{"version":3,"sources":["webpack:///0.89154e0f2714751e6227.js","webpack:///./public/app/features/templating/variable.ts","webpack:///./public/vendor/flot/jquery.flot.js","webpack:///./public/app/features/panel/panel_ctrl.ts","webpack:///./public/app/core/table_model.ts","webpack:///./public/app/plugins/datasource/elasticsearch/query_def.ts","webpack:///./public/vendor/flot/jquery.flot.time.js","webpack:///./public/app/features/plugins/plugin_loader.ts","webpack:///./public/app/plugins/panel/heatmap/heatmap_data_converter.ts","webpack:///./node_modules/rxjs/observable/EmptyObservable.js","webpack:///./node_modules/rxjs/symbol/iterator.js","webpack:///./public/app/features/panellinks/link_srv.ts","webpack:///./public/app/features/annotations/event.ts","webpack:///./public/app/features/templating/template_srv.ts","webpack:///./public/app/features/panel/query_ctrl.ts","webpack:///./public/app/core/utils/file_export.ts","webpack:///./public/app/core/utils/flatten.ts","webpack:///./public/app/core/utils/version.ts","webpack:///./public/app/plugins/datasource/cloudwatch/query_parameter_ctrl.ts","webpack:///./public/app/plugins/datasource/influxdb/influx_query.ts","webpack:///./public/app/plugins/datasource/influxdb/query_part.ts","webpack:///./public/app/plugins/datasource/influxdb/query_builder.ts","webpack:///./public/app/plugins/panel/graph/module.ts","webpack:///./public/vendor/flot/jquery.flot.selection.js","webpack:///./public/vendor/flot/jquery.flot.stack.js","webpack:///./public/vendor/flot/jquery.flot.stackpercent.js","webpack:///./public/vendor/flot/jquery.flot.fillbelow.js","webpack:///./public/vendor/flot/jquery.flot.crosshair.js","webpack:///./public/vendor/flot/jquery.flot.dashes.js","webpack:///./public/app/plugins/panel/heatmap/color_scale.ts","webpack:///./public/app/plugins/panel/table/transformers.ts","webpack:///./node_modules/rxjs/util/isArrayLike.js","webpack:///./node_modules/rxjs/util/isPromise.js","webpack:///./node_modules/rxjs/observable/ArrayObservable.js","webpack:///./node_modules/rxjs/observable/ScalarObservable.js","webpack:///./public/app/features/dashboard/folder_page_loader.ts","webpack:///./public/app/features/org/org_users_ctrl.ts","webpack:///./public/app/features/panellinks/module.ts","webpack:///./public/app/features/dashlinks/module.ts","webpack:///./public/app/features/dashlinks/editor.ts","webpack:///./public/app/features/annotations/annotations_srv.ts","webpack:///./public/app/features/annotations/editor_ctrl.ts","webpack:///./public/app/features/annotations/events_processing.ts","webpack:///./public/app/features/annotations/event_editor.ts","webpack:///./public/app/features/annotations/event_manager.ts","webpack:///./public/app/features/annotations/annotation_tooltip.ts","webpack:///./public/app/features/templating/all.ts","webpack:///./public/app/features/templating/editor_ctrl.ts","webpack:///./public/app/features/templating/variable_srv.ts","webpack:///./public/app/features/templating/builtin_variables.ts","webpack:///./public/app/features/templating/interval_variable.ts","webpack:///./public/app/features/templating/query_variable.ts","webpack:///./public/app/features/templating/datasource_variable.ts","webpack:///./public/app/features/templating/custom_variable.ts","webpack:///./public/app/features/templating/constant_variable.ts","webpack:///./public/app/features/templating/adhoc_variable.ts","webpack:///./public/app/features/plugins/all.ts","webpack:///./public/app/features/plugins/plugin_edit_ctrl.ts","webpack:///./public/app/features/plugins/plugin_page_ctrl.ts","webpack:///./public/app/features/plugins/plugin_list_ctrl.ts","webpack:///./public/app/features/plugins/import_list/import_list.ts","webpack:///./public/app/features/plugins/ds_edit_ctrl.ts","webpack:///./public/app/features/plugins/ds_dashboards_ctrl.ts","webpack:///./public/app/features/plugins/ds_list_ctrl.ts","webpack:///./public/app/features/plugins/datasource_srv.ts","webpack:///./node_modules/systemjs/dist/system.js","webpack:///./public/app/features/panel/metrics_panel_ctrl.ts","webpack:///./public/app/features/panel/metrics_tab.ts","webpack:///./public/app/features/alerting/alert_tab_ctrl.ts","webpack:///./public/app/features/alerting/threshold_mapper.ts","webpack:///./node_modules/util/util.js","webpack:///./node_modules/inherits/inherits_browser.js","webpack:///./public/app/features/plugins/built_in_plugins.ts","webpack:///./public/app/plugins/datasource/graphite/module.ts","webpack:///./public/app/plugins/datasource/graphite/datasource.ts","webpack:///./public/app/plugins/datasource/graphite/gfunc.ts","webpack:///./public/app/plugins/datasource/graphite/query_ctrl.ts","webpack:///./public/app/plugins/datasource/graphite/add_graphite_func.ts","webpack:///./public/app/plugins/datasource/graphite/func_editor.ts","webpack:///./public/app/plugins/datasource/graphite/graphite_query.ts","webpack:///./public/app/plugins/datasource/graphite/parser.ts","webpack:///./public/app/plugins/datasource/graphite/lexer.ts","webpack:///./public/app/plugins/datasource/graphite/config_ctrl.ts","webpack:///./public/app/plugins/datasource/cloudwatch/module.ts","webpack:///./public/app/plugins/datasource/cloudwatch/datasource.ts","webpack:///./public/app/plugins/datasource/cloudwatch/query_ctrl.ts","webpack:///./public/app/plugins/datasource/cloudwatch/config_ctrl.ts","webpack:///./public/app/plugins/datasource/elasticsearch/module.ts","webpack:///./public/app/plugins/datasource/elasticsearch/datasource.ts","webpack:///./public/app/plugins/datasource/elasticsearch/query_builder.ts","webpack:///./public/app/plugins/datasource/elasticsearch/index_pattern.ts","webpack:///./public/app/plugins/datasource/elasticsearch/elastic_response.ts","webpack:///./public/app/plugins/datasource/elasticsearch/query_ctrl.ts","webpack:///./public/app/plugins/datasource/elasticsearch/bucket_agg.ts","webpack:///./public/app/plugins/datasource/elasticsearch/metric_agg.ts","webpack:///./public/app/plugins/datasource/elasticsearch/config_ctrl.ts","webpack:///./public/app/plugins/datasource/opentsdb/module.ts","webpack:///./public/app/plugins/datasource/opentsdb/datasource.ts","webpack:///./public/app/plugins/datasource/opentsdb/query_ctrl.ts","webpack:///./public/app/plugins/datasource/opentsdb/config_ctrl.ts","webpack:///./public/app/plugins/datasource/grafana/module.ts","webpack:///./public/app/plugins/datasource/grafana/datasource.ts","webpack:///./public/app/plugins/datasource/influxdb/datasource.ts","webpack:///./public/app/plugins/datasource/influxdb/module.ts","webpack:///./public/app/plugins/datasource/influxdb/influx_series.ts","webpack:///./public/app/plugins/datasource/influxdb/response_parser.ts","webpack:///./public/app/plugins/datasource/influxdb/query_ctrl.ts","webpack:///./public/app/plugins/datasource/mixed/module.ts","webpack:///./public/app/plugins/datasource/mixed/datasource.ts","webpack:///./public/app/plugins/datasource/mysql/module.ts","webpack:///./public/app/plugins/datasource/mysql/datasource.ts","webpack:///./public/app/plugins/datasource/mysql/response_parser.ts","webpack:///./public/app/plugins/datasource/mysql/query_ctrl.ts","webpack:///./public/app/plugins/datasource/postgres/module.ts","webpack:///./public/app/plugins/datasource/postgres/datasource.ts","webpack:///./public/app/plugins/datasource/postgres/response_parser.ts","webpack:///./public/app/plugins/datasource/postgres/query_ctrl.ts","webpack:///./public/app/plugins/datasource/prometheus/module.ts","webpack:///./public/app/plugins/datasource/prometheus/datasource.ts","webpack:///./public/app/plugins/datasource/prometheus/metric_find_query.ts","webpack:///./public/app/plugins/datasource/prometheus/result_transformer.ts","webpack:///./public/app/plugins/datasource/prometheus/query_ctrl.ts","webpack:///./public/app/plugins/datasource/prometheus/completer.ts","webpack:///./public/app/plugins/datasource/prometheus/mode-prometheus.js","webpack:///./public/app/plugins/datasource/prometheus/snippets/prometheus.js","webpack:///./public/app/plugins/datasource/prometheus/config_ctrl.ts","webpack:///./public/app/plugins/datasource/mssql/module.ts","webpack:///./public/app/plugins/datasource/mssql/datasource.ts","webpack:///./public/app/plugins/datasource/mssql/response_parser.ts","webpack:///./public/app/plugins/datasource/mssql/query_ctrl.ts","webpack:///./public/app/plugins/panel/text/module.ts","webpack:///./public/app/plugins/panel/graph/graph.ts","webpack:///./public/app/plugins/panel/graph/jquery.flot.events.js","webpack:///./public/app/plugins/panel/graph/graph_tooltip.ts","webpack:///./public/app/plugins/panel/graph/threshold_manager.ts","webpack:///./public/app/plugins/panel/graph/histogram.ts","webpack:///./public/app/plugins/panel/graph/align_yaxes.ts","webpack:///./public/app/plugins/panel/graph/legend.ts","webpack:///./public/app/plugins/panel/graph/series_overrides_ctrl.ts","webpack:///./public/app/plugins/panel/graph/thresholds_form.ts","webpack:///./public/app/plugins/panel/graph/template.ts","webpack:///./public/app/plugins/panel/graph/data_processor.ts","webpack:///./public/app/plugins/panel/graph/axes_editor.ts","webpack:///./public/app/plugins/panel/sensor/module.ts","webpack:///./public/app/plugins/panel/dashlist/module.ts","webpack:///./public/app/plugins/panel/pluginlist/module.ts","webpack:///./public/app/plugins/panel/alertlist/module.ts","webpack:///./public/app/plugins/panel/heatmap/module.ts","webpack:///./public/app/plugins/panel/heatmap/color_legend.ts","webpack:///./public/app/plugins/panel/heatmap/heatmap_ctrl.ts","webpack:///./public/app/plugins/panel/heatmap/axes_editor.ts","webpack:///./public/app/plugins/panel/heatmap/display_editor.ts","webpack:///./public/app/plugins/panel/heatmap/rendering.ts","webpack:///./public/app/plugins/panel/heatmap/heatmap_tooltip.ts","webpack:///./public/app/plugins/panel/table/module.ts","webpack:///./public/app/plugins/panel/table/editor.ts","webpack:///./public/app/plugins/panel/table/column_options.ts","webpack:///./public/app/plugins/panel/table/renderer.ts","webpack:///./public/app/plugins/panel/singlestat/module.ts","webpack:///./public/vendor/flot/jquery.flot.gauge.js","webpack:///./public/app/plugins/panel/gettingstarted/module.ts","webpack:///./public/app/plugins/panel/experimentdetails/module.ts","webpack:///./public/app/plugins/panel/experimentvideo/module.ts","webpack:///./public/app/plugins/app/testdata/datasource/datasource.ts","webpack:///./public/app/plugins/app/testdata/module.ts","webpack:///./public/app/plugins/app/testdata/datasource/module.ts","webpack:///./public/app/plugins/app/testdata/datasource/query_ctrl.ts","webpack:///./node_modules/rxjs/Subject.js","webpack:///./node_modules/rxjs/SubjectSubscription.js","webpack:///./node_modules/rxjs/util/ObjectUnsubscribedError.js","webpack:///./node_modules/rxjs/add/observable/empty.js","webpack:///./node_modules/rxjs/add/observable/from.js","webpack:///./node_modules/rxjs/observable/from.js","webpack:///./node_modules/rxjs/observable/FromObservable.js","webpack:///./node_modules/rxjs/observable/PromiseObservable.js","webpack:///./node_modules/rxjs/observable/IteratorObservable.js","webpack:///./node_modules/rxjs/observable/ArrayLikeObservable.js","webpack:///./node_modules/rxjs/util/isScheduler.js","webpack:///./node_modules/rxjs/operators/observeOn.js","webpack:///./node_modules/rxjs/Notification.js","webpack:///./node_modules/rxjs/operators/map.js","webpack:///./node_modules/rxjs/add/operator/map.js","webpack:///./node_modules/rxjs/operator/map.js","webpack:///./node_modules/rxjs/operator/combineAll.js","webpack:///./node_modules/rxjs/operators/combineAll.js","webpack:///./node_modules/rxjs/operators/combineLatest.js","webpack:///./node_modules/rxjs/OuterSubscriber.js","webpack:///./node_modules/rxjs/util/subscribeToResult.js","webpack:///./node_modules/rxjs/InnerSubscriber.js","webpack:///./public/vendor/flot/jquery.flot.pie.js","webpack:///./public/app/features/plugins/plugin_component.ts","webpack:///./public/app/plugins/panel/unknown/module.ts","webpack:///./public/app/features/dashboard/all.ts","webpack:///./public/app/features/dashboard/dashboard_ctrl.ts","webpack:///./public/app/features/dashboard/alerting_srv.ts","webpack:///./public/app/features/dashboard/history/history.ts","webpack:///./public/app/features/dashboard/dashboard_loader_srv.ts","webpack:///./public/app/features/dashboard/history/history_srv.ts","webpack:///./public/app/features/dashboard/dashnav/dashnav.ts","webpack:///./public/app/features/dashboard/save_as_modal.ts","webpack:///./public/app/features/dashboard/submenu/submenu.ts","webpack:///./public/app/features/dashboard/save_modal.ts","webpack:///./public/app/features/dashboard/save_provisioned_modal.ts","webpack:///./public/app/features/dashboard/shareModalCtrl.ts","webpack:///./public/app/features/dashboard/share_snapshot_ctrl.ts","webpack:///./public/app/features/dashboard/dashboard_srv.ts","webpack:///./public/app/features/dashboard/view_state_srv.ts","webpack:///./public/app/features/dashboard/time_srv.ts","webpack:///./public/app/features/dashboard/validation_srv.ts","webpack:///./public/app/features/dashboard/unsaved_changes_srv.ts","webpack:///./public/app/features/dashboard/change_tracker.ts","webpack:///./public/app/features/dashboard/unsaved_changes_modal.ts","webpack:///./public/app/features/dashboard/timepicker/timepicker.ts","webpack:///./public/app/features/dashboard/upload.ts","webpack:///./public/app/features/dashboard/timepicker/input_date.ts","webpack:///./public/app/features/dashboard/export/export_modal.ts","webpack:///./public/app/features/dashboard/export/exporter.ts","webpack:///./public/app/features/dashboard/export_data/export_data_modal.ts","webpack:///./public/app/features/dashboard/export_experiment/export_experiment_modal.ts","webpack:///./public/app/features/dashboard/ad_hoc_filters.ts","webpack:///./public/app/features/dashboard/dashgrid/DashboardGrid.tsx","webpack:///./public/app/features/dashboard/repeat_option/repeat_option.ts","webpack:///./public/app/features/dashboard/dashgrid/DashboardGridDirective.ts","webpack:///./public/app/features/dashboard/dashgrid/DashboardPanel.tsx","webpack:///./public/app/features/dashboard/dashgrid/DashboardRow.tsx","webpack:///./public/app/features/dashboard/dashgrid/AddPanelPanel.tsx","webpack:///./public/app/core/components/ScrollBar/ScrollBar.tsx","webpack:///./public/app/features/dashboard/dashgrid/PanelLoader.ts","webpack:///./public/app/features/dashboard/dashgrid/RowOptions.ts","webpack:///./public/app/features/dashboard/folder_picker/folder_picker.ts","webpack:///./public/app/features/dashboard/settings/settings.ts","webpack:///./public/app/features/dashboard/move_to_folder_modal/move_to_folder.ts","webpack:///./public/app/features/dashboard/folder_settings_ctrl.ts","webpack:///./public/app/features/dashboard/dashboard_list_ctrl.ts","webpack:///./public/app/features/dashboard/folder_dashboards_ctrl.ts","webpack:///./public/app/features/dashboard/dashboard_import_ctrl.ts","webpack:///./public/app/features/dashboard/create_folder_ctrl.ts","webpack:///./public/app/features/experiments/all.ts","webpack:///./public/app/features/experiments/experiment_create_ctrl.ts","webpack:///./public/app/features/experiments/experiment_edit_ctrl.ts","webpack:///./public/app/features/experiments/experiment_folder_create_ctrl.ts","webpack:///./public/app/features/experiments/experiment_folder_edit_ctrl.ts","webpack:///./public/app/features/sensors/all.ts","webpack:///./public/app/features/sensors/sensor_edit_ctrl.ts","webpack:///./public/app/features/sensors/sensor_create_ctrl.ts","webpack:///./public/app/features/sensors/sensor_bind_ctrl.ts","webpack:///./public/app/features/sensors/delete_sensor_modal.ts","webpack:///./public/app/features/playlist/all.ts","webpack:///./public/app/features/playlist/playlists_ctrl.ts","webpack:///./public/app/features/playlist/playlist_search.ts","webpack:///./public/app/features/playlist/playlist_srv.ts","webpack:///./public/app/features/playlist/playlist_edit_ctrl.ts","webpack:///./public/app/features/playlist/playlist_routes.ts","webpack:///./public/app/features/snapshot/snapshot_ctrl.ts","webpack:///./public/app/features/panel/all.ts","webpack:///./public/app/features/panel/panel_header.ts","webpack:///./public/app/features/panel/panel_directive.ts","webpack:///./public/app/features/panel/solo_panel_ctrl.ts","webpack:///./public/app/features/panel/panel_editor_tab.ts","webpack:///./public/app/features/panel/query_editor_row.ts","webpack:///./public/app/features/panel/query_troubleshooter.ts","webpack:///./public/app/features/org/select_org_ctrl.ts","webpack:///./public/app/features/org/all.ts","webpack:///./public/app/features/org/profile_ctrl.ts","webpack:///./public/app/features/org/change_password_ctrl.ts","webpack:///./public/app/features/org/new_org_ctrl.ts","webpack:///./public/app/features/org/user_invite_ctrl.ts","webpack:///./public/app/features/org/teams_ctrl.ts","webpack:///./public/app/features/org/team_details_ctrl.ts","webpack:///./public/app/features/org/create_team_ctrl.ts","webpack:///./public/app/features/org/org_api_keys_ctrl.ts","webpack:///./public/app/features/org/org_details_ctrl.ts","webpack:///./public/app/features/org/prefs_control.ts","webpack:///./public/app/features/admin/admin.ts","webpack:///./public/app/features/admin/admin_list_users_ctrl.ts","webpack:///./public/app/features/admin/admin_list_orgs_ctrl.ts","webpack:///./public/app/features/admin/admin_edit_org_ctrl.ts","webpack:///./public/app/features/admin/admin_edit_user_ctrl.ts","webpack:///./public/app/features/admin/admin_list_experiments_ctrl.ts","webpack:///./public/app/features/alerting/all.ts","webpack:///./public/app/features/alerting/notifications_list_ctrl.ts","webpack:///./public/app/features/alerting/notification_edit_ctrl.ts","webpack:///./public/app/features/styleguide/styleguide.ts","webpack:///./public/app/features/upload/upload.ts"],"names":["webpackJsonp","1982","module","__webpack_exports__","__webpack_require__","Object","defineProperty","value","1983","__WEBPACK_IMPORTED_MODULE_0_app_features_panel_panel_ctrl__","__WEBPACK_IMPORTED_MODULE_1_app_features_panel_metrics_panel_ctrl__","__WEBPACK_IMPORTED_MODULE_2_app_features_panel_query_ctrl__","__WEBPACK_IMPORTED_MODULE_3_app_features_alerting_alert_tab_ctrl__","__WEBPACK_IMPORTED_MODULE_4_app_features_plugins_plugin_loader__","d","1984","containsVariable","args","_i","arguments","length","variableName","str","i","__WEBPACK_IMPORTED_MODULE_0_app_core_utils_kbn__","regexEscape","RegExp","exec","variableTypes","__WEBPACK_IMPORTED_MODULE_1_app_core_utils_model_utils__","1985","exports","$","color","make","r","g","b","a","o","add","c","charAt","normalize","scale","f","toString","join","clamp","min","max","parseInt","clone","extract","elem","css","toLowerCase","parent","nodeName","get","parse","res","m","parseFloat","name","trim","lookupColors","aqua","azure","beige","black","blue","brown","cyan","darkblue","darkcyan","darkgrey","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkviolet","fuchsia","gold","green","indigo","khaki","lightblue","lightcyan","lightgreen","lightgrey","lightpink","lightyellow","lime","magenta","maroon","navy","olive","orange","pink","purple","violet","red","silver","white","yellow","jQuery","Canvas","cls","container","element","children","document","createElement","className","direction","position","left","top","appendTo","getContext","window","G_vmlCanvasManager","Error","initElement","this","context","devicePixelRatio","backingStoreRatio","webkitBackingStorePixelRatio","mozBackingStorePixelRatio","msBackingStorePixelRatio","oBackingStorePixelRatio","backingStorePixelRatio","pixelRatio","resize","width","height","textContainer","text","_textCache","_textSizeCache","flotTextSizeCache","Plot","placeholder","data_","options_","plugins","executeHooks","hook","plot","concat","apply","setData","series","parseData","fillInSeriesOptions","processData","s","extend","options","data","push","axisNumber","obj","coord","n","allAxes","grep","xaxes","yaxes","canvasToAxisCoords","pos","axis","used","c2p","undefined","x1","x","y1","y","axisToCanvasCoords","key","p2c","getOrCreateAxis","axes","number","xaxis","yaxis","neededColors","maxIndex","sc","colors","colorPool","colorPoolSize","variation","colori","lines","show","v","zero","fill","updateAxis","datamin","fakeInfinity","datamax","j","k","points","ps","val","p","format","topSentry","Number","POSITIVE_INFINITY","bottomSentry","NEGATIVE_INFINITY","MAX_VALUE","each","_","datapoints","hooks","processRawData","required","bars","autoscale","defaultValue","horizontal","pointsize","insertSteps","steps","nullify","isNaN","Infinity","transform","processDatapoints","xmin","ymin","xmax","ymax","delta","align","barWidth","shutdown","redrawTimeout","clearTimeout","eventHolder","unbind","onMouseMove","onMouseLeave","onClick","setTransformationHelpers","identity","t","it","inverseTransform","plotWidth","Math","abs","plotHeight","measureTickLabels","opts","ticks","labelWidth","labelHeight","maxWidth","floor","surface","legacyStyles","layer","font","label","info","getTextInfo","allocateAxisBoxFirstPhase","lw","lh","isXAxis","tickLength","axisMargin","grid","padding","labelMargin","eventSectionPadding","eventSectionHeight","innermost","outermost","first","found","reserveSpace","plotOffset","bottom","box","right","allocateAxisBoxSecondPhase","adjustLayoutForThingsStickingOut","minMargin","minBorderMargin","radius","lineWidth","margins","ceil","setupGrid","showGrid","margin","processOffset","borderWidth","axisOpts","setRange","processRange","allocatedAxes","snaped","setupTickGeneration","setTicks","snapRangeToTicks","drawAxisLabels","insertLegend","widen","autoscaleMargin","noTicks","sqrt","dec","log","LN10","maxDec","tickDecimals","size","magn","pow","norm","minTickSize","tickSize","scaledDecimals","mode","tickGenerator","prev","start","floorInBase","NaN","tickFormatter","factor","formatted","round","decimal","indexOf","precision","substr","isFunction","alignTicksWithAxis","otherAxis","niceTicks","extraDec","ts","test","toFixed","oticks","changed","draw","clear","drawBackground","ctx","backgroundColor","aboveData","drawGrid","drawSeries","render","triggerRedrawOverlay","extractRange","ranges","from","to","tmp","save","translate","fillStyle","getColorOrGradient","fillRect","restore","bw","bc","markings","getAxes","xrange","yrange","xequal","yequal","markingsLineWidth","subPixel","beginPath","strokeStyle","markingsColor","moveTo","lineTo","stroke","xoff","yoff","tickColor","borderColor","strokeRect","tick","halign","valign","removeText","addText","drawSeriesLines","drawSeriesBars","drawSeriesPoints","plotLine","xoffset","yoffset","axisx","axisy","prevx","prevy","x2","y2","lineJoin","sw","shadowSize","angle","PI","sin","cos","getFillStyle","areaOpen","ypos","segmentStart","segmentEnd","x1old","x2old","plotPoints","offset","shadow","symbol","arc","closePath","w","drawBar","barLeft","barRight","fillStyleCallback","drawLeft","drawRight","drawTop","drawBottom","filloptions","seriesColor","fillColor","legend","html","find","remove","fragments","entries","rowStarted","lf","labelFormatter","sorted","sort","reverse","ascending","entry","noColumns","labelBoxBorderColor","table","replace","backgroundOpacity","div","prependTo","findNearbyItem","mouseX","mouseY","seriesFilter","maxDistance","mouseActiveRadius","smallestDistance","item","mx","my","maxx","maxy","dx","dy","dist","datapoint","slice","dataIndex","seriesIndex","e","hoverable","triggerClickHoverEvent","isSelecting","eventname","event","canvasX","pageX","canvasY","pageY","ctrlKey","metaKey","autoHighlight","highlights","h","auto","point","unhighlight","highlight","trigger","interaction","redrawOverlayInterval","drawOverlay","setTimeout","octx","overlay","hi","drawBarHighlight","drawPointHighlight","indexOfHighlight","splice","highlightColor","pointRadius","spec","defaultColor","gradient","createLinearGradient","l","co","brightness","opacity","addColorStop","clickable","processOptions","bindEvents","getPlaceholder","getCanvas","getPlotOffset","getData","getXAxes","getYAxes","getOptions","pointOffset","destroy","removeData","empty","classes","init","axisOptions","axisCount","fontSize","fontSizeDefault","fontDefaults","style","variant","weight","family","lineHeight","x2axis","y2axis","coloredAreas","coloredAreasColor","existing","mousemove","bind","click","base","hasOwnProperty","prototype","fn","detach","parentNode","removeChild","clearRect","cache","layerKey","call","getTextLayer","layerCache","hide","styleKey","styleCache","positions","active","rendered","append","font-size","insertAfter","addClass","textStyle","max-width","outerWidth","outerHeight","text-align","version","1986","PanelCtrl","__WEBPACK_IMPORTED_MODULE_0_app_core_config__","__WEBPACK_IMPORTED_MODULE_1_lodash__","__WEBPACK_IMPORTED_MODULE_1_lodash___default","__WEBPACK_IMPORTED_MODULE_2_jquery__","__WEBPACK_IMPORTED_MODULE_2_jquery___default","__WEBPACK_IMPORTED_MODULE_3_app_core_core__","__WEBPACK_IMPORTED_MODULE_4_app_features_dashboard_panel_model__","__WEBPACK_IMPORTED_MODULE_5_remarkable__","__WEBPACK_IMPORTED_MODULE_5_remarkable___default","__WEBPACK_IMPORTED_MODULE_6_app_core_constants__","__WEBPACK_IMPORTED_MODULE_7_app_core_store__","$scope","$injector","_this","$location","$timeout","editorTabIndex","events","panel","timing","plugin","panels","type","pluginId","id","pluginName","$on","refresh","panelDidMount","emit","removeAllListeners","publishAppEvent","scope","renderingCompleted","evtName","evt","$root","appEvent","changeView","fullscreen","edit","panelId","viewPanel","editPanel","exitFullscreen","initEditMode","editorTabs","addEditorTab","editModeInitiated","urlTab","tab","forEach","title","changeTab","newIndex","route","current","params","updateParams","directiveFn","index","editorTab","isString","templateUrl","getMenu","menu","icon","shortcut","dashboard","meta","canEdit","role","getAdditionalMenuItems","extendedMenu","getExtendedMenu","submenu","divider","otherPanelInFullscreenMode","calculatePanelHeight","docHeight","editHeight","fullscreenHeight","containerHeight","editMode","gridPos","soloMode","payload","renderStart","Date","getTime","duplicate","duplicatePanel","$broadcast","removePanel","editPanelJson","editScope","$new","object","getSaveModel","updateHandler","replacePanel","enableCopy","src","copyPanel","set","JSON","stringify","newPanel","oldPanel","findIndex","deletedPanel","sortPanelsByGridPos","sharePanel","shareScope","getInfoMode","error","description","links","getInfoContent","markdown","linkSrv","sanitize","templateSrv","interpolatedMarkdown","scopedVars","_a","link","getPanelLinkAnchorInfo","href","target","openInspector","modalScope","panelInfoHtml","inspector","titleChanged","hasCustomTitle","1987","TableModel","columns","columnMap","rows","col","desc","addColumn","addRow","row","1988","getMetricAggTypes","esVersion","__WEBPACK_IMPORTED_MODULE_0_lodash___default","filter","metricAggTypes","minVersion","getPipelineOptions","metric","isPipelineAgg","pipelineOptions","metricType","po","getPipelineAggOptions","targets","result","metrics","describeMetric","getMovingAvgSettings","model","filtered","filteredResult","movingAvgModelSettings","setting","isCheckbox","getOrderByOptions","metricRefs","orderByOptions","describeOrder","order","orderOptions","field","describeOrderBy","orderBy","def","bucketAggTypes","sizeOptions","extendedStats","intervalOptions","movingAvgModelOptions","__WEBPACK_IMPORTED_MODULE_0_lodash__","requiresField","supportsInlineScript","supportsMissing","moving_avg","default","derivative","simple","linear","ewma","holt","holt_winters","1989","formatDate","fmt","monthNames","dayNames","strftime","leftPad","pad","escape","hours","getHours","isAM","hours12","getDay","getMonth","getDate","getMinutes","getSeconds","getFullYear","makeUtcWrapper","addProxyMethod","sourceObj","sourceMethod","targetObj","targetMethod","utc","date","props","dateGenerator","timezone","timezoneJS","setTimezone","setTime","axisName","minSize","specQuarters","specMonths","timeUnitSize","unit","year","step","setSeconds","setMinutes","setHours","setMonth","setFullYear","setMilliseconds","minute","hour","day","setDate","month","quarter","carry","end","timeformat","useQuarters","span","suffix","hourCode","twelveHourClock","second","baseSpec","1990","locate","load","address","bust","exposeToPlugin","component","__WEBPACK_IMPORTED_MODULE_0_systemjs_dist_system_js___default","registerDynamic","require","importPluginModule","path","builtIn","__WEBPACK_IMPORTED_MODULE_22__built_in_plugins__","Promise","resolve","import","loadPluginCss","__WEBPACK_IMPORTED_MODULE_13_app_core_config__","bootData","user","lightTheme","light","dark","__WEBPACK_IMPORTED_MODULE_0_systemjs_dist_system_js__","__WEBPACK_IMPORTED_MODULE_2_app_plugins_sdk__","__WEBPACK_IMPORTED_MODULE_3_app_core_utils_kbn__","__WEBPACK_IMPORTED_MODULE_4_moment__","__WEBPACK_IMPORTED_MODULE_4_moment___default","__WEBPACK_IMPORTED_MODULE_5_angular__","__WEBPACK_IMPORTED_MODULE_5_angular___default","__WEBPACK_IMPORTED_MODULE_6_jquery__","__WEBPACK_IMPORTED_MODULE_6_jquery___default","__WEBPACK_IMPORTED_MODULE_7_prismjs__","__WEBPACK_IMPORTED_MODULE_7_prismjs___default","__WEBPACK_IMPORTED_MODULE_8_slate__","__WEBPACK_IMPORTED_MODULE_9_slate_react__","__WEBPACK_IMPORTED_MODULE_10_slate_plain_serializer__","__WEBPACK_IMPORTED_MODULE_11_react__","__WEBPACK_IMPORTED_MODULE_11_react___default","__WEBPACK_IMPORTED_MODULE_12_react_dom__","__WEBPACK_IMPORTED_MODULE_12_react_dom___default","__WEBPACK_IMPORTED_MODULE_14_app_core_time_series2__","__WEBPACK_IMPORTED_MODULE_15_app_core_table_model__","__WEBPACK_IMPORTED_MODULE_16_app_core_core__","__WEBPACK_IMPORTED_MODULE_17_app_core_utils_datemath__","__WEBPACK_IMPORTED_MODULE_18_app_core_utils_file_export__","__WEBPACK_IMPORTED_MODULE_19_app_core_utils_flatten__","__WEBPACK_IMPORTED_MODULE_20_app_core_utils_ticks__","__WEBPACK_IMPORTED_MODULE_21_app_core_services_impression_srv__","__WEBPACK_IMPORTED_MODULE_23_d3__","__WEBPACK_IMPORTED_MODULE_24_rxjs_Observable__","__WEBPACK_IMPORTED_MODULE_25_rxjs_Subject__","__WEBPACK_IMPORTED_MODULE_26_rxjs_add_observable_empty__","__WEBPACK_IMPORTED_MODULE_27_rxjs_add_observable_from__","__WEBPACK_IMPORTED_MODULE_28_rxjs_add_operator_map__","__WEBPACK_IMPORTED_MODULE_29_rxjs_add_operator_combineAll__","__WEBPACK_IMPORTED_MODULE_30_vendor_flot_jquery_flot__","__WEBPACK_IMPORTED_MODULE_31_vendor_flot_jquery_flot_selection__","__WEBPACK_IMPORTED_MODULE_32_vendor_flot_jquery_flot_time__","__WEBPACK_IMPORTED_MODULE_33_vendor_flot_jquery_flot_stack__","__WEBPACK_IMPORTED_MODULE_34_vendor_flot_jquery_flot_pie__","__WEBPACK_IMPORTED_MODULE_35_vendor_flot_jquery_flot_stackpercent__","__WEBPACK_IMPORTED_MODULE_36_vendor_flot_jquery_flot_fillbelow__","__WEBPACK_IMPORTED_MODULE_37_vendor_flot_jquery_flot_crosshair__","__WEBPACK_IMPORTED_MODULE_38_vendor_flot_jquery_flot_dashes__","now","registry","newModule","config","baseURL","defaultExtension","packages","map","plugin*","esModule","authorization","loader","Subject","Observable","impressions","__esModule","coreModule","appEvents","contextSrv","flotDeps","flotDeps_1","fakeDep","1991","histogramToHeatmap","seriesList","heatmap","bound","count","VALUE_INDEX","time","TIME_INDEX","isNumber","bucket","buckets","bounds","values","sortSeriesByLabel","s1","s2","label1","label2","parseHistogramLabel","err","console","message","convertToCards","cards","xBucket","yBucket","card","yBounds","cardStats","mergeZeroBuckets","minValue","yBuckets","emptyBucket","nullBucket","minBucket","newBucket","convertToHeatMap","yBucketSize","xBucketSize","logBase","seriesList_1","seriesName","bucketBound","getBucketBound","pushToXBuckets","convertToLogScaleValueBuckets","convertToValueBuckets","bucketNum","point_ext","pushToYBuckets","getValueBucketBound","getLogScaleBucketBound","getBucketBounds","bucketSize","getLogScaleBucketBounds","yBucketSplitFactor","powTop","value_log","logp","additional_bucket_size","additional_log","calculateBucketSize","sortBy","distance","getDistance","1992","__extends","__","constructor","create","Observable_1","EmptyObservable","_super","scheduler","dispatch","arg","subscriber","complete","_subscribe","schedule","1993","symbolIteratorPonyfill","root","Symbol","iterator","Set_1","Set","Map_1","Map","keys","getOwnPropertyNames","root_1","$$iterator","1994","__WEBPACK_IMPORTED_MODULE_0_angular__","__WEBPACK_IMPORTED_MODULE_0_angular___default","__WEBPACK_IMPORTED_MODULE_2_app_core_utils_kbn__","LinkSrv","timeSrv","$inject","getLinkUrl","url","keepTime","range","timeRangeForUrl","includeVars","fillVariableValuesForUrl","addParamsToUrl","paramsArray","isArray","instance","encodeURIComponent","appendToQueryString","stringToAppend","isUndefined","getAnchorInfo","targetBlank","dashUri","slug","slugifyForUrl","service","1995","__WEBPACK_IMPORTED_MODULE_2__event_manager__","1996","AnnotationEvent","1997","luceneEscape","TemplateSrv","regex","grafanaVariables","builtIns","variables","updateTemplateData","variable","isNone","variableInitialized","getAdhocFilters","datasourceName","filters","datasource","luceneFormat","Array","formatValue","escapedValues","distributeVariable","setGrafanaVariable","getVariableName","expression","lastIndex","match","variableExists","highlightVariablesAsHtml","var1","var2","fmt2","var3","getAllValue","allValue","systemValue","fmt3","isAllValue","replaceWithText","option","getValueForUrl","1998","QueryCtrl","panelCtrl","isLastQuery","1999","csvEscaped","split","QUOTE","htmlDecoded","domParser","parseFromString","body","textContent","regexp","formatSpecialHeader","useExcelHeader","END_COLUMN","END_ROW","formatRow","addEndRowDelimiter","__WEBPACK_IMPORTED_MODULE_3_util__","toLocaleString","convertSeriesListToCsv","dateTimeFormat","excel","DEFAULT_DATETIME_FORMAT","alias","__WEBPACK_IMPORTED_MODULE_1_moment___default","POINT_TIME_INDEX","POINT_VALUE_INDEX","exportSeriesListToCsv","saveSaveBlob","EXPORT_FILENAME","convertSeriesListToCsvColumns","mergeSeriesByTime","timestamp","timestamps","seriesPoints","seriesTimestamps","extendedSeries","pointIndex","exportSeriesListToCsvColumns","convertTableDataToCsv","exportTableDataToCsv","fname","blob","Blob","__WEBPACK_IMPORTED_MODULE_2_file_saver__","__WEBPACK_IMPORTED_MODULE_1_moment__","DOMParser","2000","flatten","isarray","safe","isobject","newKey","delimiter","maxDepth","currentDepth","output","2001","isVersionGtOrEq","SemVersion","isGtOrEq","versionPattern","major","minor","patch","compared","isValid","2002","CloudWatchQueryParameter","controller","restrict","onChange","CloudWatchQueryParameterCtrl","uiSegmentSrv","datasourceSrv","$q","namespace","metricName","statistics","dimensions","period","region","highResolution","regionSegment","getSegmentForValue","namespaceSegment","metricSegment","dimSegments","reduce","memo","newOperator","newKeyValue","statSegments","stat","ensurePlusButton","removeDimSegment","newSegment","fake","removeStatSegment","isEmpty","getStatSegments","when","copy","standardStatistics","statSegmentChanged","segment","seg","segments","lastSegment","newPlusButton","getDimSegments","$index","query","getDimensionKeys","dimensionKey","getDimensionValues","then","transformToSegments","results","dimSegmentChanged","newFake","cssClass","syncDimSegmentsWithModel","dims","keySegment","valueSegment","getRegions","metricFindQuery","unshift","getNamespaces","getMetrics","regionChanged","namespaceChanged","metricChanged","addTemplateVars","expandable","directive","2003","__WEBPACK_IMPORTED_MODULE_1__query_part__","InfluxQuery","policy","resultFormat","orderByTime","tags","groupBy","select","updateProjection","selectModels","parts","groupByParts","updatePersistedParts","selectParts","part","hasGroupByTime","hasFill","addGroupBy","stringParts","typePart","partModel","partCount","removeGroupByPart","categories","getCategories","category","Aggregations","Selectors","removeSelect","removeSelectPart","modelsIndex","partIndex","addSelectPart","addStrategy","renderTagCondition","tag","interpolate","operator","condition","getMeasurementAndPolicy","measurement","interpolateQueryStr","defaultFormatFn","multi","includeAll","rawQuery","selectText","conditions","groupBySection","limit","slimit","renderAdhocFilters","2004","createPart","__WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__","register","aliasRenderer","innerExpr","fieldRenderer","replaceAggregationAddStrategy","morePartsAvailable","addTransformationStrategy","Aliasing","addMathStrategy","addAliasStrategy","addFieldStrategy","Transformations","Predictors","Fields","groupByTimeFunctions","dynamicLookup","defaultParams","renderer","quote","renderMode","replaceAggregationAdd","2005","InfluxQueryBuilder","database","buildExploreQuery","withKey","withMeasurementFilter","whereConditions","2006","GraphCtrl","__WEBPACK_IMPORTED_MODULE_4__template__","__WEBPACK_IMPORTED_MODULE_5_lodash__","__WEBPACK_IMPORTED_MODULE_5_lodash___default","__WEBPACK_IMPORTED_MODULE_6_app_core_config__","__WEBPACK_IMPORTED_MODULE_7_app_plugins_sdk__","__WEBPACK_IMPORTED_MODULE_8__data_processor__","__WEBPACK_IMPORTED_MODULE_9__axes_editor__","extendStatics","setPrototypeOf","__proto__","annotationsSrv","hiddenSeries","dataList","annotations","panelDefaults","alignLevel","linewidth","dashes","dashLength","spaceLength","pointradius","stack","percentage","total","avg","nullPointMode","steppedLine","tooltip","value_type","shared","timeFrom","timeShift","aliasColors","seriesOverrides","thresholds","defaults","processor","on","onRender","onDataReceived","onDataError","onDataSnapshotLoad","onInitEditMode","onInitPanelActions","alertingEnabled","subTabIndex","actions","issueQueries","annotationsPromise","getAnnotations","zoomOut","snapshotData","getSeriesList","dataWarning","tip","isOutsideRange","loading","alertState","applySeriesOverrides","changeSeriesColor","setColor","toggleSeries","serie","shiftKey","toggleSeriesExclusiveMode","hidden","every","toggleAxis","override","addSeriesOverride","removeSeriesOverride","without","toggleLegend","joeMode","prompt","slowMode","enabled","stepCount","legendValuesOptionChanged","exportCsv","templateHtml","modalClass","template","2007","selection","updateSelection","getSelection","onMouseDown","which","focus","onselectstart","savedhandlers","ondrag","setSelectionPos","mouseUpHandler","onMouseUp","one","selectionIsSane","triggerSelectedEvent","c1","c2","anyUsed","p1","p2","clearSelection","preventEvent","setSelection","mousedown","shape","2008","findMatchingSeries","allseries","stackData","other","px","py","intery","qx","qy","otherps","otherpoints","newpoints","withlines","withbottom","withsteps","keyOffset","accumulateOffset","fromgap","2009","processed","stackSums","getStackSums","stackpercent","num","percents","key_idx","value_idx","sum","_data","data_len","sums","newPoints","stackBases","2010","findBelowSeries","fillBelowTo","segmentIntersection","top_left_x","top_left_y","top_right_x","top_right_y","bottom_left_x","bottom_left_y","bottom_right_x","bottom_right_y","top_delta_x","top_delta_y","bottom_delta_x","bottom_delta_y","plotDifferenceArea","openPolygon","closePolygon","findNextStart","start_i","end_i","assert","intersect","equal","intersectionPoint","topTraversal","right_i","bottomTraversal","otherseries","2011","onMouseOut","crosshair","locked","setCrosshair","clearCrosshair","lockCrosshair","unlockCrosshair","mouseout","adj","drawX","drawY","2012","plotDashes","dashOnLength","dashOffLength","dashRemainder","dashOn","dashOffset","ax1","ay1","ax2","ay2","segmentLength","deltaX","deltaY","remainder","xsign","ysign","2013","getColorScale","colorScheme","maxValue","colorInterpolator","__WEBPACK_IMPORTED_MODULE_1_d3_scale_chromatic__","colorScaleInverted","invert","__WEBPACK_IMPORTED_MODULE_0_d3__","domain","getOpacityScale","legendOpacityScale","colorScale","exponent","2014","transformDataToTable","__WEBPACK_IMPORTED_MODULE_3__core_table_model__","transformer","transformers","__WEBPACK_IMPORTED_MODULE_1__core_utils_flatten__","__WEBPACK_IMPORTED_MODULE_2__core_time_series2__","getColumns","dp","timeKey","getFlotPairs","cells","stats","columnNames","acc","areRowsMatching","otherRow","foundFieldToMatch","columnIndex","noTableIndex","String","fromCharCode","columnsUnion","columnIndexMapper","flattenedRows","mapper","alteredRow","mergedRows","compactedRows","rowIndex","matchedRow","names","maxDocs","doc","flattened","propName","z","column","tableCol","filterable","isObject","2015","isArrayLike","2016","isPromise","subscribe","2017","ScalarObservable_1","EmptyObservable_1","isScheduler_1","ArrayObservable","array","_isScalar","of","isScheduler","pop","len","ScalarObservable","state","next","closed","2018","done","2019","FolderPageLoader","backendSrv","ctrl","uid","activeChildId","navModel","main","subTitle","breadcrumbs","getFolderByUid","folder","folderId","folderTitle","folderUrl","dashTab","child","canAdmin","2020","__WEBPACK_IMPORTED_MODULE_1_app_core_core_module__","__WEBPACK_IMPORTED_MODULE_2_remarkable__","__WEBPACK_IMPORTED_MODULE_2_remarkable___default","__WEBPACK_IMPORTED_MODULE_3_lodash__","__WEBPACK_IMPORTED_MODULE_3_lodash___default","OrgUsersCtrl","navModelSrv","$sce","getNav","externalUserMngLinkUrl","externalUserMngLinkName","canInvite","disableLoginForm","externalUserMngInfo","linkTarget","users","unfiltered","pendingInvites","onQueryUpdated","searchQuery","email","login","updateOrgUser","userId","removeUser","yesText","onConfirm","removeUserConfirmed","delete","revokeInvite","invite","stopPropagation","code","copyInviteToClipboard","getInviteUrl","2040","panelLinksEditor","PanelLinksEditorCtrl","addLink","searchDashboards","queryStr","callback","search","hits","dashboards","dash","dashboardChanged","uri","deleteLink","2041","dashLinksContainer","dashLink","$compile","$sanitize","update","linkInfo","asDropdown","anchor","attr","sanitizeAnchor","anchorSanitized","contents","$last","__WEBPACK_IMPORTED_MODULE_2__editor__","DashLinksContainerCtrl","$rootScope","dashboardSrv","buildLinks","linkDef","updateDashLinks","promises","all","generatedLinks","currentDashId","getCurrent","fillDropdown","hit","searchHits","onAppEvent","2042","dashLinksEditor","DashLinkEditorCtrl","bindToController","controllerAs","iconMap","external link","question","bolt","cloud","backToList","setupNew","editLink","saveLink","moveLink","dir","move","updateSubmenuVisibility","2043","__WEBPACK_IMPORTED_MODULE_1_angular__","__WEBPACK_IMPORTED_MODULE_1_angular___default","__WEBPACK_IMPORTED_MODULE_2_lodash__","__WEBPACK_IMPORTED_MODULE_2_lodash___default","__WEBPACK_IMPORTED_MODULE_3_app_core_core_module__","__WEBPACK_IMPORTED_MODULE_4__events_processing__","AnnotationsSrv","clearCache","globalAnnotationsPromise","alertStatesPromise","getGlobalAnnotations","getAlertStates","flattenDeep","source","catch","alert","raw","dashboardId","timeRange","this_1","list","annotation","state_1","enable","translateQueryResult","annotationQuery","rangeRaw","snapshot","saveAnnotationEvent","post","updateAnnotationEvent","put","deleteAnnotationEvent","deleteUrl","isRegion","regionId","results_1","2044","AnnotationsEditorCtrl","annotationDefaults","iconColor","showIn","showOptions","datasources","getAnnotationSources","reset","onColorChange","datasourceChanged","currentAnnotation","ds","currentDatasource","currentIsNew","removeAnnotation","newColor","2045","makeRegions","partition","regionEvents","singleEvents","regions","region_events","compact","region_obj","head","timeEnd","isStartOfRegion","valueOf","dedupAnnotations","dedup","eventsById","eventGroup","isPanelAlert","eventType","2046","tryEpochToMoment","epoch","eventEditor","EventEditorCtrl","close","__WEBPACK_IMPORTED_MODULE_2_app_core_core__","timeFormated","form","$valid","saveModel","cloneDeep","2047","addRegionMarking","flotOptions","__WEBPACK_IMPORTED_MODULE_4_app_core_utils_colors__","addAlphaToRGB","colorString","alpha","__WEBPACK_IMPORTED_MODULE_2_tinycolor2___default","setAlpha","toRgbString","EventManager","__WEBPACK_IMPORTED_MODULE_2_tinycolor2__","__WEBPACK_IMPORTED_MODULE_3__event__","editorClosed","editorOpen","editorOpened","updateTime","editEvent","addFlotEvents","types","$__alerting","markerSize","$__ok","$__no_data","$__editing","editModel","newState","levels","manager","2048","annotationTooltipDirective","sanitizeString","formatTZeroTime","onEdit","getColor","tagText","titleStateClass","alertId","stateModel","__WEBPACK_IMPORTED_MODULE_3__alerting_alert_def__","getStateDisplayModel","stateClass","iconClass","getAlertAnnotationInfo","currentEventX","eventBundle","header","avatarUrl","__WEBPACK_IMPORTED_MODULE_1_jquery___default","__WEBPACK_IMPORTED_MODULE_1_jquery__","__WEBPACK_IMPORTED_MODULE_2_app_core_core_module__","2049","__WEBPACK_IMPORTED_MODULE_2__template_srv__","factory","2050","__WEBPACK_IMPORTED_MODULE_2__variable__","__WEBPACK_IMPORTED_MODULE_3_app_core_app_events__","VariableEditorCtrl","variableSrv","namePattern","optionsLimit","refreshOptions","sortOptions","hideOptions","$watch","setMode","addVariable","sameName","validate","infoText","getTagKeys","runQuery","updateOptions","createVariableFromModel","getMetricSources","mixed","datasourceTypes","uniqBy","typeChanged","old","oldIndex","removeVariable","showMoreOptions","2051","__WEBPACK_IMPORTED_MODULE_2__core_core_module__","__WEBPACK_IMPORTED_MODULE_3__variable__","__WEBPACK_IMPORTED_MODULE_4__builtin_variables__","VariableSrv","$routeParams","onDashboardRefresh","updateUrlParamsWithCurrentVariables","hasVariable","templating","isSnapshot","initLock","defer","queryParams","processVariable","previousOptions","toJson","$emit","dependencies","otherVariable","dependsOn","promise","experimentId","setValueFromUrl","urlValue","finally","ctor","instantiate","variableUpdated","emitChangeEvents","selectOptionsForCurrentValue","selected","validateVariableSelectionState","setValue","currentOption","setOptionFromUrl","op","defaultText","setOptionAsCurrent","setAdhocFilter","2052","resolution","allFormat","2053","__WEBPACK_IMPORTED_MODULE_1_app_core_utils_kbn__","IntervalVariable","auto_min","auto_count","updateAutoValue","calculateInterval","interval","2054","getNoneOption","QueryVariable","useTags","tagsQuery","tagValuesQuery","updateOptionsFromMetricFindQuery","updateTags","getValuesForTag","tagKey","metricNamesToVariableValues","addAllOption","metricNames","matches","stringToJsRegex","sortVariableValues","sortOrder","sortType","reverseSort","opt","toLower","supportsMulti","2055","__WEBPACK_IMPORTED_MODULE_1__variable__","DatasourceVariable","sources","skipVariables","2056","CustomVariable","2057","__WEBPACK_IMPORTED_MODULE_0__variable__","ConstantVariable","2058","AdhocVariable","unescapeDelimiter","escapeDelimiter","setFilters","2059","2060","PluginEditCtrl","preUpdateHook","postUpdateHook","setNavModel","defaultTab","img","logos","large","author","includes","pluginIcon","getPluginIcon","plug","initReadme","md","readmeHtml","trustAsHtml","updateCmd","pinned","jsonData","secureJsonData","location","importDashboards","setPreUpdateHook","setPostUpdateHook","updateAvailable","disable","2061","pluginInfoCache","AppPageCtrl","initPage","loadPluginInfo","app","appModel","page","getNotFoundNav","pluginNav","2062","PluginListCtrl","tabIndex","embedded","allPlugins","2063","dashboardImportList","DashImportListCtrl","__WEBPACK_IMPORTED_MODULE_2_app_core_app_events__","importAll","importNext","reject","overwrite","installCmd","inputs","importedUri","imported","2064","__WEBPACK_IMPORTED_MODULE_1_mobx__","__WEBPACK_IMPORTED_MODULE_2_app_core_config__","__WEBPACK_IMPORTED_MODULE_4_app_stores_store__","access","secureJsonFields","datasourceCreated","DataSourceEditCtrl","nav","loadDatasourceTypes","getDatasourceById","initNewDatasourceModel","isNew","gettingstarted","gettingStarted","isDefault","testDatasource","userChangedType","updateNav","initDatasourceEditNav","datasourceMeta","pluginInfo","updateFrontendSettings","settings","defaultDatasource","testing","status","withNoBackendCache","statusText","saveChanges","editForm","readOnly","confirmDelete","suggestUrl","noDirectAccess","pre","attrs","showAccessOption","showAccessHelp","toggleAccessHelp","getSuggestUrls","2065","__WEBPACK_IMPORTED_MODULE_0_mobx__","__WEBPACK_IMPORTED_MODULE_1_app_core_core__","__WEBPACK_IMPORTED_MODULE_2_app_stores_store__","DataSourceDashboardsCtrl","getPluginInfo","2066","__WEBPACK_IMPORTED_MODULE_0__core_core_module__","DataSourcesCtrl","removeDataSourceConfirmed","removeDataSource","2067","__WEBPACK_IMPORTED_MODULE_3__plugin_loader__","DatasourceSrv","loadDatasource","dsConfig","deferred","pluginDef","Datasource","instanceSettings","getAll","addDataSourceVariables","metricSources","2068","Buffer","process","global","__filename","ut","ot","at","ft","fileName","lineNumber","originalErr","RangeError","u","lastIndexOf","substring","TypeError","mt","vt","enumerable","linkRecord","yt","lastRegister","records","trace","registration","importerSetters","loadError","evalError","instantiatePromise","execute","executingRequire","moduleObj","setters","depsInstantiatePromise","dependencyInstantiations","bt","__useDefault","loads","deps","dynamicDeps","depMap","st","O","E","S","configurable","wt","P","M","xt","toStringTag","R","warnings","warn","C","Uint8Array","WebAssembly","compile","Module","imports","Instance","L","kt","_nodeRequire","decodeURI","paths","_nodeModulePaths","A","I","F","K","Pt","Mt","rel","as","appendChild","Image","D","importScripts","U","Rt","removeEventListener","_t","charset","async","crossOrigin","integrity","addEventListener","q","shift","T","N","nt","J","Ft","headers","Accept","Authorization","credentials","fetch","ok","arrayBuffer","response","responseText","XMLHttpRequest","responseType","onreadystatechange","readyState","open","setRequestHeader","withCredentials","send","B","Lt","readFile","W","G","pluginKey","pluginArgument","pluginModule","packageKey","packageConfig","H","pluginFirst","Z","St","he","me","ne","ee","argument","oe","ve","re","jt","X","Q","Y","V","has","ue","de","packageConfigKeys","Ee","ae","Et","ce","te","configured","pe","configPath","le","extension","scriptLoad","globals","nonce","sourceMap","encapsulateGlobal","cjsRequireDetection","cjsDeferDepsExecute","ge","ie","se","prop","negate","fe","regEx","wildcard","packageConfigPaths","Dt","pluginLoader","Oe","Ut","qt","ye","Tt","Er","be","we","xe","Or","ke","wasm","tt","production","build","defaultJSExtensions","bundles","normalizeSync","depCache","transpiler","Se","zt","Wt","btoa","unescape","je","_e","Nt","documentElement","onerror","addToError","Pe","setAttribute","Me","Gt","Bt","System","SystemJS","Re","Ht","Jt","$t","runInThisContext","filename","eval","Ce","Zt","Le","Ae","dirname","Ie","It","tr","rr","Fe","nr","Ke","De","define","Yt","Ue","ar","sr","ur","or","ir","qe","Te","Vt","cr","Qt","lr","ze","Ne","Je","Be","fr","amdDefine","pr","$e","We","pluginLoad","metadata","Kt","TextDecoder","decode","Ge","Ve","traceOpts","Xe","He","gr","Ye","Ze","Ot","__cjsWrapper","yr","hr","mr","vr","file","Qe","br","wr","et","_loader","loadedBundles","scriptSrc","dr","er","Xt","browser","node","dev","rt","versions","platform","self","getElementsByTagName","baseURI","lt","ct","cwd","dt","gt","pt","resolveInstantiate","ht","freeze","relList","supports","Ct","At","chrome","navigator","userAgent","decanonicalize","toUrl","requireResolve","getPathVars","prepareGlobal","amd","amdRequire","protocol","hostname","port","xr","kr","currentScript","resolveSync","getConfig","Sr","Proxy","jr","isModule","_r","2069","2070","MetricsPanelCtrl","__WEBPACK_IMPORTED_MODULE_0_jquery__","__WEBPACK_IMPORTED_MODULE_0_jquery___default","__WEBPACK_IMPORTED_MODULE_4_app_features_panel_panel_ctrl__","__WEBPACK_IMPORTED_MODULE_5_app_core_utils_rangeutil__","__WEBPACK_IMPORTED_MODULE_6_app_core_utils_datemath__","__WEBPACK_IMPORTED_MODULE_7_app_core_utils_location_util__","__WEBPACK_IMPORTED_MODULE_8__metrics_tab__","__assign","assign","onMetricsPanelRefresh","onInitMetricsPanelEditMode","onPanelTearDown","dataSubscription","unsubscribe","updateTimeRange","dataStream","setTimeQueryStart","handleQueryResult","cancelled","queryStart","setTimeQueryEnd","queryEnd","applyPanelTimeOverrides","maxDataPoints","intervalOverride","intervalMs","timeInfo","timeFromInterpolated","timeFromInfo","invalid","timeFromDate","display","timeShiftInterpolated","hideTimeOverride","__interval","__interval_ms","metricsQuery","getTimezone","cacheTimeout","handleDataStream","stream","setDatasource","items","exploreEnabled","isEditor","supportsExplore","explore","getExploreState","exploreState","addQuery","refId","getNextQueryLetter","nextRefId","removeQuery","moveQuery","2071","metricsTabDirective","MetricsTabCtrl","__WEBPACK_IMPORTED_MODULE_0_remarkable__","__WEBPACK_IMPORTED_MODULE_0_remarkable___default","panelDsValue","datasourceInstance","addQueryDropdown","updateDatasourceOptions","hasQueryHelp","queryOptions","includeBuiltin","addMixedQuery","toggleHelp","optionsOpen","queryTroubleshooterOpen","helpOpen","helpHtml","toggleOptions","toggleQueryTroubleshooter","2072","alertTab","AlertTabCtrl","__WEBPACK_IMPORTED_MODULE_1__threshold_mapper__","__WEBPACK_IMPORTED_MODULE_2_app_core_components_query_part_query_part__","__WEBPACK_IMPORTED_MODULE_3__alert_def__","__WEBPACK_IMPORTED_MODULE_4_app_core_config__","__WEBPACK_IMPORTED_MODULE_5_app_core_app_events__","evalFunctions","evalOperators","conditionTypes","noDataModes","executionErrorModes","appSubUrl","$onInit","addNotificationSegment","thresholdChangedEventHandler","graphThresholdChanged","off","editingThresholds","notifications","alertNotifications","alertHistory","initModel","validateModel","getAlertHistory","ah","getNotificationIcon","getNotifications","changeTabIndex","newTabIndex","notificationAdded","removeNotification","buildDefaultCondition","noDataState","executionErrorState","frequency","handler","defaultName","conditionModels","buildConditionModel","alertToGraphThresholds","addedNotification","_b","_c","notification","bgColor","evaluator","handleIndex","threshold","evaluatorParamsChanged","reducer","firstTarget","foundTarget","alerting","targetContainsTemplate","cm","queryPart","alertQueryDef","reducerPart","createReducerPart","handleQueryPartEvent","conditionModel","handleReducerPartEvent","action","reducerTypes","addCondition","removeCondition","text2","evaluatorTypeChanged","clearHistory","testResult","getSaveModelClone","2073","ThresholdMapper","value1","value2","line","colorMode","2074","inspect","seen","stylize","stylizeNoColor","depth","isBoolean","showHidden","_extend","customInspect","stylizeWithColor","styleType","styles","arrayToHash","hash","idx","recurseTimes","ret","primitive","formatPrimitive","visibleKeys","isError","formatError","isRegExp","isDate","braces","toUTCString","formatArray","formatProperty","reduceToSingleString","isNull","getOwnPropertyDescriptor","numLinesEst","cur","isNullOrUndefined","isSymbol","objectToString","isPrimitive","months","formatRegExp","objects","deprecate","msg","deprecated","warned","throwDeprecation","traceDeprecation","noDeprecation","debugEnviron","debugs","debuglog","JENKINS","NODE_ENV","VERSION","NODE_DEBUG","toUpperCase","pid","bold","italic","underline","inverse","grey","special","boolean","null","string","isBuffer","inherits","origin","2075","readUInt8","2076","superCtor","super_","writable","TempCtor","2077","__WEBPACK_IMPORTED_MODULE_0_app_plugins_datasource_graphite_module__","__WEBPACK_IMPORTED_MODULE_1_app_plugins_datasource_cloudwatch_module__","__WEBPACK_IMPORTED_MODULE_2_app_plugins_datasource_elasticsearch_module__","__WEBPACK_IMPORTED_MODULE_3_app_plugins_datasource_opentsdb_module__","__WEBPACK_IMPORTED_MODULE_4_app_plugins_datasource_grafana_module__","__WEBPACK_IMPORTED_MODULE_5_app_plugins_datasource_influxdb_module__","__WEBPACK_IMPORTED_MODULE_6_app_plugins_datasource_mixed_module__","__WEBPACK_IMPORTED_MODULE_7_app_plugins_datasource_mysql_module__","__WEBPACK_IMPORTED_MODULE_8_app_plugins_datasource_postgres_module__","__WEBPACK_IMPORTED_MODULE_9_app_plugins_datasource_prometheus_module__","__WEBPACK_IMPORTED_MODULE_10_app_plugins_datasource_mssql_module__","__WEBPACK_IMPORTED_MODULE_11_app_plugins_panel_text_module__","__WEBPACK_IMPORTED_MODULE_12_app_plugins_panel_graph_module__","__WEBPACK_IMPORTED_MODULE_13_app_plugins_panel_sensor_module__","__WEBPACK_IMPORTED_MODULE_14_app_plugins_panel_dashlist_module__","__WEBPACK_IMPORTED_MODULE_15_app_plugins_panel_pluginlist_module__","__WEBPACK_IMPORTED_MODULE_16_app_plugins_panel_alertlist_module__","__WEBPACK_IMPORTED_MODULE_17_app_plugins_panel_heatmap_module__","__WEBPACK_IMPORTED_MODULE_18_app_plugins_panel_table_module__","__WEBPACK_IMPORTED_MODULE_19_app_plugins_panel_singlestat_module__","__WEBPACK_IMPORTED_MODULE_20_app_plugins_panel_gettingstarted_module__","__WEBPACK_IMPORTED_MODULE_21_app_plugins_panel_experimentdetails_module__","__WEBPACK_IMPORTED_MODULE_22_app_plugins_panel_experimentvideo_module__","__WEBPACK_IMPORTED_MODULE_23_app_plugins_app_testdata_module__","__WEBPACK_IMPORTED_MODULE_24_app_plugins_app_testdata_datasource_module__","builtInPlugins","app/plugins/datasource/graphite/module","app/plugins/datasource/cloudwatch/module","app/plugins/datasource/elasticsearch/module","app/plugins/datasource/opentsdb/module","app/plugins/datasource/grafana/module","app/plugins/datasource/influxdb/module","app/plugins/datasource/mixed/module","app/plugins/datasource/mysql/module","app/plugins/datasource/postgres/module","app/plugins/datasource/mssql/module","app/plugins/datasource/prometheus/module","app/plugins/app/testdata/module","app/plugins/app/testdata/datasource/module","app/plugins/panel/text/module","app/plugins/panel/graph/module","app/plugins/panel/sensor/module","app/plugins/panel/dashlist/module","app/plugins/panel/pluginlist/module","app/plugins/panel/alertlist/module","app/plugins/panel/heatmap/module","app/plugins/panel/table/module","app/plugins/panel/singlestat/module","app/plugins/panel/gettingstarted/module","app/plugins/panel/experimentdetails/module","app/plugins/panel/experimentvideo/module","2078","AnnotationsQueryCtrl","__WEBPACK_IMPORTED_MODULE_0__datasource__","__WEBPACK_IMPORTED_MODULE_1__query_ctrl__","__WEBPACK_IMPORTED_MODULE_2__config_ctrl__","2079","GraphiteDatasource","basicAuth","graphiteVersion","supportsTags","render_method","funcDefs","funcDefsPromise","getQueryOptionsInfo","graphOptions","translateTime","until","buildGraphiteParams","httpOptions","method","Content-Type","addTracingHeaders","requestId","doGraphiteRequest","convertDataPointsToMs","parseTags","tagString","graphiteQuery","what","roundUp","__WEBPACK_IMPORTED_MODULE_1_app_core_utils_datemath__","subtract","unix","optionalOptions","interpolatedQuery","expressions","exprRegex","getTagValuesAutoComplete","getTagsAutoComplete","getTags","getTagValues","tagPrefix","expr","valuePrefix","getVersion","__WEBPACK_IMPORTED_MODULE_2_app_core_utils_version__","createFuncInstance","funcDef","__WEBPACK_IMPORTED_MODULE_3__gfunc__","getFuncDef","waitForFuncDefsLoaded","getFuncDefs","supportsFunctionIndex","parseFuncDefs","datasourceRequest","_seriesRefLetters","fixIntervalFormat","nestedSeriesRegexReplacer","g1","targetValue","graphite_options","clean_options","intervalFormatFixRegex","hasTargets","2080","addFuncDef","shortName","isVersionRelatedFunction","__WEBPACK_IMPORTED_MODULE_1_app_core_utils_version__","FuncInstance","funcs","param","rawDefs","funcName","group","func","multiple","rawParam","optional","suggestions","optionalSeriesRefArgs","withDefaultParams","updateText","metricExp","parameters","paramType","last","isFinite","_hasMultipleParamsInString","strValue","updateParam","partVal","2081","mapToDropdownOptions","removeTagPrefix","TAG_PREFIX","GraphiteQueryCtrl","__WEBPACK_IMPORTED_MODULE_3__graphite_query__","__WEBPACK_IMPORTED_MODULE_4_app_plugins_sdk__","GRAPHITE_TAG_OPERATORS","paused","queryModel","buildSegments","removeTagValue","parseTarget","toggleEditorMode","textEditor","checkOtherSegmentsIndex","checkOtherSegments","seriesByTagUsed","fixTagSegments","addSelectMetricSegment","newSelectMetric","fromIndex","getSegmentPathUpTo","setSegmentFocus","segmentIndex","getAltSegments","prefix","altSegments","eachRight","removeTaggedEntry","addAltTagSegments","getTagsAsSegments","tagSegments","segmentValueChanged","updateSegmentValue","functions","pause","addSeriesByTagFunc","targetChanged","spliceSegments","emptySegments","targetTextChanged","updateModelTarget","oldTarget","addFunction","newFunc","added","smartlyHandleNewAliasByNode","removeFunction","tagParam","getAllTags","altTags","tagExpressions","renderTagExpressions","getTagOperators","getAllTagValues","altValues","tagChanged","tagIndex","updateTag","addNewTag","newTagKey","newTag","addTag","removeTag","addTagSegments","showDelimiter","unpause","2082","graphiteAddFunc","$input","$button","allFunctions","functionMenu","createFunctionDropDownMenu","typeahead","minLength","updater","$apply","keyup","toggleClass","blur","removeClass","drop","cleanUpDrop","shortDesc","contentElement","innerHTML","__WEBPACK_IMPORTED_MODULE_3_rst2html___default","__WEBPACK_IMPORTED_MODULE_4_tether_drop___default","content","openOn","tetherOptions","attachment","targetAttachment","__WEBPACK_IMPORTED_MODULE_3_rst2html__","__WEBPACK_IMPORTED_MODULE_4_tether_drop__","2083","graphiteFuncEditor","popoverSrv","clickFuncParam","paramIndex","$link","$comma","lookup","scheduledRelinkIfNeeded","paramCountAtLink","scheduledRelink","relink","paramDef","switchToLink","inputElem","cancelBlur","newValue","hasClass","inputBlur","inputKeyPress","inputKeyDown","addTypeahead","$element","toggleFuncControls","targetDiv","closest","$funcControls","addElementsAndCompile","$funcLink","defParams","lastParam","paramValue","$paramLink","partial","keypress","ifJustAddedFocusFirstParam","registerFuncControlsToggle","registerFuncControlsActions","$target","classNames","2084","wrapFunction","renderTagString","__WEBPACK_IMPORTED_MODULE_1__parser__","GraphiteQuery","parser","astNode","getAst","parseTargetRecursive","checkForSeriesByTag","seriesByTagFunc","splitSeriesByTagParams","arr","innerFunc","addFunctionParameter","moveAliasFuncLast","aliasFunc","startsWith","metricPath","updateRenderedTarget","countTargetRefs","targetsByRefId","refCount","nestedSeriesRefRegex","keyBy","targetWithNestedQueries","updated","targetFull","tagPattern","getSeriesByTagFuncIndex","getSeriesByTagFunc","seriesByTagFuncIndex","newTagParam","excludeIndex","tagExpr","2085","Parser","lexer","__WEBPACK_IMPORTED_MODULE_0__lexer__","tokens","tokenize","functionCall","metricExpression","curlyBraceSegment","curlySegment","consumeToken","errorMark","curly","functionParameters","boolExpression","numericLiteral","seriesRefExpression","stringLiteral","token","isUnclosed","currentToken","char","matchToken","token1","token2","2086","Lexer","input","unicodeLetterTable","identifierStartTable","identifierPartTable","peek","skip","scanStringLiteral","scanPunctuator","scanNumericLiteral","scanIdentifier","scanTemplateSequence","isUnicodeLetter","isHexDigit","readUnicodeEscapeSequence","ch1","ch2","ch3","ch4","getIdentifierStart","chr","charCodeAt","getIdentifierPart","isDecimalDigit","isOctalDigit","isIdentifierStart","ch","bad","isMalformed","isPunctuator","2087","GraphiteConfigCtrl","graphiteVersions","autoDetectGraphiteVersion","2088","CloudWatchAnnotationsQueryCtrl","__WEBPACK_IMPORTED_MODULE_1__datasource__","__WEBPACK_IMPORTED_MODULE_2__query_ctrl__","__WEBPACK_IMPORTED_MODULE_3__config_ctrl__","2089","__WEBPACK_IMPORTED_MODULE_2_app_core_utils_datemath__","__WEBPACK_IMPORTED_MODULE_4_app_features_templating_variable__","CloudWatchDatasource","supportMetrics","proxyUrl","defaultRegion","expandTemplateVariable","queries","getActualRegion","convertDimensionFormat","getPeriod","datasourceId","request","performTimeSeriesQuery","convertToCloudWatchTime","periodUnit","interval_to_seconds","daySec","awsRequest","queryRes","transformSuggestDataFromTable","suggestData","tables","doMetricQueryRequest","subtype","filterDimensions","getEbsVolumeIds","instanceId","getEc2InstanceAttribute","attributeName","filterJson","metricNameQuery","dimensionKeysQuery","dimensionValuesQuery","ebsVolumeIdsQuery","ec2InstanceAttributeQuery","targetAttributeName","defaultPeriod","prefixMatching","actionPrefix","alarmNamePrefix","getDefaultRegion","getExpandedVariables","allSelected","chain","scopedVar","findKey","multiVariable","convertedDimensions","2090","CloudWatchQueryCtrl","__WEBPACK_IMPORTED_MODULE_1_app_plugins_sdk__","aliasSyntax","2091","CloudWatchConfigCtrl","accessKeyExist","secretKeyExist","authTypes","indexPatternTypes","example","timeField","authType","accessKey","secretKey","resetAccessKey","resetSecretKey","2092","ElasticAnnotationsQueryCtrl","2093","ElasticDatasource","__WEBPACK_IMPORTED_MODULE_2_moment__","__WEBPACK_IMPORTED_MODULE_2_moment___default","__WEBPACK_IMPORTED_MODULE_3__query_builder__","__WEBPACK_IMPORTED_MODULE_4__index_pattern__","__WEBPACK_IMPORTED_MODULE_5__elastic_response__","indexPattern","timeInterval","maxConcurrentShardRequests","queryBuilder","index_list","getIndexList","$$config","getIndexForToday","reason","queryString","tagsField","textField","queryInterpolated","bool","query_string","search_type","ignore_unavailable","responses","getFieldFromSource","fieldName","fieldNames","fieldValue","_source","fields","titleField","getFields","dateFields","getQueryHeader","searchType","timeTo","query_header","sentTargets","adhocFilters","queryObj","esQuery","getTimeSeries","shouldAddField","typeMap","getFieldsRecursively","subObj","properties","fieldNameParts","float","double","integer","long","scaled_float","nested","indexName","mappings","typeName","getTerms","queryDef","getTermsQuery","aggregations","key_as_string","fromJson","bucketAggs","bucketAgg","objectContainsTemplate","some","2094","ElasticQueryBuilder","__WEBPACK_IMPORTED_MODULE_0__query_def__","getRangeFilter","gte","lte","buildTermsAgg","aggDef","queryNode","metricRef","terms","aggs","min_doc_count","missing","getDateHistogramAgg","esAgg","extended_bounds","getHistogramAgg","getFiltersAgg","filterObj","analyze_wildcard","documentQuery","unmapped_type","script_fields","fielddata_fields","docvalue_fields","addAdhocFilters","queryCondition","must","match_phrase","must_not","nestedAggs","aggField","metricAgg","pipelineAgg","buckets_path","1","_term","2095","IndexPattern","__WEBPACK_IMPORTED_MODULE_0_moment__","__WEBPACK_IMPORTED_MODULE_0_moment___default","intervalMap","Hourly","startOf","amount","Daily","Weekly","Monthly","Yearly","pattern","intervalInfo","endEpoch","indexList","2096","ElasticResponse","__WEBPACK_IMPORTED_MODULE_1__query_def__","__WEBPACK_IMPORTED_MODULE_2_app_core_table_model__","processMetrics","newSeries","doc_count","firstBucket","percentiles","percentileName","statName","std_deviation_bounds_upper","std_deviation_bounds","upper","std_deviation_bounds_lower","lower","normalized_value","processAggregationDocs","propKey","addMetricValue","_d","propValues","_f","_g","getMetricName","processBuckets","aggId","nameIndex","metricDef","getSeriesName","metricTypeCount","g2","appliedAgg","nameSeries","uniq","processHits","_id","_type","_index","trimDatapoints","histogram","trimEdges","getErrorFromElasticResponse","root_cause","tmpSeriesList","2097","ElasticQueryCtrl","__WEBPACK_IMPORTED_MODULE_2_angular__","__WEBPACK_IMPORTED_MODULE_2_angular___default","__WEBPACK_IMPORTED_MODULE_4__query_def__","__WEBPACK_IMPORTED_MODULE_5_app_plugins_sdk__","queryUpdated","jsonStr","handleQueryError","newJson","rawQueryOld","getCollapsedText","metricAggs","2098","elasticBucketAgg","__WEBPACK_IMPORTED_MODULE_2__query_def__","ElasticBucketAggCtrl","getBucketAggTypes","getOrderOptions","getSizeOptions","agg","onChangeInternal","onTypeChanged","isFirst","bucketAggCount","settingsLinkText","defaultTo","addFiltersQuery","removeFiltersQuery","getFieldsInternal","$fieldType","getIntervalOptions","addBucketAgg","lastBucket","addIndex","removeBucketAgg","2099","elasticMetricAgg","ElasticMetricAggCtrl","pipelineAggOptions","modelSettingsValues","updatePipelineAggOptions","isSingle","precision_threshold","movingAvgModelTypes","modelSettings","updateMovingAvgModelSettings","inlineScript","script","inline","modelSettingsKeys","onChangeClearInternal","minimize","onTypeChange","addMetricAgg","removeMetricAgg","toggleShowMetric","2100","ElasticConfigCtrl","esVersions","indexPatternTypeChanged","2101","2102","OpenTsDatasource","tsdbVersion","tsdbResolution","tagKeys","aggregatorsPromise","filterTypesPromise","convertToTSDBTime","qs","convertTargetToQuery","groupByTags","tagk","metricToTargetMapping","mapMetricsToTargets","metricData","_saveTagKeys","transformMetricData","eventList","aggregator","annotationObject","isGlobal","globalAnnotations","startTime","msResolution","reqBody","showQuery","_addCredentialOptions","suggestTagKeys","aggregateTags","_performSuggestQuery","_get","_performMetricKeyValueLookup","keysArray","keysQuery","tagvs","_performMetricKeyLookup","tagks","tagv","relativeUrl","interpolated","responseTransform","metrics_regex","tag_names_regex","tag_values_regex","tag_names_suggest_regex","tag_values_suggest_regex","metrics_query","tag_names_query","tag_values_query","tag_names_suggest_query","tag_values_suggest_query","getAggregators","getFilterTypes","metricLabel","createMetricLabel","dps","tagData","toPairs","shouldComputeRate","rate","rateOptions","counter","isCounter","counterMax","counterResetValue","resetValue","dropResets","ResetValue","disableDownsampling","downsampleInterval","downsample","downsampleAggregator","downsampleFillPolicy","filter_key","tag_key","explicitTags","interpolatedTagValue","arrTagV","tagV","tagK","2103","OpenTsQueryCtrl","errors","validateTarget","aggregators","fillPolicies","filterTypes","suggestMetrics","getTextValues","suggestTagValues","targetBlur","metricFindResult","addTagMode","currentTagKey","currentTagValue","editTag","closeAddTagMode","addFilter","addFilterMode","currentFilterType","currentFilterGroupBy","currentFilter","currentFilterKey","currentFilterValue","removeFilter","editFilter","fil","closeAddFilterMode","errs","shouldDownsample","describe_interval","2104","OpenTsConfigCtrl","tsdbVersions","tsdbResolutions","2105","GrafanaQueryCtrl","GrafanaAnnotationsQueryCtrl","2106","GrafanaDatasource","2107","InfluxConfigCtrl","InfluxAnnotationsQueryCtrl","2108","__WEBPACK_IMPORTED_MODULE_2__influx_series__","__WEBPACK_IMPORTED_MODULE_3__influx_query__","__WEBPACK_IMPORTED_MODULE_4__response_parser__","__WEBPACK_IMPORTED_MODULE_5__query_builder__","InfluxDatasource","urls","username","password","supportAnnotations","responseParser","timeFilter","getTimeFilter","queryTargets","allQueries","_seriesQuery","influxSeries","getTable","timeSeries","curry","_influxRequest","coeff","serializeParams","currentUrl","db","req","paramSerializer","getInfluxTime","fromIsAbsolute","2109","__WEBPACK_IMPORTED_MODULE_1_app_core_table_model__","InfluxSeries","columnName","_getSeriesName","segIndex","titleCol","timeCol","tagsCol","textCol","titleColumn","tagsColumn","textColumn","reordered","2110","addUnique","ResponseParser","influxResults","normalizedQuery","isValueFirst","2111","InfluxQueryCtrl","__WEBPACK_IMPORTED_MODULE_2__query_builder__","__WEBPACK_IMPORTED_MODULE_4__query_part__","groupBySegment","resultFormats","policySegment","measurementSegment","newSelectMeasurement","newCondition","buildSelectMenu","removeTagFilterSegment","removeOrderByTime","selectMenu","cat","getGroupByOptions","tags_1","groupByAction","plusButton","subitem","handleSelectPartEvent","fieldsQuery","handleGroupByPartEvent","measurementChanged","getPolicySegments","policiesQuery","policyChanged","getMeasurements","measurementFilter","getTagsOrValues","newOperators","getFieldSegments","tagSegmentUpdated","rebuildTargetTagConditions","tagOperator","segment2","getTagValueOperator","tagValue","2112","2113","MixedDatasource","sets","dsName","2114","MysqlConfigCtrl","MysqlAnnotationsQueryCtrl","defaultQuery","2115","MysqlDatasource","__WEBPACK_IMPORTED_MODULE_1__response_parser__","interpolateVariable","rawSql","processQueryResult","transformAnnotationResponse","parseMetricFindQueryResult","2116","rowCount","textColIndex","findColIndex","valueColIndex","transformToKeyValueList","transformToSimpleList","containsKey","colName","timeColumnIndex","textColumnIndex","tagsColumnIndex","2117","MysqlQueryCtrl","formats","lastQueryMeta","lastQueryError","anySeriesFromQuery","2118","PostgresConfigCtrl","PostgresAnnotationsQueryCtrl","sslmode","2119","PostgresDatasource","2120","2121","PostgresQueryCtrl","2122","PrometheusAnnotationsQueryCtrl","2123","alignRange","prometheusRegularEscape","prometheusSpecialRegexEscape","PrometheusDatasource","__WEBPACK_IMPORTED_MODULE_3_app_core_utils_datemath__","__WEBPACK_IMPORTED_MODULE_4__metric_find_query__","__WEBPACK_IMPORTED_MODULE_5__result_transformer__","editorSrc","directUrl","queryTimeout","httpMethod","resultTransformer","_request","transformRequest","metadataRequest","silent","interpolateQueryExpr","getPrometheusTime","activeTargets","createQuery","allQueryPromise","instant","performInstantQuery","responseList","transformerOptions","legendFormat","responseListLength","responseIndex","minInterval","intervalFactor","adjustedInterval","adjustInterval","adjusted","performSuggestQuery","metricsNameCache","expire","titleFormat","textFormat","renderTemplate","getOriginalMetricName","labelData","2124","PrometheusMetricFindQuery","label_values_regex","metric_names_regex","query_result_regex","label_values_query","labelValuesQuery","metric_names_query","query_result_query","queryResultQuery","metricNameAndLabelsQuery","_labels","metricFilterPattern","matchedMetricName","__name__","2125","le1","le2","ResultTransformer","prometheusResult","transformMetricDataToTable","prometheusResult_1","transformToHistogramOverTime","prometheusResult_2","resultType","transformInstantMetricData","stepMs","baseTimestamp","dp_value","endTimestamp","resultCount","metricLabels","sortedLabels","labelIndex","valueText","aliasPattern","aliasData","aliasRegex","topSeries","bottomSeries","2126","PrometheusQueryCtrl","__WEBPACK_IMPORTED_MODULE_3__completer__","__WEBPACK_IMPORTED_MODULE_4__mode_prometheus__","__WEBPACK_IMPORTED_MODULE_5__snippets_prometheus__","getDefaultFormat","resolutions","updateLink","getCompleter","refreshMetricData","isEqual","rangeDiff","endTime","g0.expr","g0.range_input","g0.end_input","g0.step_input","g0.stacked","g0.tab","linkToPrometheus","2127","PromCompleter","identifierRegexps","labelQueryCache","labelNameCache","labelValueCache","templateVariableCompletions","caption","score","getCompletions","editor","session","wrappedCallback","completions","getTokenAt","getCompletionsForLabelMatcherName","getCompletionsForLabelMatcherValue","getCompletionsForBinaryOperator","vectors","findMetricName","getLabelNameAndValueForExpression","labelNames","transformToCompletions","labelNameToken","findToken","labelName","labelValues","keywordOperatorToken","rparenToken","findExpressionMatchedParen","binaryOperatorToken","metricName_1","words","nameLabelNameToken","getTokens","nameLabelValueToken","metricNameToken","guard","nc","deep","2128","ace","oop","TextHighlightRules","PrometheusHighlightRules","keywordMapper","createKeywordMapper","support.function","keyword","constant.language","$rules","start-label-matcher","start-label-list-matcher","normalizeRules","wrapText","space_index","line_start","next_line_end","convertMarkDownTags","convertToHTML","docText","lang","escapeHTML","prometheusKeyWords","keyWordsCompletions","word","prometheusFunctions","functionsCompletions","docHTML","PrometheusCompletions","getWrapped","opening","closing","rowDiff","CstyleBehaviour","Behaviour","PrometheusBehaviour","TokenIterator","inherit","getSelectionRange","getTextRange","getWrapBehavioursEnabled","isSaneInsertion","cursor","getCursorPosition","getLine","rightChar","matching","$findOpeningBracket","isAutoInsertedClosing","isMultiLine","TextMode","Mode","HighlightRules","$behaviour","$completer","completer","$id","2129","snippets","tabTrigger","2130","PrometheusConfigCtrl","2131","MssqlConfigCtrl","MssqlAnnotationsQueryCtrl","2132","MssqlDatasource","2133","2134","MssqlQueryCtrl","2135","TextPanelCtrl","onRefresh","throttle","renderMarkdown","updateContent","renderText","remarkable","$applyAsync","scrollable","2136","graphDirective","shouldAbortRender","panelWidth","drawHook","__WEBPACK_IMPORTED_MODULE_9_jquery___default","thresholdManager","processOffsetHook","gridMargin","panelOptions","processRangeHook","yAxes","level","__WEBPACK_IMPORTED_MODULE_19__align_yaxes__","getMinTimeStepOfSeries","timeStep","render_panel","prepare","buildFlotOptions","prepareXAxis","configureYAxisOptions","addFlotOptions","eventManager","sortedSeries","sortSeries","callPlotSlow","callPlot","buildFlotPairs","addXSeriesAxis","histMin","__WEBPACK_IMPORTED_MODULE_10_lodash___default","histMax","__WEBPACK_IMPORTED_MODULE_13_app_core_utils_ticks__","__WEBPACK_IMPORTED_MODULE_18__histogram__","addXHistogramAxis","addXTableAxis","addTimeAxis","sleep","ms","incrementRenderCounter","__awaiter","originalData","drawStepsCount","drawStepsSizes","maxVal","minVal","axisIndex","sortedSeries_1","isLast","seriesIdx","drawStepsSize","begin","isLastSeries","__generator","sent","renderError","gridColor","__WEBPACK_IMPORTED_MODULE_20_app_core_config__","translateFillOption","labelMarginX","sortDesc","haveSortBy","haveSortOrder","shouldSortBy","zindex","tzero","tZeroFormatter","timeforamt","time_format","defaultTicks","tick_values","data_1","tickStep_1","ticks_num","configureAxisMode","parseNumber","decimals","secondY","applyLogScale","toNumber","minSetToZero","MIN_VALUE","logmin","generateTicksForLogScaleYAxis","nextTick","maxNumTicks","numTicks","__WEBPACK_IMPORTED_MODULE_12_app_core_utils_kbn__","valueFormats","secPerTick","__WEBPACK_IMPORTED_MODULE_17_app_features_annotations_all__","__WEBPACK_IMPORTED_MODULE_16__threshold_manager__","__WEBPACK_IMPORTED_MODULE_15__graph_tooltip__","renderData","showEcuEvents","graphHeight","__WEBPACK_IMPORTED_MODULE_14_app_core_core__","isVideoSync","sharedTooltipModeEnabled","canMakeEditable","__WEBPACK_IMPORTED_MODULE_11_moment___default","__WEBPACK_IMPORTED_MODULE_0_vendor_flot_jquery_flot__","__WEBPACK_IMPORTED_MODULE_1_vendor_flot_jquery_flot_selection__","__WEBPACK_IMPORTED_MODULE_2_vendor_flot_jquery_flot_time__","__WEBPACK_IMPORTED_MODULE_3_vendor_flot_jquery_flot_stack__","__WEBPACK_IMPORTED_MODULE_4_vendor_flot_jquery_flot_stackpercent__","__WEBPACK_IMPORTED_MODULE_5_vendor_flot_jquery_flot_fillbelow__","__WEBPACK_IMPORTED_MODULE_6_vendor_flot_jquery_flot_crosshair__","__WEBPACK_IMPORTED_MODULE_7_vendor_flot_jquery_flot_dashes__","__WEBPACK_IMPORTED_MODULE_8__jquery_flot_events__","__WEBPACK_IMPORTED_MODULE_9_jquery__","__WEBPACK_IMPORTED_MODULE_10_lodash__","__WEBPACK_IMPORTED_MODULE_11_moment__","thisArg","_arguments","generator","fulfilled","rejected","verb","ops","trys","throw","return","2137","__WEBPACK_AMD_DEFINE_ARRAY__","__WEBPACK_AMD_DEFINE_RESULT__","angular","Drop","createAnnotationToolip","injector","invoke","tmpScope","$digest","$destroy","hoverCloseDelay","constraints","pin","createEditPopover","markerElementToAttachTo","that","eventMarkers","EventMarkers","getEvents","_events","hideEvents","visual","getObject","showEvents","drawEvents","setEvents","eventsEnabled","setupEvents","setTypes","updateEvents","DrawableEvent","drawFunc","clearFunc","moveFunc","_object","_drawFunc","_clearFunc","_moveFunc","_position","_width","_height","VisualEvent","drawableEvent","_options","_drawableEvent","_hidden","getParent","isHidden","unhide","_types","_plot","_buildDiv","vre","_buildRegDiv","ao","bo","_insidePlot","_clearEvents","markerShow","lineStyle","markerTooltip","yaxis2","eventTypeId","topOffset","border-left-width","border-left-style","border-left-color","marker","line-height","border-left","border-right","border-top","border-bottom","mouseenter","mouseleave","hover","regionWidth","background-color","xc","defaultOptions","2138","GraphTooltip","getSeriesFn","$tooltip","findHoverIndexFromDataPoints","posX","initial","findHoverIndexFromData","middle","renderAndShow","innerHtml","xMode","place_tt","getMultiSeriesPlotHoverInfo","hoverIndex","hoverDistance","pointTime","minDistance","minTime","last_value","hideEmpty","allIsNull","hideZero","allIsZero","aliasEscaped","panelRelY","absoluteTime","hoverInfo","seriesHtml","tooltipFormat","plotData","xAxes","allSeriesMode","scrollTop","innerHeight","sharedCrosshairModeOnly","hasMsResolution","seriesHoverInfo","highlightClass","2139","ThresholdManager","getHandleHtml","valueStr","initDragging","dragging","lastY","clientY","diff","posTop","handleElem","stopped","graphValue","currentTarget","parents","cleanUp","needsCleanup","renderHandle","defaultHandleTopPos","handleTopPos","valueCanvasPos","shouldDrawHandles","hasSecondYAxis","thresholdMargin","gtLimit","ltLimit","lineColor","2140","getSeriesValues","convertValuesToHistogram","minBound","maxBound","bound_1","histogam_series","convertToHistogramData","2141","alignYLevel","checkCorrectAxis","yLeft","yRight","moveLevelToZero","expandStuckValues","oneSide","checkOneSide","checkOppositeSides","getRate","checkTwoCross","restoreLevelFromZero","checkCorrectAxes","rateLeft","rateRight","absLeftMin","absLeftMax","absRightMin","absRightMax","upLeft","downLeft","upRight","downRight","2142","__WEBPACK_IMPORTED_MODULE_3_baron__","__WEBPACK_IMPORTED_MODULE_3_baron___default","getSeriesIndexForElement","el","openColorSelector","colorSelected","seriesInfo","scrollPosition","sortLegend","getTableHeaderHtml","legendWidth","legendElem","firstRender","rightSide","sideWidth","ieWidth","alignAsTable","tableHeaderElem","legendRightDefaultWidth","renderLegendElement","renderSeriesLegendElements","seriesElements","hideFromLegend","tbodyElem","wrap","addScrollbar","destroyScrollbar","scrollRoot","scroller","scrollbarParams","bar","track","barOnCls","scrollingCls","legendScrollbar","marginRight","offsetWidth","clientWidth","scroll","dispose","2143","SeriesOverridesCtrl","overrideMenu","currentOverrides","addOverrideOption","propertyName","lenght","setOverride","subItem","updateCurrentOverrides","fakeSeries","autoClose","onClose","removeOverride","getSeriesNames","2144","__WEBPACK_IMPORTED_MODULE_0_app_core_core_module__","ThresholdFormCtrl","disabled","unbindDestroy","addThreshold","removeThreshold","onFillColorChange","onLineColorChange","2145","2146","DataProcessor","__WEBPACK_IMPORTED_MODULE_1_app_core_time_series2__","__WEBPACK_IMPORTED_MODULE_2_app_core_utils_colors__","firstItem","autoDetectMode","getAutoDetectXAxisMode","setPanelDefaultsForNewXAxisMode","timeSeriesHandler","histogramDataList","customHandler","seriesData","colorIndex","dataItem","validateXAxisSeriesValue","validOptions","getXAxisValueOptions","getDataFieldNames","onlyNumbers","getPropertiesRecursive","fieldParts","pluckDeep","property","propertyParts","2147","axesEditorComponent","AxesEditorCtrl","unitFormats","getUnitFormats","logScales","log (base 2)","log (base 10)","log (base 32)","log (base 1024)","xAxisModes","Time","Series","Histogram","xAxisStatOptions","setUnitFormat","xAxisModeChanged","xAxisValueChanged","2148","SensorCtrl","__WEBPACK_IMPORTED_MODULE_1__graph_module__","sensorSrv","experimentSrv","exp","experiment","loadTargets","sensor","shortNames","descriptor","sensorShortName","buildTarget","setTitle","initEcuFlag","onSensorPanelRefresh","addSensorEditTab","aliasChanged","canDrop","$data","onDrop","sensorTargets","foreignTargets","buildSensorAlias","loadTargetInfo","getSensorForExperiment","sensorIds","isHandled","buildQuery","experimentIdQuery","databaseId","dsType","2149","DashListCtrl","__WEBPACK_IMPORTED_MODULE_2_app_core_services_impression_srv__","recent","starred","headings","groups","modes","getRecentDashboards","getStarred","getSearch","folderIds","starDashboard","isStarred","preventDefault","dashIds","take","getDashboardOpened","dashboardIds","orderId","onFolderChange","2150","__WEBPACK_IMPORTED_MODULE_1__features_panel_panel_ctrl__","pluginList","viewModel","gotoPlugin","$event","core","hasUpdate","2151","AlertListPanel","__WEBPACK_IMPORTED_MODULE_2__features_alerting_alert_def__","__WEBPACK_IMPORTED_MODULE_3_app_plugins_sdk__","__WEBPACK_IMPORTED_MODULE_4_app_core_utils_datemath__","sortOrderOptions","stateFilter","currentAlerts","onlyAlertsOnDashboard","dashboardFilter","nameFilter","sortResult","alerts","alertStateSortScore","updateStateFilter","getAlertsPromise","getCurrentAlertState","getStateChanges","al","noAlertsMessage","dashboardQuery","dashboardTags","dashboardTag","newStateDateAgo","newStateDate","locale","fromNow","2152","__WEBPACK_IMPORTED_MODULE_1__heatmap_ctrl__","2153","drawColorLegend","rangeFrom","rangeTo","__WEBPACK_IMPORTED_MODULE_3_d3__","clearLegend","legendHeight","rangeStep","widthFactor","valuesRange","__WEBPACK_IMPORTED_MODULE_6__color_scale__","__WEBPACK_IMPORTED_MODULE_4_app_core_core__","selectAll","enter","drawLegendValues","drawOpacityLegend","opacityScale","cardColor","childNodes","legendValueScale","buildLegendTicks","xAxis","tickValues","LEGEND_TICK_SIZE","colorRect","posY","getSvgElemHeight","LEGEND_VALUE_MARGIN","getSvgElemX","drawSimpleColorLegend","valuesNumber","drawSimpleOpacityLegend","legendOpacityScale_1","svgElem","baseVal","tickStepSize","__WEBPACK_IMPORTED_MODULE_5_app_core_utils_ticks__","ticksNum","isValueCloseTo","valueTo","colorSchemes","colorOptions","2154","HeatmapCtrl","__WEBPACK_IMPORTED_MODULE_0_app_plugins_sdk__","__WEBPACK_IMPORTED_MODULE_3_app_core_time_series2__","__WEBPACK_IMPORTED_MODULE_4__axes_editor__","__WEBPACK_IMPORTED_MODULE_5__display_editor__","__WEBPACK_IMPORTED_MODULE_6__rendering__","__WEBPACK_IMPORTED_MODULE_7__heatmap_data_converter__","cardPadding","cardRound","dataFormat","yBucketBound","yAxis","splitFactor","xBucketNumber","yBucketNumber","showHistogram","highlightCards","colorModes","opacityScales","ds_support_histogram_sort","selectionActivated","defaultsDeep","onCardColorChange","convertHistogramToHeatmapData","convertTimeSeriesToHeatmapData","bucketsData","heatmapStats","xBucketSizeByNumber","interval_regex","interval_to_ms","parseSeries","minLog","tsBuckets","panelDatasource","getPanelDataSourceType","xBucketBoundSet","seriesHandler","flotpairs","parseHistogramSeries","2155","axesEditor","dataFormats","Time series","Time series buckets","yBucketBoundModes","Auto","Upper","Lower","2156","heatmapDisplayEditor","HeatmapDisplayEditorCtrl","2157","setElementHeight","$heatmap","getYAxisWidth","axis_text","nodes","getBBox","getXAxisHeight","axis_line_position","addXAxis","xScale","chartWidth","timeFormat","DEFAULT_X_TICK_SIZE_PX","grafanaTimeFormatter","__WEBPACK_IMPORTED_MODULE_6_app_core_utils_ticks__","tickFormat","tickPadding","X_AXIS_TICK_PADDING","chartHeight","yAxisWidth","addYAxis","DEFAULT_Y_TICK_SIZE_PX","tick_interval","wideYAxisRange","y_min","y_max","decimalsAuto","flot_tick_size","yScale","tickValueFormatter","tickSizeInner","tickSizeOuter","Y_AXIS_TICK_PADDING","tickInterval","y_widing","dataRangeWidingFactor","addLogYAxis","log_base","adjustLogRange","adjustLogMin","adjustLogMax","logScaleTickValues","addYAxisFromBuckets","valIndex","valueFormatted","tsBucketsFormatted","domainMin","domainMax","under_one_ticks","tick_value","__WEBPACK_IMPORTED_MODULE_4_app_core_utils_kbn__","fixYAxisTickSize","addAxes","chartTop","chartBottom","xAxisHeight","addHeatmapCanvas","heatmap_elem","CARD_PADDING","CARD_ROUND","addHeatmap","__WEBPACK_IMPORTED_MODULE_8__heatmap_data_converter__","cardsData","maxValueAuto","__WEBPACK_IMPORTED_MODULE_9__color_scale__","__WEBPACK_IMPORTED_MODULE_5_app_core_core__","setCardSize","getCardX","getCardWidth","getCardY","getCardHeight","getCardColor","getCardOpacity","mouseOverBucket","highlightCard","resetCardHighLight","darker","strokeColor","brighter","current_card","originalFillColor","xGridSize","yGridSize","cardWidth","cardHeight","cutted_width","MIN_CARD_SIZE","offsetX","selectionRange","MIN_SELECTION_WIDTH","limitSelection","drawSelection","emitGraphHoverEvent","drawCrosshair","offsetY","posX1","posX2","selectionX","selectionWidth","drawSharedCrosshair","graphTooltip","__WEBPACK_IMPORTED_MODULE_7__heatmap_tooltip__","DATA_RANGE_WIDING_FACTOR","2158","HeatmapTooltip","__WEBPACK_IMPORTED_MODULE_4__heatmap_data_converter__","heatmapPanel","onMouseOver","getBucketIndexes","xBucketIndex","yBucketIndex","boundBottom","boundTop","countValueFormatter","bucketBoundFormatter","xData","yData","bucketIndex","tooltipDecimals","tooltipHtml","addHistogram","getXBucketIndex","getYBucketIndex","getSharedTooltipPos","histogramData","histXScale","barNumberFactor","histogramDomain","histYScale","tooltipWidth","tooltipHeight","clientHeight","innerWidth","pageYOffset","2159","TablePanelCtrl","__WEBPACK_IMPORTED_MODULE_3__transformers__","__WEBPACK_IMPORTED_MODULE_4__editor__","__WEBPACK_IMPORTED_MODULE_5__column_options__","__WEBPACK_IMPORTED_MODULE_6__renderer__","pageSize","showHeader","dateFormat","pageIndex","dataRaw","isTimezoneUtc","toggleColumnSort","colIndex","tableData","render_values","getTableHeight","panelHeight","pageCount","appendTableRows","setTable","switchPage","renderPanel","appendPaginationControls","footerElem","startPage","endPage","paginationList","activeClass","pageLinkElem","panelElem","rootElem","max-height","addFilterClicked","filterData","selector","2160","tablePanelEditor","TablePanelEditorCtrl","__WEBPACK_IMPORTED_MODULE_1__transformers__","fontSizes","addColumnSegment","updateTransformHints","canSetColumns","columnsHelpMessage","getColumnOptions","transformChanged","removeColumn","2161","columnOptionsTab","ColumnOptionsCtrl","activeStyleIndex","columnTypes","dateFormats","mappingTypes","getColumnNames","addColumnStyle","newStyleRule","mappingType","stylesCount","indexToInsert","removeColumnStyle","invertColorOrder","ref","styleIndex","addValueMap","valueMaps","removeValueMap","addRangeMap","rangeMaps","removeRangeMap","2162","TableRenderer","isUtc","initColumns","formatters","colorState","createColumnFormatter","getColorForValue","defaultCellFormatter","setColorState","valueFormatter_1","numericValue","renderRowVariables","cell_variable","formatColumnValue","renderCell","addWidthHack","cellClasses","cellClass","cell","columnHtml","preserveFormat","cellLink","linkUrl","cellLinkTooltip","linkTooltip","cellTarget","linkTargetBlank","startPos","endPos","cellHtml","rowStyle","new_row","2163","colorMap","SingleStatCtrl","__WEBPACK_IMPORTED_MODULE_2_vendor_flot_jquery_flot__","__WEBPACK_IMPORTED_MODULE_3_vendor_flot_jquery_flot_gauge__","__WEBPACK_IMPORTED_MODULE_5_app_core_utils_kbn__","__WEBPACK_IMPORTED_MODULE_7_app_core_time_series2__","__WEBPACK_IMPORTED_MODULE_8_app_plugins_sdk__","dataType","valueNameOptions","postfix","nullText","valueName","prefixFontSize","valueFontSize","postfixFontSize","colorBackground","colorValue","sparkline","full","gauge","thresholdMarkers","thresholdLabels","tableColumn","onSparklineColorChange","onSparklineFillChange","tableHandler","setTableValues","setValues","tableColumnOptions","setTableColumnToSensibleDefault","valueRounded","decimalInfo","getDecimalsForValue","formatFunc","roundValue","setValueMapping","canChangeFontSize","setColoring","background","panelColorIndex","lastPoint","lastValue","rangeMap","applyColoringThresholds","valueString","getSpan","getBigValueHtml","getValueText","addGauge","dimension","invalidGaugeRange","plotCanvas","plotCss","fontScale","gaugeWidthReduceRatio","gaugeWidth","thresholdMarkersWidth","thresholdLabelFontSize","gauges","border","frame","layout","thresholdWidth","formatter","plotSeries","addSparkline","dynamicHeightMargin","strVale","$panelContainer","drilldownTooltip","2164","getLogger","debugOptions","Logger","toRad","drawArc","cx","cy","rd1","rd2","lc","fc","debug","gaugeOptions","Gauge","calculateLayout","gaugeOptionsi","calculateAutoValues","cellWidth","cellLayout","calculateCellLayout","drawCellBackground","drawLable","drawGauge","drawThreshold","drawThresholdValues","drawValue","calculateAngle","startAngle","endAngle","drawArcWithShadow","clip","shadowOffsetX","shadowOffsetY","shadowBlur","shadowColor","drawThresholdValue","drawText","thresholdLabelMargin","textOptions","exists","logger","canvasWidth","canvasHeight","hMargin","vMargin","cellHeight","square","cellMargin","labelFontSize","valueMargin","maxRadiusH","dAngle","heightRatioV","outerRadiusV","maxRadiusV","outerRadius","gaugeOuterHeight","blank","vAlign","a2","a1","2165","GettingStartedPanelCtrl","stepIndex","note","check","cta","nextStep","checksDone","currentStep","passed","dismiss","showSuccessAlert","helpFlags1","2166","ExperimentPanelCtrl","experimentIdVars","duration","stoppedNs","startedNs","created","onExperimentDetailsPanelRefresh","2167","ExperimentVideoPanelCtrl","__WEBPACK_IMPORTED_MODULE_2_uppy__","alertSrv","$interval","isTranscoding","videoUrl","offsetSec","videoStartSec","monitorTranscodeProgress","syncClicked","syncEnabled","getCountdownTimeSeconds","notes","setRefClicked","player","currentTime","updateExperimentSilent","initializeUploader","uploadedVideoFilename","uppy","allowMultipleUploads","use","getUploadParameters","ext","accept","content-type","contentType","json","successful","experimentCreateVideoJob","showUploadDialog","getPlugin","openModal","intervalJob","experimentGetVideoJob","cancel","2168","ConfigCtrl","appEditCtrl","initDatasource","res_1","dsInstance","2169","TestDataAnnotationsQueryCtrl","2170","TestDataDatasource","scenarioId","stringInput","2171","TestDataQueryCtrl","scenarioList","newPointTime","selectedPoint","getPoints","pointSelected","deletePoint","addPoint","newPointValue","scenario","scenarioChanged","2172","Subscriber_1","Subscription_1","ObjectUnsubscribedError_1","SubjectSubscription_1","rxSubscriber_1","SubjectSubscriber","destination","Subscriber","observers","isStopped","hasError","thrownError","rxSubscriber","lift","subject","AnonymousSubject","ObjectUnsubscribedError","_trySubscribe","Subscription","EMPTY","SubjectSubscription","asObservable","observable","2173","2174","subscriberIndex","2175","empty_1","2176","2177","from_1","2178","FromObservable_1","FromObservable","2179","isArray_1","isArrayLike_1","isPromise_1","PromiseObservable_1","IteratorObservable_1","ArrayObservable_1","ArrayLikeObservable_1","iterator_1","observeOn_1","observable_1","ish","PromiseObservable","IteratorObservable","ArrayLikeObservable","ObserveOnSubscriber","2180","dispatchNext","dispatchError","2181","getIterator","StringIterator","ArrayIterator","toLength","numberIsFinite","sign","maxSafeInteger","valueAsNumber","2182","2183","arrayLike","2184","observeOn","delay","ObserveOnOperator","Notification_1","observe","scheduleMessage","ObserveOnMessage","_next","Notification","createNext","_error","createError","_complete","createComplete","2185","kind","hasValue","observer","do","nextOrObserver","toObservable","undefinedValueNotification","completeNotification","2186","map_1","2187","project","2188","MapOperator","MapSubscriber","2189","combineAll_1","combineAll","2190","2191","combineLatest_1","CombineLatestOperator","2192","combineLatest","observables","OuterSubscriber_1","subscribeToResult_1","none","CombineLatestSubscriber","toRespond","subscribeToResult","notifyComplete","unused","notifyNext","outerValue","innerValue","outerIndex","innerIndex","innerSub","oldVal","_tryProject","OuterSubscriber","2193","notifyError","2194","outerSubscriber","InnerSubscriber_1","InnerSubscriber","syncErrorThrowable","obs","isObject_1","2195","2196","canvas","combine","combined","numCombined","pie","newdata","percent","newCtx","maxRadius","tilt","centerTop","centerLeft","slices","attempts","REDRAW_SHRINK","shadowLeft","shadowTop","globalAlpha","drawSlice","currentAngle","drawDonutHole","plf","halfAngle","labelTop","labelLeft","insertBefore","REDRAW_ATTEMPTS","prepend","setSeries","innerRadius","globalCompositeOperation","isPointInPoly","poly","findNearbySlice","isPointInPath","2197","pluginDirectiveLoader","$http","$templateCache","getTemplate","cached","relativeTemplateUrlToAbs","baseUrl","getPluginComponentDirective","Component","bindings","loadPanelComponentInfo","componentInfo","class","panelInfo","panelCtrlPromise","__WEBPACK_IMPORTED_MODULE_5_app_plugins_panel_unknown_module__","__WEBPACK_IMPORTED_MODULE_4__plugin_loader__","panelModule","registeredAs","templatePromise","getModule","dsModule","panel-ctrl","dsMeta","notFound","model_1","appModule","app-model","app-edit-ctrl","appModel_1","appendAndCompile","registerPluginComponent","directiveName","$normalize","2198","UnknownPanelCtrl","2199","__WEBPACK_IMPORTED_MODULE_30_app_core_core_module__","__WEBPACK_IMPORTED_MODULE_31__dashboard_list_ctrl__","__WEBPACK_IMPORTED_MODULE_32__folder_dashboards_ctrl__","__WEBPACK_IMPORTED_MODULE_33__folder_settings_ctrl__","__WEBPACK_IMPORTED_MODULE_34__dashboard_import_ctrl__","__WEBPACK_IMPORTED_MODULE_35__create_folder_ctrl__","2200","DashboardCtrl","keybindingSrv","alertingSrv","unsavedChangesSrv","dashboardViewStateSrv","playlistSrv","panelLoader","editTab","getPanelContainer","isHome","setupDashboard","setupDashboardInternal","onInitFailed","setCurrent","finishSetupDashboardInternal","processRepeats","dashboardViewState","setupDashboardBindings","setWindowTitleAndTheme","fatal","loadedFallbackDashboard","templateVariableUpdated","showJsonEditor","getDashboard","getPanelLoader","timezoneChanged","onRemovingPanel","getPanelInfoById","ask","confirmText","addExperimentMetaPanel","video","addVideoPanel","addSensorPanel","onScroll","ngScroll","2201","AlertingSrv","2202","dashboardHistoryDirective","HistoryListCtrl","__WEBPACK_IMPORTED_MODULE_3_moment__","__WEBPACK_IMPORTED_MODULE_3_moment___default","__WEBPACK_IMPORTED_MODULE_4_app_core_utils_location_util__","$route","historySrv","appending","canCompare","onDashboardSaved","resetFromSource","switchMode","addToLog","getLog","revisionSelectionChanged","revisions","checked","formatBasicDate","getDiff","newInfo","baseInfo","isNewLatest","new","diffType","calculateDiff","getHistoryList","revisions_1","rev","createdDateString","ageString","isLastPage","basic","restoreConfirm","restoreDashboard","stripBaseFromUrl","reload","2203","HistorySrv","2204","__WEBPACK_IMPORTED_MODULE_3_jquery__","__WEBPACK_IMPORTED_MODULE_3_jquery___default","__WEBPACK_IMPORTED_MODULE_5_app_core_utils_datemath__","__WEBPACK_IMPORTED_MODULE_6_app_core_services_impression_srv__","DashboardLoaderSrv","_dashboardLoadFailed","canStar","canDelete","canSave","dashboardNotFound","loadDashboard","_loadScriptedDashboard","getDashboardByUid","isFolder","isSignedIn","addDashboardImpression","_executeScript","fromScript","services","script_func","Function","script_result","2205","dashNavDirective","DashNavCtrl","transclude","saveDashboard","titleTooltip","calendar","expires","toggleSettings","editview","shareDashboard","hideTooltip","showSearch","addPanel","animate","navItemClicked","navItem","clickHandler","2206","submenuDirective","SubmenuCtrl","annotationStateChanged","openEditView","2207","saveDashboardAsDirective","SaveDashboardAsModalCtrl","isValidFolderSelection","editable","hideControls","autoUpdate","keyDown","keyCode","onEnterFolderCreation","onExitFolderCreation","2208","saveDashboardModalDirective","SaveDashboardModalCtrl","saveVariables","saveTimerange","originalCurrent","timeChange","variableValueChange","isSaving","hasTimeChanged","hasVariableValuesChanged","saveForm","postSave","resetOriginalVariables","resetOriginalTime","2209","saveProvisionedDashboardModalDirective","SaveProvisionedDashboardModalCtrl","__WEBPACK_IMPORTED_MODULE_1_file_saver__","dashboardJson","getJsonForClipboard","2210","__WEBPACK_IMPORTED_MODULE_1_app_core_config__","ShareModalCtrl","forCurrent","includeTemplateVars","theme","modeSharePanel","tabs","modalTitle","buildUrl","absUrl","orgId","shareUrl","soloUrl","iframeHtml","imageUrl","getLocalTimeZone","utcOffset","Intl","DateTimeFormat","resolvedOptions","timeZone","getShareUrl","2211","ShareSnapshotCtrl","timeoutSeconds","expireOptions","accessOptions","externalUrl","sharingButtonText","externalEnabled","apiUrl","createSnapshot","external","originalUrl","saveSnapshot","scrubDashboard","cmdData","postUrl","snapshotUrl","saveExternalSnapshotRef","deleteKey","getSnapshotUrl","singlePanel","forEachPanel","deleteSnapshot","2212","__WEBPACK_IMPORTED_MODULE_1__dashboard_model__","__WEBPACK_IMPORTED_MODULE_2_app_core_utils_location_util__","DashboardSrv","handleSaveDashboardError","altActionText","onAltAction","showSaveAsModal","newUrl","provisioned","showDashboardProvisionedModal","makeEditable","showSaveModal","saveJSONDashboard","2213","DashboardViewState","panelScopes","urlState","getQueryStringState","needsSync","registerPanel","serializeToUrl","fromRouteUpdated","toggle","editStateChanged","toggleCollapsedPanelRow","syncState","collapsed","rowPanel","toggleRow","panelScope","getPanelScope","fullscreenPanel","leaveFullscreen","enterFullscreen","setViewMode","oldTimeRange","2214","hitTypes","FOLDER","DASHBOARD","ValidationSrv","rootName","validateNewDashboardName","validateNewFolderName","existingErrorMessage","nameLowerCased","hits_1","2215","TimeSrv","timer","routeUpdated","autoRefreshBlocked","visibilityState","refreshDashboard","cancelAll","initTimeFromUrl","parseTime","timeAtLoad","setAutoRefresh","parseUrlParam","urlRange","timeHasChangedSinceLoad","cancelNextRefresh","refreshTimer","startNextRefreshTimer","afterMs","isGrafanaVisible","fromRouteUpdate","isMoment","oldRefresh","urlParams","timespan","center","2216","$window","tracker","__WEBPACK_IMPORTED_MODULE_1__change_tracker__","2217","ChangeTracker","__WEBPACK_IMPORTED_MODULE_2__dashboard_model__","originalCopyDelay","originalPath","original","onbeforeunload","ignoreChanges","hasChanges","open_modal","fromFile","cleanDashboardFromIgnoredChanges","dashData","expandRows","schemaVersion","iteration","repeatPanelId","currentTimepicker","originalTimepicker","discardChanges","gotoNext","baseLen","nextUrl","2218","unsavedChangesModalDirective","UnsavedChangesModalCtrl","discard","2219","settingsDirective","TimePickerCtrl","timePickerDirective","__WEBPACK_IMPORTED_MODULE_3_app_core_utils_rangeutil__","__WEBPACK_IMPORTED_MODULE_4__input_date__","openDropdown","timepicker","firstDayOfWeek","localeData","timeRaw","local","tZero","secs","rangeString","absolute","fromJs","toDate","toJs","zoom","isOpen","closeDropdown","editTimeRaw","timeOptions","refresh_intervals","applyCustom","absoluteFromChanged","getAbsoluteMomentForTimezone","absoluteToChanged","jsDate","setRelativeFilter","nowDelay","time_options","2220","inputDateDirective","$elem","ngModel","fromUser","$setValidity","parsed","toUser","currentValue","$parsers","$formatters","2221","uploadDashboardDirective","onUpload","file_selected","files","reader","FileReader","onload","readAsText","wnd","File","FileList","getElementById","2222","dashExportDirective","DashExportCtrl","__WEBPACK_IMPORTED_MODULE_3__exporter__","exporter","makeExportable","saveJson","2223","DashboardExporter","cleanUpRepeats","requires","variableLookup","templateizeDatasourceUsage","refName","processPanel","panelDef","_h","_j","annotationDef","buildInfo","newObj","2224","exportDataModal","ExportDataModalCtrl","__WEBPACK_IMPORTED_MODULE_1_app_core_utils_file_export__","asRows","export","2225","dashExportExperimentDirective","DashExportExperimentCtrl","sampleInterval","isEmailLoading","makeUrl","intervalChanged","prefilled","cookie","copyLink","2226","adHocFiltersComponent","AdHocFiltersCtrl","buildSegmentModel","segmentChanged","updateVariableModel","filterIndex","hasFakes","2227","dashRepeatOptionDirective","repeat","repeatDirection","optionChanged","2228","__WEBPACK_IMPORTED_MODULE_0_app_core_utils_react2angular__","__WEBPACK_IMPORTED_MODULE_1__DashboardGrid__","watchDepth","wrapApply","2229","GridWrapper","onLayoutChange","onDragStop","onResize","onResizeStop","onWidthChange","isResizable","isDraggable","lastGridWidth","__WEBPACK_IMPORTED_MODULE_0_react___default","__WEBPACK_IMPORTED_MODULE_1_react_grid_layout___default","measureBeforeMount","containerPadding","useCSSTransforms","__WEBPACK_IMPORTED_MODULE_2_app_core_constants__","cols","rowHeight","draggableHandle","DashboardGrid","__WEBPACK_IMPORTED_MODULE_0_react__","__WEBPACK_IMPORTED_MODULE_1_react_grid_layout__","__WEBPACK_IMPORTED_MODULE_3__DashboardPanel__","__WEBPACK_IMPORTED_MODULE_4_classnames__","__WEBPACK_IMPORTED_MODULE_4_classnames___default","__WEBPACK_IMPORTED_MODULE_5_react_sizeme__","__WEBPACK_IMPORTED_MODULE_5_react_sizeme___default","SizedReactLayoutGrid","monitorWidth","panelContainer","animated","triggerForceUpdate","buildLayout","panelMap","stringId","panelPos","newLayout","newLayout_1","newPos","updateGridPos","forceUpdate","resizeDone","oldItem","newItem","componentDidMount","setState","renderPanels","panelElements","panelClasses","panel--fullscreen","2230","DashboardPanel","__WEBPACK_IMPORTED_MODULE_1__DashboardRow__","__WEBPACK_IMPORTED_MODULE_2__AddPanelPanel__","attachedPanel","componentWillUnmount","2231","DashboardRow","__WEBPACK_IMPORTED_MODULE_1_classnames__","__WEBPACK_IMPORTED_MODULE_1_classnames___default","__WEBPACK_IMPORTED_MODULE_2_app_features_templating_template_srv__","openSettings","prevState","onUpdated","removeRow","dashboard-row","dashboard-row--collapsed","chevronClass","fa","fa-chevron-down","fa-chevron-right","2232","AddPanelPanel","__WEBPACK_IMPORTED_MODULE_2_classnames__","__WEBPACK_IMPORTED_MODULE_2_classnames___default","__WEBPACK_IMPORTED_MODULE_3_app_core_config__","__WEBPACK_IMPORTED_MODULE_4_app_core_components_ScrollBar_ScrollBar__","__WEBPACK_IMPORTED_MODULE_5_app_core_store__","__WEBPACK_IMPORTED_MODULE_7_react_highlight_words__","__WEBPACK_IMPORTED_MODULE_7_react_highlight_words___default","__WEBPACK_IMPORTED_MODULE_8_app_core_app_events__","onAddPanel","panelPluginInfo","handleCloseAddPanel","renderPanelItem","panelSizeChanged","panelPlugins","getPanelPlugins","copiedPanelPlugins","getCopiedPanelPlugins","scrollbar","hideFromList","small","filterPanels","copiedPanels","copiedPanelJson","copiedPanel","pluginCopy","searchWords","highlightClassName","textToHighlight","noCopiedPanelPlugins","filterChange","filterKeyPress","openCopy","openAdd","panelTab","active active--panel","","copyClass","autoFocus","onKeyPress","2233","__WEBPACK_IMPORTED_MODULE_1_baron__","__WEBPACK_IMPORTED_MODULE_1_baron___default","ScrollBar","handleRef","parentElement","componentDidUpdate","setScrollTop","setScrollLeft","scrollLeft","2234","PanelLoader","compiledElem","2235","rowOptionsDirective","RowOptionsCtrl","__WEBPACK_IMPORTED_MODULE_0_app_core_core__","2236","folderPicker","FolderPickerCtrl","initialTitle","initialFolderId","labelClass","onLoad","onCreateFolder","enterFolderCreation","exitFolderCreation","enableCreateNew","enableReset","validationSrv","loadInitialValue","permission","createNewFolder","$folder","newFolderNameChanged","newFolderNameTouched","newFolderName","hasValidationError","validationError","createFolder","closeCreateFolder","cancelCreateFolder","resetFolder","rootFolder","onFolderLoad","2237","moveToFolderModal","MoveToFolderCtrl","afterSave","__WEBPACK_IMPORTED_MODULE_1_app_core_app_events__","moveDashboards","successCount","totalCount","alreadyInFolderCount","2238","dashboardSettings","SettingsCtrl","__WEBPACK_IMPORTED_MODULE_3_angular__","__WEBPACK_IMPORTED_MODULE_3_angular___default","canSaveAs","hasEditPermissionInFolders","buildSectionList","onRouteUpdated","onPostSave","sections","section","sectionParams","viewId","openSaveAsModal","saveDashboardJson","hasUnsavedFolderChange","hideSettings","currentSection","deleteDashboard","sumBy","deleteDashboardConfirmed","getFolder","2239","DashboardListCtrl","2240","FolderDashboardsCtrl","__WEBPACK_IMPORTED_MODULE_0__folder_page_loader__","__WEBPACK_IMPORTED_MODULE_1_app_core_utils_location_util__","2241","FolderSettingsCtrl","folderPageLoader","hasChanged","updateFolder","handleSaveFolderError","deleteFolder","2242","DashboardImportCtrl","nameExists","uidExists","autoGenerateUid","autoGenerateUidValue","initialFolderTitle","gnetId","gnetUrl","checkGnetDashboard","__inputs","inputModel","setDatasourceOptions","inputsValid","uidChanged","inputValueChanged","titleTouched","hasNameValidationError","nameValidationError","hasUidValidationError","uidValidationError","importedUrl","loadJsonText","parseError","jsonText","gnetError","gnetInfo","back","2243","CreateFolderCtrl","__WEBPACK_IMPORTED_MODULE_0_app_core_app_events__","2244","__WEBPACK_IMPORTED_MODULE_1__experiment_create_ctrl__","__WEBPACK_IMPORTED_MODULE_2__experiment_edit_ctrl__","__WEBPACK_IMPORTED_MODULE_3__experiment_folder_create_ctrl__","__WEBPACK_IMPORTED_MODULE_4__experiment_folder_edit_ctrl__","2245","ExperimentCreateCtrl","__WEBPACK_IMPORTED_MODULE_1_app_core_nav_model_srv__","submitLabel","inputDisabled","showDelete","hideFromTabs","submit","createExperiment","history","2246","ExperimentEditCtrl","getExperiment","startTimeSeconds","endTimeSeconds","updateExperiment","timesChanged","deleteExperiment","2247","ExperimentFolderCreateCtrl","createExperimentFolder","2248","ExperimentFolderEditCtrl","deleteExperimentFolder","2249","__WEBPACK_IMPORTED_MODULE_1__sensor_edit_ctrl__","__WEBPACK_IMPORTED_MODULE_2__sensor_create_ctrl__","__WEBPACK_IMPORTED_MODULE_3__sensor_bind_ctrl__","2250","SensorEditCtrl","getSensor","updateSensor","permanentDelete","deleteSensor","deleteall","2251","SensorCreateCtrl","bindToExperimentId","createSensor","2252","SensorBindCtrl","canAdd","setupNav","doQuery","addSensors","ids","experimentAddSensors","onQueryChange","sensors","bindingExists","toggleSelection","2253","deleteSensorModalDirective","DeleteSensorModalCtrl","removeThis","experimentRemoveSensor","removeAll","2254","2255","__WEBPACK_IMPORTED_MODULE_1__core_core_module__","PlaylistsCtrl","playlists","removePlaylistConfirmed","playlist","removePlaylist","2256","playlistSearchDirective","PlaylistSearchCtrl","searchStarted","tagsMode","prom","dashboardResult","tagResult","showStarred","queryHasNoFilters","filterByTag","2257","PlaylistSrv","cancelPromise","getUrlWithKioskMode","inKioskMode","classList","contains","startUrl","playlistId","stop","isPlaying","kiosk","2258","PlaylistEditCtrl","filteredDashboards","filteredTags","playlistItems","dashboardresult","tagresult","filterFoundPlaylistItems","playlistItem","listPlaylistItem","term","addPlaylistItem","addTagPlaylistItem","removePlaylistItem","listedPlaylistItem","savePlaylist","savePromise","isPlaylistEmpty","movePlaylistItem","currentPosition","newPosition","movePlaylistItemUp","movePlaylistItemDown","2259","grafanaRoutes","$routeProvider","2260","2261","SnapshotsCtrl","snapshots","removeSnapshotConfirmed","removeSnapshot","2262","2263","renderMenuItem","listItemClass","createMenuTemplate","panelHeader","togglePanelMenu","isDragged","togglePanelStackPosition","dropdown","parentsUntil","menuElem","menuScope","targetClass","menuHtml","mouseup","2264","__WEBPACK_IMPORTED_MODULE_2_tether_drop__","__WEBPACK_IMPORTED_MODULE_2_tether_drop___default","$document","mouseEnter","setPanelFocus","mouseLeave","panelHeightUpdated","panelContent","resizeScrollableContent","panelScrollbar","updatePanelCornerInfo","cornerMode","cornerInfoElem","infoDrop","hoverOpenDelay","lastAlertState","hasAlertRule","transparentLastState","lastHasAlertRule","transparent","$watchGroup","$watchCollection","2265","SoloPanelCtrl","dashboardLoaderSrv","sidemenu","initPanelScope","getDashboardBySlug","initDashboard","2266","panelEditorTab","dynamicDirectiveSrv","2267","queryEditorRowDirective","QueryRowCtrl","queryCtrl","canCollapse","hasTextEditMode","toggleCollapse","toggleHideQuery","__collapsedQueryCache","collapsedText","duplicateQuery","2268","queryTroubleshooter","QueryTroubleshooterCtrl","renderJsonExplorer","jsonElem","jsonExplorer","animateOpen","onRequestErrorEventListener","onRequestError","onRequestResponseEventListener","onRequestResponse","removeEventsListeners","stateChanged","toggleMocking","isMocking","isLoading","getClipboardText","handleMocking","mockedData","mockedResponse","transformResponse","jsonpCallbackParam","retry","timeout","toggleExpand","allNodesExpanded","openAtDepth","2269","2270","ProfileCtrl","orgs","showOrgsList","readonlyLoginFields","getUser","getUserOrgs","setUsingOrg","org","userForm","old_theme","2271","SelectOrgCtrl","2272","ChangePasswordCtrl","command","authProxyEnabled","ldapEnabled","changePassword","newPassword","confirmNew","2273","NewOrgCtrl","newOrg","createOrg","2274","UserInviteCtrl","sendEmail","sendInvite","inviteForm","2275","TeamsCtrl","pages","perPage","showPaging","teams","totalPages","navigateToPage","deleteTeam","team","deleteTeamConfirmed","openTeamModal","2276","TeamDetailsCtrl","teamMembers","userPicked","removeTeamMember","teamMember","removeMemberConfirmed","teamDetailsForm","2277","CreateTeamCtrl","teamId","2278","OrgApiKeysCtrl","roleTypes","removeToken","addToken","rootPath","copyToClipboard","execCommand","2279","OrgDetailsCtrl","getOrgInfo","orgName","orgForm","updateAddress","addressForm","2280","prefsControlDirective","PrefsControlCtrl","timezones","themes","prefs","oldTheme","updatePrefs","prefsForm","cmd","homeDashboardId","2281","__WEBPACK_IMPORTED_MODULE_0__admin_list_users_ctrl__","__WEBPACK_IMPORTED_MODULE_5_app_core_core_module__","AdminSettingsCtrl","AdminHomeCtrl","AdminStatsCtrl","2282","AdminListUsersCtrl","getUsers","impersonate","deleteUser","2283","AdminListOrgsCtrl","getOrgs","deleteOrg","2284","AdminEditOrgCtrl","getOrg","getOrgUsers","orgUsers","orgDetailsForm","orgUser","removeOrgUser","2285","AdminEditUserCtrl","permissions","user_id","isGrafanaAdmin","setPassword","passwordForm","updatePermissions","orgsSearchCache","searchOrgs","addOrgUser","addOrgForm","orgInfo","loginOrEmail","2286","AdminListExperimentsCtrl","getExperiments","experiments","2287","2288","AlertNotificationsListCtrl","loadNotifications","deleteNotification","2289","AlertNotificationEditCtrl","testSeverity","autoResolve","uploadImage","notifiers","notifier","getNotifierTemplateId","optionsTemplate","notifierTemplateId","theForm","testNotification","2290","StyleGuideCtrl","buttonNames","buttonSizes","buttonVariants","switchTheme","2291","__WEBPACK_IMPORTED_MODULE_1_app_core_store__","TIME_UNITS","short","TIME_UNITS_COMPATIBLE_MODE","TIME_UNITS_CLI","UploadCtrl","uploadProgressPercent","importProgressPercent","timeUnit","timeUnits","createDashboard","timeOffset","monitorImportProgressIntervalMs","statusCheckIntervalMs","compatibleMode","generateTimestamps","fileSelected","validateFile","fileArray","dropHandler","fileDrop","dotIndex","experimentTitle","startUpload","isUploading","uploadProgressText","importProgressText","totalBytes","uploadId","upload","checkStatus","previousStatus","serverStatus","uploadType","errorMessage","uploadError","csvHeaderLine","csvFirstTen","timeColumnOptions","loadConfig","setupTimeUnits","parseResult","commonFrequency","channel","frequencyHz","sampleFrequency","xhr","onprogress","loaded","importClicked","isImporting","configureTdms","configureCsv","importConfig","timeColumn","saveConfig","startImport","validateTdms","freq","channelConfig","channels","monitorImportProgress","importComplete","progress","importProgress","timeUnitShort","getTimeColumn","setTimeColumn","configStr","selectTimeUnit","candidates","compatibleModeClicked","originalEvent","ev","dataTransfer","getAsFile","$setViewValue","file_1","selectNgFiles"],"mappings":"AAAAA,cAAc,IAERC,KACA,SAAUC,EAAQC,EAAqBC,GAE7C,YACAC,QAAOC,eAAeH,EAAqB,cAAgBI,OAAO,GACUH,GAAoB,MACrBA,EAAoB,MACrBA,EAAoB,MACrBA,EAAoB,MACvBA,EAAoB,MAClBA,EAAoB,MAClBA,EAAoB,MACxBA,EAAoB,MACnBA,EAAoB,MACpBA,EAAoB,MACtBA,EA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Fq+gBDj0F,KiFn+gBAqP,KAAQ,EAx6BPnX,EAAA,EAAAo8F,CjFo3iBL,KAAK,GiFn3iBArrE,GAAA9wB,EAAA,GACAyuB,EAAAzuB,EAAAsK,EAAAwmB,GAUHurE,GACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,IACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,MACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OAEE,OAEJ,OACE,OjF8+gBE,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OACA,OiF5+gBH,OAEG,OAEE,OACJ,OACA,OACA,OACD,OAED,OACE,OjF2+gBE,OiFz+gBF,OAEA,OjF0+gBE,OACA,OACA,OiFx+gBF,QjF2+gBEC,KiFv+gBAn7F,EAAI,EAAAA,EAAM,IAAAA,IjFy+gBVm7F,EiFx+gBgBn7F,GjFy+gBXA,GiFx+gBH,IAAKA,GAAK,IACX,KAAAA,GACM,MAAPA,GACD,MAAAA,GAEKA,GAAA,IAAAA,GAAA,IACK,KAALA,GAEJ,KAAAA,GACS,KAALA,GACF,KAAAA,GACE,KjFs+gBIA,GiFr+gBJ,KjFs+gBIA,GiFr+gBL,KjFs+gBKA,GiFp+gBF,KAAJA,GACE,KjFq+gBIA,GiFp+gBJ,KjFq+gBIA,GiFp+gBLA,GAAA,IAAAA,GAAA,GjFu+gBP,IAAIo7F,GiFp+gBiBD,CjF0+gBrBH,GAAM54E,WACFi5E,KAAM,SiFl+gBGr7F,Gj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AKmsB,EAAGjsB,OAAQF,IAAM,CAC/D,GAAI+c,GAAOoP,EAAGnsB,EACd,IAAkB,SAAd+c,EAAKg4I,KAAiB,CACtB,GAAIjhF,GAAO/2D,EAAKgkL,WAEhB,YADAruB,GAAQsuB,cAAcltH,QAM9B,KAAK,GAAIiL,GAAK,EAAGC,EAAK6hH,EAAGC,aAAaxtB,MAAOv0F,EAAKC,EAAG9+E,OAAQ6+E,IAAM,CAC/D,GAAIkiH,GAASjiH,EAAGD,EAEhB,YADA2zF,GAAQsuB,cAAcC,SAQ1CC,EAAgB,WAChB,OACI9rK,QAAS,UACThJ,KAAM,SAAkB9F,EAAOlkB,EAAM8+D,EAAOwxG,GACxCtwK,EAAK2yC,GAAG,SAAU,SAAUp3B,GACxB,GAAI21J,GAAQlxK,EAAK,GAAGkxK,KACpBZ,GAAQsuB,cAAc1tB,OAKtCz/G,GAAoE,EAAE7qB,WAAW,aAAcyzJ,GAC/F5oI,EAAoE,EAAE1mB,UAAU,gBAAiB+zJ,GACjGrtI,EAAoE,EAAE1mB,UAAU,WAAYqwJ,GAC5F3pI,EAAoE,EAAEjmC,OAAO,cAAe,WACxF,MAAO,UAAU0tE,GACb,MAAOA,GAAMl/E,QAAQ,GAAI5b,QAAO,IAAK,KAAM","file":"0.89154e0f2714751e6227.js","sourcesContent":["webpackJsonp([0],{\n\n/***/ 1982:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__panellinks_module__ = __webpack_require__(2040);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dashlinks_module__ = __webpack_require__(2041);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__annotations_all__ = __webpack_require__(1995);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__templating_all__ = __webpack_require__(2049);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__plugins_all__ = __webpack_require__(2059);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__dashboard_all__ = __webpack_require__(2199);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__experiments_all__ = __webpack_require__(2244);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__sensors_all__ = __webpack_require__(2249);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__playlist_all__ = __webpack_require__(2254);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__snapshot_all__ = __webpack_require__(2260);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__panel_all__ = __webpack_require__(2262);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__org_all__ = __webpack_require__(2269);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__admin_admin__ = __webpack_require__(2281);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__alerting_all__ = __webpack_require__(2287);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__styleguide_styleguide__ = __webpack_require__(2290);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__upload_upload__ = __webpack_require__(2291);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/***/ }),\n\n/***/ 1983:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_features_panel_panel_ctrl__ = __webpack_require__(1986);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_features_panel_metrics_panel_ctrl__ = __webpack_require__(2070);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_features_panel_query_ctrl__ = __webpack_require__(1998);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_app_features_alerting_alert_tab_ctrl__ = __webpack_require__(2072);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_app_features_plugins_plugin_loader__ = __webpack_require__(1990);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"PanelCtrl\", function() { return __WEBPACK_IMPORTED_MODULE_0_app_features_panel_panel_ctrl__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"MetricsPanelCtrl\", function() { return __WEBPACK_IMPORTED_MODULE_1_app_features_panel_metrics_panel_ctrl__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"QueryCtrl\", function() { return __WEBPACK_IMPORTED_MODULE_2_app_features_panel_query_ctrl__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"alertTab\", function() { return __WEBPACK_IMPORTED_MODULE_3_app_features_alerting_alert_tab_ctrl__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"loadPluginCss\", function() { return __WEBPACK_IMPORTED_MODULE_4_app_features_plugins_plugin_loader__[\"b\"]; });\n\n\n\n\n\n\n\n\n/***/ }),\n\n/***/ 1984:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return variableTypes; });\n/* harmony export (immutable) */ __webpack_exports__[\"b\"] = containsVariable;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_utils_kbn__ = __webpack_require__(312);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_utils_model_utils__ = __webpack_require__(708);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return __WEBPACK_IMPORTED_MODULE_1_app_core_utils_model_utils__[\"a\"]; });\n\n\nvar variableTypes = {};\n\nfunction containsVariable() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var variableName = args[args.length - 1];\n var str = args[0] || '';\n for (var i = 1; i < args.length - 1; i++) {\n str += ' ' + args[i] || '';\n }\n variableName = __WEBPACK_IMPORTED_MODULE_0_app_core_utils_kbn__[\"a\" /* default */].regexEscape(variableName);\n var findVarRegex = new RegExp('\\\\$(' + variableName + ')(?:\\\\W|$)|\\\\[\\\\[(' + variableName + ')\\\\]\\\\]', 'g');\n var match = findVarRegex.exec(str);\n return match !== null;\n}\n\n\n/***/ }),\n\n/***/ 1985:\n/***/ (function(module, exports) {\n\n/* Javascript plotting library for jQuery, version 0.8.3.\n\nCopyright (c) 2007-2014 IOLA and Ole Laursen.\nLicensed under the MIT license.\n\n*/\n\n// first an inline dependency, jquery.colorhelpers.js, we inline it here\n// for convenience\n\n/* Plugin for jQuery for working with colors.\n *\n * Version 1.1.\n *\n * Inspiration from jQuery color animation plugin by John Resig.\n *\n * Released under the MIT license by Ole Laursen, October 2009.\n *\n * Examples:\n *\n * $.color.parse(\"#fff\").scale('rgb', 0.25).add('a', -0.5).toString()\n * var c = $.color.extract($(\"#mydiv\"), 'background-color');\n * console.log(c.r, c.g, c.b, c.a);\n * $.color.make(100, 50, 25, 0.4).toString() // returns \"rgba(100,50,25,0.4)\"\n *\n * Note that .scale() and .add() return the same modified object\n * instead of making a new one.\n *\n * V. 1.1: Fix error handling so e.g. parsing an empty string does\n * produce a color rather than just crashing.\n */\n(function($){$.color={};$.color.make=function(r,g,b,a){var o={};o.r=r||0;o.g=g||0;o.b=b||0;o.a=a!=null?a:1;o.add=function(c,d){for(var i=0;i=1){return\"rgb(\"+[o.r,o.g,o.b].join(\",\")+\")\"}else{return\"rgba(\"+[o.r,o.g,o.b,o.a].join(\",\")+\")\"}};o.normalize=function(){function clamp(min,value,max){return valuemax?max:value}o.r=clamp(0,parseInt(o.r),255);o.g=clamp(0,parseInt(o.g),255);o.b=clamp(0,parseInt(o.b),255);o.a=clamp(0,o.a,1);return o};o.clone=function(){return $.color.make(o.r,o.b,o.g,o.a)};return o.normalize()};$.color.extract=function(elem,css){var c;do{c=elem.css(css).toLowerCase();if(c!=\"\"&&c!=\"transparent\")break;elem=elem.parent()}while(elem.length&&!$.nodeName(elem.get(0),\"body\"));if(c==\"rgba(0, 0, 0, 0)\")c=\"transparent\";return $.color.parse(c)};$.color.parse=function(str){var res,m=$.color.make;if(res=/rgb\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10));if(res=/rgba\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\s*\\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10),parseFloat(res[4]));if(res=/rgb\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55);if(res=/rgba\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\s*\\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55,parseFloat(res[4]));if(res=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(str))return m(parseInt(res[1],16),parseInt(res[2],16),parseInt(res[3],16));if(res=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(str))return m(parseInt(res[1]+res[1],16),parseInt(res[2]+res[2],16),parseInt(res[3]+res[3],16));var name=$.trim(str).toLowerCase();if(name==\"transparent\")return m(255,255,255,0);else{res=lookupColors[name]||[0,0,0];return m(res[0],res[1],res[2])}};var lookupColors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);\n\n// the actual Flot code\n(function($) {\n\n\t// Cache the prototype hasOwnProperty for faster access\n\n\tvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\n // A shim to provide 'detach' to jQuery versions prior to 1.4. Using a DOM\n // operation produces the same effect as detach, i.e. removing the element\n // without touching its jQuery data.\n\n // Do not merge this into Flot 0.9, since it requires jQuery 1.4.4+.\n\n if (!$.fn.detach) {\n $.fn.detach = function() {\n return this.each(function() {\n if (this.parentNode) {\n this.parentNode.removeChild( this );\n }\n });\n };\n }\n\n\t///////////////////////////////////////////////////////////////////////////\n\t// The Canvas object is a wrapper around an HTML5 tag.\n\t//\n\t// @constructor\n\t// @param {string} cls List of classes to apply to the canvas.\n\t// @param {element} container Element onto which to append the canvas.\n\t//\n\t// Requiring a container is a little iffy, but unfortunately canvas\n\t// operations don't work unless the canvas is attached to the DOM.\n\n\tfunction Canvas(cls, container) {\n\n\t\tvar element = container.children(\".\" + cls)[0];\n\n\t\tif (element == null) {\n\n\t\t\telement = document.createElement(\"canvas\");\n\t\t\telement.className = cls;\n\n\t\t\t$(element).css({ direction: \"ltr\", position: \"absolute\", left: 0, top: 0 })\n\t\t\t\t.appendTo(container);\n\n\t\t\t// If HTML5 Canvas isn't available, fall back to [Ex|Flash]canvas\n\n\t\t\tif (!element.getContext) {\n\t\t\t\tif (window.G_vmlCanvasManager) {\n\t\t\t\t\telement = window.G_vmlCanvasManager.initElement(element);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(\"Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.element = element;\n\n\t\tvar context = this.context = element.getContext(\"2d\");\n\n\t\t// Determine the screen's ratio of physical to device-independent\n\t\t// pixels. This is the ratio between the canvas width that the browser\n\t\t// advertises and the number of pixels actually present in that space.\n\n\t\t// The iPhone 4, for example, has a device-independent width of 320px,\n\t\t// but its screen is actually 640px wide. It therefore has a pixel\n\t\t// ratio of 2, while most normal devices have a ratio of 1.\n\n\t\tvar devicePixelRatio = window.devicePixelRatio || 1,\n\t\t\tbackingStoreRatio =\n\t\t\t\tcontext.webkitBackingStorePixelRatio ||\n\t\t\t\tcontext.mozBackingStorePixelRatio ||\n\t\t\t\tcontext.msBackingStorePixelRatio ||\n\t\t\t\tcontext.oBackingStorePixelRatio ||\n\t\t\t\tcontext.backingStorePixelRatio || 1;\n\n\t\tthis.pixelRatio = devicePixelRatio / backingStoreRatio;\n\n\t\t// Size the canvas to match the internal dimensions of its container\n\n\t\tthis.resize(container.width(), container.height());\n\n\t\t// Collection of HTML div layers for text overlaid onto the canvas\n\n\t\tthis.textContainer = null;\n\t\tthis.text = {};\n\n\t\t// Cache of text fragments and metrics, so we can avoid expensively\n\t\t// re-calculating them when the plot is re-rendered in a loop.\n\n\t\tthis._textCache = {};\n\t\tthis._textSizeCache = window.flotTextSizeCache = window.flotTextSizeCache || {};\n\t}\n\n\t// Resizes the canvas to the given dimensions.\n\t//\n\t// @param {number} width New width of the canvas, in pixels.\n\t// @param {number} width New height of the canvas, in pixels.\n\n\tCanvas.prototype.resize = function(width, height) {\n\n\t\tif (width <= 0 || height <= 0) {\n\t\t\tthrow new Error(\"Invalid dimensions for plot, width = \" + width + \", height = \" + height);\n\t\t}\n\n\t\tvar element = this.element,\n\t\t\tcontext = this.context,\n\t\t\tpixelRatio = this.pixelRatio;\n\n\t\t// Resize the canvas, increasing its density based on the display's\n\t\t// pixel ratio; basically giving it more pixels without increasing the\n\t\t// size of its element, to take advantage of the fact that retina\n\t\t// displays have that many more pixels in the same advertised space.\n\n\t\t// Resizing should reset the state (excanvas seems to be buggy though)\n\n\t\tif (this.width != width) {\n\t\t\telement.width = width * pixelRatio;\n\t\t\telement.style.width = width + \"px\";\n\t\t\tthis.width = width;\n\t\t}\n\n\t\tif (this.height != height) {\n\t\t\telement.height = height * pixelRatio;\n\t\t\telement.style.height = height + \"px\";\n\t\t\tthis.height = height;\n\t\t}\n\n\t\t// Save the context, so we can reset in case we get replotted. The\n\t\t// restore ensure that we're really back at the initial state, and\n\t\t// should be safe even if we haven't saved the initial state yet.\n\n\t\tcontext.restore();\n\t\tcontext.save();\n\n\t\t// Scale the coordinate space to match the display density; so even though we\n\t\t// may have twice as many pixels, we still want lines and other drawing to\n\t\t// appear at the same size; the extra pixels will just make them crisper.\n\n\t\tcontext.scale(pixelRatio, pixelRatio);\n\t};\n\n\t// Clears the entire canvas area, not including any overlaid HTML text\n\n\tCanvas.prototype.clear = function() {\n\t\tthis.context.clearRect(0, 0, this.width, this.height);\n\t};\n\n\t// Finishes rendering the canvas, including managing the text overlay.\n\n\tCanvas.prototype.render = function() {\n\n\t\tvar cache = this._textCache;\n\n\t\t// For each text layer, add elements marked as active that haven't\n\t\t// already been rendered, and remove those that are no longer active.\n\n\t\tfor (var layerKey in cache) {\n\t\t\tif (hasOwnProperty.call(cache, layerKey)) {\n\n\t\t\t\tvar layer = this.getTextLayer(layerKey),\n\t\t\t\t\tlayerCache = cache[layerKey];\n\n\t\t\t\tlayer.hide();\n\n\t\t\t\tfor (var styleKey in layerCache) {\n\t\t\t\t\tif (hasOwnProperty.call(layerCache, styleKey)) {\n\t\t\t\t\t\tvar styleCache = layerCache[styleKey];\n\t\t\t\t\t\tfor (var key in styleCache) {\n\t\t\t\t\t\t\tif (hasOwnProperty.call(styleCache, key)) {\n\n\t\t\t\t\t\t\t\tvar positions = styleCache[key].positions;\n\n\t\t\t\t\t\t\t\tfor (var i = 0, position; position = positions[i]; i++) {\n\t\t\t\t\t\t\t\t\tif (position.active) {\n\t\t\t\t\t\t\t\t\t\tif (!position.rendered) {\n\t\t\t\t\t\t\t\t\t\t\tlayer.append(position.element);\n\t\t\t\t\t\t\t\t\t\t\tposition.rendered = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tpositions.splice(i--, 1);\n\t\t\t\t\t\t\t\t\t\tif (position.rendered) {\n\t\t\t\t\t\t\t\t\t\t\tposition.element.detach();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (positions.length == 0) {\n\t\t\t\t\t\t\t\t\tdelete styleCache[key];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlayer.show();\n\t\t\t}\n\t\t}\n\t};\n\n\t// Creates (if necessary) and returns the text overlay container.\n\t//\n\t// @param {string} classes String of space-separated CSS classes used to\n\t// uniquely identify the text layer.\n\t// @return {object} The jQuery-wrapped text-layer div.\n\n\tCanvas.prototype.getTextLayer = function(classes) {\n\n\t\tvar layer = this.text[classes];\n\n\t\t// Create the text layer if it doesn't exist\n\n\t\tif (layer == null) {\n\n\t\t\t// Create the text layer container, if it doesn't exist\n\n\t\t\tif (this.textContainer == null) {\n\t\t\t\tthis.textContainer = $(\"
\")\n\t\t\t\t\t.css({\n\t\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\tbottom: 0,\n\t\t\t\t\t\tright: 0,\n\t\t\t\t\t\t'font-size': \"smaller\",\n\t\t\t\t\t\tcolor: \"#545454\"\n\t\t\t\t\t})\n\t\t\t\t\t.insertAfter(this.element);\n\t\t\t}\n\n\t\t\tlayer = this.text[classes] = $(\"
\")\n\t\t\t\t.addClass(classes)\n\t\t\t\t.css({\n\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\ttop: 0,\n\t\t\t\t\tleft: 0,\n\t\t\t\t\tbottom: 0,\n\t\t\t\t\tright: 0\n\t\t\t\t})\n\t\t\t\t.appendTo(this.textContainer);\n\t\t}\n\n\t\treturn layer;\n\t};\n\n\t// Creates (if necessary) and returns a text info object.\n\t//\n\t// The object looks like this:\n\t//\n\t// {\n\t// width: Width of the text's wrapper div.\n\t// height: Height of the text's wrapper div.\n\t// element: The jQuery-wrapped HTML div containing the text.\n\t// positions: Array of positions at which this text is drawn.\n\t// }\n\t//\n\t// The positions array contains objects that look like this:\n\t//\n\t// {\n\t// active: Flag indicating whether the text should be visible.\n\t// rendered: Flag indicating whether the text is currently visible.\n\t// element: The jQuery-wrapped HTML div containing the text.\n\t// x: X coordinate at which to draw the text.\n\t// y: Y coordinate at which to draw the text.\n\t// }\n\t//\n\t// Each position after the first receives a clone of the original element.\n\t//\n\t// The idea is that that the width, height, and general 'identity' of the\n\t// text is constant no matter where it is placed; the placements are a\n\t// secondary property.\n\t//\n\t// Canvas maintains a cache of recently-used text info objects; getTextInfo\n\t// either returns the cached element or creates a new entry.\n\t//\n\t// @param {string} layer A string of space-separated CSS classes uniquely\n\t// identifying the layer containing this text.\n\t// @param {string} text Text string to retrieve info for.\n\t// @param {(string|object)=} font Either a string of space-separated CSS\n\t// classes or a font-spec object, defining the text's font and style.\n\t// @param {number=} angle Angle at which to rotate the text, in degrees.\n\t// Angle is currently unused, it will be implemented in the future.\n\t// @param {number=} width Maximum width of the text before it wraps.\n\t// @return {object} a text info object.\n\n\tCanvas.prototype.getTextInfo = function(layer, text, font, angle, width) {\n\n\t\tvar textStyle, layerCache, styleCache, info;\n\n\t\t// Cast the value to a string, in case we were given a number or such\n\n\t\ttext = \"\" + text;\n\n\t\t// If the font is a font-spec object, generate a CSS font definition\n\n\t\tif (typeof font === \"object\") {\n\t\t\ttextStyle = font.style + \" \" + font.variant + \" \" + font.weight + \" \" + font.size + \"px/\" + font.lineHeight + \"px \" + font.family;\n\t\t} else {\n\t\t\ttextStyle = font;\n\t\t}\n\n\t\t// Retrieve (or create) the cache for the text's layer and styles\n\n\t\tlayerCache = this._textCache[layer];\n\n\t\tif (layerCache == null) {\n\t\t\tlayerCache = this._textCache[layer] = {};\n\t\t}\n\n\t\tstyleCache = layerCache[textStyle];\n\n\t\tif (styleCache == null) {\n\t\t\tstyleCache = layerCache[textStyle] = {};\n\t\t}\n\n\t\tinfo = styleCache[text];\n\n\t\t// If we can't find a matching element in our cache, create a new one\n\n\t\tif (info == null) {\n\n\t\t\tvar element = $(\"
\").html(text)\n\t\t\t\t.css({\n\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\t'max-width': width,\n\t\t\t\t\ttop: -9999\n\t\t\t\t})\n\t\t\t\t.appendTo(this.getTextLayer(layer));\n\n\t\t\tif (typeof font === \"object\") {\n\t\t\t\telement.css({\n\t\t\t\t\tfont: textStyle,\n\t\t\t\t\tcolor: font.color\n\t\t\t\t});\n\t\t\t} else if (typeof font === \"string\") {\n\t\t\t\telement.addClass(font);\n\t\t\t}\n\n info = styleCache[text] = { element: element, positions: [] };\n\n var size = this._textSizeCache[text];\n\t\t\tif (size) {\n info.width = size.width;\n info.height = size.height;\n\t\t\t} else {\n info.width = element.outerWidth(true);\n info.height = element.outerHeight(true);\n this._textSizeCache[text] = { width: info.width, height: info.height };\n\t\t\t}\n\t\t\telement.detach();\n\t\t}\n\n\t\treturn info;\n\t};\n\n\t// Adds a text string to the canvas text overlay.\n\t//\n\t// The text isn't drawn immediately; it is marked as rendering, which will\n\t// result in its addition to the canvas on the next render pass.\n\t//\n\t// @param {string} layer A string of space-separated CSS classes uniquely\n\t// identifying the layer containing this text.\n\t// @param {number} x X coordinate at which to draw the text.\n\t// @param {number} y Y coordinate at which to draw the text.\n\t// @param {string} text Text string to draw.\n\t// @param {(string|object)=} font Either a string of space-separated CSS\n\t// classes or a font-spec object, defining the text's font and style.\n\t// @param {number=} angle Angle at which to rotate the text, in degrees.\n\t// Angle is currently unused, it will be implemented in the future.\n\t// @param {number=} width Maximum width of the text before it wraps.\n\t// @param {string=} halign Horizontal alignment of the text; either \"left\",\n\t// \"center\" or \"right\".\n\t// @param {string=} valign Vertical alignment of the text; either \"top\",\n\t// \"middle\" or \"bottom\".\n\n\tCanvas.prototype.addText = function(layer, x, y, text, font, angle, width, halign, valign) {\n\n\t\tvar info = this.getTextInfo(layer, text, font, angle, width),\n\t\t\tpositions = info.positions;\n\n\t\t// Tweak the div's position to match the text's alignment\n\n\t\tif (halign == \"center\") {\n\t\t\tx -= info.width / 2;\n\t\t} else if (halign == \"right\") {\n\t\t\tx -= info.width;\n\t\t}\n\n\t\tif (valign == \"middle\") {\n\t\t\ty -= info.height / 2;\n\t\t} else if (valign == \"bottom\") {\n\t\t\ty -= info.height;\n\t\t}\n\n\t\t// Determine whether this text already exists at this position.\n\t\t// If so, mark it for inclusion in the next render pass.\n\n\t\tfor (var i = 0, position; position = positions[i]; i++) {\n\t\t\tif (position.x == x && position.y == y) {\n\t\t\t\tposition.active = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// If the text doesn't exist at this position, create a new entry\n\n\t\t// For the very first position we'll re-use the original element,\n\t\t// while for subsequent ones we'll clone it.\n\n\t\tposition = {\n\t\t\tactive: true,\n\t\t\trendered: false,\n\t\t\telement: positions.length ? info.element.clone() : info.element,\n\t\t\tx: x,\n\t\t\ty: y\n\t\t};\n\n\t\tpositions.push(position);\n\n\t\t// Move the element to its final position within the container\n\n\t\tposition.element.css({\n\t\t\ttop: Math.round(y),\n\t\t\tleft: Math.round(x),\n\t\t\t'text-align': halign\t// In case the text wraps\n\t\t});\n\t};\n\n\t// Removes one or more text strings from the canvas text overlay.\n\t//\n\t// If no parameters are given, all text within the layer is removed.\n\t//\n\t// Note that the text is not immediately removed; it is simply marked as\n\t// inactive, which will result in its removal on the next render pass.\n\t// This avoids the performance penalty for 'clear and redraw' behavior,\n\t// where we potentially get rid of all text on a layer, but will likely\n\t// add back most or all of it later, as when redrawing axes, for example.\n\t//\n\t// @param {string} layer A string of space-separated CSS classes uniquely\n\t// identifying the layer containing this text.\n\t// @param {number=} x X coordinate of the text.\n\t// @param {number=} y Y coordinate of the text.\n\t// @param {string=} text Text string to remove.\n\t// @param {(string|object)=} font Either a string of space-separated CSS\n\t// classes or a font-spec object, defining the text's font and style.\n\t// @param {number=} angle Angle at which the text is rotated, in degrees.\n\t// Angle is currently unused, it will be implemented in the future.\n\n\tCanvas.prototype.removeText = function(layer, x, y, text, font, angle) {\n\t\tif (text == null) {\n\t\t\tvar layerCache = this._textCache[layer];\n\t\t\tif (layerCache != null) {\n\t\t\t\tfor (var styleKey in layerCache) {\n\t\t\t\t\tif (hasOwnProperty.call(layerCache, styleKey)) {\n\t\t\t\t\t\tvar styleCache = layerCache[styleKey];\n\t\t\t\t\t\tfor (var key in styleCache) {\n\t\t\t\t\t\t\tif (hasOwnProperty.call(styleCache, key)) {\n\t\t\t\t\t\t\t\tvar positions = styleCache[key].positions;\n\t\t\t\t\t\t\t\tfor (var i = 0, position; position = positions[i]; i++) {\n\t\t\t\t\t\t\t\t\tposition.active = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tvar positions = this.getTextInfo(layer, text, font, angle).positions;\n\t\t\tfor (var i = 0, position; position = positions[i]; i++) {\n\t\t\t\tif (position.x == x && position.y == y) {\n\t\t\t\t\tposition.active = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t///////////////////////////////////////////////////////////////////////////\n\t// The top-level container for the entire plot.\n\n function Plot(placeholder, data_, options_, plugins) {\n // data is on the form:\n // [ series1, series2 ... ]\n // where series is either just the data as [ [x1, y1], [x2, y2], ... ]\n // or { data: [ [x1, y1], [x2, y2], ... ], label: \"some label\", ... }\n\n var series = [],\n options = {\n // the color theme used for graphs\n colors: [\"#edc240\", \"#afd8f8\", \"#cb4b4b\", \"#4da74d\", \"#9440ed\"],\n legend: {\n show: true,\n noColumns: 1, // number of colums in legend table\n labelFormatter: null, // fn: string -> string\n labelBoxBorderColor: \"#ccc\", // border color for the little label boxes\n container: null, // container (as jQuery object) to put legend in, null means default on top of graph\n position: \"ne\", // position of default legend container within plot\n margin: 5, // distance from grid edge to default legend container within plot\n backgroundColor: null, // null means auto-detect\n backgroundOpacity: 0.85, // set to 0 to avoid background\n sorted: null // default to no legend sorting\n },\n xaxis: {\n show: null, // null = auto-detect, true = always, false = never\n position: \"bottom\", // or \"top\"\n mode: null, // null or \"time\"\n font: null, // null (derived from CSS in placeholder) or object like { size: 11, lineHeight: 13, style: \"italic\", weight: \"bold\", family: \"sans-serif\", variant: \"small-caps\" }\n color: null, // base color, labels, ticks\n tickColor: null, // possibly different color of ticks, e.g. \"rgba(0,0,0,0.15)\"\n transform: null, // null or f: number -> number to transform axis\n inverseTransform: null, // if transform is set, this should be the inverse function\n min: null, // min. value to show, null means set automatically\n max: null, // max. value to show, null means set automatically\n autoscaleMargin: null, // margin in % to add if auto-setting min/max\n ticks: null, // either [1, 3] or [[1, \"a\"], 3] or (fn: axis info -> ticks) or app. number of ticks for auto-ticks\n tickFormatter: null, // fn: number -> string\n labelWidth: null, // size of tick labels in pixels\n labelHeight: null,\n reserveSpace: null, // whether to reserve space even if axis isn't shown\n tickLength: null, // size in pixels of ticks, or \"full\" for whole line\n alignTicksWithAxis: null, // axis number or null for no sync\n tickDecimals: null, // no. of decimals, null means auto\n tickSize: null, // number or [number, \"unit\"]\n minTickSize: null // number or [number, \"unit\"]\n },\n yaxis: {\n autoscaleMargin: 0.02,\n position: \"left\" // or \"right\"\n },\n xaxes: [],\n yaxes: [],\n series: {\n points: {\n show: false,\n radius: 3,\n lineWidth: 2, // in pixels\n fill: true,\n fillColor: \"#ffffff\",\n symbol: \"circle\" // or callback\n },\n lines: {\n // we don't put in show: false so we can see\n // whether lines were actively disabled\n lineWidth: 2, // in pixels\n fill: false,\n fillColor: null,\n steps: false\n // Omit 'zero', so we can later default its value to\n // match that of the 'fill' option.\n },\n bars: {\n show: false,\n lineWidth: 2, // in pixels\n barWidth: 1, // in units of the x axis\n fill: true,\n fillColor: null,\n align: \"left\", // \"left\", \"right\", or \"center\"\n horizontal: false,\n zero: true\n },\n shadowSize: 3,\n highlightColor: null\n },\n grid: {\n show: true,\n aboveData: false,\n color: \"#545454\", // primary color used for outline and labels\n backgroundColor: null, // null for transparent, else color\n borderColor: null, // set if different from the grid color\n tickColor: null, // color for the ticks, e.g. \"rgba(0,0,0,0.15)\"\n margin: 0, // distance from the canvas edge to the grid\n labelMargin: 5, // in pixels\n eventSectionHeight: 0, // space for event section\n axisMargin: 8, // in pixels\n borderWidth: 2, // in pixels\n minBorderMargin: null, // in pixels, null means taken from points radius\n markings: null, // array of ranges or fn: axes -> array of ranges\n markingsColor: \"#f4f4f4\",\n markingsLineWidth: 2,\n // interactive stuff\n clickable: false,\n hoverable: false,\n autoHighlight: true, // highlight in case mouse is near\n mouseActiveRadius: 10 // how far the mouse can be away to activate an item\n },\n interaction: {\n redrawOverlayInterval: 1000/60 // time between updates, -1 means in same flow\n },\n hooks: {}\n },\n surface = null, // the canvas for the plot itself\n overlay = null, // canvas for interactive stuff on top of plot\n eventHolder = null, // jQuery object that events should be bound to\n ctx = null, octx = null,\n xaxes = [], yaxes = [],\n plotOffset = { left: 0, right: 0, top: 0, bottom: 0},\n plotWidth = 0, plotHeight = 0,\n hooks = {\n processOptions: [],\n processRawData: [],\n processDatapoints: [],\n processOffset: [],\n processRange: [],\n drawBackground: [],\n drawSeries: [],\n draw: [],\n bindEvents: [],\n drawOverlay: [],\n shutdown: []\n },\n plot = this;\n\n // public functions\n plot.setData = setData;\n plot.setupGrid = setupGrid;\n plot.draw = draw;\n plot.getPlaceholder = function() { return placeholder; };\n plot.getCanvas = function() { return surface.element; };\n plot.getPlotOffset = function() { return plotOffset; };\n plot.width = function () { return plotWidth; };\n plot.height = function () { return plotHeight; };\n plot.offset = function () {\n var o = eventHolder.offset();\n o.left += plotOffset.left;\n o.top += plotOffset.top;\n return o;\n };\n plot.getData = function () { return series; };\n plot.getAxes = function () {\n var res = {}, i;\n $.each(xaxes.concat(yaxes), function (_, axis) {\n if (axis)\n res[axis.direction + (axis.n != 1 ? axis.n : \"\") + \"axis\"] = axis;\n });\n return res;\n };\n plot.getXAxes = function () { return xaxes; };\n plot.getYAxes = function () { return yaxes; };\n plot.c2p = canvasToAxisCoords;\n plot.p2c = axisToCanvasCoords;\n plot.getOptions = function () { return options; };\n plot.highlight = highlight;\n plot.unhighlight = unhighlight;\n plot.triggerRedrawOverlay = triggerRedrawOverlay;\n plot.pointOffset = function(point) {\n return {\n left: parseInt(xaxes[axisNumber(point, \"x\") - 1].p2c(+point.x) + plotOffset.left, 10),\n top: parseInt(yaxes[axisNumber(point, \"y\") - 1].p2c(+point.y) + plotOffset.top, 10)\n };\n };\n plot.shutdown = shutdown;\n plot.destroy = function () {\n shutdown();\n placeholder.removeData(\"plot\").empty();\n\n series = [];\n options = null;\n surface = null;\n overlay = null;\n eventHolder = null;\n ctx = null;\n octx = null;\n xaxes = [];\n yaxes = [];\n hooks = null;\n highlights = [];\n plot = null;\n };\n plot.resize = function () {\n \tvar width = placeholder.width(),\n \t\theight = placeholder.height();\n surface.resize(width, height);\n overlay.resize(width, height);\n };\n\n // public attributes\n plot.hooks = hooks;\n\n // initialize\n initPlugins(plot);\n parseOptions(options_);\n setupCanvases();\n setData(data_);\n setupGrid();\n draw();\n bindEvents();\n\n\n function executeHooks(hook, args) {\n args = [plot].concat(args);\n for (var i = 0; i < hook.length; ++i)\n hook[i].apply(this, args);\n }\n\n function initPlugins() {\n\n // References to key classes, allowing plugins to modify them\n\n var classes = {\n Canvas: Canvas\n };\n\n for (var i = 0; i < plugins.length; ++i) {\n var p = plugins[i];\n p.init(plot, classes);\n if (p.options)\n $.extend(true, options, p.options);\n }\n }\n\n function parseOptions(opts) {\n\n $.extend(true, options, opts);\n\n // $.extend merges arrays, rather than replacing them. When less\n // colors are provided than the size of the default palette, we\n // end up with those colors plus the remaining defaults, which is\n // not expected behavior; avoid it by replacing them here.\n\n if (opts && opts.colors) {\n \toptions.colors = opts.colors;\n }\n\n if (options.xaxis.color == null)\n options.xaxis.color = $.color.parse(options.grid.color).scale('a', 0.22).toString();\n if (options.yaxis.color == null)\n options.yaxis.color = $.color.parse(options.grid.color).scale('a', 0.22).toString();\n\n if (options.xaxis.tickColor == null) // grid.tickColor for back-compatibility\n options.xaxis.tickColor = options.grid.tickColor || options.xaxis.color;\n if (options.yaxis.tickColor == null) // grid.tickColor for back-compatibility\n options.yaxis.tickColor = options.grid.tickColor || options.yaxis.color;\n\n if (options.grid.borderColor == null)\n options.grid.borderColor = options.grid.color;\n if (options.grid.tickColor == null)\n options.grid.tickColor = $.color.parse(options.grid.color).scale('a', 0.22).toString();\n\n // Fill in defaults for axis options, including any unspecified\n // font-spec fields, if a font-spec was provided.\n\n // If no x/y axis options were provided, create one of each anyway,\n // since the rest of the code assumes that they exist.\n\n var i, axisOptions, axisCount,\n fontSize = placeholder.css(\"font-size\"),\n fontSizeDefault = fontSize ? +fontSize.replace(\"px\", \"\") : 13,\n fontDefaults = {\n style: placeholder.css(\"font-style\"),\n size: Math.round(0.8 * fontSizeDefault),\n variant: placeholder.css(\"font-variant\"),\n weight: placeholder.css(\"font-weight\"),\n family: placeholder.css(\"font-family\")\n };\n\n axisCount = options.xaxes.length || 1;\n for (i = 0; i < axisCount; ++i) {\n\n axisOptions = options.xaxes[i];\n if (axisOptions && !axisOptions.tickColor) {\n axisOptions.tickColor = axisOptions.color;\n }\n\n axisOptions = $.extend(true, {}, options.xaxis, axisOptions);\n options.xaxes[i] = axisOptions;\n\n if (axisOptions.font) {\n axisOptions.font = $.extend({}, fontDefaults, axisOptions.font);\n if (!axisOptions.font.color) {\n axisOptions.font.color = axisOptions.color;\n }\n if (!axisOptions.font.lineHeight) {\n axisOptions.font.lineHeight = Math.round(axisOptions.font.size * 1.15);\n }\n }\n }\n\n axisCount = options.yaxes.length || 1;\n for (i = 0; i < axisCount; ++i) {\n\n axisOptions = options.yaxes[i];\n if (axisOptions && !axisOptions.tickColor) {\n axisOptions.tickColor = axisOptions.color;\n }\n\n axisOptions = $.extend(true, {}, options.yaxis, axisOptions);\n options.yaxes[i] = axisOptions;\n\n if (axisOptions.font) {\n axisOptions.font = $.extend({}, fontDefaults, axisOptions.font);\n if (!axisOptions.font.color) {\n axisOptions.font.color = axisOptions.color;\n }\n if (!axisOptions.font.lineHeight) {\n axisOptions.font.lineHeight = Math.round(axisOptions.font.size * 1.15);\n }\n }\n }\n\n // backwards compatibility, to be removed in future\n if (options.xaxis.noTicks && options.xaxis.ticks == null)\n options.xaxis.ticks = options.xaxis.noTicks;\n if (options.yaxis.noTicks && options.yaxis.ticks == null)\n options.yaxis.ticks = options.yaxis.noTicks;\n if (options.x2axis) {\n options.xaxes[1] = $.extend(true, {}, options.xaxis, options.x2axis);\n options.xaxes[1].position = \"top\";\n // Override the inherit to allow the axis to auto-scale\n if (options.x2axis.min == null) {\n options.xaxes[1].min = null;\n }\n if (options.x2axis.max == null) {\n options.xaxes[1].max = null;\n }\n }\n if (options.y2axis) {\n options.yaxes[1] = $.extend(true, {}, options.yaxis, options.y2axis);\n options.yaxes[1].position = \"right\";\n // Override the inherit to allow the axis to auto-scale\n if (options.y2axis.min == null) {\n options.yaxes[1].min = null;\n }\n if (options.y2axis.max == null) {\n options.yaxes[1].max = null;\n }\n }\n if (options.grid.coloredAreas)\n options.grid.markings = options.grid.coloredAreas;\n if (options.grid.coloredAreasColor)\n options.grid.markingsColor = options.grid.coloredAreasColor;\n if (options.lines)\n $.extend(true, options.series.lines, options.lines);\n if (options.points)\n $.extend(true, options.series.points, options.points);\n if (options.bars)\n $.extend(true, options.series.bars, options.bars);\n if (options.shadowSize != null)\n options.series.shadowSize = options.shadowSize;\n if (options.highlightColor != null)\n options.series.highlightColor = options.highlightColor;\n\n // save options on axes for future reference\n for (i = 0; i < options.xaxes.length; ++i)\n getOrCreateAxis(xaxes, i + 1).options = options.xaxes[i];\n for (i = 0; i < options.yaxes.length; ++i)\n getOrCreateAxis(yaxes, i + 1).options = options.yaxes[i];\n\n // add hooks from options\n for (var n in hooks)\n if (options.hooks[n] && options.hooks[n].length)\n hooks[n] = hooks[n].concat(options.hooks[n]);\n\n executeHooks(hooks.processOptions, [options]);\n }\n\n function setData(d) {\n series = parseData(d);\n fillInSeriesOptions();\n processData();\n }\n\n function parseData(d) {\n var res = [];\n for (var i = 0; i < d.length; ++i) {\n var s = $.extend(true, {}, options.series);\n\n if (d[i].data != null) {\n s.data = d[i].data; // move the data instead of deep-copy\n delete d[i].data;\n\n $.extend(true, s, d[i]);\n\n d[i].data = s.data;\n }\n else\n s.data = d[i];\n res.push(s);\n }\n\n return res;\n }\n\n function axisNumber(obj, coord) {\n var a = obj[coord + \"axis\"];\n if (typeof a == \"object\") // if we got a real axis, extract number\n a = a.n;\n if (typeof a != \"number\")\n a = 1; // default to first axis\n return a;\n }\n\n function allAxes() {\n // return flat array without annoying null entries\n return $.grep(xaxes.concat(yaxes), function (a) { return a; });\n }\n\n function canvasToAxisCoords(pos) {\n // return an object with x/y corresponding to all used axes\n var res = {}, i, axis;\n for (i = 0; i < xaxes.length; ++i) {\n axis = xaxes[i];\n if (axis && axis.used)\n res[\"x\" + axis.n] = axis.c2p(pos.left);\n }\n\n for (i = 0; i < yaxes.length; ++i) {\n axis = yaxes[i];\n if (axis && axis.used)\n res[\"y\" + axis.n] = axis.c2p(pos.top);\n }\n\n if (res.x1 !== undefined)\n res.x = res.x1;\n if (res.y1 !== undefined)\n res.y = res.y1;\n\n return res;\n }\n\n function axisToCanvasCoords(pos) {\n // get canvas coords from the first pair of x/y found in pos\n var res = {}, i, axis, key;\n\n for (i = 0; i < xaxes.length; ++i) {\n axis = xaxes[i];\n if (axis && axis.used) {\n key = \"x\" + axis.n;\n if (pos[key] == null && axis.n == 1)\n key = \"x\";\n\n if (pos[key] != null) {\n res.left = axis.p2c(pos[key]);\n break;\n }\n }\n }\n\n for (i = 0; i < yaxes.length; ++i) {\n axis = yaxes[i];\n if (axis && axis.used) {\n key = \"y\" + axis.n;\n if (pos[key] == null && axis.n == 1)\n key = \"y\";\n\n if (pos[key] != null) {\n res.top = axis.p2c(pos[key]);\n break;\n }\n }\n }\n\n return res;\n }\n\n function getOrCreateAxis(axes, number) {\n if (!axes[number - 1])\n axes[number - 1] = {\n n: number, // save the number for future reference\n direction: axes == xaxes ? \"x\" : \"y\",\n options: $.extend(true, {}, axes == xaxes ? options.xaxis : options.yaxis)\n };\n\n return axes[number - 1];\n }\n\n function fillInSeriesOptions() {\n\n var neededColors = series.length, maxIndex = -1, i;\n\n // Subtract the number of series that already have fixed colors or\n // color indexes from the number that we still need to generate.\n\n for (i = 0; i < series.length; ++i) {\n var sc = series[i].color;\n if (sc != null) {\n neededColors--;\n if (typeof sc == \"number\" && sc > maxIndex) {\n maxIndex = sc;\n }\n }\n }\n\n // If any of the series have fixed color indexes, then we need to\n // generate at least as many colors as the highest index.\n\n if (neededColors <= maxIndex) {\n neededColors = maxIndex + 1;\n }\n\n // Generate all the colors, using first the option colors and then\n // variations on those colors once they're exhausted.\n\n var c, colors = [], colorPool = options.colors,\n colorPoolSize = colorPool.length, variation = 0;\n\n for (i = 0; i < neededColors; i++) {\n\n c = $.color.parse(colorPool[i % colorPoolSize] || \"#666\");\n\n // Each time we exhaust the colors in the pool we adjust\n // a scaling factor used to produce more variations on\n // those colors. The factor alternates negative/positive\n // to produce lighter/darker colors.\n\n // Reset the variation after every few cycles, or else\n // it will end up producing only white or black colors.\n\n if (i % colorPoolSize == 0 && i) {\n if (variation >= 0) {\n if (variation < 0.5) {\n variation = -variation - 0.2;\n } else variation = 0;\n } else variation = -variation;\n }\n\n colors[i] = c.scale('rgb', 1 + variation);\n }\n\n // Finalize the series options, filling in their colors\n\n var colori = 0, s;\n for (i = 0; i < series.length; ++i) {\n s = series[i];\n\n // assign colors\n if (s.color == null) {\n s.color = colors[colori].toString();\n ++colori;\n }\n else if (typeof s.color == \"number\")\n s.color = colors[s.color].toString();\n\n // turn on lines automatically in case nothing is set\n if (s.lines.show == null) {\n var v, show = true;\n for (v in s)\n if (s[v] && s[v].show) {\n show = false;\n break;\n }\n if (show)\n s.lines.show = true;\n }\n\n // If nothing was provided for lines.zero, default it to match\n // lines.fill, since areas by default should extend to zero.\n\n if (s.lines.zero == null) {\n s.lines.zero = !!s.lines.fill;\n }\n\n // setup axes\n s.xaxis = getOrCreateAxis(xaxes, axisNumber(s, \"x\"));\n s.yaxis = getOrCreateAxis(yaxes, axisNumber(s, \"y\"));\n }\n }\n\n function processData() {\n var topSentry = Number.POSITIVE_INFINITY,\n bottomSentry = Number.NEGATIVE_INFINITY,\n fakeInfinity = Number.MAX_VALUE,\n i, j, k, m, length,\n s, points, ps, x, y, axis, val, f, p,\n data, format;\n\n function updateAxis(axis, min, max) {\n if (min < axis.datamin && min != -fakeInfinity)\n axis.datamin = min;\n if (max > axis.datamax && max != fakeInfinity)\n axis.datamax = max;\n }\n\n $.each(allAxes(), function (_, axis) {\n // init axis\n axis.datamin = topSentry;\n axis.datamax = bottomSentry;\n axis.used = false;\n });\n\n for (i = 0; i < series.length; ++i) {\n s = series[i];\n s.datapoints = { points: [] };\n\n executeHooks(hooks.processRawData, [ s, s.data, s.datapoints ]);\n }\n\n // first pass: clean and copy data\n for (i = 0; i < series.length; ++i) {\n s = series[i];\n\n data = s.data;\n format = s.datapoints.format;\n\n if (!format) {\n format = [];\n // find out how to copy\n format.push({ x: true, number: true, required: true });\n format.push({ y: true, number: true, required: true });\n\n if (s.bars.show || (s.lines.show && s.lines.fill)) {\n var autoscale = !!((s.bars.show && s.bars.zero) || (s.lines.show && s.lines.zero));\n format.push({ y: true, number: true, required: false, defaultValue: 0, autoscale: autoscale });\n if (s.bars.horizontal) {\n delete format[format.length - 1].y;\n format[format.length - 1].x = true;\n }\n }\n\n s.datapoints.format = format;\n }\n\n if (s.datapoints.pointsize != null)\n continue; // already filled in\n\n s.datapoints.pointsize = format.length;\n\n ps = s.datapoints.pointsize;\n points = s.datapoints.points;\n\n var insertSteps = s.lines.show && s.lines.steps;\n s.xaxis.used = s.yaxis.used = true;\n\n for (j = k = 0; j < data.length; ++j, k += ps) {\n p = data[j];\n\n var nullify = p == null;\n if (!nullify) {\n for (m = 0; m < ps; ++m) {\n val = p[m];\n f = format[m];\n\n if (f) {\n if (f.number && val != null) {\n val = +val; // convert to number\n if (isNaN(val))\n val = null;\n else if (val == Infinity)\n val = fakeInfinity;\n else if (val == -Infinity)\n val = -fakeInfinity;\n }\n\n if (val == null) {\n if (f.required)\n nullify = true;\n\n if (f.defaultValue != null)\n val = f.defaultValue;\n }\n }\n\n points[k + m] = val;\n }\n }\n\n if (nullify) {\n for (m = 0; m < ps; ++m) {\n val = points[k + m];\n if (val != null) {\n f = format[m];\n // extract min/max info\n if (f.autoscale !== false) {\n if (f.x) {\n updateAxis(s.xaxis, val, val);\n }\n if (f.y) {\n updateAxis(s.yaxis, val, val);\n }\n }\n }\n points[k + m] = null;\n }\n }\n\n if (insertSteps && k > 0 && (!nullify || points[k - ps] != null)) {\n // copy the point to make room for a middle point\n for (m = 0; m < ps; ++m)\n points[k + ps + m] = points[k + m];\n\n // middle point has same y\n points[k + 1] = points[k - ps + 1] || 0;\n\n // if series has null values, let's give the last !null value a nice step\n if(nullify)\n \tpoints[k] = p[0];\n\n // we've added a point, better reflect that\n k += ps;\n }\n }\n }\n\n // give the hooks a chance to run\n for (i = 0; i < series.length; ++i) {\n s = series[i];\n points = s.datapoints.points;\n ps = s.datapoints.pointsize;\n\n // grafana\n if (s.transform === 'negative-Y') {\n for (j = 0; j < points.length; j += ps) {\n if (points[j] == null)\n continue;\n\n val = points[j + 1];\n points[j + 1] = -val;\n }\n }\n\n executeHooks(hooks.processDatapoints, [ s, s.datapoints]);\n }\n\n // second pass: find datamax/datamin for auto-scaling\n for (i = 0; i < series.length; ++i) {\n s = series[i];\n points = s.datapoints.points;\n ps = s.datapoints.pointsize;\n format = s.datapoints.format;\n\n var xmin = topSentry, ymin = topSentry,\n xmax = bottomSentry, ymax = bottomSentry;\n\n for (j = 0; j < points.length; j += ps) {\n if (points[j] == null)\n continue;\n\n for (m = 0; m < ps; ++m) {\n val = points[j + m];\n f = format[m];\n if (!f || f.autoscale === false || val == fakeInfinity || val == -fakeInfinity)\n continue;\n\n if (f.x) {\n if (val < xmin)\n xmin = val;\n if (val > xmax)\n xmax = val;\n }\n if (f.y) {\n if (val < ymin)\n ymin = val;\n if (val > ymax)\n ymax = val;\n }\n }\n }\n\n if (s.bars.show) {\n // make sure we got room for the bar on the dancing floor\n var delta;\n\n switch (s.bars.align) {\n case \"left\":\n delta = 0;\n break;\n case \"right\":\n delta = -s.bars.barWidth;\n break;\n default:\n delta = -s.bars.barWidth / 2;\n }\n\n if (s.bars.horizontal) {\n ymin += delta;\n ymax += delta + s.bars.barWidth;\n }\n else {\n xmin += delta;\n xmax += delta + s.bars.barWidth;\n }\n }\n\n updateAxis(s.xaxis, xmin, xmax);\n updateAxis(s.yaxis, ymin, ymax);\n }\n\n $.each(allAxes(), function (_, axis) {\n if (axis.datamin == topSentry)\n axis.datamin = null;\n if (axis.datamax == bottomSentry)\n axis.datamax = null;\n });\n }\n\n function setupCanvases() {\n // Make sure the placeholder is clear of everything except canvases\n // from a previous plot in this container that we'll try to re-use.\n\n placeholder.find(\".flot-temp-elem\").remove();\n\n if (placeholder.css(\"position\") == 'static')\n placeholder.css(\"position\", \"relative\"); // for positioning labels and overlay\n\n surface = new Canvas(\"flot-base\", placeholder);\n overlay = new Canvas(\"flot-overlay\", placeholder); // overlay canvas for interactive features\n\n ctx = surface.context;\n octx = overlay.context;\n\n // define which element we're listening for events on\n eventHolder = $(overlay.element).unbind();\n\n // If we're re-using a plot object, shut down the old one\n\n var existing = placeholder.data(\"plot\");\n\n if (existing) {\n existing.shutdown();\n overlay.clear();\n }\n\n // save in case we get replotted\n placeholder.data(\"plot\", plot);\n }\n\n function bindEvents() {\n // bind events\n if (options.grid.hoverable) {\n eventHolder.mousemove(onMouseMove);\n\n // Use bind, rather than .mouseleave, because we officially\n // still support jQuery 1.2.6, which doesn't define a shortcut\n // for mouseenter or mouseleave. This was a bug/oversight that\n // was fixed somewhere around 1.3.x. We can return to using\n // .mouseleave when we drop support for 1.2.6.\n\n eventHolder.bind(\"mouseleave\", onMouseLeave);\n }\n\n if (options.grid.clickable)\n eventHolder.click(onClick);\n\n executeHooks(hooks.bindEvents, [eventHolder]);\n }\n\n function shutdown() {\n if (redrawTimeout)\n clearTimeout(redrawTimeout);\n\n eventHolder.unbind(\"mousemove\", onMouseMove);\n eventHolder.unbind(\"mouseleave\", onMouseLeave);\n eventHolder.unbind(\"click\", onClick);\n\n executeHooks(hooks.shutdown, [eventHolder]);\n }\n\n function setTransformationHelpers(axis) {\n // set helper functions on the axis, assumes plot area\n // has been computed already\n\n function identity(x) { return x; }\n\n var s, m, t = axis.options.transform || identity,\n it = axis.options.inverseTransform;\n\n // precompute how much the axis is scaling a point\n // in canvas space\n if (axis.direction == \"x\") {\n s = axis.scale = plotWidth / Math.abs(t(axis.max) - t(axis.min));\n m = Math.min(t(axis.max), t(axis.min));\n }\n else {\n s = axis.scale = plotHeight / Math.abs(t(axis.max) - t(axis.min));\n s = -s;\n m = Math.max(t(axis.max), t(axis.min));\n }\n\n // data point to canvas coordinate\n if (t == identity) // slight optimization\n axis.p2c = function (p) { return (p - m) * s; };\n else\n axis.p2c = function (p) { return (t(p) - m) * s; };\n // canvas coordinate to data point\n if (!it)\n axis.c2p = function (c) { return m + c / s; };\n else\n axis.c2p = function (c) { return it(m + c / s); };\n }\n\n function measureTickLabels(axis) {\n\n var opts = axis.options,\n ticks = axis.ticks || [],\n labelWidth = opts.labelWidth || 0,\n labelHeight = opts.labelHeight || 0,\n maxWidth = labelWidth || (axis.direction == \"x\" ? Math.floor(surface.width / (ticks.length || 1)) : null),\n legacyStyles = axis.direction + \"Axis \" + axis.direction + axis.n + \"Axis\",\n layer = \"flot-\" + axis.direction + \"-axis flot-\" + axis.direction + axis.n + \"-axis \" + legacyStyles,\n font = opts.font || \"flot-tick-label tickLabel\";\n\n for (var i = 0; i < ticks.length; ++i) {\n\n var t = ticks[i];\n\n if (!t.label)\n continue;\n\n var info = surface.getTextInfo(layer, t.label, font, null, maxWidth);\n\n /// Grafana fix, add +1 to label width\n labelWidth = Math.max(labelWidth, info.width + 1);\n labelHeight = Math.max(labelHeight, info.height);\n }\n\n axis.labelWidth = opts.labelWidth || labelWidth;\n axis.labelHeight = opts.labelHeight || labelHeight;\n }\n\n function allocateAxisBoxFirstPhase(axis) {\n // find the bounding box of the axis by looking at label\n // widths/heights and ticks, make room by diminishing the\n // plotOffset; this first phase only looks at one\n // dimension per axis, the other dimension depends on the\n // other axes so will have to wait\n\n var lw = axis.labelWidth,\n lh = axis.labelHeight,\n pos = axis.options.position,\n isXAxis = axis.direction === \"x\",\n tickLength = axis.options.tickLength,\n axisMargin = options.grid.axisMargin,\n padding = options.grid.labelMargin,\n eventSectionPadding = options.grid.eventSectionHeight,\n innermost = true,\n outermost = true,\n first = true,\n found = false;\n\n // Determine the axis's position in its direction and on its side\n\n $.each(isXAxis ? xaxes : yaxes, function(i, a) {\n if (a && (a.show || a.reserveSpace)) {\n if (a === axis) {\n found = true;\n } else if (a.options.position === pos) {\n if (found) {\n outermost = false;\n } else {\n innermost = false;\n }\n }\n if (!found) {\n first = false;\n }\n }\n });\n\n // The outermost axis on each side has no margin\n\n if (outermost) {\n axisMargin = 0;\n }\n\n // The ticks for the first axis in each direction stretch across\n\n if (tickLength == null) {\n tickLength = first ? \"full\" : 5;\n }\n\n if (!isNaN(+tickLength))\n padding += +tickLength;\n\n if (isXAxis) {\n // Add space for event section\n lh += padding;\n lh += eventSectionPadding;\n\n if (pos == \"bottom\") {\n plotOffset.bottom += lh + axisMargin;\n axis.box = { top: surface.height - plotOffset.bottom, height: lh };\n }\n else {\n axis.box = { top: plotOffset.top + axisMargin, height: lh };\n plotOffset.top += lh + axisMargin;\n }\n }\n else {\n lw += padding;\n\n if (pos == \"left\") {\n axis.box = { left: plotOffset.left + axisMargin, width: lw };\n plotOffset.left += lw + axisMargin;\n }\n else {\n plotOffset.right += lw + axisMargin;\n axis.box = { left: surface.width - plotOffset.right, width: lw };\n }\n }\n\n // save for future reference\n axis.position = pos;\n axis.tickLength = tickLength;\n axis.box.padding = padding;\n axis.box.eventSectionPadding = eventSectionPadding;\n axis.innermost = innermost;\n }\n\n function allocateAxisBoxSecondPhase(axis) {\n // now that all axis boxes have been placed in one\n // dimension, we can set the remaining dimension coordinates\n if (axis.direction == \"x\") {\n axis.box.left = plotOffset.left - axis.labelWidth / 2;\n axis.box.width = surface.width - plotOffset.left - plotOffset.right + axis.labelWidth;\n }\n else {\n axis.box.top = plotOffset.top - axis.labelHeight / 2;\n axis.box.height = surface.height - plotOffset.bottom - plotOffset.top + axis.labelHeight;\n }\n }\n\n function adjustLayoutForThingsStickingOut() {\n // possibly adjust plot offset to ensure everything stays\n // inside the canvas and isn't clipped off\n\n var minMargin = options.grid.minBorderMargin,\n axis, i;\n\n // check stuff from the plot (FIXME: this should just read\n // a value from the series, otherwise it's impossible to\n // customize)\n if (minMargin == null) {\n minMargin = 0;\n for (i = 0; i < series.length; ++i)\n minMargin = Math.max(minMargin, 2 * (series[i].points.radius + series[i].points.lineWidth/2));\n }\n\n var margins = {\n left: minMargin,\n right: minMargin,\n top: minMargin,\n bottom: minMargin\n };\n\n // check axis labels, note we don't check the actual\n // labels but instead use the overall width/height to not\n // jump as much around with replots\n $.each(allAxes(), function (_, axis) {\n if (axis.reserveSpace && axis.ticks && axis.ticks.length) {\n if (axis.direction === \"x\") {\n margins.left = Math.max(margins.left, axis.labelWidth / 2);\n margins.right = Math.max(margins.right, axis.labelWidth / 2);\n } else {\n margins.bottom = Math.max(margins.bottom, axis.labelHeight / 2);\n margins.top = Math.max(margins.top, axis.labelHeight / 2);\n }\n }\n });\n\n plotOffset.left = Math.ceil(Math.max(margins.left, plotOffset.left));\n plotOffset.right = Math.ceil(Math.max(margins.right, plotOffset.right));\n plotOffset.top = Math.ceil(Math.max(margins.top, plotOffset.top));\n plotOffset.bottom = Math.ceil(Math.max(margins.bottom, plotOffset.bottom));\n }\n\n function setupGrid() {\n var i, axes = allAxes(), showGrid = options.grid.show;\n\n // Initialize the plot's offset from the edge of the canvas\n\n for (var a in plotOffset) {\n var margin = options.grid.margin || 0;\n plotOffset[a] = typeof margin == \"number\" ? margin : margin[a] || 0;\n }\n\n executeHooks(hooks.processOffset, [plotOffset]);\n\n // If the grid is visible, add its border width to the offset\n\n for (var a in plotOffset) {\n if(typeof(options.grid.borderWidth) == \"object\") {\n plotOffset[a] += showGrid ? options.grid.borderWidth[a] : 0;\n }\n else {\n plotOffset[a] += showGrid ? options.grid.borderWidth : 0;\n }\n }\n\n $.each(axes, function (_, axis) {\n var axisOpts = axis.options;\n axis.show = axisOpts.show == null ? axis.used : axisOpts.show;\n axis.reserveSpace = axisOpts.reserveSpace == null ? axis.show : axisOpts.reserveSpace;\n setRange(axis);\n });\n\n executeHooks(hooks.processRange, []);\n\n if (showGrid) {\n\n var allocatedAxes = $.grep(axes, function (axis) {\n return axis.show || axis.reserveSpace;\n });\n\n var snaped = false;\n for (var i = 0; i < 2; i++) {\n $.each(allocatedAxes, function (_, axis) {\n // make the ticks\n setupTickGeneration(axis);\n setTicks(axis);\n snaped = snapRangeToTicks(axis, axis.ticks) || snaped;\n // find labelWidth/Height for axis\n measureTickLabels(axis);\n });\n\n if (snaped && hooks.processRange.length > 0) {\n executeHooks(hooks.processRange, []);\n snaped = false;\n } else {\n break;\n }\n }\n\n // with all dimensions calculated, we can compute the\n // axis bounding boxes, start from the outside\n // (reverse order)\n for (i = allocatedAxes.length - 1; i >= 0; --i)\n allocateAxisBoxFirstPhase(allocatedAxes[i]);\n\n // make sure we've got enough space for things that\n // might stick out\n adjustLayoutForThingsStickingOut();\n\n $.each(allocatedAxes, function (_, axis) {\n allocateAxisBoxSecondPhase(axis);\n });\n }\n\n\n plotWidth = surface.width - plotOffset.left - plotOffset.right;\n plotHeight = surface.height - plotOffset.bottom - plotOffset.top;\n\n // now we got the proper plot dimensions, we can compute the scaling\n $.each(axes, function (_, axis) {\n setTransformationHelpers(axis);\n });\n\n if (showGrid) {\n drawAxisLabels();\n }\n\n insertLegend();\n }\n\n function setRange(axis) {\n var opts = axis.options,\n min = +(opts.min != null ? opts.min : axis.datamin),\n max = +(opts.max != null ? opts.max : axis.datamax),\n delta = max - min;\n\n if (delta == 0.0) {\n // Grafana fix: wide Y min and max using increased wideFactor\n // when all series values are the same\n var wideFactor = 0.25;\n var widen = Math.abs(max == 0 ? 1 : max * wideFactor);\n\n if (opts.min == null) {\n min -= widen;\n }\n // always widen max if we couldn't widen min to ensure we\n // don't fall into min == max which doesn't work\n if (opts.max == null || opts.min != null) {\n max += widen;\n }\n }\n else {\n // consider autoscaling\n var margin = opts.autoscaleMargin;\n if (margin != null) {\n if (opts.min == null) {\n min -= delta * margin;\n // make sure we don't go below zero if all values\n // are positive\n if (min < 0 && axis.datamin != null && axis.datamin >= 0)\n min = 0;\n }\n if (opts.max == null) {\n max += delta * margin;\n if (max > 0 && axis.datamax != null && axis.datamax <= 0)\n max = 0;\n }\n }\n }\n axis.min = min;\n axis.max = max;\n }\n\n function setupTickGeneration(axis) {\n var opts = axis.options;\n\n // estimate number of ticks\n var noTicks;\n if (typeof opts.ticks == \"number\" && opts.ticks > 0)\n noTicks = opts.ticks;\n else\n // heuristic based on the model a*sqrt(x) fitted to\n // some data points that seemed reasonable\n noTicks = 0.3 * Math.sqrt(axis.direction == \"x\" ? surface.width : surface.height);\n\n var delta = (axis.max - axis.min) / noTicks,\n dec = -Math.floor(Math.log(delta) / Math.LN10),\n maxDec = opts.tickDecimals;\n\n if (maxDec != null && dec > maxDec) {\n dec = maxDec;\n }\n\n var magn = Math.pow(10, -dec),\n norm = delta / magn, // norm is between 1.0 and 10.0\n size;\n\n if (norm < 1.5) {\n size = 1;\n } else if (norm < 3) {\n size = 2;\n // special case for 2.5, requires an extra decimal\n if (norm > 2.25 && (maxDec == null || dec + 1 <= maxDec)) {\n size = 2.5;\n ++dec;\n }\n } else if (norm < 7.5) {\n size = 5;\n } else {\n size = 10;\n }\n\n size *= magn;\n\n if (opts.minTickSize != null && size < opts.minTickSize) {\n size = opts.minTickSize;\n }\n\n axis.delta = delta;\n axis.tickDecimals = Math.max(0, maxDec != null ? maxDec : dec);\n axis.tickSize = opts.tickSize || size;\n // grafana addition\n axis.scaledDecimals = axis.tickDecimals - Math.floor(Math.log(axis.tickSize) / Math.LN10);\n\n // Time mode was moved to a plug-in in 0.8, and since so many people use it\n // we'll add an especially friendly reminder to make sure they included it.\n\n if (opts.mode == \"time\" && !axis.tickGenerator) {\n throw new Error(\"Time mode requires the flot.time plugin.\");\n }\n\n // Flot supports base-10 axes; any other mode else is handled by a plug-in,\n // like flot.time.js.\n\n if (!axis.tickGenerator) {\n\n axis.tickGenerator = function (axis) {\n\n var ticks = [],\n start = floorInBase(axis.min, axis.tickSize),\n i = 0,\n v = Number.NaN,\n prev;\n\n do {\n prev = v;\n v = start + i * axis.tickSize;\n ticks.push(v);\n ++i;\n } while (v < axis.max && v != prev);\n return ticks;\n };\n\n\t\t\t\taxis.tickFormatter = function (value, axis) {\n\n\t\t\t\t\tvar factor = axis.tickDecimals ? Math.pow(10, axis.tickDecimals) : 1;\n\t\t\t\t\tvar formatted = \"\" + Math.round(value * factor) / factor;\n\n\t\t\t\t\t// If tickDecimals was specified, ensure that we have exactly that\n\t\t\t\t\t// much precision; otherwise default to the value's own precision.\n\n\t\t\t\t\tif (axis.tickDecimals != null) {\n\t\t\t\t\t\tvar decimal = formatted.indexOf(\".\");\n\t\t\t\t\t\tvar precision = decimal == -1 ? 0 : formatted.length - decimal - 1;\n\t\t\t\t\t\tif (precision < axis.tickDecimals) {\n\t\t\t\t\t\t\treturn (precision ? formatted : formatted + \".\") + (\"\" + factor).substr(1, axis.tickDecimals - precision);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n return formatted;\n };\n }\n\n if ($.isFunction(opts.tickFormatter))\n axis.tickFormatter = function (v, axis) { return \"\" + opts.tickFormatter(v, axis); };\n\n if (opts.alignTicksWithAxis != null) {\n var otherAxis = (axis.direction == \"x\" ? xaxes : yaxes)[opts.alignTicksWithAxis - 1];\n if (otherAxis && otherAxis.used && otherAxis != axis) {\n // consider snapping min/max to outermost nice ticks\n var niceTicks = axis.tickGenerator(axis);\n if (niceTicks.length > 0) {\n if (opts.min == null)\n axis.min = Math.min(axis.min, niceTicks[0]);\n if (opts.max == null && niceTicks.length > 1)\n axis.max = Math.max(axis.max, niceTicks[niceTicks.length - 1]);\n }\n\n axis.tickGenerator = function (axis) {\n // copy ticks, scaled to this axis\n var ticks = [], v, i;\n for (i = 0; i < otherAxis.ticks.length; ++i) {\n v = (otherAxis.ticks[i].v - otherAxis.min) / (otherAxis.max - otherAxis.min);\n v = axis.min + v * (axis.max - axis.min);\n ticks.push(v);\n }\n return ticks;\n };\n\n // we might need an extra decimal since forced\n // ticks don't necessarily fit naturally\n if (!axis.mode && opts.tickDecimals == null) {\n var extraDec = Math.max(0, -Math.floor(Math.log(axis.delta) / Math.LN10) + 1),\n ts = axis.tickGenerator(axis);\n\n // only proceed if the tick interval rounded\n // with an extra decimal doesn't give us a\n // zero at end\n if (!(ts.length > 1 && /\\..*0$/.test((ts[1] - ts[0]).toFixed(extraDec))))\n axis.tickDecimals = extraDec;\n }\n }\n }\n }\n\n function setTicks(axis) {\n var oticks = axis.options.ticks, ticks = [];\n if (oticks == null || (typeof oticks == \"number\" && oticks > 0))\n ticks = axis.tickGenerator(axis);\n else if (oticks) {\n if ($.isFunction(oticks))\n // generate the ticks\n ticks = oticks(axis);\n else\n ticks = oticks;\n }\n\n // clean up/labelify the supplied ticks, copy them over\n var i, v;\n axis.ticks = [];\n for (i = 0; i < ticks.length; ++i) {\n var label = null;\n var t = ticks[i];\n if (typeof t == \"object\") {\n v = +t[0];\n if (t.length > 1)\n label = t[1];\n }\n else\n v = +t;\n if (label == null)\n label = axis.tickFormatter(v, axis);\n if (!isNaN(v))\n axis.ticks.push({ v: v, label: label });\n }\n }\n\n function snapRangeToTicks(axis, ticks) {\n var changed = false;\n if (axis.options.autoscaleMargin && ticks.length > 0) {\n // snap to ticks\n if (axis.options.min == null) {\n axis.min = Math.min(axis.min, ticks[0].v);\n changed = true;\n }\n if (axis.options.max == null && ticks.length > 1) {\n axis.max = Math.max(axis.max, ticks[ticks.length - 1].v);\n changed = true;\n }\n }\n return changed;\n }\n\n function draw() {\n\n surface.clear();\n\n executeHooks(hooks.drawBackground, [ctx]);\n\n var grid = options.grid;\n\n // draw background, if any\n if (grid.show && grid.backgroundColor)\n drawBackground();\n\n if (grid.show && !grid.aboveData) {\n drawGrid();\n }\n\n for (var i = 0; i < series.length; ++i) {\n executeHooks(hooks.drawSeries, [ctx, series[i]]);\n drawSeries(series[i]);\n }\n\n executeHooks(hooks.draw, [ctx]);\n\n if (grid.show && grid.aboveData) {\n drawGrid();\n }\n\n surface.render();\n\n // A draw implies that either the axes or data have changed, so we\n // should probably update the overlay highlights as well.\n\n triggerRedrawOverlay();\n }\n\n function extractRange(ranges, coord) {\n var axis, from, to, key, axes = allAxes();\n\n for (var i = 0; i < axes.length; ++i) {\n axis = axes[i];\n if (axis.direction == coord) {\n key = coord + axis.n + \"axis\";\n if (!ranges[key] && axis.n == 1)\n key = coord + \"axis\"; // support x1axis as xaxis\n if (ranges[key]) {\n from = ranges[key].from;\n to = ranges[key].to;\n break;\n }\n }\n }\n\n // backwards-compat stuff - to be removed in future\n if (!ranges[key]) {\n axis = coord == \"x\" ? xaxes[0] : yaxes[0];\n from = ranges[coord + \"1\"];\n to = ranges[coord + \"2\"];\n }\n\n // auto-reverse as an added bonus\n if (from != null && to != null && from > to) {\n var tmp = from;\n from = to;\n to = tmp;\n }\n\n return { from: from, to: to, axis: axis };\n }\n\n function drawBackground() {\n ctx.save();\n ctx.translate(plotOffset.left, plotOffset.top);\n\n ctx.fillStyle = getColorOrGradient(options.grid.backgroundColor, plotHeight, 0, \"rgba(255, 255, 255, 0)\");\n ctx.fillRect(0, 0, plotWidth, plotHeight);\n ctx.restore();\n }\n\n function drawGrid() {\n var i, axes, bw, bc;\n\n ctx.save();\n ctx.translate(plotOffset.left, plotOffset.top);\n\n // draw markings\n var markings = options.grid.markings;\n if (markings) {\n if ($.isFunction(markings)) {\n axes = plot.getAxes();\n // xmin etc. is backwards compatibility, to be\n // removed in the future\n axes.xmin = axes.xaxis.min;\n axes.xmax = axes.xaxis.max;\n axes.ymin = axes.yaxis.min;\n axes.ymax = axes.yaxis.max;\n\n markings = markings(axes);\n }\n\n for (i = 0; i < markings.length; ++i) {\n var m = markings[i],\n xrange = extractRange(m, \"x\"),\n yrange = extractRange(m, \"y\");\n\n // fill in missing\n if (xrange.from == null)\n xrange.from = xrange.axis.min;\n if (xrange.to == null)\n xrange.to = xrange.axis.max;\n if (yrange.from == null)\n yrange.from = yrange.axis.min;\n if (yrange.to == null)\n yrange.to = yrange.axis.max;\n\n // clip\n if (xrange.to < xrange.axis.min || xrange.from > xrange.axis.max ||\n yrange.to < yrange.axis.min || yrange.from > yrange.axis.max)\n continue;\n\n xrange.from = Math.max(xrange.from, xrange.axis.min);\n xrange.to = Math.min(xrange.to, xrange.axis.max);\n yrange.from = Math.max(yrange.from, yrange.axis.min);\n yrange.to = Math.min(yrange.to, yrange.axis.max);\n\n var xequal = xrange.from === xrange.to,\n yequal = yrange.from === yrange.to;\n\n if (xequal && yequal) {\n continue;\n }\n\n // then draw\n xrange.from = Math.floor(xrange.axis.p2c(xrange.from));\n xrange.to = Math.floor(xrange.axis.p2c(xrange.to));\n yrange.from = Math.floor(yrange.axis.p2c(yrange.from));\n yrange.to = Math.floor(yrange.axis.p2c(yrange.to));\n\n if (xequal || yequal) {\n var lineWidth = m.lineWidth || options.grid.markingsLineWidth,\n subPixel = lineWidth % 2 ? 0.5 : 0;\n ctx.beginPath();\n ctx.strokeStyle = m.color || options.grid.markingsColor;\n ctx.lineWidth = lineWidth;\n if (xequal) {\n ctx.moveTo(xrange.to + subPixel, yrange.from);\n ctx.lineTo(xrange.to + subPixel, yrange.to);\n } else {\n ctx.moveTo(xrange.from, yrange.to + subPixel);\n ctx.lineTo(xrange.to, yrange.to + subPixel);\n }\n ctx.stroke();\n } else {\n ctx.fillStyle = m.color || options.grid.markingsColor;\n ctx.fillRect(xrange.from, yrange.to,\n xrange.to - xrange.from,\n yrange.from - yrange.to);\n }\n }\n }\n\n // draw the ticks\n axes = allAxes();\n bw = options.grid.borderWidth;\n\n for (var j = 0; j < axes.length; ++j) {\n var axis = axes[j], box = axis.box,\n t = axis.tickLength, x, y, xoff, yoff;\n if (!axis.show || axis.ticks.length == 0)\n continue;\n\n ctx.lineWidth = 1;\n\n // find the edges\n if (axis.direction == \"x\") {\n x = 0;\n if (t == \"full\")\n y = (axis.position == \"top\" ? 0 : plotHeight);\n else\n y = box.top - plotOffset.top + (axis.position == \"top\" ? box.height : 0);\n }\n else {\n y = 0;\n if (t == \"full\")\n x = (axis.position == \"left\" ? 0 : plotWidth);\n else\n x = box.left - plotOffset.left + (axis.position == \"left\" ? box.width : 0);\n }\n\n // draw tick bar\n if (!axis.innermost) {\n ctx.strokeStyle = axis.options.color;\n ctx.beginPath();\n xoff = yoff = 0;\n if (axis.direction == \"x\")\n xoff = plotWidth + 1;\n else\n yoff = plotHeight + 1;\n\n if (ctx.lineWidth == 1) {\n if (axis.direction == \"x\") {\n y = Math.floor(y) + 0.5;\n } else {\n x = Math.floor(x) + 0.5;\n }\n }\n\n ctx.moveTo(x, y);\n ctx.lineTo(x + xoff, y + yoff);\n ctx.stroke();\n }\n\n // draw ticks\n\n ctx.strokeStyle = axis.options.tickColor;\n\n ctx.beginPath();\n for (i = 0; i < axis.ticks.length; ++i) {\n var v = axis.ticks[i].v;\n\n xoff = yoff = 0;\n\n if (isNaN(v) || v < axis.min || v > axis.max\n // skip those lying on the axes if we got a border\n || (t == \"full\"\n && ((typeof bw == \"object\" && bw[axis.position] > 0) || bw > 0)\n && (v == axis.min || v == axis.max)))\n continue;\n\n if (axis.direction == \"x\") {\n x = axis.p2c(v);\n yoff = t == \"full\" ? -plotHeight : t;\n\n if (axis.position == \"top\")\n yoff = -yoff;\n }\n else {\n y = axis.p2c(v);\n xoff = t == \"full\" ? -plotWidth : t;\n\n if (axis.position == \"left\")\n xoff = -xoff;\n }\n\n if (ctx.lineWidth == 1) {\n if (axis.direction == \"x\")\n x = Math.floor(x) + 0.5;\n else\n y = Math.floor(y) + 0.5;\n }\n\n ctx.moveTo(x, y);\n ctx.lineTo(x + xoff, y + yoff);\n }\n\n ctx.stroke();\n }\n\n\n // draw border\n if (bw) {\n // If either borderWidth or borderColor is an object, then draw the border\n // line by line instead of as one rectangle\n bc = options.grid.borderColor;\n if(typeof bw == \"object\" || typeof bc == \"object\") {\n if (typeof bw !== \"object\") {\n bw = {top: bw, right: bw, bottom: bw, left: bw};\n }\n if (typeof bc !== \"object\") {\n bc = {top: bc, right: bc, bottom: bc, left: bc};\n }\n\n if (bw.top > 0) {\n ctx.strokeStyle = bc.top;\n ctx.lineWidth = bw.top;\n ctx.beginPath();\n ctx.moveTo(0 - bw.left, 0 - bw.top/2);\n ctx.lineTo(plotWidth, 0 - bw.top/2);\n ctx.stroke();\n }\n\n if (bw.right > 0) {\n ctx.strokeStyle = bc.right;\n ctx.lineWidth = bw.right;\n ctx.beginPath();\n ctx.moveTo(plotWidth + bw.right / 2, 0 - bw.top);\n ctx.lineTo(plotWidth + bw.right / 2, plotHeight);\n ctx.stroke();\n }\n\n if (bw.bottom > 0) {\n ctx.strokeStyle = bc.bottom;\n ctx.lineWidth = bw.bottom;\n ctx.beginPath();\n ctx.moveTo(plotWidth + bw.right, plotHeight + bw.bottom / 2);\n ctx.lineTo(0, plotHeight + bw.bottom / 2);\n ctx.stroke();\n }\n\n if (bw.left > 0) {\n ctx.strokeStyle = bc.left;\n ctx.lineWidth = bw.left;\n ctx.beginPath();\n ctx.moveTo(0 - bw.left/2, plotHeight + bw.bottom);\n ctx.lineTo(0- bw.left/2, 0);\n ctx.stroke();\n }\n }\n else {\n ctx.lineWidth = bw;\n ctx.strokeStyle = options.grid.borderColor;\n ctx.strokeRect(-bw/2, -bw/2, plotWidth + bw, plotHeight + bw);\n }\n }\n\n ctx.restore();\n }\n\n function drawAxisLabels() {\n\n $.each(allAxes(), function (_, axis) {\n var box = axis.box,\n legacyStyles = axis.direction + \"Axis \" + axis.direction + axis.n + \"Axis\",\n layer = \"flot-\" + axis.direction + \"-axis flot-\" + axis.direction + axis.n + \"-axis \" + legacyStyles,\n font = axis.options.font || \"flot-tick-label tickLabel\",\n tick, x, y, halign, valign;\n\n // Remove text before checking for axis.show and ticks.length;\n // otherwise plugins, like flot-tickrotor, that draw their own\n // tick labels will end up with both theirs and the defaults.\n\n surface.removeText(layer);\n\n if (!axis.show || axis.ticks.length == 0)\n return;\n\n for (var i = 0; i < axis.ticks.length; ++i) {\n\n tick = axis.ticks[i];\n if (!tick.label || tick.v < axis.min || tick.v > axis.max)\n continue;\n\n if (axis.direction == \"x\") {\n halign = \"center\";\n x = plotOffset.left + axis.p2c(tick.v);\n if (axis.position == \"bottom\") {\n y = box.top + box.padding + box.eventSectionPadding;\n } else {\n y = box.top + box.height - box.padding;\n valign = \"bottom\";\n }\n } else {\n valign = \"middle\";\n y = plotOffset.top + axis.p2c(tick.v);\n if (axis.position == \"left\") {\n x = box.left + box.width - box.padding;\n halign = \"right\";\n } else {\n x = box.left + box.padding;\n }\n }\n\n surface.addText(layer, x, y, tick.label, font, null, null, halign, valign);\n }\n });\n }\n\n function drawSeries(series) {\n if (series.lines.show)\n drawSeriesLines(series);\n if (series.bars.show)\n drawSeriesBars(series);\n if (series.points.show)\n drawSeriesPoints(series);\n }\n\n function drawSeriesLines(series) {\n function plotLine(datapoints, xoffset, yoffset, axisx, axisy) {\n var points = datapoints.points,\n ps = datapoints.pointsize,\n prevx = null, prevy = null;\n\n ctx.beginPath();\n for (var i = ps; i < points.length; i += ps) {\n var x1 = points[i - ps], y1 = points[i - ps + 1],\n x2 = points[i], y2 = points[i + 1];\n\n if (x1 == null || x2 == null)\n continue;\n\n // clip with ymin\n if (y1 <= y2 && y1 < axisy.min) {\n if (y2 < axisy.min)\n continue; // line segment is outside\n // compute new intersection point\n x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;\n y1 = axisy.min;\n }\n else if (y2 <= y1 && y2 < axisy.min) {\n if (y1 < axisy.min)\n continue;\n x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;\n y2 = axisy.min;\n }\n\n // clip with ymax\n if (y1 >= y2 && y1 > axisy.max) {\n if (y2 > axisy.max)\n continue;\n x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;\n y1 = axisy.max;\n }\n else if (y2 >= y1 && y2 > axisy.max) {\n if (y1 > axisy.max)\n continue;\n x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;\n y2 = axisy.max;\n }\n\n // clip with xmin\n if (x1 <= x2 && x1 < axisx.min) {\n if (x2 < axisx.min)\n continue;\n y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;\n x1 = axisx.min;\n }\n else if (x2 <= x1 && x2 < axisx.min) {\n if (x1 < axisx.min)\n continue;\n y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;\n x2 = axisx.min;\n }\n\n // clip with xmax\n if (x1 >= x2 && x1 > axisx.max) {\n if (x2 > axisx.max)\n continue;\n y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;\n x1 = axisx.max;\n }\n else if (x2 >= x1 && x2 > axisx.max) {\n if (x1 > axisx.max)\n continue;\n y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;\n x2 = axisx.max;\n }\n\n if (x1 != prevx || y1 != prevy)\n ctx.moveTo(axisx.p2c(x1) + xoffset, axisy.p2c(y1) + yoffset);\n\n prevx = x2;\n prevy = y2;\n ctx.lineTo(axisx.p2c(x2) + xoffset, axisy.p2c(y2) + yoffset);\n }\n ctx.stroke();\n }\n\n function plotLineArea(datapoints, axisx, axisy) {\n var points = datapoints.points,\n ps = datapoints.pointsize,\n bottom = Math.min(Math.max(0, axisy.min), axisy.max),\n i = 0, top, areaOpen = false,\n ypos = 1, segmentStart = 0, segmentEnd = 0;\n\n // we process each segment in two turns, first forward\n // direction to sketch out top, then once we hit the\n // end we go backwards to sketch the bottom\n while (true) {\n if (ps > 0 && i > points.length + ps)\n break;\n\n i += ps; // ps is negative if going backwards\n\n var x1 = points[i - ps],\n y1 = points[i - ps + ypos],\n x2 = points[i], y2 = points[i + ypos];\n\n if (areaOpen) {\n if (ps > 0 && x1 != null && x2 == null) {\n // at turning point\n segmentEnd = i;\n ps = -ps;\n ypos = 2;\n continue;\n }\n\n if (ps < 0 && i == segmentStart + ps) {\n // done with the reverse sweep\n ctx.fill();\n areaOpen = false;\n ps = -ps;\n ypos = 1;\n i = segmentStart = segmentEnd + ps;\n continue;\n }\n }\n\n if (x1 == null || x2 == null)\n continue;\n\n // clip x values\n\n // clip with xmin\n if (x1 <= x2 && x1 < axisx.min) {\n if (x2 < axisx.min)\n continue;\n y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;\n x1 = axisx.min;\n }\n else if (x2 <= x1 && x2 < axisx.min) {\n if (x1 < axisx.min)\n continue;\n y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;\n x2 = axisx.min;\n }\n\n // clip with xmax\n if (x1 >= x2 && x1 > axisx.max) {\n if (x2 > axisx.max)\n continue;\n y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;\n x1 = axisx.max;\n }\n else if (x2 >= x1 && x2 > axisx.max) {\n if (x1 > axisx.max)\n continue;\n y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;\n x2 = axisx.max;\n }\n\n if (!areaOpen) {\n // open area\n ctx.beginPath();\n ctx.moveTo(axisx.p2c(x1), axisy.p2c(bottom));\n areaOpen = true;\n }\n\n // now first check the case where both is outside\n if (y1 >= axisy.max && y2 >= axisy.max) {\n ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.max));\n ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.max));\n continue;\n }\n else if (y1 <= axisy.min && y2 <= axisy.min) {\n ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.min));\n ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.min));\n continue;\n }\n\n // else it's a bit more complicated, there might\n // be a flat maxed out rectangle first, then a\n // triangular cutout or reverse; to find these\n // keep track of the current x values\n var x1old = x1, x2old = x2;\n\n // clip the y values, without shortcutting, we\n // go through all cases in turn\n\n // clip with ymin\n if (y1 <= y2 && y1 < axisy.min && y2 >= axisy.min) {\n x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;\n y1 = axisy.min;\n }\n else if (y2 <= y1 && y2 < axisy.min && y1 >= axisy.min) {\n x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;\n y2 = axisy.min;\n }\n\n // clip with ymax\n if (y1 >= y2 && y1 > axisy.max && y2 <= axisy.max) {\n x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;\n y1 = axisy.max;\n }\n else if (y2 >= y1 && y2 > axisy.max && y1 <= axisy.max) {\n x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;\n y2 = axisy.max;\n }\n\n // if the x value was changed we got a rectangle\n // to fill\n if (x1 != x1old) {\n ctx.lineTo(axisx.p2c(x1old), axisy.p2c(y1));\n // it goes to (x1, y1), but we fill that below\n }\n\n // fill triangular section, this sometimes result\n // in redundant points if (x1, y1) hasn't changed\n // from previous line to, but we just ignore that\n ctx.lineTo(axisx.p2c(x1), axisy.p2c(y1));\n ctx.lineTo(axisx.p2c(x2), axisy.p2c(y2));\n\n // fill the other rectangle if it's there\n if (x2 != x2old) {\n ctx.lineTo(axisx.p2c(x2), axisy.p2c(y2));\n ctx.lineTo(axisx.p2c(x2old), axisy.p2c(y2));\n }\n }\n }\n\n ctx.save();\n ctx.translate(plotOffset.left, plotOffset.top);\n ctx.lineJoin = \"round\";\n\n var lw = series.lines.lineWidth,\n sw = series.shadowSize;\n // FIXME: consider another form of shadow when filling is turned on\n if (lw > 0 && sw > 0) {\n // draw shadow as a thick and thin line with transparency\n ctx.lineWidth = sw;\n ctx.strokeStyle = \"rgba(0,0,0,0.1)\";\n // position shadow at angle from the mid of line\n var angle = Math.PI/18;\n plotLine(series.datapoints, Math.sin(angle) * (lw/2 + sw/2), Math.cos(angle) * (lw/2 + sw/2), series.xaxis, series.yaxis);\n ctx.lineWidth = sw/2;\n plotLine(series.datapoints, Math.sin(angle) * (lw/2 + sw/4), Math.cos(angle) * (lw/2 + sw/4), series.xaxis, series.yaxis);\n }\n\n ctx.lineWidth = lw;\n ctx.strokeStyle = series.color;\n var fillStyle = getFillStyle(series.lines, series.color, 0, plotHeight);\n if (fillStyle) {\n ctx.fillStyle = fillStyle;\n plotLineArea(series.datapoints, series.xaxis, series.yaxis);\n }\n\n if (lw > 0)\n plotLine(series.datapoints, 0, 0, series.xaxis, series.yaxis);\n ctx.restore();\n }\n\n function drawSeriesPoints(series) {\n function plotPoints(datapoints, radius, fillStyle, offset, shadow, axisx, axisy, symbol) {\n var points = datapoints.points, ps = datapoints.pointsize;\n\n for (var i = 0; i < points.length; i += ps) {\n var x = points[i], y = points[i + 1];\n if (x == null || x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max)\n continue;\n\n ctx.beginPath();\n x = axisx.p2c(x);\n y = axisy.p2c(y) + offset;\n if (symbol == \"circle\")\n ctx.arc(x, y, radius, 0, shadow ? Math.PI : Math.PI * 2, false);\n else\n symbol(ctx, x, y, radius, shadow);\n ctx.closePath();\n\n if (fillStyle) {\n ctx.fillStyle = fillStyle;\n ctx.fill();\n }\n ctx.stroke();\n }\n }\n\n ctx.save();\n ctx.translate(plotOffset.left, plotOffset.top);\n\n var lw = series.points.lineWidth,\n sw = series.shadowSize,\n radius = series.points.radius,\n symbol = series.points.symbol;\n\n // If the user sets the line width to 0, we change it to a very\n // small value. A line width of 0 seems to force the default of 1.\n // Doing the conditional here allows the shadow setting to still be\n // optional even with a lineWidth of 0.\n\n if( lw == 0 )\n lw = 0.0001;\n\n if (lw > 0 && sw > 0) {\n // draw shadow in two steps\n var w = sw / 2;\n ctx.lineWidth = w;\n ctx.strokeStyle = \"rgba(0,0,0,0.1)\";\n plotPoints(series.datapoints, radius, null, w + w/2, true,\n series.xaxis, series.yaxis, symbol);\n\n ctx.strokeStyle = \"rgba(0,0,0,0.2)\";\n plotPoints(series.datapoints, radius, null, w/2, true,\n series.xaxis, series.yaxis, symbol);\n }\n\n ctx.lineWidth = lw;\n ctx.strokeStyle = series.color;\n plotPoints(series.datapoints, radius,\n getFillStyle(series.points, series.color), 0, false,\n series.xaxis, series.yaxis, symbol);\n ctx.restore();\n }\n\n function drawBar(x, y, b, barLeft, barRight, fillStyleCallback, axisx, axisy, c, horizontal, lineWidth) {\n var left, right, bottom, top,\n drawLeft, drawRight, drawTop, drawBottom,\n tmp;\n\n // in horizontal mode, we start the bar from the left\n // instead of from the bottom so it appears to be\n // horizontal rather than vertical\n if (horizontal) {\n drawBottom = drawRight = drawTop = true;\n drawLeft = false;\n left = b;\n right = x;\n top = y + barLeft;\n bottom = y + barRight;\n\n // account for negative bars\n if (right < left) {\n tmp = right;\n right = left;\n left = tmp;\n drawLeft = true;\n drawRight = false;\n }\n }\n else {\n drawLeft = drawRight = drawTop = true;\n drawBottom = false;\n left = x + barLeft;\n right = x + barRight;\n bottom = b;\n top = y;\n\n // account for negative bars\n if (top < bottom) {\n tmp = top;\n top = bottom;\n bottom = tmp;\n drawBottom = true;\n drawTop = false;\n }\n }\n\n // clip\n if (right < axisx.min || left > axisx.max ||\n top < axisy.min || bottom > axisy.max)\n return;\n\n if (left < axisx.min) {\n left = axisx.min;\n drawLeft = false;\n }\n\n if (right > axisx.max) {\n right = axisx.max;\n drawRight = false;\n }\n\n if (bottom < axisy.min) {\n bottom = axisy.min;\n drawBottom = false;\n }\n\n if (top > axisy.max) {\n top = axisy.max;\n drawTop = false;\n }\n\n left = axisx.p2c(left);\n bottom = axisy.p2c(bottom);\n right = axisx.p2c(right);\n top = axisy.p2c(top);\n\n // fill the bar\n if (fillStyleCallback) {\n c.fillStyle = fillStyleCallback(bottom, top);\n c.fillRect(left, top, right - left, bottom - top)\n }\n\n // draw outline\n if (lineWidth > 0 && (drawLeft || drawRight || drawTop || drawBottom)) {\n c.beginPath();\n\n // FIXME: inline moveTo is buggy with excanvas\n c.moveTo(left, bottom);\n if (drawLeft)\n c.lineTo(left, top);\n else\n c.moveTo(left, top);\n if (drawTop)\n c.lineTo(right, top);\n else\n c.moveTo(right, top);\n if (drawRight)\n c.lineTo(right, bottom);\n else\n c.moveTo(right, bottom);\n if (drawBottom)\n c.lineTo(left, bottom);\n else\n c.moveTo(left, bottom);\n c.stroke();\n }\n }\n\n function drawSeriesBars(series) {\n function plotBars(datapoints, barLeft, barRight, fillStyleCallback, axisx, axisy) {\n var points = datapoints.points, ps = datapoints.pointsize;\n\n for (var i = 0; i < points.length; i += ps) {\n if (points[i] == null)\n continue;\n drawBar(points[i], points[i + 1], points[i + 2], barLeft, barRight, fillStyleCallback, axisx, axisy, ctx, series.bars.horizontal, series.bars.lineWidth);\n }\n }\n\n ctx.save();\n ctx.translate(plotOffset.left, plotOffset.top);\n\n // FIXME: figure out a way to add shadows (for instance along the right edge)\n ctx.lineWidth = series.bars.lineWidth;\n ctx.strokeStyle = series.color;\n\n var barLeft;\n\n switch (series.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -series.bars.barWidth;\n break;\n default:\n barLeft = -series.bars.barWidth / 2;\n }\n\n var fillStyleCallback = series.bars.fill ? function (bottom, top) { return getFillStyle(series.bars, series.color, bottom, top); } : null;\n plotBars(series.datapoints, barLeft, barLeft + series.bars.barWidth, fillStyleCallback, series.xaxis, series.yaxis);\n ctx.restore();\n }\n\n function getFillStyle(filloptions, seriesColor, bottom, top) {\n var fill = filloptions.fill;\n if (!fill)\n return null;\n\n if (filloptions.fillColor)\n return getColorOrGradient(filloptions.fillColor, bottom, top, seriesColor);\n\n var c = $.color.parse(seriesColor);\n c.a = typeof fill == \"number\" ? fill : 0.4;\n c.normalize();\n return c.toString();\n }\n\n function insertLegend() {\n\n if (options.legend.container != null) {\n $(options.legend.container).html(\"\");\n } else {\n placeholder.find(\".legend\").remove();\n }\n\n if (!options.legend.show) {\n return;\n }\n\n var fragments = [], entries = [], rowStarted = false,\n lf = options.legend.labelFormatter, s, label;\n\n // Build a list of legend entries, with each having a label and a color\n\n for (var i = 0; i < series.length; ++i) {\n s = series[i];\n if (s.label) {\n label = lf ? lf(s.label, s) : s.label;\n if (label) {\n entries.push({\n label: label,\n color: s.color\n });\n }\n }\n }\n\n // Sort the legend using either the default or a custom comparator\n\n if (options.legend.sorted) {\n if ($.isFunction(options.legend.sorted)) {\n entries.sort(options.legend.sorted);\n } else if (options.legend.sorted == \"reverse\") {\n \tentries.reverse();\n } else {\n var ascending = options.legend.sorted != \"descending\";\n entries.sort(function(a, b) {\n return a.label == b.label ? 0 : (\n (a.label < b.label) != ascending ? 1 : -1 // Logical XOR\n );\n });\n }\n }\n\n // Generate markup for the list of entries, in their final order\n\n for (var i = 0; i < entries.length; ++i) {\n\n var entry = entries[i];\n\n if (i % options.legend.noColumns == 0) {\n if (rowStarted)\n fragments.push('');\n fragments.push('');\n rowStarted = true;\n }\n\n fragments.push(\n '
' +\n '' + entry.label + ''\n );\n }\n\n if (rowStarted)\n fragments.push('');\n\n if (fragments.length == 0)\n return;\n\n var table = '' + fragments.join(\"\") + '
';\n if (options.legend.container != null)\n $(options.legend.container).html(table);\n else {\n var pos = \"\",\n p = options.legend.position,\n m = options.legend.margin;\n if (m[0] == null)\n m = [m, m];\n if (p.charAt(0) == \"n\")\n pos += 'top:' + (m[1] + plotOffset.top) + 'px;';\n else if (p.charAt(0) == \"s\")\n pos += 'bottom:' + (m[1] + plotOffset.bottom) + 'px;';\n if (p.charAt(1) == \"e\")\n pos += 'right:' + (m[0] + plotOffset.right) + 'px;';\n else if (p.charAt(1) == \"w\")\n pos += 'left:' + (m[0] + plotOffset.left) + 'px;';\n var legend = $('
' + table.replace('style=\"', 'style=\"position:absolute;' + pos +';') + '
').appendTo(placeholder);\n if (options.legend.backgroundOpacity != 0.0) {\n // put in the transparent background\n // separately to avoid blended labels and\n // label boxes\n var c = options.legend.backgroundColor;\n if (c == null) {\n c = options.grid.backgroundColor;\n if (c && typeof c == \"string\")\n c = $.color.parse(c);\n else\n c = $.color.extract(legend, 'background-color');\n c.a = 1;\n c = c.toString();\n }\n var div = legend.children();\n $('
').prependTo(legend).css('opacity', options.legend.backgroundOpacity);\n }\n }\n }\n\n\n // interactive features\n\n var highlights = [],\n redrawTimeout = null;\n\n // returns the data item the mouse is over, or null if none is found\n function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }\n\n function onMouseMove(e) {\n if (options.grid.hoverable)\n triggerClickHoverEvent(\"plothover\", e,\n function (s) { return s[\"hoverable\"] != false; });\n }\n\n function onMouseLeave(e) {\n if (options.grid.hoverable)\n triggerClickHoverEvent(\"plothover\", e,\n function (s) { return false; });\n }\n\n function onClick(e) {\n if (plot.isSelecting) {\n return;\n }\n\n triggerClickHoverEvent(\"plotclick\", e, function (s) { return s[\"clickable\"] != false; });\n }\n\n // trigger click or hover event (they send the same parameters\n // so we share their code)\n function triggerClickHoverEvent(eventname, event, seriesFilter) {\n var offset = eventHolder.offset(),\n canvasX = event.pageX - offset.left - plotOffset.left,\n canvasY = event.pageY - offset.top - plotOffset.top,\n pos = canvasToAxisCoords({ left: canvasX, top: canvasY });\n\n pos.pageX = event.pageX;\n pos.pageY = event.pageY;\n\n // Add ctrlKey and metaKey to event\n pos.ctrlKey = event.ctrlKey;\n pos.metaKey = event.metaKey;\n\n var item = findNearbyItem(canvasX, canvasY, seriesFilter);\n\n if (item) {\n // fill in mouse pos for any listeners out there\n item.pageX = parseInt(item.series.xaxis.p2c(item.datapoint[0]) + offset.left + plotOffset.left, 10);\n item.pageY = parseInt(item.series.yaxis.p2c(item.datapoint[1]) + offset.top + plotOffset.top, 10);\n }\n\n if (options.grid.autoHighlight) {\n // clear auto-highlights\n for (var i = 0; i < highlights.length; ++i) {\n var h = highlights[i];\n if (h.auto == eventname &&\n !(item && h.series == item.series &&\n h.point[0] == item.datapoint[0] &&\n h.point[1] == item.datapoint[1]))\n unhighlight(h.series, h.point);\n }\n\n if (item)\n highlight(item.series, item.datapoint, eventname);\n }\n\n placeholder.trigger(eventname, [ pos, item ]);\n }\n\n function triggerRedrawOverlay() {\n var t = options.interaction.redrawOverlayInterval;\n if (t == -1) { // skip event queue\n drawOverlay();\n return;\n }\n\n if (!redrawTimeout)\n redrawTimeout = setTimeout(drawOverlay, t);\n }\n\n function drawOverlay() {\n redrawTimeout = null;\n\n // draw highlights\n octx.save();\n overlay.clear();\n octx.translate(plotOffset.left, plotOffset.top);\n\n var i, hi;\n for (i = 0; i < highlights.length; ++i) {\n hi = highlights[i];\n\n if (hi.series.bars.show)\n drawBarHighlight(hi.series, hi.point);\n else\n drawPointHighlight(hi.series, hi.point);\n }\n octx.restore();\n\n executeHooks(hooks.drawOverlay, [octx]);\n }\n\n function highlight(s, point, auto) {\n if (typeof s == \"number\")\n s = series[s];\n\n if (typeof point == \"number\") {\n var ps = s.datapoints.pointsize;\n point = s.datapoints.points.slice(ps * point, ps * (point + 1));\n }\n\n var i = indexOfHighlight(s, point);\n if (i == -1) {\n highlights.push({ series: s, point: point, auto: auto });\n\n triggerRedrawOverlay();\n }\n else if (!auto)\n highlights[i].auto = false;\n }\n\n function unhighlight(s, point) {\n if (s == null && point == null) {\n highlights = [];\n triggerRedrawOverlay();\n return;\n }\n\n if (typeof s == \"number\")\n s = series[s];\n\n if (typeof point == \"number\") {\n var ps = s.datapoints.pointsize;\n point = s.datapoints.points.slice(ps * point, ps * (point + 1));\n }\n\n var i = indexOfHighlight(s, point);\n if (i != -1) {\n highlights.splice(i, 1);\n\n triggerRedrawOverlay();\n }\n }\n\n function indexOfHighlight(s, p) {\n for (var i = 0; i < highlights.length; ++i) {\n var h = highlights[i];\n if (h.series == s && h.point[0] == p[0]\n && h.point[1] == p[1])\n return i;\n }\n return -1;\n }\n\n function drawPointHighlight(series, point) {\n var x = point[0], y = point[1],\n axisx = series.xaxis, axisy = series.yaxis,\n highlightColor = (typeof series.highlightColor === \"string\") ? series.highlightColor : $.color.parse(series.color).scale('a', 0.5).toString();\n\n if (x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max)\n return;\n\n var pointRadius = series.points.radius + series.points.lineWidth / 2;\n octx.lineWidth = pointRadius;\n octx.strokeStyle = highlightColor;\n var radius = 1.5 * pointRadius;\n x = axisx.p2c(x);\n y = axisy.p2c(y);\n\n octx.beginPath();\n if (series.points.symbol == \"circle\")\n octx.arc(x, y, radius, 0, 2 * Math.PI, false);\n else\n series.points.symbol(octx, x, y, radius, false);\n octx.closePath();\n octx.stroke();\n }\n\n function drawBarHighlight(series, point) {\n var highlightColor = (typeof series.highlightColor === \"string\") ? series.highlightColor : $.color.parse(series.color).scale('a', 0.5).toString(),\n fillStyle = highlightColor,\n barLeft;\n\n switch (series.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -series.bars.barWidth;\n break;\n default:\n barLeft = -series.bars.barWidth / 2;\n }\n\n octx.lineWidth = series.bars.lineWidth;\n octx.strokeStyle = highlightColor;\n\n drawBar(point[0], point[1], point[2] || 0, barLeft, barLeft + series.bars.barWidth,\n function () { return fillStyle; }, series.xaxis, series.yaxis, octx, series.bars.horizontal, series.bars.lineWidth);\n }\n\n function getColorOrGradient(spec, bottom, top, defaultColor) {\n if (typeof spec == \"string\")\n return spec;\n else {\n // assume this is a gradient spec; IE currently only\n // supports a simple vertical gradient properly, so that's\n // what we support too\n var gradient = ctx.createLinearGradient(0, top, 0, bottom);\n\n for (var i = 0, l = spec.colors.length; i < l; ++i) {\n var c = spec.colors[i];\n if (typeof c != \"string\") {\n var co = $.color.parse(defaultColor);\n if (c.brightness != null)\n co = co.scale('rgb', c.brightness);\n if (c.opacity != null)\n co.a *= c.opacity;\n c = co.toString();\n }\n gradient.addColorStop(i / (l - 1), c);\n }\n\n return gradient;\n }\n }\n }\n\n // Add the plot function to the top level of the jQuery object\n\n $.plot = function(placeholder, data, options) {\n //var t0 = new Date();\n var plot = new Plot($(placeholder), data, options, $.plot.plugins);\n //(window.console ? console.log : alert)(\"time used (msecs): \" + ((new Date()).getTime() - t0.getTime()));\n return plot;\n };\n\n $.plot.version = \"0.8.3\";\n\n $.plot.plugins = [];\n\n // Also add the plot function as a chainable property\n\n $.fn.plot = function(data, options) {\n return this.each(function() {\n $.plot(this, data, options);\n });\n };\n\n // round to nearby lower multiple of base\n function floorInBase(n, base) {\n return base * Math.floor(n / base);\n }\n\n})(jQuery);\n\n\n/***/ }),\n\n/***/ 1986:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return PanelCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_config__ = __webpack_require__(23);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_jquery__ = __webpack_require__(17);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_jquery__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_app_core_core__ = __webpack_require__(197);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_app_features_dashboard_panel_model__ = __webpack_require__(319);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_remarkable__ = __webpack_require__(694);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_remarkable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_remarkable__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_app_core_constants__ = __webpack_require__(315);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_app_core_store__ = __webpack_require__(77);\n\n\n\n\n\n\n\n\nvar TITLE_HEIGHT = 27;\nvar PANEL_BORDER = 2;\nvar PanelCtrl = /** @class */ (function () {\n function PanelCtrl($scope, $injector) {\n var _this = this;\n this.$injector = $injector;\n this.$location = $injector.get('$location');\n this.$scope = $scope;\n this.$timeout = $injector.get('$timeout');\n this.editorTabIndex = 0;\n this.events = this.panel.events;\n this.timing = {};\n var plugin = __WEBPACK_IMPORTED_MODULE_0_app_core_config__[\"a\" /* default */].panels[this.panel.type];\n if (plugin) {\n this.pluginId = plugin.id;\n this.pluginName = plugin.name;\n }\n $scope.$on('refresh', function () { return _this.refresh(); });\n $scope.$on('component-did-mount', function () { return _this.panelDidMount(); });\n $scope.$on('$destroy', function () {\n _this.events.emit('panel-teardown');\n _this.events.removeAllListeners();\n });\n }\n PanelCtrl.prototype.init = function () {\n this.events.emit('panel-initialized');\n this.publishAppEvent('panel-initialized', { scope: this.$scope });\n };\n PanelCtrl.prototype.panelDidMount = function () {\n this.events.emit('component-did-mount');\n };\n PanelCtrl.prototype.renderingCompleted = function () {\n __WEBPACK_IMPORTED_MODULE_3_app_core_core__[\"e\" /* profiler */].renderingCompleted(this.panel.id, this.timing);\n };\n PanelCtrl.prototype.refresh = function () {\n this.events.emit('refresh', null);\n };\n PanelCtrl.prototype.publishAppEvent = function (evtName, evt) {\n this.$scope.$root.appEvent(evtName, evt);\n };\n PanelCtrl.prototype.changeView = function (fullscreen, edit) {\n this.publishAppEvent('panel-change-view', {\n fullscreen: fullscreen,\n edit: edit,\n panelId: this.panel.id,\n });\n };\n PanelCtrl.prototype.viewPanel = function () {\n this.changeView(true, false);\n };\n PanelCtrl.prototype.editPanel = function () {\n this.changeView(true, true);\n };\n PanelCtrl.prototype.exitFullscreen = function () {\n this.changeView(false, false);\n };\n PanelCtrl.prototype.initEditMode = function () {\n var _this = this;\n this.editorTabs = [];\n this.addEditorTab('General', 'public/app/partials/panelgeneral.html');\n this.editModeInitiated = true;\n this.events.emit('init-edit-mode', null);\n var urlTab = (this.$injector.get('$routeParams').tab || '').toLowerCase();\n if (urlTab) {\n this.editorTabs.forEach(function (tab, i) {\n if (tab.title.toLowerCase() === urlTab) {\n _this.editorTabIndex = i;\n }\n });\n }\n };\n PanelCtrl.prototype.changeTab = function (newIndex) {\n this.editorTabIndex = newIndex;\n var route = this.$injector.get('$route');\n route.current.params.tab = this.editorTabs[newIndex].title.toLowerCase();\n route.updateParams();\n };\n PanelCtrl.prototype.addEditorTab = function (title, directiveFn, index) {\n var editorTab = { title: title, directiveFn: directiveFn };\n if (__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isString(directiveFn)) {\n editorTab.directiveFn = function () {\n return { templateUrl: directiveFn };\n };\n }\n if (index) {\n this.editorTabs.splice(index, 0, editorTab);\n }\n else {\n this.editorTabs.push(editorTab);\n }\n };\n PanelCtrl.prototype.getMenu = function () {\n var menu = [];\n menu.push({\n text: 'View',\n click: 'ctrl.viewPanel();',\n icon: 'fa fa-fw fa-eye',\n shortcut: 'v',\n });\n if (this.dashboard.meta.canEdit) {\n menu.push({\n text: 'Edit',\n click: 'ctrl.editPanel();',\n role: 'Editor',\n icon: 'fa fa-fw fa-edit',\n shortcut: 'e',\n });\n }\n menu.push({\n text: 'Share',\n click: 'ctrl.sharePanel();',\n icon: 'fa fa-fw fa-share',\n shortcut: 'p s',\n });\n // Additional items from sub-class\n menu.push.apply(menu, this.getAdditionalMenuItems());\n var extendedMenu = this.getExtendedMenu();\n menu.push({\n text: 'More ...',\n click: '',\n icon: 'fa fa-fw fa-cube',\n submenu: extendedMenu,\n });\n if (this.dashboard.meta.canEdit) {\n menu.push({ divider: true, role: 'Editor' });\n menu.push({\n text: 'Remove',\n click: 'ctrl.removePanel();',\n role: 'Editor',\n icon: 'fa fa-fw fa-trash',\n shortcut: 'p r',\n });\n }\n return menu;\n };\n PanelCtrl.prototype.getExtendedMenu = function () {\n var menu = [];\n if (!this.fullscreen && this.dashboard.meta.canEdit) {\n menu.push({\n text: 'Duplicate',\n click: 'ctrl.duplicate()',\n role: 'Editor',\n shortcut: 'p d',\n });\n }\n this.events.emit('init-panel-actions', menu);\n return menu;\n };\n // Override in sub-class to add items before extended menu\n PanelCtrl.prototype.getAdditionalMenuItems = function () {\n return [];\n };\n PanelCtrl.prototype.otherPanelInFullscreenMode = function () {\n return this.dashboard.meta.fullscreen && !this.fullscreen;\n };\n PanelCtrl.prototype.calculatePanelHeight = function () {\n if (this.fullscreen) {\n var docHeight = __WEBPACK_IMPORTED_MODULE_2_jquery___default()(window).height();\n var editHeight = Math.floor(docHeight * 0.4);\n var fullscreenHeight = Math.floor(docHeight * 0.8);\n this.containerHeight = this.editMode ? editHeight : fullscreenHeight;\n }\n else {\n this.containerHeight = this.panel.gridPos.h * __WEBPACK_IMPORTED_MODULE_6_app_core_constants__[\"c\" /* GRID_CELL_HEIGHT */] + (this.panel.gridPos.h - 1) * __WEBPACK_IMPORTED_MODULE_6_app_core_constants__[\"d\" /* GRID_CELL_VMARGIN */];\n }\n if (this.panel.soloMode) {\n this.containerHeight = __WEBPACK_IMPORTED_MODULE_2_jquery___default()(window).height();\n }\n this.height = this.containerHeight - (PANEL_BORDER + TITLE_HEIGHT);\n };\n PanelCtrl.prototype.render = function (payload) {\n this.timing.renderStart = new Date().getTime();\n this.events.emit('render', payload);\n };\n PanelCtrl.prototype.duplicate = function () {\n var _this = this;\n this.dashboard.duplicatePanel(this.panel);\n this.$timeout(function () {\n _this.$scope.$root.$broadcast('render');\n });\n };\n PanelCtrl.prototype.removePanel = function () {\n this.publishAppEvent('panel-remove', {\n panelId: this.panel.id,\n });\n };\n PanelCtrl.prototype.editPanelJson = function () {\n var editScope = this.$scope.$root.$new();\n editScope.object = this.panel.getSaveModel();\n editScope.updateHandler = this.replacePanel.bind(this);\n editScope.enableCopy = true;\n this.publishAppEvent('show-modal', {\n src: 'public/app/partials/edit_json.html',\n scope: editScope,\n });\n };\n PanelCtrl.prototype.copyPanel = function () {\n __WEBPACK_IMPORTED_MODULE_7_app_core_store__[\"a\" /* default */].set(__WEBPACK_IMPORTED_MODULE_6_app_core_constants__[\"f\" /* LS_PANEL_COPY_KEY */], JSON.stringify(this.panel.getSaveModel()));\n __WEBPACK_IMPORTED_MODULE_3_app_core_core__[\"b\" /* appEvents */].emit('alert-success', ['Panel copied. Open Add Panel to paste']);\n };\n PanelCtrl.prototype.replacePanel = function (newPanel, oldPanel) {\n var dashboard = this.dashboard;\n var index = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.findIndex(dashboard.panels, function (panel) {\n return panel.id === oldPanel.id;\n });\n var deletedPanel = dashboard.panels.splice(index, 1);\n this.dashboard.events.emit('panel-removed', deletedPanel);\n newPanel = new __WEBPACK_IMPORTED_MODULE_4_app_features_dashboard_panel_model__[\"a\" /* PanelModel */](newPanel);\n newPanel.id = oldPanel.id;\n dashboard.panels.splice(index, 0, newPanel);\n dashboard.sortPanelsByGridPos();\n dashboard.events.emit('panel-added', newPanel);\n };\n PanelCtrl.prototype.sharePanel = function () {\n var shareScope = this.$scope.$new();\n shareScope.panel = this.panel;\n shareScope.dashboard = this.dashboard;\n this.publishAppEvent('show-modal', {\n src: 'public/app/features/dashboard/partials/shareModal.html',\n scope: shareScope,\n });\n };\n PanelCtrl.prototype.getInfoMode = function () {\n if (this.error) {\n return 'error';\n }\n if (!!this.panel.description) {\n return 'info';\n }\n if (this.panel.links && this.panel.links.length) {\n return 'links';\n }\n return '';\n };\n PanelCtrl.prototype.getInfoContent = function (options) {\n var markdown = this.panel.description;\n if (options.mode === 'tooltip') {\n markdown = this.error || this.panel.description;\n }\n var linkSrv = this.$injector.get('linkSrv');\n var sanitize = this.$injector.get('$sanitize');\n var templateSrv = this.$injector.get('templateSrv');\n var interpolatedMarkdown = templateSrv.replace(markdown, this.panel.scopedVars);\n var html = '
';\n html += new __WEBPACK_IMPORTED_MODULE_5_remarkable___default.a().render(interpolatedMarkdown);\n if (this.panel.links && this.panel.links.length > 0) {\n html += '
    ';\n for (var _i = 0, _a = this.panel.links; _i < _a.length; _i++) {\n var link = _a[_i];\n var info = linkSrv.getPanelLinkAnchorInfo(link, this.panel.scopedVars);\n html +=\n '
  • ' +\n info.title +\n '
  • ';\n }\n html += '
';\n }\n html += '
';\n return sanitize(html);\n };\n PanelCtrl.prototype.openInspector = function () {\n var modalScope = this.$scope.$new();\n modalScope.panel = this.panel;\n modalScope.dashboard = this.dashboard;\n modalScope.panelInfoHtml = this.getInfoContent({ mode: 'inspector' });\n modalScope.inspector = __WEBPACK_IMPORTED_MODULE_2_jquery___default.a.extend(true, {}, this.inspector);\n this.publishAppEvent('show-modal', {\n src: 'public/app/features/dashboard/partials/inspector.html',\n scope: modalScope,\n });\n };\n PanelCtrl.prototype.titleChanged = function () {\n this.panel.hasCustomTitle = true;\n };\n return PanelCtrl;\n}());\n\n\n\n/***/ }),\n\n/***/ 1987:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar TableModel = /** @class */ (function () {\n function TableModel() {\n this.columns = [];\n this.columnMap = {};\n this.rows = [];\n this.type = 'table';\n }\n TableModel.prototype.sort = function (options) {\n if (options.col === null || this.columns.length <= options.col) {\n return;\n }\n this.rows.sort(function (a, b) {\n a = a[options.col];\n b = b[options.col];\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n });\n this.columns[options.col].sort = true;\n if (options.desc) {\n this.rows.reverse();\n this.columns[options.col].desc = true;\n }\n else {\n this.columns[options.col].desc = false;\n }\n };\n TableModel.prototype.addColumn = function (col) {\n if (!this.columnMap[col.text]) {\n this.columns.push(col);\n this.columnMap[col.text] = col;\n }\n };\n TableModel.prototype.addRow = function (row) {\n this.rows.push(row);\n };\n return TableModel;\n}());\n/* harmony default export */ __webpack_exports__[\"a\"] = (TableModel);\n\n\n/***/ }),\n\n/***/ 1988:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"m\", function() { return metricAggTypes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return bucketAggTypes; });\n/* unused harmony export orderByOptions */\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"o\", function() { return orderOptions; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"p\", function() { return sizeOptions; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"e\", function() { return extendedStats; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"k\", function() { return intervalOptions; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"n\", function() { return movingAvgModelOptions; });\n/* unused harmony export pipelineOptions */\n/* unused harmony export movingAvgModelSettings */\n/* harmony export (immutable) */ __webpack_exports__[\"f\"] = getMetricAggTypes;\n/* harmony export (immutable) */ __webpack_exports__[\"j\"] = getPipelineOptions;\n/* harmony export (immutable) */ __webpack_exports__[\"l\"] = isPipelineAgg;\n/* harmony export (immutable) */ __webpack_exports__[\"i\"] = getPipelineAggOptions;\n/* harmony export (immutable) */ __webpack_exports__[\"g\"] = getMovingAvgSettings;\n/* harmony export (immutable) */ __webpack_exports__[\"h\"] = getOrderByOptions;\n/* harmony export (immutable) */ __webpack_exports__[\"c\"] = describeOrder;\n/* harmony export (immutable) */ __webpack_exports__[\"b\"] = describeMetric;\n/* harmony export (immutable) */ __webpack_exports__[\"d\"] = describeOrderBy;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n\nvar metricAggTypes = [\n { text: 'Count', value: 'count', requiresField: false },\n {\n text: 'Average',\n value: 'avg',\n requiresField: true,\n supportsInlineScript: true,\n supportsMissing: true,\n },\n {\n text: 'Sum',\n value: 'sum',\n requiresField: true,\n supportsInlineScript: true,\n supportsMissing: true,\n },\n {\n text: 'Max',\n value: 'max',\n requiresField: true,\n supportsInlineScript: true,\n supportsMissing: true,\n },\n {\n text: 'Min',\n value: 'min',\n requiresField: true,\n supportsInlineScript: true,\n supportsMissing: true,\n },\n {\n text: 'Extended Stats',\n value: 'extended_stats',\n requiresField: true,\n supportsMissing: true,\n supportsInlineScript: true,\n },\n {\n text: 'Percentiles',\n value: 'percentiles',\n requiresField: true,\n supportsMissing: true,\n supportsInlineScript: true,\n },\n {\n text: 'Unique Count',\n value: 'cardinality',\n requiresField: true,\n supportsMissing: true,\n },\n {\n text: 'Moving Average',\n value: 'moving_avg',\n requiresField: false,\n isPipelineAgg: true,\n minVersion: 2,\n },\n {\n text: 'Derivative',\n value: 'derivative',\n requiresField: false,\n isPipelineAgg: true,\n minVersion: 2,\n },\n { text: 'Raw Document', value: 'raw_document', requiresField: false },\n];\nvar bucketAggTypes = [\n { text: 'Terms', value: 'terms', requiresField: true },\n { text: 'Filters', value: 'filters' },\n { text: 'Geo Hash Grid', value: 'geohash_grid', requiresField: true },\n { text: 'Date Histogram', value: 'date_histogram', requiresField: true },\n { text: 'Histogram', value: 'histogram', requiresField: true },\n];\nvar orderByOptions = [{ text: 'Doc Count', value: '_count' }, { text: 'Term value', value: '_term' }];\nvar orderOptions = [{ text: 'Top', value: 'desc' }, { text: 'Bottom', value: 'asc' }];\nvar sizeOptions = [\n { text: 'No limit', value: '0' },\n { text: '1', value: '1' },\n { text: '2', value: '2' },\n { text: '3', value: '3' },\n { text: '5', value: '5' },\n { text: '10', value: '10' },\n { text: '15', value: '15' },\n { text: '20', value: '20' },\n];\nvar extendedStats = [\n { text: 'Avg', value: 'avg' },\n { text: 'Min', value: 'min' },\n { text: 'Max', value: 'max' },\n { text: 'Sum', value: 'sum' },\n { text: 'Count', value: 'count' },\n { text: 'Std Dev', value: 'std_deviation' },\n { text: 'Std Dev Upper', value: 'std_deviation_bounds_upper' },\n { text: 'Std Dev Lower', value: 'std_deviation_bounds_lower' },\n];\nvar intervalOptions = [\n { text: 'auto', value: 'auto' },\n { text: '10s', value: '10s' },\n { text: '1m', value: '1m' },\n { text: '5m', value: '5m' },\n { text: '10m', value: '10m' },\n { text: '20m', value: '20m' },\n { text: '1h', value: '1h' },\n { text: '1d', value: '1d' },\n];\nvar movingAvgModelOptions = [\n { text: 'Simple', value: 'simple' },\n { text: 'Linear', value: 'linear' },\n { text: 'Exponentially Weighted', value: 'ewma' },\n { text: 'Holt Linear', value: 'holt' },\n { text: 'Holt Winters', value: 'holt_winters' },\n];\nvar pipelineOptions = {\n moving_avg: [\n { text: 'window', default: 5 },\n { text: 'model', default: 'simple' },\n { text: 'predict', default: undefined },\n { text: 'minimize', default: false },\n ],\n derivative: [{ text: 'unit', default: undefined }],\n};\nvar movingAvgModelSettings = {\n simple: [],\n linear: [],\n ewma: [{ text: 'Alpha', value: 'alpha', default: undefined }],\n holt: [{ text: 'Alpha', value: 'alpha', default: undefined }, { text: 'Beta', value: 'beta', default: undefined }],\n holt_winters: [\n { text: 'Alpha', value: 'alpha', default: undefined },\n { text: 'Beta', value: 'beta', default: undefined },\n { text: 'Gamma', value: 'gamma', default: undefined },\n { text: 'Period', value: 'period', default: undefined },\n { text: 'Pad', value: 'pad', default: undefined, isCheckbox: true },\n ],\n};\nfunction getMetricAggTypes(esVersion) {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.filter(metricAggTypes, function (f) {\n if (f.minVersion) {\n return f.minVersion <= esVersion;\n }\n else {\n return true;\n }\n });\n}\nfunction getPipelineOptions(metric) {\n if (!isPipelineAgg(metric.type)) {\n return [];\n }\n return pipelineOptions[metric.type];\n}\nfunction isPipelineAgg(metricType) {\n if (metricType) {\n var po = pipelineOptions[metricType];\n return po !== null && po !== undefined;\n }\n return false;\n}\nfunction getPipelineAggOptions(targets) {\n var result = [];\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(targets.metrics, function (metric) {\n if (!isPipelineAgg(metric.type)) {\n result.push({ text: describeMetric(metric), value: metric.id });\n }\n });\n return result;\n}\nfunction getMovingAvgSettings(model, filtered) {\n var filteredResult = [];\n if (filtered) {\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(movingAvgModelSettings[model], function (setting) {\n if (!setting.isCheckbox) {\n filteredResult.push(setting);\n }\n });\n return filteredResult;\n }\n return movingAvgModelSettings[model];\n}\nfunction getOrderByOptions(target) {\n var metricRefs = [];\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(target.metrics, function (metric) {\n if (metric.type !== 'count') {\n metricRefs.push({ text: describeMetric(metric), value: metric.id });\n }\n });\n return orderByOptions.concat(metricRefs);\n}\nfunction describeOrder(order) {\n var def = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(orderOptions, { value: order });\n return def.text;\n}\nfunction describeMetric(metric) {\n var def = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(metricAggTypes, { value: metric.type });\n return def.text + ' ' + metric.field;\n}\nfunction describeOrderBy(orderBy, target) {\n var def = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(orderByOptions, { value: orderBy });\n if (def) {\n return def.text;\n }\n var metric = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(target.metrics, { id: orderBy });\n if (metric) {\n return describeMetric(metric);\n }\n else {\n return 'metric not found';\n }\n}\n\n\n/***/ }),\n\n/***/ 1989:\n/***/ (function(module, exports) {\n\n/* Pretty handling of time axes.\n\nCopyright (c) 2007-2013 IOLA and Ole Laursen.\nLicensed under the MIT license.\n\nSet axis.mode to \"time\" to enable. See the section \"Time series data\" in\nAPI.txt for details.\n\n*/\n\n(function($) {\n\n\tvar options = {\n\t\txaxis: {\n\t\t\ttimezone: null,\t\t// \"browser\" for local to the client or timezone for timezone-js\n\t\t\ttimeformat: null,\t// format string to use\n\t\t\ttwelveHourClock: false,\t// 12 or 24 time in time mode\n\t\t\tmonthNames: null\t// list of names of months\n\t\t}\n\t};\n\n\t// round to nearby lower multiple of base\n\n\tfunction floorInBase(n, base) {\n\t\treturn base * Math.floor(n / base);\n\t}\n\n\t// Returns a string with the date d formatted according to fmt.\n\t// A subset of the Open Group's strftime format is supported.\n\n\tfunction formatDate(d, fmt, monthNames, dayNames) {\n\n\t\tif (typeof d.strftime == \"function\") {\n\t\t\treturn d.strftime(fmt);\n\t\t}\n\n\t\tvar leftPad = function(n, pad) {\n\t\t\tn = \"\" + n;\n\t\t\tpad = \"\" + (pad == null ? \"0\" : pad);\n\t\t\treturn n.length == 1 ? pad + n : n;\n\t\t};\n\n\t\tvar r = [];\n\t\tvar escape = false;\n\t\tvar hours = d.getHours();\n\t\tvar isAM = hours < 12;\n\n\t\tif (monthNames == null) {\n\t\t\tmonthNames = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n\t\t}\n\n\t\tif (dayNames == null) {\n\t\t\tdayNames = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\n\t\t}\n\n\t\tvar hours12;\n\n\t\tif (hours > 12) {\n\t\t\thours12 = hours - 12;\n\t\t} else if (hours == 0) {\n\t\t\thours12 = 12;\n\t\t} else {\n\t\t\thours12 = hours;\n\t\t}\n\n\t\tfor (var i = 0; i < fmt.length; ++i) {\n\n\t\t\tvar c = fmt.charAt(i);\n\n\t\t\tif (escape) {\n\t\t\t\tswitch (c) {\n\t\t\t\t\tcase 'a': c = \"\" + dayNames[d.getDay()]; break;\n\t\t\t\t\tcase 'b': c = \"\" + monthNames[d.getMonth()]; break;\n\t\t\t\t\tcase 'd': c = leftPad(d.getDate(), \"\"); break;\n\t\t\t\t\tcase 'e': c = leftPad(d.getDate(), \" \"); break;\n\t\t\t\t\tcase 'h':\t// For back-compat with 0.7; remove in 1.0\n\t\t\t\t\tcase 'H': c = leftPad(hours); break;\n\t\t\t\t\tcase 'I': c = leftPad(hours12); break;\n\t\t\t\t\tcase 'l': c = leftPad(hours12, \" \"); break;\n\t\t\t\t\tcase 'm': c = leftPad(d.getMonth() + 1, \"\"); break;\n\t\t\t\t\tcase 'M': c = leftPad(d.getMinutes()); break;\n\t\t\t\t\t// quarters not in Open Group's strftime specification\n\t\t\t\t\tcase 'q':\n\t\t\t\t\t\tc = \"\" + (Math.floor(d.getMonth() / 3) + 1); break;\n\t\t\t\t\tcase 'S': c = leftPad(d.getSeconds()); break;\n\t\t\t\t\tcase 'y': c = leftPad(d.getFullYear() % 100); break;\n\t\t\t\t\tcase 'Y': c = \"\" + d.getFullYear(); break;\n\t\t\t\t\tcase 'p': c = (isAM) ? (\"\" + \"am\") : (\"\" + \"pm\"); break;\n\t\t\t\t\tcase 'P': c = (isAM) ? (\"\" + \"AM\") : (\"\" + \"PM\"); break;\n\t\t\t\t\tcase 'w': c = \"\" + d.getDay(); break;\n\t\t\t\t}\n\t\t\t\tr.push(c);\n\t\t\t\tescape = false;\n\t\t\t} else {\n\t\t\t\tif (c == \"%\") {\n\t\t\t\t\tescape = true;\n\t\t\t\t} else {\n\t\t\t\t\tr.push(c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn r.join(\"\");\n\t}\n\n\t// To have a consistent view of time-based data independent of which time\n\t// zone the client happens to be in we need a date-like object independent\n\t// of time zones. This is done through a wrapper that only calls the UTC\n\t// versions of the accessor methods.\n\n\tfunction makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t};\n\n\t// select time zone strategy. This returns a date-like object tied to the\n\t// desired timezone\n\n\tfunction dateGenerator(ts, opts) {\n\t\tif (opts.timezone == \"browser\") {\n\t\t\treturn new Date(ts);\n\t\t} else if (!opts.timezone || opts.timezone == \"utc\") {\n\t\t\treturn makeUtcWrapper(new Date(ts));\n\t\t} else if (typeof timezoneJS != \"undefined\" && typeof timezoneJS.Date != \"undefined\") {\n\t\t\tvar d = new timezoneJS.Date();\n\t\t\t// timezone-js is fickle, so be sure to set the time zone before\n\t\t\t// setting the time.\n\t\t\td.setTimezone(opts.timezone);\n\t\t\td.setTime(ts);\n\t\t\treturn d;\n\t\t} else {\n\t\t\treturn makeUtcWrapper(new Date(ts));\n\t\t}\n\t}\n\n\t// map of app. size of time units in milliseconds\n\n\tvar timeUnitSize = {\n\t\t\"second\": 1000,\n\t\t\"minute\": 60 * 1000,\n\t\t\"hour\": 60 * 60 * 1000,\n\t\t\"day\": 24 * 60 * 60 * 1000,\n\t\t\"month\": 30 * 24 * 60 * 60 * 1000,\n\t\t\"quarter\": 3 * 30 * 24 * 60 * 60 * 1000,\n\t\t\"year\": 365.2425 * 24 * 60 * 60 * 1000\n\t};\n\n\t// the allowed tick sizes, after 1 year we use\n\t// an integer algorithm\n\n\tvar baseSpec = [\n\t\t[1, \"second\"], [2, \"second\"], [5, \"second\"], [10, \"second\"],\n\t\t[30, \"second\"],\n\t\t[1, \"minute\"], [2, \"minute\"], [5, \"minute\"], [10, \"minute\"],\n\t\t[30, \"minute\"],\n\t\t[1, \"hour\"], [2, \"hour\"], [4, \"hour\"],\n\t\t[8, \"hour\"], [12, \"hour\"],\n\t\t[1, \"day\"], [2, \"day\"], [3, \"day\"],\n\t\t[0.25, \"month\"], [0.5, \"month\"], [1, \"month\"],\n\t\t[2, \"month\"]\n\t];\n\n\t// we don't know which variant(s) we'll need yet, but generating both is\n\t// cheap\n\n\tvar specMonths = baseSpec.concat([[3, \"month\"], [6, \"month\"],\n\t\t[1, \"year\"]]);\n\tvar specQuarters = baseSpec.concat([[1, \"quarter\"], [2, \"quarter\"],\n\t\t[1, \"year\"]]);\n\n\tfunction init(plot) {\n\t\tplot.hooks.processOptions.push(function (plot, options) {\n\t\t\t$.each(plot.getAxes(), function(axisName, axis) {\n\n\t\t\t\tvar opts = axis.options;\n\n\t\t\t\tif (opts.mode == \"time\") {\n\t\t\t\t\taxis.tickGenerator = function(axis) {\n\n\t\t\t\t\t\tvar ticks = [];\n\t\t\t\t\t\tvar d = dateGenerator(axis.min, opts);\n\t\t\t\t\t\tvar minSize = 0;\n\n\t\t\t\t\t\t// make quarter use a possibility if quarters are\n\t\t\t\t\t\t// mentioned in either of these options\n\n\t\t\t\t\t\tvar spec = (opts.tickSize && opts.tickSize[1] ===\n\t\t\t\t\t\t\t\"quarter\") ||\n\t\t\t\t\t\t\t(opts.minTickSize && opts.minTickSize[1] ===\n\t\t\t\t\t\t\t\"quarter\") ? specQuarters : specMonths;\n\n\t\t\t\t\t\tif (opts.minTickSize != null) {\n\t\t\t\t\t\t\tif (typeof opts.tickSize == \"number\") {\n\t\t\t\t\t\t\t\tminSize = opts.tickSize;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tminSize = opts.minTickSize[0] * timeUnitSize[opts.minTickSize[1]];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (var i = 0; i < spec.length - 1; ++i) {\n\t\t\t\t\t\t\tif (axis.delta < (spec[i][0] * timeUnitSize[spec[i][1]]\n\t\t\t\t\t\t\t\t\t\t\t + spec[i + 1][0] * timeUnitSize[spec[i + 1][1]]) / 2\n\t\t\t\t\t\t\t\t&& spec[i][0] * timeUnitSize[spec[i][1]] >= minSize) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar size = spec[i][0];\n\t\t\t\t\t\tvar unit = spec[i][1];\n\n\t\t\t\t\t\t// special-case the possibility of several years\n\n\t\t\t\t\t\tif (unit == \"year\") {\n\n\t\t\t\t\t\t\t// if given a minTickSize in years, just use it,\n\t\t\t\t\t\t\t// ensuring that it's an integer\n\n\t\t\t\t\t\t\tif (opts.minTickSize != null && opts.minTickSize[1] == \"year\") {\n\t\t\t\t\t\t\t\tsize = Math.floor(opts.minTickSize[0]);\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tvar magn = Math.pow(10, Math.floor(Math.log(axis.delta / timeUnitSize.year) / Math.LN10));\n\t\t\t\t\t\t\t\tvar norm = (axis.delta / timeUnitSize.year) / magn;\n\n\t\t\t\t\t\t\t\tif (norm < 1.5) {\n\t\t\t\t\t\t\t\t\tsize = 1;\n\t\t\t\t\t\t\t\t} else if (norm < 3) {\n\t\t\t\t\t\t\t\t\tsize = 2;\n\t\t\t\t\t\t\t\t} else if (norm < 7.5) {\n\t\t\t\t\t\t\t\t\tsize = 5;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tsize = 10;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tsize *= magn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// minimum size for years is 1\n\n\t\t\t\t\t\t\tif (size < 1) {\n\t\t\t\t\t\t\t\tsize = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taxis.tickSize = opts.tickSize || [size, unit];\n\t\t\t\t\t\tvar tickSize = axis.tickSize[0];\n\t\t\t\t\t\tunit = axis.tickSize[1];\n\n\t\t\t\t\t\tvar step = tickSize * timeUnitSize[unit];\n\n\t\t\t\t\t\tif (unit == \"second\") {\n\t\t\t\t\t\t\td.setSeconds(floorInBase(d.getSeconds(), tickSize));\n\t\t\t\t\t\t} else if (unit == \"minute\") {\n\t\t\t\t\t\t\td.setMinutes(floorInBase(d.getMinutes(), tickSize));\n\t\t\t\t\t\t} else if (unit == \"hour\") {\n\t\t\t\t\t\t\td.setHours(floorInBase(d.getHours(), tickSize));\n\t\t\t\t\t\t} else if (unit == \"month\") {\n\t\t\t\t\t\t\td.setMonth(floorInBase(d.getMonth(), tickSize));\n\t\t\t\t\t\t} else if (unit == \"quarter\") {\n\t\t\t\t\t\t\td.setMonth(3 * floorInBase(d.getMonth() / 3,\n\t\t\t\t\t\t\t\ttickSize));\n\t\t\t\t\t\t} else if (unit == \"year\") {\n\t\t\t\t\t\t\td.setFullYear(floorInBase(d.getFullYear(), tickSize));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// reset smaller components\n\n\t\t\t\t\t\td.setMilliseconds(0);\n\n\t\t\t\t\t\tif (step >= timeUnitSize.minute) {\n\t\t\t\t\t\t\td.setSeconds(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (step >= timeUnitSize.hour) {\n\t\t\t\t\t\t\td.setMinutes(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (step >= timeUnitSize.day) {\n\t\t\t\t\t\t\td.setHours(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (step >= timeUnitSize.day * 4) {\n\t\t\t\t\t\t\td.setDate(1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (step >= timeUnitSize.month * 2) {\n\t\t\t\t\t\t\td.setMonth(floorInBase(d.getMonth(), 3));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (step >= timeUnitSize.quarter * 2) {\n\t\t\t\t\t\t\td.setMonth(floorInBase(d.getMonth(), 6));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (step >= timeUnitSize.year) {\n\t\t\t\t\t\t\td.setMonth(0);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar carry = 0;\n\t\t\t\t\t\tvar v = Number.NaN;\n\t\t\t\t\t\tvar prev;\n\n\t\t\t\t\t\tdo {\n\n\t\t\t\t\t\t\tprev = v;\n\t\t\t\t\t\t\tv = d.getTime();\n\t\t\t\t\t\t\tticks.push(v);\n\n\t\t\t\t\t\t\tif (unit == \"month\" || unit == \"quarter\") {\n\t\t\t\t\t\t\t\tif (tickSize < 1) {\n\n\t\t\t\t\t\t\t\t\t// a bit complicated - we'll divide the\n\t\t\t\t\t\t\t\t\t// month/quarter up but we need to take\n\t\t\t\t\t\t\t\t\t// care of fractions so we don't end up in\n\t\t\t\t\t\t\t\t\t// the middle of a day\n\n\t\t\t\t\t\t\t\t\td.setDate(1);\n\t\t\t\t\t\t\t\t\tvar start = d.getTime();\n\t\t\t\t\t\t\t\t\td.setMonth(d.getMonth() +\n\t\t\t\t\t\t\t\t\t\t(unit == \"quarter\" ? 3 : 1));\n\t\t\t\t\t\t\t\t\tvar end = d.getTime();\n\t\t\t\t\t\t\t\t\td.setTime(v + carry * timeUnitSize.hour + (end - start) * tickSize);\n\t\t\t\t\t\t\t\t\tcarry = d.getHours();\n\t\t\t\t\t\t\t\t\td.setHours(0);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\td.setMonth(d.getMonth() +\n\t\t\t\t\t\t\t\t\t\ttickSize * (unit == \"quarter\" ? 3 : 1));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (unit == \"year\") {\n\t\t\t\t\t\t\t\td.setFullYear(d.getFullYear() + tickSize);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\td.setTime(v + step);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} while (v < axis.max && v != prev);\n\n\t\t\t\t\t\treturn ticks;\n\t\t\t\t\t};\n\n\t\t\t\t\taxis.tickFormatter = function (v, axis) {\n\n\t\t\t\t\t\tvar d = dateGenerator(v, axis.options);\n\n\t\t\t\t\t\t// first check global format\n\n\t\t\t\t\t\tif (opts.timeformat != null) {\n\t\t\t\t\t\t\treturn formatDate(d, opts.timeformat, opts.monthNames, opts.dayNames);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// possibly use quarters if quarters are mentioned in\n\t\t\t\t\t\t// any of these places\n\n\t\t\t\t\t\tvar useQuarters = (axis.options.tickSize &&\n\t\t\t\t\t\t\t\taxis.options.tickSize[1] == \"quarter\") ||\n\t\t\t\t\t\t\t(axis.options.minTickSize &&\n\t\t\t\t\t\t\t\taxis.options.minTickSize[1] == \"quarter\");\n\n\t\t\t\t\t\tvar t = axis.tickSize[0] * timeUnitSize[axis.tickSize[1]];\n\t\t\t\t\t\tvar span = axis.max - axis.min;\n\t\t\t\t\t\tvar suffix = (opts.twelveHourClock) ? \" %p\" : \"\";\n\t\t\t\t\t\tvar hourCode = (opts.twelveHourClock) ? \"%I\" : \"%H\";\n\t\t\t\t\t\tvar fmt;\n\n\t\t\t\t\t\tif (t < timeUnitSize.minute) {\n\t\t\t\t\t\t\tfmt = hourCode + \":%M:%S\" + suffix;\n\t\t\t\t\t\t} else if (t < timeUnitSize.day) {\n\t\t\t\t\t\t\tif (span < 2 * timeUnitSize.day) {\n\t\t\t\t\t\t\t\tfmt = hourCode + \":%M\" + suffix;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tfmt = \"%b %d \" + hourCode + \":%M\" + suffix;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (t < timeUnitSize.month) {\n\t\t\t\t\t\t\tfmt = \"%b %d\";\n\t\t\t\t\t\t} else if ((useQuarters && t < timeUnitSize.quarter) ||\n\t\t\t\t\t\t\t(!useQuarters && t < timeUnitSize.year)) {\n\t\t\t\t\t\t\tif (span < timeUnitSize.year) {\n\t\t\t\t\t\t\t\tfmt = \"%b\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tfmt = \"%b %Y\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (useQuarters && t < timeUnitSize.year) {\n\t\t\t\t\t\t\tif (span < timeUnitSize.year) {\n\t\t\t\t\t\t\t\tfmt = \"Q%q\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tfmt = \"Q%q %Y\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfmt = \"%Y\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar rt = formatDate(d, fmt, opts.monthNames, opts.dayNames);\n\n\t\t\t\t\t\treturn rt;\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\t$.plot.plugins.push({\n\t\tinit: init,\n\t\toptions: options,\n\t\tname: 'time',\n\t\tversion: '1.0'\n\t});\n\n\t// Time-axis support used to be in Flot core, which exposed the\n\t// formatDate function on the plot object. Various plugins depend\n\t// on the function, so we need to re-expose it here.\n\n\t$.plot.formatDate = formatDate;\n\n})(jQuery);\n\n\n/***/ }),\n\n/***/ 1990:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = importPluginModule;\n/* harmony export (immutable) */ __webpack_exports__[\"b\"] = loadPluginCss;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_systemjs_dist_system_js__ = __webpack_require__(2068);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_systemjs_dist_system_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_systemjs_dist_system_js__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_plugins_sdk__ = __webpack_require__(1983);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_app_core_utils_kbn__ = __webpack_require__(312);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_moment__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_moment__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_jquery__ = __webpack_require__(17);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_jquery__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prismjs__ = __webpack_require__(705);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_prismjs___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_prismjs__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_slate__ = __webpack_require__(113);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_slate_react__ = __webpack_require__(704);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_slate_plain_serializer__ = __webpack_require__(317);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_react__ = __webpack_require__(3);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11_react__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_react_dom__ = __webpack_require__(32);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_react_dom___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_12_react_dom__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_app_core_config__ = __webpack_require__(23);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_app_core_time_series2__ = __webpack_require__(313);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_app_core_table_model__ = __webpack_require__(1987);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16_app_core_core__ = __webpack_require__(197);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17_app_core_utils_datemath__ = __webpack_require__(691);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18_app_core_utils_file_export__ = __webpack_require__(1999);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19_app_core_utils_flatten__ = __webpack_require__(2000);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20_app_core_utils_ticks__ = __webpack_require__(696);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21_app_core_services_impression_srv__ = __webpack_require__(200);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__built_in_plugins__ = __webpack_require__(2077);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23_d3__ = __webpack_require__(695);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24_rxjs_Observable__ = __webpack_require__(690);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24_rxjs_Observable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_24_rxjs_Observable__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25_rxjs_Subject__ = __webpack_require__(2172);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25_rxjs_Subject___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_25_rxjs_Subject__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26_rxjs_add_observable_empty__ = __webpack_require__(2175);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26_rxjs_add_observable_empty___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_26_rxjs_add_observable_empty__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27_rxjs_add_observable_from__ = __webpack_require__(2177);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27_rxjs_add_observable_from___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_27_rxjs_add_observable_from__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28_rxjs_add_operator_map__ = __webpack_require__(2186);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28_rxjs_add_operator_map___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_28_rxjs_add_operator_map__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29_rxjs_add_operator_combineAll__ = __webpack_require__(2189);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29_rxjs_add_operator_combineAll___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_29_rxjs_add_operator_combineAll__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30_vendor_flot_jquery_flot__ = __webpack_require__(1985);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30_vendor_flot_jquery_flot___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_30_vendor_flot_jquery_flot__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31_vendor_flot_jquery_flot_selection__ = __webpack_require__(2007);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31_vendor_flot_jquery_flot_selection___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_31_vendor_flot_jquery_flot_selection__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32_vendor_flot_jquery_flot_time__ = __webpack_require__(1989);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32_vendor_flot_jquery_flot_time___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_32_vendor_flot_jquery_flot_time__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33_vendor_flot_jquery_flot_stack__ = __webpack_require__(2008);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33_vendor_flot_jquery_flot_stack___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_33_vendor_flot_jquery_flot_stack__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34_vendor_flot_jquery_flot_pie__ = __webpack_require__(2196);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34_vendor_flot_jquery_flot_pie___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_34_vendor_flot_jquery_flot_pie__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35_vendor_flot_jquery_flot_stackpercent__ = __webpack_require__(2009);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35_vendor_flot_jquery_flot_stackpercent___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_35_vendor_flot_jquery_flot_stackpercent__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36_vendor_flot_jquery_flot_fillbelow__ = __webpack_require__(2010);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36_vendor_flot_jquery_flot_fillbelow___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_36_vendor_flot_jquery_flot_fillbelow__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37_vendor_flot_jquery_flot_crosshair__ = __webpack_require__(2011);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37_vendor_flot_jquery_flot_crosshair___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_37_vendor_flot_jquery_flot_crosshair__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38_vendor_flot_jquery_flot_dashes__ = __webpack_require__(2012);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38_vendor_flot_jquery_flot_dashes___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_38_vendor_flot_jquery_flot_dashes__);\n\n\n\n\n\n\n\n// Experimental module exports\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// rxjs\n\n\n// these imports add functions to Observable\n\n\n\n\n// add cache busting\nvar bust = \"?_cache=\" + Date.now();\nfunction locate(load) {\n return load.address + bust;\n}\n__WEBPACK_IMPORTED_MODULE_0_systemjs_dist_system_js___default.a.registry.set('plugin-loader', __WEBPACK_IMPORTED_MODULE_0_systemjs_dist_system_js___default.a.newModule({ locate: locate }));\n__WEBPACK_IMPORTED_MODULE_0_systemjs_dist_system_js___default.a.config({\n baseURL: 'public',\n defaultExtension: 'js',\n packages: {\n plugins: {\n defaultExtension: 'js',\n },\n },\n map: {\n text: 'vendor/plugin-text/text.js',\n css: 'vendor/plugin-css/css.js',\n },\n meta: {\n 'plugin*': {\n esModule: true,\n authorization: true,\n loader: 'plugin-loader',\n },\n },\n});\nfunction exposeToPlugin(name, component) {\n __WEBPACK_IMPORTED_MODULE_0_systemjs_dist_system_js___default.a.registerDynamic(name, [], true, function (require, exports, module) {\n module.exports = component;\n });\n}\nexposeToPlugin('lodash', __WEBPACK_IMPORTED_MODULE_1_lodash___default.a);\nexposeToPlugin('moment', __WEBPACK_IMPORTED_MODULE_4_moment___default.a);\nexposeToPlugin('jquery', __WEBPACK_IMPORTED_MODULE_6_jquery___default.a);\nexposeToPlugin('angular', __WEBPACK_IMPORTED_MODULE_5_angular___default.a);\nexposeToPlugin('d3', __WEBPACK_IMPORTED_MODULE_23_d3__);\nexposeToPlugin('rxjs/Subject', __WEBPACK_IMPORTED_MODULE_25_rxjs_Subject__[\"Subject\"]);\nexposeToPlugin('rxjs/Observable', __WEBPACK_IMPORTED_MODULE_24_rxjs_Observable__[\"Observable\"]);\n// Experimental modules\nexposeToPlugin('prismjs', __WEBPACK_IMPORTED_MODULE_7_prismjs___default.a);\nexposeToPlugin('slate', __WEBPACK_IMPORTED_MODULE_8_slate__[\"default\"]);\nexposeToPlugin('slate-react', __WEBPACK_IMPORTED_MODULE_9_slate_react__[\"default\"]);\nexposeToPlugin('slate-plain-serializer', __WEBPACK_IMPORTED_MODULE_10_slate_plain_serializer__[\"default\"]);\nexposeToPlugin('react', __WEBPACK_IMPORTED_MODULE_11_react___default.a);\nexposeToPlugin('react-dom', __WEBPACK_IMPORTED_MODULE_12_react_dom___default.a);\n// backward compatible path\nexposeToPlugin('vendor/npm/rxjs/Rx', {\n Subject: __WEBPACK_IMPORTED_MODULE_25_rxjs_Subject__[\"Subject\"],\n Observable: __WEBPACK_IMPORTED_MODULE_24_rxjs_Observable__[\"Observable\"],\n});\nexposeToPlugin('app/features/dashboard/impression_store', {\n impressions: __WEBPACK_IMPORTED_MODULE_21_app_core_services_impression_srv__[\"a\" /* default */],\n __esModule: true,\n});\nexposeToPlugin('app/plugins/sdk', __WEBPACK_IMPORTED_MODULE_2_app_plugins_sdk__);\nexposeToPlugin('app/core/utils/datemath', __WEBPACK_IMPORTED_MODULE_17_app_core_utils_datemath__);\nexposeToPlugin('app/core/utils/file_export', __WEBPACK_IMPORTED_MODULE_18_app_core_utils_file_export__);\nexposeToPlugin('app/core/utils/flatten', __WEBPACK_IMPORTED_MODULE_19_app_core_utils_flatten__);\nexposeToPlugin('app/core/utils/kbn', __WEBPACK_IMPORTED_MODULE_3_app_core_utils_kbn__[\"a\" /* default */]);\nexposeToPlugin('app/core/utils/ticks', __WEBPACK_IMPORTED_MODULE_20_app_core_utils_ticks__);\nexposeToPlugin('app/core/config', __WEBPACK_IMPORTED_MODULE_13_app_core_config__[\"a\" /* default */]);\nexposeToPlugin('app/core/time_series', __WEBPACK_IMPORTED_MODULE_14_app_core_time_series2__[\"a\" /* default */]);\nexposeToPlugin('app/core/time_series2', __WEBPACK_IMPORTED_MODULE_14_app_core_time_series2__[\"a\" /* default */]);\nexposeToPlugin('app/core/table_model', __WEBPACK_IMPORTED_MODULE_15_app_core_table_model__[\"a\" /* default */]);\nexposeToPlugin('app/core/app_events', __WEBPACK_IMPORTED_MODULE_16_app_core_core__[\"b\" /* appEvents */]);\nexposeToPlugin('app/core/core_module', __WEBPACK_IMPORTED_MODULE_16_app_core_core__[\"d\" /* coreModule */]);\nexposeToPlugin('app/core/core', {\n coreModule: __WEBPACK_IMPORTED_MODULE_16_app_core_core__[\"d\" /* coreModule */],\n appEvents: __WEBPACK_IMPORTED_MODULE_16_app_core_core__[\"b\" /* appEvents */],\n contextSrv: __WEBPACK_IMPORTED_MODULE_16_app_core_core__[\"c\" /* contextSrv */],\n __esModule: true,\n});\n\n\n\n\n\n\n\n\n\nvar flotDeps = [\n 'jquery.flot',\n 'jquery.flot.pie',\n 'jquery.flot.time',\n 'jquery.flot.fillbelow',\n 'jquery.flot.crosshair',\n 'jquery.flot.stack',\n 'jquery.flot.selection',\n 'jquery.flot.stackpercent',\n 'jquery.flot.events',\n];\nfor (var _i = 0, flotDeps_1 = flotDeps; _i < flotDeps_1.length; _i++) {\n var flotDep = flotDeps_1[_i];\n exposeToPlugin(flotDep, { fakeDep: 1 });\n}\nfunction importPluginModule(path) {\n var builtIn = __WEBPACK_IMPORTED_MODULE_22__built_in_plugins__[\"a\" /* default */][path];\n if (builtIn) {\n return Promise.resolve(builtIn);\n }\n return __WEBPACK_IMPORTED_MODULE_0_systemjs_dist_system_js___default.a.import(path);\n}\nfunction loadPluginCss(options) {\n if (__WEBPACK_IMPORTED_MODULE_13_app_core_config__[\"a\" /* default */].bootData.user.lightTheme) {\n __WEBPACK_IMPORTED_MODULE_0_systemjs_dist_system_js___default.a.import(options.light + '!css');\n }\n else {\n __WEBPACK_IMPORTED_MODULE_0_systemjs_dist_system_js___default.a.import(options.dark + '!css');\n }\n}\n\n\n/***/ }),\n\n/***/ 1991:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"c\", function() { return convertToHeatMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"e\", function() { return histogramToHeatmap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return convertToCards; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"f\", function() { return mergeZeroBuckets; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"d\", function() { return getValueBucketBound; });\n/* unused harmony export isHeatmapDataEqual */\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return calculateBucketSize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"g\", function() { return sortSeriesByLabel; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n\nvar VALUE_INDEX = 0;\nvar TIME_INDEX = 1;\n/**\n * Convert histogram represented by the list of series to heatmap object.\n * @param seriesList List of time series\n */\nfunction histogramToHeatmap(seriesList) {\n var heatmap = {};\n for (var i = 0; i < seriesList.length; i++) {\n var series = seriesList[i];\n var bound = i;\n if (isNaN(bound)) {\n return heatmap;\n }\n for (var _i = 0, _a = series.datapoints; _i < _a.length; _i++) {\n var point = _a[_i];\n var count = point[VALUE_INDEX];\n var time = point[TIME_INDEX];\n if (!__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isNumber(count)) {\n continue;\n }\n var bucket = heatmap[time];\n if (!bucket) {\n bucket = heatmap[time] = { x: time, buckets: {} };\n }\n bucket.buckets[bound] = {\n y: bound,\n count: count,\n bounds: {\n top: null,\n bottom: bound,\n },\n values: [],\n points: [],\n };\n }\n }\n return heatmap;\n}\n/**\n * Sort series representing histogram by label value.\n */\nfunction sortSeriesByLabel(s1, s2) {\n var label1, label2;\n try {\n // fail if not integer. might happen with bad queries\n label1 = parseHistogramLabel(s1.label);\n label2 = parseHistogramLabel(s2.label);\n }\n catch (err) {\n console.log(err.message || err);\n return 0;\n }\n if (label1 > label2) {\n return 1;\n }\n if (label1 < label2) {\n return -1;\n }\n return 0;\n}\nfunction parseHistogramLabel(label) {\n if (label === '+Inf' || label === 'inf') {\n return +Infinity;\n }\n var value = Number(label);\n if (isNaN(value)) {\n throw new Error(\"Error parsing histogram label: \" + label + \" is not a number\");\n }\n return value;\n}\n/**\n * Convert buckets into linear array of \"cards\" - objects, represented heatmap elements.\n * @param {Object} buckets\n * @return {Array} Array of \"card\" objects\n */\nfunction convertToCards(buckets) {\n var min = 0, max = 0;\n var cards = [];\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.forEach(buckets, function (xBucket) {\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.forEach(xBucket.buckets, function (yBucket) {\n var card = {\n x: xBucket.x,\n y: yBucket.y,\n yBounds: yBucket.bounds,\n values: yBucket.values,\n count: yBucket.count,\n };\n cards.push(card);\n if (cards.length === 1) {\n min = yBucket.count;\n max = yBucket.count;\n }\n min = yBucket.count < min ? yBucket.count : min;\n max = yBucket.count > max ? yBucket.count : max;\n });\n });\n var cardStats = { min: min, max: max };\n return { cards: cards, cardStats: cardStats };\n}\n/**\n * Special method for log scales. When series converted into buckets with log scale,\n * for simplification, 0 values are converted into 0, not into -Infinity. On the other hand, we mean\n * that all values less than series minimum, is 0 values, and we create special \"minimum\" bucket for\n * that values (actually, there're no values less than minimum, so this bucket is empty).\n * 8-16| | ** | | * | **|\n * 4-8| * |* *|* |** *| * |\n * 2-4| * *| | ***| |* |\n * 1-2|* | | | | | This bucket contains minimum series value\n * 0.5-1|____|____|____|____|____| This bucket should be displayed as 0 on graph\n * 0|____|____|____|____|____| This bucket is for 0 values (should actually be -Infinity)\n * So we should merge two bottom buckets into one (0-value bucket).\n *\n * @param {Object} buckets Heatmap buckets\n * @param {Number} minValue Minimum series value\n * @return {Object} Transformed buckets\n */\nfunction mergeZeroBuckets(buckets, minValue) {\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.forEach(buckets, function (xBucket) {\n var yBuckets = xBucket.buckets;\n var emptyBucket = {\n bounds: { bottom: 0, top: 0 },\n values: [],\n points: [],\n count: 0,\n };\n var nullBucket = yBuckets[0] || emptyBucket;\n var minBucket = yBuckets[minValue] || emptyBucket;\n var newBucket = {\n y: 0,\n bounds: { bottom: minValue, top: minBucket.bounds.top || minValue },\n values: [],\n points: [],\n count: 0,\n };\n newBucket.points = nullBucket.points.concat(minBucket.points);\n newBucket.values = nullBucket.values.concat(minBucket.values);\n newBucket.count = newBucket.values.length;\n if (newBucket.count === 0) {\n return;\n }\n delete yBuckets[minValue];\n yBuckets[0] = newBucket;\n });\n return buckets;\n}\n/**\n * Convert set of time series into heatmap buckets\n * @return {Object} Heatmap object:\n * {\n * xBucketBound_1: {\n * x: xBucketBound_1,\n * buckets: {\n * yBucketBound_1: {\n * y: yBucketBound_1,\n * bounds: {bottom, top}\n * values: [val_1, val_2, ..., val_K],\n * points: [[val_Y, val_X, series_name], ..., [...]],\n * seriesStat: {seriesName_1: val_1, seriesName_2: val_2}\n * },\n * ...\n * yBucketBound_M: {}\n * },\n * values: [val_1, val_2, ..., val_K],\n * points: [\n * [val_Y, val_X, series_name], (point_1)\n * ...\n * [...] (point_K)\n * ]\n * },\n * xBucketBound_2: {},\n * ...\n * xBucketBound_N: {}\n * }\n */\nfunction convertToHeatMap(seriesList, yBucketSize, xBucketSize, logBase) {\n if (logBase === void 0) { logBase = 1; }\n var heatmap = {};\n var _loop_1 = function (series) {\n var datapoints = series.datapoints;\n var seriesName = series.label;\n // Slice series into X axis buckets\n // | | ** | | * | **|\n // | * |* *|* |** *| * |\n // |** *| | ***| |* |\n // |____|____|____|____|____|_\n //\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.forEach(datapoints, function (point) {\n var bucketBound = getBucketBound(point[TIME_INDEX], xBucketSize);\n pushToXBuckets(heatmap, point, bucketBound, seriesName);\n });\n };\n for (var _i = 0, seriesList_1 = seriesList; _i < seriesList_1.length; _i++) {\n var series = seriesList_1[_i];\n _loop_1(series);\n }\n // Slice X axis buckets into Y (value) buckets\n // | **| |2|,\n // | * | --\\ |1|,\n // |* | --/ |1|,\n // |____| |0|\n //\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.forEach(heatmap, function (xBucket) {\n if (logBase !== 1) {\n xBucket.buckets = convertToLogScaleValueBuckets(xBucket, yBucketSize, logBase);\n }\n else {\n xBucket.buckets = convertToValueBuckets(xBucket, yBucketSize);\n }\n });\n return heatmap;\n}\nfunction pushToXBuckets(buckets, point, bucketNum, seriesName) {\n var value = point[VALUE_INDEX];\n if (value === null || value === undefined || isNaN(value)) {\n return;\n }\n // Add series name to point for future identification\n var point_ext = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.concat(point, seriesName);\n if (buckets[bucketNum] && buckets[bucketNum].values) {\n buckets[bucketNum].values.push(value);\n buckets[bucketNum].points.push(point_ext);\n }\n else {\n buckets[bucketNum] = {\n x: bucketNum,\n values: [value],\n points: [point_ext],\n };\n }\n}\nfunction pushToYBuckets(buckets, bucketNum, value, point, bounds) {\n var count = 1;\n // Use the 3rd argument as scale/count\n if (point.length > 3) {\n count = parseInt(point[2]);\n }\n if (buckets[bucketNum]) {\n buckets[bucketNum].values.push(value);\n buckets[bucketNum].points.push(point);\n buckets[bucketNum].count += count;\n }\n else {\n buckets[bucketNum] = {\n y: bucketNum,\n bounds: bounds,\n values: [value],\n points: [point],\n count: count,\n };\n }\n}\nfunction getValueBucketBound(value, yBucketSize, logBase) {\n if (logBase === 1) {\n return getBucketBound(value, yBucketSize);\n }\n else {\n return getLogScaleBucketBound(value, yBucketSize, logBase);\n }\n}\n/**\n * Find bucket for given value (for linear scale)\n */\nfunction getBucketBounds(value, bucketSize) {\n var bottom, top;\n bottom = Math.floor(value / bucketSize) * bucketSize;\n top = (Math.floor(value / bucketSize) + 1) * bucketSize;\n return { bottom: bottom, top: top };\n}\nfunction getBucketBound(value, bucketSize) {\n var bounds = getBucketBounds(value, bucketSize);\n return bounds.bottom;\n}\nfunction convertToValueBuckets(xBucket, bucketSize) {\n var values = xBucket.values;\n var points = xBucket.points;\n var buckets = {};\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.forEach(values, function (val, index) {\n var bounds = getBucketBounds(val, bucketSize);\n var bucketNum = bounds.bottom;\n pushToYBuckets(buckets, bucketNum, val, points[index], bounds);\n });\n return buckets;\n}\n/**\n * Find bucket for given value (for log scales)\n */\nfunction getLogScaleBucketBounds(value, yBucketSplitFactor, logBase) {\n var top, bottom;\n if (value === 0) {\n return { bottom: 0, top: 0 };\n }\n var value_log = logp(value, logBase);\n var pow, powTop;\n if (yBucketSplitFactor === 1 || !yBucketSplitFactor) {\n pow = Math.floor(value_log);\n powTop = pow + 1;\n }\n else {\n var additional_bucket_size = 1 / yBucketSplitFactor;\n var additional_log = value_log - Math.floor(value_log);\n additional_log = Math.floor(additional_log / additional_bucket_size) * additional_bucket_size;\n pow = Math.floor(value_log) + additional_log;\n powTop = pow + additional_bucket_size;\n }\n bottom = Math.pow(logBase, pow);\n top = Math.pow(logBase, powTop);\n return { bottom: bottom, top: top };\n}\nfunction getLogScaleBucketBound(value, yBucketSplitFactor, logBase) {\n var bounds = getLogScaleBucketBounds(value, yBucketSplitFactor, logBase);\n return bounds.bottom;\n}\nfunction convertToLogScaleValueBuckets(xBucket, yBucketSplitFactor, logBase) {\n var values = xBucket.values;\n var points = xBucket.points;\n var buckets = {};\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.forEach(values, function (val, index) {\n var bounds = getLogScaleBucketBounds(val, yBucketSplitFactor, logBase);\n var bucketNum = bounds.bottom;\n pushToYBuckets(buckets, bucketNum, val, points[index], bounds);\n });\n return buckets;\n}\n/**\n * Logarithm for custom base\n * @param value\n * @param base logarithm base\n */\nfunction logp(value, base) {\n return Math.log(value) / Math.log(base);\n}\n/**\n * Calculate size of Y bucket from given buckets bounds.\n * @param bounds Array of Y buckets bounds\n * @param logBase Logarithm base\n */\nfunction calculateBucketSize(bounds, logBase) {\n if (logBase === void 0) { logBase = 1; }\n var bucketSize = Infinity;\n if (bounds.length === 0) {\n return 0;\n }\n else if (bounds.length === 1) {\n return bounds[0];\n }\n else {\n bounds = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.sortBy(bounds);\n for (var i = 1; i < bounds.length; i++) {\n var distance = getDistance(bounds[i], bounds[i - 1], logBase);\n bucketSize = distance < bucketSize ? distance : bucketSize;\n }\n }\n return bucketSize;\n}\n/**\n * Calculate distance between two numbers in given scale (linear or logarithmic).\n * @param a\n * @param b\n * @param logBase\n */\nfunction getDistance(a, b, logBase) {\n if (logBase === void 0) { logBase = 1; }\n if (logBase === 1) {\n // Linear distance\n return Math.abs(b - a);\n }\n else {\n // logarithmic distance\n var ratio = Math.max(a, b) / Math.min(a, b);\n return logp(ratio, logBase);\n }\n}\n/**\n * Compare two heatmap data objects\n * @param objA\n * @param objB\n */\nfunction isHeatmapDataEqual(objA, objB) {\n var is_eql = !emptyXOR(objA, objB);\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.forEach(objA, function (xBucket, x) {\n if (objB[x]) {\n if (emptyXOR(xBucket.buckets, objB[x].buckets)) {\n is_eql = false;\n return false;\n }\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.forEach(xBucket.buckets, function (yBucket, y) {\n if (objB[x].buckets && objB[x].buckets[y]) {\n if (objB[x].buckets[y].values) {\n is_eql = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isEqual(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.sortBy(yBucket.values), __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.sortBy(objB[x].buckets[y].values));\n if (!is_eql) {\n return false;\n }\n else {\n return true;\n }\n }\n else {\n is_eql = false;\n return false;\n }\n }\n else {\n is_eql = false;\n return false;\n }\n });\n if (!is_eql) {\n return false;\n }\n else {\n return true;\n }\n }\n else {\n is_eql = false;\n return false;\n }\n });\n return is_eql;\n}\nfunction emptyXOR(foo, bar) {\n return (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isEmpty(foo) || __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isEmpty(bar)) && !(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isEmpty(foo) && __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isEmpty(bar));\n}\n\n\n\n/***/ }),\n\n/***/ 1992:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Observable_1 = __webpack_require__(690);\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar EmptyObservable = (function (_super) {\n __extends(EmptyObservable, _super);\n function EmptyObservable(scheduler) {\n _super.call(this);\n this.scheduler = scheduler;\n }\n /**\n * Creates an Observable that emits no items to the Observer and immediately\n * emits a complete notification.\n *\n * Just emits 'complete', and nothing else.\n * \n *\n * \n *\n * This static operator is useful for creating a simple Observable that only\n * emits the complete notification. It can be used for composing with other\n * Observables, such as in a {@link mergeMap}.\n *\n * @example Emit the number 7, then complete.\n * var result = Rx.Observable.empty().startWith(7);\n * result.subscribe(x => console.log(x));\n *\n * @example Map and flatten only odd numbers to the sequence 'a', 'b', 'c'\n * var interval = Rx.Observable.interval(1000);\n * var result = interval.mergeMap(x =>\n * x % 2 === 1 ? Rx.Observable.of('a', 'b', 'c') : Rx.Observable.empty()\n * );\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following to the console:\n * // x is equal to the count on the interval eg(0,1,2,3,...)\n * // x will occur every 1000ms\n * // if x % 2 is equal to 1 print abc\n * // if x % 2 is not equal to 1 nothing will be output\n *\n * @see {@link create}\n * @see {@link never}\n * @see {@link of}\n * @see {@link throw}\n *\n * @param {Scheduler} [scheduler] A {@link IScheduler} to use for scheduling\n * the emission of the complete notification.\n * @return {Observable} An \"empty\" Observable: emits only the complete\n * notification.\n * @static true\n * @name empty\n * @owner Observable\n */\n EmptyObservable.create = function (scheduler) {\n return new EmptyObservable(scheduler);\n };\n EmptyObservable.dispatch = function (arg) {\n var subscriber = arg.subscriber;\n subscriber.complete();\n };\n /** @deprecated internal use only */ EmptyObservable.prototype._subscribe = function (subscriber) {\n var scheduler = this.scheduler;\n if (scheduler) {\n return scheduler.schedule(EmptyObservable.dispatch, 0, { subscriber: subscriber });\n }\n else {\n subscriber.complete();\n }\n };\n return EmptyObservable;\n}(Observable_1.Observable));\nexports.EmptyObservable = EmptyObservable;\n//# sourceMappingURL=EmptyObservable.js.map\n\n/***/ }),\n\n/***/ 1993:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar root_1 = __webpack_require__(199);\nfunction symbolIteratorPonyfill(root) {\n var Symbol = root.Symbol;\n if (typeof Symbol === 'function') {\n if (!Symbol.iterator) {\n Symbol.iterator = Symbol('iterator polyfill');\n }\n return Symbol.iterator;\n }\n else {\n // [for Mozilla Gecko 27-35:](https://mzl.la/2ewE1zC)\n var Set_1 = root.Set;\n if (Set_1 && typeof new Set_1()['@@iterator'] === 'function') {\n return '@@iterator';\n }\n var Map_1 = root.Map;\n // required for compatability with es6-shim\n if (Map_1) {\n var keys = Object.getOwnPropertyNames(Map_1.prototype);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n // according to spec, Map.prototype[@@iterator] and Map.orototype.entries must be equal.\n if (key !== 'entries' && key !== 'size' && Map_1.prototype[key] === Map_1.prototype['entries']) {\n return key;\n }\n }\n }\n return '@@iterator';\n }\n}\nexports.symbolIteratorPonyfill = symbolIteratorPonyfill;\nexports.iterator = symbolIteratorPonyfill(root_1.root);\n/**\n * @deprecated use iterator instead\n */\nexports.$$iterator = exports.iterator;\n//# sourceMappingURL=iterator.js.map\n\n/***/ }),\n\n/***/ 1994:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export LinkSrv */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_utils_kbn__ = __webpack_require__(312);\n\n\n\nvar LinkSrv = /** @class */ (function () {\n /** @ngInject */\n LinkSrv.$inject = [\"templateSrv\", \"timeSrv\"];\n function LinkSrv(templateSrv, timeSrv) {\n this.templateSrv = templateSrv;\n this.timeSrv = timeSrv;\n }\n LinkSrv.prototype.getLinkUrl = function (link) {\n var url = this.templateSrv.replace(link.url || '');\n var params = {};\n if (link.keepTime) {\n var range = this.timeSrv.timeRangeForUrl();\n params['from'] = range.from;\n params['to'] = range.to;\n }\n if (link.includeVars) {\n this.templateSrv.fillVariableValuesForUrl(params);\n }\n return this.addParamsToUrl(url, params);\n };\n LinkSrv.prototype.addParamsToUrl = function (url, params) {\n var paramsArray = [];\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(params, function (value, key) {\n if (value === null) {\n return;\n }\n if (value === true) {\n paramsArray.push(key);\n }\n else if (__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isArray(value)) {\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(value, function (instance) {\n paramsArray.push(key + '=' + encodeURIComponent(instance));\n });\n }\n else {\n paramsArray.push(key + '=' + encodeURIComponent(value));\n }\n });\n if (paramsArray.length === 0) {\n return url;\n }\n return this.appendToQueryString(url, paramsArray.join('&'));\n };\n LinkSrv.prototype.appendToQueryString = function (url, stringToAppend) {\n if (!__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isUndefined(stringToAppend) && stringToAppend !== null && stringToAppend !== '') {\n var pos = url.indexOf('?');\n if (pos !== -1) {\n if (url.length - pos > 1) {\n url += '&';\n }\n }\n else {\n url += '?';\n }\n url += stringToAppend;\n }\n return url;\n };\n LinkSrv.prototype.getAnchorInfo = function (link) {\n var info = {};\n info.href = this.getLinkUrl(link);\n info.title = this.templateSrv.replace(link.title || '');\n return info;\n };\n LinkSrv.prototype.getPanelLinkAnchorInfo = function (link, scopedVars) {\n var info = {};\n if (link.type === 'absolute') {\n info.target = link.targetBlank ? '_blank' : '_self';\n info.href = this.templateSrv.replace(link.url || '', scopedVars);\n info.title = this.templateSrv.replace(link.title || '', scopedVars);\n }\n else if (link.dashUri) {\n info.href = 'dashboard/' + link.dashUri + '?';\n info.title = this.templateSrv.replace(link.title || '', scopedVars);\n info.target = link.targetBlank ? '_blank' : '';\n }\n else {\n info.title = this.templateSrv.replace(link.title || '', scopedVars);\n var slug = __WEBPACK_IMPORTED_MODULE_2_app_core_utils_kbn__[\"a\" /* default */].slugifyForUrl(link.dashboard || '');\n info.href = 'dashboard/db/' + slug + '?';\n }\n var params = {};\n if (link.keepTime) {\n var range = this.timeSrv.timeRangeForUrl();\n params['from'] = range.from;\n params['to'] = range.to;\n }\n if (link.includeVars) {\n this.templateSrv.fillVariableValuesForUrl(params, scopedVars);\n }\n info.href = this.addParamsToUrl(info.href, params);\n if (link.params) {\n info.href = this.appendToQueryString(info.href, this.templateSrv.replace(link.params, scopedVars));\n }\n return info;\n };\n return LinkSrv;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.services').service('linkSrv', LinkSrv);\n\n\n/***/ }),\n\n/***/ 1995:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__annotations_srv__ = __webpack_require__(2043);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__event_editor__ = __webpack_require__(2046);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__event_manager__ = __webpack_require__(2047);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__event__ = __webpack_require__(1996);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__annotation_tooltip__ = __webpack_require__(2048);\n/* unused harmony reexport AnnotationsSrv */\n/* unused harmony reexport eventEditor */\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return __WEBPACK_IMPORTED_MODULE_2__event_manager__[\"a\"]; });\n/* unused harmony reexport AnnotationEvent */\n/* unused harmony reexport annotationTooltipDirective */\n\n\n\n\n\n\n\n\n/***/ }),\n\n/***/ 1996:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return AnnotationEvent; });\nvar AnnotationEvent = /** @class */ (function () {\n function AnnotationEvent() {\n }\n return AnnotationEvent;\n}());\n\n\n\n/***/ }),\n\n/***/ 1997:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export TemplateSrv */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_utils_kbn__ = __webpack_require__(312);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n\n\nfunction luceneEscape(value) {\n return value.replace(/([\\!\\*\\+\\-\\=<>\\s\\&\\|\\(\\)\\[\\]\\{\\}\\^\\~\\?\\:\\\\/\"])/g, '\\\\$1');\n}\nvar TemplateSrv = /** @class */ (function () {\n function TemplateSrv() {\n /*\n * This regex matches 3 types of variable reference with an optional format specifier\n * \\$(\\w+) $var1\n * \\[\\[([\\s\\S]+?)(?::(\\w+))?\\]\\] [[var2]] or [[var2:fmt2]]\n * \\${(\\w+)(?::(\\w+))?} ${var3} or ${var3:fmt3}\n */\n this.regex = /\\$(\\w+)|\\[\\[([\\s\\S]+?)(?::(\\w+))?\\]\\]|\\${(\\w+)(?::(\\w+))?}/g;\n this.index = {};\n this.grafanaVariables = {};\n this.builtIns = {};\n this.builtIns['__interval'] = { text: '1s', value: '1s' };\n this.builtIns['__interval_ms'] = { text: '100', value: '100' };\n }\n TemplateSrv.prototype.init = function (variables) {\n this.variables = variables;\n this.updateTemplateData();\n };\n TemplateSrv.prototype.updateTemplateData = function () {\n this.index = {};\n for (var i = 0; i < this.variables.length; i++) {\n var variable = this.variables[i];\n if (!variable.current || (!variable.current.isNone && !variable.current.value)) {\n continue;\n }\n this.index[variable.name] = variable;\n }\n };\n TemplateSrv.prototype.variableInitialized = function (variable) {\n this.index[variable.name] = variable;\n };\n TemplateSrv.prototype.getAdhocFilters = function (datasourceName) {\n var filters = [];\n for (var i = 0; i < this.variables.length; i++) {\n var variable = this.variables[i];\n if (variable.type !== 'adhoc') {\n continue;\n }\n if (variable.datasource === datasourceName) {\n filters = filters.concat(variable.filters);\n }\n if (variable.datasource.indexOf('$') === 0) {\n if (this.replace(variable.datasource) === datasourceName) {\n filters = filters.concat(variable.filters);\n }\n }\n }\n return filters;\n };\n TemplateSrv.prototype.luceneFormat = function (value) {\n if (typeof value === 'string') {\n return luceneEscape(value);\n }\n if (value instanceof Array && value.length === 0) {\n return '__empty__';\n }\n var quotedValues = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(value, function (val) {\n return '\"' + luceneEscape(val) + '\"';\n });\n return '(' + quotedValues.join(' OR ') + ')';\n };\n TemplateSrv.prototype.formatValue = function (value, format, variable) {\n // for some scopedVars there is no variable\n variable = variable || {};\n if (typeof format === 'function') {\n return format(value, variable, this.formatValue);\n }\n switch (format) {\n case 'regex': {\n if (typeof value === 'string') {\n return __WEBPACK_IMPORTED_MODULE_0_app_core_utils_kbn__[\"a\" /* default */].regexEscape(value);\n }\n var escapedValues = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(value, __WEBPACK_IMPORTED_MODULE_0_app_core_utils_kbn__[\"a\" /* default */].regexEscape);\n if (escapedValues.length === 1) {\n return escapedValues[0];\n }\n return '(' + escapedValues.join('|') + ')';\n }\n case 'lucene': {\n return this.luceneFormat(value);\n }\n case 'pipe': {\n if (typeof value === 'string') {\n return value;\n }\n return value.join('|');\n }\n case 'distributed': {\n if (typeof value === 'string') {\n return value;\n }\n return this.distributeVariable(value, variable.name);\n }\n case 'csv': {\n if (__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isArray(value)) {\n return value.join(',');\n }\n return value;\n }\n default: {\n if (__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isArray(value)) {\n return '{' + value.join(',') + '}';\n }\n return value;\n }\n }\n };\n TemplateSrv.prototype.setGrafanaVariable = function (name, value) {\n this.grafanaVariables[name] = value;\n };\n TemplateSrv.prototype.getVariableName = function (expression) {\n this.regex.lastIndex = 0;\n var match = this.regex.exec(expression);\n if (!match) {\n return null;\n }\n return match[1] || match[2];\n };\n TemplateSrv.prototype.variableExists = function (expression) {\n var name = this.getVariableName(expression);\n return name && this.index[name] !== void 0;\n };\n TemplateSrv.prototype.highlightVariablesAsHtml = function (str) {\n var _this = this;\n if (!str || !__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isString(str)) {\n return str;\n }\n str = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.escape(str);\n this.regex.lastIndex = 0;\n return str.replace(this.regex, function (match, var1, var2, fmt2, var3) {\n if (_this.index[var1 || var2 || var3] || _this.builtIns[var1 || var2 || var3]) {\n return '' + match + '';\n }\n return match;\n });\n };\n TemplateSrv.prototype.getAllValue = function (variable) {\n if (variable.allValue) {\n return variable.allValue;\n }\n var values = [];\n for (var i = 1; i < variable.options.length; i++) {\n values.push(variable.options[i].value);\n }\n return values;\n };\n TemplateSrv.prototype.replace = function (target, scopedVars, format) {\n var _this = this;\n if (!target) {\n return target;\n }\n var variable, systemValue, value, fmt;\n this.regex.lastIndex = 0;\n return target.replace(this.regex, function (match, var1, var2, fmt2, var3, fmt3) {\n variable = _this.index[var1 || var2 || var3];\n fmt = fmt2 || fmt3 || format;\n if (scopedVars) {\n value = scopedVars[var1 || var2 || var3];\n if (value) {\n return _this.formatValue(value.value, fmt, variable);\n }\n }\n if (!variable) {\n return match;\n }\n systemValue = _this.grafanaVariables[variable.current.value];\n if (systemValue) {\n return _this.formatValue(systemValue, fmt, variable);\n }\n value = variable.current.value;\n if (_this.isAllValue(value)) {\n value = _this.getAllValue(variable);\n // skip formatting of custom all values\n if (variable.allValue) {\n return value;\n }\n }\n var res = _this.formatValue(value, fmt, variable);\n return res;\n });\n };\n TemplateSrv.prototype.isAllValue = function (value) {\n return value === '$__all' || (Array.isArray(value) && value[0] === '$__all');\n };\n TemplateSrv.prototype.replaceWithText = function (target, scopedVars) {\n var _this = this;\n if (!target) {\n return target;\n }\n var variable;\n this.regex.lastIndex = 0;\n return target.replace(this.regex, function (match, var1, var2, fmt2, var3) {\n if (scopedVars) {\n var option = scopedVars[var1 || var2 || var3];\n if (option) {\n return option.text;\n }\n }\n variable = _this.index[var1 || var2 || var3];\n if (!variable) {\n return match;\n }\n return _this.grafanaVariables[variable.current.value] || variable.current.text;\n });\n };\n TemplateSrv.prototype.fillVariableValuesForUrl = function (params, scopedVars) {\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(this.variables, function (variable) {\n if (scopedVars && scopedVars[variable.name] !== void 0) {\n params['var-' + variable.name] = scopedVars[variable.name].value;\n }\n else {\n params['var-' + variable.name] = variable.getValueForUrl();\n }\n });\n };\n TemplateSrv.prototype.distributeVariable = function (value, variable) {\n value = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(value, function (val, index) {\n if (index !== 0) {\n return variable + '=' + val;\n }\n else {\n return val;\n }\n });\n return value.join(',');\n };\n return TemplateSrv;\n}());\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (new TemplateSrv());\n\n\n/***/ }),\n\n/***/ 1998:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return QueryCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n\nvar QueryCtrl = /** @class */ (function () {\n function QueryCtrl($scope, $injector) {\n this.$scope = $scope;\n this.$injector = $injector;\n this.panel = this.panelCtrl.panel;\n this.isLastQuery = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.indexOf(this.panel.targets, this.target) === this.panel.targets.length - 1;\n }\n QueryCtrl.prototype.refresh = function () {\n this.panelCtrl.refresh();\n };\n return QueryCtrl;\n}());\n\n\n\n/***/ }),\n\n/***/ 1999:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (immutable) */ __webpack_exports__[\"convertSeriesListToCsv\"] = convertSeriesListToCsv;\n/* harmony export (immutable) */ __webpack_exports__[\"exportSeriesListToCsv\"] = exportSeriesListToCsv;\n/* harmony export (immutable) */ __webpack_exports__[\"convertSeriesListToCsvColumns\"] = convertSeriesListToCsvColumns;\n/* harmony export (immutable) */ __webpack_exports__[\"exportSeriesListToCsvColumns\"] = exportSeriesListToCsvColumns;\n/* harmony export (immutable) */ __webpack_exports__[\"convertTableDataToCsv\"] = convertTableDataToCsv;\n/* harmony export (immutable) */ __webpack_exports__[\"exportTableDataToCsv\"] = exportTableDataToCsv;\n/* harmony export (immutable) */ __webpack_exports__[\"saveSaveBlob\"] = saveSaveBlob;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_moment__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_moment__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_file_saver__ = __webpack_require__(314);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_file_saver___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_file_saver__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_util__ = __webpack_require__(2074);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_util___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_util__);\n\n\n\n\nvar DEFAULT_DATETIME_FORMAT = 'YYYY-MM-DDTHH:mm:ssZ';\nvar POINT_TIME_INDEX = 1;\nvar POINT_VALUE_INDEX = 0;\nvar END_COLUMN = ';';\nvar END_ROW = '\\r\\n';\nvar QUOTE = '\"';\nvar EXPORT_FILENAME = 'grafana_data_export.csv';\nfunction csvEscaped(text) {\n if (!text) {\n return text;\n }\n return text.split(QUOTE).join(QUOTE + QUOTE);\n}\nvar domParser = new DOMParser();\nfunction htmlDecoded(text) {\n if (!text) {\n return text;\n }\n var regexp = /&[^;]+;/g;\n function htmlDecoded(value) {\n var parsedDom = domParser.parseFromString(value, 'text/html');\n return parsedDom.body.textContent;\n }\n return text.replace(regexp, htmlDecoded).replace(regexp, htmlDecoded);\n}\nfunction formatSpecialHeader(useExcelHeader) {\n return useExcelHeader ? \"sep=\" + END_COLUMN + END_ROW : '';\n}\nfunction formatRow(row, addEndRowDelimiter) {\n if (addEndRowDelimiter === void 0) { addEndRowDelimiter = true; }\n var text = '';\n for (var i = 0; i < row.length; i += 1) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0_lodash__[\"isBoolean\"])(row[i]) || Object(__WEBPACK_IMPORTED_MODULE_3_util__[\"isNullOrUndefined\"])(row[i])) {\n text += row[i];\n }\n else if (Object(__WEBPACK_IMPORTED_MODULE_0_lodash__[\"isNumber\"])(row[i])) {\n text += row[i].toLocaleString();\n }\n else {\n text += \"\" + QUOTE + csvEscaped(Object(__WEBPACK_IMPORTED_MODULE_0_lodash__[\"unescape\"])(htmlDecoded(row[i]))) + QUOTE;\n }\n if (i < row.length - 1) {\n text += END_COLUMN;\n }\n }\n return addEndRowDelimiter ? text + END_ROW : text;\n}\nfunction convertSeriesListToCsv(seriesList, dateTimeFormat, excel) {\n if (dateTimeFormat === void 0) { dateTimeFormat = DEFAULT_DATETIME_FORMAT; }\n if (excel === void 0) { excel = false; }\n var text = formatSpecialHeader(excel) + formatRow(['Series', 'Time', 'Value']);\n for (var seriesIndex = 0; seriesIndex < seriesList.length; seriesIndex += 1) {\n for (var i = 0; i < seriesList[seriesIndex].datapoints.length; i += 1) {\n text += formatRow([\n seriesList[seriesIndex].alias,\n __WEBPACK_IMPORTED_MODULE_1_moment___default()(seriesList[seriesIndex].datapoints[i][POINT_TIME_INDEX]).format(dateTimeFormat),\n seriesList[seriesIndex].datapoints[i][POINT_VALUE_INDEX],\n ], i < seriesList[seriesIndex].datapoints.length - 1 || seriesIndex < seriesList.length - 1);\n }\n }\n return text;\n}\nfunction exportSeriesListToCsv(seriesList, dateTimeFormat, excel) {\n if (dateTimeFormat === void 0) { dateTimeFormat = DEFAULT_DATETIME_FORMAT; }\n if (excel === void 0) { excel = false; }\n var text = convertSeriesListToCsv(seriesList, dateTimeFormat, excel);\n saveSaveBlob(text, EXPORT_FILENAME);\n}\nfunction convertSeriesListToCsvColumns(seriesList, dateTimeFormat, excel) {\n if (dateTimeFormat === void 0) { dateTimeFormat = DEFAULT_DATETIME_FORMAT; }\n if (excel === void 0) { excel = false; }\n // add header\n var text = formatSpecialHeader(excel) +\n formatRow(['Time'].concat(seriesList.map(function (val) {\n return val.alias;\n })));\n // process data\n seriesList = mergeSeriesByTime(seriesList);\n var _loop_1 = function (i) {\n var timestamp = __WEBPACK_IMPORTED_MODULE_1_moment___default()(seriesList[0].datapoints[i][POINT_TIME_INDEX]).format(dateTimeFormat);\n text += formatRow([timestamp].concat(seriesList.map(function (series) {\n return series.datapoints[i][POINT_VALUE_INDEX];\n })), i < seriesList[0].datapoints.length - 1);\n };\n // make text\n for (var i = 0; i < seriesList[0].datapoints.length; i += 1) {\n _loop_1(i);\n }\n return text;\n}\n/**\n * Collect all unique timestamps from series list and use it to fill\n * missing points by null.\n */\nfunction mergeSeriesByTime(seriesList) {\n var timestamps = [];\n for (var i = 0; i < seriesList.length; i++) {\n var seriesPoints = seriesList[i].datapoints;\n for (var j = 0; j < seriesPoints.length; j++) {\n timestamps.push(seriesPoints[j][POINT_TIME_INDEX]);\n }\n }\n timestamps = Object(__WEBPACK_IMPORTED_MODULE_0_lodash__[\"sortedUniq\"])(timestamps.sort());\n for (var i = 0; i < seriesList.length; i++) {\n var seriesPoints = seriesList[i].datapoints;\n var seriesTimestamps = seriesPoints.map(function (p) { return p[POINT_TIME_INDEX]; });\n var extendedSeries = [];\n var pointIndex = void 0;\n for (var j = 0; j < timestamps.length; j++) {\n pointIndex = Object(__WEBPACK_IMPORTED_MODULE_0_lodash__[\"sortedIndexOf\"])(seriesTimestamps, timestamps[j]);\n if (pointIndex !== -1) {\n extendedSeries.push(seriesPoints[pointIndex]);\n }\n else {\n extendedSeries.push([null, timestamps[j]]);\n }\n }\n seriesList[i].datapoints = extendedSeries;\n }\n return seriesList;\n}\nfunction exportSeriesListToCsvColumns(seriesList, dateTimeFormat, excel) {\n if (dateTimeFormat === void 0) { dateTimeFormat = DEFAULT_DATETIME_FORMAT; }\n if (excel === void 0) { excel = false; }\n var text = convertSeriesListToCsvColumns(seriesList, dateTimeFormat, excel);\n saveSaveBlob(text, EXPORT_FILENAME);\n}\nfunction convertTableDataToCsv(table, excel) {\n if (excel === void 0) { excel = false; }\n var text = formatSpecialHeader(excel);\n // add headline\n text += formatRow(table.columns.map(function (val) { return val.title || val.text; }));\n // process data\n for (var i = 0; i < table.rows.length; i += 1) {\n text += formatRow(table.rows[i], i < table.rows.length - 1);\n }\n return text;\n}\nfunction exportTableDataToCsv(table, excel) {\n if (excel === void 0) { excel = false; }\n var text = convertTableDataToCsv(table, excel);\n saveSaveBlob(text, EXPORT_FILENAME);\n}\nfunction saveSaveBlob(payload, fname) {\n var blob = new Blob([payload], { type: 'text/csv;charset=utf-8;header=present;' });\n Object(__WEBPACK_IMPORTED_MODULE_2_file_saver__[\"saveAs\"])(blob, fname);\n}\n\n\n/***/ }),\n\n/***/ 2000:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (immutable) */ __webpack_exports__[\"default\"] = flatten;\n// Copyright (c) 2014, Hugh Kennedy\n// Based on code from https://github.com/hughsk/flat/blob/master/index.js\n//\nfunction flatten(target, opts) {\n opts = opts || {};\n var delimiter = opts.delimiter || '.';\n var maxDepth = opts.maxDepth || 3;\n var currentDepth = 1;\n var output = {};\n function step(object, prev) {\n Object.keys(object).forEach(function (key) {\n var value = object[key];\n var isarray = opts.safe && Array.isArray(value);\n var type = Object.prototype.toString.call(value);\n var isobject = type === '[object Object]';\n var newKey = prev ? prev + delimiter + key : key;\n if (!opts.maxDepth) {\n maxDepth = currentDepth + 1;\n }\n if (!isarray && isobject && Object.keys(value).length && currentDepth < maxDepth) {\n ++currentDepth;\n return step(value, newKey);\n }\n output[newKey] = value;\n });\n }\n step(target, null);\n return output;\n}\n\n\n/***/ }),\n\n/***/ 2001:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return SemVersion; });\n/* harmony export (immutable) */ __webpack_exports__[\"b\"] = isVersionGtOrEq;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n\nvar versionPattern = /^(\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))?(?:-([0-9A-Za-z\\.]+))?/;\nvar SemVersion = /** @class */ (function () {\n function SemVersion(version) {\n var match = versionPattern.exec(version);\n if (match) {\n this.major = Number(match[1]);\n this.minor = Number(match[2] || 0);\n this.patch = Number(match[3] || 0);\n this.meta = match[4];\n }\n }\n SemVersion.prototype.isGtOrEq = function (version) {\n var compared = new SemVersion(version);\n return !(this.major < compared.major || this.minor < compared.minor || this.patch < compared.patch);\n };\n SemVersion.prototype.isValid = function () {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isNumber(this.major);\n };\n return SemVersion;\n}());\n\nfunction isVersionGtOrEq(a, b) {\n var a_semver = new SemVersion(a);\n return a_semver.isGtOrEq(b);\n}\n\n\n/***/ }),\n\n/***/ 2002:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export CloudWatchQueryParameter */\n/* unused harmony export CloudWatchQueryParameterCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n\n\nvar CloudWatchQueryParameter = /** @class */ (function () {\n function CloudWatchQueryParameter() {\n return {\n templateUrl: 'public/app/plugins/datasource/cloudwatch/partials/query.parameter.html',\n controller: 'CloudWatchQueryParameterCtrl',\n restrict: 'E',\n scope: {\n target: '=',\n datasource: '=',\n onChange: '&',\n },\n };\n }\n return CloudWatchQueryParameter;\n}());\n\nvar CloudWatchQueryParameterCtrl = /** @class */ (function () {\n /** @ngInject */\n CloudWatchQueryParameterCtrl.$inject = [\"$scope\", \"templateSrv\", \"uiSegmentSrv\", \"datasourceSrv\", \"$q\"];\n function CloudWatchQueryParameterCtrl($scope, templateSrv, uiSegmentSrv, datasourceSrv, $q) {\n $scope.init = function () {\n var target = $scope.target;\n target.namespace = target.namespace || '';\n target.metricName = target.metricName || '';\n target.statistics = target.statistics || ['Average'];\n target.dimensions = target.dimensions || {};\n target.period = target.period || '';\n target.region = target.region || 'default';\n target.highResolution = target.highResolution || false;\n $scope.regionSegment = uiSegmentSrv.getSegmentForValue($scope.target.region, 'select region');\n $scope.namespaceSegment = uiSegmentSrv.getSegmentForValue($scope.target.namespace, 'select namespace');\n $scope.metricSegment = uiSegmentSrv.getSegmentForValue($scope.target.metricName, 'select metric');\n $scope.dimSegments = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.reduce($scope.target.dimensions, function (memo, value, key) {\n memo.push(uiSegmentSrv.newKey(key));\n memo.push(uiSegmentSrv.newOperator('='));\n memo.push(uiSegmentSrv.newKeyValue(value));\n return memo;\n }, []);\n $scope.statSegments = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map($scope.target.statistics, function (stat) {\n return uiSegmentSrv.getSegmentForValue(stat);\n });\n $scope.ensurePlusButton($scope.statSegments);\n $scope.ensurePlusButton($scope.dimSegments);\n $scope.removeDimSegment = uiSegmentSrv.newSegment({\n fake: true,\n value: '-- remove dimension --',\n });\n $scope.removeStatSegment = uiSegmentSrv.newSegment({\n fake: true,\n value: '-- remove stat --',\n });\n if (__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isEmpty($scope.target.region)) {\n $scope.target.region = 'default';\n }\n if (!$scope.onChange) {\n $scope.onChange = function () { };\n }\n };\n $scope.getStatSegments = function () {\n return $q.when(__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.flatten([\n __WEBPACK_IMPORTED_MODULE_0_angular___default.a.copy($scope.removeStatSegment),\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map($scope.datasource.standardStatistics, function (s) {\n return uiSegmentSrv.getSegmentForValue(s);\n }),\n uiSegmentSrv.getSegmentForValue('pNN.NN'),\n ]));\n };\n $scope.statSegmentChanged = function (segment, index) {\n if (segment.value === $scope.removeStatSegment.value) {\n $scope.statSegments.splice(index, 1);\n }\n else {\n segment.type = 'value';\n }\n $scope.target.statistics = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.reduce($scope.statSegments, function (memo, seg) {\n if (!seg.fake) {\n memo.push(seg.value);\n }\n return memo;\n }, []);\n $scope.ensurePlusButton($scope.statSegments);\n $scope.onChange();\n };\n $scope.ensurePlusButton = function (segments) {\n var count = segments.length;\n var lastSegment = segments[Math.max(count - 1, 0)];\n if (!lastSegment || lastSegment.type !== 'plus-button') {\n segments.push(uiSegmentSrv.newPlusButton());\n }\n };\n $scope.getDimSegments = function (segment, $index) {\n if (segment.type === 'operator') {\n return $q.when([]);\n }\n var target = $scope.target;\n var query = $q.when([]);\n if (segment.type === 'key' || segment.type === 'plus-button') {\n query = $scope.datasource.getDimensionKeys($scope.target.namespace, $scope.target.region);\n }\n else if (segment.type === 'value') {\n var dimensionKey = $scope.dimSegments[$index - 2].value;\n query = $scope.datasource.getDimensionValues(target.region, target.namespace, target.metricName, dimensionKey, target.dimensions);\n }\n return query.then($scope.transformToSegments(true)).then(function (results) {\n if (segment.type === 'key') {\n results.splice(0, 0, __WEBPACK_IMPORTED_MODULE_0_angular___default.a.copy($scope.removeDimSegment));\n }\n return results;\n });\n };\n $scope.dimSegmentChanged = function (segment, index) {\n $scope.dimSegments[index] = segment;\n if (segment.value === $scope.removeDimSegment.value) {\n $scope.dimSegments.splice(index, 3);\n }\n else if (segment.type === 'plus-button') {\n $scope.dimSegments.push(uiSegmentSrv.newOperator('='));\n $scope.dimSegments.push(uiSegmentSrv.newFake('select dimension value', 'value', 'query-segment-value'));\n segment.type = 'key';\n segment.cssClass = 'query-segment-key';\n }\n $scope.syncDimSegmentsWithModel();\n $scope.ensurePlusButton($scope.dimSegments);\n $scope.onChange();\n };\n $scope.syncDimSegmentsWithModel = function () {\n var dims = {};\n var length = $scope.dimSegments.length;\n for (var i = 0; i < length - 2; i += 3) {\n var keySegment = $scope.dimSegments[i];\n var valueSegment = $scope.dimSegments[i + 2];\n if (!valueSegment.fake) {\n dims[keySegment.value] = valueSegment.value;\n }\n }\n $scope.target.dimensions = dims;\n };\n $scope.getRegions = function () {\n return $scope.datasource\n .metricFindQuery('regions()')\n .then(function (results) {\n results.unshift({ text: 'default' });\n return results;\n })\n .then($scope.transformToSegments(true));\n };\n $scope.getNamespaces = function () {\n return $scope.datasource.metricFindQuery('namespaces()').then($scope.transformToSegments(true));\n };\n $scope.getMetrics = function () {\n return $scope.datasource\n .metricFindQuery('metrics(' + $scope.target.namespace + ',' + $scope.target.region + ')')\n .then($scope.transformToSegments(true));\n };\n $scope.regionChanged = function () {\n $scope.target.region = $scope.regionSegment.value;\n $scope.onChange();\n };\n $scope.namespaceChanged = function () {\n $scope.target.namespace = $scope.namespaceSegment.value;\n $scope.onChange();\n };\n $scope.metricChanged = function () {\n $scope.target.metricName = $scope.metricSegment.value;\n $scope.onChange();\n };\n $scope.transformToSegments = function (addTemplateVars) {\n return function (results) {\n var segments = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(results, function (segment) {\n return uiSegmentSrv.newSegment({\n value: segment.text,\n expandable: segment.expandable,\n });\n });\n if (addTemplateVars) {\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(templateSrv.variables, function (variable) {\n segments.unshift(uiSegmentSrv.newSegment({\n type: 'template',\n value: '$' + variable.name,\n expandable: true,\n }));\n });\n }\n return segments;\n };\n };\n $scope.init();\n }\n return CloudWatchQueryParameterCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.controllers').directive('cloudwatchQueryParameter', CloudWatchQueryParameter);\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.controllers').controller('CloudWatchQueryParameterCtrl', CloudWatchQueryParameterCtrl);\n\n\n/***/ }),\n\n/***/ 2003:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__query_part__ = __webpack_require__(2004);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_utils_kbn__ = __webpack_require__(312);\n\n\n\nvar InfluxQuery = /** @class */ (function () {\n /** @ngInject */\n InfluxQuery.$inject = [\"target\", \"templateSrv\", \"scopedVars\"];\n function InfluxQuery(target, templateSrv, scopedVars) {\n this.target = target;\n this.templateSrv = templateSrv;\n this.scopedVars = scopedVars;\n target.policy = target.policy || 'default';\n target.resultFormat = target.resultFormat || 'time_series';\n target.orderByTime = target.orderByTime || 'ASC';\n target.tags = target.tags || [];\n target.groupBy = target.groupBy || [{ type: 'time', params: ['$__interval'] }, { type: 'fill', params: ['null'] }];\n target.select = target.select || [[{ type: 'field', params: ['value'] }, { type: 'mean', params: [] }]];\n this.updateProjection();\n }\n InfluxQuery.prototype.updateProjection = function () {\n this.selectModels = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(this.target.select, function (parts) {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(parts, __WEBPACK_IMPORTED_MODULE_1__query_part__[\"a\" /* default */].create);\n });\n this.groupByParts = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(this.target.groupBy, __WEBPACK_IMPORTED_MODULE_1__query_part__[\"a\" /* default */].create);\n };\n InfluxQuery.prototype.updatePersistedParts = function () {\n this.target.select = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(this.selectModels, function (selectParts) {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(selectParts, function (part) {\n return { type: part.def.type, params: part.params };\n });\n });\n };\n InfluxQuery.prototype.hasGroupByTime = function () {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(this.target.groupBy, function (g) { return g.type === 'time'; });\n };\n InfluxQuery.prototype.hasFill = function () {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(this.target.groupBy, function (g) { return g.type === 'fill'; });\n };\n InfluxQuery.prototype.addGroupBy = function (value) {\n var stringParts = value.match(/^(\\w+)\\((.*)\\)$/);\n var typePart = stringParts[1];\n var arg = stringParts[2];\n var partModel = __WEBPACK_IMPORTED_MODULE_1__query_part__[\"a\" /* default */].create({ type: typePart, params: [arg] });\n var partCount = this.target.groupBy.length;\n if (partCount === 0) {\n this.target.groupBy.push(partModel.part);\n }\n else if (typePart === 'time') {\n this.target.groupBy.splice(0, 0, partModel.part);\n }\n else if (typePart === 'tag') {\n if (this.target.groupBy[partCount - 1].type === 'fill') {\n this.target.groupBy.splice(partCount - 1, 0, partModel.part);\n }\n else {\n this.target.groupBy.push(partModel.part);\n }\n }\n else {\n this.target.groupBy.push(partModel.part);\n }\n this.updateProjection();\n };\n InfluxQuery.prototype.removeGroupByPart = function (part, index) {\n var categories = __WEBPACK_IMPORTED_MODULE_1__query_part__[\"a\" /* default */].getCategories();\n if (part.def.type === 'time') {\n // remove fill\n this.target.groupBy = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.filter(this.target.groupBy, function (g) { return g.type !== 'fill'; });\n // remove aggregations\n this.target.select = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(this.target.select, function (s) {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.filter(s, function (part) {\n var partModel = __WEBPACK_IMPORTED_MODULE_1__query_part__[\"a\" /* default */].create(part);\n if (partModel.def.category === categories.Aggregations) {\n return false;\n }\n if (partModel.def.category === categories.Selectors) {\n return false;\n }\n return true;\n });\n });\n }\n this.target.groupBy.splice(index, 1);\n this.updateProjection();\n };\n InfluxQuery.prototype.removeSelect = function (index) {\n this.target.select.splice(index, 1);\n this.updateProjection();\n };\n InfluxQuery.prototype.removeSelectPart = function (selectParts, part) {\n // if we remove the field remove the whole statement\n if (part.def.type === 'field') {\n if (this.selectModels.length > 1) {\n var modelsIndex = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.indexOf(this.selectModels, selectParts);\n this.selectModels.splice(modelsIndex, 1);\n }\n }\n else {\n var partIndex = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.indexOf(selectParts, part);\n selectParts.splice(partIndex, 1);\n }\n this.updatePersistedParts();\n };\n InfluxQuery.prototype.addSelectPart = function (selectParts, type) {\n var partModel = __WEBPACK_IMPORTED_MODULE_1__query_part__[\"a\" /* default */].create({ type: type });\n partModel.def.addStrategy(selectParts, partModel, this);\n this.updatePersistedParts();\n };\n InfluxQuery.prototype.renderTagCondition = function (tag, index, interpolate) {\n var str = '';\n var operator = tag.operator;\n var value = tag.value;\n if (index > 0) {\n str = (tag.condition || 'AND') + ' ';\n }\n if (!operator) {\n if (/^\\/.*\\/$/.test(value)) {\n operator = '=~';\n }\n else {\n operator = '=';\n }\n }\n // quote value unless regex\n if (operator !== '=~' && operator !== '!~') {\n if (interpolate) {\n value = this.templateSrv.replace(value, this.scopedVars);\n }\n if (operator !== '>' && operator !== '<') {\n value = \"'\" + value.replace(/\\\\/g, '\\\\\\\\') + \"'\";\n }\n }\n else if (interpolate) {\n value = this.templateSrv.replace(value, this.scopedVars, 'regex');\n }\n return str + '\"' + tag.key + '\" ' + operator + ' ' + value;\n };\n InfluxQuery.prototype.getMeasurementAndPolicy = function (interpolate) {\n var policy = this.target.policy;\n var measurement = this.target.measurement || 'measurement';\n if (!measurement.match('^/.*/$')) {\n measurement = '\"' + measurement + '\"';\n }\n else if (interpolate) {\n measurement = this.templateSrv.replace(measurement, this.scopedVars, 'regex');\n }\n if (policy !== 'default') {\n policy = '\"' + this.target.policy + '\".';\n }\n else {\n policy = '';\n }\n return policy + measurement;\n };\n InfluxQuery.prototype.interpolateQueryStr = function (value, variable, defaultFormatFn) {\n // if no multi or include all do not regexEscape\n if (!variable.multi && !variable.includeAll) {\n return value;\n }\n if (typeof value === 'string') {\n return __WEBPACK_IMPORTED_MODULE_2_app_core_utils_kbn__[\"a\" /* default */].regexEscape(value);\n }\n var escapedValues = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(value, __WEBPACK_IMPORTED_MODULE_2_app_core_utils_kbn__[\"a\" /* default */].regexEscape);\n return '(' + escapedValues.join('|') + ')';\n };\n InfluxQuery.prototype.render = function (interpolate) {\n var _this = this;\n var target = this.target;\n if (target.rawQuery) {\n if (interpolate) {\n return this.templateSrv.replace(target.query, this.scopedVars, this.interpolateQueryStr);\n }\n else {\n return target.query;\n }\n }\n var query = 'SELECT ';\n var i, y;\n for (i = 0; i < this.selectModels.length; i++) {\n var parts = this.selectModels[i];\n var selectText = '';\n for (y = 0; y < parts.length; y++) {\n var part_1 = parts[y];\n selectText = part_1.render(selectText);\n }\n if (i > 0) {\n query += ', ';\n }\n query += selectText;\n }\n query += ' FROM ' + this.getMeasurementAndPolicy(interpolate) + ' WHERE ';\n var conditions = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(target.tags, function (tag, index) {\n return _this.renderTagCondition(tag, index, interpolate);\n });\n if (conditions.length > 0) {\n query += '(' + conditions.join(' ') + ') AND ';\n }\n query += '$timeFilter';\n var groupBySection = '';\n for (i = 0; i < this.groupByParts.length; i++) {\n var part = this.groupByParts[i];\n if (i > 0) {\n // for some reason fill has no separator\n groupBySection += part.def.type === 'fill' ? ' ' : ', ';\n }\n groupBySection += part.render('');\n }\n if (groupBySection.length) {\n query += ' GROUP BY ' + groupBySection;\n }\n if (target.fill) {\n query += ' fill(' + target.fill + ')';\n }\n if (target.orderByTime === 'DESC') {\n query += ' ORDER BY time DESC';\n }\n if (target.limit) {\n query += ' LIMIT ' + target.limit;\n }\n if (target.slimit) {\n query += ' SLIMIT ' + target.slimit;\n }\n return query;\n };\n InfluxQuery.prototype.renderAdhocFilters = function (filters) {\n var _this = this;\n var conditions = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(filters, function (tag, index) {\n return _this.renderTagCondition(tag, index, false);\n });\n return conditions.join(' ');\n };\n return InfluxQuery;\n}());\n/* harmony default export */ __webpack_exports__[\"a\"] = (InfluxQuery);\n\n\n/***/ }),\n\n/***/ 2004:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__ = __webpack_require__(699);\n\n\nvar index = [];\nvar categories = {\n Aggregations: [],\n Selectors: [],\n Transformations: [],\n Predictors: [],\n Math: [],\n Aliasing: [],\n Fields: [],\n};\nfunction createPart(part) {\n var def = index[part.type];\n if (!def) {\n throw { message: 'Could not find query part ' + part.type };\n }\n return new __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"a\" /* QueryPart */](part, def);\n}\nfunction register(options) {\n index[options.type] = new __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"b\" /* QueryPartDef */](options);\n options.category.push(index[options.type]);\n}\nvar groupByTimeFunctions = [];\nfunction aliasRenderer(part, innerExpr) {\n return innerExpr + ' AS ' + '\"' + part.params[0] + '\"';\n}\nfunction fieldRenderer(part, innerExpr) {\n if (part.params[0] === '*') {\n return '*';\n }\n return '\"' + part.params[0] + '\"';\n}\nfunction replaceAggregationAddStrategy(selectParts, partModel) {\n // look for existing aggregation\n for (var i = 0; i < selectParts.length; i++) {\n var part = selectParts[i];\n if (part.def.category === categories.Aggregations) {\n if (part.def.type === partModel.def.type) {\n return;\n }\n // count distinct is allowed\n if (part.def.type === 'count' && partModel.def.type === 'distinct') {\n break;\n }\n // remove next aggregation if distinct was replaced\n if (part.def.type === 'distinct') {\n var morePartsAvailable = selectParts.length >= i + 2;\n if (partModel.def.type !== 'count' && morePartsAvailable) {\n var nextPart = selectParts[i + 1];\n if (nextPart.def.category === categories.Aggregations) {\n selectParts.splice(i + 1, 1);\n }\n }\n else if (partModel.def.type === 'count') {\n if (!morePartsAvailable || selectParts[i + 1].def.type !== 'count') {\n selectParts.splice(i + 1, 0, partModel);\n }\n return;\n }\n }\n selectParts[i] = partModel;\n return;\n }\n if (part.def.category === categories.Selectors) {\n selectParts[i] = partModel;\n return;\n }\n }\n selectParts.splice(1, 0, partModel);\n}\nfunction addTransformationStrategy(selectParts, partModel) {\n var i;\n // look for index to add transformation\n for (i = 0; i < selectParts.length; i++) {\n var part = selectParts[i];\n if (part.def.category === categories.Math || part.def.category === categories.Aliasing) {\n break;\n }\n }\n selectParts.splice(i, 0, partModel);\n}\nfunction addMathStrategy(selectParts, partModel) {\n var partCount = selectParts.length;\n if (partCount > 0) {\n // if last is math, replace it\n if (selectParts[partCount - 1].def.type === 'math') {\n selectParts[partCount - 1] = partModel;\n return;\n }\n // if next to last is math, replace it\n if (partCount > 1 && selectParts[partCount - 2].def.type === 'math') {\n selectParts[partCount - 2] = partModel;\n return;\n }\n else if (selectParts[partCount - 1].def.type === 'alias') {\n // if last is alias add it before\n selectParts.splice(partCount - 1, 0, partModel);\n return;\n }\n }\n selectParts.push(partModel);\n}\nfunction addAliasStrategy(selectParts, partModel) {\n var partCount = selectParts.length;\n if (partCount > 0) {\n // if last is alias, replace it\n if (selectParts[partCount - 1].def.type === 'alias') {\n selectParts[partCount - 1] = partModel;\n return;\n }\n }\n selectParts.push(partModel);\n}\nfunction addFieldStrategy(selectParts, partModel, query) {\n // copy all parts\n var parts = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(selectParts, function (part) {\n return createPart({ type: part.def.type, params: __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.clone(part.params) });\n });\n query.selectModels.push(parts);\n}\nregister({\n type: 'field',\n addStrategy: addFieldStrategy,\n category: categories.Fields,\n params: [{ type: 'field', dynamicLookup: true }],\n defaultParams: ['value'],\n renderer: fieldRenderer,\n});\n// Aggregations\nregister({\n type: 'count',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Aggregations,\n params: [],\n defaultParams: [],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'distinct',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Aggregations,\n params: [],\n defaultParams: [],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'integral',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Aggregations,\n params: [],\n defaultParams: [],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'mean',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Aggregations,\n params: [],\n defaultParams: [],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'median',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Aggregations,\n params: [],\n defaultParams: [],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'mode',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Aggregations,\n params: [],\n defaultParams: [],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'sum',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Aggregations,\n params: [],\n defaultParams: [],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\n// transformations\nregister({\n type: 'derivative',\n addStrategy: addTransformationStrategy,\n category: categories.Transformations,\n params: [\n {\n name: 'duration',\n type: 'interval',\n options: ['1s', '10s', '1m', '5m', '10m', '15m', '1h'],\n },\n ],\n defaultParams: ['10s'],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'spread',\n addStrategy: addTransformationStrategy,\n category: categories.Transformations,\n params: [],\n defaultParams: [],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'non_negative_derivative',\n addStrategy: addTransformationStrategy,\n category: categories.Transformations,\n params: [\n {\n name: 'duration',\n type: 'interval',\n options: ['1s', '10s', '1m', '5m', '10m', '15m', '1h'],\n },\n ],\n defaultParams: ['10s'],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'difference',\n addStrategy: addTransformationStrategy,\n category: categories.Transformations,\n params: [],\n defaultParams: [],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'non_negative_difference',\n addStrategy: addTransformationStrategy,\n category: categories.Transformations,\n params: [],\n defaultParams: [],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'moving_average',\n addStrategy: addTransformationStrategy,\n category: categories.Transformations,\n params: [{ name: 'window', type: 'int', options: [5, 10, 20, 30, 40] }],\n defaultParams: [10],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'cumulative_sum',\n addStrategy: addTransformationStrategy,\n category: categories.Transformations,\n params: [],\n defaultParams: [],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'stddev',\n addStrategy: addTransformationStrategy,\n category: categories.Transformations,\n params: [],\n defaultParams: [],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'time',\n category: groupByTimeFunctions,\n params: [\n {\n name: 'interval',\n type: 'time',\n options: ['$__interval', '1s', '10s', '1m', '5m', '10m', '15m', '1h'],\n },\n ],\n defaultParams: ['$__interval'],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'fill',\n category: groupByTimeFunctions,\n params: [\n {\n name: 'fill',\n type: 'string',\n options: ['none', 'null', '0', 'previous', 'linear'],\n },\n ],\n defaultParams: ['null'],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'elapsed',\n addStrategy: addTransformationStrategy,\n category: categories.Transformations,\n params: [\n {\n name: 'duration',\n type: 'interval',\n options: ['1s', '10s', '1m', '5m', '10m', '15m', '1h'],\n },\n ],\n defaultParams: ['10s'],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\n// predictions\nregister({\n type: 'holt_winters',\n addStrategy: addTransformationStrategy,\n category: categories.Predictors,\n params: [\n { name: 'number', type: 'int', options: [5, 10, 20, 30, 40] },\n { name: 'season', type: 'int', options: [0, 1, 2, 5, 10] },\n ],\n defaultParams: [10, 2],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'holt_winters_with_fit',\n addStrategy: addTransformationStrategy,\n category: categories.Predictors,\n params: [\n { name: 'number', type: 'int', options: [5, 10, 20, 30, 40] },\n { name: 'season', type: 'int', options: [0, 1, 2, 5, 10] },\n ],\n defaultParams: [10, 2],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\n// Selectors\nregister({\n type: 'bottom',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Selectors,\n params: [{ name: 'count', type: 'int' }],\n defaultParams: [3],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'first',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Selectors,\n params: [],\n defaultParams: [],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'last',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Selectors,\n params: [],\n defaultParams: [],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'max',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Selectors,\n params: [],\n defaultParams: [],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'min',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Selectors,\n params: [],\n defaultParams: [],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'percentile',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Selectors,\n params: [{ name: 'nth', type: 'int' }],\n defaultParams: [95],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'top',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Selectors,\n params: [{ name: 'count', type: 'int' }],\n defaultParams: [3],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"c\" /* functionRenderer */],\n});\nregister({\n type: 'tag',\n category: groupByTimeFunctions,\n params: [{ name: 'tag', type: 'string', dynamicLookup: true }],\n defaultParams: ['tag'],\n renderer: fieldRenderer,\n});\nregister({\n type: 'math',\n addStrategy: addMathStrategy,\n category: categories.Math,\n params: [{ name: 'expr', type: 'string' }],\n defaultParams: [' / 100'],\n renderer: __WEBPACK_IMPORTED_MODULE_1_app_core_components_query_part_query_part__[\"d\" /* suffixRenderer */],\n});\nregister({\n type: 'alias',\n addStrategy: addAliasStrategy,\n category: categories.Aliasing,\n params: [{ name: 'name', type: 'string', quote: 'double' }],\n defaultParams: ['alias'],\n renderMode: 'suffix',\n renderer: aliasRenderer,\n});\n/* harmony default export */ __webpack_exports__[\"a\"] = ({\n create: createPart,\n getCategories: function () {\n return categories;\n },\n replaceAggregationAdd: replaceAggregationAddStrategy,\n});\n\n\n/***/ }),\n\n/***/ 2005:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return InfluxQueryBuilder; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n\nfunction renderTagCondition(tag, index) {\n var str = '';\n var operator = tag.operator;\n var value = tag.value;\n if (index > 0) {\n str = (tag.condition || 'AND') + ' ';\n }\n if (!operator) {\n if (/^\\/.*\\/$/.test(tag.value)) {\n operator = '=~';\n }\n else {\n operator = '=';\n }\n }\n // quote value unless regex or number\n if (operator !== '=~' && operator !== '!~' && isNaN(+value)) {\n value = \"'\" + value + \"'\";\n }\n return str + '\"' + tag.key + '\" ' + operator + ' ' + value;\n}\nvar InfluxQueryBuilder = /** @class */ (function () {\n function InfluxQueryBuilder(target, database) {\n this.target = target;\n this.database = database;\n }\n InfluxQueryBuilder.prototype.buildExploreQuery = function (type, withKey, withMeasurementFilter) {\n var query;\n var measurement;\n var policy;\n if (type === 'TAG_KEYS') {\n query = 'SHOW TAG KEYS';\n measurement = this.target.measurement;\n policy = this.target.policy;\n }\n else if (type === 'TAG_VALUES') {\n query = 'SHOW TAG VALUES';\n measurement = this.target.measurement;\n policy = this.target.policy;\n }\n else if (type === 'MEASUREMENTS') {\n query = 'SHOW MEASUREMENTS';\n if (withMeasurementFilter) {\n query += ' WITH MEASUREMENT =~ /' + withMeasurementFilter + '/';\n }\n }\n else if (type === 'FIELDS') {\n measurement = this.target.measurement;\n policy = this.target.policy;\n if (!measurement.match('^/.*/')) {\n measurement = '\"' + measurement + '\"';\n if (policy && policy !== 'default') {\n policy = '\"' + policy + '\"';\n measurement = policy + '.' + measurement;\n }\n }\n return 'SHOW FIELD KEYS FROM ' + measurement;\n }\n else if (type === 'RETENTION POLICIES') {\n query = 'SHOW RETENTION POLICIES on \"' + this.database + '\"';\n return query;\n }\n if (measurement) {\n if (!measurement.match('^/.*/') && !measurement.match(/^merge\\(.*\\)/)) {\n measurement = '\"' + measurement + '\"';\n }\n if (policy && policy !== 'default') {\n policy = '\"' + policy + '\"';\n measurement = policy + '.' + measurement;\n }\n query += ' FROM ' + measurement;\n }\n if (withKey) {\n query += ' WITH KEY = \"' + withKey + '\"';\n }\n if (this.target.tags && this.target.tags.length > 0) {\n var whereConditions = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.reduce(this.target.tags, function (memo, tag) {\n // do not add a condition for the key we want to explore for\n if (tag.key === withKey) {\n return memo;\n }\n memo.push(renderTagCondition(tag, memo.length));\n return memo;\n }, []);\n if (whereConditions.length > 0) {\n query += ' WHERE ' + whereConditions.join(' ');\n }\n }\n if (type === 'MEASUREMENTS') {\n query += ' LIMIT 100';\n //Solve issue #2524 by limiting the number of measurements returned\n //LIMIT must be after WITH MEASUREMENT and WHERE clauses\n //This also could be used for TAG KEYS and TAG VALUES, if desired\n }\n return query;\n };\n return InfluxQueryBuilder;\n}());\n\n\n\n/***/ }),\n\n/***/ 2006:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GraphCtrl\", function() { return GraphCtrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PanelCtrl\", function() { return GraphCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__graph__ = __webpack_require__(2136);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__legend__ = __webpack_require__(2142);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__series_overrides_ctrl__ = __webpack_require__(2143);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__thresholds_form__ = __webpack_require__(2144);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__template__ = __webpack_require__(2145);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_app_core_config__ = __webpack_require__(23);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_app_plugins_sdk__ = __webpack_require__(1983);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__data_processor__ = __webpack_require__(2146);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__axes_editor__ = __webpack_require__(2147);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n\n\n\n\n\n\n\nvar GraphCtrl = /** @class */ (function (_super) {\n __extends(GraphCtrl, _super);\n /** @ngInject */\n GraphCtrl.$inject = [\"$scope\", \"$injector\", \"annotationsSrv\"];\n function GraphCtrl($scope, $injector, annotationsSrv) {\n var _this = _super.call(this, $scope, $injector) || this;\n _this.annotationsSrv = annotationsSrv;\n _this.hiddenSeries = {};\n _this.seriesList = [];\n _this.dataList = [];\n _this.annotations = [];\n _this.colors = [];\n _this.panelDefaults = {\n // datasource name, null = default datasource\n datasource: null,\n // sets client side (flot) or native graphite png renderer (png)\n renderer: 'flot',\n yaxes: [\n {\n label: null,\n show: true,\n logBase: 1,\n min: null,\n max: null,\n format: 'short',\n },\n {\n label: null,\n show: true,\n logBase: 1,\n min: null,\n max: null,\n format: 'short',\n },\n ],\n xaxis: {\n show: true,\n mode: 'time',\n name: null,\n values: [],\n buckets: null,\n },\n yaxis: {\n align: false,\n alignLevel: null,\n },\n // show/hide lines\n lines: true,\n // fill factor\n fill: 1,\n // line width in pixels\n linewidth: 1,\n // show/hide dashed line\n dashes: false,\n // length of a dash\n dashLength: 10,\n // length of space between two dashes\n spaceLength: 10,\n // show hide points\n points: false,\n // point radius in pixels\n pointradius: 5,\n // show hide bars\n bars: false,\n // enable/disable stacking\n stack: false,\n // stack percentage mode\n percentage: false,\n // legend options\n legend: {\n show: true,\n values: false,\n min: false,\n max: false,\n current: false,\n total: false,\n avg: false,\n },\n // how null points should be handled\n nullPointMode: 'connected',\n // staircase line mode\n steppedLine: false,\n // tooltip options\n tooltip: {\n value_type: 'individual',\n shared: true,\n sort: 0,\n },\n // time overrides\n timeFrom: null,\n timeShift: null,\n // metric queries\n targets: [{}],\n // series color overrides\n aliasColors: {},\n // other style overrides\n seriesOverrides: [],\n thresholds: [],\n };\n __WEBPACK_IMPORTED_MODULE_5_lodash___default.a.defaults(_this.panel, _this.panelDefaults);\n __WEBPACK_IMPORTED_MODULE_5_lodash___default.a.defaults(_this.panel.tooltip, _this.panelDefaults.tooltip);\n __WEBPACK_IMPORTED_MODULE_5_lodash___default.a.defaults(_this.panel.legend, _this.panelDefaults.legend);\n __WEBPACK_IMPORTED_MODULE_5_lodash___default.a.defaults(_this.panel.xaxis, _this.panelDefaults.xaxis);\n _this.processor = new __WEBPACK_IMPORTED_MODULE_8__data_processor__[\"a\" /* DataProcessor */](_this.panel);\n _this.events.on('render', _this.onRender.bind(_this));\n _this.events.on('data-received', _this.onDataReceived.bind(_this));\n _this.events.on('data-error', _this.onDataError.bind(_this));\n _this.events.on('data-snapshot-load', _this.onDataSnapshotLoad.bind(_this));\n _this.events.on('init-edit-mode', _this.onInitEditMode.bind(_this));\n _this.events.on('init-panel-actions', _this.onInitPanelActions.bind(_this));\n return _this;\n }\n GraphCtrl.prototype.onInitEditMode = function () {\n this.addEditorTab('Axes', __WEBPACK_IMPORTED_MODULE_9__axes_editor__[\"a\" /* axesEditorComponent */], 2);\n this.addEditorTab('Legend', 'public/app/plugins/panel/graph/tab_legend.html', 3);\n this.addEditorTab('Display', 'public/app/plugins/panel/graph/tab_display.html', 4);\n if (__WEBPACK_IMPORTED_MODULE_6_app_core_config__[\"a\" /* default */].alertingEnabled) {\n this.addEditorTab('Alert', __WEBPACK_IMPORTED_MODULE_7_app_plugins_sdk__[\"alertTab\"], 5);\n }\n this.subTabIndex = 0;\n };\n GraphCtrl.prototype.onInitPanelActions = function (actions) {\n // actions.push({ text: 'Export CSV', click: 'ctrl.exportCsv()' });\n actions.push({ text: 'Toggle legend', click: 'ctrl.toggleLegend()' });\n actions.push({ text: 'Joe mode', click: 'ctrl.joeMode()' });\n };\n GraphCtrl.prototype.issueQueries = function (datasource) {\n this.annotationsPromise = this.annotationsSrv.getAnnotations({\n dashboard: this.dashboard,\n panel: this.panel,\n range: this.range,\n });\n return _super.prototype.issueQueries.call(this, datasource);\n };\n GraphCtrl.prototype.zoomOut = function (evt) {\n this.publishAppEvent('zoom-out', 2);\n };\n GraphCtrl.prototype.onDataSnapshotLoad = function (snapshotData) {\n this.annotationsPromise = this.annotationsSrv.getAnnotations({\n dashboard: this.dashboard,\n panel: this.panel,\n range: this.range,\n });\n this.onDataReceived(snapshotData);\n };\n GraphCtrl.prototype.onDataError = function (err) {\n this.seriesList = [];\n this.annotations = [];\n this.render([]);\n };\n GraphCtrl.prototype.onDataReceived = function (dataList) {\n var _this = this;\n this.dataList = dataList;\n this.seriesList = this.processor.getSeriesList({\n dataList: dataList,\n range: this.range,\n });\n this.dataWarning = null;\n var datapointsCount = this.seriesList.reduce(function (prev, series) {\n return prev + series.datapoints.length;\n }, 0);\n if (datapointsCount === 0) {\n this.dataWarning = {\n title: 'No data points',\n tip: 'No datapoints returned from data query',\n };\n }\n else {\n for (var _i = 0, _a = this.seriesList; _i < _a.length; _i++) {\n var series = _a[_i];\n if (series.isOutsideRange) {\n this.dataWarning = {\n title: 'Data points outside time range',\n tip: 'Can be caused by timezone mismatch or missing time filter in query',\n };\n break;\n }\n }\n }\n this.annotationsPromise.then(function (result) {\n _this.loading = false;\n _this.alertState = result.alertState;\n _this.annotations = result.annotations;\n _this.render(_this.seriesList);\n }, function () {\n _this.loading = false;\n _this.render(_this.seriesList);\n });\n };\n GraphCtrl.prototype.onRender = function () {\n if (!this.seriesList) {\n return;\n }\n for (var _i = 0, _a = this.seriesList; _i < _a.length; _i++) {\n var series = _a[_i];\n series.applySeriesOverrides(this.panel.seriesOverrides);\n if (series.unit) {\n this.panel.yaxes[series.yaxis - 1].format = series.unit;\n }\n }\n };\n GraphCtrl.prototype.changeSeriesColor = function (series, color) {\n series.setColor(color);\n this.panel.aliasColors[series.alias] = series.color;\n this.render();\n };\n GraphCtrl.prototype.toggleSeries = function (serie, event) {\n if (event.ctrlKey || event.metaKey || event.shiftKey) {\n if (this.hiddenSeries[serie.alias]) {\n delete this.hiddenSeries[serie.alias];\n }\n else {\n this.hiddenSeries[serie.alias] = true;\n }\n }\n else {\n this.toggleSeriesExclusiveMode(serie);\n }\n this.render();\n };\n GraphCtrl.prototype.toggleSeriesExclusiveMode = function (serie) {\n var _this = this;\n var hidden = this.hiddenSeries;\n if (hidden[serie.alias]) {\n delete hidden[serie.alias];\n }\n // check if every other series is hidden\n var alreadyExclusive = __WEBPACK_IMPORTED_MODULE_5_lodash___default.a.every(this.seriesList, function (value) {\n if (value.alias === serie.alias) {\n return true;\n }\n return hidden[value.alias];\n });\n if (alreadyExclusive) {\n // remove all hidden series\n __WEBPACK_IMPORTED_MODULE_5_lodash___default.a.each(this.seriesList, function (value) {\n delete _this.hiddenSeries[value.alias];\n });\n }\n else {\n // hide all but this serie\n __WEBPACK_IMPORTED_MODULE_5_lodash___default.a.each(this.seriesList, function (value) {\n if (value.alias === serie.alias) {\n return;\n }\n _this.hiddenSeries[value.alias] = true;\n });\n }\n };\n GraphCtrl.prototype.toggleAxis = function (info) {\n var override = __WEBPACK_IMPORTED_MODULE_5_lodash___default.a.find(this.panel.seriesOverrides, { alias: info.alias });\n if (!override) {\n override = { alias: info.alias };\n this.panel.seriesOverrides.push(override);\n }\n info.yaxis = override.yaxis = info.yaxis === 2 ? 1 : 2;\n this.render();\n };\n GraphCtrl.prototype.addSeriesOverride = function (override) {\n this.panel.seriesOverrides.push(override || {});\n };\n GraphCtrl.prototype.removeSeriesOverride = function (override) {\n this.panel.seriesOverrides = __WEBPACK_IMPORTED_MODULE_5_lodash___default.a.without(this.panel.seriesOverrides, override);\n this.render();\n };\n GraphCtrl.prototype.toggleLegend = function () {\n this.panel.legend.show = !this.panel.legend.show;\n this.refresh();\n };\n GraphCtrl.prototype.joeMode = function () {\n var steps = window.prompt('Step count (10-500)?');\n this.panel.slowMode = { enabled: true, stepCount: Number(steps) };\n this.refresh();\n };\n GraphCtrl.prototype.legendValuesOptionChanged = function () {\n var legend = this.panel.legend;\n legend.values = legend.min || legend.max || legend.avg || legend.current || legend.total;\n this.render();\n };\n GraphCtrl.prototype.exportCsv = function () {\n var scope = this.$scope.$new(true);\n scope.seriesList = this.seriesList;\n this.publishAppEvent('show-modal', {\n templateHtml: '',\n scope: scope,\n modalClass: 'modal--narrow',\n });\n };\n GraphCtrl.template = __WEBPACK_IMPORTED_MODULE_4__template__[\"a\" /* default */];\n return GraphCtrl;\n}(__WEBPACK_IMPORTED_MODULE_7_app_plugins_sdk__[\"MetricsPanelCtrl\"]));\n\n\n\n/***/ }),\n\n/***/ 2007:\n/***/ (function(module, exports) {\n\n/* Flot plugin for selecting regions of a plot.\n\nCopyright (c) 2007-2013 IOLA and Ole Laursen.\nLicensed under the MIT license.\n\nThe plugin supports these options:\n\nselection: {\n\tmode: null or \"x\" or \"y\" or \"xy\",\n\tcolor: color,\n\tshape: \"round\" or \"miter\" or \"bevel\",\n\tminSize: number of pixels\n}\n\nSelection support is enabled by setting the mode to one of \"x\", \"y\" or \"xy\".\nIn \"x\" mode, the user will only be able to specify the x range, similarly for\n\"y\" mode. For \"xy\", the selection becomes a rectangle where both ranges can be\nspecified. \"color\" is color of the selection (if you need to change the color\nlater on, you can get to it with plot.getOptions().selection.color). \"shape\"\nis the shape of the corners of the selection.\n\n\"minSize\" is the minimum size a selection can be in pixels. This value can\nbe customized to determine the smallest size a selection can be and still\nhave the selection rectangle be displayed. When customizing this value, the\nfact that it refers to pixels, not axis units must be taken into account.\nThus, for example, if there is a bar graph in time mode with BarWidth set to 1\nminute, setting \"minSize\" to 1 will not make the minimum selection size 1\nminute, but rather 1 pixel. Note also that setting \"minSize\" to 0 will prevent\n\"plotunselected\" events from being fired when the user clicks the mouse without\ndragging.\n\nWhen selection support is enabled, a \"plotselected\" event will be emitted on\nthe DOM element you passed into the plot function. The event handler gets a\nparameter with the ranges selected on the axes, like this:\n\n\tplaceholder.bind( \"plotselected\", function( event, ranges ) {\n\t\talert(\"You selected \" + ranges.xaxis.from + \" to \" + ranges.xaxis.to)\n\t\t// similar for yaxis - with multiple axes, the extra ones are in\n\t\t// x2axis, x3axis, ...\n\t});\n\nThe \"plotselected\" event is only fired when the user has finished making the\nselection. A \"plotselecting\" event is fired during the process with the same\nparameters as the \"plotselected\" event, in case you want to know what's\nhappening while it's happening,\n\nA \"plotunselected\" event with no arguments is emitted when the user clicks the\nmouse to remove the selection. As stated above, setting \"minSize\" to 0 will\ndestroy this behavior.\n\nThe plugin allso adds the following methods to the plot object:\n\n- setSelection( ranges, preventEvent )\n\n Set the selection rectangle. The passed in ranges is on the same form as\n returned in the \"plotselected\" event. If the selection mode is \"x\", you\n should put in either an xaxis range, if the mode is \"y\" you need to put in\n an yaxis range and both xaxis and yaxis if the selection mode is \"xy\", like\n this:\n\n\tsetSelection({ xaxis: { from: 0, to: 10 }, yaxis: { from: 40, to: 60 } });\n\n setSelection will trigger the \"plotselected\" event when called. If you don't\n want that to happen, e.g. if you're inside a \"plotselected\" handler, pass\n true as the second parameter. If you are using multiple axes, you can\n specify the ranges on any of those, e.g. as x2axis/x3axis/... instead of\n xaxis, the plugin picks the first one it sees.\n\n- clearSelection( preventEvent )\n\n Clear the selection rectangle. Pass in true to avoid getting a\n \"plotunselected\" event.\n\n- getSelection()\n\n Returns the current selection in the same format as the \"plotselected\"\n event. If there's currently no selection, the function returns null.\n\n*/\n\n(function ($) {\n function init(plot) {\n var selection = {\n first: { x: -1, y: -1}, second: { x: -1, y: -1},\n show: false,\n active: false\n };\n\n // FIXME: The drag handling implemented here should be\n // abstracted out, there's some similar code from a library in\n // the navigation plugin, this should be massaged a bit to fit\n // the Flot cases here better and reused. Doing this would\n // make this plugin much slimmer.\n var savedhandlers = {};\n\n var mouseUpHandler = null;\n\n function onMouseMove(e) {\n if (selection.active) {\n updateSelection(e);\n\n plot.getPlaceholder().trigger(\"plotselecting\", [ getSelection() ]);\n }\n }\n\n function onMouseDown(e) {\n if (e.which != 1) // only accept left-click\n return;\n\n // cancel out any text selections\n document.body.focus();\n\n // prevent text selection and drag in old-school browsers\n if (document.onselectstart !== undefined && savedhandlers.onselectstart == null) {\n savedhandlers.onselectstart = document.onselectstart;\n document.onselectstart = function () { return false; };\n }\n if (document.ondrag !== undefined && savedhandlers.ondrag == null) {\n savedhandlers.ondrag = document.ondrag;\n document.ondrag = function () { return false; };\n }\n\n setSelectionPos(selection.first, e);\n\n selection.active = true;\n\n // this is a bit silly, but we have to use a closure to be\n // able to whack the same handler again\n mouseUpHandler = function (e) { onMouseUp(e); };\n\n $(document).one(\"mouseup\", mouseUpHandler);\n }\n\n function onMouseUp(e) {\n mouseUpHandler = null;\n\n // revert drag stuff for old-school browsers\n if (document.onselectstart !== undefined)\n document.onselectstart = savedhandlers.onselectstart;\n if (document.ondrag !== undefined)\n document.ondrag = savedhandlers.ondrag;\n\n // no more dragging\n selection.active = false;\n updateSelection(e);\n\n if (selectionIsSane())\n triggerSelectedEvent(e);\n else {\n // this counts as a clear\n plot.getPlaceholder().trigger(\"plotunselected\", [ ]);\n plot.getPlaceholder().trigger(\"plotselecting\", [ null ]);\n }\n\n setTimeout(function() {\n plot.isSelecting = false;\n }, 10);\n\n return false;\n }\n\n function getSelection() {\n if (!selectionIsSane())\n return null;\n\n if (!selection.show) return null;\n\n var r = {}, c1 = selection.first, c2 = selection.second;\n var axes = plot.getAxes();\n // look if no axis is used\n var noAxisInUse = true;\n $.each(axes, function (name, axis) {\n if (axis.used) {\n anyUsed = false;\n }\n })\n\n $.each(axes, function (name, axis) {\n if (axis.used || noAxisInUse) {\n var p1 = axis.c2p(c1[axis.direction]), p2 = axis.c2p(c2[axis.direction]);\n r[name] = { from: Math.min(p1, p2), to: Math.max(p1, p2) };\n }\n });\n return r;\n }\n\n function triggerSelectedEvent(event) {\n var r = getSelection();\n\n // Add ctrlKey and metaKey to event\n r.ctrlKey = event.ctrlKey;\n r.metaKey = event.metaKey;\n\n plot.getPlaceholder().trigger(\"plotselected\", [ r ]);\n\n // backwards-compat stuff, to be removed in future\n if (r.xaxis && r.yaxis)\n plot.getPlaceholder().trigger(\"selected\", [ { x1: r.xaxis.from, y1: r.yaxis.from, x2: r.xaxis.to, y2: r.yaxis.to } ]);\n }\n\n function clamp(min, value, max) {\n return value < min ? min: (value > max ? max: value);\n }\n\n function setSelectionPos(pos, e) {\n var o = plot.getOptions();\n var offset = plot.getPlaceholder().offset();\n var plotOffset = plot.getPlotOffset();\n pos.x = clamp(0, e.pageX - offset.left - plotOffset.left, plot.width());\n pos.y = clamp(0, e.pageY - offset.top - plotOffset.top, plot.height());\n\n if (o.selection.mode == \"y\")\n pos.x = pos == selection.first ? 0 : plot.width();\n\n if (o.selection.mode == \"x\")\n pos.y = pos == selection.first ? 0 : plot.height();\n }\n\n function updateSelection(pos) {\n if (pos.pageX == null)\n return;\n\n setSelectionPos(selection.second, pos);\n if (selectionIsSane()) {\n plot.isSelecting = true;\n selection.show = true;\n plot.triggerRedrawOverlay();\n }\n else\n clearSelection(true);\n }\n\n function clearSelection(preventEvent) {\n if (selection.show) {\n selection.show = false;\n plot.triggerRedrawOverlay();\n if (!preventEvent)\n plot.getPlaceholder().trigger(\"plotunselected\", [ ]);\n }\n }\n\n // function taken from markings support in Flot\n function extractRange(ranges, coord) {\n var axis, from, to, key, axes = plot.getAxes();\n\n for (var k in axes) {\n axis = axes[k];\n if (axis.direction == coord) {\n key = coord + axis.n + \"axis\";\n if (!ranges[key] && axis.n == 1)\n key = coord + \"axis\"; // support x1axis as xaxis\n if (ranges[key]) {\n from = ranges[key].from;\n to = ranges[key].to;\n break;\n }\n }\n }\n\n // backwards-compat stuff - to be removed in future\n if (!ranges[key]) {\n axis = coord == \"x\" ? plot.getXAxes()[0] : plot.getYAxes()[0];\n from = ranges[coord + \"1\"];\n to = ranges[coord + \"2\"];\n }\n\n // auto-reverse as an added bonus\n if (from != null && to != null && from > to) {\n var tmp = from;\n from = to;\n to = tmp;\n }\n\n return { from: from, to: to, axis: axis };\n }\n\n function setSelection(ranges, preventEvent) {\n var axis, range, o = plot.getOptions();\n\n if (o.selection.mode == \"y\") {\n selection.first.x = 0;\n selection.second.x = plot.width();\n }\n else {\n range = extractRange(ranges, \"x\");\n\n selection.first.x = range.axis.p2c(range.from);\n selection.second.x = range.axis.p2c(range.to);\n }\n\n if (o.selection.mode == \"x\") {\n selection.first.y = 0;\n selection.second.y = plot.height();\n }\n else {\n range = extractRange(ranges, \"y\");\n\n selection.first.y = range.axis.p2c(range.from);\n selection.second.y = range.axis.p2c(range.to);\n }\n\n selection.show = true;\n plot.triggerRedrawOverlay();\n if (!preventEvent && selectionIsSane())\n triggerSelectedEvent();\n }\n\n function selectionIsSane() {\n var minSize = plot.getOptions().selection.minSize;\n return Math.abs(selection.second.x - selection.first.x) >= minSize &&\n Math.abs(selection.second.y - selection.first.y) >= minSize;\n }\n\n plot.clearSelection = clearSelection;\n plot.setSelection = setSelection;\n plot.getSelection = getSelection;\n\n plot.hooks.bindEvents.push(function(plot, eventHolder) {\n var o = plot.getOptions();\n if (o.selection.mode != null) {\n eventHolder.mousemove(onMouseMove);\n eventHolder.mousedown(onMouseDown);\n }\n });\n\n\n plot.hooks.drawOverlay.push(function (plot, ctx) {\n // draw selection\n if (selection.show && selectionIsSane()) {\n var plotOffset = plot.getPlotOffset();\n var o = plot.getOptions();\n\n ctx.save();\n ctx.translate(plotOffset.left, plotOffset.top);\n\n var c = $.color.parse(o.selection.color);\n\n ctx.strokeStyle = c.scale('a', 0.8).toString();\n ctx.lineWidth = 1;\n ctx.lineJoin = o.selection.shape;\n ctx.fillStyle = c.scale('a', 0.4).toString();\n\n var x = Math.min(selection.first.x, selection.second.x) + 0.5,\n y = Math.min(selection.first.y, selection.second.y) + 0.5,\n w = Math.abs(selection.second.x - selection.first.x) - 1,\n h = Math.abs(selection.second.y - selection.first.y) - 1;\n\n ctx.fillRect(x, y, w, h);\n ctx.strokeRect(x, y, w, h);\n\n ctx.restore();\n }\n });\n\n plot.hooks.shutdown.push(function (plot, eventHolder) {\n eventHolder.unbind(\"mousemove\", onMouseMove);\n eventHolder.unbind(\"mousedown\", onMouseDown);\n\n if (mouseUpHandler)\n $(document).unbind(\"mouseup\", mouseUpHandler);\n });\n\n }\n\n $.plot.plugins.push({\n init: init,\n options: {\n selection: {\n mode: null, // one of null, \"x\", \"y\" or \"xy\"\n color: \"#e8cfac\",\n shape: \"round\", // one of \"round\", \"miter\", or \"bevel\"\n minSize: 5 // minimum number of pixels\n }\n },\n name: 'selection',\n version: '1.1'\n });\n})(jQuery);\n\n\n/***/ }),\n\n/***/ 2008:\n/***/ (function(module, exports) {\n\n/* Flot plugin for stacking data sets rather than overlyaing them.\n\nCopyright (c) 2007-2014 IOLA and Ole Laursen.\nLicensed under the MIT license.\n\nThe plugin assumes the data is sorted on x (or y if stacking horizontally).\nFor line charts, it is assumed that if a line has an undefined gap (from a\nnull point), then the line above it should have the same gap - insert zeros\ninstead of \"null\" if you want another behaviour. This also holds for the start\nand end of the chart. Note that stacking a mix of positive and negative values\nin most instances doesn't make sense (so it looks weird).\n\nTwo or more series are stacked when their \"stack\" attribute is set to the same\nkey (which can be any number or string or just \"true\"). To specify the default\nstack, you can set the stack option like this:\n\n series: {\n stack: null/false, true, or a key (number/string)\n }\n\nYou can also specify it for a single series, like this:\n\n $.plot( $(\"#placeholder\"), [{\n data: [ ... ],\n stack: true\n }])\n\nThe stacking order is determined by the order of the data series in the array\n(later series end up on top of the previous).\n\nInternally, the plugin modifies the datapoints in each series, adding an\noffset to the y value. For line series, extra data points are inserted through\ninterpolation. If there's a second y value, it's also adjusted (e.g for bar\ncharts or filled areas).\n\n*/\n\n(function ($) {\n var options = {\n series: { stack: null } // or number/string\n };\n\n function init(plot) {\n function findMatchingSeries(s, allseries) {\n var res = null;\n for (var i = 0; i < allseries.length; ++i) {\n if (s == allseries[i])\n break;\n\n if (allseries[i].stack == s.stack)\n res = allseries[i];\n }\n\n return res;\n }\n\n function stackData(plot, s, datapoints) {\n if (s.stack == null || s.stack === false)\n return;\n\n var other = findMatchingSeries(s, plot.getData());\n if (!other)\n return;\n\n var ps = datapoints.pointsize,\n points = datapoints.points,\n otherps = other.datapoints.pointsize,\n otherpoints = other.datapoints.points,\n newpoints = [],\n px, py, intery, qx, qy, bottom,\n withlines = s.lines.show,\n horizontal = s.bars.horizontal,\n withbottom = ps > 2 && (horizontal ? datapoints.format[2].x : datapoints.format[2].y),\n withsteps = withlines && s.lines.steps,\n keyOffset = horizontal ? 1 : 0,\n accumulateOffset = horizontal ? 0 : 1,\n i = 0, j = 0, l, m;\n\n while (true) {\n if (i >= points.length && j >= otherpoints.length)\n break;\n\n l = newpoints.length;\n\n if (i < points.length && points[i] == null) {\n // copy gaps\n for (m = 0; m < ps; ++m)\n newpoints.push(points[i + m]);\n i += ps;\n }\n else if (i >= points.length) {\n // take the remaining points from the previous series\n for (m = 0; m < ps; ++m)\n newpoints.push(otherpoints[j + m]);\n if (withbottom)\n newpoints[l + 2] = otherpoints[j + accumulateOffset];\n j += otherps;\n }\n else if (j >= otherpoints.length) {\n // take the remaining points from the current series\n for (m = 0; m < ps; ++m)\n newpoints.push(points[i + m]);\n i += ps;\n }\n else if (j < otherpoints.length && otherpoints[j] == null) {\n // ignore point\n j += otherps;\n }\n else {\n // cases where we actually got two points\n px = points[i + keyOffset];\n py = points[i + accumulateOffset];\n qx = otherpoints[j + keyOffset];\n qy = otherpoints[j + accumulateOffset];\n bottom = 0;\n\n if (px == qx) {\n for (m = 0; m < ps; ++m)\n newpoints.push(points[i + m]);\n\n newpoints[l + accumulateOffset] += qy;\n bottom = qy;\n\n i += ps;\n j += otherps;\n }\n else if (px > qx) {\n // take the point from the previous series so that next series will correctly stack\n if (i == 0) {\n for (m = 0; m < ps; ++m)\n newpoints.push(otherpoints[j + m]);\n bottom = qy;\n }\n // we got past point below, might need to\n // insert interpolated extra point\n if (i > 0 && points[i - ps] != null) {\n intery = py + (points[i - ps + accumulateOffset] - py) * (qx - px) / (points[i - ps + keyOffset] - px);\n newpoints.push(qx);\n newpoints.push(intery + qy);\n for (m = 2; m < ps; ++m)\n newpoints.push(points[i + m]);\n bottom = qy;\n }\n\n j += otherps;\n }\n else { // px < qx\n for (m = 0; m < ps; ++m)\n newpoints.push(points[i + m]);\n\n // we might be able to interpolate a point below,\n // this can give us a better y\n if (j > 0 && otherpoints[j - otherps] != null)\n bottom = qy + (otherpoints[j - otherps + accumulateOffset] - qy) * (px - qx) / (otherpoints[j - otherps + keyOffset] - qx);\n\n newpoints[l + accumulateOffset] += bottom;\n\n i += ps;\n }\n\n fromgap = false;\n\n if (l != newpoints.length && withbottom)\n newpoints[l + 2] = bottom;\n }\n\n // maintain the line steps invariant\n if (withsteps && l != newpoints.length && l > 0\n && newpoints[l] != null\n && newpoints[l] != newpoints[l - ps]\n && newpoints[l + 1] != newpoints[l - ps + 1]) {\n for (m = 0; m < ps; ++m)\n newpoints[l + ps + m] = newpoints[l + m];\n newpoints[l + 1] = newpoints[l - ps + 1];\n }\n }\n\n datapoints.points = newpoints;\n }\n\n plot.hooks.processDatapoints.push(stackData);\n }\n\n $.plot.plugins.push({\n init: init,\n options: options,\n name: 'stack',\n version: '1.2'\n });\n})(jQuery);\n\n\n/***/ }),\n\n/***/ 2009:\n/***/ (function(module, exports) {\n\n(function ($) {\n var options = {\n series: {\n stackpercent: null\n } // or number/string\n };\n\n function init(plot) {\n\n // will be built up dynamically as a hash from x-value, or y-value if horizontal\n var stackBases = {};\n var processed = false;\n var stackSums = {};\n\n //set percentage for stacked chart\n function processRawData(plot, series, data, datapoints) {\n if (!processed) {\n processed = true;\n stackSums = getStackSums(plot.getData());\n }\n\t\t\tif (series.stackpercent == true) {\n\t\t\t\tvar num = data.length;\n\t\t\t\tseries.percents = [];\n\t\t\t\tvar key_idx = 0;\n\t\t\t\tvar value_idx = 1;\n\t\t\t\tif (series.bars && series.bars.horizontal && series.bars.horizontal === true) {\n\t\t\t\t\tkey_idx = 1;\n\t\t\t\t\tvalue_idx = 0;\n\t\t\t\t}\n\t\t\t\tfor (var j = 0; j < num; j++) {\n\t\t\t\t\tvar sum = stackSums[data[j][key_idx] + \"\"];\n\t\t\t\t\tif (sum > 0) {\n\t\t\t\t\t\tseries.percents.push(data[j][value_idx] * 100 / sum);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tseries.percents.push(0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n }\n\n //calculate summary\n function getStackSums(_data) {\n var data_len = _data.length;\n var sums = {};\n if (data_len > 0) {\n //caculate summary\n for (var i = 0; i < data_len; i++) {\n if (_data[i].stackpercent) {\n\t\t\t\t\t\tvar key_idx = 0;\n\t\t\t\t\t\tvar value_idx = 1;\n\t\t\t\t\t\tif (_data[i].bars && _data[i].bars.horizontal && _data[i].bars.horizontal === true) {\n\t\t\t\t\t\t\tkey_idx = 1;\n\t\t\t\t\t\t\tvalue_idx = 0;\n\t\t\t\t\t\t}\n var num = _data[i].data.length;\n for (var j = 0; j < num; j++) {\n var value = 0;\n if (_data[i].data[j][1] != null) {\n value = _data[i].data[j][value_idx];\n }\n if (sums[_data[i].data[j][key_idx] + \"\"]) {\n sums[_data[i].data[j][key_idx] + \"\"] += value;\n } else {\n sums[_data[i].data[j][key_idx] + \"\"] = value;\n }\n\n }\n }\n }\n }\n return sums;\n }\n\n function stackData(plot, s, datapoints) {\n if (!s.stackpercent) return;\n if (!processed) {\n stackSums = getStackSums(plot.getData());\n }\n var newPoints = [];\n\n\n\t\t\tvar key_idx = 0;\n\t\t\tvar value_idx = 1;\n\t\t\tif (s.bars && s.bars.horizontal && s.bars.horizontal === true) {\n\t\t\t\tkey_idx = 1;\n\t\t\t\tvalue_idx = 0;\n\t\t\t}\n\n\t\t\tfor (var i = 0; i < datapoints.points.length; i += 3) {\n\t\t\t\t// note that the values need to be turned into absolute y-values.\n\t\t\t\t// in other words, if you were to stack (x, y1), (x, y2), and (x, y3),\n\t\t\t\t// (each from different series, which is where stackBases comes in),\n\t\t\t\t// you'd want the new points to be (x, y1, 0), (x, y1+y2, y1), (x, y1+y2+y3, y1+y2)\n\t\t\t\t// generally, (x, thisValue + (base up to this point), + (base up to this point))\n\t\t\t\tif (!stackBases[datapoints.points[i + key_idx]]) {\n\t\t\t\t\tstackBases[datapoints.points[i + key_idx]] = 0;\n\t\t\t\t}\n\t\t\t\tnewPoints[i + key_idx] = datapoints.points[i + key_idx];\n\t\t\t\tnewPoints[i + value_idx] = datapoints.points[i + value_idx] + stackBases[datapoints.points[i + key_idx]];\n\t\t\t\tnewPoints[i + 2] = stackBases[datapoints.points[i + key_idx]];\n\t\t\t\tstackBases[datapoints.points[i + key_idx]] += datapoints.points[i + value_idx];\n\t\t\t\t// change points to percentage values\n\t\t\t\t// you may need to set yaxis:{ max = 100 }\n\t\t\t\tif ( stackSums[newPoints[i+key_idx]+\"\"] > 0 ){\n\t\t\t\t\tnewPoints[i + value_idx] = newPoints[i + value_idx] * 100 / stackSums[newPoints[i + key_idx] + \"\"];\n\t\t\t\t\tnewPoints[i + 2] = newPoints[i + 2] * 100 / stackSums[newPoints[i + key_idx] + \"\"];\n\t\t\t\t} else {\n\t\t\t\t\tnewPoints[i + value_idx] = 0;\n\t\t\t\t\tnewPoints[i + 2] = 0;\n\t\t\t\t}\n\t\t\t}\n\n datapoints.points = newPoints;\n }\n\n\t\tplot.hooks.processRawData.push(processRawData);\n plot.hooks.processDatapoints.push(stackData);\n }\n\n $.plot.plugins.push({\n init: init,\n options: options,\n name: 'stackpercent',\n version: '0.1'\n });\n})(jQuery);\n\n\n/***/ }),\n\n/***/ 2010:\n/***/ (function(module, exports) {\n\n(function($) {\n \"use strict\";\n\n var options = {\n series: {\n fillBelowTo: null\n }\n };\n\n function init(plot) {\n function findBelowSeries( series, allseries ) {\n\n var i;\n\n for ( i = 0; i < allseries.length; ++i ) {\n if ( allseries[ i ].id === series.fillBelowTo ) {\n return allseries[ i ];\n }\n }\n\n return null;\n }\n\n /* top and bottom doesn't actually matter for this, we're just using it to help make this easier to think about */\n /* this is a vector cross product operation */\n function segmentIntersection(top_left_x, top_left_y, top_right_x, top_right_y, bottom_left_x, bottom_left_y, bottom_right_x, bottom_right_y) {\n var top_delta_x, top_delta_y, bottom_delta_x, bottom_delta_y,\n s, t;\n\n top_delta_x = top_right_x - top_left_x;\n top_delta_y = top_right_y - top_left_y;\n bottom_delta_x = bottom_right_x - bottom_left_x;\n bottom_delta_y = bottom_right_y - bottom_left_y;\n\n s = (\n (-top_delta_y * (top_left_x - bottom_left_x)) + (top_delta_x * (top_left_y - bottom_left_y))\n ) / (\n -bottom_delta_x * top_delta_y + top_delta_x * bottom_delta_y\n );\n\n t = (\n (bottom_delta_x * (top_left_y - bottom_left_y)) - (bottom_delta_y * (top_left_x - bottom_left_x))\n ) / (\n -bottom_delta_x * top_delta_y + top_delta_x * bottom_delta_y\n );\n\n // Collision detected\n if (s >= 0 && s <= 1 && t >= 0 && t <= 1) {\n return [\n top_left_x + (t * top_delta_x), // X\n top_left_y + (t * top_delta_y) // Y\n ];\n }\n\n // No collision\n return null;\n }\n\n function plotDifferenceArea(plot, ctx, series) {\n if ( series.fillBelowTo === null ) {\n return;\n }\n\n var otherseries,\n\n ps,\n points,\n\n otherps,\n otherpoints,\n\n plotOffset,\n fillStyle;\n\n function openPolygon(x, y) {\n ctx.beginPath();\n ctx.moveTo(\n series.xaxis.p2c(x) + plotOffset.left,\n series.yaxis.p2c(y) + plotOffset.top\n );\n\n }\n\n function closePolygon() {\n ctx.closePath();\n ctx.fill();\n }\n\n function validateInput() {\n if (points.length/ps !== otherpoints.length/otherps) {\n console.error(\"Refusing to graph inconsistent number of points\");\n return false;\n }\n\n var i;\n for (i = 0; i < (points.length / ps); i++) {\n if (\n points[i * ps] !== null &&\n otherpoints[i * otherps] !== null &&\n points[i * ps] !== otherpoints[i * otherps]\n ) {\n console.error(\"Refusing to graph points without matching value\");\n return false;\n }\n }\n\n return true;\n }\n\n function findNextStart(start_i, end_i) {\n console.assert(end_i > start_i, \"expects the end index to be greater than the start index\");\n\n var start = (\n start_i === 0 ||\n points[start_i - 1] === null ||\n otherpoints[start_i - 1] === null\n ),\n equal = false,\n i,\n intersect;\n\n for (i = start_i; i < end_i; i++) {\n // Take note of null points\n if (\n points[(i * ps) + 1] === null ||\n otherpoints[(i * ps) + 1] === null\n ) {\n equal = false;\n start = true;\n }\n\n // Take note of equal points\n else if (points[(i * ps) + 1] === otherpoints[(i * otherps) + 1]) {\n equal = true;\n start = false;\n }\n\n\n else if (points[(i * ps) + 1] > otherpoints[(i * otherps) + 1]) {\n // If we begin above the desired point\n if (start) {\n openPolygon(points[i * ps], points[(i * ps) + 1]);\n }\n\n // If an equal point preceeds this, start the polygon at that equal point\n else if (equal) {\n openPolygon(points[(i - 1) * ps], points[((i - 1) * ps) + 1]);\n }\n\n // Otherwise, find the intersection point, and start it there\n else {\n intersect = intersectionPoint(i);\n openPolygon(intersect[0], intersect[1]);\n }\n\n topTraversal(i, end_i);\n return;\n }\n\n // If we go below equal, equal at any preceeding point is irrelevant\n else {\n start = false;\n equal = false;\n }\n }\n }\n\n function intersectionPoint(right_i) {\n console.assert(right_i > 0, \"expects the second point in the series line segment\");\n\n var i, intersect;\n\n for (i = 1; i < (otherpoints.length/otherps); i++) {\n intersect = segmentIntersection(\n points[(right_i - 1) * ps], points[((right_i - 1) * ps) + 1],\n points[right_i * ps], points[(right_i * ps) + 1],\n\n otherpoints[(i - 1) * otherps], otherpoints[((i - 1) * otherps) + 1],\n otherpoints[i * otherps], otherpoints[(i * otherps) + 1]\n );\n\n if (intersect !== null) {\n return intersect;\n }\n }\n\n console.error(\"intersectionPoint() should only be called when an intersection happens\");\n }\n\n function bottomTraversal(start_i, end_i) {\n console.assert(start_i >= end_i, \"the start should be the rightmost point, and the end should be the leftmost (excluding the equal or intersecting point)\");\n\n var i;\n\n for (i = start_i; i >= end_i; i--) {\n ctx.lineTo(\n otherseries.xaxis.p2c(otherpoints[i * otherps]) + plotOffset.left,\n otherseries.yaxis.p2c(otherpoints[(i * otherps) + 1]) + plotOffset.top\n );\n }\n\n closePolygon();\n }\n\n function topTraversal(start_i, end_i) {\n console.assert(start_i <= end_i, \"the start should be the rightmost point, and the end should be the leftmost (excluding the equal or intersecting point)\");\n\n var i,\n intersect;\n\n for (i = start_i; i < end_i; i++) {\n if (points[(i * ps) + 1] === null && i > start_i) {\n bottomTraversal(i - 1, start_i);\n findNextStart(i, end_i);\n return;\n }\n\n else if (points[(i * ps) + 1] === otherpoints[(i * otherps) + 1]) {\n bottomTraversal(i, start_i);\n findNextStart(i, end_i);\n return;\n }\n\n else if (points[(i * ps) + 1] < otherpoints[(i * otherps) + 1]) {\n intersect = intersectionPoint(i);\n ctx.lineTo(\n series.xaxis.p2c(intersect[0]) + plotOffset.left,\n series.yaxis.p2c(intersect[1]) + plotOffset.top\n );\n bottomTraversal(i, start_i);\n findNextStart(i, end_i);\n return;\n\n }\n\n else {\n ctx.lineTo(\n series.xaxis.p2c(points[i * ps]) + plotOffset.left,\n series.yaxis.p2c(points[(i * ps) + 1]) + plotOffset.top\n );\n }\n }\n\n bottomTraversal(end_i, start_i);\n }\n\n\n // Begin processing\n\n otherseries = findBelowSeries( series, plot.getData() );\n\n if ( !otherseries ) {\n return;\n }\n\n ps = series.datapoints.pointsize;\n points = series.datapoints.points;\n otherps = otherseries.datapoints.pointsize;\n otherpoints = otherseries.datapoints.points;\n plotOffset = plot.getPlotOffset();\n\n if (!validateInput()) {\n return;\n }\n\n\n // Flot's getFillStyle() should probably be exposed somewhere\n fillStyle = $.color.parse(series.color);\n fillStyle.a = 0.4;\n fillStyle.normalize();\n ctx.fillStyle = fillStyle.toString();\n\n\n // Begin recursive bi-directional traversal\n findNextStart(0, points.length/ps);\n }\n\n plot.hooks.drawSeries.push(plotDifferenceArea);\n }\n\n $.plot.plugins.push({\n init: init,\n options: options,\n name: \"fillbelow\",\n version: \"0.1.0\"\n });\n\n})(jQuery);\n\n\n/***/ }),\n\n/***/ 2011:\n/***/ (function(module, exports) {\n\n/* Flot plugin for showing crosshairs when the mouse hovers over the plot.\n\nCopyright (c) 2007-2014 IOLA and Ole Laursen.\nLicensed under the MIT license.\n\nThe plugin supports these options:\n\n\tcrosshair: {\n\t\tmode: null or \"x\" or \"y\" or \"xy\"\n\t\tcolor: color\n\t\tlineWidth: number\n\t}\n\nSet the mode to one of \"x\", \"y\" or \"xy\". The \"x\" mode enables a vertical\ncrosshair that lets you trace the values on the x axis, \"y\" enables a\nhorizontal crosshair and \"xy\" enables them both. \"color\" is the color of the\ncrosshair (default is \"rgba(170, 0, 0, 0.80)\"), \"lineWidth\" is the width of\nthe drawn lines (default is 1).\n\nThe plugin also adds four public methods:\n\n - setCrosshair( pos )\n\n Set the position of the crosshair. Note that this is cleared if the user\n moves the mouse. \"pos\" is in coordinates of the plot and should be on the\n form { x: xpos, y: ypos } (you can use x2/x3/... if you're using multiple\n axes), which is coincidentally the same format as what you get from a\n \"plothover\" event. If \"pos\" is null, the crosshair is cleared.\n\n - clearCrosshair()\n\n Clear the crosshair.\n\n - lockCrosshair(pos)\n\n Cause the crosshair to lock to the current location, no longer updating if\n the user moves the mouse. Optionally supply a position (passed on to\n setCrosshair()) to move it to.\n\n Example usage:\n\n\tvar myFlot = $.plot( $(\"#graph\"), ..., { crosshair: { mode: \"x\" } } };\n\t$(\"#graph\").bind( \"plothover\", function ( evt, position, item ) {\n\t\tif ( item ) {\n\t\t\t// Lock the crosshair to the data point being hovered\n\t\t\tmyFlot.lockCrosshair({\n\t\t\t\tx: item.datapoint[ 0 ],\n\t\t\t\ty: item.datapoint[ 1 ]\n\t\t\t});\n\t\t} else {\n\t\t\t// Return normal crosshair operation\n\t\t\tmyFlot.unlockCrosshair();\n\t\t}\n\t});\n\n - unlockCrosshair()\n\n Free the crosshair to move again after locking it.\n*/\n\n(function ($) {\n var options = {\n crosshair: {\n mode: null, // one of null, \"x\", \"y\" or \"xy\",\n color: \"rgba(170, 0, 0, 0.80)\",\n lineWidth: 1\n }\n };\n \n function init(plot) {\n // position of crosshair in pixels\n var crosshair = { x: -1, y: -1, locked: false };\n\n plot.setCrosshair = function setCrosshair(pos) {\n if (!pos)\n crosshair.x = -1;\n else {\n var o = plot.p2c(pos);\n crosshair.x = Math.max(0, Math.min(o.left, plot.width()));\n crosshair.y = Math.max(0, Math.min(o.top, plot.height()));\n }\n \n plot.triggerRedrawOverlay();\n };\n \n plot.clearCrosshair = plot.setCrosshair; // passes null for pos\n \n plot.lockCrosshair = function lockCrosshair(pos) {\n if (pos)\n plot.setCrosshair(pos);\n crosshair.locked = true;\n };\n\n plot.unlockCrosshair = function unlockCrosshair() {\n crosshair.locked = false;\n };\n\n function onMouseOut(e) {\n if (crosshair.locked)\n return;\n\n if (crosshair.x != -1) {\n crosshair.x = -1;\n plot.triggerRedrawOverlay();\n }\n }\n\n function onMouseMove(e) {\n if (crosshair.locked)\n return;\n \n if (plot.getSelection && plot.getSelection()) {\n crosshair.x = -1; // hide the crosshair while selecting\n return;\n }\n \n var offset = plot.offset();\n crosshair.x = Math.max(0, Math.min(e.pageX - offset.left, plot.width()));\n crosshair.y = Math.max(0, Math.min(e.pageY - offset.top, plot.height()));\n plot.triggerRedrawOverlay();\n }\n \n plot.hooks.bindEvents.push(function (plot, eventHolder) {\n if (!plot.getOptions().crosshair.mode)\n return;\n\n eventHolder.mouseout(onMouseOut);\n eventHolder.mousemove(onMouseMove);\n });\n\n plot.hooks.drawOverlay.push(function (plot, ctx) {\n var c = plot.getOptions().crosshair;\n if (!c.mode)\n return;\n\n var plotOffset = plot.getPlotOffset();\n \n ctx.save();\n ctx.translate(plotOffset.left, plotOffset.top);\n\n if (crosshair.x != -1) {\n var adj = plot.getOptions().crosshair.lineWidth % 2 ? 0.5 : 0;\n\n ctx.strokeStyle = c.color;\n ctx.lineWidth = c.lineWidth;\n ctx.lineJoin = \"round\";\n\n ctx.beginPath();\n if (c.mode.indexOf(\"x\") != -1) {\n var drawX = Math.floor(crosshair.x) + adj;\n ctx.moveTo(drawX, 0);\n ctx.lineTo(drawX, plot.height());\n }\n if (c.mode.indexOf(\"y\") != -1) {\n var drawY = Math.floor(crosshair.y) + adj;\n ctx.moveTo(0, drawY);\n ctx.lineTo(plot.width(), drawY);\n }\n ctx.stroke();\n }\n ctx.restore();\n });\n\n plot.hooks.shutdown.push(function (plot, eventHolder) {\n eventHolder.unbind(\"mouseout\", onMouseOut);\n eventHolder.unbind(\"mousemove\", onMouseMove);\n });\n }\n \n $.plot.plugins.push({\n init: init,\n options: options,\n name: 'crosshair',\n version: '1.0'\n });\n})(jQuery);\n\n\n/***/ }),\n\n/***/ 2012:\n/***/ (function(module, exports) {\n\n/*\n * jQuery.flot.dashes\n *\n * options = {\n * series: {\n * dashes: {\n *\n * // show\n * // default: false\n * // Whether to show dashes for the series.\n * show: ,\n *\n * // lineWidth\n * // default: 2\n * // The width of the dashed line in pixels.\n * lineWidth: ,\n *\n * // dashLength\n * // default: 10\n * // Controls the length of the individual dashes and the amount of\n * // space between them.\n * // If this is a number, the dashes and spaces will have that length.\n * // If this is an array, it is read as [ dashLength, spaceLength ]\n * dashLength: or \n * }\n * }\n * }\n */\n(function($){\n\n function init(plot) {\n\n plot.hooks.processDatapoints.push(function(plot, series, datapoints) {\n\n if (!series.dashes.show) return;\n\n plot.hooks.draw.push(function(plot, ctx) {\n\n var plotOffset = plot.getPlotOffset(),\n axisx = series.xaxis,\n axisy = series.yaxis;\n\n function plotDashes(xoffset, yoffset) {\n\n var points = datapoints.points,\n ps = datapoints.pointsize,\n prevx = null,\n prevy = null,\n dashRemainder = 0,\n dashOn = true,\n dashOnLength,\n dashOffLength;\n\n if (series.dashes.dashLength[0]) {\n dashOnLength = series.dashes.dashLength[0];\n if (series.dashes.dashLength[1]) {\n dashOffLength = series.dashes.dashLength[1];\n } else {\n dashOffLength = dashOnLength;\n }\n } else {\n dashOffLength = dashOnLength = series.dashes.dashLength;\n }\n\n ctx.beginPath();\n\n for (var i = ps; i < points.length; i += ps) {\n\n var x1 = points[i - ps],\n y1 = points[i - ps + 1],\n x2 = points[i],\n y2 = points[i + 1];\n\n if (x1 == null || x2 == null) continue;\n\n // clip with ymin\n if (y1 <= y2 && y1 < axisy.min) {\n if (y2 < axisy.min) continue; // line segment is outside\n // compute new intersection point\n x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;\n y1 = axisy.min;\n } else if (y2 <= y1 && y2 < axisy.min) {\n if (y1 < axisy.min) continue;\n x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;\n y2 = axisy.min;\n }\n\n // clip with ymax\n if (y1 >= y2 && y1 > axisy.max) {\n if (y2 > axisy.max) continue;\n x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;\n y1 = axisy.max;\n } else if (y2 >= y1 && y2 > axisy.max) {\n if (y1 > axisy.max) continue;\n x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;\n y2 = axisy.max;\n }\n\n // clip with xmin\n if (x1 <= x2 && x1 < axisx.min) {\n if (x2 < axisx.min) continue;\n y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;\n x1 = axisx.min;\n } else if (x2 <= x1 && x2 < axisx.min) {\n if (x1 < axisx.min) continue;\n y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;\n x2 = axisx.min;\n }\n\n // clip with xmax\n if (x1 >= x2 && x1 > axisx.max) {\n if (x2 > axisx.max) continue;\n y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;\n x1 = axisx.max;\n } else if (x2 >= x1 && x2 > axisx.max) {\n if (x1 > axisx.max) continue;\n y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;\n x2 = axisx.max;\n }\n\n if (x1 != prevx || y1 != prevy) {\n ctx.moveTo(axisx.p2c(x1) + xoffset, axisy.p2c(y1) + yoffset);\n }\n\n var ax1 = axisx.p2c(x1) + xoffset,\n ay1 = axisy.p2c(y1) + yoffset,\n ax2 = axisx.p2c(x2) + xoffset,\n ay2 = axisy.p2c(y2) + yoffset,\n dashOffset;\n\n function lineSegmentOffset(segmentLength) {\n\n var c = Math.sqrt(Math.pow(ax2 - ax1, 2) + Math.pow(ay2 - ay1, 2));\n\n if (c <= segmentLength) {\n return {\n deltaX: ax2 - ax1,\n deltaY: ay2 - ay1,\n distance: c,\n remainder: segmentLength - c\n }\n } else {\n var xsign = ax2 > ax1 ? 1 : -1,\n ysign = ay2 > ay1 ? 1 : -1;\n return {\n deltaX: xsign * Math.sqrt(Math.pow(segmentLength, 2) / (1 + Math.pow((ay2 - ay1)/(ax2 - ax1), 2))),\n deltaY: ysign * Math.sqrt(Math.pow(segmentLength, 2) - Math.pow(segmentLength, 2) / (1 + Math.pow((ay2 - ay1)/(ax2 - ax1), 2))),\n distance: segmentLength,\n remainder: 0\n };\n }\n }\n //-end lineSegmentOffset\n\n do {\n\n dashOffset = lineSegmentOffset(\n dashRemainder > 0 ? dashRemainder :\n dashOn ? dashOnLength : dashOffLength);\n\n if (dashOffset.deltaX != 0 || dashOffset.deltaY != 0) {\n if (dashOn) {\n ctx.lineTo(ax1 + dashOffset.deltaX, ay1 + dashOffset.deltaY);\n } else {\n ctx.moveTo(ax1 + dashOffset.deltaX, ay1 + dashOffset.deltaY);\n }\n }\n\n dashOn = !dashOn;\n dashRemainder = dashOffset.remainder;\n ax1 += dashOffset.deltaX;\n ay1 += dashOffset.deltaY;\n\n } while (dashOffset.distance > 0);\n\n prevx = x2;\n prevy = y2;\n }\n\n ctx.stroke();\n }\n //-end plotDashes\n\n ctx.save();\n ctx.translate(plotOffset.left, plotOffset.top);\n ctx.lineJoin = 'round';\n\n var lw = series.dashes.lineWidth,\n sw = series.shadowSize;\n\n // FIXME: consider another form of shadow when filling is turned on\n if (lw > 0 && sw > 0) {\n // draw shadow as a thick and thin line with transparency\n ctx.lineWidth = sw;\n ctx.strokeStyle = \"rgba(0,0,0,0.1)\";\n // position shadow at angle from the mid of line\n var angle = Math.PI/18;\n plotDashes(Math.sin(angle) * (lw/2 + sw/2), Math.cos(angle) * (lw/2 + sw/2));\n ctx.lineWidth = sw/2;\n plotDashes(Math.sin(angle) * (lw/2 + sw/4), Math.cos(angle) * (lw/2 + sw/4));\n }\n\n ctx.lineWidth = lw;\n ctx.strokeStyle = series.color;\n\n if (lw > 0) {\n plotDashes(0, 0);\n }\n\n ctx.restore();\n\n });\n //-end draw hook\n\n });\n //-end processDatapoints hook\n\n }\n //-end init\n\n $.plot.plugins.push({\n init: init,\n options: {\n series: {\n dashes: {\n show: false,\n lineWidth: 2,\n dashLength: 10\n }\n }\n },\n name: 'dashes',\n version: '0.1'\n });\n\n})(jQuery)\n\n\n/***/ }),\n\n/***/ 2013:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = getColorScale;\n/* harmony export (immutable) */ __webpack_exports__[\"b\"] = getOpacityScale;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_d3__ = __webpack_require__(695);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_d3_scale_chromatic__ = __webpack_require__(710);\n\n\nfunction getColorScale(colorScheme, lightTheme, maxValue, minValue) {\n if (minValue === void 0) { minValue = 0; }\n var colorInterpolator = __WEBPACK_IMPORTED_MODULE_1_d3_scale_chromatic__[colorScheme.value];\n var colorScaleInverted = colorScheme.invert === 'always' || (colorScheme.invert === 'dark' && !lightTheme);\n var start = colorScaleInverted ? maxValue : minValue;\n var end = colorScaleInverted ? minValue : maxValue;\n return __WEBPACK_IMPORTED_MODULE_0_d3__[\"scaleSequential\"](colorInterpolator).domain([start, end]);\n}\nfunction getOpacityScale(options, maxValue, minValue) {\n if (minValue === void 0) { minValue = 0; }\n var legendOpacityScale;\n if (options.colorScale === 'linear') {\n legendOpacityScale = __WEBPACK_IMPORTED_MODULE_0_d3__[\"scaleLinear\"]()\n .domain([minValue, maxValue])\n .range([0, 1]);\n }\n else if (options.colorScale === 'sqrt') {\n legendOpacityScale = __WEBPACK_IMPORTED_MODULE_0_d3__[\"scalePow\"]()\n .exponent(options.exponent)\n .domain([minValue, maxValue])\n .range([0, 1]);\n }\n return legendOpacityScale;\n}\n\n\n/***/ }),\n\n/***/ 2014:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return transformers; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return transformDataToTable; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__core_utils_flatten__ = __webpack_require__(2000);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__core_time_series2__ = __webpack_require__(313);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__core_table_model__ = __webpack_require__(1987);\n\n\n\n\nvar transformers = {};\ntransformers['timeseries_to_rows'] = {\n description: 'Time series to rows',\n getColumns: function () {\n return [];\n },\n transform: function (data, panel, model) {\n model.columns = [{ text: 'Time', type: 'date' }, { text: 'Metric' }, { text: 'Value' }];\n for (var i = 0; i < data.length; i++) {\n var series = data[i];\n for (var y = 0; y < series.datapoints.length; y++) {\n var dp = series.datapoints[y];\n model.rows.push([dp[1], series.target, dp[0]]);\n }\n }\n },\n};\ntransformers['timeseries_to_columns'] = {\n description: 'Time series to columns',\n getColumns: function () {\n return [];\n },\n transform: function (data, panel, model) {\n model.columns.push({ text: 'Time', type: 'date' });\n // group by time\n var points = {};\n for (var i = 0; i < data.length; i++) {\n var series = data[i];\n model.columns.push({ text: series.target });\n for (var y = 0; y < series.datapoints.length; y++) {\n var dp = series.datapoints[y];\n var timeKey = dp[1].toString();\n if (!points[timeKey]) {\n points[timeKey] = { time: dp[1] };\n points[timeKey][i] = dp[0];\n }\n else {\n points[timeKey][i] = dp[0];\n }\n }\n }\n for (var time in points) {\n var point = points[time];\n var values = [point.time];\n for (var i = 0; i < data.length; i++) {\n var value = point[i];\n values.push(value);\n }\n model.rows.push(values);\n }\n },\n};\ntransformers['timeseries_aggregations'] = {\n description: 'Time series aggregations',\n getColumns: function () {\n return [\n { text: 'Avg', value: 'avg' },\n { text: 'Min', value: 'min' },\n { text: 'Max', value: 'max' },\n { text: 'Total', value: 'total' },\n { text: 'Current', value: 'current' },\n { text: 'Count', value: 'count' },\n ];\n },\n transform: function (data, panel, model) {\n var i, y;\n model.columns.push({ text: 'Metric' });\n for (i = 0; i < panel.columns.length; i++) {\n model.columns.push({ text: panel.columns[i].text });\n }\n for (i = 0; i < data.length; i++) {\n var series = new __WEBPACK_IMPORTED_MODULE_2__core_time_series2__[\"a\" /* default */]({\n datapoints: data[i].datapoints,\n alias: data[i].target,\n });\n series.getFlotPairs('connected');\n var cells = [series.alias];\n for (y = 0; y < panel.columns.length; y++) {\n cells.push(series.stats[panel.columns[y].value]);\n }\n model.rows.push(cells);\n }\n },\n};\ntransformers['annotations'] = {\n description: 'Annotations',\n getColumns: function () {\n return [];\n },\n transform: function (data, panel, model) {\n model.columns.push({ text: 'Time', type: 'date' });\n model.columns.push({ text: 'Title' });\n model.columns.push({ text: 'Text' });\n model.columns.push({ text: 'Tags' });\n if (!data || !data.annotations || data.annotations.length === 0) {\n return;\n }\n for (var i = 0; i < data.annotations.length; i++) {\n var evt = data.annotations[i];\n model.rows.push([evt.time, evt.title, evt.text, evt.tags]);\n }\n },\n};\ntransformers['table'] = {\n description: 'Table',\n getColumns: function (data) {\n if (!data || data.length === 0) {\n return [];\n }\n // Single query returns data columns as is\n if (data.length === 1) {\n return data[0].columns.slice();\n }\n // Track column indexes: name -> index\n var columnNames = {};\n // Union of all columns\n var columns = data.reduce(function (acc, series) {\n series.columns.forEach(function (col) {\n var text = col.text;\n if (columnNames[text] === undefined) {\n columnNames[text] = acc.length;\n acc.push(col);\n }\n });\n return acc;\n }, []);\n return columns;\n },\n transform: function (data, panel, model) {\n if (!data || data.length === 0) {\n return;\n }\n var noTableIndex = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.findIndex(data, function (d) { return d.type !== 'table'; });\n if (noTableIndex > -1) {\n throw {\n message: \"Result of query #\" + String.fromCharCode(65 + noTableIndex) + \" is not in table format, try using another transform.\",\n };\n }\n // Single query returns data columns and rows as is\n if (data.length === 1) {\n model.columns = data[0].columns.slice();\n model.rows = data[0].rows.slice();\n return;\n }\n // Track column indexes of union: name -> index\n var columnNames = {};\n // Union of all non-value columns\n var columnsUnion = data.reduce(function (acc, series) {\n series.columns.forEach(function (col) {\n var text = col.text;\n if (columnNames[text] === undefined) {\n columnNames[text] = acc.length;\n acc.push(col);\n }\n });\n return acc;\n }, []);\n // Map old column index to union index per series, e.g.,\n // given columnNames {A: 0, B: 1} and\n // data [{columns: [{ text: 'A' }]}, {columns: [{ text: 'B' }]}] => [[0], [1]]\n var columnIndexMapper = data.map(function (series) { return series.columns.map(function (col) { return columnNames[col.text]; }); });\n // Flatten rows of all series and adjust new column indexes\n var flattenedRows = data.reduce(function (acc, series, seriesIndex) {\n var mapper = columnIndexMapper[seriesIndex];\n series.rows.forEach(function (row) {\n var alteredRow = [];\n // Shifting entries according to index mapper\n mapper.forEach(function (to, from) {\n alteredRow[to] = row[from];\n });\n acc.push(alteredRow);\n });\n return acc;\n }, []);\n // Returns true if both rows have matching non-empty fields as well as matching\n // indexes where one field is empty and the other is not\n function areRowsMatching(columns, row, otherRow) {\n var foundFieldToMatch = false;\n for (var columnIndex = 0; columnIndex < columns.length; columnIndex++) {\n if (row[columnIndex] !== undefined && otherRow[columnIndex] !== undefined) {\n if (row[columnIndex] !== otherRow[columnIndex]) {\n return false;\n }\n }\n else if (row[columnIndex] === undefined || otherRow[columnIndex] === undefined) {\n foundFieldToMatch = true;\n }\n }\n return foundFieldToMatch;\n }\n // Merge rows that have same values for columns\n var mergedRows = {};\n var compactedRows = flattenedRows.reduce(function (acc, row, rowIndex) {\n if (!mergedRows[rowIndex]) {\n // Look from current row onwards\n var offset = rowIndex + 1;\n // More than one row can be merged into current row\n while (offset < flattenedRows.length) {\n // Find next row that could be merged\n var match = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.findIndex(flattenedRows, function (otherRow) { return areRowsMatching(columnsUnion, row, otherRow); }, offset);\n if (match > -1) {\n var matchedRow = flattenedRows[match];\n // Merge values from match into current row if there is a gap in the current row\n for (var columnIndex = 0; columnIndex < columnsUnion.length; columnIndex++) {\n if (row[columnIndex] === undefined && matchedRow[columnIndex] !== undefined) {\n row[columnIndex] = matchedRow[columnIndex];\n }\n }\n // Don't visit this row again\n mergedRows[match] = matchedRow;\n // Keep looking for more rows to merge\n offset = match + 1;\n }\n else {\n // No match found, stop looking\n break;\n }\n }\n acc.push(row);\n }\n return acc;\n }, []);\n model.columns = columnsUnion;\n model.rows = compactedRows;\n },\n};\ntransformers['json'] = {\n description: 'JSON Data',\n getColumns: function (data) {\n if (!data || data.length === 0) {\n return [];\n }\n var names = {};\n for (var i = 0; i < data.length; i++) {\n var series = data[i];\n if (series.type !== 'docs') {\n continue;\n }\n // only look at 100 docs\n var maxDocs = Math.min(series.datapoints.length, 100);\n for (var y = 0; y < maxDocs; y++) {\n var doc = series.datapoints[y];\n var flattened = Object(__WEBPACK_IMPORTED_MODULE_1__core_utils_flatten__[\"default\"])(doc, null);\n for (var propName in flattened) {\n names[propName] = true;\n }\n }\n }\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(names, function (value, key) {\n return { text: key, value: key };\n });\n },\n transform: function (data, panel, model) {\n var i, y, z;\n for (var _i = 0, _a = panel.columns; _i < _a.length; _i++) {\n var column = _a[_i];\n var tableCol = { text: column.text };\n // if filterable data then set columns to filterable\n if (data.length > 0 && data[0].filterable) {\n tableCol.filterable = true;\n }\n model.columns.push(tableCol);\n }\n if (model.columns.length === 0) {\n model.columns.push({ text: 'JSON' });\n }\n for (i = 0; i < data.length; i++) {\n var series = data[i];\n for (y = 0; y < series.datapoints.length; y++) {\n var dp = series.datapoints[y];\n var values = [];\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isObject(dp) && panel.columns.length > 0) {\n var flattened = Object(__WEBPACK_IMPORTED_MODULE_1__core_utils_flatten__[\"default\"])(dp, null);\n for (z = 0; z < panel.columns.length; z++) {\n values.push(flattened[panel.columns[z].value]);\n }\n }\n else {\n values.push(JSON.stringify(dp));\n }\n model.rows.push(values);\n }\n }\n },\n};\nfunction transformDataToTable(data, panel) {\n var model = new __WEBPACK_IMPORTED_MODULE_3__core_table_model__[\"a\" /* default */]();\n if (!data || data.length === 0) {\n return model;\n }\n var transformer = transformers[panel.transform];\n if (!transformer) {\n throw { message: 'Transformer ' + panel.transform + ' not found' };\n }\n transformer.transform(data, panel, model);\n return model;\n}\n\n\n\n/***/ }),\n\n/***/ 2015:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nexports.isArrayLike = (function (x) { return x && typeof x.length === 'number'; });\n//# sourceMappingURL=isArrayLike.js.map\n\n/***/ }),\n\n/***/ 2016:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nfunction isPromise(value) {\n return value && typeof value.subscribe !== 'function' && typeof value.then === 'function';\n}\nexports.isPromise = isPromise;\n//# sourceMappingURL=isPromise.js.map\n\n/***/ }),\n\n/***/ 2017:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Observable_1 = __webpack_require__(690);\nvar ScalarObservable_1 = __webpack_require__(2018);\nvar EmptyObservable_1 = __webpack_require__(1992);\nvar isScheduler_1 = __webpack_require__(2182);\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar ArrayObservable = (function (_super) {\n __extends(ArrayObservable, _super);\n function ArrayObservable(array, scheduler) {\n _super.call(this);\n this.array = array;\n this.scheduler = scheduler;\n if (!scheduler && array.length === 1) {\n this._isScalar = true;\n this.value = array[0];\n }\n }\n ArrayObservable.create = function (array, scheduler) {\n return new ArrayObservable(array, scheduler);\n };\n /**\n * Creates an Observable that emits some values you specify as arguments,\n * immediately one after the other, and then emits a complete notification.\n *\n * Emits the arguments you provide, then completes.\n * \n *\n * \n *\n * This static operator is useful for creating a simple Observable that only\n * emits the arguments given, and the complete notification thereafter. It can\n * be used for composing with other Observables, such as with {@link concat}.\n * By default, it uses a `null` IScheduler, which means the `next`\n * notifications are sent synchronously, although with a different IScheduler\n * it is possible to determine when those notifications will be delivered.\n *\n * @example Emit 10, 20, 30, then 'a', 'b', 'c', then start ticking every second.\n * var numbers = Rx.Observable.of(10, 20, 30);\n * var letters = Rx.Observable.of('a', 'b', 'c');\n * var interval = Rx.Observable.interval(1000);\n * var result = numbers.concat(letters).concat(interval);\n * result.subscribe(x => console.log(x));\n *\n * @see {@link create}\n * @see {@link empty}\n * @see {@link never}\n * @see {@link throw}\n *\n * @param {...T} values Arguments that represent `next` values to be emitted.\n * @param {Scheduler} [scheduler] A {@link IScheduler} to use for scheduling\n * the emissions of the `next` notifications.\n * @return {Observable} An Observable that emits each given input value.\n * @static true\n * @name of\n * @owner Observable\n */\n ArrayObservable.of = function () {\n var array = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n array[_i - 0] = arguments[_i];\n }\n var scheduler = array[array.length - 1];\n if (isScheduler_1.isScheduler(scheduler)) {\n array.pop();\n }\n else {\n scheduler = null;\n }\n var len = array.length;\n if (len > 1) {\n return new ArrayObservable(array, scheduler);\n }\n else if (len === 1) {\n return new ScalarObservable_1.ScalarObservable(array[0], scheduler);\n }\n else {\n return new EmptyObservable_1.EmptyObservable(scheduler);\n }\n };\n ArrayObservable.dispatch = function (state) {\n var array = state.array, index = state.index, count = state.count, subscriber = state.subscriber;\n if (index >= count) {\n subscriber.complete();\n return;\n }\n subscriber.next(array[index]);\n if (subscriber.closed) {\n return;\n }\n state.index = index + 1;\n this.schedule(state);\n };\n /** @deprecated internal use only */ ArrayObservable.prototype._subscribe = function (subscriber) {\n var index = 0;\n var array = this.array;\n var count = array.length;\n var scheduler = this.scheduler;\n if (scheduler) {\n return scheduler.schedule(ArrayObservable.dispatch, 0, {\n array: array, index: index, count: count, subscriber: subscriber\n });\n }\n else {\n for (var i = 0; i < count && !subscriber.closed; i++) {\n subscriber.next(array[i]);\n }\n subscriber.complete();\n }\n };\n return ArrayObservable;\n}(Observable_1.Observable));\nexports.ArrayObservable = ArrayObservable;\n//# sourceMappingURL=ArrayObservable.js.map\n\n/***/ }),\n\n/***/ 2018:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Observable_1 = __webpack_require__(690);\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar ScalarObservable = (function (_super) {\n __extends(ScalarObservable, _super);\n function ScalarObservable(value, scheduler) {\n _super.call(this);\n this.value = value;\n this.scheduler = scheduler;\n this._isScalar = true;\n if (scheduler) {\n this._isScalar = false;\n }\n }\n ScalarObservable.create = function (value, scheduler) {\n return new ScalarObservable(value, scheduler);\n };\n ScalarObservable.dispatch = function (state) {\n var done = state.done, value = state.value, subscriber = state.subscriber;\n if (done) {\n subscriber.complete();\n return;\n }\n subscriber.next(value);\n if (subscriber.closed) {\n return;\n }\n state.done = true;\n this.schedule(state);\n };\n /** @deprecated internal use only */ ScalarObservable.prototype._subscribe = function (subscriber) {\n var value = this.value;\n var scheduler = this.scheduler;\n if (scheduler) {\n return scheduler.schedule(ScalarObservable.dispatch, 0, {\n done: false, value: value, subscriber: subscriber\n });\n }\n else {\n subscriber.next(value);\n if (!subscriber.closed) {\n subscriber.complete();\n }\n }\n };\n return ScalarObservable;\n}(Observable_1.Observable));\nexports.ScalarObservable = ScalarObservable;\n//# sourceMappingURL=ScalarObservable.js.map\n\n/***/ }),\n\n/***/ 2019:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return FolderPageLoader; });\nvar FolderPageLoader = /** @class */ (function () {\n function FolderPageLoader(backendSrv) {\n this.backendSrv = backendSrv;\n }\n FolderPageLoader.prototype.load = function (ctrl, uid, activeChildId) {\n ctrl.navModel = {\n main: {\n icon: 'fa fa-folder-open',\n id: 'manage-folder',\n subTitle: 'Manage folder dashboards & permissions',\n url: '',\n text: '',\n breadcrumbs: [{ title: 'Dashboards', url: 'dashboards' }],\n children: [\n {\n active: activeChildId === 'manage-folder-dashboards',\n icon: 'fa fa-fw fa-th-large',\n id: 'manage-folder-dashboards',\n text: 'Dashboards',\n url: 'dashboards',\n },\n {\n active: activeChildId === 'manage-folder-permissions',\n icon: 'fa fa-fw fa-lock',\n id: 'manage-folder-permissions',\n text: 'Permissions',\n url: 'dashboards/permissions',\n },\n {\n active: activeChildId === 'manage-folder-settings',\n icon: 'fa fa-fw fa-cog',\n id: 'manage-folder-settings',\n text: 'Settings',\n url: 'dashboards/settings',\n },\n ],\n },\n };\n return this.backendSrv.getFolderByUid(uid).then(function (folder) {\n ctrl.folderId = folder.id;\n var folderTitle = folder.title;\n var folderUrl = folder.url;\n ctrl.navModel.main.text = folderTitle;\n var dashTab = ctrl.navModel.main.children.find(function (child) { return child.id === 'manage-folder-dashboards'; });\n dashTab.url = folderUrl;\n if (folder.canAdmin) {\n var permTab = ctrl.navModel.main.children.find(function (child) { return child.id === 'manage-folder-permissions'; });\n permTab.url = folderUrl + '/permissions';\n var settingsTab = ctrl.navModel.main.children.find(function (child) { return child.id === 'manage-folder-settings'; });\n settingsTab.url = folderUrl + '/settings';\n }\n else {\n ctrl.navModel.main.children = [dashTab];\n }\n return folder;\n });\n };\n return FolderPageLoader;\n}());\n\n\n\n/***/ }),\n\n/***/ 2020:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export OrgUsersCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_config__ = __webpack_require__(23);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_core_module__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_remarkable__ = __webpack_require__(694);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_remarkable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_remarkable__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash__);\n\n\n\n\nvar OrgUsersCtrl = /** @class */ (function () {\n /** @ngInject */\n OrgUsersCtrl.$inject = [\"$scope\", \"backendSrv\", \"navModelSrv\", \"$sce\"];\n function OrgUsersCtrl($scope, backendSrv, navModelSrv, $sce) {\n this.$scope = $scope;\n this.backendSrv = backendSrv;\n this.navModel = navModelSrv.getNav('cfg', 'users', 0);\n this.get();\n this.externalUserMngLinkUrl = __WEBPACK_IMPORTED_MODULE_0_app_core_config__[\"a\" /* default */].externalUserMngLinkUrl;\n this.externalUserMngLinkName = __WEBPACK_IMPORTED_MODULE_0_app_core_config__[\"a\" /* default */].externalUserMngLinkName;\n this.canInvite = !__WEBPACK_IMPORTED_MODULE_0_app_core_config__[\"a\" /* default */].disableLoginForm && !__WEBPACK_IMPORTED_MODULE_0_app_core_config__[\"a\" /* default */].externalUserMngLinkName;\n // render external user management info markdown\n if (__WEBPACK_IMPORTED_MODULE_0_app_core_config__[\"a\" /* default */].externalUserMngInfo) {\n this.externalUserMngInfo = new __WEBPACK_IMPORTED_MODULE_2_remarkable___default.a({\n linkTarget: '__blank',\n }).render(__WEBPACK_IMPORTED_MODULE_0_app_core_config__[\"a\" /* default */].externalUserMngInfo);\n }\n }\n OrgUsersCtrl.prototype.get = function () {\n var _this = this;\n this.backendSrv.get('/api/org/users').then(function (users) {\n _this.users = users;\n _this.unfiltered = users;\n });\n this.backendSrv.get('/api/org/invites').then(function (pendingInvites) {\n _this.pendingInvites = pendingInvites;\n });\n };\n OrgUsersCtrl.prototype.onQueryUpdated = function () {\n var regex = new RegExp(this.searchQuery, 'ig');\n this.users = __WEBPACK_IMPORTED_MODULE_3_lodash___default.a.filter(this.unfiltered, function (item) {\n return regex.test(item.email) || regex.test(item.login);\n });\n };\n OrgUsersCtrl.prototype.updateOrgUser = function (user) {\n this.backendSrv.patch('/api/org/users/' + user.userId, user);\n };\n OrgUsersCtrl.prototype.removeUser = function (user) {\n var _this = this;\n this.$scope.appEvent('confirm-modal', {\n title: 'Delete',\n text: 'Are you sure you want to delete user ' + user.login + '?',\n yesText: 'Delete',\n icon: 'fa-warning',\n onConfirm: function () {\n _this.removeUserConfirmed(user);\n },\n });\n };\n OrgUsersCtrl.prototype.removeUserConfirmed = function (user) {\n this.backendSrv.delete('/api/org/users/' + user.userId).then(this.get.bind(this));\n };\n OrgUsersCtrl.prototype.revokeInvite = function (invite, evt) {\n evt.stopPropagation();\n this.backendSrv.patch('/api/org/invites/' + invite.code + '/revoke').then(this.get.bind(this));\n };\n OrgUsersCtrl.prototype.copyInviteToClipboard = function (evt) {\n evt.stopPropagation();\n };\n OrgUsersCtrl.prototype.getInviteUrl = function (invite) {\n return invite.url;\n };\n return OrgUsersCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_1_app_core_core_module__[\"a\" /* default */].controller('OrgUsersCtrl', OrgUsersCtrl);\n\n\n/***/ }),\n\n/***/ 2040:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export PanelLinksEditorCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__link_srv__ = __webpack_require__(1994);\n\n\n\nfunction panelLinksEditor() {\n return {\n scope: {\n panel: '=',\n },\n restrict: 'E',\n controller: 'PanelLinksEditorCtrl',\n templateUrl: 'public/app/features/panellinks/module.html',\n link: function () { },\n };\n}\nvar PanelLinksEditorCtrl = /** @class */ (function () {\n /** @ngInject */\n PanelLinksEditorCtrl.$inject = [\"$scope\", \"backendSrv\"];\n function PanelLinksEditorCtrl($scope, backendSrv) {\n $scope.panel.links = $scope.panel.links || [];\n $scope.addLink = function () {\n $scope.panel.links.push({\n type: 'dashboard',\n });\n };\n $scope.searchDashboards = function (queryStr, callback) {\n backendSrv.search({ query: queryStr }).then(function (hits) {\n var dashboards = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(hits, function (dash) {\n return dash.title;\n });\n callback(dashboards);\n });\n };\n $scope.dashboardChanged = function (link) {\n backendSrv.search({ query: link.dashboard }).then(function (hits) {\n var dashboard = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find(hits, { title: link.dashboard });\n if (dashboard) {\n link.dashUri = dashboard.uri;\n link.title = dashboard.title;\n }\n });\n };\n $scope.deleteLink = function (link) {\n $scope.panel.links = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.without($scope.panel.links, link);\n };\n }\n return PanelLinksEditorCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a\n .module('grafana.directives')\n .directive('panelLinksEditor', panelLinksEditor)\n .controller('PanelLinksEditorCtrl', PanelLinksEditorCtrl);\n\n\n/***/ }),\n\n/***/ 2041:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export DashLinksContainerCtrl */\n/* harmony import */ \ndashLink.$inject = [\"$compile\", \"$sanitize\", \"linkSrv\"];var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__editor__ = __webpack_require__(2042);\n\n\n\nfunction dashLinksContainer() {\n return {\n scope: {\n links: '=',\n },\n restrict: 'E',\n controller: 'DashLinksContainerCtrl',\n template: '',\n link: function () { },\n };\n}\n/** @ngInject */\nfunction dashLink($compile, $sanitize, linkSrv) {\n return {\n restrict: 'E',\n link: function (scope, elem) {\n var link = scope.link;\n var template = '
' +\n '' +\n ' ';\n if (link.asDropdown) {\n template +=\n '';\n }\n template += '
';\n elem.html(template);\n $compile(elem.contents())(scope);\n var anchor = elem.find('a');\n var icon = elem.find('i');\n var span = elem.find('span');\n function update() {\n var linkInfo = linkSrv.getAnchorInfo(link);\n span.text(linkInfo.title);\n if (!link.asDropdown) {\n anchor.attr('href', linkInfo.href);\n sanitizeAnchor();\n }\n elem.find('a').attr('data-placement', 'bottom');\n // tooltip\n elem.find('a').tooltip({\n title: $sanitize(scope.link.tooltip),\n html: true,\n container: 'body',\n });\n }\n function sanitizeAnchor() {\n var anchorSanitized = $sanitize(anchor.parent().html());\n anchor.parent().html(anchorSanitized);\n }\n icon.attr('class', 'fa fa-fw ' + scope.link.icon);\n anchor.attr('target', scope.link.target);\n // fix for menus on the far right\n if (link.asDropdown && scope.$last) {\n elem.find('.dropdown-menu').addClass('pull-right');\n }\n update();\n scope.$on('refresh', update);\n },\n };\n}\nvar DashLinksContainerCtrl = /** @class */ (function () {\n /** @ngInject */\n DashLinksContainerCtrl.$inject = [\"$scope\", \"$rootScope\", \"$q\", \"backendSrv\", \"dashboardSrv\", \"linkSrv\"];\n function DashLinksContainerCtrl($scope, $rootScope, $q, backendSrv, dashboardSrv, linkSrv) {\n var currentDashId = dashboardSrv.getCurrent().id;\n function buildLinks(linkDef) {\n if (linkDef.type === 'dashboards') {\n if (!linkDef.tags) {\n console.log('Dashboard link missing tag');\n return $q.when([]);\n }\n if (linkDef.asDropdown) {\n return $q.when([\n {\n title: linkDef.title,\n tags: linkDef.tags,\n keepTime: linkDef.keepTime,\n includeVars: linkDef.includeVars,\n target: linkDef.targetBlank ? '_blank' : '_self',\n icon: 'fa fa-bars',\n asDropdown: true,\n },\n ]);\n }\n return $scope.searchDashboards(linkDef, 7);\n }\n if (linkDef.type === 'link') {\n return $q.when([\n {\n url: linkDef.url,\n title: linkDef.title,\n icon: __WEBPACK_IMPORTED_MODULE_2__editor__[\"a\" /* iconMap */][linkDef.icon],\n tooltip: linkDef.tooltip,\n target: linkDef.targetBlank ? '_blank' : '_self',\n keepTime: linkDef.keepTime,\n includeVars: linkDef.includeVars,\n },\n ]);\n }\n return $q.when([]);\n }\n function updateDashLinks() {\n var promises = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map($scope.links, buildLinks);\n $q.all(promises).then(function (results) {\n $scope.generatedLinks = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.flatten(results);\n });\n }\n $scope.searchDashboards = function (link, limit) {\n return backendSrv.search({ tag: link.tags, limit: limit }).then(function (results) {\n return __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.reduce(results, function (memo, dash) {\n // do not add current dashboard\n if (dash.id !== currentDashId) {\n memo.push({\n title: dash.title,\n url: 'dashboard/' + dash.uri,\n target: link.target,\n icon: 'fa fa-th-large',\n keepTime: link.keepTime,\n includeVars: link.includeVars,\n });\n }\n return memo;\n }, []);\n });\n };\n $scope.fillDropdown = function (link) {\n $scope.searchDashboards(link, 100).then(function (results) {\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(results, function (hit) {\n hit.url = linkSrv.getLinkUrl(hit);\n });\n link.searchHits = results;\n });\n };\n updateDashLinks();\n $rootScope.onAppEvent('dash-links-updated', updateDashLinks, $scope);\n }\n return DashLinksContainerCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.directives').directive('dashLinksContainer', dashLinksContainer);\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.directives').directive('dashLink', dashLink);\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.directives').controller('DashLinksContainerCtrl', DashLinksContainerCtrl);\n\n\n/***/ }),\n\n/***/ 2042:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return iconMap; });\n/* unused harmony export DashLinkEditorCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n\n\nvar iconMap = {\n 'external link': 'fa-external-link',\n dashboard: 'fa-th-large',\n question: 'fa-question',\n info: 'fa-info',\n bolt: 'fa-bolt',\n doc: 'fa-file-text-o',\n cloud: 'fa-cloud',\n};\nvar DashLinkEditorCtrl = /** @class */ (function () {\n /** @ngInject */\n DashLinkEditorCtrl.$inject = [\"$scope\", \"$rootScope\"];\n function DashLinkEditorCtrl($scope, $rootScope) {\n this.iconMap = iconMap;\n this.dashboard.links = this.dashboard.links || [];\n this.mode = 'list';\n $scope.$on('$destroy', function () {\n $rootScope.appEvent('dash-links-updated');\n });\n }\n DashLinkEditorCtrl.prototype.backToList = function () {\n this.mode = 'list';\n };\n DashLinkEditorCtrl.prototype.setupNew = function () {\n this.mode = 'new';\n this.link = { type: 'dashboards', icon: 'external link' };\n };\n DashLinkEditorCtrl.prototype.addLink = function () {\n this.dashboard.links.push(this.link);\n this.mode = 'list';\n };\n DashLinkEditorCtrl.prototype.editLink = function (link) {\n this.link = link;\n this.mode = 'edit';\n console.log(this.link);\n };\n DashLinkEditorCtrl.prototype.saveLink = function () {\n this.backToList();\n };\n DashLinkEditorCtrl.prototype.moveLink = function (index, dir) {\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.move(this.dashboard.links, index, index + dir);\n };\n DashLinkEditorCtrl.prototype.deleteLink = function (index) {\n this.dashboard.links.splice(index, 1);\n this.dashboard.updateSubmenuVisibility();\n };\n return DashLinkEditorCtrl;\n}());\n\nfunction dashLinksEditor() {\n return {\n restrict: 'E',\n controller: DashLinkEditorCtrl,\n templateUrl: 'public/app/features/dashlinks/editor.html',\n bindToController: true,\n controllerAs: 'ctrl',\n scope: {\n dashboard: '=',\n },\n };\n}\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.directives').directive('dashLinksEditor', dashLinksEditor);\n\n\n/***/ }),\n\n/***/ 2043:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export AnnotationsSrv */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__editor_ctrl__ = __webpack_require__(2044);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_app_core_core_module__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__events_processing__ = __webpack_require__(2045);\n\n\n\n\n\nvar AnnotationsSrv = /** @class */ (function () {\n /** @ngInject */\n AnnotationsSrv.$inject = [\"$rootScope\", \"$q\", \"datasourceSrv\", \"backendSrv\", \"timeSrv\"];\n function AnnotationsSrv($rootScope, $q, datasourceSrv, backendSrv, timeSrv) {\n this.$rootScope = $rootScope;\n this.$q = $q;\n this.datasourceSrv = datasourceSrv;\n this.backendSrv = backendSrv;\n this.timeSrv = timeSrv;\n $rootScope.onAppEvent('refresh', this.clearCache.bind(this), $rootScope);\n $rootScope.onAppEvent('dashboard-initialized', this.clearCache.bind(this), $rootScope);\n }\n AnnotationsSrv.prototype.clearCache = function () {\n this.globalAnnotationsPromise = null;\n this.alertStatesPromise = null;\n };\n AnnotationsSrv.prototype.getAnnotations = function (options) {\n var _this = this;\n return this.$q\n .all([this.getGlobalAnnotations(options), this.getAlertStates(options)])\n .then(function (results) {\n // combine the annotations and flatten results\n var annotations = __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.flattenDeep(results[0]);\n // filter out annotations that do not belong to requesting panel\n annotations = __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.filter(annotations, function (item) {\n // if event has panel id and query is of type dashboard then panel and requesting panel id must match\n if (item.panelId && item.source.type === 'dashboard') {\n return item.panelId === options.panel.id;\n }\n return true;\n });\n annotations = Object(__WEBPACK_IMPORTED_MODULE_4__events_processing__[\"a\" /* dedupAnnotations */])(annotations);\n annotations = Object(__WEBPACK_IMPORTED_MODULE_4__events_processing__[\"b\" /* makeRegions */])(annotations, options);\n // look for alert state for this panel\n var alertState = __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.find(results[1], { panelId: options.panel.id });\n return {\n annotations: annotations,\n alertState: alertState,\n };\n })\n .catch(function (err) {\n if (!err.message && err.data && err.data.message) {\n err.message = err.data.message;\n }\n console.log('AnnotationSrv.query error', err);\n _this.$rootScope.appEvent('alert-error', ['Annotation Query Failed', err.message || err]);\n return [];\n });\n };\n AnnotationsSrv.prototype.getAlertStates = function (options) {\n if (!options.dashboard.id) {\n return this.$q.when([]);\n }\n // ignore if no alerts\n if (options.panel && !options.panel.alert) {\n return this.$q.when([]);\n }\n if (options.range.raw.to !== 'now') {\n return this.$q.when([]);\n }\n if (this.alertStatesPromise) {\n return this.alertStatesPromise;\n }\n this.alertStatesPromise = this.backendSrv.get('/api/alerts/states-for-dashboard', {\n dashboardId: options.dashboard.id,\n });\n return this.alertStatesPromise;\n };\n AnnotationsSrv.prototype.getGlobalAnnotations = function (options) {\n var _this = this;\n var dashboard = options.dashboard;\n if (this.globalAnnotationsPromise) {\n return this.globalAnnotationsPromise;\n }\n var range = this.timeSrv.timeRange();\n var promises = [];\n var _loop_1 = function (annotation) {\n if (!annotation.enable) {\n return \"continue\";\n }\n if (annotation.snapshotData) {\n return { value: this_1.translateQueryResult(annotation, annotation.snapshotData) };\n }\n promises.push(this_1.datasourceSrv\n .get(annotation.datasource)\n .then(function (datasource) {\n // issue query against data source\n return datasource.annotationQuery({\n range: range,\n rangeRaw: range.raw,\n annotation: annotation,\n dashboard: dashboard,\n });\n })\n .then(function (results) {\n // store response in annotation object if this is a snapshot call\n if (dashboard.snapshot) {\n annotation.snapshotData = __WEBPACK_IMPORTED_MODULE_1_angular___default.a.copy(results);\n }\n // translate result\n return _this.translateQueryResult(annotation, results);\n }));\n };\n var this_1 = this;\n for (var _i = 0, _a = dashboard.annotations.list; _i < _a.length; _i++) {\n var annotation = _a[_i];\n var state_1 = _loop_1(annotation);\n if (typeof state_1 === \"object\")\n return state_1.value;\n }\n this.globalAnnotationsPromise = this.$q.all(promises);\n return this.globalAnnotationsPromise;\n };\n AnnotationsSrv.prototype.saveAnnotationEvent = function (annotation) {\n this.globalAnnotationsPromise = null;\n return this.backendSrv.post('/api/annotations', annotation);\n };\n AnnotationsSrv.prototype.updateAnnotationEvent = function (annotation) {\n this.globalAnnotationsPromise = null;\n return this.backendSrv.put(\"/api/annotations/\" + annotation.id, annotation);\n };\n AnnotationsSrv.prototype.deleteAnnotationEvent = function (annotation) {\n this.globalAnnotationsPromise = null;\n var deleteUrl = \"/api/annotations/\" + annotation.id;\n if (annotation.isRegion) {\n deleteUrl = \"/api/annotations/region/\" + annotation.regionId;\n }\n return this.backendSrv.delete(deleteUrl);\n };\n AnnotationsSrv.prototype.translateQueryResult = function (annotation, results) {\n // if annotation has snapshotData\n // make clone and remove it\n if (annotation.snapshotData) {\n annotation = __WEBPACK_IMPORTED_MODULE_1_angular___default.a.copy(annotation);\n delete annotation.snapshotData;\n }\n for (var _i = 0, results_1 = results; _i < results_1.length; _i++) {\n var item = results_1[_i];\n item.source = annotation;\n }\n return results;\n };\n return AnnotationsSrv;\n}());\n\n__WEBPACK_IMPORTED_MODULE_3_app_core_core_module__[\"a\" /* default */].service('annotationsSrv', AnnotationsSrv);\n\n\n/***/ }),\n\n/***/ 2044:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export AnnotationsEditorCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_jquery__ = __webpack_require__(17);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_jquery__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_app_core_core_module__ = __webpack_require__(2);\n\n\n\n\nvar AnnotationsEditorCtrl = /** @class */ (function () {\n /** @ngInject */\n AnnotationsEditorCtrl.$inject = [\"$scope\", \"datasourceSrv\"];\n function AnnotationsEditorCtrl($scope, datasourceSrv) {\n this.datasourceSrv = datasourceSrv;\n this.annotationDefaults = {\n name: '',\n datasource: null,\n iconColor: 'rgba(255, 96, 96, 1)',\n enable: true,\n showIn: 0,\n hide: false,\n };\n this.showOptions = [{ text: 'All Panels', value: 0 }, { text: 'Specific Panels', value: 1 }];\n $scope.ctrl = this;\n this.mode = 'list';\n this.datasources = datasourceSrv.getAnnotationSources();\n this.annotations = $scope.dashboard.annotations.list;\n this.reset();\n this.onColorChange = this.onColorChange.bind(this);\n }\n AnnotationsEditorCtrl.prototype.datasourceChanged = function () {\n var _this = this;\n return this.datasourceSrv.get(this.currentAnnotation.datasource).then(function (ds) {\n _this.currentDatasource = ds;\n });\n };\n AnnotationsEditorCtrl.prototype.edit = function (annotation) {\n this.currentAnnotation = annotation;\n this.currentAnnotation.showIn = this.currentAnnotation.showIn || 0;\n this.currentIsNew = false;\n this.datasourceChanged();\n this.mode = 'edit';\n __WEBPACK_IMPORTED_MODULE_2_jquery___default()('.tooltip.in').remove();\n };\n AnnotationsEditorCtrl.prototype.reset = function () {\n this.currentAnnotation = __WEBPACK_IMPORTED_MODULE_0_angular___default.a.copy(this.annotationDefaults);\n this.currentAnnotation.datasource = this.datasources[0].name;\n this.currentIsNew = true;\n this.datasourceChanged();\n };\n AnnotationsEditorCtrl.prototype.update = function () {\n this.reset();\n this.mode = 'list';\n };\n AnnotationsEditorCtrl.prototype.setupNew = function () {\n this.mode = 'new';\n this.reset();\n };\n AnnotationsEditorCtrl.prototype.backToList = function () {\n this.mode = 'list';\n };\n AnnotationsEditorCtrl.prototype.move = function (index, dir) {\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.move(this.annotations, index, index + dir);\n };\n AnnotationsEditorCtrl.prototype.add = function () {\n this.annotations.push(this.currentAnnotation);\n this.reset();\n this.mode = 'list';\n };\n AnnotationsEditorCtrl.prototype.removeAnnotation = function (annotation) {\n var index = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.indexOf(this.annotations, annotation);\n this.annotations.splice(index, 1);\n };\n AnnotationsEditorCtrl.prototype.onColorChange = function (newColor) {\n this.currentAnnotation.iconColor = newColor;\n };\n return AnnotationsEditorCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_3_app_core_core_module__[\"a\" /* default */].controller('AnnotationsEditorCtrl', AnnotationsEditorCtrl);\n\n\n/***/ }),\n\n/***/ 2045:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"b\"] = makeRegions;\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = dedupAnnotations;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n\n/**\n * This function converts annotation events into set\n * of single events and regions (event consist of two)\n * @param annotations\n * @param options\n */\nfunction makeRegions(annotations, options) {\n var _a = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.partition(annotations, 'regionId'), regionEvents = _a[0], singleEvents = _a[1];\n var regions = getRegions(regionEvents, options.range);\n annotations = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.concat(regions, singleEvents);\n return annotations;\n}\nfunction getRegions(events, range) {\n var region_events = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.filter(events, function (event) {\n return event.regionId;\n });\n var regions = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.groupBy(region_events, 'regionId');\n regions = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.compact(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(regions, function (region_events) {\n var region_obj = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.head(region_events);\n if (region_events && region_events.length > 1) {\n region_obj.timeEnd = region_events[1].time;\n region_obj.isRegion = true;\n return region_obj;\n }\n else {\n if (region_events && region_events.length) {\n // Don't change proper region object\n if (!region_obj.time || !region_obj.timeEnd) {\n // This is cut region\n if (isStartOfRegion(region_obj)) {\n region_obj.timeEnd = range.to.valueOf() - 1;\n }\n else {\n // Start time = null\n region_obj.timeEnd = region_obj.time;\n region_obj.time = range.from.valueOf() + 1;\n }\n region_obj.isRegion = true;\n }\n return region_obj;\n }\n }\n }));\n return regions;\n}\nfunction isStartOfRegion(event) {\n return event.id && event.id === event.regionId;\n}\nfunction dedupAnnotations(annotations) {\n var dedup = [];\n // Split events by annotationId property existence\n var events = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.partition(annotations, 'id');\n var eventsById = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.groupBy(events[0], 'id');\n dedup = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(eventsById, function (eventGroup) {\n if (eventGroup.length > 1 && !__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.every(eventGroup, isPanelAlert)) {\n // Get first non-panel alert\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(eventGroup, function (event) {\n return event.eventType !== 'panel-alert';\n });\n }\n else {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.head(eventGroup);\n }\n });\n dedup = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.concat(dedup, events[1]);\n return dedup;\n}\nfunction isPanelAlert(event) {\n return event.eventType === 'panel-alert';\n}\n\n\n/***/ }),\n\n/***/ 2046:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export EventEditorCtrl */\n/* unused harmony export eventEditor */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_moment__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_moment__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_core__ = __webpack_require__(197);\n\n\n\nvar EventEditorCtrl = /** @class */ (function () {\n /** @ngInject **/\n EventEditorCtrl.$inject = [\"annotationsSrv\"];\n function EventEditorCtrl(annotationsSrv) {\n this.annotationsSrv = annotationsSrv;\n this.event.panelId = this.panelCtrl.panel.id;\n this.event.dashboardId = this.panelCtrl.dashboard.id;\n // Annotations query returns time as Unix timestamp in milliseconds\n this.event.time = tryEpochToMoment(this.event.time);\n if (this.event.isRegion) {\n this.event.timeEnd = tryEpochToMoment(this.event.timeEnd);\n }\n this.timeFormated = this.panelCtrl.dashboard.formatDate(this.event.time);\n }\n EventEditorCtrl.prototype.save = function () {\n var _this = this;\n if (!this.form.$valid) {\n return;\n }\n var saveModel = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.cloneDeep(this.event);\n saveModel.time = saveModel.time.valueOf();\n saveModel.timeEnd = 0;\n if (saveModel.isRegion) {\n saveModel.timeEnd = this.event.timeEnd.valueOf();\n if (saveModel.timeEnd < saveModel.time) {\n console.log('invalid time');\n return;\n }\n }\n if (saveModel.id) {\n this.annotationsSrv\n .updateAnnotationEvent(saveModel)\n .then(function () {\n _this.panelCtrl.refresh();\n _this.close();\n })\n .catch(function () {\n _this.panelCtrl.refresh();\n _this.close();\n });\n }\n else {\n this.annotationsSrv\n .saveAnnotationEvent(saveModel)\n .then(function () {\n _this.panelCtrl.refresh();\n _this.close();\n })\n .catch(function () {\n _this.panelCtrl.refresh();\n _this.close();\n });\n }\n };\n EventEditorCtrl.prototype.delete = function () {\n var _this = this;\n return this.annotationsSrv\n .deleteAnnotationEvent(this.event)\n .then(function () {\n _this.panelCtrl.refresh();\n _this.close();\n })\n .catch(function () {\n _this.panelCtrl.refresh();\n _this.close();\n });\n };\n return EventEditorCtrl;\n}());\n\nfunction tryEpochToMoment(timestamp) {\n if (timestamp && __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isNumber(timestamp)) {\n var epoch = Number(timestamp);\n return __WEBPACK_IMPORTED_MODULE_1_moment___default()(epoch);\n }\n else {\n return timestamp;\n }\n}\nfunction eventEditor() {\n return {\n restrict: 'E',\n controller: EventEditorCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n templateUrl: 'public/app/features/annotations/partials/event_editor.html',\n scope: {\n panelCtrl: '=',\n event: '=',\n close: '&',\n },\n };\n}\n__WEBPACK_IMPORTED_MODULE_2_app_core_core__[\"d\" /* coreModule */].directive('eventEditor', eventEditor);\n\n\n/***/ }),\n\n/***/ 2047:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return EventManager; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_moment__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_moment__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_tinycolor2__ = __webpack_require__(202);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_tinycolor2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_tinycolor2__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__event__ = __webpack_require__(1996);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_app_core_utils_colors__ = __webpack_require__(138);\n\n\n\n\n\nvar EventManager = /** @class */ (function () {\n function EventManager(panelCtrl) {\n this.panelCtrl = panelCtrl;\n }\n EventManager.prototype.editorClosed = function () {\n this.event = null;\n this.editorOpen = false;\n this.panelCtrl.render();\n };\n EventManager.prototype.editorOpened = function () {\n this.editorOpen = true;\n };\n EventManager.prototype.updateTime = function (range) {\n if (!this.event) {\n this.event = new __WEBPACK_IMPORTED_MODULE_3__event__[\"a\" /* AnnotationEvent */]();\n this.event.dashboardId = this.panelCtrl.dashboard.id;\n this.event.panelId = this.panelCtrl.panel.id;\n }\n // update time\n this.event.time = __WEBPACK_IMPORTED_MODULE_1_moment___default()(range.from);\n this.event.isRegion = false;\n if (range.to) {\n this.event.timeEnd = __WEBPACK_IMPORTED_MODULE_1_moment___default()(range.to);\n this.event.isRegion = true;\n }\n this.panelCtrl.render();\n };\n EventManager.prototype.editEvent = function (event, elem) {\n this.event = event;\n this.panelCtrl.render();\n };\n EventManager.prototype.addFlotEvents = function (annotations, flotOptions) {\n if (!this.event && annotations.length === 0) {\n return;\n }\n var types = {\n $__alerting: {\n color: __WEBPACK_IMPORTED_MODULE_4_app_core_utils_colors__[\"a\" /* ALERTING_COLOR */],\n position: 'BOTTOM',\n markerSize: 5,\n },\n $__ok: {\n color: __WEBPACK_IMPORTED_MODULE_4_app_core_utils_colors__[\"d\" /* OK_COLOR */],\n position: 'BOTTOM',\n markerSize: 5,\n },\n $__no_data: {\n color: __WEBPACK_IMPORTED_MODULE_4_app_core_utils_colors__[\"c\" /* NO_DATA_COLOR */],\n position: 'BOTTOM',\n markerSize: 5,\n },\n $__editing: {\n color: __WEBPACK_IMPORTED_MODULE_4_app_core_utils_colors__[\"b\" /* DEFAULT_ANNOTATION_COLOR */],\n position: 'BOTTOM',\n markerSize: 5,\n },\n };\n if (this.event) {\n if (this.event.isRegion) {\n annotations = [\n {\n isRegion: true,\n min: this.event.time.valueOf(),\n timeEnd: this.event.timeEnd.valueOf(),\n text: this.event.text,\n eventType: '$__editing',\n editModel: this.event,\n },\n ];\n }\n else {\n annotations = [\n {\n min: this.event.time.valueOf(),\n text: this.event.text,\n editModel: this.event,\n eventType: '$__editing',\n },\n ];\n }\n }\n else {\n // annotations from query\n for (var i = 0; i < annotations.length; i++) {\n var item = annotations[i];\n // add properties used by jquery flot events\n item.min = item.time;\n item.max = item.time;\n item.eventType = item.source.name;\n if (item.newState) {\n item.eventType = '$__' + item.newState;\n continue;\n }\n if (!types[item.source.name]) {\n types[item.source.name] = {\n color: item.source.iconColor,\n position: 'BOTTOM',\n markerSize: 5,\n };\n }\n }\n }\n var regions = getRegions(annotations);\n addRegionMarking(regions, flotOptions);\n var eventSectionHeight = 20;\n var eventSectionMargin = 7;\n flotOptions.grid.eventSectionHeight = eventSectionMargin;\n flotOptions.xaxis.eventSectionHeight = eventSectionHeight;\n flotOptions.events = {\n levels: __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.keys(types).length + 1,\n data: annotations,\n types: types,\n manager: this,\n };\n };\n return EventManager;\n}());\n\nfunction getRegions(events) {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.filter(events, 'isRegion');\n}\nfunction addRegionMarking(regions, flotOptions) {\n var markings = flotOptions.grid.markings;\n var defaultColor = __WEBPACK_IMPORTED_MODULE_4_app_core_utils_colors__[\"b\" /* DEFAULT_ANNOTATION_COLOR */];\n var fillColor;\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(regions, function (region) {\n if (region.source) {\n fillColor = region.source.iconColor || defaultColor;\n }\n else {\n fillColor = defaultColor;\n }\n fillColor = addAlphaToRGB(fillColor, __WEBPACK_IMPORTED_MODULE_4_app_core_utils_colors__[\"e\" /* REGION_FILL_ALPHA */]);\n markings.push({\n xaxis: { from: region.min, to: region.timeEnd },\n color: fillColor,\n });\n });\n}\nfunction addAlphaToRGB(colorString, alpha) {\n var color = __WEBPACK_IMPORTED_MODULE_2_tinycolor2___default()(colorString);\n if (color.isValid()) {\n color.setAlpha(alpha);\n return color.toRgbString();\n }\n else {\n return colorString;\n }\n}\n\n\n/***/ }),\n\n/***/ 2048:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export annotationTooltipDirective */\n/* harmony import */ \nannotationTooltipDirective.$inject = [\"$sanitize\", \"dashboardSrv\", \"contextSrv\", \"$compile\"];var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery__ = __webpack_require__(17);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_jquery__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_core_module__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__alerting_alert_def__ = __webpack_require__(698);\n\n\n\n\n/** @ngInject **/\nfunction annotationTooltipDirective($sanitize, dashboardSrv, contextSrv, $compile) {\n function sanitizeString(str) {\n try {\n return $sanitize(str);\n }\n catch (err) {\n console.log('Could not sanitize annotation string, html escaping instead');\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.escape(str);\n }\n }\n function formatTZeroTime(time) {\n var t_zero_prefix = time === 0 ? 'T=' : time < 0 ? 'T-' : 'T+';\n return t_zero_prefix + time / 1000;\n }\n return {\n restrict: 'E',\n scope: {\n event: '=',\n events: '=',\n plot: '=',\n onEdit: '&',\n },\n link: function (scope, element) {\n var event = scope.event;\n var events = scope.events;\n var plot = scope.plot;\n var title = event.title;\n var text = event.text;\n var dashboard = dashboardSrv.getCurrent();\n var tooltip = '
';\n var titleStateClass = '';\n if (event.alertId) {\n var stateModel = __WEBPACK_IMPORTED_MODULE_3__alerting_alert_def__[\"a\" /* default */].getStateDisplayModel(event.newState);\n titleStateClass = stateModel.stateClass;\n title = \" \" + stateModel.text;\n text = __WEBPACK_IMPORTED_MODULE_3__alerting_alert_def__[\"a\" /* default */].getAlertAnnotationInfo(event);\n if (event.text) {\n text = text + '
' + event.text;\n }\n }\n else if (title) {\n text = title + '
' + (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isString(text) ? text : '');\n title = '';\n }\n /* Bundle events that are very close by */\n var xaxis = plot.getXAxes()[plot.getOptions().events.xaxis - 1];\n var currentEventX = xaxis.p2c(event.min);\n var eventBundle = events.filter(function (e) {\n var distance = Math.abs(xaxis.p2c(e.time) - currentEventX);\n return distance < 10;\n });\n var header = \"
\";\n if (event.login) {\n header += \"
\";\n var time = formatTZeroTime(event.min);\n header += \"\\n \" + sanitizeString(title) + \"\\n \" + time + \"\\n \";\n }\n else {\n header += \"\\n event\\n \";\n }\n // Show edit icon only for users with at least Editor role\n if (event.id && dashboard.meta.canEdit) {\n header += \"\\n \\n \\n \\n \";\n }\n header += \"
\";\n tooltip += header;\n tooltip += '
';\n if (text && eventBundle.length === 1) {\n tooltip += '
' + sanitizeString(text.replace(/\\n/g, '
')) + '
';\n }\n function getColor(tagText) {\n var colors = ['#757575', '#9B9B9B'];\n if (tagText.match('CLOSE') || tagText.match('SET_0')) {\n colors = ['#991F23', '#BF4549'];\n }\n else if (tagText.match('OPEN') || tagText.match('SET_')) {\n colors = ['#33AA6A', '#59D090'];\n }\n else if (tagText.match('CRUISE')) {\n colors = ['#0000FF', '#2626FF'];\n }\n return \"background-color: \" + colors[0] + \"; border-color: \" + colors[1];\n }\n var tags = [];\n __WEBPACK_IMPORTED_MODULE_1_jquery___default.a.each(eventBundle, function (index, e) {\n __WEBPACK_IMPORTED_MODULE_1_jquery___default.a.each(e.tags, function (index, tag) {\n tags.push({\n time: formatTZeroTime(e.time),\n color: getColor(tag),\n text: tag,\n });\n });\n });\n if (tags && tags.length) {\n scope.tags = tags;\n tooltip +=\n '' +\n '{{tag.text}} ' +\n '{{tag.time}}
' +\n '
';\n }\n tooltip += '
';\n tooltip += '
';\n var $tooltip = __WEBPACK_IMPORTED_MODULE_1_jquery___default()(tooltip);\n $tooltip.appendTo(element);\n $compile(element.contents())(scope);\n },\n };\n}\n__WEBPACK_IMPORTED_MODULE_2_app_core_core_module__[\"a\" /* default */].directive('annotationTooltip', annotationTooltipDirective);\n\n\n/***/ }),\n\n/***/ 2049:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__editor_ctrl__ = __webpack_require__(2050);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_core_module__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__template_srv__ = __webpack_require__(1997);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__variable_srv__ = __webpack_require__(2051);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__interval_variable__ = __webpack_require__(2053);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__query_variable__ = __webpack_require__(2054);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__datasource_variable__ = __webpack_require__(2055);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__custom_variable__ = __webpack_require__(2056);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__constant_variable__ = __webpack_require__(2057);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__adhoc_variable__ = __webpack_require__(2058);\n/* unused harmony reexport VariableSrv */\n/* unused harmony reexport IntervalVariable */\n/* unused harmony reexport QueryVariable */\n/* unused harmony reexport DatasourceVariable */\n/* unused harmony reexport CustomVariable */\n/* unused harmony reexport ConstantVariable */\n/* unused harmony reexport AdhocVariable */\n\n\n\n\n\n\n\n\n\n\n__WEBPACK_IMPORTED_MODULE_1_app_core_core_module__[\"a\" /* default */].factory('templateSrv', function () {\n return __WEBPACK_IMPORTED_MODULE_2__template_srv__[\"a\" /* default */];\n});\n\n\n\n/***/ }),\n\n/***/ 2050:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export VariableEditorCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_core_module__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__variable__ = __webpack_require__(1984);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_app_core_app_events__ = __webpack_require__(22);\n\n\n\n\nvar VariableEditorCtrl = /** @class */ (function () {\n /** @ngInject **/\n VariableEditorCtrl.$inject = [\"$scope\", \"datasourceSrv\", \"variableSrv\", \"templateSrv\"];\n function VariableEditorCtrl($scope, datasourceSrv, variableSrv, templateSrv) {\n $scope.variableTypes = __WEBPACK_IMPORTED_MODULE_2__variable__[\"c\" /* variableTypes */];\n $scope.ctrl = {};\n $scope.namePattern = /^(?!__).*$/;\n $scope._ = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a;\n $scope.optionsLimit = 20;\n $scope.refreshOptions = [\n { value: 0, text: 'Never' },\n { value: 1, text: 'On Dashboard Load' },\n { value: 2, text: 'On Time Range Change' },\n ];\n $scope.sortOptions = [\n { value: 0, text: 'Disabled' },\n { value: 1, text: 'Alphabetical (asc)' },\n { value: 2, text: 'Alphabetical (desc)' },\n { value: 3, text: 'Numerical (asc)' },\n { value: 4, text: 'Numerical (desc)' },\n { value: 5, text: 'Alphabetical (case-insensitive, asc)' },\n { value: 6, text: 'Alphabetical (case-insensitive, desc)' },\n ];\n $scope.hideOptions = [{ value: 0, text: '' }, { value: 1, text: 'Label' }, { value: 2, text: 'Variable' }];\n $scope.init = function () {\n $scope.mode = 'list';\n $scope.variables = variableSrv.variables;\n $scope.reset();\n $scope.$watch('mode', function (val) {\n if (val === 'new') {\n $scope.reset();\n }\n });\n };\n $scope.setMode = function (mode) {\n $scope.mode = mode;\n };\n $scope.add = function () {\n if ($scope.isValid()) {\n variableSrv.addVariable($scope.current);\n $scope.update();\n }\n };\n $scope.isValid = function () {\n if (!$scope.ctrl.form.$valid) {\n return false;\n }\n if (!$scope.current.name.match(/^\\w+$/)) {\n __WEBPACK_IMPORTED_MODULE_3_app_core_app_events__[\"a\" /* default */].emit('alert-warning', ['Validation', 'Only word and digit characters are allowed in variable names']);\n return false;\n }\n var sameName = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find($scope.variables, { name: $scope.current.name });\n if (sameName && sameName !== $scope.current) {\n __WEBPACK_IMPORTED_MODULE_3_app_core_app_events__[\"a\" /* default */].emit('alert-warning', ['Validation', 'Variable with the same name already exists']);\n return false;\n }\n if ($scope.current.type === 'query' &&\n $scope.current.query.match(new RegExp('\\\\$' + $scope.current.name + '(/| |$)'))) {\n __WEBPACK_IMPORTED_MODULE_3_app_core_app_events__[\"a\" /* default */].emit('alert-warning', [\n 'Validation',\n 'Query cannot contain a reference to itself. Variable: $' + $scope.current.name,\n ]);\n return false;\n }\n return true;\n };\n $scope.validate = function () {\n $scope.infoText = '';\n if ($scope.current.type === 'adhoc' && $scope.current.datasource !== null) {\n $scope.infoText = 'Adhoc filters are applied automatically to all queries that target this datasource';\n datasourceSrv.get($scope.current.datasource).then(function (ds) {\n if (!ds.getTagKeys) {\n $scope.infoText = 'This datasource does not support adhoc filters yet.';\n }\n });\n }\n };\n $scope.runQuery = function () {\n $scope.optionsLimit = 20;\n return variableSrv.updateOptions($scope.current).catch(function (err) {\n if (err.data && err.data.message) {\n err.message = err.data.message;\n }\n __WEBPACK_IMPORTED_MODULE_3_app_core_app_events__[\"a\" /* default */].emit('alert-error', ['Templating', 'Template variables could not be initialized: ' + err.message]);\n });\n };\n $scope.edit = function (variable) {\n $scope.current = variable;\n $scope.currentIsNew = false;\n $scope.mode = 'edit';\n $scope.validate();\n };\n $scope.duplicate = function (variable) {\n var clone = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.cloneDeep(variable.getSaveModel());\n $scope.current = variableSrv.createVariableFromModel(clone);\n $scope.current.name = 'copy_of_' + variable.name;\n variableSrv.addVariable($scope.current);\n };\n $scope.update = function () {\n if ($scope.isValid()) {\n $scope.runQuery().then(function () {\n $scope.reset();\n $scope.mode = 'list';\n templateSrv.updateTemplateData();\n });\n }\n };\n $scope.reset = function () {\n $scope.currentIsNew = true;\n $scope.current = variableSrv.createVariableFromModel({ type: 'query' });\n // this is done here in case a new data source type variable was added\n $scope.datasources = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.filter(datasourceSrv.getMetricSources(), function (ds) {\n return !ds.meta.mixed && ds.value !== null;\n });\n $scope.datasourceTypes = __WEBPACK_IMPORTED_MODULE_0_lodash___default()($scope.datasources)\n .uniqBy('meta.id')\n .map(function (ds) {\n return { text: ds.meta.name, value: ds.meta.id };\n })\n .value();\n };\n $scope.typeChanged = function () {\n var old = $scope.current;\n $scope.current = variableSrv.createVariableFromModel({\n type: $scope.current.type,\n });\n $scope.current.name = old.name;\n $scope.current.hide = old.hide;\n $scope.current.label = old.label;\n var oldIndex = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.indexOf(this.variables, old);\n if (oldIndex !== -1) {\n this.variables[oldIndex] = $scope.current;\n }\n $scope.validate();\n };\n $scope.removeVariable = function (variable) {\n variableSrv.removeVariable(variable);\n };\n $scope.showMoreOptions = function () {\n $scope.optionsLimit += 20;\n };\n }\n return VariableEditorCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_1_app_core_core_module__[\"a\" /* default */].controller('VariableEditorCtrl', VariableEditorCtrl);\n\n\n/***/ }),\n\n/***/ 2051:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export VariableSrv */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__core_core_module__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__variable__ = __webpack_require__(1984);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__builtin_variables__ = __webpack_require__(2052);\n\n\n\n\n\nvar VariableSrv = /** @class */ (function () {\n /** @ngInject */\n VariableSrv.$inject = [\"$rootScope\", \"$q\", \"$location\", \"$injector\", \"templateSrv\", \"$routeParams\"];\n function VariableSrv($rootScope, $q, $location, $injector, templateSrv, $routeParams) {\n this.$rootScope = $rootScope;\n this.$q = $q;\n this.$location = $location;\n this.$injector = $injector;\n this.templateSrv = templateSrv;\n this.$routeParams = $routeParams;\n // update time variant variables\n $rootScope.$on('refresh', this.onDashboardRefresh.bind(this), $rootScope);\n $rootScope.$on('template-variable-value-updated', this.updateUrlParamsWithCurrentVariables.bind(this), $rootScope);\n }\n VariableSrv.prototype.hasVariable = function (name) {\n return this.dashboard.templating.list.filter(function (t) { return t.name === name; }).length > 0;\n };\n VariableSrv.prototype.init = function (dashboard) {\n var _this = this;\n this.dashboard = dashboard;\n if (!this.hasVariable('experiment_id')) {\n dashboard.templating.list.push(__WEBPACK_IMPORTED_MODULE_4__builtin_variables__[\"a\" /* experimentId */]);\n }\n if (!this.hasVariable('resolution') && !dashboard.meta.isSnapshot) {\n dashboard.templating.list.push(__WEBPACK_IMPORTED_MODULE_4__builtin_variables__[\"b\" /* resolution */]);\n }\n // Don't show res variable on snapshots\n if (this.hasVariable('resolution') && dashboard.meta.isSnapshot) {\n this.dashboard.templating.list = this.dashboard.templating.list.filter(function (t) { return t.name !== 'resolution'; });\n }\n // create working class models representing variables\n this.variables = dashboard.templating.list = dashboard.templating.list.map(this.createVariableFromModel.bind(this));\n this.templateSrv.init(this.variables);\n // init variables\n for (var _i = 0, _a = this.variables; _i < _a.length; _i++) {\n var variable = _a[_i];\n variable.initLock = this.$q.defer();\n }\n var queryParams = this.$location.search();\n return this.$q\n .all(this.variables.map(function (variable) {\n return _this.processVariable(variable, queryParams);\n }))\n .then(function () {\n _this.templateSrv.updateTemplateData();\n });\n };\n VariableSrv.prototype.onDashboardRefresh = function () {\n var _this = this;\n var promises = this.variables.filter(function (variable) { return variable.refresh === 2; }).map(function (variable) {\n var previousOptions = variable.options.slice();\n return variable.updateOptions().then(function () {\n if (__WEBPACK_IMPORTED_MODULE_0_angular___default.a.toJson(previousOptions) !== __WEBPACK_IMPORTED_MODULE_0_angular___default.a.toJson(variable.options)) {\n _this.$rootScope.$emit('template-variable-value-updated');\n }\n });\n });\n return this.$q.all(promises);\n };\n VariableSrv.prototype.processVariable = function (variable, queryParams) {\n var _this = this;\n var dependencies = [];\n for (var _i = 0, _a = this.variables; _i < _a.length; _i++) {\n var otherVariable = _a[_i];\n if (variable.dependsOn(otherVariable)) {\n dependencies.push(otherVariable.initLock.promise);\n }\n }\n return this.$q\n .all(dependencies)\n .then(function () {\n if (variable.name === 'experiment_id') {\n var experimentId = _this.$routeParams.experimentId;\n variable.setValueFromUrl(experimentId).then(variable.initLock.resolve);\n return;\n }\n var urlValue = queryParams['var-' + variable.name];\n if (urlValue !== void 0) {\n return variable.setValueFromUrl(urlValue).then(variable.initLock.resolve);\n }\n if (variable.refresh === 1 || variable.refresh === 2) {\n return variable.updateOptions().then(variable.initLock.resolve);\n }\n variable.initLock.resolve();\n })\n .finally(function () {\n _this.templateSrv.variableInitialized(variable);\n delete variable.initLock;\n });\n };\n VariableSrv.prototype.createVariableFromModel = function (model) {\n var ctor = __WEBPACK_IMPORTED_MODULE_3__variable__[\"c\" /* variableTypes */][model.type].ctor;\n if (!ctor) {\n throw {\n message: 'Unable to find variable constructor for ' + model.type,\n };\n }\n var variable = this.$injector.instantiate(ctor, { model: model });\n return variable;\n };\n VariableSrv.prototype.addVariable = function (variable) {\n this.variables.push(variable);\n this.templateSrv.updateTemplateData();\n this.dashboard.updateSubmenuVisibility();\n };\n VariableSrv.prototype.removeVariable = function (variable) {\n var index = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.indexOf(this.variables, variable);\n this.variables.splice(index, 1);\n this.templateSrv.updateTemplateData();\n this.dashboard.updateSubmenuVisibility();\n };\n VariableSrv.prototype.updateOptions = function (variable) {\n return variable.updateOptions();\n };\n VariableSrv.prototype.variableUpdated = function (variable, emitChangeEvents) {\n var _this = this;\n // if there is a variable lock ignore cascading update because we are in a boot up scenario\n if (variable.initLock) {\n return this.$q.when();\n }\n // cascade updates to variables that use this variable\n var promises = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(this.variables, function (otherVariable) {\n if (otherVariable === variable) {\n return;\n }\n if (otherVariable.dependsOn(variable)) {\n return _this.updateOptions(otherVariable);\n }\n });\n return this.$q.all(promises).then(function () {\n if (emitChangeEvents) {\n _this.$rootScope.$emit('template-variable-value-updated');\n _this.$rootScope.$broadcast('refresh');\n }\n });\n };\n VariableSrv.prototype.selectOptionsForCurrentValue = function (variable) {\n var i, y, value, option;\n var selected = [];\n for (i = 0; i < variable.options.length; i++) {\n option = variable.options[i];\n option.selected = false;\n if (__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isArray(variable.current.value)) {\n for (y = 0; y < variable.current.value.length; y++) {\n value = variable.current.value[y];\n if (option.value === value) {\n option.selected = true;\n selected.push(option);\n }\n }\n }\n else if (option.value === variable.current.value) {\n option.selected = true;\n selected.push(option);\n }\n }\n return selected;\n };\n VariableSrv.prototype.validateVariableSelectionState = function (variable) {\n if (!variable.current) {\n variable.current = {};\n }\n if (__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isArray(variable.current.value)) {\n var selected = this.selectOptionsForCurrentValue(variable);\n // if none pick first\n if (selected.length === 0) {\n selected = variable.options[0];\n }\n else {\n selected = {\n value: __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(selected, function (val) {\n return val.value;\n }),\n text: __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(selected, function (val) {\n return val.text;\n }).join(' + '),\n };\n }\n return variable.setValue(selected);\n }\n else {\n var currentOption = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find(variable.options, {\n text: variable.current.text,\n });\n if (currentOption) {\n return variable.setValue(currentOption);\n }\n else {\n if (!variable.options.length) {\n return Promise.resolve();\n }\n return variable.setValue(variable.options[0]);\n }\n }\n };\n VariableSrv.prototype.setOptionFromUrl = function (variable, urlValue) {\n var promise = this.$q.when();\n if (variable.refresh) {\n promise = variable.updateOptions();\n }\n return promise.then(function () {\n var option = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find(variable.options, function (op) {\n return op.text === urlValue || op.value === urlValue;\n });\n var defaultText = urlValue;\n var defaultValue = urlValue;\n if (!option && __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isArray(urlValue)) {\n defaultText = [];\n var _loop_1 = function (n) {\n var t = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find(variable.options, function (op) {\n return op.value === urlValue[n];\n });\n if (t) {\n defaultText.push(t.text);\n }\n };\n for (var n = 0; n < urlValue.length; n++) {\n _loop_1(n);\n }\n }\n option = option || { text: defaultText, value: defaultValue };\n return variable.setValue(option);\n });\n };\n VariableSrv.prototype.setOptionAsCurrent = function (variable, option) {\n variable.current = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.cloneDeep(option);\n if (__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isArray(variable.current.text)) {\n variable.current.text = variable.current.text.join(' + ');\n }\n this.selectOptionsForCurrentValue(variable);\n return this.variableUpdated(variable);\n };\n VariableSrv.prototype.updateUrlParamsWithCurrentVariables = function () {\n // update url\n var params = this.$location.search();\n // remove variable params\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(params, function (value, key) {\n if (key.indexOf('var-') === 0) {\n delete params[key];\n }\n });\n // add new values\n this.templateSrv.fillVariableValuesForUrl(params);\n // update url\n this.$location.search(params);\n };\n VariableSrv.prototype.setAdhocFilter = function (options) {\n var variable = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find(this.variables, {\n type: 'adhoc',\n datasource: options.datasource,\n });\n if (!variable) {\n variable = this.createVariableFromModel({\n name: 'Filters',\n type: 'adhoc',\n datasource: options.datasource,\n });\n this.addVariable(variable);\n }\n var filters = variable.filters;\n var filter = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find(filters, { key: options.key, value: options.value });\n if (!filter) {\n filter = { key: options.key, value: options.value };\n filters.push(filter);\n }\n filter.operator = options.operator;\n this.variableUpdated(variable, true);\n };\n return VariableSrv;\n}());\n\n__WEBPACK_IMPORTED_MODULE_2__core_core_module__[\"a\" /* default */].service('variableSrv', VariableSrv);\n\n\n/***/ }),\n\n/***/ 2052:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return experimentId; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"b\", function() { return resolution; });\nvar experimentId = {\n allFormat: 'glob',\n current: { text: '10', value: '10' },\n datasource: null,\n hide: 2,\n label: null,\n name: 'experiment_id',\n options: [{ selected: false, text: '0', value: '0' }],\n query: '0',\n refresh: 0,\n type: 'constant',\n};\nvar resolution = {\n allFormat: 'glob',\n allValue: null,\n current: { tags: [], text: 'Automatic', value: '$__interval' },\n datasource: null,\n hide: 0,\n includeAll: false,\n label: 'Resolution',\n multi: false,\n name: 'resolution',\n options: [\n { selected: true, text: 'Automatic', value: '$__interval' },\n { selected: false, text: '10s', value: '10s' },\n { selected: false, text: '1s', value: '1s' },\n { selected: false, text: '100ms', value: '100ms' },\n { selected: false, text: '10ms', value: '10ms' },\n { selected: false, text: '1ms', value: '1ms' },\n { selected: false, text: '100µs', value: '100u' },\n { selected: false, text: '10µs', value: '10u' },\n { selected: false, text: '1µs', value: '1u' },\n { selected: false, text: '100ns', value: '100ns' },\n { selected: false, text: '10ns', value: '10ns' },\n { selected: false, text: '1ns', value: '1ns' },\n ],\n query: '$__interval,1ms',\n refresh: 0,\n type: 'custom',\n};\n\n\n\n/***/ }),\n\n/***/ 2053:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export IntervalVariable */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_utils_kbn__ = __webpack_require__(312);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__variable__ = __webpack_require__(1984);\n\n\n\nvar IntervalVariable = /** @class */ (function () {\n /** @ngInject **/\n IntervalVariable.$inject = [\"model\", \"timeSrv\", \"templateSrv\", \"variableSrv\"];\n function IntervalVariable(model, timeSrv, templateSrv, variableSrv) {\n this.model = model;\n this.timeSrv = timeSrv;\n this.templateSrv = templateSrv;\n this.variableSrv = variableSrv;\n this.defaults = {\n type: 'interval',\n name: '',\n hide: 0,\n label: '',\n refresh: 2,\n options: [],\n current: {},\n query: '1m,10m,30m,1h,6h,12h,1d,7d,14d,30d',\n auto: false,\n auto_min: '10s',\n auto_count: 30,\n };\n Object(__WEBPACK_IMPORTED_MODULE_2__variable__[\"a\" /* assignModelProperties */])(this, model, this.defaults);\n this.refresh = 2;\n }\n IntervalVariable.prototype.getSaveModel = function () {\n Object(__WEBPACK_IMPORTED_MODULE_2__variable__[\"a\" /* assignModelProperties */])(this.model, this, this.defaults);\n return this.model;\n };\n IntervalVariable.prototype.setValue = function (option) {\n this.updateAutoValue();\n return this.variableSrv.setOptionAsCurrent(this, option);\n };\n IntervalVariable.prototype.updateAutoValue = function () {\n if (!this.auto) {\n return;\n }\n // add auto option if missing\n if (this.options.length && this.options[0].text !== 'auto') {\n this.options.unshift({\n text: 'auto',\n value: '$__auto_interval_' + this.name,\n });\n }\n var res = __WEBPACK_IMPORTED_MODULE_1_app_core_utils_kbn__[\"a\" /* default */].calculateInterval(this.timeSrv.timeRange(), this.auto_count, this.auto_min);\n this.templateSrv.setGrafanaVariable('$__auto_interval_' + this.name, res.interval);\n // for backward compatibility, to be removed eventually\n this.templateSrv.setGrafanaVariable('$__auto_interval', res.interval);\n };\n IntervalVariable.prototype.updateOptions = function () {\n // extract options between quotes and/or comma\n this.options = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(this.query.match(/([\"'])(.*?)\\1|\\w+/g), function (text) {\n text = text.replace(/[\"']+/g, '');\n return { text: text.trim(), value: text.trim() };\n });\n this.updateAutoValue();\n return this.variableSrv.validateVariableSelectionState(this);\n };\n IntervalVariable.prototype.dependsOn = function (variable) {\n return false;\n };\n IntervalVariable.prototype.setValueFromUrl = function (urlValue) {\n this.updateAutoValue();\n return this.variableSrv.setOptionFromUrl(this, urlValue);\n };\n IntervalVariable.prototype.getValueForUrl = function () {\n return this.current.value;\n };\n return IntervalVariable;\n}());\n\n__WEBPACK_IMPORTED_MODULE_2__variable__[\"c\" /* variableTypes */]['interval'] = {\n name: 'Interval',\n ctor: IntervalVariable,\n description: 'Define a timespan interval (ex 1m, 1h, 1d)',\n};\n\n\n/***/ }),\n\n/***/ 2054:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export QueryVariable */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_utils_kbn__ = __webpack_require__(312);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__variable__ = __webpack_require__(1984);\n\n\n\nfunction getNoneOption() {\n return { text: 'None', value: '', isNone: true };\n}\nvar QueryVariable = /** @class */ (function () {\n /** @ngInject **/\n QueryVariable.$inject = [\"model\", \"datasourceSrv\", \"templateSrv\", \"variableSrv\", \"timeSrv\"];\n function QueryVariable(model, datasourceSrv, templateSrv, variableSrv, timeSrv) {\n this.model = model;\n this.datasourceSrv = datasourceSrv;\n this.templateSrv = templateSrv;\n this.variableSrv = variableSrv;\n this.timeSrv = timeSrv;\n this.defaults = {\n type: 'query',\n label: null,\n query: '',\n regex: '',\n sort: 0,\n datasource: null,\n refresh: 0,\n hide: 0,\n name: '',\n multi: false,\n includeAll: false,\n allValue: null,\n options: [],\n current: {},\n tags: [],\n useTags: false,\n tagsQuery: '',\n tagValuesQuery: '',\n };\n // copy model properties to this instance\n Object(__WEBPACK_IMPORTED_MODULE_2__variable__[\"a\" /* assignModelProperties */])(this, model, this.defaults);\n }\n QueryVariable.prototype.getSaveModel = function () {\n // copy back model properties to model\n Object(__WEBPACK_IMPORTED_MODULE_2__variable__[\"a\" /* assignModelProperties */])(this.model, this, this.defaults);\n // remove options\n if (this.refresh !== 0) {\n this.model.options = [];\n }\n return this.model;\n };\n QueryVariable.prototype.setValue = function (option) {\n return this.variableSrv.setOptionAsCurrent(this, option);\n };\n QueryVariable.prototype.setValueFromUrl = function (urlValue) {\n return this.variableSrv.setOptionFromUrl(this, urlValue);\n };\n QueryVariable.prototype.getValueForUrl = function () {\n if (this.current.text === 'All') {\n return 'All';\n }\n return this.current.value;\n };\n QueryVariable.prototype.updateOptions = function () {\n return this.datasourceSrv\n .get(this.datasource)\n .then(this.updateOptionsFromMetricFindQuery.bind(this))\n .then(this.updateTags.bind(this))\n .then(this.variableSrv.validateVariableSelectionState.bind(this.variableSrv, this));\n };\n QueryVariable.prototype.updateTags = function (datasource) {\n var _this = this;\n if (this.useTags) {\n return this.metricFindQuery(datasource, this.tagsQuery).then(function (results) {\n _this.tags = [];\n for (var i = 0; i < results.length; i++) {\n _this.tags.push(results[i].text);\n }\n return datasource;\n });\n }\n else {\n delete this.tags;\n }\n return datasource;\n };\n QueryVariable.prototype.getValuesForTag = function (tagKey) {\n var _this = this;\n return this.datasourceSrv.get(this.datasource).then(function (datasource) {\n var query = _this.tagValuesQuery.replace('$tag', tagKey);\n return _this.metricFindQuery(datasource, query).then(function (results) {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(results, function (value) {\n return value.text;\n });\n });\n });\n };\n QueryVariable.prototype.updateOptionsFromMetricFindQuery = function (datasource) {\n var _this = this;\n return this.metricFindQuery(datasource, this.query).then(function (results) {\n _this.options = _this.metricNamesToVariableValues(results);\n if (_this.includeAll) {\n _this.addAllOption();\n }\n if (!_this.options.length) {\n _this.options.push(getNoneOption());\n }\n return datasource;\n });\n };\n QueryVariable.prototype.metricFindQuery = function (datasource, query) {\n var options = { range: undefined, variable: this };\n if (this.refresh === 2) {\n options.range = this.timeSrv.timeRange();\n }\n return datasource.metricFindQuery(query, options);\n };\n QueryVariable.prototype.addAllOption = function () {\n this.options.unshift({ text: 'All', value: '$__all' });\n };\n QueryVariable.prototype.metricNamesToVariableValues = function (metricNames) {\n var regex, options, i, matches;\n options = [];\n if (this.regex) {\n regex = __WEBPACK_IMPORTED_MODULE_1_app_core_utils_kbn__[\"a\" /* default */].stringToJsRegex(this.templateSrv.replace(this.regex, {}, 'regex'));\n }\n for (i = 0; i < metricNames.length; i++) {\n var item = metricNames[i];\n var text = item.text === undefined || item.text === null ? item.value : item.text;\n var value = item.value === undefined || item.value === null ? item.text : item.value;\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isNumber(value)) {\n value = value.toString();\n }\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isNumber(text)) {\n text = text.toString();\n }\n if (regex) {\n matches = regex.exec(value);\n if (!matches) {\n continue;\n }\n if (matches.length > 1) {\n value = matches[1];\n text = matches[1];\n }\n }\n options.push({ text: text, value: value });\n }\n options = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.uniqBy(options, 'value');\n return this.sortVariableValues(options, this.sort);\n };\n QueryVariable.prototype.sortVariableValues = function (options, sortOrder) {\n if (sortOrder === 0) {\n return options;\n }\n var sortType = Math.ceil(sortOrder / 2);\n var reverseSort = sortOrder % 2 === 0;\n if (sortType === 1) {\n options = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.sortBy(options, 'text');\n }\n else if (sortType === 2) {\n options = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.sortBy(options, function (opt) {\n var matches = opt.text.match(/.*?(\\d+).*/);\n if (!matches || matches.length < 2) {\n return -1;\n }\n else {\n return parseInt(matches[1], 10);\n }\n });\n }\n else if (sortType === 3) {\n options = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.sortBy(options, function (opt) {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.toLower(opt.text);\n });\n }\n if (reverseSort) {\n options = options.reverse();\n }\n return options;\n };\n QueryVariable.prototype.dependsOn = function (variable) {\n return Object(__WEBPACK_IMPORTED_MODULE_2__variable__[\"b\" /* containsVariable */])(this.query, this.datasource, variable.name);\n };\n return QueryVariable;\n}());\n\n__WEBPACK_IMPORTED_MODULE_2__variable__[\"c\" /* variableTypes */]['query'] = {\n name: 'Query',\n ctor: QueryVariable,\n description: 'Variable values are fetched from a datasource query',\n supportsMulti: true,\n};\n\n\n/***/ }),\n\n/***/ 2055:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export DatasourceVariable */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_utils_kbn__ = __webpack_require__(312);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__variable__ = __webpack_require__(1984);\n\n\nvar DatasourceVariable = /** @class */ (function () {\n /** @ngInject **/\n DatasourceVariable.$inject = [\"model\", \"datasourceSrv\", \"variableSrv\", \"templateSrv\"];\n function DatasourceVariable(model, datasourceSrv, variableSrv, templateSrv) {\n this.model = model;\n this.datasourceSrv = datasourceSrv;\n this.variableSrv = variableSrv;\n this.templateSrv = templateSrv;\n this.defaults = {\n type: 'datasource',\n name: '',\n hide: 0,\n label: '',\n current: {},\n regex: '',\n options: [],\n query: '',\n refresh: 1,\n };\n Object(__WEBPACK_IMPORTED_MODULE_1__variable__[\"a\" /* assignModelProperties */])(this, model, this.defaults);\n this.refresh = 1;\n }\n DatasourceVariable.prototype.getSaveModel = function () {\n Object(__WEBPACK_IMPORTED_MODULE_1__variable__[\"a\" /* assignModelProperties */])(this.model, this, this.defaults);\n // don't persist options\n this.model.options = [];\n return this.model;\n };\n DatasourceVariable.prototype.setValue = function (option) {\n return this.variableSrv.setOptionAsCurrent(this, option);\n };\n DatasourceVariable.prototype.updateOptions = function () {\n var options = [];\n var sources = this.datasourceSrv.getMetricSources({ skipVariables: true });\n var regex;\n if (this.regex) {\n regex = this.templateSrv.replace(this.regex, null, 'regex');\n regex = __WEBPACK_IMPORTED_MODULE_0_app_core_utils_kbn__[\"a\" /* default */].stringToJsRegex(regex);\n }\n for (var i = 0; i < sources.length; i++) {\n var source = sources[i];\n // must match on type\n if (source.meta.id !== this.query) {\n continue;\n }\n if (regex && !regex.exec(source.name)) {\n continue;\n }\n options.push({ text: source.name, value: source.name });\n }\n if (options.length === 0) {\n options.push({ text: 'No data sources found', value: '' });\n }\n this.options = options;\n return this.variableSrv.validateVariableSelectionState(this);\n };\n DatasourceVariable.prototype.dependsOn = function (variable) {\n if (this.regex) {\n return Object(__WEBPACK_IMPORTED_MODULE_1__variable__[\"b\" /* containsVariable */])(this.regex, variable.name);\n }\n return false;\n };\n DatasourceVariable.prototype.setValueFromUrl = function (urlValue) {\n return this.variableSrv.setOptionFromUrl(this, urlValue);\n };\n DatasourceVariable.prototype.getValueForUrl = function () {\n return this.current.value;\n };\n return DatasourceVariable;\n}());\n\n__WEBPACK_IMPORTED_MODULE_1__variable__[\"c\" /* variableTypes */]['datasource'] = {\n name: 'Datasource',\n ctor: DatasourceVariable,\n description: 'Enabled you to dynamically switch the datasource for multiple panels',\n};\n\n\n/***/ }),\n\n/***/ 2056:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export CustomVariable */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__variable__ = __webpack_require__(1984);\n\n\nvar CustomVariable = /** @class */ (function () {\n /** @ngInject **/\n CustomVariable.$inject = [\"model\", \"variableSrv\"];\n function CustomVariable(model, variableSrv) {\n this.model = model;\n this.variableSrv = variableSrv;\n this.defaults = {\n type: 'custom',\n name: '',\n label: '',\n hide: 0,\n options: [],\n current: {},\n query: '',\n includeAll: false,\n multi: false,\n allValue: null,\n };\n Object(__WEBPACK_IMPORTED_MODULE_1__variable__[\"a\" /* assignModelProperties */])(this, model, this.defaults);\n }\n CustomVariable.prototype.setValue = function (option) {\n return this.variableSrv.setOptionAsCurrent(this, option);\n };\n CustomVariable.prototype.getSaveModel = function () {\n Object(__WEBPACK_IMPORTED_MODULE_1__variable__[\"a\" /* assignModelProperties */])(this.model, this, this.defaults);\n return this.model;\n };\n CustomVariable.prototype.updateOptions = function () {\n // extract options in comma separated string\n this.options = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(this.query.split(/[,]+/), function (text) {\n return { text: text.trim(), value: text.trim() };\n });\n if (this.includeAll) {\n this.addAllOption();\n }\n return this.variableSrv.validateVariableSelectionState(this);\n };\n CustomVariable.prototype.addAllOption = function () {\n this.options.unshift({ text: 'All', value: '$__all' });\n };\n CustomVariable.prototype.dependsOn = function (variable) {\n return false;\n };\n CustomVariable.prototype.setValueFromUrl = function (urlValue) {\n return this.variableSrv.setOptionFromUrl(this, urlValue);\n };\n CustomVariable.prototype.getValueForUrl = function () {\n if (this.current.text === 'All') {\n return 'All';\n }\n return this.current.value;\n };\n return CustomVariable;\n}());\n\n__WEBPACK_IMPORTED_MODULE_1__variable__[\"c\" /* variableTypes */]['custom'] = {\n name: 'Custom',\n ctor: CustomVariable,\n description: 'Define variable values manually',\n supportsMulti: true,\n};\n\n\n/***/ }),\n\n/***/ 2057:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export ConstantVariable */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__variable__ = __webpack_require__(1984);\n\nvar ConstantVariable = /** @class */ (function () {\n /** @ngInject **/\n ConstantVariable.$inject = [\"model\", \"variableSrv\"];\n function ConstantVariable(model, variableSrv) {\n this.model = model;\n this.variableSrv = variableSrv;\n this.defaults = {\n type: 'constant',\n name: '',\n hide: 2,\n label: '',\n query: '',\n current: {},\n options: [],\n };\n Object(__WEBPACK_IMPORTED_MODULE_0__variable__[\"a\" /* assignModelProperties */])(this, model, this.defaults);\n }\n ConstantVariable.prototype.getSaveModel = function () {\n Object(__WEBPACK_IMPORTED_MODULE_0__variable__[\"a\" /* assignModelProperties */])(this.model, this, this.defaults);\n return this.model;\n };\n ConstantVariable.prototype.setValue = function (option) {\n this.variableSrv.setOptionAsCurrent(this, option);\n };\n ConstantVariable.prototype.updateOptions = function () {\n this.options = [{ text: this.query.trim(), value: this.query.trim() }];\n this.setValue(this.options[0]);\n return Promise.resolve();\n };\n ConstantVariable.prototype.dependsOn = function (variable) {\n return false;\n };\n ConstantVariable.prototype.setValueFromUrl = function (urlValue) {\n return this.variableSrv.setOptionFromUrl(this, urlValue);\n };\n ConstantVariable.prototype.getValueForUrl = function () {\n return this.current.value;\n };\n return ConstantVariable;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0__variable__[\"c\" /* variableTypes */]['constant'] = {\n name: 'Constant',\n ctor: ConstantVariable,\n description: 'Define a hidden constant variable, useful for metric prefixes in dashboards you want to share',\n};\n\n\n/***/ }),\n\n/***/ 2058:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export AdhocVariable */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__variable__ = __webpack_require__(1984);\n\n\nvar AdhocVariable = /** @class */ (function () {\n /** @ngInject **/\n AdhocVariable.$inject = [\"model\"];\n function AdhocVariable(model) {\n this.model = model;\n this.defaults = {\n type: 'adhoc',\n name: '',\n label: '',\n hide: 0,\n datasource: null,\n filters: [],\n };\n Object(__WEBPACK_IMPORTED_MODULE_1__variable__[\"a\" /* assignModelProperties */])(this, model, this.defaults);\n }\n AdhocVariable.prototype.setValue = function (option) {\n return Promise.resolve();\n };\n AdhocVariable.prototype.getSaveModel = function () {\n Object(__WEBPACK_IMPORTED_MODULE_1__variable__[\"a\" /* assignModelProperties */])(this.model, this, this.defaults);\n return this.model;\n };\n AdhocVariable.prototype.updateOptions = function () {\n return Promise.resolve();\n };\n AdhocVariable.prototype.dependsOn = function (variable) {\n return false;\n };\n AdhocVariable.prototype.setValueFromUrl = function (urlValue) {\n var _this = this;\n if (!__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isArray(urlValue)) {\n urlValue = [urlValue];\n }\n this.filters = urlValue.map(function (item) {\n var values = item.split('|').map(function (value) {\n return _this.unescapeDelimiter(value);\n });\n return {\n key: values[0],\n operator: values[1],\n value: values[2],\n };\n });\n return Promise.resolve();\n };\n AdhocVariable.prototype.getValueForUrl = function () {\n var _this = this;\n return this.filters.map(function (filter) {\n return [filter.key, filter.operator, filter.value]\n .map(function (value) {\n return _this.escapeDelimiter(value);\n })\n .join('|');\n });\n };\n AdhocVariable.prototype.escapeDelimiter = function (value) {\n return value.replace(/\\|/g, '__gfp__');\n };\n AdhocVariable.prototype.unescapeDelimiter = function (value) {\n return value.replace(/__gfp__/g, '|');\n };\n AdhocVariable.prototype.setFilters = function (filters) {\n this.filters = filters;\n };\n return AdhocVariable;\n}());\n\n__WEBPACK_IMPORTED_MODULE_1__variable__[\"c\" /* variableTypes */]['adhoc'] = {\n name: 'Ad hoc filters',\n ctor: AdhocVariable,\n description: 'Add key/value filters on the fly',\n};\n\n\n/***/ }),\n\n/***/ 2059:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__plugin_edit_ctrl__ = __webpack_require__(2060);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__plugin_page_ctrl__ = __webpack_require__(2061);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__plugin_list_ctrl__ = __webpack_require__(2062);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__import_list_import_list__ = __webpack_require__(2063);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__ds_edit_ctrl__ = __webpack_require__(2064);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__ds_dashboards_ctrl__ = __webpack_require__(2065);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__ds_list_ctrl__ = __webpack_require__(2066);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__datasource_srv__ = __webpack_require__(2067);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__plugin_component__ = __webpack_require__(2197);\n\n\n\n\n\n\n\n\n\n\n\n/***/ }),\n\n/***/ 2060:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export PluginEditCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_remarkable__ = __webpack_require__(694);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_remarkable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_remarkable__);\n\n\n\nvar PluginEditCtrl = /** @class */ (function () {\n /** @ngInject */\n PluginEditCtrl.$inject = [\"$scope\", \"$rootScope\", \"backendSrv\", \"$sce\", \"$routeParams\", \"navModelSrv\"];\n function PluginEditCtrl($scope, $rootScope, backendSrv, $sce, $routeParams, navModelSrv) {\n this.$scope = $scope;\n this.$rootScope = $rootScope;\n this.backendSrv = backendSrv;\n this.$sce = $sce;\n this.$routeParams = $routeParams;\n this.pluginId = $routeParams.pluginId;\n this.preUpdateHook = function () { return Promise.resolve(); };\n this.postUpdateHook = function () { return Promise.resolve(); };\n this.init();\n }\n PluginEditCtrl.prototype.setNavModel = function (model) {\n var defaultTab = 'readme';\n this.navModel = {\n main: {\n img: model.info.logos.large,\n subTitle: model.info.author.name,\n url: '',\n text: model.name,\n breadcrumbs: [{ title: 'Plugins', url: 'plugins' }],\n children: [\n {\n icon: 'fa fa-fw fa-file-text-o',\n id: 'readme',\n text: 'Readme',\n url: \"plugins/\" + this.model.id + \"/edit?tab=readme\",\n },\n ],\n },\n };\n if (model.type === 'app') {\n this.navModel.main.children.push({\n icon: 'gicon gicon-cog',\n id: 'config',\n text: 'Config',\n url: \"plugins/\" + this.model.id + \"/edit?tab=config\",\n });\n var hasDashboards = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find(model.includes, { type: 'dashboard' });\n if (hasDashboards) {\n this.navModel.main.children.push({\n icon: 'gicon gicon-dashboard',\n id: 'dashboards',\n text: 'Dashboards',\n url: \"plugins/\" + this.model.id + \"/edit?tab=dashboards\",\n });\n }\n defaultTab = 'config';\n }\n this.tab = this.$routeParams.tab || defaultTab;\n for (var _i = 0, _a = this.navModel.main.children; _i < _a.length; _i++) {\n var tab = _a[_i];\n if (tab.id === this.tab) {\n tab.active = true;\n }\n }\n };\n PluginEditCtrl.prototype.init = function () {\n var _this = this;\n return this.backendSrv.get(\"/api/plugins/\" + this.pluginId + \"/settings\").then(function (result) {\n _this.model = result;\n _this.pluginIcon = _this.getPluginIcon(_this.model.type);\n _this.model.dependencies.plugins.forEach(function (plug) {\n plug.icon = _this.getPluginIcon(plug.type);\n });\n _this.includes = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(result.includes, function (plug) {\n plug.icon = _this.getPluginIcon(plug.type);\n return plug;\n });\n _this.setNavModel(_this.model);\n return _this.initReadme();\n });\n };\n PluginEditCtrl.prototype.initReadme = function () {\n var _this = this;\n return this.backendSrv.get(\"/api/plugins/\" + this.pluginId + \"/markdown/readme\").then(function (res) {\n var md = new __WEBPACK_IMPORTED_MODULE_2_remarkable___default.a();\n _this.readmeHtml = _this.$sce.trustAsHtml(md.render(res));\n });\n };\n PluginEditCtrl.prototype.getPluginIcon = function (type) {\n switch (type) {\n case 'datasource':\n return 'icon-gf icon-gf-datasources';\n case 'panel':\n return 'icon-gf icon-gf-panel';\n case 'app':\n return 'icon-gf icon-gf-apps';\n case 'page':\n return 'icon-gf icon-gf-endpoint-tiny';\n case 'dashboard':\n return 'icon-gf icon-gf-dashboard';\n default:\n return 'icon-gf icon-gf-apps';\n }\n };\n PluginEditCtrl.prototype.update = function () {\n var _this = this;\n this.preUpdateHook()\n .then(function () {\n var updateCmd = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.extend({\n enabled: _this.model.enabled,\n pinned: _this.model.pinned,\n jsonData: _this.model.jsonData,\n secureJsonData: _this.model.secureJsonData,\n }, {});\n return _this.backendSrv.post(\"/api/plugins/\" + _this.pluginId + \"/settings\", updateCmd);\n })\n .then(this.postUpdateHook)\n .then(function (res) {\n window.location.href = window.location.href;\n });\n };\n PluginEditCtrl.prototype.importDashboards = function () {\n return Promise.resolve();\n };\n PluginEditCtrl.prototype.setPreUpdateHook = function (callback) {\n this.preUpdateHook = callback;\n };\n PluginEditCtrl.prototype.setPostUpdateHook = function (callback) {\n this.postUpdateHook = callback;\n };\n PluginEditCtrl.prototype.updateAvailable = function () {\n var modalScope = this.$scope.$new(true);\n modalScope.plugin = this.model;\n this.$rootScope.appEvent('show-modal', {\n src: 'public/app/features/plugins/partials/update_instructions.html',\n scope: modalScope,\n });\n };\n PluginEditCtrl.prototype.enable = function () {\n this.model.enabled = true;\n this.model.pinned = true;\n this.update();\n };\n PluginEditCtrl.prototype.disable = function () {\n this.model.enabled = false;\n this.model.pinned = false;\n this.update();\n };\n return PluginEditCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.controllers').controller('PluginEditCtrl', PluginEditCtrl);\n\n\n/***/ }),\n\n/***/ 2061:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export AppPageCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n\n\nvar pluginInfoCache = {};\nvar AppPageCtrl = /** @class */ (function () {\n /** @ngInject */\n AppPageCtrl.$inject = [\"backendSrv\", \"$routeParams\", \"$rootScope\", \"navModelSrv\"];\n function AppPageCtrl(backendSrv, $routeParams, $rootScope, navModelSrv) {\n this.backendSrv = backendSrv;\n this.$routeParams = $routeParams;\n this.$rootScope = $rootScope;\n this.navModelSrv = navModelSrv;\n this.pluginId = $routeParams.pluginId;\n if (pluginInfoCache[this.pluginId]) {\n this.initPage(pluginInfoCache[this.pluginId]);\n }\n else {\n this.loadPluginInfo();\n }\n }\n AppPageCtrl.prototype.initPage = function (app) {\n this.appModel = app;\n this.page = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find(app.includes, { slug: this.$routeParams.slug });\n pluginInfoCache[this.pluginId] = app;\n if (!this.page) {\n this.$rootScope.appEvent('alert-error', ['App Page Not Found', '']);\n this.navModel = this.navModelSrv.getNotFoundNav();\n return;\n }\n var pluginNav = this.navModelSrv.getNav('plugin-page-' + app.id);\n this.navModel = {\n main: {\n img: app.info.logos.large,\n subTitle: app.name,\n url: '',\n text: this.page.name,\n breadcrumbs: [{ title: app.name, url: pluginNav.main.url }],\n },\n };\n };\n AppPageCtrl.prototype.loadPluginInfo = function () {\n var _this = this;\n this.backendSrv.get(\"/api/plugins/\" + this.pluginId + \"/settings\").then(function (app) {\n _this.initPage(app);\n });\n };\n return AppPageCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.controllers').controller('AppPageCtrl', AppPageCtrl);\n\n\n/***/ }),\n\n/***/ 2062:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export PluginListCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n\n\nvar PluginListCtrl = /** @class */ (function () {\n /** @ngInject */\n PluginListCtrl.$inject = [\"backendSrv\", \"$location\", \"navModelSrv\"];\n function PluginListCtrl(backendSrv, $location, navModelSrv) {\n var _this = this;\n this.backendSrv = backendSrv;\n this.tabIndex = 0;\n this.navModel = navModelSrv.getNav('cfg', 'plugins', 0);\n this.backendSrv.get('api/plugins', { embedded: 0 }).then(function (plugins) {\n _this.plugins = plugins;\n _this.allPlugins = plugins;\n });\n }\n PluginListCtrl.prototype.onQueryUpdated = function () {\n var regex = new RegExp(this.searchQuery, 'ig');\n this.plugins = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.filter(this.allPlugins, function (item) {\n return regex.test(item.name) || regex.test(item.type);\n });\n };\n return PluginListCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.controllers').controller('PluginListCtrl', PluginListCtrl);\n\n\n/***/ }),\n\n/***/ 2063:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export DashImportListCtrl */\n/* unused harmony export dashboardImportList */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_core_module__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_app_events__ = __webpack_require__(22);\n\n\n\nvar DashImportListCtrl = /** @class */ (function () {\n /** @ngInject */\n DashImportListCtrl.$inject = [\"$scope\", \"backendSrv\", \"$rootScope\"];\n function DashImportListCtrl($scope, backendSrv, $rootScope) {\n var _this = this;\n this.backendSrv = backendSrv;\n this.$rootScope = $rootScope;\n this.dashboards = [];\n backendSrv.get(\"/api/plugins/\" + this.plugin.id + \"/dashboards\").then(function (dashboards) {\n _this.dashboards = dashboards;\n });\n __WEBPACK_IMPORTED_MODULE_2_app_core_app_events__[\"a\" /* default */].on('dashboard-list-import-all', this.importAll.bind(this), $scope);\n }\n DashImportListCtrl.prototype.importAll = function (payload) {\n return this.importNext(0)\n .then(function () {\n payload.resolve('All dashboards imported');\n })\n .catch(function (err) {\n payload.reject(err);\n });\n };\n DashImportListCtrl.prototype.importNext = function (index) {\n var _this = this;\n return this.import(this.dashboards[index], true).then(function () {\n if (index + 1 < _this.dashboards.length) {\n return new Promise(function (resolve) {\n setTimeout(function () {\n _this.importNext(index + 1).then(function () {\n resolve();\n });\n }, 500);\n });\n }\n else {\n return Promise.resolve();\n }\n });\n };\n DashImportListCtrl.prototype.import = function (dash, overwrite) {\n var _this = this;\n var installCmd = {\n pluginId: this.plugin.id,\n path: dash.path,\n overwrite: overwrite,\n inputs: [],\n };\n if (this.datasource) {\n installCmd.inputs.push({\n name: '*',\n type: 'datasource',\n pluginId: this.datasource.type,\n value: this.datasource.name,\n });\n }\n return this.backendSrv.post(\"/api/dashboards/import\", installCmd).then(function (res) {\n _this.$rootScope.appEvent('alert-success', ['Dashboard Imported', dash.title]);\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.extend(dash, res);\n });\n };\n DashImportListCtrl.prototype.remove = function (dash) {\n var _this = this;\n this.backendSrv.delete('/api/dashboards/' + dash.importedUri).then(function () {\n _this.$rootScope.appEvent('alert-success', ['Dashboard Deleted', dash.title]);\n dash.imported = false;\n });\n };\n return DashImportListCtrl;\n}());\n\nfunction dashboardImportList() {\n return {\n restrict: 'E',\n templateUrl: 'public/app/features/plugins/import_list/import_list.html',\n controller: DashImportListCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: {\n plugin: '=',\n datasource: '=',\n },\n };\n}\n__WEBPACK_IMPORTED_MODULE_1_app_core_core_module__[\"a\" /* default */].directive('dashboardImportList', dashboardImportList);\n\n\n/***/ }),\n\n/***/ 2064:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export DataSourceEditCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_mobx__ = __webpack_require__(70);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_config__ = __webpack_require__(23);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_app_core_core__ = __webpack_require__(197);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_app_stores_store__ = __webpack_require__(112);\n\n\n\n\n\nvar datasourceTypes = [];\nvar defaults = {\n name: '',\n type: 'graphite',\n url: '',\n access: 'proxy',\n jsonData: {},\n secureJsonFields: {},\n};\nvar datasourceCreated = false;\nvar DataSourceEditCtrl = /** @class */ (function () {\n /** @ngInject */\n DataSourceEditCtrl.$inject = [\"$q\", \"backendSrv\", \"$routeParams\", \"$location\", \"datasourceSrv\"];\n function DataSourceEditCtrl($q, backendSrv, $routeParams, $location, datasourceSrv) {\n var _this = this;\n this.$q = $q;\n this.backendSrv = backendSrv;\n this.$routeParams = $routeParams;\n this.$location = $location;\n this.datasourceSrv = datasourceSrv;\n if (__WEBPACK_IMPORTED_MODULE_4_app_stores_store__[\"b\" /* store */].nav.main === null) {\n __WEBPACK_IMPORTED_MODULE_4_app_stores_store__[\"b\" /* store */].nav.load('cfg', 'datasources');\n }\n this.navModel = Object(__WEBPACK_IMPORTED_MODULE_1_mobx__[\"toJS\"])(__WEBPACK_IMPORTED_MODULE_4_app_stores_store__[\"b\" /* store */].nav);\n this.datasources = [];\n this.loadDatasourceTypes().then(function () {\n if (_this.$routeParams.id) {\n _this.getDatasourceById(_this.$routeParams.id);\n }\n else {\n _this.initNewDatasourceModel();\n }\n });\n }\n DataSourceEditCtrl.prototype.initNewDatasourceModel = function () {\n this.isNew = true;\n this.current = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.cloneDeep(defaults);\n // We are coming from getting started\n if (this.$location.search().gettingstarted) {\n this.gettingStarted = true;\n this.current.isDefault = true;\n }\n this.typeChanged();\n };\n DataSourceEditCtrl.prototype.loadDatasourceTypes = function () {\n var _this = this;\n if (datasourceTypes.length > 0) {\n this.types = datasourceTypes;\n return this.$q.when(null);\n }\n return this.backendSrv.get('/api/plugins', { enabled: 1, type: 'datasource' }).then(function (plugins) {\n datasourceTypes = plugins;\n _this.types = plugins;\n });\n };\n DataSourceEditCtrl.prototype.getDatasourceById = function (id) {\n var _this = this;\n this.backendSrv.get('/api/datasources/' + id).then(function (ds) {\n _this.isNew = false;\n _this.current = ds;\n if (datasourceCreated) {\n datasourceCreated = false;\n _this.testDatasource();\n }\n return _this.typeChanged();\n });\n };\n DataSourceEditCtrl.prototype.userChangedType = function () {\n // reset model but keep name & default flag\n this.current = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.defaults({\n id: this.current.id,\n name: this.current.name,\n isDefault: this.current.isDefault,\n type: this.current.type,\n }, __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.cloneDeep(defaults));\n this.typeChanged();\n };\n DataSourceEditCtrl.prototype.updateNav = function () {\n __WEBPACK_IMPORTED_MODULE_4_app_stores_store__[\"b\" /* store */].nav.initDatasourceEditNav(this.current, this.datasourceMeta, 'datasource-settings');\n this.navModel = Object(__WEBPACK_IMPORTED_MODULE_1_mobx__[\"toJS\"])(__WEBPACK_IMPORTED_MODULE_4_app_stores_store__[\"b\" /* store */].nav);\n };\n DataSourceEditCtrl.prototype.typeChanged = function () {\n var _this = this;\n return this.backendSrv.get('/api/plugins/' + this.current.type + '/settings').then(function (pluginInfo) {\n _this.datasourceMeta = pluginInfo;\n _this.updateNav();\n });\n };\n DataSourceEditCtrl.prototype.updateFrontendSettings = function () {\n var _this = this;\n return this.backendSrv.get('/api/frontend/settings').then(function (settings) {\n __WEBPACK_IMPORTED_MODULE_2_app_core_config__[\"a\" /* default */].datasources = settings.datasources;\n __WEBPACK_IMPORTED_MODULE_2_app_core_config__[\"a\" /* default */].defaultDatasource = settings.defaultDatasource;\n _this.datasourceSrv.init();\n });\n };\n DataSourceEditCtrl.prototype.testDatasource = function () {\n var _this = this;\n this.datasourceSrv.get(this.current.name).then(function (datasource) {\n if (!datasource.testDatasource) {\n return;\n }\n _this.testing = { done: false, status: 'error' };\n // make test call in no backend cache context\n _this.backendSrv\n .withNoBackendCache(function () {\n return datasource\n .testDatasource()\n .then(function (result) {\n _this.testing.message = result.message;\n _this.testing.status = result.status;\n })\n .catch(function (err) {\n if (err.statusText) {\n _this.testing.message = 'HTTP Error ' + err.statusText;\n }\n else {\n _this.testing.message = err.message;\n }\n });\n })\n .finally(function () {\n _this.testing.done = true;\n });\n });\n };\n DataSourceEditCtrl.prototype.saveChanges = function () {\n var _this = this;\n if (!this.editForm.$valid) {\n return;\n }\n if (this.current.readOnly) {\n return;\n }\n if (this.current.id) {\n return this.backendSrv.put('/api/datasources/' + this.current.id, this.current).then(function (result) {\n _this.current = result.datasource;\n _this.updateNav();\n _this.updateFrontendSettings().then(function () {\n _this.testDatasource();\n });\n });\n }\n else {\n return this.backendSrv.post('/api/datasources', this.current).then(function (result) {\n _this.current = result.datasource;\n _this.updateFrontendSettings();\n datasourceCreated = true;\n _this.$location.path('datasources/edit/' + result.id);\n });\n }\n };\n DataSourceEditCtrl.prototype.confirmDelete = function () {\n var _this = this;\n this.backendSrv.delete('/api/datasources/' + this.current.id).then(function () {\n _this.$location.path('datasources');\n });\n };\n DataSourceEditCtrl.prototype.delete = function (s) {\n var _this = this;\n __WEBPACK_IMPORTED_MODULE_3_app_core_core__[\"b\" /* appEvents */].emit('confirm-modal', {\n title: 'Delete',\n text: 'Are you sure you want to delete this datasource?',\n yesText: 'Delete',\n icon: 'fa-trash',\n onConfirm: function () {\n _this.confirmDelete();\n },\n });\n };\n return DataSourceEditCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_3_app_core_core__[\"d\" /* coreModule */].controller('DataSourceEditCtrl', DataSourceEditCtrl);\n__WEBPACK_IMPORTED_MODULE_3_app_core_core__[\"d\" /* coreModule */].directive('datasourceHttpSettings', function () {\n return {\n scope: {\n current: '=',\n suggestUrl: '@',\n noDirectAccess: '@',\n },\n templateUrl: 'public/app/features/plugins/partials/ds_http_settings.html',\n link: {\n pre: function ($scope, elem, attrs) {\n // do not show access option if direct access is disabled\n $scope.showAccessOption = $scope.noDirectAccess !== 'true';\n $scope.showAccessHelp = false;\n $scope.toggleAccessHelp = function () {\n $scope.showAccessHelp = !$scope.showAccessHelp;\n };\n $scope.getSuggestUrls = function () {\n return [$scope.suggestUrl];\n };\n },\n },\n };\n});\n\n\n/***/ }),\n\n/***/ 2065:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export DataSourceDashboardsCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_mobx__ = __webpack_require__(70);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_core__ = __webpack_require__(197);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_stores_store__ = __webpack_require__(112);\n\n\n\nvar DataSourceDashboardsCtrl = /** @class */ (function () {\n /** @ngInject */\n DataSourceDashboardsCtrl.$inject = [\"backendSrv\", \"$routeParams\"];\n function DataSourceDashboardsCtrl(backendSrv, $routeParams) {\n this.backendSrv = backendSrv;\n this.$routeParams = $routeParams;\n if (__WEBPACK_IMPORTED_MODULE_2_app_stores_store__[\"b\" /* store */].nav.main === null) {\n __WEBPACK_IMPORTED_MODULE_2_app_stores_store__[\"b\" /* store */].nav.load('cfg', 'datasources');\n }\n this.navModel = Object(__WEBPACK_IMPORTED_MODULE_0_mobx__[\"toJS\"])(__WEBPACK_IMPORTED_MODULE_2_app_stores_store__[\"b\" /* store */].nav);\n if (this.$routeParams.id) {\n this.getDatasourceById(this.$routeParams.id);\n }\n }\n DataSourceDashboardsCtrl.prototype.getDatasourceById = function (id) {\n var _this = this;\n this.backendSrv\n .get('/api/datasources/' + id)\n .then(function (ds) {\n _this.current = ds;\n })\n .then(this.getPluginInfo.bind(this));\n };\n DataSourceDashboardsCtrl.prototype.updateNav = function () {\n __WEBPACK_IMPORTED_MODULE_2_app_stores_store__[\"b\" /* store */].nav.initDatasourceEditNav(this.current, this.datasourceMeta, 'datasource-dashboards');\n this.navModel = Object(__WEBPACK_IMPORTED_MODULE_0_mobx__[\"toJS\"])(__WEBPACK_IMPORTED_MODULE_2_app_stores_store__[\"b\" /* store */].nav);\n };\n DataSourceDashboardsCtrl.prototype.getPluginInfo = function () {\n var _this = this;\n return this.backendSrv.get('/api/plugins/' + this.current.type + '/settings').then(function (pluginInfo) {\n _this.datasourceMeta = pluginInfo;\n _this.updateNav();\n });\n };\n return DataSourceDashboardsCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_1_app_core_core__[\"d\" /* coreModule */].controller('DataSourceDashboardsCtrl', DataSourceDashboardsCtrl);\n\n\n/***/ }),\n\n/***/ 2066:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export DataSourcesCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__core_core_module__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n\n\nvar DataSourcesCtrl = /** @class */ (function () {\n /** @ngInject */\n DataSourcesCtrl.$inject = [\"$scope\", \"backendSrv\", \"datasourceSrv\", \"navModelSrv\"];\n function DataSourcesCtrl($scope, backendSrv, datasourceSrv, navModelSrv) {\n var _this = this;\n this.$scope = $scope;\n this.backendSrv = backendSrv;\n this.datasourceSrv = datasourceSrv;\n this.navModelSrv = navModelSrv;\n this.navModel = this.navModelSrv.getNav('cfg', 'datasources', 0);\n backendSrv.get('/api/datasources').then(function (result) {\n _this.datasources = result;\n _this.unfiltered = result;\n });\n }\n DataSourcesCtrl.prototype.onQueryUpdated = function () {\n var regex = new RegExp(this.searchQuery, 'ig');\n this.datasources = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.filter(this.unfiltered, function (item) {\n return regex.test(item.name) || regex.test(item.type);\n });\n };\n DataSourcesCtrl.prototype.removeDataSourceConfirmed = function (ds) {\n var _this = this;\n this.backendSrv\n .delete('/api/datasources/' + ds.id)\n .then(function () {\n _this.$scope.appEvent('alert-success', ['Datasource deleted', '']);\n }, function () {\n _this.$scope.appEvent('alert-error', ['Unable to delete datasource', '']);\n })\n .then(function () {\n _this.backendSrv.get('/api/datasources').then(function (result) {\n _this.datasources = result;\n });\n _this.backendSrv.get('/api/frontend/settings').then(function (settings) {\n _this.datasourceSrv.init(settings.datasources);\n });\n });\n };\n DataSourcesCtrl.prototype.removeDataSource = function (ds) {\n var _this = this;\n this.$scope.appEvent('confirm-modal', {\n title: 'Delete',\n text: 'Are you sure you want to delete datasource ' + ds.name + '?',\n yesText: 'Delete',\n icon: 'fa-trash',\n onConfirm: function () {\n _this.removeDataSourceConfirmed(ds);\n },\n });\n };\n return DataSourcesCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0__core_core_module__[\"a\" /* default */].controller('DataSourcesCtrl', DataSourcesCtrl);\n\n\n/***/ }),\n\n/***/ 2067:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export DatasourceSrv */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_core_module__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_config__ = __webpack_require__(23);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__plugin_loader__ = __webpack_require__(1990);\n\n\n\n\nvar DatasourceSrv = /** @class */ (function () {\n /** @ngInject */\n DatasourceSrv.$inject = [\"$q\", \"$injector\", \"$rootScope\", \"templateSrv\"];\n function DatasourceSrv($q, $injector, $rootScope, templateSrv) {\n this.$q = $q;\n this.$injector = $injector;\n this.$rootScope = $rootScope;\n this.templateSrv = templateSrv;\n this.init();\n }\n DatasourceSrv.prototype.init = function () {\n this.datasources = {};\n };\n DatasourceSrv.prototype.get = function (name) {\n if (!name) {\n return this.get(__WEBPACK_IMPORTED_MODULE_2_app_core_config__[\"a\" /* default */].defaultDatasource);\n }\n name = this.templateSrv.replace(name);\n if (name === 'default') {\n return this.get(__WEBPACK_IMPORTED_MODULE_2_app_core_config__[\"a\" /* default */].defaultDatasource);\n }\n if (this.datasources[name]) {\n return this.$q.when(this.datasources[name]);\n }\n return this.loadDatasource(name);\n };\n DatasourceSrv.prototype.loadDatasource = function (name) {\n var _this = this;\n var dsConfig = __WEBPACK_IMPORTED_MODULE_2_app_core_config__[\"a\" /* default */].datasources[name];\n if (!dsConfig) {\n return this.$q.reject({ message: 'Datasource named ' + name + ' was not found' });\n }\n var deferred = this.$q.defer();\n var pluginDef = dsConfig.meta;\n Object(__WEBPACK_IMPORTED_MODULE_3__plugin_loader__[\"a\" /* importPluginModule */])(pluginDef.module)\n .then(function (plugin) {\n // check if its in cache now\n if (_this.datasources[name]) {\n deferred.resolve(_this.datasources[name]);\n return;\n }\n // plugin module needs to export a constructor function named Datasource\n if (!plugin.Datasource) {\n throw new Error('Plugin module is missing Datasource constructor');\n }\n var instance = _this.$injector.instantiate(plugin.Datasource, { instanceSettings: dsConfig });\n instance.meta = pluginDef;\n instance.name = name;\n _this.datasources[name] = instance;\n deferred.resolve(instance);\n })\n .catch(function (err) {\n _this.$rootScope.appEvent('alert-error', [dsConfig.name + ' plugin failed', err.toString()]);\n });\n return deferred.promise;\n };\n DatasourceSrv.prototype.getAll = function () {\n return __WEBPACK_IMPORTED_MODULE_2_app_core_config__[\"a\" /* default */].datasources;\n };\n DatasourceSrv.prototype.getAnnotationSources = function () {\n var sources = [];\n this.addDataSourceVariables(sources);\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(__WEBPACK_IMPORTED_MODULE_2_app_core_config__[\"a\" /* default */].datasources, function (value) {\n if (value.meta && value.meta.annotations) {\n sources.push(value);\n }\n });\n return sources;\n };\n DatasourceSrv.prototype.getMetricSources = function (options) {\n var metricSources = [];\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(__WEBPACK_IMPORTED_MODULE_2_app_core_config__[\"a\" /* default */].datasources, function (value, key) {\n if (value.meta && value.meta.metrics) {\n metricSources.push({ value: key, name: key, meta: value.meta });\n if (key === __WEBPACK_IMPORTED_MODULE_2_app_core_config__[\"a\" /* default */].defaultDatasource) {\n metricSources.push({ value: null, name: 'default', meta: value.meta });\n }\n }\n });\n if (!options || !options.skipVariables) {\n this.addDataSourceVariables(metricSources);\n }\n metricSources.sort(function (a, b) {\n // these two should always be at the bottom\n if (a.meta.id === 'mixed' || a.meta.id === 'grafana') {\n return 1;\n }\n if (b.meta.id === 'mixed' || b.meta.id === 'grafana') {\n return -1;\n }\n if (a.name.toLowerCase() > b.name.toLowerCase()) {\n return 1;\n }\n if (a.name.toLowerCase() < b.name.toLowerCase()) {\n return -1;\n }\n return 0;\n });\n return metricSources;\n };\n DatasourceSrv.prototype.addDataSourceVariables = function (list) {\n // look for data source variables\n for (var i = 0; i < this.templateSrv.variables.length; i++) {\n var variable = this.templateSrv.variables[i];\n if (variable.type !== 'datasource') {\n continue;\n }\n var first = variable.current.value;\n if (first === 'default') {\n first = __WEBPACK_IMPORTED_MODULE_2_app_core_config__[\"a\" /* default */].defaultDatasource;\n }\n var ds = __WEBPACK_IMPORTED_MODULE_2_app_core_config__[\"a\" /* default */].datasources[first];\n if (ds) {\n list.push({\n name: '$' + variable.name,\n value: '$' + variable.name,\n meta: ds.meta,\n });\n }\n }\n };\n return DatasourceSrv;\n}());\n\n__WEBPACK_IMPORTED_MODULE_1_app_core_core_module__[\"a\" /* default */].service('datasourceSrv', DatasourceSrv);\n\n\n/***/ }),\n\n/***/ 2068:\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function(Buffer, process, global, __filename) {var require;/*\n * SystemJS v0.20.19 Dev\n */\n!function(){\"use strict\";function e(e){return ut?Symbol():\"@@\"+e}function t(e,t){ot||(t=t.replace(at?/file:\\/\\/\\//g:/file:\\/\\//g,\"\"));var r,n=(e.message||e)+\"\\n \"+t;r=ft&&e.fileName?new Error(n,e.fileName,e.lineNumber):new Error(n);var o=e.originalErr?e.originalErr.stack:e.stack;return r.stack=it?n+\"\\n \"+o:o,r.originalErr=e.originalErr||e,r}function r(e,t){throw new RangeError('Unable to resolve \"'+e+'\" to '+t)}function n(e,t){e=e.trim();var n=t&&t.substr(0,t.indexOf(\":\")+1),o=e[0],i=e[1];if(\"/\"===o&&\"/\"===i)return n||r(e,t),n+e;if(\".\"===o&&(\"/\"===i||\".\"===i&&(\"/\"===e[2]||2===e.length&&(e+=\"/\"))||1===e.length&&(e+=\"/\"))||\"/\"===o){var a,s=!n||\"/\"!==t[n.length];if(s?(void 0===t&&r(e,t),a=t):a=\"/\"===t[n.length+1]?\"file:\"!==n?(a=t.substr(n.length+2)).substr(a.indexOf(\"/\")+1):t.substr(8):t.substr(n.length+1),\"/\"===o){if(!s)return t.substr(0,t.length-a.length-1)+e;r(e,t)}for(var u=a.substr(0,a.lastIndexOf(\"/\")+1)+e,l=[],c=-1,f=0;f1&&g(e,r,i))})).then(function(t){if(void 0!==t){if(!(t instanceof l))throw new TypeError(\"Instantiate did not return a valid Module object.\");return delete i.records[r.key],e.trace&&v(e,r,n),o[r.key]=t}var a=r.registration;if(r.registration=void 0,!a)throw new TypeError(\"Module instantiation did not call an anonymous or correctly named System.register.\");return n.dependencies=a[0],r.importerSetters=[],n.moduleObj={},a[2]?(n.moduleObj.default=n.moduleObj.__useDefault={},n.executingRequire=a[1],n.execute=a[2]):y(e,r,n,a[1]),r}).catch(function(e){throw r.linkRecord=void 0,r.loadError=r.loadError||t(e,\"Instantiating \"+r.key)}))}function m(e,t,r,n,o,i){return e.resolve(t,r).then(function(r){i&&(i[t]=r);var a=o.records[r],s=n[r];if(s&&(!a||a.module&&s!==a.module))return s;if(a&&a.loadError)throw a.loadError;(!a||!s&&a.module)&&(a=d(o,r,a&&a.registration));var u=a.linkRecord;return u?h(e,a,u,n,o):a})}function v(e,t,r){e.loads=e.loads||{},e.loads[t.key]={key:t.key,deps:r.dependencies,dynamicDeps:[],depMap:r.depMap||{}}}function y(e,t,r,n){var o=r.moduleObj,i=t.importerSetters,a=!1,s=n.call(st,function(e,t){if(\"object\"==typeof e){var r=!1;for(var n in e)t=e[n],\"__useDefault\"===n||n in o&&o[n]===t||(r=!0,o[n]=t);if(!1===r)return t}else{if((a||e in o)&&o[e]===t)return t;o[e]=t}for(var s=0;sthis.len&&(this.match=e,this.len=r)}}function N(e,t){if(Object.hasOwnProperty.call(e,t))return t;var r={name:t,match:void 0,len:0};return Object.keys(e).forEach(z,r),r.match}function J(e,t,r,n){if(\"file:///\"===e.substr(0,8)){if(Ft)return $(e,t,r,n);throw new Error(\"Unable to fetch file URLs in this environment.\")}e=e.replace(/#/g,\"%23\");var o={headers:{Accept:\"application/x-es-module, */*\"}};return r&&(o.integrity=r),t&&(\"string\"==typeof t&&(o.headers.Authorization=t),o.credentials=\"include\"),fetch(e,o).then(function(e){if(e.ok)return n?e.arrayBuffer():e.text();throw new Error(\"Fetch error: \"+e.status+\" \"+e.statusText)})}function $(e,t,r,n){return new Promise(function(r,o){function i(){r(n?s.response:s.responseText)}function a(){o(new Error(\"XHR error: \"+(s.status?\" (\"+s.status+(s.statusText?\" \"+s.statusText:\"\")+\")\":\"\")+\" loading \"+e))}e=e.replace(/#/g,\"%23\");var s=new XMLHttpRequest;n&&(s.responseType=\"arraybuffer\"),s.onreadystatechange=function(){4===s.readyState&&(0==s.status?s.response?i():(s.addEventListener(\"error\",a),s.addEventListener(\"load\",i)):200===s.status?i():a())},s.open(\"GET\",e,!0),s.setRequestHeader&&(s.setRequestHeader(\"Accept\",\"application/x-es-module, */*\"),t&&(\"string\"==typeof t&&s.setRequestHeader(\"Authorization\",t),s.withCredentials=!0)),s.send(null)})}function B(e,t,r,n){return\"file:///\"!=e.substr(0,8)?Promise.reject(new Error('Unable to fetch \"'+e+'\". Only file URLs of the form file:/// supported running in Node.')):(Lt=Lt||__webpack_require__(2069),e=at?e.replace(/\\//g,\"\\\\\").substr(8):e.substr(7),new Promise(function(t,r){Lt.readFile(e,function(e,o){if(e)return r(e);if(n)t(o);else{var i=o+\"\";\"\\ufeff\"===i[0]&&(i=i.substr(1)),t(i)}})}))}function W(){throw new Error(\"No fetch method is defined for this environment.\")}function G(){return{pluginKey:void 0,pluginArgument:void 0,pluginModule:void 0,packageKey:void 0,packageConfig:void 0,load:void 0}}function H(e,t,r){var n=G();if(r){var o;t.pluginFirst?-1!==(o=r.lastIndexOf(\"!\"))&&(n.pluginArgument=n.pluginKey=r.substr(0,o)):-1!==(o=r.indexOf(\"!\"))&&(n.pluginArgument=n.pluginKey=r.substr(o+1)),n.packageKey=N(t.packages,r),n.packageKey&&(n.packageConfig=t.packages[n.packageKey])}return n}function Z(e,t){var r=this[St],n=G(),o=H(this,r,t),i=this;return Promise.resolve().then(function(){var r=e.lastIndexOf(\"#?\");if(-1===r)return Promise.resolve(e);var n=he.call(i,e.substr(r+2));return me.call(i,n,t,!0).then(function(t){return t?e.substr(0,r):\"@empty\"})}).then(function(e){var a=ne(r.pluginFirst,e);return a?(n.pluginKey=a.plugin,Promise.all([ee.call(i,r,a.argument,o&&o.pluginArgument||t,n,o,!0),i.resolve(a.plugin,t)]).then(function(e){if(n.pluginArgument=e[0],n.pluginKey=e[1],n.pluginArgument===n.pluginKey)throw new Error(\"Plugin \"+n.pluginArgument+\" cannot load itself, make sure it is excluded from any wildcard meta configuration via a custom loader: false rule.\");return oe(r.pluginFirst,e[0],e[1])})):ee.call(i,r,e,o&&o.pluginArgument||t,n,o,!1)}).then(function(e){return ve.call(i,e,t,o)}).then(function(e){return re.call(i,r,e,n),n.pluginKey||!n.load.loader?e:i.resolve(n.load.loader,e).then(function(t){return n.pluginKey=t,n.pluginArgument=e,e})}).then(function(e){return i[jt][e]=n,e})}function X(e,t){var r=ne(e.pluginFirst,t);if(r){var n=X.call(this,e,r.plugin);return oe(e.pluginFirst,Q.call(this,e,r.argument,void 0,!1,!1),n)}return Q.call(this,e,t,void 0,!1,!1)}function Y(e,t){var r=this[St],n=G(),o=o||H(this,r,t),i=ne(r.pluginFirst,e);return i?(n.pluginKey=Y.call(this,i.plugin,t),oe(r.pluginFirst,V.call(this,r,i.argument,o.pluginArgument||t,n,o,!!n.pluginKey),n.pluginKey)):V.call(this,r,e,o.pluginArgument||t,n,o,!!n.pluginKey)}function Q(e,t,r,o,i){var a=n(t,r||nt);if(a)return T(e.baseURL,e.paths,a);if(o){var s=N(e.map,t);if(s&&(t=e.map[s]+t.substr(s.length),a=n(t,nt)))return T(e.baseURL,e.paths,a)}if(this.registry.has(t))return t;if(\"@node/\"===t.substr(0,6))return t;var u=i&&\"/\"!==t[t.length-1],l=T(e.baseURL,e.paths,u?t+\"/\":t);return u?l.substr(0,l.length-1):l}function V(e,t,r,n,o,i){if(o&&o.packageConfig&&\".\"!==t[0]){var a=o.packageConfig.map,s=a&&N(a,t);if(s&&\"string\"==typeof a[s]){var u=ue(this,e,o.packageConfig,o.packageKey,s,t,n,i);if(u)return u}}var l=Q.call(this,e,t,r,!0,!0),c=de(e,l);if(n.packageKey=c&&c.packageKey||N(e.packages,l),!n.packageKey)return l;if(-1!==e.packageConfigKeys.indexOf(l))return n.packageKey=void 0,l;n.packageConfig=e.packages[n.packageKey]||(e.packages[n.packageKey]=Ee());var f=l.substr(n.packageKey.length+1);return ae(this,e,n.packageConfig,n.packageKey,f,n,i)}function ee(e,t,r,n,o,i){var a=this;return Et.then(function(){if(o&&o.packageConfig&&\"./\"!==t.substr(0,2)){var r=o.packageConfig.map,s=r&&N(r,t);if(s)return ce(a,e,o.packageConfig,o.packageKey,s,t,n,i)}return Et}).then(function(o){if(o)return o;var s=Q.call(a,e,t,r,!0,!0),u=de(e,s);return n.packageKey=u&&u.packageKey||N(e.packages,s),n.packageKey?-1!==e.packageConfigKeys.indexOf(s)?(n.packageKey=void 0,n.load=te(),n.load.format=\"json\",n.load.loader=\"\",Promise.resolve(s)):(n.packageConfig=e.packages[n.packageKey]||(e.packages[n.packageKey]=Ee()),(u&&!n.packageConfig.configured?pe(a,e,u.configPath,n):Et).then(function(){var t=s.substr(n.packageKey.length+1);return le(a,e,n.packageConfig,n.packageKey,t,n,i)})):Promise.resolve(s)})}function te(){return{extension:\"\",deps:void 0,format:void 0,loader:void 0,scriptLoad:void 0,globals:void 0,nonce:void 0,integrity:void 0,sourceMap:void 0,exports:void 0,encapsulateGlobal:!1,crossOrigin:void 0,cjsRequireDetection:!0,cjsDeferDepsExecute:!1,esModule:!1}}function re(e,t,r){r.load=r.load||te();var n,o=0;for(var i in e.meta)if(-1!==(n=i.indexOf(\"*\"))&&i.substr(0,n)===t.substr(0,n)&&i.substr(n+1)===t.substr(t.length-i.length+n+1)){var a=i.split(\"/\").length;a>o&&(o=a),F(r.load,e.meta[i],o!==a)}if(e.meta[t]&&F(r.load,e.meta[t],!1),r.packageKey){var s=t.substr(r.packageKey.length+1),u={};if(r.packageConfig.meta){o=0;ge(r.packageConfig.meta,s,function(e,t,r){r>o&&(o=r),F(u,t,r&&o>r)}),F(r.load,u,!1)}!r.packageConfig.format||r.pluginKey||r.load.loader||(r.load.format=r.load.format||r.packageConfig.format)}}function ne(e,t){var r,n,o=e?t.indexOf(\"!\"):t.lastIndexOf(\"!\");if(-1!==o)return e?(r=t.substr(o+1),n=t.substr(0,o)):(r=t.substr(0,o),n=t.substr(o+1)||r.substr(r.lastIndexOf(\".\")+1)),{argument:r,plugin:n}}function oe(e,t,r){return e?r+\"!\"+t:t+\"!\"+r}function ie(e,t,r,n,o){if(!n||!t.defaultExtension||\"/\"===n[n.length-1]||o)return n;var i=!1;if(t.meta&&ge(t.meta,n,function(e,t,r){if(0===r||e.lastIndexOf(\"*\")!==e.length-1)return i=!0}),!i&&e.meta&&ge(e.meta,r+\"/\"+n,function(e,t,r){if(0===r||e.lastIndexOf(\"*\")!==e.length-1)return i=!0}),i)return n;var a=\".\"+t.defaultExtension;return n.substr(n.length-a.length)!==a?n+a:n}function ae(e,t,r,n,o,i,a){if(!o){if(!r.main)return n;o=\"./\"===r.main.substr(0,2)?r.main.substr(2):r.main}if(r.map){var s=\"./\"+o,u=N(r.map,s);if(u||(s=\"./\"+ie(t,r,n,o,a))!==\"./\"+o&&(u=N(r.map,s)),u){var l=ue(e,t,r,n,u,s,i,a);if(l)return l}}return n+\"/\"+ie(t,r,n,o,a)}function se(e,t,r){return!(t.substr(0,e.length)===e&&r.length>e.length)}function ue(e,t,r,n,o,i,a,s){\"/\"===i[i.length-1]&&(i=i.substr(0,i.length-1));var u=r.map[o];if(\"object\"==typeof u)throw new Error(\"Synchronous conditional normalization not supported sync normalizing \"+o+\" in \"+n);if(se(o,u,i)&&\"string\"==typeof u)return V.call(e,t,u+i.substr(o.length),n+\"/\",a,a,s)}function le(e,t,r,n,o,i,a){if(!o){if(!r.main)return Promise.resolve(n);o=\"./\"===r.main.substr(0,2)?r.main.substr(2):r.main}var s,u;return r.map&&(s=\"./\"+o,(u=N(r.map,s))||(s=\"./\"+ie(t,r,n,o,a))!==\"./\"+o&&(u=N(r.map,s))),(u?ce(e,t,r,n,u,s,i,a):Et).then(function(e){return e?Promise.resolve(e):Promise.resolve(n+\"/\"+ie(t,r,n,o,a))})}function ce(e,t,r,n,o,i,a,s){\"/\"===i[i.length-1]&&(i=i.substr(0,i.length-1));var u=r.map[o];if(\"string\"==typeof u)return se(o,u,i)?ee.call(e,t,u+i.substr(o.length),n+\"/\",a,a,s).then(function(t){return ve.call(e,t,n+\"/\",a)}):Et;var l=[],c=[];for(var d in u){var p=he(d);c.push({condition:p,map:u[d]}),l.push(f.prototype.import.call(e,p.module,n))}return Promise.all(l).then(function(e){for(var t=0;t1?o instanceof Array?r[n]=[].concat(o):\"object\"==typeof o?r[n]=be(o,t-1):\"packageConfig\"!==n&&(r[n]=o):r[n]=o}return r}function we(e,t){var r=e[t];return r instanceof Array?e[t].concat([]):\"object\"==typeof r?be(r,3):e[t]}function xe(e){if(e){if(-1!==Or.indexOf(e))return we(this[St],e);throw new Error('\"'+e+'\" is not a valid configuration name. Must be one of '+Or.join(\", \")+\".\")}for(var t={},r=0;r \"+o.paths[a]+\" is no longer supported as wildcards are deprecated.\"),delete o.paths[a])}if(e.defaultJSExtensions&&R.call(o,\"The defaultJSExtensions configuration option is deprecated.\\n Use packages defaultExtension instead.\",!0),\"boolean\"==typeof e.pluginFirst&&(o.pluginFirst=e.pluginFirst),e.map)for(var a in e.map){var s=e.map[a];if(\"string\"==typeof s){var u=Q.call(r,o,s,void 0,!1,!1);\"/\"===u[u.length-1]&&\":\"!==a[a.length-1]&&\"/\"!==a[a.length-1]&&(u=u.substr(0,u.length-1)),o.map[a]=u}else{m=(m=Q.call(r,o,\"/\"!==a[a.length-1]?a+\"/\":a,void 0,!0,!0)).substr(0,m.length-1);var l=o.packages[m];l||((l=o.packages[m]=Ee()).defaultExtension=\"\"),Oe(l,{map:s},m,!1,o)}}if(e.packageConfigPaths){for(var c=[],f=0;ft.index)return!0;return!1}It.lastIndex=tr.lastIndex=rr.lastIndex=0;var r,n=[],o=[],i=[];if(e.length/e.split(\"\\n\").length<200){for(;r=rr.exec(e);)o.push([r.index,r.index+r[0].length]);for(;r=tr.exec(e);)t(o,r)||i.push([r.index+r[1].length,r.index+r[0].length-1])}for(;r=It.exec(e);)if(!t(o,r)&&!t(i,r)){var a=r[1].substr(1,r[1].length-2);if(a.match(/\"|'/))continue;n.push(a)}return n}function Fe(e){if(-1===nr.indexOf(e)){try{var t=st[e]}catch(t){nr.push(e)}this(e,t)}}function Ke(e){if(\"string\"==typeof e)return q(e,st);if(!(e instanceof Array))throw new Error(\"Global exports must be a string or array.\");for(var t={},r=0;r1;)e=e[n=o.shift()]=e[n]||{};void 0===e[n=o.shift()]&&(e[n]=r)}function Ve(e,t){var r=e.match(br);if(r)for(var n=r[0].match(wr),o=0;o value2) {\n thresholds.push({ value: value1, op: 'gt' });\n thresholds.push({ value: value2, op: 'lt' });\n }\n else {\n thresholds.push({ value: value1, op: 'lt' });\n thresholds.push({ value: value2, op: 'gt' });\n }\n break;\n }\n case 'within_range': {\n var value1 = evaluator.params[0];\n var value2 = evaluator.params[1];\n if (value1 > value2) {\n thresholds.push({ value: value1, op: 'lt' });\n thresholds.push({ value: value2, op: 'gt' });\n }\n else {\n thresholds.push({ value: value1, op: 'gt' });\n thresholds.push({ value: value2, op: 'lt' });\n }\n break;\n }\n }\n break;\n }\n for (var _i = 0, _a = panel.thresholds; _i < _a.length; _i++) {\n var t = _a[_i];\n t.fill = true;\n t.line = true;\n t.colorMode = 'critical';\n }\n var updated = true;\n return updated;\n };\n return ThresholdMapper;\n}());\n\n\n\n/***/ }),\n\n/***/ 2074:\n/***/ (function(module, exports, __webpack_require__) {\n\n/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n // Allow for deprecating things in the process of starting up.\n if (isUndefined(global.process)) {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n if (process.noDeprecation === true) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexports.debuglog = function(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = Object({\"JENKINS\":undefined,\"NODE_ENV\":\"production\",\"VERSION\":\"819eeb\"}).NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = __webpack_require__(2075);\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = __webpack_require__(2076);\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5), __webpack_require__(201)))\n\n/***/ }),\n\n/***/ 2075:\n/***/ (function(module, exports) {\n\nmodule.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object'\n && typeof arg.copy === 'function'\n && typeof arg.fill === 'function'\n && typeof arg.readUInt8 === 'function';\n}\n\n/***/ }),\n\n/***/ 2076:\n/***/ (function(module, exports) {\n\nif (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n\n\n/***/ }),\n\n/***/ 2077:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_plugins_datasource_graphite_module__ = __webpack_require__(2078);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_plugins_datasource_cloudwatch_module__ = __webpack_require__(2088);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_plugins_datasource_elasticsearch_module__ = __webpack_require__(2092);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_app_plugins_datasource_opentsdb_module__ = __webpack_require__(2101);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_app_plugins_datasource_grafana_module__ = __webpack_require__(2105);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_app_plugins_datasource_influxdb_module__ = __webpack_require__(2107);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_app_plugins_datasource_mixed_module__ = __webpack_require__(2112);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_app_plugins_datasource_mysql_module__ = __webpack_require__(2114);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_app_plugins_datasource_postgres_module__ = __webpack_require__(2118);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_app_plugins_datasource_prometheus_module__ = __webpack_require__(2122);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_app_plugins_datasource_mssql_module__ = __webpack_require__(2131);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_app_plugins_panel_text_module__ = __webpack_require__(2135);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_app_plugins_panel_graph_module__ = __webpack_require__(2006);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_app_plugins_panel_sensor_module__ = __webpack_require__(2148);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_app_plugins_panel_dashlist_module__ = __webpack_require__(2149);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15_app_plugins_panel_pluginlist_module__ = __webpack_require__(2150);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16_app_plugins_panel_alertlist_module__ = __webpack_require__(2151);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17_app_plugins_panel_heatmap_module__ = __webpack_require__(2152);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18_app_plugins_panel_table_module__ = __webpack_require__(2159);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19_app_plugins_panel_singlestat_module__ = __webpack_require__(2163);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20_app_plugins_panel_gettingstarted_module__ = __webpack_require__(2165);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21_app_plugins_panel_experimentdetails_module__ = __webpack_require__(2166);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22_app_plugins_panel_experimentvideo_module__ = __webpack_require__(2167);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23_app_plugins_app_testdata_module__ = __webpack_require__(2168);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24_app_plugins_app_testdata_datasource_module__ = __webpack_require__(2169);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar builtInPlugins = {\n 'app/plugins/datasource/graphite/module': __WEBPACK_IMPORTED_MODULE_0_app_plugins_datasource_graphite_module__,\n 'app/plugins/datasource/cloudwatch/module': __WEBPACK_IMPORTED_MODULE_1_app_plugins_datasource_cloudwatch_module__,\n 'app/plugins/datasource/elasticsearch/module': __WEBPACK_IMPORTED_MODULE_2_app_plugins_datasource_elasticsearch_module__,\n 'app/plugins/datasource/opentsdb/module': __WEBPACK_IMPORTED_MODULE_3_app_plugins_datasource_opentsdb_module__,\n 'app/plugins/datasource/grafana/module': __WEBPACK_IMPORTED_MODULE_4_app_plugins_datasource_grafana_module__,\n 'app/plugins/datasource/influxdb/module': __WEBPACK_IMPORTED_MODULE_5_app_plugins_datasource_influxdb_module__,\n 'app/plugins/datasource/mixed/module': __WEBPACK_IMPORTED_MODULE_6_app_plugins_datasource_mixed_module__,\n 'app/plugins/datasource/mysql/module': __WEBPACK_IMPORTED_MODULE_7_app_plugins_datasource_mysql_module__,\n 'app/plugins/datasource/postgres/module': __WEBPACK_IMPORTED_MODULE_8_app_plugins_datasource_postgres_module__,\n 'app/plugins/datasource/mssql/module': __WEBPACK_IMPORTED_MODULE_10_app_plugins_datasource_mssql_module__,\n 'app/plugins/datasource/prometheus/module': __WEBPACK_IMPORTED_MODULE_9_app_plugins_datasource_prometheus_module__,\n 'app/plugins/app/testdata/module': __WEBPACK_IMPORTED_MODULE_23_app_plugins_app_testdata_module__,\n 'app/plugins/app/testdata/datasource/module': __WEBPACK_IMPORTED_MODULE_24_app_plugins_app_testdata_datasource_module__,\n 'app/plugins/panel/text/module': __WEBPACK_IMPORTED_MODULE_11_app_plugins_panel_text_module__,\n 'app/plugins/panel/graph/module': __WEBPACK_IMPORTED_MODULE_12_app_plugins_panel_graph_module__,\n 'app/plugins/panel/sensor/module': __WEBPACK_IMPORTED_MODULE_13_app_plugins_panel_sensor_module__,\n 'app/plugins/panel/dashlist/module': __WEBPACK_IMPORTED_MODULE_14_app_plugins_panel_dashlist_module__,\n 'app/plugins/panel/pluginlist/module': __WEBPACK_IMPORTED_MODULE_15_app_plugins_panel_pluginlist_module__,\n 'app/plugins/panel/alertlist/module': __WEBPACK_IMPORTED_MODULE_16_app_plugins_panel_alertlist_module__,\n 'app/plugins/panel/heatmap/module': __WEBPACK_IMPORTED_MODULE_17_app_plugins_panel_heatmap_module__,\n 'app/plugins/panel/table/module': __WEBPACK_IMPORTED_MODULE_18_app_plugins_panel_table_module__,\n 'app/plugins/panel/singlestat/module': __WEBPACK_IMPORTED_MODULE_19_app_plugins_panel_singlestat_module__,\n 'app/plugins/panel/gettingstarted/module': __WEBPACK_IMPORTED_MODULE_20_app_plugins_panel_gettingstarted_module__,\n 'app/plugins/panel/experimentdetails/module': __WEBPACK_IMPORTED_MODULE_21_app_plugins_panel_experimentdetails_module__,\n 'app/plugins/panel/experimentvideo/module': __WEBPACK_IMPORTED_MODULE_22_app_plugins_panel_experimentvideo_module__,\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (builtInPlugins);\n\n\n/***/ }),\n\n/***/ 2078:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnnotationsQueryCtrl\", function() { return AnnotationsQueryCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__datasource__ = __webpack_require__(2079);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__query_ctrl__ = __webpack_require__(2081);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_ctrl__ = __webpack_require__(2087);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"Datasource\", function() { return __WEBPACK_IMPORTED_MODULE_0__datasource__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"QueryCtrl\", function() { return __WEBPACK_IMPORTED_MODULE_1__query_ctrl__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"ConfigCtrl\", function() { return __WEBPACK_IMPORTED_MODULE_2__config_ctrl__[\"a\"]; });\n\n\n\nvar AnnotationsQueryCtrl = /** @class */ (function () {\n function AnnotationsQueryCtrl() {\n }\n AnnotationsQueryCtrl.templateUrl = 'partials/annotations.editor.html';\n return AnnotationsQueryCtrl;\n}());\n\n\n\n/***/ }),\n\n/***/ 2079:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ \nGraphiteDatasource.$inject = [\"instanceSettings\", \"$q\", \"backendSrv\", \"templateSrv\"];__webpack_exports__[\"a\"] = GraphiteDatasource;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_utils_datemath__ = __webpack_require__(691);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_utils_version__ = __webpack_require__(2001);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__gfunc__ = __webpack_require__(2080);\n\n\n\n\n/** @ngInject */\nfunction GraphiteDatasource(instanceSettings, $q, backendSrv, templateSrv) {\n var _this = this;\n this.basicAuth = instanceSettings.basicAuth;\n this.url = instanceSettings.url;\n this.name = instanceSettings.name;\n this.graphiteVersion = instanceSettings.jsonData.graphiteVersion || '0.9';\n this.supportsTags = supportsTags(this.graphiteVersion);\n this.cacheTimeout = instanceSettings.cacheTimeout;\n this.withCredentials = instanceSettings.withCredentials;\n this.render_method = instanceSettings.render_method || 'POST';\n this.funcDefs = null;\n this.funcDefsPromise = null;\n this.getQueryOptionsInfo = function () {\n return {\n maxDataPoints: true,\n cacheTimeout: true,\n links: [\n {\n text: 'Help',\n url: 'http://docs.grafana.org/features/datasources/graphite/#using-graphite-in-grafana',\n },\n ],\n };\n };\n this.query = function (options) {\n var graphOptions = {\n from: this.translateTime(options.rangeRaw.from, false),\n until: this.translateTime(options.rangeRaw.to, true),\n targets: options.targets,\n format: options.format,\n cacheTimeout: options.cacheTimeout || this.cacheTimeout,\n maxDataPoints: options.maxDataPoints,\n };\n var params = this.buildGraphiteParams(graphOptions, options.scopedVars);\n if (params.length === 0) {\n return $q.when({ data: [] });\n }\n var httpOptions = {\n method: 'POST',\n url: '/render',\n data: params.join('&'),\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n };\n this.addTracingHeaders(httpOptions, options);\n if (options.panelId) {\n httpOptions.requestId = this.name + '.panelId.' + options.panelId;\n }\n return this.doGraphiteRequest(httpOptions).then(this.convertDataPointsToMs);\n };\n this.addTracingHeaders = function (httpOptions, options) {\n var proxyMode = !this.url.match(/^http/);\n if (proxyMode) {\n httpOptions.headers['X-Dashboard-Id'] = options.dashboardId;\n httpOptions.headers['X-Panel-Id'] = options.panelId;\n }\n };\n this.convertDataPointsToMs = function (result) {\n if (!result || !result.data) {\n return [];\n }\n for (var i = 0; i < result.data.length; i++) {\n var series = result.data[i];\n for (var y = 0; y < series.datapoints.length; y++) {\n series.datapoints[y][1] *= 1000;\n }\n }\n return result;\n };\n this.parseTags = function (tagString) {\n var tags = [];\n tags = tagString.split(',');\n if (tags.length === 1) {\n tags = tagString.split(' ');\n if (tags[0] === '') {\n tags = [];\n }\n }\n return tags;\n };\n this.annotationQuery = function (options) {\n var _this = this;\n // Graphite metric as annotation\n if (options.annotation.target) {\n var target = templateSrv.replace(options.annotation.target, {}, 'glob');\n var graphiteQuery = {\n rangeRaw: options.rangeRaw,\n targets: [{ target: target }],\n format: 'json',\n maxDataPoints: 100,\n };\n return this.query(graphiteQuery).then(function (result) {\n var list = [];\n for (var i = 0; i < result.data.length; i++) {\n var target = result.data[i];\n for (var y = 0; y < target.datapoints.length; y++) {\n var datapoint = target.datapoints[y];\n if (!datapoint[0]) {\n continue;\n }\n list.push({\n annotation: options.annotation,\n time: datapoint[1],\n title: target.target,\n });\n }\n }\n return list;\n });\n }\n else {\n // Graphite event as annotation\n var tags = templateSrv.replace(options.annotation.tags);\n return this.events({ range: options.rangeRaw, tags: tags }).then(function (results) {\n var list = [];\n for (var i = 0; i < results.data.length; i++) {\n var e = results.data[i];\n var tags = e.tags;\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isString(e.tags)) {\n tags = _this.parseTags(e.tags);\n }\n list.push({\n annotation: options.annotation,\n time: e.when * 1000,\n title: e.what,\n tags: tags,\n text: e.data,\n });\n }\n return list;\n });\n }\n };\n this.events = function (options) {\n try {\n var tags = '';\n if (options.tags) {\n tags = '&tags=' + options.tags;\n }\n return this.doGraphiteRequest({\n method: 'GET',\n url: '/events/get_data?from=' +\n this.translateTime(options.range.from, false) +\n '&until=' +\n this.translateTime(options.range.to, true) +\n tags,\n });\n }\n catch (err) {\n return $q.reject(err);\n }\n };\n this.targetContainsTemplate = function (target) {\n return templateSrv.variableExists(target.target);\n };\n this.translateTime = function (date, roundUp) {\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isString(date)) {\n if (date === 'now') {\n return 'now';\n }\n else if (date.indexOf('now-') >= 0 && date.indexOf('/') === -1) {\n date = date.substring(3);\n date = date.replace('m', 'min');\n date = date.replace('M', 'mon');\n return date;\n }\n date = __WEBPACK_IMPORTED_MODULE_1_app_core_utils_datemath__[\"parse\"](date, roundUp);\n }\n // graphite' s from filter is exclusive\n // here we step back one minute in order\n // to guarantee that we get all the data that\n // exists for the specified range\n if (roundUp) {\n if (date.get('s')) {\n date.add(1, 'm');\n }\n }\n else if (roundUp === false) {\n if (date.get('s')) {\n date.subtract(1, 'm');\n }\n }\n return date.unix();\n };\n this.metricFindQuery = function (query, optionalOptions) {\n var options = optionalOptions || {};\n var interpolatedQuery = templateSrv.replace(query);\n // special handling for tag_values([,]*), this is used for template variables\n var matches = interpolatedQuery.match(/^tag_values\\(([^,]+)((, *[^,]+)*)\\)$/);\n if (matches) {\n var expressions = [];\n var exprRegex = /, *([^,]+)/g;\n var match = void 0;\n while ((match = exprRegex.exec(matches[2])) !== null) {\n expressions.push(match[1]);\n }\n options.limit = 10000;\n return this.getTagValuesAutoComplete(expressions, matches[1], undefined, options);\n }\n // special handling for tags([,]*), this is used for template variables\n matches = interpolatedQuery.match(/^tags\\(([^,]*)((, *[^,]+)*)\\)$/);\n if (matches) {\n var expressions = [];\n if (matches[1]) {\n expressions.push(matches[1]);\n var exprRegex = /, *([^,]+)/g;\n var match = void 0;\n while ((match = exprRegex.exec(matches[2])) !== null) {\n expressions.push(match[1]);\n }\n }\n options.limit = 10000;\n return this.getTagsAutoComplete(expressions, undefined, options);\n }\n var httpOptions = {\n method: 'GET',\n url: '/metrics/find',\n params: {\n query: interpolatedQuery,\n },\n // for cancellations\n requestId: options.requestId,\n };\n if (options.range) {\n httpOptions.params.from = this.translateTime(options.range.from, false);\n httpOptions.params.until = this.translateTime(options.range.to, true);\n }\n return this.doGraphiteRequest(httpOptions).then(function (results) {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(results.data, function (metric) {\n return {\n text: metric.text,\n expandable: metric.expandable ? true : false,\n };\n });\n });\n };\n this.getTags = function (optionalOptions) {\n var options = optionalOptions || {};\n var httpOptions = {\n method: 'GET',\n url: '/tags',\n // for cancellations\n requestId: options.requestId,\n };\n if (options.range) {\n httpOptions.params.from = this.translateTime(options.range.from, false);\n httpOptions.params.until = this.translateTime(options.range.to, true);\n }\n return this.doGraphiteRequest(httpOptions).then(function (results) {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(results.data, function (tag) {\n return {\n text: tag.tag,\n id: tag.id,\n };\n });\n });\n };\n this.getTagValues = function (tag, optionalOptions) {\n var options = optionalOptions || {};\n var httpOptions = {\n method: 'GET',\n url: '/tags/' + templateSrv.replace(tag),\n // for cancellations\n requestId: options.requestId,\n };\n if (options.range) {\n httpOptions.params.from = this.translateTime(options.range.from, false);\n httpOptions.params.until = this.translateTime(options.range.to, true);\n }\n return this.doGraphiteRequest(httpOptions).then(function (results) {\n if (results.data && results.data.values) {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(results.data.values, function (value) {\n return {\n text: value.value,\n id: value.id,\n };\n });\n }\n else {\n return [];\n }\n });\n };\n this.getTagsAutoComplete = function (expressions, tagPrefix, optionalOptions) {\n var options = optionalOptions || {};\n var httpOptions = {\n method: 'GET',\n url: '/tags/autoComplete/tags',\n params: {\n expr: __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(expressions, function (expression) { return templateSrv.replace((expression || '').trim()); }),\n },\n // for cancellations\n requestId: options.requestId,\n };\n if (tagPrefix) {\n httpOptions.params.tagPrefix = tagPrefix;\n }\n if (options.limit) {\n httpOptions.params.limit = options.limit;\n }\n if (options.range) {\n httpOptions.params.from = _this.translateTime(options.range.from, false);\n httpOptions.params.until = _this.translateTime(options.range.to, true);\n }\n return _this.doGraphiteRequest(httpOptions).then(function (results) {\n if (results.data) {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(results.data, function (tag) {\n return { text: tag };\n });\n }\n else {\n return [];\n }\n });\n };\n this.getTagValuesAutoComplete = function (expressions, tag, valuePrefix, optionalOptions) {\n var options = optionalOptions || {};\n var httpOptions = {\n method: 'GET',\n url: '/tags/autoComplete/values',\n params: {\n expr: __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(expressions, function (expression) { return templateSrv.replace((expression || '').trim()); }),\n tag: templateSrv.replace((tag || '').trim()),\n },\n // for cancellations\n requestId: options.requestId,\n };\n if (valuePrefix) {\n httpOptions.params.valuePrefix = valuePrefix;\n }\n if (options.limit) {\n httpOptions.params.limit = options.limit;\n }\n if (options.range) {\n httpOptions.params.from = _this.translateTime(options.range.from, false);\n httpOptions.params.until = _this.translateTime(options.range.to, true);\n }\n return _this.doGraphiteRequest(httpOptions).then(function (results) {\n if (results.data) {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(results.data, function (value) {\n return { text: value };\n });\n }\n else {\n return [];\n }\n });\n };\n this.getVersion = function (optionalOptions) {\n var options = optionalOptions || {};\n var httpOptions = {\n method: 'GET',\n url: '/version',\n requestId: options.requestId,\n };\n return this.doGraphiteRequest(httpOptions)\n .then(function (results) {\n if (results.data) {\n var semver = new __WEBPACK_IMPORTED_MODULE_2_app_core_utils_version__[\"a\" /* SemVersion */](results.data);\n return semver.isValid() ? results.data : '';\n }\n return '';\n })\n .catch(function () {\n return '';\n });\n };\n this.createFuncInstance = function (funcDef, options) {\n return __WEBPACK_IMPORTED_MODULE_3__gfunc__[\"a\" /* default */].createFuncInstance(funcDef, options, this.funcDefs);\n };\n this.getFuncDef = function (name) {\n return __WEBPACK_IMPORTED_MODULE_3__gfunc__[\"a\" /* default */].getFuncDef(name, this.funcDefs);\n };\n this.waitForFuncDefsLoaded = function () {\n return this.getFuncDefs();\n };\n this.getFuncDefs = function () {\n var _this = this;\n if (this.funcDefsPromise !== null) {\n return this.funcDefsPromise;\n }\n if (!supportsFunctionIndex(this.graphiteVersion)) {\n this.funcDefs = __WEBPACK_IMPORTED_MODULE_3__gfunc__[\"a\" /* default */].getFuncDefs(this.graphiteVersion);\n this.funcDefsPromise = Promise.resolve(this.funcDefs);\n return this.funcDefsPromise;\n }\n var httpOptions = {\n method: 'GET',\n url: '/functions',\n };\n this.funcDefsPromise = this.doGraphiteRequest(httpOptions)\n .then(function (results) {\n if (results.status !== 200 || typeof results.data !== 'object') {\n _this.funcDefs = __WEBPACK_IMPORTED_MODULE_3__gfunc__[\"a\" /* default */].getFuncDefs(_this.graphiteVersion);\n }\n else {\n _this.funcDefs = __WEBPACK_IMPORTED_MODULE_3__gfunc__[\"a\" /* default */].parseFuncDefs(results.data);\n }\n return _this.funcDefs;\n })\n .catch(function (err) {\n console.log('Fetching graphite functions error', err);\n _this.funcDefs = __WEBPACK_IMPORTED_MODULE_3__gfunc__[\"a\" /* default */].getFuncDefs(_this.graphiteVersion);\n return _this.funcDefs;\n });\n return this.funcDefsPromise;\n };\n this.testDatasource = function () {\n var query = {\n panelId: 3,\n rangeRaw: { from: 'now-1h', to: 'now' },\n targets: [{ target: 'constantLine(100)' }],\n maxDataPoints: 300,\n };\n return this.query(query).then(function () {\n return { status: 'success', message: 'Data source is working' };\n });\n };\n this.doGraphiteRequest = function (options) {\n if (this.basicAuth || this.withCredentials) {\n options.withCredentials = true;\n }\n if (this.basicAuth) {\n options.headers = options.headers || {};\n options.headers.Authorization = this.basicAuth;\n }\n options.url = this.url + options.url;\n options.inspect = { type: 'graphite' };\n return backendSrv.datasourceRequest(options);\n };\n this._seriesRefLetters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n this.buildGraphiteParams = function (options, scopedVars) {\n var graphite_options = ['from', 'until', 'rawData', 'format', 'maxDataPoints', 'cacheTimeout'];\n var clean_options = [], targets = {};\n var target, targetValue, i;\n var regex = /\\#([A-Z])/g;\n var intervalFormatFixRegex = /'(\\d+)m'/gi;\n var hasTargets = false;\n options['format'] = 'json';\n function fixIntervalFormat(match) {\n return match.replace('m', 'min').replace('M', 'mon');\n }\n for (i = 0; i < options.targets.length; i++) {\n target = options.targets[i];\n if (!target.target) {\n continue;\n }\n if (!target.refId) {\n target.refId = this._seriesRefLetters[i];\n }\n targetValue = templateSrv.replace(target.target, scopedVars);\n targetValue = targetValue.replace(intervalFormatFixRegex, fixIntervalFormat);\n targets[target.refId] = targetValue;\n }\n function nestedSeriesRegexReplacer(match, g1) {\n return targets[g1] || match;\n }\n for (i = 0; i < options.targets.length; i++) {\n target = options.targets[i];\n if (!target.target) {\n continue;\n }\n targetValue = targets[target.refId];\n targetValue = targetValue.replace(regex, nestedSeriesRegexReplacer);\n targets[target.refId] = targetValue;\n if (!target.hide) {\n hasTargets = true;\n clean_options.push('target=' + encodeURIComponent(targetValue));\n }\n }\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(options, function (value, key) {\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.indexOf(graphite_options, key) === -1) {\n return;\n }\n if (value) {\n clean_options.push(key + '=' + encodeURIComponent(value));\n }\n });\n if (!hasTargets) {\n return [];\n }\n return clean_options;\n };\n}\nfunction supportsTags(version) {\n return Object(__WEBPACK_IMPORTED_MODULE_2_app_core_utils_version__[\"b\" /* isVersionGtOrEq */])(version, '1.1');\n}\nfunction supportsFunctionIndex(version) {\n return Object(__WEBPACK_IMPORTED_MODULE_2_app_core_utils_version__[\"b\" /* isVersionGtOrEq */])(version, '1.1');\n}\n\n\n/***/ }),\n\n/***/ 2080:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export FuncInstance */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_utils_version__ = __webpack_require__(2001);\n\n\nvar index = {};\nfunction addFuncDef(funcDef) {\n funcDef.params = funcDef.params || [];\n funcDef.defaultParams = funcDef.defaultParams || [];\n index[funcDef.name] = funcDef;\n if (funcDef.shortName) {\n index[funcDef.shortName] = funcDef;\n }\n}\nvar optionalSeriesRefArgs = [{ name: 'other', type: 'value_or_series', optional: true, multiple: true }];\naddFuncDef({\n name: 'scaleToSeconds',\n category: 'Transform',\n params: [{ name: 'seconds', type: 'int' }],\n defaultParams: [1],\n});\naddFuncDef({\n name: 'perSecond',\n category: 'Transform',\n params: [{ name: 'max value', type: 'int', optional: true }],\n defaultParams: [],\n});\naddFuncDef({\n name: 'holtWintersForecast',\n category: 'Calculate',\n});\naddFuncDef({\n name: 'holtWintersConfidenceBands',\n category: 'Calculate',\n params: [{ name: 'delta', type: 'int' }],\n defaultParams: [3],\n});\naddFuncDef({\n name: 'holtWintersAberration',\n category: 'Calculate',\n params: [{ name: 'delta', type: 'int' }],\n defaultParams: [3],\n});\naddFuncDef({\n name: 'nPercentile',\n category: 'Calculate',\n params: [{ name: 'Nth percentile', type: 'int' }],\n defaultParams: [95],\n});\naddFuncDef({\n name: 'diffSeries',\n params: optionalSeriesRefArgs,\n defaultParams: ['#A'],\n category: 'Combine',\n});\naddFuncDef({\n name: 'stddevSeries',\n params: optionalSeriesRefArgs,\n defaultParams: [''],\n category: 'Combine',\n});\naddFuncDef({\n name: 'divideSeries',\n params: optionalSeriesRefArgs,\n defaultParams: ['#A'],\n category: 'Combine',\n});\naddFuncDef({\n name: 'multiplySeries',\n params: optionalSeriesRefArgs,\n defaultParams: ['#A'],\n category: 'Combine',\n});\naddFuncDef({\n name: 'asPercent',\n params: optionalSeriesRefArgs,\n defaultParams: ['#A'],\n category: 'Combine',\n});\naddFuncDef({\n name: 'group',\n params: optionalSeriesRefArgs,\n defaultParams: ['#A', '#B'],\n category: 'Combine',\n});\naddFuncDef({\n name: 'sumSeries',\n shortName: 'sum',\n category: 'Combine',\n params: optionalSeriesRefArgs,\n defaultParams: [''],\n});\naddFuncDef({\n name: 'averageSeries',\n shortName: 'avg',\n category: 'Combine',\n params: optionalSeriesRefArgs,\n defaultParams: [''],\n});\naddFuncDef({\n name: 'rangeOfSeries',\n category: 'Combine',\n});\naddFuncDef({\n name: 'percentileOfSeries',\n category: 'Combine',\n params: [{ name: 'n', type: 'int' }, { name: 'interpolate', type: 'boolean', options: ['true', 'false'] }],\n defaultParams: [95, 'false'],\n});\naddFuncDef({\n name: 'sumSeriesWithWildcards',\n category: 'Combine',\n params: [{ name: 'node', type: 'int', multiple: true }],\n defaultParams: [3],\n});\naddFuncDef({\n name: 'maxSeries',\n shortName: 'max',\n category: 'Combine',\n});\naddFuncDef({\n name: 'minSeries',\n shortName: 'min',\n category: 'Combine',\n});\naddFuncDef({\n name: 'averageSeriesWithWildcards',\n category: 'Combine',\n params: [{ name: 'node', type: 'int', multiple: true }],\n defaultParams: [3],\n});\naddFuncDef({\n name: 'alias',\n category: 'Alias',\n params: [{ name: 'alias', type: 'string' }],\n defaultParams: ['alias'],\n});\naddFuncDef({\n name: 'aliasSub',\n category: 'Alias',\n params: [{ name: 'search', type: 'string' }, { name: 'replace', type: 'string' }],\n defaultParams: ['', '\\\\1'],\n});\naddFuncDef({\n name: 'consolidateBy',\n category: 'Special',\n params: [\n {\n name: 'function',\n type: 'string',\n options: ['sum', 'average', 'min', 'max'],\n },\n ],\n defaultParams: ['max'],\n});\naddFuncDef({\n name: 'cumulative',\n category: 'Special',\n params: [],\n defaultParams: [],\n});\naddFuncDef({\n name: 'groupByNode',\n category: 'Combine',\n params: [\n {\n name: 'node',\n type: 'int',\n options: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12],\n },\n {\n name: 'function',\n type: 'string',\n options: ['sum', 'avg', 'maxSeries'],\n },\n ],\n defaultParams: [3, 'sum'],\n});\naddFuncDef({\n name: 'aliasByNode',\n category: 'Alias',\n params: [\n {\n name: 'node',\n type: 'int',\n options: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12],\n multiple: true,\n },\n ],\n defaultParams: [3],\n});\naddFuncDef({\n name: 'substr',\n category: 'Special',\n params: [\n {\n name: 'start',\n type: 'int',\n options: [-6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12],\n },\n {\n name: 'stop',\n type: 'int',\n options: [-6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12],\n },\n ],\n defaultParams: [0, 0],\n});\naddFuncDef({\n name: 'sortByName',\n category: 'Sorting',\n params: [\n {\n name: 'natural',\n type: 'boolean',\n options: ['true', 'false'],\n optional: true,\n },\n ],\n defaultParams: ['false'],\n});\naddFuncDef({\n name: 'sortByMaxima',\n category: 'Sorting',\n});\naddFuncDef({\n name: 'sortByMinima',\n category: 'Sorting',\n});\naddFuncDef({\n name: 'sortByTotal',\n category: 'Sorting',\n});\naddFuncDef({\n name: 'aliasByMetric',\n category: 'Alias',\n});\naddFuncDef({\n name: 'randomWalk',\n fake: true,\n category: 'Special',\n params: [{ name: 'name', type: 'string' }],\n defaultParams: ['randomWalk'],\n});\naddFuncDef({\n name: 'countSeries',\n category: 'Combine',\n});\naddFuncDef({\n name: 'constantLine',\n category: 'Special',\n params: [{ name: 'value', type: 'int' }],\n defaultParams: [10],\n});\naddFuncDef({\n name: 'cactiStyle',\n category: 'Special',\n});\naddFuncDef({\n name: 'keepLastValue',\n category: 'Transform',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [100],\n});\naddFuncDef({\n name: 'changed',\n category: 'Special',\n params: [],\n defaultParams: [],\n});\naddFuncDef({\n name: 'scale',\n category: 'Transform',\n params: [{ name: 'factor', type: 'int' }],\n defaultParams: [1],\n});\naddFuncDef({\n name: 'offset',\n category: 'Transform',\n params: [{ name: 'amount', type: 'int' }],\n defaultParams: [10],\n});\naddFuncDef({\n name: 'transformNull',\n category: 'Transform',\n params: [{ name: 'amount', type: 'int' }],\n defaultParams: [0],\n});\naddFuncDef({\n name: 'integral',\n category: 'Transform',\n});\naddFuncDef({\n name: 'derivative',\n category: 'Transform',\n});\naddFuncDef({\n name: 'nonNegativeDerivative',\n category: 'Transform',\n params: [{ name: 'max value or 0', type: 'int', optional: true }],\n defaultParams: [''],\n});\naddFuncDef({\n name: 'timeShift',\n category: 'Transform',\n params: [\n {\n name: 'amount',\n type: 'select',\n options: ['1h', '6h', '12h', '1d', '2d', '7d', '14d', '30d'],\n },\n ],\n defaultParams: ['1d'],\n});\naddFuncDef({\n name: 'timeStack',\n category: 'Transform',\n params: [\n {\n name: 'timeShiftUnit',\n type: 'select',\n options: ['1h', '6h', '12h', '1d', '2d', '7d', '14d', '30d'],\n },\n { name: 'timeShiftStart', type: 'int' },\n { name: 'timeShiftEnd', type: 'int' },\n ],\n defaultParams: ['1d', 0, 7],\n});\naddFuncDef({\n name: 'summarize',\n category: 'Transform',\n params: [\n { name: 'interval', type: 'string' },\n {\n name: 'func',\n type: 'select',\n options: ['sum', 'avg', 'min', 'max', 'last'],\n },\n {\n name: 'alignToFrom',\n type: 'boolean',\n optional: true,\n options: ['false', 'true'],\n },\n ],\n defaultParams: ['1h', 'sum', 'false'],\n});\naddFuncDef({\n name: 'smartSummarize',\n category: 'Transform',\n params: [\n { name: 'interval', type: 'string' },\n {\n name: 'func',\n type: 'select',\n options: ['sum', 'avg', 'min', 'max', 'last'],\n },\n ],\n defaultParams: ['1h', 'sum'],\n});\naddFuncDef({\n name: 'absolute',\n category: 'Transform',\n});\naddFuncDef({\n name: 'hitcount',\n category: 'Transform',\n params: [{ name: 'interval', type: 'string' }],\n defaultParams: ['10s'],\n});\naddFuncDef({\n name: 'log',\n category: 'Transform',\n params: [{ name: 'base', type: 'int' }],\n defaultParams: ['10'],\n});\naddFuncDef({\n name: 'averageAbove',\n category: 'Filter Series',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [25],\n});\naddFuncDef({\n name: 'averageBelow',\n category: 'Filter Series',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [25],\n});\naddFuncDef({\n name: 'currentAbove',\n category: 'Filter Series',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [25],\n});\naddFuncDef({\n name: 'currentBelow',\n category: 'Filter Series',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [25],\n});\naddFuncDef({\n name: 'maximumAbove',\n category: 'Filter Series',\n params: [{ name: 'value', type: 'int' }],\n defaultParams: [0],\n});\naddFuncDef({\n name: 'maximumBelow',\n category: 'Filter Series',\n params: [{ name: 'value', type: 'int' }],\n defaultParams: [0],\n});\naddFuncDef({\n name: 'minimumAbove',\n category: 'Filter Series',\n params: [{ name: 'value', type: 'int' }],\n defaultParams: [0],\n});\naddFuncDef({\n name: 'minimumBelow',\n category: 'Filter Series',\n params: [{ name: 'value', type: 'int' }],\n defaultParams: [0],\n});\naddFuncDef({\n name: 'limit',\n category: 'Filter Series',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [5],\n});\naddFuncDef({\n name: 'mostDeviant',\n category: 'Filter Series',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [10],\n});\naddFuncDef({\n name: 'exclude',\n category: 'Filter Series',\n params: [{ name: 'exclude', type: 'string' }],\n defaultParams: ['exclude'],\n});\naddFuncDef({\n name: 'highestCurrent',\n category: 'Filter Series',\n params: [{ name: 'count', type: 'int' }],\n defaultParams: [5],\n});\naddFuncDef({\n name: 'highestMax',\n category: 'Filter Series',\n params: [{ name: 'count', type: 'int' }],\n defaultParams: [5],\n});\naddFuncDef({\n name: 'lowestCurrent',\n category: 'Filter Series',\n params: [{ name: 'count', type: 'int' }],\n defaultParams: [5],\n});\naddFuncDef({\n name: 'movingAverage',\n category: 'Calculate',\n params: [\n {\n name: 'windowSize',\n type: 'int_or_interval',\n options: ['5', '7', '10', '5min', '10min', '30min', '1hour'],\n },\n ],\n defaultParams: [10],\n});\naddFuncDef({\n name: 'movingMedian',\n category: 'Calculate',\n params: [\n {\n name: 'windowSize',\n type: 'int_or_interval',\n options: ['5', '7', '10', '5min', '10min', '30min', '1hour'],\n },\n ],\n defaultParams: ['5'],\n});\naddFuncDef({\n name: 'stdev',\n category: 'Calculate',\n params: [{ name: 'n', type: 'int' }, { name: 'tolerance', type: 'int' }],\n defaultParams: [5, 0.1],\n});\naddFuncDef({\n name: 'highestAverage',\n category: 'Filter Series',\n params: [{ name: 'count', type: 'int' }],\n defaultParams: [5],\n});\naddFuncDef({\n name: 'lowestAverage',\n category: 'Filter Series',\n params: [{ name: 'count', type: 'int' }],\n defaultParams: [5],\n});\naddFuncDef({\n name: 'removeAbovePercentile',\n category: 'Filter Data',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [5],\n});\naddFuncDef({\n name: 'removeAboveValue',\n category: 'Filter Data',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [5],\n});\naddFuncDef({\n name: 'removeBelowPercentile',\n category: 'Filter Data',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [5],\n});\naddFuncDef({\n name: 'removeBelowValue',\n category: 'Filter Data',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [5],\n});\naddFuncDef({\n name: 'useSeriesAbove',\n category: 'Filter Series',\n params: [{ name: 'value', type: 'int' }, { name: 'search', type: 'string' }, { name: 'replace', type: 'string' }],\n defaultParams: [0, 'search', 'replace'],\n});\n////////////////////\n// Graphite 1.0.x //\n////////////////////\naddFuncDef({\n name: 'aggregateLine',\n category: 'Calculate',\n params: [\n {\n name: 'func',\n type: 'select',\n options: ['sum', 'avg', 'min', 'max', 'last'],\n },\n ],\n defaultParams: ['avg'],\n version: '1.0',\n});\naddFuncDef({\n name: 'averageOutsidePercentile',\n category: 'Filter Series',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [95],\n version: '1.0',\n});\naddFuncDef({\n name: 'delay',\n category: 'Transform',\n params: [{ name: 'steps', type: 'int' }],\n defaultParams: [1],\n version: '1.0',\n});\naddFuncDef({\n name: 'exponentialMovingAverage',\n category: 'Calculate',\n params: [\n {\n name: 'windowSize',\n type: 'int_or_interval',\n options: ['5', '7', '10', '5min', '10min', '30min', '1hour'],\n },\n ],\n defaultParams: [10],\n version: '1.0',\n});\naddFuncDef({\n name: 'fallbackSeries',\n category: 'Special',\n params: [{ name: 'fallback', type: 'string' }],\n defaultParams: ['constantLine(0)'],\n version: '1.0',\n});\naddFuncDef({\n name: 'grep',\n category: 'Filter Series',\n params: [{ name: 'grep', type: 'string' }],\n defaultParams: ['grep'],\n version: '1.0',\n});\naddFuncDef({\n name: 'groupByNodes',\n category: 'Combine',\n params: [\n {\n name: 'function',\n type: 'string',\n options: ['sum', 'avg', 'maxSeries'],\n },\n {\n name: 'node',\n type: 'int',\n options: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12],\n multiple: true,\n },\n ],\n defaultParams: ['sum', 3],\n version: '1.0',\n});\naddFuncDef({\n name: 'integralByInterval',\n category: 'Transform',\n params: [\n {\n name: 'intervalUnit',\n type: 'select',\n options: ['1h', '6h', '12h', '1d', '2d', '7d', '14d', '30d'],\n },\n ],\n defaultParams: ['1d'],\n version: '1.0',\n});\naddFuncDef({\n name: 'interpolate',\n category: 'Transform',\n params: [{ name: 'limit', type: 'int', optional: true }],\n defaultParams: [],\n version: '1.0',\n});\naddFuncDef({\n name: 'invert',\n category: 'Transform',\n version: '1.0',\n});\naddFuncDef({\n name: 'isNonNull',\n category: 'Combine',\n version: '1.0',\n});\naddFuncDef({\n name: 'linearRegression',\n category: 'Calculate',\n params: [\n {\n name: 'startSourceAt',\n type: 'select',\n options: ['-1h', '-6h', '-12h', '-1d', '-2d', '-7d', '-14d', '-30d'],\n optional: true,\n },\n {\n name: 'endSourceAt',\n type: 'select',\n options: ['-1h', '-6h', '-12h', '-1d', '-2d', '-7d', '-14d', '-30d'],\n optional: true,\n },\n ],\n defaultParams: [],\n version: '1.0',\n});\naddFuncDef({\n name: 'mapSeries',\n shortName: 'map',\n params: [{ name: 'node', type: 'int' }],\n defaultParams: [3],\n category: 'Combine',\n version: '1.0',\n});\naddFuncDef({\n name: 'movingMin',\n category: 'Calculate',\n params: [\n {\n name: 'windowSize',\n type: 'int_or_interval',\n options: ['5', '7', '10', '5min', '10min', '30min', '1hour'],\n },\n ],\n defaultParams: [10],\n version: '1.0',\n});\naddFuncDef({\n name: 'movingMax',\n category: 'Calculate',\n params: [\n {\n name: 'windowSize',\n type: 'int_or_interval',\n options: ['5', '7', '10', '5min', '10min', '30min', '1hour'],\n },\n ],\n defaultParams: [10],\n version: '1.0',\n});\naddFuncDef({\n name: 'movingSum',\n category: 'Calculate',\n params: [\n {\n name: 'windowSize',\n type: 'int_or_interval',\n options: ['5', '7', '10', '5min', '10min', '30min', '1hour'],\n },\n ],\n defaultParams: [10],\n version: '1.0',\n});\naddFuncDef({\n name: 'multiplySeriesWithWildcards',\n category: 'Combine',\n params: [\n {\n name: 'position',\n type: 'int',\n options: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12],\n multiple: true,\n },\n ],\n defaultParams: [2],\n version: '1.0',\n});\naddFuncDef({\n name: 'offsetToZero',\n category: 'Transform',\n version: '1.0',\n});\naddFuncDef({\n name: 'pow',\n category: 'Transform',\n params: [{ name: 'factor', type: 'int' }],\n defaultParams: [10],\n version: '1.0',\n});\naddFuncDef({\n name: 'powSeries',\n category: 'Transform',\n params: optionalSeriesRefArgs,\n defaultParams: [''],\n version: '1.0',\n});\naddFuncDef({\n name: 'reduceSeries',\n shortName: 'reduce',\n params: [\n {\n name: 'function',\n type: 'string',\n options: ['asPercent', 'diffSeries', 'divideSeries'],\n },\n {\n name: 'reduceNode',\n type: 'int',\n options: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13],\n },\n { name: 'reduceMatchers', type: 'string', multiple: true },\n ],\n defaultParams: ['asPercent', 2, 'used_bytes'],\n category: 'Combine',\n version: '1.0',\n});\naddFuncDef({\n name: 'removeBetweenPercentile',\n category: 'Filter Series',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [95],\n version: '1.0',\n});\naddFuncDef({\n name: 'removeEmptySeries',\n category: 'Filter Series',\n version: '1.0',\n});\naddFuncDef({\n name: 'squareRoot',\n category: 'Transform',\n version: '1.0',\n});\naddFuncDef({\n name: 'timeSlice',\n category: 'Transform',\n params: [\n {\n name: 'startSliceAt',\n type: 'select',\n options: ['-1h', '-6h', '-12h', '-1d', '-2d', '-7d', '-14d', '-30d'],\n },\n {\n name: 'endSliceAt',\n type: 'select',\n options: ['-1h', '-6h', '-12h', '-1d', '-2d', '-7d', '-14d', '-30d'],\n optional: true,\n },\n ],\n defaultParams: ['-1h'],\n version: '1.0',\n});\naddFuncDef({\n name: 'weightedAverage',\n category: 'Combine',\n params: [\n { name: 'other', type: 'value_or_series', optional: true },\n {\n name: 'node',\n type: 'int',\n options: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12],\n },\n ],\n defaultParams: ['#A', 4],\n version: '1.0',\n});\naddFuncDef({\n name: 'seriesByTag',\n category: 'Special',\n params: [{ name: 'tagExpression', type: 'string', multiple: true }],\n version: '1.1',\n});\naddFuncDef({\n name: 'groupByTags',\n category: 'Combine',\n params: [\n {\n name: 'function',\n type: 'string',\n options: ['sum', 'avg', 'maxSeries'],\n },\n { name: 'tag', type: 'string', multiple: true },\n ],\n defaultParams: ['sum', 'tag'],\n version: '1.1',\n});\naddFuncDef({\n name: 'aliasByTags',\n category: 'Alias',\n params: [{ name: 'tag', type: 'string', multiple: true }],\n defaultParams: ['tag'],\n version: '1.1',\n});\nfunction isVersionRelatedFunction(obj, graphiteVersion) {\n return !obj.version || Object(__WEBPACK_IMPORTED_MODULE_1_app_core_utils_version__[\"b\" /* isVersionGtOrEq */])(graphiteVersion, obj.version);\n}\nvar FuncInstance = /** @class */ (function () {\n function FuncInstance(funcDef, options) {\n this.def = funcDef;\n this.params = [];\n if (options && options.withDefaultParams) {\n this.params = funcDef.defaultParams.slice(0);\n }\n this.updateText();\n }\n FuncInstance.prototype.render = function (metricExp) {\n var str = this.def.name + '(';\n var parameters = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(this.params, function (value, index) {\n var paramType;\n if (index < this.def.params.length) {\n paramType = this.def.params[index].type;\n }\n else if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.get(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.last(this.def.params), 'multiple')) {\n paramType = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.get(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.last(this.def.params), 'type');\n }\n if (paramType === 'value_or_series') {\n return value;\n }\n if (paramType === 'boolean' && __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.includes(['true', 'false'], value)) {\n return value;\n }\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.includes(['int', 'float', 'int_or_interval', 'node_or_tag', 'node'], paramType) && __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isFinite(+value)) {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.toString(+value);\n }\n return \"'\" + value + \"'\";\n }.bind(this));\n // don't send any blank parameters to graphite\n while (parameters[parameters.length - 1] === '') {\n parameters.pop();\n }\n if (metricExp) {\n parameters.unshift(metricExp);\n }\n return str + parameters.join(', ') + ')';\n };\n FuncInstance.prototype._hasMultipleParamsInString = function (strValue, index) {\n if (strValue.indexOf(',') === -1) {\n return false;\n }\n if (this.def.params[index + 1] && this.def.params[index + 1].optional) {\n return true;\n }\n if (index + 1 >= this.def.params.length && __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.get(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.last(this.def.params), 'multiple')) {\n return true;\n }\n return false;\n };\n FuncInstance.prototype.updateParam = function (strValue, index) {\n // handle optional parameters\n // if string contains ',' and next param is optional, split and update both\n if (this._hasMultipleParamsInString(strValue, index)) {\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(strValue.split(','), function (partVal, idx) {\n this.updateParam(partVal.trim(), index + idx);\n }.bind(this));\n return;\n }\n if (strValue === '' && (index >= this.def.params.length || this.def.params[index].optional)) {\n this.params.splice(index, 1);\n }\n else {\n this.params[index] = strValue;\n }\n this.updateText();\n };\n FuncInstance.prototype.updateText = function () {\n if (this.params.length === 0) {\n this.text = this.def.name + '()';\n return;\n }\n var text = this.def.name + '(';\n text += this.params.join(', ');\n text += ')';\n this.text = text;\n };\n return FuncInstance;\n}());\n\nfunction createFuncInstance(funcDef, options, idx) {\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isString(funcDef)) {\n funcDef = getFuncDef(funcDef, idx);\n }\n return new FuncInstance(funcDef, options);\n}\nfunction getFuncDef(name, idx) {\n if (!(idx || index)[name]) {\n throw { message: 'Method not found ' + name };\n }\n return (idx || index)[name];\n}\nfunction getFuncDefs(graphiteVersion, idx) {\n var funcs = {};\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.forEach(idx || index, function (funcDef) {\n if (isVersionRelatedFunction(funcDef, graphiteVersion)) {\n funcs[funcDef.name] = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.assign({}, funcDef, {\n params: __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.filter(funcDef.params, function (param) {\n return isVersionRelatedFunction(param, graphiteVersion);\n }),\n });\n }\n });\n return funcs;\n}\n// parse response from graphite /functions endpoint into internal format\nfunction parseFuncDefs(rawDefs) {\n var funcDefs = {};\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.forEach(rawDefs || {}, function (funcDef, funcName) {\n // skip graphite graph functions\n if (funcDef.group === 'Graph') {\n return;\n }\n var description = funcDef.description;\n if (description) {\n // tidy up some pydoc syntax that rst2html can't handle\n description = description\n .replace(/:py:func:`(.+)( <[^>]*>)?`/g, '``$1``')\n .replace(/.. seealso:: /g, 'See also: ')\n .replace(/.. code-block *:: *none/g, '.. code-block::');\n }\n var func = {\n name: funcDef.name,\n description: description,\n category: funcDef.group,\n params: [],\n defaultParams: [],\n fake: false,\n };\n // get rid of the first \"seriesList\" param\n if (/^seriesLists?$/.test(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.get(funcDef, 'params[0].type', ''))) {\n // handle functions that accept multiple seriesLists\n // we leave the param in place but mark it optional, so users can add more series if they wish\n if (funcDef.params[0].multiple) {\n funcDef.params[0].required = false;\n // otherwise chop off the first param, it'll be handled separately\n }\n else {\n funcDef.params.shift();\n }\n // tag function as fake\n }\n else {\n func.fake = true;\n }\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.forEach(funcDef.params, function (rawParam) {\n var param = {\n name: rawParam.name,\n type: 'string',\n optional: !rawParam.required,\n multiple: !!rawParam.multiple,\n options: undefined,\n };\n if (rawParam.default !== undefined) {\n func.defaultParams.push(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.toString(rawParam.default));\n }\n else if (rawParam.suggestions) {\n func.defaultParams.push(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.toString(rawParam.suggestions[0]));\n }\n else {\n func.defaultParams.push('');\n }\n if (rawParam.type === 'boolean') {\n param.type = 'boolean';\n param.options = ['true', 'false'];\n }\n else if (rawParam.type === 'integer') {\n param.type = 'int';\n }\n else if (rawParam.type === 'float') {\n param.type = 'float';\n }\n else if (rawParam.type === 'node') {\n param.type = 'node';\n param.options = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'];\n }\n else if (rawParam.type === 'nodeOrTag') {\n param.type = 'node_or_tag';\n param.options = ['name', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'];\n }\n else if (rawParam.type === 'intOrInterval') {\n param.type = 'int_or_interval';\n }\n else if (rawParam.type === 'seriesList') {\n param.type = 'value_or_series';\n }\n if (rawParam.options) {\n param.options = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(rawParam.options, __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.toString);\n }\n else if (rawParam.suggestions) {\n param.options = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(rawParam.suggestions, __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.toString);\n }\n func.params.push(param);\n });\n funcDefs[funcName] = func;\n });\n return funcDefs;\n}\n/* harmony default export */ __webpack_exports__[\"a\"] = ({\n createFuncInstance: createFuncInstance,\n getFuncDef: getFuncDef,\n getFuncDefs: getFuncDefs,\n parseFuncDefs: parseFuncDefs,\n});\n\n\n/***/ }),\n\n/***/ 2081:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return GraphiteQueryCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__add_graphite_func__ = __webpack_require__(2082);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__func_editor__ = __webpack_require__(2083);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__graphite_query__ = __webpack_require__(2084);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_app_plugins_sdk__ = __webpack_require__(1983);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_app_core_app_events__ = __webpack_require__(22);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n\n\n\nvar GRAPHITE_TAG_OPERATORS = ['=', '!=', '=~', '!=~'];\nvar TAG_PREFIX = 'tag: ';\nvar GraphiteQueryCtrl = /** @class */ (function (_super) {\n __extends(GraphiteQueryCtrl, _super);\n /** @ngInject **/\n GraphiteQueryCtrl.$inject = [\"$scope\", \"$injector\", \"uiSegmentSrv\", \"templateSrv\", \"$timeout\"];\n function GraphiteQueryCtrl($scope, $injector, uiSegmentSrv, templateSrv, $timeout) {\n var _this = _super.call(this, $scope, $injector) || this;\n _this.uiSegmentSrv = uiSegmentSrv;\n _this.templateSrv = templateSrv;\n _this.supportsTags = _this.datasource.supportsTags;\n _this.paused = false;\n _this.target.target = _this.target.target || '';\n _this.datasource.waitForFuncDefsLoaded().then(function () {\n _this.queryModel = new __WEBPACK_IMPORTED_MODULE_3__graphite_query__[\"a\" /* default */](_this.datasource, _this.target, templateSrv);\n _this.buildSegments();\n });\n _this.removeTagValue = '-- remove tag --';\n return _this;\n }\n GraphiteQueryCtrl.prototype.parseTarget = function () {\n this.queryModel.parseTarget();\n this.buildSegments();\n };\n GraphiteQueryCtrl.prototype.toggleEditorMode = function () {\n this.target.textEditor = !this.target.textEditor;\n this.parseTarget();\n };\n GraphiteQueryCtrl.prototype.buildSegments = function () {\n var _this = this;\n this.segments = __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.map(this.queryModel.segments, function (segment) {\n return _this.uiSegmentSrv.newSegment(segment);\n });\n var checkOtherSegmentsIndex = this.queryModel.checkOtherSegmentsIndex || 0;\n this.checkOtherSegments(checkOtherSegmentsIndex);\n if (this.queryModel.seriesByTagUsed) {\n this.fixTagSegments();\n }\n };\n GraphiteQueryCtrl.prototype.addSelectMetricSegment = function () {\n this.queryModel.addSelectMetricSegment();\n this.segments.push(this.uiSegmentSrv.newSelectMetric());\n };\n GraphiteQueryCtrl.prototype.checkOtherSegments = function (fromIndex) {\n var _this = this;\n if (this.queryModel.segments.length === 1 && this.queryModel.segments[0].type === 'series-ref') {\n return;\n }\n if (fromIndex === 0) {\n this.addSelectMetricSegment();\n return;\n }\n var path = this.queryModel.getSegmentPathUpTo(fromIndex + 1);\n if (path === '') {\n return Promise.resolve();\n }\n return this.datasource\n .metricFindQuery(path)\n .then(function (segments) {\n if (segments.length === 0) {\n if (path !== '') {\n _this.queryModel.segments = _this.queryModel.segments.splice(0, fromIndex);\n _this.segments = _this.segments.splice(0, fromIndex);\n _this.addSelectMetricSegment();\n }\n }\n else if (segments[0].expandable) {\n if (_this.segments.length === fromIndex) {\n _this.addSelectMetricSegment();\n }\n else {\n return _this.checkOtherSegments(fromIndex + 1);\n }\n }\n })\n .catch(function (err) {\n __WEBPACK_IMPORTED_MODULE_5_app_core_app_events__[\"a\" /* default */].emit('alert-error', ['Error', err]);\n });\n };\n GraphiteQueryCtrl.prototype.setSegmentFocus = function (segmentIndex) {\n __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.each(this.segments, function (segment, index) {\n segment.focus = segmentIndex === index;\n });\n };\n GraphiteQueryCtrl.prototype.getAltSegments = function (index, prefix) {\n var _this = this;\n var query = prefix && prefix.length > 0 ? '*' + prefix + '*' : '*';\n if (index > 0) {\n query = this.queryModel.getSegmentPathUpTo(index) + '.' + query;\n }\n var options = {\n range: this.panelCtrl.range,\n requestId: 'get-alt-segments',\n };\n return this.datasource\n .metricFindQuery(query, options)\n .then(function (segments) {\n var altSegments = __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.map(segments, function (segment) {\n return _this.uiSegmentSrv.newSegment({\n value: segment.text,\n expandable: segment.expandable,\n });\n });\n if (index > 0 && altSegments.length === 0) {\n return altSegments;\n }\n // add query references\n if (index === 0) {\n __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.eachRight(_this.panelCtrl.panel.targets, function (target) {\n if (target.refId === _this.queryModel.target.refId) {\n return;\n }\n altSegments.unshift(_this.uiSegmentSrv.newSegment({\n type: 'series-ref',\n value: '#' + target.refId,\n expandable: false,\n }));\n });\n }\n // add template variables\n __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.eachRight(_this.templateSrv.variables, function (variable) {\n altSegments.unshift(_this.uiSegmentSrv.newSegment({\n type: 'template',\n value: '$' + variable.name,\n expandable: true,\n }));\n });\n // add wildcard option\n altSegments.unshift(_this.uiSegmentSrv.newSegment('*'));\n if (_this.supportsTags && index === 0) {\n _this.removeTaggedEntry(altSegments);\n return _this.addAltTagSegments(prefix, altSegments);\n }\n else {\n return altSegments;\n }\n })\n .catch(function (err) {\n return [];\n });\n };\n GraphiteQueryCtrl.prototype.addAltTagSegments = function (prefix, altSegments) {\n return this.getTagsAsSegments(prefix).then(function (tagSegments) {\n tagSegments = __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.map(tagSegments, function (segment) {\n segment.value = TAG_PREFIX + segment.value;\n return segment;\n });\n return altSegments.concat.apply(altSegments, tagSegments);\n });\n };\n GraphiteQueryCtrl.prototype.removeTaggedEntry = function (altSegments) {\n altSegments = __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.remove(altSegments, function (s) { return s.value === '_tagged'; });\n };\n GraphiteQueryCtrl.prototype.segmentValueChanged = function (segment, segmentIndex) {\n var _this = this;\n this.error = null;\n this.queryModel.updateSegmentValue(segment, segmentIndex);\n if (this.queryModel.functions.length > 0 && this.queryModel.functions[0].def.fake) {\n this.queryModel.functions = [];\n }\n if (segment.type === 'tag') {\n var tag = removeTagPrefix(segment.value);\n this.pause();\n this.addSeriesByTagFunc(tag);\n return;\n }\n if (segment.expandable) {\n return this.checkOtherSegments(segmentIndex + 1).then(function () {\n _this.setSegmentFocus(segmentIndex + 1);\n _this.targetChanged();\n });\n }\n else {\n this.spliceSegments(segmentIndex + 1);\n }\n this.setSegmentFocus(segmentIndex + 1);\n this.targetChanged();\n };\n GraphiteQueryCtrl.prototype.spliceSegments = function (index) {\n this.segments = this.segments.splice(0, index);\n this.queryModel.segments = this.queryModel.segments.splice(0, index);\n };\n GraphiteQueryCtrl.prototype.emptySegments = function () {\n this.queryModel.segments = [];\n this.segments = [];\n };\n GraphiteQueryCtrl.prototype.targetTextChanged = function () {\n this.updateModelTarget();\n this.refresh();\n };\n GraphiteQueryCtrl.prototype.updateModelTarget = function () {\n this.queryModel.updateModelTarget(this.panelCtrl.panel.targets);\n };\n GraphiteQueryCtrl.prototype.targetChanged = function () {\n if (this.queryModel.error) {\n return;\n }\n var oldTarget = this.queryModel.target.target;\n this.updateModelTarget();\n if (this.queryModel.target !== oldTarget && !this.paused) {\n this.panelCtrl.refresh();\n }\n };\n GraphiteQueryCtrl.prototype.addFunction = function (funcDef) {\n var newFunc = this.datasource.createFuncInstance(funcDef, {\n withDefaultParams: true,\n });\n newFunc.added = true;\n this.queryModel.addFunction(newFunc);\n this.smartlyHandleNewAliasByNode(newFunc);\n if (this.segments.length === 1 && this.segments[0].fake) {\n this.emptySegments();\n }\n if (!newFunc.params.length && newFunc.added) {\n this.targetChanged();\n }\n if (newFunc.def.name === 'seriesByTag') {\n this.parseTarget();\n }\n };\n GraphiteQueryCtrl.prototype.removeFunction = function (func) {\n this.queryModel.removeFunction(func);\n this.targetChanged();\n };\n GraphiteQueryCtrl.prototype.addSeriesByTagFunc = function (tag) {\n var newFunc = this.datasource.createFuncInstance('seriesByTag', {\n withDefaultParams: false,\n });\n var tagParam = tag + \"=\";\n newFunc.params = [tagParam];\n this.queryModel.addFunction(newFunc);\n newFunc.added = true;\n this.emptySegments();\n this.targetChanged();\n this.parseTarget();\n };\n GraphiteQueryCtrl.prototype.smartlyHandleNewAliasByNode = function (func) {\n if (func.def.name !== 'aliasByNode') {\n return;\n }\n for (var i = 0; i < this.segments.length; i++) {\n if (this.segments[i].value.indexOf('*') >= 0) {\n func.params[0] = i;\n func.added = false;\n this.targetChanged();\n return;\n }\n }\n };\n GraphiteQueryCtrl.prototype.getAllTags = function () {\n var _this = this;\n return this.datasource.getTags().then(function (values) {\n var altTags = __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.map(values, 'text');\n altTags.splice(0, 0, _this.removeTagValue);\n return mapToDropdownOptions(altTags);\n });\n };\n GraphiteQueryCtrl.prototype.getTags = function (index, tagPrefix) {\n var _this = this;\n var tagExpressions = this.queryModel.renderTagExpressions(index);\n return this.datasource.getTagsAutoComplete(tagExpressions, tagPrefix).then(function (values) {\n var altTags = __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.map(values, 'text');\n altTags.splice(0, 0, _this.removeTagValue);\n return mapToDropdownOptions(altTags);\n });\n };\n GraphiteQueryCtrl.prototype.getTagsAsSegments = function (tagPrefix) {\n var _this = this;\n var tagExpressions = this.queryModel.renderTagExpressions();\n return this.datasource.getTagsAutoComplete(tagExpressions, tagPrefix).then(function (values) {\n return __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.map(values, function (val) {\n return _this.uiSegmentSrv.newSegment({\n value: val.text,\n type: 'tag',\n expandable: false,\n });\n });\n });\n };\n GraphiteQueryCtrl.prototype.getTagOperators = function () {\n return mapToDropdownOptions(GRAPHITE_TAG_OPERATORS);\n };\n GraphiteQueryCtrl.prototype.getAllTagValues = function (tag) {\n var tagKey = tag.key;\n return this.datasource.getTagValues(tagKey).then(function (values) {\n var altValues = __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.map(values, 'text');\n return mapToDropdownOptions(altValues);\n });\n };\n GraphiteQueryCtrl.prototype.getTagValues = function (tag, index, valuePrefix) {\n var _this = this;\n var tagExpressions = this.queryModel.renderTagExpressions(index);\n var tagKey = tag.key;\n return this.datasource.getTagValuesAutoComplete(tagExpressions, tagKey, valuePrefix).then(function (values) {\n var altValues = __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.map(values, 'text');\n // Add template variables as additional values\n __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.eachRight(_this.templateSrv.variables, function (variable) {\n altValues.push('${' + variable.name + ':regex}');\n });\n return mapToDropdownOptions(altValues);\n });\n };\n GraphiteQueryCtrl.prototype.tagChanged = function (tag, tagIndex) {\n this.queryModel.updateTag(tag, tagIndex);\n this.targetChanged();\n };\n GraphiteQueryCtrl.prototype.addNewTag = function (segment) {\n var newTagKey = segment.value;\n var newTag = { key: newTagKey, operator: '=', value: '' };\n this.queryModel.addTag(newTag);\n this.targetChanged();\n this.fixTagSegments();\n };\n GraphiteQueryCtrl.prototype.removeTag = function (index) {\n this.queryModel.removeTag(index);\n this.targetChanged();\n };\n GraphiteQueryCtrl.prototype.fixTagSegments = function () {\n // Adding tag with the same name as just removed works incorrectly if single segment is used (instead of array)\n this.addTagSegments = [this.uiSegmentSrv.newPlusButton()];\n };\n GraphiteQueryCtrl.prototype.showDelimiter = function (index) {\n return index !== this.queryModel.tags.length - 1;\n };\n GraphiteQueryCtrl.prototype.pause = function () {\n this.paused = true;\n };\n GraphiteQueryCtrl.prototype.unpause = function () {\n this.paused = false;\n this.panelCtrl.refresh();\n };\n GraphiteQueryCtrl.templateUrl = 'partials/query.editor.html';\n return GraphiteQueryCtrl;\n}(__WEBPACK_IMPORTED_MODULE_4_app_plugins_sdk__[\"QueryCtrl\"]));\n\nfunction mapToDropdownOptions(results) {\n return __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.map(results, function (value) {\n return { text: value, value: value };\n });\n}\nfunction removeTagPrefix(value) {\n return value.replace(TAG_PREFIX, '');\n}\n\n\n/***/ }),\n\n/***/ 2082:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export graphiteAddFunc */\n/* harmony import */ \ngraphiteAddFunc.$inject = [\"$compile\"];var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_jquery__ = __webpack_require__(17);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_jquery__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rst2html__ = __webpack_require__(706);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rst2html___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rst2html__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_tether_drop__ = __webpack_require__(111);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_tether_drop___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_tether_drop__);\n\n\n\n\n\n/** @ngInject */\nfunction graphiteAddFunc($compile) {\n var inputTemplate = '';\n var buttonTemplate = '' +\n '';\n return {\n link: function ($scope, elem) {\n var ctrl = $scope.ctrl;\n var $input = __WEBPACK_IMPORTED_MODULE_2_jquery___default()(inputTemplate);\n var $button = __WEBPACK_IMPORTED_MODULE_2_jquery___default()(buttonTemplate);\n $input.appendTo(elem);\n $button.appendTo(elem);\n ctrl.datasource.getFuncDefs().then(function (funcDefs) {\n var allFunctions = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(funcDefs, 'name').sort();\n $scope.functionMenu = createFunctionDropDownMenu(funcDefs);\n $input.attr('data-provide', 'typeahead');\n $input.typeahead({\n source: allFunctions,\n minLength: 1,\n items: 10,\n updater: function (value) {\n var funcDef = ctrl.datasource.getFuncDef(value);\n if (!funcDef) {\n // try find close match\n value = value.toLowerCase();\n funcDef = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find(allFunctions, function (funcName) {\n return funcName.toLowerCase().indexOf(value) === 0;\n });\n if (!funcDef) {\n return '';\n }\n }\n $scope.$apply(function () {\n ctrl.addFunction(funcDef);\n });\n $input.trigger('blur');\n return '';\n },\n });\n $button.click(function () {\n $button.hide();\n $input.show();\n $input.focus();\n });\n $input.keyup(function () {\n elem.toggleClass('open', $input.val() === '');\n });\n $input.blur(function () {\n // clicking the function dropdown menu won't\n // work if you remove class at once\n setTimeout(function () {\n $input.val('');\n $input.hide();\n $button.show();\n elem.removeClass('open');\n }, 200);\n });\n $compile(elem.contents())($scope);\n });\n var drop;\n var cleanUpDrop = function () {\n if (drop) {\n drop.destroy();\n drop = null;\n }\n };\n __WEBPACK_IMPORTED_MODULE_2_jquery___default()(elem)\n .on('mouseenter', 'ul.dropdown-menu li', function () {\n cleanUpDrop();\n var funcDef;\n try {\n funcDef = ctrl.datasource.getFuncDef(__WEBPACK_IMPORTED_MODULE_2_jquery___default()('a', this).text());\n }\n catch (e) {\n // ignore\n }\n if (funcDef && funcDef.description) {\n var shortDesc = funcDef.description;\n if (shortDesc.length > 500) {\n shortDesc = shortDesc.substring(0, 497) + '...';\n }\n var contentElement = document.createElement('div');\n contentElement.innerHTML = '

' + funcDef.name + '

' + __WEBPACK_IMPORTED_MODULE_3_rst2html___default()(shortDesc);\n drop = new __WEBPACK_IMPORTED_MODULE_4_tether_drop___default.a({\n target: this,\n content: contentElement,\n classes: 'drop-popover',\n openOn: 'always',\n tetherOptions: {\n attachment: 'bottom left',\n targetAttachment: 'bottom right',\n },\n });\n }\n })\n .on('mouseout', 'ul.dropdown-menu li', function () {\n cleanUpDrop();\n });\n $scope.$on('$destroy', cleanUpDrop);\n },\n };\n}\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.directives').directive('graphiteAddFunc', graphiteAddFunc);\nfunction createFunctionDropDownMenu(funcDefs) {\n var categories = {};\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.forEach(funcDefs, function (funcDef) {\n if (!funcDef.category) {\n return;\n }\n if (!categories[funcDef.category]) {\n categories[funcDef.category] = [];\n }\n categories[funcDef.category].push({\n text: funcDef.name,\n click: \"ctrl.addFunction('\" + funcDef.name + \"')\",\n });\n });\n return __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.sortBy(__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(categories, function (submenu, category) {\n return {\n text: category,\n submenu: __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.sortBy(submenu, 'text'),\n };\n }), 'text');\n}\n\n\n/***/ }),\n\n/***/ 2083:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export graphiteFuncEditor */\n/* harmony import */ \ngraphiteFuncEditor.$inject = [\"$compile\", \"templateSrv\", \"popoverSrv\"];var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_jquery__ = __webpack_require__(17);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_jquery__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rst2html__ = __webpack_require__(706);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_rst2html___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_rst2html__);\n\n\n\n\n/** @ngInject */\nfunction graphiteFuncEditor($compile, templateSrv, popoverSrv) {\n var funcSpanTemplate = '{{func.def.name}}(';\n var paramTemplate = '';\n var funcControlsTemplate = \"\\n
\\n \\n \\n \\n \\n
\";\n return {\n restrict: 'A',\n link: function postLink($scope, elem) {\n var $funcLink = __WEBPACK_IMPORTED_MODULE_2_jquery___default()(funcSpanTemplate);\n var $funcControls = __WEBPACK_IMPORTED_MODULE_2_jquery___default()(funcControlsTemplate);\n var ctrl = $scope.ctrl;\n var func = $scope.func;\n var scheduledRelink = false;\n var paramCountAtLink = 0;\n var cancelBlur = null;\n function clickFuncParam(paramIndex) {\n /*jshint validthis:true */\n var $link = __WEBPACK_IMPORTED_MODULE_2_jquery___default()(this);\n var $comma = $link.prev('.comma');\n var $input = $link.next();\n $input.val(func.params[paramIndex]);\n $comma.removeClass('query-part__last');\n $link.hide();\n $input.show();\n $input.focus();\n $input.select();\n var typeahead = $input.data('typeahead');\n if (typeahead) {\n $input.val('');\n typeahead.lookup();\n }\n }\n function scheduledRelinkIfNeeded() {\n if (paramCountAtLink === func.params.length) {\n return;\n }\n if (!scheduledRelink) {\n scheduledRelink = true;\n setTimeout(function () {\n relink();\n scheduledRelink = false;\n }, 200);\n }\n }\n function paramDef(index) {\n if (index < func.def.params.length) {\n return func.def.params[index];\n }\n if (__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.last(func.def.params).multiple) {\n return __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.assign({}, __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.last(func.def.params), { optional: true });\n }\n return {};\n }\n function switchToLink(inputElem, paramIndex) {\n /*jshint validthis:true */\n var $input = __WEBPACK_IMPORTED_MODULE_2_jquery___default()(inputElem);\n clearTimeout(cancelBlur);\n cancelBlur = null;\n var $link = $input.prev();\n var $comma = $link.prev('.comma');\n var newValue = $input.val();\n // remove optional empty params\n if (newValue !== '' || paramDef(paramIndex).optional) {\n func.updateParam(newValue, paramIndex);\n $link.html(newValue ? templateSrv.highlightVariablesAsHtml(newValue) : ' ');\n }\n scheduledRelinkIfNeeded();\n $scope.$apply(function () {\n ctrl.targetChanged();\n });\n if ($link.hasClass('query-part__last') && newValue === '') {\n $comma.addClass('query-part__last');\n }\n else {\n $link.removeClass('query-part__last');\n }\n $input.hide();\n $link.show();\n }\n // this = input element\n function inputBlur(paramIndex) {\n /*jshint validthis:true */\n var inputElem = this;\n // happens long before the click event on the typeahead options\n // need to have long delay because the blur\n cancelBlur = setTimeout(function () {\n switchToLink(inputElem, paramIndex);\n }, 200);\n }\n function inputKeyPress(paramIndex, e) {\n /*jshint validthis:true */\n if (e.which === 13) {\n __WEBPACK_IMPORTED_MODULE_2_jquery___default()(this).blur();\n }\n }\n function inputKeyDown() {\n /*jshint validthis:true */\n this.style.width = (3 + this.value.length) * 8 + 'px';\n }\n function addTypeahead($input, paramIndex) {\n $input.attr('data-provide', 'typeahead');\n var options = paramDef(paramIndex).options;\n if (paramDef(paramIndex).type === 'int') {\n options = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(options, function (val) {\n return val.toString();\n });\n }\n $input.typeahead({\n source: options,\n minLength: 0,\n items: 20,\n updater: function (value) {\n $input.val(value);\n switchToLink($input[0], paramIndex);\n return value;\n },\n });\n var typeahead = $input.data('typeahead');\n typeahead.lookup = function () {\n this.query = this.$element.val() || '';\n return this.process(this.source);\n };\n }\n function toggleFuncControls() {\n var targetDiv = elem.closest('.tight-form');\n if (elem.hasClass('show-function-controls')) {\n elem.removeClass('show-function-controls');\n targetDiv.removeClass('has-open-function');\n $funcControls.hide();\n return;\n }\n elem.addClass('show-function-controls');\n targetDiv.addClass('has-open-function');\n $funcControls.show();\n }\n function addElementsAndCompile() {\n $funcControls.appendTo(elem);\n $funcLink.appendTo(elem);\n var defParams = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.clone(func.def.params);\n var lastParam = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.last(func.def.params);\n while (func.params.length >= defParams.length && lastParam && lastParam.multiple) {\n defParams.push(__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.assign({}, lastParam, { optional: true }));\n }\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(defParams, function (param, index) {\n if (param.optional && func.params.length < index) {\n return false;\n }\n var paramValue = templateSrv.highlightVariablesAsHtml(func.params[index]);\n var last = index >= func.params.length - 1 && param.optional && !paramValue;\n if (last && param.multiple) {\n paramValue = '+';\n }\n if (index > 0) {\n __WEBPACK_IMPORTED_MODULE_2_jquery___default()(', ').appendTo(elem);\n }\n var $paramLink = __WEBPACK_IMPORTED_MODULE_2_jquery___default()('' +\n (paramValue || ' ') +\n '');\n var $input = __WEBPACK_IMPORTED_MODULE_2_jquery___default()(paramTemplate);\n $input.attr('placeholder', param.name);\n paramCountAtLink++;\n $paramLink.appendTo(elem);\n $input.appendTo(elem);\n $input.blur(__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.partial(inputBlur, index));\n $input.keyup(inputKeyDown);\n $input.keypress(__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.partial(inputKeyPress, index));\n $paramLink.click(__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.partial(clickFuncParam, index));\n if (param.options) {\n addTypeahead($input, index);\n }\n return true;\n });\n __WEBPACK_IMPORTED_MODULE_2_jquery___default()(')').appendTo(elem);\n $compile(elem.contents())($scope);\n }\n function ifJustAddedFocusFirstParam() {\n if ($scope.func.added) {\n $scope.func.added = false;\n setTimeout(function () {\n elem\n .find('.graphite-func-param-link')\n .first()\n .click();\n }, 10);\n }\n }\n function registerFuncControlsToggle() {\n $funcLink.click(toggleFuncControls);\n }\n function registerFuncControlsActions() {\n $funcControls.click(function (e) {\n var $target = __WEBPACK_IMPORTED_MODULE_2_jquery___default()(e.target);\n if ($target.hasClass('fa-remove')) {\n toggleFuncControls();\n $scope.$apply(function () {\n ctrl.removeFunction($scope.func);\n });\n return;\n }\n if ($target.hasClass('fa-arrow-left')) {\n $scope.$apply(function () {\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.move(ctrl.queryModel.functions, $scope.$index, $scope.$index - 1);\n ctrl.targetChanged();\n });\n return;\n }\n if ($target.hasClass('fa-arrow-right')) {\n $scope.$apply(function () {\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.move(ctrl.queryModel.functions, $scope.$index, $scope.$index + 1);\n ctrl.targetChanged();\n });\n return;\n }\n if ($target.hasClass('fa-question-circle')) {\n var funcDef = ctrl.datasource.getFuncDef(func.def.name);\n if (funcDef && funcDef.description) {\n popoverSrv.show({\n element: e.target,\n position: 'bottom left',\n classNames: 'drop-popover drop-function-def',\n template: \"\\n
\\n

\" + funcDef.name + \"

\\n \" + __WEBPACK_IMPORTED_MODULE_3_rst2html___default()(funcDef.description) + \"\\n
\",\n openOn: 'click',\n });\n }\n else {\n window.open('http://graphite.readthedocs.org/en/latest/functions.html#graphite.render.functions.' + func.def.name, '_blank');\n }\n return;\n }\n });\n }\n function relink() {\n elem.children().remove();\n addElementsAndCompile();\n ifJustAddedFocusFirstParam();\n registerFuncControlsToggle();\n registerFuncControlsActions();\n }\n relink();\n },\n };\n}\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.directives').directive('graphiteFuncEditor', graphiteFuncEditor);\n\n\n/***/ }),\n\n/***/ 2084:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__parser__ = __webpack_require__(2085);\n\n\nvar GraphiteQuery = /** @class */ (function () {\n /** @ngInject */\n GraphiteQuery.$inject = [\"datasource\", \"target\", \"templateSrv\", \"scopedVars\"];\n function GraphiteQuery(datasource, target, templateSrv, scopedVars) {\n this.datasource = datasource;\n this.target = target;\n this.parseTarget();\n this.removeTagValue = '-- remove tag --';\n }\n GraphiteQuery.prototype.parseTarget = function () {\n this.functions = [];\n this.segments = [];\n this.tags = [];\n this.error = null;\n if (this.target.textEditor) {\n return;\n }\n var parser = new __WEBPACK_IMPORTED_MODULE_1__parser__[\"a\" /* Parser */](this.target.target);\n var astNode = parser.getAst();\n if (astNode === null) {\n this.checkOtherSegmentsIndex = 0;\n return;\n }\n if (astNode.type === 'error') {\n this.error = astNode.message + ' at position: ' + astNode.pos;\n this.target.textEditor = true;\n return;\n }\n try {\n this.parseTargetRecursive(astNode, null);\n }\n catch (err) {\n console.log('error parsing target:', err.message);\n this.error = err.message;\n this.target.textEditor = true;\n }\n this.checkOtherSegmentsIndex = this.segments.length - 1;\n this.checkForSeriesByTag();\n };\n GraphiteQuery.prototype.checkForSeriesByTag = function () {\n var seriesByTagFunc = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(this.functions, function (func) { return func.def.name === 'seriesByTag'; });\n if (seriesByTagFunc) {\n this.seriesByTagUsed = true;\n seriesByTagFunc.hidden = true;\n var tags = this.splitSeriesByTagParams(seriesByTagFunc);\n this.tags = tags;\n }\n };\n GraphiteQuery.prototype.getSegmentPathUpTo = function (index) {\n var arr = this.segments.slice(0, index);\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.reduce(arr, function (result, segment) {\n return result ? result + '.' + segment.value : segment.value;\n }, '');\n };\n GraphiteQuery.prototype.parseTargetRecursive = function (astNode, func) {\n var _this = this;\n if (astNode === null) {\n return null;\n }\n switch (astNode.type) {\n case 'function':\n var innerFunc = this.datasource.createFuncInstance(astNode.name, {\n withDefaultParams: false,\n });\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(astNode.params, function (param) {\n _this.parseTargetRecursive(param, innerFunc);\n });\n innerFunc.updateText();\n this.functions.push(innerFunc);\n break;\n case 'series-ref':\n if (this.segments.length > 0) {\n this.addFunctionParameter(func, astNode.value);\n }\n else {\n this.segments.push(astNode);\n }\n break;\n case 'bool':\n case 'string':\n case 'number':\n this.addFunctionParameter(func, astNode.value);\n break;\n case 'metric':\n if (this.segments.length > 0) {\n this.addFunctionParameter(func, __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.join(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(astNode.segments, 'value'), '.'));\n }\n else {\n this.segments = astNode.segments;\n }\n break;\n }\n };\n GraphiteQuery.prototype.updateSegmentValue = function (segment, index) {\n this.segments[index].value = segment.value;\n };\n GraphiteQuery.prototype.addSelectMetricSegment = function () {\n this.segments.push({ value: 'select metric' });\n };\n GraphiteQuery.prototype.addFunction = function (newFunc) {\n this.functions.push(newFunc);\n this.moveAliasFuncLast();\n };\n GraphiteQuery.prototype.moveAliasFuncLast = function () {\n var aliasFunc = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(this.functions, function (func) {\n return func.def.name.startsWith('alias');\n });\n if (aliasFunc) {\n this.functions = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.without(this.functions, aliasFunc);\n this.functions.push(aliasFunc);\n }\n };\n GraphiteQuery.prototype.addFunctionParameter = function (func, value) {\n if (func.params.length >= func.def.params.length && !__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.get(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.last(func.def.params), 'multiple', false)) {\n throw { message: 'too many parameters for function ' + func.def.name };\n }\n func.params.push(value);\n };\n GraphiteQuery.prototype.removeFunction = function (func) {\n this.functions = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.without(this.functions, func);\n };\n GraphiteQuery.prototype.updateModelTarget = function (targets) {\n // render query\n if (!this.target.textEditor) {\n var metricPath = this.getSegmentPathUpTo(this.segments.length).replace(/\\.select metric$/, '');\n this.target.target = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.reduce(this.functions, wrapFunction, metricPath);\n }\n this.updateRenderedTarget(this.target, targets);\n // loop through other queries and update targetFull as needed\n for (var _i = 0, _a = targets || []; _i < _a.length; _i++) {\n var target = _a[_i];\n if (target.refId !== this.target.refId) {\n this.updateRenderedTarget(target, targets);\n }\n }\n };\n GraphiteQuery.prototype.updateRenderedTarget = function (target, targets) {\n // render nested query\n var targetsByRefId = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.keyBy(targets, 'refId');\n // no references to self\n delete targetsByRefId[target.refId];\n var nestedSeriesRefRegex = /\\#([A-Z])/g;\n var targetWithNestedQueries = target.target;\n // Use ref count to track circular references\n function countTargetRefs(targetsByRefId, refId) {\n var refCount = 0;\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(targetsByRefId, function (t, id) {\n if (id !== refId) {\n var match = nestedSeriesRefRegex.exec(t.target);\n var count = match && match.length ? match.length - 1 : 0;\n refCount += count;\n }\n });\n targetsByRefId[refId].refCount = refCount;\n }\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(targetsByRefId, function (t, id) {\n countTargetRefs(targetsByRefId, id);\n });\n // Keep interpolating until there are no query references\n // The reason for the loop is that the referenced query might contain another reference to another query\n while (targetWithNestedQueries.match(nestedSeriesRefRegex)) {\n var updated = targetWithNestedQueries.replace(nestedSeriesRefRegex, function (match, g1) {\n var t = targetsByRefId[g1];\n if (!t) {\n return match;\n }\n // no circular references\n if (t.refCount === 0) {\n delete targetsByRefId[g1];\n }\n t.refCount--;\n return t.target;\n });\n if (updated === targetWithNestedQueries) {\n break;\n }\n targetWithNestedQueries = updated;\n }\n delete target.targetFull;\n if (target.target !== targetWithNestedQueries) {\n target.targetFull = targetWithNestedQueries;\n }\n };\n GraphiteQuery.prototype.splitSeriesByTagParams = function (func) {\n var tagPattern = /([^\\!=~]+)(\\!?=~?)(.*)/;\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.flatten(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(func.params, function (param) {\n var matches = tagPattern.exec(param);\n if (matches) {\n var tag = matches.slice(1);\n if (tag.length === 3) {\n return {\n key: tag[0],\n operator: tag[1],\n value: tag[2],\n };\n }\n }\n return [];\n }));\n };\n GraphiteQuery.prototype.getSeriesByTagFuncIndex = function () {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.findIndex(this.functions, function (func) { return func.def.name === 'seriesByTag'; });\n };\n GraphiteQuery.prototype.getSeriesByTagFunc = function () {\n var seriesByTagFuncIndex = this.getSeriesByTagFuncIndex();\n if (seriesByTagFuncIndex >= 0) {\n return this.functions[seriesByTagFuncIndex];\n }\n else {\n return undefined;\n }\n };\n GraphiteQuery.prototype.addTag = function (tag) {\n var newTagParam = renderTagString(tag);\n this.getSeriesByTagFunc().params.push(newTagParam);\n this.tags.push(tag);\n };\n GraphiteQuery.prototype.removeTag = function (index) {\n this.getSeriesByTagFunc().params.splice(index, 1);\n this.tags.splice(index, 1);\n };\n GraphiteQuery.prototype.updateTag = function (tag, tagIndex) {\n this.error = null;\n if (tag.key === this.removeTagValue) {\n this.removeTag(tagIndex);\n return;\n }\n var newTagParam = renderTagString(tag);\n this.getSeriesByTagFunc().params[tagIndex] = newTagParam;\n this.tags[tagIndex] = tag;\n };\n GraphiteQuery.prototype.renderTagExpressions = function (excludeIndex) {\n if (excludeIndex === void 0) { excludeIndex = -1; }\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.compact(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(this.tags, function (tagExpr, index) {\n // Don't render tag that we want to lookup\n if (index !== excludeIndex) {\n return tagExpr.key + tagExpr.operator + tagExpr.value;\n }\n }));\n };\n return GraphiteQuery;\n}());\n/* harmony default export */ __webpack_exports__[\"a\"] = (GraphiteQuery);\nfunction wrapFunction(target, func) {\n return func.render(target);\n}\nfunction renderTagString(tag) {\n return tag.key + tag.operator + tag.value;\n}\n\n\n/***/ }),\n\n/***/ 2085:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = Parser;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__lexer__ = __webpack_require__(2086);\n\nfunction Parser(expression) {\n this.expression = expression;\n this.lexer = new __WEBPACK_IMPORTED_MODULE_0__lexer__[\"a\" /* Lexer */](expression);\n this.tokens = this.lexer.tokenize();\n this.index = 0;\n}\nParser.prototype = {\n getAst: function () {\n return this.start();\n },\n start: function () {\n try {\n return this.functionCall() || this.metricExpression();\n }\n catch (e) {\n return {\n type: 'error',\n message: e.message,\n pos: e.pos,\n };\n }\n },\n curlyBraceSegment: function () {\n if (this.match('identifier', '{') || this.match('{')) {\n var curlySegment = '';\n while (!this.match('') && !this.match('}')) {\n curlySegment += this.consumeToken().value;\n }\n if (!this.match('}')) {\n this.errorMark(\"Expected closing '}'\");\n }\n curlySegment += this.consumeToken().value;\n // if curly segment is directly followed by identifier\n // include it in the segment\n if (this.match('identifier')) {\n curlySegment += this.consumeToken().value;\n }\n return {\n type: 'segment',\n value: curlySegment,\n };\n }\n else {\n return null;\n }\n },\n metricSegment: function () {\n var curly = this.curlyBraceSegment();\n if (curly) {\n return curly;\n }\n if (this.match('identifier') || this.match('number')) {\n // hack to handle float numbers in metric segments\n var parts = this.consumeToken().value.split('.');\n if (parts.length === 2) {\n this.tokens.splice(this.index, 0, { type: '.' });\n this.tokens.splice(this.index + 1, 0, {\n type: 'number',\n value: parts[1],\n });\n }\n return {\n type: 'segment',\n value: parts[0],\n };\n }\n if (!this.match('templateStart')) {\n this.errorMark('Expected metric identifier');\n }\n this.consumeToken();\n if (!this.match('identifier')) {\n this.errorMark('Expected identifier after templateStart');\n }\n var node = {\n type: 'template',\n value: this.consumeToken().value,\n };\n if (!this.match('templateEnd')) {\n this.errorMark('Expected templateEnd');\n }\n this.consumeToken();\n return node;\n },\n metricExpression: function () {\n if (!this.match('templateStart') && !this.match('identifier') && !this.match('number') && !this.match('{')) {\n return null;\n }\n var node = {\n type: 'metric',\n segments: [],\n };\n node.segments.push(this.metricSegment());\n while (this.match('.')) {\n this.consumeToken();\n var segment = this.metricSegment();\n if (!segment) {\n this.errorMark('Expected metric identifier');\n }\n node.segments.push(segment);\n }\n return node;\n },\n functionCall: function () {\n if (!this.match('identifier', '(')) {\n return null;\n }\n var node = {\n type: 'function',\n name: this.consumeToken().value,\n };\n // consume left parenthesis\n this.consumeToken();\n node.params = this.functionParameters();\n if (!this.match(')')) {\n this.errorMark('Expected closing parenthesis');\n }\n this.consumeToken();\n return node;\n },\n boolExpression: function () {\n if (!this.match('bool')) {\n return null;\n }\n return {\n type: 'bool',\n value: this.consumeToken().value === 'true',\n };\n },\n functionParameters: function () {\n if (this.match(')') || this.match('')) {\n return [];\n }\n var param = this.functionCall() ||\n this.numericLiteral() ||\n this.seriesRefExpression() ||\n this.boolExpression() ||\n this.metricExpression() ||\n this.stringLiteral();\n if (!this.match(',')) {\n return [param];\n }\n this.consumeToken();\n return [param].concat(this.functionParameters());\n },\n seriesRefExpression: function () {\n if (!this.match('identifier')) {\n return null;\n }\n var value = this.tokens[this.index].value;\n if (!value.match(/\\#[A-Z]/)) {\n return null;\n }\n var token = this.consumeToken();\n return {\n type: 'series-ref',\n value: token.value,\n };\n },\n numericLiteral: function () {\n if (!this.match('number')) {\n return null;\n }\n return {\n type: 'number',\n value: parseFloat(this.consumeToken().value),\n };\n },\n stringLiteral: function () {\n if (!this.match('string')) {\n return null;\n }\n var token = this.consumeToken();\n if (token.isUnclosed) {\n throw { message: 'Unclosed string parameter', pos: token.pos };\n }\n return {\n type: 'string',\n value: token.value,\n };\n },\n errorMark: function (text) {\n var currentToken = this.tokens[this.index];\n var type = currentToken ? currentToken.type : 'end of string';\n throw {\n message: text + ' instead found ' + type,\n pos: currentToken ? currentToken.pos : this.lexer.char,\n };\n },\n // returns token value and incre\n consumeToken: function () {\n this.index++;\n return this.tokens[this.index - 1];\n },\n matchToken: function (type, index) {\n var token = this.tokens[this.index + index];\n return (token === undefined && type === '') || (token && token.type === type);\n },\n match: function (token1, token2) {\n return this.matchToken(token1, 0) && (!token2 || this.matchToken(token2, 1));\n },\n};\n\n\n/***/ }),\n\n/***/ 2086:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = Lexer;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n\n// This is auto generated from the unicode tables.\n// The tables are at:\n// http://www.fileformat.info/info/unicode/category/Lu/list.htm\n// http://www.fileformat.info/info/unicode/category/Ll/list.htm\n// http://www.fileformat.info/info/unicode/category/Lt/list.htm\n// http://www.fileformat.info/info/unicode/category/Lm/list.htm\n// http://www.fileformat.info/info/unicode/category/Lo/list.htm\n// http://www.fileformat.info/info/unicode/category/Nl/list.htm\nvar unicodeLetterTable = [\n 170,\n 170,\n 181,\n 181,\n 186,\n 186,\n 192,\n 214,\n 216,\n 246,\n 248,\n 705,\n 710,\n 721,\n 736,\n 740,\n 748,\n 748,\n 750,\n 750,\n 880,\n 884,\n 886,\n 887,\n 890,\n 893,\n 902,\n 902,\n 904,\n 906,\n 908,\n 908,\n 910,\n 929,\n 931,\n 1013,\n 1015,\n 1153,\n 1162,\n 1319,\n 1329,\n 1366,\n 1369,\n 1369,\n 1377,\n 1415,\n 1488,\n 1514,\n 1520,\n 1522,\n 1568,\n 1610,\n 1646,\n 1647,\n 1649,\n 1747,\n 1749,\n 1749,\n 1765,\n 1766,\n 1774,\n 1775,\n 1786,\n 1788,\n 1791,\n 1791,\n 1808,\n 1808,\n 1810,\n 1839,\n 1869,\n 1957,\n 1969,\n 1969,\n 1994,\n 2026,\n 2036,\n 2037,\n 2042,\n 2042,\n 2048,\n 2069,\n 2074,\n 2074,\n 2084,\n 2084,\n 2088,\n 2088,\n 2112,\n 2136,\n 2308,\n 2361,\n 2365,\n 2365,\n 2384,\n 2384,\n 2392,\n 2401,\n 2417,\n 2423,\n 2425,\n 2431,\n 2437,\n 2444,\n 2447,\n 2448,\n 2451,\n 2472,\n 2474,\n 2480,\n 2482,\n 2482,\n 2486,\n 2489,\n 2493,\n 2493,\n 2510,\n 2510,\n 2524,\n 2525,\n 2527,\n 2529,\n 2544,\n 2545,\n 2565,\n 2570,\n 2575,\n 2576,\n 2579,\n 2600,\n 2602,\n 2608,\n 2610,\n 2611,\n 2613,\n 2614,\n 2616,\n 2617,\n 2649,\n 2652,\n 2654,\n 2654,\n 2674,\n 2676,\n 2693,\n 2701,\n 2703,\n 2705,\n 2707,\n 2728,\n 2730,\n 2736,\n 2738,\n 2739,\n 2741,\n 2745,\n 2749,\n 2749,\n 2768,\n 2768,\n 2784,\n 2785,\n 2821,\n 2828,\n 2831,\n 2832,\n 2835,\n 2856,\n 2858,\n 2864,\n 2866,\n 2867,\n 2869,\n 2873,\n 2877,\n 2877,\n 2908,\n 2909,\n 2911,\n 2913,\n 2929,\n 2929,\n 2947,\n 2947,\n 2949,\n 2954,\n 2958,\n 2960,\n 2962,\n 2965,\n 2969,\n 2970,\n 2972,\n 2972,\n 2974,\n 2975,\n 2979,\n 2980,\n 2984,\n 2986,\n 2990,\n 3001,\n 3024,\n 3024,\n 3077,\n 3084,\n 3086,\n 3088,\n 3090,\n 3112,\n 3114,\n 3123,\n 3125,\n 3129,\n 3133,\n 3133,\n 3160,\n 3161,\n 3168,\n 3169,\n 3205,\n 3212,\n 3214,\n 3216,\n 3218,\n 3240,\n 3242,\n 3251,\n 3253,\n 3257,\n 3261,\n 3261,\n 3294,\n 3294,\n 3296,\n 3297,\n 3313,\n 3314,\n 3333,\n 3340,\n 3342,\n 3344,\n 3346,\n 3386,\n 3389,\n 3389,\n 3406,\n 3406,\n 3424,\n 3425,\n 3450,\n 3455,\n 3461,\n 3478,\n 3482,\n 3505,\n 3507,\n 3515,\n 3517,\n 3517,\n 3520,\n 3526,\n 3585,\n 3632,\n 3634,\n 3635,\n 3648,\n 3654,\n 3713,\n 3714,\n 3716,\n 3716,\n 3719,\n 3720,\n 3722,\n 3722,\n 3725,\n 3725,\n 3732,\n 3735,\n 3737,\n 3743,\n 3745,\n 3747,\n 3749,\n 3749,\n 3751,\n 3751,\n 3754,\n 3755,\n 3757,\n 3760,\n 3762,\n 3763,\n 3773,\n 3773,\n 3776,\n 3780,\n 3782,\n 3782,\n 3804,\n 3805,\n 3840,\n 3840,\n 3904,\n 3911,\n 3913,\n 3948,\n 3976,\n 3980,\n 4096,\n 4138,\n 4159,\n 4159,\n 4176,\n 4181,\n 4186,\n 4189,\n 4193,\n 4193,\n 4197,\n 4198,\n 4206,\n 4208,\n 4213,\n 4225,\n 4238,\n 4238,\n 4256,\n 4293,\n 4304,\n 4346,\n 4348,\n 4348,\n 4352,\n 4680,\n 4682,\n 4685,\n 4688,\n 4694,\n 4696,\n 4696,\n 4698,\n 4701,\n 4704,\n 4744,\n 4746,\n 4749,\n 4752,\n 4784,\n 4786,\n 4789,\n 4792,\n 4798,\n 4800,\n 4800,\n 4802,\n 4805,\n 4808,\n 4822,\n 4824,\n 4880,\n 4882,\n 4885,\n 4888,\n 4954,\n 4992,\n 5007,\n 5024,\n 5108,\n 5121,\n 5740,\n 5743,\n 5759,\n 5761,\n 5786,\n 5792,\n 5866,\n 5870,\n 5872,\n 5888,\n 5900,\n 5902,\n 5905,\n 5920,\n 5937,\n 5952,\n 5969,\n 5984,\n 5996,\n 5998,\n 6000,\n 6016,\n 6067,\n 6103,\n 6103,\n 6108,\n 6108,\n 6176,\n 6263,\n 6272,\n 6312,\n 6314,\n 6314,\n 6320,\n 6389,\n 6400,\n 6428,\n 6480,\n 6509,\n 6512,\n 6516,\n 6528,\n 6571,\n 6593,\n 6599,\n 6656,\n 6678,\n 6688,\n 6740,\n 6823,\n 6823,\n 6917,\n 6963,\n 6981,\n 6987,\n 7043,\n 7072,\n 7086,\n 7087,\n 7104,\n 7141,\n 7168,\n 7203,\n 7245,\n 7247,\n 7258,\n 7293,\n 7401,\n 7404,\n 7406,\n 7409,\n 7424,\n 7615,\n 7680,\n 7957,\n 7960,\n 7965,\n 7968,\n 8005,\n 8008,\n 8013,\n 8016,\n 8023,\n 8025,\n 8025,\n 8027,\n 8027,\n 8029,\n 8029,\n 8031,\n 8061,\n 8064,\n 8116,\n 8118,\n 8124,\n 8126,\n 8126,\n 8130,\n 8132,\n 8134,\n 8140,\n 8144,\n 8147,\n 8150,\n 8155,\n 8160,\n 8172,\n 8178,\n 8180,\n 8182,\n 8188,\n 8305,\n 8305,\n 8319,\n 8319,\n 8336,\n 8348,\n 8450,\n 8450,\n 8455,\n 8455,\n 8458,\n 8467,\n 8469,\n 8469,\n 8473,\n 8477,\n 8484,\n 8484,\n 8486,\n 8486,\n 8488,\n 8488,\n 8490,\n 8493,\n 8495,\n 8505,\n 8508,\n 8511,\n 8517,\n 8521,\n 8526,\n 8526,\n 8544,\n 8584,\n 11264,\n 11310,\n 11312,\n 11358,\n 11360,\n 11492,\n 11499,\n 11502,\n 11520,\n 11557,\n 11568,\n 11621,\n 11631,\n 11631,\n 11648,\n 11670,\n 11680,\n 11686,\n 11688,\n 11694,\n 11696,\n 11702,\n 11704,\n 11710,\n 11712,\n 11718,\n 11720,\n 11726,\n 11728,\n 11734,\n 11736,\n 11742,\n 11823,\n 11823,\n 12293,\n 12295,\n 12321,\n 12329,\n 12337,\n 12341,\n 12344,\n 12348,\n 12353,\n 12438,\n 12445,\n 12447,\n 12449,\n 12538,\n 12540,\n 12543,\n 12549,\n 12589,\n 12593,\n 12686,\n 12704,\n 12730,\n 12784,\n 12799,\n 13312,\n 13312,\n 19893,\n 19893,\n 19968,\n 19968,\n 40907,\n 40907,\n 40960,\n 42124,\n 42192,\n 42237,\n 42240,\n 42508,\n 42512,\n 42527,\n 42538,\n 42539,\n 42560,\n 42606,\n 42623,\n 42647,\n 42656,\n 42735,\n 42775,\n 42783,\n 42786,\n 42888,\n 42891,\n 42894,\n 42896,\n 42897,\n 42912,\n 42921,\n 43002,\n 43009,\n 43011,\n 43013,\n 43015,\n 43018,\n 43020,\n 43042,\n 43072,\n 43123,\n 43138,\n 43187,\n 43250,\n 43255,\n 43259,\n 43259,\n 43274,\n 43301,\n 43312,\n 43334,\n 43360,\n 43388,\n 43396,\n 43442,\n 43471,\n 43471,\n 43520,\n 43560,\n 43584,\n 43586,\n 43588,\n 43595,\n 43616,\n 43638,\n 43642,\n 43642,\n 43648,\n 43695,\n 43697,\n 43697,\n 43701,\n 43702,\n 43705,\n 43709,\n 43712,\n 43712,\n 43714,\n 43714,\n 43739,\n 43741,\n 43777,\n 43782,\n 43785,\n 43790,\n 43793,\n 43798,\n 43808,\n 43814,\n 43816,\n 43822,\n 43968,\n 44002,\n 44032,\n 44032,\n 55203,\n 55203,\n 55216,\n 55238,\n 55243,\n 55291,\n 63744,\n 64045,\n 64048,\n 64109,\n 64112,\n 64217,\n 64256,\n 64262,\n 64275,\n 64279,\n 64285,\n 64285,\n 64287,\n 64296,\n 64298,\n 64310,\n 64312,\n 64316,\n 64318,\n 64318,\n 64320,\n 64321,\n 64323,\n 64324,\n 64326,\n 64433,\n 64467,\n 64829,\n 64848,\n 64911,\n 64914,\n 64967,\n 65008,\n 65019,\n 65136,\n 65140,\n 65142,\n 65276,\n 65313,\n 65338,\n 65345,\n 65370,\n 65382,\n 65470,\n 65474,\n 65479,\n 65482,\n 65487,\n 65490,\n 65495,\n 65498,\n 65500,\n 65536,\n 65547,\n 65549,\n 65574,\n 65576,\n 65594,\n 65596,\n 65597,\n 65599,\n 65613,\n 65616,\n 65629,\n 65664,\n 65786,\n 65856,\n 65908,\n 66176,\n 66204,\n 66208,\n 66256,\n 66304,\n 66334,\n 66352,\n 66378,\n 66432,\n 66461,\n 66464,\n 66499,\n 66504,\n 66511,\n 66513,\n 66517,\n 66560,\n 66717,\n 67584,\n 67589,\n 67592,\n 67592,\n 67594,\n 67637,\n 67639,\n 67640,\n 67644,\n 67644,\n 67647,\n 67669,\n 67840,\n 67861,\n 67872,\n 67897,\n 68096,\n 68096,\n 68112,\n 68115,\n 68117,\n 68119,\n 68121,\n 68147,\n 68192,\n 68220,\n 68352,\n 68405,\n 68416,\n 68437,\n 68448,\n 68466,\n 68608,\n 68680,\n 69635,\n 69687,\n 69763,\n 69807,\n 73728,\n 74606,\n 74752,\n 74850,\n 77824,\n 78894,\n 92160,\n 92728,\n 110592,\n 110593,\n 119808,\n 119892,\n 119894,\n 119964,\n 119966,\n 119967,\n 119970,\n 119970,\n 119973,\n 119974,\n 119977,\n 119980,\n 119982,\n 119993,\n 119995,\n 119995,\n 119997,\n 120003,\n 120005,\n 120069,\n 120071,\n 120074,\n 120077,\n 120084,\n 120086,\n 120092,\n 120094,\n 120121,\n 120123,\n 120126,\n 120128,\n 120132,\n 120134,\n 120134,\n 120138,\n 120144,\n 120146,\n 120485,\n 120488,\n 120512,\n 120514,\n 120538,\n 120540,\n 120570,\n 120572,\n 120596,\n 120598,\n 120628,\n 120630,\n 120654,\n 120656,\n 120686,\n 120688,\n 120712,\n 120714,\n 120744,\n 120746,\n 120770,\n 120772,\n 120779,\n 131072,\n 131072,\n 173782,\n 173782,\n 173824,\n 173824,\n 177972,\n 177972,\n 177984,\n 177984,\n 178205,\n 178205,\n 194560,\n 195101,\n];\nvar identifierStartTable = [];\nfor (var i = 0; i < 128; i++) {\n identifierStartTable[i] =\n (i >= 48 && i <= 57) || // 0-9\n i === 36 || // $\n i === 126 || // ~\n i === 124 || // |\n (i >= 65 && i <= 90) || // A-Z\n i === 95 || // _\n i === 45 || // -\n i === 42 || // *\n i === 58 || // :\n i === 91 || // templateStart [\n i === 93 || // templateEnd ]\n i === 63 || // ?\n i === 37 || // %\n i === 35 || // #\n i === 61 || // =\n (i >= 97 && i <= 122); // a-z\n}\nvar identifierPartTable = identifierStartTable;\nfunction Lexer(expression) {\n this.input = expression;\n this.char = 1;\n this.from = 1;\n}\nLexer.prototype = {\n peek: function (i) {\n return this.input.charAt(i || 0);\n },\n skip: function (i) {\n i = i || 1;\n this.char += i;\n this.input = this.input.slice(i);\n },\n tokenize: function () {\n var list = [];\n var token;\n while ((token = this.next())) {\n list.push(token);\n }\n return list;\n },\n next: function () {\n this.from = this.char;\n // Move to the next non-space character.\n if (/\\s/.test(this.peek())) {\n while (/\\s/.test(this.peek())) {\n this.from += 1;\n this.skip();\n }\n if (this.peek() === '') {\n // EOL\n return null;\n }\n }\n var match = this.scanStringLiteral();\n if (match) {\n return match;\n }\n match = this.scanPunctuator() || this.scanNumericLiteral() || this.scanIdentifier() || this.scanTemplateSequence();\n if (match) {\n this.skip(match.value.length);\n return match;\n }\n // No token could be matched, give up.\n return null;\n },\n scanTemplateSequence: function () {\n if (this.peek() === '[' && this.peek(1) === '[') {\n return {\n type: 'templateStart',\n value: '[[',\n pos: this.char,\n };\n }\n if (this.peek() === ']' && this.peek(1) === ']') {\n return {\n type: 'templateEnd',\n value: '[[',\n pos: this.char,\n };\n }\n return null;\n },\n /*\n * Extract a JavaScript identifier out of the next sequence of\n * characters or return 'null' if its not possible. In addition,\n * to Identifier this method can also produce BooleanLiteral\n * (true/false) and NullLiteral (null).\n */\n scanIdentifier: function () {\n var id = '';\n var index = 0;\n var type, char;\n // Detects any character in the Unicode categories \"Uppercase\n // letter (Lu)\", \"Lowercase letter (Ll)\", \"Titlecase letter\n // (Lt)\", \"Modifier letter (Lm)\", \"Other letter (Lo)\", or\n // \"Letter number (Nl)\".\n //\n // Both approach and unicodeLetterTable were borrowed from\n // Google's Traceur.\n function isUnicodeLetter(code) {\n for (var i = 0; i < unicodeLetterTable.length;) {\n if (code < unicodeLetterTable[i++]) {\n return false;\n }\n if (code <= unicodeLetterTable[i++]) {\n return true;\n }\n }\n return false;\n }\n function isHexDigit(str) {\n return /^[0-9a-fA-F]$/.test(str);\n }\n var readUnicodeEscapeSequence = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.bind(function () {\n /*jshint validthis:true */\n index += 1;\n if (this.peek(index) !== 'u') {\n return null;\n }\n var ch1 = this.peek(index + 1);\n var ch2 = this.peek(index + 2);\n var ch3 = this.peek(index + 3);\n var ch4 = this.peek(index + 4);\n var code;\n if (isHexDigit(ch1) && isHexDigit(ch2) && isHexDigit(ch3) && isHexDigit(ch4)) {\n code = parseInt(ch1 + ch2 + ch3 + ch4, 16);\n if (isUnicodeLetter(code)) {\n index += 5;\n return '\\\\u' + ch1 + ch2 + ch3 + ch4;\n }\n return null;\n }\n return null;\n }, this);\n var getIdentifierStart = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.bind(function () {\n /*jshint validthis:true */\n var chr = this.peek(index);\n var code = chr.charCodeAt(0);\n if (chr === '*') {\n index += 1;\n return chr;\n }\n if (code === 92) {\n return readUnicodeEscapeSequence();\n }\n if (code < 128) {\n if (identifierStartTable[code]) {\n index += 1;\n return chr;\n }\n return null;\n }\n if (isUnicodeLetter(code)) {\n index += 1;\n return chr;\n }\n return null;\n }, this);\n var getIdentifierPart = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.bind(function () {\n /*jshint validthis:true */\n var chr = this.peek(index);\n var code = chr.charCodeAt(0);\n if (code === 92) {\n return readUnicodeEscapeSequence();\n }\n if (code < 128) {\n if (identifierPartTable[code]) {\n index += 1;\n return chr;\n }\n return null;\n }\n if (isUnicodeLetter(code)) {\n index += 1;\n return chr;\n }\n return null;\n }, this);\n char = getIdentifierStart();\n if (char === null) {\n return null;\n }\n id = char;\n for (;;) {\n char = getIdentifierPart();\n if (char === null) {\n break;\n }\n id += char;\n }\n switch (id) {\n case 'true': {\n type = 'bool';\n break;\n }\n case 'false': {\n type = 'bool';\n break;\n }\n default:\n type = 'identifier';\n }\n return {\n type: type,\n value: id,\n pos: this.char,\n };\n },\n /*\n * Extract a numeric literal out of the next sequence of\n * characters or return 'null' if its not possible. This method\n * supports all numeric literals described in section 7.8.3\n * of the EcmaScript 5 specification.\n *\n * This method's implementation was heavily influenced by the\n * scanNumericLiteral function in the Esprima parser's source code.\n */\n scanNumericLiteral: function () {\n var index = 0;\n var value = '';\n var length = this.input.length;\n var char = this.peek(index);\n var bad;\n function isDecimalDigit(str) {\n return /^[0-9]$/.test(str);\n }\n function isOctalDigit(str) {\n return /^[0-7]$/.test(str);\n }\n function isHexDigit(str) {\n return /^[0-9a-fA-F]$/.test(str);\n }\n function isIdentifierStart(ch) {\n return ch === '$' || ch === '_' || ch === '\\\\' || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z');\n }\n // handle negative num literals\n if (char === '-') {\n value += char;\n index += 1;\n char = this.peek(index);\n }\n // Numbers must start either with a decimal digit or a point.\n if (char !== '.' && !isDecimalDigit(char)) {\n return null;\n }\n if (char !== '.') {\n value += this.peek(index);\n index += 1;\n char = this.peek(index);\n if (value === '0') {\n // Base-16 numbers.\n if (char === 'x' || char === 'X') {\n index += 1;\n value += char;\n while (index < length) {\n char = this.peek(index);\n if (!isHexDigit(char)) {\n break;\n }\n value += char;\n index += 1;\n }\n if (value.length <= 2) {\n // 0x\n return {\n type: 'number',\n value: value,\n isMalformed: true,\n pos: this.char,\n };\n }\n if (index < length) {\n char = this.peek(index);\n if (isIdentifierStart(char)) {\n return null;\n }\n }\n return {\n type: 'number',\n value: value,\n base: 16,\n isMalformed: false,\n pos: this.char,\n };\n }\n // Base-8 numbers.\n if (isOctalDigit(char)) {\n index += 1;\n value += char;\n bad = false;\n while (index < length) {\n char = this.peek(index);\n // Numbers like '019' (note the 9) are not valid octals\n // but we still parse them and mark as malformed.\n if (isDecimalDigit(char)) {\n bad = true;\n }\n if (!isOctalDigit(char)) {\n // if the char is a non punctuator then its not a valid number\n if (!this.isPunctuator(char)) {\n return null;\n }\n break;\n }\n value += char;\n index += 1;\n }\n if (index < length) {\n char = this.peek(index);\n if (isIdentifierStart(char)) {\n return null;\n }\n }\n return {\n type: 'number',\n value: value,\n base: 8,\n isMalformed: bad,\n };\n }\n // Decimal numbers that start with '0' such as '09' are illegal\n // but we still parse them and return as malformed.\n if (isDecimalDigit(char)) {\n index += 1;\n value += char;\n }\n }\n while (index < length) {\n char = this.peek(index);\n if (!isDecimalDigit(char)) {\n break;\n }\n value += char;\n index += 1;\n }\n }\n // Decimal digits.\n if (char === '.') {\n value += char;\n index += 1;\n while (index < length) {\n char = this.peek(index);\n if (!isDecimalDigit(char)) {\n break;\n }\n value += char;\n index += 1;\n }\n }\n // Exponent part.\n if (char === 'e' || char === 'E') {\n value += char;\n index += 1;\n char = this.peek(index);\n if (char === '+' || char === '-') {\n value += this.peek(index);\n index += 1;\n }\n char = this.peek(index);\n if (isDecimalDigit(char)) {\n value += char;\n index += 1;\n while (index < length) {\n char = this.peek(index);\n if (!isDecimalDigit(char)) {\n break;\n }\n value += char;\n index += 1;\n }\n }\n else {\n return null;\n }\n }\n if (index < length) {\n char = this.peek(index);\n if (!this.isPunctuator(char)) {\n return null;\n }\n }\n return {\n type: 'number',\n value: value,\n base: 10,\n pos: this.char,\n isMalformed: !isFinite(+value),\n };\n },\n isPunctuator: function (ch1) {\n switch (ch1) {\n case '.':\n case '(':\n case ')':\n case ',':\n case '{':\n case '}':\n return true;\n }\n return false;\n },\n scanPunctuator: function () {\n var ch1 = this.peek();\n if (this.isPunctuator(ch1)) {\n return {\n type: ch1,\n value: ch1,\n pos: this.char,\n };\n }\n return null;\n },\n /*\n * Extract a string out of the next sequence of characters and/or\n * lines or return 'null' if its not possible. Since strings can\n * span across multiple lines this method has to move the char\n * pointer.\n *\n * This method recognizes pseudo-multiline JavaScript strings:\n *\n * var str = \"hello\\\n * world\";\n */\n scanStringLiteral: function () {\n /*jshint loopfunc:true */\n var quote = this.peek();\n // String must start with a quote.\n if (quote !== '\"' && quote !== \"'\") {\n return null;\n }\n var value = '';\n this.skip();\n while (this.peek() !== quote) {\n if (this.peek() === '') {\n // End Of Line\n return {\n type: 'string',\n value: value,\n isUnclosed: true,\n quote: quote,\n pos: this.char,\n };\n }\n var char = this.peek();\n var jump = 1; // A length of a jump, after we're done\n // parsing this character.\n value += char;\n this.skip(jump);\n }\n this.skip();\n return {\n type: 'string',\n value: value,\n isUnclosed: false,\n quote: quote,\n pos: this.char,\n };\n },\n};\n\n\n/***/ }),\n\n/***/ 2087:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return GraphiteConfigCtrl; });\nvar GraphiteConfigCtrl = /** @class */ (function () {\n /** @ngInject */\n GraphiteConfigCtrl.$inject = [\"$scope\", \"datasourceSrv\"];\n function GraphiteConfigCtrl($scope, datasourceSrv) {\n this.graphiteVersions = [\n { name: '0.9.x', value: '0.9' },\n { name: '1.0.x', value: '1.0' },\n { name: '1.1.x', value: '1.1' },\n ];\n this.datasourceSrv = datasourceSrv;\n this.current.jsonData = this.current.jsonData || {};\n this.current.jsonData.graphiteVersion = this.current.jsonData.graphiteVersion || '0.9';\n this.autoDetectGraphiteVersion();\n }\n GraphiteConfigCtrl.prototype.autoDetectGraphiteVersion = function () {\n var _this = this;\n if (!this.current.id) {\n return;\n }\n this.datasourceSrv\n .loadDatasource(this.current.name)\n .then(function (ds) {\n return ds.getVersion();\n })\n .then(function (version) {\n _this.graphiteVersions.push({ name: version, value: version });\n _this.current.jsonData.graphiteVersion = version;\n });\n };\n GraphiteConfigCtrl.templateUrl = 'public/app/plugins/datasource/graphite/partials/config.html';\n return GraphiteConfigCtrl;\n}());\n\n\n\n/***/ }),\n\n/***/ 2088:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnnotationsQueryCtrl\", function() { return CloudWatchAnnotationsQueryCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__query_parameter_ctrl__ = __webpack_require__(2002);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__datasource__ = __webpack_require__(2089);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__query_ctrl__ = __webpack_require__(2090);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__config_ctrl__ = __webpack_require__(2091);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"Datasource\", function() { return __WEBPACK_IMPORTED_MODULE_1__datasource__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"QueryCtrl\", function() { return __WEBPACK_IMPORTED_MODULE_2__query_ctrl__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"ConfigCtrl\", function() { return __WEBPACK_IMPORTED_MODULE_3__config_ctrl__[\"a\"]; });\n\n\n\n\nvar CloudWatchAnnotationsQueryCtrl = /** @class */ (function () {\n function CloudWatchAnnotationsQueryCtrl() {\n }\n CloudWatchAnnotationsQueryCtrl.templateUrl = 'partials/annotations.editor.html';\n return CloudWatchAnnotationsQueryCtrl;\n}());\n\n\n\n/***/ }),\n\n/***/ 2089:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_utils_datemath__ = __webpack_require__(691);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_app_core_utils_kbn__ = __webpack_require__(312);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_app_features_templating_variable__ = __webpack_require__(1984);\n\n\n\n\n\n// import * as moment from 'moment';\nvar CloudWatchDatasource = /** @class */ (function () {\n /** @ngInject */\n CloudWatchDatasource.$inject = [\"instanceSettings\", \"$q\", \"backendSrv\", \"templateSrv\", \"timeSrv\"];\n function CloudWatchDatasource(instanceSettings, $q, backendSrv, templateSrv, timeSrv) {\n this.$q = $q;\n this.backendSrv = backendSrv;\n this.templateSrv = templateSrv;\n this.timeSrv = timeSrv;\n this.type = 'cloudwatch';\n this.name = instanceSettings.name;\n this.supportMetrics = true;\n this.proxyUrl = instanceSettings.url;\n this.defaultRegion = instanceSettings.jsonData.defaultRegion;\n this.instanceSettings = instanceSettings;\n this.standardStatistics = ['Average', 'Maximum', 'Minimum', 'Sum', 'SampleCount'];\n }\n CloudWatchDatasource.prototype.query = function (options) {\n var _this = this;\n options = __WEBPACK_IMPORTED_MODULE_0_angular___default.a.copy(options);\n options.targets = this.expandTemplateVariable(options.targets, options.scopedVars, this.templateSrv);\n var queries = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.filter(options.targets, function (item) {\n return (item.hide !== true && !!item.region && !!item.namespace && !!item.metricName && !__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isEmpty(item.statistics));\n }).map(function (item) {\n item.region = _this.templateSrv.replace(_this.getActualRegion(item.region), options.scopedVars);\n item.namespace = _this.templateSrv.replace(item.namespace, options.scopedVars);\n item.metricName = _this.templateSrv.replace(item.metricName, options.scopedVars);\n item.dimensions = _this.convertDimensionFormat(item.dimensions, options.scopedVars);\n item.period = String(_this.getPeriod(item, options)); // use string format for period in graph query, and alerting\n return __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.extend({\n refId: item.refId,\n intervalMs: options.intervalMs,\n maxDataPoints: options.maxDataPoints,\n datasourceId: _this.instanceSettings.id,\n type: 'timeSeriesQuery',\n }, item);\n });\n // No valid targets, return the empty result to save a round trip.\n if (__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isEmpty(queries)) {\n var d = this.$q.defer();\n d.resolve({ data: [] });\n return d.promise;\n }\n var request = {\n from: options.range.from.valueOf().toString(),\n to: options.range.to.valueOf().toString(),\n queries: queries,\n };\n return this.performTimeSeriesQuery(request);\n };\n CloudWatchDatasource.prototype.getPeriod = function (target, options, now) {\n var start = this.convertToCloudWatchTime(options.range.from, false);\n var end = this.convertToCloudWatchTime(options.range.to, true);\n now = Math.round((now || Date.now()) / 1000);\n var period;\n var range = end - start;\n var hourSec = 60 * 60;\n var daySec = hourSec * 24;\n var periodUnit = 60;\n if (!target.period) {\n if (now - start <= daySec * 15) {\n // until 15 days ago\n if (target.namespace === 'AWS/EC2') {\n periodUnit = period = 300;\n }\n else {\n periodUnit = period = 60;\n }\n }\n else if (now - start <= daySec * 63) {\n // until 63 days ago\n periodUnit = period = 60 * 5;\n }\n else if (now - start <= daySec * 455) {\n // until 455 days ago\n periodUnit = period = 60 * 60;\n }\n else {\n // over 455 days, should return error, but try to long period\n periodUnit = period = 60 * 60;\n }\n }\n else {\n if (/^\\d+$/.test(target.period)) {\n period = parseInt(target.period, 10);\n }\n else {\n period = __WEBPACK_IMPORTED_MODULE_3_app_core_utils_kbn__[\"a\" /* default */].interval_to_seconds(this.templateSrv.replace(target.period, options.scopedVars));\n }\n }\n if (period < 1) {\n period = 1;\n }\n if (!target.highResolution && range / period >= 1440) {\n period = Math.ceil(range / 1440 / periodUnit) * periodUnit;\n }\n return period;\n };\n CloudWatchDatasource.prototype.performTimeSeriesQuery = function (request) {\n return this.awsRequest('/api/tsdb/query', request).then(function (res) {\n var data = [];\n if (res.results) {\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.forEach(res.results, function (queryRes) {\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.forEach(queryRes.series, function (series) {\n data.push({ target: series.name, datapoints: series.points });\n });\n });\n }\n return { data: data };\n });\n };\n CloudWatchDatasource.prototype.transformSuggestDataFromTable = function (suggestData) {\n return __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(suggestData.results['metricFindQuery'].tables[0].rows, function (v) {\n return {\n text: v[0],\n value: v[1],\n };\n });\n };\n CloudWatchDatasource.prototype.doMetricQueryRequest = function (subtype, parameters) {\n var _this = this;\n var range = this.timeSrv.timeRange();\n return this.awsRequest('/api/tsdb/query', {\n from: range.from.valueOf().toString(),\n to: range.to.valueOf().toString(),\n queries: [\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.extend({\n refId: 'metricFindQuery',\n intervalMs: 1,\n maxDataPoints: 1,\n datasourceId: this.instanceSettings.id,\n type: 'metricFindQuery',\n subtype: subtype,\n }, parameters),\n ],\n }).then(function (r) {\n return _this.transformSuggestDataFromTable(r);\n });\n };\n CloudWatchDatasource.prototype.getRegions = function () {\n return this.doMetricQueryRequest('regions', null);\n };\n CloudWatchDatasource.prototype.getNamespaces = function () {\n return this.doMetricQueryRequest('namespaces', null);\n };\n CloudWatchDatasource.prototype.getMetrics = function (namespace, region) {\n return this.doMetricQueryRequest('metrics', {\n region: this.templateSrv.replace(this.getActualRegion(region)),\n namespace: this.templateSrv.replace(namespace),\n });\n };\n CloudWatchDatasource.prototype.getDimensionKeys = function (namespace, region) {\n return this.doMetricQueryRequest('dimension_keys', {\n region: this.templateSrv.replace(this.getActualRegion(region)),\n namespace: this.templateSrv.replace(namespace),\n });\n };\n CloudWatchDatasource.prototype.getDimensionValues = function (region, namespace, metricName, dimensionKey, filterDimensions) {\n return this.doMetricQueryRequest('dimension_values', {\n region: this.templateSrv.replace(this.getActualRegion(region)),\n namespace: this.templateSrv.replace(namespace),\n metricName: this.templateSrv.replace(metricName),\n dimensionKey: this.templateSrv.replace(dimensionKey),\n dimensions: this.convertDimensionFormat(filterDimensions, {}),\n });\n };\n CloudWatchDatasource.prototype.getEbsVolumeIds = function (region, instanceId) {\n return this.doMetricQueryRequest('ebs_volume_ids', {\n region: this.templateSrv.replace(this.getActualRegion(region)),\n instanceId: this.templateSrv.replace(instanceId),\n });\n };\n CloudWatchDatasource.prototype.getEc2InstanceAttribute = function (region, attributeName, filters) {\n return this.doMetricQueryRequest('ec2_instance_attribute', {\n region: this.templateSrv.replace(this.getActualRegion(region)),\n attributeName: this.templateSrv.replace(attributeName),\n filters: filters,\n });\n };\n CloudWatchDatasource.prototype.metricFindQuery = function (query) {\n var region;\n var namespace;\n var metricName;\n var filterJson;\n var regionQuery = query.match(/^regions\\(\\)/);\n if (regionQuery) {\n return this.getRegions();\n }\n var namespaceQuery = query.match(/^namespaces\\(\\)/);\n if (namespaceQuery) {\n return this.getNamespaces();\n }\n var metricNameQuery = query.match(/^metrics\\(([^\\)]+?)(,\\s?([^,]+?))?\\)/);\n if (metricNameQuery) {\n namespace = metricNameQuery[1];\n region = metricNameQuery[3];\n return this.getMetrics(namespace, region);\n }\n var dimensionKeysQuery = query.match(/^dimension_keys\\(([^\\)]+?)(,\\s?([^,]+?))?\\)/);\n if (dimensionKeysQuery) {\n namespace = dimensionKeysQuery[1];\n region = dimensionKeysQuery[3];\n return this.getDimensionKeys(namespace, region);\n }\n var dimensionValuesQuery = query.match(/^dimension_values\\(([^,]+?),\\s?([^,]+?),\\s?([^,]+?),\\s?([^,]+?)(,\\s?(.+))?\\)/);\n if (dimensionValuesQuery) {\n region = dimensionValuesQuery[1];\n namespace = dimensionValuesQuery[2];\n metricName = dimensionValuesQuery[3];\n var dimensionKey = dimensionValuesQuery[4];\n filterJson = {};\n if (dimensionValuesQuery[6]) {\n filterJson = JSON.parse(this.templateSrv.replace(dimensionValuesQuery[6]));\n }\n return this.getDimensionValues(region, namespace, metricName, dimensionKey, filterJson);\n }\n var ebsVolumeIdsQuery = query.match(/^ebs_volume_ids\\(([^,]+?),\\s?([^,]+?)\\)/);\n if (ebsVolumeIdsQuery) {\n region = ebsVolumeIdsQuery[1];\n var instanceId = ebsVolumeIdsQuery[2];\n return this.getEbsVolumeIds(region, instanceId);\n }\n var ec2InstanceAttributeQuery = query.match(/^ec2_instance_attribute\\(([^,]+?),\\s?([^,]+?),\\s?(.+?)\\)/);\n if (ec2InstanceAttributeQuery) {\n region = ec2InstanceAttributeQuery[1];\n var targetAttributeName = ec2InstanceAttributeQuery[2];\n filterJson = JSON.parse(this.templateSrv.replace(ec2InstanceAttributeQuery[3]));\n return this.getEc2InstanceAttribute(region, targetAttributeName, filterJson);\n }\n return this.$q.when([]);\n };\n CloudWatchDatasource.prototype.annotationQuery = function (options) {\n var _this = this;\n var annotation = options.annotation;\n var statistics = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(annotation.statistics, function (s) {\n return _this.templateSrv.replace(s);\n });\n var defaultPeriod = annotation.prefixMatching ? '' : '300';\n var period = annotation.period || defaultPeriod;\n period = parseInt(period, 10);\n var parameters = {\n prefixMatching: annotation.prefixMatching,\n region: this.templateSrv.replace(this.getActualRegion(annotation.region)),\n namespace: this.templateSrv.replace(annotation.namespace),\n metricName: this.templateSrv.replace(annotation.metricName),\n dimensions: this.convertDimensionFormat(annotation.dimensions, {}),\n statistics: statistics,\n period: period,\n actionPrefix: annotation.actionPrefix || '',\n alarmNamePrefix: annotation.alarmNamePrefix || '',\n };\n return this.awsRequest('/api/tsdb/query', {\n from: options.range.from.valueOf().toString(),\n to: options.range.to.valueOf().toString(),\n queries: [\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.extend({\n refId: 'annotationQuery',\n intervalMs: 1,\n maxDataPoints: 1,\n datasourceId: this.instanceSettings.id,\n type: 'annotationQuery',\n }, parameters),\n ],\n }).then(function (r) {\n return __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(r.results['annotationQuery'].tables[0].rows, function (v) {\n return {\n annotation: annotation,\n time: Date.parse(v[0]),\n title: v[1],\n tags: [v[2]],\n text: v[3],\n };\n });\n });\n };\n CloudWatchDatasource.prototype.targetContainsTemplate = function (target) {\n var _this = this;\n return (this.templateSrv.variableExists(target.region) ||\n this.templateSrv.variableExists(target.namespace) ||\n this.templateSrv.variableExists(target.metricName) ||\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find(target.dimensions, function (v, k) {\n return _this.templateSrv.variableExists(k) || _this.templateSrv.variableExists(v);\n }));\n };\n CloudWatchDatasource.prototype.testDatasource = function () {\n /* use billing metrics for test */\n var region = this.defaultRegion;\n var namespace = 'AWS/Billing';\n var metricName = 'EstimatedCharges';\n var dimensions = {};\n return this.getDimensionValues(region, namespace, metricName, 'ServiceName', dimensions).then(function () {\n return { status: 'success', message: 'Data source is working' };\n }, function (err) {\n return { status: 'error', message: err.message };\n });\n };\n CloudWatchDatasource.prototype.awsRequest = function (url, data) {\n var options = {\n method: 'POST',\n url: url,\n data: data,\n };\n return this.backendSrv.datasourceRequest(options).then(function (result) {\n return result.data;\n });\n };\n CloudWatchDatasource.prototype.getDefaultRegion = function () {\n return this.defaultRegion;\n };\n CloudWatchDatasource.prototype.getActualRegion = function (region) {\n if (region === 'default' || __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isEmpty(region)) {\n return this.getDefaultRegion();\n }\n return region;\n };\n CloudWatchDatasource.prototype.getExpandedVariables = function (target, dimensionKey, variable, templateSrv) {\n /* if the all checkbox is marked we should add all values to the targets */\n var allSelected = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find(variable.options, { selected: true, text: 'All' });\n return __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.chain(variable.options)\n .filter(function (v) {\n if (allSelected) {\n return v.text !== 'All';\n }\n else {\n return v.selected;\n }\n })\n .map(function (v) {\n var t = __WEBPACK_IMPORTED_MODULE_0_angular___default.a.copy(target);\n var scopedVar = {};\n scopedVar[variable.name] = v;\n t.refId = target.refId + '_' + v.value;\n t.dimensions[dimensionKey] = templateSrv.replace(t.dimensions[dimensionKey], scopedVar);\n return t;\n })\n .value();\n };\n CloudWatchDatasource.prototype.expandTemplateVariable = function (targets, scopedVars, templateSrv) {\n var _this = this;\n return __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.chain(targets)\n .map(function (target) {\n var dimensionKey = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.findKey(target.dimensions, function (v) {\n return templateSrv.variableExists(v) && !__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.has(scopedVars, templateSrv.getVariableName(v));\n });\n if (dimensionKey) {\n var multiVariable = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find(templateSrv.variables, function (variable) {\n return (__WEBPACK_IMPORTED_MODULE_4_app_features_templating_variable__[\"b\" /* containsVariable */](target.dimensions[dimensionKey], variable.name) && variable.multi);\n });\n var variable = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find(templateSrv.variables, function (variable) {\n return __WEBPACK_IMPORTED_MODULE_4_app_features_templating_variable__[\"b\" /* containsVariable */](target.dimensions[dimensionKey], variable.name);\n });\n return _this.getExpandedVariables(target, dimensionKey, multiVariable || variable, templateSrv);\n }\n else {\n return [target];\n }\n })\n .flatten()\n .value();\n };\n CloudWatchDatasource.prototype.convertToCloudWatchTime = function (date, roundUp) {\n if (__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isString(date)) {\n date = __WEBPACK_IMPORTED_MODULE_2_app_core_utils_datemath__[\"parse\"](date, roundUp);\n }\n return Math.round(date.valueOf() / 1000);\n };\n CloudWatchDatasource.prototype.convertDimensionFormat = function (dimensions, scopedVars) {\n var _this = this;\n var convertedDimensions = {};\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(dimensions, function (value, key) {\n convertedDimensions[_this.templateSrv.replace(key, scopedVars)] = _this.templateSrv.replace(value, scopedVars);\n });\n return convertedDimensions;\n };\n return CloudWatchDatasource;\n}());\n/* harmony default export */ __webpack_exports__[\"a\"] = (CloudWatchDatasource);\n\n\n/***/ }),\n\n/***/ 2090:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return CloudWatchQueryCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__query_parameter_ctrl__ = __webpack_require__(2002);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_plugins_sdk__ = __webpack_require__(1983);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\nvar CloudWatchQueryCtrl = /** @class */ (function (_super) {\n __extends(CloudWatchQueryCtrl, _super);\n /** @ngInject **/\n CloudWatchQueryCtrl.$inject = [\"$scope\", \"$injector\"];\n function CloudWatchQueryCtrl($scope, $injector) {\n var _this = _super.call(this, $scope, $injector) || this;\n _this.aliasSyntax = '{{metric}} {{stat}} {{namespace}} {{region}} {{}}';\n return _this;\n }\n CloudWatchQueryCtrl.templateUrl = 'partials/query.editor.html';\n return CloudWatchQueryCtrl;\n}(__WEBPACK_IMPORTED_MODULE_1_app_plugins_sdk__[\"QueryCtrl\"]));\n\n\n\n/***/ }),\n\n/***/ 2091:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return CloudWatchConfigCtrl; });\nvar CloudWatchConfigCtrl = /** @class */ (function () {\n /** @ngInject */\n CloudWatchConfigCtrl.$inject = [\"$scope\"];\n function CloudWatchConfigCtrl($scope) {\n this.accessKeyExist = false;\n this.secretKeyExist = false;\n this.authTypes = [\n { name: 'Access & secret key', value: 'keys' },\n { name: 'Credentials file', value: 'credentials' },\n { name: 'ARN', value: 'arn' },\n ];\n this.indexPatternTypes = [\n { name: 'No pattern', value: undefined },\n { name: 'Hourly', value: 'Hourly', example: '[logstash-]YYYY.MM.DD.HH' },\n { name: 'Daily', value: 'Daily', example: '[logstash-]YYYY.MM.DD' },\n { name: 'Weekly', value: 'Weekly', example: '[logstash-]GGGG.WW' },\n { name: 'Monthly', value: 'Monthly', example: '[logstash-]YYYY.MM' },\n { name: 'Yearly', value: 'Yearly', example: '[logstash-]YYYY' },\n ];\n this.current.jsonData.timeField = this.current.jsonData.timeField || '@timestamp';\n this.current.jsonData.authType = this.current.jsonData.authType || 'credentials';\n this.accessKeyExist = this.current.secureJsonFields.accessKey;\n this.secretKeyExist = this.current.secureJsonFields.secretKey;\n }\n CloudWatchConfigCtrl.prototype.resetAccessKey = function () {\n this.accessKeyExist = false;\n };\n CloudWatchConfigCtrl.prototype.resetSecretKey = function () {\n this.secretKeyExist = false;\n };\n CloudWatchConfigCtrl.templateUrl = 'partials/config.html';\n return CloudWatchConfigCtrl;\n}());\n\n\n\n/***/ }),\n\n/***/ 2092:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnnotationsQueryCtrl\", function() { return ElasticAnnotationsQueryCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__datasource__ = __webpack_require__(2093);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__query_ctrl__ = __webpack_require__(2097);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_ctrl__ = __webpack_require__(2100);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"Datasource\", function() { return __WEBPACK_IMPORTED_MODULE_0__datasource__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"QueryCtrl\", function() { return __WEBPACK_IMPORTED_MODULE_1__query_ctrl__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"ConfigCtrl\", function() { return __WEBPACK_IMPORTED_MODULE_2__config_ctrl__[\"a\"]; });\n\n\n\nvar ElasticAnnotationsQueryCtrl = /** @class */ (function () {\n function ElasticAnnotationsQueryCtrl() {\n }\n ElasticAnnotationsQueryCtrl.templateUrl = 'partials/annotations.editor.html';\n return ElasticAnnotationsQueryCtrl;\n}());\n\n\n\n/***/ }),\n\n/***/ 2093:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return ElasticDatasource; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_moment__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_moment__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__query_builder__ = __webpack_require__(2094);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__index_pattern__ = __webpack_require__(2095);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__elastic_response__ = __webpack_require__(2096);\n\n\n\n\n\n\nvar ElasticDatasource = /** @class */ (function () {\n /** @ngInject */\n ElasticDatasource.$inject = [\"instanceSettings\", \"$q\", \"backendSrv\", \"templateSrv\", \"timeSrv\"];\n function ElasticDatasource(instanceSettings, $q, backendSrv, templateSrv, timeSrv) {\n this.$q = $q;\n this.backendSrv = backendSrv;\n this.templateSrv = templateSrv;\n this.timeSrv = timeSrv;\n this.basicAuth = instanceSettings.basicAuth;\n this.withCredentials = instanceSettings.withCredentials;\n this.url = instanceSettings.url;\n this.name = instanceSettings.name;\n this.index = instanceSettings.index;\n this.timeField = instanceSettings.jsonData.timeField;\n this.esVersion = instanceSettings.jsonData.esVersion;\n this.indexPattern = new __WEBPACK_IMPORTED_MODULE_4__index_pattern__[\"a\" /* IndexPattern */](instanceSettings.index, instanceSettings.jsonData.interval);\n this.interval = instanceSettings.jsonData.timeInterval;\n this.maxConcurrentShardRequests = instanceSettings.jsonData.maxConcurrentShardRequests;\n this.queryBuilder = new __WEBPACK_IMPORTED_MODULE_3__query_builder__[\"a\" /* ElasticQueryBuilder */]({\n timeField: this.timeField,\n esVersion: this.esVersion,\n });\n }\n ElasticDatasource.prototype.request = function (method, url, data) {\n var options = {\n url: this.url + '/' + url,\n method: method,\n data: data,\n };\n if (this.basicAuth || this.withCredentials) {\n options.withCredentials = true;\n }\n if (this.basicAuth) {\n options.headers = {\n Authorization: this.basicAuth,\n };\n }\n return this.backendSrv.datasourceRequest(options);\n };\n ElasticDatasource.prototype.get = function (url) {\n var range = this.timeSrv.timeRange();\n var index_list = this.indexPattern.getIndexList(range.from.valueOf(), range.to.valueOf());\n if (__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isArray(index_list) && index_list.length) {\n return this.request('GET', index_list[0] + url).then(function (results) {\n results.data.$$config = results.config;\n return results.data;\n });\n }\n else {\n return this.request('GET', this.indexPattern.getIndexForToday() + url).then(function (results) {\n results.data.$$config = results.config;\n return results.data;\n });\n }\n };\n ElasticDatasource.prototype.post = function (url, data) {\n return this.request('POST', url, data)\n .then(function (results) {\n results.data.$$config = results.config;\n return results.data;\n })\n .catch(function (err) {\n if (err.data && err.data.error) {\n throw {\n message: 'Elasticsearch error: ' + err.data.error.reason,\n error: err.data.error,\n };\n }\n throw err;\n });\n };\n ElasticDatasource.prototype.annotationQuery = function (options) {\n var annotation = options.annotation;\n var timeField = annotation.timeField || '@timestamp';\n var queryString = annotation.query || '*';\n var tagsField = annotation.tagsField || 'tags';\n var textField = annotation.textField || null;\n var range = {};\n range[timeField] = {\n from: options.range.from.valueOf(),\n to: options.range.to.valueOf(),\n format: 'epoch_millis',\n };\n var queryInterpolated = this.templateSrv.replace(queryString, {}, 'lucene');\n var query = {\n bool: {\n filter: [\n { range: range },\n {\n query_string: {\n query: queryInterpolated,\n },\n },\n ],\n },\n };\n var data = {\n query: query,\n size: 10000,\n };\n // fields field not supported on ES 5.x\n if (this.esVersion < 5) {\n data['fields'] = [timeField, '_source'];\n }\n var header = {\n search_type: 'query_then_fetch',\n ignore_unavailable: true,\n };\n // old elastic annotations had index specified on them\n if (annotation.index) {\n header.index = annotation.index;\n }\n else {\n header.index = this.indexPattern.getIndexList(options.range.from, options.range.to);\n }\n var payload = __WEBPACK_IMPORTED_MODULE_0_angular___default.a.toJson(header) + '\\n' + __WEBPACK_IMPORTED_MODULE_0_angular___default.a.toJson(data) + '\\n';\n return this.post('_msearch', payload).then(function (res) {\n var list = [];\n var hits = res.responses[0].hits.hits;\n var getFieldFromSource = function (source, fieldName) {\n if (!fieldName) {\n return;\n }\n var fieldNames = fieldName.split('.');\n var fieldValue = source;\n for (var i = 0; i < fieldNames.length; i++) {\n fieldValue = fieldValue[fieldNames[i]];\n if (!fieldValue) {\n console.log('could not find field in annotation: ', fieldName);\n return '';\n }\n }\n return fieldValue;\n };\n for (var i = 0; i < hits.length; i++) {\n var source = hits[i]._source;\n var time = getFieldFromSource(source, timeField);\n if (typeof hits[i].fields !== 'undefined') {\n var fields = hits[i].fields;\n if (__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isString(fields[timeField]) || __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isNumber(fields[timeField])) {\n time = fields[timeField];\n }\n }\n var event = {\n annotation: annotation,\n time: __WEBPACK_IMPORTED_MODULE_2_moment___default.a.utc(time).valueOf(),\n text: getFieldFromSource(source, textField),\n tags: getFieldFromSource(source, tagsField),\n };\n // legacy support for title tield\n if (annotation.titleField) {\n var title = getFieldFromSource(source, annotation.titleField);\n if (title) {\n event.text = title + '\\n' + event.text;\n }\n }\n if (typeof event.tags === 'string') {\n event.tags = event.tags.split(',');\n }\n list.push(event);\n }\n return list;\n });\n };\n ElasticDatasource.prototype.testDatasource = function () {\n this.timeSrv.setTime({ from: 'now-1m', to: 'now' }, true);\n // validate that the index exist and has date field\n return this.getFields({ type: 'date' }).then(function (dateFields) {\n var timeField = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find(dateFields, { text: this.timeField });\n if (!timeField) {\n return {\n status: 'error',\n message: 'No date field named ' + this.timeField + ' found',\n };\n }\n return { status: 'success', message: 'Index OK. Time field name OK.' };\n }.bind(this), function (err) {\n console.log(err);\n if (err.data && err.data.error) {\n var message = __WEBPACK_IMPORTED_MODULE_0_angular___default.a.toJson(err.data.error);\n if (err.data.error.reason) {\n message = err.data.error.reason;\n }\n return { status: 'error', message: message };\n }\n else {\n return { status: 'error', message: err.status };\n }\n });\n };\n ElasticDatasource.prototype.getQueryHeader = function (searchType, timeFrom, timeTo) {\n var query_header = {\n search_type: searchType,\n ignore_unavailable: true,\n index: this.indexPattern.getIndexList(timeFrom, timeTo),\n };\n if (this.esVersion >= 56) {\n query_header['max_concurrent_shard_requests'] = this.maxConcurrentShardRequests;\n }\n return __WEBPACK_IMPORTED_MODULE_0_angular___default.a.toJson(query_header);\n };\n ElasticDatasource.prototype.query = function (options) {\n var payload = '';\n var target;\n var sentTargets = [];\n // add global adhoc filters to timeFilter\n var adhocFilters = this.templateSrv.getAdhocFilters(this.name);\n for (var i = 0; i < options.targets.length; i++) {\n target = options.targets[i];\n if (target.hide) {\n continue;\n }\n var queryString = this.templateSrv.replace(target.query || '*', options.scopedVars, 'lucene');\n var queryObj = this.queryBuilder.build(target, adhocFilters, queryString);\n var esQuery = __WEBPACK_IMPORTED_MODULE_0_angular___default.a.toJson(queryObj);\n var searchType = queryObj.size === 0 && this.esVersion < 5 ? 'count' : 'query_then_fetch';\n var header = this.getQueryHeader(searchType, options.range.from, options.range.to);\n payload += header + '\\n';\n payload += esQuery + '\\n';\n sentTargets.push(target);\n }\n if (sentTargets.length === 0) {\n return this.$q.when([]);\n }\n payload = payload.replace(/\\$timeFrom/g, options.range.from.valueOf());\n payload = payload.replace(/\\$timeTo/g, options.range.to.valueOf());\n payload = this.templateSrv.replace(payload, options.scopedVars);\n return this.post('_msearch', payload).then(function (res) {\n return new __WEBPACK_IMPORTED_MODULE_5__elastic_response__[\"a\" /* ElasticResponse */](sentTargets, res).getTimeSeries();\n });\n };\n ElasticDatasource.prototype.getFields = function (query) {\n return this.get('/_mapping').then(function (result) {\n var typeMap = {\n float: 'number',\n double: 'number',\n integer: 'number',\n long: 'number',\n date: 'date',\n string: 'string',\n text: 'string',\n scaled_float: 'number',\n nested: 'nested',\n };\n function shouldAddField(obj, key, query) {\n if (key[0] === '_') {\n return false;\n }\n if (!query.type) {\n return true;\n }\n // equal query type filter, or via typemap translation\n return query.type === obj.type || query.type === typeMap[obj.type];\n }\n // Store subfield names: [system, process, cpu, total] -> system.process.cpu.total\n var fieldNameParts = [];\n var fields = {};\n function getFieldsRecursively(obj) {\n for (var key in obj) {\n var subObj = obj[key];\n // Check mapping field for nested fields\n if (__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isObject(subObj.properties)) {\n fieldNameParts.push(key);\n getFieldsRecursively(subObj.properties);\n }\n if (__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isObject(subObj.fields)) {\n fieldNameParts.push(key);\n getFieldsRecursively(subObj.fields);\n }\n if (__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isString(subObj.type)) {\n var fieldName = fieldNameParts.concat(key).join('.');\n // Hide meta-fields and check field type\n if (shouldAddField(subObj, key, query)) {\n fields[fieldName] = {\n text: fieldName,\n type: subObj.type,\n };\n }\n }\n }\n fieldNameParts.pop();\n }\n for (var indexName in result) {\n var index = result[indexName];\n if (index && index.mappings) {\n var mappings = index.mappings;\n for (var typeName in mappings) {\n var properties = mappings[typeName].properties;\n getFieldsRecursively(properties);\n }\n }\n }\n // transform to array\n return __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(fields, function (value) {\n return value;\n });\n });\n };\n ElasticDatasource.prototype.getTerms = function (queryDef) {\n var range = this.timeSrv.timeRange();\n var searchType = this.esVersion >= 5 ? 'query_then_fetch' : 'count';\n var header = this.getQueryHeader(searchType, range.from, range.to);\n var esQuery = __WEBPACK_IMPORTED_MODULE_0_angular___default.a.toJson(this.queryBuilder.getTermsQuery(queryDef));\n esQuery = esQuery.replace(/\\$timeFrom/g, range.from.valueOf());\n esQuery = esQuery.replace(/\\$timeTo/g, range.to.valueOf());\n esQuery = header + '\\n' + esQuery + '\\n';\n return this.post('_msearch?search_type=' + searchType, esQuery).then(function (res) {\n if (!res.responses[0].aggregations) {\n return [];\n }\n var buckets = res.responses[0].aggregations['1'].buckets;\n return __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(buckets, function (bucket) {\n return {\n text: bucket.key_as_string || bucket.key,\n value: bucket.key,\n };\n });\n });\n };\n ElasticDatasource.prototype.metricFindQuery = function (query) {\n query = __WEBPACK_IMPORTED_MODULE_0_angular___default.a.fromJson(query);\n if (!query) {\n return this.$q.when([]);\n }\n if (query.find === 'fields') {\n query.field = this.templateSrv.replace(query.field, {}, 'lucene');\n return this.getFields(query);\n }\n if (query.find === 'terms') {\n query.field = this.templateSrv.replace(query.field, {}, 'lucene');\n query.query = this.templateSrv.replace(query.query || '*', {}, 'lucene');\n return this.getTerms(query);\n }\n };\n ElasticDatasource.prototype.getTagKeys = function () {\n return this.getFields({});\n };\n ElasticDatasource.prototype.getTagValues = function (options) {\n return this.getTerms({ field: options.key, query: '*' });\n };\n ElasticDatasource.prototype.targetContainsTemplate = function (target) {\n if (this.templateSrv.variableExists(target.query) || this.templateSrv.variableExists(target.alias)) {\n return true;\n }\n for (var _i = 0, _a = target.bucketAggs; _i < _a.length; _i++) {\n var bucketAgg = _a[_i];\n if (this.templateSrv.variableExists(bucketAgg.field) || this.objectContainsTemplate(bucketAgg.settings)) {\n return true;\n }\n }\n for (var _b = 0, _c = target.metrics; _b < _c.length; _b++) {\n var metric = _c[_b];\n if (this.templateSrv.variableExists(metric.field) ||\n this.objectContainsTemplate(metric.settings) ||\n this.objectContainsTemplate(metric.meta)) {\n return true;\n }\n }\n return false;\n };\n ElasticDatasource.prototype.isPrimitive = function (obj) {\n if (obj === null || obj === undefined) {\n return true;\n }\n if (['string', 'number', 'boolean'].some(function (type) { return type === typeof true; })) {\n return true;\n }\n return false;\n };\n ElasticDatasource.prototype.objectContainsTemplate = function (obj) {\n if (!obj) {\n return false;\n }\n for (var _i = 0, _a = Object.keys(obj); _i < _a.length; _i++) {\n var key = _a[_i];\n if (this.isPrimitive(obj[key])) {\n if (this.templateSrv.variableExists(obj[key])) {\n return true;\n }\n }\n else if (Array.isArray(obj[key])) {\n for (var _b = 0, _c = obj[key]; _b < _c.length; _b++) {\n var item = _c[_b];\n if (this.objectContainsTemplate(item)) {\n return true;\n }\n }\n }\n else {\n if (this.objectContainsTemplate(obj[key])) {\n return true;\n }\n }\n }\n return false;\n };\n return ElasticDatasource;\n}());\n\n\n\n/***/ }),\n\n/***/ 2094:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return ElasticQueryBuilder; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__query_def__ = __webpack_require__(1988);\n\nvar ElasticQueryBuilder = /** @class */ (function () {\n function ElasticQueryBuilder(options) {\n this.timeField = options.timeField;\n this.esVersion = options.esVersion;\n }\n ElasticQueryBuilder.prototype.getRangeFilter = function () {\n var filter = {};\n filter[this.timeField] = {\n gte: '$timeFrom',\n lte: '$timeTo',\n format: 'epoch_millis',\n };\n return filter;\n };\n ElasticQueryBuilder.prototype.buildTermsAgg = function (aggDef, queryNode, target) {\n var metricRef, metric, y;\n queryNode.terms = { field: aggDef.field };\n if (!aggDef.settings) {\n return queryNode;\n }\n queryNode.terms.size = parseInt(aggDef.settings.size, 10) === 0 ? 500 : parseInt(aggDef.settings.size, 10);\n if (aggDef.settings.orderBy !== void 0) {\n queryNode.terms.order = {};\n queryNode.terms.order[aggDef.settings.orderBy] = aggDef.settings.order;\n // if metric ref, look it up and add it to this agg level\n metricRef = parseInt(aggDef.settings.orderBy, 10);\n if (!isNaN(metricRef)) {\n for (y = 0; y < target.metrics.length; y++) {\n metric = target.metrics[y];\n if (metric.id === aggDef.settings.orderBy) {\n queryNode.aggs = {};\n queryNode.aggs[metric.id] = {};\n queryNode.aggs[metric.id][metric.type] = { field: metric.field };\n break;\n }\n }\n }\n }\n if (aggDef.settings.min_doc_count !== void 0) {\n queryNode.terms.min_doc_count = parseInt(aggDef.settings.min_doc_count, 10);\n }\n if (aggDef.settings.missing) {\n queryNode.terms.missing = aggDef.settings.missing;\n }\n return queryNode;\n };\n ElasticQueryBuilder.prototype.getDateHistogramAgg = function (aggDef) {\n var esAgg = {};\n var settings = aggDef.settings || {};\n esAgg.interval = settings.interval;\n esAgg.field = this.timeField;\n esAgg.min_doc_count = settings.min_doc_count || 0;\n esAgg.extended_bounds = { min: '$timeFrom', max: '$timeTo' };\n esAgg.format = 'epoch_millis';\n if (esAgg.interval === 'auto') {\n esAgg.interval = '$__interval';\n }\n if (settings.missing) {\n esAgg.missing = settings.missing;\n }\n return esAgg;\n };\n ElasticQueryBuilder.prototype.getHistogramAgg = function (aggDef) {\n var esAgg = {};\n var settings = aggDef.settings || {};\n esAgg.interval = settings.interval;\n esAgg.field = aggDef.field;\n esAgg.min_doc_count = settings.min_doc_count || 0;\n if (settings.missing) {\n esAgg.missing = settings.missing;\n }\n return esAgg;\n };\n ElasticQueryBuilder.prototype.getFiltersAgg = function (aggDef) {\n var filterObj = {};\n for (var i = 0; i < aggDef.settings.filters.length; i++) {\n var query = aggDef.settings.filters[i].query;\n var label = aggDef.settings.filters[i].label;\n label = label === '' || label === undefined ? query : label;\n filterObj[label] = {\n query_string: {\n query: query,\n analyze_wildcard: true,\n },\n };\n }\n return filterObj;\n };\n ElasticQueryBuilder.prototype.documentQuery = function (query, size) {\n query.size = size;\n query.sort = {};\n query.sort[this.timeField] = { order: 'desc', unmapped_type: 'boolean' };\n // fields field not supported on ES 5.x\n if (this.esVersion < 5) {\n query.fields = ['*', '_source'];\n }\n query.script_fields = {};\n if (this.esVersion < 5) {\n query.fielddata_fields = [this.timeField];\n }\n else {\n query.docvalue_fields = [this.timeField];\n }\n return query;\n };\n ElasticQueryBuilder.prototype.addAdhocFilters = function (query, adhocFilters) {\n if (!adhocFilters) {\n return;\n }\n var i, filter, condition, queryCondition;\n for (i = 0; i < adhocFilters.length; i++) {\n filter = adhocFilters[i];\n condition = {};\n condition[filter.key] = filter.value;\n queryCondition = {};\n queryCondition[filter.key] = { query: filter.value };\n switch (filter.operator) {\n case '=':\n if (!query.query.bool.must) {\n query.query.bool.must = [];\n }\n query.query.bool.must.push({ match_phrase: queryCondition });\n break;\n case '!=':\n if (!query.query.bool.must_not) {\n query.query.bool.must_not = [];\n }\n query.query.bool.must_not.push({ match_phrase: queryCondition });\n break;\n case '<':\n condition[filter.key] = { lt: filter.value };\n query.query.bool.filter.push({ range: condition });\n break;\n case '>':\n condition[filter.key] = { gt: filter.value };\n query.query.bool.filter.push({ range: condition });\n break;\n case '=~':\n query.query.bool.filter.push({ regexp: condition });\n break;\n case '!~':\n query.query.bool.filter.push({\n bool: { must_not: { regexp: condition } },\n });\n break;\n }\n }\n };\n ElasticQueryBuilder.prototype.build = function (target, adhocFilters, queryString) {\n // make sure query has defaults;\n target.metrics = target.metrics || [{ type: 'count', id: '1' }];\n target.bucketAggs = target.bucketAggs || [{ type: 'date_histogram', id: '2', settings: { interval: 'auto' } }];\n target.timeField = this.timeField;\n var i, nestedAggs, metric;\n var query = {\n size: 0,\n query: {\n bool: {\n filter: [\n { range: this.getRangeFilter() },\n {\n query_string: {\n analyze_wildcard: true,\n query: queryString,\n },\n },\n ],\n },\n },\n };\n this.addAdhocFilters(query, adhocFilters);\n // handle document query\n if (target.bucketAggs.length === 0) {\n metric = target.metrics[0];\n if (!metric || metric.type !== 'raw_document') {\n throw { message: 'Invalid query' };\n }\n var size = (metric.settings && metric.settings.size) || 500;\n return this.documentQuery(query, size);\n }\n nestedAggs = query;\n for (i = 0; i < target.bucketAggs.length; i++) {\n var aggDef = target.bucketAggs[i];\n var esAgg = {};\n switch (aggDef.type) {\n case 'date_histogram': {\n esAgg['date_histogram'] = this.getDateHistogramAgg(aggDef);\n break;\n }\n case 'histogram': {\n esAgg['histogram'] = this.getHistogramAgg(aggDef);\n break;\n }\n case 'filters': {\n esAgg['filters'] = { filters: this.getFiltersAgg(aggDef) };\n break;\n }\n case 'terms': {\n this.buildTermsAgg(aggDef, esAgg, target);\n break;\n }\n case 'geohash_grid': {\n esAgg['geohash_grid'] = {\n field: aggDef.field,\n precision: aggDef.settings.precision,\n };\n break;\n }\n }\n nestedAggs.aggs = nestedAggs.aggs || {};\n nestedAggs.aggs[aggDef.id] = esAgg;\n nestedAggs = esAgg;\n }\n nestedAggs.aggs = {};\n for (i = 0; i < target.metrics.length; i++) {\n metric = target.metrics[i];\n if (metric.type === 'count') {\n continue;\n }\n var aggField = {};\n var metricAgg = null;\n if (__WEBPACK_IMPORTED_MODULE_0__query_def__[\"l\" /* isPipelineAgg */](metric.type)) {\n if (metric.pipelineAgg && /^\\d*$/.test(metric.pipelineAgg)) {\n metricAgg = { buckets_path: metric.pipelineAgg };\n }\n else {\n continue;\n }\n }\n else {\n metricAgg = { field: metric.field };\n }\n for (var prop in metric.settings) {\n if (metric.settings.hasOwnProperty(prop) && metric.settings[prop] !== null) {\n metricAgg[prop] = metric.settings[prop];\n }\n }\n aggField[metric.type] = metricAgg;\n nestedAggs.aggs[metric.id] = aggField;\n }\n return query;\n };\n ElasticQueryBuilder.prototype.getTermsQuery = function (queryDef) {\n var query = {\n size: 0,\n query: {\n bool: {\n filter: [{ range: this.getRangeFilter() }],\n },\n },\n };\n if (queryDef.query) {\n query.query.bool.filter.push({\n query_string: {\n analyze_wildcard: true,\n query: queryDef.query,\n },\n });\n }\n var size = 500;\n if (queryDef.size) {\n size = queryDef.size;\n }\n query.aggs = {\n '1': {\n terms: {\n field: queryDef.field,\n size: size,\n order: {\n _term: 'asc',\n },\n },\n },\n };\n return query;\n };\n return ElasticQueryBuilder;\n}());\n\n\n\n/***/ }),\n\n/***/ 2095:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return IndexPattern; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_moment__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_moment__);\n\nvar intervalMap = {\n Hourly: { startOf: 'hour', amount: 'hours' },\n Daily: { startOf: 'day', amount: 'days' },\n Weekly: { startOf: 'isoWeek', amount: 'weeks' },\n Monthly: { startOf: 'month', amount: 'months' },\n Yearly: { startOf: 'year', amount: 'years' },\n};\nvar IndexPattern = /** @class */ (function () {\n function IndexPattern(pattern, interval) {\n this.pattern = pattern;\n this.interval = interval;\n }\n IndexPattern.prototype.getIndexForToday = function () {\n if (this.interval) {\n return __WEBPACK_IMPORTED_MODULE_0_moment___default.a.utc().format(this.pattern);\n }\n else {\n return this.pattern;\n }\n };\n IndexPattern.prototype.getIndexList = function (from, to) {\n if (!this.interval) {\n return this.pattern;\n }\n var intervalInfo = intervalMap[this.interval];\n var start = __WEBPACK_IMPORTED_MODULE_0_moment___default()(from)\n .utc()\n .startOf(intervalInfo.startOf);\n var endEpoch = __WEBPACK_IMPORTED_MODULE_0_moment___default()(to)\n .utc()\n .startOf(intervalInfo.startOf)\n .valueOf();\n var indexList = [];\n while (start.valueOf() <= endEpoch) {\n indexList.push(start.format(this.pattern));\n start.add(1, intervalInfo.amount);\n }\n return indexList;\n };\n return IndexPattern;\n}());\n\n\n\n/***/ }),\n\n/***/ 2096:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return ElasticResponse; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__query_def__ = __webpack_require__(1988);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_table_model__ = __webpack_require__(1987);\n\n\n\nvar ElasticResponse = /** @class */ (function () {\n function ElasticResponse(targets, response) {\n this.targets = targets;\n this.response = response;\n this.targets = targets;\n this.response = response;\n }\n ElasticResponse.prototype.processMetrics = function (esAgg, target, seriesList, props) {\n var metric, y, i, newSeries, bucket, value;\n for (y = 0; y < target.metrics.length; y++) {\n metric = target.metrics[y];\n if (metric.hide) {\n continue;\n }\n switch (metric.type) {\n case 'count': {\n newSeries = { datapoints: [], metric: 'count', props: props };\n for (i = 0; i < esAgg.buckets.length; i++) {\n bucket = esAgg.buckets[i];\n value = bucket.doc_count;\n newSeries.datapoints.push([value, bucket.key]);\n }\n seriesList.push(newSeries);\n break;\n }\n case 'percentiles': {\n if (esAgg.buckets.length === 0) {\n break;\n }\n var firstBucket = esAgg.buckets[0];\n var percentiles = firstBucket[metric.id].values;\n for (var percentileName in percentiles) {\n newSeries = {\n datapoints: [],\n metric: 'p' + percentileName,\n props: props,\n field: metric.field,\n };\n for (i = 0; i < esAgg.buckets.length; i++) {\n bucket = esAgg.buckets[i];\n var values = bucket[metric.id].values;\n newSeries.datapoints.push([values[percentileName], bucket.key]);\n }\n seriesList.push(newSeries);\n }\n break;\n }\n case 'extended_stats': {\n for (var statName in metric.meta) {\n if (!metric.meta[statName]) {\n continue;\n }\n newSeries = {\n datapoints: [],\n metric: statName,\n props: props,\n field: metric.field,\n };\n for (i = 0; i < esAgg.buckets.length; i++) {\n bucket = esAgg.buckets[i];\n var stats = bucket[metric.id];\n // add stats that are in nested obj to top level obj\n stats.std_deviation_bounds_upper = stats.std_deviation_bounds.upper;\n stats.std_deviation_bounds_lower = stats.std_deviation_bounds.lower;\n newSeries.datapoints.push([stats[statName], bucket.key]);\n }\n seriesList.push(newSeries);\n }\n break;\n }\n default: {\n newSeries = {\n datapoints: [],\n metric: metric.type,\n field: metric.field,\n props: props,\n };\n for (i = 0; i < esAgg.buckets.length; i++) {\n bucket = esAgg.buckets[i];\n value = bucket[metric.id];\n if (value !== undefined) {\n if (value.normalized_value) {\n newSeries.datapoints.push([value.normalized_value, bucket.key]);\n }\n else {\n newSeries.datapoints.push([value.value, bucket.key]);\n }\n }\n }\n seriesList.push(newSeries);\n break;\n }\n }\n }\n };\n ElasticResponse.prototype.processAggregationDocs = function (esAgg, aggDef, target, table, props) {\n // add columns\n if (table.columns.length === 0) {\n for (var _i = 0, _a = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.keys(props); _i < _a.length; _i++) {\n var propKey = _a[_i];\n table.addColumn({ text: propKey, filterable: true });\n }\n table.addColumn({ text: aggDef.field, filterable: true });\n }\n // helper func to add values to value array\n var addMetricValue = function (values, metricName, value) {\n table.addColumn({ text: metricName });\n values.push(value);\n };\n for (var _b = 0, _c = esAgg.buckets; _b < _c.length; _b++) {\n var bucket = _c[_b];\n var values = [];\n for (var _d = 0, _e = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.values(props); _d < _e.length; _d++) {\n var propValues = _e[_d];\n values.push(propValues);\n }\n // add bucket key (value)\n values.push(bucket.key);\n for (var _f = 0, _g = target.metrics; _f < _g.length; _f++) {\n var metric = _g[_f];\n switch (metric.type) {\n case 'count': {\n addMetricValue(values, this.getMetricName(metric.type), bucket.doc_count);\n break;\n }\n case 'extended_stats': {\n for (var statName in metric.meta) {\n if (!metric.meta[statName]) {\n continue;\n }\n var stats = bucket[metric.id];\n // add stats that are in nested obj to top level obj\n stats.std_deviation_bounds_upper = stats.std_deviation_bounds.upper;\n stats.std_deviation_bounds_lower = stats.std_deviation_bounds.lower;\n addMetricValue(values, this.getMetricName(statName), stats[statName]);\n }\n break;\n }\n default: {\n var metricName = this.getMetricName(metric.type);\n var otherMetrics = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.filter(target.metrics, { type: metric.type });\n // if more of the same metric type include field field name in property\n if (otherMetrics.length > 1) {\n metricName += ' ' + metric.field;\n }\n addMetricValue(values, metricName, bucket[metric.id].value);\n break;\n }\n }\n }\n table.rows.push(values);\n }\n };\n // This is quite complex\n // need to recurise down the nested buckets to build series\n ElasticResponse.prototype.processBuckets = function (aggs, target, seriesList, table, props, depth) {\n var bucket, aggDef, esAgg, aggId;\n var maxDepth = target.bucketAggs.length - 1;\n for (aggId in aggs) {\n aggDef = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(target.bucketAggs, { id: aggId });\n esAgg = aggs[aggId];\n if (!aggDef) {\n continue;\n }\n if (depth === maxDepth) {\n if (aggDef.type === 'date_histogram') {\n this.processMetrics(esAgg, target, seriesList, props);\n }\n else {\n this.processAggregationDocs(esAgg, aggDef, target, table, props);\n }\n }\n else {\n for (var nameIndex in esAgg.buckets) {\n bucket = esAgg.buckets[nameIndex];\n props = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.clone(props);\n if (bucket.key !== void 0) {\n props[aggDef.field] = bucket.key;\n }\n else {\n props['filter'] = nameIndex;\n }\n if (bucket.key_as_string) {\n props[aggDef.field] = bucket.key_as_string;\n }\n this.processBuckets(bucket, target, seriesList, table, props, depth + 1);\n }\n }\n }\n };\n ElasticResponse.prototype.getMetricName = function (metric) {\n var metricDef = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(__WEBPACK_IMPORTED_MODULE_1__query_def__[\"m\" /* metricAggTypes */], { value: metric });\n if (!metricDef) {\n metricDef = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(__WEBPACK_IMPORTED_MODULE_1__query_def__[\"e\" /* extendedStats */], { value: metric });\n }\n return metricDef ? metricDef.text : metric;\n };\n ElasticResponse.prototype.getSeriesName = function (series, target, metricTypeCount) {\n var metricName = this.getMetricName(series.metric);\n if (target.alias) {\n var regex = /\\{\\{([\\s\\S]+?)\\}\\}/g;\n return target.alias.replace(regex, function (match, g1, g2) {\n var group = g1 || g2;\n if (group.indexOf('term ') === 0) {\n return series.props[group.substring(5)];\n }\n if (series.props[group] !== void 0) {\n return series.props[group];\n }\n if (group === 'metric') {\n return metricName;\n }\n if (group === 'field') {\n return series.field;\n }\n return match;\n });\n }\n if (series.field && __WEBPACK_IMPORTED_MODULE_1__query_def__[\"l\" /* isPipelineAgg */](series.metric)) {\n var appliedAgg = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(target.metrics, { id: series.field });\n if (appliedAgg) {\n metricName += ' ' + __WEBPACK_IMPORTED_MODULE_1__query_def__[\"b\" /* describeMetric */](appliedAgg);\n }\n else {\n metricName = 'Unset';\n }\n }\n else if (series.field) {\n metricName += ' ' + series.field;\n }\n var propKeys = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.keys(series.props);\n if (propKeys.length === 0) {\n return metricName;\n }\n var name = '';\n for (var propName in series.props) {\n name += series.props[propName] + ' ';\n }\n if (metricTypeCount === 1) {\n return name.trim();\n }\n return name.trim() + ' ' + metricName;\n };\n ElasticResponse.prototype.nameSeries = function (seriesList, target) {\n var metricTypeCount = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.uniq(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(seriesList, 'metric')).length;\n for (var i = 0; i < seriesList.length; i++) {\n var series = seriesList[i];\n series.target = this.getSeriesName(series, target, metricTypeCount);\n }\n };\n ElasticResponse.prototype.processHits = function (hits, seriesList) {\n var series = {\n target: 'docs',\n type: 'docs',\n datapoints: [],\n total: hits.total,\n filterable: true,\n };\n var propName, hit, doc, i;\n for (i = 0; i < hits.hits.length; i++) {\n hit = hits.hits[i];\n doc = {\n _id: hit._id,\n _type: hit._type,\n _index: hit._index,\n };\n if (hit._source) {\n for (propName in hit._source) {\n doc[propName] = hit._source[propName];\n }\n }\n for (propName in hit.fields) {\n doc[propName] = hit.fields[propName];\n }\n series.datapoints.push(doc);\n }\n seriesList.push(series);\n };\n ElasticResponse.prototype.trimDatapoints = function (aggregations, target) {\n var histogram = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(target.bucketAggs, { type: 'date_histogram' });\n var shouldDropFirstAndLast = histogram && histogram.settings && histogram.settings.trimEdges;\n if (shouldDropFirstAndLast) {\n var trim = histogram.settings.trimEdges;\n for (var prop in aggregations) {\n var points = aggregations[prop];\n if (points.datapoints.length > trim * 2) {\n points.datapoints = points.datapoints.slice(trim, points.datapoints.length - trim);\n }\n }\n }\n };\n ElasticResponse.prototype.getErrorFromElasticResponse = function (response, err) {\n var result = {};\n result.data = JSON.stringify(err, null, 4);\n if (err.root_cause && err.root_cause.length > 0 && err.root_cause[0].reason) {\n result.message = err.root_cause[0].reason;\n }\n else {\n result.message = err.reason || 'Unkown elastic error response';\n }\n if (response.$$config) {\n result.config = response.$$config;\n }\n return result;\n };\n ElasticResponse.prototype.getTimeSeries = function () {\n var seriesList = [];\n for (var i = 0; i < this.response.responses.length; i++) {\n var response = this.response.responses[i];\n if (response.error) {\n throw this.getErrorFromElasticResponse(this.response, response.error);\n }\n if (response.hits && response.hits.hits.length > 0) {\n this.processHits(response.hits, seriesList);\n }\n if (response.aggregations) {\n var aggregations = response.aggregations;\n var target = this.targets[i];\n var tmpSeriesList = [];\n var table = new __WEBPACK_IMPORTED_MODULE_2_app_core_table_model__[\"a\" /* default */]();\n this.processBuckets(aggregations, target, tmpSeriesList, table, {}, 0);\n this.trimDatapoints(tmpSeriesList, target);\n this.nameSeries(tmpSeriesList, target);\n for (var y = 0; y < tmpSeriesList.length; y++) {\n seriesList.push(tmpSeriesList[y]);\n }\n if (table.rows.length > 0) {\n seriesList.push(table);\n }\n }\n }\n return { data: seriesList };\n };\n return ElasticResponse;\n}());\n\n\n\n/***/ }),\n\n/***/ 2097:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return ElasticQueryCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__bucket_agg__ = __webpack_require__(2098);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__metric_agg__ = __webpack_require__(2099);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__query_def__ = __webpack_require__(1988);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_app_plugins_sdk__ = __webpack_require__(1983);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n\n\n\nvar ElasticQueryCtrl = /** @class */ (function (_super) {\n __extends(ElasticQueryCtrl, _super);\n /** @ngInject **/\n ElasticQueryCtrl.$inject = [\"$scope\", \"$injector\", \"$rootScope\", \"uiSegmentSrv\"];\n function ElasticQueryCtrl($scope, $injector, $rootScope, uiSegmentSrv) {\n var _this = _super.call(this, $scope, $injector) || this;\n _this.$rootScope = $rootScope;\n _this.uiSegmentSrv = uiSegmentSrv;\n _this.esVersion = _this.datasource.esVersion;\n _this.queryUpdated();\n return _this;\n }\n ElasticQueryCtrl.prototype.getFields = function (type) {\n var jsonStr = __WEBPACK_IMPORTED_MODULE_2_angular___default.a.toJson({ find: 'fields', type: type });\n return this.datasource\n .metricFindQuery(jsonStr)\n .then(this.uiSegmentSrv.transformToSegments(false))\n .catch(this.handleQueryError.bind(this));\n };\n ElasticQueryCtrl.prototype.queryUpdated = function () {\n var newJson = __WEBPACK_IMPORTED_MODULE_2_angular___default.a.toJson(this.datasource.queryBuilder.build(this.target), true);\n if (this.rawQueryOld && newJson !== this.rawQueryOld) {\n this.refresh();\n }\n this.rawQueryOld = newJson;\n this.$rootScope.appEvent('elastic-query-updated');\n };\n ElasticQueryCtrl.prototype.getCollapsedText = function () {\n var metricAggs = this.target.metrics;\n var bucketAggs = this.target.bucketAggs;\n var metricAggTypes = __WEBPACK_IMPORTED_MODULE_4__query_def__[\"f\" /* getMetricAggTypes */](this.esVersion);\n var bucketAggTypes = __WEBPACK_IMPORTED_MODULE_4__query_def__[\"a\" /* bucketAggTypes */];\n var text = '';\n if (this.target.query) {\n text += 'Query: ' + this.target.query + ', ';\n }\n text += 'Metrics: ';\n __WEBPACK_IMPORTED_MODULE_3_lodash___default.a.each(metricAggs, function (metric, index) {\n var aggDef = __WEBPACK_IMPORTED_MODULE_3_lodash___default.a.find(metricAggTypes, { value: metric.type });\n text += aggDef.text + '(';\n if (aggDef.requiresField) {\n text += metric.field;\n }\n text += '), ';\n });\n __WEBPACK_IMPORTED_MODULE_3_lodash___default.a.each(bucketAggs, function (bucketAgg, index) {\n if (index === 0) {\n text += ' Group by: ';\n }\n var aggDef = __WEBPACK_IMPORTED_MODULE_3_lodash___default.a.find(bucketAggTypes, { value: bucketAgg.type });\n text += aggDef.text + '(';\n if (aggDef.requiresField) {\n text += bucketAgg.field;\n }\n text += '), ';\n });\n if (this.target.alias) {\n text += 'Alias: ' + this.target.alias;\n }\n return text;\n };\n ElasticQueryCtrl.prototype.handleQueryError = function (err) {\n this.error = err.message || 'Failed to issue metric query';\n return [];\n };\n ElasticQueryCtrl.templateUrl = 'partials/query.editor.html';\n return ElasticQueryCtrl;\n}(__WEBPACK_IMPORTED_MODULE_5_app_plugins_sdk__[\"QueryCtrl\"]));\n\n\n\n/***/ }),\n\n/***/ 2098:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export elasticBucketAgg */\n/* unused harmony export ElasticBucketAggCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__query_def__ = __webpack_require__(1988);\n\n\n\nfunction elasticBucketAgg() {\n return {\n templateUrl: 'public/app/plugins/datasource/elasticsearch/partials/bucket_agg.html',\n controller: 'ElasticBucketAggCtrl',\n restrict: 'E',\n scope: {\n target: '=',\n index: '=',\n onChange: '&',\n getFields: '&',\n },\n };\n}\nvar ElasticBucketAggCtrl = /** @class */ (function () {\n /** @nginject */\n ElasticBucketAggCtrl.$inject = [\"$scope\", \"uiSegmentSrv\", \"$q\", \"$rootScope\"];\n function ElasticBucketAggCtrl($scope, uiSegmentSrv, $q, $rootScope) {\n var bucketAggs = $scope.target.bucketAggs;\n $scope.orderByOptions = [];\n $scope.getBucketAggTypes = function () {\n return __WEBPACK_IMPORTED_MODULE_2__query_def__[\"a\" /* bucketAggTypes */];\n };\n $scope.getOrderOptions = function () {\n return __WEBPACK_IMPORTED_MODULE_2__query_def__[\"o\" /* orderOptions */];\n };\n $scope.getSizeOptions = function () {\n return __WEBPACK_IMPORTED_MODULE_2__query_def__[\"p\" /* sizeOptions */];\n };\n $rootScope.onAppEvent('elastic-query-updated', function () {\n $scope.validateModel();\n }, $scope);\n $scope.init = function () {\n $scope.agg = bucketAggs[$scope.index];\n $scope.validateModel();\n };\n $scope.onChangeInternal = function () {\n $scope.onChange();\n };\n $scope.onTypeChanged = function () {\n $scope.agg.settings = {};\n $scope.showOptions = false;\n switch ($scope.agg.type) {\n case 'date_histogram':\n case 'histogram':\n case 'terms': {\n delete $scope.agg.query;\n $scope.agg.field = 'select field';\n break;\n }\n case 'filters': {\n delete $scope.agg.field;\n $scope.agg.query = '*';\n break;\n }\n case 'geohash_grid': {\n $scope.agg.settings.precision = 3;\n break;\n }\n }\n $scope.validateModel();\n $scope.onChange();\n };\n $scope.validateModel = function () {\n $scope.index = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.indexOf(bucketAggs, $scope.agg);\n $scope.isFirst = $scope.index === 0;\n $scope.bucketAggCount = bucketAggs.length;\n var settingsLinkText = '';\n var settings = $scope.agg.settings || {};\n switch ($scope.agg.type) {\n case 'terms': {\n settings.order = settings.order || 'desc';\n settings.size = settings.size || '10';\n settings.min_doc_count = settings.min_doc_count || 1;\n settings.orderBy = settings.orderBy || '_term';\n if (settings.size !== '0') {\n settingsLinkText = __WEBPACK_IMPORTED_MODULE_2__query_def__[\"c\" /* describeOrder */](settings.order) + ' ' + settings.size + ', ';\n }\n if (settings.min_doc_count > 0) {\n settingsLinkText += 'Min Doc Count: ' + settings.min_doc_count + ', ';\n }\n settingsLinkText += 'Order by: ' + __WEBPACK_IMPORTED_MODULE_2__query_def__[\"d\" /* describeOrderBy */](settings.orderBy, $scope.target);\n if (settings.size === '0') {\n settingsLinkText += ' (' + settings.order + ')';\n }\n break;\n }\n case 'filters': {\n settings.filters = settings.filters || [{ query: '*' }];\n settingsLinkText = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.reduce(settings.filters, function (memo, value, index) {\n memo += 'Q' + (index + 1) + ' = ' + value.query + ' ';\n return memo;\n }, '');\n if (settingsLinkText.length > 50) {\n settingsLinkText = settingsLinkText.substr(0, 50) + '...';\n }\n settingsLinkText = 'Filter Queries (' + settings.filters.length + ')';\n break;\n }\n case 'date_histogram': {\n settings.interval = settings.interval || 'auto';\n settings.min_doc_count = settings.min_doc_count || 0;\n $scope.agg.field = $scope.target.timeField;\n settingsLinkText = 'Interval: ' + settings.interval;\n if (settings.min_doc_count > 0) {\n settingsLinkText += ', Min Doc Count: ' + settings.min_doc_count;\n }\n if (settings.trimEdges === undefined || settings.trimEdges < 0) {\n settings.trimEdges = 0;\n }\n if (settings.trimEdges && settings.trimEdges > 0) {\n settingsLinkText += ', Trim edges: ' + settings.trimEdges;\n }\n break;\n }\n case 'histogram': {\n settings.interval = settings.interval || 1000;\n settings.min_doc_count = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.defaultTo(settings.min_doc_count, 1);\n settingsLinkText = 'Interval: ' + settings.interval;\n if (settings.min_doc_count > 0) {\n settingsLinkText += ', Min Doc Count: ' + settings.min_doc_count;\n }\n break;\n }\n case 'geohash_grid': {\n // limit precision to 7\n settings.precision = Math.max(Math.min(settings.precision, 7), 1);\n settingsLinkText = 'Precision: ' + settings.precision;\n break;\n }\n }\n $scope.settingsLinkText = settingsLinkText;\n $scope.agg.settings = settings;\n return true;\n };\n $scope.addFiltersQuery = function () {\n $scope.agg.settings.filters.push({ query: '*' });\n };\n $scope.removeFiltersQuery = function (filter) {\n $scope.agg.settings.filters = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.without($scope.agg.settings.filters, filter);\n };\n $scope.toggleOptions = function () {\n $scope.showOptions = !$scope.showOptions;\n };\n $scope.getOrderByOptions = function () {\n return __WEBPACK_IMPORTED_MODULE_2__query_def__[\"h\" /* getOrderByOptions */]($scope.target);\n };\n $scope.getFieldsInternal = function () {\n if ($scope.agg.type === 'date_histogram') {\n return $scope.getFields({ $fieldType: 'date' });\n }\n else {\n return $scope.getFields();\n }\n };\n $scope.getIntervalOptions = function () {\n return $q.when(uiSegmentSrv.transformToSegments(true, 'interval')(__WEBPACK_IMPORTED_MODULE_2__query_def__[\"k\" /* intervalOptions */]));\n };\n $scope.addBucketAgg = function () {\n // if last is date histogram add it before\n var lastBucket = bucketAggs[bucketAggs.length - 1];\n var addIndex = bucketAggs.length - 1;\n if (lastBucket && lastBucket.type === 'date_histogram') {\n addIndex -= 1;\n }\n var id = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.reduce($scope.target.bucketAggs.concat($scope.target.metrics), function (max, val) {\n return parseInt(val.id) > max ? parseInt(val.id) : max;\n }, 0);\n bucketAggs.splice(addIndex, 0, { type: 'terms', field: 'select field', id: (id + 1).toString(), fake: true });\n $scope.onChange();\n };\n $scope.removeBucketAgg = function () {\n bucketAggs.splice($scope.index, 1);\n $scope.onChange();\n };\n $scope.init();\n }\n return ElasticBucketAggCtrl;\n}());\n\nvar module = __WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.directives');\nmodule.directive('elasticBucketAgg', elasticBucketAgg);\nmodule.controller('ElasticBucketAggCtrl', ElasticBucketAggCtrl);\n\n\n/***/ }),\n\n/***/ 2099:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export elasticMetricAgg */\n/* unused harmony export ElasticMetricAggCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__query_def__ = __webpack_require__(1988);\n\n\n\nfunction elasticMetricAgg() {\n return {\n templateUrl: 'public/app/plugins/datasource/elasticsearch/partials/metric_agg.html',\n controller: 'ElasticMetricAggCtrl',\n restrict: 'E',\n scope: {\n target: '=',\n index: '=',\n onChange: '&',\n getFields: '&',\n esVersion: '=',\n },\n };\n}\nvar ElasticMetricAggCtrl = /** @class */ (function () {\n ElasticMetricAggCtrl.$inject = [\"$scope\", \"uiSegmentSrv\", \"$q\", \"$rootScope\"];\n function ElasticMetricAggCtrl($scope, uiSegmentSrv, $q, $rootScope) {\n var metricAggs = $scope.target.metrics;\n $scope.metricAggTypes = __WEBPACK_IMPORTED_MODULE_2__query_def__[\"f\" /* getMetricAggTypes */]($scope.esVersion);\n $scope.extendedStats = __WEBPACK_IMPORTED_MODULE_2__query_def__[\"e\" /* extendedStats */];\n $scope.pipelineAggOptions = [];\n $scope.modelSettingsValues = {};\n $scope.init = function () {\n $scope.agg = metricAggs[$scope.index];\n $scope.validateModel();\n $scope.updatePipelineAggOptions();\n };\n $scope.updatePipelineAggOptions = function () {\n $scope.pipelineAggOptions = __WEBPACK_IMPORTED_MODULE_2__query_def__[\"i\" /* getPipelineAggOptions */]($scope.target);\n };\n $rootScope.onAppEvent('elastic-query-updated', function () {\n $scope.index = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.indexOf(metricAggs, $scope.agg);\n $scope.updatePipelineAggOptions();\n $scope.validateModel();\n }, $scope);\n $scope.validateModel = function () {\n $scope.isFirst = $scope.index === 0;\n $scope.isSingle = metricAggs.length === 1;\n $scope.settingsLinkText = '';\n $scope.aggDef = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find($scope.metricAggTypes, { value: $scope.agg.type });\n if (__WEBPACK_IMPORTED_MODULE_2__query_def__[\"l\" /* isPipelineAgg */]($scope.agg.type)) {\n $scope.agg.pipelineAgg = $scope.agg.pipelineAgg || 'select metric';\n $scope.agg.field = $scope.agg.pipelineAgg;\n var pipelineOptions = __WEBPACK_IMPORTED_MODULE_2__query_def__[\"j\" /* getPipelineOptions */]($scope.agg);\n if (pipelineOptions.length > 0) {\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(pipelineOptions, function (opt) {\n $scope.agg.settings[opt.text] = $scope.agg.settings[opt.text] || opt.default;\n });\n $scope.settingsLinkText = 'Options';\n }\n }\n else if (!$scope.agg.field) {\n $scope.agg.field = 'select field';\n }\n switch ($scope.agg.type) {\n case 'cardinality': {\n var precision_threshold = $scope.agg.settings.precision_threshold || '';\n $scope.settingsLinkText = 'Precision threshold: ' + precision_threshold;\n break;\n }\n case 'percentiles': {\n $scope.agg.settings.percents = $scope.agg.settings.percents || [25, 50, 75, 95, 99];\n $scope.settingsLinkText = 'Values: ' + $scope.agg.settings.percents.join(',');\n break;\n }\n case 'extended_stats': {\n if (__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.keys($scope.agg.meta).length === 0) {\n $scope.agg.meta.std_deviation_bounds_lower = true;\n $scope.agg.meta.std_deviation_bounds_upper = true;\n }\n var stats = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.reduce($scope.agg.meta, function (memo, val, key) {\n if (val) {\n var def = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find($scope.extendedStats, { value: key });\n memo.push(def.text);\n }\n return memo;\n }, []);\n $scope.settingsLinkText = 'Stats: ' + stats.join(', ');\n break;\n }\n case 'moving_avg': {\n $scope.movingAvgModelTypes = __WEBPACK_IMPORTED_MODULE_2__query_def__[\"n\" /* movingAvgModelOptions */];\n $scope.modelSettings = __WEBPACK_IMPORTED_MODULE_2__query_def__[\"g\" /* getMovingAvgSettings */]($scope.agg.settings.model, true);\n $scope.updateMovingAvgModelSettings();\n break;\n }\n case 'raw_document': {\n $scope.agg.settings.size = $scope.agg.settings.size || 500;\n $scope.settingsLinkText = 'Size: ' + $scope.agg.settings.size;\n $scope.target.metrics.splice(0, $scope.target.metrics.length, $scope.agg);\n $scope.target.bucketAggs = [];\n break;\n }\n }\n if ($scope.aggDef.supportsInlineScript) {\n // I know this stores the inline script twice\n // but having it like this simplifes the query_builder\n var inlineScript = $scope.agg.inlineScript;\n if (inlineScript) {\n $scope.agg.settings.script = { inline: inlineScript };\n }\n else {\n delete $scope.agg.settings.script;\n }\n if ($scope.settingsLinkText === '') {\n $scope.settingsLinkText = 'Options';\n }\n }\n };\n $scope.toggleOptions = function () {\n $scope.showOptions = !$scope.showOptions;\n $scope.updatePipelineAggOptions();\n };\n $scope.onChangeInternal = function () {\n $scope.onChange();\n };\n $scope.updateMovingAvgModelSettings = function () {\n var modelSettingsKeys = [];\n var modelSettings = __WEBPACK_IMPORTED_MODULE_2__query_def__[\"g\" /* getMovingAvgSettings */]($scope.agg.settings.model, false);\n for (var i = 0; i < modelSettings.length; i++) {\n modelSettingsKeys.push(modelSettings[i].value);\n }\n for (var key in $scope.agg.settings.settings) {\n if ($scope.agg.settings.settings[key] === null || modelSettingsKeys.indexOf(key) === -1) {\n delete $scope.agg.settings.settings[key];\n }\n }\n };\n $scope.onChangeClearInternal = function () {\n delete $scope.agg.settings.minimize;\n $scope.onChange();\n };\n $scope.onTypeChange = function () {\n $scope.agg.settings = {};\n $scope.agg.meta = {};\n $scope.showOptions = false;\n $scope.updatePipelineAggOptions();\n $scope.onChange();\n };\n $scope.getFieldsInternal = function () {\n if ($scope.agg.type === 'cardinality') {\n return $scope.getFields();\n }\n return $scope.getFields({ $fieldType: 'number' });\n };\n $scope.addMetricAgg = function () {\n var addIndex = metricAggs.length;\n var id = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.reduce($scope.target.bucketAggs.concat($scope.target.metrics), function (max, val) {\n return parseInt(val.id) > max ? parseInt(val.id) : max;\n }, 0);\n metricAggs.splice(addIndex, 0, { type: 'count', field: 'select field', id: (id + 1).toString() });\n $scope.onChange();\n };\n $scope.removeMetricAgg = function () {\n metricAggs.splice($scope.index, 1);\n $scope.onChange();\n };\n $scope.toggleShowMetric = function () {\n $scope.agg.hide = !$scope.agg.hide;\n if (!$scope.agg.hide) {\n delete $scope.agg.hide;\n }\n $scope.onChange();\n };\n $scope.init();\n }\n return ElasticMetricAggCtrl;\n}());\n\nvar module = __WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.directives');\nmodule.directive('elasticMetricAgg', elasticMetricAgg);\nmodule.controller('ElasticMetricAggCtrl', ElasticMetricAggCtrl);\n\n\n/***/ }),\n\n/***/ 2100:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return ElasticConfigCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n\nvar ElasticConfigCtrl = /** @class */ (function () {\n /** @ngInject */\n ElasticConfigCtrl.$inject = [\"$scope\"];\n function ElasticConfigCtrl($scope) {\n this.indexPatternTypes = [\n { name: 'No pattern', value: undefined },\n { name: 'Hourly', value: 'Hourly', example: '[logstash-]YYYY.MM.DD.HH' },\n { name: 'Daily', value: 'Daily', example: '[logstash-]YYYY.MM.DD' },\n { name: 'Weekly', value: 'Weekly', example: '[logstash-]GGGG.WW' },\n { name: 'Monthly', value: 'Monthly', example: '[logstash-]YYYY.MM' },\n { name: 'Yearly', value: 'Yearly', example: '[logstash-]YYYY' },\n ];\n this.esVersions = [{ name: '2.x', value: 2 }, { name: '5.x', value: 5 }, { name: '5.6+', value: 56 }];\n this.current.jsonData.timeField = this.current.jsonData.timeField || '@timestamp';\n this.current.jsonData.esVersion = this.current.jsonData.esVersion || 5;\n this.current.jsonData.maxConcurrentShardRequests = this.current.jsonData.maxConcurrentShardRequests || 256;\n }\n ElasticConfigCtrl.prototype.indexPatternTypeChanged = function () {\n var def = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(this.indexPatternTypes, {\n value: this.current.jsonData.interval,\n });\n this.current.database = def.example || 'es-index-name';\n };\n ElasticConfigCtrl.templateUrl = 'public/app/plugins/datasource/elasticsearch/partials/config.html';\n return ElasticConfigCtrl;\n}());\n\n\n\n/***/ }),\n\n/***/ 2101:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnnotationsQueryCtrl\", function() { return AnnotationsQueryCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__datasource__ = __webpack_require__(2102);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__query_ctrl__ = __webpack_require__(2103);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_ctrl__ = __webpack_require__(2104);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"Datasource\", function() { return __WEBPACK_IMPORTED_MODULE_0__datasource__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"QueryCtrl\", function() { return __WEBPACK_IMPORTED_MODULE_1__query_ctrl__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"ConfigCtrl\", function() { return __WEBPACK_IMPORTED_MODULE_2__config_ctrl__[\"a\"]; });\n\n\n\nvar AnnotationsQueryCtrl = /** @class */ (function () {\n function AnnotationsQueryCtrl() {\n }\n AnnotationsQueryCtrl.templateUrl = 'partials/annotations.editor.html';\n return AnnotationsQueryCtrl;\n}());\n\n\n\n/***/ }),\n\n/***/ 2102:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_utils_datemath__ = __webpack_require__(691);\n\n\n\nvar OpenTsDatasource = /** @class */ (function () {\n /** @ngInject */\n OpenTsDatasource.$inject = [\"instanceSettings\", \"$q\", \"backendSrv\", \"templateSrv\"];\n function OpenTsDatasource(instanceSettings, $q, backendSrv, templateSrv) {\n this.$q = $q;\n this.backendSrv = backendSrv;\n this.templateSrv = templateSrv;\n this.type = 'opentsdb';\n this.url = instanceSettings.url;\n this.name = instanceSettings.name;\n this.withCredentials = instanceSettings.withCredentials;\n this.basicAuth = instanceSettings.basicAuth;\n instanceSettings.jsonData = instanceSettings.jsonData || {};\n this.tsdbVersion = instanceSettings.jsonData.tsdbVersion || 1;\n this.tsdbResolution = instanceSettings.jsonData.tsdbResolution || 1;\n this.supportMetrics = true;\n this.tagKeys = {};\n this.aggregatorsPromise = null;\n this.filterTypesPromise = null;\n }\n // Called once per panel (graph)\n OpenTsDatasource.prototype.query = function (options) {\n var start = this.convertToTSDBTime(options.rangeRaw.from, false);\n var end = this.convertToTSDBTime(options.rangeRaw.to, true);\n var qs = [];\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(options.targets, function (target) {\n if (!target.metric) {\n return;\n }\n qs.push(this.convertTargetToQuery(target, options, this.tsdbVersion));\n }.bind(this));\n var queries = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.compact(qs);\n // No valid targets, return the empty result to save a round trip.\n if (__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isEmpty(queries)) {\n var d = this.$q.defer();\n d.resolve({ data: [] });\n return d.promise;\n }\n var groupByTags = {};\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(queries, function (query) {\n if (query.filters && query.filters.length > 0) {\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(query.filters, function (val) {\n groupByTags[val.tagk] = true;\n });\n }\n else {\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(query.tags, function (val, key) {\n groupByTags[key] = true;\n });\n }\n });\n options.targets = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.filter(options.targets, function (query) {\n return query.hide !== true;\n });\n return this.performTimeSeriesQuery(queries, start, end).then(function (response) {\n var metricToTargetMapping = this.mapMetricsToTargets(response.data, options, this.tsdbVersion);\n var result = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(response.data, function (metricData, index) {\n index = metricToTargetMapping[index];\n if (index === -1) {\n index = 0;\n }\n this._saveTagKeys(metricData);\n return this.transformMetricData(metricData, groupByTags, options.targets[index], options, this.tsdbResolution);\n }.bind(this));\n return { data: result };\n }.bind(this));\n };\n OpenTsDatasource.prototype.annotationQuery = function (options) {\n var start = this.convertToTSDBTime(options.rangeRaw.from, false);\n var end = this.convertToTSDBTime(options.rangeRaw.to, true);\n var qs = [];\n var eventList = [];\n qs.push({ aggregator: 'sum', metric: options.annotation.target });\n var queries = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.compact(qs);\n return this.performTimeSeriesQuery(queries, start, end).then(function (results) {\n if (results.data[0]) {\n var annotationObject = results.data[0].annotations;\n if (options.annotation.isGlobal) {\n annotationObject = results.data[0].globalAnnotations;\n }\n if (annotationObject) {\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(annotationObject, function (annotation) {\n var event = {\n text: annotation.description,\n time: Math.floor(annotation.startTime) * 1000,\n annotation: options.annotation,\n };\n eventList.push(event);\n });\n }\n }\n return eventList;\n }.bind(this));\n };\n OpenTsDatasource.prototype.targetContainsTemplate = function (target) {\n if (target.filters && target.filters.length > 0) {\n for (var i = 0; i < target.filters.length; i++) {\n if (this.templateSrv.variableExists(target.filters[i].filter)) {\n return true;\n }\n }\n }\n if (target.tags && Object.keys(target.tags).length > 0) {\n for (var tagKey in target.tags) {\n if (this.templateSrv.variableExists(target.tags[tagKey])) {\n return true;\n }\n }\n }\n return false;\n };\n OpenTsDatasource.prototype.performTimeSeriesQuery = function (queries, start, end) {\n var msResolution = false;\n if (this.tsdbResolution === 2) {\n msResolution = true;\n }\n var reqBody = {\n start: start,\n queries: queries,\n msResolution: msResolution,\n globalAnnotations: true,\n };\n if (this.tsdbVersion === 3) {\n reqBody.showQuery = true;\n }\n // Relative queries (e.g. last hour) don't include an end time\n if (end) {\n reqBody.end = end;\n }\n var options = {\n method: 'POST',\n url: this.url + '/api/query',\n data: reqBody,\n };\n this._addCredentialOptions(options);\n return this.backendSrv.datasourceRequest(options);\n };\n OpenTsDatasource.prototype.suggestTagKeys = function (metric) {\n return this.$q.when(this.tagKeys[metric] || []);\n };\n OpenTsDatasource.prototype._saveTagKeys = function (metricData) {\n var tagKeys = Object.keys(metricData.tags);\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(metricData.aggregateTags, function (tag) {\n tagKeys.push(tag);\n });\n this.tagKeys[metricData.metric] = tagKeys;\n };\n OpenTsDatasource.prototype._performSuggestQuery = function (query, type) {\n return this._get('/api/suggest', { type: type, q: query, max: 1000 }).then(function (result) {\n return result.data;\n });\n };\n OpenTsDatasource.prototype._performMetricKeyValueLookup = function (metric, keys) {\n if (!metric || !keys) {\n return this.$q.when([]);\n }\n var keysArray = keys.split(',').map(function (key) {\n return key.trim();\n });\n var key = keysArray[0];\n var keysQuery = key + '=*';\n if (keysArray.length > 1) {\n keysQuery += ',' + keysArray.splice(1).join(',');\n }\n var m = metric + '{' + keysQuery + '}';\n return this._get('/api/search/lookup', { m: m, limit: 3000 }).then(function (result) {\n result = result.data.results;\n var tagvs = [];\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(result, function (r) {\n if (tagvs.indexOf(r.tags[key]) === -1) {\n tagvs.push(r.tags[key]);\n }\n });\n return tagvs;\n });\n };\n OpenTsDatasource.prototype._performMetricKeyLookup = function (metric) {\n if (!metric) {\n return this.$q.when([]);\n }\n return this._get('/api/search/lookup', { m: metric, limit: 1000 }).then(function (result) {\n result = result.data.results;\n var tagks = [];\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(result, function (r) {\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(r.tags, function (tagv, tagk) {\n if (tagks.indexOf(tagk) === -1) {\n tagks.push(tagk);\n }\n });\n });\n return tagks;\n });\n };\n OpenTsDatasource.prototype._get = function (relativeUrl, params) {\n var options = {\n method: 'GET',\n url: this.url + relativeUrl,\n params: params,\n };\n this._addCredentialOptions(options);\n return this.backendSrv.datasourceRequest(options);\n };\n OpenTsDatasource.prototype._addCredentialOptions = function (options) {\n if (this.basicAuth || this.withCredentials) {\n options.withCredentials = true;\n }\n if (this.basicAuth) {\n options.headers = { Authorization: this.basicAuth };\n }\n };\n OpenTsDatasource.prototype.metricFindQuery = function (query) {\n if (!query) {\n return this.$q.when([]);\n }\n var interpolated;\n try {\n interpolated = this.templateSrv.replace(query, {}, 'distributed');\n }\n catch (err) {\n return this.$q.reject(err);\n }\n var responseTransform = function (result) {\n return __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(result, function (value) {\n return { text: value };\n });\n };\n var metrics_regex = /metrics\\((.*)\\)/;\n var tag_names_regex = /tag_names\\((.*)\\)/;\n var tag_values_regex = /tag_values\\((.*?),\\s?(.*)\\)/;\n var tag_names_suggest_regex = /suggest_tagk\\((.*)\\)/;\n var tag_values_suggest_regex = /suggest_tagv\\((.*)\\)/;\n var metrics_query = interpolated.match(metrics_regex);\n if (metrics_query) {\n return this._performSuggestQuery(metrics_query[1], 'metrics').then(responseTransform);\n }\n var tag_names_query = interpolated.match(tag_names_regex);\n if (tag_names_query) {\n return this._performMetricKeyLookup(tag_names_query[1]).then(responseTransform);\n }\n var tag_values_query = interpolated.match(tag_values_regex);\n if (tag_values_query) {\n return this._performMetricKeyValueLookup(tag_values_query[1], tag_values_query[2]).then(responseTransform);\n }\n var tag_names_suggest_query = interpolated.match(tag_names_suggest_regex);\n if (tag_names_suggest_query) {\n return this._performSuggestQuery(tag_names_suggest_query[1], 'tagk').then(responseTransform);\n }\n var tag_values_suggest_query = interpolated.match(tag_values_suggest_regex);\n if (tag_values_suggest_query) {\n return this._performSuggestQuery(tag_values_suggest_query[1], 'tagv').then(responseTransform);\n }\n return this.$q.when([]);\n };\n OpenTsDatasource.prototype.testDatasource = function () {\n return this._performSuggestQuery('cpu', 'metrics').then(function () {\n return { status: 'success', message: 'Data source is working' };\n });\n };\n OpenTsDatasource.prototype.getAggregators = function () {\n if (this.aggregatorsPromise) {\n return this.aggregatorsPromise;\n }\n this.aggregatorsPromise = this._get('/api/aggregators').then(function (result) {\n if (result.data && __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isArray(result.data)) {\n return result.data.sort();\n }\n return [];\n });\n return this.aggregatorsPromise;\n };\n OpenTsDatasource.prototype.getFilterTypes = function () {\n if (this.filterTypesPromise) {\n return this.filterTypesPromise;\n }\n this.filterTypesPromise = this._get('/api/config/filters').then(function (result) {\n if (result.data) {\n return Object.keys(result.data).sort();\n }\n return [];\n });\n return this.filterTypesPromise;\n };\n OpenTsDatasource.prototype.transformMetricData = function (md, groupByTags, target, options, tsdbResolution) {\n var metricLabel = this.createMetricLabel(md, target, groupByTags, options);\n var dps = [];\n // TSDB returns datapoints has a hash of ts => value.\n // Can't use _.pairs(invert()) because it stringifies keys/values\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(md.dps, function (v, k) {\n if (tsdbResolution === 2) {\n dps.push([v, k * 1]);\n }\n else {\n dps.push([v, k * 1000]);\n }\n });\n return { target: metricLabel, datapoints: dps };\n };\n OpenTsDatasource.prototype.createMetricLabel = function (md, target, groupByTags, options) {\n if (target.alias) {\n var scopedVars = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.clone(options.scopedVars || {});\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(md.tags, function (value, key) {\n scopedVars['tag_' + key] = { value: value };\n });\n return this.templateSrv.replace(target.alias, scopedVars);\n }\n var label = md.metric;\n var tagData = [];\n if (!__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isEmpty(md.tags)) {\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.toPairs(md.tags), function (tag) {\n if (__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.has(groupByTags, tag[0])) {\n tagData.push(tag[0] + '=' + tag[1]);\n }\n });\n }\n if (!__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isEmpty(tagData)) {\n label += '{' + tagData.join(', ') + '}';\n }\n return label;\n };\n OpenTsDatasource.prototype.convertTargetToQuery = function (target, options, tsdbVersion) {\n if (!target.metric || target.hide) {\n return null;\n }\n var query = {\n metric: this.templateSrv.replace(target.metric, options.scopedVars, 'pipe'),\n aggregator: 'avg',\n };\n if (target.aggregator) {\n query.aggregator = this.templateSrv.replace(target.aggregator);\n }\n if (target.shouldComputeRate) {\n query.rate = true;\n query.rateOptions = {\n counter: !!target.isCounter,\n };\n if (target.counterMax && target.counterMax.length) {\n query.rateOptions.counterMax = parseInt(target.counterMax);\n }\n if (target.counterResetValue && target.counterResetValue.length) {\n query.rateOptions.resetValue = parseInt(target.counterResetValue);\n }\n if (tsdbVersion >= 2) {\n query.rateOptions.dropResets =\n !query.rateOptions.counterMax && (!query.rateOptions.ResetValue || query.rateOptions.ResetValue === 0);\n }\n }\n if (!target.disableDownsampling) {\n var interval = this.templateSrv.replace(target.downsampleInterval || options.interval);\n if (interval.match(/\\.[0-9]+s/)) {\n interval = parseFloat(interval) * 1000 + 'ms';\n }\n query.downsample = interval + '-' + target.downsampleAggregator;\n if (target.downsampleFillPolicy && target.downsampleFillPolicy !== 'none') {\n query.downsample += '-' + target.downsampleFillPolicy;\n }\n }\n if (target.filters && target.filters.length > 0) {\n query.filters = __WEBPACK_IMPORTED_MODULE_0_angular___default.a.copy(target.filters);\n if (query.filters) {\n for (var filter_key in query.filters) {\n query.filters[filter_key].filter = this.templateSrv.replace(query.filters[filter_key].filter, options.scopedVars, 'pipe');\n }\n }\n }\n else {\n query.tags = __WEBPACK_IMPORTED_MODULE_0_angular___default.a.copy(target.tags);\n if (query.tags) {\n for (var tag_key in query.tags) {\n query.tags[tag_key] = this.templateSrv.replace(query.tags[tag_key], options.scopedVars, 'pipe');\n }\n }\n }\n if (target.explicitTags) {\n query.explicitTags = true;\n }\n return query;\n };\n OpenTsDatasource.prototype.mapMetricsToTargets = function (metrics, options, tsdbVersion) {\n var interpolatedTagValue, arrTagV;\n return __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(metrics, function (metricData) {\n if (tsdbVersion === 3) {\n return metricData.query.index;\n }\n else {\n return __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.findIndex(options.targets, function (target) {\n if (target.filters && target.filters.length > 0) {\n return target.metric === metricData.metric;\n }\n else {\n return (target.metric === metricData.metric &&\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.every(target.tags, function (tagV, tagK) {\n interpolatedTagValue = this.templateSrv.replace(tagV, options.scopedVars, 'pipe');\n arrTagV = interpolatedTagValue.split('|');\n return __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.includes(arrTagV, metricData.tags[tagK]) || interpolatedTagValue === '*';\n }));\n }\n });\n }\n });\n };\n OpenTsDatasource.prototype.convertToTSDBTime = function (date, roundUp) {\n if (date === 'now') {\n return null;\n }\n date = __WEBPACK_IMPORTED_MODULE_2_app_core_utils_datemath__[\"parse\"](date, roundUp);\n return date.valueOf();\n };\n return OpenTsDatasource;\n}());\n/* harmony default export */ __webpack_exports__[\"a\"] = (OpenTsDatasource);\n\n\n/***/ }),\n\n/***/ 2103:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return OpenTsQueryCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_utils_kbn__ = __webpack_require__(312);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_plugins_sdk__ = __webpack_require__(1983);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\nvar OpenTsQueryCtrl = /** @class */ (function (_super) {\n __extends(OpenTsQueryCtrl, _super);\n /** @ngInject **/\n OpenTsQueryCtrl.$inject = [\"$scope\", \"$injector\"];\n function OpenTsQueryCtrl($scope, $injector) {\n var _this = _super.call(this, $scope, $injector) || this;\n _this.errors = _this.validateTarget();\n _this.aggregators = ['avg', 'sum', 'min', 'max', 'dev', 'zimsum', 'mimmin', 'mimmax'];\n _this.fillPolicies = ['none', 'nan', 'null', 'zero'];\n _this.filterTypes = [\n 'wildcard',\n 'iliteral_or',\n 'not_iliteral_or',\n 'not_literal_or',\n 'iwildcard',\n 'literal_or',\n 'regexp',\n ];\n _this.tsdbVersion = _this.datasource.tsdbVersion;\n if (!_this.target.aggregator) {\n _this.target.aggregator = 'sum';\n }\n if (!_this.target.downsampleAggregator) {\n _this.target.downsampleAggregator = 'avg';\n }\n if (!_this.target.downsampleFillPolicy) {\n _this.target.downsampleFillPolicy = 'none';\n }\n _this.datasource.getAggregators().then(function (aggs) {\n if (aggs.length !== 0) {\n _this.aggregators = aggs;\n }\n });\n _this.datasource.getFilterTypes().then(function (filterTypes) {\n if (filterTypes.length !== 0) {\n _this.filterTypes = filterTypes;\n }\n });\n // needs to be defined here as it is called from typeahead\n _this.suggestMetrics = function (query, callback) {\n _this.datasource\n .metricFindQuery('metrics(' + query + ')')\n .then(_this.getTextValues)\n .then(callback);\n };\n _this.suggestTagKeys = function (query, callback) {\n _this.datasource.suggestTagKeys(_this.target.metric).then(callback);\n };\n _this.suggestTagValues = function (query, callback) {\n _this.datasource\n .metricFindQuery('suggest_tagv(' + query + ')')\n .then(_this.getTextValues)\n .then(callback);\n };\n return _this;\n }\n OpenTsQueryCtrl.prototype.targetBlur = function () {\n this.errors = this.validateTarget();\n this.refresh();\n };\n OpenTsQueryCtrl.prototype.getTextValues = function (metricFindResult) {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(metricFindResult, function (value) {\n return value.text;\n });\n };\n OpenTsQueryCtrl.prototype.addTag = function () {\n if (this.target.filters && this.target.filters.length > 0) {\n this.errors.tags = 'Please remove filters to use tags, tags and filters are mutually exclusive.';\n }\n if (!this.addTagMode) {\n this.addTagMode = true;\n return;\n }\n if (!this.target.tags) {\n this.target.tags = {};\n }\n this.errors = this.validateTarget();\n if (!this.errors.tags) {\n this.target.tags[this.target.currentTagKey] = this.target.currentTagValue;\n this.target.currentTagKey = '';\n this.target.currentTagValue = '';\n this.targetBlur();\n }\n this.addTagMode = false;\n };\n OpenTsQueryCtrl.prototype.removeTag = function (key) {\n delete this.target.tags[key];\n this.targetBlur();\n };\n OpenTsQueryCtrl.prototype.editTag = function (key, value) {\n this.removeTag(key);\n this.target.currentTagKey = key;\n this.target.currentTagValue = value;\n this.addTag();\n };\n OpenTsQueryCtrl.prototype.closeAddTagMode = function () {\n this.addTagMode = false;\n return;\n };\n OpenTsQueryCtrl.prototype.addFilter = function () {\n if (this.target.tags && __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.size(this.target.tags) > 0) {\n this.errors.filters = 'Please remove tags to use filters, tags and filters are mutually exclusive.';\n }\n if (!this.addFilterMode) {\n this.addFilterMode = true;\n return;\n }\n if (!this.target.filters) {\n this.target.filters = [];\n }\n if (!this.target.currentFilterType) {\n this.target.currentFilterType = 'iliteral_or';\n }\n if (!this.target.currentFilterGroupBy) {\n this.target.currentFilterGroupBy = false;\n }\n this.errors = this.validateTarget();\n if (!this.errors.filters) {\n var currentFilter = {\n type: this.target.currentFilterType,\n tagk: this.target.currentFilterKey,\n filter: this.target.currentFilterValue,\n groupBy: this.target.currentFilterGroupBy,\n };\n this.target.filters.push(currentFilter);\n this.target.currentFilterType = 'literal_or';\n this.target.currentFilterKey = '';\n this.target.currentFilterValue = '';\n this.target.currentFilterGroupBy = false;\n this.targetBlur();\n }\n this.addFilterMode = false;\n };\n OpenTsQueryCtrl.prototype.removeFilter = function (index) {\n this.target.filters.splice(index, 1);\n this.targetBlur();\n };\n OpenTsQueryCtrl.prototype.editFilter = function (fil, index) {\n this.removeFilter(index);\n this.target.currentFilterKey = fil.tagk;\n this.target.currentFilterValue = fil.filter;\n this.target.currentFilterType = fil.type;\n this.target.currentFilterGroupBy = fil.groupBy;\n this.addFilter();\n };\n OpenTsQueryCtrl.prototype.closeAddFilterMode = function () {\n this.addFilterMode = false;\n return;\n };\n OpenTsQueryCtrl.prototype.validateTarget = function () {\n var errs = {};\n if (this.target.shouldDownsample) {\n try {\n if (this.target.downsampleInterval) {\n __WEBPACK_IMPORTED_MODULE_1_app_core_utils_kbn__[\"a\" /* default */].describe_interval(this.target.downsampleInterval);\n }\n else {\n errs.downsampleInterval = \"You must supply a downsample interval (e.g. '1m' or '1h').\";\n }\n }\n catch (err) {\n errs.downsampleInterval = err.message;\n }\n }\n if (this.target.tags && __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.has(this.target.tags, this.target.currentTagKey)) {\n errs.tags = \"Duplicate tag key '\" + this.target.currentTagKey + \"'.\";\n }\n return errs;\n };\n OpenTsQueryCtrl.templateUrl = 'partials/query.editor.html';\n return OpenTsQueryCtrl;\n}(__WEBPACK_IMPORTED_MODULE_2_app_plugins_sdk__[\"QueryCtrl\"]));\n\n\n\n/***/ }),\n\n/***/ 2104:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return OpenTsConfigCtrl; });\nvar OpenTsConfigCtrl = /** @class */ (function () {\n /** @ngInject */\n OpenTsConfigCtrl.$inject = [\"$scope\"];\n function OpenTsConfigCtrl($scope) {\n this.tsdbVersions = [{ name: '<=2.1', value: 1 }, { name: '==2.2', value: 2 }, { name: '==2.3', value: 3 }];\n this.tsdbResolutions = [{ name: 'second', value: 1 }, { name: 'millisecond', value: 2 }];\n this.current.jsonData = this.current.jsonData || {};\n this.current.jsonData.tsdbVersion = this.current.jsonData.tsdbVersion || 1;\n this.current.jsonData.tsdbResolution = this.current.jsonData.tsdbResolution || 1;\n }\n OpenTsConfigCtrl.templateUrl = 'public/app/plugins/datasource/opentsdb/partials/config.html';\n return OpenTsConfigCtrl;\n}());\n\n\n\n/***/ }),\n\n/***/ 2105:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"QueryCtrl\", function() { return GrafanaQueryCtrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnnotationsQueryCtrl\", function() { return GrafanaAnnotationsQueryCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__datasource__ = __webpack_require__(2106);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_plugins_sdk__ = __webpack_require__(1983);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"GrafanaDatasource\", function() { return __WEBPACK_IMPORTED_MODULE_0__datasource__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"Datasource\", function() { return __WEBPACK_IMPORTED_MODULE_0__datasource__[\"a\"]; });\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\nvar GrafanaQueryCtrl = /** @class */ (function (_super) {\n __extends(GrafanaQueryCtrl, _super);\n function GrafanaQueryCtrl() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n GrafanaQueryCtrl.templateUrl = 'partials/query.editor.html';\n return GrafanaQueryCtrl;\n}(__WEBPACK_IMPORTED_MODULE_1_app_plugins_sdk__[\"QueryCtrl\"]));\nvar GrafanaAnnotationsQueryCtrl = /** @class */ (function () {\n function GrafanaAnnotationsQueryCtrl() {\n this.types = [{ text: 'Dashboard', value: 'dashboard' }, { text: 'Tags', value: 'tags' }];\n this.annotation.type = this.annotation.type || 'tags';\n this.annotation.limit = this.annotation.limit || 100;\n }\n GrafanaAnnotationsQueryCtrl.templateUrl = 'partials/annotations.editor.html';\n return GrafanaAnnotationsQueryCtrl;\n}());\n\n\n\n/***/ }),\n\n/***/ 2106:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return GrafanaDatasource; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n\nvar GrafanaDatasource = /** @class */ (function () {\n /** @ngInject */\n GrafanaDatasource.$inject = [\"backendSrv\", \"$q\"];\n function GrafanaDatasource(backendSrv, $q) {\n this.backendSrv = backendSrv;\n this.$q = $q;\n }\n GrafanaDatasource.prototype.query = function (options) {\n return this.backendSrv\n .get('/api/tsdb/testdata/random-walk', {\n from: options.range.from.valueOf(),\n to: options.range.to.valueOf(),\n intervalMs: options.intervalMs,\n maxDataPoints: options.maxDataPoints,\n })\n .then(function (res) {\n var data = [];\n if (res.results) {\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.forEach(res.results, function (queryRes) {\n for (var _i = 0, _a = queryRes.series; _i < _a.length; _i++) {\n var series = _a[_i];\n data.push({\n target: series.name,\n datapoints: series.points,\n });\n }\n });\n }\n return { data: data };\n });\n };\n GrafanaDatasource.prototype.metricFindQuery = function (options) {\n return this.$q.when({ data: [] });\n };\n GrafanaDatasource.prototype.annotationQuery = function (options) {\n var params = {\n from: options.range.from.valueOf(),\n to: options.range.to.valueOf(),\n limit: options.annotation.limit,\n tags: options.annotation.tags,\n };\n if (options.annotation.type === 'dashboard') {\n // if no dashboard id yet return\n if (!options.dashboard.id) {\n return this.$q.when([]);\n }\n // filter by dashboard id\n params.dashboardId = options.dashboard.id;\n // remove tags filter if any\n delete params.tags;\n }\n else {\n // require at least one tag\n if (!__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isArray(options.annotation.tags) || options.annotation.tags.length === 0) {\n return this.$q.when([]);\n }\n }\n return this.backendSrv.get('/api/annotations', params);\n };\n return GrafanaDatasource;\n}());\n\n\n\n/***/ }),\n\n/***/ 2107:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ConfigCtrl\", function() { return InfluxConfigCtrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnnotationsQueryCtrl\", function() { return InfluxAnnotationsQueryCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__datasource__ = __webpack_require__(2108);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__query_ctrl__ = __webpack_require__(2111);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"Datasource\", function() { return __WEBPACK_IMPORTED_MODULE_0__datasource__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"QueryCtrl\", function() { return __WEBPACK_IMPORTED_MODULE_1__query_ctrl__[\"a\"]; });\n\n\nvar InfluxConfigCtrl = /** @class */ (function () {\n function InfluxConfigCtrl() {\n }\n InfluxConfigCtrl.templateUrl = 'partials/config.html';\n return InfluxConfigCtrl;\n}());\nvar InfluxAnnotationsQueryCtrl = /** @class */ (function () {\n function InfluxAnnotationsQueryCtrl() {\n }\n InfluxAnnotationsQueryCtrl.templateUrl = 'partials/annotations.editor.html';\n return InfluxAnnotationsQueryCtrl;\n}());\n\n\n\n/***/ }),\n\n/***/ 2108:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_utils_datemath__ = __webpack_require__(691);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__influx_series__ = __webpack_require__(2109);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__influx_query__ = __webpack_require__(2003);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__response_parser__ = __webpack_require__(2110);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__query_builder__ = __webpack_require__(2005);\n\n\n\n\n\n\nvar InfluxDatasource = /** @class */ (function () {\n /** @ngInject */\n InfluxDatasource.$inject = [\"instanceSettings\", \"$q\", \"backendSrv\", \"templateSrv\"];\n function InfluxDatasource(instanceSettings, $q, backendSrv, templateSrv) {\n this.$q = $q;\n this.backendSrv = backendSrv;\n this.templateSrv = templateSrv;\n this.type = 'influxdb';\n this.urls = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(instanceSettings.url.split(','), function (url) {\n return url.trim();\n });\n this.username = instanceSettings.username;\n this.password = instanceSettings.password;\n this.name = instanceSettings.name;\n this.database = instanceSettings.database;\n this.basicAuth = instanceSettings.basicAuth;\n this.withCredentials = instanceSettings.withCredentials;\n this.interval = (instanceSettings.jsonData || {}).timeInterval;\n this.supportAnnotations = true;\n this.supportMetrics = true;\n this.responseParser = new __WEBPACK_IMPORTED_MODULE_4__response_parser__[\"a\" /* default */]();\n }\n InfluxDatasource.prototype.query = function (options) {\n var _this = this;\n var timeFilter = this.getTimeFilter(options);\n var scopedVars = options.scopedVars;\n var targets = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.cloneDeep(options.targets);\n var queryTargets = [];\n var queryModel;\n var i, y;\n var allQueries = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(targets, function (target) {\n if (target.hide) {\n return '';\n }\n queryTargets.push(target);\n // backward compatibility\n scopedVars.interval = scopedVars.__interval;\n queryModel = new __WEBPACK_IMPORTED_MODULE_3__influx_query__[\"a\" /* default */](target, _this.templateSrv, scopedVars);\n return queryModel.render(true);\n }).reduce(function (acc, current) {\n if (current !== '') {\n acc += ';' + current;\n }\n return acc;\n });\n if (allQueries === '') {\n return this.$q.when({ data: [] });\n }\n // add global adhoc filters to timeFilter\n var adhocFilters = this.templateSrv.getAdhocFilters(this.name);\n if (adhocFilters.length > 0) {\n timeFilter += ' AND ' + queryModel.renderAdhocFilters(adhocFilters);\n }\n // replace grafana variables\n scopedVars.timeFilter = { value: timeFilter };\n // replace templated variables\n allQueries = this.templateSrv.replace(allQueries, scopedVars);\n return this._seriesQuery(allQueries, options).then(function (data) {\n if (!data || !data.results) {\n return [];\n }\n var seriesList = [];\n for (i = 0; i < data.results.length; i++) {\n var result = data.results[i];\n if (!result || !result.series) {\n continue;\n }\n var target = queryTargets[i];\n var alias = target.alias;\n if (alias) {\n alias = _this.templateSrv.replace(target.alias, options.scopedVars);\n }\n var influxSeries = new __WEBPACK_IMPORTED_MODULE_2__influx_series__[\"a\" /* default */]({\n series: data.results[i].series,\n alias: alias,\n });\n switch (target.resultFormat) {\n case 'table': {\n seriesList.push(influxSeries.getTable());\n break;\n }\n default: {\n var timeSeries = influxSeries.getTimeSeries();\n for (y = 0; y < timeSeries.length; y++) {\n seriesList.push(timeSeries[y]);\n }\n break;\n }\n }\n }\n return { data: seriesList };\n });\n };\n InfluxDatasource.prototype.annotationQuery = function (options) {\n if (!options.annotation.query) {\n return this.$q.reject({\n message: 'Query missing in annotation definition',\n });\n }\n var timeFilter = this.getTimeFilter({ rangeRaw: options.rangeRaw });\n var query = options.annotation.query.replace('$timeFilter', timeFilter);\n query = this.templateSrv.replace(query, null, 'regex');\n return this._seriesQuery(query, options).then(function (data) {\n if (!data || !data.results || !data.results[0]) {\n throw { message: 'No results in response from InfluxDB' };\n }\n return new __WEBPACK_IMPORTED_MODULE_2__influx_series__[\"a\" /* default */]({\n series: data.results[0].series,\n annotation: options.annotation,\n }).getAnnotations();\n });\n };\n InfluxDatasource.prototype.targetContainsTemplate = function (target) {\n for (var _i = 0, _a = target.groupBy; _i < _a.length; _i++) {\n var group = _a[_i];\n for (var _b = 0, _c = group.params; _b < _c.length; _b++) {\n var param = _c[_b];\n if (this.templateSrv.variableExists(param)) {\n return true;\n }\n }\n }\n for (var i in target.tags) {\n if (this.templateSrv.variableExists(target.tags[i].value)) {\n return true;\n }\n }\n return false;\n };\n InfluxDatasource.prototype.metricFindQuery = function (query, options) {\n var interpolated = this.templateSrv.replace(query, null, 'regex');\n return this._seriesQuery(interpolated, options).then(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.curry(this.responseParser.parse)(query));\n };\n InfluxDatasource.prototype.getTagKeys = function (options) {\n var queryBuilder = new __WEBPACK_IMPORTED_MODULE_5__query_builder__[\"a\" /* InfluxQueryBuilder */]({ measurement: '', tags: [] }, this.database);\n var query = queryBuilder.buildExploreQuery('TAG_KEYS');\n return this.metricFindQuery(query, options);\n };\n InfluxDatasource.prototype.getTagValues = function (options) {\n var queryBuilder = new __WEBPACK_IMPORTED_MODULE_5__query_builder__[\"a\" /* InfluxQueryBuilder */]({ measurement: '', tags: [] }, this.database);\n var query = queryBuilder.buildExploreQuery('TAG_VALUES', options.key);\n return this.metricFindQuery(query, options);\n };\n InfluxDatasource.prototype._seriesQuery = function (query, options) {\n if (!query) {\n return this.$q.when({ results: [] });\n }\n var epoch = 'ms';\n // Match the influx epoch parameter to requested time interval\n var match = query.match(/time\\(\\d+(\\w+)\\)/);\n if (match && ['ns', 'u', 'µ'].indexOf(match[1]) !== -1) {\n epoch = match[1];\n }\n return this._influxRequest('GET', '/query', { q: query, epoch: epoch }, options).then(function (data) {\n // if the epoch was changed to lower res, adjust incoming timestamps back to ms\n var coeff = 1;\n if (epoch === 'u' || epoch === 'µ') {\n coeff = 0.001;\n }\n else if (epoch === 'ns') {\n coeff = 0.000001;\n }\n if (coeff !== 1) {\n for (var i in data.results) {\n for (var _i = 0, _a = data.results[i].series[0].values; _i < _a.length; _i++) {\n var point = _a[_i];\n point[0] = point[0] * coeff;\n }\n }\n }\n return data;\n });\n };\n InfluxDatasource.prototype.serializeParams = function (params) {\n if (!params) {\n return '';\n }\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.reduce(params, function (memo, value, key) {\n if (value === null || value === undefined) {\n return memo;\n }\n memo.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));\n return memo;\n }, []).join('&');\n };\n InfluxDatasource.prototype.testDatasource = function () {\n var queryBuilder = new __WEBPACK_IMPORTED_MODULE_5__query_builder__[\"a\" /* InfluxQueryBuilder */]({ measurement: '', tags: [] }, this.database);\n var query = queryBuilder.buildExploreQuery('RETENTION POLICIES');\n return this._seriesQuery(query)\n .then(function (res) {\n var error = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.get(res, 'results[0].error');\n if (error) {\n return { status: 'error', message: error };\n }\n return { status: 'success', message: 'Data source is working' };\n })\n .catch(function (err) {\n return { status: 'error', message: err.message };\n });\n };\n InfluxDatasource.prototype._influxRequest = function (method, url, data, options) {\n var currentUrl = this.urls.shift();\n this.urls.push(currentUrl);\n var params = {};\n if (this.username) {\n params.u = this.username;\n params.p = this.password;\n }\n if (options && options.database) {\n params.db = options.database;\n }\n else if (this.database) {\n params.db = this.database;\n }\n if (method === 'GET') {\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.extend(params, data);\n data = null;\n }\n var req = {\n method: method,\n url: currentUrl + url,\n params: params,\n data: data,\n precision: 'ms',\n inspect: { type: 'influxdb' },\n paramSerializer: this.serializeParams,\n };\n req.headers = req.headers || {};\n if (this.basicAuth || this.withCredentials) {\n req.withCredentials = true;\n }\n if (this.basicAuth) {\n req.headers.Authorization = this.basicAuth;\n }\n return this.backendSrv.datasourceRequest(req).then(function (result) {\n return result.data;\n }, function (err) {\n if (err.status !== 0 || err.status >= 300) {\n if (err.data && err.data.error) {\n throw {\n message: 'InfluxDB Error: ' + err.data.error,\n data: err.data,\n config: err.config,\n };\n }\n else {\n throw {\n message: 'Network Error: ' + err.statusText + '(' + err.status + ')',\n data: err.data,\n config: err.config,\n };\n }\n }\n });\n };\n InfluxDatasource.prototype.getTimeFilter = function (options) {\n var from = this.getInfluxTime(options.rangeRaw.from, false);\n var until = this.getInfluxTime(options.rangeRaw.to, true);\n var fromIsAbsolute = from[from.length - 1] === 'ms';\n if (until === 'now()' && !fromIsAbsolute) {\n return 'time >= ' + from;\n }\n return 'time >= ' + from + ' and time <= ' + until;\n };\n InfluxDatasource.prototype.getInfluxTime = function (date, roundUp) {\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isString(date)) {\n if (date === 'now') {\n return 'now()';\n }\n var parts = /^now-(\\d+)([d|h|m|s])$/.exec(date);\n if (parts) {\n var amount = parseInt(parts[1]);\n var unit = parts[2];\n return 'now() - ' + amount + unit;\n }\n date = __WEBPACK_IMPORTED_MODULE_1_app_core_utils_datemath__[\"parse\"](date, roundUp);\n }\n return date.valueOf() + 'ms';\n };\n return InfluxDatasource;\n}());\n/* harmony default export */ __webpack_exports__[\"a\"] = (InfluxDatasource);\n\n\n/***/ }),\n\n/***/ 2109:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_table_model__ = __webpack_require__(1987);\n\n\nvar InfluxSeries = /** @class */ (function () {\n function InfluxSeries(options) {\n this.series = options.series;\n this.alias = options.alias;\n this.annotation = options.annotation;\n }\n InfluxSeries.prototype.getTimeSeries = function () {\n var _this = this;\n var output = [];\n var i, j;\n if (this.series.length === 0) {\n return output;\n }\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(this.series, function (series) {\n var columns = series.columns.length;\n var tags = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(series.tags, function (value, key) {\n return key + ': ' + value;\n });\n for (j = 1; j < columns; j++) {\n var seriesName = series.name;\n var columnName = series.columns[j];\n if (columnName !== 'value') {\n seriesName = seriesName + '.' + columnName;\n }\n if (_this.alias) {\n seriesName = _this._getSeriesName(series, j);\n }\n else if (series.tags) {\n seriesName = seriesName + ' {' + tags.join(', ') + '}';\n }\n var datapoints = [];\n if (series.values) {\n for (i = 0; i < series.values.length; i++) {\n datapoints[i] = [series.values[i][j], series.values[i][0]];\n }\n }\n output.push({ target: seriesName, datapoints: datapoints });\n }\n });\n return output;\n };\n InfluxSeries.prototype._getSeriesName = function (series, index) {\n var regex = /\\$(\\w+)|\\[\\[([\\s\\S]+?)\\]\\]/g;\n var segments = series.name.split('.');\n return this.alias.replace(regex, function (match, g1, g2) {\n var group = g1 || g2;\n var segIndex = parseInt(group, 10);\n if (group === 'm' || group === 'measurement') {\n return series.name;\n }\n if (group === 'col') {\n return series.columns[index];\n }\n if (!isNaN(segIndex)) {\n return segments[segIndex];\n }\n if (group.indexOf('tag_') !== 0) {\n return match;\n }\n var tag = group.replace('tag_', '');\n if (!series.tags) {\n return match;\n }\n return series.tags[tag];\n });\n };\n InfluxSeries.prototype.getAnnotations = function () {\n var _this = this;\n var list = [];\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(this.series, function (series) {\n var titleCol = null;\n var timeCol = null;\n var tagsCol = [];\n var textCol = null;\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(series.columns, function (column, index) {\n if (column === 'time') {\n timeCol = index;\n return;\n }\n if (column === 'sequence_number') {\n return;\n }\n if (!titleCol) {\n titleCol = index;\n }\n if (column === _this.annotation.titleColumn) {\n titleCol = index;\n return;\n }\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.includes((_this.annotation.tagsColumn || '').replace(' ', '').split(','), column)) {\n tagsCol.push(index);\n return;\n }\n if (column === _this.annotation.textColumn) {\n textCol = index;\n return;\n }\n });\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(series.values, function (value) {\n var data = {\n annotation: _this.annotation,\n time: +new Date(value[timeCol]),\n title: value[titleCol],\n // Remove empty values, then split in different tags for comma separated values\n tags: __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.flatten(tagsCol\n .filter(function (t) {\n return value[t];\n })\n .map(function (t) {\n return value[t].split(',');\n })),\n text: value[textCol],\n };\n list.push(data);\n });\n });\n return list;\n };\n InfluxSeries.prototype.getTable = function () {\n var table = new __WEBPACK_IMPORTED_MODULE_1_app_core_table_model__[\"a\" /* default */]();\n var i, j;\n if (this.series.length === 0) {\n return table;\n }\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(this.series, function (series, seriesIndex) {\n if (seriesIndex === 0) {\n j = 0;\n // Check that the first column is indeed 'time'\n if (series.columns[0] === 'time') {\n // Push this now before the tags and with the right type\n table.columns.push({ text: 'Time', type: 'time' });\n j++;\n }\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.keys(series.tags), function (key) {\n table.columns.push({ text: key });\n });\n for (; j < series.columns.length; j++) {\n table.columns.push({ text: series.columns[j] });\n }\n }\n if (series.values) {\n for (i = 0; i < series.values.length; i++) {\n var values = series.values[i];\n var reordered = [values[0]];\n if (series.tags) {\n for (var key in series.tags) {\n if (series.tags.hasOwnProperty(key)) {\n reordered.push(series.tags[key]);\n }\n }\n }\n for (j = 1; j < values.length; j++) {\n reordered.push(values[j]);\n }\n table.rows.push(reordered);\n }\n }\n });\n return table;\n };\n return InfluxSeries;\n}());\n/* harmony default export */ __webpack_exports__[\"a\"] = (InfluxSeries);\n\n\n/***/ }),\n\n/***/ 2110:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n\nvar ResponseParser = /** @class */ (function () {\n function ResponseParser() {\n }\n ResponseParser.prototype.parse = function (query, results) {\n if (!results || results.results.length === 0) {\n return [];\n }\n var influxResults = results.results[0];\n if (!influxResults.series) {\n return [];\n }\n var normalizedQuery = query.toLowerCase();\n var isValueFirst = normalizedQuery.indexOf('show field keys') >= 0 || normalizedQuery.indexOf('show retention policies') >= 0;\n var res = {};\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(influxResults.series, function (serie) {\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(serie.values, function (value) {\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isArray(value)) {\n // In general, there are 2 possible shapes for the returned value.\n // The first one is a two-element array,\n // where the first element is somewhat a metadata value:\n // the tag name for SHOW TAG VALUES queries,\n // the time field for SELECT queries, etc.\n // The second shape is an one-element array,\n // that is containing an immediate value.\n // For example, SHOW FIELD KEYS queries return such shape.\n // Note, pre-0.11 versions return\n // the second shape for SHOW TAG VALUES queries\n // (while the newer versions—first).\n if (isValueFirst) {\n addUnique(res, value[0]);\n }\n else if (value[1] !== undefined) {\n addUnique(res, value[1]);\n }\n else {\n addUnique(res, value[0]);\n }\n }\n else {\n addUnique(res, value);\n }\n });\n });\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(res, function (value) {\n return { text: value.toString() };\n });\n };\n return ResponseParser;\n}());\n/* harmony default export */ __webpack_exports__[\"a\"] = (ResponseParser);\nfunction addUnique(arr, value) {\n arr[value] = value;\n}\n\n\n/***/ }),\n\n/***/ 2111:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return InfluxQueryCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__query_builder__ = __webpack_require__(2005);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__influx_query__ = __webpack_require__(2003);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__query_part__ = __webpack_require__(2004);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_app_plugins_sdk__ = __webpack_require__(1983);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n\n\n\nvar InfluxQueryCtrl = /** @class */ (function (_super) {\n __extends(InfluxQueryCtrl, _super);\n /** @ngInject **/\n InfluxQueryCtrl.$inject = [\"$scope\", \"$injector\", \"templateSrv\", \"$q\", \"uiSegmentSrv\"];\n function InfluxQueryCtrl($scope, $injector, templateSrv, $q, uiSegmentSrv) {\n var _this = _super.call(this, $scope, $injector) || this;\n _this.templateSrv = templateSrv;\n _this.$q = $q;\n _this.uiSegmentSrv = uiSegmentSrv;\n _this.target = _this.target;\n _this.queryModel = new __WEBPACK_IMPORTED_MODULE_3__influx_query__[\"a\" /* default */](_this.target, templateSrv, _this.panel.scopedVars);\n _this.queryBuilder = new __WEBPACK_IMPORTED_MODULE_2__query_builder__[\"a\" /* InfluxQueryBuilder */](_this.target, _this.datasource.database);\n _this.groupBySegment = _this.uiSegmentSrv.newPlusButton();\n _this.resultFormats = [{ text: 'Time series', value: 'time_series' }, { text: 'Table', value: 'table' }];\n _this.policySegment = uiSegmentSrv.newSegment(_this.target.policy);\n if (!_this.target.measurement) {\n _this.measurementSegment = uiSegmentSrv.newSelectMeasurement();\n }\n else {\n _this.measurementSegment = uiSegmentSrv.newSegment(_this.target.measurement);\n }\n _this.tagSegments = [];\n for (var _i = 0, _a = _this.target.tags; _i < _a.length; _i++) {\n var tag = _a[_i];\n if (!tag.operator) {\n if (/^\\/.*\\/$/.test(tag.value)) {\n tag.operator = '=~';\n }\n else {\n tag.operator = '=';\n }\n }\n if (tag.condition) {\n _this.tagSegments.push(uiSegmentSrv.newCondition(tag.condition));\n }\n _this.tagSegments.push(uiSegmentSrv.newKey(tag.key));\n _this.tagSegments.push(uiSegmentSrv.newOperator(tag.operator));\n _this.tagSegments.push(uiSegmentSrv.newKeyValue(tag.value));\n }\n _this.fixTagSegments();\n _this.buildSelectMenu();\n _this.removeTagFilterSegment = uiSegmentSrv.newSegment({\n fake: true,\n value: '-- remove tag filter --',\n });\n return _this;\n }\n InfluxQueryCtrl.prototype.removeOrderByTime = function () {\n this.target.orderByTime = 'ASC';\n };\n InfluxQueryCtrl.prototype.buildSelectMenu = function () {\n var categories = __WEBPACK_IMPORTED_MODULE_4__query_part__[\"a\" /* default */].getCategories();\n this.selectMenu = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.reduce(categories, function (memo, cat, key) {\n var menu = {\n text: key,\n submenu: cat.map(function (item) {\n return { text: item.type, value: item.type };\n }),\n };\n memo.push(menu);\n return memo;\n }, []);\n };\n InfluxQueryCtrl.prototype.getGroupByOptions = function () {\n var _this = this;\n var query = this.queryBuilder.buildExploreQuery('TAG_KEYS');\n return this.datasource\n .metricFindQuery(query)\n .then(function (tags) {\n var options = [];\n if (!_this.queryModel.hasFill()) {\n options.push(_this.uiSegmentSrv.newSegment({ value: 'fill(null)' }));\n }\n if (!_this.target.limit) {\n options.push(_this.uiSegmentSrv.newSegment({ value: 'LIMIT' }));\n }\n if (!_this.target.slimit) {\n options.push(_this.uiSegmentSrv.newSegment({ value: 'SLIMIT' }));\n }\n if (_this.target.orderByTime === 'ASC') {\n options.push(_this.uiSegmentSrv.newSegment({ value: 'ORDER BY time DESC' }));\n }\n if (!_this.queryModel.hasGroupByTime()) {\n options.push(_this.uiSegmentSrv.newSegment({ value: 'time($interval)' }));\n }\n for (var _i = 0, tags_1 = tags; _i < tags_1.length; _i++) {\n var tag = tags_1[_i];\n options.push(_this.uiSegmentSrv.newSegment({ value: 'tag(' + tag.text + ')' }));\n }\n return options;\n })\n .catch(this.handleQueryError.bind(this));\n };\n InfluxQueryCtrl.prototype.groupByAction = function () {\n switch (this.groupBySegment.value) {\n case 'LIMIT': {\n this.target.limit = 10;\n break;\n }\n case 'SLIMIT': {\n this.target.slimit = 10;\n break;\n }\n case 'ORDER BY time DESC': {\n this.target.orderByTime = 'DESC';\n break;\n }\n default: {\n this.queryModel.addGroupBy(this.groupBySegment.value);\n }\n }\n var plusButton = this.uiSegmentSrv.newPlusButton();\n this.groupBySegment.value = plusButton.value;\n this.groupBySegment.html = plusButton.html;\n this.panelCtrl.refresh();\n };\n InfluxQueryCtrl.prototype.addSelectPart = function (selectParts, cat, subitem) {\n this.queryModel.addSelectPart(selectParts, subitem.value);\n this.panelCtrl.refresh();\n };\n InfluxQueryCtrl.prototype.handleSelectPartEvent = function (selectParts, part, evt) {\n switch (evt.name) {\n case 'get-param-options': {\n var fieldsQuery = this.queryBuilder.buildExploreQuery('FIELDS');\n return this.datasource\n .metricFindQuery(fieldsQuery)\n .then(this.transformToSegments(true))\n .catch(this.handleQueryError.bind(this));\n }\n case 'part-param-changed': {\n this.panelCtrl.refresh();\n break;\n }\n case 'action': {\n this.queryModel.removeSelectPart(selectParts, part);\n this.panelCtrl.refresh();\n break;\n }\n case 'get-part-actions': {\n return this.$q.when([{ text: 'Remove', value: 'remove-part' }]);\n }\n }\n };\n InfluxQueryCtrl.prototype.handleGroupByPartEvent = function (part, index, evt) {\n switch (evt.name) {\n case 'get-param-options': {\n var tagsQuery = this.queryBuilder.buildExploreQuery('TAG_KEYS');\n return this.datasource\n .metricFindQuery(tagsQuery)\n .then(this.transformToSegments(true))\n .catch(this.handleQueryError.bind(this));\n }\n case 'part-param-changed': {\n this.panelCtrl.refresh();\n break;\n }\n case 'action': {\n this.queryModel.removeGroupByPart(part, index);\n this.panelCtrl.refresh();\n break;\n }\n case 'get-part-actions': {\n return this.$q.when([{ text: 'Remove', value: 'remove-part' }]);\n }\n }\n };\n InfluxQueryCtrl.prototype.fixTagSegments = function () {\n var count = this.tagSegments.length;\n var lastSegment = this.tagSegments[Math.max(count - 1, 0)];\n if (!lastSegment || lastSegment.type !== 'plus-button') {\n this.tagSegments.push(this.uiSegmentSrv.newPlusButton());\n }\n };\n InfluxQueryCtrl.prototype.measurementChanged = function () {\n this.target.measurement = this.measurementSegment.value;\n this.panelCtrl.refresh();\n };\n InfluxQueryCtrl.prototype.getPolicySegments = function () {\n var policiesQuery = this.queryBuilder.buildExploreQuery('RETENTION POLICIES');\n return this.datasource\n .metricFindQuery(policiesQuery)\n .then(this.transformToSegments(false))\n .catch(this.handleQueryError.bind(this));\n };\n InfluxQueryCtrl.prototype.policyChanged = function () {\n this.target.policy = this.policySegment.value;\n this.panelCtrl.refresh();\n };\n InfluxQueryCtrl.prototype.toggleEditorMode = function () {\n try {\n this.target.query = this.queryModel.render(false);\n }\n catch (err) {\n console.log('query render error');\n }\n this.target.rawQuery = !this.target.rawQuery;\n };\n InfluxQueryCtrl.prototype.getMeasurements = function (measurementFilter) {\n var query = this.queryBuilder.buildExploreQuery('MEASUREMENTS', undefined, measurementFilter);\n return this.datasource\n .metricFindQuery(query)\n .then(this.transformToSegments(true))\n .catch(this.handleQueryError.bind(this));\n };\n InfluxQueryCtrl.prototype.handleQueryError = function (err) {\n this.error = err.message || 'Failed to issue metric query';\n return [];\n };\n InfluxQueryCtrl.prototype.transformToSegments = function (addTemplateVars) {\n var _this = this;\n return function (results) {\n var segments = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(results, function (segment) {\n return _this.uiSegmentSrv.newSegment({\n value: segment.text,\n expandable: segment.expandable,\n });\n });\n if (addTemplateVars) {\n for (var _i = 0, _a = _this.templateSrv.variables; _i < _a.length; _i++) {\n var variable = _a[_i];\n segments.unshift(_this.uiSegmentSrv.newSegment({\n type: 'value',\n value: '/^$' + variable.name + '$/',\n expandable: true,\n }));\n }\n }\n return segments;\n };\n };\n InfluxQueryCtrl.prototype.getTagsOrValues = function (segment, index) {\n var _this = this;\n if (segment.type === 'condition') {\n return this.$q.when([this.uiSegmentSrv.newSegment('AND'), this.uiSegmentSrv.newSegment('OR')]);\n }\n if (segment.type === 'operator') {\n var nextValue = this.tagSegments[index + 1].value;\n if (/^\\/.*\\/$/.test(nextValue)) {\n return this.$q.when(this.uiSegmentSrv.newOperators(['=~', '!~']));\n }\n else {\n return this.$q.when(this.uiSegmentSrv.newOperators(['=', '!=', '<>', '<', '>']));\n }\n }\n var query, addTemplateVars;\n if (segment.type === 'key' || segment.type === 'plus-button') {\n query = this.queryBuilder.buildExploreQuery('TAG_KEYS');\n addTemplateVars = false;\n }\n else if (segment.type === 'value') {\n query = this.queryBuilder.buildExploreQuery('TAG_VALUES', this.tagSegments[index - 2].value);\n addTemplateVars = true;\n }\n return this.datasource\n .metricFindQuery(query)\n .then(this.transformToSegments(addTemplateVars))\n .then(function (results) {\n if (segment.type === 'key') {\n results.splice(0, 0, __WEBPACK_IMPORTED_MODULE_0_angular___default.a.copy(_this.removeTagFilterSegment));\n }\n return results;\n })\n .catch(this.handleQueryError.bind(this));\n };\n InfluxQueryCtrl.prototype.getFieldSegments = function () {\n var fieldsQuery = this.queryBuilder.buildExploreQuery('FIELDS');\n return this.datasource\n .metricFindQuery(fieldsQuery)\n .then(this.transformToSegments(false))\n .catch(this.handleQueryError);\n };\n InfluxQueryCtrl.prototype.tagSegmentUpdated = function (segment, index) {\n this.tagSegments[index] = segment;\n // handle remove tag condition\n if (segment.value === this.removeTagFilterSegment.value) {\n this.tagSegments.splice(index, 3);\n if (this.tagSegments.length === 0) {\n this.tagSegments.push(this.uiSegmentSrv.newPlusButton());\n }\n else if (this.tagSegments.length > 2) {\n this.tagSegments.splice(Math.max(index - 1, 0), 1);\n if (this.tagSegments[this.tagSegments.length - 1].type !== 'plus-button') {\n this.tagSegments.push(this.uiSegmentSrv.newPlusButton());\n }\n }\n }\n else {\n if (segment.type === 'plus-button') {\n if (index > 2) {\n this.tagSegments.splice(index, 0, this.uiSegmentSrv.newCondition('AND'));\n }\n this.tagSegments.push(this.uiSegmentSrv.newOperator('='));\n this.tagSegments.push(this.uiSegmentSrv.newFake('select tag value', 'value', 'query-segment-value'));\n segment.type = 'key';\n segment.cssClass = 'query-segment-key';\n }\n if (index + 1 === this.tagSegments.length) {\n this.tagSegments.push(this.uiSegmentSrv.newPlusButton());\n }\n }\n this.rebuildTargetTagConditions();\n };\n InfluxQueryCtrl.prototype.rebuildTargetTagConditions = function () {\n var _this = this;\n var tags = [];\n var tagIndex = 0;\n var tagOperator = '';\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(this.tagSegments, function (segment2, index) {\n if (segment2.type === 'key') {\n if (tags.length === 0) {\n tags.push({});\n }\n tags[tagIndex].key = segment2.value;\n }\n else if (segment2.type === 'value') {\n tagOperator = _this.getTagValueOperator(segment2.value, tags[tagIndex].operator);\n if (tagOperator) {\n _this.tagSegments[index - 1] = _this.uiSegmentSrv.newOperator(tagOperator);\n tags[tagIndex].operator = tagOperator;\n }\n tags[tagIndex].value = segment2.value;\n }\n else if (segment2.type === 'condition') {\n tags.push({ condition: segment2.value });\n tagIndex += 1;\n }\n else if (segment2.type === 'operator') {\n tags[tagIndex].operator = segment2.value;\n }\n });\n this.target.tags = tags;\n this.panelCtrl.refresh();\n };\n InfluxQueryCtrl.prototype.getTagValueOperator = function (tagValue, tagOperator) {\n if (tagOperator !== '=~' && tagOperator !== '!~' && /^\\/.*\\/$/.test(tagValue)) {\n return '=~';\n }\n else if ((tagOperator === '=~' || tagOperator === '!~') && /^(?!\\/.*\\/$)/.test(tagValue)) {\n return '=';\n }\n return null;\n };\n InfluxQueryCtrl.prototype.getCollapsedText = function () {\n return this.queryModel.render(false);\n };\n InfluxQueryCtrl.templateUrl = 'partials/query.editor.html';\n return InfluxQueryCtrl;\n}(__WEBPACK_IMPORTED_MODULE_5_app_plugins_sdk__[\"QueryCtrl\"]));\n\n\n\n/***/ }),\n\n/***/ 2112:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__datasource__ = __webpack_require__(2113);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"MixedDatasource\", function() { return __WEBPACK_IMPORTED_MODULE_0__datasource__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"Datasource\", function() { return __WEBPACK_IMPORTED_MODULE_0__datasource__[\"a\"]; });\n\n\n\n\n/***/ }),\n\n/***/ 2113:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return MixedDatasource; });\n/* unused harmony export Datasource */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n\n\nvar MixedDatasource = /** @class */ (function () {\n /** @ngInject */\n MixedDatasource.$inject = [\"$q\", \"datasourceSrv\"];\n function MixedDatasource($q, datasourceSrv) {\n this.$q = $q;\n this.datasourceSrv = datasourceSrv;\n }\n MixedDatasource.prototype.query = function (options) {\n var _this = this;\n var sets = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.groupBy(options.targets, 'datasource');\n var promises = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(sets, function (targets) {\n var dsName = targets[0].datasource;\n if (dsName === '-- Mixed --') {\n return _this.$q([]);\n }\n return _this.datasourceSrv.get(dsName).then(function (ds) {\n var opt = __WEBPACK_IMPORTED_MODULE_0_angular___default.a.copy(options);\n opt.targets = targets;\n return ds.query(opt);\n });\n });\n return this.$q.all(promises).then(function (results) {\n return { data: __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.flatten(__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(results, 'data')) };\n });\n };\n return MixedDatasource;\n}());\n\n\n\n/***/ }),\n\n/***/ 2114:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ConfigCtrl\", function() { return MysqlConfigCtrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnnotationsQueryCtrl\", function() { return MysqlAnnotationsQueryCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__datasource__ = __webpack_require__(2115);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__query_ctrl__ = __webpack_require__(2117);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"MysqlDatasource\", function() { return __WEBPACK_IMPORTED_MODULE_0__datasource__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"Datasource\", function() { return __WEBPACK_IMPORTED_MODULE_0__datasource__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"QueryCtrl\", function() { return __WEBPACK_IMPORTED_MODULE_1__query_ctrl__[\"a\"]; });\n\n\nvar MysqlConfigCtrl = /** @class */ (function () {\n function MysqlConfigCtrl() {\n }\n MysqlConfigCtrl.templateUrl = 'partials/config.html';\n return MysqlConfigCtrl;\n}());\nvar defaultQuery = \"SELECT\\n UNIX_TIMESTAMP() as time_sec,\\n as text,\\n as tags\\n FROM \\n WHERE $__timeFilter(time_column)\\n ORDER BY ASC\\n LIMIT 100\\n \";\nvar MysqlAnnotationsQueryCtrl = /** @class */ (function () {\n /** @ngInject **/\n function MysqlAnnotationsQueryCtrl() {\n this.annotation.rawQuery = this.annotation.rawQuery || defaultQuery;\n }\n MysqlAnnotationsQueryCtrl.templateUrl = 'partials/annotations.editor.html';\n return MysqlAnnotationsQueryCtrl;\n}());\n\n\n\n/***/ }),\n\n/***/ 2115:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return MysqlDatasource; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__response_parser__ = __webpack_require__(2116);\n\n\nvar MysqlDatasource = /** @class */ (function () {\n /** @ngInject **/\n MysqlDatasource.$inject = [\"instanceSettings\", \"backendSrv\", \"$q\", \"templateSrv\"];\n function MysqlDatasource(instanceSettings, backendSrv, $q, templateSrv) {\n this.backendSrv = backendSrv;\n this.$q = $q;\n this.templateSrv = templateSrv;\n this.name = instanceSettings.name;\n this.id = instanceSettings.id;\n this.responseParser = new __WEBPACK_IMPORTED_MODULE_1__response_parser__[\"a\" /* default */](this.$q);\n }\n MysqlDatasource.prototype.interpolateVariable = function (value, variable) {\n if (typeof value === 'string') {\n if (variable.multi || variable.includeAll) {\n return \"'\" + value + \"'\";\n }\n else {\n return value;\n }\n }\n if (typeof value === 'number') {\n return value;\n }\n var quotedValues = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(value, function (val) {\n if (typeof value === 'number') {\n return value;\n }\n return \"'\" + val + \"'\";\n });\n return quotedValues.join(',');\n };\n MysqlDatasource.prototype.query = function (options) {\n var _this = this;\n var queries = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.filter(options.targets, function (item) {\n return item.hide !== true;\n }).map(function (item) {\n return {\n refId: item.refId,\n intervalMs: options.intervalMs,\n maxDataPoints: options.maxDataPoints,\n datasourceId: _this.id,\n rawSql: _this.templateSrv.replace(item.rawSql, options.scopedVars, _this.interpolateVariable),\n format: item.format,\n };\n });\n if (queries.length === 0) {\n return this.$q.when({ data: [] });\n }\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: {\n from: options.range.from.valueOf().toString(),\n to: options.range.to.valueOf().toString(),\n queries: queries,\n },\n })\n .then(this.responseParser.processQueryResult);\n };\n MysqlDatasource.prototype.annotationQuery = function (options) {\n var _this = this;\n if (!options.annotation.rawQuery) {\n return this.$q.reject({\n message: 'Query missing in annotation definition',\n });\n }\n var query = {\n refId: options.annotation.name,\n datasourceId: this.id,\n rawSql: this.templateSrv.replace(options.annotation.rawQuery, options.scopedVars, this.interpolateVariable),\n format: 'table',\n };\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: {\n from: options.range.from.valueOf().toString(),\n to: options.range.to.valueOf().toString(),\n queries: [query],\n },\n })\n .then(function (data) { return _this.responseParser.transformAnnotationResponse(options, data); });\n };\n MysqlDatasource.prototype.metricFindQuery = function (query, optionalOptions) {\n var _this = this;\n var refId = 'tempvar';\n if (optionalOptions && optionalOptions.variable && optionalOptions.variable.name) {\n refId = optionalOptions.variable.name;\n }\n var interpolatedQuery = {\n refId: refId,\n datasourceId: this.id,\n rawSql: this.templateSrv.replace(query, {}, this.interpolateVariable),\n format: 'table',\n };\n var data = {\n queries: [interpolatedQuery],\n };\n if (optionalOptions && optionalOptions.range && optionalOptions.range.from) {\n data['from'] = optionalOptions.range.from.valueOf().toString();\n }\n if (optionalOptions && optionalOptions.range && optionalOptions.range.to) {\n data['to'] = optionalOptions.range.to.valueOf().toString();\n }\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: data,\n })\n .then(function (data) { return _this.responseParser.parseMetricFindQueryResult(refId, data); });\n };\n MysqlDatasource.prototype.testDatasource = function () {\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: {\n from: '5m',\n to: 'now',\n queries: [\n {\n refId: 'A',\n intervalMs: 1,\n maxDataPoints: 1,\n datasourceId: this.id,\n rawSql: 'SELECT 1',\n format: 'table',\n },\n ],\n },\n })\n .then(function (res) {\n return { status: 'success', message: 'Database Connection OK' };\n })\n .catch(function (err) {\n console.log(err);\n if (err.data && err.data.message) {\n return { status: 'error', message: err.data.message };\n }\n else {\n return { status: 'error', message: err.status };\n }\n });\n };\n return MysqlDatasource;\n}());\n\n\n\n/***/ }),\n\n/***/ 2116:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n\nvar ResponseParser = /** @class */ (function () {\n function ResponseParser($q) {\n this.$q = $q;\n }\n ResponseParser.prototype.processQueryResult = function (res) {\n var data = [];\n if (!res.data.results) {\n return { data: data };\n }\n for (var key in res.data.results) {\n var queryRes = res.data.results[key];\n if (queryRes.series) {\n for (var _i = 0, _a = queryRes.series; _i < _a.length; _i++) {\n var series = _a[_i];\n data.push({\n target: series.name,\n datapoints: series.points,\n refId: queryRes.refId,\n meta: queryRes.meta,\n });\n }\n }\n if (queryRes.tables) {\n for (var _b = 0, _c = queryRes.tables; _b < _c.length; _b++) {\n var table = _c[_b];\n table.type = 'table';\n table.refId = queryRes.refId;\n table.meta = queryRes.meta;\n data.push(table);\n }\n }\n }\n return { data: data };\n };\n ResponseParser.prototype.parseMetricFindQueryResult = function (refId, results) {\n if (!results || results.data.length === 0 || results.data.results[refId].meta.rowCount === 0) {\n return [];\n }\n var columns = results.data.results[refId].tables[0].columns;\n var rows = results.data.results[refId].tables[0].rows;\n var textColIndex = this.findColIndex(columns, '__text');\n var valueColIndex = this.findColIndex(columns, '__value');\n if (columns.length === 2 && textColIndex !== -1 && valueColIndex !== -1) {\n return this.transformToKeyValueList(rows, textColIndex, valueColIndex);\n }\n return this.transformToSimpleList(rows);\n };\n ResponseParser.prototype.transformToKeyValueList = function (rows, textColIndex, valueColIndex) {\n var res = [];\n for (var i = 0; i < rows.length; i++) {\n if (!this.containsKey(res, rows[i][textColIndex])) {\n res.push({\n text: rows[i][textColIndex],\n value: rows[i][valueColIndex],\n });\n }\n }\n return res;\n };\n ResponseParser.prototype.transformToSimpleList = function (rows) {\n var res = [];\n for (var i = 0; i < rows.length; i++) {\n for (var j = 0; j < rows[i].length; j++) {\n var value = rows[i][j];\n if (res.indexOf(value) === -1) {\n res.push(value);\n }\n }\n }\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(res, function (value) {\n return { text: value };\n });\n };\n ResponseParser.prototype.findColIndex = function (columns, colName) {\n for (var i = 0; i < columns.length; i++) {\n if (columns[i].text === colName) {\n return i;\n }\n }\n return -1;\n };\n ResponseParser.prototype.containsKey = function (res, key) {\n for (var i = 0; i < res.length; i++) {\n if (res[i].text === key) {\n return true;\n }\n }\n return false;\n };\n ResponseParser.prototype.transformAnnotationResponse = function (options, data) {\n var table = data.data.results[options.annotation.name].tables[0];\n var timeColumnIndex = -1;\n var textColumnIndex = -1;\n var tagsColumnIndex = -1;\n for (var i = 0; i < table.columns.length; i++) {\n if (table.columns[i].text === 'time_sec' || table.columns[i].text === 'time') {\n timeColumnIndex = i;\n }\n else if (table.columns[i].text === 'title') {\n return this.$q.reject({\n message: 'The title column for annotations is deprecated, now only a column named text is returned',\n });\n }\n else if (table.columns[i].text === 'text') {\n textColumnIndex = i;\n }\n else if (table.columns[i].text === 'tags') {\n tagsColumnIndex = i;\n }\n }\n if (timeColumnIndex === -1) {\n return this.$q.reject({\n message: 'Missing mandatory time column (with time_sec column alias) in annotation query.',\n });\n }\n var list = [];\n for (var i = 0; i < table.rows.length; i++) {\n var row = table.rows[i];\n list.push({\n annotation: options.annotation,\n time: Math.floor(row[timeColumnIndex]),\n text: row[textColumnIndex] ? row[textColumnIndex].toString() : '',\n tags: row[tagsColumnIndex] ? row[tagsColumnIndex].trim().split(/\\s*,\\s*/) : [],\n });\n }\n return list;\n };\n return ResponseParser;\n}());\n/* harmony default export */ __webpack_exports__[\"a\"] = (ResponseParser);\n\n\n/***/ }),\n\n/***/ 2117:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return MysqlQueryCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_plugins_sdk__ = __webpack_require__(1983);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\nvar defaultQuery = \"SELECT\\n UNIX_TIMESTAMP() as time_sec,\\n as value,\\n as metric\\nFROM
\\nWHERE $__timeFilter(time_column)\\nORDER BY ASC\\n\";\nvar MysqlQueryCtrl = /** @class */ (function (_super) {\n __extends(MysqlQueryCtrl, _super);\n /** @ngInject **/\n MysqlQueryCtrl.$inject = [\"$scope\", \"$injector\"];\n function MysqlQueryCtrl($scope, $injector) {\n var _this = _super.call(this, $scope, $injector) || this;\n _this.target.format = _this.target.format || 'time_series';\n _this.target.alias = '';\n _this.formats = [{ text: 'Time series', value: 'time_series' }, { text: 'Table', value: 'table' }];\n if (!_this.target.rawSql) {\n // special handling when in table panel\n if (_this.panelCtrl.panel.type === 'table') {\n _this.target.format = 'table';\n _this.target.rawSql = 'SELECT 1';\n }\n else {\n _this.target.rawSql = defaultQuery;\n }\n }\n _this.panelCtrl.events.on('data-received', _this.onDataReceived.bind(_this), $scope);\n _this.panelCtrl.events.on('data-error', _this.onDataError.bind(_this), $scope);\n return _this;\n }\n MysqlQueryCtrl.prototype.onDataReceived = function (dataList) {\n this.lastQueryMeta = null;\n this.lastQueryError = null;\n var anySeriesFromQuery = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(dataList, { refId: this.target.refId });\n if (anySeriesFromQuery) {\n this.lastQueryMeta = anySeriesFromQuery.meta;\n }\n };\n MysqlQueryCtrl.prototype.onDataError = function (err) {\n if (err.data && err.data.results) {\n var queryRes = err.data.results[this.target.refId];\n if (queryRes) {\n this.lastQueryMeta = queryRes.meta;\n this.lastQueryError = queryRes.error;\n }\n }\n };\n MysqlQueryCtrl.templateUrl = 'partials/query.editor.html';\n return MysqlQueryCtrl;\n}(__WEBPACK_IMPORTED_MODULE_1_app_plugins_sdk__[\"QueryCtrl\"]));\n\n\n\n/***/ }),\n\n/***/ 2118:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ConfigCtrl\", function() { return PostgresConfigCtrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnnotationsQueryCtrl\", function() { return PostgresAnnotationsQueryCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__datasource__ = __webpack_require__(2119);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__query_ctrl__ = __webpack_require__(2121);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"PostgresDatasource\", function() { return __WEBPACK_IMPORTED_MODULE_0__datasource__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"Datasource\", function() { return __WEBPACK_IMPORTED_MODULE_0__datasource__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"QueryCtrl\", function() { return __WEBPACK_IMPORTED_MODULE_1__query_ctrl__[\"a\"]; });\n\n\nvar PostgresConfigCtrl = /** @class */ (function () {\n /** @ngInject **/\n PostgresConfigCtrl.$inject = [\"$scope\"];\n function PostgresConfigCtrl($scope) {\n this.current.jsonData.sslmode = this.current.jsonData.sslmode || 'verify-full';\n }\n PostgresConfigCtrl.templateUrl = 'partials/config.html';\n return PostgresConfigCtrl;\n}());\nvar defaultQuery = \"SELECT\\n extract(epoch from time_column) AS time,\\n text_column as text,\\n tags_column as tags\\nFROM\\n metric_table\\nWHERE\\n $__timeFilter(time_column)\\n\";\nvar PostgresAnnotationsQueryCtrl = /** @class */ (function () {\n /** @ngInject **/\n function PostgresAnnotationsQueryCtrl() {\n this.annotation.rawQuery = this.annotation.rawQuery || defaultQuery;\n }\n PostgresAnnotationsQueryCtrl.templateUrl = 'partials/annotations.editor.html';\n return PostgresAnnotationsQueryCtrl;\n}());\n\n\n\n/***/ }),\n\n/***/ 2119:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return PostgresDatasource; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__response_parser__ = __webpack_require__(2120);\n\n\nvar PostgresDatasource = /** @class */ (function () {\n /** @ngInject **/\n PostgresDatasource.$inject = [\"instanceSettings\", \"backendSrv\", \"$q\", \"templateSrv\"];\n function PostgresDatasource(instanceSettings, backendSrv, $q, templateSrv) {\n this.backendSrv = backendSrv;\n this.$q = $q;\n this.templateSrv = templateSrv;\n this.name = instanceSettings.name;\n this.id = instanceSettings.id;\n this.responseParser = new __WEBPACK_IMPORTED_MODULE_1__response_parser__[\"a\" /* default */](this.$q);\n }\n PostgresDatasource.prototype.interpolateVariable = function (value, variable) {\n if (typeof value === 'string') {\n if (variable.multi || variable.includeAll) {\n return \"'\" + value + \"'\";\n }\n else {\n return value;\n }\n }\n if (typeof value === 'number') {\n return value;\n }\n var quotedValues = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(value, function (val) {\n return \"'\" + val + \"'\";\n });\n return quotedValues.join(',');\n };\n PostgresDatasource.prototype.query = function (options) {\n var _this = this;\n var queries = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.filter(options.targets, function (item) {\n return item.hide !== true;\n }).map(function (item) {\n return {\n refId: item.refId,\n intervalMs: options.intervalMs,\n maxDataPoints: options.maxDataPoints,\n datasourceId: _this.id,\n rawSql: _this.templateSrv.replace(item.rawSql, options.scopedVars, _this.interpolateVariable),\n format: item.format,\n };\n });\n if (queries.length === 0) {\n return this.$q.when({ data: [] });\n }\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: {\n from: options.range.from.valueOf().toString(),\n to: options.range.to.valueOf().toString(),\n queries: queries,\n },\n })\n .then(this.responseParser.processQueryResult);\n };\n PostgresDatasource.prototype.annotationQuery = function (options) {\n var _this = this;\n if (!options.annotation.rawQuery) {\n return this.$q.reject({\n message: 'Query missing in annotation definition',\n });\n }\n var query = {\n refId: options.annotation.name,\n datasourceId: this.id,\n rawSql: this.templateSrv.replace(options.annotation.rawQuery, options.scopedVars, this.interpolateVariable),\n format: 'table',\n };\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: {\n from: options.range.from.valueOf().toString(),\n to: options.range.to.valueOf().toString(),\n queries: [query],\n },\n })\n .then(function (data) { return _this.responseParser.transformAnnotationResponse(options, data); });\n };\n PostgresDatasource.prototype.metricFindQuery = function (query, optionalOptions) {\n var _this = this;\n var refId = 'tempvar';\n if (optionalOptions && optionalOptions.variable && optionalOptions.variable.name) {\n refId = optionalOptions.variable.name;\n }\n var interpolatedQuery = {\n refId: refId,\n datasourceId: this.id,\n rawSql: this.templateSrv.replace(query, {}, this.interpolateVariable),\n format: 'table',\n };\n var data = {\n queries: [interpolatedQuery],\n };\n if (optionalOptions && optionalOptions.range && optionalOptions.range.from) {\n data['from'] = optionalOptions.range.from.valueOf().toString();\n }\n if (optionalOptions && optionalOptions.range && optionalOptions.range.to) {\n data['to'] = optionalOptions.range.to.valueOf().toString();\n }\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: data,\n })\n .then(function (data) { return _this.responseParser.parseMetricFindQueryResult(refId, data); });\n };\n PostgresDatasource.prototype.testDatasource = function () {\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: {\n from: '5m',\n to: 'now',\n queries: [\n {\n refId: 'A',\n intervalMs: 1,\n maxDataPoints: 1,\n datasourceId: this.id,\n rawSql: 'SELECT 1',\n format: 'table',\n },\n ],\n },\n })\n .then(function (res) {\n return { status: 'success', message: 'Database Connection OK' };\n })\n .catch(function (err) {\n console.log(err);\n if (err.data && err.data.message) {\n return { status: 'error', message: err.data.message };\n }\n else {\n return { status: 'error', message: err.status };\n }\n });\n };\n return PostgresDatasource;\n}());\n\n\n\n/***/ }),\n\n/***/ 2120:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n\nvar ResponseParser = /** @class */ (function () {\n function ResponseParser($q) {\n this.$q = $q;\n }\n ResponseParser.prototype.processQueryResult = function (res) {\n var data = [];\n if (!res.data.results) {\n return { data: data };\n }\n for (var key in res.data.results) {\n var queryRes = res.data.results[key];\n if (queryRes.series) {\n for (var _i = 0, _a = queryRes.series; _i < _a.length; _i++) {\n var series = _a[_i];\n data.push({\n target: series.name,\n datapoints: series.points,\n refId: queryRes.refId,\n meta: queryRes.meta,\n });\n }\n }\n if (queryRes.tables) {\n for (var _b = 0, _c = queryRes.tables; _b < _c.length; _b++) {\n var table = _c[_b];\n table.type = 'table';\n table.refId = queryRes.refId;\n table.meta = queryRes.meta;\n data.push(table);\n }\n }\n }\n return { data: data };\n };\n ResponseParser.prototype.parseMetricFindQueryResult = function (refId, results) {\n if (!results || results.data.length === 0 || results.data.results[refId].meta.rowCount === 0) {\n return [];\n }\n var columns = results.data.results[refId].tables[0].columns;\n var rows = results.data.results[refId].tables[0].rows;\n var textColIndex = this.findColIndex(columns, '__text');\n var valueColIndex = this.findColIndex(columns, '__value');\n if (columns.length === 2 && textColIndex !== -1 && valueColIndex !== -1) {\n return this.transformToKeyValueList(rows, textColIndex, valueColIndex);\n }\n return this.transformToSimpleList(rows);\n };\n ResponseParser.prototype.transformToKeyValueList = function (rows, textColIndex, valueColIndex) {\n var res = [];\n for (var i = 0; i < rows.length; i++) {\n if (!this.containsKey(res, rows[i][textColIndex])) {\n res.push({\n text: rows[i][textColIndex],\n value: rows[i][valueColIndex],\n });\n }\n }\n return res;\n };\n ResponseParser.prototype.transformToSimpleList = function (rows) {\n var res = [];\n for (var i = 0; i < rows.length; i++) {\n for (var j = 0; j < rows[i].length; j++) {\n var value = rows[i][j];\n if (res.indexOf(value) === -1) {\n res.push(value);\n }\n }\n }\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(res, function (value) {\n return { text: value };\n });\n };\n ResponseParser.prototype.findColIndex = function (columns, colName) {\n for (var i = 0; i < columns.length; i++) {\n if (columns[i].text === colName) {\n return i;\n }\n }\n return -1;\n };\n ResponseParser.prototype.containsKey = function (res, key) {\n for (var i = 0; i < res.length; i++) {\n if (res[i].text === key) {\n return true;\n }\n }\n return false;\n };\n ResponseParser.prototype.transformAnnotationResponse = function (options, data) {\n var table = data.data.results[options.annotation.name].tables[0];\n var timeColumnIndex = -1;\n var titleColumnIndex = -1;\n var textColumnIndex = -1;\n var tagsColumnIndex = -1;\n for (var i = 0; i < table.columns.length; i++) {\n if (table.columns[i].text === 'time') {\n timeColumnIndex = i;\n }\n else if (table.columns[i].text === 'text') {\n textColumnIndex = i;\n }\n else if (table.columns[i].text === 'tags') {\n tagsColumnIndex = i;\n }\n }\n if (timeColumnIndex === -1) {\n return this.$q.reject({\n message: 'Missing mandatory time column in annotation query.',\n });\n }\n var list = [];\n for (var i = 0; i < table.rows.length; i++) {\n var row = table.rows[i];\n list.push({\n annotation: options.annotation,\n time: Math.floor(row[timeColumnIndex]),\n title: row[titleColumnIndex],\n text: row[textColumnIndex],\n tags: row[tagsColumnIndex] ? row[tagsColumnIndex].trim().split(/\\s*,\\s*/) : [],\n });\n }\n return list;\n };\n return ResponseParser;\n}());\n/* harmony default export */ __webpack_exports__[\"a\"] = (ResponseParser);\n\n\n/***/ }),\n\n/***/ 2121:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return PostgresQueryCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_plugins_sdk__ = __webpack_require__(1983);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\nvar defaultQuery = \"SELECT\\n $__time(time_column),\\n value1\\nFROM\\n metric_table\\nWHERE\\n $__timeFilter(time_column)\\n\";\nvar PostgresQueryCtrl = /** @class */ (function (_super) {\n __extends(PostgresQueryCtrl, _super);\n /** @ngInject **/\n PostgresQueryCtrl.$inject = [\"$scope\", \"$injector\"];\n function PostgresQueryCtrl($scope, $injector) {\n var _this = _super.call(this, $scope, $injector) || this;\n _this.target.format = _this.target.format || 'time_series';\n _this.target.alias = '';\n _this.formats = [{ text: 'Time series', value: 'time_series' }, { text: 'Table', value: 'table' }];\n if (!_this.target.rawSql) {\n // special handling when in table panel\n if (_this.panelCtrl.panel.type === 'table') {\n _this.target.format = 'table';\n _this.target.rawSql = 'SELECT 1';\n }\n else {\n _this.target.rawSql = defaultQuery;\n }\n }\n _this.panelCtrl.events.on('data-received', _this.onDataReceived.bind(_this), $scope);\n _this.panelCtrl.events.on('data-error', _this.onDataError.bind(_this), $scope);\n return _this;\n }\n PostgresQueryCtrl.prototype.onDataReceived = function (dataList) {\n this.lastQueryMeta = null;\n this.lastQueryError = null;\n var anySeriesFromQuery = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(dataList, { refId: this.target.refId });\n if (anySeriesFromQuery) {\n this.lastQueryMeta = anySeriesFromQuery.meta;\n }\n };\n PostgresQueryCtrl.prototype.onDataError = function (err) {\n if (err.data && err.data.results) {\n var queryRes = err.data.results[this.target.refId];\n if (queryRes) {\n this.lastQueryMeta = queryRes.meta;\n this.lastQueryError = queryRes.error;\n }\n }\n };\n PostgresQueryCtrl.templateUrl = 'partials/query.editor.html';\n return PostgresQueryCtrl;\n}(__WEBPACK_IMPORTED_MODULE_1_app_plugins_sdk__[\"QueryCtrl\"]));\n\n\n\n/***/ }),\n\n/***/ 2122:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnnotationsQueryCtrl\", function() { return PrometheusAnnotationsQueryCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__datasource__ = __webpack_require__(2123);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__query_ctrl__ = __webpack_require__(2126);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__config_ctrl__ = __webpack_require__(2130);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"Datasource\", function() { return __WEBPACK_IMPORTED_MODULE_0__datasource__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"QueryCtrl\", function() { return __WEBPACK_IMPORTED_MODULE_1__query_ctrl__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"ConfigCtrl\", function() { return __WEBPACK_IMPORTED_MODULE_2__config_ctrl__[\"a\"]; });\n\n\n\nvar PrometheusAnnotationsQueryCtrl = /** @class */ (function () {\n function PrometheusAnnotationsQueryCtrl() {\n }\n PrometheusAnnotationsQueryCtrl.templateUrl = 'partials/annotations.editor.html';\n return PrometheusAnnotationsQueryCtrl;\n}());\n\n\n\n/***/ }),\n\n/***/ 2123:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export alignRange */\n/* unused harmony export prometheusRegularEscape */\n/* unused harmony export prometheusSpecialRegexEscape */\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return PrometheusDatasource; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery__ = __webpack_require__(17);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_jquery__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_utils_kbn__ = __webpack_require__(312);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_app_core_utils_datemath__ = __webpack_require__(691);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__metric_find_query__ = __webpack_require__(2124);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__result_transformer__ = __webpack_require__(2125);\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n\n\n\n\n\n\nfunction alignRange(start, end, step) {\n var alignedEnd = Math.ceil(end / step) * step;\n var alignedStart = Math.floor(start / step) * step;\n return {\n end: alignedEnd,\n start: alignedStart,\n };\n}\nfunction prometheusRegularEscape(value) {\n return value.replace(/'/g, \"\\\\\\\\'\");\n}\nfunction prometheusSpecialRegexEscape(value) {\n return prometheusRegularEscape(value.replace(/\\\\/g, '\\\\\\\\\\\\\\\\').replace(/[$^*{}\\[\\]+?.()]/g, '\\\\\\\\$&'));\n}\nvar PrometheusDatasource = /** @class */ (function () {\n /** @ngInject */\n PrometheusDatasource.$inject = [\"instanceSettings\", \"$q\", \"backendSrv\", \"templateSrv\", \"timeSrv\"];\n function PrometheusDatasource(instanceSettings, $q, backendSrv, templateSrv, timeSrv) {\n this.$q = $q;\n this.backendSrv = backendSrv;\n this.templateSrv = templateSrv;\n this.timeSrv = timeSrv;\n this.type = 'prometheus';\n this.editorSrc = 'app/features/prometheus/partials/query.editor.html';\n this.name = instanceSettings.name;\n this.supportsExplore = true;\n this.supportMetrics = true;\n this.url = instanceSettings.url;\n this.directUrl = instanceSettings.directUrl;\n this.basicAuth = instanceSettings.basicAuth;\n this.withCredentials = instanceSettings.withCredentials;\n this.interval = instanceSettings.jsonData.timeInterval || '15s';\n this.queryTimeout = instanceSettings.jsonData.queryTimeout;\n this.httpMethod = instanceSettings.jsonData.httpMethod || 'GET';\n this.resultTransformer = new __WEBPACK_IMPORTED_MODULE_5__result_transformer__[\"a\" /* ResultTransformer */](templateSrv);\n }\n PrometheusDatasource.prototype._request = function (url, data, options) {\n var options = __assign({ url: this.url + url, method: this.httpMethod }, options);\n if (options.method === 'GET') {\n if (!__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isEmpty(data)) {\n options.url =\n options.url +\n '?' +\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(data, function (v, k) {\n return encodeURIComponent(k) + '=' + encodeURIComponent(v);\n }).join('&');\n }\n }\n else {\n options.headers = {\n 'Content-Type': 'application/x-www-form-urlencoded',\n };\n options.transformRequest = function (data) {\n return __WEBPACK_IMPORTED_MODULE_1_jquery___default.a.param(data);\n };\n options.data = data;\n }\n if (this.basicAuth || this.withCredentials) {\n options.withCredentials = true;\n }\n if (this.basicAuth) {\n options.headers = {\n Authorization: this.basicAuth,\n };\n }\n return this.backendSrv.datasourceRequest(options);\n };\n // Use this for tab completion features, wont publish response to other components\n PrometheusDatasource.prototype.metadataRequest = function (url) {\n return this._request(url, null, { method: 'GET', silent: true });\n };\n PrometheusDatasource.prototype.interpolateQueryExpr = function (value, variable, defaultFormatFn) {\n // if no multi or include all do not regexEscape\n if (!variable.multi && !variable.includeAll) {\n return prometheusRegularEscape(value);\n }\n if (typeof value === 'string') {\n return prometheusSpecialRegexEscape(value);\n }\n var escapedValues = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(value, prometheusSpecialRegexEscape);\n return escapedValues.join('|');\n };\n PrometheusDatasource.prototype.targetContainsTemplate = function (target) {\n return this.templateSrv.variableExists(target.expr);\n };\n PrometheusDatasource.prototype.query = function (options) {\n var _this = this;\n var start = this.getPrometheusTime(options.range.from, false);\n var end = this.getPrometheusTime(options.range.to, true);\n var queries = [];\n var activeTargets = [];\n options = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.clone(options);\n for (var _i = 0, _a = options.targets; _i < _a.length; _i++) {\n var target = _a[_i];\n if (!target.expr || target.hide) {\n continue;\n }\n activeTargets.push(target);\n queries.push(this.createQuery(target, options, start, end));\n }\n // No valid targets, return the empty result to save a round trip.\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isEmpty(queries)) {\n return this.$q.when({ data: [] });\n }\n var allQueryPromise = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(queries, function (query) {\n if (!query.instant) {\n return _this.performTimeSeriesQuery(query, query.start, query.end);\n }\n else {\n return _this.performInstantQuery(query, end);\n }\n });\n return this.$q.all(allQueryPromise).then(function (responseList) {\n var result = [];\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(responseList, function (response, index) {\n if (response.status === 'error') {\n throw response.error;\n }\n // Keeping original start/end for transformers\n var transformerOptions = {\n format: activeTargets[index].format,\n step: queries[index].step,\n legendFormat: activeTargets[index].legendFormat,\n start: start,\n end: end,\n query: queries[index].expr,\n responseListLength: responseList.length,\n responseIndex: index,\n refId: activeTargets[index].refId,\n };\n _this.resultTransformer.transform(result, response, transformerOptions);\n });\n return { data: result };\n });\n };\n PrometheusDatasource.prototype.createQuery = function (target, options, start, end) {\n var query = {};\n query.instant = target.instant;\n var range = Math.ceil(end - start);\n var interval = __WEBPACK_IMPORTED_MODULE_2_app_core_utils_kbn__[\"a\" /* default */].interval_to_seconds(options.interval);\n // Minimum interval (\"Min step\"), if specified for the query. or same as interval otherwise\n var minInterval = __WEBPACK_IMPORTED_MODULE_2_app_core_utils_kbn__[\"a\" /* default */].interval_to_seconds(this.templateSrv.replace(target.interval, options.scopedVars) || options.interval);\n var intervalFactor = target.intervalFactor || 1;\n // Adjust the interval to take into account any specified minimum and interval factor plus Prometheus limits\n var adjustedInterval = this.adjustInterval(interval, minInterval, range, intervalFactor);\n var scopedVars = options.scopedVars;\n // If the interval was adjusted, make a shallow copy of scopedVars with updated interval vars\n if (interval !== adjustedInterval) {\n interval = adjustedInterval;\n scopedVars = Object.assign({}, options.scopedVars, {\n __interval: { text: interval + 's', value: interval + 's' },\n __interval_ms: { text: interval * 1000, value: interval * 1000 },\n });\n }\n query.step = interval;\n // Only replace vars in expression after having (possibly) updated interval vars\n query.expr = this.templateSrv.replace(target.expr, scopedVars, this.interpolateQueryExpr);\n query.requestId = options.panelId + target.refId;\n // Align query interval with step\n var adjusted = alignRange(start, end, query.step);\n query.start = adjusted.start;\n query.end = adjusted.end;\n return query;\n };\n PrometheusDatasource.prototype.adjustInterval = function (interval, minInterval, range, intervalFactor) {\n // Prometheus will drop queries that might return more than 11000 data points.\n // Calibrate interval if it is too small.\n if (interval !== 0 && range / intervalFactor / interval > 11000) {\n interval = Math.ceil(range / intervalFactor / 11000);\n }\n return Math.max(interval * intervalFactor, minInterval, 1);\n };\n PrometheusDatasource.prototype.performTimeSeriesQuery = function (query, start, end) {\n if (start > end) {\n throw { message: 'Invalid time range' };\n }\n var url = '/api/v1/query_range';\n var data = {\n query: query.expr,\n start: start,\n end: end,\n step: query.step,\n };\n if (this.queryTimeout) {\n data['timeout'] = this.queryTimeout;\n }\n return this._request(url, data, { requestId: query.requestId });\n };\n PrometheusDatasource.prototype.performInstantQuery = function (query, time) {\n var url = '/api/v1/query';\n var data = {\n query: query.expr,\n time: time,\n };\n if (this.queryTimeout) {\n data['timeout'] = this.queryTimeout;\n }\n return this._request(url, data, { requestId: query.requestId });\n };\n PrometheusDatasource.prototype.performSuggestQuery = function (query, cache) {\n var _this = this;\n if (cache === void 0) { cache = false; }\n var url = '/api/v1/label/__name__/values';\n if (cache && this.metricsNameCache && this.metricsNameCache.expire > Date.now()) {\n return this.$q.when(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.filter(this.metricsNameCache.data, function (metricName) {\n return metricName.indexOf(query) !== 1;\n }));\n }\n return this.metadataRequest(url).then(function (result) {\n _this.metricsNameCache = {\n data: result.data.data,\n expire: Date.now() + 60 * 1000,\n };\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.filter(result.data.data, function (metricName) {\n return metricName.indexOf(query) !== 1;\n });\n });\n };\n PrometheusDatasource.prototype.metricFindQuery = function (query) {\n if (!query) {\n return this.$q.when([]);\n }\n var interpolated = this.templateSrv.replace(query, {}, this.interpolateQueryExpr);\n var metricFindQuery = new __WEBPACK_IMPORTED_MODULE_4__metric_find_query__[\"a\" /* default */](this, interpolated, this.timeSrv);\n return metricFindQuery.process();\n };\n PrometheusDatasource.prototype.annotationQuery = function (options) {\n var annotation = options.annotation;\n var expr = annotation.expr || '';\n var tagKeys = annotation.tagKeys || '';\n var titleFormat = annotation.titleFormat || '';\n var textFormat = annotation.textFormat || '';\n if (!expr) {\n return this.$q.when([]);\n }\n var step = annotation.step || '60s';\n var start = this.getPrometheusTime(options.range.from, false);\n var end = this.getPrometheusTime(options.range.to, true);\n // Unsetting min interval\n var queryOptions = __assign({}, options, { interval: '0s' });\n var query = this.createQuery({ expr: expr, interval: step }, queryOptions, start, end);\n var self = this;\n return this.performTimeSeriesQuery(query, query.start, query.end).then(function (results) {\n var eventList = [];\n tagKeys = tagKeys.split(',');\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(results.data.data.result, function (series) {\n var tags = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.chain(series.metric)\n .filter(function (v, k) {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.includes(tagKeys, k);\n })\n .value();\n for (var _i = 0, _a = series.values; _i < _a.length; _i++) {\n var value = _a[_i];\n if (value[1] === '1') {\n var event = {\n annotation: annotation,\n time: Math.floor(parseFloat(value[0])) * 1000,\n title: self.resultTransformer.renderTemplate(titleFormat, series.metric),\n tags: tags,\n text: self.resultTransformer.renderTemplate(textFormat, series.metric),\n };\n eventList.push(event);\n }\n }\n });\n return eventList;\n });\n };\n PrometheusDatasource.prototype.testDatasource = function () {\n var now = new Date().getTime();\n return this.performInstantQuery({ expr: '1+1' }, now / 1000).then(function (response) {\n if (response.data.status === 'success') {\n return { status: 'success', message: 'Data source is working' };\n }\n else {\n return { status: 'error', message: response.error };\n }\n });\n };\n PrometheusDatasource.prototype.getExploreState = function (panel) {\n var _this = this;\n var state = {};\n if (panel.targets) {\n var queries = panel.targets.map(function (t) { return ({\n query: _this.templateSrv.replace(t.expr, {}, _this.interpolateQueryExpr),\n format: t.format,\n }); });\n state = __assign({}, state, { queries: queries });\n }\n return state;\n };\n PrometheusDatasource.prototype.getPrometheusTime = function (date, roundUp) {\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isString(date)) {\n date = __WEBPACK_IMPORTED_MODULE_3_app_core_utils_datemath__[\"parse\"](date, roundUp);\n }\n return Math.ceil(date.valueOf() / 1000);\n };\n PrometheusDatasource.prototype.getOriginalMetricName = function (labelData) {\n return this.resultTransformer.getOriginalMetricName(labelData);\n };\n return PrometheusDatasource;\n}());\n\n\n\n/***/ }),\n\n/***/ 2124:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n\nvar PrometheusMetricFindQuery = /** @class */ (function () {\n function PrometheusMetricFindQuery(datasource, query, timeSrv) {\n this.datasource = datasource;\n this.query = query;\n this.range = timeSrv.timeRange();\n }\n PrometheusMetricFindQuery.prototype.process = function () {\n var label_values_regex = /^label_values\\((?:(.+),\\s*)?([a-zA-Z_][a-zA-Z0-9_]+)\\)\\s*$/;\n var metric_names_regex = /^metrics\\((.+)\\)\\s*$/;\n var query_result_regex = /^query_result\\((.+)\\)\\s*$/;\n var label_values_query = this.query.match(label_values_regex);\n if (label_values_query) {\n if (label_values_query[1]) {\n return this.labelValuesQuery(label_values_query[2], label_values_query[1]);\n }\n else {\n return this.labelValuesQuery(label_values_query[2], null);\n }\n }\n var metric_names_query = this.query.match(metric_names_regex);\n if (metric_names_query) {\n return this.metricNameQuery(metric_names_query[1]);\n }\n var query_result_query = this.query.match(query_result_regex);\n if (query_result_query) {\n return this.queryResultQuery(query_result_query[1]);\n }\n // if query contains full metric name, return metric name and label list\n return this.metricNameAndLabelsQuery(this.query);\n };\n PrometheusMetricFindQuery.prototype.labelValuesQuery = function (label, metric) {\n var url;\n if (!metric) {\n // return label values globally\n url = '/api/v1/label/' + label + '/values';\n return this.datasource.metadataRequest(url).then(function (result) {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(result.data.data, function (value) {\n return { text: value };\n });\n });\n }\n else {\n var start = this.datasource.getPrometheusTime(this.range.from, false);\n var end = this.datasource.getPrometheusTime(this.range.to, true);\n url = '/api/v1/series?match[]=' + encodeURIComponent(metric) + '&start=' + start + '&end=' + end;\n return this.datasource.metadataRequest(url).then(function (result) {\n var _labels = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(result.data.data, function (metric) {\n return metric[label] || '';\n }).filter(function (label) {\n return label !== '';\n });\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.uniq(_labels).map(function (metric) {\n return {\n text: metric,\n expandable: true,\n };\n });\n });\n }\n };\n PrometheusMetricFindQuery.prototype.metricNameQuery = function (metricFilterPattern) {\n var url = '/api/v1/label/__name__/values';\n return this.datasource.metadataRequest(url).then(function (result) {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.chain(result.data.data)\n .filter(function (metricName) {\n var r = new RegExp(metricFilterPattern);\n return r.test(metricName);\n })\n .map(function (matchedMetricName) {\n return {\n text: matchedMetricName,\n expandable: true,\n };\n })\n .value();\n });\n };\n PrometheusMetricFindQuery.prototype.queryResultQuery = function (query) {\n var end = this.datasource.getPrometheusTime(this.range.to, true);\n return this.datasource.performInstantQuery({ expr: query }, end).then(function (result) {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(result.data.data.result, function (metricData) {\n var text = metricData.metric.__name__ || '';\n delete metricData.metric.__name__;\n text +=\n '{' +\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(metricData.metric, function (v, k) {\n return k + '=\"' + v + '\"';\n }).join(',') +\n '}';\n text += ' ' + metricData.value[1] + ' ' + metricData.value[0] * 1000;\n return {\n text: text,\n expandable: true,\n };\n });\n });\n };\n PrometheusMetricFindQuery.prototype.metricNameAndLabelsQuery = function (query) {\n var start = this.datasource.getPrometheusTime(this.range.from, false);\n var end = this.datasource.getPrometheusTime(this.range.to, true);\n var url = '/api/v1/series?match[]=' + encodeURIComponent(query) + '&start=' + start + '&end=' + end;\n var self = this;\n return this.datasource.metadataRequest(url).then(function (result) {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(result.data.data, function (metric) {\n return {\n text: self.datasource.getOriginalMetricName(metric),\n expandable: true,\n };\n });\n });\n };\n return PrometheusMetricFindQuery;\n}());\n/* harmony default export */ __webpack_exports__[\"a\"] = (PrometheusMetricFindQuery);\n\n\n/***/ }),\n\n/***/ 2125:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return ResultTransformer; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_table_model__ = __webpack_require__(1987);\n\n\nvar ResultTransformer = /** @class */ (function () {\n function ResultTransformer(templateSrv) {\n this.templateSrv = templateSrv;\n }\n ResultTransformer.prototype.transform = function (result, response, options) {\n var prometheusResult = response.data.data.result;\n if (options.format === 'table') {\n result.push(this.transformMetricDataToTable(prometheusResult, options.responseListLength, options.refId));\n }\n else if (options.format === 'heatmap') {\n var seriesList = [];\n prometheusResult.sort(sortSeriesByLabel);\n for (var _i = 0, prometheusResult_1 = prometheusResult; _i < prometheusResult_1.length; _i++) {\n var metricData = prometheusResult_1[_i];\n seriesList.push(this.transformMetricData(metricData, options, options.start, options.end));\n }\n seriesList = this.transformToHistogramOverTime(seriesList);\n result.push.apply(result, seriesList);\n }\n else {\n for (var _a = 0, prometheusResult_2 = prometheusResult; _a < prometheusResult_2.length; _a++) {\n var metricData = prometheusResult_2[_a];\n if (response.data.data.resultType === 'matrix') {\n result.push(this.transformMetricData(metricData, options, options.start, options.end));\n }\n else if (response.data.data.resultType === 'vector') {\n result.push(this.transformInstantMetricData(metricData, options));\n }\n }\n }\n };\n ResultTransformer.prototype.transformMetricData = function (md, options, start, end) {\n var dps = [], metricLabel = null;\n metricLabel = this.createMetricLabel(md.metric, options);\n var stepMs = parseInt(options.step) * 1000;\n var baseTimestamp = start * 1000;\n for (var _i = 0, _a = md.values; _i < _a.length; _i++) {\n var value = _a[_i];\n var dp_value = parseFloat(value[1]);\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isNaN(dp_value)) {\n dp_value = null;\n }\n var timestamp = parseFloat(value[0]) * 1000;\n for (var t = baseTimestamp; t < timestamp; t += stepMs) {\n dps.push([null, t]);\n }\n baseTimestamp = timestamp + stepMs;\n dps.push([dp_value, timestamp]);\n }\n var endTimestamp = end * 1000;\n for (var t = baseTimestamp; t <= endTimestamp; t += stepMs) {\n dps.push([null, t]);\n }\n return { target: metricLabel, datapoints: dps };\n };\n ResultTransformer.prototype.transformMetricDataToTable = function (md, resultCount, refId) {\n var table = new __WEBPACK_IMPORTED_MODULE_1_app_core_table_model__[\"a\" /* default */]();\n var i, j;\n var metricLabels = {};\n if (md.length === 0) {\n return table;\n }\n // Collect all labels across all metrics\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(md, function (series) {\n for (var label in series.metric) {\n if (!metricLabels.hasOwnProperty(label)) {\n metricLabels[label] = 1;\n }\n }\n });\n // Sort metric labels, create columns for them and record their index\n var sortedLabels = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.keys(metricLabels).sort();\n table.columns.push({ text: 'Time', type: 'time' });\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(sortedLabels, function (label, labelIndex) {\n metricLabels[label] = labelIndex + 1;\n table.columns.push({ text: label });\n });\n var valueText = resultCount > 1 ? \"Value #\" + refId : 'Value';\n table.columns.push({ text: valueText });\n // Populate rows, set value to empty string when label not present.\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each(md, function (series) {\n if (series.value) {\n series.values = [series.value];\n }\n if (series.values) {\n for (i = 0; i < series.values.length; i++) {\n var values = series.values[i];\n var reordered = [values[0] * 1000];\n if (series.metric) {\n for (j = 0; j < sortedLabels.length; j++) {\n var label = sortedLabels[j];\n if (series.metric.hasOwnProperty(label)) {\n reordered.push(series.metric[label]);\n }\n else {\n reordered.push('');\n }\n }\n }\n reordered.push(parseFloat(values[1]));\n table.rows.push(reordered);\n }\n }\n });\n return table;\n };\n ResultTransformer.prototype.transformInstantMetricData = function (md, options) {\n var dps = [], metricLabel = null;\n metricLabel = this.createMetricLabel(md.metric, options);\n dps.push([parseFloat(md.value[1]), md.value[0] * 1000]);\n return { target: metricLabel, datapoints: dps };\n };\n ResultTransformer.prototype.createMetricLabel = function (labelData, options) {\n var label = '';\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isUndefined(options) || __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isEmpty(options.legendFormat)) {\n label = this.getOriginalMetricName(labelData);\n }\n else {\n label = this.renderTemplate(this.templateSrv.replace(options.legendFormat), labelData);\n }\n if (!label || label === '{}') {\n label = options.query;\n }\n return label;\n };\n ResultTransformer.prototype.renderTemplate = function (aliasPattern, aliasData) {\n var aliasRegex = /\\{\\{\\s*(.+?)\\s*\\}\\}/g;\n return aliasPattern.replace(aliasRegex, function (match, g1) {\n if (aliasData[g1]) {\n return aliasData[g1];\n }\n return g1;\n });\n };\n ResultTransformer.prototype.getOriginalMetricName = function (labelData) {\n var metricName = labelData.__name__ || '';\n delete labelData.__name__;\n var labelPart = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.toPairs(labelData), function (label) {\n return label[0] + '=\"' + label[1] + '\"';\n }).join(',');\n return metricName + '{' + labelPart + '}';\n };\n ResultTransformer.prototype.transformToHistogramOverTime = function (seriesList) {\n /* t1 = timestamp1, t2 = timestamp2 etc.\n t1 t2 t3 t1 t2 t3\n le10 10 10 0 => 10 10 0\n le20 20 10 30 => 10 0 30\n le30 30 10 35 => 10 0 5\n */\n for (var i = seriesList.length - 1; i > 0; i--) {\n var topSeries = seriesList[i].datapoints;\n var bottomSeries = seriesList[i - 1].datapoints;\n for (var j = 0; j < topSeries.length; j++) {\n topSeries[j][0] -= bottomSeries[j][0];\n }\n }\n return seriesList;\n };\n return ResultTransformer;\n}());\n\nfunction sortSeriesByLabel(s1, s2) {\n var le1, le2;\n try {\n // fail if not integer. might happen with bad queries\n le1 = parseHistogramLabel(s1.metric.le);\n le2 = parseHistogramLabel(s2.metric.le);\n }\n catch (err) {\n console.log(err);\n return 0;\n }\n if (le1 > le2) {\n return 1;\n }\n if (le1 < le2) {\n return -1;\n }\n return 0;\n}\nfunction parseHistogramLabel(le) {\n if (le === '+Inf') {\n return +Infinity;\n }\n return Number(le);\n}\n\n\n/***/ }),\n\n/***/ 2126:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return PrometheusQueryCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_plugins_sdk__ = __webpack_require__(1983);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__completer__ = __webpack_require__(2127);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__mode_prometheus__ = __webpack_require__(2128);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__mode_prometheus___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__mode_prometheus__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__snippets_prometheus__ = __webpack_require__(2129);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__snippets_prometheus___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__snippets_prometheus__);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n\n\n\nvar PrometheusQueryCtrl = /** @class */ (function (_super) {\n __extends(PrometheusQueryCtrl, _super);\n /** @ngInject */\n PrometheusQueryCtrl.$inject = [\"$scope\", \"$injector\", \"templateSrv\"];\n function PrometheusQueryCtrl($scope, $injector, templateSrv) {\n var _this = _super.call(this, $scope, $injector) || this;\n _this.templateSrv = templateSrv;\n var target = _this.target;\n target.expr = target.expr || '';\n target.intervalFactor = target.intervalFactor || 1;\n target.format = target.format || _this.getDefaultFormat();\n _this.metric = '';\n _this.resolutions = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map([1, 2, 3, 4, 5, 10], function (f) {\n return { factor: f, label: '1/' + f };\n });\n _this.formats = [\n { text: 'Time series', value: 'time_series' },\n { text: 'Table', value: 'table' },\n { text: 'Heatmap', value: 'heatmap' },\n ];\n _this.instant = false;\n _this.updateLink();\n return _this;\n }\n PrometheusQueryCtrl.prototype.getCompleter = function (query) {\n return new __WEBPACK_IMPORTED_MODULE_3__completer__[\"a\" /* PromCompleter */](this.datasource, this.templateSrv);\n };\n PrometheusQueryCtrl.prototype.getDefaultFormat = function () {\n if (this.panelCtrl.panel.type === 'table') {\n return 'table';\n }\n else if (this.panelCtrl.panel.type === 'heatmap') {\n return 'heatmap';\n }\n return 'time_series';\n };\n PrometheusQueryCtrl.prototype.refreshMetricData = function () {\n if (!__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isEqual(this.oldTarget, this.target)) {\n this.oldTarget = __WEBPACK_IMPORTED_MODULE_0_angular___default.a.copy(this.target);\n this.panelCtrl.refresh();\n this.updateLink();\n }\n };\n PrometheusQueryCtrl.prototype.updateLink = function () {\n var range = this.panelCtrl.range;\n if (!range) {\n return;\n }\n var rangeDiff = Math.ceil((range.to.valueOf() - range.from.valueOf()) / 1000);\n var endTime = range.to.utc().format('YYYY-MM-DD HH:mm');\n var expr = {\n 'g0.expr': this.templateSrv.replace(this.target.expr, this.panelCtrl.panel.scopedVars, this.datasource.interpolateQueryExpr),\n 'g0.range_input': rangeDiff + 's',\n 'g0.end_input': endTime,\n 'g0.step_input': this.target.step,\n 'g0.stacked': this.panelCtrl.panel.stack ? 1 : 0,\n 'g0.tab': 0,\n };\n var args = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(expr, function (v, k) {\n return k + '=' + encodeURIComponent(v);\n }).join('&');\n this.linkToPrometheus = this.datasource.directUrl + '/graph?' + args;\n };\n PrometheusQueryCtrl.prototype.getCollapsedText = function () {\n return this.target.expr;\n };\n PrometheusQueryCtrl.templateUrl = 'partials/query.editor.html';\n return PrometheusQueryCtrl;\n}(__WEBPACK_IMPORTED_MODULE_2_app_plugins_sdk__[\"QueryCtrl\"]));\n\n\n\n/***/ }),\n\n/***/ 2127:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return PromCompleter; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n\nvar PromCompleter = /** @class */ (function () {\n function PromCompleter(datasource, templateSrv) {\n this.datasource = datasource;\n this.templateSrv = templateSrv;\n this.identifierRegexps = [/\\[/, /[a-zA-Z0-9_:]/];\n this.labelQueryCache = {};\n this.labelNameCache = {};\n this.labelValueCache = {};\n this.templateVariableCompletions = this.templateSrv.variables.map(function (variable) {\n return {\n caption: '$' + variable.name,\n value: '$' + variable.name,\n meta: 'variable',\n score: Number.MAX_VALUE,\n };\n });\n }\n PromCompleter.prototype.getCompletions = function (editor, session, pos, prefix, callback) {\n var _this = this;\n var wrappedCallback = function (err, completions) {\n completions = completions.concat(_this.templateVariableCompletions);\n return callback(err, completions);\n };\n var token = session.getTokenAt(pos.row, pos.column);\n switch (token.type) {\n case 'entity.name.tag.label-matcher':\n this.getCompletionsForLabelMatcherName(session, pos).then(function (completions) {\n wrappedCallback(null, completions);\n });\n return;\n case 'string.quoted.label-matcher':\n this.getCompletionsForLabelMatcherValue(session, pos).then(function (completions) {\n wrappedCallback(null, completions);\n });\n return;\n case 'entity.name.tag.label-list-matcher':\n this.getCompletionsForBinaryOperator(session, pos).then(function (completions) {\n wrappedCallback(null, completions);\n });\n return;\n }\n if (token.type === 'paren.lparen' && token.value === '[') {\n var vectors = [];\n for (var _i = 0, _a = ['s', 'm', 'h']; _i < _a.length; _i++) {\n var unit = _a[_i];\n for (var _b = 0, _c = [1, 5, 10, 30]; _b < _c.length; _b++) {\n var value = _c[_b];\n vectors.push({\n caption: value + unit,\n value: '[' + value + unit,\n meta: 'range vector',\n });\n }\n }\n vectors.unshift({\n caption: '$__interval_ms',\n value: '[$__interval_ms',\n meta: 'range vector',\n });\n vectors.unshift({\n caption: '$__interval',\n value: '[$__interval',\n meta: 'range vector',\n });\n wrappedCallback(null, vectors);\n return;\n }\n var query = prefix;\n return this.datasource.performSuggestQuery(query, true).then(function (metricNames) {\n wrappedCallback(null, metricNames.map(function (name) {\n var value = name;\n if (prefix === '(') {\n value = '(' + name;\n }\n return {\n caption: name,\n value: value,\n meta: 'metric',\n };\n }));\n });\n };\n PromCompleter.prototype.getCompletionsForLabelMatcherName = function (session, pos) {\n var _this = this;\n var metricName = this.findMetricName(session, pos.row, pos.column);\n if (!metricName) {\n return Promise.resolve(this.transformToCompletions(['__name__', 'instance', 'job'], 'label name'));\n }\n if (this.labelNameCache[metricName]) {\n return Promise.resolve(this.labelNameCache[metricName]);\n }\n return this.getLabelNameAndValueForExpression(metricName, 'metricName').then(function (result) {\n var labelNames = _this.transformToCompletions(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.uniq(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.flatten(result.map(function (r) {\n return Object.keys(r.metric);\n }))), 'label name');\n _this.labelNameCache[metricName] = labelNames;\n return Promise.resolve(labelNames);\n });\n };\n PromCompleter.prototype.getCompletionsForLabelMatcherValue = function (session, pos) {\n var _this = this;\n var metricName = this.findMetricName(session, pos.row, pos.column);\n if (!metricName) {\n return Promise.resolve([]);\n }\n var labelNameToken = this.findToken(session, pos.row, pos.column, 'entity.name.tag.label-matcher', null, 'paren.lparen.label-matcher');\n if (!labelNameToken) {\n return Promise.resolve([]);\n }\n var labelName = labelNameToken.value;\n if (this.labelValueCache[metricName] && this.labelValueCache[metricName][labelName]) {\n return Promise.resolve(this.labelValueCache[metricName][labelName]);\n }\n return this.getLabelNameAndValueForExpression(metricName, 'metricName').then(function (result) {\n var labelValues = _this.transformToCompletions(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.uniq(result.map(function (r) {\n return r.metric[labelName];\n })), 'label value');\n _this.labelValueCache[metricName] = _this.labelValueCache[metricName] || {};\n _this.labelValueCache[metricName][labelName] = labelValues;\n return Promise.resolve(labelValues);\n });\n };\n PromCompleter.prototype.getCompletionsForBinaryOperator = function (session, pos) {\n var _this = this;\n var keywordOperatorToken = this.findToken(session, pos.row, pos.column, 'keyword.control', null, 'identifier');\n if (!keywordOperatorToken) {\n return Promise.resolve([]);\n }\n var rparenToken, expr;\n switch (keywordOperatorToken.value) {\n case 'by':\n case 'without':\n rparenToken = this.findToken(session, keywordOperatorToken.row, keywordOperatorToken.column, 'paren.rparen', null, 'identifier');\n if (!rparenToken) {\n return Promise.resolve([]);\n }\n expr = this.findExpressionMatchedParen(session, rparenToken.row, rparenToken.column);\n if (expr === '') {\n return Promise.resolve([]);\n }\n return this.getLabelNameAndValueForExpression(expr, 'expression').then(function (result) {\n var labelNames = _this.transformToCompletions(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.uniq(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.flatten(result.map(function (r) {\n return Object.keys(r.metric);\n }))), 'label name');\n _this.labelNameCache[expr] = labelNames;\n return labelNames;\n });\n case 'on':\n case 'ignoring':\n case 'group_left':\n case 'group_right':\n var binaryOperatorToken = this.findToken(session, keywordOperatorToken.row, keywordOperatorToken.column, 'keyword.operator.binary', null, 'identifier');\n if (!binaryOperatorToken) {\n return Promise.resolve([]);\n }\n rparenToken = this.findToken(session, binaryOperatorToken.row, binaryOperatorToken.column, 'paren.rparen', null, 'identifier');\n if (rparenToken) {\n expr = this.findExpressionMatchedParen(session, rparenToken.row, rparenToken.column);\n if (expr === '') {\n return Promise.resolve([]);\n }\n return this.getLabelNameAndValueForExpression(expr, 'expression').then(function (result) {\n var labelNames = _this.transformToCompletions(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.uniq(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.flatten(result.map(function (r) {\n return Object.keys(r.metric);\n }))), 'label name');\n _this.labelNameCache[expr] = labelNames;\n return labelNames;\n });\n }\n else {\n var metricName_1 = this.findMetricName(session, binaryOperatorToken.row, binaryOperatorToken.column);\n return this.getLabelNameAndValueForExpression(metricName_1, 'metricName').then(function (result) {\n var labelNames = _this.transformToCompletions(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.uniq(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.flatten(result.map(function (r) {\n return Object.keys(r.metric);\n }))), 'label name');\n _this.labelNameCache[metricName_1] = labelNames;\n return Promise.resolve(labelNames);\n });\n }\n }\n return Promise.resolve([]);\n };\n PromCompleter.prototype.getLabelNameAndValueForExpression = function (expr, type) {\n var _this = this;\n if (this.labelQueryCache[expr]) {\n return Promise.resolve(this.labelQueryCache[expr]);\n }\n var query = expr;\n if (type === 'metricName') {\n var op = '=~';\n if (/[a-zA-Z_:][a-zA-Z0-9_:]*/.test(expr)) {\n op = '=';\n }\n query = '{__name__' + op + '\"' + expr + '\"}';\n }\n return this.datasource.performInstantQuery({ expr: query }, new Date().getTime() / 1000).then(function (response) {\n _this.labelQueryCache[expr] = response.data.data.result;\n return response.data.data.result;\n });\n };\n PromCompleter.prototype.transformToCompletions = function (words, meta) {\n return words.map(function (name) {\n return {\n caption: name,\n value: name,\n meta: meta,\n score: Number.MAX_VALUE,\n };\n });\n };\n PromCompleter.prototype.findMetricName = function (session, row, column) {\n var metricName = '';\n var tokens;\n var nameLabelNameToken = this.findToken(session, row, column, 'entity.name.tag.label-matcher', '__name__', 'paren.lparen.label-matcher');\n if (nameLabelNameToken) {\n tokens = session.getTokens(nameLabelNameToken.row);\n var nameLabelValueToken = tokens[nameLabelNameToken.index + 2];\n if (nameLabelValueToken && nameLabelValueToken.type === 'string.quoted.label-matcher') {\n metricName = nameLabelValueToken.value.slice(1, -1); // cut begin/end quotation\n }\n }\n else {\n var metricNameToken = this.findToken(session, row, column, 'identifier', null, null);\n if (metricNameToken) {\n tokens = session.getTokens(metricNameToken.row);\n metricName = metricNameToken.value;\n }\n }\n return metricName;\n };\n PromCompleter.prototype.findToken = function (session, row, column, target, value, guard) {\n var tokens, idx;\n // find index and get column of previous token\n for (var r = row; r >= 0; r--) {\n var c = void 0;\n tokens = session.getTokens(r);\n if (r === row) {\n // current row\n c = 0;\n for (idx = 0; idx < tokens.length; idx++) {\n var nc = c + tokens[idx].value.length;\n if (nc >= column) {\n break;\n }\n c = nc;\n }\n }\n else {\n idx = tokens.length - 1;\n c =\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.sum(tokens.map(function (t) {\n return t.value.length;\n })) - tokens[tokens.length - 1].value.length;\n }\n for (; idx >= 0; idx--) {\n if (tokens[idx].type === guard) {\n return null;\n }\n if (tokens[idx].type === target && (!value || tokens[idx].value === value)) {\n tokens[idx].row = r;\n tokens[idx].column = c;\n tokens[idx].index = idx;\n return tokens[idx];\n }\n c -= tokens[idx].value.length;\n }\n }\n return null;\n };\n PromCompleter.prototype.findExpressionMatchedParen = function (session, row, column) {\n var tokens, idx;\n var deep = 1;\n var expression = ')';\n for (var r = row; r >= 0; r--) {\n tokens = session.getTokens(r);\n if (r === row) {\n // current row\n var c = 0;\n for (idx = 0; idx < tokens.length; idx++) {\n c += tokens[idx].value.length;\n if (c >= column) {\n break;\n }\n }\n }\n else {\n idx = tokens.length - 1;\n }\n for (; idx >= 0; idx--) {\n expression = tokens[idx].value + expression;\n if (tokens[idx].type === 'paren.rparen') {\n deep++;\n }\n else if (tokens[idx].type === 'paren.lparen') {\n deep--;\n if (deep === 0) {\n return expression;\n }\n }\n }\n }\n return expression;\n };\n return PromCompleter;\n}());\n\n\n\n/***/ }),\n\n/***/ 2128:\n/***/ (function(module, exports) {\n\n// jshint ignore: start\n// jscs: disable\nace.define(\"ace/mode/prometheus_highlight_rules\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text_highlight_rules\"], function(require, exports, module) {\n\"use strict\";\n\nvar oop = require(\"../lib/oop\");\nvar TextHighlightRules = require(\"./text_highlight_rules\").TextHighlightRules;\n\nvar PrometheusHighlightRules = function() {\n var keywords = (\n \"count|count_values|min|max|avg|sum|stddev|stdvar|bottomk|topk|quantile\"\n );\n\n var builtinConstants = (\n \"true|false|null|__name__|job\"\n );\n\n var builtinFunctions = (\n \"abs|absent|ceil|changes|clamp_max|clamp_min|count_scalar|day_of_month|day_of_week|days_in_month|delta|deriv|\" + \"drop_common_labels|exp|floor|histogram_quantile|holt_winters|hour|idelta|increase|irate|label_replace|ln|log2|\" +\n \"log10|minute|month|predict_linear|rate|resets|round|scalar|sort|sort_desc|sqrt|time|vector|year|avg_over_time|\" +\n \"min_over_time|max_over_time|sum_over_time|count_over_time|quantile_over_time|stddev_over_time|stdvar_over_time\"\n );\n\n var keywordMapper = this.createKeywordMapper({\n \"support.function\": builtinFunctions,\n \"keyword\": keywords,\n \"constant.language\": builtinConstants\n }, \"identifier\", true);\n\n this.$rules = {\n \"start\" : [ {\n token : \"string\", // single line\n regex : /\"(?:[^\"\\\\]|\\\\.)*?\"/\n }, {\n token : \"string\", // string\n regex : \"'.*?'\"\n }, {\n token : \"constant.numeric\", // float\n regex : \"[-]?\\\\d+(?:(?:\\\\.\\\\d*)?(?:[eE][+-]?\\\\d+)?)?\\\\b\"\n }, {\n token : \"constant.language\", // time\n regex : \"\\\\d+[smhdwy]\"\n }, {\n token : \"keyword.operator.binary\",\n regex : \"\\\\+|\\\\-|\\\\*|\\\\/|%|\\\\^|==|!=|<=|>=|<|>|and|or|unless\"\n }, {\n token : \"keyword.other\",\n regex : \"keep_common|offset|bool\"\n }, {\n token : \"keyword.control\",\n regex : \"by|without|on|ignoring|group_left|group_right\",\n next : \"start-label-list-matcher\"\n }, {\n token : \"variable\",\n regex : \"\\\\$[A-Za-z0-9_]+\"\n }, {\n token : keywordMapper,\n regex : \"[a-zA-Z_:][a-zA-Z0-9_:]*\"\n }, {\n token : \"paren.lparen\",\n regex : \"[[(]\"\n }, {\n token : \"paren.lparen.label-matcher\",\n regex : \"{\",\n next : \"start-label-matcher\"\n }, {\n token : \"paren.rparen\",\n regex : \"[\\\\])]\"\n }, {\n token : \"paren.rparen.label-matcher\",\n regex : \"}\"\n }, {\n token : \"text\",\n regex : \"\\\\s+\"\n } ],\n \"start-label-matcher\" : [ {\n token : \"entity.name.tag.label-matcher\",\n regex : '[a-zA-Z_][a-zA-Z0-9_]*'\n }, {\n token : \"keyword.operator.label-matcher\",\n regex : '=~|=|!~|!='\n }, {\n token : \"string.quoted.label-matcher\",\n regex : '\"[^\"]*\"|\\'[^\\']*\\''\n }, {\n token : \"punctuation.operator.label-matcher\",\n regex : \",\"\n }, {\n token : \"paren.rparen.label-matcher\",\n regex : \"}\",\n next : \"start\"\n } ],\n \"start-label-list-matcher\" : [ {\n token : \"paren.lparen.label-list-matcher\",\n regex : \"[(]\"\n }, {\n token : \"entity.name.tag.label-list-matcher\",\n regex : '[a-zA-Z_][a-zA-Z0-9_]*'\n }, {\n token : \"punctuation.operator.label-list-matcher\",\n regex : \",\"\n }, {\n token : \"paren.rparen.label-list-matcher\",\n regex : \"[)]\",\n next : \"start\"\n } ]\n };\n\n this.normalizeRules();\n};\n\noop.inherits(PrometheusHighlightRules, TextHighlightRules);\n\nexports.PrometheusHighlightRules = PrometheusHighlightRules;\n});\n\nace.define(\"ace/mode/prometheus_completions\",[\"require\",\"exports\",\"module\",\"ace/token_iterator\", \"ace/lib/lang\"], function(require, exports, module) {\n\"use strict\";\n\nvar lang = require(\"../lib/lang\");\n\nvar prometheusKeyWords = [\n \"by\", \"without\", \"keep_common\", \"offset\", \"bool\", \"and\", \"or\", \"unless\", \"ignoring\", \"on\", \"group_left\",\n \"group_right\", \"count\", \"count_values\", \"min\", \"max\", \"avg\", \"sum\", \"stddev\", \"stdvar\", \"bottomk\", \"topk\", \"quantile\"\n];\n\nvar keyWordsCompletions = prometheusKeyWords.map(function(word) {\n return {\n caption: word,\n value: word,\n meta: \"keyword\",\n score: Number.MAX_VALUE\n }\n});\n\nvar prometheusFunctions = [\n {\n name: 'abs()', value: 'abs',\n def: 'abs(v instant-vector)',\n docText: 'Returns the input vector with all sample values converted to their absolute value.'\n },\n {\n name: 'absent()', value: 'absent',\n def: 'absent(v instant-vector)',\n docText: 'Returns an empty vector if the vector passed to it has any elements and a 1-element vector with the value 1 if the vector passed to it has no elements. This is useful for alerting on when no time series exist for a given metric name and label combination.'\n },\n {\n name: 'ceil()', value: 'ceil',\n def: 'ceil(v instant-vector)',\n docText: 'Rounds the sample values of all elements in `v` up to the nearest integer.'\n },\n {\n name: 'changes()', value: 'changes',\n def: 'changes(v range-vector)',\n docText: 'For each input time series, `changes(v range-vector)` returns the number of times its value has changed within the provided time range as an instant vector.'\n },\n {\n name: 'clamp_max()', value: 'clamp_max',\n def: 'clamp_max(v instant-vector, max scalar)',\n docText: 'Clamps the sample values of all elements in `v` to have an upper limit of `max`.'\n },\n {\n name: 'clamp_min()', value: 'clamp_min',\n def: 'clamp_min(v instant-vector, min scalar)',\n docText: 'Clamps the sample values of all elements in `v` to have a lower limit of `min`.'\n },\n {\n name: 'count_scalar()', value: 'count_scalar',\n def: 'count_scalar(v instant-vector)',\n docText: 'Returns the number of elements in a time series vector as a scalar. This is in contrast to the `count()` aggregation operator, which always returns a vector (an empty one if the input vector is empty) and allows grouping by labels via a `by` clause.'\n },\n {\n name: 'day_of_month()', value: 'day_of_month',\n def: 'day_of_month(v=vector(time()) instant-vector)',\n docText: 'Returns the day of the month for each of the given times in UTC. Returned values are from 1 to 31.'\n },\n {\n name: 'day_of_week()', value: 'day_of_week',\n def: 'day_of_week(v=vector(time()) instant-vector)',\n docText: 'Returns the day of the week for each of the given times in UTC. Returned values are from 0 to 6, where 0 means Sunday etc.'\n },\n {\n name: 'days_in_month()', value: 'days_in_month',\n def: 'days_in_month(v=vector(time()) instant-vector)',\n docText: 'Returns number of days in the month for each of the given times in UTC. Returned values are from 28 to 31.'\n },\n {\n name: 'delta()', value: 'delta',\n def: 'delta(v range-vector)',\n docText: 'Calculates the difference between the first and last value of each time series element in a range vector `v`, returning an instant vector with the given deltas and equivalent labels. The delta is extrapolated to cover the full time range as specified in the range vector selector, so that it is possible to get a non-integer result even if the sample values are all integers.'\n },\n {\n name: 'deriv()', value: 'deriv',\n def: 'deriv(v range-vector)',\n docText: 'Calculates the per-second derivative of the time series in a range vector `v`, using simple linear regression.'\n },\n {\n name: 'drop_common_labels()', value: 'drop_common_labels',\n def: 'drop_common_labels(instant-vector)',\n docText: 'Drops all labels that have the same name and value across all series in the input vector.'\n },\n {\n name: 'exp()', value: 'exp',\n def: 'exp(v instant-vector)',\n docText: 'Calculates the exponential function for all elements in `v`.\\nSpecial cases are:\\n* `Exp(+Inf) = +Inf` \\n* `Exp(NaN) = NaN`'\n },\n {\n name: 'floor()', value: 'floor',\n def: 'floor(v instant-vector)',\n docText: 'Rounds the sample values of all elements in `v` down to the nearest integer.'\n },\n {\n name: 'histogram_quantile()', value: 'histogram_quantile',\n def: 'histogram_quantile(φ float, b instant-vector)',\n docText: 'Calculates the φ-quantile (0 ≤ φ ≤ 1) from the buckets `b` of a histogram. The samples in `b` are the counts of observations in each bucket. Each sample must have a label `le` where the label value denotes the inclusive upper bound of the bucket. (Samples without such a label are silently ignored.) The histogram metric type automatically provides time series with the `_bucket` suffix and the appropriate labels.'\n },\n {\n name: 'holt_winters()', value: 'holt_winters',\n def: 'holt_winters(v range-vector, sf scalar, tf scalar)',\n docText: 'Produces a smoothed value for time series based on the range in `v`. The lower the smoothing factor `sf`, the more importance is given to old data. The higher the trend factor `tf`, the more trends in the data is considered. Both `sf` and `tf` must be between 0 and 1.'\n },\n {\n name: 'hour()', value: 'hour',\n def: 'hour(v=vector(time()) instant-vector)',\n docText: 'Returns the hour of the day for each of the given times in UTC. Returned values are from 0 to 23.'\n },\n {\n name: 'idelta()', value: 'idelta',\n def: 'idelta(v range-vector)',\n docText: 'Calculates the difference between the last two samples in the range vector `v`, returning an instant vector with the given deltas and equivalent labels.'\n },\n {\n name: 'increase()', value: 'increase',\n def: 'increase(v range-vector)',\n docText: 'Calculates the increase in the time series in the range vector. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for. The increase is extrapolated to cover the full time range as specified in the range vector selector, so that it is possible to get a non-integer result even if a counter increases only by integer increments.'\n },\n {\n name: 'irate()', value: 'irate',\n def: 'irate(v range-vector)',\n docText: 'Calculates the per-second instant rate of increase of the time series in the range vector. This is based on the last two data points. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for.'\n },\n {\n name: 'label_replace()', value: 'label_replace',\n def: 'label_replace(v instant-vector, dst_label string, replacement string, src_label string, regex string)',\n docText: 'For each timeseries in `v`, `label_replace(v instant-vector, dst_label string, replacement string, src_label string, regex string)` matches the regular expression `regex` against the label `src_label`. If it matches, then the timeseries is returned with the label `dst_label` replaced by the expansion of `replacement`. `$1` is replaced with the first matching subgroup, `$2` with the second etc. If the regular expression doesn\\'t match then the timeseries is returned unchanged.'\n },\n {\n name: 'ln()', value: 'ln',\n def: 'ln(v instant-vector)',\n docText: 'calculates the natural logarithm for all elements in `v`.\\nSpecial cases are:\\n * `ln(+Inf) = +Inf`\\n * `ln(0) = -Inf`\\n * `ln(x < 0) = NaN`\\n * `ln(NaN) = NaN`'\n },\n {\n name: 'log2()', value: 'log2',\n def: 'log2(v instant-vector)',\n docText: 'Calculates the binary logarithm for all elements in `v`. The special cases are equivalent to those in `ln`.'\n },\n {\n name: 'log10()', value: 'log10',\n def: 'log10(v instant-vector)',\n docText: 'Calculates the decimal logarithm for all elements in `v`. The special cases are equivalent to those in `ln`.'\n },\n {\n name: 'minute()', value: 'minute',\n def: 'minute(v=vector(time()) instant-vector)',\n docText: 'Returns the minute of the hour for each of the given times in UTC. Returned values are from 0 to 59.'\n },\n {\n name: 'month()', value: 'month',\n def: 'month(v=vector(time()) instant-vector)',\n docText: 'Returns the month of the year for each of the given times in UTC. Returned values are from 1 to 12, where 1 means January etc.'\n },\n {\n name: 'predict_linear()', value: 'predict_linear',\n def: 'predict_linear(v range-vector, t scalar)',\n docText: 'Predicts the value of time series `t` seconds from now, based on the range vector `v`, using simple linear regression.'\n },\n {\n name: 'rate()', value: 'rate',\n def: 'rate(v range-vector)',\n docText: \"Calculates the per-second average rate of increase of the time series in the range vector. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for. Also, the calculation extrapolates to the ends of the time range, allowing for missed scrapes or imperfect alignment of scrape cycles with the range's time period.\"\n },\n {\n name: 'resets()', value: 'resets',\n def: 'resets(v range-vector)',\n docText: 'For each input time series, `resets(v range-vector)` returns the number of counter resets within the provided time range as an instant vector. Any decrease in the value between two consecutive samples is interpreted as a counter reset.'\n },\n {\n name: 'round()', value: 'round',\n def: 'round(v instant-vector, to_nearest=1 scalar)',\n docText: 'Rounds the sample values of all elements in `v` to the nearest integer. Ties are resolved by rounding up. The optional `to_nearest` argument allows specifying the nearest multiple to which the sample values should be rounded. This multiple may also be a fraction.'\n },\n {\n name: 'scalar()', value: 'scalar',\n def: 'scalar(v instant-vector)',\n docText: 'Given a single-element input vector, `scalar(v instant-vector)` returns the sample value of that single element as a scalar. If the input vector does not have exactly one element, `scalar` will return `NaN`.'\n },\n {\n name: 'sort()', value: 'sort',\n def: 'sort(v instant-vector)',\n docText: 'Returns vector elements sorted by their sample values, in ascending order.'\n },\n {\n name: 'sort_desc()', value: 'sort_desc',\n def: 'sort_desc(v instant-vector)',\n docText: 'Returns vector elements sorted by their sample values, in descending order.'\n },\n {\n name: 'sqrt()', value: 'sqrt',\n def: 'sqrt(v instant-vector)',\n docText: 'Calculates the square root of all elements in `v`.'\n },\n {\n name: 'time()', value: 'time',\n def: 'time()',\n docText: 'Returns the number of seconds since January 1, 1970 UTC. Note that this does not actually return the current time, but the time at which the expression is to be evaluated.'\n },\n {\n name: 'vector()', value: 'vector',\n def: 'vector(s scalar)',\n docText: 'Returns the scalar `s` as a vector with no labels.'\n },\n {\n name: 'year()', value: 'year',\n def: 'year(v=vector(time()) instant-vector)',\n docText: 'Returns the year for each of the given times in UTC.'\n },\n {\n name: 'avg_over_time()', value: 'avg_over_time',\n def: 'avg_over_time(range-vector)',\n docText: 'The average value of all points in the specified interval.'\n },\n {\n name: 'min_over_time()', value: 'min_over_time',\n def: 'min_over_time(range-vector)',\n docText: 'The minimum value of all points in the specified interval.'\n },\n {\n name: 'max_over_time()', value: 'max_over_time',\n def: 'max_over_time(range-vector)',\n docText: 'The maximum value of all points in the specified interval.'\n },\n {\n name: 'sum_over_time()', value: 'sum_over_time',\n def: 'sum_over_time(range-vector)',\n docText: 'The sum of all values in the specified interval.'\n },\n {\n name: 'count_over_time()', value: 'count_over_time',\n def: 'count_over_time(range-vector)',\n docText: 'The count of all values in the specified interval.'\n },\n {\n name: 'quantile_over_time()', value: 'quantile_over_time',\n def: 'quantile_over_time(scalar, range-vector)',\n docText: 'The φ-quantile (0 ≤ φ ≤ 1) of the values in the specified interval.'\n },\n {\n name: 'stddev_over_time()', value: 'stddev_over_time',\n def: 'stddev_over_time(range-vector)',\n docText: 'The population standard deviation of the values in the specified interval.'\n },\n {\n name: 'stdvar_over_time()', value: 'stdvar_over_time',\n def: 'stdvar_over_time(range-vector)',\n docText: 'The population standard variance of the values in the specified interval.'\n },\n];\n\nfunction wrapText(str, len) {\n len = len || 60;\n var lines = [];\n var space_index = 0;\n var line_start = 0;\n var next_line_end = len;\n var line = \"\";\n for (var i = 0; i < str.length; i++) {\n if (str[i] === ' ') {\n space_index = i;\n } else if (i >= next_line_end && space_index != 0) {\n line = str.slice(line_start, space_index);\n lines.push(line);\n line_start = space_index + 1;\n next_line_end = i + len;\n space_index = 0;\n }\n }\n line = str.slice(line_start);\n lines.push(line);\n return lines.join(\" 
\");\n}\n\nfunction convertMarkDownTags(text) {\n text = text.replace(/```(.+)```/, \"
$1
\");\n text = text.replace(/`([^`]+)`/, \"$1\");\n return text;\n}\n\nfunction convertToHTML(item) {\n var docText = lang.escapeHTML(item.docText);\n docText = convertMarkDownTags(wrapText(docText, 40));\n return [\n \"\", lang.escapeHTML(item.def), \"\", \"
\", docText, \"
 \"\n ].join(\"\");\n}\n\nvar functionsCompletions = prometheusFunctions.map(function(item) {\n return {\n caption: item.name,\n value: item.value,\n docHTML: convertToHTML(item),\n meta: \"function\",\n score: Number.MAX_VALUE\n };\n});\n\nvar PrometheusCompletions = function() {};\n\n(function() {\n this.getCompletions = function(state, session, pos, prefix, callback) {\n var token = session.getTokenAt(pos.row, pos.column);\n if (token.type === 'entity.name.tag.label-matcher'\n || token.type === 'string.quoted.label-matcher'\n || token.type === 'entity.name.tag.label-list-matcher') {\n return callback(null, []);\n }\n\n var completions = keyWordsCompletions.concat(functionsCompletions);\n callback(null, completions);\n };\n\n}).call(PrometheusCompletions.prototype);\n\nexports.PrometheusCompletions = PrometheusCompletions;\n});\n\nace.define(\"ace/mode/behaviour/prometheus\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/behaviour\",\"ace/mode/behaviour/cstyle\",\"ace/token_iterator\"], function(require, exports, module) {\n\"use strict\";\n\nvar oop = require(\"../../lib/oop\");\nvar Behaviour = require(\"../behaviour\").Behaviour;\nvar CstyleBehaviour = require(\"./cstyle\").CstyleBehaviour;\nvar TokenIterator = require(\"../../token_iterator\").TokenIterator;\n\nfunction getWrapped(selection, selected, opening, closing) {\n var rowDiff = selection.end.row - selection.start.row;\n return {\n text: opening + selected + closing,\n selection: [\n 0,\n selection.start.column + 1,\n rowDiff,\n selection.end.column + (rowDiff ? 0 : 1)\n ]\n };\n};\n\nvar PrometheusBehaviour = function () {\n this.inherit(CstyleBehaviour);\n\n // Rewrite default CstyleBehaviour for {} braces\n this.add(\"braces\", \"insertion\", function(state, action, editor, session, text) {\n if (text == '{') {\n var selection = editor.getSelectionRange();\n var selected = session.doc.getTextRange(selection);\n if (selected !== \"\" && editor.getWrapBehavioursEnabled()) {\n return getWrapped(selection, selected, '{', '}');\n } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {\n return {\n text: '{}',\n selection: [1, 1]\n };\n }\n } else if (text == '}') {\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n var rightChar = line.substring(cursor.column, cursor.column + 1);\n if (rightChar == '}') {\n var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});\n if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {\n return {\n text: '',\n selection: [1, 1]\n };\n }\n }\n }\n });\n\n this.add(\"braces\", \"deletion\", function(state, action, editor, session, range) {\n var selected = session.doc.getTextRange(range);\n if (!range.isMultiLine() && selected == '{') {\n var line = session.doc.getLine(range.start.row);\n var rightChar = line.substring(range.start.column + 1, range.start.column + 2);\n if (rightChar == '}') {\n range.end.column++;\n return range;\n }\n }\n });\n\n}\noop.inherits(PrometheusBehaviour, CstyleBehaviour);\n\nexports.PrometheusBehaviour = PrometheusBehaviour;\n});\n\nace.define(\"ace/mode/prometheus\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text\",\"ace/mode/prometheus_highlight_rules\"], function(require, exports, module) {\n\"use strict\";\n\nvar oop = require(\"../lib/oop\");\nvar TextMode = require(\"./text\").Mode;\nvar PrometheusHighlightRules = require(\"./prometheus_highlight_rules\").PrometheusHighlightRules;\nvar PrometheusCompletions = require(\"./prometheus_completions\").PrometheusCompletions;\nvar PrometheusBehaviour = require(\"./behaviour/prometheus\").PrometheusBehaviour;\n\nvar Mode = function() {\n this.HighlightRules = PrometheusHighlightRules;\n this.$behaviour = new PrometheusBehaviour();\n this.$completer = new PrometheusCompletions();\n // replace keyWordCompleter\n this.completer = this.$completer;\n};\noop.inherits(Mode, TextMode);\n\n(function() {\n\n this.$id = \"ace/mode/prometheus\";\n}).call(Mode.prototype);\n\nexports.Mode = Mode;\n\n});\n\n\n/***/ }),\n\n/***/ 2129:\n/***/ (function(module, exports) {\n\n// jshint ignore: start\n// jscs: disable\nace.define(\"ace/snippets/prometheus\",[\"require\",\"exports\",\"module\"], function(require, exports, module) {\n\"use strict\";\n\n// exports.snippetText = \"# rate\\n\\\n// snippet r\\n\\\n// rate(${1:metric}[${2:range}])\\n\\\n// \";\n\nexports.snippets = [\n {\n \"content\": \"rate(${1:metric}[${2:range}])\",\n \"name\": \"rate()\",\n \"scope\": \"prometheus\",\n \"tabTrigger\": \"r\"\n }\n];\n\nexports.scope = \"prometheus\";\n});\n\n\n/***/ }),\n\n/***/ 2130:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return PrometheusConfigCtrl; });\nvar PrometheusConfigCtrl = /** @class */ (function () {\n /** @ngInject */\n PrometheusConfigCtrl.$inject = [\"$scope\"];\n function PrometheusConfigCtrl($scope) {\n this.current.jsonData.httpMethod = this.current.jsonData.httpMethod || 'GET';\n }\n PrometheusConfigCtrl.templateUrl = 'public/app/plugins/datasource/prometheus/partials/config.html';\n return PrometheusConfigCtrl;\n}());\n\n\n\n/***/ }),\n\n/***/ 2131:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ConfigCtrl\", function() { return MssqlConfigCtrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnnotationsQueryCtrl\", function() { return MssqlAnnotationsQueryCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__datasource__ = __webpack_require__(2132);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__query_ctrl__ = __webpack_require__(2134);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"MssqlDatasource\", function() { return __WEBPACK_IMPORTED_MODULE_0__datasource__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"Datasource\", function() { return __WEBPACK_IMPORTED_MODULE_0__datasource__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"QueryCtrl\", function() { return __WEBPACK_IMPORTED_MODULE_1__query_ctrl__[\"a\"]; });\n\n\nvar MssqlConfigCtrl = /** @class */ (function () {\n function MssqlConfigCtrl() {\n }\n MssqlConfigCtrl.templateUrl = 'partials/config.html';\n return MssqlConfigCtrl;\n}());\nvar defaultQuery = \"SELECT\\n as time,\\n as text,\\n as tags\\n FROM\\n
\\n WHERE\\n $__timeFilter(time_column)\\n ORDER BY\\n ASC\";\nvar MssqlAnnotationsQueryCtrl = /** @class */ (function () {\n /** @ngInject **/\n function MssqlAnnotationsQueryCtrl() {\n this.annotation.rawQuery = this.annotation.rawQuery || defaultQuery;\n }\n MssqlAnnotationsQueryCtrl.templateUrl = 'partials/annotations.editor.html';\n return MssqlAnnotationsQueryCtrl;\n}());\n\n\n\n/***/ }),\n\n/***/ 2132:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return MssqlDatasource; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__response_parser__ = __webpack_require__(2133);\n\n\nvar MssqlDatasource = /** @class */ (function () {\n /** @ngInject **/\n MssqlDatasource.$inject = [\"instanceSettings\", \"backendSrv\", \"$q\", \"templateSrv\"];\n function MssqlDatasource(instanceSettings, backendSrv, $q, templateSrv) {\n this.backendSrv = backendSrv;\n this.$q = $q;\n this.templateSrv = templateSrv;\n this.name = instanceSettings.name;\n this.id = instanceSettings.id;\n this.responseParser = new __WEBPACK_IMPORTED_MODULE_1__response_parser__[\"a\" /* default */](this.$q);\n }\n MssqlDatasource.prototype.interpolateVariable = function (value, variable) {\n if (typeof value === 'string') {\n if (variable.multi || variable.includeAll) {\n return \"'\" + value + \"'\";\n }\n else {\n return value;\n }\n }\n if (typeof value === 'number') {\n return value;\n }\n var quotedValues = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(value, function (val) {\n if (typeof value === 'number') {\n return value;\n }\n return \"'\" + val + \"'\";\n });\n return quotedValues.join(',');\n };\n MssqlDatasource.prototype.query = function (options) {\n var _this = this;\n var queries = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.filter(options.targets, function (item) {\n return item.hide !== true;\n }).map(function (item) {\n return {\n refId: item.refId,\n intervalMs: options.intervalMs,\n maxDataPoints: options.maxDataPoints,\n datasourceId: _this.id,\n rawSql: _this.templateSrv.replace(item.rawSql, options.scopedVars, _this.interpolateVariable),\n format: item.format,\n };\n });\n if (queries.length === 0) {\n return this.$q.when({ data: [] });\n }\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: {\n from: options.range.from.valueOf().toString(),\n to: options.range.to.valueOf().toString(),\n queries: queries,\n },\n })\n .then(this.responseParser.processQueryResult);\n };\n MssqlDatasource.prototype.annotationQuery = function (options) {\n var _this = this;\n if (!options.annotation.rawQuery) {\n return this.$q.reject({ message: 'Query missing in annotation definition' });\n }\n var query = {\n refId: options.annotation.name,\n datasourceId: this.id,\n rawSql: this.templateSrv.replace(options.annotation.rawQuery, options.scopedVars, this.interpolateVariable),\n format: 'table',\n };\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: {\n from: options.range.from.valueOf().toString(),\n to: options.range.to.valueOf().toString(),\n queries: [query],\n },\n })\n .then(function (data) { return _this.responseParser.transformAnnotationResponse(options, data); });\n };\n MssqlDatasource.prototype.metricFindQuery = function (query, optionalOptions) {\n var _this = this;\n var refId = 'tempvar';\n if (optionalOptions && optionalOptions.variable && optionalOptions.variable.name) {\n refId = optionalOptions.variable.name;\n }\n var interpolatedQuery = {\n refId: refId,\n datasourceId: this.id,\n rawSql: this.templateSrv.replace(query, {}, this.interpolateVariable),\n format: 'table',\n };\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: {\n queries: [interpolatedQuery],\n },\n })\n .then(function (data) { return _this.responseParser.parseMetricFindQueryResult(refId, data); });\n };\n MssqlDatasource.prototype.testDatasource = function () {\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: {\n from: '5m',\n to: 'now',\n queries: [\n {\n refId: 'A',\n intervalMs: 1,\n maxDataPoints: 1,\n datasourceId: this.id,\n rawSql: 'SELECT 1',\n format: 'table',\n },\n ],\n },\n })\n .then(function (res) {\n return { status: 'success', message: 'Database Connection OK' };\n })\n .catch(function (err) {\n console.log(err);\n if (err.data && err.data.message) {\n return { status: 'error', message: err.data.message };\n }\n else {\n return { status: 'error', message: err.status };\n }\n });\n };\n return MssqlDatasource;\n}());\n\n\n\n/***/ }),\n\n/***/ 2133:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n\nvar ResponseParser = /** @class */ (function () {\n function ResponseParser($q) {\n this.$q = $q;\n }\n ResponseParser.prototype.processQueryResult = function (res) {\n var data = [];\n if (!res.data.results) {\n return { data: data };\n }\n for (var key in res.data.results) {\n var queryRes = res.data.results[key];\n if (queryRes.series) {\n for (var _i = 0, _a = queryRes.series; _i < _a.length; _i++) {\n var series = _a[_i];\n data.push({\n target: series.name,\n datapoints: series.points,\n refId: queryRes.refId,\n meta: queryRes.meta,\n });\n }\n }\n if (queryRes.tables) {\n for (var _b = 0, _c = queryRes.tables; _b < _c.length; _b++) {\n var table = _c[_b];\n table.type = 'table';\n table.refId = queryRes.refId;\n table.meta = queryRes.meta;\n data.push(table);\n }\n }\n }\n return { data: data };\n };\n ResponseParser.prototype.parseMetricFindQueryResult = function (refId, results) {\n if (!results || results.data.length === 0 || results.data.results[refId].meta.rowCount === 0) {\n return [];\n }\n var columns = results.data.results[refId].tables[0].columns;\n var rows = results.data.results[refId].tables[0].rows;\n var textColIndex = this.findColIndex(columns, '__text');\n var valueColIndex = this.findColIndex(columns, '__value');\n if (columns.length === 2 && textColIndex !== -1 && valueColIndex !== -1) {\n return this.transformToKeyValueList(rows, textColIndex, valueColIndex);\n }\n return this.transformToSimpleList(rows);\n };\n ResponseParser.prototype.transformToKeyValueList = function (rows, textColIndex, valueColIndex) {\n var res = [];\n for (var i = 0; i < rows.length; i++) {\n if (!this.containsKey(res, rows[i][textColIndex])) {\n res.push({ text: rows[i][textColIndex], value: rows[i][valueColIndex] });\n }\n }\n return res;\n };\n ResponseParser.prototype.transformToSimpleList = function (rows) {\n var res = [];\n for (var i = 0; i < rows.length; i++) {\n for (var j = 0; j < rows[i].length; j++) {\n var value = rows[i][j];\n if (res.indexOf(value) === -1) {\n res.push(value);\n }\n }\n }\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(res, function (value) {\n return { text: value };\n });\n };\n ResponseParser.prototype.findColIndex = function (columns, colName) {\n for (var i = 0; i < columns.length; i++) {\n if (columns[i].text === colName) {\n return i;\n }\n }\n return -1;\n };\n ResponseParser.prototype.containsKey = function (res, key) {\n for (var i = 0; i < res.length; i++) {\n if (res[i].text === key) {\n return true;\n }\n }\n return false;\n };\n ResponseParser.prototype.transformAnnotationResponse = function (options, data) {\n var table = data.data.results[options.annotation.name].tables[0];\n var timeColumnIndex = -1;\n var textColumnIndex = -1;\n var tagsColumnIndex = -1;\n for (var i = 0; i < table.columns.length; i++) {\n if (table.columns[i].text === 'time') {\n timeColumnIndex = i;\n }\n else if (table.columns[i].text === 'text') {\n textColumnIndex = i;\n }\n else if (table.columns[i].text === 'tags') {\n tagsColumnIndex = i;\n }\n }\n if (timeColumnIndex === -1) {\n return this.$q.reject({ message: 'Missing mandatory time column (with time column alias) in annotation query.' });\n }\n var list = [];\n for (var i = 0; i < table.rows.length; i++) {\n var row = table.rows[i];\n list.push({\n annotation: options.annotation,\n time: Math.floor(row[timeColumnIndex]),\n text: row[textColumnIndex],\n tags: row[tagsColumnIndex] ? row[tagsColumnIndex].trim().split(/\\s*,\\s*/) : [],\n });\n }\n return list;\n };\n return ResponseParser;\n}());\n/* harmony default export */ __webpack_exports__[\"a\"] = (ResponseParser);\n\n\n/***/ }),\n\n/***/ 2134:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return MssqlQueryCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_plugins_sdk__ = __webpack_require__(1983);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\nvar defaultQuery = \"SELECT\\n $__timeEpoch(),\\n as value,\\n as metric\\nFROM\\n
\\nWHERE\\n $__timeFilter(time_column)\\nORDER BY\\n ASC\";\nvar MssqlQueryCtrl = /** @class */ (function (_super) {\n __extends(MssqlQueryCtrl, _super);\n /** @ngInject **/\n MssqlQueryCtrl.$inject = [\"$scope\", \"$injector\"];\n function MssqlQueryCtrl($scope, $injector) {\n var _this = _super.call(this, $scope, $injector) || this;\n _this.target.format = _this.target.format || 'time_series';\n _this.target.alias = '';\n _this.formats = [{ text: 'Time series', value: 'time_series' }, { text: 'Table', value: 'table' }];\n if (!_this.target.rawSql) {\n // special handling when in table panel\n if (_this.panelCtrl.panel.type === 'table') {\n _this.target.format = 'table';\n _this.target.rawSql = 'SELECT 1';\n }\n else {\n _this.target.rawSql = defaultQuery;\n }\n }\n _this.panelCtrl.events.on('data-received', _this.onDataReceived.bind(_this), $scope);\n _this.panelCtrl.events.on('data-error', _this.onDataError.bind(_this), $scope);\n return _this;\n }\n MssqlQueryCtrl.prototype.onDataReceived = function (dataList) {\n this.lastQueryMeta = null;\n this.lastQueryError = null;\n var anySeriesFromQuery = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(dataList, { refId: this.target.refId });\n if (anySeriesFromQuery) {\n this.lastQueryMeta = anySeriesFromQuery.meta;\n }\n };\n MssqlQueryCtrl.prototype.onDataError = function (err) {\n if (err.data && err.data.results) {\n var queryRes = err.data.results[this.target.refId];\n if (queryRes) {\n this.lastQueryMeta = queryRes.meta;\n this.lastQueryError = queryRes.error;\n }\n }\n };\n MssqlQueryCtrl.templateUrl = 'partials/query.editor.html';\n return MssqlQueryCtrl;\n}(__WEBPACK_IMPORTED_MODULE_1_app_plugins_sdk__[\"QueryCtrl\"]));\n\n\n\n/***/ }),\n\n/***/ 2135:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TextPanelCtrl\", function() { return TextPanelCtrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PanelCtrl\", function() { return TextPanelCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_plugins_sdk__ = __webpack_require__(1983);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_remarkable__ = __webpack_require__(694);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_remarkable___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_remarkable__);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\nvar TextPanelCtrl = /** @class */ (function (_super) {\n __extends(TextPanelCtrl, _super);\n /** @ngInject **/\n TextPanelCtrl.$inject = [\"$scope\", \"$injector\", \"templateSrv\", \"$sce\"];\n function TextPanelCtrl($scope, $injector, templateSrv, $sce) {\n var _this = _super.call(this, $scope, $injector) || this;\n _this.templateSrv = templateSrv;\n _this.$sce = $sce;\n // Set and populate defaults\n _this.panelDefaults = {\n mode: 'markdown',\n content: '# title',\n };\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.defaults(_this.panel, _this.panelDefaults);\n _this.events.on('init-edit-mode', _this.onInitEditMode.bind(_this));\n _this.events.on('refresh', _this.onRefresh.bind(_this));\n _this.events.on('render', _this.onRender.bind(_this));\n $scope.$watch('ctrl.panel.content', __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.throttle(function () {\n _this.render();\n }, 1000));\n return _this;\n }\n TextPanelCtrl.prototype.onInitEditMode = function () {\n this.addEditorTab('Options', 'public/app/plugins/panel/text/editor.html');\n this.editorTabIndex = 1;\n if (this.panel.mode === 'text') {\n this.panel.mode = 'markdown';\n }\n };\n TextPanelCtrl.prototype.onRefresh = function () {\n this.render();\n };\n TextPanelCtrl.prototype.onRender = function () {\n if (this.panel.mode === 'markdown') {\n this.renderMarkdown(this.panel.content);\n }\n else if (this.panel.mode === 'html') {\n this.updateContent(this.panel.content);\n }\n this.renderingCompleted();\n };\n TextPanelCtrl.prototype.renderText = function (content) {\n content = content\n .replace(/&/g, '&')\n .replace(/>/g, '>')\n .replace(/');\n this.updateContent(content);\n };\n TextPanelCtrl.prototype.renderMarkdown = function (content) {\n var _this = this;\n if (!this.remarkable) {\n this.remarkable = new __WEBPACK_IMPORTED_MODULE_2_remarkable___default.a();\n }\n this.$scope.$applyAsync(function () {\n _this.updateContent(_this.remarkable.render(content));\n });\n };\n TextPanelCtrl.prototype.updateContent = function (html) {\n try {\n this.content = this.$sce.trustAsHtml(this.templateSrv.replace(html, this.panel.scopedVars));\n }\n catch (e) {\n console.log('Text panel error: ', e);\n this.content = this.$sce.trustAsHtml(html);\n }\n };\n TextPanelCtrl.templateUrl = \"public/app/plugins/panel/text/module.html\";\n TextPanelCtrl.scrollable = true;\n return TextPanelCtrl;\n}(__WEBPACK_IMPORTED_MODULE_1_app_plugins_sdk__[\"PanelCtrl\"]));\n\n\n\n\n/***/ }),\n\n/***/ 2136:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ \ngraphDirective.$inject = [\"timeSrv\", \"popoverSrv\", \"contextSrv\"];var __WEBPACK_IMPORTED_MODULE_0_vendor_flot_jquery_flot__ = __webpack_require__(1985);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vendor_flot_jquery_flot___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vendor_flot_jquery_flot__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vendor_flot_jquery_flot_selection__ = __webpack_require__(2007);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_vendor_flot_jquery_flot_selection___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_vendor_flot_jquery_flot_selection__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vendor_flot_jquery_flot_time__ = __webpack_require__(1989);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vendor_flot_jquery_flot_time___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vendor_flot_jquery_flot_time__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vendor_flot_jquery_flot_stack__ = __webpack_require__(2008);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vendor_flot_jquery_flot_stack___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_vendor_flot_jquery_flot_stack__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_vendor_flot_jquery_flot_stackpercent__ = __webpack_require__(2009);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_vendor_flot_jquery_flot_stackpercent___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_vendor_flot_jquery_flot_stackpercent__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_vendor_flot_jquery_flot_fillbelow__ = __webpack_require__(2010);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_vendor_flot_jquery_flot_fillbelow___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5_vendor_flot_jquery_flot_fillbelow__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_vendor_flot_jquery_flot_crosshair__ = __webpack_require__(2011);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_vendor_flot_jquery_flot_crosshair___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_vendor_flot_jquery_flot_crosshair__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_vendor_flot_jquery_flot_dashes__ = __webpack_require__(2012);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_vendor_flot_jquery_flot_dashes___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_vendor_flot_jquery_flot_dashes__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__jquery_flot_events__ = __webpack_require__(2137);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__jquery_flot_events___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8__jquery_flot_events__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_jquery__ = __webpack_require__(17);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_jquery__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_moment__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_11_moment__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12_app_core_utils_kbn__ = __webpack_require__(312);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13_app_core_utils_ticks__ = __webpack_require__(696);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14_app_core_core__ = __webpack_require__(197);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__graph_tooltip__ = __webpack_require__(2138);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__threshold_manager__ = __webpack_require__(2139);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17_app_features_annotations_all__ = __webpack_require__(1995);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__histogram__ = __webpack_require__(2140);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__align_yaxes__ = __webpack_require__(2141);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20_app_core_config__ = __webpack_require__(23);\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/** @ngInject **/\nfunction graphDirective(timeSrv, popoverSrv, contextSrv) {\n return {\n restrict: 'A',\n template: '',\n link: function (scope, elem) {\n var ctrl = scope.ctrl;\n var dashboard = ctrl.dashboard;\n var panel = ctrl.panel;\n var annotations = [];\n var data;\n var plot;\n var sortedSeries;\n var panelWidth = 0;\n var eventManager = new __WEBPACK_IMPORTED_MODULE_17_app_features_annotations_all__[\"a\" /* EventManager */](ctrl);\n var thresholdManager = new __WEBPACK_IMPORTED_MODULE_16__threshold_manager__[\"a\" /* ThresholdManager */](ctrl);\n var tooltip = new __WEBPACK_IMPORTED_MODULE_15__graph_tooltip__[\"a\" /* default */](elem, dashboard, scope, function () {\n return sortedSeries;\n });\n // panel events\n ctrl.events.on('panel-teardown', function () {\n thresholdManager = null;\n if (plot) {\n plot.destroy();\n plot = null;\n }\n });\n /**\n * Split graph rendering into two parts.\n * First, calculate series stats in buildFlotPairs() function. Then legend rendering started\n * (see ctrl.events.on('render') in legend.ts).\n * When legend is rendered it emits 'legend-rendering-complete' and graph rendered.\n */\n ctrl.events.on('render', function (renderData) {\n data = renderData || data;\n if (!data) {\n return;\n }\n annotations = ctrl.annotations || [];\n if (!panel.showEcuEvents) {\n annotations = __WEBPACK_IMPORTED_MODULE_10_lodash___default.a.filter(annotations, function (a) {\n return a.source.datasource !== '-- Platform Influxdb --';\n });\n }\n buildFlotPairs(data);\n var graphHeight = elem.height();\n Object(__WEBPACK_IMPORTED_MODULE_14_app_core_core__[\"g\" /* updateLegendValues */])(data, panel, graphHeight);\n ctrl.events.emit('render-legend');\n });\n ctrl.events.on('legend-rendering-complete', function () {\n render_panel();\n });\n // global events\n __WEBPACK_IMPORTED_MODULE_14_app_core_core__[\"b\" /* appEvents */].on('graph-hover', function (evt) {\n var isVideoSyncEvent = evt && evt.isVideoSync;\n // ignore other graph hover events if shared tooltip is disabled\n if (!isVideoSyncEvent && !dashboard.sharedTooltipModeEnabled()) {\n return;\n }\n // ignore if we are the emitter\n if (!plot || evt.panel.id === panel.id || ctrl.otherPanelInFullscreenMode()) {\n return;\n }\n tooltip.show(evt.pos);\n }, scope);\n __WEBPACK_IMPORTED_MODULE_14_app_core_core__[\"b\" /* appEvents */].on('graph-hover-clear', function (event, info) {\n if (plot) {\n tooltip.clear(plot);\n }\n }, scope);\n function shouldAbortRender() {\n if (!data) {\n return true;\n }\n if (panelWidth === 0) {\n return true;\n }\n return false;\n }\n function drawHook(plot) {\n // add left axis labels\n if (panel.yaxes[0].label && panel.yaxes[0].show) {\n __WEBPACK_IMPORTED_MODULE_9_jquery___default()(\"
\")\n .text(panel.yaxes[0].label)\n .appendTo(elem);\n }\n // add right axis labels\n if (panel.yaxes[1].label && panel.yaxes[1].show) {\n __WEBPACK_IMPORTED_MODULE_9_jquery___default()(\"
\")\n .text(panel.yaxes[1].label)\n .appendTo(elem);\n }\n if (ctrl.dataWarning) {\n __WEBPACK_IMPORTED_MODULE_9_jquery___default()(\"
\" + ctrl.dataWarning.title + \"
\").appendTo(elem);\n }\n thresholdManager.draw(plot);\n }\n function processOffsetHook(plot, gridMargin) {\n var left = panel.yaxes[0];\n var right = panel.yaxes[1];\n if (left.show && left.label) {\n gridMargin.left = 20;\n }\n if (right.show && right.label) {\n gridMargin.right = 20;\n }\n // apply y-axis min/max options\n var yaxis = plot.getYAxes();\n for (var i = 0; i < yaxis.length; i++) {\n var axis = yaxis[i];\n var panelOptions = panel.yaxes[i];\n axis.options.max = axis.options.max !== null ? axis.options.max : panelOptions.max;\n axis.options.min = axis.options.min !== null ? axis.options.min : panelOptions.min;\n }\n }\n function processRangeHook(plot) {\n var yAxes = plot.getYAxes();\n var align = panel.yaxis.align || false;\n if (yAxes.length > 1 && align === true) {\n var level = panel.yaxis.alignLevel || 0;\n Object(__WEBPACK_IMPORTED_MODULE_19__align_yaxes__[\"a\" /* alignYLevel */])(yAxes, parseFloat(level));\n }\n }\n // Series could have different timeSteps,\n // let's find the smallest one so that bars are correctly rendered.\n // In addition, only take series which are rendered as bars for this.\n function getMinTimeStepOfSeries(data) {\n var min = Number.MAX_VALUE;\n for (var i = 0; i < data.length; i++) {\n if (!data[i].stats.timeStep) {\n continue;\n }\n if (panel.bars) {\n if (data[i].bars && data[i].bars.show === false) {\n continue;\n }\n }\n else {\n if (typeof data[i].bars === 'undefined' || typeof data[i].bars.show === 'undefined' || !data[i].bars.show) {\n continue;\n }\n }\n if (data[i].stats.timeStep < min) {\n min = data[i].stats.timeStep;\n }\n }\n return min;\n }\n // Function for rendering panel\n function render_panel() {\n panelWidth = elem.width();\n if (shouldAbortRender()) {\n return;\n }\n // give space to alert editing\n thresholdManager.prepare(elem, data);\n // un-check dashes if lines are unchecked\n panel.dashes = panel.lines ? panel.dashes : false;\n // Populate element\n var options = buildFlotOptions(panel);\n prepareXAxis(options, panel);\n configureYAxisOptions(data, options);\n thresholdManager.addFlotOptions(options, panel);\n eventManager.addFlotEvents(annotations, options);\n sortedSeries = sortSeries(data, panel);\n if (panel.slowMode && panel.slowMode.enabled) {\n callPlotSlow(options, true);\n panel.slowMode.enabled = false;\n }\n else {\n callPlot(options, true);\n }\n }\n function buildFlotPairs(data) {\n for (var i = 0; i < data.length; i++) {\n var series = data[i];\n series.data = series.getFlotPairs(series.nullPointMode || panel.nullPointMode);\n // if hidden remove points and disable stack\n if (ctrl.hiddenSeries[series.alias]) {\n series.data = [];\n series.stack = false;\n }\n }\n }\n function prepareXAxis(options, panel) {\n switch (panel.xaxis.mode) {\n case 'series': {\n options.series.bars.barWidth = 0.7;\n options.series.bars.align = 'center';\n for (var i = 0; i < data.length; i++) {\n var series = data[i];\n series.data = [[i + 1, series.stats[panel.xaxis.values[0]]]];\n }\n addXSeriesAxis(options);\n break;\n }\n case 'histogram': {\n var bucketSize = void 0;\n if (data.length) {\n var histMin = __WEBPACK_IMPORTED_MODULE_10_lodash___default.a.min(__WEBPACK_IMPORTED_MODULE_10_lodash___default.a.map(data, function (s) { return s.stats.min; }));\n var histMax = __WEBPACK_IMPORTED_MODULE_10_lodash___default.a.max(__WEBPACK_IMPORTED_MODULE_10_lodash___default.a.map(data, function (s) { return s.stats.max; }));\n var ticks = panel.xaxis.buckets || panelWidth / 50;\n bucketSize = Object(__WEBPACK_IMPORTED_MODULE_13_app_core_utils_ticks__[\"tickStep\"])(histMin, histMax, ticks);\n options.series.bars.barWidth = bucketSize * 0.8;\n data = Object(__WEBPACK_IMPORTED_MODULE_18__histogram__[\"a\" /* convertToHistogramData */])(data, bucketSize, ctrl.hiddenSeries, histMin, histMax);\n }\n else {\n bucketSize = 0;\n }\n addXHistogramAxis(options, bucketSize);\n break;\n }\n case 'table': {\n options.series.bars.barWidth = 0.7;\n options.series.bars.align = 'center';\n addXTableAxis(options);\n break;\n }\n default: {\n options.series.bars.barWidth = getMinTimeStepOfSeries(data) / 1.5;\n addTimeAxis(options, panel);\n break;\n }\n }\n }\n function sleep(ms) {\n return new Promise(function (resolve) { return setTimeout(resolve, ms); });\n }\n function callPlotSlow(options, incrementRenderCounter) {\n return __awaiter(this, void 0, void 0, function () {\n var originalData, drawStepsCount, drawStepsSizes, i, series, maxVal, minVal, delta, axisIndex, _i, sortedSeries_1, series, i, isLast, seriesIdx, drawStepsSize, begin, end, isLastSeries, seriesIdx;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n originalData = [];\n drawStepsCount = (panel.slowMode && panel.slowMode.stepCount) || 100;\n drawStepsSizes = [];\n for (i in sortedSeries) {\n series = sortedSeries[i];\n // copy data for later slicing\n originalData[i] = series.data;\n drawStepsSizes[i] = series.data.length / drawStepsCount;\n maxVal = series.stats.max;\n minVal = series.stats.min;\n delta = maxVal - minVal;\n axisIndex = series.yaxis - 1;\n options.yaxes[axisIndex].min = Math.min(minVal - delta * 0.1, options.yaxes[axisIndex].min);\n options.yaxes[axisIndex].max = Math.max(maxVal + delta * 0.1, options.yaxes[axisIndex].max);\n }\n // first clear the graph, and wait 1s\n for (_i = 0, sortedSeries_1 = sortedSeries; _i < sortedSeries_1.length; _i++) {\n series = sortedSeries_1[_i];\n series.data = [];\n }\n callPlot(options, false);\n return [4 /*yield*/, sleep(1000)];\n case 1:\n _a.sent();\n i = 0;\n _a.label = 2;\n case 2:\n if (!(i < drawStepsCount)) return [3 /*break*/, 5];\n isLast = false;\n for (seriesIdx = 0; seriesIdx < sortedSeries.length; seriesIdx++) {\n drawStepsSize = drawStepsSizes[seriesIdx];\n begin = i * drawStepsSize;\n end = begin + drawStepsSize;\n sortedSeries[seriesIdx].data = originalData[seriesIdx].slice(0, end);\n isLastSeries = seriesIdx === sortedSeries.length - 1;\n isLast = i === drawStepsCount - 1 && isLastSeries;\n }\n callPlot(options, isLast);\n return [4 /*yield*/, sleep(0)];\n case 3:\n _a.sent();\n _a.label = 4;\n case 4:\n i++;\n return [3 /*break*/, 2];\n case 5:\n // reset data\n for (seriesIdx = 0; seriesIdx < sortedSeries.length; seriesIdx++) {\n sortedSeries[seriesIdx].data = originalData[seriesIdx];\n }\n return [2 /*return*/];\n }\n });\n });\n }\n function callPlot(options, incrementRenderCounter) {\n try {\n plot = __WEBPACK_IMPORTED_MODULE_9_jquery___default.a.plot(elem, sortedSeries, options);\n if (ctrl.renderError) {\n delete ctrl.error;\n delete ctrl.inspector;\n }\n }\n catch (e) {\n console.log('flotcharts error', e);\n ctrl.error = e.message || 'Render Error';\n ctrl.renderError = true;\n ctrl.inspector = { error: e };\n }\n if (incrementRenderCounter) {\n ctrl.renderingCompleted();\n }\n }\n function buildFlotOptions(panel) {\n var gridColor = '#c8c8c8';\n if (__WEBPACK_IMPORTED_MODULE_20_app_core_config__[\"a\" /* default */].bootData.user.lightTheme === true) {\n gridColor = '#a1a1a1';\n }\n var stack = panel.stack ? true : null;\n var options = {\n hooks: {\n draw: [drawHook],\n processOffset: [processOffsetHook],\n processRange: [processRangeHook],\n },\n legend: { show: false },\n series: {\n stackpercent: panel.stack ? panel.percentage : false,\n stack: panel.percentage ? null : stack,\n lines: {\n show: panel.lines,\n zero: false,\n fill: translateFillOption(panel.fill),\n lineWidth: panel.dashes ? 0 : panel.linewidth,\n steps: panel.steppedLine,\n },\n dashes: {\n show: panel.dashes,\n lineWidth: panel.linewidth,\n dashLength: [panel.dashLength, panel.spaceLength],\n },\n bars: {\n show: panel.bars,\n fill: 1,\n barWidth: 1,\n zero: false,\n lineWidth: 0,\n },\n points: {\n show: panel.points,\n fill: 1,\n fillColor: false,\n radius: panel.points ? panel.pointradius : 2,\n },\n shadowSize: 0,\n },\n yaxes: [],\n xaxis: {},\n grid: {\n minBorderMargin: 0,\n markings: [],\n backgroundColor: null,\n borderWidth: 0,\n hoverable: true,\n clickable: true,\n color: gridColor,\n margin: { left: 0, right: 0 },\n labelMarginX: 0,\n },\n selection: {\n mode: 'x',\n color: '#666',\n },\n crosshair: {\n mode: 'x',\n },\n };\n return options;\n }\n function sortSeries(series, panel) {\n var sortBy = panel.legend.sort;\n var sortOrder = panel.legend.sortDesc;\n var haveSortBy = sortBy !== null && sortBy !== undefined;\n var haveSortOrder = sortOrder !== null && sortOrder !== undefined;\n var shouldSortBy = panel.stack && haveSortBy && haveSortOrder;\n var sortDesc = panel.legend.sortDesc === true ? -1 : 1;\n if (shouldSortBy) {\n return __WEBPACK_IMPORTED_MODULE_10_lodash___default.a.sortBy(series, function (s) { return s.stats[sortBy] * sortDesc; });\n }\n else {\n return __WEBPACK_IMPORTED_MODULE_10_lodash___default.a.sortBy(series, function (s) { return s.zindex; });\n }\n }\n function translateFillOption(fill) {\n if (panel.percentage && panel.stack) {\n return fill === 0 ? 0.001 : fill / 10;\n }\n else {\n return fill / 10;\n }\n }\n function addTimeAxis(options, panel) {\n var ticks = panelWidth / 100;\n var min = __WEBPACK_IMPORTED_MODULE_10_lodash___default.a.isUndefined(ctrl.range.from) ? null : ctrl.range.from.valueOf();\n var max = __WEBPACK_IMPORTED_MODULE_10_lodash___default.a.isUndefined(ctrl.range.to) ? null : ctrl.range.to.valueOf();\n options.xaxis = {\n mode: 'time',\n show: panel.xaxis.show,\n min: min,\n max: max,\n label: 'Datetime',\n ticks: ticks,\n };\n if (panel.xaxis.tzero) {\n var tZeroFormatter = function (val, axis) {\n if (val === 0) {\n return 'T=0';\n }\n var prefix = val < 0 ? 'T-' : 'T+';\n var time = Math.abs(val) / 1000;\n return prefix + time;\n };\n options.xaxis.tickFormatter = tZeroFormatter;\n }\n else {\n options.xaxis.timezone = dashboard.getTimezone();\n options.xaxis.timeforamt = time_format(ticks, min, max);\n }\n }\n function addXSeriesAxis(options) {\n var ticks = __WEBPACK_IMPORTED_MODULE_10_lodash___default.a.map(data, function (series, index) {\n return [index + 1, series.alias];\n });\n options.xaxis = {\n timezone: dashboard.getTimezone(),\n show: panel.xaxis.show,\n mode: null,\n min: 0,\n max: ticks.length + 1,\n label: 'Datetime',\n ticks: ticks,\n };\n }\n function addXHistogramAxis(options, bucketSize) {\n var ticks, min, max;\n var defaultTicks = panelWidth / 50;\n if (data.length && bucketSize) {\n var tick_values = [];\n for (var _i = 0, data_1 = data; _i < data_1.length; _i++) {\n var d = data_1[_i];\n for (var _a = 0, _b = d.data; _a < _b.length; _a++) {\n var point = _b[_a];\n tick_values[point[0]] = true;\n }\n }\n ticks = Object.keys(tick_values).map(function (v) { return Number(v); });\n min = __WEBPACK_IMPORTED_MODULE_10_lodash___default.a.min(ticks);\n max = __WEBPACK_IMPORTED_MODULE_10_lodash___default.a.max(ticks);\n // Adjust tick step\n var tickStep_1 = bucketSize;\n var ticks_num = Math.floor((max - min) / tickStep_1);\n while (ticks_num > defaultTicks) {\n tickStep_1 = tickStep_1 * 2;\n ticks_num = Math.ceil((max - min) / tickStep_1);\n }\n // Expand ticks for pretty view\n min = Math.floor(min / tickStep_1) * tickStep_1;\n // 1.01 is 101% - ensure we have enough space for last bar\n max = Math.ceil(max * 1.01 / tickStep_1) * tickStep_1;\n ticks = [];\n for (var i = min; i <= max; i += tickStep_1) {\n ticks.push(i);\n }\n }\n else {\n // Set defaults if no data\n ticks = defaultTicks / 2;\n min = 0;\n max = 1;\n }\n options.xaxis = {\n timezone: dashboard.getTimezone(),\n show: panel.xaxis.show,\n mode: null,\n min: min,\n max: max,\n label: 'Histogram',\n ticks: ticks,\n };\n // Use 'short' format for histogram values\n configureAxisMode(options.xaxis, 'short');\n }\n function addXTableAxis(options) {\n var ticks = __WEBPACK_IMPORTED_MODULE_10_lodash___default.a.map(data, function (series, seriesIndex) {\n return __WEBPACK_IMPORTED_MODULE_10_lodash___default.a.map(series.datapoints, function (point, pointIndex) {\n var tickIndex = seriesIndex * series.datapoints.length + pointIndex;\n return [tickIndex + 1, point[1]];\n });\n });\n ticks = __WEBPACK_IMPORTED_MODULE_10_lodash___default.a.flatten(ticks, true);\n options.xaxis = {\n timezone: dashboard.getTimezone(),\n show: panel.xaxis.show,\n mode: null,\n min: 0,\n max: ticks.length + 1,\n label: 'Datetime',\n ticks: ticks,\n };\n }\n function configureYAxisOptions(data, options) {\n var defaults = {\n position: 'left',\n show: panel.yaxes[0].show,\n index: 1,\n logBase: panel.yaxes[0].logBase || 1,\n min: parseNumber(panel.yaxes[0].min),\n max: parseNumber(panel.yaxes[0].max),\n tickDecimals: panel.yaxes[0].decimals,\n };\n options.yaxes.push(defaults);\n if (__WEBPACK_IMPORTED_MODULE_10_lodash___default.a.find(data, { yaxis: 2 })) {\n var secondY = __WEBPACK_IMPORTED_MODULE_10_lodash___default.a.clone(defaults);\n secondY.index = 2;\n secondY.show = panel.yaxes[1].show;\n secondY.logBase = panel.yaxes[1].logBase || 1;\n secondY.position = 'right';\n secondY.min = parseNumber(panel.yaxes[1].min);\n secondY.max = parseNumber(panel.yaxes[1].max);\n secondY.tickDecimals = panel.yaxes[1].decimals;\n options.yaxes.push(secondY);\n applyLogScale(options.yaxes[1], data);\n configureAxisMode(options.yaxes[1], panel.percentage && panel.stack ? 'percent' : panel.yaxes[1].format);\n }\n applyLogScale(options.yaxes[0], data);\n configureAxisMode(options.yaxes[0], panel.percentage && panel.stack ? 'percent' : panel.yaxes[0].format);\n }\n function parseNumber(value) {\n if (value === null || typeof value === 'undefined') {\n return null;\n }\n return __WEBPACK_IMPORTED_MODULE_10_lodash___default.a.toNumber(value);\n }\n function applyLogScale(axis, data) {\n if (axis.logBase === 1) {\n return;\n }\n var minSetToZero = axis.min === 0;\n if (axis.min < Number.MIN_VALUE) {\n axis.min = null;\n }\n if (axis.max < Number.MIN_VALUE) {\n axis.max = null;\n }\n var series, i;\n var max = axis.max, min = axis.min;\n for (i = 0; i < data.length; i++) {\n series = data[i];\n if (series.yaxis === axis.index) {\n if (!max || max < series.stats.max) {\n max = series.stats.max;\n }\n if (!min || min > series.stats.logmin) {\n min = series.stats.logmin;\n }\n }\n }\n axis.transform = function (v) {\n return v < Number.MIN_VALUE ? null : Math.log(v) / Math.log(axis.logBase);\n };\n axis.inverseTransform = function (v) {\n return Math.pow(axis.logBase, v);\n };\n if (!max && !min) {\n max = axis.inverseTransform(+2);\n min = axis.inverseTransform(-2);\n }\n else if (!max) {\n max = min * axis.inverseTransform(+4);\n }\n else if (!min) {\n min = max * axis.inverseTransform(-4);\n }\n if (axis.min) {\n min = axis.inverseTransform(Math.ceil(axis.transform(axis.min)));\n }\n else {\n min = axis.min = axis.inverseTransform(Math.floor(axis.transform(min)));\n }\n if (axis.max) {\n max = axis.inverseTransform(Math.floor(axis.transform(axis.max)));\n }\n else {\n max = axis.max = axis.inverseTransform(Math.ceil(axis.transform(max)));\n }\n if (!min || min < Number.MIN_VALUE || !max || max < Number.MIN_VALUE) {\n return;\n }\n if (Number.isFinite(min) && Number.isFinite(max)) {\n if (minSetToZero) {\n axis.min = 0.1;\n min = 1;\n }\n axis.ticks = generateTicksForLogScaleYAxis(min, max, axis.logBase);\n if (minSetToZero) {\n axis.ticks.unshift(0.1);\n }\n if (axis.ticks[axis.ticks.length - 1] > axis.max) {\n axis.max = axis.ticks[axis.ticks.length - 1];\n }\n }\n else {\n axis.ticks = [1, 2];\n delete axis.min;\n delete axis.max;\n }\n }\n function generateTicksForLogScaleYAxis(min, max, logBase) {\n var ticks = [];\n var nextTick;\n for (nextTick = min; nextTick <= max; nextTick *= logBase) {\n ticks.push(nextTick);\n }\n var maxNumTicks = Math.ceil(ctrl.height / 25);\n var numTicks = ticks.length;\n if (numTicks > maxNumTicks) {\n var factor = Math.ceil(numTicks / maxNumTicks) * logBase;\n ticks = [];\n for (nextTick = min; nextTick <= max * factor; nextTick *= factor) {\n ticks.push(nextTick);\n }\n }\n return ticks;\n }\n function configureAxisMode(axis, format) {\n axis.tickFormatter = function (val, axis) {\n if (!__WEBPACK_IMPORTED_MODULE_12_app_core_utils_kbn__[\"a\" /* default */].valueFormats[format]) {\n throw new Error(\"Unit '\" + format + \"' is not supported\");\n }\n return __WEBPACK_IMPORTED_MODULE_12_app_core_utils_kbn__[\"a\" /* default */].valueFormats[format](val, axis.tickDecimals, axis.scaledDecimals);\n };\n }\n function time_format(ticks, min, max) {\n if (min && max && ticks) {\n var range = max - min;\n var secPerTick = range / ticks / 1000;\n var oneDay = 86400000;\n var oneYear = 31536000000;\n if (secPerTick <= 45) {\n return '%H:%M:%S';\n }\n if (secPerTick <= 7200 || range <= oneDay) {\n return '%H:%M';\n }\n if (secPerTick <= 80000) {\n return '%m/%d %H:%M';\n }\n if (secPerTick <= 2419200 || range <= oneYear) {\n return '%m/%d';\n }\n return '%Y-%m';\n }\n return '%H:%M';\n }\n elem.bind('plotselected', function (event, ranges) {\n if (panel.xaxis.mode !== 'time') {\n // Skip if panel in histogram or series mode\n plot.clearSelection();\n return;\n }\n if ((ranges.ctrlKey || ranges.metaKey) && (dashboard.meta.canEdit || dashboard.meta.canMakeEditable)) {\n // Add annotation\n setTimeout(function () {\n eventManager.updateTime(ranges.xaxis);\n }, 100);\n }\n else {\n scope.$apply(function () {\n timeSrv.setTime({\n from: __WEBPACK_IMPORTED_MODULE_11_moment___default.a.utc(ranges.xaxis.from),\n to: __WEBPACK_IMPORTED_MODULE_11_moment___default.a.utc(ranges.xaxis.to),\n });\n });\n }\n });\n elem.bind('plotclick', function (event, pos, item) {\n if (panel.xaxis.mode !== 'time') {\n // Skip if panel in histogram or series mode\n return;\n }\n if ((pos.ctrlKey || pos.metaKey) && (dashboard.meta.canEdit || dashboard.meta.canMakeEditable)) {\n // Skip if range selected (added in \"plotselected\" event handler)\n var isRangeSelection = pos.x !== pos.x1;\n if (!isRangeSelection) {\n setTimeout(function () {\n eventManager.updateTime({ from: pos.x, to: null });\n }, 100);\n }\n }\n });\n scope.$on('$destroy', function () {\n tooltip.destroy();\n elem.off();\n elem.remove();\n });\n },\n };\n}\n__WEBPACK_IMPORTED_MODULE_14_app_core_core__[\"d\" /* coreModule */].directive('grafanaGraph', graphDirective);\n\n\n/***/ }),\n\n/***/ 2137:\n/***/ (function(module, exports, __webpack_require__) {\n\nvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [\n __webpack_require__(17),\n __webpack_require__(4),\n __webpack_require__(27),\n __webpack_require__(111),\n], __WEBPACK_AMD_DEFINE_RESULT__ = (function ($, _, angular, Drop) {\n 'use strict';\n\n function createAnnotationToolip(element, event, plot, events) {\n var injector = angular.element(document).injector();\n var content = document.createElement('div');\n content.innerHTML = '';\n\n injector.invoke([\"$compile\", \"$rootScope\", function($compile, $rootScope) {\n var eventManager = plot.getOptions().events.manager;\n var tmpScope = $rootScope.$new(true);\n tmpScope.event = event;\n tmpScope.events = events;\n tmpScope.plot = plot;\n tmpScope.onEdit = function() {\n eventManager.editEvent(event);\n };\n\n $compile(content)(tmpScope);\n tmpScope.$digest();\n tmpScope.$destroy();\n\n var drop = new Drop({\n target: element[0],\n content: content,\n position: \"bottom center\",\n classes: 'drop-popover drop-popover--annotation',\n openOn: 'hover',\n hoverCloseDelay: 200,\n tetherOptions: {\n constraints: [{to: 'window', pin: true, attachment: \"both\"}]\n }\n });\n\n drop.open();\n\n drop.on('close', function() {\n setTimeout(function() {\n drop.destroy();\n });\n });\n }]);\n }\n\n var markerElementToAttachTo = null;\n\n function createEditPopover(element, event, plot) {\n var eventManager = plot.getOptions().events.manager;\n if (eventManager.editorOpen) {\n // update marker element to attach to (needed in case of legend on the right\n // when there is a double render pass and the initial marker element is removed)\n markerElementToAttachTo = element;\n return;\n }\n\n // mark as openend\n eventManager.editorOpened();\n // set marker element to attache to\n markerElementToAttachTo = element;\n\n // wait for element to be attached and positioned\n setTimeout(function() {\n\n var injector = angular.element(document).injector();\n var content = document.createElement('div');\n content.innerHTML = '';\n\n injector.invoke([\"$compile\", \"$rootScope\", function($compile, $rootScope) {\n var scope = $rootScope.$new(true);\n var drop;\n\n scope.event = event;\n scope.panelCtrl = eventManager.panelCtrl;\n scope.close = function() {\n drop.close();\n };\n\n $compile(content)(scope);\n scope.$digest();\n\n drop = new Drop({\n target: markerElementToAttachTo[0],\n content: content,\n position: \"bottom center\",\n classes: 'drop-popover drop-popover--form',\n openOn: 'click',\n tetherOptions: {\n constraints: [{to: 'window', pin: true, attachment: \"both\"}]\n }\n });\n\n drop.open();\n eventManager.editorOpened();\n\n drop.on('close', function() {\n // need timeout here in order call drop.destroy\n setTimeout(function() {\n eventManager.editorClosed();\n scope.$destroy();\n drop.destroy();\n });\n });\n }]);\n\n }, 100);\n }\n\n /*\n * jquery.flot.events\n *\n * description: Flot plugin for adding events/markers to the plot\n * version: 0.2.5\n * authors:\n * Alexander Wunschik \n * Joel Oughton \n * Nicolas Joseph \n *\n * website: https://github.com/mojoaxel/flot-events\n *\n * released under MIT License and GPLv2+\n */\n\n /**\n * A class that allows for the drawing an remove of some object\n */\n var DrawableEvent = function(object, drawFunc, clearFunc, moveFunc, left, top, width, height) {\n var _object = object;\n var\t_drawFunc = drawFunc;\n var\t_clearFunc = clearFunc;\n var\t_moveFunc = moveFunc;\n var\t_position = { left: left, top: top };\n var\t_width = width;\n var\t_height = height;\n\n this.width = function() { return _width; };\n this.height = function() { return _height; };\n this.position = function() { return _position; };\n this.draw = function() { _drawFunc(_object); };\n this.clear = function() { _clearFunc(_object); };\n this.getObject = function() { return _object; };\n this.moveTo = function(position) {\n _position = position;\n _moveFunc(_object, _position);\n };\n };\n\n /**\n * Event class that stores options (eventType, min, max, title, description) and the object to draw.\n */\n var VisualEvent = function(options, drawableEvent) {\n var _parent;\n var _options = options;\n var _drawableEvent = drawableEvent;\n var _hidden = false;\n\n this.visual = function() { return _drawableEvent; };\n this.getOptions = function() { return _options; };\n this.getParent = function() { return _parent; };\n this.isHidden = function() { return _hidden; };\n this.hide = function() { _hidden = true; };\n this.unhide = function() { _hidden = false; };\n };\n\n /**\n * A Class that handles the event-markers inside the given plot\n */\n var EventMarkers = function(plot) {\n var _events = [];\n\n this._types = [];\n this._plot = plot;\n this.eventsEnabled = false;\n\n this.getEvents = function() {\n return _events;\n };\n\n this.setTypes = function(types) {\n return this._types = types;\n };\n\n /**\n * create internal objects for the given events\n */\n this.setupEvents = function(events) {\n var that = this;\n var parts = _.partition(events, 'isRegion');\n var regions = parts[0];\n events = parts[1];\n\n $.each(events, function(index, event) {\n var ve = new VisualEvent(event, that._buildDiv(event, events));\n _events.push(ve);\n });\n\n $.each(regions, function (index, event) {\n var vre = new VisualEvent(event, that._buildRegDiv(event));\n _events.push(vre);\n });\n\n _events.sort(function(a, b) {\n var ao = a.getOptions(), bo = b.getOptions();\n if (ao.min > bo.min) { return 1; }\n if (ao.min < bo.min) { return -1; }\n return 0;\n });\n };\n\n /**\n * draw the events to the plot\n */\n this.drawEvents = function() {\n var that = this;\n // var o = this._plot.getPlotOffset();\n\n $.each(_events, function(index, event) {\n // check event is inside the graph range\n if (that._insidePlot(event.getOptions().min) && !event.isHidden()) {\n event.visual().draw();\n } else {\n event.visual().getObject().hide();\n }\n });\n };\n\n /**\n * update the position of the event-markers (e.g. after scrolling or zooming)\n */\n this.updateEvents = function() {\n var that = this;\n var o = this._plot.getPlotOffset(), left, top;\n var xaxis = this._plot.getXAxes()[this._plot.getOptions().events.xaxis - 1];\n\n $.each(_events, function(index, event) {\n top = o.top + that._plot.height() - event.visual().height();\n left = xaxis.p2c(event.getOptions().min) + o.left - event.visual().width() / 2;\n event.visual().moveTo({ top: top, left: left });\n });\n };\n\n /**\n * remove all events from the plot\n */\n this._clearEvents = function() {\n $.each(_events, function(index, val) {\n val.visual().clear();\n });\n _events = [];\n };\n\n /**\n * create a DOM element for the given event\n */\n this._buildDiv = function(event, events) {\n var that = this;\n\n var container = this._plot.getPlaceholder();\n var o = this._plot.getPlotOffset();\n var axes = this._plot.getAxes();\n var xaxis = this._plot.getXAxes()[this._plot.getOptions().events.xaxis - 1];\n var yaxis, top, left, color, markerSize, markerShow, lineStyle, lineWidth;\n var markerTooltip;\n\n // determine the y axis used\n if (axes.yaxis && axes.yaxis.used) { yaxis = axes.yaxis; }\n if (axes.yaxis2 && axes.yaxis2.used) { yaxis = axes.yaxis2; }\n\n // map the eventType to a types object\n var eventTypeId = event.eventType;\n\n if (this._types === null || !this._types[eventTypeId] || !this._types[eventTypeId].color) {\n color = '#666';\n } else {\n color = this._types[eventTypeId].color;\n }\n\n if (this._types === null || !this._types[eventTypeId] || !this._types[eventTypeId].markerSize) {\n markerSize = 8; //default marker size\n } else {\n markerSize = this._types[eventTypeId].markerSize;\n }\n\n if (this._types === null || !this._types[eventTypeId] || this._types[eventTypeId].markerShow === undefined) {\n markerShow = true;\n } else {\n markerShow = this._types[eventTypeId].markerShow;\n }\n\n if (this._types === null || !this._types[eventTypeId] || this._types[eventTypeId].markerTooltip === undefined) {\n markerTooltip = true;\n } else {\n markerTooltip = this._types[eventTypeId].markerTooltip;\n }\n\n if (this._types == null || !this._types[eventTypeId] || !this._types[eventTypeId].lineStyle) {\n lineStyle = 'dashed'; //default line style\n } else {\n lineStyle = this._types[eventTypeId].lineStyle.toLowerCase();\n }\n\n if (this._types == null || !this._types[eventTypeId] || this._types[eventTypeId].lineWidth === undefined) {\n lineWidth = 1; //default line width\n } else {\n lineWidth = this._types[eventTypeId].lineWidth;\n }\n\n var topOffset = xaxis.options.eventSectionHeight || 0;\n topOffset = topOffset / 3;\n\n top = o.top + this._plot.height() + topOffset;\n left = xaxis.p2c(event.min) + o.left;\n\n var line = $('
').css({\n \"position\": \"absolute\",\n \"opacity\": 0.8,\n \"left\": left + 'px',\n \"top\": 8,\n \"width\": lineWidth + \"px\",\n \"height\": this._plot.height() + topOffset * 0.8,\n \"border-left-width\": lineWidth + \"px\",\n \"border-left-style\": lineStyle,\n \"border-left-color\": color,\n \"color\": color\n })\n .appendTo(container);\n\n if (markerShow) {\n var marker = $('
').css({\n \"position\": \"absolute\",\n \"left\": (-markerSize - Math.round(lineWidth / 2)) + \"px\",\n \"font-size\": 0,\n \"line-height\": 0,\n \"width\": 0,\n \"height\": 0,\n \"border-left\": markerSize+\"px solid transparent\",\n \"border-right\": markerSize+\"px solid transparent\"\n });\n\n marker.appendTo(line);\n\n if (this._types[eventTypeId] && this._types[eventTypeId].position && this._types[eventTypeId].position.toUpperCase() === 'BOTTOM') {\n marker.css({\n \"top\": top-markerSize-8 +\"px\",\n \"border-top\": \"none\",\n \"border-bottom\": markerSize+\"px solid \" + color\n });\n } else {\n marker.css({\n \"top\": \"0px\",\n \"border-top\": markerSize+\"px solid \" + color,\n \"border-bottom\": \"none\"\n });\n }\n\n marker.data({\n \"event\": event\n });\n\n var mouseenter = function() {\n createAnnotationToolip(marker, $(this).data(\"event\"), that._plot, events);\n };\n\n if (event.editModel) {\n createEditPopover(marker, event.editModel, that._plot);\n }\n\n var mouseleave = function() {\n that._plot.clearSelection();\n };\n\n if (markerTooltip) {\n marker.css({ \"cursor\": \"help\" });\n marker.hover(mouseenter, mouseleave);\n }\n }\n\n var drawableEvent = new DrawableEvent(\n line,\n function drawFunc(obj) { obj.show(); },\n function(obj) { obj.remove(); },\n function(obj, position) {\n obj.css({\n top: position.top,\n left: position.left\n });\n },\n left,\n top,\n line.width(),\n line.height()\n );\n\n return drawableEvent;\n };\n\n /**\n * create a DOM element for the given region\n */\n this._buildRegDiv = function (event) {\n var that = this;\n\n var container = this._plot.getPlaceholder();\n var o = this._plot.getPlotOffset();\n var axes = this._plot.getAxes();\n var xaxis = this._plot.getXAxes()[this._plot.getOptions().events.xaxis - 1];\n var yaxis, top, left, lineWidth, regionWidth, lineStyle, color, markerTooltip;\n\n // determine the y axis used\n if (axes.yaxis && axes.yaxis.used) { yaxis = axes.yaxis; }\n if (axes.yaxis2 && axes.yaxis2.used) { yaxis = axes.yaxis2; }\n\n // map the eventType to a types object\n var eventTypeId = event.eventType;\n\n if (this._types === null || !this._types[eventTypeId] || !this._types[eventTypeId].color) {\n color = '#666';\n } else {\n color = this._types[eventTypeId].color;\n }\n\n if (this._types === null || !this._types[eventTypeId] || this._types[eventTypeId].markerTooltip === undefined) {\n markerTooltip = true;\n } else {\n markerTooltip = this._types[eventTypeId].markerTooltip;\n }\n\n if (this._types == null || !this._types[eventTypeId] || this._types[eventTypeId].lineWidth === undefined) {\n lineWidth = 1; //default line width\n } else {\n lineWidth = this._types[eventTypeId].lineWidth;\n }\n\n if (this._types == null || !this._types[eventTypeId] || !this._types[eventTypeId].lineStyle) {\n lineStyle = 'dashed'; //default line style\n } else {\n lineStyle = this._types[eventTypeId].lineStyle.toLowerCase();\n }\n\n var topOffset = 2;\n top = o.top + this._plot.height() + topOffset;\n\n var timeFrom = Math.min(event.min, event.timeEnd);\n var timeTo = Math.max(event.min, event.timeEnd);\n left = xaxis.p2c(timeFrom) + o.left;\n var right = xaxis.p2c(timeTo) + o.left;\n regionWidth = right - left;\n\n _.each([left, right], function(position) {\n var line = $('
').css({\n \"position\": \"absolute\",\n \"opacity\": 0.8,\n \"left\": position + 'px',\n \"top\": 8,\n \"width\": lineWidth + \"px\",\n \"height\": that._plot.height() + topOffset,\n \"border-left-width\": lineWidth + \"px\",\n \"border-left-style\": lineStyle,\n \"border-left-color\": color,\n \"color\": color\n });\n line.appendTo(container);\n });\n\n var region = $('
').css({\n \"position\": \"absolute\",\n \"opacity\": 0.5,\n \"left\": left + 'px',\n \"top\": top,\n \"width\": Math.round(regionWidth + lineWidth) + \"px\",\n \"height\": \"0.5rem\",\n \"border-left-color\": color,\n \"color\": color,\n \"background-color\": color\n });\n region.appendTo(container);\n\n region.data({\n \"event\": event\n });\n\n var mouseenter = function () {\n createAnnotationToolip(region, $(this).data(\"event\"), that._plot);\n };\n\n if (event.editModel) {\n createEditPopover(region, event.editModel, that._plot);\n }\n\n var mouseleave = function () {\n that._plot.clearSelection();\n };\n\n if (markerTooltip) {\n region.css({ \"cursor\": \"help\" });\n region.hover(mouseenter, mouseleave);\n }\n\n var drawableEvent = new DrawableEvent(\n region,\n function drawFunc(obj) { obj.show(); },\n function (obj) { obj.remove(); },\n function (obj, position) {\n obj.css({\n top: position.top,\n left: position.left\n });\n },\n left,\n top,\n region.width(),\n region.height()\n );\n\n return drawableEvent;\n };\n\n /**\n * check if the event is inside visible range\n */\n this._insidePlot = function(x) {\n var xaxis = this._plot.getXAxes()[this._plot.getOptions().events.xaxis - 1];\n var xc = xaxis.p2c(x);\n return xc > 0 && xc < xaxis.p2c(xaxis.max);\n };\n };\n\n /**\n * initialize the plugin for the given plot\n */\n function init(plot) {\n /*jshint validthis:true */\n var that = this;\n var eventMarkers = new EventMarkers(plot);\n\n plot.getEvents = function() {\n return eventMarkers._events;\n };\n\n plot.hideEvents = function() {\n $.each(eventMarkers._events, function(index, event) {\n event.visual().getObject().hide();\n });\n };\n\n plot.showEvents = function() {\n plot.hideEvents();\n $.each(eventMarkers._events, function(index, event) {\n event.hide();\n });\n\n that.eventMarkers.drawEvents();\n };\n\n // change events on an existing plot\n plot.setEvents = function(events) {\n if (eventMarkers.eventsEnabled) {\n eventMarkers.setupEvents(events);\n }\n };\n\n plot.hooks.processOptions.push(function(plot, options) {\n // enable the plugin\n if (options.events.data != null) {\n eventMarkers.eventsEnabled = true;\n }\n });\n\n plot.hooks.draw.push(function(plot) {\n var options = plot.getOptions();\n\n if (eventMarkers.eventsEnabled) {\n // check for first run\n if (eventMarkers.getEvents().length < 1) {\n eventMarkers.setTypes(options.events.types);\n eventMarkers.setupEvents(options.events.data);\n } else {\n eventMarkers.updateEvents();\n }\n }\n\n eventMarkers.drawEvents();\n });\n }\n\n var defaultOptions = {\n events: {\n data: null,\n types: null,\n xaxis: 1,\n position: 'BOTTOM'\n }\n };\n\n $.plot.plugins.push({\n init: init,\n options: defaultOptions,\n name: \"events\",\n version: \"0.2.5\"\n });\n}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\n\n/***/ }),\n\n/***/ 2138:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = GraphTooltip;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery__ = __webpack_require__(17);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_jquery__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_core__ = __webpack_require__(197);\n\n\nfunction GraphTooltip(elem, dashboard, scope, getSeriesFn) {\n var self = this;\n var ctrl = scope.ctrl;\n var panel = ctrl.panel;\n var $tooltip = __WEBPACK_IMPORTED_MODULE_0_jquery___default()('
');\n this.destroy = function () {\n $tooltip.remove();\n };\n this.findHoverIndexFromDataPoints = function (posX, series, last) {\n var ps = series.datapoints.pointsize;\n var initial = last * ps;\n var len = series.datapoints.points.length;\n var j;\n for (j = initial; j < len; j += ps) {\n // Special case of a non stepped line, highlight the very last point just before a null point\n if ((!series.lines.steps && series.datapoints.points[initial] != null && series.datapoints.points[j] == null) ||\n //normal case\n series.datapoints.points[j] > posX) {\n return Math.max(j - ps, 0) / ps;\n }\n }\n return j / ps - 1;\n };\n this.findHoverIndexFromData = function (posX, series) {\n var lower = 0;\n var upper = series.data.length - 1;\n var middle;\n while (true) {\n if (lower > upper) {\n return Math.max(upper, 0);\n }\n middle = Math.floor((lower + upper) / 2);\n if (series.data[middle][0] === posX) {\n return middle;\n }\n else if (series.data[middle][0] < posX) {\n lower = middle + 1;\n }\n else {\n upper = middle - 1;\n }\n }\n };\n this.renderAndShow = function (time, innerHtml, pos, xMode) {\n if (xMode === 'time') {\n innerHtml = '
' + time + '
' + innerHtml;\n }\n $tooltip.html(innerHtml).place_tt(pos.pageX + 20, pos.pageY);\n };\n this.getMultiSeriesPlotHoverInfo = function (seriesList, pos) {\n var value, i, series, hoverIndex, hoverDistance, pointTime, yaxis;\n // 3 sub-arrays, 1st for hidden series, 2nd for left yaxis, 3rd for right yaxis.\n var results = [[], [], []];\n //now we know the current X (j) position for X and Y values\n var last_value = 0; //needed for stacked values\n var minDistance, minTime;\n for (i = 0; i < seriesList.length; i++) {\n series = seriesList[i];\n if (!series.data.length || (panel.legend.hideEmpty && series.allIsNull)) {\n // Init value so that it does not brake series sorting\n results[0].push({ hidden: true, value: 0 });\n continue;\n }\n if (!series.data.length || (panel.legend.hideZero && series.allIsZero)) {\n // Init value so that it does not brake series sorting\n results[0].push({ hidden: true, value: 0 });\n continue;\n }\n hoverIndex = this.findHoverIndexFromData(pos.x, series);\n hoverDistance = pos.x - series.data[hoverIndex][0];\n pointTime = series.data[hoverIndex][0];\n // Take the closest point before the cursor, or if it does not exist, the closest after\n if (!minDistance ||\n (hoverDistance >= 0 && (hoverDistance < minDistance || minDistance < 0)) ||\n (hoverDistance < 0 && hoverDistance > minDistance)) {\n minDistance = hoverDistance;\n minTime = pointTime;\n }\n if (series.stack) {\n if (panel.tooltip.value_type === 'individual') {\n value = series.data[hoverIndex][1];\n }\n else if (!series.stack) {\n value = series.data[hoverIndex][1];\n }\n else {\n last_value += series.data[hoverIndex][1];\n value = last_value;\n }\n }\n else {\n value = series.data[hoverIndex][1];\n }\n // Highlighting multiple Points depending on the plot type\n if (series.lines.steps || series.stack) {\n // stacked and steppedLine plots can have series with different length.\n // Stacked series can increase its length on each new stacked serie if null points found,\n // to speed the index search we begin always on the last found hoverIndex.\n hoverIndex = this.findHoverIndexFromDataPoints(pos.x, series, hoverIndex);\n }\n // Be sure we have a yaxis so that it does not brake series sorting\n yaxis = 0;\n if (series.yaxis) {\n yaxis = series.yaxis.n;\n }\n results[yaxis].push({\n value: value,\n hoverIndex: hoverIndex,\n color: series.color,\n label: series.aliasEscaped,\n time: pointTime,\n distance: hoverDistance,\n index: i,\n });\n }\n // Contat the 3 sub-arrays\n results = results[0].concat(results[1], results[2]);\n // Time of the point closer to pointer\n results.time = minTime;\n return results;\n };\n elem.mouseleave(function () {\n if (panel.tooltip.shared) {\n var plot = elem.data().plot;\n if (plot) {\n $tooltip.detach();\n plot.unhighlight();\n }\n }\n __WEBPACK_IMPORTED_MODULE_1_app_core_core__[\"b\" /* appEvents */].emit('graph-hover-clear');\n });\n elem.bind('plothover', function (event, pos, item) {\n self.show(pos, item);\n // broadcast to other graph panels that we are hovering!\n pos.panelRelY = (pos.pageY - elem.offset().top) / elem.height();\n __WEBPACK_IMPORTED_MODULE_1_app_core_core__[\"b\" /* appEvents */].emit('graph-hover', { pos: pos, panel: panel });\n });\n elem.bind('plotclick', function (event, pos, item) {\n __WEBPACK_IMPORTED_MODULE_1_app_core_core__[\"b\" /* appEvents */].emit('graph-click', { pos: pos, panel: panel, item: item });\n });\n this.clear = function (plot) {\n $tooltip.detach();\n plot.clearCrosshair();\n plot.unhighlight();\n };\n this.show = function (pos, item) {\n var plot = elem.data().plot;\n var plotData = plot.getData();\n var xAxes = plot.getXAxes();\n var xMode = xAxes[0].options.mode;\n var seriesList = getSeriesFn();\n var allSeriesMode = panel.tooltip.shared;\n var group, value, absoluteTime, hoverInfo, i, series, seriesHtml, tooltipFormat;\n // if panelRelY is defined another panel wants us to show a tooltip\n // get pageX from position on x axis and pageY from relative position in original panel\n if ('panelRelY' in pos) {\n var pointOffset = plot.pointOffset({ x: pos.x });\n if (Number.isNaN(pointOffset.left) || pointOffset.left < 0 || pointOffset.left > elem.width()) {\n self.clear(plot);\n return;\n }\n pos.pageX = elem.offset().left + pointOffset.left;\n pos.pageY = elem.offset().top + elem.height() * pos.panelRelY;\n var isVisible = pos.pageY >= __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).scrollTop() && pos.pageY <= __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).innerHeight() + __WEBPACK_IMPORTED_MODULE_0_jquery___default()(window).scrollTop();\n if (!isVisible) {\n self.clear(plot);\n return;\n }\n plot.setCrosshair(pos);\n allSeriesMode = true;\n if (dashboard.sharedCrosshairModeOnly()) {\n // if only crosshair mode we are done\n return;\n }\n }\n if (seriesList.length === 0) {\n return;\n }\n if (seriesList[0].hasMsResolution) {\n tooltipFormat = 'YYYY-MM-DD HH:mm:ss.SSS';\n }\n else {\n tooltipFormat = 'YYYY-MM-DD HH:mm:ss';\n }\n if (allSeriesMode) {\n plot.unhighlight();\n var seriesHoverInfo = self.getMultiSeriesPlotHoverInfo(plotData, pos);\n seriesHtml = '';\n var tZeroFormatter = function (val) {\n var prefix = val === 0 ? 'T=' : val < 0 ? 'T-' : 'T+';\n return prefix + Math.abs(val) / 1000;\n };\n absoluteTime = panel.xaxis.tzero\n ? tZeroFormatter(seriesHoverInfo.time)\n : dashboard.formatDate(seriesHoverInfo.time, tooltipFormat);\n // Dynamically reorder the hovercard for the current time point if the\n // option is enabled.\n if (panel.tooltip.sort === 2) {\n seriesHoverInfo.sort(function (a, b) {\n return b.value - a.value;\n });\n }\n else if (panel.tooltip.sort === 1) {\n seriesHoverInfo.sort(function (a, b) {\n return a.value - b.value;\n });\n }\n for (i = 0; i < seriesHoverInfo.length; i++) {\n hoverInfo = seriesHoverInfo[i];\n if (hoverInfo.hidden) {\n continue;\n }\n var highlightClass = '';\n if (item && hoverInfo.index === item.seriesIndex) {\n highlightClass = 'graph-tooltip-list-item--highlight';\n }\n series = seriesList[hoverInfo.index];\n value = series.formatValue(hoverInfo.value);\n seriesHtml +=\n '
';\n seriesHtml +=\n ' ' + hoverInfo.label + ':
';\n seriesHtml += '
' + value + '
';\n plot.highlight(hoverInfo.index, hoverInfo.hoverIndex);\n }\n self.renderAndShow(absoluteTime, seriesHtml, pos, xMode);\n }\n else if (item) {\n // single series tooltip\n series = seriesList[item.seriesIndex];\n group = '
';\n group +=\n ' ' + series.aliasEscaped + ':
';\n if (panel.stack && panel.tooltip.value_type === 'individual') {\n value = item.datapoint[1] - item.datapoint[2];\n }\n else {\n value = item.datapoint[1];\n }\n value = series.formatValue(value);\n absoluteTime = dashboard.formatDate(item.datapoint[0], tooltipFormat);\n group += '
' + value + '
';\n self.renderAndShow(absoluteTime, group, pos, xMode);\n }\n else {\n // no hit\n $tooltip.detach();\n }\n };\n}\n\n\n/***/ }),\n\n/***/ 2139:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return ThresholdManager; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vendor_flot_jquery_flot__ = __webpack_require__(1985);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vendor_flot_jquery_flot___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vendor_flot_jquery_flot__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery__ = __webpack_require__(17);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_jquery__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash__);\n\n\n\nvar ThresholdManager = /** @class */ (function () {\n function ThresholdManager(panelCtrl) {\n this.panelCtrl = panelCtrl;\n }\n ThresholdManager.prototype.getHandleHtml = function (handleIndex, model, valueStr) {\n var stateClass = model.colorMode;\n if (model.colorMode === 'custom') {\n stateClass = 'critical';\n }\n return \"\\n
\\n
\\n
\\n
\\n \\n \" + valueStr + \"\\n
\\n
\";\n };\n ThresholdManager.prototype.initDragging = function (evt) {\n var handleElem = __WEBPACK_IMPORTED_MODULE_1_jquery___default()(evt.currentTarget).parents('.alert-handle-wrapper');\n var handleIndex = __WEBPACK_IMPORTED_MODULE_1_jquery___default()(evt.currentTarget).data('handleIndex');\n var lastY = null;\n var posTop;\n var plot = this.plot;\n var panelCtrl = this.panelCtrl;\n var model = this.thresholds[handleIndex];\n function dragging(evt) {\n if (lastY === null) {\n lastY = evt.clientY;\n }\n else {\n var diff = evt.clientY - lastY;\n posTop = posTop + diff;\n lastY = evt.clientY;\n handleElem.css({ top: posTop + diff });\n }\n }\n function stopped() {\n // calculate graph level\n var graphValue = plot.c2p({ left: 0, top: posTop }).y;\n graphValue = parseInt(graphValue.toFixed(0));\n model.value = graphValue;\n handleElem.off('mousemove', dragging);\n handleElem.off('mouseup', dragging);\n handleElem.off('mouseleave', dragging);\n // trigger digest and render\n panelCtrl.$scope.$apply(function () {\n panelCtrl.render();\n panelCtrl.events.emit('threshold-changed', {\n threshold: model,\n handleIndex: handleIndex,\n });\n });\n }\n lastY = null;\n posTop = handleElem.position().top;\n handleElem.on('mousemove', dragging);\n handleElem.on('mouseup', stopped);\n handleElem.on('mouseleave', stopped);\n };\n ThresholdManager.prototype.cleanUp = function () {\n this.placeholder.find('.alert-handle-wrapper').remove();\n this.needsCleanup = false;\n };\n ThresholdManager.prototype.renderHandle = function (handleIndex, defaultHandleTopPos) {\n var model = this.thresholds[handleIndex];\n var value = model.value;\n var valueStr = value;\n var handleTopPos = 0;\n // handle no value\n if (!__WEBPACK_IMPORTED_MODULE_2_lodash___default.a.isNumber(value)) {\n valueStr = '';\n handleTopPos = defaultHandleTopPos;\n }\n else {\n var valueCanvasPos = this.plot.p2c({ x: 0, y: value });\n handleTopPos = Math.round(Math.min(Math.max(valueCanvasPos.top, 0), this.height) - 6);\n }\n var handleElem = __WEBPACK_IMPORTED_MODULE_1_jquery___default()(this.getHandleHtml(handleIndex, model, valueStr));\n this.placeholder.append(handleElem);\n handleElem.toggleClass('alert-handle-wrapper--no-value', valueStr === '');\n handleElem.css({ top: handleTopPos });\n };\n ThresholdManager.prototype.shouldDrawHandles = function () {\n return !this.hasSecondYAxis && this.panelCtrl.editingThresholds && this.panelCtrl.panel.thresholds.length > 0;\n };\n ThresholdManager.prototype.prepare = function (elem, data) {\n this.hasSecondYAxis = false;\n for (var i = 0; i < data.length; i++) {\n if (data[i].yaxis > 1) {\n this.hasSecondYAxis = true;\n break;\n }\n }\n if (this.shouldDrawHandles()) {\n var thresholdMargin = this.panelCtrl.panel.thresholds.length > 1 ? '220px' : '110px';\n elem.css('margin-right', thresholdMargin);\n }\n else if (this.needsCleanup) {\n elem.css('margin-right', '0');\n }\n };\n ThresholdManager.prototype.draw = function (plot) {\n this.thresholds = this.panelCtrl.panel.thresholds;\n this.plot = plot;\n this.placeholder = plot.getPlaceholder();\n if (this.needsCleanup) {\n this.cleanUp();\n }\n if (!this.shouldDrawHandles()) {\n return;\n }\n this.height = plot.height();\n if (this.thresholds.length > 0) {\n this.renderHandle(0, 10);\n }\n if (this.thresholds.length > 1) {\n this.renderHandle(1, this.height - 30);\n }\n this.placeholder.off('mousedown', '.alert-handle');\n this.placeholder.on('mousedown', '.alert-handle', this.initDragging.bind(this));\n this.needsCleanup = true;\n };\n ThresholdManager.prototype.addFlotOptions = function (options, panel) {\n if (!panel.thresholds || panel.thresholds.length === 0) {\n return;\n }\n var gtLimit = Infinity;\n var ltLimit = -Infinity;\n var i, threshold, other;\n for (i = 0; i < panel.thresholds.length; i++) {\n threshold = panel.thresholds[i];\n if (!__WEBPACK_IMPORTED_MODULE_2_lodash___default.a.isNumber(threshold.value)) {\n continue;\n }\n var limit;\n switch (threshold.op) {\n case 'gt': {\n limit = gtLimit;\n // if next threshold is less then op and greater value, then use that as limit\n if (panel.thresholds.length > i + 1) {\n other = panel.thresholds[i + 1];\n if (other.value > threshold.value) {\n limit = other.value;\n ltLimit = limit;\n }\n }\n break;\n }\n case 'lt': {\n limit = ltLimit;\n // if next threshold is less then op and greater value, then use that as limit\n if (panel.thresholds.length > i + 1) {\n other = panel.thresholds[i + 1];\n if (other.value < threshold.value) {\n limit = other.value;\n gtLimit = limit;\n }\n }\n break;\n }\n }\n var fillColor, lineColor;\n switch (threshold.colorMode) {\n case 'critical': {\n fillColor = 'rgba(234, 112, 112, 0.12)';\n lineColor = 'rgba(237, 46, 24, 0.60)';\n break;\n }\n case 'warning': {\n fillColor = 'rgba(235, 138, 14, 0.12)';\n lineColor = 'rgba(247, 149, 32, 0.60)';\n break;\n }\n case 'ok': {\n fillColor = 'rgba(11, 237, 50, 0.090)';\n lineColor = 'rgba(6,163,69, 0.60)';\n break;\n }\n case 'custom': {\n fillColor = threshold.fillColor;\n lineColor = threshold.lineColor;\n break;\n }\n }\n // fill\n if (threshold.fill) {\n if (threshold.yaxis === 'right' && this.hasSecondYAxis) {\n options.grid.markings.push({\n y2axis: { from: threshold.value, to: limit },\n color: fillColor,\n });\n }\n else {\n options.grid.markings.push({\n yaxis: { from: threshold.value, to: limit },\n color: fillColor,\n });\n }\n }\n if (threshold.line) {\n if (threshold.yaxis === 'right' && this.hasSecondYAxis) {\n options.grid.markings.push({\n y2axis: { from: threshold.value, to: threshold.value },\n color: lineColor,\n });\n }\n else {\n options.grid.markings.push({\n yaxis: { from: threshold.value, to: threshold.value },\n color: lineColor,\n });\n }\n }\n }\n };\n return ThresholdManager;\n}());\n\n\n\n/***/ }),\n\n/***/ 2140:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export getSeriesValues */\n/* unused harmony export convertValuesToHistogram */\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = convertToHistogramData;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n\n/**\n * Convert series into array of series values.\n * @param data Array of series\n */\nfunction getSeriesValues(dataList) {\n var VALUE_INDEX = 0;\n var values = [];\n // Count histogam stats\n for (var i = 0; i < dataList.length; i++) {\n var series = dataList[i];\n var datapoints = series.datapoints;\n for (var j = 0; j < datapoints.length; j++) {\n if (datapoints[j][VALUE_INDEX] !== null) {\n values.push(datapoints[j][VALUE_INDEX]);\n }\n }\n }\n return values;\n}\n/**\n * Convert array of values into timeseries-like histogram:\n * [[val_1, count_1], [val_2, count_2], ..., [val_n, count_n]]\n * @param values\n * @param bucketSize\n */\nfunction convertValuesToHistogram(values, bucketSize, min, max) {\n var histogram = {};\n var minBound = getBucketBound(min, bucketSize);\n var maxBound = getBucketBound(max, bucketSize);\n var bound = minBound;\n var n = 0;\n while (bound <= maxBound) {\n histogram[bound] = 0;\n bound = minBound + bucketSize * n;\n n++;\n }\n for (var i = 0; i < values.length; i++) {\n var bound_1 = getBucketBound(values[i], bucketSize);\n histogram[bound_1] = histogram[bound_1] + 1;\n }\n var histogam_series = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(histogram, function (count, bound) {\n return [Number(bound), count];\n });\n // Sort by Y axis values\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.sortBy(histogam_series, function (point) { return point[0]; });\n}\n/**\n * Convert series into array of histogram data.\n * @param data Array of series\n * @param bucketSize\n */\nfunction convertToHistogramData(data, bucketSize, hiddenSeries, min, max) {\n return data.map(function (series) {\n var values = getSeriesValues([series]);\n series.histogram = true;\n if (!hiddenSeries[series.alias]) {\n var histogram = convertValuesToHistogram(values, bucketSize, min, max);\n series.data = histogram;\n }\n else {\n series.data = [];\n }\n return series;\n });\n}\nfunction getBucketBound(value, bucketSize) {\n return Math.floor(value / bucketSize) * bucketSize;\n}\n\n\n/***/ }),\n\n/***/ 2141:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = alignYLevel;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n\n/**\n * To align two Y axes by Y level\n * @param yAxes data [{min: min_y1, min: max_y1}, {min: min_y2, max: max_y2}]\n * @param level Y level\n */\nfunction alignYLevel(yAxes, level) {\n if (isNaN(level) || !checkCorrectAxis(yAxes)) {\n return;\n }\n var yLeft = yAxes[0], yRight = yAxes[1];\n moveLevelToZero(yLeft, yRight, level);\n expandStuckValues(yLeft, yRight);\n // one of graphs on zero\n var zero = yLeft.min === 0 || yRight.min === 0 || yLeft.max === 0 || yRight.max === 0;\n var oneSide = checkOneSide(yLeft, yRight);\n if (zero && oneSide) {\n yLeft.min = yLeft.max > 0 ? 0 : yLeft.min;\n yLeft.max = yLeft.max > 0 ? yLeft.max : 0;\n yRight.min = yRight.max > 0 ? 0 : yRight.min;\n yRight.max = yRight.max > 0 ? yRight.max : 0;\n }\n else {\n if (checkOppositeSides(yLeft, yRight)) {\n if (yLeft.min >= 0) {\n yLeft.min = -yLeft.max;\n yRight.max = -yRight.min;\n }\n else {\n yLeft.max = -yLeft.min;\n yRight.min = -yRight.max;\n }\n }\n else {\n var rate = getRate(yLeft, yRight);\n if (oneSide) {\n // all graphs above the Y level\n if (yLeft.min > 0) {\n yLeft.min = yLeft.max / rate;\n yRight.min = yRight.max / rate;\n }\n else {\n yLeft.max = yLeft.min / rate;\n yRight.max = yRight.min / rate;\n }\n }\n else {\n if (checkTwoCross(yLeft, yRight)) {\n yLeft.min = yRight.min ? yRight.min * rate : yLeft.min;\n yRight.min = yLeft.min ? yLeft.min / rate : yRight.min;\n yLeft.max = yRight.max ? yRight.max * rate : yLeft.max;\n yRight.max = yLeft.max ? yLeft.max / rate : yRight.max;\n }\n else {\n yLeft.min = yLeft.min > 0 ? yRight.min * rate : yLeft.min;\n yRight.min = yRight.min > 0 ? yLeft.min / rate : yRight.min;\n yLeft.max = yLeft.max < 0 ? yRight.max * rate : yLeft.max;\n yRight.max = yRight.max < 0 ? yLeft.max / rate : yRight.max;\n }\n }\n }\n }\n restoreLevelFromZero(yLeft, yRight, level);\n}\nfunction expandStuckValues(yLeft, yRight) {\n // wide Y min and max using increased wideFactor\n var wideFactor = 0.25;\n if (yLeft.max === yLeft.min) {\n yLeft.min -= wideFactor;\n yLeft.max += wideFactor;\n }\n if (yRight.max === yRight.min) {\n yRight.min -= wideFactor;\n yRight.max += wideFactor;\n }\n}\nfunction moveLevelToZero(yLeft, yRight, level) {\n if (level !== 0) {\n yLeft.min -= level;\n yLeft.max -= level;\n yRight.min -= level;\n yRight.max -= level;\n }\n}\nfunction restoreLevelFromZero(yLeft, yRight, level) {\n if (level !== 0) {\n yLeft.min += level;\n yLeft.max += level;\n yRight.min += level;\n yRight.max += level;\n }\n}\nfunction checkCorrectAxis(axis) {\n return axis.length === 2 && checkCorrectAxes(axis[0]) && checkCorrectAxes(axis[1]);\n}\nfunction checkCorrectAxes(axes) {\n return 'min' in axes && 'max' in axes;\n}\nfunction checkOneSide(yLeft, yRight) {\n // on the one hand with respect to zero\n return (yLeft.min >= 0 && yRight.min >= 0) || (yLeft.max <= 0 && yRight.max <= 0);\n}\nfunction checkTwoCross(yLeft, yRight) {\n // both across zero\n return yLeft.min <= 0 && yLeft.max >= 0 && yRight.min <= 0 && yRight.max >= 0;\n}\nfunction checkOppositeSides(yLeft, yRight) {\n // on the opposite sides with respect to zero\n return (yLeft.min >= 0 && yRight.max <= 0) || (yLeft.max <= 0 && yRight.min >= 0);\n}\nfunction getRate(yLeft, yRight) {\n var rateLeft, rateRight, rate;\n if (checkTwoCross(yLeft, yRight)) {\n rateLeft = yRight.min ? yLeft.min / yRight.min : 0;\n rateRight = yRight.max ? yLeft.max / yRight.max : 0;\n }\n else {\n if (checkOneSide(yLeft, yRight)) {\n var absLeftMin = Math.abs(yLeft.min);\n var absLeftMax = Math.abs(yLeft.max);\n var absRightMin = Math.abs(yRight.min);\n var absRightMax = Math.abs(yRight.max);\n var upLeft = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.max([absLeftMin, absLeftMax]);\n var downLeft = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.min([absLeftMin, absLeftMax]);\n var upRight = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.max([absRightMin, absRightMax]);\n var downRight = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.min([absRightMin, absRightMax]);\n rateLeft = downLeft ? upLeft / downLeft : upLeft;\n rateRight = downRight ? upRight / downRight : upRight;\n }\n else {\n if (yLeft.min > 0 || yRight.min > 0) {\n rateLeft = yLeft.max / yRight.max;\n rateRight = 0;\n }\n else {\n rateLeft = 0;\n rateRight = yLeft.min / yRight.min;\n }\n }\n }\n rate = rateLeft > rateRight ? rateLeft : rateRight;\n return rate;\n}\n\n\n/***/ }),\n\n/***/ 2142:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_jquery__ = __webpack_require__(17);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_jquery__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_baron__ = __webpack_require__(316);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_baron___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_baron__);\n\n\n\n\nvar module = __WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.directives');\nmodule.directive('graphLegend', [\"popoverSrv\", \"$timeout\", function (popoverSrv, $timeout) {\n return {\n link: function (scope, elem) {\n var firstRender = true;\n var ctrl = scope.ctrl;\n var panel = ctrl.panel;\n var data;\n var seriesList;\n var i;\n var legendScrollbar;\n var legendRightDefaultWidth = 10;\n var legendElem = elem.parent();\n scope.$on('$destroy', function () {\n destroyScrollbar();\n });\n ctrl.events.on('render-legend', function () {\n data = ctrl.seriesList;\n if (data) {\n render();\n }\n ctrl.events.emit('legend-rendering-complete');\n });\n function getSeriesIndexForElement(el) {\n return el.parents('[data-series-index]').data('series-index');\n }\n function openColorSelector(e) {\n // if we clicked inside poup container ignore click\n if (__WEBPACK_IMPORTED_MODULE_2_jquery___default()(e.target).parents('.popover').length) {\n return;\n }\n var el = __WEBPACK_IMPORTED_MODULE_2_jquery___default()(e.currentTarget).find('.fa-minus');\n var index = getSeriesIndexForElement(el);\n var series = seriesList[index];\n $timeout(function () {\n popoverSrv.show({\n element: el[0],\n position: 'bottom left',\n targetAttachment: 'top left',\n template: '' +\n '',\n openOn: 'hover',\n model: {\n series: series,\n toggleAxis: function () {\n ctrl.toggleAxis(series);\n },\n colorSelected: function (color) {\n ctrl.changeSeriesColor(series, color);\n },\n },\n });\n });\n }\n function toggleSeries(e) {\n var el = __WEBPACK_IMPORTED_MODULE_2_jquery___default()(e.currentTarget);\n var index = getSeriesIndexForElement(el);\n var seriesInfo = seriesList[index];\n var scrollPosition = __WEBPACK_IMPORTED_MODULE_2_jquery___default()(elem.children('tbody')).scrollTop();\n ctrl.toggleSeries(seriesInfo, e);\n __WEBPACK_IMPORTED_MODULE_2_jquery___default()(elem.children('tbody')).scrollTop(scrollPosition);\n }\n function sortLegend(e) {\n var el = __WEBPACK_IMPORTED_MODULE_2_jquery___default()(e.currentTarget);\n var stat = el.data('stat');\n if (stat !== panel.legend.sort) {\n panel.legend.sortDesc = null;\n }\n // if already sort ascending, disable sorting\n if (panel.legend.sortDesc === false) {\n panel.legend.sort = null;\n panel.legend.sortDesc = null;\n ctrl.render();\n return;\n }\n panel.legend.sortDesc = !panel.legend.sortDesc;\n panel.legend.sort = stat;\n ctrl.render();\n }\n function getTableHeaderHtml(statName) {\n if (!panel.legend[statName]) {\n return '';\n }\n var html = '
';\n }\n function render() {\n var legendWidth = legendElem.width();\n if (!ctrl.panel.legend.show) {\n elem.empty();\n firstRender = true;\n return;\n }\n if (firstRender) {\n elem.on('click', '.graph-legend-icon', openColorSelector);\n elem.on('click', '.graph-legend-alias', toggleSeries);\n elem.on('click', 'th', sortLegend);\n firstRender = false;\n }\n seriesList = data;\n elem.empty();\n // Set min-width if side style and there is a value, otherwise remove the CSS property\n // Set width so it works with IE11\n var width = panel.legend.rightSide && panel.legend.sideWidth ? panel.legend.sideWidth + 'px' : '';\n var ieWidth = panel.legend.rightSide && panel.legend.sideWidth ? panel.legend.sideWidth - 1 + 'px' : '';\n legendElem.css('min-width', width);\n legendElem.css('width', ieWidth);\n elem.toggleClass('graph-legend-table', panel.legend.alignAsTable === true);\n var tableHeaderElem;\n if (panel.legend.alignAsTable) {\n var header = '';\n header += '';\n if (panel.legend.values) {\n header += getTableHeaderHtml('min');\n header += getTableHeaderHtml('max');\n header += getTableHeaderHtml('avg');\n header += getTableHeaderHtml('current');\n header += getTableHeaderHtml('total');\n }\n header += '';\n tableHeaderElem = __WEBPACK_IMPORTED_MODULE_2_jquery___default()(header);\n }\n if (panel.legend.sort) {\n seriesList = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.sortBy(seriesList, function (series) {\n var sort = series.stats[panel.legend.sort];\n if (sort === null) {\n sort = -Infinity;\n }\n return sort;\n });\n if (panel.legend.sortDesc) {\n seriesList = seriesList.reverse();\n }\n }\n // render first time for getting proper legend height\n if (!panel.legend.rightSide || (panel.legend.rightSide && legendWidth !== legendRightDefaultWidth)) {\n renderLegendElement(tableHeaderElem);\n elem.empty();\n }\n renderLegendElement(tableHeaderElem);\n }\n function renderSeriesLegendElements() {\n var seriesElements = [];\n for (i = 0; i < seriesList.length; i++) {\n var series = seriesList[i];\n if (series.hideFromLegend(panel.legend)) {\n continue;\n }\n var html = '
';\n html += '
';\n html += '';\n html += '
';\n html +=\n '' + series.aliasEscaped + '';\n if (panel.legend.values) {\n var avg = series.formatValue(series.stats.avg);\n var current = series.formatValue(series.stats.current);\n var min = series.formatValue(series.stats.min);\n var max = series.formatValue(series.stats.max);\n var total = series.formatValue(series.stats.total);\n if (panel.legend.min) {\n html += '
' + min + '
';\n }\n if (panel.legend.max) {\n html += '
' + max + '
';\n }\n if (panel.legend.avg) {\n html += '
' + avg + '
';\n }\n if (panel.legend.current) {\n html += '
' + current + '
';\n }\n if (panel.legend.total) {\n html += '
' + total + '
';\n }\n }\n html += '
';\n seriesElements.push(__WEBPACK_IMPORTED_MODULE_2_jquery___default()(html));\n }\n return seriesElements;\n }\n function renderLegendElement(tableHeaderElem) {\n var legendWidth = elem.width();\n var seriesElements = renderSeriesLegendElements();\n if (panel.legend.alignAsTable) {\n var tbodyElem = __WEBPACK_IMPORTED_MODULE_2_jquery___default()('');\n tbodyElem.append(tableHeaderElem);\n tbodyElem.append(seriesElements);\n elem.append(tbodyElem);\n tbodyElem.wrap('
');\n }\n else {\n elem.append('
');\n elem.find('.graph-legend-scroll').append(seriesElements);\n }\n if (!panel.legend.rightSide || (panel.legend.rightSide && legendWidth !== legendRightDefaultWidth)) {\n addScrollbar();\n }\n else {\n destroyScrollbar();\n }\n }\n function addScrollbar() {\n var scrollRootClass = 'baron baron__root';\n var scrollerClass = 'baron__scroller';\n var scrollBarHTML = \"\\n
\\n
\\n
\\n \";\n var scrollRoot = elem;\n var scroller = elem.find('.graph-legend-scroll');\n // clear existing scroll bar track to prevent duplication\n scrollRoot.find('.baron__track').remove();\n scrollRoot.addClass(scrollRootClass);\n __WEBPACK_IMPORTED_MODULE_2_jquery___default()(scrollBarHTML).appendTo(scrollRoot);\n scroller.addClass(scrollerClass);\n var scrollbarParams = {\n root: scrollRoot[0],\n scroller: scroller[0],\n bar: '.baron__bar',\n track: '.baron__track',\n barOnCls: '_scrollbar',\n scrollingCls: '_scrolling',\n };\n if (!legendScrollbar) {\n legendScrollbar = __WEBPACK_IMPORTED_MODULE_3_baron___default()(scrollbarParams);\n }\n else {\n destroyScrollbar();\n legendScrollbar = __WEBPACK_IMPORTED_MODULE_3_baron___default()(scrollbarParams);\n }\n // #11830 - compensates for Firefox scrollbar calculation error in the baron framework\n scroller[0].style.marginRight = '-' + (scroller[0].offsetWidth - scroller[0].clientWidth) + 'px';\n legendScrollbar.scroll();\n }\n function destroyScrollbar() {\n if (legendScrollbar) {\n legendScrollbar.dispose();\n legendScrollbar = undefined;\n }\n }\n },\n };\n}]);\n\n\n/***/ }),\n\n/***/ 2143:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export SeriesOverridesCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_angular__);\n\n\nvar SeriesOverridesCtrl = /** @class */ (function () {\n /** @ngInject */\n SeriesOverridesCtrl.$inject = [\"$scope\", \"$element\", \"popoverSrv\"];\n function SeriesOverridesCtrl($scope, $element, popoverSrv) {\n $scope.overrideMenu = [];\n $scope.currentOverrides = [];\n $scope.override = $scope.override || {};\n $scope.addOverrideOption = function (name, propertyName, values) {\n var option = {\n text: name,\n propertyName: propertyName,\n index: $scope.overrideMenu.lenght,\n values: values,\n submenu: __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(values, function (value) {\n return { text: String(value), value: value };\n }),\n };\n $scope.overrideMenu.push(option);\n };\n $scope.setOverride = function (item, subItem) {\n // handle color overrides\n if (item.propertyName === 'color') {\n $scope.openColorSelector($scope.override['color']);\n return;\n }\n $scope.override[item.propertyName] = subItem.value;\n // automatically disable lines for this series and the fill below to series\n // can be removed by the user if they still want lines\n if (item.propertyName === 'fillBelowTo') {\n $scope.override['lines'] = false;\n $scope.ctrl.addSeriesOverride({ alias: subItem.value, lines: false });\n }\n $scope.updateCurrentOverrides();\n $scope.ctrl.render();\n };\n $scope.colorSelected = function (color) {\n $scope.override['color'] = color;\n $scope.updateCurrentOverrides();\n $scope.ctrl.render();\n };\n $scope.openColorSelector = function (color) {\n var fakeSeries = { color: color };\n popoverSrv.show({\n element: $element.find('.dropdown')[0],\n position: 'top center',\n openOn: 'click',\n template: '',\n model: {\n autoClose: true,\n colorSelected: $scope.colorSelected,\n series: fakeSeries,\n },\n onClose: function () {\n $scope.ctrl.render();\n },\n });\n };\n $scope.removeOverride = function (option) {\n delete $scope.override[option.propertyName];\n $scope.updateCurrentOverrides();\n $scope.ctrl.refresh();\n };\n $scope.getSeriesNames = function () {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map($scope.ctrl.seriesList, function (series) {\n return series.alias;\n });\n };\n $scope.updateCurrentOverrides = function () {\n $scope.currentOverrides = [];\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.each($scope.overrideMenu, function (option) {\n var value = $scope.override[option.propertyName];\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isUndefined(value)) {\n return;\n }\n $scope.currentOverrides.push({\n name: option.text,\n propertyName: option.propertyName,\n value: String(value),\n });\n });\n };\n $scope.addOverrideOption('Bars', 'bars', [true, false]);\n $scope.addOverrideOption('Lines', 'lines', [true, false]);\n $scope.addOverrideOption('Line fill', 'fill', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);\n $scope.addOverrideOption('Line width', 'linewidth', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);\n $scope.addOverrideOption('Null point mode', 'nullPointMode', ['connected', 'null', 'null as zero']);\n $scope.addOverrideOption('Fill below to', 'fillBelowTo', $scope.getSeriesNames());\n $scope.addOverrideOption('Staircase line', 'steppedLine', [true, false]);\n $scope.addOverrideOption('Dashes', 'dashes', [true, false]);\n $scope.addOverrideOption('Dash Length', 'dashLength', [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n ]);\n $scope.addOverrideOption('Dash Space', 'spaceLength', [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n ]);\n $scope.addOverrideOption('Points', 'points', [true, false]);\n $scope.addOverrideOption('Points Radius', 'pointradius', [1, 2, 3, 4, 5]);\n $scope.addOverrideOption('Stack', 'stack', [true, false, 'A', 'B', 'C', 'D']);\n $scope.addOverrideOption('Color', 'color', ['change']);\n $scope.addOverrideOption('Y-axis', 'yaxis', [1, 2]);\n $scope.addOverrideOption('Z-index', 'zindex', [-3, -2, -1, 0, 1, 2, 3]);\n $scope.addOverrideOption('Transform', 'transform', ['negative-Y']);\n $scope.addOverrideOption('Legend', 'legend', [true, false]);\n $scope.updateCurrentOverrides();\n }\n return SeriesOverridesCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_1_angular___default.a.module('grafana.controllers').controller('SeriesOverridesCtrl', SeriesOverridesCtrl);\n\n\n/***/ }),\n\n/***/ 2144:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export ThresholdFormCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_core_module__ = __webpack_require__(2);\n\nvar ThresholdFormCtrl = /** @class */ (function () {\n /** @ngInject */\n ThresholdFormCtrl.$inject = [\"$scope\"];\n function ThresholdFormCtrl($scope) {\n var _this = this;\n this.panel = this.panelCtrl.panel;\n if (this.panel.alert) {\n this.disabled = true;\n }\n var unbindDestroy = $scope.$on('$destroy', function () {\n _this.panelCtrl.editingThresholds = false;\n _this.panelCtrl.render();\n unbindDestroy();\n });\n this.panelCtrl.editingThresholds = true;\n }\n ThresholdFormCtrl.prototype.addThreshold = function () {\n this.panel.thresholds.push({\n value: undefined,\n colorMode: 'critical',\n op: 'gt',\n fill: true,\n line: true,\n yaxis: 'left',\n });\n this.panelCtrl.render();\n };\n ThresholdFormCtrl.prototype.removeThreshold = function (index) {\n this.panel.thresholds.splice(index, 1);\n this.panelCtrl.render();\n };\n ThresholdFormCtrl.prototype.render = function () {\n this.panelCtrl.render();\n };\n ThresholdFormCtrl.prototype.onFillColorChange = function (index) {\n var _this = this;\n return function (newColor) {\n _this.panel.thresholds[index].fillColor = newColor;\n _this.render();\n };\n };\n ThresholdFormCtrl.prototype.onLineColorChange = function (index) {\n var _this = this;\n return function (newColor) {\n _this.panel.thresholds[index].lineColor = newColor;\n _this.render();\n };\n };\n return ThresholdFormCtrl;\n}());\n\nvar template = \"\\n
\\n
Thresholds
\\n

\\n Visual thresholds options disabled.\\n Visit the Alert tab update your thresholds.
\\n To re-enable thresholds, the alert rule must be deleted from this panel.\\n

\\n
\\n
\\n
\\n \\n
\\n\\n
\\n
\\n \\n
\\n \\n
\\n\\n
\\n \\n
\\n \\n
\\n
\\n\\n \\n\\n
\\n \\n \\n \\n \\n
\\n\\n \\n\\n
\\n \\n \\n \\n \\n
\\n\\n
\\n \\n
\\n \\n
\\n
\\n\\n
\\n \\n
\\n
\\n\\n
\\n \\n
\\n
\\n
\\n\";\n__WEBPACK_IMPORTED_MODULE_0_app_core_core_module__[\"a\" /* default */].directive('graphThresholdForm', function () {\n return {\n restrict: 'E',\n template: template,\n controller: ThresholdFormCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: {\n panelCtrl: '=',\n },\n };\n});\n\n\n/***/ }),\n\n/***/ 2145:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar template = \"\\n
\\n
\\n
\\n\\n
\\n
\\n
\\n
\\n\";\n/* harmony default export */ __webpack_exports__[\"a\"] = (template);\n\n\n/***/ }),\n\n/***/ 2146:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return DataProcessor; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_time_series2__ = __webpack_require__(313);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_utils_colors__ = __webpack_require__(138);\n\n\n\nvar DataProcessor = /** @class */ (function () {\n function DataProcessor(panel) {\n this.panel = panel;\n }\n DataProcessor.prototype.getSeriesList = function (options) {\n var _this = this;\n if (!options.dataList || options.dataList.length === 0) {\n return [];\n }\n // auto detect xaxis mode\n var firstItem;\n if (options.dataList && options.dataList.length > 0) {\n firstItem = options.dataList[0];\n var autoDetectMode = this.getAutoDetectXAxisMode(firstItem);\n if (this.panel.xaxis.mode !== autoDetectMode) {\n this.panel.xaxis.mode = autoDetectMode;\n this.setPanelDefaultsForNewXAxisMode();\n }\n }\n switch (this.panel.xaxis.mode) {\n case 'series':\n case 'time': {\n return options.dataList.map(function (item, index) {\n return _this.timeSeriesHandler(item, index, options);\n });\n }\n case 'histogram': {\n var histogramDataList = void 0;\n if (this.panel.stack) {\n histogramDataList = options.dataList;\n }\n else {\n histogramDataList = [\n {\n target: 'count',\n datapoints: __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.concat([], __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.flatten(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(options.dataList, 'datapoints'))),\n },\n ];\n }\n return histogramDataList.map(function (item, index) {\n return _this.timeSeriesHandler(item, index, options);\n });\n }\n case 'field': {\n return this.customHandler(firstItem);\n }\n }\n };\n DataProcessor.prototype.getAutoDetectXAxisMode = function (firstItem) {\n switch (firstItem.type) {\n case 'docs':\n return 'field';\n case 'table':\n return 'field';\n default: {\n if (this.panel.xaxis.mode === 'series') {\n return 'series';\n }\n if (this.panel.xaxis.mode === 'histogram') {\n return 'histogram';\n }\n return 'time';\n }\n }\n };\n DataProcessor.prototype.setPanelDefaultsForNewXAxisMode = function () {\n switch (this.panel.xaxis.mode) {\n case 'time': {\n this.panel.bars = false;\n this.panel.lines = true;\n this.panel.points = false;\n this.panel.legend.show = true;\n this.panel.tooltip.shared = true;\n this.panel.xaxis.values = [];\n break;\n }\n case 'series': {\n this.panel.bars = true;\n this.panel.lines = false;\n this.panel.points = false;\n this.panel.stack = false;\n this.panel.legend.show = false;\n this.panel.tooltip.shared = false;\n this.panel.xaxis.values = ['total'];\n break;\n }\n case 'histogram': {\n this.panel.bars = true;\n this.panel.lines = false;\n this.panel.points = false;\n this.panel.stack = false;\n this.panel.legend.show = false;\n this.panel.tooltip.shared = false;\n break;\n }\n }\n };\n DataProcessor.prototype.timeSeriesHandler = function (seriesData, index, options) {\n var datapoints = seriesData.datapoints || [];\n var alias = seriesData.target;\n var colorIndex = index % __WEBPACK_IMPORTED_MODULE_2_app_core_utils_colors__[\"f\" /* default */].length;\n var color = this.panel.aliasColors[alias] || __WEBPACK_IMPORTED_MODULE_2_app_core_utils_colors__[\"f\" /* default */][colorIndex];\n var series = new __WEBPACK_IMPORTED_MODULE_1_app_core_time_series2__[\"a\" /* default */]({\n datapoints: datapoints,\n alias: alias,\n color: color,\n unit: seriesData.unit,\n });\n if (datapoints && datapoints.length > 0) {\n var last = datapoints[datapoints.length - 1][1];\n var from = options.range.from;\n if (last - from < -10000) {\n series.isOutsideRange = true;\n }\n }\n return series;\n };\n DataProcessor.prototype.customHandler = function (dataItem) {\n var nameField = this.panel.xaxis.name;\n if (!nameField) {\n throw {\n message: 'No field name specified to use for x-axis, check your axes settings',\n };\n }\n return [];\n };\n DataProcessor.prototype.validateXAxisSeriesValue = function () {\n switch (this.panel.xaxis.mode) {\n case 'series': {\n if (this.panel.xaxis.values.length === 0) {\n this.panel.xaxis.values = ['total'];\n return;\n }\n var validOptions = this.getXAxisValueOptions({});\n var found = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(validOptions, { value: this.panel.xaxis.values[0] });\n if (!found) {\n this.panel.xaxis.values = ['total'];\n }\n return;\n }\n }\n };\n DataProcessor.prototype.getDataFieldNames = function (dataList, onlyNumbers) {\n if (dataList.length === 0) {\n return [];\n }\n var fields = [];\n var firstItem = dataList[0];\n var fieldParts = [];\n function getPropertiesRecursive(obj) {\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.forEach(obj, function (value, key) {\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isObject(value)) {\n fieldParts.push(key);\n getPropertiesRecursive(value);\n }\n else {\n if (!onlyNumbers || __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isNumber(value)) {\n var field = fieldParts.concat(key).join('.');\n fields.push(field);\n }\n }\n });\n fieldParts.pop();\n }\n if (firstItem.type === 'docs') {\n if (firstItem.datapoints.length === 0) {\n return [];\n }\n getPropertiesRecursive(firstItem.datapoints[0]);\n }\n return fields;\n };\n DataProcessor.prototype.getXAxisValueOptions = function (options) {\n switch (this.panel.xaxis.mode) {\n case 'series': {\n return [\n { text: 'Avg', value: 'avg' },\n { text: 'Min', value: 'min' },\n { text: 'Max', value: 'max' },\n { text: 'Total', value: 'total' },\n { text: 'Count', value: 'count' },\n ];\n }\n }\n return [];\n };\n DataProcessor.prototype.pluckDeep = function (obj, property) {\n var propertyParts = property.split('.');\n var value = obj;\n for (var i = 0; i < propertyParts.length; ++i) {\n if (value[propertyParts[i]]) {\n value = value[propertyParts[i]];\n }\n else {\n return undefined;\n }\n }\n return value;\n };\n return DataProcessor;\n}());\n\n\n\n/***/ }),\n\n/***/ 2147:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export AxesEditorCtrl */\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = axesEditorComponent;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_utils_kbn__ = __webpack_require__(312);\n\nvar AxesEditorCtrl = /** @class */ (function () {\n /** @ngInject **/\n AxesEditorCtrl.$inject = [\"$scope\", \"$q\"];\n function AxesEditorCtrl($scope, $q) {\n this.$scope = $scope;\n this.$q = $q;\n this.panelCtrl = $scope.ctrl;\n this.panel = this.panelCtrl.panel;\n this.$scope.ctrl = this;\n this.unitFormats = __WEBPACK_IMPORTED_MODULE_0_app_core_utils_kbn__[\"a\" /* default */].getUnitFormats();\n this.logScales = {\n linear: 1,\n 'log (base 2)': 2,\n 'log (base 10)': 10,\n 'log (base 32)': 32,\n 'log (base 1024)': 1024,\n };\n this.xAxisModes = {\n Time: 'time',\n Series: 'series',\n Histogram: 'histogram',\n };\n this.xAxisStatOptions = [\n { text: 'Avg', value: 'avg' },\n { text: 'Min', value: 'min' },\n { text: 'Max', value: 'max' },\n { text: 'Total', value: 'total' },\n { text: 'Count', value: 'count' },\n { text: 'Current', value: 'current' },\n ];\n if (this.panel.xaxis.mode === 'custom') {\n if (!this.panel.xaxis.name) {\n this.panel.xaxis.name = 'specify field';\n }\n }\n }\n AxesEditorCtrl.prototype.setUnitFormat = function (axis, subItem) {\n axis.format = subItem.value;\n this.panelCtrl.render();\n };\n AxesEditorCtrl.prototype.render = function () {\n this.panelCtrl.render();\n };\n AxesEditorCtrl.prototype.xAxisModeChanged = function () {\n this.panelCtrl.processor.setPanelDefaultsForNewXAxisMode();\n this.panelCtrl.onDataReceived(this.panelCtrl.dataList);\n };\n AxesEditorCtrl.prototype.xAxisValueChanged = function () {\n this.panelCtrl.onDataReceived(this.panelCtrl.dataList);\n };\n AxesEditorCtrl.prototype.getDataFieldNames = function (onlyNumbers) {\n var props = this.panelCtrl.processor.getDataFieldNames(this.panelCtrl.dataList, onlyNumbers);\n var items = props.map(function (prop) {\n return { text: prop, value: prop };\n });\n return this.$q.when(items);\n };\n return AxesEditorCtrl;\n}());\n\n/** @ngInject **/\nfunction axesEditorComponent() {\n 'use strict';\n return {\n restrict: 'E',\n scope: true,\n templateUrl: 'public/app/plugins/panel/graph/axes_editor.html',\n controller: AxesEditorCtrl,\n };\n}\n\n\n/***/ }),\n\n/***/ 2148:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SensorCtrl\", function() { return SensorCtrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PanelCtrl\", function() { return SensorCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__graph_module__ = __webpack_require__(2006);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\nvar SensorCtrl = /** @class */ (function (_super) {\n __extends(SensorCtrl, _super);\n /** @ngInject */\n SensorCtrl.$inject = [\"$scope\", \"$injector\", \"annotationsSrv\", \"sensorSrv\", \"experimentSrv\"];\n function SensorCtrl($scope, $injector, annotationsSrv, sensorSrv, experimentSrv) {\n var _this = _super.call(this, $scope, $injector, annotationsSrv) || this;\n _this.sensorSrv = sensorSrv;\n _this.experimentSrv = experimentSrv;\n _this.panel.targets = [];\n // In snapshot mode, all sensor data is stored in the json model by the\n // underlying metrics_panel_ctrl, so no need to generate targets to fetch\n // data from influx\n if (!_this.dashboard.snapshot) {\n experimentSrv.getCurrent().then(function (exp) {\n _this.experiment = exp;\n _this.loadTargets().then(function (targets) {\n var validTargets = targets.filter(function (target) { return target.sensor; });\n if (validTargets.length === 0) {\n if (targets.length > 1) {\n var shortNames = targets.map(function (t) { return t.descriptor.sensorShortName; });\n _this.panel.title = \"No valid target found: \" + shortNames.join(' ');\n }\n else {\n _this.panel.title = \"Sensor not found: \" + targets[0].descriptor.sensorShortName;\n }\n _this.panel.showEcuEvents = false;\n return;\n }\n _this.panel.targets = targets.map(function (target) { return _this.buildTarget(target); });\n _this.setTitle(targets);\n _this.initEcuFlag(targets);\n _this.refresh();\n }, function (err) {\n _this.panel.title = 'Uh-oh!';\n _this.dataWarning = {\n title: ' ' + '
This experiment or sensor was deleted.',\n };\n });\n });\n }\n _this.events.on('refresh', _this.onSensorPanelRefresh.bind(_this));\n _this.events.on('init-edit-mode', _this.addSensorEditTab.bind(_this));\n return _this;\n }\n SensorCtrl.prototype.addSensorEditTab = function () {\n this.addEditorTab('Sensors', 'public/app/plugins/panel/sensor/partials/tab.html', 1);\n };\n SensorCtrl.prototype.onSensorPanelRefresh = function () {\n // If loading from a snapshot, regenerate title based on snapshotData\n // stored in metrics_panel_ctrl.ts\n if (this.panel.snapshotData && this.panel.snapshotData.length > 0) {\n var targets = this.panel.snapshotData.map(function (d) { return d.target; });\n if (!this.panel.hasCustomTitle) {\n if (targets.length > 1) {\n this.panel.title = 'Various sensors';\n }\n else {\n this.panel.title = targets[0];\n }\n }\n }\n };\n SensorCtrl.prototype.aliasChanged = function (shortName, alias) {\n var dbTarget = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.filter(this.panel.targets, function (t) { return t.sensorShortName === shortName; })[0];\n dbTarget.alias = alias;\n this.refresh();\n };\n SensorCtrl.prototype.canDrop = function ($data) {\n return $data.hasOwnProperty('sensor');\n };\n SensorCtrl.prototype.onDrop = function ($data) {\n console.log('DROP DATA', $data);\n var sensor = $data.sensor, experiment = $data.experiment;\n this.panel.sensorTargets.push({\n sensorShortName: sensor.shortName,\n experimentId: experiment.id,\n });\n var target = {\n sensor: this.sensorSrv.get(sensor.shortName),\n experiment: experiment,\n descriptor: null,\n };\n this.panel.targets.push(this.buildTarget(target));\n this.refresh();\n };\n SensorCtrl.prototype.initEcuFlag = function (targets) {\n var _this = this;\n var foreignTargets = targets.filter(function (t) { return t.experiment && t.experiment.id !== -1 && t.experiment.id !== _this.experiment.id; });\n this.panel.showEcuEvents = foreignTargets.length === 0;\n };\n SensorCtrl.prototype.setTitle = function (targets) {\n if (this.panel.hasCustomTitle) {\n return;\n }\n if (targets.length > 1) {\n this.panel.title = 'Various sensors';\n return;\n }\n this.panel.title = this.buildSensorAlias(targets[0]);\n };\n SensorCtrl.prototype.loadTargets = function () {\n var _this = this;\n var promises = this.panel.sensorTargets.map(function (target) { return _this.loadTargetInfo(target); });\n return Promise.all(promises);\n };\n SensorCtrl.prototype.getSensorForExperiment = function (sensorShortName, experiment) {\n var sensor = this.sensorSrv.get(sensorShortName);\n if (!sensor) {\n return null;\n }\n if (!experiment.sensorIds) {\n return null;\n }\n if (experiment.sensorIds.indexOf(sensor.id) === -1) {\n return null;\n }\n return sensor;\n };\n SensorCtrl.prototype.loadTargetInfo = function (descriptor) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n var result = {\n descriptor: descriptor,\n experiment: null,\n sensor: null,\n };\n if (descriptor.experimentId === -1) {\n result.sensor = _this.getSensorForExperiment(descriptor.sensorShortName, _this.experiment);\n result.experiment = { id: -1 };\n resolve(result);\n }\n else {\n _this.experimentSrv.get(descriptor.experimentId).then(function (experiment) {\n result.sensor = _this.getSensorForExperiment(descriptor.sensorShortName, experiment);\n result.experiment = experiment;\n resolve(result);\n }, function (err) {\n reject(err);\n err.isHandled = true;\n });\n }\n });\n };\n SensorCtrl.prototype.buildQuery = function (target) {\n var sensor = target.sensor, experiment = target.experiment;\n var experimentIdQuery = experiment.id !== -1 ? experiment.id : '$experiment_id';\n var query = \"SELECT mean(\\\"sensor\" + sensor.databaseId + \"\\\") \" +\n (\"FROM \\\"experiment\" + experimentIdQuery + \"\\\" \") +\n \"WHERE $timeFilter GROUP BY time($resolution) fill(null)\";\n return query;\n };\n SensorCtrl.prototype.buildSensorAlias = function (target) {\n if (target.descriptor && target.descriptor.alias) {\n return target.descriptor.alias;\n }\n var sensor = target.sensor, experiment = target.experiment;\n var alias = sensor.shortName;\n if (experiment.id !== -1) {\n alias = experiment.title + \" - \" + alias;\n }\n if (sensor.description) {\n alias = alias + \" - \" + sensor.description;\n }\n return alias;\n };\n SensorCtrl.prototype.buildTarget = function (target) {\n if (!target.sensor) {\n return {};\n }\n var query = this.buildQuery(target);\n var dbtarget = {\n dsType: 'influxdb',\n rawQuery: true,\n alias: this.buildSensorAlias(target),\n query: query,\n sensorShortName: target.sensor && target.sensor.shortName,\n };\n return dbtarget;\n };\n return SensorCtrl;\n}(__WEBPACK_IMPORTED_MODULE_1__graph_module__[\"GraphCtrl\"]));\n\n\n\n/***/ }),\n\n/***/ 2149:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DashListCtrl\", function() { return DashListCtrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PanelCtrl\", function() { return DashListCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_plugins_sdk__ = __webpack_require__(1983);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_services_impression_srv__ = __webpack_require__(200);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\nvar DashListCtrl = /** @class */ (function (_super) {\n __extends(DashListCtrl, _super);\n /** @ngInject */\n DashListCtrl.$inject = [\"$scope\", \"$injector\", \"backendSrv\", \"dashboardSrv\"];\n function DashListCtrl($scope, $injector, backendSrv, dashboardSrv) {\n var _this = _super.call(this, $scope, $injector) || this;\n _this.backendSrv = backendSrv;\n _this.dashboardSrv = dashboardSrv;\n _this.panelDefaults = {\n query: '',\n limit: 10,\n tags: [],\n recent: false,\n search: false,\n starred: true,\n headings: true,\n folderId: null,\n };\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.defaults(_this.panel, _this.panelDefaults);\n if (_this.panel.tag) {\n _this.panel.tags = [_this.panel.tag];\n delete _this.panel.tag;\n }\n _this.events.on('refresh', _this.onRefresh.bind(_this));\n _this.events.on('init-edit-mode', _this.onInitEditMode.bind(_this));\n _this.groups = [\n { list: [], show: false, header: 'Starred dashboards' },\n { list: [], show: false, header: 'Recently viewed dashboards' },\n { list: [], show: false, header: 'Search' },\n ];\n // update capability\n if (_this.panel.mode) {\n if (_this.panel.mode === 'starred') {\n _this.panel.starred = true;\n _this.panel.headings = false;\n }\n if (_this.panel.mode === 'recently viewed') {\n _this.panel.recent = true;\n _this.panel.starred = false;\n _this.panel.headings = false;\n }\n if (_this.panel.mode === 'search') {\n _this.panel.search = true;\n _this.panel.starred = false;\n _this.panel.headings = false;\n }\n delete _this.panel.mode;\n }\n return _this;\n }\n DashListCtrl.prototype.onInitEditMode = function () {\n this.editorTabIndex = 1;\n this.modes = ['starred', 'search', 'recently viewed'];\n this.addEditorTab('Options', 'public/app/plugins/panel/dashlist/editor.html');\n };\n DashListCtrl.prototype.onRefresh = function () {\n var promises = [];\n promises.push(this.getRecentDashboards());\n promises.push(this.getStarred());\n promises.push(this.getSearch());\n return Promise.all(promises).then(this.renderingCompleted.bind(this));\n };\n DashListCtrl.prototype.getSearch = function () {\n var _this = this;\n this.groups[2].show = this.panel.search;\n if (!this.panel.search) {\n return Promise.resolve();\n }\n var params = {\n limit: this.panel.limit,\n query: this.panel.query,\n tag: this.panel.tags,\n folderIds: this.panel.folderId,\n type: 'dash-db',\n };\n return this.backendSrv.search(params).then(function (result) {\n _this.groups[2].list = result;\n });\n };\n DashListCtrl.prototype.getStarred = function () {\n var _this = this;\n this.groups[0].show = this.panel.starred;\n if (!this.panel.starred) {\n return Promise.resolve();\n }\n var params = { limit: this.panel.limit, starred: 'true' };\n return this.backendSrv.search(params).then(function (result) {\n _this.groups[0].list = result;\n });\n };\n DashListCtrl.prototype.starDashboard = function (dash, evt) {\n this.dashboardSrv.starDashboard(dash.id, dash.isStarred).then(function (newState) {\n dash.isStarred = newState;\n });\n if (evt) {\n evt.stopPropagation();\n evt.preventDefault();\n }\n };\n DashListCtrl.prototype.getRecentDashboards = function () {\n var _this = this;\n this.groups[1].show = this.panel.recent;\n if (!this.panel.recent) {\n return Promise.resolve();\n }\n var dashIds = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.take(__WEBPACK_IMPORTED_MODULE_2_app_core_services_impression_srv__[\"a\" /* default */].getDashboardOpened(), this.panel.limit);\n return this.backendSrv.search({ dashboardIds: dashIds, limit: this.panel.limit }).then(function (result) {\n _this.groups[1].list = dashIds\n .map(function (orderId) {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(result, function (dashboard) {\n return dashboard.id === orderId;\n });\n })\n .filter(function (el) {\n return el !== undefined;\n });\n });\n };\n DashListCtrl.prototype.onFolderChange = function (folder) {\n this.panel.folderId = folder.id;\n this.refresh();\n };\n DashListCtrl.templateUrl = 'module.html';\n DashListCtrl.scrollable = true;\n return DashListCtrl;\n}(__WEBPACK_IMPORTED_MODULE_1_app_plugins_sdk__[\"PanelCtrl\"]));\n\n\n\n/***/ }),\n\n/***/ 2150:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PluginListCtrl\", function() { return PluginListCtrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PanelCtrl\", function() { return PluginListCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__features_panel_panel_ctrl__ = __webpack_require__(1986);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\nvar PluginListCtrl = /** @class */ (function (_super) {\n __extends(PluginListCtrl, _super);\n /** @ngInject */\n PluginListCtrl.$inject = [\"$scope\", \"$injector\", \"backendSrv\"];\n function PluginListCtrl($scope, $injector, backendSrv) {\n var _this = _super.call(this, $scope, $injector) || this;\n _this.backendSrv = backendSrv;\n // Set and populate defaults\n _this.panelDefaults = {};\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.defaults(_this.panel, _this.panelDefaults);\n _this.events.on('init-edit-mode', _this.onInitEditMode.bind(_this));\n _this.pluginList = [];\n _this.viewModel = [\n { header: 'Installed Apps', list: [], type: 'app' },\n { header: 'Installed Panels', list: [], type: 'panel' },\n { header: 'Installed Datasources', list: [], type: 'datasource' },\n ];\n _this.update();\n return _this;\n }\n PluginListCtrl.prototype.onInitEditMode = function () {\n this.editorTabIndex = 1;\n this.addEditorTab('Options', 'public/app/plugins/panel/pluginlist/editor.html');\n };\n PluginListCtrl.prototype.gotoPlugin = function (plugin, evt) {\n if (evt) {\n evt.stopPropagation();\n }\n this.$location.url(\"plugins/\" + plugin.id + \"/edit\");\n };\n PluginListCtrl.prototype.updateAvailable = function (plugin, $event) {\n $event.stopPropagation();\n $event.preventDefault();\n var modalScope = this.$scope.$new(true);\n modalScope.plugin = plugin;\n this.publishAppEvent('show-modal', {\n src: 'public/app/features/plugins/partials/update_instructions.html',\n scope: modalScope,\n });\n };\n PluginListCtrl.prototype.update = function () {\n var _this = this;\n this.backendSrv.get('api/plugins', { embedded: 0, core: 0 }).then(function (plugins) {\n _this.pluginList = plugins;\n _this.viewModel[0].list = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.filter(plugins, { type: 'app' });\n _this.viewModel[1].list = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.filter(plugins, { type: 'panel' });\n _this.viewModel[2].list = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.filter(plugins, { type: 'datasource' });\n for (var _i = 0, _a = _this.pluginList; _i < _a.length; _i++) {\n var plugin = _a[_i];\n if (plugin.hasUpdate) {\n plugin.state = 'has-update';\n }\n else if (!plugin.enabled) {\n plugin.state = 'not-enabled';\n }\n }\n });\n };\n PluginListCtrl.templateUrl = 'module.html';\n PluginListCtrl.scrollable = true;\n return PluginListCtrl;\n}(__WEBPACK_IMPORTED_MODULE_1__features_panel_panel_ctrl__[\"a\" /* PanelCtrl */]));\n\n\n\n/***/ }),\n\n/***/ 2151:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AlertListPanel\", function() { return AlertListPanel; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PanelCtrl\", function() { return AlertListPanel; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_moment__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_moment__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__features_alerting_alert_def__ = __webpack_require__(698);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_app_plugins_sdk__ = __webpack_require__(1983);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_app_core_utils_datemath__ = __webpack_require__(691);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n\n\nvar AlertListPanel = /** @class */ (function (_super) {\n __extends(AlertListPanel, _super);\n /** @ngInject */\n AlertListPanel.$inject = [\"$scope\", \"$injector\", \"backendSrv\"];\n function AlertListPanel($scope, $injector, backendSrv) {\n var _this = _super.call(this, $scope, $injector) || this;\n _this.backendSrv = backendSrv;\n _this.showOptions = [{ text: 'Current state', value: 'current' }, { text: 'Recent state changes', value: 'changes' }];\n _this.sortOrderOptions = [\n { text: 'Alphabetical (asc)', value: 1 },\n { text: 'Alphabetical (desc)', value: 2 },\n { text: 'Importance', value: 3 },\n ];\n _this.stateFilter = {};\n _this.currentAlerts = [];\n _this.alertHistory = [];\n // Set and populate defaults\n _this.panelDefaults = {\n show: 'current',\n limit: 10,\n stateFilter: [],\n onlyAlertsOnDashboard: false,\n sortOrder: 1,\n dashboardFilter: '',\n nameFilter: '',\n folderId: null,\n };\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.defaults(_this.panel, _this.panelDefaults);\n _this.events.on('init-edit-mode', _this.onInitEditMode.bind(_this));\n _this.events.on('refresh', _this.onRefresh.bind(_this));\n for (var key in _this.panel.stateFilter) {\n _this.stateFilter[_this.panel.stateFilter[key]] = true;\n }\n return _this;\n }\n AlertListPanel.prototype.sortResult = function (alerts) {\n if (this.panel.sortOrder === 3) {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.sortBy(alerts, function (a) {\n return __WEBPACK_IMPORTED_MODULE_2__features_alerting_alert_def__[\"a\" /* default */].alertStateSortScore[a.state];\n });\n }\n var result = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.sortBy(alerts, function (a) {\n return a.name.toLowerCase();\n });\n if (this.panel.sortOrder === 2) {\n result.reverse();\n }\n return result;\n };\n AlertListPanel.prototype.updateStateFilter = function () {\n var result = [];\n for (var key in this.stateFilter) {\n if (this.stateFilter[key]) {\n result.push(key);\n }\n }\n this.panel.stateFilter = result;\n this.onRefresh();\n };\n AlertListPanel.prototype.onRefresh = function () {\n var _this = this;\n var getAlertsPromise;\n if (this.panel.show === 'current') {\n getAlertsPromise = this.getCurrentAlertState();\n }\n if (this.panel.show === 'changes') {\n getAlertsPromise = this.getStateChanges();\n }\n getAlertsPromise.then(function () {\n _this.renderingCompleted();\n });\n };\n AlertListPanel.prototype.onFolderChange = function (folder) {\n this.panel.folderId = folder.id;\n this.refresh();\n };\n AlertListPanel.prototype.getStateChanges = function () {\n var _this = this;\n var params = {\n limit: this.panel.limit,\n type: 'alert',\n newState: this.panel.stateFilter,\n };\n if (this.panel.onlyAlertsOnDashboard) {\n params.dashboardId = this.dashboard.id;\n }\n params.from = __WEBPACK_IMPORTED_MODULE_4_app_core_utils_datemath__[\"parse\"](this.dashboard.time.from).unix() * 1000;\n params.to = __WEBPACK_IMPORTED_MODULE_4_app_core_utils_datemath__[\"parse\"](this.dashboard.time.to).unix() * 1000;\n return this.backendSrv.get(\"/api/annotations\", params).then(function (res) {\n _this.alertHistory = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(res, function (al) {\n al.time = _this.dashboard.formatDate(al.time, 'MMM D, YYYY HH:mm:ss');\n al.stateModel = __WEBPACK_IMPORTED_MODULE_2__features_alerting_alert_def__[\"a\" /* default */].getStateDisplayModel(al.newState);\n al.info = __WEBPACK_IMPORTED_MODULE_2__features_alerting_alert_def__[\"a\" /* default */].getAlertAnnotationInfo(al);\n return al;\n });\n _this.noAlertsMessage = _this.alertHistory.length === 0 ? 'No alerts in current time range' : '';\n return _this.alertHistory;\n });\n };\n AlertListPanel.prototype.getCurrentAlertState = function () {\n var _this = this;\n var params = {\n state: this.panel.stateFilter,\n };\n if (this.panel.nameFilter) {\n params.query = this.panel.nameFilter;\n }\n if (this.panel.folderId >= 0) {\n params.folderId = this.panel.folderId;\n }\n if (this.panel.dashboardFilter) {\n params.dashboardQuery = this.panel.dashboardFilter;\n }\n if (this.panel.onlyAlertsOnDashboard) {\n params.dashboardId = this.dashboard.id;\n }\n if (this.panel.dashboardTags) {\n params.dashboardTag = this.panel.dashboardTags;\n }\n return this.backendSrv.get(\"/api/alerts\", params).then(function (res) {\n _this.currentAlerts = _this.sortResult(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(res, function (al) {\n al.stateModel = __WEBPACK_IMPORTED_MODULE_2__features_alerting_alert_def__[\"a\" /* default */].getStateDisplayModel(al.state);\n al.newStateDateAgo = __WEBPACK_IMPORTED_MODULE_1_moment___default()(al.newStateDate)\n .locale('en')\n .fromNow(true);\n return al;\n }));\n if (_this.currentAlerts.length > _this.panel.limit) {\n _this.currentAlerts = _this.currentAlerts.slice(0, _this.panel.limit);\n }\n _this.noAlertsMessage = _this.currentAlerts.length === 0 ? 'No alerts' : '';\n return _this.currentAlerts;\n });\n };\n AlertListPanel.prototype.onInitEditMode = function () {\n this.addEditorTab('Options', 'public/app/plugins/panel/alertlist/editor.html');\n };\n AlertListPanel.templateUrl = 'module.html';\n AlertListPanel.scrollable = true;\n return AlertListPanel;\n}(__WEBPACK_IMPORTED_MODULE_3_app_plugins_sdk__[\"PanelCtrl\"]));\n\n\n\n/***/ }),\n\n/***/ 2152:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__color_legend__ = __webpack_require__(2153);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__heatmap_ctrl__ = __webpack_require__(2154);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"PanelCtrl\", function() { return __WEBPACK_IMPORTED_MODULE_1__heatmap_ctrl__[\"a\"]; });\n\n\n\n\n\n/***/ }),\n\n/***/ 2153:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_jquery__ = __webpack_require__(17);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_jquery__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_d3__ = __webpack_require__(695);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_app_core_core__ = __webpack_require__(197);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_app_core_utils_ticks__ = __webpack_require__(696);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__color_scale__ = __webpack_require__(2013);\n\n\n\n\n\n\n\nvar module = __WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.directives');\nvar LEGEND_HEIGHT_PX = 6;\nvar LEGEND_WIDTH_PX = 100;\nvar LEGEND_TICK_SIZE = 0;\nvar LEGEND_VALUE_MARGIN = 0;\n/**\n * Color legend for heatmap editor.\n */\nmodule.directive('colorLegend', function () {\n return {\n restrict: 'E',\n template: '
',\n link: function (scope, elem, attrs) {\n var ctrl = scope.ctrl;\n var panel = scope.ctrl.panel;\n render();\n ctrl.events.on('render', function () {\n render();\n });\n function render() {\n var legendElem = __WEBPACK_IMPORTED_MODULE_2_jquery___default()(elem).find('svg');\n var legendWidth = Math.floor(legendElem.outerWidth());\n if (panel.color.mode === 'spectrum') {\n var colorScheme = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find(ctrl.colorSchemes, {\n value: panel.color.colorScheme,\n });\n var colorScale = Object(__WEBPACK_IMPORTED_MODULE_6__color_scale__[\"a\" /* getColorScale */])(colorScheme, __WEBPACK_IMPORTED_MODULE_4_app_core_core__[\"c\" /* contextSrv */].user.lightTheme, legendWidth);\n drawSimpleColorLegend(elem, colorScale);\n }\n else if (panel.color.mode === 'opacity') {\n var colorOptions = panel.color;\n drawSimpleOpacityLegend(elem, colorOptions);\n }\n }\n },\n };\n});\n/**\n * Heatmap legend with scale values.\n */\nmodule.directive('heatmapLegend', function () {\n return {\n restrict: 'E',\n template: \"
\",\n link: function (scope, elem, attrs) {\n var ctrl = scope.ctrl;\n var panel = scope.ctrl.panel;\n render();\n ctrl.events.on('render', function () {\n render();\n });\n function render() {\n clearLegend(elem);\n if (!__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isEmpty(ctrl.data) && !__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isEmpty(ctrl.data.cards)) {\n var rangeFrom = 0;\n var rangeTo = ctrl.data.cardStats.max;\n var maxValue = panel.color.max || rangeTo;\n var minValue = panel.color.min || 0;\n if (panel.color.mode === 'spectrum') {\n var colorScheme = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find(ctrl.colorSchemes, {\n value: panel.color.colorScheme,\n });\n drawColorLegend(elem, colorScheme, rangeFrom, rangeTo, maxValue, minValue);\n }\n else if (panel.color.mode === 'opacity') {\n var colorOptions = panel.color;\n drawOpacityLegend(elem, colorOptions, rangeFrom, rangeTo, maxValue, minValue);\n }\n }\n }\n },\n };\n});\nfunction drawColorLegend(elem, colorScheme, rangeFrom, rangeTo, maxValue, minValue) {\n var legendElem = __WEBPACK_IMPORTED_MODULE_2_jquery___default()(elem).find('svg');\n var legend = __WEBPACK_IMPORTED_MODULE_3_d3__[\"select\"](legendElem.get(0));\n clearLegend(elem);\n var legendWidth = Math.floor(legendElem.outerWidth()) - 30;\n var legendHeight = legendElem.attr('height');\n var rangeStep = 1;\n if (rangeTo - rangeFrom > legendWidth) {\n rangeStep = Math.floor((rangeTo - rangeFrom) / legendWidth);\n }\n var widthFactor = legendWidth / (rangeTo - rangeFrom);\n var valuesRange = __WEBPACK_IMPORTED_MODULE_3_d3__[\"range\"](rangeFrom, rangeTo, rangeStep);\n var colorScale = Object(__WEBPACK_IMPORTED_MODULE_6__color_scale__[\"a\" /* getColorScale */])(colorScheme, __WEBPACK_IMPORTED_MODULE_4_app_core_core__[\"c\" /* contextSrv */].user.lightTheme, maxValue, minValue);\n legend\n .selectAll('.heatmap-color-legend-rect')\n .data(valuesRange)\n .enter()\n .append('rect')\n .attr('x', function (d) { return d * widthFactor; })\n .attr('y', 0)\n .attr('width', rangeStep * widthFactor + 1) // Overlap rectangles to prevent gaps\n .attr('height', legendHeight)\n .attr('stroke-width', 0)\n .attr('fill', function (d) { return colorScale(d); });\n drawLegendValues(elem, colorScale, rangeFrom, rangeTo, maxValue, minValue, legendWidth);\n}\nfunction drawOpacityLegend(elem, options, rangeFrom, rangeTo, maxValue, minValue) {\n var legendElem = __WEBPACK_IMPORTED_MODULE_2_jquery___default()(elem).find('svg');\n var legend = __WEBPACK_IMPORTED_MODULE_3_d3__[\"select\"](legendElem.get(0));\n clearLegend(elem);\n var legendWidth = Math.floor(legendElem.outerWidth()) - 30;\n var legendHeight = legendElem.attr('height');\n var rangeStep = 1;\n if (rangeTo - rangeFrom > legendWidth) {\n rangeStep = Math.floor((rangeTo - rangeFrom) / legendWidth);\n }\n var widthFactor = legendWidth / (rangeTo - rangeFrom);\n var valuesRange = __WEBPACK_IMPORTED_MODULE_3_d3__[\"range\"](rangeFrom, rangeTo, rangeStep);\n var opacityScale = Object(__WEBPACK_IMPORTED_MODULE_6__color_scale__[\"b\" /* getOpacityScale */])(options, maxValue, minValue);\n legend\n .selectAll('.heatmap-opacity-legend-rect')\n .data(valuesRange)\n .enter()\n .append('rect')\n .attr('x', function (d) { return d * widthFactor; })\n .attr('y', 0)\n .attr('width', rangeStep * widthFactor)\n .attr('height', legendHeight)\n .attr('stroke-width', 0)\n .attr('fill', options.cardColor)\n .style('opacity', function (d) { return opacityScale(d); });\n drawLegendValues(elem, opacityScale, rangeFrom, rangeTo, maxValue, minValue, legendWidth);\n}\nfunction drawLegendValues(elem, colorScale, rangeFrom, rangeTo, maxValue, minValue, legendWidth) {\n var legendElem = __WEBPACK_IMPORTED_MODULE_2_jquery___default()(elem).find('svg');\n var legend = __WEBPACK_IMPORTED_MODULE_3_d3__[\"select\"](legendElem.get(0));\n if (legendWidth <= 0 || legendElem.get(0).childNodes.length === 0) {\n return;\n }\n var legendValueScale = __WEBPACK_IMPORTED_MODULE_3_d3__[\"scaleLinear\"]()\n .domain([0, rangeTo])\n .range([0, legendWidth]);\n var ticks = buildLegendTicks(0, rangeTo, maxValue, minValue);\n var xAxis = __WEBPACK_IMPORTED_MODULE_3_d3__[\"axisBottom\"](legendValueScale)\n .tickValues(ticks)\n .tickSize(LEGEND_TICK_SIZE);\n var colorRect = legendElem.find(':first-child');\n var posY = getSvgElemHeight(legendElem) + LEGEND_VALUE_MARGIN;\n var posX = getSvgElemX(colorRect);\n __WEBPACK_IMPORTED_MODULE_3_d3__[\"select\"](legendElem.get(0))\n .append('g')\n .attr('class', 'axis')\n .attr('transform', 'translate(' + posX + ',' + posY + ')')\n .call(xAxis);\n legend\n .select('.axis')\n .select('.domain')\n .remove();\n}\nfunction drawSimpleColorLegend(elem, colorScale) {\n var legendElem = __WEBPACK_IMPORTED_MODULE_2_jquery___default()(elem).find('svg');\n clearLegend(elem);\n var legendWidth = Math.floor(legendElem.outerWidth());\n var legendHeight = legendElem.attr('height');\n if (legendWidth) {\n var valuesNumber = Math.floor(legendWidth / 2);\n var rangeStep = Math.floor(legendWidth / valuesNumber);\n var valuesRange = __WEBPACK_IMPORTED_MODULE_3_d3__[\"range\"](0, legendWidth, rangeStep);\n var legend = __WEBPACK_IMPORTED_MODULE_3_d3__[\"select\"](legendElem.get(0));\n var legendRects = legend.selectAll('.heatmap-color-legend-rect').data(valuesRange);\n legendRects\n .enter()\n .append('rect')\n .attr('x', function (d) { return d; })\n .attr('y', 0)\n .attr('width', rangeStep + 1) // Overlap rectangles to prevent gaps\n .attr('height', legendHeight)\n .attr('stroke-width', 0)\n .attr('fill', function (d) { return colorScale(d); });\n }\n}\nfunction drawSimpleOpacityLegend(elem, options) {\n var legendElem = __WEBPACK_IMPORTED_MODULE_2_jquery___default()(elem).find('svg');\n clearLegend(elem);\n var legend = __WEBPACK_IMPORTED_MODULE_3_d3__[\"select\"](legendElem.get(0));\n var legendWidth = Math.floor(legendElem.outerWidth());\n var legendHeight = legendElem.attr('height');\n if (legendWidth) {\n var legendOpacityScale_1;\n if (options.colorScale === 'linear') {\n legendOpacityScale_1 = __WEBPACK_IMPORTED_MODULE_3_d3__[\"scaleLinear\"]()\n .domain([0, legendWidth])\n .range([0, 1]);\n }\n else if (options.colorScale === 'sqrt') {\n legendOpacityScale_1 = __WEBPACK_IMPORTED_MODULE_3_d3__[\"scalePow\"]()\n .exponent(options.exponent)\n .domain([0, legendWidth])\n .range([0, 1]);\n }\n var rangeStep = 10;\n var valuesRange = __WEBPACK_IMPORTED_MODULE_3_d3__[\"range\"](0, legendWidth, rangeStep);\n var legendRects = legend.selectAll('.heatmap-opacity-legend-rect').data(valuesRange);\n legendRects\n .enter()\n .append('rect')\n .attr('x', function (d) { return d; })\n .attr('y', 0)\n .attr('width', rangeStep)\n .attr('height', legendHeight)\n .attr('stroke-width', 0)\n .attr('fill', options.cardColor)\n .style('opacity', function (d) { return legendOpacityScale_1(d); });\n }\n}\nfunction clearLegend(elem) {\n var legendElem = __WEBPACK_IMPORTED_MODULE_2_jquery___default()(elem).find('svg');\n legendElem.empty();\n}\nfunction getSvgElemX(elem) {\n var svgElem = elem.get(0);\n if (svgElem && svgElem.x && svgElem.x.baseVal) {\n return svgElem.x.baseVal.value;\n }\n else {\n return 0;\n }\n}\nfunction getSvgElemHeight(elem) {\n var svgElem = elem.get(0);\n if (svgElem && svgElem.height && svgElem.height.baseVal) {\n return svgElem.height.baseVal.value;\n }\n else {\n return 0;\n }\n}\nfunction buildLegendTicks(rangeFrom, rangeTo, maxValue, minValue) {\n var range = rangeTo - rangeFrom;\n var tickStepSize = Object(__WEBPACK_IMPORTED_MODULE_5_app_core_utils_ticks__[\"tickStep\"])(rangeFrom, rangeTo, 3);\n var ticksNum = Math.round(range / tickStepSize);\n var ticks = [];\n for (var i = 0; i < ticksNum; i++) {\n var current = tickStepSize * i;\n // Add user-defined min and max if it had been set\n if (isValueCloseTo(minValue, current, tickStepSize)) {\n ticks.push(minValue);\n continue;\n }\n else if (minValue < current) {\n ticks.push(minValue);\n }\n if (isValueCloseTo(maxValue, current, tickStepSize)) {\n ticks.push(maxValue);\n continue;\n }\n else if (maxValue < current) {\n ticks.push(maxValue);\n }\n ticks.push(tickStepSize * i);\n }\n if (!isValueCloseTo(maxValue, rangeTo, tickStepSize)) {\n ticks.push(maxValue);\n }\n ticks.push(rangeTo);\n ticks = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.sortBy(__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.uniq(ticks));\n return ticks;\n}\nfunction isValueCloseTo(val, valueTo, step) {\n var diff = Math.abs(val - valueTo);\n return diff < step * 0.3;\n}\n\n\n/***/ }),\n\n/***/ 2154:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return HeatmapCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_plugins_sdk__ = __webpack_require__(1983);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_utils_kbn__ = __webpack_require__(312);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_app_core_time_series2__ = __webpack_require__(313);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__axes_editor__ = __webpack_require__(2155);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__display_editor__ = __webpack_require__(2156);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__rendering__ = __webpack_require__(2157);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__heatmap_data_converter__ = __webpack_require__(1991);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n\n\n\n\n\nvar X_BUCKET_NUMBER_DEFAULT = 30;\nvar Y_BUCKET_NUMBER_DEFAULT = 10;\nvar panelDefaults = {\n heatmap: {},\n cards: {\n cardPadding: null,\n cardRound: null,\n },\n color: {\n mode: 'spectrum',\n cardColor: '#b4ff00',\n colorScale: 'sqrt',\n exponent: 0.5,\n colorScheme: 'interpolateOranges',\n },\n legend: {\n show: false,\n },\n dataFormat: 'timeseries',\n yBucketBound: 'auto',\n xAxis: {\n show: true,\n },\n yAxis: {\n show: true,\n format: 'short',\n decimals: null,\n logBase: 1,\n splitFactor: null,\n min: null,\n max: null,\n },\n xBucketSize: null,\n xBucketNumber: null,\n yBucketSize: null,\n yBucketNumber: null,\n tooltip: {\n show: true,\n showHistogram: false,\n },\n highlightCards: true,\n};\nvar colorModes = ['opacity', 'spectrum'];\nvar opacityScales = ['linear', 'sqrt'];\n// Schemes from d3-scale-chromatic\n// https://github.com/d3/d3-scale-chromatic\nvar colorSchemes = [\n // Diverging\n { name: 'Spectral', value: 'interpolateSpectral', invert: 'always' },\n { name: 'RdYlGn', value: 'interpolateRdYlGn', invert: 'always' },\n // Sequential (Single Hue)\n { name: 'Blues', value: 'interpolateBlues', invert: 'dark' },\n { name: 'Greens', value: 'interpolateGreens', invert: 'dark' },\n { name: 'Greys', value: 'interpolateGreys', invert: 'dark' },\n { name: 'Oranges', value: 'interpolateOranges', invert: 'dark' },\n { name: 'Purples', value: 'interpolatePurples', invert: 'dark' },\n { name: 'Reds', value: 'interpolateReds', invert: 'dark' },\n // Sequential (Multi-Hue)\n { name: 'BuGn', value: 'interpolateBuGn', invert: 'dark' },\n { name: 'BuPu', value: 'interpolateBuPu', invert: 'dark' },\n { name: 'GnBu', value: 'interpolateGnBu', invert: 'dark' },\n { name: 'OrRd', value: 'interpolateOrRd', invert: 'dark' },\n { name: 'PuBuGn', value: 'interpolatePuBuGn', invert: 'dark' },\n { name: 'PuBu', value: 'interpolatePuBu', invert: 'dark' },\n { name: 'PuRd', value: 'interpolatePuRd', invert: 'dark' },\n { name: 'RdPu', value: 'interpolateRdPu', invert: 'dark' },\n { name: 'YlGnBu', value: 'interpolateYlGnBu', invert: 'dark' },\n { name: 'YlGn', value: 'interpolateYlGn', invert: 'dark' },\n { name: 'YlOrBr', value: 'interpolateYlOrBr', invert: 'dark' },\n { name: 'YlOrRd', value: 'interpolateYlOrRd', invert: 'darm' },\n];\nvar ds_support_histogram_sort = ['prometheus', 'elasticsearch'];\nvar HeatmapCtrl = /** @class */ (function (_super) {\n __extends(HeatmapCtrl, _super);\n /** @ngInject */\n HeatmapCtrl.$inject = [\"$scope\", \"$injector\", \"timeSrv\"];\n function HeatmapCtrl($scope, $injector, timeSrv) {\n var _this = _super.call(this, $scope, $injector) || this;\n _this.opacityScales = [];\n _this.colorModes = [];\n _this.colorSchemes = [];\n _this.timeSrv = timeSrv;\n _this.selectionActivated = false;\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.defaultsDeep(_this.panel, panelDefaults);\n _this.opacityScales = opacityScales;\n _this.colorModes = colorModes;\n _this.colorSchemes = colorSchemes;\n // Bind grafana panel events\n _this.events.on('render', _this.onRender.bind(_this));\n _this.events.on('data-received', _this.onDataReceived.bind(_this));\n _this.events.on('data-error', _this.onDataError.bind(_this));\n _this.events.on('data-snapshot-load', _this.onDataReceived.bind(_this));\n _this.events.on('init-edit-mode', _this.onInitEditMode.bind(_this));\n _this.onCardColorChange = _this.onCardColorChange.bind(_this);\n return _this;\n }\n HeatmapCtrl.prototype.onInitEditMode = function () {\n this.addEditorTab('Axes', __WEBPACK_IMPORTED_MODULE_4__axes_editor__[\"a\" /* axesEditor */], 2);\n this.addEditorTab('Display', __WEBPACK_IMPORTED_MODULE_5__display_editor__[\"a\" /* heatmapDisplayEditor */], 3);\n this.unitFormats = __WEBPACK_IMPORTED_MODULE_2_app_core_utils_kbn__[\"a\" /* default */].getUnitFormats();\n };\n HeatmapCtrl.prototype.zoomOut = function (evt) {\n this.publishAppEvent('zoom-out', 2);\n };\n HeatmapCtrl.prototype.onRender = function () {\n if (!this.range) {\n return;\n }\n if (this.panel.dataFormat === 'tsbuckets') {\n this.convertHistogramToHeatmapData();\n }\n else {\n this.convertTimeSeriesToHeatmapData();\n }\n };\n HeatmapCtrl.prototype.convertTimeSeriesToHeatmapData = function () {\n var xBucketSize, yBucketSize, bucketsData, heatmapStats;\n var logBase = this.panel.yAxis.logBase;\n var xBucketNumber = this.panel.xBucketNumber || X_BUCKET_NUMBER_DEFAULT;\n var xBucketSizeByNumber = Math.floor((this.range.to - this.range.from) / xBucketNumber);\n // Parse X bucket size (number or interval)\n var isIntervalString = __WEBPACK_IMPORTED_MODULE_2_app_core_utils_kbn__[\"a\" /* default */].interval_regex.test(this.panel.xBucketSize);\n if (isIntervalString) {\n xBucketSize = __WEBPACK_IMPORTED_MODULE_2_app_core_utils_kbn__[\"a\" /* default */].interval_to_ms(this.panel.xBucketSize);\n }\n else if (isNaN(Number(this.panel.xBucketSize)) ||\n this.panel.xBucketSize === '' ||\n this.panel.xBucketSize === null) {\n xBucketSize = xBucketSizeByNumber;\n }\n else {\n xBucketSize = Number(this.panel.xBucketSize);\n }\n // Calculate Y bucket size\n heatmapStats = this.parseSeries(this.series);\n var yBucketNumber = this.panel.yBucketNumber || Y_BUCKET_NUMBER_DEFAULT;\n if (logBase !== 1) {\n yBucketSize = this.panel.yAxis.splitFactor;\n }\n else {\n if (heatmapStats.max === heatmapStats.min) {\n if (heatmapStats.max) {\n yBucketSize = heatmapStats.max / Y_BUCKET_NUMBER_DEFAULT;\n }\n else {\n yBucketSize = 1;\n }\n }\n else {\n yBucketSize = (heatmapStats.max - heatmapStats.min) / yBucketNumber;\n }\n yBucketSize = this.panel.yBucketSize || yBucketSize;\n }\n bucketsData = Object(__WEBPACK_IMPORTED_MODULE_7__heatmap_data_converter__[\"c\" /* convertToHeatMap */])(this.series, yBucketSize, xBucketSize, logBase);\n // Set default Y range if no data\n if (!heatmapStats.min && !heatmapStats.max) {\n heatmapStats = { min: -1, max: 1, minLog: 1 };\n yBucketSize = 1;\n }\n var _a = Object(__WEBPACK_IMPORTED_MODULE_7__heatmap_data_converter__[\"b\" /* convertToCards */])(bucketsData), cards = _a.cards, cardStats = _a.cardStats;\n this.data = {\n buckets: bucketsData,\n heatmapStats: heatmapStats,\n xBucketSize: xBucketSize,\n yBucketSize: yBucketSize,\n cards: cards,\n cardStats: cardStats,\n };\n };\n HeatmapCtrl.prototype.convertHistogramToHeatmapData = function () {\n var panelDatasource = this.getPanelDataSourceType();\n var xBucketSize, yBucketSize, bucketsData, tsBuckets;\n // Try to sort series by bucket bound, if datasource doesn't do it.\n if (!__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.includes(ds_support_histogram_sort, panelDatasource)) {\n this.series.sort(__WEBPACK_IMPORTED_MODULE_7__heatmap_data_converter__[\"g\" /* sortSeriesByLabel */]);\n }\n // Convert histogram to heatmap. Each histogram bucket represented by the series which name is\n // a top (or bottom, depends of datasource) bucket bound. Further, these values will be used as X axis labels.\n bucketsData = Object(__WEBPACK_IMPORTED_MODULE_7__heatmap_data_converter__[\"e\" /* histogramToHeatmap */])(this.series);\n tsBuckets = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(this.series, 'label');\n var yBucketBound = this.panel.yBucketBound;\n if ((panelDatasource === 'prometheus' && yBucketBound !== 'lower') || yBucketBound === 'upper') {\n // Prometheus labels are upper inclusive bounds, so add empty bottom bucket label.\n tsBuckets = [''].concat(tsBuckets);\n }\n else {\n // Elasticsearch uses labels as lower bucket bounds, so add empty top bucket label.\n // Use this as a default mode as well.\n tsBuckets.push('');\n }\n // Calculate bucket size based on heatmap data\n var xBucketBoundSet = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.keys(bucketsData), function (key) { return Number(key); });\n xBucketSize = Object(__WEBPACK_IMPORTED_MODULE_7__heatmap_data_converter__[\"a\" /* calculateBucketSize */])(xBucketBoundSet);\n // Always let yBucketSize=1 in 'tsbuckets' mode\n yBucketSize = 1;\n var _a = Object(__WEBPACK_IMPORTED_MODULE_7__heatmap_data_converter__[\"b\" /* convertToCards */])(bucketsData), cards = _a.cards, cardStats = _a.cardStats;\n this.data = {\n buckets: bucketsData,\n xBucketSize: xBucketSize,\n yBucketSize: yBucketSize,\n tsBuckets: tsBuckets,\n cards: cards,\n cardStats: cardStats,\n };\n };\n HeatmapCtrl.prototype.getPanelDataSourceType = function () {\n if (this.datasource.meta && this.datasource.meta.id) {\n return this.datasource.meta.id;\n }\n else {\n return 'unknown';\n }\n };\n HeatmapCtrl.prototype.onDataReceived = function (dataList) {\n this.series = dataList.map(this.seriesHandler.bind(this));\n this.dataWarning = null;\n var datapointsCount = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.reduce(this.series, function (sum, series) {\n return sum + series.datapoints.length;\n }, 0);\n if (datapointsCount === 0) {\n this.dataWarning = {\n title: 'No data points',\n tip: 'No datapoints returned from data query',\n };\n }\n else {\n for (var _i = 0, _a = this.series; _i < _a.length; _i++) {\n var series = _a[_i];\n if (series.isOutsideRange) {\n this.dataWarning = {\n title: 'Data points outside time range',\n tip: 'Can be caused by timezone mismatch or missing time filter in query',\n };\n break;\n }\n }\n }\n this.render();\n };\n HeatmapCtrl.prototype.onDataError = function () {\n this.series = [];\n this.render();\n };\n HeatmapCtrl.prototype.onCardColorChange = function (newColor) {\n this.panel.color.cardColor = newColor;\n this.render();\n };\n HeatmapCtrl.prototype.seriesHandler = function (seriesData) {\n var series = new __WEBPACK_IMPORTED_MODULE_3_app_core_time_series2__[\"a\" /* default */]({\n datapoints: seriesData.datapoints,\n alias: seriesData.target,\n });\n series.flotpairs = series.getFlotPairs(this.panel.nullPointMode);\n var datapoints = seriesData.datapoints || [];\n if (datapoints && datapoints.length > 0) {\n var last = datapoints[datapoints.length - 1][1];\n var from = this.range.from;\n if (last - from < -10000) {\n series.isOutsideRange = true;\n }\n }\n return series;\n };\n HeatmapCtrl.prototype.parseSeries = function (series) {\n var min = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.min(__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(series, function (s) { return s.stats.min; }));\n var minLog = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.min(__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(series, function (s) { return s.stats.logmin; }));\n var max = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.max(__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(series, function (s) { return s.stats.max; }));\n return {\n max: max,\n min: min,\n minLog: minLog,\n };\n };\n HeatmapCtrl.prototype.parseHistogramSeries = function (series) {\n var bounds = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(series, function (s) { return Number(s.alias); });\n var min = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.min(bounds);\n var minLog = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.min(bounds);\n var max = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.max(bounds);\n return {\n max: max,\n min: min,\n minLog: minLog,\n };\n };\n HeatmapCtrl.prototype.link = function (scope, elem, attrs, ctrl) {\n Object(__WEBPACK_IMPORTED_MODULE_6__rendering__[\"a\" /* default */])(scope, elem, attrs, ctrl);\n };\n HeatmapCtrl.templateUrl = 'module.html';\n return HeatmapCtrl;\n}(__WEBPACK_IMPORTED_MODULE_0_app_plugins_sdk__[\"MetricsPanelCtrl\"]));\n\n\n\n/***/ }),\n\n/***/ 2155:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export AxesEditorCtrl */\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = axesEditor;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_utils_kbn__ = __webpack_require__(312);\n\nvar AxesEditorCtrl = /** @class */ (function () {\n /** @ngInject */\n AxesEditorCtrl.$inject = [\"$scope\", \"uiSegmentSrv\"];\n function AxesEditorCtrl($scope, uiSegmentSrv) {\n $scope.editor = this;\n this.panelCtrl = $scope.ctrl;\n this.panel = this.panelCtrl.panel;\n this.unitFormats = __WEBPACK_IMPORTED_MODULE_0_app_core_utils_kbn__[\"a\" /* default */].getUnitFormats();\n this.logScales = {\n linear: 1,\n 'log (base 2)': 2,\n 'log (base 10)': 10,\n 'log (base 32)': 32,\n 'log (base 1024)': 1024,\n };\n this.dataFormats = {\n 'Time series': 'timeseries',\n 'Time series buckets': 'tsbuckets',\n };\n this.yBucketBoundModes = {\n Auto: 'auto',\n Upper: 'upper',\n Lower: 'lower',\n };\n }\n AxesEditorCtrl.prototype.setUnitFormat = function (subItem) {\n this.panel.yAxis.format = subItem.value;\n this.panelCtrl.render();\n };\n return AxesEditorCtrl;\n}());\n\n/** @ngInject */\nfunction axesEditor() {\n 'use strict';\n return {\n restrict: 'E',\n scope: true,\n templateUrl: 'public/app/plugins/panel/heatmap/partials/axes_editor.html',\n controller: AxesEditorCtrl,\n };\n}\n\n\n/***/ }),\n\n/***/ 2156:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export HeatmapDisplayEditorCtrl */\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = heatmapDisplayEditor;\nvar HeatmapDisplayEditorCtrl = /** @class */ (function () {\n /** @ngInject */\n HeatmapDisplayEditorCtrl.$inject = [\"$scope\"];\n function HeatmapDisplayEditorCtrl($scope) {\n $scope.editor = this;\n this.panelCtrl = $scope.ctrl;\n this.panel = this.panelCtrl.panel;\n this.panelCtrl.render();\n }\n return HeatmapDisplayEditorCtrl;\n}());\n\n/** @ngInject */\nfunction heatmapDisplayEditor() {\n 'use strict';\n return {\n restrict: 'E',\n scope: true,\n templateUrl: 'public/app/plugins/panel/heatmap/partials/display_editor.html',\n controller: HeatmapDisplayEditorCtrl,\n };\n}\n\n\n/***/ }),\n\n/***/ 2157:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = link;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery__ = __webpack_require__(17);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_jquery__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_moment__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_moment__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_d3__ = __webpack_require__(695);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_app_core_utils_kbn__ = __webpack_require__(312);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_app_core_core__ = __webpack_require__(197);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_app_core_utils_ticks__ = __webpack_require__(696);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__heatmap_tooltip__ = __webpack_require__(2158);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__heatmap_data_converter__ = __webpack_require__(1991);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__color_scale__ = __webpack_require__(2013);\n\n\n\n\n\n\n\n\n\n\nvar MIN_CARD_SIZE = 1, CARD_PADDING = 1, CARD_ROUND = 0, DATA_RANGE_WIDING_FACTOR = 1.2, DEFAULT_X_TICK_SIZE_PX = 100, DEFAULT_Y_TICK_SIZE_PX = 50, X_AXIS_TICK_PADDING = 10, Y_AXIS_TICK_PADDING = 5, MIN_SELECTION_WIDTH = 2;\nfunction link(scope, elem, attrs, ctrl) {\n var data, timeRange, panel, heatmap;\n // $heatmap is JQuery object, but heatmap is D3\n var $heatmap = elem.find('.heatmap-panel');\n var tooltip = new __WEBPACK_IMPORTED_MODULE_7__heatmap_tooltip__[\"a\" /* HeatmapTooltip */]($heatmap, scope);\n var width, height, yScale, xScale, chartWidth, chartHeight, chartTop, chartBottom, yAxisWidth, xAxisHeight, cardPadding, cardRound, cardWidth, cardHeight, colorScale, opacityScale, mouseUpHandler;\n var selection = {\n active: false,\n x1: -1,\n x2: -1,\n };\n var padding = { left: 0, right: 0, top: 0, bottom: 0 }, margin = { left: 25, right: 15, top: 10, bottom: 20 }, dataRangeWidingFactor = DATA_RANGE_WIDING_FACTOR;\n ctrl.events.on('render', function () {\n render();\n ctrl.renderingCompleted();\n });\n function setElementHeight() {\n try {\n var height = ctrl.height || panel.height || ctrl.row.height;\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isString(height)) {\n height = parseInt(height.replace('px', ''), 10);\n }\n height -= panel.legend.show ? 28 : 11; // bottom padding and space for legend\n $heatmap.css('height', height + 'px');\n return true;\n }\n catch (e) {\n // IE throws errors sometimes\n return false;\n }\n }\n function getYAxisWidth(elem) {\n var axis_text = elem.selectAll('.axis-y text').nodes();\n var max_text_width = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.max(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(axis_text, function (text) {\n // Use SVG getBBox method\n return text.getBBox().width;\n }));\n return max_text_width;\n }\n function getXAxisHeight(elem) {\n var axis_line = elem.select('.axis-x line');\n if (!axis_line.empty()) {\n var axis_line_position = parseFloat(elem.select('.axis-x line').attr('y2'));\n var canvas_width = parseFloat(elem.attr('height'));\n return canvas_width - axis_line_position;\n }\n else {\n // Default height\n return 30;\n }\n }\n function addXAxis() {\n scope.xScale = xScale = __WEBPACK_IMPORTED_MODULE_3_d3__[\"scaleTime\"]()\n .domain([timeRange.from, timeRange.to])\n .range([0, chartWidth]);\n var ticks = chartWidth / DEFAULT_X_TICK_SIZE_PX;\n var grafanaTimeFormatter = __WEBPACK_IMPORTED_MODULE_6_app_core_utils_ticks__[\"grafanaTimeFormat\"](ticks, timeRange.from, timeRange.to);\n var timeFormat;\n var dashboardTimeZone = ctrl.dashboard.getTimezone();\n if (dashboardTimeZone === 'utc') {\n timeFormat = __WEBPACK_IMPORTED_MODULE_3_d3__[\"utcFormat\"](grafanaTimeFormatter);\n }\n else {\n timeFormat = __WEBPACK_IMPORTED_MODULE_3_d3__[\"timeFormat\"](grafanaTimeFormatter);\n }\n var xAxis = __WEBPACK_IMPORTED_MODULE_3_d3__[\"axisBottom\"](xScale)\n .ticks(ticks)\n .tickFormat(timeFormat)\n .tickPadding(X_AXIS_TICK_PADDING)\n .tickSize(chartHeight);\n var posY = margin.top;\n var posX = yAxisWidth;\n heatmap\n .append('g')\n .attr('class', 'axis axis-x')\n .attr('transform', 'translate(' + posX + ',' + posY + ')')\n .call(xAxis);\n // Remove horizontal line in the top of axis labels (called domain in d3)\n heatmap\n .select('.axis-x')\n .select('.domain')\n .remove();\n }\n function addYAxis() {\n var ticks = Math.ceil(chartHeight / DEFAULT_Y_TICK_SIZE_PX);\n var tick_interval = __WEBPACK_IMPORTED_MODULE_6_app_core_utils_ticks__[\"tickStep\"](data.heatmapStats.min, data.heatmapStats.max, ticks);\n var _a = wideYAxisRange(data.heatmapStats.min, data.heatmapStats.max, tick_interval), y_min = _a.y_min, y_max = _a.y_max;\n // Rewrite min and max if it have been set explicitly\n y_min = panel.yAxis.min !== null ? panel.yAxis.min : y_min;\n y_max = panel.yAxis.max !== null ? panel.yAxis.max : y_max;\n // Adjust ticks after Y range widening\n tick_interval = __WEBPACK_IMPORTED_MODULE_6_app_core_utils_ticks__[\"tickStep\"](y_min, y_max, ticks);\n ticks = Math.ceil((y_max - y_min) / tick_interval);\n var decimalsAuto = __WEBPACK_IMPORTED_MODULE_6_app_core_utils_ticks__[\"getPrecision\"](tick_interval);\n var decimals = panel.yAxis.decimals === null ? decimalsAuto : panel.yAxis.decimals;\n // Calculate scaledDecimals for log scales using tick size (as in jquery.flot.js)\n var flot_tick_size = __WEBPACK_IMPORTED_MODULE_6_app_core_utils_ticks__[\"getFlotTickSize\"](y_min, y_max, ticks, decimalsAuto);\n var scaledDecimals = __WEBPACK_IMPORTED_MODULE_6_app_core_utils_ticks__[\"getScaledDecimals\"](decimals, flot_tick_size);\n ctrl.decimals = decimals;\n ctrl.scaledDecimals = scaledDecimals;\n // Set default Y min and max if no data\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isEmpty(data.buckets)) {\n y_max = 1;\n y_min = -1;\n ticks = 3;\n decimals = 1;\n }\n data.yAxis = {\n min: y_min,\n max: y_max,\n ticks: ticks,\n };\n scope.yScale = yScale = __WEBPACK_IMPORTED_MODULE_3_d3__[\"scaleLinear\"]()\n .domain([y_min, y_max])\n .range([chartHeight, 0]);\n var yAxis = __WEBPACK_IMPORTED_MODULE_3_d3__[\"axisLeft\"](yScale)\n .ticks(ticks)\n .tickFormat(tickValueFormatter(decimals, scaledDecimals))\n .tickSizeInner(0 - width)\n .tickSizeOuter(0)\n .tickPadding(Y_AXIS_TICK_PADDING);\n heatmap\n .append('g')\n .attr('class', 'axis axis-y')\n .call(yAxis);\n // Calculate Y axis width first, then move axis into visible area\n var posY = margin.top;\n var posX = getYAxisWidth(heatmap) + Y_AXIS_TICK_PADDING;\n heatmap.select('.axis-y').attr('transform', 'translate(' + posX + ',' + posY + ')');\n // Remove vertical line in the right of axis labels (called domain in d3)\n heatmap\n .select('.axis-y')\n .select('.domain')\n .remove();\n }\n // Wide Y values range and anjust to bucket size\n function wideYAxisRange(min, max, tickInterval) {\n var y_widing = (max * (dataRangeWidingFactor - 1) - min * (dataRangeWidingFactor - 1)) / 2;\n var y_min, y_max;\n if (tickInterval === 0) {\n y_max = max * dataRangeWidingFactor;\n y_min = min - min * (dataRangeWidingFactor - 1);\n tickInterval = (y_max - y_min) / 2;\n }\n else {\n y_max = Math.ceil((max + y_widing) / tickInterval) * tickInterval;\n y_min = Math.floor((min - y_widing) / tickInterval) * tickInterval;\n }\n // Don't wide axis below 0 if all values are positive\n if (min >= 0 && y_min < 0) {\n y_min = 0;\n }\n return { y_min: y_min, y_max: y_max };\n }\n function addLogYAxis() {\n var log_base = panel.yAxis.logBase;\n var _a = adjustLogRange(data.heatmapStats.minLog, data.heatmapStats.max, log_base), y_min = _a.y_min, y_max = _a.y_max;\n y_min = panel.yAxis.min && panel.yAxis.min !== '0' ? adjustLogMin(panel.yAxis.min, log_base) : y_min;\n y_max = panel.yAxis.max !== null ? adjustLogMax(panel.yAxis.max, log_base) : y_max;\n // Set default Y min and max if no data\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isEmpty(data.buckets)) {\n y_max = Math.pow(log_base, 2);\n y_min = 1;\n }\n scope.yScale = yScale = __WEBPACK_IMPORTED_MODULE_3_d3__[\"scaleLog\"]()\n .base(panel.yAxis.logBase)\n .domain([y_min, y_max])\n .range([chartHeight, 0]);\n var domain = yScale.domain();\n var tick_values = logScaleTickValues(domain, log_base);\n var decimalsAuto = __WEBPACK_IMPORTED_MODULE_6_app_core_utils_ticks__[\"getPrecision\"](y_min);\n var decimals = panel.yAxis.decimals || decimalsAuto;\n // Calculate scaledDecimals for log scales using tick size (as in jquery.flot.js)\n var flot_tick_size = __WEBPACK_IMPORTED_MODULE_6_app_core_utils_ticks__[\"getFlotTickSize\"](y_min, y_max, tick_values.length, decimalsAuto);\n var scaledDecimals = __WEBPACK_IMPORTED_MODULE_6_app_core_utils_ticks__[\"getScaledDecimals\"](decimals, flot_tick_size);\n ctrl.decimals = decimals;\n ctrl.scaledDecimals = scaledDecimals;\n data.yAxis = {\n min: y_min,\n max: y_max,\n ticks: tick_values.length,\n };\n var yAxis = __WEBPACK_IMPORTED_MODULE_3_d3__[\"axisLeft\"](yScale)\n .tickValues(tick_values)\n .tickFormat(tickValueFormatter(decimals, scaledDecimals))\n .tickSizeInner(0 - width)\n .tickSizeOuter(0)\n .tickPadding(Y_AXIS_TICK_PADDING);\n heatmap\n .append('g')\n .attr('class', 'axis axis-y')\n .call(yAxis);\n // Calculate Y axis width first, then move axis into visible area\n var posY = margin.top;\n var posX = getYAxisWidth(heatmap) + Y_AXIS_TICK_PADDING;\n heatmap.select('.axis-y').attr('transform', 'translate(' + posX + ',' + posY + ')');\n // Set first tick as pseudo 0\n if (y_min < 1) {\n heatmap\n .select('.axis-y')\n .select('.tick text')\n .text('0');\n }\n // Remove vertical line in the right of axis labels (called domain in d3)\n heatmap\n .select('.axis-y')\n .select('.domain')\n .remove();\n }\n function addYAxisFromBuckets() {\n var tsBuckets = data.tsBuckets;\n scope.yScale = yScale = __WEBPACK_IMPORTED_MODULE_3_d3__[\"scaleLinear\"]()\n .domain([0, tsBuckets.length - 1])\n .range([chartHeight, 0]);\n var tick_values = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(tsBuckets, function (b, i) { return i; });\n var decimalsAuto = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.max(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(tsBuckets, __WEBPACK_IMPORTED_MODULE_6_app_core_utils_ticks__[\"getStringPrecision\"]));\n var decimals = panel.yAxis.decimals === null ? decimalsAuto : panel.yAxis.decimals;\n ctrl.decimals = decimals;\n function tickFormatter(valIndex) {\n var valueFormatted = tsBuckets[valIndex];\n if (!__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isNaN(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.toNumber(valueFormatted)) && valueFormatted !== '') {\n // Try to format numeric tick labels\n valueFormatted = tickValueFormatter(decimals)(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.toNumber(valueFormatted));\n }\n return valueFormatted;\n }\n var tsBucketsFormatted = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(tsBuckets, function (v, i) { return tickFormatter(i); });\n data.tsBucketsFormatted = tsBucketsFormatted;\n var yAxis = __WEBPACK_IMPORTED_MODULE_3_d3__[\"axisLeft\"](yScale)\n .tickValues(tick_values)\n .tickFormat(tickFormatter)\n .tickSizeInner(0 - width)\n .tickSizeOuter(0)\n .tickPadding(Y_AXIS_TICK_PADDING);\n heatmap\n .append('g')\n .attr('class', 'axis axis-y')\n .call(yAxis);\n // Calculate Y axis width first, then move axis into visible area\n var posY = margin.top;\n var posX = getYAxisWidth(heatmap) + Y_AXIS_TICK_PADDING;\n heatmap.select('.axis-y').attr('transform', 'translate(' + posX + ',' + posY + ')');\n // Remove vertical line in the right of axis labels (called domain in d3)\n heatmap\n .select('.axis-y')\n .select('.domain')\n .remove();\n }\n // Adjust data range to log base\n function adjustLogRange(min, max, logBase) {\n var y_min, y_max;\n y_min = data.heatmapStats.minLog;\n if (data.heatmapStats.minLog > 1 || !data.heatmapStats.minLog) {\n y_min = 1;\n }\n else {\n y_min = adjustLogMin(data.heatmapStats.minLog, logBase);\n }\n // Adjust max Y value to log base\n y_max = adjustLogMax(data.heatmapStats.max, logBase);\n return { y_min: y_min, y_max: y_max };\n }\n function adjustLogMax(max, base) {\n return Math.pow(base, Math.ceil(__WEBPACK_IMPORTED_MODULE_6_app_core_utils_ticks__[\"logp\"](max, base)));\n }\n function adjustLogMin(min, base) {\n return Math.pow(base, Math.floor(__WEBPACK_IMPORTED_MODULE_6_app_core_utils_ticks__[\"logp\"](min, base)));\n }\n function logScaleTickValues(domain, base) {\n var domainMin = domain[0];\n var domainMax = domain[1];\n var tickValues = [];\n if (domainMin < 1) {\n var under_one_ticks = Math.floor(__WEBPACK_IMPORTED_MODULE_6_app_core_utils_ticks__[\"logp\"](domainMin, base));\n for (var i = under_one_ticks; i < 0; i++) {\n var tick_value = Math.pow(base, i);\n tickValues.push(tick_value);\n }\n }\n var ticks = Math.ceil(__WEBPACK_IMPORTED_MODULE_6_app_core_utils_ticks__[\"logp\"](domainMax, base));\n for (var i = 0; i <= ticks; i++) {\n var tick_value = Math.pow(base, i);\n tickValues.push(tick_value);\n }\n return tickValues;\n }\n function tickValueFormatter(decimals, scaledDecimals) {\n if (scaledDecimals === void 0) { scaledDecimals = null; }\n var format = panel.yAxis.format;\n return function (value) {\n try {\n return format !== 'none' ? __WEBPACK_IMPORTED_MODULE_4_app_core_utils_kbn__[\"a\" /* default */].valueFormats[format](value, decimals, scaledDecimals) : value;\n }\n catch (err) {\n console.error(err.message || err);\n return value;\n }\n };\n }\n ctrl.tickValueFormatter = tickValueFormatter;\n function fixYAxisTickSize() {\n heatmap\n .select('.axis-y')\n .selectAll('.tick line')\n .attr('x2', chartWidth);\n }\n function addAxes() {\n chartHeight = height - margin.top - margin.bottom;\n chartTop = margin.top;\n chartBottom = chartTop + chartHeight;\n if (panel.dataFormat === 'tsbuckets') {\n addYAxisFromBuckets();\n }\n else {\n if (panel.yAxis.logBase === 1) {\n addYAxis();\n }\n else {\n addLogYAxis();\n }\n }\n yAxisWidth = getYAxisWidth(heatmap) + Y_AXIS_TICK_PADDING;\n chartWidth = width - yAxisWidth - margin.right;\n fixYAxisTickSize();\n addXAxis();\n xAxisHeight = getXAxisHeight(heatmap);\n if (!panel.yAxis.show) {\n heatmap\n .select('.axis-y')\n .selectAll('line')\n .style('opacity', 0);\n }\n if (!panel.xAxis.show) {\n heatmap\n .select('.axis-x')\n .selectAll('line')\n .style('opacity', 0);\n }\n }\n function addHeatmapCanvas() {\n var heatmap_elem = $heatmap[0];\n width = Math.floor($heatmap.width()) - padding.right;\n height = Math.floor($heatmap.height()) - padding.bottom;\n cardPadding = panel.cards.cardPadding !== null ? panel.cards.cardPadding : CARD_PADDING;\n cardRound = panel.cards.cardRound !== null ? panel.cards.cardRound : CARD_ROUND;\n if (heatmap) {\n heatmap.remove();\n }\n heatmap = __WEBPACK_IMPORTED_MODULE_3_d3__[\"select\"](heatmap_elem)\n .append('svg')\n .attr('width', width)\n .attr('height', height);\n }\n function addHeatmap() {\n addHeatmapCanvas();\n addAxes();\n if (panel.yAxis.logBase !== 1 && panel.dataFormat !== 'tsbuckets') {\n var log_base = panel.yAxis.logBase;\n var domain = yScale.domain();\n var tick_values = logScaleTickValues(domain, log_base);\n data.buckets = Object(__WEBPACK_IMPORTED_MODULE_8__heatmap_data_converter__[\"f\" /* mergeZeroBuckets */])(data.buckets, __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.min(tick_values));\n }\n var cardsData = data.cards;\n var maxValueAuto = data.cardStats.max;\n var maxValue = panel.color.max || maxValueAuto;\n var minValue = panel.color.min || 0;\n var colorScheme = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(ctrl.colorSchemes, {\n value: panel.color.colorScheme,\n });\n colorScale = Object(__WEBPACK_IMPORTED_MODULE_9__color_scale__[\"a\" /* getColorScale */])(colorScheme, __WEBPACK_IMPORTED_MODULE_5_app_core_core__[\"c\" /* contextSrv */].user.lightTheme, maxValue, minValue);\n opacityScale = Object(__WEBPACK_IMPORTED_MODULE_9__color_scale__[\"b\" /* getOpacityScale */])(panel.color, maxValue);\n setCardSize();\n var cards = heatmap.selectAll('.heatmap-card').data(cardsData);\n cards.append('title');\n cards = cards\n .enter()\n .append('rect')\n .attr('x', getCardX)\n .attr('width', getCardWidth)\n .attr('y', getCardY)\n .attr('height', getCardHeight)\n .attr('rx', cardRound)\n .attr('ry', cardRound)\n .attr('class', 'bordered heatmap-card')\n .style('fill', getCardColor)\n .style('stroke', getCardColor)\n .style('stroke-width', 0)\n .style('opacity', getCardOpacity);\n var $cards = $heatmap.find('.heatmap-card');\n $cards\n .on('mouseenter', function (event) {\n tooltip.mouseOverBucket = true;\n highlightCard(event);\n })\n .on('mouseleave', function (event) {\n tooltip.mouseOverBucket = false;\n resetCardHighLight(event);\n });\n }\n function highlightCard(event) {\n var color = __WEBPACK_IMPORTED_MODULE_3_d3__[\"select\"](event.target).style('fill');\n var highlightColor = __WEBPACK_IMPORTED_MODULE_3_d3__[\"color\"](color).darker(2);\n var strokeColor = __WEBPACK_IMPORTED_MODULE_3_d3__[\"color\"](color).brighter(4);\n var current_card = __WEBPACK_IMPORTED_MODULE_3_d3__[\"select\"](event.target);\n tooltip.originalFillColor = color;\n current_card\n .style('fill', highlightColor.toString())\n .style('stroke', strokeColor.toString())\n .style('stroke-width', 1);\n }\n function resetCardHighLight(event) {\n __WEBPACK_IMPORTED_MODULE_3_d3__[\"select\"](event.target)\n .style('fill', tooltip.originalFillColor)\n .style('stroke', tooltip.originalFillColor)\n .style('stroke-width', 0);\n }\n function setCardSize() {\n var xGridSize = Math.floor(xScale(data.xBucketSize) - xScale(0));\n var yGridSize = Math.floor(yScale(yScale.invert(0) - data.yBucketSize));\n if (panel.yAxis.logBase !== 1) {\n var base = panel.yAxis.logBase;\n var splitFactor = data.yBucketSize || 1;\n yGridSize = Math.floor((yScale(1) - yScale(base)) / splitFactor);\n }\n cardWidth = xGridSize - cardPadding * 2;\n cardHeight = yGridSize ? yGridSize - cardPadding * 2 : 0;\n }\n function getCardX(d) {\n var x;\n if (xScale(d.x) < 0) {\n // Cut card left to prevent overlay\n x = yAxisWidth + cardPadding;\n }\n else {\n x = xScale(d.x) + yAxisWidth + cardPadding;\n }\n return x;\n }\n function getCardWidth(d) {\n var w;\n if (xScale(d.x) < 0) {\n // Cut card left to prevent overlay\n var cutted_width = xScale(d.x) + cardWidth;\n w = cutted_width > 0 ? cutted_width : 0;\n }\n else if (xScale(d.x) + cardWidth > chartWidth) {\n // Cut card right to prevent overlay\n w = chartWidth - xScale(d.x) - cardPadding;\n }\n else {\n w = cardWidth;\n }\n // Card width should be MIN_CARD_SIZE at least\n w = Math.max(w, MIN_CARD_SIZE);\n return w;\n }\n function getCardY(d) {\n var y = yScale(d.y) + chartTop - cardHeight - cardPadding;\n if (panel.yAxis.logBase !== 1 && d.y === 0) {\n y = chartBottom - cardHeight - cardPadding;\n }\n else {\n if (y < chartTop) {\n y = chartTop;\n }\n }\n return y;\n }\n function getCardHeight(d) {\n var y = yScale(d.y) + chartTop - cardHeight - cardPadding;\n var h = cardHeight;\n if (panel.yAxis.logBase !== 1 && d.y === 0) {\n return cardHeight;\n }\n // Cut card height to prevent overlay\n if (y < chartTop) {\n h = yScale(d.y) - cardPadding;\n }\n else if (yScale(d.y) > chartBottom) {\n h = chartBottom - y;\n }\n else if (y + cardHeight > chartBottom) {\n h = chartBottom - y;\n }\n // Height can't be more than chart height\n h = Math.min(h, chartHeight);\n // Card height should be MIN_CARD_SIZE at least\n h = Math.max(h, MIN_CARD_SIZE);\n return h;\n }\n function getCardColor(d) {\n if (panel.color.mode === 'opacity') {\n return panel.color.cardColor;\n }\n else {\n return colorScale(d.count);\n }\n }\n function getCardOpacity(d) {\n if (panel.color.mode === 'opacity') {\n return opacityScale(d.count);\n }\n else {\n return 1;\n }\n }\n /////////////////////////////\n // Selection and crosshair //\n /////////////////////////////\n // Shared crosshair and tooltip\n __WEBPACK_IMPORTED_MODULE_5_app_core_core__[\"b\" /* appEvents */].on('graph-hover', function (event) {\n drawSharedCrosshair(event.pos);\n }, scope);\n __WEBPACK_IMPORTED_MODULE_5_app_core_core__[\"b\" /* appEvents */].on('graph-hover-clear', function () {\n clearCrosshair();\n }, scope);\n function onMouseDown(event) {\n selection.active = true;\n selection.x1 = event.offsetX;\n mouseUpHandler = function () {\n onMouseUp();\n };\n __WEBPACK_IMPORTED_MODULE_1_jquery___default()(document).one('mouseup', mouseUpHandler);\n }\n function onMouseUp() {\n __WEBPACK_IMPORTED_MODULE_1_jquery___default()(document).unbind('mouseup', mouseUpHandler);\n mouseUpHandler = null;\n selection.active = false;\n var selectionRange = Math.abs(selection.x2 - selection.x1);\n if (selection.x2 >= 0 && selectionRange > MIN_SELECTION_WIDTH) {\n var timeFrom = xScale.invert(Math.min(selection.x1, selection.x2) - yAxisWidth);\n var timeTo = xScale.invert(Math.max(selection.x1, selection.x2) - yAxisWidth);\n ctrl.timeSrv.setTime({\n from: __WEBPACK_IMPORTED_MODULE_2_moment___default.a.utc(timeFrom),\n to: __WEBPACK_IMPORTED_MODULE_2_moment___default.a.utc(timeTo),\n });\n }\n clearSelection();\n }\n function onMouseLeave() {\n __WEBPACK_IMPORTED_MODULE_5_app_core_core__[\"b\" /* appEvents */].emit('graph-hover-clear');\n clearCrosshair();\n }\n function onMouseMove(event) {\n if (!heatmap) {\n return;\n }\n if (selection.active) {\n // Clear crosshair and tooltip\n clearCrosshair();\n tooltip.destroy();\n selection.x2 = limitSelection(event.offsetX);\n drawSelection(selection.x1, selection.x2);\n }\n else {\n emitGraphHoverEvent(event);\n drawCrosshair(event.offsetX);\n tooltip.show(event, data);\n }\n }\n function emitGraphHoverEvent(event) {\n var x = xScale.invert(event.offsetX - yAxisWidth).valueOf();\n var y = yScale.invert(event.offsetY);\n var pos = {\n pageX: event.pageX,\n pageY: event.pageY,\n x: x,\n x1: x,\n y: y,\n y1: y,\n panelRelY: null,\n };\n // Set minimum offset to prevent showing legend from another panel\n pos.panelRelY = Math.max(event.offsetY / height, 0.001);\n // broadcast to other graph panels that we are hovering\n __WEBPACK_IMPORTED_MODULE_5_app_core_core__[\"b\" /* appEvents */].emit('graph-hover', { pos: pos, panel: panel });\n }\n function limitSelection(x2) {\n x2 = Math.max(x2, yAxisWidth);\n x2 = Math.min(x2, chartWidth + yAxisWidth);\n return x2;\n }\n function drawSelection(posX1, posX2) {\n if (heatmap) {\n heatmap.selectAll('.heatmap-selection').remove();\n var selectionX = Math.min(posX1, posX2);\n var selectionWidth = Math.abs(posX1 - posX2);\n if (selectionWidth > MIN_SELECTION_WIDTH) {\n heatmap\n .append('rect')\n .attr('class', 'heatmap-selection')\n .attr('x', selectionX)\n .attr('width', selectionWidth)\n .attr('y', chartTop)\n .attr('height', chartHeight);\n }\n }\n }\n function clearSelection() {\n selection.x1 = -1;\n selection.x2 = -1;\n if (heatmap) {\n heatmap.selectAll('.heatmap-selection').remove();\n }\n }\n function drawCrosshair(position) {\n if (heatmap) {\n heatmap.selectAll('.heatmap-crosshair').remove();\n var posX = position;\n posX = Math.max(posX, yAxisWidth);\n posX = Math.min(posX, chartWidth + yAxisWidth);\n heatmap\n .append('g')\n .attr('class', 'heatmap-crosshair')\n .attr('transform', 'translate(' + posX + ',0)')\n .append('line')\n .attr('x1', 1)\n .attr('y1', chartTop)\n .attr('x2', 1)\n .attr('y2', chartBottom)\n .attr('stroke-width', 1);\n }\n }\n function drawSharedCrosshair(pos) {\n if (heatmap && ctrl.dashboard.graphTooltip !== 0) {\n var posX = xScale(pos.x) + yAxisWidth;\n drawCrosshair(posX);\n }\n }\n function clearCrosshair() {\n if (heatmap) {\n heatmap.selectAll('.heatmap-crosshair').remove();\n }\n }\n function render() {\n data = ctrl.data;\n panel = ctrl.panel;\n timeRange = ctrl.range;\n if (!setElementHeight() || !data) {\n return;\n }\n // Draw default axes and return if no data\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isEmpty(data.buckets)) {\n addHeatmapCanvas();\n addAxes();\n return;\n }\n addHeatmap();\n scope.yAxisWidth = yAxisWidth;\n scope.xAxisHeight = xAxisHeight;\n scope.chartHeight = chartHeight;\n scope.chartWidth = chartWidth;\n scope.chartTop = chartTop;\n }\n // Register selection listeners\n $heatmap.on('mousedown', onMouseDown);\n $heatmap.on('mousemove', onMouseMove);\n $heatmap.on('mouseleave', onMouseLeave);\n}\n\n\n/***/ }),\n\n/***/ 2158:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return HeatmapTooltip; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_d3__ = __webpack_require__(695);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery__ = __webpack_require__(17);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_jquery__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_app_core_utils_kbn__ = __webpack_require__(312);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__heatmap_data_converter__ = __webpack_require__(1991);\n\n\n\n\n\nvar TOOLTIP_PADDING_X = 30;\nvar TOOLTIP_PADDING_Y = 5;\nvar HISTOGRAM_WIDTH = 160;\nvar HISTOGRAM_HEIGHT = 40;\nvar HeatmapTooltip = /** @class */ (function () {\n function HeatmapTooltip(elem, scope) {\n this.scope = scope;\n this.dashboard = scope.ctrl.dashboard;\n this.panelCtrl = scope.ctrl;\n this.panel = scope.ctrl.panel;\n this.heatmapPanel = elem;\n this.mouseOverBucket = false;\n this.originalFillColor = null;\n elem.on('mouseover', this.onMouseOver.bind(this));\n elem.on('mouseleave', this.onMouseLeave.bind(this));\n }\n HeatmapTooltip.prototype.onMouseOver = function (e) {\n if (!this.panel.tooltip.show || !this.scope.ctrl.data || __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.isEmpty(this.scope.ctrl.data.buckets)) {\n return;\n }\n if (!this.tooltip) {\n this.add();\n this.move(e);\n }\n };\n HeatmapTooltip.prototype.onMouseLeave = function () {\n this.destroy();\n };\n HeatmapTooltip.prototype.onMouseMove = function (e) {\n if (!this.panel.tooltip.show) {\n return;\n }\n this.move(e);\n };\n HeatmapTooltip.prototype.add = function () {\n this.tooltip = __WEBPACK_IMPORTED_MODULE_0_d3__[\"select\"]('body')\n .append('div')\n .attr('class', 'heatmap-tooltip graph-tooltip grafana-tooltip');\n };\n HeatmapTooltip.prototype.destroy = function () {\n if (this.tooltip) {\n this.tooltip.remove();\n }\n this.tooltip = null;\n };\n HeatmapTooltip.prototype.show = function (pos, data) {\n if (!this.panel.tooltip.show || !data) {\n return;\n }\n // shared tooltip mode\n if (pos.panelRelY) {\n return;\n }\n var _a = this.getBucketIndexes(pos, data), xBucketIndex = _a.xBucketIndex, yBucketIndex = _a.yBucketIndex;\n if (!data.buckets[xBucketIndex] || !this.tooltip) {\n this.destroy();\n return;\n }\n var boundBottom, boundTop, valuesNumber;\n var xData = data.buckets[xBucketIndex];\n // Search in special 'zero' bucket also\n var yData = __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.find(xData.buckets, function (bucket, bucketIndex) {\n return bucket.bounds.bottom === yBucketIndex || bucketIndex === yBucketIndex.toString();\n });\n var tooltipTimeFormat = 'YYYY-MM-DD HH:mm:ss';\n var time = this.dashboard.formatDate(xData.x, tooltipTimeFormat);\n // Decimals override. Code from panel/graph/graph.ts\n var countValueFormatter, bucketBoundFormatter;\n if (__WEBPACK_IMPORTED_MODULE_2_lodash___default.a.isNumber(this.panel.tooltipDecimals)) {\n countValueFormatter = this.countValueFormatter(this.panel.tooltipDecimals, null);\n bucketBoundFormatter = this.panelCtrl.tickValueFormatter(this.panelCtrl.decimals, null);\n }\n else {\n // auto decimals\n // legend and tooltip gets one more decimal precision\n // than graph legend ticks\n var decimals = (this.panelCtrl.decimals || -1) + 1;\n countValueFormatter = this.countValueFormatter(decimals, this.panelCtrl.scaledDecimals + 2);\n bucketBoundFormatter = this.panelCtrl.tickValueFormatter(decimals, this.panelCtrl.scaledDecimals + 2);\n }\n var tooltipHtml = \"
\" + time + \"
\\n
\";\n if (yData) {\n if (yData.bounds) {\n if (data.tsBuckets) {\n // Use Y-axis labels\n var tickFormatter = function (valIndex) {\n return data.tsBucketsFormatted ? data.tsBucketsFormatted[valIndex] : data.tsBuckets[valIndex];\n };\n boundBottom = tickFormatter(yBucketIndex);\n boundTop = yBucketIndex < data.tsBuckets.length - 1 ? tickFormatter(yBucketIndex + 1) : '';\n }\n else {\n // Display 0 if bucket is a special 'zero' bucket\n var bottom = yData.y ? yData.bounds.bottom : 0;\n boundBottom = bucketBoundFormatter(bottom);\n boundTop = bucketBoundFormatter(yData.bounds.top);\n }\n valuesNumber = countValueFormatter(yData.count);\n tooltipHtml += \"
\\n bucket: \" + boundBottom + \" - \" + boundTop + \"
\\n count: \" + valuesNumber + \"
\\n
\";\n }\n else {\n // currently no bounds for pre bucketed data\n tooltipHtml += \"
count: \" + yData.count + \"
\";\n }\n }\n else {\n if (!this.panel.tooltip.showHistogram) {\n this.destroy();\n return;\n }\n boundBottom = yBucketIndex;\n boundTop = '';\n valuesNumber = 0;\n }\n this.tooltip.html(tooltipHtml);\n if (this.panel.tooltip.showHistogram) {\n this.addHistogram(xData);\n }\n this.move(pos);\n };\n HeatmapTooltip.prototype.getBucketIndexes = function (pos, data) {\n var xBucketIndex = this.getXBucketIndex(pos.offsetX, data);\n var yBucketIndex = this.getYBucketIndex(pos.offsetY, data);\n return { xBucketIndex: xBucketIndex, yBucketIndex: yBucketIndex };\n };\n HeatmapTooltip.prototype.getXBucketIndex = function (offsetX, data) {\n var x = this.scope.xScale.invert(offsetX - this.scope.yAxisWidth).valueOf();\n // First try to find X bucket by checking x pos is in the\n // [bucket.x, bucket.x + xBucketSize] interval\n var xBucket = __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.find(data.buckets, function (bucket) {\n return x > bucket.x && x - bucket.x <= data.xBucketSize;\n });\n return xBucket ? xBucket.x : Object(__WEBPACK_IMPORTED_MODULE_4__heatmap_data_converter__[\"d\" /* getValueBucketBound */])(x, data.xBucketSize, 1);\n };\n HeatmapTooltip.prototype.getYBucketIndex = function (offsetY, data) {\n var y = this.scope.yScale.invert(offsetY - this.scope.chartTop);\n if (data.tsBuckets) {\n return Math.floor(y);\n }\n var yBucketIndex = Object(__WEBPACK_IMPORTED_MODULE_4__heatmap_data_converter__[\"d\" /* getValueBucketBound */])(y, data.yBucketSize, this.panel.yAxis.logBase);\n return yBucketIndex;\n };\n HeatmapTooltip.prototype.getSharedTooltipPos = function (pos) {\n // get pageX from position on x axis and pageY from relative position in original panel\n pos.pageX = this.heatmapPanel.offset().left + this.scope.xScale(pos.x);\n pos.pageY = this.heatmapPanel.offset().top + this.scope.chartHeight * pos.panelRelY;\n return pos;\n };\n HeatmapTooltip.prototype.addHistogram = function (data) {\n var xBucket = this.scope.ctrl.data.buckets[data.x];\n var yBucketSize = this.scope.ctrl.data.yBucketSize;\n var min, max, ticks;\n if (this.scope.ctrl.data.tsBuckets) {\n min = 0;\n max = this.scope.ctrl.data.tsBuckets.length - 1;\n ticks = this.scope.ctrl.data.tsBuckets.length;\n }\n else {\n min = this.scope.ctrl.data.yAxis.min;\n max = this.scope.ctrl.data.yAxis.max;\n ticks = this.scope.ctrl.data.yAxis.ticks;\n }\n var histogramData = __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.map(xBucket.buckets, function (bucket) {\n var count = bucket.count !== undefined ? bucket.count : bucket.values.length;\n return [bucket.bounds.bottom, count];\n });\n histogramData = __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.filter(histogramData, function (d) {\n return d[0] >= min && d[0] <= max;\n });\n var scale = this.scope.yScale.copy();\n var histXScale = scale.domain([min, max]).range([0, HISTOGRAM_WIDTH]);\n var barWidth;\n if (this.panel.yAxis.logBase === 1) {\n barWidth = Math.floor(HISTOGRAM_WIDTH / (max - min) * yBucketSize * 0.9);\n }\n else {\n var barNumberFactor = yBucketSize ? yBucketSize : 1;\n barWidth = Math.floor(HISTOGRAM_WIDTH / ticks / barNumberFactor * 0.9);\n }\n barWidth = Math.max(barWidth, 1);\n // Normalize histogram Y axis\n var histogramDomain = __WEBPACK_IMPORTED_MODULE_2_lodash___default.a.reduce(__WEBPACK_IMPORTED_MODULE_2_lodash___default.a.map(histogramData, function (d) { return d[1]; }), function (sum, val) { return sum + val; }, 0);\n var histYScale = __WEBPACK_IMPORTED_MODULE_0_d3__[\"scaleLinear\"]()\n .domain([0, histogramDomain])\n .range([0, HISTOGRAM_HEIGHT]);\n var histogram = this.tooltip\n .select('.heatmap-histogram')\n .append('svg')\n .attr('width', HISTOGRAM_WIDTH)\n .attr('height', HISTOGRAM_HEIGHT);\n histogram\n .selectAll('.bar')\n .data(histogramData)\n .enter()\n .append('rect')\n .attr('x', function (d) {\n return histXScale(d[0]);\n })\n .attr('width', barWidth)\n .attr('y', function (d) {\n return HISTOGRAM_HEIGHT - histYScale(d[1]);\n })\n .attr('height', function (d) {\n return histYScale(d[1]);\n });\n };\n HeatmapTooltip.prototype.move = function (pos) {\n if (!this.tooltip) {\n return;\n }\n var elem = __WEBPACK_IMPORTED_MODULE_1_jquery___default()(this.tooltip.node())[0];\n var tooltipWidth = elem.clientWidth;\n var tooltipHeight = elem.clientHeight;\n var left = pos.pageX + TOOLTIP_PADDING_X;\n var top = pos.pageY + TOOLTIP_PADDING_Y;\n if (pos.pageX + tooltipWidth + 40 > window.innerWidth) {\n left = pos.pageX - tooltipWidth - TOOLTIP_PADDING_X;\n }\n if (pos.pageY - window.pageYOffset + tooltipHeight + 20 > window.innerHeight) {\n top = pos.pageY - tooltipHeight - TOOLTIP_PADDING_Y;\n }\n return this.tooltip.style('left', left + 'px').style('top', top + 'px');\n };\n HeatmapTooltip.prototype.countValueFormatter = function (decimals, scaledDecimals) {\n if (scaledDecimals === void 0) { scaledDecimals = null; }\n var format = 'short';\n return function (value) {\n return __WEBPACK_IMPORTED_MODULE_3_app_core_utils_kbn__[\"a\" /* default */].valueFormats[format](value, decimals, scaledDecimals);\n };\n };\n return HeatmapTooltip;\n}());\n\n\n\n/***/ }),\n\n/***/ 2159:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TablePanelCtrl\", function() { return TablePanelCtrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PanelCtrl\", function() { return TablePanelCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery__ = __webpack_require__(17);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_jquery__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_plugins_sdk__ = __webpack_require__(1983);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__transformers__ = __webpack_require__(2014);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__editor__ = __webpack_require__(2160);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__column_options__ = __webpack_require__(2161);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__renderer__ = __webpack_require__(2162);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n\n\n\n\nvar TablePanelCtrl = /** @class */ (function (_super) {\n __extends(TablePanelCtrl, _super);\n /** @ngInject */\n TablePanelCtrl.$inject = [\"$scope\", \"$injector\", \"templateSrv\", \"annotationsSrv\", \"$sanitize\", \"variableSrv\"];\n function TablePanelCtrl($scope, $injector, templateSrv, annotationsSrv, $sanitize, variableSrv) {\n var _this = _super.call(this, $scope, $injector) || this;\n _this.annotationsSrv = annotationsSrv;\n _this.$sanitize = $sanitize;\n _this.variableSrv = variableSrv;\n _this.panelDefaults = {\n targets: [{}],\n transform: 'timeseries_to_columns',\n pageSize: null,\n showHeader: true,\n styles: [\n {\n type: 'date',\n pattern: 'Time',\n alias: 'Time',\n dateFormat: 'YYYY-MM-DD HH:mm:ss',\n },\n {\n unit: 'short',\n type: 'number',\n alias: '',\n decimals: 2,\n colors: ['rgba(245, 54, 54, 0.9)', 'rgba(237, 129, 40, 0.89)', 'rgba(50, 172, 45, 0.97)'],\n colorMode: null,\n pattern: '/.*/',\n thresholds: [],\n },\n ],\n columns: [],\n scroll: true,\n fontSize: '100%',\n sort: { col: 0, desc: true },\n };\n _this.pageIndex = 0;\n if (_this.panel.styles === void 0) {\n _this.panel.styles = _this.panel.columns;\n _this.panel.columns = _this.panel.fields;\n delete _this.panel.columns;\n delete _this.panel.fields;\n }\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.defaults(_this.panel, _this.panelDefaults);\n _this.events.on('data-received', _this.onDataReceived.bind(_this));\n _this.events.on('data-error', _this.onDataError.bind(_this));\n _this.events.on('data-snapshot-load', _this.onDataReceived.bind(_this));\n _this.events.on('init-edit-mode', _this.onInitEditMode.bind(_this));\n _this.events.on('init-panel-actions', _this.onInitPanelActions.bind(_this));\n return _this;\n }\n TablePanelCtrl.prototype.onInitEditMode = function () {\n this.addEditorTab('Options', __WEBPACK_IMPORTED_MODULE_4__editor__[\"a\" /* tablePanelEditor */], 2);\n this.addEditorTab('Column Styles', __WEBPACK_IMPORTED_MODULE_5__column_options__[\"a\" /* columnOptionsTab */], 3);\n };\n TablePanelCtrl.prototype.onInitPanelActions = function (actions) {\n actions.push({ text: 'Export CSV', click: 'ctrl.exportCsv()' });\n };\n TablePanelCtrl.prototype.issueQueries = function (datasource) {\n this.pageIndex = 0;\n if (this.panel.transform === 'annotations') {\n this.setTimeQueryStart();\n return this.annotationsSrv\n .getAnnotations({\n dashboard: this.dashboard,\n panel: this.panel,\n range: this.range,\n })\n .then(function (annotations) {\n return { data: annotations };\n });\n }\n return _super.prototype.issueQueries.call(this, datasource);\n };\n TablePanelCtrl.prototype.onDataError = function (err) {\n this.dataRaw = [];\n this.render();\n };\n TablePanelCtrl.prototype.onDataReceived = function (dataList) {\n this.dataRaw = dataList;\n this.pageIndex = 0;\n // automatically correct transform mode based on data\n if (this.dataRaw && this.dataRaw.length) {\n if (this.dataRaw[0].type === 'table') {\n this.panel.transform = 'table';\n }\n else {\n if (this.dataRaw[0].type === 'docs') {\n this.panel.transform = 'json';\n }\n else {\n if (this.panel.transform === 'table' || this.panel.transform === 'json') {\n this.panel.transform = 'timeseries_to_rows';\n }\n }\n }\n }\n this.render();\n };\n TablePanelCtrl.prototype.render = function () {\n this.table = Object(__WEBPACK_IMPORTED_MODULE_3__transformers__[\"a\" /* transformDataToTable */])(this.dataRaw, this.panel);\n this.table.sort(this.panel.sort);\n this.renderer = new __WEBPACK_IMPORTED_MODULE_6__renderer__[\"a\" /* TableRenderer */](this.panel, this.table, this.dashboard.isTimezoneUtc(), this.$sanitize, this.templateSrv);\n return _super.prototype.render.call(this, this.table);\n };\n TablePanelCtrl.prototype.toggleColumnSort = function (col, colIndex) {\n // remove sort flag from current column\n if (this.table.columns[this.panel.sort.col]) {\n this.table.columns[this.panel.sort.col].sort = false;\n }\n if (this.panel.sort.col === colIndex) {\n if (this.panel.sort.desc) {\n this.panel.sort.desc = false;\n }\n else {\n this.panel.sort.col = null;\n }\n }\n else {\n this.panel.sort.col = colIndex;\n this.panel.sort.desc = true;\n }\n this.render();\n };\n TablePanelCtrl.prototype.moveQuery = function (target, direction) {\n _super.prototype.moveQuery.call(this, target, direction);\n _super.prototype.refresh.call(this);\n };\n TablePanelCtrl.prototype.exportCsv = function () {\n var scope = this.$scope.$new(true);\n scope.tableData = this.renderer.render_values();\n scope.panel = 'table';\n this.publishAppEvent('show-modal', {\n templateHtml: '',\n scope: scope,\n modalClass: 'modal--narrow',\n });\n };\n TablePanelCtrl.prototype.link = function (scope, elem, attrs, ctrl) {\n var data;\n var panel = ctrl.panel;\n var pageCount = 0;\n function getTableHeight() {\n var panelHeight = ctrl.height;\n if (pageCount > 1) {\n panelHeight -= 26;\n }\n return panelHeight - 31 + 'px';\n }\n function appendTableRows(tbodyElem) {\n ctrl.renderer.setTable(data);\n tbodyElem.empty();\n tbodyElem.html(ctrl.renderer.render(ctrl.pageIndex));\n }\n function switchPage(e) {\n var el = __WEBPACK_IMPORTED_MODULE_1_jquery___default()(e.currentTarget);\n ctrl.pageIndex = parseInt(el.text(), 10) - 1;\n renderPanel();\n }\n function appendPaginationControls(footerElem) {\n footerElem.empty();\n var pageSize = panel.pageSize || 100;\n pageCount = Math.ceil(data.rows.length / pageSize);\n if (pageCount === 1) {\n return;\n }\n var startPage = Math.max(ctrl.pageIndex - 3, 0);\n var endPage = Math.min(pageCount, startPage + 9);\n var paginationList = __WEBPACK_IMPORTED_MODULE_1_jquery___default()('
    ');\n for (var i = startPage; i < endPage; i++) {\n var activeClass = i === ctrl.pageIndex ? 'active' : '';\n var pageLinkElem = __WEBPACK_IMPORTED_MODULE_1_jquery___default()('
  • ' + (i + 1) + '
  • ');\n paginationList.append(pageLinkElem);\n }\n footerElem.append(paginationList);\n }\n function renderPanel() {\n var panelElem = elem.parents('.panel-content');\n var rootElem = elem.find('.table-panel-scroll');\n var tbodyElem = elem.find('tbody');\n var footerElem = elem.find('.table-panel-footer');\n elem.css({ 'font-size': panel.fontSize });\n panelElem.addClass('table-panel-content');\n appendTableRows(tbodyElem);\n appendPaginationControls(footerElem);\n rootElem.css({ 'max-height': panel.scroll ? getTableHeight() : '' });\n }\n // hook up link tooltips\n elem.tooltip({\n selector: '[data-link-tooltip]',\n });\n function addFilterClicked(e) {\n var filterData = __WEBPACK_IMPORTED_MODULE_1_jquery___default()(e.currentTarget).data();\n var options = {\n datasource: panel.datasource,\n key: data.columns[filterData.column].text,\n value: data.rows[filterData.row][filterData.column],\n operator: filterData.operator,\n };\n ctrl.variableSrv.setAdhocFilter(options);\n }\n elem.on('click', '.table-panel-page-link', switchPage);\n elem.on('click', '.table-panel-filter-link', addFilterClicked);\n var unbindDestroy = scope.$on('$destroy', function () {\n elem.off('click', '.table-panel-page-link');\n elem.off('click', '.table-panel-filter-link');\n unbindDestroy();\n });\n ctrl.events.on('render', function (renderData) {\n data = renderData || data;\n if (data) {\n renderPanel();\n }\n ctrl.renderingCompleted();\n });\n };\n TablePanelCtrl.templateUrl = 'module.html';\n return TablePanelCtrl;\n}(__WEBPACK_IMPORTED_MODULE_2_app_plugins_sdk__[\"MetricsPanelCtrl\"]));\n\n\n\n/***/ }),\n\n/***/ 2160:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export TablePanelEditorCtrl */\n/* harmony export (immutable) */ \ntablePanelEditor.$inject = [\"$q\", \"uiSegmentSrv\"];__webpack_exports__[\"a\"] = tablePanelEditor;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__transformers__ = __webpack_require__(2014);\n\n\nvar TablePanelEditorCtrl = /** @class */ (function () {\n /** @ngInject */\n TablePanelEditorCtrl.$inject = [\"$scope\", \"$q\", \"uiSegmentSrv\"];\n function TablePanelEditorCtrl($scope, $q, uiSegmentSrv) {\n this.$q = $q;\n this.uiSegmentSrv = uiSegmentSrv;\n $scope.editor = this;\n this.panelCtrl = $scope.ctrl;\n this.panel = this.panelCtrl.panel;\n this.transformers = __WEBPACK_IMPORTED_MODULE_1__transformers__[\"b\" /* transformers */];\n this.fontSizes = ['80%', '90%', '100%', '110%', '120%', '130%', '150%', '160%', '180%', '200%', '220%', '250%'];\n this.addColumnSegment = uiSegmentSrv.newPlusButton();\n this.updateTransformHints();\n }\n TablePanelEditorCtrl.prototype.updateTransformHints = function () {\n this.canSetColumns = false;\n this.columnsHelpMessage = '';\n switch (this.panel.transform) {\n case 'timeseries_aggregations': {\n this.canSetColumns = true;\n break;\n }\n case 'json': {\n this.canSetColumns = true;\n break;\n }\n case 'table': {\n this.columnsHelpMessage = 'Columns and their order are determined by the data query';\n }\n }\n };\n TablePanelEditorCtrl.prototype.getColumnOptions = function () {\n var _this = this;\n if (!this.panelCtrl.dataRaw) {\n return this.$q.when([]);\n }\n var columns = this.transformers[this.panel.transform].getColumns(this.panelCtrl.dataRaw);\n var segments = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(columns, function (c) { return _this.uiSegmentSrv.newSegment({ value: c.text }); });\n return this.$q.when(segments);\n };\n TablePanelEditorCtrl.prototype.addColumn = function () {\n var columns = __WEBPACK_IMPORTED_MODULE_1__transformers__[\"b\" /* transformers */][this.panel.transform].getColumns(this.panelCtrl.dataRaw);\n var column = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(columns, { text: this.addColumnSegment.value });\n if (column) {\n this.panel.columns.push(column);\n this.render();\n }\n var plusButton = this.uiSegmentSrv.newPlusButton();\n this.addColumnSegment.html = plusButton.html;\n this.addColumnSegment.value = plusButton.value;\n };\n TablePanelEditorCtrl.prototype.transformChanged = function () {\n this.panel.columns = [];\n if (this.panel.transform === 'timeseries_aggregations') {\n this.panel.columns.push({ text: 'Avg', value: 'avg' });\n }\n this.updateTransformHints();\n this.render();\n };\n TablePanelEditorCtrl.prototype.render = function () {\n this.panelCtrl.render();\n };\n TablePanelEditorCtrl.prototype.removeColumn = function (column) {\n this.panel.columns = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.without(this.panel.columns, column);\n this.panelCtrl.render();\n };\n return TablePanelEditorCtrl;\n}());\n\n/** @ngInject */\nfunction tablePanelEditor($q, uiSegmentSrv) {\n 'use strict';\n return {\n restrict: 'E',\n scope: true,\n templateUrl: 'public/app/plugins/panel/table/editor.html',\n controller: TablePanelEditorCtrl,\n };\n}\n\n\n/***/ }),\n\n/***/ 2161:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export ColumnOptionsCtrl */\n/* harmony export (immutable) */ \ncolumnOptionsTab.$inject = [\"$q\", \"uiSegmentSrv\"];__webpack_exports__[\"a\"] = columnOptionsTab;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_utils_kbn__ = __webpack_require__(312);\n\n\nvar ColumnOptionsCtrl = /** @class */ (function () {\n /** @ngInject */\n ColumnOptionsCtrl.$inject = [\"$scope\"];\n function ColumnOptionsCtrl($scope) {\n var _this = this;\n $scope.editor = this;\n this.activeStyleIndex = 0;\n this.panelCtrl = $scope.ctrl;\n this.panel = this.panelCtrl.panel;\n this.unitFormats = __WEBPACK_IMPORTED_MODULE_1_app_core_utils_kbn__[\"a\" /* default */].getUnitFormats();\n this.colorModes = [\n { text: 'Disabled', value: null },\n { text: 'Cell', value: 'cell' },\n { text: 'Value', value: 'value' },\n { text: 'Row', value: 'row' },\n ];\n this.columnTypes = [\n { text: 'Number', value: 'number' },\n { text: 'String', value: 'string' },\n { text: 'Date', value: 'date' },\n { text: 'Hidden', value: 'hidden' },\n ];\n this.fontSizes = ['80%', '90%', '100%', '110%', '120%', '130%', '150%', '160%', '180%', '200%', '220%', '250%'];\n this.dateFormats = [\n { text: 'YYYY-MM-DD HH:mm:ss', value: 'YYYY-MM-DD HH:mm:ss' },\n { text: 'YYYY-MM-DD HH:mm:ss.SSS', value: 'YYYY-MM-DD HH:mm:ss.SSS' },\n { text: 'MM/DD/YY h:mm:ss a', value: 'MM/DD/YY h:mm:ss a' },\n { text: 'MMMM D, YYYY LT', value: 'MMMM D, YYYY LT' },\n ];\n this.mappingTypes = [{ text: 'Value to text', value: 1 }, { text: 'Range to text', value: 2 }];\n this.getColumnNames = function () {\n if (!_this.panelCtrl.table) {\n return [];\n }\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(_this.panelCtrl.table.columns, function (col) {\n return col.text;\n });\n };\n this.onColorChange = this.onColorChange.bind(this);\n }\n ColumnOptionsCtrl.prototype.render = function () {\n this.panelCtrl.render();\n };\n ColumnOptionsCtrl.prototype.setUnitFormat = function (column, subItem) {\n column.unit = subItem.value;\n this.panelCtrl.render();\n };\n ColumnOptionsCtrl.prototype.addColumnStyle = function () {\n var newStyleRule = {\n unit: 'short',\n type: 'number',\n alias: '',\n decimals: 2,\n colors: ['rgba(245, 54, 54, 0.9)', 'rgba(237, 129, 40, 0.89)', 'rgba(50, 172, 45, 0.97)'],\n colorMode: null,\n pattern: '',\n dateFormat: 'YYYY-MM-DD HH:mm:ss',\n thresholds: [],\n mappingType: 1,\n };\n var styles = this.panel.styles;\n var stylesCount = styles.length;\n var indexToInsert = stylesCount;\n // check if last is a catch all rule, then add it before that one\n if (stylesCount > 0) {\n var last = styles[stylesCount - 1];\n if (last.pattern === '/.*/') {\n indexToInsert = stylesCount - 1;\n }\n }\n styles.splice(indexToInsert, 0, newStyleRule);\n this.activeStyleIndex = indexToInsert;\n };\n ColumnOptionsCtrl.prototype.removeColumnStyle = function (style) {\n this.panel.styles = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.without(this.panel.styles, style);\n };\n ColumnOptionsCtrl.prototype.invertColorOrder = function (index) {\n var ref = this.panel.styles[index].colors;\n var copy = ref[0];\n ref[0] = ref[2];\n ref[2] = copy;\n this.panelCtrl.render();\n };\n ColumnOptionsCtrl.prototype.onColorChange = function (styleIndex, colorIndex) {\n var _this = this;\n return function (newColor) {\n _this.panel.styles[styleIndex].colors[colorIndex] = newColor;\n _this.render();\n };\n };\n ColumnOptionsCtrl.prototype.addValueMap = function (style) {\n if (!style.valueMaps) {\n style.valueMaps = [];\n }\n style.valueMaps.push({ value: '', text: '' });\n this.panelCtrl.render();\n };\n ColumnOptionsCtrl.prototype.removeValueMap = function (style, index) {\n style.valueMaps.splice(index, 1);\n this.panelCtrl.render();\n };\n ColumnOptionsCtrl.prototype.addRangeMap = function (style) {\n if (!style.rangeMaps) {\n style.rangeMaps = [];\n }\n style.rangeMaps.push({ from: '', to: '', text: '' });\n this.panelCtrl.render();\n };\n ColumnOptionsCtrl.prototype.removeRangeMap = function (style, index) {\n style.rangeMaps.splice(index, 1);\n this.panelCtrl.render();\n };\n return ColumnOptionsCtrl;\n}());\n\n/** @ngInject */\nfunction columnOptionsTab($q, uiSegmentSrv) {\n 'use strict';\n return {\n restrict: 'E',\n scope: true,\n templateUrl: 'public/app/plugins/panel/table/column_options.html',\n controller: ColumnOptionsCtrl,\n };\n}\n\n\n/***/ }),\n\n/***/ 2162:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return TableRenderer; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_moment__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_moment__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_utils_kbn__ = __webpack_require__(312);\n\n\n\nvar TableRenderer = /** @class */ (function () {\n function TableRenderer(panel, table, isUtc, sanitize, templateSrv) {\n this.panel = panel;\n this.table = table;\n this.isUtc = isUtc;\n this.sanitize = sanitize;\n this.templateSrv = templateSrv;\n this.initColumns();\n }\n TableRenderer.prototype.setTable = function (table) {\n this.table = table;\n this.initColumns();\n };\n TableRenderer.prototype.initColumns = function () {\n this.formatters = [];\n this.colorState = {};\n for (var colIndex = 0; colIndex < this.table.columns.length; colIndex++) {\n var column = this.table.columns[colIndex];\n column.title = column.text;\n for (var i = 0; i < this.panel.styles.length; i++) {\n var style = this.panel.styles[i];\n var regex = __WEBPACK_IMPORTED_MODULE_2_app_core_utils_kbn__[\"a\" /* default */].stringToJsRegex(style.pattern);\n if (column.text.match(regex)) {\n column.style = style;\n if (style.alias) {\n column.title = column.text.replace(regex, style.alias);\n }\n break;\n }\n }\n this.formatters[colIndex] = this.createColumnFormatter(column);\n }\n };\n TableRenderer.prototype.getColorForValue = function (value, style) {\n if (!style.thresholds) {\n return null;\n }\n for (var i = style.thresholds.length; i > 0; i--) {\n if (value >= style.thresholds[i - 1]) {\n return style.colors[i];\n }\n }\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.first(style.colors);\n };\n TableRenderer.prototype.defaultCellFormatter = function (v, style) {\n if (v === null || v === void 0 || v === undefined) {\n return '';\n }\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isArray(v)) {\n v = v.join(', ');\n }\n if (style && style.sanitize) {\n return this.sanitize(v);\n }\n else {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.escape(v);\n }\n };\n TableRenderer.prototype.createColumnFormatter = function (column) {\n var _this = this;\n if (!column.style) {\n return this.defaultCellFormatter;\n }\n if (column.style.type === 'hidden') {\n return function (v) {\n return undefined;\n };\n }\n if (column.style.type === 'date') {\n return function (v) {\n if (v === undefined || v === null) {\n return '-';\n }\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isArray(v)) {\n v = v[0];\n }\n var date = __WEBPACK_IMPORTED_MODULE_1_moment___default()(v);\n if (_this.isUtc) {\n date = date.utc();\n }\n return date.format(column.style.dateFormat);\n };\n }\n if (column.style.type === 'string') {\n return function (v) {\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isArray(v)) {\n v = v.join(', ');\n }\n var mappingType = column.style.mappingType || 0;\n if (mappingType === 1 && column.style.valueMaps) {\n for (var i = 0; i < column.style.valueMaps.length; i++) {\n var map = column.style.valueMaps[i];\n if (v === null) {\n if (map.value === 'null') {\n return map.text;\n }\n continue;\n }\n // Allow both numeric and string values to be mapped\n if ((!__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isString(v) && Number(map.value) === Number(v)) || map.value === v) {\n _this.setColorState(v, column.style);\n return _this.defaultCellFormatter(map.text, column.style);\n }\n }\n }\n if (mappingType === 2 && column.style.rangeMaps) {\n for (var i = 0; i < column.style.rangeMaps.length; i++) {\n var map = column.style.rangeMaps[i];\n if (v === null) {\n if (map.from === 'null' && map.to === 'null') {\n return map.text;\n }\n continue;\n }\n if (Number(map.from) <= Number(v) && Number(map.to) >= Number(v)) {\n _this.setColorState(v, column.style);\n return _this.defaultCellFormatter(map.text, column.style);\n }\n }\n }\n if (v === null || v === void 0) {\n return '-';\n }\n _this.setColorState(v, column.style);\n return _this.defaultCellFormatter(v, column.style);\n };\n }\n if (column.style.type === 'number') {\n var valueFormatter_1 = __WEBPACK_IMPORTED_MODULE_2_app_core_utils_kbn__[\"a\" /* default */].valueFormats[column.unit || column.style.unit];\n return function (v) {\n if (v === null || v === void 0) {\n return '-';\n }\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isString(v) || __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isArray(v)) {\n return _this.defaultCellFormatter(v, column.style);\n }\n _this.setColorState(v, column.style);\n return valueFormatter_1(v, column.style.decimals, null);\n };\n }\n return function (value) {\n return _this.defaultCellFormatter(value, column.style);\n };\n };\n TableRenderer.prototype.setColorState = function (value, style) {\n if (!style.colorMode) {\n return;\n }\n if (value === null || value === void 0 || __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isArray(value)) {\n return;\n }\n var numericValue = Number(value);\n if (numericValue === NaN) {\n return;\n }\n this.colorState[style.colorMode] = this.getColorForValue(numericValue, style);\n };\n TableRenderer.prototype.renderRowVariables = function (rowIndex) {\n var scopedVars = {};\n var cell_variable;\n var row = this.table.rows[rowIndex];\n for (var i = 0; i < row.length; i++) {\n cell_variable = \"__cell_\" + i;\n scopedVars[cell_variable] = { value: row[i] };\n }\n return scopedVars;\n };\n TableRenderer.prototype.formatColumnValue = function (colIndex, value) {\n return this.formatters[colIndex] ? this.formatters[colIndex](value) : value;\n };\n TableRenderer.prototype.renderCell = function (columnIndex, rowIndex, value, addWidthHack) {\n if (addWidthHack === void 0) { addWidthHack = false; }\n value = this.formatColumnValue(columnIndex, value);\n var column = this.table.columns[columnIndex];\n var style = '';\n var cellClasses = [];\n var cellClass = '';\n if (this.colorState.cell) {\n style = ' style=\"background-color:' + this.colorState.cell + ';color: white\"';\n this.colorState.cell = null;\n }\n else if (this.colorState.value) {\n style = ' style=\"color:' + this.colorState.value + '\"';\n this.colorState.value = null;\n }\n // because of the fixed table headers css only solution\n // there is an issue if header cell is wider the cell\n // this hack adds header content to cell (not visible)\n var columnHtml = '';\n if (addWidthHack) {\n columnHtml = '
    ' + this.table.columns[columnIndex].title + '
    ';\n }\n if (value === undefined) {\n style = ' style=\"display:none;\"';\n column.hidden = true;\n }\n else {\n column.hidden = false;\n }\n if (column.style && column.style.preserveFormat) {\n cellClasses.push('table-panel-cell-pre');\n }\n if (column.style && column.style.link) {\n // Render cell as link\n var scopedVars = this.renderRowVariables(rowIndex);\n scopedVars['__cell'] = { value: value };\n var cellLink = this.templateSrv.replace(column.style.linkUrl, scopedVars, encodeURIComponent);\n var cellLinkTooltip = this.templateSrv.replace(column.style.linkTooltip, scopedVars);\n var cellTarget = column.style.linkTargetBlank ? '_blank' : '';\n cellClasses.push('table-panel-cell-link');\n columnHtml += \"\\n \\n \" + value + \"\\n \\n \";\n }\n else {\n columnHtml += value;\n }\n if (column.filterable) {\n cellClasses.push('table-panel-cell-filterable');\n columnHtml += \"\\n \\n \\n \\n \\n \\n \";\n }\n if (cellClasses.length) {\n cellClass = ' class=\"' + cellClasses.join(' ') + '\"';\n }\n columnHtml = '' + columnHtml + '';\n return columnHtml;\n };\n TableRenderer.prototype.render = function (page) {\n var pageSize = this.panel.pageSize || 100;\n var startPos = page * pageSize;\n var endPos = Math.min(startPos + pageSize, this.table.rows.length);\n var html = '';\n for (var y = startPos; y < endPos; y++) {\n var row = this.table.rows[y];\n var cellHtml = '';\n var rowStyle = '';\n for (var i = 0; i < this.table.columns.length; i++) {\n cellHtml += this.renderCell(i, y, row[i], y === startPos);\n }\n if (this.colorState.row) {\n rowStyle = ' style=\"background-color:' + this.colorState.row + ';color: white\"';\n this.colorState.row = null;\n }\n html += '
    ' + cellHtml + '';\n }\n return html;\n };\n TableRenderer.prototype.render_values = function () {\n var rows = [];\n for (var y = 0; y < this.table.rows.length; y++) {\n var row = this.table.rows[y];\n var new_row = [];\n for (var i = 0; i < this.table.columns.length; i++) {\n new_row.push(this.formatColumnValue(i, row[i]));\n }\n rows.push(new_row);\n }\n return {\n columns: this.table.columns,\n rows: rows,\n };\n };\n return TableRenderer;\n}());\n\n\n\n/***/ }),\n\n/***/ 2163:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SingleStatCtrl\", function() { return SingleStatCtrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PanelCtrl\", function() { return SingleStatCtrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getColorForValue\", function() { return getColorForValue; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery__ = __webpack_require__(17);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_jquery__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vendor_flot_jquery_flot__ = __webpack_require__(1985);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vendor_flot_jquery_flot___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vendor_flot_jquery_flot__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vendor_flot_jquery_flot_gauge__ = __webpack_require__(2164);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_vendor_flot_jquery_flot_gauge___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_vendor_flot_jquery_flot_gauge__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_app_features_panellinks_link_srv__ = __webpack_require__(1994);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_app_core_utils_kbn__ = __webpack_require__(312);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_app_core_config__ = __webpack_require__(23);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_app_core_time_series2__ = __webpack_require__(313);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_app_plugins_sdk__ = __webpack_require__(1983);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\n\n\n\n\n\n\nvar SingleStatCtrl = /** @class */ (function (_super) {\n __extends(SingleStatCtrl, _super);\n /** @ngInject */\n SingleStatCtrl.$inject = [\"$scope\", \"$injector\", \"linkSrv\"];\n function SingleStatCtrl($scope, $injector, linkSrv) {\n var _this = _super.call(this, $scope, $injector) || this;\n _this.linkSrv = linkSrv;\n _this.dataType = 'timeseries';\n _this.valueNameOptions = [\n { value: 'min', text: 'Min' },\n { value: 'max', text: 'Max' },\n { value: 'avg', text: 'Average' },\n { value: 'current', text: 'Current' },\n { value: 'total', text: 'Total' },\n { value: 'name', text: 'Name' },\n { value: 'first', text: 'First' },\n { value: 'delta', text: 'Delta' },\n { value: 'diff', text: 'Difference' },\n { value: 'range', text: 'Range' },\n { value: 'last_time', text: 'Time of last point' },\n ];\n // Set and populate defaults\n _this.panelDefaults = {\n links: [],\n datasource: null,\n maxDataPoints: 100,\n interval: null,\n targets: [{}],\n cacheTimeout: null,\n format: 'none',\n prefix: '',\n postfix: '',\n nullText: null,\n valueMaps: [{ value: 'null', op: '=', text: 'N/A' }],\n mappingTypes: [{ name: 'value to text', value: 1 }, { name: 'range to text', value: 2 }],\n rangeMaps: [{ from: 'null', to: 'null', text: 'N/A' }],\n mappingType: 1,\n nullPointMode: 'connected',\n valueName: 'avg',\n prefixFontSize: '50%',\n valueFontSize: '80%',\n postfixFontSize: '50%',\n thresholds: '',\n colorBackground: false,\n colorValue: false,\n colors: ['#299c46', 'rgba(237, 129, 40, 0.89)', '#d44a3a'],\n sparkline: {\n show: false,\n full: false,\n lineColor: 'rgb(31, 120, 193)',\n fillColor: 'rgba(31, 118, 189, 0.18)',\n },\n gauge: {\n show: false,\n minValue: 0,\n maxValue: 100,\n thresholdMarkers: true,\n thresholdLabels: false,\n },\n tableColumn: '',\n };\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.defaults(_this.panel, _this.panelDefaults);\n _this.events.on('data-received', _this.onDataReceived.bind(_this));\n _this.events.on('data-error', _this.onDataError.bind(_this));\n _this.events.on('data-snapshot-load', _this.onDataReceived.bind(_this));\n _this.events.on('init-edit-mode', _this.onInitEditMode.bind(_this));\n _this.onSparklineColorChange = _this.onSparklineColorChange.bind(_this);\n _this.onSparklineFillChange = _this.onSparklineFillChange.bind(_this);\n return _this;\n }\n SingleStatCtrl.prototype.onInitEditMode = function () {\n this.fontSizes = ['20%', '30%', '50%', '70%', '80%', '100%', '110%', '120%', '150%', '170%', '200%'];\n this.addEditorTab('Options', 'public/app/plugins/panel/singlestat/editor.html', 2);\n this.addEditorTab('Value Mappings', 'public/app/plugins/panel/singlestat/mappings.html', 3);\n this.unitFormats = __WEBPACK_IMPORTED_MODULE_5_app_core_utils_kbn__[\"a\" /* default */].getUnitFormats();\n };\n SingleStatCtrl.prototype.setUnitFormat = function (subItem) {\n this.panel.format = subItem.value;\n this.refresh();\n };\n SingleStatCtrl.prototype.onDataError = function (err) {\n this.onDataReceived([]);\n };\n SingleStatCtrl.prototype.onDataReceived = function (dataList) {\n var data = {};\n if (dataList.length > 0 && dataList[0].type === 'table') {\n this.dataType = 'table';\n var tableData = dataList.map(this.tableHandler.bind(this));\n this.setTableValues(tableData, data);\n }\n else {\n this.dataType = 'timeseries';\n this.series = dataList.map(this.seriesHandler.bind(this));\n this.setValues(data);\n }\n this.data = data;\n this.render();\n };\n SingleStatCtrl.prototype.seriesHandler = function (seriesData) {\n var series = new __WEBPACK_IMPORTED_MODULE_7_app_core_time_series2__[\"a\" /* default */]({\n datapoints: seriesData.datapoints || [],\n alias: seriesData.target,\n });\n series.flotpairs = series.getFlotPairs(this.panel.nullPointMode);\n return series;\n };\n SingleStatCtrl.prototype.tableHandler = function (tableData) {\n var datapoints = [];\n var columnNames = {};\n tableData.columns.forEach(function (column, columnIndex) {\n columnNames[columnIndex] = column.text;\n });\n this.tableColumnOptions = columnNames;\n if (!__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(tableData.columns, ['text', this.panel.tableColumn])) {\n this.setTableColumnToSensibleDefault(tableData);\n }\n tableData.rows.forEach(function (row) {\n var datapoint = {};\n row.forEach(function (value, columnIndex) {\n var key = columnNames[columnIndex];\n datapoint[key] = value;\n });\n datapoints.push(datapoint);\n });\n return datapoints;\n };\n SingleStatCtrl.prototype.setTableColumnToSensibleDefault = function (tableData) {\n if (tableData.columns.length === 1) {\n this.panel.tableColumn = tableData.columns[0].text;\n }\n else {\n this.panel.tableColumn = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(tableData.columns, function (col) {\n return col.type !== 'time';\n }).text;\n }\n };\n SingleStatCtrl.prototype.setTableValues = function (tableData, data) {\n if (!tableData || tableData.length === 0) {\n return;\n }\n if (tableData[0].length === 0 || tableData[0][0][this.panel.tableColumn] === undefined) {\n return;\n }\n var datapoint = tableData[0][0];\n data.value = datapoint[this.panel.tableColumn];\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isString(data.value)) {\n data.valueFormatted = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.escape(data.value);\n data.value = 0;\n data.valueRounded = 0;\n }\n else {\n var decimalInfo = this.getDecimalsForValue(data.value);\n var formatFunc = __WEBPACK_IMPORTED_MODULE_5_app_core_utils_kbn__[\"a\" /* default */].valueFormats[this.panel.format];\n data.valueFormatted = formatFunc(datapoint[this.panel.tableColumn], decimalInfo.decimals, decimalInfo.scaledDecimals);\n data.valueRounded = __WEBPACK_IMPORTED_MODULE_5_app_core_utils_kbn__[\"a\" /* default */].roundValue(data.value, this.panel.decimals || 0);\n }\n this.setValueMapping(data);\n };\n SingleStatCtrl.prototype.canChangeFontSize = function () {\n return this.panel.gauge.show;\n };\n SingleStatCtrl.prototype.setColoring = function (options) {\n if (options.background) {\n this.panel.colorValue = false;\n this.panel.colors = ['rgba(71, 212, 59, 0.4)', 'rgba(245, 150, 40, 0.73)', 'rgba(225, 40, 40, 0.59)'];\n }\n else {\n this.panel.colorBackground = false;\n this.panel.colors = ['rgba(50, 172, 45, 0.97)', 'rgba(237, 129, 40, 0.89)', 'rgba(245, 54, 54, 0.9)'];\n }\n this.render();\n };\n SingleStatCtrl.prototype.invertColorOrder = function () {\n var tmp = this.panel.colors[0];\n this.panel.colors[0] = this.panel.colors[2];\n this.panel.colors[2] = tmp;\n this.render();\n };\n SingleStatCtrl.prototype.onColorChange = function (panelColorIndex) {\n var _this = this;\n return function (color) {\n _this.panel.colors[panelColorIndex] = color;\n _this.render();\n };\n };\n SingleStatCtrl.prototype.onSparklineColorChange = function (newColor) {\n this.panel.sparkline.lineColor = newColor;\n this.render();\n };\n SingleStatCtrl.prototype.onSparklineFillChange = function (newColor) {\n this.panel.sparkline.fillColor = newColor;\n this.render();\n };\n SingleStatCtrl.prototype.getDecimalsForValue = function (value) {\n if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isNumber(this.panel.decimals)) {\n return { decimals: this.panel.decimals, scaledDecimals: null };\n }\n var delta = value / 2;\n var dec = -Math.floor(Math.log(delta) / Math.LN10);\n var magn = Math.pow(10, -dec), norm = delta / magn, // norm is between 1.0 and 10.0\n size;\n if (norm < 1.5) {\n size = 1;\n }\n else if (norm < 3) {\n size = 2;\n // special case for 2.5, requires an extra decimal\n if (norm > 2.25) {\n size = 2.5;\n ++dec;\n }\n }\n else if (norm < 7.5) {\n size = 5;\n }\n else {\n size = 10;\n }\n size *= magn;\n // reduce starting decimals if not needed\n if (Math.floor(value) === value) {\n dec = 0;\n }\n var result = {};\n result.decimals = Math.max(0, dec);\n result.scaledDecimals = result.decimals - Math.floor(Math.log(size) / Math.LN10) + 2;\n return result;\n };\n SingleStatCtrl.prototype.setValues = function (data) {\n data.flotpairs = [];\n if (this.series.length > 1) {\n var error = new Error();\n error.message = 'Multiple Series Error';\n error.data =\n 'Metric query returns ' +\n this.series.length +\n ' series. Single Stat Panel expects a single series.\\n\\nResponse:\\n' +\n JSON.stringify(this.series);\n throw error;\n }\n if (this.series && this.series.length > 0) {\n var lastPoint = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.last(this.series[0].datapoints);\n var lastValue = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isArray(lastPoint) ? lastPoint[0] : null;\n if (this.panel.valueName === 'name') {\n data.value = 0;\n data.valueRounded = 0;\n data.valueFormatted = this.series[0].alias;\n }\n else if (__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isString(lastValue)) {\n data.value = 0;\n data.valueFormatted = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.escape(lastValue);\n data.valueRounded = 0;\n }\n else if (this.panel.valueName === 'last_time') {\n var formatFunc = __WEBPACK_IMPORTED_MODULE_5_app_core_utils_kbn__[\"a\" /* default */].valueFormats[this.panel.format];\n data.value = lastPoint[1];\n data.valueRounded = data.value;\n data.valueFormatted = formatFunc(data.value, this.dashboard.isTimezoneUtc());\n }\n else {\n data.value = this.series[0].stats[this.panel.valueName];\n data.flotpairs = this.series[0].flotpairs;\n var decimalInfo = this.getDecimalsForValue(data.value);\n var formatFunc = __WEBPACK_IMPORTED_MODULE_5_app_core_utils_kbn__[\"a\" /* default */].valueFormats[this.panel.format];\n data.valueFormatted = formatFunc(data.value, decimalInfo.decimals, decimalInfo.scaledDecimals);\n data.valueRounded = __WEBPACK_IMPORTED_MODULE_5_app_core_utils_kbn__[\"a\" /* default */].roundValue(data.value, decimalInfo.decimals);\n }\n // Add $__name variable for using in prefix or postfix\n data.scopedVars = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.extend({}, this.panel.scopedVars);\n data.scopedVars['__name'] = { value: this.series[0].label };\n }\n this.setValueMapping(data);\n };\n SingleStatCtrl.prototype.setValueMapping = function (data) {\n // check value to text mappings if its enabled\n if (this.panel.mappingType === 1) {\n for (var i = 0; i < this.panel.valueMaps.length; i++) {\n var map = this.panel.valueMaps[i];\n // special null case\n if (map.value === 'null') {\n if (data.value === null || data.value === void 0) {\n data.valueFormatted = map.text;\n return;\n }\n continue;\n }\n // value/number to text mapping\n var value = parseFloat(map.value);\n if (value === data.valueRounded) {\n data.valueFormatted = map.text;\n return;\n }\n }\n }\n else if (this.panel.mappingType === 2) {\n for (var i = 0; i < this.panel.rangeMaps.length; i++) {\n var map = this.panel.rangeMaps[i];\n // special null case\n if (map.from === 'null' && map.to === 'null') {\n if (data.value === null || data.value === void 0) {\n data.valueFormatted = map.text;\n return;\n }\n continue;\n }\n // value/number to range mapping\n var from = parseFloat(map.from);\n var to = parseFloat(map.to);\n if (to >= data.valueRounded && from <= data.valueRounded) {\n data.valueFormatted = map.text;\n return;\n }\n }\n }\n if (data.value === null || data.value === void 0) {\n data.valueFormatted = 'no value';\n }\n };\n SingleStatCtrl.prototype.removeValueMap = function (map) {\n var index = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.indexOf(this.panel.valueMaps, map);\n this.panel.valueMaps.splice(index, 1);\n this.render();\n };\n SingleStatCtrl.prototype.addValueMap = function () {\n this.panel.valueMaps.push({ value: '', op: '=', text: '' });\n };\n SingleStatCtrl.prototype.removeRangeMap = function (rangeMap) {\n var index = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.indexOf(this.panel.rangeMaps, rangeMap);\n this.panel.rangeMaps.splice(index, 1);\n this.render();\n };\n SingleStatCtrl.prototype.addRangeMap = function () {\n this.panel.rangeMaps.push({ from: '', to: '', text: '' });\n };\n SingleStatCtrl.prototype.link = function (scope, elem, attrs, ctrl) {\n var $location = this.$location;\n var linkSrv = this.linkSrv;\n var $timeout = this.$timeout;\n var panel = ctrl.panel;\n var templateSrv = this.templateSrv;\n var data, linkInfo;\n var $panelContainer = elem.find('.panel-container');\n elem = elem.find('.singlestat-panel');\n function applyColoringThresholds(value, valueString) {\n if (!panel.colorValue) {\n return valueString;\n }\n var color = getColorForValue(data, value);\n if (color) {\n return '' + valueString + '';\n }\n return valueString;\n }\n function getSpan(className, fontSize, value) {\n value = templateSrv.replace(value, data.scopedVars);\n return '' + value + '';\n }\n function getBigValueHtml() {\n var body = '
    ';\n if (panel.prefix) {\n var prefix = applyColoringThresholds(data.value, panel.prefix);\n body += getSpan('singlestat-panel-prefix', panel.prefixFontSize, prefix);\n }\n var value = applyColoringThresholds(data.value, data.valueFormatted);\n body += getSpan('singlestat-panel-value', panel.valueFontSize, value);\n if (panel.postfix) {\n var postfix = applyColoringThresholds(data.value, panel.postfix);\n body += getSpan('singlestat-panel-postfix', panel.postfixFontSize, postfix);\n }\n body += '
    ';\n return body;\n }\n function getValueText() {\n var result = panel.prefix ? templateSrv.replace(panel.prefix, data.scopedVars) : '';\n result += data.valueFormatted;\n result += panel.postfix ? templateSrv.replace(panel.postfix, data.scopedVars) : '';\n return result;\n }\n function addGauge() {\n var width = elem.width();\n var height = elem.height();\n // Allow to use a bit more space for wide gauges\n var dimension = Math.min(width, height * 1.3);\n ctrl.invalidGaugeRange = false;\n if (panel.gauge.minValue > panel.gauge.maxValue) {\n ctrl.invalidGaugeRange = true;\n return;\n }\n var plotCanvas = __WEBPACK_IMPORTED_MODULE_1_jquery___default()('
    ');\n var plotCss = {\n top: '10px',\n margin: 'auto',\n position: 'relative',\n height: height * 0.9 + 'px',\n width: dimension + 'px',\n };\n plotCanvas.css(plotCss);\n var thresholds = [];\n for (var i = 0; i < data.thresholds.length; i++) {\n thresholds.push({\n value: data.thresholds[i],\n color: data.colorMap[i],\n });\n }\n thresholds.push({\n value: panel.gauge.maxValue,\n color: data.colorMap[data.colorMap.length - 1],\n });\n var bgColor = __WEBPACK_IMPORTED_MODULE_6_app_core_config__[\"a\" /* default */].bootData.user.lightTheme ? 'rgb(230,230,230)' : 'rgb(38,38,38)';\n var fontScale = parseInt(panel.valueFontSize) / 100;\n var fontSize = Math.min(dimension / 5, 100) * fontScale;\n // Reduce gauge width if threshold labels enabled\n var gaugeWidthReduceRatio = panel.gauge.thresholdLabels ? 1.5 : 1;\n var gaugeWidth = Math.min(dimension / 6, 60) / gaugeWidthReduceRatio;\n var thresholdMarkersWidth = gaugeWidth / 5;\n var thresholdLabelFontSize = fontSize / 2.5;\n var options = {\n series: {\n gauges: {\n gauge: {\n min: panel.gauge.minValue,\n max: panel.gauge.maxValue,\n background: { color: bgColor },\n border: { color: null },\n shadow: { show: false },\n width: gaugeWidth,\n },\n frame: { show: false },\n label: { show: false },\n layout: { margin: 0, thresholdWidth: 0 },\n cell: { border: { width: 0 } },\n threshold: {\n values: thresholds,\n label: {\n show: panel.gauge.thresholdLabels,\n margin: thresholdMarkersWidth + 1,\n font: { size: thresholdLabelFontSize },\n },\n show: panel.gauge.thresholdMarkers,\n width: thresholdMarkersWidth,\n },\n value: {\n color: panel.colorValue ? getColorForValue(data, data.valueRounded) : null,\n formatter: function () {\n return getValueText();\n },\n font: {\n size: fontSize,\n family: '\"Helvetica Neue\", Helvetica, Arial, sans-serif',\n },\n },\n show: true,\n },\n },\n };\n elem.append(plotCanvas);\n var plotSeries = {\n data: [[0, data.valueRounded]],\n };\n __WEBPACK_IMPORTED_MODULE_1_jquery___default.a.plot(plotCanvas, [plotSeries], options);\n }\n function addSparkline() {\n var width = elem.width() + 20;\n if (width < 30) {\n // element has not gotten it's width yet\n // delay sparkline render\n setTimeout(addSparkline, 30);\n return;\n }\n var height = ctrl.height;\n var plotCanvas = __WEBPACK_IMPORTED_MODULE_1_jquery___default()('
    ');\n var plotCss = {};\n plotCss.position = 'absolute';\n if (panel.sparkline.full) {\n plotCss.bottom = '5px';\n plotCss.left = '-5px';\n plotCss.width = width - 10 + 'px';\n var dynamicHeightMargin = height <= 100 ? 5 : Math.round(height / 100) * 15 + 5;\n plotCss.height = height - dynamicHeightMargin + 'px';\n }\n else {\n plotCss.bottom = '0px';\n plotCss.left = '-5px';\n plotCss.width = width - 10 + 'px';\n plotCss.height = Math.floor(height * 0.25) + 'px';\n }\n plotCanvas.css(plotCss);\n var options = {\n legend: { show: false },\n series: {\n lines: {\n show: true,\n fill: 1,\n zero: false,\n lineWidth: 1,\n fillColor: panel.sparkline.fillColor,\n },\n },\n yaxes: { show: false },\n xaxis: {\n show: false,\n mode: 'time',\n min: ctrl.range.from.valueOf(),\n max: ctrl.range.to.valueOf(),\n },\n grid: { hoverable: false, show: false },\n };\n elem.append(plotCanvas);\n var plotSeries = {\n data: data.flotpairs,\n color: panel.sparkline.lineColor,\n };\n __WEBPACK_IMPORTED_MODULE_1_jquery___default.a.plot(plotCanvas, [plotSeries], options);\n }\n function render() {\n if (!ctrl.data) {\n return;\n }\n data = ctrl.data;\n // get thresholds\n data.thresholds = panel.thresholds.split(',').map(function (strVale) {\n return Number(strVale.trim());\n });\n data.colorMap = panel.colors;\n var body = panel.gauge.show ? '' : getBigValueHtml();\n if (panel.colorBackground) {\n var color = getColorForValue(data, data.value);\n if (color) {\n $panelContainer.css('background-color', color);\n if (scope.fullscreen) {\n elem.css('background-color', color);\n }\n else {\n elem.css('background-color', '');\n }\n }\n }\n else {\n $panelContainer.css('background-color', '');\n elem.css('background-color', '');\n }\n elem.html(body);\n if (panel.sparkline.show) {\n addSparkline();\n }\n if (panel.gauge.show) {\n addGauge();\n }\n elem.toggleClass('pointer', panel.links.length > 0);\n if (panel.links.length > 0) {\n linkInfo = linkSrv.getPanelLinkAnchorInfo(panel.links[0], data.scopedVars);\n }\n else {\n linkInfo = null;\n }\n }\n function hookupDrilldownLinkTooltip() {\n // drilldown link tooltip\n var drilldownTooltip = __WEBPACK_IMPORTED_MODULE_1_jquery___default()('
    hello
    \"');\n elem.mouseleave(function () {\n if (panel.links.length === 0) {\n return;\n }\n $timeout(function () {\n drilldownTooltip.detach();\n });\n });\n elem.click(function (evt) {\n if (!linkInfo) {\n return;\n }\n // ignore title clicks in title\n if (__WEBPACK_IMPORTED_MODULE_1_jquery___default()(evt).parents('.panel-header').length > 0) {\n return;\n }\n if (linkInfo.target === '_blank') {\n window.open(linkInfo.href, '_blank');\n return;\n }\n if (linkInfo.href.indexOf('http') === 0) {\n window.location.href = linkInfo.href;\n }\n else {\n $timeout(function () {\n $location.url(linkInfo.href);\n });\n }\n drilldownTooltip.detach();\n });\n elem.mousemove(function (e) {\n if (!linkInfo) {\n return;\n }\n drilldownTooltip.text('click to go to: ' + linkInfo.title);\n drilldownTooltip.place_tt(e.pageX, e.pageY - 50);\n });\n }\n hookupDrilldownLinkTooltip();\n this.events.on('render', function () {\n render();\n ctrl.renderingCompleted();\n });\n };\n SingleStatCtrl.templateUrl = 'module.html';\n return SingleStatCtrl;\n}(__WEBPACK_IMPORTED_MODULE_8_app_plugins_sdk__[\"MetricsPanelCtrl\"]));\nfunction getColorForValue(data, value) {\n if (!__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isFinite(value)) {\n return null;\n }\n for (var i = data.thresholds.length; i > 0; i--) {\n if (value >= data.thresholds[i - 1]) {\n return data.colorMap[i];\n }\n }\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.first(data.colorMap);\n}\n\n\n\n/***/ }),\n\n/***/ 2164:\n/***/ (function(module, exports) {\n\n/*!\n * jquery.flot.gauge v1.1.0 *\n *\n * Flot plugin for rendering gauge charts.\n *\n * Copyright (c) 2015 @toyoty99.\n * Licensed under the MIT license.\n */\n\n/**\n * @module flot.gauge\n */\n(function($) {\n\n\n /**\n * Gauge class\n *\n * @class Gauge\n */\n var Gauge = (function() {\n /**\n * context of canvas\n *\n * @property context\n * @type Object\n */\n var context;\n /**\n * placeholder of canvas\n *\n * @property placeholder\n * @type Object\n */\n var placeholder;\n /**\n * options of plot\n *\n * @property options\n * @type Object\n */\n var options;\n /**\n * options of gauge\n *\n * @property gaugeOptions\n * @type Object\n */\n var gaugeOptions;\n /**\n * data series\n *\n * @property series\n * @type Array\n */\n var series;\n /**\n * logger\n *\n * @property logger\n * @type Object\n */\n var logger;\n\n /**\n * constructor\n *\n * @class Gauge\n * @constructor\n * @param {Object} gaugeOptions gauge options\n */\n var Gauge = function(plot, ctx) {\n context = ctx;\n placeholder = plot.getPlaceholder();\n options = plot.getOptions();\n gaugeOptions = options.series.gauges;\n series = plot.getData();\n logger = getLogger(gaugeOptions.debug);\n }\n\n /**\n * calculate layout\n *\n * @method calculateLayout\n * @return the calculated layout properties\n */\n Gauge.prototype.calculateLayout = function() {\n\n var canvasWidth = placeholder.width();\n var canvasHeight = placeholder.height();\n\n\n\n // calculate cell size\n var columns = Math.min(series.length, gaugeOptions.layout.columns);\n var rows = Math.ceil(series.length / columns);\n\n\n\n var margin = gaugeOptions.layout.margin;\n var hMargin = gaugeOptions.layout.hMargin;\n var vMargin = gaugeOptions.layout.vMargin;\n var cellWidth = (canvasWidth - (margin * 2) - (hMargin * (columns - 1))) / columns;\n var cellHeight = (canvasHeight - (margin * 2) - (vMargin * (rows - 1))) / rows;\n if (gaugeOptions.layout.square) {\n var cell = Math.min(cellWidth, cellHeight);\n cellWidth = cell;\n cellHeight = cell;\n }\n\n\n\n // calculate 'auto' values\n calculateAutoValues(gaugeOptions, cellWidth);\n\n // calculate maximum radius\n var cellMargin = gaugeOptions.cell.margin;\n var labelMargin = 0;\n var labelFontSize = 0;\n if (gaugeOptions.label.show) {\n labelMargin = gaugeOptions.label.margin;\n labelFontSize = gaugeOptions.label.font.size;\n }\n var valueMargin = 0;\n var valueFontSize = 0;\n if (gaugeOptions.value.show) {\n valueMargin = gaugeOptions.value.margin;\n valueFontSize = gaugeOptions.value.font.size;\n }\n var thresholdWidth = 0;\n if (gaugeOptions.threshold.show) {\n thresholdWidth = gaugeOptions.threshold.width;\n }\n var thresholdLabelMargin = 0;\n var thresholdLabelFontSize = 0;\n if (gaugeOptions.threshold.label.show) {\n thresholdLabelMargin = gaugeOptions.threshold.label.margin;\n thresholdLabelFontSize = gaugeOptions.threshold.label.font.size;\n }\n\n var maxRadiusH = (cellWidth / 2) - cellMargin - thresholdWidth - (thresholdLabelMargin * 2) - thresholdLabelFontSize;\n\n var startAngle = gaugeOptions.gauge.startAngle;\n var endAngle = gaugeOptions.gauge.endAngle;\n var dAngle = (endAngle - startAngle) / 100;\n var heightRatioV = -1;\n for (var a = startAngle; a < endAngle; a += dAngle) {\n heightRatioV = Math.max(heightRatioV, Math.sin(toRad(a)));\n }\n heightRatioV = Math.max(heightRatioV, Math.sin(toRad(endAngle)));\n var outerRadiusV = (cellHeight - (cellMargin * 2) - (labelMargin * 2) - labelFontSize) / (1 + heightRatioV);\n if (outerRadiusV * heightRatioV < valueMargin + (valueFontSize / 2)) {\n outerRadiusV = cellHeight - (cellMargin * 2) - (labelMargin * 2) - labelFontSize - valueMargin - (valueFontSize / 2);\n }\n var maxRadiusV = outerRadiusV - (thresholdLabelMargin * 2) - thresholdLabelFontSize - thresholdWidth;\n\n var radius = Math.min(maxRadiusH, maxRadiusV);\n\n\n var width = gaugeOptions.gauge.width;\n if (width >= radius) {\n width = Math.max(3, radius / 3);\n }\n\n\n var outerRadius = (thresholdLabelMargin * 2) + thresholdLabelFontSize + thresholdWidth + radius;\n var gaugeOuterHeight = Math.max(outerRadius * (1 + heightRatioV), outerRadius + valueMargin + (valueFontSize / 2));\n\n return {\n canvasWidth: canvasWidth,\n canvasHeight: canvasHeight,\n margin: margin,\n hMargin: hMargin,\n vMargin: vMargin,\n columns: columns,\n rows: rows,\n cellWidth: cellWidth,\n cellHeight: cellHeight,\n cellMargin: cellMargin,\n labelMargin: labelMargin,\n labelFontSize: labelFontSize,\n valueMargin: valueMargin,\n valueFontSize: valueFontSize,\n width: width,\n radius: radius,\n thresholdWidth: thresholdWidth,\n thresholdLabelMargin: thresholdLabelMargin,\n thresholdLabelFontSize: thresholdLabelFontSize,\n gaugeOuterHeight: gaugeOuterHeight\n };\n }\n\n /**\n * calculate the values which are set as 'auto'\n *\n * @method calculateAutoValues\n * @param {Object} gaugeOptionsi the options of the gauge\n * @param {Number} cellWidth the width of cell\n */\n function calculateAutoValues(gaugeOptionsi, cellWidth) {\n\n if (gaugeOptionsi.gauge.width === \"auto\") {\n gaugeOptionsi.gauge.width = Math.max(5, cellWidth / 8);\n }\n if (gaugeOptionsi.label.margin === \"auto\") {\n gaugeOptionsi.label.margin = Math.max(1, cellWidth / 20);\n }\n if (gaugeOptionsi.label.font.size === \"auto\") {\n gaugeOptionsi.label.font.size = Math.max(5, cellWidth / 8);\n }\n if (gaugeOptionsi.value.margin === \"auto\") {\n gaugeOptionsi.value.margin = Math.max(1, cellWidth / 30);\n }\n if (gaugeOptionsi.value.font.size === \"auto\") {\n gaugeOptionsi.value.font.size = Math.max(5, cellWidth / 9);\n }\n if (gaugeOptionsi.threshold.width === \"auto\") {\n gaugeOptionsi.threshold.width = Math.max(3, cellWidth / 100);\n }\n if (gaugeOptionsi.threshold.label.margin === \"auto\") {\n gaugeOptionsi.threshold.label.margin = Math.max(3, cellWidth / 40);\n }\n if (gaugeOptionsi.threshold.label.font.size === \"auto\") {\n gaugeOptionsi.threshold.label.font.size = Math.max(5, cellWidth / 15);\n }\n\n }\n Gauge.prototype.calculateAutoValues = calculateAutoValues;\n\n /**\n * calculate the layout of the cell inside\n *\n * @method calculateCellLayout\n * @param {Object} gaugeOptionsi the options of the gauge\n * @param {Number} cellWidth the width of cell\n * @param {Number} i the index of the series\n * @return the calculated cell layout properties\n */\n Gauge.prototype.calculateCellLayout = function(gaugeOptionsi, layout, i) {\n\n // calculate top, left and center\n var c = col(layout.columns, i);\n var r = row(layout.columns, i);\n var x = layout.margin + (layout.cellWidth + layout.hMargin) * c;\n var y = layout.margin + (layout.cellHeight + layout.vMargin) * r;\n var cx = x + (layout.cellWidth / 2);\n var cy = y + layout.cellMargin + (layout.labelMargin * 2) + layout.labelFontSize + layout.thresholdWidth\n + layout.thresholdLabelFontSize + (layout.thresholdLabelMargin * 2) + layout.radius;\n var blank = layout.cellHeight - (layout.cellMargin * 2) - (layout.labelMargin * 2) - layout.labelFontSize - layout.gaugeOuterHeight;\n var offsetY = 0;\n if (gaugeOptionsi.cell.vAlign === \"middle\") {\n offsetY = (blank / 2);\n } else if (gaugeOptionsi.cell.vAlign === \"bottom\") {\n offsetY = blank;\n }\n cy += offsetY;\n\n return {\n col: c,\n row: r,\n x: x,\n y: y,\n offsetY: offsetY,\n cellWidth: layout.cellWidth,\n cellHeight: layout.cellHeight,\n cellMargin: layout.cellMargin,\n cx: cx,\n cy: cy\n }\n }\n\n /**\n * draw the background of chart\n *\n * @method drawBackground\n * @param {Object} layout the layout properties\n */\n Gauge.prototype.drawBackground = function(layout) {\n\n if (!gaugeOptions.frame.show) {\n return;\n }\n context.save();\n context.strokeStyle = options.grid.borderColor;\n context.lineWidth = options.grid.borderWidth;\n context.strokeRect(0, 0, layout.canvasWidth, layout.canvasHeight);\n if (options.grid.backgroundColor) {\n context.fillStyle = options.grid.backgroundColor;\n context.fillRect(0, 0, layout.canvasWidth, layout.canvasHeight);\n }\n context.restore();\n }\n\n /**\n * draw the background of cell\n *\n * @method drawCellBackground\n * @param {Object} gaugeOptionsi the options of the gauge\n * @param {Object} cellLayout the cell layout properties\n */\n Gauge.prototype.drawCellBackground = function(gaugeOptionsi, cellLayout) {\n\n context.save();\n if (gaugeOptionsi.cell.border && gaugeOptionsi.cell.border.show && gaugeOptionsi.cell.border.color && gaugeOptionsi.cell.border.width) {\n context.strokeStyle = gaugeOptionsi.cell.border.color;\n context.lineWidth = gaugeOptionsi.cell.border.width;\n context.strokeRect(cellLayout.x, cellLayout.y, cellLayout.cellWidth, cellLayout.cellHeight);\n }\n if (gaugeOptionsi.cell.background && gaugeOptionsi.cell.background.color) {\n context.fillStyle = gaugeOptionsi.cell.background.color;\n context.fillRect(cellLayout.x, cellLayout.y, cellLayout.cellWidth, cellLayout.cellHeight);\n }\n context.restore();\n }\n\n /**\n * draw the gauge\n *\n * @method drawGauge\n * @param {Object} gaugeOptionsi the options of the gauge\n * @param {Object} layout the layout properties\n * @param {Object} cellLayout the cell layout properties\n * @param {String} label the label of data\n * @param {Number} data the value of the gauge\n */\n Gauge.prototype.drawGauge = function(gaugeOptionsi, layout, cellLayout, label, data) {\n\n\n var blur = gaugeOptionsi.gauge.shadow.show ? gaugeOptionsi.gauge.shadow.blur : 0;\n\n\n // draw gauge frame\n drawArcWithShadow(\n cellLayout.cx, // center x\n cellLayout.cy, // center y\n layout.radius,\n layout.width,\n toRad(gaugeOptionsi.gauge.startAngle),\n toRad(gaugeOptionsi.gauge.endAngle),\n gaugeOptionsi.gauge.border.color, // line color\n gaugeOptionsi.gauge.border.width, // line width\n gaugeOptionsi.gauge.background.color, // fill color\n blur);\n\n // draw gauge\n var c1 = getColor(gaugeOptionsi, data);\n var a2 = calculateAngle(gaugeOptionsi, layout, data);\n drawArcWithShadow(\n cellLayout.cx, // center x\n cellLayout.cy, // center y\n layout.radius - 1,\n layout.width - 2,\n toRad(gaugeOptionsi.gauge.startAngle),\n toRad(a2),\n c1, // line color\n 1, // line width\n c1, // fill color\n blur);\n }\n\n /**\n * decide the color of the data from the threshold options\n *\n * @method getColor\n * @private\n * @param {Object} gaugeOptionsi the options of the gauge\n * @param {Number} data the value of the gauge\n */\n function getColor(gaugeOptionsi, data) {\n var color;\n for (var i = 0; i < gaugeOptionsi.threshold.values.length; i++) {\n var threshold = gaugeOptionsi.threshold.values[i];\n color = threshold.color;\n if (data < threshold.value) {\n break;\n }\n }\n return color;\n }\n\n /**\n * calculate the angle of the data\n *\n * @method calculateAngle\n * @private\n * @param {Object} gaugeOptionsi the options of the gauge\n * @param {Object} layout the layout properties\n * @param {Number} data the value of the gauge\n */\n function calculateAngle(gaugeOptionsi, layout, data) {\n var a =\n gaugeOptionsi.gauge.startAngle\n + (gaugeOptionsi.gauge.endAngle - gaugeOptionsi.gauge.startAngle)\n * ((data - gaugeOptionsi.gauge.min) / (gaugeOptionsi.gauge.max - gaugeOptionsi.gauge.min));\n\n if (a < gaugeOptionsi.gauge.startAngle) {\n a = gaugeOptionsi.gauge.startAngle;\n } else if (a > gaugeOptionsi.gauge.endAngle) {\n a = gaugeOptionsi.gauge.endAngle;\n }\n return a;\n }\n\n /**\n * draw the arc of the threshold\n *\n * @method drawThreshold\n * @param {Object} gaugeOptionsi the options of the gauge\n * @param {Object} layout the layout properties\n * @param {Object} cellLayout the cell layout properties\n */\n Gauge.prototype.drawThreshold = function(gaugeOptionsi, layout, cellLayout) {\n\n var a1 = gaugeOptionsi.gauge.startAngle;\n for (var i = 0; i < gaugeOptionsi.threshold.values.length; i++) {\n var threshold = gaugeOptionsi.threshold.values[i];\n c1 = threshold.color;\n a2 = calculateAngle(gaugeOptionsi, layout, threshold.value);\n drawArc(\n context,\n cellLayout.cx, // center x\n cellLayout.cy, // center y\n layout.radius + layout.thresholdWidth,\n layout.thresholdWidth - 2,\n toRad(a1),\n toRad(a2),\n c1, // line color\n 1, // line width\n c1); // fill color\n a1 = a2;\n }\n }\n\n /**\n * draw an arc with a shadow\n *\n * @method drawArcWithShadow\n * @private\n * @param {Number} cx the x position of the center\n * @param {Number} cy the y position of the center\n * @param {Number} r the radius of an arc\n * @param {Number} w the width of an arc\n * @param {Number} rd1 the start angle of an arc in radians\n * @param {Number} rd2 the end angle of an arc in radians\n * @param {String} lc the color of a line\n * @param {Number} lw the widht of a line\n * @param {String} fc the fill color of an arc\n * @param {Number} blur the shdow blur\n */\n function drawArcWithShadow(cx, cy, r, w, rd1, rd2, lc, lw, fc, blur) {\n if (rd1 === rd2) {\n return;\n }\n context.save();\n\n drawArc(context, cx, cy, r, w, rd1, rd2, lc, lw, fc);\n\n if (blur) {\n drawArc(context, cx, cy, r, w, rd1, rd2);\n context.clip();\n context.shadowOffsetX = 0;\n context.shadowOffsetY = 0;\n context.shadowBlur = 10;\n context.shadowColor = \"gray\";\n drawArc(context, cx, cy, r + 1, w + 2, rd1, rd2, lc, 1);\n }\n context.restore();\n }\n\n /**\n * draw the label of the gauge\n *\n * @method drawLable\n * @param {Object} gaugeOptionsi the options of the gauge\n * @param {Object} layout the layout properties\n * @param {Object} cellLayout the cell layout properties\n * @param {Number} i the index of the series\n * @param {Object} item the item of the series\n */\n Gauge.prototype.drawLable = function(gaugeOptionsi, layout, cellLayout, i, item) {\n\n drawText(\n cellLayout.cx,\n cellLayout.y + cellLayout.cellMargin + layout.labelMargin + cellLayout.offsetY,\n \"flotGagueLabel\" + i,\n gaugeOptionsi.label.formatter ? gaugeOptionsi.label.formatter(item.label, item.data[0][1]) : text,\n gaugeOptionsi.label);\n }\n\n /**\n * draw the value of the gauge\n *\n * @method drawValue\n * @param {Object} gaugeOptionsi the options of the gauge\n * @param {Object} layout the layout properties\n * @param {Object} cellLayout the cell layout properties\n * @param {Number} i the index of the series\n * @param {Object} item the item of the series\n */\n Gauge.prototype.drawValue = function(gaugeOptionsi, layout, cellLayout, i, item) {\n\n drawText(\n cellLayout.cx,\n cellLayout.cy - (gaugeOptionsi.value.font.size / 2),\n \"flotGagueValue\" + i,\n gaugeOptionsi.value.formatter ? gaugeOptionsi.value.formatter(item.label, item.data[0][1]) : text,\n gaugeOptionsi.value);\n }\n\n /**\n * draw the values of the threshold\n *\n * @method drawThresholdValues\n * @param {Object} gaugeOptionsi the options of the gauge\n * @param {Object} layout the layout properties\n * @param {Object} cellLayout the cell layout properties\n * @param {Number} i the index of the series\n */\n Gauge.prototype.drawThresholdValues = function(gaugeOptionsi, layout, cellLayout, i) {\n\n // min, max\n drawThresholdValue(gaugeOptionsi, layout, cellLayout, \"Min\" + i, gaugeOptionsi.gauge.min, gaugeOptionsi.gauge.startAngle);\n drawThresholdValue(gaugeOptionsi, layout, cellLayout, \"Max\" + i, gaugeOptionsi.gauge.max, gaugeOptionsi.gauge.endAngle);\n // threshold values\n for (var j = 0; j < gaugeOptionsi.threshold.values.length; j++) {\n var threshold = gaugeOptionsi.threshold.values[j];\n if (threshold.value > gaugeOptionsi.gauge.min && threshold.value < gaugeOptionsi.gauge.max) {\n var a = calculateAngle(gaugeOptionsi, layout, threshold.value);\n drawThresholdValue(gaugeOptionsi, layout, cellLayout, i + \"_\" + j, threshold.value, a);\n }\n }\n }\n\n /**\n * draw the value of the threshold\n *\n * @method drawThresholdValue\n * @param {Object} gaugeOptionsi the options of the gauge\n * @param {Object} layout the layout properties\n * @param {Object} cellLayout the cell layout properties\n * @param {Number} i the index of the series\n * @param {Number} value the value of the threshold\n * @param {Number} a the angle of the value drawn\n */\n function drawThresholdValue(gaugeOptionsi, layout, cellLayout, i, value, a) {\n drawText(\n cellLayout.cx\n + ((layout.thresholdLabelMargin + (layout.thresholdLabelFontSize / 2) + layout.radius)\n * Math.cos(toRad(a))),\n cellLayout.cy\n + ((layout.thresholdLabelMargin + (layout.thresholdLabelFontSize / 2) + layout.radius)\n * Math.sin(toRad(a))),\n \"flotGagueThresholdValue\" + i,\n gaugeOptionsi.threshold.label.formatter ? gaugeOptionsi.threshold.label.formatter(value) : value,\n gaugeOptionsi.threshold.label,\n a);\n }\n\n /**\n * draw a text\n *\n * the textOptions is assumed as follows:\n *\n * textOptions: {\n * background: {\n * color: null,\n * opacity: 0\n * },\n * font: {\n * size: \"auto\"\n * family: \"\\\"MS ゴシック\\\",sans-serif\"\n * },\n * color: null\n * }\n *\n * @method drawText\n * @private\n * @param {Number} x the x position of the text drawn (left top)\n * @param {Number} y the y position of the text drawn (left top)\n * @param {String} id the id of the dom element\n * @param {String} text the text drawn\n * @param {Object} textOptions the option of the text\n * @param {Number} [a] the angle of the value drawn\n */\n function drawText(x, y, id, text, textOptions, a) {\n var span = $(\".\" + id, placeholder);\n var exists = span.length;\n if (!exists) {\n span = $(\"\")\n span.attr(\"id\", id);\n span.css(\"position\", \"absolute\");\n span.css(\"top\", y + \"px\");\n if (textOptions.font.size) {\n span.css(\"font-size\", textOptions.font.size + \"px\");\n }\n if (textOptions.font.family) {\n span.css(\"font-family\", textOptions.font.family);\n }\n if (textOptions.color) {\n span.css(\"color\", textOptions.color);\n }\n if (textOptions.background.color) {\n span.css(\"background-color\", textOptions.background.color);\n }\n if (textOptions.background.opacity) {\n span.css(\"opacity\", textOptions.background.opacity);\n }\n placeholder.append(span);\n }\n span.text(text);\n // after append, readjust the left position\n span.css(\"left\", x + \"px\"); // for redraw, resetting the left position is needed here\n span.css(\"left\", (parseInt(span.css(\"left\")) - (span.width()/ 2)) + \"px\");\n\n // at last, set angle\n if (!exists && a) {\n span.css(\"top\", (parseInt(span.css(\"top\")) - (span.height()/ 2)) + \"px\");\n span.css(\"transform\", \"rotate(\" + ((180 * a) + 90) + \"deg)\"); // not supported for ie8\n }\n }\n\n return Gauge;\n })();\n /**\n * get a instance of Logger\n *\n * @method getLogger\n * @for flot.gauge\n * @private\n * @param {Object} debugOptions the options of debug\n */\n function getLogger(debugOptions) {\n return typeof Logger !== \"undefined\" ? new Logger(debugOptions) : null;\n }\n\n /**\n * calculate the index of columns for the specified data\n *\n * @method col\n * @for flot.gauge\n * @param {Number} columns the number of columns\n * @param {Number} i the index of the series\n * @return the index of columns\n */\n function col(columns, i) {\n return i % columns;\n }\n\n /**\n * calculate the index of rows for the specified data\n *\n * @method row\n * @for flot.gauge\n * @param {Number} columns the number of rows\n * @param {Number} i the index of the series\n * @return the index of rows\n */\n function row(columns, i) {\n return Math.floor(i / columns);\n }\n\n /**\n * calculate the angle in radians\n *\n * internally, use a number without PI (0 - 2).\n * so, in this function, multiply PI\n *\n * @method toRad\n * @for flot.gauge\n * @param {Number} a the number of angle without PI\n * @return the angle in radians\n */\n function toRad(a) {\n return a * Math.PI;\n }\n\n /**\n * draw an arc\n *\n * @method drawArc\n * @for flot.gauge\n * @param {Object} context the context of canvas\n * @param {Number} cx the x position of the center\n * @param {Number} cy the y position of the center\n * @param {Number} r the radius of an arc\n * @param {Number} w the width of an arc\n * @param {Number} rd1 the start angle of an arc in radians\n * @param {Number} rd2 the end angle of an arc in radians\n * @param {String} lc the color of a line\n * @param {Number} lw the widht of a line\n * @param {String} fc the fill color of an arc\n */\n function drawArc(context, cx, cy, r, w, rd1, rd2, lc, lw, fc) {\n if (rd1 === rd2) {\n return;\n }\n var counterClockwise = false;\n context.save();\n context.beginPath();\n context.arc(cx, cy, r, rd1, rd2, counterClockwise);\n context.lineTo(cx + (r - w) * Math.cos(rd2),\n cy + (r - w) * Math.sin(rd2));\n context.arc(cx, cy, r - w, rd2, rd1, !counterClockwise);\n context.closePath();\n if (lw) {\n context.lineWidth = lw;\n }\n if (lc) {\n context.strokeStyle = lc;\n context.stroke();\n }\n if (fc) {\n context.fillStyle = fc;\n context.fill();\n }\n context.restore();\n }\n\n /**\n * initialize plugin\n *\n * @method init\n * @for flot.gauge\n * @private\n * @param {Object} plot a instance of plot\n */\n function init (plot) {\n // add processOptions hook\n plot.hooks.processOptions.push(function(plot, options) {\n var logger = getLogger(options.series.gauges.debug);\n\n\n\n\n // turn 'grid' and 'legend' off\n if (options.series.gauges.show) {\n options.grid.show = false;\n options.legend.show = false;\n }\n\n // sort threshold\n var thresholds = options.series.gauges.threshold.values;\n\n thresholds.sort(function(a, b) {\n if (a.value < b.value) {\n return -1;\n } else if (a.value > b.value) {\n return 1;\n } else {\n return 0;\n }\n });\n\n\n\n });\n\n // add draw hook\n plot.hooks.draw.push(function(plot, context) {\n var options = plot.getOptions();\n var gaugeOptions = options.series.gauges;\n\n var logger = getLogger(gaugeOptions.debug);\n\n\n if (!gaugeOptions.show) {\n return;\n }\n\n var series = plot.getData();\n\n if (!series || !series.length) {\n return; // if no series were passed\n }\n\n var gauge = new Gauge(plot, context);\n\n // calculate layout\n var layout = gauge.calculateLayout();\n\n // debug layout\n if (gaugeOptions.debug.layout) {\n\n }\n\n // draw background\n gauge.drawBackground(layout)\n\n // draw cells (label, gauge, value, threshold)\n for (var i = 0; i < series.length; i++) {\n var item = series[i];\n\n var gaugeOptionsi = $.extend({}, gaugeOptions, item.gauges);\n if (item.gauges) {\n // re-calculate 'auto' values\n gauge.calculateAutoValues(gaugeOptionsi, layout.cellWidth);\n }\n\n // calculate cell layout\n var cellLayout = gauge.calculateCellLayout(gaugeOptionsi, layout, i);\n\n // draw cell background\n gauge.drawCellBackground(gaugeOptionsi, cellLayout)\n // debug layout\n if (gaugeOptionsi.debug.layout) {\n\n }\n // draw label\n if (gaugeOptionsi.label.show) {\n gauge.drawLable(gaugeOptionsi, layout, cellLayout, i, item);\n }\n // draw gauge\n gauge.drawGauge(gaugeOptionsi, layout, cellLayout, item.label, item.data[0][1]);\n // draw threshold\n if (gaugeOptionsi.threshold.show) {\n gauge.drawThreshold(gaugeOptionsi, layout, cellLayout);\n }\n if (gaugeOptionsi.threshold.label.show) {\n gauge.drawThresholdValues(gaugeOptionsi, layout, cellLayout, i)\n }\n // draw value\n if (gaugeOptionsi.value.show) {\n gauge.drawValue(gaugeOptionsi, layout, cellLayout, i, item);\n }\n }\n });\n }\n\n /**\n * [defaults description]\n *\n * @property defaults\n * @type {Object}\n */\n var defaults = {\n series: {\n gauges: {\n debug: {\n log: false,\n layout: false,\n alert: false\n },\n show: false,\n layout: {\n margin: 5,\n columns: 3,\n hMargin: 5,\n vMargin: 5,\n square: false\n },\n frame: {\n show: true\n },\n cell: {\n background: {\n color: null\n },\n border: {\n show: true,\n color: \"black\",\n width: 1\n },\n margin: 5,\n vAlign: \"middle\" // 'top' or 'middle' or 'bottom'\n },\n gauge: {\n width: \"auto\", // a specified number, or 'auto'\n startAngle: 0.9, // 0 - 2 factor of the radians\n endAngle: 2.1, // 0 - 2 factor of the radians\n min: 0,\n max: 100,\n background: {\n color: \"white\"\n },\n border: {\n color: \"lightgray\",\n width: 2\n },\n shadow: {\n show: true,\n blur: 5\n }\n },\n label: {\n show: true,\n margin: \"auto\", // a specified number, or 'auto'\n background: {\n color: null,\n opacity: 0\n },\n font: {\n size: \"auto\", // a specified number, or 'auto'\n family: \"sans-serif\"\n },\n color: null,\n formatter: function(label, value) {\n return label;\n }\n },\n value: {\n show: true,\n margin: \"auto\", // a specified number, or 'auto'\n background: {\n color: null,\n opacity: 0\n },\n font: {\n size: \"auto\", // a specified number, or 'auto'\n family: \"sans-serif\"\n },\n color: null,\n formatter: function(label, value) {\n return parseInt(value);\n }\n },\n threshold: {\n show: true,\n width: \"auto\", // a specified number, or 'auto'\n label: {\n show: true,\n margin: \"auto\", // a specified number, or 'auto'\n background: {\n color: null,\n opacity: 0\n },\n font: {\n size: \"auto\", // a specified number, or 'auto'\n family: \",sans-serif\"\n },\n color: null,\n formatter: function(value) {\n return value;\n }\n },\n values: [\n {\n value: 50,\n color: \"lightgreen\"\n }, {\n value: 80,\n color: \"yellow\"\n }, {\n value: 100,\n color: \"red\"\n }\n ]\n }\n }\n }\n };\n\n // register the gauge plugin\n $.plot.plugins.push({\n init: init,\n options: defaults,\n name: \"gauge\",\n version: \"1.1.0\"\n });\n\n})(jQuery);\n\n\n/***/ }),\n\n/***/ 2165:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GettingStartedPanelCtrl\", function() { return GettingStartedPanelCtrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PanelCtrl\", function() { return GettingStartedPanelCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_plugins_sdk__ = __webpack_require__(1983);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_core__ = __webpack_require__(197);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\nvar GettingStartedPanelCtrl = /** @class */ (function (_super) {\n __extends(GettingStartedPanelCtrl, _super);\n /** @ngInject **/\n GettingStartedPanelCtrl.$inject = [\"$scope\", \"$injector\", \"backendSrv\", \"datasourceSrv\", \"$q\"];\n function GettingStartedPanelCtrl($scope, $injector, backendSrv, datasourceSrv, $q) {\n var _this = _super.call(this, $scope, $injector) || this;\n _this.backendSrv = backendSrv;\n _this.$q = $q;\n _this.stepIndex = 0;\n _this.steps = [];\n _this.steps.push({\n title: 'Install Grafana',\n icon: 'icon-gf icon-gf-check',\n href: 'http://docs.grafana.org/',\n target: '_blank',\n note: 'Review the installation docs',\n check: function () { return $q.when(true); },\n });\n _this.steps.push({\n title: 'Create your first data source',\n cta: 'Add data source',\n icon: 'icon-gf icon-gf-datasources',\n href: 'datasources/new?gettingstarted',\n check: function () {\n return $q.when(datasourceSrv.getMetricSources().filter(function (item) {\n return item.meta.builtIn !== true;\n }).length > 0);\n },\n });\n _this.steps.push({\n title: 'Create your first dashboard',\n cta: 'New dashboard',\n icon: 'icon-gf icon-gf-dashboard',\n href: 'dashboard/new?gettingstarted',\n check: function () {\n return _this.backendSrv.search({ limit: 1 }).then(function (result) {\n return result.length > 0;\n });\n },\n });\n _this.steps.push({\n title: 'Invite your team',\n cta: 'Add Users',\n icon: 'icon-gf icon-gf-users',\n href: 'org/users?gettingstarted',\n check: function () {\n return _this.backendSrv.get('/api/org/users').then(function (res) {\n return res.length > 1;\n });\n },\n });\n _this.steps.push({\n title: 'Install apps & plugins',\n cta: 'Explore plugin repository',\n icon: 'icon-gf icon-gf-apps',\n href: 'https://grafana.com/plugins?utm_source=grafana_getting_started',\n check: function () {\n return _this.backendSrv.get('/api/plugins', { embedded: 0, core: 0 }).then(function (plugins) {\n return plugins.length > 0;\n });\n },\n });\n return _this;\n }\n GettingStartedPanelCtrl.prototype.$onInit = function () {\n var _this = this;\n this.stepIndex = -1;\n return this.nextStep().then(function (res) {\n _this.checksDone = true;\n });\n };\n GettingStartedPanelCtrl.prototype.nextStep = function () {\n var _this = this;\n if (this.stepIndex === this.steps.length - 1) {\n return this.$q.when();\n }\n this.stepIndex += 1;\n var currentStep = this.steps[this.stepIndex];\n return currentStep.check().then(function (passed) {\n if (passed) {\n currentStep.cssClass = 'completed';\n return _this.nextStep();\n }\n currentStep.cssClass = 'active';\n return _this.$q.when();\n });\n };\n GettingStartedPanelCtrl.prototype.dismiss = function () {\n this.dashboard.removePanel(this.panel, false);\n this.backendSrv\n .request({\n method: 'PUT',\n url: '/api/user/helpflags/1',\n showSuccessAlert: false,\n })\n .then(function (res) {\n __WEBPACK_IMPORTED_MODULE_1_app_core_core__[\"c\" /* contextSrv */].user.helpFlags1 = res.helpFlags1;\n });\n };\n GettingStartedPanelCtrl.templateUrl = 'public/app/plugins/panel/gettingstarted/module.html';\n return GettingStartedPanelCtrl;\n}(__WEBPACK_IMPORTED_MODULE_0_app_plugins_sdk__[\"PanelCtrl\"]));\n\n\n\n/***/ }),\n\n/***/ 2166:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ExperimentPanelCtrl\", function() { return ExperimentPanelCtrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PanelCtrl\", function() { return ExperimentPanelCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_features_panel_panel_ctrl__ = __webpack_require__(1986);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\nvar ExperimentPanelCtrl = /** @class */ (function (_super) {\n __extends(ExperimentPanelCtrl, _super);\n /** @ngInject */\n ExperimentPanelCtrl.$inject = [\"$scope\", \"$injector\", \"backendSrv\", \"variableSrv\"];\n function ExperimentPanelCtrl($scope, $injector, backendSrv, variableSrv) {\n var _this = _super.call(this, $scope, $injector) || this;\n if (!_this.dashboard.snapshot) {\n var experimentIdVars = variableSrv.variables.filter(function (v) { return v.name === 'experiment_id'; });\n if (experimentIdVars.length > 0) {\n var experimentId = experimentIdVars[0].current.value;\n console.log('exp id', experimentId);\n backendSrv.get('/api/experiments/' + experimentId).then(function (experiment) {\n var duration = (experiment.stoppedNs - experiment.startedNs) / Math.pow(10, 9);\n experiment.duration = duration;\n experiment.created = new Date(experiment.created).toString();\n _this.experiment = experiment;\n });\n }\n }\n _this.events.on('refresh', _this.onExperimentDetailsPanelRefresh.bind(_this));\n return _this;\n }\n ExperimentPanelCtrl.prototype.onExperimentDetailsPanelRefresh = function () {\n if (this.dashboard.snapshot) {\n if (this.panel.snapshotData) {\n this.experiment = this.panel.snapshotData;\n }\n else if (this.experiment) {\n this.panel.snapshotData = this.experiment;\n }\n }\n };\n ExperimentPanelCtrl.templateUrl = 'public/app/plugins/panel/experimentdetails/module.html';\n return ExperimentPanelCtrl;\n}(__WEBPACK_IMPORTED_MODULE_0_app_features_panel_panel_ctrl__[\"a\" /* PanelCtrl */]));\n\n\n\n\n/***/ }),\n\n/***/ 2167:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ExperimentVideoPanelCtrl\", function() { return ExperimentVideoPanelCtrl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PanelCtrl\", function() { return ExperimentVideoPanelCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_features_panel_panel_ctrl__ = __webpack_require__(1986);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_core__ = __webpack_require__(197);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_uppy__ = __webpack_require__(711);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\nvar ExperimentVideoPanelCtrl = /** @class */ (function (_super) {\n __extends(ExperimentVideoPanelCtrl, _super);\n /** @ngInject */\n ExperimentVideoPanelCtrl.$inject = [\"$scope\", \"$injector\", \"experimentSrv\", \"backendSrv\", \"alertSrv\", \"$interval\"];\n function ExperimentVideoPanelCtrl($scope, $injector, experimentSrv, backendSrv, alertSrv, $interval) {\n var _this = _super.call(this, $scope, $injector) || this;\n _this.backendSrv = backendSrv;\n _this.alertSrv = alertSrv;\n _this.$interval = $interval;\n _this.isTranscoding = false;\n experimentSrv.getCurrent().then(function (exp) {\n _this.experiment = exp;\n _this.videoUrl = exp.videoUrl;\n if ('videoStartSec' in exp) {\n _this.offsetSec = exp.videoStartSec;\n }\n if (_this.videoUrl && !_this.videoUrl.toLowerCase().startsWith('http')) {\n _this.isTranscoding = true;\n _this.monitorTranscodeProgress();\n }\n });\n return _this;\n }\n ExperimentVideoPanelCtrl.prototype.syncClicked = function () {\n if (!this.syncEnabled) {\n __WEBPACK_IMPORTED_MODULE_1_app_core_core__[\"b\" /* appEvents */].emit('graph-hover-clear');\n }\n };\n ExperimentVideoPanelCtrl.prototype.getCountdownTimeSeconds = function (exp) {\n if (!exp || !exp.notes) {\n return null;\n }\n var match = exp.notes.match(/countdown: (\\d+)/);\n if (!match) {\n return null;\n }\n var val = parseFloat(match[1]);\n if (isNaN(val)) {\n return null;\n }\n return val / 1000;\n };\n ExperimentVideoPanelCtrl.prototype.setRefClicked = function () {\n var time = this.getCountdownTimeSeconds(this.experiment);\n var defaultValue = time ? (-time).toString() : '';\n var input = prompt('Current time in player is (enter: -50 for T-50 seconds):', defaultValue);\n if (input == null) {\n return;\n }\n var val = parseFloat(input);\n if (isNaN(val)) {\n alert('Invalid offset: not a number.');\n return;\n }\n var offset = -this.player.currentTime() + val;\n console.log('SET TZERO, player time: ', offset);\n this.offsetSec = offset;\n this.backendSrv.updateExperimentSilent(this.experiment.id, { videoStartSec: offset });\n };\n ExperimentVideoPanelCtrl.prototype.initializeUploader = function () {\n var _this = this;\n var experimentId = this.experiment.id;\n var uploadedVideoFilename;\n this.uppy = __WEBPACK_IMPORTED_MODULE_2_uppy__[\"Core\"]({ allowMultipleUploads: false })\n .use(__WEBPACK_IMPORTED_MODULE_2_uppy__[\"Dashboard\"], {\n inline: false,\n target: 'body',\n })\n .use(__WEBPACK_IMPORTED_MODULE_2_uppy__[\"AwsS3\"], {\n getUploadParameters: function (file) {\n var re = /(?:\\.([^.]+))?$/;\n var ext = re.exec(file.name)[1];\n uploadedVideoFilename = 'videoupload-' + experimentId + '.' + ext;\n return fetch('/api/s3-sign-upload', {\n method: 'post',\n headers: {\n accept: 'application/json',\n 'content-type': 'application/json',\n },\n body: JSON.stringify({\n filename: uploadedVideoFilename,\n contentType: file.type,\n }),\n })\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n var result = {\n method: 'PUT',\n url: data.url,\n fields: {},\n headers: {},\n };\n return result;\n });\n },\n limit: 1,\n });\n this.uppy.on('complete', function (result) {\n console.log('Upload complete! We’ve uploaded these files:', result.successful);\n _this.backendSrv.experimentCreateVideoJob(_this.experiment.id, uploadedVideoFilename).then(function (result) {\n _this.alertSrv.set('Processing video...', '', 'success', 10000);\n _this.uppy.close();\n _this.isTranscoding = true;\n _this.monitorTranscodeProgress();\n });\n });\n };\n ExperimentVideoPanelCtrl.prototype.showUploadDialog = function () {\n this.initializeUploader();\n this.uppy.getPlugin('Dashboard').openModal();\n };\n ExperimentVideoPanelCtrl.prototype.monitorTranscodeProgress = function () {\n var _this = this;\n this.intervalJob = this.$interval(function () {\n console.log('transcode progress check...');\n _this.backendSrv.experimentGetVideoJob(_this.experiment.id).then(function (result) {\n if (result.status && result.status.toLowerCase() === 'complete') {\n console.log('Job Complete!');\n _this.$interval.cancel(_this.intervalJob);\n _this.videoUrl = result.url;\n _this.isTranscoding = false;\n }\n });\n }, 10000);\n };\n ExperimentVideoPanelCtrl.templateUrl = 'public/app/plugins/panel/experimentvideo/module.html';\n return ExperimentVideoPanelCtrl;\n}(__WEBPACK_IMPORTED_MODULE_0_app_features_panel_panel_ctrl__[\"a\" /* PanelCtrl */]));\n\n\n\n\n/***/ }),\n\n/***/ 2168:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ConfigCtrl\", function() { return ConfigCtrl; });\nvar ConfigCtrl = /** @class */ (function () {\n /** @ngInject **/\n ConfigCtrl.$inject = [\"backendSrv\"];\n function ConfigCtrl(backendSrv) {\n this.backendSrv = backendSrv;\n this.appEditCtrl.setPreUpdateHook(this.initDatasource.bind(this));\n }\n ConfigCtrl.prototype.initDatasource = function () {\n var _this = this;\n return this.backendSrv.get('/api/datasources').then(function (res) {\n var found = false;\n for (var _i = 0, res_1 = res; _i < res_1.length; _i++) {\n var ds = res_1[_i];\n if (ds.type === 'grafana-testdata-datasource') {\n found = true;\n }\n }\n if (!found) {\n var dsInstance = {\n name: 'Grafana TestData',\n type: 'grafana-testdata-datasource',\n access: 'direct',\n jsonData: {},\n };\n return _this.backendSrv.post('/api/datasources', dsInstance);\n }\n return Promise.resolve();\n });\n };\n ConfigCtrl.template = '';\n return ConfigCtrl;\n}());\n\n\n\n/***/ }),\n\n/***/ 2169:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnnotationsQueryCtrl\", function() { return TestDataAnnotationsQueryCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__datasource__ = __webpack_require__(2170);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__query_ctrl__ = __webpack_require__(2171);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"TestDataDatasource\", function() { return __WEBPACK_IMPORTED_MODULE_0__datasource__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"Datasource\", function() { return __WEBPACK_IMPORTED_MODULE_0__datasource__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"QueryCtrl\", function() { return __WEBPACK_IMPORTED_MODULE_1__query_ctrl__[\"a\"]; });\n\n\nvar TestDataAnnotationsQueryCtrl = /** @class */ (function () {\n function TestDataAnnotationsQueryCtrl() {\n }\n TestDataAnnotationsQueryCtrl.template = '

    test data

    ';\n return TestDataAnnotationsQueryCtrl;\n}());\n\n\n\n/***/ }),\n\n/***/ 2170:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return TestDataDatasource; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n\nvar TestDataDatasource = /** @class */ (function () {\n /** @ngInject */\n TestDataDatasource.$inject = [\"instanceSettings\", \"backendSrv\", \"$q\"];\n function TestDataDatasource(instanceSettings, backendSrv, $q) {\n this.backendSrv = backendSrv;\n this.$q = $q;\n this.id = instanceSettings.id;\n }\n TestDataDatasource.prototype.query = function (options) {\n var _this = this;\n var queries = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.filter(options.targets, function (item) {\n return item.hide !== true;\n }).map(function (item) {\n return {\n refId: item.refId,\n scenarioId: item.scenarioId,\n intervalMs: options.intervalMs,\n maxDataPoints: options.maxDataPoints,\n stringInput: item.stringInput,\n points: item.points,\n alias: item.alias,\n datasourceId: _this.id,\n };\n });\n if (queries.length === 0) {\n return this.$q.when({ data: [] });\n }\n return this.backendSrv\n .post('/api/tsdb/query', {\n from: options.range.from.valueOf().toString(),\n to: options.range.to.valueOf().toString(),\n queries: queries,\n })\n .then(function (res) {\n var data = [];\n if (res.results) {\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.forEach(res.results, function (queryRes) {\n for (var _i = 0, _a = queryRes.series; _i < _a.length; _i++) {\n var series = _a[_i];\n data.push({\n target: series.name,\n datapoints: series.points,\n });\n }\n });\n }\n return { data: data };\n });\n };\n TestDataDatasource.prototype.annotationQuery = function (options) {\n return this.backendSrv.get('/api/annotations', {\n from: options.range.from.valueOf(),\n to: options.range.to.valueOf(),\n limit: options.limit,\n type: options.type,\n });\n };\n return TestDataDatasource;\n}());\n\n\n\n/***/ }),\n\n/***/ 2171:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return TestDataQueryCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_plugins_sdk__ = __webpack_require__(1983);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_moment__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_moment__);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\n\nvar TestDataQueryCtrl = /** @class */ (function (_super) {\n __extends(TestDataQueryCtrl, _super);\n /** @ngInject **/\n TestDataQueryCtrl.$inject = [\"$scope\", \"$injector\", \"backendSrv\"];\n function TestDataQueryCtrl($scope, $injector, backendSrv) {\n var _this = _super.call(this, $scope, $injector) || this;\n _this.backendSrv = backendSrv;\n _this.target.scenarioId = _this.target.scenarioId || 'random_walk';\n _this.scenarioList = [];\n _this.newPointTime = __WEBPACK_IMPORTED_MODULE_2_moment___default()();\n _this.selectedPoint = { text: 'Select point', value: null };\n return _this;\n }\n TestDataQueryCtrl.prototype.getPoints = function () {\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(this.target.points, function (point, index) {\n return {\n text: __WEBPACK_IMPORTED_MODULE_2_moment___default()(point[1]).format('MMMM Do YYYY, H:mm:ss') + ' : ' + point[0],\n value: index,\n };\n });\n };\n TestDataQueryCtrl.prototype.pointSelected = function (option) {\n this.selectedPoint = option;\n };\n TestDataQueryCtrl.prototype.deletePoint = function () {\n this.target.points.splice(this.selectedPoint.value, 1);\n this.selectedPoint = { text: 'Select point', value: null };\n this.refresh();\n };\n TestDataQueryCtrl.prototype.addPoint = function () {\n this.target.points = this.target.points || [];\n this.target.points.push([this.newPointValue, this.newPointTime.valueOf()]);\n this.target.points = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.sortBy(this.target.points, function (p) { return p[1]; });\n this.refresh();\n };\n TestDataQueryCtrl.prototype.$onInit = function () {\n var _this = this;\n return this.backendSrv.get('/api/tsdb/testdata/scenarios').then(function (res) {\n _this.scenarioList = res;\n _this.scenario = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(_this.scenarioList, { id: _this.target.scenarioId });\n });\n };\n TestDataQueryCtrl.prototype.scenarioChanged = function () {\n this.scenario = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.find(this.scenarioList, { id: this.target.scenarioId });\n this.target.stringInput = this.scenario.stringInput;\n if (this.target.scenarioId === 'manual_entry') {\n this.target.points = this.target.points || [];\n }\n else {\n delete this.target.points;\n }\n this.refresh();\n };\n TestDataQueryCtrl.templateUrl = 'partials/query.editor.html';\n return TestDataQueryCtrl;\n}(__WEBPACK_IMPORTED_MODULE_1_app_plugins_sdk__[\"QueryCtrl\"]));\n\n\n\n/***/ }),\n\n/***/ 2172:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Observable_1 = __webpack_require__(690);\nvar Subscriber_1 = __webpack_require__(693);\nvar Subscription_1 = __webpack_require__(700);\nvar ObjectUnsubscribedError_1 = __webpack_require__(2173);\nvar SubjectSubscription_1 = __webpack_require__(2174);\nvar rxSubscriber_1 = __webpack_require__(318);\n/**\n * @class SubjectSubscriber\n */\nvar SubjectSubscriber = (function (_super) {\n __extends(SubjectSubscriber, _super);\n function SubjectSubscriber(destination) {\n _super.call(this, destination);\n this.destination = destination;\n }\n return SubjectSubscriber;\n}(Subscriber_1.Subscriber));\nexports.SubjectSubscriber = SubjectSubscriber;\n/**\n * @class Subject\n */\nvar Subject = (function (_super) {\n __extends(Subject, _super);\n function Subject() {\n _super.call(this);\n this.observers = [];\n this.closed = false;\n this.isStopped = false;\n this.hasError = false;\n this.thrownError = null;\n }\n Subject.prototype[rxSubscriber_1.rxSubscriber] = function () {\n return new SubjectSubscriber(this);\n };\n Subject.prototype.lift = function (operator) {\n var subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n };\n Subject.prototype.next = function (value) {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n if (!this.isStopped) {\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].next(value);\n }\n }\n };\n Subject.prototype.error = function (err) {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n this.hasError = true;\n this.thrownError = err;\n this.isStopped = true;\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].error(err);\n }\n this.observers.length = 0;\n };\n Subject.prototype.complete = function () {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n this.isStopped = true;\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].complete();\n }\n this.observers.length = 0;\n };\n Subject.prototype.unsubscribe = function () {\n this.isStopped = true;\n this.closed = true;\n this.observers = null;\n };\n Subject.prototype._trySubscribe = function (subscriber) {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n else {\n return _super.prototype._trySubscribe.call(this, subscriber);\n }\n };\n /** @deprecated internal use only */ Subject.prototype._subscribe = function (subscriber) {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n else if (this.hasError) {\n subscriber.error(this.thrownError);\n return Subscription_1.Subscription.EMPTY;\n }\n else if (this.isStopped) {\n subscriber.complete();\n return Subscription_1.Subscription.EMPTY;\n }\n else {\n this.observers.push(subscriber);\n return new SubjectSubscription_1.SubjectSubscription(this, subscriber);\n }\n };\n Subject.prototype.asObservable = function () {\n var observable = new Observable_1.Observable();\n observable.source = this;\n return observable;\n };\n Subject.create = function (destination, source) {\n return new AnonymousSubject(destination, source);\n };\n return Subject;\n}(Observable_1.Observable));\nexports.Subject = Subject;\n/**\n * @class AnonymousSubject\n */\nvar AnonymousSubject = (function (_super) {\n __extends(AnonymousSubject, _super);\n function AnonymousSubject(destination, source) {\n _super.call(this);\n this.destination = destination;\n this.source = source;\n }\n AnonymousSubject.prototype.next = function (value) {\n var destination = this.destination;\n if (destination && destination.next) {\n destination.next(value);\n }\n };\n AnonymousSubject.prototype.error = function (err) {\n var destination = this.destination;\n if (destination && destination.error) {\n this.destination.error(err);\n }\n };\n AnonymousSubject.prototype.complete = function () {\n var destination = this.destination;\n if (destination && destination.complete) {\n this.destination.complete();\n }\n };\n /** @deprecated internal use only */ AnonymousSubject.prototype._subscribe = function (subscriber) {\n var source = this.source;\n if (source) {\n return this.source.subscribe(subscriber);\n }\n else {\n return Subscription_1.Subscription.EMPTY;\n }\n };\n return AnonymousSubject;\n}(Subject));\nexports.AnonymousSubject = AnonymousSubject;\n//# sourceMappingURL=Subject.js.map\n\n/***/ }),\n\n/***/ 2173:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/**\n * An error thrown when an action is invalid because the object has been\n * unsubscribed.\n *\n * @see {@link Subject}\n * @see {@link BehaviorSubject}\n *\n * @class ObjectUnsubscribedError\n */\nvar ObjectUnsubscribedError = (function (_super) {\n __extends(ObjectUnsubscribedError, _super);\n function ObjectUnsubscribedError() {\n var err = _super.call(this, 'object unsubscribed');\n this.name = err.name = 'ObjectUnsubscribedError';\n this.stack = err.stack;\n this.message = err.message;\n }\n return ObjectUnsubscribedError;\n}(Error));\nexports.ObjectUnsubscribedError = ObjectUnsubscribedError;\n//# sourceMappingURL=ObjectUnsubscribedError.js.map\n\n/***/ }),\n\n/***/ 2174:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscription_1 = __webpack_require__(700);\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar SubjectSubscription = (function (_super) {\n __extends(SubjectSubscription, _super);\n function SubjectSubscription(subject, subscriber) {\n _super.call(this);\n this.subject = subject;\n this.subscriber = subscriber;\n this.closed = false;\n }\n SubjectSubscription.prototype.unsubscribe = function () {\n if (this.closed) {\n return;\n }\n this.closed = true;\n var subject = this.subject;\n var observers = subject.observers;\n this.subject = null;\n if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {\n return;\n }\n var subscriberIndex = observers.indexOf(this.subscriber);\n if (subscriberIndex !== -1) {\n observers.splice(subscriberIndex, 1);\n }\n };\n return SubjectSubscription;\n}(Subscription_1.Subscription));\nexports.SubjectSubscription = SubjectSubscription;\n//# sourceMappingURL=SubjectSubscription.js.map\n\n/***/ }),\n\n/***/ 2175:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar Observable_1 = __webpack_require__(690);\nvar empty_1 = __webpack_require__(2176);\nObservable_1.Observable.empty = empty_1.empty;\n//# sourceMappingURL=empty.js.map\n\n/***/ }),\n\n/***/ 2176:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar EmptyObservable_1 = __webpack_require__(1992);\nexports.empty = EmptyObservable_1.EmptyObservable.create;\n//# sourceMappingURL=empty.js.map\n\n/***/ }),\n\n/***/ 2177:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar Observable_1 = __webpack_require__(690);\nvar from_1 = __webpack_require__(2178);\nObservable_1.Observable.from = from_1.from;\n//# sourceMappingURL=from.js.map\n\n/***/ }),\n\n/***/ 2178:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar FromObservable_1 = __webpack_require__(2179);\nexports.from = FromObservable_1.FromObservable.create;\n//# sourceMappingURL=from.js.map\n\n/***/ }),\n\n/***/ 2179:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar isArray_1 = __webpack_require__(701);\nvar isArrayLike_1 = __webpack_require__(2015);\nvar isPromise_1 = __webpack_require__(2016);\nvar PromiseObservable_1 = __webpack_require__(2180);\nvar IteratorObservable_1 = __webpack_require__(2181);\nvar ArrayObservable_1 = __webpack_require__(2017);\nvar ArrayLikeObservable_1 = __webpack_require__(2183);\nvar iterator_1 = __webpack_require__(1993);\nvar Observable_1 = __webpack_require__(690);\nvar observeOn_1 = __webpack_require__(2184);\nvar observable_1 = __webpack_require__(702);\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar FromObservable = (function (_super) {\n __extends(FromObservable, _super);\n function FromObservable(ish, scheduler) {\n _super.call(this, null);\n this.ish = ish;\n this.scheduler = scheduler;\n }\n /**\n * Creates an Observable from an Array, an array-like object, a Promise, an\n * iterable object, or an Observable-like object.\n *\n * Converts almost anything to an Observable.\n *\n * \n *\n * Convert various other objects and data types into Observables. `from`\n * converts a Promise or an array-like or an\n * [iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterable)\n * object into an Observable that emits the items in that promise or array or\n * iterable. A String, in this context, is treated as an array of characters.\n * Observable-like objects (contains a function named with the ES2015 Symbol\n * for Observable) can also be converted through this operator.\n *\n * @example \n * var array = [10, 20, 30];\n * var result = Rx.Observable.from(array);\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // 10 20 30\n *\n * @example \n * function* generateDoubles(seed) {\n * var i = seed;\n * while (true) {\n * yield i;\n * i = 2 * i; // double it\n * }\n * }\n *\n * var iterator = generateDoubles(3);\n * var result = Rx.Observable.from(iterator).take(10);\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // 3 6 12 24 48 96 192 384 768 1536\n *\n * @see {@link create}\n * @see {@link fromEvent}\n * @see {@link fromEventPattern}\n * @see {@link fromPromise}\n *\n * @param {ObservableInput} ish A subscribable object, a Promise, an\n * Observable-like, an Array, an iterable or an array-like object to be\n * converted.\n * @param {Scheduler} [scheduler] The scheduler on which to schedule the\n * emissions of values.\n * @return {Observable} The Observable whose values are originally from the\n * input object that was converted.\n * @static true\n * @name from\n * @owner Observable\n */\n FromObservable.create = function (ish, scheduler) {\n if (ish != null) {\n if (typeof ish[observable_1.observable] === 'function') {\n if (ish instanceof Observable_1.Observable && !scheduler) {\n return ish;\n }\n return new FromObservable(ish, scheduler);\n }\n else if (isArray_1.isArray(ish)) {\n return new ArrayObservable_1.ArrayObservable(ish, scheduler);\n }\n else if (isPromise_1.isPromise(ish)) {\n return new PromiseObservable_1.PromiseObservable(ish, scheduler);\n }\n else if (typeof ish[iterator_1.iterator] === 'function' || typeof ish === 'string') {\n return new IteratorObservable_1.IteratorObservable(ish, scheduler);\n }\n else if (isArrayLike_1.isArrayLike(ish)) {\n return new ArrayLikeObservable_1.ArrayLikeObservable(ish, scheduler);\n }\n }\n throw new TypeError((ish !== null && typeof ish || ish) + ' is not observable');\n };\n /** @deprecated internal use only */ FromObservable.prototype._subscribe = function (subscriber) {\n var ish = this.ish;\n var scheduler = this.scheduler;\n if (scheduler == null) {\n return ish[observable_1.observable]().subscribe(subscriber);\n }\n else {\n return ish[observable_1.observable]().subscribe(new observeOn_1.ObserveOnSubscriber(subscriber, scheduler, 0));\n }\n };\n return FromObservable;\n}(Observable_1.Observable));\nexports.FromObservable = FromObservable;\n//# sourceMappingURL=FromObservable.js.map\n\n/***/ }),\n\n/***/ 2180:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar root_1 = __webpack_require__(199);\nvar Observable_1 = __webpack_require__(690);\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar PromiseObservable = (function (_super) {\n __extends(PromiseObservable, _super);\n function PromiseObservable(promise, scheduler) {\n _super.call(this);\n this.promise = promise;\n this.scheduler = scheduler;\n }\n /**\n * Converts a Promise to an Observable.\n *\n * Returns an Observable that just emits the Promise's\n * resolved value, then completes.\n *\n * Converts an ES2015 Promise or a Promises/A+ spec compliant Promise to an\n * Observable. If the Promise resolves with a value, the output Observable\n * emits that resolved value as a `next`, and then completes. If the Promise\n * is rejected, then the output Observable emits the corresponding Error.\n *\n * @example \n * var result = Rx.Observable.fromPromise(fetch('http://myserver.com/'));\n * result.subscribe(x => console.log(x), e => console.error(e));\n *\n * @see {@link bindCallback}\n * @see {@link from}\n *\n * @param {PromiseLike} promise The promise to be converted.\n * @param {Scheduler} [scheduler] An optional IScheduler to use for scheduling\n * the delivery of the resolved value (or the rejection).\n * @return {Observable} An Observable which wraps the Promise.\n * @static true\n * @name fromPromise\n * @owner Observable\n */\n PromiseObservable.create = function (promise, scheduler) {\n return new PromiseObservable(promise, scheduler);\n };\n /** @deprecated internal use only */ PromiseObservable.prototype._subscribe = function (subscriber) {\n var _this = this;\n var promise = this.promise;\n var scheduler = this.scheduler;\n if (scheduler == null) {\n if (this._isScalar) {\n if (!subscriber.closed) {\n subscriber.next(this.value);\n subscriber.complete();\n }\n }\n else {\n promise.then(function (value) {\n _this.value = value;\n _this._isScalar = true;\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n }, function (err) {\n if (!subscriber.closed) {\n subscriber.error(err);\n }\n })\n .then(null, function (err) {\n // escape the promise trap, throw unhandled errors\n root_1.root.setTimeout(function () { throw err; });\n });\n }\n }\n else {\n if (this._isScalar) {\n if (!subscriber.closed) {\n return scheduler.schedule(dispatchNext, 0, { value: this.value, subscriber: subscriber });\n }\n }\n else {\n promise.then(function (value) {\n _this.value = value;\n _this._isScalar = true;\n if (!subscriber.closed) {\n subscriber.add(scheduler.schedule(dispatchNext, 0, { value: value, subscriber: subscriber }));\n }\n }, function (err) {\n if (!subscriber.closed) {\n subscriber.add(scheduler.schedule(dispatchError, 0, { err: err, subscriber: subscriber }));\n }\n })\n .then(null, function (err) {\n // escape the promise trap, throw unhandled errors\n root_1.root.setTimeout(function () { throw err; });\n });\n }\n }\n };\n return PromiseObservable;\n}(Observable_1.Observable));\nexports.PromiseObservable = PromiseObservable;\nfunction dispatchNext(arg) {\n var value = arg.value, subscriber = arg.subscriber;\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n}\nfunction dispatchError(arg) {\n var err = arg.err, subscriber = arg.subscriber;\n if (!subscriber.closed) {\n subscriber.error(err);\n }\n}\n//# sourceMappingURL=PromiseObservable.js.map\n\n/***/ }),\n\n/***/ 2181:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar root_1 = __webpack_require__(199);\nvar Observable_1 = __webpack_require__(690);\nvar iterator_1 = __webpack_require__(1993);\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar IteratorObservable = (function (_super) {\n __extends(IteratorObservable, _super);\n function IteratorObservable(iterator, scheduler) {\n _super.call(this);\n this.scheduler = scheduler;\n if (iterator == null) {\n throw new Error('iterator cannot be null.');\n }\n this.iterator = getIterator(iterator);\n }\n IteratorObservable.create = function (iterator, scheduler) {\n return new IteratorObservable(iterator, scheduler);\n };\n IteratorObservable.dispatch = function (state) {\n var index = state.index, hasError = state.hasError, iterator = state.iterator, subscriber = state.subscriber;\n if (hasError) {\n subscriber.error(state.error);\n return;\n }\n var result = iterator.next();\n if (result.done) {\n subscriber.complete();\n return;\n }\n subscriber.next(result.value);\n state.index = index + 1;\n if (subscriber.closed) {\n if (typeof iterator.return === 'function') {\n iterator.return();\n }\n return;\n }\n this.schedule(state);\n };\n /** @deprecated internal use only */ IteratorObservable.prototype._subscribe = function (subscriber) {\n var index = 0;\n var _a = this, iterator = _a.iterator, scheduler = _a.scheduler;\n if (scheduler) {\n return scheduler.schedule(IteratorObservable.dispatch, 0, {\n index: index, iterator: iterator, subscriber: subscriber\n });\n }\n else {\n do {\n var result = iterator.next();\n if (result.done) {\n subscriber.complete();\n break;\n }\n else {\n subscriber.next(result.value);\n }\n if (subscriber.closed) {\n if (typeof iterator.return === 'function') {\n iterator.return();\n }\n break;\n }\n } while (true);\n }\n };\n return IteratorObservable;\n}(Observable_1.Observable));\nexports.IteratorObservable = IteratorObservable;\nvar StringIterator = (function () {\n function StringIterator(str, idx, len) {\n if (idx === void 0) { idx = 0; }\n if (len === void 0) { len = str.length; }\n this.str = str;\n this.idx = idx;\n this.len = len;\n }\n StringIterator.prototype[iterator_1.iterator] = function () { return (this); };\n StringIterator.prototype.next = function () {\n return this.idx < this.len ? {\n done: false,\n value: this.str.charAt(this.idx++)\n } : {\n done: true,\n value: undefined\n };\n };\n return StringIterator;\n}());\nvar ArrayIterator = (function () {\n function ArrayIterator(arr, idx, len) {\n if (idx === void 0) { idx = 0; }\n if (len === void 0) { len = toLength(arr); }\n this.arr = arr;\n this.idx = idx;\n this.len = len;\n }\n ArrayIterator.prototype[iterator_1.iterator] = function () { return this; };\n ArrayIterator.prototype.next = function () {\n return this.idx < this.len ? {\n done: false,\n value: this.arr[this.idx++]\n } : {\n done: true,\n value: undefined\n };\n };\n return ArrayIterator;\n}());\nfunction getIterator(obj) {\n var i = obj[iterator_1.iterator];\n if (!i && typeof obj === 'string') {\n return new StringIterator(obj);\n }\n if (!i && obj.length !== undefined) {\n return new ArrayIterator(obj);\n }\n if (!i) {\n throw new TypeError('object is not iterable');\n }\n return obj[iterator_1.iterator]();\n}\nvar maxSafeInteger = Math.pow(2, 53) - 1;\nfunction toLength(o) {\n var len = +o.length;\n if (isNaN(len)) {\n return 0;\n }\n if (len === 0 || !numberIsFinite(len)) {\n return len;\n }\n len = sign(len) * Math.floor(Math.abs(len));\n if (len <= 0) {\n return 0;\n }\n if (len > maxSafeInteger) {\n return maxSafeInteger;\n }\n return len;\n}\nfunction numberIsFinite(value) {\n return typeof value === 'number' && root_1.root.isFinite(value);\n}\nfunction sign(value) {\n var valueAsNumber = +value;\n if (valueAsNumber === 0) {\n return valueAsNumber;\n }\n if (isNaN(valueAsNumber)) {\n return valueAsNumber;\n }\n return valueAsNumber < 0 ? -1 : 1;\n}\n//# sourceMappingURL=IteratorObservable.js.map\n\n/***/ }),\n\n/***/ 2182:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nfunction isScheduler(value) {\n return value && typeof value.schedule === 'function';\n}\nexports.isScheduler = isScheduler;\n//# sourceMappingURL=isScheduler.js.map\n\n/***/ }),\n\n/***/ 2183:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Observable_1 = __webpack_require__(690);\nvar ScalarObservable_1 = __webpack_require__(2018);\nvar EmptyObservable_1 = __webpack_require__(1992);\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar ArrayLikeObservable = (function (_super) {\n __extends(ArrayLikeObservable, _super);\n function ArrayLikeObservable(arrayLike, scheduler) {\n _super.call(this);\n this.arrayLike = arrayLike;\n this.scheduler = scheduler;\n if (!scheduler && arrayLike.length === 1) {\n this._isScalar = true;\n this.value = arrayLike[0];\n }\n }\n ArrayLikeObservable.create = function (arrayLike, scheduler) {\n var length = arrayLike.length;\n if (length === 0) {\n return new EmptyObservable_1.EmptyObservable();\n }\n else if (length === 1) {\n return new ScalarObservable_1.ScalarObservable(arrayLike[0], scheduler);\n }\n else {\n return new ArrayLikeObservable(arrayLike, scheduler);\n }\n };\n ArrayLikeObservable.dispatch = function (state) {\n var arrayLike = state.arrayLike, index = state.index, length = state.length, subscriber = state.subscriber;\n if (subscriber.closed) {\n return;\n }\n if (index >= length) {\n subscriber.complete();\n return;\n }\n subscriber.next(arrayLike[index]);\n state.index = index + 1;\n this.schedule(state);\n };\n /** @deprecated internal use only */ ArrayLikeObservable.prototype._subscribe = function (subscriber) {\n var index = 0;\n var _a = this, arrayLike = _a.arrayLike, scheduler = _a.scheduler;\n var length = arrayLike.length;\n if (scheduler) {\n return scheduler.schedule(ArrayLikeObservable.dispatch, 0, {\n arrayLike: arrayLike, index: index, length: length, subscriber: subscriber\n });\n }\n else {\n for (var i = 0; i < length && !subscriber.closed; i++) {\n subscriber.next(arrayLike[i]);\n }\n subscriber.complete();\n }\n };\n return ArrayLikeObservable;\n}(Observable_1.Observable));\nexports.ArrayLikeObservable = ArrayLikeObservable;\n//# sourceMappingURL=ArrayLikeObservable.js.map\n\n/***/ }),\n\n/***/ 2184:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscriber_1 = __webpack_require__(693);\nvar Notification_1 = __webpack_require__(2185);\n/**\n *\n * Re-emits all notifications from source Observable with specified scheduler.\n *\n * Ensure a specific scheduler is used, from outside of an Observable.\n *\n * `observeOn` is an operator that accepts a scheduler as a first parameter, which will be used to reschedule\n * notifications emitted by the source Observable. It might be useful, if you do not have control over\n * internal scheduler of a given Observable, but want to control when its values are emitted nevertheless.\n *\n * Returned Observable emits the same notifications (nexted values, complete and error events) as the source Observable,\n * but rescheduled with provided scheduler. Note that this doesn't mean that source Observables internal\n * scheduler will be replaced in any way. Original scheduler still will be used, but when the source Observable emits\n * notification, it will be immediately scheduled again - this time with scheduler passed to `observeOn`.\n * An anti-pattern would be calling `observeOn` on Observable that emits lots of values synchronously, to split\n * that emissions into asynchronous chunks. For this to happen, scheduler would have to be passed into the source\n * Observable directly (usually into the operator that creates it). `observeOn` simply delays notifications a\n * little bit more, to ensure that they are emitted at expected moments.\n *\n * As a matter of fact, `observeOn` accepts second parameter, which specifies in milliseconds with what delay notifications\n * will be emitted. The main difference between {@link delay} operator and `observeOn` is that `observeOn`\n * will delay all notifications - including error notifications - while `delay` will pass through error\n * from source Observable immediately when it is emitted. In general it is highly recommended to use `delay` operator\n * for any kind of delaying of values in the stream, while using `observeOn` to specify which scheduler should be used\n * for notification emissions in general.\n *\n * @example \n * const intervals = Rx.Observable.interval(10); // Intervals are scheduled\n * // with async scheduler by default...\n *\n * intervals\n * .observeOn(Rx.Scheduler.animationFrame) // ...but we will observe on animationFrame\n * .subscribe(val => { // scheduler to ensure smooth animation.\n * someDiv.style.height = val + 'px';\n * });\n *\n * @see {@link delay}\n *\n * @param {IScheduler} scheduler Scheduler that will be used to reschedule notifications from source Observable.\n * @param {number} [delay] Number of milliseconds that states with what delay every notification should be rescheduled.\n * @return {Observable} Observable that emits the same notifications as the source Observable,\n * but with provided scheduler.\n *\n * @method observeOn\n * @owner Observable\n */\nfunction observeOn(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n return function observeOnOperatorFunction(source) {\n return source.lift(new ObserveOnOperator(scheduler, delay));\n };\n}\nexports.observeOn = observeOn;\nvar ObserveOnOperator = (function () {\n function ObserveOnOperator(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n this.scheduler = scheduler;\n this.delay = delay;\n }\n ObserveOnOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));\n };\n return ObserveOnOperator;\n}());\nexports.ObserveOnOperator = ObserveOnOperator;\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar ObserveOnSubscriber = (function (_super) {\n __extends(ObserveOnSubscriber, _super);\n function ObserveOnSubscriber(destination, scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n _super.call(this, destination);\n this.scheduler = scheduler;\n this.delay = delay;\n }\n ObserveOnSubscriber.dispatch = function (arg) {\n var notification = arg.notification, destination = arg.destination;\n notification.observe(destination);\n this.unsubscribe();\n };\n ObserveOnSubscriber.prototype.scheduleMessage = function (notification) {\n this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination)));\n };\n ObserveOnSubscriber.prototype._next = function (value) {\n this.scheduleMessage(Notification_1.Notification.createNext(value));\n };\n ObserveOnSubscriber.prototype._error = function (err) {\n this.scheduleMessage(Notification_1.Notification.createError(err));\n };\n ObserveOnSubscriber.prototype._complete = function () {\n this.scheduleMessage(Notification_1.Notification.createComplete());\n };\n return ObserveOnSubscriber;\n}(Subscriber_1.Subscriber));\nexports.ObserveOnSubscriber = ObserveOnSubscriber;\nvar ObserveOnMessage = (function () {\n function ObserveOnMessage(notification, destination) {\n this.notification = notification;\n this.destination = destination;\n }\n return ObserveOnMessage;\n}());\nexports.ObserveOnMessage = ObserveOnMessage;\n//# sourceMappingURL=observeOn.js.map\n\n/***/ }),\n\n/***/ 2185:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar Observable_1 = __webpack_require__(690);\n/**\n * Represents a push-based event or value that an {@link Observable} can emit.\n * This class is particularly useful for operators that manage notifications,\n * like {@link materialize}, {@link dematerialize}, {@link observeOn}, and\n * others. Besides wrapping the actual delivered value, it also annotates it\n * with metadata of, for instance, what type of push message it is (`next`,\n * `error`, or `complete`).\n *\n * @see {@link materialize}\n * @see {@link dematerialize}\n * @see {@link observeOn}\n *\n * @class Notification\n */\nvar Notification = (function () {\n function Notification(kind, value, error) {\n this.kind = kind;\n this.value = value;\n this.error = error;\n this.hasValue = kind === 'N';\n }\n /**\n * Delivers to the given `observer` the value wrapped by this Notification.\n * @param {Observer} observer\n * @return\n */\n Notification.prototype.observe = function (observer) {\n switch (this.kind) {\n case 'N':\n return observer.next && observer.next(this.value);\n case 'E':\n return observer.error && observer.error(this.error);\n case 'C':\n return observer.complete && observer.complete();\n }\n };\n /**\n * Given some {@link Observer} callbacks, deliver the value represented by the\n * current Notification to the correctly corresponding callback.\n * @param {function(value: T): void} next An Observer `next` callback.\n * @param {function(err: any): void} [error] An Observer `error` callback.\n * @param {function(): void} [complete] An Observer `complete` callback.\n * @return {any}\n */\n Notification.prototype.do = function (next, error, complete) {\n var kind = this.kind;\n switch (kind) {\n case 'N':\n return next && next(this.value);\n case 'E':\n return error && error(this.error);\n case 'C':\n return complete && complete();\n }\n };\n /**\n * Takes an Observer or its individual callback functions, and calls `observe`\n * or `do` methods accordingly.\n * @param {Observer|function(value: T): void} nextOrObserver An Observer or\n * the `next` callback.\n * @param {function(err: any): void} [error] An Observer `error` callback.\n * @param {function(): void} [complete] An Observer `complete` callback.\n * @return {any}\n */\n Notification.prototype.accept = function (nextOrObserver, error, complete) {\n if (nextOrObserver && typeof nextOrObserver.next === 'function') {\n return this.observe(nextOrObserver);\n }\n else {\n return this.do(nextOrObserver, error, complete);\n }\n };\n /**\n * Returns a simple Observable that just delivers the notification represented\n * by this Notification instance.\n * @return {any}\n */\n Notification.prototype.toObservable = function () {\n var kind = this.kind;\n switch (kind) {\n case 'N':\n return Observable_1.Observable.of(this.value);\n case 'E':\n return Observable_1.Observable.throw(this.error);\n case 'C':\n return Observable_1.Observable.empty();\n }\n throw new Error('unexpected notification kind value');\n };\n /**\n * A shortcut to create a Notification instance of the type `next` from a\n * given value.\n * @param {T} value The `next` value.\n * @return {Notification} The \"next\" Notification representing the\n * argument.\n */\n Notification.createNext = function (value) {\n if (typeof value !== 'undefined') {\n return new Notification('N', value);\n }\n return Notification.undefinedValueNotification;\n };\n /**\n * A shortcut to create a Notification instance of the type `error` from a\n * given error.\n * @param {any} [err] The `error` error.\n * @return {Notification} The \"error\" Notification representing the\n * argument.\n */\n Notification.createError = function (err) {\n return new Notification('E', undefined, err);\n };\n /**\n * A shortcut to create a Notification instance of the type `complete`.\n * @return {Notification} The valueless \"complete\" Notification.\n */\n Notification.createComplete = function () {\n return Notification.completeNotification;\n };\n Notification.completeNotification = new Notification('C');\n Notification.undefinedValueNotification = new Notification('N', undefined);\n return Notification;\n}());\nexports.Notification = Notification;\n//# sourceMappingURL=Notification.js.map\n\n/***/ }),\n\n/***/ 2186:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar Observable_1 = __webpack_require__(690);\nvar map_1 = __webpack_require__(2187);\nObservable_1.Observable.prototype.map = map_1.map;\n//# sourceMappingURL=map.js.map\n\n/***/ }),\n\n/***/ 2187:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar map_1 = __webpack_require__(2188);\n/**\n * Applies a given `project` function to each value emitted by the source\n * Observable, and emits the resulting values as an Observable.\n *\n * Like [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map),\n * it passes each source value through a transformation function to get\n * corresponding output values.\n *\n * \n *\n * Similar to the well known `Array.prototype.map` function, this operator\n * applies a projection to each value and emits that projection in the output\n * Observable.\n *\n * @example \n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var positions = clicks.map(ev => ev.clientX);\n * positions.subscribe(x => console.log(x));\n *\n * @see {@link mapTo}\n * @see {@link pluck}\n *\n * @param {function(value: T, index: number): R} project The function to apply\n * to each `value` emitted by the source Observable. The `index` parameter is\n * the number `i` for the i-th emission that has happened since the\n * subscription, starting from the number `0`.\n * @param {any} [thisArg] An optional argument to define what `this` is in the\n * `project` function.\n * @return {Observable} An Observable that emits the values from the source\n * Observable transformed by the given `project` function.\n * @method map\n * @owner Observable\n */\nfunction map(project, thisArg) {\n return map_1.map(project, thisArg)(this);\n}\nexports.map = map;\n//# sourceMappingURL=map.js.map\n\n/***/ }),\n\n/***/ 2188:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscriber_1 = __webpack_require__(693);\n/**\n * Applies a given `project` function to each value emitted by the source\n * Observable, and emits the resulting values as an Observable.\n *\n * Like [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map),\n * it passes each source value through a transformation function to get\n * corresponding output values.\n *\n * \n *\n * Similar to the well known `Array.prototype.map` function, this operator\n * applies a projection to each value and emits that projection in the output\n * Observable.\n *\n * @example \n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var positions = clicks.map(ev => ev.clientX);\n * positions.subscribe(x => console.log(x));\n *\n * @see {@link mapTo}\n * @see {@link pluck}\n *\n * @param {function(value: T, index: number): R} project The function to apply\n * to each `value` emitted by the source Observable. The `index` parameter is\n * the number `i` for the i-th emission that has happened since the\n * subscription, starting from the number `0`.\n * @param {any} [thisArg] An optional argument to define what `this` is in the\n * `project` function.\n * @return {Observable} An Observable that emits the values from the source\n * Observable transformed by the given `project` function.\n * @method map\n * @owner Observable\n */\nfunction map(project, thisArg) {\n return function mapOperation(source) {\n if (typeof project !== 'function') {\n throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');\n }\n return source.lift(new MapOperator(project, thisArg));\n };\n}\nexports.map = map;\nvar MapOperator = (function () {\n function MapOperator(project, thisArg) {\n this.project = project;\n this.thisArg = thisArg;\n }\n MapOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));\n };\n return MapOperator;\n}());\nexports.MapOperator = MapOperator;\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar MapSubscriber = (function (_super) {\n __extends(MapSubscriber, _super);\n function MapSubscriber(destination, project, thisArg) {\n _super.call(this, destination);\n this.project = project;\n this.count = 0;\n this.thisArg = thisArg || this;\n }\n // NOTE: This looks unoptimized, but it's actually purposefully NOT\n // using try/catch optimizations.\n MapSubscriber.prototype._next = function (value) {\n var result;\n try {\n result = this.project.call(this.thisArg, value, this.count++);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n return MapSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=map.js.map\n\n/***/ }),\n\n/***/ 2189:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar Observable_1 = __webpack_require__(690);\nvar combineAll_1 = __webpack_require__(2190);\nObservable_1.Observable.prototype.combineAll = combineAll_1.combineAll;\n//# sourceMappingURL=combineAll.js.map\n\n/***/ }),\n\n/***/ 2190:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar combineAll_1 = __webpack_require__(2191);\n/**\n * Converts a higher-order Observable into a first-order Observable by waiting\n * for the outer Observable to complete, then applying {@link combineLatest}.\n *\n * Flattens an Observable-of-Observables by applying\n * {@link combineLatest} when the Observable-of-Observables completes.\n *\n * \n *\n * Takes an Observable of Observables, and collects all Observables from it.\n * Once the outer Observable completes, it subscribes to all collected\n * Observables and combines their values using the {@link combineLatest}\n * strategy, such that:\n * - Every time an inner Observable emits, the output Observable emits.\n * - When the returned observable emits, it emits all of the latest values by:\n * - If a `project` function is provided, it is called with each recent value\n * from each inner Observable in whatever order they arrived, and the result\n * of the `project` function is what is emitted by the output Observable.\n * - If there is no `project` function, an array of all of the most recent\n * values is emitted by the output Observable.\n *\n * @example \n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var higherOrder = clicks.map(ev =>\n * Rx.Observable.interval(Math.random()*2000).take(3)\n * ).take(2);\n * var result = higherOrder.combineAll();\n * result.subscribe(x => console.log(x));\n *\n * @see {@link combineLatest}\n * @see {@link mergeAll}\n *\n * @param {function} [project] An optional function to map the most recent\n * values from each inner Observable into a new result. Takes each of the most\n * recent values from each collected inner Observable as arguments, in order.\n * @return {Observable} An Observable of projected results or arrays of recent\n * values.\n * @method combineAll\n * @owner Observable\n */\nfunction combineAll(project) {\n return combineAll_1.combineAll(project)(this);\n}\nexports.combineAll = combineAll;\n//# sourceMappingURL=combineAll.js.map\n\n/***/ }),\n\n/***/ 2191:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar combineLatest_1 = __webpack_require__(2192);\nfunction combineAll(project) {\n return function (source) { return source.lift(new combineLatest_1.CombineLatestOperator(project)); };\n}\nexports.combineAll = combineAll;\n//# sourceMappingURL=combineAll.js.map\n\n/***/ }),\n\n/***/ 2192:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar ArrayObservable_1 = __webpack_require__(2017);\nvar isArray_1 = __webpack_require__(701);\nvar OuterSubscriber_1 = __webpack_require__(2193);\nvar subscribeToResult_1 = __webpack_require__(2194);\nvar none = {};\n/* tslint:enable:max-line-length */\n/**\n * Combines multiple Observables to create an Observable whose values are\n * calculated from the latest values of each of its input Observables.\n *\n * Whenever any input Observable emits a value, it\n * computes a formula using the latest values from all the inputs, then emits\n * the output of that formula.\n *\n * \n *\n * `combineLatest` combines the values from this Observable with values from\n * Observables passed as arguments. This is done by subscribing to each\n * Observable, in order, and collecting an array of each of the most recent\n * values any time any of the input Observables emits, then either taking that\n * array and passing it as arguments to an optional `project` function and\n * emitting the return value of that, or just emitting the array of recent\n * values directly if there is no `project` function.\n *\n * @example \n * var weight = Rx.Observable.of(70, 72, 76, 79, 75);\n * var height = Rx.Observable.of(1.76, 1.77, 1.78);\n * var bmi = weight.combineLatest(height, (w, h) => w / (h * h));\n * bmi.subscribe(x => console.log('BMI is ' + x));\n *\n * // With output to console:\n * // BMI is 24.212293388429753\n * // BMI is 23.93948099205209\n * // BMI is 23.671253629592222\n *\n * @see {@link combineAll}\n * @see {@link merge}\n * @see {@link withLatestFrom}\n *\n * @param {ObservableInput} other An input Observable to combine with the source\n * Observable. More than one input Observables may be given as argument.\n * @param {function} [project] An optional function to project the values from\n * the combined latest values into a new value on the output Observable.\n * @return {Observable} An Observable of projected values from the most recent\n * values from each input Observable, or an array of the most recent values from\n * each input Observable.\n * @method combineLatest\n * @owner Observable\n */\nfunction combineLatest() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i - 0] = arguments[_i];\n }\n var project = null;\n if (typeof observables[observables.length - 1] === 'function') {\n project = observables.pop();\n }\n // if the first and only other argument besides the resultSelector is an array\n // assume it's been called with `combineLatest([obs1, obs2, obs3], project)`\n if (observables.length === 1 && isArray_1.isArray(observables[0])) {\n observables = observables[0].slice();\n }\n return function (source) { return source.lift.call(new ArrayObservable_1.ArrayObservable([source].concat(observables)), new CombineLatestOperator(project)); };\n}\nexports.combineLatest = combineLatest;\nvar CombineLatestOperator = (function () {\n function CombineLatestOperator(project) {\n this.project = project;\n }\n CombineLatestOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new CombineLatestSubscriber(subscriber, this.project));\n };\n return CombineLatestOperator;\n}());\nexports.CombineLatestOperator = CombineLatestOperator;\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar CombineLatestSubscriber = (function (_super) {\n __extends(CombineLatestSubscriber, _super);\n function CombineLatestSubscriber(destination, project) {\n _super.call(this, destination);\n this.project = project;\n this.active = 0;\n this.values = [];\n this.observables = [];\n }\n CombineLatestSubscriber.prototype._next = function (observable) {\n this.values.push(none);\n this.observables.push(observable);\n };\n CombineLatestSubscriber.prototype._complete = function () {\n var observables = this.observables;\n var len = observables.length;\n if (len === 0) {\n this.destination.complete();\n }\n else {\n this.active = len;\n this.toRespond = len;\n for (var i = 0; i < len; i++) {\n var observable = observables[i];\n this.add(subscribeToResult_1.subscribeToResult(this, observable, observable, i));\n }\n }\n };\n CombineLatestSubscriber.prototype.notifyComplete = function (unused) {\n if ((this.active -= 1) === 0) {\n this.destination.complete();\n }\n };\n CombineLatestSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n var values = this.values;\n var oldVal = values[outerIndex];\n var toRespond = !this.toRespond\n ? 0\n : oldVal === none ? --this.toRespond : this.toRespond;\n values[outerIndex] = innerValue;\n if (toRespond === 0) {\n if (this.project) {\n this._tryProject(values);\n }\n else {\n this.destination.next(values.slice());\n }\n }\n };\n CombineLatestSubscriber.prototype._tryProject = function (values) {\n var result;\n try {\n result = this.project.apply(this, values);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n return CombineLatestSubscriber;\n}(OuterSubscriber_1.OuterSubscriber));\nexports.CombineLatestSubscriber = CombineLatestSubscriber;\n//# sourceMappingURL=combineLatest.js.map\n\n/***/ }),\n\n/***/ 2193:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscriber_1 = __webpack_require__(693);\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar OuterSubscriber = (function (_super) {\n __extends(OuterSubscriber, _super);\n function OuterSubscriber() {\n _super.apply(this, arguments);\n }\n OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.destination.next(innerValue);\n };\n OuterSubscriber.prototype.notifyError = function (error, innerSub) {\n this.destination.error(error);\n };\n OuterSubscriber.prototype.notifyComplete = function (innerSub) {\n this.destination.complete();\n };\n return OuterSubscriber;\n}(Subscriber_1.Subscriber));\nexports.OuterSubscriber = OuterSubscriber;\n//# sourceMappingURL=OuterSubscriber.js.map\n\n/***/ }),\n\n/***/ 2194:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar root_1 = __webpack_require__(199);\nvar isArrayLike_1 = __webpack_require__(2015);\nvar isPromise_1 = __webpack_require__(2016);\nvar isObject_1 = __webpack_require__(707);\nvar Observable_1 = __webpack_require__(690);\nvar iterator_1 = __webpack_require__(1993);\nvar InnerSubscriber_1 = __webpack_require__(2195);\nvar observable_1 = __webpack_require__(702);\nfunction subscribeToResult(outerSubscriber, result, outerValue, outerIndex) {\n var destination = new InnerSubscriber_1.InnerSubscriber(outerSubscriber, outerValue, outerIndex);\n if (destination.closed) {\n return null;\n }\n if (result instanceof Observable_1.Observable) {\n if (result._isScalar) {\n destination.next(result.value);\n destination.complete();\n return null;\n }\n else {\n destination.syncErrorThrowable = true;\n return result.subscribe(destination);\n }\n }\n else if (isArrayLike_1.isArrayLike(result)) {\n for (var i = 0, len = result.length; i < len && !destination.closed; i++) {\n destination.next(result[i]);\n }\n if (!destination.closed) {\n destination.complete();\n }\n }\n else if (isPromise_1.isPromise(result)) {\n result.then(function (value) {\n if (!destination.closed) {\n destination.next(value);\n destination.complete();\n }\n }, function (err) { return destination.error(err); })\n .then(null, function (err) {\n // Escaping the Promise trap: globally throw unhandled errors\n root_1.root.setTimeout(function () { throw err; });\n });\n return destination;\n }\n else if (result && typeof result[iterator_1.iterator] === 'function') {\n var iterator = result[iterator_1.iterator]();\n do {\n var item = iterator.next();\n if (item.done) {\n destination.complete();\n break;\n }\n destination.next(item.value);\n if (destination.closed) {\n break;\n }\n } while (true);\n }\n else if (result && typeof result[observable_1.observable] === 'function') {\n var obs = result[observable_1.observable]();\n if (typeof obs.subscribe !== 'function') {\n destination.error(new TypeError('Provided object does not correctly implement Symbol.observable'));\n }\n else {\n return obs.subscribe(new InnerSubscriber_1.InnerSubscriber(outerSubscriber, outerValue, outerIndex));\n }\n }\n else {\n var value = isObject_1.isObject(result) ? 'an invalid object' : \"'\" + result + \"'\";\n var msg = (\"You provided \" + value + \" where a stream was expected.\")\n + ' You can provide an Observable, Promise, Array, or Iterable.';\n destination.error(new TypeError(msg));\n }\n return null;\n}\nexports.subscribeToResult = subscribeToResult;\n//# sourceMappingURL=subscribeToResult.js.map\n\n/***/ }),\n\n/***/ 2195:\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscriber_1 = __webpack_require__(693);\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar InnerSubscriber = (function (_super) {\n __extends(InnerSubscriber, _super);\n function InnerSubscriber(parent, outerValue, outerIndex) {\n _super.call(this);\n this.parent = parent;\n this.outerValue = outerValue;\n this.outerIndex = outerIndex;\n this.index = 0;\n }\n InnerSubscriber.prototype._next = function (value) {\n this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);\n };\n InnerSubscriber.prototype._error = function (error) {\n this.parent.notifyError(error, this);\n this.unsubscribe();\n };\n InnerSubscriber.prototype._complete = function () {\n this.parent.notifyComplete(this);\n this.unsubscribe();\n };\n return InnerSubscriber;\n}(Subscriber_1.Subscriber));\nexports.InnerSubscriber = InnerSubscriber;\n//# sourceMappingURL=InnerSubscriber.js.map\n\n/***/ }),\n\n/***/ 2196:\n/***/ (function(module, exports) {\n\n/* Flot plugin for rendering pie charts.\n\nCopyright (c) 2007-2013 IOLA and Ole Laursen.\nLicensed under the MIT license.\n\nThe plugin assumes that each series has a single data value, and that each\nvalue is a positive integer or zero. Negative numbers don't make sense for a\npie chart, and have unpredictable results. The values do NOT need to be\npassed in as percentages; the plugin will calculate the total and per-slice\npercentages internally.\n\n* Created by Brian Medendorp\n\n* Updated with contributions from btburnett3, Anthony Aragues and Xavi Ivars\n\nThe plugin supports these options:\n\n\tseries: {\n\t\tpie: {\n\t\t\tshow: true/false\n\t\t\tradius: 0-1 for percentage of fullsize, or a specified pixel length, or 'auto'\n\t\t\tinnerRadius: 0-1 for percentage of fullsize or a specified pixel length, for creating a donut effect\n\t\t\tstartAngle: 0-2 factor of PI used for starting angle (in radians) i.e 3/2 starts at the top, 0 and 2 have the same result\n\t\t\ttilt: 0-1 for percentage to tilt the pie, where 1 is no tilt, and 0 is completely flat (nothing will show)\n\t\t\toffset: {\n\t\t\t\ttop: integer value to move the pie up or down\n\t\t\t\tleft: integer value to move the pie left or right, or 'auto'\n\t\t\t},\n\t\t\tstroke: {\n\t\t\t\tcolor: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#FFF')\n\t\t\t\twidth: integer pixel width of the stroke\n\t\t\t},\n\t\t\tlabel: {\n\t\t\t\tshow: true/false, or 'auto'\n\t\t\t\tformatter: a user-defined function that modifies the text/style of the label text\n\t\t\t\tradius: 0-1 for percentage of fullsize, or a specified pixel length\n\t\t\t\tbackground: {\n\t\t\t\t\tcolor: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#000')\n\t\t\t\t\topacity: 0-1\n\t\t\t\t},\n\t\t\t\tthreshold: 0-1 for the percentage value at which to hide labels (if they're too small)\n\t\t\t},\n\t\t\tcombine: {\n\t\t\t\tthreshold: 0-1 for the percentage value at which to combine slices (if they're too small)\n\t\t\t\tcolor: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#CCC'), if null, the plugin will automatically use the color of the first slice to be combined\n\t\t\t\tlabel: any text value of what the combined slice should be labeled\n\t\t\t}\n\t\t\thighlight: {\n\t\t\t\topacity: 0-1\n\t\t\t}\n\t\t}\n\t}\n\nMore detail and specific examples can be found in the included HTML file.\n\n*/\n\n(function($) {\n\n\t// Maximum redraw attempts when fitting labels within the plot\n\n\tvar REDRAW_ATTEMPTS = 10;\n\n\t// Factor by which to shrink the pie when fitting labels within the plot\n\n\tvar REDRAW_SHRINK = 0.95;\n\n\tfunction init(plot) {\n\n\t\tvar canvas = null,\n\t\t\ttarget = null,\n\t\t\tmaxRadius = null,\n\t\t\tcenterLeft = null,\n\t\t\tcenterTop = null,\n\t\t\tprocessed = false,\n\t\t\tctx = null;\n\n\t\t// interactive variables\n\n\t\tvar highlights = [];\n\n\t\t// add hook to determine if pie plugin in enabled, and then perform necessary operations\n\n\t\tplot.hooks.processOptions.push(function(plot, options) {\n\t\t\tif (options.series.pie.show) {\n\n\t\t\t\toptions.grid.show = false;\n\n\t\t\t\t// set labels.show\n\n\t\t\t\tif (options.series.pie.label.show == \"auto\") {\n\t\t\t\t\tif (options.legend.show) {\n\t\t\t\t\t\toptions.series.pie.label.show = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\toptions.series.pie.label.show = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// set radius\n\n\t\t\t\tif (options.series.pie.radius == \"auto\") {\n\t\t\t\t\tif (options.series.pie.label.show) {\n\t\t\t\t\t\toptions.series.pie.radius = 3/4;\n\t\t\t\t\t} else {\n\t\t\t\t\t\toptions.series.pie.radius = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// ensure sane tilt\n\n\t\t\t\tif (options.series.pie.tilt > 1) {\n\t\t\t\t\toptions.series.pie.tilt = 1;\n\t\t\t\t} else if (options.series.pie.tilt < 0) {\n\t\t\t\t\toptions.series.pie.tilt = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tplot.hooks.bindEvents.push(function(plot, eventHolder) {\n\t\t\tvar options = plot.getOptions();\n\t\t\tif (options.series.pie.show) {\n\t\t\t\tif (options.grid.hoverable) {\n\t\t\t\t\teventHolder.unbind(\"mousemove\").mousemove(onMouseMove);\n\t\t\t\t}\n\t\t\t\tif (options.grid.clickable) {\n\t\t\t\t\teventHolder.unbind(\"click\").click(onClick);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tplot.hooks.processDatapoints.push(function(plot, series, data, datapoints) {\n\t\t\tvar options = plot.getOptions();\n\t\t\tif (options.series.pie.show) {\n\t\t\t\tprocessDatapoints(plot, series, data, datapoints);\n\t\t\t}\n\t\t});\n\n\t\tplot.hooks.drawOverlay.push(function(plot, octx) {\n\t\t\tvar options = plot.getOptions();\n\t\t\tif (options.series.pie.show) {\n\t\t\t\tdrawOverlay(plot, octx);\n\t\t\t}\n\t\t});\n\n\t\tplot.hooks.draw.push(function(plot, newCtx) {\n\t\t\tvar options = plot.getOptions();\n\t\t\tif (options.series.pie.show) {\n\t\t\t\tdraw(plot, newCtx);\n\t\t\t}\n\t\t});\n\n\t\tfunction processDatapoints(plot, series, datapoints) {\n\t\t\tif (!processed)\t{\n\t\t\t\tprocessed = true;\n\t\t\t\tcanvas = plot.getCanvas();\n\t\t\t\ttarget = $(canvas).parent();\n\t\t\t\toptions = plot.getOptions();\n\t\t\t\tplot.setData(combine(plot.getData()));\n\t\t\t}\n\t\t}\n\n\t\tfunction combine(data) {\n\n\t\t\tvar total = 0,\n\t\t\t\tcombined = 0,\n\t\t\t\tnumCombined = 0,\n\t\t\t\tcolor = options.series.pie.combine.color,\n\t\t\t\tnewdata = [];\n\n\t\t\t// Fix up the raw data from Flot, ensuring the data is numeric\n\n\t\t\tfor (var i = 0; i < data.length; ++i) {\n\n\t\t\t\tvar value = data[i].data;\n\n\t\t\t\t// If the data is an array, we'll assume that it's a standard\n\t\t\t\t// Flot x-y pair, and are concerned only with the second value.\n\n\t\t\t\t// Note how we use the original array, rather than creating a\n\t\t\t\t// new one; this is more efficient and preserves any extra data\n\t\t\t\t// that the user may have stored in higher indexes.\n\n\t\t\t\tif ($.isArray(value) && value.length == 1) {\n \t\t\t\tvalue = value[0];\n\t\t\t\t}\n\n\t\t\t\tif ($.isArray(value)) {\n\t\t\t\t\t// Equivalent to $.isNumeric() but compatible with jQuery < 1.7\n\t\t\t\t\tif (!isNaN(parseFloat(value[1])) && isFinite(value[1])) {\n\t\t\t\t\t\tvalue[1] = +value[1];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalue[1] = 0;\n\t\t\t\t\t}\n\t\t\t\t} else if (!isNaN(parseFloat(value)) && isFinite(value)) {\n\t\t\t\t\tvalue = [1, +value];\n\t\t\t\t} else {\n\t\t\t\t\tvalue = [1, 0];\n\t\t\t\t}\n\n\t\t\t\tdata[i].data = [value];\n\t\t\t}\n\n\t\t\t// Sum up all the slices, so we can calculate percentages for each\n\n\t\t\tfor (var i = 0; i < data.length; ++i) {\n\t\t\t\ttotal += data[i].data[0][1];\n\t\t\t}\n\n\t\t\t// Count the number of slices with percentages below the combine\n\t\t\t// threshold; if it turns out to be just one, we won't combine.\n\n\t\t\tfor (var i = 0; i < data.length; ++i) {\n\t\t\t\tvar value = data[i].data[0][1];\n\t\t\t\tif (value / total <= options.series.pie.combine.threshold) {\n\t\t\t\t\tcombined += value;\n\t\t\t\t\tnumCombined++;\n\t\t\t\t\tif (!color) {\n\t\t\t\t\t\tcolor = data[i].color;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (var i = 0; i < data.length; ++i) {\n\t\t\t\tvar value = data[i].data[0][1];\n\t\t\t\tif (numCombined < 2 || value / total > options.series.pie.combine.threshold) {\n\t\t\t\t\tnewdata.push({\n\t\t\t\t\t\tdata: [[1, value]],\n\t\t\t\t\t\tcolor: data[i].color,\n\t\t\t\t\t\tlabel: data[i].label,\n\t\t\t\t\t\tangle: value * Math.PI * 2 / total,\n\t\t\t\t\t\tpercent: value / (total / 100)\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (numCombined > 1) {\n\t\t\t\tnewdata.push({\n\t\t\t\t\tdata: [[1, combined]],\n\t\t\t\t\tcolor: color,\n\t\t\t\t\tlabel: options.series.pie.combine.label,\n\t\t\t\t\tangle: combined * Math.PI * 2 / total,\n\t\t\t\t\tpercent: combined / (total / 100)\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn newdata;\n\t\t}\n\n\t\tfunction draw(plot, newCtx) {\n\n\t\t\tif (!target) {\n\t\t\t\treturn; // if no series were passed\n\t\t\t}\n\n\t\t\tvar canvasWidth = plot.getPlaceholder().width(),\n\t\t\t\tcanvasHeight = plot.getPlaceholder().height(),\n\t\t\t\tlegendWidth = target.children().filter(\".legend\").children().width() || 0;\n\n\t\t\tctx = newCtx;\n\n\t\t\t// WARNING: HACK! REWRITE THIS CODE AS SOON AS POSSIBLE!\n\n\t\t\t// When combining smaller slices into an 'other' slice, we need to\n\t\t\t// add a new series. Since Flot gives plugins no way to modify the\n\t\t\t// list of series, the pie plugin uses a hack where the first call\n\t\t\t// to processDatapoints results in a call to setData with the new\n\t\t\t// list of series, then subsequent processDatapoints do nothing.\n\n\t\t\t// The plugin-global 'processed' flag is used to control this hack;\n\t\t\t// it starts out false, and is set to true after the first call to\n\t\t\t// processDatapoints.\n\n\t\t\t// Unfortunately this turns future setData calls into no-ops; they\n\t\t\t// call processDatapoints, the flag is true, and nothing happens.\n\n\t\t\t// To fix this we'll set the flag back to false here in draw, when\n\t\t\t// all series have been processed, so the next sequence of calls to\n\t\t\t// processDatapoints once again starts out with a slice-combine.\n\t\t\t// This is really a hack; in 0.9 we need to give plugins a proper\n\t\t\t// way to modify series before any processing begins.\n\n\t\t\tprocessed = false;\n\n\t\t\t// calculate maximum radius and center point\n\n\t\t\tmaxRadius = Math.min(canvasWidth, canvasHeight / options.series.pie.tilt) / 2;\n\t\t\tcenterTop = canvasHeight / 2 + options.series.pie.offset.top;\n\t\t\tcenterLeft = canvasWidth / 2;\n\n\t\t\tif (options.series.pie.offset.left == \"auto\") {\n\t\t\t\tif (options.legend.position.match(\"w\")) {\n\t\t\t\t\tcenterLeft += legendWidth / 2;\n\t\t\t\t} else {\n\t\t\t\t\tcenterLeft -= legendWidth / 2;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcenterLeft += options.series.pie.offset.left;\n\t\t\t}\n\n\t\t\tif (centerLeft < maxRadius) {\n\t\t\t\tcenterLeft = maxRadius;\n\t\t\t} else if (centerLeft > canvasWidth - maxRadius) {\n\t\t\t\tcenterLeft = canvasWidth - maxRadius;\n\t\t\t}\n\n\t\t\tvar slices = plot.getData(),\n\t\t\t\tattempts = 0;\n\n\t\t\t// Keep shrinking the pie's radius until drawPie returns true,\n\t\t\t// indicating that all the labels fit, or we try too many times.\n\n\t\t\tdo {\n\t\t\t\tif (attempts > 0) {\n\t\t\t\t\tmaxRadius *= REDRAW_SHRINK;\n\t\t\t\t}\n\t\t\t\tattempts += 1;\n\t\t\t\tclear();\n\t\t\t\tif (options.series.pie.tilt <= 0.8) {\n\t\t\t\t\tdrawShadow();\n\t\t\t\t}\n\t\t\t} while (!drawPie() && attempts < REDRAW_ATTEMPTS)\n\n\t\t\tif (attempts >= REDRAW_ATTEMPTS) {\n\t\t\t\tclear();\n\t\t\t\ttarget.prepend(\"
    Could not draw pie with labels contained inside canvas
    \");\n\t\t\t}\n\n\t\t\tif (plot.setSeries && plot.insertLegend) {\n\t\t\t\tplot.setSeries(slices);\n\t\t\t\tplot.insertLegend();\n\t\t\t}\n\n\t\t\t// we're actually done at this point, just defining internal functions at this point\n\n\t\t\tfunction clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}\n\n\t\t\tfunction drawShadow() {\n\n\t\t\t\tvar shadowLeft = options.series.pie.shadow.left;\n\t\t\t\tvar shadowTop = options.series.pie.shadow.top;\n\t\t\t\tvar edge = 10;\n\t\t\t\tvar alpha = options.series.pie.shadow.alpha;\n\t\t\t\tvar radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;\n\n\t\t\t\tif (radius >= canvasWidth / 2 - shadowLeft || radius * options.series.pie.tilt >= canvasHeight / 2 - shadowTop || radius <= edge) {\n\t\t\t\t\treturn;\t// shadow would be outside canvas, so don't draw it\n\t\t\t\t}\n\n\t\t\t\tctx.save();\n\t\t\t\tctx.translate(shadowLeft,shadowTop);\n\t\t\t\tctx.globalAlpha = alpha;\n\t\t\t\tctx.fillStyle = \"#000\";\n\n\t\t\t\t// center and rotate to starting position\n\n\t\t\t\tctx.translate(centerLeft,centerTop);\n\t\t\t\tctx.scale(1, options.series.pie.tilt);\n\n\t\t\t\t//radius -= edge;\n\n\t\t\t\tfor (var i = 1; i <= edge; i++) {\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tctx.arc(0, 0, radius, 0, Math.PI * 2, false);\n\t\t\t\t\tctx.fill();\n\t\t\t\t\tradius -= i;\n\t\t\t\t}\n\n\t\t\t\tctx.restore();\n\t\t\t}\n\n\t\t\tfunction drawPie() {\n\n\t\t\t\tvar startAngle = Math.PI * options.series.pie.startAngle;\n\t\t\t\tvar radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;\n\n\t\t\t\t// center and rotate to starting position\n\n\t\t\t\tctx.save();\n\t\t\t\tctx.translate(centerLeft,centerTop);\n\t\t\t\tctx.scale(1, options.series.pie.tilt);\n\t\t\t\t//ctx.rotate(startAngle); // start at top; -- This doesn't work properly in Opera\n\n\t\t\t\t// draw slices\n\n\t\t\t\tctx.save();\n\t\t\t\tvar currentAngle = startAngle;\n\t\t\t\tfor (var i = 0; i < slices.length; ++i) {\n\t\t\t\t\tslices[i].startAngle = currentAngle;\n\t\t\t\t\tdrawSlice(slices[i].angle, slices[i].color, true);\n\t\t\t\t}\n\t\t\t\tctx.restore();\n\n\t\t\t\t// draw slice outlines\n\n\t\t\t\tif (options.series.pie.stroke.width > 0) {\n\t\t\t\t\tctx.save();\n\t\t\t\t\tctx.lineWidth = options.series.pie.stroke.width;\n\t\t\t\t\tcurrentAngle = startAngle;\n\t\t\t\t\tfor (var i = 0; i < slices.length; ++i) {\n\t\t\t\t\t\tdrawSlice(slices[i].angle, options.series.pie.stroke.color, false);\n\t\t\t\t\t}\n\t\t\t\t\tctx.restore();\n\t\t\t\t}\n\n\t\t\t\t// draw donut hole\n\n\t\t\t\tdrawDonutHole(ctx);\n\n\t\t\t\tctx.restore();\n\n\t\t\t\t// Draw the labels, returning true if they fit within the plot\n\n\t\t\t\tif (options.series.pie.label.show) {\n\t\t\t\t\treturn drawLabels();\n\t\t\t\t} else return true;\n\n\t\t\t\tfunction drawSlice(angle, color, fill) {\n\n\t\t\t\t\tif (angle <= 0 || isNaN(angle)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (fill) {\n\t\t\t\t\t\tctx.fillStyle = color;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tctx.strokeStyle = color;\n\t\t\t\t\t\tctx.lineJoin = \"round\";\n\t\t\t\t\t}\n\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tif (Math.abs(angle - Math.PI * 2) > 0.000000001) {\n\t\t\t\t\t\tctx.moveTo(0, 0); // Center of the pie\n\t\t\t\t\t}\n\n\t\t\t\t\t//ctx.arc(0, 0, radius, 0, angle, false); // This doesn't work properly in Opera\n\t\t\t\t\tctx.arc(0, 0, radius,currentAngle, currentAngle + angle / 2, false);\n\t\t\t\t\tctx.arc(0, 0, radius,currentAngle + angle / 2, currentAngle + angle, false);\n\t\t\t\t\tctx.closePath();\n\t\t\t\t\t//ctx.rotate(angle); // This doesn't work properly in Opera\n\t\t\t\t\tcurrentAngle += angle;\n\n\t\t\t\t\tif (fill) {\n\t\t\t\t\t\tctx.fill();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tctx.stroke();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction drawLabels() {\n\n\t\t\t\t\tvar currentAngle = startAngle;\n\t\t\t\t\tvar radius = options.series.pie.label.radius > 1 ? options.series.pie.label.radius : maxRadius * options.series.pie.label.radius;\n\n\t\t\t\t\tfor (var i = 0; i < slices.length; ++i) {\n\t\t\t\t\t\tif (slices[i].percent >= options.series.pie.label.threshold * 100) {\n\t\t\t\t\t\t\tif (!drawLabel(slices[i], currentAngle, i)) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrentAngle += slices[i].angle;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn true;\n\n\t\t\t\t\tfunction drawLabel(slice, startAngle, index) {\n\n\t\t\t\t\t\tif (slice.data[0][1] == 0) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// format label text\n\n\t\t\t\t\t\tvar lf = options.legend.labelFormatter, text, plf = options.series.pie.label.formatter;\n\n\t\t\t\t\t\tif (lf) {\n\t\t\t\t\t\t\ttext = lf(slice.label, slice);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttext = slice.label;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (plf) {\n\t\t\t\t\t\t\ttext = plf(text, slice);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar halfAngle = ((startAngle + slice.angle) + startAngle) / 2;\n\t\t\t\t\t\tvar x = centerLeft + Math.round(Math.cos(halfAngle) * radius);\n\t\t\t\t\t\tvar y = centerTop + Math.round(Math.sin(halfAngle) * radius) * options.series.pie.tilt;\n\n\t\t\t\t\t\tvar html = \"\" + text + \"\";\n\t\t\t\t\t\ttarget.append(html);\n\n\t\t\t\t\t\tvar label = target.children(\"#pieLabel\" + index);\n\t\t\t\t\t\tvar labelTop = (y - label.height() / 2);\n\t\t\t\t\t\tvar labelLeft = (x - label.width() / 2);\n\n\t\t\t\t\t\tlabel.css(\"top\", labelTop);\n\t\t\t\t\t\tlabel.css(\"left\", labelLeft);\n\n\t\t\t\t\t\t// check to make sure that the label is not outside the canvas\n\n\t\t\t\t\t\tif (0 - labelTop > 0 || 0 - labelLeft > 0 || canvasHeight - (labelTop + label.height()) < 0 || canvasWidth - (labelLeft + label.width()) < 0) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (options.series.pie.label.background.opacity != 0) {\n\n\t\t\t\t\t\t\t// put in the transparent background separately to avoid blended labels and label boxes\n\n\t\t\t\t\t\t\tvar c = options.series.pie.label.background.color;\n\n\t\t\t\t\t\t\tif (c == null) {\n\t\t\t\t\t\t\t\tc = slice.color;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar pos = \"top:\" + labelTop + \"px;left:\" + labelLeft + \"px;\";\n\t\t\t\t\t\t\t$(\"
    \")\n\t\t\t\t\t\t\t\t.css(\"opacity\", options.series.pie.label.background.opacity)\n\t\t\t\t\t\t\t\t.insertBefore(label);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} // end individual label function\n\t\t\t\t} // end drawLabels function\n\t\t\t} // end drawPie function\n\t\t} // end draw function\n\n\t\t// Placed here because it needs to be accessed from multiple locations\n\n\t\tfunction drawDonutHole(layer) {\n\t\t\tif (options.series.pie.innerRadius > 0) {\n\n\t\t\t\t// subtract the center\n\n\t\t\t\tlayer.save();\n\t\t\t\tvar innerRadius = options.series.pie.innerRadius > 1 ? options.series.pie.innerRadius : maxRadius * options.series.pie.innerRadius;\n\t\t\t\tlayer.globalCompositeOperation = \"destination-out\"; // this does not work with excanvas, but it will fall back to using the stroke color\n\t\t\t\tlayer.beginPath();\n\t\t\t\tlayer.fillStyle = options.series.pie.stroke.color;\n\t\t\t\tlayer.arc(0, 0, innerRadius, 0, Math.PI * 2, false);\n\t\t\t\tlayer.fill();\n\t\t\t\tlayer.closePath();\n\t\t\t\tlayer.restore();\n\n\t\t\t\t// add inner stroke\n\n\t\t\t\tlayer.save();\n\t\t\t\tlayer.beginPath();\n\t\t\t\tlayer.strokeStyle = options.series.pie.stroke.color;\n\t\t\t\tlayer.arc(0, 0, innerRadius, 0, Math.PI * 2, false);\n\t\t\t\tlayer.stroke();\n\t\t\t\tlayer.closePath();\n\t\t\t\tlayer.restore();\n\n\t\t\t\t// TODO: add extra shadow inside hole (with a mask) if the pie is tilted.\n\t\t\t}\n\t\t}\n\n\t\t//-- Additional Interactive related functions --\n\n\t\tfunction isPointInPoly(poly, pt) {\n\t\t\tfor(var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i)\n\t\t\t\t((poly[i][1] <= pt[1] && pt[1] < poly[j][1]) || (poly[j][1] <= pt[1] && pt[1]< poly[i][1]))\n\t\t\t\t&& (pt[0] < (poly[j][0] - poly[i][0]) * (pt[1] - poly[i][1]) / (poly[j][1] - poly[i][1]) + poly[i][0])\n\t\t\t\t&& (c = !c);\n\t\t\treturn c;\n\t\t}\n\n\t\tfunction findNearbySlice(mouseX, mouseY) {\n\n\t\t\tvar slices = plot.getData(),\n\t\t\t\toptions = plot.getOptions(),\n\t\t\t\tradius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius,\n\t\t\t\tx, y;\n\n\t\t\tfor (var i = 0; i < slices.length; ++i) {\n\n\t\t\t\tvar s = slices[i];\n\n\t\t\t\tif (s.pie.show) {\n\n\t\t\t\t\tctx.save();\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tctx.moveTo(0, 0); // Center of the pie\n\t\t\t\t\t//ctx.scale(1, options.series.pie.tilt);\t// this actually seems to break everything when here.\n\t\t\t\t\tctx.arc(0, 0, radius, s.startAngle, s.startAngle + s.angle / 2, false);\n\t\t\t\t\tctx.arc(0, 0, radius, s.startAngle + s.angle / 2, s.startAngle + s.angle, false);\n\t\t\t\t\tctx.closePath();\n\t\t\t\t\tx = mouseX - centerLeft;\n\t\t\t\t\ty = mouseY - centerTop;\n\n\t\t\t\t\tif (ctx.isPointInPath) {\n\t\t\t\t\t\tif (ctx.isPointInPath(mouseX - centerLeft, mouseY - centerTop)) {\n\t\t\t\t\t\t\tctx.restore();\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tdatapoint: [s.percent, s.data],\n\t\t\t\t\t\t\t\tdataIndex: 0,\n\t\t\t\t\t\t\t\tseries: s,\n\t\t\t\t\t\t\t\tseriesIndex: i\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// excanvas for IE doesn;t support isPointInPath, this is a workaround.\n\n\t\t\t\t\t\tvar p1X = radius * Math.cos(s.startAngle),\n\t\t\t\t\t\t\tp1Y = radius * Math.sin(s.startAngle),\n\t\t\t\t\t\t\tp2X = radius * Math.cos(s.startAngle + s.angle / 4),\n\t\t\t\t\t\t\tp2Y = radius * Math.sin(s.startAngle + s.angle / 4),\n\t\t\t\t\t\t\tp3X = radius * Math.cos(s.startAngle + s.angle / 2),\n\t\t\t\t\t\t\tp3Y = radius * Math.sin(s.startAngle + s.angle / 2),\n\t\t\t\t\t\t\tp4X = radius * Math.cos(s.startAngle + s.angle / 1.5),\n\t\t\t\t\t\t\tp4Y = radius * Math.sin(s.startAngle + s.angle / 1.5),\n\t\t\t\t\t\t\tp5X = radius * Math.cos(s.startAngle + s.angle),\n\t\t\t\t\t\t\tp5Y = radius * Math.sin(s.startAngle + s.angle),\n\t\t\t\t\t\t\tarrPoly = [[0, 0], [p1X, p1Y], [p2X, p2Y], [p3X, p3Y], [p4X, p4Y], [p5X, p5Y]],\n\t\t\t\t\t\t\tarrPoint = [x, y];\n\n\t\t\t\t\t\t// TODO: perhaps do some mathmatical trickery here with the Y-coordinate to compensate for pie tilt?\n\n\t\t\t\t\t\tif (isPointInPoly(arrPoly, arrPoint)) {\n\t\t\t\t\t\t\tctx.restore();\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tdatapoint: [s.percent, s.data],\n\t\t\t\t\t\t\t\tdataIndex: 0,\n\t\t\t\t\t\t\t\tseries: s,\n\t\t\t\t\t\t\t\tseriesIndex: i\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tctx.restore();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tfunction onMouseMove(e) {\n\t\t\ttriggerClickHoverEvent(\"plothover\", e);\n\t\t}\n\n\t\tfunction onClick(e) {\n\t\t\ttriggerClickHoverEvent(\"plotclick\", e);\n\t\t}\n\n\t\t// trigger click or hover event (they send the same parameters so we share their code)\n\n\t\tfunction triggerClickHoverEvent(eventname, e) {\n\n\t\t\tvar offset = plot.offset();\n\t\t\tvar canvasX = parseInt(e.pageX - offset.left);\n\t\t\tvar canvasY = parseInt(e.pageY - offset.top);\n\t\t\tvar item = findNearbySlice(canvasX, canvasY);\n\n\t\t\tif (options.grid.autoHighlight) {\n\n\t\t\t\t// clear auto-highlights\n\n\t\t\t\tfor (var i = 0; i < highlights.length; ++i) {\n\t\t\t\t\tvar h = highlights[i];\n\t\t\t\t\tif (h.auto == eventname && !(item && h.series == item.series)) {\n\t\t\t\t\t\tunhighlight(h.series);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// highlight the slice\n\n\t\t\tif (item) {\n\t\t\t\thighlight(item.series, eventname);\n\t\t\t}\n\n\t\t\t// trigger any hover bind events\n\n\t\t\tvar pos = { pageX: e.pageX, pageY: e.pageY };\n\t\t\ttarget.trigger(eventname, [pos, item]);\n\t\t}\n\n\t\tfunction highlight(s, auto) {\n\t\t\t//if (typeof s == \"number\") {\n\t\t\t//\ts = series[s];\n\t\t\t//}\n\n\t\t\tvar i = indexOfHighlight(s);\n\n\t\t\tif (i == -1) {\n\t\t\t\thighlights.push({ series: s, auto: auto });\n\t\t\t\tplot.triggerRedrawOverlay();\n\t\t\t} else if (!auto) {\n\t\t\t\thighlights[i].auto = false;\n\t\t\t}\n\t\t}\n\n\t\tfunction unhighlight(s) {\n\t\t\tif (s == null) {\n\t\t\t\thighlights = [];\n\t\t\t\tplot.triggerRedrawOverlay();\n\t\t\t}\n\n\t\t\t//if (typeof s == \"number\") {\n\t\t\t//\ts = series[s];\n\t\t\t//}\n\n\t\t\tvar i = indexOfHighlight(s);\n\n\t\t\tif (i != -1) {\n\t\t\t\thighlights.splice(i, 1);\n\t\t\t\tplot.triggerRedrawOverlay();\n\t\t\t}\n\t\t}\n\n\t\tfunction indexOfHighlight(s) {\n\t\t\tfor (var i = 0; i < highlights.length; ++i) {\n\t\t\t\tvar h = highlights[i];\n\t\t\t\tif (h.series == s)\n\t\t\t\t\treturn i;\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\tfunction drawOverlay(plot, octx) {\n\n\t\t\tvar options = plot.getOptions();\n\n\t\t\tvar radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;\n\n\t\t\toctx.save();\n\t\t\toctx.translate(centerLeft, centerTop);\n\t\t\toctx.scale(1, options.series.pie.tilt);\n\n\t\t\tfor (var i = 0; i < highlights.length; ++i) {\n\t\t\t\tdrawHighlight(highlights[i].series);\n\t\t\t}\n\n\t\t\tdrawDonutHole(octx);\n\n\t\t\toctx.restore();\n\n\t\t\tfunction drawHighlight(series) {\n\n\t\t\t\tif (series.angle <= 0 || isNaN(series.angle)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//octx.fillStyle = parseColor(options.series.pie.highlight.color).scale(null, null, null, options.series.pie.highlight.opacity).toString();\n\t\t\t\toctx.fillStyle = \"rgba(255, 255, 255, \" + options.series.pie.highlight.opacity + \")\"; // this is temporary until we have access to parseColor\n\t\t\t\toctx.beginPath();\n\t\t\t\tif (Math.abs(series.angle - Math.PI * 2) > 0.000000001) {\n\t\t\t\t\toctx.moveTo(0, 0); // Center of the pie\n\t\t\t\t}\n\t\t\t\toctx.arc(0, 0, radius, series.startAngle, series.startAngle + series.angle / 2, false);\n\t\t\t\toctx.arc(0, 0, radius, series.startAngle + series.angle / 2, series.startAngle + series.angle, false);\n\t\t\t\toctx.closePath();\n\t\t\t\toctx.fill();\n\t\t\t}\n\t\t}\n\t} // end init (plugin body)\n\n\t// define pie specific options and their default values\n\n\tvar options = {\n\t\tseries: {\n\t\t\tpie: {\n\t\t\t\tshow: false,\n\t\t\t\tradius: \"auto\",\t// actual radius of the visible pie (based on full calculated radius if <=1, or hard pixel value)\n\t\t\t\tinnerRadius: 0, /* for donut */\n\t\t\t\tstartAngle: 3/2,\n\t\t\t\ttilt: 1,\n\t\t\t\tshadow: {\n\t\t\t\t\tleft: 5,\t// shadow left offset\n\t\t\t\t\ttop: 15,\t// shadow top offset\n\t\t\t\t\talpha: 0.02\t// shadow alpha\n\t\t\t\t},\n\t\t\t\toffset: {\n\t\t\t\t\ttop: 0,\n\t\t\t\t\tleft: \"auto\"\n\t\t\t\t},\n\t\t\t\tstroke: {\n\t\t\t\t\tcolor: \"#fff\",\n\t\t\t\t\twidth: 1\n\t\t\t\t},\n\t\t\t\tlabel: {\n\t\t\t\t\tshow: \"auto\",\n\t\t\t\t\tformatter: function(label, slice) {\n\t\t\t\t\t\treturn \"
    \" + label + \"
    \" + Math.round(slice.percent) + \"%
    \";\n\t\t\t\t\t},\t// formatter function\n\t\t\t\t\tradius: 1,\t// radius at which to place the labels (based on full calculated radius if <=1, or hard pixel value)\n\t\t\t\t\tbackground: {\n\t\t\t\t\t\tcolor: null,\n\t\t\t\t\t\topacity: 0\n\t\t\t\t\t},\n\t\t\t\t\tthreshold: 0\t// percentage at which to hide the label (i.e. the slice is too narrow)\n\t\t\t\t},\n\t\t\t\tcombine: {\n\t\t\t\t\tthreshold: -1,\t// percentage at which to combine little slices into one larger slice\n\t\t\t\t\tcolor: null,\t// color to give the new slice (auto-generated if null)\n\t\t\t\t\tlabel: \"Other\"\t// label to give the new slice\n\t\t\t\t},\n\t\t\t\thighlight: {\n\t\t\t\t\t//color: \"#fff\",\t\t// will add this functionality once parseColor is available\n\t\t\t\t\topacity: 0.5\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t$.plot.plugins.push({\n\t\tinit: init,\n\t\toptions: options,\n\t\tname: \"pie\",\n\t\tversion: \"1.1\"\n\t});\n\n})(jQuery);\n\n\n/***/ }),\n\n/***/ 2197:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ \npluginDirectiveLoader.$inject = [\"$compile\", \"datasourceSrv\", \"$rootScope\", \"$q\", \"$http\", \"$templateCache\"];var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_config__ = __webpack_require__(23);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_app_core_core_module__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__plugin_loader__ = __webpack_require__(1990);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_app_plugins_panel_unknown_module__ = __webpack_require__(2198);\n\n\n\n\n\n\n/** @ngInject **/\nfunction pluginDirectiveLoader($compile, datasourceSrv, $rootScope, $q, $http, $templateCache) {\n function getTemplate(component) {\n if (component.template) {\n return $q.when(component.template);\n }\n var cached = $templateCache.get(component.templateUrl);\n if (cached) {\n return $q.when(cached);\n }\n return $http.get(component.templateUrl).then(function (res) {\n return res.data;\n });\n }\n function relativeTemplateUrlToAbs(templateUrl, baseUrl) {\n if (!templateUrl) {\n return undefined;\n }\n if (templateUrl.indexOf('public') === 0) {\n return templateUrl;\n }\n return baseUrl + '/' + templateUrl;\n }\n function getPluginComponentDirective(options) {\n // handle relative template urls for plugin templates\n options.Component.templateUrl = relativeTemplateUrlToAbs(options.Component.templateUrl, options.baseUrl);\n return function () {\n return {\n templateUrl: options.Component.templateUrl,\n template: options.Component.template,\n restrict: 'E',\n controller: options.Component,\n controllerAs: 'ctrl',\n bindToController: true,\n scope: options.bindings,\n link: function (scope, elem, attrs, ctrl) {\n if (ctrl.link) {\n ctrl.link(scope, elem, attrs, ctrl);\n }\n if (ctrl.init) {\n ctrl.init();\n }\n },\n };\n };\n }\n function loadPanelComponentInfo(scope, attrs) {\n var componentInfo = {\n name: 'panel-plugin-' + scope.panel.type,\n bindings: { dashboard: '=', panel: '=', row: '=' },\n attrs: {\n dashboard: 'dashboard',\n panel: 'panel',\n class: 'panel-height-helper',\n },\n };\n var panelInfo = __WEBPACK_IMPORTED_MODULE_2_app_core_config__[\"a\" /* default */].panels[scope.panel.type];\n var panelCtrlPromise = Promise.resolve(__WEBPACK_IMPORTED_MODULE_5_app_plugins_panel_unknown_module__[\"a\" /* UnknownPanelCtrl */]);\n if (panelInfo) {\n panelCtrlPromise = Object(__WEBPACK_IMPORTED_MODULE_4__plugin_loader__[\"a\" /* importPluginModule */])(panelInfo.module).then(function (panelModule) {\n return panelModule.PanelCtrl;\n });\n }\n return panelCtrlPromise.then(function (PanelCtrl) {\n componentInfo.Component = PanelCtrl;\n if (!PanelCtrl || PanelCtrl.registeredAs === componentInfo.name) {\n return componentInfo;\n }\n if (PanelCtrl.templatePromise) {\n return PanelCtrl.templatePromise.then(function (res) {\n return componentInfo;\n });\n }\n if (panelInfo) {\n PanelCtrl.templateUrl = relativeTemplateUrlToAbs(PanelCtrl.templateUrl, panelInfo.baseUrl);\n }\n PanelCtrl.templatePromise = getTemplate(PanelCtrl).then(function (template) {\n PanelCtrl.templateUrl = null;\n PanelCtrl.template = \"\" + template + \"\";\n return componentInfo;\n });\n return PanelCtrl.templatePromise;\n });\n }\n function getModule(scope, attrs) {\n switch (attrs.type) {\n // QueryCtrl\n case 'query-ctrl': {\n var datasource = scope.target.datasource || scope.ctrl.panel.datasource;\n return datasourceSrv.get(datasource).then(function (ds) {\n scope.datasource = ds;\n return Object(__WEBPACK_IMPORTED_MODULE_4__plugin_loader__[\"a\" /* importPluginModule */])(ds.meta.module).then(function (dsModule) {\n return {\n baseUrl: ds.meta.baseUrl,\n name: 'query-ctrl-' + ds.meta.id,\n bindings: { target: '=', panelCtrl: '=', datasource: '=' },\n attrs: {\n target: 'target',\n 'panel-ctrl': 'ctrl.panelCtrl',\n datasource: 'datasource',\n },\n Component: dsModule.QueryCtrl,\n };\n });\n });\n }\n // Annotations\n case 'annotations-query-ctrl': {\n return Object(__WEBPACK_IMPORTED_MODULE_4__plugin_loader__[\"a\" /* importPluginModule */])(scope.ctrl.currentDatasource.meta.module).then(function (dsModule) {\n return {\n baseUrl: scope.ctrl.currentDatasource.meta.baseUrl,\n name: 'annotations-query-ctrl-' + scope.ctrl.currentDatasource.meta.id,\n bindings: { annotation: '=', datasource: '=' },\n attrs: {\n annotation: 'ctrl.currentAnnotation',\n datasource: 'ctrl.currentDatasource',\n },\n Component: dsModule.AnnotationsQueryCtrl,\n };\n });\n }\n // Datasource ConfigCtrl\n case 'datasource-config-ctrl': {\n var dsMeta = scope.ctrl.datasourceMeta;\n return Object(__WEBPACK_IMPORTED_MODULE_4__plugin_loader__[\"a\" /* importPluginModule */])(dsMeta.module).then(function (dsModule) {\n if (!dsModule.ConfigCtrl) {\n return { notFound: true };\n }\n return {\n baseUrl: dsMeta.baseUrl,\n name: 'ds-config-' + dsMeta.id,\n bindings: { meta: '=', current: '=' },\n attrs: { meta: 'ctrl.datasourceMeta', current: 'ctrl.current' },\n Component: dsModule.ConfigCtrl,\n };\n });\n }\n // AppConfigCtrl\n case 'app-config-ctrl': {\n var model_1 = scope.ctrl.model;\n return Object(__WEBPACK_IMPORTED_MODULE_4__plugin_loader__[\"a\" /* importPluginModule */])(model_1.module).then(function (appModule) {\n return {\n baseUrl: model_1.baseUrl,\n name: 'app-config-' + model_1.id,\n bindings: { appModel: '=', appEditCtrl: '=' },\n attrs: { 'app-model': 'ctrl.model', 'app-edit-ctrl': 'ctrl' },\n Component: appModule.ConfigCtrl,\n };\n });\n }\n // App Page\n case 'app-page': {\n var appModel_1 = scope.ctrl.appModel;\n return Object(__WEBPACK_IMPORTED_MODULE_4__plugin_loader__[\"a\" /* importPluginModule */])(appModel_1.module).then(function (appModule) {\n return {\n baseUrl: appModel_1.baseUrl,\n name: 'app-page-' + appModel_1.id + '-' + scope.ctrl.page.slug,\n bindings: { appModel: '=' },\n attrs: { 'app-model': 'ctrl.appModel' },\n Component: appModule[scope.ctrl.page.component],\n };\n });\n }\n // Panel\n case 'panel': {\n return loadPanelComponentInfo(scope, attrs);\n }\n default: {\n return $q.reject({\n message: 'Could not find component type: ' + attrs.type,\n });\n }\n }\n }\n function appendAndCompile(scope, elem, componentInfo) {\n var child = __WEBPACK_IMPORTED_MODULE_0_angular___default.a.element(document.createElement(componentInfo.name));\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(componentInfo.attrs, function (value, key) {\n child.attr(key, value);\n });\n $compile(child)(scope);\n elem.empty();\n // let a binding digest cycle complete before adding to dom\n setTimeout(function () {\n elem.append(child);\n scope.$applyAsync(function () {\n scope.$broadcast('component-did-mount');\n scope.$broadcast('refresh');\n });\n });\n }\n function registerPluginComponent(scope, elem, attrs, componentInfo) {\n if (componentInfo.notFound) {\n elem.empty();\n return;\n }\n if (!componentInfo.Component) {\n throw {\n message: 'Failed to find exported plugin component for ' + componentInfo.name,\n };\n }\n if (componentInfo.Component.registeredAs !== componentInfo.name) {\n var directiveName = attrs.$normalize(componentInfo.name);\n var directiveFn = getPluginComponentDirective(componentInfo);\n __WEBPACK_IMPORTED_MODULE_3_app_core_core_module__[\"a\" /* default */].directive(directiveName, directiveFn);\n componentInfo.Component.registeredAs = componentInfo.name;\n }\n appendAndCompile(scope, elem, componentInfo);\n }\n return {\n restrict: 'E',\n link: function (scope, elem, attrs) {\n getModule(scope, attrs)\n .then(function (componentInfo) {\n registerPluginComponent(scope, elem, attrs, componentInfo);\n })\n .catch(function (err) {\n $rootScope.appEvent('alert-error', ['Plugin Error', err.message || err]);\n console.log('Plugin component error', err);\n });\n },\n };\n}\n__WEBPACK_IMPORTED_MODULE_3_app_core_core_module__[\"a\" /* default */].directive('pluginComponent', pluginDirectiveLoader);\n\n\n/***/ }),\n\n/***/ 2198:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return UnknownPanelCtrl; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_features_panel_panel_ctrl__ = __webpack_require__(1986);\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n }\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\nvar UnknownPanelCtrl = /** @class */ (function (_super) {\n __extends(UnknownPanelCtrl, _super);\n /** @ngInject */\n UnknownPanelCtrl.$inject = [\"$scope\", \"$injector\"];\n function UnknownPanelCtrl($scope, $injector) {\n return _super.call(this, $scope, $injector) || this;\n }\n UnknownPanelCtrl.templateUrl = 'public/app/plugins/panel/unknown/module.html';\n return UnknownPanelCtrl;\n}(__WEBPACK_IMPORTED_MODULE_0_app_features_panel_panel_ctrl__[\"a\" /* PanelCtrl */]));\n\n\n\n/***/ }),\n\n/***/ 2199:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__dashboard_ctrl__ = __webpack_require__(2200);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__alerting_srv__ = __webpack_require__(2201);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__history_history__ = __webpack_require__(2202);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__dashboard_loader_srv__ = __webpack_require__(2204);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__dashnav_dashnav__ = __webpack_require__(2205);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__submenu_submenu__ = __webpack_require__(2206);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__save_as_modal__ = __webpack_require__(2207);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__save_modal__ = __webpack_require__(2208);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__save_provisioned_modal__ = __webpack_require__(2209);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__shareModalCtrl__ = __webpack_require__(2210);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__share_snapshot_ctrl__ = __webpack_require__(2211);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__dashboard_srv__ = __webpack_require__(2212);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__view_state_srv__ = __webpack_require__(2213);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__validation_srv__ = __webpack_require__(2214);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__time_srv__ = __webpack_require__(2215);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__unsaved_changes_srv__ = __webpack_require__(2216);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__unsaved_changes_modal__ = __webpack_require__(2218);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__timepicker_timepicker__ = __webpack_require__(2219);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__upload__ = __webpack_require__(2221);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__export_export_modal__ = __webpack_require__(2222);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__export_data_export_data_modal__ = __webpack_require__(2224);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__export_experiment_export_experiment_modal__ = __webpack_require__(2225);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__ad_hoc_filters__ = __webpack_require__(2226);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__repeat_option_repeat_option__ = __webpack_require__(2227);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__dashgrid_DashboardGridDirective__ = __webpack_require__(2228);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__dashgrid_PanelLoader__ = __webpack_require__(2234);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__dashgrid_RowOptions__ = __webpack_require__(2235);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__folder_picker_folder_picker__ = __webpack_require__(2236);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__move_to_folder_modal_move_to_folder__ = __webpack_require__(2237);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__settings_settings__ = __webpack_require__(2238);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30_app_core_core_module__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__dashboard_list_ctrl__ = __webpack_require__(2239);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__folder_dashboards_ctrl__ = __webpack_require__(2240);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__folder_settings_ctrl__ = __webpack_require__(2241);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__dashboard_import_ctrl__ = __webpack_require__(2242);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__create_folder_ctrl__ = __webpack_require__(2243);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n__WEBPACK_IMPORTED_MODULE_30_app_core_core_module__[\"a\" /* default */].controller('DashboardListCtrl', __WEBPACK_IMPORTED_MODULE_31__dashboard_list_ctrl__[\"a\" /* DashboardListCtrl */]);\n__WEBPACK_IMPORTED_MODULE_30_app_core_core_module__[\"a\" /* default */].controller('FolderDashboardsCtrl', __WEBPACK_IMPORTED_MODULE_32__folder_dashboards_ctrl__[\"a\" /* FolderDashboardsCtrl */]);\n__WEBPACK_IMPORTED_MODULE_30_app_core_core_module__[\"a\" /* default */].controller('FolderSettingsCtrl', __WEBPACK_IMPORTED_MODULE_33__folder_settings_ctrl__[\"a\" /* FolderSettingsCtrl */]);\n__WEBPACK_IMPORTED_MODULE_30_app_core_core_module__[\"a\" /* default */].controller('DashboardImportCtrl', __WEBPACK_IMPORTED_MODULE_34__dashboard_import_ctrl__[\"a\" /* DashboardImportCtrl */]);\n__WEBPACK_IMPORTED_MODULE_30_app_core_core_module__[\"a\" /* default */].controller('CreateFolderCtrl', __WEBPACK_IMPORTED_MODULE_35__create_folder_ctrl__[\"a\" /* CreateFolderCtrl */]);\n\n\n/***/ }),\n\n/***/ 2200:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export DashboardCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_core_module__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_core__ = __webpack_require__(197);\n\n\nvar DashboardCtrl = /** @class */ (function () {\n /** @ngInject */\n DashboardCtrl.$inject = [\"$scope\", \"$rootScope\", \"keybindingSrv\", \"timeSrv\", \"variableSrv\", \"alertSrv\", \"alertingSrv\", \"dashboardSrv\", \"unsavedChangesSrv\", \"dashboardViewStateSrv\", \"playlistSrv\", \"panelLoader\", \"experimentSrv\", \"sensorSrv\", \"$q\", \"$routeParams\", \"$location\"];\n function DashboardCtrl($scope, $rootScope, keybindingSrv, timeSrv, variableSrv, alertSrv, alertingSrv, dashboardSrv, unsavedChangesSrv, dashboardViewStateSrv, playlistSrv, panelLoader, experimentSrv, sensorSrv, $q, $routeParams, $location) {\n this.$scope = $scope;\n this.$rootScope = $rootScope;\n this.keybindingSrv = keybindingSrv;\n this.timeSrv = timeSrv;\n this.variableSrv = variableSrv;\n this.alertSrv = alertSrv;\n this.alertingSrv = alertingSrv;\n this.dashboardSrv = dashboardSrv;\n this.unsavedChangesSrv = unsavedChangesSrv;\n this.dashboardViewStateSrv = dashboardViewStateSrv;\n this.playlistSrv = playlistSrv;\n this.panelLoader = panelLoader;\n this.experimentSrv = experimentSrv;\n this.sensorSrv = sensorSrv;\n this.$q = $q;\n this.$routeParams = $routeParams;\n // temp hack due to way dashboards are loaded\n // can't use controllerAs on route yet\n $scope.ctrl = this;\n // TODO: break out settings view to separate view & controller\n this.editTab = 0;\n // funcs called from React component bindings and needs this binding\n this.getPanelContainer = this.getPanelContainer.bind(this);\n this.isHome = $location.path() === '/';\n }\n DashboardCtrl.prototype.setupDashboard = function (data) {\n var _this = this;\n try {\n if (this.$routeParams.experimentId) {\n this.experimentSrv.get(this.$routeParams.experimentId).then(function (exp) {\n _this.experiment = exp;\n _this.setupDashboardInternal(data);\n }, function (err) {\n console.log('Experiment missing (id: ' + _this.$routeParams.experimentId + ')');\n _this.alertSrv.set('This experiment was not found!', null, 'warning', 10000);\n err.isHandled = true;\n });\n }\n else {\n if (data.meta && data.meta.isSnapshot) {\n this.experiment = data.dashboard.experiment;\n }\n this.setupDashboardInternal(data);\n }\n }\n catch (err) {\n this.onInitFailed(err, 'Dashboard init failed', true);\n }\n };\n DashboardCtrl.prototype.setupDashboardInternal = function (data) {\n var _this = this;\n var dashboard = this.dashboardSrv.create(data.dashboard, data.meta);\n this.dashboardSrv.setCurrent(dashboard);\n // init services\n this.timeSrv.init(dashboard, this.experiment);\n this.alertingSrv.init(dashboard, data.alerts);\n // template values service needs to initialize completely before\n // the rest of the dashboard can load\n this.$q\n .all(this.variableSrv.init(dashboard))\n .catch(this.onInitFailed.bind(this, 'Dashboard init failed', false))\n // continue\n .finally(function () {\n if (!dashboard.meta.isSnapshot) {\n // Sensor service preloads the sensor meta so that panels can\n // generate influx queries and titles\n _this.sensorSrv.init().then(function () {\n _this.finishSetupDashboardInternal(dashboard, data);\n });\n }\n else {\n _this.finishSetupDashboardInternal(dashboard, data);\n }\n })\n .catch(this.onInitFailed.bind(this, 'Dashboard init failed', true));\n };\n DashboardCtrl.prototype.finishSetupDashboardInternal = function (dashboard, data) {\n this.dashboard = dashboard;\n this.dashboard.processRepeats();\n this.unsavedChangesSrv.init(dashboard, this.$scope);\n // TODO refactor ViewStateSrv\n this.$scope.dashboard = dashboard;\n this.dashboardViewState = this.dashboardViewStateSrv.create(this.$scope);\n this.keybindingSrv.setupDashboardBindings(this.$scope, dashboard);\n this.dashboard.updateSubmenuVisibility();\n this.setWindowTitleAndTheme();\n this.$scope.appEvent('dashboard-initialized', dashboard);\n };\n DashboardCtrl.prototype.onInitFailed = function (msg, fatal, err) {\n console.log(msg, err);\n if (err.data && err.data.message) {\n err.message = err.data.message;\n }\n else if (!err.message) {\n err = { message: err.toString() };\n }\n this.$scope.appEvent('alert-error', [msg, err.message]);\n // protect against recursive fallbacks\n if (fatal && !this.loadedFallbackDashboard) {\n this.loadedFallbackDashboard = true;\n this.setupDashboard({ dashboard: { title: 'Dashboard Init failed' } });\n }\n };\n DashboardCtrl.prototype.templateVariableUpdated = function () {\n this.dashboard.processRepeats();\n };\n DashboardCtrl.prototype.setWindowTitleAndTheme = function () {\n window.document.title = this.dashboard.title + ' - CURVE';\n };\n DashboardCtrl.prototype.showJsonEditor = function (evt, options) {\n var editScope = this.$rootScope.$new();\n editScope.object = options.object;\n editScope.updateHandler = options.updateHandler;\n this.$scope.appEvent('show-dash-editor', {\n src: 'public/app/partials/edit_json.html',\n scope: editScope,\n });\n };\n DashboardCtrl.prototype.getDashboard = function () {\n return this.dashboard;\n };\n DashboardCtrl.prototype.getPanelLoader = function () {\n return this.panelLoader;\n };\n DashboardCtrl.prototype.timezoneChanged = function () {\n this.$rootScope.$broadcast('refresh');\n };\n DashboardCtrl.prototype.getPanelContainer = function () {\n return this;\n };\n DashboardCtrl.prototype.onRemovingPanel = function (evt, options) {\n options = options || {};\n if (!options.panelId) {\n return;\n }\n var panelInfo = this.dashboard.getPanelInfoById(options.panelId);\n this.removePanel(panelInfo.panel, true);\n };\n DashboardCtrl.prototype.removePanel = function (panel, ask) {\n var _this = this;\n // confirm deletion\n if (ask !== false) {\n var text2, confirmText;\n if (panel.alert) {\n text2 = 'Panel includes an alert rule, removing panel will also remove alert rule';\n confirmText = 'YES';\n }\n this.$scope.appEvent('confirm-modal', {\n title: 'Remove Panel',\n text: 'Are you sure you want to remove this panel?',\n text2: text2,\n icon: 'fa-trash',\n confirmText: confirmText,\n yesText: 'Remove',\n onConfirm: function () {\n _this.removePanel(panel, false);\n },\n });\n return;\n }\n this.dashboard.removePanel(panel);\n };\n // $data contains a sensor attribute, and optionally a experiment attribute\n // if it was dragged from a specific experiment (not \"current experiment\")\n DashboardCtrl.prototype.onDrop = function ($data) {\n if ($data.meta) {\n this.dashboard.addExperimentMetaPanel();\n }\n else if ($data.video) {\n this.dashboard.addVideoPanel();\n }\n else {\n this.dashboard.addSensorPanel($data.sensor.shortName, $data.experiment.id);\n }\n };\n DashboardCtrl.prototype.init = function (dashboard) {\n this.$scope.onAppEvent('show-json-editor', this.showJsonEditor.bind(this));\n this.$scope.onAppEvent('template-variable-value-updated', this.templateVariableUpdated.bind(this));\n this.$scope.onAppEvent('panel-remove', this.onRemovingPanel.bind(this));\n this.setupDashboard(dashboard);\n };\n DashboardCtrl.prototype.onScroll = function () {\n __WEBPACK_IMPORTED_MODULE_1_app_core_core__[\"b\" /* appEvents */].emit('graph-hover-clear');\n };\n return DashboardCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_app_core_core_module__[\"a\" /* default */].controller('DashboardCtrl', DashboardCtrl);\n__WEBPACK_IMPORTED_MODULE_0_app_core_core_module__[\"a\" /* default */].directive('scroll', [\n function () {\n return {\n scope: { ngScroll: '=' },\n link: function (scope, elem, attrs) {\n elem.on('scroll', scope.ngScroll);\n },\n };\n },\n]);\n\n\n/***/ }),\n\n/***/ 2201:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export AlertingSrv */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_core_module__ = __webpack_require__(2);\n\nvar AlertingSrv = /** @class */ (function () {\n function AlertingSrv() {\n }\n AlertingSrv.prototype.init = function (dashboard, alerts) {\n this.dashboard = dashboard;\n this.alerts = alerts || [];\n };\n return AlertingSrv;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_app_core_core_module__[\"a\" /* default */].service('alertingSrv', AlertingSrv);\n\n\n/***/ }),\n\n/***/ 2202:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export HistoryListCtrl */\n/* unused harmony export dashboardHistoryDirective */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__history_srv__ = __webpack_require__(2203);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_moment__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_moment__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_app_core_utils_location_util__ = __webpack_require__(198);\n\n\n\n\n\nvar HistoryListCtrl = /** @class */ (function () {\n /** @ngInject */\n HistoryListCtrl.$inject = [\"$route\", \"$rootScope\", \"$location\", \"$q\", \"historySrv\", \"$scope\"];\n function HistoryListCtrl($route, $rootScope, $location, $q, historySrv, $scope) {\n this.$route = $route;\n this.$rootScope = $rootScope;\n this.$location = $location;\n this.$q = $q;\n this.historySrv = historySrv;\n this.$scope = $scope;\n this.appending = false;\n this.diff = 'basic';\n this.limit = 10;\n this.loading = false;\n this.max = 2;\n this.mode = 'list';\n this.start = 0;\n this.canCompare = false;\n this.$rootScope.onAppEvent('dashboard-saved', this.onDashboardSaved.bind(this), $scope);\n this.resetFromSource();\n }\n HistoryListCtrl.prototype.onDashboardSaved = function () {\n this.resetFromSource();\n };\n HistoryListCtrl.prototype.switchMode = function (mode) {\n this.mode = mode;\n if (this.mode === 'list') {\n this.reset();\n }\n };\n HistoryListCtrl.prototype.dismiss = function () {\n this.$rootScope.appEvent('hide-dash-editor');\n };\n HistoryListCtrl.prototype.addToLog = function () {\n this.start = this.start + this.limit;\n this.getLog(true);\n };\n HistoryListCtrl.prototype.revisionSelectionChanged = function () {\n var selected = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.filter(this.revisions, { checked: true }).length;\n this.canCompare = selected === 2;\n };\n HistoryListCtrl.prototype.formatDate = function (date) {\n return this.dashboard.formatDate(date);\n };\n HistoryListCtrl.prototype.formatBasicDate = function (date) {\n var now = this.dashboard.timezone === 'browser' ? __WEBPACK_IMPORTED_MODULE_3_moment___default()() : __WEBPACK_IMPORTED_MODULE_3_moment___default.a.utc();\n var then = this.dashboard.timezone === 'browser' ? __WEBPACK_IMPORTED_MODULE_3_moment___default()(date) : __WEBPACK_IMPORTED_MODULE_3_moment___default.a.utc(date);\n return then.from(now);\n };\n HistoryListCtrl.prototype.getDiff = function (diff) {\n var _this = this;\n this.diff = diff;\n this.mode = 'compare';\n // have it already been fetched?\n if (this.delta[this.diff]) {\n return this.$q.when(this.delta[this.diff]);\n }\n var selected = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.filter(this.revisions, { checked: true });\n this.newInfo = selected[0];\n this.baseInfo = selected[1];\n this.isNewLatest = this.newInfo.version === this.dashboard.version;\n this.loading = true;\n var options = {\n new: {\n dashboardId: this.dashboard.id,\n version: this.newInfo.version,\n },\n base: {\n dashboardId: this.dashboard.id,\n version: this.baseInfo.version,\n },\n diffType: diff,\n };\n return this.historySrv\n .calculateDiff(options)\n .then(function (response) {\n _this.delta[_this.diff] = response;\n })\n .catch(function () {\n _this.mode = 'list';\n })\n .finally(function () {\n _this.loading = false;\n });\n };\n HistoryListCtrl.prototype.getLog = function (append) {\n var _this = this;\n if (append === void 0) { append = false; }\n this.loading = !append;\n this.appending = append;\n var options = {\n limit: this.limit,\n start: this.start,\n };\n return this.historySrv\n .getHistoryList(this.dashboard, options)\n .then(function (revisions) {\n // set formatted dates & default values\n for (var _i = 0, revisions_1 = revisions; _i < revisions_1.length; _i++) {\n var rev = revisions_1[_i];\n rev.createdDateString = _this.formatDate(rev.created);\n rev.ageString = _this.formatBasicDate(rev.created);\n rev.checked = false;\n }\n _this.revisions = append ? _this.revisions.concat(revisions) : revisions;\n })\n .catch(function (err) {\n _this.loading = false;\n })\n .finally(function () {\n _this.loading = false;\n _this.appending = false;\n });\n };\n HistoryListCtrl.prototype.isLastPage = function () {\n return __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find(this.revisions, function (rev) { return rev.version === 1; });\n };\n HistoryListCtrl.prototype.reset = function () {\n this.delta = { basic: '', json: '' };\n this.diff = 'basic';\n this.mode = 'list';\n this.revisions = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(this.revisions, function (rev) { return __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.extend({}, rev, { checked: false }); });\n this.canCompare = false;\n this.start = 0;\n this.isNewLatest = false;\n };\n HistoryListCtrl.prototype.resetFromSource = function () {\n this.revisions = [];\n return this.getLog().then(this.reset.bind(this));\n };\n HistoryListCtrl.prototype.restore = function (version) {\n this.$rootScope.appEvent('confirm-modal', {\n title: 'Restore version',\n text: '',\n text2: \"Are you sure you want to restore the dashboard to version \" + version + \"? All unsaved changes will be lost.\",\n icon: 'fa-history',\n yesText: \"Yes, restore to version \" + version,\n onConfirm: this.restoreConfirm.bind(this, version),\n });\n };\n HistoryListCtrl.prototype.restoreConfirm = function (version) {\n var _this = this;\n this.loading = true;\n return this.historySrv\n .restoreDashboard(this.dashboard, version)\n .then(function (response) {\n _this.$location.url(__WEBPACK_IMPORTED_MODULE_4_app_core_utils_location_util__[\"b\" /* default */].stripBaseFromUrl(response.url)).replace();\n _this.$route.reload();\n _this.$rootScope.appEvent('alert-success', ['Dashboard restored', 'Restored from version ' + version]);\n })\n .catch(function () {\n _this.mode = 'list';\n _this.loading = false;\n });\n };\n return HistoryListCtrl;\n}());\n\nfunction dashboardHistoryDirective() {\n return {\n restrict: 'E',\n templateUrl: 'public/app/features/dashboard/history/history.html',\n controller: HistoryListCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: {\n dashboard: '=',\n },\n };\n}\n__WEBPACK_IMPORTED_MODULE_2_angular___default.a.module('grafana.directives').directive('gfDashboardHistory', dashboardHistoryDirective);\n\n\n/***/ }),\n\n/***/ 2203:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export HistorySrv */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_core_module__ = __webpack_require__(2);\n\n\nvar HistorySrv = /** @class */ (function () {\n /** @ngInject */\n HistorySrv.$inject = [\"backendSrv\", \"$q\"];\n function HistorySrv(backendSrv, $q) {\n this.backendSrv = backendSrv;\n this.$q = $q;\n }\n HistorySrv.prototype.getHistoryList = function (dashboard, options) {\n var id = dashboard && dashboard.id ? dashboard.id : void 0;\n return id ? this.backendSrv.get(\"api/dashboards/id/\" + id + \"/versions\", options) : this.$q.when([]);\n };\n HistorySrv.prototype.calculateDiff = function (options) {\n return this.backendSrv.post('api/dashboards/calculate-diff', options);\n };\n HistorySrv.prototype.restoreDashboard = function (dashboard, version) {\n var id = dashboard && dashboard.id ? dashboard.id : void 0;\n var url = \"api/dashboards/id/\" + id + \"/restore\";\n return id && __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isNumber(version) ? this.backendSrv.post(url, { version: version }) : this.$q.when({});\n };\n return HistorySrv;\n}());\n\n__WEBPACK_IMPORTED_MODULE_1_app_core_core_module__[\"a\" /* default */].service('historySrv', HistorySrv);\n\n\n/***/ }),\n\n/***/ 2204:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export DashboardLoaderSrv */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_moment__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_moment__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_jquery__ = __webpack_require__(17);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_jquery___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_jquery__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_app_core_utils_kbn__ = __webpack_require__(312);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_app_core_utils_datemath__ = __webpack_require__(691);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_app_core_services_impression_srv__ = __webpack_require__(200);\n\n\n\n\n\n\n\nvar DashboardLoaderSrv = /** @class */ (function () {\n /** @ngInject */\n DashboardLoaderSrv.$inject = [\"backendSrv\", \"dashboardSrv\", \"datasourceSrv\", \"$http\", \"$q\", \"$timeout\", \"contextSrv\", \"$routeParams\", \"$rootScope\"];\n function DashboardLoaderSrv(backendSrv, dashboardSrv, datasourceSrv, $http, $q, $timeout, contextSrv, $routeParams, $rootScope) {\n this.backendSrv = backendSrv;\n this.dashboardSrv = dashboardSrv;\n this.datasourceSrv = datasourceSrv;\n this.$http = $http;\n this.$q = $q;\n this.$timeout = $timeout;\n this.contextSrv = contextSrv;\n this.$routeParams = $routeParams;\n this.$rootScope = $rootScope;\n }\n DashboardLoaderSrv.prototype._dashboardLoadFailed = function (title, snapshot) {\n snapshot = snapshot || false;\n return {\n meta: {\n canStar: false,\n isSnapshot: snapshot,\n canDelete: false,\n canSave: false,\n canEdit: false,\n dashboardNotFound: true,\n },\n dashboard: { title: title },\n };\n };\n DashboardLoaderSrv.prototype.loadDashboard = function (type, slug, uid) {\n var _this = this;\n var promise;\n if (type === 'script') {\n promise = this._loadScriptedDashboard(slug);\n }\n else if (type === 'snapshot') {\n promise = this.backendSrv.get('/api/snapshots/' + slug).catch(function () {\n return _this._dashboardLoadFailed('Snapshot not found', true);\n });\n }\n else {\n promise = this.backendSrv\n .getDashboardByUid(uid)\n .then(function (result) {\n if (result.meta.isFolder) {\n _this.$rootScope.appEvent('alert-error', ['Dashboard not found']);\n throw new Error('Dashboard not found');\n }\n return result;\n })\n .catch(function (err) {\n err.isHandled = true;\n return _this._dashboardLoadFailed('Not found', true);\n });\n }\n if (this.contextSrv.isSignedIn) {\n promise.then(function (result) {\n if (result.meta.dashboardNotFound !== true) {\n __WEBPACK_IMPORTED_MODULE_6_app_core_services_impression_srv__[\"a\" /* default */].addDashboardImpression(result.dashboard.id, result.meta.url);\n var options = {\n method: 'PUT',\n url: '/api/user/lastdash',\n data: { dashboardId: result.dashboard.id },\n showSuccessAlert: false,\n };\n _this.backendSrv.request(options).catch(function (err) {\n console.log('Error updating dash:', err.message);\n });\n }\n return result;\n });\n }\n return promise;\n };\n DashboardLoaderSrv.prototype._loadScriptedDashboard = function (file) {\n var _this = this;\n var url = 'public/dashboards/' + file.replace(/\\.(?!js)/, '/') + '?' + new Date().getTime();\n return this.$http({ url: url, method: 'GET' })\n .then(this._executeScript.bind(this))\n .then(function (result) {\n return {\n meta: {\n fromScript: true,\n canDelete: false,\n canSave: false,\n canStar: false,\n },\n dashboard: result.data,\n };\n }, function (err) {\n console.log('Script dashboard error ' + err);\n _this.$rootScope.appEvent('alert-error', [\n 'Script Error',\n 'Please make sure it exists and returns a valid dashboard',\n ]);\n return _this._dashboardLoadFailed('Scripted dashboard');\n });\n };\n DashboardLoaderSrv.prototype._executeScript = function (result) {\n var _this = this;\n var services = {\n dashboardSrv: this.dashboardSrv,\n datasourceSrv: this.datasourceSrv,\n $q: this.$q,\n };\n /*jshint -W054 */\n var script_func = new Function('ARGS', 'kbn', 'dateMath', '_', 'moment', 'window', 'document', '$', 'jQuery', 'services', result.data);\n var script_result = script_func(this.$routeParams, __WEBPACK_IMPORTED_MODULE_4_app_core_utils_kbn__[\"a\" /* default */], __WEBPACK_IMPORTED_MODULE_5_app_core_utils_datemath__, __WEBPACK_IMPORTED_MODULE_2_lodash___default.a, __WEBPACK_IMPORTED_MODULE_1_moment___default.a, window, document, __WEBPACK_IMPORTED_MODULE_3_jquery___default.a, __WEBPACK_IMPORTED_MODULE_3_jquery___default.a, services);\n // Handle async dashboard scripts\n if (__WEBPACK_IMPORTED_MODULE_2_lodash___default.a.isFunction(script_result)) {\n var deferred = this.$q.defer();\n script_result(function (dashboard) {\n _this.$timeout(function () {\n deferred.resolve({ data: dashboard });\n });\n });\n return deferred.promise;\n }\n return { data: script_result };\n };\n return DashboardLoaderSrv;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.services').service('dashboardLoaderSrv', DashboardLoaderSrv);\n\n\n/***/ }),\n\n/***/ 2205:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export DashNavCtrl */\n/* unused harmony export dashNavDirective */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_moment__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_moment__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_core__ = __webpack_require__(197);\n\n\n\nvar DashNavCtrl = /** @class */ (function () {\n /** @ngInject */\n DashNavCtrl.$inject = [\"$scope\", \"dashboardSrv\", \"$location\", \"playlistSrv\", \"contextSrv\"];\n function DashNavCtrl($scope, dashboardSrv, $location, playlistSrv, contextSrv) {\n this.$scope = $scope;\n this.dashboardSrv = dashboardSrv;\n this.$location = $location;\n this.playlistSrv = playlistSrv;\n __WEBPACK_IMPORTED_MODULE_2_app_core_core__[\"b\" /* appEvents */].on('save-dashboard', this.saveDashboard.bind(this), $scope);\n this.isSignedIn = contextSrv.isSignedIn;\n if (this.dashboard.meta.isSnapshot) {\n var meta = this.dashboard.meta;\n this.titleTooltip = 'Created:  ' + __WEBPACK_IMPORTED_MODULE_0_moment___default()(meta.created).calendar();\n if (meta.expires) {\n this.titleTooltip += '
    Expires:  ' + __WEBPACK_IMPORTED_MODULE_0_moment___default()(meta.expires).fromNow() + '
    ';\n }\n }\n }\n DashNavCtrl.prototype.toggleSettings = function () {\n var search = this.$location.search();\n if (search.editview) {\n delete search.editview;\n }\n else {\n search.editview = 'settings';\n }\n this.$location.search(search);\n __WEBPACK_IMPORTED_MODULE_2_app_core_core__[\"b\" /* appEvents */].emit('graph-hover-clear');\n };\n DashNavCtrl.prototype.close = function () {\n var search = this.$location.search();\n if (search.editview) {\n delete search.editview;\n }\n else if (search.fullscreen) {\n delete search.fullscreen;\n delete search.edit;\n }\n this.$location.search(search);\n };\n DashNavCtrl.prototype.starDashboard = function () {\n var _this = this;\n this.dashboardSrv.starDashboard(this.dashboard.id, this.dashboard.meta.isStarred).then(function (newState) {\n _this.dashboard.meta.isStarred = newState;\n });\n };\n DashNavCtrl.prototype.shareDashboard = function (tabIndex) {\n var modalScope = this.$scope.$new();\n modalScope.tabIndex = tabIndex;\n modalScope.dashboard = this.dashboard;\n modalScope.experiment = this.experiment;\n __WEBPACK_IMPORTED_MODULE_2_app_core_core__[\"b\" /* appEvents */].emit('show-modal', {\n src: 'public/app/features/dashboard/partials/shareModal.html',\n scope: modalScope,\n });\n };\n DashNavCtrl.prototype.hideTooltip = function (evt) {\n __WEBPACK_IMPORTED_MODULE_1_angular___default.a.element(evt.currentTarget).tooltip('hide');\n };\n DashNavCtrl.prototype.saveDashboard = function () {\n return this.dashboardSrv.saveDashboard();\n };\n DashNavCtrl.prototype.showSearch = function () {\n __WEBPACK_IMPORTED_MODULE_2_app_core_core__[\"b\" /* appEvents */].emit('show-dash-search');\n };\n DashNavCtrl.prototype.addPanel = function () {\n __WEBPACK_IMPORTED_MODULE_2_app_core_core__[\"b\" /* appEvents */].emit('dash-scroll', { animate: true, evt: 0 });\n if (this.dashboard.panels.length > 0 && this.dashboard.panels[0].type === 'add-panel') {\n return; // Return if the \"Add panel\" exists already\n }\n this.dashboard.addPanel({\n type: 'add-panel',\n gridPos: { x: 0, y: 0, w: 12, h: 9 },\n title: 'Panel Title',\n });\n };\n DashNavCtrl.prototype.navItemClicked = function (navItem, evt) {\n if (navItem.clickHandler) {\n navItem.clickHandler();\n evt.preventDefault();\n }\n };\n return DashNavCtrl;\n}());\n\nfunction dashNavDirective() {\n return {\n restrict: 'E',\n templateUrl: 'public/app/features/dashboard/dashnav/dashnav.html',\n controller: DashNavCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n transclude: true,\n scope: { dashboard: '=', experiment: '=' },\n };\n}\n__WEBPACK_IMPORTED_MODULE_1_angular___default.a.module('grafana.directives').directive('dashnav', dashNavDirective);\n\n\n/***/ }),\n\n/***/ 2206:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export SubmenuCtrl */\n/* unused harmony export submenuDirective */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n\n\nvar SubmenuCtrl = /** @class */ (function () {\n /** @ngInject */\n SubmenuCtrl.$inject = [\"$rootScope\", \"variableSrv\", \"$location\"];\n function SubmenuCtrl($rootScope, variableSrv, $location) {\n this.$rootScope = $rootScope;\n this.variableSrv = variableSrv;\n this.$location = $location;\n this.annotations = this.dashboard.templating.list;\n this.variables = this.variableSrv.variables;\n }\n SubmenuCtrl.prototype.annotationStateChanged = function () {\n this.$rootScope.$broadcast('refresh');\n };\n SubmenuCtrl.prototype.variableUpdated = function (variable) {\n this.variableSrv.variableUpdated(variable, true);\n };\n SubmenuCtrl.prototype.openEditView = function (editview) {\n var search = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.extend(this.$location.search(), { editview: editview });\n this.$location.search(search);\n };\n return SubmenuCtrl;\n}());\n\nfunction submenuDirective() {\n return {\n restrict: 'E',\n templateUrl: 'public/app/features/dashboard/submenu/submenu.html',\n controller: SubmenuCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: {\n dashboard: '=',\n },\n };\n}\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.directives').directive('dashboardSubmenu', submenuDirective);\n\n\n/***/ }),\n\n/***/ 2207:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export SaveDashboardAsModalCtrl */\n/* unused harmony export saveDashboardAsDirective */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_core_module__ = __webpack_require__(2);\n\nvar template = \"\\n
    \\n\\t
    \\n\\t\\t

    \\n\\t\\t\\t\\n\\t\\t\\tSave As...\\n\\t\\t

    \\n\\n\\t\\t\\n\\t\\t\\t\\n\\t\\t\\n\\t
    \\n\\n\\t
    \\n\\t\\t
    \\n\\t\\t\\t
    \\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\n\\t\\t\\t
    \\n
    \\n \\n \\n
    \\n\\t\\t
    \\n\\n\\t\\t
    \\n\\t\\t\\t\\n\\t\\t\\tCancel\\n\\t\\t
    \\n\\t\\n
    \\n\";\nvar SaveDashboardAsModalCtrl = /** @class */ (function () {\n /** @ngInject */\n SaveDashboardAsModalCtrl.$inject = [\"dashboardSrv\"];\n function SaveDashboardAsModalCtrl(dashboardSrv) {\n this.dashboardSrv = dashboardSrv;\n this.isValidFolderSelection = true;\n var dashboard = this.dashboardSrv.getCurrent();\n this.clone = dashboard.getSaveModelClone();\n this.clone.id = null;\n this.clone.uid = '';\n this.clone.title += ' Copy';\n this.clone.editable = true;\n this.clone.hideControls = false;\n this.folderId = dashboard.meta.folderId;\n // remove alerts if source dashboard is already persisted\n // do not want to create alert dupes\n if (dashboard.id > 0) {\n this.clone.panels.forEach(function (panel) {\n if (panel.type === 'graph' && panel.alert) {\n delete panel.thresholds;\n }\n delete panel.alert;\n });\n }\n delete this.clone.autoUpdate;\n }\n SaveDashboardAsModalCtrl.prototype.save = function () {\n return this.dashboardSrv.save(this.clone, { folderId: this.folderId }).then(this.dismiss);\n };\n SaveDashboardAsModalCtrl.prototype.keyDown = function (evt) {\n if (evt.keyCode === 13) {\n this.save();\n }\n };\n SaveDashboardAsModalCtrl.prototype.onFolderChange = function (folder) {\n this.folderId = folder.id;\n };\n SaveDashboardAsModalCtrl.prototype.onEnterFolderCreation = function () {\n this.isValidFolderSelection = false;\n };\n SaveDashboardAsModalCtrl.prototype.onExitFolderCreation = function () {\n this.isValidFolderSelection = true;\n };\n return SaveDashboardAsModalCtrl;\n}());\n\nfunction saveDashboardAsDirective() {\n return {\n restrict: 'E',\n template: template,\n controller: SaveDashboardAsModalCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: { dismiss: '&' },\n };\n}\n__WEBPACK_IMPORTED_MODULE_0_app_core_core_module__[\"a\" /* default */].directive('saveDashboardAsModal', saveDashboardAsDirective);\n\n\n/***/ }),\n\n/***/ 2208:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export SaveDashboardModalCtrl */\n/* unused harmony export saveDashboardModalDirective */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_core_module__ = __webpack_require__(2);\n\nvar template = \"\\n
    \\n
    \\n

    \\n \\n Save changes\\n

    \\n\\n \\n \\n \\n
    \\n\\n
    \\n
    \\n
    \\n \\n
    \\n
    \\n\\n
    \\n \\n Save\\n Saving...\\n \\n \\n
    \\n \\n
    \\n\";\nvar SaveDashboardModalCtrl = /** @class */ (function () {\n /** @ngInject */\n SaveDashboardModalCtrl.$inject = [\"dashboardSrv\"];\n function SaveDashboardModalCtrl(dashboardSrv) {\n this.dashboardSrv = dashboardSrv;\n this.saveVariables = false;\n this.saveTimerange = false;\n this.current = [];\n this.originalCurrent = [];\n this.timeChange = false;\n this.variableValueChange = false;\n this.message = '';\n this.max = 64;\n this.isSaving = false;\n this.timeChange = this.dashboardSrv.getCurrent().hasTimeChanged();\n this.variableValueChange = this.dashboardSrv.getCurrent().hasVariableValuesChanged();\n }\n SaveDashboardModalCtrl.prototype.save = function () {\n if (!this.saveForm.$valid) {\n return;\n }\n var options = {\n saveVariables: this.saveVariables,\n saveTimerange: this.saveTimerange,\n message: this.message,\n };\n var dashboard = this.dashboardSrv.getCurrent();\n var saveModel = dashboard.getSaveModelClone(options);\n this.isSaving = true;\n return this.dashboardSrv.save(saveModel, options).then(this.postSave.bind(this, options));\n };\n SaveDashboardModalCtrl.prototype.postSave = function (options) {\n if (options.saveVariables) {\n this.dashboardSrv.getCurrent().resetOriginalVariables();\n }\n if (options.saveTimerange) {\n this.dashboardSrv.getCurrent().resetOriginalTime();\n }\n this.dismiss();\n };\n return SaveDashboardModalCtrl;\n}());\n\nfunction saveDashboardModalDirective() {\n return {\n restrict: 'E',\n template: template,\n controller: SaveDashboardModalCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: { dismiss: '&' },\n };\n}\n__WEBPACK_IMPORTED_MODULE_0_app_core_core_module__[\"a\" /* default */].directive('saveDashboardModal', saveDashboardModalDirective);\n\n\n/***/ }),\n\n/***/ 2209:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export SaveProvisionedDashboardModalCtrl */\n/* unused harmony export saveProvisionedDashboardModalDirective */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_file_saver__ = __webpack_require__(314);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_file_saver___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_file_saver__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_core_module__ = __webpack_require__(2);\n\n\n\nvar template = \"\\n
    \\n
    \\n

    \\n Cannot save provisioned dashboard\\n

    \\n\\n \\n \\n \\n
    \\n\\n
    \\n \\n This dashboard cannot be saved from Grafana's UI since it has been provisioned from another source.\\n Copy the JSON or save it to a file below. Then you can update your dashboard in corresponding provisioning source.
    \\n See \\n documentation for more information about provisioning.\\n
    \\n
    \\n
    \\n \\n
    \\n
    \\n \\n \\n Cancel\\n
    \\n
    \\n
    \\n
    \\n\";\nvar SaveProvisionedDashboardModalCtrl = /** @class */ (function () {\n /** @ngInject */\n SaveProvisionedDashboardModalCtrl.$inject = [\"dashboardSrv\"];\n function SaveProvisionedDashboardModalCtrl(dashboardSrv) {\n this.dash = dashboardSrv.getCurrent().getSaveModelClone();\n delete this.dash.id;\n this.dashboardJson = __WEBPACK_IMPORTED_MODULE_0_angular___default.a.toJson(this.dash, true);\n }\n SaveProvisionedDashboardModalCtrl.prototype.save = function () {\n var blob = new Blob([__WEBPACK_IMPORTED_MODULE_0_angular___default.a.toJson(this.dash, true)], {\n type: 'application/json;charset=utf-8',\n });\n Object(__WEBPACK_IMPORTED_MODULE_1_file_saver__[\"saveAs\"])(blob, this.dash.title + '-' + new Date().getTime() + '.json');\n };\n SaveProvisionedDashboardModalCtrl.prototype.getJsonForClipboard = function () {\n return this.dashboardJson;\n };\n return SaveProvisionedDashboardModalCtrl;\n}());\n\nfunction saveProvisionedDashboardModalDirective() {\n return {\n restrict: 'E',\n template: template,\n controller: SaveProvisionedDashboardModalCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: { dismiss: '&' },\n };\n}\n__WEBPACK_IMPORTED_MODULE_2_app_core_core_module__[\"a\" /* default */].directive('saveProvisionedDashboardModal', saveProvisionedDashboardModalDirective);\n\n\n/***/ }),\n\n/***/ 2210:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export ShareModalCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_config__ = __webpack_require__(23);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_moment__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_moment__);\n\n\n\nvar ShareModalCtrl = /** @class */ (function () {\n /** @ngInject */\n ShareModalCtrl.$inject = [\"$scope\", \"$rootScope\", \"$location\", \"$timeout\", \"timeSrv\", \"templateSrv\", \"linkSrv\"];\n function ShareModalCtrl($scope, $rootScope, $location, $timeout, timeSrv, templateSrv, linkSrv) {\n $scope.options = {\n forCurrent: true,\n includeTemplateVars: true,\n theme: 'current',\n };\n $scope.editor = { index: $scope.tabIndex || 0 };\n $scope.init = function () {\n $scope.modeSharePanel = $scope.panel ? true : false;\n $scope.tabs = [{ title: 'Link', src: 'shareLink.html' }];\n if ($scope.modeSharePanel) {\n $scope.modalTitle = 'Share Panel';\n $scope.tabs.push({ title: 'Embed', src: 'shareEmbed.html' });\n }\n else {\n $scope.modalTitle = 'Share';\n }\n if (!$scope.dashboard.meta.isSnapshot) {\n $scope.tabs.push({ title: 'Snapshot', src: 'shareSnapshot.html' });\n }\n if (!$scope.dashboard.meta.isSnapshot && !$scope.modeSharePanel) {\n $scope.tabs.push({ title: 'Dashboard', src: 'shareExport.html' });\n }\n if (!$scope.modeSharePanel && !$scope.dashboard.meta.isSnapshot) {\n $scope.tabs.push({ title: 'Experiment', src: 'shareExperiment.html' });\n }\n $scope.buildUrl();\n };\n $scope.buildUrl = function () {\n var baseUrl = $location.absUrl();\n var queryStart = baseUrl.indexOf('?');\n if (queryStart !== -1) {\n baseUrl = baseUrl.substring(0, queryStart);\n }\n var params = __WEBPACK_IMPORTED_MODULE_0_angular___default.a.copy($location.search());\n var range = timeSrv.timeRange();\n params.from = range.from.valueOf();\n params.to = range.to.valueOf();\n params.orgId = __WEBPACK_IMPORTED_MODULE_1_app_core_config__[\"a\" /* default */].bootData.user.orgId;\n if ($scope.options.includeTemplateVars) {\n templateSrv.fillVariableValuesForUrl(params);\n }\n if (!$scope.options.forCurrent) {\n delete params.from;\n delete params.to;\n }\n if ($scope.options.theme !== 'current') {\n params.theme = $scope.options.theme;\n }\n if ($scope.modeSharePanel) {\n params.panelId = $scope.panel.id;\n params.fullscreen = true;\n }\n else {\n delete params.panelId;\n delete params.fullscreen;\n }\n $scope.shareUrl = linkSrv.addParamsToUrl(baseUrl, params);\n var soloUrl = baseUrl.replace(__WEBPACK_IMPORTED_MODULE_1_app_core_config__[\"a\" /* default */].appSubUrl + '/dashboard/', __WEBPACK_IMPORTED_MODULE_1_app_core_config__[\"a\" /* default */].appSubUrl + '/dashboard-solo/');\n soloUrl = soloUrl.replace(__WEBPACK_IMPORTED_MODULE_1_app_core_config__[\"a\" /* default */].appSubUrl + '/d/', __WEBPACK_IMPORTED_MODULE_1_app_core_config__[\"a\" /* default */].appSubUrl + '/d-solo/');\n delete params.fullscreen;\n delete params.edit;\n delete params.orgId;\n delete params['var-experiment_id'];\n soloUrl = linkSrv.addParamsToUrl(soloUrl, params);\n $scope.iframeHtml = '';\n $scope.imageUrl = soloUrl.replace(__WEBPACK_IMPORTED_MODULE_1_app_core_config__[\"a\" /* default */].appSubUrl + '/dashboard-solo/', __WEBPACK_IMPORTED_MODULE_1_app_core_config__[\"a\" /* default */].appSubUrl + '/render/dashboard-solo/');\n $scope.imageUrl = $scope.imageUrl.replace(__WEBPACK_IMPORTED_MODULE_1_app_core_config__[\"a\" /* default */].appSubUrl + '/d-solo/', __WEBPACK_IMPORTED_MODULE_1_app_core_config__[\"a\" /* default */].appSubUrl + '/render/d-solo/');\n $scope.imageUrl += '&width=1000&height=500' + $scope.getLocalTimeZone();\n };\n // This function will try to return the proper full name of the local timezone\n // Chrome does not handle the timezone offset (but phantomjs does)\n $scope.getLocalTimeZone = function () {\n var utcOffset = '&tz=UTC' + encodeURIComponent(__WEBPACK_IMPORTED_MODULE_2_moment___default()().format('Z'));\n // Older browser does not the internationalization API\n if (!window.Intl) {\n return utcOffset;\n }\n var dateFormat = window.Intl.DateTimeFormat();\n if (!dateFormat.resolvedOptions) {\n return utcOffset;\n }\n var options = dateFormat.resolvedOptions();\n if (!options.timeZone) {\n return utcOffset;\n }\n return '&tz=' + encodeURIComponent(options.timeZone);\n };\n $scope.getShareUrl = function () {\n return $scope.shareUrl;\n };\n }\n return ShareModalCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.controllers').controller('ShareModalCtrl', ShareModalCtrl);\n\n\n/***/ }),\n\n/***/ 2211:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export ShareSnapshotCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n\n\nvar ShareSnapshotCtrl = /** @class */ (function () {\n /** @ngInject **/\n ShareSnapshotCtrl.$inject = [\"$scope\", \"$rootScope\", \"$location\", \"backendSrv\", \"$timeout\", \"timeSrv\"];\n function ShareSnapshotCtrl($scope, $rootScope, $location, backendSrv, $timeout, timeSrv) {\n $scope.snapshot = {\n name: $scope.dashboard.title,\n expires: 0,\n timeoutSeconds: 4,\n };\n $scope.step = 1;\n $scope.expireOptions = [\n { text: '1 Hour', value: 60 * 60 },\n { text: '1 Day', value: 60 * 60 * 24 },\n { text: '7 Days', value: 60 * 60 * 24 * 7 },\n { text: 'Never', value: 0 },\n ];\n $scope.accessOptions = [\n { text: 'Anyone with the link', value: 1 },\n { text: 'Organization users', value: 2 },\n { text: 'Public on the web', value: 3 },\n ];\n $scope.init = function () {\n backendSrv.get('/api/snapshot/shared-options').then(function (options) {\n $scope.externalUrl = options['externalSnapshotURL'];\n $scope.sharingButtonText = options['externalSnapshotName'];\n $scope.externalEnabled = options['externalEnabled'];\n });\n };\n $scope.apiUrl = '/api/snapshots';\n $scope.createSnapshot = function (external) {\n $scope.dashboard.snapshot = {\n timestamp: new Date(),\n };\n if (!external) {\n $scope.dashboard.snapshot.originalUrl = $location.absUrl();\n }\n $scope.loading = true;\n $scope.snapshot.external = external;\n $rootScope.$broadcast('refresh');\n $timeout(function () {\n $scope.saveSnapshot(external);\n }, $scope.snapshot.timeoutSeconds * 1000);\n };\n $scope.saveSnapshot = function (external) {\n var dash = $scope.dashboard.getSaveModelClone();\n $scope.scrubDashboard(dash);\n var cmdData = {\n dashboard: dash,\n name: dash.title,\n expires: $scope.snapshot.expires,\n };\n var postUrl = external ? $scope.externalUrl + $scope.apiUrl : $scope.apiUrl;\n backendSrv.post(postUrl, cmdData).then(function (results) {\n $scope.loading = false;\n if (external) {\n $scope.deleteUrl = results.deleteUrl;\n $scope.snapshotUrl = results.url;\n $scope.saveExternalSnapshotRef(cmdData, results);\n }\n else {\n var url = $location.url();\n var baseUrl = $location.absUrl();\n if (url !== '/') {\n baseUrl = baseUrl.replace(url, '') + '/';\n }\n $scope.snapshotUrl = baseUrl + 'dashboard/snapshot/' + results.key;\n $scope.deleteUrl = baseUrl + 'api/snapshots-delete/' + results.deleteKey;\n }\n $scope.step = 2;\n }, function () {\n $scope.loading = false;\n });\n };\n $scope.getSnapshotUrl = function () {\n return $scope.snapshotUrl;\n };\n $scope.scrubDashboard = function (dash) {\n // change title\n dash.title = $scope.snapshot.name;\n // Attach experiment info\n dash.experiment = $scope.experiment;\n // make relative times absolute\n dash.time = timeSrv.timeRange();\n // remove panel queries & links\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(dash.panels, function (panel) {\n panel.targets = [];\n panel.links = [];\n panel.datasource = null;\n });\n // remove annotation queries\n dash.annotations.list = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.chain(dash.annotations.list)\n .filter(function (annotation) {\n return annotation.enable;\n })\n .map(function (annotation) {\n return {\n name: annotation.name,\n enable: annotation.enable,\n iconColor: annotation.iconColor,\n snapshotData: annotation.snapshotData,\n type: annotation.type,\n builtIn: annotation.builtIn,\n hide: annotation.hide,\n };\n })\n .value();\n // remove template queries\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(dash.templating.list, function (variable) {\n variable.query = '';\n variable.options = variable.current;\n variable.refresh = false;\n });\n // snapshot single panel\n if ($scope.modeSharePanel) {\n var singlePanel = $scope.panel.getSaveModel();\n singlePanel.gridPos.w = 24;\n singlePanel.gridPos.x = 0;\n singlePanel.gridPos.y = 0;\n singlePanel.gridPos.h = 20;\n dash.panels = [singlePanel];\n }\n // cleanup snapshotData\n delete $scope.dashboard.snapshot;\n $scope.dashboard.forEachPanel(function (panel) {\n delete panel.snapshotData;\n });\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each($scope.dashboard.annotations.list, function (annotation) {\n delete annotation.snapshotData;\n });\n };\n $scope.deleteSnapshot = function () {\n backendSrv.get($scope.deleteUrl).then(function () {\n $scope.step = 3;\n });\n };\n $scope.saveExternalSnapshotRef = function (cmdData, results) {\n // save external in local instance as well\n cmdData.external = true;\n cmdData.key = results.key;\n cmdData.deleteKey = results.deleteKey;\n backendSrv.post('/api/snapshots/', cmdData);\n };\n }\n return ShareSnapshotCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.controllers').controller('ShareSnapshotCtrl', ShareSnapshotCtrl);\n\n\n/***/ }),\n\n/***/ 2212:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export DashboardSrv */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_core_module__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__dashboard_model__ = __webpack_require__(703);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_utils_location_util__ = __webpack_require__(198);\n\n\n\nvar DashboardSrv = /** @class */ (function () {\n /** @ngInject */\n DashboardSrv.$inject = [\"backendSrv\", \"$rootScope\", \"$location\"];\n function DashboardSrv(backendSrv, $rootScope, $location) {\n this.backendSrv = backendSrv;\n this.$rootScope = $rootScope;\n this.$location = $location;\n }\n DashboardSrv.prototype.create = function (dashboard, meta) {\n return new __WEBPACK_IMPORTED_MODULE_1__dashboard_model__[\"a\" /* DashboardModel */](dashboard, meta);\n };\n DashboardSrv.prototype.setCurrent = function (dashboard) {\n this.dash = dashboard;\n };\n DashboardSrv.prototype.getCurrent = function () {\n return this.dash;\n };\n DashboardSrv.prototype.handleSaveDashboardError = function (clone, options, err) {\n var _this = this;\n options = options || {};\n options.overwrite = true;\n if (err.data && err.data.status === 'version-mismatch') {\n err.isHandled = true;\n this.$rootScope.appEvent('confirm-modal', {\n title: 'Conflict',\n text: 'Someone else has updated this dashboard.',\n text2: 'Would you still like to save this dashboard?',\n yesText: 'Save & Overwrite',\n icon: 'fa-warning',\n onConfirm: function () {\n _this.save(clone, options);\n },\n });\n }\n if (err.data && err.data.status === 'name-exists') {\n err.isHandled = true;\n this.$rootScope.appEvent('confirm-modal', {\n title: 'Conflict',\n text: 'A dashboard with the same name in selected folder already exists.',\n text2: 'Would you still like to save this dashboard?',\n yesText: 'Save & Overwrite',\n icon: 'fa-warning',\n onConfirm: function () {\n _this.save(clone, options);\n },\n });\n }\n if (err.data && err.data.status === 'plugin-dashboard') {\n err.isHandled = true;\n this.$rootScope.appEvent('confirm-modal', {\n title: 'Plugin Dashboard',\n text: err.data.message,\n text2: 'Your changes will be lost when you update the plugin. Use Save As to create custom version.',\n yesText: 'Overwrite',\n icon: 'fa-warning',\n altActionText: 'Save As',\n onAltAction: function () {\n _this.showSaveAsModal();\n },\n onConfirm: function () {\n _this.save(clone, { overwrite: true });\n },\n });\n }\n };\n DashboardSrv.prototype.postSave = function (clone, data) {\n this.dash.version = data.version;\n var newUrl = __WEBPACK_IMPORTED_MODULE_2_app_core_utils_location_util__[\"b\" /* default */].stripBaseFromUrl(data.url);\n var currentPath = this.$location.path();\n if (newUrl !== currentPath) {\n this.$location.url(newUrl).replace();\n }\n this.$rootScope.appEvent('dashboard-saved', this.dash);\n this.$rootScope.appEvent('alert-success', ['Dashboard saved']);\n return this.dash;\n };\n DashboardSrv.prototype.save = function (clone, options) {\n options = options || {};\n options.folderId = options.folderId >= 0 ? options.folderId : this.dash.meta.folderId || clone.folderId;\n return this.backendSrv\n .saveDashboard(clone, options)\n .then(this.postSave.bind(this, clone))\n .catch(this.handleSaveDashboardError.bind(this, clone, options));\n };\n DashboardSrv.prototype.saveDashboard = function (options, clone) {\n if (clone) {\n this.setCurrent(this.create(clone, this.dash.meta));\n }\n if (this.dash.meta.provisioned) {\n return this.showDashboardProvisionedModal();\n }\n if (!this.dash.meta.canSave && options.makeEditable !== true) {\n return Promise.resolve();\n }\n if (this.dash.title === 'New dashboard') {\n return this.showSaveAsModal();\n }\n if (this.dash.version > 0) {\n return this.showSaveModal();\n }\n return this.save(this.dash.getSaveModelClone(), options);\n };\n DashboardSrv.prototype.saveJSONDashboard = function (json) {\n return this.save(JSON.parse(json), {});\n };\n DashboardSrv.prototype.showDashboardProvisionedModal = function () {\n this.$rootScope.appEvent('show-modal', {\n templateHtml: '',\n });\n };\n DashboardSrv.prototype.showSaveAsModal = function () {\n this.$rootScope.appEvent('show-modal', {\n templateHtml: '',\n modalClass: 'modal--narrow',\n });\n };\n DashboardSrv.prototype.showSaveModal = function () {\n this.$rootScope.appEvent('show-modal', {\n templateHtml: '',\n modalClass: 'modal--narrow',\n });\n };\n DashboardSrv.prototype.starDashboard = function (dashboardId, isStarred) {\n var _this = this;\n var promise;\n if (isStarred) {\n promise = this.backendSrv.delete('/api/user/stars/dashboard/' + dashboardId).then(function () {\n return false;\n });\n }\n else {\n promise = this.backendSrv.post('/api/user/stars/dashboard/' + dashboardId).then(function () {\n return true;\n });\n }\n return promise.then(function (res) {\n if (_this.dash && _this.dash.id === dashboardId) {\n _this.dash.meta.isStarred = res;\n }\n return res;\n });\n };\n return DashboardSrv;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_app_core_core_module__[\"a\" /* default */].service('dashboardSrv', DashboardSrv);\n\n\n/***/ }),\n\n/***/ 2213:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export DashboardViewState */\n/* unused harmony export dashboardViewStateSrv */\n/* harmony import */ \ndashboardViewStateSrv.$inject = [\"$location\", \"$timeout\", \"$rootScope\"];var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_config__ = __webpack_require__(23);\n\n\n\n// represents the transient view state\n// like fullscreen panel & edit\nvar DashboardViewState = /** @class */ (function () {\n /** @ngInject */\n DashboardViewState.$inject = [\"$scope\", \"$location\", \"$timeout\", \"$rootScope\"];\n function DashboardViewState($scope, $location, $timeout, $rootScope) {\n this.$location = $location;\n this.$timeout = $timeout;\n this.$rootScope = $rootScope;\n var self = this;\n self.state = {};\n self.panelScopes = [];\n self.$scope = $scope;\n self.dashboard = $scope.dashboard;\n $scope.onAppEvent('$routeUpdate', function () {\n var urlState = self.getQueryStringState();\n if (self.needsSync(urlState)) {\n self.update(urlState, true);\n }\n });\n $scope.onAppEvent('panel-change-view', function (evt, payload) {\n self.update(payload);\n });\n $scope.onAppEvent('panel-initialized', function (evt, payload) {\n self.registerPanel(payload.scope);\n });\n // this marks changes to location during this digest cycle as not to add history item\n // don't want url changes like adding orgId to add browser history\n $location.replace();\n this.update(this.getQueryStringState());\n }\n DashboardViewState.prototype.needsSync = function (urlState) {\n return __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isEqual(this.state, urlState) === false;\n };\n DashboardViewState.prototype.getQueryStringState = function () {\n var state = this.$location.search();\n state.panelId = parseInt(state.panelId) || null;\n state.fullscreen = state.fullscreen ? true : null;\n state.edit = state.edit === 'true' || state.edit === true || null;\n state.editview = state.editview || null;\n state.orgId = __WEBPACK_IMPORTED_MODULE_2_app_core_config__[\"a\" /* default */].bootData.user.orgId;\n return state;\n };\n DashboardViewState.prototype.serializeToUrl = function () {\n var urlState = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.clone(this.state);\n urlState.fullscreen = this.state.fullscreen ? true : null;\n urlState.edit = this.state.edit ? true : null;\n return urlState;\n };\n DashboardViewState.prototype.update = function (state, fromRouteUpdated) {\n // implement toggle logic\n if (state.toggle) {\n delete state.toggle;\n if (this.state.fullscreen && state.fullscreen) {\n if (this.state.edit === state.edit) {\n state.fullscreen = !state.fullscreen;\n }\n }\n }\n // remember if editStateChanged\n this.editStateChanged = (state.edit || false) !== (this.state.edit || false);\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.extend(this.state, state);\n this.dashboard.meta.fullscreen = this.state.fullscreen;\n if (!this.state.fullscreen) {\n this.state.fullscreen = null;\n this.state.edit = null;\n // clear panel id unless in solo mode\n if (!this.dashboard.meta.soloMode) {\n this.state.panelId = null;\n }\n }\n if ((this.state.fullscreen || this.dashboard.meta.soloMode) && this.state.panelId) {\n // Trying to render panel in fullscreen when it's in the collapsed row causes an issue.\n // So in this case expand collapsed row first.\n this.toggleCollapsedPanelRow(this.state.panelId);\n }\n // if no edit state cleanup tab parm\n if (!this.state.edit) {\n delete this.state.tab;\n }\n // do not update url params if we are here\n // from routeUpdated event\n if (fromRouteUpdated !== true) {\n this.$location.search(this.serializeToUrl());\n }\n this.syncState();\n };\n DashboardViewState.prototype.toggleCollapsedPanelRow = function (panelId) {\n for (var _i = 0, _a = this.dashboard.panels; _i < _a.length; _i++) {\n var panel = _a[_i];\n if (panel.collapsed) {\n for (var _b = 0, _c = panel.panels; _b < _c.length; _b++) {\n var rowPanel = _c[_b];\n if (rowPanel.id === panelId) {\n this.dashboard.toggleRow(panel);\n return;\n }\n }\n }\n }\n };\n DashboardViewState.prototype.syncState = function () {\n if (this.panelScopes.length === 0) {\n return;\n }\n if (this.dashboard.meta.fullscreen) {\n var panelScope = this.getPanelScope(this.state.panelId);\n if (!panelScope) {\n return;\n }\n if (this.fullscreenPanel) {\n // if already fullscreen\n if (this.fullscreenPanel === panelScope && this.editStateChanged === false) {\n return;\n }\n else {\n this.leaveFullscreen(false);\n }\n }\n if (!panelScope.ctrl.editModeInitiated) {\n panelScope.ctrl.initEditMode();\n }\n if (!panelScope.ctrl.fullscreen) {\n this.enterFullscreen(panelScope);\n }\n }\n else if (this.fullscreenPanel) {\n this.leaveFullscreen(true);\n }\n };\n DashboardViewState.prototype.getPanelScope = function (id) {\n return __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find(this.panelScopes, function (panelScope) {\n return panelScope.ctrl.panel.id === id;\n });\n };\n DashboardViewState.prototype.leaveFullscreen = function (render) {\n var self = this;\n var ctrl = self.fullscreenPanel.ctrl;\n ctrl.editMode = false;\n ctrl.fullscreen = false;\n this.dashboard.setViewMode(ctrl.panel, false, false);\n this.$scope.appEvent('panel-fullscreen-exit', { panelId: ctrl.panel.id });\n this.$scope.appEvent('dash-scroll', { restore: true });\n if (!render) {\n return false;\n }\n this.$timeout(function () {\n if (self.oldTimeRange !== ctrl.range) {\n self.$rootScope.$broadcast('refresh');\n }\n else {\n self.$rootScope.$broadcast('render');\n }\n delete self.fullscreenPanel;\n });\n return true;\n };\n DashboardViewState.prototype.enterFullscreen = function (panelScope) {\n var ctrl = panelScope.ctrl;\n ctrl.editMode = this.state.edit && this.dashboard.meta.canEdit;\n ctrl.fullscreen = true;\n this.oldTimeRange = ctrl.range;\n this.fullscreenPanel = panelScope;\n // Firefox doesn't return scrollTop position properly if 'dash-scroll' is emitted after setViewMode()\n this.$scope.appEvent('dash-scroll', { animate: false, pos: 0 });\n this.dashboard.setViewMode(ctrl.panel, true, ctrl.editMode);\n this.$scope.appEvent('panel-fullscreen-enter', { panelId: ctrl.panel.id });\n };\n DashboardViewState.prototype.registerPanel = function (panelScope) {\n var self = this;\n self.panelScopes.push(panelScope);\n if (!self.dashboard.meta.soloMode) {\n if (self.state.panelId === panelScope.ctrl.panel.id) {\n if (self.state.edit) {\n panelScope.ctrl.editPanel();\n }\n else {\n panelScope.ctrl.viewPanel();\n }\n }\n }\n var unbind = panelScope.$on('$destroy', function () {\n self.panelScopes = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.without(self.panelScopes, panelScope);\n unbind();\n });\n };\n return DashboardViewState;\n}());\n\n/** @ngInject */\nfunction dashboardViewStateSrv($location, $timeout, $rootScope) {\n return {\n create: function ($scope) {\n return new DashboardViewState($scope, $location, $timeout, $rootScope);\n },\n };\n}\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.services').factory('dashboardViewStateSrv', dashboardViewStateSrv);\n\n\n/***/ }),\n\n/***/ 2214:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export ValidationSrv */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_core_module__ = __webpack_require__(2);\n\nvar hitTypes = {\n FOLDER: 'dash-folder',\n DASHBOARD: 'dash-db',\n};\nvar ValidationSrv = /** @class */ (function () {\n /** @ngInject */\n ValidationSrv.$inject = [\"$q\", \"backendSrv\"];\n function ValidationSrv($q, backendSrv) {\n this.$q = $q;\n this.backendSrv = backendSrv;\n this.rootName = 'general';\n }\n ValidationSrv.prototype.validateNewDashboardName = function (folderId, name) {\n return this.validate(folderId, name, 'A dashboard in this folder with the same name already exists');\n };\n ValidationSrv.prototype.validateNewFolderName = function (name) {\n return this.validate(0, name, 'A folder or dashboard in the general folder with the same name already exists');\n };\n ValidationSrv.prototype.validate = function (folderId, name, existingErrorMessage) {\n name = (name || '').trim();\n var nameLowerCased = name.toLowerCase();\n if (name.length === 0) {\n return this.$q.reject({\n type: 'REQUIRED',\n message: 'Name is required',\n });\n }\n if (folderId === 0 && nameLowerCased === this.rootName) {\n return this.$q.reject({\n type: 'EXISTING',\n message: 'This is a reserved name and cannot be used for a folder.',\n });\n }\n var deferred = this.$q.defer();\n var promises = [];\n promises.push(this.backendSrv.search({ type: hitTypes.FOLDER, folderIds: [folderId], query: name }));\n promises.push(this.backendSrv.search({ type: hitTypes.DASHBOARD, folderIds: [folderId], query: name }));\n this.$q.all(promises).then(function (res) {\n var hits = [];\n if (res.length > 0 && res[0].length > 0) {\n hits = res[0];\n }\n if (res.length > 1 && res[1].length > 0) {\n hits = hits.concat(res[1]);\n }\n for (var _i = 0, hits_1 = hits; _i < hits_1.length; _i++) {\n var hit = hits_1[_i];\n if (nameLowerCased === hit.title.toLowerCase()) {\n deferred.reject({\n type: 'EXISTING',\n message: existingErrorMessage,\n });\n break;\n }\n }\n deferred.resolve();\n });\n return deferred.promise;\n };\n return ValidationSrv;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_app_core_core_module__[\"a\" /* default */].service('validationSrv', ValidationSrv);\n\n\n/***/ }),\n\n/***/ 2215:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_moment__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_moment__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_core_module__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_app_core_utils_kbn__ = __webpack_require__(312);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_app_core_utils_datemath__ = __webpack_require__(691);\n\n\n\n\n\nvar TimeSrv = /** @class */ (function () {\n /** @ngInject **/\n TimeSrv.$inject = [\"$rootScope\", \"$timeout\", \"$location\", \"timer\", \"contextSrv\"];\n function TimeSrv($rootScope, $timeout, $location, timer, contextSrv) {\n var _this = this;\n this.$rootScope = $rootScope;\n this.$timeout = $timeout;\n this.$location = $location;\n this.timer = timer;\n this.contextSrv = contextSrv;\n // default time\n this.time = { from: '6h', to: 'now' };\n $rootScope.$on('zoom-out', this.zoomOut.bind(this));\n $rootScope.$on('$routeUpdate', this.routeUpdated.bind(this));\n document.addEventListener('visibilitychange', function () {\n if (_this.autoRefreshBlocked && document.visibilityState === 'visible') {\n _this.autoRefreshBlocked = false;\n _this.refreshDashboard();\n }\n });\n }\n TimeSrv.prototype.init = function (dashboard, experiment) {\n this.timer.cancelAll();\n this.dashboard = dashboard;\n this.experiment = experiment;\n this.time = dashboard.time;\n this.refresh = dashboard.refresh;\n this.initTimeFromUrl();\n this.parseTime();\n // remember time at load so we can go back to it\n this.timeAtLoad = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.cloneDeep(this.time);\n if (this.refresh) {\n this.setAutoRefresh(this.refresh);\n }\n };\n TimeSrv.prototype.parseTime = function () {\n // when absolute time is saved in json it is turned to a string\n if (__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isString(this.time.from) && this.time.from.indexOf('Z') >= 0) {\n this.time.from = __WEBPACK_IMPORTED_MODULE_0_moment___default()(this.time.from).utc();\n }\n if (__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.isString(this.time.to) && this.time.to.indexOf('Z') >= 0) {\n this.time.to = __WEBPACK_IMPORTED_MODULE_0_moment___default()(this.time.to).utc();\n }\n };\n TimeSrv.prototype.parseUrlParam = function (value) {\n if (value.indexOf('now') !== -1) {\n return value;\n }\n // Length based formatting is causing problems with 8 digit timestamps,\n // disabling this for now.\n // if (value.length === 8) {\n // return moment.utc(value, 'YYYYMMDD');\n // }\n // if (value.length === 15) {\n // return moment.utc(value, 'YYYYMMDDTHHmmss');\n // }\n if (!isNaN(value)) {\n var epoch = parseInt(value);\n return __WEBPACK_IMPORTED_MODULE_0_moment___default.a.utc(epoch);\n }\n return null;\n };\n TimeSrv.prototype.initTimeFromUrl = function () {\n var params = this.$location.search();\n if (params.from && params.to) {\n this.time.from = this.parseUrlParam(params.from) || this.time.from;\n this.time.to = this.parseUrlParam(params.to) || this.time.to;\n }\n else if (this.experiment) {\n this.time.from = __WEBPACK_IMPORTED_MODULE_0_moment___default.a.utc(this.experiment.startedNs / Math.pow(10, 6));\n this.time.to = __WEBPACK_IMPORTED_MODULE_0_moment___default.a.utc(this.experiment.stoppedNs / Math.pow(10, 6));\n }\n if (params.refresh) {\n this.refresh = params.refresh || this.refresh;\n }\n };\n TimeSrv.prototype.routeUpdated = function () {\n var params = this.$location.search();\n var urlRange = this.timeRangeForUrl();\n // check if url has time range\n if (params.from && params.to) {\n // is it different from what our current time range?\n if (params.from !== urlRange.from || params.to !== urlRange.to) {\n // issue update\n this.initTimeFromUrl();\n this.setTime(this.time, true);\n }\n }\n else if (this.timeHasChangedSinceLoad()) {\n this.setTime(this.timeAtLoad, true);\n }\n };\n TimeSrv.prototype.timeHasChangedSinceLoad = function () {\n return this.timeAtLoad.from !== this.time.from || this.timeAtLoad.to !== this.time.to;\n };\n TimeSrv.prototype.setAutoRefresh = function (interval) {\n var _this = this;\n this.dashboard.refresh = interval;\n this.cancelNextRefresh();\n if (interval) {\n var intervalMs = __WEBPACK_IMPORTED_MODULE_3_app_core_utils_kbn__[\"a\" /* default */].interval_to_ms(interval);\n this.refreshTimer = this.timer.register(this.$timeout(function () {\n _this.startNextRefreshTimer(intervalMs);\n _this.refreshDashboard();\n }, intervalMs));\n }\n // update url\n var params = this.$location.search();\n if (interval) {\n params.refresh = interval;\n this.$location.search(params);\n }\n else if (params.refresh) {\n delete params.refresh;\n this.$location.search(params);\n }\n };\n TimeSrv.prototype.refreshDashboard = function () {\n this.$rootScope.$broadcast('refresh');\n };\n TimeSrv.prototype.startNextRefreshTimer = function (afterMs) {\n var _this = this;\n this.cancelNextRefresh();\n this.refreshTimer = this.timer.register(this.$timeout(function () {\n _this.startNextRefreshTimer(afterMs);\n if (_this.contextSrv.isGrafanaVisible()) {\n _this.refreshDashboard();\n }\n else {\n _this.autoRefreshBlocked = true;\n }\n }, afterMs));\n };\n TimeSrv.prototype.cancelNextRefresh = function () {\n this.timer.cancel(this.refreshTimer);\n };\n TimeSrv.prototype.setTime = function (time, fromRouteUpdate) {\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.extend(this.time, time);\n // disable refresh if zoom in or zoom out\n if (__WEBPACK_IMPORTED_MODULE_0_moment___default.a.isMoment(time.to)) {\n this.oldRefresh = this.dashboard.refresh || this.oldRefresh;\n this.setAutoRefresh(false);\n }\n else if (this.oldRefresh && this.oldRefresh !== this.dashboard.refresh) {\n this.setAutoRefresh(this.oldRefresh);\n this.oldRefresh = null;\n }\n // update url\n if (fromRouteUpdate !== true) {\n var urlRange = this.timeRangeForUrl();\n var urlParams = this.$location.search();\n urlParams.from = urlRange.from;\n urlParams.to = urlRange.to;\n this.$location.search(urlParams);\n }\n this.$rootScope.appEvent('time-range-changed', this.time);\n this.$timeout(this.refreshDashboard.bind(this), 0);\n };\n TimeSrv.prototype.timeRangeForUrl = function () {\n var range = this.timeRange().raw;\n if (__WEBPACK_IMPORTED_MODULE_0_moment___default.a.isMoment(range.from)) {\n range.from = range.from.valueOf().toString();\n }\n if (__WEBPACK_IMPORTED_MODULE_0_moment___default.a.isMoment(range.to)) {\n range.to = range.to.valueOf().toString();\n }\n return range;\n };\n TimeSrv.prototype.timeRange = function () {\n // make copies if they are moment (do not want to return out internal moment, because they are mutable!)\n var raw = {\n from: __WEBPACK_IMPORTED_MODULE_0_moment___default.a.isMoment(this.time.from) ? __WEBPACK_IMPORTED_MODULE_0_moment___default()(this.time.from) : this.time.from,\n to: __WEBPACK_IMPORTED_MODULE_0_moment___default.a.isMoment(this.time.to) ? __WEBPACK_IMPORTED_MODULE_0_moment___default()(this.time.to) : this.time.to,\n };\n var timezone = this.dashboard && this.dashboard.getTimezone();\n return {\n from: __WEBPACK_IMPORTED_MODULE_4_app_core_utils_datemath__[\"parse\"](raw.from, false, timezone),\n to: __WEBPACK_IMPORTED_MODULE_4_app_core_utils_datemath__[\"parse\"](raw.to, true, timezone),\n raw: raw,\n };\n };\n TimeSrv.prototype.zoomOut = function (e, factor) {\n var range = this.timeRange();\n var timespan = range.to.valueOf() - range.from.valueOf();\n var center = range.to.valueOf() - timespan / 2;\n var to = center + timespan * factor / 2;\n var from = center - timespan * factor / 2;\n if (to > Date.now() && range.to <= Date.now()) {\n var offset = to - Date.now();\n from = from - offset;\n to = Date.now();\n }\n this.setTime({ from: __WEBPACK_IMPORTED_MODULE_0_moment___default.a.utc(from), to: __WEBPACK_IMPORTED_MODULE_0_moment___default.a.utc(to) });\n };\n return TimeSrv;\n}());\n__WEBPACK_IMPORTED_MODULE_2_app_core_core_module__[\"a\" /* default */].service('timeSrv', TimeSrv);\n\n\n/***/ }),\n\n/***/ 2216:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export unsavedChangesSrv */\n/* harmony import */ \nunsavedChangesSrv.$inject = [\"$rootScope\", \"$q\", \"$location\", \"$timeout\", \"contextSrv\", \"dashboardSrv\", \"$window\"];var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__change_tracker__ = __webpack_require__(2217);\n\n\n/** @ngInject */\nfunction unsavedChangesSrv($rootScope, $q, $location, $timeout, contextSrv, dashboardSrv, $window) {\n this.init = function (dashboard, scope) {\n this.tracker = new __WEBPACK_IMPORTED_MODULE_1__change_tracker__[\"a\" /* ChangeTracker */](dashboard, scope, 1000, $location, $window, $timeout, contextSrv, $rootScope);\n return this.tracker;\n };\n}\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.services').service('unsavedChangesSrv', unsavedChangesSrv);\n\n\n/***/ }),\n\n/***/ 2217:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return ChangeTracker; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__dashboard_model__ = __webpack_require__(703);\n\n\n\nvar ChangeTracker = /** @class */ (function () {\n /** @ngInject */\n ChangeTracker.$inject = [\"dashboard\", \"scope\", \"originalCopyDelay\", \"$location\", \"$window\", \"$timeout\", \"contextSrv\", \"$rootScope\"];\n function ChangeTracker(dashboard, scope, originalCopyDelay, $location, $window, $timeout, contextSrv, $rootScope) {\n var _this = this;\n this.$location = $location;\n this.$timeout = $timeout;\n this.contextSrv = contextSrv;\n this.$rootScope = $rootScope;\n this.$location = $location;\n this.$window = $window;\n this.current = dashboard;\n this.originalPath = $location.path();\n this.scope = scope;\n // register events\n scope.onAppEvent('dashboard-saved', function () {\n _this.original = _this.current.getSaveModelClone();\n _this.originalPath = $location.path();\n });\n $window.onbeforeunload = function () {\n if (_this.ignoreChanges()) {\n return undefined;\n }\n if (_this.hasChanges()) {\n return 'There are unsaved changes to this dashboard';\n }\n return undefined;\n };\n scope.$on('$locationChangeStart', function (event, next) {\n // check if we should look for changes\n if (_this.originalPath === $location.path()) {\n return true;\n }\n if (_this.ignoreChanges()) {\n return true;\n }\n if (_this.hasChanges()) {\n event.preventDefault();\n _this.next = next;\n _this.$timeout(function () {\n _this.open_modal();\n });\n }\n return false;\n });\n if (originalCopyDelay) {\n this.$timeout(function () {\n // wait for different services to patch the dashboard (missing properties)\n _this.original = dashboard.getSaveModelClone();\n }, originalCopyDelay);\n }\n else {\n this.original = dashboard.getSaveModelClone();\n }\n }\n // for some dashboards and users\n // changes should be ignored\n ChangeTracker.prototype.ignoreChanges = function () {\n if (!this.original) {\n return true;\n }\n if (!this.contextSrv.isEditor) {\n return true;\n }\n if (!this.current || !this.current.meta) {\n return true;\n }\n var meta = this.current.meta;\n return !meta.canSave || meta.fromScript || meta.fromFile;\n };\n // remove stuff that should not count in diff\n ChangeTracker.prototype.cleanDashboardFromIgnoredChanges = function (dashData) {\n // need to new up the domain model class to get access to expand / collapse row logic\n var model = new __WEBPACK_IMPORTED_MODULE_2__dashboard_model__[\"a\" /* DashboardModel */](dashData);\n // Expand all rows before making comparison. This is required because row expand / collapse\n // change order of panel array and panel positions.\n model.expandRows();\n var dash = model.getSaveModelClone();\n // ignore time and refresh\n dash.time = 0;\n dash.refresh = 0;\n dash.schemaVersion = 0;\n // ignore iteration property\n delete dash.iteration;\n dash.panels = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.filter(dash.panels, function (panel) {\n if (panel.repeatPanelId) {\n return false;\n }\n // remove scopedVars\n panel.scopedVars = null;\n // ignore panel legend sort\n if (panel.legend) {\n delete panel.legend.sort;\n delete panel.legend.sortDesc;\n }\n return true;\n });\n // ignore template variable values\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(dash.templating.list, function (value) {\n value.current = null;\n value.options = null;\n value.filters = null;\n });\n return dash;\n };\n ChangeTracker.prototype.hasChanges = function () {\n var current = this.cleanDashboardFromIgnoredChanges(this.current.getSaveModelClone());\n var original = this.cleanDashboardFromIgnoredChanges(this.original);\n var currentTimepicker = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find(current.nav, { type: 'timepicker' });\n var originalTimepicker = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find(original.nav, { type: 'timepicker' });\n if (currentTimepicker && originalTimepicker) {\n currentTimepicker.now = originalTimepicker.now;\n }\n var currentJson = __WEBPACK_IMPORTED_MODULE_0_angular___default.a.toJson(current, true);\n var originalJson = __WEBPACK_IMPORTED_MODULE_0_angular___default.a.toJson(original, true);\n return currentJson !== originalJson;\n };\n ChangeTracker.prototype.discardChanges = function () {\n this.original = null;\n this.gotoNext();\n };\n ChangeTracker.prototype.open_modal = function () {\n this.$rootScope.appEvent('show-modal', {\n templateHtml: '',\n modalClass: 'modal--narrow confirm-modal',\n });\n };\n ChangeTracker.prototype.saveChanges = function () {\n var _this = this;\n var self = this;\n var cancel = this.$rootScope.$on('dashboard-saved', function () {\n cancel();\n _this.$timeout(function () {\n self.gotoNext();\n });\n });\n this.$rootScope.appEvent('save-dashboard');\n };\n ChangeTracker.prototype.gotoNext = function () {\n var baseLen = this.$location.absUrl().length - this.$location.url().length;\n var nextUrl = this.next.substring(baseLen);\n this.$location.url(nextUrl);\n };\n return ChangeTracker;\n}());\n\n\n\n/***/ }),\n\n/***/ 2218:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export UnsavedChangesModalCtrl */\n/* unused harmony export unsavedChangesModalDirective */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_core_module__ = __webpack_require__(2);\n\nvar template = \"\\n
    \\n
    \\n

    \\n \\n Unsaved changes\\n

    \\n\\n \\n \\n \\n
    \\n\\n
    \\n\\n
    \\n Do you want to save your changes?\\n
    \\n\\n
    \\n \\n \\n \\n
    \\n
    \\n
    \\n\";\nvar UnsavedChangesModalCtrl = /** @class */ (function () {\n /** @ngInject */\n UnsavedChangesModalCtrl.$inject = [\"unsavedChangesSrv\"];\n function UnsavedChangesModalCtrl(unsavedChangesSrv) {\n this.unsavedChangesSrv = unsavedChangesSrv;\n }\n UnsavedChangesModalCtrl.prototype.discard = function () {\n this.dismiss();\n this.unsavedChangesSrv.tracker.discardChanges();\n };\n UnsavedChangesModalCtrl.prototype.save = function () {\n this.dismiss();\n this.unsavedChangesSrv.tracker.saveChanges();\n };\n return UnsavedChangesModalCtrl;\n}());\n\nfunction unsavedChangesModalDirective() {\n return {\n restrict: 'E',\n template: template,\n controller: UnsavedChangesModalCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: { dismiss: '&' },\n };\n}\n__WEBPACK_IMPORTED_MODULE_0_app_core_core_module__[\"a\" /* default */].directive('unsavedChangesModal', unsavedChangesModalDirective);\n\n\n/***/ }),\n\n/***/ 2219:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export TimePickerCtrl */\n/* unused harmony export settingsDirective */\n/* unused harmony export timePickerDirective */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_moment__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_moment__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_app_core_utils_rangeutil__ = __webpack_require__(697);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__input_date__ = __webpack_require__(2220);\n\n\n\n\nvar TimePickerCtrl = /** @class */ (function () {\n /** @ngInject */\n TimePickerCtrl.$inject = [\"$scope\", \"$rootScope\", \"timeSrv\"];\n function TimePickerCtrl($scope, $rootScope, timeSrv) {\n var _this = this;\n this.$scope = $scope;\n this.$rootScope = $rootScope;\n this.timeSrv = timeSrv;\n this.$scope.ctrl = this;\n $rootScope.onAppEvent('shift-time-forward', function () { return _this.move(1); }, $scope);\n $rootScope.onAppEvent('shift-time-backward', function () { return _this.move(-1); }, $scope);\n $rootScope.onAppEvent('refresh', this.onRefresh.bind(this), $scope);\n $rootScope.onAppEvent('closeTimepicker', this.openDropdown.bind(this), $scope);\n // init options\n this.panel = this.dashboard.timepicker;\n __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.defaults(this.panel, TimePickerCtrl.defaults);\n this.firstDayOfWeek = __WEBPACK_IMPORTED_MODULE_2_moment___default.a.localeData().firstDayOfWeek();\n // init time stuff\n this.onRefresh();\n }\n TimePickerCtrl.prototype.onRefresh = function () {\n var time = __WEBPACK_IMPORTED_MODULE_1_angular___default.a.copy(this.timeSrv.timeRange());\n var timeRaw = __WEBPACK_IMPORTED_MODULE_1_angular___default.a.copy(time.raw);\n if (!this.dashboard.isTimezoneUtc()) {\n time.from.local();\n time.to.local();\n if (__WEBPACK_IMPORTED_MODULE_2_moment___default.a.isMoment(timeRaw.from)) {\n timeRaw.from.local();\n }\n if (__WEBPACK_IMPORTED_MODULE_2_moment___default.a.isMoment(timeRaw.to)) {\n timeRaw.to.local();\n }\n this.isUtc = false;\n }\n else {\n this.isUtc = true;\n }\n var tZero = function (secs) { return (secs < 0 ? 'T' + secs : secs === 0 ? 'T=0' : 'T+' + secs); };\n this.rangeString = tZero(time.from.unix()) + ' to ' + tZero(time.to.unix());\n this.absolute = { fromJs: time.from.toDate(), toJs: time.to.toDate() };\n this.tooltip = this.dashboard.formatDate(time.from) + '
    to
    ';\n this.tooltip += this.dashboard.formatDate(time.to);\n this.timeRaw = timeRaw;\n };\n TimePickerCtrl.prototype.zoom = function (factor) {\n this.$rootScope.appEvent('zoom-out', 2);\n };\n TimePickerCtrl.prototype.move = function (direction) {\n var range = this.timeSrv.timeRange();\n var timespan = (range.to.valueOf() - range.from.valueOf()) / 2;\n var to, from;\n if (direction === -1) {\n to = range.to.valueOf() - timespan;\n from = range.from.valueOf() - timespan;\n }\n else if (direction === 1) {\n to = range.to.valueOf() + timespan;\n from = range.from.valueOf() + timespan;\n if (to > Date.now() && range.to < Date.now()) {\n to = Date.now();\n from = range.from.valueOf();\n }\n }\n else {\n to = range.to.valueOf();\n from = range.from.valueOf();\n }\n this.timeSrv.setTime({ from: __WEBPACK_IMPORTED_MODULE_2_moment___default.a.utc(from), to: __WEBPACK_IMPORTED_MODULE_2_moment___default.a.utc(to) });\n };\n TimePickerCtrl.prototype.openDropdown = function () {\n if (this.isOpen) {\n this.closeDropdown();\n return;\n }\n this.onRefresh();\n this.editTimeRaw = this.timeRaw;\n this.timeOptions = __WEBPACK_IMPORTED_MODULE_3_app_core_utils_rangeutil__[\"c\" /* getRelativeTimesList */](this.panel, this.rangeString);\n this.refresh = {\n value: this.dashboard.refresh,\n options: __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(this.panel.refresh_intervals, function (interval) {\n return { text: interval, value: interval };\n }),\n };\n this.refresh.options.unshift({ text: 'off' });\n this.isOpen = true;\n this.$rootScope.appEvent('timepickerOpen');\n };\n TimePickerCtrl.prototype.closeDropdown = function () {\n this.isOpen = false;\n this.$rootScope.appEvent('timepickerClosed');\n };\n TimePickerCtrl.prototype.applyCustom = function () {\n if (this.refresh.value !== this.dashboard.refresh) {\n this.timeSrv.setAutoRefresh(this.refresh.value);\n }\n this.timeSrv.setTime(this.editTimeRaw);\n this.closeDropdown();\n };\n TimePickerCtrl.prototype.absoluteFromChanged = function () {\n this.editTimeRaw.from = this.getAbsoluteMomentForTimezone(this.absolute.fromJs);\n };\n TimePickerCtrl.prototype.absoluteToChanged = function () {\n this.editTimeRaw.to = this.getAbsoluteMomentForTimezone(this.absolute.toJs);\n };\n TimePickerCtrl.prototype.getAbsoluteMomentForTimezone = function (jsDate) {\n return this.dashboard.isTimezoneUtc() ? __WEBPACK_IMPORTED_MODULE_2_moment___default()(jsDate).utc() : __WEBPACK_IMPORTED_MODULE_2_moment___default()(jsDate);\n };\n TimePickerCtrl.prototype.setRelativeFilter = function (timespan) {\n var range = { from: timespan.from, to: timespan.to };\n if (this.panel.nowDelay && range.to === 'now') {\n range.to = 'now-' + this.panel.nowDelay;\n }\n this.timeSrv.setTime(range);\n this.closeDropdown();\n };\n TimePickerCtrl.tooltipFormat = 'MMM D, YYYY HH:mm:ss';\n TimePickerCtrl.defaults = {\n time_options: ['5m', '15m', '1h', '6h', '12h', '24h', '2d', '7d', '30d'],\n refresh_intervals: ['5s', '10s', '30s', '1m', '5m', '15m', '30m', '1h', '2h', '1d'],\n };\n return TimePickerCtrl;\n}());\n\nfunction settingsDirective() {\n return {\n restrict: 'E',\n templateUrl: 'public/app/features/dashboard/timepicker/settings.html',\n controller: TimePickerCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: {\n dashboard: '=',\n },\n };\n}\nfunction timePickerDirective() {\n return {\n restrict: 'E',\n templateUrl: 'public/app/features/dashboard/timepicker/timepicker.html',\n controller: TimePickerCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: {\n dashboard: '=',\n },\n };\n}\n__WEBPACK_IMPORTED_MODULE_1_angular___default.a.module('grafana.directives').directive('gfTimePickerSettings', settingsDirective);\n__WEBPACK_IMPORTED_MODULE_1_angular___default.a.module('grafana.directives').directive('gfTimePicker', timePickerDirective);\n\n__WEBPACK_IMPORTED_MODULE_1_angular___default.a.module('grafana.directives').directive('inputDatetime', __WEBPACK_IMPORTED_MODULE_4__input_date__[\"a\" /* inputDateDirective */]);\n\n\n/***/ }),\n\n/***/ 2220:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = inputDateDirective;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_moment__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_moment___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_moment__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_utils_datemath__ = __webpack_require__(691);\n\n\nfunction inputDateDirective() {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function ($scope, $elem, attrs, ngModel) {\n var format = 'YYYY-MM-DD HH:mm:ss';\n var fromUser = function (text) {\n if (text.indexOf('now') !== -1) {\n if (!__WEBPACK_IMPORTED_MODULE_1_app_core_utils_datemath__[\"isValid\"](text)) {\n ngModel.$setValidity('error', false);\n return undefined;\n }\n ngModel.$setValidity('error', true);\n return text;\n }\n var parsed;\n if ($scope.ctrl.isUtc) {\n parsed = __WEBPACK_IMPORTED_MODULE_0_moment___default.a.utc(text, format);\n }\n else {\n parsed = __WEBPACK_IMPORTED_MODULE_0_moment___default()(text, format);\n }\n if (!parsed.isValid()) {\n ngModel.$setValidity('error', false);\n return undefined;\n }\n ngModel.$setValidity('error', true);\n return parsed;\n };\n var toUser = function (currentValue) {\n if (__WEBPACK_IMPORTED_MODULE_0_moment___default.a.isMoment(currentValue)) {\n return currentValue.format(format);\n }\n else {\n return currentValue;\n }\n };\n ngModel.$parsers.push(fromUser);\n ngModel.$formatters.push(toUser);\n },\n };\n}\n\n\n/***/ }),\n\n/***/ 2221:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ \nuploadDashboardDirective.$inject = [\"timer\", \"alertSrv\", \"$location\"];var __WEBPACK_IMPORTED_MODULE_0_app_core_core_module__ = __webpack_require__(2);\n\nvar template = \"\\n\\n\\n\";\n/** @ngInject */\nfunction uploadDashboardDirective(timer, alertSrv, $location) {\n return {\n restrict: 'E',\n template: template,\n scope: {\n onUpload: '&',\n },\n link: function (scope) {\n function file_selected(evt) {\n var files = evt.target.files; // FileList object\n var readerOnload = function () {\n return function (e) {\n var dash;\n try {\n dash = JSON.parse(e.target.result);\n }\n catch (err) {\n console.log(err);\n scope.appEvent('alert-error', ['Import failed', 'JSON -> JS Serialization failed: ' + err.message]);\n return;\n }\n scope.$apply(function () {\n scope.onUpload({ dash: dash });\n });\n };\n };\n for (var i = 0, f; (f = files[i]); i++) {\n var reader = new FileReader();\n reader.onload = readerOnload();\n reader.readAsText(f);\n }\n }\n var wnd = window;\n // Check for the various File API support.\n if (wnd.File && wnd.FileReader && wnd.FileList && wnd.Blob) {\n // Something\n document.getElementById('dashupload').addEventListener('change', file_selected, false);\n }\n else {\n alertSrv.set('Oops', 'Sorry, the HTML5 File APIs are not fully supported in this browser.', 'error');\n }\n },\n };\n}\n__WEBPACK_IMPORTED_MODULE_0_app_core_core_module__[\"a\" /* default */].directive('dashUpload', uploadDashboardDirective);\n\n\n/***/ }),\n\n/***/ 2222:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export DashExportCtrl */\n/* unused harmony export dashExportDirective */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_file_saver__ = __webpack_require__(314);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_file_saver___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_file_saver__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_core_module__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__exporter__ = __webpack_require__(2223);\n\n\n\n\nvar DashExportCtrl = /** @class */ (function () {\n /** @ngInject */\n DashExportCtrl.$inject = [\"dashboardSrv\", \"datasourceSrv\", \"$scope\", \"$rootScope\"];\n function DashExportCtrl(dashboardSrv, datasourceSrv, $scope, $rootScope) {\n var _this = this;\n this.dashboardSrv = dashboardSrv;\n this.$scope = $scope;\n this.$rootScope = $rootScope;\n this.exporter = new __WEBPACK_IMPORTED_MODULE_3__exporter__[\"a\" /* DashboardExporter */](datasourceSrv);\n this.exporter.makeExportable(this.dashboardSrv.getCurrent()).then(function (dash) {\n _this.$scope.$apply(function () {\n _this.dash = dash;\n });\n });\n }\n DashExportCtrl.prototype.save = function () {\n var blob = new Blob([__WEBPACK_IMPORTED_MODULE_0_angular___default.a.toJson(this.dash, true)], {\n type: 'application/json;charset=utf-8',\n });\n Object(__WEBPACK_IMPORTED_MODULE_1_file_saver__[\"saveAs\"])(blob, this.dash.title + '-' + new Date().getTime() + '.json');\n };\n DashExportCtrl.prototype.saveJson = function () {\n var clone = this.dash;\n var editScope = this.$rootScope.$new();\n editScope.object = clone;\n editScope.enableCopy = true;\n this.$rootScope.appEvent('show-modal', {\n src: 'public/app/partials/edit_json.html',\n scope: editScope,\n });\n this.dismiss();\n };\n return DashExportCtrl;\n}());\n\nfunction dashExportDirective() {\n return {\n restrict: 'E',\n templateUrl: 'public/app/features/dashboard/export/export_modal.html',\n controller: DashExportCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: { dismiss: '&' },\n };\n}\n__WEBPACK_IMPORTED_MODULE_2_app_core_core_module__[\"a\" /* default */].directive('dashExportModal', dashExportDirective);\n\n\n/***/ }),\n\n/***/ 2223:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"a\", function() { return DashboardExporter; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_config__ = __webpack_require__(23);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n\n\nvar DashboardExporter = /** @class */ (function () {\n function DashboardExporter(datasourceSrv) {\n this.datasourceSrv = datasourceSrv;\n }\n DashboardExporter.prototype.makeExportable = function (dashboard) {\n var _this = this;\n // clean up repeated rows and panels,\n // this is done on the live real dashboard instance, not on a clone\n // so we need to undo this\n // this is pretty hacky and needs to be changed\n dashboard.cleanUpRepeats();\n var saveModel = dashboard.getSaveModelClone();\n saveModel.id = null;\n // undo repeat cleanup\n dashboard.processRepeats();\n var inputs = [];\n var requires = {};\n var datasources = {};\n var promises = [];\n var variableLookup = {};\n for (var _i = 0, _a = saveModel.templating.list; _i < _a.length; _i++) {\n var variable = _a[_i];\n variableLookup[variable.name] = variable;\n }\n var templateizeDatasourceUsage = function (obj) {\n // ignore data source properties that contain a variable\n if (obj.datasource && obj.datasource.indexOf('$') === 0) {\n if (variableLookup[obj.datasource.substring(1)]) {\n return;\n }\n }\n promises.push(_this.datasourceSrv.get(obj.datasource).then(function (ds) {\n if (ds.meta.builtIn) {\n return;\n }\n var refName = 'DS_' + ds.name.replace(' ', '_').toUpperCase();\n datasources[refName] = {\n name: refName,\n label: ds.name,\n description: '',\n type: 'datasource',\n pluginId: ds.meta.id,\n pluginName: ds.meta.name,\n };\n obj.datasource = '${' + refName + '}';\n requires['datasource' + ds.meta.id] = {\n type: 'datasource',\n id: ds.meta.id,\n name: ds.meta.name,\n version: ds.meta.info.version || '1.0.0',\n };\n }));\n };\n var processPanel = function (panel) {\n if (panel.datasource !== undefined) {\n templateizeDatasourceUsage(panel);\n }\n if (panel.targets) {\n for (var _i = 0, _a = panel.targets; _i < _a.length; _i++) {\n var target = _a[_i];\n if (target.datasource !== undefined) {\n templateizeDatasourceUsage(target);\n }\n }\n }\n var panelDef = __WEBPACK_IMPORTED_MODULE_0_app_core_config__[\"a\" /* default */].panels[panel.type];\n if (panelDef) {\n requires['panel' + panelDef.id] = {\n type: 'panel',\n id: panelDef.id,\n name: panelDef.name,\n version: panelDef.info.version,\n };\n }\n };\n // check up panel data sources\n for (var _b = 0, _c = saveModel.panels; _b < _c.length; _b++) {\n var panel = _c[_b];\n processPanel(panel);\n // handle collapsed rows\n if (panel.collapsed !== undefined && panel.collapsed === true && panel.panels) {\n for (var _d = 0, _e = panel.panels; _d < _e.length; _d++) {\n var rowPanel = _e[_d];\n processPanel(rowPanel);\n }\n }\n }\n // templatize template vars\n for (var _f = 0, _g = saveModel.templating.list; _f < _g.length; _f++) {\n var variable = _g[_f];\n if (variable.type === 'query') {\n templateizeDatasourceUsage(variable);\n variable.options = [];\n variable.current = {};\n variable.refresh = variable.refresh > 0 ? variable.refresh : 1;\n }\n }\n // templatize annotations vars\n for (var _h = 0, _j = saveModel.annotations.list; _h < _j.length; _h++) {\n var annotationDef = _j[_h];\n templateizeDatasourceUsage(annotationDef);\n }\n // add grafana version\n requires['grafana'] = {\n type: 'grafana',\n id: 'grafana',\n name: 'Grafana',\n version: __WEBPACK_IMPORTED_MODULE_0_app_core_config__[\"a\" /* default */].buildInfo.version,\n };\n return Promise.all(promises)\n .then(function () {\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.each(datasources, function (value, key) {\n inputs.push(value);\n });\n // templatize constants\n for (var _i = 0, _a = saveModel.templating.list; _i < _a.length; _i++) {\n var variable = _a[_i];\n if (variable.type === 'constant') {\n var refName = 'VAR_' + variable.name.replace(' ', '_').toUpperCase();\n inputs.push({\n name: refName,\n type: 'constant',\n label: variable.label || variable.name,\n value: variable.current.value,\n description: '',\n });\n // update current and option\n variable.query = '${' + refName + '}';\n variable.options[0] = variable.current = {\n value: variable.query,\n text: variable.query,\n };\n }\n }\n // make inputs and requires a top thing\n var newObj = {};\n newObj['__inputs'] = inputs;\n newObj['__requires'] = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.sortBy(requires, ['id']);\n __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.defaults(newObj, saveModel);\n return newObj;\n })\n .catch(function (err) {\n console.log('Export failed:', err);\n return {\n error: err,\n };\n });\n };\n return DashboardExporter;\n}());\n\n\n\n/***/ }),\n\n/***/ 2224:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export ExportDataModalCtrl */\n/* unused harmony export exportDataModal */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_utils_file_export__ = __webpack_require__(1999);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_app_events__ = __webpack_require__(22);\n\n\n\nvar ExportDataModalCtrl = /** @class */ (function () {\n function ExportDataModalCtrl() {\n this.asRows = true;\n this.dateTimeFormat = 'x';\n }\n ExportDataModalCtrl.prototype.export = function () {\n if (this.panel === 'table') {\n __WEBPACK_IMPORTED_MODULE_1_app_core_utils_file_export__[\"exportTableDataToCsv\"](this.data, this.excel);\n }\n else {\n if (this.asRows) {\n __WEBPACK_IMPORTED_MODULE_1_app_core_utils_file_export__[\"exportSeriesListToCsv\"](this.data, this.dateTimeFormat, this.excel);\n }\n else {\n __WEBPACK_IMPORTED_MODULE_1_app_core_utils_file_export__[\"exportSeriesListToCsvColumns\"](this.data, this.dateTimeFormat, this.excel);\n }\n }\n this.dismiss();\n };\n ExportDataModalCtrl.prototype.dismiss = function () {\n __WEBPACK_IMPORTED_MODULE_2_app_core_app_events__[\"a\" /* default */].emit('hide-modal');\n };\n return ExportDataModalCtrl;\n}());\n\nfunction exportDataModal() {\n return {\n restrict: 'E',\n templateUrl: 'public/app/features/dashboard/export_data/export_data_modal.html',\n controller: ExportDataModalCtrl,\n controllerAs: 'ctrl',\n scope: {\n panel: '<',\n data: '<',\n },\n bindToController: true,\n };\n}\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.directives').directive('exportDataModal', exportDataModal);\n\n\n/***/ }),\n\n/***/ 2225:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export DashExportExperimentCtrl */\n/* unused harmony export dashExportExperimentDirective */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_core_module__ = __webpack_require__(2);\n\nvar DashExportExperimentCtrl = /** @class */ (function () {\n /** @ngInject */\n DashExportExperimentCtrl.$inject = [\"$scope\", \"$http\", \"$routeParams\"];\n function DashExportExperimentCtrl($scope, $http, $routeParams) {\n this.$http = $http;\n this.isEmailLoading = false;\n $scope.sampleInterval = 'orig';\n this.experimentId = $routeParams.experimentId;\n this.link = this.makeUrl($scope.sampleInterval);\n }\n DashExportExperimentCtrl.prototype.intervalChanged = function (interval) {\n this.link = this.makeUrl(interval);\n };\n DashExportExperimentCtrl.prototype.makeUrl = function (interval) {\n var url = \"/api/experiments/\" + this.experimentId + \"/export\";\n if (interval !== 'orig') {\n url += '?sample_interval=' + interval;\n }\n return url;\n };\n DashExportExperimentCtrl.prototype.save = function (interval) {\n window.location.href = this.makeUrl(interval);\n };\n DashExportExperimentCtrl.prototype.email = function (interval) {\n var _this = this;\n function getCookie(name) {\n var cookie = {};\n document.cookie.split(';').forEach(function (el) {\n var _a = el.split('='), k = _a[0], v = _a[1];\n cookie[k.trim()] = v;\n });\n return cookie[name];\n }\n var prefilled = getCookie('email_export_addresses');\n var target = prompt('Please enter email addresses separated by comma: ', prefilled);\n if (!target) {\n return;\n }\n document.cookie = 'email_export_addresses=' + target + '; expires=Thu, 1 Jan 2050 12:00:00 UTC';\n var url = '/experiments/emailreport/?id=' + this.experimentId + '&interval=' + interval + '&target=' + target;\n this.isEmailLoading = true;\n this.$http.get(url).then(function (response) {\n if (response.data === 'ok') {\n alert('Email succesfully sent!');\n }\n else {\n alert('Error sending email!');\n }\n _this.isEmailLoading = false;\n });\n };\n DashExportExperimentCtrl.prototype.copyLink = function (interval) { };\n return DashExportExperimentCtrl;\n}());\n\nfunction dashExportExperimentDirective() {\n return {\n restrict: 'E',\n templateUrl: 'public/app/features/dashboard/export_experiment/export_experiment_modal.html',\n controller: DashExportExperimentCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: {\n dismiss: '&',\n sampleInterval: '=',\n },\n };\n}\n__WEBPACK_IMPORTED_MODULE_0_app_core_core_module__[\"a\" /* default */].directive('dashExportExperimentModal', dashExportExperimentDirective);\n\n\n/***/ }),\n\n/***/ 2226:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export AdHocFiltersCtrl */\n/* unused harmony export adHocFiltersComponent */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_core_module__ = __webpack_require__(2);\n\n\n\nvar AdHocFiltersCtrl = /** @class */ (function () {\n /** @ngInject */\n AdHocFiltersCtrl.$inject = [\"uiSegmentSrv\", \"datasourceSrv\", \"$q\", \"variableSrv\", \"$scope\", \"$rootScope\"];\n function AdHocFiltersCtrl(uiSegmentSrv, datasourceSrv, $q, variableSrv, $scope, $rootScope) {\n this.uiSegmentSrv = uiSegmentSrv;\n this.datasourceSrv = datasourceSrv;\n this.$q = $q;\n this.variableSrv = variableSrv;\n this.$rootScope = $rootScope;\n this.removeTagFilterSegment = uiSegmentSrv.newSegment({\n fake: true,\n value: '-- remove filter --',\n });\n this.buildSegmentModel();\n this.$rootScope.onAppEvent('template-variable-value-updated', this.buildSegmentModel.bind(this), $scope);\n }\n AdHocFiltersCtrl.prototype.buildSegmentModel = function () {\n this.segments = [];\n if (this.variable.value && !__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.isArray(this.variable.value)) {\n }\n for (var _i = 0, _a = this.variable.filters; _i < _a.length; _i++) {\n var tag = _a[_i];\n if (this.segments.length > 0) {\n this.segments.push(this.uiSegmentSrv.newCondition('AND'));\n }\n if (tag.key !== undefined && tag.value !== undefined) {\n this.segments.push(this.uiSegmentSrv.newKey(tag.key));\n this.segments.push(this.uiSegmentSrv.newOperator(tag.operator));\n this.segments.push(this.uiSegmentSrv.newKeyValue(tag.value));\n }\n }\n this.segments.push(this.uiSegmentSrv.newPlusButton());\n };\n AdHocFiltersCtrl.prototype.getOptions = function (segment, index) {\n var _this = this;\n if (segment.type === 'operator') {\n return this.$q.when(this.uiSegmentSrv.newOperators(['=', '!=', '<', '>', '=~', '!~']));\n }\n if (segment.type === 'condition') {\n return this.$q.when([this.uiSegmentSrv.newSegment('AND')]);\n }\n return this.datasourceSrv.get(this.variable.datasource).then(function (ds) {\n var options = {};\n var promise = null;\n if (segment.type !== 'value') {\n promise = ds.getTagKeys();\n }\n else {\n options.key = _this.segments[index - 2].value;\n promise = ds.getTagValues(options);\n }\n return promise.then(function (results) {\n results = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.map(results, function (segment) {\n return _this.uiSegmentSrv.newSegment({ value: segment.text });\n });\n // add remove option for keys\n if (segment.type === 'key') {\n results.splice(0, 0, __WEBPACK_IMPORTED_MODULE_1_angular___default.a.copy(_this.removeTagFilterSegment));\n }\n return results;\n });\n });\n };\n AdHocFiltersCtrl.prototype.segmentChanged = function (segment, index) {\n this.segments[index] = segment;\n // handle remove tag condition\n if (segment.value === this.removeTagFilterSegment.value) {\n this.segments.splice(index, 3);\n if (this.segments.length === 0) {\n this.segments.push(this.uiSegmentSrv.newPlusButton());\n }\n else if (this.segments.length > 2) {\n this.segments.splice(Math.max(index - 1, 0), 1);\n if (this.segments[this.segments.length - 1].type !== 'plus-button') {\n this.segments.push(this.uiSegmentSrv.newPlusButton());\n }\n }\n }\n else {\n if (segment.type === 'plus-button') {\n if (index > 2) {\n this.segments.splice(index, 0, this.uiSegmentSrv.newCondition('AND'));\n }\n this.segments.push(this.uiSegmentSrv.newOperator('='));\n this.segments.push(this.uiSegmentSrv.newFake('select tag value', 'value', 'query-segment-value'));\n segment.type = 'key';\n segment.cssClass = 'query-segment-key';\n }\n if (index + 1 === this.segments.length) {\n this.segments.push(this.uiSegmentSrv.newPlusButton());\n }\n }\n this.updateVariableModel();\n };\n AdHocFiltersCtrl.prototype.updateVariableModel = function () {\n var filters = [];\n var filterIndex = -1;\n var hasFakes = false;\n this.segments.forEach(function (segment) {\n if (segment.type === 'value' && segment.fake) {\n hasFakes = true;\n return;\n }\n switch (segment.type) {\n case 'key': {\n filters.push({ key: segment.value });\n filterIndex += 1;\n break;\n }\n case 'value': {\n filters[filterIndex].value = segment.value;\n break;\n }\n case 'operator': {\n filters[filterIndex].operator = segment.value;\n break;\n }\n case 'condition': {\n filters[filterIndex].condition = segment.value;\n break;\n }\n }\n });\n if (hasFakes) {\n return;\n }\n this.variable.setFilters(filters);\n this.variableSrv.variableUpdated(this.variable, true);\n };\n return AdHocFiltersCtrl;\n}());\n\nvar template = \"\\n
    \\n
    \\n \\n
    \\n
    \\n\";\nfunction adHocFiltersComponent() {\n return {\n restrict: 'E',\n template: template,\n controller: AdHocFiltersCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: {\n variable: '=',\n },\n };\n}\n__WEBPACK_IMPORTED_MODULE_2_app_core_core_module__[\"a\" /* default */].directive('adHocFilters', adHocFiltersComponent);\n\n\n/***/ }),\n\n/***/ 2227:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ \ndashRepeatOptionDirective.$inject = [\"variableSrv\"];var __WEBPACK_IMPORTED_MODULE_0_app_core_core__ = __webpack_require__(197);\n\nvar template = \"\\n
    \\n \\n
    \\n \\n\\n\";\nvar QueryTroubleshooterCtrl = /** @class */ (function () {\n /** @ngInject **/\n QueryTroubleshooterCtrl.$inject = [\"$scope\", \"$timeout\"];\n function QueryTroubleshooterCtrl($scope, $timeout) {\n this.$timeout = $timeout;\n this.onRequestErrorEventListener = this.onRequestError.bind(this);\n this.onRequestResponseEventListener = this.onRequestResponse.bind(this);\n __WEBPACK_IMPORTED_MODULE_1_app_core_app_events__[\"a\" /* default */].on('ds-request-response', this.onRequestResponseEventListener);\n __WEBPACK_IMPORTED_MODULE_1_app_core_app_events__[\"a\" /* default */].on('ds-request-error', this.onRequestErrorEventListener);\n $scope.$on('$destroy', this.removeEventsListeners.bind(this));\n $scope.$watch('ctrl.isOpen', this.stateChanged.bind(this));\n }\n QueryTroubleshooterCtrl.prototype.removeEventsListeners = function () {\n __WEBPACK_IMPORTED_MODULE_1_app_core_app_events__[\"a\" /* default */].off('ds-request-response', this.onRequestResponseEventListener);\n __WEBPACK_IMPORTED_MODULE_1_app_core_app_events__[\"a\" /* default */].off('ds-request-error', this.onRequestErrorEventListener);\n };\n QueryTroubleshooterCtrl.prototype.toggleMocking = function () {\n this.isMocking = !this.isMocking;\n };\n QueryTroubleshooterCtrl.prototype.onRequestError = function (err) {\n // ignore if closed\n if (!this.isOpen) {\n return;\n }\n this.isOpen = true;\n this.hasError = true;\n this.onRequestResponse(err);\n };\n QueryTroubleshooterCtrl.prototype.stateChanged = function () {\n if (this.isOpen) {\n this.panelCtrl.refresh();\n this.isLoading = true;\n }\n };\n QueryTroubleshooterCtrl.prototype.getClipboardText = function () {\n if (this.jsonExplorer) {\n return JSON.stringify(this.jsonExplorer.json, null, 2);\n }\n return '';\n };\n QueryTroubleshooterCtrl.prototype.handleMocking = function (data) {\n var mockedData;\n try {\n mockedData = JSON.parse(this.mockedResponse);\n }\n catch (err) {\n __WEBPACK_IMPORTED_MODULE_1_app_core_app_events__[\"a\" /* default */].emit('alert-error', ['Failed to parse mocked response']);\n return;\n }\n data.data = mockedData;\n };\n QueryTroubleshooterCtrl.prototype.onRequestResponse = function (data) {\n // ignore if closed\n if (!this.isOpen) {\n return;\n }\n if (this.isMocking) {\n this.handleMocking(data);\n return;\n }\n this.isLoading = false;\n data = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.cloneDeep(data);\n if (data.headers) {\n delete data.headers;\n }\n if (data.config) {\n data.request = data.config;\n delete data.config;\n delete data.request.transformRequest;\n delete data.request.transformResponse;\n delete data.request.paramSerializer;\n delete data.request.jsonpCallbackParam;\n delete data.request.headers;\n delete data.request.requestId;\n delete data.request.inspect;\n delete data.request.retry;\n delete data.request.timeout;\n }\n if (data.data) {\n data.response = data.data;\n if (data.status === 200) {\n // if we are in error state, assume we automatically opened\n // and auto close it again\n if (this.hasError) {\n this.hasError = false;\n this.isOpen = false;\n }\n }\n delete data.data;\n delete data.status;\n delete data.statusText;\n delete data.$$config;\n }\n this.$timeout(__WEBPACK_IMPORTED_MODULE_0_lodash___default.a.partial(this.renderJsonExplorer, data));\n };\n QueryTroubleshooterCtrl.prototype.toggleExpand = function (depth) {\n if (this.jsonExplorer) {\n this.allNodesExpanded = !this.allNodesExpanded;\n this.jsonExplorer.openAtDepth(this.allNodesExpanded ? 20 : 1);\n }\n };\n return QueryTroubleshooterCtrl;\n}());\n\nfunction queryTroubleshooter() {\n return {\n restrict: 'E',\n template: template,\n controller: QueryTroubleshooterCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: {\n panelCtrl: '=',\n isOpen: '=',\n },\n link: function (scope, elem, attrs, ctrl) {\n ctrl.renderJsonExplorer = function (data) {\n var jsonElem = elem.find('.query-troubleshooter-json');\n ctrl.jsonExplorer = new __WEBPACK_IMPORTED_MODULE_2_app_core_core__[\"a\" /* JsonExplorer */](data, 3, {\n animateOpen: true,\n });\n var html = ctrl.jsonExplorer.render(true);\n jsonElem.html(html);\n };\n },\n };\n}\n__WEBPACK_IMPORTED_MODULE_2_app_core_core__[\"d\" /* coreModule */].directive('queryTroubleshooter', queryTroubleshooter);\n\n\n/***/ }),\n\n/***/ 2269:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__org_users_ctrl__ = __webpack_require__(2020);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__profile_ctrl__ = __webpack_require__(2270);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__select_org_ctrl__ = __webpack_require__(2271);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__change_password_ctrl__ = __webpack_require__(2272);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__new_org_ctrl__ = __webpack_require__(2273);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__user_invite_ctrl__ = __webpack_require__(2274);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__teams_ctrl__ = __webpack_require__(2275);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__team_details_ctrl__ = __webpack_require__(2276);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__create_team_ctrl__ = __webpack_require__(2277);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__org_api_keys_ctrl__ = __webpack_require__(2278);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__org_details_ctrl__ = __webpack_require__(2279);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__prefs_control__ = __webpack_require__(2280);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/***/ }),\n\n/***/ 2270:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export ProfileCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_config__ = __webpack_require__(23);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_core__ = __webpack_require__(197);\n\n\nvar ProfileCtrl = /** @class */ (function () {\n /** @ngInject **/\n ProfileCtrl.$inject = [\"backendSrv\", \"contextSrv\", \"$location\", \"navModelSrv\"];\n function ProfileCtrl(backendSrv, contextSrv, $location, navModelSrv) {\n this.backendSrv = backendSrv;\n this.contextSrv = contextSrv;\n this.$location = $location;\n this.orgs = [];\n this.showOrgsList = false;\n this.readonlyLoginFields = __WEBPACK_IMPORTED_MODULE_0_app_core_config__[\"a\" /* default */].disableLoginForm;\n this.getUser();\n this.getUserOrgs();\n this.navModel = navModelSrv.getNav('profile', 'profile-settings', 0);\n }\n ProfileCtrl.prototype.getUser = function () {\n var _this = this;\n this.backendSrv.get('/api/user').then(function (user) {\n _this.user = user;\n _this.user.theme = user.theme || 'dark';\n });\n };\n ProfileCtrl.prototype.getUserOrgs = function () {\n var _this = this;\n this.backendSrv.get('/api/user/orgs').then(function (orgs) {\n _this.orgs = orgs;\n _this.showOrgsList = orgs.length > 1;\n });\n };\n ProfileCtrl.prototype.setUsingOrg = function (org) {\n this.backendSrv.post('/api/user/using/' + org.orgId).then(function () {\n window.location.href = __WEBPACK_IMPORTED_MODULE_0_app_core_config__[\"a\" /* default */].appSubUrl + '/profile';\n });\n };\n ProfileCtrl.prototype.update = function () {\n var _this = this;\n if (!this.userForm.$valid) {\n return;\n }\n this.backendSrv.put('/api/user/', this.user).then(function () {\n _this.contextSrv.user.name = _this.user.name || _this.user.login;\n if (_this.old_theme !== _this.user.theme) {\n window.location.href = __WEBPACK_IMPORTED_MODULE_0_app_core_config__[\"a\" /* default */].appSubUrl + _this.$location.path();\n }\n });\n };\n return ProfileCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_1_app_core_core__[\"d\" /* coreModule */].controller('ProfileCtrl', ProfileCtrl);\n\n\n/***/ }),\n\n/***/ 2271:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export SelectOrgCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_config__ = __webpack_require__(23);\n\n\nvar SelectOrgCtrl = /** @class */ (function () {\n /** @ngInject **/\n SelectOrgCtrl.$inject = [\"$scope\", \"backendSrv\", \"contextSrv\"];\n function SelectOrgCtrl($scope, backendSrv, contextSrv) {\n contextSrv.sidemenu = false;\n $scope.navModel = {\n main: {\n icon: 'gicon gicon-branding',\n subTitle: 'Preferences',\n text: 'Select active organization',\n },\n };\n $scope.init = function () {\n $scope.getUserOrgs();\n };\n $scope.getUserOrgs = function () {\n backendSrv.get('/api/user/orgs').then(function (orgs) {\n $scope.orgs = orgs;\n });\n };\n $scope.setUsingOrg = function (org) {\n backendSrv.post('/api/user/using/' + org.orgId).then(function () {\n window.location.href = __WEBPACK_IMPORTED_MODULE_1_app_core_config__[\"a\" /* default */].appSubUrl + '/';\n });\n };\n $scope.init();\n }\n return SelectOrgCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.controllers').controller('SelectOrgCtrl', SelectOrgCtrl);\n\n\n/***/ }),\n\n/***/ 2272:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export ChangePasswordCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_config__ = __webpack_require__(23);\n\n\nvar ChangePasswordCtrl = /** @class */ (function () {\n /** @ngInject **/\n ChangePasswordCtrl.$inject = [\"$scope\", \"backendSrv\", \"$location\", \"navModelSrv\"];\n function ChangePasswordCtrl($scope, backendSrv, $location, navModelSrv) {\n $scope.command = {};\n $scope.authProxyEnabled = __WEBPACK_IMPORTED_MODULE_1_app_core_config__[\"a\" /* default */].authProxyEnabled;\n $scope.ldapEnabled = __WEBPACK_IMPORTED_MODULE_1_app_core_config__[\"a\" /* default */].ldapEnabled;\n $scope.navModel = navModelSrv.getNav('profile', 'change-password', 0);\n $scope.changePassword = function () {\n if (!$scope.userForm.$valid) {\n return;\n }\n if ($scope.command.newPassword !== $scope.command.confirmNew) {\n $scope.appEvent('alert-warning', ['New passwords do not match', '']);\n return;\n }\n backendSrv.put('/api/user/password', $scope.command).then(function () {\n $location.path('profile');\n }, function (err) {\n if (err.status === 401) {\n err.isHandled = true;\n $scope.appEvent('alert-warning', [err.data.message, '']);\n }\n });\n };\n }\n return ChangePasswordCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.controllers').controller('ChangePasswordCtrl', ChangePasswordCtrl);\n\n\n/***/ }),\n\n/***/ 2273:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export NewOrgCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_config__ = __webpack_require__(23);\n\n\nvar NewOrgCtrl = /** @class */ (function () {\n /** @ngInject **/\n NewOrgCtrl.$inject = [\"$scope\", \"$http\", \"backendSrv\", \"navModelSrv\"];\n function NewOrgCtrl($scope, $http, backendSrv, navModelSrv) {\n $scope.navModel = navModelSrv.getNav('cfg', 'admin', 'global-orgs', 1);\n $scope.newOrg = { name: '' };\n $scope.createOrg = function () {\n backendSrv.post('/api/orgs/', $scope.newOrg).then(function (result) {\n backendSrv.post('/api/user/using/' + result.orgId).then(function () {\n window.location.href = __WEBPACK_IMPORTED_MODULE_1_app_core_config__[\"a\" /* default */].appSubUrl + '/org';\n });\n });\n };\n }\n return NewOrgCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.controllers').controller('NewOrgCtrl', NewOrgCtrl);\n\n\n/***/ }),\n\n/***/ 2274:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export UserInviteCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_core_module__ = __webpack_require__(2);\n\nvar UserInviteCtrl = /** @class */ (function () {\n /** @ngInject **/\n UserInviteCtrl.$inject = [\"backendSrv\", \"navModelSrv\", \"$location\"];\n function UserInviteCtrl(backendSrv, navModelSrv, $location) {\n this.backendSrv = backendSrv;\n this.$location = $location;\n this.navModel = navModelSrv.getNav('cfg', 'users', 0);\n this.invite = {\n name: '',\n email: '',\n role: 'Editor',\n sendEmail: true,\n };\n }\n UserInviteCtrl.prototype.sendInvite = function () {\n var _this = this;\n if (!this.inviteForm.$valid) {\n return;\n }\n return this.backendSrv.post('/api/org/invites', this.invite).then(function () {\n _this.$location.path('org/users/');\n });\n };\n return UserInviteCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_app_core_core_module__[\"a\" /* default */].controller('UserInviteCtrl', UserInviteCtrl);\n\n\n/***/ }),\n\n/***/ 2275:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export TeamsCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_core_module__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_app_events__ = __webpack_require__(22);\n\n\nvar TeamsCtrl = /** @class */ (function () {\n /** @ngInject */\n TeamsCtrl.$inject = [\"backendSrv\", \"navModelSrv\"];\n function TeamsCtrl(backendSrv, navModelSrv) {\n this.backendSrv = backendSrv;\n this.pages = [];\n this.perPage = 50;\n this.page = 1;\n this.showPaging = false;\n this.query = '';\n this.navModel = navModelSrv.getNav('cfg', 'teams', 0);\n this.get();\n }\n TeamsCtrl.prototype.get = function () {\n var _this = this;\n this.backendSrv\n .get(\"/api/teams/search?perpage=\" + this.perPage + \"&page=\" + this.page + \"&query=\" + this.query)\n .then(function (result) {\n _this.teams = result.teams;\n _this.page = result.page;\n _this.perPage = result.perPage;\n _this.totalPages = Math.ceil(result.totalCount / result.perPage);\n _this.showPaging = _this.totalPages > 1;\n _this.pages = [];\n for (var i = 1; i < _this.totalPages + 1; i++) {\n _this.pages.push({ page: i, current: i === _this.page });\n }\n });\n };\n TeamsCtrl.prototype.navigateToPage = function (page) {\n this.page = page.page;\n this.get();\n };\n TeamsCtrl.prototype.deleteTeam = function (team) {\n var _this = this;\n __WEBPACK_IMPORTED_MODULE_1_app_core_app_events__[\"a\" /* default */].emit('confirm-modal', {\n title: 'Delete',\n text: 'Are you sure you want to delete Team ' + team.name + '?',\n yesText: 'Delete',\n icon: 'fa-warning',\n onConfirm: function () {\n _this.deleteTeamConfirmed(team);\n },\n });\n };\n TeamsCtrl.prototype.deleteTeamConfirmed = function (team) {\n this.backendSrv.delete('/api/teams/' + team.id).then(this.get.bind(this));\n };\n TeamsCtrl.prototype.openTeamModal = function () {\n __WEBPACK_IMPORTED_MODULE_1_app_core_app_events__[\"a\" /* default */].emit('show-modal', {\n templateHtml: '',\n modalClass: 'modal--narrow',\n });\n };\n return TeamsCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_app_core_core_module__[\"a\" /* default */].controller('TeamsCtrl', TeamsCtrl);\n\n\n/***/ }),\n\n/***/ 2276:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_core_module__ = __webpack_require__(2);\n\nvar TeamDetailsCtrl = /** @class */ (function () {\n /** @ngInject **/\n TeamDetailsCtrl.$inject = [\"$scope\", \"backendSrv\", \"$routeParams\", \"navModelSrv\"];\n function TeamDetailsCtrl($scope, backendSrv, $routeParams, navModelSrv) {\n this.$scope = $scope;\n this.backendSrv = backendSrv;\n this.$routeParams = $routeParams;\n this.teamMembers = [];\n this.navModel = navModelSrv.getNav('cfg', 'teams', 0);\n this.userPicked = this.userPicked.bind(this);\n this.get = this.get.bind(this);\n this.get();\n }\n TeamDetailsCtrl.prototype.get = function () {\n var _this = this;\n if (this.$routeParams && this.$routeParams.id) {\n this.backendSrv.get(\"/api/teams/\" + this.$routeParams.id).then(function (result) {\n _this.team = result;\n });\n this.backendSrv.get(\"/api/teams/\" + this.$routeParams.id + \"/members\").then(function (result) {\n _this.teamMembers = result;\n });\n }\n };\n TeamDetailsCtrl.prototype.removeTeamMember = function (teamMember) {\n var _this = this;\n this.$scope.appEvent('confirm-modal', {\n title: 'Remove Member',\n text: 'Are you sure you want to remove ' + teamMember.login + ' from this group?',\n yesText: 'Remove',\n icon: 'fa-warning',\n onConfirm: function () {\n _this.removeMemberConfirmed(teamMember);\n },\n });\n };\n TeamDetailsCtrl.prototype.removeMemberConfirmed = function (teamMember) {\n this.backendSrv.delete(\"/api/teams/\" + this.$routeParams.id + \"/members/\" + teamMember.userId).then(this.get);\n };\n TeamDetailsCtrl.prototype.update = function () {\n if (!this.$scope.teamDetailsForm.$valid) {\n return;\n }\n this.backendSrv.put('/api/teams/' + this.team.id, {\n name: this.team.name,\n email: this.team.email,\n });\n };\n TeamDetailsCtrl.prototype.userPicked = function (user) {\n var _this = this;\n this.backendSrv.post(\"/api/teams/\" + this.$routeParams.id + \"/members\", { userId: user.id }).then(function () {\n _this.$scope.$broadcast('user-picker-reset');\n _this.get();\n });\n };\n return TeamDetailsCtrl;\n}());\n/* unused harmony default export */ var _unused_webpack_default_export = (TeamDetailsCtrl);\n__WEBPACK_IMPORTED_MODULE_0_app_core_core_module__[\"a\" /* default */].controller('TeamDetailsCtrl', TeamDetailsCtrl);\n\n\n/***/ }),\n\n/***/ 2277:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_core_module__ = __webpack_require__(2);\n\nvar CreateTeamCtrl = /** @class */ (function () {\n /** @ngInject **/\n CreateTeamCtrl.$inject = [\"backendSrv\", \"$location\", \"navModelSrv\"];\n function CreateTeamCtrl(backendSrv, $location, navModelSrv) {\n this.backendSrv = backendSrv;\n this.$location = $location;\n this.navModel = navModelSrv.getNav('cfg', 'teams', 0);\n }\n CreateTeamCtrl.prototype.create = function () {\n var _this = this;\n var payload = {\n name: this.name,\n email: this.email,\n };\n this.backendSrv.post('/api/teams', payload).then(function (result) {\n if (result.teamId) {\n _this.$location.path('/org/teams/edit/' + result.teamId);\n }\n });\n };\n return CreateTeamCtrl;\n}());\n/* unused harmony default export */ var _unused_webpack_default_export = (CreateTeamCtrl);\n__WEBPACK_IMPORTED_MODULE_0_app_core_core_module__[\"a\" /* default */].controller('CreateTeamCtrl', CreateTeamCtrl);\n\n\n/***/ }),\n\n/***/ 2278:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export OrgApiKeysCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n\nvar OrgApiKeysCtrl = /** @class */ (function () {\n /** @ngInject **/\n OrgApiKeysCtrl.$inject = [\"$scope\", \"$http\", \"backendSrv\", \"navModelSrv\"];\n function OrgApiKeysCtrl($scope, $http, backendSrv, navModelSrv) {\n $scope.navModel = navModelSrv.getNav('cfg', 'apikeys', 0);\n $scope.roleTypes = ['Viewer', 'Editor', 'Admin'];\n $scope.token = { role: 'Viewer' };\n $scope.init = function () {\n $scope.getTokens();\n };\n $scope.getTokens = function () {\n backendSrv.get('/api/auth/keys').then(function (tokens) {\n $scope.tokens = tokens;\n });\n };\n $scope.removeToken = function (id) {\n backendSrv.delete('/api/auth/keys/' + id).then($scope.getTokens);\n };\n $scope.addToken = function () {\n backendSrv.post('/api/auth/keys', $scope.token).then(function (result) {\n var modalScope = $scope.$new(true);\n modalScope.key = result.key;\n modalScope.rootPath = window.location.origin + $scope.$root.appSubUrl;\n $scope.appEvent('show-modal', {\n src: 'public/app/features/org/partials/apikeyModal.html',\n scope: modalScope,\n });\n $scope.getTokens();\n });\n };\n $scope.copy = function (key) {\n copyToClipboard(key);\n alert('The key has been copied to the clipboard.');\n };\n $scope.init();\n }\n return OrgApiKeysCtrl;\n}());\n\nvar copyToClipboard = function (str) {\n var el = document.createElement('textarea');\n el.value = str;\n el.setAttribute('readonly', '');\n el.style.position = 'absolute';\n el.style.left = '-9999px';\n document.body.appendChild(el);\n el.select();\n document.execCommand('copy');\n document.body.removeChild(el);\n};\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.controllers').controller('OrgApiKeysCtrl', OrgApiKeysCtrl);\n\n\n/***/ }),\n\n/***/ 2279:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export OrgDetailsCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n\nvar OrgDetailsCtrl = /** @class */ (function () {\n /** @ngInject **/\n OrgDetailsCtrl.$inject = [\"$scope\", \"$http\", \"backendSrv\", \"contextSrv\", \"navModelSrv\"];\n function OrgDetailsCtrl($scope, $http, backendSrv, contextSrv, navModelSrv) {\n $scope.init = function () {\n $scope.getOrgInfo();\n $scope.navModel = navModelSrv.getNav('cfg', 'org-settings', 0);\n };\n $scope.getOrgInfo = function () {\n backendSrv.get('/api/org').then(function (org) {\n $scope.org = org;\n $scope.address = org.address;\n contextSrv.user.orgName = org.name;\n });\n };\n $scope.update = function () {\n if (!$scope.orgForm.$valid) {\n return;\n }\n var data = { name: $scope.org.name };\n backendSrv.put('/api/org', data).then($scope.getOrgInfo);\n };\n $scope.updateAddress = function () {\n if (!$scope.addressForm.$valid) {\n return;\n }\n backendSrv.put('/api/org/address', $scope.address).then($scope.getOrgInfo);\n };\n $scope.init();\n }\n return OrgDetailsCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.controllers').controller('OrgDetailsCtrl', OrgDetailsCtrl);\n\n\n/***/ }),\n\n/***/ 2280:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export PrefsControlCtrl */\n/* unused harmony export prefsControlDirective */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_config__ = __webpack_require__(23);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_core_module__ = __webpack_require__(2);\n\n\nvar PrefsControlCtrl = /** @class */ (function () {\n /** @ngInject **/\n PrefsControlCtrl.$inject = [\"backendSrv\", \"$location\"];\n function PrefsControlCtrl(backendSrv, $location) {\n this.backendSrv = backendSrv;\n this.$location = $location;\n this.timezones = [\n { value: '', text: 'Default' },\n { value: 'browser', text: 'Local browser time' },\n { value: 'utc', text: 'UTC' },\n ];\n this.themes = [{ value: '', text: 'Default' }, { value: 'dark', text: 'Dark' }, { value: 'light', text: 'Light' }];\n }\n PrefsControlCtrl.prototype.$onInit = function () {\n var _this = this;\n return this.backendSrv.get(\"/api/\" + this.mode + \"/preferences\").then(function (prefs) {\n _this.prefs = prefs;\n _this.oldTheme = prefs.theme;\n });\n };\n PrefsControlCtrl.prototype.updatePrefs = function () {\n var _this = this;\n if (!this.prefsForm.$valid) {\n return;\n }\n var cmd = {\n theme: this.prefs.theme,\n timezone: this.prefs.timezone,\n homeDashboardId: this.prefs.homeDashboardId,\n };\n this.backendSrv.put(\"/api/\" + this.mode + \"/preferences\", cmd).then(function () {\n window.location.href = __WEBPACK_IMPORTED_MODULE_0_app_core_config__[\"a\" /* default */].appSubUrl + _this.$location.path();\n });\n };\n return PrefsControlCtrl;\n}());\n\nvar template = \"\\n\\n

    Preferences

    \\n\\n
    \\n \\n
    \\n \\n
    \\n
    \\n\\n
    \\n \\n
    \\n\\n\";\nfunction prefsControlDirective() {\n return {\n restrict: 'E',\n controller: PrefsControlCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n template: template,\n scope: {\n mode: '@',\n },\n };\n}\n__WEBPACK_IMPORTED_MODULE_1_app_core_core_module__[\"a\" /* default */].directive('prefsControl', prefsControlDirective);\n\n\n/***/ }),\n\n/***/ 2281:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export AdminStatsCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__admin_list_users_ctrl__ = __webpack_require__(2282);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__admin_list_orgs_ctrl__ = __webpack_require__(2283);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__admin_edit_org_ctrl__ = __webpack_require__(2284);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__admin_edit_user_ctrl__ = __webpack_require__(2285);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__admin_list_experiments_ctrl__ = __webpack_require__(2286);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5_app_core_core_module__ = __webpack_require__(2);\n\n\n\n\n\n\nvar AdminSettingsCtrl = /** @class */ (function () {\n /** @ngInject **/\n AdminSettingsCtrl.$inject = [\"$scope\", \"backendSrv\", \"navModelSrv\"];\n function AdminSettingsCtrl($scope, backendSrv, navModelSrv) {\n this.navModel = navModelSrv.getNav('cfg', 'admin', 'server-settings', 1);\n backendSrv.get('/api/admin/settings').then(function (settings) {\n $scope.settings = settings;\n });\n }\n return AdminSettingsCtrl;\n}());\nvar AdminHomeCtrl = /** @class */ (function () {\n /** @ngInject **/\n AdminHomeCtrl.$inject = [\"navModelSrv\"];\n function AdminHomeCtrl(navModelSrv) {\n this.navModel = navModelSrv.getNav('cfg', 'admin', 1);\n }\n return AdminHomeCtrl;\n}());\nvar AdminStatsCtrl = /** @class */ (function () {\n /** @ngInject */\n AdminStatsCtrl.$inject = [\"backendSrv\", \"navModelSrv\"];\n function AdminStatsCtrl(backendSrv, navModelSrv) {\n var _this = this;\n this.navModel = navModelSrv.getNav('cfg', 'admin', 'server-stats', 1);\n backendSrv.get('/api/admin/stats').then(function (stats) {\n _this.stats = stats;\n });\n }\n return AdminStatsCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_5_app_core_core_module__[\"a\" /* default */].controller('AdminSettingsCtrl', AdminSettingsCtrl);\n__WEBPACK_IMPORTED_MODULE_5_app_core_core_module__[\"a\" /* default */].controller('AdminHomeCtrl', AdminHomeCtrl);\n__WEBPACK_IMPORTED_MODULE_5_app_core_core_module__[\"a\" /* default */].controller('AdminStatsCtrl', AdminStatsCtrl);\n__WEBPACK_IMPORTED_MODULE_5_app_core_core_module__[\"a\" /* default */].controller('AdminListUsersCtrl', __WEBPACK_IMPORTED_MODULE_0__admin_list_users_ctrl__[\"a\" /* default */]);\n\n\n/***/ }),\n\n/***/ 2282:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar AdminListUsersCtrl = /** @class */ (function () {\n /** @ngInject */\n AdminListUsersCtrl.$inject = [\"$scope\", \"backendSrv\", \"navModelSrv\", \"$window\"];\n function AdminListUsersCtrl($scope, backendSrv, navModelSrv, $window) {\n this.$scope = $scope;\n this.backendSrv = backendSrv;\n this.$window = $window;\n this.pages = [];\n this.perPage = 50;\n this.page = 1;\n this.showPaging = false;\n this.navModel = navModelSrv.getNav('cfg', 'admin', 'global-users', 1);\n this.query = '';\n this.getUsers();\n }\n AdminListUsersCtrl.prototype.getUsers = function () {\n var _this = this;\n this.backendSrv\n .get(\"/api/users/search?perpage=\" + this.perPage + \"&page=\" + this.page + \"&query=\" + this.query)\n .then(function (result) {\n _this.users = result.users;\n _this.page = result.page;\n _this.perPage = result.perPage;\n _this.totalPages = Math.ceil(result.totalCount / result.perPage);\n _this.showPaging = _this.totalPages > 1;\n _this.pages = [];\n for (var i = 1; i < _this.totalPages + 1; i++) {\n _this.pages.push({ page: i, current: i === _this.page });\n }\n });\n };\n AdminListUsersCtrl.prototype.navigateToPage = function (page) {\n this.page = page.page;\n this.getUsers();\n };\n AdminListUsersCtrl.prototype.impersonate = function (user) {\n var _this = this;\n this.backendSrv.post('/admin/impersonate', { email: user.email }).then(function (result) {\n _this.$window.location.reload();\n });\n };\n AdminListUsersCtrl.prototype.deleteUser = function (user) {\n var _this = this;\n this.$scope.appEvent('confirm-modal', {\n title: 'Delete',\n text: 'Do you want to delete ' + user.login + '?',\n icon: 'fa-trash',\n yesText: 'Delete',\n onConfirm: function () {\n _this.backendSrv.delete('/api/admin/users/' + user.id).then(function () {\n _this.getUsers();\n });\n },\n });\n };\n return AdminListUsersCtrl;\n}());\n/* harmony default export */ __webpack_exports__[\"a\"] = (AdminListUsersCtrl);\n\n\n/***/ }),\n\n/***/ 2283:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export AdminListOrgsCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n\nvar AdminListOrgsCtrl = /** @class */ (function () {\n /** @ngInject */\n AdminListOrgsCtrl.$inject = [\"$scope\", \"backendSrv\", \"navModelSrv\"];\n function AdminListOrgsCtrl($scope, backendSrv, navModelSrv) {\n $scope.init = function () {\n $scope.navModel = navModelSrv.getNav('cfg', 'admin', 'global-orgs', 1);\n $scope.getOrgs();\n };\n $scope.getOrgs = function () {\n backendSrv.get('/api/orgs').then(function (orgs) {\n $scope.orgs = orgs;\n });\n };\n $scope.deleteOrg = function (org) {\n $scope.appEvent('confirm-modal', {\n title: 'Delete',\n text: 'Do you want to delete organization ' + org.name + '?',\n text2: 'ALL DATA (including sensor data from InfluxDB) for this organization will be removed!',\n icon: 'fa-trash',\n yesText: 'Delete',\n onConfirm: function () {\n backendSrv.delete('/api/orgs/' + org.id).then(function () {\n $scope.getOrgs();\n });\n },\n });\n };\n $scope.init();\n }\n return AdminListOrgsCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.controllers').controller('AdminListOrgsCtrl', AdminListOrgsCtrl);\n\n\n/***/ }),\n\n/***/ 2284:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export AdminEditOrgCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n\nvar AdminEditOrgCtrl = /** @class */ (function () {\n /** @ngInject */\n AdminEditOrgCtrl.$inject = [\"$scope\", \"$routeParams\", \"backendSrv\", \"$location\", \"navModelSrv\"];\n function AdminEditOrgCtrl($scope, $routeParams, backendSrv, $location, navModelSrv) {\n $scope.init = function () {\n $scope.navModel = navModelSrv.getNav('cfg', 'admin', 'global-orgs', 1);\n if ($routeParams.id) {\n $scope.getOrg($routeParams.id);\n $scope.getOrgUsers($routeParams.id);\n }\n };\n $scope.getOrg = function (id) {\n backendSrv.get('/api/orgs/' + id).then(function (org) {\n $scope.org = org;\n });\n };\n $scope.getOrgUsers = function (id) {\n backendSrv.get('/api/orgs/' + id + '/users').then(function (orgUsers) {\n $scope.orgUsers = orgUsers;\n });\n };\n $scope.update = function () {\n if (!$scope.orgDetailsForm.$valid) {\n return;\n }\n backendSrv.put('/api/orgs/' + $scope.org.id, $scope.org).then(function () {\n $location.path('/admin/orgs');\n });\n };\n $scope.updateOrgUser = function (orgUser) {\n backendSrv.patch('/api/orgs/' + orgUser.orgId + '/users/' + orgUser.userId, orgUser);\n };\n $scope.removeOrgUser = function (orgUser) {\n backendSrv.delete('/api/orgs/' + orgUser.orgId + '/users/' + orgUser.userId).then(function () {\n $scope.getOrgUsers($scope.org.id);\n });\n };\n $scope.init();\n }\n return AdminEditOrgCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.controllers').controller('AdminEditOrgCtrl', AdminEditOrgCtrl);\n\n\n/***/ }),\n\n/***/ 2285:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export AdminEditUserCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);\n\n\nvar AdminEditUserCtrl = /** @class */ (function () {\n /** @ngInject */\n AdminEditUserCtrl.$inject = [\"$scope\", \"$routeParams\", \"backendSrv\", \"$location\", \"navModelSrv\"];\n function AdminEditUserCtrl($scope, $routeParams, backendSrv, $location, navModelSrv) {\n $scope.user = {};\n $scope.newOrg = { name: '', role: 'Editor' };\n $scope.permissions = {};\n $scope.navModel = navModelSrv.getNav('cfg', 'admin', 'global-users', 1);\n $scope.init = function () {\n if ($routeParams.id) {\n $scope.getUser($routeParams.id);\n $scope.getUserOrgs($routeParams.id);\n }\n };\n $scope.getUser = function (id) {\n backendSrv.get('/api/users/' + id).then(function (user) {\n $scope.user = user;\n $scope.user_id = id;\n $scope.permissions.isGrafanaAdmin = user.isGrafanaAdmin;\n });\n };\n $scope.setPassword = function () {\n if (!$scope.passwordForm.$valid) {\n return;\n }\n var payload = { password: $scope.password };\n backendSrv.put('/api/admin/users/' + $scope.user_id + '/password', payload).then(function () {\n $location.path('/admin/users');\n });\n };\n $scope.updatePermissions = function () {\n var payload = $scope.permissions;\n backendSrv.put('/api/admin/users/' + $scope.user_id + '/permissions', payload).then(function () {\n $location.path('/admin/users');\n });\n };\n $scope.create = function () {\n if (!$scope.userForm.$valid) {\n return;\n }\n backendSrv.post('/api/admin/users', $scope.user).then(function () {\n $location.path('/admin/users');\n });\n };\n $scope.getUserOrgs = function (id) {\n backendSrv.get('/api/users/' + id + '/orgs').then(function (orgs) {\n $scope.orgs = orgs;\n });\n };\n $scope.update = function () {\n if (!$scope.userForm.$valid) {\n return;\n }\n backendSrv.put('/api/users/' + $scope.user_id, $scope.user).then(function () {\n $location.path('/admin/users');\n });\n };\n $scope.updateOrgUser = function (orgUser) {\n backendSrv.patch('/api/orgs/' + orgUser.orgId + '/users/' + $scope.user_id, orgUser).then(function () { });\n };\n $scope.removeOrgUser = function (orgUser) {\n backendSrv.delete('/api/orgs/' + orgUser.orgId + '/users/' + $scope.user_id).then(function () {\n $scope.getUser($scope.user_id);\n $scope.getUserOrgs($scope.user_id);\n });\n };\n $scope.orgsSearchCache = [];\n $scope.searchOrgs = function (queryStr, callback) {\n if ($scope.orgsSearchCache.length > 0) {\n callback(__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map($scope.orgsSearchCache, 'name'));\n return;\n }\n backendSrv.get('/api/orgs', { query: '' }).then(function (result) {\n $scope.orgsSearchCache = result;\n callback(__WEBPACK_IMPORTED_MODULE_1_lodash___default.a.map(result, 'name'));\n });\n };\n $scope.addOrgUser = function () {\n if (!$scope.addOrgForm.$valid) {\n return;\n }\n var orgInfo = __WEBPACK_IMPORTED_MODULE_1_lodash___default.a.find($scope.orgsSearchCache, {\n name: $scope.newOrg.name,\n });\n if (!orgInfo) {\n return;\n }\n $scope.newOrg.loginOrEmail = $scope.user.login;\n backendSrv.post('/api/orgs/' + orgInfo.id + '/users/', $scope.newOrg).then(function () {\n $scope.getUser($scope.user_id);\n $scope.getUserOrgs($scope.user_id);\n });\n };\n $scope.init();\n }\n return AdminEditUserCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.controllers').controller('AdminEditUserCtrl', AdminEditUserCtrl);\n\n\n/***/ }),\n\n/***/ 2286:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export AdminListExperimentsCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_angular___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_angular__);\n\nvar AdminListExperimentsCtrl = /** @class */ (function () {\n /** @ngInject */\n AdminListExperimentsCtrl.$inject = [\"$scope\", \"backendSrv\", \"navModelSrv\", \"$window\"];\n function AdminListExperimentsCtrl($scope, backendSrv, navModelSrv, $window) {\n this.backendSrv = backendSrv;\n this.$window = $window;\n $scope.init = function () {\n $scope.navModel = navModelSrv.getNav('cfg', 'admin', 'global-experiments', 1);\n $scope.getExperiments();\n };\n $scope.getExperiments = function () {\n backendSrv.get('/api/experiments?limit=300').then(function (response) {\n $scope.experiments = response.results;\n });\n };\n $scope.init();\n }\n AdminListExperimentsCtrl.prototype.impersonate = function (email) {\n var _this = this;\n this.backendSrv.post('/admin/impersonate', { email: email }).then(function (result) {\n _this.$window.location.reload();\n });\n };\n return AdminListExperimentsCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_angular___default.a.module('grafana.controllers').controller('AdminListExperimentsCtrl', AdminListExperimentsCtrl);\n\n\n/***/ }),\n\n/***/ 2287:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__notifications_list_ctrl__ = __webpack_require__(2288);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__notification_edit_ctrl__ = __webpack_require__(2289);\n\n\n\n\n/***/ }),\n\n/***/ 2288:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export AlertNotificationsListCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_core__ = __webpack_require__(197);\n\nvar AlertNotificationsListCtrl = /** @class */ (function () {\n /** @ngInject */\n AlertNotificationsListCtrl.$inject = [\"backendSrv\", \"navModelSrv\"];\n function AlertNotificationsListCtrl(backendSrv, navModelSrv) {\n this.backendSrv = backendSrv;\n this.loadNotifications();\n this.navModel = navModelSrv.getNav('alerting', 'channels', 0);\n }\n AlertNotificationsListCtrl.prototype.loadNotifications = function () {\n var _this = this;\n this.backendSrv.get(\"/api/alert-notifications\").then(function (result) {\n _this.notifications = result;\n });\n };\n AlertNotificationsListCtrl.prototype.deleteNotification = function (id) {\n var _this = this;\n this.backendSrv.delete(\"/api/alert-notifications/\" + id).then(function () {\n _this.notifications = _this.notifications.filter(function (notification) {\n return notification.id !== id;\n });\n });\n };\n return AlertNotificationsListCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_0_app_core_core__[\"d\" /* coreModule */].controller('AlertNotificationsListCtrl', AlertNotificationsListCtrl);\n\n\n/***/ }),\n\n/***/ 2289:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export AlertNotificationEditCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_core__ = __webpack_require__(197);\n\n\nvar AlertNotificationEditCtrl = /** @class */ (function () {\n /** @ngInject */\n AlertNotificationEditCtrl.$inject = [\"$routeParams\", \"backendSrv\", \"$location\", \"$templateCache\", \"navModelSrv\"];\n function AlertNotificationEditCtrl($routeParams, backendSrv, $location, $templateCache, navModelSrv) {\n var _this = this;\n this.$routeParams = $routeParams;\n this.backendSrv = backendSrv;\n this.$location = $location;\n this.$templateCache = $templateCache;\n this.testSeverity = 'critical';\n this.defaults = {\n type: 'email',\n settings: {\n httpMethod: 'POST',\n autoResolve: true,\n uploadImage: true,\n },\n isDefault: false,\n };\n this.navModel = navModelSrv.getNav('alerting', 'channels', 0);\n this.isNew = !this.$routeParams.id;\n this.backendSrv\n .get(\"/api/alert-notifiers\")\n .then(function (notifiers) {\n _this.notifiers = notifiers;\n // add option templates\n for (var _i = 0, _a = _this.notifiers; _i < _a.length; _i++) {\n var notifier = _a[_i];\n _this.$templateCache.put(_this.getNotifierTemplateId(notifier.type), notifier.optionsTemplate);\n }\n if (!_this.$routeParams.id) {\n _this.navModel.breadcrumbs.push({ text: 'New channel' });\n _this.navModel.node = { text: 'New channel' };\n return __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.defaults(_this.model, _this.defaults);\n }\n return _this.backendSrv.get(\"/api/alert-notifications/\" + _this.$routeParams.id).then(function (result) {\n _this.navModel.breadcrumbs.push({ text: result.name });\n _this.navModel.node = { text: result.name };\n result.settings = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.defaults(result.settings, _this.defaults.settings);\n return result;\n });\n })\n .then(function (model) {\n _this.model = model;\n _this.notifierTemplateId = _this.getNotifierTemplateId(_this.model.type);\n });\n }\n AlertNotificationEditCtrl.prototype.save = function () {\n var _this = this;\n if (!this.theForm.$valid) {\n return;\n }\n if (this.model.id) {\n this.backendSrv\n .put(\"/api/alert-notifications/\" + this.model.id, this.model)\n .then(function (res) {\n _this.model = res;\n __WEBPACK_IMPORTED_MODULE_1_app_core_core__[\"b\" /* appEvents */].emit('alert-success', ['Notification updated', '']);\n })\n .catch(function (err) {\n if (err.data && err.data.error) {\n __WEBPACK_IMPORTED_MODULE_1_app_core_core__[\"b\" /* appEvents */].emit('alert-error', [err.data.error]);\n }\n });\n }\n else {\n this.backendSrv\n .post(\"/api/alert-notifications\", this.model)\n .then(function (res) {\n __WEBPACK_IMPORTED_MODULE_1_app_core_core__[\"b\" /* appEvents */].emit('alert-success', ['Notification created', '']);\n _this.$location.path('alerting/notifications');\n })\n .catch(function (err) {\n if (err.data && err.data.error) {\n __WEBPACK_IMPORTED_MODULE_1_app_core_core__[\"b\" /* appEvents */].emit('alert-error', [err.data.error]);\n }\n });\n }\n };\n AlertNotificationEditCtrl.prototype.getNotifierTemplateId = function (type) {\n return \"notifier-options-\" + type;\n };\n AlertNotificationEditCtrl.prototype.typeChanged = function () {\n this.model.settings = __WEBPACK_IMPORTED_MODULE_0_lodash___default.a.defaults({}, this.defaults.settings);\n this.notifierTemplateId = this.getNotifierTemplateId(this.model.type);\n };\n AlertNotificationEditCtrl.prototype.testNotification = function () {\n if (!this.theForm.$valid) {\n return;\n }\n var payload = {\n name: this.model.name,\n type: this.model.type,\n settings: this.model.settings,\n };\n this.backendSrv.post(\"/api/alert-notifications/test\", payload).then(function (res) {\n __WEBPACK_IMPORTED_MODULE_1_app_core_core__[\"b\" /* appEvents */].emit('alert-success', ['Test notification sent', '']);\n });\n };\n return AlertNotificationEditCtrl;\n}());\n\n__WEBPACK_IMPORTED_MODULE_1_app_core_core__[\"d\" /* coreModule */].controller('AlertNotificationEditCtrl', AlertNotificationEditCtrl);\n\n\n/***/ }),\n\n/***/ 2290:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_core_module__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_config__ = __webpack_require__(23);\n\n\nvar StyleGuideCtrl = /** @class */ (function () {\n /** @ngInject **/\n StyleGuideCtrl.$inject = [\"$routeParams\", \"backendSrv\", \"navModelSrv\"];\n function StyleGuideCtrl($routeParams, backendSrv, navModelSrv) {\n this.$routeParams = $routeParams;\n this.backendSrv = backendSrv;\n this.buttonNames = ['primary', 'secondary', 'inverse', 'success', 'warning', 'danger'];\n this.buttonSizes = ['btn-small', '', 'btn-large'];\n this.buttonVariants = ['-'];\n this.navModel = navModelSrv.getNav('cfg', 'admin', 'styleguide', 1);\n this.theme = __WEBPACK_IMPORTED_MODULE_1_app_core_config__[\"a\" /* default */].bootData.user.lightTheme ? 'light' : 'dark';\n }\n StyleGuideCtrl.prototype.switchTheme = function () {\n this.$routeParams.theme = this.theme === 'dark' ? 'light' : 'dark';\n var cmd = {\n theme: this.$routeParams.theme,\n };\n this.backendSrv.put('/api/user/preferences', cmd).then(function () {\n window.location.href = window.location.href;\n });\n };\n return StyleGuideCtrl;\n}());\n__WEBPACK_IMPORTED_MODULE_0_app_core_core_module__[\"a\" /* default */].controller('StyleGuideCtrl', StyleGuideCtrl);\n\n\n/***/ }),\n\n/***/ 2291:\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export UploadCtrl */\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_app_core_app_events__ = __webpack_require__(22);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_app_core_store__ = __webpack_require__(77);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_app_core_core_module__ = __webpack_require__(2);\n\n\n\nvar TIME_UNITS = [\n { text: 'Seconds', short: 's' },\n { text: 'Milliseconds', short: 'ms' },\n { text: 'Microseconds', short: 'us' },\n { text: 'Nanoseconds', short: 'ns' },\n];\nvar TIME_UNITS_COMPATIBLE_MODE = [\n { text: 'Timestamp (hh:mm:ss)', short: 'timestamp' },\n];\nvar TIME_UNITS_CLI = [\n { text: 'RFC3339 (2020-01-01T00:00:00Z)', short: 'RFC3339' },\n { text: 'RFC3339Nano (2020-01-01T00:00:00.000000000Z)', short: 'RFC3339Nano' },\n];\n/*\n * UPLOADER CONTROLLER\n *\n * Flow:\n * - Select file in UI\n * - fileSelected() or dropHandler() is called\n * - validateFile() checks for empty file and extracts file name\n * - startUpload() is called\n * - creates an upload object in backend\n * - starts uploading file over xhr\n * - checkStatus() is called. if status is:\n * - 'created' or 'started', check again later\n * - 'parse_error', show error, bail\n * - 'parsed' and type is 'csv'; read column names from response\n * for time column selection. Load previous config.\n * - Import config UI is shown to the user, user clicks \"import\"\n * - If file is CSV\n * - send importConfig via PUT on upload object\n * - save config to local browser\n * - call startImport()\n * - If file is TDMS, same, different importconfig though\n * - startImport() start the import on backend, start import monitoring task.\n * - monitorImportProgress(), check status is:\n * - 'error' show error and bail\n * - 'importing' show progress (exp. back-off)\n * - 'done' call importComplete()\n * - importComplete() creates dashboards, and redirects to it\n */\nvar UploadCtrl = /** @class */ (function () {\n /** @ngInject */\n UploadCtrl.$inject = [\"backendSrv\", \"$scope\", \"$timeout\", \"alertSrv\", \"$location\", \"$window\"];\n function UploadCtrl(backendSrv, $scope, $timeout, alertSrv, $location, $window) {\n this.backendSrv = backendSrv;\n this.$scope = $scope;\n this.$timeout = $timeout;\n this.alertSrv = alertSrv;\n this.$location = $location;\n this.$window = $window;\n this.uploadProgressPercent = 0;\n this.importProgressPercent = 0;\n this.timeUnit = TIME_UNITS[0];\n this.timeUnits = TIME_UNITS;\n this.createDashboard = true;\n this.timeOffset = '0';\n this.monitorImportProgressIntervalMs = 1000;\n this.statusCheckIntervalMs = 500;\n this.compatibleMode = false;\n this.generateTimestamps = false;\n }\n UploadCtrl.prototype.fileSelected = function () {\n this.validateFile(this.fileArray[0]);\n };\n UploadCtrl.prototype.dropHandler = function () {\n this.validateFile(this.fileDrop);\n };\n UploadCtrl.prototype.validateFile = function (file) {\n if (file.size <= 0) {\n this.alertSrv.set('File is empty.', null, 'warning', 10000);\n return;\n }\n this.file = file;\n var dotIndex = this.file.name.lastIndexOf('.');\n this.experimentTitle = this.file.name.substr(0, dotIndex);\n this.startUpload();\n };\n UploadCtrl.prototype.startUpload = function () {\n var _this = this;\n this.isUploading = true;\n this.uploadProgressPercent = 0;\n this.uploadProgressText = '';\n this.importProgressPercent = 0;\n this.importProgressText = '';\n var options = {\n method: 'POST',\n url: '/api/uploads',\n showSuccessAlert: false,\n data: {\n totalBytes: this.file.size,\n },\n };\n this.backendSrv.request(options).then(function (result) {\n _this.uploadId = result.id;\n _this.upload();\n _this.checkStatus(result.id);\n });\n };\n UploadCtrl.prototype.checkStatus = function (id) {\n var _this = this;\n this.$timeout(function () {\n _this.backendSrv.get(\"/api/uploads/\" + id).then(function (result) {\n console.log('checkStatus:', result);\n var previousStatus = _this.serverStatus;\n _this.serverStatus = result.upload.status;\n _this.uploadType = result.upload.type;\n if (_this.serverStatus === 'created' || _this.serverStatus === 'started') {\n if (previousStatus === _this.serverStatus) {\n if (_this.statusCheckIntervalMs < 8000) {\n _this.statusCheckIntervalMs *= 2; // back off\n }\n }\n else {\n _this.statusCheckIntervalMs = 1000;\n }\n _this.checkStatus(id); // check again later\n return;\n }\n else if (_this.serverStatus === 'parse_error') {\n console.log('PARSER ERROR', result);\n _this.alertSrv.set('Error processing CSV', result.upload.errorMessage, 'warning', 10000);\n _this.uploadError = result.upload.errorMessage;\n }\n else if (result.upload.type === 'csv' && _this.serverStatus === 'parsed') {\n _this.csvHeaderLine = result.header[0];\n _this.csvFirstTen = result.header.slice(1);\n _this.timeColumnOptions = [];\n for (var index in result.header[0]) {\n _this.timeColumnOptions.push({ index: index, value: result.header[0][index] });\n }\n _this.loadConfig(); // load previous form settings\n _this.setupTimeUnits();\n }\n else if (result.upload.type === 'tdms' && _this.serverStatus === 'parsed') {\n _this.parseResult = result.upload.parseResult;\n var commonFrequency = null;\n for (var _i = 0, _a = _this.parseResult; _i < _a.length; _i++) {\n var channel = _a[_i];\n if (commonFrequency === null) {\n commonFrequency = channel.frequencyHz;\n }\n else if (commonFrequency !== channel.frequencyHz) {\n commonFrequency = 0;\n break;\n }\n }\n _this.sampleFrequency = commonFrequency;\n console.log('Parse result: ', _this.parseResult);\n }\n });\n }, this.statusCheckIntervalMs);\n };\n UploadCtrl.prototype.upload = function () {\n var _this = this;\n var xhr = new XMLHttpRequest();\n if (xhr.upload) {\n xhr.upload.onload = function (e) {\n console.log('Upload complete');\n _this.$scope.$apply(function () {\n _this.uploadProgressText = \"Upload complete.\";\n });\n };\n xhr.upload.onprogress = function (e) {\n var percent = Math.ceil(e.loaded / e.total * 100);\n _this.$scope.$apply(function () {\n _this.uploadProgressPercent = percent;\n _this.uploadProgressText = \"Uploading \" + percent + \"%\";\n });\n };\n xhr.open('POST', '/api/uploads/' + this.uploadId + '/data', true);\n xhr.send(this.file);\n }\n xhr.onreadystatechange = function () {\n if (xhr.status === 412 && xhr.response) {\n var result = JSON.parse(xhr.response);\n _this.alertSrv.set(result.message + '.', null, 'warning', 10000);\n _this.uploadError = result.message + '.';\n }\n };\n };\n UploadCtrl.prototype.importClicked = function () {\n this.isImporting = true;\n if (this.uploadType === 'tdms') {\n this.configureTdms();\n }\n else {\n this.configureCsv();\n }\n };\n UploadCtrl.prototype.configureCsv = function () {\n var _this = this;\n var importConfig = {\n title: this.experimentTitle,\n compatibleMode: this.compatibleMode,\n time: {\n unit: this.timeUnit.short,\n column: parseInt(this.timeColumn),\n frequency: parseFloat(this.sampleFrequency),\n offset: this.timeOffset,\n },\n };\n if (importConfig.time.column === -1) {\n if (isNaN(importConfig.time.frequency)) {\n this.alertSrv.set('Invalid frequency: ' + this.sampleFrequency, null, 'warning', 10000);\n return;\n }\n }\n this.saveConfig();\n this.message = 'Please keep the window open until your upload has finished...';\n var options = {\n method: 'PUT',\n url: \"/api/uploads/\" + this.uploadId,\n data: { importConfig: importConfig },\n showSuccessAlert: false,\n };\n this.backendSrv.request(options).then(function (result) {\n _this.startImport();\n });\n };\n UploadCtrl.prototype.validateTdms = function () {\n var freq = this.sampleFrequency.toString().trim();\n if (freq.length === 0) {\n this.alertSrv.set('Please specify a sample rate.', 'warning', 10000);\n return false;\n }\n var match = freq.match(/(\\d+)/);\n if (!match) {\n this.alertSrv.set('Invalid sample rate: ' + this.sampleFrequency, null, 'warning', 10000);\n return false;\n }\n var frequencyHz = parseFloat(match[1]);\n console.log('final freq', frequencyHz);\n if (frequencyHz === 0) {\n this.alertSrv.set('Please specify a sample rate.', null, 'warning', 10000);\n return false;\n }\n for (var _i = 0, _a = this.parseResult; _i < _a.length; _i++) {\n var channel = _a[_i];\n channel.frequencyHz = frequencyHz;\n }\n return true;\n };\n UploadCtrl.prototype.configureTdms = function () {\n var _this = this;\n if (!this.validateTdms()) {\n this.isImporting = false;\n return;\n }\n var channelConfig = {};\n for (var _i = 0, _a = this.parseResult; _i < _a.length; _i++) {\n var channel = _a[_i];\n channelConfig[channel.path] = channel;\n }\n var options = {\n method: 'PUT',\n url: \"/api/uploads/\" + this.uploadId,\n data: { importConfig: { experimentTitle: this.experimentTitle, channels: channelConfig } },\n showSuccessAlert: false,\n };\n this.backendSrv.request(options).then(function (result) {\n _this.startImport();\n });\n };\n UploadCtrl.prototype.startImport = function () {\n var _this = this;\n this.backendSrv.post(\"/api/uploads/\" + this.uploadId + \"/startimport\").then(function (result) {\n console.log('Import started');\n _this.monitorImportProgress();\n }, function (err) {\n console.log(err);\n _this.message = 'An error occured during import.';\n });\n };\n UploadCtrl.prototype.monitorImportProgress = function () {\n var _this = this;\n this.backendSrv.get(\"/api/uploads/\" + this.uploadId).then(function (result) {\n if (result.upload && result.upload.status === 'error') {\n _this.alertSrv.set('Error processing file', '', 'warning', 10000);\n _this.importProgressText = 'Error during import.';\n _this.message = 'Error during import: ' + result.upload.errorMessage;\n _this.isImporting = false;\n return;\n }\n if (result.upload.status === 'done') {\n _this.importComplete(result.upload);\n return;\n }\n if (result.upload.status === 'importing') {\n _this.importProgressText = \"Importing...\";\n var progress = result.upload.importProgress;\n console.log('Import progress', progress);\n if (progress) {\n // back off exponentially if no progress is detected\n _this.monitorImportProgressIntervalMs =\n _this.importProgressPercent === progress ? _this.monitorImportProgressIntervalMs * 2 : 1000;\n _this.importProgressPercent = progress;\n _this.importProgressText = \"Importing \" + _this.importProgressPercent.toFixed(0) + \"%\";\n if (progress >= 100) {\n _this.importComplete(result.upload);\n return;\n }\n }\n }\n _this.$timeout(_this.monitorImportProgress.bind(_this), _this.monitorImportProgressIntervalMs);\n });\n };\n UploadCtrl.prototype.importComplete = function (upload) {\n var _this = this;\n this.importProgressText = \"Import complete.\";\n this.importProgressPercent = 100;\n this.message = \"Import complete.\";\n var experimentId = upload.experimentId;\n __WEBPACK_IMPORTED_MODULE_0_app_core_app_events__[\"a\" /* default */].emit('refresh-sidepane');\n this.alertSrv.set('Import complete!', null, 'success', 10000);\n if (this.createDashboard) {\n this.backendSrv.post(\"/api/dashboards/for-experiment/\" + experimentId).then(function (result) {\n var url = \"/e/\" + experimentId + result.url;\n _this.message = 'Dashboard created. Redirecting in 3...';\n _this.$timeout(function () {\n _this.message = 'Dashboard created. Redirecting in 2...';\n }, 1000);\n _this.$timeout(function () {\n _this.message = 'Dashboard created. Redirecting in 1...';\n }, 2000);\n _this.$timeout(function () {\n _this.$location.url(url);\n }, 3000);\n });\n }\n };\n UploadCtrl.prototype.saveConfig = function () {\n var importConfig = {\n timeUnitShort: this.timeUnit.short,\n timeColumn: this.getTimeColumn(),\n sampleFrequency: this.sampleFrequency,\n timeOffset: this.timeOffset,\n compatibleMode: this.compatibleMode,\n };\n __WEBPACK_IMPORTED_MODULE_1_app_core_store__[\"a\" /* default */].set('csv_import_config', JSON.stringify(importConfig));\n };\n UploadCtrl.prototype.getTimeColumn = function () {\n if (this.timeColumn === '-1') {\n return { index: '-1' };\n }\n if (this.timeColumnOptions) {\n for (var _i = 0, _a = this.timeColumnOptions; _i < _a.length; _i++) {\n var element = _a[_i];\n if (element['index'] === this.timeColumn) {\n return element;\n }\n }\n }\n return null;\n };\n UploadCtrl.prototype.setTimeColumn = function (hash) {\n if (!hash) {\n return;\n }\n if (hash['index'] === '-1') {\n this.timeColumn = '-1';\n return;\n }\n if (this.timeColumnOptions) {\n for (var _i = 0, _a = this.timeColumnOptions; _i < _a.length; _i++) {\n var element = _a[_i];\n if (element['value'] === hash['value']) {\n this.timeColumn = element['index'];\n return;\n }\n }\n }\n };\n UploadCtrl.prototype.loadConfig = function () {\n if (!__WEBPACK_IMPORTED_MODULE_1_app_core_store__[\"a\" /* default */].exists('csv_import_config')) {\n return;\n }\n var configStr = __WEBPACK_IMPORTED_MODULE_1_app_core_store__[\"a\" /* default */].get('csv_import_config');\n if (!configStr) {\n return;\n }\n var config = JSON.parse(configStr);\n this.sampleFrequency = config.sampleFrequency;\n this.timeOffset = config.timeOffset;\n this.selectTimeUnit(config.timeUnitShort);\n this.setTimeColumn(config.timeColumn);\n this.compatibleMode = config.compatibleMode;\n };\n UploadCtrl.prototype.selectTimeUnit = function (short) {\n var candidates = TIME_UNITS.filter(function (unit) { return unit.short === short; });\n if (candidates.length > 0) {\n this.timeUnit = candidates[0];\n }\n else {\n console.log('Time unit not found: ' + short);\n }\n };\n UploadCtrl.prototype.reload = function () {\n this.$window.location.reload();\n };\n UploadCtrl.prototype.setupTimeUnits = function () {\n if (this.compatibleMode) {\n this.timeUnits = TIME_UNITS.concat(TIME_UNITS_COMPATIBLE_MODE);\n }\n else {\n this.timeUnits = TIME_UNITS.concat(TIME_UNITS_CLI);\n }\n };\n UploadCtrl.prototype.compatibleModeClicked = function () {\n this.setupTimeUnits();\n };\n return UploadCtrl;\n}());\n\nvar fileDrop = function () {\n return {\n require: 'ngModel',\n link: function postLink(scope, elem, attrs, ngModel) {\n elem.on('dragover', function (e) {\n e.originalEvent.preventDefault();\n });\n elem.on('drop', function (e) {\n var ev = e.originalEvent;\n ev.preventDefault();\n if (ev.dataTransfer.items) {\n for (var _i = 0, _a = ev.dataTransfer.items; _i < _a.length; _i++) {\n var item = _a[_i];\n if (item.kind === 'file') {\n var file = item.getAsFile();\n ngModel.$setViewValue(file);\n return;\n }\n }\n }\n else {\n for (var _b = 0, _c = ev.dataTransfer.files; _b < _c.length; _b++) {\n var file_1 = _c[_b];\n ngModel.$setViewValue(file_1);\n return;\n }\n }\n });\n },\n };\n};\nvar selectNgFiles = function () {\n return {\n require: 'ngModel',\n link: function postLink(scope, elem, attrs, ngModel) {\n elem.on('change', function (e) {\n var files = elem[0].files;\n ngModel.$setViewValue(files);\n });\n },\n };\n};\n__WEBPACK_IMPORTED_MODULE_2_app_core_core_module__[\"a\" /* default */].controller('UploadCtrl', UploadCtrl);\n__WEBPACK_IMPORTED_MODULE_2_app_core_core_module__[\"a\" /* default */].directive('selectNgFiles', selectNgFiles);\n__WEBPACK_IMPORTED_MODULE_2_app_core_core_module__[\"a\" /* default */].directive('fileDrop', fileDrop);\n__WEBPACK_IMPORTED_MODULE_2_app_core_core_module__[\"a\" /* default */].filter('stripquotes', function () {\n return function (input) {\n return input.replace(new RegExp(\"'\", 'g'), '');\n };\n});\n\n\n/***/ })\n\n});\n\n\n// WEBPACK FOOTER //\n// 0.89154e0f2714751e6227.js","import kbn from 'app/core/utils/kbn';\nimport { assignModelProperties } from 'app/core/utils/model_utils';\n\nexport interface Variable {\n setValue(option);\n updateOptions();\n dependsOn(variable);\n setValueFromUrl(urlValue);\n getValueForUrl();\n getSaveModel();\n}\n\nexport var variableTypes = {};\nexport { assignModelProperties };\n\nexport function containsVariable(...args: any[]) {\n var variableName = args[args.length - 1];\n var str = args[0] || '';\n\n for (var i = 1; i < args.length - 1; i++) {\n str += ' ' + args[i] || '';\n }\n\n variableName = kbn.regexEscape(variableName);\n var findVarRegex = new RegExp('\\\\$(' + variableName + ')(?:\\\\W|$)|\\\\[\\\\[(' + variableName + ')\\\\]\\\\]', 'g');\n var match = findVarRegex.exec(str);\n return match !== null;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/templating/variable.ts","/* Javascript plotting library for jQuery, version 0.8.3.\n\nCopyright (c) 2007-2014 IOLA and Ole Laursen.\nLicensed under the MIT license.\n\n*/\n\n// first an inline dependency, jquery.colorhelpers.js, we inline it here\n// for convenience\n\n/* Plugin for jQuery for working with colors.\n *\n * Version 1.1.\n *\n * Inspiration from jQuery color animation plugin by John Resig.\n *\n * Released under the MIT license by Ole Laursen, October 2009.\n *\n * Examples:\n *\n * $.color.parse(\"#fff\").scale('rgb', 0.25).add('a', -0.5).toString()\n * var c = $.color.extract($(\"#mydiv\"), 'background-color');\n * console.log(c.r, c.g, c.b, c.a);\n * $.color.make(100, 50, 25, 0.4).toString() // returns \"rgba(100,50,25,0.4)\"\n *\n * Note that .scale() and .add() return the same modified object\n * instead of making a new one.\n *\n * V. 1.1: Fix error handling so e.g. parsing an empty string does\n * produce a color rather than just crashing.\n */\n(function($){$.color={};$.color.make=function(r,g,b,a){var o={};o.r=r||0;o.g=g||0;o.b=b||0;o.a=a!=null?a:1;o.add=function(c,d){for(var i=0;i=1){return\"rgb(\"+[o.r,o.g,o.b].join(\",\")+\")\"}else{return\"rgba(\"+[o.r,o.g,o.b,o.a].join(\",\")+\")\"}};o.normalize=function(){function clamp(min,value,max){return valuemax?max:value}o.r=clamp(0,parseInt(o.r),255);o.g=clamp(0,parseInt(o.g),255);o.b=clamp(0,parseInt(o.b),255);o.a=clamp(0,o.a,1);return o};o.clone=function(){return $.color.make(o.r,o.b,o.g,o.a)};return o.normalize()};$.color.extract=function(elem,css){var c;do{c=elem.css(css).toLowerCase();if(c!=\"\"&&c!=\"transparent\")break;elem=elem.parent()}while(elem.length&&!$.nodeName(elem.get(0),\"body\"));if(c==\"rgba(0, 0, 0, 0)\")c=\"transparent\";return $.color.parse(c)};$.color.parse=function(str){var res,m=$.color.make;if(res=/rgb\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10));if(res=/rgba\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\s*\\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10),parseFloat(res[4]));if(res=/rgb\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55);if(res=/rgba\\(\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\s*\\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55,parseFloat(res[4]));if(res=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(str))return m(parseInt(res[1],16),parseInt(res[2],16),parseInt(res[3],16));if(res=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(str))return m(parseInt(res[1]+res[1],16),parseInt(res[2]+res[2],16),parseInt(res[3]+res[3],16));var name=$.trim(str).toLowerCase();if(name==\"transparent\")return m(255,255,255,0);else{res=lookupColors[name]||[0,0,0];return m(res[0],res[1],res[2])}};var lookupColors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);\n\n// the actual Flot code\n(function($) {\n\n\t// Cache the prototype hasOwnProperty for faster access\n\n\tvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\n // A shim to provide 'detach' to jQuery versions prior to 1.4. Using a DOM\n // operation produces the same effect as detach, i.e. removing the element\n // without touching its jQuery data.\n\n // Do not merge this into Flot 0.9, since it requires jQuery 1.4.4+.\n\n if (!$.fn.detach) {\n $.fn.detach = function() {\n return this.each(function() {\n if (this.parentNode) {\n this.parentNode.removeChild( this );\n }\n });\n };\n }\n\n\t///////////////////////////////////////////////////////////////////////////\n\t// The Canvas object is a wrapper around an HTML5 tag.\n\t//\n\t// @constructor\n\t// @param {string} cls List of classes to apply to the canvas.\n\t// @param {element} container Element onto which to append the canvas.\n\t//\n\t// Requiring a container is a little iffy, but unfortunately canvas\n\t// operations don't work unless the canvas is attached to the DOM.\n\n\tfunction Canvas(cls, container) {\n\n\t\tvar element = container.children(\".\" + cls)[0];\n\n\t\tif (element == null) {\n\n\t\t\telement = document.createElement(\"canvas\");\n\t\t\telement.className = cls;\n\n\t\t\t$(element).css({ direction: \"ltr\", position: \"absolute\", left: 0, top: 0 })\n\t\t\t\t.appendTo(container);\n\n\t\t\t// If HTML5 Canvas isn't available, fall back to [Ex|Flash]canvas\n\n\t\t\tif (!element.getContext) {\n\t\t\t\tif (window.G_vmlCanvasManager) {\n\t\t\t\t\telement = window.G_vmlCanvasManager.initElement(element);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(\"Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.element = element;\n\n\t\tvar context = this.context = element.getContext(\"2d\");\n\n\t\t// Determine the screen's ratio of physical to device-independent\n\t\t// pixels. This is the ratio between the canvas width that the browser\n\t\t// advertises and the number of pixels actually present in that space.\n\n\t\t// The iPhone 4, for example, has a device-independent width of 320px,\n\t\t// but its screen is actually 640px wide. It therefore has a pixel\n\t\t// ratio of 2, while most normal devices have a ratio of 1.\n\n\t\tvar devicePixelRatio = window.devicePixelRatio || 1,\n\t\t\tbackingStoreRatio =\n\t\t\t\tcontext.webkitBackingStorePixelRatio ||\n\t\t\t\tcontext.mozBackingStorePixelRatio ||\n\t\t\t\tcontext.msBackingStorePixelRatio ||\n\t\t\t\tcontext.oBackingStorePixelRatio ||\n\t\t\t\tcontext.backingStorePixelRatio || 1;\n\n\t\tthis.pixelRatio = devicePixelRatio / backingStoreRatio;\n\n\t\t// Size the canvas to match the internal dimensions of its container\n\n\t\tthis.resize(container.width(), container.height());\n\n\t\t// Collection of HTML div layers for text overlaid onto the canvas\n\n\t\tthis.textContainer = null;\n\t\tthis.text = {};\n\n\t\t// Cache of text fragments and metrics, so we can avoid expensively\n\t\t// re-calculating them when the plot is re-rendered in a loop.\n\n\t\tthis._textCache = {};\n\t\tthis._textSizeCache = window.flotTextSizeCache = window.flotTextSizeCache || {};\n\t}\n\n\t// Resizes the canvas to the given dimensions.\n\t//\n\t// @param {number} width New width of the canvas, in pixels.\n\t// @param {number} width New height of the canvas, in pixels.\n\n\tCanvas.prototype.resize = function(width, height) {\n\n\t\tif (width <= 0 || height <= 0) {\n\t\t\tthrow new Error(\"Invalid dimensions for plot, width = \" + width + \", height = \" + height);\n\t\t}\n\n\t\tvar element = this.element,\n\t\t\tcontext = this.context,\n\t\t\tpixelRatio = this.pixelRatio;\n\n\t\t// Resize the canvas, increasing its density based on the display's\n\t\t// pixel ratio; basically giving it more pixels without increasing the\n\t\t// size of its element, to take advantage of the fact that retina\n\t\t// displays have that many more pixels in the same advertised space.\n\n\t\t// Resizing should reset the state (excanvas seems to be buggy though)\n\n\t\tif (this.width != width) {\n\t\t\telement.width = width * pixelRatio;\n\t\t\telement.style.width = width + \"px\";\n\t\t\tthis.width = width;\n\t\t}\n\n\t\tif (this.height != height) {\n\t\t\telement.height = height * pixelRatio;\n\t\t\telement.style.height = height + \"px\";\n\t\t\tthis.height = height;\n\t\t}\n\n\t\t// Save the context, so we can reset in case we get replotted. The\n\t\t// restore ensure that we're really back at the initial state, and\n\t\t// should be safe even if we haven't saved the initial state yet.\n\n\t\tcontext.restore();\n\t\tcontext.save();\n\n\t\t// Scale the coordinate space to match the display density; so even though we\n\t\t// may have twice as many pixels, we still want lines and other drawing to\n\t\t// appear at the same size; the extra pixels will just make them crisper.\n\n\t\tcontext.scale(pixelRatio, pixelRatio);\n\t};\n\n\t// Clears the entire canvas area, not including any overlaid HTML text\n\n\tCanvas.prototype.clear = function() {\n\t\tthis.context.clearRect(0, 0, this.width, this.height);\n\t};\n\n\t// Finishes rendering the canvas, including managing the text overlay.\n\n\tCanvas.prototype.render = function() {\n\n\t\tvar cache = this._textCache;\n\n\t\t// For each text layer, add elements marked as active that haven't\n\t\t// already been rendered, and remove those that are no longer active.\n\n\t\tfor (var layerKey in cache) {\n\t\t\tif (hasOwnProperty.call(cache, layerKey)) {\n\n\t\t\t\tvar layer = this.getTextLayer(layerKey),\n\t\t\t\t\tlayerCache = cache[layerKey];\n\n\t\t\t\tlayer.hide();\n\n\t\t\t\tfor (var styleKey in layerCache) {\n\t\t\t\t\tif (hasOwnProperty.call(layerCache, styleKey)) {\n\t\t\t\t\t\tvar styleCache = layerCache[styleKey];\n\t\t\t\t\t\tfor (var key in styleCache) {\n\t\t\t\t\t\t\tif (hasOwnProperty.call(styleCache, key)) {\n\n\t\t\t\t\t\t\t\tvar positions = styleCache[key].positions;\n\n\t\t\t\t\t\t\t\tfor (var i = 0, position; position = positions[i]; i++) {\n\t\t\t\t\t\t\t\t\tif (position.active) {\n\t\t\t\t\t\t\t\t\t\tif (!position.rendered) {\n\t\t\t\t\t\t\t\t\t\t\tlayer.append(position.element);\n\t\t\t\t\t\t\t\t\t\t\tposition.rendered = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tpositions.splice(i--, 1);\n\t\t\t\t\t\t\t\t\t\tif (position.rendered) {\n\t\t\t\t\t\t\t\t\t\t\tposition.element.detach();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (positions.length == 0) {\n\t\t\t\t\t\t\t\t\tdelete styleCache[key];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlayer.show();\n\t\t\t}\n\t\t}\n\t};\n\n\t// Creates (if necessary) and returns the text overlay container.\n\t//\n\t// @param {string} classes String of space-separated CSS classes used to\n\t// uniquely identify the text layer.\n\t// @return {object} The jQuery-wrapped text-layer div.\n\n\tCanvas.prototype.getTextLayer = function(classes) {\n\n\t\tvar layer = this.text[classes];\n\n\t\t// Create the text layer if it doesn't exist\n\n\t\tif (layer == null) {\n\n\t\t\t// Create the text layer container, if it doesn't exist\n\n\t\t\tif (this.textContainer == null) {\n\t\t\t\tthis.textContainer = $(\"
    \")\n\t\t\t\t\t.css({\n\t\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t\tbottom: 0,\n\t\t\t\t\t\tright: 0,\n\t\t\t\t\t\t'font-size': \"smaller\",\n\t\t\t\t\t\tcolor: \"#545454\"\n\t\t\t\t\t})\n\t\t\t\t\t.insertAfter(this.element);\n\t\t\t}\n\n\t\t\tlayer = this.text[classes] = $(\"
    \")\n\t\t\t\t.addClass(classes)\n\t\t\t\t.css({\n\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\ttop: 0,\n\t\t\t\t\tleft: 0,\n\t\t\t\t\tbottom: 0,\n\t\t\t\t\tright: 0\n\t\t\t\t})\n\t\t\t\t.appendTo(this.textContainer);\n\t\t}\n\n\t\treturn layer;\n\t};\n\n\t// Creates (if necessary) and returns a text info object.\n\t//\n\t// The object looks like this:\n\t//\n\t// {\n\t// width: Width of the text's wrapper div.\n\t// height: Height of the text's wrapper div.\n\t// element: The jQuery-wrapped HTML div containing the text.\n\t// positions: Array of positions at which this text is drawn.\n\t// }\n\t//\n\t// The positions array contains objects that look like this:\n\t//\n\t// {\n\t// active: Flag indicating whether the text should be visible.\n\t// rendered: Flag indicating whether the text is currently visible.\n\t// element: The jQuery-wrapped HTML div containing the text.\n\t// x: X coordinate at which to draw the text.\n\t// y: Y coordinate at which to draw the text.\n\t// }\n\t//\n\t// Each position after the first receives a clone of the original element.\n\t//\n\t// The idea is that that the width, height, and general 'identity' of the\n\t// text is constant no matter where it is placed; the placements are a\n\t// secondary property.\n\t//\n\t// Canvas maintains a cache of recently-used text info objects; getTextInfo\n\t// either returns the cached element or creates a new entry.\n\t//\n\t// @param {string} layer A string of space-separated CSS classes uniquely\n\t// identifying the layer containing this text.\n\t// @param {string} text Text string to retrieve info for.\n\t// @param {(string|object)=} font Either a string of space-separated CSS\n\t// classes or a font-spec object, defining the text's font and style.\n\t// @param {number=} angle Angle at which to rotate the text, in degrees.\n\t// Angle is currently unused, it will be implemented in the future.\n\t// @param {number=} width Maximum width of the text before it wraps.\n\t// @return {object} a text info object.\n\n\tCanvas.prototype.getTextInfo = function(layer, text, font, angle, width) {\n\n\t\tvar textStyle, layerCache, styleCache, info;\n\n\t\t// Cast the value to a string, in case we were given a number or such\n\n\t\ttext = \"\" + text;\n\n\t\t// If the font is a font-spec object, generate a CSS font definition\n\n\t\tif (typeof font === \"object\") {\n\t\t\ttextStyle = font.style + \" \" + font.variant + \" \" + font.weight + \" \" + font.size + \"px/\" + font.lineHeight + \"px \" + font.family;\n\t\t} else {\n\t\t\ttextStyle = font;\n\t\t}\n\n\t\t// Retrieve (or create) the cache for the text's layer and styles\n\n\t\tlayerCache = this._textCache[layer];\n\n\t\tif (layerCache == null) {\n\t\t\tlayerCache = this._textCache[layer] = {};\n\t\t}\n\n\t\tstyleCache = layerCache[textStyle];\n\n\t\tif (styleCache == null) {\n\t\t\tstyleCache = layerCache[textStyle] = {};\n\t\t}\n\n\t\tinfo = styleCache[text];\n\n\t\t// If we can't find a matching element in our cache, create a new one\n\n\t\tif (info == null) {\n\n\t\t\tvar element = $(\"
    \").html(text)\n\t\t\t\t.css({\n\t\t\t\t\tposition: \"absolute\",\n\t\t\t\t\t'max-width': width,\n\t\t\t\t\ttop: -9999\n\t\t\t\t})\n\t\t\t\t.appendTo(this.getTextLayer(layer));\n\n\t\t\tif (typeof font === \"object\") {\n\t\t\t\telement.css({\n\t\t\t\t\tfont: textStyle,\n\t\t\t\t\tcolor: font.color\n\t\t\t\t});\n\t\t\t} else if (typeof font === \"string\") {\n\t\t\t\telement.addClass(font);\n\t\t\t}\n\n info = styleCache[text] = { element: element, positions: [] };\n\n var size = this._textSizeCache[text];\n\t\t\tif (size) {\n info.width = size.width;\n info.height = size.height;\n\t\t\t} else {\n info.width = element.outerWidth(true);\n info.height = element.outerHeight(true);\n this._textSizeCache[text] = { width: info.width, height: info.height };\n\t\t\t}\n\t\t\telement.detach();\n\t\t}\n\n\t\treturn info;\n\t};\n\n\t// Adds a text string to the canvas text overlay.\n\t//\n\t// The text isn't drawn immediately; it is marked as rendering, which will\n\t// result in its addition to the canvas on the next render pass.\n\t//\n\t// @param {string} layer A string of space-separated CSS classes uniquely\n\t// identifying the layer containing this text.\n\t// @param {number} x X coordinate at which to draw the text.\n\t// @param {number} y Y coordinate at which to draw the text.\n\t// @param {string} text Text string to draw.\n\t// @param {(string|object)=} font Either a string of space-separated CSS\n\t// classes or a font-spec object, defining the text's font and style.\n\t// @param {number=} angle Angle at which to rotate the text, in degrees.\n\t// Angle is currently unused, it will be implemented in the future.\n\t// @param {number=} width Maximum width of the text before it wraps.\n\t// @param {string=} halign Horizontal alignment of the text; either \"left\",\n\t// \"center\" or \"right\".\n\t// @param {string=} valign Vertical alignment of the text; either \"top\",\n\t// \"middle\" or \"bottom\".\n\n\tCanvas.prototype.addText = function(layer, x, y, text, font, angle, width, halign, valign) {\n\n\t\tvar info = this.getTextInfo(layer, text, font, angle, width),\n\t\t\tpositions = info.positions;\n\n\t\t// Tweak the div's position to match the text's alignment\n\n\t\tif (halign == \"center\") {\n\t\t\tx -= info.width / 2;\n\t\t} else if (halign == \"right\") {\n\t\t\tx -= info.width;\n\t\t}\n\n\t\tif (valign == \"middle\") {\n\t\t\ty -= info.height / 2;\n\t\t} else if (valign == \"bottom\") {\n\t\t\ty -= info.height;\n\t\t}\n\n\t\t// Determine whether this text already exists at this position.\n\t\t// If so, mark it for inclusion in the next render pass.\n\n\t\tfor (var i = 0, position; position = positions[i]; i++) {\n\t\t\tif (position.x == x && position.y == y) {\n\t\t\t\tposition.active = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// If the text doesn't exist at this position, create a new entry\n\n\t\t// For the very first position we'll re-use the original element,\n\t\t// while for subsequent ones we'll clone it.\n\n\t\tposition = {\n\t\t\tactive: true,\n\t\t\trendered: false,\n\t\t\telement: positions.length ? info.element.clone() : info.element,\n\t\t\tx: x,\n\t\t\ty: y\n\t\t};\n\n\t\tpositions.push(position);\n\n\t\t// Move the element to its final position within the container\n\n\t\tposition.element.css({\n\t\t\ttop: Math.round(y),\n\t\t\tleft: Math.round(x),\n\t\t\t'text-align': halign\t// In case the text wraps\n\t\t});\n\t};\n\n\t// Removes one or more text strings from the canvas text overlay.\n\t//\n\t// If no parameters are given, all text within the layer is removed.\n\t//\n\t// Note that the text is not immediately removed; it is simply marked as\n\t// inactive, which will result in its removal on the next render pass.\n\t// This avoids the performance penalty for 'clear and redraw' behavior,\n\t// where we potentially get rid of all text on a layer, but will likely\n\t// add back most or all of it later, as when redrawing axes, for example.\n\t//\n\t// @param {string} layer A string of space-separated CSS classes uniquely\n\t// identifying the layer containing this text.\n\t// @param {number=} x X coordinate of the text.\n\t// @param {number=} y Y coordinate of the text.\n\t// @param {string=} text Text string to remove.\n\t// @param {(string|object)=} font Either a string of space-separated CSS\n\t// classes or a font-spec object, defining the text's font and style.\n\t// @param {number=} angle Angle at which the text is rotated, in degrees.\n\t// Angle is currently unused, it will be implemented in the future.\n\n\tCanvas.prototype.removeText = function(layer, x, y, text, font, angle) {\n\t\tif (text == null) {\n\t\t\tvar layerCache = this._textCache[layer];\n\t\t\tif (layerCache != null) {\n\t\t\t\tfor (var styleKey in layerCache) {\n\t\t\t\t\tif (hasOwnProperty.call(layerCache, styleKey)) {\n\t\t\t\t\t\tvar styleCache = layerCache[styleKey];\n\t\t\t\t\t\tfor (var key in styleCache) {\n\t\t\t\t\t\t\tif (hasOwnProperty.call(styleCache, key)) {\n\t\t\t\t\t\t\t\tvar positions = styleCache[key].positions;\n\t\t\t\t\t\t\t\tfor (var i = 0, position; position = positions[i]; i++) {\n\t\t\t\t\t\t\t\t\tposition.active = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tvar positions = this.getTextInfo(layer, text, font, angle).positions;\n\t\t\tfor (var i = 0, position; position = positions[i]; i++) {\n\t\t\t\tif (position.x == x && position.y == y) {\n\t\t\t\t\tposition.active = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t///////////////////////////////////////////////////////////////////////////\n\t// The top-level container for the entire plot.\n\n function Plot(placeholder, data_, options_, plugins) {\n // data is on the form:\n // [ series1, series2 ... ]\n // where series is either just the data as [ [x1, y1], [x2, y2], ... ]\n // or { data: [ [x1, y1], [x2, y2], ... ], label: \"some label\", ... }\n\n var series = [],\n options = {\n // the color theme used for graphs\n colors: [\"#edc240\", \"#afd8f8\", \"#cb4b4b\", \"#4da74d\", \"#9440ed\"],\n legend: {\n show: true,\n noColumns: 1, // number of colums in legend table\n labelFormatter: null, // fn: string -> string\n labelBoxBorderColor: \"#ccc\", // border color for the little label boxes\n container: null, // container (as jQuery object) to put legend in, null means default on top of graph\n position: \"ne\", // position of default legend container within plot\n margin: 5, // distance from grid edge to default legend container within plot\n backgroundColor: null, // null means auto-detect\n backgroundOpacity: 0.85, // set to 0 to avoid background\n sorted: null // default to no legend sorting\n },\n xaxis: {\n show: null, // null = auto-detect, true = always, false = never\n position: \"bottom\", // or \"top\"\n mode: null, // null or \"time\"\n font: null, // null (derived from CSS in placeholder) or object like { size: 11, lineHeight: 13, style: \"italic\", weight: \"bold\", family: \"sans-serif\", variant: \"small-caps\" }\n color: null, // base color, labels, ticks\n tickColor: null, // possibly different color of ticks, e.g. \"rgba(0,0,0,0.15)\"\n transform: null, // null or f: number -> number to transform axis\n inverseTransform: null, // if transform is set, this should be the inverse function\n min: null, // min. value to show, null means set automatically\n max: null, // max. value to show, null means set automatically\n autoscaleMargin: null, // margin in % to add if auto-setting min/max\n ticks: null, // either [1, 3] or [[1, \"a\"], 3] or (fn: axis info -> ticks) or app. number of ticks for auto-ticks\n tickFormatter: null, // fn: number -> string\n labelWidth: null, // size of tick labels in pixels\n labelHeight: null,\n reserveSpace: null, // whether to reserve space even if axis isn't shown\n tickLength: null, // size in pixels of ticks, or \"full\" for whole line\n alignTicksWithAxis: null, // axis number or null for no sync\n tickDecimals: null, // no. of decimals, null means auto\n tickSize: null, // number or [number, \"unit\"]\n minTickSize: null // number or [number, \"unit\"]\n },\n yaxis: {\n autoscaleMargin: 0.02,\n position: \"left\" // or \"right\"\n },\n xaxes: [],\n yaxes: [],\n series: {\n points: {\n show: false,\n radius: 3,\n lineWidth: 2, // in pixels\n fill: true,\n fillColor: \"#ffffff\",\n symbol: \"circle\" // or callback\n },\n lines: {\n // we don't put in show: false so we can see\n // whether lines were actively disabled\n lineWidth: 2, // in pixels\n fill: false,\n fillColor: null,\n steps: false\n // Omit 'zero', so we can later default its value to\n // match that of the 'fill' option.\n },\n bars: {\n show: false,\n lineWidth: 2, // in pixels\n barWidth: 1, // in units of the x axis\n fill: true,\n fillColor: null,\n align: \"left\", // \"left\", \"right\", or \"center\"\n horizontal: false,\n zero: true\n },\n shadowSize: 3,\n highlightColor: null\n },\n grid: {\n show: true,\n aboveData: false,\n color: \"#545454\", // primary color used for outline and labels\n backgroundColor: null, // null for transparent, else color\n borderColor: null, // set if different from the grid color\n tickColor: null, // color for the ticks, e.g. \"rgba(0,0,0,0.15)\"\n margin: 0, // distance from the canvas edge to the grid\n labelMargin: 5, // in pixels\n eventSectionHeight: 0, // space for event section\n axisMargin: 8, // in pixels\n borderWidth: 2, // in pixels\n minBorderMargin: null, // in pixels, null means taken from points radius\n markings: null, // array of ranges or fn: axes -> array of ranges\n markingsColor: \"#f4f4f4\",\n markingsLineWidth: 2,\n // interactive stuff\n clickable: false,\n hoverable: false,\n autoHighlight: true, // highlight in case mouse is near\n mouseActiveRadius: 10 // how far the mouse can be away to activate an item\n },\n interaction: {\n redrawOverlayInterval: 1000/60 // time between updates, -1 means in same flow\n },\n hooks: {}\n },\n surface = null, // the canvas for the plot itself\n overlay = null, // canvas for interactive stuff on top of plot\n eventHolder = null, // jQuery object that events should be bound to\n ctx = null, octx = null,\n xaxes = [], yaxes = [],\n plotOffset = { left: 0, right: 0, top: 0, bottom: 0},\n plotWidth = 0, plotHeight = 0,\n hooks = {\n processOptions: [],\n processRawData: [],\n processDatapoints: [],\n processOffset: [],\n processRange: [],\n drawBackground: [],\n drawSeries: [],\n draw: [],\n bindEvents: [],\n drawOverlay: [],\n shutdown: []\n },\n plot = this;\n\n // public functions\n plot.setData = setData;\n plot.setupGrid = setupGrid;\n plot.draw = draw;\n plot.getPlaceholder = function() { return placeholder; };\n plot.getCanvas = function() { return surface.element; };\n plot.getPlotOffset = function() { return plotOffset; };\n plot.width = function () { return plotWidth; };\n plot.height = function () { return plotHeight; };\n plot.offset = function () {\n var o = eventHolder.offset();\n o.left += plotOffset.left;\n o.top += plotOffset.top;\n return o;\n };\n plot.getData = function () { return series; };\n plot.getAxes = function () {\n var res = {}, i;\n $.each(xaxes.concat(yaxes), function (_, axis) {\n if (axis)\n res[axis.direction + (axis.n != 1 ? axis.n : \"\") + \"axis\"] = axis;\n });\n return res;\n };\n plot.getXAxes = function () { return xaxes; };\n plot.getYAxes = function () { return yaxes; };\n plot.c2p = canvasToAxisCoords;\n plot.p2c = axisToCanvasCoords;\n plot.getOptions = function () { return options; };\n plot.highlight = highlight;\n plot.unhighlight = unhighlight;\n plot.triggerRedrawOverlay = triggerRedrawOverlay;\n plot.pointOffset = function(point) {\n return {\n left: parseInt(xaxes[axisNumber(point, \"x\") - 1].p2c(+point.x) + plotOffset.left, 10),\n top: parseInt(yaxes[axisNumber(point, \"y\") - 1].p2c(+point.y) + plotOffset.top, 10)\n };\n };\n plot.shutdown = shutdown;\n plot.destroy = function () {\n shutdown();\n placeholder.removeData(\"plot\").empty();\n\n series = [];\n options = null;\n surface = null;\n overlay = null;\n eventHolder = null;\n ctx = null;\n octx = null;\n xaxes = [];\n yaxes = [];\n hooks = null;\n highlights = [];\n plot = null;\n };\n plot.resize = function () {\n \tvar width = placeholder.width(),\n \t\theight = placeholder.height();\n surface.resize(width, height);\n overlay.resize(width, height);\n };\n\n // public attributes\n plot.hooks = hooks;\n\n // initialize\n initPlugins(plot);\n parseOptions(options_);\n setupCanvases();\n setData(data_);\n setupGrid();\n draw();\n bindEvents();\n\n\n function executeHooks(hook, args) {\n args = [plot].concat(args);\n for (var i = 0; i < hook.length; ++i)\n hook[i].apply(this, args);\n }\n\n function initPlugins() {\n\n // References to key classes, allowing plugins to modify them\n\n var classes = {\n Canvas: Canvas\n };\n\n for (var i = 0; i < plugins.length; ++i) {\n var p = plugins[i];\n p.init(plot, classes);\n if (p.options)\n $.extend(true, options, p.options);\n }\n }\n\n function parseOptions(opts) {\n\n $.extend(true, options, opts);\n\n // $.extend merges arrays, rather than replacing them. When less\n // colors are provided than the size of the default palette, we\n // end up with those colors plus the remaining defaults, which is\n // not expected behavior; avoid it by replacing them here.\n\n if (opts && opts.colors) {\n \toptions.colors = opts.colors;\n }\n\n if (options.xaxis.color == null)\n options.xaxis.color = $.color.parse(options.grid.color).scale('a', 0.22).toString();\n if (options.yaxis.color == null)\n options.yaxis.color = $.color.parse(options.grid.color).scale('a', 0.22).toString();\n\n if (options.xaxis.tickColor == null) // grid.tickColor for back-compatibility\n options.xaxis.tickColor = options.grid.tickColor || options.xaxis.color;\n if (options.yaxis.tickColor == null) // grid.tickColor for back-compatibility\n options.yaxis.tickColor = options.grid.tickColor || options.yaxis.color;\n\n if (options.grid.borderColor == null)\n options.grid.borderColor = options.grid.color;\n if (options.grid.tickColor == null)\n options.grid.tickColor = $.color.parse(options.grid.color).scale('a', 0.22).toString();\n\n // Fill in defaults for axis options, including any unspecified\n // font-spec fields, if a font-spec was provided.\n\n // If no x/y axis options were provided, create one of each anyway,\n // since the rest of the code assumes that they exist.\n\n var i, axisOptions, axisCount,\n fontSize = placeholder.css(\"font-size\"),\n fontSizeDefault = fontSize ? +fontSize.replace(\"px\", \"\") : 13,\n fontDefaults = {\n style: placeholder.css(\"font-style\"),\n size: Math.round(0.8 * fontSizeDefault),\n variant: placeholder.css(\"font-variant\"),\n weight: placeholder.css(\"font-weight\"),\n family: placeholder.css(\"font-family\")\n };\n\n axisCount = options.xaxes.length || 1;\n for (i = 0; i < axisCount; ++i) {\n\n axisOptions = options.xaxes[i];\n if (axisOptions && !axisOptions.tickColor) {\n axisOptions.tickColor = axisOptions.color;\n }\n\n axisOptions = $.extend(true, {}, options.xaxis, axisOptions);\n options.xaxes[i] = axisOptions;\n\n if (axisOptions.font) {\n axisOptions.font = $.extend({}, fontDefaults, axisOptions.font);\n if (!axisOptions.font.color) {\n axisOptions.font.color = axisOptions.color;\n }\n if (!axisOptions.font.lineHeight) {\n axisOptions.font.lineHeight = Math.round(axisOptions.font.size * 1.15);\n }\n }\n }\n\n axisCount = options.yaxes.length || 1;\n for (i = 0; i < axisCount; ++i) {\n\n axisOptions = options.yaxes[i];\n if (axisOptions && !axisOptions.tickColor) {\n axisOptions.tickColor = axisOptions.color;\n }\n\n axisOptions = $.extend(true, {}, options.yaxis, axisOptions);\n options.yaxes[i] = axisOptions;\n\n if (axisOptions.font) {\n axisOptions.font = $.extend({}, fontDefaults, axisOptions.font);\n if (!axisOptions.font.color) {\n axisOptions.font.color = axisOptions.color;\n }\n if (!axisOptions.font.lineHeight) {\n axisOptions.font.lineHeight = Math.round(axisOptions.font.size * 1.15);\n }\n }\n }\n\n // backwards compatibility, to be removed in future\n if (options.xaxis.noTicks && options.xaxis.ticks == null)\n options.xaxis.ticks = options.xaxis.noTicks;\n if (options.yaxis.noTicks && options.yaxis.ticks == null)\n options.yaxis.ticks = options.yaxis.noTicks;\n if (options.x2axis) {\n options.xaxes[1] = $.extend(true, {}, options.xaxis, options.x2axis);\n options.xaxes[1].position = \"top\";\n // Override the inherit to allow the axis to auto-scale\n if (options.x2axis.min == null) {\n options.xaxes[1].min = null;\n }\n if (options.x2axis.max == null) {\n options.xaxes[1].max = null;\n }\n }\n if (options.y2axis) {\n options.yaxes[1] = $.extend(true, {}, options.yaxis, options.y2axis);\n options.yaxes[1].position = \"right\";\n // Override the inherit to allow the axis to auto-scale\n if (options.y2axis.min == null) {\n options.yaxes[1].min = null;\n }\n if (options.y2axis.max == null) {\n options.yaxes[1].max = null;\n }\n }\n if (options.grid.coloredAreas)\n options.grid.markings = options.grid.coloredAreas;\n if (options.grid.coloredAreasColor)\n options.grid.markingsColor = options.grid.coloredAreasColor;\n if (options.lines)\n $.extend(true, options.series.lines, options.lines);\n if (options.points)\n $.extend(true, options.series.points, options.points);\n if (options.bars)\n $.extend(true, options.series.bars, options.bars);\n if (options.shadowSize != null)\n options.series.shadowSize = options.shadowSize;\n if (options.highlightColor != null)\n options.series.highlightColor = options.highlightColor;\n\n // save options on axes for future reference\n for (i = 0; i < options.xaxes.length; ++i)\n getOrCreateAxis(xaxes, i + 1).options = options.xaxes[i];\n for (i = 0; i < options.yaxes.length; ++i)\n getOrCreateAxis(yaxes, i + 1).options = options.yaxes[i];\n\n // add hooks from options\n for (var n in hooks)\n if (options.hooks[n] && options.hooks[n].length)\n hooks[n] = hooks[n].concat(options.hooks[n]);\n\n executeHooks(hooks.processOptions, [options]);\n }\n\n function setData(d) {\n series = parseData(d);\n fillInSeriesOptions();\n processData();\n }\n\n function parseData(d) {\n var res = [];\n for (var i = 0; i < d.length; ++i) {\n var s = $.extend(true, {}, options.series);\n\n if (d[i].data != null) {\n s.data = d[i].data; // move the data instead of deep-copy\n delete d[i].data;\n\n $.extend(true, s, d[i]);\n\n d[i].data = s.data;\n }\n else\n s.data = d[i];\n res.push(s);\n }\n\n return res;\n }\n\n function axisNumber(obj, coord) {\n var a = obj[coord + \"axis\"];\n if (typeof a == \"object\") // if we got a real axis, extract number\n a = a.n;\n if (typeof a != \"number\")\n a = 1; // default to first axis\n return a;\n }\n\n function allAxes() {\n // return flat array without annoying null entries\n return $.grep(xaxes.concat(yaxes), function (a) { return a; });\n }\n\n function canvasToAxisCoords(pos) {\n // return an object with x/y corresponding to all used axes\n var res = {}, i, axis;\n for (i = 0; i < xaxes.length; ++i) {\n axis = xaxes[i];\n if (axis && axis.used)\n res[\"x\" + axis.n] = axis.c2p(pos.left);\n }\n\n for (i = 0; i < yaxes.length; ++i) {\n axis = yaxes[i];\n if (axis && axis.used)\n res[\"y\" + axis.n] = axis.c2p(pos.top);\n }\n\n if (res.x1 !== undefined)\n res.x = res.x1;\n if (res.y1 !== undefined)\n res.y = res.y1;\n\n return res;\n }\n\n function axisToCanvasCoords(pos) {\n // get canvas coords from the first pair of x/y found in pos\n var res = {}, i, axis, key;\n\n for (i = 0; i < xaxes.length; ++i) {\n axis = xaxes[i];\n if (axis && axis.used) {\n key = \"x\" + axis.n;\n if (pos[key] == null && axis.n == 1)\n key = \"x\";\n\n if (pos[key] != null) {\n res.left = axis.p2c(pos[key]);\n break;\n }\n }\n }\n\n for (i = 0; i < yaxes.length; ++i) {\n axis = yaxes[i];\n if (axis && axis.used) {\n key = \"y\" + axis.n;\n if (pos[key] == null && axis.n == 1)\n key = \"y\";\n\n if (pos[key] != null) {\n res.top = axis.p2c(pos[key]);\n break;\n }\n }\n }\n\n return res;\n }\n\n function getOrCreateAxis(axes, number) {\n if (!axes[number - 1])\n axes[number - 1] = {\n n: number, // save the number for future reference\n direction: axes == xaxes ? \"x\" : \"y\",\n options: $.extend(true, {}, axes == xaxes ? options.xaxis : options.yaxis)\n };\n\n return axes[number - 1];\n }\n\n function fillInSeriesOptions() {\n\n var neededColors = series.length, maxIndex = -1, i;\n\n // Subtract the number of series that already have fixed colors or\n // color indexes from the number that we still need to generate.\n\n for (i = 0; i < series.length; ++i) {\n var sc = series[i].color;\n if (sc != null) {\n neededColors--;\n if (typeof sc == \"number\" && sc > maxIndex) {\n maxIndex = sc;\n }\n }\n }\n\n // If any of the series have fixed color indexes, then we need to\n // generate at least as many colors as the highest index.\n\n if (neededColors <= maxIndex) {\n neededColors = maxIndex + 1;\n }\n\n // Generate all the colors, using first the option colors and then\n // variations on those colors once they're exhausted.\n\n var c, colors = [], colorPool = options.colors,\n colorPoolSize = colorPool.length, variation = 0;\n\n for (i = 0; i < neededColors; i++) {\n\n c = $.color.parse(colorPool[i % colorPoolSize] || \"#666\");\n\n // Each time we exhaust the colors in the pool we adjust\n // a scaling factor used to produce more variations on\n // those colors. The factor alternates negative/positive\n // to produce lighter/darker colors.\n\n // Reset the variation after every few cycles, or else\n // it will end up producing only white or black colors.\n\n if (i % colorPoolSize == 0 && i) {\n if (variation >= 0) {\n if (variation < 0.5) {\n variation = -variation - 0.2;\n } else variation = 0;\n } else variation = -variation;\n }\n\n colors[i] = c.scale('rgb', 1 + variation);\n }\n\n // Finalize the series options, filling in their colors\n\n var colori = 0, s;\n for (i = 0; i < series.length; ++i) {\n s = series[i];\n\n // assign colors\n if (s.color == null) {\n s.color = colors[colori].toString();\n ++colori;\n }\n else if (typeof s.color == \"number\")\n s.color = colors[s.color].toString();\n\n // turn on lines automatically in case nothing is set\n if (s.lines.show == null) {\n var v, show = true;\n for (v in s)\n if (s[v] && s[v].show) {\n show = false;\n break;\n }\n if (show)\n s.lines.show = true;\n }\n\n // If nothing was provided for lines.zero, default it to match\n // lines.fill, since areas by default should extend to zero.\n\n if (s.lines.zero == null) {\n s.lines.zero = !!s.lines.fill;\n }\n\n // setup axes\n s.xaxis = getOrCreateAxis(xaxes, axisNumber(s, \"x\"));\n s.yaxis = getOrCreateAxis(yaxes, axisNumber(s, \"y\"));\n }\n }\n\n function processData() {\n var topSentry = Number.POSITIVE_INFINITY,\n bottomSentry = Number.NEGATIVE_INFINITY,\n fakeInfinity = Number.MAX_VALUE,\n i, j, k, m, length,\n s, points, ps, x, y, axis, val, f, p,\n data, format;\n\n function updateAxis(axis, min, max) {\n if (min < axis.datamin && min != -fakeInfinity)\n axis.datamin = min;\n if (max > axis.datamax && max != fakeInfinity)\n axis.datamax = max;\n }\n\n $.each(allAxes(), function (_, axis) {\n // init axis\n axis.datamin = topSentry;\n axis.datamax = bottomSentry;\n axis.used = false;\n });\n\n for (i = 0; i < series.length; ++i) {\n s = series[i];\n s.datapoints = { points: [] };\n\n executeHooks(hooks.processRawData, [ s, s.data, s.datapoints ]);\n }\n\n // first pass: clean and copy data\n for (i = 0; i < series.length; ++i) {\n s = series[i];\n\n data = s.data;\n format = s.datapoints.format;\n\n if (!format) {\n format = [];\n // find out how to copy\n format.push({ x: true, number: true, required: true });\n format.push({ y: true, number: true, required: true });\n\n if (s.bars.show || (s.lines.show && s.lines.fill)) {\n var autoscale = !!((s.bars.show && s.bars.zero) || (s.lines.show && s.lines.zero));\n format.push({ y: true, number: true, required: false, defaultValue: 0, autoscale: autoscale });\n if (s.bars.horizontal) {\n delete format[format.length - 1].y;\n format[format.length - 1].x = true;\n }\n }\n\n s.datapoints.format = format;\n }\n\n if (s.datapoints.pointsize != null)\n continue; // already filled in\n\n s.datapoints.pointsize = format.length;\n\n ps = s.datapoints.pointsize;\n points = s.datapoints.points;\n\n var insertSteps = s.lines.show && s.lines.steps;\n s.xaxis.used = s.yaxis.used = true;\n\n for (j = k = 0; j < data.length; ++j, k += ps) {\n p = data[j];\n\n var nullify = p == null;\n if (!nullify) {\n for (m = 0; m < ps; ++m) {\n val = p[m];\n f = format[m];\n\n if (f) {\n if (f.number && val != null) {\n val = +val; // convert to number\n if (isNaN(val))\n val = null;\n else if (val == Infinity)\n val = fakeInfinity;\n else if (val == -Infinity)\n val = -fakeInfinity;\n }\n\n if (val == null) {\n if (f.required)\n nullify = true;\n\n if (f.defaultValue != null)\n val = f.defaultValue;\n }\n }\n\n points[k + m] = val;\n }\n }\n\n if (nullify) {\n for (m = 0; m < ps; ++m) {\n val = points[k + m];\n if (val != null) {\n f = format[m];\n // extract min/max info\n if (f.autoscale !== false) {\n if (f.x) {\n updateAxis(s.xaxis, val, val);\n }\n if (f.y) {\n updateAxis(s.yaxis, val, val);\n }\n }\n }\n points[k + m] = null;\n }\n }\n\n if (insertSteps && k > 0 && (!nullify || points[k - ps] != null)) {\n // copy the point to make room for a middle point\n for (m = 0; m < ps; ++m)\n points[k + ps + m] = points[k + m];\n\n // middle point has same y\n points[k + 1] = points[k - ps + 1] || 0;\n\n // if series has null values, let's give the last !null value a nice step\n if(nullify)\n \tpoints[k] = p[0];\n\n // we've added a point, better reflect that\n k += ps;\n }\n }\n }\n\n // give the hooks a chance to run\n for (i = 0; i < series.length; ++i) {\n s = series[i];\n points = s.datapoints.points;\n ps = s.datapoints.pointsize;\n\n // grafana\n if (s.transform === 'negative-Y') {\n for (j = 0; j < points.length; j += ps) {\n if (points[j] == null)\n continue;\n\n val = points[j + 1];\n points[j + 1] = -val;\n }\n }\n\n executeHooks(hooks.processDatapoints, [ s, s.datapoints]);\n }\n\n // second pass: find datamax/datamin for auto-scaling\n for (i = 0; i < series.length; ++i) {\n s = series[i];\n points = s.datapoints.points;\n ps = s.datapoints.pointsize;\n format = s.datapoints.format;\n\n var xmin = topSentry, ymin = topSentry,\n xmax = bottomSentry, ymax = bottomSentry;\n\n for (j = 0; j < points.length; j += ps) {\n if (points[j] == null)\n continue;\n\n for (m = 0; m < ps; ++m) {\n val = points[j + m];\n f = format[m];\n if (!f || f.autoscale === false || val == fakeInfinity || val == -fakeInfinity)\n continue;\n\n if (f.x) {\n if (val < xmin)\n xmin = val;\n if (val > xmax)\n xmax = val;\n }\n if (f.y) {\n if (val < ymin)\n ymin = val;\n if (val > ymax)\n ymax = val;\n }\n }\n }\n\n if (s.bars.show) {\n // make sure we got room for the bar on the dancing floor\n var delta;\n\n switch (s.bars.align) {\n case \"left\":\n delta = 0;\n break;\n case \"right\":\n delta = -s.bars.barWidth;\n break;\n default:\n delta = -s.bars.barWidth / 2;\n }\n\n if (s.bars.horizontal) {\n ymin += delta;\n ymax += delta + s.bars.barWidth;\n }\n else {\n xmin += delta;\n xmax += delta + s.bars.barWidth;\n }\n }\n\n updateAxis(s.xaxis, xmin, xmax);\n updateAxis(s.yaxis, ymin, ymax);\n }\n\n $.each(allAxes(), function (_, axis) {\n if (axis.datamin == topSentry)\n axis.datamin = null;\n if (axis.datamax == bottomSentry)\n axis.datamax = null;\n });\n }\n\n function setupCanvases() {\n // Make sure the placeholder is clear of everything except canvases\n // from a previous plot in this container that we'll try to re-use.\n\n placeholder.find(\".flot-temp-elem\").remove();\n\n if (placeholder.css(\"position\") == 'static')\n placeholder.css(\"position\", \"relative\"); // for positioning labels and overlay\n\n surface = new Canvas(\"flot-base\", placeholder);\n overlay = new Canvas(\"flot-overlay\", placeholder); // overlay canvas for interactive features\n\n ctx = surface.context;\n octx = overlay.context;\n\n // define which element we're listening for events on\n eventHolder = $(overlay.element).unbind();\n\n // If we're re-using a plot object, shut down the old one\n\n var existing = placeholder.data(\"plot\");\n\n if (existing) {\n existing.shutdown();\n overlay.clear();\n }\n\n // save in case we get replotted\n placeholder.data(\"plot\", plot);\n }\n\n function bindEvents() {\n // bind events\n if (options.grid.hoverable) {\n eventHolder.mousemove(onMouseMove);\n\n // Use bind, rather than .mouseleave, because we officially\n // still support jQuery 1.2.6, which doesn't define a shortcut\n // for mouseenter or mouseleave. This was a bug/oversight that\n // was fixed somewhere around 1.3.x. We can return to using\n // .mouseleave when we drop support for 1.2.6.\n\n eventHolder.bind(\"mouseleave\", onMouseLeave);\n }\n\n if (options.grid.clickable)\n eventHolder.click(onClick);\n\n executeHooks(hooks.bindEvents, [eventHolder]);\n }\n\n function shutdown() {\n if (redrawTimeout)\n clearTimeout(redrawTimeout);\n\n eventHolder.unbind(\"mousemove\", onMouseMove);\n eventHolder.unbind(\"mouseleave\", onMouseLeave);\n eventHolder.unbind(\"click\", onClick);\n\n executeHooks(hooks.shutdown, [eventHolder]);\n }\n\n function setTransformationHelpers(axis) {\n // set helper functions on the axis, assumes plot area\n // has been computed already\n\n function identity(x) { return x; }\n\n var s, m, t = axis.options.transform || identity,\n it = axis.options.inverseTransform;\n\n // precompute how much the axis is scaling a point\n // in canvas space\n if (axis.direction == \"x\") {\n s = axis.scale = plotWidth / Math.abs(t(axis.max) - t(axis.min));\n m = Math.min(t(axis.max), t(axis.min));\n }\n else {\n s = axis.scale = plotHeight / Math.abs(t(axis.max) - t(axis.min));\n s = -s;\n m = Math.max(t(axis.max), t(axis.min));\n }\n\n // data point to canvas coordinate\n if (t == identity) // slight optimization\n axis.p2c = function (p) { return (p - m) * s; };\n else\n axis.p2c = function (p) { return (t(p) - m) * s; };\n // canvas coordinate to data point\n if (!it)\n axis.c2p = function (c) { return m + c / s; };\n else\n axis.c2p = function (c) { return it(m + c / s); };\n }\n\n function measureTickLabels(axis) {\n\n var opts = axis.options,\n ticks = axis.ticks || [],\n labelWidth = opts.labelWidth || 0,\n labelHeight = opts.labelHeight || 0,\n maxWidth = labelWidth || (axis.direction == \"x\" ? Math.floor(surface.width / (ticks.length || 1)) : null),\n legacyStyles = axis.direction + \"Axis \" + axis.direction + axis.n + \"Axis\",\n layer = \"flot-\" + axis.direction + \"-axis flot-\" + axis.direction + axis.n + \"-axis \" + legacyStyles,\n font = opts.font || \"flot-tick-label tickLabel\";\n\n for (var i = 0; i < ticks.length; ++i) {\n\n var t = ticks[i];\n\n if (!t.label)\n continue;\n\n var info = surface.getTextInfo(layer, t.label, font, null, maxWidth);\n\n /// Grafana fix, add +1 to label width\n labelWidth = Math.max(labelWidth, info.width + 1);\n labelHeight = Math.max(labelHeight, info.height);\n }\n\n axis.labelWidth = opts.labelWidth || labelWidth;\n axis.labelHeight = opts.labelHeight || labelHeight;\n }\n\n function allocateAxisBoxFirstPhase(axis) {\n // find the bounding box of the axis by looking at label\n // widths/heights and ticks, make room by diminishing the\n // plotOffset; this first phase only looks at one\n // dimension per axis, the other dimension depends on the\n // other axes so will have to wait\n\n var lw = axis.labelWidth,\n lh = axis.labelHeight,\n pos = axis.options.position,\n isXAxis = axis.direction === \"x\",\n tickLength = axis.options.tickLength,\n axisMargin = options.grid.axisMargin,\n padding = options.grid.labelMargin,\n eventSectionPadding = options.grid.eventSectionHeight,\n innermost = true,\n outermost = true,\n first = true,\n found = false;\n\n // Determine the axis's position in its direction and on its side\n\n $.each(isXAxis ? xaxes : yaxes, function(i, a) {\n if (a && (a.show || a.reserveSpace)) {\n if (a === axis) {\n found = true;\n } else if (a.options.position === pos) {\n if (found) {\n outermost = false;\n } else {\n innermost = false;\n }\n }\n if (!found) {\n first = false;\n }\n }\n });\n\n // The outermost axis on each side has no margin\n\n if (outermost) {\n axisMargin = 0;\n }\n\n // The ticks for the first axis in each direction stretch across\n\n if (tickLength == null) {\n tickLength = first ? \"full\" : 5;\n }\n\n if (!isNaN(+tickLength))\n padding += +tickLength;\n\n if (isXAxis) {\n // Add space for event section\n lh += padding;\n lh += eventSectionPadding;\n\n if (pos == \"bottom\") {\n plotOffset.bottom += lh + axisMargin;\n axis.box = { top: surface.height - plotOffset.bottom, height: lh };\n }\n else {\n axis.box = { top: plotOffset.top + axisMargin, height: lh };\n plotOffset.top += lh + axisMargin;\n }\n }\n else {\n lw += padding;\n\n if (pos == \"left\") {\n axis.box = { left: plotOffset.left + axisMargin, width: lw };\n plotOffset.left += lw + axisMargin;\n }\n else {\n plotOffset.right += lw + axisMargin;\n axis.box = { left: surface.width - plotOffset.right, width: lw };\n }\n }\n\n // save for future reference\n axis.position = pos;\n axis.tickLength = tickLength;\n axis.box.padding = padding;\n axis.box.eventSectionPadding = eventSectionPadding;\n axis.innermost = innermost;\n }\n\n function allocateAxisBoxSecondPhase(axis) {\n // now that all axis boxes have been placed in one\n // dimension, we can set the remaining dimension coordinates\n if (axis.direction == \"x\") {\n axis.box.left = plotOffset.left - axis.labelWidth / 2;\n axis.box.width = surface.width - plotOffset.left - plotOffset.right + axis.labelWidth;\n }\n else {\n axis.box.top = plotOffset.top - axis.labelHeight / 2;\n axis.box.height = surface.height - plotOffset.bottom - plotOffset.top + axis.labelHeight;\n }\n }\n\n function adjustLayoutForThingsStickingOut() {\n // possibly adjust plot offset to ensure everything stays\n // inside the canvas and isn't clipped off\n\n var minMargin = options.grid.minBorderMargin,\n axis, i;\n\n // check stuff from the plot (FIXME: this should just read\n // a value from the series, otherwise it's impossible to\n // customize)\n if (minMargin == null) {\n minMargin = 0;\n for (i = 0; i < series.length; ++i)\n minMargin = Math.max(minMargin, 2 * (series[i].points.radius + series[i].points.lineWidth/2));\n }\n\n var margins = {\n left: minMargin,\n right: minMargin,\n top: minMargin,\n bottom: minMargin\n };\n\n // check axis labels, note we don't check the actual\n // labels but instead use the overall width/height to not\n // jump as much around with replots\n $.each(allAxes(), function (_, axis) {\n if (axis.reserveSpace && axis.ticks && axis.ticks.length) {\n if (axis.direction === \"x\") {\n margins.left = Math.max(margins.left, axis.labelWidth / 2);\n margins.right = Math.max(margins.right, axis.labelWidth / 2);\n } else {\n margins.bottom = Math.max(margins.bottom, axis.labelHeight / 2);\n margins.top = Math.max(margins.top, axis.labelHeight / 2);\n }\n }\n });\n\n plotOffset.left = Math.ceil(Math.max(margins.left, plotOffset.left));\n plotOffset.right = Math.ceil(Math.max(margins.right, plotOffset.right));\n plotOffset.top = Math.ceil(Math.max(margins.top, plotOffset.top));\n plotOffset.bottom = Math.ceil(Math.max(margins.bottom, plotOffset.bottom));\n }\n\n function setupGrid() {\n var i, axes = allAxes(), showGrid = options.grid.show;\n\n // Initialize the plot's offset from the edge of the canvas\n\n for (var a in plotOffset) {\n var margin = options.grid.margin || 0;\n plotOffset[a] = typeof margin == \"number\" ? margin : margin[a] || 0;\n }\n\n executeHooks(hooks.processOffset, [plotOffset]);\n\n // If the grid is visible, add its border width to the offset\n\n for (var a in plotOffset) {\n if(typeof(options.grid.borderWidth) == \"object\") {\n plotOffset[a] += showGrid ? options.grid.borderWidth[a] : 0;\n }\n else {\n plotOffset[a] += showGrid ? options.grid.borderWidth : 0;\n }\n }\n\n $.each(axes, function (_, axis) {\n var axisOpts = axis.options;\n axis.show = axisOpts.show == null ? axis.used : axisOpts.show;\n axis.reserveSpace = axisOpts.reserveSpace == null ? axis.show : axisOpts.reserveSpace;\n setRange(axis);\n });\n\n executeHooks(hooks.processRange, []);\n\n if (showGrid) {\n\n var allocatedAxes = $.grep(axes, function (axis) {\n return axis.show || axis.reserveSpace;\n });\n\n var snaped = false;\n for (var i = 0; i < 2; i++) {\n $.each(allocatedAxes, function (_, axis) {\n // make the ticks\n setupTickGeneration(axis);\n setTicks(axis);\n snaped = snapRangeToTicks(axis, axis.ticks) || snaped;\n // find labelWidth/Height for axis\n measureTickLabels(axis);\n });\n\n if (snaped && hooks.processRange.length > 0) {\n executeHooks(hooks.processRange, []);\n snaped = false;\n } else {\n break;\n }\n }\n\n // with all dimensions calculated, we can compute the\n // axis bounding boxes, start from the outside\n // (reverse order)\n for (i = allocatedAxes.length - 1; i >= 0; --i)\n allocateAxisBoxFirstPhase(allocatedAxes[i]);\n\n // make sure we've got enough space for things that\n // might stick out\n adjustLayoutForThingsStickingOut();\n\n $.each(allocatedAxes, function (_, axis) {\n allocateAxisBoxSecondPhase(axis);\n });\n }\n\n\n plotWidth = surface.width - plotOffset.left - plotOffset.right;\n plotHeight = surface.height - plotOffset.bottom - plotOffset.top;\n\n // now we got the proper plot dimensions, we can compute the scaling\n $.each(axes, function (_, axis) {\n setTransformationHelpers(axis);\n });\n\n if (showGrid) {\n drawAxisLabels();\n }\n\n insertLegend();\n }\n\n function setRange(axis) {\n var opts = axis.options,\n min = +(opts.min != null ? opts.min : axis.datamin),\n max = +(opts.max != null ? opts.max : axis.datamax),\n delta = max - min;\n\n if (delta == 0.0) {\n // Grafana fix: wide Y min and max using increased wideFactor\n // when all series values are the same\n var wideFactor = 0.25;\n var widen = Math.abs(max == 0 ? 1 : max * wideFactor);\n\n if (opts.min == null) {\n min -= widen;\n }\n // always widen max if we couldn't widen min to ensure we\n // don't fall into min == max which doesn't work\n if (opts.max == null || opts.min != null) {\n max += widen;\n }\n }\n else {\n // consider autoscaling\n var margin = opts.autoscaleMargin;\n if (margin != null) {\n if (opts.min == null) {\n min -= delta * margin;\n // make sure we don't go below zero if all values\n // are positive\n if (min < 0 && axis.datamin != null && axis.datamin >= 0)\n min = 0;\n }\n if (opts.max == null) {\n max += delta * margin;\n if (max > 0 && axis.datamax != null && axis.datamax <= 0)\n max = 0;\n }\n }\n }\n axis.min = min;\n axis.max = max;\n }\n\n function setupTickGeneration(axis) {\n var opts = axis.options;\n\n // estimate number of ticks\n var noTicks;\n if (typeof opts.ticks == \"number\" && opts.ticks > 0)\n noTicks = opts.ticks;\n else\n // heuristic based on the model a*sqrt(x) fitted to\n // some data points that seemed reasonable\n noTicks = 0.3 * Math.sqrt(axis.direction == \"x\" ? surface.width : surface.height);\n\n var delta = (axis.max - axis.min) / noTicks,\n dec = -Math.floor(Math.log(delta) / Math.LN10),\n maxDec = opts.tickDecimals;\n\n if (maxDec != null && dec > maxDec) {\n dec = maxDec;\n }\n\n var magn = Math.pow(10, -dec),\n norm = delta / magn, // norm is between 1.0 and 10.0\n size;\n\n if (norm < 1.5) {\n size = 1;\n } else if (norm < 3) {\n size = 2;\n // special case for 2.5, requires an extra decimal\n if (norm > 2.25 && (maxDec == null || dec + 1 <= maxDec)) {\n size = 2.5;\n ++dec;\n }\n } else if (norm < 7.5) {\n size = 5;\n } else {\n size = 10;\n }\n\n size *= magn;\n\n if (opts.minTickSize != null && size < opts.minTickSize) {\n size = opts.minTickSize;\n }\n\n axis.delta = delta;\n axis.tickDecimals = Math.max(0, maxDec != null ? maxDec : dec);\n axis.tickSize = opts.tickSize || size;\n // grafana addition\n axis.scaledDecimals = axis.tickDecimals - Math.floor(Math.log(axis.tickSize) / Math.LN10);\n\n // Time mode was moved to a plug-in in 0.8, and since so many people use it\n // we'll add an especially friendly reminder to make sure they included it.\n\n if (opts.mode == \"time\" && !axis.tickGenerator) {\n throw new Error(\"Time mode requires the flot.time plugin.\");\n }\n\n // Flot supports base-10 axes; any other mode else is handled by a plug-in,\n // like flot.time.js.\n\n if (!axis.tickGenerator) {\n\n axis.tickGenerator = function (axis) {\n\n var ticks = [],\n start = floorInBase(axis.min, axis.tickSize),\n i = 0,\n v = Number.NaN,\n prev;\n\n do {\n prev = v;\n v = start + i * axis.tickSize;\n ticks.push(v);\n ++i;\n } while (v < axis.max && v != prev);\n return ticks;\n };\n\n\t\t\t\taxis.tickFormatter = function (value, axis) {\n\n\t\t\t\t\tvar factor = axis.tickDecimals ? Math.pow(10, axis.tickDecimals) : 1;\n\t\t\t\t\tvar formatted = \"\" + Math.round(value * factor) / factor;\n\n\t\t\t\t\t// If tickDecimals was specified, ensure that we have exactly that\n\t\t\t\t\t// much precision; otherwise default to the value's own precision.\n\n\t\t\t\t\tif (axis.tickDecimals != null) {\n\t\t\t\t\t\tvar decimal = formatted.indexOf(\".\");\n\t\t\t\t\t\tvar precision = decimal == -1 ? 0 : formatted.length - decimal - 1;\n\t\t\t\t\t\tif (precision < axis.tickDecimals) {\n\t\t\t\t\t\t\treturn (precision ? formatted : formatted + \".\") + (\"\" + factor).substr(1, axis.tickDecimals - precision);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n return formatted;\n };\n }\n\n if ($.isFunction(opts.tickFormatter))\n axis.tickFormatter = function (v, axis) { return \"\" + opts.tickFormatter(v, axis); };\n\n if (opts.alignTicksWithAxis != null) {\n var otherAxis = (axis.direction == \"x\" ? xaxes : yaxes)[opts.alignTicksWithAxis - 1];\n if (otherAxis && otherAxis.used && otherAxis != axis) {\n // consider snapping min/max to outermost nice ticks\n var niceTicks = axis.tickGenerator(axis);\n if (niceTicks.length > 0) {\n if (opts.min == null)\n axis.min = Math.min(axis.min, niceTicks[0]);\n if (opts.max == null && niceTicks.length > 1)\n axis.max = Math.max(axis.max, niceTicks[niceTicks.length - 1]);\n }\n\n axis.tickGenerator = function (axis) {\n // copy ticks, scaled to this axis\n var ticks = [], v, i;\n for (i = 0; i < otherAxis.ticks.length; ++i) {\n v = (otherAxis.ticks[i].v - otherAxis.min) / (otherAxis.max - otherAxis.min);\n v = axis.min + v * (axis.max - axis.min);\n ticks.push(v);\n }\n return ticks;\n };\n\n // we might need an extra decimal since forced\n // ticks don't necessarily fit naturally\n if (!axis.mode && opts.tickDecimals == null) {\n var extraDec = Math.max(0, -Math.floor(Math.log(axis.delta) / Math.LN10) + 1),\n ts = axis.tickGenerator(axis);\n\n // only proceed if the tick interval rounded\n // with an extra decimal doesn't give us a\n // zero at end\n if (!(ts.length > 1 && /\\..*0$/.test((ts[1] - ts[0]).toFixed(extraDec))))\n axis.tickDecimals = extraDec;\n }\n }\n }\n }\n\n function setTicks(axis) {\n var oticks = axis.options.ticks, ticks = [];\n if (oticks == null || (typeof oticks == \"number\" && oticks > 0))\n ticks = axis.tickGenerator(axis);\n else if (oticks) {\n if ($.isFunction(oticks))\n // generate the ticks\n ticks = oticks(axis);\n else\n ticks = oticks;\n }\n\n // clean up/labelify the supplied ticks, copy them over\n var i, v;\n axis.ticks = [];\n for (i = 0; i < ticks.length; ++i) {\n var label = null;\n var t = ticks[i];\n if (typeof t == \"object\") {\n v = +t[0];\n if (t.length > 1)\n label = t[1];\n }\n else\n v = +t;\n if (label == null)\n label = axis.tickFormatter(v, axis);\n if (!isNaN(v))\n axis.ticks.push({ v: v, label: label });\n }\n }\n\n function snapRangeToTicks(axis, ticks) {\n var changed = false;\n if (axis.options.autoscaleMargin && ticks.length > 0) {\n // snap to ticks\n if (axis.options.min == null) {\n axis.min = Math.min(axis.min, ticks[0].v);\n changed = true;\n }\n if (axis.options.max == null && ticks.length > 1) {\n axis.max = Math.max(axis.max, ticks[ticks.length - 1].v);\n changed = true;\n }\n }\n return changed;\n }\n\n function draw() {\n\n surface.clear();\n\n executeHooks(hooks.drawBackground, [ctx]);\n\n var grid = options.grid;\n\n // draw background, if any\n if (grid.show && grid.backgroundColor)\n drawBackground();\n\n if (grid.show && !grid.aboveData) {\n drawGrid();\n }\n\n for (var i = 0; i < series.length; ++i) {\n executeHooks(hooks.drawSeries, [ctx, series[i]]);\n drawSeries(series[i]);\n }\n\n executeHooks(hooks.draw, [ctx]);\n\n if (grid.show && grid.aboveData) {\n drawGrid();\n }\n\n surface.render();\n\n // A draw implies that either the axes or data have changed, so we\n // should probably update the overlay highlights as well.\n\n triggerRedrawOverlay();\n }\n\n function extractRange(ranges, coord) {\n var axis, from, to, key, axes = allAxes();\n\n for (var i = 0; i < axes.length; ++i) {\n axis = axes[i];\n if (axis.direction == coord) {\n key = coord + axis.n + \"axis\";\n if (!ranges[key] && axis.n == 1)\n key = coord + \"axis\"; // support x1axis as xaxis\n if (ranges[key]) {\n from = ranges[key].from;\n to = ranges[key].to;\n break;\n }\n }\n }\n\n // backwards-compat stuff - to be removed in future\n if (!ranges[key]) {\n axis = coord == \"x\" ? xaxes[0] : yaxes[0];\n from = ranges[coord + \"1\"];\n to = ranges[coord + \"2\"];\n }\n\n // auto-reverse as an added bonus\n if (from != null && to != null && from > to) {\n var tmp = from;\n from = to;\n to = tmp;\n }\n\n return { from: from, to: to, axis: axis };\n }\n\n function drawBackground() {\n ctx.save();\n ctx.translate(plotOffset.left, plotOffset.top);\n\n ctx.fillStyle = getColorOrGradient(options.grid.backgroundColor, plotHeight, 0, \"rgba(255, 255, 255, 0)\");\n ctx.fillRect(0, 0, plotWidth, plotHeight);\n ctx.restore();\n }\n\n function drawGrid() {\n var i, axes, bw, bc;\n\n ctx.save();\n ctx.translate(plotOffset.left, plotOffset.top);\n\n // draw markings\n var markings = options.grid.markings;\n if (markings) {\n if ($.isFunction(markings)) {\n axes = plot.getAxes();\n // xmin etc. is backwards compatibility, to be\n // removed in the future\n axes.xmin = axes.xaxis.min;\n axes.xmax = axes.xaxis.max;\n axes.ymin = axes.yaxis.min;\n axes.ymax = axes.yaxis.max;\n\n markings = markings(axes);\n }\n\n for (i = 0; i < markings.length; ++i) {\n var m = markings[i],\n xrange = extractRange(m, \"x\"),\n yrange = extractRange(m, \"y\");\n\n // fill in missing\n if (xrange.from == null)\n xrange.from = xrange.axis.min;\n if (xrange.to == null)\n xrange.to = xrange.axis.max;\n if (yrange.from == null)\n yrange.from = yrange.axis.min;\n if (yrange.to == null)\n yrange.to = yrange.axis.max;\n\n // clip\n if (xrange.to < xrange.axis.min || xrange.from > xrange.axis.max ||\n yrange.to < yrange.axis.min || yrange.from > yrange.axis.max)\n continue;\n\n xrange.from = Math.max(xrange.from, xrange.axis.min);\n xrange.to = Math.min(xrange.to, xrange.axis.max);\n yrange.from = Math.max(yrange.from, yrange.axis.min);\n yrange.to = Math.min(yrange.to, yrange.axis.max);\n\n var xequal = xrange.from === xrange.to,\n yequal = yrange.from === yrange.to;\n\n if (xequal && yequal) {\n continue;\n }\n\n // then draw\n xrange.from = Math.floor(xrange.axis.p2c(xrange.from));\n xrange.to = Math.floor(xrange.axis.p2c(xrange.to));\n yrange.from = Math.floor(yrange.axis.p2c(yrange.from));\n yrange.to = Math.floor(yrange.axis.p2c(yrange.to));\n\n if (xequal || yequal) {\n var lineWidth = m.lineWidth || options.grid.markingsLineWidth,\n subPixel = lineWidth % 2 ? 0.5 : 0;\n ctx.beginPath();\n ctx.strokeStyle = m.color || options.grid.markingsColor;\n ctx.lineWidth = lineWidth;\n if (xequal) {\n ctx.moveTo(xrange.to + subPixel, yrange.from);\n ctx.lineTo(xrange.to + subPixel, yrange.to);\n } else {\n ctx.moveTo(xrange.from, yrange.to + subPixel);\n ctx.lineTo(xrange.to, yrange.to + subPixel);\n }\n ctx.stroke();\n } else {\n ctx.fillStyle = m.color || options.grid.markingsColor;\n ctx.fillRect(xrange.from, yrange.to,\n xrange.to - xrange.from,\n yrange.from - yrange.to);\n }\n }\n }\n\n // draw the ticks\n axes = allAxes();\n bw = options.grid.borderWidth;\n\n for (var j = 0; j < axes.length; ++j) {\n var axis = axes[j], box = axis.box,\n t = axis.tickLength, x, y, xoff, yoff;\n if (!axis.show || axis.ticks.length == 0)\n continue;\n\n ctx.lineWidth = 1;\n\n // find the edges\n if (axis.direction == \"x\") {\n x = 0;\n if (t == \"full\")\n y = (axis.position == \"top\" ? 0 : plotHeight);\n else\n y = box.top - plotOffset.top + (axis.position == \"top\" ? box.height : 0);\n }\n else {\n y = 0;\n if (t == \"full\")\n x = (axis.position == \"left\" ? 0 : plotWidth);\n else\n x = box.left - plotOffset.left + (axis.position == \"left\" ? box.width : 0);\n }\n\n // draw tick bar\n if (!axis.innermost) {\n ctx.strokeStyle = axis.options.color;\n ctx.beginPath();\n xoff = yoff = 0;\n if (axis.direction == \"x\")\n xoff = plotWidth + 1;\n else\n yoff = plotHeight + 1;\n\n if (ctx.lineWidth == 1) {\n if (axis.direction == \"x\") {\n y = Math.floor(y) + 0.5;\n } else {\n x = Math.floor(x) + 0.5;\n }\n }\n\n ctx.moveTo(x, y);\n ctx.lineTo(x + xoff, y + yoff);\n ctx.stroke();\n }\n\n // draw ticks\n\n ctx.strokeStyle = axis.options.tickColor;\n\n ctx.beginPath();\n for (i = 0; i < axis.ticks.length; ++i) {\n var v = axis.ticks[i].v;\n\n xoff = yoff = 0;\n\n if (isNaN(v) || v < axis.min || v > axis.max\n // skip those lying on the axes if we got a border\n || (t == \"full\"\n && ((typeof bw == \"object\" && bw[axis.position] > 0) || bw > 0)\n && (v == axis.min || v == axis.max)))\n continue;\n\n if (axis.direction == \"x\") {\n x = axis.p2c(v);\n yoff = t == \"full\" ? -plotHeight : t;\n\n if (axis.position == \"top\")\n yoff = -yoff;\n }\n else {\n y = axis.p2c(v);\n xoff = t == \"full\" ? -plotWidth : t;\n\n if (axis.position == \"left\")\n xoff = -xoff;\n }\n\n if (ctx.lineWidth == 1) {\n if (axis.direction == \"x\")\n x = Math.floor(x) + 0.5;\n else\n y = Math.floor(y) + 0.5;\n }\n\n ctx.moveTo(x, y);\n ctx.lineTo(x + xoff, y + yoff);\n }\n\n ctx.stroke();\n }\n\n\n // draw border\n if (bw) {\n // If either borderWidth or borderColor is an object, then draw the border\n // line by line instead of as one rectangle\n bc = options.grid.borderColor;\n if(typeof bw == \"object\" || typeof bc == \"object\") {\n if (typeof bw !== \"object\") {\n bw = {top: bw, right: bw, bottom: bw, left: bw};\n }\n if (typeof bc !== \"object\") {\n bc = {top: bc, right: bc, bottom: bc, left: bc};\n }\n\n if (bw.top > 0) {\n ctx.strokeStyle = bc.top;\n ctx.lineWidth = bw.top;\n ctx.beginPath();\n ctx.moveTo(0 - bw.left, 0 - bw.top/2);\n ctx.lineTo(plotWidth, 0 - bw.top/2);\n ctx.stroke();\n }\n\n if (bw.right > 0) {\n ctx.strokeStyle = bc.right;\n ctx.lineWidth = bw.right;\n ctx.beginPath();\n ctx.moveTo(plotWidth + bw.right / 2, 0 - bw.top);\n ctx.lineTo(plotWidth + bw.right / 2, plotHeight);\n ctx.stroke();\n }\n\n if (bw.bottom > 0) {\n ctx.strokeStyle = bc.bottom;\n ctx.lineWidth = bw.bottom;\n ctx.beginPath();\n ctx.moveTo(plotWidth + bw.right, plotHeight + bw.bottom / 2);\n ctx.lineTo(0, plotHeight + bw.bottom / 2);\n ctx.stroke();\n }\n\n if (bw.left > 0) {\n ctx.strokeStyle = bc.left;\n ctx.lineWidth = bw.left;\n ctx.beginPath();\n ctx.moveTo(0 - bw.left/2, plotHeight + bw.bottom);\n ctx.lineTo(0- bw.left/2, 0);\n ctx.stroke();\n }\n }\n else {\n ctx.lineWidth = bw;\n ctx.strokeStyle = options.grid.borderColor;\n ctx.strokeRect(-bw/2, -bw/2, plotWidth + bw, plotHeight + bw);\n }\n }\n\n ctx.restore();\n }\n\n function drawAxisLabels() {\n\n $.each(allAxes(), function (_, axis) {\n var box = axis.box,\n legacyStyles = axis.direction + \"Axis \" + axis.direction + axis.n + \"Axis\",\n layer = \"flot-\" + axis.direction + \"-axis flot-\" + axis.direction + axis.n + \"-axis \" + legacyStyles,\n font = axis.options.font || \"flot-tick-label tickLabel\",\n tick, x, y, halign, valign;\n\n // Remove text before checking for axis.show and ticks.length;\n // otherwise plugins, like flot-tickrotor, that draw their own\n // tick labels will end up with both theirs and the defaults.\n\n surface.removeText(layer);\n\n if (!axis.show || axis.ticks.length == 0)\n return;\n\n for (var i = 0; i < axis.ticks.length; ++i) {\n\n tick = axis.ticks[i];\n if (!tick.label || tick.v < axis.min || tick.v > axis.max)\n continue;\n\n if (axis.direction == \"x\") {\n halign = \"center\";\n x = plotOffset.left + axis.p2c(tick.v);\n if (axis.position == \"bottom\") {\n y = box.top + box.padding + box.eventSectionPadding;\n } else {\n y = box.top + box.height - box.padding;\n valign = \"bottom\";\n }\n } else {\n valign = \"middle\";\n y = plotOffset.top + axis.p2c(tick.v);\n if (axis.position == \"left\") {\n x = box.left + box.width - box.padding;\n halign = \"right\";\n } else {\n x = box.left + box.padding;\n }\n }\n\n surface.addText(layer, x, y, tick.label, font, null, null, halign, valign);\n }\n });\n }\n\n function drawSeries(series) {\n if (series.lines.show)\n drawSeriesLines(series);\n if (series.bars.show)\n drawSeriesBars(series);\n if (series.points.show)\n drawSeriesPoints(series);\n }\n\n function drawSeriesLines(series) {\n function plotLine(datapoints, xoffset, yoffset, axisx, axisy) {\n var points = datapoints.points,\n ps = datapoints.pointsize,\n prevx = null, prevy = null;\n\n ctx.beginPath();\n for (var i = ps; i < points.length; i += ps) {\n var x1 = points[i - ps], y1 = points[i - ps + 1],\n x2 = points[i], y2 = points[i + 1];\n\n if (x1 == null || x2 == null)\n continue;\n\n // clip with ymin\n if (y1 <= y2 && y1 < axisy.min) {\n if (y2 < axisy.min)\n continue; // line segment is outside\n // compute new intersection point\n x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;\n y1 = axisy.min;\n }\n else if (y2 <= y1 && y2 < axisy.min) {\n if (y1 < axisy.min)\n continue;\n x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;\n y2 = axisy.min;\n }\n\n // clip with ymax\n if (y1 >= y2 && y1 > axisy.max) {\n if (y2 > axisy.max)\n continue;\n x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;\n y1 = axisy.max;\n }\n else if (y2 >= y1 && y2 > axisy.max) {\n if (y1 > axisy.max)\n continue;\n x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;\n y2 = axisy.max;\n }\n\n // clip with xmin\n if (x1 <= x2 && x1 < axisx.min) {\n if (x2 < axisx.min)\n continue;\n y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;\n x1 = axisx.min;\n }\n else if (x2 <= x1 && x2 < axisx.min) {\n if (x1 < axisx.min)\n continue;\n y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;\n x2 = axisx.min;\n }\n\n // clip with xmax\n if (x1 >= x2 && x1 > axisx.max) {\n if (x2 > axisx.max)\n continue;\n y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;\n x1 = axisx.max;\n }\n else if (x2 >= x1 && x2 > axisx.max) {\n if (x1 > axisx.max)\n continue;\n y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;\n x2 = axisx.max;\n }\n\n if (x1 != prevx || y1 != prevy)\n ctx.moveTo(axisx.p2c(x1) + xoffset, axisy.p2c(y1) + yoffset);\n\n prevx = x2;\n prevy = y2;\n ctx.lineTo(axisx.p2c(x2) + xoffset, axisy.p2c(y2) + yoffset);\n }\n ctx.stroke();\n }\n\n function plotLineArea(datapoints, axisx, axisy) {\n var points = datapoints.points,\n ps = datapoints.pointsize,\n bottom = Math.min(Math.max(0, axisy.min), axisy.max),\n i = 0, top, areaOpen = false,\n ypos = 1, segmentStart = 0, segmentEnd = 0;\n\n // we process each segment in two turns, first forward\n // direction to sketch out top, then once we hit the\n // end we go backwards to sketch the bottom\n while (true) {\n if (ps > 0 && i > points.length + ps)\n break;\n\n i += ps; // ps is negative if going backwards\n\n var x1 = points[i - ps],\n y1 = points[i - ps + ypos],\n x2 = points[i], y2 = points[i + ypos];\n\n if (areaOpen) {\n if (ps > 0 && x1 != null && x2 == null) {\n // at turning point\n segmentEnd = i;\n ps = -ps;\n ypos = 2;\n continue;\n }\n\n if (ps < 0 && i == segmentStart + ps) {\n // done with the reverse sweep\n ctx.fill();\n areaOpen = false;\n ps = -ps;\n ypos = 1;\n i = segmentStart = segmentEnd + ps;\n continue;\n }\n }\n\n if (x1 == null || x2 == null)\n continue;\n\n // clip x values\n\n // clip with xmin\n if (x1 <= x2 && x1 < axisx.min) {\n if (x2 < axisx.min)\n continue;\n y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;\n x1 = axisx.min;\n }\n else if (x2 <= x1 && x2 < axisx.min) {\n if (x1 < axisx.min)\n continue;\n y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;\n x2 = axisx.min;\n }\n\n // clip with xmax\n if (x1 >= x2 && x1 > axisx.max) {\n if (x2 > axisx.max)\n continue;\n y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;\n x1 = axisx.max;\n }\n else if (x2 >= x1 && x2 > axisx.max) {\n if (x1 > axisx.max)\n continue;\n y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;\n x2 = axisx.max;\n }\n\n if (!areaOpen) {\n // open area\n ctx.beginPath();\n ctx.moveTo(axisx.p2c(x1), axisy.p2c(bottom));\n areaOpen = true;\n }\n\n // now first check the case where both is outside\n if (y1 >= axisy.max && y2 >= axisy.max) {\n ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.max));\n ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.max));\n continue;\n }\n else if (y1 <= axisy.min && y2 <= axisy.min) {\n ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.min));\n ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.min));\n continue;\n }\n\n // else it's a bit more complicated, there might\n // be a flat maxed out rectangle first, then a\n // triangular cutout or reverse; to find these\n // keep track of the current x values\n var x1old = x1, x2old = x2;\n\n // clip the y values, without shortcutting, we\n // go through all cases in turn\n\n // clip with ymin\n if (y1 <= y2 && y1 < axisy.min && y2 >= axisy.min) {\n x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;\n y1 = axisy.min;\n }\n else if (y2 <= y1 && y2 < axisy.min && y1 >= axisy.min) {\n x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;\n y2 = axisy.min;\n }\n\n // clip with ymax\n if (y1 >= y2 && y1 > axisy.max && y2 <= axisy.max) {\n x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;\n y1 = axisy.max;\n }\n else if (y2 >= y1 && y2 > axisy.max && y1 <= axisy.max) {\n x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;\n y2 = axisy.max;\n }\n\n // if the x value was changed we got a rectangle\n // to fill\n if (x1 != x1old) {\n ctx.lineTo(axisx.p2c(x1old), axisy.p2c(y1));\n // it goes to (x1, y1), but we fill that below\n }\n\n // fill triangular section, this sometimes result\n // in redundant points if (x1, y1) hasn't changed\n // from previous line to, but we just ignore that\n ctx.lineTo(axisx.p2c(x1), axisy.p2c(y1));\n ctx.lineTo(axisx.p2c(x2), axisy.p2c(y2));\n\n // fill the other rectangle if it's there\n if (x2 != x2old) {\n ctx.lineTo(axisx.p2c(x2), axisy.p2c(y2));\n ctx.lineTo(axisx.p2c(x2old), axisy.p2c(y2));\n }\n }\n }\n\n ctx.save();\n ctx.translate(plotOffset.left, plotOffset.top);\n ctx.lineJoin = \"round\";\n\n var lw = series.lines.lineWidth,\n sw = series.shadowSize;\n // FIXME: consider another form of shadow when filling is turned on\n if (lw > 0 && sw > 0) {\n // draw shadow as a thick and thin line with transparency\n ctx.lineWidth = sw;\n ctx.strokeStyle = \"rgba(0,0,0,0.1)\";\n // position shadow at angle from the mid of line\n var angle = Math.PI/18;\n plotLine(series.datapoints, Math.sin(angle) * (lw/2 + sw/2), Math.cos(angle) * (lw/2 + sw/2), series.xaxis, series.yaxis);\n ctx.lineWidth = sw/2;\n plotLine(series.datapoints, Math.sin(angle) * (lw/2 + sw/4), Math.cos(angle) * (lw/2 + sw/4), series.xaxis, series.yaxis);\n }\n\n ctx.lineWidth = lw;\n ctx.strokeStyle = series.color;\n var fillStyle = getFillStyle(series.lines, series.color, 0, plotHeight);\n if (fillStyle) {\n ctx.fillStyle = fillStyle;\n plotLineArea(series.datapoints, series.xaxis, series.yaxis);\n }\n\n if (lw > 0)\n plotLine(series.datapoints, 0, 0, series.xaxis, series.yaxis);\n ctx.restore();\n }\n\n function drawSeriesPoints(series) {\n function plotPoints(datapoints, radius, fillStyle, offset, shadow, axisx, axisy, symbol) {\n var points = datapoints.points, ps = datapoints.pointsize;\n\n for (var i = 0; i < points.length; i += ps) {\n var x = points[i], y = points[i + 1];\n if (x == null || x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max)\n continue;\n\n ctx.beginPath();\n x = axisx.p2c(x);\n y = axisy.p2c(y) + offset;\n if (symbol == \"circle\")\n ctx.arc(x, y, radius, 0, shadow ? Math.PI : Math.PI * 2, false);\n else\n symbol(ctx, x, y, radius, shadow);\n ctx.closePath();\n\n if (fillStyle) {\n ctx.fillStyle = fillStyle;\n ctx.fill();\n }\n ctx.stroke();\n }\n }\n\n ctx.save();\n ctx.translate(plotOffset.left, plotOffset.top);\n\n var lw = series.points.lineWidth,\n sw = series.shadowSize,\n radius = series.points.radius,\n symbol = series.points.symbol;\n\n // If the user sets the line width to 0, we change it to a very\n // small value. A line width of 0 seems to force the default of 1.\n // Doing the conditional here allows the shadow setting to still be\n // optional even with a lineWidth of 0.\n\n if( lw == 0 )\n lw = 0.0001;\n\n if (lw > 0 && sw > 0) {\n // draw shadow in two steps\n var w = sw / 2;\n ctx.lineWidth = w;\n ctx.strokeStyle = \"rgba(0,0,0,0.1)\";\n plotPoints(series.datapoints, radius, null, w + w/2, true,\n series.xaxis, series.yaxis, symbol);\n\n ctx.strokeStyle = \"rgba(0,0,0,0.2)\";\n plotPoints(series.datapoints, radius, null, w/2, true,\n series.xaxis, series.yaxis, symbol);\n }\n\n ctx.lineWidth = lw;\n ctx.strokeStyle = series.color;\n plotPoints(series.datapoints, radius,\n getFillStyle(series.points, series.color), 0, false,\n series.xaxis, series.yaxis, symbol);\n ctx.restore();\n }\n\n function drawBar(x, y, b, barLeft, barRight, fillStyleCallback, axisx, axisy, c, horizontal, lineWidth) {\n var left, right, bottom, top,\n drawLeft, drawRight, drawTop, drawBottom,\n tmp;\n\n // in horizontal mode, we start the bar from the left\n // instead of from the bottom so it appears to be\n // horizontal rather than vertical\n if (horizontal) {\n drawBottom = drawRight = drawTop = true;\n drawLeft = false;\n left = b;\n right = x;\n top = y + barLeft;\n bottom = y + barRight;\n\n // account for negative bars\n if (right < left) {\n tmp = right;\n right = left;\n left = tmp;\n drawLeft = true;\n drawRight = false;\n }\n }\n else {\n drawLeft = drawRight = drawTop = true;\n drawBottom = false;\n left = x + barLeft;\n right = x + barRight;\n bottom = b;\n top = y;\n\n // account for negative bars\n if (top < bottom) {\n tmp = top;\n top = bottom;\n bottom = tmp;\n drawBottom = true;\n drawTop = false;\n }\n }\n\n // clip\n if (right < axisx.min || left > axisx.max ||\n top < axisy.min || bottom > axisy.max)\n return;\n\n if (left < axisx.min) {\n left = axisx.min;\n drawLeft = false;\n }\n\n if (right > axisx.max) {\n right = axisx.max;\n drawRight = false;\n }\n\n if (bottom < axisy.min) {\n bottom = axisy.min;\n drawBottom = false;\n }\n\n if (top > axisy.max) {\n top = axisy.max;\n drawTop = false;\n }\n\n left = axisx.p2c(left);\n bottom = axisy.p2c(bottom);\n right = axisx.p2c(right);\n top = axisy.p2c(top);\n\n // fill the bar\n if (fillStyleCallback) {\n c.fillStyle = fillStyleCallback(bottom, top);\n c.fillRect(left, top, right - left, bottom - top)\n }\n\n // draw outline\n if (lineWidth > 0 && (drawLeft || drawRight || drawTop || drawBottom)) {\n c.beginPath();\n\n // FIXME: inline moveTo is buggy with excanvas\n c.moveTo(left, bottom);\n if (drawLeft)\n c.lineTo(left, top);\n else\n c.moveTo(left, top);\n if (drawTop)\n c.lineTo(right, top);\n else\n c.moveTo(right, top);\n if (drawRight)\n c.lineTo(right, bottom);\n else\n c.moveTo(right, bottom);\n if (drawBottom)\n c.lineTo(left, bottom);\n else\n c.moveTo(left, bottom);\n c.stroke();\n }\n }\n\n function drawSeriesBars(series) {\n function plotBars(datapoints, barLeft, barRight, fillStyleCallback, axisx, axisy) {\n var points = datapoints.points, ps = datapoints.pointsize;\n\n for (var i = 0; i < points.length; i += ps) {\n if (points[i] == null)\n continue;\n drawBar(points[i], points[i + 1], points[i + 2], barLeft, barRight, fillStyleCallback, axisx, axisy, ctx, series.bars.horizontal, series.bars.lineWidth);\n }\n }\n\n ctx.save();\n ctx.translate(plotOffset.left, plotOffset.top);\n\n // FIXME: figure out a way to add shadows (for instance along the right edge)\n ctx.lineWidth = series.bars.lineWidth;\n ctx.strokeStyle = series.color;\n\n var barLeft;\n\n switch (series.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -series.bars.barWidth;\n break;\n default:\n barLeft = -series.bars.barWidth / 2;\n }\n\n var fillStyleCallback = series.bars.fill ? function (bottom, top) { return getFillStyle(series.bars, series.color, bottom, top); } : null;\n plotBars(series.datapoints, barLeft, barLeft + series.bars.barWidth, fillStyleCallback, series.xaxis, series.yaxis);\n ctx.restore();\n }\n\n function getFillStyle(filloptions, seriesColor, bottom, top) {\n var fill = filloptions.fill;\n if (!fill)\n return null;\n\n if (filloptions.fillColor)\n return getColorOrGradient(filloptions.fillColor, bottom, top, seriesColor);\n\n var c = $.color.parse(seriesColor);\n c.a = typeof fill == \"number\" ? fill : 0.4;\n c.normalize();\n return c.toString();\n }\n\n function insertLegend() {\n\n if (options.legend.container != null) {\n $(options.legend.container).html(\"\");\n } else {\n placeholder.find(\".legend\").remove();\n }\n\n if (!options.legend.show) {\n return;\n }\n\n var fragments = [], entries = [], rowStarted = false,\n lf = options.legend.labelFormatter, s, label;\n\n // Build a list of legend entries, with each having a label and a color\n\n for (var i = 0; i < series.length; ++i) {\n s = series[i];\n if (s.label) {\n label = lf ? lf(s.label, s) : s.label;\n if (label) {\n entries.push({\n label: label,\n color: s.color\n });\n }\n }\n }\n\n // Sort the legend using either the default or a custom comparator\n\n if (options.legend.sorted) {\n if ($.isFunction(options.legend.sorted)) {\n entries.sort(options.legend.sorted);\n } else if (options.legend.sorted == \"reverse\") {\n \tentries.reverse();\n } else {\n var ascending = options.legend.sorted != \"descending\";\n entries.sort(function(a, b) {\n return a.label == b.label ? 0 : (\n (a.label < b.label) != ascending ? 1 : -1 // Logical XOR\n );\n });\n }\n }\n\n // Generate markup for the list of entries, in their final order\n\n for (var i = 0; i < entries.length; ++i) {\n\n var entry = entries[i];\n\n if (i % options.legend.noColumns == 0) {\n if (rowStarted)\n fragments.push('');\n fragments.push('
    ');\n rowStarted = true;\n }\n\n fragments.push(\n '' +\n ''\n );\n }\n\n if (rowStarted)\n fragments.push('');\n\n if (fragments.length == 0)\n return;\n\n var table = '
    ' + statName;\n if (panel.legend.sort === statName) {\n var cssClass = panel.legend.sortDesc ? 'fa fa-caret-down' : 'fa fa-caret-up';\n html += ' ';\n }\n return html + '
    Converts an array to an ObservableConvert an infinite iterable (from a generator) to an ObservableConvert the Promise returned by Fetch to an ObservableEnsure values in subscribe are called just before browser repaint.Map every click to the clientX position of that clickMap every click to the clientX position of that clickMap two click events to a finite interval Observable, then apply combineAllDynamically calculate the Body-Mass Index from an Observable of weight and one for height
    ' + entry.label + '
    ' + fragments.join(\"\") + '
    ';\n if (options.legend.container != null)\n $(options.legend.container).html(table);\n else {\n var pos = \"\",\n p = options.legend.position,\n m = options.legend.margin;\n if (m[0] == null)\n m = [m, m];\n if (p.charAt(0) == \"n\")\n pos += 'top:' + (m[1] + plotOffset.top) + 'px;';\n else if (p.charAt(0) == \"s\")\n pos += 'bottom:' + (m[1] + plotOffset.bottom) + 'px;';\n if (p.charAt(1) == \"e\")\n pos += 'right:' + (m[0] + plotOffset.right) + 'px;';\n else if (p.charAt(1) == \"w\")\n pos += 'left:' + (m[0] + plotOffset.left) + 'px;';\n var legend = $('
    ' + table.replace('style=\"', 'style=\"position:absolute;' + pos +';') + '
    ').appendTo(placeholder);\n if (options.legend.backgroundOpacity != 0.0) {\n // put in the transparent background\n // separately to avoid blended labels and\n // label boxes\n var c = options.legend.backgroundColor;\n if (c == null) {\n c = options.grid.backgroundColor;\n if (c && typeof c == \"string\")\n c = $.color.parse(c);\n else\n c = $.color.extract(legend, 'background-color');\n c.a = 1;\n c = c.toString();\n }\n var div = legend.children();\n $('
    ').prependTo(legend).css('opacity', options.legend.backgroundOpacity);\n }\n }\n }\n\n\n // interactive features\n\n var highlights = [],\n redrawTimeout = null;\n\n // returns the data item the mouse is over, or null if none is found\n function findNearbyItem(mouseX, mouseY, seriesFilter) {\n var maxDistance = options.grid.mouseActiveRadius,\n smallestDistance = maxDistance * maxDistance + 1,\n item = null, foundPoint = false, i, j, ps;\n\n for (i = series.length - 1; i >= 0; --i) {\n if (!seriesFilter(series[i]))\n continue;\n\n var s = series[i],\n axisx = s.xaxis,\n axisy = s.yaxis,\n points = s.datapoints.points,\n mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster\n my = axisy.c2p(mouseY),\n maxx = maxDistance / axisx.scale,\n maxy = maxDistance / axisy.scale;\n\n ps = s.datapoints.pointsize;\n // with inverse transforms, we can't use the maxx/maxy\n // optimization, sadly\n if (axisx.options.inverseTransform)\n maxx = Number.MAX_VALUE;\n if (axisy.options.inverseTransform)\n maxy = Number.MAX_VALUE;\n\n if (s.lines.show || s.points.show) {\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1];\n if (x == null)\n continue;\n\n // For points and lines, the cursor must be within a\n // certain distance to the data point\n if (x - mx > maxx || x - mx < -maxx ||\n y - my > maxy || y - my < -maxy)\n continue;\n\n // We have to calculate distances in pixels, not in\n // data units, because the scales of the axes may be different\n var dx = Math.abs(axisx.p2c(x) - mouseX),\n dy = Math.abs(axisy.p2c(y) - mouseY),\n dist = dx * dx + dy * dy; // we save the sqrt\n\n // use <= to ensure last point takes precedence\n // (last generally means on top of)\n if (dist < smallestDistance) {\n smallestDistance = dist;\n item = [i, j / ps];\n }\n }\n }\n\n if (s.bars.show && !item) { // no other point can be nearby\n\n var barLeft, barRight;\n\n switch (s.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -s.bars.barWidth;\n break;\n default:\n barLeft = -s.bars.barWidth / 2;\n }\n\n barRight = barLeft + s.bars.barWidth;\n\n for (j = 0; j < points.length; j += ps) {\n var x = points[j], y = points[j + 1], b = points[j + 2];\n if (x == null)\n continue;\n\n // for a bar graph, the cursor must be inside the bar\n if (series[i].bars.horizontal ?\n (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&\n my >= y + barLeft && my <= y + barRight) :\n (mx >= x + barLeft && mx <= x + barRight &&\n my >= Math.min(b, y) && my <= Math.max(b, y)))\n item = [i, j / ps];\n }\n }\n }\n\n if (item) {\n i = item[0];\n j = item[1];\n ps = series[i].datapoints.pointsize;\n\n return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),\n dataIndex: j,\n series: series[i],\n seriesIndex: i };\n }\n\n return null;\n }\n\n function onMouseMove(e) {\n if (options.grid.hoverable)\n triggerClickHoverEvent(\"plothover\", e,\n function (s) { return s[\"hoverable\"] != false; });\n }\n\n function onMouseLeave(e) {\n if (options.grid.hoverable)\n triggerClickHoverEvent(\"plothover\", e,\n function (s) { return false; });\n }\n\n function onClick(e) {\n if (plot.isSelecting) {\n return;\n }\n\n triggerClickHoverEvent(\"plotclick\", e, function (s) { return s[\"clickable\"] != false; });\n }\n\n // trigger click or hover event (they send the same parameters\n // so we share their code)\n function triggerClickHoverEvent(eventname, event, seriesFilter) {\n var offset = eventHolder.offset(),\n canvasX = event.pageX - offset.left - plotOffset.left,\n canvasY = event.pageY - offset.top - plotOffset.top,\n pos = canvasToAxisCoords({ left: canvasX, top: canvasY });\n\n pos.pageX = event.pageX;\n pos.pageY = event.pageY;\n\n // Add ctrlKey and metaKey to event\n pos.ctrlKey = event.ctrlKey;\n pos.metaKey = event.metaKey;\n\n var item = findNearbyItem(canvasX, canvasY, seriesFilter);\n\n if (item) {\n // fill in mouse pos for any listeners out there\n item.pageX = parseInt(item.series.xaxis.p2c(item.datapoint[0]) + offset.left + plotOffset.left, 10);\n item.pageY = parseInt(item.series.yaxis.p2c(item.datapoint[1]) + offset.top + plotOffset.top, 10);\n }\n\n if (options.grid.autoHighlight) {\n // clear auto-highlights\n for (var i = 0; i < highlights.length; ++i) {\n var h = highlights[i];\n if (h.auto == eventname &&\n !(item && h.series == item.series &&\n h.point[0] == item.datapoint[0] &&\n h.point[1] == item.datapoint[1]))\n unhighlight(h.series, h.point);\n }\n\n if (item)\n highlight(item.series, item.datapoint, eventname);\n }\n\n placeholder.trigger(eventname, [ pos, item ]);\n }\n\n function triggerRedrawOverlay() {\n var t = options.interaction.redrawOverlayInterval;\n if (t == -1) { // skip event queue\n drawOverlay();\n return;\n }\n\n if (!redrawTimeout)\n redrawTimeout = setTimeout(drawOverlay, t);\n }\n\n function drawOverlay() {\n redrawTimeout = null;\n\n // draw highlights\n octx.save();\n overlay.clear();\n octx.translate(plotOffset.left, plotOffset.top);\n\n var i, hi;\n for (i = 0; i < highlights.length; ++i) {\n hi = highlights[i];\n\n if (hi.series.bars.show)\n drawBarHighlight(hi.series, hi.point);\n else\n drawPointHighlight(hi.series, hi.point);\n }\n octx.restore();\n\n executeHooks(hooks.drawOverlay, [octx]);\n }\n\n function highlight(s, point, auto) {\n if (typeof s == \"number\")\n s = series[s];\n\n if (typeof point == \"number\") {\n var ps = s.datapoints.pointsize;\n point = s.datapoints.points.slice(ps * point, ps * (point + 1));\n }\n\n var i = indexOfHighlight(s, point);\n if (i == -1) {\n highlights.push({ series: s, point: point, auto: auto });\n\n triggerRedrawOverlay();\n }\n else if (!auto)\n highlights[i].auto = false;\n }\n\n function unhighlight(s, point) {\n if (s == null && point == null) {\n highlights = [];\n triggerRedrawOverlay();\n return;\n }\n\n if (typeof s == \"number\")\n s = series[s];\n\n if (typeof point == \"number\") {\n var ps = s.datapoints.pointsize;\n point = s.datapoints.points.slice(ps * point, ps * (point + 1));\n }\n\n var i = indexOfHighlight(s, point);\n if (i != -1) {\n highlights.splice(i, 1);\n\n triggerRedrawOverlay();\n }\n }\n\n function indexOfHighlight(s, p) {\n for (var i = 0; i < highlights.length; ++i) {\n var h = highlights[i];\n if (h.series == s && h.point[0] == p[0]\n && h.point[1] == p[1])\n return i;\n }\n return -1;\n }\n\n function drawPointHighlight(series, point) {\n var x = point[0], y = point[1],\n axisx = series.xaxis, axisy = series.yaxis,\n highlightColor = (typeof series.highlightColor === \"string\") ? series.highlightColor : $.color.parse(series.color).scale('a', 0.5).toString();\n\n if (x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max)\n return;\n\n var pointRadius = series.points.radius + series.points.lineWidth / 2;\n octx.lineWidth = pointRadius;\n octx.strokeStyle = highlightColor;\n var radius = 1.5 * pointRadius;\n x = axisx.p2c(x);\n y = axisy.p2c(y);\n\n octx.beginPath();\n if (series.points.symbol == \"circle\")\n octx.arc(x, y, radius, 0, 2 * Math.PI, false);\n else\n series.points.symbol(octx, x, y, radius, false);\n octx.closePath();\n octx.stroke();\n }\n\n function drawBarHighlight(series, point) {\n var highlightColor = (typeof series.highlightColor === \"string\") ? series.highlightColor : $.color.parse(series.color).scale('a', 0.5).toString(),\n fillStyle = highlightColor,\n barLeft;\n\n switch (series.bars.align) {\n case \"left\":\n barLeft = 0;\n break;\n case \"right\":\n barLeft = -series.bars.barWidth;\n break;\n default:\n barLeft = -series.bars.barWidth / 2;\n }\n\n octx.lineWidth = series.bars.lineWidth;\n octx.strokeStyle = highlightColor;\n\n drawBar(point[0], point[1], point[2] || 0, barLeft, barLeft + series.bars.barWidth,\n function () { return fillStyle; }, series.xaxis, series.yaxis, octx, series.bars.horizontal, series.bars.lineWidth);\n }\n\n function getColorOrGradient(spec, bottom, top, defaultColor) {\n if (typeof spec == \"string\")\n return spec;\n else {\n // assume this is a gradient spec; IE currently only\n // supports a simple vertical gradient properly, so that's\n // what we support too\n var gradient = ctx.createLinearGradient(0, top, 0, bottom);\n\n for (var i = 0, l = spec.colors.length; i < l; ++i) {\n var c = spec.colors[i];\n if (typeof c != \"string\") {\n var co = $.color.parse(defaultColor);\n if (c.brightness != null)\n co = co.scale('rgb', c.brightness);\n if (c.opacity != null)\n co.a *= c.opacity;\n c = co.toString();\n }\n gradient.addColorStop(i / (l - 1), c);\n }\n\n return gradient;\n }\n }\n }\n\n // Add the plot function to the top level of the jQuery object\n\n $.plot = function(placeholder, data, options) {\n //var t0 = new Date();\n var plot = new Plot($(placeholder), data, options, $.plot.plugins);\n //(window.console ? console.log : alert)(\"time used (msecs): \" + ((new Date()).getTime() - t0.getTime()));\n return plot;\n };\n\n $.plot.version = \"0.8.3\";\n\n $.plot.plugins = [];\n\n // Also add the plot function as a chainable property\n\n $.fn.plot = function(data, options) {\n return this.each(function() {\n $.plot(this, data, options);\n });\n };\n\n // round to nearby lower multiple of base\n function floorInBase(n, base) {\n return base * Math.floor(n / base);\n }\n\n})(jQuery);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./public/vendor/flot/jquery.flot.js\n// module id = 1985\n// module chunks = 0 1","import config from 'app/core/config';\nimport _ from 'lodash';\nimport $ from 'jquery';\nimport { appEvents, profiler } from 'app/core/core';\nimport { PanelModel } from 'app/features/dashboard/panel_model';\nimport Remarkable from 'remarkable';\nimport { GRID_CELL_HEIGHT, GRID_CELL_VMARGIN, LS_PANEL_COPY_KEY } from 'app/core/constants';\nimport store from 'app/core/store';\n\nconst TITLE_HEIGHT = 27;\nconst PANEL_BORDER = 2;\n\nimport { Emitter } from 'app/core/core';\n\nexport class PanelCtrl {\n panel: any;\n error: any;\n dashboard: any;\n editorTabIndex: number;\n pluginName: string;\n pluginId: string;\n editorTabs: any;\n $scope: any;\n $injector: any;\n $location: any;\n $timeout: any;\n fullscreen: boolean;\n inspector: any;\n editModeInitiated: boolean;\n editMode: any;\n height: any;\n containerHeight: any;\n events: Emitter;\n timing: any;\n loading: boolean;\n\n constructor($scope, $injector) {\n this.$injector = $injector;\n this.$location = $injector.get('$location');\n this.$scope = $scope;\n this.$timeout = $injector.get('$timeout');\n this.editorTabIndex = 0;\n this.events = this.panel.events;\n this.timing = {};\n\n var plugin = config.panels[this.panel.type];\n if (plugin) {\n this.pluginId = plugin.id;\n this.pluginName = plugin.name;\n }\n\n $scope.$on('refresh', () => this.refresh());\n $scope.$on('component-did-mount', () => this.panelDidMount());\n\n $scope.$on('$destroy', () => {\n this.events.emit('panel-teardown');\n this.events.removeAllListeners();\n });\n }\n\n init() {\n this.events.emit('panel-initialized');\n this.publishAppEvent('panel-initialized', { scope: this.$scope });\n }\n\n panelDidMount() {\n this.events.emit('component-did-mount');\n }\n\n renderingCompleted() {\n profiler.renderingCompleted(this.panel.id, this.timing);\n }\n\n refresh() {\n this.events.emit('refresh', null);\n }\n\n publishAppEvent(evtName, evt) {\n this.$scope.$root.appEvent(evtName, evt);\n }\n\n changeView(fullscreen, edit) {\n this.publishAppEvent('panel-change-view', {\n fullscreen: fullscreen,\n edit: edit,\n panelId: this.panel.id,\n });\n }\n\n viewPanel() {\n this.changeView(true, false);\n }\n\n editPanel() {\n this.changeView(true, true);\n }\n\n exitFullscreen() {\n this.changeView(false, false);\n }\n\n initEditMode() {\n this.editorTabs = [];\n this.addEditorTab('General', 'public/app/partials/panelgeneral.html');\n this.editModeInitiated = true;\n this.events.emit('init-edit-mode', null);\n\n var urlTab = (this.$injector.get('$routeParams').tab || '').toLowerCase();\n if (urlTab) {\n this.editorTabs.forEach((tab, i) => {\n if (tab.title.toLowerCase() === urlTab) {\n this.editorTabIndex = i;\n }\n });\n }\n }\n\n changeTab(newIndex) {\n this.editorTabIndex = newIndex;\n var route = this.$injector.get('$route');\n route.current.params.tab = this.editorTabs[newIndex].title.toLowerCase();\n route.updateParams();\n }\n\n addEditorTab(title, directiveFn, index?) {\n var editorTab = { title, directiveFn };\n\n if (_.isString(directiveFn)) {\n editorTab.directiveFn = function() {\n return { templateUrl: directiveFn };\n };\n }\n if (index) {\n this.editorTabs.splice(index, 0, editorTab);\n } else {\n this.editorTabs.push(editorTab);\n }\n }\n\n getMenu() {\n let menu = [];\n menu.push({\n text: 'View',\n click: 'ctrl.viewPanel();',\n icon: 'fa fa-fw fa-eye',\n shortcut: 'v',\n });\n\n if (this.dashboard.meta.canEdit) {\n menu.push({\n text: 'Edit',\n click: 'ctrl.editPanel();',\n role: 'Editor',\n icon: 'fa fa-fw fa-edit',\n shortcut: 'e',\n });\n }\n\n menu.push({\n text: 'Share',\n click: 'ctrl.sharePanel();',\n icon: 'fa fa-fw fa-share',\n shortcut: 'p s',\n });\n\n // Additional items from sub-class\n menu.push(...this.getAdditionalMenuItems());\n\n let extendedMenu = this.getExtendedMenu();\n menu.push({\n text: 'More ...',\n click: '',\n icon: 'fa fa-fw fa-cube',\n submenu: extendedMenu,\n });\n\n if (this.dashboard.meta.canEdit) {\n menu.push({ divider: true, role: 'Editor' });\n menu.push({\n text: 'Remove',\n click: 'ctrl.removePanel();',\n role: 'Editor',\n icon: 'fa fa-fw fa-trash',\n shortcut: 'p r',\n });\n }\n\n return menu;\n }\n\n getExtendedMenu() {\n let menu = [];\n if (!this.fullscreen && this.dashboard.meta.canEdit) {\n menu.push({\n text: 'Duplicate',\n click: 'ctrl.duplicate()',\n role: 'Editor',\n shortcut: 'p d',\n });\n }\n\n this.events.emit('init-panel-actions', menu);\n return menu;\n }\n\n // Override in sub-class to add items before extended menu\n getAdditionalMenuItems() {\n return [];\n }\n\n otherPanelInFullscreenMode() {\n return this.dashboard.meta.fullscreen && !this.fullscreen;\n }\n\n calculatePanelHeight() {\n if (this.fullscreen) {\n var docHeight = $(window).height();\n var editHeight = Math.floor(docHeight * 0.4);\n var fullscreenHeight = Math.floor(docHeight * 0.8);\n this.containerHeight = this.editMode ? editHeight : fullscreenHeight;\n } else {\n this.containerHeight = this.panel.gridPos.h * GRID_CELL_HEIGHT + (this.panel.gridPos.h - 1) * GRID_CELL_VMARGIN;\n }\n\n if (this.panel.soloMode) {\n this.containerHeight = $(window).height();\n }\n\n this.height = this.containerHeight - (PANEL_BORDER + TITLE_HEIGHT);\n }\n\n render(payload?) {\n this.timing.renderStart = new Date().getTime();\n this.events.emit('render', payload);\n }\n\n duplicate() {\n this.dashboard.duplicatePanel(this.panel);\n this.$timeout(() => {\n this.$scope.$root.$broadcast('render');\n });\n }\n\n removePanel() {\n this.publishAppEvent('panel-remove', {\n panelId: this.panel.id,\n });\n }\n\n editPanelJson() {\n let editScope = this.$scope.$root.$new();\n editScope.object = this.panel.getSaveModel();\n editScope.updateHandler = this.replacePanel.bind(this);\n editScope.enableCopy = true;\n\n this.publishAppEvent('show-modal', {\n src: 'public/app/partials/edit_json.html',\n scope: editScope,\n });\n }\n\n copyPanel() {\n store.set(LS_PANEL_COPY_KEY, JSON.stringify(this.panel.getSaveModel()));\n appEvents.emit('alert-success', ['Panel copied. Open Add Panel to paste']);\n }\n\n replacePanel(newPanel, oldPanel) {\n let dashboard = this.dashboard;\n let index = _.findIndex(dashboard.panels, panel => {\n return panel.id === oldPanel.id;\n });\n\n let deletedPanel = dashboard.panels.splice(index, 1);\n this.dashboard.events.emit('panel-removed', deletedPanel);\n\n newPanel = new PanelModel(newPanel);\n newPanel.id = oldPanel.id;\n\n dashboard.panels.splice(index, 0, newPanel);\n dashboard.sortPanelsByGridPos();\n dashboard.events.emit('panel-added', newPanel);\n }\n\n sharePanel() {\n var shareScope = this.$scope.$new();\n shareScope.panel = this.panel;\n shareScope.dashboard = this.dashboard;\n\n this.publishAppEvent('show-modal', {\n src: 'public/app/features/dashboard/partials/shareModal.html',\n scope: shareScope,\n });\n }\n\n getInfoMode() {\n if (this.error) {\n return 'error';\n }\n if (!!this.panel.description) {\n return 'info';\n }\n if (this.panel.links && this.panel.links.length) {\n return 'links';\n }\n return '';\n }\n\n getInfoContent(options) {\n var markdown = this.panel.description;\n\n if (options.mode === 'tooltip') {\n markdown = this.error || this.panel.description;\n }\n\n var linkSrv = this.$injector.get('linkSrv');\n var sanitize = this.$injector.get('$sanitize');\n var templateSrv = this.$injector.get('templateSrv');\n var interpolatedMarkdown = templateSrv.replace(markdown, this.panel.scopedVars);\n var html = '
    ';\n\n html += new Remarkable().render(interpolatedMarkdown);\n\n if (this.panel.links && this.panel.links.length > 0) {\n html += '
      ';\n for (let link of this.panel.links) {\n var info = linkSrv.getPanelLinkAnchorInfo(link, this.panel.scopedVars);\n html +=\n '
    • ' +\n info.title +\n '
    • ';\n }\n html += '
    ';\n }\n\n html += '
    ';\n return sanitize(html);\n }\n\n openInspector() {\n var modalScope = this.$scope.$new();\n modalScope.panel = this.panel;\n modalScope.dashboard = this.dashboard;\n modalScope.panelInfoHtml = this.getInfoContent({ mode: 'inspector' });\n\n modalScope.inspector = $.extend(true, {}, this.inspector);\n this.publishAppEvent('show-modal', {\n src: 'public/app/features/dashboard/partials/inspector.html',\n scope: modalScope,\n });\n }\n\n titleChanged() {\n this.panel.hasCustomTitle = true;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/panel/panel_ctrl.ts","export default class TableModel {\n columns: any[];\n rows: any[];\n type: string;\n columnMap: any;\n\n constructor() {\n this.columns = [];\n this.columnMap = {};\n this.rows = [];\n this.type = 'table';\n }\n\n sort(options) {\n if (options.col === null || this.columns.length <= options.col) {\n return;\n }\n\n this.rows.sort(function(a, b) {\n a = a[options.col];\n b = b[options.col];\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n });\n\n this.columns[options.col].sort = true;\n\n if (options.desc) {\n this.rows.reverse();\n this.columns[options.col].desc = true;\n } else {\n this.columns[options.col].desc = false;\n }\n }\n\n addColumn(col) {\n if (!this.columnMap[col.text]) {\n this.columns.push(col);\n this.columnMap[col.text] = col;\n }\n }\n\n addRow(row) {\n this.rows.push(row);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/core/table_model.ts","import _ from 'lodash';\n\nexport const metricAggTypes = [\n { text: 'Count', value: 'count', requiresField: false },\n {\n text: 'Average',\n value: 'avg',\n requiresField: true,\n supportsInlineScript: true,\n supportsMissing: true,\n },\n {\n text: 'Sum',\n value: 'sum',\n requiresField: true,\n supportsInlineScript: true,\n supportsMissing: true,\n },\n {\n text: 'Max',\n value: 'max',\n requiresField: true,\n supportsInlineScript: true,\n supportsMissing: true,\n },\n {\n text: 'Min',\n value: 'min',\n requiresField: true,\n supportsInlineScript: true,\n supportsMissing: true,\n },\n {\n text: 'Extended Stats',\n value: 'extended_stats',\n requiresField: true,\n supportsMissing: true,\n supportsInlineScript: true,\n },\n {\n text: 'Percentiles',\n value: 'percentiles',\n requiresField: true,\n supportsMissing: true,\n supportsInlineScript: true,\n },\n {\n text: 'Unique Count',\n value: 'cardinality',\n requiresField: true,\n supportsMissing: true,\n },\n {\n text: 'Moving Average',\n value: 'moving_avg',\n requiresField: false,\n isPipelineAgg: true,\n minVersion: 2,\n },\n {\n text: 'Derivative',\n value: 'derivative',\n requiresField: false,\n isPipelineAgg: true,\n minVersion: 2,\n },\n { text: 'Raw Document', value: 'raw_document', requiresField: false },\n];\n\nexport const bucketAggTypes = [\n { text: 'Terms', value: 'terms', requiresField: true },\n { text: 'Filters', value: 'filters' },\n { text: 'Geo Hash Grid', value: 'geohash_grid', requiresField: true },\n { text: 'Date Histogram', value: 'date_histogram', requiresField: true },\n { text: 'Histogram', value: 'histogram', requiresField: true },\n];\n\nexport const orderByOptions = [{ text: 'Doc Count', value: '_count' }, { text: 'Term value', value: '_term' }];\n\nexport const orderOptions = [{ text: 'Top', value: 'desc' }, { text: 'Bottom', value: 'asc' }];\n\nexport const sizeOptions = [\n { text: 'No limit', value: '0' },\n { text: '1', value: '1' },\n { text: '2', value: '2' },\n { text: '3', value: '3' },\n { text: '5', value: '5' },\n { text: '10', value: '10' },\n { text: '15', value: '15' },\n { text: '20', value: '20' },\n];\n\nexport const extendedStats = [\n { text: 'Avg', value: 'avg' },\n { text: 'Min', value: 'min' },\n { text: 'Max', value: 'max' },\n { text: 'Sum', value: 'sum' },\n { text: 'Count', value: 'count' },\n { text: 'Std Dev', value: 'std_deviation' },\n { text: 'Std Dev Upper', value: 'std_deviation_bounds_upper' },\n { text: 'Std Dev Lower', value: 'std_deviation_bounds_lower' },\n];\n\nexport const intervalOptions = [\n { text: 'auto', value: 'auto' },\n { text: '10s', value: '10s' },\n { text: '1m', value: '1m' },\n { text: '5m', value: '5m' },\n { text: '10m', value: '10m' },\n { text: '20m', value: '20m' },\n { text: '1h', value: '1h' },\n { text: '1d', value: '1d' },\n];\n\nexport const movingAvgModelOptions = [\n { text: 'Simple', value: 'simple' },\n { text: 'Linear', value: 'linear' },\n { text: 'Exponentially Weighted', value: 'ewma' },\n { text: 'Holt Linear', value: 'holt' },\n { text: 'Holt Winters', value: 'holt_winters' },\n];\n\nexport const pipelineOptions = {\n moving_avg: [\n { text: 'window', default: 5 },\n { text: 'model', default: 'simple' },\n { text: 'predict', default: undefined },\n { text: 'minimize', default: false },\n ],\n derivative: [{ text: 'unit', default: undefined }],\n};\n\nexport const movingAvgModelSettings = {\n simple: [],\n linear: [],\n ewma: [{ text: 'Alpha', value: 'alpha', default: undefined }],\n holt: [{ text: 'Alpha', value: 'alpha', default: undefined }, { text: 'Beta', value: 'beta', default: undefined }],\n holt_winters: [\n { text: 'Alpha', value: 'alpha', default: undefined },\n { text: 'Beta', value: 'beta', default: undefined },\n { text: 'Gamma', value: 'gamma', default: undefined },\n { text: 'Period', value: 'period', default: undefined },\n { text: 'Pad', value: 'pad', default: undefined, isCheckbox: true },\n ],\n};\n\nexport function getMetricAggTypes(esVersion) {\n return _.filter(metricAggTypes, function(f) {\n if (f.minVersion) {\n return f.minVersion <= esVersion;\n } else {\n return true;\n }\n });\n}\n\nexport function getPipelineOptions(metric) {\n if (!isPipelineAgg(metric.type)) {\n return [];\n }\n\n return pipelineOptions[metric.type];\n}\n\nexport function isPipelineAgg(metricType) {\n if (metricType) {\n var po = pipelineOptions[metricType];\n return po !== null && po !== undefined;\n }\n\n return false;\n}\n\nexport function getPipelineAggOptions(targets) {\n var result = [];\n _.each(targets.metrics, function(metric) {\n if (!isPipelineAgg(metric.type)) {\n result.push({ text: describeMetric(metric), value: metric.id });\n }\n });\n\n return result;\n}\n\nexport function getMovingAvgSettings(model, filtered) {\n var filteredResult = [];\n if (filtered) {\n _.each(movingAvgModelSettings[model], function(setting) {\n if (!setting.isCheckbox) {\n filteredResult.push(setting);\n }\n });\n return filteredResult;\n }\n return movingAvgModelSettings[model];\n}\n\nexport function getOrderByOptions(target) {\n var metricRefs = [];\n _.each(target.metrics, function(metric) {\n if (metric.type !== 'count') {\n metricRefs.push({ text: describeMetric(metric), value: metric.id });\n }\n });\n\n return orderByOptions.concat(metricRefs);\n}\n\nexport function describeOrder(order) {\n var def = _.find(orderOptions, { value: order });\n return def.text;\n}\n\nexport function describeMetric(metric) {\n var def = _.find(metricAggTypes, { value: metric.type });\n return def.text + ' ' + metric.field;\n}\n\nexport function describeOrderBy(orderBy, target) {\n var def = _.find(orderByOptions, { value: orderBy });\n if (def) {\n return def.text;\n }\n var metric = _.find(target.metrics, { id: orderBy });\n if (metric) {\n return describeMetric(metric);\n } else {\n return 'metric not found';\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/elasticsearch/query_def.ts","/* Pretty handling of time axes.\n\nCopyright (c) 2007-2013 IOLA and Ole Laursen.\nLicensed under the MIT license.\n\nSet axis.mode to \"time\" to enable. See the section \"Time series data\" in\nAPI.txt for details.\n\n*/\n\n(function($) {\n\n\tvar options = {\n\t\txaxis: {\n\t\t\ttimezone: null,\t\t// \"browser\" for local to the client or timezone for timezone-js\n\t\t\ttimeformat: null,\t// format string to use\n\t\t\ttwelveHourClock: false,\t// 12 or 24 time in time mode\n\t\t\tmonthNames: null\t// list of names of months\n\t\t}\n\t};\n\n\t// round to nearby lower multiple of base\n\n\tfunction floorInBase(n, base) {\n\t\treturn base * Math.floor(n / base);\n\t}\n\n\t// Returns a string with the date d formatted according to fmt.\n\t// A subset of the Open Group's strftime format is supported.\n\n\tfunction formatDate(d, fmt, monthNames, dayNames) {\n\n\t\tif (typeof d.strftime == \"function\") {\n\t\t\treturn d.strftime(fmt);\n\t\t}\n\n\t\tvar leftPad = function(n, pad) {\n\t\t\tn = \"\" + n;\n\t\t\tpad = \"\" + (pad == null ? \"0\" : pad);\n\t\t\treturn n.length == 1 ? pad + n : n;\n\t\t};\n\n\t\tvar r = [];\n\t\tvar escape = false;\n\t\tvar hours = d.getHours();\n\t\tvar isAM = hours < 12;\n\n\t\tif (monthNames == null) {\n\t\t\tmonthNames = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n\t\t}\n\n\t\tif (dayNames == null) {\n\t\t\tdayNames = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\n\t\t}\n\n\t\tvar hours12;\n\n\t\tif (hours > 12) {\n\t\t\thours12 = hours - 12;\n\t\t} else if (hours == 0) {\n\t\t\thours12 = 12;\n\t\t} else {\n\t\t\thours12 = hours;\n\t\t}\n\n\t\tfor (var i = 0; i < fmt.length; ++i) {\n\n\t\t\tvar c = fmt.charAt(i);\n\n\t\t\tif (escape) {\n\t\t\t\tswitch (c) {\n\t\t\t\t\tcase 'a': c = \"\" + dayNames[d.getDay()]; break;\n\t\t\t\t\tcase 'b': c = \"\" + monthNames[d.getMonth()]; break;\n\t\t\t\t\tcase 'd': c = leftPad(d.getDate(), \"\"); break;\n\t\t\t\t\tcase 'e': c = leftPad(d.getDate(), \" \"); break;\n\t\t\t\t\tcase 'h':\t// For back-compat with 0.7; remove in 1.0\n\t\t\t\t\tcase 'H': c = leftPad(hours); break;\n\t\t\t\t\tcase 'I': c = leftPad(hours12); break;\n\t\t\t\t\tcase 'l': c = leftPad(hours12, \" \"); break;\n\t\t\t\t\tcase 'm': c = leftPad(d.getMonth() + 1, \"\"); break;\n\t\t\t\t\tcase 'M': c = leftPad(d.getMinutes()); break;\n\t\t\t\t\t// quarters not in Open Group's strftime specification\n\t\t\t\t\tcase 'q':\n\t\t\t\t\t\tc = \"\" + (Math.floor(d.getMonth() / 3) + 1); break;\n\t\t\t\t\tcase 'S': c = leftPad(d.getSeconds()); break;\n\t\t\t\t\tcase 'y': c = leftPad(d.getFullYear() % 100); break;\n\t\t\t\t\tcase 'Y': c = \"\" + d.getFullYear(); break;\n\t\t\t\t\tcase 'p': c = (isAM) ? (\"\" + \"am\") : (\"\" + \"pm\"); break;\n\t\t\t\t\tcase 'P': c = (isAM) ? (\"\" + \"AM\") : (\"\" + \"PM\"); break;\n\t\t\t\t\tcase 'w': c = \"\" + d.getDay(); break;\n\t\t\t\t}\n\t\t\t\tr.push(c);\n\t\t\t\tescape = false;\n\t\t\t} else {\n\t\t\t\tif (c == \"%\") {\n\t\t\t\t\tescape = true;\n\t\t\t\t} else {\n\t\t\t\t\tr.push(c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn r.join(\"\");\n\t}\n\n\t// To have a consistent view of time-based data independent of which time\n\t// zone the client happens to be in we need a date-like object independent\n\t// of time zones. This is done through a wrapper that only calls the UTC\n\t// versions of the accessor methods.\n\n\tfunction makeUtcWrapper(d) {\n\n\t\tfunction addProxyMethod(sourceObj, sourceMethod, targetObj, targetMethod) {\n\t\t\tsourceObj[sourceMethod] = function() {\n\t\t\t\treturn targetObj[targetMethod].apply(targetObj, arguments);\n\t\t\t};\n\t\t};\n\n\t\tvar utc = {\n\t\t\tdate: d\n\t\t};\n\n\t\t// support strftime, if found\n\n\t\tif (d.strftime != undefined) {\n\t\t\taddProxyMethod(utc, \"strftime\", d, \"strftime\");\n\t\t}\n\n\t\taddProxyMethod(utc, \"getTime\", d, \"getTime\");\n\t\taddProxyMethod(utc, \"setTime\", d, \"setTime\");\n\n\t\tvar props = [\"Date\", \"Day\", \"FullYear\", \"Hours\", \"Milliseconds\", \"Minutes\", \"Month\", \"Seconds\"];\n\n\t\tfor (var p = 0; p < props.length; p++) {\n\t\t\taddProxyMethod(utc, \"get\" + props[p], d, \"getUTC\" + props[p]);\n\t\t\taddProxyMethod(utc, \"set\" + props[p], d, \"setUTC\" + props[p]);\n\t\t}\n\n\t\treturn utc;\n\t};\n\n\t// select time zone strategy. This returns a date-like object tied to the\n\t// desired timezone\n\n\tfunction dateGenerator(ts, opts) {\n\t\tif (opts.timezone == \"browser\") {\n\t\t\treturn new Date(ts);\n\t\t} else if (!opts.timezone || opts.timezone == \"utc\") {\n\t\t\treturn makeUtcWrapper(new Date(ts));\n\t\t} else if (typeof timezoneJS != \"undefined\" && typeof timezoneJS.Date != \"undefined\") {\n\t\t\tvar d = new timezoneJS.Date();\n\t\t\t// timezone-js is fickle, so be sure to set the time zone before\n\t\t\t// setting the time.\n\t\t\td.setTimezone(opts.timezone);\n\t\t\td.setTime(ts);\n\t\t\treturn d;\n\t\t} else {\n\t\t\treturn makeUtcWrapper(new Date(ts));\n\t\t}\n\t}\n\n\t// map of app. size of time units in milliseconds\n\n\tvar timeUnitSize = {\n\t\t\"second\": 1000,\n\t\t\"minute\": 60 * 1000,\n\t\t\"hour\": 60 * 60 * 1000,\n\t\t\"day\": 24 * 60 * 60 * 1000,\n\t\t\"month\": 30 * 24 * 60 * 60 * 1000,\n\t\t\"quarter\": 3 * 30 * 24 * 60 * 60 * 1000,\n\t\t\"year\": 365.2425 * 24 * 60 * 60 * 1000\n\t};\n\n\t// the allowed tick sizes, after 1 year we use\n\t// an integer algorithm\n\n\tvar baseSpec = [\n\t\t[1, \"second\"], [2, \"second\"], [5, \"second\"], [10, \"second\"],\n\t\t[30, \"second\"],\n\t\t[1, \"minute\"], [2, \"minute\"], [5, \"minute\"], [10, \"minute\"],\n\t\t[30, \"minute\"],\n\t\t[1, \"hour\"], [2, \"hour\"], [4, \"hour\"],\n\t\t[8, \"hour\"], [12, \"hour\"],\n\t\t[1, \"day\"], [2, \"day\"], [3, \"day\"],\n\t\t[0.25, \"month\"], [0.5, \"month\"], [1, \"month\"],\n\t\t[2, \"month\"]\n\t];\n\n\t// we don't know which variant(s) we'll need yet, but generating both is\n\t// cheap\n\n\tvar specMonths = baseSpec.concat([[3, \"month\"], [6, \"month\"],\n\t\t[1, \"year\"]]);\n\tvar specQuarters = baseSpec.concat([[1, \"quarter\"], [2, \"quarter\"],\n\t\t[1, \"year\"]]);\n\n\tfunction init(plot) {\n\t\tplot.hooks.processOptions.push(function (plot, options) {\n\t\t\t$.each(plot.getAxes(), function(axisName, axis) {\n\n\t\t\t\tvar opts = axis.options;\n\n\t\t\t\tif (opts.mode == \"time\") {\n\t\t\t\t\taxis.tickGenerator = function(axis) {\n\n\t\t\t\t\t\tvar ticks = [];\n\t\t\t\t\t\tvar d = dateGenerator(axis.min, opts);\n\t\t\t\t\t\tvar minSize = 0;\n\n\t\t\t\t\t\t// make quarter use a possibility if quarters are\n\t\t\t\t\t\t// mentioned in either of these options\n\n\t\t\t\t\t\tvar spec = (opts.tickSize && opts.tickSize[1] ===\n\t\t\t\t\t\t\t\"quarter\") ||\n\t\t\t\t\t\t\t(opts.minTickSize && opts.minTickSize[1] ===\n\t\t\t\t\t\t\t\"quarter\") ? specQuarters : specMonths;\n\n\t\t\t\t\t\tif (opts.minTickSize != null) {\n\t\t\t\t\t\t\tif (typeof opts.tickSize == \"number\") {\n\t\t\t\t\t\t\t\tminSize = opts.tickSize;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tminSize = opts.minTickSize[0] * timeUnitSize[opts.minTickSize[1]];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (var i = 0; i < spec.length - 1; ++i) {\n\t\t\t\t\t\t\tif (axis.delta < (spec[i][0] * timeUnitSize[spec[i][1]]\n\t\t\t\t\t\t\t\t\t\t\t + spec[i + 1][0] * timeUnitSize[spec[i + 1][1]]) / 2\n\t\t\t\t\t\t\t\t&& spec[i][0] * timeUnitSize[spec[i][1]] >= minSize) {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar size = spec[i][0];\n\t\t\t\t\t\tvar unit = spec[i][1];\n\n\t\t\t\t\t\t// special-case the possibility of several years\n\n\t\t\t\t\t\tif (unit == \"year\") {\n\n\t\t\t\t\t\t\t// if given a minTickSize in years, just use it,\n\t\t\t\t\t\t\t// ensuring that it's an integer\n\n\t\t\t\t\t\t\tif (opts.minTickSize != null && opts.minTickSize[1] == \"year\") {\n\t\t\t\t\t\t\t\tsize = Math.floor(opts.minTickSize[0]);\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tvar magn = Math.pow(10, Math.floor(Math.log(axis.delta / timeUnitSize.year) / Math.LN10));\n\t\t\t\t\t\t\t\tvar norm = (axis.delta / timeUnitSize.year) / magn;\n\n\t\t\t\t\t\t\t\tif (norm < 1.5) {\n\t\t\t\t\t\t\t\t\tsize = 1;\n\t\t\t\t\t\t\t\t} else if (norm < 3) {\n\t\t\t\t\t\t\t\t\tsize = 2;\n\t\t\t\t\t\t\t\t} else if (norm < 7.5) {\n\t\t\t\t\t\t\t\t\tsize = 5;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tsize = 10;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tsize *= magn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// minimum size for years is 1\n\n\t\t\t\t\t\t\tif (size < 1) {\n\t\t\t\t\t\t\t\tsize = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\taxis.tickSize = opts.tickSize || [size, unit];\n\t\t\t\t\t\tvar tickSize = axis.tickSize[0];\n\t\t\t\t\t\tunit = axis.tickSize[1];\n\n\t\t\t\t\t\tvar step = tickSize * timeUnitSize[unit];\n\n\t\t\t\t\t\tif (unit == \"second\") {\n\t\t\t\t\t\t\td.setSeconds(floorInBase(d.getSeconds(), tickSize));\n\t\t\t\t\t\t} else if (unit == \"minute\") {\n\t\t\t\t\t\t\td.setMinutes(floorInBase(d.getMinutes(), tickSize));\n\t\t\t\t\t\t} else if (unit == \"hour\") {\n\t\t\t\t\t\t\td.setHours(floorInBase(d.getHours(), tickSize));\n\t\t\t\t\t\t} else if (unit == \"month\") {\n\t\t\t\t\t\t\td.setMonth(floorInBase(d.getMonth(), tickSize));\n\t\t\t\t\t\t} else if (unit == \"quarter\") {\n\t\t\t\t\t\t\td.setMonth(3 * floorInBase(d.getMonth() / 3,\n\t\t\t\t\t\t\t\ttickSize));\n\t\t\t\t\t\t} else if (unit == \"year\") {\n\t\t\t\t\t\t\td.setFullYear(floorInBase(d.getFullYear(), tickSize));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// reset smaller components\n\n\t\t\t\t\t\td.setMilliseconds(0);\n\n\t\t\t\t\t\tif (step >= timeUnitSize.minute) {\n\t\t\t\t\t\t\td.setSeconds(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (step >= timeUnitSize.hour) {\n\t\t\t\t\t\t\td.setMinutes(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (step >= timeUnitSize.day) {\n\t\t\t\t\t\t\td.setHours(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (step >= timeUnitSize.day * 4) {\n\t\t\t\t\t\t\td.setDate(1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (step >= timeUnitSize.month * 2) {\n\t\t\t\t\t\t\td.setMonth(floorInBase(d.getMonth(), 3));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (step >= timeUnitSize.quarter * 2) {\n\t\t\t\t\t\t\td.setMonth(floorInBase(d.getMonth(), 6));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (step >= timeUnitSize.year) {\n\t\t\t\t\t\t\td.setMonth(0);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar carry = 0;\n\t\t\t\t\t\tvar v = Number.NaN;\n\t\t\t\t\t\tvar prev;\n\n\t\t\t\t\t\tdo {\n\n\t\t\t\t\t\t\tprev = v;\n\t\t\t\t\t\t\tv = d.getTime();\n\t\t\t\t\t\t\tticks.push(v);\n\n\t\t\t\t\t\t\tif (unit == \"month\" || unit == \"quarter\") {\n\t\t\t\t\t\t\t\tif (tickSize < 1) {\n\n\t\t\t\t\t\t\t\t\t// a bit complicated - we'll divide the\n\t\t\t\t\t\t\t\t\t// month/quarter up but we need to take\n\t\t\t\t\t\t\t\t\t// care of fractions so we don't end up in\n\t\t\t\t\t\t\t\t\t// the middle of a day\n\n\t\t\t\t\t\t\t\t\td.setDate(1);\n\t\t\t\t\t\t\t\t\tvar start = d.getTime();\n\t\t\t\t\t\t\t\t\td.setMonth(d.getMonth() +\n\t\t\t\t\t\t\t\t\t\t(unit == \"quarter\" ? 3 : 1));\n\t\t\t\t\t\t\t\t\tvar end = d.getTime();\n\t\t\t\t\t\t\t\t\td.setTime(v + carry * timeUnitSize.hour + (end - start) * tickSize);\n\t\t\t\t\t\t\t\t\tcarry = d.getHours();\n\t\t\t\t\t\t\t\t\td.setHours(0);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\td.setMonth(d.getMonth() +\n\t\t\t\t\t\t\t\t\t\ttickSize * (unit == \"quarter\" ? 3 : 1));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (unit == \"year\") {\n\t\t\t\t\t\t\t\td.setFullYear(d.getFullYear() + tickSize);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\td.setTime(v + step);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} while (v < axis.max && v != prev);\n\n\t\t\t\t\t\treturn ticks;\n\t\t\t\t\t};\n\n\t\t\t\t\taxis.tickFormatter = function (v, axis) {\n\n\t\t\t\t\t\tvar d = dateGenerator(v, axis.options);\n\n\t\t\t\t\t\t// first check global format\n\n\t\t\t\t\t\tif (opts.timeformat != null) {\n\t\t\t\t\t\t\treturn formatDate(d, opts.timeformat, opts.monthNames, opts.dayNames);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// possibly use quarters if quarters are mentioned in\n\t\t\t\t\t\t// any of these places\n\n\t\t\t\t\t\tvar useQuarters = (axis.options.tickSize &&\n\t\t\t\t\t\t\t\taxis.options.tickSize[1] == \"quarter\") ||\n\t\t\t\t\t\t\t(axis.options.minTickSize &&\n\t\t\t\t\t\t\t\taxis.options.minTickSize[1] == \"quarter\");\n\n\t\t\t\t\t\tvar t = axis.tickSize[0] * timeUnitSize[axis.tickSize[1]];\n\t\t\t\t\t\tvar span = axis.max - axis.min;\n\t\t\t\t\t\tvar suffix = (opts.twelveHourClock) ? \" %p\" : \"\";\n\t\t\t\t\t\tvar hourCode = (opts.twelveHourClock) ? \"%I\" : \"%H\";\n\t\t\t\t\t\tvar fmt;\n\n\t\t\t\t\t\tif (t < timeUnitSize.minute) {\n\t\t\t\t\t\t\tfmt = hourCode + \":%M:%S\" + suffix;\n\t\t\t\t\t\t} else if (t < timeUnitSize.day) {\n\t\t\t\t\t\t\tif (span < 2 * timeUnitSize.day) {\n\t\t\t\t\t\t\t\tfmt = hourCode + \":%M\" + suffix;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tfmt = \"%b %d \" + hourCode + \":%M\" + suffix;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (t < timeUnitSize.month) {\n\t\t\t\t\t\t\tfmt = \"%b %d\";\n\t\t\t\t\t\t} else if ((useQuarters && t < timeUnitSize.quarter) ||\n\t\t\t\t\t\t\t(!useQuarters && t < timeUnitSize.year)) {\n\t\t\t\t\t\t\tif (span < timeUnitSize.year) {\n\t\t\t\t\t\t\t\tfmt = \"%b\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tfmt = \"%b %Y\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (useQuarters && t < timeUnitSize.year) {\n\t\t\t\t\t\t\tif (span < timeUnitSize.year) {\n\t\t\t\t\t\t\t\tfmt = \"Q%q\";\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tfmt = \"Q%q %Y\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfmt = \"%Y\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar rt = formatDate(d, fmt, opts.monthNames, opts.dayNames);\n\n\t\t\t\t\t\treturn rt;\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n\n\t$.plot.plugins.push({\n\t\tinit: init,\n\t\toptions: options,\n\t\tname: 'time',\n\t\tversion: '1.0'\n\t});\n\n\t// Time-axis support used to be in Flot core, which exposed the\n\t// formatDate function on the plot object. Various plugins depend\n\t// on the function, so we need to re-expose it here.\n\n\t$.plot.formatDate = formatDate;\n\n})(jQuery);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./public/vendor/flot/jquery.flot.time.js\n// module id = 1989\n// module chunks = 0 1","import System from 'systemjs/dist/system.js';\nimport _ from 'lodash';\nimport * as sdk from 'app/plugins/sdk';\nimport kbn from 'app/core/utils/kbn';\nimport moment from 'moment';\nimport angular from 'angular';\nimport jquery from 'jquery';\n\n// Experimental module exports\nimport prismjs from 'prismjs';\nimport slate from 'slate';\nimport slateReact from 'slate-react';\nimport slatePlain from 'slate-plain-serializer';\nimport react from 'react';\nimport reactDom from 'react-dom';\n\nimport config from 'app/core/config';\nimport TimeSeries from 'app/core/time_series2';\nimport TableModel from 'app/core/table_model';\nimport { coreModule, appEvents, contextSrv } from 'app/core/core';\nimport * as datemath from 'app/core/utils/datemath';\nimport * as fileExport from 'app/core/utils/file_export';\nimport * as flatten from 'app/core/utils/flatten';\nimport * as ticks from 'app/core/utils/ticks';\nimport impressionSrv from 'app/core/services/impression_srv';\nimport builtInPlugins from './built_in_plugins';\nimport * as d3 from 'd3';\n\n// rxjs\nimport { Observable } from 'rxjs/Observable';\nimport { Subject } from 'rxjs/Subject';\n\n// these imports add functions to Observable\nimport 'rxjs/add/observable/empty';\nimport 'rxjs/add/observable/from';\nimport 'rxjs/add/operator/map';\nimport 'rxjs/add/operator/combineAll';\n\n// add cache busting\nconst bust = `?_cache=${Date.now()}`;\nfunction locate(load) {\n return load.address + bust;\n}\nSystem.registry.set('plugin-loader', System.newModule({ locate: locate }));\n\nSystem.config({\n baseURL: 'public',\n defaultExtension: 'js',\n packages: {\n plugins: {\n defaultExtension: 'js',\n },\n },\n map: {\n text: 'vendor/plugin-text/text.js',\n css: 'vendor/plugin-css/css.js',\n },\n meta: {\n 'plugin*': {\n esModule: true,\n authorization: true,\n loader: 'plugin-loader',\n },\n },\n});\n\nfunction exposeToPlugin(name: string, component: any) {\n System.registerDynamic(name, [], true, function(require, exports, module) {\n module.exports = component;\n });\n}\n\nexposeToPlugin('lodash', _);\nexposeToPlugin('moment', moment);\nexposeToPlugin('jquery', jquery);\nexposeToPlugin('angular', angular);\nexposeToPlugin('d3', d3);\nexposeToPlugin('rxjs/Subject', Subject);\nexposeToPlugin('rxjs/Observable', Observable);\n\n// Experimental modules\nexposeToPlugin('prismjs', prismjs);\nexposeToPlugin('slate', slate);\nexposeToPlugin('slate-react', slateReact);\nexposeToPlugin('slate-plain-serializer', slatePlain);\nexposeToPlugin('react', react);\nexposeToPlugin('react-dom', reactDom);\n\n// backward compatible path\nexposeToPlugin('vendor/npm/rxjs/Rx', {\n Subject: Subject,\n Observable: Observable,\n});\n\nexposeToPlugin('app/features/dashboard/impression_store', {\n impressions: impressionSrv,\n __esModule: true,\n});\n\nexposeToPlugin('app/plugins/sdk', sdk);\nexposeToPlugin('app/core/utils/datemath', datemath);\nexposeToPlugin('app/core/utils/file_export', fileExport);\nexposeToPlugin('app/core/utils/flatten', flatten);\nexposeToPlugin('app/core/utils/kbn', kbn);\nexposeToPlugin('app/core/utils/ticks', ticks);\n\nexposeToPlugin('app/core/config', config);\nexposeToPlugin('app/core/time_series', TimeSeries);\nexposeToPlugin('app/core/time_series2', TimeSeries);\nexposeToPlugin('app/core/table_model', TableModel);\nexposeToPlugin('app/core/app_events', appEvents);\nexposeToPlugin('app/core/core_module', coreModule);\nexposeToPlugin('app/core/core', {\n coreModule: coreModule,\n appEvents: appEvents,\n contextSrv: contextSrv,\n __esModule: true,\n});\n\nimport 'vendor/flot/jquery.flot';\nimport 'vendor/flot/jquery.flot.selection';\nimport 'vendor/flot/jquery.flot.time';\nimport 'vendor/flot/jquery.flot.stack';\nimport 'vendor/flot/jquery.flot.pie';\nimport 'vendor/flot/jquery.flot.stackpercent';\nimport 'vendor/flot/jquery.flot.fillbelow';\nimport 'vendor/flot/jquery.flot.crosshair';\nimport 'vendor/flot/jquery.flot.dashes';\n\nconst flotDeps = [\n 'jquery.flot',\n 'jquery.flot.pie',\n 'jquery.flot.time',\n 'jquery.flot.fillbelow',\n 'jquery.flot.crosshair',\n 'jquery.flot.stack',\n 'jquery.flot.selection',\n 'jquery.flot.stackpercent',\n 'jquery.flot.events',\n];\nfor (let flotDep of flotDeps) {\n exposeToPlugin(flotDep, { fakeDep: 1 });\n}\n\nexport function importPluginModule(path: string): Promise {\n let builtIn = builtInPlugins[path];\n if (builtIn) {\n return Promise.resolve(builtIn);\n }\n return System.import(path);\n}\n\nexport function loadPluginCss(options) {\n if (config.bootData.user.lightTheme) {\n System.import(options.light + '!css');\n } else {\n System.import(options.dark + '!css');\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/plugins/plugin_loader.ts","import _ from 'lodash';\n\nlet VALUE_INDEX = 0;\nlet TIME_INDEX = 1;\n\ninterface XBucket {\n x: number;\n buckets: any;\n}\n\ninterface YBucket {\n y: number;\n values: number[];\n}\n\n/**\n * Convert histogram represented by the list of series to heatmap object.\n * @param seriesList List of time series\n */\nfunction histogramToHeatmap(seriesList) {\n let heatmap = {};\n\n for (let i = 0; i < seriesList.length; i++) {\n let series = seriesList[i];\n let bound = i;\n if (isNaN(bound)) {\n return heatmap;\n }\n\n for (let point of series.datapoints) {\n let count = point[VALUE_INDEX];\n let time = point[TIME_INDEX];\n\n if (!_.isNumber(count)) {\n continue;\n }\n\n let bucket = heatmap[time];\n if (!bucket) {\n bucket = heatmap[time] = { x: time, buckets: {} };\n }\n\n bucket.buckets[bound] = {\n y: bound,\n count: count,\n bounds: {\n top: null,\n bottom: bound,\n },\n values: [],\n points: [],\n };\n }\n }\n\n return heatmap;\n}\n\n/**\n * Sort series representing histogram by label value.\n */\nfunction sortSeriesByLabel(s1, s2) {\n let label1, label2;\n\n try {\n // fail if not integer. might happen with bad queries\n label1 = parseHistogramLabel(s1.label);\n label2 = parseHistogramLabel(s2.label);\n } catch (err) {\n console.log(err.message || err);\n return 0;\n }\n\n if (label1 > label2) {\n return 1;\n }\n\n if (label1 < label2) {\n return -1;\n }\n\n return 0;\n}\n\nfunction parseHistogramLabel(label: string): number {\n if (label === '+Inf' || label === 'inf') {\n return +Infinity;\n }\n const value = Number(label);\n if (isNaN(value)) {\n throw new Error(`Error parsing histogram label: ${label} is not a number`);\n }\n return value;\n}\n\n/**\n * Convert buckets into linear array of \"cards\" - objects, represented heatmap elements.\n * @param {Object} buckets\n * @return {Array} Array of \"card\" objects\n */\nfunction convertToCards(buckets) {\n let min = 0,\n max = 0;\n let cards = [];\n _.forEach(buckets, xBucket => {\n _.forEach(xBucket.buckets, yBucket => {\n let card = {\n x: xBucket.x,\n y: yBucket.y,\n yBounds: yBucket.bounds,\n values: yBucket.values,\n count: yBucket.count,\n };\n cards.push(card);\n\n if (cards.length === 1) {\n min = yBucket.count;\n max = yBucket.count;\n }\n\n min = yBucket.count < min ? yBucket.count : min;\n max = yBucket.count > max ? yBucket.count : max;\n });\n });\n\n let cardStats = { min, max };\n return { cards, cardStats };\n}\n\n/**\n * Special method for log scales. When series converted into buckets with log scale,\n * for simplification, 0 values are converted into 0, not into -Infinity. On the other hand, we mean\n * that all values less than series minimum, is 0 values, and we create special \"minimum\" bucket for\n * that values (actually, there're no values less than minimum, so this bucket is empty).\n * 8-16| | ** | | * | **|\n * 4-8| * |* *|* |** *| * |\n * 2-4| * *| | ***| |* |\n * 1-2|* | | | | | This bucket contains minimum series value\n * 0.5-1|____|____|____|____|____| This bucket should be displayed as 0 on graph\n * 0|____|____|____|____|____| This bucket is for 0 values (should actually be -Infinity)\n * So we should merge two bottom buckets into one (0-value bucket).\n *\n * @param {Object} buckets Heatmap buckets\n * @param {Number} minValue Minimum series value\n * @return {Object} Transformed buckets\n */\nfunction mergeZeroBuckets(buckets, minValue) {\n _.forEach(buckets, xBucket => {\n let yBuckets = xBucket.buckets;\n\n let emptyBucket = {\n bounds: { bottom: 0, top: 0 },\n values: [],\n points: [],\n count: 0,\n };\n\n let nullBucket = yBuckets[0] || emptyBucket;\n let minBucket = yBuckets[minValue] || emptyBucket;\n\n let newBucket = {\n y: 0,\n bounds: { bottom: minValue, top: minBucket.bounds.top || minValue },\n values: [],\n points: [],\n count: 0,\n };\n\n newBucket.points = nullBucket.points.concat(minBucket.points);\n newBucket.values = nullBucket.values.concat(minBucket.values);\n newBucket.count = newBucket.values.length;\n\n if (newBucket.count === 0) {\n return;\n }\n\n delete yBuckets[minValue];\n yBuckets[0] = newBucket;\n });\n\n return buckets;\n}\n\n/**\n * Convert set of time series into heatmap buckets\n * @return {Object} Heatmap object:\n * {\n * xBucketBound_1: {\n * x: xBucketBound_1,\n * buckets: {\n * yBucketBound_1: {\n * y: yBucketBound_1,\n * bounds: {bottom, top}\n * values: [val_1, val_2, ..., val_K],\n * points: [[val_Y, val_X, series_name], ..., [...]],\n * seriesStat: {seriesName_1: val_1, seriesName_2: val_2}\n * },\n * ...\n * yBucketBound_M: {}\n * },\n * values: [val_1, val_2, ..., val_K],\n * points: [\n * [val_Y, val_X, series_name], (point_1)\n * ...\n * [...] (point_K)\n * ]\n * },\n * xBucketBound_2: {},\n * ...\n * xBucketBound_N: {}\n * }\n */\nfunction convertToHeatMap(seriesList, yBucketSize, xBucketSize, logBase = 1) {\n let heatmap = {};\n\n for (let series of seriesList) {\n let datapoints = series.datapoints;\n let seriesName = series.label;\n\n // Slice series into X axis buckets\n // | | ** | | * | **|\n // | * |* *|* |** *| * |\n // |** *| | ***| |* |\n // |____|____|____|____|____|_\n //\n _.forEach(datapoints, point => {\n let bucketBound = getBucketBound(point[TIME_INDEX], xBucketSize);\n pushToXBuckets(heatmap, point, bucketBound, seriesName);\n });\n }\n\n // Slice X axis buckets into Y (value) buckets\n // | **| |2|,\n // | * | --\\ |1|,\n // |* | --/ |1|,\n // |____| |0|\n //\n _.forEach(heatmap, xBucket => {\n if (logBase !== 1) {\n xBucket.buckets = convertToLogScaleValueBuckets(xBucket, yBucketSize, logBase);\n } else {\n xBucket.buckets = convertToValueBuckets(xBucket, yBucketSize);\n }\n });\n\n return heatmap;\n}\n\nfunction pushToXBuckets(buckets, point, bucketNum, seriesName) {\n let value = point[VALUE_INDEX];\n if (value === null || value === undefined || isNaN(value)) {\n return;\n }\n\n // Add series name to point for future identification\n let point_ext = _.concat(point, seriesName);\n\n if (buckets[bucketNum] && buckets[bucketNum].values) {\n buckets[bucketNum].values.push(value);\n buckets[bucketNum].points.push(point_ext);\n } else {\n buckets[bucketNum] = {\n x: bucketNum,\n values: [value],\n points: [point_ext],\n };\n }\n}\n\nfunction pushToYBuckets(buckets, bucketNum, value, point, bounds) {\n var count = 1;\n // Use the 3rd argument as scale/count\n if (point.length > 3) {\n count = parseInt(point[2]);\n }\n if (buckets[bucketNum]) {\n buckets[bucketNum].values.push(value);\n buckets[bucketNum].points.push(point);\n buckets[bucketNum].count += count;\n } else {\n buckets[bucketNum] = {\n y: bucketNum,\n bounds: bounds,\n values: [value],\n points: [point],\n count: count,\n };\n }\n}\n\nfunction getValueBucketBound(value, yBucketSize, logBase) {\n if (logBase === 1) {\n return getBucketBound(value, yBucketSize);\n } else {\n return getLogScaleBucketBound(value, yBucketSize, logBase);\n }\n}\n\n/**\n * Find bucket for given value (for linear scale)\n */\nfunction getBucketBounds(value, bucketSize) {\n let bottom, top;\n bottom = Math.floor(value / bucketSize) * bucketSize;\n top = (Math.floor(value / bucketSize) + 1) * bucketSize;\n\n return { bottom, top };\n}\n\nfunction getBucketBound(value, bucketSize) {\n let bounds = getBucketBounds(value, bucketSize);\n return bounds.bottom;\n}\n\nfunction convertToValueBuckets(xBucket, bucketSize) {\n let values = xBucket.values;\n let points = xBucket.points;\n let buckets = {};\n\n _.forEach(values, (val, index) => {\n let bounds = getBucketBounds(val, bucketSize);\n let bucketNum = bounds.bottom;\n pushToYBuckets(buckets, bucketNum, val, points[index], bounds);\n });\n\n return buckets;\n}\n\n/**\n * Find bucket for given value (for log scales)\n */\nfunction getLogScaleBucketBounds(value, yBucketSplitFactor, logBase) {\n let top, bottom;\n if (value === 0) {\n return { bottom: 0, top: 0 };\n }\n\n let value_log = logp(value, logBase);\n let pow, powTop;\n if (yBucketSplitFactor === 1 || !yBucketSplitFactor) {\n pow = Math.floor(value_log);\n powTop = pow + 1;\n } else {\n let additional_bucket_size = 1 / yBucketSplitFactor;\n let additional_log = value_log - Math.floor(value_log);\n additional_log = Math.floor(additional_log / additional_bucket_size) * additional_bucket_size;\n pow = Math.floor(value_log) + additional_log;\n powTop = pow + additional_bucket_size;\n }\n bottom = Math.pow(logBase, pow);\n top = Math.pow(logBase, powTop);\n\n return { bottom, top };\n}\n\nfunction getLogScaleBucketBound(value, yBucketSplitFactor, logBase) {\n let bounds = getLogScaleBucketBounds(value, yBucketSplitFactor, logBase);\n return bounds.bottom;\n}\n\nfunction convertToLogScaleValueBuckets(xBucket, yBucketSplitFactor, logBase) {\n let values = xBucket.values;\n let points = xBucket.points;\n\n let buckets = {};\n _.forEach(values, (val, index) => {\n let bounds = getLogScaleBucketBounds(val, yBucketSplitFactor, logBase);\n let bucketNum = bounds.bottom;\n pushToYBuckets(buckets, bucketNum, val, points[index], bounds);\n });\n\n return buckets;\n}\n\n/**\n * Logarithm for custom base\n * @param value\n * @param base logarithm base\n */\nfunction logp(value, base) {\n return Math.log(value) / Math.log(base);\n}\n\n/**\n * Calculate size of Y bucket from given buckets bounds.\n * @param bounds Array of Y buckets bounds\n * @param logBase Logarithm base\n */\nfunction calculateBucketSize(bounds: number[], logBase = 1): number {\n let bucketSize = Infinity;\n\n if (bounds.length === 0) {\n return 0;\n } else if (bounds.length === 1) {\n return bounds[0];\n } else {\n bounds = _.sortBy(bounds);\n for (let i = 1; i < bounds.length; i++) {\n let distance = getDistance(bounds[i], bounds[i - 1], logBase);\n bucketSize = distance < bucketSize ? distance : bucketSize;\n }\n }\n\n return bucketSize;\n}\n\n/**\n * Calculate distance between two numbers in given scale (linear or logarithmic).\n * @param a\n * @param b\n * @param logBase\n */\nfunction getDistance(a: number, b: number, logBase = 1): number {\n if (logBase === 1) {\n // Linear distance\n return Math.abs(b - a);\n } else {\n // logarithmic distance\n let ratio = Math.max(a, b) / Math.min(a, b);\n return logp(ratio, logBase);\n }\n}\n\n/**\n * Compare two heatmap data objects\n * @param objA\n * @param objB\n */\nfunction isHeatmapDataEqual(objA: any, objB: any): boolean {\n let is_eql = !emptyXOR(objA, objB);\n\n _.forEach(objA, (xBucket: XBucket, x) => {\n if (objB[x]) {\n if (emptyXOR(xBucket.buckets, objB[x].buckets)) {\n is_eql = false;\n return false;\n }\n\n _.forEach(xBucket.buckets, (yBucket: YBucket, y) => {\n if (objB[x].buckets && objB[x].buckets[y]) {\n if (objB[x].buckets[y].values) {\n is_eql = _.isEqual(_.sortBy(yBucket.values), _.sortBy(objB[x].buckets[y].values));\n if (!is_eql) {\n return false;\n } else {\n return true;\n }\n } else {\n is_eql = false;\n return false;\n }\n } else {\n is_eql = false;\n return false;\n }\n });\n\n if (!is_eql) {\n return false;\n } else {\n return true;\n }\n } else {\n is_eql = false;\n return false;\n }\n });\n\n return is_eql;\n}\n\nfunction emptyXOR(foo: any, bar: any): boolean {\n return (_.isEmpty(foo) || _.isEmpty(bar)) && !(_.isEmpty(foo) && _.isEmpty(bar));\n}\n\nexport {\n convertToHeatMap,\n histogramToHeatmap,\n convertToCards,\n mergeZeroBuckets,\n getValueBucketBound,\n isHeatmapDataEqual,\n calculateBucketSize,\n sortSeriesByLabel,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/heatmap/heatmap_data_converter.ts","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Observable_1 = require('../Observable');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar EmptyObservable = (function (_super) {\n __extends(EmptyObservable, _super);\n function EmptyObservable(scheduler) {\n _super.call(this);\n this.scheduler = scheduler;\n }\n /**\n * Creates an Observable that emits no items to the Observer and immediately\n * emits a complete notification.\n *\n * Just emits 'complete', and nothing else.\n * \n *\n * \n *\n * This static operator is useful for creating a simple Observable that only\n * emits the complete notification. It can be used for composing with other\n * Observables, such as in a {@link mergeMap}.\n *\n * @example Emit the number 7, then complete.\n * var result = Rx.Observable.empty().startWith(7);\n * result.subscribe(x => console.log(x));\n *\n * @example Map and flatten only odd numbers to the sequence 'a', 'b', 'c'\n * var interval = Rx.Observable.interval(1000);\n * var result = interval.mergeMap(x =>\n * x % 2 === 1 ? Rx.Observable.of('a', 'b', 'c') : Rx.Observable.empty()\n * );\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following to the console:\n * // x is equal to the count on the interval eg(0,1,2,3,...)\n * // x will occur every 1000ms\n * // if x % 2 is equal to 1 print abc\n * // if x % 2 is not equal to 1 nothing will be output\n *\n * @see {@link create}\n * @see {@link never}\n * @see {@link of}\n * @see {@link throw}\n *\n * @param {Scheduler} [scheduler] A {@link IScheduler} to use for scheduling\n * the emission of the complete notification.\n * @return {Observable} An \"empty\" Observable: emits only the complete\n * notification.\n * @static true\n * @name empty\n * @owner Observable\n */\n EmptyObservable.create = function (scheduler) {\n return new EmptyObservable(scheduler);\n };\n EmptyObservable.dispatch = function (arg) {\n var subscriber = arg.subscriber;\n subscriber.complete();\n };\n /** @deprecated internal use only */ EmptyObservable.prototype._subscribe = function (subscriber) {\n var scheduler = this.scheduler;\n if (scheduler) {\n return scheduler.schedule(EmptyObservable.dispatch, 0, { subscriber: subscriber });\n }\n else {\n subscriber.complete();\n }\n };\n return EmptyObservable;\n}(Observable_1.Observable));\nexports.EmptyObservable = EmptyObservable;\n//# sourceMappingURL=EmptyObservable.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/observable/EmptyObservable.js\n// module id = 1992\n// module chunks = 0","\"use strict\";\nvar root_1 = require('../util/root');\nfunction symbolIteratorPonyfill(root) {\n var Symbol = root.Symbol;\n if (typeof Symbol === 'function') {\n if (!Symbol.iterator) {\n Symbol.iterator = Symbol('iterator polyfill');\n }\n return Symbol.iterator;\n }\n else {\n // [for Mozilla Gecko 27-35:](https://mzl.la/2ewE1zC)\n var Set_1 = root.Set;\n if (Set_1 && typeof new Set_1()['@@iterator'] === 'function') {\n return '@@iterator';\n }\n var Map_1 = root.Map;\n // required for compatability with es6-shim\n if (Map_1) {\n var keys = Object.getOwnPropertyNames(Map_1.prototype);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n // according to spec, Map.prototype[@@iterator] and Map.orototype.entries must be equal.\n if (key !== 'entries' && key !== 'size' && Map_1.prototype[key] === Map_1.prototype['entries']) {\n return key;\n }\n }\n }\n return '@@iterator';\n }\n}\nexports.symbolIteratorPonyfill = symbolIteratorPonyfill;\nexports.iterator = symbolIteratorPonyfill(root_1.root);\n/**\n * @deprecated use iterator instead\n */\nexports.$$iterator = exports.iterator;\n//# sourceMappingURL=iterator.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/symbol/iterator.js\n// module id = 1993\n// module chunks = 0","import angular from 'angular';\nimport _ from 'lodash';\nimport kbn from 'app/core/utils/kbn';\n\nexport class LinkSrv {\n /** @ngInject */\n constructor(private templateSrv, private timeSrv) {}\n\n getLinkUrl(link) {\n var url = this.templateSrv.replace(link.url || '');\n var params = {};\n\n if (link.keepTime) {\n var range = this.timeSrv.timeRangeForUrl();\n params['from'] = range.from;\n params['to'] = range.to;\n }\n\n if (link.includeVars) {\n this.templateSrv.fillVariableValuesForUrl(params);\n }\n\n return this.addParamsToUrl(url, params);\n }\n\n addParamsToUrl(url, params) {\n var paramsArray = [];\n\n _.each(params, function(value, key) {\n if (value === null) {\n return;\n }\n if (value === true) {\n paramsArray.push(key);\n } else if (_.isArray(value)) {\n _.each(value, function(instance) {\n paramsArray.push(key + '=' + encodeURIComponent(instance));\n });\n } else {\n paramsArray.push(key + '=' + encodeURIComponent(value));\n }\n });\n\n if (paramsArray.length === 0) {\n return url;\n }\n\n return this.appendToQueryString(url, paramsArray.join('&'));\n }\n\n appendToQueryString(url, stringToAppend) {\n if (!_.isUndefined(stringToAppend) && stringToAppend !== null && stringToAppend !== '') {\n var pos = url.indexOf('?');\n if (pos !== -1) {\n if (url.length - pos > 1) {\n url += '&';\n }\n } else {\n url += '?';\n }\n url += stringToAppend;\n }\n\n return url;\n }\n\n getAnchorInfo(link) {\n var info: any = {};\n info.href = this.getLinkUrl(link);\n info.title = this.templateSrv.replace(link.title || '');\n return info;\n }\n\n getPanelLinkAnchorInfo(link, scopedVars) {\n var info: any = {};\n if (link.type === 'absolute') {\n info.target = link.targetBlank ? '_blank' : '_self';\n info.href = this.templateSrv.replace(link.url || '', scopedVars);\n info.title = this.templateSrv.replace(link.title || '', scopedVars);\n } else if (link.dashUri) {\n info.href = 'dashboard/' + link.dashUri + '?';\n info.title = this.templateSrv.replace(link.title || '', scopedVars);\n info.target = link.targetBlank ? '_blank' : '';\n } else {\n info.title = this.templateSrv.replace(link.title || '', scopedVars);\n var slug = kbn.slugifyForUrl(link.dashboard || '');\n info.href = 'dashboard/db/' + slug + '?';\n }\n\n var params = {};\n\n if (link.keepTime) {\n var range = this.timeSrv.timeRangeForUrl();\n params['from'] = range.from;\n params['to'] = range.to;\n }\n\n if (link.includeVars) {\n this.templateSrv.fillVariableValuesForUrl(params, scopedVars);\n }\n\n info.href = this.addParamsToUrl(info.href, params);\n\n if (link.params) {\n info.href = this.appendToQueryString(info.href, this.templateSrv.replace(link.params, scopedVars));\n }\n\n return info;\n }\n}\n\nangular.module('grafana.services').service('linkSrv', LinkSrv);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/panellinks/link_srv.ts","export class AnnotationEvent {\n dashboardId: number;\n panelId: number;\n userId: number;\n time: any;\n timeEnd: any;\n isRegion: boolean;\n text: string;\n type: string;\n tags: string;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/annotations/event.ts","import kbn from 'app/core/utils/kbn';\nimport _ from 'lodash';\n\nfunction luceneEscape(value) {\n return value.replace(/([\\!\\*\\+\\-\\=<>\\s\\&\\|\\(\\)\\[\\]\\{\\}\\^\\~\\?\\:\\\\/\"])/g, '\\\\$1');\n}\n\nexport class TemplateSrv {\n variables: any[];\n\n /*\n * This regex matches 3 types of variable reference with an optional format specifier\n * \\$(\\w+) $var1\n * \\[\\[([\\s\\S]+?)(?::(\\w+))?\\]\\] [[var2]] or [[var2:fmt2]]\n * \\${(\\w+)(?::(\\w+))?} ${var3} or ${var3:fmt3}\n */\n private regex = /\\$(\\w+)|\\[\\[([\\s\\S]+?)(?::(\\w+))?\\]\\]|\\${(\\w+)(?::(\\w+))?}/g;\n private index = {};\n private grafanaVariables = {};\n private builtIns = {};\n\n constructor() {\n this.builtIns['__interval'] = { text: '1s', value: '1s' };\n this.builtIns['__interval_ms'] = { text: '100', value: '100' };\n }\n\n init(variables) {\n this.variables = variables;\n this.updateTemplateData();\n }\n\n updateTemplateData() {\n this.index = {};\n\n for (var i = 0; i < this.variables.length; i++) {\n var variable = this.variables[i];\n\n if (!variable.current || (!variable.current.isNone && !variable.current.value)) {\n continue;\n }\n\n this.index[variable.name] = variable;\n }\n }\n\n variableInitialized(variable) {\n this.index[variable.name] = variable;\n }\n\n getAdhocFilters(datasourceName) {\n var filters = [];\n\n for (var i = 0; i < this.variables.length; i++) {\n var variable = this.variables[i];\n if (variable.type !== 'adhoc') {\n continue;\n }\n\n if (variable.datasource === datasourceName) {\n filters = filters.concat(variable.filters);\n }\n\n if (variable.datasource.indexOf('$') === 0) {\n if (this.replace(variable.datasource) === datasourceName) {\n filters = filters.concat(variable.filters);\n }\n }\n }\n\n return filters;\n }\n\n luceneFormat(value) {\n if (typeof value === 'string') {\n return luceneEscape(value);\n }\n if (value instanceof Array && value.length === 0) {\n return '__empty__';\n }\n var quotedValues = _.map(value, function(val) {\n return '\"' + luceneEscape(val) + '\"';\n });\n return '(' + quotedValues.join(' OR ') + ')';\n }\n\n formatValue(value, format, variable) {\n // for some scopedVars there is no variable\n variable = variable || {};\n\n if (typeof format === 'function') {\n return format(value, variable, this.formatValue);\n }\n\n switch (format) {\n case 'regex': {\n if (typeof value === 'string') {\n return kbn.regexEscape(value);\n }\n\n var escapedValues = _.map(value, kbn.regexEscape);\n if (escapedValues.length === 1) {\n return escapedValues[0];\n }\n return '(' + escapedValues.join('|') + ')';\n }\n case 'lucene': {\n return this.luceneFormat(value);\n }\n case 'pipe': {\n if (typeof value === 'string') {\n return value;\n }\n return value.join('|');\n }\n case 'distributed': {\n if (typeof value === 'string') {\n return value;\n }\n return this.distributeVariable(value, variable.name);\n }\n case 'csv': {\n if (_.isArray(value)) {\n return value.join(',');\n }\n return value;\n }\n default: {\n if (_.isArray(value)) {\n return '{' + value.join(',') + '}';\n }\n return value;\n }\n }\n }\n\n setGrafanaVariable(name, value) {\n this.grafanaVariables[name] = value;\n }\n\n getVariableName(expression) {\n this.regex.lastIndex = 0;\n var match = this.regex.exec(expression);\n if (!match) {\n return null;\n }\n return match[1] || match[2];\n }\n\n variableExists(expression) {\n var name = this.getVariableName(expression);\n return name && this.index[name] !== void 0;\n }\n\n highlightVariablesAsHtml(str) {\n if (!str || !_.isString(str)) {\n return str;\n }\n\n str = _.escape(str);\n this.regex.lastIndex = 0;\n return str.replace(this.regex, (match, var1, var2, fmt2, var3) => {\n if (this.index[var1 || var2 || var3] || this.builtIns[var1 || var2 || var3]) {\n return '' + match + '';\n }\n return match;\n });\n }\n\n getAllValue(variable) {\n if (variable.allValue) {\n return variable.allValue;\n }\n var values = [];\n for (var i = 1; i < variable.options.length; i++) {\n values.push(variable.options[i].value);\n }\n return values;\n }\n\n replace(target, scopedVars?, format?) {\n if (!target) {\n return target;\n }\n\n var variable, systemValue, value, fmt;\n this.regex.lastIndex = 0;\n\n return target.replace(this.regex, (match, var1, var2, fmt2, var3, fmt3) => {\n variable = this.index[var1 || var2 || var3];\n fmt = fmt2 || fmt3 || format;\n if (scopedVars) {\n value = scopedVars[var1 || var2 || var3];\n if (value) {\n return this.formatValue(value.value, fmt, variable);\n }\n }\n\n if (!variable) {\n return match;\n }\n\n systemValue = this.grafanaVariables[variable.current.value];\n if (systemValue) {\n return this.formatValue(systemValue, fmt, variable);\n }\n\n value = variable.current.value;\n if (this.isAllValue(value)) {\n value = this.getAllValue(variable);\n // skip formatting of custom all values\n if (variable.allValue) {\n return value;\n }\n }\n\n var res = this.formatValue(value, fmt, variable);\n return res;\n });\n }\n\n isAllValue(value) {\n return value === '$__all' || (Array.isArray(value) && value[0] === '$__all');\n }\n\n replaceWithText(target, scopedVars) {\n if (!target) {\n return target;\n }\n\n var variable;\n this.regex.lastIndex = 0;\n\n return target.replace(this.regex, (match, var1, var2, fmt2, var3) => {\n if (scopedVars) {\n var option = scopedVars[var1 || var2 || var3];\n if (option) {\n return option.text;\n }\n }\n\n variable = this.index[var1 || var2 || var3];\n if (!variable) {\n return match;\n }\n\n return this.grafanaVariables[variable.current.value] || variable.current.text;\n });\n }\n\n fillVariableValuesForUrl(params, scopedVars) {\n _.each(this.variables, function(variable) {\n if (scopedVars && scopedVars[variable.name] !== void 0) {\n params['var-' + variable.name] = scopedVars[variable.name].value;\n } else {\n params['var-' + variable.name] = variable.getValueForUrl();\n }\n });\n }\n\n distributeVariable(value, variable) {\n value = _.map(value, function(val, index) {\n if (index !== 0) {\n return variable + '=' + val;\n } else {\n return val;\n }\n });\n return value.join(',');\n }\n}\n\nexport default new TemplateSrv();\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/templating/template_srv.ts","import _ from 'lodash';\n\nexport class QueryCtrl {\n target: any;\n datasource: any;\n panelCtrl: any;\n panel: any;\n hasRawMode: boolean;\n error: string;\n isLastQuery: boolean;\n\n constructor(public $scope, public $injector) {\n this.panel = this.panelCtrl.panel;\n this.isLastQuery = _.indexOf(this.panel.targets, this.target) === this.panel.targets.length - 1;\n }\n\n refresh() {\n this.panelCtrl.refresh();\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/panel/query_ctrl.ts","import { isBoolean, isNumber, sortedUniq, sortedIndexOf, unescape as htmlUnescaped } from 'lodash';\nimport moment from 'moment';\nimport { saveAs } from 'file-saver';\nimport { isNullOrUndefined } from 'util';\n\nconst DEFAULT_DATETIME_FORMAT = 'YYYY-MM-DDTHH:mm:ssZ';\nconst POINT_TIME_INDEX = 1;\nconst POINT_VALUE_INDEX = 0;\n\nconst END_COLUMN = ';';\nconst END_ROW = '\\r\\n';\nconst QUOTE = '\"';\nconst EXPORT_FILENAME = 'grafana_data_export.csv';\n\nfunction csvEscaped(text) {\n if (!text) {\n return text;\n }\n\n return text.split(QUOTE).join(QUOTE + QUOTE);\n}\n\nconst domParser = new DOMParser();\nfunction htmlDecoded(text) {\n if (!text) {\n return text;\n }\n\n const regexp = /&[^;]+;/g;\n function htmlDecoded(value) {\n const parsedDom = domParser.parseFromString(value, 'text/html');\n return parsedDom.body.textContent;\n }\n return text.replace(regexp, htmlDecoded).replace(regexp, htmlDecoded);\n}\n\nfunction formatSpecialHeader(useExcelHeader) {\n return useExcelHeader ? `sep=${END_COLUMN}${END_ROW}` : '';\n}\n\nfunction formatRow(row, addEndRowDelimiter = true) {\n let text = '';\n for (let i = 0; i < row.length; i += 1) {\n if (isBoolean(row[i]) || isNullOrUndefined(row[i])) {\n text += row[i];\n } else if (isNumber(row[i])) {\n text += row[i].toLocaleString();\n } else {\n text += `${QUOTE}${csvEscaped(htmlUnescaped(htmlDecoded(row[i])))}${QUOTE}`;\n }\n\n if (i < row.length - 1) {\n text += END_COLUMN;\n }\n }\n return addEndRowDelimiter ? text + END_ROW : text;\n}\n\nexport function convertSeriesListToCsv(seriesList, dateTimeFormat = DEFAULT_DATETIME_FORMAT, excel = false) {\n let text = formatSpecialHeader(excel) + formatRow(['Series', 'Time', 'Value']);\n for (let seriesIndex = 0; seriesIndex < seriesList.length; seriesIndex += 1) {\n for (let i = 0; i < seriesList[seriesIndex].datapoints.length; i += 1) {\n text += formatRow(\n [\n seriesList[seriesIndex].alias,\n moment(seriesList[seriesIndex].datapoints[i][POINT_TIME_INDEX]).format(dateTimeFormat),\n seriesList[seriesIndex].datapoints[i][POINT_VALUE_INDEX],\n ],\n i < seriesList[seriesIndex].datapoints.length - 1 || seriesIndex < seriesList.length - 1\n );\n }\n }\n return text;\n}\n\nexport function exportSeriesListToCsv(seriesList, dateTimeFormat = DEFAULT_DATETIME_FORMAT, excel = false) {\n let text = convertSeriesListToCsv(seriesList, dateTimeFormat, excel);\n saveSaveBlob(text, EXPORT_FILENAME);\n}\n\nexport function convertSeriesListToCsvColumns(seriesList, dateTimeFormat = DEFAULT_DATETIME_FORMAT, excel = false) {\n // add header\n let text =\n formatSpecialHeader(excel) +\n formatRow(\n ['Time'].concat(\n seriesList.map(function(val) {\n return val.alias;\n })\n )\n );\n // process data\n seriesList = mergeSeriesByTime(seriesList);\n\n // make text\n for (let i = 0; i < seriesList[0].datapoints.length; i += 1) {\n const timestamp = moment(seriesList[0].datapoints[i][POINT_TIME_INDEX]).format(dateTimeFormat);\n text += formatRow(\n [timestamp].concat(\n seriesList.map(function(series) {\n return series.datapoints[i][POINT_VALUE_INDEX];\n })\n ),\n i < seriesList[0].datapoints.length - 1\n );\n }\n\n return text;\n}\n\n/**\n * Collect all unique timestamps from series list and use it to fill\n * missing points by null.\n */\nfunction mergeSeriesByTime(seriesList) {\n let timestamps = [];\n for (let i = 0; i < seriesList.length; i++) {\n let seriesPoints = seriesList[i].datapoints;\n for (let j = 0; j < seriesPoints.length; j++) {\n timestamps.push(seriesPoints[j][POINT_TIME_INDEX]);\n }\n }\n timestamps = sortedUniq(timestamps.sort());\n\n for (let i = 0; i < seriesList.length; i++) {\n let seriesPoints = seriesList[i].datapoints;\n let seriesTimestamps = seriesPoints.map(p => p[POINT_TIME_INDEX]);\n let extendedSeries = [];\n let pointIndex;\n for (let j = 0; j < timestamps.length; j++) {\n pointIndex = sortedIndexOf(seriesTimestamps, timestamps[j]);\n if (pointIndex !== -1) {\n extendedSeries.push(seriesPoints[pointIndex]);\n } else {\n extendedSeries.push([null, timestamps[j]]);\n }\n }\n seriesList[i].datapoints = extendedSeries;\n }\n return seriesList;\n}\n\nexport function exportSeriesListToCsvColumns(seriesList, dateTimeFormat = DEFAULT_DATETIME_FORMAT, excel = false) {\n let text = convertSeriesListToCsvColumns(seriesList, dateTimeFormat, excel);\n saveSaveBlob(text, EXPORT_FILENAME);\n}\n\nexport function convertTableDataToCsv(table, excel = false) {\n let text = formatSpecialHeader(excel);\n // add headline\n text += formatRow(table.columns.map(val => val.title || val.text));\n // process data\n for (let i = 0; i < table.rows.length; i += 1) {\n text += formatRow(table.rows[i], i < table.rows.length - 1);\n }\n return text;\n}\n\nexport function exportTableDataToCsv(table, excel = false) {\n let text = convertTableDataToCsv(table, excel);\n saveSaveBlob(text, EXPORT_FILENAME);\n}\n\nexport function saveSaveBlob(payload, fname) {\n let blob = new Blob([payload], { type: 'text/csv;charset=utf-8;header=present;' });\n saveAs(blob, fname);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/core/utils/file_export.ts","// Copyright (c) 2014, Hugh Kennedy\n// Based on code from https://github.com/hughsk/flat/blob/master/index.js\n//\nexport default function flatten(target, opts): any {\n opts = opts || {};\n\n var delimiter = opts.delimiter || '.';\n var maxDepth = opts.maxDepth || 3;\n var currentDepth = 1;\n var output = {};\n\n function step(object, prev) {\n Object.keys(object).forEach(function(key) {\n var value = object[key];\n var isarray = opts.safe && Array.isArray(value);\n var type = Object.prototype.toString.call(value);\n var isobject = type === '[object Object]';\n\n var newKey = prev ? prev + delimiter + key : key;\n\n if (!opts.maxDepth) {\n maxDepth = currentDepth + 1;\n }\n\n if (!isarray && isobject && Object.keys(value).length && currentDepth < maxDepth) {\n ++currentDepth;\n return step(value, newKey);\n }\n\n output[newKey] = value;\n });\n }\n\n step(target, null);\n\n return output;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/core/utils/flatten.ts","import _ from 'lodash';\n\nconst versionPattern = /^(\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))?(?:-([0-9A-Za-z\\.]+))?/;\n\nexport class SemVersion {\n major: number;\n minor: number;\n patch: number;\n meta: string;\n\n constructor(version: string) {\n let match = versionPattern.exec(version);\n if (match) {\n this.major = Number(match[1]);\n this.minor = Number(match[2] || 0);\n this.patch = Number(match[3] || 0);\n this.meta = match[4];\n }\n }\n\n isGtOrEq(version: string): boolean {\n let compared = new SemVersion(version);\n return !(this.major < compared.major || this.minor < compared.minor || this.patch < compared.patch);\n }\n\n isValid(): boolean {\n return _.isNumber(this.major);\n }\n}\n\nexport function isVersionGtOrEq(a: string, b: string): boolean {\n let a_semver = new SemVersion(a);\n return a_semver.isGtOrEq(b);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/core/utils/version.ts","import angular from 'angular';\nimport _ from 'lodash';\n\nexport class CloudWatchQueryParameter {\n constructor() {\n return {\n templateUrl: 'public/app/plugins/datasource/cloudwatch/partials/query.parameter.html',\n controller: 'CloudWatchQueryParameterCtrl',\n restrict: 'E',\n scope: {\n target: '=',\n datasource: '=',\n onChange: '&',\n },\n };\n }\n}\n\nexport class CloudWatchQueryParameterCtrl {\n /** @ngInject */\n constructor($scope, templateSrv, uiSegmentSrv, datasourceSrv, $q) {\n $scope.init = function() {\n var target = $scope.target;\n target.namespace = target.namespace || '';\n target.metricName = target.metricName || '';\n target.statistics = target.statistics || ['Average'];\n target.dimensions = target.dimensions || {};\n target.period = target.period || '';\n target.region = target.region || 'default';\n target.highResolution = target.highResolution || false;\n\n $scope.regionSegment = uiSegmentSrv.getSegmentForValue($scope.target.region, 'select region');\n $scope.namespaceSegment = uiSegmentSrv.getSegmentForValue($scope.target.namespace, 'select namespace');\n $scope.metricSegment = uiSegmentSrv.getSegmentForValue($scope.target.metricName, 'select metric');\n\n $scope.dimSegments = _.reduce(\n $scope.target.dimensions,\n function(memo, value, key) {\n memo.push(uiSegmentSrv.newKey(key));\n memo.push(uiSegmentSrv.newOperator('='));\n memo.push(uiSegmentSrv.newKeyValue(value));\n return memo;\n },\n []\n );\n\n $scope.statSegments = _.map($scope.target.statistics, function(stat) {\n return uiSegmentSrv.getSegmentForValue(stat);\n });\n\n $scope.ensurePlusButton($scope.statSegments);\n $scope.ensurePlusButton($scope.dimSegments);\n $scope.removeDimSegment = uiSegmentSrv.newSegment({\n fake: true,\n value: '-- remove dimension --',\n });\n $scope.removeStatSegment = uiSegmentSrv.newSegment({\n fake: true,\n value: '-- remove stat --',\n });\n\n if (_.isEmpty($scope.target.region)) {\n $scope.target.region = 'default';\n }\n\n if (!$scope.onChange) {\n $scope.onChange = function() {};\n }\n };\n\n $scope.getStatSegments = function() {\n return $q.when(\n _.flatten([\n angular.copy($scope.removeStatSegment),\n _.map($scope.datasource.standardStatistics, function(s) {\n return uiSegmentSrv.getSegmentForValue(s);\n }),\n uiSegmentSrv.getSegmentForValue('pNN.NN'),\n ])\n );\n };\n\n $scope.statSegmentChanged = function(segment, index) {\n if (segment.value === $scope.removeStatSegment.value) {\n $scope.statSegments.splice(index, 1);\n } else {\n segment.type = 'value';\n }\n\n $scope.target.statistics = _.reduce(\n $scope.statSegments,\n function(memo, seg) {\n if (!seg.fake) {\n memo.push(seg.value);\n }\n return memo;\n },\n []\n );\n\n $scope.ensurePlusButton($scope.statSegments);\n $scope.onChange();\n };\n\n $scope.ensurePlusButton = function(segments) {\n var count = segments.length;\n var lastSegment = segments[Math.max(count - 1, 0)];\n\n if (!lastSegment || lastSegment.type !== 'plus-button') {\n segments.push(uiSegmentSrv.newPlusButton());\n }\n };\n\n $scope.getDimSegments = function(segment, $index) {\n if (segment.type === 'operator') {\n return $q.when([]);\n }\n\n var target = $scope.target;\n var query = $q.when([]);\n\n if (segment.type === 'key' || segment.type === 'plus-button') {\n query = $scope.datasource.getDimensionKeys($scope.target.namespace, $scope.target.region);\n } else if (segment.type === 'value') {\n var dimensionKey = $scope.dimSegments[$index - 2].value;\n query = $scope.datasource.getDimensionValues(\n target.region,\n target.namespace,\n target.metricName,\n dimensionKey,\n target.dimensions\n );\n }\n\n return query.then($scope.transformToSegments(true)).then(function(results) {\n if (segment.type === 'key') {\n results.splice(0, 0, angular.copy($scope.removeDimSegment));\n }\n return results;\n });\n };\n\n $scope.dimSegmentChanged = function(segment, index) {\n $scope.dimSegments[index] = segment;\n\n if (segment.value === $scope.removeDimSegment.value) {\n $scope.dimSegments.splice(index, 3);\n } else if (segment.type === 'plus-button') {\n $scope.dimSegments.push(uiSegmentSrv.newOperator('='));\n $scope.dimSegments.push(uiSegmentSrv.newFake('select dimension value', 'value', 'query-segment-value'));\n segment.type = 'key';\n segment.cssClass = 'query-segment-key';\n }\n\n $scope.syncDimSegmentsWithModel();\n $scope.ensurePlusButton($scope.dimSegments);\n $scope.onChange();\n };\n\n $scope.syncDimSegmentsWithModel = function() {\n var dims = {};\n var length = $scope.dimSegments.length;\n\n for (var i = 0; i < length - 2; i += 3) {\n var keySegment = $scope.dimSegments[i];\n var valueSegment = $scope.dimSegments[i + 2];\n if (!valueSegment.fake) {\n dims[keySegment.value] = valueSegment.value;\n }\n }\n\n $scope.target.dimensions = dims;\n };\n\n $scope.getRegions = function() {\n return $scope.datasource\n .metricFindQuery('regions()')\n .then(function(results) {\n results.unshift({ text: 'default' });\n return results;\n })\n .then($scope.transformToSegments(true));\n };\n\n $scope.getNamespaces = function() {\n return $scope.datasource.metricFindQuery('namespaces()').then($scope.transformToSegments(true));\n };\n\n $scope.getMetrics = function() {\n return $scope.datasource\n .metricFindQuery('metrics(' + $scope.target.namespace + ',' + $scope.target.region + ')')\n .then($scope.transformToSegments(true));\n };\n\n $scope.regionChanged = function() {\n $scope.target.region = $scope.regionSegment.value;\n $scope.onChange();\n };\n\n $scope.namespaceChanged = function() {\n $scope.target.namespace = $scope.namespaceSegment.value;\n $scope.onChange();\n };\n\n $scope.metricChanged = function() {\n $scope.target.metricName = $scope.metricSegment.value;\n $scope.onChange();\n };\n\n $scope.transformToSegments = function(addTemplateVars) {\n return function(results) {\n var segments = _.map(results, function(segment) {\n return uiSegmentSrv.newSegment({\n value: segment.text,\n expandable: segment.expandable,\n });\n });\n\n if (addTemplateVars) {\n _.each(templateSrv.variables, function(variable) {\n segments.unshift(\n uiSegmentSrv.newSegment({\n type: 'template',\n value: '$' + variable.name,\n expandable: true,\n })\n );\n });\n }\n\n return segments;\n };\n };\n\n $scope.init();\n }\n}\n\nangular.module('grafana.controllers').directive('cloudwatchQueryParameter', CloudWatchQueryParameter);\nangular.module('grafana.controllers').controller('CloudWatchQueryParameterCtrl', CloudWatchQueryParameterCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/cloudwatch/query_parameter_ctrl.ts","import _ from 'lodash';\nimport queryPart from './query_part';\nimport kbn from 'app/core/utils/kbn';\n\nexport default class InfluxQuery {\n target: any;\n selectModels: any[];\n queryBuilder: any;\n groupByParts: any;\n templateSrv: any;\n scopedVars: any;\n\n /** @ngInject */\n constructor(target, templateSrv?, scopedVars?) {\n this.target = target;\n this.templateSrv = templateSrv;\n this.scopedVars = scopedVars;\n\n target.policy = target.policy || 'default';\n target.resultFormat = target.resultFormat || 'time_series';\n target.orderByTime = target.orderByTime || 'ASC';\n target.tags = target.tags || [];\n target.groupBy = target.groupBy || [{ type: 'time', params: ['$__interval'] }, { type: 'fill', params: ['null'] }];\n target.select = target.select || [[{ type: 'field', params: ['value'] }, { type: 'mean', params: [] }]];\n\n this.updateProjection();\n }\n\n updateProjection() {\n this.selectModels = _.map(this.target.select, function(parts: any) {\n return _.map(parts, queryPart.create);\n });\n this.groupByParts = _.map(this.target.groupBy, queryPart.create);\n }\n\n updatePersistedParts() {\n this.target.select = _.map(this.selectModels, function(selectParts) {\n return _.map(selectParts, function(part: any) {\n return { type: part.def.type, params: part.params };\n });\n });\n }\n\n hasGroupByTime() {\n return _.find(this.target.groupBy, (g: any) => g.type === 'time');\n }\n\n hasFill() {\n return _.find(this.target.groupBy, (g: any) => g.type === 'fill');\n }\n\n addGroupBy(value) {\n var stringParts = value.match(/^(\\w+)\\((.*)\\)$/);\n var typePart = stringParts[1];\n var arg = stringParts[2];\n var partModel = queryPart.create({ type: typePart, params: [arg] });\n var partCount = this.target.groupBy.length;\n\n if (partCount === 0) {\n this.target.groupBy.push(partModel.part);\n } else if (typePart === 'time') {\n this.target.groupBy.splice(0, 0, partModel.part);\n } else if (typePart === 'tag') {\n if (this.target.groupBy[partCount - 1].type === 'fill') {\n this.target.groupBy.splice(partCount - 1, 0, partModel.part);\n } else {\n this.target.groupBy.push(partModel.part);\n }\n } else {\n this.target.groupBy.push(partModel.part);\n }\n\n this.updateProjection();\n }\n\n removeGroupByPart(part, index) {\n var categories = queryPart.getCategories();\n\n if (part.def.type === 'time') {\n // remove fill\n this.target.groupBy = _.filter(this.target.groupBy, (g: any) => g.type !== 'fill');\n // remove aggregations\n this.target.select = _.map(this.target.select, (s: any) => {\n return _.filter(s, (part: any) => {\n var partModel = queryPart.create(part);\n if (partModel.def.category === categories.Aggregations) {\n return false;\n }\n if (partModel.def.category === categories.Selectors) {\n return false;\n }\n return true;\n });\n });\n }\n\n this.target.groupBy.splice(index, 1);\n this.updateProjection();\n }\n\n removeSelect(index: number) {\n this.target.select.splice(index, 1);\n this.updateProjection();\n }\n\n removeSelectPart(selectParts, part) {\n // if we remove the field remove the whole statement\n if (part.def.type === 'field') {\n if (this.selectModels.length > 1) {\n var modelsIndex = _.indexOf(this.selectModels, selectParts);\n this.selectModels.splice(modelsIndex, 1);\n }\n } else {\n var partIndex = _.indexOf(selectParts, part);\n selectParts.splice(partIndex, 1);\n }\n\n this.updatePersistedParts();\n }\n\n addSelectPart(selectParts, type) {\n var partModel = queryPart.create({ type: type });\n partModel.def.addStrategy(selectParts, partModel, this);\n this.updatePersistedParts();\n }\n\n private renderTagCondition(tag, index, interpolate) {\n var str = '';\n var operator = tag.operator;\n var value = tag.value;\n if (index > 0) {\n str = (tag.condition || 'AND') + ' ';\n }\n\n if (!operator) {\n if (/^\\/.*\\/$/.test(value)) {\n operator = '=~';\n } else {\n operator = '=';\n }\n }\n\n // quote value unless regex\n if (operator !== '=~' && operator !== '!~') {\n if (interpolate) {\n value = this.templateSrv.replace(value, this.scopedVars);\n }\n if (operator !== '>' && operator !== '<') {\n value = \"'\" + value.replace(/\\\\/g, '\\\\\\\\') + \"'\";\n }\n } else if (interpolate) {\n value = this.templateSrv.replace(value, this.scopedVars, 'regex');\n }\n\n return str + '\"' + tag.key + '\" ' + operator + ' ' + value;\n }\n\n getMeasurementAndPolicy(interpolate) {\n var policy = this.target.policy;\n var measurement = this.target.measurement || 'measurement';\n\n if (!measurement.match('^/.*/$')) {\n measurement = '\"' + measurement + '\"';\n } else if (interpolate) {\n measurement = this.templateSrv.replace(measurement, this.scopedVars, 'regex');\n }\n\n if (policy !== 'default') {\n policy = '\"' + this.target.policy + '\".';\n } else {\n policy = '';\n }\n\n return policy + measurement;\n }\n\n interpolateQueryStr(value, variable, defaultFormatFn) {\n // if no multi or include all do not regexEscape\n if (!variable.multi && !variable.includeAll) {\n return value;\n }\n\n if (typeof value === 'string') {\n return kbn.regexEscape(value);\n }\n\n var escapedValues = _.map(value, kbn.regexEscape);\n return '(' + escapedValues.join('|') + ')';\n }\n\n render(interpolate?) {\n var target = this.target;\n\n if (target.rawQuery) {\n if (interpolate) {\n return this.templateSrv.replace(target.query, this.scopedVars, this.interpolateQueryStr);\n } else {\n return target.query;\n }\n }\n\n var query = 'SELECT ';\n var i, y;\n for (i = 0; i < this.selectModels.length; i++) {\n let parts = this.selectModels[i];\n var selectText = '';\n for (y = 0; y < parts.length; y++) {\n let part = parts[y];\n selectText = part.render(selectText);\n }\n\n if (i > 0) {\n query += ', ';\n }\n query += selectText;\n }\n\n query += ' FROM ' + this.getMeasurementAndPolicy(interpolate) + ' WHERE ';\n var conditions = _.map(target.tags, (tag, index) => {\n return this.renderTagCondition(tag, index, interpolate);\n });\n\n if (conditions.length > 0) {\n query += '(' + conditions.join(' ') + ') AND ';\n }\n\n query += '$timeFilter';\n\n var groupBySection = '';\n for (i = 0; i < this.groupByParts.length; i++) {\n var part = this.groupByParts[i];\n if (i > 0) {\n // for some reason fill has no separator\n groupBySection += part.def.type === 'fill' ? ' ' : ', ';\n }\n groupBySection += part.render('');\n }\n\n if (groupBySection.length) {\n query += ' GROUP BY ' + groupBySection;\n }\n\n if (target.fill) {\n query += ' fill(' + target.fill + ')';\n }\n\n if (target.orderByTime === 'DESC') {\n query += ' ORDER BY time DESC';\n }\n\n if (target.limit) {\n query += ' LIMIT ' + target.limit;\n }\n\n if (target.slimit) {\n query += ' SLIMIT ' + target.slimit;\n }\n\n return query;\n }\n\n renderAdhocFilters(filters) {\n var conditions = _.map(filters, (tag, index) => {\n return this.renderTagCondition(tag, index, false);\n });\n return conditions.join(' ');\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/influxdb/influx_query.ts","import _ from 'lodash';\nimport { QueryPartDef, QueryPart, functionRenderer, suffixRenderer } from 'app/core/components/query_part/query_part';\n\nvar index = [];\nvar categories = {\n Aggregations: [],\n Selectors: [],\n Transformations: [],\n Predictors: [],\n Math: [],\n Aliasing: [],\n Fields: [],\n};\n\nfunction createPart(part): any {\n var def = index[part.type];\n if (!def) {\n throw { message: 'Could not find query part ' + part.type };\n }\n\n return new QueryPart(part, def);\n}\n\nfunction register(options: any) {\n index[options.type] = new QueryPartDef(options);\n options.category.push(index[options.type]);\n}\n\nvar groupByTimeFunctions = [];\n\nfunction aliasRenderer(part, innerExpr) {\n return innerExpr + ' AS ' + '\"' + part.params[0] + '\"';\n}\n\nfunction fieldRenderer(part, innerExpr) {\n if (part.params[0] === '*') {\n return '*';\n }\n return '\"' + part.params[0] + '\"';\n}\n\nfunction replaceAggregationAddStrategy(selectParts, partModel) {\n // look for existing aggregation\n for (var i = 0; i < selectParts.length; i++) {\n var part = selectParts[i];\n if (part.def.category === categories.Aggregations) {\n if (part.def.type === partModel.def.type) {\n return;\n }\n // count distinct is allowed\n if (part.def.type === 'count' && partModel.def.type === 'distinct') {\n break;\n }\n // remove next aggregation if distinct was replaced\n if (part.def.type === 'distinct') {\n var morePartsAvailable = selectParts.length >= i + 2;\n if (partModel.def.type !== 'count' && morePartsAvailable) {\n var nextPart = selectParts[i + 1];\n if (nextPart.def.category === categories.Aggregations) {\n selectParts.splice(i + 1, 1);\n }\n } else if (partModel.def.type === 'count') {\n if (!morePartsAvailable || selectParts[i + 1].def.type !== 'count') {\n selectParts.splice(i + 1, 0, partModel);\n }\n return;\n }\n }\n selectParts[i] = partModel;\n return;\n }\n if (part.def.category === categories.Selectors) {\n selectParts[i] = partModel;\n return;\n }\n }\n\n selectParts.splice(1, 0, partModel);\n}\n\nfunction addTransformationStrategy(selectParts, partModel) {\n var i;\n // look for index to add transformation\n for (i = 0; i < selectParts.length; i++) {\n var part = selectParts[i];\n if (part.def.category === categories.Math || part.def.category === categories.Aliasing) {\n break;\n }\n }\n\n selectParts.splice(i, 0, partModel);\n}\n\nfunction addMathStrategy(selectParts, partModel) {\n var partCount = selectParts.length;\n if (partCount > 0) {\n // if last is math, replace it\n if (selectParts[partCount - 1].def.type === 'math') {\n selectParts[partCount - 1] = partModel;\n return;\n }\n // if next to last is math, replace it\n if (partCount > 1 && selectParts[partCount - 2].def.type === 'math') {\n selectParts[partCount - 2] = partModel;\n return;\n } else if (selectParts[partCount - 1].def.type === 'alias') {\n // if last is alias add it before\n selectParts.splice(partCount - 1, 0, partModel);\n return;\n }\n }\n selectParts.push(partModel);\n}\n\nfunction addAliasStrategy(selectParts, partModel) {\n var partCount = selectParts.length;\n if (partCount > 0) {\n // if last is alias, replace it\n if (selectParts[partCount - 1].def.type === 'alias') {\n selectParts[partCount - 1] = partModel;\n return;\n }\n }\n selectParts.push(partModel);\n}\n\nfunction addFieldStrategy(selectParts, partModel, query) {\n // copy all parts\n var parts = _.map(selectParts, function(part: any) {\n return createPart({ type: part.def.type, params: _.clone(part.params) });\n });\n\n query.selectModels.push(parts);\n}\n\nregister({\n type: 'field',\n addStrategy: addFieldStrategy,\n category: categories.Fields,\n params: [{ type: 'field', dynamicLookup: true }],\n defaultParams: ['value'],\n renderer: fieldRenderer,\n});\n\n// Aggregations\nregister({\n type: 'count',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Aggregations,\n params: [],\n defaultParams: [],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'distinct',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Aggregations,\n params: [],\n defaultParams: [],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'integral',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Aggregations,\n params: [],\n defaultParams: [],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'mean',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Aggregations,\n params: [],\n defaultParams: [],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'median',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Aggregations,\n params: [],\n defaultParams: [],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'mode',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Aggregations,\n params: [],\n defaultParams: [],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'sum',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Aggregations,\n params: [],\n defaultParams: [],\n renderer: functionRenderer,\n});\n\n// transformations\n\nregister({\n type: 'derivative',\n addStrategy: addTransformationStrategy,\n category: categories.Transformations,\n params: [\n {\n name: 'duration',\n type: 'interval',\n options: ['1s', '10s', '1m', '5m', '10m', '15m', '1h'],\n },\n ],\n defaultParams: ['10s'],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'spread',\n addStrategy: addTransformationStrategy,\n category: categories.Transformations,\n params: [],\n defaultParams: [],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'non_negative_derivative',\n addStrategy: addTransformationStrategy,\n category: categories.Transformations,\n params: [\n {\n name: 'duration',\n type: 'interval',\n options: ['1s', '10s', '1m', '5m', '10m', '15m', '1h'],\n },\n ],\n defaultParams: ['10s'],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'difference',\n addStrategy: addTransformationStrategy,\n category: categories.Transformations,\n params: [],\n defaultParams: [],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'non_negative_difference',\n addStrategy: addTransformationStrategy,\n category: categories.Transformations,\n params: [],\n defaultParams: [],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'moving_average',\n addStrategy: addTransformationStrategy,\n category: categories.Transformations,\n params: [{ name: 'window', type: 'int', options: [5, 10, 20, 30, 40] }],\n defaultParams: [10],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'cumulative_sum',\n addStrategy: addTransformationStrategy,\n category: categories.Transformations,\n params: [],\n defaultParams: [],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'stddev',\n addStrategy: addTransformationStrategy,\n category: categories.Transformations,\n params: [],\n defaultParams: [],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'time',\n category: groupByTimeFunctions,\n params: [\n {\n name: 'interval',\n type: 'time',\n options: ['$__interval', '1s', '10s', '1m', '5m', '10m', '15m', '1h'],\n },\n ],\n defaultParams: ['$__interval'],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'fill',\n category: groupByTimeFunctions,\n params: [\n {\n name: 'fill',\n type: 'string',\n options: ['none', 'null', '0', 'previous', 'linear'],\n },\n ],\n defaultParams: ['null'],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'elapsed',\n addStrategy: addTransformationStrategy,\n category: categories.Transformations,\n params: [\n {\n name: 'duration',\n type: 'interval',\n options: ['1s', '10s', '1m', '5m', '10m', '15m', '1h'],\n },\n ],\n defaultParams: ['10s'],\n renderer: functionRenderer,\n});\n\n// predictions\nregister({\n type: 'holt_winters',\n addStrategy: addTransformationStrategy,\n category: categories.Predictors,\n params: [\n { name: 'number', type: 'int', options: [5, 10, 20, 30, 40] },\n { name: 'season', type: 'int', options: [0, 1, 2, 5, 10] },\n ],\n defaultParams: [10, 2],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'holt_winters_with_fit',\n addStrategy: addTransformationStrategy,\n category: categories.Predictors,\n params: [\n { name: 'number', type: 'int', options: [5, 10, 20, 30, 40] },\n { name: 'season', type: 'int', options: [0, 1, 2, 5, 10] },\n ],\n defaultParams: [10, 2],\n renderer: functionRenderer,\n});\n\n// Selectors\nregister({\n type: 'bottom',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Selectors,\n params: [{ name: 'count', type: 'int' }],\n defaultParams: [3],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'first',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Selectors,\n params: [],\n defaultParams: [],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'last',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Selectors,\n params: [],\n defaultParams: [],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'max',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Selectors,\n params: [],\n defaultParams: [],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'min',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Selectors,\n params: [],\n defaultParams: [],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'percentile',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Selectors,\n params: [{ name: 'nth', type: 'int' }],\n defaultParams: [95],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'top',\n addStrategy: replaceAggregationAddStrategy,\n category: categories.Selectors,\n params: [{ name: 'count', type: 'int' }],\n defaultParams: [3],\n renderer: functionRenderer,\n});\n\nregister({\n type: 'tag',\n category: groupByTimeFunctions,\n params: [{ name: 'tag', type: 'string', dynamicLookup: true }],\n defaultParams: ['tag'],\n renderer: fieldRenderer,\n});\n\nregister({\n type: 'math',\n addStrategy: addMathStrategy,\n category: categories.Math,\n params: [{ name: 'expr', type: 'string' }],\n defaultParams: [' / 100'],\n renderer: suffixRenderer,\n});\n\nregister({\n type: 'alias',\n addStrategy: addAliasStrategy,\n category: categories.Aliasing,\n params: [{ name: 'name', type: 'string', quote: 'double' }],\n defaultParams: ['alias'],\n renderMode: 'suffix',\n renderer: aliasRenderer,\n});\n\nexport default {\n create: createPart,\n getCategories: function() {\n return categories;\n },\n replaceAggregationAdd: replaceAggregationAddStrategy,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/influxdb/query_part.ts","import _ from 'lodash';\n\nfunction renderTagCondition(tag, index) {\n var str = '';\n var operator = tag.operator;\n var value = tag.value;\n if (index > 0) {\n str = (tag.condition || 'AND') + ' ';\n }\n\n if (!operator) {\n if (/^\\/.*\\/$/.test(tag.value)) {\n operator = '=~';\n } else {\n operator = '=';\n }\n }\n\n // quote value unless regex or number\n if (operator !== '=~' && operator !== '!~' && isNaN(+value)) {\n value = \"'\" + value + \"'\";\n }\n\n return str + '\"' + tag.key + '\" ' + operator + ' ' + value;\n}\n\nexport class InfluxQueryBuilder {\n constructor(private target, private database?) {}\n\n buildExploreQuery(type: string, withKey?: string, withMeasurementFilter?: string) {\n var query;\n var measurement;\n var policy;\n\n if (type === 'TAG_KEYS') {\n query = 'SHOW TAG KEYS';\n measurement = this.target.measurement;\n policy = this.target.policy;\n } else if (type === 'TAG_VALUES') {\n query = 'SHOW TAG VALUES';\n measurement = this.target.measurement;\n policy = this.target.policy;\n } else if (type === 'MEASUREMENTS') {\n query = 'SHOW MEASUREMENTS';\n if (withMeasurementFilter) {\n query += ' WITH MEASUREMENT =~ /' + withMeasurementFilter + '/';\n }\n } else if (type === 'FIELDS') {\n measurement = this.target.measurement;\n policy = this.target.policy;\n\n if (!measurement.match('^/.*/')) {\n measurement = '\"' + measurement + '\"';\n\n if (policy && policy !== 'default') {\n policy = '\"' + policy + '\"';\n measurement = policy + '.' + measurement;\n }\n }\n\n return 'SHOW FIELD KEYS FROM ' + measurement;\n } else if (type === 'RETENTION POLICIES') {\n query = 'SHOW RETENTION POLICIES on \"' + this.database + '\"';\n return query;\n }\n\n if (measurement) {\n if (!measurement.match('^/.*/') && !measurement.match(/^merge\\(.*\\)/)) {\n measurement = '\"' + measurement + '\"';\n }\n\n if (policy && policy !== 'default') {\n policy = '\"' + policy + '\"';\n measurement = policy + '.' + measurement;\n }\n\n query += ' FROM ' + measurement;\n }\n\n if (withKey) {\n query += ' WITH KEY = \"' + withKey + '\"';\n }\n\n if (this.target.tags && this.target.tags.length > 0) {\n var whereConditions = _.reduce(\n this.target.tags,\n function(memo, tag) {\n // do not add a condition for the key we want to explore for\n if (tag.key === withKey) {\n return memo;\n }\n memo.push(renderTagCondition(tag, memo.length));\n return memo;\n },\n []\n );\n\n if (whereConditions.length > 0) {\n query += ' WHERE ' + whereConditions.join(' ');\n }\n }\n if (type === 'MEASUREMENTS') {\n query += ' LIMIT 100';\n //Solve issue #2524 by limiting the number of measurements returned\n //LIMIT must be after WITH MEASUREMENT and WHERE clauses\n //This also could be used for TAG KEYS and TAG VALUES, if desired\n }\n return query;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/influxdb/query_builder.ts","import './graph';\nimport './legend';\nimport './series_overrides_ctrl';\nimport './thresholds_form';\n\nimport template from './template';\nimport _ from 'lodash';\nimport config from 'app/core/config';\nimport { MetricsPanelCtrl, alertTab } from 'app/plugins/sdk';\nimport { DataProcessor } from './data_processor';\nimport { axesEditorComponent } from './axes_editor';\n\nclass GraphCtrl extends MetricsPanelCtrl {\n static template = template;\n\n hiddenSeries: any = {};\n seriesList: any = [];\n dataList: any = [];\n annotations: any = [];\n alertState: any;\n\n annotationsPromise: any;\n dataWarning: any;\n colors: any = [];\n subTabIndex: number;\n processor: DataProcessor;\n\n panelDefaults = {\n // datasource name, null = default datasource\n datasource: null,\n // sets client side (flot) or native graphite png renderer (png)\n renderer: 'flot',\n yaxes: [\n {\n label: null,\n show: true,\n logBase: 1,\n min: null,\n max: null,\n format: 'short',\n },\n {\n label: null,\n show: true,\n logBase: 1,\n min: null,\n max: null,\n format: 'short',\n },\n ],\n xaxis: {\n show: true,\n mode: 'time',\n name: null,\n values: [],\n buckets: null,\n },\n yaxis: {\n align: false,\n alignLevel: null,\n },\n // show/hide lines\n lines: true,\n // fill factor\n fill: 1,\n // line width in pixels\n linewidth: 1,\n // show/hide dashed line\n dashes: false,\n // length of a dash\n dashLength: 10,\n // length of space between two dashes\n spaceLength: 10,\n // show hide points\n points: false,\n // point radius in pixels\n pointradius: 5,\n // show hide bars\n bars: false,\n // enable/disable stacking\n stack: false,\n // stack percentage mode\n percentage: false,\n // legend options\n legend: {\n show: true, // disable/enable legend\n values: false, // disable/enable legend values\n min: false,\n max: false,\n current: false,\n total: false,\n avg: false,\n },\n // how null points should be handled\n nullPointMode: 'connected',\n // staircase line mode\n steppedLine: false,\n // tooltip options\n tooltip: {\n value_type: 'individual',\n shared: true,\n sort: 0,\n },\n // time overrides\n timeFrom: null,\n timeShift: null,\n // metric queries\n targets: [{}],\n // series color overrides\n aliasColors: {},\n // other style overrides\n seriesOverrides: [],\n thresholds: [],\n };\n\n /** @ngInject */\n constructor($scope, $injector, private annotationsSrv) {\n super($scope, $injector);\n\n _.defaults(this.panel, this.panelDefaults);\n _.defaults(this.panel.tooltip, this.panelDefaults.tooltip);\n _.defaults(this.panel.legend, this.panelDefaults.legend);\n _.defaults(this.panel.xaxis, this.panelDefaults.xaxis);\n\n this.processor = new DataProcessor(this.panel);\n\n this.events.on('render', this.onRender.bind(this));\n this.events.on('data-received', this.onDataReceived.bind(this));\n this.events.on('data-error', this.onDataError.bind(this));\n this.events.on('data-snapshot-load', this.onDataSnapshotLoad.bind(this));\n this.events.on('init-edit-mode', this.onInitEditMode.bind(this));\n this.events.on('init-panel-actions', this.onInitPanelActions.bind(this));\n }\n\n onInitEditMode() {\n this.addEditorTab('Axes', axesEditorComponent, 2);\n this.addEditorTab('Legend', 'public/app/plugins/panel/graph/tab_legend.html', 3);\n this.addEditorTab('Display', 'public/app/plugins/panel/graph/tab_display.html', 4);\n\n if (config.alertingEnabled) {\n this.addEditorTab('Alert', alertTab, 5);\n }\n\n this.subTabIndex = 0;\n }\n\n onInitPanelActions(actions) {\n // actions.push({ text: 'Export CSV', click: 'ctrl.exportCsv()' });\n actions.push({ text: 'Toggle legend', click: 'ctrl.toggleLegend()' });\n actions.push({ text: 'Joe mode', click: 'ctrl.joeMode()' });\n }\n\n issueQueries(datasource) {\n this.annotationsPromise = this.annotationsSrv.getAnnotations({\n dashboard: this.dashboard,\n panel: this.panel,\n range: this.range,\n });\n return super.issueQueries(datasource);\n }\n\n zoomOut(evt) {\n this.publishAppEvent('zoom-out', 2);\n }\n\n onDataSnapshotLoad(snapshotData) {\n this.annotationsPromise = this.annotationsSrv.getAnnotations({\n dashboard: this.dashboard,\n panel: this.panel,\n range: this.range,\n });\n this.onDataReceived(snapshotData);\n }\n\n onDataError(err) {\n this.seriesList = [];\n this.annotations = [];\n this.render([]);\n }\n\n onDataReceived(dataList) {\n this.dataList = dataList;\n this.seriesList = this.processor.getSeriesList({\n dataList: dataList,\n range: this.range,\n });\n\n this.dataWarning = null;\n const datapointsCount = this.seriesList.reduce((prev, series) => {\n return prev + series.datapoints.length;\n }, 0);\n\n if (datapointsCount === 0) {\n this.dataWarning = {\n title: 'No data points',\n tip: 'No datapoints returned from data query',\n };\n } else {\n for (let series of this.seriesList) {\n if (series.isOutsideRange) {\n this.dataWarning = {\n title: 'Data points outside time range',\n tip: 'Can be caused by timezone mismatch or missing time filter in query',\n };\n break;\n }\n }\n }\n\n this.annotationsPromise.then(\n result => {\n this.loading = false;\n this.alertState = result.alertState;\n this.annotations = result.annotations;\n this.render(this.seriesList);\n },\n () => {\n this.loading = false;\n this.render(this.seriesList);\n }\n );\n }\n\n onRender() {\n if (!this.seriesList) {\n return;\n }\n\n for (let series of this.seriesList) {\n series.applySeriesOverrides(this.panel.seriesOverrides);\n\n if (series.unit) {\n this.panel.yaxes[series.yaxis - 1].format = series.unit;\n }\n }\n }\n\n changeSeriesColor(series, color) {\n series.setColor(color);\n this.panel.aliasColors[series.alias] = series.color;\n this.render();\n }\n\n toggleSeries(serie, event) {\n if (event.ctrlKey || event.metaKey || event.shiftKey) {\n if (this.hiddenSeries[serie.alias]) {\n delete this.hiddenSeries[serie.alias];\n } else {\n this.hiddenSeries[serie.alias] = true;\n }\n } else {\n this.toggleSeriesExclusiveMode(serie);\n }\n this.render();\n }\n\n toggleSeriesExclusiveMode(serie) {\n var hidden = this.hiddenSeries;\n\n if (hidden[serie.alias]) {\n delete hidden[serie.alias];\n }\n\n // check if every other series is hidden\n var alreadyExclusive = _.every(this.seriesList, value => {\n if (value.alias === serie.alias) {\n return true;\n }\n\n return hidden[value.alias];\n });\n\n if (alreadyExclusive) {\n // remove all hidden series\n _.each(this.seriesList, value => {\n delete this.hiddenSeries[value.alias];\n });\n } else {\n // hide all but this serie\n _.each(this.seriesList, value => {\n if (value.alias === serie.alias) {\n return;\n }\n\n this.hiddenSeries[value.alias] = true;\n });\n }\n }\n\n toggleAxis(info) {\n var override = _.find(this.panel.seriesOverrides, { alias: info.alias });\n if (!override) {\n override = { alias: info.alias };\n this.panel.seriesOverrides.push(override);\n }\n info.yaxis = override.yaxis = info.yaxis === 2 ? 1 : 2;\n this.render();\n }\n\n addSeriesOverride(override) {\n this.panel.seriesOverrides.push(override || {});\n }\n\n removeSeriesOverride(override) {\n this.panel.seriesOverrides = _.without(this.panel.seriesOverrides, override);\n this.render();\n }\n\n toggleLegend() {\n this.panel.legend.show = !this.panel.legend.show;\n this.refresh();\n }\n\n joeMode() {\n let steps = window.prompt('Step count (10-500)?');\n this.panel.slowMode = { enabled: true, stepCount: Number(steps) };\n this.refresh();\n }\n\n legendValuesOptionChanged() {\n var legend = this.panel.legend;\n legend.values = legend.min || legend.max || legend.avg || legend.current || legend.total;\n this.render();\n }\n\n exportCsv() {\n var scope = this.$scope.$new(true);\n scope.seriesList = this.seriesList;\n this.publishAppEvent('show-modal', {\n templateHtml: '',\n scope,\n modalClass: 'modal--narrow',\n });\n }\n}\n\nexport { GraphCtrl, GraphCtrl as PanelCtrl };\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/graph/module.ts","/* Flot plugin for selecting regions of a plot.\n\nCopyright (c) 2007-2013 IOLA and Ole Laursen.\nLicensed under the MIT license.\n\nThe plugin supports these options:\n\nselection: {\n\tmode: null or \"x\" or \"y\" or \"xy\",\n\tcolor: color,\n\tshape: \"round\" or \"miter\" or \"bevel\",\n\tminSize: number of pixels\n}\n\nSelection support is enabled by setting the mode to one of \"x\", \"y\" or \"xy\".\nIn \"x\" mode, the user will only be able to specify the x range, similarly for\n\"y\" mode. For \"xy\", the selection becomes a rectangle where both ranges can be\nspecified. \"color\" is color of the selection (if you need to change the color\nlater on, you can get to it with plot.getOptions().selection.color). \"shape\"\nis the shape of the corners of the selection.\n\n\"minSize\" is the minimum size a selection can be in pixels. This value can\nbe customized to determine the smallest size a selection can be and still\nhave the selection rectangle be displayed. When customizing this value, the\nfact that it refers to pixels, not axis units must be taken into account.\nThus, for example, if there is a bar graph in time mode with BarWidth set to 1\nminute, setting \"minSize\" to 1 will not make the minimum selection size 1\nminute, but rather 1 pixel. Note also that setting \"minSize\" to 0 will prevent\n\"plotunselected\" events from being fired when the user clicks the mouse without\ndragging.\n\nWhen selection support is enabled, a \"plotselected\" event will be emitted on\nthe DOM element you passed into the plot function. The event handler gets a\nparameter with the ranges selected on the axes, like this:\n\n\tplaceholder.bind( \"plotselected\", function( event, ranges ) {\n\t\talert(\"You selected \" + ranges.xaxis.from + \" to \" + ranges.xaxis.to)\n\t\t// similar for yaxis - with multiple axes, the extra ones are in\n\t\t// x2axis, x3axis, ...\n\t});\n\nThe \"plotselected\" event is only fired when the user has finished making the\nselection. A \"plotselecting\" event is fired during the process with the same\nparameters as the \"plotselected\" event, in case you want to know what's\nhappening while it's happening,\n\nA \"plotunselected\" event with no arguments is emitted when the user clicks the\nmouse to remove the selection. As stated above, setting \"minSize\" to 0 will\ndestroy this behavior.\n\nThe plugin allso adds the following methods to the plot object:\n\n- setSelection( ranges, preventEvent )\n\n Set the selection rectangle. The passed in ranges is on the same form as\n returned in the \"plotselected\" event. If the selection mode is \"x\", you\n should put in either an xaxis range, if the mode is \"y\" you need to put in\n an yaxis range and both xaxis and yaxis if the selection mode is \"xy\", like\n this:\n\n\tsetSelection({ xaxis: { from: 0, to: 10 }, yaxis: { from: 40, to: 60 } });\n\n setSelection will trigger the \"plotselected\" event when called. If you don't\n want that to happen, e.g. if you're inside a \"plotselected\" handler, pass\n true as the second parameter. If you are using multiple axes, you can\n specify the ranges on any of those, e.g. as x2axis/x3axis/... instead of\n xaxis, the plugin picks the first one it sees.\n\n- clearSelection( preventEvent )\n\n Clear the selection rectangle. Pass in true to avoid getting a\n \"plotunselected\" event.\n\n- getSelection()\n\n Returns the current selection in the same format as the \"plotselected\"\n event. If there's currently no selection, the function returns null.\n\n*/\n\n(function ($) {\n function init(plot) {\n var selection = {\n first: { x: -1, y: -1}, second: { x: -1, y: -1},\n show: false,\n active: false\n };\n\n // FIXME: The drag handling implemented here should be\n // abstracted out, there's some similar code from a library in\n // the navigation plugin, this should be massaged a bit to fit\n // the Flot cases here better and reused. Doing this would\n // make this plugin much slimmer.\n var savedhandlers = {};\n\n var mouseUpHandler = null;\n\n function onMouseMove(e) {\n if (selection.active) {\n updateSelection(e);\n\n plot.getPlaceholder().trigger(\"plotselecting\", [ getSelection() ]);\n }\n }\n\n function onMouseDown(e) {\n if (e.which != 1) // only accept left-click\n return;\n\n // cancel out any text selections\n document.body.focus();\n\n // prevent text selection and drag in old-school browsers\n if (document.onselectstart !== undefined && savedhandlers.onselectstart == null) {\n savedhandlers.onselectstart = document.onselectstart;\n document.onselectstart = function () { return false; };\n }\n if (document.ondrag !== undefined && savedhandlers.ondrag == null) {\n savedhandlers.ondrag = document.ondrag;\n document.ondrag = function () { return false; };\n }\n\n setSelectionPos(selection.first, e);\n\n selection.active = true;\n\n // this is a bit silly, but we have to use a closure to be\n // able to whack the same handler again\n mouseUpHandler = function (e) { onMouseUp(e); };\n\n $(document).one(\"mouseup\", mouseUpHandler);\n }\n\n function onMouseUp(e) {\n mouseUpHandler = null;\n\n // revert drag stuff for old-school browsers\n if (document.onselectstart !== undefined)\n document.onselectstart = savedhandlers.onselectstart;\n if (document.ondrag !== undefined)\n document.ondrag = savedhandlers.ondrag;\n\n // no more dragging\n selection.active = false;\n updateSelection(e);\n\n if (selectionIsSane())\n triggerSelectedEvent(e);\n else {\n // this counts as a clear\n plot.getPlaceholder().trigger(\"plotunselected\", [ ]);\n plot.getPlaceholder().trigger(\"plotselecting\", [ null ]);\n }\n\n setTimeout(function() {\n plot.isSelecting = false;\n }, 10);\n\n return false;\n }\n\n function getSelection() {\n if (!selectionIsSane())\n return null;\n\n if (!selection.show) return null;\n\n var r = {}, c1 = selection.first, c2 = selection.second;\n var axes = plot.getAxes();\n // look if no axis is used\n var noAxisInUse = true;\n $.each(axes, function (name, axis) {\n if (axis.used) {\n anyUsed = false;\n }\n })\n\n $.each(axes, function (name, axis) {\n if (axis.used || noAxisInUse) {\n var p1 = axis.c2p(c1[axis.direction]), p2 = axis.c2p(c2[axis.direction]);\n r[name] = { from: Math.min(p1, p2), to: Math.max(p1, p2) };\n }\n });\n return r;\n }\n\n function triggerSelectedEvent(event) {\n var r = getSelection();\n\n // Add ctrlKey and metaKey to event\n r.ctrlKey = event.ctrlKey;\n r.metaKey = event.metaKey;\n\n plot.getPlaceholder().trigger(\"plotselected\", [ r ]);\n\n // backwards-compat stuff, to be removed in future\n if (r.xaxis && r.yaxis)\n plot.getPlaceholder().trigger(\"selected\", [ { x1: r.xaxis.from, y1: r.yaxis.from, x2: r.xaxis.to, y2: r.yaxis.to } ]);\n }\n\n function clamp(min, value, max) {\n return value < min ? min: (value > max ? max: value);\n }\n\n function setSelectionPos(pos, e) {\n var o = plot.getOptions();\n var offset = plot.getPlaceholder().offset();\n var plotOffset = plot.getPlotOffset();\n pos.x = clamp(0, e.pageX - offset.left - plotOffset.left, plot.width());\n pos.y = clamp(0, e.pageY - offset.top - plotOffset.top, plot.height());\n\n if (o.selection.mode == \"y\")\n pos.x = pos == selection.first ? 0 : plot.width();\n\n if (o.selection.mode == \"x\")\n pos.y = pos == selection.first ? 0 : plot.height();\n }\n\n function updateSelection(pos) {\n if (pos.pageX == null)\n return;\n\n setSelectionPos(selection.second, pos);\n if (selectionIsSane()) {\n plot.isSelecting = true;\n selection.show = true;\n plot.triggerRedrawOverlay();\n }\n else\n clearSelection(true);\n }\n\n function clearSelection(preventEvent) {\n if (selection.show) {\n selection.show = false;\n plot.triggerRedrawOverlay();\n if (!preventEvent)\n plot.getPlaceholder().trigger(\"plotunselected\", [ ]);\n }\n }\n\n // function taken from markings support in Flot\n function extractRange(ranges, coord) {\n var axis, from, to, key, axes = plot.getAxes();\n\n for (var k in axes) {\n axis = axes[k];\n if (axis.direction == coord) {\n key = coord + axis.n + \"axis\";\n if (!ranges[key] && axis.n == 1)\n key = coord + \"axis\"; // support x1axis as xaxis\n if (ranges[key]) {\n from = ranges[key].from;\n to = ranges[key].to;\n break;\n }\n }\n }\n\n // backwards-compat stuff - to be removed in future\n if (!ranges[key]) {\n axis = coord == \"x\" ? plot.getXAxes()[0] : plot.getYAxes()[0];\n from = ranges[coord + \"1\"];\n to = ranges[coord + \"2\"];\n }\n\n // auto-reverse as an added bonus\n if (from != null && to != null && from > to) {\n var tmp = from;\n from = to;\n to = tmp;\n }\n\n return { from: from, to: to, axis: axis };\n }\n\n function setSelection(ranges, preventEvent) {\n var axis, range, o = plot.getOptions();\n\n if (o.selection.mode == \"y\") {\n selection.first.x = 0;\n selection.second.x = plot.width();\n }\n else {\n range = extractRange(ranges, \"x\");\n\n selection.first.x = range.axis.p2c(range.from);\n selection.second.x = range.axis.p2c(range.to);\n }\n\n if (o.selection.mode == \"x\") {\n selection.first.y = 0;\n selection.second.y = plot.height();\n }\n else {\n range = extractRange(ranges, \"y\");\n\n selection.first.y = range.axis.p2c(range.from);\n selection.second.y = range.axis.p2c(range.to);\n }\n\n selection.show = true;\n plot.triggerRedrawOverlay();\n if (!preventEvent && selectionIsSane())\n triggerSelectedEvent();\n }\n\n function selectionIsSane() {\n var minSize = plot.getOptions().selection.minSize;\n return Math.abs(selection.second.x - selection.first.x) >= minSize &&\n Math.abs(selection.second.y - selection.first.y) >= minSize;\n }\n\n plot.clearSelection = clearSelection;\n plot.setSelection = setSelection;\n plot.getSelection = getSelection;\n\n plot.hooks.bindEvents.push(function(plot, eventHolder) {\n var o = plot.getOptions();\n if (o.selection.mode != null) {\n eventHolder.mousemove(onMouseMove);\n eventHolder.mousedown(onMouseDown);\n }\n });\n\n\n plot.hooks.drawOverlay.push(function (plot, ctx) {\n // draw selection\n if (selection.show && selectionIsSane()) {\n var plotOffset = plot.getPlotOffset();\n var o = plot.getOptions();\n\n ctx.save();\n ctx.translate(plotOffset.left, plotOffset.top);\n\n var c = $.color.parse(o.selection.color);\n\n ctx.strokeStyle = c.scale('a', 0.8).toString();\n ctx.lineWidth = 1;\n ctx.lineJoin = o.selection.shape;\n ctx.fillStyle = c.scale('a', 0.4).toString();\n\n var x = Math.min(selection.first.x, selection.second.x) + 0.5,\n y = Math.min(selection.first.y, selection.second.y) + 0.5,\n w = Math.abs(selection.second.x - selection.first.x) - 1,\n h = Math.abs(selection.second.y - selection.first.y) - 1;\n\n ctx.fillRect(x, y, w, h);\n ctx.strokeRect(x, y, w, h);\n\n ctx.restore();\n }\n });\n\n plot.hooks.shutdown.push(function (plot, eventHolder) {\n eventHolder.unbind(\"mousemove\", onMouseMove);\n eventHolder.unbind(\"mousedown\", onMouseDown);\n\n if (mouseUpHandler)\n $(document).unbind(\"mouseup\", mouseUpHandler);\n });\n\n }\n\n $.plot.plugins.push({\n init: init,\n options: {\n selection: {\n mode: null, // one of null, \"x\", \"y\" or \"xy\"\n color: \"#e8cfac\",\n shape: \"round\", // one of \"round\", \"miter\", or \"bevel\"\n minSize: 5 // minimum number of pixels\n }\n },\n name: 'selection',\n version: '1.1'\n });\n})(jQuery);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./public/vendor/flot/jquery.flot.selection.js\n// module id = 2007\n// module chunks = 0","/* Flot plugin for stacking data sets rather than overlyaing them.\n\nCopyright (c) 2007-2014 IOLA and Ole Laursen.\nLicensed under the MIT license.\n\nThe plugin assumes the data is sorted on x (or y if stacking horizontally).\nFor line charts, it is assumed that if a line has an undefined gap (from a\nnull point), then the line above it should have the same gap - insert zeros\ninstead of \"null\" if you want another behaviour. This also holds for the start\nand end of the chart. Note that stacking a mix of positive and negative values\nin most instances doesn't make sense (so it looks weird).\n\nTwo or more series are stacked when their \"stack\" attribute is set to the same\nkey (which can be any number or string or just \"true\"). To specify the default\nstack, you can set the stack option like this:\n\n series: {\n stack: null/false, true, or a key (number/string)\n }\n\nYou can also specify it for a single series, like this:\n\n $.plot( $(\"#placeholder\"), [{\n data: [ ... ],\n stack: true\n }])\n\nThe stacking order is determined by the order of the data series in the array\n(later series end up on top of the previous).\n\nInternally, the plugin modifies the datapoints in each series, adding an\noffset to the y value. For line series, extra data points are inserted through\ninterpolation. If there's a second y value, it's also adjusted (e.g for bar\ncharts or filled areas).\n\n*/\n\n(function ($) {\n var options = {\n series: { stack: null } // or number/string\n };\n\n function init(plot) {\n function findMatchingSeries(s, allseries) {\n var res = null;\n for (var i = 0; i < allseries.length; ++i) {\n if (s == allseries[i])\n break;\n\n if (allseries[i].stack == s.stack)\n res = allseries[i];\n }\n\n return res;\n }\n\n function stackData(plot, s, datapoints) {\n if (s.stack == null || s.stack === false)\n return;\n\n var other = findMatchingSeries(s, plot.getData());\n if (!other)\n return;\n\n var ps = datapoints.pointsize,\n points = datapoints.points,\n otherps = other.datapoints.pointsize,\n otherpoints = other.datapoints.points,\n newpoints = [],\n px, py, intery, qx, qy, bottom,\n withlines = s.lines.show,\n horizontal = s.bars.horizontal,\n withbottom = ps > 2 && (horizontal ? datapoints.format[2].x : datapoints.format[2].y),\n withsteps = withlines && s.lines.steps,\n keyOffset = horizontal ? 1 : 0,\n accumulateOffset = horizontal ? 0 : 1,\n i = 0, j = 0, l, m;\n\n while (true) {\n if (i >= points.length && j >= otherpoints.length)\n break;\n\n l = newpoints.length;\n\n if (i < points.length && points[i] == null) {\n // copy gaps\n for (m = 0; m < ps; ++m)\n newpoints.push(points[i + m]);\n i += ps;\n }\n else if (i >= points.length) {\n // take the remaining points from the previous series\n for (m = 0; m < ps; ++m)\n newpoints.push(otherpoints[j + m]);\n if (withbottom)\n newpoints[l + 2] = otherpoints[j + accumulateOffset];\n j += otherps;\n }\n else if (j >= otherpoints.length) {\n // take the remaining points from the current series\n for (m = 0; m < ps; ++m)\n newpoints.push(points[i + m]);\n i += ps;\n }\n else if (j < otherpoints.length && otherpoints[j] == null) {\n // ignore point\n j += otherps;\n }\n else {\n // cases where we actually got two points\n px = points[i + keyOffset];\n py = points[i + accumulateOffset];\n qx = otherpoints[j + keyOffset];\n qy = otherpoints[j + accumulateOffset];\n bottom = 0;\n\n if (px == qx) {\n for (m = 0; m < ps; ++m)\n newpoints.push(points[i + m]);\n\n newpoints[l + accumulateOffset] += qy;\n bottom = qy;\n\n i += ps;\n j += otherps;\n }\n else if (px > qx) {\n // take the point from the previous series so that next series will correctly stack\n if (i == 0) {\n for (m = 0; m < ps; ++m)\n newpoints.push(otherpoints[j + m]);\n bottom = qy;\n }\n // we got past point below, might need to\n // insert interpolated extra point\n if (i > 0 && points[i - ps] != null) {\n intery = py + (points[i - ps + accumulateOffset] - py) * (qx - px) / (points[i - ps + keyOffset] - px);\n newpoints.push(qx);\n newpoints.push(intery + qy);\n for (m = 2; m < ps; ++m)\n newpoints.push(points[i + m]);\n bottom = qy;\n }\n\n j += otherps;\n }\n else { // px < qx\n for (m = 0; m < ps; ++m)\n newpoints.push(points[i + m]);\n\n // we might be able to interpolate a point below,\n // this can give us a better y\n if (j > 0 && otherpoints[j - otherps] != null)\n bottom = qy + (otherpoints[j - otherps + accumulateOffset] - qy) * (px - qx) / (otherpoints[j - otherps + keyOffset] - qx);\n\n newpoints[l + accumulateOffset] += bottom;\n\n i += ps;\n }\n\n fromgap = false;\n\n if (l != newpoints.length && withbottom)\n newpoints[l + 2] = bottom;\n }\n\n // maintain the line steps invariant\n if (withsteps && l != newpoints.length && l > 0\n && newpoints[l] != null\n && newpoints[l] != newpoints[l - ps]\n && newpoints[l + 1] != newpoints[l - ps + 1]) {\n for (m = 0; m < ps; ++m)\n newpoints[l + ps + m] = newpoints[l + m];\n newpoints[l + 1] = newpoints[l - ps + 1];\n }\n }\n\n datapoints.points = newpoints;\n }\n\n plot.hooks.processDatapoints.push(stackData);\n }\n\n $.plot.plugins.push({\n init: init,\n options: options,\n name: 'stack',\n version: '1.2'\n });\n})(jQuery);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./public/vendor/flot/jquery.flot.stack.js\n// module id = 2008\n// module chunks = 0","(function ($) {\n var options = {\n series: {\n stackpercent: null\n } // or number/string\n };\n\n function init(plot) {\n\n // will be built up dynamically as a hash from x-value, or y-value if horizontal\n var stackBases = {};\n var processed = false;\n var stackSums = {};\n\n //set percentage for stacked chart\n function processRawData(plot, series, data, datapoints) {\n if (!processed) {\n processed = true;\n stackSums = getStackSums(plot.getData());\n }\n\t\t\tif (series.stackpercent == true) {\n\t\t\t\tvar num = data.length;\n\t\t\t\tseries.percents = [];\n\t\t\t\tvar key_idx = 0;\n\t\t\t\tvar value_idx = 1;\n\t\t\t\tif (series.bars && series.bars.horizontal && series.bars.horizontal === true) {\n\t\t\t\t\tkey_idx = 1;\n\t\t\t\t\tvalue_idx = 0;\n\t\t\t\t}\n\t\t\t\tfor (var j = 0; j < num; j++) {\n\t\t\t\t\tvar sum = stackSums[data[j][key_idx] + \"\"];\n\t\t\t\t\tif (sum > 0) {\n\t\t\t\t\t\tseries.percents.push(data[j][value_idx] * 100 / sum);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tseries.percents.push(0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n }\n\n //calculate summary\n function getStackSums(_data) {\n var data_len = _data.length;\n var sums = {};\n if (data_len > 0) {\n //caculate summary\n for (var i = 0; i < data_len; i++) {\n if (_data[i].stackpercent) {\n\t\t\t\t\t\tvar key_idx = 0;\n\t\t\t\t\t\tvar value_idx = 1;\n\t\t\t\t\t\tif (_data[i].bars && _data[i].bars.horizontal && _data[i].bars.horizontal === true) {\n\t\t\t\t\t\t\tkey_idx = 1;\n\t\t\t\t\t\t\tvalue_idx = 0;\n\t\t\t\t\t\t}\n var num = _data[i].data.length;\n for (var j = 0; j < num; j++) {\n var value = 0;\n if (_data[i].data[j][1] != null) {\n value = _data[i].data[j][value_idx];\n }\n if (sums[_data[i].data[j][key_idx] + \"\"]) {\n sums[_data[i].data[j][key_idx] + \"\"] += value;\n } else {\n sums[_data[i].data[j][key_idx] + \"\"] = value;\n }\n\n }\n }\n }\n }\n return sums;\n }\n\n function stackData(plot, s, datapoints) {\n if (!s.stackpercent) return;\n if (!processed) {\n stackSums = getStackSums(plot.getData());\n }\n var newPoints = [];\n\n\n\t\t\tvar key_idx = 0;\n\t\t\tvar value_idx = 1;\n\t\t\tif (s.bars && s.bars.horizontal && s.bars.horizontal === true) {\n\t\t\t\tkey_idx = 1;\n\t\t\t\tvalue_idx = 0;\n\t\t\t}\n\n\t\t\tfor (var i = 0; i < datapoints.points.length; i += 3) {\n\t\t\t\t// note that the values need to be turned into absolute y-values.\n\t\t\t\t// in other words, if you were to stack (x, y1), (x, y2), and (x, y3),\n\t\t\t\t// (each from different series, which is where stackBases comes in),\n\t\t\t\t// you'd want the new points to be (x, y1, 0), (x, y1+y2, y1), (x, y1+y2+y3, y1+y2)\n\t\t\t\t// generally, (x, thisValue + (base up to this point), + (base up to this point))\n\t\t\t\tif (!stackBases[datapoints.points[i + key_idx]]) {\n\t\t\t\t\tstackBases[datapoints.points[i + key_idx]] = 0;\n\t\t\t\t}\n\t\t\t\tnewPoints[i + key_idx] = datapoints.points[i + key_idx];\n\t\t\t\tnewPoints[i + value_idx] = datapoints.points[i + value_idx] + stackBases[datapoints.points[i + key_idx]];\n\t\t\t\tnewPoints[i + 2] = stackBases[datapoints.points[i + key_idx]];\n\t\t\t\tstackBases[datapoints.points[i + key_idx]] += datapoints.points[i + value_idx];\n\t\t\t\t// change points to percentage values\n\t\t\t\t// you may need to set yaxis:{ max = 100 }\n\t\t\t\tif ( stackSums[newPoints[i+key_idx]+\"\"] > 0 ){\n\t\t\t\t\tnewPoints[i + value_idx] = newPoints[i + value_idx] * 100 / stackSums[newPoints[i + key_idx] + \"\"];\n\t\t\t\t\tnewPoints[i + 2] = newPoints[i + 2] * 100 / stackSums[newPoints[i + key_idx] + \"\"];\n\t\t\t\t} else {\n\t\t\t\t\tnewPoints[i + value_idx] = 0;\n\t\t\t\t\tnewPoints[i + 2] = 0;\n\t\t\t\t}\n\t\t\t}\n\n datapoints.points = newPoints;\n }\n\n\t\tplot.hooks.processRawData.push(processRawData);\n plot.hooks.processDatapoints.push(stackData);\n }\n\n $.plot.plugins.push({\n init: init,\n options: options,\n name: 'stackpercent',\n version: '0.1'\n });\n})(jQuery);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./public/vendor/flot/jquery.flot.stackpercent.js\n// module id = 2009\n// module chunks = 0","(function($) {\n \"use strict\";\n\n var options = {\n series: {\n fillBelowTo: null\n }\n };\n\n function init(plot) {\n function findBelowSeries( series, allseries ) {\n\n var i;\n\n for ( i = 0; i < allseries.length; ++i ) {\n if ( allseries[ i ].id === series.fillBelowTo ) {\n return allseries[ i ];\n }\n }\n\n return null;\n }\n\n /* top and bottom doesn't actually matter for this, we're just using it to help make this easier to think about */\n /* this is a vector cross product operation */\n function segmentIntersection(top_left_x, top_left_y, top_right_x, top_right_y, bottom_left_x, bottom_left_y, bottom_right_x, bottom_right_y) {\n var top_delta_x, top_delta_y, bottom_delta_x, bottom_delta_y,\n s, t;\n\n top_delta_x = top_right_x - top_left_x;\n top_delta_y = top_right_y - top_left_y;\n bottom_delta_x = bottom_right_x - bottom_left_x;\n bottom_delta_y = bottom_right_y - bottom_left_y;\n\n s = (\n (-top_delta_y * (top_left_x - bottom_left_x)) + (top_delta_x * (top_left_y - bottom_left_y))\n ) / (\n -bottom_delta_x * top_delta_y + top_delta_x * bottom_delta_y\n );\n\n t = (\n (bottom_delta_x * (top_left_y - bottom_left_y)) - (bottom_delta_y * (top_left_x - bottom_left_x))\n ) / (\n -bottom_delta_x * top_delta_y + top_delta_x * bottom_delta_y\n );\n\n // Collision detected\n if (s >= 0 && s <= 1 && t >= 0 && t <= 1) {\n return [\n top_left_x + (t * top_delta_x), // X\n top_left_y + (t * top_delta_y) // Y\n ];\n }\n\n // No collision\n return null;\n }\n\n function plotDifferenceArea(plot, ctx, series) {\n if ( series.fillBelowTo === null ) {\n return;\n }\n\n var otherseries,\n\n ps,\n points,\n\n otherps,\n otherpoints,\n\n plotOffset,\n fillStyle;\n\n function openPolygon(x, y) {\n ctx.beginPath();\n ctx.moveTo(\n series.xaxis.p2c(x) + plotOffset.left,\n series.yaxis.p2c(y) + plotOffset.top\n );\n\n }\n\n function closePolygon() {\n ctx.closePath();\n ctx.fill();\n }\n\n function validateInput() {\n if (points.length/ps !== otherpoints.length/otherps) {\n console.error(\"Refusing to graph inconsistent number of points\");\n return false;\n }\n\n var i;\n for (i = 0; i < (points.length / ps); i++) {\n if (\n points[i * ps] !== null &&\n otherpoints[i * otherps] !== null &&\n points[i * ps] !== otherpoints[i * otherps]\n ) {\n console.error(\"Refusing to graph points without matching value\");\n return false;\n }\n }\n\n return true;\n }\n\n function findNextStart(start_i, end_i) {\n console.assert(end_i > start_i, \"expects the end index to be greater than the start index\");\n\n var start = (\n start_i === 0 ||\n points[start_i - 1] === null ||\n otherpoints[start_i - 1] === null\n ),\n equal = false,\n i,\n intersect;\n\n for (i = start_i; i < end_i; i++) {\n // Take note of null points\n if (\n points[(i * ps) + 1] === null ||\n otherpoints[(i * ps) + 1] === null\n ) {\n equal = false;\n start = true;\n }\n\n // Take note of equal points\n else if (points[(i * ps) + 1] === otherpoints[(i * otherps) + 1]) {\n equal = true;\n start = false;\n }\n\n\n else if (points[(i * ps) + 1] > otherpoints[(i * otherps) + 1]) {\n // If we begin above the desired point\n if (start) {\n openPolygon(points[i * ps], points[(i * ps) + 1]);\n }\n\n // If an equal point preceeds this, start the polygon at that equal point\n else if (equal) {\n openPolygon(points[(i - 1) * ps], points[((i - 1) * ps) + 1]);\n }\n\n // Otherwise, find the intersection point, and start it there\n else {\n intersect = intersectionPoint(i);\n openPolygon(intersect[0], intersect[1]);\n }\n\n topTraversal(i, end_i);\n return;\n }\n\n // If we go below equal, equal at any preceeding point is irrelevant\n else {\n start = false;\n equal = false;\n }\n }\n }\n\n function intersectionPoint(right_i) {\n console.assert(right_i > 0, \"expects the second point in the series line segment\");\n\n var i, intersect;\n\n for (i = 1; i < (otherpoints.length/otherps); i++) {\n intersect = segmentIntersection(\n points[(right_i - 1) * ps], points[((right_i - 1) * ps) + 1],\n points[right_i * ps], points[(right_i * ps) + 1],\n\n otherpoints[(i - 1) * otherps], otherpoints[((i - 1) * otherps) + 1],\n otherpoints[i * otherps], otherpoints[(i * otherps) + 1]\n );\n\n if (intersect !== null) {\n return intersect;\n }\n }\n\n console.error(\"intersectionPoint() should only be called when an intersection happens\");\n }\n\n function bottomTraversal(start_i, end_i) {\n console.assert(start_i >= end_i, \"the start should be the rightmost point, and the end should be the leftmost (excluding the equal or intersecting point)\");\n\n var i;\n\n for (i = start_i; i >= end_i; i--) {\n ctx.lineTo(\n otherseries.xaxis.p2c(otherpoints[i * otherps]) + plotOffset.left,\n otherseries.yaxis.p2c(otherpoints[(i * otherps) + 1]) + plotOffset.top\n );\n }\n\n closePolygon();\n }\n\n function topTraversal(start_i, end_i) {\n console.assert(start_i <= end_i, \"the start should be the rightmost point, and the end should be the leftmost (excluding the equal or intersecting point)\");\n\n var i,\n intersect;\n\n for (i = start_i; i < end_i; i++) {\n if (points[(i * ps) + 1] === null && i > start_i) {\n bottomTraversal(i - 1, start_i);\n findNextStart(i, end_i);\n return;\n }\n\n else if (points[(i * ps) + 1] === otherpoints[(i * otherps) + 1]) {\n bottomTraversal(i, start_i);\n findNextStart(i, end_i);\n return;\n }\n\n else if (points[(i * ps) + 1] < otherpoints[(i * otherps) + 1]) {\n intersect = intersectionPoint(i);\n ctx.lineTo(\n series.xaxis.p2c(intersect[0]) + plotOffset.left,\n series.yaxis.p2c(intersect[1]) + plotOffset.top\n );\n bottomTraversal(i, start_i);\n findNextStart(i, end_i);\n return;\n\n }\n\n else {\n ctx.lineTo(\n series.xaxis.p2c(points[i * ps]) + plotOffset.left,\n series.yaxis.p2c(points[(i * ps) + 1]) + plotOffset.top\n );\n }\n }\n\n bottomTraversal(end_i, start_i);\n }\n\n\n // Begin processing\n\n otherseries = findBelowSeries( series, plot.getData() );\n\n if ( !otherseries ) {\n return;\n }\n\n ps = series.datapoints.pointsize;\n points = series.datapoints.points;\n otherps = otherseries.datapoints.pointsize;\n otherpoints = otherseries.datapoints.points;\n plotOffset = plot.getPlotOffset();\n\n if (!validateInput()) {\n return;\n }\n\n\n // Flot's getFillStyle() should probably be exposed somewhere\n fillStyle = $.color.parse(series.color);\n fillStyle.a = 0.4;\n fillStyle.normalize();\n ctx.fillStyle = fillStyle.toString();\n\n\n // Begin recursive bi-directional traversal\n findNextStart(0, points.length/ps);\n }\n\n plot.hooks.drawSeries.push(plotDifferenceArea);\n }\n\n $.plot.plugins.push({\n init: init,\n options: options,\n name: \"fillbelow\",\n version: \"0.1.0\"\n });\n\n})(jQuery);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./public/vendor/flot/jquery.flot.fillbelow.js\n// module id = 2010\n// module chunks = 0","/* Flot plugin for showing crosshairs when the mouse hovers over the plot.\n\nCopyright (c) 2007-2014 IOLA and Ole Laursen.\nLicensed under the MIT license.\n\nThe plugin supports these options:\n\n\tcrosshair: {\n\t\tmode: null or \"x\" or \"y\" or \"xy\"\n\t\tcolor: color\n\t\tlineWidth: number\n\t}\n\nSet the mode to one of \"x\", \"y\" or \"xy\". The \"x\" mode enables a vertical\ncrosshair that lets you trace the values on the x axis, \"y\" enables a\nhorizontal crosshair and \"xy\" enables them both. \"color\" is the color of the\ncrosshair (default is \"rgba(170, 0, 0, 0.80)\"), \"lineWidth\" is the width of\nthe drawn lines (default is 1).\n\nThe plugin also adds four public methods:\n\n - setCrosshair( pos )\n\n Set the position of the crosshair. Note that this is cleared if the user\n moves the mouse. \"pos\" is in coordinates of the plot and should be on the\n form { x: xpos, y: ypos } (you can use x2/x3/... if you're using multiple\n axes), which is coincidentally the same format as what you get from a\n \"plothover\" event. If \"pos\" is null, the crosshair is cleared.\n\n - clearCrosshair()\n\n Clear the crosshair.\n\n - lockCrosshair(pos)\n\n Cause the crosshair to lock to the current location, no longer updating if\n the user moves the mouse. Optionally supply a position (passed on to\n setCrosshair()) to move it to.\n\n Example usage:\n\n\tvar myFlot = $.plot( $(\"#graph\"), ..., { crosshair: { mode: \"x\" } } };\n\t$(\"#graph\").bind( \"plothover\", function ( evt, position, item ) {\n\t\tif ( item ) {\n\t\t\t// Lock the crosshair to the data point being hovered\n\t\t\tmyFlot.lockCrosshair({\n\t\t\t\tx: item.datapoint[ 0 ],\n\t\t\t\ty: item.datapoint[ 1 ]\n\t\t\t});\n\t\t} else {\n\t\t\t// Return normal crosshair operation\n\t\t\tmyFlot.unlockCrosshair();\n\t\t}\n\t});\n\n - unlockCrosshair()\n\n Free the crosshair to move again after locking it.\n*/\n\n(function ($) {\n var options = {\n crosshair: {\n mode: null, // one of null, \"x\", \"y\" or \"xy\",\n color: \"rgba(170, 0, 0, 0.80)\",\n lineWidth: 1\n }\n };\n \n function init(plot) {\n // position of crosshair in pixels\n var crosshair = { x: -1, y: -1, locked: false };\n\n plot.setCrosshair = function setCrosshair(pos) {\n if (!pos)\n crosshair.x = -1;\n else {\n var o = plot.p2c(pos);\n crosshair.x = Math.max(0, Math.min(o.left, plot.width()));\n crosshair.y = Math.max(0, Math.min(o.top, plot.height()));\n }\n \n plot.triggerRedrawOverlay();\n };\n \n plot.clearCrosshair = plot.setCrosshair; // passes null for pos\n \n plot.lockCrosshair = function lockCrosshair(pos) {\n if (pos)\n plot.setCrosshair(pos);\n crosshair.locked = true;\n };\n\n plot.unlockCrosshair = function unlockCrosshair() {\n crosshair.locked = false;\n };\n\n function onMouseOut(e) {\n if (crosshair.locked)\n return;\n\n if (crosshair.x != -1) {\n crosshair.x = -1;\n plot.triggerRedrawOverlay();\n }\n }\n\n function onMouseMove(e) {\n if (crosshair.locked)\n return;\n \n if (plot.getSelection && plot.getSelection()) {\n crosshair.x = -1; // hide the crosshair while selecting\n return;\n }\n \n var offset = plot.offset();\n crosshair.x = Math.max(0, Math.min(e.pageX - offset.left, plot.width()));\n crosshair.y = Math.max(0, Math.min(e.pageY - offset.top, plot.height()));\n plot.triggerRedrawOverlay();\n }\n \n plot.hooks.bindEvents.push(function (plot, eventHolder) {\n if (!plot.getOptions().crosshair.mode)\n return;\n\n eventHolder.mouseout(onMouseOut);\n eventHolder.mousemove(onMouseMove);\n });\n\n plot.hooks.drawOverlay.push(function (plot, ctx) {\n var c = plot.getOptions().crosshair;\n if (!c.mode)\n return;\n\n var plotOffset = plot.getPlotOffset();\n \n ctx.save();\n ctx.translate(plotOffset.left, plotOffset.top);\n\n if (crosshair.x != -1) {\n var adj = plot.getOptions().crosshair.lineWidth % 2 ? 0.5 : 0;\n\n ctx.strokeStyle = c.color;\n ctx.lineWidth = c.lineWidth;\n ctx.lineJoin = \"round\";\n\n ctx.beginPath();\n if (c.mode.indexOf(\"x\") != -1) {\n var drawX = Math.floor(crosshair.x) + adj;\n ctx.moveTo(drawX, 0);\n ctx.lineTo(drawX, plot.height());\n }\n if (c.mode.indexOf(\"y\") != -1) {\n var drawY = Math.floor(crosshair.y) + adj;\n ctx.moveTo(0, drawY);\n ctx.lineTo(plot.width(), drawY);\n }\n ctx.stroke();\n }\n ctx.restore();\n });\n\n plot.hooks.shutdown.push(function (plot, eventHolder) {\n eventHolder.unbind(\"mouseout\", onMouseOut);\n eventHolder.unbind(\"mousemove\", onMouseMove);\n });\n }\n \n $.plot.plugins.push({\n init: init,\n options: options,\n name: 'crosshair',\n version: '1.0'\n });\n})(jQuery);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./public/vendor/flot/jquery.flot.crosshair.js\n// module id = 2011\n// module chunks = 0","/*\n * jQuery.flot.dashes\n *\n * options = {\n * series: {\n * dashes: {\n *\n * // show\n * // default: false\n * // Whether to show dashes for the series.\n * show: ,\n *\n * // lineWidth\n * // default: 2\n * // The width of the dashed line in pixels.\n * lineWidth: ,\n *\n * // dashLength\n * // default: 10\n * // Controls the length of the individual dashes and the amount of\n * // space between them.\n * // If this is a number, the dashes and spaces will have that length.\n * // If this is an array, it is read as [ dashLength, spaceLength ]\n * dashLength: or \n * }\n * }\n * }\n */\n(function($){\n\n function init(plot) {\n\n plot.hooks.processDatapoints.push(function(plot, series, datapoints) {\n\n if (!series.dashes.show) return;\n\n plot.hooks.draw.push(function(plot, ctx) {\n\n var plotOffset = plot.getPlotOffset(),\n axisx = series.xaxis,\n axisy = series.yaxis;\n\n function plotDashes(xoffset, yoffset) {\n\n var points = datapoints.points,\n ps = datapoints.pointsize,\n prevx = null,\n prevy = null,\n dashRemainder = 0,\n dashOn = true,\n dashOnLength,\n dashOffLength;\n\n if (series.dashes.dashLength[0]) {\n dashOnLength = series.dashes.dashLength[0];\n if (series.dashes.dashLength[1]) {\n dashOffLength = series.dashes.dashLength[1];\n } else {\n dashOffLength = dashOnLength;\n }\n } else {\n dashOffLength = dashOnLength = series.dashes.dashLength;\n }\n\n ctx.beginPath();\n\n for (var i = ps; i < points.length; i += ps) {\n\n var x1 = points[i - ps],\n y1 = points[i - ps + 1],\n x2 = points[i],\n y2 = points[i + 1];\n\n if (x1 == null || x2 == null) continue;\n\n // clip with ymin\n if (y1 <= y2 && y1 < axisy.min) {\n if (y2 < axisy.min) continue; // line segment is outside\n // compute new intersection point\n x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;\n y1 = axisy.min;\n } else if (y2 <= y1 && y2 < axisy.min) {\n if (y1 < axisy.min) continue;\n x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;\n y2 = axisy.min;\n }\n\n // clip with ymax\n if (y1 >= y2 && y1 > axisy.max) {\n if (y2 > axisy.max) continue;\n x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;\n y1 = axisy.max;\n } else if (y2 >= y1 && y2 > axisy.max) {\n if (y1 > axisy.max) continue;\n x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;\n y2 = axisy.max;\n }\n\n // clip with xmin\n if (x1 <= x2 && x1 < axisx.min) {\n if (x2 < axisx.min) continue;\n y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;\n x1 = axisx.min;\n } else if (x2 <= x1 && x2 < axisx.min) {\n if (x1 < axisx.min) continue;\n y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;\n x2 = axisx.min;\n }\n\n // clip with xmax\n if (x1 >= x2 && x1 > axisx.max) {\n if (x2 > axisx.max) continue;\n y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;\n x1 = axisx.max;\n } else if (x2 >= x1 && x2 > axisx.max) {\n if (x1 > axisx.max) continue;\n y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;\n x2 = axisx.max;\n }\n\n if (x1 != prevx || y1 != prevy) {\n ctx.moveTo(axisx.p2c(x1) + xoffset, axisy.p2c(y1) + yoffset);\n }\n\n var ax1 = axisx.p2c(x1) + xoffset,\n ay1 = axisy.p2c(y1) + yoffset,\n ax2 = axisx.p2c(x2) + xoffset,\n ay2 = axisy.p2c(y2) + yoffset,\n dashOffset;\n\n function lineSegmentOffset(segmentLength) {\n\n var c = Math.sqrt(Math.pow(ax2 - ax1, 2) + Math.pow(ay2 - ay1, 2));\n\n if (c <= segmentLength) {\n return {\n deltaX: ax2 - ax1,\n deltaY: ay2 - ay1,\n distance: c,\n remainder: segmentLength - c\n }\n } else {\n var xsign = ax2 > ax1 ? 1 : -1,\n ysign = ay2 > ay1 ? 1 : -1;\n return {\n deltaX: xsign * Math.sqrt(Math.pow(segmentLength, 2) / (1 + Math.pow((ay2 - ay1)/(ax2 - ax1), 2))),\n deltaY: ysign * Math.sqrt(Math.pow(segmentLength, 2) - Math.pow(segmentLength, 2) / (1 + Math.pow((ay2 - ay1)/(ax2 - ax1), 2))),\n distance: segmentLength,\n remainder: 0\n };\n }\n }\n //-end lineSegmentOffset\n\n do {\n\n dashOffset = lineSegmentOffset(\n dashRemainder > 0 ? dashRemainder :\n dashOn ? dashOnLength : dashOffLength);\n\n if (dashOffset.deltaX != 0 || dashOffset.deltaY != 0) {\n if (dashOn) {\n ctx.lineTo(ax1 + dashOffset.deltaX, ay1 + dashOffset.deltaY);\n } else {\n ctx.moveTo(ax1 + dashOffset.deltaX, ay1 + dashOffset.deltaY);\n }\n }\n\n dashOn = !dashOn;\n dashRemainder = dashOffset.remainder;\n ax1 += dashOffset.deltaX;\n ay1 += dashOffset.deltaY;\n\n } while (dashOffset.distance > 0);\n\n prevx = x2;\n prevy = y2;\n }\n\n ctx.stroke();\n }\n //-end plotDashes\n\n ctx.save();\n ctx.translate(plotOffset.left, plotOffset.top);\n ctx.lineJoin = 'round';\n\n var lw = series.dashes.lineWidth,\n sw = series.shadowSize;\n\n // FIXME: consider another form of shadow when filling is turned on\n if (lw > 0 && sw > 0) {\n // draw shadow as a thick and thin line with transparency\n ctx.lineWidth = sw;\n ctx.strokeStyle = \"rgba(0,0,0,0.1)\";\n // position shadow at angle from the mid of line\n var angle = Math.PI/18;\n plotDashes(Math.sin(angle) * (lw/2 + sw/2), Math.cos(angle) * (lw/2 + sw/2));\n ctx.lineWidth = sw/2;\n plotDashes(Math.sin(angle) * (lw/2 + sw/4), Math.cos(angle) * (lw/2 + sw/4));\n }\n\n ctx.lineWidth = lw;\n ctx.strokeStyle = series.color;\n\n if (lw > 0) {\n plotDashes(0, 0);\n }\n\n ctx.restore();\n\n });\n //-end draw hook\n\n });\n //-end processDatapoints hook\n\n }\n //-end init\n\n $.plot.plugins.push({\n init: init,\n options: {\n series: {\n dashes: {\n show: false,\n lineWidth: 2,\n dashLength: 10\n }\n }\n },\n name: 'dashes',\n version: '0.1'\n });\n\n})(jQuery)\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./public/vendor/flot/jquery.flot.dashes.js\n// module id = 2012\n// module chunks = 0","import * as d3 from 'd3';\nimport * as d3ScaleChromatic from 'd3-scale-chromatic';\n\nexport function getColorScale(colorScheme: any, lightTheme: boolean, maxValue: number, minValue = 0): (d: any) => any {\n let colorInterpolator = d3ScaleChromatic[colorScheme.value];\n let colorScaleInverted = colorScheme.invert === 'always' || (colorScheme.invert === 'dark' && !lightTheme);\n\n let start = colorScaleInverted ? maxValue : minValue;\n let end = colorScaleInverted ? minValue : maxValue;\n\n return d3.scaleSequential(colorInterpolator).domain([start, end]);\n}\n\nexport function getOpacityScale(options, maxValue, minValue = 0) {\n let legendOpacityScale;\n if (options.colorScale === 'linear') {\n legendOpacityScale = d3\n .scaleLinear()\n .domain([minValue, maxValue])\n .range([0, 1]);\n } else if (options.colorScale === 'sqrt') {\n legendOpacityScale = d3\n .scalePow()\n .exponent(options.exponent)\n .domain([minValue, maxValue])\n .range([0, 1]);\n }\n return legendOpacityScale;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/heatmap/color_scale.ts","import _ from 'lodash';\nimport flatten from '../../../core/utils/flatten';\nimport TimeSeries from '../../../core/time_series2';\nimport TableModel from '../../../core/table_model';\n\nvar transformers = {};\n\ntransformers['timeseries_to_rows'] = {\n description: 'Time series to rows',\n getColumns: function() {\n return [];\n },\n transform: function(data, panel, model) {\n model.columns = [{ text: 'Time', type: 'date' }, { text: 'Metric' }, { text: 'Value' }];\n\n for (var i = 0; i < data.length; i++) {\n var series = data[i];\n for (var y = 0; y < series.datapoints.length; y++) {\n var dp = series.datapoints[y];\n model.rows.push([dp[1], series.target, dp[0]]);\n }\n }\n },\n};\n\ntransformers['timeseries_to_columns'] = {\n description: 'Time series to columns',\n getColumns: function() {\n return [];\n },\n transform: function(data, panel, model) {\n model.columns.push({ text: 'Time', type: 'date' });\n\n // group by time\n var points = {};\n\n for (let i = 0; i < data.length; i++) {\n var series = data[i];\n model.columns.push({ text: series.target });\n\n for (var y = 0; y < series.datapoints.length; y++) {\n var dp = series.datapoints[y];\n var timeKey = dp[1].toString();\n\n if (!points[timeKey]) {\n points[timeKey] = { time: dp[1] };\n points[timeKey][i] = dp[0];\n } else {\n points[timeKey][i] = dp[0];\n }\n }\n }\n\n for (var time in points) {\n var point = points[time];\n var values = [point.time];\n\n for (let i = 0; i < data.length; i++) {\n var value = point[i];\n values.push(value);\n }\n\n model.rows.push(values);\n }\n },\n};\n\ntransformers['timeseries_aggregations'] = {\n description: 'Time series aggregations',\n getColumns: function() {\n return [\n { text: 'Avg', value: 'avg' },\n { text: 'Min', value: 'min' },\n { text: 'Max', value: 'max' },\n { text: 'Total', value: 'total' },\n { text: 'Current', value: 'current' },\n { text: 'Count', value: 'count' },\n ];\n },\n transform: function(data, panel, model) {\n var i, y;\n model.columns.push({ text: 'Metric' });\n\n for (i = 0; i < panel.columns.length; i++) {\n model.columns.push({ text: panel.columns[i].text });\n }\n\n for (i = 0; i < data.length; i++) {\n var series = new TimeSeries({\n datapoints: data[i].datapoints,\n alias: data[i].target,\n });\n\n series.getFlotPairs('connected');\n var cells = [series.alias];\n\n for (y = 0; y < panel.columns.length; y++) {\n cells.push(series.stats[panel.columns[y].value]);\n }\n\n model.rows.push(cells);\n }\n },\n};\n\ntransformers['annotations'] = {\n description: 'Annotations',\n getColumns: function() {\n return [];\n },\n transform: function(data, panel, model) {\n model.columns.push({ text: 'Time', type: 'date' });\n model.columns.push({ text: 'Title' });\n model.columns.push({ text: 'Text' });\n model.columns.push({ text: 'Tags' });\n\n if (!data || !data.annotations || data.annotations.length === 0) {\n return;\n }\n\n for (var i = 0; i < data.annotations.length; i++) {\n var evt = data.annotations[i];\n model.rows.push([evt.time, evt.title, evt.text, evt.tags]);\n }\n },\n};\n\ntransformers['table'] = {\n description: 'Table',\n getColumns: function(data) {\n if (!data || data.length === 0) {\n return [];\n }\n\n // Single query returns data columns as is\n if (data.length === 1) {\n return [...data[0].columns];\n }\n\n // Track column indexes: name -> index\n const columnNames = {};\n\n // Union of all columns\n const columns = data.reduce((acc, series) => {\n series.columns.forEach(col => {\n const { text } = col;\n if (columnNames[text] === undefined) {\n columnNames[text] = acc.length;\n acc.push(col);\n }\n });\n return acc;\n }, []);\n\n return columns;\n },\n transform: function(data, panel, model) {\n if (!data || data.length === 0) {\n return;\n }\n\n const noTableIndex = _.findIndex(data, d => d.type !== 'table');\n if (noTableIndex > -1) {\n throw {\n message: `Result of query #${String.fromCharCode(\n 65 + noTableIndex\n )} is not in table format, try using another transform.`,\n };\n }\n\n // Single query returns data columns and rows as is\n if (data.length === 1) {\n model.columns = [...data[0].columns];\n model.rows = [...data[0].rows];\n return;\n }\n\n // Track column indexes of union: name -> index\n const columnNames = {};\n\n // Union of all non-value columns\n const columnsUnion = data.reduce((acc, series) => {\n series.columns.forEach(col => {\n const { text } = col;\n if (columnNames[text] === undefined) {\n columnNames[text] = acc.length;\n acc.push(col);\n }\n });\n return acc;\n }, []);\n\n // Map old column index to union index per series, e.g.,\n // given columnNames {A: 0, B: 1} and\n // data [{columns: [{ text: 'A' }]}, {columns: [{ text: 'B' }]}] => [[0], [1]]\n const columnIndexMapper = data.map(series => series.columns.map(col => columnNames[col.text]));\n\n // Flatten rows of all series and adjust new column indexes\n const flattenedRows = data.reduce((acc, series, seriesIndex) => {\n const mapper = columnIndexMapper[seriesIndex];\n series.rows.forEach(row => {\n const alteredRow = [];\n // Shifting entries according to index mapper\n mapper.forEach((to, from) => {\n alteredRow[to] = row[from];\n });\n acc.push(alteredRow);\n });\n return acc;\n }, []);\n\n // Returns true if both rows have matching non-empty fields as well as matching\n // indexes where one field is empty and the other is not\n function areRowsMatching(columns, row, otherRow) {\n let foundFieldToMatch = false;\n for (let columnIndex = 0; columnIndex < columns.length; columnIndex++) {\n if (row[columnIndex] !== undefined && otherRow[columnIndex] !== undefined) {\n if (row[columnIndex] !== otherRow[columnIndex]) {\n return false;\n }\n } else if (row[columnIndex] === undefined || otherRow[columnIndex] === undefined) {\n foundFieldToMatch = true;\n }\n }\n return foundFieldToMatch;\n }\n\n // Merge rows that have same values for columns\n const mergedRows = {};\n const compactedRows = flattenedRows.reduce((acc, row, rowIndex) => {\n if (!mergedRows[rowIndex]) {\n // Look from current row onwards\n let offset = rowIndex + 1;\n // More than one row can be merged into current row\n while (offset < flattenedRows.length) {\n // Find next row that could be merged\n const match = _.findIndex(flattenedRows, otherRow => areRowsMatching(columnsUnion, row, otherRow), offset);\n if (match > -1) {\n const matchedRow = flattenedRows[match];\n // Merge values from match into current row if there is a gap in the current row\n for (let columnIndex = 0; columnIndex < columnsUnion.length; columnIndex++) {\n if (row[columnIndex] === undefined && matchedRow[columnIndex] !== undefined) {\n row[columnIndex] = matchedRow[columnIndex];\n }\n }\n // Don't visit this row again\n mergedRows[match] = matchedRow;\n // Keep looking for more rows to merge\n offset = match + 1;\n } else {\n // No match found, stop looking\n break;\n }\n }\n acc.push(row);\n }\n return acc;\n }, []);\n\n model.columns = columnsUnion;\n model.rows = compactedRows;\n },\n};\n\ntransformers['json'] = {\n description: 'JSON Data',\n getColumns: function(data) {\n if (!data || data.length === 0) {\n return [];\n }\n\n var names: any = {};\n for (var i = 0; i < data.length; i++) {\n var series = data[i];\n if (series.type !== 'docs') {\n continue;\n }\n\n // only look at 100 docs\n var maxDocs = Math.min(series.datapoints.length, 100);\n for (var y = 0; y < maxDocs; y++) {\n var doc = series.datapoints[y];\n var flattened = flatten(doc, null);\n for (var propName in flattened) {\n names[propName] = true;\n }\n }\n }\n\n return _.map(names, function(value, key) {\n return { text: key, value: key };\n });\n },\n transform: function(data, panel, model) {\n var i, y, z;\n\n for (let column of panel.columns) {\n var tableCol: any = { text: column.text };\n\n // if filterable data then set columns to filterable\n if (data.length > 0 && data[0].filterable) {\n tableCol.filterable = true;\n }\n\n model.columns.push(tableCol);\n }\n\n if (model.columns.length === 0) {\n model.columns.push({ text: 'JSON' });\n }\n\n for (i = 0; i < data.length; i++) {\n var series = data[i];\n\n for (y = 0; y < series.datapoints.length; y++) {\n var dp = series.datapoints[y];\n var values = [];\n\n if (_.isObject(dp) && panel.columns.length > 0) {\n var flattened = flatten(dp, null);\n for (z = 0; z < panel.columns.length; z++) {\n values.push(flattened[panel.columns[z].value]);\n }\n } else {\n values.push(JSON.stringify(dp));\n }\n\n model.rows.push(values);\n }\n }\n },\n};\n\nfunction transformDataToTable(data, panel) {\n var model = new TableModel();\n\n if (!data || data.length === 0) {\n return model;\n }\n\n var transformer = transformers[panel.transform];\n if (!transformer) {\n throw { message: 'Transformer ' + panel.transform + ' not found' };\n }\n\n transformer.transform(data, panel, model);\n return model;\n}\n\nexport { transformers, transformDataToTable };\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/table/transformers.ts","\"use strict\";\nexports.isArrayLike = (function (x) { return x && typeof x.length === 'number'; });\n//# sourceMappingURL=isArrayLike.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/util/isArrayLike.js\n// module id = 2015\n// module chunks = 0","\"use strict\";\nfunction isPromise(value) {\n return value && typeof value.subscribe !== 'function' && typeof value.then === 'function';\n}\nexports.isPromise = isPromise;\n//# sourceMappingURL=isPromise.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/util/isPromise.js\n// module id = 2016\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Observable_1 = require('../Observable');\nvar ScalarObservable_1 = require('./ScalarObservable');\nvar EmptyObservable_1 = require('./EmptyObservable');\nvar isScheduler_1 = require('../util/isScheduler');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar ArrayObservable = (function (_super) {\n __extends(ArrayObservable, _super);\n function ArrayObservable(array, scheduler) {\n _super.call(this);\n this.array = array;\n this.scheduler = scheduler;\n if (!scheduler && array.length === 1) {\n this._isScalar = true;\n this.value = array[0];\n }\n }\n ArrayObservable.create = function (array, scheduler) {\n return new ArrayObservable(array, scheduler);\n };\n /**\n * Creates an Observable that emits some values you specify as arguments,\n * immediately one after the other, and then emits a complete notification.\n *\n * Emits the arguments you provide, then completes.\n * \n *\n * \n *\n * This static operator is useful for creating a simple Observable that only\n * emits the arguments given, and the complete notification thereafter. It can\n * be used for composing with other Observables, such as with {@link concat}.\n * By default, it uses a `null` IScheduler, which means the `next`\n * notifications are sent synchronously, although with a different IScheduler\n * it is possible to determine when those notifications will be delivered.\n *\n * @example Emit 10, 20, 30, then 'a', 'b', 'c', then start ticking every second.\n * var numbers = Rx.Observable.of(10, 20, 30);\n * var letters = Rx.Observable.of('a', 'b', 'c');\n * var interval = Rx.Observable.interval(1000);\n * var result = numbers.concat(letters).concat(interval);\n * result.subscribe(x => console.log(x));\n *\n * @see {@link create}\n * @see {@link empty}\n * @see {@link never}\n * @see {@link throw}\n *\n * @param {...T} values Arguments that represent `next` values to be emitted.\n * @param {Scheduler} [scheduler] A {@link IScheduler} to use for scheduling\n * the emissions of the `next` notifications.\n * @return {Observable} An Observable that emits each given input value.\n * @static true\n * @name of\n * @owner Observable\n */\n ArrayObservable.of = function () {\n var array = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n array[_i - 0] = arguments[_i];\n }\n var scheduler = array[array.length - 1];\n if (isScheduler_1.isScheduler(scheduler)) {\n array.pop();\n }\n else {\n scheduler = null;\n }\n var len = array.length;\n if (len > 1) {\n return new ArrayObservable(array, scheduler);\n }\n else if (len === 1) {\n return new ScalarObservable_1.ScalarObservable(array[0], scheduler);\n }\n else {\n return new EmptyObservable_1.EmptyObservable(scheduler);\n }\n };\n ArrayObservable.dispatch = function (state) {\n var array = state.array, index = state.index, count = state.count, subscriber = state.subscriber;\n if (index >= count) {\n subscriber.complete();\n return;\n }\n subscriber.next(array[index]);\n if (subscriber.closed) {\n return;\n }\n state.index = index + 1;\n this.schedule(state);\n };\n /** @deprecated internal use only */ ArrayObservable.prototype._subscribe = function (subscriber) {\n var index = 0;\n var array = this.array;\n var count = array.length;\n var scheduler = this.scheduler;\n if (scheduler) {\n return scheduler.schedule(ArrayObservable.dispatch, 0, {\n array: array, index: index, count: count, subscriber: subscriber\n });\n }\n else {\n for (var i = 0; i < count && !subscriber.closed; i++) {\n subscriber.next(array[i]);\n }\n subscriber.complete();\n }\n };\n return ArrayObservable;\n}(Observable_1.Observable));\nexports.ArrayObservable = ArrayObservable;\n//# sourceMappingURL=ArrayObservable.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/observable/ArrayObservable.js\n// module id = 2017\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Observable_1 = require('../Observable');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar ScalarObservable = (function (_super) {\n __extends(ScalarObservable, _super);\n function ScalarObservable(value, scheduler) {\n _super.call(this);\n this.value = value;\n this.scheduler = scheduler;\n this._isScalar = true;\n if (scheduler) {\n this._isScalar = false;\n }\n }\n ScalarObservable.create = function (value, scheduler) {\n return new ScalarObservable(value, scheduler);\n };\n ScalarObservable.dispatch = function (state) {\n var done = state.done, value = state.value, subscriber = state.subscriber;\n if (done) {\n subscriber.complete();\n return;\n }\n subscriber.next(value);\n if (subscriber.closed) {\n return;\n }\n state.done = true;\n this.schedule(state);\n };\n /** @deprecated internal use only */ ScalarObservable.prototype._subscribe = function (subscriber) {\n var value = this.value;\n var scheduler = this.scheduler;\n if (scheduler) {\n return scheduler.schedule(ScalarObservable.dispatch, 0, {\n done: false, value: value, subscriber: subscriber\n });\n }\n else {\n subscriber.next(value);\n if (!subscriber.closed) {\n subscriber.complete();\n }\n }\n };\n return ScalarObservable;\n}(Observable_1.Observable));\nexports.ScalarObservable = ScalarObservable;\n//# sourceMappingURL=ScalarObservable.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/observable/ScalarObservable.js\n// module id = 2018\n// module chunks = 0","export class FolderPageLoader {\n constructor(private backendSrv) {}\n\n load(ctrl, uid, activeChildId) {\n ctrl.navModel = {\n main: {\n icon: 'fa fa-folder-open',\n id: 'manage-folder',\n subTitle: 'Manage folder dashboards & permissions',\n url: '',\n text: '',\n breadcrumbs: [{ title: 'Dashboards', url: 'dashboards' }],\n children: [\n {\n active: activeChildId === 'manage-folder-dashboards',\n icon: 'fa fa-fw fa-th-large',\n id: 'manage-folder-dashboards',\n text: 'Dashboards',\n url: 'dashboards',\n },\n {\n active: activeChildId === 'manage-folder-permissions',\n icon: 'fa fa-fw fa-lock',\n id: 'manage-folder-permissions',\n text: 'Permissions',\n url: 'dashboards/permissions',\n },\n {\n active: activeChildId === 'manage-folder-settings',\n icon: 'fa fa-fw fa-cog',\n id: 'manage-folder-settings',\n text: 'Settings',\n url: 'dashboards/settings',\n },\n ],\n },\n };\n\n return this.backendSrv.getFolderByUid(uid).then(folder => {\n ctrl.folderId = folder.id;\n const folderTitle = folder.title;\n const folderUrl = folder.url;\n ctrl.navModel.main.text = folderTitle;\n\n const dashTab = ctrl.navModel.main.children.find(child => child.id === 'manage-folder-dashboards');\n dashTab.url = folderUrl;\n\n if (folder.canAdmin) {\n const permTab = ctrl.navModel.main.children.find(child => child.id === 'manage-folder-permissions');\n permTab.url = folderUrl + '/permissions';\n\n const settingsTab = ctrl.navModel.main.children.find(child => child.id === 'manage-folder-settings');\n settingsTab.url = folderUrl + '/settings';\n } else {\n ctrl.navModel.main.children = [dashTab];\n }\n\n return folder;\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/folder_page_loader.ts","import config from 'app/core/config';\nimport coreModule from 'app/core/core_module';\nimport Remarkable from 'remarkable';\nimport _ from 'lodash';\n\nexport class OrgUsersCtrl {\n unfiltered: any;\n users: any;\n pendingInvites: any;\n editor: any;\n navModel: any;\n externalUserMngLinkUrl: string;\n externalUserMngLinkName: string;\n externalUserMngInfo: string;\n canInvite: boolean;\n searchQuery: string;\n showInvites: boolean;\n\n /** @ngInject */\n constructor(private $scope, private backendSrv, navModelSrv, $sce) {\n this.navModel = navModelSrv.getNav('cfg', 'users', 0);\n\n this.get();\n this.externalUserMngLinkUrl = config.externalUserMngLinkUrl;\n this.externalUserMngLinkName = config.externalUserMngLinkName;\n this.canInvite = !config.disableLoginForm && !config.externalUserMngLinkName;\n\n // render external user management info markdown\n if (config.externalUserMngInfo) {\n this.externalUserMngInfo = new Remarkable({\n linkTarget: '__blank',\n }).render(config.externalUserMngInfo);\n }\n }\n\n get() {\n this.backendSrv.get('/api/org/users').then(users => {\n this.users = users;\n this.unfiltered = users;\n });\n this.backendSrv.get('/api/org/invites').then(pendingInvites => {\n this.pendingInvites = pendingInvites;\n });\n }\n\n onQueryUpdated() {\n let regex = new RegExp(this.searchQuery, 'ig');\n this.users = _.filter(this.unfiltered, item => {\n return regex.test(item.email) || regex.test(item.login);\n });\n }\n\n updateOrgUser(user) {\n this.backendSrv.patch('/api/org/users/' + user.userId, user);\n }\n\n removeUser(user) {\n this.$scope.appEvent('confirm-modal', {\n title: 'Delete',\n text: 'Are you sure you want to delete user ' + user.login + '?',\n yesText: 'Delete',\n icon: 'fa-warning',\n onConfirm: () => {\n this.removeUserConfirmed(user);\n },\n });\n }\n\n removeUserConfirmed(user) {\n this.backendSrv.delete('/api/org/users/' + user.userId).then(this.get.bind(this));\n }\n\n revokeInvite(invite, evt) {\n evt.stopPropagation();\n this.backendSrv.patch('/api/org/invites/' + invite.code + '/revoke').then(this.get.bind(this));\n }\n\n copyInviteToClipboard(evt) {\n evt.stopPropagation();\n }\n\n getInviteUrl(invite) {\n return invite.url;\n }\n}\n\ncoreModule.controller('OrgUsersCtrl', OrgUsersCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/org/org_users_ctrl.ts","import angular from 'angular';\nimport _ from 'lodash';\nimport './link_srv';\n\nfunction panelLinksEditor() {\n return {\n scope: {\n panel: '=',\n },\n restrict: 'E',\n controller: 'PanelLinksEditorCtrl',\n templateUrl: 'public/app/features/panellinks/module.html',\n link: function() {},\n };\n}\n\nexport class PanelLinksEditorCtrl {\n /** @ngInject */\n constructor($scope, backendSrv) {\n $scope.panel.links = $scope.panel.links || [];\n\n $scope.addLink = function() {\n $scope.panel.links.push({\n type: 'dashboard',\n });\n };\n\n $scope.searchDashboards = function(queryStr, callback) {\n backendSrv.search({ query: queryStr }).then(function(hits) {\n var dashboards = _.map(hits, function(dash) {\n return dash.title;\n });\n\n callback(dashboards);\n });\n };\n\n $scope.dashboardChanged = function(link) {\n backendSrv.search({ query: link.dashboard }).then(function(hits) {\n var dashboard = _.find(hits, { title: link.dashboard });\n if (dashboard) {\n link.dashUri = dashboard.uri;\n link.title = dashboard.title;\n }\n });\n };\n\n $scope.deleteLink = function(link) {\n $scope.panel.links = _.without($scope.panel.links, link);\n };\n }\n}\n\nangular\n .module('grafana.directives')\n .directive('panelLinksEditor', panelLinksEditor)\n .controller('PanelLinksEditorCtrl', PanelLinksEditorCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/panellinks/module.ts","import angular from 'angular';\nimport _ from 'lodash';\nimport { iconMap } from './editor';\n\nfunction dashLinksContainer() {\n return {\n scope: {\n links: '=',\n },\n restrict: 'E',\n controller: 'DashLinksContainerCtrl',\n template: '',\n link: function() {},\n };\n}\n\n/** @ngInject */\nfunction dashLink($compile, $sanitize, linkSrv) {\n return {\n restrict: 'E',\n link: function(scope, elem) {\n var link = scope.link;\n var template =\n '
    ' +\n '' +\n ' ';\n\n if (link.asDropdown) {\n template +=\n '';\n }\n\n template += '
    ';\n\n elem.html(template);\n $compile(elem.contents())(scope);\n\n var anchor = elem.find('a');\n var icon = elem.find('i');\n var span = elem.find('span');\n\n function update() {\n var linkInfo = linkSrv.getAnchorInfo(link);\n span.text(linkInfo.title);\n if (!link.asDropdown) {\n anchor.attr('href', linkInfo.href);\n sanitizeAnchor();\n }\n elem.find('a').attr('data-placement', 'bottom');\n // tooltip\n elem.find('a').tooltip({\n title: $sanitize(scope.link.tooltip),\n html: true,\n container: 'body',\n });\n }\n\n function sanitizeAnchor() {\n const anchorSanitized = $sanitize(anchor.parent().html());\n anchor.parent().html(anchorSanitized);\n }\n\n icon.attr('class', 'fa fa-fw ' + scope.link.icon);\n anchor.attr('target', scope.link.target);\n\n // fix for menus on the far right\n if (link.asDropdown && scope.$last) {\n elem.find('.dropdown-menu').addClass('pull-right');\n }\n\n update();\n scope.$on('refresh', update);\n },\n };\n}\n\nexport class DashLinksContainerCtrl {\n /** @ngInject */\n constructor($scope, $rootScope, $q, backendSrv, dashboardSrv, linkSrv) {\n var currentDashId = dashboardSrv.getCurrent().id;\n\n function buildLinks(linkDef) {\n if (linkDef.type === 'dashboards') {\n if (!linkDef.tags) {\n console.log('Dashboard link missing tag');\n return $q.when([]);\n }\n\n if (linkDef.asDropdown) {\n return $q.when([\n {\n title: linkDef.title,\n tags: linkDef.tags,\n keepTime: linkDef.keepTime,\n includeVars: linkDef.includeVars,\n target: linkDef.targetBlank ? '_blank' : '_self',\n icon: 'fa fa-bars',\n asDropdown: true,\n },\n ]);\n }\n\n return $scope.searchDashboards(linkDef, 7);\n }\n\n if (linkDef.type === 'link') {\n return $q.when([\n {\n url: linkDef.url,\n title: linkDef.title,\n icon: iconMap[linkDef.icon],\n tooltip: linkDef.tooltip,\n target: linkDef.targetBlank ? '_blank' : '_self',\n keepTime: linkDef.keepTime,\n includeVars: linkDef.includeVars,\n },\n ]);\n }\n\n return $q.when([]);\n }\n\n function updateDashLinks() {\n var promises = _.map($scope.links, buildLinks);\n\n $q.all(promises).then(function(results) {\n $scope.generatedLinks = _.flatten(results);\n });\n }\n\n $scope.searchDashboards = function(link, limit) {\n return backendSrv.search({ tag: link.tags, limit: limit }).then(function(results) {\n return _.reduce(\n results,\n function(memo, dash) {\n // do not add current dashboard\n if (dash.id !== currentDashId) {\n memo.push({\n title: dash.title,\n url: 'dashboard/' + dash.uri,\n target: link.target,\n icon: 'fa fa-th-large',\n keepTime: link.keepTime,\n includeVars: link.includeVars,\n });\n }\n return memo;\n },\n []\n );\n });\n };\n\n $scope.fillDropdown = function(link) {\n $scope.searchDashboards(link, 100).then(function(results) {\n _.each(results, function(hit) {\n hit.url = linkSrv.getLinkUrl(hit);\n });\n link.searchHits = results;\n });\n };\n\n updateDashLinks();\n $rootScope.onAppEvent('dash-links-updated', updateDashLinks, $scope);\n }\n}\n\nangular.module('grafana.directives').directive('dashLinksContainer', dashLinksContainer);\nangular.module('grafana.directives').directive('dashLink', dashLink);\nangular.module('grafana.directives').controller('DashLinksContainerCtrl', DashLinksContainerCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashlinks/module.ts","import angular from 'angular';\nimport _ from 'lodash';\n\nexport var iconMap = {\n 'external link': 'fa-external-link',\n dashboard: 'fa-th-large',\n question: 'fa-question',\n info: 'fa-info',\n bolt: 'fa-bolt',\n doc: 'fa-file-text-o',\n cloud: 'fa-cloud',\n};\n\nexport class DashLinkEditorCtrl {\n dashboard: any;\n iconMap: any;\n mode: any;\n link: any;\n\n /** @ngInject */\n constructor($scope, $rootScope) {\n this.iconMap = iconMap;\n this.dashboard.links = this.dashboard.links || [];\n this.mode = 'list';\n\n $scope.$on('$destroy', () => {\n $rootScope.appEvent('dash-links-updated');\n });\n }\n\n backToList() {\n this.mode = 'list';\n }\n\n setupNew() {\n this.mode = 'new';\n this.link = { type: 'dashboards', icon: 'external link' };\n }\n\n addLink() {\n this.dashboard.links.push(this.link);\n this.mode = 'list';\n }\n\n editLink(link) {\n this.link = link;\n this.mode = 'edit';\n console.log(this.link);\n }\n\n saveLink() {\n this.backToList();\n }\n\n moveLink(index, dir) {\n _.move(this.dashboard.links, index, index + dir);\n }\n\n deleteLink(index) {\n this.dashboard.links.splice(index, 1);\n this.dashboard.updateSubmenuVisibility();\n }\n}\n\nfunction dashLinksEditor() {\n return {\n restrict: 'E',\n controller: DashLinkEditorCtrl,\n templateUrl: 'public/app/features/dashlinks/editor.html',\n bindToController: true,\n controllerAs: 'ctrl',\n scope: {\n dashboard: '=',\n },\n };\n}\n\nangular.module('grafana.directives').directive('dashLinksEditor', dashLinksEditor);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashlinks/editor.ts","import './editor_ctrl';\n\nimport angular from 'angular';\nimport _ from 'lodash';\nimport coreModule from 'app/core/core_module';\nimport { makeRegions, dedupAnnotations } from './events_processing';\n\nexport class AnnotationsSrv {\n globalAnnotationsPromise: any;\n alertStatesPromise: any;\n\n /** @ngInject */\n constructor(private $rootScope, private $q, private datasourceSrv, private backendSrv, private timeSrv) {\n $rootScope.onAppEvent('refresh', this.clearCache.bind(this), $rootScope);\n $rootScope.onAppEvent('dashboard-initialized', this.clearCache.bind(this), $rootScope);\n }\n\n clearCache() {\n this.globalAnnotationsPromise = null;\n this.alertStatesPromise = null;\n }\n\n getAnnotations(options) {\n return this.$q\n .all([this.getGlobalAnnotations(options), this.getAlertStates(options)])\n .then(results => {\n // combine the annotations and flatten results\n var annotations = _.flattenDeep(results[0]);\n\n // filter out annotations that do not belong to requesting panel\n annotations = _.filter(annotations, item => {\n // if event has panel id and query is of type dashboard then panel and requesting panel id must match\n if (item.panelId && item.source.type === 'dashboard') {\n return item.panelId === options.panel.id;\n }\n return true;\n });\n\n annotations = dedupAnnotations(annotations);\n annotations = makeRegions(annotations, options);\n\n // look for alert state for this panel\n var alertState = _.find(results[1], { panelId: options.panel.id });\n\n return {\n annotations: annotations,\n alertState: alertState,\n };\n })\n .catch(err => {\n if (!err.message && err.data && err.data.message) {\n err.message = err.data.message;\n }\n console.log('AnnotationSrv.query error', err);\n this.$rootScope.appEvent('alert-error', ['Annotation Query Failed', err.message || err]);\n return [];\n });\n }\n\n getAlertStates(options) {\n if (!options.dashboard.id) {\n return this.$q.when([]);\n }\n\n // ignore if no alerts\n if (options.panel && !options.panel.alert) {\n return this.$q.when([]);\n }\n\n if (options.range.raw.to !== 'now') {\n return this.$q.when([]);\n }\n\n if (this.alertStatesPromise) {\n return this.alertStatesPromise;\n }\n\n this.alertStatesPromise = this.backendSrv.get('/api/alerts/states-for-dashboard', {\n dashboardId: options.dashboard.id,\n });\n return this.alertStatesPromise;\n }\n\n getGlobalAnnotations(options) {\n var dashboard = options.dashboard;\n\n if (this.globalAnnotationsPromise) {\n return this.globalAnnotationsPromise;\n }\n\n var range = this.timeSrv.timeRange();\n var promises = [];\n\n for (let annotation of dashboard.annotations.list) {\n if (!annotation.enable) {\n continue;\n }\n\n if (annotation.snapshotData) {\n return this.translateQueryResult(annotation, annotation.snapshotData);\n }\n\n promises.push(\n this.datasourceSrv\n .get(annotation.datasource)\n .then(datasource => {\n // issue query against data source\n return datasource.annotationQuery({\n range: range,\n rangeRaw: range.raw,\n annotation: annotation,\n dashboard: dashboard,\n });\n })\n .then(results => {\n // store response in annotation object if this is a snapshot call\n if (dashboard.snapshot) {\n annotation.snapshotData = angular.copy(results);\n }\n // translate result\n return this.translateQueryResult(annotation, results);\n })\n );\n }\n\n this.globalAnnotationsPromise = this.$q.all(promises);\n return this.globalAnnotationsPromise;\n }\n\n saveAnnotationEvent(annotation) {\n this.globalAnnotationsPromise = null;\n return this.backendSrv.post('/api/annotations', annotation);\n }\n\n updateAnnotationEvent(annotation) {\n this.globalAnnotationsPromise = null;\n return this.backendSrv.put(`/api/annotations/${annotation.id}`, annotation);\n }\n\n deleteAnnotationEvent(annotation) {\n this.globalAnnotationsPromise = null;\n let deleteUrl = `/api/annotations/${annotation.id}`;\n if (annotation.isRegion) {\n deleteUrl = `/api/annotations/region/${annotation.regionId}`;\n }\n\n return this.backendSrv.delete(deleteUrl);\n }\n\n translateQueryResult(annotation, results) {\n // if annotation has snapshotData\n // make clone and remove it\n if (annotation.snapshotData) {\n annotation = angular.copy(annotation);\n delete annotation.snapshotData;\n }\n\n for (var item of results) {\n item.source = annotation;\n }\n return results;\n }\n}\n\ncoreModule.service('annotationsSrv', AnnotationsSrv);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/annotations/annotations_srv.ts","import angular from 'angular';\nimport _ from 'lodash';\nimport $ from 'jquery';\nimport coreModule from 'app/core/core_module';\n\nexport class AnnotationsEditorCtrl {\n mode: any;\n datasources: any;\n annotations: any;\n currentAnnotation: any;\n currentDatasource: any;\n currentIsNew: any;\n\n annotationDefaults: any = {\n name: '',\n datasource: null,\n iconColor: 'rgba(255, 96, 96, 1)',\n enable: true,\n showIn: 0,\n hide: false,\n };\n\n showOptions: any = [{ text: 'All Panels', value: 0 }, { text: 'Specific Panels', value: 1 }];\n\n /** @ngInject */\n constructor($scope, private datasourceSrv) {\n $scope.ctrl = this;\n\n this.mode = 'list';\n this.datasources = datasourceSrv.getAnnotationSources();\n this.annotations = $scope.dashboard.annotations.list;\n this.reset();\n\n this.onColorChange = this.onColorChange.bind(this);\n }\n\n datasourceChanged() {\n return this.datasourceSrv.get(this.currentAnnotation.datasource).then(ds => {\n this.currentDatasource = ds;\n });\n }\n\n edit(annotation) {\n this.currentAnnotation = annotation;\n this.currentAnnotation.showIn = this.currentAnnotation.showIn || 0;\n this.currentIsNew = false;\n this.datasourceChanged();\n this.mode = 'edit';\n $('.tooltip.in').remove();\n }\n\n reset() {\n this.currentAnnotation = angular.copy(this.annotationDefaults);\n this.currentAnnotation.datasource = this.datasources[0].name;\n this.currentIsNew = true;\n this.datasourceChanged();\n }\n\n update() {\n this.reset();\n this.mode = 'list';\n }\n\n setupNew() {\n this.mode = 'new';\n this.reset();\n }\n\n backToList() {\n this.mode = 'list';\n }\n\n move(index, dir) {\n _.move(this.annotations, index, index + dir);\n }\n\n add() {\n this.annotations.push(this.currentAnnotation);\n this.reset();\n this.mode = 'list';\n }\n\n removeAnnotation(annotation) {\n var index = _.indexOf(this.annotations, annotation);\n this.annotations.splice(index, 1);\n }\n\n onColorChange(newColor) {\n this.currentAnnotation.iconColor = newColor;\n }\n}\n\ncoreModule.controller('AnnotationsEditorCtrl', AnnotationsEditorCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/annotations/editor_ctrl.ts","import _ from 'lodash';\n\n/**\n * This function converts annotation events into set\n * of single events and regions (event consist of two)\n * @param annotations\n * @param options\n */\nexport function makeRegions(annotations, options) {\n let [regionEvents, singleEvents] = _.partition(annotations, 'regionId');\n let regions = getRegions(regionEvents, options.range);\n annotations = _.concat(regions, singleEvents);\n return annotations;\n}\n\nfunction getRegions(events, range) {\n let region_events = _.filter(events, event => {\n return event.regionId;\n });\n let regions = _.groupBy(region_events, 'regionId');\n regions = _.compact(\n _.map(regions, region_events => {\n let region_obj = _.head(region_events);\n if (region_events && region_events.length > 1) {\n region_obj.timeEnd = region_events[1].time;\n region_obj.isRegion = true;\n return region_obj;\n } else {\n if (region_events && region_events.length) {\n // Don't change proper region object\n if (!region_obj.time || !region_obj.timeEnd) {\n // This is cut region\n if (isStartOfRegion(region_obj)) {\n region_obj.timeEnd = range.to.valueOf() - 1;\n } else {\n // Start time = null\n region_obj.timeEnd = region_obj.time;\n region_obj.time = range.from.valueOf() + 1;\n }\n region_obj.isRegion = true;\n }\n\n return region_obj;\n }\n }\n })\n );\n\n return regions;\n}\n\nfunction isStartOfRegion(event): boolean {\n return event.id && event.id === event.regionId;\n}\n\nexport function dedupAnnotations(annotations) {\n let dedup = [];\n\n // Split events by annotationId property existence\n let events = _.partition(annotations, 'id');\n\n let eventsById = _.groupBy(events[0], 'id');\n dedup = _.map(eventsById, eventGroup => {\n if (eventGroup.length > 1 && !_.every(eventGroup, isPanelAlert)) {\n // Get first non-panel alert\n return _.find(eventGroup, event => {\n return event.eventType !== 'panel-alert';\n });\n } else {\n return _.head(eventGroup);\n }\n });\n\n dedup = _.concat(dedup, events[1]);\n return dedup;\n}\n\nfunction isPanelAlert(event) {\n return event.eventType === 'panel-alert';\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/annotations/events_processing.ts","import _ from 'lodash';\nimport moment from 'moment';\nimport { coreModule } from 'app/core/core';\nimport { MetricsPanelCtrl } from 'app/plugins/sdk';\nimport { AnnotationEvent } from './event';\n\nexport class EventEditorCtrl {\n panelCtrl: MetricsPanelCtrl;\n event: AnnotationEvent;\n timeRange: { from: number; to: number };\n form: any;\n close: any;\n timeFormated: string;\n\n /** @ngInject **/\n constructor(private annotationsSrv) {\n this.event.panelId = this.panelCtrl.panel.id;\n this.event.dashboardId = this.panelCtrl.dashboard.id;\n\n // Annotations query returns time as Unix timestamp in milliseconds\n this.event.time = tryEpochToMoment(this.event.time);\n if (this.event.isRegion) {\n this.event.timeEnd = tryEpochToMoment(this.event.timeEnd);\n }\n\n this.timeFormated = this.panelCtrl.dashboard.formatDate(this.event.time);\n }\n\n save() {\n if (!this.form.$valid) {\n return;\n }\n\n let saveModel = _.cloneDeep(this.event);\n saveModel.time = saveModel.time.valueOf();\n saveModel.timeEnd = 0;\n\n if (saveModel.isRegion) {\n saveModel.timeEnd = this.event.timeEnd.valueOf();\n\n if (saveModel.timeEnd < saveModel.time) {\n console.log('invalid time');\n return;\n }\n }\n\n if (saveModel.id) {\n this.annotationsSrv\n .updateAnnotationEvent(saveModel)\n .then(() => {\n this.panelCtrl.refresh();\n this.close();\n })\n .catch(() => {\n this.panelCtrl.refresh();\n this.close();\n });\n } else {\n this.annotationsSrv\n .saveAnnotationEvent(saveModel)\n .then(() => {\n this.panelCtrl.refresh();\n this.close();\n })\n .catch(() => {\n this.panelCtrl.refresh();\n this.close();\n });\n }\n }\n\n delete() {\n return this.annotationsSrv\n .deleteAnnotationEvent(this.event)\n .then(() => {\n this.panelCtrl.refresh();\n this.close();\n })\n .catch(() => {\n this.panelCtrl.refresh();\n this.close();\n });\n }\n}\n\nfunction tryEpochToMoment(timestamp) {\n if (timestamp && _.isNumber(timestamp)) {\n let epoch = Number(timestamp);\n return moment(epoch);\n } else {\n return timestamp;\n }\n}\n\nexport function eventEditor() {\n return {\n restrict: 'E',\n controller: EventEditorCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n templateUrl: 'public/app/features/annotations/partials/event_editor.html',\n scope: {\n panelCtrl: '=',\n event: '=',\n close: '&',\n },\n };\n}\n\ncoreModule.directive('eventEditor', eventEditor);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/annotations/event_editor.ts","import _ from 'lodash';\nimport moment from 'moment';\nimport tinycolor from 'tinycolor2';\nimport { MetricsPanelCtrl } from 'app/plugins/sdk';\nimport { AnnotationEvent } from './event';\nimport {\n OK_COLOR,\n ALERTING_COLOR,\n NO_DATA_COLOR,\n DEFAULT_ANNOTATION_COLOR,\n REGION_FILL_ALPHA,\n} from 'app/core/utils/colors';\n\nexport class EventManager {\n event: AnnotationEvent;\n editorOpen: boolean;\n\n constructor(private panelCtrl: MetricsPanelCtrl) {}\n\n editorClosed() {\n this.event = null;\n this.editorOpen = false;\n this.panelCtrl.render();\n }\n\n editorOpened() {\n this.editorOpen = true;\n }\n\n updateTime(range) {\n if (!this.event) {\n this.event = new AnnotationEvent();\n this.event.dashboardId = this.panelCtrl.dashboard.id;\n this.event.panelId = this.panelCtrl.panel.id;\n }\n\n // update time\n this.event.time = moment(range.from);\n this.event.isRegion = false;\n if (range.to) {\n this.event.timeEnd = moment(range.to);\n this.event.isRegion = true;\n }\n\n this.panelCtrl.render();\n }\n\n editEvent(event, elem?) {\n this.event = event;\n this.panelCtrl.render();\n }\n\n addFlotEvents(annotations, flotOptions) {\n if (!this.event && annotations.length === 0) {\n return;\n }\n\n var types = {\n $__alerting: {\n color: ALERTING_COLOR,\n position: 'BOTTOM',\n markerSize: 5,\n },\n $__ok: {\n color: OK_COLOR,\n position: 'BOTTOM',\n markerSize: 5,\n },\n $__no_data: {\n color: NO_DATA_COLOR,\n position: 'BOTTOM',\n markerSize: 5,\n },\n $__editing: {\n color: DEFAULT_ANNOTATION_COLOR,\n position: 'BOTTOM',\n markerSize: 5,\n },\n };\n\n if (this.event) {\n if (this.event.isRegion) {\n annotations = [\n {\n isRegion: true,\n min: this.event.time.valueOf(),\n timeEnd: this.event.timeEnd.valueOf(),\n text: this.event.text,\n eventType: '$__editing',\n editModel: this.event,\n },\n ];\n } else {\n annotations = [\n {\n min: this.event.time.valueOf(),\n text: this.event.text,\n editModel: this.event,\n eventType: '$__editing',\n },\n ];\n }\n } else {\n // annotations from query\n for (var i = 0; i < annotations.length; i++) {\n var item = annotations[i];\n\n // add properties used by jquery flot events\n item.min = item.time;\n item.max = item.time;\n item.eventType = item.source.name;\n\n if (item.newState) {\n item.eventType = '$__' + item.newState;\n continue;\n }\n\n if (!types[item.source.name]) {\n types[item.source.name] = {\n color: item.source.iconColor,\n position: 'BOTTOM',\n markerSize: 5,\n };\n }\n }\n }\n\n let regions = getRegions(annotations);\n addRegionMarking(regions, flotOptions);\n\n let eventSectionHeight = 20;\n let eventSectionMargin = 7;\n flotOptions.grid.eventSectionHeight = eventSectionMargin;\n flotOptions.xaxis.eventSectionHeight = eventSectionHeight;\n\n flotOptions.events = {\n levels: _.keys(types).length + 1,\n data: annotations,\n types: types,\n manager: this,\n };\n }\n}\n\nfunction getRegions(events) {\n return _.filter(events, 'isRegion');\n}\n\nfunction addRegionMarking(regions, flotOptions) {\n let markings = flotOptions.grid.markings;\n let defaultColor = DEFAULT_ANNOTATION_COLOR;\n let fillColor;\n\n _.each(regions, region => {\n if (region.source) {\n fillColor = region.source.iconColor || defaultColor;\n } else {\n fillColor = defaultColor;\n }\n\n fillColor = addAlphaToRGB(fillColor, REGION_FILL_ALPHA);\n markings.push({\n xaxis: { from: region.min, to: region.timeEnd },\n color: fillColor,\n });\n });\n}\n\nfunction addAlphaToRGB(colorString: string, alpha: number): string {\n let color = tinycolor(colorString);\n if (color.isValid()) {\n color.setAlpha(alpha);\n return color.toRgbString();\n } else {\n return colorString;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/annotations/event_manager.ts","import _ from 'lodash';\nimport $ from 'jquery';\nimport coreModule from 'app/core/core_module';\nimport alertDef from '../alerting/alert_def';\n\n/** @ngInject **/\nexport function annotationTooltipDirective($sanitize, dashboardSrv, contextSrv, $compile) {\n function sanitizeString(str) {\n try {\n return $sanitize(str);\n } catch (err) {\n console.log('Could not sanitize annotation string, html escaping instead');\n return _.escape(str);\n }\n }\n\n function formatTZeroTime(time) {\n var t_zero_prefix = time === 0 ? 'T=' : time < 0 ? 'T-' : 'T+';\n return t_zero_prefix + time / 1000;\n }\n\n return {\n restrict: 'E',\n scope: {\n event: '=',\n events: '=',\n plot: '=',\n onEdit: '&',\n },\n link: function(scope, element) {\n var event = scope.event;\n var events = scope.events;\n var plot = scope.plot;\n var title = event.title;\n var text = event.text;\n var dashboard = dashboardSrv.getCurrent();\n\n var tooltip = '
    ';\n var titleStateClass = '';\n\n if (event.alertId) {\n var stateModel = alertDef.getStateDisplayModel(event.newState);\n titleStateClass = stateModel.stateClass;\n title = ` ${stateModel.text}`;\n text = alertDef.getAlertAnnotationInfo(event);\n if (event.text) {\n text = text + '
    ' + event.text;\n }\n } else if (title) {\n text = title + '
    ' + (_.isString(text) ? text : '');\n title = '';\n }\n\n /* Bundle events that are very close by */\n var xaxis = plot.getXAxes()[plot.getOptions().events.xaxis - 1];\n var currentEventX = xaxis.p2c(event.min);\n\n var eventBundle = events.filter(function(e) {\n var distance = Math.abs(xaxis.p2c(e.time) - currentEventX);\n return distance < 10;\n });\n\n var header = `
    `;\n\n if (event.login) {\n header += `
    `;\n\n var time = formatTZeroTime(event.min);\n header += `\n ${sanitizeString(title)}\n ${time}\n `;\n } else {\n header += `\n event\n `;\n }\n\n // Show edit icon only for users with at least Editor role\n if (event.id && dashboard.meta.canEdit) {\n header += `\n \n \n \n `;\n }\n\n header += `
    `;\n tooltip += header;\n tooltip += '
    ';\n\n if (text && eventBundle.length === 1) {\n tooltip += '
    ' + sanitizeString(text.replace(/\\n/g, '
    ')) + '
    ';\n }\n\n function getColor(tagText) {\n var colors = ['#757575', '#9B9B9B'];\n\n if (tagText.match('CLOSE') || tagText.match('SET_0')) {\n colors = ['#991F23', '#BF4549'];\n } else if (tagText.match('OPEN') || tagText.match('SET_')) {\n colors = ['#33AA6A', '#59D090'];\n } else if (tagText.match('CRUISE')) {\n colors = ['#0000FF', '#2626FF'];\n }\n return `background-color: ${colors[0]}; border-color: ${colors[1]}`;\n }\n\n var tags = [];\n $.each(eventBundle, function(index, e) {\n $.each(e.tags, function(index, tag) {\n tags.push({\n time: formatTZeroTime(e.time),\n color: getColor(tag),\n text: tag,\n });\n });\n });\n\n if (tags && tags.length) {\n scope.tags = tags;\n tooltip +=\n '' +\n '{{tag.text}} ' +\n '{{tag.time}}
    ' +\n '
    ';\n }\n\n tooltip += '
    ';\n tooltip += '
    ';\n\n var $tooltip = $(tooltip);\n $tooltip.appendTo(element);\n\n $compile(element.contents())(scope);\n },\n };\n}\n\ncoreModule.directive('annotationTooltip', annotationTooltipDirective);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/annotations/annotation_tooltip.ts","import './editor_ctrl';\nimport coreModule from 'app/core/core_module';\n\nimport templateSrv from './template_srv';\nimport { VariableSrv } from './variable_srv';\nimport { IntervalVariable } from './interval_variable';\nimport { QueryVariable } from './query_variable';\nimport { DatasourceVariable } from './datasource_variable';\nimport { CustomVariable } from './custom_variable';\nimport { ConstantVariable } from './constant_variable';\nimport { AdhocVariable } from './adhoc_variable';\n\ncoreModule.factory('templateSrv', function() {\n return templateSrv;\n});\n\nexport {\n VariableSrv,\n IntervalVariable,\n QueryVariable,\n DatasourceVariable,\n CustomVariable,\n ConstantVariable,\n AdhocVariable,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/templating/all.ts","import _ from 'lodash';\nimport coreModule from 'app/core/core_module';\nimport { variableTypes } from './variable';\nimport appEvents from 'app/core/app_events';\n\nexport class VariableEditorCtrl {\n /** @ngInject **/\n constructor($scope, datasourceSrv, variableSrv, templateSrv) {\n $scope.variableTypes = variableTypes;\n $scope.ctrl = {};\n $scope.namePattern = /^(?!__).*$/;\n $scope._ = _;\n $scope.optionsLimit = 20;\n\n $scope.refreshOptions = [\n { value: 0, text: 'Never' },\n { value: 1, text: 'On Dashboard Load' },\n { value: 2, text: 'On Time Range Change' },\n ];\n\n $scope.sortOptions = [\n { value: 0, text: 'Disabled' },\n { value: 1, text: 'Alphabetical (asc)' },\n { value: 2, text: 'Alphabetical (desc)' },\n { value: 3, text: 'Numerical (asc)' },\n { value: 4, text: 'Numerical (desc)' },\n { value: 5, text: 'Alphabetical (case-insensitive, asc)' },\n { value: 6, text: 'Alphabetical (case-insensitive, desc)' },\n ];\n\n $scope.hideOptions = [{ value: 0, text: '' }, { value: 1, text: 'Label' }, { value: 2, text: 'Variable' }];\n\n $scope.init = function() {\n $scope.mode = 'list';\n\n $scope.variables = variableSrv.variables;\n $scope.reset();\n\n $scope.$watch('mode', function(val) {\n if (val === 'new') {\n $scope.reset();\n }\n });\n };\n\n $scope.setMode = function(mode) {\n $scope.mode = mode;\n };\n\n $scope.add = function() {\n if ($scope.isValid()) {\n variableSrv.addVariable($scope.current);\n $scope.update();\n }\n };\n\n $scope.isValid = function() {\n if (!$scope.ctrl.form.$valid) {\n return false;\n }\n\n if (!$scope.current.name.match(/^\\w+$/)) {\n appEvents.emit('alert-warning', ['Validation', 'Only word and digit characters are allowed in variable names']);\n return false;\n }\n\n var sameName = _.find($scope.variables, { name: $scope.current.name });\n if (sameName && sameName !== $scope.current) {\n appEvents.emit('alert-warning', ['Validation', 'Variable with the same name already exists']);\n return false;\n }\n\n if (\n $scope.current.type === 'query' &&\n $scope.current.query.match(new RegExp('\\\\$' + $scope.current.name + '(/| |$)'))\n ) {\n appEvents.emit('alert-warning', [\n 'Validation',\n 'Query cannot contain a reference to itself. Variable: $' + $scope.current.name,\n ]);\n return false;\n }\n\n return true;\n };\n\n $scope.validate = function() {\n $scope.infoText = '';\n if ($scope.current.type === 'adhoc' && $scope.current.datasource !== null) {\n $scope.infoText = 'Adhoc filters are applied automatically to all queries that target this datasource';\n datasourceSrv.get($scope.current.datasource).then(ds => {\n if (!ds.getTagKeys) {\n $scope.infoText = 'This datasource does not support adhoc filters yet.';\n }\n });\n }\n };\n\n $scope.runQuery = function() {\n $scope.optionsLimit = 20;\n return variableSrv.updateOptions($scope.current).catch(err => {\n if (err.data && err.data.message) {\n err.message = err.data.message;\n }\n appEvents.emit('alert-error', ['Templating', 'Template variables could not be initialized: ' + err.message]);\n });\n };\n\n $scope.edit = function(variable) {\n $scope.current = variable;\n $scope.currentIsNew = false;\n $scope.mode = 'edit';\n $scope.validate();\n };\n\n $scope.duplicate = function(variable) {\n var clone = _.cloneDeep(variable.getSaveModel());\n $scope.current = variableSrv.createVariableFromModel(clone);\n $scope.current.name = 'copy_of_' + variable.name;\n variableSrv.addVariable($scope.current);\n };\n\n $scope.update = function() {\n if ($scope.isValid()) {\n $scope.runQuery().then(function() {\n $scope.reset();\n $scope.mode = 'list';\n templateSrv.updateTemplateData();\n });\n }\n };\n\n $scope.reset = function() {\n $scope.currentIsNew = true;\n $scope.current = variableSrv.createVariableFromModel({ type: 'query' });\n\n // this is done here in case a new data source type variable was added\n $scope.datasources = _.filter(datasourceSrv.getMetricSources(), function(ds) {\n return !ds.meta.mixed && ds.value !== null;\n });\n\n $scope.datasourceTypes = _($scope.datasources)\n .uniqBy('meta.id')\n .map(function(ds) {\n return { text: ds.meta.name, value: ds.meta.id };\n })\n .value();\n };\n\n $scope.typeChanged = function() {\n var old = $scope.current;\n $scope.current = variableSrv.createVariableFromModel({\n type: $scope.current.type,\n });\n $scope.current.name = old.name;\n $scope.current.hide = old.hide;\n $scope.current.label = old.label;\n\n var oldIndex = _.indexOf(this.variables, old);\n if (oldIndex !== -1) {\n this.variables[oldIndex] = $scope.current;\n }\n\n $scope.validate();\n };\n\n $scope.removeVariable = function(variable) {\n variableSrv.removeVariable(variable);\n };\n\n $scope.showMoreOptions = function() {\n $scope.optionsLimit += 20;\n };\n }\n}\n\ncoreModule.controller('VariableEditorCtrl', VariableEditorCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/templating/editor_ctrl.ts","import angular from 'angular';\nimport _ from 'lodash';\nimport coreModule from '../../core/core_module';\nimport { variableTypes } from './variable';\nimport * as builtinVariables from './builtin_variables';\n\nexport class VariableSrv {\n dashboard: any;\n variables: any;\n\n /** @ngInject */\n constructor(\n private $rootScope,\n private $q,\n private $location,\n private $injector,\n private templateSrv,\n private $routeParams\n ) {\n // update time variant variables\n $rootScope.$on('refresh', this.onDashboardRefresh.bind(this), $rootScope);\n $rootScope.$on('template-variable-value-updated', this.updateUrlParamsWithCurrentVariables.bind(this), $rootScope);\n }\n\n hasVariable(name) {\n return this.dashboard.templating.list.filter(t => t.name === name).length > 0;\n }\n\n init(dashboard) {\n this.dashboard = dashboard;\n\n if (!this.hasVariable('experiment_id')) {\n dashboard.templating.list.push(builtinVariables.experimentId);\n }\n\n if (!this.hasVariable('resolution') && !dashboard.meta.isSnapshot) {\n dashboard.templating.list.push(builtinVariables.resolution);\n }\n\n // Don't show res variable on snapshots\n if (this.hasVariable('resolution') && dashboard.meta.isSnapshot) {\n this.dashboard.templating.list = this.dashboard.templating.list.filter(t => t.name !== 'resolution');\n }\n\n // create working class models representing variables\n this.variables = dashboard.templating.list = dashboard.templating.list.map(this.createVariableFromModel.bind(this));\n this.templateSrv.init(this.variables);\n\n // init variables\n for (let variable of this.variables) {\n variable.initLock = this.$q.defer();\n }\n\n var queryParams = this.$location.search();\n return this.$q\n .all(\n this.variables.map(variable => {\n return this.processVariable(variable, queryParams);\n })\n )\n .then(() => {\n this.templateSrv.updateTemplateData();\n });\n }\n\n onDashboardRefresh() {\n var promises = this.variables.filter(variable => variable.refresh === 2).map(variable => {\n var previousOptions = variable.options.slice();\n\n return variable.updateOptions().then(() => {\n if (angular.toJson(previousOptions) !== angular.toJson(variable.options)) {\n this.$rootScope.$emit('template-variable-value-updated');\n }\n });\n });\n\n return this.$q.all(promises);\n }\n\n processVariable(variable, queryParams) {\n var dependencies = [];\n\n for (let otherVariable of this.variables) {\n if (variable.dependsOn(otherVariable)) {\n dependencies.push(otherVariable.initLock.promise);\n }\n }\n\n return this.$q\n .all(dependencies)\n .then(() => {\n if (variable.name === 'experiment_id') {\n let experimentId = this.$routeParams.experimentId;\n variable.setValueFromUrl(experimentId).then(variable.initLock.resolve);\n return;\n }\n\n var urlValue = queryParams['var-' + variable.name];\n\n if (urlValue !== void 0) {\n return variable.setValueFromUrl(urlValue).then(variable.initLock.resolve);\n }\n\n if (variable.refresh === 1 || variable.refresh === 2) {\n return variable.updateOptions().then(variable.initLock.resolve);\n }\n\n variable.initLock.resolve();\n })\n .finally(() => {\n this.templateSrv.variableInitialized(variable);\n delete variable.initLock;\n });\n }\n\n createVariableFromModel(model) {\n var ctor = variableTypes[model.type].ctor;\n if (!ctor) {\n throw {\n message: 'Unable to find variable constructor for ' + model.type,\n };\n }\n\n var variable = this.$injector.instantiate(ctor, { model: model });\n return variable;\n }\n\n addVariable(variable) {\n this.variables.push(variable);\n this.templateSrv.updateTemplateData();\n this.dashboard.updateSubmenuVisibility();\n }\n\n removeVariable(variable) {\n var index = _.indexOf(this.variables, variable);\n this.variables.splice(index, 1);\n this.templateSrv.updateTemplateData();\n this.dashboard.updateSubmenuVisibility();\n }\n\n updateOptions(variable) {\n return variable.updateOptions();\n }\n\n variableUpdated(variable, emitChangeEvents?) {\n // if there is a variable lock ignore cascading update because we are in a boot up scenario\n if (variable.initLock) {\n return this.$q.when();\n }\n\n // cascade updates to variables that use this variable\n var promises = _.map(this.variables, otherVariable => {\n if (otherVariable === variable) {\n return;\n }\n\n if (otherVariable.dependsOn(variable)) {\n return this.updateOptions(otherVariable);\n }\n });\n\n return this.$q.all(promises).then(() => {\n if (emitChangeEvents) {\n this.$rootScope.$emit('template-variable-value-updated');\n this.$rootScope.$broadcast('refresh');\n }\n });\n }\n\n selectOptionsForCurrentValue(variable) {\n var i, y, value, option;\n var selected: any = [];\n\n for (i = 0; i < variable.options.length; i++) {\n option = variable.options[i];\n option.selected = false;\n if (_.isArray(variable.current.value)) {\n for (y = 0; y < variable.current.value.length; y++) {\n value = variable.current.value[y];\n if (option.value === value) {\n option.selected = true;\n selected.push(option);\n }\n }\n } else if (option.value === variable.current.value) {\n option.selected = true;\n selected.push(option);\n }\n }\n\n return selected;\n }\n\n validateVariableSelectionState(variable) {\n if (!variable.current) {\n variable.current = {};\n }\n\n if (_.isArray(variable.current.value)) {\n var selected = this.selectOptionsForCurrentValue(variable);\n\n // if none pick first\n if (selected.length === 0) {\n selected = variable.options[0];\n } else {\n selected = {\n value: _.map(selected, function(val) {\n return val.value;\n }),\n text: _.map(selected, function(val) {\n return val.text;\n }).join(' + '),\n };\n }\n\n return variable.setValue(selected);\n } else {\n var currentOption = _.find(variable.options, {\n text: variable.current.text,\n });\n if (currentOption) {\n return variable.setValue(currentOption);\n } else {\n if (!variable.options.length) {\n return Promise.resolve();\n }\n return variable.setValue(variable.options[0]);\n }\n }\n }\n\n setOptionFromUrl(variable, urlValue) {\n var promise = this.$q.when();\n\n if (variable.refresh) {\n promise = variable.updateOptions();\n }\n\n return promise.then(() => {\n var option = _.find(variable.options, op => {\n return op.text === urlValue || op.value === urlValue;\n });\n\n let defaultText = urlValue;\n let defaultValue = urlValue;\n\n if (!option && _.isArray(urlValue)) {\n defaultText = [];\n\n for (let n = 0; n < urlValue.length; n++) {\n let t = _.find(variable.options, op => {\n return op.value === urlValue[n];\n });\n\n if (t) {\n defaultText.push(t.text);\n }\n }\n }\n\n option = option || { text: defaultText, value: defaultValue };\n return variable.setValue(option);\n });\n }\n\n setOptionAsCurrent(variable, option) {\n variable.current = _.cloneDeep(option);\n\n if (_.isArray(variable.current.text)) {\n variable.current.text = variable.current.text.join(' + ');\n }\n\n this.selectOptionsForCurrentValue(variable);\n return this.variableUpdated(variable);\n }\n\n updateUrlParamsWithCurrentVariables() {\n // update url\n var params = this.$location.search();\n\n // remove variable params\n _.each(params, function(value, key) {\n if (key.indexOf('var-') === 0) {\n delete params[key];\n }\n });\n\n // add new values\n this.templateSrv.fillVariableValuesForUrl(params);\n // update url\n this.$location.search(params);\n }\n\n setAdhocFilter(options) {\n var variable = _.find(this.variables, {\n type: 'adhoc',\n datasource: options.datasource,\n });\n if (!variable) {\n variable = this.createVariableFromModel({\n name: 'Filters',\n type: 'adhoc',\n datasource: options.datasource,\n });\n this.addVariable(variable);\n }\n\n let filters = variable.filters;\n let filter = _.find(filters, { key: options.key, value: options.value });\n\n if (!filter) {\n filter = { key: options.key, value: options.value };\n filters.push(filter);\n }\n\n filter.operator = options.operator;\n this.variableUpdated(variable, true);\n }\n}\n\ncoreModule.service('variableSrv', VariableSrv);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/templating/variable_srv.ts","let experimentId = {\n allFormat: 'glob',\n current: { text: '10', value: '10' },\n datasource: null,\n hide: 2,\n label: null,\n name: 'experiment_id',\n options: [{ selected: false, text: '0', value: '0' }],\n query: '0',\n refresh: 0,\n type: 'constant',\n};\n\nlet resolution = {\n allFormat: 'glob',\n allValue: null,\n current: { tags: [], text: 'Automatic', value: '$__interval' },\n datasource: null,\n hide: 0,\n includeAll: false,\n label: 'Resolution',\n multi: false,\n name: 'resolution',\n options: [\n { selected: true, text: 'Automatic', value: '$__interval' },\n { selected: false, text: '10s', value: '10s' },\n { selected: false, text: '1s', value: '1s' },\n { selected: false, text: '100ms', value: '100ms' },\n { selected: false, text: '10ms', value: '10ms' },\n { selected: false, text: '1ms', value: '1ms' },\n { selected: false, text: '100µs', value: '100u' },\n { selected: false, text: '10µs', value: '10u' },\n { selected: false, text: '1µs', value: '1u' },\n { selected: false, text: '100ns', value: '100ns' },\n { selected: false, text: '10ns', value: '10ns' },\n { selected: false, text: '1ns', value: '1ns' },\n ],\n query: '$__interval,1ms',\n refresh: 0,\n type: 'custom',\n};\n\nexport { experimentId, resolution };\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/templating/builtin_variables.ts","import _ from 'lodash';\nimport kbn from 'app/core/utils/kbn';\nimport { Variable, assignModelProperties, variableTypes } from './variable';\n\nexport class IntervalVariable implements Variable {\n name: string;\n auto_count: number;\n auto_min: number;\n options: any;\n auto: boolean;\n query: string;\n refresh: number;\n current: any;\n\n defaults = {\n type: 'interval',\n name: '',\n hide: 0,\n label: '',\n refresh: 2,\n options: [],\n current: {},\n query: '1m,10m,30m,1h,6h,12h,1d,7d,14d,30d',\n auto: false,\n auto_min: '10s',\n auto_count: 30,\n };\n\n /** @ngInject **/\n constructor(private model, private timeSrv, private templateSrv, private variableSrv) {\n assignModelProperties(this, model, this.defaults);\n this.refresh = 2;\n }\n\n getSaveModel() {\n assignModelProperties(this.model, this, this.defaults);\n return this.model;\n }\n\n setValue(option) {\n this.updateAutoValue();\n return this.variableSrv.setOptionAsCurrent(this, option);\n }\n\n updateAutoValue() {\n if (!this.auto) {\n return;\n }\n\n // add auto option if missing\n if (this.options.length && this.options[0].text !== 'auto') {\n this.options.unshift({\n text: 'auto',\n value: '$__auto_interval_' + this.name,\n });\n }\n\n var res = kbn.calculateInterval(this.timeSrv.timeRange(), this.auto_count, this.auto_min);\n this.templateSrv.setGrafanaVariable('$__auto_interval_' + this.name, res.interval);\n // for backward compatibility, to be removed eventually\n this.templateSrv.setGrafanaVariable('$__auto_interval', res.interval);\n }\n\n updateOptions() {\n // extract options between quotes and/or comma\n this.options = _.map(this.query.match(/([\"'])(.*?)\\1|\\w+/g), function(text) {\n text = text.replace(/[\"']+/g, '');\n return { text: text.trim(), value: text.trim() };\n });\n\n this.updateAutoValue();\n return this.variableSrv.validateVariableSelectionState(this);\n }\n\n dependsOn(variable) {\n return false;\n }\n\n setValueFromUrl(urlValue) {\n this.updateAutoValue();\n return this.variableSrv.setOptionFromUrl(this, urlValue);\n }\n\n getValueForUrl() {\n return this.current.value;\n }\n}\n\nvariableTypes['interval'] = {\n name: 'Interval',\n ctor: IntervalVariable,\n description: 'Define a timespan interval (ex 1m, 1h, 1d)',\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/templating/interval_variable.ts","import _ from 'lodash';\nimport kbn from 'app/core/utils/kbn';\nimport { Variable, containsVariable, assignModelProperties, variableTypes } from './variable';\n\nfunction getNoneOption() {\n return { text: 'None', value: '', isNone: true };\n}\n\nexport class QueryVariable implements Variable {\n datasource: any;\n query: any;\n regex: any;\n sort: any;\n options: any;\n current: any;\n refresh: number;\n hide: number;\n name: string;\n multi: boolean;\n includeAll: boolean;\n useTags: boolean;\n tagsQuery: string;\n tagValuesQuery: string;\n tags: any[];\n\n defaults = {\n type: 'query',\n label: null,\n query: '',\n regex: '',\n sort: 0,\n datasource: null,\n refresh: 0,\n hide: 0,\n name: '',\n multi: false,\n includeAll: false,\n allValue: null,\n options: [],\n current: {},\n tags: [],\n useTags: false,\n tagsQuery: '',\n tagValuesQuery: '',\n };\n\n /** @ngInject **/\n constructor(private model, private datasourceSrv, private templateSrv, private variableSrv, private timeSrv) {\n // copy model properties to this instance\n assignModelProperties(this, model, this.defaults);\n }\n\n getSaveModel() {\n // copy back model properties to model\n assignModelProperties(this.model, this, this.defaults);\n\n // remove options\n if (this.refresh !== 0) {\n this.model.options = [];\n }\n\n return this.model;\n }\n\n setValue(option) {\n return this.variableSrv.setOptionAsCurrent(this, option);\n }\n\n setValueFromUrl(urlValue) {\n return this.variableSrv.setOptionFromUrl(this, urlValue);\n }\n\n getValueForUrl() {\n if (this.current.text === 'All') {\n return 'All';\n }\n return this.current.value;\n }\n\n updateOptions() {\n return this.datasourceSrv\n .get(this.datasource)\n .then(this.updateOptionsFromMetricFindQuery.bind(this))\n .then(this.updateTags.bind(this))\n .then(this.variableSrv.validateVariableSelectionState.bind(this.variableSrv, this));\n }\n\n updateTags(datasource) {\n if (this.useTags) {\n return this.metricFindQuery(datasource, this.tagsQuery).then(results => {\n this.tags = [];\n for (var i = 0; i < results.length; i++) {\n this.tags.push(results[i].text);\n }\n return datasource;\n });\n } else {\n delete this.tags;\n }\n\n return datasource;\n }\n\n getValuesForTag(tagKey) {\n return this.datasourceSrv.get(this.datasource).then(datasource => {\n var query = this.tagValuesQuery.replace('$tag', tagKey);\n return this.metricFindQuery(datasource, query).then(function(results) {\n return _.map(results, function(value) {\n return value.text;\n });\n });\n });\n }\n\n updateOptionsFromMetricFindQuery(datasource) {\n return this.metricFindQuery(datasource, this.query).then(results => {\n this.options = this.metricNamesToVariableValues(results);\n if (this.includeAll) {\n this.addAllOption();\n }\n if (!this.options.length) {\n this.options.push(getNoneOption());\n }\n return datasource;\n });\n }\n\n metricFindQuery(datasource, query) {\n var options = { range: undefined, variable: this };\n\n if (this.refresh === 2) {\n options.range = this.timeSrv.timeRange();\n }\n\n return datasource.metricFindQuery(query, options);\n }\n\n addAllOption() {\n this.options.unshift({ text: 'All', value: '$__all' });\n }\n\n metricNamesToVariableValues(metricNames) {\n var regex, options, i, matches;\n options = [];\n\n if (this.regex) {\n regex = kbn.stringToJsRegex(this.templateSrv.replace(this.regex, {}, 'regex'));\n }\n for (i = 0; i < metricNames.length; i++) {\n var item = metricNames[i];\n var text = item.text === undefined || item.text === null ? item.value : item.text;\n\n var value = item.value === undefined || item.value === null ? item.text : item.value;\n\n if (_.isNumber(value)) {\n value = value.toString();\n }\n\n if (_.isNumber(text)) {\n text = text.toString();\n }\n\n if (regex) {\n matches = regex.exec(value);\n if (!matches) {\n continue;\n }\n if (matches.length > 1) {\n value = matches[1];\n text = matches[1];\n }\n }\n\n options.push({ text: text, value: value });\n }\n\n options = _.uniqBy(options, 'value');\n return this.sortVariableValues(options, this.sort);\n }\n\n sortVariableValues(options, sortOrder) {\n if (sortOrder === 0) {\n return options;\n }\n\n var sortType = Math.ceil(sortOrder / 2);\n var reverseSort = sortOrder % 2 === 0;\n\n if (sortType === 1) {\n options = _.sortBy(options, 'text');\n } else if (sortType === 2) {\n options = _.sortBy(options, opt => {\n var matches = opt.text.match(/.*?(\\d+).*/);\n if (!matches || matches.length < 2) {\n return -1;\n } else {\n return parseInt(matches[1], 10);\n }\n });\n } else if (sortType === 3) {\n options = _.sortBy(options, opt => {\n return _.toLower(opt.text);\n });\n }\n\n if (reverseSort) {\n options = options.reverse();\n }\n\n return options;\n }\n\n dependsOn(variable) {\n return containsVariable(this.query, this.datasource, variable.name);\n }\n}\n\nvariableTypes['query'] = {\n name: 'Query',\n ctor: QueryVariable,\n description: 'Variable values are fetched from a datasource query',\n supportsMulti: true,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/templating/query_variable.ts","import kbn from 'app/core/utils/kbn';\nimport { Variable, containsVariable, assignModelProperties, variableTypes } from './variable';\n\nexport class DatasourceVariable implements Variable {\n regex: any;\n query: string;\n options: any;\n current: any;\n refresh: any;\n\n defaults = {\n type: 'datasource',\n name: '',\n hide: 0,\n label: '',\n current: {},\n regex: '',\n options: [],\n query: '',\n refresh: 1,\n };\n\n /** @ngInject **/\n constructor(private model, private datasourceSrv, private variableSrv, private templateSrv) {\n assignModelProperties(this, model, this.defaults);\n this.refresh = 1;\n }\n\n getSaveModel() {\n assignModelProperties(this.model, this, this.defaults);\n\n // don't persist options\n this.model.options = [];\n return this.model;\n }\n\n setValue(option) {\n return this.variableSrv.setOptionAsCurrent(this, option);\n }\n\n updateOptions() {\n var options = [];\n var sources = this.datasourceSrv.getMetricSources({ skipVariables: true });\n var regex;\n\n if (this.regex) {\n regex = this.templateSrv.replace(this.regex, null, 'regex');\n regex = kbn.stringToJsRegex(regex);\n }\n\n for (var i = 0; i < sources.length; i++) {\n var source = sources[i];\n // must match on type\n if (source.meta.id !== this.query) {\n continue;\n }\n\n if (regex && !regex.exec(source.name)) {\n continue;\n }\n\n options.push({ text: source.name, value: source.name });\n }\n\n if (options.length === 0) {\n options.push({ text: 'No data sources found', value: '' });\n }\n\n this.options = options;\n return this.variableSrv.validateVariableSelectionState(this);\n }\n\n dependsOn(variable) {\n if (this.regex) {\n return containsVariable(this.regex, variable.name);\n }\n return false;\n }\n\n setValueFromUrl(urlValue) {\n return this.variableSrv.setOptionFromUrl(this, urlValue);\n }\n\n getValueForUrl() {\n return this.current.value;\n }\n}\n\nvariableTypes['datasource'] = {\n name: 'Datasource',\n ctor: DatasourceVariable,\n description: 'Enabled you to dynamically switch the datasource for multiple panels',\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/templating/datasource_variable.ts","import _ from 'lodash';\nimport { Variable, assignModelProperties, variableTypes } from './variable';\n\nexport class CustomVariable implements Variable {\n query: string;\n options: any;\n includeAll: boolean;\n multi: boolean;\n current: any;\n\n defaults = {\n type: 'custom',\n name: '',\n label: '',\n hide: 0,\n options: [],\n current: {},\n query: '',\n includeAll: false,\n multi: false,\n allValue: null,\n };\n\n /** @ngInject **/\n constructor(private model, private variableSrv) {\n assignModelProperties(this, model, this.defaults);\n }\n\n setValue(option) {\n return this.variableSrv.setOptionAsCurrent(this, option);\n }\n\n getSaveModel() {\n assignModelProperties(this.model, this, this.defaults);\n return this.model;\n }\n\n updateOptions() {\n // extract options in comma separated string\n this.options = _.map(this.query.split(/[,]+/), function(text) {\n return { text: text.trim(), value: text.trim() };\n });\n\n if (this.includeAll) {\n this.addAllOption();\n }\n\n return this.variableSrv.validateVariableSelectionState(this);\n }\n\n addAllOption() {\n this.options.unshift({ text: 'All', value: '$__all' });\n }\n\n dependsOn(variable) {\n return false;\n }\n\n setValueFromUrl(urlValue) {\n return this.variableSrv.setOptionFromUrl(this, urlValue);\n }\n\n getValueForUrl() {\n if (this.current.text === 'All') {\n return 'All';\n }\n return this.current.value;\n }\n}\n\nvariableTypes['custom'] = {\n name: 'Custom',\n ctor: CustomVariable,\n description: 'Define variable values manually',\n supportsMulti: true,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/templating/custom_variable.ts","import { Variable, assignModelProperties, variableTypes } from './variable';\n\nexport class ConstantVariable implements Variable {\n query: string;\n options: any[];\n current: any;\n\n defaults = {\n type: 'constant',\n name: '',\n hide: 2,\n label: '',\n query: '',\n current: {},\n options: [],\n };\n\n /** @ngInject **/\n constructor(private model, private variableSrv) {\n assignModelProperties(this, model, this.defaults);\n }\n\n getSaveModel() {\n assignModelProperties(this.model, this, this.defaults);\n return this.model;\n }\n\n setValue(option) {\n this.variableSrv.setOptionAsCurrent(this, option);\n }\n\n updateOptions() {\n this.options = [{ text: this.query.trim(), value: this.query.trim() }];\n this.setValue(this.options[0]);\n return Promise.resolve();\n }\n\n dependsOn(variable) {\n return false;\n }\n\n setValueFromUrl(urlValue) {\n return this.variableSrv.setOptionFromUrl(this, urlValue);\n }\n\n getValueForUrl() {\n return this.current.value;\n }\n}\n\nvariableTypes['constant'] = {\n name: 'Constant',\n ctor: ConstantVariable,\n description: 'Define a hidden constant variable, useful for metric prefixes in dashboards you want to share',\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/templating/constant_variable.ts","import _ from 'lodash';\nimport { Variable, assignModelProperties, variableTypes } from './variable';\n\nexport class AdhocVariable implements Variable {\n filters: any[];\n\n defaults = {\n type: 'adhoc',\n name: '',\n label: '',\n hide: 0,\n datasource: null,\n filters: [],\n };\n\n /** @ngInject **/\n constructor(private model) {\n assignModelProperties(this, model, this.defaults);\n }\n\n setValue(option) {\n return Promise.resolve();\n }\n\n getSaveModel() {\n assignModelProperties(this.model, this, this.defaults);\n return this.model;\n }\n\n updateOptions() {\n return Promise.resolve();\n }\n\n dependsOn(variable) {\n return false;\n }\n\n setValueFromUrl(urlValue) {\n if (!_.isArray(urlValue)) {\n urlValue = [urlValue];\n }\n\n this.filters = urlValue.map(item => {\n var values = item.split('|').map(value => {\n return this.unescapeDelimiter(value);\n });\n return {\n key: values[0],\n operator: values[1],\n value: values[2],\n };\n });\n\n return Promise.resolve();\n }\n\n getValueForUrl() {\n return this.filters.map(filter => {\n return [filter.key, filter.operator, filter.value]\n .map(value => {\n return this.escapeDelimiter(value);\n })\n .join('|');\n });\n }\n\n escapeDelimiter(value) {\n return value.replace(/\\|/g, '__gfp__');\n }\n\n unescapeDelimiter(value) {\n return value.replace(/__gfp__/g, '|');\n }\n\n setFilters(filters: any[]) {\n this.filters = filters;\n }\n}\n\nvariableTypes['adhoc'] = {\n name: 'Ad hoc filters',\n ctor: AdhocVariable,\n description: 'Add key/value filters on the fly',\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/templating/adhoc_variable.ts","import './plugin_edit_ctrl';\nimport './plugin_page_ctrl';\nimport './plugin_list_ctrl';\nimport './import_list/import_list';\nimport './ds_edit_ctrl';\nimport './ds_dashboards_ctrl';\nimport './ds_list_ctrl';\nimport './datasource_srv';\nimport './plugin_component';\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/plugins/all.ts","import angular from 'angular';\nimport _ from 'lodash';\nimport Remarkable from 'remarkable';\n\nexport class PluginEditCtrl {\n model: any;\n pluginIcon: string;\n pluginId: any;\n includes: any;\n readmeHtml: any;\n includedDatasources: any;\n tab: string;\n navModel: any;\n hasDashboards: any;\n preUpdateHook: () => any;\n postUpdateHook: () => any;\n\n /** @ngInject */\n constructor(private $scope, private $rootScope, private backendSrv, private $sce, private $routeParams, navModelSrv) {\n this.pluginId = $routeParams.pluginId;\n this.preUpdateHook = () => Promise.resolve();\n this.postUpdateHook = () => Promise.resolve();\n\n this.init();\n }\n\n setNavModel(model) {\n let defaultTab = 'readme';\n\n this.navModel = {\n main: {\n img: model.info.logos.large,\n subTitle: model.info.author.name,\n url: '',\n text: model.name,\n breadcrumbs: [{ title: 'Plugins', url: 'plugins' }],\n children: [\n {\n icon: 'fa fa-fw fa-file-text-o',\n id: 'readme',\n text: 'Readme',\n url: `plugins/${this.model.id}/edit?tab=readme`,\n },\n ],\n },\n };\n\n if (model.type === 'app') {\n this.navModel.main.children.push({\n icon: 'gicon gicon-cog',\n id: 'config',\n text: 'Config',\n url: `plugins/${this.model.id}/edit?tab=config`,\n });\n\n let hasDashboards = _.find(model.includes, { type: 'dashboard' });\n\n if (hasDashboards) {\n this.navModel.main.children.push({\n icon: 'gicon gicon-dashboard',\n id: 'dashboards',\n text: 'Dashboards',\n url: `plugins/${this.model.id}/edit?tab=dashboards`,\n });\n }\n\n defaultTab = 'config';\n }\n\n this.tab = this.$routeParams.tab || defaultTab;\n\n for (let tab of this.navModel.main.children) {\n if (tab.id === this.tab) {\n tab.active = true;\n }\n }\n }\n\n init() {\n return this.backendSrv.get(`/api/plugins/${this.pluginId}/settings`).then(result => {\n this.model = result;\n this.pluginIcon = this.getPluginIcon(this.model.type);\n\n this.model.dependencies.plugins.forEach(plug => {\n plug.icon = this.getPluginIcon(plug.type);\n });\n\n this.includes = _.map(result.includes, plug => {\n plug.icon = this.getPluginIcon(plug.type);\n return plug;\n });\n\n this.setNavModel(this.model);\n return this.initReadme();\n });\n }\n\n initReadme() {\n return this.backendSrv.get(`/api/plugins/${this.pluginId}/markdown/readme`).then(res => {\n var md = new Remarkable();\n this.readmeHtml = this.$sce.trustAsHtml(md.render(res));\n });\n }\n\n getPluginIcon(type) {\n switch (type) {\n case 'datasource':\n return 'icon-gf icon-gf-datasources';\n case 'panel':\n return 'icon-gf icon-gf-panel';\n case 'app':\n return 'icon-gf icon-gf-apps';\n case 'page':\n return 'icon-gf icon-gf-endpoint-tiny';\n case 'dashboard':\n return 'icon-gf icon-gf-dashboard';\n default:\n return 'icon-gf icon-gf-apps';\n }\n }\n\n update() {\n this.preUpdateHook()\n .then(() => {\n var updateCmd = _.extend(\n {\n enabled: this.model.enabled,\n pinned: this.model.pinned,\n jsonData: this.model.jsonData,\n secureJsonData: this.model.secureJsonData,\n },\n {}\n );\n return this.backendSrv.post(`/api/plugins/${this.pluginId}/settings`, updateCmd);\n })\n .then(this.postUpdateHook)\n .then(res => {\n window.location.href = window.location.href;\n });\n }\n\n importDashboards() {\n return Promise.resolve();\n }\n\n setPreUpdateHook(callback: () => any) {\n this.preUpdateHook = callback;\n }\n\n setPostUpdateHook(callback: () => any) {\n this.postUpdateHook = callback;\n }\n\n updateAvailable() {\n var modalScope = this.$scope.$new(true);\n modalScope.plugin = this.model;\n\n this.$rootScope.appEvent('show-modal', {\n src: 'public/app/features/plugins/partials/update_instructions.html',\n scope: modalScope,\n });\n }\n\n enable() {\n this.model.enabled = true;\n this.model.pinned = true;\n this.update();\n }\n\n disable() {\n this.model.enabled = false;\n this.model.pinned = false;\n this.update();\n }\n}\n\nangular.module('grafana.controllers').controller('PluginEditCtrl', PluginEditCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/plugins/plugin_edit_ctrl.ts","import angular from 'angular';\nimport _ from 'lodash';\n\nvar pluginInfoCache = {};\n\nexport class AppPageCtrl {\n page: any;\n pluginId: any;\n appModel: any;\n navModel: any;\n\n /** @ngInject */\n constructor(private backendSrv, private $routeParams: any, private $rootScope, private navModelSrv) {\n this.pluginId = $routeParams.pluginId;\n\n if (pluginInfoCache[this.pluginId]) {\n this.initPage(pluginInfoCache[this.pluginId]);\n } else {\n this.loadPluginInfo();\n }\n }\n\n initPage(app) {\n this.appModel = app;\n this.page = _.find(app.includes, { slug: this.$routeParams.slug });\n\n pluginInfoCache[this.pluginId] = app;\n\n if (!this.page) {\n this.$rootScope.appEvent('alert-error', ['App Page Not Found', '']);\n\n this.navModel = this.navModelSrv.getNotFoundNav();\n return;\n }\n\n let pluginNav = this.navModelSrv.getNav('plugin-page-' + app.id);\n\n this.navModel = {\n main: {\n img: app.info.logos.large,\n subTitle: app.name,\n url: '',\n text: this.page.name,\n breadcrumbs: [{ title: app.name, url: pluginNav.main.url }],\n },\n };\n }\n\n loadPluginInfo() {\n this.backendSrv.get(`/api/plugins/${this.pluginId}/settings`).then(app => {\n this.initPage(app);\n });\n }\n}\n\nangular.module('grafana.controllers').controller('AppPageCtrl', AppPageCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/plugins/plugin_page_ctrl.ts","import angular from 'angular';\nimport _ from 'lodash';\n\nexport class PluginListCtrl {\n plugins: any[];\n tabIndex: number;\n navModel: any;\n searchQuery: string;\n allPlugins: any[];\n\n /** @ngInject */\n constructor(private backendSrv: any, $location, navModelSrv) {\n this.tabIndex = 0;\n this.navModel = navModelSrv.getNav('cfg', 'plugins', 0);\n\n this.backendSrv.get('api/plugins', { embedded: 0 }).then(plugins => {\n this.plugins = plugins;\n this.allPlugins = plugins;\n });\n }\n\n onQueryUpdated() {\n let regex = new RegExp(this.searchQuery, 'ig');\n this.plugins = _.filter(this.allPlugins, item => {\n return regex.test(item.name) || regex.test(item.type);\n });\n }\n}\n\nangular.module('grafana.controllers').controller('PluginListCtrl', PluginListCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/plugins/plugin_list_ctrl.ts","import _ from 'lodash';\nimport coreModule from 'app/core/core_module';\nimport appEvents from 'app/core/app_events';\n\nexport class DashImportListCtrl {\n dashboards: any[];\n plugin: any;\n datasource: any;\n\n /** @ngInject */\n constructor($scope, private backendSrv, private $rootScope) {\n this.dashboards = [];\n\n backendSrv.get(`/api/plugins/${this.plugin.id}/dashboards`).then(dashboards => {\n this.dashboards = dashboards;\n });\n\n appEvents.on('dashboard-list-import-all', this.importAll.bind(this), $scope);\n }\n\n importAll(payload) {\n return this.importNext(0)\n .then(() => {\n payload.resolve('All dashboards imported');\n })\n .catch(err => {\n payload.reject(err);\n });\n }\n\n importNext(index) {\n return this.import(this.dashboards[index], true).then(() => {\n if (index + 1 < this.dashboards.length) {\n return new Promise(resolve => {\n setTimeout(() => {\n this.importNext(index + 1).then(() => {\n resolve();\n });\n }, 500);\n });\n } else {\n return Promise.resolve();\n }\n });\n }\n\n import(dash, overwrite) {\n var installCmd = {\n pluginId: this.plugin.id,\n path: dash.path,\n overwrite: overwrite,\n inputs: [],\n };\n\n if (this.datasource) {\n installCmd.inputs.push({\n name: '*',\n type: 'datasource',\n pluginId: this.datasource.type,\n value: this.datasource.name,\n });\n }\n\n return this.backendSrv.post(`/api/dashboards/import`, installCmd).then(res => {\n this.$rootScope.appEvent('alert-success', ['Dashboard Imported', dash.title]);\n _.extend(dash, res);\n });\n }\n\n remove(dash) {\n this.backendSrv.delete('/api/dashboards/' + dash.importedUri).then(() => {\n this.$rootScope.appEvent('alert-success', ['Dashboard Deleted', dash.title]);\n dash.imported = false;\n });\n }\n}\n\nexport function dashboardImportList() {\n return {\n restrict: 'E',\n templateUrl: 'public/app/features/plugins/import_list/import_list.html',\n controller: DashImportListCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: {\n plugin: '=',\n datasource: '=',\n },\n };\n}\n\ncoreModule.directive('dashboardImportList', dashboardImportList);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/plugins/import_list/import_list.ts","import _ from 'lodash';\nimport { toJS } from 'mobx';\nimport config from 'app/core/config';\nimport { coreModule, appEvents } from 'app/core/core';\nimport { store } from 'app/stores/store';\n\nvar datasourceTypes = [];\n\nvar defaults = {\n name: '',\n type: 'graphite',\n url: '',\n access: 'proxy',\n jsonData: {},\n secureJsonFields: {},\n};\n\nvar datasourceCreated = false;\n\nexport class DataSourceEditCtrl {\n isNew: boolean;\n datasources: any[];\n current: any;\n types: any;\n testing: any;\n datasourceMeta: any;\n editForm: any;\n gettingStarted: boolean;\n navModel: any;\n\n /** @ngInject */\n constructor(private $q, private backendSrv, private $routeParams, private $location, private datasourceSrv) {\n if (store.nav.main === null) {\n store.nav.load('cfg', 'datasources');\n }\n\n this.navModel = toJS(store.nav);\n this.datasources = [];\n\n this.loadDatasourceTypes().then(() => {\n if (this.$routeParams.id) {\n this.getDatasourceById(this.$routeParams.id);\n } else {\n this.initNewDatasourceModel();\n }\n });\n }\n\n initNewDatasourceModel() {\n this.isNew = true;\n this.current = _.cloneDeep(defaults);\n\n // We are coming from getting started\n if (this.$location.search().gettingstarted) {\n this.gettingStarted = true;\n this.current.isDefault = true;\n }\n\n this.typeChanged();\n }\n\n loadDatasourceTypes() {\n if (datasourceTypes.length > 0) {\n this.types = datasourceTypes;\n return this.$q.when(null);\n }\n\n return this.backendSrv.get('/api/plugins', { enabled: 1, type: 'datasource' }).then(plugins => {\n datasourceTypes = plugins;\n this.types = plugins;\n });\n }\n\n getDatasourceById(id) {\n this.backendSrv.get('/api/datasources/' + id).then(ds => {\n this.isNew = false;\n this.current = ds;\n\n if (datasourceCreated) {\n datasourceCreated = false;\n this.testDatasource();\n }\n\n return this.typeChanged();\n });\n }\n\n userChangedType() {\n // reset model but keep name & default flag\n this.current = _.defaults(\n {\n id: this.current.id,\n name: this.current.name,\n isDefault: this.current.isDefault,\n type: this.current.type,\n },\n _.cloneDeep(defaults)\n );\n this.typeChanged();\n }\n\n updateNav() {\n store.nav.initDatasourceEditNav(this.current, this.datasourceMeta, 'datasource-settings');\n this.navModel = toJS(store.nav);\n }\n\n typeChanged() {\n return this.backendSrv.get('/api/plugins/' + this.current.type + '/settings').then(pluginInfo => {\n this.datasourceMeta = pluginInfo;\n this.updateNav();\n });\n }\n\n updateFrontendSettings() {\n return this.backendSrv.get('/api/frontend/settings').then(settings => {\n config.datasources = settings.datasources;\n config.defaultDatasource = settings.defaultDatasource;\n this.datasourceSrv.init();\n });\n }\n\n testDatasource() {\n this.datasourceSrv.get(this.current.name).then(datasource => {\n if (!datasource.testDatasource) {\n return;\n }\n\n this.testing = { done: false, status: 'error' };\n\n // make test call in no backend cache context\n this.backendSrv\n .withNoBackendCache(() => {\n return datasource\n .testDatasource()\n .then(result => {\n this.testing.message = result.message;\n this.testing.status = result.status;\n })\n .catch(err => {\n if (err.statusText) {\n this.testing.message = 'HTTP Error ' + err.statusText;\n } else {\n this.testing.message = err.message;\n }\n });\n })\n .finally(() => {\n this.testing.done = true;\n });\n });\n }\n\n saveChanges() {\n if (!this.editForm.$valid) {\n return;\n }\n\n if (this.current.readOnly) {\n return;\n }\n\n if (this.current.id) {\n return this.backendSrv.put('/api/datasources/' + this.current.id, this.current).then(result => {\n this.current = result.datasource;\n this.updateNav();\n this.updateFrontendSettings().then(() => {\n this.testDatasource();\n });\n });\n } else {\n return this.backendSrv.post('/api/datasources', this.current).then(result => {\n this.current = result.datasource;\n this.updateFrontendSettings();\n\n datasourceCreated = true;\n this.$location.path('datasources/edit/' + result.id);\n });\n }\n }\n\n confirmDelete() {\n this.backendSrv.delete('/api/datasources/' + this.current.id).then(() => {\n this.$location.path('datasources');\n });\n }\n\n delete(s) {\n appEvents.emit('confirm-modal', {\n title: 'Delete',\n text: 'Are you sure you want to delete this datasource?',\n yesText: 'Delete',\n icon: 'fa-trash',\n onConfirm: () => {\n this.confirmDelete();\n },\n });\n }\n}\n\ncoreModule.controller('DataSourceEditCtrl', DataSourceEditCtrl);\n\ncoreModule.directive('datasourceHttpSettings', function() {\n return {\n scope: {\n current: '=',\n suggestUrl: '@',\n noDirectAccess: '@',\n },\n templateUrl: 'public/app/features/plugins/partials/ds_http_settings.html',\n link: {\n pre: function($scope, elem, attrs) {\n // do not show access option if direct access is disabled\n $scope.showAccessOption = $scope.noDirectAccess !== 'true';\n $scope.showAccessHelp = false;\n $scope.toggleAccessHelp = function() {\n $scope.showAccessHelp = !$scope.showAccessHelp;\n };\n\n $scope.getSuggestUrls = function() {\n return [$scope.suggestUrl];\n };\n },\n },\n };\n});\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/plugins/ds_edit_ctrl.ts","import { toJS } from 'mobx';\nimport { coreModule } from 'app/core/core';\nimport { store } from 'app/stores/store';\n\nexport class DataSourceDashboardsCtrl {\n datasourceMeta: any;\n navModel: any;\n current: any;\n\n /** @ngInject */\n constructor(private backendSrv, private $routeParams) {\n if (store.nav.main === null) {\n store.nav.load('cfg', 'datasources');\n }\n\n this.navModel = toJS(store.nav);\n\n if (this.$routeParams.id) {\n this.getDatasourceById(this.$routeParams.id);\n }\n }\n\n getDatasourceById(id) {\n this.backendSrv\n .get('/api/datasources/' + id)\n .then(ds => {\n this.current = ds;\n })\n .then(this.getPluginInfo.bind(this));\n }\n\n updateNav() {\n store.nav.initDatasourceEditNav(this.current, this.datasourceMeta, 'datasource-dashboards');\n this.navModel = toJS(store.nav);\n }\n\n getPluginInfo() {\n return this.backendSrv.get('/api/plugins/' + this.current.type + '/settings').then(pluginInfo => {\n this.datasourceMeta = pluginInfo;\n this.updateNav();\n });\n }\n}\n\ncoreModule.controller('DataSourceDashboardsCtrl', DataSourceDashboardsCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/plugins/ds_dashboards_ctrl.ts","import coreModule from '../../core/core_module';\nimport _ from 'lodash';\n\nexport class DataSourcesCtrl {\n datasources: any;\n unfiltered: any;\n navModel: any;\n searchQuery: string;\n\n /** @ngInject */\n constructor(private $scope, private backendSrv, private datasourceSrv, private navModelSrv) {\n this.navModel = this.navModelSrv.getNav('cfg', 'datasources', 0);\n backendSrv.get('/api/datasources').then(result => {\n this.datasources = result;\n this.unfiltered = result;\n });\n }\n\n onQueryUpdated() {\n let regex = new RegExp(this.searchQuery, 'ig');\n this.datasources = _.filter(this.unfiltered, item => {\n return regex.test(item.name) || regex.test(item.type);\n });\n }\n\n removeDataSourceConfirmed(ds) {\n this.backendSrv\n .delete('/api/datasources/' + ds.id)\n .then(\n () => {\n this.$scope.appEvent('alert-success', ['Datasource deleted', '']);\n },\n () => {\n this.$scope.appEvent('alert-error', ['Unable to delete datasource', '']);\n }\n )\n .then(() => {\n this.backendSrv.get('/api/datasources').then(result => {\n this.datasources = result;\n });\n this.backendSrv.get('/api/frontend/settings').then(settings => {\n this.datasourceSrv.init(settings.datasources);\n });\n });\n }\n\n removeDataSource(ds) {\n this.$scope.appEvent('confirm-modal', {\n title: 'Delete',\n text: 'Are you sure you want to delete datasource ' + ds.name + '?',\n yesText: 'Delete',\n icon: 'fa-trash',\n onConfirm: () => {\n this.removeDataSourceConfirmed(ds);\n },\n });\n }\n}\n\ncoreModule.controller('DataSourcesCtrl', DataSourcesCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/plugins/ds_list_ctrl.ts","import _ from 'lodash';\nimport coreModule from 'app/core/core_module';\nimport config from 'app/core/config';\nimport { importPluginModule } from './plugin_loader';\n\nexport class DatasourceSrv {\n datasources: any;\n\n /** @ngInject */\n constructor(private $q, private $injector, private $rootScope, private templateSrv) {\n this.init();\n }\n\n init() {\n this.datasources = {};\n }\n\n get(name?) {\n if (!name) {\n return this.get(config.defaultDatasource);\n }\n\n name = this.templateSrv.replace(name);\n\n if (name === 'default') {\n return this.get(config.defaultDatasource);\n }\n\n if (this.datasources[name]) {\n return this.$q.when(this.datasources[name]);\n }\n\n return this.loadDatasource(name);\n }\n\n loadDatasource(name) {\n var dsConfig = config.datasources[name];\n if (!dsConfig) {\n return this.$q.reject({ message: 'Datasource named ' + name + ' was not found' });\n }\n\n var deferred = this.$q.defer();\n var pluginDef = dsConfig.meta;\n\n importPluginModule(pluginDef.module)\n .then(plugin => {\n // check if its in cache now\n if (this.datasources[name]) {\n deferred.resolve(this.datasources[name]);\n return;\n }\n\n // plugin module needs to export a constructor function named Datasource\n if (!plugin.Datasource) {\n throw new Error('Plugin module is missing Datasource constructor');\n }\n\n var instance = this.$injector.instantiate(plugin.Datasource, { instanceSettings: dsConfig });\n instance.meta = pluginDef;\n instance.name = name;\n this.datasources[name] = instance;\n deferred.resolve(instance);\n })\n .catch(err => {\n this.$rootScope.appEvent('alert-error', [dsConfig.name + ' plugin failed', err.toString()]);\n });\n\n return deferred.promise;\n }\n\n getAll() {\n return config.datasources;\n }\n\n getAnnotationSources() {\n var sources = [];\n\n this.addDataSourceVariables(sources);\n\n _.each(config.datasources, function(value) {\n if (value.meta && value.meta.annotations) {\n sources.push(value);\n }\n });\n\n return sources;\n }\n\n getMetricSources(options) {\n var metricSources = [];\n\n _.each(config.datasources, function(value, key) {\n if (value.meta && value.meta.metrics) {\n metricSources.push({ value: key, name: key, meta: value.meta });\n\n if (key === config.defaultDatasource) {\n metricSources.push({ value: null, name: 'default', meta: value.meta });\n }\n }\n });\n\n if (!options || !options.skipVariables) {\n this.addDataSourceVariables(metricSources);\n }\n\n metricSources.sort(function(a, b) {\n // these two should always be at the bottom\n if (a.meta.id === 'mixed' || a.meta.id === 'grafana') {\n return 1;\n }\n if (b.meta.id === 'mixed' || b.meta.id === 'grafana') {\n return -1;\n }\n if (a.name.toLowerCase() > b.name.toLowerCase()) {\n return 1;\n }\n if (a.name.toLowerCase() < b.name.toLowerCase()) {\n return -1;\n }\n return 0;\n });\n\n return metricSources;\n }\n\n addDataSourceVariables(list) {\n // look for data source variables\n for (var i = 0; i < this.templateSrv.variables.length; i++) {\n var variable = this.templateSrv.variables[i];\n if (variable.type !== 'datasource') {\n continue;\n }\n\n var first = variable.current.value;\n if (first === 'default') {\n first = config.defaultDatasource;\n }\n\n var ds = config.datasources[first];\n\n if (ds) {\n list.push({\n name: '$' + variable.name,\n value: '$' + variable.name,\n meta: ds.meta,\n });\n }\n }\n }\n}\n\ncoreModule.service('datasourceSrv', DatasourceSrv);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/plugins/datasource_srv.ts","/*\n * SystemJS v0.20.19 Dev\n */\n!function(){\"use strict\";function e(e){return ut?Symbol():\"@@\"+e}function t(e,t){ot||(t=t.replace(at?/file:\\/\\/\\//g:/file:\\/\\//g,\"\"));var r,n=(e.message||e)+\"\\n \"+t;r=ft&&e.fileName?new Error(n,e.fileName,e.lineNumber):new Error(n);var o=e.originalErr?e.originalErr.stack:e.stack;return r.stack=it?n+\"\\n \"+o:o,r.originalErr=e.originalErr||e,r}function r(e,t){throw new RangeError('Unable to resolve \"'+e+'\" to '+t)}function n(e,t){e=e.trim();var n=t&&t.substr(0,t.indexOf(\":\")+1),o=e[0],i=e[1];if(\"/\"===o&&\"/\"===i)return n||r(e,t),n+e;if(\".\"===o&&(\"/\"===i||\".\"===i&&(\"/\"===e[2]||2===e.length&&(e+=\"/\"))||1===e.length&&(e+=\"/\"))||\"/\"===o){var a,s=!n||\"/\"!==t[n.length];if(s?(void 0===t&&r(e,t),a=t):a=\"/\"===t[n.length+1]?\"file:\"!==n?(a=t.substr(n.length+2)).substr(a.indexOf(\"/\")+1):t.substr(8):t.substr(n.length+1),\"/\"===o){if(!s)return t.substr(0,t.length-a.length-1)+e;r(e,t)}for(var u=a.substr(0,a.lastIndexOf(\"/\")+1)+e,l=[],c=-1,f=0;f1&&g(e,r,i))})).then(function(t){if(void 0!==t){if(!(t instanceof l))throw new TypeError(\"Instantiate did not return a valid Module object.\");return delete i.records[r.key],e.trace&&v(e,r,n),o[r.key]=t}var a=r.registration;if(r.registration=void 0,!a)throw new TypeError(\"Module instantiation did not call an anonymous or correctly named System.register.\");return n.dependencies=a[0],r.importerSetters=[],n.moduleObj={},a[2]?(n.moduleObj.default=n.moduleObj.__useDefault={},n.executingRequire=a[1],n.execute=a[2]):y(e,r,n,a[1]),r}).catch(function(e){throw r.linkRecord=void 0,r.loadError=r.loadError||t(e,\"Instantiating \"+r.key)}))}function m(e,t,r,n,o,i){return e.resolve(t,r).then(function(r){i&&(i[t]=r);var a=o.records[r],s=n[r];if(s&&(!a||a.module&&s!==a.module))return s;if(a&&a.loadError)throw a.loadError;(!a||!s&&a.module)&&(a=d(o,r,a&&a.registration));var u=a.linkRecord;return u?h(e,a,u,n,o):a})}function v(e,t,r){e.loads=e.loads||{},e.loads[t.key]={key:t.key,deps:r.dependencies,dynamicDeps:[],depMap:r.depMap||{}}}function y(e,t,r,n){var o=r.moduleObj,i=t.importerSetters,a=!1,s=n.call(st,function(e,t){if(\"object\"==typeof e){var r=!1;for(var n in e)t=e[n],\"__useDefault\"===n||n in o&&o[n]===t||(r=!0,o[n]=t);if(!1===r)return t}else{if((a||e in o)&&o[e]===t)return t;o[e]=t}for(var s=0;sthis.len&&(this.match=e,this.len=r)}}function N(e,t){if(Object.hasOwnProperty.call(e,t))return t;var r={name:t,match:void 0,len:0};return Object.keys(e).forEach(z,r),r.match}function J(e,t,r,n){if(\"file:///\"===e.substr(0,8)){if(Ft)return $(e,t,r,n);throw new Error(\"Unable to fetch file URLs in this environment.\")}e=e.replace(/#/g,\"%23\");var o={headers:{Accept:\"application/x-es-module, */*\"}};return r&&(o.integrity=r),t&&(\"string\"==typeof t&&(o.headers.Authorization=t),o.credentials=\"include\"),fetch(e,o).then(function(e){if(e.ok)return n?e.arrayBuffer():e.text();throw new Error(\"Fetch error: \"+e.status+\" \"+e.statusText)})}function $(e,t,r,n){return new Promise(function(r,o){function i(){r(n?s.response:s.responseText)}function a(){o(new Error(\"XHR error: \"+(s.status?\" (\"+s.status+(s.statusText?\" \"+s.statusText:\"\")+\")\":\"\")+\" loading \"+e))}e=e.replace(/#/g,\"%23\");var s=new XMLHttpRequest;n&&(s.responseType=\"arraybuffer\"),s.onreadystatechange=function(){4===s.readyState&&(0==s.status?s.response?i():(s.addEventListener(\"error\",a),s.addEventListener(\"load\",i)):200===s.status?i():a())},s.open(\"GET\",e,!0),s.setRequestHeader&&(s.setRequestHeader(\"Accept\",\"application/x-es-module, */*\"),t&&(\"string\"==typeof t&&s.setRequestHeader(\"Authorization\",t),s.withCredentials=!0)),s.send(null)})}function B(e,t,r,n){return\"file:///\"!=e.substr(0,8)?Promise.reject(new Error('Unable to fetch \"'+e+'\". Only file URLs of the form file:/// supported running in Node.')):(Lt=Lt||require(\"fs\"),e=at?e.replace(/\\//g,\"\\\\\").substr(8):e.substr(7),new Promise(function(t,r){Lt.readFile(e,function(e,o){if(e)return r(e);if(n)t(o);else{var i=o+\"\";\"\\ufeff\"===i[0]&&(i=i.substr(1)),t(i)}})}))}function W(){throw new Error(\"No fetch method is defined for this environment.\")}function G(){return{pluginKey:void 0,pluginArgument:void 0,pluginModule:void 0,packageKey:void 0,packageConfig:void 0,load:void 0}}function H(e,t,r){var n=G();if(r){var o;t.pluginFirst?-1!==(o=r.lastIndexOf(\"!\"))&&(n.pluginArgument=n.pluginKey=r.substr(0,o)):-1!==(o=r.indexOf(\"!\"))&&(n.pluginArgument=n.pluginKey=r.substr(o+1)),n.packageKey=N(t.packages,r),n.packageKey&&(n.packageConfig=t.packages[n.packageKey])}return n}function Z(e,t){var r=this[St],n=G(),o=H(this,r,t),i=this;return Promise.resolve().then(function(){var r=e.lastIndexOf(\"#?\");if(-1===r)return Promise.resolve(e);var n=he.call(i,e.substr(r+2));return me.call(i,n,t,!0).then(function(t){return t?e.substr(0,r):\"@empty\"})}).then(function(e){var a=ne(r.pluginFirst,e);return a?(n.pluginKey=a.plugin,Promise.all([ee.call(i,r,a.argument,o&&o.pluginArgument||t,n,o,!0),i.resolve(a.plugin,t)]).then(function(e){if(n.pluginArgument=e[0],n.pluginKey=e[1],n.pluginArgument===n.pluginKey)throw new Error(\"Plugin \"+n.pluginArgument+\" cannot load itself, make sure it is excluded from any wildcard meta configuration via a custom loader: false rule.\");return oe(r.pluginFirst,e[0],e[1])})):ee.call(i,r,e,o&&o.pluginArgument||t,n,o,!1)}).then(function(e){return ve.call(i,e,t,o)}).then(function(e){return re.call(i,r,e,n),n.pluginKey||!n.load.loader?e:i.resolve(n.load.loader,e).then(function(t){return n.pluginKey=t,n.pluginArgument=e,e})}).then(function(e){return i[jt][e]=n,e})}function X(e,t){var r=ne(e.pluginFirst,t);if(r){var n=X.call(this,e,r.plugin);return oe(e.pluginFirst,Q.call(this,e,r.argument,void 0,!1,!1),n)}return Q.call(this,e,t,void 0,!1,!1)}function Y(e,t){var r=this[St],n=G(),o=o||H(this,r,t),i=ne(r.pluginFirst,e);return i?(n.pluginKey=Y.call(this,i.plugin,t),oe(r.pluginFirst,V.call(this,r,i.argument,o.pluginArgument||t,n,o,!!n.pluginKey),n.pluginKey)):V.call(this,r,e,o.pluginArgument||t,n,o,!!n.pluginKey)}function Q(e,t,r,o,i){var a=n(t,r||nt);if(a)return T(e.baseURL,e.paths,a);if(o){var s=N(e.map,t);if(s&&(t=e.map[s]+t.substr(s.length),a=n(t,nt)))return T(e.baseURL,e.paths,a)}if(this.registry.has(t))return t;if(\"@node/\"===t.substr(0,6))return t;var u=i&&\"/\"!==t[t.length-1],l=T(e.baseURL,e.paths,u?t+\"/\":t);return u?l.substr(0,l.length-1):l}function V(e,t,r,n,o,i){if(o&&o.packageConfig&&\".\"!==t[0]){var a=o.packageConfig.map,s=a&&N(a,t);if(s&&\"string\"==typeof a[s]){var u=ue(this,e,o.packageConfig,o.packageKey,s,t,n,i);if(u)return u}}var l=Q.call(this,e,t,r,!0,!0),c=de(e,l);if(n.packageKey=c&&c.packageKey||N(e.packages,l),!n.packageKey)return l;if(-1!==e.packageConfigKeys.indexOf(l))return n.packageKey=void 0,l;n.packageConfig=e.packages[n.packageKey]||(e.packages[n.packageKey]=Ee());var f=l.substr(n.packageKey.length+1);return ae(this,e,n.packageConfig,n.packageKey,f,n,i)}function ee(e,t,r,n,o,i){var a=this;return Et.then(function(){if(o&&o.packageConfig&&\"./\"!==t.substr(0,2)){var r=o.packageConfig.map,s=r&&N(r,t);if(s)return ce(a,e,o.packageConfig,o.packageKey,s,t,n,i)}return Et}).then(function(o){if(o)return o;var s=Q.call(a,e,t,r,!0,!0),u=de(e,s);return n.packageKey=u&&u.packageKey||N(e.packages,s),n.packageKey?-1!==e.packageConfigKeys.indexOf(s)?(n.packageKey=void 0,n.load=te(),n.load.format=\"json\",n.load.loader=\"\",Promise.resolve(s)):(n.packageConfig=e.packages[n.packageKey]||(e.packages[n.packageKey]=Ee()),(u&&!n.packageConfig.configured?pe(a,e,u.configPath,n):Et).then(function(){var t=s.substr(n.packageKey.length+1);return le(a,e,n.packageConfig,n.packageKey,t,n,i)})):Promise.resolve(s)})}function te(){return{extension:\"\",deps:void 0,format:void 0,loader:void 0,scriptLoad:void 0,globals:void 0,nonce:void 0,integrity:void 0,sourceMap:void 0,exports:void 0,encapsulateGlobal:!1,crossOrigin:void 0,cjsRequireDetection:!0,cjsDeferDepsExecute:!1,esModule:!1}}function re(e,t,r){r.load=r.load||te();var n,o=0;for(var i in e.meta)if(-1!==(n=i.indexOf(\"*\"))&&i.substr(0,n)===t.substr(0,n)&&i.substr(n+1)===t.substr(t.length-i.length+n+1)){var a=i.split(\"/\").length;a>o&&(o=a),F(r.load,e.meta[i],o!==a)}if(e.meta[t]&&F(r.load,e.meta[t],!1),r.packageKey){var s=t.substr(r.packageKey.length+1),u={};if(r.packageConfig.meta){o=0;ge(r.packageConfig.meta,s,function(e,t,r){r>o&&(o=r),F(u,t,r&&o>r)}),F(r.load,u,!1)}!r.packageConfig.format||r.pluginKey||r.load.loader||(r.load.format=r.load.format||r.packageConfig.format)}}function ne(e,t){var r,n,o=e?t.indexOf(\"!\"):t.lastIndexOf(\"!\");if(-1!==o)return e?(r=t.substr(o+1),n=t.substr(0,o)):(r=t.substr(0,o),n=t.substr(o+1)||r.substr(r.lastIndexOf(\".\")+1)),{argument:r,plugin:n}}function oe(e,t,r){return e?r+\"!\"+t:t+\"!\"+r}function ie(e,t,r,n,o){if(!n||!t.defaultExtension||\"/\"===n[n.length-1]||o)return n;var i=!1;if(t.meta&&ge(t.meta,n,function(e,t,r){if(0===r||e.lastIndexOf(\"*\")!==e.length-1)return i=!0}),!i&&e.meta&&ge(e.meta,r+\"/\"+n,function(e,t,r){if(0===r||e.lastIndexOf(\"*\")!==e.length-1)return i=!0}),i)return n;var a=\".\"+t.defaultExtension;return n.substr(n.length-a.length)!==a?n+a:n}function ae(e,t,r,n,o,i,a){if(!o){if(!r.main)return n;o=\"./\"===r.main.substr(0,2)?r.main.substr(2):r.main}if(r.map){var s=\"./\"+o,u=N(r.map,s);if(u||(s=\"./\"+ie(t,r,n,o,a))!==\"./\"+o&&(u=N(r.map,s)),u){var l=ue(e,t,r,n,u,s,i,a);if(l)return l}}return n+\"/\"+ie(t,r,n,o,a)}function se(e,t,r){return!(t.substr(0,e.length)===e&&r.length>e.length)}function ue(e,t,r,n,o,i,a,s){\"/\"===i[i.length-1]&&(i=i.substr(0,i.length-1));var u=r.map[o];if(\"object\"==typeof u)throw new Error(\"Synchronous conditional normalization not supported sync normalizing \"+o+\" in \"+n);if(se(o,u,i)&&\"string\"==typeof u)return V.call(e,t,u+i.substr(o.length),n+\"/\",a,a,s)}function le(e,t,r,n,o,i,a){if(!o){if(!r.main)return Promise.resolve(n);o=\"./\"===r.main.substr(0,2)?r.main.substr(2):r.main}var s,u;return r.map&&(s=\"./\"+o,(u=N(r.map,s))||(s=\"./\"+ie(t,r,n,o,a))!==\"./\"+o&&(u=N(r.map,s))),(u?ce(e,t,r,n,u,s,i,a):Et).then(function(e){return e?Promise.resolve(e):Promise.resolve(n+\"/\"+ie(t,r,n,o,a))})}function ce(e,t,r,n,o,i,a,s){\"/\"===i[i.length-1]&&(i=i.substr(0,i.length-1));var u=r.map[o];if(\"string\"==typeof u)return se(o,u,i)?ee.call(e,t,u+i.substr(o.length),n+\"/\",a,a,s).then(function(t){return ve.call(e,t,n+\"/\",a)}):Et;var l=[],c=[];for(var d in u){var p=he(d);c.push({condition:p,map:u[d]}),l.push(f.prototype.import.call(e,p.module,n))}return Promise.all(l).then(function(e){for(var t=0;t1?o instanceof Array?r[n]=[].concat(o):\"object\"==typeof o?r[n]=be(o,t-1):\"packageConfig\"!==n&&(r[n]=o):r[n]=o}return r}function we(e,t){var r=e[t];return r instanceof Array?e[t].concat([]):\"object\"==typeof r?be(r,3):e[t]}function xe(e){if(e){if(-1!==Or.indexOf(e))return we(this[St],e);throw new Error('\"'+e+'\" is not a valid configuration name. Must be one of '+Or.join(\", \")+\".\")}for(var t={},r=0;r \"+o.paths[a]+\" is no longer supported as wildcards are deprecated.\"),delete o.paths[a])}if(e.defaultJSExtensions&&R.call(o,\"The defaultJSExtensions configuration option is deprecated.\\n Use packages defaultExtension instead.\",!0),\"boolean\"==typeof e.pluginFirst&&(o.pluginFirst=e.pluginFirst),e.map)for(var a in e.map){var s=e.map[a];if(\"string\"==typeof s){var u=Q.call(r,o,s,void 0,!1,!1);\"/\"===u[u.length-1]&&\":\"!==a[a.length-1]&&\"/\"!==a[a.length-1]&&(u=u.substr(0,u.length-1)),o.map[a]=u}else{m=(m=Q.call(r,o,\"/\"!==a[a.length-1]?a+\"/\":a,void 0,!0,!0)).substr(0,m.length-1);var l=o.packages[m];l||((l=o.packages[m]=Ee()).defaultExtension=\"\"),Oe(l,{map:s},m,!1,o)}}if(e.packageConfigPaths){for(var c=[],f=0;ft.index)return!0;return!1}It.lastIndex=tr.lastIndex=rr.lastIndex=0;var r,n=[],o=[],i=[];if(e.length/e.split(\"\\n\").length<200){for(;r=rr.exec(e);)o.push([r.index,r.index+r[0].length]);for(;r=tr.exec(e);)t(o,r)||i.push([r.index+r[1].length,r.index+r[0].length-1])}for(;r=It.exec(e);)if(!t(o,r)&&!t(i,r)){var a=r[1].substr(1,r[1].length-2);if(a.match(/\"|'/))continue;n.push(a)}return n}function Fe(e){if(-1===nr.indexOf(e)){try{var t=st[e]}catch(t){nr.push(e)}this(e,t)}}function Ke(e){if(\"string\"==typeof e)return q(e,st);if(!(e instanceof Array))throw new Error(\"Global exports must be a string or array.\");for(var t={},r=0;r1;)e=e[n=o.shift()]=e[n]||{};void 0===e[n=o.shift()]&&(e[n]=r)}function Ve(e,t){var r=e.match(br);if(r)for(var n=r[0].match(wr),o=0;o {\n this.events.emit('data-snapshot-load', data);\n });\n }\n\n // // ignore if we have data stream\n if (this.dataStream) {\n return;\n }\n\n // clear loading/error state\n delete this.error;\n this.loading = true;\n\n // load datasource service\n this.setTimeQueryStart();\n this.datasourceSrv\n .get(this.panel.datasource)\n .then(this.updateTimeRange.bind(this))\n .then(this.issueQueries.bind(this))\n .then(this.handleQueryResult.bind(this))\n .catch(err => {\n // if cancelled keep loading set to true\n if (err.cancelled) {\n console.log('Panel request cancelled', err);\n return;\n }\n\n this.loading = false;\n this.error = err.message || 'Request Error';\n this.inspector = { error: err };\n\n if (err.data) {\n if (err.data.message) {\n this.error = err.data.message;\n }\n if (err.data.error) {\n this.error = err.data.error;\n }\n }\n\n this.events.emit('data-error', err);\n console.log('Panel data error:', err);\n });\n }\n\n setTimeQueryStart() {\n this.timing.queryStart = new Date().getTime();\n }\n\n setTimeQueryEnd() {\n this.timing.queryEnd = new Date().getTime();\n }\n\n updateTimeRange(datasource?) {\n this.datasource = datasource || this.datasource;\n this.range = this.timeSrv.timeRange();\n\n this.applyPanelTimeOverrides();\n\n if (this.panel.maxDataPoints) {\n this.resolution = this.panel.maxDataPoints;\n } else {\n this.resolution = Math.ceil($(window).width() * (this.panel.gridPos.w / 24));\n }\n\n this.calculateInterval();\n\n return this.datasource;\n }\n\n calculateInterval() {\n var intervalOverride = this.panel.interval;\n\n // if no panel interval check datasource\n if (intervalOverride) {\n intervalOverride = this.templateSrv.replace(intervalOverride, this.panel.scopedVars);\n } else if (this.datasource && this.datasource.interval) {\n intervalOverride = this.datasource.interval;\n }\n\n var res = kbn.calculateInterval(this.range, this.resolution, intervalOverride);\n this.interval = res.interval;\n this.intervalMs = res.intervalMs;\n }\n\n applyPanelTimeOverrides() {\n this.timeInfo = '';\n\n // check panel time overrrides\n if (this.panel.timeFrom) {\n var timeFromInterpolated = this.templateSrv.replace(this.panel.timeFrom, this.panel.scopedVars);\n var timeFromInfo = rangeUtil.describeTextRange(timeFromInterpolated);\n if (timeFromInfo.invalid) {\n this.timeInfo = 'invalid time override';\n return;\n }\n\n if (_.isString(this.range.raw.from)) {\n var timeFromDate = dateMath.parse(timeFromInfo.from);\n this.timeInfo = timeFromInfo.display;\n this.range.from = timeFromDate;\n this.range.to = dateMath.parse(timeFromInfo.to);\n this.range.raw.from = timeFromInfo.from;\n this.range.raw.to = timeFromInfo.to;\n }\n }\n\n if (this.panel.timeShift) {\n var timeShiftInterpolated = this.templateSrv.replace(this.panel.timeShift, this.panel.scopedVars);\n var timeShiftInfo = rangeUtil.describeTextRange(timeShiftInterpolated);\n if (timeShiftInfo.invalid) {\n this.timeInfo = 'invalid timeshift';\n return;\n }\n\n var timeShift = '-' + timeShiftInterpolated;\n this.timeInfo += ' timeshift ' + timeShift;\n this.range.from = dateMath.parseDateMath(timeShift, this.range.from, false);\n this.range.to = dateMath.parseDateMath(timeShift, this.range.to, true);\n this.range.raw = { from: this.range.from, to: this.range.to };\n }\n\n if (this.panel.hideTimeOverride) {\n this.timeInfo = '';\n }\n }\n\n issueQueries(datasource) {\n this.datasource = datasource;\n\n if (!this.panel.targets || this.panel.targets.length === 0) {\n return this.$q.when([]);\n }\n\n // make shallow copy of scoped vars,\n // and add built in variables interval and interval_ms\n var scopedVars = Object.assign({}, this.panel.scopedVars, {\n __interval: { text: this.interval, value: this.interval },\n __interval_ms: { text: this.intervalMs, value: this.intervalMs },\n });\n\n var metricsQuery = {\n timezone: this.dashboard.getTimezone(),\n panelId: this.panel.id,\n dashboardId: this.dashboard.id,\n range: this.range,\n rangeRaw: this.range.raw,\n interval: this.interval,\n intervalMs: this.intervalMs,\n targets: this.panel.targets,\n maxDataPoints: this.resolution,\n scopedVars: scopedVars,\n cacheTimeout: this.panel.cacheTimeout,\n };\n\n return datasource.query(metricsQuery);\n }\n\n handleQueryResult(result) {\n this.setTimeQueryEnd();\n this.loading = false;\n\n // check for if data source returns subject\n if (result && result.subscribe) {\n this.handleDataStream(result);\n return;\n }\n\n if (this.dashboard.snapshot) {\n this.panel.snapshotData = result.data;\n }\n\n if (!result || !result.data) {\n console.log('Data source query result invalid, missing data field:', result);\n result = { data: [] };\n }\n\n this.events.emit('data-received', result.data);\n }\n\n handleDataStream(stream) {\n // if we already have a connection\n if (this.dataStream) {\n console.log('two stream observables!');\n return;\n }\n\n this.dataStream = stream;\n this.dataSubscription = stream.subscribe({\n next: data => {\n console.log('dataSubject next!');\n if (data.range) {\n this.range = data.range;\n }\n this.events.emit('data-received', data.data);\n },\n error: error => {\n this.events.emit('data-error', error);\n console.log('panel: observer got error');\n },\n complete: () => {\n console.log('panel: observer got complete');\n this.dataStream = null;\n },\n });\n }\n\n setDatasource(datasource) {\n // switching to mixed\n if (datasource.meta.mixed) {\n _.each(this.panel.targets, target => {\n target.datasource = this.panel.datasource;\n if (!target.datasource) {\n target.datasource = config.defaultDatasource;\n }\n });\n } else if (this.datasource && this.datasource.meta.mixed) {\n _.each(this.panel.targets, target => {\n delete target.datasource;\n });\n }\n\n this.panel.datasource = datasource.value;\n this.datasourceName = datasource.name;\n this.datasource = null;\n this.refresh();\n }\n\n getAdditionalMenuItems() {\n const items = [];\n if (config.exploreEnabled && this.contextSrv.isEditor && this.datasource && this.datasource.supportsExplore) {\n items.push({\n text: 'Explore',\n click: 'ctrl.explore();',\n icon: 'fa fa-fw fa-rocket',\n shortcut: 'x',\n });\n }\n return items;\n }\n\n explore() {\n const range = this.timeSrv.timeRangeForUrl();\n const state = {\n ...this.datasource.getExploreState(this.panel),\n range,\n };\n const exploreState = encodePathComponent(JSON.stringify(state));\n this.$location.url(`/explore/${exploreState}`);\n }\n\n addQuery(target) {\n target.refId = this.dashboard.getNextQueryLetter(this.panel);\n\n this.panel.targets.push(target);\n this.nextRefId = this.dashboard.getNextQueryLetter(this.panel);\n }\n\n removeQuery(target) {\n var index = _.indexOf(this.panel.targets, target);\n this.panel.targets.splice(index, 1);\n this.nextRefId = this.dashboard.getNextQueryLetter(this.panel);\n this.refresh();\n }\n\n moveQuery(target, direction) {\n var index = _.indexOf(this.panel.targets, target);\n _.move(this.panel.targets, index, index + direction);\n }\n}\n\nexport { MetricsPanelCtrl };\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/panel/metrics_panel_ctrl.ts","import { DashboardModel } from '../dashboard/dashboard_model';\nimport Remarkable from 'remarkable';\n\nexport class MetricsTabCtrl {\n dsName: string;\n panel: any;\n panelCtrl: any;\n datasources: any[];\n datasourceInstance: any;\n nextRefId: string;\n dashboard: DashboardModel;\n panelDsValue: any;\n addQueryDropdown: any;\n queryTroubleshooterOpen: boolean;\n helpOpen: boolean;\n optionsOpen: boolean;\n hasQueryHelp: boolean;\n helpHtml: string;\n queryOptions: any;\n\n /** @ngInject */\n constructor($scope, private $sce, datasourceSrv, private backendSrv) {\n this.panelCtrl = $scope.ctrl;\n $scope.ctrl = this;\n\n this.panel = this.panelCtrl.panel;\n this.dashboard = this.panelCtrl.dashboard;\n this.datasources = datasourceSrv.getMetricSources();\n this.panelDsValue = this.panelCtrl.panel.datasource;\n\n for (let ds of this.datasources) {\n if (ds.value === this.panelDsValue) {\n this.datasourceInstance = ds;\n }\n }\n\n this.addQueryDropdown = { text: 'Add Query', value: null, fake: true };\n\n // update next ref id\n this.panelCtrl.nextRefId = this.dashboard.getNextQueryLetter(this.panel);\n this.updateDatasourceOptions();\n }\n\n updateDatasourceOptions() {\n if (this.datasourceInstance) {\n this.hasQueryHelp = this.datasourceInstance.meta.hasQueryHelp;\n this.queryOptions = this.datasourceInstance.meta.queryOptions;\n }\n }\n\n getOptions(includeBuiltin) {\n return Promise.resolve(\n this.datasources\n .filter(value => {\n return includeBuiltin || !value.meta.builtIn;\n })\n .map(ds => {\n return { value: ds.value, text: ds.name, datasource: ds };\n })\n );\n }\n\n datasourceChanged(option) {\n if (!option) {\n return;\n }\n\n this.datasourceInstance = option.datasource;\n this.panelCtrl.setDatasource(option.datasource);\n this.updateDatasourceOptions();\n }\n\n addMixedQuery(option) {\n if (!option) {\n return;\n }\n\n this.panelCtrl.addQuery({\n isNew: true,\n datasource: option.datasource.name,\n });\n this.addQueryDropdown = { text: 'Add Query', value: null, fake: true };\n }\n\n addQuery() {\n this.panelCtrl.addQuery({ isNew: true });\n }\n\n toggleHelp() {\n this.optionsOpen = false;\n this.queryTroubleshooterOpen = false;\n this.helpOpen = !this.helpOpen;\n\n this.backendSrv.get(`/api/plugins/${this.datasourceInstance.meta.id}/markdown/query_help`).then(res => {\n var md = new Remarkable();\n this.helpHtml = this.$sce.trustAsHtml(md.render(res));\n });\n }\n\n toggleOptions() {\n this.helpOpen = false;\n this.queryTroubleshooterOpen = false;\n this.optionsOpen = !this.optionsOpen;\n }\n\n toggleQueryTroubleshooter() {\n this.helpOpen = false;\n this.optionsOpen = false;\n this.queryTroubleshooterOpen = !this.queryTroubleshooterOpen;\n }\n}\n\n/** @ngInject **/\nexport function metricsTabDirective() {\n 'use strict';\n return {\n restrict: 'E',\n scope: true,\n templateUrl: 'public/app/features/panel/partials/metrics_tab.html',\n controller: MetricsTabCtrl,\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/panel/metrics_tab.ts","import _ from 'lodash';\nimport { ThresholdMapper } from './threshold_mapper';\nimport { QueryPart } from 'app/core/components/query_part/query_part';\nimport alertDef from './alert_def';\nimport config from 'app/core/config';\nimport appEvents from 'app/core/app_events';\n\nexport class AlertTabCtrl {\n panel: any;\n panelCtrl: any;\n testing: boolean;\n testResult: any;\n subTabIndex: number;\n conditionTypes: any;\n alert: any;\n conditionModels: any;\n evalFunctions: any;\n evalOperators: any;\n noDataModes: any;\n executionErrorModes: any;\n addNotificationSegment;\n notifications;\n alertNotifications;\n error: string;\n appSubUrl: string;\n alertHistory: any;\n\n /** @ngInject */\n constructor(\n private $scope,\n private backendSrv,\n private dashboardSrv,\n private uiSegmentSrv,\n private $q,\n private datasourceSrv\n ) {\n this.panelCtrl = $scope.ctrl;\n this.panel = this.panelCtrl.panel;\n this.$scope.ctrl = this;\n this.subTabIndex = 0;\n this.evalFunctions = alertDef.evalFunctions;\n this.evalOperators = alertDef.evalOperators;\n this.conditionTypes = alertDef.conditionTypes;\n this.noDataModes = alertDef.noDataModes;\n this.executionErrorModes = alertDef.executionErrorModes;\n this.appSubUrl = config.appSubUrl;\n }\n\n $onInit() {\n this.addNotificationSegment = this.uiSegmentSrv.newPlusButton();\n\n // subscribe to graph threshold handle changes\n var thresholdChangedEventHandler = this.graphThresholdChanged.bind(this);\n this.panelCtrl.events.on('threshold-changed', thresholdChangedEventHandler);\n\n // set panel alert edit mode\n this.$scope.$on('$destroy', () => {\n this.panelCtrl.events.off('threshold-changed', thresholdChangedEventHandler);\n this.panelCtrl.editingThresholds = false;\n this.panelCtrl.render();\n });\n\n // build notification model\n this.notifications = [];\n this.alertNotifications = [];\n this.alertHistory = [];\n\n return this.backendSrv.get('/api/alert-notifications').then(res => {\n this.notifications = res;\n\n this.initModel();\n this.validateModel();\n });\n }\n\n getAlertHistory() {\n this.backendSrv\n .get(`/api/annotations?dashboardId=${this.panelCtrl.dashboard.id}&panelId=${this.panel.id}&limit=50&type=alert`)\n .then(res => {\n this.alertHistory = _.map(res, ah => {\n ah.time = this.dashboardSrv.getCurrent().formatDate(ah.time, 'MMM D, YYYY HH:mm:ss');\n ah.stateModel = alertDef.getStateDisplayModel(ah.newState);\n ah.info = alertDef.getAlertAnnotationInfo(ah);\n return ah;\n });\n });\n }\n\n getNotificationIcon(type): string {\n switch (type) {\n case 'email':\n return 'fa fa-envelope';\n case 'slack':\n return 'fa fa-slack';\n case 'victorops':\n return 'fa fa-pagelines';\n case 'webhook':\n return 'fa fa-cubes';\n case 'pagerduty':\n return 'fa fa-bullhorn';\n case 'opsgenie':\n return 'fa fa-bell';\n case 'hipchat':\n return 'fa fa-mail-forward';\n case 'pushover':\n return 'fa fa-mobile';\n case 'kafka':\n return 'fa fa-random';\n case 'teams':\n return 'fa fa-windows';\n }\n return 'fa fa-bell';\n }\n\n getNotifications() {\n return Promise.resolve(\n this.notifications.map(item => {\n return this.uiSegmentSrv.newSegment(item.name);\n })\n );\n }\n\n changeTabIndex(newTabIndex) {\n this.subTabIndex = newTabIndex;\n\n if (this.subTabIndex === 2) {\n this.getAlertHistory();\n }\n }\n\n notificationAdded() {\n var model = _.find(this.notifications, {\n name: this.addNotificationSegment.value,\n });\n if (!model) {\n return;\n }\n\n this.alertNotifications.push({\n name: model.name,\n iconClass: this.getNotificationIcon(model.type),\n isDefault: false,\n });\n this.alert.notifications.push({ id: model.id });\n\n // reset plus button\n this.addNotificationSegment.value = this.uiSegmentSrv.newPlusButton().value;\n this.addNotificationSegment.html = this.uiSegmentSrv.newPlusButton().html;\n }\n\n removeNotification(index) {\n this.alert.notifications.splice(index, 1);\n this.alertNotifications.splice(index, 1);\n }\n\n initModel() {\n var alert = (this.alert = this.panel.alert);\n if (!alert) {\n return;\n }\n\n alert.conditions = alert.conditions || [];\n if (alert.conditions.length === 0) {\n alert.conditions.push(this.buildDefaultCondition());\n }\n\n alert.noDataState = alert.noDataState || 'no_data';\n alert.executionErrorState = alert.executionErrorState || 'alerting';\n alert.frequency = alert.frequency || '60s';\n alert.handler = alert.handler || 1;\n alert.notifications = alert.notifications || [];\n\n var defaultName = this.panel.title + ' alert';\n alert.name = alert.name || defaultName;\n\n this.conditionModels = _.reduce(\n alert.conditions,\n (memo, value) => {\n memo.push(this.buildConditionModel(value));\n return memo;\n },\n []\n );\n\n ThresholdMapper.alertToGraphThresholds(this.panel);\n\n for (let addedNotification of alert.notifications) {\n var model = _.find(this.notifications, { id: addedNotification.id });\n if (model && model.isDefault === false) {\n model.iconClass = this.getNotificationIcon(model.type);\n this.alertNotifications.push(model);\n }\n }\n\n for (let notification of this.notifications) {\n if (notification.isDefault) {\n notification.iconClass = this.getNotificationIcon(notification.type);\n notification.bgColor = '#00678b';\n this.alertNotifications.push(notification);\n }\n }\n\n this.panelCtrl.editingThresholds = true;\n this.panelCtrl.render();\n }\n\n graphThresholdChanged(evt) {\n for (var condition of this.alert.conditions) {\n if (condition.type === 'query') {\n condition.evaluator.params[evt.handleIndex] = evt.threshold.value;\n this.evaluatorParamsChanged();\n break;\n }\n }\n }\n\n buildDefaultCondition() {\n return {\n type: 'query',\n query: { params: ['A', '5m', 'now'] },\n reducer: { type: 'avg', params: [] },\n evaluator: { type: 'gt', params: [null] },\n operator: { type: 'and' },\n };\n }\n\n validateModel() {\n if (!this.alert) {\n return;\n }\n\n let firstTarget;\n let foundTarget = null;\n\n for (var condition of this.alert.conditions) {\n if (condition.type !== 'query') {\n continue;\n }\n\n for (var target of this.panel.targets) {\n if (!firstTarget) {\n firstTarget = target;\n }\n if (condition.query.params[0] === target.refId) {\n foundTarget = target;\n break;\n }\n }\n\n if (!foundTarget) {\n if (firstTarget) {\n condition.query.params[0] = firstTarget.refId;\n foundTarget = firstTarget;\n } else {\n this.error = 'Could not find any metric queries';\n }\n }\n\n var datasourceName = foundTarget.datasource || this.panel.datasource;\n this.datasourceSrv.get(datasourceName).then(ds => {\n if (!ds.meta.alerting) {\n this.error = 'The datasource does not support alerting queries';\n } else if (ds.targetContainsTemplate(foundTarget)) {\n this.error = 'Template variables are not supported in alert queries';\n } else {\n this.error = '';\n }\n });\n }\n }\n\n buildConditionModel(source) {\n var cm: any = { source: source, type: source.type };\n\n cm.queryPart = new QueryPart(source.query, alertDef.alertQueryDef);\n cm.reducerPart = alertDef.createReducerPart(source.reducer);\n cm.evaluator = source.evaluator;\n cm.operator = source.operator;\n\n return cm;\n }\n\n handleQueryPartEvent(conditionModel, evt) {\n switch (evt.name) {\n case 'action-remove-part': {\n break;\n }\n case 'get-part-actions': {\n return this.$q.when([]);\n }\n case 'part-param-changed': {\n this.validateModel();\n }\n case 'get-param-options': {\n var result = this.panel.targets.map(target => {\n return this.uiSegmentSrv.newSegment({ value: target.refId });\n });\n\n return this.$q.when(result);\n }\n }\n }\n\n handleReducerPartEvent(conditionModel, evt) {\n switch (evt.name) {\n case 'action': {\n conditionModel.source.reducer.type = evt.action.value;\n conditionModel.reducerPart = alertDef.createReducerPart(conditionModel.source.reducer);\n break;\n }\n case 'get-part-actions': {\n var result = [];\n for (var type of alertDef.reducerTypes) {\n if (type.value !== conditionModel.source.reducer.type) {\n result.push(type);\n }\n }\n return this.$q.when(result);\n }\n }\n }\n\n addCondition(type) {\n var condition = this.buildDefaultCondition();\n // add to persited model\n this.alert.conditions.push(condition);\n // add to view model\n this.conditionModels.push(this.buildConditionModel(condition));\n }\n\n removeCondition(index) {\n this.alert.conditions.splice(index, 1);\n this.conditionModels.splice(index, 1);\n }\n\n delete() {\n appEvents.emit('confirm-modal', {\n title: 'Delete Alert',\n text: 'Are you sure you want to delete this alert rule?',\n text2: 'You need to save dashboard for the delete to take effect',\n icon: 'fa-trash',\n yesText: 'Delete',\n onConfirm: () => {\n delete this.panel.alert;\n this.alert = null;\n this.panel.thresholds = [];\n this.conditionModels = [];\n this.panelCtrl.alertState = null;\n this.panelCtrl.render();\n },\n });\n }\n\n enable() {\n this.panel.alert = {};\n this.initModel();\n }\n\n evaluatorParamsChanged() {\n ThresholdMapper.alertToGraphThresholds(this.panel);\n this.panelCtrl.render();\n }\n\n evaluatorTypeChanged(evaluator) {\n // ensure params array is correct length\n switch (evaluator.type) {\n case 'lt':\n case 'gt': {\n evaluator.params = [evaluator.params[0]];\n break;\n }\n case 'within_range':\n case 'outside_range': {\n evaluator.params = [evaluator.params[0], evaluator.params[1]];\n break;\n }\n case 'no_value': {\n evaluator.params = [];\n }\n }\n\n this.evaluatorParamsChanged();\n }\n\n clearHistory() {\n appEvents.emit('confirm-modal', {\n title: 'Delete Alert History',\n text: 'Are you sure you want to remove all history & annotations for this alert?',\n icon: 'fa-trash',\n yesText: 'Yes',\n onConfirm: () => {\n this.backendSrv\n .post('/api/annotations/mass-delete', {\n dashboardId: this.panelCtrl.dashboard.id,\n panelId: this.panel.id,\n })\n .then(res => {\n this.alertHistory = [];\n this.panelCtrl.refresh();\n });\n },\n });\n }\n\n test() {\n this.testing = true;\n this.testResult = false;\n\n var payload = {\n dashboard: this.dashboardSrv.getCurrent().getSaveModelClone(),\n panelId: this.panelCtrl.panel.id,\n };\n\n return this.backendSrv.post('/api/alerts/test', payload).then(res => {\n this.testResult = res;\n this.testing = false;\n });\n }\n}\n\n/** @ngInject */\nexport function alertTab() {\n 'use strict';\n return {\n restrict: 'E',\n scope: true,\n templateUrl: 'public/app/features/alerting/partials/alert_tab.html',\n controller: AlertTabCtrl,\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/alerting/alert_tab_ctrl.ts","export class ThresholdMapper {\n static alertToGraphThresholds(panel) {\n for (var i = 0; i < panel.alert.conditions.length; i++) {\n let condition = panel.alert.conditions[i];\n if (condition.type !== 'query') {\n continue;\n }\n\n var evaluator = condition.evaluator;\n var thresholds = (panel.thresholds = []);\n\n switch (evaluator.type) {\n case 'gt': {\n let value = evaluator.params[0];\n thresholds.push({ value: value, op: 'gt' });\n break;\n }\n case 'lt': {\n let value = evaluator.params[0];\n thresholds.push({ value: value, op: 'lt' });\n break;\n }\n case 'outside_range': {\n let value1 = evaluator.params[0];\n let value2 = evaluator.params[1];\n\n if (value1 > value2) {\n thresholds.push({ value: value1, op: 'gt' });\n thresholds.push({ value: value2, op: 'lt' });\n } else {\n thresholds.push({ value: value1, op: 'lt' });\n thresholds.push({ value: value2, op: 'gt' });\n }\n\n break;\n }\n case 'within_range': {\n let value1 = evaluator.params[0];\n let value2 = evaluator.params[1];\n\n if (value1 > value2) {\n thresholds.push({ value: value1, op: 'lt' });\n thresholds.push({ value: value2, op: 'gt' });\n } else {\n thresholds.push({ value: value1, op: 'gt' });\n thresholds.push({ value: value2, op: 'lt' });\n }\n break;\n }\n }\n break;\n }\n\n for (var t of panel.thresholds) {\n t.fill = true;\n t.line = true;\n t.colorMode = 'critical';\n }\n\n var updated = true;\n return updated;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/alerting/threshold_mapper.ts","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar formatRegExp = /%[sdj%]/g;\nexports.format = function(f) {\n if (!isString(f)) {\n var objects = [];\n for (var i = 0; i < arguments.length; i++) {\n objects.push(inspect(arguments[i]));\n }\n return objects.join(' ');\n }\n\n var i = 1;\n var args = arguments;\n var len = args.length;\n var str = String(f).replace(formatRegExp, function(x) {\n if (x === '%%') return '%';\n if (i >= len) return x;\n switch (x) {\n case '%s': return String(args[i++]);\n case '%d': return Number(args[i++]);\n case '%j':\n try {\n return JSON.stringify(args[i++]);\n } catch (_) {\n return '[Circular]';\n }\n default:\n return x;\n }\n });\n for (var x = args[i]; i < len; x = args[++i]) {\n if (isNull(x) || !isObject(x)) {\n str += ' ' + x;\n } else {\n str += ' ' + inspect(x);\n }\n }\n return str;\n};\n\n\n// Mark that a method should not be used.\n// Returns a modified function which warns once by default.\n// If --no-deprecation is set, then it is a no-op.\nexports.deprecate = function(fn, msg) {\n // Allow for deprecating things in the process of starting up.\n if (isUndefined(global.process)) {\n return function() {\n return exports.deprecate(fn, msg).apply(this, arguments);\n };\n }\n\n if (process.noDeprecation === true) {\n return fn;\n }\n\n var warned = false;\n function deprecated() {\n if (!warned) {\n if (process.throwDeprecation) {\n throw new Error(msg);\n } else if (process.traceDeprecation) {\n console.trace(msg);\n } else {\n console.error(msg);\n }\n warned = true;\n }\n return fn.apply(this, arguments);\n }\n\n return deprecated;\n};\n\n\nvar debugs = {};\nvar debugEnviron;\nexports.debuglog = function(set) {\n if (isUndefined(debugEnviron))\n debugEnviron = process.env.NODE_DEBUG || '';\n set = set.toUpperCase();\n if (!debugs[set]) {\n if (new RegExp('\\\\b' + set + '\\\\b', 'i').test(debugEnviron)) {\n var pid = process.pid;\n debugs[set] = function() {\n var msg = exports.format.apply(exports, arguments);\n console.error('%s %d: %s', set, pid, msg);\n };\n } else {\n debugs[set] = function() {};\n }\n }\n return debugs[set];\n};\n\n\n/**\n * Echos the value of a value. Trys to print the value out\n * in the best way possible given the different types.\n *\n * @param {Object} obj The object to print out.\n * @param {Object} opts Optional options object that alters the output.\n */\n/* legacy: obj, showHidden, depth, colors*/\nfunction inspect(obj, opts) {\n // default options\n var ctx = {\n seen: [],\n stylize: stylizeNoColor\n };\n // legacy...\n if (arguments.length >= 3) ctx.depth = arguments[2];\n if (arguments.length >= 4) ctx.colors = arguments[3];\n if (isBoolean(opts)) {\n // legacy...\n ctx.showHidden = opts;\n } else if (opts) {\n // got an \"options\" object\n exports._extend(ctx, opts);\n }\n // set default options\n if (isUndefined(ctx.showHidden)) ctx.showHidden = false;\n if (isUndefined(ctx.depth)) ctx.depth = 2;\n if (isUndefined(ctx.colors)) ctx.colors = false;\n if (isUndefined(ctx.customInspect)) ctx.customInspect = true;\n if (ctx.colors) ctx.stylize = stylizeWithColor;\n return formatValue(ctx, obj, ctx.depth);\n}\nexports.inspect = inspect;\n\n\n// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics\ninspect.colors = {\n 'bold' : [1, 22],\n 'italic' : [3, 23],\n 'underline' : [4, 24],\n 'inverse' : [7, 27],\n 'white' : [37, 39],\n 'grey' : [90, 39],\n 'black' : [30, 39],\n 'blue' : [34, 39],\n 'cyan' : [36, 39],\n 'green' : [32, 39],\n 'magenta' : [35, 39],\n 'red' : [31, 39],\n 'yellow' : [33, 39]\n};\n\n// Don't use 'blue' not visible on cmd.exe\ninspect.styles = {\n 'special': 'cyan',\n 'number': 'yellow',\n 'boolean': 'yellow',\n 'undefined': 'grey',\n 'null': 'bold',\n 'string': 'green',\n 'date': 'magenta',\n // \"name\": intentionally not styling\n 'regexp': 'red'\n};\n\n\nfunction stylizeWithColor(str, styleType) {\n var style = inspect.styles[styleType];\n\n if (style) {\n return '\\u001b[' + inspect.colors[style][0] + 'm' + str +\n '\\u001b[' + inspect.colors[style][1] + 'm';\n } else {\n return str;\n }\n}\n\n\nfunction stylizeNoColor(str, styleType) {\n return str;\n}\n\n\nfunction arrayToHash(array) {\n var hash = {};\n\n array.forEach(function(val, idx) {\n hash[val] = true;\n });\n\n return hash;\n}\n\n\nfunction formatValue(ctx, value, recurseTimes) {\n // Provide a hook for user-specified inspect functions.\n // Check that value is an object with an inspect function on it\n if (ctx.customInspect &&\n value &&\n isFunction(value.inspect) &&\n // Filter out the util module, it's inspect function is special\n value.inspect !== exports.inspect &&\n // Also filter out any prototype objects using the circular check.\n !(value.constructor && value.constructor.prototype === value)) {\n var ret = value.inspect(recurseTimes, ctx);\n if (!isString(ret)) {\n ret = formatValue(ctx, ret, recurseTimes);\n }\n return ret;\n }\n\n // Primitive types cannot have properties\n var primitive = formatPrimitive(ctx, value);\n if (primitive) {\n return primitive;\n }\n\n // Look up the keys of the object.\n var keys = Object.keys(value);\n var visibleKeys = arrayToHash(keys);\n\n if (ctx.showHidden) {\n keys = Object.getOwnPropertyNames(value);\n }\n\n // IE doesn't make error fields non-enumerable\n // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx\n if (isError(value)\n && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {\n return formatError(value);\n }\n\n // Some type of object without properties can be shortcutted.\n if (keys.length === 0) {\n if (isFunction(value)) {\n var name = value.name ? ': ' + value.name : '';\n return ctx.stylize('[Function' + name + ']', 'special');\n }\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n }\n if (isDate(value)) {\n return ctx.stylize(Date.prototype.toString.call(value), 'date');\n }\n if (isError(value)) {\n return formatError(value);\n }\n }\n\n var base = '', array = false, braces = ['{', '}'];\n\n // Make Array say that they are Array\n if (isArray(value)) {\n array = true;\n braces = ['[', ']'];\n }\n\n // Make functions say that they are functions\n if (isFunction(value)) {\n var n = value.name ? ': ' + value.name : '';\n base = ' [Function' + n + ']';\n }\n\n // Make RegExps say that they are RegExps\n if (isRegExp(value)) {\n base = ' ' + RegExp.prototype.toString.call(value);\n }\n\n // Make dates with properties first say the date\n if (isDate(value)) {\n base = ' ' + Date.prototype.toUTCString.call(value);\n }\n\n // Make error with message first say the error\n if (isError(value)) {\n base = ' ' + formatError(value);\n }\n\n if (keys.length === 0 && (!array || value.length == 0)) {\n return braces[0] + base + braces[1];\n }\n\n if (recurseTimes < 0) {\n if (isRegExp(value)) {\n return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');\n } else {\n return ctx.stylize('[Object]', 'special');\n }\n }\n\n ctx.seen.push(value);\n\n var output;\n if (array) {\n output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);\n } else {\n output = keys.map(function(key) {\n return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);\n });\n }\n\n ctx.seen.pop();\n\n return reduceToSingleString(output, base, braces);\n}\n\n\nfunction formatPrimitive(ctx, value) {\n if (isUndefined(value))\n return ctx.stylize('undefined', 'undefined');\n if (isString(value)) {\n var simple = '\\'' + JSON.stringify(value).replace(/^\"|\"$/g, '')\n .replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"') + '\\'';\n return ctx.stylize(simple, 'string');\n }\n if (isNumber(value))\n return ctx.stylize('' + value, 'number');\n if (isBoolean(value))\n return ctx.stylize('' + value, 'boolean');\n // For some reason typeof null is \"object\", so special case here.\n if (isNull(value))\n return ctx.stylize('null', 'null');\n}\n\n\nfunction formatError(value) {\n return '[' + Error.prototype.toString.call(value) + ']';\n}\n\n\nfunction formatArray(ctx, value, recurseTimes, visibleKeys, keys) {\n var output = [];\n for (var i = 0, l = value.length; i < l; ++i) {\n if (hasOwnProperty(value, String(i))) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n String(i), true));\n } else {\n output.push('');\n }\n }\n keys.forEach(function(key) {\n if (!key.match(/^\\d+$/)) {\n output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,\n key, true));\n }\n });\n return output;\n}\n\n\nfunction formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {\n var name, str, desc;\n desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };\n if (desc.get) {\n if (desc.set) {\n str = ctx.stylize('[Getter/Setter]', 'special');\n } else {\n str = ctx.stylize('[Getter]', 'special');\n }\n } else {\n if (desc.set) {\n str = ctx.stylize('[Setter]', 'special');\n }\n }\n if (!hasOwnProperty(visibleKeys, key)) {\n name = '[' + key + ']';\n }\n if (!str) {\n if (ctx.seen.indexOf(desc.value) < 0) {\n if (isNull(recurseTimes)) {\n str = formatValue(ctx, desc.value, null);\n } else {\n str = formatValue(ctx, desc.value, recurseTimes - 1);\n }\n if (str.indexOf('\\n') > -1) {\n if (array) {\n str = str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n').substr(2);\n } else {\n str = '\\n' + str.split('\\n').map(function(line) {\n return ' ' + line;\n }).join('\\n');\n }\n }\n } else {\n str = ctx.stylize('[Circular]', 'special');\n }\n }\n if (isUndefined(name)) {\n if (array && key.match(/^\\d+$/)) {\n return str;\n }\n name = JSON.stringify('' + key);\n if (name.match(/^\"([a-zA-Z_][a-zA-Z_0-9]*)\"$/)) {\n name = name.substr(1, name.length - 2);\n name = ctx.stylize(name, 'name');\n } else {\n name = name.replace(/'/g, \"\\\\'\")\n .replace(/\\\\\"/g, '\"')\n .replace(/(^\"|\"$)/g, \"'\");\n name = ctx.stylize(name, 'string');\n }\n }\n\n return name + ': ' + str;\n}\n\n\nfunction reduceToSingleString(output, base, braces) {\n var numLinesEst = 0;\n var length = output.reduce(function(prev, cur) {\n numLinesEst++;\n if (cur.indexOf('\\n') >= 0) numLinesEst++;\n return prev + cur.replace(/\\u001b\\[\\d\\d?m/g, '').length + 1;\n }, 0);\n\n if (length > 60) {\n return braces[0] +\n (base === '' ? '' : base + '\\n ') +\n ' ' +\n output.join(',\\n ') +\n ' ' +\n braces[1];\n }\n\n return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];\n}\n\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\nfunction isArray(ar) {\n return Array.isArray(ar);\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return isObject(re) && objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return isObject(d) && objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return isObject(e) &&\n (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = require('./support/isBuffer');\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n\n\nfunction pad(n) {\n return n < 10 ? '0' + n.toString(10) : n.toString(10);\n}\n\n\nvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',\n 'Oct', 'Nov', 'Dec'];\n\n// 26 Feb 16:19:34\nfunction timestamp() {\n var d = new Date();\n var time = [pad(d.getHours()),\n pad(d.getMinutes()),\n pad(d.getSeconds())].join(':');\n return [d.getDate(), months[d.getMonth()], time].join(' ');\n}\n\n\n// log is just a thin wrapper to console.log that prepends a timestamp\nexports.log = function() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n};\n\n\n/**\n * Inherit the prototype methods from one constructor into another.\n *\n * The Function.prototype.inherits from lang.js rewritten as a standalone\n * function (not on Function.prototype). NOTE: If this file is to be loaded\n * during bootstrapping this function needs to be rewritten using some native\n * functions as prototype setup using normal JavaScript does not work as\n * expected during bootstrapping (see mirror.js in r114903).\n *\n * @param {function} ctor Constructor function which needs to inherit the\n * prototype.\n * @param {function} superCtor Constructor function to inherit prototype from.\n */\nexports.inherits = require('inherits');\n\nexports._extend = function(origin, add) {\n // Don't do anything if add isn't an object\n if (!add || !isObject(add)) return origin;\n\n var keys = Object.keys(add);\n var i = keys.length;\n while (i--) {\n origin[keys[i]] = add[keys[i]];\n }\n return origin;\n};\n\nfunction hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/util/util.js\n// module id = 2074\n// module chunks = 0","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/inherits/inherits_browser.js\n// module id = 2076\n// module chunks = 0","import * as graphitePlugin from 'app/plugins/datasource/graphite/module';\nimport * as cloudwatchPlugin from 'app/plugins/datasource/cloudwatch/module';\nimport * as elasticsearchPlugin from 'app/plugins/datasource/elasticsearch/module';\nimport * as opentsdbPlugin from 'app/plugins/datasource/opentsdb/module';\nimport * as grafanaPlugin from 'app/plugins/datasource/grafana/module';\nimport * as influxdbPlugin from 'app/plugins/datasource/influxdb/module';\nimport * as mixedPlugin from 'app/plugins/datasource/mixed/module';\nimport * as mysqlPlugin from 'app/plugins/datasource/mysql/module';\nimport * as postgresPlugin from 'app/plugins/datasource/postgres/module';\nimport * as prometheusPlugin from 'app/plugins/datasource/prometheus/module';\nimport * as mssqlPlugin from 'app/plugins/datasource/mssql/module';\n\nimport * as textPanel from 'app/plugins/panel/text/module';\nimport * as graphPanel from 'app/plugins/panel/graph/module';\nimport * as sensorPanel from 'app/plugins/panel/sensor/module';\nimport * as dashListPanel from 'app/plugins/panel/dashlist/module';\nimport * as pluginsListPanel from 'app/plugins/panel/pluginlist/module';\nimport * as alertListPanel from 'app/plugins/panel/alertlist/module';\nimport * as heatmapPanel from 'app/plugins/panel/heatmap/module';\nimport * as tablePanel from 'app/plugins/panel/table/module';\nimport * as singlestatPanel from 'app/plugins/panel/singlestat/module';\nimport * as gettingStartedPanel from 'app/plugins/panel/gettingstarted/module';\n\nimport * as experimentDetailsPanel from 'app/plugins/panel/experimentdetails/module';\nimport * as experimentVideoPanel from 'app/plugins/panel/experimentvideo/module';\n\nimport * as testDataAppPlugin from 'app/plugins/app/testdata/module';\nimport * as testDataDSPlugin from 'app/plugins/app/testdata/datasource/module';\n\nconst builtInPlugins = {\n 'app/plugins/datasource/graphite/module': graphitePlugin,\n 'app/plugins/datasource/cloudwatch/module': cloudwatchPlugin,\n 'app/plugins/datasource/elasticsearch/module': elasticsearchPlugin,\n 'app/plugins/datasource/opentsdb/module': opentsdbPlugin,\n 'app/plugins/datasource/grafana/module': grafanaPlugin,\n 'app/plugins/datasource/influxdb/module': influxdbPlugin,\n 'app/plugins/datasource/mixed/module': mixedPlugin,\n 'app/plugins/datasource/mysql/module': mysqlPlugin,\n 'app/plugins/datasource/postgres/module': postgresPlugin,\n 'app/plugins/datasource/mssql/module': mssqlPlugin,\n 'app/plugins/datasource/prometheus/module': prometheusPlugin,\n 'app/plugins/app/testdata/module': testDataAppPlugin,\n 'app/plugins/app/testdata/datasource/module': testDataDSPlugin,\n\n 'app/plugins/panel/text/module': textPanel,\n 'app/plugins/panel/graph/module': graphPanel,\n 'app/plugins/panel/sensor/module': sensorPanel,\n 'app/plugins/panel/dashlist/module': dashListPanel,\n 'app/plugins/panel/pluginlist/module': pluginsListPanel,\n 'app/plugins/panel/alertlist/module': alertListPanel,\n 'app/plugins/panel/heatmap/module': heatmapPanel,\n 'app/plugins/panel/table/module': tablePanel,\n 'app/plugins/panel/singlestat/module': singlestatPanel,\n 'app/plugins/panel/gettingstarted/module': gettingStartedPanel,\n\n 'app/plugins/panel/experimentdetails/module': experimentDetailsPanel,\n 'app/plugins/panel/experimentvideo/module': experimentVideoPanel,\n};\n\nexport default builtInPlugins;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/plugins/built_in_plugins.ts","import { GraphiteDatasource } from './datasource';\nimport { GraphiteQueryCtrl } from './query_ctrl';\nimport { GraphiteConfigCtrl } from './config_ctrl';\n\nclass AnnotationsQueryCtrl {\n static templateUrl = 'partials/annotations.editor.html';\n}\n\nexport {\n GraphiteDatasource as Datasource,\n GraphiteQueryCtrl as QueryCtrl,\n GraphiteConfigCtrl as ConfigCtrl,\n AnnotationsQueryCtrl,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/graphite/module.ts","import _ from 'lodash';\nimport * as dateMath from 'app/core/utils/datemath';\nimport { isVersionGtOrEq, SemVersion } from 'app/core/utils/version';\nimport gfunc from './gfunc';\n\n/** @ngInject */\nexport function GraphiteDatasource(instanceSettings, $q, backendSrv, templateSrv) {\n this.basicAuth = instanceSettings.basicAuth;\n this.url = instanceSettings.url;\n this.name = instanceSettings.name;\n this.graphiteVersion = instanceSettings.jsonData.graphiteVersion || '0.9';\n this.supportsTags = supportsTags(this.graphiteVersion);\n this.cacheTimeout = instanceSettings.cacheTimeout;\n this.withCredentials = instanceSettings.withCredentials;\n this.render_method = instanceSettings.render_method || 'POST';\n this.funcDefs = null;\n this.funcDefsPromise = null;\n\n this.getQueryOptionsInfo = function() {\n return {\n maxDataPoints: true,\n cacheTimeout: true,\n links: [\n {\n text: 'Help',\n url: 'http://docs.grafana.org/features/datasources/graphite/#using-graphite-in-grafana',\n },\n ],\n };\n };\n\n this.query = function(options) {\n var graphOptions = {\n from: this.translateTime(options.rangeRaw.from, false),\n until: this.translateTime(options.rangeRaw.to, true),\n targets: options.targets,\n format: options.format,\n cacheTimeout: options.cacheTimeout || this.cacheTimeout,\n maxDataPoints: options.maxDataPoints,\n };\n\n var params = this.buildGraphiteParams(graphOptions, options.scopedVars);\n if (params.length === 0) {\n return $q.when({ data: [] });\n }\n\n var httpOptions: any = {\n method: 'POST',\n url: '/render',\n data: params.join('&'),\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n };\n\n this.addTracingHeaders(httpOptions, options);\n\n if (options.panelId) {\n httpOptions.requestId = this.name + '.panelId.' + options.panelId;\n }\n\n return this.doGraphiteRequest(httpOptions).then(this.convertDataPointsToMs);\n };\n\n this.addTracingHeaders = function(httpOptions, options) {\n var proxyMode = !this.url.match(/^http/);\n if (proxyMode) {\n httpOptions.headers['X-Dashboard-Id'] = options.dashboardId;\n httpOptions.headers['X-Panel-Id'] = options.panelId;\n }\n };\n\n this.convertDataPointsToMs = function(result) {\n if (!result || !result.data) {\n return [];\n }\n for (var i = 0; i < result.data.length; i++) {\n var series = result.data[i];\n for (var y = 0; y < series.datapoints.length; y++) {\n series.datapoints[y][1] *= 1000;\n }\n }\n return result;\n };\n\n this.parseTags = function(tagString) {\n let tags = [];\n tags = tagString.split(',');\n if (tags.length === 1) {\n tags = tagString.split(' ');\n if (tags[0] === '') {\n tags = [];\n }\n }\n return tags;\n };\n\n this.annotationQuery = function(options) {\n // Graphite metric as annotation\n if (options.annotation.target) {\n var target = templateSrv.replace(options.annotation.target, {}, 'glob');\n var graphiteQuery = {\n rangeRaw: options.rangeRaw,\n targets: [{ target: target }],\n format: 'json',\n maxDataPoints: 100,\n };\n\n return this.query(graphiteQuery).then(function(result) {\n var list = [];\n\n for (var i = 0; i < result.data.length; i++) {\n var target = result.data[i];\n\n for (var y = 0; y < target.datapoints.length; y++) {\n var datapoint = target.datapoints[y];\n if (!datapoint[0]) {\n continue;\n }\n\n list.push({\n annotation: options.annotation,\n time: datapoint[1],\n title: target.target,\n });\n }\n }\n\n return list;\n });\n } else {\n // Graphite event as annotation\n var tags = templateSrv.replace(options.annotation.tags);\n return this.events({ range: options.rangeRaw, tags: tags }).then(results => {\n var list = [];\n for (var i = 0; i < results.data.length; i++) {\n var e = results.data[i];\n\n var tags = e.tags;\n if (_.isString(e.tags)) {\n tags = this.parseTags(e.tags);\n }\n\n list.push({\n annotation: options.annotation,\n time: e.when * 1000,\n title: e.what,\n tags: tags,\n text: e.data,\n });\n }\n\n return list;\n });\n }\n };\n\n this.events = function(options) {\n try {\n var tags = '';\n if (options.tags) {\n tags = '&tags=' + options.tags;\n }\n return this.doGraphiteRequest({\n method: 'GET',\n url:\n '/events/get_data?from=' +\n this.translateTime(options.range.from, false) +\n '&until=' +\n this.translateTime(options.range.to, true) +\n tags,\n });\n } catch (err) {\n return $q.reject(err);\n }\n };\n\n this.targetContainsTemplate = function(target) {\n return templateSrv.variableExists(target.target);\n };\n\n this.translateTime = function(date, roundUp) {\n if (_.isString(date)) {\n if (date === 'now') {\n return 'now';\n } else if (date.indexOf('now-') >= 0 && date.indexOf('/') === -1) {\n date = date.substring(3);\n date = date.replace('m', 'min');\n date = date.replace('M', 'mon');\n return date;\n }\n date = dateMath.parse(date, roundUp);\n }\n\n // graphite' s from filter is exclusive\n // here we step back one minute in order\n // to guarantee that we get all the data that\n // exists for the specified range\n if (roundUp) {\n if (date.get('s')) {\n date.add(1, 'm');\n }\n } else if (roundUp === false) {\n if (date.get('s')) {\n date.subtract(1, 'm');\n }\n }\n\n return date.unix();\n };\n\n this.metricFindQuery = function(query, optionalOptions) {\n let options = optionalOptions || {};\n let interpolatedQuery = templateSrv.replace(query);\n\n // special handling for tag_values([,]*), this is used for template variables\n let matches = interpolatedQuery.match(/^tag_values\\(([^,]+)((, *[^,]+)*)\\)$/);\n if (matches) {\n const expressions = [];\n const exprRegex = /, *([^,]+)/g;\n let match;\n while ((match = exprRegex.exec(matches[2])) !== null) {\n expressions.push(match[1]);\n }\n options.limit = 10000;\n return this.getTagValuesAutoComplete(expressions, matches[1], undefined, options);\n }\n\n // special handling for tags([,]*), this is used for template variables\n matches = interpolatedQuery.match(/^tags\\(([^,]*)((, *[^,]+)*)\\)$/);\n if (matches) {\n const expressions = [];\n if (matches[1]) {\n expressions.push(matches[1]);\n const exprRegex = /, *([^,]+)/g;\n let match;\n while ((match = exprRegex.exec(matches[2])) !== null) {\n expressions.push(match[1]);\n }\n }\n options.limit = 10000;\n return this.getTagsAutoComplete(expressions, undefined, options);\n }\n\n let httpOptions: any = {\n method: 'GET',\n url: '/metrics/find',\n params: {\n query: interpolatedQuery,\n },\n // for cancellations\n requestId: options.requestId,\n };\n\n if (options.range) {\n httpOptions.params.from = this.translateTime(options.range.from, false);\n httpOptions.params.until = this.translateTime(options.range.to, true);\n }\n\n return this.doGraphiteRequest(httpOptions).then(results => {\n return _.map(results.data, metric => {\n return {\n text: metric.text,\n expandable: metric.expandable ? true : false,\n };\n });\n });\n };\n\n this.getTags = function(optionalOptions) {\n let options = optionalOptions || {};\n\n let httpOptions: any = {\n method: 'GET',\n url: '/tags',\n // for cancellations\n requestId: options.requestId,\n };\n\n if (options.range) {\n httpOptions.params.from = this.translateTime(options.range.from, false);\n httpOptions.params.until = this.translateTime(options.range.to, true);\n }\n\n return this.doGraphiteRequest(httpOptions).then(results => {\n return _.map(results.data, tag => {\n return {\n text: tag.tag,\n id: tag.id,\n };\n });\n });\n };\n\n this.getTagValues = function(tag, optionalOptions) {\n let options = optionalOptions || {};\n\n let httpOptions: any = {\n method: 'GET',\n url: '/tags/' + templateSrv.replace(tag),\n // for cancellations\n requestId: options.requestId,\n };\n\n if (options.range) {\n httpOptions.params.from = this.translateTime(options.range.from, false);\n httpOptions.params.until = this.translateTime(options.range.to, true);\n }\n\n return this.doGraphiteRequest(httpOptions).then(results => {\n if (results.data && results.data.values) {\n return _.map(results.data.values, value => {\n return {\n text: value.value,\n id: value.id,\n };\n });\n } else {\n return [];\n }\n });\n };\n\n this.getTagsAutoComplete = (expressions, tagPrefix, optionalOptions) => {\n let options = optionalOptions || {};\n\n let httpOptions: any = {\n method: 'GET',\n url: '/tags/autoComplete/tags',\n params: {\n expr: _.map(expressions, expression => templateSrv.replace((expression || '').trim())),\n },\n // for cancellations\n requestId: options.requestId,\n };\n\n if (tagPrefix) {\n httpOptions.params.tagPrefix = tagPrefix;\n }\n if (options.limit) {\n httpOptions.params.limit = options.limit;\n }\n if (options.range) {\n httpOptions.params.from = this.translateTime(options.range.from, false);\n httpOptions.params.until = this.translateTime(options.range.to, true);\n }\n\n return this.doGraphiteRequest(httpOptions).then(results => {\n if (results.data) {\n return _.map(results.data, tag => {\n return { text: tag };\n });\n } else {\n return [];\n }\n });\n };\n\n this.getTagValuesAutoComplete = (expressions, tag, valuePrefix, optionalOptions) => {\n let options = optionalOptions || {};\n\n let httpOptions: any = {\n method: 'GET',\n url: '/tags/autoComplete/values',\n params: {\n expr: _.map(expressions, expression => templateSrv.replace((expression || '').trim())),\n tag: templateSrv.replace((tag || '').trim()),\n },\n // for cancellations\n requestId: options.requestId,\n };\n\n if (valuePrefix) {\n httpOptions.params.valuePrefix = valuePrefix;\n }\n if (options.limit) {\n httpOptions.params.limit = options.limit;\n }\n if (options.range) {\n httpOptions.params.from = this.translateTime(options.range.from, false);\n httpOptions.params.until = this.translateTime(options.range.to, true);\n }\n\n return this.doGraphiteRequest(httpOptions).then(results => {\n if (results.data) {\n return _.map(results.data, value => {\n return { text: value };\n });\n } else {\n return [];\n }\n });\n };\n\n this.getVersion = function(optionalOptions) {\n let options = optionalOptions || {};\n\n let httpOptions = {\n method: 'GET',\n url: '/version',\n requestId: options.requestId,\n };\n\n return this.doGraphiteRequest(httpOptions)\n .then(results => {\n if (results.data) {\n let semver = new SemVersion(results.data);\n return semver.isValid() ? results.data : '';\n }\n return '';\n })\n .catch(() => {\n return '';\n });\n };\n\n this.createFuncInstance = function(funcDef, options?) {\n return gfunc.createFuncInstance(funcDef, options, this.funcDefs);\n };\n\n this.getFuncDef = function(name) {\n return gfunc.getFuncDef(name, this.funcDefs);\n };\n\n this.waitForFuncDefsLoaded = function() {\n return this.getFuncDefs();\n };\n\n this.getFuncDefs = function() {\n if (this.funcDefsPromise !== null) {\n return this.funcDefsPromise;\n }\n\n if (!supportsFunctionIndex(this.graphiteVersion)) {\n this.funcDefs = gfunc.getFuncDefs(this.graphiteVersion);\n this.funcDefsPromise = Promise.resolve(this.funcDefs);\n return this.funcDefsPromise;\n }\n\n let httpOptions = {\n method: 'GET',\n url: '/functions',\n };\n\n this.funcDefsPromise = this.doGraphiteRequest(httpOptions)\n .then(results => {\n if (results.status !== 200 || typeof results.data !== 'object') {\n this.funcDefs = gfunc.getFuncDefs(this.graphiteVersion);\n } else {\n this.funcDefs = gfunc.parseFuncDefs(results.data);\n }\n return this.funcDefs;\n })\n .catch(err => {\n console.log('Fetching graphite functions error', err);\n this.funcDefs = gfunc.getFuncDefs(this.graphiteVersion);\n return this.funcDefs;\n });\n\n return this.funcDefsPromise;\n };\n\n this.testDatasource = function() {\n let query = {\n panelId: 3,\n rangeRaw: { from: 'now-1h', to: 'now' },\n targets: [{ target: 'constantLine(100)' }],\n maxDataPoints: 300,\n };\n return this.query(query).then(function() {\n return { status: 'success', message: 'Data source is working' };\n });\n };\n\n this.doGraphiteRequest = function(options) {\n if (this.basicAuth || this.withCredentials) {\n options.withCredentials = true;\n }\n if (this.basicAuth) {\n options.headers = options.headers || {};\n options.headers.Authorization = this.basicAuth;\n }\n\n options.url = this.url + options.url;\n options.inspect = { type: 'graphite' };\n\n return backendSrv.datasourceRequest(options);\n };\n\n this._seriesRefLetters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\n this.buildGraphiteParams = function(options, scopedVars) {\n var graphite_options = ['from', 'until', 'rawData', 'format', 'maxDataPoints', 'cacheTimeout'];\n var clean_options = [],\n targets = {};\n var target, targetValue, i;\n var regex = /\\#([A-Z])/g;\n var intervalFormatFixRegex = /'(\\d+)m'/gi;\n var hasTargets = false;\n\n options['format'] = 'json';\n\n function fixIntervalFormat(match) {\n return match.replace('m', 'min').replace('M', 'mon');\n }\n\n for (i = 0; i < options.targets.length; i++) {\n target = options.targets[i];\n if (!target.target) {\n continue;\n }\n\n if (!target.refId) {\n target.refId = this._seriesRefLetters[i];\n }\n\n targetValue = templateSrv.replace(target.target, scopedVars);\n targetValue = targetValue.replace(intervalFormatFixRegex, fixIntervalFormat);\n targets[target.refId] = targetValue;\n }\n\n function nestedSeriesRegexReplacer(match, g1) {\n return targets[g1] || match;\n }\n\n for (i = 0; i < options.targets.length; i++) {\n target = options.targets[i];\n if (!target.target) {\n continue;\n }\n\n targetValue = targets[target.refId];\n targetValue = targetValue.replace(regex, nestedSeriesRegexReplacer);\n targets[target.refId] = targetValue;\n\n if (!target.hide) {\n hasTargets = true;\n clean_options.push('target=' + encodeURIComponent(targetValue));\n }\n }\n\n _.each(options, function(value, key) {\n if (_.indexOf(graphite_options, key) === -1) {\n return;\n }\n if (value) {\n clean_options.push(key + '=' + encodeURIComponent(value));\n }\n });\n\n if (!hasTargets) {\n return [];\n }\n\n return clean_options;\n };\n}\n\nfunction supportsTags(version: string): boolean {\n return isVersionGtOrEq(version, '1.1');\n}\n\nfunction supportsFunctionIndex(version: string): boolean {\n return isVersionGtOrEq(version, '1.1');\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/graphite/datasource.ts","import _ from 'lodash';\nimport { isVersionGtOrEq } from 'app/core/utils/version';\n\nvar index = {};\n\nfunction addFuncDef(funcDef) {\n funcDef.params = funcDef.params || [];\n funcDef.defaultParams = funcDef.defaultParams || [];\n\n index[funcDef.name] = funcDef;\n if (funcDef.shortName) {\n index[funcDef.shortName] = funcDef;\n }\n}\n\nvar optionalSeriesRefArgs = [{ name: 'other', type: 'value_or_series', optional: true, multiple: true }];\n\naddFuncDef({\n name: 'scaleToSeconds',\n category: 'Transform',\n params: [{ name: 'seconds', type: 'int' }],\n defaultParams: [1],\n});\n\naddFuncDef({\n name: 'perSecond',\n category: 'Transform',\n params: [{ name: 'max value', type: 'int', optional: true }],\n defaultParams: [],\n});\n\naddFuncDef({\n name: 'holtWintersForecast',\n category: 'Calculate',\n});\n\naddFuncDef({\n name: 'holtWintersConfidenceBands',\n category: 'Calculate',\n params: [{ name: 'delta', type: 'int' }],\n defaultParams: [3],\n});\n\naddFuncDef({\n name: 'holtWintersAberration',\n category: 'Calculate',\n params: [{ name: 'delta', type: 'int' }],\n defaultParams: [3],\n});\n\naddFuncDef({\n name: 'nPercentile',\n category: 'Calculate',\n params: [{ name: 'Nth percentile', type: 'int' }],\n defaultParams: [95],\n});\n\naddFuncDef({\n name: 'diffSeries',\n params: optionalSeriesRefArgs,\n defaultParams: ['#A'],\n category: 'Combine',\n});\n\naddFuncDef({\n name: 'stddevSeries',\n params: optionalSeriesRefArgs,\n defaultParams: [''],\n category: 'Combine',\n});\n\naddFuncDef({\n name: 'divideSeries',\n params: optionalSeriesRefArgs,\n defaultParams: ['#A'],\n category: 'Combine',\n});\n\naddFuncDef({\n name: 'multiplySeries',\n params: optionalSeriesRefArgs,\n defaultParams: ['#A'],\n category: 'Combine',\n});\n\naddFuncDef({\n name: 'asPercent',\n params: optionalSeriesRefArgs,\n defaultParams: ['#A'],\n category: 'Combine',\n});\n\naddFuncDef({\n name: 'group',\n params: optionalSeriesRefArgs,\n defaultParams: ['#A', '#B'],\n category: 'Combine',\n});\n\naddFuncDef({\n name: 'sumSeries',\n shortName: 'sum',\n category: 'Combine',\n params: optionalSeriesRefArgs,\n defaultParams: [''],\n});\n\naddFuncDef({\n name: 'averageSeries',\n shortName: 'avg',\n category: 'Combine',\n params: optionalSeriesRefArgs,\n defaultParams: [''],\n});\n\naddFuncDef({\n name: 'rangeOfSeries',\n category: 'Combine',\n});\n\naddFuncDef({\n name: 'percentileOfSeries',\n category: 'Combine',\n params: [{ name: 'n', type: 'int' }, { name: 'interpolate', type: 'boolean', options: ['true', 'false'] }],\n defaultParams: [95, 'false'],\n});\n\naddFuncDef({\n name: 'sumSeriesWithWildcards',\n category: 'Combine',\n params: [{ name: 'node', type: 'int', multiple: true }],\n defaultParams: [3],\n});\n\naddFuncDef({\n name: 'maxSeries',\n shortName: 'max',\n category: 'Combine',\n});\n\naddFuncDef({\n name: 'minSeries',\n shortName: 'min',\n category: 'Combine',\n});\n\naddFuncDef({\n name: 'averageSeriesWithWildcards',\n category: 'Combine',\n params: [{ name: 'node', type: 'int', multiple: true }],\n defaultParams: [3],\n});\n\naddFuncDef({\n name: 'alias',\n category: 'Alias',\n params: [{ name: 'alias', type: 'string' }],\n defaultParams: ['alias'],\n});\n\naddFuncDef({\n name: 'aliasSub',\n category: 'Alias',\n params: [{ name: 'search', type: 'string' }, { name: 'replace', type: 'string' }],\n defaultParams: ['', '\\\\1'],\n});\n\naddFuncDef({\n name: 'consolidateBy',\n category: 'Special',\n params: [\n {\n name: 'function',\n type: 'string',\n options: ['sum', 'average', 'min', 'max'],\n },\n ],\n defaultParams: ['max'],\n});\n\naddFuncDef({\n name: 'cumulative',\n category: 'Special',\n params: [],\n defaultParams: [],\n});\n\naddFuncDef({\n name: 'groupByNode',\n category: 'Combine',\n params: [\n {\n name: 'node',\n type: 'int',\n options: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12],\n },\n {\n name: 'function',\n type: 'string',\n options: ['sum', 'avg', 'maxSeries'],\n },\n ],\n defaultParams: [3, 'sum'],\n});\n\naddFuncDef({\n name: 'aliasByNode',\n category: 'Alias',\n params: [\n {\n name: 'node',\n type: 'int',\n options: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12],\n multiple: true,\n },\n ],\n defaultParams: [3],\n});\n\naddFuncDef({\n name: 'substr',\n category: 'Special',\n params: [\n {\n name: 'start',\n type: 'int',\n options: [-6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12],\n },\n {\n name: 'stop',\n type: 'int',\n options: [-6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12],\n },\n ],\n defaultParams: [0, 0],\n});\n\naddFuncDef({\n name: 'sortByName',\n category: 'Sorting',\n params: [\n {\n name: 'natural',\n type: 'boolean',\n options: ['true', 'false'],\n optional: true,\n },\n ],\n defaultParams: ['false'],\n});\n\naddFuncDef({\n name: 'sortByMaxima',\n category: 'Sorting',\n});\n\naddFuncDef({\n name: 'sortByMinima',\n category: 'Sorting',\n});\n\naddFuncDef({\n name: 'sortByTotal',\n category: 'Sorting',\n});\n\naddFuncDef({\n name: 'aliasByMetric',\n category: 'Alias',\n});\n\naddFuncDef({\n name: 'randomWalk',\n fake: true,\n category: 'Special',\n params: [{ name: 'name', type: 'string' }],\n defaultParams: ['randomWalk'],\n});\n\naddFuncDef({\n name: 'countSeries',\n category: 'Combine',\n});\n\naddFuncDef({\n name: 'constantLine',\n category: 'Special',\n params: [{ name: 'value', type: 'int' }],\n defaultParams: [10],\n});\n\naddFuncDef({\n name: 'cactiStyle',\n category: 'Special',\n});\n\naddFuncDef({\n name: 'keepLastValue',\n category: 'Transform',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [100],\n});\n\naddFuncDef({\n name: 'changed',\n category: 'Special',\n params: [],\n defaultParams: [],\n});\n\naddFuncDef({\n name: 'scale',\n category: 'Transform',\n params: [{ name: 'factor', type: 'int' }],\n defaultParams: [1],\n});\n\naddFuncDef({\n name: 'offset',\n category: 'Transform',\n params: [{ name: 'amount', type: 'int' }],\n defaultParams: [10],\n});\n\naddFuncDef({\n name: 'transformNull',\n category: 'Transform',\n params: [{ name: 'amount', type: 'int' }],\n defaultParams: [0],\n});\n\naddFuncDef({\n name: 'integral',\n category: 'Transform',\n});\n\naddFuncDef({\n name: 'derivative',\n category: 'Transform',\n});\n\naddFuncDef({\n name: 'nonNegativeDerivative',\n category: 'Transform',\n params: [{ name: 'max value or 0', type: 'int', optional: true }],\n defaultParams: [''],\n});\n\naddFuncDef({\n name: 'timeShift',\n category: 'Transform',\n params: [\n {\n name: 'amount',\n type: 'select',\n options: ['1h', '6h', '12h', '1d', '2d', '7d', '14d', '30d'],\n },\n ],\n defaultParams: ['1d'],\n});\n\naddFuncDef({\n name: 'timeStack',\n category: 'Transform',\n params: [\n {\n name: 'timeShiftUnit',\n type: 'select',\n options: ['1h', '6h', '12h', '1d', '2d', '7d', '14d', '30d'],\n },\n { name: 'timeShiftStart', type: 'int' },\n { name: 'timeShiftEnd', type: 'int' },\n ],\n defaultParams: ['1d', 0, 7],\n});\n\naddFuncDef({\n name: 'summarize',\n category: 'Transform',\n params: [\n { name: 'interval', type: 'string' },\n {\n name: 'func',\n type: 'select',\n options: ['sum', 'avg', 'min', 'max', 'last'],\n },\n {\n name: 'alignToFrom',\n type: 'boolean',\n optional: true,\n options: ['false', 'true'],\n },\n ],\n defaultParams: ['1h', 'sum', 'false'],\n});\n\naddFuncDef({\n name: 'smartSummarize',\n category: 'Transform',\n params: [\n { name: 'interval', type: 'string' },\n {\n name: 'func',\n type: 'select',\n options: ['sum', 'avg', 'min', 'max', 'last'],\n },\n ],\n defaultParams: ['1h', 'sum'],\n});\n\naddFuncDef({\n name: 'absolute',\n category: 'Transform',\n});\n\naddFuncDef({\n name: 'hitcount',\n category: 'Transform',\n params: [{ name: 'interval', type: 'string' }],\n defaultParams: ['10s'],\n});\n\naddFuncDef({\n name: 'log',\n category: 'Transform',\n params: [{ name: 'base', type: 'int' }],\n defaultParams: ['10'],\n});\n\naddFuncDef({\n name: 'averageAbove',\n category: 'Filter Series',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [25],\n});\n\naddFuncDef({\n name: 'averageBelow',\n category: 'Filter Series',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [25],\n});\n\naddFuncDef({\n name: 'currentAbove',\n category: 'Filter Series',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [25],\n});\n\naddFuncDef({\n name: 'currentBelow',\n category: 'Filter Series',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [25],\n});\n\naddFuncDef({\n name: 'maximumAbove',\n category: 'Filter Series',\n params: [{ name: 'value', type: 'int' }],\n defaultParams: [0],\n});\n\naddFuncDef({\n name: 'maximumBelow',\n category: 'Filter Series',\n params: [{ name: 'value', type: 'int' }],\n defaultParams: [0],\n});\n\naddFuncDef({\n name: 'minimumAbove',\n category: 'Filter Series',\n params: [{ name: 'value', type: 'int' }],\n defaultParams: [0],\n});\n\naddFuncDef({\n name: 'minimumBelow',\n category: 'Filter Series',\n params: [{ name: 'value', type: 'int' }],\n defaultParams: [0],\n});\n\naddFuncDef({\n name: 'limit',\n category: 'Filter Series',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [5],\n});\n\naddFuncDef({\n name: 'mostDeviant',\n category: 'Filter Series',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [10],\n});\n\naddFuncDef({\n name: 'exclude',\n category: 'Filter Series',\n params: [{ name: 'exclude', type: 'string' }],\n defaultParams: ['exclude'],\n});\n\naddFuncDef({\n name: 'highestCurrent',\n category: 'Filter Series',\n params: [{ name: 'count', type: 'int' }],\n defaultParams: [5],\n});\n\naddFuncDef({\n name: 'highestMax',\n category: 'Filter Series',\n params: [{ name: 'count', type: 'int' }],\n defaultParams: [5],\n});\n\naddFuncDef({\n name: 'lowestCurrent',\n category: 'Filter Series',\n params: [{ name: 'count', type: 'int' }],\n defaultParams: [5],\n});\n\naddFuncDef({\n name: 'movingAverage',\n category: 'Calculate',\n params: [\n {\n name: 'windowSize',\n type: 'int_or_interval',\n options: ['5', '7', '10', '5min', '10min', '30min', '1hour'],\n },\n ],\n defaultParams: [10],\n});\n\naddFuncDef({\n name: 'movingMedian',\n category: 'Calculate',\n params: [\n {\n name: 'windowSize',\n type: 'int_or_interval',\n options: ['5', '7', '10', '5min', '10min', '30min', '1hour'],\n },\n ],\n defaultParams: ['5'],\n});\n\naddFuncDef({\n name: 'stdev',\n category: 'Calculate',\n params: [{ name: 'n', type: 'int' }, { name: 'tolerance', type: 'int' }],\n defaultParams: [5, 0.1],\n});\n\naddFuncDef({\n name: 'highestAverage',\n category: 'Filter Series',\n params: [{ name: 'count', type: 'int' }],\n defaultParams: [5],\n});\n\naddFuncDef({\n name: 'lowestAverage',\n category: 'Filter Series',\n params: [{ name: 'count', type: 'int' }],\n defaultParams: [5],\n});\n\naddFuncDef({\n name: 'removeAbovePercentile',\n category: 'Filter Data',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [5],\n});\n\naddFuncDef({\n name: 'removeAboveValue',\n category: 'Filter Data',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [5],\n});\n\naddFuncDef({\n name: 'removeBelowPercentile',\n category: 'Filter Data',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [5],\n});\n\naddFuncDef({\n name: 'removeBelowValue',\n category: 'Filter Data',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [5],\n});\n\naddFuncDef({\n name: 'useSeriesAbove',\n category: 'Filter Series',\n params: [{ name: 'value', type: 'int' }, { name: 'search', type: 'string' }, { name: 'replace', type: 'string' }],\n defaultParams: [0, 'search', 'replace'],\n});\n\n////////////////////\n// Graphite 1.0.x //\n////////////////////\n\naddFuncDef({\n name: 'aggregateLine',\n category: 'Calculate',\n params: [\n {\n name: 'func',\n type: 'select',\n options: ['sum', 'avg', 'min', 'max', 'last'],\n },\n ],\n defaultParams: ['avg'],\n version: '1.0',\n});\n\naddFuncDef({\n name: 'averageOutsidePercentile',\n category: 'Filter Series',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [95],\n version: '1.0',\n});\n\naddFuncDef({\n name: 'delay',\n category: 'Transform',\n params: [{ name: 'steps', type: 'int' }],\n defaultParams: [1],\n version: '1.0',\n});\n\naddFuncDef({\n name: 'exponentialMovingAverage',\n category: 'Calculate',\n params: [\n {\n name: 'windowSize',\n type: 'int_or_interval',\n options: ['5', '7', '10', '5min', '10min', '30min', '1hour'],\n },\n ],\n defaultParams: [10],\n version: '1.0',\n});\n\naddFuncDef({\n name: 'fallbackSeries',\n category: 'Special',\n params: [{ name: 'fallback', type: 'string' }],\n defaultParams: ['constantLine(0)'],\n version: '1.0',\n});\n\naddFuncDef({\n name: 'grep',\n category: 'Filter Series',\n params: [{ name: 'grep', type: 'string' }],\n defaultParams: ['grep'],\n version: '1.0',\n});\n\naddFuncDef({\n name: 'groupByNodes',\n category: 'Combine',\n params: [\n {\n name: 'function',\n type: 'string',\n options: ['sum', 'avg', 'maxSeries'],\n },\n {\n name: 'node',\n type: 'int',\n options: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12],\n multiple: true,\n },\n ],\n defaultParams: ['sum', 3],\n version: '1.0',\n});\n\naddFuncDef({\n name: 'integralByInterval',\n category: 'Transform',\n params: [\n {\n name: 'intervalUnit',\n type: 'select',\n options: ['1h', '6h', '12h', '1d', '2d', '7d', '14d', '30d'],\n },\n ],\n defaultParams: ['1d'],\n version: '1.0',\n});\n\naddFuncDef({\n name: 'interpolate',\n category: 'Transform',\n params: [{ name: 'limit', type: 'int', optional: true }],\n defaultParams: [],\n version: '1.0',\n});\n\naddFuncDef({\n name: 'invert',\n category: 'Transform',\n version: '1.0',\n});\n\naddFuncDef({\n name: 'isNonNull',\n category: 'Combine',\n version: '1.0',\n});\n\naddFuncDef({\n name: 'linearRegression',\n category: 'Calculate',\n params: [\n {\n name: 'startSourceAt',\n type: 'select',\n options: ['-1h', '-6h', '-12h', '-1d', '-2d', '-7d', '-14d', '-30d'],\n optional: true,\n },\n {\n name: 'endSourceAt',\n type: 'select',\n options: ['-1h', '-6h', '-12h', '-1d', '-2d', '-7d', '-14d', '-30d'],\n optional: true,\n },\n ],\n defaultParams: [],\n version: '1.0',\n});\n\naddFuncDef({\n name: 'mapSeries',\n shortName: 'map',\n params: [{ name: 'node', type: 'int' }],\n defaultParams: [3],\n category: 'Combine',\n version: '1.0',\n});\n\naddFuncDef({\n name: 'movingMin',\n category: 'Calculate',\n params: [\n {\n name: 'windowSize',\n type: 'int_or_interval',\n options: ['5', '7', '10', '5min', '10min', '30min', '1hour'],\n },\n ],\n defaultParams: [10],\n version: '1.0',\n});\n\naddFuncDef({\n name: 'movingMax',\n category: 'Calculate',\n params: [\n {\n name: 'windowSize',\n type: 'int_or_interval',\n options: ['5', '7', '10', '5min', '10min', '30min', '1hour'],\n },\n ],\n defaultParams: [10],\n version: '1.0',\n});\n\naddFuncDef({\n name: 'movingSum',\n category: 'Calculate',\n params: [\n {\n name: 'windowSize',\n type: 'int_or_interval',\n options: ['5', '7', '10', '5min', '10min', '30min', '1hour'],\n },\n ],\n defaultParams: [10],\n version: '1.0',\n});\n\naddFuncDef({\n name: 'multiplySeriesWithWildcards',\n category: 'Combine',\n params: [\n {\n name: 'position',\n type: 'int',\n options: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12],\n multiple: true,\n },\n ],\n defaultParams: [2],\n version: '1.0',\n});\n\naddFuncDef({\n name: 'offsetToZero',\n category: 'Transform',\n version: '1.0',\n});\n\naddFuncDef({\n name: 'pow',\n category: 'Transform',\n params: [{ name: 'factor', type: 'int' }],\n defaultParams: [10],\n version: '1.0',\n});\n\naddFuncDef({\n name: 'powSeries',\n category: 'Transform',\n params: optionalSeriesRefArgs,\n defaultParams: [''],\n version: '1.0',\n});\n\naddFuncDef({\n name: 'reduceSeries',\n shortName: 'reduce',\n params: [\n {\n name: 'function',\n type: 'string',\n options: ['asPercent', 'diffSeries', 'divideSeries'],\n },\n {\n name: 'reduceNode',\n type: 'int',\n options: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13],\n },\n { name: 'reduceMatchers', type: 'string', multiple: true },\n ],\n defaultParams: ['asPercent', 2, 'used_bytes'],\n category: 'Combine',\n version: '1.0',\n});\n\naddFuncDef({\n name: 'removeBetweenPercentile',\n category: 'Filter Series',\n params: [{ name: 'n', type: 'int' }],\n defaultParams: [95],\n version: '1.0',\n});\n\naddFuncDef({\n name: 'removeEmptySeries',\n category: 'Filter Series',\n version: '1.0',\n});\n\naddFuncDef({\n name: 'squareRoot',\n category: 'Transform',\n version: '1.0',\n});\n\naddFuncDef({\n name: 'timeSlice',\n category: 'Transform',\n params: [\n {\n name: 'startSliceAt',\n type: 'select',\n options: ['-1h', '-6h', '-12h', '-1d', '-2d', '-7d', '-14d', '-30d'],\n },\n {\n name: 'endSliceAt',\n type: 'select',\n options: ['-1h', '-6h', '-12h', '-1d', '-2d', '-7d', '-14d', '-30d'],\n optional: true,\n },\n ],\n defaultParams: ['-1h'],\n version: '1.0',\n});\n\naddFuncDef({\n name: 'weightedAverage',\n category: 'Combine',\n params: [\n { name: 'other', type: 'value_or_series', optional: true },\n {\n name: 'node',\n type: 'int',\n options: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12],\n },\n ],\n defaultParams: ['#A', 4],\n version: '1.0',\n});\n\naddFuncDef({\n name: 'seriesByTag',\n category: 'Special',\n params: [{ name: 'tagExpression', type: 'string', multiple: true }],\n version: '1.1',\n});\n\naddFuncDef({\n name: 'groupByTags',\n category: 'Combine',\n params: [\n {\n name: 'function',\n type: 'string',\n options: ['sum', 'avg', 'maxSeries'],\n },\n { name: 'tag', type: 'string', multiple: true },\n ],\n defaultParams: ['sum', 'tag'],\n version: '1.1',\n});\n\naddFuncDef({\n name: 'aliasByTags',\n category: 'Alias',\n params: [{ name: 'tag', type: 'string', multiple: true }],\n defaultParams: ['tag'],\n version: '1.1',\n});\n\nfunction isVersionRelatedFunction(obj, graphiteVersion) {\n return !obj.version || isVersionGtOrEq(graphiteVersion, obj.version);\n}\n\nexport class FuncInstance {\n def: any;\n params: any;\n text: any;\n added: boolean;\n\n constructor(funcDef, options) {\n this.def = funcDef;\n this.params = [];\n\n if (options && options.withDefaultParams) {\n this.params = funcDef.defaultParams.slice(0);\n }\n\n this.updateText();\n }\n\n render(metricExp) {\n var str = this.def.name + '(';\n\n var parameters = _.map(\n this.params,\n function(value, index) {\n var paramType;\n if (index < this.def.params.length) {\n paramType = this.def.params[index].type;\n } else if (_.get(_.last(this.def.params), 'multiple')) {\n paramType = _.get(_.last(this.def.params), 'type');\n }\n if (paramType === 'value_or_series') {\n return value;\n }\n if (paramType === 'boolean' && _.includes(['true', 'false'], value)) {\n return value;\n }\n if (_.includes(['int', 'float', 'int_or_interval', 'node_or_tag', 'node'], paramType) && _.isFinite(+value)) {\n return _.toString(+value);\n }\n return \"'\" + value + \"'\";\n }.bind(this)\n );\n\n // don't send any blank parameters to graphite\n while (parameters[parameters.length - 1] === '') {\n parameters.pop();\n }\n\n if (metricExp) {\n parameters.unshift(metricExp);\n }\n\n return str + parameters.join(', ') + ')';\n }\n\n _hasMultipleParamsInString(strValue, index) {\n if (strValue.indexOf(',') === -1) {\n return false;\n }\n\n if (this.def.params[index + 1] && this.def.params[index + 1].optional) {\n return true;\n }\n\n if (index + 1 >= this.def.params.length && _.get(_.last(this.def.params), 'multiple')) {\n return true;\n }\n\n return false;\n }\n\n updateParam(strValue, index) {\n // handle optional parameters\n // if string contains ',' and next param is optional, split and update both\n if (this._hasMultipleParamsInString(strValue, index)) {\n _.each(\n strValue.split(','),\n function(partVal, idx) {\n this.updateParam(partVal.trim(), index + idx);\n }.bind(this)\n );\n return;\n }\n\n if (strValue === '' && (index >= this.def.params.length || this.def.params[index].optional)) {\n this.params.splice(index, 1);\n } else {\n this.params[index] = strValue;\n }\n\n this.updateText();\n }\n\n updateText() {\n if (this.params.length === 0) {\n this.text = this.def.name + '()';\n return;\n }\n\n var text = this.def.name + '(';\n text += this.params.join(', ');\n text += ')';\n this.text = text;\n }\n}\n\nfunction createFuncInstance(funcDef, options?, idx?) {\n if (_.isString(funcDef)) {\n funcDef = getFuncDef(funcDef, idx);\n }\n return new FuncInstance(funcDef, options);\n}\n\nfunction getFuncDef(name, idx?) {\n if (!(idx || index)[name]) {\n throw { message: 'Method not found ' + name };\n }\n return (idx || index)[name];\n}\n\nfunction getFuncDefs(graphiteVersion, idx?) {\n var funcs = {};\n _.forEach(idx || index, function(funcDef) {\n if (isVersionRelatedFunction(funcDef, graphiteVersion)) {\n funcs[funcDef.name] = _.assign({}, funcDef, {\n params: _.filter(funcDef.params, function(param) {\n return isVersionRelatedFunction(param, graphiteVersion);\n }),\n });\n }\n });\n return funcs;\n}\n\n// parse response from graphite /functions endpoint into internal format\nfunction parseFuncDefs(rawDefs) {\n var funcDefs = {};\n\n _.forEach(rawDefs || {}, (funcDef, funcName) => {\n // skip graphite graph functions\n if (funcDef.group === 'Graph') {\n return;\n }\n\n var description = funcDef.description;\n if (description) {\n // tidy up some pydoc syntax that rst2html can't handle\n description = description\n .replace(/:py:func:`(.+)( <[^>]*>)?`/g, '``$1``')\n .replace(/.. seealso:: /g, 'See also: ')\n .replace(/.. code-block *:: *none/g, '.. code-block::');\n }\n\n var func = {\n name: funcDef.name,\n description: description,\n category: funcDef.group,\n params: [],\n defaultParams: [],\n fake: false,\n };\n\n // get rid of the first \"seriesList\" param\n if (/^seriesLists?$/.test(_.get(funcDef, 'params[0].type', ''))) {\n // handle functions that accept multiple seriesLists\n // we leave the param in place but mark it optional, so users can add more series if they wish\n if (funcDef.params[0].multiple) {\n funcDef.params[0].required = false;\n // otherwise chop off the first param, it'll be handled separately\n } else {\n funcDef.params.shift();\n }\n // tag function as fake\n } else {\n func.fake = true;\n }\n\n _.forEach(funcDef.params, rawParam => {\n var param = {\n name: rawParam.name,\n type: 'string',\n optional: !rawParam.required,\n multiple: !!rawParam.multiple,\n options: undefined,\n };\n\n if (rawParam.default !== undefined) {\n func.defaultParams.push(_.toString(rawParam.default));\n } else if (rawParam.suggestions) {\n func.defaultParams.push(_.toString(rawParam.suggestions[0]));\n } else {\n func.defaultParams.push('');\n }\n\n if (rawParam.type === 'boolean') {\n param.type = 'boolean';\n param.options = ['true', 'false'];\n } else if (rawParam.type === 'integer') {\n param.type = 'int';\n } else if (rawParam.type === 'float') {\n param.type = 'float';\n } else if (rawParam.type === 'node') {\n param.type = 'node';\n param.options = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'];\n } else if (rawParam.type === 'nodeOrTag') {\n param.type = 'node_or_tag';\n param.options = ['name', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'];\n } else if (rawParam.type === 'intOrInterval') {\n param.type = 'int_or_interval';\n } else if (rawParam.type === 'seriesList') {\n param.type = 'value_or_series';\n }\n\n if (rawParam.options) {\n param.options = _.map(rawParam.options, _.toString);\n } else if (rawParam.suggestions) {\n param.options = _.map(rawParam.suggestions, _.toString);\n }\n\n func.params.push(param);\n });\n\n funcDefs[funcName] = func;\n });\n\n return funcDefs;\n}\n\nexport default {\n createFuncInstance: createFuncInstance,\n getFuncDef: getFuncDef,\n getFuncDefs: getFuncDefs,\n parseFuncDefs: parseFuncDefs,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/graphite/gfunc.ts","import './add_graphite_func';\nimport './func_editor';\n\nimport _ from 'lodash';\nimport GraphiteQuery from './graphite_query';\nimport { QueryCtrl } from 'app/plugins/sdk';\nimport appEvents from 'app/core/app_events';\n\nconst GRAPHITE_TAG_OPERATORS = ['=', '!=', '=~', '!=~'];\nconst TAG_PREFIX = 'tag: ';\n\nexport class GraphiteQueryCtrl extends QueryCtrl {\n static templateUrl = 'partials/query.editor.html';\n\n queryModel: GraphiteQuery;\n segments: any[];\n addTagSegments: any[];\n removeTagValue: string;\n supportsTags: boolean;\n paused: boolean;\n\n /** @ngInject **/\n constructor($scope, $injector, private uiSegmentSrv, private templateSrv, $timeout) {\n super($scope, $injector);\n this.supportsTags = this.datasource.supportsTags;\n this.paused = false;\n this.target.target = this.target.target || '';\n\n this.datasource.waitForFuncDefsLoaded().then(() => {\n this.queryModel = new GraphiteQuery(this.datasource, this.target, templateSrv);\n this.buildSegments();\n });\n\n this.removeTagValue = '-- remove tag --';\n }\n\n parseTarget() {\n this.queryModel.parseTarget();\n this.buildSegments();\n }\n\n toggleEditorMode() {\n this.target.textEditor = !this.target.textEditor;\n this.parseTarget();\n }\n\n buildSegments() {\n this.segments = _.map(this.queryModel.segments, segment => {\n return this.uiSegmentSrv.newSegment(segment);\n });\n\n let checkOtherSegmentsIndex = this.queryModel.checkOtherSegmentsIndex || 0;\n this.checkOtherSegments(checkOtherSegmentsIndex);\n\n if (this.queryModel.seriesByTagUsed) {\n this.fixTagSegments();\n }\n }\n\n addSelectMetricSegment() {\n this.queryModel.addSelectMetricSegment();\n this.segments.push(this.uiSegmentSrv.newSelectMetric());\n }\n\n checkOtherSegments(fromIndex) {\n if (this.queryModel.segments.length === 1 && this.queryModel.segments[0].type === 'series-ref') {\n return;\n }\n\n if (fromIndex === 0) {\n this.addSelectMetricSegment();\n return;\n }\n\n var path = this.queryModel.getSegmentPathUpTo(fromIndex + 1);\n if (path === '') {\n return Promise.resolve();\n }\n\n return this.datasource\n .metricFindQuery(path)\n .then(segments => {\n if (segments.length === 0) {\n if (path !== '') {\n this.queryModel.segments = this.queryModel.segments.splice(0, fromIndex);\n this.segments = this.segments.splice(0, fromIndex);\n this.addSelectMetricSegment();\n }\n } else if (segments[0].expandable) {\n if (this.segments.length === fromIndex) {\n this.addSelectMetricSegment();\n } else {\n return this.checkOtherSegments(fromIndex + 1);\n }\n }\n })\n .catch(err => {\n appEvents.emit('alert-error', ['Error', err]);\n });\n }\n\n setSegmentFocus(segmentIndex) {\n _.each(this.segments, (segment, index) => {\n segment.focus = segmentIndex === index;\n });\n }\n\n getAltSegments(index, prefix) {\n var query = prefix && prefix.length > 0 ? '*' + prefix + '*' : '*';\n if (index > 0) {\n query = this.queryModel.getSegmentPathUpTo(index) + '.' + query;\n }\n var options = {\n range: this.panelCtrl.range,\n requestId: 'get-alt-segments',\n };\n\n return this.datasource\n .metricFindQuery(query, options)\n .then(segments => {\n var altSegments = _.map(segments, segment => {\n return this.uiSegmentSrv.newSegment({\n value: segment.text,\n expandable: segment.expandable,\n });\n });\n\n if (index > 0 && altSegments.length === 0) {\n return altSegments;\n }\n\n // add query references\n if (index === 0) {\n _.eachRight(this.panelCtrl.panel.targets, target => {\n if (target.refId === this.queryModel.target.refId) {\n return;\n }\n\n altSegments.unshift(\n this.uiSegmentSrv.newSegment({\n type: 'series-ref',\n value: '#' + target.refId,\n expandable: false,\n })\n );\n });\n }\n\n // add template variables\n _.eachRight(this.templateSrv.variables, variable => {\n altSegments.unshift(\n this.uiSegmentSrv.newSegment({\n type: 'template',\n value: '$' + variable.name,\n expandable: true,\n })\n );\n });\n\n // add wildcard option\n altSegments.unshift(this.uiSegmentSrv.newSegment('*'));\n\n if (this.supportsTags && index === 0) {\n this.removeTaggedEntry(altSegments);\n return this.addAltTagSegments(prefix, altSegments);\n } else {\n return altSegments;\n }\n })\n .catch(err => {\n return [];\n });\n }\n\n addAltTagSegments(prefix, altSegments) {\n return this.getTagsAsSegments(prefix).then(tagSegments => {\n tagSegments = _.map(tagSegments, segment => {\n segment.value = TAG_PREFIX + segment.value;\n return segment;\n });\n return altSegments.concat(...tagSegments);\n });\n }\n\n removeTaggedEntry(altSegments) {\n altSegments = _.remove(altSegments, s => s.value === '_tagged');\n }\n\n segmentValueChanged(segment, segmentIndex) {\n this.error = null;\n this.queryModel.updateSegmentValue(segment, segmentIndex);\n\n if (this.queryModel.functions.length > 0 && this.queryModel.functions[0].def.fake) {\n this.queryModel.functions = [];\n }\n\n if (segment.type === 'tag') {\n let tag = removeTagPrefix(segment.value);\n this.pause();\n this.addSeriesByTagFunc(tag);\n return;\n }\n\n if (segment.expandable) {\n return this.checkOtherSegments(segmentIndex + 1).then(() => {\n this.setSegmentFocus(segmentIndex + 1);\n this.targetChanged();\n });\n } else {\n this.spliceSegments(segmentIndex + 1);\n }\n\n this.setSegmentFocus(segmentIndex + 1);\n this.targetChanged();\n }\n\n spliceSegments(index) {\n this.segments = this.segments.splice(0, index);\n this.queryModel.segments = this.queryModel.segments.splice(0, index);\n }\n\n emptySegments() {\n this.queryModel.segments = [];\n this.segments = [];\n }\n\n targetTextChanged() {\n this.updateModelTarget();\n this.refresh();\n }\n\n updateModelTarget() {\n this.queryModel.updateModelTarget(this.panelCtrl.panel.targets);\n }\n\n targetChanged() {\n if (this.queryModel.error) {\n return;\n }\n\n var oldTarget = this.queryModel.target.target;\n this.updateModelTarget();\n\n if (this.queryModel.target !== oldTarget && !this.paused) {\n this.panelCtrl.refresh();\n }\n }\n\n addFunction(funcDef) {\n var newFunc = this.datasource.createFuncInstance(funcDef, {\n withDefaultParams: true,\n });\n newFunc.added = true;\n this.queryModel.addFunction(newFunc);\n this.smartlyHandleNewAliasByNode(newFunc);\n\n if (this.segments.length === 1 && this.segments[0].fake) {\n this.emptySegments();\n }\n\n if (!newFunc.params.length && newFunc.added) {\n this.targetChanged();\n }\n\n if (newFunc.def.name === 'seriesByTag') {\n this.parseTarget();\n }\n }\n\n removeFunction(func) {\n this.queryModel.removeFunction(func);\n this.targetChanged();\n }\n\n addSeriesByTagFunc(tag) {\n let newFunc = this.datasource.createFuncInstance('seriesByTag', {\n withDefaultParams: false,\n });\n let tagParam = `${tag}=`;\n newFunc.params = [tagParam];\n this.queryModel.addFunction(newFunc);\n newFunc.added = true;\n\n this.emptySegments();\n this.targetChanged();\n this.parseTarget();\n }\n\n smartlyHandleNewAliasByNode(func) {\n if (func.def.name !== 'aliasByNode') {\n return;\n }\n\n for (var i = 0; i < this.segments.length; i++) {\n if (this.segments[i].value.indexOf('*') >= 0) {\n func.params[0] = i;\n func.added = false;\n this.targetChanged();\n return;\n }\n }\n }\n\n getAllTags() {\n return this.datasource.getTags().then(values => {\n let altTags = _.map(values, 'text');\n altTags.splice(0, 0, this.removeTagValue);\n return mapToDropdownOptions(altTags);\n });\n }\n\n getTags(index, tagPrefix) {\n let tagExpressions = this.queryModel.renderTagExpressions(index);\n return this.datasource.getTagsAutoComplete(tagExpressions, tagPrefix).then(values => {\n let altTags = _.map(values, 'text');\n altTags.splice(0, 0, this.removeTagValue);\n return mapToDropdownOptions(altTags);\n });\n }\n\n getTagsAsSegments(tagPrefix) {\n let tagExpressions = this.queryModel.renderTagExpressions();\n return this.datasource.getTagsAutoComplete(tagExpressions, tagPrefix).then(values => {\n return _.map(values, val => {\n return this.uiSegmentSrv.newSegment({\n value: val.text,\n type: 'tag',\n expandable: false,\n });\n });\n });\n }\n\n getTagOperators() {\n return mapToDropdownOptions(GRAPHITE_TAG_OPERATORS);\n }\n\n getAllTagValues(tag) {\n let tagKey = tag.key;\n return this.datasource.getTagValues(tagKey).then(values => {\n let altValues = _.map(values, 'text');\n return mapToDropdownOptions(altValues);\n });\n }\n\n getTagValues(tag, index, valuePrefix) {\n let tagExpressions = this.queryModel.renderTagExpressions(index);\n let tagKey = tag.key;\n return this.datasource.getTagValuesAutoComplete(tagExpressions, tagKey, valuePrefix).then(values => {\n let altValues = _.map(values, 'text');\n // Add template variables as additional values\n _.eachRight(this.templateSrv.variables, variable => {\n altValues.push('${' + variable.name + ':regex}');\n });\n return mapToDropdownOptions(altValues);\n });\n }\n\n tagChanged(tag, tagIndex) {\n this.queryModel.updateTag(tag, tagIndex);\n this.targetChanged();\n }\n\n addNewTag(segment) {\n let newTagKey = segment.value;\n let newTag = { key: newTagKey, operator: '=', value: '' };\n this.queryModel.addTag(newTag);\n this.targetChanged();\n this.fixTagSegments();\n }\n\n removeTag(index) {\n this.queryModel.removeTag(index);\n this.targetChanged();\n }\n\n fixTagSegments() {\n // Adding tag with the same name as just removed works incorrectly if single segment is used (instead of array)\n this.addTagSegments = [this.uiSegmentSrv.newPlusButton()];\n }\n\n showDelimiter(index) {\n return index !== this.queryModel.tags.length - 1;\n }\n\n pause() {\n this.paused = true;\n }\n\n unpause() {\n this.paused = false;\n this.panelCtrl.refresh();\n }\n}\n\nfunction mapToDropdownOptions(results) {\n return _.map(results, value => {\n return { text: value, value: value };\n });\n}\n\nfunction removeTagPrefix(value: string): string {\n return value.replace(TAG_PREFIX, '');\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/graphite/query_ctrl.ts","import angular from 'angular';\nimport _ from 'lodash';\nimport $ from 'jquery';\nimport rst2html from 'rst2html';\nimport Drop from 'tether-drop';\n\n/** @ngInject */\nexport function graphiteAddFunc($compile) {\n const inputTemplate =\n '';\n\n const buttonTemplate =\n '' +\n '';\n\n return {\n link: function($scope, elem) {\n var ctrl = $scope.ctrl;\n\n var $input = $(inputTemplate);\n var $button = $(buttonTemplate);\n\n $input.appendTo(elem);\n $button.appendTo(elem);\n\n ctrl.datasource.getFuncDefs().then(function(funcDefs) {\n var allFunctions = _.map(funcDefs, 'name').sort();\n\n $scope.functionMenu = createFunctionDropDownMenu(funcDefs);\n\n $input.attr('data-provide', 'typeahead');\n $input.typeahead({\n source: allFunctions,\n minLength: 1,\n items: 10,\n updater: function(value) {\n var funcDef = ctrl.datasource.getFuncDef(value);\n if (!funcDef) {\n // try find close match\n value = value.toLowerCase();\n funcDef = _.find(allFunctions, function(funcName) {\n return funcName.toLowerCase().indexOf(value) === 0;\n });\n\n if (!funcDef) {\n return '';\n }\n }\n\n $scope.$apply(function() {\n ctrl.addFunction(funcDef);\n });\n\n $input.trigger('blur');\n return '';\n },\n });\n\n $button.click(function() {\n $button.hide();\n $input.show();\n $input.focus();\n });\n\n $input.keyup(function() {\n elem.toggleClass('open', $input.val() === '');\n });\n\n $input.blur(function() {\n // clicking the function dropdown menu won't\n // work if you remove class at once\n setTimeout(function() {\n $input.val('');\n $input.hide();\n $button.show();\n elem.removeClass('open');\n }, 200);\n });\n\n $compile(elem.contents())($scope);\n });\n\n var drop;\n var cleanUpDrop = function() {\n if (drop) {\n drop.destroy();\n drop = null;\n }\n };\n\n $(elem)\n .on('mouseenter', 'ul.dropdown-menu li', function() {\n cleanUpDrop();\n\n var funcDef;\n try {\n funcDef = ctrl.datasource.getFuncDef($('a', this).text());\n } catch (e) {\n // ignore\n }\n\n if (funcDef && funcDef.description) {\n var shortDesc = funcDef.description;\n if (shortDesc.length > 500) {\n shortDesc = shortDesc.substring(0, 497) + '...';\n }\n\n var contentElement = document.createElement('div');\n contentElement.innerHTML = '

    ' + funcDef.name + '

    ' + rst2html(shortDesc);\n\n drop = new Drop({\n target: this,\n content: contentElement,\n classes: 'drop-popover',\n openOn: 'always',\n tetherOptions: {\n attachment: 'bottom left',\n targetAttachment: 'bottom right',\n },\n });\n }\n })\n .on('mouseout', 'ul.dropdown-menu li', function() {\n cleanUpDrop();\n });\n\n $scope.$on('$destroy', cleanUpDrop);\n },\n };\n}\n\nangular.module('grafana.directives').directive('graphiteAddFunc', graphiteAddFunc);\n\nfunction createFunctionDropDownMenu(funcDefs) {\n var categories = {};\n\n _.forEach(funcDefs, function(funcDef) {\n if (!funcDef.category) {\n return;\n }\n if (!categories[funcDef.category]) {\n categories[funcDef.category] = [];\n }\n categories[funcDef.category].push({\n text: funcDef.name,\n click: \"ctrl.addFunction('\" + funcDef.name + \"')\",\n });\n });\n\n return _.sortBy(\n _.map(categories, function(submenu, category) {\n return {\n text: category,\n submenu: _.sortBy(submenu, 'text'),\n };\n }),\n 'text'\n );\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/graphite/add_graphite_func.ts","import angular from 'angular';\nimport _ from 'lodash';\nimport $ from 'jquery';\nimport rst2html from 'rst2html';\n\n/** @ngInject */\nexport function graphiteFuncEditor($compile, templateSrv, popoverSrv) {\n const funcSpanTemplate = '{{func.def.name}}(';\n const paramTemplate =\n '';\n\n const funcControlsTemplate = `\n
    \n \n \n \n \n
    `;\n\n return {\n restrict: 'A',\n link: function postLink($scope, elem) {\n var $funcLink = $(funcSpanTemplate);\n var $funcControls = $(funcControlsTemplate);\n var ctrl = $scope.ctrl;\n var func = $scope.func;\n var scheduledRelink = false;\n var paramCountAtLink = 0;\n var cancelBlur = null;\n\n function clickFuncParam(paramIndex) {\n /*jshint validthis:true */\n\n var $link = $(this);\n var $comma = $link.prev('.comma');\n var $input = $link.next();\n\n $input.val(func.params[paramIndex]);\n\n $comma.removeClass('query-part__last');\n $link.hide();\n $input.show();\n $input.focus();\n $input.select();\n\n var typeahead = $input.data('typeahead');\n if (typeahead) {\n $input.val('');\n typeahead.lookup();\n }\n }\n\n function scheduledRelinkIfNeeded() {\n if (paramCountAtLink === func.params.length) {\n return;\n }\n\n if (!scheduledRelink) {\n scheduledRelink = true;\n setTimeout(function() {\n relink();\n scheduledRelink = false;\n }, 200);\n }\n }\n\n function paramDef(index) {\n if (index < func.def.params.length) {\n return func.def.params[index];\n }\n if (_.last(func.def.params).multiple) {\n return _.assign({}, _.last(func.def.params), { optional: true });\n }\n return {};\n }\n\n function switchToLink(inputElem, paramIndex) {\n /*jshint validthis:true */\n var $input = $(inputElem);\n\n clearTimeout(cancelBlur);\n cancelBlur = null;\n\n var $link = $input.prev();\n var $comma = $link.prev('.comma');\n var newValue = $input.val();\n\n // remove optional empty params\n if (newValue !== '' || paramDef(paramIndex).optional) {\n func.updateParam(newValue, paramIndex);\n $link.html(newValue ? templateSrv.highlightVariablesAsHtml(newValue) : ' ');\n }\n\n scheduledRelinkIfNeeded();\n\n $scope.$apply(function() {\n ctrl.targetChanged();\n });\n\n if ($link.hasClass('query-part__last') && newValue === '') {\n $comma.addClass('query-part__last');\n } else {\n $link.removeClass('query-part__last');\n }\n\n $input.hide();\n $link.show();\n }\n\n // this = input element\n function inputBlur(paramIndex) {\n /*jshint validthis:true */\n var inputElem = this;\n // happens long before the click event on the typeahead options\n // need to have long delay because the blur\n cancelBlur = setTimeout(function() {\n switchToLink(inputElem, paramIndex);\n }, 200);\n }\n\n function inputKeyPress(paramIndex, e) {\n /*jshint validthis:true */\n if (e.which === 13) {\n $(this).blur();\n }\n }\n\n function inputKeyDown() {\n /*jshint validthis:true */\n this.style.width = (3 + this.value.length) * 8 + 'px';\n }\n\n function addTypeahead($input, paramIndex) {\n $input.attr('data-provide', 'typeahead');\n\n var options = paramDef(paramIndex).options;\n if (paramDef(paramIndex).type === 'int') {\n options = _.map(options, function(val) {\n return val.toString();\n });\n }\n\n $input.typeahead({\n source: options,\n minLength: 0,\n items: 20,\n updater: function(value) {\n $input.val(value);\n switchToLink($input[0], paramIndex);\n return value;\n },\n });\n\n var typeahead = $input.data('typeahead');\n typeahead.lookup = function() {\n this.query = this.$element.val() || '';\n return this.process(this.source);\n };\n }\n\n function toggleFuncControls() {\n var targetDiv = elem.closest('.tight-form');\n\n if (elem.hasClass('show-function-controls')) {\n elem.removeClass('show-function-controls');\n targetDiv.removeClass('has-open-function');\n $funcControls.hide();\n return;\n }\n\n elem.addClass('show-function-controls');\n targetDiv.addClass('has-open-function');\n\n $funcControls.show();\n }\n\n function addElementsAndCompile() {\n $funcControls.appendTo(elem);\n $funcLink.appendTo(elem);\n\n var defParams = _.clone(func.def.params);\n var lastParam = _.last(func.def.params);\n\n while (func.params.length >= defParams.length && lastParam && lastParam.multiple) {\n defParams.push(_.assign({}, lastParam, { optional: true }));\n }\n\n _.each(defParams, function(param, index) {\n if (param.optional && func.params.length < index) {\n return false;\n }\n\n var paramValue = templateSrv.highlightVariablesAsHtml(func.params[index]);\n\n var last = index >= func.params.length - 1 && param.optional && !paramValue;\n if (last && param.multiple) {\n paramValue = '+';\n }\n\n if (index > 0) {\n $(', ').appendTo(elem);\n }\n\n var $paramLink = $(\n '' +\n (paramValue || ' ') +\n ''\n );\n var $input = $(paramTemplate);\n $input.attr('placeholder', param.name);\n\n paramCountAtLink++;\n\n $paramLink.appendTo(elem);\n $input.appendTo(elem);\n\n $input.blur(_.partial(inputBlur, index));\n $input.keyup(inputKeyDown);\n $input.keypress(_.partial(inputKeyPress, index));\n $paramLink.click(_.partial(clickFuncParam, index));\n\n if (param.options) {\n addTypeahead($input, index);\n }\n\n return true;\n });\n\n $(')').appendTo(elem);\n\n $compile(elem.contents())($scope);\n }\n\n function ifJustAddedFocusFirstParam() {\n if ($scope.func.added) {\n $scope.func.added = false;\n setTimeout(function() {\n elem\n .find('.graphite-func-param-link')\n .first()\n .click();\n }, 10);\n }\n }\n\n function registerFuncControlsToggle() {\n $funcLink.click(toggleFuncControls);\n }\n\n function registerFuncControlsActions() {\n $funcControls.click(function(e) {\n var $target = $(e.target);\n if ($target.hasClass('fa-remove')) {\n toggleFuncControls();\n $scope.$apply(function() {\n ctrl.removeFunction($scope.func);\n });\n return;\n }\n\n if ($target.hasClass('fa-arrow-left')) {\n $scope.$apply(function() {\n _.move(ctrl.queryModel.functions, $scope.$index, $scope.$index - 1);\n ctrl.targetChanged();\n });\n return;\n }\n\n if ($target.hasClass('fa-arrow-right')) {\n $scope.$apply(function() {\n _.move(ctrl.queryModel.functions, $scope.$index, $scope.$index + 1);\n ctrl.targetChanged();\n });\n return;\n }\n\n if ($target.hasClass('fa-question-circle')) {\n var funcDef = ctrl.datasource.getFuncDef(func.def.name);\n if (funcDef && funcDef.description) {\n popoverSrv.show({\n element: e.target,\n position: 'bottom left',\n classNames: 'drop-popover drop-function-def',\n template: `\n
    \n

    ${funcDef.name}

    \n ${rst2html(funcDef.description)}\n
    `,\n openOn: 'click',\n });\n } else {\n window.open(\n 'http://graphite.readthedocs.org/en/latest/functions.html#graphite.render.functions.' + func.def.name,\n '_blank'\n );\n }\n return;\n }\n });\n }\n\n function relink() {\n elem.children().remove();\n\n addElementsAndCompile();\n ifJustAddedFocusFirstParam();\n registerFuncControlsToggle();\n registerFuncControlsActions();\n }\n\n relink();\n },\n };\n}\n\nangular.module('grafana.directives').directive('graphiteFuncEditor', graphiteFuncEditor);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/graphite/func_editor.ts","import _ from 'lodash';\nimport { Parser } from './parser';\n\nexport default class GraphiteQuery {\n datasource: any;\n target: any;\n functions: any[];\n segments: any[];\n tags: any[];\n error: any;\n seriesByTagUsed: boolean;\n checkOtherSegmentsIndex: number;\n removeTagValue: string;\n templateSrv: any;\n scopedVars: any;\n\n /** @ngInject */\n constructor(datasource, target, templateSrv?, scopedVars?) {\n this.datasource = datasource;\n this.target = target;\n this.parseTarget();\n\n this.removeTagValue = '-- remove tag --';\n }\n\n parseTarget() {\n this.functions = [];\n this.segments = [];\n this.tags = [];\n this.error = null;\n\n if (this.target.textEditor) {\n return;\n }\n\n var parser = new Parser(this.target.target);\n var astNode = parser.getAst();\n if (astNode === null) {\n this.checkOtherSegmentsIndex = 0;\n return;\n }\n\n if (astNode.type === 'error') {\n this.error = astNode.message + ' at position: ' + astNode.pos;\n this.target.textEditor = true;\n return;\n }\n\n try {\n this.parseTargetRecursive(astNode, null);\n } catch (err) {\n console.log('error parsing target:', err.message);\n this.error = err.message;\n this.target.textEditor = true;\n }\n\n this.checkOtherSegmentsIndex = this.segments.length - 1;\n this.checkForSeriesByTag();\n }\n\n checkForSeriesByTag() {\n let seriesByTagFunc = _.find(this.functions, func => func.def.name === 'seriesByTag');\n if (seriesByTagFunc) {\n this.seriesByTagUsed = true;\n seriesByTagFunc.hidden = true;\n let tags = this.splitSeriesByTagParams(seriesByTagFunc);\n this.tags = tags;\n }\n }\n\n getSegmentPathUpTo(index) {\n var arr = this.segments.slice(0, index);\n\n return _.reduce(\n arr,\n function(result, segment) {\n return result ? result + '.' + segment.value : segment.value;\n },\n ''\n );\n }\n\n parseTargetRecursive(astNode, func) {\n if (astNode === null) {\n return null;\n }\n\n switch (astNode.type) {\n case 'function':\n var innerFunc = this.datasource.createFuncInstance(astNode.name, {\n withDefaultParams: false,\n });\n _.each(astNode.params, param => {\n this.parseTargetRecursive(param, innerFunc);\n });\n\n innerFunc.updateText();\n this.functions.push(innerFunc);\n break;\n case 'series-ref':\n if (this.segments.length > 0) {\n this.addFunctionParameter(func, astNode.value);\n } else {\n this.segments.push(astNode);\n }\n break;\n case 'bool':\n case 'string':\n case 'number':\n this.addFunctionParameter(func, astNode.value);\n break;\n case 'metric':\n if (this.segments.length > 0) {\n this.addFunctionParameter(func, _.join(_.map(astNode.segments, 'value'), '.'));\n } else {\n this.segments = astNode.segments;\n }\n break;\n }\n }\n\n updateSegmentValue(segment, index) {\n this.segments[index].value = segment.value;\n }\n\n addSelectMetricSegment() {\n this.segments.push({ value: 'select metric' });\n }\n\n addFunction(newFunc) {\n this.functions.push(newFunc);\n this.moveAliasFuncLast();\n }\n\n moveAliasFuncLast() {\n var aliasFunc = _.find(this.functions, function(func) {\n return func.def.name.startsWith('alias');\n });\n\n if (aliasFunc) {\n this.functions = _.without(this.functions, aliasFunc);\n this.functions.push(aliasFunc);\n }\n }\n\n addFunctionParameter(func, value) {\n if (func.params.length >= func.def.params.length && !_.get(_.last(func.def.params), 'multiple', false)) {\n throw { message: 'too many parameters for function ' + func.def.name };\n }\n func.params.push(value);\n }\n\n removeFunction(func) {\n this.functions = _.without(this.functions, func);\n }\n\n updateModelTarget(targets) {\n // render query\n if (!this.target.textEditor) {\n var metricPath = this.getSegmentPathUpTo(this.segments.length).replace(/\\.select metric$/, '');\n this.target.target = _.reduce(this.functions, wrapFunction, metricPath);\n }\n\n this.updateRenderedTarget(this.target, targets);\n\n // loop through other queries and update targetFull as needed\n for (const target of targets || []) {\n if (target.refId !== this.target.refId) {\n this.updateRenderedTarget(target, targets);\n }\n }\n }\n\n updateRenderedTarget(target, targets) {\n // render nested query\n var targetsByRefId = _.keyBy(targets, 'refId');\n\n // no references to self\n delete targetsByRefId[target.refId];\n\n var nestedSeriesRefRegex = /\\#([A-Z])/g;\n var targetWithNestedQueries = target.target;\n\n // Use ref count to track circular references\n function countTargetRefs(targetsByRefId, refId) {\n let refCount = 0;\n _.each(targetsByRefId, (t, id) => {\n if (id !== refId) {\n let match = nestedSeriesRefRegex.exec(t.target);\n let count = match && match.length ? match.length - 1 : 0;\n refCount += count;\n }\n });\n targetsByRefId[refId].refCount = refCount;\n }\n _.each(targetsByRefId, (t, id) => {\n countTargetRefs(targetsByRefId, id);\n });\n\n // Keep interpolating until there are no query references\n // The reason for the loop is that the referenced query might contain another reference to another query\n while (targetWithNestedQueries.match(nestedSeriesRefRegex)) {\n var updated = targetWithNestedQueries.replace(nestedSeriesRefRegex, (match, g1) => {\n var t = targetsByRefId[g1];\n if (!t) {\n return match;\n }\n\n // no circular references\n if (t.refCount === 0) {\n delete targetsByRefId[g1];\n }\n t.refCount--;\n\n return t.target;\n });\n\n if (updated === targetWithNestedQueries) {\n break;\n }\n\n targetWithNestedQueries = updated;\n }\n\n delete target.targetFull;\n if (target.target !== targetWithNestedQueries) {\n target.targetFull = targetWithNestedQueries;\n }\n }\n\n splitSeriesByTagParams(func) {\n const tagPattern = /([^\\!=~]+)(\\!?=~?)(.*)/;\n return _.flatten(\n _.map(func.params, (param: string) => {\n let matches = tagPattern.exec(param);\n if (matches) {\n let tag = matches.slice(1);\n if (tag.length === 3) {\n return {\n key: tag[0],\n operator: tag[1],\n value: tag[2],\n };\n }\n }\n return [];\n })\n );\n }\n\n getSeriesByTagFuncIndex() {\n return _.findIndex(this.functions, func => func.def.name === 'seriesByTag');\n }\n\n getSeriesByTagFunc() {\n let seriesByTagFuncIndex = this.getSeriesByTagFuncIndex();\n if (seriesByTagFuncIndex >= 0) {\n return this.functions[seriesByTagFuncIndex];\n } else {\n return undefined;\n }\n }\n\n addTag(tag) {\n let newTagParam = renderTagString(tag);\n this.getSeriesByTagFunc().params.push(newTagParam);\n this.tags.push(tag);\n }\n\n removeTag(index) {\n this.getSeriesByTagFunc().params.splice(index, 1);\n this.tags.splice(index, 1);\n }\n\n updateTag(tag, tagIndex) {\n this.error = null;\n\n if (tag.key === this.removeTagValue) {\n this.removeTag(tagIndex);\n return;\n }\n\n let newTagParam = renderTagString(tag);\n this.getSeriesByTagFunc().params[tagIndex] = newTagParam;\n this.tags[tagIndex] = tag;\n }\n\n renderTagExpressions(excludeIndex = -1) {\n return _.compact(\n _.map(this.tags, (tagExpr, index) => {\n // Don't render tag that we want to lookup\n if (index !== excludeIndex) {\n return tagExpr.key + tagExpr.operator + tagExpr.value;\n }\n })\n );\n }\n}\n\nfunction wrapFunction(target, func) {\n return func.render(target);\n}\n\nfunction renderTagString(tag) {\n return tag.key + tag.operator + tag.value;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/graphite/graphite_query.ts","import { Lexer } from './lexer';\n\nexport function Parser(expression) {\n this.expression = expression;\n this.lexer = new Lexer(expression);\n this.tokens = this.lexer.tokenize();\n this.index = 0;\n}\n\nParser.prototype = {\n getAst: function() {\n return this.start();\n },\n\n start: function() {\n try {\n return this.functionCall() || this.metricExpression();\n } catch (e) {\n return {\n type: 'error',\n message: e.message,\n pos: e.pos,\n };\n }\n },\n\n curlyBraceSegment: function() {\n if (this.match('identifier', '{') || this.match('{')) {\n var curlySegment = '';\n\n while (!this.match('') && !this.match('}')) {\n curlySegment += this.consumeToken().value;\n }\n\n if (!this.match('}')) {\n this.errorMark(\"Expected closing '}'\");\n }\n\n curlySegment += this.consumeToken().value;\n\n // if curly segment is directly followed by identifier\n // include it in the segment\n if (this.match('identifier')) {\n curlySegment += this.consumeToken().value;\n }\n\n return {\n type: 'segment',\n value: curlySegment,\n };\n } else {\n return null;\n }\n },\n\n metricSegment: function() {\n var curly = this.curlyBraceSegment();\n if (curly) {\n return curly;\n }\n\n if (this.match('identifier') || this.match('number')) {\n // hack to handle float numbers in metric segments\n var parts = this.consumeToken().value.split('.');\n if (parts.length === 2) {\n this.tokens.splice(this.index, 0, { type: '.' });\n this.tokens.splice(this.index + 1, 0, {\n type: 'number',\n value: parts[1],\n });\n }\n\n return {\n type: 'segment',\n value: parts[0],\n };\n }\n\n if (!this.match('templateStart')) {\n this.errorMark('Expected metric identifier');\n }\n\n this.consumeToken();\n\n if (!this.match('identifier')) {\n this.errorMark('Expected identifier after templateStart');\n }\n\n var node = {\n type: 'template',\n value: this.consumeToken().value,\n };\n\n if (!this.match('templateEnd')) {\n this.errorMark('Expected templateEnd');\n }\n\n this.consumeToken();\n return node;\n },\n\n metricExpression: function() {\n if (!this.match('templateStart') && !this.match('identifier') && !this.match('number') && !this.match('{')) {\n return null;\n }\n\n var node = {\n type: 'metric',\n segments: [],\n };\n\n node.segments.push(this.metricSegment());\n\n while (this.match('.')) {\n this.consumeToken();\n\n var segment = this.metricSegment();\n if (!segment) {\n this.errorMark('Expected metric identifier');\n }\n\n node.segments.push(segment);\n }\n\n return node;\n },\n\n functionCall: function() {\n if (!this.match('identifier', '(')) {\n return null;\n }\n\n var node: any = {\n type: 'function',\n name: this.consumeToken().value,\n };\n\n // consume left parenthesis\n this.consumeToken();\n\n node.params = this.functionParameters();\n\n if (!this.match(')')) {\n this.errorMark('Expected closing parenthesis');\n }\n\n this.consumeToken();\n\n return node;\n },\n\n boolExpression: function() {\n if (!this.match('bool')) {\n return null;\n }\n\n return {\n type: 'bool',\n value: this.consumeToken().value === 'true',\n };\n },\n\n functionParameters: function() {\n if (this.match(')') || this.match('')) {\n return [];\n }\n\n var param =\n this.functionCall() ||\n this.numericLiteral() ||\n this.seriesRefExpression() ||\n this.boolExpression() ||\n this.metricExpression() ||\n this.stringLiteral();\n\n if (!this.match(',')) {\n return [param];\n }\n\n this.consumeToken();\n return [param].concat(this.functionParameters());\n },\n\n seriesRefExpression: function() {\n if (!this.match('identifier')) {\n return null;\n }\n\n var value = this.tokens[this.index].value;\n if (!value.match(/\\#[A-Z]/)) {\n return null;\n }\n\n var token = this.consumeToken();\n\n return {\n type: 'series-ref',\n value: token.value,\n };\n },\n\n numericLiteral: function() {\n if (!this.match('number')) {\n return null;\n }\n\n return {\n type: 'number',\n value: parseFloat(this.consumeToken().value),\n };\n },\n\n stringLiteral: function() {\n if (!this.match('string')) {\n return null;\n }\n\n var token = this.consumeToken();\n if (token.isUnclosed) {\n throw { message: 'Unclosed string parameter', pos: token.pos };\n }\n\n return {\n type: 'string',\n value: token.value,\n };\n },\n\n errorMark: function(text) {\n var currentToken = this.tokens[this.index];\n var type = currentToken ? currentToken.type : 'end of string';\n throw {\n message: text + ' instead found ' + type,\n pos: currentToken ? currentToken.pos : this.lexer.char,\n };\n },\n\n // returns token value and incre\n consumeToken: function() {\n this.index++;\n return this.tokens[this.index - 1];\n },\n\n matchToken: function(type, index) {\n var token = this.tokens[this.index + index];\n return (token === undefined && type === '') || (token && token.type === type);\n },\n\n match: function(token1, token2) {\n return this.matchToken(token1, 0) && (!token2 || this.matchToken(token2, 1));\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/graphite/parser.ts","import _ from 'lodash';\n\n// This is auto generated from the unicode tables.\n// The tables are at:\n// http://www.fileformat.info/info/unicode/category/Lu/list.htm\n// http://www.fileformat.info/info/unicode/category/Ll/list.htm\n// http://www.fileformat.info/info/unicode/category/Lt/list.htm\n// http://www.fileformat.info/info/unicode/category/Lm/list.htm\n// http://www.fileformat.info/info/unicode/category/Lo/list.htm\n// http://www.fileformat.info/info/unicode/category/Nl/list.htm\n\nvar unicodeLetterTable = [\n 170,\n 170,\n 181,\n 181,\n 186,\n 186,\n 192,\n 214,\n 216,\n 246,\n 248,\n 705,\n 710,\n 721,\n 736,\n 740,\n 748,\n 748,\n 750,\n 750,\n 880,\n 884,\n 886,\n 887,\n 890,\n 893,\n 902,\n 902,\n 904,\n 906,\n 908,\n 908,\n 910,\n 929,\n 931,\n 1013,\n 1015,\n 1153,\n 1162,\n 1319,\n 1329,\n 1366,\n 1369,\n 1369,\n 1377,\n 1415,\n 1488,\n 1514,\n 1520,\n 1522,\n 1568,\n 1610,\n 1646,\n 1647,\n 1649,\n 1747,\n 1749,\n 1749,\n 1765,\n 1766,\n 1774,\n 1775,\n 1786,\n 1788,\n 1791,\n 1791,\n 1808,\n 1808,\n 1810,\n 1839,\n 1869,\n 1957,\n 1969,\n 1969,\n 1994,\n 2026,\n 2036,\n 2037,\n 2042,\n 2042,\n 2048,\n 2069,\n 2074,\n 2074,\n 2084,\n 2084,\n 2088,\n 2088,\n 2112,\n 2136,\n 2308,\n 2361,\n 2365,\n 2365,\n 2384,\n 2384,\n 2392,\n 2401,\n 2417,\n 2423,\n 2425,\n 2431,\n 2437,\n 2444,\n 2447,\n 2448,\n 2451,\n 2472,\n 2474,\n 2480,\n 2482,\n 2482,\n 2486,\n 2489,\n 2493,\n 2493,\n 2510,\n 2510,\n 2524,\n 2525,\n 2527,\n 2529,\n 2544,\n 2545,\n 2565,\n 2570,\n 2575,\n 2576,\n 2579,\n 2600,\n 2602,\n 2608,\n 2610,\n 2611,\n 2613,\n 2614,\n 2616,\n 2617,\n 2649,\n 2652,\n 2654,\n 2654,\n 2674,\n 2676,\n 2693,\n 2701,\n 2703,\n 2705,\n 2707,\n 2728,\n 2730,\n 2736,\n 2738,\n 2739,\n 2741,\n 2745,\n 2749,\n 2749,\n 2768,\n 2768,\n 2784,\n 2785,\n 2821,\n 2828,\n 2831,\n 2832,\n 2835,\n 2856,\n 2858,\n 2864,\n 2866,\n 2867,\n 2869,\n 2873,\n 2877,\n 2877,\n 2908,\n 2909,\n 2911,\n 2913,\n 2929,\n 2929,\n 2947,\n 2947,\n 2949,\n 2954,\n 2958,\n 2960,\n 2962,\n 2965,\n 2969,\n 2970,\n 2972,\n 2972,\n 2974,\n 2975,\n 2979,\n 2980,\n 2984,\n 2986,\n 2990,\n 3001,\n 3024,\n 3024,\n 3077,\n 3084,\n 3086,\n 3088,\n 3090,\n 3112,\n 3114,\n 3123,\n 3125,\n 3129,\n 3133,\n 3133,\n 3160,\n 3161,\n 3168,\n 3169,\n 3205,\n 3212,\n 3214,\n 3216,\n 3218,\n 3240,\n 3242,\n 3251,\n 3253,\n 3257,\n 3261,\n 3261,\n 3294,\n 3294,\n 3296,\n 3297,\n 3313,\n 3314,\n 3333,\n 3340,\n 3342,\n 3344,\n 3346,\n 3386,\n 3389,\n 3389,\n 3406,\n 3406,\n 3424,\n 3425,\n 3450,\n 3455,\n 3461,\n 3478,\n 3482,\n 3505,\n 3507,\n 3515,\n 3517,\n 3517,\n 3520,\n 3526,\n 3585,\n 3632,\n 3634,\n 3635,\n 3648,\n 3654,\n 3713,\n 3714,\n 3716,\n 3716,\n 3719,\n 3720,\n 3722,\n 3722,\n 3725,\n 3725,\n 3732,\n 3735,\n 3737,\n 3743,\n 3745,\n 3747,\n 3749,\n 3749,\n 3751,\n 3751,\n 3754,\n 3755,\n 3757,\n 3760,\n 3762,\n 3763,\n 3773,\n 3773,\n 3776,\n 3780,\n 3782,\n 3782,\n 3804,\n 3805,\n 3840,\n 3840,\n 3904,\n 3911,\n 3913,\n 3948,\n 3976,\n 3980,\n 4096,\n 4138,\n 4159,\n 4159,\n 4176,\n 4181,\n 4186,\n 4189,\n 4193,\n 4193,\n 4197,\n 4198,\n 4206,\n 4208,\n 4213,\n 4225,\n 4238,\n 4238,\n 4256,\n 4293,\n 4304,\n 4346,\n 4348,\n 4348,\n 4352,\n 4680,\n 4682,\n 4685,\n 4688,\n 4694,\n 4696,\n 4696,\n 4698,\n 4701,\n 4704,\n 4744,\n 4746,\n 4749,\n 4752,\n 4784,\n 4786,\n 4789,\n 4792,\n 4798,\n 4800,\n 4800,\n 4802,\n 4805,\n 4808,\n 4822,\n 4824,\n 4880,\n 4882,\n 4885,\n 4888,\n 4954,\n 4992,\n 5007,\n 5024,\n 5108,\n 5121,\n 5740,\n 5743,\n 5759,\n 5761,\n 5786,\n 5792,\n 5866,\n 5870,\n 5872,\n 5888,\n 5900,\n 5902,\n 5905,\n 5920,\n 5937,\n 5952,\n 5969,\n 5984,\n 5996,\n 5998,\n 6000,\n 6016,\n 6067,\n 6103,\n 6103,\n 6108,\n 6108,\n 6176,\n 6263,\n 6272,\n 6312,\n 6314,\n 6314,\n 6320,\n 6389,\n 6400,\n 6428,\n 6480,\n 6509,\n 6512,\n 6516,\n 6528,\n 6571,\n 6593,\n 6599,\n 6656,\n 6678,\n 6688,\n 6740,\n 6823,\n 6823,\n 6917,\n 6963,\n 6981,\n 6987,\n 7043,\n 7072,\n 7086,\n 7087,\n 7104,\n 7141,\n 7168,\n 7203,\n 7245,\n 7247,\n 7258,\n 7293,\n 7401,\n 7404,\n 7406,\n 7409,\n 7424,\n 7615,\n 7680,\n 7957,\n 7960,\n 7965,\n 7968,\n 8005,\n 8008,\n 8013,\n 8016,\n 8023,\n 8025,\n 8025,\n 8027,\n 8027,\n 8029,\n 8029,\n 8031,\n 8061,\n 8064,\n 8116,\n 8118,\n 8124,\n 8126,\n 8126,\n 8130,\n 8132,\n 8134,\n 8140,\n 8144,\n 8147,\n 8150,\n 8155,\n 8160,\n 8172,\n 8178,\n 8180,\n 8182,\n 8188,\n 8305,\n 8305,\n 8319,\n 8319,\n 8336,\n 8348,\n 8450,\n 8450,\n 8455,\n 8455,\n 8458,\n 8467,\n 8469,\n 8469,\n 8473,\n 8477,\n 8484,\n 8484,\n 8486,\n 8486,\n 8488,\n 8488,\n 8490,\n 8493,\n 8495,\n 8505,\n 8508,\n 8511,\n 8517,\n 8521,\n 8526,\n 8526,\n 8544,\n 8584,\n 11264,\n 11310,\n 11312,\n 11358,\n 11360,\n 11492,\n 11499,\n 11502,\n 11520,\n 11557,\n 11568,\n 11621,\n 11631,\n 11631,\n 11648,\n 11670,\n 11680,\n 11686,\n 11688,\n 11694,\n 11696,\n 11702,\n 11704,\n 11710,\n 11712,\n 11718,\n 11720,\n 11726,\n 11728,\n 11734,\n 11736,\n 11742,\n 11823,\n 11823,\n 12293,\n 12295,\n 12321,\n 12329,\n 12337,\n 12341,\n 12344,\n 12348,\n 12353,\n 12438,\n 12445,\n 12447,\n 12449,\n 12538,\n 12540,\n 12543,\n 12549,\n 12589,\n 12593,\n 12686,\n 12704,\n 12730,\n 12784,\n 12799,\n 13312,\n 13312,\n 19893,\n 19893,\n 19968,\n 19968,\n 40907,\n 40907,\n 40960,\n 42124,\n 42192,\n 42237,\n 42240,\n 42508,\n 42512,\n 42527,\n 42538,\n 42539,\n 42560,\n 42606,\n 42623,\n 42647,\n 42656,\n 42735,\n 42775,\n 42783,\n 42786,\n 42888,\n 42891,\n 42894,\n 42896,\n 42897,\n 42912,\n 42921,\n 43002,\n 43009,\n 43011,\n 43013,\n 43015,\n 43018,\n 43020,\n 43042,\n 43072,\n 43123,\n 43138,\n 43187,\n 43250,\n 43255,\n 43259,\n 43259,\n 43274,\n 43301,\n 43312,\n 43334,\n 43360,\n 43388,\n 43396,\n 43442,\n 43471,\n 43471,\n 43520,\n 43560,\n 43584,\n 43586,\n 43588,\n 43595,\n 43616,\n 43638,\n 43642,\n 43642,\n 43648,\n 43695,\n 43697,\n 43697,\n 43701,\n 43702,\n 43705,\n 43709,\n 43712,\n 43712,\n 43714,\n 43714,\n 43739,\n 43741,\n 43777,\n 43782,\n 43785,\n 43790,\n 43793,\n 43798,\n 43808,\n 43814,\n 43816,\n 43822,\n 43968,\n 44002,\n 44032,\n 44032,\n 55203,\n 55203,\n 55216,\n 55238,\n 55243,\n 55291,\n 63744,\n 64045,\n 64048,\n 64109,\n 64112,\n 64217,\n 64256,\n 64262,\n 64275,\n 64279,\n 64285,\n 64285,\n 64287,\n 64296,\n 64298,\n 64310,\n 64312,\n 64316,\n 64318,\n 64318,\n 64320,\n 64321,\n 64323,\n 64324,\n 64326,\n 64433,\n 64467,\n 64829,\n 64848,\n 64911,\n 64914,\n 64967,\n 65008,\n 65019,\n 65136,\n 65140,\n 65142,\n 65276,\n 65313,\n 65338,\n 65345,\n 65370,\n 65382,\n 65470,\n 65474,\n 65479,\n 65482,\n 65487,\n 65490,\n 65495,\n 65498,\n 65500,\n 65536,\n 65547,\n 65549,\n 65574,\n 65576,\n 65594,\n 65596,\n 65597,\n 65599,\n 65613,\n 65616,\n 65629,\n 65664,\n 65786,\n 65856,\n 65908,\n 66176,\n 66204,\n 66208,\n 66256,\n 66304,\n 66334,\n 66352,\n 66378,\n 66432,\n 66461,\n 66464,\n 66499,\n 66504,\n 66511,\n 66513,\n 66517,\n 66560,\n 66717,\n 67584,\n 67589,\n 67592,\n 67592,\n 67594,\n 67637,\n 67639,\n 67640,\n 67644,\n 67644,\n 67647,\n 67669,\n 67840,\n 67861,\n 67872,\n 67897,\n 68096,\n 68096,\n 68112,\n 68115,\n 68117,\n 68119,\n 68121,\n 68147,\n 68192,\n 68220,\n 68352,\n 68405,\n 68416,\n 68437,\n 68448,\n 68466,\n 68608,\n 68680,\n 69635,\n 69687,\n 69763,\n 69807,\n 73728,\n 74606,\n 74752,\n 74850,\n 77824,\n 78894,\n 92160,\n 92728,\n 110592,\n 110593,\n 119808,\n 119892,\n 119894,\n 119964,\n 119966,\n 119967,\n 119970,\n 119970,\n 119973,\n 119974,\n 119977,\n 119980,\n 119982,\n 119993,\n 119995,\n 119995,\n 119997,\n 120003,\n 120005,\n 120069,\n 120071,\n 120074,\n 120077,\n 120084,\n 120086,\n 120092,\n 120094,\n 120121,\n 120123,\n 120126,\n 120128,\n 120132,\n 120134,\n 120134,\n 120138,\n 120144,\n 120146,\n 120485,\n 120488,\n 120512,\n 120514,\n 120538,\n 120540,\n 120570,\n 120572,\n 120596,\n 120598,\n 120628,\n 120630,\n 120654,\n 120656,\n 120686,\n 120688,\n 120712,\n 120714,\n 120744,\n 120746,\n 120770,\n 120772,\n 120779,\n 131072,\n 131072,\n 173782,\n 173782,\n 173824,\n 173824,\n 177972,\n 177972,\n 177984,\n 177984,\n 178205,\n 178205,\n 194560,\n 195101,\n];\n\nvar identifierStartTable = [];\n\nfor (var i = 0; i < 128; i++) {\n identifierStartTable[i] =\n (i >= 48 && i <= 57) || // 0-9\n i === 36 || // $\n i === 126 || // ~\n i === 124 || // |\n (i >= 65 && i <= 90) || // A-Z\n i === 95 || // _\n i === 45 || // -\n i === 42 || // *\n i === 58 || // :\n i === 91 || // templateStart [\n i === 93 || // templateEnd ]\n i === 63 || // ?\n i === 37 || // %\n i === 35 || // #\n i === 61 || // =\n (i >= 97 && i <= 122); // a-z\n}\n\nvar identifierPartTable = identifierStartTable;\n\nexport function Lexer(expression) {\n this.input = expression;\n this.char = 1;\n this.from = 1;\n}\n\nLexer.prototype = {\n peek: function(i) {\n return this.input.charAt(i || 0);\n },\n\n skip: function(i) {\n i = i || 1;\n this.char += i;\n this.input = this.input.slice(i);\n },\n\n tokenize: function() {\n var list = [];\n var token;\n while ((token = this.next())) {\n list.push(token);\n }\n return list;\n },\n\n next: function() {\n this.from = this.char;\n\n // Move to the next non-space character.\n if (/\\s/.test(this.peek())) {\n while (/\\s/.test(this.peek())) {\n this.from += 1;\n this.skip();\n }\n\n if (this.peek() === '') {\n // EOL\n return null;\n }\n }\n\n var match = this.scanStringLiteral();\n if (match) {\n return match;\n }\n\n match = this.scanPunctuator() || this.scanNumericLiteral() || this.scanIdentifier() || this.scanTemplateSequence();\n\n if (match) {\n this.skip(match.value.length);\n return match;\n }\n\n // No token could be matched, give up.\n return null;\n },\n\n scanTemplateSequence: function() {\n if (this.peek() === '[' && this.peek(1) === '[') {\n return {\n type: 'templateStart',\n value: '[[',\n pos: this.char,\n };\n }\n\n if (this.peek() === ']' && this.peek(1) === ']') {\n return {\n type: 'templateEnd',\n value: '[[',\n pos: this.char,\n };\n }\n\n return null;\n },\n\n /*\n * Extract a JavaScript identifier out of the next sequence of\n * characters or return 'null' if its not possible. In addition,\n * to Identifier this method can also produce BooleanLiteral\n * (true/false) and NullLiteral (null).\n */\n scanIdentifier: function() {\n var id = '';\n var index = 0;\n var type, char;\n\n // Detects any character in the Unicode categories \"Uppercase\n // letter (Lu)\", \"Lowercase letter (Ll)\", \"Titlecase letter\n // (Lt)\", \"Modifier letter (Lm)\", \"Other letter (Lo)\", or\n // \"Letter number (Nl)\".\n //\n // Both approach and unicodeLetterTable were borrowed from\n // Google's Traceur.\n\n function isUnicodeLetter(code) {\n for (var i = 0; i < unicodeLetterTable.length; ) {\n if (code < unicodeLetterTable[i++]) {\n return false;\n }\n\n if (code <= unicodeLetterTable[i++]) {\n return true;\n }\n }\n\n return false;\n }\n\n function isHexDigit(str) {\n return /^[0-9a-fA-F]$/.test(str);\n }\n\n var readUnicodeEscapeSequence = _.bind(function() {\n /*jshint validthis:true */\n index += 1;\n\n if (this.peek(index) !== 'u') {\n return null;\n }\n\n var ch1 = this.peek(index + 1);\n var ch2 = this.peek(index + 2);\n var ch3 = this.peek(index + 3);\n var ch4 = this.peek(index + 4);\n var code;\n\n if (isHexDigit(ch1) && isHexDigit(ch2) && isHexDigit(ch3) && isHexDigit(ch4)) {\n code = parseInt(ch1 + ch2 + ch3 + ch4, 16);\n\n if (isUnicodeLetter(code)) {\n index += 5;\n return '\\\\u' + ch1 + ch2 + ch3 + ch4;\n }\n\n return null;\n }\n\n return null;\n }, this);\n\n var getIdentifierStart = _.bind(function() {\n /*jshint validthis:true */\n var chr = this.peek(index);\n var code = chr.charCodeAt(0);\n\n if (chr === '*') {\n index += 1;\n return chr;\n }\n\n if (code === 92) {\n return readUnicodeEscapeSequence();\n }\n\n if (code < 128) {\n if (identifierStartTable[code]) {\n index += 1;\n return chr;\n }\n\n return null;\n }\n\n if (isUnicodeLetter(code)) {\n index += 1;\n return chr;\n }\n\n return null;\n }, this);\n\n var getIdentifierPart = _.bind(function() {\n /*jshint validthis:true */\n var chr = this.peek(index);\n var code = chr.charCodeAt(0);\n\n if (code === 92) {\n return readUnicodeEscapeSequence();\n }\n\n if (code < 128) {\n if (identifierPartTable[code]) {\n index += 1;\n return chr;\n }\n\n return null;\n }\n\n if (isUnicodeLetter(code)) {\n index += 1;\n return chr;\n }\n\n return null;\n }, this);\n\n char = getIdentifierStart();\n if (char === null) {\n return null;\n }\n\n id = char;\n for (;;) {\n char = getIdentifierPart();\n\n if (char === null) {\n break;\n }\n\n id += char;\n }\n\n switch (id) {\n case 'true': {\n type = 'bool';\n break;\n }\n case 'false': {\n type = 'bool';\n break;\n }\n default:\n type = 'identifier';\n }\n\n return {\n type: type,\n value: id,\n pos: this.char,\n };\n },\n\n /*\n * Extract a numeric literal out of the next sequence of\n * characters or return 'null' if its not possible. This method\n * supports all numeric literals described in section 7.8.3\n * of the EcmaScript 5 specification.\n *\n * This method's implementation was heavily influenced by the\n * scanNumericLiteral function in the Esprima parser's source code.\n */\n scanNumericLiteral: function(): any {\n var index = 0;\n var value = '';\n var length = this.input.length;\n var char = this.peek(index);\n var bad;\n\n function isDecimalDigit(str) {\n return /^[0-9]$/.test(str);\n }\n\n function isOctalDigit(str) {\n return /^[0-7]$/.test(str);\n }\n\n function isHexDigit(str) {\n return /^[0-9a-fA-F]$/.test(str);\n }\n\n function isIdentifierStart(ch) {\n return ch === '$' || ch === '_' || ch === '\\\\' || (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z');\n }\n\n // handle negative num literals\n if (char === '-') {\n value += char;\n index += 1;\n char = this.peek(index);\n }\n\n // Numbers must start either with a decimal digit or a point.\n if (char !== '.' && !isDecimalDigit(char)) {\n return null;\n }\n\n if (char !== '.') {\n value += this.peek(index);\n index += 1;\n char = this.peek(index);\n\n if (value === '0') {\n // Base-16 numbers.\n if (char === 'x' || char === 'X') {\n index += 1;\n value += char;\n\n while (index < length) {\n char = this.peek(index);\n if (!isHexDigit(char)) {\n break;\n }\n value += char;\n index += 1;\n }\n\n if (value.length <= 2) {\n // 0x\n return {\n type: 'number',\n value: value,\n isMalformed: true,\n pos: this.char,\n };\n }\n\n if (index < length) {\n char = this.peek(index);\n if (isIdentifierStart(char)) {\n return null;\n }\n }\n\n return {\n type: 'number',\n value: value,\n base: 16,\n isMalformed: false,\n pos: this.char,\n };\n }\n\n // Base-8 numbers.\n if (isOctalDigit(char)) {\n index += 1;\n value += char;\n bad = false;\n\n while (index < length) {\n char = this.peek(index);\n\n // Numbers like '019' (note the 9) are not valid octals\n // but we still parse them and mark as malformed.\n\n if (isDecimalDigit(char)) {\n bad = true;\n }\n if (!isOctalDigit(char)) {\n // if the char is a non punctuator then its not a valid number\n if (!this.isPunctuator(char)) {\n return null;\n }\n break;\n }\n value += char;\n index += 1;\n }\n\n if (index < length) {\n char = this.peek(index);\n if (isIdentifierStart(char)) {\n return null;\n }\n }\n\n return {\n type: 'number',\n value: value,\n base: 8,\n isMalformed: bad,\n };\n }\n\n // Decimal numbers that start with '0' such as '09' are illegal\n // but we still parse them and return as malformed.\n\n if (isDecimalDigit(char)) {\n index += 1;\n value += char;\n }\n }\n\n while (index < length) {\n char = this.peek(index);\n if (!isDecimalDigit(char)) {\n break;\n }\n value += char;\n index += 1;\n }\n }\n\n // Decimal digits.\n\n if (char === '.') {\n value += char;\n index += 1;\n\n while (index < length) {\n char = this.peek(index);\n if (!isDecimalDigit(char)) {\n break;\n }\n value += char;\n index += 1;\n }\n }\n\n // Exponent part.\n\n if (char === 'e' || char === 'E') {\n value += char;\n index += 1;\n char = this.peek(index);\n\n if (char === '+' || char === '-') {\n value += this.peek(index);\n index += 1;\n }\n\n char = this.peek(index);\n if (isDecimalDigit(char)) {\n value += char;\n index += 1;\n\n while (index < length) {\n char = this.peek(index);\n if (!isDecimalDigit(char)) {\n break;\n }\n value += char;\n index += 1;\n }\n } else {\n return null;\n }\n }\n\n if (index < length) {\n char = this.peek(index);\n if (!this.isPunctuator(char)) {\n return null;\n }\n }\n\n return {\n type: 'number',\n value: value,\n base: 10,\n pos: this.char,\n isMalformed: !isFinite(+value),\n };\n },\n\n isPunctuator: function(ch1) {\n switch (ch1) {\n case '.':\n case '(':\n case ')':\n case ',':\n case '{':\n case '}':\n return true;\n }\n\n return false;\n },\n\n scanPunctuator: function() {\n var ch1 = this.peek();\n\n if (this.isPunctuator(ch1)) {\n return {\n type: ch1,\n value: ch1,\n pos: this.char,\n };\n }\n\n return null;\n },\n\n /*\n * Extract a string out of the next sequence of characters and/or\n * lines or return 'null' if its not possible. Since strings can\n * span across multiple lines this method has to move the char\n * pointer.\n *\n * This method recognizes pseudo-multiline JavaScript strings:\n *\n * var str = \"hello\\\n * world\";\n */\n scanStringLiteral: function() {\n /*jshint loopfunc:true */\n var quote = this.peek();\n\n // String must start with a quote.\n if (quote !== '\"' && quote !== \"'\") {\n return null;\n }\n\n var value = '';\n\n this.skip();\n\n while (this.peek() !== quote) {\n if (this.peek() === '') {\n // End Of Line\n return {\n type: 'string',\n value: value,\n isUnclosed: true,\n quote: quote,\n pos: this.char,\n };\n }\n\n var char = this.peek();\n var jump = 1; // A length of a jump, after we're done\n // parsing this character.\n\n value += char;\n this.skip(jump);\n }\n\n this.skip();\n return {\n type: 'string',\n value: value,\n isUnclosed: false,\n quote: quote,\n pos: this.char,\n };\n },\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/graphite/lexer.ts","export class GraphiteConfigCtrl {\n static templateUrl = 'public/app/plugins/datasource/graphite/partials/config.html';\n datasourceSrv: any;\n current: any;\n\n /** @ngInject */\n constructor($scope, datasourceSrv) {\n this.datasourceSrv = datasourceSrv;\n this.current.jsonData = this.current.jsonData || {};\n this.current.jsonData.graphiteVersion = this.current.jsonData.graphiteVersion || '0.9';\n this.autoDetectGraphiteVersion();\n }\n\n autoDetectGraphiteVersion() {\n if (!this.current.id) {\n return;\n }\n\n this.datasourceSrv\n .loadDatasource(this.current.name)\n .then(ds => {\n return ds.getVersion();\n })\n .then(version => {\n this.graphiteVersions.push({ name: version, value: version });\n this.current.jsonData.graphiteVersion = version;\n });\n }\n\n graphiteVersions = [\n { name: '0.9.x', value: '0.9' },\n { name: '1.0.x', value: '1.0' },\n { name: '1.1.x', value: '1.1' },\n ];\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/graphite/config_ctrl.ts","import './query_parameter_ctrl';\n\nimport CloudWatchDatasource from './datasource';\nimport { CloudWatchQueryCtrl } from './query_ctrl';\nimport { CloudWatchConfigCtrl } from './config_ctrl';\n\nclass CloudWatchAnnotationsQueryCtrl {\n static templateUrl = 'partials/annotations.editor.html';\n}\n\nexport {\n CloudWatchDatasource as Datasource,\n CloudWatchQueryCtrl as QueryCtrl,\n CloudWatchConfigCtrl as ConfigCtrl,\n CloudWatchAnnotationsQueryCtrl as AnnotationsQueryCtrl,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/cloudwatch/module.ts","import angular from 'angular';\nimport _ from 'lodash';\nimport * as dateMath from 'app/core/utils/datemath';\nimport kbn from 'app/core/utils/kbn';\nimport * as templatingVariable from 'app/features/templating/variable';\n// import * as moment from 'moment';\n\nexport default class CloudWatchDatasource {\n type: any;\n name: any;\n supportMetrics: any;\n proxyUrl: any;\n defaultRegion: any;\n instanceSettings: any;\n standardStatistics: any;\n /** @ngInject */\n constructor(instanceSettings, private $q, private backendSrv, private templateSrv, private timeSrv) {\n this.type = 'cloudwatch';\n this.name = instanceSettings.name;\n this.supportMetrics = true;\n this.proxyUrl = instanceSettings.url;\n this.defaultRegion = instanceSettings.jsonData.defaultRegion;\n this.instanceSettings = instanceSettings;\n this.standardStatistics = ['Average', 'Maximum', 'Minimum', 'Sum', 'SampleCount'];\n }\n\n query(options) {\n options = angular.copy(options);\n options.targets = this.expandTemplateVariable(options.targets, options.scopedVars, this.templateSrv);\n\n var queries = _.filter(options.targets, item => {\n return (\n item.hide !== true && !!item.region && !!item.namespace && !!item.metricName && !_.isEmpty(item.statistics)\n );\n }).map(item => {\n item.region = this.templateSrv.replace(this.getActualRegion(item.region), options.scopedVars);\n item.namespace = this.templateSrv.replace(item.namespace, options.scopedVars);\n item.metricName = this.templateSrv.replace(item.metricName, options.scopedVars);\n item.dimensions = this.convertDimensionFormat(item.dimensions, options.scopedVars);\n item.period = String(this.getPeriod(item, options)); // use string format for period in graph query, and alerting\n\n return _.extend(\n {\n refId: item.refId,\n intervalMs: options.intervalMs,\n maxDataPoints: options.maxDataPoints,\n datasourceId: this.instanceSettings.id,\n type: 'timeSeriesQuery',\n },\n item\n );\n });\n\n // No valid targets, return the empty result to save a round trip.\n if (_.isEmpty(queries)) {\n var d = this.$q.defer();\n d.resolve({ data: [] });\n return d.promise;\n }\n\n var request = {\n from: options.range.from.valueOf().toString(),\n to: options.range.to.valueOf().toString(),\n queries: queries,\n };\n\n return this.performTimeSeriesQuery(request);\n }\n\n getPeriod(target, options, now?) {\n var start = this.convertToCloudWatchTime(options.range.from, false);\n var end = this.convertToCloudWatchTime(options.range.to, true);\n now = Math.round((now || Date.now()) / 1000);\n\n var period;\n var range = end - start;\n\n var hourSec = 60 * 60;\n var daySec = hourSec * 24;\n var periodUnit = 60;\n if (!target.period) {\n if (now - start <= daySec * 15) {\n // until 15 days ago\n if (target.namespace === 'AWS/EC2') {\n periodUnit = period = 300;\n } else {\n periodUnit = period = 60;\n }\n } else if (now - start <= daySec * 63) {\n // until 63 days ago\n periodUnit = period = 60 * 5;\n } else if (now - start <= daySec * 455) {\n // until 455 days ago\n periodUnit = period = 60 * 60;\n } else {\n // over 455 days, should return error, but try to long period\n periodUnit = period = 60 * 60;\n }\n } else {\n if (/^\\d+$/.test(target.period)) {\n period = parseInt(target.period, 10);\n } else {\n period = kbn.interval_to_seconds(this.templateSrv.replace(target.period, options.scopedVars));\n }\n }\n if (period < 1) {\n period = 1;\n }\n if (!target.highResolution && range / period >= 1440) {\n period = Math.ceil(range / 1440 / periodUnit) * periodUnit;\n }\n\n return period;\n }\n\n performTimeSeriesQuery(request) {\n return this.awsRequest('/api/tsdb/query', request).then(res => {\n var data = [];\n\n if (res.results) {\n _.forEach(res.results, queryRes => {\n _.forEach(queryRes.series, series => {\n data.push({ target: series.name, datapoints: series.points });\n });\n });\n }\n\n return { data: data };\n });\n }\n\n transformSuggestDataFromTable(suggestData) {\n return _.map(suggestData.results['metricFindQuery'].tables[0].rows, v => {\n return {\n text: v[0],\n value: v[1],\n };\n });\n }\n\n doMetricQueryRequest(subtype, parameters) {\n var range = this.timeSrv.timeRange();\n return this.awsRequest('/api/tsdb/query', {\n from: range.from.valueOf().toString(),\n to: range.to.valueOf().toString(),\n queries: [\n _.extend(\n {\n refId: 'metricFindQuery',\n intervalMs: 1, // dummy\n maxDataPoints: 1, // dummy\n datasourceId: this.instanceSettings.id,\n type: 'metricFindQuery',\n subtype: subtype,\n },\n parameters\n ),\n ],\n }).then(r => {\n return this.transformSuggestDataFromTable(r);\n });\n }\n\n getRegions() {\n return this.doMetricQueryRequest('regions', null);\n }\n\n getNamespaces() {\n return this.doMetricQueryRequest('namespaces', null);\n }\n\n getMetrics(namespace, region) {\n return this.doMetricQueryRequest('metrics', {\n region: this.templateSrv.replace(this.getActualRegion(region)),\n namespace: this.templateSrv.replace(namespace),\n });\n }\n\n getDimensionKeys(namespace, region) {\n return this.doMetricQueryRequest('dimension_keys', {\n region: this.templateSrv.replace(this.getActualRegion(region)),\n namespace: this.templateSrv.replace(namespace),\n });\n }\n\n getDimensionValues(region, namespace, metricName, dimensionKey, filterDimensions) {\n return this.doMetricQueryRequest('dimension_values', {\n region: this.templateSrv.replace(this.getActualRegion(region)),\n namespace: this.templateSrv.replace(namespace),\n metricName: this.templateSrv.replace(metricName),\n dimensionKey: this.templateSrv.replace(dimensionKey),\n dimensions: this.convertDimensionFormat(filterDimensions, {}),\n });\n }\n\n getEbsVolumeIds(region, instanceId) {\n return this.doMetricQueryRequest('ebs_volume_ids', {\n region: this.templateSrv.replace(this.getActualRegion(region)),\n instanceId: this.templateSrv.replace(instanceId),\n });\n }\n\n getEc2InstanceAttribute(region, attributeName, filters) {\n return this.doMetricQueryRequest('ec2_instance_attribute', {\n region: this.templateSrv.replace(this.getActualRegion(region)),\n attributeName: this.templateSrv.replace(attributeName),\n filters: filters,\n });\n }\n\n metricFindQuery(query) {\n var region;\n var namespace;\n var metricName;\n var filterJson;\n\n var regionQuery = query.match(/^regions\\(\\)/);\n if (regionQuery) {\n return this.getRegions();\n }\n\n var namespaceQuery = query.match(/^namespaces\\(\\)/);\n if (namespaceQuery) {\n return this.getNamespaces();\n }\n\n var metricNameQuery = query.match(/^metrics\\(([^\\)]+?)(,\\s?([^,]+?))?\\)/);\n if (metricNameQuery) {\n namespace = metricNameQuery[1];\n region = metricNameQuery[3];\n return this.getMetrics(namespace, region);\n }\n\n var dimensionKeysQuery = query.match(/^dimension_keys\\(([^\\)]+?)(,\\s?([^,]+?))?\\)/);\n if (dimensionKeysQuery) {\n namespace = dimensionKeysQuery[1];\n region = dimensionKeysQuery[3];\n return this.getDimensionKeys(namespace, region);\n }\n\n var dimensionValuesQuery = query.match(\n /^dimension_values\\(([^,]+?),\\s?([^,]+?),\\s?([^,]+?),\\s?([^,]+?)(,\\s?(.+))?\\)/\n );\n if (dimensionValuesQuery) {\n region = dimensionValuesQuery[1];\n namespace = dimensionValuesQuery[2];\n metricName = dimensionValuesQuery[3];\n var dimensionKey = dimensionValuesQuery[4];\n filterJson = {};\n if (dimensionValuesQuery[6]) {\n filterJson = JSON.parse(this.templateSrv.replace(dimensionValuesQuery[6]));\n }\n\n return this.getDimensionValues(region, namespace, metricName, dimensionKey, filterJson);\n }\n\n var ebsVolumeIdsQuery = query.match(/^ebs_volume_ids\\(([^,]+?),\\s?([^,]+?)\\)/);\n if (ebsVolumeIdsQuery) {\n region = ebsVolumeIdsQuery[1];\n var instanceId = ebsVolumeIdsQuery[2];\n return this.getEbsVolumeIds(region, instanceId);\n }\n\n var ec2InstanceAttributeQuery = query.match(/^ec2_instance_attribute\\(([^,]+?),\\s?([^,]+?),\\s?(.+?)\\)/);\n if (ec2InstanceAttributeQuery) {\n region = ec2InstanceAttributeQuery[1];\n var targetAttributeName = ec2InstanceAttributeQuery[2];\n filterJson = JSON.parse(this.templateSrv.replace(ec2InstanceAttributeQuery[3]));\n return this.getEc2InstanceAttribute(region, targetAttributeName, filterJson);\n }\n\n return this.$q.when([]);\n }\n\n annotationQuery(options) {\n var annotation = options.annotation;\n var statistics = _.map(annotation.statistics, s => {\n return this.templateSrv.replace(s);\n });\n var defaultPeriod = annotation.prefixMatching ? '' : '300';\n var period = annotation.period || defaultPeriod;\n period = parseInt(period, 10);\n var parameters = {\n prefixMatching: annotation.prefixMatching,\n region: this.templateSrv.replace(this.getActualRegion(annotation.region)),\n namespace: this.templateSrv.replace(annotation.namespace),\n metricName: this.templateSrv.replace(annotation.metricName),\n dimensions: this.convertDimensionFormat(annotation.dimensions, {}),\n statistics: statistics,\n period: period,\n actionPrefix: annotation.actionPrefix || '',\n alarmNamePrefix: annotation.alarmNamePrefix || '',\n };\n\n return this.awsRequest('/api/tsdb/query', {\n from: options.range.from.valueOf().toString(),\n to: options.range.to.valueOf().toString(),\n queries: [\n _.extend(\n {\n refId: 'annotationQuery',\n intervalMs: 1, // dummy\n maxDataPoints: 1, // dummy\n datasourceId: this.instanceSettings.id,\n type: 'annotationQuery',\n },\n parameters\n ),\n ],\n }).then(r => {\n return _.map(r.results['annotationQuery'].tables[0].rows, v => {\n return {\n annotation: annotation,\n time: Date.parse(v[0]),\n title: v[1],\n tags: [v[2]],\n text: v[3],\n };\n });\n });\n }\n\n targetContainsTemplate(target) {\n return (\n this.templateSrv.variableExists(target.region) ||\n this.templateSrv.variableExists(target.namespace) ||\n this.templateSrv.variableExists(target.metricName) ||\n _.find(target.dimensions, (v, k) => {\n return this.templateSrv.variableExists(k) || this.templateSrv.variableExists(v);\n })\n );\n }\n\n testDatasource() {\n /* use billing metrics for test */\n var region = this.defaultRegion;\n var namespace = 'AWS/Billing';\n var metricName = 'EstimatedCharges';\n var dimensions = {};\n\n return this.getDimensionValues(region, namespace, metricName, 'ServiceName', dimensions).then(\n () => {\n return { status: 'success', message: 'Data source is working' };\n },\n err => {\n return { status: 'error', message: err.message };\n }\n );\n }\n\n awsRequest(url, data) {\n var options = {\n method: 'POST',\n url: url,\n data: data,\n };\n\n return this.backendSrv.datasourceRequest(options).then(result => {\n return result.data;\n });\n }\n\n getDefaultRegion() {\n return this.defaultRegion;\n }\n\n getActualRegion(region) {\n if (region === 'default' || _.isEmpty(region)) {\n return this.getDefaultRegion();\n }\n return region;\n }\n\n getExpandedVariables(target, dimensionKey, variable, templateSrv) {\n /* if the all checkbox is marked we should add all values to the targets */\n var allSelected = _.find(variable.options, { selected: true, text: 'All' });\n return _.chain(variable.options)\n .filter(v => {\n if (allSelected) {\n return v.text !== 'All';\n } else {\n return v.selected;\n }\n })\n .map(v => {\n var t = angular.copy(target);\n var scopedVar = {};\n scopedVar[variable.name] = v;\n t.refId = target.refId + '_' + v.value;\n t.dimensions[dimensionKey] = templateSrv.replace(t.dimensions[dimensionKey], scopedVar);\n return t;\n })\n .value();\n }\n\n expandTemplateVariable(targets, scopedVars, templateSrv) {\n return _.chain(targets)\n .map(target => {\n var dimensionKey = _.findKey(target.dimensions, v => {\n return templateSrv.variableExists(v) && !_.has(scopedVars, templateSrv.getVariableName(v));\n });\n\n if (dimensionKey) {\n var multiVariable = _.find(templateSrv.variables, variable => {\n return (\n templatingVariable.containsVariable(target.dimensions[dimensionKey], variable.name) && variable.multi\n );\n });\n var variable = _.find(templateSrv.variables, variable => {\n return templatingVariable.containsVariable(target.dimensions[dimensionKey], variable.name);\n });\n return this.getExpandedVariables(target, dimensionKey, multiVariable || variable, templateSrv);\n } else {\n return [target];\n }\n })\n .flatten()\n .value();\n }\n\n convertToCloudWatchTime(date, roundUp) {\n if (_.isString(date)) {\n date = dateMath.parse(date, roundUp);\n }\n return Math.round(date.valueOf() / 1000);\n }\n\n convertDimensionFormat(dimensions, scopedVars) {\n var convertedDimensions = {};\n _.each(dimensions, (value, key) => {\n convertedDimensions[this.templateSrv.replace(key, scopedVars)] = this.templateSrv.replace(value, scopedVars);\n });\n return convertedDimensions;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/cloudwatch/datasource.ts","import './query_parameter_ctrl';\nimport { QueryCtrl } from 'app/plugins/sdk';\n\nexport class CloudWatchQueryCtrl extends QueryCtrl {\n static templateUrl = 'partials/query.editor.html';\n\n aliasSyntax: string;\n\n /** @ngInject **/\n constructor($scope, $injector) {\n super($scope, $injector);\n this.aliasSyntax = '{{metric}} {{stat}} {{namespace}} {{region}} {{}}';\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/cloudwatch/query_ctrl.ts","export class CloudWatchConfigCtrl {\n static templateUrl = 'partials/config.html';\n current: any;\n\n accessKeyExist = false;\n secretKeyExist = false;\n\n /** @ngInject */\n constructor($scope) {\n this.current.jsonData.timeField = this.current.jsonData.timeField || '@timestamp';\n this.current.jsonData.authType = this.current.jsonData.authType || 'credentials';\n\n this.accessKeyExist = this.current.secureJsonFields.accessKey;\n this.secretKeyExist = this.current.secureJsonFields.secretKey;\n }\n\n resetAccessKey() {\n this.accessKeyExist = false;\n }\n\n resetSecretKey() {\n this.secretKeyExist = false;\n }\n\n authTypes = [\n { name: 'Access & secret key', value: 'keys' },\n { name: 'Credentials file', value: 'credentials' },\n { name: 'ARN', value: 'arn' },\n ];\n\n indexPatternTypes = [\n { name: 'No pattern', value: undefined },\n { name: 'Hourly', value: 'Hourly', example: '[logstash-]YYYY.MM.DD.HH' },\n { name: 'Daily', value: 'Daily', example: '[logstash-]YYYY.MM.DD' },\n { name: 'Weekly', value: 'Weekly', example: '[logstash-]GGGG.WW' },\n { name: 'Monthly', value: 'Monthly', example: '[logstash-]YYYY.MM' },\n { name: 'Yearly', value: 'Yearly', example: '[logstash-]YYYY' },\n ];\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/cloudwatch/config_ctrl.ts","import { ElasticDatasource } from './datasource';\nimport { ElasticQueryCtrl } from './query_ctrl';\nimport { ElasticConfigCtrl } from './config_ctrl';\n\nclass ElasticAnnotationsQueryCtrl {\n static templateUrl = 'partials/annotations.editor.html';\n}\n\nexport {\n ElasticDatasource as Datasource,\n ElasticQueryCtrl as QueryCtrl,\n ElasticConfigCtrl as ConfigCtrl,\n ElasticAnnotationsQueryCtrl as AnnotationsQueryCtrl,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/elasticsearch/module.ts","import angular from 'angular';\nimport _ from 'lodash';\nimport moment from 'moment';\nimport { ElasticQueryBuilder } from './query_builder';\nimport { IndexPattern } from './index_pattern';\nimport { ElasticResponse } from './elastic_response';\n\nexport class ElasticDatasource {\n basicAuth: string;\n withCredentials: boolean;\n url: string;\n name: string;\n index: string;\n timeField: string;\n esVersion: number;\n interval: string;\n maxConcurrentShardRequests: number;\n queryBuilder: ElasticQueryBuilder;\n indexPattern: IndexPattern;\n\n /** @ngInject */\n constructor(instanceSettings, private $q, private backendSrv, private templateSrv, private timeSrv) {\n this.basicAuth = instanceSettings.basicAuth;\n this.withCredentials = instanceSettings.withCredentials;\n this.url = instanceSettings.url;\n this.name = instanceSettings.name;\n this.index = instanceSettings.index;\n this.timeField = instanceSettings.jsonData.timeField;\n this.esVersion = instanceSettings.jsonData.esVersion;\n this.indexPattern = new IndexPattern(instanceSettings.index, instanceSettings.jsonData.interval);\n this.interval = instanceSettings.jsonData.timeInterval;\n this.maxConcurrentShardRequests = instanceSettings.jsonData.maxConcurrentShardRequests;\n this.queryBuilder = new ElasticQueryBuilder({\n timeField: this.timeField,\n esVersion: this.esVersion,\n });\n }\n\n private request(method, url, data?) {\n var options: any = {\n url: this.url + '/' + url,\n method: method,\n data: data,\n };\n\n if (this.basicAuth || this.withCredentials) {\n options.withCredentials = true;\n }\n if (this.basicAuth) {\n options.headers = {\n Authorization: this.basicAuth,\n };\n }\n\n return this.backendSrv.datasourceRequest(options);\n }\n\n private get(url) {\n var range = this.timeSrv.timeRange();\n var index_list = this.indexPattern.getIndexList(range.from.valueOf(), range.to.valueOf());\n if (_.isArray(index_list) && index_list.length) {\n return this.request('GET', index_list[0] + url).then(function(results) {\n results.data.$$config = results.config;\n return results.data;\n });\n } else {\n return this.request('GET', this.indexPattern.getIndexForToday() + url).then(function(results) {\n results.data.$$config = results.config;\n return results.data;\n });\n }\n }\n\n private post(url, data) {\n return this.request('POST', url, data)\n .then(function(results) {\n results.data.$$config = results.config;\n return results.data;\n })\n .catch(err => {\n if (err.data && err.data.error) {\n throw {\n message: 'Elasticsearch error: ' + err.data.error.reason,\n error: err.data.error,\n };\n }\n\n throw err;\n });\n }\n\n annotationQuery(options) {\n var annotation = options.annotation;\n var timeField = annotation.timeField || '@timestamp';\n var queryString = annotation.query || '*';\n var tagsField = annotation.tagsField || 'tags';\n var textField = annotation.textField || null;\n\n var range = {};\n range[timeField] = {\n from: options.range.from.valueOf(),\n to: options.range.to.valueOf(),\n format: 'epoch_millis',\n };\n\n var queryInterpolated = this.templateSrv.replace(queryString, {}, 'lucene');\n var query = {\n bool: {\n filter: [\n { range: range },\n {\n query_string: {\n query: queryInterpolated,\n },\n },\n ],\n },\n };\n\n var data = {\n query: query,\n size: 10000,\n };\n\n // fields field not supported on ES 5.x\n if (this.esVersion < 5) {\n data['fields'] = [timeField, '_source'];\n }\n\n var header: any = {\n search_type: 'query_then_fetch',\n ignore_unavailable: true,\n };\n\n // old elastic annotations had index specified on them\n if (annotation.index) {\n header.index = annotation.index;\n } else {\n header.index = this.indexPattern.getIndexList(options.range.from, options.range.to);\n }\n\n var payload = angular.toJson(header) + '\\n' + angular.toJson(data) + '\\n';\n\n return this.post('_msearch', payload).then(res => {\n var list = [];\n var hits = res.responses[0].hits.hits;\n\n var getFieldFromSource = function(source, fieldName) {\n if (!fieldName) {\n return;\n }\n\n var fieldNames = fieldName.split('.');\n var fieldValue = source;\n\n for (var i = 0; i < fieldNames.length; i++) {\n fieldValue = fieldValue[fieldNames[i]];\n if (!fieldValue) {\n console.log('could not find field in annotation: ', fieldName);\n return '';\n }\n }\n\n return fieldValue;\n };\n\n for (var i = 0; i < hits.length; i++) {\n var source = hits[i]._source;\n var time = getFieldFromSource(source, timeField);\n if (typeof hits[i].fields !== 'undefined') {\n var fields = hits[i].fields;\n if (_.isString(fields[timeField]) || _.isNumber(fields[timeField])) {\n time = fields[timeField];\n }\n }\n\n var event = {\n annotation: annotation,\n time: moment.utc(time).valueOf(),\n text: getFieldFromSource(source, textField),\n tags: getFieldFromSource(source, tagsField),\n };\n\n // legacy support for title tield\n if (annotation.titleField) {\n const title = getFieldFromSource(source, annotation.titleField);\n if (title) {\n event.text = title + '\\n' + event.text;\n }\n }\n\n if (typeof event.tags === 'string') {\n event.tags = event.tags.split(',');\n }\n\n list.push(event);\n }\n return list;\n });\n }\n\n testDatasource() {\n this.timeSrv.setTime({ from: 'now-1m', to: 'now' }, true);\n // validate that the index exist and has date field\n return this.getFields({ type: 'date' }).then(\n function(dateFields) {\n var timeField = _.find(dateFields, { text: this.timeField });\n if (!timeField) {\n return {\n status: 'error',\n message: 'No date field named ' + this.timeField + ' found',\n };\n }\n return { status: 'success', message: 'Index OK. Time field name OK.' };\n }.bind(this),\n function(err) {\n console.log(err);\n if (err.data && err.data.error) {\n var message = angular.toJson(err.data.error);\n if (err.data.error.reason) {\n message = err.data.error.reason;\n }\n return { status: 'error', message: message };\n } else {\n return { status: 'error', message: err.status };\n }\n }\n );\n }\n\n getQueryHeader(searchType, timeFrom, timeTo) {\n var query_header: any = {\n search_type: searchType,\n ignore_unavailable: true,\n index: this.indexPattern.getIndexList(timeFrom, timeTo),\n };\n if (this.esVersion >= 56) {\n query_header['max_concurrent_shard_requests'] = this.maxConcurrentShardRequests;\n }\n return angular.toJson(query_header);\n }\n\n query(options) {\n var payload = '';\n var target;\n var sentTargets = [];\n\n // add global adhoc filters to timeFilter\n var adhocFilters = this.templateSrv.getAdhocFilters(this.name);\n\n for (var i = 0; i < options.targets.length; i++) {\n target = options.targets[i];\n if (target.hide) {\n continue;\n }\n\n var queryString = this.templateSrv.replace(target.query || '*', options.scopedVars, 'lucene');\n var queryObj = this.queryBuilder.build(target, adhocFilters, queryString);\n var esQuery = angular.toJson(queryObj);\n\n var searchType = queryObj.size === 0 && this.esVersion < 5 ? 'count' : 'query_then_fetch';\n var header = this.getQueryHeader(searchType, options.range.from, options.range.to);\n payload += header + '\\n';\n\n payload += esQuery + '\\n';\n sentTargets.push(target);\n }\n\n if (sentTargets.length === 0) {\n return this.$q.when([]);\n }\n\n payload = payload.replace(/\\$timeFrom/g, options.range.from.valueOf());\n payload = payload.replace(/\\$timeTo/g, options.range.to.valueOf());\n payload = this.templateSrv.replace(payload, options.scopedVars);\n\n return this.post('_msearch', payload).then(function(res) {\n return new ElasticResponse(sentTargets, res).getTimeSeries();\n });\n }\n\n getFields(query) {\n return this.get('/_mapping').then(function(result) {\n var typeMap = {\n float: 'number',\n double: 'number',\n integer: 'number',\n long: 'number',\n date: 'date',\n string: 'string',\n text: 'string',\n scaled_float: 'number',\n nested: 'nested',\n };\n\n function shouldAddField(obj, key, query) {\n if (key[0] === '_') {\n return false;\n }\n\n if (!query.type) {\n return true;\n }\n\n // equal query type filter, or via typemap translation\n return query.type === obj.type || query.type === typeMap[obj.type];\n }\n\n // Store subfield names: [system, process, cpu, total] -> system.process.cpu.total\n var fieldNameParts = [];\n var fields = {};\n\n function getFieldsRecursively(obj) {\n for (var key in obj) {\n var subObj = obj[key];\n\n // Check mapping field for nested fields\n if (_.isObject(subObj.properties)) {\n fieldNameParts.push(key);\n getFieldsRecursively(subObj.properties);\n }\n\n if (_.isObject(subObj.fields)) {\n fieldNameParts.push(key);\n getFieldsRecursively(subObj.fields);\n }\n\n if (_.isString(subObj.type)) {\n var fieldName = fieldNameParts.concat(key).join('.');\n\n // Hide meta-fields and check field type\n if (shouldAddField(subObj, key, query)) {\n fields[fieldName] = {\n text: fieldName,\n type: subObj.type,\n };\n }\n }\n }\n fieldNameParts.pop();\n }\n\n for (var indexName in result) {\n var index = result[indexName];\n if (index && index.mappings) {\n var mappings = index.mappings;\n for (var typeName in mappings) {\n var properties = mappings[typeName].properties;\n getFieldsRecursively(properties);\n }\n }\n }\n\n // transform to array\n return _.map(fields, function(value) {\n return value;\n });\n });\n }\n\n getTerms(queryDef) {\n var range = this.timeSrv.timeRange();\n var searchType = this.esVersion >= 5 ? 'query_then_fetch' : 'count';\n var header = this.getQueryHeader(searchType, range.from, range.to);\n var esQuery = angular.toJson(this.queryBuilder.getTermsQuery(queryDef));\n\n esQuery = esQuery.replace(/\\$timeFrom/g, range.from.valueOf());\n esQuery = esQuery.replace(/\\$timeTo/g, range.to.valueOf());\n esQuery = header + '\\n' + esQuery + '\\n';\n\n return this.post('_msearch?search_type=' + searchType, esQuery).then(function(res) {\n if (!res.responses[0].aggregations) {\n return [];\n }\n\n var buckets = res.responses[0].aggregations['1'].buckets;\n return _.map(buckets, function(bucket) {\n return {\n text: bucket.key_as_string || bucket.key,\n value: bucket.key,\n };\n });\n });\n }\n\n metricFindQuery(query) {\n query = angular.fromJson(query);\n if (!query) {\n return this.$q.when([]);\n }\n\n if (query.find === 'fields') {\n query.field = this.templateSrv.replace(query.field, {}, 'lucene');\n return this.getFields(query);\n }\n\n if (query.find === 'terms') {\n query.field = this.templateSrv.replace(query.field, {}, 'lucene');\n query.query = this.templateSrv.replace(query.query || '*', {}, 'lucene');\n return this.getTerms(query);\n }\n }\n\n getTagKeys() {\n return this.getFields({});\n }\n\n getTagValues(options) {\n return this.getTerms({ field: options.key, query: '*' });\n }\n\n targetContainsTemplate(target) {\n if (this.templateSrv.variableExists(target.query) || this.templateSrv.variableExists(target.alias)) {\n return true;\n }\n\n for (let bucketAgg of target.bucketAggs) {\n if (this.templateSrv.variableExists(bucketAgg.field) || this.objectContainsTemplate(bucketAgg.settings)) {\n return true;\n }\n }\n\n for (let metric of target.metrics) {\n if (\n this.templateSrv.variableExists(metric.field) ||\n this.objectContainsTemplate(metric.settings) ||\n this.objectContainsTemplate(metric.meta)\n ) {\n return true;\n }\n }\n\n return false;\n }\n\n private isPrimitive(obj) {\n if (obj === null || obj === undefined) {\n return true;\n }\n if (['string', 'number', 'boolean'].some(type => type === typeof true)) {\n return true;\n }\n\n return false;\n }\n\n private objectContainsTemplate(obj) {\n if (!obj) {\n return false;\n }\n\n for (let key of Object.keys(obj)) {\n if (this.isPrimitive(obj[key])) {\n if (this.templateSrv.variableExists(obj[key])) {\n return true;\n }\n } else if (Array.isArray(obj[key])) {\n for (let item of obj[key]) {\n if (this.objectContainsTemplate(item)) {\n return true;\n }\n }\n } else {\n if (this.objectContainsTemplate(obj[key])) {\n return true;\n }\n }\n }\n\n return false;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/elasticsearch/datasource.ts","import * as queryDef from './query_def';\n\nexport class ElasticQueryBuilder {\n timeField: string;\n esVersion: number;\n\n constructor(options) {\n this.timeField = options.timeField;\n this.esVersion = options.esVersion;\n }\n\n getRangeFilter() {\n var filter = {};\n filter[this.timeField] = {\n gte: '$timeFrom',\n lte: '$timeTo',\n format: 'epoch_millis',\n };\n\n return filter;\n }\n\n buildTermsAgg(aggDef, queryNode, target) {\n var metricRef, metric, y;\n queryNode.terms = { field: aggDef.field };\n\n if (!aggDef.settings) {\n return queryNode;\n }\n\n queryNode.terms.size = parseInt(aggDef.settings.size, 10) === 0 ? 500 : parseInt(aggDef.settings.size, 10);\n if (aggDef.settings.orderBy !== void 0) {\n queryNode.terms.order = {};\n queryNode.terms.order[aggDef.settings.orderBy] = aggDef.settings.order;\n\n // if metric ref, look it up and add it to this agg level\n metricRef = parseInt(aggDef.settings.orderBy, 10);\n if (!isNaN(metricRef)) {\n for (y = 0; y < target.metrics.length; y++) {\n metric = target.metrics[y];\n if (metric.id === aggDef.settings.orderBy) {\n queryNode.aggs = {};\n queryNode.aggs[metric.id] = {};\n queryNode.aggs[metric.id][metric.type] = { field: metric.field };\n break;\n }\n }\n }\n }\n\n if (aggDef.settings.min_doc_count !== void 0) {\n queryNode.terms.min_doc_count = parseInt(aggDef.settings.min_doc_count, 10);\n }\n\n if (aggDef.settings.missing) {\n queryNode.terms.missing = aggDef.settings.missing;\n }\n\n return queryNode;\n }\n\n getDateHistogramAgg(aggDef) {\n var esAgg: any = {};\n var settings = aggDef.settings || {};\n esAgg.interval = settings.interval;\n esAgg.field = this.timeField;\n esAgg.min_doc_count = settings.min_doc_count || 0;\n esAgg.extended_bounds = { min: '$timeFrom', max: '$timeTo' };\n esAgg.format = 'epoch_millis';\n\n if (esAgg.interval === 'auto') {\n esAgg.interval = '$__interval';\n }\n\n if (settings.missing) {\n esAgg.missing = settings.missing;\n }\n\n return esAgg;\n }\n\n getHistogramAgg(aggDef) {\n var esAgg: any = {};\n var settings = aggDef.settings || {};\n esAgg.interval = settings.interval;\n esAgg.field = aggDef.field;\n esAgg.min_doc_count = settings.min_doc_count || 0;\n\n if (settings.missing) {\n esAgg.missing = settings.missing;\n }\n return esAgg;\n }\n\n getFiltersAgg(aggDef) {\n var filterObj = {};\n for (var i = 0; i < aggDef.settings.filters.length; i++) {\n var query = aggDef.settings.filters[i].query;\n var label = aggDef.settings.filters[i].label;\n label = label === '' || label === undefined ? query : label;\n filterObj[label] = {\n query_string: {\n query: query,\n analyze_wildcard: true,\n },\n };\n }\n\n return filterObj;\n }\n\n documentQuery(query, size) {\n query.size = size;\n query.sort = {};\n query.sort[this.timeField] = { order: 'desc', unmapped_type: 'boolean' };\n\n // fields field not supported on ES 5.x\n if (this.esVersion < 5) {\n query.fields = ['*', '_source'];\n }\n\n query.script_fields = {};\n if (this.esVersion < 5) {\n query.fielddata_fields = [this.timeField];\n } else {\n query.docvalue_fields = [this.timeField];\n }\n return query;\n }\n\n addAdhocFilters(query, adhocFilters) {\n if (!adhocFilters) {\n return;\n }\n\n var i, filter, condition, queryCondition;\n\n for (i = 0; i < adhocFilters.length; i++) {\n filter = adhocFilters[i];\n condition = {};\n condition[filter.key] = filter.value;\n queryCondition = {};\n queryCondition[filter.key] = { query: filter.value };\n\n switch (filter.operator) {\n case '=':\n if (!query.query.bool.must) {\n query.query.bool.must = [];\n }\n query.query.bool.must.push({ match_phrase: queryCondition });\n break;\n case '!=':\n if (!query.query.bool.must_not) {\n query.query.bool.must_not = [];\n }\n query.query.bool.must_not.push({ match_phrase: queryCondition });\n break;\n case '<':\n condition[filter.key] = { lt: filter.value };\n query.query.bool.filter.push({ range: condition });\n break;\n case '>':\n condition[filter.key] = { gt: filter.value };\n query.query.bool.filter.push({ range: condition });\n break;\n case '=~':\n query.query.bool.filter.push({ regexp: condition });\n break;\n case '!~':\n query.query.bool.filter.push({\n bool: { must_not: { regexp: condition } },\n });\n break;\n }\n }\n }\n\n build(target, adhocFilters?, queryString?) {\n // make sure query has defaults;\n target.metrics = target.metrics || [{ type: 'count', id: '1' }];\n target.bucketAggs = target.bucketAggs || [{ type: 'date_histogram', id: '2', settings: { interval: 'auto' } }];\n target.timeField = this.timeField;\n\n var i, nestedAggs, metric;\n var query = {\n size: 0,\n query: {\n bool: {\n filter: [\n { range: this.getRangeFilter() },\n {\n query_string: {\n analyze_wildcard: true,\n query: queryString,\n },\n },\n ],\n },\n },\n };\n\n this.addAdhocFilters(query, adhocFilters);\n\n // handle document query\n if (target.bucketAggs.length === 0) {\n metric = target.metrics[0];\n if (!metric || metric.type !== 'raw_document') {\n throw { message: 'Invalid query' };\n }\n\n var size = (metric.settings && metric.settings.size) || 500;\n return this.documentQuery(query, size);\n }\n\n nestedAggs = query;\n\n for (i = 0; i < target.bucketAggs.length; i++) {\n var aggDef = target.bucketAggs[i];\n var esAgg = {};\n\n switch (aggDef.type) {\n case 'date_histogram': {\n esAgg['date_histogram'] = this.getDateHistogramAgg(aggDef);\n break;\n }\n case 'histogram': {\n esAgg['histogram'] = this.getHistogramAgg(aggDef);\n break;\n }\n case 'filters': {\n esAgg['filters'] = { filters: this.getFiltersAgg(aggDef) };\n break;\n }\n case 'terms': {\n this.buildTermsAgg(aggDef, esAgg, target);\n break;\n }\n case 'geohash_grid': {\n esAgg['geohash_grid'] = {\n field: aggDef.field,\n precision: aggDef.settings.precision,\n };\n break;\n }\n }\n\n nestedAggs.aggs = nestedAggs.aggs || {};\n nestedAggs.aggs[aggDef.id] = esAgg;\n nestedAggs = esAgg;\n }\n\n nestedAggs.aggs = {};\n\n for (i = 0; i < target.metrics.length; i++) {\n metric = target.metrics[i];\n if (metric.type === 'count') {\n continue;\n }\n\n var aggField = {};\n var metricAgg = null;\n\n if (queryDef.isPipelineAgg(metric.type)) {\n if (metric.pipelineAgg && /^\\d*$/.test(metric.pipelineAgg)) {\n metricAgg = { buckets_path: metric.pipelineAgg };\n } else {\n continue;\n }\n } else {\n metricAgg = { field: metric.field };\n }\n\n for (var prop in metric.settings) {\n if (metric.settings.hasOwnProperty(prop) && metric.settings[prop] !== null) {\n metricAgg[prop] = metric.settings[prop];\n }\n }\n\n aggField[metric.type] = metricAgg;\n nestedAggs.aggs[metric.id] = aggField;\n }\n\n return query;\n }\n\n getTermsQuery(queryDef) {\n var query: any = {\n size: 0,\n query: {\n bool: {\n filter: [{ range: this.getRangeFilter() }],\n },\n },\n };\n\n if (queryDef.query) {\n query.query.bool.filter.push({\n query_string: {\n analyze_wildcard: true,\n query: queryDef.query,\n },\n });\n }\n\n var size = 500;\n if (queryDef.size) {\n size = queryDef.size;\n }\n\n query.aggs = {\n '1': {\n terms: {\n field: queryDef.field,\n size: size,\n order: {\n _term: 'asc',\n },\n },\n },\n };\n return query;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/elasticsearch/query_builder.ts","import moment from 'moment';\n\nconst intervalMap = {\n Hourly: { startOf: 'hour', amount: 'hours' },\n Daily: { startOf: 'day', amount: 'days' },\n Weekly: { startOf: 'isoWeek', amount: 'weeks' },\n Monthly: { startOf: 'month', amount: 'months' },\n Yearly: { startOf: 'year', amount: 'years' },\n};\n\nexport class IndexPattern {\n constructor(private pattern, private interval: string | null) {}\n\n getIndexForToday() {\n if (this.interval) {\n return moment.utc().format(this.pattern);\n } else {\n return this.pattern;\n }\n }\n\n getIndexList(from, to) {\n if (!this.interval) {\n return this.pattern;\n }\n\n var intervalInfo = intervalMap[this.interval];\n var start = moment(from)\n .utc()\n .startOf(intervalInfo.startOf);\n var endEpoch = moment(to)\n .utc()\n .startOf(intervalInfo.startOf)\n .valueOf();\n var indexList = [];\n\n while (start.valueOf() <= endEpoch) {\n indexList.push(start.format(this.pattern));\n start.add(1, intervalInfo.amount);\n }\n\n return indexList;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/elasticsearch/index_pattern.ts","import _ from 'lodash';\nimport * as queryDef from './query_def';\nimport TableModel from 'app/core/table_model';\n\nexport class ElasticResponse {\n constructor(private targets, private response) {\n this.targets = targets;\n this.response = response;\n }\n\n processMetrics(esAgg, target, seriesList, props) {\n var metric, y, i, newSeries, bucket, value;\n\n for (y = 0; y < target.metrics.length; y++) {\n metric = target.metrics[y];\n if (metric.hide) {\n continue;\n }\n\n switch (metric.type) {\n case 'count': {\n newSeries = { datapoints: [], metric: 'count', props: props };\n for (i = 0; i < esAgg.buckets.length; i++) {\n bucket = esAgg.buckets[i];\n value = bucket.doc_count;\n newSeries.datapoints.push([value, bucket.key]);\n }\n seriesList.push(newSeries);\n break;\n }\n case 'percentiles': {\n if (esAgg.buckets.length === 0) {\n break;\n }\n\n var firstBucket = esAgg.buckets[0];\n var percentiles = firstBucket[metric.id].values;\n\n for (var percentileName in percentiles) {\n newSeries = {\n datapoints: [],\n metric: 'p' + percentileName,\n props: props,\n field: metric.field,\n };\n\n for (i = 0; i < esAgg.buckets.length; i++) {\n bucket = esAgg.buckets[i];\n var values = bucket[metric.id].values;\n newSeries.datapoints.push([values[percentileName], bucket.key]);\n }\n seriesList.push(newSeries);\n }\n\n break;\n }\n case 'extended_stats': {\n for (var statName in metric.meta) {\n if (!metric.meta[statName]) {\n continue;\n }\n\n newSeries = {\n datapoints: [],\n metric: statName,\n props: props,\n field: metric.field,\n };\n\n for (i = 0; i < esAgg.buckets.length; i++) {\n bucket = esAgg.buckets[i];\n var stats = bucket[metric.id];\n\n // add stats that are in nested obj to top level obj\n stats.std_deviation_bounds_upper = stats.std_deviation_bounds.upper;\n stats.std_deviation_bounds_lower = stats.std_deviation_bounds.lower;\n\n newSeries.datapoints.push([stats[statName], bucket.key]);\n }\n\n seriesList.push(newSeries);\n }\n\n break;\n }\n default: {\n newSeries = {\n datapoints: [],\n metric: metric.type,\n field: metric.field,\n props: props,\n };\n for (i = 0; i < esAgg.buckets.length; i++) {\n bucket = esAgg.buckets[i];\n\n value = bucket[metric.id];\n if (value !== undefined) {\n if (value.normalized_value) {\n newSeries.datapoints.push([value.normalized_value, bucket.key]);\n } else {\n newSeries.datapoints.push([value.value, bucket.key]);\n }\n }\n }\n seriesList.push(newSeries);\n break;\n }\n }\n }\n }\n\n processAggregationDocs(esAgg, aggDef, target, table, props) {\n // add columns\n if (table.columns.length === 0) {\n for (let propKey of _.keys(props)) {\n table.addColumn({ text: propKey, filterable: true });\n }\n table.addColumn({ text: aggDef.field, filterable: true });\n }\n\n // helper func to add values to value array\n let addMetricValue = (values, metricName, value) => {\n table.addColumn({ text: metricName });\n values.push(value);\n };\n\n for (let bucket of esAgg.buckets) {\n let values = [];\n\n for (let propValues of _.values(props)) {\n values.push(propValues);\n }\n\n // add bucket key (value)\n values.push(bucket.key);\n\n for (let metric of target.metrics) {\n switch (metric.type) {\n case 'count': {\n addMetricValue(values, this.getMetricName(metric.type), bucket.doc_count);\n break;\n }\n case 'extended_stats': {\n for (var statName in metric.meta) {\n if (!metric.meta[statName]) {\n continue;\n }\n\n var stats = bucket[metric.id];\n // add stats that are in nested obj to top level obj\n stats.std_deviation_bounds_upper = stats.std_deviation_bounds.upper;\n stats.std_deviation_bounds_lower = stats.std_deviation_bounds.lower;\n\n addMetricValue(values, this.getMetricName(statName), stats[statName]);\n }\n break;\n }\n default: {\n let metricName = this.getMetricName(metric.type);\n let otherMetrics = _.filter(target.metrics, { type: metric.type });\n\n // if more of the same metric type include field field name in property\n if (otherMetrics.length > 1) {\n metricName += ' ' + metric.field;\n }\n\n addMetricValue(values, metricName, bucket[metric.id].value);\n break;\n }\n }\n }\n\n table.rows.push(values);\n }\n }\n\n // This is quite complex\n // need to recurise down the nested buckets to build series\n processBuckets(aggs, target, seriesList, table, props, depth) {\n var bucket, aggDef, esAgg, aggId;\n var maxDepth = target.bucketAggs.length - 1;\n\n for (aggId in aggs) {\n aggDef = _.find(target.bucketAggs, { id: aggId });\n esAgg = aggs[aggId];\n\n if (!aggDef) {\n continue;\n }\n\n if (depth === maxDepth) {\n if (aggDef.type === 'date_histogram') {\n this.processMetrics(esAgg, target, seriesList, props);\n } else {\n this.processAggregationDocs(esAgg, aggDef, target, table, props);\n }\n } else {\n for (var nameIndex in esAgg.buckets) {\n bucket = esAgg.buckets[nameIndex];\n props = _.clone(props);\n if (bucket.key !== void 0) {\n props[aggDef.field] = bucket.key;\n } else {\n props['filter'] = nameIndex;\n }\n if (bucket.key_as_string) {\n props[aggDef.field] = bucket.key_as_string;\n }\n this.processBuckets(bucket, target, seriesList, table, props, depth + 1);\n }\n }\n }\n }\n\n private getMetricName(metric) {\n var metricDef = _.find(queryDef.metricAggTypes, { value: metric });\n if (!metricDef) {\n metricDef = _.find(queryDef.extendedStats, { value: metric });\n }\n\n return metricDef ? metricDef.text : metric;\n }\n\n private getSeriesName(series, target, metricTypeCount) {\n var metricName = this.getMetricName(series.metric);\n\n if (target.alias) {\n var regex = /\\{\\{([\\s\\S]+?)\\}\\}/g;\n\n return target.alias.replace(regex, function(match, g1, g2) {\n var group = g1 || g2;\n\n if (group.indexOf('term ') === 0) {\n return series.props[group.substring(5)];\n }\n if (series.props[group] !== void 0) {\n return series.props[group];\n }\n if (group === 'metric') {\n return metricName;\n }\n if (group === 'field') {\n return series.field;\n }\n\n return match;\n });\n }\n\n if (series.field && queryDef.isPipelineAgg(series.metric)) {\n var appliedAgg = _.find(target.metrics, { id: series.field });\n if (appliedAgg) {\n metricName += ' ' + queryDef.describeMetric(appliedAgg);\n } else {\n metricName = 'Unset';\n }\n } else if (series.field) {\n metricName += ' ' + series.field;\n }\n\n var propKeys = _.keys(series.props);\n if (propKeys.length === 0) {\n return metricName;\n }\n\n var name = '';\n for (var propName in series.props) {\n name += series.props[propName] + ' ';\n }\n\n if (metricTypeCount === 1) {\n return name.trim();\n }\n\n return name.trim() + ' ' + metricName;\n }\n\n nameSeries(seriesList, target) {\n var metricTypeCount = _.uniq(_.map(seriesList, 'metric')).length;\n\n for (var i = 0; i < seriesList.length; i++) {\n var series = seriesList[i];\n series.target = this.getSeriesName(series, target, metricTypeCount);\n }\n }\n\n processHits(hits, seriesList) {\n var series = {\n target: 'docs',\n type: 'docs',\n datapoints: [],\n total: hits.total,\n filterable: true,\n };\n var propName, hit, doc, i;\n\n for (i = 0; i < hits.hits.length; i++) {\n hit = hits.hits[i];\n doc = {\n _id: hit._id,\n _type: hit._type,\n _index: hit._index,\n };\n\n if (hit._source) {\n for (propName in hit._source) {\n doc[propName] = hit._source[propName];\n }\n }\n\n for (propName in hit.fields) {\n doc[propName] = hit.fields[propName];\n }\n series.datapoints.push(doc);\n }\n\n seriesList.push(series);\n }\n\n trimDatapoints(aggregations, target) {\n var histogram = _.find(target.bucketAggs, { type: 'date_histogram' });\n\n var shouldDropFirstAndLast = histogram && histogram.settings && histogram.settings.trimEdges;\n if (shouldDropFirstAndLast) {\n var trim = histogram.settings.trimEdges;\n for (var prop in aggregations) {\n var points = aggregations[prop];\n if (points.datapoints.length > trim * 2) {\n points.datapoints = points.datapoints.slice(trim, points.datapoints.length - trim);\n }\n }\n }\n }\n\n getErrorFromElasticResponse(response, err) {\n var result: any = {};\n result.data = JSON.stringify(err, null, 4);\n if (err.root_cause && err.root_cause.length > 0 && err.root_cause[0].reason) {\n result.message = err.root_cause[0].reason;\n } else {\n result.message = err.reason || 'Unkown elastic error response';\n }\n\n if (response.$$config) {\n result.config = response.$$config;\n }\n\n return result;\n }\n\n getTimeSeries() {\n var seriesList = [];\n\n for (var i = 0; i < this.response.responses.length; i++) {\n var response = this.response.responses[i];\n if (response.error) {\n throw this.getErrorFromElasticResponse(this.response, response.error);\n }\n\n if (response.hits && response.hits.hits.length > 0) {\n this.processHits(response.hits, seriesList);\n }\n\n if (response.aggregations) {\n var aggregations = response.aggregations;\n var target = this.targets[i];\n var tmpSeriesList = [];\n var table = new TableModel();\n\n this.processBuckets(aggregations, target, tmpSeriesList, table, {}, 0);\n this.trimDatapoints(tmpSeriesList, target);\n this.nameSeries(tmpSeriesList, target);\n\n for (var y = 0; y < tmpSeriesList.length; y++) {\n seriesList.push(tmpSeriesList[y]);\n }\n\n if (table.rows.length > 0) {\n seriesList.push(table);\n }\n }\n }\n\n return { data: seriesList };\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/elasticsearch/elastic_response.ts","import './bucket_agg';\nimport './metric_agg';\n\nimport angular from 'angular';\nimport _ from 'lodash';\nimport * as queryDef from './query_def';\nimport { QueryCtrl } from 'app/plugins/sdk';\n\nexport class ElasticQueryCtrl extends QueryCtrl {\n static templateUrl = 'partials/query.editor.html';\n\n esVersion: any;\n rawQueryOld: string;\n\n /** @ngInject **/\n constructor($scope, $injector, private $rootScope, private uiSegmentSrv) {\n super($scope, $injector);\n\n this.esVersion = this.datasource.esVersion;\n this.queryUpdated();\n }\n\n getFields(type) {\n var jsonStr = angular.toJson({ find: 'fields', type: type });\n return this.datasource\n .metricFindQuery(jsonStr)\n .then(this.uiSegmentSrv.transformToSegments(false))\n .catch(this.handleQueryError.bind(this));\n }\n\n queryUpdated() {\n var newJson = angular.toJson(this.datasource.queryBuilder.build(this.target), true);\n if (this.rawQueryOld && newJson !== this.rawQueryOld) {\n this.refresh();\n }\n\n this.rawQueryOld = newJson;\n this.$rootScope.appEvent('elastic-query-updated');\n }\n\n getCollapsedText() {\n var metricAggs = this.target.metrics;\n var bucketAggs = this.target.bucketAggs;\n var metricAggTypes = queryDef.getMetricAggTypes(this.esVersion);\n var bucketAggTypes = queryDef.bucketAggTypes;\n var text = '';\n\n if (this.target.query) {\n text += 'Query: ' + this.target.query + ', ';\n }\n\n text += 'Metrics: ';\n\n _.each(metricAggs, (metric, index) => {\n var aggDef = _.find(metricAggTypes, { value: metric.type });\n text += aggDef.text + '(';\n if (aggDef.requiresField) {\n text += metric.field;\n }\n text += '), ';\n });\n\n _.each(bucketAggs, (bucketAgg, index) => {\n if (index === 0) {\n text += ' Group by: ';\n }\n\n var aggDef = _.find(bucketAggTypes, { value: bucketAgg.type });\n text += aggDef.text + '(';\n if (aggDef.requiresField) {\n text += bucketAgg.field;\n }\n text += '), ';\n });\n\n if (this.target.alias) {\n text += 'Alias: ' + this.target.alias;\n }\n\n return text;\n }\n\n handleQueryError(err) {\n this.error = err.message || 'Failed to issue metric query';\n return [];\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/elasticsearch/query_ctrl.ts","import angular from 'angular';\nimport _ from 'lodash';\nimport * as queryDef from './query_def';\n\nexport function elasticBucketAgg() {\n return {\n templateUrl: 'public/app/plugins/datasource/elasticsearch/partials/bucket_agg.html',\n controller: 'ElasticBucketAggCtrl',\n restrict: 'E',\n scope: {\n target: '=',\n index: '=',\n onChange: '&',\n getFields: '&',\n },\n };\n}\n\nexport class ElasticBucketAggCtrl {\n /** @nginject */\n constructor($scope, uiSegmentSrv, $q, $rootScope) {\n var bucketAggs = $scope.target.bucketAggs;\n\n $scope.orderByOptions = [];\n\n $scope.getBucketAggTypes = function() {\n return queryDef.bucketAggTypes;\n };\n\n $scope.getOrderOptions = function() {\n return queryDef.orderOptions;\n };\n\n $scope.getSizeOptions = function() {\n return queryDef.sizeOptions;\n };\n\n $rootScope.onAppEvent(\n 'elastic-query-updated',\n function() {\n $scope.validateModel();\n },\n $scope\n );\n\n $scope.init = function() {\n $scope.agg = bucketAggs[$scope.index];\n $scope.validateModel();\n };\n\n $scope.onChangeInternal = function() {\n $scope.onChange();\n };\n\n $scope.onTypeChanged = function() {\n $scope.agg.settings = {};\n $scope.showOptions = false;\n\n switch ($scope.agg.type) {\n case 'date_histogram':\n case 'histogram':\n case 'terms': {\n delete $scope.agg.query;\n $scope.agg.field = 'select field';\n break;\n }\n case 'filters': {\n delete $scope.agg.field;\n $scope.agg.query = '*';\n break;\n }\n case 'geohash_grid': {\n $scope.agg.settings.precision = 3;\n break;\n }\n }\n\n $scope.validateModel();\n $scope.onChange();\n };\n\n $scope.validateModel = function() {\n $scope.index = _.indexOf(bucketAggs, $scope.agg);\n $scope.isFirst = $scope.index === 0;\n $scope.bucketAggCount = bucketAggs.length;\n\n var settingsLinkText = '';\n var settings = $scope.agg.settings || {};\n\n switch ($scope.agg.type) {\n case 'terms': {\n settings.order = settings.order || 'desc';\n settings.size = settings.size || '10';\n settings.min_doc_count = settings.min_doc_count || 1;\n settings.orderBy = settings.orderBy || '_term';\n\n if (settings.size !== '0') {\n settingsLinkText = queryDef.describeOrder(settings.order) + ' ' + settings.size + ', ';\n }\n\n if (settings.min_doc_count > 0) {\n settingsLinkText += 'Min Doc Count: ' + settings.min_doc_count + ', ';\n }\n\n settingsLinkText += 'Order by: ' + queryDef.describeOrderBy(settings.orderBy, $scope.target);\n\n if (settings.size === '0') {\n settingsLinkText += ' (' + settings.order + ')';\n }\n\n break;\n }\n case 'filters': {\n settings.filters = settings.filters || [{ query: '*' }];\n settingsLinkText = _.reduce(\n settings.filters,\n function(memo, value, index) {\n memo += 'Q' + (index + 1) + ' = ' + value.query + ' ';\n return memo;\n },\n ''\n );\n if (settingsLinkText.length > 50) {\n settingsLinkText = settingsLinkText.substr(0, 50) + '...';\n }\n settingsLinkText = 'Filter Queries (' + settings.filters.length + ')';\n break;\n }\n case 'date_histogram': {\n settings.interval = settings.interval || 'auto';\n settings.min_doc_count = settings.min_doc_count || 0;\n $scope.agg.field = $scope.target.timeField;\n settingsLinkText = 'Interval: ' + settings.interval;\n\n if (settings.min_doc_count > 0) {\n settingsLinkText += ', Min Doc Count: ' + settings.min_doc_count;\n }\n\n if (settings.trimEdges === undefined || settings.trimEdges < 0) {\n settings.trimEdges = 0;\n }\n\n if (settings.trimEdges && settings.trimEdges > 0) {\n settingsLinkText += ', Trim edges: ' + settings.trimEdges;\n }\n break;\n }\n case 'histogram': {\n settings.interval = settings.interval || 1000;\n settings.min_doc_count = _.defaultTo(settings.min_doc_count, 1);\n settingsLinkText = 'Interval: ' + settings.interval;\n\n if (settings.min_doc_count > 0) {\n settingsLinkText += ', Min Doc Count: ' + settings.min_doc_count;\n }\n break;\n }\n case 'geohash_grid': {\n // limit precision to 7\n settings.precision = Math.max(Math.min(settings.precision, 7), 1);\n settingsLinkText = 'Precision: ' + settings.precision;\n break;\n }\n }\n\n $scope.settingsLinkText = settingsLinkText;\n $scope.agg.settings = settings;\n return true;\n };\n\n $scope.addFiltersQuery = function() {\n $scope.agg.settings.filters.push({ query: '*' });\n };\n\n $scope.removeFiltersQuery = function(filter) {\n $scope.agg.settings.filters = _.without($scope.agg.settings.filters, filter);\n };\n\n $scope.toggleOptions = function() {\n $scope.showOptions = !$scope.showOptions;\n };\n\n $scope.getOrderByOptions = function() {\n return queryDef.getOrderByOptions($scope.target);\n };\n\n $scope.getFieldsInternal = function() {\n if ($scope.agg.type === 'date_histogram') {\n return $scope.getFields({ $fieldType: 'date' });\n } else {\n return $scope.getFields();\n }\n };\n\n $scope.getIntervalOptions = function() {\n return $q.when(uiSegmentSrv.transformToSegments(true, 'interval')(queryDef.intervalOptions));\n };\n\n $scope.addBucketAgg = function() {\n // if last is date histogram add it before\n var lastBucket = bucketAggs[bucketAggs.length - 1];\n var addIndex = bucketAggs.length - 1;\n\n if (lastBucket && lastBucket.type === 'date_histogram') {\n addIndex -= 1;\n }\n\n var id = _.reduce(\n $scope.target.bucketAggs.concat($scope.target.metrics),\n function(max, val) {\n return parseInt(val.id) > max ? parseInt(val.id) : max;\n },\n 0\n );\n\n bucketAggs.splice(addIndex, 0, { type: 'terms', field: 'select field', id: (id + 1).toString(), fake: true });\n $scope.onChange();\n };\n\n $scope.removeBucketAgg = function() {\n bucketAggs.splice($scope.index, 1);\n $scope.onChange();\n };\n\n $scope.init();\n }\n}\n\nvar module = angular.module('grafana.directives');\nmodule.directive('elasticBucketAgg', elasticBucketAgg);\nmodule.controller('ElasticBucketAggCtrl', ElasticBucketAggCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/elasticsearch/bucket_agg.ts","import angular from 'angular';\nimport _ from 'lodash';\nimport * as queryDef from './query_def';\n\nexport function elasticMetricAgg() {\n return {\n templateUrl: 'public/app/plugins/datasource/elasticsearch/partials/metric_agg.html',\n controller: 'ElasticMetricAggCtrl',\n restrict: 'E',\n scope: {\n target: '=',\n index: '=',\n onChange: '&',\n getFields: '&',\n esVersion: '=',\n },\n };\n}\n\nexport class ElasticMetricAggCtrl {\n constructor($scope, uiSegmentSrv, $q, $rootScope) {\n var metricAggs = $scope.target.metrics;\n $scope.metricAggTypes = queryDef.getMetricAggTypes($scope.esVersion);\n $scope.extendedStats = queryDef.extendedStats;\n $scope.pipelineAggOptions = [];\n $scope.modelSettingsValues = {};\n\n $scope.init = function() {\n $scope.agg = metricAggs[$scope.index];\n $scope.validateModel();\n $scope.updatePipelineAggOptions();\n };\n\n $scope.updatePipelineAggOptions = function() {\n $scope.pipelineAggOptions = queryDef.getPipelineAggOptions($scope.target);\n };\n\n $rootScope.onAppEvent(\n 'elastic-query-updated',\n function() {\n $scope.index = _.indexOf(metricAggs, $scope.agg);\n $scope.updatePipelineAggOptions();\n $scope.validateModel();\n },\n $scope\n );\n\n $scope.validateModel = function() {\n $scope.isFirst = $scope.index === 0;\n $scope.isSingle = metricAggs.length === 1;\n $scope.settingsLinkText = '';\n $scope.aggDef = _.find($scope.metricAggTypes, { value: $scope.agg.type });\n\n if (queryDef.isPipelineAgg($scope.agg.type)) {\n $scope.agg.pipelineAgg = $scope.agg.pipelineAgg || 'select metric';\n $scope.agg.field = $scope.agg.pipelineAgg;\n\n var pipelineOptions = queryDef.getPipelineOptions($scope.agg);\n if (pipelineOptions.length > 0) {\n _.each(pipelineOptions, function(opt) {\n $scope.agg.settings[opt.text] = $scope.agg.settings[opt.text] || opt.default;\n });\n $scope.settingsLinkText = 'Options';\n }\n } else if (!$scope.agg.field) {\n $scope.agg.field = 'select field';\n }\n switch ($scope.agg.type) {\n case 'cardinality': {\n var precision_threshold = $scope.agg.settings.precision_threshold || '';\n $scope.settingsLinkText = 'Precision threshold: ' + precision_threshold;\n break;\n }\n case 'percentiles': {\n $scope.agg.settings.percents = $scope.agg.settings.percents || [25, 50, 75, 95, 99];\n $scope.settingsLinkText = 'Values: ' + $scope.agg.settings.percents.join(',');\n break;\n }\n case 'extended_stats': {\n if (_.keys($scope.agg.meta).length === 0) {\n $scope.agg.meta.std_deviation_bounds_lower = true;\n $scope.agg.meta.std_deviation_bounds_upper = true;\n }\n\n var stats = _.reduce(\n $scope.agg.meta,\n function(memo, val, key) {\n if (val) {\n var def = _.find($scope.extendedStats, { value: key });\n memo.push(def.text);\n }\n return memo;\n },\n []\n );\n\n $scope.settingsLinkText = 'Stats: ' + stats.join(', ');\n break;\n }\n case 'moving_avg': {\n $scope.movingAvgModelTypes = queryDef.movingAvgModelOptions;\n $scope.modelSettings = queryDef.getMovingAvgSettings($scope.agg.settings.model, true);\n $scope.updateMovingAvgModelSettings();\n break;\n }\n case 'raw_document': {\n $scope.agg.settings.size = $scope.agg.settings.size || 500;\n $scope.settingsLinkText = 'Size: ' + $scope.agg.settings.size;\n $scope.target.metrics.splice(0, $scope.target.metrics.length, $scope.agg);\n\n $scope.target.bucketAggs = [];\n break;\n }\n }\n if ($scope.aggDef.supportsInlineScript) {\n // I know this stores the inline script twice\n // but having it like this simplifes the query_builder\n var inlineScript = $scope.agg.inlineScript;\n if (inlineScript) {\n $scope.agg.settings.script = { inline: inlineScript };\n } else {\n delete $scope.agg.settings.script;\n }\n\n if ($scope.settingsLinkText === '') {\n $scope.settingsLinkText = 'Options';\n }\n }\n };\n\n $scope.toggleOptions = function() {\n $scope.showOptions = !$scope.showOptions;\n $scope.updatePipelineAggOptions();\n };\n\n $scope.onChangeInternal = function() {\n $scope.onChange();\n };\n\n $scope.updateMovingAvgModelSettings = function() {\n var modelSettingsKeys = [];\n var modelSettings = queryDef.getMovingAvgSettings($scope.agg.settings.model, false);\n for (var i = 0; i < modelSettings.length; i++) {\n modelSettingsKeys.push(modelSettings[i].value);\n }\n\n for (var key in $scope.agg.settings.settings) {\n if ($scope.agg.settings.settings[key] === null || modelSettingsKeys.indexOf(key) === -1) {\n delete $scope.agg.settings.settings[key];\n }\n }\n };\n\n $scope.onChangeClearInternal = function() {\n delete $scope.agg.settings.minimize;\n $scope.onChange();\n };\n\n $scope.onTypeChange = function() {\n $scope.agg.settings = {};\n $scope.agg.meta = {};\n $scope.showOptions = false;\n $scope.updatePipelineAggOptions();\n $scope.onChange();\n };\n\n $scope.getFieldsInternal = function() {\n if ($scope.agg.type === 'cardinality') {\n return $scope.getFields();\n }\n return $scope.getFields({ $fieldType: 'number' });\n };\n\n $scope.addMetricAgg = function() {\n var addIndex = metricAggs.length;\n\n var id = _.reduce(\n $scope.target.bucketAggs.concat($scope.target.metrics),\n function(max, val) {\n return parseInt(val.id) > max ? parseInt(val.id) : max;\n },\n 0\n );\n\n metricAggs.splice(addIndex, 0, { type: 'count', field: 'select field', id: (id + 1).toString() });\n $scope.onChange();\n };\n\n $scope.removeMetricAgg = function() {\n metricAggs.splice($scope.index, 1);\n $scope.onChange();\n };\n\n $scope.toggleShowMetric = function() {\n $scope.agg.hide = !$scope.agg.hide;\n if (!$scope.agg.hide) {\n delete $scope.agg.hide;\n }\n $scope.onChange();\n };\n\n $scope.init();\n }\n}\n\nvar module = angular.module('grafana.directives');\nmodule.directive('elasticMetricAgg', elasticMetricAgg);\nmodule.controller('ElasticMetricAggCtrl', ElasticMetricAggCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/elasticsearch/metric_agg.ts","import _ from 'lodash';\n\nexport class ElasticConfigCtrl {\n static templateUrl = 'public/app/plugins/datasource/elasticsearch/partials/config.html';\n current: any;\n\n /** @ngInject */\n constructor($scope) {\n this.current.jsonData.timeField = this.current.jsonData.timeField || '@timestamp';\n this.current.jsonData.esVersion = this.current.jsonData.esVersion || 5;\n this.current.jsonData.maxConcurrentShardRequests = this.current.jsonData.maxConcurrentShardRequests || 256;\n }\n\n indexPatternTypes = [\n { name: 'No pattern', value: undefined },\n { name: 'Hourly', value: 'Hourly', example: '[logstash-]YYYY.MM.DD.HH' },\n { name: 'Daily', value: 'Daily', example: '[logstash-]YYYY.MM.DD' },\n { name: 'Weekly', value: 'Weekly', example: '[logstash-]GGGG.WW' },\n { name: 'Monthly', value: 'Monthly', example: '[logstash-]YYYY.MM' },\n { name: 'Yearly', value: 'Yearly', example: '[logstash-]YYYY' },\n ];\n\n esVersions = [{ name: '2.x', value: 2 }, { name: '5.x', value: 5 }, { name: '5.6+', value: 56 }];\n\n indexPatternTypeChanged() {\n var def = _.find(this.indexPatternTypes, {\n value: this.current.jsonData.interval,\n });\n this.current.database = def.example || 'es-index-name';\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/elasticsearch/config_ctrl.ts","import OpenTsDatasource from './datasource';\nimport { OpenTsQueryCtrl } from './query_ctrl';\nimport { OpenTsConfigCtrl } from './config_ctrl';\n\nclass AnnotationsQueryCtrl {\n static templateUrl = 'partials/annotations.editor.html';\n}\n\nexport {\n OpenTsDatasource as Datasource,\n OpenTsQueryCtrl as QueryCtrl,\n OpenTsConfigCtrl as ConfigCtrl,\n AnnotationsQueryCtrl,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/opentsdb/module.ts","import angular from 'angular';\nimport _ from 'lodash';\nimport * as dateMath from 'app/core/utils/datemath';\n\nexport default class OpenTsDatasource {\n type: any;\n url: any;\n name: any;\n withCredentials: any;\n basicAuth: any;\n tsdbVersion: any;\n tsdbResolution: any;\n supportMetrics: any;\n tagKeys: any;\n\n aggregatorsPromise: any;\n filterTypesPromise: any;\n\n /** @ngInject */\n constructor(instanceSettings, private $q, private backendSrv, private templateSrv) {\n this.type = 'opentsdb';\n this.url = instanceSettings.url;\n this.name = instanceSettings.name;\n this.withCredentials = instanceSettings.withCredentials;\n this.basicAuth = instanceSettings.basicAuth;\n instanceSettings.jsonData = instanceSettings.jsonData || {};\n this.tsdbVersion = instanceSettings.jsonData.tsdbVersion || 1;\n this.tsdbResolution = instanceSettings.jsonData.tsdbResolution || 1;\n this.supportMetrics = true;\n this.tagKeys = {};\n\n this.aggregatorsPromise = null;\n this.filterTypesPromise = null;\n }\n\n // Called once per panel (graph)\n query(options) {\n var start = this.convertToTSDBTime(options.rangeRaw.from, false);\n var end = this.convertToTSDBTime(options.rangeRaw.to, true);\n var qs = [];\n\n _.each(\n options.targets,\n function(target) {\n if (!target.metric) {\n return;\n }\n qs.push(this.convertTargetToQuery(target, options, this.tsdbVersion));\n }.bind(this)\n );\n\n var queries = _.compact(qs);\n\n // No valid targets, return the empty result to save a round trip.\n if (_.isEmpty(queries)) {\n var d = this.$q.defer();\n d.resolve({ data: [] });\n return d.promise;\n }\n\n var groupByTags = {};\n _.each(queries, function(query) {\n if (query.filters && query.filters.length > 0) {\n _.each(query.filters, function(val) {\n groupByTags[val.tagk] = true;\n });\n } else {\n _.each(query.tags, function(val, key) {\n groupByTags[key] = true;\n });\n }\n });\n\n options.targets = _.filter(options.targets, function(query) {\n return query.hide !== true;\n });\n\n return this.performTimeSeriesQuery(queries, start, end).then(\n function(response) {\n var metricToTargetMapping = this.mapMetricsToTargets(response.data, options, this.tsdbVersion);\n var result = _.map(\n response.data,\n function(metricData, index) {\n index = metricToTargetMapping[index];\n if (index === -1) {\n index = 0;\n }\n this._saveTagKeys(metricData);\n\n return this.transformMetricData(\n metricData,\n groupByTags,\n options.targets[index],\n options,\n this.tsdbResolution\n );\n }.bind(this)\n );\n return { data: result };\n }.bind(this)\n );\n }\n\n annotationQuery(options) {\n var start = this.convertToTSDBTime(options.rangeRaw.from, false);\n var end = this.convertToTSDBTime(options.rangeRaw.to, true);\n var qs = [];\n var eventList = [];\n\n qs.push({ aggregator: 'sum', metric: options.annotation.target });\n\n var queries = _.compact(qs);\n\n return this.performTimeSeriesQuery(queries, start, end).then(\n function(results) {\n if (results.data[0]) {\n var annotationObject = results.data[0].annotations;\n if (options.annotation.isGlobal) {\n annotationObject = results.data[0].globalAnnotations;\n }\n if (annotationObject) {\n _.each(annotationObject, function(annotation) {\n var event = {\n text: annotation.description,\n time: Math.floor(annotation.startTime) * 1000,\n annotation: options.annotation,\n };\n\n eventList.push(event);\n });\n }\n }\n return eventList;\n }.bind(this)\n );\n }\n\n targetContainsTemplate(target) {\n if (target.filters && target.filters.length > 0) {\n for (var i = 0; i < target.filters.length; i++) {\n if (this.templateSrv.variableExists(target.filters[i].filter)) {\n return true;\n }\n }\n }\n\n if (target.tags && Object.keys(target.tags).length > 0) {\n for (var tagKey in target.tags) {\n if (this.templateSrv.variableExists(target.tags[tagKey])) {\n return true;\n }\n }\n }\n\n return false;\n }\n\n performTimeSeriesQuery(queries, start, end) {\n var msResolution = false;\n if (this.tsdbResolution === 2) {\n msResolution = true;\n }\n var reqBody: any = {\n start: start,\n queries: queries,\n msResolution: msResolution,\n globalAnnotations: true,\n };\n if (this.tsdbVersion === 3) {\n reqBody.showQuery = true;\n }\n\n // Relative queries (e.g. last hour) don't include an end time\n if (end) {\n reqBody.end = end;\n }\n\n var options = {\n method: 'POST',\n url: this.url + '/api/query',\n data: reqBody,\n };\n\n this._addCredentialOptions(options);\n return this.backendSrv.datasourceRequest(options);\n }\n\n suggestTagKeys(metric) {\n return this.$q.when(this.tagKeys[metric] || []);\n }\n\n _saveTagKeys(metricData) {\n var tagKeys = Object.keys(metricData.tags);\n _.each(metricData.aggregateTags, function(tag) {\n tagKeys.push(tag);\n });\n\n this.tagKeys[metricData.metric] = tagKeys;\n }\n\n _performSuggestQuery(query, type) {\n return this._get('/api/suggest', { type: type, q: query, max: 1000 }).then(function(result) {\n return result.data;\n });\n }\n\n _performMetricKeyValueLookup(metric, keys) {\n if (!metric || !keys) {\n return this.$q.when([]);\n }\n\n var keysArray = keys.split(',').map(function(key) {\n return key.trim();\n });\n var key = keysArray[0];\n var keysQuery = key + '=*';\n\n if (keysArray.length > 1) {\n keysQuery += ',' + keysArray.splice(1).join(',');\n }\n\n var m = metric + '{' + keysQuery + '}';\n\n return this._get('/api/search/lookup', { m: m, limit: 3000 }).then(function(result) {\n result = result.data.results;\n var tagvs = [];\n _.each(result, function(r) {\n if (tagvs.indexOf(r.tags[key]) === -1) {\n tagvs.push(r.tags[key]);\n }\n });\n return tagvs;\n });\n }\n\n _performMetricKeyLookup(metric) {\n if (!metric) {\n return this.$q.when([]);\n }\n\n return this._get('/api/search/lookup', { m: metric, limit: 1000 }).then(function(result) {\n result = result.data.results;\n var tagks = [];\n _.each(result, function(r) {\n _.each(r.tags, function(tagv, tagk) {\n if (tagks.indexOf(tagk) === -1) {\n tagks.push(tagk);\n }\n });\n });\n return tagks;\n });\n }\n\n _get(relativeUrl, params?) {\n var options = {\n method: 'GET',\n url: this.url + relativeUrl,\n params: params,\n };\n\n this._addCredentialOptions(options);\n\n return this.backendSrv.datasourceRequest(options);\n }\n\n _addCredentialOptions(options) {\n if (this.basicAuth || this.withCredentials) {\n options.withCredentials = true;\n }\n if (this.basicAuth) {\n options.headers = { Authorization: this.basicAuth };\n }\n }\n\n metricFindQuery(query) {\n if (!query) {\n return this.$q.when([]);\n }\n\n var interpolated;\n try {\n interpolated = this.templateSrv.replace(query, {}, 'distributed');\n } catch (err) {\n return this.$q.reject(err);\n }\n\n var responseTransform = function(result) {\n return _.map(result, function(value) {\n return { text: value };\n });\n };\n\n var metrics_regex = /metrics\\((.*)\\)/;\n var tag_names_regex = /tag_names\\((.*)\\)/;\n var tag_values_regex = /tag_values\\((.*?),\\s?(.*)\\)/;\n var tag_names_suggest_regex = /suggest_tagk\\((.*)\\)/;\n var tag_values_suggest_regex = /suggest_tagv\\((.*)\\)/;\n\n var metrics_query = interpolated.match(metrics_regex);\n if (metrics_query) {\n return this._performSuggestQuery(metrics_query[1], 'metrics').then(responseTransform);\n }\n\n var tag_names_query = interpolated.match(tag_names_regex);\n if (tag_names_query) {\n return this._performMetricKeyLookup(tag_names_query[1]).then(responseTransform);\n }\n\n var tag_values_query = interpolated.match(tag_values_regex);\n if (tag_values_query) {\n return this._performMetricKeyValueLookup(tag_values_query[1], tag_values_query[2]).then(responseTransform);\n }\n\n var tag_names_suggest_query = interpolated.match(tag_names_suggest_regex);\n if (tag_names_suggest_query) {\n return this._performSuggestQuery(tag_names_suggest_query[1], 'tagk').then(responseTransform);\n }\n\n var tag_values_suggest_query = interpolated.match(tag_values_suggest_regex);\n if (tag_values_suggest_query) {\n return this._performSuggestQuery(tag_values_suggest_query[1], 'tagv').then(responseTransform);\n }\n\n return this.$q.when([]);\n }\n\n testDatasource() {\n return this._performSuggestQuery('cpu', 'metrics').then(function() {\n return { status: 'success', message: 'Data source is working' };\n });\n }\n\n getAggregators() {\n if (this.aggregatorsPromise) {\n return this.aggregatorsPromise;\n }\n\n this.aggregatorsPromise = this._get('/api/aggregators').then(function(result) {\n if (result.data && _.isArray(result.data)) {\n return result.data.sort();\n }\n return [];\n });\n return this.aggregatorsPromise;\n }\n\n getFilterTypes() {\n if (this.filterTypesPromise) {\n return this.filterTypesPromise;\n }\n\n this.filterTypesPromise = this._get('/api/config/filters').then(function(result) {\n if (result.data) {\n return Object.keys(result.data).sort();\n }\n return [];\n });\n return this.filterTypesPromise;\n }\n\n transformMetricData(md, groupByTags, target, options, tsdbResolution) {\n var metricLabel = this.createMetricLabel(md, target, groupByTags, options);\n var dps = [];\n\n // TSDB returns datapoints has a hash of ts => value.\n // Can't use _.pairs(invert()) because it stringifies keys/values\n _.each(md.dps, function(v, k) {\n if (tsdbResolution === 2) {\n dps.push([v, k * 1]);\n } else {\n dps.push([v, k * 1000]);\n }\n });\n\n return { target: metricLabel, datapoints: dps };\n }\n\n createMetricLabel(md, target, groupByTags, options) {\n if (target.alias) {\n var scopedVars = _.clone(options.scopedVars || {});\n _.each(md.tags, function(value, key) {\n scopedVars['tag_' + key] = { value: value };\n });\n return this.templateSrv.replace(target.alias, scopedVars);\n }\n\n var label = md.metric;\n var tagData = [];\n\n if (!_.isEmpty(md.tags)) {\n _.each(_.toPairs(md.tags), function(tag) {\n if (_.has(groupByTags, tag[0])) {\n tagData.push(tag[0] + '=' + tag[1]);\n }\n });\n }\n\n if (!_.isEmpty(tagData)) {\n label += '{' + tagData.join(', ') + '}';\n }\n\n return label;\n }\n\n convertTargetToQuery(target, options, tsdbVersion) {\n if (!target.metric || target.hide) {\n return null;\n }\n\n var query: any = {\n metric: this.templateSrv.replace(target.metric, options.scopedVars, 'pipe'),\n aggregator: 'avg',\n };\n\n if (target.aggregator) {\n query.aggregator = this.templateSrv.replace(target.aggregator);\n }\n\n if (target.shouldComputeRate) {\n query.rate = true;\n query.rateOptions = {\n counter: !!target.isCounter,\n };\n\n if (target.counterMax && target.counterMax.length) {\n query.rateOptions.counterMax = parseInt(target.counterMax);\n }\n\n if (target.counterResetValue && target.counterResetValue.length) {\n query.rateOptions.resetValue = parseInt(target.counterResetValue);\n }\n\n if (tsdbVersion >= 2) {\n query.rateOptions.dropResets =\n !query.rateOptions.counterMax && (!query.rateOptions.ResetValue || query.rateOptions.ResetValue === 0);\n }\n }\n\n if (!target.disableDownsampling) {\n var interval = this.templateSrv.replace(target.downsampleInterval || options.interval);\n\n if (interval.match(/\\.[0-9]+s/)) {\n interval = parseFloat(interval) * 1000 + 'ms';\n }\n\n query.downsample = interval + '-' + target.downsampleAggregator;\n\n if (target.downsampleFillPolicy && target.downsampleFillPolicy !== 'none') {\n query.downsample += '-' + target.downsampleFillPolicy;\n }\n }\n\n if (target.filters && target.filters.length > 0) {\n query.filters = angular.copy(target.filters);\n if (query.filters) {\n for (var filter_key in query.filters) {\n query.filters[filter_key].filter = this.templateSrv.replace(\n query.filters[filter_key].filter,\n options.scopedVars,\n 'pipe'\n );\n }\n }\n } else {\n query.tags = angular.copy(target.tags);\n if (query.tags) {\n for (var tag_key in query.tags) {\n query.tags[tag_key] = this.templateSrv.replace(query.tags[tag_key], options.scopedVars, 'pipe');\n }\n }\n }\n\n if (target.explicitTags) {\n query.explicitTags = true;\n }\n\n return query;\n }\n\n mapMetricsToTargets(metrics, options, tsdbVersion) {\n var interpolatedTagValue, arrTagV;\n return _.map(metrics, function(metricData) {\n if (tsdbVersion === 3) {\n return metricData.query.index;\n } else {\n return _.findIndex(options.targets, function(target) {\n if (target.filters && target.filters.length > 0) {\n return target.metric === metricData.metric;\n } else {\n return (\n target.metric === metricData.metric &&\n _.every(target.tags, function(tagV, tagK) {\n interpolatedTagValue = this.templateSrv.replace(tagV, options.scopedVars, 'pipe');\n arrTagV = interpolatedTagValue.split('|');\n return _.includes(arrTagV, metricData.tags[tagK]) || interpolatedTagValue === '*';\n })\n );\n }\n });\n }\n });\n }\n\n convertToTSDBTime(date, roundUp) {\n if (date === 'now') {\n return null;\n }\n\n date = dateMath.parse(date, roundUp);\n return date.valueOf();\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/opentsdb/datasource.ts","import _ from 'lodash';\nimport kbn from 'app/core/utils/kbn';\nimport { QueryCtrl } from 'app/plugins/sdk';\n\nexport class OpenTsQueryCtrl extends QueryCtrl {\n static templateUrl = 'partials/query.editor.html';\n aggregators: any;\n fillPolicies: any;\n filterTypes: any;\n tsdbVersion: any;\n aggregator: any;\n downsampleInterval: any;\n downsampleAggregator: any;\n downsampleFillPolicy: any;\n errors: any;\n suggestMetrics: any;\n suggestTagKeys: any;\n suggestTagValues: any;\n addTagMode: boolean;\n addFilterMode: boolean;\n\n /** @ngInject **/\n constructor($scope, $injector) {\n super($scope, $injector);\n\n this.errors = this.validateTarget();\n this.aggregators = ['avg', 'sum', 'min', 'max', 'dev', 'zimsum', 'mimmin', 'mimmax'];\n this.fillPolicies = ['none', 'nan', 'null', 'zero'];\n this.filterTypes = [\n 'wildcard',\n 'iliteral_or',\n 'not_iliteral_or',\n 'not_literal_or',\n 'iwildcard',\n 'literal_or',\n 'regexp',\n ];\n\n this.tsdbVersion = this.datasource.tsdbVersion;\n\n if (!this.target.aggregator) {\n this.target.aggregator = 'sum';\n }\n\n if (!this.target.downsampleAggregator) {\n this.target.downsampleAggregator = 'avg';\n }\n\n if (!this.target.downsampleFillPolicy) {\n this.target.downsampleFillPolicy = 'none';\n }\n\n this.datasource.getAggregators().then(aggs => {\n if (aggs.length !== 0) {\n this.aggregators = aggs;\n }\n });\n\n this.datasource.getFilterTypes().then(filterTypes => {\n if (filterTypes.length !== 0) {\n this.filterTypes = filterTypes;\n }\n });\n\n // needs to be defined here as it is called from typeahead\n this.suggestMetrics = (query, callback) => {\n this.datasource\n .metricFindQuery('metrics(' + query + ')')\n .then(this.getTextValues)\n .then(callback);\n };\n\n this.suggestTagKeys = (query, callback) => {\n this.datasource.suggestTagKeys(this.target.metric).then(callback);\n };\n\n this.suggestTagValues = (query, callback) => {\n this.datasource\n .metricFindQuery('suggest_tagv(' + query + ')')\n .then(this.getTextValues)\n .then(callback);\n };\n }\n\n targetBlur() {\n this.errors = this.validateTarget();\n this.refresh();\n }\n\n getTextValues(metricFindResult) {\n return _.map(metricFindResult, function(value) {\n return value.text;\n });\n }\n\n addTag() {\n if (this.target.filters && this.target.filters.length > 0) {\n this.errors.tags = 'Please remove filters to use tags, tags and filters are mutually exclusive.';\n }\n\n if (!this.addTagMode) {\n this.addTagMode = true;\n return;\n }\n\n if (!this.target.tags) {\n this.target.tags = {};\n }\n\n this.errors = this.validateTarget();\n\n if (!this.errors.tags) {\n this.target.tags[this.target.currentTagKey] = this.target.currentTagValue;\n this.target.currentTagKey = '';\n this.target.currentTagValue = '';\n this.targetBlur();\n }\n\n this.addTagMode = false;\n }\n\n removeTag(key) {\n delete this.target.tags[key];\n this.targetBlur();\n }\n\n editTag(key, value) {\n this.removeTag(key);\n this.target.currentTagKey = key;\n this.target.currentTagValue = value;\n this.addTag();\n }\n\n closeAddTagMode() {\n this.addTagMode = false;\n return;\n }\n\n addFilter() {\n if (this.target.tags && _.size(this.target.tags) > 0) {\n this.errors.filters = 'Please remove tags to use filters, tags and filters are mutually exclusive.';\n }\n\n if (!this.addFilterMode) {\n this.addFilterMode = true;\n return;\n }\n\n if (!this.target.filters) {\n this.target.filters = [];\n }\n\n if (!this.target.currentFilterType) {\n this.target.currentFilterType = 'iliteral_or';\n }\n\n if (!this.target.currentFilterGroupBy) {\n this.target.currentFilterGroupBy = false;\n }\n\n this.errors = this.validateTarget();\n\n if (!this.errors.filters) {\n var currentFilter = {\n type: this.target.currentFilterType,\n tagk: this.target.currentFilterKey,\n filter: this.target.currentFilterValue,\n groupBy: this.target.currentFilterGroupBy,\n };\n this.target.filters.push(currentFilter);\n this.target.currentFilterType = 'literal_or';\n this.target.currentFilterKey = '';\n this.target.currentFilterValue = '';\n this.target.currentFilterGroupBy = false;\n this.targetBlur();\n }\n\n this.addFilterMode = false;\n }\n\n removeFilter(index) {\n this.target.filters.splice(index, 1);\n this.targetBlur();\n }\n\n editFilter(fil, index) {\n this.removeFilter(index);\n this.target.currentFilterKey = fil.tagk;\n this.target.currentFilterValue = fil.filter;\n this.target.currentFilterType = fil.type;\n this.target.currentFilterGroupBy = fil.groupBy;\n this.addFilter();\n }\n\n closeAddFilterMode() {\n this.addFilterMode = false;\n return;\n }\n\n validateTarget() {\n var errs: any = {};\n\n if (this.target.shouldDownsample) {\n try {\n if (this.target.downsampleInterval) {\n kbn.describe_interval(this.target.downsampleInterval);\n } else {\n errs.downsampleInterval = \"You must supply a downsample interval (e.g. '1m' or '1h').\";\n }\n } catch (err) {\n errs.downsampleInterval = err.message;\n }\n }\n\n if (this.target.tags && _.has(this.target.tags, this.target.currentTagKey)) {\n errs.tags = \"Duplicate tag key '\" + this.target.currentTagKey + \"'.\";\n }\n\n return errs;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/opentsdb/query_ctrl.ts","export class OpenTsConfigCtrl {\n static templateUrl = 'public/app/plugins/datasource/opentsdb/partials/config.html';\n current: any;\n\n /** @ngInject */\n constructor($scope) {\n this.current.jsonData = this.current.jsonData || {};\n this.current.jsonData.tsdbVersion = this.current.jsonData.tsdbVersion || 1;\n this.current.jsonData.tsdbResolution = this.current.jsonData.tsdbResolution || 1;\n }\n\n tsdbVersions = [{ name: '<=2.1', value: 1 }, { name: '==2.2', value: 2 }, { name: '==2.3', value: 3 }];\n\n tsdbResolutions = [{ name: 'second', value: 1 }, { name: 'millisecond', value: 2 }];\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/opentsdb/config_ctrl.ts","import { GrafanaDatasource } from './datasource';\nimport { QueryCtrl } from 'app/plugins/sdk';\n\nclass GrafanaQueryCtrl extends QueryCtrl {\n static templateUrl = 'partials/query.editor.html';\n}\n\nclass GrafanaAnnotationsQueryCtrl {\n annotation: any;\n\n types = [{ text: 'Dashboard', value: 'dashboard' }, { text: 'Tags', value: 'tags' }];\n\n constructor() {\n this.annotation.type = this.annotation.type || 'tags';\n this.annotation.limit = this.annotation.limit || 100;\n }\n\n static templateUrl = 'partials/annotations.editor.html';\n}\n\nexport {\n GrafanaDatasource,\n GrafanaDatasource as Datasource,\n GrafanaQueryCtrl as QueryCtrl,\n GrafanaAnnotationsQueryCtrl as AnnotationsQueryCtrl,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/grafana/module.ts","import _ from 'lodash';\n\nclass GrafanaDatasource {\n /** @ngInject */\n constructor(private backendSrv, private $q) {}\n\n query(options) {\n return this.backendSrv\n .get('/api/tsdb/testdata/random-walk', {\n from: options.range.from.valueOf(),\n to: options.range.to.valueOf(),\n intervalMs: options.intervalMs,\n maxDataPoints: options.maxDataPoints,\n })\n .then(res => {\n var data = [];\n\n if (res.results) {\n _.forEach(res.results, queryRes => {\n for (let series of queryRes.series) {\n data.push({\n target: series.name,\n datapoints: series.points,\n });\n }\n });\n }\n\n return { data: data };\n });\n }\n\n metricFindQuery(options) {\n return this.$q.when({ data: [] });\n }\n\n annotationQuery(options) {\n const params: any = {\n from: options.range.from.valueOf(),\n to: options.range.to.valueOf(),\n limit: options.annotation.limit,\n tags: options.annotation.tags,\n };\n\n if (options.annotation.type === 'dashboard') {\n // if no dashboard id yet return\n if (!options.dashboard.id) {\n return this.$q.when([]);\n }\n // filter by dashboard id\n params.dashboardId = options.dashboard.id;\n // remove tags filter if any\n delete params.tags;\n } else {\n // require at least one tag\n if (!_.isArray(options.annotation.tags) || options.annotation.tags.length === 0) {\n return this.$q.when([]);\n }\n }\n\n return this.backendSrv.get('/api/annotations', params);\n }\n}\n\nexport { GrafanaDatasource };\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/grafana/datasource.ts","import _ from 'lodash';\n\nimport * as dateMath from 'app/core/utils/datemath';\nimport InfluxSeries from './influx_series';\nimport InfluxQuery from './influx_query';\nimport ResponseParser from './response_parser';\nimport { InfluxQueryBuilder } from './query_builder';\n\nexport default class InfluxDatasource {\n type: string;\n urls: any;\n username: string;\n password: string;\n name: string;\n database: any;\n basicAuth: any;\n withCredentials: any;\n interval: any;\n supportAnnotations: boolean;\n supportMetrics: boolean;\n responseParser: any;\n\n /** @ngInject */\n constructor(instanceSettings, private $q, private backendSrv, private templateSrv) {\n this.type = 'influxdb';\n this.urls = _.map(instanceSettings.url.split(','), function(url) {\n return url.trim();\n });\n\n this.username = instanceSettings.username;\n this.password = instanceSettings.password;\n this.name = instanceSettings.name;\n this.database = instanceSettings.database;\n this.basicAuth = instanceSettings.basicAuth;\n this.withCredentials = instanceSettings.withCredentials;\n this.interval = (instanceSettings.jsonData || {}).timeInterval;\n this.supportAnnotations = true;\n this.supportMetrics = true;\n this.responseParser = new ResponseParser();\n }\n\n query(options) {\n var timeFilter = this.getTimeFilter(options);\n var scopedVars = options.scopedVars;\n var targets = _.cloneDeep(options.targets);\n var queryTargets = [];\n var queryModel;\n var i, y;\n\n var allQueries = _.map(targets, target => {\n if (target.hide) {\n return '';\n }\n\n queryTargets.push(target);\n\n // backward compatibility\n scopedVars.interval = scopedVars.__interval;\n\n queryModel = new InfluxQuery(target, this.templateSrv, scopedVars);\n return queryModel.render(true);\n }).reduce((acc, current) => {\n if (current !== '') {\n acc += ';' + current;\n }\n return acc;\n });\n\n if (allQueries === '') {\n return this.$q.when({ data: [] });\n }\n\n // add global adhoc filters to timeFilter\n var adhocFilters = this.templateSrv.getAdhocFilters(this.name);\n if (adhocFilters.length > 0) {\n timeFilter += ' AND ' + queryModel.renderAdhocFilters(adhocFilters);\n }\n\n // replace grafana variables\n scopedVars.timeFilter = { value: timeFilter };\n\n // replace templated variables\n allQueries = this.templateSrv.replace(allQueries, scopedVars);\n\n return this._seriesQuery(allQueries, options).then((data): any => {\n if (!data || !data.results) {\n return [];\n }\n\n var seriesList = [];\n for (i = 0; i < data.results.length; i++) {\n var result = data.results[i];\n if (!result || !result.series) {\n continue;\n }\n\n var target = queryTargets[i];\n var alias = target.alias;\n if (alias) {\n alias = this.templateSrv.replace(target.alias, options.scopedVars);\n }\n\n var influxSeries = new InfluxSeries({\n series: data.results[i].series,\n alias: alias,\n });\n\n switch (target.resultFormat) {\n case 'table': {\n seriesList.push(influxSeries.getTable());\n break;\n }\n default: {\n var timeSeries = influxSeries.getTimeSeries();\n for (y = 0; y < timeSeries.length; y++) {\n seriesList.push(timeSeries[y]);\n }\n break;\n }\n }\n }\n\n return { data: seriesList };\n });\n }\n\n annotationQuery(options) {\n if (!options.annotation.query) {\n return this.$q.reject({\n message: 'Query missing in annotation definition',\n });\n }\n\n var timeFilter = this.getTimeFilter({ rangeRaw: options.rangeRaw });\n var query = options.annotation.query.replace('$timeFilter', timeFilter);\n query = this.templateSrv.replace(query, null, 'regex');\n\n return this._seriesQuery(query, options).then(data => {\n if (!data || !data.results || !data.results[0]) {\n throw { message: 'No results in response from InfluxDB' };\n }\n return new InfluxSeries({\n series: data.results[0].series,\n annotation: options.annotation,\n }).getAnnotations();\n });\n }\n\n targetContainsTemplate(target) {\n for (let group of target.groupBy) {\n for (let param of group.params) {\n if (this.templateSrv.variableExists(param)) {\n return true;\n }\n }\n }\n\n for (let i in target.tags) {\n if (this.templateSrv.variableExists(target.tags[i].value)) {\n return true;\n }\n }\n\n return false;\n }\n\n metricFindQuery(query: string, options?: any) {\n var interpolated = this.templateSrv.replace(query, null, 'regex');\n\n return this._seriesQuery(interpolated, options).then(_.curry(this.responseParser.parse)(query));\n }\n\n getTagKeys(options) {\n var queryBuilder = new InfluxQueryBuilder({ measurement: '', tags: [] }, this.database);\n var query = queryBuilder.buildExploreQuery('TAG_KEYS');\n return this.metricFindQuery(query, options);\n }\n\n getTagValues(options) {\n var queryBuilder = new InfluxQueryBuilder({ measurement: '', tags: [] }, this.database);\n var query = queryBuilder.buildExploreQuery('TAG_VALUES', options.key);\n return this.metricFindQuery(query, options);\n }\n\n _seriesQuery(query: string, options?: any) {\n if (!query) {\n return this.$q.when({ results: [] });\n }\n\n let epoch = 'ms';\n\n // Match the influx epoch parameter to requested time interval\n let match = query.match(/time\\(\\d+(\\w+)\\)/);\n if (match && ['ns', 'u', 'µ'].indexOf(match[1]) !== -1) {\n epoch = match[1];\n }\n\n return this._influxRequest('GET', '/query', { q: query, epoch: epoch }, options).then(data => {\n // if the epoch was changed to lower res, adjust incoming timestamps back to ms\n let coeff = 1;\n if (epoch === 'u' || epoch === 'µ') {\n coeff = 0.001;\n } else if (epoch === 'ns') {\n coeff = 0.000001;\n }\n\n if (coeff !== 1) {\n for (let i in data.results) {\n for (let point of data.results[i].series[0].values) {\n point[0] = point[0] * coeff;\n }\n }\n }\n\n return data;\n });\n }\n\n serializeParams(params) {\n if (!params) {\n return '';\n }\n\n return _.reduce(\n params,\n (memo, value, key) => {\n if (value === null || value === undefined) {\n return memo;\n }\n memo.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));\n return memo;\n },\n []\n ).join('&');\n }\n\n testDatasource() {\n var queryBuilder = new InfluxQueryBuilder({ measurement: '', tags: [] }, this.database);\n var query = queryBuilder.buildExploreQuery('RETENTION POLICIES');\n\n return this._seriesQuery(query)\n .then(res => {\n let error = _.get(res, 'results[0].error');\n if (error) {\n return { status: 'error', message: error };\n }\n return { status: 'success', message: 'Data source is working' };\n })\n .catch(err => {\n return { status: 'error', message: err.message };\n });\n }\n\n _influxRequest(method: string, url: string, data: any, options?: any) {\n const currentUrl = this.urls.shift();\n this.urls.push(currentUrl);\n\n let params: any = {};\n\n if (this.username) {\n params.u = this.username;\n params.p = this.password;\n }\n\n if (options && options.database) {\n params.db = options.database;\n } else if (this.database) {\n params.db = this.database;\n }\n\n if (method === 'GET') {\n _.extend(params, data);\n data = null;\n }\n\n let req: any = {\n method: method,\n url: currentUrl + url,\n params: params,\n data: data,\n precision: 'ms',\n inspect: { type: 'influxdb' },\n paramSerializer: this.serializeParams,\n };\n\n req.headers = req.headers || {};\n if (this.basicAuth || this.withCredentials) {\n req.withCredentials = true;\n }\n if (this.basicAuth) {\n req.headers.Authorization = this.basicAuth;\n }\n\n return this.backendSrv.datasourceRequest(req).then(\n result => {\n return result.data;\n },\n function(err) {\n if (err.status !== 0 || err.status >= 300) {\n if (err.data && err.data.error) {\n throw {\n message: 'InfluxDB Error: ' + err.data.error,\n data: err.data,\n config: err.config,\n };\n } else {\n throw {\n message: 'Network Error: ' + err.statusText + '(' + err.status + ')',\n data: err.data,\n config: err.config,\n };\n }\n }\n }\n );\n }\n\n getTimeFilter(options) {\n var from = this.getInfluxTime(options.rangeRaw.from, false);\n var until = this.getInfluxTime(options.rangeRaw.to, true);\n var fromIsAbsolute = from[from.length - 1] === 'ms';\n\n if (until === 'now()' && !fromIsAbsolute) {\n return 'time >= ' + from;\n }\n\n return 'time >= ' + from + ' and time <= ' + until;\n }\n\n getInfluxTime(date, roundUp) {\n if (_.isString(date)) {\n if (date === 'now') {\n return 'now()';\n }\n\n var parts = /^now-(\\d+)([d|h|m|s])$/.exec(date);\n if (parts) {\n var amount = parseInt(parts[1]);\n var unit = parts[2];\n return 'now() - ' + amount + unit;\n }\n date = dateMath.parse(date, roundUp);\n }\n\n return date.valueOf() + 'ms';\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/influxdb/datasource.ts","import InfluxDatasource from './datasource';\nimport { InfluxQueryCtrl } from './query_ctrl';\n\nclass InfluxConfigCtrl {\n static templateUrl = 'partials/config.html';\n}\n\nclass InfluxAnnotationsQueryCtrl {\n static templateUrl = 'partials/annotations.editor.html';\n}\n\nexport {\n InfluxDatasource as Datasource,\n InfluxQueryCtrl as QueryCtrl,\n InfluxConfigCtrl as ConfigCtrl,\n InfluxAnnotationsQueryCtrl as AnnotationsQueryCtrl,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/influxdb/module.ts","import _ from 'lodash';\nimport TableModel from 'app/core/table_model';\n\nexport default class InfluxSeries {\n series: any;\n alias: any;\n annotation: any;\n\n constructor(options) {\n this.series = options.series;\n this.alias = options.alias;\n this.annotation = options.annotation;\n }\n\n getTimeSeries() {\n var output = [];\n var i, j;\n\n if (this.series.length === 0) {\n return output;\n }\n\n _.each(this.series, series => {\n var columns = series.columns.length;\n var tags = _.map(series.tags, function(value, key) {\n return key + ': ' + value;\n });\n\n for (j = 1; j < columns; j++) {\n var seriesName = series.name;\n var columnName = series.columns[j];\n if (columnName !== 'value') {\n seriesName = seriesName + '.' + columnName;\n }\n\n if (this.alias) {\n seriesName = this._getSeriesName(series, j);\n } else if (series.tags) {\n seriesName = seriesName + ' {' + tags.join(', ') + '}';\n }\n\n var datapoints = [];\n if (series.values) {\n for (i = 0; i < series.values.length; i++) {\n datapoints[i] = [series.values[i][j], series.values[i][0]];\n }\n }\n\n output.push({ target: seriesName, datapoints: datapoints });\n }\n });\n\n return output;\n }\n\n _getSeriesName(series, index) {\n var regex = /\\$(\\w+)|\\[\\[([\\s\\S]+?)\\]\\]/g;\n var segments = series.name.split('.');\n\n return this.alias.replace(regex, function(match, g1, g2) {\n var group = g1 || g2;\n var segIndex = parseInt(group, 10);\n\n if (group === 'm' || group === 'measurement') {\n return series.name;\n }\n if (group === 'col') {\n return series.columns[index];\n }\n if (!isNaN(segIndex)) {\n return segments[segIndex];\n }\n if (group.indexOf('tag_') !== 0) {\n return match;\n }\n\n var tag = group.replace('tag_', '');\n if (!series.tags) {\n return match;\n }\n return series.tags[tag];\n });\n }\n\n getAnnotations() {\n var list = [];\n\n _.each(this.series, series => {\n var titleCol = null;\n var timeCol = null;\n var tagsCol = [];\n var textCol = null;\n\n _.each(series.columns, (column, index) => {\n if (column === 'time') {\n timeCol = index;\n return;\n }\n if (column === 'sequence_number') {\n return;\n }\n if (!titleCol) {\n titleCol = index;\n }\n if (column === this.annotation.titleColumn) {\n titleCol = index;\n return;\n }\n if (_.includes((this.annotation.tagsColumn || '').replace(' ', '').split(','), column)) {\n tagsCol.push(index);\n return;\n }\n if (column === this.annotation.textColumn) {\n textCol = index;\n return;\n }\n });\n\n _.each(series.values, value => {\n var data = {\n annotation: this.annotation,\n time: +new Date(value[timeCol]),\n title: value[titleCol],\n // Remove empty values, then split in different tags for comma separated values\n tags: _.flatten(\n tagsCol\n .filter(function(t) {\n return value[t];\n })\n .map(function(t) {\n return value[t].split(',');\n })\n ),\n text: value[textCol],\n };\n\n list.push(data);\n });\n });\n\n return list;\n }\n\n getTable() {\n var table = new TableModel();\n var i, j;\n\n if (this.series.length === 0) {\n return table;\n }\n\n _.each(this.series, (series, seriesIndex) => {\n if (seriesIndex === 0) {\n j = 0;\n // Check that the first column is indeed 'time'\n if (series.columns[0] === 'time') {\n // Push this now before the tags and with the right type\n table.columns.push({ text: 'Time', type: 'time' });\n j++;\n }\n _.each(_.keys(series.tags), function(key) {\n table.columns.push({ text: key });\n });\n for (; j < series.columns.length; j++) {\n table.columns.push({ text: series.columns[j] });\n }\n }\n\n if (series.values) {\n for (i = 0; i < series.values.length; i++) {\n var values = series.values[i];\n var reordered = [values[0]];\n if (series.tags) {\n for (var key in series.tags) {\n if (series.tags.hasOwnProperty(key)) {\n reordered.push(series.tags[key]);\n }\n }\n }\n for (j = 1; j < values.length; j++) {\n reordered.push(values[j]);\n }\n table.rows.push(reordered);\n }\n }\n });\n\n return table;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/influxdb/influx_series.ts","import _ from 'lodash';\n\nexport default class ResponseParser {\n parse(query, results) {\n if (!results || results.results.length === 0) {\n return [];\n }\n\n var influxResults = results.results[0];\n if (!influxResults.series) {\n return [];\n }\n\n var normalizedQuery = query.toLowerCase();\n var isValueFirst =\n normalizedQuery.indexOf('show field keys') >= 0 || normalizedQuery.indexOf('show retention policies') >= 0;\n\n var res = {};\n _.each(influxResults.series, serie => {\n _.each(serie.values, value => {\n if (_.isArray(value)) {\n // In general, there are 2 possible shapes for the returned value.\n // The first one is a two-element array,\n // where the first element is somewhat a metadata value:\n // the tag name for SHOW TAG VALUES queries,\n // the time field for SELECT queries, etc.\n // The second shape is an one-element array,\n // that is containing an immediate value.\n // For example, SHOW FIELD KEYS queries return such shape.\n // Note, pre-0.11 versions return\n // the second shape for SHOW TAG VALUES queries\n // (while the newer versions—first).\n\n if (isValueFirst) {\n addUnique(res, value[0]);\n } else if (value[1] !== undefined) {\n addUnique(res, value[1]);\n } else {\n addUnique(res, value[0]);\n }\n } else {\n addUnique(res, value);\n }\n });\n });\n\n return _.map(res, value => {\n return { text: value.toString() };\n });\n }\n}\n\nfunction addUnique(arr, value) {\n arr[value] = value;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/influxdb/response_parser.ts","import angular from 'angular';\nimport _ from 'lodash';\nimport { InfluxQueryBuilder } from './query_builder';\nimport InfluxQuery from './influx_query';\nimport queryPart from './query_part';\nimport { QueryCtrl } from 'app/plugins/sdk';\n\nexport class InfluxQueryCtrl extends QueryCtrl {\n static templateUrl = 'partials/query.editor.html';\n\n queryModel: InfluxQuery;\n queryBuilder: any;\n groupBySegment: any;\n resultFormats: any[];\n orderByTime: any[];\n policySegment: any;\n tagSegments: any[];\n selectMenu: any;\n measurementSegment: any;\n removeTagFilterSegment: any;\n\n /** @ngInject **/\n constructor($scope, $injector, private templateSrv, private $q, private uiSegmentSrv) {\n super($scope, $injector);\n\n this.target = this.target;\n this.queryModel = new InfluxQuery(this.target, templateSrv, this.panel.scopedVars);\n this.queryBuilder = new InfluxQueryBuilder(this.target, this.datasource.database);\n this.groupBySegment = this.uiSegmentSrv.newPlusButton();\n this.resultFormats = [{ text: 'Time series', value: 'time_series' }, { text: 'Table', value: 'table' }];\n this.policySegment = uiSegmentSrv.newSegment(this.target.policy);\n\n if (!this.target.measurement) {\n this.measurementSegment = uiSegmentSrv.newSelectMeasurement();\n } else {\n this.measurementSegment = uiSegmentSrv.newSegment(this.target.measurement);\n }\n\n this.tagSegments = [];\n for (let tag of this.target.tags) {\n if (!tag.operator) {\n if (/^\\/.*\\/$/.test(tag.value)) {\n tag.operator = '=~';\n } else {\n tag.operator = '=';\n }\n }\n\n if (tag.condition) {\n this.tagSegments.push(uiSegmentSrv.newCondition(tag.condition));\n }\n\n this.tagSegments.push(uiSegmentSrv.newKey(tag.key));\n this.tagSegments.push(uiSegmentSrv.newOperator(tag.operator));\n this.tagSegments.push(uiSegmentSrv.newKeyValue(tag.value));\n }\n\n this.fixTagSegments();\n this.buildSelectMenu();\n this.removeTagFilterSegment = uiSegmentSrv.newSegment({\n fake: true,\n value: '-- remove tag filter --',\n });\n }\n\n removeOrderByTime() {\n this.target.orderByTime = 'ASC';\n }\n\n buildSelectMenu() {\n var categories = queryPart.getCategories();\n this.selectMenu = _.reduce(\n categories,\n function(memo, cat, key) {\n var menu = {\n text: key,\n submenu: cat.map(item => {\n return { text: item.type, value: item.type };\n }),\n };\n memo.push(menu);\n return memo;\n },\n []\n );\n }\n\n getGroupByOptions() {\n var query = this.queryBuilder.buildExploreQuery('TAG_KEYS');\n\n return this.datasource\n .metricFindQuery(query)\n .then(tags => {\n var options = [];\n if (!this.queryModel.hasFill()) {\n options.push(this.uiSegmentSrv.newSegment({ value: 'fill(null)' }));\n }\n if (!this.target.limit) {\n options.push(this.uiSegmentSrv.newSegment({ value: 'LIMIT' }));\n }\n if (!this.target.slimit) {\n options.push(this.uiSegmentSrv.newSegment({ value: 'SLIMIT' }));\n }\n if (this.target.orderByTime === 'ASC') {\n options.push(this.uiSegmentSrv.newSegment({ value: 'ORDER BY time DESC' }));\n }\n if (!this.queryModel.hasGroupByTime()) {\n options.push(this.uiSegmentSrv.newSegment({ value: 'time($interval)' }));\n }\n for (let tag of tags) {\n options.push(this.uiSegmentSrv.newSegment({ value: 'tag(' + tag.text + ')' }));\n }\n return options;\n })\n .catch(this.handleQueryError.bind(this));\n }\n\n groupByAction() {\n switch (this.groupBySegment.value) {\n case 'LIMIT': {\n this.target.limit = 10;\n break;\n }\n case 'SLIMIT': {\n this.target.slimit = 10;\n break;\n }\n case 'ORDER BY time DESC': {\n this.target.orderByTime = 'DESC';\n break;\n }\n default: {\n this.queryModel.addGroupBy(this.groupBySegment.value);\n }\n }\n\n var plusButton = this.uiSegmentSrv.newPlusButton();\n this.groupBySegment.value = plusButton.value;\n this.groupBySegment.html = plusButton.html;\n this.panelCtrl.refresh();\n }\n\n addSelectPart(selectParts, cat, subitem) {\n this.queryModel.addSelectPart(selectParts, subitem.value);\n this.panelCtrl.refresh();\n }\n\n handleSelectPartEvent(selectParts, part, evt) {\n switch (evt.name) {\n case 'get-param-options': {\n var fieldsQuery = this.queryBuilder.buildExploreQuery('FIELDS');\n return this.datasource\n .metricFindQuery(fieldsQuery)\n .then(this.transformToSegments(true))\n .catch(this.handleQueryError.bind(this));\n }\n case 'part-param-changed': {\n this.panelCtrl.refresh();\n break;\n }\n case 'action': {\n this.queryModel.removeSelectPart(selectParts, part);\n this.panelCtrl.refresh();\n break;\n }\n case 'get-part-actions': {\n return this.$q.when([{ text: 'Remove', value: 'remove-part' }]);\n }\n }\n }\n\n handleGroupByPartEvent(part, index, evt) {\n switch (evt.name) {\n case 'get-param-options': {\n var tagsQuery = this.queryBuilder.buildExploreQuery('TAG_KEYS');\n return this.datasource\n .metricFindQuery(tagsQuery)\n .then(this.transformToSegments(true))\n .catch(this.handleQueryError.bind(this));\n }\n case 'part-param-changed': {\n this.panelCtrl.refresh();\n break;\n }\n case 'action': {\n this.queryModel.removeGroupByPart(part, index);\n this.panelCtrl.refresh();\n break;\n }\n case 'get-part-actions': {\n return this.$q.when([{ text: 'Remove', value: 'remove-part' }]);\n }\n }\n }\n\n fixTagSegments() {\n var count = this.tagSegments.length;\n var lastSegment = this.tagSegments[Math.max(count - 1, 0)];\n\n if (!lastSegment || lastSegment.type !== 'plus-button') {\n this.tagSegments.push(this.uiSegmentSrv.newPlusButton());\n }\n }\n\n measurementChanged() {\n this.target.measurement = this.measurementSegment.value;\n this.panelCtrl.refresh();\n }\n\n getPolicySegments() {\n var policiesQuery = this.queryBuilder.buildExploreQuery('RETENTION POLICIES');\n return this.datasource\n .metricFindQuery(policiesQuery)\n .then(this.transformToSegments(false))\n .catch(this.handleQueryError.bind(this));\n }\n\n policyChanged() {\n this.target.policy = this.policySegment.value;\n this.panelCtrl.refresh();\n }\n\n toggleEditorMode() {\n try {\n this.target.query = this.queryModel.render(false);\n } catch (err) {\n console.log('query render error');\n }\n this.target.rawQuery = !this.target.rawQuery;\n }\n\n getMeasurements(measurementFilter) {\n var query = this.queryBuilder.buildExploreQuery('MEASUREMENTS', undefined, measurementFilter);\n return this.datasource\n .metricFindQuery(query)\n .then(this.transformToSegments(true))\n .catch(this.handleQueryError.bind(this));\n }\n\n handleQueryError(err) {\n this.error = err.message || 'Failed to issue metric query';\n return [];\n }\n\n transformToSegments(addTemplateVars) {\n return results => {\n var segments = _.map(results, segment => {\n return this.uiSegmentSrv.newSegment({\n value: segment.text,\n expandable: segment.expandable,\n });\n });\n\n if (addTemplateVars) {\n for (let variable of this.templateSrv.variables) {\n segments.unshift(\n this.uiSegmentSrv.newSegment({\n type: 'value',\n value: '/^$' + variable.name + '$/',\n expandable: true,\n })\n );\n }\n }\n\n return segments;\n };\n }\n\n getTagsOrValues(segment, index) {\n if (segment.type === 'condition') {\n return this.$q.when([this.uiSegmentSrv.newSegment('AND'), this.uiSegmentSrv.newSegment('OR')]);\n }\n if (segment.type === 'operator') {\n var nextValue = this.tagSegments[index + 1].value;\n if (/^\\/.*\\/$/.test(nextValue)) {\n return this.$q.when(this.uiSegmentSrv.newOperators(['=~', '!~']));\n } else {\n return this.$q.when(this.uiSegmentSrv.newOperators(['=', '!=', '<>', '<', '>']));\n }\n }\n\n var query, addTemplateVars;\n if (segment.type === 'key' || segment.type === 'plus-button') {\n query = this.queryBuilder.buildExploreQuery('TAG_KEYS');\n addTemplateVars = false;\n } else if (segment.type === 'value') {\n query = this.queryBuilder.buildExploreQuery('TAG_VALUES', this.tagSegments[index - 2].value);\n addTemplateVars = true;\n }\n\n return this.datasource\n .metricFindQuery(query)\n .then(this.transformToSegments(addTemplateVars))\n .then(results => {\n if (segment.type === 'key') {\n results.splice(0, 0, angular.copy(this.removeTagFilterSegment));\n }\n return results;\n })\n .catch(this.handleQueryError.bind(this));\n }\n\n getFieldSegments() {\n var fieldsQuery = this.queryBuilder.buildExploreQuery('FIELDS');\n return this.datasource\n .metricFindQuery(fieldsQuery)\n .then(this.transformToSegments(false))\n .catch(this.handleQueryError);\n }\n\n tagSegmentUpdated(segment, index) {\n this.tagSegments[index] = segment;\n\n // handle remove tag condition\n if (segment.value === this.removeTagFilterSegment.value) {\n this.tagSegments.splice(index, 3);\n if (this.tagSegments.length === 0) {\n this.tagSegments.push(this.uiSegmentSrv.newPlusButton());\n } else if (this.tagSegments.length > 2) {\n this.tagSegments.splice(Math.max(index - 1, 0), 1);\n if (this.tagSegments[this.tagSegments.length - 1].type !== 'plus-button') {\n this.tagSegments.push(this.uiSegmentSrv.newPlusButton());\n }\n }\n } else {\n if (segment.type === 'plus-button') {\n if (index > 2) {\n this.tagSegments.splice(index, 0, this.uiSegmentSrv.newCondition('AND'));\n }\n this.tagSegments.push(this.uiSegmentSrv.newOperator('='));\n this.tagSegments.push(this.uiSegmentSrv.newFake('select tag value', 'value', 'query-segment-value'));\n segment.type = 'key';\n segment.cssClass = 'query-segment-key';\n }\n\n if (index + 1 === this.tagSegments.length) {\n this.tagSegments.push(this.uiSegmentSrv.newPlusButton());\n }\n }\n\n this.rebuildTargetTagConditions();\n }\n\n rebuildTargetTagConditions() {\n var tags = [];\n var tagIndex = 0;\n var tagOperator = '';\n\n _.each(this.tagSegments, (segment2, index) => {\n if (segment2.type === 'key') {\n if (tags.length === 0) {\n tags.push({});\n }\n tags[tagIndex].key = segment2.value;\n } else if (segment2.type === 'value') {\n tagOperator = this.getTagValueOperator(segment2.value, tags[tagIndex].operator);\n if (tagOperator) {\n this.tagSegments[index - 1] = this.uiSegmentSrv.newOperator(tagOperator);\n tags[tagIndex].operator = tagOperator;\n }\n tags[tagIndex].value = segment2.value;\n } else if (segment2.type === 'condition') {\n tags.push({ condition: segment2.value });\n tagIndex += 1;\n } else if (segment2.type === 'operator') {\n tags[tagIndex].operator = segment2.value;\n }\n });\n\n this.target.tags = tags;\n this.panelCtrl.refresh();\n }\n\n getTagValueOperator(tagValue, tagOperator): string {\n if (tagOperator !== '=~' && tagOperator !== '!~' && /^\\/.*\\/$/.test(tagValue)) {\n return '=~';\n } else if ((tagOperator === '=~' || tagOperator === '!~') && /^(?!\\/.*\\/$)/.test(tagValue)) {\n return '=';\n }\n return null;\n }\n\n getCollapsedText() {\n return this.queryModel.render(false);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/influxdb/query_ctrl.ts","import { MixedDatasource } from './datasource';\nexport { MixedDatasource, MixedDatasource as Datasource };\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/mixed/module.ts","import angular from 'angular';\nimport _ from 'lodash';\n\nclass MixedDatasource {\n /** @ngInject */\n constructor(private $q, private datasourceSrv) {}\n\n query(options) {\n var sets = _.groupBy(options.targets, 'datasource');\n var promises = _.map(sets, targets => {\n var dsName = targets[0].datasource;\n if (dsName === '-- Mixed --') {\n return this.$q([]);\n }\n\n return this.datasourceSrv.get(dsName).then(function(ds) {\n var opt = angular.copy(options);\n opt.targets = targets;\n return ds.query(opt);\n });\n });\n\n return this.$q.all(promises).then(function(results) {\n return { data: _.flatten(_.map(results, 'data')) };\n });\n }\n}\n\nexport { MixedDatasource, MixedDatasource as Datasource };\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/mixed/datasource.ts","import { MysqlDatasource } from './datasource';\nimport { MysqlQueryCtrl } from './query_ctrl';\n\nclass MysqlConfigCtrl {\n static templateUrl = 'partials/config.html';\n}\n\nconst defaultQuery = `SELECT\n UNIX_TIMESTAMP() as time_sec,\n as text,\n as tags\n FROM \n WHERE $__timeFilter(time_column)\n ORDER BY ASC\n LIMIT 100\n `;\n\nclass MysqlAnnotationsQueryCtrl {\n static templateUrl = 'partials/annotations.editor.html';\n\n annotation: any;\n\n /** @ngInject **/\n constructor() {\n this.annotation.rawQuery = this.annotation.rawQuery || defaultQuery;\n }\n}\n\nexport {\n MysqlDatasource,\n MysqlDatasource as Datasource,\n MysqlQueryCtrl as QueryCtrl,\n MysqlConfigCtrl as ConfigCtrl,\n MysqlAnnotationsQueryCtrl as AnnotationsQueryCtrl,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/mysql/module.ts","import _ from 'lodash';\nimport ResponseParser from './response_parser';\n\nexport class MysqlDatasource {\n id: any;\n name: any;\n responseParser: ResponseParser;\n\n /** @ngInject **/\n constructor(instanceSettings, private backendSrv, private $q, private templateSrv) {\n this.name = instanceSettings.name;\n this.id = instanceSettings.id;\n this.responseParser = new ResponseParser(this.$q);\n }\n\n interpolateVariable(value, variable) {\n if (typeof value === 'string') {\n if (variable.multi || variable.includeAll) {\n return \"'\" + value + \"'\";\n } else {\n return value;\n }\n }\n\n if (typeof value === 'number') {\n return value;\n }\n\n var quotedValues = _.map(value, function(val) {\n if (typeof value === 'number') {\n return value;\n }\n\n return \"'\" + val + \"'\";\n });\n return quotedValues.join(',');\n }\n\n query(options) {\n var queries = _.filter(options.targets, item => {\n return item.hide !== true;\n }).map(item => {\n return {\n refId: item.refId,\n intervalMs: options.intervalMs,\n maxDataPoints: options.maxDataPoints,\n datasourceId: this.id,\n rawSql: this.templateSrv.replace(item.rawSql, options.scopedVars, this.interpolateVariable),\n format: item.format,\n };\n });\n\n if (queries.length === 0) {\n return this.$q.when({ data: [] });\n }\n\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: {\n from: options.range.from.valueOf().toString(),\n to: options.range.to.valueOf().toString(),\n queries: queries,\n },\n })\n .then(this.responseParser.processQueryResult);\n }\n\n annotationQuery(options) {\n if (!options.annotation.rawQuery) {\n return this.$q.reject({\n message: 'Query missing in annotation definition',\n });\n }\n\n const query = {\n refId: options.annotation.name,\n datasourceId: this.id,\n rawSql: this.templateSrv.replace(options.annotation.rawQuery, options.scopedVars, this.interpolateVariable),\n format: 'table',\n };\n\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: {\n from: options.range.from.valueOf().toString(),\n to: options.range.to.valueOf().toString(),\n queries: [query],\n },\n })\n .then(data => this.responseParser.transformAnnotationResponse(options, data));\n }\n\n metricFindQuery(query, optionalOptions) {\n let refId = 'tempvar';\n if (optionalOptions && optionalOptions.variable && optionalOptions.variable.name) {\n refId = optionalOptions.variable.name;\n }\n\n const interpolatedQuery = {\n refId: refId,\n datasourceId: this.id,\n rawSql: this.templateSrv.replace(query, {}, this.interpolateVariable),\n format: 'table',\n };\n\n var data = {\n queries: [interpolatedQuery],\n };\n\n if (optionalOptions && optionalOptions.range && optionalOptions.range.from) {\n data['from'] = optionalOptions.range.from.valueOf().toString();\n }\n if (optionalOptions && optionalOptions.range && optionalOptions.range.to) {\n data['to'] = optionalOptions.range.to.valueOf().toString();\n }\n\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: data,\n })\n .then(data => this.responseParser.parseMetricFindQueryResult(refId, data));\n }\n\n testDatasource() {\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: {\n from: '5m',\n to: 'now',\n queries: [\n {\n refId: 'A',\n intervalMs: 1,\n maxDataPoints: 1,\n datasourceId: this.id,\n rawSql: 'SELECT 1',\n format: 'table',\n },\n ],\n },\n })\n .then(res => {\n return { status: 'success', message: 'Database Connection OK' };\n })\n .catch(err => {\n console.log(err);\n if (err.data && err.data.message) {\n return { status: 'error', message: err.data.message };\n } else {\n return { status: 'error', message: err.status };\n }\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/mysql/datasource.ts","import _ from 'lodash';\n\nexport default class ResponseParser {\n constructor(private $q) {}\n\n processQueryResult(res) {\n var data = [];\n\n if (!res.data.results) {\n return { data: data };\n }\n\n for (let key in res.data.results) {\n let queryRes = res.data.results[key];\n\n if (queryRes.series) {\n for (let series of queryRes.series) {\n data.push({\n target: series.name,\n datapoints: series.points,\n refId: queryRes.refId,\n meta: queryRes.meta,\n });\n }\n }\n\n if (queryRes.tables) {\n for (let table of queryRes.tables) {\n table.type = 'table';\n table.refId = queryRes.refId;\n table.meta = queryRes.meta;\n data.push(table);\n }\n }\n }\n\n return { data: data };\n }\n\n parseMetricFindQueryResult(refId, results) {\n if (!results || results.data.length === 0 || results.data.results[refId].meta.rowCount === 0) {\n return [];\n }\n\n const columns = results.data.results[refId].tables[0].columns;\n const rows = results.data.results[refId].tables[0].rows;\n const textColIndex = this.findColIndex(columns, '__text');\n const valueColIndex = this.findColIndex(columns, '__value');\n\n if (columns.length === 2 && textColIndex !== -1 && valueColIndex !== -1) {\n return this.transformToKeyValueList(rows, textColIndex, valueColIndex);\n }\n\n return this.transformToSimpleList(rows);\n }\n\n transformToKeyValueList(rows, textColIndex, valueColIndex) {\n const res = [];\n\n for (let i = 0; i < rows.length; i++) {\n if (!this.containsKey(res, rows[i][textColIndex])) {\n res.push({\n text: rows[i][textColIndex],\n value: rows[i][valueColIndex],\n });\n }\n }\n\n return res;\n }\n\n transformToSimpleList(rows) {\n const res = [];\n\n for (let i = 0; i < rows.length; i++) {\n for (let j = 0; j < rows[i].length; j++) {\n const value = rows[i][j];\n if (res.indexOf(value) === -1) {\n res.push(value);\n }\n }\n }\n\n return _.map(res, value => {\n return { text: value };\n });\n }\n\n findColIndex(columns, colName) {\n for (let i = 0; i < columns.length; i++) {\n if (columns[i].text === colName) {\n return i;\n }\n }\n\n return -1;\n }\n\n containsKey(res, key) {\n for (let i = 0; i < res.length; i++) {\n if (res[i].text === key) {\n return true;\n }\n }\n return false;\n }\n\n transformAnnotationResponse(options, data) {\n const table = data.data.results[options.annotation.name].tables[0];\n\n let timeColumnIndex = -1;\n let textColumnIndex = -1;\n let tagsColumnIndex = -1;\n\n for (let i = 0; i < table.columns.length; i++) {\n if (table.columns[i].text === 'time_sec' || table.columns[i].text === 'time') {\n timeColumnIndex = i;\n } else if (table.columns[i].text === 'title') {\n return this.$q.reject({\n message: 'The title column for annotations is deprecated, now only a column named text is returned',\n });\n } else if (table.columns[i].text === 'text') {\n textColumnIndex = i;\n } else if (table.columns[i].text === 'tags') {\n tagsColumnIndex = i;\n }\n }\n\n if (timeColumnIndex === -1) {\n return this.$q.reject({\n message: 'Missing mandatory time column (with time_sec column alias) in annotation query.',\n });\n }\n\n const list = [];\n for (let i = 0; i < table.rows.length; i++) {\n const row = table.rows[i];\n list.push({\n annotation: options.annotation,\n time: Math.floor(row[timeColumnIndex]),\n text: row[textColumnIndex] ? row[textColumnIndex].toString() : '',\n tags: row[tagsColumnIndex] ? row[tagsColumnIndex].trim().split(/\\s*,\\s*/) : [],\n });\n }\n\n return list;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/mysql/response_parser.ts","import _ from 'lodash';\nimport { QueryCtrl } from 'app/plugins/sdk';\n\nexport interface MysqlQuery {\n refId: string;\n format: string;\n alias: string;\n rawSql: string;\n}\n\nexport interface QueryMeta {\n sql: string;\n}\n\nconst defaultQuery = `SELECT\n UNIX_TIMESTAMP() as time_sec,\n as value,\n as metric\nFROM
    \nWHERE $__timeFilter(time_column)\nORDER BY ASC\n`;\n\nexport class MysqlQueryCtrl extends QueryCtrl {\n static templateUrl = 'partials/query.editor.html';\n\n showLastQuerySQL: boolean;\n formats: any[];\n target: MysqlQuery;\n lastQueryMeta: QueryMeta;\n lastQueryError: string;\n showHelp: boolean;\n\n /** @ngInject **/\n constructor($scope, $injector) {\n super($scope, $injector);\n\n this.target.format = this.target.format || 'time_series';\n this.target.alias = '';\n this.formats = [{ text: 'Time series', value: 'time_series' }, { text: 'Table', value: 'table' }];\n\n if (!this.target.rawSql) {\n // special handling when in table panel\n if (this.panelCtrl.panel.type === 'table') {\n this.target.format = 'table';\n this.target.rawSql = 'SELECT 1';\n } else {\n this.target.rawSql = defaultQuery;\n }\n }\n\n this.panelCtrl.events.on('data-received', this.onDataReceived.bind(this), $scope);\n this.panelCtrl.events.on('data-error', this.onDataError.bind(this), $scope);\n }\n\n onDataReceived(dataList) {\n this.lastQueryMeta = null;\n this.lastQueryError = null;\n\n let anySeriesFromQuery = _.find(dataList, { refId: this.target.refId });\n if (anySeriesFromQuery) {\n this.lastQueryMeta = anySeriesFromQuery.meta;\n }\n }\n\n onDataError(err) {\n if (err.data && err.data.results) {\n let queryRes = err.data.results[this.target.refId];\n if (queryRes) {\n this.lastQueryMeta = queryRes.meta;\n this.lastQueryError = queryRes.error;\n }\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/mysql/query_ctrl.ts","import { PostgresDatasource } from './datasource';\nimport { PostgresQueryCtrl } from './query_ctrl';\n\nclass PostgresConfigCtrl {\n static templateUrl = 'partials/config.html';\n\n current: any;\n\n /** @ngInject **/\n constructor($scope) {\n this.current.jsonData.sslmode = this.current.jsonData.sslmode || 'verify-full';\n }\n}\n\nconst defaultQuery = `SELECT\n extract(epoch from time_column) AS time,\n text_column as text,\n tags_column as tags\nFROM\n metric_table\nWHERE\n $__timeFilter(time_column)\n`;\n\nclass PostgresAnnotationsQueryCtrl {\n static templateUrl = 'partials/annotations.editor.html';\n\n annotation: any;\n\n /** @ngInject **/\n constructor() {\n this.annotation.rawQuery = this.annotation.rawQuery || defaultQuery;\n }\n}\n\nexport {\n PostgresDatasource,\n PostgresDatasource as Datasource,\n PostgresQueryCtrl as QueryCtrl,\n PostgresConfigCtrl as ConfigCtrl,\n PostgresAnnotationsQueryCtrl as AnnotationsQueryCtrl,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/postgres/module.ts","import _ from 'lodash';\nimport ResponseParser from './response_parser';\n\nexport class PostgresDatasource {\n id: any;\n name: any;\n responseParser: ResponseParser;\n\n /** @ngInject **/\n constructor(instanceSettings, private backendSrv, private $q, private templateSrv) {\n this.name = instanceSettings.name;\n this.id = instanceSettings.id;\n this.responseParser = new ResponseParser(this.$q);\n }\n\n interpolateVariable(value, variable) {\n if (typeof value === 'string') {\n if (variable.multi || variable.includeAll) {\n return \"'\" + value + \"'\";\n } else {\n return value;\n }\n }\n\n if (typeof value === 'number') {\n return value;\n }\n\n var quotedValues = _.map(value, function(val) {\n return \"'\" + val + \"'\";\n });\n return quotedValues.join(',');\n }\n\n query(options) {\n var queries = _.filter(options.targets, item => {\n return item.hide !== true;\n }).map(item => {\n return {\n refId: item.refId,\n intervalMs: options.intervalMs,\n maxDataPoints: options.maxDataPoints,\n datasourceId: this.id,\n rawSql: this.templateSrv.replace(item.rawSql, options.scopedVars, this.interpolateVariable),\n format: item.format,\n };\n });\n\n if (queries.length === 0) {\n return this.$q.when({ data: [] });\n }\n\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: {\n from: options.range.from.valueOf().toString(),\n to: options.range.to.valueOf().toString(),\n queries: queries,\n },\n })\n .then(this.responseParser.processQueryResult);\n }\n\n annotationQuery(options) {\n if (!options.annotation.rawQuery) {\n return this.$q.reject({\n message: 'Query missing in annotation definition',\n });\n }\n\n const query = {\n refId: options.annotation.name,\n datasourceId: this.id,\n rawSql: this.templateSrv.replace(options.annotation.rawQuery, options.scopedVars, this.interpolateVariable),\n format: 'table',\n };\n\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: {\n from: options.range.from.valueOf().toString(),\n to: options.range.to.valueOf().toString(),\n queries: [query],\n },\n })\n .then(data => this.responseParser.transformAnnotationResponse(options, data));\n }\n\n metricFindQuery(query, optionalOptions) {\n let refId = 'tempvar';\n if (optionalOptions && optionalOptions.variable && optionalOptions.variable.name) {\n refId = optionalOptions.variable.name;\n }\n\n const interpolatedQuery = {\n refId: refId,\n datasourceId: this.id,\n rawSql: this.templateSrv.replace(query, {}, this.interpolateVariable),\n format: 'table',\n };\n\n var data = {\n queries: [interpolatedQuery],\n };\n\n if (optionalOptions && optionalOptions.range && optionalOptions.range.from) {\n data['from'] = optionalOptions.range.from.valueOf().toString();\n }\n if (optionalOptions && optionalOptions.range && optionalOptions.range.to) {\n data['to'] = optionalOptions.range.to.valueOf().toString();\n }\n\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: data,\n })\n .then(data => this.responseParser.parseMetricFindQueryResult(refId, data));\n }\n\n testDatasource() {\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: {\n from: '5m',\n to: 'now',\n queries: [\n {\n refId: 'A',\n intervalMs: 1,\n maxDataPoints: 1,\n datasourceId: this.id,\n rawSql: 'SELECT 1',\n format: 'table',\n },\n ],\n },\n })\n .then(res => {\n return { status: 'success', message: 'Database Connection OK' };\n })\n .catch(err => {\n console.log(err);\n if (err.data && err.data.message) {\n return { status: 'error', message: err.data.message };\n } else {\n return { status: 'error', message: err.status };\n }\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/postgres/datasource.ts","import _ from 'lodash';\n\nexport default class ResponseParser {\n constructor(private $q) {}\n\n processQueryResult(res) {\n var data = [];\n\n if (!res.data.results) {\n return { data: data };\n }\n\n for (let key in res.data.results) {\n let queryRes = res.data.results[key];\n\n if (queryRes.series) {\n for (let series of queryRes.series) {\n data.push({\n target: series.name,\n datapoints: series.points,\n refId: queryRes.refId,\n meta: queryRes.meta,\n });\n }\n }\n\n if (queryRes.tables) {\n for (let table of queryRes.tables) {\n table.type = 'table';\n table.refId = queryRes.refId;\n table.meta = queryRes.meta;\n data.push(table);\n }\n }\n }\n\n return { data: data };\n }\n\n parseMetricFindQueryResult(refId, results) {\n if (!results || results.data.length === 0 || results.data.results[refId].meta.rowCount === 0) {\n return [];\n }\n\n const columns = results.data.results[refId].tables[0].columns;\n const rows = results.data.results[refId].tables[0].rows;\n const textColIndex = this.findColIndex(columns, '__text');\n const valueColIndex = this.findColIndex(columns, '__value');\n\n if (columns.length === 2 && textColIndex !== -1 && valueColIndex !== -1) {\n return this.transformToKeyValueList(rows, textColIndex, valueColIndex);\n }\n\n return this.transformToSimpleList(rows);\n }\n\n transformToKeyValueList(rows, textColIndex, valueColIndex) {\n const res = [];\n\n for (let i = 0; i < rows.length; i++) {\n if (!this.containsKey(res, rows[i][textColIndex])) {\n res.push({\n text: rows[i][textColIndex],\n value: rows[i][valueColIndex],\n });\n }\n }\n\n return res;\n }\n\n transformToSimpleList(rows) {\n const res = [];\n\n for (let i = 0; i < rows.length; i++) {\n for (let j = 0; j < rows[i].length; j++) {\n const value = rows[i][j];\n if (res.indexOf(value) === -1) {\n res.push(value);\n }\n }\n }\n\n return _.map(res, value => {\n return { text: value };\n });\n }\n\n findColIndex(columns, colName) {\n for (let i = 0; i < columns.length; i++) {\n if (columns[i].text === colName) {\n return i;\n }\n }\n\n return -1;\n }\n\n containsKey(res, key) {\n for (let i = 0; i < res.length; i++) {\n if (res[i].text === key) {\n return true;\n }\n }\n return false;\n }\n\n transformAnnotationResponse(options, data) {\n const table = data.data.results[options.annotation.name].tables[0];\n\n let timeColumnIndex = -1;\n let titleColumnIndex = -1;\n let textColumnIndex = -1;\n let tagsColumnIndex = -1;\n\n for (let i = 0; i < table.columns.length; i++) {\n if (table.columns[i].text === 'time') {\n timeColumnIndex = i;\n } else if (table.columns[i].text === 'text') {\n textColumnIndex = i;\n } else if (table.columns[i].text === 'tags') {\n tagsColumnIndex = i;\n }\n }\n\n if (timeColumnIndex === -1) {\n return this.$q.reject({\n message: 'Missing mandatory time column in annotation query.',\n });\n }\n\n const list = [];\n for (let i = 0; i < table.rows.length; i++) {\n const row = table.rows[i];\n list.push({\n annotation: options.annotation,\n time: Math.floor(row[timeColumnIndex]),\n title: row[titleColumnIndex],\n text: row[textColumnIndex],\n tags: row[tagsColumnIndex] ? row[tagsColumnIndex].trim().split(/\\s*,\\s*/) : [],\n });\n }\n\n return list;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/postgres/response_parser.ts","import _ from 'lodash';\nimport { QueryCtrl } from 'app/plugins/sdk';\n\nexport interface PostgresQuery {\n refId: string;\n format: string;\n alias: string;\n rawSql: string;\n}\n\nexport interface QueryMeta {\n sql: string;\n}\n\nconst defaultQuery = `SELECT\n $__time(time_column),\n value1\nFROM\n metric_table\nWHERE\n $__timeFilter(time_column)\n`;\n\nexport class PostgresQueryCtrl extends QueryCtrl {\n static templateUrl = 'partials/query.editor.html';\n\n showLastQuerySQL: boolean;\n formats: any[];\n target: PostgresQuery;\n lastQueryMeta: QueryMeta;\n lastQueryError: string;\n showHelp: boolean;\n\n /** @ngInject **/\n constructor($scope, $injector) {\n super($scope, $injector);\n\n this.target.format = this.target.format || 'time_series';\n this.target.alias = '';\n this.formats = [{ text: 'Time series', value: 'time_series' }, { text: 'Table', value: 'table' }];\n\n if (!this.target.rawSql) {\n // special handling when in table panel\n if (this.panelCtrl.panel.type === 'table') {\n this.target.format = 'table';\n this.target.rawSql = 'SELECT 1';\n } else {\n this.target.rawSql = defaultQuery;\n }\n }\n\n this.panelCtrl.events.on('data-received', this.onDataReceived.bind(this), $scope);\n this.panelCtrl.events.on('data-error', this.onDataError.bind(this), $scope);\n }\n\n onDataReceived(dataList) {\n this.lastQueryMeta = null;\n this.lastQueryError = null;\n\n let anySeriesFromQuery = _.find(dataList, { refId: this.target.refId });\n if (anySeriesFromQuery) {\n this.lastQueryMeta = anySeriesFromQuery.meta;\n }\n }\n\n onDataError(err) {\n if (err.data && err.data.results) {\n let queryRes = err.data.results[this.target.refId];\n if (queryRes) {\n this.lastQueryMeta = queryRes.meta;\n this.lastQueryError = queryRes.error;\n }\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/postgres/query_ctrl.ts","import { PrometheusDatasource } from './datasource';\nimport { PrometheusQueryCtrl } from './query_ctrl';\nimport { PrometheusConfigCtrl } from './config_ctrl';\n\nclass PrometheusAnnotationsQueryCtrl {\n static templateUrl = 'partials/annotations.editor.html';\n}\n\nexport {\n PrometheusDatasource as Datasource,\n PrometheusQueryCtrl as QueryCtrl,\n PrometheusConfigCtrl as ConfigCtrl,\n PrometheusAnnotationsQueryCtrl as AnnotationsQueryCtrl,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/prometheus/module.ts","import _ from 'lodash';\n\nimport $ from 'jquery';\nimport kbn from 'app/core/utils/kbn';\nimport * as dateMath from 'app/core/utils/datemath';\nimport PrometheusMetricFindQuery from './metric_find_query';\nimport { ResultTransformer } from './result_transformer';\nimport { BackendSrv } from 'app/core/services/backend_srv';\n\nexport function alignRange(start, end, step) {\n const alignedEnd = Math.ceil(end / step) * step;\n const alignedStart = Math.floor(start / step) * step;\n return {\n end: alignedEnd,\n start: alignedStart,\n };\n}\n\nexport function prometheusRegularEscape(value) {\n return value.replace(/'/g, \"\\\\\\\\'\");\n}\n\nexport function prometheusSpecialRegexEscape(value) {\n return prometheusRegularEscape(value.replace(/\\\\/g, '\\\\\\\\\\\\\\\\').replace(/[$^*{}\\[\\]+?.()]/g, '\\\\\\\\$&'));\n}\n\nexport class PrometheusDatasource {\n type: string;\n editorSrc: string;\n name: string;\n supportsExplore: boolean;\n supportMetrics: boolean;\n url: string;\n directUrl: string;\n basicAuth: any;\n withCredentials: any;\n metricsNameCache: any;\n interval: string;\n queryTimeout: string;\n httpMethod: string;\n resultTransformer: ResultTransformer;\n\n /** @ngInject */\n constructor(instanceSettings, private $q, private backendSrv: BackendSrv, private templateSrv, private timeSrv) {\n this.type = 'prometheus';\n this.editorSrc = 'app/features/prometheus/partials/query.editor.html';\n this.name = instanceSettings.name;\n this.supportsExplore = true;\n this.supportMetrics = true;\n this.url = instanceSettings.url;\n this.directUrl = instanceSettings.directUrl;\n this.basicAuth = instanceSettings.basicAuth;\n this.withCredentials = instanceSettings.withCredentials;\n this.interval = instanceSettings.jsonData.timeInterval || '15s';\n this.queryTimeout = instanceSettings.jsonData.queryTimeout;\n this.httpMethod = instanceSettings.jsonData.httpMethod || 'GET';\n this.resultTransformer = new ResultTransformer(templateSrv);\n }\n\n _request(url, data?, options?: any) {\n var options: any = {\n url: this.url + url,\n method: this.httpMethod,\n ...options,\n };\n if (options.method === 'GET') {\n if (!_.isEmpty(data)) {\n options.url =\n options.url +\n '?' +\n _.map(data, (v, k) => {\n return encodeURIComponent(k) + '=' + encodeURIComponent(v);\n }).join('&');\n }\n } else {\n options.headers = {\n 'Content-Type': 'application/x-www-form-urlencoded',\n };\n options.transformRequest = data => {\n return $.param(data);\n };\n options.data = data;\n }\n\n if (this.basicAuth || this.withCredentials) {\n options.withCredentials = true;\n }\n\n if (this.basicAuth) {\n options.headers = {\n Authorization: this.basicAuth,\n };\n }\n\n return this.backendSrv.datasourceRequest(options);\n }\n\n // Use this for tab completion features, wont publish response to other components\n metadataRequest(url) {\n return this._request(url, null, { method: 'GET', silent: true });\n }\n\n interpolateQueryExpr(value, variable, defaultFormatFn) {\n // if no multi or include all do not regexEscape\n if (!variable.multi && !variable.includeAll) {\n return prometheusRegularEscape(value);\n }\n\n if (typeof value === 'string') {\n return prometheusSpecialRegexEscape(value);\n }\n\n var escapedValues = _.map(value, prometheusSpecialRegexEscape);\n return escapedValues.join('|');\n }\n\n targetContainsTemplate(target) {\n return this.templateSrv.variableExists(target.expr);\n }\n\n query(options) {\n var start = this.getPrometheusTime(options.range.from, false);\n var end = this.getPrometheusTime(options.range.to, true);\n\n var queries = [];\n var activeTargets = [];\n\n options = _.clone(options);\n\n for (let target of options.targets) {\n if (!target.expr || target.hide) {\n continue;\n }\n\n activeTargets.push(target);\n queries.push(this.createQuery(target, options, start, end));\n }\n\n // No valid targets, return the empty result to save a round trip.\n if (_.isEmpty(queries)) {\n return this.$q.when({ data: [] });\n }\n\n var allQueryPromise = _.map(queries, query => {\n if (!query.instant) {\n return this.performTimeSeriesQuery(query, query.start, query.end);\n } else {\n return this.performInstantQuery(query, end);\n }\n });\n\n return this.$q.all(allQueryPromise).then(responseList => {\n let result = [];\n\n _.each(responseList, (response, index) => {\n if (response.status === 'error') {\n throw response.error;\n }\n\n // Keeping original start/end for transformers\n const transformerOptions = {\n format: activeTargets[index].format,\n step: queries[index].step,\n legendFormat: activeTargets[index].legendFormat,\n start: start,\n end: end,\n query: queries[index].expr,\n responseListLength: responseList.length,\n responseIndex: index,\n refId: activeTargets[index].refId,\n };\n\n this.resultTransformer.transform(result, response, transformerOptions);\n });\n\n return { data: result };\n });\n }\n\n createQuery(target, options, start, end) {\n var query: any = {};\n query.instant = target.instant;\n var range = Math.ceil(end - start);\n\n var interval = kbn.interval_to_seconds(options.interval);\n // Minimum interval (\"Min step\"), if specified for the query. or same as interval otherwise\n var minInterval = kbn.interval_to_seconds(\n this.templateSrv.replace(target.interval, options.scopedVars) || options.interval\n );\n var intervalFactor = target.intervalFactor || 1;\n // Adjust the interval to take into account any specified minimum and interval factor plus Prometheus limits\n var adjustedInterval = this.adjustInterval(interval, minInterval, range, intervalFactor);\n var scopedVars = options.scopedVars;\n // If the interval was adjusted, make a shallow copy of scopedVars with updated interval vars\n if (interval !== adjustedInterval) {\n interval = adjustedInterval;\n scopedVars = Object.assign({}, options.scopedVars, {\n __interval: { text: interval + 's', value: interval + 's' },\n __interval_ms: { text: interval * 1000, value: interval * 1000 },\n });\n }\n query.step = interval;\n\n // Only replace vars in expression after having (possibly) updated interval vars\n query.expr = this.templateSrv.replace(target.expr, scopedVars, this.interpolateQueryExpr);\n query.requestId = options.panelId + target.refId;\n\n // Align query interval with step\n const adjusted = alignRange(start, end, query.step);\n query.start = adjusted.start;\n query.end = adjusted.end;\n\n return query;\n }\n\n adjustInterval(interval, minInterval, range, intervalFactor) {\n // Prometheus will drop queries that might return more than 11000 data points.\n // Calibrate interval if it is too small.\n if (interval !== 0 && range / intervalFactor / interval > 11000) {\n interval = Math.ceil(range / intervalFactor / 11000);\n }\n return Math.max(interval * intervalFactor, minInterval, 1);\n }\n\n performTimeSeriesQuery(query, start, end) {\n if (start > end) {\n throw { message: 'Invalid time range' };\n }\n\n var url = '/api/v1/query_range';\n var data = {\n query: query.expr,\n start: start,\n end: end,\n step: query.step,\n };\n if (this.queryTimeout) {\n data['timeout'] = this.queryTimeout;\n }\n return this._request(url, data, { requestId: query.requestId });\n }\n\n performInstantQuery(query, time) {\n var url = '/api/v1/query';\n var data = {\n query: query.expr,\n time: time,\n };\n if (this.queryTimeout) {\n data['timeout'] = this.queryTimeout;\n }\n return this._request(url, data, { requestId: query.requestId });\n }\n\n performSuggestQuery(query, cache = false) {\n var url = '/api/v1/label/__name__/values';\n\n if (cache && this.metricsNameCache && this.metricsNameCache.expire > Date.now()) {\n return this.$q.when(\n _.filter(this.metricsNameCache.data, metricName => {\n return metricName.indexOf(query) !== 1;\n })\n );\n }\n\n return this.metadataRequest(url).then(result => {\n this.metricsNameCache = {\n data: result.data.data,\n expire: Date.now() + 60 * 1000,\n };\n return _.filter(result.data.data, metricName => {\n return metricName.indexOf(query) !== 1;\n });\n });\n }\n\n metricFindQuery(query) {\n if (!query) {\n return this.$q.when([]);\n }\n\n let interpolated = this.templateSrv.replace(query, {}, this.interpolateQueryExpr);\n var metricFindQuery = new PrometheusMetricFindQuery(this, interpolated, this.timeSrv);\n return metricFindQuery.process();\n }\n\n annotationQuery(options) {\n var annotation = options.annotation;\n var expr = annotation.expr || '';\n var tagKeys = annotation.tagKeys || '';\n var titleFormat = annotation.titleFormat || '';\n var textFormat = annotation.textFormat || '';\n\n if (!expr) {\n return this.$q.when([]);\n }\n\n var step = annotation.step || '60s';\n var start = this.getPrometheusTime(options.range.from, false);\n var end = this.getPrometheusTime(options.range.to, true);\n // Unsetting min interval\n const queryOptions = {\n ...options,\n interval: '0s',\n };\n const query = this.createQuery({ expr, interval: step }, queryOptions, start, end);\n\n var self = this;\n return this.performTimeSeriesQuery(query, query.start, query.end).then(function(results) {\n var eventList = [];\n tagKeys = tagKeys.split(',');\n\n _.each(results.data.data.result, function(series) {\n var tags = _.chain(series.metric)\n .filter(function(v, k) {\n return _.includes(tagKeys, k);\n })\n .value();\n\n for (let value of series.values) {\n if (value[1] === '1') {\n var event = {\n annotation: annotation,\n time: Math.floor(parseFloat(value[0])) * 1000,\n title: self.resultTransformer.renderTemplate(titleFormat, series.metric),\n tags: tags,\n text: self.resultTransformer.renderTemplate(textFormat, series.metric),\n };\n\n eventList.push(event);\n }\n }\n });\n\n return eventList;\n });\n }\n\n testDatasource() {\n let now = new Date().getTime();\n return this.performInstantQuery({ expr: '1+1' }, now / 1000).then(response => {\n if (response.data.status === 'success') {\n return { status: 'success', message: 'Data source is working' };\n } else {\n return { status: 'error', message: response.error };\n }\n });\n }\n\n getExploreState(panel) {\n let state = {};\n if (panel.targets) {\n const queries = panel.targets.map(t => ({\n query: this.templateSrv.replace(t.expr, {}, this.interpolateQueryExpr),\n format: t.format,\n }));\n state = {\n ...state,\n queries,\n };\n }\n return state;\n }\n\n getPrometheusTime(date, roundUp) {\n if (_.isString(date)) {\n date = dateMath.parse(date, roundUp);\n }\n return Math.ceil(date.valueOf() / 1000);\n }\n\n getOriginalMetricName(labelData) {\n return this.resultTransformer.getOriginalMetricName(labelData);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/prometheus/datasource.ts","import _ from 'lodash';\n\nexport default class PrometheusMetricFindQuery {\n datasource: any;\n query: any;\n range: any;\n\n constructor(datasource, query, timeSrv) {\n this.datasource = datasource;\n this.query = query;\n this.range = timeSrv.timeRange();\n }\n\n process() {\n var label_values_regex = /^label_values\\((?:(.+),\\s*)?([a-zA-Z_][a-zA-Z0-9_]+)\\)\\s*$/;\n var metric_names_regex = /^metrics\\((.+)\\)\\s*$/;\n var query_result_regex = /^query_result\\((.+)\\)\\s*$/;\n\n var label_values_query = this.query.match(label_values_regex);\n if (label_values_query) {\n if (label_values_query[1]) {\n return this.labelValuesQuery(label_values_query[2], label_values_query[1]);\n } else {\n return this.labelValuesQuery(label_values_query[2], null);\n }\n }\n\n var metric_names_query = this.query.match(metric_names_regex);\n if (metric_names_query) {\n return this.metricNameQuery(metric_names_query[1]);\n }\n\n var query_result_query = this.query.match(query_result_regex);\n if (query_result_query) {\n return this.queryResultQuery(query_result_query[1]);\n }\n\n // if query contains full metric name, return metric name and label list\n return this.metricNameAndLabelsQuery(this.query);\n }\n\n labelValuesQuery(label, metric) {\n var url;\n\n if (!metric) {\n // return label values globally\n url = '/api/v1/label/' + label + '/values';\n\n return this.datasource.metadataRequest(url).then(function(result) {\n return _.map(result.data.data, function(value) {\n return { text: value };\n });\n });\n } else {\n var start = this.datasource.getPrometheusTime(this.range.from, false);\n var end = this.datasource.getPrometheusTime(this.range.to, true);\n url = '/api/v1/series?match[]=' + encodeURIComponent(metric) + '&start=' + start + '&end=' + end;\n\n return this.datasource.metadataRequest(url).then(function(result) {\n var _labels = _.map(result.data.data, function(metric) {\n return metric[label] || '';\n }).filter(function(label) {\n return label !== '';\n });\n\n return _.uniq(_labels).map(function(metric) {\n return {\n text: metric,\n expandable: true,\n };\n });\n });\n }\n }\n\n metricNameQuery(metricFilterPattern) {\n var url = '/api/v1/label/__name__/values';\n\n return this.datasource.metadataRequest(url).then(function(result) {\n return _.chain(result.data.data)\n .filter(function(metricName) {\n var r = new RegExp(metricFilterPattern);\n return r.test(metricName);\n })\n .map(function(matchedMetricName) {\n return {\n text: matchedMetricName,\n expandable: true,\n };\n })\n .value();\n });\n }\n\n queryResultQuery(query) {\n var end = this.datasource.getPrometheusTime(this.range.to, true);\n return this.datasource.performInstantQuery({ expr: query }, end).then(function(result) {\n return _.map(result.data.data.result, function(metricData) {\n var text = metricData.metric.__name__ || '';\n delete metricData.metric.__name__;\n text +=\n '{' +\n _.map(metricData.metric, function(v, k) {\n return k + '=\"' + v + '\"';\n }).join(',') +\n '}';\n text += ' ' + metricData.value[1] + ' ' + metricData.value[0] * 1000;\n\n return {\n text: text,\n expandable: true,\n };\n });\n });\n }\n\n metricNameAndLabelsQuery(query) {\n var start = this.datasource.getPrometheusTime(this.range.from, false);\n var end = this.datasource.getPrometheusTime(this.range.to, true);\n var url = '/api/v1/series?match[]=' + encodeURIComponent(query) + '&start=' + start + '&end=' + end;\n\n var self = this;\n return this.datasource.metadataRequest(url).then(function(result) {\n return _.map(result.data.data, metric => {\n return {\n text: self.datasource.getOriginalMetricName(metric),\n expandable: true,\n };\n });\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/prometheus/metric_find_query.ts","import _ from 'lodash';\nimport TableModel from 'app/core/table_model';\n\nexport class ResultTransformer {\n constructor(private templateSrv) {}\n\n transform(result: any, response: any, options: any) {\n let prometheusResult = response.data.data.result;\n\n if (options.format === 'table') {\n result.push(this.transformMetricDataToTable(prometheusResult, options.responseListLength, options.refId));\n } else if (options.format === 'heatmap') {\n let seriesList = [];\n prometheusResult.sort(sortSeriesByLabel);\n for (let metricData of prometheusResult) {\n seriesList.push(this.transformMetricData(metricData, options, options.start, options.end));\n }\n seriesList = this.transformToHistogramOverTime(seriesList);\n result.push(...seriesList);\n } else {\n for (let metricData of prometheusResult) {\n if (response.data.data.resultType === 'matrix') {\n result.push(this.transformMetricData(metricData, options, options.start, options.end));\n } else if (response.data.data.resultType === 'vector') {\n result.push(this.transformInstantMetricData(metricData, options));\n }\n }\n }\n }\n\n transformMetricData(md, options, start, end) {\n let dps = [],\n metricLabel = null;\n\n metricLabel = this.createMetricLabel(md.metric, options);\n\n const stepMs = parseInt(options.step) * 1000;\n let baseTimestamp = start * 1000;\n for (let value of md.values) {\n let dp_value = parseFloat(value[1]);\n if (_.isNaN(dp_value)) {\n dp_value = null;\n }\n\n const timestamp = parseFloat(value[0]) * 1000;\n for (let t = baseTimestamp; t < timestamp; t += stepMs) {\n dps.push([null, t]);\n }\n baseTimestamp = timestamp + stepMs;\n dps.push([dp_value, timestamp]);\n }\n\n const endTimestamp = end * 1000;\n for (let t = baseTimestamp; t <= endTimestamp; t += stepMs) {\n dps.push([null, t]);\n }\n\n return { target: metricLabel, datapoints: dps };\n }\n\n transformMetricDataToTable(md, resultCount: number, refId: string) {\n var table = new TableModel();\n var i, j;\n var metricLabels = {};\n\n if (md.length === 0) {\n return table;\n }\n\n // Collect all labels across all metrics\n _.each(md, function(series) {\n for (var label in series.metric) {\n if (!metricLabels.hasOwnProperty(label)) {\n metricLabels[label] = 1;\n }\n }\n });\n\n // Sort metric labels, create columns for them and record their index\n var sortedLabels = _.keys(metricLabels).sort();\n table.columns.push({ text: 'Time', type: 'time' });\n _.each(sortedLabels, function(label, labelIndex) {\n metricLabels[label] = labelIndex + 1;\n table.columns.push({ text: label });\n });\n let valueText = resultCount > 1 ? `Value #${refId}` : 'Value';\n table.columns.push({ text: valueText });\n\n // Populate rows, set value to empty string when label not present.\n _.each(md, function(series) {\n if (series.value) {\n series.values = [series.value];\n }\n if (series.values) {\n for (i = 0; i < series.values.length; i++) {\n var values = series.values[i];\n var reordered: any = [values[0] * 1000];\n if (series.metric) {\n for (j = 0; j < sortedLabels.length; j++) {\n var label = sortedLabels[j];\n if (series.metric.hasOwnProperty(label)) {\n reordered.push(series.metric[label]);\n } else {\n reordered.push('');\n }\n }\n }\n reordered.push(parseFloat(values[1]));\n table.rows.push(reordered);\n }\n }\n });\n\n return table;\n }\n\n transformInstantMetricData(md, options) {\n var dps = [],\n metricLabel = null;\n metricLabel = this.createMetricLabel(md.metric, options);\n dps.push([parseFloat(md.value[1]), md.value[0] * 1000]);\n return { target: metricLabel, datapoints: dps };\n }\n\n createMetricLabel(labelData, options) {\n let label = '';\n if (_.isUndefined(options) || _.isEmpty(options.legendFormat)) {\n label = this.getOriginalMetricName(labelData);\n } else {\n label = this.renderTemplate(this.templateSrv.replace(options.legendFormat), labelData);\n }\n if (!label || label === '{}') {\n label = options.query;\n }\n return label;\n }\n\n renderTemplate(aliasPattern, aliasData) {\n var aliasRegex = /\\{\\{\\s*(.+?)\\s*\\}\\}/g;\n return aliasPattern.replace(aliasRegex, function(match, g1) {\n if (aliasData[g1]) {\n return aliasData[g1];\n }\n return g1;\n });\n }\n\n getOriginalMetricName(labelData) {\n var metricName = labelData.__name__ || '';\n delete labelData.__name__;\n var labelPart = _.map(_.toPairs(labelData), function(label) {\n return label[0] + '=\"' + label[1] + '\"';\n }).join(',');\n return metricName + '{' + labelPart + '}';\n }\n\n transformToHistogramOverTime(seriesList) {\n /* t1 = timestamp1, t2 = timestamp2 etc.\n t1 t2 t3 t1 t2 t3\n le10 10 10 0 => 10 10 0\n le20 20 10 30 => 10 0 30\n le30 30 10 35 => 10 0 5\n */\n for (let i = seriesList.length - 1; i > 0; i--) {\n let topSeries = seriesList[i].datapoints;\n let bottomSeries = seriesList[i - 1].datapoints;\n for (let j = 0; j < topSeries.length; j++) {\n topSeries[j][0] -= bottomSeries[j][0];\n }\n }\n\n return seriesList;\n }\n}\n\nfunction sortSeriesByLabel(s1, s2): number {\n let le1, le2;\n\n try {\n // fail if not integer. might happen with bad queries\n le1 = parseHistogramLabel(s1.metric.le);\n le2 = parseHistogramLabel(s2.metric.le);\n } catch (err) {\n console.log(err);\n return 0;\n }\n\n if (le1 > le2) {\n return 1;\n }\n\n if (le1 < le2) {\n return -1;\n }\n\n return 0;\n}\n\nfunction parseHistogramLabel(le: string): number {\n if (le === '+Inf') {\n return +Infinity;\n }\n return Number(le);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/prometheus/result_transformer.ts","import angular from 'angular';\nimport _ from 'lodash';\nimport { QueryCtrl } from 'app/plugins/sdk';\nimport { PromCompleter } from './completer';\nimport './mode-prometheus';\nimport './snippets/prometheus';\n\nclass PrometheusQueryCtrl extends QueryCtrl {\n static templateUrl = 'partials/query.editor.html';\n\n metric: any;\n resolutions: any;\n formats: any;\n instant: any;\n oldTarget: any;\n suggestMetrics: any;\n getMetricsAutocomplete: any;\n linkToPrometheus: any;\n\n /** @ngInject */\n constructor($scope, $injector, private templateSrv) {\n super($scope, $injector);\n\n var target = this.target;\n target.expr = target.expr || '';\n target.intervalFactor = target.intervalFactor || 1;\n target.format = target.format || this.getDefaultFormat();\n\n this.metric = '';\n this.resolutions = _.map([1, 2, 3, 4, 5, 10], function(f) {\n return { factor: f, label: '1/' + f };\n });\n\n this.formats = [\n { text: 'Time series', value: 'time_series' },\n { text: 'Table', value: 'table' },\n { text: 'Heatmap', value: 'heatmap' },\n ];\n\n this.instant = false;\n\n this.updateLink();\n }\n\n getCompleter(query) {\n return new PromCompleter(this.datasource, this.templateSrv);\n }\n\n getDefaultFormat() {\n if (this.panelCtrl.panel.type === 'table') {\n return 'table';\n } else if (this.panelCtrl.panel.type === 'heatmap') {\n return 'heatmap';\n }\n\n return 'time_series';\n }\n\n refreshMetricData() {\n if (!_.isEqual(this.oldTarget, this.target)) {\n this.oldTarget = angular.copy(this.target);\n this.panelCtrl.refresh();\n this.updateLink();\n }\n }\n\n updateLink() {\n var range = this.panelCtrl.range;\n if (!range) {\n return;\n }\n\n var rangeDiff = Math.ceil((range.to.valueOf() - range.from.valueOf()) / 1000);\n var endTime = range.to.utc().format('YYYY-MM-DD HH:mm');\n var expr = {\n 'g0.expr': this.templateSrv.replace(\n this.target.expr,\n this.panelCtrl.panel.scopedVars,\n this.datasource.interpolateQueryExpr\n ),\n 'g0.range_input': rangeDiff + 's',\n 'g0.end_input': endTime,\n 'g0.step_input': this.target.step,\n 'g0.stacked': this.panelCtrl.panel.stack ? 1 : 0,\n 'g0.tab': 0,\n };\n var args = _.map(expr, (v, k) => {\n return k + '=' + encodeURIComponent(v);\n }).join('&');\n this.linkToPrometheus = this.datasource.directUrl + '/graph?' + args;\n }\n\n getCollapsedText() {\n return this.target.expr;\n }\n}\n\nexport { PrometheusQueryCtrl };\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/prometheus/query_ctrl.ts","import { PrometheusDatasource } from './datasource';\nimport _ from 'lodash';\n\nexport class PromCompleter {\n labelQueryCache: any;\n labelNameCache: any;\n labelValueCache: any;\n templateVariableCompletions: any;\n\n identifierRegexps = [/\\[/, /[a-zA-Z0-9_:]/];\n\n constructor(private datasource: PrometheusDatasource, private templateSrv) {\n this.labelQueryCache = {};\n this.labelNameCache = {};\n this.labelValueCache = {};\n this.templateVariableCompletions = this.templateSrv.variables.map(variable => {\n return {\n caption: '$' + variable.name,\n value: '$' + variable.name,\n meta: 'variable',\n score: Number.MAX_VALUE,\n };\n });\n }\n\n getCompletions(editor, session, pos, prefix, callback) {\n let wrappedCallback = (err, completions) => {\n completions = completions.concat(this.templateVariableCompletions);\n return callback(err, completions);\n };\n\n let token = session.getTokenAt(pos.row, pos.column);\n\n switch (token.type) {\n case 'entity.name.tag.label-matcher':\n this.getCompletionsForLabelMatcherName(session, pos).then(completions => {\n wrappedCallback(null, completions);\n });\n return;\n case 'string.quoted.label-matcher':\n this.getCompletionsForLabelMatcherValue(session, pos).then(completions => {\n wrappedCallback(null, completions);\n });\n return;\n case 'entity.name.tag.label-list-matcher':\n this.getCompletionsForBinaryOperator(session, pos).then(completions => {\n wrappedCallback(null, completions);\n });\n return;\n }\n\n if (token.type === 'paren.lparen' && token.value === '[') {\n var vectors = [];\n for (let unit of ['s', 'm', 'h']) {\n for (let value of [1, 5, 10, 30]) {\n vectors.push({\n caption: value + unit,\n value: '[' + value + unit,\n meta: 'range vector',\n });\n }\n }\n\n vectors.unshift({\n caption: '$__interval_ms',\n value: '[$__interval_ms',\n meta: 'range vector',\n });\n\n vectors.unshift({\n caption: '$__interval',\n value: '[$__interval',\n meta: 'range vector',\n });\n\n wrappedCallback(null, vectors);\n return;\n }\n\n var query = prefix;\n\n return this.datasource.performSuggestQuery(query, true).then(metricNames => {\n wrappedCallback(\n null,\n metricNames.map(name => {\n let value = name;\n if (prefix === '(') {\n value = '(' + name;\n }\n\n return {\n caption: name,\n value: value,\n meta: 'metric',\n };\n })\n );\n });\n }\n\n getCompletionsForLabelMatcherName(session, pos) {\n let metricName = this.findMetricName(session, pos.row, pos.column);\n if (!metricName) {\n return Promise.resolve(this.transformToCompletions(['__name__', 'instance', 'job'], 'label name'));\n }\n\n if (this.labelNameCache[metricName]) {\n return Promise.resolve(this.labelNameCache[metricName]);\n }\n\n return this.getLabelNameAndValueForExpression(metricName, 'metricName').then(result => {\n var labelNames = this.transformToCompletions(\n _.uniq(\n _.flatten(\n result.map(r => {\n return Object.keys(r.metric);\n })\n )\n ),\n 'label name'\n );\n this.labelNameCache[metricName] = labelNames;\n return Promise.resolve(labelNames);\n });\n }\n\n getCompletionsForLabelMatcherValue(session, pos) {\n let metricName = this.findMetricName(session, pos.row, pos.column);\n if (!metricName) {\n return Promise.resolve([]);\n }\n\n var labelNameToken = this.findToken(\n session,\n pos.row,\n pos.column,\n 'entity.name.tag.label-matcher',\n null,\n 'paren.lparen.label-matcher'\n );\n if (!labelNameToken) {\n return Promise.resolve([]);\n }\n var labelName = labelNameToken.value;\n\n if (this.labelValueCache[metricName] && this.labelValueCache[metricName][labelName]) {\n return Promise.resolve(this.labelValueCache[metricName][labelName]);\n }\n\n return this.getLabelNameAndValueForExpression(metricName, 'metricName').then(result => {\n var labelValues = this.transformToCompletions(\n _.uniq(\n result.map(r => {\n return r.metric[labelName];\n })\n ),\n 'label value'\n );\n this.labelValueCache[metricName] = this.labelValueCache[metricName] || {};\n this.labelValueCache[metricName][labelName] = labelValues;\n return Promise.resolve(labelValues);\n });\n }\n\n getCompletionsForBinaryOperator(session, pos) {\n let keywordOperatorToken = this.findToken(session, pos.row, pos.column, 'keyword.control', null, 'identifier');\n if (!keywordOperatorToken) {\n return Promise.resolve([]);\n }\n let rparenToken, expr;\n switch (keywordOperatorToken.value) {\n case 'by':\n case 'without':\n rparenToken = this.findToken(\n session,\n keywordOperatorToken.row,\n keywordOperatorToken.column,\n 'paren.rparen',\n null,\n 'identifier'\n );\n if (!rparenToken) {\n return Promise.resolve([]);\n }\n expr = this.findExpressionMatchedParen(session, rparenToken.row, rparenToken.column);\n if (expr === '') {\n return Promise.resolve([]);\n }\n return this.getLabelNameAndValueForExpression(expr, 'expression').then(result => {\n var labelNames = this.transformToCompletions(\n _.uniq(\n _.flatten(\n result.map(r => {\n return Object.keys(r.metric);\n })\n )\n ),\n 'label name'\n );\n this.labelNameCache[expr] = labelNames;\n return labelNames;\n });\n case 'on':\n case 'ignoring':\n case 'group_left':\n case 'group_right':\n let binaryOperatorToken = this.findToken(\n session,\n keywordOperatorToken.row,\n keywordOperatorToken.column,\n 'keyword.operator.binary',\n null,\n 'identifier'\n );\n if (!binaryOperatorToken) {\n return Promise.resolve([]);\n }\n rparenToken = this.findToken(\n session,\n binaryOperatorToken.row,\n binaryOperatorToken.column,\n 'paren.rparen',\n null,\n 'identifier'\n );\n if (rparenToken) {\n expr = this.findExpressionMatchedParen(session, rparenToken.row, rparenToken.column);\n if (expr === '') {\n return Promise.resolve([]);\n }\n return this.getLabelNameAndValueForExpression(expr, 'expression').then(result => {\n var labelNames = this.transformToCompletions(\n _.uniq(\n _.flatten(\n result.map(r => {\n return Object.keys(r.metric);\n })\n )\n ),\n 'label name'\n );\n this.labelNameCache[expr] = labelNames;\n return labelNames;\n });\n } else {\n let metricName = this.findMetricName(session, binaryOperatorToken.row, binaryOperatorToken.column);\n return this.getLabelNameAndValueForExpression(metricName, 'metricName').then(result => {\n var labelNames = this.transformToCompletions(\n _.uniq(\n _.flatten(\n result.map(r => {\n return Object.keys(r.metric);\n })\n )\n ),\n 'label name'\n );\n this.labelNameCache[metricName] = labelNames;\n return Promise.resolve(labelNames);\n });\n }\n }\n\n return Promise.resolve([]);\n }\n\n getLabelNameAndValueForExpression(expr, type) {\n if (this.labelQueryCache[expr]) {\n return Promise.resolve(this.labelQueryCache[expr]);\n }\n let query = expr;\n if (type === 'metricName') {\n let op = '=~';\n if (/[a-zA-Z_:][a-zA-Z0-9_:]*/.test(expr)) {\n op = '=';\n }\n query = '{__name__' + op + '\"' + expr + '\"}';\n }\n return this.datasource.performInstantQuery({ expr: query }, new Date().getTime() / 1000).then(response => {\n this.labelQueryCache[expr] = response.data.data.result;\n return response.data.data.result;\n });\n }\n\n transformToCompletions(words, meta) {\n return words.map(name => {\n return {\n caption: name,\n value: name,\n meta: meta,\n score: Number.MAX_VALUE,\n };\n });\n }\n\n findMetricName(session, row, column) {\n var metricName = '';\n\n var tokens;\n var nameLabelNameToken = this.findToken(\n session,\n row,\n column,\n 'entity.name.tag.label-matcher',\n '__name__',\n 'paren.lparen.label-matcher'\n );\n if (nameLabelNameToken) {\n tokens = session.getTokens(nameLabelNameToken.row);\n var nameLabelValueToken = tokens[nameLabelNameToken.index + 2];\n if (nameLabelValueToken && nameLabelValueToken.type === 'string.quoted.label-matcher') {\n metricName = nameLabelValueToken.value.slice(1, -1); // cut begin/end quotation\n }\n } else {\n var metricNameToken = this.findToken(session, row, column, 'identifier', null, null);\n if (metricNameToken) {\n tokens = session.getTokens(metricNameToken.row);\n metricName = metricNameToken.value;\n }\n }\n\n return metricName;\n }\n\n findToken(session, row, column, target, value, guard) {\n var tokens, idx;\n // find index and get column of previous token\n for (var r = row; r >= 0; r--) {\n let c;\n tokens = session.getTokens(r);\n if (r === row) {\n // current row\n c = 0;\n for (idx = 0; idx < tokens.length; idx++) {\n let nc = c + tokens[idx].value.length;\n if (nc >= column) {\n break;\n }\n c = nc;\n }\n } else {\n idx = tokens.length - 1;\n c =\n _.sum(\n tokens.map(t => {\n return t.value.length;\n })\n ) - tokens[tokens.length - 1].value.length;\n }\n\n for (; idx >= 0; idx--) {\n if (tokens[idx].type === guard) {\n return null;\n }\n\n if (tokens[idx].type === target && (!value || tokens[idx].value === value)) {\n tokens[idx].row = r;\n tokens[idx].column = c;\n tokens[idx].index = idx;\n return tokens[idx];\n }\n c -= tokens[idx].value.length;\n }\n }\n\n return null;\n }\n\n findExpressionMatchedParen(session, row, column) {\n let tokens, idx;\n let deep = 1;\n let expression = ')';\n for (let r = row; r >= 0; r--) {\n tokens = session.getTokens(r);\n if (r === row) {\n // current row\n let c = 0;\n for (idx = 0; idx < tokens.length; idx++) {\n c += tokens[idx].value.length;\n if (c >= column) {\n break;\n }\n }\n } else {\n idx = tokens.length - 1;\n }\n\n for (; idx >= 0; idx--) {\n expression = tokens[idx].value + expression;\n if (tokens[idx].type === 'paren.rparen') {\n deep++;\n } else if (tokens[idx].type === 'paren.lparen') {\n deep--;\n if (deep === 0) {\n return expression;\n }\n }\n }\n }\n\n return expression;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/prometheus/completer.ts","// jshint ignore: start\n// jscs: disable\nace.define(\"ace/mode/prometheus_highlight_rules\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text_highlight_rules\"], function(require, exports, module) {\n\"use strict\";\n\nvar oop = require(\"../lib/oop\");\nvar TextHighlightRules = require(\"./text_highlight_rules\").TextHighlightRules;\n\nvar PrometheusHighlightRules = function() {\n var keywords = (\n \"count|count_values|min|max|avg|sum|stddev|stdvar|bottomk|topk|quantile\"\n );\n\n var builtinConstants = (\n \"true|false|null|__name__|job\"\n );\n\n var builtinFunctions = (\n \"abs|absent|ceil|changes|clamp_max|clamp_min|count_scalar|day_of_month|day_of_week|days_in_month|delta|deriv|\" + \"drop_common_labels|exp|floor|histogram_quantile|holt_winters|hour|idelta|increase|irate|label_replace|ln|log2|\" +\n \"log10|minute|month|predict_linear|rate|resets|round|scalar|sort|sort_desc|sqrt|time|vector|year|avg_over_time|\" +\n \"min_over_time|max_over_time|sum_over_time|count_over_time|quantile_over_time|stddev_over_time|stdvar_over_time\"\n );\n\n var keywordMapper = this.createKeywordMapper({\n \"support.function\": builtinFunctions,\n \"keyword\": keywords,\n \"constant.language\": builtinConstants\n }, \"identifier\", true);\n\n this.$rules = {\n \"start\" : [ {\n token : \"string\", // single line\n regex : /\"(?:[^\"\\\\]|\\\\.)*?\"/\n }, {\n token : \"string\", // string\n regex : \"'.*?'\"\n }, {\n token : \"constant.numeric\", // float\n regex : \"[-]?\\\\d+(?:(?:\\\\.\\\\d*)?(?:[eE][+-]?\\\\d+)?)?\\\\b\"\n }, {\n token : \"constant.language\", // time\n regex : \"\\\\d+[smhdwy]\"\n }, {\n token : \"keyword.operator.binary\",\n regex : \"\\\\+|\\\\-|\\\\*|\\\\/|%|\\\\^|==|!=|<=|>=|<|>|and|or|unless\"\n }, {\n token : \"keyword.other\",\n regex : \"keep_common|offset|bool\"\n }, {\n token : \"keyword.control\",\n regex : \"by|without|on|ignoring|group_left|group_right\",\n next : \"start-label-list-matcher\"\n }, {\n token : \"variable\",\n regex : \"\\\\$[A-Za-z0-9_]+\"\n }, {\n token : keywordMapper,\n regex : \"[a-zA-Z_:][a-zA-Z0-9_:]*\"\n }, {\n token : \"paren.lparen\",\n regex : \"[[(]\"\n }, {\n token : \"paren.lparen.label-matcher\",\n regex : \"{\",\n next : \"start-label-matcher\"\n }, {\n token : \"paren.rparen\",\n regex : \"[\\\\])]\"\n }, {\n token : \"paren.rparen.label-matcher\",\n regex : \"}\"\n }, {\n token : \"text\",\n regex : \"\\\\s+\"\n } ],\n \"start-label-matcher\" : [ {\n token : \"entity.name.tag.label-matcher\",\n regex : '[a-zA-Z_][a-zA-Z0-9_]*'\n }, {\n token : \"keyword.operator.label-matcher\",\n regex : '=~|=|!~|!='\n }, {\n token : \"string.quoted.label-matcher\",\n regex : '\"[^\"]*\"|\\'[^\\']*\\''\n }, {\n token : \"punctuation.operator.label-matcher\",\n regex : \",\"\n }, {\n token : \"paren.rparen.label-matcher\",\n regex : \"}\",\n next : \"start\"\n } ],\n \"start-label-list-matcher\" : [ {\n token : \"paren.lparen.label-list-matcher\",\n regex : \"[(]\"\n }, {\n token : \"entity.name.tag.label-list-matcher\",\n regex : '[a-zA-Z_][a-zA-Z0-9_]*'\n }, {\n token : \"punctuation.operator.label-list-matcher\",\n regex : \",\"\n }, {\n token : \"paren.rparen.label-list-matcher\",\n regex : \"[)]\",\n next : \"start\"\n } ]\n };\n\n this.normalizeRules();\n};\n\noop.inherits(PrometheusHighlightRules, TextHighlightRules);\n\nexports.PrometheusHighlightRules = PrometheusHighlightRules;\n});\n\nace.define(\"ace/mode/prometheus_completions\",[\"require\",\"exports\",\"module\",\"ace/token_iterator\", \"ace/lib/lang\"], function(require, exports, module) {\n\"use strict\";\n\nvar lang = require(\"../lib/lang\");\n\nvar prometheusKeyWords = [\n \"by\", \"without\", \"keep_common\", \"offset\", \"bool\", \"and\", \"or\", \"unless\", \"ignoring\", \"on\", \"group_left\",\n \"group_right\", \"count\", \"count_values\", \"min\", \"max\", \"avg\", \"sum\", \"stddev\", \"stdvar\", \"bottomk\", \"topk\", \"quantile\"\n];\n\nvar keyWordsCompletions = prometheusKeyWords.map(function(word) {\n return {\n caption: word,\n value: word,\n meta: \"keyword\",\n score: Number.MAX_VALUE\n }\n});\n\nvar prometheusFunctions = [\n {\n name: 'abs()', value: 'abs',\n def: 'abs(v instant-vector)',\n docText: 'Returns the input vector with all sample values converted to their absolute value.'\n },\n {\n name: 'absent()', value: 'absent',\n def: 'absent(v instant-vector)',\n docText: 'Returns an empty vector if the vector passed to it has any elements and a 1-element vector with the value 1 if the vector passed to it has no elements. This is useful for alerting on when no time series exist for a given metric name and label combination.'\n },\n {\n name: 'ceil()', value: 'ceil',\n def: 'ceil(v instant-vector)',\n docText: 'Rounds the sample values of all elements in `v` up to the nearest integer.'\n },\n {\n name: 'changes()', value: 'changes',\n def: 'changes(v range-vector)',\n docText: 'For each input time series, `changes(v range-vector)` returns the number of times its value has changed within the provided time range as an instant vector.'\n },\n {\n name: 'clamp_max()', value: 'clamp_max',\n def: 'clamp_max(v instant-vector, max scalar)',\n docText: 'Clamps the sample values of all elements in `v` to have an upper limit of `max`.'\n },\n {\n name: 'clamp_min()', value: 'clamp_min',\n def: 'clamp_min(v instant-vector, min scalar)',\n docText: 'Clamps the sample values of all elements in `v` to have a lower limit of `min`.'\n },\n {\n name: 'count_scalar()', value: 'count_scalar',\n def: 'count_scalar(v instant-vector)',\n docText: 'Returns the number of elements in a time series vector as a scalar. This is in contrast to the `count()` aggregation operator, which always returns a vector (an empty one if the input vector is empty) and allows grouping by labels via a `by` clause.'\n },\n {\n name: 'day_of_month()', value: 'day_of_month',\n def: 'day_of_month(v=vector(time()) instant-vector)',\n docText: 'Returns the day of the month for each of the given times in UTC. Returned values are from 1 to 31.'\n },\n {\n name: 'day_of_week()', value: 'day_of_week',\n def: 'day_of_week(v=vector(time()) instant-vector)',\n docText: 'Returns the day of the week for each of the given times in UTC. Returned values are from 0 to 6, where 0 means Sunday etc.'\n },\n {\n name: 'days_in_month()', value: 'days_in_month',\n def: 'days_in_month(v=vector(time()) instant-vector)',\n docText: 'Returns number of days in the month for each of the given times in UTC. Returned values are from 28 to 31.'\n },\n {\n name: 'delta()', value: 'delta',\n def: 'delta(v range-vector)',\n docText: 'Calculates the difference between the first and last value of each time series element in a range vector `v`, returning an instant vector with the given deltas and equivalent labels. The delta is extrapolated to cover the full time range as specified in the range vector selector, so that it is possible to get a non-integer result even if the sample values are all integers.'\n },\n {\n name: 'deriv()', value: 'deriv',\n def: 'deriv(v range-vector)',\n docText: 'Calculates the per-second derivative of the time series in a range vector `v`, using simple linear regression.'\n },\n {\n name: 'drop_common_labels()', value: 'drop_common_labels',\n def: 'drop_common_labels(instant-vector)',\n docText: 'Drops all labels that have the same name and value across all series in the input vector.'\n },\n {\n name: 'exp()', value: 'exp',\n def: 'exp(v instant-vector)',\n docText: 'Calculates the exponential function for all elements in `v`.\\nSpecial cases are:\\n* `Exp(+Inf) = +Inf` \\n* `Exp(NaN) = NaN`'\n },\n {\n name: 'floor()', value: 'floor',\n def: 'floor(v instant-vector)',\n docText: 'Rounds the sample values of all elements in `v` down to the nearest integer.'\n },\n {\n name: 'histogram_quantile()', value: 'histogram_quantile',\n def: 'histogram_quantile(φ float, b instant-vector)',\n docText: 'Calculates the φ-quantile (0 ≤ φ ≤ 1) from the buckets `b` of a histogram. The samples in `b` are the counts of observations in each bucket. Each sample must have a label `le` where the label value denotes the inclusive upper bound of the bucket. (Samples without such a label are silently ignored.) The histogram metric type automatically provides time series with the `_bucket` suffix and the appropriate labels.'\n },\n {\n name: 'holt_winters()', value: 'holt_winters',\n def: 'holt_winters(v range-vector, sf scalar, tf scalar)',\n docText: 'Produces a smoothed value for time series based on the range in `v`. The lower the smoothing factor `sf`, the more importance is given to old data. The higher the trend factor `tf`, the more trends in the data is considered. Both `sf` and `tf` must be between 0 and 1.'\n },\n {\n name: 'hour()', value: 'hour',\n def: 'hour(v=vector(time()) instant-vector)',\n docText: 'Returns the hour of the day for each of the given times in UTC. Returned values are from 0 to 23.'\n },\n {\n name: 'idelta()', value: 'idelta',\n def: 'idelta(v range-vector)',\n docText: 'Calculates the difference between the last two samples in the range vector `v`, returning an instant vector with the given deltas and equivalent labels.'\n },\n {\n name: 'increase()', value: 'increase',\n def: 'increase(v range-vector)',\n docText: 'Calculates the increase in the time series in the range vector. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for. The increase is extrapolated to cover the full time range as specified in the range vector selector, so that it is possible to get a non-integer result even if a counter increases only by integer increments.'\n },\n {\n name: 'irate()', value: 'irate',\n def: 'irate(v range-vector)',\n docText: 'Calculates the per-second instant rate of increase of the time series in the range vector. This is based on the last two data points. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for.'\n },\n {\n name: 'label_replace()', value: 'label_replace',\n def: 'label_replace(v instant-vector, dst_label string, replacement string, src_label string, regex string)',\n docText: 'For each timeseries in `v`, `label_replace(v instant-vector, dst_label string, replacement string, src_label string, regex string)` matches the regular expression `regex` against the label `src_label`. If it matches, then the timeseries is returned with the label `dst_label` replaced by the expansion of `replacement`. `$1` is replaced with the first matching subgroup, `$2` with the second etc. If the regular expression doesn\\'t match then the timeseries is returned unchanged.'\n },\n {\n name: 'ln()', value: 'ln',\n def: 'ln(v instant-vector)',\n docText: 'calculates the natural logarithm for all elements in `v`.\\nSpecial cases are:\\n * `ln(+Inf) = +Inf`\\n * `ln(0) = -Inf`\\n * `ln(x < 0) = NaN`\\n * `ln(NaN) = NaN`'\n },\n {\n name: 'log2()', value: 'log2',\n def: 'log2(v instant-vector)',\n docText: 'Calculates the binary logarithm for all elements in `v`. The special cases are equivalent to those in `ln`.'\n },\n {\n name: 'log10()', value: 'log10',\n def: 'log10(v instant-vector)',\n docText: 'Calculates the decimal logarithm for all elements in `v`. The special cases are equivalent to those in `ln`.'\n },\n {\n name: 'minute()', value: 'minute',\n def: 'minute(v=vector(time()) instant-vector)',\n docText: 'Returns the minute of the hour for each of the given times in UTC. Returned values are from 0 to 59.'\n },\n {\n name: 'month()', value: 'month',\n def: 'month(v=vector(time()) instant-vector)',\n docText: 'Returns the month of the year for each of the given times in UTC. Returned values are from 1 to 12, where 1 means January etc.'\n },\n {\n name: 'predict_linear()', value: 'predict_linear',\n def: 'predict_linear(v range-vector, t scalar)',\n docText: 'Predicts the value of time series `t` seconds from now, based on the range vector `v`, using simple linear regression.'\n },\n {\n name: 'rate()', value: 'rate',\n def: 'rate(v range-vector)',\n docText: \"Calculates the per-second average rate of increase of the time series in the range vector. Breaks in monotonicity (such as counter resets due to target restarts) are automatically adjusted for. Also, the calculation extrapolates to the ends of the time range, allowing for missed scrapes or imperfect alignment of scrape cycles with the range's time period.\"\n },\n {\n name: 'resets()', value: 'resets',\n def: 'resets(v range-vector)',\n docText: 'For each input time series, `resets(v range-vector)` returns the number of counter resets within the provided time range as an instant vector. Any decrease in the value between two consecutive samples is interpreted as a counter reset.'\n },\n {\n name: 'round()', value: 'round',\n def: 'round(v instant-vector, to_nearest=1 scalar)',\n docText: 'Rounds the sample values of all elements in `v` to the nearest integer. Ties are resolved by rounding up. The optional `to_nearest` argument allows specifying the nearest multiple to which the sample values should be rounded. This multiple may also be a fraction.'\n },\n {\n name: 'scalar()', value: 'scalar',\n def: 'scalar(v instant-vector)',\n docText: 'Given a single-element input vector, `scalar(v instant-vector)` returns the sample value of that single element as a scalar. If the input vector does not have exactly one element, `scalar` will return `NaN`.'\n },\n {\n name: 'sort()', value: 'sort',\n def: 'sort(v instant-vector)',\n docText: 'Returns vector elements sorted by their sample values, in ascending order.'\n },\n {\n name: 'sort_desc()', value: 'sort_desc',\n def: 'sort_desc(v instant-vector)',\n docText: 'Returns vector elements sorted by their sample values, in descending order.'\n },\n {\n name: 'sqrt()', value: 'sqrt',\n def: 'sqrt(v instant-vector)',\n docText: 'Calculates the square root of all elements in `v`.'\n },\n {\n name: 'time()', value: 'time',\n def: 'time()',\n docText: 'Returns the number of seconds since January 1, 1970 UTC. Note that this does not actually return the current time, but the time at which the expression is to be evaluated.'\n },\n {\n name: 'vector()', value: 'vector',\n def: 'vector(s scalar)',\n docText: 'Returns the scalar `s` as a vector with no labels.'\n },\n {\n name: 'year()', value: 'year',\n def: 'year(v=vector(time()) instant-vector)',\n docText: 'Returns the year for each of the given times in UTC.'\n },\n {\n name: 'avg_over_time()', value: 'avg_over_time',\n def: 'avg_over_time(range-vector)',\n docText: 'The average value of all points in the specified interval.'\n },\n {\n name: 'min_over_time()', value: 'min_over_time',\n def: 'min_over_time(range-vector)',\n docText: 'The minimum value of all points in the specified interval.'\n },\n {\n name: 'max_over_time()', value: 'max_over_time',\n def: 'max_over_time(range-vector)',\n docText: 'The maximum value of all points in the specified interval.'\n },\n {\n name: 'sum_over_time()', value: 'sum_over_time',\n def: 'sum_over_time(range-vector)',\n docText: 'The sum of all values in the specified interval.'\n },\n {\n name: 'count_over_time()', value: 'count_over_time',\n def: 'count_over_time(range-vector)',\n docText: 'The count of all values in the specified interval.'\n },\n {\n name: 'quantile_over_time()', value: 'quantile_over_time',\n def: 'quantile_over_time(scalar, range-vector)',\n docText: 'The φ-quantile (0 ≤ φ ≤ 1) of the values in the specified interval.'\n },\n {\n name: 'stddev_over_time()', value: 'stddev_over_time',\n def: 'stddev_over_time(range-vector)',\n docText: 'The population standard deviation of the values in the specified interval.'\n },\n {\n name: 'stdvar_over_time()', value: 'stdvar_over_time',\n def: 'stdvar_over_time(range-vector)',\n docText: 'The population standard variance of the values in the specified interval.'\n },\n];\n\nfunction wrapText(str, len) {\n len = len || 60;\n var lines = [];\n var space_index = 0;\n var line_start = 0;\n var next_line_end = len;\n var line = \"\";\n for (var i = 0; i < str.length; i++) {\n if (str[i] === ' ') {\n space_index = i;\n } else if (i >= next_line_end && space_index != 0) {\n line = str.slice(line_start, space_index);\n lines.push(line);\n line_start = space_index + 1;\n next_line_end = i + len;\n space_index = 0;\n }\n }\n line = str.slice(line_start);\n lines.push(line);\n return lines.join(\" 
    \");\n}\n\nfunction convertMarkDownTags(text) {\n text = text.replace(/```(.+)```/, \"
    $1
    \");\n text = text.replace(/`([^`]+)`/, \"$1\");\n return text;\n}\n\nfunction convertToHTML(item) {\n var docText = lang.escapeHTML(item.docText);\n docText = convertMarkDownTags(wrapText(docText, 40));\n return [\n \"\", lang.escapeHTML(item.def), \"\", \"
    \", docText, \"
     \"\n ].join(\"\");\n}\n\nvar functionsCompletions = prometheusFunctions.map(function(item) {\n return {\n caption: item.name,\n value: item.value,\n docHTML: convertToHTML(item),\n meta: \"function\",\n score: Number.MAX_VALUE\n };\n});\n\nvar PrometheusCompletions = function() {};\n\n(function() {\n this.getCompletions = function(state, session, pos, prefix, callback) {\n var token = session.getTokenAt(pos.row, pos.column);\n if (token.type === 'entity.name.tag.label-matcher'\n || token.type === 'string.quoted.label-matcher'\n || token.type === 'entity.name.tag.label-list-matcher') {\n return callback(null, []);\n }\n\n var completions = keyWordsCompletions.concat(functionsCompletions);\n callback(null, completions);\n };\n\n}).call(PrometheusCompletions.prototype);\n\nexports.PrometheusCompletions = PrometheusCompletions;\n});\n\nace.define(\"ace/mode/behaviour/prometheus\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/behaviour\",\"ace/mode/behaviour/cstyle\",\"ace/token_iterator\"], function(require, exports, module) {\n\"use strict\";\n\nvar oop = require(\"../../lib/oop\");\nvar Behaviour = require(\"../behaviour\").Behaviour;\nvar CstyleBehaviour = require(\"./cstyle\").CstyleBehaviour;\nvar TokenIterator = require(\"../../token_iterator\").TokenIterator;\n\nfunction getWrapped(selection, selected, opening, closing) {\n var rowDiff = selection.end.row - selection.start.row;\n return {\n text: opening + selected + closing,\n selection: [\n 0,\n selection.start.column + 1,\n rowDiff,\n selection.end.column + (rowDiff ? 0 : 1)\n ]\n };\n};\n\nvar PrometheusBehaviour = function () {\n this.inherit(CstyleBehaviour);\n\n // Rewrite default CstyleBehaviour for {} braces\n this.add(\"braces\", \"insertion\", function(state, action, editor, session, text) {\n if (text == '{') {\n var selection = editor.getSelectionRange();\n var selected = session.doc.getTextRange(selection);\n if (selected !== \"\" && editor.getWrapBehavioursEnabled()) {\n return getWrapped(selection, selected, '{', '}');\n } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {\n return {\n text: '{}',\n selection: [1, 1]\n };\n }\n } else if (text == '}') {\n var cursor = editor.getCursorPosition();\n var line = session.doc.getLine(cursor.row);\n var rightChar = line.substring(cursor.column, cursor.column + 1);\n if (rightChar == '}') {\n var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});\n if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {\n return {\n text: '',\n selection: [1, 1]\n };\n }\n }\n }\n });\n\n this.add(\"braces\", \"deletion\", function(state, action, editor, session, range) {\n var selected = session.doc.getTextRange(range);\n if (!range.isMultiLine() && selected == '{') {\n var line = session.doc.getLine(range.start.row);\n var rightChar = line.substring(range.start.column + 1, range.start.column + 2);\n if (rightChar == '}') {\n range.end.column++;\n return range;\n }\n }\n });\n\n}\noop.inherits(PrometheusBehaviour, CstyleBehaviour);\n\nexports.PrometheusBehaviour = PrometheusBehaviour;\n});\n\nace.define(\"ace/mode/prometheus\",[\"require\",\"exports\",\"module\",\"ace/lib/oop\",\"ace/mode/text\",\"ace/mode/prometheus_highlight_rules\"], function(require, exports, module) {\n\"use strict\";\n\nvar oop = require(\"../lib/oop\");\nvar TextMode = require(\"./text\").Mode;\nvar PrometheusHighlightRules = require(\"./prometheus_highlight_rules\").PrometheusHighlightRules;\nvar PrometheusCompletions = require(\"./prometheus_completions\").PrometheusCompletions;\nvar PrometheusBehaviour = require(\"./behaviour/prometheus\").PrometheusBehaviour;\n\nvar Mode = function() {\n this.HighlightRules = PrometheusHighlightRules;\n this.$behaviour = new PrometheusBehaviour();\n this.$completer = new PrometheusCompletions();\n // replace keyWordCompleter\n this.completer = this.$completer;\n};\noop.inherits(Mode, TextMode);\n\n(function() {\n\n this.$id = \"ace/mode/prometheus\";\n}).call(Mode.prototype);\n\nexports.Mode = Mode;\n\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./public/app/plugins/datasource/prometheus/mode-prometheus.js\n// module id = 2128\n// module chunks = 0","// jshint ignore: start\n// jscs: disable\nace.define(\"ace/snippets/prometheus\",[\"require\",\"exports\",\"module\"], function(require, exports, module) {\n\"use strict\";\n\n// exports.snippetText = \"# rate\\n\\\n// snippet r\\n\\\n// rate(${1:metric}[${2:range}])\\n\\\n// \";\n\nexports.snippets = [\n {\n \"content\": \"rate(${1:metric}[${2:range}])\",\n \"name\": \"rate()\",\n \"scope\": \"prometheus\",\n \"tabTrigger\": \"r\"\n }\n];\n\nexports.scope = \"prometheus\";\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./public/app/plugins/datasource/prometheus/snippets/prometheus.js\n// module id = 2129\n// module chunks = 0","export class PrometheusConfigCtrl {\n static templateUrl = 'public/app/plugins/datasource/prometheus/partials/config.html';\n current: any;\n\n /** @ngInject */\n constructor($scope) {\n this.current.jsonData.httpMethod = this.current.jsonData.httpMethod || 'GET';\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/prometheus/config_ctrl.ts","import { MssqlDatasource } from './datasource';\nimport { MssqlQueryCtrl } from './query_ctrl';\n\nclass MssqlConfigCtrl {\n static templateUrl = 'partials/config.html';\n}\n\nconst defaultQuery = `SELECT\n as time,\n as text,\n as tags\n FROM\n
    \n WHERE\n $__timeFilter(time_column)\n ORDER BY\n ASC`;\n\nclass MssqlAnnotationsQueryCtrl {\n static templateUrl = 'partials/annotations.editor.html';\n\n annotation: any;\n\n /** @ngInject **/\n constructor() {\n this.annotation.rawQuery = this.annotation.rawQuery || defaultQuery;\n }\n}\n\nexport {\n MssqlDatasource,\n MssqlDatasource as Datasource,\n MssqlQueryCtrl as QueryCtrl,\n MssqlConfigCtrl as ConfigCtrl,\n MssqlAnnotationsQueryCtrl as AnnotationsQueryCtrl,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/mssql/module.ts","import _ from 'lodash';\nimport ResponseParser from './response_parser';\n\nexport class MssqlDatasource {\n id: any;\n name: any;\n responseParser: ResponseParser;\n\n /** @ngInject **/\n constructor(instanceSettings, private backendSrv, private $q, private templateSrv) {\n this.name = instanceSettings.name;\n this.id = instanceSettings.id;\n this.responseParser = new ResponseParser(this.$q);\n }\n\n interpolateVariable(value, variable) {\n if (typeof value === 'string') {\n if (variable.multi || variable.includeAll) {\n return \"'\" + value + \"'\";\n } else {\n return value;\n }\n }\n\n if (typeof value === 'number') {\n return value;\n }\n\n var quotedValues = _.map(value, function(val) {\n if (typeof value === 'number') {\n return value;\n }\n\n return \"'\" + val + \"'\";\n });\n return quotedValues.join(',');\n }\n\n query(options) {\n var queries = _.filter(options.targets, item => {\n return item.hide !== true;\n }).map(item => {\n return {\n refId: item.refId,\n intervalMs: options.intervalMs,\n maxDataPoints: options.maxDataPoints,\n datasourceId: this.id,\n rawSql: this.templateSrv.replace(item.rawSql, options.scopedVars, this.interpolateVariable),\n format: item.format,\n };\n });\n\n if (queries.length === 0) {\n return this.$q.when({ data: [] });\n }\n\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: {\n from: options.range.from.valueOf().toString(),\n to: options.range.to.valueOf().toString(),\n queries: queries,\n },\n })\n .then(this.responseParser.processQueryResult);\n }\n\n annotationQuery(options) {\n if (!options.annotation.rawQuery) {\n return this.$q.reject({ message: 'Query missing in annotation definition' });\n }\n\n const query = {\n refId: options.annotation.name,\n datasourceId: this.id,\n rawSql: this.templateSrv.replace(options.annotation.rawQuery, options.scopedVars, this.interpolateVariable),\n format: 'table',\n };\n\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: {\n from: options.range.from.valueOf().toString(),\n to: options.range.to.valueOf().toString(),\n queries: [query],\n },\n })\n .then(data => this.responseParser.transformAnnotationResponse(options, data));\n }\n\n metricFindQuery(query, optionalOptions) {\n let refId = 'tempvar';\n if (optionalOptions && optionalOptions.variable && optionalOptions.variable.name) {\n refId = optionalOptions.variable.name;\n }\n\n const interpolatedQuery = {\n refId: refId,\n datasourceId: this.id,\n rawSql: this.templateSrv.replace(query, {}, this.interpolateVariable),\n format: 'table',\n };\n\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: {\n queries: [interpolatedQuery],\n },\n })\n .then(data => this.responseParser.parseMetricFindQueryResult(refId, data));\n }\n\n testDatasource() {\n return this.backendSrv\n .datasourceRequest({\n url: '/api/tsdb/query',\n method: 'POST',\n data: {\n from: '5m',\n to: 'now',\n queries: [\n {\n refId: 'A',\n intervalMs: 1,\n maxDataPoints: 1,\n datasourceId: this.id,\n rawSql: 'SELECT 1',\n format: 'table',\n },\n ],\n },\n })\n .then(res => {\n return { status: 'success', message: 'Database Connection OK' };\n })\n .catch(err => {\n console.log(err);\n if (err.data && err.data.message) {\n return { status: 'error', message: err.data.message };\n } else {\n return { status: 'error', message: err.status };\n }\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/mssql/datasource.ts","import _ from 'lodash';\n\nexport default class ResponseParser {\n constructor(private $q) {}\n\n processQueryResult(res) {\n var data = [];\n\n if (!res.data.results) {\n return { data: data };\n }\n\n for (let key in res.data.results) {\n let queryRes = res.data.results[key];\n\n if (queryRes.series) {\n for (let series of queryRes.series) {\n data.push({\n target: series.name,\n datapoints: series.points,\n refId: queryRes.refId,\n meta: queryRes.meta,\n });\n }\n }\n\n if (queryRes.tables) {\n for (let table of queryRes.tables) {\n table.type = 'table';\n table.refId = queryRes.refId;\n table.meta = queryRes.meta;\n data.push(table);\n }\n }\n }\n\n return { data: data };\n }\n\n parseMetricFindQueryResult(refId, results) {\n if (!results || results.data.length === 0 || results.data.results[refId].meta.rowCount === 0) {\n return [];\n }\n\n const columns = results.data.results[refId].tables[0].columns;\n const rows = results.data.results[refId].tables[0].rows;\n const textColIndex = this.findColIndex(columns, '__text');\n const valueColIndex = this.findColIndex(columns, '__value');\n\n if (columns.length === 2 && textColIndex !== -1 && valueColIndex !== -1) {\n return this.transformToKeyValueList(rows, textColIndex, valueColIndex);\n }\n\n return this.transformToSimpleList(rows);\n }\n\n transformToKeyValueList(rows, textColIndex, valueColIndex) {\n const res = [];\n\n for (let i = 0; i < rows.length; i++) {\n if (!this.containsKey(res, rows[i][textColIndex])) {\n res.push({ text: rows[i][textColIndex], value: rows[i][valueColIndex] });\n }\n }\n\n return res;\n }\n\n transformToSimpleList(rows) {\n const res = [];\n\n for (let i = 0; i < rows.length; i++) {\n for (let j = 0; j < rows[i].length; j++) {\n const value = rows[i][j];\n if (res.indexOf(value) === -1) {\n res.push(value);\n }\n }\n }\n\n return _.map(res, value => {\n return { text: value };\n });\n }\n\n findColIndex(columns, colName) {\n for (let i = 0; i < columns.length; i++) {\n if (columns[i].text === colName) {\n return i;\n }\n }\n\n return -1;\n }\n\n containsKey(res, key) {\n for (let i = 0; i < res.length; i++) {\n if (res[i].text === key) {\n return true;\n }\n }\n return false;\n }\n\n transformAnnotationResponse(options, data) {\n const table = data.data.results[options.annotation.name].tables[0];\n\n let timeColumnIndex = -1;\n let textColumnIndex = -1;\n let tagsColumnIndex = -1;\n\n for (let i = 0; i < table.columns.length; i++) {\n if (table.columns[i].text === 'time') {\n timeColumnIndex = i;\n } else if (table.columns[i].text === 'text') {\n textColumnIndex = i;\n } else if (table.columns[i].text === 'tags') {\n tagsColumnIndex = i;\n }\n }\n\n if (timeColumnIndex === -1) {\n return this.$q.reject({ message: 'Missing mandatory time column (with time column alias) in annotation query.' });\n }\n\n const list = [];\n for (let i = 0; i < table.rows.length; i++) {\n const row = table.rows[i];\n list.push({\n annotation: options.annotation,\n time: Math.floor(row[timeColumnIndex]),\n text: row[textColumnIndex],\n tags: row[tagsColumnIndex] ? row[tagsColumnIndex].trim().split(/\\s*,\\s*/) : [],\n });\n }\n\n return list;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/mssql/response_parser.ts","import _ from 'lodash';\nimport { QueryCtrl } from 'app/plugins/sdk';\n\nexport interface MssqlQuery {\n refId: string;\n format: string;\n alias: string;\n rawSql: string;\n}\n\nexport interface QueryMeta {\n sql: string;\n}\n\nconst defaultQuery = `SELECT\n $__timeEpoch(),\n as value,\n as metric\nFROM\n
    \nWHERE\n $__timeFilter(time_column)\nORDER BY\n ASC`;\n\nexport class MssqlQueryCtrl extends QueryCtrl {\n static templateUrl = 'partials/query.editor.html';\n\n showLastQuerySQL: boolean;\n formats: any[];\n target: MssqlQuery;\n lastQueryMeta: QueryMeta;\n lastQueryError: string;\n showHelp: boolean;\n\n /** @ngInject **/\n constructor($scope, $injector) {\n super($scope, $injector);\n\n this.target.format = this.target.format || 'time_series';\n this.target.alias = '';\n this.formats = [{ text: 'Time series', value: 'time_series' }, { text: 'Table', value: 'table' }];\n\n if (!this.target.rawSql) {\n // special handling when in table panel\n if (this.panelCtrl.panel.type === 'table') {\n this.target.format = 'table';\n this.target.rawSql = 'SELECT 1';\n } else {\n this.target.rawSql = defaultQuery;\n }\n }\n\n this.panelCtrl.events.on('data-received', this.onDataReceived.bind(this), $scope);\n this.panelCtrl.events.on('data-error', this.onDataError.bind(this), $scope);\n }\n\n onDataReceived(dataList) {\n this.lastQueryMeta = null;\n this.lastQueryError = null;\n\n let anySeriesFromQuery = _.find(dataList, { refId: this.target.refId });\n if (anySeriesFromQuery) {\n this.lastQueryMeta = anySeriesFromQuery.meta;\n }\n }\n\n onDataError(err) {\n if (err.data && err.data.results) {\n let queryRes = err.data.results[this.target.refId];\n if (queryRes) {\n this.lastQueryMeta = queryRes.meta;\n this.lastQueryError = queryRes.error;\n }\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/datasource/mssql/query_ctrl.ts","import _ from 'lodash';\nimport { PanelCtrl } from 'app/plugins/sdk';\nimport Remarkable from 'remarkable';\n\nexport class TextPanelCtrl extends PanelCtrl {\n static templateUrl = `public/app/plugins/panel/text/module.html`;\n static scrollable = true;\n\n remarkable: any;\n content: string;\n // Set and populate defaults\n panelDefaults = {\n mode: 'markdown', // 'html', 'markdown', 'text'\n content: '# title',\n };\n\n /** @ngInject **/\n constructor($scope, $injector, private templateSrv, private $sce) {\n super($scope, $injector);\n\n _.defaults(this.panel, this.panelDefaults);\n\n this.events.on('init-edit-mode', this.onInitEditMode.bind(this));\n this.events.on('refresh', this.onRefresh.bind(this));\n this.events.on('render', this.onRender.bind(this));\n\n $scope.$watch(\n 'ctrl.panel.content',\n _.throttle(() => {\n this.render();\n }, 1000)\n );\n }\n\n onInitEditMode() {\n this.addEditorTab('Options', 'public/app/plugins/panel/text/editor.html');\n this.editorTabIndex = 1;\n\n if (this.panel.mode === 'text') {\n this.panel.mode = 'markdown';\n }\n }\n\n onRefresh() {\n this.render();\n }\n\n onRender() {\n if (this.panel.mode === 'markdown') {\n this.renderMarkdown(this.panel.content);\n } else if (this.panel.mode === 'html') {\n this.updateContent(this.panel.content);\n }\n this.renderingCompleted();\n }\n\n renderText(content) {\n content = content\n .replace(/&/g, '&')\n .replace(/>/g, '>')\n .replace(/');\n this.updateContent(content);\n }\n\n renderMarkdown(content) {\n if (!this.remarkable) {\n this.remarkable = new Remarkable();\n }\n\n this.$scope.$applyAsync(() => {\n this.updateContent(this.remarkable.render(content));\n });\n }\n\n updateContent(html) {\n try {\n this.content = this.$sce.trustAsHtml(this.templateSrv.replace(html, this.panel.scopedVars));\n } catch (e) {\n console.log('Text panel error: ', e);\n this.content = this.$sce.trustAsHtml(html);\n }\n }\n}\n\nexport { TextPanelCtrl as PanelCtrl };\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/text/module.ts","import 'vendor/flot/jquery.flot';\nimport 'vendor/flot/jquery.flot.selection';\nimport 'vendor/flot/jquery.flot.time';\nimport 'vendor/flot/jquery.flot.stack';\nimport 'vendor/flot/jquery.flot.stackpercent';\nimport 'vendor/flot/jquery.flot.fillbelow';\nimport 'vendor/flot/jquery.flot.crosshair';\nimport 'vendor/flot/jquery.flot.dashes';\nimport './jquery.flot.events';\n\nimport $ from 'jquery';\nimport _ from 'lodash';\nimport moment from 'moment';\nimport kbn from 'app/core/utils/kbn';\nimport { tickStep } from 'app/core/utils/ticks';\nimport { appEvents, coreModule, updateLegendValues } from 'app/core/core';\nimport GraphTooltip from './graph_tooltip';\nimport { ThresholdManager } from './threshold_manager';\nimport { EventManager } from 'app/features/annotations/all';\nimport { convertToHistogramData } from './histogram';\nimport { alignYLevel } from './align_yaxes';\nimport config from 'app/core/config';\n\n/** @ngInject **/\nfunction graphDirective(timeSrv, popoverSrv, contextSrv) {\n return {\n restrict: 'A',\n template: '',\n link: function(scope, elem) {\n var ctrl = scope.ctrl;\n var dashboard = ctrl.dashboard;\n var panel = ctrl.panel;\n var annotations = [];\n var data;\n var plot;\n var sortedSeries;\n var panelWidth = 0;\n var eventManager = new EventManager(ctrl);\n var thresholdManager = new ThresholdManager(ctrl);\n var tooltip = new GraphTooltip(elem, dashboard, scope, function() {\n return sortedSeries;\n });\n\n // panel events\n ctrl.events.on('panel-teardown', () => {\n thresholdManager = null;\n\n if (plot) {\n plot.destroy();\n plot = null;\n }\n });\n\n /**\n * Split graph rendering into two parts.\n * First, calculate series stats in buildFlotPairs() function. Then legend rendering started\n * (see ctrl.events.on('render') in legend.ts).\n * When legend is rendered it emits 'legend-rendering-complete' and graph rendered.\n */\n ctrl.events.on('render', renderData => {\n data = renderData || data;\n if (!data) {\n return;\n }\n annotations = ctrl.annotations || [];\n\n if (!panel.showEcuEvents) {\n annotations = _.filter(annotations, a => {\n return a.source.datasource !== '-- Platform Influxdb --';\n });\n }\n\n buildFlotPairs(data);\n const graphHeight = elem.height();\n updateLegendValues(data, panel, graphHeight);\n\n ctrl.events.emit('render-legend');\n });\n\n ctrl.events.on('legend-rendering-complete', () => {\n render_panel();\n });\n\n // global events\n appEvents.on(\n 'graph-hover',\n evt => {\n let isVideoSyncEvent = evt && evt.isVideoSync;\n\n // ignore other graph hover events if shared tooltip is disabled\n if (!isVideoSyncEvent && !dashboard.sharedTooltipModeEnabled()) {\n return;\n }\n\n // ignore if we are the emitter\n if (!plot || evt.panel.id === panel.id || ctrl.otherPanelInFullscreenMode()) {\n return;\n }\n\n tooltip.show(evt.pos);\n },\n scope\n );\n\n appEvents.on(\n 'graph-hover-clear',\n (event, info) => {\n if (plot) {\n tooltip.clear(plot);\n }\n },\n scope\n );\n\n function shouldAbortRender() {\n if (!data) {\n return true;\n }\n\n if (panelWidth === 0) {\n return true;\n }\n\n return false;\n }\n\n function drawHook(plot) {\n // add left axis labels\n if (panel.yaxes[0].label && panel.yaxes[0].show) {\n $(\"
    \")\n .text(panel.yaxes[0].label)\n .appendTo(elem);\n }\n\n // add right axis labels\n if (panel.yaxes[1].label && panel.yaxes[1].show) {\n $(\"
    \")\n .text(panel.yaxes[1].label)\n .appendTo(elem);\n }\n\n if (ctrl.dataWarning) {\n $(`
    ${ctrl.dataWarning.title}
    `).appendTo(elem);\n }\n\n thresholdManager.draw(plot);\n }\n\n function processOffsetHook(plot, gridMargin) {\n var left = panel.yaxes[0];\n var right = panel.yaxes[1];\n if (left.show && left.label) {\n gridMargin.left = 20;\n }\n if (right.show && right.label) {\n gridMargin.right = 20;\n }\n\n // apply y-axis min/max options\n var yaxis = plot.getYAxes();\n for (var i = 0; i < yaxis.length; i++) {\n var axis = yaxis[i];\n var panelOptions = panel.yaxes[i];\n axis.options.max = axis.options.max !== null ? axis.options.max : panelOptions.max;\n axis.options.min = axis.options.min !== null ? axis.options.min : panelOptions.min;\n }\n }\n\n function processRangeHook(plot) {\n var yAxes = plot.getYAxes();\n const align = panel.yaxis.align || false;\n\n if (yAxes.length > 1 && align === true) {\n const level = panel.yaxis.alignLevel || 0;\n alignYLevel(yAxes, parseFloat(level));\n }\n }\n\n // Series could have different timeSteps,\n // let's find the smallest one so that bars are correctly rendered.\n // In addition, only take series which are rendered as bars for this.\n function getMinTimeStepOfSeries(data) {\n var min = Number.MAX_VALUE;\n\n for (let i = 0; i < data.length; i++) {\n if (!data[i].stats.timeStep) {\n continue;\n }\n if (panel.bars) {\n if (data[i].bars && data[i].bars.show === false) {\n continue;\n }\n } else {\n if (typeof data[i].bars === 'undefined' || typeof data[i].bars.show === 'undefined' || !data[i].bars.show) {\n continue;\n }\n }\n\n if (data[i].stats.timeStep < min) {\n min = data[i].stats.timeStep;\n }\n }\n\n return min;\n }\n\n // Function for rendering panel\n function render_panel() {\n panelWidth = elem.width();\n if (shouldAbortRender()) {\n return;\n }\n\n // give space to alert editing\n thresholdManager.prepare(elem, data);\n\n // un-check dashes if lines are unchecked\n panel.dashes = panel.lines ? panel.dashes : false;\n\n // Populate element\n let options: any = buildFlotOptions(panel);\n prepareXAxis(options, panel);\n configureYAxisOptions(data, options);\n thresholdManager.addFlotOptions(options, panel);\n eventManager.addFlotEvents(annotations, options);\n\n sortedSeries = sortSeries(data, panel);\n if (panel.slowMode && panel.slowMode.enabled) {\n callPlotSlow(options, true);\n panel.slowMode.enabled = false;\n } else {\n callPlot(options, true);\n }\n }\n\n function buildFlotPairs(data) {\n for (let i = 0; i < data.length; i++) {\n let series = data[i];\n series.data = series.getFlotPairs(series.nullPointMode || panel.nullPointMode);\n\n // if hidden remove points and disable stack\n if (ctrl.hiddenSeries[series.alias]) {\n series.data = [];\n series.stack = false;\n }\n }\n }\n\n function prepareXAxis(options, panel) {\n switch (panel.xaxis.mode) {\n case 'series': {\n options.series.bars.barWidth = 0.7;\n options.series.bars.align = 'center';\n\n for (let i = 0; i < data.length; i++) {\n let series = data[i];\n series.data = [[i + 1, series.stats[panel.xaxis.values[0]]]];\n }\n\n addXSeriesAxis(options);\n break;\n }\n case 'histogram': {\n let bucketSize: number;\n\n if (data.length) {\n let histMin = _.min(_.map(data, s => s.stats.min));\n let histMax = _.max(_.map(data, s => s.stats.max));\n let ticks = panel.xaxis.buckets || panelWidth / 50;\n bucketSize = tickStep(histMin, histMax, ticks);\n options.series.bars.barWidth = bucketSize * 0.8;\n data = convertToHistogramData(data, bucketSize, ctrl.hiddenSeries, histMin, histMax);\n } else {\n bucketSize = 0;\n }\n\n addXHistogramAxis(options, bucketSize);\n break;\n }\n case 'table': {\n options.series.bars.barWidth = 0.7;\n options.series.bars.align = 'center';\n addXTableAxis(options);\n break;\n }\n default: {\n options.series.bars.barWidth = getMinTimeStepOfSeries(data) / 1.5;\n addTimeAxis(options, panel);\n break;\n }\n }\n }\n\n function sleep(ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n }\n\n async function callPlotSlow(options, incrementRenderCounter) {\n let originalData = [];\n let drawStepsCount = (panel.slowMode && panel.slowMode.stepCount) || 100;\n let drawStepsSizes = [];\n\n for (let i in sortedSeries) {\n let series = sortedSeries[i];\n // copy data for later slicing\n originalData[i] = series.data;\n drawStepsSizes[i] = series.data.length / drawStepsCount;\n\n // next set min / max for axis, if we don't it will break because the\n // automatic calculation is missing the data removed from the slice\n let maxVal = series.stats.max;\n let minVal = series.stats.min;\n let delta = maxVal - minVal;\n let axisIndex = series.yaxis - 1;\n\n options.yaxes[axisIndex].min = Math.min(minVal - delta * 0.1, options.yaxes[axisIndex].min);\n options.yaxes[axisIndex].max = Math.max(maxVal + delta * 0.1, options.yaxes[axisIndex].max);\n }\n\n // first clear the graph, and wait 1s\n for (let series of sortedSeries) {\n series.data = [];\n }\n callPlot(options, false);\n await sleep(1000);\n\n // then iterate, draw chunks of series in parralell\n for (let i = 0; i < drawStepsCount; i++) {\n let isLast = false;\n for (let seriesIdx = 0; seriesIdx < sortedSeries.length; seriesIdx++) {\n // Number of points to draw at each iteration, for each series\n let drawStepsSize = drawStepsSizes[seriesIdx];\n let begin = i * drawStepsSize;\n let end = begin + drawStepsSize;\n sortedSeries[seriesIdx].data = originalData[seriesIdx].slice(0, end);\n\n let isLastSeries = seriesIdx === sortedSeries.length - 1;\n isLast = i === drawStepsCount - 1 && isLastSeries;\n }\n callPlot(options, isLast);\n await sleep(0);\n }\n\n // reset data\n for (let seriesIdx = 0; seriesIdx < sortedSeries.length; seriesIdx++) {\n sortedSeries[seriesIdx].data = originalData[seriesIdx];\n }\n }\n\n function callPlot(options, incrementRenderCounter) {\n try {\n plot = $.plot(elem, sortedSeries, options);\n if (ctrl.renderError) {\n delete ctrl.error;\n delete ctrl.inspector;\n }\n } catch (e) {\n console.log('flotcharts error', e);\n ctrl.error = e.message || 'Render Error';\n ctrl.renderError = true;\n ctrl.inspector = { error: e };\n }\n\n if (incrementRenderCounter) {\n ctrl.renderingCompleted();\n }\n }\n\n function buildFlotOptions(panel) {\n let gridColor = '#c8c8c8';\n if (config.bootData.user.lightTheme === true) {\n gridColor = '#a1a1a1';\n }\n const stack = panel.stack ? true : null;\n let options = {\n hooks: {\n draw: [drawHook],\n processOffset: [processOffsetHook],\n processRange: [processRangeHook],\n },\n legend: { show: false },\n series: {\n stackpercent: panel.stack ? panel.percentage : false,\n stack: panel.percentage ? null : stack,\n lines: {\n show: panel.lines,\n zero: false,\n fill: translateFillOption(panel.fill),\n lineWidth: panel.dashes ? 0 : panel.linewidth,\n steps: panel.steppedLine,\n },\n dashes: {\n show: panel.dashes,\n lineWidth: panel.linewidth,\n dashLength: [panel.dashLength, panel.spaceLength],\n },\n bars: {\n show: panel.bars,\n fill: 1,\n barWidth: 1,\n zero: false,\n lineWidth: 0,\n },\n points: {\n show: panel.points,\n fill: 1,\n fillColor: false,\n radius: panel.points ? panel.pointradius : 2,\n },\n shadowSize: 0,\n },\n yaxes: [],\n xaxis: {},\n grid: {\n minBorderMargin: 0,\n markings: [],\n backgroundColor: null,\n borderWidth: 0,\n hoverable: true,\n clickable: true,\n color: gridColor,\n margin: { left: 0, right: 0 },\n labelMarginX: 0,\n },\n selection: {\n mode: 'x',\n color: '#666',\n },\n crosshair: {\n mode: 'x',\n },\n };\n return options;\n }\n\n function sortSeries(series, panel) {\n var sortBy = panel.legend.sort;\n var sortOrder = panel.legend.sortDesc;\n var haveSortBy = sortBy !== null && sortBy !== undefined;\n var haveSortOrder = sortOrder !== null && sortOrder !== undefined;\n var shouldSortBy = panel.stack && haveSortBy && haveSortOrder;\n var sortDesc = panel.legend.sortDesc === true ? -1 : 1;\n\n if (shouldSortBy) {\n return _.sortBy(series, s => s.stats[sortBy] * sortDesc);\n } else {\n return _.sortBy(series, s => s.zindex);\n }\n }\n\n function translateFillOption(fill) {\n if (panel.percentage && panel.stack) {\n return fill === 0 ? 0.001 : fill / 10;\n } else {\n return fill / 10;\n }\n }\n\n function addTimeAxis(options, panel) {\n var ticks = panelWidth / 100;\n var min = _.isUndefined(ctrl.range.from) ? null : ctrl.range.from.valueOf();\n var max = _.isUndefined(ctrl.range.to) ? null : ctrl.range.to.valueOf();\n\n options.xaxis = {\n mode: 'time',\n show: panel.xaxis.show,\n min: min,\n max: max,\n label: 'Datetime',\n ticks: ticks,\n };\n\n if (panel.xaxis.tzero) {\n var tZeroFormatter = function(val, axis) {\n if (val === 0) {\n return 'T=0';\n }\n var prefix = val < 0 ? 'T-' : 'T+';\n var time = Math.abs(val) / 1000;\n return prefix + time;\n };\n\n options.xaxis.tickFormatter = tZeroFormatter;\n } else {\n options.xaxis.timezone = dashboard.getTimezone();\n options.xaxis.timeforamt = time_format(ticks, min, max);\n }\n }\n\n function addXSeriesAxis(options) {\n var ticks = _.map(data, function(series, index) {\n return [index + 1, series.alias];\n });\n\n options.xaxis = {\n timezone: dashboard.getTimezone(),\n show: panel.xaxis.show,\n mode: null,\n min: 0,\n max: ticks.length + 1,\n label: 'Datetime',\n ticks: ticks,\n };\n }\n\n function addXHistogramAxis(options, bucketSize) {\n let ticks, min, max;\n let defaultTicks = panelWidth / 50;\n\n if (data.length && bucketSize) {\n let tick_values = [];\n for (let d of data) {\n for (let point of d.data) {\n tick_values[point[0]] = true;\n }\n }\n ticks = Object.keys(tick_values).map(v => Number(v));\n min = _.min(ticks);\n max = _.max(ticks);\n\n // Adjust tick step\n let tickStep = bucketSize;\n let ticks_num = Math.floor((max - min) / tickStep);\n while (ticks_num > defaultTicks) {\n tickStep = tickStep * 2;\n ticks_num = Math.ceil((max - min) / tickStep);\n }\n\n // Expand ticks for pretty view\n min = Math.floor(min / tickStep) * tickStep;\n // 1.01 is 101% - ensure we have enough space for last bar\n max = Math.ceil(max * 1.01 / tickStep) * tickStep;\n\n ticks = [];\n for (let i = min; i <= max; i += tickStep) {\n ticks.push(i);\n }\n } else {\n // Set defaults if no data\n ticks = defaultTicks / 2;\n min = 0;\n max = 1;\n }\n\n options.xaxis = {\n timezone: dashboard.getTimezone(),\n show: panel.xaxis.show,\n mode: null,\n min: min,\n max: max,\n label: 'Histogram',\n ticks: ticks,\n };\n\n // Use 'short' format for histogram values\n configureAxisMode(options.xaxis, 'short');\n }\n\n function addXTableAxis(options) {\n var ticks = _.map(data, function(series, seriesIndex) {\n return _.map(series.datapoints, function(point, pointIndex) {\n var tickIndex = seriesIndex * series.datapoints.length + pointIndex;\n return [tickIndex + 1, point[1]];\n });\n });\n ticks = _.flatten(ticks, true);\n\n options.xaxis = {\n timezone: dashboard.getTimezone(),\n show: panel.xaxis.show,\n mode: null,\n min: 0,\n max: ticks.length + 1,\n label: 'Datetime',\n ticks: ticks,\n };\n }\n\n function configureYAxisOptions(data, options) {\n var defaults = {\n position: 'left',\n show: panel.yaxes[0].show,\n index: 1,\n logBase: panel.yaxes[0].logBase || 1,\n min: parseNumber(panel.yaxes[0].min),\n max: parseNumber(panel.yaxes[0].max),\n tickDecimals: panel.yaxes[0].decimals,\n };\n\n options.yaxes.push(defaults);\n\n if (_.find(data, { yaxis: 2 })) {\n var secondY = _.clone(defaults);\n secondY.index = 2;\n secondY.show = panel.yaxes[1].show;\n secondY.logBase = panel.yaxes[1].logBase || 1;\n secondY.position = 'right';\n secondY.min = parseNumber(panel.yaxes[1].min);\n secondY.max = parseNumber(panel.yaxes[1].max);\n secondY.tickDecimals = panel.yaxes[1].decimals;\n options.yaxes.push(secondY);\n\n applyLogScale(options.yaxes[1], data);\n configureAxisMode(options.yaxes[1], panel.percentage && panel.stack ? 'percent' : panel.yaxes[1].format);\n }\n applyLogScale(options.yaxes[0], data);\n configureAxisMode(options.yaxes[0], panel.percentage && panel.stack ? 'percent' : panel.yaxes[0].format);\n }\n\n function parseNumber(value: any) {\n if (value === null || typeof value === 'undefined') {\n return null;\n }\n\n return _.toNumber(value);\n }\n\n function applyLogScale(axis, data) {\n if (axis.logBase === 1) {\n return;\n }\n\n const minSetToZero = axis.min === 0;\n\n if (axis.min < Number.MIN_VALUE) {\n axis.min = null;\n }\n if (axis.max < Number.MIN_VALUE) {\n axis.max = null;\n }\n\n var series, i;\n var max = axis.max,\n min = axis.min;\n\n for (i = 0; i < data.length; i++) {\n series = data[i];\n if (series.yaxis === axis.index) {\n if (!max || max < series.stats.max) {\n max = series.stats.max;\n }\n if (!min || min > series.stats.logmin) {\n min = series.stats.logmin;\n }\n }\n }\n\n axis.transform = function(v) {\n return v < Number.MIN_VALUE ? null : Math.log(v) / Math.log(axis.logBase);\n };\n axis.inverseTransform = function(v) {\n return Math.pow(axis.logBase, v);\n };\n\n if (!max && !min) {\n max = axis.inverseTransform(+2);\n min = axis.inverseTransform(-2);\n } else if (!max) {\n max = min * axis.inverseTransform(+4);\n } else if (!min) {\n min = max * axis.inverseTransform(-4);\n }\n\n if (axis.min) {\n min = axis.inverseTransform(Math.ceil(axis.transform(axis.min)));\n } else {\n min = axis.min = axis.inverseTransform(Math.floor(axis.transform(min)));\n }\n if (axis.max) {\n max = axis.inverseTransform(Math.floor(axis.transform(axis.max)));\n } else {\n max = axis.max = axis.inverseTransform(Math.ceil(axis.transform(max)));\n }\n\n if (!min || min < Number.MIN_VALUE || !max || max < Number.MIN_VALUE) {\n return;\n }\n\n if (Number.isFinite(min) && Number.isFinite(max)) {\n if (minSetToZero) {\n axis.min = 0.1;\n min = 1;\n }\n\n axis.ticks = generateTicksForLogScaleYAxis(min, max, axis.logBase);\n if (minSetToZero) {\n axis.ticks.unshift(0.1);\n }\n if (axis.ticks[axis.ticks.length - 1] > axis.max) {\n axis.max = axis.ticks[axis.ticks.length - 1];\n }\n } else {\n axis.ticks = [1, 2];\n delete axis.min;\n delete axis.max;\n }\n }\n\n function generateTicksForLogScaleYAxis(min, max, logBase) {\n let ticks = [];\n\n var nextTick;\n for (nextTick = min; nextTick <= max; nextTick *= logBase) {\n ticks.push(nextTick);\n }\n\n const maxNumTicks = Math.ceil(ctrl.height / 25);\n const numTicks = ticks.length;\n if (numTicks > maxNumTicks) {\n const factor = Math.ceil(numTicks / maxNumTicks) * logBase;\n ticks = [];\n\n for (nextTick = min; nextTick <= max * factor; nextTick *= factor) {\n ticks.push(nextTick);\n }\n }\n\n return ticks;\n }\n\n function configureAxisMode(axis, format) {\n axis.tickFormatter = function(val, axis) {\n if (!kbn.valueFormats[format]) {\n throw new Error(`Unit '${format}' is not supported`);\n }\n return kbn.valueFormats[format](val, axis.tickDecimals, axis.scaledDecimals);\n };\n }\n\n function time_format(ticks, min, max) {\n if (min && max && ticks) {\n var range = max - min;\n var secPerTick = range / ticks / 1000;\n var oneDay = 86400000;\n var oneYear = 31536000000;\n\n if (secPerTick <= 45) {\n return '%H:%M:%S';\n }\n if (secPerTick <= 7200 || range <= oneDay) {\n return '%H:%M';\n }\n if (secPerTick <= 80000) {\n return '%m/%d %H:%M';\n }\n if (secPerTick <= 2419200 || range <= oneYear) {\n return '%m/%d';\n }\n return '%Y-%m';\n }\n\n return '%H:%M';\n }\n\n elem.bind('plotselected', function(event, ranges) {\n if (panel.xaxis.mode !== 'time') {\n // Skip if panel in histogram or series mode\n plot.clearSelection();\n return;\n }\n\n if ((ranges.ctrlKey || ranges.metaKey) && (dashboard.meta.canEdit || dashboard.meta.canMakeEditable)) {\n // Add annotation\n setTimeout(() => {\n eventManager.updateTime(ranges.xaxis);\n }, 100);\n } else {\n scope.$apply(function() {\n timeSrv.setTime({\n from: moment.utc(ranges.xaxis.from),\n to: moment.utc(ranges.xaxis.to),\n });\n });\n }\n });\n\n elem.bind('plotclick', function(event, pos, item) {\n if (panel.xaxis.mode !== 'time') {\n // Skip if panel in histogram or series mode\n return;\n }\n\n if ((pos.ctrlKey || pos.metaKey) && (dashboard.meta.canEdit || dashboard.meta.canMakeEditable)) {\n // Skip if range selected (added in \"plotselected\" event handler)\n let isRangeSelection = pos.x !== pos.x1;\n if (!isRangeSelection) {\n setTimeout(() => {\n eventManager.updateTime({ from: pos.x, to: null });\n }, 100);\n }\n }\n });\n\n scope.$on('$destroy', function() {\n tooltip.destroy();\n elem.off();\n elem.remove();\n });\n },\n };\n}\n\ncoreModule.directive('grafanaGraph', graphDirective);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/graph/graph.ts","define([\n 'jquery',\n 'lodash',\n 'angular',\n 'tether-drop',\n],\nfunction ($, _, angular, Drop) {\n 'use strict';\n\n function createAnnotationToolip(element, event, plot, events) {\n var injector = angular.element(document).injector();\n var content = document.createElement('div');\n content.innerHTML = '';\n\n injector.invoke([\"$compile\", \"$rootScope\", function($compile, $rootScope) {\n var eventManager = plot.getOptions().events.manager;\n var tmpScope = $rootScope.$new(true);\n tmpScope.event = event;\n tmpScope.events = events;\n tmpScope.plot = plot;\n tmpScope.onEdit = function() {\n eventManager.editEvent(event);\n };\n\n $compile(content)(tmpScope);\n tmpScope.$digest();\n tmpScope.$destroy();\n\n var drop = new Drop({\n target: element[0],\n content: content,\n position: \"bottom center\",\n classes: 'drop-popover drop-popover--annotation',\n openOn: 'hover',\n hoverCloseDelay: 200,\n tetherOptions: {\n constraints: [{to: 'window', pin: true, attachment: \"both\"}]\n }\n });\n\n drop.open();\n\n drop.on('close', function() {\n setTimeout(function() {\n drop.destroy();\n });\n });\n }]);\n }\n\n var markerElementToAttachTo = null;\n\n function createEditPopover(element, event, plot) {\n var eventManager = plot.getOptions().events.manager;\n if (eventManager.editorOpen) {\n // update marker element to attach to (needed in case of legend on the right\n // when there is a double render pass and the initial marker element is removed)\n markerElementToAttachTo = element;\n return;\n }\n\n // mark as openend\n eventManager.editorOpened();\n // set marker element to attache to\n markerElementToAttachTo = element;\n\n // wait for element to be attached and positioned\n setTimeout(function() {\n\n var injector = angular.element(document).injector();\n var content = document.createElement('div');\n content.innerHTML = '';\n\n injector.invoke([\"$compile\", \"$rootScope\", function($compile, $rootScope) {\n var scope = $rootScope.$new(true);\n var drop;\n\n scope.event = event;\n scope.panelCtrl = eventManager.panelCtrl;\n scope.close = function() {\n drop.close();\n };\n\n $compile(content)(scope);\n scope.$digest();\n\n drop = new Drop({\n target: markerElementToAttachTo[0],\n content: content,\n position: \"bottom center\",\n classes: 'drop-popover drop-popover--form',\n openOn: 'click',\n tetherOptions: {\n constraints: [{to: 'window', pin: true, attachment: \"both\"}]\n }\n });\n\n drop.open();\n eventManager.editorOpened();\n\n drop.on('close', function() {\n // need timeout here in order call drop.destroy\n setTimeout(function() {\n eventManager.editorClosed();\n scope.$destroy();\n drop.destroy();\n });\n });\n }]);\n\n }, 100);\n }\n\n /*\n * jquery.flot.events\n *\n * description: Flot plugin for adding events/markers to the plot\n * version: 0.2.5\n * authors:\n * Alexander Wunschik \n * Joel Oughton \n * Nicolas Joseph \n *\n * website: https://github.com/mojoaxel/flot-events\n *\n * released under MIT License and GPLv2+\n */\n\n /**\n * A class that allows for the drawing an remove of some object\n */\n var DrawableEvent = function(object, drawFunc, clearFunc, moveFunc, left, top, width, height) {\n var _object = object;\n var\t_drawFunc = drawFunc;\n var\t_clearFunc = clearFunc;\n var\t_moveFunc = moveFunc;\n var\t_position = { left: left, top: top };\n var\t_width = width;\n var\t_height = height;\n\n this.width = function() { return _width; };\n this.height = function() { return _height; };\n this.position = function() { return _position; };\n this.draw = function() { _drawFunc(_object); };\n this.clear = function() { _clearFunc(_object); };\n this.getObject = function() { return _object; };\n this.moveTo = function(position) {\n _position = position;\n _moveFunc(_object, _position);\n };\n };\n\n /**\n * Event class that stores options (eventType, min, max, title, description) and the object to draw.\n */\n var VisualEvent = function(options, drawableEvent) {\n var _parent;\n var _options = options;\n var _drawableEvent = drawableEvent;\n var _hidden = false;\n\n this.visual = function() { return _drawableEvent; };\n this.getOptions = function() { return _options; };\n this.getParent = function() { return _parent; };\n this.isHidden = function() { return _hidden; };\n this.hide = function() { _hidden = true; };\n this.unhide = function() { _hidden = false; };\n };\n\n /**\n * A Class that handles the event-markers inside the given plot\n */\n var EventMarkers = function(plot) {\n var _events = [];\n\n this._types = [];\n this._plot = plot;\n this.eventsEnabled = false;\n\n this.getEvents = function() {\n return _events;\n };\n\n this.setTypes = function(types) {\n return this._types = types;\n };\n\n /**\n * create internal objects for the given events\n */\n this.setupEvents = function(events) {\n var that = this;\n var parts = _.partition(events, 'isRegion');\n var regions = parts[0];\n events = parts[1];\n\n $.each(events, function(index, event) {\n var ve = new VisualEvent(event, that._buildDiv(event, events));\n _events.push(ve);\n });\n\n $.each(regions, function (index, event) {\n var vre = new VisualEvent(event, that._buildRegDiv(event));\n _events.push(vre);\n });\n\n _events.sort(function(a, b) {\n var ao = a.getOptions(), bo = b.getOptions();\n if (ao.min > bo.min) { return 1; }\n if (ao.min < bo.min) { return -1; }\n return 0;\n });\n };\n\n /**\n * draw the events to the plot\n */\n this.drawEvents = function() {\n var that = this;\n // var o = this._plot.getPlotOffset();\n\n $.each(_events, function(index, event) {\n // check event is inside the graph range\n if (that._insidePlot(event.getOptions().min) && !event.isHidden()) {\n event.visual().draw();\n } else {\n event.visual().getObject().hide();\n }\n });\n };\n\n /**\n * update the position of the event-markers (e.g. after scrolling or zooming)\n */\n this.updateEvents = function() {\n var that = this;\n var o = this._plot.getPlotOffset(), left, top;\n var xaxis = this._plot.getXAxes()[this._plot.getOptions().events.xaxis - 1];\n\n $.each(_events, function(index, event) {\n top = o.top + that._plot.height() - event.visual().height();\n left = xaxis.p2c(event.getOptions().min) + o.left - event.visual().width() / 2;\n event.visual().moveTo({ top: top, left: left });\n });\n };\n\n /**\n * remove all events from the plot\n */\n this._clearEvents = function() {\n $.each(_events, function(index, val) {\n val.visual().clear();\n });\n _events = [];\n };\n\n /**\n * create a DOM element for the given event\n */\n this._buildDiv = function(event, events) {\n var that = this;\n\n var container = this._plot.getPlaceholder();\n var o = this._plot.getPlotOffset();\n var axes = this._plot.getAxes();\n var xaxis = this._plot.getXAxes()[this._plot.getOptions().events.xaxis - 1];\n var yaxis, top, left, color, markerSize, markerShow, lineStyle, lineWidth;\n var markerTooltip;\n\n // determine the y axis used\n if (axes.yaxis && axes.yaxis.used) { yaxis = axes.yaxis; }\n if (axes.yaxis2 && axes.yaxis2.used) { yaxis = axes.yaxis2; }\n\n // map the eventType to a types object\n var eventTypeId = event.eventType;\n\n if (this._types === null || !this._types[eventTypeId] || !this._types[eventTypeId].color) {\n color = '#666';\n } else {\n color = this._types[eventTypeId].color;\n }\n\n if (this._types === null || !this._types[eventTypeId] || !this._types[eventTypeId].markerSize) {\n markerSize = 8; //default marker size\n } else {\n markerSize = this._types[eventTypeId].markerSize;\n }\n\n if (this._types === null || !this._types[eventTypeId] || this._types[eventTypeId].markerShow === undefined) {\n markerShow = true;\n } else {\n markerShow = this._types[eventTypeId].markerShow;\n }\n\n if (this._types === null || !this._types[eventTypeId] || this._types[eventTypeId].markerTooltip === undefined) {\n markerTooltip = true;\n } else {\n markerTooltip = this._types[eventTypeId].markerTooltip;\n }\n\n if (this._types == null || !this._types[eventTypeId] || !this._types[eventTypeId].lineStyle) {\n lineStyle = 'dashed'; //default line style\n } else {\n lineStyle = this._types[eventTypeId].lineStyle.toLowerCase();\n }\n\n if (this._types == null || !this._types[eventTypeId] || this._types[eventTypeId].lineWidth === undefined) {\n lineWidth = 1; //default line width\n } else {\n lineWidth = this._types[eventTypeId].lineWidth;\n }\n\n var topOffset = xaxis.options.eventSectionHeight || 0;\n topOffset = topOffset / 3;\n\n top = o.top + this._plot.height() + topOffset;\n left = xaxis.p2c(event.min) + o.left;\n\n var line = $('
    ').css({\n \"position\": \"absolute\",\n \"opacity\": 0.8,\n \"left\": left + 'px',\n \"top\": 8,\n \"width\": lineWidth + \"px\",\n \"height\": this._plot.height() + topOffset * 0.8,\n \"border-left-width\": lineWidth + \"px\",\n \"border-left-style\": lineStyle,\n \"border-left-color\": color,\n \"color\": color\n })\n .appendTo(container);\n\n if (markerShow) {\n var marker = $('
    ').css({\n \"position\": \"absolute\",\n \"left\": (-markerSize - Math.round(lineWidth / 2)) + \"px\",\n \"font-size\": 0,\n \"line-height\": 0,\n \"width\": 0,\n \"height\": 0,\n \"border-left\": markerSize+\"px solid transparent\",\n \"border-right\": markerSize+\"px solid transparent\"\n });\n\n marker.appendTo(line);\n\n if (this._types[eventTypeId] && this._types[eventTypeId].position && this._types[eventTypeId].position.toUpperCase() === 'BOTTOM') {\n marker.css({\n \"top\": top-markerSize-8 +\"px\",\n \"border-top\": \"none\",\n \"border-bottom\": markerSize+\"px solid \" + color\n });\n } else {\n marker.css({\n \"top\": \"0px\",\n \"border-top\": markerSize+\"px solid \" + color,\n \"border-bottom\": \"none\"\n });\n }\n\n marker.data({\n \"event\": event\n });\n\n var mouseenter = function() {\n createAnnotationToolip(marker, $(this).data(\"event\"), that._plot, events);\n };\n\n if (event.editModel) {\n createEditPopover(marker, event.editModel, that._plot);\n }\n\n var mouseleave = function() {\n that._plot.clearSelection();\n };\n\n if (markerTooltip) {\n marker.css({ \"cursor\": \"help\" });\n marker.hover(mouseenter, mouseleave);\n }\n }\n\n var drawableEvent = new DrawableEvent(\n line,\n function drawFunc(obj) { obj.show(); },\n function(obj) { obj.remove(); },\n function(obj, position) {\n obj.css({\n top: position.top,\n left: position.left\n });\n },\n left,\n top,\n line.width(),\n line.height()\n );\n\n return drawableEvent;\n };\n\n /**\n * create a DOM element for the given region\n */\n this._buildRegDiv = function (event) {\n var that = this;\n\n var container = this._plot.getPlaceholder();\n var o = this._plot.getPlotOffset();\n var axes = this._plot.getAxes();\n var xaxis = this._plot.getXAxes()[this._plot.getOptions().events.xaxis - 1];\n var yaxis, top, left, lineWidth, regionWidth, lineStyle, color, markerTooltip;\n\n // determine the y axis used\n if (axes.yaxis && axes.yaxis.used) { yaxis = axes.yaxis; }\n if (axes.yaxis2 && axes.yaxis2.used) { yaxis = axes.yaxis2; }\n\n // map the eventType to a types object\n var eventTypeId = event.eventType;\n\n if (this._types === null || !this._types[eventTypeId] || !this._types[eventTypeId].color) {\n color = '#666';\n } else {\n color = this._types[eventTypeId].color;\n }\n\n if (this._types === null || !this._types[eventTypeId] || this._types[eventTypeId].markerTooltip === undefined) {\n markerTooltip = true;\n } else {\n markerTooltip = this._types[eventTypeId].markerTooltip;\n }\n\n if (this._types == null || !this._types[eventTypeId] || this._types[eventTypeId].lineWidth === undefined) {\n lineWidth = 1; //default line width\n } else {\n lineWidth = this._types[eventTypeId].lineWidth;\n }\n\n if (this._types == null || !this._types[eventTypeId] || !this._types[eventTypeId].lineStyle) {\n lineStyle = 'dashed'; //default line style\n } else {\n lineStyle = this._types[eventTypeId].lineStyle.toLowerCase();\n }\n\n var topOffset = 2;\n top = o.top + this._plot.height() + topOffset;\n\n var timeFrom = Math.min(event.min, event.timeEnd);\n var timeTo = Math.max(event.min, event.timeEnd);\n left = xaxis.p2c(timeFrom) + o.left;\n var right = xaxis.p2c(timeTo) + o.left;\n regionWidth = right - left;\n\n _.each([left, right], function(position) {\n var line = $('
    ').css({\n \"position\": \"absolute\",\n \"opacity\": 0.8,\n \"left\": position + 'px',\n \"top\": 8,\n \"width\": lineWidth + \"px\",\n \"height\": that._plot.height() + topOffset,\n \"border-left-width\": lineWidth + \"px\",\n \"border-left-style\": lineStyle,\n \"border-left-color\": color,\n \"color\": color\n });\n line.appendTo(container);\n });\n\n var region = $('
    ').css({\n \"position\": \"absolute\",\n \"opacity\": 0.5,\n \"left\": left + 'px',\n \"top\": top,\n \"width\": Math.round(regionWidth + lineWidth) + \"px\",\n \"height\": \"0.5rem\",\n \"border-left-color\": color,\n \"color\": color,\n \"background-color\": color\n });\n region.appendTo(container);\n\n region.data({\n \"event\": event\n });\n\n var mouseenter = function () {\n createAnnotationToolip(region, $(this).data(\"event\"), that._plot);\n };\n\n if (event.editModel) {\n createEditPopover(region, event.editModel, that._plot);\n }\n\n var mouseleave = function () {\n that._plot.clearSelection();\n };\n\n if (markerTooltip) {\n region.css({ \"cursor\": \"help\" });\n region.hover(mouseenter, mouseleave);\n }\n\n var drawableEvent = new DrawableEvent(\n region,\n function drawFunc(obj) { obj.show(); },\n function (obj) { obj.remove(); },\n function (obj, position) {\n obj.css({\n top: position.top,\n left: position.left\n });\n },\n left,\n top,\n region.width(),\n region.height()\n );\n\n return drawableEvent;\n };\n\n /**\n * check if the event is inside visible range\n */\n this._insidePlot = function(x) {\n var xaxis = this._plot.getXAxes()[this._plot.getOptions().events.xaxis - 1];\n var xc = xaxis.p2c(x);\n return xc > 0 && xc < xaxis.p2c(xaxis.max);\n };\n };\n\n /**\n * initialize the plugin for the given plot\n */\n function init(plot) {\n /*jshint validthis:true */\n var that = this;\n var eventMarkers = new EventMarkers(plot);\n\n plot.getEvents = function() {\n return eventMarkers._events;\n };\n\n plot.hideEvents = function() {\n $.each(eventMarkers._events, function(index, event) {\n event.visual().getObject().hide();\n });\n };\n\n plot.showEvents = function() {\n plot.hideEvents();\n $.each(eventMarkers._events, function(index, event) {\n event.hide();\n });\n\n that.eventMarkers.drawEvents();\n };\n\n // change events on an existing plot\n plot.setEvents = function(events) {\n if (eventMarkers.eventsEnabled) {\n eventMarkers.setupEvents(events);\n }\n };\n\n plot.hooks.processOptions.push(function(plot, options) {\n // enable the plugin\n if (options.events.data != null) {\n eventMarkers.eventsEnabled = true;\n }\n });\n\n plot.hooks.draw.push(function(plot) {\n var options = plot.getOptions();\n\n if (eventMarkers.eventsEnabled) {\n // check for first run\n if (eventMarkers.getEvents().length < 1) {\n eventMarkers.setTypes(options.events.types);\n eventMarkers.setupEvents(options.events.data);\n } else {\n eventMarkers.updateEvents();\n }\n }\n\n eventMarkers.drawEvents();\n });\n }\n\n var defaultOptions = {\n events: {\n data: null,\n types: null,\n xaxis: 1,\n position: 'BOTTOM'\n }\n };\n\n $.plot.plugins.push({\n init: init,\n options: defaultOptions,\n name: \"events\",\n version: \"0.2.5\"\n });\n});\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./public/app/plugins/panel/graph/jquery.flot.events.js\n// module id = 2137\n// module chunks = 0","import $ from 'jquery';\nimport { appEvents } from 'app/core/core';\n\nexport default function GraphTooltip(elem, dashboard, scope, getSeriesFn) {\n let self = this;\n let ctrl = scope.ctrl;\n let panel = ctrl.panel;\n\n let $tooltip = $('
    ');\n\n this.destroy = function() {\n $tooltip.remove();\n };\n\n this.findHoverIndexFromDataPoints = function(posX, series, last) {\n let ps = series.datapoints.pointsize;\n let initial = last * ps;\n let len = series.datapoints.points.length;\n let j;\n for (j = initial; j < len; j += ps) {\n // Special case of a non stepped line, highlight the very last point just before a null point\n if (\n (!series.lines.steps && series.datapoints.points[initial] != null && series.datapoints.points[j] == null) ||\n //normal case\n series.datapoints.points[j] > posX\n ) {\n return Math.max(j - ps, 0) / ps;\n }\n }\n return j / ps - 1;\n };\n\n this.findHoverIndexFromData = function(posX, series) {\n let lower = 0;\n let upper = series.data.length - 1;\n let middle;\n while (true) {\n if (lower > upper) {\n return Math.max(upper, 0);\n }\n middle = Math.floor((lower + upper) / 2);\n if (series.data[middle][0] === posX) {\n return middle;\n } else if (series.data[middle][0] < posX) {\n lower = middle + 1;\n } else {\n upper = middle - 1;\n }\n }\n };\n\n this.renderAndShow = function(time, innerHtml, pos, xMode) {\n if (xMode === 'time') {\n innerHtml = '
    ' + time + '
    ' + innerHtml;\n }\n $tooltip.html(innerHtml).place_tt(pos.pageX + 20, pos.pageY);\n };\n\n this.getMultiSeriesPlotHoverInfo = function(seriesList, pos) {\n let value, i, series, hoverIndex, hoverDistance, pointTime, yaxis;\n // 3 sub-arrays, 1st for hidden series, 2nd for left yaxis, 3rd for right yaxis.\n let results: any = [[], [], []];\n\n //now we know the current X (j) position for X and Y values\n let last_value = 0; //needed for stacked values\n\n let minDistance, minTime;\n\n for (i = 0; i < seriesList.length; i++) {\n series = seriesList[i];\n\n if (!series.data.length || (panel.legend.hideEmpty && series.allIsNull)) {\n // Init value so that it does not brake series sorting\n results[0].push({ hidden: true, value: 0 });\n continue;\n }\n\n if (!series.data.length || (panel.legend.hideZero && series.allIsZero)) {\n // Init value so that it does not brake series sorting\n results[0].push({ hidden: true, value: 0 });\n continue;\n }\n\n hoverIndex = this.findHoverIndexFromData(pos.x, series);\n hoverDistance = pos.x - series.data[hoverIndex][0];\n pointTime = series.data[hoverIndex][0];\n\n // Take the closest point before the cursor, or if it does not exist, the closest after\n if (\n !minDistance ||\n (hoverDistance >= 0 && (hoverDistance < minDistance || minDistance < 0)) ||\n (hoverDistance < 0 && hoverDistance > minDistance)\n ) {\n minDistance = hoverDistance;\n minTime = pointTime;\n }\n\n if (series.stack) {\n if (panel.tooltip.value_type === 'individual') {\n value = series.data[hoverIndex][1];\n } else if (!series.stack) {\n value = series.data[hoverIndex][1];\n } else {\n last_value += series.data[hoverIndex][1];\n value = last_value;\n }\n } else {\n value = series.data[hoverIndex][1];\n }\n\n // Highlighting multiple Points depending on the plot type\n if (series.lines.steps || series.stack) {\n // stacked and steppedLine plots can have series with different length.\n // Stacked series can increase its length on each new stacked serie if null points found,\n // to speed the index search we begin always on the last found hoverIndex.\n hoverIndex = this.findHoverIndexFromDataPoints(pos.x, series, hoverIndex);\n }\n\n // Be sure we have a yaxis so that it does not brake series sorting\n yaxis = 0;\n if (series.yaxis) {\n yaxis = series.yaxis.n;\n }\n\n results[yaxis].push({\n value: value,\n hoverIndex: hoverIndex,\n color: series.color,\n label: series.aliasEscaped,\n time: pointTime,\n distance: hoverDistance,\n index: i,\n });\n }\n\n // Contat the 3 sub-arrays\n results = results[0].concat(results[1], results[2]);\n\n // Time of the point closer to pointer\n results.time = minTime;\n\n return results;\n };\n\n elem.mouseleave(function() {\n if (panel.tooltip.shared) {\n let plot = elem.data().plot;\n if (plot) {\n $tooltip.detach();\n plot.unhighlight();\n }\n }\n appEvents.emit('graph-hover-clear');\n });\n\n elem.bind('plothover', function(event, pos, item) {\n self.show(pos, item);\n\n // broadcast to other graph panels that we are hovering!\n pos.panelRelY = (pos.pageY - elem.offset().top) / elem.height();\n appEvents.emit('graph-hover', { pos: pos, panel: panel });\n });\n\n elem.bind('plotclick', function(event, pos, item) {\n appEvents.emit('graph-click', { pos: pos, panel: panel, item: item });\n });\n\n this.clear = function(plot) {\n $tooltip.detach();\n plot.clearCrosshair();\n plot.unhighlight();\n };\n\n this.show = function(pos, item) {\n let plot = elem.data().plot;\n let plotData = plot.getData();\n let xAxes = plot.getXAxes();\n let xMode = xAxes[0].options.mode;\n let seriesList = getSeriesFn();\n let allSeriesMode = panel.tooltip.shared;\n let group, value, absoluteTime, hoverInfo, i, series, seriesHtml, tooltipFormat;\n\n // if panelRelY is defined another panel wants us to show a tooltip\n // get pageX from position on x axis and pageY from relative position in original panel\n if ('panelRelY' in pos) {\n let pointOffset = plot.pointOffset({ x: pos.x });\n if (Number.isNaN(pointOffset.left) || pointOffset.left < 0 || pointOffset.left > elem.width()) {\n self.clear(plot);\n return;\n }\n pos.pageX = elem.offset().left + pointOffset.left;\n pos.pageY = elem.offset().top + elem.height() * pos.panelRelY;\n let isVisible =\n pos.pageY >= $(window).scrollTop() && pos.pageY <= $(window).innerHeight() + $(window).scrollTop();\n if (!isVisible) {\n self.clear(plot);\n return;\n }\n plot.setCrosshair(pos);\n allSeriesMode = true;\n\n if (dashboard.sharedCrosshairModeOnly()) {\n // if only crosshair mode we are done\n return;\n }\n }\n\n if (seriesList.length === 0) {\n return;\n }\n\n if (seriesList[0].hasMsResolution) {\n tooltipFormat = 'YYYY-MM-DD HH:mm:ss.SSS';\n } else {\n tooltipFormat = 'YYYY-MM-DD HH:mm:ss';\n }\n\n if (allSeriesMode) {\n plot.unhighlight();\n\n let seriesHoverInfo = self.getMultiSeriesPlotHoverInfo(plotData, pos);\n\n seriesHtml = '';\n\n var tZeroFormatter = function(val) {\n var prefix = val === 0 ? 'T=' : val < 0 ? 'T-' : 'T+';\n return prefix + Math.abs(val) / 1000;\n };\n\n absoluteTime = panel.xaxis.tzero\n ? tZeroFormatter(seriesHoverInfo.time)\n : dashboard.formatDate(seriesHoverInfo.time, tooltipFormat);\n\n // Dynamically reorder the hovercard for the current time point if the\n // option is enabled.\n if (panel.tooltip.sort === 2) {\n seriesHoverInfo.sort(function(a, b) {\n return b.value - a.value;\n });\n } else if (panel.tooltip.sort === 1) {\n seriesHoverInfo.sort(function(a, b) {\n return a.value - b.value;\n });\n }\n\n for (i = 0; i < seriesHoverInfo.length; i++) {\n hoverInfo = seriesHoverInfo[i];\n\n if (hoverInfo.hidden) {\n continue;\n }\n\n let highlightClass = '';\n if (item && hoverInfo.index === item.seriesIndex) {\n highlightClass = 'graph-tooltip-list-item--highlight';\n }\n\n series = seriesList[hoverInfo.index];\n\n value = series.formatValue(hoverInfo.value);\n\n seriesHtml +=\n '
    ';\n seriesHtml +=\n ' ' + hoverInfo.label + ':
    ';\n seriesHtml += '
    ' + value + '
    ';\n plot.highlight(hoverInfo.index, hoverInfo.hoverIndex);\n }\n\n self.renderAndShow(absoluteTime, seriesHtml, pos, xMode);\n } else if (item) {\n // single series tooltip\n series = seriesList[item.seriesIndex];\n group = '
    ';\n group +=\n ' ' + series.aliasEscaped + ':
    ';\n\n if (panel.stack && panel.tooltip.value_type === 'individual') {\n value = item.datapoint[1] - item.datapoint[2];\n } else {\n value = item.datapoint[1];\n }\n\n value = series.formatValue(value);\n\n absoluteTime = dashboard.formatDate(item.datapoint[0], tooltipFormat);\n\n group += '
    ' + value + '
    ';\n\n self.renderAndShow(absoluteTime, group, pos, xMode);\n } else {\n // no hit\n $tooltip.detach();\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/graph/graph_tooltip.ts","import 'vendor/flot/jquery.flot';\nimport $ from 'jquery';\nimport _ from 'lodash';\n\nexport class ThresholdManager {\n plot: any;\n placeholder: any;\n height: any;\n thresholds: any;\n needsCleanup: boolean;\n hasSecondYAxis: any;\n\n constructor(private panelCtrl) {}\n\n getHandleHtml(handleIndex, model, valueStr) {\n var stateClass = model.colorMode;\n if (model.colorMode === 'custom') {\n stateClass = 'critical';\n }\n\n return `\n
    \n
    \n
    \n
    \n \n ${valueStr}\n
    \n
    `;\n }\n\n initDragging(evt) {\n var handleElem = $(evt.currentTarget).parents('.alert-handle-wrapper');\n var handleIndex = $(evt.currentTarget).data('handleIndex');\n\n var lastY = null;\n var posTop;\n var plot = this.plot;\n var panelCtrl = this.panelCtrl;\n var model = this.thresholds[handleIndex];\n\n function dragging(evt) {\n if (lastY === null) {\n lastY = evt.clientY;\n } else {\n var diff = evt.clientY - lastY;\n posTop = posTop + diff;\n lastY = evt.clientY;\n handleElem.css({ top: posTop + diff });\n }\n }\n\n function stopped() {\n // calculate graph level\n var graphValue = plot.c2p({ left: 0, top: posTop }).y;\n graphValue = parseInt(graphValue.toFixed(0));\n model.value = graphValue;\n\n handleElem.off('mousemove', dragging);\n handleElem.off('mouseup', dragging);\n handleElem.off('mouseleave', dragging);\n\n // trigger digest and render\n panelCtrl.$scope.$apply(function() {\n panelCtrl.render();\n panelCtrl.events.emit('threshold-changed', {\n threshold: model,\n handleIndex: handleIndex,\n });\n });\n }\n\n lastY = null;\n posTop = handleElem.position().top;\n\n handleElem.on('mousemove', dragging);\n handleElem.on('mouseup', stopped);\n handleElem.on('mouseleave', stopped);\n }\n\n cleanUp() {\n this.placeholder.find('.alert-handle-wrapper').remove();\n this.needsCleanup = false;\n }\n\n renderHandle(handleIndex, defaultHandleTopPos) {\n var model = this.thresholds[handleIndex];\n var value = model.value;\n var valueStr = value;\n var handleTopPos = 0;\n\n // handle no value\n if (!_.isNumber(value)) {\n valueStr = '';\n handleTopPos = defaultHandleTopPos;\n } else {\n var valueCanvasPos = this.plot.p2c({ x: 0, y: value });\n handleTopPos = Math.round(Math.min(Math.max(valueCanvasPos.top, 0), this.height) - 6);\n }\n\n var handleElem = $(this.getHandleHtml(handleIndex, model, valueStr));\n this.placeholder.append(handleElem);\n\n handleElem.toggleClass('alert-handle-wrapper--no-value', valueStr === '');\n handleElem.css({ top: handleTopPos });\n }\n\n shouldDrawHandles() {\n return !this.hasSecondYAxis && this.panelCtrl.editingThresholds && this.panelCtrl.panel.thresholds.length > 0;\n }\n\n prepare(elem, data) {\n this.hasSecondYAxis = false;\n for (var i = 0; i < data.length; i++) {\n if (data[i].yaxis > 1) {\n this.hasSecondYAxis = true;\n break;\n }\n }\n\n if (this.shouldDrawHandles()) {\n var thresholdMargin = this.panelCtrl.panel.thresholds.length > 1 ? '220px' : '110px';\n elem.css('margin-right', thresholdMargin);\n } else if (this.needsCleanup) {\n elem.css('margin-right', '0');\n }\n }\n\n draw(plot) {\n this.thresholds = this.panelCtrl.panel.thresholds;\n this.plot = plot;\n this.placeholder = plot.getPlaceholder();\n\n if (this.needsCleanup) {\n this.cleanUp();\n }\n\n if (!this.shouldDrawHandles()) {\n return;\n }\n\n this.height = plot.height();\n\n if (this.thresholds.length > 0) {\n this.renderHandle(0, 10);\n }\n if (this.thresholds.length > 1) {\n this.renderHandle(1, this.height - 30);\n }\n\n this.placeholder.off('mousedown', '.alert-handle');\n this.placeholder.on('mousedown', '.alert-handle', this.initDragging.bind(this));\n this.needsCleanup = true;\n }\n\n addFlotOptions(options, panel) {\n if (!panel.thresholds || panel.thresholds.length === 0) {\n return;\n }\n\n var gtLimit = Infinity;\n var ltLimit = -Infinity;\n var i, threshold, other;\n\n for (i = 0; i < panel.thresholds.length; i++) {\n threshold = panel.thresholds[i];\n if (!_.isNumber(threshold.value)) {\n continue;\n }\n\n var limit;\n switch (threshold.op) {\n case 'gt': {\n limit = gtLimit;\n // if next threshold is less then op and greater value, then use that as limit\n if (panel.thresholds.length > i + 1) {\n other = panel.thresholds[i + 1];\n if (other.value > threshold.value) {\n limit = other.value;\n ltLimit = limit;\n }\n }\n break;\n }\n case 'lt': {\n limit = ltLimit;\n // if next threshold is less then op and greater value, then use that as limit\n if (panel.thresholds.length > i + 1) {\n other = panel.thresholds[i + 1];\n if (other.value < threshold.value) {\n limit = other.value;\n gtLimit = limit;\n }\n }\n break;\n }\n }\n\n var fillColor, lineColor;\n switch (threshold.colorMode) {\n case 'critical': {\n fillColor = 'rgba(234, 112, 112, 0.12)';\n lineColor = 'rgba(237, 46, 24, 0.60)';\n break;\n }\n case 'warning': {\n fillColor = 'rgba(235, 138, 14, 0.12)';\n lineColor = 'rgba(247, 149, 32, 0.60)';\n break;\n }\n case 'ok': {\n fillColor = 'rgba(11, 237, 50, 0.090)';\n lineColor = 'rgba(6,163,69, 0.60)';\n break;\n }\n case 'custom': {\n fillColor = threshold.fillColor;\n lineColor = threshold.lineColor;\n break;\n }\n }\n\n // fill\n if (threshold.fill) {\n if (threshold.yaxis === 'right' && this.hasSecondYAxis) {\n options.grid.markings.push({\n y2axis: { from: threshold.value, to: limit },\n color: fillColor,\n });\n } else {\n options.grid.markings.push({\n yaxis: { from: threshold.value, to: limit },\n color: fillColor,\n });\n }\n }\n if (threshold.line) {\n if (threshold.yaxis === 'right' && this.hasSecondYAxis) {\n options.grid.markings.push({\n y2axis: { from: threshold.value, to: threshold.value },\n color: lineColor,\n });\n } else {\n options.grid.markings.push({\n yaxis: { from: threshold.value, to: threshold.value },\n color: lineColor,\n });\n }\n }\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/graph/threshold_manager.ts","import _ from 'lodash';\nimport TimeSeries from 'app/core/time_series2';\n\n/**\n * Convert series into array of series values.\n * @param data Array of series\n */\nexport function getSeriesValues(dataList: TimeSeries[]): number[] {\n const VALUE_INDEX = 0;\n let values = [];\n\n // Count histogam stats\n for (let i = 0; i < dataList.length; i++) {\n let series = dataList[i];\n let datapoints = series.datapoints;\n for (let j = 0; j < datapoints.length; j++) {\n if (datapoints[j][VALUE_INDEX] !== null) {\n values.push(datapoints[j][VALUE_INDEX]);\n }\n }\n }\n\n return values;\n}\n\n/**\n * Convert array of values into timeseries-like histogram:\n * [[val_1, count_1], [val_2, count_2], ..., [val_n, count_n]]\n * @param values\n * @param bucketSize\n */\nexport function convertValuesToHistogram(values: number[], bucketSize: number, min: number, max: number): any[] {\n let histogram = {};\n\n let minBound = getBucketBound(min, bucketSize);\n let maxBound = getBucketBound(max, bucketSize);\n let bound = minBound;\n let n = 0;\n while (bound <= maxBound) {\n histogram[bound] = 0;\n bound = minBound + bucketSize * n;\n n++;\n }\n\n for (let i = 0; i < values.length; i++) {\n let bound = getBucketBound(values[i], bucketSize);\n histogram[bound] = histogram[bound] + 1;\n }\n\n let histogam_series = _.map(histogram, (count, bound) => {\n return [Number(bound), count];\n });\n\n // Sort by Y axis values\n return _.sortBy(histogam_series, point => point[0]);\n}\n\n/**\n * Convert series into array of histogram data.\n * @param data Array of series\n * @param bucketSize\n */\nexport function convertToHistogramData(\n data: any,\n bucketSize: number,\n hiddenSeries: any,\n min: number,\n max: number\n): any[] {\n return data.map(series => {\n let values = getSeriesValues([series]);\n series.histogram = true;\n if (!hiddenSeries[series.alias]) {\n let histogram = convertValuesToHistogram(values, bucketSize, min, max);\n series.data = histogram;\n } else {\n series.data = [];\n }\n return series;\n });\n}\n\nfunction getBucketBound(value: number, bucketSize: number): number {\n return Math.floor(value / bucketSize) * bucketSize;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/graph/histogram.ts","import _ from 'lodash';\n\n/**\n * To align two Y axes by Y level\n * @param yAxes data [{min: min_y1, min: max_y1}, {min: min_y2, max: max_y2}]\n * @param level Y level\n */\nexport function alignYLevel(yAxes, level) {\n if (isNaN(level) || !checkCorrectAxis(yAxes)) {\n return;\n }\n\n var [yLeft, yRight] = yAxes;\n moveLevelToZero(yLeft, yRight, level);\n\n expandStuckValues(yLeft, yRight);\n\n // one of graphs on zero\n var zero = yLeft.min === 0 || yRight.min === 0 || yLeft.max === 0 || yRight.max === 0;\n\n var oneSide = checkOneSide(yLeft, yRight);\n\n if (zero && oneSide) {\n yLeft.min = yLeft.max > 0 ? 0 : yLeft.min;\n yLeft.max = yLeft.max > 0 ? yLeft.max : 0;\n yRight.min = yRight.max > 0 ? 0 : yRight.min;\n yRight.max = yRight.max > 0 ? yRight.max : 0;\n } else {\n if (checkOppositeSides(yLeft, yRight)) {\n if (yLeft.min >= 0) {\n yLeft.min = -yLeft.max;\n yRight.max = -yRight.min;\n } else {\n yLeft.max = -yLeft.min;\n yRight.min = -yRight.max;\n }\n } else {\n var rate = getRate(yLeft, yRight);\n\n if (oneSide) {\n // all graphs above the Y level\n if (yLeft.min > 0) {\n yLeft.min = yLeft.max / rate;\n yRight.min = yRight.max / rate;\n } else {\n yLeft.max = yLeft.min / rate;\n yRight.max = yRight.min / rate;\n }\n } else {\n if (checkTwoCross(yLeft, yRight)) {\n yLeft.min = yRight.min ? yRight.min * rate : yLeft.min;\n yRight.min = yLeft.min ? yLeft.min / rate : yRight.min;\n yLeft.max = yRight.max ? yRight.max * rate : yLeft.max;\n yRight.max = yLeft.max ? yLeft.max / rate : yRight.max;\n } else {\n yLeft.min = yLeft.min > 0 ? yRight.min * rate : yLeft.min;\n yRight.min = yRight.min > 0 ? yLeft.min / rate : yRight.min;\n yLeft.max = yLeft.max < 0 ? yRight.max * rate : yLeft.max;\n yRight.max = yRight.max < 0 ? yLeft.max / rate : yRight.max;\n }\n }\n }\n }\n\n restoreLevelFromZero(yLeft, yRight, level);\n}\n\nfunction expandStuckValues(yLeft, yRight) {\n // wide Y min and max using increased wideFactor\n var wideFactor = 0.25;\n if (yLeft.max === yLeft.min) {\n yLeft.min -= wideFactor;\n yLeft.max += wideFactor;\n }\n if (yRight.max === yRight.min) {\n yRight.min -= wideFactor;\n yRight.max += wideFactor;\n }\n}\n\nfunction moveLevelToZero(yLeft, yRight, level) {\n if (level !== 0) {\n yLeft.min -= level;\n yLeft.max -= level;\n yRight.min -= level;\n yRight.max -= level;\n }\n}\n\nfunction restoreLevelFromZero(yLeft, yRight, level) {\n if (level !== 0) {\n yLeft.min += level;\n yLeft.max += level;\n yRight.min += level;\n yRight.max += level;\n }\n}\n\nfunction checkCorrectAxis(axis) {\n return axis.length === 2 && checkCorrectAxes(axis[0]) && checkCorrectAxes(axis[1]);\n}\n\nfunction checkCorrectAxes(axes) {\n return 'min' in axes && 'max' in axes;\n}\n\nfunction checkOneSide(yLeft, yRight) {\n // on the one hand with respect to zero\n return (yLeft.min >= 0 && yRight.min >= 0) || (yLeft.max <= 0 && yRight.max <= 0);\n}\n\nfunction checkTwoCross(yLeft, yRight) {\n // both across zero\n return yLeft.min <= 0 && yLeft.max >= 0 && yRight.min <= 0 && yRight.max >= 0;\n}\n\nfunction checkOppositeSides(yLeft, yRight) {\n // on the opposite sides with respect to zero\n return (yLeft.min >= 0 && yRight.max <= 0) || (yLeft.max <= 0 && yRight.min >= 0);\n}\n\nfunction getRate(yLeft, yRight) {\n var rateLeft, rateRight, rate;\n if (checkTwoCross(yLeft, yRight)) {\n rateLeft = yRight.min ? yLeft.min / yRight.min : 0;\n rateRight = yRight.max ? yLeft.max / yRight.max : 0;\n } else {\n if (checkOneSide(yLeft, yRight)) {\n var absLeftMin = Math.abs(yLeft.min);\n var absLeftMax = Math.abs(yLeft.max);\n var absRightMin = Math.abs(yRight.min);\n var absRightMax = Math.abs(yRight.max);\n var upLeft = _.max([absLeftMin, absLeftMax]);\n var downLeft = _.min([absLeftMin, absLeftMax]);\n var upRight = _.max([absRightMin, absRightMax]);\n var downRight = _.min([absRightMin, absRightMax]);\n\n rateLeft = downLeft ? upLeft / downLeft : upLeft;\n rateRight = downRight ? upRight / downRight : upRight;\n } else {\n if (yLeft.min > 0 || yRight.min > 0) {\n rateLeft = yLeft.max / yRight.max;\n rateRight = 0;\n } else {\n rateLeft = 0;\n rateRight = yLeft.min / yRight.min;\n }\n }\n }\n\n rate = rateLeft > rateRight ? rateLeft : rateRight;\n\n return rate;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/graph/align_yaxes.ts","import angular from 'angular';\nimport _ from 'lodash';\nimport $ from 'jquery';\nimport baron from 'baron';\n\nvar module = angular.module('grafana.directives');\n\nmodule.directive('graphLegend', function(popoverSrv, $timeout) {\n return {\n link: function(scope, elem) {\n var firstRender = true;\n var ctrl = scope.ctrl;\n var panel = ctrl.panel;\n var data;\n var seriesList;\n var i;\n var legendScrollbar;\n const legendRightDefaultWidth = 10;\n let legendElem = elem.parent();\n\n scope.$on('$destroy', function() {\n destroyScrollbar();\n });\n\n ctrl.events.on('render-legend', () => {\n data = ctrl.seriesList;\n if (data) {\n render();\n }\n ctrl.events.emit('legend-rendering-complete');\n });\n\n function getSeriesIndexForElement(el) {\n return el.parents('[data-series-index]').data('series-index');\n }\n\n function openColorSelector(e) {\n // if we clicked inside poup container ignore click\n if ($(e.target).parents('.popover').length) {\n return;\n }\n\n var el = $(e.currentTarget).find('.fa-minus');\n var index = getSeriesIndexForElement(el);\n var series = seriesList[index];\n\n $timeout(function() {\n popoverSrv.show({\n element: el[0],\n position: 'bottom left',\n targetAttachment: 'top left',\n template:\n '' +\n '',\n openOn: 'hover',\n model: {\n series: series,\n toggleAxis: function() {\n ctrl.toggleAxis(series);\n },\n colorSelected: function(color) {\n ctrl.changeSeriesColor(series, color);\n },\n },\n });\n });\n }\n\n function toggleSeries(e) {\n var el = $(e.currentTarget);\n var index = getSeriesIndexForElement(el);\n var seriesInfo = seriesList[index];\n var scrollPosition = $(elem.children('tbody')).scrollTop();\n ctrl.toggleSeries(seriesInfo, e);\n $(elem.children('tbody')).scrollTop(scrollPosition);\n }\n\n function sortLegend(e) {\n var el = $(e.currentTarget);\n var stat = el.data('stat');\n\n if (stat !== panel.legend.sort) {\n panel.legend.sortDesc = null;\n }\n\n // if already sort ascending, disable sorting\n if (panel.legend.sortDesc === false) {\n panel.legend.sort = null;\n panel.legend.sortDesc = null;\n ctrl.render();\n return;\n }\n\n panel.legend.sortDesc = !panel.legend.sortDesc;\n panel.legend.sort = stat;\n ctrl.render();\n }\n\n function getTableHeaderHtml(statName) {\n if (!panel.legend[statName]) {\n return '';\n }\n var html = '
    ';\n }\n\n function render() {\n let legendWidth = legendElem.width();\n if (!ctrl.panel.legend.show) {\n elem.empty();\n firstRender = true;\n return;\n }\n\n if (firstRender) {\n elem.on('click', '.graph-legend-icon', openColorSelector);\n elem.on('click', '.graph-legend-alias', toggleSeries);\n elem.on('click', 'th', sortLegend);\n firstRender = false;\n }\n\n seriesList = data;\n\n elem.empty();\n\n // Set min-width if side style and there is a value, otherwise remove the CSS property\n // Set width so it works with IE11\n var width: any = panel.legend.rightSide && panel.legend.sideWidth ? panel.legend.sideWidth + 'px' : '';\n var ieWidth: any = panel.legend.rightSide && panel.legend.sideWidth ? panel.legend.sideWidth - 1 + 'px' : '';\n legendElem.css('min-width', width);\n legendElem.css('width', ieWidth);\n\n elem.toggleClass('graph-legend-table', panel.legend.alignAsTable === true);\n\n var tableHeaderElem;\n if (panel.legend.alignAsTable) {\n var header = '';\n header += '';\n if (panel.legend.values) {\n header += getTableHeaderHtml('min');\n header += getTableHeaderHtml('max');\n header += getTableHeaderHtml('avg');\n header += getTableHeaderHtml('current');\n header += getTableHeaderHtml('total');\n }\n header += '';\n tableHeaderElem = $(header);\n }\n\n if (panel.legend.sort) {\n seriesList = _.sortBy(seriesList, function(series) {\n let sort = series.stats[panel.legend.sort];\n if (sort === null) {\n sort = -Infinity;\n }\n return sort;\n });\n if (panel.legend.sortDesc) {\n seriesList = seriesList.reverse();\n }\n }\n\n // render first time for getting proper legend height\n if (!panel.legend.rightSide || (panel.legend.rightSide && legendWidth !== legendRightDefaultWidth)) {\n renderLegendElement(tableHeaderElem);\n elem.empty();\n }\n\n renderLegendElement(tableHeaderElem);\n }\n\n function renderSeriesLegendElements() {\n let seriesElements = [];\n for (i = 0; i < seriesList.length; i++) {\n var series = seriesList[i];\n\n if (series.hideFromLegend(panel.legend)) {\n continue;\n }\n\n var html = '
    ';\n html += '
    ';\n html += '';\n html += '
    ';\n\n html +=\n '' + series.aliasEscaped + '';\n\n if (panel.legend.values) {\n var avg = series.formatValue(series.stats.avg);\n var current = series.formatValue(series.stats.current);\n var min = series.formatValue(series.stats.min);\n var max = series.formatValue(series.stats.max);\n var total = series.formatValue(series.stats.total);\n\n if (panel.legend.min) {\n html += '
    ' + min + '
    ';\n }\n if (panel.legend.max) {\n html += '
    ' + max + '
    ';\n }\n if (panel.legend.avg) {\n html += '
    ' + avg + '
    ';\n }\n if (panel.legend.current) {\n html += '
    ' + current + '
    ';\n }\n if (panel.legend.total) {\n html += '
    ' + total + '
    ';\n }\n }\n\n html += '
    ';\n seriesElements.push($(html));\n }\n return seriesElements;\n }\n\n function renderLegendElement(tableHeaderElem) {\n let legendWidth = elem.width();\n\n var seriesElements = renderSeriesLegendElements();\n\n if (panel.legend.alignAsTable) {\n var tbodyElem = $('');\n tbodyElem.append(tableHeaderElem);\n tbodyElem.append(seriesElements);\n elem.append(tbodyElem);\n tbodyElem.wrap('
    ');\n } else {\n elem.append('
    ');\n elem.find('.graph-legend-scroll').append(seriesElements);\n }\n\n if (!panel.legend.rightSide || (panel.legend.rightSide && legendWidth !== legendRightDefaultWidth)) {\n addScrollbar();\n } else {\n destroyScrollbar();\n }\n }\n\n function addScrollbar() {\n const scrollRootClass = 'baron baron__root';\n const scrollerClass = 'baron__scroller';\n const scrollBarHTML = `\n
    \n
    \n
    \n `;\n\n let scrollRoot = elem;\n let scroller = elem.find('.graph-legend-scroll');\n\n // clear existing scroll bar track to prevent duplication\n scrollRoot.find('.baron__track').remove();\n\n scrollRoot.addClass(scrollRootClass);\n $(scrollBarHTML).appendTo(scrollRoot);\n scroller.addClass(scrollerClass);\n\n let scrollbarParams = {\n root: scrollRoot[0],\n scroller: scroller[0],\n bar: '.baron__bar',\n track: '.baron__track',\n barOnCls: '_scrollbar',\n scrollingCls: '_scrolling',\n };\n\n if (!legendScrollbar) {\n legendScrollbar = baron(scrollbarParams);\n } else {\n destroyScrollbar();\n legendScrollbar = baron(scrollbarParams);\n }\n\n // #11830 - compensates for Firefox scrollbar calculation error in the baron framework\n scroller[0].style.marginRight = '-' + (scroller[0].offsetWidth - scroller[0].clientWidth) + 'px';\n\n legendScrollbar.scroll();\n }\n\n function destroyScrollbar() {\n if (legendScrollbar) {\n legendScrollbar.dispose();\n legendScrollbar = undefined;\n }\n }\n },\n };\n});\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/graph/legend.ts","import _ from 'lodash';\nimport angular from 'angular';\n\nexport class SeriesOverridesCtrl {\n /** @ngInject */\n constructor($scope, $element, popoverSrv) {\n $scope.overrideMenu = [];\n $scope.currentOverrides = [];\n $scope.override = $scope.override || {};\n\n $scope.addOverrideOption = function(name, propertyName, values) {\n var option = {\n text: name,\n propertyName: propertyName,\n index: $scope.overrideMenu.lenght,\n values: values,\n submenu: _.map(values, function(value) {\n return { text: String(value), value: value };\n }),\n };\n\n $scope.overrideMenu.push(option);\n };\n\n $scope.setOverride = function(item, subItem) {\n // handle color overrides\n if (item.propertyName === 'color') {\n $scope.openColorSelector($scope.override['color']);\n return;\n }\n\n $scope.override[item.propertyName] = subItem.value;\n\n // automatically disable lines for this series and the fill below to series\n // can be removed by the user if they still want lines\n if (item.propertyName === 'fillBelowTo') {\n $scope.override['lines'] = false;\n $scope.ctrl.addSeriesOverride({ alias: subItem.value, lines: false });\n }\n\n $scope.updateCurrentOverrides();\n $scope.ctrl.render();\n };\n\n $scope.colorSelected = function(color) {\n $scope.override['color'] = color;\n $scope.updateCurrentOverrides();\n $scope.ctrl.render();\n };\n\n $scope.openColorSelector = function(color) {\n var fakeSeries = { color: color };\n popoverSrv.show({\n element: $element.find('.dropdown')[0],\n position: 'top center',\n openOn: 'click',\n template: '',\n model: {\n autoClose: true,\n colorSelected: $scope.colorSelected,\n series: fakeSeries,\n },\n onClose: function() {\n $scope.ctrl.render();\n },\n });\n };\n\n $scope.removeOverride = function(option) {\n delete $scope.override[option.propertyName];\n $scope.updateCurrentOverrides();\n $scope.ctrl.refresh();\n };\n\n $scope.getSeriesNames = function() {\n return _.map($scope.ctrl.seriesList, function(series) {\n return series.alias;\n });\n };\n\n $scope.updateCurrentOverrides = function() {\n $scope.currentOverrides = [];\n _.each($scope.overrideMenu, function(option) {\n var value = $scope.override[option.propertyName];\n if (_.isUndefined(value)) {\n return;\n }\n $scope.currentOverrides.push({\n name: option.text,\n propertyName: option.propertyName,\n value: String(value),\n });\n });\n };\n\n $scope.addOverrideOption('Bars', 'bars', [true, false]);\n $scope.addOverrideOption('Lines', 'lines', [true, false]);\n $scope.addOverrideOption('Line fill', 'fill', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);\n $scope.addOverrideOption('Line width', 'linewidth', [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);\n $scope.addOverrideOption('Null point mode', 'nullPointMode', ['connected', 'null', 'null as zero']);\n $scope.addOverrideOption('Fill below to', 'fillBelowTo', $scope.getSeriesNames());\n $scope.addOverrideOption('Staircase line', 'steppedLine', [true, false]);\n $scope.addOverrideOption('Dashes', 'dashes', [true, false]);\n $scope.addOverrideOption('Dash Length', 'dashLength', [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n ]);\n $scope.addOverrideOption('Dash Space', 'spaceLength', [\n 1,\n 2,\n 3,\n 4,\n 5,\n 6,\n 7,\n 8,\n 9,\n 10,\n 11,\n 12,\n 13,\n 14,\n 15,\n 16,\n 17,\n 18,\n 19,\n 20,\n ]);\n $scope.addOverrideOption('Points', 'points', [true, false]);\n $scope.addOverrideOption('Points Radius', 'pointradius', [1, 2, 3, 4, 5]);\n $scope.addOverrideOption('Stack', 'stack', [true, false, 'A', 'B', 'C', 'D']);\n $scope.addOverrideOption('Color', 'color', ['change']);\n $scope.addOverrideOption('Y-axis', 'yaxis', [1, 2]);\n $scope.addOverrideOption('Z-index', 'zindex', [-3, -2, -1, 0, 1, 2, 3]);\n $scope.addOverrideOption('Transform', 'transform', ['negative-Y']);\n $scope.addOverrideOption('Legend', 'legend', [true, false]);\n $scope.updateCurrentOverrides();\n }\n}\n\nangular.module('grafana.controllers').controller('SeriesOverridesCtrl', SeriesOverridesCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/graph/series_overrides_ctrl.ts","import coreModule from 'app/core/core_module';\n\nexport class ThresholdFormCtrl {\n panelCtrl: any;\n panel: any;\n disabled: boolean;\n\n /** @ngInject */\n constructor($scope) {\n this.panel = this.panelCtrl.panel;\n\n if (this.panel.alert) {\n this.disabled = true;\n }\n\n var unbindDestroy = $scope.$on('$destroy', () => {\n this.panelCtrl.editingThresholds = false;\n this.panelCtrl.render();\n unbindDestroy();\n });\n\n this.panelCtrl.editingThresholds = true;\n }\n\n addThreshold() {\n this.panel.thresholds.push({\n value: undefined,\n colorMode: 'critical',\n op: 'gt',\n fill: true,\n line: true,\n yaxis: 'left',\n });\n this.panelCtrl.render();\n }\n\n removeThreshold(index) {\n this.panel.thresholds.splice(index, 1);\n this.panelCtrl.render();\n }\n\n render() {\n this.panelCtrl.render();\n }\n\n onFillColorChange(index) {\n return newColor => {\n this.panel.thresholds[index].fillColor = newColor;\n this.render();\n };\n }\n\n onLineColorChange(index) {\n return newColor => {\n this.panel.thresholds[index].lineColor = newColor;\n this.render();\n };\n }\n}\n\nvar template = `\n
    \n
    Thresholds
    \n

    \n Visual thresholds options disabled.\n Visit the Alert tab update your thresholds.
    \n To re-enable thresholds, the alert rule must be deleted from this panel.\n

    \n
    \n
    \n
    \n \n
    \n\n
    \n
    \n \n
    \n \n
    \n\n
    \n \n
    \n \n
    \n
    \n\n \n\n
    \n \n \n \n \n
    \n\n \n\n
    \n \n \n \n \n
    \n\n
    \n \n
    \n \n
    \n
    \n\n
    \n \n
    \n
    \n\n
    \n \n
    \n
    \n
    \n`;\n\ncoreModule.directive('graphThresholdForm', function() {\n return {\n restrict: 'E',\n template: template,\n controller: ThresholdFormCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: {\n panelCtrl: '=',\n },\n };\n});\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/graph/thresholds_form.ts","var template = `\n
    \n
    \n
    \n\n
    \n
    \n
    \n
    \n`;\n\nexport default template;\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/graph/template.ts","import _ from 'lodash';\nimport TimeSeries from 'app/core/time_series2';\nimport colors from 'app/core/utils/colors';\n\nexport class DataProcessor {\n constructor(private panel) {}\n\n getSeriesList(options) {\n if (!options.dataList || options.dataList.length === 0) {\n return [];\n }\n\n // auto detect xaxis mode\n var firstItem;\n if (options.dataList && options.dataList.length > 0) {\n firstItem = options.dataList[0];\n let autoDetectMode = this.getAutoDetectXAxisMode(firstItem);\n if (this.panel.xaxis.mode !== autoDetectMode) {\n this.panel.xaxis.mode = autoDetectMode;\n this.setPanelDefaultsForNewXAxisMode();\n }\n }\n\n switch (this.panel.xaxis.mode) {\n case 'series':\n case 'time': {\n return options.dataList.map((item, index) => {\n return this.timeSeriesHandler(item, index, options);\n });\n }\n case 'histogram': {\n let histogramDataList;\n if (this.panel.stack) {\n histogramDataList = options.dataList;\n } else {\n histogramDataList = [\n {\n target: 'count',\n datapoints: _.concat([], _.flatten(_.map(options.dataList, 'datapoints'))),\n },\n ];\n }\n return histogramDataList.map((item, index) => {\n return this.timeSeriesHandler(item, index, options);\n });\n }\n case 'field': {\n return this.customHandler(firstItem);\n }\n }\n }\n\n getAutoDetectXAxisMode(firstItem) {\n switch (firstItem.type) {\n case 'docs':\n return 'field';\n case 'table':\n return 'field';\n default: {\n if (this.panel.xaxis.mode === 'series') {\n return 'series';\n }\n if (this.panel.xaxis.mode === 'histogram') {\n return 'histogram';\n }\n return 'time';\n }\n }\n }\n\n setPanelDefaultsForNewXAxisMode() {\n switch (this.panel.xaxis.mode) {\n case 'time': {\n this.panel.bars = false;\n this.panel.lines = true;\n this.panel.points = false;\n this.panel.legend.show = true;\n this.panel.tooltip.shared = true;\n this.panel.xaxis.values = [];\n break;\n }\n case 'series': {\n this.panel.bars = true;\n this.panel.lines = false;\n this.panel.points = false;\n this.panel.stack = false;\n this.panel.legend.show = false;\n this.panel.tooltip.shared = false;\n this.panel.xaxis.values = ['total'];\n break;\n }\n case 'histogram': {\n this.panel.bars = true;\n this.panel.lines = false;\n this.panel.points = false;\n this.panel.stack = false;\n this.panel.legend.show = false;\n this.panel.tooltip.shared = false;\n break;\n }\n }\n }\n\n timeSeriesHandler(seriesData, index, options) {\n var datapoints = seriesData.datapoints || [];\n var alias = seriesData.target;\n\n var colorIndex = index % colors.length;\n var color = this.panel.aliasColors[alias] || colors[colorIndex];\n\n var series = new TimeSeries({\n datapoints: datapoints,\n alias: alias,\n color: color,\n unit: seriesData.unit,\n });\n\n if (datapoints && datapoints.length > 0) {\n var last = datapoints[datapoints.length - 1][1];\n var from = options.range.from;\n if (last - from < -10000) {\n series.isOutsideRange = true;\n }\n }\n\n return series;\n }\n\n customHandler(dataItem) {\n let nameField = this.panel.xaxis.name;\n if (!nameField) {\n throw {\n message: 'No field name specified to use for x-axis, check your axes settings',\n };\n }\n return [];\n }\n\n validateXAxisSeriesValue() {\n switch (this.panel.xaxis.mode) {\n case 'series': {\n if (this.panel.xaxis.values.length === 0) {\n this.panel.xaxis.values = ['total'];\n return;\n }\n\n var validOptions = this.getXAxisValueOptions({});\n var found = _.find(validOptions, { value: this.panel.xaxis.values[0] });\n if (!found) {\n this.panel.xaxis.values = ['total'];\n }\n return;\n }\n }\n }\n\n getDataFieldNames(dataList, onlyNumbers) {\n if (dataList.length === 0) {\n return [];\n }\n\n let fields = [];\n var firstItem = dataList[0];\n let fieldParts = [];\n\n function getPropertiesRecursive(obj) {\n _.forEach(obj, (value, key) => {\n if (_.isObject(value)) {\n fieldParts.push(key);\n getPropertiesRecursive(value);\n } else {\n if (!onlyNumbers || _.isNumber(value)) {\n let field = fieldParts.concat(key).join('.');\n fields.push(field);\n }\n }\n });\n fieldParts.pop();\n }\n\n if (firstItem.type === 'docs') {\n if (firstItem.datapoints.length === 0) {\n return [];\n }\n getPropertiesRecursive(firstItem.datapoints[0]);\n }\n\n return fields;\n }\n\n getXAxisValueOptions(options) {\n switch (this.panel.xaxis.mode) {\n case 'series': {\n return [\n { text: 'Avg', value: 'avg' },\n { text: 'Min', value: 'min' },\n { text: 'Max', value: 'max' },\n { text: 'Total', value: 'total' },\n { text: 'Count', value: 'count' },\n ];\n }\n }\n\n return [];\n }\n\n pluckDeep(obj: any, property: string) {\n let propertyParts = property.split('.');\n let value = obj;\n for (let i = 0; i < propertyParts.length; ++i) {\n if (value[propertyParts[i]]) {\n value = value[propertyParts[i]];\n } else {\n return undefined;\n }\n }\n return value;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/graph/data_processor.ts","import kbn from 'app/core/utils/kbn';\n\nexport class AxesEditorCtrl {\n panel: any;\n panelCtrl: any;\n unitFormats: any;\n logScales: any;\n xAxisModes: any;\n xAxisStatOptions: any;\n xNameSegment: any;\n\n /** @ngInject **/\n constructor(private $scope, private $q) {\n this.panelCtrl = $scope.ctrl;\n this.panel = this.panelCtrl.panel;\n this.$scope.ctrl = this;\n\n this.unitFormats = kbn.getUnitFormats();\n\n this.logScales = {\n linear: 1,\n 'log (base 2)': 2,\n 'log (base 10)': 10,\n 'log (base 32)': 32,\n 'log (base 1024)': 1024,\n };\n\n this.xAxisModes = {\n Time: 'time',\n Series: 'series',\n Histogram: 'histogram',\n // 'Data field': 'field',\n };\n\n this.xAxisStatOptions = [\n { text: 'Avg', value: 'avg' },\n { text: 'Min', value: 'min' },\n { text: 'Max', value: 'max' },\n { text: 'Total', value: 'total' },\n { text: 'Count', value: 'count' },\n { text: 'Current', value: 'current' },\n ];\n\n if (this.panel.xaxis.mode === 'custom') {\n if (!this.panel.xaxis.name) {\n this.panel.xaxis.name = 'specify field';\n }\n }\n }\n\n setUnitFormat(axis, subItem) {\n axis.format = subItem.value;\n this.panelCtrl.render();\n }\n\n render() {\n this.panelCtrl.render();\n }\n\n xAxisModeChanged() {\n this.panelCtrl.processor.setPanelDefaultsForNewXAxisMode();\n this.panelCtrl.onDataReceived(this.panelCtrl.dataList);\n }\n\n xAxisValueChanged() {\n this.panelCtrl.onDataReceived(this.panelCtrl.dataList);\n }\n\n getDataFieldNames(onlyNumbers) {\n var props = this.panelCtrl.processor.getDataFieldNames(this.panelCtrl.dataList, onlyNumbers);\n var items = props.map(prop => {\n return { text: prop, value: prop };\n });\n\n return this.$q.when(items);\n }\n}\n\n/** @ngInject **/\nexport function axesEditorComponent() {\n 'use strict';\n return {\n restrict: 'E',\n scope: true,\n templateUrl: 'public/app/plugins/panel/graph/axes_editor.html',\n controller: AxesEditorCtrl,\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/graph/axes_editor.ts","import _ from 'lodash';\nimport { GraphCtrl } from '../graph/module';\n\ninterface SensorTarget {\n sensor: any;\n experiment: any;\n descriptor: TargetDescriptor;\n}\n\ninterface TargetDescriptor {\n sensorShortName: string;\n experimentId: number;\n alias: string;\n}\n\nclass SensorCtrl extends GraphCtrl {\n experiment: any;\n\n /** @ngInject */\n constructor($scope, $injector, annotationsSrv, private sensorSrv, private experimentSrv) {\n super($scope, $injector, annotationsSrv);\n\n this.panel.targets = [];\n\n // In snapshot mode, all sensor data is stored in the json model by the\n // underlying metrics_panel_ctrl, so no need to generate targets to fetch\n // data from influx\n if (!this.dashboard.snapshot) {\n experimentSrv.getCurrent().then(exp => {\n this.experiment = exp;\n\n this.loadTargets().then(\n (targets: SensorTarget[]) => {\n let validTargets = targets.filter(target => target.sensor);\n\n if (validTargets.length === 0) {\n if (targets.length > 1) {\n let shortNames = targets.map(t => t.descriptor.sensorShortName);\n this.panel.title = `No valid target found: ${shortNames.join(' ')}`;\n } else {\n this.panel.title = `Sensor not found: ${targets[0].descriptor.sensorShortName}`;\n }\n this.panel.showEcuEvents = false;\n return;\n }\n\n this.panel.targets = targets.map((target: SensorTarget) => this.buildTarget(target));\n\n this.setTitle(targets);\n this.initEcuFlag(targets);\n this.refresh();\n },\n err => {\n this.panel.title = 'Uh-oh!';\n this.dataWarning = {\n title: ' ' + '
    This experiment or sensor was deleted.',\n };\n }\n );\n });\n }\n\n this.events.on('refresh', this.onSensorPanelRefresh.bind(this));\n this.events.on('init-edit-mode', this.addSensorEditTab.bind(this));\n }\n\n private addSensorEditTab() {\n this.addEditorTab('Sensors', 'public/app/plugins/panel/sensor/partials/tab.html', 1);\n }\n\n private onSensorPanelRefresh() {\n // If loading from a snapshot, regenerate title based on snapshotData\n // stored in metrics_panel_ctrl.ts\n if (this.panel.snapshotData && this.panel.snapshotData.length > 0) {\n let targets = this.panel.snapshotData.map(d => d.target);\n\n if (!this.panel.hasCustomTitle) {\n if (targets.length > 1) {\n this.panel.title = 'Various sensors';\n } else {\n this.panel.title = targets[0];\n }\n }\n }\n }\n\n aliasChanged(shortName, alias) {\n let dbTarget = _.filter(this.panel.targets, t => t.sensorShortName === shortName)[0];\n dbTarget.alias = alias;\n this.refresh();\n }\n\n canDrop($data) {\n return $data.hasOwnProperty('sensor');\n }\n\n onDrop($data) {\n console.log('DROP DATA', $data);\n let { sensor, experiment } = $data;\n\n this.panel.sensorTargets.push({\n sensorShortName: sensor.shortName,\n experimentId: experiment.id,\n });\n\n let target: SensorTarget = {\n sensor: this.sensorSrv.get(sensor.shortName),\n experiment: experiment,\n descriptor: null,\n };\n\n this.panel.targets.push(this.buildTarget(target));\n this.refresh();\n }\n\n initEcuFlag(targets) {\n let foreignTargets = targets.filter(\n t => t.experiment && t.experiment.id !== -1 && t.experiment.id !== this.experiment.id\n );\n\n this.panel.showEcuEvents = foreignTargets.length === 0;\n }\n\n setTitle(targets) {\n if (this.panel.hasCustomTitle) {\n return;\n }\n if (targets.length > 1) {\n this.panel.title = 'Various sensors';\n return;\n }\n\n this.panel.title = this.buildSensorAlias(targets[0]);\n }\n\n loadTargets(): Promise {\n let promises: Promise[] = this.panel.sensorTargets.map(target => this.loadTargetInfo(target));\n return Promise.all(promises);\n }\n\n getSensorForExperiment(sensorShortName, experiment) {\n let sensor = this.sensorSrv.get(sensorShortName);\n if (!sensor) {\n return null;\n }\n if (!experiment.sensorIds) {\n return null;\n }\n if (experiment.sensorIds.indexOf(sensor.id) === -1) {\n return null;\n }\n return sensor;\n }\n\n loadTargetInfo(descriptor: TargetDescriptor): Promise {\n return new Promise((resolve, reject) => {\n let result: SensorTarget = {\n descriptor: descriptor,\n experiment: null,\n sensor: null,\n };\n\n if (descriptor.experimentId === -1) {\n result.sensor = this.getSensorForExperiment(descriptor.sensorShortName, this.experiment);\n result.experiment = { id: -1 };\n resolve(result);\n } else {\n this.experimentSrv.get(descriptor.experimentId).then(\n experiment => {\n result.sensor = this.getSensorForExperiment(descriptor.sensorShortName, experiment);\n result.experiment = experiment;\n resolve(result);\n },\n err => {\n reject(err);\n err.isHandled = true;\n }\n );\n }\n });\n }\n\n buildQuery(target: SensorTarget) {\n let { sensor, experiment } = target;\n let experimentIdQuery = experiment.id !== -1 ? experiment.id : '$experiment_id';\n let query =\n `SELECT mean(\"sensor${sensor.databaseId}\") ` +\n `FROM \"experiment${experimentIdQuery}\" ` +\n `WHERE $timeFilter GROUP BY time($resolution) fill(null)`;\n return query;\n }\n\n buildSensorAlias(target: SensorTarget) {\n if (target.descriptor && target.descriptor.alias) {\n return target.descriptor.alias;\n }\n\n let { sensor, experiment } = target;\n let alias = sensor.shortName;\n\n if (experiment.id !== -1) {\n alias = `${experiment.title} - ${alias}`;\n }\n if (sensor.description) {\n alias = `${alias} - ${sensor.description}`;\n }\n return alias;\n }\n\n buildTarget(target: SensorTarget) {\n if (!target.sensor) {\n return {};\n }\n\n let query = this.buildQuery(target);\n\n let dbtarget = {\n dsType: 'influxdb',\n rawQuery: true,\n alias: this.buildSensorAlias(target),\n query: query,\n sensorShortName: target.sensor && target.sensor.shortName,\n };\n\n return dbtarget;\n }\n}\n\nexport { SensorCtrl, SensorCtrl as PanelCtrl };\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/sensor/module.ts","import _ from 'lodash';\nimport { PanelCtrl } from 'app/plugins/sdk';\nimport impressionSrv from 'app/core/services/impression_srv';\n\nclass DashListCtrl extends PanelCtrl {\n static templateUrl = 'module.html';\n static scrollable = true;\n\n groups: any[];\n modes: any[];\n\n panelDefaults = {\n query: '',\n limit: 10,\n tags: [],\n recent: false,\n search: false,\n starred: true,\n headings: true,\n folderId: null,\n };\n\n /** @ngInject */\n constructor($scope, $injector, private backendSrv, private dashboardSrv) {\n super($scope, $injector);\n _.defaults(this.panel, this.panelDefaults);\n\n if (this.panel.tag) {\n this.panel.tags = [this.panel.tag];\n delete this.panel.tag;\n }\n\n this.events.on('refresh', this.onRefresh.bind(this));\n this.events.on('init-edit-mode', this.onInitEditMode.bind(this));\n\n this.groups = [\n { list: [], show: false, header: 'Starred dashboards' },\n { list: [], show: false, header: 'Recently viewed dashboards' },\n { list: [], show: false, header: 'Search' },\n ];\n\n // update capability\n if (this.panel.mode) {\n if (this.panel.mode === 'starred') {\n this.panel.starred = true;\n this.panel.headings = false;\n }\n if (this.panel.mode === 'recently viewed') {\n this.panel.recent = true;\n this.panel.starred = false;\n this.panel.headings = false;\n }\n if (this.panel.mode === 'search') {\n this.panel.search = true;\n this.panel.starred = false;\n this.panel.headings = false;\n }\n delete this.panel.mode;\n }\n }\n\n onInitEditMode() {\n this.editorTabIndex = 1;\n this.modes = ['starred', 'search', 'recently viewed'];\n this.addEditorTab('Options', 'public/app/plugins/panel/dashlist/editor.html');\n }\n\n onRefresh() {\n var promises = [];\n\n promises.push(this.getRecentDashboards());\n promises.push(this.getStarred());\n promises.push(this.getSearch());\n\n return Promise.all(promises).then(this.renderingCompleted.bind(this));\n }\n\n getSearch() {\n this.groups[2].show = this.panel.search;\n if (!this.panel.search) {\n return Promise.resolve();\n }\n\n var params = {\n limit: this.panel.limit,\n query: this.panel.query,\n tag: this.panel.tags,\n folderIds: this.panel.folderId,\n type: 'dash-db',\n };\n\n return this.backendSrv.search(params).then(result => {\n this.groups[2].list = result;\n });\n }\n\n getStarred() {\n this.groups[0].show = this.panel.starred;\n if (!this.panel.starred) {\n return Promise.resolve();\n }\n\n var params = { limit: this.panel.limit, starred: 'true' };\n return this.backendSrv.search(params).then(result => {\n this.groups[0].list = result;\n });\n }\n\n starDashboard(dash, evt) {\n this.dashboardSrv.starDashboard(dash.id, dash.isStarred).then(newState => {\n dash.isStarred = newState;\n });\n\n if (evt) {\n evt.stopPropagation();\n evt.preventDefault();\n }\n }\n\n getRecentDashboards() {\n this.groups[1].show = this.panel.recent;\n if (!this.panel.recent) {\n return Promise.resolve();\n }\n\n var dashIds = _.take(impressionSrv.getDashboardOpened(), this.panel.limit);\n return this.backendSrv.search({ dashboardIds: dashIds, limit: this.panel.limit }).then(result => {\n this.groups[1].list = dashIds\n .map(orderId => {\n return _.find(result, dashboard => {\n return dashboard.id === orderId;\n });\n })\n .filter(el => {\n return el !== undefined;\n });\n });\n }\n\n onFolderChange(folder: any) {\n this.panel.folderId = folder.id;\n this.refresh();\n }\n}\n\nexport { DashListCtrl, DashListCtrl as PanelCtrl };\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/dashlist/module.ts","import _ from 'lodash';\nimport { PanelCtrl } from '../../../features/panel/panel_ctrl';\n\nclass PluginListCtrl extends PanelCtrl {\n static templateUrl = 'module.html';\n static scrollable = true;\n\n pluginList: any[];\n viewModel: any;\n\n // Set and populate defaults\n panelDefaults = {};\n\n /** @ngInject */\n constructor($scope, $injector, private backendSrv) {\n super($scope, $injector);\n\n _.defaults(this.panel, this.panelDefaults);\n\n this.events.on('init-edit-mode', this.onInitEditMode.bind(this));\n this.pluginList = [];\n this.viewModel = [\n { header: 'Installed Apps', list: [], type: 'app' },\n { header: 'Installed Panels', list: [], type: 'panel' },\n { header: 'Installed Datasources', list: [], type: 'datasource' },\n ];\n\n this.update();\n }\n\n onInitEditMode() {\n this.editorTabIndex = 1;\n this.addEditorTab('Options', 'public/app/plugins/panel/pluginlist/editor.html');\n }\n\n gotoPlugin(plugin, evt) {\n if (evt) {\n evt.stopPropagation();\n }\n this.$location.url(`plugins/${plugin.id}/edit`);\n }\n\n updateAvailable(plugin, $event) {\n $event.stopPropagation();\n $event.preventDefault();\n\n var modalScope = this.$scope.$new(true);\n modalScope.plugin = plugin;\n\n this.publishAppEvent('show-modal', {\n src: 'public/app/features/plugins/partials/update_instructions.html',\n scope: modalScope,\n });\n }\n\n update() {\n this.backendSrv.get('api/plugins', { embedded: 0, core: 0 }).then(plugins => {\n this.pluginList = plugins;\n this.viewModel[0].list = _.filter(plugins, { type: 'app' });\n this.viewModel[1].list = _.filter(plugins, { type: 'panel' });\n this.viewModel[2].list = _.filter(plugins, { type: 'datasource' });\n\n for (let plugin of this.pluginList) {\n if (plugin.hasUpdate) {\n plugin.state = 'has-update';\n } else if (!plugin.enabled) {\n plugin.state = 'not-enabled';\n }\n }\n });\n }\n}\n\nexport { PluginListCtrl, PluginListCtrl as PanelCtrl };\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/pluginlist/module.ts","import _ from 'lodash';\nimport moment from 'moment';\nimport alertDef from '../../../features/alerting/alert_def';\nimport { PanelCtrl } from 'app/plugins/sdk';\n\nimport * as dateMath from 'app/core/utils/datemath';\n\nclass AlertListPanel extends PanelCtrl {\n static templateUrl = 'module.html';\n static scrollable = true;\n\n showOptions = [{ text: 'Current state', value: 'current' }, { text: 'Recent state changes', value: 'changes' }];\n\n sortOrderOptions = [\n { text: 'Alphabetical (asc)', value: 1 },\n { text: 'Alphabetical (desc)', value: 2 },\n { text: 'Importance', value: 3 },\n ];\n\n stateFilter: any = {};\n currentAlerts: any = [];\n alertHistory: any = [];\n noAlertsMessage: string;\n\n // Set and populate defaults\n panelDefaults = {\n show: 'current',\n limit: 10,\n stateFilter: [],\n onlyAlertsOnDashboard: false,\n sortOrder: 1,\n dashboardFilter: '',\n nameFilter: '',\n folderId: null,\n };\n\n /** @ngInject */\n constructor($scope, $injector, private backendSrv) {\n super($scope, $injector);\n _.defaults(this.panel, this.panelDefaults);\n\n this.events.on('init-edit-mode', this.onInitEditMode.bind(this));\n this.events.on('refresh', this.onRefresh.bind(this));\n\n for (let key in this.panel.stateFilter) {\n this.stateFilter[this.panel.stateFilter[key]] = true;\n }\n }\n\n sortResult(alerts) {\n if (this.panel.sortOrder === 3) {\n return _.sortBy(alerts, a => {\n return alertDef.alertStateSortScore[a.state];\n });\n }\n\n var result = _.sortBy(alerts, a => {\n return a.name.toLowerCase();\n });\n if (this.panel.sortOrder === 2) {\n result.reverse();\n }\n\n return result;\n }\n\n updateStateFilter() {\n var result = [];\n\n for (let key in this.stateFilter) {\n if (this.stateFilter[key]) {\n result.push(key);\n }\n }\n\n this.panel.stateFilter = result;\n this.onRefresh();\n }\n\n onRefresh() {\n let getAlertsPromise;\n\n if (this.panel.show === 'current') {\n getAlertsPromise = this.getCurrentAlertState();\n }\n\n if (this.panel.show === 'changes') {\n getAlertsPromise = this.getStateChanges();\n }\n\n getAlertsPromise.then(() => {\n this.renderingCompleted();\n });\n }\n\n onFolderChange(folder: any) {\n this.panel.folderId = folder.id;\n this.refresh();\n }\n\n getStateChanges() {\n var params: any = {\n limit: this.panel.limit,\n type: 'alert',\n newState: this.panel.stateFilter,\n };\n\n if (this.panel.onlyAlertsOnDashboard) {\n params.dashboardId = this.dashboard.id;\n }\n\n params.from = dateMath.parse(this.dashboard.time.from).unix() * 1000;\n params.to = dateMath.parse(this.dashboard.time.to).unix() * 1000;\n\n return this.backendSrv.get(`/api/annotations`, params).then(res => {\n this.alertHistory = _.map(res, al => {\n al.time = this.dashboard.formatDate(al.time, 'MMM D, YYYY HH:mm:ss');\n al.stateModel = alertDef.getStateDisplayModel(al.newState);\n al.info = alertDef.getAlertAnnotationInfo(al);\n return al;\n });\n\n this.noAlertsMessage = this.alertHistory.length === 0 ? 'No alerts in current time range' : '';\n\n return this.alertHistory;\n });\n }\n\n getCurrentAlertState() {\n var params: any = {\n state: this.panel.stateFilter,\n };\n\n if (this.panel.nameFilter) {\n params.query = this.panel.nameFilter;\n }\n\n if (this.panel.folderId >= 0) {\n params.folderId = this.panel.folderId;\n }\n\n if (this.panel.dashboardFilter) {\n params.dashboardQuery = this.panel.dashboardFilter;\n }\n\n if (this.panel.onlyAlertsOnDashboard) {\n params.dashboardId = this.dashboard.id;\n }\n\n if (this.panel.dashboardTags) {\n params.dashboardTag = this.panel.dashboardTags;\n }\n\n return this.backendSrv.get(`/api/alerts`, params).then(res => {\n this.currentAlerts = this.sortResult(\n _.map(res, al => {\n al.stateModel = alertDef.getStateDisplayModel(al.state);\n al.newStateDateAgo = moment(al.newStateDate)\n .locale('en')\n .fromNow(true);\n return al;\n })\n );\n if (this.currentAlerts.length > this.panel.limit) {\n this.currentAlerts = this.currentAlerts.slice(0, this.panel.limit);\n }\n this.noAlertsMessage = this.currentAlerts.length === 0 ? 'No alerts' : '';\n\n return this.currentAlerts;\n });\n }\n\n onInitEditMode() {\n this.addEditorTab('Options', 'public/app/plugins/panel/alertlist/editor.html');\n }\n}\n\nexport { AlertListPanel, AlertListPanel as PanelCtrl };\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/alertlist/module.ts","import './color_legend';\nimport { HeatmapCtrl } from './heatmap_ctrl';\n\nexport { HeatmapCtrl as PanelCtrl };\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/heatmap/module.ts","import angular from 'angular';\nimport _ from 'lodash';\nimport $ from 'jquery';\nimport * as d3 from 'd3';\nimport { contextSrv } from 'app/core/core';\nimport { tickStep } from 'app/core/utils/ticks';\nimport { getColorScale, getOpacityScale } from './color_scale';\n\nlet module = angular.module('grafana.directives');\n\nconst LEGEND_HEIGHT_PX = 6;\nconst LEGEND_WIDTH_PX = 100;\nconst LEGEND_TICK_SIZE = 0;\nconst LEGEND_VALUE_MARGIN = 0;\n\n/**\n * Color legend for heatmap editor.\n */\nmodule.directive('colorLegend', function() {\n return {\n restrict: 'E',\n template: '
    ',\n link: function(scope, elem, attrs) {\n let ctrl = scope.ctrl;\n let panel = scope.ctrl.panel;\n\n render();\n\n ctrl.events.on('render', function() {\n render();\n });\n\n function render() {\n let legendElem = $(elem).find('svg');\n let legendWidth = Math.floor(legendElem.outerWidth());\n\n if (panel.color.mode === 'spectrum') {\n let colorScheme = _.find(ctrl.colorSchemes, {\n value: panel.color.colorScheme,\n });\n let colorScale = getColorScale(colorScheme, contextSrv.user.lightTheme, legendWidth);\n drawSimpleColorLegend(elem, colorScale);\n } else if (panel.color.mode === 'opacity') {\n let colorOptions = panel.color;\n drawSimpleOpacityLegend(elem, colorOptions);\n }\n }\n },\n };\n});\n\n/**\n * Heatmap legend with scale values.\n */\nmodule.directive('heatmapLegend', function() {\n return {\n restrict: 'E',\n template: `
    `,\n link: function(scope, elem, attrs) {\n let ctrl = scope.ctrl;\n let panel = scope.ctrl.panel;\n\n render();\n ctrl.events.on('render', function() {\n render();\n });\n\n function render() {\n clearLegend(elem);\n if (!_.isEmpty(ctrl.data) && !_.isEmpty(ctrl.data.cards)) {\n let rangeFrom = 0;\n let rangeTo = ctrl.data.cardStats.max;\n let maxValue = panel.color.max || rangeTo;\n let minValue = panel.color.min || 0;\n\n if (panel.color.mode === 'spectrum') {\n let colorScheme = _.find(ctrl.colorSchemes, {\n value: panel.color.colorScheme,\n });\n drawColorLegend(elem, colorScheme, rangeFrom, rangeTo, maxValue, minValue);\n } else if (panel.color.mode === 'opacity') {\n let colorOptions = panel.color;\n drawOpacityLegend(elem, colorOptions, rangeFrom, rangeTo, maxValue, minValue);\n }\n }\n }\n },\n };\n});\n\nfunction drawColorLegend(elem, colorScheme, rangeFrom, rangeTo, maxValue, minValue) {\n let legendElem = $(elem).find('svg');\n let legend = d3.select(legendElem.get(0));\n clearLegend(elem);\n\n let legendWidth = Math.floor(legendElem.outerWidth()) - 30;\n let legendHeight = legendElem.attr('height');\n\n let rangeStep = 1;\n if (rangeTo - rangeFrom > legendWidth) {\n rangeStep = Math.floor((rangeTo - rangeFrom) / legendWidth);\n }\n let widthFactor = legendWidth / (rangeTo - rangeFrom);\n let valuesRange = d3.range(rangeFrom, rangeTo, rangeStep);\n\n let colorScale = getColorScale(colorScheme, contextSrv.user.lightTheme, maxValue, minValue);\n legend\n .selectAll('.heatmap-color-legend-rect')\n .data(valuesRange)\n .enter()\n .append('rect')\n .attr('x', d => d * widthFactor)\n .attr('y', 0)\n .attr('width', rangeStep * widthFactor + 1) // Overlap rectangles to prevent gaps\n .attr('height', legendHeight)\n .attr('stroke-width', 0)\n .attr('fill', d => colorScale(d));\n\n drawLegendValues(elem, colorScale, rangeFrom, rangeTo, maxValue, minValue, legendWidth);\n}\n\nfunction drawOpacityLegend(elem, options, rangeFrom, rangeTo, maxValue, minValue) {\n let legendElem = $(elem).find('svg');\n let legend = d3.select(legendElem.get(0));\n clearLegend(elem);\n\n let legendWidth = Math.floor(legendElem.outerWidth()) - 30;\n let legendHeight = legendElem.attr('height');\n\n let rangeStep = 1;\n if (rangeTo - rangeFrom > legendWidth) {\n rangeStep = Math.floor((rangeTo - rangeFrom) / legendWidth);\n }\n let widthFactor = legendWidth / (rangeTo - rangeFrom);\n let valuesRange = d3.range(rangeFrom, rangeTo, rangeStep);\n\n let opacityScale = getOpacityScale(options, maxValue, minValue);\n legend\n .selectAll('.heatmap-opacity-legend-rect')\n .data(valuesRange)\n .enter()\n .append('rect')\n .attr('x', d => d * widthFactor)\n .attr('y', 0)\n .attr('width', rangeStep * widthFactor)\n .attr('height', legendHeight)\n .attr('stroke-width', 0)\n .attr('fill', options.cardColor)\n .style('opacity', d => opacityScale(d));\n\n drawLegendValues(elem, opacityScale, rangeFrom, rangeTo, maxValue, minValue, legendWidth);\n}\n\nfunction drawLegendValues(elem, colorScale, rangeFrom, rangeTo, maxValue, minValue, legendWidth) {\n let legendElem = $(elem).find('svg');\n let legend = d3.select(legendElem.get(0));\n\n if (legendWidth <= 0 || legendElem.get(0).childNodes.length === 0) {\n return;\n }\n\n let legendValueScale = d3\n .scaleLinear()\n .domain([0, rangeTo])\n .range([0, legendWidth]);\n\n let ticks = buildLegendTicks(0, rangeTo, maxValue, minValue);\n let xAxis = d3\n .axisBottom(legendValueScale)\n .tickValues(ticks)\n .tickSize(LEGEND_TICK_SIZE);\n\n let colorRect = legendElem.find(':first-child');\n let posY = getSvgElemHeight(legendElem) + LEGEND_VALUE_MARGIN;\n let posX = getSvgElemX(colorRect);\n\n d3\n .select(legendElem.get(0))\n .append('g')\n .attr('class', 'axis')\n .attr('transform', 'translate(' + posX + ',' + posY + ')')\n .call(xAxis);\n\n legend\n .select('.axis')\n .select('.domain')\n .remove();\n}\n\nfunction drawSimpleColorLegend(elem, colorScale) {\n let legendElem = $(elem).find('svg');\n clearLegend(elem);\n\n let legendWidth = Math.floor(legendElem.outerWidth());\n let legendHeight = legendElem.attr('height');\n\n if (legendWidth) {\n let valuesNumber = Math.floor(legendWidth / 2);\n let rangeStep = Math.floor(legendWidth / valuesNumber);\n let valuesRange = d3.range(0, legendWidth, rangeStep);\n\n let legend = d3.select(legendElem.get(0));\n var legendRects = legend.selectAll('.heatmap-color-legend-rect').data(valuesRange);\n\n legendRects\n .enter()\n .append('rect')\n .attr('x', d => d)\n .attr('y', 0)\n .attr('width', rangeStep + 1) // Overlap rectangles to prevent gaps\n .attr('height', legendHeight)\n .attr('stroke-width', 0)\n .attr('fill', d => colorScale(d));\n }\n}\n\nfunction drawSimpleOpacityLegend(elem, options) {\n let legendElem = $(elem).find('svg');\n clearLegend(elem);\n\n let legend = d3.select(legendElem.get(0));\n let legendWidth = Math.floor(legendElem.outerWidth());\n let legendHeight = legendElem.attr('height');\n\n if (legendWidth) {\n let legendOpacityScale;\n if (options.colorScale === 'linear') {\n legendOpacityScale = d3\n .scaleLinear()\n .domain([0, legendWidth])\n .range([0, 1]);\n } else if (options.colorScale === 'sqrt') {\n legendOpacityScale = d3\n .scalePow()\n .exponent(options.exponent)\n .domain([0, legendWidth])\n .range([0, 1]);\n }\n\n let rangeStep = 10;\n let valuesRange = d3.range(0, legendWidth, rangeStep);\n var legendRects = legend.selectAll('.heatmap-opacity-legend-rect').data(valuesRange);\n\n legendRects\n .enter()\n .append('rect')\n .attr('x', d => d)\n .attr('y', 0)\n .attr('width', rangeStep)\n .attr('height', legendHeight)\n .attr('stroke-width', 0)\n .attr('fill', options.cardColor)\n .style('opacity', d => legendOpacityScale(d));\n }\n}\n\nfunction clearLegend(elem) {\n let legendElem = $(elem).find('svg');\n legendElem.empty();\n}\n\nfunction getSvgElemX(elem) {\n let svgElem = elem.get(0);\n if (svgElem && svgElem.x && svgElem.x.baseVal) {\n return svgElem.x.baseVal.value;\n } else {\n return 0;\n }\n}\n\nfunction getSvgElemHeight(elem) {\n let svgElem = elem.get(0);\n if (svgElem && svgElem.height && svgElem.height.baseVal) {\n return svgElem.height.baseVal.value;\n } else {\n return 0;\n }\n}\n\nfunction buildLegendTicks(rangeFrom, rangeTo, maxValue, minValue) {\n let range = rangeTo - rangeFrom;\n let tickStepSize = tickStep(rangeFrom, rangeTo, 3);\n let ticksNum = Math.round(range / tickStepSize);\n let ticks = [];\n\n for (let i = 0; i < ticksNum; i++) {\n let current = tickStepSize * i;\n // Add user-defined min and max if it had been set\n if (isValueCloseTo(minValue, current, tickStepSize)) {\n ticks.push(minValue);\n continue;\n } else if (minValue < current) {\n ticks.push(minValue);\n }\n if (isValueCloseTo(maxValue, current, tickStepSize)) {\n ticks.push(maxValue);\n continue;\n } else if (maxValue < current) {\n ticks.push(maxValue);\n }\n ticks.push(tickStepSize * i);\n }\n if (!isValueCloseTo(maxValue, rangeTo, tickStepSize)) {\n ticks.push(maxValue);\n }\n ticks.push(rangeTo);\n ticks = _.sortBy(_.uniq(ticks));\n return ticks;\n}\n\nfunction isValueCloseTo(val, valueTo, step) {\n let diff = Math.abs(val - valueTo);\n return diff < step * 0.3;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/heatmap/color_legend.ts","import { MetricsPanelCtrl } from 'app/plugins/sdk';\nimport _ from 'lodash';\nimport kbn from 'app/core/utils/kbn';\nimport TimeSeries from 'app/core/time_series2';\nimport { axesEditor } from './axes_editor';\nimport { heatmapDisplayEditor } from './display_editor';\nimport rendering from './rendering';\nimport {\n convertToHeatMap,\n convertToCards,\n histogramToHeatmap,\n calculateBucketSize,\n sortSeriesByLabel,\n} from './heatmap_data_converter';\n\nlet X_BUCKET_NUMBER_DEFAULT = 30;\nlet Y_BUCKET_NUMBER_DEFAULT = 10;\n\nlet panelDefaults = {\n heatmap: {},\n cards: {\n cardPadding: null,\n cardRound: null,\n },\n color: {\n mode: 'spectrum',\n cardColor: '#b4ff00',\n colorScale: 'sqrt',\n exponent: 0.5,\n colorScheme: 'interpolateOranges',\n },\n legend: {\n show: false,\n },\n dataFormat: 'timeseries',\n yBucketBound: 'auto',\n xAxis: {\n show: true,\n },\n yAxis: {\n show: true,\n format: 'short',\n decimals: null,\n logBase: 1,\n splitFactor: null,\n min: null,\n max: null,\n },\n xBucketSize: null,\n xBucketNumber: null,\n yBucketSize: null,\n yBucketNumber: null,\n tooltip: {\n show: true,\n showHistogram: false,\n },\n highlightCards: true,\n};\n\nlet colorModes = ['opacity', 'spectrum'];\nlet opacityScales = ['linear', 'sqrt'];\n\n// Schemes from d3-scale-chromatic\n// https://github.com/d3/d3-scale-chromatic\nlet colorSchemes = [\n // Diverging\n { name: 'Spectral', value: 'interpolateSpectral', invert: 'always' },\n { name: 'RdYlGn', value: 'interpolateRdYlGn', invert: 'always' },\n\n // Sequential (Single Hue)\n { name: 'Blues', value: 'interpolateBlues', invert: 'dark' },\n { name: 'Greens', value: 'interpolateGreens', invert: 'dark' },\n { name: 'Greys', value: 'interpolateGreys', invert: 'dark' },\n { name: 'Oranges', value: 'interpolateOranges', invert: 'dark' },\n { name: 'Purples', value: 'interpolatePurples', invert: 'dark' },\n { name: 'Reds', value: 'interpolateReds', invert: 'dark' },\n\n // Sequential (Multi-Hue)\n { name: 'BuGn', value: 'interpolateBuGn', invert: 'dark' },\n { name: 'BuPu', value: 'interpolateBuPu', invert: 'dark' },\n { name: 'GnBu', value: 'interpolateGnBu', invert: 'dark' },\n { name: 'OrRd', value: 'interpolateOrRd', invert: 'dark' },\n { name: 'PuBuGn', value: 'interpolatePuBuGn', invert: 'dark' },\n { name: 'PuBu', value: 'interpolatePuBu', invert: 'dark' },\n { name: 'PuRd', value: 'interpolatePuRd', invert: 'dark' },\n { name: 'RdPu', value: 'interpolateRdPu', invert: 'dark' },\n { name: 'YlGnBu', value: 'interpolateYlGnBu', invert: 'dark' },\n { name: 'YlGn', value: 'interpolateYlGn', invert: 'dark' },\n { name: 'YlOrBr', value: 'interpolateYlOrBr', invert: 'dark' },\n { name: 'YlOrRd', value: 'interpolateYlOrRd', invert: 'darm' },\n];\n\nconst ds_support_histogram_sort = ['prometheus', 'elasticsearch'];\n\nexport class HeatmapCtrl extends MetricsPanelCtrl {\n static templateUrl = 'module.html';\n\n opacityScales: any = [];\n colorModes: any = [];\n colorSchemes: any = [];\n selectionActivated: boolean;\n unitFormats: any;\n data: any;\n series: any;\n timeSrv: any;\n dataWarning: any;\n decimals: number;\n scaledDecimals: number;\n\n /** @ngInject */\n constructor($scope, $injector, timeSrv) {\n super($scope, $injector);\n this.timeSrv = timeSrv;\n this.selectionActivated = false;\n\n _.defaultsDeep(this.panel, panelDefaults);\n this.opacityScales = opacityScales;\n this.colorModes = colorModes;\n this.colorSchemes = colorSchemes;\n\n // Bind grafana panel events\n this.events.on('render', this.onRender.bind(this));\n this.events.on('data-received', this.onDataReceived.bind(this));\n this.events.on('data-error', this.onDataError.bind(this));\n this.events.on('data-snapshot-load', this.onDataReceived.bind(this));\n this.events.on('init-edit-mode', this.onInitEditMode.bind(this));\n\n this.onCardColorChange = this.onCardColorChange.bind(this);\n }\n\n onInitEditMode() {\n this.addEditorTab('Axes', axesEditor, 2);\n this.addEditorTab('Display', heatmapDisplayEditor, 3);\n this.unitFormats = kbn.getUnitFormats();\n }\n\n zoomOut(evt) {\n this.publishAppEvent('zoom-out', 2);\n }\n\n onRender() {\n if (!this.range) {\n return;\n }\n\n if (this.panel.dataFormat === 'tsbuckets') {\n this.convertHistogramToHeatmapData();\n } else {\n this.convertTimeSeriesToHeatmapData();\n }\n }\n\n convertTimeSeriesToHeatmapData() {\n let xBucketSize, yBucketSize, bucketsData, heatmapStats;\n const logBase = this.panel.yAxis.logBase;\n\n let xBucketNumber = this.panel.xBucketNumber || X_BUCKET_NUMBER_DEFAULT;\n let xBucketSizeByNumber = Math.floor((this.range.to - this.range.from) / xBucketNumber);\n\n // Parse X bucket size (number or interval)\n let isIntervalString = kbn.interval_regex.test(this.panel.xBucketSize);\n if (isIntervalString) {\n xBucketSize = kbn.interval_to_ms(this.panel.xBucketSize);\n } else if (\n isNaN(Number(this.panel.xBucketSize)) ||\n this.panel.xBucketSize === '' ||\n this.panel.xBucketSize === null\n ) {\n xBucketSize = xBucketSizeByNumber;\n } else {\n xBucketSize = Number(this.panel.xBucketSize);\n }\n\n // Calculate Y bucket size\n heatmapStats = this.parseSeries(this.series);\n let yBucketNumber = this.panel.yBucketNumber || Y_BUCKET_NUMBER_DEFAULT;\n if (logBase !== 1) {\n yBucketSize = this.panel.yAxis.splitFactor;\n } else {\n if (heatmapStats.max === heatmapStats.min) {\n if (heatmapStats.max) {\n yBucketSize = heatmapStats.max / Y_BUCKET_NUMBER_DEFAULT;\n } else {\n yBucketSize = 1;\n }\n } else {\n yBucketSize = (heatmapStats.max - heatmapStats.min) / yBucketNumber;\n }\n yBucketSize = this.panel.yBucketSize || yBucketSize;\n }\n\n bucketsData = convertToHeatMap(this.series, yBucketSize, xBucketSize, logBase);\n\n // Set default Y range if no data\n if (!heatmapStats.min && !heatmapStats.max) {\n heatmapStats = { min: -1, max: 1, minLog: 1 };\n yBucketSize = 1;\n }\n\n let { cards, cardStats } = convertToCards(bucketsData);\n\n this.data = {\n buckets: bucketsData,\n heatmapStats: heatmapStats,\n xBucketSize: xBucketSize,\n yBucketSize: yBucketSize,\n cards: cards,\n cardStats: cardStats,\n };\n }\n\n convertHistogramToHeatmapData() {\n const panelDatasource = this.getPanelDataSourceType();\n let xBucketSize, yBucketSize, bucketsData, tsBuckets;\n\n // Try to sort series by bucket bound, if datasource doesn't do it.\n if (!_.includes(ds_support_histogram_sort, panelDatasource)) {\n this.series.sort(sortSeriesByLabel);\n }\n\n // Convert histogram to heatmap. Each histogram bucket represented by the series which name is\n // a top (or bottom, depends of datasource) bucket bound. Further, these values will be used as X axis labels.\n bucketsData = histogramToHeatmap(this.series);\n\n tsBuckets = _.map(this.series, 'label');\n const yBucketBound = this.panel.yBucketBound;\n if ((panelDatasource === 'prometheus' && yBucketBound !== 'lower') || yBucketBound === 'upper') {\n // Prometheus labels are upper inclusive bounds, so add empty bottom bucket label.\n tsBuckets = [''].concat(tsBuckets);\n } else {\n // Elasticsearch uses labels as lower bucket bounds, so add empty top bucket label.\n // Use this as a default mode as well.\n tsBuckets.push('');\n }\n\n // Calculate bucket size based on heatmap data\n let xBucketBoundSet = _.map(_.keys(bucketsData), key => Number(key));\n xBucketSize = calculateBucketSize(xBucketBoundSet);\n // Always let yBucketSize=1 in 'tsbuckets' mode\n yBucketSize = 1;\n\n let { cards, cardStats } = convertToCards(bucketsData);\n\n this.data = {\n buckets: bucketsData,\n xBucketSize: xBucketSize,\n yBucketSize: yBucketSize,\n tsBuckets: tsBuckets,\n cards: cards,\n cardStats: cardStats,\n };\n }\n\n getPanelDataSourceType() {\n if (this.datasource.meta && this.datasource.meta.id) {\n return this.datasource.meta.id;\n } else {\n return 'unknown';\n }\n }\n\n onDataReceived(dataList) {\n this.series = dataList.map(this.seriesHandler.bind(this));\n\n this.dataWarning = null;\n const datapointsCount = _.reduce(\n this.series,\n (sum, series) => {\n return sum + series.datapoints.length;\n },\n 0\n );\n\n if (datapointsCount === 0) {\n this.dataWarning = {\n title: 'No data points',\n tip: 'No datapoints returned from data query',\n };\n } else {\n for (let series of this.series) {\n if (series.isOutsideRange) {\n this.dataWarning = {\n title: 'Data points outside time range',\n tip: 'Can be caused by timezone mismatch or missing time filter in query',\n };\n break;\n }\n }\n }\n\n this.render();\n }\n\n onDataError() {\n this.series = [];\n this.render();\n }\n\n onCardColorChange(newColor) {\n this.panel.color.cardColor = newColor;\n this.render();\n }\n\n seriesHandler(seriesData) {\n let series = new TimeSeries({\n datapoints: seriesData.datapoints,\n alias: seriesData.target,\n });\n\n series.flotpairs = series.getFlotPairs(this.panel.nullPointMode);\n\n let datapoints = seriesData.datapoints || [];\n if (datapoints && datapoints.length > 0) {\n let last = datapoints[datapoints.length - 1][1];\n let from = this.range.from;\n if (last - from < -10000) {\n series.isOutsideRange = true;\n }\n }\n\n return series;\n }\n\n parseSeries(series) {\n let min = _.min(_.map(series, s => s.stats.min));\n let minLog = _.min(_.map(series, s => s.stats.logmin));\n let max = _.max(_.map(series, s => s.stats.max));\n\n return {\n max: max,\n min: min,\n minLog: minLog,\n };\n }\n\n parseHistogramSeries(series) {\n let bounds = _.map(series, s => Number(s.alias));\n let min = _.min(bounds);\n let minLog = _.min(bounds);\n let max = _.max(bounds);\n\n return {\n max: max,\n min: min,\n minLog: minLog,\n };\n }\n\n link(scope, elem, attrs, ctrl) {\n rendering(scope, elem, attrs, ctrl);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/heatmap/heatmap_ctrl.ts","import kbn from 'app/core/utils/kbn';\n\nexport class AxesEditorCtrl {\n panel: any;\n panelCtrl: any;\n unitFormats: any;\n logScales: any;\n dataFormats: any;\n yBucketBoundModes: any;\n\n /** @ngInject */\n constructor($scope, uiSegmentSrv) {\n $scope.editor = this;\n this.panelCtrl = $scope.ctrl;\n this.panel = this.panelCtrl.panel;\n this.unitFormats = kbn.getUnitFormats();\n\n this.logScales = {\n linear: 1,\n 'log (base 2)': 2,\n 'log (base 10)': 10,\n 'log (base 32)': 32,\n 'log (base 1024)': 1024,\n };\n\n this.dataFormats = {\n 'Time series': 'timeseries',\n 'Time series buckets': 'tsbuckets',\n };\n\n this.yBucketBoundModes = {\n Auto: 'auto',\n Upper: 'upper',\n Lower: 'lower',\n };\n }\n\n setUnitFormat(subItem) {\n this.panel.yAxis.format = subItem.value;\n this.panelCtrl.render();\n }\n}\n\n/** @ngInject */\nexport function axesEditor() {\n 'use strict';\n return {\n restrict: 'E',\n scope: true,\n templateUrl: 'public/app/plugins/panel/heatmap/partials/axes_editor.html',\n controller: AxesEditorCtrl,\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/heatmap/axes_editor.ts","export class HeatmapDisplayEditorCtrl {\n panel: any;\n panelCtrl: any;\n\n /** @ngInject */\n constructor($scope) {\n $scope.editor = this;\n this.panelCtrl = $scope.ctrl;\n this.panel = this.panelCtrl.panel;\n\n this.panelCtrl.render();\n }\n}\n\n/** @ngInject */\nexport function heatmapDisplayEditor() {\n 'use strict';\n return {\n restrict: 'E',\n scope: true,\n templateUrl: 'public/app/plugins/panel/heatmap/partials/display_editor.html',\n controller: HeatmapDisplayEditorCtrl,\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/heatmap/display_editor.ts","import _ from 'lodash';\nimport $ from 'jquery';\nimport moment from 'moment';\nimport * as d3 from 'd3';\nimport kbn from 'app/core/utils/kbn';\nimport { appEvents, contextSrv } from 'app/core/core';\nimport * as ticksUtils from 'app/core/utils/ticks';\nimport { HeatmapTooltip } from './heatmap_tooltip';\nimport { mergeZeroBuckets } from './heatmap_data_converter';\nimport { getColorScale, getOpacityScale } from './color_scale';\n\nlet MIN_CARD_SIZE = 1,\n CARD_PADDING = 1,\n CARD_ROUND = 0,\n DATA_RANGE_WIDING_FACTOR = 1.2,\n DEFAULT_X_TICK_SIZE_PX = 100,\n DEFAULT_Y_TICK_SIZE_PX = 50,\n X_AXIS_TICK_PADDING = 10,\n Y_AXIS_TICK_PADDING = 5,\n MIN_SELECTION_WIDTH = 2;\n\nexport default function link(scope, elem, attrs, ctrl) {\n let data, timeRange, panel, heatmap;\n\n // $heatmap is JQuery object, but heatmap is D3\n let $heatmap = elem.find('.heatmap-panel');\n let tooltip = new HeatmapTooltip($heatmap, scope);\n\n let width,\n height,\n yScale,\n xScale,\n chartWidth,\n chartHeight,\n chartTop,\n chartBottom,\n yAxisWidth,\n xAxisHeight,\n cardPadding,\n cardRound,\n cardWidth,\n cardHeight,\n colorScale,\n opacityScale,\n mouseUpHandler;\n\n let selection = {\n active: false,\n x1: -1,\n x2: -1,\n };\n\n let padding = { left: 0, right: 0, top: 0, bottom: 0 },\n margin = { left: 25, right: 15, top: 10, bottom: 20 },\n dataRangeWidingFactor = DATA_RANGE_WIDING_FACTOR;\n\n ctrl.events.on('render', () => {\n render();\n ctrl.renderingCompleted();\n });\n\n function setElementHeight() {\n try {\n var height = ctrl.height || panel.height || ctrl.row.height;\n if (_.isString(height)) {\n height = parseInt(height.replace('px', ''), 10);\n }\n\n height -= panel.legend.show ? 28 : 11; // bottom padding and space for legend\n\n $heatmap.css('height', height + 'px');\n\n return true;\n } catch (e) {\n // IE throws errors sometimes\n return false;\n }\n }\n\n function getYAxisWidth(elem) {\n let axis_text = elem.selectAll('.axis-y text').nodes();\n let max_text_width = _.max(\n _.map(axis_text, text => {\n // Use SVG getBBox method\n return text.getBBox().width;\n })\n );\n\n return max_text_width;\n }\n\n function getXAxisHeight(elem) {\n let axis_line = elem.select('.axis-x line');\n if (!axis_line.empty()) {\n let axis_line_position = parseFloat(elem.select('.axis-x line').attr('y2'));\n let canvas_width = parseFloat(elem.attr('height'));\n return canvas_width - axis_line_position;\n } else {\n // Default height\n return 30;\n }\n }\n\n function addXAxis() {\n scope.xScale = xScale = d3\n .scaleTime()\n .domain([timeRange.from, timeRange.to])\n .range([0, chartWidth]);\n\n let ticks = chartWidth / DEFAULT_X_TICK_SIZE_PX;\n let grafanaTimeFormatter = ticksUtils.grafanaTimeFormat(ticks, timeRange.from, timeRange.to);\n let timeFormat;\n let dashboardTimeZone = ctrl.dashboard.getTimezone();\n if (dashboardTimeZone === 'utc') {\n timeFormat = d3.utcFormat(grafanaTimeFormatter);\n } else {\n timeFormat = d3.timeFormat(grafanaTimeFormatter);\n }\n\n let xAxis = d3\n .axisBottom(xScale)\n .ticks(ticks)\n .tickFormat(timeFormat)\n .tickPadding(X_AXIS_TICK_PADDING)\n .tickSize(chartHeight);\n\n let posY = margin.top;\n let posX = yAxisWidth;\n heatmap\n .append('g')\n .attr('class', 'axis axis-x')\n .attr('transform', 'translate(' + posX + ',' + posY + ')')\n .call(xAxis);\n\n // Remove horizontal line in the top of axis labels (called domain in d3)\n heatmap\n .select('.axis-x')\n .select('.domain')\n .remove();\n }\n\n function addYAxis() {\n let ticks = Math.ceil(chartHeight / DEFAULT_Y_TICK_SIZE_PX);\n let tick_interval = ticksUtils.tickStep(data.heatmapStats.min, data.heatmapStats.max, ticks);\n let { y_min, y_max } = wideYAxisRange(data.heatmapStats.min, data.heatmapStats.max, tick_interval);\n\n // Rewrite min and max if it have been set explicitly\n y_min = panel.yAxis.min !== null ? panel.yAxis.min : y_min;\n y_max = panel.yAxis.max !== null ? panel.yAxis.max : y_max;\n\n // Adjust ticks after Y range widening\n tick_interval = ticksUtils.tickStep(y_min, y_max, ticks);\n ticks = Math.ceil((y_max - y_min) / tick_interval);\n\n let decimalsAuto = ticksUtils.getPrecision(tick_interval);\n let decimals = panel.yAxis.decimals === null ? decimalsAuto : panel.yAxis.decimals;\n // Calculate scaledDecimals for log scales using tick size (as in jquery.flot.js)\n let flot_tick_size = ticksUtils.getFlotTickSize(y_min, y_max, ticks, decimalsAuto);\n let scaledDecimals = ticksUtils.getScaledDecimals(decimals, flot_tick_size);\n ctrl.decimals = decimals;\n ctrl.scaledDecimals = scaledDecimals;\n\n // Set default Y min and max if no data\n if (_.isEmpty(data.buckets)) {\n y_max = 1;\n y_min = -1;\n ticks = 3;\n decimals = 1;\n }\n\n data.yAxis = {\n min: y_min,\n max: y_max,\n ticks: ticks,\n };\n\n scope.yScale = yScale = d3\n .scaleLinear()\n .domain([y_min, y_max])\n .range([chartHeight, 0]);\n\n let yAxis = d3\n .axisLeft(yScale)\n .ticks(ticks)\n .tickFormat(tickValueFormatter(decimals, scaledDecimals))\n .tickSizeInner(0 - width)\n .tickSizeOuter(0)\n .tickPadding(Y_AXIS_TICK_PADDING);\n\n heatmap\n .append('g')\n .attr('class', 'axis axis-y')\n .call(yAxis);\n\n // Calculate Y axis width first, then move axis into visible area\n let posY = margin.top;\n let posX = getYAxisWidth(heatmap) + Y_AXIS_TICK_PADDING;\n heatmap.select('.axis-y').attr('transform', 'translate(' + posX + ',' + posY + ')');\n\n // Remove vertical line in the right of axis labels (called domain in d3)\n heatmap\n .select('.axis-y')\n .select('.domain')\n .remove();\n }\n\n // Wide Y values range and anjust to bucket size\n function wideYAxisRange(min, max, tickInterval) {\n let y_widing = (max * (dataRangeWidingFactor - 1) - min * (dataRangeWidingFactor - 1)) / 2;\n let y_min, y_max;\n\n if (tickInterval === 0) {\n y_max = max * dataRangeWidingFactor;\n y_min = min - min * (dataRangeWidingFactor - 1);\n tickInterval = (y_max - y_min) / 2;\n } else {\n y_max = Math.ceil((max + y_widing) / tickInterval) * tickInterval;\n y_min = Math.floor((min - y_widing) / tickInterval) * tickInterval;\n }\n\n // Don't wide axis below 0 if all values are positive\n if (min >= 0 && y_min < 0) {\n y_min = 0;\n }\n\n return { y_min, y_max };\n }\n\n function addLogYAxis() {\n let log_base = panel.yAxis.logBase;\n let { y_min, y_max } = adjustLogRange(data.heatmapStats.minLog, data.heatmapStats.max, log_base);\n\n y_min = panel.yAxis.min && panel.yAxis.min !== '0' ? adjustLogMin(panel.yAxis.min, log_base) : y_min;\n y_max = panel.yAxis.max !== null ? adjustLogMax(panel.yAxis.max, log_base) : y_max;\n\n // Set default Y min and max if no data\n if (_.isEmpty(data.buckets)) {\n y_max = Math.pow(log_base, 2);\n y_min = 1;\n }\n\n scope.yScale = yScale = d3\n .scaleLog()\n .base(panel.yAxis.logBase)\n .domain([y_min, y_max])\n .range([chartHeight, 0]);\n\n let domain = yScale.domain();\n let tick_values = logScaleTickValues(domain, log_base);\n\n let decimalsAuto = ticksUtils.getPrecision(y_min);\n let decimals = panel.yAxis.decimals || decimalsAuto;\n\n // Calculate scaledDecimals for log scales using tick size (as in jquery.flot.js)\n let flot_tick_size = ticksUtils.getFlotTickSize(y_min, y_max, tick_values.length, decimalsAuto);\n let scaledDecimals = ticksUtils.getScaledDecimals(decimals, flot_tick_size);\n ctrl.decimals = decimals;\n ctrl.scaledDecimals = scaledDecimals;\n\n data.yAxis = {\n min: y_min,\n max: y_max,\n ticks: tick_values.length,\n };\n\n let yAxis = d3\n .axisLeft(yScale)\n .tickValues(tick_values)\n .tickFormat(tickValueFormatter(decimals, scaledDecimals))\n .tickSizeInner(0 - width)\n .tickSizeOuter(0)\n .tickPadding(Y_AXIS_TICK_PADDING);\n\n heatmap\n .append('g')\n .attr('class', 'axis axis-y')\n .call(yAxis);\n\n // Calculate Y axis width first, then move axis into visible area\n let posY = margin.top;\n let posX = getYAxisWidth(heatmap) + Y_AXIS_TICK_PADDING;\n heatmap.select('.axis-y').attr('transform', 'translate(' + posX + ',' + posY + ')');\n\n // Set first tick as pseudo 0\n if (y_min < 1) {\n heatmap\n .select('.axis-y')\n .select('.tick text')\n .text('0');\n }\n\n // Remove vertical line in the right of axis labels (called domain in d3)\n heatmap\n .select('.axis-y')\n .select('.domain')\n .remove();\n }\n\n function addYAxisFromBuckets() {\n const tsBuckets = data.tsBuckets;\n\n scope.yScale = yScale = d3\n .scaleLinear()\n .domain([0, tsBuckets.length - 1])\n .range([chartHeight, 0]);\n\n const tick_values = _.map(tsBuckets, (b, i) => i);\n const decimalsAuto = _.max(_.map(tsBuckets, ticksUtils.getStringPrecision));\n const decimals = panel.yAxis.decimals === null ? decimalsAuto : panel.yAxis.decimals;\n ctrl.decimals = decimals;\n\n function tickFormatter(valIndex) {\n let valueFormatted = tsBuckets[valIndex];\n if (!_.isNaN(_.toNumber(valueFormatted)) && valueFormatted !== '') {\n // Try to format numeric tick labels\n valueFormatted = tickValueFormatter(decimals)(_.toNumber(valueFormatted));\n }\n return valueFormatted;\n }\n\n const tsBucketsFormatted = _.map(tsBuckets, (v, i) => tickFormatter(i));\n data.tsBucketsFormatted = tsBucketsFormatted;\n\n let yAxis = d3\n .axisLeft(yScale)\n .tickValues(tick_values)\n .tickFormat(tickFormatter)\n .tickSizeInner(0 - width)\n .tickSizeOuter(0)\n .tickPadding(Y_AXIS_TICK_PADDING);\n\n heatmap\n .append('g')\n .attr('class', 'axis axis-y')\n .call(yAxis);\n\n // Calculate Y axis width first, then move axis into visible area\n const posY = margin.top;\n const posX = getYAxisWidth(heatmap) + Y_AXIS_TICK_PADDING;\n heatmap.select('.axis-y').attr('transform', 'translate(' + posX + ',' + posY + ')');\n\n // Remove vertical line in the right of axis labels (called domain in d3)\n heatmap\n .select('.axis-y')\n .select('.domain')\n .remove();\n }\n\n // Adjust data range to log base\n function adjustLogRange(min, max, logBase) {\n let y_min, y_max;\n\n y_min = data.heatmapStats.minLog;\n if (data.heatmapStats.minLog > 1 || !data.heatmapStats.minLog) {\n y_min = 1;\n } else {\n y_min = adjustLogMin(data.heatmapStats.minLog, logBase);\n }\n\n // Adjust max Y value to log base\n y_max = adjustLogMax(data.heatmapStats.max, logBase);\n\n return { y_min, y_max };\n }\n\n function adjustLogMax(max, base) {\n return Math.pow(base, Math.ceil(ticksUtils.logp(max, base)));\n }\n\n function adjustLogMin(min, base) {\n return Math.pow(base, Math.floor(ticksUtils.logp(min, base)));\n }\n\n function logScaleTickValues(domain, base) {\n let domainMin = domain[0];\n let domainMax = domain[1];\n let tickValues = [];\n\n if (domainMin < 1) {\n let under_one_ticks = Math.floor(ticksUtils.logp(domainMin, base));\n for (let i = under_one_ticks; i < 0; i++) {\n let tick_value = Math.pow(base, i);\n tickValues.push(tick_value);\n }\n }\n\n let ticks = Math.ceil(ticksUtils.logp(domainMax, base));\n for (let i = 0; i <= ticks; i++) {\n let tick_value = Math.pow(base, i);\n tickValues.push(tick_value);\n }\n\n return tickValues;\n }\n\n function tickValueFormatter(decimals, scaledDecimals = null) {\n let format = panel.yAxis.format;\n return function(value) {\n try {\n return format !== 'none' ? kbn.valueFormats[format](value, decimals, scaledDecimals) : value;\n } catch (err) {\n console.error(err.message || err);\n return value;\n }\n };\n }\n\n ctrl.tickValueFormatter = tickValueFormatter;\n\n function fixYAxisTickSize() {\n heatmap\n .select('.axis-y')\n .selectAll('.tick line')\n .attr('x2', chartWidth);\n }\n\n function addAxes() {\n chartHeight = height - margin.top - margin.bottom;\n chartTop = margin.top;\n chartBottom = chartTop + chartHeight;\n\n if (panel.dataFormat === 'tsbuckets') {\n addYAxisFromBuckets();\n } else {\n if (panel.yAxis.logBase === 1) {\n addYAxis();\n } else {\n addLogYAxis();\n }\n }\n\n yAxisWidth = getYAxisWidth(heatmap) + Y_AXIS_TICK_PADDING;\n chartWidth = width - yAxisWidth - margin.right;\n fixYAxisTickSize();\n\n addXAxis();\n xAxisHeight = getXAxisHeight(heatmap);\n\n if (!panel.yAxis.show) {\n heatmap\n .select('.axis-y')\n .selectAll('line')\n .style('opacity', 0);\n }\n\n if (!panel.xAxis.show) {\n heatmap\n .select('.axis-x')\n .selectAll('line')\n .style('opacity', 0);\n }\n }\n\n function addHeatmapCanvas() {\n let heatmap_elem = $heatmap[0];\n\n width = Math.floor($heatmap.width()) - padding.right;\n height = Math.floor($heatmap.height()) - padding.bottom;\n\n cardPadding = panel.cards.cardPadding !== null ? panel.cards.cardPadding : CARD_PADDING;\n cardRound = panel.cards.cardRound !== null ? panel.cards.cardRound : CARD_ROUND;\n\n if (heatmap) {\n heatmap.remove();\n }\n\n heatmap = d3\n .select(heatmap_elem)\n .append('svg')\n .attr('width', width)\n .attr('height', height);\n }\n\n function addHeatmap() {\n addHeatmapCanvas();\n addAxes();\n\n if (panel.yAxis.logBase !== 1 && panel.dataFormat !== 'tsbuckets') {\n let log_base = panel.yAxis.logBase;\n let domain = yScale.domain();\n let tick_values = logScaleTickValues(domain, log_base);\n data.buckets = mergeZeroBuckets(data.buckets, _.min(tick_values));\n }\n\n let cardsData = data.cards;\n let maxValueAuto = data.cardStats.max;\n let maxValue = panel.color.max || maxValueAuto;\n let minValue = panel.color.min || 0;\n\n let colorScheme = _.find(ctrl.colorSchemes, {\n value: panel.color.colorScheme,\n });\n colorScale = getColorScale(colorScheme, contextSrv.user.lightTheme, maxValue, minValue);\n opacityScale = getOpacityScale(panel.color, maxValue);\n setCardSize();\n\n let cards = heatmap.selectAll('.heatmap-card').data(cardsData);\n cards.append('title');\n cards = cards\n .enter()\n .append('rect')\n .attr('x', getCardX)\n .attr('width', getCardWidth)\n .attr('y', getCardY)\n .attr('height', getCardHeight)\n .attr('rx', cardRound)\n .attr('ry', cardRound)\n .attr('class', 'bordered heatmap-card')\n .style('fill', getCardColor)\n .style('stroke', getCardColor)\n .style('stroke-width', 0)\n .style('opacity', getCardOpacity);\n\n let $cards = $heatmap.find('.heatmap-card');\n $cards\n .on('mouseenter', event => {\n tooltip.mouseOverBucket = true;\n highlightCard(event);\n })\n .on('mouseleave', event => {\n tooltip.mouseOverBucket = false;\n resetCardHighLight(event);\n });\n }\n\n function highlightCard(event) {\n let color = d3.select(event.target).style('fill');\n let highlightColor = d3.color(color).darker(2);\n let strokeColor = d3.color(color).brighter(4);\n let current_card = d3.select(event.target);\n tooltip.originalFillColor = color;\n current_card\n .style('fill', highlightColor.toString())\n .style('stroke', strokeColor.toString())\n .style('stroke-width', 1);\n }\n\n function resetCardHighLight(event) {\n d3\n .select(event.target)\n .style('fill', tooltip.originalFillColor)\n .style('stroke', tooltip.originalFillColor)\n .style('stroke-width', 0);\n }\n\n function setCardSize() {\n let xGridSize = Math.floor(xScale(data.xBucketSize) - xScale(0));\n let yGridSize = Math.floor(yScale(yScale.invert(0) - data.yBucketSize));\n\n if (panel.yAxis.logBase !== 1) {\n let base = panel.yAxis.logBase;\n let splitFactor = data.yBucketSize || 1;\n yGridSize = Math.floor((yScale(1) - yScale(base)) / splitFactor);\n }\n\n cardWidth = xGridSize - cardPadding * 2;\n cardHeight = yGridSize ? yGridSize - cardPadding * 2 : 0;\n }\n\n function getCardX(d) {\n let x;\n if (xScale(d.x) < 0) {\n // Cut card left to prevent overlay\n x = yAxisWidth + cardPadding;\n } else {\n x = xScale(d.x) + yAxisWidth + cardPadding;\n }\n\n return x;\n }\n\n function getCardWidth(d) {\n let w;\n if (xScale(d.x) < 0) {\n // Cut card left to prevent overlay\n let cutted_width = xScale(d.x) + cardWidth;\n w = cutted_width > 0 ? cutted_width : 0;\n } else if (xScale(d.x) + cardWidth > chartWidth) {\n // Cut card right to prevent overlay\n w = chartWidth - xScale(d.x) - cardPadding;\n } else {\n w = cardWidth;\n }\n\n // Card width should be MIN_CARD_SIZE at least\n w = Math.max(w, MIN_CARD_SIZE);\n return w;\n }\n\n function getCardY(d) {\n let y = yScale(d.y) + chartTop - cardHeight - cardPadding;\n if (panel.yAxis.logBase !== 1 && d.y === 0) {\n y = chartBottom - cardHeight - cardPadding;\n } else {\n if (y < chartTop) {\n y = chartTop;\n }\n }\n\n return y;\n }\n\n function getCardHeight(d) {\n let y = yScale(d.y) + chartTop - cardHeight - cardPadding;\n let h = cardHeight;\n\n if (panel.yAxis.logBase !== 1 && d.y === 0) {\n return cardHeight;\n }\n\n // Cut card height to prevent overlay\n if (y < chartTop) {\n h = yScale(d.y) - cardPadding;\n } else if (yScale(d.y) > chartBottom) {\n h = chartBottom - y;\n } else if (y + cardHeight > chartBottom) {\n h = chartBottom - y;\n }\n\n // Height can't be more than chart height\n h = Math.min(h, chartHeight);\n // Card height should be MIN_CARD_SIZE at least\n h = Math.max(h, MIN_CARD_SIZE);\n\n return h;\n }\n\n function getCardColor(d) {\n if (panel.color.mode === 'opacity') {\n return panel.color.cardColor;\n } else {\n return colorScale(d.count);\n }\n }\n\n function getCardOpacity(d) {\n if (panel.color.mode === 'opacity') {\n return opacityScale(d.count);\n } else {\n return 1;\n }\n }\n\n /////////////////////////////\n // Selection and crosshair //\n /////////////////////////////\n\n // Shared crosshair and tooltip\n appEvents.on(\n 'graph-hover',\n event => {\n drawSharedCrosshair(event.pos);\n },\n scope\n );\n\n appEvents.on(\n 'graph-hover-clear',\n () => {\n clearCrosshair();\n },\n scope\n );\n\n function onMouseDown(event) {\n selection.active = true;\n selection.x1 = event.offsetX;\n\n mouseUpHandler = function() {\n onMouseUp();\n };\n\n $(document).one('mouseup', mouseUpHandler);\n }\n\n function onMouseUp() {\n $(document).unbind('mouseup', mouseUpHandler);\n mouseUpHandler = null;\n selection.active = false;\n\n let selectionRange = Math.abs(selection.x2 - selection.x1);\n if (selection.x2 >= 0 && selectionRange > MIN_SELECTION_WIDTH) {\n let timeFrom = xScale.invert(Math.min(selection.x1, selection.x2) - yAxisWidth);\n let timeTo = xScale.invert(Math.max(selection.x1, selection.x2) - yAxisWidth);\n\n ctrl.timeSrv.setTime({\n from: moment.utc(timeFrom),\n to: moment.utc(timeTo),\n });\n }\n\n clearSelection();\n }\n\n function onMouseLeave() {\n appEvents.emit('graph-hover-clear');\n clearCrosshair();\n }\n\n function onMouseMove(event) {\n if (!heatmap) {\n return;\n }\n\n if (selection.active) {\n // Clear crosshair and tooltip\n clearCrosshair();\n tooltip.destroy();\n\n selection.x2 = limitSelection(event.offsetX);\n drawSelection(selection.x1, selection.x2);\n } else {\n emitGraphHoverEvent(event);\n drawCrosshair(event.offsetX);\n tooltip.show(event, data);\n }\n }\n\n function emitGraphHoverEvent(event) {\n let x = xScale.invert(event.offsetX - yAxisWidth).valueOf();\n let y = yScale.invert(event.offsetY);\n let pos = {\n pageX: event.pageX,\n pageY: event.pageY,\n x: x,\n x1: x,\n y: y,\n y1: y,\n panelRelY: null,\n };\n\n // Set minimum offset to prevent showing legend from another panel\n pos.panelRelY = Math.max(event.offsetY / height, 0.001);\n\n // broadcast to other graph panels that we are hovering\n appEvents.emit('graph-hover', { pos: pos, panel: panel });\n }\n\n function limitSelection(x2) {\n x2 = Math.max(x2, yAxisWidth);\n x2 = Math.min(x2, chartWidth + yAxisWidth);\n return x2;\n }\n\n function drawSelection(posX1, posX2) {\n if (heatmap) {\n heatmap.selectAll('.heatmap-selection').remove();\n let selectionX = Math.min(posX1, posX2);\n let selectionWidth = Math.abs(posX1 - posX2);\n\n if (selectionWidth > MIN_SELECTION_WIDTH) {\n heatmap\n .append('rect')\n .attr('class', 'heatmap-selection')\n .attr('x', selectionX)\n .attr('width', selectionWidth)\n .attr('y', chartTop)\n .attr('height', chartHeight);\n }\n }\n }\n\n function clearSelection() {\n selection.x1 = -1;\n selection.x2 = -1;\n\n if (heatmap) {\n heatmap.selectAll('.heatmap-selection').remove();\n }\n }\n\n function drawCrosshair(position) {\n if (heatmap) {\n heatmap.selectAll('.heatmap-crosshair').remove();\n\n let posX = position;\n posX = Math.max(posX, yAxisWidth);\n posX = Math.min(posX, chartWidth + yAxisWidth);\n\n heatmap\n .append('g')\n .attr('class', 'heatmap-crosshair')\n .attr('transform', 'translate(' + posX + ',0)')\n .append('line')\n .attr('x1', 1)\n .attr('y1', chartTop)\n .attr('x2', 1)\n .attr('y2', chartBottom)\n .attr('stroke-width', 1);\n }\n }\n\n function drawSharedCrosshair(pos) {\n if (heatmap && ctrl.dashboard.graphTooltip !== 0) {\n let posX = xScale(pos.x) + yAxisWidth;\n drawCrosshair(posX);\n }\n }\n\n function clearCrosshair() {\n if (heatmap) {\n heatmap.selectAll('.heatmap-crosshair').remove();\n }\n }\n\n function render() {\n data = ctrl.data;\n panel = ctrl.panel;\n timeRange = ctrl.range;\n\n if (!setElementHeight() || !data) {\n return;\n }\n\n // Draw default axes and return if no data\n if (_.isEmpty(data.buckets)) {\n addHeatmapCanvas();\n addAxes();\n return;\n }\n\n addHeatmap();\n scope.yAxisWidth = yAxisWidth;\n scope.xAxisHeight = xAxisHeight;\n scope.chartHeight = chartHeight;\n scope.chartWidth = chartWidth;\n scope.chartTop = chartTop;\n }\n\n // Register selection listeners\n $heatmap.on('mousedown', onMouseDown);\n $heatmap.on('mousemove', onMouseMove);\n $heatmap.on('mouseleave', onMouseLeave);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/heatmap/rendering.ts","import * as d3 from 'd3';\nimport $ from 'jquery';\nimport _ from 'lodash';\nimport kbn from 'app/core/utils/kbn';\nimport { getValueBucketBound } from './heatmap_data_converter';\n\nlet TOOLTIP_PADDING_X = 30;\nlet TOOLTIP_PADDING_Y = 5;\nlet HISTOGRAM_WIDTH = 160;\nlet HISTOGRAM_HEIGHT = 40;\n\nexport class HeatmapTooltip {\n tooltip: any;\n scope: any;\n dashboard: any;\n panelCtrl: any;\n panel: any;\n heatmapPanel: any;\n mouseOverBucket: boolean;\n originalFillColor: any;\n\n constructor(elem, scope) {\n this.scope = scope;\n this.dashboard = scope.ctrl.dashboard;\n this.panelCtrl = scope.ctrl;\n this.panel = scope.ctrl.panel;\n this.heatmapPanel = elem;\n this.mouseOverBucket = false;\n this.originalFillColor = null;\n\n elem.on('mouseover', this.onMouseOver.bind(this));\n elem.on('mouseleave', this.onMouseLeave.bind(this));\n }\n\n onMouseOver(e) {\n if (!this.panel.tooltip.show || !this.scope.ctrl.data || _.isEmpty(this.scope.ctrl.data.buckets)) {\n return;\n }\n\n if (!this.tooltip) {\n this.add();\n this.move(e);\n }\n }\n\n onMouseLeave() {\n this.destroy();\n }\n\n onMouseMove(e) {\n if (!this.panel.tooltip.show) {\n return;\n }\n\n this.move(e);\n }\n\n add() {\n this.tooltip = d3\n .select('body')\n .append('div')\n .attr('class', 'heatmap-tooltip graph-tooltip grafana-tooltip');\n }\n\n destroy() {\n if (this.tooltip) {\n this.tooltip.remove();\n }\n\n this.tooltip = null;\n }\n\n show(pos, data) {\n if (!this.panel.tooltip.show || !data) {\n return;\n }\n // shared tooltip mode\n if (pos.panelRelY) {\n return;\n }\n\n let { xBucketIndex, yBucketIndex } = this.getBucketIndexes(pos, data);\n\n if (!data.buckets[xBucketIndex] || !this.tooltip) {\n this.destroy();\n return;\n }\n\n let boundBottom, boundTop, valuesNumber;\n let xData = data.buckets[xBucketIndex];\n // Search in special 'zero' bucket also\n let yData = _.find(xData.buckets, (bucket, bucketIndex) => {\n return bucket.bounds.bottom === yBucketIndex || bucketIndex === yBucketIndex.toString();\n });\n\n let tooltipTimeFormat = 'YYYY-MM-DD HH:mm:ss';\n let time = this.dashboard.formatDate(xData.x, tooltipTimeFormat);\n\n // Decimals override. Code from panel/graph/graph.ts\n let countValueFormatter, bucketBoundFormatter;\n if (_.isNumber(this.panel.tooltipDecimals)) {\n countValueFormatter = this.countValueFormatter(this.panel.tooltipDecimals, null);\n bucketBoundFormatter = this.panelCtrl.tickValueFormatter(this.panelCtrl.decimals, null);\n } else {\n // auto decimals\n // legend and tooltip gets one more decimal precision\n // than graph legend ticks\n let decimals = (this.panelCtrl.decimals || -1) + 1;\n countValueFormatter = this.countValueFormatter(decimals, this.panelCtrl.scaledDecimals + 2);\n bucketBoundFormatter = this.panelCtrl.tickValueFormatter(decimals, this.panelCtrl.scaledDecimals + 2);\n }\n\n let tooltipHtml = `
    ${time}
    \n
    `;\n\n if (yData) {\n if (yData.bounds) {\n if (data.tsBuckets) {\n // Use Y-axis labels\n const tickFormatter = valIndex => {\n return data.tsBucketsFormatted ? data.tsBucketsFormatted[valIndex] : data.tsBuckets[valIndex];\n };\n\n boundBottom = tickFormatter(yBucketIndex);\n boundTop = yBucketIndex < data.tsBuckets.length - 1 ? tickFormatter(yBucketIndex + 1) : '';\n } else {\n // Display 0 if bucket is a special 'zero' bucket\n let bottom = yData.y ? yData.bounds.bottom : 0;\n boundBottom = bucketBoundFormatter(bottom);\n boundTop = bucketBoundFormatter(yData.bounds.top);\n }\n valuesNumber = countValueFormatter(yData.count);\n tooltipHtml += `
    \n bucket: ${boundBottom} - ${boundTop}
    \n count: ${valuesNumber}
    \n
    `;\n } else {\n // currently no bounds for pre bucketed data\n tooltipHtml += `
    count: ${yData.count}
    `;\n }\n } else {\n if (!this.panel.tooltip.showHistogram) {\n this.destroy();\n return;\n }\n boundBottom = yBucketIndex;\n boundTop = '';\n valuesNumber = 0;\n }\n\n this.tooltip.html(tooltipHtml);\n\n if (this.panel.tooltip.showHistogram) {\n this.addHistogram(xData);\n }\n\n this.move(pos);\n }\n\n getBucketIndexes(pos, data) {\n const xBucketIndex = this.getXBucketIndex(pos.offsetX, data);\n const yBucketIndex = this.getYBucketIndex(pos.offsetY, data);\n return { xBucketIndex, yBucketIndex };\n }\n\n getXBucketIndex(offsetX, data) {\n let x = this.scope.xScale.invert(offsetX - this.scope.yAxisWidth).valueOf();\n // First try to find X bucket by checking x pos is in the\n // [bucket.x, bucket.x + xBucketSize] interval\n let xBucket = _.find(data.buckets, bucket => {\n return x > bucket.x && x - bucket.x <= data.xBucketSize;\n });\n return xBucket ? xBucket.x : getValueBucketBound(x, data.xBucketSize, 1);\n }\n\n getYBucketIndex(offsetY, data) {\n let y = this.scope.yScale.invert(offsetY - this.scope.chartTop);\n if (data.tsBuckets) {\n return Math.floor(y);\n }\n let yBucketIndex = getValueBucketBound(y, data.yBucketSize, this.panel.yAxis.logBase);\n return yBucketIndex;\n }\n\n getSharedTooltipPos(pos) {\n // get pageX from position on x axis and pageY from relative position in original panel\n pos.pageX = this.heatmapPanel.offset().left + this.scope.xScale(pos.x);\n pos.pageY = this.heatmapPanel.offset().top + this.scope.chartHeight * pos.panelRelY;\n return pos;\n }\n\n addHistogram(data) {\n let xBucket = this.scope.ctrl.data.buckets[data.x];\n let yBucketSize = this.scope.ctrl.data.yBucketSize;\n let min, max, ticks;\n if (this.scope.ctrl.data.tsBuckets) {\n min = 0;\n max = this.scope.ctrl.data.tsBuckets.length - 1;\n ticks = this.scope.ctrl.data.tsBuckets.length;\n } else {\n min = this.scope.ctrl.data.yAxis.min;\n max = this.scope.ctrl.data.yAxis.max;\n ticks = this.scope.ctrl.data.yAxis.ticks;\n }\n let histogramData = _.map(xBucket.buckets, bucket => {\n let count = bucket.count !== undefined ? bucket.count : bucket.values.length;\n return [bucket.bounds.bottom, count];\n });\n histogramData = _.filter(histogramData, d => {\n return d[0] >= min && d[0] <= max;\n });\n\n let scale = this.scope.yScale.copy();\n let histXScale = scale.domain([min, max]).range([0, HISTOGRAM_WIDTH]);\n\n let barWidth;\n if (this.panel.yAxis.logBase === 1) {\n barWidth = Math.floor(HISTOGRAM_WIDTH / (max - min) * yBucketSize * 0.9);\n } else {\n let barNumberFactor = yBucketSize ? yBucketSize : 1;\n barWidth = Math.floor(HISTOGRAM_WIDTH / ticks / barNumberFactor * 0.9);\n }\n barWidth = Math.max(barWidth, 1);\n\n // Normalize histogram Y axis\n let histogramDomain = _.reduce(_.map(histogramData, d => d[1]), (sum, val) => sum + val, 0);\n let histYScale = d3\n .scaleLinear()\n .domain([0, histogramDomain])\n .range([0, HISTOGRAM_HEIGHT]);\n\n let histogram = this.tooltip\n .select('.heatmap-histogram')\n .append('svg')\n .attr('width', HISTOGRAM_WIDTH)\n .attr('height', HISTOGRAM_HEIGHT);\n\n histogram\n .selectAll('.bar')\n .data(histogramData)\n .enter()\n .append('rect')\n .attr('x', d => {\n return histXScale(d[0]);\n })\n .attr('width', barWidth)\n .attr('y', d => {\n return HISTOGRAM_HEIGHT - histYScale(d[1]);\n })\n .attr('height', d => {\n return histYScale(d[1]);\n });\n }\n\n move(pos) {\n if (!this.tooltip) {\n return;\n }\n\n let elem = $(this.tooltip.node())[0];\n let tooltipWidth = elem.clientWidth;\n let tooltipHeight = elem.clientHeight;\n\n let left = pos.pageX + TOOLTIP_PADDING_X;\n let top = pos.pageY + TOOLTIP_PADDING_Y;\n\n if (pos.pageX + tooltipWidth + 40 > window.innerWidth) {\n left = pos.pageX - tooltipWidth - TOOLTIP_PADDING_X;\n }\n\n if (pos.pageY - window.pageYOffset + tooltipHeight + 20 > window.innerHeight) {\n top = pos.pageY - tooltipHeight - TOOLTIP_PADDING_Y;\n }\n\n return this.tooltip.style('left', left + 'px').style('top', top + 'px');\n }\n\n countValueFormatter(decimals, scaledDecimals = null) {\n let format = 'short';\n return function(value) {\n return kbn.valueFormats[format](value, decimals, scaledDecimals);\n };\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/heatmap/heatmap_tooltip.ts","import _ from 'lodash';\nimport $ from 'jquery';\nimport { MetricsPanelCtrl } from 'app/plugins/sdk';\nimport { transformDataToTable } from './transformers';\nimport { tablePanelEditor } from './editor';\nimport { columnOptionsTab } from './column_options';\nimport { TableRenderer } from './renderer';\n\nclass TablePanelCtrl extends MetricsPanelCtrl {\n static templateUrl = 'module.html';\n\n pageIndex: number;\n dataRaw: any;\n table: any;\n renderer: any;\n\n panelDefaults = {\n targets: [{}],\n transform: 'timeseries_to_columns',\n pageSize: null,\n showHeader: true,\n styles: [\n {\n type: 'date',\n pattern: 'Time',\n alias: 'Time',\n dateFormat: 'YYYY-MM-DD HH:mm:ss',\n },\n {\n unit: 'short',\n type: 'number',\n alias: '',\n decimals: 2,\n colors: ['rgba(245, 54, 54, 0.9)', 'rgba(237, 129, 40, 0.89)', 'rgba(50, 172, 45, 0.97)'],\n colorMode: null,\n pattern: '/.*/',\n thresholds: [],\n },\n ],\n columns: [],\n scroll: true,\n fontSize: '100%',\n sort: { col: 0, desc: true },\n };\n\n /** @ngInject */\n constructor($scope, $injector, templateSrv, private annotationsSrv, private $sanitize, private variableSrv) {\n super($scope, $injector);\n\n this.pageIndex = 0;\n\n if (this.panel.styles === void 0) {\n this.panel.styles = this.panel.columns;\n this.panel.columns = this.panel.fields;\n delete this.panel.columns;\n delete this.panel.fields;\n }\n\n _.defaults(this.panel, this.panelDefaults);\n\n this.events.on('data-received', this.onDataReceived.bind(this));\n this.events.on('data-error', this.onDataError.bind(this));\n this.events.on('data-snapshot-load', this.onDataReceived.bind(this));\n this.events.on('init-edit-mode', this.onInitEditMode.bind(this));\n this.events.on('init-panel-actions', this.onInitPanelActions.bind(this));\n }\n\n onInitEditMode() {\n this.addEditorTab('Options', tablePanelEditor, 2);\n this.addEditorTab('Column Styles', columnOptionsTab, 3);\n }\n\n onInitPanelActions(actions) {\n actions.push({ text: 'Export CSV', click: 'ctrl.exportCsv()' });\n }\n\n issueQueries(datasource) {\n this.pageIndex = 0;\n\n if (this.panel.transform === 'annotations') {\n this.setTimeQueryStart();\n return this.annotationsSrv\n .getAnnotations({\n dashboard: this.dashboard,\n panel: this.panel,\n range: this.range,\n })\n .then(annotations => {\n return { data: annotations };\n });\n }\n\n return super.issueQueries(datasource);\n }\n\n onDataError(err) {\n this.dataRaw = [];\n this.render();\n }\n\n onDataReceived(dataList) {\n this.dataRaw = dataList;\n this.pageIndex = 0;\n\n // automatically correct transform mode based on data\n if (this.dataRaw && this.dataRaw.length) {\n if (this.dataRaw[0].type === 'table') {\n this.panel.transform = 'table';\n } else {\n if (this.dataRaw[0].type === 'docs') {\n this.panel.transform = 'json';\n } else {\n if (this.panel.transform === 'table' || this.panel.transform === 'json') {\n this.panel.transform = 'timeseries_to_rows';\n }\n }\n }\n }\n\n this.render();\n }\n\n render() {\n this.table = transformDataToTable(this.dataRaw, this.panel);\n this.table.sort(this.panel.sort);\n\n this.renderer = new TableRenderer(\n this.panel,\n this.table,\n this.dashboard.isTimezoneUtc(),\n this.$sanitize,\n this.templateSrv\n );\n\n return super.render(this.table);\n }\n\n toggleColumnSort(col, colIndex) {\n // remove sort flag from current column\n if (this.table.columns[this.panel.sort.col]) {\n this.table.columns[this.panel.sort.col].sort = false;\n }\n\n if (this.panel.sort.col === colIndex) {\n if (this.panel.sort.desc) {\n this.panel.sort.desc = false;\n } else {\n this.panel.sort.col = null;\n }\n } else {\n this.panel.sort.col = colIndex;\n this.panel.sort.desc = true;\n }\n this.render();\n }\n\n moveQuery(target, direction) {\n super.moveQuery(target, direction);\n super.refresh();\n }\n\n exportCsv() {\n var scope = this.$scope.$new(true);\n scope.tableData = this.renderer.render_values();\n scope.panel = 'table';\n this.publishAppEvent('show-modal', {\n templateHtml: '',\n scope,\n modalClass: 'modal--narrow',\n });\n }\n\n link(scope, elem, attrs, ctrl: TablePanelCtrl) {\n var data;\n var panel = ctrl.panel;\n var pageCount = 0;\n\n function getTableHeight() {\n var panelHeight = ctrl.height;\n\n if (pageCount > 1) {\n panelHeight -= 26;\n }\n\n return panelHeight - 31 + 'px';\n }\n\n function appendTableRows(tbodyElem) {\n ctrl.renderer.setTable(data);\n tbodyElem.empty();\n tbodyElem.html(ctrl.renderer.render(ctrl.pageIndex));\n }\n\n function switchPage(e) {\n var el = $(e.currentTarget);\n ctrl.pageIndex = parseInt(el.text(), 10) - 1;\n renderPanel();\n }\n\n function appendPaginationControls(footerElem) {\n footerElem.empty();\n\n var pageSize = panel.pageSize || 100;\n pageCount = Math.ceil(data.rows.length / pageSize);\n if (pageCount === 1) {\n return;\n }\n\n var startPage = Math.max(ctrl.pageIndex - 3, 0);\n var endPage = Math.min(pageCount, startPage + 9);\n\n var paginationList = $('
      ');\n\n for (var i = startPage; i < endPage; i++) {\n var activeClass = i === ctrl.pageIndex ? 'active' : '';\n var pageLinkElem = $(\n '
    • ' + (i + 1) + '
    • '\n );\n paginationList.append(pageLinkElem);\n }\n\n footerElem.append(paginationList);\n }\n\n function renderPanel() {\n var panelElem = elem.parents('.panel-content');\n var rootElem = elem.find('.table-panel-scroll');\n var tbodyElem = elem.find('tbody');\n var footerElem = elem.find('.table-panel-footer');\n\n elem.css({ 'font-size': panel.fontSize });\n panelElem.addClass('table-panel-content');\n\n appendTableRows(tbodyElem);\n appendPaginationControls(footerElem);\n\n rootElem.css({ 'max-height': panel.scroll ? getTableHeight() : '' });\n }\n\n // hook up link tooltips\n elem.tooltip({\n selector: '[data-link-tooltip]',\n });\n\n function addFilterClicked(e) {\n let filterData = $(e.currentTarget).data();\n var options = {\n datasource: panel.datasource,\n key: data.columns[filterData.column].text,\n value: data.rows[filterData.row][filterData.column],\n operator: filterData.operator,\n };\n\n ctrl.variableSrv.setAdhocFilter(options);\n }\n\n elem.on('click', '.table-panel-page-link', switchPage);\n elem.on('click', '.table-panel-filter-link', addFilterClicked);\n\n var unbindDestroy = scope.$on('$destroy', function() {\n elem.off('click', '.table-panel-page-link');\n elem.off('click', '.table-panel-filter-link');\n unbindDestroy();\n });\n\n ctrl.events.on('render', function(renderData) {\n data = renderData || data;\n if (data) {\n renderPanel();\n }\n ctrl.renderingCompleted();\n });\n }\n}\n\nexport { TablePanelCtrl, TablePanelCtrl as PanelCtrl };\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/table/module.ts","import _ from 'lodash';\nimport { transformers } from './transformers';\n\nexport class TablePanelEditorCtrl {\n panel: any;\n panelCtrl: any;\n transformers: any;\n fontSizes: any;\n addColumnSegment: any;\n getColumnNames: any;\n canSetColumns: boolean;\n columnsHelpMessage: string;\n\n /** @ngInject */\n constructor($scope, private $q, private uiSegmentSrv) {\n $scope.editor = this;\n this.panelCtrl = $scope.ctrl;\n this.panel = this.panelCtrl.panel;\n this.transformers = transformers;\n this.fontSizes = ['80%', '90%', '100%', '110%', '120%', '130%', '150%', '160%', '180%', '200%', '220%', '250%'];\n this.addColumnSegment = uiSegmentSrv.newPlusButton();\n this.updateTransformHints();\n }\n\n updateTransformHints() {\n this.canSetColumns = false;\n this.columnsHelpMessage = '';\n\n switch (this.panel.transform) {\n case 'timeseries_aggregations': {\n this.canSetColumns = true;\n break;\n }\n case 'json': {\n this.canSetColumns = true;\n break;\n }\n case 'table': {\n this.columnsHelpMessage = 'Columns and their order are determined by the data query';\n }\n }\n }\n\n getColumnOptions() {\n if (!this.panelCtrl.dataRaw) {\n return this.$q.when([]);\n }\n var columns = this.transformers[this.panel.transform].getColumns(this.panelCtrl.dataRaw);\n var segments = _.map(columns, (c: any) => this.uiSegmentSrv.newSegment({ value: c.text }));\n return this.$q.when(segments);\n }\n\n addColumn() {\n var columns = transformers[this.panel.transform].getColumns(this.panelCtrl.dataRaw);\n var column = _.find(columns, { text: this.addColumnSegment.value });\n\n if (column) {\n this.panel.columns.push(column);\n this.render();\n }\n\n var plusButton = this.uiSegmentSrv.newPlusButton();\n this.addColumnSegment.html = plusButton.html;\n this.addColumnSegment.value = plusButton.value;\n }\n\n transformChanged() {\n this.panel.columns = [];\n if (this.panel.transform === 'timeseries_aggregations') {\n this.panel.columns.push({ text: 'Avg', value: 'avg' });\n }\n\n this.updateTransformHints();\n this.render();\n }\n\n render() {\n this.panelCtrl.render();\n }\n\n removeColumn(column) {\n this.panel.columns = _.without(this.panel.columns, column);\n this.panelCtrl.render();\n }\n}\n\n/** @ngInject */\nexport function tablePanelEditor($q, uiSegmentSrv) {\n 'use strict';\n return {\n restrict: 'E',\n scope: true,\n templateUrl: 'public/app/plugins/panel/table/editor.html',\n controller: TablePanelEditorCtrl,\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/table/editor.ts","import _ from 'lodash';\nimport kbn from 'app/core/utils/kbn';\n\nexport class ColumnOptionsCtrl {\n panel: any;\n panelCtrl: any;\n colorModes: any;\n columnStyles: any;\n columnTypes: any;\n fontSizes: any;\n dateFormats: any;\n addColumnSegment: any;\n unitFormats: any;\n getColumnNames: any;\n activeStyleIndex: number;\n mappingTypes: any;\n\n /** @ngInject */\n constructor($scope) {\n $scope.editor = this;\n\n this.activeStyleIndex = 0;\n this.panelCtrl = $scope.ctrl;\n this.panel = this.panelCtrl.panel;\n this.unitFormats = kbn.getUnitFormats();\n this.colorModes = [\n { text: 'Disabled', value: null },\n { text: 'Cell', value: 'cell' },\n { text: 'Value', value: 'value' },\n { text: 'Row', value: 'row' },\n ];\n this.columnTypes = [\n { text: 'Number', value: 'number' },\n { text: 'String', value: 'string' },\n { text: 'Date', value: 'date' },\n { text: 'Hidden', value: 'hidden' },\n ];\n this.fontSizes = ['80%', '90%', '100%', '110%', '120%', '130%', '150%', '160%', '180%', '200%', '220%', '250%'];\n this.dateFormats = [\n { text: 'YYYY-MM-DD HH:mm:ss', value: 'YYYY-MM-DD HH:mm:ss' },\n { text: 'YYYY-MM-DD HH:mm:ss.SSS', value: 'YYYY-MM-DD HH:mm:ss.SSS' },\n { text: 'MM/DD/YY h:mm:ss a', value: 'MM/DD/YY h:mm:ss a' },\n { text: 'MMMM D, YYYY LT', value: 'MMMM D, YYYY LT' },\n ];\n this.mappingTypes = [{ text: 'Value to text', value: 1 }, { text: 'Range to text', value: 2 }];\n\n this.getColumnNames = () => {\n if (!this.panelCtrl.table) {\n return [];\n }\n return _.map(this.panelCtrl.table.columns, function(col: any) {\n return col.text;\n });\n };\n\n this.onColorChange = this.onColorChange.bind(this);\n }\n\n render() {\n this.panelCtrl.render();\n }\n\n setUnitFormat(column, subItem) {\n column.unit = subItem.value;\n this.panelCtrl.render();\n }\n\n addColumnStyle() {\n var newStyleRule = {\n unit: 'short',\n type: 'number',\n alias: '',\n decimals: 2,\n colors: ['rgba(245, 54, 54, 0.9)', 'rgba(237, 129, 40, 0.89)', 'rgba(50, 172, 45, 0.97)'],\n colorMode: null,\n pattern: '',\n dateFormat: 'YYYY-MM-DD HH:mm:ss',\n thresholds: [],\n mappingType: 1,\n };\n\n var styles = this.panel.styles;\n var stylesCount = styles.length;\n var indexToInsert = stylesCount;\n\n // check if last is a catch all rule, then add it before that one\n if (stylesCount > 0) {\n var last = styles[stylesCount - 1];\n if (last.pattern === '/.*/') {\n indexToInsert = stylesCount - 1;\n }\n }\n\n styles.splice(indexToInsert, 0, newStyleRule);\n this.activeStyleIndex = indexToInsert;\n }\n\n removeColumnStyle(style) {\n this.panel.styles = _.without(this.panel.styles, style);\n }\n\n invertColorOrder(index) {\n var ref = this.panel.styles[index].colors;\n var copy = ref[0];\n ref[0] = ref[2];\n ref[2] = copy;\n this.panelCtrl.render();\n }\n\n onColorChange(styleIndex, colorIndex) {\n return newColor => {\n this.panel.styles[styleIndex].colors[colorIndex] = newColor;\n this.render();\n };\n }\n\n addValueMap(style) {\n if (!style.valueMaps) {\n style.valueMaps = [];\n }\n style.valueMaps.push({ value: '', text: '' });\n this.panelCtrl.render();\n }\n\n removeValueMap(style, index) {\n style.valueMaps.splice(index, 1);\n this.panelCtrl.render();\n }\n\n addRangeMap(style) {\n if (!style.rangeMaps) {\n style.rangeMaps = [];\n }\n style.rangeMaps.push({ from: '', to: '', text: '' });\n this.panelCtrl.render();\n }\n\n removeRangeMap(style, index) {\n style.rangeMaps.splice(index, 1);\n this.panelCtrl.render();\n }\n}\n\n/** @ngInject */\nexport function columnOptionsTab($q, uiSegmentSrv) {\n 'use strict';\n return {\n restrict: 'E',\n scope: true,\n templateUrl: 'public/app/plugins/panel/table/column_options.html',\n controller: ColumnOptionsCtrl,\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/table/column_options.ts","import _ from 'lodash';\nimport moment from 'moment';\nimport kbn from 'app/core/utils/kbn';\n\nexport class TableRenderer {\n formatters: any[];\n colorState: any;\n\n constructor(private panel, private table, private isUtc, private sanitize, private templateSrv) {\n this.initColumns();\n }\n\n setTable(table) {\n this.table = table;\n\n this.initColumns();\n }\n\n initColumns() {\n this.formatters = [];\n this.colorState = {};\n\n for (let colIndex = 0; colIndex < this.table.columns.length; colIndex++) {\n let column = this.table.columns[colIndex];\n column.title = column.text;\n\n for (let i = 0; i < this.panel.styles.length; i++) {\n let style = this.panel.styles[i];\n\n var regex = kbn.stringToJsRegex(style.pattern);\n if (column.text.match(regex)) {\n column.style = style;\n\n if (style.alias) {\n column.title = column.text.replace(regex, style.alias);\n }\n\n break;\n }\n }\n\n this.formatters[colIndex] = this.createColumnFormatter(column);\n }\n }\n\n getColorForValue(value, style) {\n if (!style.thresholds) {\n return null;\n }\n for (var i = style.thresholds.length; i > 0; i--) {\n if (value >= style.thresholds[i - 1]) {\n return style.colors[i];\n }\n }\n return _.first(style.colors);\n }\n\n defaultCellFormatter(v, style) {\n if (v === null || v === void 0 || v === undefined) {\n return '';\n }\n\n if (_.isArray(v)) {\n v = v.join(', ');\n }\n\n if (style && style.sanitize) {\n return this.sanitize(v);\n } else {\n return _.escape(v);\n }\n }\n\n createColumnFormatter(column) {\n if (!column.style) {\n return this.defaultCellFormatter;\n }\n\n if (column.style.type === 'hidden') {\n return v => {\n return undefined;\n };\n }\n\n if (column.style.type === 'date') {\n return v => {\n if (v === undefined || v === null) {\n return '-';\n }\n\n if (_.isArray(v)) {\n v = v[0];\n }\n var date = moment(v);\n if (this.isUtc) {\n date = date.utc();\n }\n return date.format(column.style.dateFormat);\n };\n }\n\n if (column.style.type === 'string') {\n return v => {\n if (_.isArray(v)) {\n v = v.join(', ');\n }\n\n const mappingType = column.style.mappingType || 0;\n\n if (mappingType === 1 && column.style.valueMaps) {\n for (let i = 0; i < column.style.valueMaps.length; i++) {\n const map = column.style.valueMaps[i];\n\n if (v === null) {\n if (map.value === 'null') {\n return map.text;\n }\n continue;\n }\n\n // Allow both numeric and string values to be mapped\n if ((!_.isString(v) && Number(map.value) === Number(v)) || map.value === v) {\n this.setColorState(v, column.style);\n return this.defaultCellFormatter(map.text, column.style);\n }\n }\n }\n\n if (mappingType === 2 && column.style.rangeMaps) {\n for (let i = 0; i < column.style.rangeMaps.length; i++) {\n const map = column.style.rangeMaps[i];\n\n if (v === null) {\n if (map.from === 'null' && map.to === 'null') {\n return map.text;\n }\n continue;\n }\n\n if (Number(map.from) <= Number(v) && Number(map.to) >= Number(v)) {\n this.setColorState(v, column.style);\n return this.defaultCellFormatter(map.text, column.style);\n }\n }\n }\n\n if (v === null || v === void 0) {\n return '-';\n }\n\n this.setColorState(v, column.style);\n return this.defaultCellFormatter(v, column.style);\n };\n }\n\n if (column.style.type === 'number') {\n let valueFormatter = kbn.valueFormats[column.unit || column.style.unit];\n\n return v => {\n if (v === null || v === void 0) {\n return '-';\n }\n\n if (_.isString(v) || _.isArray(v)) {\n return this.defaultCellFormatter(v, column.style);\n }\n\n this.setColorState(v, column.style);\n return valueFormatter(v, column.style.decimals, null);\n };\n }\n\n return value => {\n return this.defaultCellFormatter(value, column.style);\n };\n }\n\n setColorState(value, style) {\n if (!style.colorMode) {\n return;\n }\n\n if (value === null || value === void 0 || _.isArray(value)) {\n return;\n }\n\n var numericValue = Number(value);\n if (numericValue === NaN) {\n return;\n }\n\n this.colorState[style.colorMode] = this.getColorForValue(numericValue, style);\n }\n\n renderRowVariables(rowIndex) {\n let scopedVars = {};\n let cell_variable;\n let row = this.table.rows[rowIndex];\n for (let i = 0; i < row.length; i++) {\n cell_variable = `__cell_${i}`;\n scopedVars[cell_variable] = { value: row[i] };\n }\n return scopedVars;\n }\n\n formatColumnValue(colIndex, value) {\n return this.formatters[colIndex] ? this.formatters[colIndex](value) : value;\n }\n\n renderCell(columnIndex, rowIndex, value, addWidthHack = false) {\n value = this.formatColumnValue(columnIndex, value);\n\n var column = this.table.columns[columnIndex];\n var style = '';\n var cellClasses = [];\n var cellClass = '';\n\n if (this.colorState.cell) {\n style = ' style=\"background-color:' + this.colorState.cell + ';color: white\"';\n this.colorState.cell = null;\n } else if (this.colorState.value) {\n style = ' style=\"color:' + this.colorState.value + '\"';\n this.colorState.value = null;\n }\n\n // because of the fixed table headers css only solution\n // there is an issue if header cell is wider the cell\n // this hack adds header content to cell (not visible)\n var columnHtml = '';\n if (addWidthHack) {\n columnHtml = '
      ' + this.table.columns[columnIndex].title + '
      ';\n }\n\n if (value === undefined) {\n style = ' style=\"display:none;\"';\n column.hidden = true;\n } else {\n column.hidden = false;\n }\n\n if (column.style && column.style.preserveFormat) {\n cellClasses.push('table-panel-cell-pre');\n }\n\n if (column.style && column.style.link) {\n // Render cell as link\n var scopedVars = this.renderRowVariables(rowIndex);\n scopedVars['__cell'] = { value: value };\n\n var cellLink = this.templateSrv.replace(column.style.linkUrl, scopedVars, encodeURIComponent);\n var cellLinkTooltip = this.templateSrv.replace(column.style.linkTooltip, scopedVars);\n var cellTarget = column.style.linkTargetBlank ? '_blank' : '';\n\n cellClasses.push('table-panel-cell-link');\n columnHtml += `\n \n ${value}\n \n `;\n } else {\n columnHtml += value;\n }\n\n if (column.filterable) {\n cellClasses.push('table-panel-cell-filterable');\n columnHtml += `\n \n \n \n \n \n `;\n }\n\n if (cellClasses.length) {\n cellClass = ' class=\"' + cellClasses.join(' ') + '\"';\n }\n\n columnHtml = '' + columnHtml + '';\n return columnHtml;\n }\n\n render(page) {\n let pageSize = this.panel.pageSize || 100;\n let startPos = page * pageSize;\n let endPos = Math.min(startPos + pageSize, this.table.rows.length);\n var html = '';\n\n for (var y = startPos; y < endPos; y++) {\n let row = this.table.rows[y];\n let cellHtml = '';\n let rowStyle = '';\n for (var i = 0; i < this.table.columns.length; i++) {\n cellHtml += this.renderCell(i, y, row[i], y === startPos);\n }\n\n if (this.colorState.row) {\n rowStyle = ' style=\"background-color:' + this.colorState.row + ';color: white\"';\n this.colorState.row = null;\n }\n\n html += '
      ' + cellHtml + '';\n }\n\n return html;\n }\n\n render_values() {\n let rows = [];\n\n for (var y = 0; y < this.table.rows.length; y++) {\n let row = this.table.rows[y];\n let new_row = [];\n for (var i = 0; i < this.table.columns.length; i++) {\n new_row.push(this.formatColumnValue(i, row[i]));\n }\n rows.push(new_row);\n }\n return {\n columns: this.table.columns,\n rows: rows,\n };\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/table/renderer.ts","import _ from 'lodash';\nimport $ from 'jquery';\nimport 'vendor/flot/jquery.flot';\nimport 'vendor/flot/jquery.flot.gauge';\nimport 'app/features/panellinks/link_srv';\n\nimport kbn from 'app/core/utils/kbn';\nimport config from 'app/core/config';\nimport TimeSeries from 'app/core/time_series2';\nimport { MetricsPanelCtrl } from 'app/plugins/sdk';\n\nclass SingleStatCtrl extends MetricsPanelCtrl {\n static templateUrl = 'module.html';\n\n dataType = 'timeseries';\n series: any[];\n data: any;\n fontSizes: any[];\n unitFormats: any[];\n invalidGaugeRange: boolean;\n panel: any;\n events: any;\n valueNameOptions: any[] = [\n { value: 'min', text: 'Min' },\n { value: 'max', text: 'Max' },\n { value: 'avg', text: 'Average' },\n { value: 'current', text: 'Current' },\n { value: 'total', text: 'Total' },\n { value: 'name', text: 'Name' },\n { value: 'first', text: 'First' },\n { value: 'delta', text: 'Delta' },\n { value: 'diff', text: 'Difference' },\n { value: 'range', text: 'Range' },\n { value: 'last_time', text: 'Time of last point' },\n ];\n tableColumnOptions: any;\n\n // Set and populate defaults\n panelDefaults = {\n links: [],\n datasource: null,\n maxDataPoints: 100,\n interval: null,\n targets: [{}],\n cacheTimeout: null,\n format: 'none',\n prefix: '',\n postfix: '',\n nullText: null,\n valueMaps: [{ value: 'null', op: '=', text: 'N/A' }],\n mappingTypes: [{ name: 'value to text', value: 1 }, { name: 'range to text', value: 2 }],\n rangeMaps: [{ from: 'null', to: 'null', text: 'N/A' }],\n mappingType: 1,\n nullPointMode: 'connected',\n valueName: 'avg',\n prefixFontSize: '50%',\n valueFontSize: '80%',\n postfixFontSize: '50%',\n thresholds: '',\n colorBackground: false,\n colorValue: false,\n colors: ['#299c46', 'rgba(237, 129, 40, 0.89)', '#d44a3a'],\n sparkline: {\n show: false,\n full: false,\n lineColor: 'rgb(31, 120, 193)',\n fillColor: 'rgba(31, 118, 189, 0.18)',\n },\n gauge: {\n show: false,\n minValue: 0,\n maxValue: 100,\n thresholdMarkers: true,\n thresholdLabels: false,\n },\n tableColumn: '',\n };\n\n /** @ngInject */\n constructor($scope, $injector, private linkSrv) {\n super($scope, $injector);\n _.defaults(this.panel, this.panelDefaults);\n\n this.events.on('data-received', this.onDataReceived.bind(this));\n this.events.on('data-error', this.onDataError.bind(this));\n this.events.on('data-snapshot-load', this.onDataReceived.bind(this));\n this.events.on('init-edit-mode', this.onInitEditMode.bind(this));\n\n this.onSparklineColorChange = this.onSparklineColorChange.bind(this);\n this.onSparklineFillChange = this.onSparklineFillChange.bind(this);\n }\n\n onInitEditMode() {\n this.fontSizes = ['20%', '30%', '50%', '70%', '80%', '100%', '110%', '120%', '150%', '170%', '200%'];\n this.addEditorTab('Options', 'public/app/plugins/panel/singlestat/editor.html', 2);\n this.addEditorTab('Value Mappings', 'public/app/plugins/panel/singlestat/mappings.html', 3);\n this.unitFormats = kbn.getUnitFormats();\n }\n\n setUnitFormat(subItem) {\n this.panel.format = subItem.value;\n this.refresh();\n }\n\n onDataError(err) {\n this.onDataReceived([]);\n }\n\n onDataReceived(dataList) {\n const data: any = {};\n if (dataList.length > 0 && dataList[0].type === 'table') {\n this.dataType = 'table';\n const tableData = dataList.map(this.tableHandler.bind(this));\n this.setTableValues(tableData, data);\n } else {\n this.dataType = 'timeseries';\n this.series = dataList.map(this.seriesHandler.bind(this));\n this.setValues(data);\n }\n this.data = data;\n this.render();\n }\n\n seriesHandler(seriesData) {\n var series = new TimeSeries({\n datapoints: seriesData.datapoints || [],\n alias: seriesData.target,\n });\n\n series.flotpairs = series.getFlotPairs(this.panel.nullPointMode);\n return series;\n }\n\n tableHandler(tableData) {\n const datapoints = [];\n const columnNames = {};\n\n tableData.columns.forEach((column, columnIndex) => {\n columnNames[columnIndex] = column.text;\n });\n\n this.tableColumnOptions = columnNames;\n if (!_.find(tableData.columns, ['text', this.panel.tableColumn])) {\n this.setTableColumnToSensibleDefault(tableData);\n }\n\n tableData.rows.forEach(row => {\n const datapoint = {};\n\n row.forEach((value, columnIndex) => {\n const key = columnNames[columnIndex];\n datapoint[key] = value;\n });\n\n datapoints.push(datapoint);\n });\n\n return datapoints;\n }\n\n setTableColumnToSensibleDefault(tableData) {\n if (tableData.columns.length === 1) {\n this.panel.tableColumn = tableData.columns[0].text;\n } else {\n this.panel.tableColumn = _.find(tableData.columns, col => {\n return col.type !== 'time';\n }).text;\n }\n }\n\n setTableValues(tableData, data) {\n if (!tableData || tableData.length === 0) {\n return;\n }\n\n if (tableData[0].length === 0 || tableData[0][0][this.panel.tableColumn] === undefined) {\n return;\n }\n\n const datapoint = tableData[0][0];\n data.value = datapoint[this.panel.tableColumn];\n\n if (_.isString(data.value)) {\n data.valueFormatted = _.escape(data.value);\n data.value = 0;\n data.valueRounded = 0;\n } else {\n const decimalInfo = this.getDecimalsForValue(data.value);\n const formatFunc = kbn.valueFormats[this.panel.format];\n data.valueFormatted = formatFunc(\n datapoint[this.panel.tableColumn],\n decimalInfo.decimals,\n decimalInfo.scaledDecimals\n );\n data.valueRounded = kbn.roundValue(data.value, this.panel.decimals || 0);\n }\n\n this.setValueMapping(data);\n }\n\n canChangeFontSize() {\n return this.panel.gauge.show;\n }\n\n setColoring(options) {\n if (options.background) {\n this.panel.colorValue = false;\n this.panel.colors = ['rgba(71, 212, 59, 0.4)', 'rgba(245, 150, 40, 0.73)', 'rgba(225, 40, 40, 0.59)'];\n } else {\n this.panel.colorBackground = false;\n this.panel.colors = ['rgba(50, 172, 45, 0.97)', 'rgba(237, 129, 40, 0.89)', 'rgba(245, 54, 54, 0.9)'];\n }\n this.render();\n }\n\n invertColorOrder() {\n var tmp = this.panel.colors[0];\n this.panel.colors[0] = this.panel.colors[2];\n this.panel.colors[2] = tmp;\n this.render();\n }\n\n onColorChange(panelColorIndex) {\n return color => {\n this.panel.colors[panelColorIndex] = color;\n this.render();\n };\n }\n\n onSparklineColorChange(newColor) {\n this.panel.sparkline.lineColor = newColor;\n this.render();\n }\n\n onSparklineFillChange(newColor) {\n this.panel.sparkline.fillColor = newColor;\n this.render();\n }\n\n getDecimalsForValue(value) {\n if (_.isNumber(this.panel.decimals)) {\n return { decimals: this.panel.decimals, scaledDecimals: null };\n }\n\n var delta = value / 2;\n var dec = -Math.floor(Math.log(delta) / Math.LN10);\n\n var magn = Math.pow(10, -dec),\n norm = delta / magn, // norm is between 1.0 and 10.0\n size;\n\n if (norm < 1.5) {\n size = 1;\n } else if (norm < 3) {\n size = 2;\n // special case for 2.5, requires an extra decimal\n if (norm > 2.25) {\n size = 2.5;\n ++dec;\n }\n } else if (norm < 7.5) {\n size = 5;\n } else {\n size = 10;\n }\n\n size *= magn;\n\n // reduce starting decimals if not needed\n if (Math.floor(value) === value) {\n dec = 0;\n }\n\n var result: any = {};\n result.decimals = Math.max(0, dec);\n result.scaledDecimals = result.decimals - Math.floor(Math.log(size) / Math.LN10) + 2;\n\n return result;\n }\n\n setValues(data) {\n data.flotpairs = [];\n\n if (this.series.length > 1) {\n var error: any = new Error();\n error.message = 'Multiple Series Error';\n error.data =\n 'Metric query returns ' +\n this.series.length +\n ' series. Single Stat Panel expects a single series.\\n\\nResponse:\\n' +\n JSON.stringify(this.series);\n throw error;\n }\n\n if (this.series && this.series.length > 0) {\n let lastPoint = _.last(this.series[0].datapoints);\n let lastValue = _.isArray(lastPoint) ? lastPoint[0] : null;\n\n if (this.panel.valueName === 'name') {\n data.value = 0;\n data.valueRounded = 0;\n data.valueFormatted = this.series[0].alias;\n } else if (_.isString(lastValue)) {\n data.value = 0;\n data.valueFormatted = _.escape(lastValue);\n data.valueRounded = 0;\n } else if (this.panel.valueName === 'last_time') {\n let formatFunc = kbn.valueFormats[this.panel.format];\n data.value = lastPoint[1];\n data.valueRounded = data.value;\n data.valueFormatted = formatFunc(data.value, this.dashboard.isTimezoneUtc());\n } else {\n data.value = this.series[0].stats[this.panel.valueName];\n data.flotpairs = this.series[0].flotpairs;\n\n let decimalInfo = this.getDecimalsForValue(data.value);\n let formatFunc = kbn.valueFormats[this.panel.format];\n data.valueFormatted = formatFunc(data.value, decimalInfo.decimals, decimalInfo.scaledDecimals);\n data.valueRounded = kbn.roundValue(data.value, decimalInfo.decimals);\n }\n\n // Add $__name variable for using in prefix or postfix\n data.scopedVars = _.extend({}, this.panel.scopedVars);\n data.scopedVars['__name'] = { value: this.series[0].label };\n }\n this.setValueMapping(data);\n }\n\n setValueMapping(data) {\n // check value to text mappings if its enabled\n if (this.panel.mappingType === 1) {\n for (let i = 0; i < this.panel.valueMaps.length; i++) {\n let map = this.panel.valueMaps[i];\n // special null case\n if (map.value === 'null') {\n if (data.value === null || data.value === void 0) {\n data.valueFormatted = map.text;\n return;\n }\n continue;\n }\n\n // value/number to text mapping\n var value = parseFloat(map.value);\n if (value === data.valueRounded) {\n data.valueFormatted = map.text;\n return;\n }\n }\n } else if (this.panel.mappingType === 2) {\n for (let i = 0; i < this.panel.rangeMaps.length; i++) {\n let map = this.panel.rangeMaps[i];\n // special null case\n if (map.from === 'null' && map.to === 'null') {\n if (data.value === null || data.value === void 0) {\n data.valueFormatted = map.text;\n return;\n }\n continue;\n }\n\n // value/number to range mapping\n var from = parseFloat(map.from);\n var to = parseFloat(map.to);\n if (to >= data.valueRounded && from <= data.valueRounded) {\n data.valueFormatted = map.text;\n return;\n }\n }\n }\n\n if (data.value === null || data.value === void 0) {\n data.valueFormatted = 'no value';\n }\n }\n\n removeValueMap(map) {\n var index = _.indexOf(this.panel.valueMaps, map);\n this.panel.valueMaps.splice(index, 1);\n this.render();\n }\n\n addValueMap() {\n this.panel.valueMaps.push({ value: '', op: '=', text: '' });\n }\n\n removeRangeMap(rangeMap) {\n var index = _.indexOf(this.panel.rangeMaps, rangeMap);\n this.panel.rangeMaps.splice(index, 1);\n this.render();\n }\n\n addRangeMap() {\n this.panel.rangeMaps.push({ from: '', to: '', text: '' });\n }\n\n link(scope, elem, attrs, ctrl) {\n var $location = this.$location;\n var linkSrv = this.linkSrv;\n var $timeout = this.$timeout;\n var panel = ctrl.panel;\n var templateSrv = this.templateSrv;\n var data, linkInfo;\n var $panelContainer = elem.find('.panel-container');\n elem = elem.find('.singlestat-panel');\n\n function applyColoringThresholds(value, valueString) {\n if (!panel.colorValue) {\n return valueString;\n }\n\n var color = getColorForValue(data, value);\n if (color) {\n return '' + valueString + '';\n }\n\n return valueString;\n }\n\n function getSpan(className, fontSize, value) {\n value = templateSrv.replace(value, data.scopedVars);\n return '' + value + '';\n }\n\n function getBigValueHtml() {\n var body = '
      ';\n\n if (panel.prefix) {\n var prefix = applyColoringThresholds(data.value, panel.prefix);\n body += getSpan('singlestat-panel-prefix', panel.prefixFontSize, prefix);\n }\n\n var value = applyColoringThresholds(data.value, data.valueFormatted);\n body += getSpan('singlestat-panel-value', panel.valueFontSize, value);\n\n if (panel.postfix) {\n var postfix = applyColoringThresholds(data.value, panel.postfix);\n body += getSpan('singlestat-panel-postfix', panel.postfixFontSize, postfix);\n }\n\n body += '
      ';\n\n return body;\n }\n\n function getValueText() {\n var result = panel.prefix ? templateSrv.replace(panel.prefix, data.scopedVars) : '';\n result += data.valueFormatted;\n result += panel.postfix ? templateSrv.replace(panel.postfix, data.scopedVars) : '';\n\n return result;\n }\n\n function addGauge() {\n var width = elem.width();\n var height = elem.height();\n // Allow to use a bit more space for wide gauges\n var dimension = Math.min(width, height * 1.3);\n\n ctrl.invalidGaugeRange = false;\n if (panel.gauge.minValue > panel.gauge.maxValue) {\n ctrl.invalidGaugeRange = true;\n return;\n }\n\n var plotCanvas = $('
      ');\n var plotCss = {\n top: '10px',\n margin: 'auto',\n position: 'relative',\n height: height * 0.9 + 'px',\n width: dimension + 'px',\n };\n\n plotCanvas.css(plotCss);\n\n var thresholds = [];\n for (var i = 0; i < data.thresholds.length; i++) {\n thresholds.push({\n value: data.thresholds[i],\n color: data.colorMap[i],\n });\n }\n thresholds.push({\n value: panel.gauge.maxValue,\n color: data.colorMap[data.colorMap.length - 1],\n });\n\n var bgColor = config.bootData.user.lightTheme ? 'rgb(230,230,230)' : 'rgb(38,38,38)';\n\n var fontScale = parseInt(panel.valueFontSize) / 100;\n var fontSize = Math.min(dimension / 5, 100) * fontScale;\n // Reduce gauge width if threshold labels enabled\n var gaugeWidthReduceRatio = panel.gauge.thresholdLabels ? 1.5 : 1;\n var gaugeWidth = Math.min(dimension / 6, 60) / gaugeWidthReduceRatio;\n var thresholdMarkersWidth = gaugeWidth / 5;\n var thresholdLabelFontSize = fontSize / 2.5;\n\n var options = {\n series: {\n gauges: {\n gauge: {\n min: panel.gauge.minValue,\n max: panel.gauge.maxValue,\n background: { color: bgColor },\n border: { color: null },\n shadow: { show: false },\n width: gaugeWidth,\n },\n frame: { show: false },\n label: { show: false },\n layout: { margin: 0, thresholdWidth: 0 },\n cell: { border: { width: 0 } },\n threshold: {\n values: thresholds,\n label: {\n show: panel.gauge.thresholdLabels,\n margin: thresholdMarkersWidth + 1,\n font: { size: thresholdLabelFontSize },\n },\n show: panel.gauge.thresholdMarkers,\n width: thresholdMarkersWidth,\n },\n value: {\n color: panel.colorValue ? getColorForValue(data, data.valueRounded) : null,\n formatter: function() {\n return getValueText();\n },\n font: {\n size: fontSize,\n family: '\"Helvetica Neue\", Helvetica, Arial, sans-serif',\n },\n },\n show: true,\n },\n },\n };\n\n elem.append(plotCanvas);\n\n var plotSeries = {\n data: [[0, data.valueRounded]],\n };\n\n $.plot(plotCanvas, [plotSeries], options);\n }\n\n function addSparkline() {\n var width = elem.width() + 20;\n if (width < 30) {\n // element has not gotten it's width yet\n // delay sparkline render\n setTimeout(addSparkline, 30);\n return;\n }\n\n var height = ctrl.height;\n var plotCanvas = $('
      ');\n var plotCss: any = {};\n plotCss.position = 'absolute';\n\n if (panel.sparkline.full) {\n plotCss.bottom = '5px';\n plotCss.left = '-5px';\n plotCss.width = width - 10 + 'px';\n var dynamicHeightMargin = height <= 100 ? 5 : Math.round(height / 100) * 15 + 5;\n plotCss.height = height - dynamicHeightMargin + 'px';\n } else {\n plotCss.bottom = '0px';\n plotCss.left = '-5px';\n plotCss.width = width - 10 + 'px';\n plotCss.height = Math.floor(height * 0.25) + 'px';\n }\n\n plotCanvas.css(plotCss);\n\n var options = {\n legend: { show: false },\n series: {\n lines: {\n show: true,\n fill: 1,\n zero: false,\n lineWidth: 1,\n fillColor: panel.sparkline.fillColor,\n },\n },\n yaxes: { show: false },\n xaxis: {\n show: false,\n mode: 'time',\n min: ctrl.range.from.valueOf(),\n max: ctrl.range.to.valueOf(),\n },\n grid: { hoverable: false, show: false },\n };\n\n elem.append(plotCanvas);\n\n var plotSeries = {\n data: data.flotpairs,\n color: panel.sparkline.lineColor,\n };\n\n $.plot(plotCanvas, [plotSeries], options);\n }\n\n function render() {\n if (!ctrl.data) {\n return;\n }\n data = ctrl.data;\n\n // get thresholds\n data.thresholds = panel.thresholds.split(',').map(function(strVale) {\n return Number(strVale.trim());\n });\n data.colorMap = panel.colors;\n\n var body = panel.gauge.show ? '' : getBigValueHtml();\n\n if (panel.colorBackground) {\n var color = getColorForValue(data, data.value);\n if (color) {\n $panelContainer.css('background-color', color);\n if (scope.fullscreen) {\n elem.css('background-color', color);\n } else {\n elem.css('background-color', '');\n }\n }\n } else {\n $panelContainer.css('background-color', '');\n elem.css('background-color', '');\n }\n\n elem.html(body);\n\n if (panel.sparkline.show) {\n addSparkline();\n }\n\n if (panel.gauge.show) {\n addGauge();\n }\n\n elem.toggleClass('pointer', panel.links.length > 0);\n\n if (panel.links.length > 0) {\n linkInfo = linkSrv.getPanelLinkAnchorInfo(panel.links[0], data.scopedVars);\n } else {\n linkInfo = null;\n }\n }\n\n function hookupDrilldownLinkTooltip() {\n // drilldown link tooltip\n var drilldownTooltip = $('
      hello
      \"');\n\n elem.mouseleave(function() {\n if (panel.links.length === 0) {\n return;\n }\n $timeout(function() {\n drilldownTooltip.detach();\n });\n });\n\n elem.click(function(evt) {\n if (!linkInfo) {\n return;\n }\n // ignore title clicks in title\n if ($(evt).parents('.panel-header').length > 0) {\n return;\n }\n\n if (linkInfo.target === '_blank') {\n window.open(linkInfo.href, '_blank');\n return;\n }\n\n if (linkInfo.href.indexOf('http') === 0) {\n window.location.href = linkInfo.href;\n } else {\n $timeout(function() {\n $location.url(linkInfo.href);\n });\n }\n\n drilldownTooltip.detach();\n });\n\n elem.mousemove(function(e) {\n if (!linkInfo) {\n return;\n }\n\n drilldownTooltip.text('click to go to: ' + linkInfo.title);\n drilldownTooltip.place_tt(e.pageX, e.pageY - 50);\n });\n }\n\n hookupDrilldownLinkTooltip();\n\n this.events.on('render', function() {\n render();\n ctrl.renderingCompleted();\n });\n }\n}\n\nfunction getColorForValue(data, value) {\n if (!_.isFinite(value)) {\n return null;\n }\n\n for (var i = data.thresholds.length; i > 0; i--) {\n if (value >= data.thresholds[i - 1]) {\n return data.colorMap[i];\n }\n }\n\n return _.first(data.colorMap);\n}\n\nexport { SingleStatCtrl, SingleStatCtrl as PanelCtrl, getColorForValue };\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/singlestat/module.ts","/*!\n * jquery.flot.gauge v1.1.0 *\n *\n * Flot plugin for rendering gauge charts.\n *\n * Copyright (c) 2015 @toyoty99.\n * Licensed under the MIT license.\n */\n\n/**\n * @module flot.gauge\n */\n(function($) {\n\n\n /**\n * Gauge class\n *\n * @class Gauge\n */\n var Gauge = (function() {\n /**\n * context of canvas\n *\n * @property context\n * @type Object\n */\n var context;\n /**\n * placeholder of canvas\n *\n * @property placeholder\n * @type Object\n */\n var placeholder;\n /**\n * options of plot\n *\n * @property options\n * @type Object\n */\n var options;\n /**\n * options of gauge\n *\n * @property gaugeOptions\n * @type Object\n */\n var gaugeOptions;\n /**\n * data series\n *\n * @property series\n * @type Array\n */\n var series;\n /**\n * logger\n *\n * @property logger\n * @type Object\n */\n var logger;\n\n /**\n * constructor\n *\n * @class Gauge\n * @constructor\n * @param {Object} gaugeOptions gauge options\n */\n var Gauge = function(plot, ctx) {\n context = ctx;\n placeholder = plot.getPlaceholder();\n options = plot.getOptions();\n gaugeOptions = options.series.gauges;\n series = plot.getData();\n logger = getLogger(gaugeOptions.debug);\n }\n\n /**\n * calculate layout\n *\n * @method calculateLayout\n * @return the calculated layout properties\n */\n Gauge.prototype.calculateLayout = function() {\n\n var canvasWidth = placeholder.width();\n var canvasHeight = placeholder.height();\n\n\n\n // calculate cell size\n var columns = Math.min(series.length, gaugeOptions.layout.columns);\n var rows = Math.ceil(series.length / columns);\n\n\n\n var margin = gaugeOptions.layout.margin;\n var hMargin = gaugeOptions.layout.hMargin;\n var vMargin = gaugeOptions.layout.vMargin;\n var cellWidth = (canvasWidth - (margin * 2) - (hMargin * (columns - 1))) / columns;\n var cellHeight = (canvasHeight - (margin * 2) - (vMargin * (rows - 1))) / rows;\n if (gaugeOptions.layout.square) {\n var cell = Math.min(cellWidth, cellHeight);\n cellWidth = cell;\n cellHeight = cell;\n }\n\n\n\n // calculate 'auto' values\n calculateAutoValues(gaugeOptions, cellWidth);\n\n // calculate maximum radius\n var cellMargin = gaugeOptions.cell.margin;\n var labelMargin = 0;\n var labelFontSize = 0;\n if (gaugeOptions.label.show) {\n labelMargin = gaugeOptions.label.margin;\n labelFontSize = gaugeOptions.label.font.size;\n }\n var valueMargin = 0;\n var valueFontSize = 0;\n if (gaugeOptions.value.show) {\n valueMargin = gaugeOptions.value.margin;\n valueFontSize = gaugeOptions.value.font.size;\n }\n var thresholdWidth = 0;\n if (gaugeOptions.threshold.show) {\n thresholdWidth = gaugeOptions.threshold.width;\n }\n var thresholdLabelMargin = 0;\n var thresholdLabelFontSize = 0;\n if (gaugeOptions.threshold.label.show) {\n thresholdLabelMargin = gaugeOptions.threshold.label.margin;\n thresholdLabelFontSize = gaugeOptions.threshold.label.font.size;\n }\n\n var maxRadiusH = (cellWidth / 2) - cellMargin - thresholdWidth - (thresholdLabelMargin * 2) - thresholdLabelFontSize;\n\n var startAngle = gaugeOptions.gauge.startAngle;\n var endAngle = gaugeOptions.gauge.endAngle;\n var dAngle = (endAngle - startAngle) / 100;\n var heightRatioV = -1;\n for (var a = startAngle; a < endAngle; a += dAngle) {\n heightRatioV = Math.max(heightRatioV, Math.sin(toRad(a)));\n }\n heightRatioV = Math.max(heightRatioV, Math.sin(toRad(endAngle)));\n var outerRadiusV = (cellHeight - (cellMargin * 2) - (labelMargin * 2) - labelFontSize) / (1 + heightRatioV);\n if (outerRadiusV * heightRatioV < valueMargin + (valueFontSize / 2)) {\n outerRadiusV = cellHeight - (cellMargin * 2) - (labelMargin * 2) - labelFontSize - valueMargin - (valueFontSize / 2);\n }\n var maxRadiusV = outerRadiusV - (thresholdLabelMargin * 2) - thresholdLabelFontSize - thresholdWidth;\n\n var radius = Math.min(maxRadiusH, maxRadiusV);\n\n\n var width = gaugeOptions.gauge.width;\n if (width >= radius) {\n width = Math.max(3, radius / 3);\n }\n\n\n var outerRadius = (thresholdLabelMargin * 2) + thresholdLabelFontSize + thresholdWidth + radius;\n var gaugeOuterHeight = Math.max(outerRadius * (1 + heightRatioV), outerRadius + valueMargin + (valueFontSize / 2));\n\n return {\n canvasWidth: canvasWidth,\n canvasHeight: canvasHeight,\n margin: margin,\n hMargin: hMargin,\n vMargin: vMargin,\n columns: columns,\n rows: rows,\n cellWidth: cellWidth,\n cellHeight: cellHeight,\n cellMargin: cellMargin,\n labelMargin: labelMargin,\n labelFontSize: labelFontSize,\n valueMargin: valueMargin,\n valueFontSize: valueFontSize,\n width: width,\n radius: radius,\n thresholdWidth: thresholdWidth,\n thresholdLabelMargin: thresholdLabelMargin,\n thresholdLabelFontSize: thresholdLabelFontSize,\n gaugeOuterHeight: gaugeOuterHeight\n };\n }\n\n /**\n * calculate the values which are set as 'auto'\n *\n * @method calculateAutoValues\n * @param {Object} gaugeOptionsi the options of the gauge\n * @param {Number} cellWidth the width of cell\n */\n function calculateAutoValues(gaugeOptionsi, cellWidth) {\n\n if (gaugeOptionsi.gauge.width === \"auto\") {\n gaugeOptionsi.gauge.width = Math.max(5, cellWidth / 8);\n }\n if (gaugeOptionsi.label.margin === \"auto\") {\n gaugeOptionsi.label.margin = Math.max(1, cellWidth / 20);\n }\n if (gaugeOptionsi.label.font.size === \"auto\") {\n gaugeOptionsi.label.font.size = Math.max(5, cellWidth / 8);\n }\n if (gaugeOptionsi.value.margin === \"auto\") {\n gaugeOptionsi.value.margin = Math.max(1, cellWidth / 30);\n }\n if (gaugeOptionsi.value.font.size === \"auto\") {\n gaugeOptionsi.value.font.size = Math.max(5, cellWidth / 9);\n }\n if (gaugeOptionsi.threshold.width === \"auto\") {\n gaugeOptionsi.threshold.width = Math.max(3, cellWidth / 100);\n }\n if (gaugeOptionsi.threshold.label.margin === \"auto\") {\n gaugeOptionsi.threshold.label.margin = Math.max(3, cellWidth / 40);\n }\n if (gaugeOptionsi.threshold.label.font.size === \"auto\") {\n gaugeOptionsi.threshold.label.font.size = Math.max(5, cellWidth / 15);\n }\n\n }\n Gauge.prototype.calculateAutoValues = calculateAutoValues;\n\n /**\n * calculate the layout of the cell inside\n *\n * @method calculateCellLayout\n * @param {Object} gaugeOptionsi the options of the gauge\n * @param {Number} cellWidth the width of cell\n * @param {Number} i the index of the series\n * @return the calculated cell layout properties\n */\n Gauge.prototype.calculateCellLayout = function(gaugeOptionsi, layout, i) {\n\n // calculate top, left and center\n var c = col(layout.columns, i);\n var r = row(layout.columns, i);\n var x = layout.margin + (layout.cellWidth + layout.hMargin) * c;\n var y = layout.margin + (layout.cellHeight + layout.vMargin) * r;\n var cx = x + (layout.cellWidth / 2);\n var cy = y + layout.cellMargin + (layout.labelMargin * 2) + layout.labelFontSize + layout.thresholdWidth\n + layout.thresholdLabelFontSize + (layout.thresholdLabelMargin * 2) + layout.radius;\n var blank = layout.cellHeight - (layout.cellMargin * 2) - (layout.labelMargin * 2) - layout.labelFontSize - layout.gaugeOuterHeight;\n var offsetY = 0;\n if (gaugeOptionsi.cell.vAlign === \"middle\") {\n offsetY = (blank / 2);\n } else if (gaugeOptionsi.cell.vAlign === \"bottom\") {\n offsetY = blank;\n }\n cy += offsetY;\n\n return {\n col: c,\n row: r,\n x: x,\n y: y,\n offsetY: offsetY,\n cellWidth: layout.cellWidth,\n cellHeight: layout.cellHeight,\n cellMargin: layout.cellMargin,\n cx: cx,\n cy: cy\n }\n }\n\n /**\n * draw the background of chart\n *\n * @method drawBackground\n * @param {Object} layout the layout properties\n */\n Gauge.prototype.drawBackground = function(layout) {\n\n if (!gaugeOptions.frame.show) {\n return;\n }\n context.save();\n context.strokeStyle = options.grid.borderColor;\n context.lineWidth = options.grid.borderWidth;\n context.strokeRect(0, 0, layout.canvasWidth, layout.canvasHeight);\n if (options.grid.backgroundColor) {\n context.fillStyle = options.grid.backgroundColor;\n context.fillRect(0, 0, layout.canvasWidth, layout.canvasHeight);\n }\n context.restore();\n }\n\n /**\n * draw the background of cell\n *\n * @method drawCellBackground\n * @param {Object} gaugeOptionsi the options of the gauge\n * @param {Object} cellLayout the cell layout properties\n */\n Gauge.prototype.drawCellBackground = function(gaugeOptionsi, cellLayout) {\n\n context.save();\n if (gaugeOptionsi.cell.border && gaugeOptionsi.cell.border.show && gaugeOptionsi.cell.border.color && gaugeOptionsi.cell.border.width) {\n context.strokeStyle = gaugeOptionsi.cell.border.color;\n context.lineWidth = gaugeOptionsi.cell.border.width;\n context.strokeRect(cellLayout.x, cellLayout.y, cellLayout.cellWidth, cellLayout.cellHeight);\n }\n if (gaugeOptionsi.cell.background && gaugeOptionsi.cell.background.color) {\n context.fillStyle = gaugeOptionsi.cell.background.color;\n context.fillRect(cellLayout.x, cellLayout.y, cellLayout.cellWidth, cellLayout.cellHeight);\n }\n context.restore();\n }\n\n /**\n * draw the gauge\n *\n * @method drawGauge\n * @param {Object} gaugeOptionsi the options of the gauge\n * @param {Object} layout the layout properties\n * @param {Object} cellLayout the cell layout properties\n * @param {String} label the label of data\n * @param {Number} data the value of the gauge\n */\n Gauge.prototype.drawGauge = function(gaugeOptionsi, layout, cellLayout, label, data) {\n\n\n var blur = gaugeOptionsi.gauge.shadow.show ? gaugeOptionsi.gauge.shadow.blur : 0;\n\n\n // draw gauge frame\n drawArcWithShadow(\n cellLayout.cx, // center x\n cellLayout.cy, // center y\n layout.radius,\n layout.width,\n toRad(gaugeOptionsi.gauge.startAngle),\n toRad(gaugeOptionsi.gauge.endAngle),\n gaugeOptionsi.gauge.border.color, // line color\n gaugeOptionsi.gauge.border.width, // line width\n gaugeOptionsi.gauge.background.color, // fill color\n blur);\n\n // draw gauge\n var c1 = getColor(gaugeOptionsi, data);\n var a2 = calculateAngle(gaugeOptionsi, layout, data);\n drawArcWithShadow(\n cellLayout.cx, // center x\n cellLayout.cy, // center y\n layout.radius - 1,\n layout.width - 2,\n toRad(gaugeOptionsi.gauge.startAngle),\n toRad(a2),\n c1, // line color\n 1, // line width\n c1, // fill color\n blur);\n }\n\n /**\n * decide the color of the data from the threshold options\n *\n * @method getColor\n * @private\n * @param {Object} gaugeOptionsi the options of the gauge\n * @param {Number} data the value of the gauge\n */\n function getColor(gaugeOptionsi, data) {\n var color;\n for (var i = 0; i < gaugeOptionsi.threshold.values.length; i++) {\n var threshold = gaugeOptionsi.threshold.values[i];\n color = threshold.color;\n if (data < threshold.value) {\n break;\n }\n }\n return color;\n }\n\n /**\n * calculate the angle of the data\n *\n * @method calculateAngle\n * @private\n * @param {Object} gaugeOptionsi the options of the gauge\n * @param {Object} layout the layout properties\n * @param {Number} data the value of the gauge\n */\n function calculateAngle(gaugeOptionsi, layout, data) {\n var a =\n gaugeOptionsi.gauge.startAngle\n + (gaugeOptionsi.gauge.endAngle - gaugeOptionsi.gauge.startAngle)\n * ((data - gaugeOptionsi.gauge.min) / (gaugeOptionsi.gauge.max - gaugeOptionsi.gauge.min));\n\n if (a < gaugeOptionsi.gauge.startAngle) {\n a = gaugeOptionsi.gauge.startAngle;\n } else if (a > gaugeOptionsi.gauge.endAngle) {\n a = gaugeOptionsi.gauge.endAngle;\n }\n return a;\n }\n\n /**\n * draw the arc of the threshold\n *\n * @method drawThreshold\n * @param {Object} gaugeOptionsi the options of the gauge\n * @param {Object} layout the layout properties\n * @param {Object} cellLayout the cell layout properties\n */\n Gauge.prototype.drawThreshold = function(gaugeOptionsi, layout, cellLayout) {\n\n var a1 = gaugeOptionsi.gauge.startAngle;\n for (var i = 0; i < gaugeOptionsi.threshold.values.length; i++) {\n var threshold = gaugeOptionsi.threshold.values[i];\n c1 = threshold.color;\n a2 = calculateAngle(gaugeOptionsi, layout, threshold.value);\n drawArc(\n context,\n cellLayout.cx, // center x\n cellLayout.cy, // center y\n layout.radius + layout.thresholdWidth,\n layout.thresholdWidth - 2,\n toRad(a1),\n toRad(a2),\n c1, // line color\n 1, // line width\n c1); // fill color\n a1 = a2;\n }\n }\n\n /**\n * draw an arc with a shadow\n *\n * @method drawArcWithShadow\n * @private\n * @param {Number} cx the x position of the center\n * @param {Number} cy the y position of the center\n * @param {Number} r the radius of an arc\n * @param {Number} w the width of an arc\n * @param {Number} rd1 the start angle of an arc in radians\n * @param {Number} rd2 the end angle of an arc in radians\n * @param {String} lc the color of a line\n * @param {Number} lw the widht of a line\n * @param {String} fc the fill color of an arc\n * @param {Number} blur the shdow blur\n */\n function drawArcWithShadow(cx, cy, r, w, rd1, rd2, lc, lw, fc, blur) {\n if (rd1 === rd2) {\n return;\n }\n context.save();\n\n drawArc(context, cx, cy, r, w, rd1, rd2, lc, lw, fc);\n\n if (blur) {\n drawArc(context, cx, cy, r, w, rd1, rd2);\n context.clip();\n context.shadowOffsetX = 0;\n context.shadowOffsetY = 0;\n context.shadowBlur = 10;\n context.shadowColor = \"gray\";\n drawArc(context, cx, cy, r + 1, w + 2, rd1, rd2, lc, 1);\n }\n context.restore();\n }\n\n /**\n * draw the label of the gauge\n *\n * @method drawLable\n * @param {Object} gaugeOptionsi the options of the gauge\n * @param {Object} layout the layout properties\n * @param {Object} cellLayout the cell layout properties\n * @param {Number} i the index of the series\n * @param {Object} item the item of the series\n */\n Gauge.prototype.drawLable = function(gaugeOptionsi, layout, cellLayout, i, item) {\n\n drawText(\n cellLayout.cx,\n cellLayout.y + cellLayout.cellMargin + layout.labelMargin + cellLayout.offsetY,\n \"flotGagueLabel\" + i,\n gaugeOptionsi.label.formatter ? gaugeOptionsi.label.formatter(item.label, item.data[0][1]) : text,\n gaugeOptionsi.label);\n }\n\n /**\n * draw the value of the gauge\n *\n * @method drawValue\n * @param {Object} gaugeOptionsi the options of the gauge\n * @param {Object} layout the layout properties\n * @param {Object} cellLayout the cell layout properties\n * @param {Number} i the index of the series\n * @param {Object} item the item of the series\n */\n Gauge.prototype.drawValue = function(gaugeOptionsi, layout, cellLayout, i, item) {\n\n drawText(\n cellLayout.cx,\n cellLayout.cy - (gaugeOptionsi.value.font.size / 2),\n \"flotGagueValue\" + i,\n gaugeOptionsi.value.formatter ? gaugeOptionsi.value.formatter(item.label, item.data[0][1]) : text,\n gaugeOptionsi.value);\n }\n\n /**\n * draw the values of the threshold\n *\n * @method drawThresholdValues\n * @param {Object} gaugeOptionsi the options of the gauge\n * @param {Object} layout the layout properties\n * @param {Object} cellLayout the cell layout properties\n * @param {Number} i the index of the series\n */\n Gauge.prototype.drawThresholdValues = function(gaugeOptionsi, layout, cellLayout, i) {\n\n // min, max\n drawThresholdValue(gaugeOptionsi, layout, cellLayout, \"Min\" + i, gaugeOptionsi.gauge.min, gaugeOptionsi.gauge.startAngle);\n drawThresholdValue(gaugeOptionsi, layout, cellLayout, \"Max\" + i, gaugeOptionsi.gauge.max, gaugeOptionsi.gauge.endAngle);\n // threshold values\n for (var j = 0; j < gaugeOptionsi.threshold.values.length; j++) {\n var threshold = gaugeOptionsi.threshold.values[j];\n if (threshold.value > gaugeOptionsi.gauge.min && threshold.value < gaugeOptionsi.gauge.max) {\n var a = calculateAngle(gaugeOptionsi, layout, threshold.value);\n drawThresholdValue(gaugeOptionsi, layout, cellLayout, i + \"_\" + j, threshold.value, a);\n }\n }\n }\n\n /**\n * draw the value of the threshold\n *\n * @method drawThresholdValue\n * @param {Object} gaugeOptionsi the options of the gauge\n * @param {Object} layout the layout properties\n * @param {Object} cellLayout the cell layout properties\n * @param {Number} i the index of the series\n * @param {Number} value the value of the threshold\n * @param {Number} a the angle of the value drawn\n */\n function drawThresholdValue(gaugeOptionsi, layout, cellLayout, i, value, a) {\n drawText(\n cellLayout.cx\n + ((layout.thresholdLabelMargin + (layout.thresholdLabelFontSize / 2) + layout.radius)\n * Math.cos(toRad(a))),\n cellLayout.cy\n + ((layout.thresholdLabelMargin + (layout.thresholdLabelFontSize / 2) + layout.radius)\n * Math.sin(toRad(a))),\n \"flotGagueThresholdValue\" + i,\n gaugeOptionsi.threshold.label.formatter ? gaugeOptionsi.threshold.label.formatter(value) : value,\n gaugeOptionsi.threshold.label,\n a);\n }\n\n /**\n * draw a text\n *\n * the textOptions is assumed as follows:\n *\n * textOptions: {\n * background: {\n * color: null,\n * opacity: 0\n * },\n * font: {\n * size: \"auto\"\n * family: \"\\\"MS ゴシック\\\",sans-serif\"\n * },\n * color: null\n * }\n *\n * @method drawText\n * @private\n * @param {Number} x the x position of the text drawn (left top)\n * @param {Number} y the y position of the text drawn (left top)\n * @param {String} id the id of the dom element\n * @param {String} text the text drawn\n * @param {Object} textOptions the option of the text\n * @param {Number} [a] the angle of the value drawn\n */\n function drawText(x, y, id, text, textOptions, a) {\n var span = $(\".\" + id, placeholder);\n var exists = span.length;\n if (!exists) {\n span = $(\"\")\n span.attr(\"id\", id);\n span.css(\"position\", \"absolute\");\n span.css(\"top\", y + \"px\");\n if (textOptions.font.size) {\n span.css(\"font-size\", textOptions.font.size + \"px\");\n }\n if (textOptions.font.family) {\n span.css(\"font-family\", textOptions.font.family);\n }\n if (textOptions.color) {\n span.css(\"color\", textOptions.color);\n }\n if (textOptions.background.color) {\n span.css(\"background-color\", textOptions.background.color);\n }\n if (textOptions.background.opacity) {\n span.css(\"opacity\", textOptions.background.opacity);\n }\n placeholder.append(span);\n }\n span.text(text);\n // after append, readjust the left position\n span.css(\"left\", x + \"px\"); // for redraw, resetting the left position is needed here\n span.css(\"left\", (parseInt(span.css(\"left\")) - (span.width()/ 2)) + \"px\");\n\n // at last, set angle\n if (!exists && a) {\n span.css(\"top\", (parseInt(span.css(\"top\")) - (span.height()/ 2)) + \"px\");\n span.css(\"transform\", \"rotate(\" + ((180 * a) + 90) + \"deg)\"); // not supported for ie8\n }\n }\n\n return Gauge;\n })();\n /**\n * get a instance of Logger\n *\n * @method getLogger\n * @for flot.gauge\n * @private\n * @param {Object} debugOptions the options of debug\n */\n function getLogger(debugOptions) {\n return typeof Logger !== \"undefined\" ? new Logger(debugOptions) : null;\n }\n\n /**\n * calculate the index of columns for the specified data\n *\n * @method col\n * @for flot.gauge\n * @param {Number} columns the number of columns\n * @param {Number} i the index of the series\n * @return the index of columns\n */\n function col(columns, i) {\n return i % columns;\n }\n\n /**\n * calculate the index of rows for the specified data\n *\n * @method row\n * @for flot.gauge\n * @param {Number} columns the number of rows\n * @param {Number} i the index of the series\n * @return the index of rows\n */\n function row(columns, i) {\n return Math.floor(i / columns);\n }\n\n /**\n * calculate the angle in radians\n *\n * internally, use a number without PI (0 - 2).\n * so, in this function, multiply PI\n *\n * @method toRad\n * @for flot.gauge\n * @param {Number} a the number of angle without PI\n * @return the angle in radians\n */\n function toRad(a) {\n return a * Math.PI;\n }\n\n /**\n * draw an arc\n *\n * @method drawArc\n * @for flot.gauge\n * @param {Object} context the context of canvas\n * @param {Number} cx the x position of the center\n * @param {Number} cy the y position of the center\n * @param {Number} r the radius of an arc\n * @param {Number} w the width of an arc\n * @param {Number} rd1 the start angle of an arc in radians\n * @param {Number} rd2 the end angle of an arc in radians\n * @param {String} lc the color of a line\n * @param {Number} lw the widht of a line\n * @param {String} fc the fill color of an arc\n */\n function drawArc(context, cx, cy, r, w, rd1, rd2, lc, lw, fc) {\n if (rd1 === rd2) {\n return;\n }\n var counterClockwise = false;\n context.save();\n context.beginPath();\n context.arc(cx, cy, r, rd1, rd2, counterClockwise);\n context.lineTo(cx + (r - w) * Math.cos(rd2),\n cy + (r - w) * Math.sin(rd2));\n context.arc(cx, cy, r - w, rd2, rd1, !counterClockwise);\n context.closePath();\n if (lw) {\n context.lineWidth = lw;\n }\n if (lc) {\n context.strokeStyle = lc;\n context.stroke();\n }\n if (fc) {\n context.fillStyle = fc;\n context.fill();\n }\n context.restore();\n }\n\n /**\n * initialize plugin\n *\n * @method init\n * @for flot.gauge\n * @private\n * @param {Object} plot a instance of plot\n */\n function init (plot) {\n // add processOptions hook\n plot.hooks.processOptions.push(function(plot, options) {\n var logger = getLogger(options.series.gauges.debug);\n\n\n\n\n // turn 'grid' and 'legend' off\n if (options.series.gauges.show) {\n options.grid.show = false;\n options.legend.show = false;\n }\n\n // sort threshold\n var thresholds = options.series.gauges.threshold.values;\n\n thresholds.sort(function(a, b) {\n if (a.value < b.value) {\n return -1;\n } else if (a.value > b.value) {\n return 1;\n } else {\n return 0;\n }\n });\n\n\n\n });\n\n // add draw hook\n plot.hooks.draw.push(function(plot, context) {\n var options = plot.getOptions();\n var gaugeOptions = options.series.gauges;\n\n var logger = getLogger(gaugeOptions.debug);\n\n\n if (!gaugeOptions.show) {\n return;\n }\n\n var series = plot.getData();\n\n if (!series || !series.length) {\n return; // if no series were passed\n }\n\n var gauge = new Gauge(plot, context);\n\n // calculate layout\n var layout = gauge.calculateLayout();\n\n // debug layout\n if (gaugeOptions.debug.layout) {\n\n }\n\n // draw background\n gauge.drawBackground(layout)\n\n // draw cells (label, gauge, value, threshold)\n for (var i = 0; i < series.length; i++) {\n var item = series[i];\n\n var gaugeOptionsi = $.extend({}, gaugeOptions, item.gauges);\n if (item.gauges) {\n // re-calculate 'auto' values\n gauge.calculateAutoValues(gaugeOptionsi, layout.cellWidth);\n }\n\n // calculate cell layout\n var cellLayout = gauge.calculateCellLayout(gaugeOptionsi, layout, i);\n\n // draw cell background\n gauge.drawCellBackground(gaugeOptionsi, cellLayout)\n // debug layout\n if (gaugeOptionsi.debug.layout) {\n\n }\n // draw label\n if (gaugeOptionsi.label.show) {\n gauge.drawLable(gaugeOptionsi, layout, cellLayout, i, item);\n }\n // draw gauge\n gauge.drawGauge(gaugeOptionsi, layout, cellLayout, item.label, item.data[0][1]);\n // draw threshold\n if (gaugeOptionsi.threshold.show) {\n gauge.drawThreshold(gaugeOptionsi, layout, cellLayout);\n }\n if (gaugeOptionsi.threshold.label.show) {\n gauge.drawThresholdValues(gaugeOptionsi, layout, cellLayout, i)\n }\n // draw value\n if (gaugeOptionsi.value.show) {\n gauge.drawValue(gaugeOptionsi, layout, cellLayout, i, item);\n }\n }\n });\n }\n\n /**\n * [defaults description]\n *\n * @property defaults\n * @type {Object}\n */\n var defaults = {\n series: {\n gauges: {\n debug: {\n log: false,\n layout: false,\n alert: false\n },\n show: false,\n layout: {\n margin: 5,\n columns: 3,\n hMargin: 5,\n vMargin: 5,\n square: false\n },\n frame: {\n show: true\n },\n cell: {\n background: {\n color: null\n },\n border: {\n show: true,\n color: \"black\",\n width: 1\n },\n margin: 5,\n vAlign: \"middle\" // 'top' or 'middle' or 'bottom'\n },\n gauge: {\n width: \"auto\", // a specified number, or 'auto'\n startAngle: 0.9, // 0 - 2 factor of the radians\n endAngle: 2.1, // 0 - 2 factor of the radians\n min: 0,\n max: 100,\n background: {\n color: \"white\"\n },\n border: {\n color: \"lightgray\",\n width: 2\n },\n shadow: {\n show: true,\n blur: 5\n }\n },\n label: {\n show: true,\n margin: \"auto\", // a specified number, or 'auto'\n background: {\n color: null,\n opacity: 0\n },\n font: {\n size: \"auto\", // a specified number, or 'auto'\n family: \"sans-serif\"\n },\n color: null,\n formatter: function(label, value) {\n return label;\n }\n },\n value: {\n show: true,\n margin: \"auto\", // a specified number, or 'auto'\n background: {\n color: null,\n opacity: 0\n },\n font: {\n size: \"auto\", // a specified number, or 'auto'\n family: \"sans-serif\"\n },\n color: null,\n formatter: function(label, value) {\n return parseInt(value);\n }\n },\n threshold: {\n show: true,\n width: \"auto\", // a specified number, or 'auto'\n label: {\n show: true,\n margin: \"auto\", // a specified number, or 'auto'\n background: {\n color: null,\n opacity: 0\n },\n font: {\n size: \"auto\", // a specified number, or 'auto'\n family: \",sans-serif\"\n },\n color: null,\n formatter: function(value) {\n return value;\n }\n },\n values: [\n {\n value: 50,\n color: \"lightgreen\"\n }, {\n value: 80,\n color: \"yellow\"\n }, {\n value: 100,\n color: \"red\"\n }\n ]\n }\n }\n }\n };\n\n // register the gauge plugin\n $.plot.plugins.push({\n init: init,\n options: defaults,\n name: \"gauge\",\n version: \"1.1.0\"\n });\n\n})(jQuery);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./public/vendor/flot/jquery.flot.gauge.js\n// module id = 2164\n// module chunks = 0","import { PanelCtrl } from 'app/plugins/sdk';\n\nimport { contextSrv } from 'app/core/core';\n\nclass GettingStartedPanelCtrl extends PanelCtrl {\n static templateUrl = 'public/app/plugins/panel/gettingstarted/module.html';\n checksDone: boolean;\n stepIndex: number;\n steps: any;\n\n /** @ngInject **/\n constructor($scope, $injector, private backendSrv, datasourceSrv, private $q) {\n super($scope, $injector);\n\n this.stepIndex = 0;\n this.steps = [];\n\n this.steps.push({\n title: 'Install Grafana',\n icon: 'icon-gf icon-gf-check',\n href: 'http://docs.grafana.org/',\n target: '_blank',\n note: 'Review the installation docs',\n check: () => $q.when(true),\n });\n\n this.steps.push({\n title: 'Create your first data source',\n cta: 'Add data source',\n icon: 'icon-gf icon-gf-datasources',\n href: 'datasources/new?gettingstarted',\n check: () => {\n return $q.when(\n datasourceSrv.getMetricSources().filter(item => {\n return item.meta.builtIn !== true;\n }).length > 0\n );\n },\n });\n\n this.steps.push({\n title: 'Create your first dashboard',\n cta: 'New dashboard',\n icon: 'icon-gf icon-gf-dashboard',\n href: 'dashboard/new?gettingstarted',\n check: () => {\n return this.backendSrv.search({ limit: 1 }).then(result => {\n return result.length > 0;\n });\n },\n });\n\n this.steps.push({\n title: 'Invite your team',\n cta: 'Add Users',\n icon: 'icon-gf icon-gf-users',\n href: 'org/users?gettingstarted',\n check: () => {\n return this.backendSrv.get('/api/org/users').then(res => {\n return res.length > 1;\n });\n },\n });\n\n this.steps.push({\n title: 'Install apps & plugins',\n cta: 'Explore plugin repository',\n icon: 'icon-gf icon-gf-apps',\n href: 'https://grafana.com/plugins?utm_source=grafana_getting_started',\n check: () => {\n return this.backendSrv.get('/api/plugins', { embedded: 0, core: 0 }).then(plugins => {\n return plugins.length > 0;\n });\n },\n });\n }\n\n $onInit() {\n this.stepIndex = -1;\n return this.nextStep().then(res => {\n this.checksDone = true;\n });\n }\n\n nextStep() {\n if (this.stepIndex === this.steps.length - 1) {\n return this.$q.when();\n }\n\n this.stepIndex += 1;\n var currentStep = this.steps[this.stepIndex];\n return currentStep.check().then(passed => {\n if (passed) {\n currentStep.cssClass = 'completed';\n return this.nextStep();\n }\n\n currentStep.cssClass = 'active';\n return this.$q.when();\n });\n }\n\n dismiss() {\n this.dashboard.removePanel(this.panel, false);\n\n this.backendSrv\n .request({\n method: 'PUT',\n url: '/api/user/helpflags/1',\n showSuccessAlert: false,\n })\n .then(res => {\n contextSrv.user.helpFlags1 = res.helpFlags1;\n });\n }\n}\n\nexport { GettingStartedPanelCtrl, GettingStartedPanelCtrl as PanelCtrl };\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/gettingstarted/module.ts","import { PanelCtrl } from 'app/features/panel/panel_ctrl';\n\nexport class ExperimentPanelCtrl extends PanelCtrl {\n static templateUrl = 'public/app/plugins/panel/experimentdetails/module.html';\n experiment: {};\n\n /** @ngInject */\n constructor($scope, $injector, backendSrv, variableSrv) {\n super($scope, $injector);\n\n if (!this.dashboard.snapshot) {\n var experimentIdVars = variableSrv.variables.filter(v => v.name === 'experiment_id');\n if (experimentIdVars.length > 0) {\n var experimentId = experimentIdVars[0].current.value;\n console.log('exp id', experimentId);\n backendSrv.get('/api/experiments/' + experimentId).then(experiment => {\n var duration = (experiment.stoppedNs - experiment.startedNs) / Math.pow(10, 9);\n experiment.duration = duration;\n experiment.created = new Date(experiment.created).toString();\n\n this.experiment = experiment;\n });\n }\n }\n\n this.events.on('refresh', this.onExperimentDetailsPanelRefresh.bind(this));\n }\n\n onExperimentDetailsPanelRefresh() {\n if (this.dashboard.snapshot) {\n if (this.panel.snapshotData) {\n this.experiment = this.panel.snapshotData;\n } else if (this.experiment) {\n this.panel.snapshotData = this.experiment;\n }\n }\n }\n}\n\nexport { ExperimentPanelCtrl as PanelCtrl };\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/experimentdetails/module.ts","import { PanelCtrl } from 'app/features/panel/panel_ctrl';\nimport { appEvents } from 'app/core/core';\nimport * as Uppy from 'uppy';\n\nexport class ExperimentVideoPanelCtrl extends PanelCtrl {\n static templateUrl = 'public/app/plugins/panel/experimentvideo/module.html';\n videoUrl: String;\n offsetSec: Number;\n syncEnabled: Boolean;\n player: any;\n experiment: any;\n uppy: any;\n isTranscoding = false;\n intervalJob: any;\n\n /** @ngInject */\n constructor($scope, $injector, experimentSrv, private backendSrv, private alertSrv, private $interval) {\n super($scope, $injector);\n\n experimentSrv.getCurrent().then((exp: any) => {\n this.experiment = exp;\n this.videoUrl = exp.videoUrl;\n if ('videoStartSec' in exp) {\n this.offsetSec = exp.videoStartSec;\n }\n\n if (this.videoUrl && !this.videoUrl.toLowerCase().startsWith('http')) {\n this.isTranscoding = true;\n this.monitorTranscodeProgress();\n }\n });\n }\n\n syncClicked() {\n if (!this.syncEnabled) {\n appEvents.emit('graph-hover-clear');\n }\n }\n\n getCountdownTimeSeconds(exp) {\n if (!exp || !exp.notes) {\n return null;\n }\n let match = exp.notes.match(/countdown: (\\d+)/);\n if (!match) {\n return null;\n }\n let val = parseFloat(match[1]);\n if (isNaN(val)) {\n return null;\n }\n return val / 1000;\n }\n\n setRefClicked() {\n var time = this.getCountdownTimeSeconds(this.experiment);\n var defaultValue = time ? (-time).toString() : '';\n\n var input = prompt('Current time in player is (enter: -50 for T-50 seconds):', defaultValue);\n\n if (input == null) {\n return;\n }\n\n var val = parseFloat(input);\n if (isNaN(val)) {\n alert('Invalid offset: not a number.');\n return;\n }\n\n let offset = -this.player.currentTime() + val;\n console.log('SET TZERO, player time: ', offset);\n this.offsetSec = offset;\n this.backendSrv.updateExperimentSilent(this.experiment.id, { videoStartSec: offset });\n }\n\n initializeUploader() {\n let experimentId = this.experiment.id;\n let uploadedVideoFilename;\n\n this.uppy = Uppy.Core({ allowMultipleUploads: false })\n .use(Uppy.Dashboard, {\n inline: false,\n target: 'body',\n })\n .use(Uppy.AwsS3, {\n getUploadParameters(file) {\n let re = /(?:\\.([^.]+))?$/;\n let ext = re.exec(file.name)[1];\n uploadedVideoFilename = 'videoupload-' + experimentId + '.' + ext;\n\n return fetch('/api/s3-sign-upload', {\n method: 'post',\n headers: {\n accept: 'application/json',\n 'content-type': 'application/json',\n },\n body: JSON.stringify({\n filename: uploadedVideoFilename,\n contentType: file.type,\n }),\n })\n .then(response => {\n return response.json();\n })\n .then(data => {\n let result = {\n method: 'PUT',\n url: data.url,\n fields: {},\n headers: {},\n };\n return result;\n });\n },\n\n limit: 1,\n });\n\n this.uppy.on('complete', result => {\n console.log('Upload complete! We’ve uploaded these files:', result.successful);\n this.backendSrv.experimentCreateVideoJob(this.experiment.id, uploadedVideoFilename).then(result => {\n this.alertSrv.set('Processing video...', '', 'success', 10000);\n this.uppy.close();\n this.isTranscoding = true;\n this.monitorTranscodeProgress();\n });\n });\n }\n\n showUploadDialog() {\n this.initializeUploader();\n this.uppy.getPlugin('Dashboard').openModal();\n }\n\n monitorTranscodeProgress() {\n this.intervalJob = this.$interval(() => {\n console.log('transcode progress check...');\n this.backendSrv.experimentGetVideoJob(this.experiment.id).then(result => {\n if (result.status && result.status.toLowerCase() === 'complete') {\n console.log('Job Complete!');\n this.$interval.cancel(this.intervalJob);\n this.videoUrl = result.url;\n this.isTranscoding = false;\n }\n });\n }, 10000);\n }\n}\n\nexport { ExperimentVideoPanelCtrl as PanelCtrl };\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/experimentvideo/module.ts","import _ from 'lodash';\n\nclass TestDataDatasource {\n id: any;\n\n /** @ngInject */\n constructor(instanceSettings, private backendSrv, private $q) {\n this.id = instanceSettings.id;\n }\n\n query(options) {\n var queries = _.filter(options.targets, item => {\n return item.hide !== true;\n }).map(item => {\n return {\n refId: item.refId,\n scenarioId: item.scenarioId,\n intervalMs: options.intervalMs,\n maxDataPoints: options.maxDataPoints,\n stringInput: item.stringInput,\n points: item.points,\n alias: item.alias,\n datasourceId: this.id,\n };\n });\n\n if (queries.length === 0) {\n return this.$q.when({ data: [] });\n }\n\n return this.backendSrv\n .post('/api/tsdb/query', {\n from: options.range.from.valueOf().toString(),\n to: options.range.to.valueOf().toString(),\n queries: queries,\n })\n .then(res => {\n var data = [];\n\n if (res.results) {\n _.forEach(res.results, queryRes => {\n for (let series of queryRes.series) {\n data.push({\n target: series.name,\n datapoints: series.points,\n });\n }\n });\n }\n\n return { data: data };\n });\n }\n\n annotationQuery(options) {\n return this.backendSrv.get('/api/annotations', {\n from: options.range.from.valueOf(),\n to: options.range.to.valueOf(),\n limit: options.limit,\n type: options.type,\n });\n }\n}\n\nexport { TestDataDatasource };\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/app/testdata/datasource/datasource.ts","export class ConfigCtrl {\n static template = '';\n\n appEditCtrl: any;\n\n /** @ngInject **/\n constructor(private backendSrv) {\n this.appEditCtrl.setPreUpdateHook(this.initDatasource.bind(this));\n }\n\n initDatasource() {\n return this.backendSrv.get('/api/datasources').then(res => {\n var found = false;\n for (let ds of res) {\n if (ds.type === 'grafana-testdata-datasource') {\n found = true;\n }\n }\n\n if (!found) {\n var dsInstance = {\n name: 'Grafana TestData',\n type: 'grafana-testdata-datasource',\n access: 'direct',\n jsonData: {},\n };\n\n return this.backendSrv.post('/api/datasources', dsInstance);\n }\n\n return Promise.resolve();\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/app/testdata/module.ts","import { TestDataDatasource } from './datasource';\nimport { TestDataQueryCtrl } from './query_ctrl';\n\nclass TestDataAnnotationsQueryCtrl {\n annotation: any;\n\n constructor() {}\n\n static template = '

      test data

      ';\n}\n\nexport {\n TestDataDatasource,\n TestDataDatasource as Datasource,\n TestDataQueryCtrl as QueryCtrl,\n TestDataAnnotationsQueryCtrl as AnnotationsQueryCtrl,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/app/testdata/datasource/module.ts","import _ from 'lodash';\n\nimport { QueryCtrl } from 'app/plugins/sdk';\nimport moment from 'moment';\n\nexport class TestDataQueryCtrl extends QueryCtrl {\n static templateUrl = 'partials/query.editor.html';\n\n scenarioList: any;\n scenario: any;\n newPointValue: number;\n newPointTime: any;\n selectedPoint: any;\n\n /** @ngInject **/\n constructor($scope, $injector, private backendSrv) {\n super($scope, $injector);\n\n this.target.scenarioId = this.target.scenarioId || 'random_walk';\n this.scenarioList = [];\n this.newPointTime = moment();\n this.selectedPoint = { text: 'Select point', value: null };\n }\n\n getPoints() {\n return _.map(this.target.points, (point, index) => {\n return {\n text: moment(point[1]).format('MMMM Do YYYY, H:mm:ss') + ' : ' + point[0],\n value: index,\n };\n });\n }\n\n pointSelected(option) {\n this.selectedPoint = option;\n }\n\n deletePoint() {\n this.target.points.splice(this.selectedPoint.value, 1);\n this.selectedPoint = { text: 'Select point', value: null };\n this.refresh();\n }\n\n addPoint() {\n this.target.points = this.target.points || [];\n this.target.points.push([this.newPointValue, this.newPointTime.valueOf()]);\n this.target.points = _.sortBy(this.target.points, p => p[1]);\n this.refresh();\n }\n\n $onInit() {\n return this.backendSrv.get('/api/tsdb/testdata/scenarios').then(res => {\n this.scenarioList = res;\n this.scenario = _.find(this.scenarioList, { id: this.target.scenarioId });\n });\n }\n\n scenarioChanged() {\n this.scenario = _.find(this.scenarioList, { id: this.target.scenarioId });\n this.target.stringInput = this.scenario.stringInput;\n\n if (this.target.scenarioId === 'manual_entry') {\n this.target.points = this.target.points || [];\n } else {\n delete this.target.points;\n }\n\n this.refresh();\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/app/testdata/datasource/query_ctrl.ts","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Observable_1 = require('./Observable');\nvar Subscriber_1 = require('./Subscriber');\nvar Subscription_1 = require('./Subscription');\nvar ObjectUnsubscribedError_1 = require('./util/ObjectUnsubscribedError');\nvar SubjectSubscription_1 = require('./SubjectSubscription');\nvar rxSubscriber_1 = require('./symbol/rxSubscriber');\n/**\n * @class SubjectSubscriber\n */\nvar SubjectSubscriber = (function (_super) {\n __extends(SubjectSubscriber, _super);\n function SubjectSubscriber(destination) {\n _super.call(this, destination);\n this.destination = destination;\n }\n return SubjectSubscriber;\n}(Subscriber_1.Subscriber));\nexports.SubjectSubscriber = SubjectSubscriber;\n/**\n * @class Subject\n */\nvar Subject = (function (_super) {\n __extends(Subject, _super);\n function Subject() {\n _super.call(this);\n this.observers = [];\n this.closed = false;\n this.isStopped = false;\n this.hasError = false;\n this.thrownError = null;\n }\n Subject.prototype[rxSubscriber_1.rxSubscriber] = function () {\n return new SubjectSubscriber(this);\n };\n Subject.prototype.lift = function (operator) {\n var subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n };\n Subject.prototype.next = function (value) {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n if (!this.isStopped) {\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].next(value);\n }\n }\n };\n Subject.prototype.error = function (err) {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n this.hasError = true;\n this.thrownError = err;\n this.isStopped = true;\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].error(err);\n }\n this.observers.length = 0;\n };\n Subject.prototype.complete = function () {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n this.isStopped = true;\n var observers = this.observers;\n var len = observers.length;\n var copy = observers.slice();\n for (var i = 0; i < len; i++) {\n copy[i].complete();\n }\n this.observers.length = 0;\n };\n Subject.prototype.unsubscribe = function () {\n this.isStopped = true;\n this.closed = true;\n this.observers = null;\n };\n Subject.prototype._trySubscribe = function (subscriber) {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n else {\n return _super.prototype._trySubscribe.call(this, subscriber);\n }\n };\n /** @deprecated internal use only */ Subject.prototype._subscribe = function (subscriber) {\n if (this.closed) {\n throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError();\n }\n else if (this.hasError) {\n subscriber.error(this.thrownError);\n return Subscription_1.Subscription.EMPTY;\n }\n else if (this.isStopped) {\n subscriber.complete();\n return Subscription_1.Subscription.EMPTY;\n }\n else {\n this.observers.push(subscriber);\n return new SubjectSubscription_1.SubjectSubscription(this, subscriber);\n }\n };\n Subject.prototype.asObservable = function () {\n var observable = new Observable_1.Observable();\n observable.source = this;\n return observable;\n };\n Subject.create = function (destination, source) {\n return new AnonymousSubject(destination, source);\n };\n return Subject;\n}(Observable_1.Observable));\nexports.Subject = Subject;\n/**\n * @class AnonymousSubject\n */\nvar AnonymousSubject = (function (_super) {\n __extends(AnonymousSubject, _super);\n function AnonymousSubject(destination, source) {\n _super.call(this);\n this.destination = destination;\n this.source = source;\n }\n AnonymousSubject.prototype.next = function (value) {\n var destination = this.destination;\n if (destination && destination.next) {\n destination.next(value);\n }\n };\n AnonymousSubject.prototype.error = function (err) {\n var destination = this.destination;\n if (destination && destination.error) {\n this.destination.error(err);\n }\n };\n AnonymousSubject.prototype.complete = function () {\n var destination = this.destination;\n if (destination && destination.complete) {\n this.destination.complete();\n }\n };\n /** @deprecated internal use only */ AnonymousSubject.prototype._subscribe = function (subscriber) {\n var source = this.source;\n if (source) {\n return this.source.subscribe(subscriber);\n }\n else {\n return Subscription_1.Subscription.EMPTY;\n }\n };\n return AnonymousSubject;\n}(Subject));\nexports.AnonymousSubject = AnonymousSubject;\n//# sourceMappingURL=Subject.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/Subject.js\n// module id = 2172\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscription_1 = require('./Subscription');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar SubjectSubscription = (function (_super) {\n __extends(SubjectSubscription, _super);\n function SubjectSubscription(subject, subscriber) {\n _super.call(this);\n this.subject = subject;\n this.subscriber = subscriber;\n this.closed = false;\n }\n SubjectSubscription.prototype.unsubscribe = function () {\n if (this.closed) {\n return;\n }\n this.closed = true;\n var subject = this.subject;\n var observers = subject.observers;\n this.subject = null;\n if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {\n return;\n }\n var subscriberIndex = observers.indexOf(this.subscriber);\n if (subscriberIndex !== -1) {\n observers.splice(subscriberIndex, 1);\n }\n };\n return SubjectSubscription;\n}(Subscription_1.Subscription));\nexports.SubjectSubscription = SubjectSubscription;\n//# sourceMappingURL=SubjectSubscription.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/SubjectSubscription.js\n// module id = 2174\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\n/**\n * An error thrown when an action is invalid because the object has been\n * unsubscribed.\n *\n * @see {@link Subject}\n * @see {@link BehaviorSubject}\n *\n * @class ObjectUnsubscribedError\n */\nvar ObjectUnsubscribedError = (function (_super) {\n __extends(ObjectUnsubscribedError, _super);\n function ObjectUnsubscribedError() {\n var err = _super.call(this, 'object unsubscribed');\n this.name = err.name = 'ObjectUnsubscribedError';\n this.stack = err.stack;\n this.message = err.message;\n }\n return ObjectUnsubscribedError;\n}(Error));\nexports.ObjectUnsubscribedError = ObjectUnsubscribedError;\n//# sourceMappingURL=ObjectUnsubscribedError.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/util/ObjectUnsubscribedError.js\n// module id = 2173\n// module chunks = 0","\"use strict\";\nvar Observable_1 = require('../../Observable');\nvar empty_1 = require('../../observable/empty');\nObservable_1.Observable.empty = empty_1.empty;\n//# sourceMappingURL=empty.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/add/observable/empty.js\n// module id = 2175\n// module chunks = 0","\"use strict\";\nvar Observable_1 = require('../../Observable');\nvar from_1 = require('../../observable/from');\nObservable_1.Observable.from = from_1.from;\n//# sourceMappingURL=from.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/add/observable/from.js\n// module id = 2177\n// module chunks = 0","\"use strict\";\nvar FromObservable_1 = require('./FromObservable');\nexports.from = FromObservable_1.FromObservable.create;\n//# sourceMappingURL=from.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/observable/from.js\n// module id = 2178\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar isArray_1 = require('../util/isArray');\nvar isArrayLike_1 = require('../util/isArrayLike');\nvar isPromise_1 = require('../util/isPromise');\nvar PromiseObservable_1 = require('./PromiseObservable');\nvar IteratorObservable_1 = require('./IteratorObservable');\nvar ArrayObservable_1 = require('./ArrayObservable');\nvar ArrayLikeObservable_1 = require('./ArrayLikeObservable');\nvar iterator_1 = require('../symbol/iterator');\nvar Observable_1 = require('../Observable');\nvar observeOn_1 = require('../operators/observeOn');\nvar observable_1 = require('../symbol/observable');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar FromObservable = (function (_super) {\n __extends(FromObservable, _super);\n function FromObservable(ish, scheduler) {\n _super.call(this, null);\n this.ish = ish;\n this.scheduler = scheduler;\n }\n /**\n * Creates an Observable from an Array, an array-like object, a Promise, an\n * iterable object, or an Observable-like object.\n *\n * Converts almost anything to an Observable.\n *\n * \n *\n * Convert various other objects and data types into Observables. `from`\n * converts a Promise or an array-like or an\n * [iterable](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterable)\n * object into an Observable that emits the items in that promise or array or\n * iterable. A String, in this context, is treated as an array of characters.\n * Observable-like objects (contains a function named with the ES2015 Symbol\n * for Observable) can also be converted through this operator.\n *\n * @example \n * var array = [10, 20, 30];\n * var result = Rx.Observable.from(array);\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // 10 20 30\n *\n * @example \n * function* generateDoubles(seed) {\n * var i = seed;\n * while (true) {\n * yield i;\n * i = 2 * i; // double it\n * }\n * }\n *\n * var iterator = generateDoubles(3);\n * var result = Rx.Observable.from(iterator).take(10);\n * result.subscribe(x => console.log(x));\n *\n * // Results in the following:\n * // 3 6 12 24 48 96 192 384 768 1536\n *\n * @see {@link create}\n * @see {@link fromEvent}\n * @see {@link fromEventPattern}\n * @see {@link fromPromise}\n *\n * @param {ObservableInput} ish A subscribable object, a Promise, an\n * Observable-like, an Array, an iterable or an array-like object to be\n * converted.\n * @param {Scheduler} [scheduler] The scheduler on which to schedule the\n * emissions of values.\n * @return {Observable} The Observable whose values are originally from the\n * input object that was converted.\n * @static true\n * @name from\n * @owner Observable\n */\n FromObservable.create = function (ish, scheduler) {\n if (ish != null) {\n if (typeof ish[observable_1.observable] === 'function') {\n if (ish instanceof Observable_1.Observable && !scheduler) {\n return ish;\n }\n return new FromObservable(ish, scheduler);\n }\n else if (isArray_1.isArray(ish)) {\n return new ArrayObservable_1.ArrayObservable(ish, scheduler);\n }\n else if (isPromise_1.isPromise(ish)) {\n return new PromiseObservable_1.PromiseObservable(ish, scheduler);\n }\n else if (typeof ish[iterator_1.iterator] === 'function' || typeof ish === 'string') {\n return new IteratorObservable_1.IteratorObservable(ish, scheduler);\n }\n else if (isArrayLike_1.isArrayLike(ish)) {\n return new ArrayLikeObservable_1.ArrayLikeObservable(ish, scheduler);\n }\n }\n throw new TypeError((ish !== null && typeof ish || ish) + ' is not observable');\n };\n /** @deprecated internal use only */ FromObservable.prototype._subscribe = function (subscriber) {\n var ish = this.ish;\n var scheduler = this.scheduler;\n if (scheduler == null) {\n return ish[observable_1.observable]().subscribe(subscriber);\n }\n else {\n return ish[observable_1.observable]().subscribe(new observeOn_1.ObserveOnSubscriber(subscriber, scheduler, 0));\n }\n };\n return FromObservable;\n}(Observable_1.Observable));\nexports.FromObservable = FromObservable;\n//# sourceMappingURL=FromObservable.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/observable/FromObservable.js\n// module id = 2179\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar root_1 = require('../util/root');\nvar Observable_1 = require('../Observable');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar PromiseObservable = (function (_super) {\n __extends(PromiseObservable, _super);\n function PromiseObservable(promise, scheduler) {\n _super.call(this);\n this.promise = promise;\n this.scheduler = scheduler;\n }\n /**\n * Converts a Promise to an Observable.\n *\n * Returns an Observable that just emits the Promise's\n * resolved value, then completes.\n *\n * Converts an ES2015 Promise or a Promises/A+ spec compliant Promise to an\n * Observable. If the Promise resolves with a value, the output Observable\n * emits that resolved value as a `next`, and then completes. If the Promise\n * is rejected, then the output Observable emits the corresponding Error.\n *\n * @example \n * var result = Rx.Observable.fromPromise(fetch('http://myserver.com/'));\n * result.subscribe(x => console.log(x), e => console.error(e));\n *\n * @see {@link bindCallback}\n * @see {@link from}\n *\n * @param {PromiseLike} promise The promise to be converted.\n * @param {Scheduler} [scheduler] An optional IScheduler to use for scheduling\n * the delivery of the resolved value (or the rejection).\n * @return {Observable} An Observable which wraps the Promise.\n * @static true\n * @name fromPromise\n * @owner Observable\n */\n PromiseObservable.create = function (promise, scheduler) {\n return new PromiseObservable(promise, scheduler);\n };\n /** @deprecated internal use only */ PromiseObservable.prototype._subscribe = function (subscriber) {\n var _this = this;\n var promise = this.promise;\n var scheduler = this.scheduler;\n if (scheduler == null) {\n if (this._isScalar) {\n if (!subscriber.closed) {\n subscriber.next(this.value);\n subscriber.complete();\n }\n }\n else {\n promise.then(function (value) {\n _this.value = value;\n _this._isScalar = true;\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n }, function (err) {\n if (!subscriber.closed) {\n subscriber.error(err);\n }\n })\n .then(null, function (err) {\n // escape the promise trap, throw unhandled errors\n root_1.root.setTimeout(function () { throw err; });\n });\n }\n }\n else {\n if (this._isScalar) {\n if (!subscriber.closed) {\n return scheduler.schedule(dispatchNext, 0, { value: this.value, subscriber: subscriber });\n }\n }\n else {\n promise.then(function (value) {\n _this.value = value;\n _this._isScalar = true;\n if (!subscriber.closed) {\n subscriber.add(scheduler.schedule(dispatchNext, 0, { value: value, subscriber: subscriber }));\n }\n }, function (err) {\n if (!subscriber.closed) {\n subscriber.add(scheduler.schedule(dispatchError, 0, { err: err, subscriber: subscriber }));\n }\n })\n .then(null, function (err) {\n // escape the promise trap, throw unhandled errors\n root_1.root.setTimeout(function () { throw err; });\n });\n }\n }\n };\n return PromiseObservable;\n}(Observable_1.Observable));\nexports.PromiseObservable = PromiseObservable;\nfunction dispatchNext(arg) {\n var value = arg.value, subscriber = arg.subscriber;\n if (!subscriber.closed) {\n subscriber.next(value);\n subscriber.complete();\n }\n}\nfunction dispatchError(arg) {\n var err = arg.err, subscriber = arg.subscriber;\n if (!subscriber.closed) {\n subscriber.error(err);\n }\n}\n//# sourceMappingURL=PromiseObservable.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/observable/PromiseObservable.js\n// module id = 2180\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar root_1 = require('../util/root');\nvar Observable_1 = require('../Observable');\nvar iterator_1 = require('../symbol/iterator');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar IteratorObservable = (function (_super) {\n __extends(IteratorObservable, _super);\n function IteratorObservable(iterator, scheduler) {\n _super.call(this);\n this.scheduler = scheduler;\n if (iterator == null) {\n throw new Error('iterator cannot be null.');\n }\n this.iterator = getIterator(iterator);\n }\n IteratorObservable.create = function (iterator, scheduler) {\n return new IteratorObservable(iterator, scheduler);\n };\n IteratorObservable.dispatch = function (state) {\n var index = state.index, hasError = state.hasError, iterator = state.iterator, subscriber = state.subscriber;\n if (hasError) {\n subscriber.error(state.error);\n return;\n }\n var result = iterator.next();\n if (result.done) {\n subscriber.complete();\n return;\n }\n subscriber.next(result.value);\n state.index = index + 1;\n if (subscriber.closed) {\n if (typeof iterator.return === 'function') {\n iterator.return();\n }\n return;\n }\n this.schedule(state);\n };\n /** @deprecated internal use only */ IteratorObservable.prototype._subscribe = function (subscriber) {\n var index = 0;\n var _a = this, iterator = _a.iterator, scheduler = _a.scheduler;\n if (scheduler) {\n return scheduler.schedule(IteratorObservable.dispatch, 0, {\n index: index, iterator: iterator, subscriber: subscriber\n });\n }\n else {\n do {\n var result = iterator.next();\n if (result.done) {\n subscriber.complete();\n break;\n }\n else {\n subscriber.next(result.value);\n }\n if (subscriber.closed) {\n if (typeof iterator.return === 'function') {\n iterator.return();\n }\n break;\n }\n } while (true);\n }\n };\n return IteratorObservable;\n}(Observable_1.Observable));\nexports.IteratorObservable = IteratorObservable;\nvar StringIterator = (function () {\n function StringIterator(str, idx, len) {\n if (idx === void 0) { idx = 0; }\n if (len === void 0) { len = str.length; }\n this.str = str;\n this.idx = idx;\n this.len = len;\n }\n StringIterator.prototype[iterator_1.iterator] = function () { return (this); };\n StringIterator.prototype.next = function () {\n return this.idx < this.len ? {\n done: false,\n value: this.str.charAt(this.idx++)\n } : {\n done: true,\n value: undefined\n };\n };\n return StringIterator;\n}());\nvar ArrayIterator = (function () {\n function ArrayIterator(arr, idx, len) {\n if (idx === void 0) { idx = 0; }\n if (len === void 0) { len = toLength(arr); }\n this.arr = arr;\n this.idx = idx;\n this.len = len;\n }\n ArrayIterator.prototype[iterator_1.iterator] = function () { return this; };\n ArrayIterator.prototype.next = function () {\n return this.idx < this.len ? {\n done: false,\n value: this.arr[this.idx++]\n } : {\n done: true,\n value: undefined\n };\n };\n return ArrayIterator;\n}());\nfunction getIterator(obj) {\n var i = obj[iterator_1.iterator];\n if (!i && typeof obj === 'string') {\n return new StringIterator(obj);\n }\n if (!i && obj.length !== undefined) {\n return new ArrayIterator(obj);\n }\n if (!i) {\n throw new TypeError('object is not iterable');\n }\n return obj[iterator_1.iterator]();\n}\nvar maxSafeInteger = Math.pow(2, 53) - 1;\nfunction toLength(o) {\n var len = +o.length;\n if (isNaN(len)) {\n return 0;\n }\n if (len === 0 || !numberIsFinite(len)) {\n return len;\n }\n len = sign(len) * Math.floor(Math.abs(len));\n if (len <= 0) {\n return 0;\n }\n if (len > maxSafeInteger) {\n return maxSafeInteger;\n }\n return len;\n}\nfunction numberIsFinite(value) {\n return typeof value === 'number' && root_1.root.isFinite(value);\n}\nfunction sign(value) {\n var valueAsNumber = +value;\n if (valueAsNumber === 0) {\n return valueAsNumber;\n }\n if (isNaN(valueAsNumber)) {\n return valueAsNumber;\n }\n return valueAsNumber < 0 ? -1 : 1;\n}\n//# sourceMappingURL=IteratorObservable.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/observable/IteratorObservable.js\n// module id = 2181\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Observable_1 = require('../Observable');\nvar ScalarObservable_1 = require('./ScalarObservable');\nvar EmptyObservable_1 = require('./EmptyObservable');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @extends {Ignored}\n * @hide true\n */\nvar ArrayLikeObservable = (function (_super) {\n __extends(ArrayLikeObservable, _super);\n function ArrayLikeObservable(arrayLike, scheduler) {\n _super.call(this);\n this.arrayLike = arrayLike;\n this.scheduler = scheduler;\n if (!scheduler && arrayLike.length === 1) {\n this._isScalar = true;\n this.value = arrayLike[0];\n }\n }\n ArrayLikeObservable.create = function (arrayLike, scheduler) {\n var length = arrayLike.length;\n if (length === 0) {\n return new EmptyObservable_1.EmptyObservable();\n }\n else if (length === 1) {\n return new ScalarObservable_1.ScalarObservable(arrayLike[0], scheduler);\n }\n else {\n return new ArrayLikeObservable(arrayLike, scheduler);\n }\n };\n ArrayLikeObservable.dispatch = function (state) {\n var arrayLike = state.arrayLike, index = state.index, length = state.length, subscriber = state.subscriber;\n if (subscriber.closed) {\n return;\n }\n if (index >= length) {\n subscriber.complete();\n return;\n }\n subscriber.next(arrayLike[index]);\n state.index = index + 1;\n this.schedule(state);\n };\n /** @deprecated internal use only */ ArrayLikeObservable.prototype._subscribe = function (subscriber) {\n var index = 0;\n var _a = this, arrayLike = _a.arrayLike, scheduler = _a.scheduler;\n var length = arrayLike.length;\n if (scheduler) {\n return scheduler.schedule(ArrayLikeObservable.dispatch, 0, {\n arrayLike: arrayLike, index: index, length: length, subscriber: subscriber\n });\n }\n else {\n for (var i = 0; i < length && !subscriber.closed; i++) {\n subscriber.next(arrayLike[i]);\n }\n subscriber.complete();\n }\n };\n return ArrayLikeObservable;\n}(Observable_1.Observable));\nexports.ArrayLikeObservable = ArrayLikeObservable;\n//# sourceMappingURL=ArrayLikeObservable.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/observable/ArrayLikeObservable.js\n// module id = 2183\n// module chunks = 0","\"use strict\";\nfunction isScheduler(value) {\n return value && typeof value.schedule === 'function';\n}\nexports.isScheduler = isScheduler;\n//# sourceMappingURL=isScheduler.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/util/isScheduler.js\n// module id = 2182\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscriber_1 = require('../Subscriber');\nvar Notification_1 = require('../Notification');\n/**\n *\n * Re-emits all notifications from source Observable with specified scheduler.\n *\n * Ensure a specific scheduler is used, from outside of an Observable.\n *\n * `observeOn` is an operator that accepts a scheduler as a first parameter, which will be used to reschedule\n * notifications emitted by the source Observable. It might be useful, if you do not have control over\n * internal scheduler of a given Observable, but want to control when its values are emitted nevertheless.\n *\n * Returned Observable emits the same notifications (nexted values, complete and error events) as the source Observable,\n * but rescheduled with provided scheduler. Note that this doesn't mean that source Observables internal\n * scheduler will be replaced in any way. Original scheduler still will be used, but when the source Observable emits\n * notification, it will be immediately scheduled again - this time with scheduler passed to `observeOn`.\n * An anti-pattern would be calling `observeOn` on Observable that emits lots of values synchronously, to split\n * that emissions into asynchronous chunks. For this to happen, scheduler would have to be passed into the source\n * Observable directly (usually into the operator that creates it). `observeOn` simply delays notifications a\n * little bit more, to ensure that they are emitted at expected moments.\n *\n * As a matter of fact, `observeOn` accepts second parameter, which specifies in milliseconds with what delay notifications\n * will be emitted. The main difference between {@link delay} operator and `observeOn` is that `observeOn`\n * will delay all notifications - including error notifications - while `delay` will pass through error\n * from source Observable immediately when it is emitted. In general it is highly recommended to use `delay` operator\n * for any kind of delaying of values in the stream, while using `observeOn` to specify which scheduler should be used\n * for notification emissions in general.\n *\n * @example \n * const intervals = Rx.Observable.interval(10); // Intervals are scheduled\n * // with async scheduler by default...\n *\n * intervals\n * .observeOn(Rx.Scheduler.animationFrame) // ...but we will observe on animationFrame\n * .subscribe(val => { // scheduler to ensure smooth animation.\n * someDiv.style.height = val + 'px';\n * });\n *\n * @see {@link delay}\n *\n * @param {IScheduler} scheduler Scheduler that will be used to reschedule notifications from source Observable.\n * @param {number} [delay] Number of milliseconds that states with what delay every notification should be rescheduled.\n * @return {Observable} Observable that emits the same notifications as the source Observable,\n * but with provided scheduler.\n *\n * @method observeOn\n * @owner Observable\n */\nfunction observeOn(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n return function observeOnOperatorFunction(source) {\n return source.lift(new ObserveOnOperator(scheduler, delay));\n };\n}\nexports.observeOn = observeOn;\nvar ObserveOnOperator = (function () {\n function ObserveOnOperator(scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n this.scheduler = scheduler;\n this.delay = delay;\n }\n ObserveOnOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));\n };\n return ObserveOnOperator;\n}());\nexports.ObserveOnOperator = ObserveOnOperator;\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar ObserveOnSubscriber = (function (_super) {\n __extends(ObserveOnSubscriber, _super);\n function ObserveOnSubscriber(destination, scheduler, delay) {\n if (delay === void 0) { delay = 0; }\n _super.call(this, destination);\n this.scheduler = scheduler;\n this.delay = delay;\n }\n ObserveOnSubscriber.dispatch = function (arg) {\n var notification = arg.notification, destination = arg.destination;\n notification.observe(destination);\n this.unsubscribe();\n };\n ObserveOnSubscriber.prototype.scheduleMessage = function (notification) {\n this.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination)));\n };\n ObserveOnSubscriber.prototype._next = function (value) {\n this.scheduleMessage(Notification_1.Notification.createNext(value));\n };\n ObserveOnSubscriber.prototype._error = function (err) {\n this.scheduleMessage(Notification_1.Notification.createError(err));\n };\n ObserveOnSubscriber.prototype._complete = function () {\n this.scheduleMessage(Notification_1.Notification.createComplete());\n };\n return ObserveOnSubscriber;\n}(Subscriber_1.Subscriber));\nexports.ObserveOnSubscriber = ObserveOnSubscriber;\nvar ObserveOnMessage = (function () {\n function ObserveOnMessage(notification, destination) {\n this.notification = notification;\n this.destination = destination;\n }\n return ObserveOnMessage;\n}());\nexports.ObserveOnMessage = ObserveOnMessage;\n//# sourceMappingURL=observeOn.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/operators/observeOn.js\n// module id = 2184\n// module chunks = 0","\"use strict\";\nvar Observable_1 = require('./Observable');\n/**\n * Represents a push-based event or value that an {@link Observable} can emit.\n * This class is particularly useful for operators that manage notifications,\n * like {@link materialize}, {@link dematerialize}, {@link observeOn}, and\n * others. Besides wrapping the actual delivered value, it also annotates it\n * with metadata of, for instance, what type of push message it is (`next`,\n * `error`, or `complete`).\n *\n * @see {@link materialize}\n * @see {@link dematerialize}\n * @see {@link observeOn}\n *\n * @class Notification\n */\nvar Notification = (function () {\n function Notification(kind, value, error) {\n this.kind = kind;\n this.value = value;\n this.error = error;\n this.hasValue = kind === 'N';\n }\n /**\n * Delivers to the given `observer` the value wrapped by this Notification.\n * @param {Observer} observer\n * @return\n */\n Notification.prototype.observe = function (observer) {\n switch (this.kind) {\n case 'N':\n return observer.next && observer.next(this.value);\n case 'E':\n return observer.error && observer.error(this.error);\n case 'C':\n return observer.complete && observer.complete();\n }\n };\n /**\n * Given some {@link Observer} callbacks, deliver the value represented by the\n * current Notification to the correctly corresponding callback.\n * @param {function(value: T): void} next An Observer `next` callback.\n * @param {function(err: any): void} [error] An Observer `error` callback.\n * @param {function(): void} [complete] An Observer `complete` callback.\n * @return {any}\n */\n Notification.prototype.do = function (next, error, complete) {\n var kind = this.kind;\n switch (kind) {\n case 'N':\n return next && next(this.value);\n case 'E':\n return error && error(this.error);\n case 'C':\n return complete && complete();\n }\n };\n /**\n * Takes an Observer or its individual callback functions, and calls `observe`\n * or `do` methods accordingly.\n * @param {Observer|function(value: T): void} nextOrObserver An Observer or\n * the `next` callback.\n * @param {function(err: any): void} [error] An Observer `error` callback.\n * @param {function(): void} [complete] An Observer `complete` callback.\n * @return {any}\n */\n Notification.prototype.accept = function (nextOrObserver, error, complete) {\n if (nextOrObserver && typeof nextOrObserver.next === 'function') {\n return this.observe(nextOrObserver);\n }\n else {\n return this.do(nextOrObserver, error, complete);\n }\n };\n /**\n * Returns a simple Observable that just delivers the notification represented\n * by this Notification instance.\n * @return {any}\n */\n Notification.prototype.toObservable = function () {\n var kind = this.kind;\n switch (kind) {\n case 'N':\n return Observable_1.Observable.of(this.value);\n case 'E':\n return Observable_1.Observable.throw(this.error);\n case 'C':\n return Observable_1.Observable.empty();\n }\n throw new Error('unexpected notification kind value');\n };\n /**\n * A shortcut to create a Notification instance of the type `next` from a\n * given value.\n * @param {T} value The `next` value.\n * @return {Notification} The \"next\" Notification representing the\n * argument.\n */\n Notification.createNext = function (value) {\n if (typeof value !== 'undefined') {\n return new Notification('N', value);\n }\n return Notification.undefinedValueNotification;\n };\n /**\n * A shortcut to create a Notification instance of the type `error` from a\n * given error.\n * @param {any} [err] The `error` error.\n * @return {Notification} The \"error\" Notification representing the\n * argument.\n */\n Notification.createError = function (err) {\n return new Notification('E', undefined, err);\n };\n /**\n * A shortcut to create a Notification instance of the type `complete`.\n * @return {Notification} The valueless \"complete\" Notification.\n */\n Notification.createComplete = function () {\n return Notification.completeNotification;\n };\n Notification.completeNotification = new Notification('C');\n Notification.undefinedValueNotification = new Notification('N', undefined);\n return Notification;\n}());\nexports.Notification = Notification;\n//# sourceMappingURL=Notification.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/Notification.js\n// module id = 2185\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscriber_1 = require('../Subscriber');\n/**\n * Applies a given `project` function to each value emitted by the source\n * Observable, and emits the resulting values as an Observable.\n *\n * Like [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map),\n * it passes each source value through a transformation function to get\n * corresponding output values.\n *\n * \n *\n * Similar to the well known `Array.prototype.map` function, this operator\n * applies a projection to each value and emits that projection in the output\n * Observable.\n *\n * @example \n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var positions = clicks.map(ev => ev.clientX);\n * positions.subscribe(x => console.log(x));\n *\n * @see {@link mapTo}\n * @see {@link pluck}\n *\n * @param {function(value: T, index: number): R} project The function to apply\n * to each `value` emitted by the source Observable. The `index` parameter is\n * the number `i` for the i-th emission that has happened since the\n * subscription, starting from the number `0`.\n * @param {any} [thisArg] An optional argument to define what `this` is in the\n * `project` function.\n * @return {Observable} An Observable that emits the values from the source\n * Observable transformed by the given `project` function.\n * @method map\n * @owner Observable\n */\nfunction map(project, thisArg) {\n return function mapOperation(source) {\n if (typeof project !== 'function') {\n throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');\n }\n return source.lift(new MapOperator(project, thisArg));\n };\n}\nexports.map = map;\nvar MapOperator = (function () {\n function MapOperator(project, thisArg) {\n this.project = project;\n this.thisArg = thisArg;\n }\n MapOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));\n };\n return MapOperator;\n}());\nexports.MapOperator = MapOperator;\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar MapSubscriber = (function (_super) {\n __extends(MapSubscriber, _super);\n function MapSubscriber(destination, project, thisArg) {\n _super.call(this, destination);\n this.project = project;\n this.count = 0;\n this.thisArg = thisArg || this;\n }\n // NOTE: This looks unoptimized, but it's actually purposefully NOT\n // using try/catch optimizations.\n MapSubscriber.prototype._next = function (value) {\n var result;\n try {\n result = this.project.call(this.thisArg, value, this.count++);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n return MapSubscriber;\n}(Subscriber_1.Subscriber));\n//# sourceMappingURL=map.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/operators/map.js\n// module id = 2188\n// module chunks = 0","\"use strict\";\nvar Observable_1 = require('../../Observable');\nvar map_1 = require('../../operator/map');\nObservable_1.Observable.prototype.map = map_1.map;\n//# sourceMappingURL=map.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/add/operator/map.js\n// module id = 2186\n// module chunks = 0","\"use strict\";\nvar map_1 = require('../operators/map');\n/**\n * Applies a given `project` function to each value emitted by the source\n * Observable, and emits the resulting values as an Observable.\n *\n * Like [Array.prototype.map()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map),\n * it passes each source value through a transformation function to get\n * corresponding output values.\n *\n * \n *\n * Similar to the well known `Array.prototype.map` function, this operator\n * applies a projection to each value and emits that projection in the output\n * Observable.\n *\n * @example \n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var positions = clicks.map(ev => ev.clientX);\n * positions.subscribe(x => console.log(x));\n *\n * @see {@link mapTo}\n * @see {@link pluck}\n *\n * @param {function(value: T, index: number): R} project The function to apply\n * to each `value` emitted by the source Observable. The `index` parameter is\n * the number `i` for the i-th emission that has happened since the\n * subscription, starting from the number `0`.\n * @param {any} [thisArg] An optional argument to define what `this` is in the\n * `project` function.\n * @return {Observable} An Observable that emits the values from the source\n * Observable transformed by the given `project` function.\n * @method map\n * @owner Observable\n */\nfunction map(project, thisArg) {\n return map_1.map(project, thisArg)(this);\n}\nexports.map = map;\n//# sourceMappingURL=map.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/operator/map.js\n// module id = 2187\n// module chunks = 0","\"use strict\";\nvar combineAll_1 = require('../operators/combineAll');\n/**\n * Converts a higher-order Observable into a first-order Observable by waiting\n * for the outer Observable to complete, then applying {@link combineLatest}.\n *\n * Flattens an Observable-of-Observables by applying\n * {@link combineLatest} when the Observable-of-Observables completes.\n *\n * \n *\n * Takes an Observable of Observables, and collects all Observables from it.\n * Once the outer Observable completes, it subscribes to all collected\n * Observables and combines their values using the {@link combineLatest}\n * strategy, such that:\n * - Every time an inner Observable emits, the output Observable emits.\n * - When the returned observable emits, it emits all of the latest values by:\n * - If a `project` function is provided, it is called with each recent value\n * from each inner Observable in whatever order they arrived, and the result\n * of the `project` function is what is emitted by the output Observable.\n * - If there is no `project` function, an array of all of the most recent\n * values is emitted by the output Observable.\n *\n * @example \n * var clicks = Rx.Observable.fromEvent(document, 'click');\n * var higherOrder = clicks.map(ev =>\n * Rx.Observable.interval(Math.random()*2000).take(3)\n * ).take(2);\n * var result = higherOrder.combineAll();\n * result.subscribe(x => console.log(x));\n *\n * @see {@link combineLatest}\n * @see {@link mergeAll}\n *\n * @param {function} [project] An optional function to map the most recent\n * values from each inner Observable into a new result. Takes each of the most\n * recent values from each collected inner Observable as arguments, in order.\n * @return {Observable} An Observable of projected results or arrays of recent\n * values.\n * @method combineAll\n * @owner Observable\n */\nfunction combineAll(project) {\n return combineAll_1.combineAll(project)(this);\n}\nexports.combineAll = combineAll;\n//# sourceMappingURL=combineAll.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/operator/combineAll.js\n// module id = 2190\n// module chunks = 0","\"use strict\";\nvar combineLatest_1 = require('../operators/combineLatest');\nfunction combineAll(project) {\n return function (source) { return source.lift(new combineLatest_1.CombineLatestOperator(project)); };\n}\nexports.combineAll = combineAll;\n//# sourceMappingURL=combineAll.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/operators/combineAll.js\n// module id = 2191\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar ArrayObservable_1 = require('../observable/ArrayObservable');\nvar isArray_1 = require('../util/isArray');\nvar OuterSubscriber_1 = require('../OuterSubscriber');\nvar subscribeToResult_1 = require('../util/subscribeToResult');\nvar none = {};\n/* tslint:enable:max-line-length */\n/**\n * Combines multiple Observables to create an Observable whose values are\n * calculated from the latest values of each of its input Observables.\n *\n * Whenever any input Observable emits a value, it\n * computes a formula using the latest values from all the inputs, then emits\n * the output of that formula.\n *\n * \n *\n * `combineLatest` combines the values from this Observable with values from\n * Observables passed as arguments. This is done by subscribing to each\n * Observable, in order, and collecting an array of each of the most recent\n * values any time any of the input Observables emits, then either taking that\n * array and passing it as arguments to an optional `project` function and\n * emitting the return value of that, or just emitting the array of recent\n * values directly if there is no `project` function.\n *\n * @example \n * var weight = Rx.Observable.of(70, 72, 76, 79, 75);\n * var height = Rx.Observable.of(1.76, 1.77, 1.78);\n * var bmi = weight.combineLatest(height, (w, h) => w / (h * h));\n * bmi.subscribe(x => console.log('BMI is ' + x));\n *\n * // With output to console:\n * // BMI is 24.212293388429753\n * // BMI is 23.93948099205209\n * // BMI is 23.671253629592222\n *\n * @see {@link combineAll}\n * @see {@link merge}\n * @see {@link withLatestFrom}\n *\n * @param {ObservableInput} other An input Observable to combine with the source\n * Observable. More than one input Observables may be given as argument.\n * @param {function} [project] An optional function to project the values from\n * the combined latest values into a new value on the output Observable.\n * @return {Observable} An Observable of projected values from the most recent\n * values from each input Observable, or an array of the most recent values from\n * each input Observable.\n * @method combineLatest\n * @owner Observable\n */\nfunction combineLatest() {\n var observables = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n observables[_i - 0] = arguments[_i];\n }\n var project = null;\n if (typeof observables[observables.length - 1] === 'function') {\n project = observables.pop();\n }\n // if the first and only other argument besides the resultSelector is an array\n // assume it's been called with `combineLatest([obs1, obs2, obs3], project)`\n if (observables.length === 1 && isArray_1.isArray(observables[0])) {\n observables = observables[0].slice();\n }\n return function (source) { return source.lift.call(new ArrayObservable_1.ArrayObservable([source].concat(observables)), new CombineLatestOperator(project)); };\n}\nexports.combineLatest = combineLatest;\nvar CombineLatestOperator = (function () {\n function CombineLatestOperator(project) {\n this.project = project;\n }\n CombineLatestOperator.prototype.call = function (subscriber, source) {\n return source.subscribe(new CombineLatestSubscriber(subscriber, this.project));\n };\n return CombineLatestOperator;\n}());\nexports.CombineLatestOperator = CombineLatestOperator;\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar CombineLatestSubscriber = (function (_super) {\n __extends(CombineLatestSubscriber, _super);\n function CombineLatestSubscriber(destination, project) {\n _super.call(this, destination);\n this.project = project;\n this.active = 0;\n this.values = [];\n this.observables = [];\n }\n CombineLatestSubscriber.prototype._next = function (observable) {\n this.values.push(none);\n this.observables.push(observable);\n };\n CombineLatestSubscriber.prototype._complete = function () {\n var observables = this.observables;\n var len = observables.length;\n if (len === 0) {\n this.destination.complete();\n }\n else {\n this.active = len;\n this.toRespond = len;\n for (var i = 0; i < len; i++) {\n var observable = observables[i];\n this.add(subscribeToResult_1.subscribeToResult(this, observable, observable, i));\n }\n }\n };\n CombineLatestSubscriber.prototype.notifyComplete = function (unused) {\n if ((this.active -= 1) === 0) {\n this.destination.complete();\n }\n };\n CombineLatestSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n var values = this.values;\n var oldVal = values[outerIndex];\n var toRespond = !this.toRespond\n ? 0\n : oldVal === none ? --this.toRespond : this.toRespond;\n values[outerIndex] = innerValue;\n if (toRespond === 0) {\n if (this.project) {\n this._tryProject(values);\n }\n else {\n this.destination.next(values.slice());\n }\n }\n };\n CombineLatestSubscriber.prototype._tryProject = function (values) {\n var result;\n try {\n result = this.project.apply(this, values);\n }\n catch (err) {\n this.destination.error(err);\n return;\n }\n this.destination.next(result);\n };\n return CombineLatestSubscriber;\n}(OuterSubscriber_1.OuterSubscriber));\nexports.CombineLatestSubscriber = CombineLatestSubscriber;\n//# sourceMappingURL=combineLatest.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/operators/combineLatest.js\n// module id = 2192\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscriber_1 = require('./Subscriber');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar OuterSubscriber = (function (_super) {\n __extends(OuterSubscriber, _super);\n function OuterSubscriber() {\n _super.apply(this, arguments);\n }\n OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {\n this.destination.next(innerValue);\n };\n OuterSubscriber.prototype.notifyError = function (error, innerSub) {\n this.destination.error(error);\n };\n OuterSubscriber.prototype.notifyComplete = function (innerSub) {\n this.destination.complete();\n };\n return OuterSubscriber;\n}(Subscriber_1.Subscriber));\nexports.OuterSubscriber = OuterSubscriber;\n//# sourceMappingURL=OuterSubscriber.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/OuterSubscriber.js\n// module id = 2193\n// module chunks = 0","\"use strict\";\nvar root_1 = require('./root');\nvar isArrayLike_1 = require('./isArrayLike');\nvar isPromise_1 = require('./isPromise');\nvar isObject_1 = require('./isObject');\nvar Observable_1 = require('../Observable');\nvar iterator_1 = require('../symbol/iterator');\nvar InnerSubscriber_1 = require('../InnerSubscriber');\nvar observable_1 = require('../symbol/observable');\nfunction subscribeToResult(outerSubscriber, result, outerValue, outerIndex) {\n var destination = new InnerSubscriber_1.InnerSubscriber(outerSubscriber, outerValue, outerIndex);\n if (destination.closed) {\n return null;\n }\n if (result instanceof Observable_1.Observable) {\n if (result._isScalar) {\n destination.next(result.value);\n destination.complete();\n return null;\n }\n else {\n destination.syncErrorThrowable = true;\n return result.subscribe(destination);\n }\n }\n else if (isArrayLike_1.isArrayLike(result)) {\n for (var i = 0, len = result.length; i < len && !destination.closed; i++) {\n destination.next(result[i]);\n }\n if (!destination.closed) {\n destination.complete();\n }\n }\n else if (isPromise_1.isPromise(result)) {\n result.then(function (value) {\n if (!destination.closed) {\n destination.next(value);\n destination.complete();\n }\n }, function (err) { return destination.error(err); })\n .then(null, function (err) {\n // Escaping the Promise trap: globally throw unhandled errors\n root_1.root.setTimeout(function () { throw err; });\n });\n return destination;\n }\n else if (result && typeof result[iterator_1.iterator] === 'function') {\n var iterator = result[iterator_1.iterator]();\n do {\n var item = iterator.next();\n if (item.done) {\n destination.complete();\n break;\n }\n destination.next(item.value);\n if (destination.closed) {\n break;\n }\n } while (true);\n }\n else if (result && typeof result[observable_1.observable] === 'function') {\n var obs = result[observable_1.observable]();\n if (typeof obs.subscribe !== 'function') {\n destination.error(new TypeError('Provided object does not correctly implement Symbol.observable'));\n }\n else {\n return obs.subscribe(new InnerSubscriber_1.InnerSubscriber(outerSubscriber, outerValue, outerIndex));\n }\n }\n else {\n var value = isObject_1.isObject(result) ? 'an invalid object' : \"'\" + result + \"'\";\n var msg = (\"You provided \" + value + \" where a stream was expected.\")\n + ' You can provide an Observable, Promise, Array, or Iterable.';\n destination.error(new TypeError(msg));\n }\n return null;\n}\nexports.subscribeToResult = subscribeToResult;\n//# sourceMappingURL=subscribeToResult.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/util/subscribeToResult.js\n// module id = 2194\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || function (d, b) {\n for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n};\nvar Subscriber_1 = require('./Subscriber');\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nvar InnerSubscriber = (function (_super) {\n __extends(InnerSubscriber, _super);\n function InnerSubscriber(parent, outerValue, outerIndex) {\n _super.call(this);\n this.parent = parent;\n this.outerValue = outerValue;\n this.outerIndex = outerIndex;\n this.index = 0;\n }\n InnerSubscriber.prototype._next = function (value) {\n this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);\n };\n InnerSubscriber.prototype._error = function (error) {\n this.parent.notifyError(error, this);\n this.unsubscribe();\n };\n InnerSubscriber.prototype._complete = function () {\n this.parent.notifyComplete(this);\n this.unsubscribe();\n };\n return InnerSubscriber;\n}(Subscriber_1.Subscriber));\nexports.InnerSubscriber = InnerSubscriber;\n//# sourceMappingURL=InnerSubscriber.js.map\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/rxjs/InnerSubscriber.js\n// module id = 2195\n// module chunks = 0","/* Flot plugin for rendering pie charts.\n\nCopyright (c) 2007-2013 IOLA and Ole Laursen.\nLicensed under the MIT license.\n\nThe plugin assumes that each series has a single data value, and that each\nvalue is a positive integer or zero. Negative numbers don't make sense for a\npie chart, and have unpredictable results. The values do NOT need to be\npassed in as percentages; the plugin will calculate the total and per-slice\npercentages internally.\n\n* Created by Brian Medendorp\n\n* Updated with contributions from btburnett3, Anthony Aragues and Xavi Ivars\n\nThe plugin supports these options:\n\n\tseries: {\n\t\tpie: {\n\t\t\tshow: true/false\n\t\t\tradius: 0-1 for percentage of fullsize, or a specified pixel length, or 'auto'\n\t\t\tinnerRadius: 0-1 for percentage of fullsize or a specified pixel length, for creating a donut effect\n\t\t\tstartAngle: 0-2 factor of PI used for starting angle (in radians) i.e 3/2 starts at the top, 0 and 2 have the same result\n\t\t\ttilt: 0-1 for percentage to tilt the pie, where 1 is no tilt, and 0 is completely flat (nothing will show)\n\t\t\toffset: {\n\t\t\t\ttop: integer value to move the pie up or down\n\t\t\t\tleft: integer value to move the pie left or right, or 'auto'\n\t\t\t},\n\t\t\tstroke: {\n\t\t\t\tcolor: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#FFF')\n\t\t\t\twidth: integer pixel width of the stroke\n\t\t\t},\n\t\t\tlabel: {\n\t\t\t\tshow: true/false, or 'auto'\n\t\t\t\tformatter: a user-defined function that modifies the text/style of the label text\n\t\t\t\tradius: 0-1 for percentage of fullsize, or a specified pixel length\n\t\t\t\tbackground: {\n\t\t\t\t\tcolor: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#000')\n\t\t\t\t\topacity: 0-1\n\t\t\t\t},\n\t\t\t\tthreshold: 0-1 for the percentage value at which to hide labels (if they're too small)\n\t\t\t},\n\t\t\tcombine: {\n\t\t\t\tthreshold: 0-1 for the percentage value at which to combine slices (if they're too small)\n\t\t\t\tcolor: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#CCC'), if null, the plugin will automatically use the color of the first slice to be combined\n\t\t\t\tlabel: any text value of what the combined slice should be labeled\n\t\t\t}\n\t\t\thighlight: {\n\t\t\t\topacity: 0-1\n\t\t\t}\n\t\t}\n\t}\n\nMore detail and specific examples can be found in the included HTML file.\n\n*/\n\n(function($) {\n\n\t// Maximum redraw attempts when fitting labels within the plot\n\n\tvar REDRAW_ATTEMPTS = 10;\n\n\t// Factor by which to shrink the pie when fitting labels within the plot\n\n\tvar REDRAW_SHRINK = 0.95;\n\n\tfunction init(plot) {\n\n\t\tvar canvas = null,\n\t\t\ttarget = null,\n\t\t\tmaxRadius = null,\n\t\t\tcenterLeft = null,\n\t\t\tcenterTop = null,\n\t\t\tprocessed = false,\n\t\t\tctx = null;\n\n\t\t// interactive variables\n\n\t\tvar highlights = [];\n\n\t\t// add hook to determine if pie plugin in enabled, and then perform necessary operations\n\n\t\tplot.hooks.processOptions.push(function(plot, options) {\n\t\t\tif (options.series.pie.show) {\n\n\t\t\t\toptions.grid.show = false;\n\n\t\t\t\t// set labels.show\n\n\t\t\t\tif (options.series.pie.label.show == \"auto\") {\n\t\t\t\t\tif (options.legend.show) {\n\t\t\t\t\t\toptions.series.pie.label.show = false;\n\t\t\t\t\t} else {\n\t\t\t\t\t\toptions.series.pie.label.show = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// set radius\n\n\t\t\t\tif (options.series.pie.radius == \"auto\") {\n\t\t\t\t\tif (options.series.pie.label.show) {\n\t\t\t\t\t\toptions.series.pie.radius = 3/4;\n\t\t\t\t\t} else {\n\t\t\t\t\t\toptions.series.pie.radius = 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// ensure sane tilt\n\n\t\t\t\tif (options.series.pie.tilt > 1) {\n\t\t\t\t\toptions.series.pie.tilt = 1;\n\t\t\t\t} else if (options.series.pie.tilt < 0) {\n\t\t\t\t\toptions.series.pie.tilt = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tplot.hooks.bindEvents.push(function(plot, eventHolder) {\n\t\t\tvar options = plot.getOptions();\n\t\t\tif (options.series.pie.show) {\n\t\t\t\tif (options.grid.hoverable) {\n\t\t\t\t\teventHolder.unbind(\"mousemove\").mousemove(onMouseMove);\n\t\t\t\t}\n\t\t\t\tif (options.grid.clickable) {\n\t\t\t\t\teventHolder.unbind(\"click\").click(onClick);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tplot.hooks.processDatapoints.push(function(plot, series, data, datapoints) {\n\t\t\tvar options = plot.getOptions();\n\t\t\tif (options.series.pie.show) {\n\t\t\t\tprocessDatapoints(plot, series, data, datapoints);\n\t\t\t}\n\t\t});\n\n\t\tplot.hooks.drawOverlay.push(function(plot, octx) {\n\t\t\tvar options = plot.getOptions();\n\t\t\tif (options.series.pie.show) {\n\t\t\t\tdrawOverlay(plot, octx);\n\t\t\t}\n\t\t});\n\n\t\tplot.hooks.draw.push(function(plot, newCtx) {\n\t\t\tvar options = plot.getOptions();\n\t\t\tif (options.series.pie.show) {\n\t\t\t\tdraw(plot, newCtx);\n\t\t\t}\n\t\t});\n\n\t\tfunction processDatapoints(plot, series, datapoints) {\n\t\t\tif (!processed)\t{\n\t\t\t\tprocessed = true;\n\t\t\t\tcanvas = plot.getCanvas();\n\t\t\t\ttarget = $(canvas).parent();\n\t\t\t\toptions = plot.getOptions();\n\t\t\t\tplot.setData(combine(plot.getData()));\n\t\t\t}\n\t\t}\n\n\t\tfunction combine(data) {\n\n\t\t\tvar total = 0,\n\t\t\t\tcombined = 0,\n\t\t\t\tnumCombined = 0,\n\t\t\t\tcolor = options.series.pie.combine.color,\n\t\t\t\tnewdata = [];\n\n\t\t\t// Fix up the raw data from Flot, ensuring the data is numeric\n\n\t\t\tfor (var i = 0; i < data.length; ++i) {\n\n\t\t\t\tvar value = data[i].data;\n\n\t\t\t\t// If the data is an array, we'll assume that it's a standard\n\t\t\t\t// Flot x-y pair, and are concerned only with the second value.\n\n\t\t\t\t// Note how we use the original array, rather than creating a\n\t\t\t\t// new one; this is more efficient and preserves any extra data\n\t\t\t\t// that the user may have stored in higher indexes.\n\n\t\t\t\tif ($.isArray(value) && value.length == 1) {\n \t\t\t\tvalue = value[0];\n\t\t\t\t}\n\n\t\t\t\tif ($.isArray(value)) {\n\t\t\t\t\t// Equivalent to $.isNumeric() but compatible with jQuery < 1.7\n\t\t\t\t\tif (!isNaN(parseFloat(value[1])) && isFinite(value[1])) {\n\t\t\t\t\t\tvalue[1] = +value[1];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalue[1] = 0;\n\t\t\t\t\t}\n\t\t\t\t} else if (!isNaN(parseFloat(value)) && isFinite(value)) {\n\t\t\t\t\tvalue = [1, +value];\n\t\t\t\t} else {\n\t\t\t\t\tvalue = [1, 0];\n\t\t\t\t}\n\n\t\t\t\tdata[i].data = [value];\n\t\t\t}\n\n\t\t\t// Sum up all the slices, so we can calculate percentages for each\n\n\t\t\tfor (var i = 0; i < data.length; ++i) {\n\t\t\t\ttotal += data[i].data[0][1];\n\t\t\t}\n\n\t\t\t// Count the number of slices with percentages below the combine\n\t\t\t// threshold; if it turns out to be just one, we won't combine.\n\n\t\t\tfor (var i = 0; i < data.length; ++i) {\n\t\t\t\tvar value = data[i].data[0][1];\n\t\t\t\tif (value / total <= options.series.pie.combine.threshold) {\n\t\t\t\t\tcombined += value;\n\t\t\t\t\tnumCombined++;\n\t\t\t\t\tif (!color) {\n\t\t\t\t\t\tcolor = data[i].color;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (var i = 0; i < data.length; ++i) {\n\t\t\t\tvar value = data[i].data[0][1];\n\t\t\t\tif (numCombined < 2 || value / total > options.series.pie.combine.threshold) {\n\t\t\t\t\tnewdata.push({\n\t\t\t\t\t\tdata: [[1, value]],\n\t\t\t\t\t\tcolor: data[i].color,\n\t\t\t\t\t\tlabel: data[i].label,\n\t\t\t\t\t\tangle: value * Math.PI * 2 / total,\n\t\t\t\t\t\tpercent: value / (total / 100)\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (numCombined > 1) {\n\t\t\t\tnewdata.push({\n\t\t\t\t\tdata: [[1, combined]],\n\t\t\t\t\tcolor: color,\n\t\t\t\t\tlabel: options.series.pie.combine.label,\n\t\t\t\t\tangle: combined * Math.PI * 2 / total,\n\t\t\t\t\tpercent: combined / (total / 100)\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn newdata;\n\t\t}\n\n\t\tfunction draw(plot, newCtx) {\n\n\t\t\tif (!target) {\n\t\t\t\treturn; // if no series were passed\n\t\t\t}\n\n\t\t\tvar canvasWidth = plot.getPlaceholder().width(),\n\t\t\t\tcanvasHeight = plot.getPlaceholder().height(),\n\t\t\t\tlegendWidth = target.children().filter(\".legend\").children().width() || 0;\n\n\t\t\tctx = newCtx;\n\n\t\t\t// WARNING: HACK! REWRITE THIS CODE AS SOON AS POSSIBLE!\n\n\t\t\t// When combining smaller slices into an 'other' slice, we need to\n\t\t\t// add a new series. Since Flot gives plugins no way to modify the\n\t\t\t// list of series, the pie plugin uses a hack where the first call\n\t\t\t// to processDatapoints results in a call to setData with the new\n\t\t\t// list of series, then subsequent processDatapoints do nothing.\n\n\t\t\t// The plugin-global 'processed' flag is used to control this hack;\n\t\t\t// it starts out false, and is set to true after the first call to\n\t\t\t// processDatapoints.\n\n\t\t\t// Unfortunately this turns future setData calls into no-ops; they\n\t\t\t// call processDatapoints, the flag is true, and nothing happens.\n\n\t\t\t// To fix this we'll set the flag back to false here in draw, when\n\t\t\t// all series have been processed, so the next sequence of calls to\n\t\t\t// processDatapoints once again starts out with a slice-combine.\n\t\t\t// This is really a hack; in 0.9 we need to give plugins a proper\n\t\t\t// way to modify series before any processing begins.\n\n\t\t\tprocessed = false;\n\n\t\t\t// calculate maximum radius and center point\n\n\t\t\tmaxRadius = Math.min(canvasWidth, canvasHeight / options.series.pie.tilt) / 2;\n\t\t\tcenterTop = canvasHeight / 2 + options.series.pie.offset.top;\n\t\t\tcenterLeft = canvasWidth / 2;\n\n\t\t\tif (options.series.pie.offset.left == \"auto\") {\n\t\t\t\tif (options.legend.position.match(\"w\")) {\n\t\t\t\t\tcenterLeft += legendWidth / 2;\n\t\t\t\t} else {\n\t\t\t\t\tcenterLeft -= legendWidth / 2;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcenterLeft += options.series.pie.offset.left;\n\t\t\t}\n\n\t\t\tif (centerLeft < maxRadius) {\n\t\t\t\tcenterLeft = maxRadius;\n\t\t\t} else if (centerLeft > canvasWidth - maxRadius) {\n\t\t\t\tcenterLeft = canvasWidth - maxRadius;\n\t\t\t}\n\n\t\t\tvar slices = plot.getData(),\n\t\t\t\tattempts = 0;\n\n\t\t\t// Keep shrinking the pie's radius until drawPie returns true,\n\t\t\t// indicating that all the labels fit, or we try too many times.\n\n\t\t\tdo {\n\t\t\t\tif (attempts > 0) {\n\t\t\t\t\tmaxRadius *= REDRAW_SHRINK;\n\t\t\t\t}\n\t\t\t\tattempts += 1;\n\t\t\t\tclear();\n\t\t\t\tif (options.series.pie.tilt <= 0.8) {\n\t\t\t\t\tdrawShadow();\n\t\t\t\t}\n\t\t\t} while (!drawPie() && attempts < REDRAW_ATTEMPTS)\n\n\t\t\tif (attempts >= REDRAW_ATTEMPTS) {\n\t\t\t\tclear();\n\t\t\t\ttarget.prepend(\"
      Could not draw pie with labels contained inside canvas
      \");\n\t\t\t}\n\n\t\t\tif (plot.setSeries && plot.insertLegend) {\n\t\t\t\tplot.setSeries(slices);\n\t\t\t\tplot.insertLegend();\n\t\t\t}\n\n\t\t\t// we're actually done at this point, just defining internal functions at this point\n\n\t\t\tfunction clear() {\n\t\t\t\tctx.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\t\ttarget.children().filter(\".pieLabel, .pieLabelBackground\").remove();\n\t\t\t}\n\n\t\t\tfunction drawShadow() {\n\n\t\t\t\tvar shadowLeft = options.series.pie.shadow.left;\n\t\t\t\tvar shadowTop = options.series.pie.shadow.top;\n\t\t\t\tvar edge = 10;\n\t\t\t\tvar alpha = options.series.pie.shadow.alpha;\n\t\t\t\tvar radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;\n\n\t\t\t\tif (radius >= canvasWidth / 2 - shadowLeft || radius * options.series.pie.tilt >= canvasHeight / 2 - shadowTop || radius <= edge) {\n\t\t\t\t\treturn;\t// shadow would be outside canvas, so don't draw it\n\t\t\t\t}\n\n\t\t\t\tctx.save();\n\t\t\t\tctx.translate(shadowLeft,shadowTop);\n\t\t\t\tctx.globalAlpha = alpha;\n\t\t\t\tctx.fillStyle = \"#000\";\n\n\t\t\t\t// center and rotate to starting position\n\n\t\t\t\tctx.translate(centerLeft,centerTop);\n\t\t\t\tctx.scale(1, options.series.pie.tilt);\n\n\t\t\t\t//radius -= edge;\n\n\t\t\t\tfor (var i = 1; i <= edge; i++) {\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tctx.arc(0, 0, radius, 0, Math.PI * 2, false);\n\t\t\t\t\tctx.fill();\n\t\t\t\t\tradius -= i;\n\t\t\t\t}\n\n\t\t\t\tctx.restore();\n\t\t\t}\n\n\t\t\tfunction drawPie() {\n\n\t\t\t\tvar startAngle = Math.PI * options.series.pie.startAngle;\n\t\t\t\tvar radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;\n\n\t\t\t\t// center and rotate to starting position\n\n\t\t\t\tctx.save();\n\t\t\t\tctx.translate(centerLeft,centerTop);\n\t\t\t\tctx.scale(1, options.series.pie.tilt);\n\t\t\t\t//ctx.rotate(startAngle); // start at top; -- This doesn't work properly in Opera\n\n\t\t\t\t// draw slices\n\n\t\t\t\tctx.save();\n\t\t\t\tvar currentAngle = startAngle;\n\t\t\t\tfor (var i = 0; i < slices.length; ++i) {\n\t\t\t\t\tslices[i].startAngle = currentAngle;\n\t\t\t\t\tdrawSlice(slices[i].angle, slices[i].color, true);\n\t\t\t\t}\n\t\t\t\tctx.restore();\n\n\t\t\t\t// draw slice outlines\n\n\t\t\t\tif (options.series.pie.stroke.width > 0) {\n\t\t\t\t\tctx.save();\n\t\t\t\t\tctx.lineWidth = options.series.pie.stroke.width;\n\t\t\t\t\tcurrentAngle = startAngle;\n\t\t\t\t\tfor (var i = 0; i < slices.length; ++i) {\n\t\t\t\t\t\tdrawSlice(slices[i].angle, options.series.pie.stroke.color, false);\n\t\t\t\t\t}\n\t\t\t\t\tctx.restore();\n\t\t\t\t}\n\n\t\t\t\t// draw donut hole\n\n\t\t\t\tdrawDonutHole(ctx);\n\n\t\t\t\tctx.restore();\n\n\t\t\t\t// Draw the labels, returning true if they fit within the plot\n\n\t\t\t\tif (options.series.pie.label.show) {\n\t\t\t\t\treturn drawLabels();\n\t\t\t\t} else return true;\n\n\t\t\t\tfunction drawSlice(angle, color, fill) {\n\n\t\t\t\t\tif (angle <= 0 || isNaN(angle)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (fill) {\n\t\t\t\t\t\tctx.fillStyle = color;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tctx.strokeStyle = color;\n\t\t\t\t\t\tctx.lineJoin = \"round\";\n\t\t\t\t\t}\n\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tif (Math.abs(angle - Math.PI * 2) > 0.000000001) {\n\t\t\t\t\t\tctx.moveTo(0, 0); // Center of the pie\n\t\t\t\t\t}\n\n\t\t\t\t\t//ctx.arc(0, 0, radius, 0, angle, false); // This doesn't work properly in Opera\n\t\t\t\t\tctx.arc(0, 0, radius,currentAngle, currentAngle + angle / 2, false);\n\t\t\t\t\tctx.arc(0, 0, radius,currentAngle + angle / 2, currentAngle + angle, false);\n\t\t\t\t\tctx.closePath();\n\t\t\t\t\t//ctx.rotate(angle); // This doesn't work properly in Opera\n\t\t\t\t\tcurrentAngle += angle;\n\n\t\t\t\t\tif (fill) {\n\t\t\t\t\t\tctx.fill();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tctx.stroke();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction drawLabels() {\n\n\t\t\t\t\tvar currentAngle = startAngle;\n\t\t\t\t\tvar radius = options.series.pie.label.radius > 1 ? options.series.pie.label.radius : maxRadius * options.series.pie.label.radius;\n\n\t\t\t\t\tfor (var i = 0; i < slices.length; ++i) {\n\t\t\t\t\t\tif (slices[i].percent >= options.series.pie.label.threshold * 100) {\n\t\t\t\t\t\t\tif (!drawLabel(slices[i], currentAngle, i)) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcurrentAngle += slices[i].angle;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn true;\n\n\t\t\t\t\tfunction drawLabel(slice, startAngle, index) {\n\n\t\t\t\t\t\tif (slice.data[0][1] == 0) {\n\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// format label text\n\n\t\t\t\t\t\tvar lf = options.legend.labelFormatter, text, plf = options.series.pie.label.formatter;\n\n\t\t\t\t\t\tif (lf) {\n\t\t\t\t\t\t\ttext = lf(slice.label, slice);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttext = slice.label;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (plf) {\n\t\t\t\t\t\t\ttext = plf(text, slice);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tvar halfAngle = ((startAngle + slice.angle) + startAngle) / 2;\n\t\t\t\t\t\tvar x = centerLeft + Math.round(Math.cos(halfAngle) * radius);\n\t\t\t\t\t\tvar y = centerTop + Math.round(Math.sin(halfAngle) * radius) * options.series.pie.tilt;\n\n\t\t\t\t\t\tvar html = \"\" + text + \"\";\n\t\t\t\t\t\ttarget.append(html);\n\n\t\t\t\t\t\tvar label = target.children(\"#pieLabel\" + index);\n\t\t\t\t\t\tvar labelTop = (y - label.height() / 2);\n\t\t\t\t\t\tvar labelLeft = (x - label.width() / 2);\n\n\t\t\t\t\t\tlabel.css(\"top\", labelTop);\n\t\t\t\t\t\tlabel.css(\"left\", labelLeft);\n\n\t\t\t\t\t\t// check to make sure that the label is not outside the canvas\n\n\t\t\t\t\t\tif (0 - labelTop > 0 || 0 - labelLeft > 0 || canvasHeight - (labelTop + label.height()) < 0 || canvasWidth - (labelLeft + label.width()) < 0) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (options.series.pie.label.background.opacity != 0) {\n\n\t\t\t\t\t\t\t// put in the transparent background separately to avoid blended labels and label boxes\n\n\t\t\t\t\t\t\tvar c = options.series.pie.label.background.color;\n\n\t\t\t\t\t\t\tif (c == null) {\n\t\t\t\t\t\t\t\tc = slice.color;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvar pos = \"top:\" + labelTop + \"px;left:\" + labelLeft + \"px;\";\n\t\t\t\t\t\t\t$(\"
      \")\n\t\t\t\t\t\t\t\t.css(\"opacity\", options.series.pie.label.background.opacity)\n\t\t\t\t\t\t\t\t.insertBefore(label);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} // end individual label function\n\t\t\t\t} // end drawLabels function\n\t\t\t} // end drawPie function\n\t\t} // end draw function\n\n\t\t// Placed here because it needs to be accessed from multiple locations\n\n\t\tfunction drawDonutHole(layer) {\n\t\t\tif (options.series.pie.innerRadius > 0) {\n\n\t\t\t\t// subtract the center\n\n\t\t\t\tlayer.save();\n\t\t\t\tvar innerRadius = options.series.pie.innerRadius > 1 ? options.series.pie.innerRadius : maxRadius * options.series.pie.innerRadius;\n\t\t\t\tlayer.globalCompositeOperation = \"destination-out\"; // this does not work with excanvas, but it will fall back to using the stroke color\n\t\t\t\tlayer.beginPath();\n\t\t\t\tlayer.fillStyle = options.series.pie.stroke.color;\n\t\t\t\tlayer.arc(0, 0, innerRadius, 0, Math.PI * 2, false);\n\t\t\t\tlayer.fill();\n\t\t\t\tlayer.closePath();\n\t\t\t\tlayer.restore();\n\n\t\t\t\t// add inner stroke\n\n\t\t\t\tlayer.save();\n\t\t\t\tlayer.beginPath();\n\t\t\t\tlayer.strokeStyle = options.series.pie.stroke.color;\n\t\t\t\tlayer.arc(0, 0, innerRadius, 0, Math.PI * 2, false);\n\t\t\t\tlayer.stroke();\n\t\t\t\tlayer.closePath();\n\t\t\t\tlayer.restore();\n\n\t\t\t\t// TODO: add extra shadow inside hole (with a mask) if the pie is tilted.\n\t\t\t}\n\t\t}\n\n\t\t//-- Additional Interactive related functions --\n\n\t\tfunction isPointInPoly(poly, pt) {\n\t\t\tfor(var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i)\n\t\t\t\t((poly[i][1] <= pt[1] && pt[1] < poly[j][1]) || (poly[j][1] <= pt[1] && pt[1]< poly[i][1]))\n\t\t\t\t&& (pt[0] < (poly[j][0] - poly[i][0]) * (pt[1] - poly[i][1]) / (poly[j][1] - poly[i][1]) + poly[i][0])\n\t\t\t\t&& (c = !c);\n\t\t\treturn c;\n\t\t}\n\n\t\tfunction findNearbySlice(mouseX, mouseY) {\n\n\t\t\tvar slices = plot.getData(),\n\t\t\t\toptions = plot.getOptions(),\n\t\t\t\tradius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius,\n\t\t\t\tx, y;\n\n\t\t\tfor (var i = 0; i < slices.length; ++i) {\n\n\t\t\t\tvar s = slices[i];\n\n\t\t\t\tif (s.pie.show) {\n\n\t\t\t\t\tctx.save();\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tctx.moveTo(0, 0); // Center of the pie\n\t\t\t\t\t//ctx.scale(1, options.series.pie.tilt);\t// this actually seems to break everything when here.\n\t\t\t\t\tctx.arc(0, 0, radius, s.startAngle, s.startAngle + s.angle / 2, false);\n\t\t\t\t\tctx.arc(0, 0, radius, s.startAngle + s.angle / 2, s.startAngle + s.angle, false);\n\t\t\t\t\tctx.closePath();\n\t\t\t\t\tx = mouseX - centerLeft;\n\t\t\t\t\ty = mouseY - centerTop;\n\n\t\t\t\t\tif (ctx.isPointInPath) {\n\t\t\t\t\t\tif (ctx.isPointInPath(mouseX - centerLeft, mouseY - centerTop)) {\n\t\t\t\t\t\t\tctx.restore();\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tdatapoint: [s.percent, s.data],\n\t\t\t\t\t\t\t\tdataIndex: 0,\n\t\t\t\t\t\t\t\tseries: s,\n\t\t\t\t\t\t\t\tseriesIndex: i\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// excanvas for IE doesn;t support isPointInPath, this is a workaround.\n\n\t\t\t\t\t\tvar p1X = radius * Math.cos(s.startAngle),\n\t\t\t\t\t\t\tp1Y = radius * Math.sin(s.startAngle),\n\t\t\t\t\t\t\tp2X = radius * Math.cos(s.startAngle + s.angle / 4),\n\t\t\t\t\t\t\tp2Y = radius * Math.sin(s.startAngle + s.angle / 4),\n\t\t\t\t\t\t\tp3X = radius * Math.cos(s.startAngle + s.angle / 2),\n\t\t\t\t\t\t\tp3Y = radius * Math.sin(s.startAngle + s.angle / 2),\n\t\t\t\t\t\t\tp4X = radius * Math.cos(s.startAngle + s.angle / 1.5),\n\t\t\t\t\t\t\tp4Y = radius * Math.sin(s.startAngle + s.angle / 1.5),\n\t\t\t\t\t\t\tp5X = radius * Math.cos(s.startAngle + s.angle),\n\t\t\t\t\t\t\tp5Y = radius * Math.sin(s.startAngle + s.angle),\n\t\t\t\t\t\t\tarrPoly = [[0, 0], [p1X, p1Y], [p2X, p2Y], [p3X, p3Y], [p4X, p4Y], [p5X, p5Y]],\n\t\t\t\t\t\t\tarrPoint = [x, y];\n\n\t\t\t\t\t\t// TODO: perhaps do some mathmatical trickery here with the Y-coordinate to compensate for pie tilt?\n\n\t\t\t\t\t\tif (isPointInPoly(arrPoly, arrPoint)) {\n\t\t\t\t\t\t\tctx.restore();\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tdatapoint: [s.percent, s.data],\n\t\t\t\t\t\t\t\tdataIndex: 0,\n\t\t\t\t\t\t\t\tseries: s,\n\t\t\t\t\t\t\t\tseriesIndex: i\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tctx.restore();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tfunction onMouseMove(e) {\n\t\t\ttriggerClickHoverEvent(\"plothover\", e);\n\t\t}\n\n\t\tfunction onClick(e) {\n\t\t\ttriggerClickHoverEvent(\"plotclick\", e);\n\t\t}\n\n\t\t// trigger click or hover event (they send the same parameters so we share their code)\n\n\t\tfunction triggerClickHoverEvent(eventname, e) {\n\n\t\t\tvar offset = plot.offset();\n\t\t\tvar canvasX = parseInt(e.pageX - offset.left);\n\t\t\tvar canvasY = parseInt(e.pageY - offset.top);\n\t\t\tvar item = findNearbySlice(canvasX, canvasY);\n\n\t\t\tif (options.grid.autoHighlight) {\n\n\t\t\t\t// clear auto-highlights\n\n\t\t\t\tfor (var i = 0; i < highlights.length; ++i) {\n\t\t\t\t\tvar h = highlights[i];\n\t\t\t\t\tif (h.auto == eventname && !(item && h.series == item.series)) {\n\t\t\t\t\t\tunhighlight(h.series);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// highlight the slice\n\n\t\t\tif (item) {\n\t\t\t\thighlight(item.series, eventname);\n\t\t\t}\n\n\t\t\t// trigger any hover bind events\n\n\t\t\tvar pos = { pageX: e.pageX, pageY: e.pageY };\n\t\t\ttarget.trigger(eventname, [pos, item]);\n\t\t}\n\n\t\tfunction highlight(s, auto) {\n\t\t\t//if (typeof s == \"number\") {\n\t\t\t//\ts = series[s];\n\t\t\t//}\n\n\t\t\tvar i = indexOfHighlight(s);\n\n\t\t\tif (i == -1) {\n\t\t\t\thighlights.push({ series: s, auto: auto });\n\t\t\t\tplot.triggerRedrawOverlay();\n\t\t\t} else if (!auto) {\n\t\t\t\thighlights[i].auto = false;\n\t\t\t}\n\t\t}\n\n\t\tfunction unhighlight(s) {\n\t\t\tif (s == null) {\n\t\t\t\thighlights = [];\n\t\t\t\tplot.triggerRedrawOverlay();\n\t\t\t}\n\n\t\t\t//if (typeof s == \"number\") {\n\t\t\t//\ts = series[s];\n\t\t\t//}\n\n\t\t\tvar i = indexOfHighlight(s);\n\n\t\t\tif (i != -1) {\n\t\t\t\thighlights.splice(i, 1);\n\t\t\t\tplot.triggerRedrawOverlay();\n\t\t\t}\n\t\t}\n\n\t\tfunction indexOfHighlight(s) {\n\t\t\tfor (var i = 0; i < highlights.length; ++i) {\n\t\t\t\tvar h = highlights[i];\n\t\t\t\tif (h.series == s)\n\t\t\t\t\treturn i;\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\tfunction drawOverlay(plot, octx) {\n\n\t\t\tvar options = plot.getOptions();\n\n\t\t\tvar radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius;\n\n\t\t\toctx.save();\n\t\t\toctx.translate(centerLeft, centerTop);\n\t\t\toctx.scale(1, options.series.pie.tilt);\n\n\t\t\tfor (var i = 0; i < highlights.length; ++i) {\n\t\t\t\tdrawHighlight(highlights[i].series);\n\t\t\t}\n\n\t\t\tdrawDonutHole(octx);\n\n\t\t\toctx.restore();\n\n\t\t\tfunction drawHighlight(series) {\n\n\t\t\t\tif (series.angle <= 0 || isNaN(series.angle)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//octx.fillStyle = parseColor(options.series.pie.highlight.color).scale(null, null, null, options.series.pie.highlight.opacity).toString();\n\t\t\t\toctx.fillStyle = \"rgba(255, 255, 255, \" + options.series.pie.highlight.opacity + \")\"; // this is temporary until we have access to parseColor\n\t\t\t\toctx.beginPath();\n\t\t\t\tif (Math.abs(series.angle - Math.PI * 2) > 0.000000001) {\n\t\t\t\t\toctx.moveTo(0, 0); // Center of the pie\n\t\t\t\t}\n\t\t\t\toctx.arc(0, 0, radius, series.startAngle, series.startAngle + series.angle / 2, false);\n\t\t\t\toctx.arc(0, 0, radius, series.startAngle + series.angle / 2, series.startAngle + series.angle, false);\n\t\t\t\toctx.closePath();\n\t\t\t\toctx.fill();\n\t\t\t}\n\t\t}\n\t} // end init (plugin body)\n\n\t// define pie specific options and their default values\n\n\tvar options = {\n\t\tseries: {\n\t\t\tpie: {\n\t\t\t\tshow: false,\n\t\t\t\tradius: \"auto\",\t// actual radius of the visible pie (based on full calculated radius if <=1, or hard pixel value)\n\t\t\t\tinnerRadius: 0, /* for donut */\n\t\t\t\tstartAngle: 3/2,\n\t\t\t\ttilt: 1,\n\t\t\t\tshadow: {\n\t\t\t\t\tleft: 5,\t// shadow left offset\n\t\t\t\t\ttop: 15,\t// shadow top offset\n\t\t\t\t\talpha: 0.02\t// shadow alpha\n\t\t\t\t},\n\t\t\t\toffset: {\n\t\t\t\t\ttop: 0,\n\t\t\t\t\tleft: \"auto\"\n\t\t\t\t},\n\t\t\t\tstroke: {\n\t\t\t\t\tcolor: \"#fff\",\n\t\t\t\t\twidth: 1\n\t\t\t\t},\n\t\t\t\tlabel: {\n\t\t\t\t\tshow: \"auto\",\n\t\t\t\t\tformatter: function(label, slice) {\n\t\t\t\t\t\treturn \"
      \" + label + \"
      \" + Math.round(slice.percent) + \"%
      \";\n\t\t\t\t\t},\t// formatter function\n\t\t\t\t\tradius: 1,\t// radius at which to place the labels (based on full calculated radius if <=1, or hard pixel value)\n\t\t\t\t\tbackground: {\n\t\t\t\t\t\tcolor: null,\n\t\t\t\t\t\topacity: 0\n\t\t\t\t\t},\n\t\t\t\t\tthreshold: 0\t// percentage at which to hide the label (i.e. the slice is too narrow)\n\t\t\t\t},\n\t\t\t\tcombine: {\n\t\t\t\t\tthreshold: -1,\t// percentage at which to combine little slices into one larger slice\n\t\t\t\t\tcolor: null,\t// color to give the new slice (auto-generated if null)\n\t\t\t\t\tlabel: \"Other\"\t// label to give the new slice\n\t\t\t\t},\n\t\t\t\thighlight: {\n\t\t\t\t\t//color: \"#fff\",\t\t// will add this functionality once parseColor is available\n\t\t\t\t\topacity: 0.5\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n\n\t$.plot.plugins.push({\n\t\tinit: init,\n\t\toptions: options,\n\t\tname: \"pie\",\n\t\tversion: \"1.1\"\n\t});\n\n})(jQuery);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./public/vendor/flot/jquery.flot.pie.js\n// module id = 2196\n// module chunks = 0","import angular from 'angular';\nimport _ from 'lodash';\n\nimport config from 'app/core/config';\nimport coreModule from 'app/core/core_module';\nimport { importPluginModule } from './plugin_loader';\n\nimport { UnknownPanelCtrl } from 'app/plugins/panel/unknown/module';\n\n/** @ngInject **/\nfunction pluginDirectiveLoader($compile, datasourceSrv, $rootScope, $q, $http, $templateCache) {\n function getTemplate(component) {\n if (component.template) {\n return $q.when(component.template);\n }\n var cached = $templateCache.get(component.templateUrl);\n if (cached) {\n return $q.when(cached);\n }\n return $http.get(component.templateUrl).then(res => {\n return res.data;\n });\n }\n\n function relativeTemplateUrlToAbs(templateUrl, baseUrl) {\n if (!templateUrl) {\n return undefined;\n }\n if (templateUrl.indexOf('public') === 0) {\n return templateUrl;\n }\n return baseUrl + '/' + templateUrl;\n }\n\n function getPluginComponentDirective(options) {\n // handle relative template urls for plugin templates\n options.Component.templateUrl = relativeTemplateUrlToAbs(options.Component.templateUrl, options.baseUrl);\n\n return function() {\n return {\n templateUrl: options.Component.templateUrl,\n template: options.Component.template,\n restrict: 'E',\n controller: options.Component,\n controllerAs: 'ctrl',\n bindToController: true,\n scope: options.bindings,\n link: (scope, elem, attrs, ctrl) => {\n if (ctrl.link) {\n ctrl.link(scope, elem, attrs, ctrl);\n }\n if (ctrl.init) {\n ctrl.init();\n }\n },\n };\n };\n }\n\n function loadPanelComponentInfo(scope, attrs) {\n var componentInfo: any = {\n name: 'panel-plugin-' + scope.panel.type,\n bindings: { dashboard: '=', panel: '=', row: '=' },\n attrs: {\n dashboard: 'dashboard',\n panel: 'panel',\n class: 'panel-height-helper',\n },\n };\n\n let panelInfo = config.panels[scope.panel.type];\n var panelCtrlPromise = Promise.resolve(UnknownPanelCtrl);\n if (panelInfo) {\n panelCtrlPromise = importPluginModule(panelInfo.module).then(function(panelModule) {\n return panelModule.PanelCtrl;\n });\n }\n\n return panelCtrlPromise.then(function(PanelCtrl: any) {\n componentInfo.Component = PanelCtrl;\n\n if (!PanelCtrl || PanelCtrl.registeredAs === componentInfo.name) {\n return componentInfo;\n }\n\n if (PanelCtrl.templatePromise) {\n return PanelCtrl.templatePromise.then(res => {\n return componentInfo;\n });\n }\n\n if (panelInfo) {\n PanelCtrl.templateUrl = relativeTemplateUrlToAbs(PanelCtrl.templateUrl, panelInfo.baseUrl);\n }\n\n PanelCtrl.templatePromise = getTemplate(PanelCtrl).then(template => {\n PanelCtrl.templateUrl = null;\n PanelCtrl.template = `${template}`;\n return componentInfo;\n });\n\n return PanelCtrl.templatePromise;\n });\n }\n\n function getModule(scope, attrs) {\n switch (attrs.type) {\n // QueryCtrl\n case 'query-ctrl': {\n let datasource = scope.target.datasource || scope.ctrl.panel.datasource;\n return datasourceSrv.get(datasource).then(ds => {\n scope.datasource = ds;\n\n return importPluginModule(ds.meta.module).then(dsModule => {\n return {\n baseUrl: ds.meta.baseUrl,\n name: 'query-ctrl-' + ds.meta.id,\n bindings: { target: '=', panelCtrl: '=', datasource: '=' },\n attrs: {\n target: 'target',\n 'panel-ctrl': 'ctrl.panelCtrl',\n datasource: 'datasource',\n },\n Component: dsModule.QueryCtrl,\n };\n });\n });\n }\n // Annotations\n case 'annotations-query-ctrl': {\n return importPluginModule(scope.ctrl.currentDatasource.meta.module).then(function(dsModule) {\n return {\n baseUrl: scope.ctrl.currentDatasource.meta.baseUrl,\n name: 'annotations-query-ctrl-' + scope.ctrl.currentDatasource.meta.id,\n bindings: { annotation: '=', datasource: '=' },\n attrs: {\n annotation: 'ctrl.currentAnnotation',\n datasource: 'ctrl.currentDatasource',\n },\n Component: dsModule.AnnotationsQueryCtrl,\n };\n });\n }\n // Datasource ConfigCtrl\n case 'datasource-config-ctrl': {\n var dsMeta = scope.ctrl.datasourceMeta;\n return importPluginModule(dsMeta.module).then(function(dsModule): any {\n if (!dsModule.ConfigCtrl) {\n return { notFound: true };\n }\n\n return {\n baseUrl: dsMeta.baseUrl,\n name: 'ds-config-' + dsMeta.id,\n bindings: { meta: '=', current: '=' },\n attrs: { meta: 'ctrl.datasourceMeta', current: 'ctrl.current' },\n Component: dsModule.ConfigCtrl,\n };\n });\n }\n // AppConfigCtrl\n case 'app-config-ctrl': {\n let model = scope.ctrl.model;\n return importPluginModule(model.module).then(function(appModule) {\n return {\n baseUrl: model.baseUrl,\n name: 'app-config-' + model.id,\n bindings: { appModel: '=', appEditCtrl: '=' },\n attrs: { 'app-model': 'ctrl.model', 'app-edit-ctrl': 'ctrl' },\n Component: appModule.ConfigCtrl,\n };\n });\n }\n // App Page\n case 'app-page': {\n let appModel = scope.ctrl.appModel;\n return importPluginModule(appModel.module).then(function(appModule) {\n return {\n baseUrl: appModel.baseUrl,\n name: 'app-page-' + appModel.id + '-' + scope.ctrl.page.slug,\n bindings: { appModel: '=' },\n attrs: { 'app-model': 'ctrl.appModel' },\n Component: appModule[scope.ctrl.page.component],\n };\n });\n }\n // Panel\n case 'panel': {\n return loadPanelComponentInfo(scope, attrs);\n }\n default: {\n return $q.reject({\n message: 'Could not find component type: ' + attrs.type,\n });\n }\n }\n }\n\n function appendAndCompile(scope, elem, componentInfo) {\n var child = angular.element(document.createElement(componentInfo.name));\n _.each(componentInfo.attrs, (value, key) => {\n child.attr(key, value);\n });\n\n $compile(child)(scope);\n elem.empty();\n\n // let a binding digest cycle complete before adding to dom\n setTimeout(function() {\n elem.append(child);\n scope.$applyAsync(function() {\n scope.$broadcast('component-did-mount');\n scope.$broadcast('refresh');\n });\n });\n }\n\n function registerPluginComponent(scope, elem, attrs, componentInfo) {\n if (componentInfo.notFound) {\n elem.empty();\n return;\n }\n\n if (!componentInfo.Component) {\n throw {\n message: 'Failed to find exported plugin component for ' + componentInfo.name,\n };\n }\n\n if (componentInfo.Component.registeredAs !== componentInfo.name) {\n var directiveName = attrs.$normalize(componentInfo.name);\n var directiveFn = getPluginComponentDirective(componentInfo);\n coreModule.directive(directiveName, directiveFn);\n componentInfo.Component.registeredAs = componentInfo.name;\n }\n\n appendAndCompile(scope, elem, componentInfo);\n }\n\n return {\n restrict: 'E',\n link: function(scope, elem, attrs) {\n getModule(scope, attrs)\n .then(function(componentInfo) {\n registerPluginComponent(scope, elem, attrs, componentInfo);\n })\n .catch(err => {\n $rootScope.appEvent('alert-error', ['Plugin Error', err.message || err]);\n console.log('Plugin component error', err);\n });\n },\n };\n}\n\ncoreModule.directive('pluginComponent', pluginDirectiveLoader);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/plugins/plugin_component.ts","import { PanelCtrl } from 'app/features/panel/panel_ctrl';\n\nexport class UnknownPanelCtrl extends PanelCtrl {\n static templateUrl = 'public/app/plugins/panel/unknown/module.html';\n\n /** @ngInject */\n constructor($scope, $injector) {\n super($scope, $injector);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/plugins/panel/unknown/module.ts","import './dashboard_ctrl';\nimport './alerting_srv';\nimport './history/history';\nimport './dashboard_loader_srv';\nimport './dashnav/dashnav';\nimport './submenu/submenu';\nimport './save_as_modal';\nimport './save_modal';\nimport './save_provisioned_modal';\nimport './shareModalCtrl';\nimport './share_snapshot_ctrl';\nimport './dashboard_srv';\nimport './view_state_srv';\nimport './validation_srv';\nimport './time_srv';\nimport './unsaved_changes_srv';\nimport './unsaved_changes_modal';\nimport './timepicker/timepicker';\nimport './upload';\nimport './export/export_modal';\nimport './export_data/export_data_modal';\nimport './export_experiment/export_experiment_modal';\nimport './ad_hoc_filters';\nimport './repeat_option/repeat_option';\nimport './dashgrid/DashboardGridDirective';\nimport './dashgrid/PanelLoader';\nimport './dashgrid/RowOptions';\nimport './folder_picker/folder_picker';\nimport './move_to_folder_modal/move_to_folder';\nimport './settings/settings';\n\nimport coreModule from 'app/core/core_module';\nimport { DashboardListCtrl } from './dashboard_list_ctrl';\nimport { FolderDashboardsCtrl } from './folder_dashboards_ctrl';\nimport { FolderSettingsCtrl } from './folder_settings_ctrl';\nimport { DashboardImportCtrl } from './dashboard_import_ctrl';\nimport { CreateFolderCtrl } from './create_folder_ctrl';\n\ncoreModule.controller('DashboardListCtrl', DashboardListCtrl);\ncoreModule.controller('FolderDashboardsCtrl', FolderDashboardsCtrl);\ncoreModule.controller('FolderSettingsCtrl', FolderSettingsCtrl);\ncoreModule.controller('DashboardImportCtrl', DashboardImportCtrl);\ncoreModule.controller('CreateFolderCtrl', CreateFolderCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/all.ts","import coreModule from 'app/core/core_module';\nimport { PanelContainer } from './dashgrid/PanelContainer';\nimport { DashboardModel } from './dashboard_model';\nimport { PanelModel } from './panel_model';\nimport { appEvents } from 'app/core/core';\n\nexport class DashboardCtrl implements PanelContainer {\n dashboard: DashboardModel;\n experiment: any;\n dashboardViewState: any;\n loadedFallbackDashboard: boolean;\n editTab: number;\n isHome: boolean;\n\n /** @ngInject */\n constructor(\n private $scope,\n private $rootScope,\n private keybindingSrv,\n private timeSrv,\n private variableSrv,\n private alertSrv,\n private alertingSrv,\n private dashboardSrv,\n private unsavedChangesSrv,\n private dashboardViewStateSrv,\n public playlistSrv,\n private panelLoader,\n private experimentSrv,\n private sensorSrv,\n private $q,\n private $routeParams,\n $location\n ) {\n // temp hack due to way dashboards are loaded\n // can't use controllerAs on route yet\n $scope.ctrl = this;\n\n // TODO: break out settings view to separate view & controller\n this.editTab = 0;\n\n // funcs called from React component bindings and needs this binding\n this.getPanelContainer = this.getPanelContainer.bind(this);\n\n this.isHome = $location.path() === '/';\n }\n\n setupDashboard(data) {\n try {\n if (this.$routeParams.experimentId) {\n this.experimentSrv.get(this.$routeParams.experimentId).then(\n exp => {\n this.experiment = exp;\n this.setupDashboardInternal(data);\n },\n err => {\n console.log('Experiment missing (id: ' + this.$routeParams.experimentId + ')');\n this.alertSrv.set('This experiment was not found!', null, 'warning', 10000);\n err.isHandled = true;\n }\n );\n } else {\n if (data.meta && data.meta.isSnapshot) {\n this.experiment = data.dashboard.experiment;\n }\n this.setupDashboardInternal(data);\n }\n } catch (err) {\n this.onInitFailed(err, 'Dashboard init failed', true);\n }\n }\n\n setupDashboardInternal(data) {\n const dashboard = this.dashboardSrv.create(data.dashboard, data.meta);\n this.dashboardSrv.setCurrent(dashboard);\n\n // init services\n this.timeSrv.init(dashboard, this.experiment);\n this.alertingSrv.init(dashboard, data.alerts);\n\n // template values service needs to initialize completely before\n // the rest of the dashboard can load\n this.$q\n .all(this.variableSrv.init(dashboard))\n .catch(this.onInitFailed.bind(this, 'Dashboard init failed', false))\n // continue\n .finally(() => {\n if (!dashboard.meta.isSnapshot) {\n // Sensor service preloads the sensor meta so that panels can\n // generate influx queries and titles\n this.sensorSrv.init().then(() => {\n this.finishSetupDashboardInternal(dashboard, data);\n });\n } else {\n this.finishSetupDashboardInternal(dashboard, data);\n }\n })\n .catch(this.onInitFailed.bind(this, 'Dashboard init failed', true));\n }\n\n finishSetupDashboardInternal(dashboard, data) {\n this.dashboard = dashboard;\n this.dashboard.processRepeats();\n\n this.unsavedChangesSrv.init(dashboard, this.$scope);\n\n // TODO refactor ViewStateSrv\n this.$scope.dashboard = dashboard;\n this.dashboardViewState = this.dashboardViewStateSrv.create(this.$scope);\n\n this.keybindingSrv.setupDashboardBindings(this.$scope, dashboard);\n\n this.dashboard.updateSubmenuVisibility();\n this.setWindowTitleAndTheme();\n\n this.$scope.appEvent('dashboard-initialized', dashboard);\n }\n\n onInitFailed(msg, fatal, err) {\n console.log(msg, err);\n\n if (err.data && err.data.message) {\n err.message = err.data.message;\n } else if (!err.message) {\n err = { message: err.toString() };\n }\n\n this.$scope.appEvent('alert-error', [msg, err.message]);\n\n // protect against recursive fallbacks\n if (fatal && !this.loadedFallbackDashboard) {\n this.loadedFallbackDashboard = true;\n this.setupDashboard({ dashboard: { title: 'Dashboard Init failed' } });\n }\n }\n\n templateVariableUpdated() {\n this.dashboard.processRepeats();\n }\n\n setWindowTitleAndTheme() {\n window.document.title = this.dashboard.title + ' - CURVE';\n }\n\n showJsonEditor(evt, options) {\n var editScope = this.$rootScope.$new();\n editScope.object = options.object;\n editScope.updateHandler = options.updateHandler;\n this.$scope.appEvent('show-dash-editor', {\n src: 'public/app/partials/edit_json.html',\n scope: editScope,\n });\n }\n\n getDashboard() {\n return this.dashboard;\n }\n\n getPanelLoader() {\n return this.panelLoader;\n }\n\n timezoneChanged() {\n this.$rootScope.$broadcast('refresh');\n }\n\n getPanelContainer() {\n return this;\n }\n\n onRemovingPanel(evt, options) {\n options = options || {};\n if (!options.panelId) {\n return;\n }\n\n var panelInfo = this.dashboard.getPanelInfoById(options.panelId);\n this.removePanel(panelInfo.panel, true);\n }\n\n removePanel(panel: PanelModel, ask: boolean) {\n // confirm deletion\n if (ask !== false) {\n var text2, confirmText;\n\n if (panel.alert) {\n text2 = 'Panel includes an alert rule, removing panel will also remove alert rule';\n confirmText = 'YES';\n }\n\n this.$scope.appEvent('confirm-modal', {\n title: 'Remove Panel',\n text: 'Are you sure you want to remove this panel?',\n text2: text2,\n icon: 'fa-trash',\n confirmText: confirmText,\n yesText: 'Remove',\n onConfirm: () => {\n this.removePanel(panel, false);\n },\n });\n return;\n }\n\n this.dashboard.removePanel(panel);\n }\n\n // $data contains a sensor attribute, and optionally a experiment attribute\n // if it was dragged from a specific experiment (not \"current experiment\")\n onDrop($data) {\n if ($data.meta) {\n this.dashboard.addExperimentMetaPanel();\n } else if ($data.video) {\n this.dashboard.addVideoPanel();\n } else {\n this.dashboard.addSensorPanel($data.sensor.shortName, $data.experiment.id);\n }\n }\n\n init(dashboard) {\n this.$scope.onAppEvent('show-json-editor', this.showJsonEditor.bind(this));\n this.$scope.onAppEvent('template-variable-value-updated', this.templateVariableUpdated.bind(this));\n this.$scope.onAppEvent('panel-remove', this.onRemovingPanel.bind(this));\n this.setupDashboard(dashboard);\n }\n\n onScroll() {\n appEvents.emit('graph-hover-clear');\n }\n}\n\ncoreModule.controller('DashboardCtrl', DashboardCtrl);\n\ncoreModule.directive('scroll', [\n function() {\n return {\n scope: { ngScroll: '=' },\n link: function(scope, elem, attrs) {\n elem.on('scroll', scope.ngScroll);\n },\n };\n },\n]);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/dashboard_ctrl.ts","import coreModule from 'app/core/core_module';\n\nexport class AlertingSrv {\n dashboard: any;\n alerts: any[];\n\n init(dashboard, alerts) {\n this.dashboard = dashboard;\n this.alerts = alerts || [];\n }\n}\n\ncoreModule.service('alertingSrv', AlertingSrv);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/alerting_srv.ts","import './history_srv';\n\nimport _ from 'lodash';\nimport angular from 'angular';\nimport moment from 'moment';\n\nimport locationUtil from 'app/core/utils/location_util';\nimport { DashboardModel } from '../dashboard_model';\nimport { HistoryListOpts, RevisionsModel, CalculateDiffOptions, HistorySrv } from './history_srv';\n\nexport class HistoryListCtrl {\n appending: boolean;\n dashboard: DashboardModel;\n delta: { basic: string; json: string };\n diff: string;\n limit: number;\n loading: boolean;\n max: number;\n mode: string;\n revisions: RevisionsModel[];\n start: number;\n newInfo: RevisionsModel;\n baseInfo: RevisionsModel;\n canCompare: boolean;\n isNewLatest: boolean;\n\n /** @ngInject */\n constructor(\n private $route,\n private $rootScope,\n private $location,\n private $q,\n private historySrv: HistorySrv,\n public $scope\n ) {\n this.appending = false;\n this.diff = 'basic';\n this.limit = 10;\n this.loading = false;\n this.max = 2;\n this.mode = 'list';\n this.start = 0;\n this.canCompare = false;\n\n this.$rootScope.onAppEvent('dashboard-saved', this.onDashboardSaved.bind(this), $scope);\n this.resetFromSource();\n }\n\n onDashboardSaved() {\n this.resetFromSource();\n }\n\n switchMode(mode: string) {\n this.mode = mode;\n if (this.mode === 'list') {\n this.reset();\n }\n }\n\n dismiss() {\n this.$rootScope.appEvent('hide-dash-editor');\n }\n\n addToLog() {\n this.start = this.start + this.limit;\n this.getLog(true);\n }\n\n revisionSelectionChanged() {\n let selected = _.filter(this.revisions, { checked: true }).length;\n this.canCompare = selected === 2;\n }\n\n formatDate(date) {\n return this.dashboard.formatDate(date);\n }\n\n formatBasicDate(date) {\n const now = this.dashboard.timezone === 'browser' ? moment() : moment.utc();\n const then = this.dashboard.timezone === 'browser' ? moment(date) : moment.utc(date);\n return then.from(now);\n }\n\n getDiff(diff: string) {\n this.diff = diff;\n this.mode = 'compare';\n\n // have it already been fetched?\n if (this.delta[this.diff]) {\n return this.$q.when(this.delta[this.diff]);\n }\n\n const selected = _.filter(this.revisions, { checked: true });\n\n this.newInfo = selected[0];\n this.baseInfo = selected[1];\n this.isNewLatest = this.newInfo.version === this.dashboard.version;\n\n this.loading = true;\n const options: CalculateDiffOptions = {\n new: {\n dashboardId: this.dashboard.id,\n version: this.newInfo.version,\n },\n base: {\n dashboardId: this.dashboard.id,\n version: this.baseInfo.version,\n },\n diffType: diff,\n };\n\n return this.historySrv\n .calculateDiff(options)\n .then(response => {\n this.delta[this.diff] = response;\n })\n .catch(() => {\n this.mode = 'list';\n })\n .finally(() => {\n this.loading = false;\n });\n }\n\n getLog(append = false) {\n this.loading = !append;\n this.appending = append;\n const options: HistoryListOpts = {\n limit: this.limit,\n start: this.start,\n };\n\n return this.historySrv\n .getHistoryList(this.dashboard, options)\n .then(revisions => {\n // set formatted dates & default values\n for (let rev of revisions) {\n rev.createdDateString = this.formatDate(rev.created);\n rev.ageString = this.formatBasicDate(rev.created);\n rev.checked = false;\n }\n\n this.revisions = append ? this.revisions.concat(revisions) : revisions;\n })\n .catch(err => {\n this.loading = false;\n })\n .finally(() => {\n this.loading = false;\n this.appending = false;\n });\n }\n\n isLastPage() {\n return _.find(this.revisions, rev => rev.version === 1);\n }\n\n reset() {\n this.delta = { basic: '', json: '' };\n this.diff = 'basic';\n this.mode = 'list';\n this.revisions = _.map(this.revisions, rev => _.extend({}, rev, { checked: false }));\n this.canCompare = false;\n this.start = 0;\n this.isNewLatest = false;\n }\n\n resetFromSource() {\n this.revisions = [];\n return this.getLog().then(this.reset.bind(this));\n }\n\n restore(version: number) {\n this.$rootScope.appEvent('confirm-modal', {\n title: 'Restore version',\n text: '',\n text2: `Are you sure you want to restore the dashboard to version ${version}? All unsaved changes will be lost.`,\n icon: 'fa-history',\n yesText: `Yes, restore to version ${version}`,\n onConfirm: this.restoreConfirm.bind(this, version),\n });\n }\n\n restoreConfirm(version: number) {\n this.loading = true;\n return this.historySrv\n .restoreDashboard(this.dashboard, version)\n .then(response => {\n this.$location.url(locationUtil.stripBaseFromUrl(response.url)).replace();\n this.$route.reload();\n this.$rootScope.appEvent('alert-success', ['Dashboard restored', 'Restored from version ' + version]);\n })\n .catch(() => {\n this.mode = 'list';\n this.loading = false;\n });\n }\n}\n\nexport function dashboardHistoryDirective() {\n return {\n restrict: 'E',\n templateUrl: 'public/app/features/dashboard/history/history.html',\n controller: HistoryListCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: {\n dashboard: '=',\n },\n };\n}\n\nangular.module('grafana.directives').directive('gfDashboardHistory', dashboardHistoryDirective);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/history/history.ts","import angular from 'angular';\nimport moment from 'moment';\nimport _ from 'lodash';\nimport $ from 'jquery';\nimport kbn from 'app/core/utils/kbn';\nimport * as dateMath from 'app/core/utils/datemath';\nimport impressionSrv from 'app/core/services/impression_srv';\n\nexport class DashboardLoaderSrv {\n /** @ngInject */\n constructor(\n private backendSrv,\n private dashboardSrv,\n private datasourceSrv,\n private $http,\n private $q,\n private $timeout,\n private contextSrv,\n private $routeParams,\n private $rootScope\n ) {}\n\n _dashboardLoadFailed(title, snapshot?) {\n snapshot = snapshot || false;\n return {\n meta: {\n canStar: false,\n isSnapshot: snapshot,\n canDelete: false,\n canSave: false,\n canEdit: false,\n dashboardNotFound: true,\n },\n dashboard: { title: title },\n };\n }\n\n loadDashboard(type, slug, uid) {\n var promise;\n\n if (type === 'script') {\n promise = this._loadScriptedDashboard(slug);\n } else if (type === 'snapshot') {\n promise = this.backendSrv.get('/api/snapshots/' + slug).catch(() => {\n return this._dashboardLoadFailed('Snapshot not found', true);\n });\n } else {\n promise = this.backendSrv\n .getDashboardByUid(uid)\n .then(result => {\n if (result.meta.isFolder) {\n this.$rootScope.appEvent('alert-error', ['Dashboard not found']);\n throw new Error('Dashboard not found');\n }\n return result;\n })\n .catch(err => {\n err.isHandled = true;\n return this._dashboardLoadFailed('Not found', true);\n });\n }\n\n if (this.contextSrv.isSignedIn) {\n promise.then(result => {\n if (result.meta.dashboardNotFound !== true) {\n impressionSrv.addDashboardImpression(result.dashboard.id, result.meta.url);\n\n let options = {\n method: 'PUT',\n url: '/api/user/lastdash',\n data: { dashboardId: result.dashboard.id },\n showSuccessAlert: false,\n };\n this.backendSrv.request(options).catch(err => {\n console.log('Error updating dash:', err.message);\n });\n }\n\n return result;\n });\n }\n\n return promise;\n }\n\n _loadScriptedDashboard(file) {\n var url = 'public/dashboards/' + file.replace(/\\.(?!js)/, '/') + '?' + new Date().getTime();\n\n return this.$http({ url: url, method: 'GET' })\n .then(this._executeScript.bind(this))\n .then(\n result => {\n return {\n meta: {\n fromScript: true,\n canDelete: false,\n canSave: false,\n canStar: false,\n },\n dashboard: result.data,\n };\n },\n err => {\n console.log('Script dashboard error ' + err);\n this.$rootScope.appEvent('alert-error', [\n 'Script Error',\n 'Please make sure it exists and returns a valid dashboard',\n ]);\n return this._dashboardLoadFailed('Scripted dashboard');\n }\n );\n }\n\n _executeScript(result) {\n var services = {\n dashboardSrv: this.dashboardSrv,\n datasourceSrv: this.datasourceSrv,\n $q: this.$q,\n };\n\n /*jshint -W054 */\n var script_func = new Function(\n 'ARGS',\n 'kbn',\n 'dateMath',\n '_',\n 'moment',\n 'window',\n 'document',\n '$',\n 'jQuery',\n 'services',\n result.data\n );\n var script_result = script_func(this.$routeParams, kbn, dateMath, _, moment, window, document, $, $, services);\n\n // Handle async dashboard scripts\n if (_.isFunction(script_result)) {\n var deferred = this.$q.defer();\n script_result(dashboard => {\n this.$timeout(() => {\n deferred.resolve({ data: dashboard });\n });\n });\n return deferred.promise;\n }\n\n return { data: script_result };\n }\n}\n\nangular.module('grafana.services').service('dashboardLoaderSrv', DashboardLoaderSrv);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/dashboard_loader_srv.ts","import _ from 'lodash';\nimport coreModule from 'app/core/core_module';\nimport { DashboardModel } from '../dashboard_model';\n\nexport interface HistoryListOpts {\n limit: number;\n start: number;\n}\n\nexport interface RevisionsModel {\n id: number;\n checked: boolean;\n dashboardId: number;\n parentVersion: number;\n version: number;\n created: Date;\n createdBy: string;\n message: string;\n}\n\nexport interface CalculateDiffOptions {\n new: DiffTarget;\n base: DiffTarget;\n diffType: string;\n}\n\nexport interface DiffTarget {\n dashboardId: number;\n version: number;\n unsavedDashboard?: DashboardModel; // when doing diffs against unsaved dashboard version\n}\n\nexport class HistorySrv {\n /** @ngInject */\n constructor(private backendSrv, private $q) {}\n\n getHistoryList(dashboard: DashboardModel, options: HistoryListOpts) {\n const id = dashboard && dashboard.id ? dashboard.id : void 0;\n return id ? this.backendSrv.get(`api/dashboards/id/${id}/versions`, options) : this.$q.when([]);\n }\n\n calculateDiff(options: CalculateDiffOptions) {\n return this.backendSrv.post('api/dashboards/calculate-diff', options);\n }\n\n restoreDashboard(dashboard: DashboardModel, version: number) {\n const id = dashboard && dashboard.id ? dashboard.id : void 0;\n const url = `api/dashboards/id/${id}/restore`;\n return id && _.isNumber(version) ? this.backendSrv.post(url, { version }) : this.$q.when({});\n }\n}\n\ncoreModule.service('historySrv', HistorySrv);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/history/history_srv.ts","import moment from 'moment';\nimport angular from 'angular';\nimport { appEvents, NavModel } from 'app/core/core';\nimport { DashboardModel } from '../dashboard_model';\n\nexport class DashNavCtrl {\n dashboard: DashboardModel;\n navModel: NavModel;\n titleTooltip: string;\n experiment: any;\n isSignedIn: boolean;\n\n /** @ngInject */\n constructor(private $scope, private dashboardSrv, private $location, public playlistSrv, contextSrv) {\n appEvents.on('save-dashboard', this.saveDashboard.bind(this), $scope);\n\n this.isSignedIn = contextSrv.isSignedIn;\n\n if (this.dashboard.meta.isSnapshot) {\n var meta = this.dashboard.meta;\n this.titleTooltip = 'Created:  ' + moment(meta.created).calendar();\n if (meta.expires) {\n this.titleTooltip += '
      Expires:  ' + moment(meta.expires).fromNow() + '
      ';\n }\n }\n }\n\n toggleSettings() {\n let search = this.$location.search();\n if (search.editview) {\n delete search.editview;\n } else {\n search.editview = 'settings';\n }\n this.$location.search(search);\n\n appEvents.emit('graph-hover-clear');\n }\n\n close() {\n let search = this.$location.search();\n if (search.editview) {\n delete search.editview;\n } else if (search.fullscreen) {\n delete search.fullscreen;\n delete search.edit;\n }\n this.$location.search(search);\n }\n\n starDashboard() {\n this.dashboardSrv.starDashboard(this.dashboard.id, this.dashboard.meta.isStarred).then(newState => {\n this.dashboard.meta.isStarred = newState;\n });\n }\n\n shareDashboard(tabIndex) {\n var modalScope = this.$scope.$new();\n modalScope.tabIndex = tabIndex;\n modalScope.dashboard = this.dashboard;\n modalScope.experiment = this.experiment;\n\n appEvents.emit('show-modal', {\n src: 'public/app/features/dashboard/partials/shareModal.html',\n scope: modalScope,\n });\n }\n\n hideTooltip(evt) {\n angular.element(evt.currentTarget).tooltip('hide');\n }\n\n saveDashboard() {\n return this.dashboardSrv.saveDashboard();\n }\n\n showSearch() {\n appEvents.emit('show-dash-search');\n }\n\n addPanel() {\n appEvents.emit('dash-scroll', { animate: true, evt: 0 });\n\n if (this.dashboard.panels.length > 0 && this.dashboard.panels[0].type === 'add-panel') {\n return; // Return if the \"Add panel\" exists already\n }\n\n this.dashboard.addPanel({\n type: 'add-panel',\n gridPos: { x: 0, y: 0, w: 12, h: 9 },\n title: 'Panel Title',\n });\n }\n\n navItemClicked(navItem, evt) {\n if (navItem.clickHandler) {\n navItem.clickHandler();\n evt.preventDefault();\n }\n }\n}\n\nexport function dashNavDirective() {\n return {\n restrict: 'E',\n templateUrl: 'public/app/features/dashboard/dashnav/dashnav.html',\n controller: DashNavCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n transclude: true,\n scope: { dashboard: '=', experiment: '=' },\n };\n}\n\nangular.module('grafana.directives').directive('dashnav', dashNavDirective);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/dashnav/dashnav.ts","import coreModule from 'app/core/core_module';\n\nconst template = `\n
      \n\t
      \n\t\t

      \n\t\t\t\n\t\t\tSave As...\n\t\t

      \n\n\t\t\n\t\t\t\n\t\t\n\t
      \n\n\t
      \n\t\t
      \n\t\t\t
      \n\t\t\t\t\n\t\t\t\t\n\t\t\t
      \n
      \n \n \n
      \n\t\t
      \n\n\t\t
      \n\t\t\t\n\t\t\tCancel\n\t\t
      \n\t\n
      \n`;\n\nexport class SaveDashboardAsModalCtrl {\n clone: any;\n folderId: any;\n dismiss: () => void;\n isValidFolderSelection = true;\n\n /** @ngInject */\n constructor(private dashboardSrv) {\n var dashboard = this.dashboardSrv.getCurrent();\n this.clone = dashboard.getSaveModelClone();\n this.clone.id = null;\n this.clone.uid = '';\n this.clone.title += ' Copy';\n this.clone.editable = true;\n this.clone.hideControls = false;\n this.folderId = dashboard.meta.folderId;\n\n // remove alerts if source dashboard is already persisted\n // do not want to create alert dupes\n if (dashboard.id > 0) {\n this.clone.panels.forEach(panel => {\n if (panel.type === 'graph' && panel.alert) {\n delete panel.thresholds;\n }\n delete panel.alert;\n });\n }\n\n delete this.clone.autoUpdate;\n }\n\n save() {\n return this.dashboardSrv.save(this.clone, { folderId: this.folderId }).then(this.dismiss);\n }\n\n keyDown(evt) {\n if (evt.keyCode === 13) {\n this.save();\n }\n }\n\n onFolderChange(folder) {\n this.folderId = folder.id;\n }\n\n onEnterFolderCreation() {\n this.isValidFolderSelection = false;\n }\n\n onExitFolderCreation() {\n this.isValidFolderSelection = true;\n }\n}\n\nexport function saveDashboardAsDirective() {\n return {\n restrict: 'E',\n template: template,\n controller: SaveDashboardAsModalCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: { dismiss: '&' },\n };\n}\n\ncoreModule.directive('saveDashboardAsModal', saveDashboardAsDirective);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/save_as_modal.ts","import angular from 'angular';\nimport _ from 'lodash';\n\nexport class SubmenuCtrl {\n annotations: any;\n variables: any;\n dashboard: any;\n\n /** @ngInject */\n constructor(private $rootScope, private variableSrv, private $location) {\n this.annotations = this.dashboard.templating.list;\n this.variables = this.variableSrv.variables;\n }\n\n annotationStateChanged() {\n this.$rootScope.$broadcast('refresh');\n }\n\n variableUpdated(variable) {\n this.variableSrv.variableUpdated(variable, true);\n }\n\n openEditView(editview) {\n var search = _.extend(this.$location.search(), { editview: editview });\n this.$location.search(search);\n }\n}\n\nexport function submenuDirective() {\n return {\n restrict: 'E',\n templateUrl: 'public/app/features/dashboard/submenu/submenu.html',\n controller: SubmenuCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: {\n dashboard: '=',\n },\n };\n}\n\nangular.module('grafana.directives').directive('dashboardSubmenu', submenuDirective);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/submenu/submenu.ts","import coreModule from 'app/core/core_module';\n\nconst template = `\n
      \n
      \n

      \n \n Save changes\n

      \n\n \n \n \n
      \n\n
      \n
      \n
      \n \n
      \n
      \n\n
      \n \n Save\n Saving...\n \n \n
      \n \n
      \n`;\n\nexport class SaveDashboardModalCtrl {\n message: string;\n saveVariables = false;\n saveTimerange = false;\n time: any;\n originalTime: any;\n current = [];\n originalCurrent = [];\n max: number;\n saveForm: any;\n isSaving: boolean;\n dismiss: () => void;\n timeChange = false;\n variableValueChange = false;\n\n /** @ngInject */\n constructor(private dashboardSrv) {\n this.message = '';\n this.max = 64;\n this.isSaving = false;\n this.timeChange = this.dashboardSrv.getCurrent().hasTimeChanged();\n this.variableValueChange = this.dashboardSrv.getCurrent().hasVariableValuesChanged();\n }\n\n save() {\n if (!this.saveForm.$valid) {\n return;\n }\n\n var options = {\n saveVariables: this.saveVariables,\n saveTimerange: this.saveTimerange,\n message: this.message,\n };\n\n var dashboard = this.dashboardSrv.getCurrent();\n var saveModel = dashboard.getSaveModelClone(options);\n\n this.isSaving = true;\n\n return this.dashboardSrv.save(saveModel, options).then(this.postSave.bind(this, options));\n }\n\n postSave(options) {\n if (options.saveVariables) {\n this.dashboardSrv.getCurrent().resetOriginalVariables();\n }\n\n if (options.saveTimerange) {\n this.dashboardSrv.getCurrent().resetOriginalTime();\n }\n\n this.dismiss();\n }\n}\n\nexport function saveDashboardModalDirective() {\n return {\n restrict: 'E',\n template: template,\n controller: SaveDashboardModalCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: { dismiss: '&' },\n };\n}\n\ncoreModule.directive('saveDashboardModal', saveDashboardModalDirective);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/save_modal.ts","import angular from 'angular';\nimport { saveAs } from 'file-saver';\nimport coreModule from 'app/core/core_module';\n\nconst template = `\n
      \n
      \n

      \n Cannot save provisioned dashboard\n

      \n\n \n \n \n
      \n\n
      \n \n This dashboard cannot be saved from Grafana's UI since it has been provisioned from another source.\n Copy the JSON or save it to a file below. Then you can update your dashboard in corresponding provisioning source.
      \n See \n documentation for more information about provisioning.\n
      \n
      \n
      \n \n
      \n
      \n \n \n Cancel\n
      \n
      \n
      \n
      \n`;\n\nexport class SaveProvisionedDashboardModalCtrl {\n dash: any;\n dashboardJson: string;\n dismiss: () => void;\n\n /** @ngInject */\n constructor(dashboardSrv) {\n this.dash = dashboardSrv.getCurrent().getSaveModelClone();\n delete this.dash.id;\n this.dashboardJson = angular.toJson(this.dash, true);\n }\n\n save() {\n var blob = new Blob([angular.toJson(this.dash, true)], {\n type: 'application/json;charset=utf-8',\n });\n saveAs(blob, this.dash.title + '-' + new Date().getTime() + '.json');\n }\n\n getJsonForClipboard() {\n return this.dashboardJson;\n }\n}\n\nexport function saveProvisionedDashboardModalDirective() {\n return {\n restrict: 'E',\n template: template,\n controller: SaveProvisionedDashboardModalCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: { dismiss: '&' },\n };\n}\n\ncoreModule.directive('saveProvisionedDashboardModal', saveProvisionedDashboardModalDirective);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/save_provisioned_modal.ts","import angular from 'angular';\nimport config from 'app/core/config';\nimport moment from 'moment';\n\nexport class ShareModalCtrl {\n /** @ngInject */\n constructor($scope, $rootScope, $location, $timeout, timeSrv, templateSrv, linkSrv) {\n $scope.options = {\n forCurrent: true,\n includeTemplateVars: true,\n theme: 'current',\n };\n $scope.editor = { index: $scope.tabIndex || 0 };\n\n $scope.init = function() {\n $scope.modeSharePanel = $scope.panel ? true : false;\n\n $scope.tabs = [{ title: 'Link', src: 'shareLink.html' }];\n\n if ($scope.modeSharePanel) {\n $scope.modalTitle = 'Share Panel';\n $scope.tabs.push({ title: 'Embed', src: 'shareEmbed.html' });\n } else {\n $scope.modalTitle = 'Share';\n }\n\n if (!$scope.dashboard.meta.isSnapshot) {\n $scope.tabs.push({ title: 'Snapshot', src: 'shareSnapshot.html' });\n }\n\n if (!$scope.dashboard.meta.isSnapshot && !$scope.modeSharePanel) {\n $scope.tabs.push({ title: 'Dashboard', src: 'shareExport.html' });\n }\n\n if (!$scope.modeSharePanel && !$scope.dashboard.meta.isSnapshot) {\n $scope.tabs.push({ title: 'Experiment', src: 'shareExperiment.html' });\n }\n\n $scope.buildUrl();\n };\n\n $scope.buildUrl = function() {\n var baseUrl = $location.absUrl();\n var queryStart = baseUrl.indexOf('?');\n\n if (queryStart !== -1) {\n baseUrl = baseUrl.substring(0, queryStart);\n }\n\n var params = angular.copy($location.search());\n\n var range = timeSrv.timeRange();\n params.from = range.from.valueOf();\n params.to = range.to.valueOf();\n params.orgId = config.bootData.user.orgId;\n\n if ($scope.options.includeTemplateVars) {\n templateSrv.fillVariableValuesForUrl(params);\n }\n\n if (!$scope.options.forCurrent) {\n delete params.from;\n delete params.to;\n }\n\n if ($scope.options.theme !== 'current') {\n params.theme = $scope.options.theme;\n }\n\n if ($scope.modeSharePanel) {\n params.panelId = $scope.panel.id;\n params.fullscreen = true;\n } else {\n delete params.panelId;\n delete params.fullscreen;\n }\n\n $scope.shareUrl = linkSrv.addParamsToUrl(baseUrl, params);\n\n var soloUrl = baseUrl.replace(config.appSubUrl + '/dashboard/', config.appSubUrl + '/dashboard-solo/');\n soloUrl = soloUrl.replace(config.appSubUrl + '/d/', config.appSubUrl + '/d-solo/');\n delete params.fullscreen;\n delete params.edit;\n delete params.orgId;\n delete params['var-experiment_id'];\n soloUrl = linkSrv.addParamsToUrl(soloUrl, params);\n\n $scope.iframeHtml = '';\n\n $scope.imageUrl = soloUrl.replace(\n config.appSubUrl + '/dashboard-solo/',\n config.appSubUrl + '/render/dashboard-solo/'\n );\n $scope.imageUrl = $scope.imageUrl.replace(config.appSubUrl + '/d-solo/', config.appSubUrl + '/render/d-solo/');\n $scope.imageUrl += '&width=1000&height=500' + $scope.getLocalTimeZone();\n };\n\n // This function will try to return the proper full name of the local timezone\n // Chrome does not handle the timezone offset (but phantomjs does)\n $scope.getLocalTimeZone = function() {\n let utcOffset = '&tz=UTC' + encodeURIComponent(moment().format('Z'));\n\n // Older browser does not the internationalization API\n if (!(window).Intl) {\n return utcOffset;\n }\n\n const dateFormat = (window).Intl.DateTimeFormat();\n if (!dateFormat.resolvedOptions) {\n return utcOffset;\n }\n\n const options = dateFormat.resolvedOptions();\n if (!options.timeZone) {\n return utcOffset;\n }\n\n return '&tz=' + encodeURIComponent(options.timeZone);\n };\n\n $scope.getShareUrl = function() {\n return $scope.shareUrl;\n };\n }\n}\n\nangular.module('grafana.controllers').controller('ShareModalCtrl', ShareModalCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/shareModalCtrl.ts","import angular from 'angular';\nimport _ from 'lodash';\n\nexport class ShareSnapshotCtrl {\n /** @ngInject **/\n constructor($scope, $rootScope, $location, backendSrv, $timeout, timeSrv) {\n $scope.snapshot = {\n name: $scope.dashboard.title,\n expires: 0,\n timeoutSeconds: 4,\n };\n\n $scope.step = 1;\n\n $scope.expireOptions = [\n { text: '1 Hour', value: 60 * 60 },\n { text: '1 Day', value: 60 * 60 * 24 },\n { text: '7 Days', value: 60 * 60 * 24 * 7 },\n { text: 'Never', value: 0 },\n ];\n\n $scope.accessOptions = [\n { text: 'Anyone with the link', value: 1 },\n { text: 'Organization users', value: 2 },\n { text: 'Public on the web', value: 3 },\n ];\n\n $scope.init = function() {\n backendSrv.get('/api/snapshot/shared-options').then(function(options) {\n $scope.externalUrl = options['externalSnapshotURL'];\n $scope.sharingButtonText = options['externalSnapshotName'];\n $scope.externalEnabled = options['externalEnabled'];\n });\n };\n\n $scope.apiUrl = '/api/snapshots';\n\n $scope.createSnapshot = function(external) {\n $scope.dashboard.snapshot = {\n timestamp: new Date(),\n };\n\n if (!external) {\n $scope.dashboard.snapshot.originalUrl = $location.absUrl();\n }\n\n $scope.loading = true;\n $scope.snapshot.external = external;\n\n $rootScope.$broadcast('refresh');\n\n $timeout(function() {\n $scope.saveSnapshot(external);\n }, $scope.snapshot.timeoutSeconds * 1000);\n };\n\n $scope.saveSnapshot = function(external) {\n var dash = $scope.dashboard.getSaveModelClone();\n $scope.scrubDashboard(dash);\n\n var cmdData = {\n dashboard: dash,\n name: dash.title,\n expires: $scope.snapshot.expires,\n };\n\n var postUrl = external ? $scope.externalUrl + $scope.apiUrl : $scope.apiUrl;\n\n backendSrv.post(postUrl, cmdData).then(\n function(results) {\n $scope.loading = false;\n\n if (external) {\n $scope.deleteUrl = results.deleteUrl;\n $scope.snapshotUrl = results.url;\n $scope.saveExternalSnapshotRef(cmdData, results);\n } else {\n var url = $location.url();\n var baseUrl = $location.absUrl();\n\n if (url !== '/') {\n baseUrl = baseUrl.replace(url, '') + '/';\n }\n\n $scope.snapshotUrl = baseUrl + 'dashboard/snapshot/' + results.key;\n $scope.deleteUrl = baseUrl + 'api/snapshots-delete/' + results.deleteKey;\n }\n\n $scope.step = 2;\n },\n function() {\n $scope.loading = false;\n }\n );\n };\n\n $scope.getSnapshotUrl = function() {\n return $scope.snapshotUrl;\n };\n\n $scope.scrubDashboard = function(dash) {\n // change title\n dash.title = $scope.snapshot.name;\n\n // Attach experiment info\n dash.experiment = $scope.experiment;\n\n // make relative times absolute\n dash.time = timeSrv.timeRange();\n\n // remove panel queries & links\n _.each(dash.panels, function(panel) {\n panel.targets = [];\n panel.links = [];\n panel.datasource = null;\n });\n\n // remove annotation queries\n dash.annotations.list = _.chain(dash.annotations.list)\n .filter(function(annotation) {\n return annotation.enable;\n })\n .map(function(annotation) {\n return {\n name: annotation.name,\n enable: annotation.enable,\n iconColor: annotation.iconColor,\n snapshotData: annotation.snapshotData,\n type: annotation.type,\n builtIn: annotation.builtIn,\n hide: annotation.hide,\n };\n })\n .value();\n\n // remove template queries\n _.each(dash.templating.list, function(variable) {\n variable.query = '';\n variable.options = variable.current;\n variable.refresh = false;\n });\n\n // snapshot single panel\n if ($scope.modeSharePanel) {\n var singlePanel = $scope.panel.getSaveModel();\n singlePanel.gridPos.w = 24;\n singlePanel.gridPos.x = 0;\n singlePanel.gridPos.y = 0;\n singlePanel.gridPos.h = 20;\n dash.panels = [singlePanel];\n }\n\n // cleanup snapshotData\n delete $scope.dashboard.snapshot;\n $scope.dashboard.forEachPanel(function(panel) {\n delete panel.snapshotData;\n });\n _.each($scope.dashboard.annotations.list, function(annotation) {\n delete annotation.snapshotData;\n });\n };\n\n $scope.deleteSnapshot = function() {\n backendSrv.get($scope.deleteUrl).then(function() {\n $scope.step = 3;\n });\n };\n\n $scope.saveExternalSnapshotRef = function(cmdData, results) {\n // save external in local instance as well\n cmdData.external = true;\n cmdData.key = results.key;\n cmdData.deleteKey = results.deleteKey;\n backendSrv.post('/api/snapshots/', cmdData);\n };\n }\n}\n\nangular.module('grafana.controllers').controller('ShareSnapshotCtrl', ShareSnapshotCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/share_snapshot_ctrl.ts","import coreModule from 'app/core/core_module';\nimport { DashboardModel } from './dashboard_model';\nimport locationUtil from 'app/core/utils/location_util';\n\nexport class DashboardSrv {\n dash: any;\n\n /** @ngInject */\n constructor(private backendSrv, private $rootScope, private $location) {}\n\n create(dashboard, meta) {\n return new DashboardModel(dashboard, meta);\n }\n\n setCurrent(dashboard) {\n this.dash = dashboard;\n }\n\n getCurrent() {\n return this.dash;\n }\n\n handleSaveDashboardError(clone, options, err) {\n options = options || {};\n options.overwrite = true;\n\n if (err.data && err.data.status === 'version-mismatch') {\n err.isHandled = true;\n\n this.$rootScope.appEvent('confirm-modal', {\n title: 'Conflict',\n text: 'Someone else has updated this dashboard.',\n text2: 'Would you still like to save this dashboard?',\n yesText: 'Save & Overwrite',\n icon: 'fa-warning',\n onConfirm: () => {\n this.save(clone, options);\n },\n });\n }\n\n if (err.data && err.data.status === 'name-exists') {\n err.isHandled = true;\n\n this.$rootScope.appEvent('confirm-modal', {\n title: 'Conflict',\n text: 'A dashboard with the same name in selected folder already exists.',\n text2: 'Would you still like to save this dashboard?',\n yesText: 'Save & Overwrite',\n icon: 'fa-warning',\n onConfirm: () => {\n this.save(clone, options);\n },\n });\n }\n\n if (err.data && err.data.status === 'plugin-dashboard') {\n err.isHandled = true;\n\n this.$rootScope.appEvent('confirm-modal', {\n title: 'Plugin Dashboard',\n text: err.data.message,\n text2: 'Your changes will be lost when you update the plugin. Use Save As to create custom version.',\n yesText: 'Overwrite',\n icon: 'fa-warning',\n altActionText: 'Save As',\n onAltAction: () => {\n this.showSaveAsModal();\n },\n onConfirm: () => {\n this.save(clone, { overwrite: true });\n },\n });\n }\n }\n\n postSave(clone, data) {\n this.dash.version = data.version;\n\n const newUrl = locationUtil.stripBaseFromUrl(data.url);\n const currentPath = this.$location.path();\n\n if (newUrl !== currentPath) {\n this.$location.url(newUrl).replace();\n }\n\n this.$rootScope.appEvent('dashboard-saved', this.dash);\n this.$rootScope.appEvent('alert-success', ['Dashboard saved']);\n\n return this.dash;\n }\n\n save(clone, options) {\n options = options || {};\n options.folderId = options.folderId >= 0 ? options.folderId : this.dash.meta.folderId || clone.folderId;\n\n return this.backendSrv\n .saveDashboard(clone, options)\n .then(this.postSave.bind(this, clone))\n .catch(this.handleSaveDashboardError.bind(this, clone, options));\n }\n\n saveDashboard(options?, clone?) {\n if (clone) {\n this.setCurrent(this.create(clone, this.dash.meta));\n }\n\n if (this.dash.meta.provisioned) {\n return this.showDashboardProvisionedModal();\n }\n\n if (!this.dash.meta.canSave && options.makeEditable !== true) {\n return Promise.resolve();\n }\n\n if (this.dash.title === 'New dashboard') {\n return this.showSaveAsModal();\n }\n\n if (this.dash.version > 0) {\n return this.showSaveModal();\n }\n\n return this.save(this.dash.getSaveModelClone(), options);\n }\n\n saveJSONDashboard(json: string) {\n return this.save(JSON.parse(json), {});\n }\n\n showDashboardProvisionedModal() {\n this.$rootScope.appEvent('show-modal', {\n templateHtml: '',\n });\n }\n\n showSaveAsModal() {\n this.$rootScope.appEvent('show-modal', {\n templateHtml: '',\n modalClass: 'modal--narrow',\n });\n }\n\n showSaveModal() {\n this.$rootScope.appEvent('show-modal', {\n templateHtml: '',\n modalClass: 'modal--narrow',\n });\n }\n\n starDashboard(dashboardId, isStarred) {\n let promise;\n\n if (isStarred) {\n promise = this.backendSrv.delete('/api/user/stars/dashboard/' + dashboardId).then(() => {\n return false;\n });\n } else {\n promise = this.backendSrv.post('/api/user/stars/dashboard/' + dashboardId).then(() => {\n return true;\n });\n }\n\n return promise.then(res => {\n if (this.dash && this.dash.id === dashboardId) {\n this.dash.meta.isStarred = res;\n }\n return res;\n });\n }\n}\n\ncoreModule.service('dashboardSrv', DashboardSrv);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/dashboard_srv.ts","import angular from 'angular';\nimport _ from 'lodash';\nimport config from 'app/core/config';\nimport { DashboardModel } from './dashboard_model';\n\n// represents the transient view state\n// like fullscreen panel & edit\nexport class DashboardViewState {\n state: any;\n panelScopes: any;\n $scope: any;\n dashboard: DashboardModel;\n editStateChanged: any;\n fullscreenPanel: any;\n oldTimeRange: any;\n\n /** @ngInject */\n constructor($scope, private $location, private $timeout, private $rootScope) {\n var self = this;\n self.state = {};\n self.panelScopes = [];\n self.$scope = $scope;\n self.dashboard = $scope.dashboard;\n\n $scope.onAppEvent('$routeUpdate', function() {\n var urlState = self.getQueryStringState();\n if (self.needsSync(urlState)) {\n self.update(urlState, true);\n }\n });\n\n $scope.onAppEvent('panel-change-view', function(evt, payload) {\n self.update(payload);\n });\n\n $scope.onAppEvent('panel-initialized', function(evt, payload) {\n self.registerPanel(payload.scope);\n });\n\n // this marks changes to location during this digest cycle as not to add history item\n // don't want url changes like adding orgId to add browser history\n $location.replace();\n this.update(this.getQueryStringState());\n }\n\n needsSync(urlState) {\n return _.isEqual(this.state, urlState) === false;\n }\n\n getQueryStringState() {\n var state = this.$location.search();\n state.panelId = parseInt(state.panelId) || null;\n state.fullscreen = state.fullscreen ? true : null;\n state.edit = state.edit === 'true' || state.edit === true || null;\n state.editview = state.editview || null;\n state.orgId = config.bootData.user.orgId;\n return state;\n }\n\n serializeToUrl() {\n var urlState = _.clone(this.state);\n urlState.fullscreen = this.state.fullscreen ? true : null;\n urlState.edit = this.state.edit ? true : null;\n return urlState;\n }\n\n update(state, fromRouteUpdated?) {\n // implement toggle logic\n if (state.toggle) {\n delete state.toggle;\n if (this.state.fullscreen && state.fullscreen) {\n if (this.state.edit === state.edit) {\n state.fullscreen = !state.fullscreen;\n }\n }\n }\n\n // remember if editStateChanged\n this.editStateChanged = (state.edit || false) !== (this.state.edit || false);\n\n _.extend(this.state, state);\n this.dashboard.meta.fullscreen = this.state.fullscreen;\n\n if (!this.state.fullscreen) {\n this.state.fullscreen = null;\n this.state.edit = null;\n // clear panel id unless in solo mode\n if (!this.dashboard.meta.soloMode) {\n this.state.panelId = null;\n }\n }\n\n if ((this.state.fullscreen || this.dashboard.meta.soloMode) && this.state.panelId) {\n // Trying to render panel in fullscreen when it's in the collapsed row causes an issue.\n // So in this case expand collapsed row first.\n this.toggleCollapsedPanelRow(this.state.panelId);\n }\n\n // if no edit state cleanup tab parm\n if (!this.state.edit) {\n delete this.state.tab;\n }\n\n // do not update url params if we are here\n // from routeUpdated event\n if (fromRouteUpdated !== true) {\n this.$location.search(this.serializeToUrl());\n }\n\n this.syncState();\n }\n\n toggleCollapsedPanelRow(panelId) {\n for (let panel of this.dashboard.panels) {\n if (panel.collapsed) {\n for (let rowPanel of panel.panels) {\n if (rowPanel.id === panelId) {\n this.dashboard.toggleRow(panel);\n return;\n }\n }\n }\n }\n }\n\n syncState() {\n if (this.panelScopes.length === 0) {\n return;\n }\n\n if (this.dashboard.meta.fullscreen) {\n var panelScope = this.getPanelScope(this.state.panelId);\n if (!panelScope) {\n return;\n }\n\n if (this.fullscreenPanel) {\n // if already fullscreen\n if (this.fullscreenPanel === panelScope && this.editStateChanged === false) {\n return;\n } else {\n this.leaveFullscreen(false);\n }\n }\n\n if (!panelScope.ctrl.editModeInitiated) {\n panelScope.ctrl.initEditMode();\n }\n\n if (!panelScope.ctrl.fullscreen) {\n this.enterFullscreen(panelScope);\n }\n } else if (this.fullscreenPanel) {\n this.leaveFullscreen(true);\n }\n }\n\n getPanelScope(id) {\n return _.find(this.panelScopes, function(panelScope) {\n return panelScope.ctrl.panel.id === id;\n });\n }\n\n leaveFullscreen(render) {\n var self = this;\n var ctrl = self.fullscreenPanel.ctrl;\n\n ctrl.editMode = false;\n ctrl.fullscreen = false;\n\n this.dashboard.setViewMode(ctrl.panel, false, false);\n this.$scope.appEvent('panel-fullscreen-exit', { panelId: ctrl.panel.id });\n this.$scope.appEvent('dash-scroll', { restore: true });\n\n if (!render) {\n return false;\n }\n\n this.$timeout(function() {\n if (self.oldTimeRange !== ctrl.range) {\n self.$rootScope.$broadcast('refresh');\n } else {\n self.$rootScope.$broadcast('render');\n }\n delete self.fullscreenPanel;\n });\n return true;\n }\n\n enterFullscreen(panelScope) {\n var ctrl = panelScope.ctrl;\n\n ctrl.editMode = this.state.edit && this.dashboard.meta.canEdit;\n ctrl.fullscreen = true;\n\n this.oldTimeRange = ctrl.range;\n this.fullscreenPanel = panelScope;\n\n // Firefox doesn't return scrollTop position properly if 'dash-scroll' is emitted after setViewMode()\n this.$scope.appEvent('dash-scroll', { animate: false, pos: 0 });\n this.dashboard.setViewMode(ctrl.panel, true, ctrl.editMode);\n this.$scope.appEvent('panel-fullscreen-enter', { panelId: ctrl.panel.id });\n }\n\n registerPanel(panelScope) {\n var self = this;\n self.panelScopes.push(panelScope);\n\n if (!self.dashboard.meta.soloMode) {\n if (self.state.panelId === panelScope.ctrl.panel.id) {\n if (self.state.edit) {\n panelScope.ctrl.editPanel();\n } else {\n panelScope.ctrl.viewPanel();\n }\n }\n }\n\n var unbind = panelScope.$on('$destroy', function() {\n self.panelScopes = _.without(self.panelScopes, panelScope);\n unbind();\n });\n }\n}\n\n/** @ngInject */\nexport function dashboardViewStateSrv($location, $timeout, $rootScope) {\n return {\n create: function($scope) {\n return new DashboardViewState($scope, $location, $timeout, $rootScope);\n },\n };\n}\n\nangular.module('grafana.services').factory('dashboardViewStateSrv', dashboardViewStateSrv);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/view_state_srv.ts","import moment from 'moment';\nimport _ from 'lodash';\nimport coreModule from 'app/core/core_module';\nimport kbn from 'app/core/utils/kbn';\nimport * as dateMath from 'app/core/utils/datemath';\n\nclass TimeSrv {\n time: any;\n refreshTimer: any;\n refresh: boolean;\n oldRefresh: boolean;\n dashboard: any;\n experiment: any;\n timeAtLoad: any;\n private autoRefreshBlocked: boolean;\n\n /** @ngInject **/\n constructor(private $rootScope, private $timeout, private $location, private timer, private contextSrv) {\n // default time\n this.time = { from: '6h', to: 'now' };\n\n $rootScope.$on('zoom-out', this.zoomOut.bind(this));\n $rootScope.$on('$routeUpdate', this.routeUpdated.bind(this));\n\n document.addEventListener('visibilitychange', () => {\n if (this.autoRefreshBlocked && document.visibilityState === 'visible') {\n this.autoRefreshBlocked = false;\n\n this.refreshDashboard();\n }\n });\n }\n\n init(dashboard, experiment) {\n this.timer.cancelAll();\n\n this.dashboard = dashboard;\n this.experiment = experiment;\n this.time = dashboard.time;\n this.refresh = dashboard.refresh;\n\n this.initTimeFromUrl();\n this.parseTime();\n\n // remember time at load so we can go back to it\n this.timeAtLoad = _.cloneDeep(this.time);\n\n if (this.refresh) {\n this.setAutoRefresh(this.refresh);\n }\n }\n\n private parseTime() {\n // when absolute time is saved in json it is turned to a string\n if (_.isString(this.time.from) && this.time.from.indexOf('Z') >= 0) {\n this.time.from = moment(this.time.from).utc();\n }\n if (_.isString(this.time.to) && this.time.to.indexOf('Z') >= 0) {\n this.time.to = moment(this.time.to).utc();\n }\n }\n\n private parseUrlParam(value) {\n if (value.indexOf('now') !== -1) {\n return value;\n }\n // Length based formatting is causing problems with 8 digit timestamps,\n // disabling this for now.\n // if (value.length === 8) {\n // return moment.utc(value, 'YYYYMMDD');\n // }\n // if (value.length === 15) {\n // return moment.utc(value, 'YYYYMMDDTHHmmss');\n // }\n\n if (!isNaN(value)) {\n var epoch = parseInt(value);\n return moment.utc(epoch);\n }\n\n return null;\n }\n\n private initTimeFromUrl() {\n var params = this.$location.search();\n\n if (params.from && params.to) {\n this.time.from = this.parseUrlParam(params.from) || this.time.from;\n this.time.to = this.parseUrlParam(params.to) || this.time.to;\n } else if (this.experiment) {\n this.time.from = moment.utc(this.experiment.startedNs / Math.pow(10, 6));\n this.time.to = moment.utc(this.experiment.stoppedNs / Math.pow(10, 6));\n }\n\n if (params.refresh) {\n this.refresh = params.refresh || this.refresh;\n }\n }\n\n private routeUpdated() {\n var params = this.$location.search();\n var urlRange = this.timeRangeForUrl();\n // check if url has time range\n if (params.from && params.to) {\n // is it different from what our current time range?\n if (params.from !== urlRange.from || params.to !== urlRange.to) {\n // issue update\n this.initTimeFromUrl();\n this.setTime(this.time, true);\n }\n } else if (this.timeHasChangedSinceLoad()) {\n this.setTime(this.timeAtLoad, true);\n }\n }\n\n private timeHasChangedSinceLoad() {\n return this.timeAtLoad.from !== this.time.from || this.timeAtLoad.to !== this.time.to;\n }\n\n setAutoRefresh(interval) {\n this.dashboard.refresh = interval;\n this.cancelNextRefresh();\n if (interval) {\n var intervalMs = kbn.interval_to_ms(interval);\n\n this.refreshTimer = this.timer.register(\n this.$timeout(() => {\n this.startNextRefreshTimer(intervalMs);\n this.refreshDashboard();\n }, intervalMs)\n );\n }\n\n // update url\n var params = this.$location.search();\n if (interval) {\n params.refresh = interval;\n this.$location.search(params);\n } else if (params.refresh) {\n delete params.refresh;\n this.$location.search(params);\n }\n }\n\n refreshDashboard() {\n this.$rootScope.$broadcast('refresh');\n }\n\n private startNextRefreshTimer(afterMs) {\n this.cancelNextRefresh();\n this.refreshTimer = this.timer.register(\n this.$timeout(() => {\n this.startNextRefreshTimer(afterMs);\n if (this.contextSrv.isGrafanaVisible()) {\n this.refreshDashboard();\n } else {\n this.autoRefreshBlocked = true;\n }\n }, afterMs)\n );\n }\n\n private cancelNextRefresh() {\n this.timer.cancel(this.refreshTimer);\n }\n\n setTime(time, fromRouteUpdate?) {\n _.extend(this.time, time);\n\n // disable refresh if zoom in or zoom out\n if (moment.isMoment(time.to)) {\n this.oldRefresh = this.dashboard.refresh || this.oldRefresh;\n this.setAutoRefresh(false);\n } else if (this.oldRefresh && this.oldRefresh !== this.dashboard.refresh) {\n this.setAutoRefresh(this.oldRefresh);\n this.oldRefresh = null;\n }\n\n // update url\n if (fromRouteUpdate !== true) {\n var urlRange = this.timeRangeForUrl();\n var urlParams = this.$location.search();\n urlParams.from = urlRange.from;\n urlParams.to = urlRange.to;\n this.$location.search(urlParams);\n }\n\n this.$rootScope.appEvent('time-range-changed', this.time);\n this.$timeout(this.refreshDashboard.bind(this), 0);\n }\n\n timeRangeForUrl() {\n var range = this.timeRange().raw;\n\n if (moment.isMoment(range.from)) {\n range.from = range.from.valueOf().toString();\n }\n if (moment.isMoment(range.to)) {\n range.to = range.to.valueOf().toString();\n }\n\n return range;\n }\n\n timeRange() {\n // make copies if they are moment (do not want to return out internal moment, because they are mutable!)\n var raw = {\n from: moment.isMoment(this.time.from) ? moment(this.time.from) : this.time.from,\n to: moment.isMoment(this.time.to) ? moment(this.time.to) : this.time.to,\n };\n\n var timezone = this.dashboard && this.dashboard.getTimezone();\n\n return {\n from: dateMath.parse(raw.from, false, timezone),\n to: dateMath.parse(raw.to, true, timezone),\n raw: raw,\n };\n }\n\n zoomOut(e, factor) {\n var range = this.timeRange();\n\n var timespan = range.to.valueOf() - range.from.valueOf();\n var center = range.to.valueOf() - timespan / 2;\n\n var to = center + timespan * factor / 2;\n var from = center - timespan * factor / 2;\n\n if (to > Date.now() && range.to <= Date.now()) {\n var offset = to - Date.now();\n from = from - offset;\n to = Date.now();\n }\n\n this.setTime({ from: moment.utc(from), to: moment.utc(to) });\n }\n}\n\ncoreModule.service('timeSrv', TimeSrv);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/time_srv.ts","import coreModule from 'app/core/core_module';\n\nconst hitTypes = {\n FOLDER: 'dash-folder',\n DASHBOARD: 'dash-db',\n};\n\nexport class ValidationSrv {\n rootName = 'general';\n\n /** @ngInject */\n constructor(private $q, private backendSrv) {}\n\n validateNewDashboardName(folderId, name) {\n return this.validate(folderId, name, 'A dashboard in this folder with the same name already exists');\n }\n\n validateNewFolderName(name) {\n return this.validate(0, name, 'A folder or dashboard in the general folder with the same name already exists');\n }\n\n private validate(folderId, name, existingErrorMessage) {\n name = (name || '').trim();\n const nameLowerCased = name.toLowerCase();\n\n if (name.length === 0) {\n return this.$q.reject({\n type: 'REQUIRED',\n message: 'Name is required',\n });\n }\n\n if (folderId === 0 && nameLowerCased === this.rootName) {\n return this.$q.reject({\n type: 'EXISTING',\n message: 'This is a reserved name and cannot be used for a folder.',\n });\n }\n\n let deferred = this.$q.defer();\n\n const promises = [];\n promises.push(this.backendSrv.search({ type: hitTypes.FOLDER, folderIds: [folderId], query: name }));\n promises.push(this.backendSrv.search({ type: hitTypes.DASHBOARD, folderIds: [folderId], query: name }));\n\n this.$q.all(promises).then(res => {\n let hits = [];\n\n if (res.length > 0 && res[0].length > 0) {\n hits = res[0];\n }\n\n if (res.length > 1 && res[1].length > 0) {\n hits = hits.concat(res[1]);\n }\n\n for (let hit of hits) {\n if (nameLowerCased === hit.title.toLowerCase()) {\n deferred.reject({\n type: 'EXISTING',\n message: existingErrorMessage,\n });\n break;\n }\n }\n\n deferred.resolve();\n });\n\n return deferred.promise;\n }\n}\n\ncoreModule.service('validationSrv', ValidationSrv);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/validation_srv.ts","import angular from 'angular';\nimport { ChangeTracker } from './change_tracker';\n\n/** @ngInject */\nexport function unsavedChangesSrv($rootScope, $q, $location, $timeout, contextSrv, dashboardSrv, $window) {\n this.init = function(dashboard, scope) {\n this.tracker = new ChangeTracker(dashboard, scope, 1000, $location, $window, $timeout, contextSrv, $rootScope);\n return this.tracker;\n };\n}\n\nangular.module('grafana.services').service('unsavedChangesSrv', unsavedChangesSrv);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/unsaved_changes_srv.ts","import angular from 'angular';\nimport _ from 'lodash';\nimport { DashboardModel } from './dashboard_model';\n\nexport class ChangeTracker {\n current: any;\n originalPath: any;\n scope: any;\n original: any;\n next: any;\n $window: any;\n\n /** @ngInject */\n constructor(\n dashboard,\n scope,\n originalCopyDelay,\n private $location,\n $window,\n private $timeout,\n private contextSrv,\n private $rootScope\n ) {\n this.$location = $location;\n this.$window = $window;\n\n this.current = dashboard;\n this.originalPath = $location.path();\n this.scope = scope;\n\n // register events\n scope.onAppEvent('dashboard-saved', () => {\n this.original = this.current.getSaveModelClone();\n this.originalPath = $location.path();\n });\n\n $window.onbeforeunload = () => {\n if (this.ignoreChanges()) {\n return undefined;\n }\n if (this.hasChanges()) {\n return 'There are unsaved changes to this dashboard';\n }\n return undefined;\n };\n\n scope.$on('$locationChangeStart', (event, next) => {\n // check if we should look for changes\n if (this.originalPath === $location.path()) {\n return true;\n }\n if (this.ignoreChanges()) {\n return true;\n }\n\n if (this.hasChanges()) {\n event.preventDefault();\n this.next = next;\n\n this.$timeout(() => {\n this.open_modal();\n });\n }\n return false;\n });\n\n if (originalCopyDelay) {\n this.$timeout(() => {\n // wait for different services to patch the dashboard (missing properties)\n this.original = dashboard.getSaveModelClone();\n }, originalCopyDelay);\n } else {\n this.original = dashboard.getSaveModelClone();\n }\n }\n\n // for some dashboards and users\n // changes should be ignored\n ignoreChanges() {\n if (!this.original) {\n return true;\n }\n if (!this.contextSrv.isEditor) {\n return true;\n }\n if (!this.current || !this.current.meta) {\n return true;\n }\n\n var meta = this.current.meta;\n return !meta.canSave || meta.fromScript || meta.fromFile;\n }\n\n // remove stuff that should not count in diff\n cleanDashboardFromIgnoredChanges(dashData) {\n // need to new up the domain model class to get access to expand / collapse row logic\n let model = new DashboardModel(dashData);\n\n // Expand all rows before making comparison. This is required because row expand / collapse\n // change order of panel array and panel positions.\n model.expandRows();\n\n let dash = model.getSaveModelClone();\n\n // ignore time and refresh\n dash.time = 0;\n dash.refresh = 0;\n dash.schemaVersion = 0;\n\n // ignore iteration property\n delete dash.iteration;\n\n dash.panels = _.filter(dash.panels, panel => {\n if (panel.repeatPanelId) {\n return false;\n }\n\n // remove scopedVars\n panel.scopedVars = null;\n\n // ignore panel legend sort\n if (panel.legend) {\n delete panel.legend.sort;\n delete panel.legend.sortDesc;\n }\n\n return true;\n });\n\n // ignore template variable values\n _.each(dash.templating.list, function(value) {\n value.current = null;\n value.options = null;\n value.filters = null;\n });\n\n return dash;\n }\n\n hasChanges() {\n let current = this.cleanDashboardFromIgnoredChanges(this.current.getSaveModelClone());\n let original = this.cleanDashboardFromIgnoredChanges(this.original);\n\n var currentTimepicker = _.find(current.nav, { type: 'timepicker' });\n var originalTimepicker = _.find(original.nav, { type: 'timepicker' });\n\n if (currentTimepicker && originalTimepicker) {\n currentTimepicker.now = originalTimepicker.now;\n }\n\n var currentJson = angular.toJson(current, true);\n var originalJson = angular.toJson(original, true);\n\n return currentJson !== originalJson;\n }\n\n discardChanges() {\n this.original = null;\n this.gotoNext();\n }\n\n open_modal() {\n this.$rootScope.appEvent('show-modal', {\n templateHtml: '',\n modalClass: 'modal--narrow confirm-modal',\n });\n }\n\n saveChanges() {\n var self = this;\n var cancel = this.$rootScope.$on('dashboard-saved', () => {\n cancel();\n this.$timeout(() => {\n self.gotoNext();\n });\n });\n\n this.$rootScope.appEvent('save-dashboard');\n }\n\n gotoNext() {\n var baseLen = this.$location.absUrl().length - this.$location.url().length;\n var nextUrl = this.next.substring(baseLen);\n this.$location.url(nextUrl);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/change_tracker.ts","import coreModule from 'app/core/core_module';\n\nconst template = `\n
      \n
      \n

      \n \n Unsaved changes\n

      \n\n \n \n \n
      \n\n
      \n\n
      \n Do you want to save your changes?\n
      \n\n
      \n \n \n \n
      \n
      \n
      \n`;\n\nexport class UnsavedChangesModalCtrl {\n clone: any;\n dismiss: () => void;\n\n /** @ngInject */\n constructor(private unsavedChangesSrv) {}\n\n discard() {\n this.dismiss();\n this.unsavedChangesSrv.tracker.discardChanges();\n }\n\n save() {\n this.dismiss();\n this.unsavedChangesSrv.tracker.saveChanges();\n }\n}\n\nexport function unsavedChangesModalDirective() {\n return {\n restrict: 'E',\n template: template,\n controller: UnsavedChangesModalCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: { dismiss: '&' },\n };\n}\n\ncoreModule.directive('unsavedChangesModal', unsavedChangesModalDirective);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/unsaved_changes_modal.ts","import _ from 'lodash';\nimport angular from 'angular';\nimport moment from 'moment';\n\nimport * as rangeUtil from 'app/core/utils/rangeutil';\n\nexport class TimePickerCtrl {\n static tooltipFormat = 'MMM D, YYYY HH:mm:ss';\n static defaults = {\n time_options: ['5m', '15m', '1h', '6h', '12h', '24h', '2d', '7d', '30d'],\n refresh_intervals: ['5s', '10s', '30s', '1m', '5m', '15m', '30m', '1h', '2h', '1d'],\n };\n\n dashboard: any;\n panel: any;\n absolute: any;\n timeRaw: any;\n editTimeRaw: any;\n tooltip: string;\n rangeString: string;\n timeOptions: any;\n refresh: any;\n isUtc: boolean;\n firstDayOfWeek: number;\n isOpen: boolean;\n\n /** @ngInject */\n constructor(private $scope, private $rootScope, private timeSrv) {\n this.$scope.ctrl = this;\n\n $rootScope.onAppEvent('shift-time-forward', () => this.move(1), $scope);\n $rootScope.onAppEvent('shift-time-backward', () => this.move(-1), $scope);\n $rootScope.onAppEvent('refresh', this.onRefresh.bind(this), $scope);\n $rootScope.onAppEvent('closeTimepicker', this.openDropdown.bind(this), $scope);\n\n // init options\n this.panel = this.dashboard.timepicker;\n _.defaults(this.panel, TimePickerCtrl.defaults);\n this.firstDayOfWeek = moment.localeData().firstDayOfWeek();\n\n // init time stuff\n this.onRefresh();\n }\n\n onRefresh() {\n var time = angular.copy(this.timeSrv.timeRange());\n var timeRaw = angular.copy(time.raw);\n\n if (!this.dashboard.isTimezoneUtc()) {\n time.from.local();\n time.to.local();\n if (moment.isMoment(timeRaw.from)) {\n timeRaw.from.local();\n }\n if (moment.isMoment(timeRaw.to)) {\n timeRaw.to.local();\n }\n this.isUtc = false;\n } else {\n this.isUtc = true;\n }\n\n var tZero = secs => (secs < 0 ? 'T' + secs : secs === 0 ? 'T=0' : 'T+' + secs);\n\n this.rangeString = tZero(time.from.unix()) + ' to ' + tZero(time.to.unix());\n\n this.absolute = { fromJs: time.from.toDate(), toJs: time.to.toDate() };\n this.tooltip = this.dashboard.formatDate(time.from) + '
      to
      ';\n this.tooltip += this.dashboard.formatDate(time.to);\n this.timeRaw = timeRaw;\n }\n\n zoom(factor) {\n this.$rootScope.appEvent('zoom-out', 2);\n }\n\n move(direction) {\n var range = this.timeSrv.timeRange();\n\n var timespan = (range.to.valueOf() - range.from.valueOf()) / 2;\n var to, from;\n if (direction === -1) {\n to = range.to.valueOf() - timespan;\n from = range.from.valueOf() - timespan;\n } else if (direction === 1) {\n to = range.to.valueOf() + timespan;\n from = range.from.valueOf() + timespan;\n if (to > Date.now() && range.to < Date.now()) {\n to = Date.now();\n from = range.from.valueOf();\n }\n } else {\n to = range.to.valueOf();\n from = range.from.valueOf();\n }\n\n this.timeSrv.setTime({ from: moment.utc(from), to: moment.utc(to) });\n }\n\n openDropdown() {\n if (this.isOpen) {\n this.closeDropdown();\n return;\n }\n\n this.onRefresh();\n this.editTimeRaw = this.timeRaw;\n this.timeOptions = rangeUtil.getRelativeTimesList(this.panel, this.rangeString);\n this.refresh = {\n value: this.dashboard.refresh,\n options: _.map(this.panel.refresh_intervals, (interval: any) => {\n return { text: interval, value: interval };\n }),\n };\n\n this.refresh.options.unshift({ text: 'off' });\n this.isOpen = true;\n this.$rootScope.appEvent('timepickerOpen');\n }\n\n closeDropdown() {\n this.isOpen = false;\n this.$rootScope.appEvent('timepickerClosed');\n }\n\n applyCustom() {\n if (this.refresh.value !== this.dashboard.refresh) {\n this.timeSrv.setAutoRefresh(this.refresh.value);\n }\n\n this.timeSrv.setTime(this.editTimeRaw);\n this.closeDropdown();\n }\n\n absoluteFromChanged() {\n this.editTimeRaw.from = this.getAbsoluteMomentForTimezone(this.absolute.fromJs);\n }\n\n absoluteToChanged() {\n this.editTimeRaw.to = this.getAbsoluteMomentForTimezone(this.absolute.toJs);\n }\n\n getAbsoluteMomentForTimezone(jsDate) {\n return this.dashboard.isTimezoneUtc() ? moment(jsDate).utc() : moment(jsDate);\n }\n\n setRelativeFilter(timespan) {\n var range = { from: timespan.from, to: timespan.to };\n\n if (this.panel.nowDelay && range.to === 'now') {\n range.to = 'now-' + this.panel.nowDelay;\n }\n\n this.timeSrv.setTime(range);\n this.closeDropdown();\n }\n}\n\nexport function settingsDirective() {\n return {\n restrict: 'E',\n templateUrl: 'public/app/features/dashboard/timepicker/settings.html',\n controller: TimePickerCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: {\n dashboard: '=',\n },\n };\n}\n\nexport function timePickerDirective() {\n return {\n restrict: 'E',\n templateUrl: 'public/app/features/dashboard/timepicker/timepicker.html',\n controller: TimePickerCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: {\n dashboard: '=',\n },\n };\n}\n\nangular.module('grafana.directives').directive('gfTimePickerSettings', settingsDirective);\nangular.module('grafana.directives').directive('gfTimePicker', timePickerDirective);\n\nimport { inputDateDirective } from './input_date';\nangular.module('grafana.directives').directive('inputDatetime', inputDateDirective);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/timepicker/timepicker.ts","import coreModule from 'app/core/core_module';\n\nvar template = `\n\n\n`;\n\n/** @ngInject */\nfunction uploadDashboardDirective(timer, alertSrv, $location) {\n return {\n restrict: 'E',\n template: template,\n scope: {\n onUpload: '&',\n },\n link: function(scope) {\n function file_selected(evt) {\n var files = evt.target.files; // FileList object\n var readerOnload = function() {\n return function(e) {\n var dash;\n try {\n dash = JSON.parse(e.target.result);\n } catch (err) {\n console.log(err);\n scope.appEvent('alert-error', ['Import failed', 'JSON -> JS Serialization failed: ' + err.message]);\n return;\n }\n\n scope.$apply(function() {\n scope.onUpload({ dash: dash });\n });\n };\n };\n\n for (var i = 0, f; (f = files[i]); i++) {\n var reader = new FileReader();\n reader.onload = readerOnload();\n reader.readAsText(f);\n }\n }\n\n var wnd: any = window;\n // Check for the various File API support.\n if (wnd.File && wnd.FileReader && wnd.FileList && wnd.Blob) {\n // Something\n document.getElementById('dashupload').addEventListener('change', file_selected, false);\n } else {\n alertSrv.set('Oops', 'Sorry, the HTML5 File APIs are not fully supported in this browser.', 'error');\n }\n },\n };\n}\n\ncoreModule.directive('dashUpload', uploadDashboardDirective);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/upload.ts","import moment from 'moment';\nimport * as dateMath from 'app/core/utils/datemath';\n\nexport function inputDateDirective() {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function($scope, $elem, attrs, ngModel) {\n var format = 'YYYY-MM-DD HH:mm:ss';\n\n var fromUser = function(text) {\n if (text.indexOf('now') !== -1) {\n if (!dateMath.isValid(text)) {\n ngModel.$setValidity('error', false);\n return undefined;\n }\n ngModel.$setValidity('error', true);\n return text;\n }\n\n var parsed;\n if ($scope.ctrl.isUtc) {\n parsed = moment.utc(text, format);\n } else {\n parsed = moment(text, format);\n }\n\n if (!parsed.isValid()) {\n ngModel.$setValidity('error', false);\n return undefined;\n }\n\n ngModel.$setValidity('error', true);\n return parsed;\n };\n\n var toUser = function(currentValue) {\n if (moment.isMoment(currentValue)) {\n return currentValue.format(format);\n } else {\n return currentValue;\n }\n };\n\n ngModel.$parsers.push(fromUser);\n ngModel.$formatters.push(toUser);\n },\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/timepicker/input_date.ts","import angular from 'angular';\nimport { saveAs } from 'file-saver';\n\nimport coreModule from 'app/core/core_module';\nimport { DashboardExporter } from './exporter';\n\nexport class DashExportCtrl {\n dash: any;\n exporter: DashboardExporter;\n dismiss: () => void;\n\n /** @ngInject */\n constructor(private dashboardSrv, datasourceSrv, private $scope, private $rootScope) {\n this.exporter = new DashboardExporter(datasourceSrv);\n\n this.exporter.makeExportable(this.dashboardSrv.getCurrent()).then(dash => {\n this.$scope.$apply(() => {\n this.dash = dash;\n });\n });\n }\n\n save() {\n var blob = new Blob([angular.toJson(this.dash, true)], {\n type: 'application/json;charset=utf-8',\n });\n saveAs(blob, this.dash.title + '-' + new Date().getTime() + '.json');\n }\n\n saveJson() {\n var clone = this.dash;\n let editScope = this.$rootScope.$new();\n editScope.object = clone;\n editScope.enableCopy = true;\n\n this.$rootScope.appEvent('show-modal', {\n src: 'public/app/partials/edit_json.html',\n scope: editScope,\n });\n\n this.dismiss();\n }\n}\n\nexport function dashExportDirective() {\n return {\n restrict: 'E',\n templateUrl: 'public/app/features/dashboard/export/export_modal.html',\n controller: DashExportCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: { dismiss: '&' },\n };\n}\n\ncoreModule.directive('dashExportModal', dashExportDirective);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/export/export_modal.ts","import config from 'app/core/config';\nimport _ from 'lodash';\nimport { DashboardModel } from '../dashboard_model';\n\nexport class DashboardExporter {\n constructor(private datasourceSrv) {}\n\n makeExportable(dashboard: DashboardModel) {\n // clean up repeated rows and panels,\n // this is done on the live real dashboard instance, not on a clone\n // so we need to undo this\n // this is pretty hacky and needs to be changed\n dashboard.cleanUpRepeats();\n\n var saveModel = dashboard.getSaveModelClone();\n saveModel.id = null;\n\n // undo repeat cleanup\n dashboard.processRepeats();\n\n var inputs = [];\n var requires = {};\n var datasources = {};\n var promises = [];\n var variableLookup: any = {};\n\n for (let variable of saveModel.templating.list) {\n variableLookup[variable.name] = variable;\n }\n\n var templateizeDatasourceUsage = obj => {\n // ignore data source properties that contain a variable\n if (obj.datasource && obj.datasource.indexOf('$') === 0) {\n if (variableLookup[obj.datasource.substring(1)]) {\n return;\n }\n }\n\n promises.push(\n this.datasourceSrv.get(obj.datasource).then(ds => {\n if (ds.meta.builtIn) {\n return;\n }\n\n var refName = 'DS_' + ds.name.replace(' ', '_').toUpperCase();\n datasources[refName] = {\n name: refName,\n label: ds.name,\n description: '',\n type: 'datasource',\n pluginId: ds.meta.id,\n pluginName: ds.meta.name,\n };\n obj.datasource = '${' + refName + '}';\n\n requires['datasource' + ds.meta.id] = {\n type: 'datasource',\n id: ds.meta.id,\n name: ds.meta.name,\n version: ds.meta.info.version || '1.0.0',\n };\n })\n );\n };\n\n const processPanel = panel => {\n if (panel.datasource !== undefined) {\n templateizeDatasourceUsage(panel);\n }\n\n if (panel.targets) {\n for (let target of panel.targets) {\n if (target.datasource !== undefined) {\n templateizeDatasourceUsage(target);\n }\n }\n }\n\n var panelDef = config.panels[panel.type];\n if (panelDef) {\n requires['panel' + panelDef.id] = {\n type: 'panel',\n id: panelDef.id,\n name: panelDef.name,\n version: panelDef.info.version,\n };\n }\n };\n\n // check up panel data sources\n for (let panel of saveModel.panels) {\n processPanel(panel);\n\n // handle collapsed rows\n if (panel.collapsed !== undefined && panel.collapsed === true && panel.panels) {\n for (let rowPanel of panel.panels) {\n processPanel(rowPanel);\n }\n }\n }\n\n // templatize template vars\n for (let variable of saveModel.templating.list) {\n if (variable.type === 'query') {\n templateizeDatasourceUsage(variable);\n variable.options = [];\n variable.current = {};\n variable.refresh = variable.refresh > 0 ? variable.refresh : 1;\n }\n }\n\n // templatize annotations vars\n for (let annotationDef of saveModel.annotations.list) {\n templateizeDatasourceUsage(annotationDef);\n }\n\n // add grafana version\n requires['grafana'] = {\n type: 'grafana',\n id: 'grafana',\n name: 'Grafana',\n version: config.buildInfo.version,\n };\n\n return Promise.all(promises)\n .then(() => {\n _.each(datasources, (value, key) => {\n inputs.push(value);\n });\n\n // templatize constants\n for (let variable of saveModel.templating.list) {\n if (variable.type === 'constant') {\n var refName = 'VAR_' + variable.name.replace(' ', '_').toUpperCase();\n inputs.push({\n name: refName,\n type: 'constant',\n label: variable.label || variable.name,\n value: variable.current.value,\n description: '',\n });\n // update current and option\n variable.query = '${' + refName + '}';\n variable.options[0] = variable.current = {\n value: variable.query,\n text: variable.query,\n };\n }\n }\n\n // make inputs and requires a top thing\n var newObj = {};\n newObj['__inputs'] = inputs;\n newObj['__requires'] = _.sortBy(requires, ['id']);\n\n _.defaults(newObj, saveModel);\n return newObj;\n })\n .catch(err => {\n console.log('Export failed:', err);\n return {\n error: err,\n };\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/export/exporter.ts","import angular from 'angular';\nimport * as fileExport from 'app/core/utils/file_export';\nimport appEvents from 'app/core/app_events';\n\nexport class ExportDataModalCtrl {\n private data: any[];\n private panel: string;\n asRows: Boolean = true;\n dateTimeFormat = 'x';\n excel: false;\n\n export() {\n if (this.panel === 'table') {\n fileExport.exportTableDataToCsv(this.data, this.excel);\n } else {\n if (this.asRows) {\n fileExport.exportSeriesListToCsv(this.data, this.dateTimeFormat, this.excel);\n } else {\n fileExport.exportSeriesListToCsvColumns(this.data, this.dateTimeFormat, this.excel);\n }\n }\n\n this.dismiss();\n }\n\n dismiss() {\n appEvents.emit('hide-modal');\n }\n}\n\nexport function exportDataModal() {\n return {\n restrict: 'E',\n templateUrl: 'public/app/features/dashboard/export_data/export_data_modal.html',\n controller: ExportDataModalCtrl,\n controllerAs: 'ctrl',\n scope: {\n panel: '<',\n data: '<', // The difference to '=' is that the bound properties are not watched\n },\n bindToController: true,\n };\n}\n\nangular.module('grafana.directives').directive('exportDataModal', exportDataModal);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/export_data/export_data_modal.ts","import coreModule from 'app/core/core_module';\n\nexport class DashExportExperimentCtrl {\n experimentId: String;\n isEmailLoading: Boolean = false;\n link: String;\n\n /** @ngInject */\n constructor($scope, private $http, $routeParams) {\n $scope.sampleInterval = 'orig';\n this.experimentId = $routeParams.experimentId;\n this.link = this.makeUrl($scope.sampleInterval);\n }\n\n intervalChanged(interval) {\n this.link = this.makeUrl(interval);\n }\n\n makeUrl(interval) {\n var url = `/api/experiments/${this.experimentId}/export`;\n if (interval !== 'orig') {\n url += '?sample_interval=' + interval;\n }\n return url;\n }\n\n save(interval) {\n window.location.href = this.makeUrl(interval);\n }\n\n email(interval) {\n function getCookie(name) {\n let cookie = {};\n document.cookie.split(';').forEach(function(el) {\n let [k, v] = el.split('=');\n cookie[k.trim()] = v;\n });\n return cookie[name];\n }\n\n var prefilled = getCookie('email_export_addresses');\n\n var target = prompt('Please enter email addresses separated by comma: ', prefilled);\n\n if (!target) {\n return;\n }\n\n document.cookie = 'email_export_addresses=' + target + '; expires=Thu, 1 Jan 2050 12:00:00 UTC';\n\n var url = '/experiments/emailreport/?id=' + this.experimentId + '&interval=' + interval + '&target=' + target;\n\n this.isEmailLoading = true;\n this.$http.get(url).then(response => {\n if (response.data === 'ok') {\n alert('Email succesfully sent!');\n } else {\n alert('Error sending email!');\n }\n this.isEmailLoading = false;\n });\n }\n\n copyLink(interval) {}\n}\n\nexport function dashExportExperimentDirective() {\n return {\n restrict: 'E',\n templateUrl: 'public/app/features/dashboard/export_experiment/export_experiment_modal.html',\n controller: DashExportExperimentCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: {\n dismiss: '&',\n sampleInterval: '=',\n },\n };\n}\n\ncoreModule.directive('dashExportExperimentModal', dashExportExperimentDirective);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/export_experiment/export_experiment_modal.ts","import _ from 'lodash';\nimport angular from 'angular';\nimport coreModule from 'app/core/core_module';\n\nexport class AdHocFiltersCtrl {\n segments: any;\n variable: any;\n removeTagFilterSegment: any;\n\n /** @ngInject */\n constructor(\n private uiSegmentSrv,\n private datasourceSrv,\n private $q,\n private variableSrv,\n $scope,\n private $rootScope\n ) {\n this.removeTagFilterSegment = uiSegmentSrv.newSegment({\n fake: true,\n value: '-- remove filter --',\n });\n this.buildSegmentModel();\n this.$rootScope.onAppEvent('template-variable-value-updated', this.buildSegmentModel.bind(this), $scope);\n }\n\n buildSegmentModel() {\n this.segments = [];\n\n if (this.variable.value && !_.isArray(this.variable.value)) {\n }\n\n for (let tag of this.variable.filters) {\n if (this.segments.length > 0) {\n this.segments.push(this.uiSegmentSrv.newCondition('AND'));\n }\n\n if (tag.key !== undefined && tag.value !== undefined) {\n this.segments.push(this.uiSegmentSrv.newKey(tag.key));\n this.segments.push(this.uiSegmentSrv.newOperator(tag.operator));\n this.segments.push(this.uiSegmentSrv.newKeyValue(tag.value));\n }\n }\n\n this.segments.push(this.uiSegmentSrv.newPlusButton());\n }\n\n getOptions(segment, index) {\n if (segment.type === 'operator') {\n return this.$q.when(this.uiSegmentSrv.newOperators(['=', '!=', '<', '>', '=~', '!~']));\n }\n\n if (segment.type === 'condition') {\n return this.$q.when([this.uiSegmentSrv.newSegment('AND')]);\n }\n\n return this.datasourceSrv.get(this.variable.datasource).then(ds => {\n var options: any = {};\n var promise = null;\n\n if (segment.type !== 'value') {\n promise = ds.getTagKeys();\n } else {\n options.key = this.segments[index - 2].value;\n promise = ds.getTagValues(options);\n }\n\n return promise.then(results => {\n results = _.map(results, segment => {\n return this.uiSegmentSrv.newSegment({ value: segment.text });\n });\n\n // add remove option for keys\n if (segment.type === 'key') {\n results.splice(0, 0, angular.copy(this.removeTagFilterSegment));\n }\n return results;\n });\n });\n }\n\n segmentChanged(segment, index) {\n this.segments[index] = segment;\n\n // handle remove tag condition\n if (segment.value === this.removeTagFilterSegment.value) {\n this.segments.splice(index, 3);\n if (this.segments.length === 0) {\n this.segments.push(this.uiSegmentSrv.newPlusButton());\n } else if (this.segments.length > 2) {\n this.segments.splice(Math.max(index - 1, 0), 1);\n if (this.segments[this.segments.length - 1].type !== 'plus-button') {\n this.segments.push(this.uiSegmentSrv.newPlusButton());\n }\n }\n } else {\n if (segment.type === 'plus-button') {\n if (index > 2) {\n this.segments.splice(index, 0, this.uiSegmentSrv.newCondition('AND'));\n }\n this.segments.push(this.uiSegmentSrv.newOperator('='));\n this.segments.push(this.uiSegmentSrv.newFake('select tag value', 'value', 'query-segment-value'));\n segment.type = 'key';\n segment.cssClass = 'query-segment-key';\n }\n\n if (index + 1 === this.segments.length) {\n this.segments.push(this.uiSegmentSrv.newPlusButton());\n }\n }\n\n this.updateVariableModel();\n }\n\n updateVariableModel() {\n var filters = [];\n var filterIndex = -1;\n var hasFakes = false;\n\n this.segments.forEach(segment => {\n if (segment.type === 'value' && segment.fake) {\n hasFakes = true;\n return;\n }\n\n switch (segment.type) {\n case 'key': {\n filters.push({ key: segment.value });\n filterIndex += 1;\n break;\n }\n case 'value': {\n filters[filterIndex].value = segment.value;\n break;\n }\n case 'operator': {\n filters[filterIndex].operator = segment.value;\n break;\n }\n case 'condition': {\n filters[filterIndex].condition = segment.value;\n break;\n }\n }\n });\n\n if (hasFakes) {\n return;\n }\n\n this.variable.setFilters(filters);\n this.variableSrv.variableUpdated(this.variable, true);\n }\n}\n\nvar template = `\n
      \n
      \n \n
      \n
      \n`;\n\nexport function adHocFiltersComponent() {\n return {\n restrict: 'E',\n template: template,\n controller: AdHocFiltersCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: {\n variable: '=',\n },\n };\n}\n\ncoreModule.directive('adHocFilters', adHocFiltersComponent);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/ad_hoc_filters.ts","import React from 'react';\nimport ReactGridLayout from 'react-grid-layout';\nimport { GRID_CELL_HEIGHT, GRID_CELL_VMARGIN, GRID_COLUMN_COUNT } from 'app/core/constants';\nimport { DashboardPanel } from './DashboardPanel';\nimport { DashboardModel } from '../dashboard_model';\nimport { PanelContainer } from './PanelContainer';\nimport { PanelModel } from '../panel_model';\nimport classNames from 'classnames';\nimport sizeMe from 'react-sizeme';\n\nlet lastGridWidth = 1200;\n\nfunction GridWrapper({\n size,\n layout,\n onLayoutChange,\n children,\n onDragStop,\n onResize,\n onResizeStop,\n onWidthChange,\n className,\n isResizable,\n isDraggable,\n}) {\n if (size.width === 0) {\n console.log('size is zero!');\n }\n\n const width = size.width > 0 ? size.width : lastGridWidth;\n if (width !== lastGridWidth) {\n onWidthChange();\n lastGridWidth = width;\n }\n\n return (\n \n {children}\n \n );\n}\n\nconst SizedReactLayoutGrid = sizeMe({ monitorWidth: true })(GridWrapper);\n\nexport interface DashboardGridProps {\n getPanelContainer: () => PanelContainer;\n}\n\nexport class DashboardGrid extends React.Component {\n gridToPanelMap: any;\n panelContainer: PanelContainer;\n dashboard: DashboardModel;\n panelMap: { [id: string]: PanelModel };\n\n constructor(props) {\n super(props);\n this.panelContainer = this.props.getPanelContainer();\n this.onLayoutChange = this.onLayoutChange.bind(this);\n this.onResize = this.onResize.bind(this);\n this.onResizeStop = this.onResizeStop.bind(this);\n this.onDragStop = this.onDragStop.bind(this);\n this.onWidthChange = this.onWidthChange.bind(this);\n\n this.state = { animated: false };\n\n // subscribe to dashboard events\n this.dashboard = this.panelContainer.getDashboard();\n this.dashboard.on('panel-added', this.triggerForceUpdate.bind(this));\n this.dashboard.on('panel-removed', this.triggerForceUpdate.bind(this));\n this.dashboard.on('repeats-processed', this.triggerForceUpdate.bind(this));\n this.dashboard.on('view-mode-changed', this.triggerForceUpdate.bind(this));\n this.dashboard.on('row-collapsed', this.triggerForceUpdate.bind(this));\n this.dashboard.on('row-expanded', this.triggerForceUpdate.bind(this));\n }\n\n buildLayout() {\n const layout = [];\n this.panelMap = {};\n\n for (let panel of this.dashboard.panels) {\n let stringId = panel.id.toString();\n this.panelMap[stringId] = panel;\n\n if (!panel.gridPos) {\n console.log('panel without gridpos');\n continue;\n }\n\n let panelPos: any = {\n i: stringId,\n x: panel.gridPos.x,\n y: panel.gridPos.y,\n w: panel.gridPos.w,\n h: panel.gridPos.h,\n };\n\n if (panel.type === 'row') {\n panelPos.w = GRID_COLUMN_COUNT;\n panelPos.h = 1;\n panelPos.isResizable = false;\n panelPos.isDraggable = panel.collapsed;\n }\n\n layout.push(panelPos);\n }\n\n return layout;\n }\n\n onLayoutChange(newLayout) {\n for (const newPos of newLayout) {\n this.panelMap[newPos.i].updateGridPos(newPos);\n }\n\n this.dashboard.sortPanelsByGridPos();\n }\n\n triggerForceUpdate() {\n this.forceUpdate();\n }\n\n onWidthChange() {\n for (const panel of this.dashboard.panels) {\n panel.resizeDone();\n }\n }\n\n updateGridPos(item, layout) {\n this.panelMap[item.i].updateGridPos(item);\n\n // react-grid-layout has a bug (#670), and onLayoutChange() is only called when the component is mounted.\n // So it's required to call it explicitly when panel resized or moved to save layout changes.\n this.onLayoutChange(layout);\n }\n\n onResize(layout, oldItem, newItem) {\n this.panelMap[newItem.i].updateGridPos(newItem);\n }\n\n onResizeStop(layout, oldItem, newItem) {\n this.updateGridPos(newItem, layout);\n this.panelMap[newItem.i].resizeDone();\n }\n\n onDragStop(layout, oldItem, newItem) {\n this.updateGridPos(newItem, layout);\n }\n\n componentDidMount() {\n setTimeout(() => {\n this.setState(() => {\n return { animated: true };\n });\n });\n }\n\n renderPanels() {\n const panelElements = [];\n\n for (let panel of this.dashboard.panels) {\n const panelClasses = classNames({ panel: true, 'panel--fullscreen': panel.fullscreen });\n panelElements.push(\n
      \n \n
      \n );\n }\n\n return panelElements;\n }\n\n render() {\n return (\n \n {this.renderPanels()}\n \n );\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/dashboard/dashgrid/DashboardGrid.tsx","import { coreModule } from 'app/core/core';\n\nvar template = `\n
      \n \n
      \n \n\n`;\n\nexport class QueryTroubleshooterCtrl {\n isOpen: any;\n isLoading: boolean;\n showResponse: boolean;\n panelCtrl: any;\n renderJsonExplorer: (data) => void;\n onRequestErrorEventListener: any;\n onRequestResponseEventListener: any;\n hasError: boolean;\n allNodesExpanded: boolean;\n isMocking: boolean;\n mockedResponse: string;\n jsonExplorer: JsonExplorer;\n\n /** @ngInject **/\n constructor($scope, private $timeout) {\n this.onRequestErrorEventListener = this.onRequestError.bind(this);\n this.onRequestResponseEventListener = this.onRequestResponse.bind(this);\n\n appEvents.on('ds-request-response', this.onRequestResponseEventListener);\n appEvents.on('ds-request-error', this.onRequestErrorEventListener);\n\n $scope.$on('$destroy', this.removeEventsListeners.bind(this));\n $scope.$watch('ctrl.isOpen', this.stateChanged.bind(this));\n }\n\n removeEventsListeners() {\n appEvents.off('ds-request-response', this.onRequestResponseEventListener);\n appEvents.off('ds-request-error', this.onRequestErrorEventListener);\n }\n\n toggleMocking() {\n this.isMocking = !this.isMocking;\n }\n\n onRequestError(err) {\n // ignore if closed\n if (!this.isOpen) {\n return;\n }\n\n this.isOpen = true;\n this.hasError = true;\n this.onRequestResponse(err);\n }\n\n stateChanged() {\n if (this.isOpen) {\n this.panelCtrl.refresh();\n this.isLoading = true;\n }\n }\n\n getClipboardText(): string {\n if (this.jsonExplorer) {\n return JSON.stringify(this.jsonExplorer.json, null, 2);\n }\n return '';\n }\n\n handleMocking(data) {\n var mockedData;\n try {\n mockedData = JSON.parse(this.mockedResponse);\n } catch (err) {\n appEvents.emit('alert-error', ['Failed to parse mocked response']);\n return;\n }\n\n data.data = mockedData;\n }\n\n onRequestResponse(data) {\n // ignore if closed\n if (!this.isOpen) {\n return;\n }\n\n if (this.isMocking) {\n this.handleMocking(data);\n return;\n }\n\n this.isLoading = false;\n data = _.cloneDeep(data);\n\n if (data.headers) {\n delete data.headers;\n }\n\n if (data.config) {\n data.request = data.config;\n delete data.config;\n delete data.request.transformRequest;\n delete data.request.transformResponse;\n delete data.request.paramSerializer;\n delete data.request.jsonpCallbackParam;\n delete data.request.headers;\n delete data.request.requestId;\n delete data.request.inspect;\n delete data.request.retry;\n delete data.request.timeout;\n }\n\n if (data.data) {\n data.response = data.data;\n\n if (data.status === 200) {\n // if we are in error state, assume we automatically opened\n // and auto close it again\n if (this.hasError) {\n this.hasError = false;\n this.isOpen = false;\n }\n }\n\n delete data.data;\n delete data.status;\n delete data.statusText;\n delete data.$$config;\n }\n\n this.$timeout(_.partial(this.renderJsonExplorer, data));\n }\n\n toggleExpand(depth) {\n if (this.jsonExplorer) {\n this.allNodesExpanded = !this.allNodesExpanded;\n this.jsonExplorer.openAtDepth(this.allNodesExpanded ? 20 : 1);\n }\n }\n}\n\nexport function queryTroubleshooter() {\n return {\n restrict: 'E',\n template: template,\n controller: QueryTroubleshooterCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n scope: {\n panelCtrl: '=',\n isOpen: '=',\n },\n link: function(scope, elem, attrs, ctrl) {\n ctrl.renderJsonExplorer = function(data) {\n var jsonElem = elem.find('.query-troubleshooter-json');\n\n ctrl.jsonExplorer = new JsonExplorer(data, 3, {\n animateOpen: true,\n });\n\n const html = ctrl.jsonExplorer.render(true);\n jsonElem.html(html);\n };\n },\n };\n}\n\ncoreModule.directive('queryTroubleshooter', queryTroubleshooter);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/panel/query_troubleshooter.ts","import angular from 'angular';\nimport config from 'app/core/config';\n\nexport class SelectOrgCtrl {\n /** @ngInject **/\n constructor($scope, backendSrv, contextSrv) {\n contextSrv.sidemenu = false;\n\n $scope.navModel = {\n main: {\n icon: 'gicon gicon-branding',\n subTitle: 'Preferences',\n text: 'Select active organization',\n },\n };\n\n $scope.init = function() {\n $scope.getUserOrgs();\n };\n\n $scope.getUserOrgs = function() {\n backendSrv.get('/api/user/orgs').then(function(orgs) {\n $scope.orgs = orgs;\n });\n };\n\n $scope.setUsingOrg = function(org) {\n backendSrv.post('/api/user/using/' + org.orgId).then(function() {\n window.location.href = config.appSubUrl + '/';\n });\n };\n\n $scope.init();\n }\n}\n\nangular.module('grafana.controllers').controller('SelectOrgCtrl', SelectOrgCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/org/select_org_ctrl.ts","import './org_users_ctrl';\nimport './profile_ctrl';\nimport './org_users_ctrl';\nimport './select_org_ctrl';\nimport './change_password_ctrl';\nimport './new_org_ctrl';\nimport './user_invite_ctrl';\nimport './teams_ctrl';\nimport './team_details_ctrl';\nimport './create_team_ctrl';\nimport './org_api_keys_ctrl';\nimport './org_details_ctrl';\nimport './prefs_control';\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/org/all.ts","import config from 'app/core/config';\nimport { coreModule } from 'app/core/core';\n\nexport class ProfileCtrl {\n user: any;\n old_theme: any;\n orgs: any = [];\n userForm: any;\n showOrgsList = false;\n readonlyLoginFields = config.disableLoginForm;\n navModel: any;\n\n /** @ngInject **/\n constructor(private backendSrv, private contextSrv, private $location, navModelSrv) {\n this.getUser();\n this.getUserOrgs();\n this.navModel = navModelSrv.getNav('profile', 'profile-settings', 0);\n }\n\n getUser() {\n this.backendSrv.get('/api/user').then(user => {\n this.user = user;\n this.user.theme = user.theme || 'dark';\n });\n }\n\n getUserOrgs() {\n this.backendSrv.get('/api/user/orgs').then(orgs => {\n this.orgs = orgs;\n this.showOrgsList = orgs.length > 1;\n });\n }\n\n setUsingOrg(org) {\n this.backendSrv.post('/api/user/using/' + org.orgId).then(() => {\n window.location.href = config.appSubUrl + '/profile';\n });\n }\n\n update() {\n if (!this.userForm.$valid) {\n return;\n }\n\n this.backendSrv.put('/api/user/', this.user).then(() => {\n this.contextSrv.user.name = this.user.name || this.user.login;\n if (this.old_theme !== this.user.theme) {\n window.location.href = config.appSubUrl + this.$location.path();\n }\n });\n }\n}\n\ncoreModule.controller('ProfileCtrl', ProfileCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/org/profile_ctrl.ts","import angular from 'angular';\nimport config from 'app/core/config';\n\nexport class ChangePasswordCtrl {\n /** @ngInject **/\n constructor($scope, backendSrv, $location, navModelSrv) {\n $scope.command = {};\n $scope.authProxyEnabled = config.authProxyEnabled;\n $scope.ldapEnabled = config.ldapEnabled;\n $scope.navModel = navModelSrv.getNav('profile', 'change-password', 0);\n\n $scope.changePassword = function() {\n if (!$scope.userForm.$valid) {\n return;\n }\n\n if ($scope.command.newPassword !== $scope.command.confirmNew) {\n $scope.appEvent('alert-warning', ['New passwords do not match', '']);\n return;\n }\n\n backendSrv.put('/api/user/password', $scope.command).then(\n function() {\n $location.path('profile');\n },\n err => {\n if (err.status === 401) {\n err.isHandled = true;\n $scope.appEvent('alert-warning', [err.data.message, '']);\n }\n }\n );\n };\n }\n}\n\nangular.module('grafana.controllers').controller('ChangePasswordCtrl', ChangePasswordCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/org/change_password_ctrl.ts","import angular from 'angular';\nimport config from 'app/core/config';\n\nexport class NewOrgCtrl {\n /** @ngInject **/\n constructor($scope, $http, backendSrv, navModelSrv) {\n $scope.navModel = navModelSrv.getNav('cfg', 'admin', 'global-orgs', 1);\n $scope.newOrg = { name: '' };\n\n $scope.createOrg = function() {\n backendSrv.post('/api/orgs/', $scope.newOrg).then(function(result) {\n backendSrv.post('/api/user/using/' + result.orgId).then(function() {\n window.location.href = config.appSubUrl + '/org';\n });\n });\n };\n }\n}\n\nangular.module('grafana.controllers').controller('NewOrgCtrl', NewOrgCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/org/new_org_ctrl.ts","import coreModule from 'app/core/core_module';\n\nexport class UserInviteCtrl {\n navModel: any;\n invite: any;\n inviteForm: any;\n\n /** @ngInject **/\n constructor(private backendSrv, navModelSrv, private $location) {\n this.navModel = navModelSrv.getNav('cfg', 'users', 0);\n\n this.invite = {\n name: '',\n email: '',\n role: 'Editor',\n sendEmail: true,\n };\n }\n\n sendInvite() {\n if (!this.inviteForm.$valid) {\n return;\n }\n\n return this.backendSrv.post('/api/org/invites', this.invite).then(() => {\n this.$location.path('org/users/');\n });\n }\n}\n\ncoreModule.controller('UserInviteCtrl', UserInviteCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/org/user_invite_ctrl.ts","import coreModule from 'app/core/core_module';\nimport appEvents from 'app/core/app_events';\n\nexport class TeamsCtrl {\n teams: any;\n pages = [];\n perPage = 50;\n page = 1;\n totalPages: number;\n showPaging = false;\n query: any = '';\n navModel: any;\n\n /** @ngInject */\n constructor(private backendSrv, navModelSrv) {\n this.navModel = navModelSrv.getNav('cfg', 'teams', 0);\n this.get();\n }\n\n get() {\n this.backendSrv\n .get(`/api/teams/search?perpage=${this.perPage}&page=${this.page}&query=${this.query}`)\n .then(result => {\n this.teams = result.teams;\n this.page = result.page;\n this.perPage = result.perPage;\n this.totalPages = Math.ceil(result.totalCount / result.perPage);\n this.showPaging = this.totalPages > 1;\n this.pages = [];\n\n for (var i = 1; i < this.totalPages + 1; i++) {\n this.pages.push({ page: i, current: i === this.page });\n }\n });\n }\n\n navigateToPage(page) {\n this.page = page.page;\n this.get();\n }\n\n deleteTeam(team) {\n appEvents.emit('confirm-modal', {\n title: 'Delete',\n text: 'Are you sure you want to delete Team ' + team.name + '?',\n yesText: 'Delete',\n icon: 'fa-warning',\n onConfirm: () => {\n this.deleteTeamConfirmed(team);\n },\n });\n }\n\n deleteTeamConfirmed(team) {\n this.backendSrv.delete('/api/teams/' + team.id).then(this.get.bind(this));\n }\n\n openTeamModal() {\n appEvents.emit('show-modal', {\n templateHtml: '',\n modalClass: 'modal--narrow',\n });\n }\n}\n\ncoreModule.controller('TeamsCtrl', TeamsCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/org/teams_ctrl.ts","import coreModule from 'app/core/core_module';\n\nexport default class TeamDetailsCtrl {\n team: Team;\n teamMembers: User[] = [];\n navModel: any;\n\n /** @ngInject **/\n constructor(private $scope, private backendSrv, private $routeParams, navModelSrv) {\n this.navModel = navModelSrv.getNav('cfg', 'teams', 0);\n this.userPicked = this.userPicked.bind(this);\n this.get = this.get.bind(this);\n this.get();\n }\n\n get() {\n if (this.$routeParams && this.$routeParams.id) {\n this.backendSrv.get(`/api/teams/${this.$routeParams.id}`).then(result => {\n this.team = result;\n });\n this.backendSrv.get(`/api/teams/${this.$routeParams.id}/members`).then(result => {\n this.teamMembers = result;\n });\n }\n }\n\n removeTeamMember(teamMember: TeamMember) {\n this.$scope.appEvent('confirm-modal', {\n title: 'Remove Member',\n text: 'Are you sure you want to remove ' + teamMember.login + ' from this group?',\n yesText: 'Remove',\n icon: 'fa-warning',\n onConfirm: () => {\n this.removeMemberConfirmed(teamMember);\n },\n });\n }\n\n removeMemberConfirmed(teamMember: TeamMember) {\n this.backendSrv.delete(`/api/teams/${this.$routeParams.id}/members/${teamMember.userId}`).then(this.get);\n }\n\n update() {\n if (!this.$scope.teamDetailsForm.$valid) {\n return;\n }\n\n this.backendSrv.put('/api/teams/' + this.team.id, {\n name: this.team.name,\n email: this.team.email,\n });\n }\n\n userPicked(user) {\n this.backendSrv.post(`/api/teams/${this.$routeParams.id}/members`, { userId: user.id }).then(() => {\n this.$scope.$broadcast('user-picker-reset');\n this.get();\n });\n }\n}\n\nexport interface Team {\n id: number;\n name: string;\n email: string;\n}\n\nexport interface User {\n id: number;\n name: string;\n login: string;\n email: string;\n}\n\nexport interface TeamMember {\n userId: number;\n name: string;\n login: string;\n}\n\ncoreModule.controller('TeamDetailsCtrl', TeamDetailsCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/org/team_details_ctrl.ts","import coreModule from 'app/core/core_module';\n\nexport default class CreateTeamCtrl {\n name: string;\n email: string;\n navModel: any;\n\n /** @ngInject **/\n constructor(private backendSrv, private $location, navModelSrv) {\n this.navModel = navModelSrv.getNav('cfg', 'teams', 0);\n }\n\n create() {\n const payload = {\n name: this.name,\n email: this.email,\n };\n this.backendSrv.post('/api/teams', payload).then(result => {\n if (result.teamId) {\n this.$location.path('/org/teams/edit/' + result.teamId);\n }\n });\n }\n}\n\ncoreModule.controller('CreateTeamCtrl', CreateTeamCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/org/create_team_ctrl.ts","import angular from 'angular';\n\nexport class OrgApiKeysCtrl {\n /** @ngInject **/\n constructor($scope, $http, backendSrv, navModelSrv) {\n $scope.navModel = navModelSrv.getNav('cfg', 'apikeys', 0);\n\n $scope.roleTypes = ['Viewer', 'Editor', 'Admin'];\n $scope.token = { role: 'Viewer' };\n\n $scope.init = function() {\n $scope.getTokens();\n };\n\n $scope.getTokens = function() {\n backendSrv.get('/api/auth/keys').then(function(tokens) {\n $scope.tokens = tokens;\n });\n };\n\n $scope.removeToken = function(id) {\n backendSrv.delete('/api/auth/keys/' + id).then($scope.getTokens);\n };\n\n $scope.addToken = function() {\n backendSrv.post('/api/auth/keys', $scope.token).then(function(result) {\n var modalScope = $scope.$new(true);\n modalScope.key = result.key;\n modalScope.rootPath = window.location.origin + $scope.$root.appSubUrl;\n\n $scope.appEvent('show-modal', {\n src: 'public/app/features/org/partials/apikeyModal.html',\n scope: modalScope,\n });\n\n $scope.getTokens();\n });\n };\n\n $scope.copy = function(key) {\n copyToClipboard(key);\n alert('The key has been copied to the clipboard.');\n };\n\n $scope.init();\n }\n}\n\nconst copyToClipboard = str => {\n const el = document.createElement('textarea');\n el.value = str;\n el.setAttribute('readonly', '');\n el.style.position = 'absolute';\n el.style.left = '-9999px';\n document.body.appendChild(el);\n el.select();\n document.execCommand('copy');\n document.body.removeChild(el);\n};\n\nangular.module('grafana.controllers').controller('OrgApiKeysCtrl', OrgApiKeysCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/org/org_api_keys_ctrl.ts","import angular from 'angular';\n\nexport class OrgDetailsCtrl {\n /** @ngInject **/\n constructor($scope, $http, backendSrv, contextSrv, navModelSrv) {\n $scope.init = function() {\n $scope.getOrgInfo();\n $scope.navModel = navModelSrv.getNav('cfg', 'org-settings', 0);\n };\n\n $scope.getOrgInfo = function() {\n backendSrv.get('/api/org').then(function(org) {\n $scope.org = org;\n $scope.address = org.address;\n contextSrv.user.orgName = org.name;\n });\n };\n\n $scope.update = function() {\n if (!$scope.orgForm.$valid) {\n return;\n }\n var data = { name: $scope.org.name };\n backendSrv.put('/api/org', data).then($scope.getOrgInfo);\n };\n\n $scope.updateAddress = function() {\n if (!$scope.addressForm.$valid) {\n return;\n }\n backendSrv.put('/api/org/address', $scope.address).then($scope.getOrgInfo);\n };\n\n $scope.init();\n }\n}\n\nangular.module('grafana.controllers').controller('OrgDetailsCtrl', OrgDetailsCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/org/org_details_ctrl.ts","import config from 'app/core/config';\nimport coreModule from 'app/core/core_module';\n\nexport class PrefsControlCtrl {\n prefs: any;\n oldTheme: any;\n prefsForm: any;\n mode: string;\n\n timezones: any = [\n { value: '', text: 'Default' },\n { value: 'browser', text: 'Local browser time' },\n { value: 'utc', text: 'UTC' },\n ];\n themes: any = [{ value: '', text: 'Default' }, { value: 'dark', text: 'Dark' }, { value: 'light', text: 'Light' }];\n\n /** @ngInject **/\n constructor(private backendSrv, private $location) {}\n\n $onInit() {\n return this.backendSrv.get(`/api/${this.mode}/preferences`).then(prefs => {\n this.prefs = prefs;\n this.oldTheme = prefs.theme;\n });\n }\n\n updatePrefs() {\n if (!this.prefsForm.$valid) {\n return;\n }\n\n var cmd = {\n theme: this.prefs.theme,\n timezone: this.prefs.timezone,\n homeDashboardId: this.prefs.homeDashboardId,\n };\n\n this.backendSrv.put(`/api/${this.mode}/preferences`, cmd).then(() => {\n window.location.href = config.appSubUrl + this.$location.path();\n });\n }\n}\n\nvar template = `\n
      \n

      Preferences

      \n\n
      \n \n
      \n \n
      \n
      \n\n
      \n \n
      \n\n`;\n\nexport function prefsControlDirective() {\n return {\n restrict: 'E',\n controller: PrefsControlCtrl,\n bindToController: true,\n controllerAs: 'ctrl',\n template: template,\n scope: {\n mode: '@',\n },\n };\n}\n\ncoreModule.directive('prefsControl', prefsControlDirective);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/org/prefs_control.ts","import AdminListUsersCtrl from './admin_list_users_ctrl';\nimport './admin_list_orgs_ctrl';\nimport './admin_edit_org_ctrl';\nimport './admin_edit_user_ctrl';\nimport './admin_list_experiments_ctrl';\n\nimport coreModule from 'app/core/core_module';\n\nclass AdminSettingsCtrl {\n navModel: any;\n\n /** @ngInject **/\n constructor($scope, backendSrv, navModelSrv) {\n this.navModel = navModelSrv.getNav('cfg', 'admin', 'server-settings', 1);\n\n backendSrv.get('/api/admin/settings').then(function(settings) {\n $scope.settings = settings;\n });\n }\n}\n\nclass AdminHomeCtrl {\n navModel: any;\n\n /** @ngInject **/\n constructor(navModelSrv) {\n this.navModel = navModelSrv.getNav('cfg', 'admin', 1);\n }\n}\n\nexport class AdminStatsCtrl {\n stats: any;\n navModel: any;\n\n /** @ngInject */\n constructor(backendSrv: any, navModelSrv) {\n this.navModel = navModelSrv.getNav('cfg', 'admin', 'server-stats', 1);\n\n backendSrv.get('/api/admin/stats').then(stats => {\n this.stats = stats;\n });\n }\n}\n\ncoreModule.controller('AdminSettingsCtrl', AdminSettingsCtrl);\ncoreModule.controller('AdminHomeCtrl', AdminHomeCtrl);\ncoreModule.controller('AdminStatsCtrl', AdminStatsCtrl);\ncoreModule.controller('AdminListUsersCtrl', AdminListUsersCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/admin/admin.ts","export default class AdminListUsersCtrl {\n users: any;\n pages = [];\n perPage = 50;\n page = 1;\n totalPages: number;\n showPaging = false;\n query: any;\n navModel: any;\n\n /** @ngInject */\n constructor(private $scope, private backendSrv, navModelSrv, private $window) {\n this.navModel = navModelSrv.getNav('cfg', 'admin', 'global-users', 1);\n this.query = '';\n this.getUsers();\n }\n\n getUsers() {\n this.backendSrv\n .get(`/api/users/search?perpage=${this.perPage}&page=${this.page}&query=${this.query}`)\n .then(result => {\n this.users = result.users;\n this.page = result.page;\n this.perPage = result.perPage;\n this.totalPages = Math.ceil(result.totalCount / result.perPage);\n this.showPaging = this.totalPages > 1;\n this.pages = [];\n\n for (var i = 1; i < this.totalPages + 1; i++) {\n this.pages.push({ page: i, current: i === this.page });\n }\n });\n }\n\n navigateToPage(page) {\n this.page = page.page;\n this.getUsers();\n }\n\n impersonate(user) {\n this.backendSrv.post('/admin/impersonate', { email: user.email }).then(result => {\n this.$window.location.reload();\n });\n }\n\n deleteUser(user) {\n this.$scope.appEvent('confirm-modal', {\n title: 'Delete',\n text: 'Do you want to delete ' + user.login + '?',\n icon: 'fa-trash',\n yesText: 'Delete',\n onConfirm: () => {\n this.backendSrv.delete('/api/admin/users/' + user.id).then(() => {\n this.getUsers();\n });\n },\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/admin/admin_list_users_ctrl.ts","import angular from 'angular';\n\nexport class AdminListOrgsCtrl {\n /** @ngInject */\n constructor($scope, backendSrv, navModelSrv) {\n $scope.init = function() {\n $scope.navModel = navModelSrv.getNav('cfg', 'admin', 'global-orgs', 1);\n $scope.getOrgs();\n };\n\n $scope.getOrgs = function() {\n backendSrv.get('/api/orgs').then(function(orgs) {\n $scope.orgs = orgs;\n });\n };\n\n $scope.deleteOrg = function(org) {\n $scope.appEvent('confirm-modal', {\n title: 'Delete',\n text: 'Do you want to delete organization ' + org.name + '?',\n text2: 'ALL DATA (including sensor data from InfluxDB) for this organization will be removed!',\n icon: 'fa-trash',\n yesText: 'Delete',\n onConfirm: function() {\n backendSrv.delete('/api/orgs/' + org.id).then(function() {\n $scope.getOrgs();\n });\n },\n });\n };\n\n $scope.init();\n }\n}\n\nangular.module('grafana.controllers').controller('AdminListOrgsCtrl', AdminListOrgsCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/admin/admin_list_orgs_ctrl.ts","import angular from 'angular';\n\nexport class AdminEditOrgCtrl {\n /** @ngInject */\n constructor($scope, $routeParams, backendSrv, $location, navModelSrv) {\n $scope.init = function() {\n $scope.navModel = navModelSrv.getNav('cfg', 'admin', 'global-orgs', 1);\n\n if ($routeParams.id) {\n $scope.getOrg($routeParams.id);\n $scope.getOrgUsers($routeParams.id);\n }\n };\n\n $scope.getOrg = function(id) {\n backendSrv.get('/api/orgs/' + id).then(function(org) {\n $scope.org = org;\n });\n };\n\n $scope.getOrgUsers = function(id) {\n backendSrv.get('/api/orgs/' + id + '/users').then(function(orgUsers) {\n $scope.orgUsers = orgUsers;\n });\n };\n\n $scope.update = function() {\n if (!$scope.orgDetailsForm.$valid) {\n return;\n }\n\n backendSrv.put('/api/orgs/' + $scope.org.id, $scope.org).then(function() {\n $location.path('/admin/orgs');\n });\n };\n\n $scope.updateOrgUser = function(orgUser) {\n backendSrv.patch('/api/orgs/' + orgUser.orgId + '/users/' + orgUser.userId, orgUser);\n };\n\n $scope.removeOrgUser = function(orgUser) {\n backendSrv.delete('/api/orgs/' + orgUser.orgId + '/users/' + orgUser.userId).then(function() {\n $scope.getOrgUsers($scope.org.id);\n });\n };\n\n $scope.init();\n }\n}\n\nangular.module('grafana.controllers').controller('AdminEditOrgCtrl', AdminEditOrgCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/admin/admin_edit_org_ctrl.ts","import angular from 'angular';\nimport _ from 'lodash';\n\nexport class AdminEditUserCtrl {\n /** @ngInject */\n constructor($scope, $routeParams, backendSrv, $location, navModelSrv) {\n $scope.user = {};\n $scope.newOrg = { name: '', role: 'Editor' };\n $scope.permissions = {};\n $scope.navModel = navModelSrv.getNav('cfg', 'admin', 'global-users', 1);\n\n $scope.init = function() {\n if ($routeParams.id) {\n $scope.getUser($routeParams.id);\n $scope.getUserOrgs($routeParams.id);\n }\n };\n\n $scope.getUser = function(id) {\n backendSrv.get('/api/users/' + id).then(function(user) {\n $scope.user = user;\n $scope.user_id = id;\n $scope.permissions.isGrafanaAdmin = user.isGrafanaAdmin;\n });\n };\n\n $scope.setPassword = function() {\n if (!$scope.passwordForm.$valid) {\n return;\n }\n\n var payload = { password: $scope.password };\n backendSrv.put('/api/admin/users/' + $scope.user_id + '/password', payload).then(function() {\n $location.path('/admin/users');\n });\n };\n\n $scope.updatePermissions = function() {\n var payload = $scope.permissions;\n\n backendSrv.put('/api/admin/users/' + $scope.user_id + '/permissions', payload).then(function() {\n $location.path('/admin/users');\n });\n };\n\n $scope.create = function() {\n if (!$scope.userForm.$valid) {\n return;\n }\n\n backendSrv.post('/api/admin/users', $scope.user).then(function() {\n $location.path('/admin/users');\n });\n };\n\n $scope.getUserOrgs = function(id) {\n backendSrv.get('/api/users/' + id + '/orgs').then(function(orgs) {\n $scope.orgs = orgs;\n });\n };\n\n $scope.update = function() {\n if (!$scope.userForm.$valid) {\n return;\n }\n\n backendSrv.put('/api/users/' + $scope.user_id, $scope.user).then(function() {\n $location.path('/admin/users');\n });\n };\n\n $scope.updateOrgUser = function(orgUser) {\n backendSrv.patch('/api/orgs/' + orgUser.orgId + '/users/' + $scope.user_id, orgUser).then(function() {});\n };\n\n $scope.removeOrgUser = function(orgUser) {\n backendSrv.delete('/api/orgs/' + orgUser.orgId + '/users/' + $scope.user_id).then(function() {\n $scope.getUser($scope.user_id);\n $scope.getUserOrgs($scope.user_id);\n });\n };\n\n $scope.orgsSearchCache = [];\n\n $scope.searchOrgs = function(queryStr, callback) {\n if ($scope.orgsSearchCache.length > 0) {\n callback(_.map($scope.orgsSearchCache, 'name'));\n return;\n }\n\n backendSrv.get('/api/orgs', { query: '' }).then(function(result) {\n $scope.orgsSearchCache = result;\n callback(_.map(result, 'name'));\n });\n };\n\n $scope.addOrgUser = function() {\n if (!$scope.addOrgForm.$valid) {\n return;\n }\n\n var orgInfo = _.find($scope.orgsSearchCache, {\n name: $scope.newOrg.name,\n });\n if (!orgInfo) {\n return;\n }\n\n $scope.newOrg.loginOrEmail = $scope.user.login;\n\n backendSrv.post('/api/orgs/' + orgInfo.id + '/users/', $scope.newOrg).then(function() {\n $scope.getUser($scope.user_id);\n $scope.getUserOrgs($scope.user_id);\n });\n };\n\n $scope.init();\n }\n}\n\nangular.module('grafana.controllers').controller('AdminEditUserCtrl', AdminEditUserCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/admin/admin_edit_user_ctrl.ts","import angular from 'angular';\n\nexport class AdminListExperimentsCtrl {\n /** @ngInject */\n constructor($scope, private backendSrv, navModelSrv, private $window) {\n $scope.init = function() {\n $scope.navModel = navModelSrv.getNav('cfg', 'admin', 'global-experiments', 1);\n $scope.getExperiments();\n };\n\n $scope.getExperiments = function() {\n backendSrv.get('/api/experiments?limit=300').then(function(response) {\n $scope.experiments = response.results;\n });\n };\n\n $scope.init();\n }\n\n impersonate(email) {\n this.backendSrv.post('/admin/impersonate', { email: email }).then(result => {\n this.$window.location.reload();\n });\n }\n}\n\nangular.module('grafana.controllers').controller('AdminListExperimentsCtrl', AdminListExperimentsCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/admin/admin_list_experiments_ctrl.ts","import './notifications_list_ctrl';\nimport './notification_edit_ctrl';\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/alerting/all.ts","import { coreModule } from 'app/core/core';\n\nexport class AlertNotificationsListCtrl {\n notifications: any;\n navModel: any;\n\n /** @ngInject */\n constructor(private backendSrv, navModelSrv) {\n this.loadNotifications();\n this.navModel = navModelSrv.getNav('alerting', 'channels', 0);\n }\n\n loadNotifications() {\n this.backendSrv.get(`/api/alert-notifications`).then(result => {\n this.notifications = result;\n });\n }\n\n deleteNotification(id) {\n this.backendSrv.delete(`/api/alert-notifications/${id}`).then(() => {\n this.notifications = this.notifications.filter(notification => {\n return notification.id !== id;\n });\n });\n }\n}\n\ncoreModule.controller('AlertNotificationsListCtrl', AlertNotificationsListCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/alerting/notifications_list_ctrl.ts","import _ from 'lodash';\nimport { appEvents, coreModule } from 'app/core/core';\n\nexport class AlertNotificationEditCtrl {\n theForm: any;\n navModel: any;\n testSeverity = 'critical';\n notifiers: any;\n notifierTemplateId: string;\n isNew: boolean;\n model: any;\n defaults: any = {\n type: 'email',\n settings: {\n httpMethod: 'POST',\n autoResolve: true,\n uploadImage: true,\n },\n isDefault: false,\n };\n\n /** @ngInject */\n constructor(private $routeParams, private backendSrv, private $location, private $templateCache, navModelSrv) {\n this.navModel = navModelSrv.getNav('alerting', 'channels', 0);\n this.isNew = !this.$routeParams.id;\n\n this.backendSrv\n .get(`/api/alert-notifiers`)\n .then(notifiers => {\n this.notifiers = notifiers;\n\n // add option templates\n for (let notifier of this.notifiers) {\n this.$templateCache.put(this.getNotifierTemplateId(notifier.type), notifier.optionsTemplate);\n }\n\n if (!this.$routeParams.id) {\n this.navModel.breadcrumbs.push({ text: 'New channel' });\n this.navModel.node = { text: 'New channel' };\n return _.defaults(this.model, this.defaults);\n }\n\n return this.backendSrv.get(`/api/alert-notifications/${this.$routeParams.id}`).then(result => {\n this.navModel.breadcrumbs.push({ text: result.name });\n this.navModel.node = { text: result.name };\n result.settings = _.defaults(result.settings, this.defaults.settings);\n return result;\n });\n })\n .then(model => {\n this.model = model;\n this.notifierTemplateId = this.getNotifierTemplateId(this.model.type);\n });\n }\n\n save() {\n if (!this.theForm.$valid) {\n return;\n }\n\n if (this.model.id) {\n this.backendSrv\n .put(`/api/alert-notifications/${this.model.id}`, this.model)\n .then(res => {\n this.model = res;\n appEvents.emit('alert-success', ['Notification updated', '']);\n })\n .catch(err => {\n if (err.data && err.data.error) {\n appEvents.emit('alert-error', [err.data.error]);\n }\n });\n } else {\n this.backendSrv\n .post(`/api/alert-notifications`, this.model)\n .then(res => {\n appEvents.emit('alert-success', ['Notification created', '']);\n this.$location.path('alerting/notifications');\n })\n .catch(err => {\n if (err.data && err.data.error) {\n appEvents.emit('alert-error', [err.data.error]);\n }\n });\n }\n }\n\n getNotifierTemplateId(type) {\n return `notifier-options-${type}`;\n }\n\n typeChanged() {\n this.model.settings = _.defaults({}, this.defaults.settings);\n this.notifierTemplateId = this.getNotifierTemplateId(this.model.type);\n }\n\n testNotification() {\n if (!this.theForm.$valid) {\n return;\n }\n\n var payload = {\n name: this.model.name,\n type: this.model.type,\n settings: this.model.settings,\n };\n\n this.backendSrv.post(`/api/alert-notifications/test`, payload).then(res => {\n appEvents.emit('alert-success', ['Test notification sent', '']);\n });\n }\n}\n\ncoreModule.controller('AlertNotificationEditCtrl', AlertNotificationEditCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/alerting/notification_edit_ctrl.ts","import coreModule from 'app/core/core_module';\nimport config from 'app/core/config';\n\nclass StyleGuideCtrl {\n theme: string;\n buttonNames = ['primary', 'secondary', 'inverse', 'success', 'warning', 'danger'];\n buttonSizes = ['btn-small', '', 'btn-large'];\n buttonVariants = ['-'];\n navModel: any;\n\n /** @ngInject **/\n constructor(private $routeParams, private backendSrv, navModelSrv) {\n this.navModel = navModelSrv.getNav('cfg', 'admin', 'styleguide', 1);\n this.theme = config.bootData.user.lightTheme ? 'light' : 'dark';\n }\n\n switchTheme() {\n this.$routeParams.theme = this.theme === 'dark' ? 'light' : 'dark';\n\n var cmd = {\n theme: this.$routeParams.theme,\n };\n\n this.backendSrv.put('/api/user/preferences', cmd).then(() => {\n window.location.href = window.location.href;\n });\n }\n}\n\ncoreModule.controller('StyleGuideCtrl', StyleGuideCtrl);\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/styleguide/styleguide.ts","import appEvents from 'app/core/app_events';\nimport store from 'app/core/store';\nimport coreModule from 'app/core/core_module';\n\nconst TIME_UNITS = [\n { text: 'Seconds', short: 's' },\n { text: 'Milliseconds', short: 'ms' },\n { text: 'Microseconds', short: 'us' },\n { text: 'Nanoseconds', short: 'ns' },\n];\n\nconst TIME_UNITS_COMPATIBLE_MODE = [\n { text: 'Timestamp (hh:mm:ss)', short: 'timestamp' },\n];\n\nconst TIME_UNITS_CLI = [\n { text: 'RFC3339 (2020-01-01T00:00:00Z)', short: 'RFC3339'},\n { text: 'RFC3339Nano (2020-01-01T00:00:00.000000000Z)', short: 'RFC3339Nano' },\n];\n\n/*\n * UPLOADER CONTROLLER\n *\n * Flow:\n * - Select file in UI\n * - fileSelected() or dropHandler() is called\n * - validateFile() checks for empty file and extracts file name\n * - startUpload() is called\n * - creates an upload object in backend\n * - starts uploading file over xhr\n * - checkStatus() is called. if status is:\n * - 'created' or 'started', check again later\n * - 'parse_error', show error, bail\n * - 'parsed' and type is 'csv'; read column names from response\n * for time column selection. Load previous config.\n * - Import config UI is shown to the user, user clicks \"import\"\n * - If file is CSV\n * - send importConfig via PUT on upload object\n * - save config to local browser\n * - call startImport()\n * - If file is TDMS, same, different importconfig though\n * - startImport() start the import on backend, start import monitoring task.\n * - monitorImportProgress(), check status is:\n * - 'error' show error and bail\n * - 'importing' show progress (exp. back-off)\n * - 'done' call importComplete()\n * - importComplete() creates dashboards, and redirects to it\n */\n\nexport class UploadCtrl {\n file: any;\n fileArray: any[];\n fileDrop: any;\n isUploading: boolean;\n isImporting: boolean;\n uploadProgressPercent = 0;\n uploadProgressText: string;\n importProgressPercent = 0;\n importProgressText: string;\n uploadStatus: string;\n uploadError: string;\n serverStatus: string;\n uploadType: string;\n experimentTitle: string;\n timeUnit = TIME_UNITS[0];\n timeUnits = TIME_UNITS;\n timeColumn: string;\n timeColumnOptions: {}[];\n createDashboard = true;\n uploadId: number;\n message: string;\n csvHeaderLine: string[];\n csvFirstTen: string[];\n sampleFrequency: string;\n timeOffset = '0';\n monitorImportProgressIntervalMs = 1000;\n statusCheckIntervalMs = 500;\n parseResult: any;\n compatibleMode = false;\n generateTimestamps = false;\n\n /** @ngInject */\n constructor(\n private backendSrv,\n private $scope,\n private $timeout,\n private alertSrv,\n private $location,\n private $window\n ) {}\n\n fileSelected() {\n this.validateFile(this.fileArray[0]);\n }\n\n dropHandler() {\n this.validateFile(this.fileDrop);\n }\n\n validateFile(file) {\n if (file.size <= 0) {\n this.alertSrv.set('File is empty.', null, 'warning', 10000);\n return;\n }\n this.file = file;\n let dotIndex = this.file.name.lastIndexOf('.');\n this.experimentTitle = this.file.name.substr(0, dotIndex);\n this.startUpload();\n }\n\n startUpload() {\n this.isUploading = true;\n\n this.uploadProgressPercent = 0;\n this.uploadProgressText = '';\n this.importProgressPercent = 0;\n this.importProgressText = '';\n\n let options = {\n method: 'POST',\n url: '/api/uploads',\n showSuccessAlert: false,\n data: {\n totalBytes: this.file.size,\n },\n };\n this.backendSrv.request(options).then(result => {\n this.uploadId = result.id;\n this.upload();\n this.checkStatus(result.id);\n });\n }\n\n checkStatus(id) {\n this.$timeout(() => {\n this.backendSrv.get(`/api/uploads/${id}`).then(result => {\n console.log('checkStatus:', result);\n let previousStatus = this.serverStatus;\n this.serverStatus = result.upload.status;\n this.uploadType = result.upload.type;\n\n if (this.serverStatus === 'created' || this.serverStatus === 'started') {\n if (previousStatus === this.serverStatus) {\n if (this.statusCheckIntervalMs < 8000) {\n this.statusCheckIntervalMs *= 2; // back off\n }\n } else {\n this.statusCheckIntervalMs = 1000;\n }\n this.checkStatus(id); // check again later\n return;\n } else if (this.serverStatus === 'parse_error') {\n console.log('PARSER ERROR', result);\n this.alertSrv.set('Error processing CSV', result.upload.errorMessage, 'warning', 10000);\n this.uploadError = result.upload.errorMessage;\n } else if (result.upload.type === 'csv' && this.serverStatus === 'parsed') {\n this.csvHeaderLine = result.header[0];\n this.csvFirstTen = result.header.slice(1);\n this.timeColumnOptions = [];\n for (let index in result.header[0]) {\n this.timeColumnOptions.push({ index: index, value: result.header[0][index] });\n }\n this.loadConfig(); // load previous form settings\n this.setupTimeUnits();\n } else if (result.upload.type === 'tdms' && this.serverStatus === 'parsed') {\n this.parseResult = result.upload.parseResult;\n\n let commonFrequency = null;\n for (let channel of this.parseResult) {\n if (commonFrequency === null) {\n commonFrequency = channel.frequencyHz;\n } else if (commonFrequency !== channel.frequencyHz) {\n commonFrequency = 0;\n break;\n }\n }\n this.sampleFrequency = commonFrequency;\n\n console.log('Parse result: ', this.parseResult);\n }\n });\n }, this.statusCheckIntervalMs);\n }\n\n upload() {\n var xhr = new XMLHttpRequest();\n\n if (xhr.upload) {\n xhr.upload.onload = e => {\n console.log('Upload complete');\n this.$scope.$apply(() => {\n this.uploadProgressText = `Upload complete.`;\n });\n };\n\n xhr.upload.onprogress = e => {\n let percent = Math.ceil(e.loaded / e.total * 100);\n this.$scope.$apply(() => {\n this.uploadProgressPercent = percent;\n this.uploadProgressText = `Uploading ${percent}%`;\n });\n };\n\n xhr.open('POST', '/api/uploads/' + this.uploadId + '/data', true);\n xhr.send(this.file);\n }\n\n xhr.onreadystatechange = () => {\n if (xhr.status === 412 && xhr.response) {\n let result = JSON.parse(xhr.response);\n this.alertSrv.set(result.message + '.', null, 'warning', 10000);\n this.uploadError = result.message + '.';\n }\n };\n }\n\n importClicked() {\n this.isImporting = true;\n\n if (this.uploadType === 'tdms') {\n this.configureTdms();\n } else {\n this.configureCsv();\n }\n }\n\n configureCsv() {\n let importConfig = {\n title: this.experimentTitle,\n compatibleMode: this.compatibleMode,\n time: {\n unit: this.timeUnit.short,\n column: parseInt(this.timeColumn),\n frequency: parseFloat(this.sampleFrequency),\n offset: this.timeOffset,\n },\n };\n\n if (importConfig.time.column === -1) {\n if (isNaN(importConfig.time.frequency)) {\n this.alertSrv.set('Invalid frequency: ' + this.sampleFrequency, null, 'warning', 10000);\n return;\n }\n }\n\n this.saveConfig();\n this.message = 'Please keep the window open until your upload has finished...';\n\n let options = {\n method: 'PUT',\n url: `/api/uploads/${this.uploadId}`,\n data: { importConfig: importConfig },\n showSuccessAlert: false,\n };\n\n this.backendSrv.request(options).then(result => {\n this.startImport();\n });\n }\n\n validateTdms() {\n let freq = this.sampleFrequency.toString().trim();\n if (freq.length === 0) {\n this.alertSrv.set('Please specify a sample rate.', 'warning', 10000);\n return false;\n }\n\n let match = freq.match(/(\\d+)/);\n if (!match) {\n this.alertSrv.set('Invalid sample rate: ' + this.sampleFrequency, null, 'warning', 10000);\n return false;\n }\n let frequencyHz = parseFloat(match[1]);\n console.log('final freq', frequencyHz);\n\n if (frequencyHz === 0) {\n this.alertSrv.set('Please specify a sample rate.', null, 'warning', 10000);\n return false;\n }\n\n for (let channel of this.parseResult) {\n channel.frequencyHz = frequencyHz;\n }\n\n return true;\n }\n\n configureTdms() {\n if (!this.validateTdms()) {\n this.isImporting = false;\n return;\n }\n\n let channelConfig = {};\n for (let channel of this.parseResult) {\n channelConfig[channel.path] = channel;\n }\n\n let options = {\n method: 'PUT',\n url: `/api/uploads/${this.uploadId}`,\n data: { importConfig: { experimentTitle: this.experimentTitle, channels: channelConfig } },\n showSuccessAlert: false,\n };\n\n this.backendSrv.request(options).then(result => {\n this.startImport();\n });\n }\n\n startImport() {\n this.backendSrv.post(`/api/uploads/${this.uploadId}/startimport`).then(\n result => {\n console.log('Import started');\n this.monitorImportProgress();\n },\n err => {\n console.log(err);\n this.message = 'An error occured during import.';\n }\n );\n }\n\n monitorImportProgress() {\n this.backendSrv.get(`/api/uploads/${this.uploadId}`).then(result => {\n if (result.upload && result.upload.status === 'error') {\n this.alertSrv.set('Error processing file', '', 'warning', 10000);\n this.importProgressText = 'Error during import.';\n this.message = 'Error during import: ' + result.upload.errorMessage;\n this.isImporting = false;\n return;\n }\n\n if (result.upload.status === 'done') {\n this.importComplete(result.upload);\n return;\n }\n\n if (result.upload.status === 'importing') {\n this.importProgressText = `Importing...`;\n let progress = result.upload.importProgress;\n console.log('Import progress', progress);\n\n if (progress) {\n // back off exponentially if no progress is detected\n this.monitorImportProgressIntervalMs =\n this.importProgressPercent === progress ? this.monitorImportProgressIntervalMs * 2 : 1000;\n this.importProgressPercent = progress;\n\n this.importProgressText = `Importing ${this.importProgressPercent.toFixed(0)}%`;\n\n if (progress >= 100) {\n this.importComplete(result.upload);\n return;\n }\n }\n }\n\n this.$timeout(this.monitorImportProgress.bind(this), this.monitorImportProgressIntervalMs);\n });\n }\n\n importComplete(upload) {\n this.importProgressText = `Import complete.`;\n this.importProgressPercent = 100;\n this.message = `Import complete.`;\n let experimentId = upload.experimentId;\n appEvents.emit('refresh-sidepane');\n\n this.alertSrv.set('Import complete!', null, 'success', 10000);\n\n if (this.createDashboard) {\n this.backendSrv.post(`/api/dashboards/for-experiment/${experimentId}`).then(result => {\n let url = `/e/${experimentId}${result.url}`;\n\n this.message = 'Dashboard created. Redirecting in 3...';\n this.$timeout(() => {\n this.message = 'Dashboard created. Redirecting in 2...';\n }, 1000);\n this.$timeout(() => {\n this.message = 'Dashboard created. Redirecting in 1...';\n }, 2000);\n this.$timeout(() => {\n this.$location.url(url);\n }, 3000);\n });\n }\n }\n\n saveConfig() {\n let importConfig = {\n timeUnitShort: this.timeUnit.short,\n timeColumn: this.getTimeColumn(),\n sampleFrequency: this.sampleFrequency,\n timeOffset: this.timeOffset,\n compatibleMode: this.compatibleMode,\n };\n store.set('csv_import_config', JSON.stringify(importConfig));\n }\n\n getTimeColumn() {\n if (this.timeColumn === '-1') {\n return { index: '-1' };\n }\n if (this.timeColumnOptions) {\n for (let element of this.timeColumnOptions) {\n if (element['index'] === this.timeColumn) {\n return element;\n }\n }\n }\n return null;\n }\n\n setTimeColumn(hash) {\n if (!hash) {\n return;\n }\n if (hash['index'] === '-1') {\n this.timeColumn = '-1';\n return;\n }\n if (this.timeColumnOptions) {\n for (let element of this.timeColumnOptions) {\n if (element['value'] === hash['value']) {\n this.timeColumn = element['index'];\n return;\n }\n }\n }\n }\n\n loadConfig() {\n if (!store.exists('csv_import_config')) {\n return;\n }\n let configStr = store.get('csv_import_config');\n if (!configStr) {\n return;\n }\n let config = JSON.parse(configStr);\n this.sampleFrequency = config.sampleFrequency;\n this.timeOffset = config.timeOffset;\n\n this.selectTimeUnit(config.timeUnitShort);\n this.setTimeColumn(config.timeColumn);\n this.compatibleMode = config.compatibleMode;\n }\n\n selectTimeUnit(short) {\n let candidates = TIME_UNITS.filter(unit => unit.short === short);\n if (candidates.length > 0) {\n this.timeUnit = candidates[0];\n } else {\n console.log('Time unit not found: ' + short);\n }\n }\n\n reload() {\n this.$window.location.reload();\n }\n\n setupTimeUnits() {\n if (this.compatibleMode) {\n this.timeUnits = TIME_UNITS.concat(TIME_UNITS_COMPATIBLE_MODE);\n } else {\n this.timeUnits = TIME_UNITS.concat(TIME_UNITS_CLI);\n }\n }\n\n compatibleModeClicked() {\n this.setupTimeUnits();\n }\n}\n\nlet fileDrop = () => {\n return {\n require: 'ngModel',\n link: function postLink(scope, elem, attrs, ngModel) {\n elem.on('dragover', function(e) {\n e.originalEvent.preventDefault();\n });\n elem.on('drop', function(e) {\n let ev = e.originalEvent;\n ev.preventDefault();\n if (ev.dataTransfer.items) {\n for (let item of ev.dataTransfer.items) {\n if (item.kind === 'file') {\n var file = item.getAsFile();\n ngModel.$setViewValue(file);\n return;\n }\n }\n } else {\n for (let file of ev.dataTransfer.files) {\n ngModel.$setViewValue(file);\n return;\n }\n }\n });\n },\n };\n};\n\nlet selectNgFiles = () => {\n return {\n require: 'ngModel',\n link: function postLink(scope, elem, attrs, ngModel) {\n elem.on('change', function(e) {\n var files = elem[0].files;\n ngModel.$setViewValue(files);\n });\n },\n };\n};\n\ncoreModule.controller('UploadCtrl', UploadCtrl);\ncoreModule.directive('selectNgFiles', selectNgFiles);\ncoreModule.directive('fileDrop', fileDrop);\n\ncoreModule.filter('stripquotes', function() {\n return function(input) {\n return input.replace(new RegExp(\"'\", 'g'), '');\n };\n});\n\n\n\n// WEBPACK FOOTER //\n// ./node_modules/tslint-loader??ref--2!./public/app/features/upload/upload.ts"],"sourceRoot":""}
      ' + statName;\n\n if (panel.legend.sort === statName) {\n var cssClass = panel.legend.sortDesc ? 'fa fa-caret-down' : 'fa fa-caret-up';\n html += ' ';\n }\n\n return html + '
      Converts an array to an ObservableConvert an infinite iterable (from a generator) to an ObservableConvert the Promise returned by Fetch to an ObservableEnsure values in subscribe are called just before browser repaint.Map every click to the clientX position of that clickMap every click to the clientX position of that clickMap two click events to a finite interval Observable, then apply combineAllDynamically calculate the Body-Mass Index from an Observable of weight and one for height