{"version":3,"sources":["webpack:///./node_modules/chartjs-plugin-annotation/src/index.js","webpack:///./node_modules/chartjs-plugin-annotation/src/element.js","webpack:///./node_modules/chartjs-plugin-annotation/src/types/line.js","webpack:///./node_modules/chartjs-plugin-annotation/src/types/box.js","webpack:///./node_modules/chartjs-plugin-annotation/src/annotation.js","webpack:///./node_modules/chartjs-plugin-annotation/src/events.js","webpack:///./node_modules/chartjs-plugin-annotation/src/helpers.js"],"names":["Chart","window","Annotation","drawTimeOptions","afterDraw","afterDatasetsDraw","beforeDatasetsDraw","defaults","drawTime","dblClickSpeed","events","annotations","labelDefaults","backgroundColor","fontFamily","global","defaultFontFamily","fontSize","defaultFontSize","fontStyle","fontColor","xPadding","yPadding","cornerRadius","position","xAdjust","yAdjust","enabled","content","Element","types","line","box","annotationPlugin","module","exports","pluginService","register","chartHelpers","helpers","extend","initialize","this","hidden","hovering","_model","clone","setDataLimits","destroy","configure","inRange","getCenterPoint","getWidth","getHeight","getArea","draw","horizontalKeyword","verticalKeyword","LineFunction","view","m","x2","x1","y2","y1","b","getX","y","getY","x","intersects","epsilon","dy","dx","isFinite","Math","abs","model","options","ranges","scaleID","min","value","max","endValue","pixel","endPixel","chartInstance","ctx","chart","scale","scales","isValid","getPixelForValue","NaN","isNaN","chartArea","clip","left","right","top","bottom","mode","labelBackgroundColor","label","labelFontFamily","labelFontSize","labelFontStyle","labelFontColor","labelXPadding","labelYPadding","labelCornerRadius","labelPosition","labelXAdjust","labelYAdjust","labelEnabled","labelContent","font","fontString","textWidth","measureText","width","textHeight","height","padWidth","padHeight","ret","xa","ya","calculateLabelPosition","labelX","labelY","labelWidth","labelHeight","borderColor","borderWidth","borderDash","borderDashOffset","mouseX","mouseY","sqrt","pow","_view","save","beginPath","rect","lineWidth","strokeStyle","setLineDash","lineDashOffset","moveTo","lineTo","stroke","fillStyle","drawRoundedRectangle","fill","textAlign","textBaseline","fillText","restore","xScale","xScaleID","yScale","yScaleID","xMin","xMax","yMin","yMax","fillRect","strokeRect","annotationTypes","setAfterDataLimitsHook","axisOptions","decorate","previous","adjustScaleRange","easingDecimal","defaultDrawTime","annotation","elements","filter","element","forEach","transition","beforeInit","chartOptions","ns","initConfig","onDestroy","firstRun","supported","ensureScalesHaveIDs","each","xAxes","yAxes","beforeUpdate","elementIds","id","objectId","type","cls","push","Object","keys","indexOf","afterScaleUpdate","afterInit","watchFor","isArray","length","canvas","eventHandler","dispatcher","bind","collapseHoverEvents","eventName","addEvent","removeEvent","deregisterers","pop","hover","filteredEvents","e","getRelativePosition","getNearestItems","eventHandlers","eventHandlerName","getEventHandlerName","hoverEvent","createMouseEvent","onDblclick","onClick","clearTimeout","clickTimeout","setTimeout","call","stopImmediatePropagation","preventDefault","noop","map","random","toString","substr","rawValue","obj","prop","func","args","concat","Array","prototype","slice","arguments","apply","undefined","callEach","fns","method","fn","toUpperCase","substring","previousEvent","MouseEvent","exception","document","createEvent","initMouseEvent","canBubble","cancelable","detail","screenX","screenY","clientX","clientY","ctrlKey","altKey","shiftKey","metaKey","button","relatedTarget","exception2","initEvent","config","configMerge","scaleId","scaleMin","scaleMax","range","Number","reduce","a","ticks","suggestedMin","suggestedMax","handleTickRangeOptions","minDistance","POSITIVE_INFINITY","nearestItems","center","distance","distanceBetweenPoints","sort","sizeA","sizeB","_index"],"mappings":"8EACA,IAAIA,EAAQ,EAAQ,KACpBA,EAA0B,mBAAZ,EAAyBA,EAAQC,OAAOD,OAGhDE,WAAaF,EAAME,YAAc,GAEvCF,EAAME,WAAWC,gBAAkB,CAClCC,UAAW,YACXC,kBAAmB,oBACnBC,mBAAoB,sBAGrBN,EAAME,WAAWK,SAAW,CAC3BC,SAAU,oBACVC,cAAe,IACfC,OAAQ,GACRC,YAAa,IAGdX,EAAME,WAAWU,cAAgB,CAChCC,gBAAiB,kBACjBC,WAAYd,EAAMO,SAASQ,OAAOC,kBAClCC,SAAUjB,EAAMO,SAASQ,OAAOG,gBAChCC,UAAW,OACXC,UAAW,OACXC,SAAU,EACVC,SA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B,EAAS6C,EAAG7C,EAAS2C,KAE5C8N,OAAO,SAASQ,EAAcpH,GAC9B,IAAIqH,EAASrH,EAAQlI,iBACjBwP,EAAWrQ,EAAasQ,sBAAsBpR,EAAUkR,GAU5D,OARIC,EAAWJ,GACdE,EAAe,CAACpH,GAChBkH,EAAcI,GACJA,IAAaJ,GAEvBE,EAAahG,KAAKpB,GAGZoH,GACL,IACFI,KAAK,SAASX,EAAGjO,GAGjB,IAAI6O,EAAQZ,EAAE5O,UAAWyP,EAAQ9O,EAAEX,UACnC,OAAQwP,EAAQC,GAASD,EAAQC,EAASD,EAAQC,EAAQb,EAAEc,OAAS/O,EAAE+O,SAEvErD,MAAM,EAAG,GAAG,IAadxB,oBAAqBA,EACrBE,iBAAkBA","file":"npm.chartjs-plugin-annotation.a2af5320674e59dc02b2.js","sourcesContent":["// Get the chart variable\nvar Chart = require('chart.js');\nChart = typeof(Chart) === 'function' ? Chart : window.Chart;\n\n// Configure plugin namespace\nChart.Annotation = Chart.Annotation || {};\n\nChart.Annotation.drawTimeOptions = {\n\tafterDraw: 'afterDraw',\n\tafterDatasetsDraw: 'afterDatasetsDraw',\n\tbeforeDatasetsDraw: 'beforeDatasetsDraw'\n};\n\nChart.Annotation.defaults = {\n\tdrawTime: 'afterDatasetsDraw',\n\tdblClickSpeed: 350, // ms\n\tevents: [],\n\tannotations: []\n};\n\nChart.Annotation.labelDefaults = {\n\tbackgroundColor: 'rgba(0,0,0,0.8)',\n\tfontFamily: Chart.defaults.global.defaultFontFamily,\n\tfontSize: Chart.defaults.global.defaultFontSize,\n\tfontStyle: 'bold',\n\tfontColor: '#fff',\n\txPadding: 6,\n\tyPadding: 6,\n\tcornerRadius: 6,\n\tposition: 'center',\n\txAdjust: 0,\n\tyAdjust: 0,\n\tenabled: false,\n\tcontent: null\n};\n\nChart.Annotation.Element = require('./element.js')(Chart);\n\nChart.Annotation.types = {\n\tline: require('./types/line.js')(Chart),\n\tbox: require('./types/box.js')(Chart)\n};\n\nvar annotationPlugin = require('./annotation.js')(Chart);\n\nmodule.exports = annotationPlugin;\nChart.pluginService.register(annotationPlugin);\n","module.exports = function(Chart) {\n\tvar chartHelpers = Chart.helpers;\n\t\n\tvar AnnotationElement = Chart.Element.extend({\n\t\tinitialize: function() {\n\t\t\tthis.hidden = false;\n\t\t\tthis.hovering = false;\n\t\t\tthis._model = chartHelpers.clone(this._model) || {};\n\t\t\tthis.setDataLimits();\n\t\t},\n\t\tdestroy: function() {},\n\t\tsetDataLimits: function() {},\n\t\tconfigure: function() {},\n\t\tinRange: function() {},\n\t\tgetCenterPoint: function() {},\n\t\tgetWidth: function() {},\n\t\tgetHeight: function() {},\n\t\tgetArea: function() {},\n\t\tdraw: function() {}\n\t});\n\n\treturn AnnotationElement;\n};\n","// Line Annotation implementation\nmodule.exports = function(Chart) {\n\tvar chartHelpers = Chart.helpers;\n\tvar helpers = require('../helpers.js')(Chart);\n\n\tvar horizontalKeyword = 'horizontal';\n\tvar verticalKeyword = 'vertical';\n\n\tvar LineAnnotation = Chart.Annotation.Element.extend({\n\t\tsetDataLimits: function() {\n\t\t\tvar model = this._model;\n\t\t\tvar options = this.options;\n\n\t\t\t// Set the data range for this annotation\n\t\t\tmodel.ranges = {};\n\t\t\tmodel.ranges[options.scaleID] = {\n\t\t\t\tmin: options.value,\n\t\t\t\tmax: options.endValue || options.value\n\t\t\t};\n\t\t},\n\t\tconfigure: function() {\n\t\t\tvar model = this._model;\n\t\t\tvar options = this.options;\n\t\t\tvar chartInstance = this.chartInstance;\n\t\t\tvar ctx = chartInstance.chart.ctx;\n\n\t\t\tvar scale = chartInstance.scales[options.scaleID];\n\t\t\tvar pixel, endPixel;\n\t\t\tif (scale) {\n\t\t\t\tpixel = helpers.isValid(options.value) ? scale.getPixelForValue(options.value) : NaN;\n\t\t\t\tendPixel = helpers.isValid(options.endValue) ? scale.getPixelForValue(options.endValue) : pixel;\n\t\t\t}\n\n\t\t\tif (isNaN(pixel)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar chartArea = chartInstance.chartArea;\n\n\t\t\t// clip annotations to the chart area\n\t\t\tmodel.clip = {\n\t\t\t\tx1: chartArea.left,\n\t\t\t\tx2: chartArea.right,\n\t\t\t\ty1: chartArea.top,\n\t\t\t\ty2: chartArea.bottom\n\t\t\t};\n\n\t\t\tif (this.options.mode == horizontalKeyword) {\n\t\t\t\tmodel.x1 = chartArea.left;\n\t\t\t\tmodel.x2 = chartArea.right;\n\t\t\t\tmodel.y1 = pixel;\n\t\t\t\tmodel.y2 = endPixel;\n\t\t\t} else {\n\t\t\t\tmodel.y1 = chartArea.top;\n\t\t\t\tmodel.y2 = chartArea.bottom;\n\t\t\t\tmodel.x1 = pixel;\n\t\t\t\tmodel.x2 = endPixel;\n\t\t\t}\n\n\t\t\tmodel.line = new LineFunction(model);\n\t\t\tmodel.mode = options.mode;\n\n\t\t\t// Figure out the label:\n\t\t\tmodel.labelBackgroundColor = options.label.backgroundColor;\n\t\t\tmodel.labelFontFamily = options.label.fontFamily;\n\t\t\tmodel.labelFontSize = options.label.fontSize;\n\t\t\tmodel.labelFontStyle = options.label.fontStyle;\n\t\t\tmodel.labelFontColor = options.label.fontColor;\n\t\t\tmodel.labelXPadding = options.label.xPadding;\n\t\t\tmodel.labelYPadding = options.label.yPadding;\n\t\t\tmodel.labelCornerRadius = options.label.cornerRadius;\n\t\t\tmodel.labelPosition = options.label.position;\n\t\t\tmodel.labelXAdjust = options.label.xAdjust;\n\t\t\tmodel.labelYAdjust = options.label.yAdjust;\n\t\t\tmodel.labelEnabled = options.label.enabled;\n\t\t\tmodel.labelContent = options.label.content;\n\n\t\t\tctx.font = chartHelpers.fontString(model.labelFontSize, model.labelFontStyle, model.labelFontFamily);\n\t\t\tvar textWidth = ctx.measureText(model.labelContent).width;\n\t\t\tvar textHeight = ctx.measureText('M').width;\n\t\t\tvar labelPosition = calculateLabelPosition(model, textWidth, textHeight, model.labelXPadding, model.labelYPadding);\n\t\t\tmodel.labelX = labelPosition.x - model.labelXPadding;\n\t\t\tmodel.labelY = labelPosition.y - model.labelYPadding;\n\t\t\tmodel.labelWidth = textWidth + (2 * model.labelXPadding);\n\t\t\tmodel.labelHeight = textHeight + (2 * model.labelYPadding);\n\n\t\t\tmodel.borderColor = options.borderColor;\n\t\t\tmodel.borderWidth = options.borderWidth;\n\t\t\tmodel.borderDash = options.borderDash || [];\n\t\t\tmodel.borderDashOffset = options.borderDashOffset || 0;\n\t\t},\n\t\tinRange: function(mouseX, mouseY) {\n\t\t\tvar model = this._model;\n\t\t\t\n\t\t\treturn (\n\t\t\t\t// On the line\n\t\t\t\tmodel.line &&\n\t\t\t\tmodel.line.intersects(mouseX, mouseY, this.getHeight())\n\t\t\t) || (\n\t\t\t\t// On the label\n\t\t\t\tmodel.labelEnabled &&\n\t\t\t\tmodel.labelContent &&\n\t\t\t\tmouseX >= model.labelX && \n\t\t\t\tmouseX <= model.labelX + model.labelWidth && \n\t\t\t\tmouseY >= model.labelY && \n\t\t\t\tmouseY <= model.labelY + model.labelHeight\n\t\t\t);\n\t\t},\n\t\tgetCenterPoint: function() {\n\t\t\treturn {\n\t\t\t\tx: (this._model.x2 + this._model.x1) / 2,\n\t\t\t\ty: (this._model.y2 + this._model.y1) / 2\n\t\t\t};\n\t\t},\n\t\tgetWidth: function() {\n\t\t\treturn Math.abs(this._model.right - this._model.left);\n\t\t},\n\t\tgetHeight: function() {\n\t\t\treturn this._model.borderWidth || 1;\n\t\t},\n\t\tgetArea: function() {\n\t\t\treturn Math.sqrt(Math.pow(this.getWidth(), 2) + Math.pow(this.getHeight(), 2));\n\t\t},\n\t\tdraw: function() {\n\t\t\tvar view = this._view;\n\t\t\tvar ctx = this.chartInstance.chart.ctx;\n\n\t\t\tif (!view.clip) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tctx.save();\n\n\t\t\t// Canvas setup\n\t\t\tctx.beginPath();\n\t\t\tctx.rect(view.clip.x1, view.clip.y1, view.clip.x2 - view.clip.x1, view.clip.y2 - view.clip.y1);\n\t\t\tctx.clip();\n\n\t\t\tctx.lineWidth = view.borderWidth;\n\t\t\tctx.strokeStyle = view.borderColor;\n\n\t\t\tif (ctx.setLineDash) {\n\t\t\t\tctx.setLineDash(view.borderDash);\n\t\t\t}\n\t\t\tctx.lineDashOffset = view.borderDashOffset;\n\n\t\t\t// Draw\n\t\t\tctx.beginPath();\n\t\t\tctx.moveTo(view.x1, view.y1);\n\t\t\tctx.lineTo(view.x2, view.y2);\n\t\t\tctx.stroke();\n\n\t\t\tif (view.labelEnabled && view.labelContent) {\n\t\t\t\tctx.beginPath();\n\t\t\t\tctx.rect(view.clip.x1, view.clip.y1, view.clip.x2 - view.clip.x1, view.clip.y2 - view.clip.y1);\n\t\t\t\tctx.clip();\n\n\t\t\t\tctx.fillStyle = view.labelBackgroundColor;\n\t\t\t\t// Draw the tooltip\n\t\t\t\tchartHelpers.drawRoundedRectangle(\n\t\t\t\t\tctx,\n\t\t\t\t\tview.labelX, // x\n\t\t\t\t\tview.labelY, // y\n\t\t\t\t\tview.labelWidth, // width\n\t\t\t\t\tview.labelHeight, // height\n\t\t\t\t\tview.labelCornerRadius // radius\n\t\t\t\t);\n\t\t\t\tctx.fill();\n\n\t\t\t\t// Draw the text\n\t\t\t\tctx.font = chartHelpers.fontString(\n\t\t\t\t\tview.labelFontSize,\n\t\t\t\t\tview.labelFontStyle,\n\t\t\t\t\tview.labelFontFamily\n\t\t\t\t);\n\t\t\t\tctx.fillStyle = view.labelFontColor;\n\t\t\t\tctx.textAlign = 'center';\n\t\t\t\tctx.textBaseline = 'middle';\n\t\t\t\tctx.fillText(\n\t\t\t\t\tview.labelContent,\n\t\t\t\t\tview.labelX + (view.labelWidth / 2),\n\t\t\t\t\tview.labelY + (view.labelHeight / 2)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tctx.restore();\n\t\t}\n\t});\n\n\tfunction LineFunction(view) {\n\t\t// Describe the line in slope-intercept form (y = mx + b).\n\t\t// Note that the axes are rotated 90° CCW, which causes the\n\t\t// x- and y-axes to be swapped.\n\t\tvar m = (view.x2 - view.x1) / (view.y2 - view.y1);\n\t\tvar b = view.x1 || 0;\n\n\t\tthis.m = m;\n\t\tthis.b = b;\n\n\t\tthis.getX = function(y) {\n\t\t\t// Coordinates are relative to the origin of the canvas\n\t\t\treturn m * (y - view.y1) + b;\n\t\t};\n\n\t\tthis.getY = function(x) {\n\t\t\treturn ((x - b) / m) + view.y1;\n\t\t};\n\n\t\tthis.intersects = function(x, y, epsilon) {\n\t\t\tepsilon = epsilon || 0.001;\n\t\t\tvar dy = this.getY(x),\n\t\t\t\tdx = this.getX(y);\n\t\t\treturn (\n\t\t\t\t(!isFinite(dy) || Math.abs(y - dy) < epsilon) &&\n\t\t\t\t(!isFinite(dx) || Math.abs(x - dx) < epsilon)\n\t\t\t);\n\t\t};\n\t}\n\n\tfunction calculateLabelPosition(view, width, height, padWidth, padHeight) {\n\t\tvar line = view.line;\n\t\tvar ret = {}, xa = 0, ya = 0;\n\n\t\tswitch (true) {\n\t\t\t// top align\n\t\t\tcase view.mode == verticalKeyword && view.labelPosition == \"top\":\n\t\t\t\tya = padHeight + view.labelYAdjust;\n\t\t\t\txa = (width / 2) + view.labelXAdjust;\n\t\t\t\tret.y = view.y1 + ya;\n\t\t\t\tret.x = (isFinite(line.m) ? line.getX(ret.y) : view.x1) - xa;\n\t\t\tbreak;\n\n\t\t\t// bottom align\n\t\t\tcase view.mode == verticalKeyword && view.labelPosition == \"bottom\":\n\t\t\t\tya = height + padHeight + view.labelYAdjust;\n\t\t\t\txa = (width / 2) + view.labelXAdjust;\n\t\t\t\tret.y = view.y2 - ya;\n\t\t\t\tret.x = (isFinite(line.m) ? line.getX(ret.y) : view.x1) - xa;\n\t\t\tbreak;\n\n\t\t\t// left align\n\t\t\tcase view.mode == horizontalKeyword && view.labelPosition == \"left\":\n\t\t\t\txa = padWidth + view.labelXAdjust;\n\t\t\t\tya = -(height / 2) + view.labelYAdjust;\n\t\t\t\tret.x = view.x1 + xa;\n\t\t\t\tret.y = line.getY(ret.x) + ya;\n\t\t\tbreak;\n\n\t\t\t// right align\n\t\t\tcase view.mode == horizontalKeyword && view.labelPosition == \"right\":\n\t\t\t\txa = width + padWidth + view.labelXAdjust;\n\t\t\t\tya = -(height / 2) + view.labelYAdjust;\n\t\t\t\tret.x = view.x2 - xa;\n\t\t\t\tret.y = line.getY(ret.x) + ya;\n\t\t\tbreak;\n\n\t\t\t// center align\n\t\t\tdefault:\n\t\t\t\tret.x = ((view.x1 + view.x2 - width) / 2) + view.labelXAdjust;\n\t\t\t\tret.y = ((view.y1 + view.y2 - height) / 2) + view.labelYAdjust;\n\t\t}\n\n\t\treturn ret;\n\t}\n\n\treturn LineAnnotation;\n};\n","// Box Annotation implementation\nmodule.exports = function(Chart) {\n\tvar helpers = require('../helpers.js')(Chart);\n\t\n\tvar BoxAnnotation = Chart.Annotation.Element.extend({\n\t\tsetDataLimits: function() {\n\t\t\tvar model = this._model;\n\t\t\tvar options = this.options;\n\t\t\tvar chartInstance = this.chartInstance;\n\n\t\t\tvar xScale = chartInstance.scales[options.xScaleID];\n\t\t\tvar yScale = chartInstance.scales[options.yScaleID];\n\t\t\tvar chartArea = chartInstance.chartArea;\n\n\t\t\t// Set the data range for this annotation\n\t\t\tmodel.ranges = {};\n\t\t\t\n\t\t\tif (!chartArea) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tvar min = 0;\n\t\t\tvar max = 0;\n\t\t\t\n\t\t\tif (xScale) {\n\t\t\t\tmin = helpers.isValid(options.xMin) ? options.xMin : xScale.getPixelForValue(chartArea.left);\n\t\t\t\tmax = helpers.isValid(options.xMax) ? options.xMax : xScale.getPixelForValue(chartArea.right);\n\n\t\t\t\tmodel.ranges[options.xScaleID] = {\n\t\t\t\t\tmin: Math.min(min, max),\n\t\t\t\t\tmax: Math.max(min, max)\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (yScale) {\n\t\t\t\tmin = helpers.isValid(options.yMin) ? options.yMin : yScale.getPixelForValue(chartArea.bottom);\n\t\t\t\tmax = helpers.isValid(options.yMax) ? options.yMax : yScale.getPixelForValue(chartArea.top);\n\n\t\t\t\tmodel.ranges[options.yScaleID] = {\n\t\t\t\t\tmin: Math.min(min, max),\n\t\t\t\t\tmax: Math.max(min, max)\n\t\t\t\t};\n\t\t\t}\n\t\t},\n\t\tconfigure: function() {\n\t\t\tvar model = this._model;\n\t\t\tvar options = this.options;\n\t\t\tvar chartInstance = this.chartInstance;\n\n\t\t\tvar xScale = chartInstance.scales[options.xScaleID];\n\t\t\tvar yScale = chartInstance.scales[options.yScaleID];\n\t\t\tvar chartArea = chartInstance.chartArea;\n\n\t\t\t// clip annotations to the chart area\n\t\t\tmodel.clip = {\n\t\t\t\tx1: chartArea.left,\n\t\t\t\tx2: chartArea.right,\n\t\t\t\ty1: chartArea.top,\n\t\t\t\ty2: chartArea.bottom\n\t\t\t};\n\n\t\t\tvar left = chartArea.left, \n\t\t\t\ttop = chartArea.top, \n\t\t\t\tright = chartArea.right, \n\t\t\t\tbottom = chartArea.bottom;\n\n\t\t\tvar min, max;\n\n\t\t\tif (xScale) {\n\t\t\t\tmin = helpers.isValid(options.xMin) ? xScale.getPixelForValue(options.xMin) : chartArea.left;\n\t\t\t\tmax = helpers.isValid(options.xMax) ? xScale.getPixelForValue(options.xMax) : chartArea.right;\n\t\t\t\tleft = Math.min(min, max);\n\t\t\t\tright = Math.max(min, max);\n\t\t\t}\n\n\t\t\tif (yScale) {\n\t\t\t\tmin = helpers.isValid(options.yMin) ? yScale.getPixelForValue(options.yMin) : chartArea.bottom;\n\t\t\t\tmax = helpers.isValid(options.yMax) ? yScale.getPixelForValue(options.yMax) : chartArea.top;\n\t\t\t\ttop = Math.min(min, max);\n\t\t\t\tbottom = Math.max(min, max);\n\t\t\t}\n\n\t\t\t// Ensure model has rect coordinates\n\t\t\tmodel.left = left;\n\t\t\tmodel.top = top;\n\t\t\tmodel.right = right;\n\t\t\tmodel.bottom = bottom;\n\n\t\t\t// Stylistic options\n\t\t\tmodel.borderColor = options.borderColor;\n\t\t\tmodel.borderWidth = options.borderWidth;\n\t\t\tmodel.backgroundColor = options.backgroundColor;\n\t\t},\n\t\tinRange: function(mouseX, mouseY) {\n\t\t\tvar model = this._model;\n\t\t\treturn model &&\n\t\t\t\tmouseX >= model.left && \n\t\t\t\tmouseX <= model.right && \n\t\t\t\tmouseY >= model.top && \n\t\t\t\tmouseY <= model.bottom;\n\t\t},\n\t\tgetCenterPoint: function() {\n\t\t\tvar model = this._model;\n\t\t\treturn {\n\t\t\t\tx: (model.right + model.left) / 2,\n\t\t\t\ty: (model.bottom + model.top) / 2\n\t\t\t};\n\t\t},\n\t\tgetWidth: function() {\n\t\t\tvar model = this._model;\n\t\t\treturn Math.abs(model.right - model.left);\n\t\t},\n\t\tgetHeight: function() {\n\t\t\tvar model = this._model;\n\t\t\treturn Math.abs(model.bottom - model.top);\n\t\t},\n\t\tgetArea: function() {\n\t\t\treturn this.getWidth() * this.getHeight();\n\t\t},\n\t\tdraw: function() {\n\t\t\tvar view = this._view;\n\t\t\tvar ctx = this.chartInstance.chart.ctx;\n\n\t\t\tctx.save();\n\n\t\t\t// Canvas setup\n\t\t\tctx.beginPath();\n\t\t\tctx.rect(view.clip.x1, view.clip.y1, view.clip.x2 - view.clip.x1, view.clip.y2 - view.clip.y1);\n\t\t\tctx.clip();\n\n\t\t\tctx.lineWidth = view.borderWidth;\n\t\t\tctx.strokeStyle = view.borderColor;\n\t\t\tctx.fillStyle = view.backgroundColor;\n\n\t\t\t// Draw\n\t\t\tvar width = view.right - view.left,\n\t\t\t\theight = view.bottom - view.top;\n\t\t\tctx.fillRect(view.left, view.top, width, height);\n\t\t\tctx.strokeRect(view.left, view.top, width, height);\n\n\t\t\tctx.restore();\n\t\t}\n\t});\n\n\treturn BoxAnnotation;\n};\n","module.exports = function(Chart) {\n\tvar chartHelpers = Chart.helpers;\n\n\tvar helpers = require('./helpers.js')(Chart);\n\tvar events = require('./events.js')(Chart);\n\n\tvar annotationTypes = Chart.Annotation.types;\n\n\tfunction setAfterDataLimitsHook(axisOptions) {\n\t\thelpers.decorate(axisOptions, 'afterDataLimits', function(previous, scale) {\n\t\t\tif (previous) previous(scale);\n\t\t\thelpers.adjustScaleRange(scale);\n\t\t});\n\t}\n\n\tfunction draw(drawTime) {\n\t\treturn function(chartInstance, easingDecimal) {\n\t\t\tvar defaultDrawTime = chartInstance.annotation.options.drawTime;\n\n\t\t\thelpers.elements(chartInstance)\n\t\t\t\t.filter(function(element) {\n\t\t\t\t\treturn drawTime === (element.options.drawTime || defaultDrawTime);\n\t\t\t\t})\n\t\t\t\t.forEach(function(element) {\n\t\t\t\t\telement.transition(easingDecimal).draw();\n\t\t\t\t});\n\t\t};\n\t}\n\n\treturn {\n\t\tbeforeInit: function(chartInstance) {\n\t\t\tvar chartOptions = chartInstance.options;\n\n\t\t\t// Initialize chart instance plugin namespace\n\t\t\tvar ns = chartInstance.annotation = {\n\t\t\t\telements: {},\n\t\t\t\toptions: helpers.initConfig(chartOptions.annotation || {}),\n\t\t\t\tonDestroy: [],\n\t\t\t\tfirstRun: true,\n\t\t\t\tsupported: false\n\t\t\t};\n\n\t\t\t// Add the annotation scale adjuster to each scale's afterDataLimits hook\n\t\t\tchartInstance.ensureScalesHaveIDs();\n\t\t\tif (chartOptions.scales) {\n\t\t\t\tns.supported = true;\n\t\t\t\tchartHelpers.each(chartOptions.scales.xAxes, setAfterDataLimitsHook);\n\t\t\t\tchartHelpers.each(chartOptions.scales.yAxes, setAfterDataLimitsHook);\n\t\t\t}\n\t\t},\n\t\tbeforeUpdate: function(chartInstance) {\n\t\t\tvar ns = chartInstance.annotation;\n\n\t\t\tif (!ns.supported) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!ns.firstRun) {\n\t\t\t\tns.options = helpers.initConfig(chartInstance.options.annotation || {});\n\t\t\t} else {\n\t\t\t\tns.firstRun = false;\n\t\t\t}\n\n\t\t\tvar elementIds = [];\n\n\t\t\t// Add new elements, or update existing ones\n\t\t\tns.options.annotations.forEach(function(annotation) {\n\t\t\t\tvar id = annotation.id || helpers.objectId();\n\t\t\t\t\n\t\t\t\t// No element with that ID exists, and it's a valid annotation type\n\t\t\t\tif (!ns.elements[id] && annotationTypes[annotation.type]) {\n\t\t\t\t\tvar cls = annotationTypes[annotation.type];\n\t\t\t\t\tvar element = new cls({\n\t\t\t\t\t\tid: id,\n\t\t\t\t\t\toptions: annotation,\n\t\t\t\t\t\tchartInstance: chartInstance,\n\t\t\t\t\t});\n\t\t\t\t\telement.initialize();\n\t\t\t\t\tns.elements[id] = element;\n\t\t\t\t\tannotation.id = id;\n\t\t\t\t\telementIds.push(id);\n\t\t\t\t} else if (ns.elements[id]) {\n\t\t\t\t\t// Nothing to do for update, since the element config references\n\t\t\t\t\t// the same object that exists in the chart annotation config\n\t\t\t\t\telementIds.push(id);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Delete removed elements\n\t\t\tObject.keys(ns.elements).forEach(function(id) {\n\t\t\t\tif (elementIds.indexOf(id) === -1) {\n\t\t\t\t\tns.elements[id].destroy();\n\t\t\t\t\tdelete ns.elements[id];\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\tafterScaleUpdate: function(chartInstance) {\n\t\t\thelpers.elements(chartInstance).forEach(function(element) {\n\t\t\t\telement.configure();\n\t\t\t});\n\t\t},\n\t\tbeforeDatasetsDraw: draw('beforeDatasetsDraw'),\n\t\tafterDatasetsDraw: draw('afterDatasetsDraw'),\n\t\tafterDraw: draw('afterDraw'),\n\t\tafterInit: function(chartInstance) {\n\t\t\t// Detect and intercept events that happen on an annotation element\n\t\t\tvar watchFor = chartInstance.annotation.options.events;\n\t\t\tif (chartHelpers.isArray(watchFor) && watchFor.length > 0) {\n\t\t\t\tvar canvas = chartInstance.chart.canvas;\n\t\t\t\tvar eventHandler = events.dispatcher.bind(chartInstance);\n\t\t\t\tevents.collapseHoverEvents(watchFor).forEach(function(eventName) {\n\t\t\t\t\tchartHelpers.addEvent(canvas, eventName, eventHandler);\n\t\t\t\t\tchartInstance.annotation.onDestroy.push(function() {\n\t\t\t\t\t\tchartHelpers.removeEvent(canvas, eventName, eventHandler);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\tdestroy: function(chartInstance) {\n\t\t\tvar deregisterers = chartInstance.annotation.onDestroy;\n\t\t\twhile (deregisterers.length > 0) {\n\t\t\t\tderegisterers.pop()();\n\t\t\t}\n\t\t}\n\t};\n};\n","module.exports = function(Chart) {\n\tvar chartHelpers = Chart.helpers;\n\tvar helpers = require('./helpers.js')(Chart);\n\n\tfunction collapseHoverEvents(events) {\n\t\tvar hover = false;\n\t\tvar filteredEvents = events.filter(function(eventName) {\n\t\t\tswitch (eventName) {\n\t\t\t\tcase 'mouseenter':\n\t\t\t\tcase 'mouseover':\n\t\t\t\tcase 'mouseout':\n\t\t\t\tcase 'mouseleave':\n\t\t\t\t\thover = true;\n\t\t\t\t\treturn false;\n\n\t\t\t\tdefault:\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t});\n\t\tif (hover && filteredEvents.indexOf('mousemove') === -1) {\n\t\t\tfilteredEvents.push('mousemove');\n\t\t}\n\t\treturn filteredEvents;\n\t}\n\n\tfunction dispatcher(e) {\n\t\tvar ns = this.annotation;\n\t\tvar elements = helpers.elements(this);\n\t\tvar position = chartHelpers.getRelativePosition(e, this.chart);\n\t\tvar element = helpers.getNearestItems(elements, position);\n\t\tvar events = collapseHoverEvents(ns.options.events);\n\t\tvar dblClickSpeed = ns.options.dblClickSpeed;\n\t\tvar eventHandlers = [];\n\t\tvar eventHandlerName = helpers.getEventHandlerName(e.type);\n\t\tvar options = (element || {}).options;\n\n\t\t// Detect hover events\n\t\tif (e.type === 'mousemove') {\n\t\t\tif (element && !element.hovering) {\n\t\t\t\t// hover started\n\t\t\t\t['mouseenter', 'mouseover'].forEach(function(eventName) {\n\t\t\t\t\tvar eventHandlerName = helpers.getEventHandlerName(eventName);\n\t\t\t\t\tvar hoverEvent = helpers.createMouseEvent(eventName, e); // recreate the event to match the handler\n\t\t\t\t\telement.hovering = true;\n\t\t\t\t\tif (typeof options[eventHandlerName] === 'function') {\n\t\t\t\t\t\teventHandlers.push([ options[eventHandlerName], hoverEvent, element ]);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else if (!element) {\n\t\t\t\t// hover ended\n\t\t\t\telements.forEach(function(element) {\n\t\t\t\t\tif (element.hovering) {\n\t\t\t\t\t\telement.hovering = false;\n\t\t\t\t\t\tvar options = element.options;\n\t\t\t\t\t\t['mouseout', 'mouseleave'].forEach(function(eventName) {\n\t\t\t\t\t\t\tvar eventHandlerName = helpers.getEventHandlerName(eventName);\n\t\t\t\t\t\t\tvar hoverEvent = helpers.createMouseEvent(eventName, e); // recreate the event to match the handler\n\t\t\t\t\t\t\tif (typeof options[eventHandlerName] === 'function') {\n\t\t\t\t\t\t\t\teventHandlers.push([ options[eventHandlerName], hoverEvent, element ]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Suppress duplicate click events during a double click\n\t\t// 1. click -> 2. click -> 3. dblclick\n\t\t//\n\t\t// 1: wait dblClickSpeed ms, then fire click\n\t\t// 2: cancel (1) if it is waiting then wait dblClickSpeed ms then fire click, else fire click immediately\n\t\t// 3: cancel (1) or (2) if waiting, then fire dblclick \n\t\tif (element && events.indexOf('dblclick') > -1 && typeof options.onDblclick === 'function') {\n\t\t\tif (e.type === 'click' && typeof options.onClick === 'function') {\n\t\t\t\tclearTimeout(element.clickTimeout);\n\t\t\t\telement.clickTimeout = setTimeout(function() {\n\t\t\t\t\tdelete element.clickTimeout;\n\t\t\t\t\toptions.onClick.call(element, e);\n\t\t\t\t}, dblClickSpeed);\n\t\t\t\te.stopImmediatePropagation();\n\t\t\t\te.preventDefault();\n\t\t\t\treturn;\n\t\t\t} else if (e.type === 'dblclick' && element.clickTimeout) {\n\t\t\t\tclearTimeout(element.clickTimeout);\n\t\t\t\tdelete element.clickTimeout;\n\t\t\t}\n\t\t}\n\n\t\t// Dispatch the event to the usual handler, but only if we haven't substituted it\n\t\tif (element && typeof options[eventHandlerName] === 'function' && eventHandlers.length === 0) {\n\t\t\teventHandlers.push([ options[eventHandlerName], e, element ]);\n\t\t}\n\n\t\tif (eventHandlers.length > 0) {\n\t\t\te.stopImmediatePropagation();\n\t\t\te.preventDefault();\n\t\t\teventHandlers.forEach(function(eventHandler) {\n\t\t\t\t// [handler, event, element]\n\t\t\t\teventHandler[0].call(eventHandler[2], eventHandler[1]);\n\t\t\t});\n\t\t}\n\t}\n\n\treturn {\n\t\tdispatcher: dispatcher,\n\t\tcollapseHoverEvents: collapseHoverEvents\n\t};\n};\n","function noop() {}\n\nfunction elements(chartInstance) {\n\t// Turn the elements object into an array of elements\n\tvar elements = chartInstance.annotation.elements;\n\treturn Object.keys(elements).map(function(id) {\n\t\treturn elements[id];\n\t});\n}\n\nfunction objectId() {\n\treturn Math.random().toString(36).substr(2, 6);\n}\n\nfunction isValid(rawValue) {\n\tif (rawValue === null || typeof rawValue === 'undefined') {\n\t\treturn false;\n\t} else if (typeof rawValue === 'number') {\n\t\treturn isFinite(rawValue);\n\t} else {\n\t\treturn !!rawValue;\n\t}\n}\n\nfunction decorate(obj, prop, func) {\n\tvar prefix = '$';\n\tif (!obj[prefix + prop]) {\n\t\tif (obj[prop]) {\n\t\t\tobj[prefix + prop] = obj[prop].bind(obj);\n\t\t\tobj[prop] = function() {\n\t\t\t\tvar args = [ obj[prefix + prop] ].concat(Array.prototype.slice.call(arguments));\n\t\t\t\treturn func.apply(obj, args);\n\t\t\t};\n\t\t} else {\n\t\t\tobj[prop] = function() {\n\t\t\t\tvar args = [ undefined ].concat(Array.prototype.slice.call(arguments));\n\t\t\t\treturn func.apply(obj, args);\n\t\t\t};\n\t\t}\n\t}\n}\n\nfunction callEach(fns, method) {\n\tfns.forEach(function(fn) {\n\t\t(method ? fn[method] : fn)();\n\t});\n}\n\nfunction getEventHandlerName(eventName) {\n\treturn 'on' + eventName[0].toUpperCase() + eventName.substring(1);\n}\n\nfunction createMouseEvent(type, previousEvent) {\n\ttry {\n\t\treturn new MouseEvent(type, previousEvent);\n\t} catch (exception) {\n\t\ttry {\n\t\t\tvar m = document.createEvent('MouseEvent');\n\t\t\tm.initMouseEvent(\n\t\t\t\ttype,\n\t\t\t\tpreviousEvent.canBubble,\n\t\t\t\tpreviousEvent.cancelable,\n\t\t\t\tpreviousEvent.view,\n\t\t\t\tpreviousEvent.detail,\n\t\t\t\tpreviousEvent.screenX,\n\t\t\t\tpreviousEvent.screenY,\n\t\t\t\tpreviousEvent.clientX,\n\t\t\t\tpreviousEvent.clientY,\n\t\t\t\tpreviousEvent.ctrlKey,\n\t\t\t\tpreviousEvent.altKey,\n\t\t\t\tpreviousEvent.shiftKey,\n\t\t\t\tpreviousEvent.metaKey,\n\t\t\t\tpreviousEvent.button,\n\t\t\t\tpreviousEvent.relatedTarget\n\t\t\t);\n\t\t\treturn m;\n\t\t} catch (exception2) {\n\t\t\tvar e = document.createEvent('Event');\n\t\t\te.initEvent(\n\t\t\t\ttype,\n\t\t\t\tpreviousEvent.canBubble,\n\t\t\t\tpreviousEvent.cancelable\n\t\t\t);\n\t\t\treturn e;\n\t\t}\n\t}\n}\n\nmodule.exports = function(Chart) {\n\tvar chartHelpers = Chart.helpers;\n\n\tfunction initConfig(config) {\n\t\tconfig = chartHelpers.configMerge(Chart.Annotation.defaults, config);\n\t\tif (chartHelpers.isArray(config.annotations)) {\n\t\t\tconfig.annotations.forEach(function(annotation) {\n\t\t\t\tannotation.label = chartHelpers.configMerge(Chart.Annotation.labelDefaults, annotation.label);\n\t\t\t});\n\t\t}\n\t\treturn config;\n\t}\n\n\tfunction getScaleLimits(scaleId, annotations, scaleMin, scaleMax) {\n\t\tvar ranges = annotations.filter(function(annotation) {\n\t\t\treturn !!annotation._model.ranges[scaleId];\n\t\t}).map(function(annotation) {\n\t\t\treturn annotation._model.ranges[scaleId];\n\t\t});\n\n\t\tvar min = ranges.map(function(range) {\n\t\t\treturn Number(range.min);\n\t\t}).reduce(function(a, b) {\n\t\t\treturn isFinite(b) && !isNaN(b) && b < a ? b : a;\n\t\t}, scaleMin);\n\n\t\tvar max = ranges.map(function(range) {\n\t\t\treturn Number(range.max);\n\t\t}).reduce(function(a, b) {\n\t\t\treturn isFinite(b) && !isNaN(b) && b > a ? b : a;\n\t\t}, scaleMax);\n\n\t\treturn {\n\t\t\tmin: min,\n\t\t\tmax: max\n\t\t};\n\t}\n\n\tfunction adjustScaleRange(scale) {\n\t\t// Adjust the scale range to include annotation values\n\t\tvar range = getScaleLimits(scale.id, elements(scale.chart), scale.min, scale.max);\n\t\tif (typeof scale.options.ticks.min === 'undefined' && typeof scale.options.ticks.suggestedMin === 'undefined') {\n\t\t\tscale.min = range.min;\n\t\t}\n\t\tif (typeof scale.options.ticks.max === 'undefined' && typeof scale.options.ticks.suggestedMax === 'undefined') {\n\t\t\tscale.max = range.max;\n\t\t}\n\t\tif (scale.handleTickRangeOptions) {\n\t\t\tscale.handleTickRangeOptions();\n\t\t}\n\t}\n\n\tfunction getNearestItems(annotations, position) {\n\t\tvar minDistance = Number.POSITIVE_INFINITY;\n\n\t\treturn annotations\n\t\t\t.filter(function(element) {\n\t\t\t\treturn element.inRange(position.x, position.y);\n\t\t\t})\n\t\t\t.reduce(function(nearestItems, element) {\n\t\t\t\tvar center = element.getCenterPoint();\n\t\t\t\tvar distance = chartHelpers.distanceBetweenPoints(position, center);\n\n\t\t\t\tif (distance < minDistance) {\n\t\t\t\t\tnearestItems = [element];\n\t\t\t\t\tminDistance = distance;\n\t\t\t\t} else if (distance === minDistance) {\n\t\t\t\t\t// Can have multiple items at the same distance in which case we sort by size\n\t\t\t\t\tnearestItems.push(element);\n\t\t\t\t}\n\n\t\t\t\treturn nearestItems;\n\t\t\t}, [])\n\t\t\t.sort(function(a, b) {\n\t\t\t\t// If there are multiple elements equally close,\n\t\t\t\t// sort them by size, then by index\n\t\t\t\tvar sizeA = a.getArea(), sizeB = b.getArea();\n\t\t\t\treturn (sizeA > sizeB || sizeA < sizeB) ? sizeA - sizeB : a._index - b._index;\n\t\t\t})\n\t\t\t.slice(0, 1)[0]; // return only the top item\n\t}\n\n\treturn {\n\t\tinitConfig: initConfig,\n\t\telements: elements,\n\t\tcallEach: callEach,\n\t\tnoop: noop,\n\t\tobjectId: objectId,\n\t\tisValid: isValid,\n\t\tdecorate: decorate,\n\t\tadjustScaleRange: adjustScaleRange,\n\t\tgetNearestItems: getNearestItems,\n\t\tgetEventHandlerName: getEventHandlerName,\n\t\tcreateMouseEvent: createMouseEvent\n\t};\n};\n\n"],"sourceRoot":""}