!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var n=e();for(var r in n)("object"==typeof exports?exports:t)[r]=n[r]}}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=214)}([function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){var r=n(94),i=n(55);t.exports=function(t,e){return null!=t&&i(t,e,r)}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){var r=n(57),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,n){var r=n(29),i=n(86),o=n(14);t.exports=function(t){return t&&t.length?r(t,o,i):void 0}},function(t,e,n){var r=n(7),i=n(4);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==r(t)}},function(t,e,n){var r=n(12),i=n(96),o=n(97),s=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":s&&s in Object(t)?i(t):o(t)}},function(t,e,n){var r=n(104),i=n(107);t.exports=function(t,e){var n=i(t,e);return r(n)?n:void 0}},function(t,e,n){var r=n(34),i=n(38);t.exports=function(t){return null!=t&&i(t.length)&&!r(t)}},function(t,e,n){var r=n(123);t.exports=function(t){return r(t,5)}},function(t,e,n){var r=n(29),i=n(81),o=n(14);t.exports=function(t){return t&&t.length?r(t,o,i):void 0}},function(t,e,n){var r=n(3).Symbol;t.exports=r},function(t,e,n){var r=n(63),i=n(134),o=n(9);t.exports=function(t){return o(t)?r(t):i(t)}},function(t,e){t.exports=function(t){return t}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,n){var r=n(61),i=n(40);t.exports=function(t,e,n,o){var s=!n;n||(n={});for(var a=-1,c=e.length;++a-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991}},function(t,e,n){var r=n(56),i=n(24);t.exports=function(t,e){for(var n=0,o=(e=r(e,t)).length;null!=t&&n1&&s(t,e[0],e[1])?e=[]:n>2&&s(e[0],e[1],e[2])&&(e=[e[0]]),i(t,r(e,1),[])}));t.exports=a},function(t,e,n){var r=n(56),i=n(23),o=n(0),s=n(37),a=n(38),c=n(24);t.exports=function(t,e,n){for(var u=-1,f=(e=r(e,t)).length,l=!1;++uf))return!1;var h=c.get(t),p=c.get(e);if(h&&p)return h==e&&p==t;var v=-1,d=!0,y=2&n?new r:void 0;for(c.set(t,e),c.set(e,t);++ve}},function(t,e,n){var r=n(157),i=n(158);"string"==typeof(i=i.__esModule?i.default:i)&&(i=[[t.i,i,""]]);var o,s=0,a={injectType:"lazyStyleTag",insert:"head",singleton:!1},c={};c.locals=i.locals||{},c.use=function(){return s++||(o=r(i,a)),c},c.unuse=function(){s>0&&!--s&&(o(),o=null)},t.exports=c},function(t,e,n){var r=n(172),i=n(9),o=n(176),s=n(177),a=n(179),c=Math.max;t.exports=function(t,e,n,u){t=i(t)?t:a(t),n=n&&!u?s(n):0;var f=t.length;return n<0&&(n=c(f+n,0)),o(t)?n<=f&&t.indexOf(e,n)>-1:!!f&&r(t,e,n)>-1}},function(t,e,n){t.exports=n(181)},function(t,e){t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},function(t,e,n){var r=n(201)((function(t,e){return t+e}),0);t.exports=r},function(t,e,n){var r=n(59);t.exports=function(){var t=arguments,e=r(t[0]);return t.length<3?e:e.replace(t[1],t[2])}},function(t,e,n){var r=n(2),i=n(213),o=n(80),s=Math.max,a=Math.min;t.exports=function(t,e,n){var c,u,f,l,h,p,v=0,d=!1,y=!1,b=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function x(e){var n=c,r=u;return c=u=void 0,v=e,l=t.apply(r,n)}function g(t){return v=t,h=setTimeout(O,e),d?x(t):l}function m(t){var n=t-p;return void 0===p||n>=e||n<0||y&&t-v>=f}function O(){var t=i();if(m(t))return j(t);h=setTimeout(O,function(t){var n=e-(t-p);return y?a(n,f-(t-v)):n}(t))}function j(t){return h=void 0,b&&c?x(t):(c=u=void 0,l)}function A(){var t=i(),n=m(t);if(c=arguments,u=this,p=t,n){if(void 0===h)return g(p);if(y)return clearTimeout(h),h=setTimeout(O,e),x(p)}return void 0===h&&(h=setTimeout(O,e)),l}return e=o(e)||0,r(n)&&(d=!!n.leading,f=(y="maxWait"in n)?s(o(n.maxWait)||0,e):f,b="trailing"in n?!!n.trailing:b),A.cancel=function(){void 0!==h&&clearTimeout(h),v=0,c=p=u=h=void 0},A.flush=function(){return void 0===h?l:j(i())},A}},function(t,e){var n=Object.prototype.hasOwnProperty;t.exports=function(t,e){return null!=t&&n.call(t,e)}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r=n(12),i=Object.prototype,o=i.hasOwnProperty,s=i.toString,a=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,a),n=t[a];try{t[a]=void 0;var r=!0}catch(t){}var i=s.call(t);return r&&(e?t[a]=n:delete t[a]),i}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var r=n(99),i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,s=r((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(i,(function(t,n,r,i){e.push(r?i.replace(o,"$1"):n||t)})),e}));t.exports=s},function(t,e,n){var r=n(100);t.exports=function(t){var e=r(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}},function(t,e,n){var r=n(33);function i(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(i.Cache||r),n}i.Cache=r,t.exports=i},function(t,e,n){var r=n(102),i=n(20),o=n(35);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},function(t,e,n){var r=n(103),i=n(108),o=n(109),s=n(110),a=n(111);function c(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1}},function(t,e,n){var r=n(21);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},function(t,e,n){var r=n(22);t.exports=function(t){var e=r(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,n){var r=n(22);t.exports=function(t){return r(this,t).get(t)}},function(t,e,n){var r=n(22);t.exports=function(t){return r(this,t).has(t)}},function(t,e,n){var r=n(22);t.exports=function(t,e){var n=r(this,t),i=n.size;return n.set(t,e),this.size+=n.size==i?0:1,this}},function(t,e,n){var r=n(7),i=n(4);t.exports=function(t){return i(t)&&"[object Arguments]"==r(t)}},function(t,e,n){var r=n(25),i=n(129),o=n(61),s=n(130),a=n(136),c=n(65),u=n(66),f=n(139),l=n(141),h=n(69),p=n(142),v=n(28),d=n(147),y=n(148),b=n(73),x=n(0),g=n(26),m=n(153),O=n(2),j=n(155),A=n(13),_=n(17),S={};S["[object Arguments]"]=S["[object Array]"]=S["[object ArrayBuffer]"]=S["[object DataView]"]=S["[object Boolean]"]=S["[object Date]"]=S["[object Float32Array]"]=S["[object Float64Array]"]=S["[object Int8Array]"]=S["[object Int16Array]"]=S["[object Int32Array]"]=S["[object Map]"]=S["[object Number]"]=S["[object Object]"]=S["[object RegExp]"]=S["[object Set]"]=S["[object String]"]=S["[object Symbol]"]=S["[object Uint8Array]"]=S["[object Uint8ClampedArray]"]=S["[object Uint16Array]"]=S["[object Uint32Array]"]=!0,S["[object Error]"]=S["[object Function]"]=S["[object WeakMap]"]=!1,t.exports=function t(e,n,C,E,w,k){var T,R=1&n,F=2&n,M=4&n;if(C&&(T=w?C(e,E,w,k):C(e)),void 0!==T)return T;if(!O(e))return e;var I=x(e);if(I){if(T=d(e),!R)return u(e,T)}else{var P=v(e),z="[object Function]"==P||"[object GeneratorFunction]"==P;if(g(e))return c(e,R);if("[object Object]"==P||"[object Arguments]"==P||z&&!w){if(T=F||z?{}:b(e),!R)return F?l(e,a(T,e)):f(e,s(T,e))}else{if(!S[P])return w?e:{};T=y(e,P,R)}}k||(k=new r);var V=k.get(e);if(V)return V;k.set(e,T),j(e)?e.forEach((function(r){T.add(t(r,n,C,r,e,k))})):m(e)&&e.forEach((function(r,i){T.set(i,t(r,n,C,i,e,k))}));var L=I?void 0:(M?F?p:h:F?_:A)(e);return i(L||e,(function(r,i){L&&(r=e[i=r]),o(T,i,t(r,n,C,i,e,k))})),T}},function(t,e,n){var r=n(20);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(20),i=n(35),o=n(33);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!i||s.length<199)return s.push([t,e]),this.size=++n.size,this;n=this.__data__=new o(s)}return n.set(t,e),this.size=n.size,this}},function(t,e){t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length;++n0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var r=n(75),i=n(2);t.exports=function t(e,n,o,s,a,c){return i(e)&&i(n)&&(c.set(n,e),r(e,n,void 0,t,c),c.delete(n)),e}},function(t,e){t.exports=function(t){return function(e,n,r){for(var i=-1,o=Object(e),s=r(e),a=s.length;a--;){var c=s[t?a:++i];if(!1===n(o[c],c,o))break}return e}}},function(t,e,n){var r=n(76),i=n(65),o=n(72),s=n(66),a=n(73),c=n(23),u=n(0),f=n(168),l=n(26),h=n(34),p=n(2),v=n(169),d=n(42),y=n(78),b=n(170);t.exports=function(t,e,n,x,g,m,O){var j=y(t,n),A=y(e,n),_=O.get(A);if(_)r(t,n,_);else{var S=m?m(j,A,n+"",t,e,O):void 0,C=void 0===S;if(C){var E=u(A),w=!E&&l(A),k=!E&&!w&&d(A);S=A,E||w||k?u(j)?S=j:f(j)?S=s(j):w?(C=!1,S=i(A,!0)):k?(C=!1,S=o(A,!0)):S=[]:v(A)||c(A)?(S=j,c(j)?S=b(j):p(j)&&!h(j)||(S=a(A))):C=!1}C&&(O.set(A,S),g(S,A,x,m,O),O.delete(A)),r(t,n,S)}}},function(t,e,n){var r=n(9),i=n(4);t.exports=function(t){return i(t)&&r(t)}},function(t,e,n){var r=n(7),i=n(47),o=n(4),s=Function.prototype,a=Object.prototype,c=s.toString,u=a.hasOwnProperty,f=c.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=r(t))return!1;var e=i(t);if(null===e)return!0;var n=u.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&c.call(n)==f}},function(t,e,n){var r=n(16),i=n(17);t.exports=function(t){return r(t,i(t))}},function(t,e,n){var r=n(49),i=n(79);t.exports=function(t){return r((function(e,n){var r=-1,o=n.length,s=o>1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(s=t.length>3&&"function"==typeof s?(o--,s):void 0,a&&i(n[0],n[1],a)&&(s=o<3?void 0:s,o=1),e=Object(e);++r0&&o(f)?n>1?t(f,n-1,o,s,a):r(a,f):s||(a[a.length]=f)}return a}},function(t,e,n){var r=n(12),i=n(23),o=n(0),s=r?r.isConcatSpreadable:void 0;t.exports=function(t){return o(t)||i(t)||!!(s&&t&&t[s])}},function(t,e,n){var r=n(36),i=n(39),o=n(50),s=n(206),a=n(210),c=n(27),u=n(211),f=n(14),l=n(0);t.exports=function(t,e,n){e=e.length?r(e,(function(t){return l(t)?function(e){return i(e,1===t.length?t[0]:t)}:t})):[f];var h=-1;e=r(e,c(o));var p=s(t,(function(t,n,i){return{criteria:r(e,(function(e){return e(t)})),index:++h,value:t}}));return a(p,(function(t,e){return u(t,e,n)}))}},function(t,e,n){var r=n(207),i=n(9);t.exports=function(t,e){var n=-1,o=i(t)?Array(t.length):[];return r(t,(function(t,r,i){o[++n]=e(t,r,i)})),o}},function(t,e,n){var r=n(208),i=n(209)(r);t.exports=i},function(t,e,n){var r=n(77),i=n(13);t.exports=function(t,e){return t&&r(t,e,i)}},function(t,e,n){var r=n(9);t.exports=function(t,e){return function(n,i){if(null==n)return n;if(!r(n))return t(n,i);for(var o=n.length,s=e?o:-1,a=Object(n);(e?s--:++s=c?u:u*("desc"==n[i]?-1:1)}return t.index-e.index}},function(t,e,n){var r=n(6);t.exports=function(t,e){if(t!==e){var n=void 0!==t,i=null===t,o=t==t,s=r(t),a=void 0!==e,c=null===e,u=e==e,f=r(e);if(!c&&!f&&!s&&t>e||s&&a&&u&&!c&&!f||i&&a&&u||!n&&u||!o)return 1;if(!i&&!s&&!f&&t0)for(var e=this.chartContainer.append("g").attr("class","legend-row"),n=function(n){if(w()(r.seriesTargetsWithBounds,r.series[n].target))return"continue";var i=0;null!==e.selectAll("text").node()&&(i=e.node().getBBox().width+25);var o=!1!==r.series[n].visible;e.append("foreignObject").attr("x",i).attr("y",r.legendRowPositionY-12).attr("width",13).attr("height",15).html("
").on("click",(function(){t.options.eventsCallbacks.onLegendClick(n)})),e.append("text").attr("x",i+20).attr("y",r.legendRowPositionY).attr("class","metric-legend-"+n).style("font-size","12px").style("fill",r.getSerieColor(n)).text(r.series[n].target).on("click",(function(){t.options.eventsCallbacks.onLegendLabelClick(n)}))},r=this,i=0;i.9*this.height)return;this.state.yValueRange=[l[0]-f*h,l[1]-f*h];var p=this.state.transform.y+f*u;this.state.transform={y:p};break;default:throw new Error("Unknown type of scroll pan orientation: "+r)}},t.prototype.onPanningEnd=function(){this.isPanning=!1,this.deltaYTransform=0,this.onMouseOut(),void 0!==this.options.eventsCallbacks&&void 0!==this.options.eventsCallbacks.panningEnd?this.options.eventsCallbacks.panningEnd([this.state.xValueRange,this.state.yValueRange,this.state.y1ValueRange]):console.log("on panning end, but there is no callback")},t.prototype.onBrush=function(){var t=this.d3.event.selection;if(this.options.zoomEvents.mouse.zoom.orientation===o.SQUARE&&null!==t){var e=this.getSelectionAttrs(t);void 0!==e&&this.chartContainer.select(".selection").attr("x",e.x).attr("y",e.y).attr("width",e.width).attr("height",e.height)}},t.prototype.getSelectionAttrs=function(t){if(null!==this.brushStartSelection&&null!=t){var e=this.brushStartSelection[0],n=this.brushStartSelection[1],r=t[0][0],i=t[1][0],o=t[0][1],s=i-r,a=t[1][1]-o,c=Math.min(s,a);return{x:r===e?e:e-c,y:o===n?n:n-c,width:c,height:c}}},t.prototype.onBrushStart=function(){this.isBrushing;var t=this.d3.event.selection;null!==t&&t.length>0&&(this.brushStartSelection=this.d3.event.selection[0]),this.onMouseOut()},t.prototype.onBrushEnd=function(){var t=this.d3.event.selection;if(this.isBrushing,!(null==t||t.length<2)){var e,n;switch(this.chartContainer.call(this.brush.move,null),this.options.zoomEvents.mouse.zoom.orientation){case o.HORIZONTAL:var r=this.xScale.invert(t[0]),i=this.xScale.invert(t[1]);if(Math.abs(i-r)0&&this.series[0].datapoints.length>1?this.series[0].datapoints[1][1]-this.series[0].datapoints[0][1]:void 0!==this.options.timeInterval&&void 0!==this.options.timeInterval.count?6e4*this.options.timeInterval.count:6e4},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xTickTransform",{get:function(){if(void 0===this.options.tickFormat||void 0===this.options.tickFormat.xTickOrientation)return"";switch(this.options.tickFormat.xTickOrientation){case r.VERTICAL:return"translate(-10px, 50px) rotate(-90deg)";case r.HORIZONTAL:return"";case r.DIAGONAL:return"translate(-30px, 30px) rotate(-45deg)";default:return""}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"extraMargin",{get:function(){var t={top:0,right:0,bottom:0,left:0};if(void 0!==this.options.tickFormat&&void 0!==this.options.tickFormat.xTickOrientation)switch(this.options.tickFormat.xTickOrientation){case r.VERTICAL:t.bottom+=80;break;case r.HORIZONTAL:break;case r.DIAGONAL:t.left+=15,t.bottom+=50,t.right+=10}return void 0!==this.options.labelFormat&&(void 0!==this.options.labelFormat.xAxis&&this.options.labelFormat.xAxis.length>0&&(t.bottom+=20),void 0!==this.options.labelFormat.yAxis&&this.options.labelFormat.yAxis.length>0&&(t.left+=20)),this.series.length>0&&(t.bottom+=25),t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.d3Node.node().clientWidth-this.margin.left-this.margin.right},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.d3Node.node().clientHeight-this.margin.top-this.margin.bottom},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"legendRowPositionY",{get:function(){return this.height+this.margin.bottom-5},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"margin",{get:function(){return void 0!==this.options.margin?this.options.margin:I()({},J,this.extraMargin,$.a)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSeriesUnavailable",{get:function(){return void 0===this.series||0===this.series.length||0===N()(this.series.map((function(t){return t.datapoints.length})))},enumerable:!1,configurable:!0}),t.prototype.formatedBound=function(t,e){return X()(t,"$__metric_name",e)},t.prototype.clearScaleCache=function(t){void 0===t&&(t=!0),this._xScale=null,this._yScale=null,this._y1Scale=null,t&&(this.state.xValueRange=void 0,this.state.yValueRange=void 0,this.state.y1ValueRange=void 0,this.state.transform={x:0,y:0,k:1})},t.prototype.getSerieColor=function(t){if(void 0===this.series[t])throw new Error("Can't get color for unexisting serie: "+t+", there are only "+this.series.length+" series");var e=this.series[t].color;return void 0===e&&(e=_[t%_.length]),e},Object.defineProperty(t.prototype,"seriesTargetsWithBounds",{get:function(){var t=this;if(void 0===this.options.bounds||void 0===this.options.bounds.upper||void 0===this.options.bounds.lower)return[];var e=[];return this.series.forEach((function(n){e.push(t.formatedBound(t.options.bounds.upper,n.target)),e.push(t.formatedBound(t.options.bounds.lower,n.target))})),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"visibleSeries",{get:function(){return this.series.filter((function(t){return!1!==t.visible}))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rectClipId",{get:function(){return 0===this._clipPathUID.length&&(this._clipPathUID=Math.random().toString(36).substr(2,12)),this._clipPathUID},enumerable:!1,configurable:!0}),t.prototype.isOutOfChart=function(){var t=this.d3.mouse(this.chartContainer.node()),e=t[0],n=t[1];return n>this.height+1||n<-1||e>this.width||e<0},t}()}])}));