/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ function webpackJsonpCallback(data) {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/ var executeModules = data[2];
/******/
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [];
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ resolves.push(installedChunks[chunkId][0]);
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/ for(moduleId in moreModules) {
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
/******/ modules[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(parentJsonpFunction) parentJsonpFunction(data);
/******/
/******/ while(resolves.length) {
/******/ resolves.shift()();
/******/ }
/******/
/******/ // add entry modules from loaded chunk to deferred list
/******/ deferredModules.push.apply(deferredModules, executeModules || []);
/******/
/******/ // run deferred modules when all chunks ready
/******/ return checkDeferredModules();
/******/ };
/******/ function checkDeferredModules() {
/******/ var result;
/******/ for(var i = 0; i < deferredModules.length; i++) {
/******/ var deferredModule = deferredModules[i];
/******/ var fulfilled = true;
/******/ for(var j = 1; j < deferredModule.length; j++) {
/******/ var depId = deferredModule[j];
/******/ if(installedChunks[depId] !== 0) fulfilled = false;
/******/ }
/******/ if(fulfilled) {
/******/ deferredModules.splice(i--, 1);
/******/ result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
/******/ }
/******/ }
/******/
/******/ return result;
/******/ }
/******/
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // Promise = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ "pages_common": 0
/******/ };
/******/
/******/ var deferredModules = [];
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ var jsonpArray = window["webpackJsonp"] = window["webpackJsonp"] || [];
/******/ var oldJsonpFunction = jsonpArray.push.bind(jsonpArray);
/******/ jsonpArray.push = webpackJsonpCallback;
/******/ jsonpArray = jsonpArray.slice();
/******/ for(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);
/******/ var parentJsonpFunction = oldJsonpFunction;
/******/
/******/
/******/ // run deferred modules from other chunks
/******/ checkDeferredModules();
/******/ })
/************************************************************************/
/******/ ({
/***/ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js":
/***/ (function(module, exports) {
function _assertThisInitialized(e) {
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return e;
}
module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/classCallCheck.js":
/***/ (function(module, exports) {
function _classCallCheck(a, n) {
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
}
module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/createClass.js":
/***/ (function(module, exports, __webpack_require__) {
var toPropertyKey = __webpack_require__("./node_modules/@babel/runtime/helpers/toPropertyKey.js");
function _defineProperties(e, r) {
for (var t = 0; t < r.length; t++) {
var o = r[t];
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
}
}
function _createClass(e, r, t) {
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
writable: !1
}), e;
}
module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/extends.js":
/***/ (function(module, exports) {
function _extends() {
return module.exports = _extends = Object.assign ? Object.assign.bind() : function (n) {
for (var e = 1; e < arguments.length; e++) {
var t = arguments[e];
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
}
return n;
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _extends.apply(null, arguments);
}
module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js":
/***/ (function(module, exports) {
function _getPrototypeOf(t) {
return module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
return t.__proto__ || Object.getPrototypeOf(t);
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _getPrototypeOf(t);
}
module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/inherits.js":
/***/ (function(module, exports, __webpack_require__) {
var setPrototypeOf = __webpack_require__("./node_modules/@babel/runtime/helpers/setPrototypeOf.js");
function _inherits(t, e) {
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
t.prototype = Object.create(e && e.prototype, {
constructor: {
value: t,
writable: !0,
configurable: !0
}
}), Object.defineProperty(t, "prototype", {
writable: !1
}), e && setPrototypeOf(t, e);
}
module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/objectWithoutProperties.js":
/***/ (function(module, exports, __webpack_require__) {
var objectWithoutPropertiesLoose = __webpack_require__("./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js");
function _objectWithoutProperties(e, t) {
if (null == e) return {};
var o,
r,
i = objectWithoutPropertiesLoose(e, t);
if (Object.getOwnPropertySymbols) {
var n = Object.getOwnPropertySymbols(e);
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
}
return i;
}
module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js":
/***/ (function(module, exports) {
function _objectWithoutPropertiesLoose(r, e) {
if (null == r) return {};
var t = {};
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
if (-1 !== e.indexOf(n)) continue;
t[n] = r[n];
}
return t;
}
module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js":
/***/ (function(module, exports, __webpack_require__) {
var _typeof = __webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js")["default"];
var assertThisInitialized = __webpack_require__("./node_modules/@babel/runtime/helpers/assertThisInitialized.js");
function _possibleConstructorReturn(t, e) {
if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
return assertThisInitialized(t);
}
module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/setPrototypeOf.js":
/***/ (function(module, exports) {
function _setPrototypeOf(t, e) {
return module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
return t.__proto__ = e, t;
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _setPrototypeOf(t, e);
}
module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/toPrimitive.js":
/***/ (function(module, exports, __webpack_require__) {
var _typeof = __webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js")["default"];
function toPrimitive(t, r) {
if ("object" != _typeof(t) || !t) return t;
var e = t[Symbol.toPrimitive];
if (void 0 !== e) {
var i = e.call(t, r || "default");
if ("object" != _typeof(i)) return i;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return ("string" === r ? String : Number)(t);
}
module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/toPropertyKey.js":
/***/ (function(module, exports, __webpack_require__) {
var _typeof = __webpack_require__("./node_modules/@babel/runtime/helpers/typeof.js")["default"];
var toPrimitive = __webpack_require__("./node_modules/@babel/runtime/helpers/toPrimitive.js");
function toPropertyKey(t) {
var i = toPrimitive(t, "string");
return "symbol" == _typeof(i) ? i : i + "";
}
module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/typeof.js":
/***/ (function(module, exports) {
function _typeof(o) {
"@babel/helpers - typeof";
return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
return typeof o;
} : function (o) {
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
}
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
/***/ }),
/***/ "./node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// CONCATENATED MODULE: ./node_modules/@emotion/memoize/dist/memoize.browser.esm.js
function memoize(fn) {
var cache = {};
return function (arg) {
if (cache[arg] === undefined) cache[arg] = fn(arg);
return cache[arg];
};
}
/* harmony default export */ var memoize_browser_esm = (memoize);
// CONCATENATED MODULE: ./node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
var index = memoize_browser_esm(function (prop) {
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
/* o */
&& prop.charCodeAt(1) === 110
/* n */
&& prop.charCodeAt(2) < 91;
}
/* Z+1 */
);
/* harmony default export */ var is_prop_valid_browser_esm = __webpack_exports__["a"] = (index);
/***/ }),
/***/ "./node_modules/@emotion/unitless/dist/unitless.browser.esm.js":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
var unitlessKeys = {
animationIterationCount: 1,
borderImageOutset: 1,
borderImageSlice: 1,
borderImageWidth: 1,
boxFlex: 1,
boxFlexGroup: 1,
boxOrdinalGroup: 1,
columnCount: 1,
columns: 1,
flex: 1,
flexGrow: 1,
flexPositive: 1,
flexShrink: 1,
flexNegative: 1,
flexOrder: 1,
gridRow: 1,
gridRowEnd: 1,
gridRowSpan: 1,
gridRowStart: 1,
gridColumn: 1,
gridColumnEnd: 1,
gridColumnSpan: 1,
gridColumnStart: 1,
msGridRow: 1,
msGridRowSpan: 1,
msGridColumn: 1,
msGridColumnSpan: 1,
fontWeight: 1,
lineHeight: 1,
opacity: 1,
order: 1,
orphans: 1,
tabSize: 1,
widows: 1,
zIndex: 1,
zoom: 1,
WebkitLineClamp: 1,
// SVG-related properties
fillOpacity: 1,
floodOpacity: 1,
stopOpacity: 1,
strokeDasharray: 1,
strokeDashoffset: 1,
strokeMiterlimit: 1,
strokeOpacity: 1,
strokeWidth: 1
};
/* harmony default export */ __webpack_exports__["a"] = (unitlessKeys);
/***/ }),
/***/ "./node_modules/@splunk/charting-utils/Formatter.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 51);
/******/ })
/************************************************************************/
/******/ ({
/***/ 0:
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/underscore/modules/index-all.js");
/***/ }),
/***/ 1:
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/jquery/dist/jquery.js");
/***/ }),
/***/ 51:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __webpack_require__(1);
var _jquery2 = _interopRequireDefault(_jquery);
var _underscore = __webpack_require__(0);
var _underscore2 = _interopRequireDefault(_underscore);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function Formatter(renderer) {
this.renderer = renderer;
this.ELLIPSIS = '...';
}
Formatter.prototype = {
ellipsize: function ellipsize(str, maxWidthInPixels, fontSize, css, ellipsisPlacement) {
if ((0, _underscore2.default)(str).isArray()) {
str = str.join(',');
}
str = _jquery2.default.trim(str);
var strLen = str.length;
if (!str || str === '') {
return '';
}
if (strLen <= 3 || !fontSize || isNaN(fontSize) || fontSize <= 0) {
return str;
}
if (!maxWidthInPixels || isNaN(maxWidthInPixels) || maxWidthInPixels <= 0) {
return this.ELLIPSIS;
}
var strWidth = this._predictLineWidth(str, fontSize, css);
var excessWidth = strWidth - maxWidthInPixels;
if (excessWidth > 0) {
var ellipsisWidth = this._predictLineWidth(this.ELLIPSIS, fontSize, css);
switch (ellipsisPlacement) {
case 'end':
return this.trimStringToWidth(str, maxWidthInPixels - ellipsisWidth, fontSize, css) + '...';
case 'start':
return '...' + this.reverseString(this.trimStringToWidth(this.reverseString(str), maxWidthInPixels - ellipsisWidth, fontSize, css));
default:
{
// default to middle ellipsization
var availableWidthPerSide = (maxWidthInPixels - ellipsisWidth) / 2;
var leftSide = this.trimStringToWidth(str, availableWidthPerSide, fontSize, css);
var rightSide = this.reverseString(this.trimStringToWidth(this.reverseString(str), availableWidthPerSide, fontSize, css));
return leftSide + '...' + rightSide;
}
}
} else {
// no need to ellipsize
return str;
}
},
// NOTE: it is up to caller to test that the entire string does not already fit
// even if it does, this method will do log N work and may or may not truncate the last character
trimStringToWidth: function trimStringToWidth(text, width, fontSize, css) {
var that = this;
var binaryFindEndIndex = function binaryFindEndIndex(start, end) {
var testIndex = void 0;
while (end > start + 1) {
testIndex = Math.floor((start + end) / 2);
if (that.predictTextWidth(text.substr(0, testIndex), fontSize, css) > width) {
end = testIndex;
} else {
start = testIndex;
}
}
return start;
};
var endIndex = binaryFindEndIndex(0, text.length);
return text.substr(0, endIndex);
},
reverseString: function reverseString(str) {
return str.split('').reverse().join('');
},
// Returns width of string in px units
predictTextWidth: function predictTextWidth(str, fontSize, css) {
if ((0, _underscore2.default)(str).isArray()) {
str = str.join(',');
}
if (!str || str === '' || !fontSize || isNaN(fontSize)) {
return 0;
}
// split lines by break tag, trimming leading and trailing whitespaces
var multilineArray = str.split(/\s*
\s*/);
var multilineArrayLen = multilineArray.length;
if (multilineArrayLen > 1) {
// if multiple lines are passed (
||
||
) then return width of widest line
var maxWidth = 0;
for (var i = 0; i < multilineArrayLen; i++) {
if (multilineArray[i] && multilineArray[i] !== '') {
var thisLineWidth = this._predictLineWidth(multilineArray[i], fontSize, css);
if (thisLineWidth > maxWidth) {
maxWidth = thisLineWidth;
}
}
}
return maxWidth;
}
// single line string
var width = this._predictLineWidth(_jquery2.default.trim(str), fontSize, css);
return width;
},
_predictLineWidth: function _predictLineWidth(str, fontSize, css) {
if (!str || !fontSize) {
return 0;
}
var bBox = this.getTextBBox(str, fontSize, css);
return bBox ? bBox.width : 0;
},
predictTextHeight: function predictTextHeight(text, fontSize, css) {
if ((0, _underscore2.default)(text).isArray()) {
text = text.join(',');
}
if (!fontSize || !text) {
return 0;
}
var bBox = this.getTextBBox(text, fontSize, css);
return bBox ? bBox.height : 0;
},
getTextBBox: function getTextBBox(text, fontSize, css) {
// fontSize is required; css is any other styling that determines size (italics, bold, etc.)
css = _jquery2.default.extend(css, {
fontSize: fontSize + 'px'
});
if (isNaN(parseFloat(fontSize, 10))) {
return undefined;
}
if (this.textPredicter) {
this.textPredicter.destroy();
}
this.textPredicter = this.renderer.text(text, 0, 0).attr({
visibility: 'hidden'
}).css(css).add();
return this.textPredicter.getBBox();
},
adjustLabels: function adjustLabels(originalLabels, width, minFont, maxFont, ellipsisMode) {
var i = void 0;
var fontSize = void 0;
var shouldEllipsize = void 0;
var labels = _jquery2.default.extend(true, [], originalLabels);
var maxWidths = this.getMaxWidthForFontRange(labels, minFont, maxFont);
// adjust font and try to fit longest
if (maxWidths[maxFont] <= width) {
shouldEllipsize = false;
fontSize = maxFont;
} else {
shouldEllipsize = true;
for (fontSize = maxFont - 1; fontSize > minFont; fontSize--) {
if (maxWidths[fontSize] <= width) {
shouldEllipsize = false;
break;
}
}
}
if (shouldEllipsize && ellipsisMode !== 'none') {
for (i = 0; i < labels.length; i++) {
labels[i] = this.ellipsize(labels[i], width, fontSize, {}, ellipsisMode);
}
}
return {
labels: labels,
fontSize: fontSize,
areEllipsized: shouldEllipsize,
longestWidth: maxWidths[fontSize]
};
},
getMaxWidthForFontRange: function getMaxWidthForFontRange(labels, minFont, maxFont) {
var longestLabelIndex = void 0;
var fontSizeToWidthMap = {};
// find the longest label
fontSizeToWidthMap[minFont] = 0;
for (var i = 0; i < labels.length; i++) {
var labelLength = this.predictTextWidth(labels[i] || '', minFont);
if (labelLength > fontSizeToWidthMap[minFont]) {
longestLabelIndex = i;
fontSizeToWidthMap[minFont] = labelLength;
}
}
// fill in the widths for the rest of the font sizes
for (var fontSize = minFont + 1; fontSize <= maxFont; fontSize++) {
fontSizeToWidthMap[fontSize] = this.predictTextWidth(labels[longestLabelIndex] || '', fontSize);
}
return fontSizeToWidthMap;
},
bBoxesOverlap: function bBoxesOverlap(bBox1, bBox2, marginX, marginY) {
marginX = marginX || 0;
marginY = marginY || 0;
var box1Left = bBox1.x - marginX;
var box2Left = bBox2.x - marginX;
var box1Right = bBox1.x + bBox1.width + 2 * marginX;
var box2Right = bBox2.x + bBox2.width + 2 * marginX;
var box1Top = bBox1.y - marginY;
var box2Top = bBox2.y - marginY;
var box1Bottom = bBox1.y + bBox1.height + 2 * marginY;
var box2Bottom = bBox2.y + bBox2.height + 2 * marginY;
return box1Left < box2Right && box1Right > box2Left && box1Top < box2Bottom && box1Bottom > box2Top;
},
destroy: function destroy() {
if (this.textPredicter) {
this.textPredicter.destroy();
this.textPredicter = false;
}
}
};
exports.default = Formatter;
module.exports = exports['default'];
/***/ })
/******/ });
/***/ }),
/***/ "./node_modules/@splunk/charting-utils/async.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 52);
/******/ })
/************************************************************************/
/******/ ({
/***/ 0:
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/underscore/modules/index-all.js");
/***/ }),
/***/ 1:
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/jquery/dist/jquery.js");
/***/ }),
/***/ 52:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __webpack_require__(1);
var _jquery2 = _interopRequireDefault(_jquery);
var _underscore = __webpack_require__(0);
var _underscore2 = _interopRequireDefault(_underscore);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/* eslint-disable func-names */
var asyncUtils = {};
asyncUtils.CANCELLED = 'cancelled';
// http://www.paulirish.com/2011/requestanimationframe-for-smart-animating
asyncUtils.requestFrame = (0, _underscore2.default)(function () {
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function (callback) {
window.setTimeout(callback, 50);
};
}()).bind(window);
asyncUtils.cancelFrame = (0, _underscore2.default)(function () {
return window.cancelAnimationFrame || window.mozCancelAnimationFrame ||
// SPL-76580, can't reference window.clearTimeout directly here, IE 7 and 8 might not have defined it yet
function (id) {
window.clearTimeout(id);
};
}()).bind(window);
asyncUtils.asyncEach = function (list, callback) {
var pendingOperation = void 0;
var cancelled = false;
var listLength = list.length;
var dfd = _jquery2.default.Deferred();
var callOnceAndWait = function callOnceAndWait(i) {
// the cancel() method will try to de-queue the frame, but this is not always supported
// so also logically cancel the work just to be safe
if (cancelled) {
return;
}
callback(list[i], i);
// check if we just processed the last item in the list
// if so, we're done, if not, queue up the next one
if (i < listLength - 1) {
pendingOperation = asyncUtils.requestFrame(function () {
callOnceAndWait(i + 1);
});
} else {
dfd.resolve();
}
};
dfd.cancel = function () {
cancelled = true;
if (pendingOperation) {
asyncUtils.cancelFrame(pendingOperation);
dfd.reject(asyncUtils.CANCELLED);
}
};
callOnceAndWait(0);
return dfd;
};
exports.default = asyncUtils;
module.exports = exports['default'];
/***/ })
/******/ });
/***/ }),
/***/ "./node_modules/@splunk/charting-utils/color.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 32);
/******/ })
/************************************************************************/
/******/ ({
/***/ 0:
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/underscore/modules/index-all.js");
/***/ }),
/***/ 1:
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/jquery/dist/jquery.js");
/***/ }),
/***/ 32:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.interpolateColors = exports.getComputedOpacity = exports.getLuminance = exports.addAlphaToColor = exports.hexFromColor = exports.normalizeColor = exports.stripOutAlpha = exports.colorFromHex = undefined;
var _jquery = __webpack_require__(1);
var _jquery2 = _interopRequireDefault(_jquery);
var _underscore = __webpack_require__(0);
var _underscore2 = _interopRequireDefault(_underscore);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// converts a hex number to its css-friendly counterpart, with optional alpha transparency field
// returns null if the input is cannot be parsed to a valid number or if the number is out of range
/* eslint-disable no-bitwise */
var colorFromHex = exports.colorFromHex = function colorFromHex(hexNum, alpha) {
if (typeof hexNum !== 'number') {
hexNum = parseInt(hexNum, 16);
}
if ((0, _underscore2.default)(hexNum).isNaN() || hexNum < 0x000000 || hexNum > 0xffffff) {
return null;
}
var r = (hexNum & 0xff0000) >> 16;
var g = (hexNum & 0x00ff00) >> 8;
var b = hexNum & 0x0000ff;
return alpha === undefined ? 'rgb(' + r + ',' + g + ',' + b + ')' : 'rgba(' + r + ',' + g + ',' + b + ',' + alpha + ')';
};
// converts an rgba value to rgb by stripping out the alpha. willl return the unchanged parameter
// if an rgb value is passed rather than rgba
var stripOutAlpha = exports.stripOutAlpha = function stripOutAlpha(color) {
var rgb = color.split(',');
var thirdChar = rgb[0].charAt(3);
if (thirdChar === 'a') {
rgb[0] = rgb[0].replace('rgba', 'rgb');
rgb[rgb.length - 1] = ')';
rgb = rgb.join();
rgb = rgb.replace(',)', ')');
return rgb;
}
return color;
};
/**
* Take an RGB value and convert to HEX equivalent.
*
* @param {String} rgb A RGB value following rgb(XXX, XXX, XXX) convention.
* @type String
* @return A HEX equivalent for a given RGB value with a leading '#' character.
*/
var getHEX = function getHEX(rgb) {
var parts = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
var hex = (parts[1] << 16 | parts[2] << 8 | parts[3]).toString(16);
return '#' + Array(6 - hex.length).concat([hex]).toString().replace(/,/g, 0);
};
/**
* Take an arbitrary RGB or HEX in long or shorthand notation and normalize to standard long HEX form with leading '#' character.
*
* @param {String} color A RGB or HEX color value in long or short notation.
* @type String or null
* @return A fully qualified 6 character hexadecimal value or with leading '#' character or null if it can't be processed.
*/
var normalizeColor = exports.normalizeColor = function normalizeColor(color) {
var normalizedColor = null;
if (typeof color === 'string' && color.charAt(0) === '#') {
if (color.length === 4) {
normalizedColor = color + color.charAt(1) + color.charAt(2) + color.charAt(3);
} else {
normalizedColor = color;
}
} else {
try {
normalizedColor = getHEX(color);
} catch (e) {} // eslint-disable-line no-empty
}
return normalizedColor;
};
// coverts a color string in either hex (must be long form) or rgb format into its corresponding hex number
// returns zero if the color string can't be parsed as either format
// TODO: either add support for short form or emit an error
var hexFromColor = exports.hexFromColor = function hexFromColor(color) {
var normalizedColor = normalizeColor(color);
return normalizedColor ? parseInt(normalizedColor.replace('#', '0x'), 16) : 0;
};
// given a color string (in long-form hex or rgb form) or a hex number,
// formats the color as an rgba string with the given alpha transparency
// TODO: currently fails somewhat silently if an un-parseable or out-of-range input is given
var addAlphaToColor = exports.addAlphaToColor = function addAlphaToColor(color, alpha) {
var colorAsHex = typeof color === 'number' ? color : hexFromColor(color);
return colorFromHex(colorAsHex, alpha);
};
// calculate the luminance of a color based on its hex value
// returns zero if the input is cannot be parsed to a valid number or if the number is out of range
// equation for luminance found at http://en.wikipedia.org/wiki/Luma_(video)
var getLuminance = exports.getLuminance = function getLuminance(hexNum) {
if (typeof hexNum !== 'number') {
hexNum = parseInt(hexNum, 16);
}
if (isNaN(hexNum) || hexNum < 0x000000 || hexNum > 0xffffff) {
return 0;
}
var r = (hexNum & 0xff0000) >> 16;
var g = (hexNum & 0x00ff00) >> 8;
var b = hexNum & 0x0000ff;
return Math.round(0.2126 * r + 0.7152 * g + 0.0722 * b);
};
// compute the user-visible fill opacity of an SVG element
// an opacity defined as part of the 'fill' color with rgba(...) syntax will take precedence over the 'fill-opacity'
var getComputedOpacity = exports.getComputedOpacity = function getComputedOpacity(element) {
var fill = _jquery2.default.trim(element.attr('fill'));
var enforceValidOpacity = function enforceValidOpacity(opacityStr) {
var parsed = parseFloat(opacityStr);
return parsed >= 0 && parsed <= 1 ? parsed : 1;
};
if (!/^rgba/.test(fill)) {
return enforceValidOpacity(element.attr('fill-opacity'));
}
var rgba = fill.match(/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/);
return rgba && rgba.length > 4 ? enforceValidOpacity(rgba[4]) : 1;
};
var interpolateColors = exports.interpolateColors = function interpolateColors(color1, color2, p) {
var r1 = color1 >> 16 & 0xff;
var g1 = color1 >> 8 & 0xff;
var b1 = color1 & 0xff;
var r2 = color2 >> 16 & 0xff;
var g2 = color2 >> 8 & 0xff;
var b2 = color2 & 0xff;
var rInterp = r1 + Math.round((r2 - r1) * p);
var gInterp = g1 + Math.round((g2 - g1) * p);
var bInterp = b1 + Math.round((b2 - b1) * p);
return rInterp << 16 | gInterp << 8 | bInterp;
};
/***/ })
/******/ });
/***/ }),
/***/ "./node_modules/@splunk/charting-utils/dom.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 53);
/******/ })
/************************************************************************/
/******/ ({
/***/ 1:
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/jquery/dist/jquery.js");
/***/ }),
/***/ 53:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.showTickLabel = exports.hideTickLabel = exports.setLegendItemText = undefined;
var _jquery = __webpack_require__(1);
var _jquery2 = _interopRequireDefault(_jquery);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// a cross-renderer way to update a legend item's text content
var setLegendItemText = exports.setLegendItemText = function setLegendItemText(legendItem, text) {
if (legendItem.attr('text') === text) {
return;
}
legendItem.added = true; // the SVG renderer needs this
legendItem.attr({ text: text });
};
var hideTickLabel = exports.hideTickLabel = function hideTickLabel(tick) {
var label = tick.label;
var nodeName = tick.label.element.nodeName.toLowerCase();
if (nodeName === 'text') {
label.hide();
} else {
(0, _jquery2.default)(label.element).css('display', 'none');
}
};
var showTickLabel = exports.showTickLabel = function showTickLabel(tick) {
var label = tick.label;
var nodeName = tick.label.element.nodeName.toLowerCase();
if (nodeName === 'text') {
label.show();
} else {
(0, _jquery2.default)(label.element).css('display', '');
}
};
/***/ })
/******/ });
/***/ }),
/***/ "./node_modules/@splunk/charting-utils/field.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 54);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/underscore/modules/index-all.js");
/***/ }),
/* 1 */,
/* 2 */
/***/ (function(module, exports) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
? window : typeof self != 'undefined' && self.Math == Math ? self
// eslint-disable-next-line no-new-func
: Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
/***/ }),
/* 3 */
/***/ (function(module, exports) {
module.exports = function (it) {
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
// Thank's IE8 for his funny defineProperty
module.exports = !__webpack_require__(9)(function () {
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/* 5 */
/***/ (function(module, exports) {
var core = module.exports = { version: '2.6.12' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(7);
var createDesc = __webpack_require__(26);
module.exports = __webpack_require__(4) ? function (object, key, value) {
return dP.f(object, key, createDesc(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(13);
var IE8_DOM_DEFINE = __webpack_require__(34);
var toPrimitive = __webpack_require__(35);
var dP = Object.defineProperty;
exports.f = __webpack_require__(4) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
anObject(O);
P = toPrimitive(P, true);
anObject(Attributes);
if (IE8_DOM_DEFINE) try {
return dP(O, P, Attributes);
} catch (e) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {
var store = __webpack_require__(28)('wks');
var uid = __webpack_require__(21);
var Symbol = __webpack_require__(2).Symbol;
var USE_SYMBOL = typeof Symbol == 'function';
var $exports = module.exports = function (name) {
return store[name] || (store[name] =
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
};
$exports.store = store;
/***/ }),
/* 9 */
/***/ (function(module, exports) {
module.exports = function (exec) {
try {
return !!exec();
} catch (e) {
return true;
}
};
/***/ }),
/* 10 */
/***/ (function(module, exports) {
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function (it, key) {
return hasOwnProperty.call(it, key);
};
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(2);
var core = __webpack_require__(5);
var ctx = __webpack_require__(12);
var hide = __webpack_require__(6);
var has = __webpack_require__(10);
var PROTOTYPE = 'prototype';
var $export = function (type, name, source) {
var IS_FORCED = type & $export.F;
var IS_GLOBAL = type & $export.G;
var IS_STATIC = type & $export.S;
var IS_PROTO = type & $export.P;
var IS_BIND = type & $export.B;
var IS_WRAP = type & $export.W;
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
var expProto = exports[PROTOTYPE];
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
var key, own, out;
if (IS_GLOBAL) source = name;
for (key in source) {
// contains in native
own = !IS_FORCED && target && target[key] !== undefined;
if (own && has(exports, key)) continue;
// export native or passed
out = own ? target[key] : source[key];
// prevent global pollution for namespaces
exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
// bind timers to global for call from export context
: IS_BIND && own ? ctx(out, global)
// wrap global constructors for prevent change them in library
: IS_WRAP && target[key] == out ? (function (C) {
var F = function (a, b, c) {
if (this instanceof C) {
switch (arguments.length) {
case 0: return new C();
case 1: return new C(a);
case 2: return new C(a, b);
} return new C(a, b, c);
} return C.apply(this, arguments);
};
F[PROTOTYPE] = C[PROTOTYPE];
return F;
// make static versions for prototype methods
})(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
// export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
if (IS_PROTO) {
(exports.virtual || (exports.virtual = {}))[key] = out;
// export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
}
}
};
// type bitmap
$export.F = 1; // forced
$export.G = 2; // global
$export.S = 4; // static
$export.P = 8; // proto
$export.B = 16; // bind
$export.W = 32; // wrap
$export.U = 64; // safe
$export.R = 128; // real proto method for `library`
module.exports = $export;
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
// optional / simple context binding
var aFunction = __webpack_require__(24);
module.exports = function (fn, that, length) {
aFunction(fn);
if (that === undefined) return fn;
switch (length) {
case 1: return function (a) {
return fn.call(that, a);
};
case 2: return function (a, b) {
return fn.call(that, a, b);
};
case 3: return function (a, b, c) {
return fn.call(that, a, b, c);
};
}
return function (/* ...args */) {
return fn.apply(that, arguments);
};
};
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(3);
module.exports = function (it) {
if (!isObject(it)) throw TypeError(it + ' is not an object!');
return it;
};
/***/ }),
/* 14 */
/***/ (function(module, exports) {
// 7.1.4 ToInteger
var ceil = Math.ceil;
var floor = Math.floor;
module.exports = function (it) {
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};
/***/ }),
/* 15 */
/***/ (function(module, exports) {
// 7.2.1 RequireObjectCoercible(argument)
module.exports = function (it) {
if (it == undefined) throw TypeError("Can't call method on " + it);
return it;
};
/***/ }),
/* 16 */
/***/ (function(module, exports, __webpack_require__) {
// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = __webpack_require__(27);
var defined = __webpack_require__(15);
module.exports = function (it) {
return IObject(defined(it));
};
/***/ }),
/* 17 */
/***/ (function(module, exports) {
module.exports = {};
/***/ }),
/* 18 */
/***/ (function(module, exports) {
var toString = {}.toString;
module.exports = function (it) {
return toString.call(it).slice(8, -1);
};
/***/ }),
/* 19 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.15 ToLength
var toInteger = __webpack_require__(14);
var min = Math.min;
module.exports = function (it) {
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
};
/***/ }),
/* 20 */
/***/ (function(module, exports, __webpack_require__) {
var shared = __webpack_require__(28)('keys');
var uid = __webpack_require__(21);
module.exports = function (key) {
return shared[key] || (shared[key] = uid(key));
};
/***/ }),
/* 21 */
/***/ (function(module, exports) {
var id = 0;
var px = Math.random();
module.exports = function (key) {
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};
/***/ }),
/* 22 */,
/* 23 */
/***/ (function(module, exports) {
module.exports = true;
/***/ }),
/* 24 */
/***/ (function(module, exports) {
module.exports = function (it) {
if (typeof it != 'function') throw TypeError(it + ' is not a function!');
return it;
};
/***/ }),
/* 25 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(3);
var document = __webpack_require__(2).document;
// typeof document.createElement is 'object' in old IE
var is = isObject(document) && isObject(document.createElement);
module.exports = function (it) {
return is ? document.createElement(it) : {};
};
/***/ }),
/* 26 */
/***/ (function(module, exports) {
module.exports = function (bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
/***/ }),
/* 27 */
/***/ (function(module, exports, __webpack_require__) {
// fallback for non-array-like ES3 and non-enumerable old V8 strings
var cof = __webpack_require__(18);
// eslint-disable-next-line no-prototype-builtins
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
return cof(it) == 'String' ? it.split('') : Object(it);
};
/***/ }),
/* 28 */
/***/ (function(module, exports, __webpack_require__) {
var core = __webpack_require__(5);
var global = __webpack_require__(2);
var SHARED = '__core-js_shared__';
var store = global[SHARED] || (global[SHARED] = {});
(module.exports = function (key, value) {
return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
version: core.version,
mode: __webpack_require__(23) ? 'pure' : 'global',
copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
});
/***/ }),
/* 29 */
/***/ (function(module, exports) {
// IE 8- don't enum bug keys
module.exports = (
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
).split(',');
/***/ }),
/* 30 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.13 ToObject(argument)
var defined = __webpack_require__(15);
module.exports = function (it) {
return Object(defined(it));
};
/***/ }),
/* 31 */
/***/ (function(module, exports, __webpack_require__) {
var ctx = __webpack_require__(12);
var call = __webpack_require__(70);
var isArrayIter = __webpack_require__(71);
var anObject = __webpack_require__(13);
var toLength = __webpack_require__(19);
var getIterFn = __webpack_require__(72);
var BREAK = {};
var RETURN = {};
var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
var f = ctx(fn, that, entries ? 2 : 1);
var index = 0;
var length, step, iterator, result;
if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
// fast case for arrays with default iterator
if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
if (result === BREAK || result === RETURN) return result;
} else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
result = call(iterator, f, step.value, entries);
if (result === BREAK || result === RETURN) return result;
}
};
exports.BREAK = BREAK;
exports.RETURN = RETURN;
/***/ }),
/* 32 */,
/* 33 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var LIBRARY = __webpack_require__(23);
var $export = __webpack_require__(11);
var redefine = __webpack_require__(60);
var hide = __webpack_require__(6);
var Iterators = __webpack_require__(17);
var $iterCreate = __webpack_require__(61);
var setToStringTag = __webpack_require__(40);
var getPrototypeOf = __webpack_require__(64);
var ITERATOR = __webpack_require__(8)('iterator');
var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
var FF_ITERATOR = '@@iterator';
var KEYS = 'keys';
var VALUES = 'values';
var returnThis = function () { return this; };
module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
$iterCreate(Constructor, NAME, next);
var getMethod = function (kind) {
if (!BUGGY && kind in proto) return proto[kind];
switch (kind) {
case KEYS: return function keys() { return new Constructor(this, kind); };
case VALUES: return function values() { return new Constructor(this, kind); };
} return function entries() { return new Constructor(this, kind); };
};
var TAG = NAME + ' Iterator';
var DEF_VALUES = DEFAULT == VALUES;
var VALUES_BUG = false;
var proto = Base.prototype;
var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
var $default = $native || getMethod(DEFAULT);
var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
var methods, key, IteratorPrototype;
// Fix native
if ($anyNative) {
IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
// Set @@toStringTag to native iterators
setToStringTag(IteratorPrototype, TAG, true);
// fix for some old engines
if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
}
}
// fix Array#{values, @@iterator}.name in V8 / FF
if (DEF_VALUES && $native && $native.name !== VALUES) {
VALUES_BUG = true;
$default = function values() { return $native.call(this); };
}
// Define iterator
if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
hide(proto, ITERATOR, $default);
}
// Plug for library
Iterators[NAME] = $default;
Iterators[TAG] = returnThis;
if (DEFAULT) {
methods = {
values: DEF_VALUES ? $default : getMethod(VALUES),
keys: IS_SET ? $default : getMethod(KEYS),
entries: $entries
};
if (FORCED) for (key in methods) {
if (!(key in proto)) redefine(proto, key, methods[key]);
} else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
}
return methods;
};
/***/ }),
/* 34 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = !__webpack_require__(4) && !__webpack_require__(9)(function () {
return Object.defineProperty(__webpack_require__(25)('div'), 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/* 35 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.1 ToPrimitive(input [, PreferredType])
var isObject = __webpack_require__(3);
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
module.exports = function (it, S) {
if (!isObject(it)) return it;
var fn, val;
if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
throw TypeError("Can't convert object to primitive value");
};
/***/ }),
/* 36 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var $keys = __webpack_require__(37);
var enumBugKeys = __webpack_require__(29);
module.exports = Object.keys || function keys(O) {
return $keys(O, enumBugKeys);
};
/***/ }),
/* 37 */
/***/ (function(module, exports, __webpack_require__) {
var has = __webpack_require__(10);
var toIObject = __webpack_require__(16);
var arrayIndexOf = __webpack_require__(38)(false);
var IE_PROTO = __webpack_require__(20)('IE_PROTO');
module.exports = function (object, names) {
var O = toIObject(object);
var i = 0;
var result = [];
var key;
for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
// Don't enum bug & hidden keys
while (names.length > i) if (has(O, key = names[i++])) {
~arrayIndexOf(result, key) || result.push(key);
}
return result;
};
/***/ }),
/* 38 */
/***/ (function(module, exports, __webpack_require__) {
// false -> Array#indexOf
// true -> Array#includes
var toIObject = __webpack_require__(16);
var toLength = __webpack_require__(19);
var toAbsoluteIndex = __webpack_require__(39);
module.exports = function (IS_INCLUDES) {
return function ($this, el, fromIndex) {
var O = toIObject($this);
var length = toLength(O.length);
var index = toAbsoluteIndex(fromIndex, length);
var value;
// Array#includes uses SameValueZero equality algorithm
// eslint-disable-next-line no-self-compare
if (IS_INCLUDES && el != el) while (length > index) {
value = O[index++];
// eslint-disable-next-line no-self-compare
if (value != value) return true;
// Array#indexOf ignores holes, Array#includes - not
} else for (;length > index; index++) if (IS_INCLUDES || index in O) {
if (O[index] === el) return IS_INCLUDES || index || 0;
} return !IS_INCLUDES && -1;
};
};
/***/ }),
/* 39 */
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(14);
var max = Math.max;
var min = Math.min;
module.exports = function (index, length) {
index = toInteger(index);
return index < 0 ? max(index + length, 0) : min(index, length);
};
/***/ }),
/* 40 */
/***/ (function(module, exports, __webpack_require__) {
var def = __webpack_require__(7).f;
var has = __webpack_require__(10);
var TAG = __webpack_require__(8)('toStringTag');
module.exports = function (it, tag, stat) {
if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
};
/***/ }),
/* 41 */,
/* 42 */,
/* 43 */,
/* 44 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
var anObject = __webpack_require__(13);
var dPs = __webpack_require__(62);
var enumBugKeys = __webpack_require__(29);
var IE_PROTO = __webpack_require__(20)('IE_PROTO');
var Empty = function () { /* empty */ };
var PROTOTYPE = 'prototype';
// Create object with fake `null` prototype: use iframe Object with cleared prototype
var createDict = function () {
// Thrash, waste and sodomy: IE GC bug
var iframe = __webpack_require__(25)('iframe');
var i = enumBugKeys.length;
var lt = '<';
var gt = '>';
var iframeDocument;
iframe.style.display = 'none';
__webpack_require__(63).appendChild(iframe);
iframe.src = 'javascript:'; // eslint-disable-line no-script-url
// createDict = iframe.contentWindow.Object;
// html.removeChild(iframe);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
iframeDocument.close();
createDict = iframeDocument.F;
while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
return createDict();
};
module.exports = Object.create || function create(O, Properties) {
var result;
if (O !== null) {
Empty[PROTOTYPE] = anObject(O);
result = new Empty();
Empty[PROTOTYPE] = null;
// add "__proto__" for Object.getPrototypeOf polyfill
result[IE_PROTO] = O;
} else result = createDict();
return Properties === undefined ? result : dPs(result, Properties);
};
/***/ }),
/* 45 */
/***/ (function(module, exports) {
module.exports = function (done, value) {
return { value: value, done: !!done };
};
/***/ }),
/* 46 */
/***/ (function(module, exports, __webpack_require__) {
var hide = __webpack_require__(6);
module.exports = function (target, src, safe) {
for (var key in src) {
if (safe && target[key]) target[key] = src[key];
else hide(target, key, src[key]);
} return target;
};
/***/ }),
/* 47 */
/***/ (function(module, exports) {
module.exports = function (it, Constructor, name, forbiddenField) {
if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
throw TypeError(name + ': incorrect invocation!');
} return it;
};
/***/ }),
/* 48 */
/***/ (function(module, exports, __webpack_require__) {
// getting tag from 19.1.3.6 Object.prototype.toString()
var cof = __webpack_require__(18);
var TAG = __webpack_require__(8)('toStringTag');
// ES3 wrong here
var ARG = cof(function () { return arguments; }()) == 'Arguments';
// fallback for IE11 Script Access Denied error
var tryGet = function (it, key) {
try {
return it[key];
} catch (e) { /* empty */ }
};
module.exports = function (it) {
var O, T, B;
return it === undefined ? 'Undefined' : it === null ? 'Null'
// @@toStringTag case
: typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
// builtinTag case
: ARG ? cof(O)
// ES3 arguments fallback
: (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
};
/***/ }),
/* 49 */
/***/ (function(module, exports, __webpack_require__) {
var META = __webpack_require__(21)('meta');
var isObject = __webpack_require__(3);
var has = __webpack_require__(10);
var setDesc = __webpack_require__(7).f;
var id = 0;
var isExtensible = Object.isExtensible || function () {
return true;
};
var FREEZE = !__webpack_require__(9)(function () {
return isExtensible(Object.preventExtensions({}));
});
var setMeta = function (it) {
setDesc(it, META, { value: {
i: 'O' + ++id, // object ID
w: {} // weak collections IDs
} });
};
var fastKey = function (it, create) {
// return primitive with prefix
if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
if (!has(it, META)) {
// can't set metadata to uncaught frozen object
if (!isExtensible(it)) return 'F';
// not necessary to add metadata
if (!create) return 'E';
// add missing metadata
setMeta(it);
// return object ID
} return it[META].i;
};
var getWeak = function (it, create) {
if (!has(it, META)) {
// can't set metadata to uncaught frozen object
if (!isExtensible(it)) return true;
// not necessary to add metadata
if (!create) return false;
// add missing metadata
setMeta(it);
// return hash weak collections IDs
} return it[META].w;
};
// add metadata on freeze-family methods calling
var onFreeze = function (it) {
if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
return it;
};
var meta = module.exports = {
KEY: META,
NEED: false,
fastKey: fastKey,
getWeak: getWeak,
onFreeze: onFreeze
};
/***/ }),
/* 50 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(3);
module.exports = function (it, TYPE) {
if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
return it;
};
/***/ }),
/* 51 */,
/* 52 */,
/* 53 */,
/* 54 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isOutlierField = exports.getOutlierFields = exports.isOutlierDataSet = exports.getRangeSeriesConfig = exports.isRangeSeriesDataSet = undefined;
var _set = __webpack_require__(55);
var _set2 = _interopRequireDefault(_set);
var _underscore = __webpack_require__(0);
var _underscore2 = _interopRequireDefault(_underscore);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var isRangeSeriesDataSet = exports.isRangeSeriesDataSet = function isRangeSeriesDataSet(dataSet) {
var allFields = dataSet.allFields();
return (0, _underscore2.default)(allFields).any(function (f) {
return (/^_predicted/.test(f)
);
}) && (0, _underscore2.default)(allFields).any(function (f) {
return (/^_lower/.test(f)
);
}) && (0, _underscore2.default)(allFields).any(function (f) {
return (/^_upper/.test(f)
);
});
};
var getRangeSeriesConfig = exports.getRangeSeriesConfig = function getRangeSeriesConfig(dataSet) {
var predictedFields = (0, _underscore2.default)(dataSet.allFields()).filter(function (f) {
return (/^_predicted/.test(f)
);
});
return (0, _underscore2.default)(predictedFields).map(function (predictedField) {
var sourceField = predictedField.replace(/^_predicted/, '');
var lowerField = '_lower' + sourceField;
var upperField = '_upper' + sourceField;
var predictedName = (0, _underscore2.default)(dataSet.getSeries(predictedField)).find(function (value) {
return !!value;
});
var lowerName = (0, _underscore2.default)(dataSet.getSeries(lowerField)).find(function (value) {
return !!value;
});
var upperName = (0, _underscore2.default)(dataSet.getSeries(upperField)).find(function (value) {
return !!value;
});
return {
predicted: predictedName,
lower: lowerName,
upper: upperName
};
});
};
var isOutlierDataSet = exports.isOutlierDataSet = function isOutlierDataSet(dataSet) {
var allFields = dataSet.allFields();
return (0, _underscore2.default)(allFields).any(function (f) {
return (/^isOutlier/.test(f)
);
}) && (0, _underscore2.default)(allFields).any(function (f) {
return (/^lowerBound/.test(f)
);
}) && (0, _underscore2.default)(allFields).any(function (f) {
return (/^upperBound/.test(f)
);
});
};
var getOutlierFields = exports.getOutlierFields = function getOutlierFields(dataSet) {
var actualField = (0, _underscore2.default)(dataSet.allFields()).filter(function (f) {
return !/^isOutlier/.test(f) && !/^lowerBound/.test(f) && !/^upperBound/.test(f) && !/^_time/.test(f);
});
return {
lower: 'lowerBound',
upper: 'upperBound',
isOutlier: 'isOutlier',
actual: '' + actualField
};
};
var isOutlierField = exports.isOutlierField = function isOutlierField(fieldName) {
var outlierFields = new _set2.default(['lowerBound', 'upperBound', 'isOutlier']);
return outlierFields.has(fieldName);
};
/***/ }),
/* 55 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(56), __esModule: true };
/***/ }),
/* 56 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(57);
__webpack_require__(58);
__webpack_require__(65);
__webpack_require__(68);
__webpack_require__(79);
__webpack_require__(82);
__webpack_require__(84);
module.exports = __webpack_require__(5).Set;
/***/ }),
/* 57 */
/***/ (function(module, exports) {
/***/ }),
/* 58 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var $at = __webpack_require__(59)(true);
// 21.1.3.27 String.prototype[@@iterator]()
__webpack_require__(33)(String, 'String', function (iterated) {
this._t = String(iterated); // target
this._i = 0; // next index
// 21.1.5.2.1 %StringIteratorPrototype%.next()
}, function () {
var O = this._t;
var index = this._i;
var point;
if (index >= O.length) return { value: undefined, done: true };
point = $at(O, index);
this._i += point.length;
return { value: point, done: false };
});
/***/ }),
/* 59 */
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(14);
var defined = __webpack_require__(15);
// true -> String#at
// false -> String#codePointAt
module.exports = function (TO_STRING) {
return function (that, pos) {
var s = String(defined(that));
var i = toInteger(pos);
var l = s.length;
var a, b;
if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
a = s.charCodeAt(i);
return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
? TO_STRING ? s.charAt(i) : a
: TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
};
};
/***/ }),
/* 60 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = __webpack_require__(6);
/***/ }),
/* 61 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var create = __webpack_require__(44);
var descriptor = __webpack_require__(26);
var setToStringTag = __webpack_require__(40);
var IteratorPrototype = {};
// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
__webpack_require__(6)(IteratorPrototype, __webpack_require__(8)('iterator'), function () { return this; });
module.exports = function (Constructor, NAME, next) {
Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
setToStringTag(Constructor, NAME + ' Iterator');
};
/***/ }),
/* 62 */
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(7);
var anObject = __webpack_require__(13);
var getKeys = __webpack_require__(36);
module.exports = __webpack_require__(4) ? Object.defineProperties : function defineProperties(O, Properties) {
anObject(O);
var keys = getKeys(Properties);
var length = keys.length;
var i = 0;
var P;
while (length > i) dP.f(O, P = keys[i++], Properties[P]);
return O;
};
/***/ }),
/* 63 */
/***/ (function(module, exports, __webpack_require__) {
var document = __webpack_require__(2).document;
module.exports = document && document.documentElement;
/***/ }),
/* 64 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
var has = __webpack_require__(10);
var toObject = __webpack_require__(30);
var IE_PROTO = __webpack_require__(20)('IE_PROTO');
var ObjectProto = Object.prototype;
module.exports = Object.getPrototypeOf || function (O) {
O = toObject(O);
if (has(O, IE_PROTO)) return O[IE_PROTO];
if (typeof O.constructor == 'function' && O instanceof O.constructor) {
return O.constructor.prototype;
} return O instanceof Object ? ObjectProto : null;
};
/***/ }),
/* 65 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(66);
var global = __webpack_require__(2);
var hide = __webpack_require__(6);
var Iterators = __webpack_require__(17);
var TO_STRING_TAG = __webpack_require__(8)('toStringTag');
var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +
'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +
'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +
'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +
'TextTrackList,TouchList').split(',');
for (var i = 0; i < DOMIterables.length; i++) {
var NAME = DOMIterables[i];
var Collection = global[NAME];
var proto = Collection && Collection.prototype;
if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
Iterators[NAME] = Iterators.Array;
}
/***/ }),
/* 66 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var addToUnscopables = __webpack_require__(67);
var step = __webpack_require__(45);
var Iterators = __webpack_require__(17);
var toIObject = __webpack_require__(16);
// 22.1.3.4 Array.prototype.entries()
// 22.1.3.13 Array.prototype.keys()
// 22.1.3.29 Array.prototype.values()
// 22.1.3.30 Array.prototype[@@iterator]()
module.exports = __webpack_require__(33)(Array, 'Array', function (iterated, kind) {
this._t = toIObject(iterated); // target
this._i = 0; // next index
this._k = kind; // kind
// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
}, function () {
var O = this._t;
var kind = this._k;
var index = this._i++;
if (!O || index >= O.length) {
this._t = undefined;
return step(1);
}
if (kind == 'keys') return step(0, index);
if (kind == 'values') return step(0, O[index]);
return step(0, [index, O[index]]);
}, 'values');
// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
Iterators.Arguments = Iterators.Array;
addToUnscopables('keys');
addToUnscopables('values');
addToUnscopables('entries');
/***/ }),
/* 67 */
/***/ (function(module, exports) {
module.exports = function () { /* empty */ };
/***/ }),
/* 68 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var strong = __webpack_require__(69);
var validate = __webpack_require__(50);
var SET = 'Set';
// 23.2 Set Objects
module.exports = __webpack_require__(74)(SET, function (get) {
return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
}, {
// 23.2.3.1 Set.prototype.add(value)
add: function add(value) {
return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);
}
}, strong);
/***/ }),
/* 69 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var dP = __webpack_require__(7).f;
var create = __webpack_require__(44);
var redefineAll = __webpack_require__(46);
var ctx = __webpack_require__(12);
var anInstance = __webpack_require__(47);
var forOf = __webpack_require__(31);
var $iterDefine = __webpack_require__(33);
var step = __webpack_require__(45);
var setSpecies = __webpack_require__(73);
var DESCRIPTORS = __webpack_require__(4);
var fastKey = __webpack_require__(49).fastKey;
var validate = __webpack_require__(50);
var SIZE = DESCRIPTORS ? '_s' : 'size';
var getEntry = function (that, key) {
// fast case
var index = fastKey(key);
var entry;
if (index !== 'F') return that._i[index];
// frozen object case
for (entry = that._f; entry; entry = entry.n) {
if (entry.k == key) return entry;
}
};
module.exports = {
getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
var C = wrapper(function (that, iterable) {
anInstance(that, C, NAME, '_i');
that._t = NAME; // collection type
that._i = create(null); // index
that._f = undefined; // first entry
that._l = undefined; // last entry
that[SIZE] = 0; // size
if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
});
redefineAll(C.prototype, {
// 23.1.3.1 Map.prototype.clear()
// 23.2.3.2 Set.prototype.clear()
clear: function clear() {
for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {
entry.r = true;
if (entry.p) entry.p = entry.p.n = undefined;
delete data[entry.i];
}
that._f = that._l = undefined;
that[SIZE] = 0;
},
// 23.1.3.3 Map.prototype.delete(key)
// 23.2.3.4 Set.prototype.delete(value)
'delete': function (key) {
var that = validate(this, NAME);
var entry = getEntry(that, key);
if (entry) {
var next = entry.n;
var prev = entry.p;
delete that._i[entry.i];
entry.r = true;
if (prev) prev.n = next;
if (next) next.p = prev;
if (that._f == entry) that._f = next;
if (that._l == entry) that._l = prev;
that[SIZE]--;
} return !!entry;
},
// 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
// 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
forEach: function forEach(callbackfn /* , that = undefined */) {
validate(this, NAME);
var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
var entry;
while (entry = entry ? entry.n : this._f) {
f(entry.v, entry.k, this);
// revert to the last existing entry
while (entry && entry.r) entry = entry.p;
}
},
// 23.1.3.7 Map.prototype.has(key)
// 23.2.3.7 Set.prototype.has(value)
has: function has(key) {
return !!getEntry(validate(this, NAME), key);
}
});
if (DESCRIPTORS) dP(C.prototype, 'size', {
get: function () {
return validate(this, NAME)[SIZE];
}
});
return C;
},
def: function (that, key, value) {
var entry = getEntry(that, key);
var prev, index;
// change existing entry
if (entry) {
entry.v = value;
// create new entry
} else {
that._l = entry = {
i: index = fastKey(key, true), // <- index
k: key, // <- key
v: value, // <- value
p: prev = that._l, // <- previous entry
n: undefined, // <- next entry
r: false // <- removed
};
if (!that._f) that._f = entry;
if (prev) prev.n = entry;
that[SIZE]++;
// add to index
if (index !== 'F') that._i[index] = entry;
} return that;
},
getEntry: getEntry,
setStrong: function (C, NAME, IS_MAP) {
// add .keys, .values, .entries, [@@iterator]
// 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
$iterDefine(C, NAME, function (iterated, kind) {
this._t = validate(iterated, NAME); // target
this._k = kind; // kind
this._l = undefined; // previous
}, function () {
var that = this;
var kind = that._k;
var entry = that._l;
// revert to the last existing entry
while (entry && entry.r) entry = entry.p;
// get next entry
if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
// or finish the iteration
that._t = undefined;
return step(1);
}
// return step by kind
if (kind == 'keys') return step(0, entry.k);
if (kind == 'values') return step(0, entry.v);
return step(0, [entry.k, entry.v]);
}, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
// add [@@species], 23.1.2.2, 23.2.2.2
setSpecies(NAME);
}
};
/***/ }),
/* 70 */
/***/ (function(module, exports, __webpack_require__) {
// call something on iterator step with safe closing on error
var anObject = __webpack_require__(13);
module.exports = function (iterator, fn, value, entries) {
try {
return entries ? fn(anObject(value)[0], value[1]) : fn(value);
// 7.4.6 IteratorClose(iterator, completion)
} catch (e) {
var ret = iterator['return'];
if (ret !== undefined) anObject(ret.call(iterator));
throw e;
}
};
/***/ }),
/* 71 */
/***/ (function(module, exports, __webpack_require__) {
// check on default Array iterator
var Iterators = __webpack_require__(17);
var ITERATOR = __webpack_require__(8)('iterator');
var ArrayProto = Array.prototype;
module.exports = function (it) {
return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
};
/***/ }),
/* 72 */
/***/ (function(module, exports, __webpack_require__) {
var classof = __webpack_require__(48);
var ITERATOR = __webpack_require__(8)('iterator');
var Iterators = __webpack_require__(17);
module.exports = __webpack_require__(5).getIteratorMethod = function (it) {
if (it != undefined) return it[ITERATOR]
|| it['@@iterator']
|| Iterators[classof(it)];
};
/***/ }),
/* 73 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var global = __webpack_require__(2);
var core = __webpack_require__(5);
var dP = __webpack_require__(7);
var DESCRIPTORS = __webpack_require__(4);
var SPECIES = __webpack_require__(8)('species');
module.exports = function (KEY) {
var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];
if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {
configurable: true,
get: function () { return this; }
});
};
/***/ }),
/* 74 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var global = __webpack_require__(2);
var $export = __webpack_require__(11);
var meta = __webpack_require__(49);
var fails = __webpack_require__(9);
var hide = __webpack_require__(6);
var redefineAll = __webpack_require__(46);
var forOf = __webpack_require__(31);
var anInstance = __webpack_require__(47);
var isObject = __webpack_require__(3);
var setToStringTag = __webpack_require__(40);
var dP = __webpack_require__(7).f;
var each = __webpack_require__(75)(0);
var DESCRIPTORS = __webpack_require__(4);
module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
var Base = global[NAME];
var C = Base;
var ADDER = IS_MAP ? 'set' : 'add';
var proto = C && C.prototype;
var O = {};
if (!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {
new C().entries().next();
}))) {
// create collection constructor
C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
redefineAll(C.prototype, methods);
meta.NEED = true;
} else {
C = wrapper(function (target, iterable) {
anInstance(target, C, NAME, '_c');
target._c = new Base();
if (iterable != undefined) forOf(iterable, IS_MAP, target[ADDER], target);
});
each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) {
var IS_ADDER = KEY == 'add' || KEY == 'set';
if (KEY in proto && !(IS_WEAK && KEY == 'clear')) hide(C.prototype, KEY, function (a, b) {
anInstance(this, C, KEY);
if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;
var result = this._c[KEY](a === 0 ? 0 : a, b);
return IS_ADDER ? this : result;
});
});
IS_WEAK || dP(C.prototype, 'size', {
get: function () {
return this._c.size;
}
});
}
setToStringTag(C, NAME);
O[NAME] = C;
$export($export.G + $export.W + $export.F, O);
if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
return C;
};
/***/ }),
/* 75 */
/***/ (function(module, exports, __webpack_require__) {
// 0 -> Array#forEach
// 1 -> Array#map
// 2 -> Array#filter
// 3 -> Array#some
// 4 -> Array#every
// 5 -> Array#find
// 6 -> Array#findIndex
var ctx = __webpack_require__(12);
var IObject = __webpack_require__(27);
var toObject = __webpack_require__(30);
var toLength = __webpack_require__(19);
var asc = __webpack_require__(76);
module.exports = function (TYPE, $create) {
var IS_MAP = TYPE == 1;
var IS_FILTER = TYPE == 2;
var IS_SOME = TYPE == 3;
var IS_EVERY = TYPE == 4;
var IS_FIND_INDEX = TYPE == 6;
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
var create = $create || asc;
return function ($this, callbackfn, that) {
var O = toObject($this);
var self = IObject(O);
var f = ctx(callbackfn, that, 3);
var length = toLength(self.length);
var index = 0;
var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
var val, res;
for (;length > index; index++) if (NO_HOLES || index in self) {
val = self[index];
res = f(val, index, O);
if (TYPE) {
if (IS_MAP) result[index] = res; // map
else if (res) switch (TYPE) {
case 3: return true; // some
case 5: return val; // find
case 6: return index; // findIndex
case 2: result.push(val); // filter
} else if (IS_EVERY) return false; // every
}
}
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
};
};
/***/ }),
/* 76 */
/***/ (function(module, exports, __webpack_require__) {
// 9.4.2.3 ArraySpeciesCreate(originalArray, length)
var speciesConstructor = __webpack_require__(77);
module.exports = function (original, length) {
return new (speciesConstructor(original))(length);
};
/***/ }),
/* 77 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(3);
var isArray = __webpack_require__(78);
var SPECIES = __webpack_require__(8)('species');
module.exports = function (original) {
var C;
if (isArray(original)) {
C = original.constructor;
// cross-realm fallback
if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
if (isObject(C)) {
C = C[SPECIES];
if (C === null) C = undefined;
}
} return C === undefined ? Array : C;
};
/***/ }),
/* 78 */
/***/ (function(module, exports, __webpack_require__) {
// 7.2.2 IsArray(argument)
var cof = __webpack_require__(18);
module.exports = Array.isArray || function isArray(arg) {
return cof(arg) == 'Array';
};
/***/ }),
/* 79 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/DavidBruant/Map-Set.prototype.toJSON
var $export = __webpack_require__(11);
$export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(80)('Set') });
/***/ }),
/* 80 */
/***/ (function(module, exports, __webpack_require__) {
// https://github.com/DavidBruant/Map-Set.prototype.toJSON
var classof = __webpack_require__(48);
var from = __webpack_require__(81);
module.exports = function (NAME) {
return function toJSON() {
if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic");
return from(this);
};
};
/***/ }),
/* 81 */
/***/ (function(module, exports, __webpack_require__) {
var forOf = __webpack_require__(31);
module.exports = function (iter, ITERATOR) {
var result = [];
forOf(iter, false, result.push, result, ITERATOR);
return result;
};
/***/ }),
/* 82 */
/***/ (function(module, exports, __webpack_require__) {
// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of
__webpack_require__(83)('Set');
/***/ }),
/* 83 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// https://tc39.github.io/proposal-setmap-offrom/
var $export = __webpack_require__(11);
module.exports = function (COLLECTION) {
$export($export.S, COLLECTION, { of: function of() {
var length = arguments.length;
var A = new Array(length);
while (length--) A[length] = arguments[length];
return new this(A);
} });
};
/***/ }),
/* 84 */
/***/ (function(module, exports, __webpack_require__) {
// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from
__webpack_require__(85)('Set');
/***/ }),
/* 85 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// https://tc39.github.io/proposal-setmap-offrom/
var $export = __webpack_require__(11);
var aFunction = __webpack_require__(24);
var ctx = __webpack_require__(12);
var forOf = __webpack_require__(31);
module.exports = function (COLLECTION) {
$export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {
var mapFn = arguments[1];
var mapping, A, n, cb;
aFunction(this);
mapping = mapFn !== undefined;
if (mapping) aFunction(mapFn);
if (source == undefined) return new this();
A = [];
if (mapping) {
n = 0;
cb = ctx(mapFn, arguments[2], 2);
forOf(source, false, function (nextItem) {
A.push(cb(nextItem, n++));
});
} else {
forOf(source, false, A.push, A);
}
return new this(A);
} });
};
/***/ })
/******/ ]);
/***/ }),
/***/ "./node_modules/@splunk/charting-utils/format.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 86);
/******/ })
/************************************************************************/
/******/ ({
/***/ 0:
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/underscore/modules/index-all.js");
/***/ }),
/***/ 22:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
/* eslint-disable */
/*
* Copied from js/stubs/i18n.js in the core UI repository, since the logic is unlikely to change and this saves
* us the trouble of taking a dependency on the SplunkWebCore bower module.
*/
/*
* monkey patches to the i18n library
* see SPL-75565
*/
// NOTE: this code block is duplicated in the util/test_i18n_patches.html unit test.
// any changes made here must also be reflected there.
if (window.locale_name() in { ko_KR: true, zh_CN: true, zh_TW: true }) {
window._i18n_locale.date_formats['short'] = { pattern: 'yy/MM/dd', format: '%(yy)s/%(MM)s/%(dd)s' };
window._i18n_locale.date_formats['medium'] = { pattern: 'yyyy/MM/dd', format: '%(yyyy)s/%(MM)s/%(dd)s' };
window._i18n_locale.time_formats['short'] = { pattern: 'H:mm', format: '%(H)s:%(mm)s' };
window._i18n_locale.time_formats['medium'] = { pattern: 'H:mm:ss', format: '%(H)s:%(mm)s:%(ss)s' };
}
var asianLanguageDateReplacements = [[/^ccc MMM d$/, 'M/d (ccc)'], [/^YYYY-MM/, 'YYYY/MM'], [/MM-dd/, 'MM/dd']];
// maintain a hash of locales where custom string replacements are needed to get correct translation
var FORMAT_DATE_REPLACEMENTS = {
ja_JP: asianLanguageDateReplacements,
ko_KR: asianLanguageDateReplacements,
zh_CN: asianLanguageDateReplacements,
zh_TW: asianLanguageDateReplacements
};
// maintain a list of replacements needed when a locale specifies that day comes before month
var DAY_FIRST_FORMATS = [['MMM d', 'd MMM']];
var oldFormatDate = window.format_date;
window.format_date = function (date, format) {
format = format || 'medium';
var i,
replacements,
locale = window.locale_name();
if (format && typeof format === 'string' && window.locale_uses_day_before_month()) {
replacements = DAY_FIRST_FORMATS;
for (i = 0; i < replacements.length; i++) {
format = format.replace(replacements[i][0], replacements[i][1]);
}
}
if (format && typeof format === 'string' && locale in FORMAT_DATE_REPLACEMENTS) {
replacements = FORMAT_DATE_REPLACEMENTS[locale];
for (i = 0; i < replacements.length; i++) {
var replacement = replacements[i];
format = format.replace(replacement[0], replacement[1]);
}
}
return oldFormatDate(date, format);
};
exports.default = {
_: window.gettext,
ungettext: window.ungettext,
format_decimal: window.format_decimal,
format_number: window.format_number,
format_percent: window.format_percent,
format_scientific: window.format_scientific,
format_date: window.format_date,
format_datetime: window.format_datetime,
format_time: window.format_time,
format_datetime_microseconds: window.format_datetime_microseconds,
format_time_microseconds: window.format_time_microseconds,
locale_uses_day_before_month: window.locale_uses_day_before_month,
format_datetime_range: window.format_datetime_range,
locale_name: window.locale_name,
DateTime: window.DateTime,
moment_install: window.moment_install,
numeral_install: window.numeral_install,
jQuery_ui_datepicker_install: window.jQuery_ui_datepicker_install
};
module.exports = exports['default'];
/***/ }),
/***/ 41:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = sprintf;
/* eslint-disable */
/**
* sprintf routine borrowed from http://kevin.vanzonneveld.net/techblog/article/javascript_equivalent_for_phps_sprintf/
* Licensed under GPL and MIT licenses
*
* Modified by Gareth to add support for Python style argument specifiers:
* sprintf("Hi %(name)s, welcome to %(application)s", { name: 'Gareth', app: 'Splunk })
*/
// prettier-ignore
function sprintf() {
// Return a formatted string
//
// + discuss at: http://kevin.vanzonneveld.net/techblog/article/javascript_equivalent_for_phps_sprintf/
// + version: 810.1015
// + original by: Ash Searle (http://hexmen.com/blog/)
// + namespaced by: Michael White (http://getsprink.com)
// + tweaked by: Jack
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// * example 1: sprintf("%01.2f", 123.1);
// * returns 1: 123.10
var regex = /%%|%(\d+\$)?(\([^)]+\))?([-+#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuidfegEG])/g;
var a = arguments,
i = 0,
format = a[i++];
// pad()
var pad = function pad(str, len, chr, leftJustify) {
var padding = str.length >= len ? '' : Array(1 + len - str.length >>> 0).join(chr);
return leftJustify ? str + padding : padding + str;
};
// justify()
var justify = function justify(value, prefix, leftJustify, minWidth, zeroPad) {
var diff = minWidth - value.length;
if (diff > 0) {
if (leftJustify || !zeroPad) {
value = pad(value, minWidth, ' ', leftJustify);
} else {
value = value.slice(0, prefix.length) + pad('', diff, '0', true) + value.slice(prefix.length);
}
}
return value;
};
// formatBaseX()
var formatBaseX = function formatBaseX(value, base, prefix, leftJustify, minWidth, precision, zeroPad) {
// Note: casts negative numbers to positive ones
var number = value >>> 0;
prefix = prefix && number && { '2': '0b', '8': '0', '16': '0x' }[base] || '';
value = prefix + pad(number.toString(base), precision || 0, '0', false);
return justify(value, prefix, leftJustify, minWidth, zeroPad);
};
// formatString()
var formatString = function formatString(value, leftJustify, minWidth, precision, zeroPad) {
if (precision != null) {
value = value.slice(0, precision);
}
return justify(value, '', leftJustify, minWidth, zeroPad);
};
// finalFormat()
var doFormat = function doFormat(substring, valueIndex, valueName, flags, minWidth, _, precision, type) {
if (substring == '%%') return '%';
// parse flags
var leftJustify = false,
positivePrefix = '',
zeroPad = false,
prefixBaseX = false;
var flagsl = flags.length;
for (var j = 0; flags && j < flagsl; j++) {
switch (flags.charAt(j)) {
case ' ':
positivePrefix = ' ';break;
case '+':
positivePrefix = '+';break;
case '-':
leftJustify = true;break;
case '0':
zeroPad = true;break;
case '#':
prefixBaseX = true;break;
}
} // parameters may be null, undefined, empty-string or real valued
// we want to ignore null, undefined and empty-string values
if (!minWidth) {
minWidth = 0;
} else if (minWidth == '*') {
minWidth = +a[i++];
} else if (minWidth.charAt(0) == '*') {
minWidth = +a[minWidth.slice(1, -1)];
} else {
minWidth = +minWidth;
}
// Note: undocumented perl feature:
if (minWidth < 0) {
minWidth = -minWidth;
leftJustify = true;
}
if (!isFinite(minWidth)) {
throw new Error('sprintf: (minimum-)width must be finite');
}
if (!precision) {
precision = 'fFeE'.indexOf(type) > -1 ? 6 : type == 'd' ? 0 : void 0;
} else if (precision == '*') {
precision = +a[i++];
} else if (precision.charAt(0) == '*') {
precision = +a[precision.slice(1, -1)];
} else {
precision = +precision;
}
// grab value using valueIndex if required?
if (valueName) {
valueName = valueName.substr(1, valueName.length - 2);
var value = a[1][valueName];
} else {
var value = valueIndex ? a[valueIndex.slice(0, -1)] : a[i++];
}
switch (type) {
case 's':
return formatString(String(value), leftJustify, minWidth, precision, zeroPad);
case 'c':
return formatString(String.fromCharCode(+value), leftJustify, minWidth, precision, zeroPad);
case 'b':
return formatBaseX(value, 2, prefixBaseX, leftJustify, minWidth, precision, zeroPad);
case 'o':
return formatBaseX(value, 8, prefixBaseX, leftJustify, minWidth, precision, zeroPad);
case 'x':
return formatBaseX(value, 16, prefixBaseX, leftJustify, minWidth, precision, zeroPad);
case 'X':
return formatBaseX(value, 16, prefixBaseX, leftJustify, minWidth, precision, zeroPad).toUpperCase();
case 'u':
return formatBaseX(value, 10, prefixBaseX, leftJustify, minWidth, precision, zeroPad);
case 'i':
case 'd':
{
var number = parseInt(+value);
var prefix = number < 0 ? '-' : positivePrefix;
value = prefix + pad(String(Math.abs(number)), precision, '0', false);
return justify(value, prefix, leftJustify, minWidth, zeroPad);
}
case 'e':
case 'E':
case 'f':
case 'F':
case 'g':
case 'G':
{
var number = +value;
var prefix = number < 0 ? '-' : positivePrefix;
var method = ['toExponential', 'toFixed', 'toPrecision']['efg'.indexOf(type.toLowerCase())];
var textTransform = ['toString', 'toUpperCase']['eEfFgG'.indexOf(type) % 2];
value = prefix + Math.abs(number)[method](precision);
return justify(value, prefix, leftJustify, minWidth, zeroPad)[textTransform]();
}
default:
return substring;
}
};
return format.replace(regex, doFormat);
} // }}}
module.exports = exports['default'];
/***/ }),
/***/ 42:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.roundToDecimal = exports.valuesAreNumeric = exports.isCommaSeparatedNumber = exports.getDecimalPrecision = exports.degreeToRadian = exports.roundWithMinMax = exports.roundWithMin = exports.nearestPowerOfTen = exports.absPowerTen = exports.absLogBaseTen = exports.logBaseTen = exports.parseFloat = undefined;
var _underscore = __webpack_require__(0);
var _underscore2 = _interopRequireDefault(_underscore);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var HEX_REGEX = /^( )*(0x|-0x)/;
var DECIMAL_OR_SCIENTIFIC_REGEX = /(^[-+]?[0-9]*[.]?[0-9]*$)|(^[-+]?[0-9][.]?[0-9]*e[-+]?[0-9][0-9]*$)/i;
var COMMA_SEPARATED_NUMBER_REGEX = /(^[-+]?([0]|([1-9][0-9]{0,2})|(([1-9][0-9]{0,2}[,])([0-9]{3}[,])*[0-9]{3}))(([.][0-9]+)?)$)/;
// an extended version of parseFloat that will handle numbers encoded in hex format (i.e. "0xff")
// and is stricter than native JavaScript parseFloat for decimal numbers
var strictParseFloat = function strictParseFloat(str) {
// determine if the string is a hex number by checking if it begins with '0x' or '-0x',
// in which case delegate to parseInt with a 16 radix
if (HEX_REGEX.test(str)) {
return parseInt(str, 16);
}
// if the number is not in decimal or scientific format, return NaN explicitly
// instead of letting JavaScript do its loose parsing
if (!DECIMAL_OR_SCIENTIFIC_REGEX.test(str)) {
return NaN;
}
return parseFloat(str);
};
exports.parseFloat = strictParseFloat;
// shortcut for base-ten log, also rounds to four decimal points of precision to make pretty numbers
var logBaseTen = exports.logBaseTen = function logBaseTen(num) {
var result = Math.log(num) / Math.LN10;
return Math.round(result * 10000) / 10000;
};
// transforms numbers to a normalized log scale that can handle negative numbers
// rounds to four decimal points of precision
var absLogBaseTen = exports.absLogBaseTen = function absLogBaseTen(num) {
if (typeof num !== 'number') {
num = parseFloat(num);
}
if ((0, _underscore2.default)(num).isNaN()) {
return num;
}
var isNegative = num < 0;
if (isNegative) {
num = -num;
}
if (num < 10) {
num += (10 - num) / 10;
}
var result = logBaseTen(num);
return isNegative ? -result : result;
};
// reverses the transformation made by absLogBaseTen above
// rounds to three decimal points of precision
var absPowerTen = exports.absPowerTen = function absPowerTen(num) {
if (typeof num !== 'number') {
num = parseFloat(num);
}
if ((0, _underscore2.default)(num).isNaN()) {
return num;
}
var isNegative = num < 0;
var result = void 0;
if (isNegative) {
num = -num;
}
// eslint-disable-next-line no-restricted-properties
result = Math.pow(10, num);
if (result < 10) {
result = 10 * (result - 1) / (10 - 1);
}
result = isNegative ? -result : result;
return Math.round(result * 1000) / 1000;
};
// calculates the power of ten that is closest to but not greater than the number
// negative numbers are treated as their absolute value and the sign of the result is flipped before returning
var nearestPowerOfTen = exports.nearestPowerOfTen = function nearestPowerOfTen(num) {
if (typeof num !== 'number') {
return NaN;
}
var isNegative = num < 0;
num = isNegative ? -num : num;
var log = logBaseTen(num);
// eslint-disable-next-line no-restricted-properties
var result = Math.pow(10, Math.floor(log));
return isNegative ? -result : result;
};
var roundWithMin = exports.roundWithMin = function roundWithMin(value, min) {
return Math.max(Math.round(value), min);
};
var roundWithMinMax = exports.roundWithMinMax = function roundWithMinMax(value, min, max) {
var roundVal = Math.round(value);
if (roundVal < min) {
return min;
}
if (roundVal > max) {
return max;
}
return roundVal;
};
var degreeToRadian = exports.degreeToRadian = function degreeToRadian(degree) {
return degree * Math.PI / 180;
};
// returns the number of digits of precision after the decimal point
// optionally accepts a maximum number, after which point it will stop looking and return the max
var getDecimalPrecision = exports.getDecimalPrecision = function getDecimalPrecision(num, max) {
// By spec, toFixed will throw a RangeError if called with a precision greater than 20.
max = Math.min(max || Infinity, 20);
var precision = 0;
while (precision < max && num.toFixed(precision) !== num.toString()) {
precision += 1;
}
return precision;
};
/**
* Checks if the value passed in is some comma separated number
* (e.g. "1,234", "300,000,000", and "12,345.67"). This function provides
* a simple way to determine when a comma seperated value string should be
* considered a number.
*
* @param {String} str - string to be checked
* @returns {Boolean} - return true if (str) is a valid number grouped by either commas or decimals, false otherwise
*/
var isCommaSeparatedNumber = exports.isCommaSeparatedNumber = function isCommaSeparatedNumber(str) {
return (
// if str is not a number grouped with either commas or decimals
COMMA_SEPARATED_NUMBER_REGEX.test(str)
);
};
/**
* Checks if a list of values can be considered "numeric".
*
* Returns true if half or more of the non-null values can be parsed to a float.
*
* @param {Array} values
* @return {Boolean}
*/
var valuesAreNumeric = exports.valuesAreNumeric = function valuesAreNumeric(values) {
var numericCount = 0;
var nonNullCount = 0;
(0, _underscore2.default)(values).each(function (value) {
// in the case of multivalue fields, use the first value
if ((0, _underscore2.default)(value).isArray()) {
value = value.length > 0 ? value[0] : null;
}
if ((0, _underscore2.default)(value).isNull()) {
return;
}
nonNullCount++;
var isNumber = !!strictParseFloat(value) || isCommaSeparatedNumber(value);
if (isNumber) {
numericCount++;
}
});
if (nonNullCount === 0) {
return false;
}
return numericCount >= nonNullCount / 2;
};
/**
*
* Rounds a number to a specifice exp base 10
*
* @param {Number} value - number to round
* @param {Number} exp - exp of base 10 of the decimal palce to round to
* eg: exp=-1 rounds to the tenths place
* exp=-2 rounds to the hundredth place
* exp=0 rounds to the ones place
* exp=1 rounds to the tens place
* @return {Number|NaN}
*
* reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round
*/
var roundToDecimal = exports.roundToDecimal = function roundToDecimal(value, exp) {
// If the exp is undefined or zero...
if (typeof exp === 'undefined' || +exp === 0) {
return Math.round(value);
}
value = +value;
exp = +exp;
// If the value is not a number or the exp is not an integer...
if (isNaN(value) || !(typeof exp === 'number' && exp % 1 === 0)) {
return NaN;
}
// Shift
value = value.toString().split('e');
value = Math.round(+(value[0] + 'e' + (value[1] ? +value[1] - exp : -exp)));
// Shift back
value = value.toString().split('e');
return +(value[0] + 'e' + (value[1] ? +value[1] + exp : exp));
};
// TODO Remove default export
exports.default = {
parseFloat: strictParseFloat,
logBaseTen: logBaseTen,
absLogBaseTen: absLogBaseTen,
absPowerTen: absPowerTen,
nearestPowerOfTen: nearestPowerOfTen,
roundWithMin: roundWithMin,
roundWithMinMax: roundWithMinMax,
degreeToRadian: degreeToRadian,
getDecimalPrecision: getDecimalPrecision,
valuesAreNumeric: valuesAreNumeric,
roundToDecimal: roundToDecimal
};
/***/ }),
/***/ 86:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getSIPower = exports.getSIUnit = exports.abbreviateByUnit = exports.abbreviateNumber = undefined;
var _i18n = __webpack_require__(22);
var _i18n2 = _interopRequireDefault(_i18n);
var _sprintf = __webpack_require__(41);
var _sprintf2 = _interopRequireDefault(_sprintf);
var _math = __webpack_require__(42);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* A method to abbreviate number to a maximum of 4 digits
*/
var abbreviateValue = function abbreviateValue(number) {
if (number < 1000) {
// less than 1,000
return _i18n2.default.format_decimal(number);
} else if (number < 10000) {
// less than 10,000
return (0, _sprintf2.default)(_i18n2.default._('%sK'), _i18n2.default.format_decimal((0, _math.roundToDecimal)(number / 1000, -2)));
} else if (number < 100000) {
// less than 100,000
return (0, _sprintf2.default)(_i18n2.default._('%sK'), _i18n2.default.format_decimal((0, _math.roundToDecimal)(number / 1000, -1)));
} else if (number < 999500) {
// less than 999,500
return (0, _sprintf2.default)(_i18n2.default._('%sK'), _i18n2.default.format_decimal((0, _math.roundToDecimal)(number / 1000, 0)));
} else if (number < 10000000) {
// less than 10,000,000
return (0, _sprintf2.default)(_i18n2.default._('%sM'), _i18n2.default.format_decimal((0, _math.roundToDecimal)(number / 1000000, -2)));
} else if (number < 100000000) {
// less than 100,000,000
return (0, _sprintf2.default)(_i18n2.default._('%sM'), _i18n2.default.format_decimal((0, _math.roundToDecimal)(number / 1000000, -1)));
} else if (number < 999500000) {
// less than 999,500,000
return (0, _sprintf2.default)(_i18n2.default._('%sM'), _i18n2.default.format_decimal((0, _math.roundToDecimal)(number / 1000000, 0)));
} else if (number < 10000000000) {
// less than 10,000,000,000
return (0, _sprintf2.default)(_i18n2.default._('%sB'), _i18n2.default.format_decimal((0, _math.roundToDecimal)(number / 1000000000, -2)));
} else if (number < 100000000000) {
// less than 100,000,000,000
return (0, _sprintf2.default)(_i18n2.default._('%sB'), _i18n2.default.format_decimal((0, _math.roundToDecimal)(number / 1000000000, -1)));
}
// greater than or equal to 100,000,000,000
return (0, _sprintf2.default)(_i18n2.default._('%sB'), _i18n2.default.format_decimal((0, _math.roundToDecimal)(number / 1000000000, 0)));
}; /**
* Util package for formatting number.
*/
var abbreviateNumber = exports.abbreviateNumber = function abbreviateNumber(number) {
if (number < 0) {
return '-'.concat(abbreviateValue(Math.abs(number)));
}
return abbreviateValue(number);
};
/**
* A method to abbreviate number to an SI unit to a certain decimal place
*/
var abbreviateByUnit = exports.abbreviateByUnit = function abbreviateByUnit(number, unit, decimal) {
var format = '###,###.';
var ending = '';
// concatonate decimal number of zeros to the ending of formatting string
for (var i = 0; i < decimal; i++) {
ending = ending + '0';
}
format += ending;
if (number === 0) {
return '0';
}
if (unit === '') {
return _i18n2.default.format_decimal(number, format).toString();
} else if (unit === 'K') {
return (0, _sprintf2.default)(_i18n2.default._('%sK'), _i18n2.default.format_decimal(number / 1000, format));
} else if (unit === 'M') {
return (0, _sprintf2.default)(_i18n2.default._('%sM'), _i18n2.default.format_decimal(number / 1000000, format));
} else if (unit === 'B') {
return (0, _sprintf2.default)(_i18n2.default._('%sB'), _i18n2.default.format_decimal(number / 1000000000, format));
} else if (unit === 'T') {
return (0, _sprintf2.default)(_i18n2.default._('%sT'), _i18n2.default.format_decimal(number / 1000000000000, format));
}
return undefined;
};
/**
* A method to return the largest SI suffix that is smaller than the number
*/
var getSIUnit = exports.getSIUnit = function getSIUnit(number) {
if (number >= 1000000000000) {
return 'T';
} else if (number >= 1000000000) {
return 'B';
} else if (number >= 1000000) {
return 'M';
} else if (number >= 1000) {
return 'K';
}
return '';
};
/**
* A method to return the largest power asscoiated to an SI suffix that is smaller than the number
*/
var getSIPower = exports.getSIPower = function getSIPower(number) {
if (number >= 1000000000000) {
return 12;
} else if (number >= 1000000000) {
return 9;
} else if (number >= 1000000) {
return 6;
} else if (number >= 1000) {
return 3;
}
return 0;
};
/***/ })
/******/ });
/***/ }),
/***/ "./node_modules/@splunk/charting-utils/i18n.js":
/***/ (function(module, exports) {
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 22);
/******/ })
/************************************************************************/
/******/ ({
/***/ 22:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
/* eslint-disable */
/*
* Copied from js/stubs/i18n.js in the core UI repository, since the logic is unlikely to change and this saves
* us the trouble of taking a dependency on the SplunkWebCore bower module.
*/
/*
* monkey patches to the i18n library
* see SPL-75565
*/
// NOTE: this code block is duplicated in the util/test_i18n_patches.html unit test.
// any changes made here must also be reflected there.
if (window.locale_name() in { ko_KR: true, zh_CN: true, zh_TW: true }) {
window._i18n_locale.date_formats['short'] = { pattern: 'yy/MM/dd', format: '%(yy)s/%(MM)s/%(dd)s' };
window._i18n_locale.date_formats['medium'] = { pattern: 'yyyy/MM/dd', format: '%(yyyy)s/%(MM)s/%(dd)s' };
window._i18n_locale.time_formats['short'] = { pattern: 'H:mm', format: '%(H)s:%(mm)s' };
window._i18n_locale.time_formats['medium'] = { pattern: 'H:mm:ss', format: '%(H)s:%(mm)s:%(ss)s' };
}
var asianLanguageDateReplacements = [[/^ccc MMM d$/, 'M/d (ccc)'], [/^YYYY-MM/, 'YYYY/MM'], [/MM-dd/, 'MM/dd']];
// maintain a hash of locales where custom string replacements are needed to get correct translation
var FORMAT_DATE_REPLACEMENTS = {
ja_JP: asianLanguageDateReplacements,
ko_KR: asianLanguageDateReplacements,
zh_CN: asianLanguageDateReplacements,
zh_TW: asianLanguageDateReplacements
};
// maintain a list of replacements needed when a locale specifies that day comes before month
var DAY_FIRST_FORMATS = [['MMM d', 'd MMM']];
var oldFormatDate = window.format_date;
window.format_date = function (date, format) {
format = format || 'medium';
var i,
replacements,
locale = window.locale_name();
if (format && typeof format === 'string' && window.locale_uses_day_before_month()) {
replacements = DAY_FIRST_FORMATS;
for (i = 0; i < replacements.length; i++) {
format = format.replace(replacements[i][0], replacements[i][1]);
}
}
if (format && typeof format === 'string' && locale in FORMAT_DATE_REPLACEMENTS) {
replacements = FORMAT_DATE_REPLACEMENTS[locale];
for (i = 0; i < replacements.length; i++) {
var replacement = replacements[i];
format = format.replace(replacement[0], replacement[1]);
}
}
return oldFormatDate(date, format);
};
exports.default = {
_: window.gettext,
ungettext: window.ungettext,
format_decimal: window.format_decimal,
format_number: window.format_number,
format_percent: window.format_percent,
format_scientific: window.format_scientific,
format_date: window.format_date,
format_datetime: window.format_datetime,
format_time: window.format_time,
format_datetime_microseconds: window.format_datetime_microseconds,
format_time_microseconds: window.format_time_microseconds,
locale_uses_day_before_month: window.locale_uses_day_before_month,
format_datetime_range: window.format_datetime_range,
locale_name: window.locale_name,
DateTime: window.DateTime,
moment_install: window.moment_install,
numeral_install: window.numeral_install,
jQuery_ui_datepicker_install: window.jQuery_ui_datepicker_install
};
module.exports = exports['default'];
/***/ })
/******/ });
/***/ }),
/***/ "./node_modules/@splunk/charting-utils/lang.js":
/***/ (function(module, exports) {
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 87);
/******/ })
/************************************************************************/
/******/ ({
/***/ 87:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
/* eslint-disable import/prefer-default-export,func-names */
// very simple inheritance helper to set up the prototype chain
var inherit = exports.inherit = function inherit(child, parent) {
var F = function F() {};
F.prototype = parent.prototype;
child.prototype = new F();
child.prototype.constructor = child;
};
/***/ })
/******/ });
/***/ }),
/***/ "./node_modules/@splunk/charting-utils/logger.js":
/***/ (function(module, exports) {
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 43);
/******/ })
/************************************************************************/
/******/ ({
/***/ 43:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _console = window.console;
var setLoggingConsole = exports.setLoggingConsole = function setLoggingConsole(newConsole) {
_console = newConsole;
};
var bindConsole = function bindConsole(fnName) {
return function () {
var _console2;
(_console2 = _console)[fnName].apply(_console2, arguments);
};
};
var debug = exports.debug = bindConsole('debug');
var info = exports.info = bindConsole('info');
var warn = exports.warn = bindConsole('warn');
var error = exports.error = bindConsole('error');
var log = exports.log = bindConsole('log');
var trace = exports.trace = bindConsole('trace');
exports.default = {
setLoggingConsole: setLoggingConsole,
debug: debug,
info: info,
warn: warn,
error: error,
log: log,
trace: trace
};
/***/ })
/******/ });
/***/ }),
/***/ "./node_modules/@splunk/charting-utils/math.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 42);
/******/ })
/************************************************************************/
/******/ ({
/***/ 0:
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/underscore/modules/index-all.js");
/***/ }),
/***/ 42:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.roundToDecimal = exports.valuesAreNumeric = exports.isCommaSeparatedNumber = exports.getDecimalPrecision = exports.degreeToRadian = exports.roundWithMinMax = exports.roundWithMin = exports.nearestPowerOfTen = exports.absPowerTen = exports.absLogBaseTen = exports.logBaseTen = exports.parseFloat = undefined;
var _underscore = __webpack_require__(0);
var _underscore2 = _interopRequireDefault(_underscore);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var HEX_REGEX = /^( )*(0x|-0x)/;
var DECIMAL_OR_SCIENTIFIC_REGEX = /(^[-+]?[0-9]*[.]?[0-9]*$)|(^[-+]?[0-9][.]?[0-9]*e[-+]?[0-9][0-9]*$)/i;
var COMMA_SEPARATED_NUMBER_REGEX = /(^[-+]?([0]|([1-9][0-9]{0,2})|(([1-9][0-9]{0,2}[,])([0-9]{3}[,])*[0-9]{3}))(([.][0-9]+)?)$)/;
// an extended version of parseFloat that will handle numbers encoded in hex format (i.e. "0xff")
// and is stricter than native JavaScript parseFloat for decimal numbers
var strictParseFloat = function strictParseFloat(str) {
// determine if the string is a hex number by checking if it begins with '0x' or '-0x',
// in which case delegate to parseInt with a 16 radix
if (HEX_REGEX.test(str)) {
return parseInt(str, 16);
}
// if the number is not in decimal or scientific format, return NaN explicitly
// instead of letting JavaScript do its loose parsing
if (!DECIMAL_OR_SCIENTIFIC_REGEX.test(str)) {
return NaN;
}
return parseFloat(str);
};
exports.parseFloat = strictParseFloat;
// shortcut for base-ten log, also rounds to four decimal points of precision to make pretty numbers
var logBaseTen = exports.logBaseTen = function logBaseTen(num) {
var result = Math.log(num) / Math.LN10;
return Math.round(result * 10000) / 10000;
};
// transforms numbers to a normalized log scale that can handle negative numbers
// rounds to four decimal points of precision
var absLogBaseTen = exports.absLogBaseTen = function absLogBaseTen(num) {
if (typeof num !== 'number') {
num = parseFloat(num);
}
if ((0, _underscore2.default)(num).isNaN()) {
return num;
}
var isNegative = num < 0;
if (isNegative) {
num = -num;
}
if (num < 10) {
num += (10 - num) / 10;
}
var result = logBaseTen(num);
return isNegative ? -result : result;
};
// reverses the transformation made by absLogBaseTen above
// rounds to three decimal points of precision
var absPowerTen = exports.absPowerTen = function absPowerTen(num) {
if (typeof num !== 'number') {
num = parseFloat(num);
}
if ((0, _underscore2.default)(num).isNaN()) {
return num;
}
var isNegative = num < 0;
var result = void 0;
if (isNegative) {
num = -num;
}
// eslint-disable-next-line no-restricted-properties
result = Math.pow(10, num);
if (result < 10) {
result = 10 * (result - 1) / (10 - 1);
}
result = isNegative ? -result : result;
return Math.round(result * 1000) / 1000;
};
// calculates the power of ten that is closest to but not greater than the number
// negative numbers are treated as their absolute value and the sign of the result is flipped before returning
var nearestPowerOfTen = exports.nearestPowerOfTen = function nearestPowerOfTen(num) {
if (typeof num !== 'number') {
return NaN;
}
var isNegative = num < 0;
num = isNegative ? -num : num;
var log = logBaseTen(num);
// eslint-disable-next-line no-restricted-properties
var result = Math.pow(10, Math.floor(log));
return isNegative ? -result : result;
};
var roundWithMin = exports.roundWithMin = function roundWithMin(value, min) {
return Math.max(Math.round(value), min);
};
var roundWithMinMax = exports.roundWithMinMax = function roundWithMinMax(value, min, max) {
var roundVal = Math.round(value);
if (roundVal < min) {
return min;
}
if (roundVal > max) {
return max;
}
return roundVal;
};
var degreeToRadian = exports.degreeToRadian = function degreeToRadian(degree) {
return degree * Math.PI / 180;
};
// returns the number of digits of precision after the decimal point
// optionally accepts a maximum number, after which point it will stop looking and return the max
var getDecimalPrecision = exports.getDecimalPrecision = function getDecimalPrecision(num, max) {
// By spec, toFixed will throw a RangeError if called with a precision greater than 20.
max = Math.min(max || Infinity, 20);
var precision = 0;
while (precision < max && num.toFixed(precision) !== num.toString()) {
precision += 1;
}
return precision;
};
/**
* Checks if the value passed in is some comma separated number
* (e.g. "1,234", "300,000,000", and "12,345.67"). This function provides
* a simple way to determine when a comma seperated value string should be
* considered a number.
*
* @param {String} str - string to be checked
* @returns {Boolean} - return true if (str) is a valid number grouped by either commas or decimals, false otherwise
*/
var isCommaSeparatedNumber = exports.isCommaSeparatedNumber = function isCommaSeparatedNumber(str) {
return (
// if str is not a number grouped with either commas or decimals
COMMA_SEPARATED_NUMBER_REGEX.test(str)
);
};
/**
* Checks if a list of values can be considered "numeric".
*
* Returns true if half or more of the non-null values can be parsed to a float.
*
* @param {Array} values
* @return {Boolean}
*/
var valuesAreNumeric = exports.valuesAreNumeric = function valuesAreNumeric(values) {
var numericCount = 0;
var nonNullCount = 0;
(0, _underscore2.default)(values).each(function (value) {
// in the case of multivalue fields, use the first value
if ((0, _underscore2.default)(value).isArray()) {
value = value.length > 0 ? value[0] : null;
}
if ((0, _underscore2.default)(value).isNull()) {
return;
}
nonNullCount++;
var isNumber = !!strictParseFloat(value) || isCommaSeparatedNumber(value);
if (isNumber) {
numericCount++;
}
});
if (nonNullCount === 0) {
return false;
}
return numericCount >= nonNullCount / 2;
};
/**
*
* Rounds a number to a specifice exp base 10
*
* @param {Number} value - number to round
* @param {Number} exp - exp of base 10 of the decimal palce to round to
* eg: exp=-1 rounds to the tenths place
* exp=-2 rounds to the hundredth place
* exp=0 rounds to the ones place
* exp=1 rounds to the tens place
* @return {Number|NaN}
*
* reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round
*/
var roundToDecimal = exports.roundToDecimal = function roundToDecimal(value, exp) {
// If the exp is undefined or zero...
if (typeof exp === 'undefined' || +exp === 0) {
return Math.round(value);
}
value = +value;
exp = +exp;
// If the value is not a number or the exp is not an integer...
if (isNaN(value) || !(typeof exp === 'number' && exp % 1 === 0)) {
return NaN;
}
// Shift
value = value.toString().split('e');
value = Math.round(+(value[0] + 'e' + (value[1] ? +value[1] - exp : -exp)));
// Shift back
value = value.toString().split('e');
return +(value[0] + 'e' + (value[1] ? +value[1] + exp : exp));
};
// TODO Remove default export
exports.default = {
parseFloat: strictParseFloat,
logBaseTen: logBaseTen,
absLogBaseTen: absLogBaseTen,
absPowerTen: absPowerTen,
nearestPowerOfTen: nearestPowerOfTen,
roundWithMin: roundWithMin,
roundWithMinMax: roundWithMinMax,
degreeToRadian: degreeToRadian,
getDecimalPrecision: getDecimalPrecision,
valuesAreNumeric: valuesAreNumeric,
roundToDecimal: roundToDecimal
};
/***/ })
/******/ });
/***/ }),
/***/ "./node_modules/@splunk/charting-utils/parsing.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 88);
/******/ })
/************************************************************************/
/******/ ({
/***/ 0:
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/underscore/modules/index-all.js");
/***/ }),
/***/ 1:
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/jquery/dist/jquery.js");
/***/ }),
/***/ 32:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.interpolateColors = exports.getComputedOpacity = exports.getLuminance = exports.addAlphaToColor = exports.hexFromColor = exports.normalizeColor = exports.stripOutAlpha = exports.colorFromHex = undefined;
var _jquery = __webpack_require__(1);
var _jquery2 = _interopRequireDefault(_jquery);
var _underscore = __webpack_require__(0);
var _underscore2 = _interopRequireDefault(_underscore);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// converts a hex number to its css-friendly counterpart, with optional alpha transparency field
// returns null if the input is cannot be parsed to a valid number or if the number is out of range
/* eslint-disable no-bitwise */
var colorFromHex = exports.colorFromHex = function colorFromHex(hexNum, alpha) {
if (typeof hexNum !== 'number') {
hexNum = parseInt(hexNum, 16);
}
if ((0, _underscore2.default)(hexNum).isNaN() || hexNum < 0x000000 || hexNum > 0xffffff) {
return null;
}
var r = (hexNum & 0xff0000) >> 16;
var g = (hexNum & 0x00ff00) >> 8;
var b = hexNum & 0x0000ff;
return alpha === undefined ? 'rgb(' + r + ',' + g + ',' + b + ')' : 'rgba(' + r + ',' + g + ',' + b + ',' + alpha + ')';
};
// converts an rgba value to rgb by stripping out the alpha. willl return the unchanged parameter
// if an rgb value is passed rather than rgba
var stripOutAlpha = exports.stripOutAlpha = function stripOutAlpha(color) {
var rgb = color.split(',');
var thirdChar = rgb[0].charAt(3);
if (thirdChar === 'a') {
rgb[0] = rgb[0].replace('rgba', 'rgb');
rgb[rgb.length - 1] = ')';
rgb = rgb.join();
rgb = rgb.replace(',)', ')');
return rgb;
}
return color;
};
/**
* Take an RGB value and convert to HEX equivalent.
*
* @param {String} rgb A RGB value following rgb(XXX, XXX, XXX) convention.
* @type String
* @return A HEX equivalent for a given RGB value with a leading '#' character.
*/
var getHEX = function getHEX(rgb) {
var parts = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
var hex = (parts[1] << 16 | parts[2] << 8 | parts[3]).toString(16);
return '#' + Array(6 - hex.length).concat([hex]).toString().replace(/,/g, 0);
};
/**
* Take an arbitrary RGB or HEX in long or shorthand notation and normalize to standard long HEX form with leading '#' character.
*
* @param {String} color A RGB or HEX color value in long or short notation.
* @type String or null
* @return A fully qualified 6 character hexadecimal value or with leading '#' character or null if it can't be processed.
*/
var normalizeColor = exports.normalizeColor = function normalizeColor(color) {
var normalizedColor = null;
if (typeof color === 'string' && color.charAt(0) === '#') {
if (color.length === 4) {
normalizedColor = color + color.charAt(1) + color.charAt(2) + color.charAt(3);
} else {
normalizedColor = color;
}
} else {
try {
normalizedColor = getHEX(color);
} catch (e) {} // eslint-disable-line no-empty
}
return normalizedColor;
};
// coverts a color string in either hex (must be long form) or rgb format into its corresponding hex number
// returns zero if the color string can't be parsed as either format
// TODO: either add support for short form or emit an error
var hexFromColor = exports.hexFromColor = function hexFromColor(color) {
var normalizedColor = normalizeColor(color);
return normalizedColor ? parseInt(normalizedColor.replace('#', '0x'), 16) : 0;
};
// given a color string (in long-form hex or rgb form) or a hex number,
// formats the color as an rgba string with the given alpha transparency
// TODO: currently fails somewhat silently if an un-parseable or out-of-range input is given
var addAlphaToColor = exports.addAlphaToColor = function addAlphaToColor(color, alpha) {
var colorAsHex = typeof color === 'number' ? color : hexFromColor(color);
return colorFromHex(colorAsHex, alpha);
};
// calculate the luminance of a color based on its hex value
// returns zero if the input is cannot be parsed to a valid number or if the number is out of range
// equation for luminance found at http://en.wikipedia.org/wiki/Luma_(video)
var getLuminance = exports.getLuminance = function getLuminance(hexNum) {
if (typeof hexNum !== 'number') {
hexNum = parseInt(hexNum, 16);
}
if (isNaN(hexNum) || hexNum < 0x000000 || hexNum > 0xffffff) {
return 0;
}
var r = (hexNum & 0xff0000) >> 16;
var g = (hexNum & 0x00ff00) >> 8;
var b = hexNum & 0x0000ff;
return Math.round(0.2126 * r + 0.7152 * g + 0.0722 * b);
};
// compute the user-visible fill opacity of an SVG element
// an opacity defined as part of the 'fill' color with rgba(...) syntax will take precedence over the 'fill-opacity'
var getComputedOpacity = exports.getComputedOpacity = function getComputedOpacity(element) {
var fill = _jquery2.default.trim(element.attr('fill'));
var enforceValidOpacity = function enforceValidOpacity(opacityStr) {
var parsed = parseFloat(opacityStr);
return parsed >= 0 && parsed <= 1 ? parsed : 1;
};
if (!/^rgba/.test(fill)) {
return enforceValidOpacity(element.attr('fill-opacity'));
}
var rgba = fill.match(/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*([\d.]+)\)$/);
return rgba && rgba.length > 4 ? enforceValidOpacity(rgba[4]) : 1;
};
var interpolateColors = exports.interpolateColors = function interpolateColors(color1, color2, p) {
var r1 = color1 >> 16 & 0xff;
var g1 = color1 >> 8 & 0xff;
var b1 = color1 & 0xff;
var r2 = color2 >> 16 & 0xff;
var g2 = color2 >> 8 & 0xff;
var b2 = color2 & 0xff;
var rInterp = r1 + Math.round((r2 - r1) * p);
var gInterp = g1 + Math.round((g2 - g1) * p);
var bInterp = b1 + Math.round((b2 - b1) * p);
return rInterp << 16 | gInterp << 8 | bInterp;
};
/***/ }),
/***/ 88:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getRotation = exports.getYAxisProperties = exports.getXAxisProperties = exports.yAxisKeyIsTrumped = exports.xAxisKeyIsTrumped = exports.getLegendProperties = exports.arraysAreEquivalent = exports.stringToHexObject = exports.stringToHexArray = exports.capitalize = exports.stringToArray = exports.stringToFieldList = exports.stringToObject = exports.normalizeBoolean = exports.filterPropsByRegex = exports.escapeSVG = exports.escapeHtml = exports.unescapeChars = exports.escapeSafeSplit = exports.trimWhitespace = undefined;
var _jquery = __webpack_require__(1);
var _jquery2 = _interopRequireDefault(_jquery);
var _underscore = __webpack_require__(0);
var _underscore2 = _interopRequireDefault(_underscore);
var _color = __webpack_require__(32);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// TODO: replace with $.trim
var trimWhitespace = exports.trimWhitespace = function trimWhitespace(str) {
return str.replace(/^\s*/, '').replace(/\s*$/, '');
};
// Remove leading and trailing quotes (single or double) -- must be the first and last char.
// ["'] matches a quote, \1 matches whichever type of quote was captured by the first match.
/* eslint-disable no-continue */
var trimQuotes = function trimQuotes(str) {
return str.replace(/^(["'])(.*)\1$/, '$2');
};
var escapeSafeSplit = exports.escapeSafeSplit = function escapeSafeSplit(str, delimiter, escapeChar) {
escapeChar = escapeChar || '\\';
var unescapedPieces = str.split(delimiter);
// the escaped pieces list initially contains the first element of the unescaped pieces list
// we use shift() to also remove that element from the unescaped pieces
var escapedPieces = [unescapedPieces.shift()];
// now loop over the remaining unescaped pieces
// if the last escaped piece ends in an escape character, perform a concatenation to undo the split
// otherwise append the new piece to the escaped pieces list
(0, _underscore2.default)(unescapedPieces).each(function (piece) {
var lastEscapedPiece = (0, _underscore2.default)(escapedPieces).last();
if ((0, _underscore2.default)(lastEscapedPiece).last() === escapeChar) {
escapedPieces[escapedPieces.length - 1] += delimiter + piece;
} else {
escapedPieces.push(piece);
}
});
return escapedPieces;
};
var unescapeChars = exports.unescapeChars = function unescapeChars(str, charList) {
(0, _underscore2.default)(charList).each(function (chr) {
// looks weird, but the first four slashes add a single escaped '\' to the regex
// and the next two escape the character itself within the regex
var regex = new RegExp('\\\\\\' + chr, 'g');
str = str.replace(regex, chr);
});
return str;
};
var escapeHtml = exports.escapeHtml = function escapeHtml(input) {
return ('' + input).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/'/g, ''');
};
var escapeSVG = exports.escapeSVG = function escapeSVG(input) {
return ('' + input).replace(//g, '>');
};
// uses the given regex to filter out any properties whose key doesn't match
// will return an empty object if the props input is not a map
var filterPropsByRegex = exports.filterPropsByRegex = function filterPropsByRegex(props, regex) {
if (!(regex instanceof RegExp)) {
return props;
}
var key = void 0;
var filtered = {};
// eslint-disable-next-line no-restricted-syntax
for (key in props) {
// eslint-disable-next-line no-prototype-builtins
if (props.hasOwnProperty(key) && regex.test(key)) {
filtered[key] = props[key];
}
}
return filtered;
};
// normalize a boolean, a default state can optionally be defined for when the value is undefined
var normalizeBoolean = exports.normalizeBoolean = function normalizeBoolean(value, defaultState) {
if ((0, _underscore2.default)(value).isUndefined()) {
return !!defaultState;
}
if (typeof value === 'string') {
value = value.toLowerCase();
}
switch (value) {
case true:
case 1:
case '1':
case 'yes':
case 'on':
case 'true':
return true;
case false:
case 0:
case '0':
case 'no':
case 'off':
case 'false':
return false;
default:
return value;
}
};
// translates a JSON-style serialized map in to a primitive object
// cannot handle nested objects
// value strings should be un-quoted or double-quoted and will be stripped of leading/trailing whitespace
// will not cast to numbers or booleans
var stringToObject = exports.stringToObject = function stringToObject(str) {
if (!str) {
return false;
}
var i = void 0;
var loopKv = void 0;
var loopKey = void 0;
var map = {};
str = trimWhitespace(str);
var strLen = str.length;
if (str.charAt(0) !== '{' || str.charAt(strLen - 1) !== '}') {
return false;
}
if (/^{\s*}$/.test(str)) {
return {};
}
str = str.substr(1, strLen - 2);
var propList = escapeSafeSplit(str, ',');
for (i = 0; i < propList.length; i++) {
loopKv = escapeSafeSplit(propList[i], ':');
if (loopKv.length !== 2) {
return false;
}
loopKey = trimWhitespace(loopKv[0]);
if (loopKey[0] === '"') {
loopKey = loopKey.substring(1);
}
if ((0, _underscore2.default)(loopKey).last() === '"') {
loopKey = loopKey.substring(0, loopKey.length - 1);
}
loopKey = unescapeChars(loopKey, ['{', '}', '[', ']', '(', ')', ',', ':', '"']);
map[loopKey] = trimQuotes(trimWhitespace(loopKv[1]));
}
return map;
};
/**
* Deserializes a string into a field list.
*/
var stringToFieldList = exports.stringToFieldList = function stringToFieldList(strList) {
if (typeof strList !== 'string' || !strList) return [];
var items = [];
var fieldNameBuffer = [];
var inquote = false;
var str = _jquery2.default.trim(strList);
for (var i = 0, j = str.length; i < j; i++) {
if (str.charAt(i) === '\\') {
var nextidx = i + 1;
if (j > nextidx && (str.charAt(nextidx) === '\\' || str.charAt(nextidx) === '"')) {
fieldNameBuffer.push(str.charAt(nextidx));
i++;
continue;
} else {
fieldNameBuffer.push(str.charAt(i));
continue;
}
}
if (str.charAt(i) === '"') {
if (!inquote) {
inquote = true;
continue;
} else {
inquote = false;
items.push(fieldNameBuffer.join(''));
fieldNameBuffer = [];
continue;
}
}
if (str.charAt(i) === ',' && !inquote) {
if (fieldNameBuffer.length > 0) {
items.push(fieldNameBuffer.join(''));
}
fieldNameBuffer = [];
continue;
}
fieldNameBuffer.push(str.charAt(i));
}
if (fieldNameBuffer.length > 0) items.push(fieldNameBuffer.join(''));
return items.map(function (element) {
return element.trim();
});
};
// translates a JSON-style serialized list in to a primitive array
// cannot handle nested arrays
var stringToArray = exports.stringToArray = function stringToArray(str) {
if (!str) {
return false;
}
str = trimWhitespace(str);
var strLen = str.length;
if (str.charAt(0) !== '[' || str.charAt(strLen - 1) !== ']') {
return false;
}
if (/^\[\s*]$/.test(str)) {
return [];
}
str = str.substr(1, strLen - 2);
return stringToFieldList(str);
};
/**
* Changes the first letter of first word in a string to upper-case.
* All other letters remain unchanged.
*
* @param str {String} - string to capitalize.
* @returns {String} - Returns a string with the first letter of first word upper-case.
*/
var capitalize = exports.capitalize = function capitalize(str) {
return str.charAt(0).toUpperCase() + str.slice(1);
};
var looseParseColor = function looseParseColor(colorStr) {
if (_underscore2.default.isNumber(colorStr)) {
return colorStr;
}
if (colorStr.substring(0, 1) === '#') {
return (0, _color.hexFromColor)(colorStr);
}
// For legacy reasons, assume that any string is a hex number representation,
// regardless of whether it starts with a '0x' (SPL-124191)
return parseInt(colorStr, 16);
};
var stringToHexArray = exports.stringToHexArray = function stringToHexArray(colorStr) {
var i = void 0;
var hexColor = void 0;
var colors = void 0;
try {
colors = JSON.parse(colorStr);
} catch (e) {
colors = stringToArray(colorStr);
}
if (!colors) {
return false;
}
for (i = 0; i < colors.length; i++) {
hexColor = looseParseColor(colors[i]);
if (isNaN(hexColor)) {
return false;
}
colors[i] = hexColor;
}
return colors;
};
var stringToHexObject = exports.stringToHexObject = function stringToHexObject(colorStr) {
var parsedInput = void 0;
try {
parsedInput = JSON.parse(colorStr);
} catch (e) {
parsedInput = stringToObject(colorStr);
}
if (!parsedInput) {
return false;
}
var hexObject = {};
(0, _underscore2.default)(parsedInput).each(function (color, key) {
hexObject[key] = looseParseColor(color) || 0;
});
return hexObject;
};
// a simple utility method for comparing arrays, assumes one-dimensional arrays of primitives,
// performs strict comparisons
var arraysAreEquivalent = exports.arraysAreEquivalent = function arraysAreEquivalent(array1, array2) {
// make sure these are actually arrays
if (!(array1 instanceof Array) || !(array2 instanceof Array)) {
return false;
}
if (array1 === array2) {
// true if they are the same object
return true;
}
if (array1.length !== array2.length) {
// false if they are different lengths
return false;
}
// false if any of their elements don't match
for (var i = 0; i < array1.length; i++) {
if (array1[i] !== array2[i]) {
return false;
}
}
return true;
};
var getLegendProperties = exports.getLegendProperties = function getLegendProperties(properties) {
var remapped = {};
var legendProps = filterPropsByRegex(properties, /legend[.]/);
(0, _underscore2.default)(legendProps).each(function (value, key) {
remapped[key.replace(/^legend[.]/, '')] = value;
});
return remapped;
};
// checks if the given x-axis key is deprecated, and if so returns true if that key's
// non-deprecated counterpart is set in the properties map, otherwise returns false
var xAxisKeyIsTrumped = exports.xAxisKeyIsTrumped = function xAxisKeyIsTrumped(key, properties) {
if (!/primaryAxis/.test(key)) {
return false;
}
if (/primaryAxisTitle/.test(key)) {
return properties[key.replace(/primaryAxisTitle/, 'axisTitleX')];
}
return properties[key.replace(/primaryAxis/, 'axisX')];
};
// checks if the given y-axis key is deprecated, and if so returns true if that key's
// non-deprecated counterpart is set in the properties map, otherwise returns false
var yAxisKeyIsTrumped = exports.yAxisKeyIsTrumped = function yAxisKeyIsTrumped(key, properties) {
if (!/secondaryAxis/.test(key)) {
return false;
}
if (/secondaryAxisTitle/.test(key)) {
return properties[key.replace(/secondaryAxisTitle/, 'axisTitleY')];
}
return properties[key.replace(/secondaryAxis/, 'axisY')];
};
// returns a map of properties that apply either to the x-axis or to x-axis labels
// all axis-related keys are renamed to 'axis' and all axis-label-related keys are renamed to 'axisLabels'
var getXAxisProperties = exports.getXAxisProperties = function getXAxisProperties(properties) {
var key = void 0;
var newKey = void 0;
var remapped = {};
var axisProps = filterPropsByRegex(properties, /(axisX|primaryAxis|axisLabelsX|axisTitleX|gridLinesX)/);
// eslint-disable-next-line no-restricted-syntax
for (key in axisProps) {
// eslint-disable-next-line no-prototype-builtins
if (axisProps.hasOwnProperty(key)) {
if (!xAxisKeyIsTrumped(key, properties)) {
newKey = key.replace(/(axisX|primaryAxis)/, 'axis');
newKey = newKey.replace(/axisLabelsX/, 'axisLabels');
newKey = newKey.replace(/axisTitleX/, 'axisTitle');
newKey = newKey.replace(/gridLinesX/, 'gridLines');
remapped[newKey] = axisProps[key];
}
}
}
return remapped;
};
// returns a map of properties that apply either to the y-axis or to y-axis labels
// all axis-related keys are renamed to 'axis' and all axis-label-related keys are renamed to 'axisLabels'
var getYAxisProperties = exports.getYAxisProperties = function getYAxisProperties(properties, axisIndex) {
var key = void 0;
var newKey = void 0;
var remapped = {};
var axisProps = void 0;
axisIndex = (properties && normalizeBoolean(properties['layout.splitSeries']) ? 0 : axisIndex) || 0;
if (axisIndex === 0) {
axisProps = filterPropsByRegex(properties, /(axisY[^2]|secondaryAxis|axisLabelsY(?!2.*|\.majorLabelStyle\.rotation|\.majorLabelStyle\.overflowMode)|axisTitleY[^2]|gridLinesY[^2])/);
} else if (axisIndex === 1) {
axisProps = filterPropsByRegex(properties, /(axisY2(?!\.enabled)|axisLabelsY2(?!\.majorLabelStyle\.rotation|\.majorLabelStyle\.overflowMode)|axisTitleY2|gridLinesY2)/);
if (!axisProps['axisY2.scale'] || axisProps['axisY2.scale'] === 'inherit') {
axisProps['axisY2.scale'] = properties ? properties['axisY.scale'] || 'linear' : 'linear';
}
// An empty or invalid value for showing the grid lines for the second y-axis should map to hiding them.
if (_underscore2.default.isUndefined(axisProps['gridLinesY2.showMajorLines']) || typeof normalizeBoolean(axisProps['gridLinesY2.showMajorLines']) !== 'boolean') {
axisProps['gridLinesY2.showMajorLines'] = 0;
}
axisProps['axisLabelsY2.extendsAxisRange'] = properties ? properties['axisLabelsY.extendsAxisRange'] || true : true;
} else {
throw new Error('Axis index must be 0 or 1');
}
// eslint-disable-next-line no-restricted-syntax
for (key in axisProps) {
// eslint-disable-next-line no-prototype-builtins
if (axisProps.hasOwnProperty(key)) {
if (!yAxisKeyIsTrumped(key, properties)) {
newKey = key.replace(/(axisY2|axisY|secondaryAxis)/, 'axis');
newKey = newKey.replace(/axisLabelsY2|axisLabelsY/, 'axisLabels');
newKey = newKey.replace(/axisTitleY2|axisTitleY/, 'axisTitle');
newKey = newKey.replace(/gridLinesY2|gridLinesY/, 'gridLines');
remapped[newKey] = axisProps[key];
}
}
}
return remapped;
};
// gets axis label rotation
var getRotation = exports.getRotation = function getRotation(rotationProperty) {
var PERMITTED_ROTATIONS = [-90, -45, 0, 45, 90];
var DEFAULT_ROTATION = 0;
var labelRotation = parseInt(rotationProperty, 10);
if (_underscore2.default.indexOf(PERMITTED_ROTATIONS, labelRotation) === -1) {
return DEFAULT_ROTATION;
}
return labelRotation;
};
/***/ })
/******/ });
/***/ }),
/***/ "./node_modules/@splunk/charting-utils/testing.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 89);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/underscore/modules/index-all.js");
/***/ }),
/* 1 */
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/jquery/dist/jquery.js");
/***/ }),
/* 2 */
/***/ (function(module, exports) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
? window : typeof self != 'undefined' && self.Math == Math ? self
// eslint-disable-next-line no-new-func
: Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
/***/ }),
/* 3 */
/***/ (function(module, exports) {
module.exports = function (it) {
return typeof it === 'object' ? it !== null : typeof it === 'function';
};
/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {
// Thank's IE8 for his funny defineProperty
module.exports = !__webpack_require__(9)(function () {
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/* 5 */
/***/ (function(module, exports) {
var core = module.exports = { version: '2.6.12' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(7);
var createDesc = __webpack_require__(26);
module.exports = __webpack_require__(4) ? function (object, key, value) {
return dP.f(object, key, createDesc(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(13);
var IE8_DOM_DEFINE = __webpack_require__(34);
var toPrimitive = __webpack_require__(35);
var dP = Object.defineProperty;
exports.f = __webpack_require__(4) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
anObject(O);
P = toPrimitive(P, true);
anObject(Attributes);
if (IE8_DOM_DEFINE) try {
return dP(O, P, Attributes);
} catch (e) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
/***/ }),
/* 8 */,
/* 9 */
/***/ (function(module, exports) {
module.exports = function (exec) {
try {
return !!exec();
} catch (e) {
return true;
}
};
/***/ }),
/* 10 */
/***/ (function(module, exports) {
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function (it, key) {
return hasOwnProperty.call(it, key);
};
/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__(2);
var core = __webpack_require__(5);
var ctx = __webpack_require__(12);
var hide = __webpack_require__(6);
var has = __webpack_require__(10);
var PROTOTYPE = 'prototype';
var $export = function (type, name, source) {
var IS_FORCED = type & $export.F;
var IS_GLOBAL = type & $export.G;
var IS_STATIC = type & $export.S;
var IS_PROTO = type & $export.P;
var IS_BIND = type & $export.B;
var IS_WRAP = type & $export.W;
var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
var expProto = exports[PROTOTYPE];
var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
var key, own, out;
if (IS_GLOBAL) source = name;
for (key in source) {
// contains in native
own = !IS_FORCED && target && target[key] !== undefined;
if (own && has(exports, key)) continue;
// export native or passed
out = own ? target[key] : source[key];
// prevent global pollution for namespaces
exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
// bind timers to global for call from export context
: IS_BIND && own ? ctx(out, global)
// wrap global constructors for prevent change them in library
: IS_WRAP && target[key] == out ? (function (C) {
var F = function (a, b, c) {
if (this instanceof C) {
switch (arguments.length) {
case 0: return new C();
case 1: return new C(a);
case 2: return new C(a, b);
} return new C(a, b, c);
} return C.apply(this, arguments);
};
F[PROTOTYPE] = C[PROTOTYPE];
return F;
// make static versions for prototype methods
})(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
// export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
if (IS_PROTO) {
(exports.virtual || (exports.virtual = {}))[key] = out;
// export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
}
}
};
// type bitmap
$export.F = 1; // forced
$export.G = 2; // global
$export.S = 4; // static
$export.P = 8; // proto
$export.B = 16; // bind
$export.W = 32; // wrap
$export.U = 64; // safe
$export.R = 128; // real proto method for `library`
module.exports = $export;
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
// optional / simple context binding
var aFunction = __webpack_require__(24);
module.exports = function (fn, that, length) {
aFunction(fn);
if (that === undefined) return fn;
switch (length) {
case 1: return function (a) {
return fn.call(that, a);
};
case 2: return function (a, b) {
return fn.call(that, a, b);
};
case 3: return function (a, b, c) {
return fn.call(that, a, b, c);
};
}
return function (/* ...args */) {
return fn.apply(that, arguments);
};
};
/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(3);
module.exports = function (it) {
if (!isObject(it)) throw TypeError(it + ' is not an object!');
return it;
};
/***/ }),
/* 14 */
/***/ (function(module, exports) {
// 7.1.4 ToInteger
var ceil = Math.ceil;
var floor = Math.floor;
module.exports = function (it) {
return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};
/***/ }),
/* 15 */
/***/ (function(module, exports) {
// 7.2.1 RequireObjectCoercible(argument)
module.exports = function (it) {
if (it == undefined) throw TypeError("Can't call method on " + it);
return it;
};
/***/ }),
/* 16 */
/***/ (function(module, exports, __webpack_require__) {
// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = __webpack_require__(27);
var defined = __webpack_require__(15);
module.exports = function (it) {
return IObject(defined(it));
};
/***/ }),
/* 17 */,
/* 18 */
/***/ (function(module, exports) {
var toString = {}.toString;
module.exports = function (it) {
return toString.call(it).slice(8, -1);
};
/***/ }),
/* 19 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.15 ToLength
var toInteger = __webpack_require__(14);
var min = Math.min;
module.exports = function (it) {
return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
};
/***/ }),
/* 20 */
/***/ (function(module, exports, __webpack_require__) {
var shared = __webpack_require__(28)('keys');
var uid = __webpack_require__(21);
module.exports = function (key) {
return shared[key] || (shared[key] = uid(key));
};
/***/ }),
/* 21 */
/***/ (function(module, exports) {
var id = 0;
var px = Math.random();
module.exports = function (key) {
return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
};
/***/ }),
/* 22 */,
/* 23 */
/***/ (function(module, exports) {
module.exports = true;
/***/ }),
/* 24 */
/***/ (function(module, exports) {
module.exports = function (it) {
if (typeof it != 'function') throw TypeError(it + ' is not a function!');
return it;
};
/***/ }),
/* 25 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(3);
var document = __webpack_require__(2).document;
// typeof document.createElement is 'object' in old IE
var is = isObject(document) && isObject(document.createElement);
module.exports = function (it) {
return is ? document.createElement(it) : {};
};
/***/ }),
/* 26 */
/***/ (function(module, exports) {
module.exports = function (bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
/***/ }),
/* 27 */
/***/ (function(module, exports, __webpack_require__) {
// fallback for non-array-like ES3 and non-enumerable old V8 strings
var cof = __webpack_require__(18);
// eslint-disable-next-line no-prototype-builtins
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
return cof(it) == 'String' ? it.split('') : Object(it);
};
/***/ }),
/* 28 */
/***/ (function(module, exports, __webpack_require__) {
var core = __webpack_require__(5);
var global = __webpack_require__(2);
var SHARED = '__core-js_shared__';
var store = global[SHARED] || (global[SHARED] = {});
(module.exports = function (key, value) {
return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
version: core.version,
mode: __webpack_require__(23) ? 'pure' : 'global',
copyright: '© 2020 Denis Pushkarev (zloirock.ru)'
});
/***/ }),
/* 29 */
/***/ (function(module, exports) {
// IE 8- don't enum bug keys
module.exports = (
'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
).split(',');
/***/ }),
/* 30 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.13 ToObject(argument)
var defined = __webpack_require__(15);
module.exports = function (it) {
return Object(defined(it));
};
/***/ }),
/* 31 */,
/* 32 */,
/* 33 */,
/* 34 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = !__webpack_require__(4) && !__webpack_require__(9)(function () {
return Object.defineProperty(__webpack_require__(25)('div'), 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/* 35 */
/***/ (function(module, exports, __webpack_require__) {
// 7.1.1 ToPrimitive(input [, PreferredType])
var isObject = __webpack_require__(3);
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
module.exports = function (it, S) {
if (!isObject(it)) return it;
var fn, val;
if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
throw TypeError("Can't convert object to primitive value");
};
/***/ }),
/* 36 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var $keys = __webpack_require__(37);
var enumBugKeys = __webpack_require__(29);
module.exports = Object.keys || function keys(O) {
return $keys(O, enumBugKeys);
};
/***/ }),
/* 37 */
/***/ (function(module, exports, __webpack_require__) {
var has = __webpack_require__(10);
var toIObject = __webpack_require__(16);
var arrayIndexOf = __webpack_require__(38)(false);
var IE_PROTO = __webpack_require__(20)('IE_PROTO');
module.exports = function (object, names) {
var O = toIObject(object);
var i = 0;
var result = [];
var key;
for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
// Don't enum bug & hidden keys
while (names.length > i) if (has(O, key = names[i++])) {
~arrayIndexOf(result, key) || result.push(key);
}
return result;
};
/***/ }),
/* 38 */
/***/ (function(module, exports, __webpack_require__) {
// false -> Array#indexOf
// true -> Array#includes
var toIObject = __webpack_require__(16);
var toLength = __webpack_require__(19);
var toAbsoluteIndex = __webpack_require__(39);
module.exports = function (IS_INCLUDES) {
return function ($this, el, fromIndex) {
var O = toIObject($this);
var length = toLength(O.length);
var index = toAbsoluteIndex(fromIndex, length);
var value;
// Array#includes uses SameValueZero equality algorithm
// eslint-disable-next-line no-self-compare
if (IS_INCLUDES && el != el) while (length > index) {
value = O[index++];
// eslint-disable-next-line no-self-compare
if (value != value) return true;
// Array#indexOf ignores holes, Array#includes - not
} else for (;length > index; index++) if (IS_INCLUDES || index in O) {
if (O[index] === el) return IS_INCLUDES || index || 0;
} return !IS_INCLUDES && -1;
};
};
/***/ }),
/* 39 */
/***/ (function(module, exports, __webpack_require__) {
var toInteger = __webpack_require__(14);
var max = Math.max;
var min = Math.min;
module.exports = function (index, length) {
index = toInteger(index);
return index < 0 ? max(index + length, 0) : min(index, length);
};
/***/ }),
/* 40 */,
/* 41 */,
/* 42 */,
/* 43 */,
/* 44 */,
/* 45 */,
/* 46 */,
/* 47 */,
/* 48 */,
/* 49 */,
/* 50 */,
/* 51 */,
/* 52 */,
/* 53 */,
/* 54 */,
/* 55 */,
/* 56 */,
/* 57 */,
/* 58 */,
/* 59 */,
/* 60 */,
/* 61 */,
/* 62 */,
/* 63 */,
/* 64 */,
/* 65 */,
/* 66 */,
/* 67 */,
/* 68 */,
/* 69 */,
/* 70 */,
/* 71 */,
/* 72 */,
/* 73 */,
/* 74 */,
/* 75 */,
/* 76 */,
/* 77 */,
/* 78 */,
/* 79 */,
/* 80 */,
/* 81 */,
/* 82 */,
/* 83 */,
/* 84 */,
/* 85 */,
/* 86 */,
/* 87 */,
/* 88 */,
/* 89 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.createGlobalReference = exports.gaugeAddTestingMetadata = exports.gaugeUpdate = exports.initializeTestingMetaData = exports.getPointCoordinates = undefined;
var _keys = __webpack_require__(90);
var _keys2 = _interopRequireDefault(_keys);
var _jquery = __webpack_require__(1);
var _jquery2 = _interopRequireDefault(_jquery);
var _underscore = __webpack_require__(0);
var _underscore2 = _interopRequireDefault(_underscore);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var sanitizeClassName = function sanitizeClassName(className) {
// the className can potentially come from the search results, so make sure it is valid before
// attempting to insert it...
// first remove any leading white space
className = className.replace(/\s/g, '');
// if the className doesn't start with a letter or a '-' followed by a letter, it should not be inserted
if (!/^[-]?[A-Za-z]/.test(className)) {
return '';
}
// now filter out anything that is not a letter, number, '-', or '_'
return className.replace(/[^A-Za-z0-9_-]/g, '');
};
var addClassToElement = function addClassToElement(elem, className) {
if (!elem) {
return;
}
className = sanitizeClassName(className);
if (className === '') {
return;
}
if (elem.className.baseVal) {
elem.className.baseVal += ' ' + className;
} else {
elem.className.baseVal = className;
}
};
var getPointCoordinates = exports.getPointCoordinates = function getPointCoordinates(hcChart, seriesIndex, pointIndex) {
var series = hcChart.series[seriesIndex];
var seriesType = series.type;
var point = series.data[pointIndex];
var containerOffset = (0, _jquery2.default)(hcChart.container).offset();
if (seriesType in { line: true, area: true, scatter: true }) {
// handle the chart overlay case for bar charts
if (hcChart.inverted) {
return {
x: series.yAxis.translate(point.y) + containerOffset.left + hcChart.plotLeft,
y: hcChart.plotHeight + hcChart.plotTop + containerOffset.top - series.xAxis.translate(point.x)
};
}
return {
x: point.plotX + containerOffset.left + hcChart.plotLeft,
y: point.plotY + containerOffset.top + hcChart.plotTop
};
}
if (seriesType === 'column') {
var shapeArgs = point.shapeArgs;
return {
x: point.plotX + containerOffset.left + hcChart.plotLeft,
y: point.plotY + containerOffset.top + hcChart.plotTop + shapeArgs.height / 2
};
}
if (seriesType === 'bar') {
return {
x: containerOffset.left + hcChart.plotLeft + hcChart.plotWidth - point.shapeArgs.y - point.shapeArgs.height / 2,
y: containerOffset.top + hcChart.plotTop + hcChart.plotHeight - series.xAxis.translate(point.x) - series.barW / 2 - series.pointXOffset
};
}
if (seriesType === 'pie') {
var centerX = series.center[0];
var centerY = series.center[1];
var labelX = point.tooltipPos[0];
var labelY = point.tooltipPos[1];
return {
x: (centerX + labelX) / 2 + containerOffset.left + hcChart.plotLeft,
y: (centerY + labelY) / 2 + containerOffset.top + hcChart.plotTop
};
}
return {};
};
var addDataClasses = function addDataClasses(chart) {
var seriesName = void 0;
var dataElements = void 0;
(0, _jquery2.default)('.highcharts-series', (0, _jquery2.default)(chart.container)).each(function (i, series) {
seriesName = chart.series[i].name;
(0, _jquery2.default)(series).attr('id', seriesName + '-series');
dataElements = (0, _jquery2.default)('rect, path', (0, _jquery2.default)(series));
dataElements.each(function (j, elem) {
addClassToElement(elem, 'spl-display-object');
});
});
};
var addAxisClasses = function addAxisClasses(chart) {
var labelElements = void 0;
var i = void 0;
(0, _underscore2.default)(chart.xAxis).each(function (axis, j) {
var className = chart.inverted ? 'vertical-axis' : 'horizontal-axis';
addClassToElement(axis.axisGroup.element, className);
addClassToElement(axis.labelGroup.element, className);
addClassToElement(axis.gridGroup.element, 'x-axis-' + j + '-grid-group');
});
(0, _underscore2.default)(chart.yAxis).each(function (axis, j) {
var className = chart.inverted ? 'horizontal-axis' : 'vertical-axis';
addClassToElement(axis.axisGroup.element, className);
addClassToElement(axis.labelGroup.element, className);
addClassToElement(axis.gridGroup.element, 'y-axis-' + j + '-grid-group');
});
(0, _jquery2.default)('.highcharts-axis, .highcharts-axis-labels', (0, _jquery2.default)(chart.container)).each(function (k, elem) {
labelElements = (0, _jquery2.default)('text', (0, _jquery2.default)(elem));
labelElements.each(function (j, label) {
addClassToElement(label, 'spl-text-label');
});
});
var labelAxisTickmarks = function labelAxisTickmarks(axis) {
(0, _underscore2.default)(axis.ticks).each(function (tick) {
if (tick.mark && tick.mark.element) {
addClassToElement(tick.mark.element, 'highcharts-axis-tickmark');
}
});
};
for (i = 0; i < chart.xAxis.length; i++) {
if (chart.xAxis[i].axisTitle) {
addClassToElement(chart.xAxis[i].axisTitle.element, 'x-axis-title');
}
labelAxisTickmarks(chart.xAxis[i]);
}
for (i = 0; i < chart.yAxis.length; i++) {
if (chart.yAxis[i].axisTitle) {
addClassToElement(chart.yAxis[i].axisTitle.element, 'y-axis-title');
}
labelAxisTickmarks(chart.yAxis[i]);
}
};
var addLegendClasses = function addLegendClasses(chart) {
var loopSeriesName = void 0;
if (chart.legend && chart.legend.down) {
addClassToElement(chart.legend.down.element, 'page-down-button');
}
if (chart.legend && chart.legend.up) {
addClassToElement(chart.legend.up.element, 'page-up-button');
}
(0, _jquery2.default)(chart.series).each(function (i, series) {
if (!series.legendItem) {
return;
}
loopSeriesName = series.legendItem.textStr;
if (series.legendSymbol) {
addClassToElement(series.legendSymbol.element, 'symbol');
addClassToElement(series.legendSymbol.element, loopSeriesName + '-symbol');
}
if (series.legendLine) {
addClassToElement(series.legendLine.element, 'symbol');
addClassToElement(series.legendLine.element, loopSeriesName + '-symbol');
}
if (series.legendItem) {
addClassToElement(series.legendItem.element, 'legend-label');
}
});
};
var addTimeTooltipClasses = function addTimeTooltipClasses() {
var i = void 0;
var loopSplit = void 0;
var toolTipCells = void 0;
var $tooltip = (0, _jquery2.default)('.highcharts-tooltip');
var tooltipElements = (0, _jquery2.default)('tr', $tooltip);
for (i = 0; i < tooltipElements.length; i++) {
toolTipCells = (0, _jquery2.default)('td', tooltipElements[i]);
if (i === 0) {
(0, _jquery2.default)(toolTipCells[0]).addClass('time-value');
(0, _jquery2.default)(toolTipCells[0]).addClass('time');
} else {
loopSplit = tooltipElements[i].textContent.split(':');
(0, _jquery2.default)(toolTipCells[0]).addClass('key');
(0, _jquery2.default)(toolTipCells[0]).addClass(sanitizeClassName(loopSplit[0] + '-key'));
(0, _jquery2.default)(toolTipCells[1]).addClass('value');
(0, _jquery2.default)(toolTipCells[1]).addClass(sanitizeClassName(loopSplit[0] + '-value'));
}
}
};
var addTooltipClasses = function addTooltipClasses() {
var i = void 0;
var loopSplit = void 0;
var toolTipCells = void 0;
var $tooltip = (0, _jquery2.default)('.highcharts-tooltip');
var tooltipElements = (0, _jquery2.default)('tr', $tooltip);
for (i = 0; i < tooltipElements.length; i++) {
toolTipCells = (0, _jquery2.default)('td', tooltipElements[i]);
loopSplit = tooltipElements[i].textContent;
(0, _jquery2.default)(toolTipCells[0]).addClass('key');
(0, _jquery2.default)(toolTipCells[0]).addClass(sanitizeClassName(loopSplit[0] + '-key'));
(0, _jquery2.default)(toolTipCells[1]).addClass('value');
(0, _jquery2.default)(toolTipCells[1]).addClass(sanitizeClassName(loopSplit[0] + '-value'));
}
};
var initializeTestingMetaData = exports.initializeTestingMetaData = function initializeTestingMetaData(chartWrapper, xFields, type) {
chartWrapper.$container.addClass('highcharts-wrapper');
// make sure the wrapper container has an id, this will be used in createGlobalReference
if (!chartWrapper.$container.attr('id')) {
chartWrapper.$container.attr('id', chartWrapper.id);
}
var chart = chartWrapper.hcChart;
(0, _jquery2.default)(chart.container).addClass(type);
addDataClasses(chart);
addAxisClasses(chart);
if (chart.options.legend.enabled) {
addLegendClasses(chart);
}
if (chart.tooltip && chart.tooltip.refresh) {
var tooltipRefresh = chart.tooltip.refresh;
var decorateTooltip = _underscore2.default.find(xFields, function (field) {
return field === '_time';
}) === '_time' ? addTimeTooltipClasses : addTooltipClasses;
chart.tooltip.refresh = function (point) {
tooltipRefresh.call(chart.tooltip, point);
decorateTooltip(chart);
};
}
chart.getPointCoordinates = (0, _underscore2.default)(getPointCoordinates).bind(null, chart);
};
// ////////////////////////
// Gauge specific testing
var gaugeUpdate = exports.gaugeUpdate = function gaugeUpdate(container, value) {
container.attr('data-gauge-value', value);
};
var gaugeAddTestingMetadata = exports.gaugeAddTestingMetadata = function gaugeAddTestingMetadata(gaugeWrapper, elements, typeName, value) {
// make sure the wrapper container has an id, this will be used in createGlobalReference
if (!gaugeWrapper.$container.attr('id')) {
gaugeWrapper.$container.attr('id', gaugeWrapper.id);
}
var innerContainer = gaugeWrapper.$hcContainer;
innerContainer.addClass(typeName);
gaugeUpdate(innerContainer, value);
if (elements.valueDisplay) {
addClassToElement(elements.valueDisplay.element, 'gauge-value');
}
var elementKeys = (0, _keys2.default)(elements);
elementKeys.filter(function (key) {
return (/^tickLabel_/.test(key)
);
}).forEach(function (key) {
addClassToElement(elements[key].element, 'gauge-tick-label');
});
elementKeys.filter(function (key) {
return (/^colorBand/.test(key)
);
}).forEach(function (key) {
addClassToElement(elements[key].element, 'gauge-color-band');
});
(0, _jquery2.default)('.gauge-color-band').each(function addDataColorBand() {
(0, _jquery2.default)(this).attr('data-band-color', (0, _jquery2.default)(this).attr('fill'));
});
// this is bad OOP but I think it's better to keep all of this code in one method
if (elements.fill) {
(0, _jquery2.default)(elements.fill.element).attr('data-indicator-color', (0, _jquery2.default)(elements.fill.element).attr('fill'));
}
if (elements.needle) {
addClassToElement(elements.needle.element, 'gauge-indicator');
}
if (elements.markerLine) {
addClassToElement(elements.markerLine.element, 'gauge-indicator');
}
};
var createGlobalReference = exports.createGlobalReference = function createGlobalReference(wrapperObject, chartObject) {
var Splunk = window.Splunk;
if (!Splunk) {
return;
}
Splunk.JSCharting = Splunk.JSCharting || {};
Splunk.JSCharting.chartByIdMap = Splunk.JSCharting.chartByIdMap || {};
var id = wrapperObject.$container.attr('id');
Splunk.JSCharting.chartByIdMap[id] = chartObject;
};
/***/ }),
/* 90 */
/***/ (function(module, exports, __webpack_require__) {
module.exports = { "default": __webpack_require__(91), __esModule: true };
/***/ }),
/* 91 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(92);
module.exports = __webpack_require__(5).Object.keys;
/***/ }),
/* 92 */
/***/ (function(module, exports, __webpack_require__) {
// 19.1.2.14 Object.keys(O)
var toObject = __webpack_require__(30);
var $keys = __webpack_require__(36);
__webpack_require__(93)('keys', function () {
return function keys(it) {
return $keys(toObject(it));
};
});
/***/ }),
/* 93 */
/***/ (function(module, exports, __webpack_require__) {
// most Object methods by ES6 should accept primitives
var $export = __webpack_require__(11);
var core = __webpack_require__(5);
var fails = __webpack_require__(9);
module.exports = function (KEY, exec) {
var fn = (core.Object || {})[KEY] || Object[KEY];
var exp = {};
exp[KEY] = exec(fn);
$export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
};
/***/ })
/******/ ]);
/***/ }),
/***/ "./node_modules/@splunk/charting-utils/time.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 94);
/******/ })
/************************************************************************/
/******/ ({
/***/ 0:
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/underscore/modules/index-all.js");
/***/ }),
/***/ 22:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
/* eslint-disable */
/*
* Copied from js/stubs/i18n.js in the core UI repository, since the logic is unlikely to change and this saves
* us the trouble of taking a dependency on the SplunkWebCore bower module.
*/
/*
* monkey patches to the i18n library
* see SPL-75565
*/
// NOTE: this code block is duplicated in the util/test_i18n_patches.html unit test.
// any changes made here must also be reflected there.
if (window.locale_name() in { ko_KR: true, zh_CN: true, zh_TW: true }) {
window._i18n_locale.date_formats['short'] = { pattern: 'yy/MM/dd', format: '%(yy)s/%(MM)s/%(dd)s' };
window._i18n_locale.date_formats['medium'] = { pattern: 'yyyy/MM/dd', format: '%(yyyy)s/%(MM)s/%(dd)s' };
window._i18n_locale.time_formats['short'] = { pattern: 'H:mm', format: '%(H)s:%(mm)s' };
window._i18n_locale.time_formats['medium'] = { pattern: 'H:mm:ss', format: '%(H)s:%(mm)s:%(ss)s' };
}
var asianLanguageDateReplacements = [[/^ccc MMM d$/, 'M/d (ccc)'], [/^YYYY-MM/, 'YYYY/MM'], [/MM-dd/, 'MM/dd']];
// maintain a hash of locales where custom string replacements are needed to get correct translation
var FORMAT_DATE_REPLACEMENTS = {
ja_JP: asianLanguageDateReplacements,
ko_KR: asianLanguageDateReplacements,
zh_CN: asianLanguageDateReplacements,
zh_TW: asianLanguageDateReplacements
};
// maintain a list of replacements needed when a locale specifies that day comes before month
var DAY_FIRST_FORMATS = [['MMM d', 'd MMM']];
var oldFormatDate = window.format_date;
window.format_date = function (date, format) {
format = format || 'medium';
var i,
replacements,
locale = window.locale_name();
if (format && typeof format === 'string' && window.locale_uses_day_before_month()) {
replacements = DAY_FIRST_FORMATS;
for (i = 0; i < replacements.length; i++) {
format = format.replace(replacements[i][0], replacements[i][1]);
}
}
if (format && typeof format === 'string' && locale in FORMAT_DATE_REPLACEMENTS) {
replacements = FORMAT_DATE_REPLACEMENTS[locale];
for (i = 0; i < replacements.length; i++) {
var replacement = replacements[i];
format = format.replace(replacement[0], replacement[1]);
}
}
return oldFormatDate(date, format);
};
exports.default = {
_: window.gettext,
ungettext: window.ungettext,
format_decimal: window.format_decimal,
format_number: window.format_number,
format_percent: window.format_percent,
format_scientific: window.format_scientific,
format_date: window.format_date,
format_datetime: window.format_datetime,
format_time: window.format_time,
format_datetime_microseconds: window.format_datetime_microseconds,
format_time_microseconds: window.format_time_microseconds,
locale_uses_day_before_month: window.locale_uses_day_before_month,
format_datetime_range: window.format_datetime_range,
locale_name: window.locale_name,
DateTime: window.DateTime,
moment_install: window.moment_install,
numeral_install: window.numeral_install,
jQuery_ui_datepicker_install: window.jQuery_ui_datepicker_install
};
module.exports = exports['default'];
/***/ }),
/***/ 43:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _console = window.console;
var setLoggingConsole = exports.setLoggingConsole = function setLoggingConsole(newConsole) {
_console = newConsole;
};
var bindConsole = function bindConsole(fnName) {
return function () {
var _console2;
(_console2 = _console)[fnName].apply(_console2, arguments);
};
};
var debug = exports.debug = bindConsole('debug');
var info = exports.info = bindConsole('info');
var warn = exports.warn = bindConsole('warn');
var error = exports.error = bindConsole('error');
var log = exports.log = bindConsole('log');
var trace = exports.trace = bindConsole('trace');
exports.default = {
setLoggingConsole: setLoggingConsole,
debug: debug,
info: info,
warn: warn,
error: error,
log: log,
trace: trace
};
/***/ }),
/***/ 94:
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _underscore = __webpack_require__(0);
var _underscore2 = _interopRequireDefault(_underscore);
var _moment = __webpack_require__(95);
var _moment2 = _interopRequireDefault(_moment);
var _i18n = __webpack_require__(22);
var _i18n2 = _interopRequireDefault(_i18n);
var _logger = __webpack_require__(43);
var logger = _interopRequireWildcard(_logger);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// TimeUtils
var BD_TIME_REGEX_MILLIS = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})\.(\d+)[+-]{1}\d{2}[:]?\d{2}$/;
var BD_TIME_REGEX_NO_MILLIS = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})[+-]{1}\d{2}[:]?\d{2}$/;
function BdTime(isoString) {
var bdPieces = BD_TIME_REGEX_MILLIS.exec(isoString) || BD_TIME_REGEX_NO_MILLIS.exec(isoString);
if (!bdPieces) {
this.isInvalid = true;
} else {
this.year = parseInt(bdPieces[1], 10);
this.month = parseInt(bdPieces[2], 10);
this.day = parseInt(bdPieces[3], 10);
this.hour = parseInt(bdPieces[4], 10);
this.minute = parseInt(bdPieces[5], 10);
this.second = parseInt(bdPieces[6], 10);
this.millisecond = bdPieces.length > 7 ? parseInt(bdPieces[7], 10) : 0;
}
}
var _extractBdTime = function _extractBdTime(timeString) {
return new BdTime(timeString);
};
var _calculateTimeFormat = function _calculateTimeFormat(time, spanSeries) {
var span = parseFloat(spanSeries[0]);
if (!(time instanceof BdTime)) {
time = _extractBdTime(time);
}
if (!span) {
return time.millisecond === 0 ? 'second' : 'millisecond';
}
if (span >= 0 && span < 1 || time.millisecond !== 0) {
return 'millisecond';
}
if (span >= 1 && span < 60 || time.second !== 0) {
return 'second';
}
if (span >= 60 && span < 3600 || time.minute !== 0) {
return 'minute';
}
if (span >= 3600 && span <= 82800 || time.hour !== 0) {
// 23 hour (82800)
return 'hour';
}
if (span > 82800 && span <= 2419200 || time.day !== 1) {
// 1 day to 28 days
return 'day';
}
if (span > 2419200 && span <= 31535999 || time.month !== 1) {
// 28 days - 1 year
return 'month';
}
if (span >= 31536000) {
// year
return 'year';
}
logger.log('_span value (' + span + ') did not meet any time formatting condition');
return 'second';
};
var bdTimeToDateObject = function bdTimeToDateObject(bdTime) {
var year = bdTime.year;
var month = bdTime.month - 1;
var day = bdTime.day;
var hour = bdTime.hour;
var minute = bdTime.minute;
var second = bdTime.second;
var millisecond = bdTime.millisecond;
return new Date(year, month, day, hour, minute, second, millisecond);
};
// Not used?
//
// const getTimezoneString = dateObj => {
// const timezoneOffset = dateObj.getTimezoneOffset();
// const absoluteValueTimezoneOffset = Math.abs(timezoneOffset);
// const hours = Math.floor(absoluteValueTimezoneOffset / 60);
// const minutes = absoluteValueTimezoneOffset % 60;
// const formattedHours = hours < 10 ? `0${hours}` : `${hours}`;
// const formattedMinutes = minutes < 10 ? `0${minutes}` : `${minutes}`;
// return `${(timezoneOffset > 0 ? '-' : '+') + formattedHours}:${formattedMinutes}`;
// };
//
// const isValidIsoTime = str => BD_TIME_REGEX_MILLIS.test(str) || BD_TIME_REGEX_NO_MILLIS.test(str);
var TimeUtils = {
SECS_PER_MIN: 60,
SECS_PER_HOUR: 60 * 60,
isoToDateObject: function isoToDateObject(isoString) {
return (0, _moment2.default)(isoString).toDate();
},
// Returns the epoch seconds in string form.
getEpochTimeFromISO: function getEpochTimeFromISO(timeString) {
var millis = TimeUtils.isoToDateObject(timeString).getTime();
return (millis / 1000).toFixed(3);
},
extractBdTime: function extractBdTime(timeString) {
return _extractBdTime(timeString);
},
determineLabelGranularity: function determineLabelGranularity(times, spanSeries) {
if (!(times[0] instanceof BdTime)) {
times = (0, _underscore2.default)(times).map(TimeUtils.extractBdTime);
}
times = (0, _underscore2.default)(times).filter(function (time) {
return !time.isInvalid;
});
if (times.length === 1 && (!spanSeries || spanSeries.length === 0)) {
return times[0].millisecond === 0 ? 'second' : 'millisecond';
}
if (times.length === 1 && spanSeries) {
return _calculateTimeFormat(times[0], spanSeries);
}
var milliseconds = [];
var seconds = [];
var minutes = [];
var hours = [];
var days = [];
var months = [];
var allInListMatch = function allInListMatch(list, matchMe) {
for (var i = 0; i < list.length; i++) {
if (list[i] !== matchMe) {
return false;
}
}
return true;
};
(0, _underscore2.default)(times).each(function (time) {
milliseconds.push(time.millisecond);
seconds.push(time.second);
minutes.push(time.minute);
hours.push(time.hour);
days.push(time.day);
months.push(time.month);
});
if (!allInListMatch(milliseconds, 0)) {
return 'millisecond';
}
if (!allInListMatch(seconds, 0)) {
return 'second';
}
if (!allInListMatch(minutes, 0)) {
return 'minute';
}
if (!allInListMatch(hours, 0)) {
return 'hour';
}
if (!allInListMatch(days, 1)) {
return 'day';
}
if (!allInListMatch(months, 1)) {
return 'month';
}
return 'year';
},
formatBdTimeAsAxisLabel: function formatBdTimeAsAxisLabel(time, prevBdTime, granularity) {
if (time.isInvalid) {
return null;
}
var dateTime = bdTimeToDateObject(time);
var showDay = granularity in { millisecond: true, second: true, minute: true, hour: true, day: true };
var showTimes = granularity in { millisecond: true, second: true, minute: true, hour: true };
var showSeconds = granularity in { millisecond: true, second: true };
var showMillis = granularity === 'millisecond';
var timeFormat = showSeconds ? 'medium' : 'short';
var dateFormat = showDay ? 'ccc MMM d' : 'MMMM';
var formatTime = function formatTime(dt, format) {
if (showMillis) {
return _i18n2.default.format_time_microseconds(dt, format);
}
return _i18n2.default.format_time(dt, format);
};
if (granularity === 'year') {
return [_i18n2.default.format_date(dateTime, 'YYYY')];
}
if (prevBdTime && prevBdTime.year === time.year && time.month === prevBdTime.month && time.day === prevBdTime.day) {
return [formatTime(dateTime, timeFormat)];
}
var formattedPieces = showTimes ? [formatTime(dateTime, timeFormat), _i18n2.default.format_date(dateTime, dateFormat)] : [_i18n2.default.format_date(dateTime, dateFormat)];
if (!prevBdTime || time.year !== prevBdTime.year) {
formattedPieces.push(_i18n2.default.format_date(dateTime, 'YYYY'));
}
return formattedPieces;
}
};
exports.default = TimeUtils;
module.exports = exports['default'];
/***/ }),
/***/ 95:
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/@splunk/moment/index.js");
/***/ })
/******/ });
/***/ }),
/***/ "./node_modules/@splunk/charting/lib/index.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 112);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/jquery/dist/jquery.js");
/***/ }),
/* 1 */
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/underscore/modules/index-all.js");
/***/ }),
/* 2 */
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/@splunk/charting-utils/lang.js");
/***/ }),
/* 3 */
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/@splunk/charting-utils/parsing.js");
/***/ }),
/* 4 */
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/@splunk/highcharts-themes/theme.js");
/***/ }),
/* 5 */
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/@splunk/charting-utils/math.js");
/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {
var freeGlobal = __webpack_require__(68);
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
module.exports = root;
/***/ }),
/* 7 */
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/@splunk/charting-utils/color.js");
/***/ }),
/* 8 */
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/@splunk/highcharts/highcharts.js");
/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
exports.__esModule = true;
var _assign = __webpack_require__(185);
var _assign2 = _interopRequireDefault(_assign);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = _assign2.default || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __webpack_require__(0);
var _jquery2 = _interopRequireDefault(_jquery);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = {
on: function on(eventType, callback) {
(0, _jquery2.default)(this).on(eventType, callback);
},
off: function off(eventType, callback) {
(0, _jquery2.default)(this).off(eventType, callback);
},
trigger: function trigger(eventType, extraParams) {
(0, _jquery2.default)(this).trigger(eventType, extraParams);
}
};
module.exports = exports['default'];
/***/ }),
/* 11 */
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/@splunk/charting-utils/Formatter.js");
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {
var store = __webpack_require__(94)('wks');
var uid = __webpack_require__(96);
var Symbol = __webpack_require__(19).Symbol;
var USE_SYMBOL = typeof Symbol == 'function';
var $exports = module.exports = function (name) {
return store[name] || (store[name] =
USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
};
$exports.store = store;
/***/ }),
/* 13 */
/***/ (function(module, exports) {
/**
* Checks if `value` is classified as an `Array` object.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
* @example
*
* _.isArray([1, 2, 3]);
* // => true
*
* _.isArray(document.body.children);
* // => false
*
* _.isArray('abc');
* // => false
*
* _.isArray(_.noop);
* // => false
*/
var isArray = Array.isArray;
module.exports = isArray;
/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {
var baseGetTag = __webpack_require__(23),
isObjectLike = __webpack_require__(18);
/** `Object#toString` result references. */
var symbolTag = '[object Symbol]';
/**
* Checks if `value` is classified as a `Symbol` primitive or object.
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
* @example
*
* _.isSymbol(Symbol.iterator);
* // => true
*
* _.isSymbol('abc');
* // => false
*/
function isSymbol(value) {
return typeof value == 'symbol' ||
(isObjectLike(value) && baseGetTag(value) == symbolTag);
}
module.exports = isSymbol;
/***/ }),
/* 15 */
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/@splunk/charting-utils/i18n.js");
/***/ }),
/* 16 */
/***/ (function(module, exports) {
/**
* This method returns the first argument it receives.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {*} value Any value.
* @returns {*} Returns `value`.
* @example
*
* var object = { 'a': 1 };
*
* console.log(_.identity(object) === object);
* // => true
*/
function identity(value) {
return value;
}
module.exports = identity;
/***/ }),
/* 17 */
/***/ (function(module, exports) {
/**
* Checks if `value` is the
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
* @example
*
* _.isObject({});
* // => true
*
* _.isObject([1, 2, 3]);
* // => true
*
* _.isObject(_.noop);
* // => true
*
* _.isObject(null);
* // => false
*/
function isObject(value) {
var type = typeof value;
return value != null && (type == 'object' || type == 'function');
}
module.exports = isObject;
/***/ }),
/* 18 */
/***/ (function(module, exports) {
/**
* Checks if `value` is object-like. A value is object-like if it's not `null`
* and has a `typeof` result of "object".
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
* @example
*
* _.isObjectLike({});
* // => true
*
* _.isObjectLike([1, 2, 3]);
* // => true
*
* _.isObjectLike(_.noop);
* // => false
*
* _.isObjectLike(null);
* // => false
*/
function isObjectLike(value) {
return value != null && typeof value == 'object';
}
module.exports = isObjectLike;
/***/ }),
/* 19 */
/***/ (function(module, exports) {
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
? window : typeof self != 'undefined' && self.Math == Math ? self
// eslint-disable-next-line no-new-func
: Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
/***/ }),
/* 20 */
/***/ (function(module, exports) {
var core = module.exports = { version: '2.6.12' };
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
/***/ }),
/* 21 */
/***/ (function(module, exports, __webpack_require__) {
// Thank's IE8 for his funny defineProperty
module.exports = !__webpack_require__(47)(function () {
return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});
/***/ }),
/* 22 */
/***/ (function(module, exports, __webpack_require__) {
var baseIsNative = __webpack_require__(126),
getValue = __webpack_require__(133);
/**
* Gets the native function at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the method to get.
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = getValue(object, key);
return baseIsNative(value) ? value : undefined;
}
module.exports = getNative;
/***/ }),
/* 23 */
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__(39),
getRawTag = __webpack_require__(128),
objectToString = __webpack_require__(129);
/** `Object#toString` result references. */
var nullTag = '[object Null]',
undefinedTag = '[object Undefined]';
/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* The base implementation of `getTag` without fallbacks for buggy environments.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the `toStringTag`.
*/
function baseGetTag(value) {
if (value == null) {
return value === undefined ? undefinedTag : nullTag;
}
return (symToStringTag && symToStringTag in Object(value))
? getRawTag(value)
: objectToString(value);
}
module.exports = baseGetTag;
/***/ }),
/* 24 */
/***/ (function(module, exports, __webpack_require__) {
var baseCreate = __webpack_require__(40),
isObject = __webpack_require__(17);
/**
* Creates a function that produces an instance of `Ctor` regardless of
* whether it was invoked as part of a `new` expression or by `call` or `apply`.
*
* @private
* @param {Function} Ctor The constructor to wrap.
* @returns {Function} Returns the new wrapped function.
*/
function createCtor(Ctor) {
return function() {
// Use a `switch` statement to work with class constructors. See
// http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
// for more details.
var args = arguments;
switch (args.length) {
case 0: return new Ctor;
case 1: return new Ctor(args[0]);
case 2: return new Ctor(args[0], args[1]);
case 3: return new Ctor(args[0], args[1], args[2]);
case 4: return new Ctor(args[0], args[1], args[2], args[3]);
case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
}
var thisBinding = baseCreate(Ctor.prototype),
result = Ctor.apply(thisBinding, args);
// Mimic the constructor's `return` behavior.
// See https://es5.github.io/#x13.2.2 for more details.
return isObject(result) ? result : thisBinding;
};
}
module.exports = createCtor;
/***/ }),
/* 25 */
/***/ (function(module, exports) {
/** Used as the internal argument placeholder. */
var PLACEHOLDER = '__lodash_placeholder__';
/**
* Replaces all `placeholder` elements in `array` with an internal placeholder
* and returns an array of their indexes.
*
* @private
* @param {Array} array The array to modify.
* @param {*} placeholder The placeholder to replace.
* @returns {Array} Returns the new array of placeholder indexes.
*/
function replaceHolders(array, placeholder) {
var index = -1,
length = array.length,
resIndex = 0,
result = [];
while (++index < length) {
var value = array[index];
if (value === placeholder || value === PLACEHOLDER) {
array[index] = PLACEHOLDER;
result[resIndex++] = index;
}
}
return result;
}
module.exports = replaceHolders;
/***/ }),
/* 26 */
/***/ (function(module, exports) {
module.exports = function(module) {
if(!module.webpackPolyfill) {
module.deprecate = function() {};
module.paths = [];
// module.parent = undefined by default
if(!module.children) module.children = [];
Object.defineProperty(module, "loaded", {
enumerable: true,
get: function() {
return module.l;
}
});
Object.defineProperty(module, "id", {
enumerable: true,
get: function() {
return module.i;
}
});
module.webpackPolyfill = 1;
}
return module;
};
/***/ }),
/* 27 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends2 = __webpack_require__(9);
var _extends3 = _interopRequireDefault(_extends2);
var _jquery = __webpack_require__(0);
var _jquery2 = _interopRequireDefault(_jquery);
var _underscore = __webpack_require__(1);
var _underscore2 = _interopRequireDefault(_underscore);
var _sortedLastIndex = __webpack_require__(197);
var _sortedLastIndex2 = _interopRequireDefault(_sortedLastIndex);
var _moment = __webpack_require__(85);
var _moment2 = _interopRequireDefault(_moment);
var _bowser = __webpack_require__(53);
var _bowser2 = _interopRequireDefault(_bowser);
var _highcharts = __webpack_require__(8);
var _highcharts2 = _interopRequireDefault(_highcharts);
var _lang = __webpack_require__(2);
var _testing = __webpack_require__(98);
var testingUtils = _interopRequireWildcard(_testing);
var _parsing = __webpack_require__(3);
var parsingUtils = _interopRequireWildcard(_parsing);
var _color = __webpack_require__(7);
var colorUtils = _interopRequireWildcard(_color);
var _convertSplunkTimezone = __webpack_require__(200);
var _convertSplunkTimezone2 = _interopRequireDefault(_convertSplunkTimezone);
var _time = __webpack_require__(54);
var _time2 = _interopRequireDefault(_time);
var _async = __webpack_require__(201);
var _field = __webpack_require__(86);
var fieldUtils = _interopRequireWildcard(_field);
var _math = __webpack_require__(5);
var mathUtils = _interopRequireWildcard(_math);
var _logger = __webpack_require__(64);
var logger = _interopRequireWildcard(_logger);
var _constants = __webpack_require__(32);
var _theme = __webpack_require__(4);
var _Visualization = __webpack_require__(99);
var _Visualization2 = _interopRequireDefault(_Visualization);
var _ColorPalette = __webpack_require__(44);
var _ColorPalette2 = _interopRequireDefault(_ColorPalette);
var _TimeAxis = __webpack_require__(202);
var _TimeAxis2 = _interopRequireDefault(_TimeAxis);
var _CategoryAxis = __webpack_require__(203);
var _CategoryAxis2 = _interopRequireDefault(_CategoryAxis);
var _NumericAxis = __webpack_require__(56);
var _NumericAxis2 = _interopRequireDefault(_NumericAxis);
var _Legend = __webpack_require__(205);
var _Legend2 = _interopRequireDefault(_Legend);
var _Tooltip = __webpack_require__(241);
var _Tooltip2 = _interopRequireDefault(_Tooltip);
var _SelectionWindow = __webpack_require__(242);
var _SelectionWindow2 = _interopRequireDefault(_SelectionWindow);
var _PanButtons = __webpack_require__(244);
var _PanButtons2 = _interopRequireDefault(_PanButtons);
var _ZoomOutButton = __webpack_require__(247);
var _ZoomOutButton2 = _interopRequireDefault(_ZoomOutButton);
var _HoverEventThrottler = __webpack_require__(36);
var _HoverEventThrottler2 = _interopRequireDefault(_HoverEventThrottler);
var _CartesianDataLabels = __webpack_require__(248);
var _CartesianDataLabels2 = _interopRequireDefault(_CartesianDataLabels);
var _series_factory = __webpack_require__(249);
var _series_factory2 = _interopRequireDefault(_series_factory);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var MULTISERIES_MODE = 'seriesCompare';
function Chart(container, properties) {
_Visualization2.default.call(this, container, properties);
}
(0, _lang.inherit)(Chart, _Visualization2.default);
_jquery2.default.extend(Chart.prototype, {
HOVER_DELAY: 160,
EXPORT_WIDTH: 600,
EXPORT_HEIGHT: 400,
FALLBACK_HEIGHT: 250,
FALLBACK_WIDTH: 600,
PROGRESSIVE_DRAW_THRESHOLD: 1000,
ANNOTATION_COLORS: ['#E19747', '#5F7395', '#3E9887', '#784772', '#A24940'].map(colorUtils.hexFromColor),
hasLegend: true,
hasTooltip: true,
hasXAxis: true,
hasYAxis: true,
legendMode: 'standard',
requiresExternalColors: true,
externalPaletteMapping: {},
externalPaletteSize: 0,
prepare: function prepare(dataSet, properties) {
this.benchmark('Prepare Started');
var wasEmpty = this.isEmpty();
var hadTimeXAxis = this.hasTimeXAxis();
_Visualization2.default.prototype.prepare.call(this, dataSet, properties);
if (this.showLabels === 'all' || this.showLabels === 'minmax') {
this.initializeDataLabels();
}
this.initializeFields();
this.isiOS = !!_bowser2.default.ios;
var isEmpty = this.isEmpty();
var hasTimeXAxis = this.hasTimeXAxis();
if (isEmpty !== wasEmpty || hadTimeXAxis !== hasTimeXAxis) {
this._isDirty = true;
}
this.resetHighlight();
if (this.shouldUpdateInPlace()) {
this.updateSeriesProperties();
this.updateAxisProperties();
if (!isEmpty) {
this.setAllSeriesData();
}
} else {
if (!isEmpty) {
this.initializeColorPalette();
}
this.initializeSeriesList();
// Determine orientation based on the chart type, not the series types (SPL-86199).
this.axesAreInverted = this.type === 'bar';
if (this.hasXAxis) {
this.initializeXAxisList();
}
if (this.hasYAxis) {
this.initializeYAxisList();
}
if (isEmpty) {
if (this.legend) {
this.legend.destroy();
this.legend = null;
}
if (this.tooltip) {
this.tooltip.destroy();
this.tooltip = null;
}
} else {
if (this.hasLegend) {
this.initializeLegend();
}
if (this.hasTooltip) {
this.initializeTooltip();
}
this.setAllSeriesData();
this.bindSeriesEvents();
}
}
},
initializeDataLabels: function initializeDataLabels() {
this.dataLabels = new _CartesianDataLabels2.default({
showLabels: this.showLabels,
splitSeries: this.splitSeries
});
},
getFieldList: function getFieldList() {
return (0, _underscore2.default)(this.seriesList).chain().invoke('getFieldList').flatten(true).compact().value();
},
setExternalColorPalette: function setExternalColorPalette(fieldIndexMap, paletteTotalSize) {
this.externalPaletteMapping = _jquery2.default.extend({}, fieldIndexMap);
this.externalPaletteSize = paletteTotalSize;
},
handleDraw: function handleDraw(callback) {
logger.debug('drawing a chart with dimensions:', {
width: this.width,
height: this.height
});
logger.debug('drawing a chart with properties:', this.properties);
logger.debug('drawing a chart with data:', this.dataSet.toJSON());
this.benchmark('Draw Started');
this.applyColorPalette();
// if there is already a draw in progress, cancel it
this.cancelPendingDraw();
if (this.shouldUpdateInPlace()) {
this.redrawInPlace(callback);
return;
}
this.hcConfig = this.getConfig();
logger.debug('config object to be sent to highcharts:', this.hcConfig);
if (this.hcChart) {
this.destroy();
this.bindSeriesEvents();
if (this.legend) {
this.bindLegendEvents();
}
}
if (this.shouldProgressiveDraw()) {
this.hcConfig.firstRenderOverride = (0, _underscore2.default)(this.firstRenderOverride).bind(this);
this.hcConfig.renderOverride = (0, _underscore2.default)(this.renderOverride).bind(this);
}
var that = this;
// eslint-disable-next-line no-new
new _highcharts2.default.Chart(this.hcConfig, function (chart) {
that.hcChart = chart;
if (that.testMode) {
testingUtils.initializeTestingMetaData(that, that.xFields, that.getClassName());
testingUtils.createGlobalReference(that, chart);
}
that.onChartLoad(chart);
that.onChartLoadOrRedraw(chart);
if (that.hasTooltip && !that.isEmpty()) {
that.enableTooltip(chart);
}
that.cacheDrawnDimensions();
that.benchmark('Draw Finished');
callback(that, that.benchmarks);
// DEBUGGING
// window.chart = that
});
},
redrawInPlace: function redrawInPlace(callback) {
var _this = this;
logger.debug('in place redraw!');
if (!this.hcChart) {
throw new Error('Cannot call redrawInPlace if chart does not already exist');
}
// redraw all series in the list
(0, _underscore2.default)(this.seriesList).invoke('redraw', false);
var existingChartSeries = this.hcChart.series;
var incomingSeriesConfigs = this.getSeriesConfigList();
// if there are more existing series than incoming, remove the extras
if (existingChartSeries.length > incomingSeriesConfigs.length) {
(0, _underscore2.default)(existingChartSeries.slice(incomingSeriesConfigs.length)).invoke('remove', false);
} else if (existingChartSeries.length < incomingSeriesConfigs.length) {
// if there are more incoming series than existing, add the new ones
(0, _underscore2.default)(incomingSeriesConfigs.slice(existingChartSeries.length)).each(function (seriesConfig) {
_this.hcChart.addSeries(seriesConfig, false, false);
});
}
var preUpdateExtremes = void 0;
var postUpdateExtremes = void 0;
var xAxis = this.xAxisList[0];
var axisWasZoomed = xAxis.isZoomed;
if (axisWasZoomed) {
preUpdateExtremes = this.hcChart.xAxis[0].getExtremes();
preUpdateExtremes.max -= xAxis.hasTickmarksBetween() ? 0 : 1;
} else if (this.selectionWindow) {
preUpdateExtremes = this.selectionWindow.getExtremes();
preUpdateExtremes.min += xAxis.hasTickmarksBetween() ? 1 : 0;
}
if (preUpdateExtremes) {
postUpdateExtremes = this.calculatePostUpdateExtremes(preUpdateExtremes);
}
// redraw the axes
(0, _underscore2.default)(this.xAxisList).invoke('redraw', false);
(0, _underscore2.default)(this.yAxisList).invoke('redraw', false);
if (axisWasZoomed) {
if (postUpdateExtremes.min === null || postUpdateExtremes.max === null) {
this.hcChart.xAxis[0].zoom();
} else {
postUpdateExtremes.max += xAxis.hasTickmarksBetween() ? 0 : 1;
this.hcChart.xAxis[0].zoom(postUpdateExtremes.min, postUpdateExtremes.max, postUpdateExtremes.dataMax, postUpdateExtremes.dataMin);
}
} else if (this.selectionWindow) {
if (postUpdateExtremes.max === null) {
this.selectionWindow.destroy();
this.selectionWindow = null;
} else {
postUpdateExtremes.min = (postUpdateExtremes.min || 0) - (xAxis.hasTickmarksBetween() ? 1 : 0);
this.selectionWindow.setExtremes(postUpdateExtremes);
}
}
// force Highcharts to redraw
this.hcChart.redraw();
this.benchmark('Series Redraw Finished');
callback(this, this.benchmarks);
},
cancelPendingDraw: function cancelPendingDraw() {
if (this.pendingDraw && this.pendingDraw.state() === 'pending') {
this.pendingDraw.cancel();
// TODO [sff] do we need to do anything with the deferred that draw() returned? currently it just stays pending
}
},
setSize: function setSize(width, height) {
if (!this.hcChart) {
return;
}
var xAxis = this.hcChart.xAxis[0];
// SPL-80149: userMin and userMax should always be set if chart is zoomed
if (xAxis && this.xAxisList[0].isZoomed) {
xAxis.userMin = xAxis.userMin || xAxis.oldUserMin;
xAxis.userMax = xAxis.userMax || xAxis.oldUserMax;
}
this.hcChart.setSize(width, height, false);
this.cacheDrawnDimensions();
},
destroy: function destroy() {
this.cancelPendingDraw();
if (this.hcChart) {
this.onChartDestroy();
// SPL-85851, for some reason the default Highcharts destroy routine does not remove listeners added
// by the Pointer object, so we explicitly remove them here.
if (this.hcChart.pointer) {
this.hcChart.pointer.reset();
}
this.hcChart.destroy();
this.hcChart = null;
}
},
getSVG: function getSVG() {
var chart = this.hcChart;
if (this.hcConfig.legend.enabled) {
if (chart.legend.nav) {
chart.legend.nav.destroy();
}
}
(0, _jquery2.default)(chart.series).each(function (i, loopSeries) {
// If the area has been set to zero opacity, just remove the element entirely (SPL-80429 and SPL-84442).
if (loopSeries.area && colorUtils.getComputedOpacity(loopSeries.area) === 0) {
loopSeries.area.destroy();
delete loopSeries.area;
}
});
var $svg = (0, _jquery2.default)('.highcharts-container').find('svg');
$svg.siblings().remove();
$svg.find('.highcharts-tracker').remove();
// SPL-65745, remove the clip path that is being applied to the legend, or it will cause labels to be hidden
$svg.find('.highcharts-legend g[clip-path]').each(function removeClipPath() {
(0, _jquery2.default)(this).removeAttr('clip-path');
});
return $svg.parent().html();
},
highlight: function highlight(xValue, seriesName) {
if (!(typeof xValue === 'string' || typeof xValue === 'number') || typeof seriesName !== 'string') {
return;
}
if (this.isMouseInteractionActive) {
return;
}
var targetSeries = this.getSeriesByName(seriesName);
if (!targetSeries) {
return;
}
var targetPoint = this.getTargetPoint(xValue, targetSeries);
if (!targetPoint) {
return;
}
this.highlighted = { targetPoint: targetPoint, targetSeries: targetSeries, value: xValue, seriesName: seriesName };
(0, _underscore2.default)(this.seriesList).each(function (series) {
if (series.matchesName(seriesName)) {
series.highlightPoint(targetPoint);
} else {
series.unHighlight();
}
});
if (this.legend) {
this.legend.selectField(targetSeries.getLegendKey());
}
},
unHighlight: function unHighlight() {
if (this.isMouseInteractionActive || this.highlighted === null) {
return;
}
var targetSeries = this.highlighted.targetSeries;
var seriesName = this.highlighted.seriesName;
var point = this.highlighted.targetPoint;
(0, _underscore2.default)(this.seriesList).each(function (series) {
if (series.matchesName(seriesName)) {
series.unHighlightPoint(point);
} else {
series.highlight();
}
});
if (this.legend) {
this.legend.unSelectField(targetSeries.getLegendKey());
}
this.highlighted = null;
},
// ///////////////////////////////////////////////////////////////////////////////////////
// [end of public interface]
processProperties: function processProperties() {
var _this2 = this;
_Visualization2.default.prototype.processProperties.call(this);
// handle enabling chart/legend clicks, there are an annoying number of different ways to specify this
// the "drilldown" property trumps all others
// eslint-disable-next-line no-prototype-builtins
if (this.properties.hasOwnProperty('drilldown')) {
// eslint-disable-next-line no-multi-assign
this.chartClickEnabled = this.legendClickEnabled = this.properties['drilldown'] === 'all';
} else {
// eslint-disable-next-line no-prototype-builtins
if (this.properties.hasOwnProperty('chart.clickEnabled')) {
this.chartClickEnabled = parsingUtils.normalizeBoolean(this.properties['chart.clickEnabled']);
} else {
this.chartClickEnabled = parsingUtils.normalizeBoolean(this.properties['enableChartClick']);
}
// eslint-disable-next-line no-prototype-builtins
if (this.properties.hasOwnProperty('chart.legend.clickEnabled')) {
this.legendClickEnabled = parsingUtils.normalizeBoolean(this.properties['chart.legend.clickEnabled']);
} else {
this.legendClickEnabled = parsingUtils.normalizeBoolean(this.properties['enableLegendClick']);
}
}
if (this.properties['showTooltip'] !== undefined) {
this.hasTooltip = parsingUtils.normalizeBoolean(this.properties['showTooltip']);
}
var metricsChartTypes = ['line', 'area'];
this.legendMode = (0, _underscore2.default)(metricsChartTypes).indexOf(this.type) === -1 ? 'standard' : _jquery2.default.trim(this.properties['legend.mode']);
if (this.legendMode !== MULTISERIES_MODE && this.properties['legend.placement'] === 'none') {
this.hasLegend = false;
}
if (this.hasXAxis || this.hasYAxis) {
this.axisColorScheme = {
'axis.foregroundColorSoft': this.axisColorSoft,
'axis.foregroundColorSofter': this.axisColorSofter,
'axis.fontColor': this.properties['chart.fontColor'] || this.properties.fontColor
};
}
if (
// eslint-disable-next-line no-prototype-builtins
this.properties.hasOwnProperty('legend.masterLegend') && (!this.properties['legend.masterLegend'] || _jquery2.default.trim(this.properties['legend.masterLegend']) === 'null')) {
this.requiresExternalColors = false;
}
this.stackMode = this.properties['chart.stackMode'] || 'default';
this.shouldColorizeTooltipData = parsingUtils.normalizeBoolean(this.properties['shouldColorizeTooltipData'], true);
this.legendLabels = parsingUtils.stringToArray(this.properties['legend.labels'] || '[]');
this.showHideMode = this.properties['data.fieldListMode'] === 'show_hide';
this.fieldHideList = _underscore2.default.union(this.properties['fieldHideList'] || [], parsingUtils.stringToArray(this.properties['data.fieldHideList']) || []);
this.fieldShowList = parsingUtils.stringToArray(this.properties['data.fieldShowList']) || [];
var seriesColorsSetting = this.properties['chart.seriesColors'] || this.properties['seriesColors'];
this.seriesColors = parsingUtils.stringToHexArray(seriesColorsSetting) || null;
var fieldColorsSetting = this.properties['chart.fieldColors'] || this.properties['fieldColors'];
this.internalFieldColors = parsingUtils.stringToHexObject(fieldColorsSetting || '{}');
var annotationCategoryColorsSettings = this.properties['annotation.categoryColors'];
this.annotationCategoryColors = parsingUtils.stringToHexObject(annotationCategoryColorsSettings || '{}');
this.overlayFields = parsingUtils.stringToFieldList(this.properties['chart.overlayFields']);
this.seriesTypeMapping = {};
(0, _underscore2.default)(this.overlayFields).each(function (field) {
// @TODO(pwied): should we support line smoothing for overlay fields as well?
_this2.seriesTypeMapping[field] = 'line';
});
this.yAxisMapping = {};
var secondYAxis = parsingUtils.normalizeBoolean(this.properties['axisY2.enabled']);
if (secondYAxis) {
var secondYAxisFields = this.properties['axisY2.fields'] ? parsingUtils.stringToFieldList(this.properties['axisY2.fields']) : this.overlayFields;
(0, _underscore2.default)(secondYAxisFields).each(function (field) {
_this2.yAxisMapping[field] = 1;
});
}
this.enableAnimation = parsingUtils.normalizeBoolean(this.properties['enableAnimation'], false);
var zoomTypes = ['x', 'y', 'xy', 'off'];
if ((0, _underscore2.default)(zoomTypes).indexOf(this.properties['zoomType']) !== -1) {
this.zoomType = this.properties['zoomType'];
}
this.showLabels = this.properties['chart.showDataLabels'];
if (typeof this.showLabels === 'undefined') {
this.showLabels = 'none';
}
this.splitSeries = parsingUtils.normalizeBoolean(this.properties['layout.splitSeries'], false);
this.splitSeriesAllowIndependentYRanges = parsingUtils.normalizeBoolean(this.properties['layout.splitSeries.allowIndependentYRanges'], false);
if (this.properties['enableAccessibility'] === 'false') {
this.enableAccessibility = parsingUtils.normalizeBoolean(this.properties['enableAccessibility']);
}
},
// prettier-ignore
firstRenderOverride: function firstRenderOverride(chart) {
// make this reference available here for testing
this.hcChart = chart;
var Pointer = _highcharts2.default.Pointer,
fireEvent = _highcharts2.default.fireEvent,
each = _highcharts2.default.each;
var options = chart.options;
/* eslint-disable */
// BEGIN: copied from Highcharts source Chart#firstRender
// Check whether the chart is ready to render
// Reference: https://github.com/highcharts/highcharts/blob/87f3d8b274cb5a01c8b1a4b939b6cb6f0da63caa/js/parts/Chart.js#L1954
if (chart.isReadyToRender && !chart.isReadyToRender()) {
return;
}
// Create the container
chart.getContainer();
// Run an early event after the container and renderer are established
fireEvent(chart, 'init');
chart.resetMargins();
chart.setChartSize();
// Set the common chart properties (mainly invert) from the given series
chart.propFromSeries();
// get axes
chart.getAxes();
// Initialize the series
each(options.series || [], function (serieOptions) {
chart.initSeries(serieOptions);
});
chart.linkSeries();
// Run an event after axes and series are initialized, but before render. At this stage,
// the series data is indexed and cached in the xData and yData arrays, so we can access
// those before rendering. Used in Highstock.
fireEvent(chart, 'beforeRender');
// depends on inverted and on margins being set
if (Pointer) {
chart.pointer = new Pointer(chart, options);
}
// MODIFIED: treat render() an asynchronous method
chart.render(function () {
// RESUME: remainder of Highcharts Chart#firstRender source code
// Fire the load event if there are no external images
if (!chart.renderer.imgCount && chart.onload) {
chart.onload();
}
// If the chart was rendered outside the top container, put it back in (#3679)
chart.temporaryDisplay(true);
// END: Highcharts Chart#firstRender source code
});
/* eslint-enable */
},
// prettier-ignore
renderOverride: function renderOverride(chart, callback) {
var each = _highcharts2.default.each;
var axes = chart.axes,
renderer = chart.renderer,
options = chart.options;
/* eslint-disable */
// BEGIN: copied from Highcharts source Chart#render
var tempWidth, tempHeight, redoHorizontal, redoVertical;
// Title
chart.setTitle();
// Legend
chart.legend = new _highcharts2.default.Legend(chart, options.legend);
// Get stacks
if (chart.getStacks) {
chart.getStacks();
}
// Get chart margins
chart.getMargins(true);
chart.setChartSize();
// Record preliminary dimensions for later comparison
tempWidth = chart.plotWidth;
tempHeight = chart.plotHeight = chart.plotHeight - 21; // 21 is the most common correction for X axis labels
// Get margins by pre-rendering axes
each(axes, function (axis) {
axis.setScale();
});
chart.getAxisMargins();
// If the plot area size has changed significantly, calculate tick positions again
redoHorizontal = tempWidth / chart.plotWidth > 1.1;
redoVertical = tempHeight / chart.plotHeight > 1.05; // Height is more sensitive
if (redoHorizontal || redoVertical) {
each(axes, function (axis) {
if (axis.horiz && redoHorizontal || !axis.horiz && redoVertical) {
axis.setTickInterval(true); // update to reflect the new margins
}
});
chart.getMargins(); // second pass to check for new labels
}
// Draw the borders and backgrounds
chart.drawChartBox();
// Axes
if (chart.hasCartesianSeries) {
each(axes, function (axis) {
if (axis.visible) {
axis.render();
}
});
}
// The series
if (!chart.seriesGroup) {
chart.seriesGroup = renderer.g('series-group').attr({
zIndex: 3
}).add();
}
// MODIFIED: use an async loop to draw the series, body of iterator is the same as Highcharts Chart#renderSeries()
this.pendingDraw = (0, _async.asyncEach)(chart.series, function (serie) {
serie.translate();
serie.render();
});
this.pendingDraw.done(function () {
// Labels
chart.renderLabels();
// Credits
chart.addCredits();
// Handle responsiveness
if (chart.setResponsive) {
chart.setResponsive();
}
// Set flag
chart.hasRendered = true;
// END: Highcharts Chart#render source
callback();
});
/* eslint-enable */
},
// ////////////////////////////////////////////////////////////////////////////////////////////
// methods for initializing chart components
initializeFields: function initializeFields() {
// TODO: this is where user settings could determine the x-axis field(s)
var baseFields = this.dataSet.getFieldData();
this.xFields = baseFields.xFields;
this.yFields = baseFields.yFields;
var fieldAllowList = _jquery2.default.extend([], this.fieldShowList);
var fieldBlockList = _jquery2.default.extend([], this.fieldHideList);
var intersection = _underscore2.default.intersection(fieldAllowList, fieldBlockList);
if (this.showHideMode) {
fieldBlockList = _underscore2.default.difference(fieldBlockList, intersection);
} else {
fieldAllowList = _underscore2.default.difference(fieldAllowList, intersection);
}
this.yFields = _underscore2.default.difference(this.yFields, fieldBlockList);
if (fieldAllowList.length > 0) {
this.yFields = _underscore2.default.intersection(this.yFields, fieldAllowList);
}
// handle the user-specified legend labels
if (this.yFields.length > 0 && this.legendLabels.length > 0) {
this.yFields = _underscore2.default.union(this.legendLabels, this.yFields);
}
},
isEmpty: function isEmpty() {
return !this.yFields || this.yFields.length === 0;
},
hasTimeXAxis: function hasTimeXAxis() {
return (0, _underscore2.default)(this.xFields || []).any(this.seriesIsTimeBased, this);
},
// Assume that the presence of an _span field in the data set means we are dealing with a binned and sorted
// time series. Otherwise the time series is assumed to be un-ordered an un-evenly distributed.
hasBinnedTimeXAxis: function hasBinnedTimeXAxis() {
return this.hasTimeXAxis() && this.dataSet.hasField('_span');
},
shouldProgressiveDraw: function shouldProgressiveDraw() {
if (this.isEmpty()) {
return false;
}
var totalPoints = this.yFields.length * this.dataSet.getSeries(this.yFields[0]).length;
return totalPoints > this.PROGRESSIVE_DRAW_THRESHOLD;
},
shouldUpdateInPlace: function shouldUpdateInPlace() {
return this.hcChart && !this.isDirty();
},
initializeColorPalette: function initializeColorPalette() {
this.colorPalette = new _ColorPalette2.default(this.seriesColors);
this.annotationColorPalette = new _ColorPalette2.default(this.ANNOTATION_COLORS, true);
},
initializeSeriesList: function initializeSeriesList() {
this.seriesList = (0, _underscore2.default)(this.initializeSeriesPropertiesList()).map(function (properties) {
return _series_factory2.default.create(properties);
});
},
updateSeriesProperties: function updateSeriesProperties() {
var _this3 = this;
var propsList = this.initializeSeriesPropertiesList();
var reinitializeSeriesList = false;
// compare the type of every series from seriesList with the propsList
// if there is at least one mismatch then re-initialize the seriesList
_underscore2.default.each(this.seriesList, function (series, i) {
if (propsList[i] && series.getType() !== propsList[i].type) {
reinitializeSeriesList = true;
}
});
if (!reinitializeSeriesList) {
// if there are more existing series that in the props list, loop through and remove the extras
// while updating the remaining ones
if (this.seriesList.length > propsList.length) {
this.seriesList = (0, _underscore2.default)(this.seriesList).filter(function (series, i) {
if (i >= propsList.length) {
series.destroy();
return false;
}
series.update(propsList[i]);
return true;
}, this);
} else if (this.seriesList.length <= propsList.length) {
// if there are less existing series than in the props list (or the same amount),
// loop through and create the new ones while updating the existing ones
this.seriesList = (0, _underscore2.default)(propsList).map(function (props, i) {
if (i < _this3.seriesList.length) {
_this3.seriesList[i].update(props);
return _this3.seriesList[i];
}
var newSeries = _series_factory2.default.create(props);
_this3.bindIndividualSeries(newSeries);
return newSeries;
});
}
} else {
this.seriesList = null;
this._isDirty = true;
this.initializeSeriesList();
}
},
initializeSeriesPropertiesList: function initializeSeriesPropertiesList() {
var _this4 = this;
if (this.isEmpty()) {
return [{ type: this.type }];
}
var rangeFieldNames = void 0;
var isRangeSeriesMode = fieldUtils.isRangeSeriesDataSet(this.dataSet);
var rangeSeriesConfig = isRangeSeriesMode ? fieldUtils.getRangeSeriesConfig(this.dataSet) : [];
var isOutlierMode = fieldUtils.isOutlierDataSet(this.dataSet);
var outlierFieldNames = isOutlierMode ? fieldUtils.getOutlierFields(this.dataSet) : [];
var dashStyle = this.getDashStyle();
var markerStyle = this.properties['lineMarkerStyle'] || 'normal';
if (isRangeSeriesMode) {
rangeFieldNames = (0, _underscore2.default)(rangeSeriesConfig).pluck('predicted');
}
return (0, _underscore2.default)(this.yFields).map(function (field) {
// TODO: this is where user settings could determine series type and/or axis mappings
var customType = void 0;
if (rangeFieldNames && (0, _underscore2.default)(rangeFieldNames).contains(field)) {
customType = 'range';
} else if (outlierFieldNames && (0, _underscore2.default)(outlierFieldNames).contains(field)) {
customType = 'outlier';
// eslint-disable-next-line no-prototype-builtins
} else if (_this4.seriesTypeMapping.hasOwnProperty(field)) {
customType = _this4.seriesTypeMapping[field];
}
var pointPlacement = null;
if (_this4.hasTimeXAxis() && _this4.type !== 'column' && _this4.type !== 'bar') {
pointPlacement = 'on';
}
var properties = _jquery2.default.extend(true, {}, _this4.properties, {
type: customType || _this4.type,
name: field,
pointPlacement: pointPlacement,
stacking: isRangeSeriesMode || isOutlierMode ? 'default' : _this4.stackMode,
// TODO [sff] should we just deal with this in the chart click handler?
clickEnabled: _this4.chartClickEnabled,
dashStyle: dashStyle,
markerStyle: markerStyle
});
if (customType === 'range') {
properties.names = (0, _underscore2.default)(rangeSeriesConfig).findWhere({ predicted: field });
}
// allow series to be assigned to y-axes via the 'yAxisMapping' property
// eslint-disable-next-line no-prototype-builtins
if (_this4.yAxisMapping.hasOwnProperty(field)) {
properties.yAxis = _this4.yAxisMapping[field];
}
return properties;
});
},
initializeXAxisList: function initializeXAxisList() {
var _this5 = this;
var isEmpty = this.isEmpty();
// TODO: this is where user settings could specify multiple x-axes
// TODO: this is where the x-axis type can be inferred from the series types attached to each axis
this.xAxisList = (0, _underscore2.default)(this.xFields).map(function (field, i) {
var tickmarksBetween = (0, _underscore2.default)(_this5.seriesList).any(function (series) {
return series.getXAxisIndex() === i &&
// eslint-disable-next-line no-prototype-builtins
{ column: true, bar: true }.hasOwnProperty(series.getType());
});
var axisProperties = _jquery2.default.extend(parsingUtils.getXAxisProperties(_this5.properties), _this5.axisColorScheme, {
'axis.orientation': _this5.axesAreInverted ? 'vertical' : 'horizontal',
isEmpty: isEmpty,
crosshair: _this5.getXAxisCrosshair()
});
axisProperties['axisTitle.text'] = _this5._getComputedXAxisTitle(axisProperties, field);
if (_this5.seriesIsTimeBased(field)) {
axisProperties['axisLabels.tickmarkPlacement'] = tickmarksBetween ? 'between' : 'on';
var maximumValue = _this5._getComputedTimeAxisMaxValue(tickmarksBetween);
if (maximumValue !== null) {
axisProperties['axis.maximumValue'] = maximumValue;
}
if (_this5.isAnnotationSupported()) {
var _getAnnotationsAndPlo = _this5.getAnnotationsAndPlotBands(),
plotBands = _getAnnotationsAndPlo.plotBands,
lineAnnotations = _getAnnotationsAndPlo.lineAnnotations;
axisProperties['axis.annotations'] = lineAnnotations;
axisProperties['axis.plotBands'] = plotBands;
}
return new _TimeAxis2.default(axisProperties);
}
axisProperties['axis.categories'] = _this5.dataSet.getSeries(field);
axisProperties['axisLabels.tickmarkPlacement'] = 'between';
return new _CategoryAxis2.default(axisProperties);
});
},
initializeYAxisList: function initializeYAxisList() {
// TODO: this is where user settings could specify multiple y-axes
var that = this;
var isEmpty = this.isEmpty();
this.yAxisList = [];
var maxAxisIndex = (0, _underscore2.default)(this.seriesList).chain().invoke('getYAxisIndex').max().value();
(0, _underscore2.default)(maxAxisIndex + 1).times(function (i) {
that._initializeYAxis(i, isEmpty);
});
},
_initializeYAxis: function _initializeYAxis(yAxisIndex, isEmpty) {
var axisProperties = this.initializeYAxisProperties(yAxisIndex, isEmpty);
// FIXME: we should do something more intelligent here
// currently if there is only one series for an axis, use that series's name as the default title
axisProperties['axisTitle.text'] = this._getComputedYAxisTitle(axisProperties, yAxisIndex);
// log scale is not respected if the chart has stacking
if (this.stackMode !== 'default') {
axisProperties['axis.scale'] = 'linear';
}
var yAxesShareRanges = this.splitSeries && !this.splitSeriesAllowIndependentYRanges;
if (this.yFieldsAreOverlayFields() && this.splitSeriesAllowIndependentYRanges && this.stackMode === 'stacked100' && this.isStackable()) {
axisProperties['sharedMin'] = this.properties['axisY2.minimumNumber'] ? this.properties['axisY2.minimumNumber'] : 0;
axisProperties['sharedMax'] = this.properties['axisY2.maximumNumber'] ? this.properties['axisY2.maximumNumber'] : 100;
} else if (this.stackMode === 'stacked100' && this.isStackable() && (yAxesShareRanges || yAxisIndex === 0)) {
axisProperties['sharedMin'] = 0;
axisProperties['sharedMax'] = 100;
}
this.yAxisList.push(new _NumericAxis2.default(axisProperties));
},
initializeYAxisProperties: function initializeYAxisProperties(yAxisIndex, isEmpty) {
var opposite = yAxisIndex % 2 !== 0;
var axisProperties = _jquery2.default.extend(parsingUtils.getYAxisProperties(this.properties, yAxisIndex), this.axisColorScheme, {
'axis.orientation': this.axesAreInverted ? 'horizontal' : 'vertical',
isEmpty: isEmpty,
opposite: opposite,
sharedMax: opposite ? this.properties.overlayAxisMax : this.properties.yAxisMax,
sharedMin: opposite ? this.properties.overlayAxisMin : this.properties.yAxisMin
});
return axisProperties;
},
yFieldsAreOverlayFields: function yFieldsAreOverlayFields() {
var match = _underscore2.default.difference(this.yFields, this.overlayFields);
return match.length === 0;
},
getXAxisCrosshair: function getXAxisCrosshair() {
var isSeriesCompareForBarAndColumn = this.properties['legend.mode'] === 'seriesCompare' && (this.type === 'bar' || this.type === 'column');
return this.legendMode === MULTISERIES_MODE || isSeriesCompareForBarAndColumn;
},
updateAxisProperties: function updateAxisProperties() {
var _this6 = this;
// make sure the x-axis gets updated categories, if needed
// TODO [sff] remove assumption that there is only one x-axis
if (this.hasXAxis) {
var xAxis = this.xAxisList[0];
var xField = this.xFields[0];
if (xAxis instanceof _CategoryAxis2.default) {
xAxis.setCategories(this.dataSet.getSeries(xField));
} else if (xAxis instanceof _TimeAxis2.default) {
var tickmarksBetween = xAxis.hasTickmarksBetween();
var maximumValue = this._getComputedTimeAxisMaxValue(tickmarksBetween);
if (maximumValue !== null) {
xAxis.setMaximumValue(maximumValue);
}
if (this.isAnnotationSupported()) {
var _getAnnotationsAndPlo2 = this.getAnnotationsAndPlotBands(),
plotBands = _getAnnotationsAndPlo2.plotBands,
lineAnnotations = _getAnnotationsAndPlo2.lineAnnotations;
xAxis.setAnnotations(lineAnnotations);
xAxis.setPlotBands(plotBands);
}
}
xAxis.crosshair = this.getXAxisCrosshair();
var xAxisProperties = parsingUtils.getXAxisProperties(this.properties);
xAxis.setTitle(this._getComputedXAxisTitle(xAxisProperties, xField));
}
// check if we need to draw two y-axis on the chart
if (this.hasYAxis) {
var maxAxisIndex = (0, _underscore2.default)(this.seriesList).chain().invoke('getYAxisIndex').max().value();
if (this.yAxisList.length < maxAxisIndex + 1) {
this.initializeYAxisList();
this._isDirty = true;
}
}
_underscore2.default.each(this.yAxisList, function (yAxis, i) {
var yAxisProperties = parsingUtils.getYAxisProperties(_this6.properties, i);
yAxis.setTitle(_this6._getComputedYAxisTitle(yAxisProperties, i));
});
},
getAnnotationsAndPlotBands: function getAnnotationsAndPlotBands() {
var _filterLineAndSpanAnn = this.filterLineAndSpanAnnotations(this.dataSet.getAnnotations()),
plotBands = _filterLineAndSpanAnn.plotBands,
annotations = _filterLineAndSpanAnn.annotations;
return {
plotBands: this.getFormattedPlotBands(plotBands),
lineAnnotations: this.getFormattedAnnotations(annotations)
};
},
isAnnotationSpanValid: function isAnnotationSpanValid(annotation) {
var span = annotation.span;
if (span) {
var parsed = parseInt(span, 10);
return !isNaN(parsed) && parsed >= 0;
}
return true;
},
filterLineAndSpanAnnotations: function filterLineAndSpanAnnotations(initAnnotations) {
var _this7 = this;
// filter out invalid annotations and plot bands
var validAnnotations = _underscore2.default.filter(initAnnotations, function (annotation) {
return annotation.time && (0, _moment2.default)(annotation.time).isValid() && _this7.isAnnotationSpanValid(annotation);
});
var plotBands = validAnnotations.filter(function (annotation) {
return annotation.span;
});
return { plotBands: plotBands, annotations: validAnnotations };
},
setFallbackColor: function setFallbackColor(annotationCategory, uniqCategories) {
// no color specify, try get color from settings or color palette
// eslint-disable-next-line no-prototype-builtins
if (this.annotationCategoryColors.hasOwnProperty(annotationCategory)) {
return colorUtils.colorFromHex(this.annotationCategoryColors[annotationCategory]);
}
return this.annotationColorPalette.getColorAsRgb(annotationCategory, uniqCategories.indexOf(annotationCategory), uniqCategories.length);
},
createEndDateFromSpan: function createEndDateFromSpan(time, span) {
return (0, _moment2.default)(time).add(span, 'seconds').toDate();
},
getFormattedPlotBands: function getFormattedPlotBands(annotations) {
var _this8 = this;
var uniqCategories = _underscore2.default.uniq(_underscore2.default.pluck(annotations, 'category'));
return _underscore2.default.map(annotations, function (annotation) {
var category = annotation.category,
span = annotation.span,
time = annotation.time;
var color = annotation.color;
var from = (0, _moment2.default)(time).toDate();
var to = _this8.createEndDateFromSpan(time, span);
if (!color) {
color = _this8.setFallbackColor(category, uniqCategories);
}
return {
from: from,
to: to,
color: color,
label: annotation.label
};
});
},
getFormattedAnnotations: function getFormattedAnnotations(annotations) {
var _this9 = this;
var uniqCategories = _underscore2.default.uniq(_underscore2.default.pluck(annotations, 'category'));
return annotations.map(function (annotation) {
var category = annotation.category,
time = annotation.time,
span = annotation.span,
label = annotation.label;
var initFormattedAnnotation = {
category: category,
label: label,
value: (0, _moment2.default)(time).toDate()
};
if (span) {
initFormattedAnnotation.span = _this9.createEndDateFromSpan(time, span);
}
var color = annotation.color;
if (!color) {
color = _this9.setFallbackColor(category, uniqCategories);
}
return (0, _extends3.default)({}, initFormattedAnnotation, {
color: color
});
});
},
_getComputedXAxisTitle: function _getComputedXAxisTitle(axisProperties, field) {
return _underscore2.default.isUndefined(axisProperties['axisTitle.text']) || axisProperties['axisTitle.text'] === '' ? this._getDefaultXAxisTitleFromField(field) : axisProperties['axisTitle.text'];
},
_getComputedYAxisTitle: function _getComputedYAxisTitle(axisProperties, yAxisIndex) {
return _underscore2.default.isUndefined(axisProperties['axisTitle.text']) || axisProperties['axisTitle.text'] === '' ? this._getDefaultYAxisTitle(yAxisIndex) : axisProperties['axisTitle.text'];
},
_getDefaultXAxisTitleFromField: function _getDefaultXAxisTitleFromField(field) {
return field;
},
_getDefaultYAxisTitle: function _getDefaultYAxisTitle(yAxisIndex) {
var axisSeries = (0, _underscore2.default)(this.seriesList).filter(function (series) {
return series.getYAxisIndex() === yAxisIndex;
});
return axisSeries.length === 1 ? axisSeries[0].getName() : undefined;
},
_getComputedTimeAxisMaxValue: function _getComputedTimeAxisMaxValue(tickmarksBetween) {
// If the axis has tickmarks on points, pad the axis maximum by one point span
// to create more room for the last axis label.
if (!tickmarksBetween && this.hasBinnedTimeXAxis()) {
var timeSeries = this.dataSet.getSeriesAsEpochTimes(this.xFields[0]);
var spanSeries = this.dataSet.getSeriesAsFloats('_span');
return _underscore2.default.last(timeSeries) + _underscore2.default.last(spanSeries) * 1000;
}
return null;
},
getTargetPoint: function getTargetPoint(value, targetSeries) {
// compute different parts targetPoint
var targetPoint = void 0;
var xInfo = this.getSeriesXInfo(targetSeries);
var xSeries = this.dataSet.getSeries(xInfo.fieldName);
var xIndex = xSeries.indexOf(value);
var data = targetSeries.getData();
if (xIndex > -1 && xIndex < data.length) {
targetPoint = {
index: xIndex,
originalIndex: xIndex,
seriesName: targetSeries.getName(),
y: data[xIndex]
};
}
return targetPoint;
},
resetHighlight: function resetHighlight() {
if (this.highlighted) {
this.unHighlight();
}
this.isMouseInteractionActive = false;
this.highlighted = null;
},
initializeLegend: function initializeLegend() {
var legendProps = parsingUtils.getLegendProperties(this.properties);
if ((0, _underscore2.default)(legendProps['clickEnabled']).isUndefined()) {
legendProps['clickEnabled'] = this.legendClickEnabled;
}
_jquery2.default.extend(legendProps, {
fontColor: (0, _theme.getThemeProperty)('LEGEND_FONT_COLOR') || this.fontColor,
isMultiSeries: this.legendMode === MULTISERIES_MODE,
isExportMode: this.exportMode
});
// Setup data for Outlier count
var outlierSeries = this.seriesList[0];
if (outlierSeries.actualSeries) {
legendProps.legendOptions = outlierSeries.actualSeries.properties.legendOptions;
var isOutlierFieldIdx = this.dataSet.fields.indexOf('isOutlier');
var isOutlierList = this.dataSet.seriesList[isOutlierFieldIdx];
var isOutlier = '1';
var outlierCount = 0;
(0, _underscore2.default)(isOutlierList).each(function (isOutlierFlag, i) {
if (isOutlierFlag === isOutlier && (
// 0/undefined 1 0
isOutlierList[i - 1] !== isOutlier && isOutlierList[i + 1] !== isOutlier ||
// 1 1 0/undefined
isOutlierList[i - 1] === isOutlier && isOutlierList[i + 1] !== isOutlier)) {
outlierCount++;
}
});
legendProps.legendOptions.labelFormatter = legendProps.legendOptions.labelFormatter(outlierCount);
}
this.legend = new _Legend2.default(legendProps);
this.bindLegendEvents();
},
bindLegendEvents: function bindLegendEvents() {
var that = this;
var properties = {
highlightDelay: 125,
unhighlightDelay: 50,
onMouseOver: function onMouseOver(fieldName) {
that.handleLegendMouseOver(fieldName);
},
onMouseOut: function onMouseOut(fieldName) {
that.handleLegendMouseOut(fieldName);
}
};
var throttle = new _HoverEventThrottler2.default(properties);
this.legend.on('mouseover', function (e, fieldName) {
throttle.mouseOverHappened(fieldName);
});
this.legend.on('mouseout', function (e, fieldName) {
throttle.mouseOutHappened(fieldName);
});
this.legend.on('click', function (e, fieldName) {
that.handleLegendClick(e, fieldName);
});
},
initializeTooltip: function initializeTooltip() {
var tooltipProps = {
borderColor: this.foregroundColorSoft,
mode: this.legendMode
};
this.tooltip = new _Tooltip2.default(tooltipProps);
},
setAllSeriesData: function setAllSeriesData() {
var _this10 = this;
(0, _underscore2.default)(this.seriesList).each(function (series) {
if (series.getType() === 'range') {
_this10.setRangeSeriesData(series);
} else if (series.getType() === 'outlier') {
_this10.setOutlierSeriesData(series);
} else {
_this10.setBasicSeriesData(series);
}
});
},
setBasicSeriesData: function setBasicSeriesData(series) {
var xInfo = this.getSeriesXInfo(series);
var yInfo = this.getSeriesYInfo(series);
var seriesType = series.getType();
if (xInfo.axis instanceof _NumericAxis2.default) {
series.setData({
x: this.formatNumericAxisData(xInfo.axis, xInfo.fieldName, seriesType),
y: this.formatNumericAxisData(yInfo.axis, yInfo.fieldName, seriesType)
});
} else if (xInfo.axis instanceof _TimeAxis2.default) {
series.setData({
x: this.formatTimeAxisData(xInfo.axis, xInfo.fieldName),
y: this.formatNumericAxisData(yInfo.axis, yInfo.fieldName, seriesType)
}, { sortXValues: !this.hasBinnedTimeXAxis() });
} else {
series.setData({
y: this.formatNumericAxisData(yInfo.axis, yInfo.fieldName, seriesType)
});
}
},
setRangeSeriesData: function setRangeSeriesData(series) {
var xInfo = this.getSeriesXInfo(series);
var yInfo = this.getSeriesYInfo(series);
var rangeConfig = (0, _underscore2.default)(fieldUtils.getRangeSeriesConfig(this.dataSet)).findWhere({
predicted: series.getName()
});
var rangeData = {
predicted: this.formatNumericAxisData(yInfo.axis, rangeConfig.predicted),
lower: this.formatNumericAxisData(yInfo.axis, rangeConfig.lower),
upper: this.formatNumericAxisData(yInfo.axis, rangeConfig.upper)
};
if (xInfo.axis instanceof _NumericAxis2.default) {
rangeData.x = this.formatNumericAxisData(xInfo.axis, xInfo.fieldName);
} else if (xInfo.axis instanceof _TimeAxis2.default) {
rangeData.x = this.formatTimeAxisData(xInfo.axis, xInfo.fieldName);
}
series.setData(rangeData);
},
setOutlierSeriesData: function setOutlierSeriesData(series) {
var xInfo = this.getSeriesXInfo(series);
var yInfo = this.getSeriesYInfo(series);
var outlierFields = fieldUtils.getOutlierFields(this.dataSet);
var outlierData = {
actual: this.formatNumericAxisData(yInfo.axis, outlierFields.actual),
lower: this.formatNumericAxisData(yInfo.axis, outlierFields.lower),
upper: this.formatNumericAxisData(yInfo.axis, outlierFields.upper),
isOutlier: this.formatNumericAxisData(yInfo.axis, outlierFields.isOutlier)
};
if (xInfo.axis instanceof _NumericAxis2.default) {
outlierData.x = this.formatNumericAxisData(xInfo.axis, xInfo.fieldName);
} else if (xInfo.axis instanceof _TimeAxis2.default) {
outlierData.x = this.formatTimeAxisData(xInfo.axis, xInfo.fieldName);
}
series.setData(outlierData);
},
bindSeriesEvents: function bindSeriesEvents() {
var that = this;
this.throttle = new _HoverEventThrottler2.default({
highlightDelay: 125,
unhighlightDelay: 50,
onMouseOver: function onMouseOver(point, series) {
if (that.legendMode !== MULTISERIES_MODE) {
that.handlePointMouseOver(point, series);
}
},
onMouseOut: function onMouseOut(point, series) {
if (that.legendMode !== MULTISERIES_MODE) {
that.handlePointMouseOut(point, series);
} else if (that.legend) {
that.legend.resetLegend();
}
}
});
(0, _underscore2.default)(this.seriesList).each(this.bindIndividualSeries, this);
},
bindIndividualSeries: function bindIndividualSeries(series) {
var that = this;
series.on('mouseover', function (e, targetPoint, targetSeries) {
that.throttle.mouseOverHappened(targetPoint, targetSeries);
});
series.on('mouseout', function (e, targetPoint, targetSeries) {
that.throttle.mouseOutHappened(targetPoint, targetSeries);
});
series.on('keydown', function (e, targetPoint, targetSeries) {
that.handleKeyDown(targetSeries);
});
series.on('click', function (e, targetPoint, targetSeries) {
that.handlePointClick(e, targetPoint, targetSeries);
});
},
getPointEventContext: function getPointEventContext(point, series) {
var _this11 = this;
var pointIndex = _underscore2.default.has(point, 'originalIndex') ? point.originalIndex : point.index;
var pointInfo = this.getSeriesPointInfo(series, point);
var value = void 0;
var _span = void 0;
var rowContext = {};
if (pointInfo.xAxisIsTime) {
var isoTimeString = this.dataSet.getSeries(pointInfo.xAxisName)[pointIndex];
value = _time2.default.getEpochTimeFromISO(isoTimeString);
rowContext['row.' + pointInfo.xAxisName] = value;
if (this.hasBinnedTimeXAxis()) {
_span = this.dataSet.getSeriesAsFloats('_span')[pointIndex];
} else {
_span = 0.001; // 1ms
}
} else {
value = pointInfo.xValue;
rowContext['row.' + pointInfo.xAxisName] = pointInfo.xValue;
}
(0, _underscore2.default)(this.yFields).each(function (fieldName) {
rowContext['row.' + fieldName] = _this11.dataSet.getSeries(fieldName)[pointIndex];
});
return {
name: pointInfo.xAxisName,
name2: pointInfo.yAxisName,
value: value,
value2: pointInfo.yValue,
rowContext: rowContext,
_span: _span
};
},
getTooltipPosition: function getTooltipPosition(point) {
return {
tooltipX: point.plotX + this.hcChart.plotLeft,
tooltipY: point.plotY + this.hcChart.plotTop
};
},
handlePointClick: function handlePointClick(event, point, series) {
var pointClickEvent = (0, _extends3.default)({
type: 'pointClick',
modifierKey: event.modifierKey
}, this.getPointEventContext(point, series));
this.trigger(pointClickEvent);
},
handleKeyDown: function handleKeyDown(targetSeries) {
(0, _underscore2.default)(this.seriesList).each(function (series) {
series.hcSeries.points.forEach(function (p) {
p.select(false);
});
series.highlight();
});
if (this.legend) {
this.legend.unSelectField(targetSeries.getLegendKey());
}
},
handlePointMouseOver: function handlePointMouseOver(targetPoint, targetSeries) {
this.isMouseInteractionActive = true;
(0, _underscore2.default)(this.seriesList).each(function (series) {
if (series.matchesName(targetSeries.getName())) {
series.handlePointMouseOver(targetPoint);
} else {
series.unHighlight();
}
});
if (this.legend) {
this.legend.selectField(targetSeries.getLegendKey());
}
var pointMouseOverEvent = (0, _extends3.default)({
type: 'pointMouseOver'
}, this.getPointEventContext(targetPoint, targetSeries), {
tooltipContext: this.getTooltipPosition(targetPoint)
});
this.trigger(pointMouseOverEvent);
},
handlePointMouseOut: function handlePointMouseOut(targetPoint, targetSeries) {
(0, _underscore2.default)(this.seriesList).each(function (series) {
if (series.matchesName(targetSeries.getName())) {
series.handlePointMouseOut(targetPoint);
} else {
series.highlight();
}
});
if (this.legend) {
this.legend.unSelectField(targetSeries.getLegendKey());
}
this.isMouseInteractionActive = false;
var pointMouseOutEvent = (0, _extends3.default)({
type: 'pointMouseOut'
}, this.getPointEventContext(targetPoint, targetSeries), {
tooltipContext: this.getTooltipPosition(targetPoint)
});
this.trigger(pointMouseOutEvent);
},
handleLegendClick: function handleLegendClick(event, fieldName) {
var legendClickEvent = {
type: 'legendClick',
modifierKey: event.modifierKey,
name2: fieldName
};
this.trigger(legendClickEvent);
},
handleLegendMouseOver: function handleLegendMouseOver(fieldName) {
this.isMouseInteractionActive = true;
(0, _underscore2.default)(this.seriesList).each(function (series) {
if (series.matchesName(fieldName)) {
series.handleLegendMouseOver(fieldName);
} else {
series.unHighlight();
}
});
},
handleLegendMouseOut: function handleLegendMouseOut(fieldName) {
(0, _underscore2.default)(this.seriesList).each(function (series) {
if (series.matchesName(fieldName)) {
series.handleLegendMouseOut(fieldName);
} else {
series.highlight();
}
});
this.isMouseInteractionActive = false;
},
applyColorPalette: function applyColorPalette() {
var _this12 = this;
if (this.isEmpty()) {
return;
}
var colorMapping = {};
(0, _underscore2.default)(this.getFieldList()).each(function (field, i, fieldList) {
colorMapping[field] = _this12.computeFieldColor(field, i, fieldList);
});
(0, _underscore2.default)(this.seriesList).invoke('applyColorMapping', colorMapping);
},
// ////////////////////////////////////////////////////////////////////////////////
// methods for generating config objects from chart objects
getConfig: function getConfig() {
var that = this;
var config = _jquery2.default.extend(true, {
chart: {
animation: this.enableAnimation
},
plotOptions: {
series: {
animation: this.enableAnimation
}
},
tooltip: {
animation: this.enableAnimation,
// Disable followTouchMove for zoomable charts so that the single-finger drag pans the chart.
followTouchMove: !this.isZoomable()
}
}, this.BASE_CONFIG, {
chart: this.getChartConfig(),
series: this.getSeriesConfigList(),
xAxis: this.getXAxisConfig(),
yAxis: this.getYAxisConfig(),
legend: this.getLegendConfig(),
tooltip: this.getTooltipConfig(),
plotOptions: this.getPlotOptionsConfig(),
pointerDragStartPreHook: (0, _underscore2.default)(this.pointerDragStartPreHook).bind(this),
pointerDragOverride: (0, _underscore2.default)(this.pointerDragOverride).bind(this),
pointerDropPreHook: (0, _underscore2.default)(this.pointerDropPreHook).bind(this),
pointerDropPostHook: (0, _underscore2.default)(this.pointerDropPostHook).bind(this),
pointerPinchOverride: (0, _underscore2.default)(this.pointerPinchOverride).bind(this)
});
if (this.exportMode) {
if (this.seriesIsTimeBased(this.xFields)) {
(0, _underscore2.default)(config.xAxis).each(function (xAxis) {
var xAxisMargin = void 0;
if (that.axesAreInverted) {
xAxisMargin = -50;
} else {
var spanSeries = that.dataSet.getSeriesAsFloats('_span');
var span = spanSeries && spanSeries.length > 0 ? parseInt(spanSeries[0], 10) : 1;
var secsPerDay = 60 * 60 * 24;
var secsPerYear = secsPerDay * 365;
if (span >= secsPerYear) {
xAxisMargin = 15;
} else if (span >= secsPerDay) {
xAxisMargin = 25;
} else {
xAxisMargin = 35;
}
}
xAxis.title.margin = xAxisMargin;
});
}
_jquery2.default.extend(true, config, {
plotOptions: {
series: {
enableMouseTracking: false,
shadow: false
}
}
});
}
if (this.properties.hasOwnProperty('time.serializedTz') || // eslint-disable-line no-prototype-builtins
this.properties.hasOwnProperty('time.timezoneOffset') || // eslint-disable-line no-prototype-builtins
this.properties.hasOwnProperty('time.ianaTimezone') // eslint-disable-line no-prototype-builtins
) {
// only specify the highcharts time config properties if the custom time overrides are present in properties
_jquery2.default.extend(true, config, {
time: this.getTimeConfig()
});
}
return config;
},
getSeriesConfigList: function getSeriesConfigList() {
return (0, _underscore2.default)(this.seriesList).chain().invoke('getConfig').flatten(true).value();
},
// For Line extend x axis config to contain plot band config
// if annotation data is passed with annotationSpan field
getXAxisConfig: function getXAxisConfig() {
if (!this.hasXAxis) {
return [];
}
return (0, _underscore2.default)(this.xAxisList).map(function (axis, i) {
var config = axis.getConfig();
if (i > 0) {
config.offset = 40;
}
return config;
}, this);
},
getYAxisConfig: function getYAxisConfig() {
if (!this.hasYAxis) {
return [];
}
return (0, _underscore2.default)(this.yAxisList).map(function (axis) {
return axis.getConfig();
});
},
getLegendConfig: function getLegendConfig() {
if (!this.hasLegend || !this.legend) {
return {};
}
return this.legend.getConfig();
},
getTimeConfig: function getTimeConfig() {
var _this13 = this;
// this is the default global time config inside splunk-time-axis
var timeConfig = {
useUTC: false
};
// we only want to use either the custom callback, the ianaTimezone, or the static offset, and the callback takes precedence
// eslint-disable-next-line no-prototype-builtins
if (this.properties.hasOwnProperty('time.serializedTz')) {
timeConfig.useUTC = true;
var parsedTz = (0, _convertSplunkTimezone2.default)(this.properties['time.serializedTz']);
timeConfig.getTimezoneOffset = function (millis) {
var untilsIndex = (0, _sortedLastIndex2.default)(parsedTz.untils, millis);
return parsedTz.offsets[untilsIndex];
};
// eslint-disable-next-line no-prototype-builtins
} else if (this.properties.hasOwnProperty('time.timezoneOffset')) {
timeConfig.timezoneOffset = mathUtils.parseFloat(this.properties['time.timezoneOffset']);
timeConfig.useUTC = true;
// eslint-disable-next-line no-prototype-builtins
} else if (this.properties.hasOwnProperty('time.ianaTimezone')) {
// https://api.highcharts.com/highcharts/time.moment
// we don't have access to the Highcharts 8.2.0 API which allows for passing a moment.js instance as an option
// if we were on 8.2.0, we could do the following instead:
/*
time.moment = momentTz;
time.timezone = this.properties['time.ianaTimezone'];
*/
// as a workaround, invoke momentTz to return the utcOffset in minutes
timeConfig.useUTC = true;
timeConfig.getTimezoneOffset = function (millis) {
return _moment2.default.tz.zone(_this13.properties['time.ianaTimezone']).utcOffset(millis);
};
}
return timeConfig;
},
getTooltipConfig: function getTooltipConfig() {
if (!this.tooltip) {
return {};
}
return _jquery2.default.extend(this.tooltip.getConfig(), {
// initially disable the tooltip, it will be re-enabled when the draw has completed
// this is to support progressive draw where some content is visible but the chart is not yet interactive
formatter: function formatter() {
return false;
}
});
},
formatTooltip: function formatTooltip(series, hcPoint, useStackValue) {
var _this14 = this;
var pointInfo = this.getSeriesPointInfo(series, hcPoint);
// in metrics legend mode, we have a single common tooltip showing only
// the x-axis value
if (this.legendMode === MULTISERIES_MODE) {
return _underscore2.default.escape(pointInfo.xValueDisplay);
}
var allPointInformation = void 0;
if (useStackValue) {
allPointInformation = [];
var color = void 0;
var text = void 0;
var yValueDisplay = void 0;
this.seriesList.forEach(function (seriesNext) {
color = seriesNext.getColor();
text = seriesNext.getName();
yValueDisplay = _this14.getSeriesPointInfo(seriesNext, seriesNext.hcSeries.points[hcPoint.index]).yValueDisplay;
allPointInformation.push([{ color: color, text: text }, yValueDisplay]);
});
}
var isSeriesCompareForBarAndColumn = this.properties['legend.mode'] === 'seriesCompare' && (this.type === 'bar' || this.type === 'column');
return series.getTooltipHtml(pointInfo, this.hcChart, allPointInformation, isSeriesCompareForBarAndColumn);
},
getChartConfig: function getChartConfig() {
var that = this;
var config = {
type: this.type,
renderTo: this.container,
backgroundColor: this.backgroundColor,
borderColor: this.backgroundColor,
events: {
redraw: function redraw() {
// Highcharts calls this handler in the scope of the current chart object
var chart = this;
that.onChartRedraw(chart);
that.onChartLoadOrRedraw(chart);
},
endResize: this.onChartResize.bind(this),
tooltipRefresh: this.onTooltipRefresh.bind(this)
}
};
if (this.hasXAxis) {
config.events.selection = this.onChartSelection.bind(this);
}
// in export mode we need to set explicit width and height
// we'll honor the width and height of the parent node, unless they are zero
if (this.exportMode) {
config.width = this.width || this.EXPORT_WIDTH;
config.height = this.height || this.EXPORT_HEIGHT;
} else if (!this.$container.is(':visible')) {
// If the container is not visible as the chart is being drawn, set some default dimensions
// so that the chart will resize correctly when made visible (SPL-101997)
config.width = this.FALLBACK_WIDTH;
config.height = this.FALLBACK_HEIGHT;
}
// allow zoom for column, line, area charts only
if (this.isZoomable()) {
if (this.zoomType !== 'off') {
config.zoomType = this.zoomType || 'x';
}
}
// don't align the ticks when we have multiple y-axis in the chart and at least one of the axes has either explicit min or explicit max (SPL-113709)
// similarly, trying to align log axes will often create empty space at the top end of the axis, so disable alignment if any axis has log scale
if (this.yAxisList && this.yAxisList.length > 1) {
var hasExplicitMinOrMax = _underscore2.default.find(this.yAxisList, function (yAxis) {
return yAxis.hasExplicitMin || yAxis.hasExplicitMax;
});
var hasLogAxis = _underscore2.default.any(this.yAxisList, function (yAxis) {
return yAxis.isLogScale();
});
if (hasExplicitMinOrMax || hasLogAxis) {
config.alignTicks = false;
}
}
return config;
},
getDataLabelConfig: function getDataLabelConfig() {
if (this.showLabels === 'none' || typeof this.dataLabels === 'undefined') {
return {
enabled: false
};
}
var that = this;
var dataLabelsWithFormatter = _jquery2.default.extend(true, {}, this.dataLabels.getConfig(), {
formatter: function formatter() {
for (var i = 0; i < that.seriesList.length; i++) {
var seriesId = this.series.options.id;
var splunkSeriesId = that.seriesList[i].id;
// To use helper, we need to identity the associated splunk series.
if (seriesId === splunkSeriesId) {
var pointInfo = that.getSeriesPointInfo(that.seriesList[i], this.point);
if (pointInfo) {
return pointInfo.yValueDisplay;
}
}
}
return undefined;
}
});
return dataLabelsWithFormatter;
},
getPlotOptionsConfig: function getPlotOptionsConfig() {
// SPL-74520, track-by-area only works well if the series do not overlap eachother,
// so it is disabled for a non-stacked chart or a range series chart
var trackByArea = this.stackMode !== 'default' && !fieldUtils.isRangeSeriesDataSet(this.dataSet);
var showMarkerHalo = parsingUtils.normalizeBoolean(this.properties['showMarkerHalo'], true);
return _jquery2.default.extend(true, {}, this.BASE_PLOT_OPTIONS_CONFIG, {
series: {
cursor: this.chartClickEnabled ? 'pointer' : 'default',
dataLabels: this.getDataLabelConfig()
},
area: {
enableMouseTracking: !fieldUtils.isOutlierDataSet(this.dataSet),
trackByArea: trackByArea
},
line: {
states: {
hover: (0, _extends3.default)({}, !showMarkerHalo && { halo: 0 })
}
},
column: {
grouping: this.properties['columnGrouping'] !== 'overlay',
minPointLength: this.properties['chart.nullValueMode'] !== 'zero' ? 2 : 0
}
});
},
isAnnotationSupported: function isAnnotationSupported() {
return _underscore2.default.indexOf(['area', 'line', 'column'], this.type) >= 0;
},
isZoomable: function isZoomable() {
return this.type === 'area' || this.type === 'line' || this.type === 'column';
},
isStackable: function isStackable() {
return this.type !== 'line';
},
shouldSetSeriesZerosToNull: function shouldSetSeriesZerosToNull(seriesType) {
return this.type === 'column' && this.properties['chart.nullValueMode'] !== 'zero' && seriesType === 'column';
},
// //////////////////////////////////////////////////////////////////////////////////////
// methods for managing event handlers and effects
enableTooltip: function enableTooltip(hcChart, useStackValue) {
var that = this;
hcChart.tooltip.options.formatter = function tooltipFormatter() {
// now with the shared tooltip functionality, we need to determine if this is an array of points
// or a single point
var curPoint = this.points && this.points.length ? this.points[0] : this;
// need to look up the instance of Splunk.JSCharting.BaseSeries, not the HighCharts series
var series = curPoint.series.splSeries;
return that.formatTooltip(series, curPoint.point, useStackValue);
};
},
onTooltipRefresh: function onTooltipRefresh() {
var _this15 = this;
if (this.legend && this.legendMode === MULTISERIES_MODE) {
var points = this.hcChart.hoverPoints.map(function (hcPoint) {
var series = _this15.getSeriesByName(hcPoint.series.name);
var pointInfo = _this15.getSeriesPointInfo(series, hcPoint);
return {
seriesIndex: hcPoint.series.index,
value: pointInfo.yValue,
formattedValue: pointInfo.yValueDisplay
};
});
this.legend.updateLegend(points);
}
},
onChartLoad: function onChartLoad(chart) {
if (this.legend) {
this.legend.onChartLoad(chart);
}
if (this.dataLabels) {
this.dataLabels.onChartLoad(chart);
}
(0, _underscore2.default)(this.xAxisList).invoke('onChartLoad', chart);
(0, _underscore2.default)(this.yAxisList).invoke('onChartLoad', chart);
(0, _underscore2.default)(this.seriesList).invoke('onChartLoad', chart);
if (this.isZoomable() && !this.shouldRemoveRangeSelectOnLoad()) {
this.triggerRangeSelectionEvent();
}
},
onChartRedraw: function onChartRedraw(chart) {
var that = this;
if (this.selectionWindow) {
this.selectionWindow.onChartRedraw(chart);
} else if (this.isZoomable() && !this.isiOS) {
var xAxis = this.xAxisList[0];
if (xAxis && xAxis.isZoomed) {
if (!this.resetZoomButton) {
this.resetZoomButton = new _ZoomOutButton2.default(this.hcChart);
}
if (this.panButtons) {
this.panButtons.onChartRedraw(chart);
} else {
this.panButtons = new _PanButtons2.default(this.hcChart, this.panDistanceResolver.bind(this));
this.panButtons.on('pan', function () {
that.triggerRangeSelectionEvent();
});
}
} else {
if (this.resetZoomButton) {
this.resetZoomButton.destroy();
this.resetZoomButton = null;
}
if (this.panButtons) {
this.panButtons.destroy();
this.panButtons = null;
}
}
}
// When search zoom is enabled, we are removing panning and reset
// This means until reset is enabled, we do not need this range selection event.
if (this.isZoomable() && !this.selectionTriggeredBeforeRedraw && !this.shouldEnableSearchZoom()) {
var skipNormalization = !this.selectionWindow || this.updateHasRebinned;
this.triggerRangeSelectionEvent(null, { skipNormalization: skipNormalization });
}
this.selectionTriggeredBeforeRedraw = false;
},
onChartLoadOrRedraw: function onChartLoadOrRedraw(chart) {
var _this16 = this;
if (this.legend) {
this.legend.onChartLoadOrRedraw(chart);
}
if (this.dataLabels) {
this.dataLabels.onChartLoadOrRedraw(chart);
}
(0, _underscore2.default)(this.xAxisList).invoke('onChartLoadOrRedraw', chart);
(0, _underscore2.default)(this.yAxisList).invoke('onChartLoadOrRedraw', chart);
(0, _underscore2.default)(this.seriesList).invoke('onChartLoadOrRedraw', chart);
var isSeriesCompareForBarAndColumn = this.properties['legend.mode'] === 'seriesCompare' && (this.type === 'bar' || this.type === 'column');
if (isSeriesCompareForBarAndColumn) {
if (chart.customImages) {
chart.customImages.forEach(function (el) {
el.destroy();
});
chart.customImages.length = 0;
} else {
chart.customImages = [];
}
var that = this;
var shape = void 0;
var XYCache = {};
chart.series.forEach(function (series, seriesIndex) {
series.points.forEach(function (point, index) {
shape = point.shapeArgs;
if (point.y) {
var x = void 0;
var y = void 0;
var width = void 0;
var height = void 0;
if (_this16.type === 'bar') {
x = chart.plotLeft;
y = chart.plotTop + chart.plotHeight - shape.x - shape.width;
width = chart.plotWidth;
height = shape.width;
} else if (_this16.type === 'column') {
// column
x = shape.x + chart.plotLeft;
y = chart.plotTop;
width = shape.width;
height = chart.plotHeight;
}
var key = x + '-' + y + '-' + width + '-' + height;
if (!XYCache[key]) {
XYCache[key] = true;
// these custom images are used to handle mouse events
chart.customImages.push(chart.renderer.image('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=', x, y, width, height).on('mouseover', function () {
that.enableTooltip(chart, true);
chart.tooltip.refresh(chart.series[seriesIndex].points[index]);
}).on('mouseout', function () {
chart.tooltip.hide();
that.enableTooltip(chart, false);
}).on('click', function () {
var pointEventContext = that.getPointEventContext(_this16.seriesList[seriesIndex].hcSeries.points[index], _this16.seriesList[seriesIndex]);
var pointClickEvent = (0, _extends3.default)({
type: 'pointClick'
}, pointEventContext);
delete pointClickEvent['name2'];
delete pointClickEvent['value2'];
_this16.trigger(pointClickEvent);
}).attr('data-test-customImage', chart.customImages.length).add());
}
}
});
});
}
},
onChartDestroy: function onChartDestroy() {
if (this.legend) {
this.legend.destroy();
}
if (this.dataLabels) {
this.dataLabels.destroy();
}
(0, _underscore2.default)(this.xAxisList).invoke('destroy');
(0, _underscore2.default)(this.yAxisList).invoke('destroy');
(0, _underscore2.default)(this.seriesList).invoke('destroy');
if (this.selectionWindow) {
this.selectionWindow.destroy();
this.selectionWindow = null;
}
if (this.panButtons) {
this.panButtons.destroy();
this.panButtons = undefined;
}
if (this.highlighted) {
this.resetHighlight();
}
},
onChartSelection: function onChartSelection(originalEvent) {
// We want to remove reset, panning and the visual only zoom when search zoom is enabled
// This can be done by using preventDefault, which will remove the visual-only zoom effects
if (this.shouldEnableSearchZoom()) {
originalEvent.preventDefault();
}
var xAxis = this.xAxisList[0];
if (!originalEvent.resetSelection) {
var xAxisInfo = originalEvent.xAxis[0];
var normalizedExtremes = this.getNormalizedAxisExtremes(xAxisInfo.min, xAxisInfo.max);
// TODO [sff] maybe this should be handled elsewhere?
xAxisInfo.min = normalizedExtremes.min;
xAxisInfo.max = normalizedExtremes.max;
if (!this.hasTimeXAxis()) {
xAxisInfo.max += xAxis.hasTickmarksBetween() ? 0 : 1;
}
// This is the one place where the range selection event if triggered with explicit extremes,
// at this stage in the event lifecycle the new extremes have not yet been applied to the axis.
var rangeSelectionEvent = this.triggerRangeSelectionEvent(normalizedExtremes);
if (rangeSelectionEvent.isDefaultPrevented()) {
originalEvent.preventDefault();
// cancel a pending range reset event since we are creating a new selection window
this.hasPendingRangeResetEvent = false;
if (xAxis.getZoomed(xAxisInfo.min, xAxisInfo.max)) {
this.selectionWindow = new _SelectionWindow2.default(this.hcChart, this.xAxisValueSnapper.bind(this));
var that = this;
this.selectionWindow.on('rangeSelect', function () {
that.triggerRangeSelectionEvent();
});
}
} else {
// Since we are triggering the event before the chart redraws, set a flag that will suppress what
// would be a duplicate event trigger in onChartRedraw.
this.selectionTriggeredBeforeRedraw = true;
}
}
},
onChartResize: function onChartResize(chart) {
if (this.panButtons) {
this.panButtons.onChartResize(chart);
}
if (this.highlighted) {
// onChart Resize we want to persist highlight
// you need to redraw it since the rendered highlight size has changed.
var existingHighlight = this.highlighted;
this.resetHighlight();
this.highlight(existingHighlight.value, existingHighlight.seriesName);
}
},
// Will be called by components like the pan buttons to determine how far an individual panning action should shift the axis.
// Returns an object with `min` and `max` to indicate a value change for both extremes
panDistanceResolver: function panDistanceResolver(axis, direction) {
// For a category axis, always shift the axis by one category at a time.
if (!this.hasTimeXAxis()) {
return { min: 1, max: 1 };
}
// For an un-binned time axis, shift the axis by one tick interval at a time.
if (!this.hasBinnedTimeXAxis()) {
var tickInterval = axis.dateTime.normalizeTimeTickInterval(axis.tickInterval, axis.options.units).unitRange;
return { min: tickInterval, max: tickInterval };
}
// For a binned time axis, we can use the span information to shift one point at a time.
var extremes = axis.getExtremes();
var timeSeries = this.dataSet.getSeriesAsEpochTimes(this.xFields[0]);
var spanSeries = this.dataSet.getSeriesAsFloats('_span');
var previousMinIndex = this.findNearestTimeBinIndex(extremes.min, timeSeries);
var previousMaxIndex = this.findNearestTimeBinIndex(extremes.max, timeSeries);
// When panning to the left, compute the span of the previous point to each extreme, and shift that far.
if (direction === 'left') {
if (previousMinIndex === 0) {
return { min: 0, max: 0 };
}
return {
min: spanSeries[previousMinIndex - 1] * 1000,
max: spanSeries[previousMaxIndex - 1] * 1000
};
}
// When panning to the right, compute the span of the current point at each extreme, and shift that far.
if (direction === 'right') {
if (previousMaxIndex >= spanSeries.length) {
return { min: 0, max: 0 };
}
return {
min: spanSeries[previousMinIndex] * 1000,
max: spanSeries[previousMaxIndex] * 1000
};
}
return undefined;
},
// Called by components like the selection window to have a raw x-axis value snapped to align with the nearest data point.
// In addition to the raw value, accepts a "snap strategy", which can be "round", "floor", or "ceil".
// Returns the snapped x-axis value.
xAxisValueSnapper: function xAxisValueSnapper(value, snapStrategy) {
snapStrategy = snapStrategy || 'round';
// For a category axis, snap to integer values.
if (!this.hasTimeXAxis()) {
return Math[snapStrategy](value);
}
// For an un-binned time axis the point distribution is unknown, so punt and don't even try to snap.
if (!this.hasBinnedTimeXAxis()) {
return value;
}
// For a binned time axis, find the nearest time bin to the raw value.
var timeSeries = this.dataSet.getSeriesAsEpochTimes(this.xFields[0]);
var binIndex = this.findNearestTimeBinIndex(value, timeSeries);
var roundedTimeValue = timeSeries[binIndex];
// The `findNearestTimeBinIndex` performs a rounding operation,
// so adjust for that if the strategy is "floor" or "ceil".
if (snapStrategy === 'floor' && value < roundedTimeValue && binIndex > 0) {
binIndex--;
} else if (snapStrategy === 'ceil' && value > roundedTimeValue) {
binIndex++;
}
// It's allowed to snap past the last data point, by using its span value to find where the next point would be.
if (binIndex === timeSeries.length) {
return timeSeries[binIndex - 1] + this.dataSet.getSeriesAsFloats('_span')[binIndex - 1] * 1000;
}
return timeSeries[binIndex];
},
getNormalizedAxisExtremes: function getNormalizedAxisExtremes(min, max) {
var hcAxis = this.hcChart.xAxis[0];
var axisMax = hcAxis.dataMax;
var axisMin = hcAxis.dataMin;
var enforceAxisBounds = function enforceAxisBounds(extreme) {
if (extreme > axisMax) {
extreme = axisMax;
}
if (extreme < axisMin) {
extreme = axisMin;
}
return extreme;
};
min = enforceAxisBounds(min);
max = enforceAxisBounds(max);
if (this.hasTimeXAxis()) {
return this.getNormalizedTimeAxisExtremes(min, max);
}
return this.getNormalizedCategoryAxisExtremes(min, max);
},
getNormalizedTimeAxisExtremes: function getNormalizedTimeAxisExtremes(min, max) {
if (!this.hasBinnedTimeXAxis()) {
return { min: min, max: max };
}
var axis = this.xAxisList[0];
var timeSeries = this.dataSet.getSeriesAsEpochTimes(this.xFields[0]);
var spanSeries = this.dataSet.getSeriesAsFloats('_span');
var minIndex = this.findNearestTimeBinIndex(min, timeSeries);
var maxIndex = this.findNearestTimeBinIndex(max, timeSeries);
return {
min: timeSeries[minIndex],
max: timeSeries[maxIndex] + (axis.hasTickmarksBetween() ? 0 : spanSeries[maxIndex] * 1000)
};
},
getNormalizedCategoryAxisExtremes: function getNormalizedCategoryAxisExtremes(min, max) {
var axis = this.xAxisList[0];
var hcAxis = this.hcChart.xAxis[0];
var axisMax = hcAxis.dataMax;
var normalizedMin = Math.round(min);
var normalizedMax = Math.round(max);
var isTouch = this.isiOS && this.hcChart.pointer.selectionMarker;
var isTouchPan = isTouch && this.hcChart.pointer.selectionMarker.width === this.hcChart.plotWidth;
var isTouchZoom = isTouch && this.hcChart.pointer.selectionMarker.width !== this.hcChart.plotWidth;
if (isTouchPan && normalizedMax > normalizedMin && normalizedMax !== axisMax) {
// If max and min are not equal, and if the event was a touch pan, normalize the max for non-column charts.
// Except when panning to the end of the chart.
normalizedMax -= axis.hasTickmarksBetween() ? 0 : 1;
}
if (isTouchZoom && max - min < 1 && !axis.hasTickmarksBetween()) {
// User is zoomed in on 1 point. Do not let them zoom in further
normalizedMax = normalizedMin;
}
return {
min: normalizedMin,
max: normalizedMax
};
},
findNearestTimeBinIndex: function findNearestTimeBinIndex(timeValue, timeSeries) {
var index = _underscore2.default.sortedIndex(timeSeries, timeValue);
if (index === 0) {
return 0;
}
var distanceFromPrevious = timeValue - timeSeries[index - 1];
var distanceFromNext = timeSeries[index] - timeValue;
return distanceFromPrevious < distanceFromNext ? index - 1 : index;
},
calculatePostUpdateExtremes: function calculatePostUpdateExtremes(preUpdateExtremes) {
var xAxis = this.xAxisList[0];
if (!this.hasTimeXAxis()) {
var updatedCategories = xAxis.getCategories();
return updatedCategories.length > preUpdateExtremes.max ? preUpdateExtremes : { min: null, max: null };
}
if (!this.hasBinnedTimeXAxis()) {
return preUpdateExtremes;
}
var timeSeries = this.dataSet.getSeriesAsEpochTimes(this.xFields[0]);
var spanSeries = this.dataSet.getSeriesAsFloats('_span');
var incomingExtremes = {
min: timeSeries[0],
max: _underscore2.default.last(timeSeries) + _underscore2.default.last(spanSeries) * 1000
};
if (incomingExtremes.max < preUpdateExtremes.max || incomingExtremes.min > preUpdateExtremes.min) {
return { min: null, max: null };
}
var lastTimeValue = timeSeries[timeSeries.length - 1];
var min = timeSeries[this.findNearestTimeBinIndex(preUpdateExtremes.min, timeSeries)];
var max = preUpdateExtremes.max > lastTimeValue ? lastTimeValue : timeSeries[this.findNearestTimeBinIndex(preUpdateExtremes.max, timeSeries)];
if (timeSeries.indexOf(preUpdateExtremes.min) === -1 || timeSeries.indexOf(preUpdateExtremes.max) === -1) {
this.updateHasRebinned = true;
}
return { min: min, max: max };
},
triggerRangeSelectionEvent: function triggerRangeSelectionEvent(extremes, options) {
var e = void 0;
var xAxis = this.xAxisList[0];
// The range is being reset if there are no explicit extremes, there is no selection window,
// and the axis is not zoomed.
var isReset = !extremes && !this.selectionWindow && !xAxis.isZoomed;
if (!extremes) {
if (this.selectionWindow) {
extremes = this.selectionWindow.getExtremes();
extremes.min += xAxis.hasTickmarksBetween() ? 1 : 0;
} else {
extremes = this.hcChart.xAxis[0].getExtremes();
if (xAxis.isZoomed) {
extremes.max -= xAxis.hasTickmarksBetween() ? 0 : 1;
}
}
if (!options || !options.skipNormalization) {
extremes = this.getNormalizedAxisExtremes(extremes.min, extremes.max);
}
}
if (this.hasTimeXAxis()) {
var timeSeries = this.dataSet.getSeriesAsEpochTimes(this.xFields[0]);
var span = 0;
var endXIndex = _underscore2.default.sortedIndex(timeSeries, extremes.max);
if (this.hasBinnedTimeXAxis() && xAxis.hasTickmarksBetween() && !this.selectionWindow) {
var spanSeries = this.dataSet.getSeriesAsFloats('_span');
span = spanSeries[endXIndex];
} else if (this.hasBinnedTimeXAxis() && (!xAxis.hasTickmarksBetween() || this.selectionWindow)) {
endXIndex--;
}
e = _jquery2.default.Event('chartRangeSelect', {
startXIndex: _underscore2.default.sortedIndex(timeSeries, extremes.min),
endXIndex: endXIndex,
startXValue: extremes.min / 1000,
endXValue: extremes.max / 1000 + span,
isReset: !!isReset
});
} else {
var categories = this.dataSet.getSeries(this.xFields[0]);
e = _jquery2.default.Event('chartRangeSelect', {
startXIndex: extremes.min,
endXIndex: extremes.max,
startXValue: categories[extremes.min],
endXValue: categories[extremes.max],
isReset: !!isReset
});
}
this.trigger(e);
return e;
},
pointerDragStartPreHook: function pointerDragStartPreHook(pointer, e) {
this.isMouseInteractionActive = true;
if (this.selectionWindow) {
var handled = this.selectionWindow.handleDragStartEvent(e);
if (!handled) {
this.destroySelectionWindow();
}
}
},
/*
* Override the default behavior of the Highcharts Pointer#pinch method, so that we can remap
* gestures into manipulations of the range selection window (if it's there) as opposed to axis zoom/pan.
*/
pointerPinchOverride: function pointerPinchOverride(pointer, e, originalFn) {
if (this.selectionWindow) {
if (e.type === 'touchstart') {
// For touchstart, the original function needs to run because it sets some stateful reference
// co-ordinates that are used later to compute drag distances. We can prevent Highcharts from
// doing any axis zoom work by disabling the zoomEnabled flag for the x-axis.
this.hcChart.xAxis[0].zoomEnabled = false;
originalFn.call(pointer, e);
var handled = this.selectionWindow.handleDragStartEvent(e);
if (!handled) {
this.destroySelectionWindow();
}
this.hcChart.xAxis[0].zoomEnabled = true;
} else if (e.type === 'touchmove') {
this.selectionWindow.handleDragEvent(e);
} else if (e.type === 'touchend') {
this.selectionWindow.handleDropEvent(e);
}
} else {
originalFn.call(pointer, e);
}
},
destroySelectionWindow: function destroySelectionWindow() {
if (this.selectionWindow) {
this.selectionWindow.destroy();
this.selectionWindow = null;
// note that a range reset event is pending, to be handled in pointerDropPostHook
// this can potentially be cancelled if the current drag event results in creating a new selected range
this.hasPendingRangeResetEvent = true;
}
},
pointerDragOverride: function pointerDragOverride(pointer, e, originalFn) {
if (this.selectionWindow) {
this.selectionWindow.handleDragEvent(e);
} else {
originalFn.call(pointer, e);
if (this.hcChart.pointer.selectionMarker) {
this.hcChart.pointer.selectionMarker.attr({
'stroke-width': 2,
stroke: this.foregroundColorSofter
});
}
}
},
pointerDropPreHook: function pointerDropPreHook(pointer, e) {
if (this.selectionWindow) {
this.selectionWindow.handleDropEvent(e);
}
},
pointerDropPostHook: function pointerDropPostHook() {
if (this.hasPendingRangeResetEvent) {
this.triggerRangeSelectionEvent();
this.hasPendingRangeResetEvent = false;
}
this.isMouseInteractionActive = false;
},
// ///////////////////////////////////////////////////////////////////////////////////
// re-usable helpers
getSeriesByName: function getSeriesByName(name) {
return (0, _underscore2.default)(this.seriesList).find(function (series) {
return series.hcSeries.name === name;
});
},
getSeriesXInfo: function getSeriesXInfo(series) {
var xIndex = series.getXAxisIndex();
return {
axis: this.xAxisList[xIndex],
fieldName: this.xFields[xIndex]
};
},
getSeriesYInfo: function getSeriesYInfo(series) {
return {
axis: this.yAxisList[series.getYAxisIndex()],
fieldName: series.getName()
};
},
getSeriesPointInfo: function getSeriesPointInfo(series, hcPoint) {
var pointIndex = _underscore2.default.has(hcPoint, 'originalIndex') ? hcPoint.originalIndex : hcPoint.index;
var xInfo = this.getSeriesXInfo(series);
var yInfo = this.getSeriesYInfo(series);
var categories = this.dataSet.getSeries(xInfo.fieldName);
var ySeries = this.dataSet.getSeries(yInfo.fieldName);
return {
pointIndex: pointIndex,
xAxisIsTime: xInfo.axis instanceof _TimeAxis2.default,
xAxisName: xInfo.fieldName,
xValue: categories[pointIndex],
xValueDisplay: xInfo.axis.formatValue(categories[pointIndex], hcPoint),
yAxisName: yInfo.fieldName,
yValue: ySeries[pointIndex],
yValueDisplay: yInfo.axis.formatValue(ySeries[pointIndex], hcPoint),
shouldColorizeTooltipData: this.shouldColorizeTooltipData
};
},
getDashStyle: function getDashStyle() {
// convert first char to upper case as HighCharts expects options to have this convention
var dashStyle = this.properties['lineDashStyle'];
if (dashStyle) {
return parsingUtils.capitalize(dashStyle);
}
return undefined;
},
// by convention, we consider a series to be time-based if it is called _time
seriesIsTimeBased: function seriesIsTimeBased(fieldName) {
return (/^_time/.test(fieldName)
);
},
formatNumericAxisData: function formatNumericAxisData(axis, fieldName, seriesType) {
if (!this.dataSet.hasField(fieldName)) {
return [];
}
return this.dataSet.getSeriesAsFloats(fieldName, {
scale: axis.isLogScale() ? 'log' : 'linear',
nullValueMode: this.properties['chart.nullValueMode'],
zerosToNull: this.shouldSetSeriesZerosToNull(seriesType)
});
},
formatTimeAxisData: function formatTimeAxisData(axis, fieldName) {
if (!this.dataSet.hasField(fieldName)) {
return [];
}
return this.dataSet.getSeriesAsEpochTimes(fieldName);
},
computeFieldColor: function computeFieldColor(field, index, fieldList) {
// eslint-disable-next-line no-prototype-builtins
if (this.internalFieldColors.hasOwnProperty(field)) {
return colorUtils.colorFromHex(this.internalFieldColors[field]);
}
var useExternalPalette = !this.seriesColors && !(0, _underscore2.default)(this.externalPaletteMapping).isEmpty();
var paletteIndex = useExternalPalette ? this.externalPaletteMapping[field] : index;
var paletteSize = useExternalPalette ? this.externalPaletteSize : fieldList.length;
return this.colorPalette.getColorAsRgb(field, paletteIndex, paletteSize);
},
shouldEnableSearchZoom: function shouldEnableSearchZoom() {
return this.dataSet.chartDataOptions.enableSearchZoom;
},
shouldRemoveRangeSelectOnLoad: function shouldRemoveRangeSelectOnLoad() {
return this.dataSet.chartDataOptions.removeRangeSelectOnLoad;
},
// ///////////////////////////////////////////////////////////////////////////////////
// templates and default settings
BASE_CONFIG: {
chart: {
showAxes: true,
reflow: false,
selectionMarkerFill: 'rgba(0,0,0,0)',
spacingTop: 16,
style: {
fontFamily: _constants.FONT_FAMILY,
fontSize: _constants.FONT_SIZE
}
},
credits: {
enabled: false
},
legend: {
enabled: false
},
plotOptions: {
series: {
states: {
// series start out with their hover state disabled, it is enabled after draw is complete
hover: {
enabled: false
},
inactive: {
opacity: 0.4
}
},
events: {
legendItemClick: function legendItemClick() {
return false;
}
},
borderWidth: 0,
shadow: false,
turboThreshold: 0
}
},
title: {
text: null
},
tooltip: {
enabled: false,
useHTML: true
}
},
BASE_PLOT_OPTIONS_CONFIG: {
line: {
stickyTracking: true,
states: {
hover: {
marker: {
enabled: true,
radius: 6
}
}
},
marker: {
enabled: false,
radius: 2,
symbol: 'circle'
}
},
area: {
stickyTracking: true,
lineWidth: 1,
states: {
hover: {
marker: {
enabled: true,
radius: 6
}
}
},
marker: {
symbol: 'circle',
radius: 2,
enabled: false
}
},
column: {
markers: {
enabled: false
},
stickyTracking: false,
fillOpacity: 1,
trackByArea: true
},
bar: {
markers: {
enabled: false
},
stickyTracking: false,
fillOpacity: 1,
trackByArea: true
}
}
});
exports.default = Chart;
module.exports = exports['default'];
/***/ }),
/* 28 */
/***/ (function(module, exports, __webpack_require__) {
var dP = __webpack_require__(29);
var createDesc = __webpack_require__(48);
module.exports = __webpack_require__(21) ? function (object, key, value) {
return dP.f(object, key, createDesc(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
/***/ }),
/* 29 */
/***/ (function(module, exports, __webpack_require__) {
var anObject = __webpack_require__(30);
var IE8_DOM_DEFINE = __webpack_require__(189);
var toPrimitive = __webpack_require__(190);
var dP = Object.defineProperty;
exports.f = __webpack_require__(21) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
anObject(O);
P = toPrimitive(P, true);
anObject(Attributes);
if (IE8_DOM_DEFINE) try {
return dP(O, P, Attributes);
} catch (e) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
/***/ }),
/* 30 */
/***/ (function(module, exports, __webpack_require__) {
var isObject = __webpack_require__(46);
module.exports = function (it) {
if (!isObject(it)) throw TypeError(it + ' is not an object!');
return it;
};
/***/ }),
/* 31 */
/***/ (function(module, exports) {
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function (it, key) {
return hasOwnProperty.call(it, key);
};
/***/ }),
/* 32 */
/***/ (function(module, exports) {
module.exports = __webpack_require__("./node_modules/@splunk/highcharts-themes/constants.js");
/***/ }),
/* 33 */
/***/ (function(module, exports, __webpack_require__) {
var getNative = __webpack_require__(22);
/* Built-in method references that are verified to be native. */
var nativeCreate = getNative(Object, 'create');
module.exports = nativeCreate;
/***/ }),
/* 34 */
/***/ (function(module, exports, __webpack_require__) {
var eq = __webpack_require__(224);
/**
* Gets the index at which the `key` is found in `array` of key-value pairs.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} key The key to search for.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq(array[length][0], key)) {
return length;
}
}
return -1;
}
module.exports = assocIndexOf;
/***/ }),
/* 35 */
/***/ (function(module, exports, __webpack_require__) {
var isKeyable = __webpack_require__(230);
/**
* Gets the data for `map`.
*
* @private
* @param {Object} map The map to query.
* @param {string} key The reference key.
* @returns {*} Returns the map data.
*/
function getMapData(map, key) {
var data = map.__data__;
return isKeyable(key)
? data[typeof key == 'string' ? 'string' : 'hash']
: data.map;
}
module.exports = getMapData;
/***/ }),
/* 36 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _jquery = __webpack_require__(0);
var _jquery2 = _interopRequireDefault(_jquery);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function Throttler(properties) {
properties = properties || {};
this.highlightDelay = properties.highlightDelay || 200;
this.unhighlightDelay = properties.unhighlightDelay || 100;
this.timer = null;
this.timer2 = null;
this.mouseStatus = 'over';
this.isSelected = false;
this.onMouseOver = properties.onMouseOver;
this.onMouseOut = properties.onMouseOut;
}
_jquery2.default.extend(Throttler.prototype, {
setMouseStatus: function setMouseStatus(status) {
this.mouseStatus = status;
},
getMouseStatus: function getMouseStatus() {
return this.mouseStatus;
},
mouseOverHappened: function mouseOverHappened() {
var _this = this;
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (Throttler._synchronousBehavior) {
this.onMouseOver.apply(null, args);
return;
}
this.mouseOverFn = function () {
_this.onMouseOver.apply(null, args);
};
clearTimeout(this.timer);
clearTimeout(this.timer2);
this.setMouseStatus('over');
this.timeOutManager();
},
mouseOutHappened: function mouseOutHappened() {
var _this2 = this;
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
if (Throttler._synchronousBehavior) {
this.onMouseOut.apply(null, args);
return;
}
this.mouseOutFn = function () {
_this2.onMouseOut.apply(null, args);
};
this.setMouseStatus('out');
this.timeOutManager();
},
timeOutManager: function timeOutManager() {
var that = this;
clearTimeout(this.timer);
if (this.isSelected) {
if (this.getMouseStatus() === 'over') {
this.mouseEventManager();
} else {
this.timer2 = setTimeout(function () {
that.setMouseStatus('out');
that.mouseEventManager();
}, that.unhighlightDelay);
}
} else {
this.timer = setTimeout(function () {
that.isSelected = true;
that.mouseEventManager();
}, that.highlightDelay);
}
},
mouseEventManager: function mouseEventManager() {
if (this.getMouseStatus() === 'over') {
this.mouseOverFn();
this.isSelected = true;
this.setMouseStatus('out');
} else {
this.mouseOutFn();
this.isSelected = false;
this.setMouseStatus('over');
}
}
});
_jquery2.default.extend(Throttler, {
_synchronousBehavior: false,
useSynchronousBehavior: function useSynchronousBehavior() {
Throttler._synchronousBehavior = true;
},
restoreDefaultBehavior: function restoreDefaultBehavior() {
Throttler._synchronousBehavior = false;
}
});
exports.default = Throttler;
module.exports = exports['default'];
/***/ }),
/* 37 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var _toConsumableArray2 = __webpack_require__(104);
var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
var _extends2 = __webpack_require__(9);
var _extends3 = _interopRequireDefault(_extends2);
var _jquery = __webpack_require__(0);
var _jquery2 = _interopRequireDefault(_jquery);
var _underscore = __webpack_require__(1);
var _underscore2 = _interopRequireDefault(_underscore);
var _Formatter = __webpack_require__(11);
var _Formatter2 = _interopRequireDefault(_Formatter);
var _color = __webpack_require__(7);
var _parsing = __webpack_require__(3);
var _constants = __webpack_require__(32);
var _theme = __webpack_require__(4);
var _EventMixin = __webpack_require__(10);
var _EventMixin2 = _interopRequireDefault(_EventMixin);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function Point(hcPoint) {
this.index = hcPoint.index;
// The original index is used track where the point appeared in the original data set,
// which is not always the same as its index in the chart series (see setData below).
this.originalIndex = _underscore2.default.has(hcPoint, 'originalIndex') ? hcPoint.originalIndex : this.index;
this.seriesName = hcPoint.series.name;
this.name = hcPoint.name;
this.y = hcPoint.y;
this.plotX = hcPoint.plotX;
this.plotY = hcPoint.plotY;
}
function Series(properties) {
this.properties = this.normalizeProperties(properties || {});
this.processProperties();
this.id = _underscore2.default.uniqueId('series_');
this.data = [];
this._isDirty = false;
this._dataIsDirty = false;
this.UNHIGHLIGHTED_COLOR = (0, _color.addAlphaToColor)(this.UNHIGHLIGHTED_BASE_COLOR, this.UNHIGHLIGHTED_OPACITY);
this.UNHIGHLIGHTED_BORDER_COLOR = (0, _color.addAlphaToColor)(this.UNHIGHLIGHTED_BORDER_BASE_COLOR, this.UNHIGHLIGHTED_OPACITY);
}
Series.prototype = _jquery2.default.extend({}, _EventMixin2.default, {
STACK_MODE_MAP: {
default: null,
stacked: 'normal',
stacked100: 'percent'
},
CHART_PROPERTY_PREFIX_REGEX: /^chart\./,
UNHIGHLIGHTED_OPACITY: 0.4,
UNHIGHLIGHTED_BASE_COLOR: 'rgb(150, 150, 150)',
UNHIGHLIGHTED_BORDER_BASE_COLOR: 'rgb(200, 200, 200)',
DEFAULT_STACK_MODE: null,
CHARTING_PROPERTY_WHITELIST: [],
// a centralized normalization method for series properties, subclasses override or extend the
// CHARTING_PROPERTY_WHITELIST with a list of property names (without the leading "chart.")
// to be parsed from the chart properties passed to the constructor
normalizeProperties: function normalizeProperties(rawProps) {
var _this = this;
var normalizedProps = _jquery2.default.extend(true, {}, rawProps);
(0, _underscore2.default)(normalizedProps).each(function (value, key) {
if (_this.CHART_PROPERTY_PREFIX_REGEX.test(key)) {
delete normalizedProps[key];
var strippedKey = key.replace(_this.CHART_PROPERTY_PREFIX_REGEX, '');
if ((0, _underscore2.default)(_this.CHARTING_PROPERTY_WHITELIST).contains(strippedKey)) {
normalizedProps[strippedKey] = value;
}
}
});
return normalizedProps;
},
// no-op to be overridden by sub-classes
processProperties: function processProperties() {},
redraw: function redraw(redrawChart) {
if (!this.hcSeries && (!this.nestedSeriesList || !this.nestedSeriesList.every(function (nestedSeries) {
return nestedSeries.hcSeries;
}))) {
// this is not an error state, there are cases where a new series is added dynamically in an update
return;
}
if (this.isDirty()) {
if (this.hcSeries) {
this.hcSeries.update(this.getConfig(), redrawChart);
} else if (this.nestedSeriesList) {
this.nestedSeriesList.forEach(function (nestedSeries) {
nestedSeries.hcSeries.update(nestedSeries.getConfig(), redrawChart);
});
}
} else if (this.dataIsDirty()) {
if (this.hcSeries) {
this.hcSeries.setData(this.hasPrettyData ? this.prettyData : this.data, redrawChart);
} else if (this.nestedSeriesList) {
this.nestedSeriesList.forEach(function (nestedSeries) {
nestedSeries.hcSeries.setData(nestedSeries.data, redrawChart);
});
}
}
},
update: function update(properties) {
var oldProperties = this.properties;
this.properties = this.normalizeProperties(properties);
if (!_underscore2.default.isEqual(this.properties, oldProperties)) {
this.processProperties();
this._isDirty = true;
}
},
setData: function setData(inputData, options) {
options = options || {};
var oldData = this.data;
if (!_underscore2.default.isArray(inputData.y) || inputData.y.length === 0) {
this.data = [];
} else if ((0, _underscore2.default)(inputData.x).isUndefined()) {
this.data = inputData.y;
} else if (options.isOutlierField) {
this.data = (0, _underscore2.default)(inputData.y).chain().map(function (v, i) {
if (v.isOutlier) {
return {
x: inputData.x[i],
y: v.y,
marker: {
enabled: true,
radius: 4,
fillColor: _constants.COLORS.SEMANTIC_WARNING
}
};
}
return {
x: inputData.x[i],
y: v
};
}).value();
} else if (options.sortXValues) {
// If the x-values need to be sorted, first put them in a format that allows for tracking the original index.
// We need to avoid the issue where we have a NaN x-value and non-NaN y-value. Highcharts interprets this as an
// error and creates a blank SVG for the series.
this.data = (0, _underscore2.default)(inputData.x).chain().map(function (value, i) {
return {
x: value,
y: isNaN(value) ? null : inputData.y[i],
originalIndex: i
};
}).sortBy(function (datum) {
return datum.x;
}).value();
} else {
this.data = (0, _underscore2.default)(inputData.x).map(function (value, i) {
return [value, inputData.y[i]];
});
}
if (!_underscore2.default.isEqual(this.data, oldData)) {
this._dataIsDirty = true;
}
},
getData: function getData() {
return this.data;
},
isDirty: function isDirty() {
return this._isDirty;
},
dataIsDirty: function dataIsDirty() {
return this._dataIsDirty;
},
getXAxisIndex: function getXAxisIndex() {
return this.properties.xAxis || 0;
},
getYAxisIndex: function getYAxisIndex() {
return this.properties.yAxis || 0;
},
getName: function getName() {
return this.properties.name;
},
getLegendKey: function getLegendKey() {
return this.properties.legendKey || this.getName();
},
getFieldList: function getFieldList() {
return [this.getName()];
},
matchesName: function matchesName(name) {
return name === this.getName();
},
applyColorMapping: function applyColorMapping(colorMapping) {
var oldColor = this.color;
this.color = colorMapping[this.getName()];
if (this.color !== oldColor) {
this._isDirty = true;
}
},
getColor: function getColor() {
return this.color;
},
getStackMode: function getStackMode() {
return this.STACK_MODE_MAP[this.properties['stacking']] || this.DEFAULT_STACK_MODE;
},
getType: function getType() {
return this.type;
},
getConfig: function getConfig() {
return {
type: this.type,
id: this.id,
name: this.getName(),
color: this.color,
data: this.hasPrettyData ? this.prettyData : this.data,
xAxis: this.getXAxisIndex(),
yAxis: this.getYAxisIndex(),
stacking: this.getStackMode()
};
},
onChartLoad: function onChartLoad() {},
onChartLoadOrRedraw: function onChartLoadOrRedraw(chart) {
this.hcSeries = chart.get(this.id);
// create a back-reference so we can get from the HighCharts series to this object
this.hcSeries.splSeries = this;
this._isDirty = false;
this._dataIsDirty = false;
this.hcSeries.options.states.hover.enabled = true;
this.addEventHandlers(this.hcSeries);
},
addEventHandlers: function addEventHandlers(hcSeries) {
var _this2 = this;
hcSeries.options.point.events = hcSeries.options.point.events || {};
var that = this;
var pointEvents = hcSeries.options.point.events;
var container = hcSeries.chart.container;
(0, _jquery2.default)(container).on('keydown', function (e) {
if (e.keyCode === 9 && hcSeries.state === 'hover') {
that.trigger('keydown', [_this2, that]);
}
});
pointEvents.mouseOver = function handleMouseOver() {
var hcPoint = this;
var point = new Point(hcPoint);
that.trigger('mouseover', [point, that]);
};
pointEvents.mouseOut = function handleMouseOut() {
var hcPoint = this;
var point = new Point(hcPoint);
that.trigger('mouseout', [point, that]);
};
if ((0, _parsing.normalizeBoolean)(this.properties['clickEnabled'])) {
pointEvents.click = function handleClick(e) {
var hcPoint = this;
var point = new Point(hcPoint);
var clickEvent = {
type: 'click',
modifierKey: e.ctrlKey || e.metaKey
};
that.trigger(clickEvent, [point, that]);
};
}
},
destroy: function destroy() {
this.off();
// remove the back-reference to avoid any reference loops that might confuse the GC
if (this.hcSeries && this.hcSeries.splSeries) {
this.hcSeries.splSeries = null;
}
this.hcSeries = null;
},
handlePointMouseOver: function handlePointMouseOver() {
this.bringToFront();
},
handleLegendMouseOver: function handleLegendMouseOver() {
this.bringToFront();
this.highlight();
},
bringToFront: function bringToFront() {
if (this.hcSeries.group) {
this.hcSeries.group.toFront();
}
if (this.hcSeries.trackerGroup) {
this.hcSeries.trackerGroup.toFront();
}
},
estimateMaxColumnWidths: function estimateMaxColumnWidths(hcChart, leftColData, rightColData) {
var formatter = new _Formatter2.default(hcChart.renderer);
var fontSize = hcChart.options.tooltip.style.fontSize.replace('px', '');
// Use the text in the columns to roughly estimate which column requires more space
var maxLeftColWidth = -Infinity;
var maxRightColWidth = -Infinity;
_underscore2.default.each(leftColData, function (datum) {
var colWidth = formatter.predictTextWidth(datum, fontSize);
if (colWidth > maxLeftColWidth) {
maxLeftColWidth = colWidth;
}
});
_underscore2.default.each(rightColData, function (datum) {
var colWidth = formatter.predictTextWidth(datum, fontSize);
if (colWidth > maxRightColWidth) {
maxRightColWidth = colWidth;
}
});
formatter.destroy();
return { maxLeftColWidth: maxLeftColWidth, maxRightColWidth: maxRightColWidth };
},
// To be overridden by subclasses
getTooltipRows: function getTooltipRows(info) {
var rows = [];
if (info.xAxisIsTime) {
rows.push([info.xValueDisplay]);
} else {
rows.push([info.xAxisName, info.xValueDisplay]);
}
rows.push([(0, _extends3.default)({}, info.shouldColorizeTooltipData && { color: info.seriesColor }, { text: info.seriesName }), info.yValueDisplay]);
return rows;
},
// find a way to send the target series and target point to the handler just like a click event
getTooltipHtml: function getTooltipHtml(info, hcChart, allPointInformation, isSeriesCompareForBarAndColumn) {
info.seriesName = this.getName();
info.seriesColor = this.getColor();
var normalizeToText = function normalizeToText(cellInfo) {
return (0, _underscore2.default)(cellInfo).isString() ? cellInfo : cellInfo.text;
};
var normalizeToColor = function normalizeToColor(cellInfo) {
return (0, _underscore2.default)(cellInfo).isString() ? null : cellInfo.color;
};
var tooltipRows = this.getTooltipRows(info);
if (allPointInformation) {
tooltipRows = [tooltipRows[0]].concat((0, _toConsumableArray3.default)(allPointInformation));
}
var maxTooltipWidth = hcChart.chartWidth - 50;
var leftColData = (0, _underscore2.default)(tooltipRows).map(function (row) {
return normalizeToText(row[0] || '');
});
var rightColData = (0, _underscore2.default)(tooltipRows).map(function (row) {
return normalizeToText(row[1] || '');
});
var colResults = this.estimateMaxColumnWidths(hcChart, leftColData, rightColData);
var leftColRatio = colResults.maxLeftColWidth / (colResults.maxLeftColWidth + colResults.maxRightColWidth);
// Make sure one column doesn't completely dominate the other
if (leftColRatio > 0.9) {
leftColRatio = 0.9;
} else if (leftColRatio < 0.1) {
leftColRatio = 0.1;
}
info.scaledMaxLeftColWidth = leftColRatio * maxTooltipWidth + 'px';
info.scaledMaxRightColWidth = (1 - leftColRatio) * maxTooltipWidth + 'px';
info.willWrap = colResults.maxLeftColWidth + colResults.maxRightColWidth > maxTooltipWidth;
info.totalStackValue = null;
if (isSeriesCompareForBarAndColumn) {
info.totalStackValue = hcChart.series.map(function (series) {
return series.data[info.pointIndex].y;
}).reduce(function (a, b) {
return a + b;
}).toLocaleString();
}
return this.tooltipTemplate(_jquery2.default.extend(info, {
rows: tooltipRows,
normalizeToText: normalizeToText,
normalizeToColor: normalizeToColor,
getThemeProperty: _theme.getThemeProperty
}));
},
// stub methods to be overridden as needed by subclasses
handlePointMouseOut: function handlePointMouseOut() {},
handleLegendMouseOut: function handleLegendMouseOut() {},
highlight: function highlight() {},
unHighlight: function unHighlight() {},
highlightPoint: function highlightPoint() {},
unHighlightPoint: function unHighlightPoint() {},
tooltipTemplate: (0, _underscore.template)('\n
| <%- normalizeToText(row[0]) %> | \n <% } else { %>\n<%- normalizeToText(row[0]) %>: | \n<%- normalizeToText(row[1]) %> | \n <% } %>\n
| Total: | \n<%- totalStackValue %> | \n
\n <%= _(\'Splunk, Splunk>, Turn Data Into Doing, Data-to-Everything, and D2E are trademarks or registered trademarks of Splunk Inc. in the United States and other countries. All other brand names, product names, or trademarks belong to their respective owners.\').t() %>\n
\n\n <% var patentLink = sprintf(\'%s\', css.aboutLink, _(\'here\').t()); %>\n <%= sprintf(_(\'Certain features and functionalities of this Software are or may be protected by patents owned by Splunk Inc. that are listed %s.\').t(), patentLink) %>\n
\n\n © <%- copyrightYear %> <%= _(\'Splunk Inc. All rights reserved.\').t()%>\n
\n\n <% if (isCloud) { %>\n <% var termsLink = sprintf(\'%s\', css.aboutLink, _(\'Terms of Service\').t()); %>\n <%= sprintf(_(\'All use of this service is subject to the Splunk Cloud %s.\').t(), termsLink) %>\n <% } else { %>\n <% var licenseLink = sprintf(\'%s\', css.aboutLink, _(\'Splunk General Terms\').t()); %>\n <% var termsLink = _(\'terms and conditions\').t(); %>\n <%= sprintf(_(\'All use of this Software is subject to the %s of the %s.\').t(), termsLink, licenseLink) %>\n <% } %>\n
\n\n <%- _(\'This health report displays information from the /health/splunkd/details endpoint. There are three potential states for a feature:\').t() %>\n
\n\n <%- _(\'This feature is functioning correctly.\').t() %>\n
\n\n <%- _(\'This feature\\\'s health report is disabled.\').t() %>\n
\n<%= _("Your network connection may have been lost or Splunk server may be down.").t() %>
\n\n'},1342:function(e,t,n){(t=e.exports=n(9)(!1)).push([e.i,".view---enterprise---dev---3fYoS{text-align:center}.spinnerWrapper---enterprise---dev---2Ybiy{float:left;margin:10px 0 10px 50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}h1,p{color:#3c444d}",""]),t.locals={view:"view---enterprise---dev---3fYoS",spinnerWrapper:"spinnerWrapper---enterprise---dev---2Ybiy"}},1343:function(e,t,n){(t=e.exports=n(9)(!1)).i(n(86),void 0),t.push([e.i,".backdrop---enterprise---dev---1VX86{z-index:1051}.view---enterprise---dev---1NWw4{padding:20px;z-index:1052}",""]),t.locals={backdrop:"backdrop---enterprise---dev---1VX86 "+n(86).locals.backdrop,view:"view---enterprise---dev---1NWw4 "+n(86).locals.view}},1344:function(e,t){e.exports='\n\n \n <%- skipTourLabel %>\n \n \n <%- continueLabel %>\n \n <% if (doneLabel) { %>\n \n <%- doneLabel %>\n \n <% } %>\n
\n