');\n }\n GraphTooltip.prototype.clear = function (plot) {\n this._visible = false;\n this.$tooltip.detach();\n plot.clearCrosshair();\n plot.unhighlight();\n };\n ;\n GraphTooltip.prototype.show = function (pos, item) {\n if (item === undefined) {\n item = this._lastItem;\n }\n else {\n this._lastItem = item;\n }\n this._visible = true;\n var plot = this.$elem.data().plot;\n var plotData = plot.getData();\n var xAxes = plot.getXAxes();\n var xMode = xAxes[0].options.mode;\n var seriesList = this.getSeriesFn();\n var allSeriesMode = this.panel.tooltip.shared;\n var group, value, absoluteTime, hoverInfo, i, series, seriesHtml, tooltipFormat;\n var rangeDist = Math.abs(xAxes[0].max - xAxes[0].min);\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 (pos.panelRelY) {\n var pointOffset = plot.pointOffset({ x: pos.x });\n if (Number.isNaN(pointOffset.left) || pointOffset.left < 0 || pointOffset.left > this.$elem.width()) {\n this.clear(plot);\n return;\n }\n pos.pageX = this.$elem.offset().left + pointOffset.left;\n pos.pageY = this.$elem.offset().top + this.$elem.height() * pos.panelRelY;\n var isVisible = pos.pageY >= $(window).scrollTop() &&\n pos.pageY <= $(window).innerHeight() + $(window).scrollTop();\n if (!isVisible) {\n this.clear(plot);\n return;\n }\n plot.setCrosshair(pos);\n allSeriesMode = true;\n if (this.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 = this._getMultiSeriesPlotHoverInfo(plotData, pos);\n seriesHtml = '';\n absoluteTime = this.dashboard.formatDate(seriesHoverInfo.time, tooltipFormat);\n // Dynamically reorder the hovercard for the current time point if the\n // option is enabled.\n if (this.panel.tooltip.sort === 2) {\n seriesHoverInfo.series.sort(function (a, b) { return b.value - a.value; });\n }\n else if (this.panel.tooltip.sort === 1) {\n seriesHoverInfo.series.sort(function (a, b) { return a.value - b.value; });\n }\n for (i = 0; i < seriesHoverInfo.series.length; i++) {\n hoverInfo = seriesHoverInfo.series[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 plot.highlight(hoverInfo.index, hoverInfo.hoverIndex);\n }\n seriesHtml += this._appendAnomaliesHTML(pos.x, rangeDist);\n this._renderAndShow(absoluteTime, seriesHtml, pos, xMode);\n }\n // single series tooltip\n else if (item) {\n series = seriesList[item.seriesIndex];\n group = '
';\n group += ' ' + series.aliasEscaped + ':
';\n if (this.panel.stack && this.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 = this.dashboard.formatDate(item.datapoint[0], tooltipFormat);\n group += '
' + value + '
';\n group += this._appendAnomaliesHTML(pos.x, rangeDist);\n this._renderAndShow(absoluteTime, group, pos, xMode);\n }\n // no hit\n else {\n this.$tooltip.detach();\n }\n };\n ;\n GraphTooltip.prototype.destroy = function () {\n this._visible = false;\n this.$tooltip.remove();\n };\n ;\n Object.defineProperty(GraphTooltip.prototype, \"visible\", {\n get: function () { return this._visible; },\n enumerable: true,\n configurable: true\n });\n GraphTooltip.prototype._findHoverIndexFromDataPoints = function (posX, series, last) {\n var ps = series.datapoints.pointsize;\n var initial = last * ps;\n var len = series.datapoints.points.length;\n for (var 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 ;\n GraphTooltip.prototype._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 ;\n GraphTooltip.prototype._appendAnomaliesHTML = function (pos, rangeDist) {\n var _this = this;\n var result = '';\n var segments = this._anomalySegmentsSearcher(pos, rangeDist);\n if (segments.length === 0) {\n return '';\n }\n segments.forEach(function (s) {\n var from = _this.dashboard.formatDate(s.segment.from, 'HH:mm:ss.SSS');\n var to = _this.dashboard.formatDate(s.segment.to, 'HH:mm:ss.SSS');\n result += \"\\n
\\n \";\n });\n return result;\n };\n GraphTooltip.prototype._renderAndShow = function (absoluteTime, innerHtml, pos, xMode) {\n if (xMode === 'time') {\n innerHtml = '
' + absoluteTime + '
' + innerHtml;\n }\n this.$tooltip.html(innerHtml).place_tt(pos.pageX + 20, pos.pageY);\n };\n ;\n GraphTooltip.prototype._getMultiSeriesPlotHoverInfo = function (seriesList, pos) {\n var value, 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 lastValue = 0; //needed for stacked values\n var minDistance, minTime;\n for (var i = 0; i < seriesList.length; i++) {\n series = seriesList[i];\n if (!series.data.length || (this.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 || (this.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 (this.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 lastValue += series.data[hoverIndex][1];\n value = lastValue;\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 return { series: results, time: minTime };\n };\n ;\n return GraphTooltip;\n}());\n\n\n\n//# sourceURL=webpack:///./graph_tooltip.ts?");
-
-/***/ }),
-
-/***/ "./histogram.ts":
-/*!**********************!*\
- !*** ./histogram.ts ***!
- \**********************/
-/*! exports provided: getSeriesValues, convertValuesToHistogram */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getSeriesValues\", function() { return getSeriesValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"convertValuesToHistogram\", function() { return convertValuesToHistogram; });\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);\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) {\n var histogram = {};\n for (var i = 0; i < values.length; i++) {\n var bound = getBucketBound(values[i], bucketSize);\n if (histogram[bound]) {\n histogram[bound] = histogram[bound] + 1;\n }\n else {\n histogram[bound] = 1;\n }\n }\n var histogam_series = lodash__WEBPACK_IMPORTED_MODULE_0___default.a.map(histogram, function (count, bound) {\n return [Number(bound), count];\n });\n // Sort by Y axis values\n return lodash__WEBPACK_IMPORTED_MODULE_0___default.a.sortBy(histogam_series, function (point) { return point[0]; });\n}\nfunction getBucketBound(value, bucketSize) {\n return Math.floor(value / bucketSize) * bucketSize;\n}\n\n\n//# sourceURL=webpack:///./histogram.ts?");
-
-/***/ }),
-
-/***/ "./models/analytic_unit.ts":
-/*!*********************************!*\
- !*** ./models/analytic_unit.ts ***!
- \*********************************/
-/*! exports provided: AnalyticSegment, AnalyticUnit, AnalyticUnitsSet */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnalyticSegment\", function() { return AnalyticSegment; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnalyticUnit\", function() { return AnalyticUnit; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnalyticUnitsSet\", function() { return AnalyticUnitsSet; });\n/* harmony import */ var _segment_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./segment_array */ \"./models/segment_array.ts\");\n/* harmony import */ var _segment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./segment */ \"./models/segment.ts\");\n/* harmony import */ var _colors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../colors */ \"./colors.ts\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);\nvar __extends = (undefined && undefined.__extends) || (function () {\n var 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 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\nvar AnalyticSegment = /** @class */ (function (_super) {\n __extends(AnalyticSegment, _super);\n function AnalyticSegment(labeled, id, from, to) {\n var _this = _super.call(this, id, from, to) || this;\n _this.labeled = labeled;\n if (!lodash__WEBPACK_IMPORTED_MODULE_3___default.a.isBoolean(labeled)) {\n throw new Error('labeled value is not boolean');\n }\n return _this;\n }\n return AnalyticSegment;\n}(_segment__WEBPACK_IMPORTED_MODULE_1__[\"Segment\"]));\n\nvar AnalyticUnit = /** @class */ (function () {\n function AnalyticUnit(_panelObject) {\n this._panelObject = _panelObject;\n this._selected = false;\n this._deleteMode = false;\n this._saving = false;\n this._segmentSet = new _segment_array__WEBPACK_IMPORTED_MODULE_0__[\"SegmentArray\"]();\n if (_panelObject === undefined) {\n this._panelObject = {};\n }\n lodash__WEBPACK_IMPORTED_MODULE_3___default.a.defaults(this._panelObject, {\n name: 'AnalyticUnitName', confidence: 0.2, color: _colors__WEBPACK_IMPORTED_MODULE_2__[\"ANALYTIC_UNIT_COLORS\"][0], type: 'general'\n });\n //this._metric = new Metric(_panelObject.metric);\n }\n Object.defineProperty(AnalyticUnit.prototype, \"id\", {\n get: function () { return this._panelObject.id; },\n set: function (value) { this._panelObject.id = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"name\", {\n get: function () { return this._panelObject.name; },\n set: function (value) { this._panelObject.name = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"type\", {\n get: function () { return this._panelObject.type; },\n set: function (value) { this._panelObject.type = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"confidence\", {\n get: function () { return this._panelObject.confidence; },\n set: function (value) { this._panelObject.confidence = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"color\", {\n get: function () { return this._panelObject.color; },\n set: function (value) { this._panelObject.color = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"selected\", {\n get: function () { return this._selected; },\n set: function (value) { this._selected = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"deleteMode\", {\n get: function () { return this._deleteMode; },\n set: function (value) { this._deleteMode = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"saving\", {\n get: function () { return this._saving; },\n set: function (value) { this._saving = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"visible\", {\n get: function () {\n return (this._panelObject.visible === undefined) ? true : this._panelObject.visible;\n },\n set: function (value) {\n this._panelObject.visible = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"metric\", {\n get: function () { return this._metric; },\n enumerable: true,\n configurable: true\n });\n AnalyticUnit.prototype.addLabeledSegment = function (segment) {\n var asegment = new AnalyticSegment(true, segment.id, segment.from, segment.to);\n this._segmentSet.addSegment(asegment);\n return asegment;\n };\n AnalyticUnit.prototype.removeSegmentsInRange = function (from, to) {\n return this._segmentSet.removeInRange(from, to);\n };\n Object.defineProperty(AnalyticUnit.prototype, \"segments\", {\n get: function () { return this._segmentSet; },\n set: function (value) {\n this._segmentSet.setSegments(value.getSegments());\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"status\", {\n get: function () { return this._status; },\n set: function (value) {\n if (value !== 'ready' &&\n value !== 'learning' &&\n value !== 'pending' &&\n value !== 'failed') {\n throw new Error('Unsupported status value: ' + value);\n }\n this._status = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"error\", {\n get: function () { return this._error; },\n set: function (value) { this._error = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"isActiveStatus\", {\n get: function () {\n return this.status !== 'ready' && this.status !== 'failed';\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"panelObject\", {\n get: function () { return this._panelObject; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AnalyticUnit.prototype, \"alertEnabled\", {\n get: function () { return this._alertEnabled; },\n set: function (value) { this._alertEnabled = value; },\n enumerable: true,\n configurable: true\n });\n return AnalyticUnit;\n}());\n\nvar AnalyticUnitsSet = /** @class */ (function () {\n function AnalyticUnitsSet(_panelObject) {\n this._panelObject = _panelObject;\n if (_panelObject === undefined) {\n throw new Error('panel object can`t be undefined');\n }\n this._mapIdIndex = new Map();\n this._items = _panelObject.map(function (p) { return new AnalyticUnit(p); });\n this._rebuildIndex();\n }\n Object.defineProperty(AnalyticUnitsSet.prototype, \"items\", {\n get: function () { return this._items; },\n enumerable: true,\n configurable: true\n });\n AnalyticUnitsSet.prototype.addItem = function (item) {\n this._panelObject.push(item.panelObject);\n this._mapIdIndex[item.id] = this._items.length;\n this._items.push(item);\n };\n AnalyticUnitsSet.prototype.removeItem = function (id) {\n var index = this._mapIdIndex[id];\n this._panelObject.splice(index, 1);\n this._items.splice(index, 1);\n this._rebuildIndex();\n };\n AnalyticUnitsSet.prototype._rebuildIndex = function () {\n var _this = this;\n this._items.forEach(function (a, i) {\n _this._mapIdIndex[a.id] = i;\n });\n };\n AnalyticUnitsSet.prototype.byId = function (id) {\n return this._items[this._mapIdIndex[id]];\n };\n AnalyticUnitsSet.prototype.byIndex = function (index) {\n return this._items[index];\n };\n return AnalyticUnitsSet;\n}());\n\n\n\n//# sourceURL=webpack:///./models/analytic_unit.ts?");
-
-/***/ }),
-
-/***/ "./models/metric.ts":
-/*!**************************!*\
- !*** ./models/metric.ts ***!
- \**************************/
-/*! exports provided: Target, Metric, MetricExpanded, MetricMap */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Target\", function() { return Target; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Metric\", function() { return Metric; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MetricExpanded\", function() { return MetricExpanded; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MetricMap\", function() { return MetricMap; });\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! md5 */ \"../node_modules/md5/md5.js\");\n/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_1__);\n\n\nvar Target = /** @class */ (function () {\n function Target(any) {\n this._data = lodash__WEBPACK_IMPORTED_MODULE_0___default.a.cloneDeep(any);\n this._strip();\n }\n Target.prototype._strip = function () {\n delete this._data.alias;\n };\n Target.prototype.getHash = function () {\n return md5__WEBPACK_IMPORTED_MODULE_1___default()(JSON.stringify(this._data));\n };\n Target.prototype.getJSON = function () {\n return this._data;\n };\n return Target;\n}());\n\nvar Metric = /** @class */ (function () {\n function Metric(_panelObj) {\n this._panelObj = _panelObj;\n if (_panelObj === undefined) {\n throw new Error('_panelObj is undefined');\n }\n }\n Object.defineProperty(Metric.prototype, \"datasource\", {\n get: function () { return this._panelObj.datasource; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Metric.prototype, \"targetHashs\", {\n get: function () { return this._panelObj.targetHashs; },\n enumerable: true,\n configurable: true\n });\n return Metric;\n}());\n\nvar MetricExpanded = /** @class */ (function () {\n function MetricExpanded(datasource, targets) {\n this.datasource = datasource;\n this._targets = targets.map(function (t) { return new Target(t); });\n }\n MetricExpanded.prototype.toJSON = function () {\n return {\n datasource: this.datasource,\n targets: this._targets.map(function (t) { return t.getJSON(); })\n };\n };\n return MetricExpanded;\n}());\n\nvar MetricMap = /** @class */ (function () {\n function MetricMap(datasource, targets) {\n var _this = this;\n this._cache = new Map();\n targets.forEach(function (t) {\n _this._cache.set(t.getHash(), t);\n });\n }\n return MetricMap;\n}());\n\n\n\n//# sourceURL=webpack:///./models/metric.ts?");
-
-/***/ }),
-
-/***/ "./models/segment.ts":
-/*!***************************!*\
- !*** ./models/segment.ts ***!
- \***************************/
-/*! exports provided: Segment */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Segment\", function() { return Segment; });\nvar Segment = /** @class */ (function () {\n function Segment(_id, from, to) {\n this._id = _id;\n this.from = from;\n this.to = to;\n if (isNaN(this._id)) {\n throw new Error('Key can`t be NaN');\n }\n if (isNaN(+from)) {\n throw new Error('from can`t be NaN');\n }\n if (isNaN(+to)) {\n throw new Error('to can`t be NaN');\n }\n }\n Object.defineProperty(Segment.prototype, \"id\", {\n get: function () { return this._id; },\n set: function (value) { this._id = value; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Segment.prototype, \"middle\", {\n get: function () { return (this.from + this.to) / 2; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Segment.prototype, \"length\", {\n get: function () {\n return Math.max(this.from, this.to) - Math.min(this.from, this.to);\n },\n enumerable: true,\n configurable: true\n });\n Segment.prototype.expandDist = function (allDist, portion) {\n var p = Math.round(this.middle - allDist * portion / 2);\n var q = Math.round(this.middle + allDist * portion / 2);\n p = Math.min(p, this.from);\n q = Math.max(q, this.to);\n return new Segment(this._id, p, q);\n };\n Segment.prototype.equals = function (segment) {\n return this._id === segment._id;\n };\n return Segment;\n}());\n\n\n\n//# sourceURL=webpack:///./models/segment.ts?");
-
-/***/ }),
-
-/***/ "./models/segment_array.ts":
-/*!*********************************!*\
- !*** ./models/segment_array.ts ***!
- \*********************************/
-/*! exports provided: SegmentArray */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SegmentArray\", function() { return SegmentArray; });\nvar SegmentArray = /** @class */ (function () {\n function SegmentArray(segments) {\n this.segments = segments;\n this._keyToSegment = new Map();\n this.setSegments(segments);\n }\n SegmentArray.prototype.getSegments = function (from, to) {\n if (from === undefined) {\n from = -Infinity;\n }\n if (to === undefined) {\n to = Infinity;\n }\n var result = [];\n for (var i = 0; i < this._segments.length; i++) {\n var s = this._segments[i];\n if (from <= s.from && s.to <= to) {\n result.push(s);\n }\n }\n return result;\n };\n SegmentArray.prototype.setSegments = function (segments) {\n var _this = this;\n this._segments = [];\n this._keyToSegment.clear();\n if (segments) {\n segments.forEach(function (s) {\n _this.addSegment(s);\n });\n }\n };\n SegmentArray.prototype.addSegment = function (segment) {\n if (this.has(segment.id)) {\n throw new Error(\"Segment with key \" + segment.id + \" exists in set\");\n }\n this._keyToSegment.set(segment.id, segment);\n this._segments.push(segment);\n };\n SegmentArray.prototype.findSegments = function (point, rangeDist) {\n return this._segments.filter(function (s) {\n var expanded = s.expandDist(rangeDist, 0.01);\n return (expanded.from <= point) && (point <= expanded.to);\n });\n };\n SegmentArray.prototype.removeInRange = function (from, to) {\n var deleted = [];\n var newSegments = [];\n for (var i = 0; i < this._segments.length; i++) {\n var s = this._segments[i];\n if (from <= s.from && s.to <= to) {\n this._keyToSegment.delete(s.id);\n deleted.push(s);\n }\n else {\n newSegments.push(s);\n }\n }\n this._segments = newSegments;\n return deleted;\n };\n Object.defineProperty(SegmentArray.prototype, \"length\", {\n get: function () {\n return this._segments.length;\n },\n enumerable: true,\n configurable: true\n });\n SegmentArray.prototype.clear = function () {\n this._segments = [];\n this._keyToSegment.clear();\n };\n SegmentArray.prototype.has = function (key) {\n return this._keyToSegment.has(key);\n };\n SegmentArray.prototype.remove = function (key) {\n if (!this.has(key)) {\n return false;\n }\n var index = this._segments.findIndex(function (s) { return s.id === key; });\n this._segments.splice(index, 1);\n this._keyToSegment.delete(key);\n return true;\n };\n SegmentArray.prototype.updateId = function (fromKey, toKey) {\n var segment = this._keyToSegment.get(fromKey);\n this._keyToSegment.delete(fromKey);\n segment.id = toKey;\n this._keyToSegment.set(toKey, segment);\n };\n return SegmentArray;\n}());\n\n\n\n//# sourceURL=webpack:///./models/segment_array.ts?");
-
-/***/ }),
-
-/***/ "./module.ts":
-/*!*******************!*\
- !*** ./module.ts ***!
- \*******************/
-/*! exports provided: GraphCtrl, PanelCtrl */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\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 _series_overrides_ctrl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./series_overrides_ctrl */ \"./series_overrides_ctrl.ts\");\n/* harmony import */ var _thresholds_form__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./thresholds_form */ \"./thresholds_form.ts\");\n/* harmony import */ var _template__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./template */ \"./template.ts\");\n/* harmony import */ var _graph_renderer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./graph_renderer */ \"./graph_renderer.ts\");\n/* harmony import */ var _graph_legend__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./graph_legend */ \"./graph_legend.ts\");\n/* harmony import */ var _data_processor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./data_processor */ \"./data_processor.ts\");\n/* harmony import */ var _models_metric__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./models/metric */ \"./models/metric.ts\");\n/* harmony import */ var _services_analytic_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./services/analytic_service */ \"./services/analytic_service.ts\");\n/* harmony import */ var _controllers_analytic_controller__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./controllers/analytic_controller */ \"./controllers/analytic_controller.ts\");\n/* harmony import */ var _axes_editor__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./axes_editor */ \"./axes_editor.ts\");\n/* harmony import */ var grafana_app_plugins_sdk__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! grafana/app/plugins/sdk */ \"grafana/app/plugins/sdk\");\n/* harmony import */ var grafana_app_plugins_sdk__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(grafana_app_plugins_sdk__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var grafana_app_core_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! grafana/app/core/core */ \"grafana/app/core/core\");\n/* harmony import */ var grafana_app_core_core__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(grafana_app_core_core__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var grafana_app_core_config__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! grafana/app/core/config */ \"grafana/app/core/config\");\n/* harmony import */ var grafana_app_core_config__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(grafana_app_core_config__WEBPACK_IMPORTED_MODULE_12__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_13__);\nvar __extends = (undefined && undefined.__extends) || (function () {\n var 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 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})();\nvar __awaiter = (undefined && undefined.__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 = (undefined && undefined.__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 = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [0, 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\nvar BACKEND_VARIABLE_NAME = 'HASTIC_SERVER_URL';\nvar GraphCtrl = /** @class */ (function (_super) {\n __extends(GraphCtrl, _super);\n /** @ngInject */\n function GraphCtrl($scope, $injector, annotationsSrv, keybindingSrv, backendSrv, popoverSrv, contextSrv, alertSrv) {\n var _this = _super.call(this, $scope, $injector) || this;\n _this.annotationsSrv = annotationsSrv;\n _this.keybindingSrv = keybindingSrv;\n _this.backendSrv = backendSrv;\n _this.popoverSrv = popoverSrv;\n _this.contextSrv = contextSrv;\n _this.alertSrv = alertSrv;\n _this.ANALYTIC_TYPES = [\n { name: 'General', value: 'general' },\n { name: 'Peaks', value: 'peak' },\n { name: 'Jumps', value: 'jump' },\n { name: 'Drops', value: 'drop' }\n ];\n _this.hiddenSeries = {};\n _this.seriesList = [];\n _this.dataList = [];\n _this._renderError = false;\n _this.colors = [];\n _this.anomalyTypes = []; // TODO: remove it later. Only for alert tab\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 // 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: 'null',\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 anomalyType: '',\n };\n lodash__WEBPACK_IMPORTED_MODULE_13___default.a.defaults(_this.panel, _this.panelDefaults);\n lodash__WEBPACK_IMPORTED_MODULE_13___default.a.defaults(_this.panel.tooltip, _this.panelDefaults.tooltip);\n lodash__WEBPACK_IMPORTED_MODULE_13___default.a.defaults(_this.panel.legend, _this.panelDefaults.legend);\n lodash__WEBPACK_IMPORTED_MODULE_13___default.a.defaults(_this.panel.xaxis, _this.panelDefaults.xaxis);\n _this.processor = new _data_processor__WEBPACK_IMPORTED_MODULE_5__[\"DataProcessor\"](_this.panel);\n var anomalyService = new _services_analytic_service__WEBPACK_IMPORTED_MODULE_7__[\"AnalyticService\"](_this.backendURL, backendSrv);\n _this.runBackendConnectivityCheck();\n _this.analyticsController = new _controllers_analytic_controller__WEBPACK_IMPORTED_MODULE_8__[\"AnalyticController\"](_this.panel, anomalyService, _this.events);\n _this.anomalyTypes = _this.panel.anomalyTypes;\n keybindingSrv.bind('d', _this.onDKey.bind(_this));\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 _this.events.on('anomaly-type-alert-change', function () {\n _this.$scope.$digest();\n });\n _this.events.on('anomaly-type-status-change', function (anomalyType) { return __awaiter(_this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (anomalyType === undefined) {\n throw new Error('anomalyType is undefined');\n }\n if (!(anomalyType.status === 'ready')) return [3 /*break*/, 2];\n return [4 /*yield*/, this.analyticsController.fetchSegments(anomalyType, +this.range.from, +this.range.to)];\n case 1:\n _a.sent();\n _a.label = 2;\n case 2:\n this.render(this.seriesList);\n this.$scope.$digest();\n return [2 /*return*/];\n }\n });\n }); });\n grafana_app_core_core__WEBPACK_IMPORTED_MODULE_11__[\"appEvents\"].on('ds-request-response', function (data) {\n var requestConfig = data.config;\n _this.datasourceRequest = {\n url: requestConfig.url,\n type: requestConfig.inspect.type,\n method: requestConfig.method,\n data: requestConfig.data,\n params: requestConfig.params\n };\n });\n _this.analyticsController.fetchAnomalyTypesStatuses();\n return _this;\n }\n Object.defineProperty(GraphCtrl.prototype, \"backendURL\", {\n get: function () {\n if (this.templateSrv.index[BACKEND_VARIABLE_NAME] === undefined) {\n return undefined;\n }\n return this.templateSrv.index[BACKEND_VARIABLE_NAME].current.value;\n },\n enumerable: true,\n configurable: true\n });\n GraphCtrl.prototype.runBackendConnectivityCheck = function () {\n return __awaiter(this, void 0, void 0, function () {\n var as, isOK;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (this.backendURL === '' || this.backendURL === undefined) {\n this.alertSrv.set(\"Dashboard variable $\" + BACKEND_VARIABLE_NAME + \" is missing\", \"Please set $\" + BACKEND_VARIABLE_NAME, 'warning', 4000);\n return [2 /*return*/];\n }\n as = new _services_analytic_service__WEBPACK_IMPORTED_MODULE_7__[\"AnalyticService\"](this.backendURL, this.backendSrv);\n return [4 /*yield*/, as.isBackendOk()];\n case 1:\n isOK = _a.sent();\n if (!isOK) {\n this.alertSrv.set('Can`t connect to Hastic server', \"Hastic server: \\\"\" + this.backendURL + \"\\\"\", 'warning', 4000);\n }\n return [2 /*return*/];\n }\n });\n });\n };\n GraphCtrl.prototype.link = function (scope, elem, attrs, ctrl) {\n var $graphElem = $(elem[0]).find('#graphPanel');\n var $legendElem = $(elem[0]).find('#graphLegend');\n this._graphRenderer = new _graph_renderer__WEBPACK_IMPORTED_MODULE_3__[\"GraphRenderer\"]($graphElem, this.timeSrv, this.popoverSrv, this.contextSrv, this.$scope);\n this._graphLegend = new _graph_legend__WEBPACK_IMPORTED_MODULE_4__[\"GraphLegend\"]($legendElem, this.popoverSrv, this.$scope);\n };\n GraphCtrl.prototype.onInitEditMode = function () {\n var partialPath = this.panelPath + 'partials';\n this.addEditorTab('Analytics', partialPath + \"/tab_analytics.html\", 2);\n this.addEditorTab('Axes', _axes_editor__WEBPACK_IMPORTED_MODULE_9__[\"axesEditorComponent\"], 3);\n this.addEditorTab('Legend', partialPath + \"/tab_legend.html\", 4);\n this.addEditorTab('Display', partialPath + \"/tab_display.html\", 5);\n if (grafana_app_core_config__WEBPACK_IMPORTED_MODULE_12___default.a.alertingEnabled) {\n this.addEditorTab('Alert', grafana_app_plugins_sdk__WEBPACK_IMPORTED_MODULE_10__[\"alertTab\"], 6);\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 };\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 return __awaiter(this, void 0, void 0, function () {\n var hasSomePoint, _i, _a, series, loadTasks, results;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n this.dataList = dataList;\n this.seriesList = this.processor.getSeriesList({\n dataList: dataList,\n range: this.range,\n });\n //this.onPredictionReceived(this.seriesList);\n this.dataWarning = null;\n hasSomePoint = this.seriesList.some(function (s) { return s.datapoints.length > 0; });\n if (!hasSomePoint) {\n this.dataWarning = {\n title: 'No data points',\n tip: 'No datapoints returned from data query',\n };\n }\n else {\n for (_i = 0, _a = this.seriesList; _i < _a.length; _i++) {\n 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 loadTasks = [\n // this.annotationsPromise,\n this.analyticsController.fetchAnomalyTypesSegments(+this.range.from, +this.range.to)\n ];\n return [4 /*yield*/, Promise.all(loadTasks)];\n case 1:\n results = _b.sent();\n this.loading = false;\n // this.annotations = results[0].annotations;\n this.render(this.seriesList);\n return [2 /*return*/];\n }\n });\n });\n };\n GraphCtrl.prototype.onPredictionReceived = function (spanList) {\n var predictions = [];\n for (var _i = 0, spanList_1 = spanList; _i < spanList_1.length; _i++) {\n var span = spanList_1[_i];\n var predictionLow = {\n target: '',\n color: '',\n datapoints: []\n };\n var predictionHigh = {\n target: '',\n color: '',\n datapoints: []\n };\n for (var _a = 0, _b = span.datapoints; _a < _b.length; _a++) {\n var datapoint = _b[_a];\n predictionHigh.datapoints.push([datapoint[0] + 2, datapoint[1]]);\n predictionLow.datapoints.push([datapoint[0] - 2, datapoint[1]]);\n }\n predictionHigh.target = span.label + \" high\";\n predictionLow.target = span.label + \" low\";\n predictionHigh.color = span.color;\n predictionLow.color = span.color;\n predictions.push(predictionHigh, predictionLow);\n }\n var predictionSeries = this.processor.getSeriesList({\n dataList: predictions,\n range: this.range\n });\n for (var _c = 0, predictionSeries_1 = predictionSeries; _c < predictionSeries_1.length; _c++) {\n var serie = predictionSeries_1[_c];\n serie.prediction = true;\n this.seriesList.push(serie);\n }\n };\n GraphCtrl.prototype.onRender = function (data) {\n if (!this.seriesList) {\n return;\n }\n var _loop_1 = function (series) {\n if (series.prediction) {\n overrideItem = lodash__WEBPACK_IMPORTED_MODULE_13___default.a.find(this_1.panel.seriesOverrides, function (el) { return el.alias === series.alias; });\n if (overrideItem !== undefined) {\n this_1.addSeriesOverride({\n alias: series.alias,\n linewidth: 0,\n legend: false,\n // if pointradius === 0 -> point still shows, that's why pointradius === -1\n pointradius: -1,\n fill: 3\n });\n }\n }\n series.applySeriesOverrides(this_1.panel.seriesOverrides);\n if (series.unit) {\n this_1.panel.yaxes[series.yaxis - 1].format = series.unit;\n }\n };\n var this_1 = this, overrideItem;\n for (var _i = 0, _a = this.seriesList; _i < _a.length; _i++) {\n var series = _a[_i];\n _loop_1(series);\n }\n if (!this.analyticsController.graphLocked) {\n this._graphLegend.render();\n this._graphRenderer.render(data);\n }\n };\n GraphCtrl.prototype.changeSeriesColor = function (series, color) {\n series.color = 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 = lodash__WEBPACK_IMPORTED_MODULE_13___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 lodash__WEBPACK_IMPORTED_MODULE_13___default.a.each(this.seriesList, function (value) {\n delete _this.hiddenSeries[value.alias];\n });\n }\n else {\n // hide all but this serie\n lodash__WEBPACK_IMPORTED_MODULE_13___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 = lodash__WEBPACK_IMPORTED_MODULE_13___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 = lodash__WEBPACK_IMPORTED_MODULE_13___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.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 Object.defineProperty(GraphCtrl.prototype, \"panelPath\", {\n // getAnnotationsByTag(tag) {\n // var res = [];\n // for (var annotation of this.annotations) {\n // if (annotation.tags.indexOf(tag) >= 0) {\n // res.push(annotation);\n // }\n // }\n // return res;\n // }\n // get annotationTags() {\n // var res = [];\n // for (var annotation of this.annotations) {\n // for (var tag of annotation.tags) {\n // if (res.indexOf(tag) < 0) {\n // res.push(tag);\n // }\n // }\n // }\n // return res;\n // }\n get: function () {\n if (this._panelPath === undefined) {\n this._panelPath = '/public/plugins/' + this.pluginId + '/';\n }\n return this._panelPath;\n },\n enumerable: true,\n configurable: true\n });\n GraphCtrl.prototype.createNew = function () {\n this.analyticsController.createNew();\n };\n GraphCtrl.prototype.saveNew = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n this.refresh();\n return [4 /*yield*/, this.analyticsController.saveNew(new _models_metric__WEBPACK_IMPORTED_MODULE_6__[\"MetricExpanded\"](this.panel.datasource, this.panel.targets), this.datasourceRequest, this.panel.id)];\n case 1:\n _a.sent();\n this.$scope.$digest();\n this.render(this.seriesList);\n return [2 /*return*/];\n }\n });\n });\n };\n GraphCtrl.prototype.onColorChange = function (id, value) {\n if (id === undefined) {\n throw new Error('id is undefined');\n }\n this.analyticsController.onAnalyticUnitColorChange(id, value);\n this.render();\n };\n GraphCtrl.prototype.onRemove = function (id) {\n if (id === undefined) {\n throw new Error('id is undefined');\n }\n this.analyticsController.removeAnalyticUnit(id);\n this.render();\n };\n GraphCtrl.prototype.onCancelLabeling = function (key) {\n var _this = this;\n this.$scope.$root.appEvent('confirm-modal', {\n title: 'Clear anomaly labeling',\n text2: 'Your changes will be lost.',\n yesText: 'Clear',\n icon: 'fa-warning',\n altActionText: 'Save',\n onAltAction: function () {\n _this.onToggleLabelingMode(key);\n },\n onConfirm: function () {\n _this.analyticsController.undoLabeling();\n _this.render();\n },\n });\n };\n GraphCtrl.prototype.onToggleLabelingMode = function (key) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.analyticsController.toggleAnomalyTypeLabelingMode(key)];\n case 1:\n _a.sent();\n this.$scope.$digest();\n this.render();\n return [2 /*return*/];\n }\n });\n });\n };\n GraphCtrl.prototype.onDKey = function () {\n if (!this.analyticsController.labelingMode) {\n return;\n }\n this.analyticsController.toggleDeleteMode();\n };\n GraphCtrl.prototype.onAnomalyAlertChange = function (anomalyType) {\n this.analyticsController.toggleAlertEnabled(anomalyType);\n };\n GraphCtrl.prototype.onToggleVisibility = function (id) {\n this.analyticsController.toggleVisibility(id);\n this.render();\n };\n Object.defineProperty(GraphCtrl.prototype, \"renderError\", {\n get: function () { return this._renderError; },\n set: function (value) { this._renderError = value; },\n enumerable: true,\n configurable: true\n });\n GraphCtrl.template = _template__WEBPACK_IMPORTED_MODULE_2__[\"default\"];\n return GraphCtrl;\n}(grafana_app_plugins_sdk__WEBPACK_IMPORTED_MODULE_10__[\"MetricsPanelCtrl\"]));\n\n\n\n//# sourceURL=webpack:///./module.ts?");
-
-/***/ }),
-
-/***/ "./series_overrides_ctrl.ts":
-/*!**********************************!*\
- !*** ./series_overrides_ctrl.ts ***!
- \**********************************/
-/*! exports provided: SeriesOverridesCtrl */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SeriesOverridesCtrl\", function() { return SeriesOverridesCtrl; });\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var angular__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! angular */ \"angular\");\n/* harmony import */ var angular__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(angular__WEBPACK_IMPORTED_MODULE_1__);\n\n\nvar SeriesOverridesCtrl = /** @class */ (function () {\n /** @ngInject */\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: lodash__WEBPACK_IMPORTED_MODULE_0___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 bellow 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 lodash__WEBPACK_IMPORTED_MODULE_0___default.a.map($scope.ctrl.seriesList, function (series) {\n return series.alias;\n });\n };\n $scope.updateCurrentOverrides = function () {\n $scope.currentOverrides = [];\n lodash__WEBPACK_IMPORTED_MODULE_0___default.a.each($scope.overrideMenu, function (option) {\n var value = $scope.override[option.propertyName];\n if (lodash__WEBPACK_IMPORTED_MODULE_0___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\nangular__WEBPACK_IMPORTED_MODULE_1___default.a.module('grafana.controllers').controller('SeriesOverridesCtrl', SeriesOverridesCtrl);\n\n\n//# sourceURL=webpack:///./series_overrides_ctrl.ts?");
-
-/***/ }),
-
-/***/ "./services/analytic_service.ts":
-/*!**************************************!*\
- !*** ./services/analytic_service.ts ***!
- \**************************************/
-/*! exports provided: AnalyticService */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AnalyticService\", function() { return AnalyticService; });\n/* harmony import */ var _models_analytic_unit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../models/analytic_unit */ \"./models/analytic_unit.ts\");\nvar __awaiter = (undefined && undefined.__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 = (undefined && undefined.__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 = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [0, 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};\nvar __await = (undefined && undefined.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }\nvar __asyncGenerator = (undefined && undefined.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n};\n\nvar AnalyticService = /** @class */ (function () {\n function AnalyticService(_backendURL, _backendSrv) {\n this._backendURL = _backendURL;\n this._backendSrv = _backendSrv;\n }\n AnalyticService.prototype.postNewItem = function (metric, datasourceRequest, newItem, panelId) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, this._backendSrv.post(this._backendURL + '/analyticUnits', {\n name: newItem.name,\n metric: metric.toJSON(),\n panelUrl: window.location.origin + window.location.pathname + (\"?panelId=\" + panelId + \"&fullscreen\"),\n datasource: datasourceRequest,\n type: newItem.type\n }).then(function (res) { return res.id; })];\n });\n });\n };\n ;\n AnalyticService.prototype.isBackendOk = function () {\n return __awaiter(this, void 0, void 0, function () {\n var data, e_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n return [4 /*yield*/, this._backendSrv.get(this._backendURL)];\n case 1:\n data = _a.sent();\n // TODO: check version\n return [2 /*return*/, true];\n case 2:\n e_1 = _a.sent();\n return [2 /*return*/, false];\n case 3: return [2 /*return*/];\n }\n });\n });\n };\n AnalyticService.prototype.updateSegments = function (id, addedSegments, removedSegments) {\n return __awaiter(this, void 0, void 0, function () {\n var getJSONs, payload, data;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n getJSONs = function (segs) { return segs.getSegments().map(function (segment) { return ({\n \"start\": segment.from,\n \"finish\": segment.to\n }); }); };\n payload = {\n id: id,\n addedSegments: getJSONs(addedSegments),\n removedSegments: removedSegments.getSegments().map(function (s) { return s.id; })\n };\n return [4 /*yield*/, this._backendSrv.patch(this._backendURL + '/segments', payload)];\n case 1:\n data = _a.sent();\n if (data.addedIds === undefined) {\n throw new Error('Server didn`t send addedIds');\n }\n return [2 /*return*/, data.addedIds];\n }\n });\n });\n };\n AnalyticService.prototype.getSegments = function (id, from, to) {\n return __awaiter(this, void 0, void 0, function () {\n var payload, data, segments;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (id === undefined) {\n throw new Error('id is undefined');\n }\n payload = { id: id };\n if (from !== undefined) {\n payload['from'] = from;\n }\n if (to !== undefined) {\n payload['to'] = to;\n }\n return [4 /*yield*/, this._backendSrv.get(this._backendURL + '/segments', payload)];\n case 1:\n data = _a.sent();\n if (data.segments === undefined) {\n throw new Error('Server didn`t return segments array');\n }\n segments = data.segments;\n return [2 /*return*/, segments.map(function (s) { return new _models_analytic_unit__WEBPACK_IMPORTED_MODULE_0__[\"AnalyticSegment\"](s.labeled, s.id, s.start, s.finish); })];\n }\n });\n });\n };\n AnalyticService.prototype.getStatusGenerator = function (id, duration) {\n return __asyncGenerator(this, arguments, function getStatusGenerator_1() {\n var _this = this;\n var statusCheck, timeout;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (id === undefined) {\n throw new Error('id is undefined');\n }\n statusCheck = function () { return __awaiter(_this, void 0, void 0, function () {\n var data;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this._backendSrv.get(this._backendURL + '/analyticUnits/status', { id: id })];\n case 1:\n data = _a.sent();\n return [2 /*return*/, data];\n }\n });\n }); };\n timeout = function () { return __awaiter(_this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n return [2 /*return*/, new Promise(function (resolve) { return setTimeout(resolve, duration); })];\n });\n }); };\n _a.label = 1;\n case 1:\n if (false) {}\n return [4 /*yield*/, __await(statusCheck())];\n case 2: return [4 /*yield*/, _a.sent()];\n case 3:\n _a.sent();\n return [4 /*yield*/, __await(timeout())];\n case 4:\n _a.sent();\n return [3 /*break*/, 1];\n case 5: return [2 /*return*/];\n }\n });\n });\n };\n AnalyticService.prototype.getAlertEnabled = function (id) {\n return __awaiter(this, void 0, void 0, function () {\n var data;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (id === undefined) {\n throw new Error('id is undefined');\n }\n return [4 /*yield*/, this._backendSrv.get(this._backendURL + '/alerts', { id: id })];\n case 1:\n data = _a.sent();\n if (data.enabled === undefined) {\n throw new Error('Server didn`t return \"enabled\"');\n }\n return [2 /*return*/, data.enabled];\n }\n });\n });\n };\n AnalyticService.prototype.setAlertEnabled = function (id, enabled) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (id === undefined) {\n throw new Error('id is undefined');\n }\n return [2 /*return*/, this._backendSrv.post(this._backendURL + '/alerts', { id: id, enabled: enabled })];\n });\n });\n };\n return AnalyticService;\n}());\n\n\n\n//# sourceURL=webpack:///./services/analytic_service.ts?");
-
-/***/ }),
-
-/***/ "./template.ts":
-/*!*********************!*\
- !*** ./template.ts ***!
- \*********************/
-/*! exports provided: default */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\nvar template = \"\\n
\\n\";\n/* harmony default export */ __webpack_exports__[\"default\"] = (template);\n\n\n//# sourceURL=webpack:///./template.ts?");
-
-/***/ }),
-
-/***/ "./threshold_manager.ts":
-/*!******************************!*\
- !*** ./threshold_manager.ts ***!
- \******************************/
-/*! exports provided: ThresholdManager */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ThresholdManager\", function() { return ThresholdManager; });\n/* harmony import */ var _vendor_flot_jquery_flot__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./vendor/flot/jquery.flot */ \"./vendor/flot/jquery.flot.js\");\n/* harmony import */ var _vendor_flot_jquery_flot__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_vendor_flot_jquery_flot__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! jquery */ \"jquery\");\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ \"lodash\");\n/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);\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 = jquery__WEBPACK_IMPORTED_MODULE_1__(evt.currentTarget).parents('.alert-handle-wrapper');\n var handleIndex = jquery__WEBPACK_IMPORTED_MODULE_1__(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 (!lodash__WEBPACK_IMPORTED_MODULE_2___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 = jquery__WEBPACK_IMPORTED_MODULE_1__(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 (!lodash__WEBPACK_IMPORTED_MODULE_2___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 options.grid.markings.push({\n yaxis: { from: threshold.value, to: limit },\n color: fillColor,\n });\n }\n if (threshold.line) {\n options.grid.markings.push({\n yaxis: { from: threshold.value, to: threshold.value },\n color: lineColor,\n });\n }\n }\n };\n return ThresholdManager;\n}());\n\n\n\n//# sourceURL=webpack:///./threshold_manager.ts?");
-
-/***/ }),
-
-/***/ "./thresholds_form.ts":
-/*!****************************!*\
- !*** ./thresholds_form.ts ***!
- \****************************/
-/*! exports provided: ThresholdFormCtrl */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ThresholdFormCtrl\", function() { return ThresholdFormCtrl; });\n/* harmony import */ var grafana_app_core_core_module__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! grafana/app/core/core_module */ \"grafana/app/core/core_module\");\n/* harmony import */ var grafana_app_core_core_module__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(grafana_app_core_core_module__WEBPACK_IMPORTED_MODULE_0__);\n\nvar ThresholdFormCtrl = /** @class */ (function () {\n /** @ngInject */\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 });\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\";\ngrafana_app_core_core_module__WEBPACK_IMPORTED_MODULE_0___default.a.directive('hasticGraphThresholdForm', 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//# sourceURL=webpack:///./thresholds_form.ts?");
-
-/***/ }),
-
-/***/ "./vendor/flot/jquery.flot.crosshair.js":
-/*!**********************************************!*\
- !*** ./vendor/flot/jquery.flot.crosshair.js ***!
- \**********************************************/
-/*! no static exports found */
-/***/ (function(module, exports) {
-
-eval("/* 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//# sourceURL=webpack:///./vendor/flot/jquery.flot.crosshair.js?");
-
-/***/ }),
-
-/***/ "./vendor/flot/jquery.flot.dashes.js":
-/*!*******************************************!*\
- !*** ./vendor/flot/jquery.flot.dashes.js ***!
- \*******************************************/
-/*! no static exports found */
-/***/ (function(module, exports) {
-
-eval("/*\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//# sourceURL=webpack:///./vendor/flot/jquery.flot.dashes.js?");
-
-/***/ }),
-
-/***/ "./vendor/flot/jquery.flot.events.js":
-/*!*******************************************!*\
- !*** ./vendor/flot/jquery.flot.events.js ***!
- \*******************************************/
-/*! no static exports found */
-/***/ (function(module, exports, __webpack_require__) {
-
-eval("var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [\n __webpack_require__(/*! jquery */ \"jquery\"),\n __webpack_require__(/*! lodash */ \"lodash\"),\n __webpack_require__(/*! angular */ \"angular\"),\n __webpack_require__(/*! tether-drop */ \"../node_modules/tether-drop/dist/js/drop.js\"),\n], __WEBPACK_AMD_DEFINE_RESULT__ = (function ($, _, angular, Drop) {\n 'use strict';\n\n function createAnnotationToolip(element, event, plot) {\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.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 inital marker element is removed)\n markerElementToAttachTo = element;\n return;\n }\n\n // mark as openend\n eventManager.editorOpened();\n // set marker elment 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));\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) {\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);\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//# sourceURL=webpack:///./vendor/flot/jquery.flot.events.js?");
-
-/***/ }),
-
-/***/ "./vendor/flot/jquery.flot.fillbelow.js":
-/*!**********************************************!*\
- !*** ./vendor/flot/jquery.flot.fillbelow.js ***!
- \**********************************************/
-/*! no static exports found */
-/***/ (function(module, exports) {
-
-eval("(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//# sourceURL=webpack:///./vendor/flot/jquery.flot.fillbelow.js?");
-
-/***/ }),
-
-/***/ "./vendor/flot/jquery.flot.js":
-/*!************************************!*\
- !*** ./vendor/flot/jquery.flot.js ***!
- \************************************/
-/*! no static exports found */
-/***/ (function(module, exports) {
-
-eval("/* 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