Reads: (No info on usage) Writes: (No
+ info on usage)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Key Events ()
+
+
+
+
+
+
None
+
+
+
+
+
+
+
+
+
None
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/icon.png b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/icon.png
new file mode 100644
index 00000000..3f8c05a8
Binary files /dev/null and b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/icon.png differ
diff --git a/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/DA-ITSI-CP-windows-dashboards/WinfraConstants.js b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/DA-ITSI-CP-windows-dashboards/WinfraConstants.js
new file mode 100644
index 00000000..528eab6a
--- /dev/null
+++ b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/DA-ITSI-CP-windows-dashboards/WinfraConstants.js
@@ -0,0 +1,42 @@
+/*
+ * This file contains a collection of constants for use in the Winfra app's js files
+ */
+
+define([
+ '/static/app/DA-ITSI-CP-windows-dashboards/js/swc-windows-cp/index.js'
+ ],
+ function(index) {
+ const splunk_util = index.SplunkUtil;
+ var WinfraConstants = {
+ getAppName: function() { return 'itsi'; },
+
+ getAppRestId: function() { return 'itsi'; },
+
+ getDefaultSparklineSettings: function() {
+ return {
+ type: "line",
+ lineColor: "#070",
+ lineWidth: 1,
+ height: 30,
+ highlightSpotColor: null,
+ minSpotColor: null,
+ maxSpotColor: null,
+ spotColor: '#070',
+ spotRadius: 2,
+ fillColor: null
+ };
+ },
+
+ getSplunkWebUrl: function(){
+ return (splunk_util.getConfigValue('MRSPARKLE_ROOT_PATH', '/') + '/')
+ .replace(/^(\/)+/, "$1")
+ .replace(/(\/)+$/, "$1");
+ },
+
+ getPerfmonPath: function() {
+ return WinfraConstants.getSplunkWebUrl() + 'app/itsi/search?';
+ }
+ };
+
+ return WinfraConstants;
+});
\ No newline at end of file
diff --git a/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/DA-ITSI-CP-windows-dashboards/components/dnsperformanceview.js b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/DA-ITSI-CP-windows-dashboards/components/dnsperformanceview.js
new file mode 100644
index 00000000..28cae738
--- /dev/null
+++ b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/DA-ITSI-CP-windows-dashboards/components/dnsperformanceview.js
@@ -0,0 +1,108 @@
+define(function(require, exports, module) {
+
+ require('/static/app/DA-ITSI-CP-windows-dashboards/js/common/contrib/jquery-3.5.0.min.js');
+ require('/static/app/DA-ITSI-CP-windows-dashboards/js/common/contrib/highcharts.js');
+ var _ = require('/static/app/DA-ITSI-CP-windows-dashboards/js/common/contrib/underscore.js');
+ var SimpleSplunkView = require("splunkjs/mvc/simplesplunkview");
+ var LINE_NAME = "% Processor Time";
+ var DNSPerformanceView = SimpleSplunkView.extend({
+
+ className: "splunk-app-microsoft-dnsperformanceview",
+
+ output_mode: "json",
+
+ _highchart: null,
+
+ createView: function() {
+ return true;
+ },
+
+ formatData: function(data){
+ return data;
+ },
+
+ updateView: function(viz, data) {
+ if (data.length == 0) {
+ return;
+ }
+
+ var areaName = '';
+
+ _.each(data, function(datum) {
+ _.each(_.keys(datum), function(key) {
+ if (key !== LINE_NAME && key.indexOf('_') !== 0) {
+ areaName = key;
+ }
+ });
+ });
+
+ var lineData = [];
+ var areaData = [];
+
+ _.each(data, function(datum) {
+ if (!_.isUndefined(datum[LINE_NAME])) {
+ lineData.push([
+ Date.parse(datum._time),
+ parseFloat(datum[LINE_NAME])
+ ]);
+ }
+ if (!_.isUndefined(datum[areaName])) {
+ areaData.push([
+ Date.parse(datum._time),
+ parseFloat(datum[areaName])
+ ]);
+ }
+ });
+
+ if (this._highchart) {
+ this._highchart.destroy();
+ }
+ this.$el.empty();
+ this.$el.append('');
+ this._highchart = new Highcharts.Chart({
+ chart: {
+ renderTo: this.$('div')[0]
+ },
+ credits: {
+ enabled: false
+ },
+ title: { text: "" },
+ xAxis: [{
+ type: 'datetime',
+ title: { text: "Time" }
+ }],
+ yAxis: [
+ {
+ title: { text: LINE_NAME },
+ opposite: true,
+ min: 0,
+ max: 100
+ },
+ {
+ title: { text: areaName }
+ }
+ ],
+
+ series: [
+ {
+ type: 'area',
+ data: areaData,
+ name: areaName,
+ yAxis: 1
+ },
+ {
+ type: 'line',
+ data: lineData,
+ name: LINE_NAME
+ }
+ ]
+ });
+ },
+
+ getData: function(){
+ return this.resultsModel.data().results;
+ }
+
+ });
+ return DNSPerformanceView;
+});
\ No newline at end of file
diff --git a/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/DA-ITSI-CP-windows-dashboards/components/ldaprecordview.css b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/DA-ITSI-CP-windows-dashboards/components/ldaprecordview.css
new file mode 100644
index 00000000..701e3450
--- /dev/null
+++ b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/DA-ITSI-CP-windows-dashboards/components/ldaprecordview.css
@@ -0,0 +1,31 @@
+.splunk-app-microsoft-ldaprecordview {
+ width: 100%;
+ overflow-x: scroll;
+}
+
+.splunk-app-microsoft-ldaprecordview div.oc {
+ width: 100%;
+}
+
+.splunk-app-microsoft-ldaprecordview div.oc h3.title {
+ padding: 6px;
+ background: #C7DBB9;
+ font: italic bold 8pt/14pt Helvetica,sans-serif;
+}
+
+.splunk-app-microsoft-ldaprecordview div.oc div.content {
+ padding-left: 10px;
+ padding-right: 10px;
+ font: black 10pt Arial,Helvetica,sans-serif;
+}
+
+.splunk-app-microsoft-ldaprecordview div.oc div.content div.attr div.attrname {
+ float: left;
+ width: 30%;
+}
+
+.splunk-app-microsoft-ldaprecordview div.oc div.content div.attr div.attrval {
+ width: 70%;
+ white-space: nowrap;
+ display: inline-block;
+}
\ No newline at end of file
diff --git a/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/DA-ITSI-CP-windows-dashboards/components/ldaprecordview.js b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/DA-ITSI-CP-windows-dashboards/components/ldaprecordview.js
new file mode 100644
index 00000000..8ec1f492
--- /dev/null
+++ b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/DA-ITSI-CP-windows-dashboards/components/ldaprecordview.js
@@ -0,0 +1,5587 @@
+define(function(require, exports, module) {
+
+ require('/static/app/DA-ITSI-CP-windows-dashboards/js/common/contrib/jquery-3.5.0.min.js');
+ var SimpleSplunkView = require("splunkjs/mvc/simplesplunkview");
+ require("css!./ldaprecordview.css");
+
+ var LDAPRecordView = SimpleSplunkView.extend({
+
+ className: "splunk-app-microsoft-ldaprecordview",
+
+ output_mode: "json",
+
+ createView: function() {
+ return true;
+ },
+
+ formatData: function(data){
+ return data;
+ },
+
+ updateView: function(viz, data) {
+ if (data.length === 0) {
+ return;
+ }
+ // The LDAP Record is a single record, but the JSON response is always an array
+ // so just take the first one.
+ var ldapRecord = data[0];
+ if (!('objectClass' in ldapRecord)) {
+ return;
+ }
+
+ // We have a proper record, so let's reset the UI and get on to display
+ this.$el.empty();
+
+ var ocMap = {};
+ // For each object class, convert the name to the AD name, and add on
+ // any auxiliary classes
+ var ocList;
+ if (ldapRecord.objectClass instanceof Array) {
+ ocList = ldapRecord.objectClass;
+ } else {
+ ocList = [ ldapRecord.objectClass ];
+ }
+ for (var i = 0 ; i < ocList.length ; i++) {
+ if (ocList[i] in this.adLDAPClasses) {
+ var oc = this.adLDAPClasses[ocList[i]];
+ // Our AD Class is one
+ ocMap[oc] = 1;
+ // Add on any auxiliary classes
+ if ('classes' in this.adSchemaClasses[oc]) {
+ for (var j = 0 ; j < this.adSchemaClasses[oc].classes.length ; j++) {
+ ocMap[this.adSchemaClasses[oc].classes[j]] = 1;
+ }
+ }
+ }
+ }
+ // Convert back to an array
+ var ocArray = [];
+ for (var p in ocMap) {
+ ocArray.push(p);
+ }
+ var objectClasses = ocArray.sort(this.caseInsensitive);
+
+ // Each objectclass has it's own display mechanics as a panel. The panel is
+ // constructed as a pair of DIVs, one on top of the other, with a switcher on
+ // the side. We do "top" first, which is every single LDAP record
+ this.buildOC("Top", ldapRecord);
+ for (var ocidx = 0 ; ocidx < objectClasses.length ; ocidx++) {
+ if (objectClasses[ocidx] != "Top")
+ this.buildOC(objectClasses[ocidx], ldapRecord);
+ }
+ },
+
+ getData: function(){
+ return this.resultsModel.data().results;
+ },
+
+
+ // Builds the Object Class
+ buildOC: function(oc, ldapRecord) {
+ // MAIN BLOCK
+ var block = $('
'+oc+'
').appendTo(this.$el);
+ var title = $('div#'+oc+' > h3.title');
+ var content = $('div#'+oc+' > div.content');
+
+ // Now populate the content. There are three possibilities here:
+ // 1) We have a distinct method of rendering the object class
+ // 2) We know about the objectclass and it's attributes
+ // 3) We don't know about the objectclass
+ //
+ // 1) We have a distinct method of rendering the object class
+ // None of these yet
+
+ // 2) We know about the objectClass
+ if (oc in this.adSchemaClasses) {
+ this.buildKnownSchemaClass(oc, ldapRecord, content);
+ return;
+ }
+
+ // 3) We don't know about the objectClass
+ $('
Unknown Object Class - Add Knowledge to LDAPRecord
').appendTo(content);
+ return;
+ },
+
+ buildKnownSchemaClass: function(oc, ldapRecord, container) {
+ var attrs = this.adSchemaClasses[oc].attributes;
+
+ for (var i = 0 ; i < attrs.length ; i++) {
+ if (attrs[i] in this.adSchemaAttributes) {
+ var ldapAttr = this.adSchemaAttributes[attrs[i]];
+ if (ldapAttr in ldapRecord) {
+ var v = ldapRecord[ldapAttr];
+ if (ldapRecord[ldapAttr] instanceof Array) {
+ v = ldapRecord[ldapAttr].join(' ');
+ }
+ $('
';
+
+ if (!isFirstFieldInRow) {
+ eventDetails += '
';
+ }
+ // Display two fields per row - so alternate every time we add a field
+ isFirstFieldInRow = !isFirstFieldInRow;
+
+ // Concoct an event title
+ // If result field is certain special fields,
+ // display their values as title for the event,
+ // since there is no single field that
+ // can act as a real title
+ var potentialTitleFields = [
+ 'signature',
+ 'status',
+ 'LogName',
+ 'SourceName',
+ 'EventCode',
+ 'Cmdlet',
+ 'CmdletError',
+ 'Error'
+ ];
+
+ if (_.contains(potentialTitleFields,resultField) &&
+ !_.isUndefined(fieldDisplayValue) &&
+ !_.isNull(fieldDisplayValue) &&
+ fieldDisplayValue.length > 0) {
+ if (rowTitle.length > 0) {
+ rowTitle += ', ';
+ }
+ if (searchFields.length > 0) {
+ searchFields += ' AND ';
+ }
+ rowTitle += fieldDisplayName + ': ' + fieldDisplayValue;
+ searchFields += resultField + '%3D%22' + fieldDisplayValue + '%22';
+ }
+ }
+ });
+ eventDetails += '
';
+ // Apply the concocted title for the row
+ if (rowTitle.length < 1) {
+ rowTitle = 'Key event #' + _lastEventIndex;
+ }
+
+ $('#key-events-list li#' + eventElId).text(rowTitle);
+
+ var eventDetailsHtml = '
'
+ );
+ return this;
+ };
+
+ PageMessagesViewClass.clearMessage = function(messageId) {
+ $(this._messagesPaneSel).find('#' + messageId).remove();
+ return this;
+ };
+
+ PageMessagesViewClass.clearAllMessages = function() {
+ $(this._messagesPaneSel).hide();
+ $(this._messagesPaneSel).empty();
+ return this;
+ };
+
+ PageMessagesViewClass.InfoMessageType = 'alert-info';
+ PageMessagesViewClass.WarningMessageType = 'alert-warning';
+ PageMessagesViewClass.ErrorMessageType = 'alert-error';
+
+ return PageMessagesView;
+});
diff --git a/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/SearchDataHelpers.js b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/SearchDataHelpers.js
new file mode 100644
index 00000000..4bc6cec7
--- /dev/null
+++ b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/SearchDataHelpers.js
@@ -0,0 +1,85 @@
+/*
+ * This file contains helper methods that could be used in the app pages
+ * to manipulate data returned from searches
+ */
+
+define(['/static/app/DA-ITSI-CP-windows-dashboards/js/common/contrib/underscore.js', '/static/app/DA-ITSI-CP-windows-dashboards/js/common/contrib/jquery-3.5.0.min.js'], function(_) {
+ var SearchDataHelpers = {
+ /*
+ * Given a map of fields to html selectors (in fieldsToElSelsMap), search fields
+ * returned from running a search (in searchFields), a row returned in the result
+ * set of a search (in searchRow) and a html renderer function (in elRenderer) that
+ * does specific action to convert result from the search to the html selector
+ * specified element, this function extracts the values for the fields from the
+ * row and invokes the renderer resulting in the values from a search row
+ * being populated to different html elements
+ */
+ populateSearchBasedFields: function(fieldsToElSelsMap, searchFields, searchRow, elRenderer) {
+ _.each(searchFields, function(fieldName, index) {
+ var elSel = fieldsToElSelsMap[fieldName];
+ if (!_.isUndefined(elSel) && !_.isNull(elSel)) {
+ elRenderer(elSel, searchRow[index]);
+ }
+ });
+ },
+
+ /*
+ * This is a specialization of populateSearchBasedFields to specifically
+ * extract and display search results as sparklines in the html elements
+ */
+ populateSearchBasedSparklineFields: function(fieldsToSparklineSelsMap, searchFields, searchRow, sparklineSettings) {
+ this.populateSearchBasedFields(
+ fieldsToSparklineSelsMap,
+ searchFields,
+ searchRow,
+ function(sparklineSel, sparklineData) {
+ $(sparklineSel).empty();
+
+ var sparks = _.isArray(sparklineData) ?
+ _.map(sparklineData.slice(1), function(value) {
+ return (value && parseFloat(value)) || 0;
+ }) : [];
+
+ $(sparklineSel).sparkline(
+ sparks,
+ sparklineSettings
+ );
+ }
+ );
+ },
+
+ /*
+ * This is a specialization of populateSearchBasedFields to specifically
+ * extract and display search results as texts in the html elements
+ */
+ populateSearchBasedTextFields: function(fieldsToTextSelsMap, searchFields, searchRow) {
+ this.populateSearchBasedFields(
+ fieldsToTextSelsMap,
+ searchFields,
+ searchRow,
+ function(textSel, textValue) {
+ $(textSel).text(textValue);
+ }
+ );
+ },
+
+ makeDisplayNameFromResultField: function(resultFieldName) {
+ // Convert all _ in field name to spaces
+ // Capitalize first character of each word part
+ var nameParts = resultFieldName.replace('_', ' ').split(' ');
+
+ var displayNameParts = _.map(nameParts, function(namePart) {
+ if (/^[a-z]/.test(namePart)) {
+ var firstChar = namePart[0].toUpperCase();
+ return firstChar + namePart.substr(1);
+ } else {
+ return namePart;
+ }
+ });
+
+ return displayNameParts.join(' ');
+ }
+ }
+
+ return SearchDataHelpers;
+});
\ No newline at end of file
diff --git a/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/SearchRunner.js b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/SearchRunner.js
new file mode 100644
index 00000000..5990a562
--- /dev/null
+++ b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/SearchRunner.js
@@ -0,0 +1,150 @@
+/*
+ * The SearchRunner is a wrapper to run searches via the core search manager that
+ * encapsulates the event handlers to ensure search manager events are handled uniformly
+ */
+
+define([
+ 'common/Class',
+ '/static/app/DA-ITSI-CP-windows-dashboards/js/common/contrib/underscore.js'
+ ],
+ function(
+ Class,
+ _
+ ) {
+ var SearchRunner = function(
+ searchManager,
+ resultsModel,
+ failureCallback,
+ successCallback,
+ startCallback,
+ progressCallback
+ ) {
+ this.checkValidProperty(searchManager);
+ this.checkValidProperty(failureCallback);
+ this.checkValidProperty(successCallback);
+ this.checkValidProperty(startCallback);
+ this.checkValidProperty(progressCallback);
+
+ if (_.isUndefined(resultsModel) || _.isNull(resultsModel)) {
+ resultsModel = searchManager.data('preview', {
+ count: 0,
+ offset: 0
+ });
+ }
+
+ this.checkValidProperty(resultsModel);
+
+ this._searchManager = searchManager;
+ this._resultsModel = resultsModel;
+ this._failureCallback = failureCallback;
+ this._successCallback = successCallback;
+ this._startCallback = startCallback;
+ this._progressCallback = progressCallback;
+ }
+
+ var SearchRunnerClass = Class.makeClass(SearchRunner);
+
+ SearchRunnerClass.runSearch = function(deferRun) {
+ var that = this;
+
+ this._searchManager.on(
+ "search:cancelled",
+ function() {
+ that._failureCallback(
+ 'The search got cancelled.' +
+ ' Search string is: "' + that._searchManager.settings.get('search') + '"'
+ );
+ },
+ this
+ );
+
+ this._searchManager.on(
+ "search:error",
+ function(message, error) {
+ var errorMessage = 'The search returned error "' + message + '".';
+
+ if (!_.isUndefined(error) && !_.isNull(error)) {
+ errorMessage += 'Detailed error: "' + error.error +
+ '(' + error.status + ') - ' + error.data.messages[0].text + '"';
+ }
+
+ that._failureCallback(
+ errorMessage + ' Search string is: "' + that._searchManager.settings.get('search') + '"'
+ );
+ },
+ this
+ );
+
+ this._searchManager.on(
+ "search:fail",
+ function(state, job) {
+ that._failureCallback(
+ 'The search failed with error "' + state.content.messages[0].text + '".' +
+ ' Search string is: "' + that._searchManager.settings.get('search') + '"'
+ );
+ },
+ this
+ );
+
+ this._searchManager.on(
+ "search:start",
+ function() {
+ that._startCallback();
+ },
+ this
+ );
+
+ this._searchManager.on(
+ "search:progress",
+ function(properties) {
+ that._progressCallback(properties.content.isDone, properties);
+ },
+ this
+ );
+
+ this._searchManager.on(
+ "search:done",
+ function(properties) {
+ that._progressCallback(properties.content.isDone, properties);
+ },
+ this
+ );
+
+ this._resultsModel.on(
+ "error",
+ function(message, error) {
+ var errorMessage = 'The search returned error "' + message + '".';
+
+ if (!_.isUndefined(error) && !_.isNull(error)) {
+ errorMessage += 'Detailed error: "' + error.error +
+ '(' + error.status + ') - ' + error.data.messages[0].text + '"';
+ }
+
+ that._failureCallback(
+ errorMessage + ' Search string is: "' + that._searchManager.settings.get('search') + '"'
+ );
+ },
+ this
+ );
+
+ this._resultsModel.on(
+ "data",
+ function() {
+ that._successCallback(this._resultsModel.data());
+ },
+ this
+ );
+
+ if (_.isUndefined(deferRun) || _.isNull(deferRun) || deferRun === true) {
+ this._searchManager.startSearch();
+ }
+ }
+
+ SearchRunnerClass.checkValidProperty = function(property) {
+ if (_.isUndefined(property) || _.isNull(property)) {
+ throw property + ' is invalid';
+ }
+ }
+
+ return SearchRunner;
+});
\ No newline at end of file
diff --git a/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/SyncTaskQueue.js b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/SyncTaskQueue.js
new file mode 100644
index 00000000..e67989fd
--- /dev/null
+++ b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/SyncTaskQueue.js
@@ -0,0 +1,66 @@
+/*
+ * The SyncTaskQueue is a task serializer queue to enable queueing tasks to be run
+ * synchronously.
+ */
+
+define([
+ 'common/Class',
+ 'common/SyncTaskRunner',
+ '/static/app/DA-ITSI-CP-windows-dashboards/js/common/contrib/underscore.js'
+ ],
+ function(
+ Class,
+ SyncTaskRunner,
+ _
+ ) {
+ var SyncTaskQueue = function() {
+ var that = this;
+
+ this._taskQueue = [];
+ this._currentTask = null;
+
+ this._waitHandle = setInterval(
+ function() {
+ if (
+ (_.isNull(that._currentTask) || that._currentTask.hasCompleted()) &&
+ that._taskQueue.length > 0
+ ) {
+ that._currentTask = that._taskQueue.shift();
+ that._currentTask.start();
+ }
+ },
+ 200
+ );
+ }
+
+ var SyncTaskQueueClass = Class.makeClass(SyncTaskQueue);
+
+ /*
+ * taskLabel - a label for the task to enqueue
+ * taskFn - the function to execute for the task
+ * the signature for the function is:
+ * function(taskRunner, )
+ * taskFnArgs - array of arguments to the task. Note that this array will
+ * not contain the taskRunner but the rest of the arguments
+ * specific to the function
+ * timeout - optional timeout for the task in ms
+ * timeoutFn - a timeout handler with the signature
+ * function()
+ * timeoutFnArgs - array of arguments to the timeout handler
+ */
+ SyncTaskQueueClass.enqueue = function(
+ taskLabel,
+ taskFn,
+ taskFnArgs,
+ timeout,
+ timeoutFn,
+ timeoutFnArgs
+ ) {
+ this._taskQueue.push(
+ new SyncTaskRunner(taskLabel, taskFn, taskFnArgs, timeout, timeoutFn, timeoutFnArgs)
+ );
+ }
+
+ return SyncTaskQueue;
+});
+
\ No newline at end of file
diff --git a/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/SyncTaskRunner.js b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/SyncTaskRunner.js
new file mode 100644
index 00000000..56192f8a
--- /dev/null
+++ b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/SyncTaskRunner.js
@@ -0,0 +1,114 @@
+/*
+ * The SyncTaskRunner is a task serializer to enable running tasks synchronously.
+ * It takes as input a function to run a task, executes it and waits for completion.
+ * The SyncTaskRunner defines a markCompleted function to call back into to indicate
+ * task completion.
+ */
+
+define([
+ 'common/Class',
+ '/static/app/DA-ITSI-CP-windows-dashboards/js/common/contrib/underscore.js'
+ ],
+ function(
+ Class,
+ _
+ ) {
+ /*
+ * taskLabel - a label for the task to enqueue
+ * taskFn - the function to execute for the task
+ * the signature for the function is:
+ * function(taskRunner, )
+ * taskFnArgs - array of arguments to the task. Note that this array will
+ * not contain the taskRunner but the rest of the arguments
+ * specific to the function
+ * timeout - optional timeout for the task in ms
+ * timeoutFn - a timeout handler with the signature
+ * function()
+ * timeoutFnArgs - array of arguments to the timeout handler
+ */
+ var SyncTaskRunner = function(
+ taskLabel,
+ taskFn,
+ taskFnArgs,
+ timeout /* in ms */,
+ timeoutFn,
+ timeoutFnArgs
+ ) {
+ this._taskCompleted = false;
+
+ if (_.isUndefined(taskFn) || _.isNull(taskFn) || !_.isFunction(taskFn)) {
+ throw('Invalid task passed to SyncTaskRunner');
+ } else {
+ this._taskFn = taskFn;
+
+ this._taskFnArgs = taskFnArgs;
+ // First argument to the function is the runner so it could invoke markCompleted
+ this._taskFnArgs.unshift(this);
+
+ this._taskLabel = taskLabel;
+ }
+
+ if (_.isUndefined(timeout) || _.isNull(timeout)) {
+ this._timeout = 600000; // 10 minutes in ms
+ } else {
+ if (_.isNumber(timeout)) {
+ this._timeout = timeout;
+ } else {
+ throw('Invalid timeout passed to SyncTaskRunner. Please specify a number in ms');
+ }
+ }
+
+ if (_.isUndefined(timeoutFn) || _.isNull(timeoutFn) || !_.isFunction(timeoutFn)) {
+ throw('Invalid timeout handler passed to SyncTaskRunner');
+ } else {
+ this._timeoutFn = timeoutFn;
+ this._timeoutFnArgs = timeoutFnArgs;
+ }
+
+ this._waitHandle = null;
+ }
+
+ var SyncTaskRunnerClass = Class.makeClass(SyncTaskRunner);
+
+ SyncTaskRunnerClass.start = function() {
+ var that = this;
+
+ if (this._taskCompleted) {
+ throw('The task ' + this._taskLabel + ' has already completed');
+ }
+
+ this._taskFn.apply(this, this._taskFnArgs);
+
+ this._waitHandle = setInterval(
+ function() {
+ if (that._taskCompleted) {
+ clearInterval(that._waitHandle);
+ }
+ },
+ 200
+ );
+
+ this._timeoutHandle = setTimeout(
+ function() {
+ that.markCompleted();
+ that._timeoutFn.apply(that, that._timeoutFnArgs);
+ },
+ this._timeout
+ );
+ }
+
+ /*
+ * This function MUST be called by the task when done otherwise the task will timeout.
+ */
+ SyncTaskRunnerClass.markCompleted = function() {
+ this._taskCompleted = true;
+ clearTimeout(this._timeoutHandle);
+ }
+
+ SyncTaskRunnerClass.hasCompleted = function() {
+ return this._taskCompleted;
+ }
+
+ return SyncTaskRunner;
+});
+
\ No newline at end of file
diff --git a/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/contrib/bootstrap.min.css b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/contrib/bootstrap.min.css
new file mode 100644
index 00000000..e1643d7b
--- /dev/null
+++ b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/contrib/bootstrap.min.css
@@ -0,0 +1 @@
+article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%}a:active,a:hover{outline:0}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{max-width:100%;height:auto;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img,.google-maps img{max-width:none}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle}button,input{line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button,input[type=button],input[type=checkbox],input[type=radio],input[type=reset],input[type=submit],label,select{cursor:pointer}input[type=search]{-webkit-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}textarea{overflow:auto;vertical-align:top}@media print{*{text-shadow:none!important;color:#000!important;background:transparent!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}}body{margin:0;background:#f2f4f5;color:#3c444d;min-width:960px;font-family:Splunk Platform Sans,Proxima Nova,Roboto,Droid,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:14px;font-weight:400;line-height:20px;-webkit-transition:margin .2s;transition:margin .2s}body.open{margin-left:300px;margin-right:-300px}.shared-page{height:100vh;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}a{text-decoration:none;cursor:pointer}a,a:hover{color:#006eaa}a:hover{text-decoration:underline}a:focus{-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0}a:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}a:focus{text-decoration:none}a:active{-webkit-box-shadow:none;box-shadow:none}a.disabled{color:#6b7785}a.external:after{font-family:Splunk Icons;content:"\EC13";display:inline-block;padding-left:.5em}.img-rounded{border-radius:3px}.img-polaroid{padding:4px;background-color:#fff;border:1px solid #c3cbd4;border:1px solid rgba(0,0,0,.2);-webkit-box-shadow:0 1px 3px rgba(0,0,0,.1);box-shadow:0 1px 3px rgba(0,0,0,.1)}.img-circle{border-radius:500px}.section-padded{padding:20px}.section-header{position:relative}.section-header .section-title{margin-top:0;font-size:24px;font-weight:500;line-height:24px}.section-header.page-heading{padding:20px 20px 10px}.main-section-body{color:#3c444d;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.main-section-body,.main-section-body>:first-child{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.main-section-body h2 i[class*=" icon-"],.main-section-body h2 i[class^=icon-]{color:#6b7785}.main-section-body .divider{border-top:1px solid #c3cbd4;margin:0}.main-section-body>.pull-right{margin-right:20px}.main-section-body .loading-message{padding-top:100px;min-height:400px;text-align:center}.main-section-body .main-section{padding:0 20px}.main-section-body .card{background-color:#fff;-webkit-box-shadow:0 1px 1px #e1e6eb;box-shadow:0 1px 1px #e1e6eb}.container-full-width{padding:0}.push-margins{margin-left:-20px;margin-right:-20px}.hide-text{text-indent:100%;white-space:nowrap;overflow:hidden}.panel{position:relative;border:1px solid #c3cbd4;background-color:#fff;padding:20px;margin-right:20px;border-radius:2px}.panel:last-child{margin-right:0}.panel-row{padding:0 20px;margin-bottom:20px}.section-content{background-color:#fff;min-height:400px;border-top:1px solid #c3cbd4}.column{position:relative;padding:20px;margin-right:20px}.navSkip{position:absolute;margin:1px 0 0 10px;top:0;left:-1000px;width:150px;height:32px;text-align:center;line-height:32px;background-color:#171d21;color:#c3cbd4;z-index:1040}.navSkip:focus{left:0}.shared-paywall{padding-top:30px}.list-dotted{line-height:20px;margin-top:0}.list-dotted dt{float:left;width:120px;overflow:hidden;white-space:nowrap;margin-right:5px;font-weight:400;line-height:20px;word-wrap:normal}.list-dotted dt:after{content:" ............................................"}.list-dotted dd{line-height:20px;margin-left:125px}#placeholder-splunk-bar{padding:0;background-color:#171d21;text-rendering:geometricPrecision}#placeholder-splunk-bar .brand,#placeholder-splunk-bar .brand:hover{font-family:Splunk Icons;font-weight:400;color:#fff;padding:0 20px;height:34px;font-size:18px;line-height:34px;text-shadow:none;text-decoration:none;text-rendering:geometricPrecision;margin-left:0}#placeholder-splunk-bar .brand strong{color:#818d99;font-weight:400}#placeholder-splunk-bar .brand strong:after{content:"\AE";color:#818d99;font-weight:400}#placeholder-app-bar{color:#fff;background-color:#3c444d;height:44px}#placeholder-main-section-body{color:#3c444d;padding-top:100px;min-height:400px;text-align:center}@media print{.main-section-body,body{background:none!important}@page{margin:1.27cm}.navSkip{display:none!important}}.span1{width:60px}.span1,.span2{float:left;min-height:1px;margin-left:20px}.span2{width:140px}.span3{width:220px}.span3,.span4{float:left;min-height:1px;margin-left:20px}.span4{width:300px}.span5{width:380px}.span5,.span6{float:left;min-height:1px;margin-left:20px}.span6{width:460px}.span7{width:540px}.span7,.span8{float:left;min-height:1px;margin-left:20px}.span8{width:620px}.span9{width:700px}.span9,.span10{float:left;min-height:1px;margin-left:20px}.span10{width:780px}.span11{width:860px}.span11,.span12{float:left;min-height:1px;margin-left:20px}.span12{width:940px}.offset1{margin-left:100px}.offset2{margin-left:180px}.offset3{margin-left:260px}.offset4{margin-left:340px}.offset5{margin-left:420px}.offset6{margin-left:500px}.offset7{margin-left:580px}.offset8{margin-left:660px}.offset9{margin-left:740px}.offset10{margin-left:820px}.offset11{margin-left:900px}.offset12{margin-left:980px}.row{margin-left:-20px}.row:after,.row:before{display:table;content:"";line-height:0}.row:after{clear:both}.container,.navbar-fixed-bottom .container,.navbar-fixed-top .container,.navbar-static-top .container{width:940px}.row-fluid{width:100%}.row-fluid:after,.row-fluid:before{display:table;content:"";line-height:0}.row-fluid:after{clear:both}.row-fluid .span1{display:block;width:100%;min-height:32px;-webkit-box-sizing:border-box;box-sizing:border-box;width:6.38298%;float:left;margin-left:2.127659574%}.row-fluid .span1:first-child{margin-left:0}.row-fluid .span2{display:block;width:100%;min-height:32px;-webkit-box-sizing:border-box;box-sizing:border-box;width:14.89362%;float:left;margin-left:2.127659574%}.row-fluid .span2:first-child{margin-left:0}.row-fluid .span3{display:block;width:100%;min-height:32px;-webkit-box-sizing:border-box;box-sizing:border-box;width:23.40426%;float:left;margin-left:2.127659574%}.row-fluid .span3:first-child{margin-left:0}.row-fluid .span4{display:block;width:100%;min-height:32px;-webkit-box-sizing:border-box;box-sizing:border-box;width:31.91489%;float:left;margin-left:2.127659574%}.row-fluid .span4:first-child{margin-left:0}.row-fluid .span5{display:block;width:100%;min-height:32px;-webkit-box-sizing:border-box;box-sizing:border-box;width:40.42553%;float:left;margin-left:2.127659574%}.row-fluid .span5:first-child{margin-left:0}.row-fluid .span6{display:block;width:100%;min-height:32px;-webkit-box-sizing:border-box;box-sizing:border-box;width:48.93617%;float:left;margin-left:2.127659574%}.row-fluid .span6:first-child{margin-left:0}.row-fluid .span7{display:block;width:100%;min-height:32px;-webkit-box-sizing:border-box;box-sizing:border-box;width:57.44681%;float:left;margin-left:2.127659574%}.row-fluid .span7:first-child{margin-left:0}.row-fluid .span8{display:block;width:100%;min-height:32px;-webkit-box-sizing:border-box;box-sizing:border-box;width:65.95745%;float:left;margin-left:2.127659574%}.row-fluid .span8:first-child{margin-left:0}.row-fluid .span9{display:block;width:100%;min-height:32px;-webkit-box-sizing:border-box;box-sizing:border-box;width:74.46809%;float:left;margin-left:2.127659574%}.row-fluid .span9:first-child{margin-left:0}.row-fluid .span10{display:block;width:100%;min-height:32px;-webkit-box-sizing:border-box;box-sizing:border-box;width:82.97873%;float:left;margin-left:2.127659574%}.row-fluid .span10:first-child{margin-left:0}.row-fluid .span11{display:block;width:100%;min-height:32px;-webkit-box-sizing:border-box;box-sizing:border-box;width:91.48937%;float:left;margin-left:2.127659574%}.row-fluid .span11:first-child{margin-left:0}.row-fluid .span12{display:block;min-height:32px;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;float:left;margin-left:2.127659574%}.row-fluid .span12:first-child{margin-left:0}.row-fluid .offset1{margin-left:10.6383%}.row-fluid .offset2{margin-left:19.14894%}.row-fluid .offset3{margin-left:27.65958%}.row-fluid .offset4{margin-left:36.17021%}.row-fluid .offset5{margin-left:44.68085%}.row-fluid .offset6{margin-left:53.19149%}.row-fluid .offset7{margin-left:61.70213%}.row-fluid .offset8{margin-left:70.21277%}.row-fluid .offset9{margin-left:78.72341%}.row-fluid .offset10{margin-left:87.23405%}.row-fluid .offset11{margin-left:95.74469%}.row-fluid .offset12{margin-left:104.25532%}.row-fluid .controls-row [class*=span]+[class*=span]{margin-left:2.127659574%}.row-fluid [class*=span].hide,[class*=span].hide{display:none}.row-fluid [class*=span].pull-right,[class*=span].pull-right{float:right}.container{margin-right:auto;margin-left:auto}.container:after,.container:before{display:table;content:"";line-height:0}.container:after{clear:both}.container-fluid{padding-right:20px;padding-left:20px}.container-fluid:after,.container-fluid:before{display:table;content:"";line-height:0}.container-fluid:after{clear:both}@font-face{font-family:Splunk Platform Sans;src:url(/en-US/static/@000.148/fonts/proxima-bold-webfont.woff) format("woff");font-weight:700;font-style:normal}@font-face{font-family:Splunk Platform Sans;src:url(/en-US/static/@000.148/fonts/proxima-regular-webfont.woff) format("woff");font-weight:400;font-style:normal}@font-face{font-family:Splunk Platform Sans;src:url(/en-US/static/@000.148/fonts/proxima-semibold-webfont.woff) format("woff");font-weight:500;font-style:normal}@font-face{font-family:Splunk Platform Mono;src:url(/en-US/static/@000.148/fonts/inconsolata-regular.woff) format("woff");font-weight:400;font-style:normal}@font-face{font-family:Splunk Icons;src:url(/en-US/static/@000.148/fonts/splunkicons-regular-webfont.woff) format("woff");font-weight:400;font-style:normal}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:21px;font-weight:200;line-height:30px}small{font-size:85%}strong{font-weight:700}em{font-style:italic}cite{font-style:normal}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.muted{color:#6b7785}a.muted:focus,a.muted:hover{color:#545e69}.text-warning{color:#f8be34}a.text-warning:focus,a.text-warning:hover{color:#f1ab09}.text-error{color:#dc4e41}a.text-error:focus,a.text-error:hover{color:#c63224}.text-info{color:#006d9c}a.text-info:focus,a.text-info:hover{color:#004b6b}.text-success{color:#53a051}a.text-success:focus,a.text-success:hover{color:#417d3f}.mono-space{font-family:Splunk Platform Mono,Inconsolata,Consolas,Droid Sans Mono,Monaco,Courier New,Courier,monospace}h1{margin:10px 0;font-size:24px;font-family:inherit;font-weight:500;line-height:20px;text-transform:none;color:#3c444d;text-rendering:optimizelegibility}h1 small{font-size:21.6px}h2{margin:10px 0;font-size:18px;font-family:inherit;font-weight:500;line-height:20px;text-transform:none;color:#3c444d;text-rendering:optimizelegibility}h2 small{font-size:16.2px}h3{margin:10px 0;font-size:16px;font-family:inherit;font-weight:500;line-height:20px;text-transform:none;color:#3c444d;text-rendering:optimizelegibility}h3 small{font-size:14px}h4{font-size:14px}h4,h5{margin:10px 0;font-family:inherit;font-weight:500;line-height:20px;text-transform:none;color:#3c444d;text-rendering:optimizelegibility}h5{font-size:18px;font-size:12px}h6{margin:10px 0;font-size:18px;text-transform:none;color:#3c444d;font-size:11px}.section-heading,h6{font-family:inherit;font-weight:500;line-height:20px;text-rendering:optimizelegibility}.section-heading{font-size:14px}.section-heading,.section-heading-small{margin:5px 0;text-transform:uppercase;color:#5c6773}.section-heading-small{font-size:12px;font-family:inherit;font-weight:500;line-height:20px;text-rendering:optimizelegibility}.page-header{padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #e1e6eb}ol,ul{padding:0;margin:0 0 10px 25px}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}ol.inline,ol.unstyled,ul.inline,ul.unstyled{margin-left:0;list-style:none}ol.inline>li,ul.inline>li{display:inline-block;padding-left:5px;padding-right:5px}li{line-height:20px}dl{margin-bottom:20px}dd,dt{line-height:20px}dt{font-weight:700}dd{margin-left:10px}.dl-horizontal:after,.dl-horizontal:before{display:table;content:"";line-height:0}.dl-horizontal:after{clear:both}.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}hr{margin:20px 0;border:0;border-top:1px solid #e1e6eb;border-bottom:1px solid #fff}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #818d99}abbr.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #e1e6eb}blockquote p{margin-bottom:0;font-size:17.5px;font-weight:300;line-height:1.25}blockquote small{display:block;line-height:20px;color:#818d99}blockquote small:before{content:"\2014 \A0"}blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #e1e6eb;border-left:0}blockquote.pull-right p,blockquote.pull-right small{text-align:right}blockquote.pull-right small:before{content:""}blockquote.pull-right small:after{content:"\A0 \2014"}blockquote:after,blockquote:before,q:after,q:before{content:""}address{display:block;margin-bottom:20px;font-style:normal;line-height:20px}code,pre{font-family:Splunk Platform Mono,Inconsolata,Consolas,Droid Sans Mono,Monaco,Courier New,Courier,monospace;border-radius:3px}code{padding:2px 4px;color:#d14;background-color:#f7f7f9;border:1px solid #e1e1e8;white-space:nowrap;font-size:12px}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;color:#3c444d;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid rgba(0,0,0,.15)}pre.prettyprint{margin-bottom:20px}pre code{padding:0;color:inherit;white-space:pre;white-space:pre-wrap;background-color:transparent;border:0}.pre-scrollable{max-height:340px;overflow-y:scroll}form,form:last-child{margin:0 0 20px}fieldset{margin:0}fieldset,legend{padding:0;border:0}legend{display:block;width:100%;margin-bottom:20px;font-size:15px;line-height:40px;color:#3c444d;border-bottom:1px solid #e5e5e5}legend small{font-size:15px;color:#818d99}button,input,label,select,textarea{font-size:14px;font-weight:400;line-height:20px}button,input,select,textarea{font-family:Splunk Platform Sans,Proxima Nova,Roboto,Droid,Helvetica Neue,Helvetica,Arial,sans-serif}label{display:block;margin-bottom:5px;cursor:default}.uneditable-input,input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week],select,textarea{display:inline-block;padding:5px 8px;height:32px;line-height:20px;font-size:14px;-webkit-box-sizing:border-box;box-sizing:border-box;margin-bottom:10px;color:#5c6773;border-radius:3px;vertical-align:middle}.uneditable-input,input,textarea{width:206px;-webkit-box-sizing:border-box;box-sizing:border-box}textarea{height:auto}.uneditable-input,input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week],textarea{background-color:#fff;border:1px solid #c3cbd4;-webkit-transition:border .2s,-webkit-box-shadow .2s;transition:border .2s,-webkit-box-shadow .2s;transition:border .2s,box-shadow .2s;transition:border .2s,box-shadow .2s,-webkit-box-shadow .2s}.uneditable-input:focus,input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus,textarea:focus{-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0;text-decoration:none}.uneditable-input:focus:active:not([disabled]),input[type=color]:focus:active:not([disabled]),input[type=date]:focus:active:not([disabled]),input[type=datetime-local]:focus:active:not([disabled]),input[type=datetime]:focus:active:not([disabled]),input[type=email]:focus:active:not([disabled]),input[type=month]:focus:active:not([disabled]),input[type=number]:focus:active:not([disabled]),input[type=password]:focus:active:not([disabled]),input[type=search]:focus:active:not([disabled]),input[type=tel]:focus:active:not([disabled]),input[type=text]:focus:active:not([disabled]),input[type=time]:focus:active:not([disabled]),input[type=url]:focus:active:not([disabled]),input[type=week]:focus:active:not([disabled]),textarea:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.uneditable-input:focus,input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus,textarea:focus{z-index:3}.uneditable-input.text-clear,input[type=color].text-clear,input[type=date].text-clear,input[type=datetime-local].text-clear,input[type=datetime].text-clear,input[type=email].text-clear,input[type=month].text-clear,input[type=number].text-clear,input[type=password].text-clear,input[type=search].text-clear,input[type=tel].text-clear,input[type=text].text-clear,input[type=time].text-clear,input[type=url].text-clear,input[type=week].text-clear,textarea.text-clear{padding-right:28px}.uneditable-input.text-clear::-ms-clear,input[type=color].text-clear::-ms-clear,input[type=date].text-clear::-ms-clear,input[type=datetime-local].text-clear::-ms-clear,input[type=datetime].text-clear::-ms-clear,input[type=email].text-clear::-ms-clear,input[type=month].text-clear::-ms-clear,input[type=number].text-clear::-ms-clear,input[type=password].text-clear::-ms-clear,input[type=search].text-clear::-ms-clear,input[type=tel].text-clear::-ms-clear,input[type=text].text-clear::-ms-clear,input[type=time].text-clear::-ms-clear,input[type=url].text-clear::-ms-clear,input[type=week].text-clear::-ms-clear,textarea.text-clear::-ms-clear{display:none;width:0;height:0}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}input[type=button],input[type=checkbox],input[type=file],input[type=image],input[type=radio],input[type=reset],input[type=submit]{width:auto}input[type=file],select{height:32px;line-height:32px}select{width:220px;border:1px solid #c3cbd4;background-color:#fff}select[multiple],select[size]{height:auto}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus,select:focus{-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0;text-decoration:none}input[type=checkbox]:focus:active:not([disabled]),input[type=file]:focus:active:not([disabled]),input[type=radio]:focus:active:not([disabled]),select:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}input[type=radio]:focus{border-radius:100%}.uneditable-input,.uneditable-textarea{color:#c3cbd4;background-color:#f7f8fa;border-color:#e1e6eb;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.025);box-shadow:inset 0 1px 2px rgba(0,0,0,.025);cursor:not-allowed}.uneditable-input{overflow:hidden;white-space:nowrap}.uneditable-textarea{width:auto;height:auto}textarea{min-height:2em;resize:vertical}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#6b7785;opacity:1}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#6b7785;opacity:1}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:#6b7785;opacity:1}input::placeholder,textarea::placeholder{color:#6b7785;opacity:1}.checkbox,.radio{min-height:20px;padding-left:20px}.checkbox input[type=checkbox],.radio input[type=radio]{float:left;margin-left:-20px}.radio input[type=radio]{border-radius:100%}.controls>.checkbox:first-child,.controls>.radio:first-child{padding-top:5px}.checkbox.inline,.radio.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle}.checkbox.inline+.checkbox.inline,.radio.inline+.radio.inline{margin-left:10px}input[disabled],input[readonly],select[disabled],select[readonly],textarea[disabled],textarea[readonly]{cursor:not-allowed;background-color:#f7f8fa;border-color:#e1e6eb;color:#c3cbd4}input[type=checkbox][disabled],input[type=checkbox][readonly],input[type=radio][disabled],input[type=radio][readonly]{background-color:#f7f8fa}.control-group.warning .checkbox,.control-group.warning .control-label,.control-group.warning .help-block,.control-group.warning .help-inline,.control-group.warning .radio{color:#f8be34}.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#f8be34;border-color:#f8be34;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0;text-decoration:none}.control-group.warning input:focus:active:not([disabled]),.control-group.warning select:focus:active:not([disabled]),.control-group.warning textarea:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{z-index:3}.control-group.warning .input-append .add-on,.control-group.warning .input-prepend .add-on{color:#f8be34;background-color:#fef2d7;border-color:#f8be34}.control-group.error .checkbox,.control-group.error .control-label,.control-group.error .help-block,.control-group.error .help-inline,.control-group.error .radio{color:#dc4e41}.control-group.error input,.control-group.error select,.control-group.error textarea{color:#dc4e41;border-color:#dc4e41;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0;text-decoration:none}.control-group.error input:focus:active:not([disabled]),.control-group.error select:focus:active:not([disabled]),.control-group.error textarea:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{z-index:3}.control-group.error .input-append .add-on,.control-group.error .input-prepend .add-on{color:#dc4e41;background-color:#f8dcd9;border-color:#dc4e41}.control-group.success .checkbox,.control-group.success .control-label,.control-group.success .help-block,.control-group.success .help-inline,.control-group.success .radio{color:#53a051}.control-group.success input,.control-group.success select,.control-group.success textarea{color:#53a051;border-color:#53a051;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0;text-decoration:none}.control-group.success input:focus:active:not([disabled]),.control-group.success select:focus:active:not([disabled]),.control-group.success textarea:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{z-index:3}.control-group.success .input-append .add-on,.control-group.success .input-prepend .add-on{color:#53a051;background-color:#ddecdd;border-color:#53a051}.control-group.info .checkbox,.control-group.info .control-label,.control-group.info .help-block,.control-group.info .help-inline,.control-group.info .radio{color:#006d9c}.control-group.info input,.control-group.info select,.control-group.info textarea{color:#006d9c;border-color:#006d9c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.control-group.info input:focus,.control-group.info select:focus,.control-group.info textarea:focus{-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0;text-decoration:none}.control-group.info input:focus:active:not([disabled]),.control-group.info select:focus:active:not([disabled]),.control-group.info textarea:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.control-group.info input:focus,.control-group.info select:focus,.control-group.info textarea:focus{z-index:3}.control-group.info .input-append .add-on,.control-group.info .input-prepend .add-on{color:#006d9c;background-color:#cce2eb;border-color:#006d9c}input:focus:invalid,select:focus:invalid,textarea:focus:invalid{color:#b94a48;border-color:#ee5f5b}input:focus:invalid:focus,select:focus:invalid:focus,textarea:focus:invalid:focus{border-color:#e9352f;-webkit-box-shadow:0 0 6px #f8bcba;box-shadow:0 0 6px #f8bcba}.form-actions{padding:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f7f8fa;border-top:1px solid #e5e5e5}.form-actions:after,.form-actions:before{display:table;content:"";line-height:0}.form-actions:after{clear:both}.help-block,.help-inline{color:#6b7785}.help-block>.help-link,.help-block>.learn-more-link,.help-inline>.help-link,.help-inline>.learn-more-link{white-space:nowrap}.help-block{display:block;margin-top:3px;margin-bottom:10px;line-height:1.4em;font-size:12px;word-wrap:break-word}.help-inline{display:inline-block;vertical-align:middle;padding-left:5px}input.search-query{margin-bottom:0;-webkit-transition:background-color .2s;transition:background-color .2s}.form-horizontal .uneditable-input,.form-horizontal input,.form-horizontal select,.form-horizontal textarea,.form-inline .uneditable-input,.form-inline input,.form-inline select,.form-inline textarea,.form-search .uneditable-input,.form-search input,.form-search select,.form-search textarea{display:inline-block;margin-bottom:0;vertical-align:middle}.form-horizontal .hide,.form-inline .hide,.form-search .hide{display:none}.form-inline .btn-group,.form-inline label,.form-search .btn-group,.form-search label{display:inline-block}.form-inline .checkbox,.form-inline .radio,.form-search .checkbox,.form-search .radio{padding-left:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio],.form-search .checkbox input[type=checkbox],.form-search .radio input[type=radio]{float:left;margin-right:3px;margin-left:0}.control-group{margin-bottom:10px;position:relative}.control-group.disabled .control-label{color:#c3cbd4;cursor:default}.control-group .tooltip-link{top:-.5em;position:relative;font-size:75%;line-height:0;vertical-align:baseline;margin:0 2px;padding:2px;cursor:default;font-weight:400}legend:not(.visuallyhidden)+.control-group{margin-top:20px;-webkit-margin-top-collapse:separate}.form-horizontal{width:600px;max-width:100%}.form-horizontal .control-group{margin-bottom:10px}.form-horizontal .control-group:after,.form-horizontal .control-group:before{display:table;content:"";line-height:0}.form-horizontal .control-group:after{clear:both}.form-horizontal .control-label{float:left;width:160px;padding-top:5px;text-align:right}.form-horizontal .controls{margin-left:180px}.form-horizontal .controls>.help-block{margin-left:0}.form-horizontal .help-block{margin-bottom:0;margin-left:180px}.form-horizontal .uneditable-input+.help-block,.form-horizontal input+.help-block,.form-horizontal select+.help-block,.form-horizontal textarea+.help-block{margin-top:10px}.form-horizontal .form-actions{padding-left:180px}.form-inline label{line-height:28px}.form-inline .form-value{line-height:28px;margin-right:15px}.form-inline input{width:auto;margin-right:15px}.controls .shared-controls-booleanradiocontrol,.controls .shared-controls-syntheticradiocontrol{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%}.controls .shared-controls-booleanradiocontrol>.btn,.controls .shared-controls-syntheticradiocontrol>.btn{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto}.controls-join{display:-webkit-box;display:-ms-flexbox;display:flex}.controls-join .control:not(:only-child){-webkit-box-flex:1;-ms-flex:1 0 0px;flex:1 0 0px;max-width:100%}.controls-join .control:only-child{width:100%}.controls-join .shared-controls-textcontrol{-webkit-box-flex:0;-ms-flex:0 1 100%;flex:0 1 100%;min-width:30%}.controls-join .control:nth-last-child(n+3)~.shared-controls-textcontrol,.controls-join .shared-controls-textcontrol:nth-last-child(n+3){min-width:48px}.controls-join .shared-controls-syntheticselectcontrol:not(:last-child) .btn,.controls-join .shared-controls-textcontrol:not(:last-child) .uneditable-input,.controls-join .shared-controls-textcontrol:not(:last-child) input{border-top-right-radius:0;border-bottom-right-radius:0}.controls-join .shared-controls-syntheticselectcontrol:not(:first-child) .btn,.controls-join .shared-controls-textcontrol:not(:first-child) .uneditable-input,.controls-join .shared-controls-textcontrol:not(:first-child) input{border-top-left-radius:0;border-bottom-left-radius:0;border-left:none}.controls-join .shared-controls-syntheticselectcontrol .btn,.controls-join .uneditable-input,.controls-join input,.controls-join select,.controls-join textarea{width:100%}.controls-join input[type=button],.controls-join input[type=checkbox],.controls-join input[type=file],.controls-join input[type=image],.controls-join input[type=radio],.controls-join input[type=reset],.controls-join input[type=submit]{width:auto}.controls-wrap{-ms-flex-wrap:wrap;flex-wrap:wrap}.controls-separate,.controls-wrap{display:-webkit-box;display:-ms-flexbox;display:flex}.controls-separate .control+.control{margin-left:10px}.controls-stack{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.control{position:relative}.control .placeholder{color:#6b7785;position:absolute;max-width:100%;top:3px;left:6px;font-size:14px}.control ::-webkit-input-placeholder{color:#6b7785;opacity:1}.control :-ms-input-placeholder{color:#6b7785;opacity:1}.control ::-ms-input-placeholder{color:#6b7785;opacity:1}.control ::placeholder{color:#6b7785;opacity:1}.control .uneditable-input{background-color:#f7f8fa;min-height:32px}.control .uneditable-input.uneditable-input-multiline{overflow-y:auto;white-space:normal;white-space:pre-wrap;word-break:break-all;word-break:break-word;height:auto;max-height:100px}.control.shared-controls-textcontrol .control-clear,.control.shared-controls-textcontrol .search-icon{position:absolute;top:calc(50% + 1px);-webkit-transform:translateY(-50%);transform:translateY(-50%);right:10px;font-size:18px;color:#6b7785}.control.shared-controls-textcontrol .control-clear{display:none}.control.shared-controls-textcontrol>input{width:100%}.control.shared-controls-spinnercontrol{text-align:center}.control.shared-controls-spinnercontrol .uneditable-input,.control.shared-controls-spinnercontrol input{display:block;padding:4px 65px 4px 6px;-webkit-transition:border .2s,-webkit-box-shadow .2s;transition:border .2s,-webkit-box-shadow .2s;transition:border .2s,box-shadow .2s;transition:border .2s,box-shadow .2s,-webkit-box-shadow .2s}.control.shared-controls-spinnercontrol input.corrected-value{border-color:#dc4e41;-webkit-box-shadow:#fcedec 0 0 8px 0;box-shadow:0 0 8px 0 #fcedec}.control.shared-controls-spinnercontrol .increment-down,.control.shared-controls-spinnercontrol .increment-up{position:absolute;right:1px;top:1px;width:30px;line-height:30px}.control.shared-controls-spinnercontrol .increment-down:focus,.control.shared-controls-spinnercontrol .increment-up:focus{background-color:rgba(0,164,253,.1);-webkit-box-shadow:none;box-shadow:none;outline:none}.control.shared-controls-spinnercontrol .increment-down.disabled,.control.shared-controls-spinnercontrol .increment-up.disabled{color:#c3cbd4}.control.shared-controls-spinnercontrol .increment-down{right:31px}.control.shared-findinput{display:inline-block;margin:5px 0}.control.shared-findinput input{width:250px}.input-label{display:inline-block;padding:8px 0 4px;height:auto;line-height:15px;font-size:14px;-webkit-box-sizing:border-box;box-sizing:border-box;max-width:100%;word-wrap:break-word;word-break:break-word;font-weight:500}label.checkbox{padding:2px 0 2px 21px;margin-bottom:0;position:relative}label.checkbox.disabled{color:#c3cbd4}label.checkbox>.btn{padding:0;width:16px;height:16px;border-radius:2px;position:absolute;left:0;top:3px}label.checkbox>.btn>[class*=icon-]{margin:0;position:relative;bottom:6px;vertical-align:text-top}.control-group-small .control-label,.control-small{font-size:12px}.control-small .uneditable-input,.control-small input[type=text],.control-small textarea{padding-top:2px;padding-bottom:2px;font-size:inherit}.control-small .uneditable-input,.control-small input[type=text]{height:26px}.control-small .uneditable-input{min-height:16px}.control-small .btn,.control-small.btn-group>.btn{padding-top:2px;padding-bottom:2px;font-size:12px}.control-small.shared-controls-spinnercontrol .uneditable-input,.control-small.shared-controls-spinnercontrol input{padding-right:55px}.control-small.shared-controls-spinnercontrol .increment-down,.control-small.shared-controls-spinnercontrol .increment-up{width:24px;line-height:24px}.control-small.shared-controls-spinnercontrol .increment-down{right:25px}.shared-controls-checkboxgroup label.checkbox{padding-top:2px;padding-bottom:2px}.control-group>.controls>.shared-controls-syntheticcheckboxcontrol:only-child{padding-top:4px}.shared-controls-keyvaluecontrol .shared-controls-textcontrol{margin-right:10px}.shared-controls-keyvaluecontrol .key-text-control-placeholder,.shared-controls-keyvaluecontrol .value-text-control-placeholder{float:left}.accumulator{width:700px}.controls-join .accumulator{width:100%}.accumulator .availableOptionsContainer,.accumulator .selectedOptionsContainer{float:left;width:calc(50% - 10px);margin:0 20px 0 0}.accumulator .addAllLink,.accumulator .removeAllLink{float:right}.accumulator .selectedOptionsContainer{margin-right:0}.accumulator .availableOptionsHeader{font-weight:400;font-size:14px;width:200px;margin-right:22px;padding-bottom:5px;line-height:0}.accumulator .selectedOptionsHeader{width:200px;margin-right:0}.accumulator ul.availableOptions,.accumulator ul.selectedOptions{border-radius:3px;height:100px;overflow:auto;list-style:none;margin:0;padding:0;border:1px solid #c3cbd4;clear:left}.accumulator .accDisabled ul.availableOptions,.accumulator .accDisabled ul.selectedOptions{background-color:#f7f8fa}.accumulator ul.availableOptions li,.accumulator ul.selectedOptions li{clear:left;padding:4px 5px;font-size:14px;cursor:pointer;line-height:1}.accumulator ul.availableOptions li:hover,.accumulator ul.selectedOptions li:hover{background-color:#f7f8fa}.accumulator ul.availableOptions li span,.accumulator ul.selectedOptions li span{margin:0 8px 0 0;display:block;float:left}.accumulator ul span.splIcon-arrow-e{background-color:#007abd}.accumulator .accDisabled ul li,.accumulator ul.availableOptions li.selected{color:#6b7785}.accumulator .accDisabled ul li span.splIcon,.accumulator ul.availableOptions li.selected span.splIcon{background-color:#c3cbd4}.accumulator .selected{background-color:transparent}.control-group.error .accumulator ul{border-color:#dc4e41}.accumulator .icon-class{color:#6b7785}.accumulator div.wide{width:340px}table.form td{padding-right:10px;padding-bottom:5px}table.form tr:last-child td{padding-bottom:0}table.form tr:last-child .help-block{margin-bottom:0}.form-format .control-label{width:100px}.form-format .control-group:last-child{margin-bottom:0}.form-format .controls{margin-left:120px}.form-horizontal.align-left .control-label{width:auto;text-align:left;display:inline-block;float:none}.form-horizontal.align-left .controls{margin-left:15px;display:inline-block}.shared-controls-textcontrol.input-prepend{display:-webkit-box;display:-ms-flexbox;display:flex}.shared-controls-textcontrol.input-prepend .uneditable-input,.shared-controls-textcontrol.input-prepend>input{border-top-left-radius:0;border-bottom-left-radius:0;-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;width:0}.shared-controls-textcontrol.input-prepend>.btn:first-child{border-top-right-radius:0;border-bottom-right-radius:0;border-right:none}.shared-controls-textbrowsecontrol,.shared-controls-textcontrol.input-append{display:-webkit-box;display:-ms-flexbox;display:flex}.shared-controls-textbrowsecontrol .uneditable-input,.shared-controls-textbrowsecontrol>input,.shared-controls-textcontrol.input-append .uneditable-input,.shared-controls-textcontrol.input-append>input{border-top-right-radius:0;border-bottom-right-radius:0;-webkit-box-flex:1;-ms-flex:1 0 auto;flex:1 0 auto;width:0}.shared-controls-textbrowsecontrol .uneditable-input+.btn,.shared-controls-textbrowsecontrol>input+.btn,.shared-controls-textcontrol.input-append .uneditable-input+.btn,.shared-controls-textcontrol.input-append>input+.btn{border-top-left-radius:0;border-bottom-left-radius:0;border-left:none}.shared-controls-textbrowsecontrol .add-on,.shared-controls-textcontrol.input-append .add-on{display:inline-block;height:auto;line-height:20px;font-size:14px;-webkit-box-sizing:border-box;box-sizing:border-box;padding:5px 14px;margin-bottom:0;font-weight:400;text-align:center;vertical-align:middle;border-top-right-radius:3px;border-bottom-right-radius:3px;background-color:#f7f8fa;border:1px solid #c3cbd4;border-left:#c3cbd4;color:#5c6773;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);text-decoration:none;text-shadow:none;-webkit-transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;-webkit-filter:none;filter:none}.shared-controls-textbrowsecontrol .add-on[disabled],.shared-controls-textcontrol.input-append .add-on[disabled]{color:#c3cbd4;border-color:#e1e6eb;cursor:not-allowed}.form-complex{width:100%}.form-complex .controls{position:relative}.form-complex .control-group{width:440px}.form-complex .control-heading{padding-top:5px;text-align:right;width:160px;font-weight:700}.form-complex .help-block,.form-complex .help-outer{position:absolute;top:4px;left:100%;margin-left:10px;margin-top:0!important;width:280px}.form-complex .outline{border:1px solid #c3cbd4;border-radius:3px;margin-bottom:10px;margin-top:0;padding-top:10px}.form-complex fieldset{border:1px solid transparent}.form-complex .btn-check{display:inline-block;padding:0;height:auto;line-height:20px;font-size:14px;-webkit-box-sizing:border-box;box-sizing:border-box;text-align:center;vertical-align:middle;width:20px}.form-complex .control-feedback{display:block;width:100%}.control-feedback{color:#5c6773;background-color:#fff;border-radius:3px;font-size:85%;text-align:center;margin-top:3px}.shared-controls-syntheticradiocontrol>.tooltip{white-space:normal}.shared-controls-syntheticradiocontrol .btn-radio{-webkit-animation:none 0s ease 0s 1 normal none running;animation:none 0s ease 0s 1 normal none running;-webkit-backface-visibility:visible;backface-visibility:visible;background:transparent none repeat 0 0/auto auto padding-box border-box scroll;border-collapse:separate;-o-border-image:none;border-image:none;border-radius:0;border-spacing:0;bottom:auto;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:content-box;box-sizing:content-box;caption-side:top;clear:none;clip:auto;color:#000;-webkit-columns:auto;-webkit-column-count:auto;-webkit-column-fill:balance;column-fill:balance;-webkit-column-gap:normal;column-gap:normal;-webkit-column-rule:medium none currentColor;column-rule:medium none currentColor;-webkit-column-span:1;column-span:1;-webkit-column-width:auto;columns:auto;content:normal;counter-increment:none;counter-reset:none;cursor:auto;direction:ltr;display:inline;empty-cells:show;float:none;font-family:serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;line-height:normal;height:auto;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none;left:auto;letter-spacing:normal;list-style:disc outside none;margin:0;max-height:none;max-width:none;min-height:0;min-width:0;opacity:1;orphans:2;overflow:visible;overflow-x:visible;overflow-y:visible;page-break-after:auto;page-break-before:auto;page-break-inside:auto;-webkit-perspective:none;perspective:none;-webkit-perspective-origin:50% 50%;perspective-origin:50% 50%;position:static;right:auto;-moz-tab-size:8;-o-tab-size:8;tab-size:8;table-layout:auto;text-align:left;text-align-last:auto;text-indent:0;text-shadow:none;text-transform:none;top:auto;-webkit-transform:none;transform:none;-webkit-transform-origin:50% 50% 0;transform-origin:50% 50% 0;-webkit-transform-style:flat;transform-style:flat;-webkit-transition:none 0s ease 0s;transition:none 0s ease 0s;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:2;width:auto;word-spacing:normal;z-index:auto;font-family:Splunk Platform Sans,Proxima Nova,Roboto,Droid,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;-webkit-box-sizing:border-box;box-sizing:border-box;display:block;border:1px;visibility:inherit;outline:medium none #00a4fd;outline:medium none invert;position:relative;padding:3px 0 3px 20px;color:#3c444d;text-decoration:none}.shared-controls-syntheticradiocontrol .btn-radio:before{content:"";background-color:#f7f8fa;border:1px solid #c3cbd4;color:#5c6773;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);text-decoration:none;text-shadow:none;-webkit-transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;-webkit-filter:none;filter:none;position:absolute;left:0;top:4px;-webkit-box-sizing:border-box;box-sizing:border-box;width:16px;height:16px;border-radius:8px}.shared-controls-syntheticradiocontrol .btn-radio.disabled{cursor:not-allowed;color:#c3cbd4;opacity:.65}.shared-controls-syntheticradiocontrol .btn-radio.disabled:before{background:#f7f8fa;-webkit-filter:none;filter:none;border-color:#e1e6eb}.shared-controls-syntheticradiocontrol .btn-radio:not(.disabled):hover:before{background-color:#ebeeef;border-color:#c3cbd4;color:#5c6773;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);text-decoration:none;text-shadow:none;-webkit-transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;-webkit-filter:none;filter:none}.shared-controls-syntheticradiocontrol .btn-radio:focus:before{-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0;text-decoration:none}.shared-controls-syntheticradiocontrol .btn-radio:focus:before:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.shared-controls-syntheticradiocontrol .btn-radio.active:after{content:"";position:absolute;left:4px;top:8px;-webkit-box-sizing:border-box;box-sizing:border-box;width:8px;height:8px;border-radius:4px;background-color:currentColor}.radio-control-list{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.error .btn{background-color:#f1b9b3;border-color:#dc4e41;color:#dc4e41;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);text-decoration:none;text-shadow:none;-webkit-transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;-webkit-filter:none;filter:none}.error .btn.active{background-image:none}.error .btn.active,.error .btn:hover{background-color:#ea958d;border-color:#dc4e41;color:#dc4e41;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);text-decoration:none;text-shadow:none;-webkit-transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;-webkit-filter:none;filter:none}.required{color:#dc4e41}.color-square{display:block;width:32px;height:32px;background:#53a051;border:1px solid #c3cbd4;border-radius:2px;-webkit-box-sizing:border-box;box-sizing:border-box}.color-square:focus{-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0;text-decoration:none}.color-square:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.color-square-standalone{margin-top:3px}table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0}.table{width:auto;min-width:100%;max-width:none;margin-bottom:20px}.table td,.table th{text-align:left;vertical-align:top;padding:6px 12px;line-height:20px;border-bottom:1px solid #e1e6eb}.table td td:focus,.table th td:focus{border-collapse:separate;outline:0;text-decoration:none}.table td td:focus,.table td td:focus:active:not([disabled]),.table th td:focus,.table th td:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.table td td:focus,.table th td:focus{-webkit-box-shadow:inset 0 0 2px 1px #fff,inset 0 0 0 2px #00a4fd;box-shadow:inset 0 0 2px 1px #fff,inset 0 0 0 2px #00a4fd}.table td .tooltip-link,.table th .tooltip-link{top:-.5em;position:relative;font-size:75%;line-height:0;vertical-align:baseline;cursor:default;font-weight:400}.table th div{padding:6px 12px}.table thead th{vertical-align:bottom}.table caption+thead tr:first-child td,.table caption+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table thead:first-child tr:first-child td,.table thead:first-child tr:first-child th{border-top:0}.table tbody+tbody{border-top:2px solid #e1e6eb}.table .sorts{white-space:nowrap;cursor:pointer}.table .sorts a{color:inherit}.table .sorts a:hover{text-decoration:none}.table .sorts:hover{color:#006eaa}.table .sorts .icon-sorts:before{font-family:Splunk Icons;content:"\2195";padding-left:5px;color:#818d99}.table .sorts.active .icon-sorts:before{color:#006eaa}.table .sorts .asc:before,.table .sorts .Asc:before{content:"\21A5";color:inherit}.table .sorts .desc:before,.table .sorts .Desc:before{content:"\21A7";color:inherit}.table .sorts[tabindex]:focus{border-collapse:separate;outline:0;text-decoration:none}.table .sorts[tabindex]:focus,.table .sorts[tabindex]:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.table .sorts[tabindex]:focus{-webkit-box-shadow:inset 0 0 2px 1px #e1e6eb,inset 0 0 0 2px #00a4fd;box-shadow:inset 0 0 2px 1px #e1e6eb,inset 0 0 0 2px #00a4fd}.table .table{background-color:transparent}.table-condensed td,.table-condensed th{padding:3px 6px}.table-bordered{border:1px solid #e1e6eb;border-collapse:separate;border-left:0}.table-bordered-lite td,.table-bordered-lite th,.table-bordered td,.table-bordered th{border-left:1px solid #e1e6eb}.table-bordered-lite td:first-child,.table-bordered-lite th:first-child{border-left:none}.table-dotted td,.table-dotted th{border-top:1px dashed #c3cbd4}.table-striped>thead>tr>th{background-color:#fff;border-top:1px solid #e1e6eb}.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#f2f4f5}.table-striped>tbody>tr:nth-child(2n)>td{background-color:#fff}.table-striped>tbody>tr.odd>td,.table-striped>tbody>tr.odd>th{background-color:#f2f4f5}.table-striped>tbody>tr.even>td,.table-striped>tbody>tr.even>th{background-color:#fff}.table-striped>tbody>tr>td{border:none}.table-striped.table-chrome>tbody>tr.even>td,.table-striped.table-chrome>tbody>tr:nth-child(2n)>td,.table-striped.table-chrome>tbody>tr:nth-child(odd).even>td{background-color:#f2f4f5}.table-striped.table-chrome>tbody>tr.odd>td,.table-striped.table-chrome>tbody>tr:nth-child(2n).odd>td,.table-striped.table-chrome>tbody>tr:nth-child(odd)>td{background-color:#fff}.table-chrome,.table-chrome.table-row-expanding{border:none}.table-chrome>thead>tr>th{font-weight:400;background-color:#e1e6eb;border-right:1px solid #fff;border-bottom:none;-webkit-box-shadow:none;box-shadow:none}.table-chrome>thead>tr>th:last-child{border-right:none}.table-chrome .sorts{border-bottom:none}@media screen and (-webkit-min-device-pixel-ratio:0){.table-chrome>thead>tr>th{position:relative}}.table-hover>tbody>tr>td,.table-hover>tbody>tr>th{-webkit-transition:background .05s;transition:background .05s}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#ecf8ff!important}.row-fluid table td[class*=span],.row-fluid table th[class*=span],table td[class*=span],table th[class*=span]{display:table-cell;float:none;margin-left:0}.table td.span1,.table th.span1{float:none;width:44px;margin-left:0}.table td.span2,.table th.span2{float:none;width:124px;margin-left:0}.table td.span3,.table th.span3{float:none;width:204px;margin-left:0}.table td.span4,.table th.span4{float:none;width:284px;margin-left:0}.table td.span5,.table th.span5{float:none;width:364px;margin-left:0}.table td.span6,.table th.span6{float:none;width:444px;margin-left:0}.table td.span7,.table th.span7{float:none;width:524px;margin-left:0}.table td.span8,.table th.span8{float:none;width:604px;margin-left:0}.table td.span9,.table th.span9{float:none;width:684px;margin-left:0}.table td.span10,.table th.span10{float:none;width:764px;margin-left:0}.table td.span11,.table th.span11{float:none;width:844px;margin-left:0}.table td.span12,.table th.span12{float:none;width:924px;margin-left:0}.table>tbody>tr.even>td:focus,.table>tbody>tr.odd>td:focus{-webkit-box-shadow:none;box-shadow:none;border-collapse:separate;outline:0;text-decoration:none}.table>tbody>tr.even>td:focus:active:not([disabled]),.table>tbody>tr.odd>td:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.table>tbody>tr.even>td:focus,.table>tbody>tr.odd>td:focus{-webkit-box-shadow:inset 0 0 2px 1px #fff,inset 0 0 0 2px #00a4fd;box-shadow:inset 0 0 2px 1px #fff,inset 0 0 0 2px #00a4fd}.table>tbody>tr.even:focus,.table>tbody>tr.odd:focus,.table>tbody>tr:focus{outline:none}.table>tbody>tr.even:focus>td,.table>tbody>tr.odd:focus>td,.table>tbody>tr:focus>td{-webkit-box-shadow:none;box-shadow:none;border-collapse:separate;outline:0;text-decoration:none}.table>tbody>tr.even:focus>td:active:not([disabled]),.table>tbody>tr.odd:focus>td:active:not([disabled]),.table>tbody>tr:focus>td:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.table>tbody>tr.even:focus>td,.table>tbody>tr.odd:focus>td,.table>tbody>tr:focus>td{-webkit-box-shadow:inset 0 0 2px 1px #fff,inset 0 0 0 2px #00a4fd;box-shadow:inset 0 0 2px 1px #fff,inset 0 0 0 2px #00a4fd}.table tbody tr.success>td{background-color:#ddecdd}.table tbody tr.error>td{background-color:#f8dcd9}.table tbody tr.warning>td{background-color:#fef2d7}.table tbody tr.info>td{background-color:#cce2eb}.table-hover tbody tr.success:hover>td{background-color:#cee3ce}.table-hover tbody tr.error:hover>td{background-color:#f4c8c3}.table-hover tbody tr.warning:hover>td{background-color:#fdeabe}.table-hover tbody tr.info:hover>td{background-color:#b9d8e4}.table-embed{width:100%;border:0}.table-embed td{border-bottom:1px dashed #c3cbd4;border-left:0;padding:0;background-color:transparent!important}.table-embed td:first-child{padding-right:10px}.table-row-expanding{width:100%;table-layout:fixed;margin-bottom:-1px;border-bottom:1px solid #c3cbd4}.table-row-expanding>tbody>tr>td.expands{cursor:pointer;border-right:1px solid #fff;padding:0}.table-row-expanding>tbody>tr>td.expands.disabled{color:#c3cbd4;cursor:default}.table-row-expanding>tbody>tr>td.expands.disabled>span,.table-row-expanding>tbody>tr>td.expands.disabled a{color:inherit;cursor:inherit}.table-row-expanding>tbody>tr>td.expands>i,.table-row-expanding>tbody>tr>td.expands>span,.table-row-expanding>tbody>tr>td.expands a{color:#3c444d;display:block;padding:6px 10px;width:15px;height:100%;text-decoration:none;text-align:center}.table-row-expanding>tbody>tr>td.expands a:focus{-webkit-box-shadow:none;box-shadow:none;border-collapse:separate;outline:0;text-decoration:none}.table-row-expanding>tbody>tr>td.expands a:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.table-row-expanding>tbody>tr>td.expands a:focus{-webkit-box-shadow:inset 0 0 2px 1px #fff,inset 0 0 0 2px #00a4fd;box-shadow:inset 0 0 2px 1px #fff,inset 0 0 0 2px #00a4fd}.table-row-expanding>tbody>tr>td>.btn-combo{margin:-4px 5px -6px 20px}.table-row-expanding>tbody>tr>td>.btn-combo:first-child{margin-left:0}.table-row-expanding>tbody>tr>td.title>a,.table-row-expanding>tbody>tr>td.title>span{margin:-6px -12px;padding:6px 12px;display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-size:14px;line-height:20px}.table-row-expanding>tbody>tr>td.title>a:focus,.table-row-expanding>tbody>tr>td.title>span:focus{-webkit-box-shadow:none;box-shadow:none;border-collapse:separate;outline:0;text-decoration:none}.table-row-expanding>tbody>tr>td.title>a:focus:active:not([disabled]),.table-row-expanding>tbody>tr>td.title>span:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.table-row-expanding>tbody>tr>td.title>a:focus,.table-row-expanding>tbody>tr>td.title>span:focus{-webkit-box-shadow:inset 0 0 2px 1px #fff,inset 0 0 0 2px #00a4fd;box-shadow:inset 0 0 2px 1px #fff,inset 0 0 0 2px #00a4fd}.table-row-expanding>tbody>tr>td.title>.disabled{color:#c3cbd4}.table-row-expanding>tbody>tr>td:focus{border-collapse:separate;outline:0;text-decoration:none}.table-row-expanding>tbody>tr>td:focus,.table-row-expanding>tbody>tr>td:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.table-row-expanding>tbody>tr>td:focus{-webkit-box-shadow:inset 0 0 2px 1px #fff,inset 0 0 0 2px #00a4fd;box-shadow:inset 0 0 2px 1px #fff,inset 0 0 0 2px #00a4fd}.table-row-expanding>tbody>tr.info-row>td,.table-row-expanding>tbody>tr.more-info{border-top:none;background-color:#ecf8ff}.table-row-expanding>tbody>tr.expanded>td{background-color:#ecf8ff}.table-row-expanding>tbody>tr.expanded>td.title>a{white-space:normal}.table-row-expanding th.col-info{width:15px;padding-left:10px;padding-right:10px;text-align:center;vertical-align:top;font-size:100%;border-right:1px solid #fff}.table-row-expanding th.col-info a{text-decoration:none;color:#000;-webkit-box-shadow:none;box-shadow:none}.table-row-expanding th.col-info .icon-info{width:15px;display:block}.table-row-expanding td.col-info:hover:not(.disabled),.table-row-expanding td.expands:hover:not(.disabled){border-right:1px solid #fff!important}.table-row-expanding td.col-info:hover:not(.disabled) a>i,.table-row-expanding td.expands:hover:not(.disabled) a>i{color:#006eaa}.table-row-expanding td.col-info.disabled:hover,.table-row-expanding td.expands.disabled:hover{background-color:inherit!important}.table-row-expanding td.expands .icon-triangle-right-small:before{content:"\203A"}.table-row-expanding td.expands .icon-triangle-down-small:before{content:"\2C5"}.table-chrome .sorts th.col-info:after{content:""}.table-padded{padding:0 20px}td.row-number,th.row-number{width:1px}td.line-num,td.row-number{text-align:right;color:#171d21}td.numeric,th.numeric{text-align:right}td.end-group{border-right:1px solid #fff}.header-table-docked{position:fixed;top:0;z-index:405;overflow:hidden;-webkit-box-shadow:0 2px 4px #c3cbd4;box-shadow:0 2px 4px #c3cbd4;background:#fff}.header-table-docked>.disable{display:block;position:absolute;top:0;right:0;bottom:0;left:0;background-color:#5c6773;opacity:.3}.header-table-docked>table{table-layout:fixed;margin-bottom:0;max-width:inherit}.main-section>.header-table-docked,.table-padded>.header-table-docked{width:calc(100% - 40px);margin-left:20px!important}.table-scroll-bar-docked{position:fixed;bottom:0;left:0;right:0;overflow-x:auto}.header-table-static{height:0;position:relative;z-index:405}.header-table-static>table{margin-bottom:0}.header-table-wrapper{overflow:hidden;border-bottom:1px solid #e1e6eb}.header-table-wrapper .table{margin-bottom:0}.scroll-table-wrapper{height:380px;width:100%;overflow:auto}.scrolling-table-wrapper{width:100%;overflow-x:auto;position:relative}.vertical-scrolling-table-wrapper{width:100%;overflow-y:auto}.modalize-table-bottom,.modalize-table-overlay,.modalize-table-top{position:absolute;left:0;background-color:#5c6773;opacity:.3}.modalize-table-top{top:0}.modalize-table-bottom{bottom:0}.modalize-table-overlay{position:fixed;top:0;bottom:0;right:0}.table-drilldown>tbody>tr>td,.table-drilldown>tbody>tr>td:hover{color:#006eaa}.table-drilldown>tbody>tr>td.row-number{color:#6b7785}.table-drilldown-row>tbody>tr:hover>td{color:#006eaa}.table-drilldown-row>tbody>tr:hover>td.row-number{color:#6b7785}.table-drilldown-cell>tbody>tr>td:hover .multivalue-subcell,.table-drilldown-cell>tbody>tr>td:hover .multivalue-subcell:hover{color:#006eaa}.ui-grid-body-table,.ui-grid-head-table{margin-bottom:0}.table-scroll tbody{max-height:200px;overflow-y:scroll}.table-border-row,.table-border-row td,.table-border-row th{border-top:1px solid #e1e6eb}.table-fixed{table-layout:fixed}.table-fixed tr>td:first-child{max-width:300px;word-break:break-all}.table-chrome .sorts th.row-number:after{content:""}@media print{body table{table-layout:auto!important}body .events-viewer-wrapper,body .results-table,body .results-wrapper,body .scrolling-table-wrapper,body table{max-width:100%!important;width:100%!important;overflow:hidden!important}body td,body th{background:none!important;word-break:break-all!important;word-wrap:break-word!important;overflow-wrap:break-word!important;white-space:normal!important;width:auto!important;page-break-inside:auto}body .table-chrome .sorts:after{content:""}body .header-table-docked,body .table-scroll-bar-docked{display:none!important}}body.print table{table-layout:auto!important}body.print .events-viewer-wrapper,body.print .results-table,body.print .results-wrapper,body.print .scrolling-table-wrapper,body.print table{max-width:100%!important;width:100%!important;overflow:hidden!important}body.print td,body.print th{background:none!important;word-break:break-all!important;word-wrap:break-word!important;overflow-wrap:break-word!important;white-space:normal!important;width:auto!important;page-break-inside:auto}body.print .table-chrome .sorts:after{content:""}body.print .header-table-docked,body.print .table-scroll-bar-docked{display:none!important}.table-caption,.table-caption-inner{min-height:42px;text-align:center;margin-bottom:5px}.table-caption-inner.affix-top{left:0;top:0;right:0;background-color:#f2f4f5;z-index:405;position:fixed}.table-caption h3,.table-caption span.shared-collectioncount{font-size:14px;font-weight:400;float:left;padding-left:20px;line-height:42px;margin:0;min-width:140px;text-align:left}.table-caption .shared-waitspinner{float:left;width:14px;height:14px;margin:12px 5px 2px 0}.table-caption form.shared-tablecaption-input{display:inline-block;margin:5px 0}.table-caption form.shared-tablecaption-input input{width:250px}.table-caption .btn-group{display:inline-block;margin-right:10px}.shared-tablecaption-input{position:relative}.table-caption div.shared-controls-controlgroup{display:inline-block;margin:0 10px 0 0}.table-caption .pagination{min-width:150px;margin:5px 20px 0}.tourbar{background-color:#171d21;min-height:46px;position:relative}.tourbar .info-container{margin:0 200px;padding:10px;background-color:#3c444d;min-height:26px}.tourbar .info-container .info{font-size:14px;color:#e1e6eb}.tourbar .btn{background:transparent;-webkit-filter:none;filter:none;border-color:#c3cbd4;color:#e1e6eb;text-shadow:none;-webkit-box-shadow:none;box-shadow:none;top:50%;margin-top:-13px;position:absolute}.tourbar .btn.next{right:158px}.tourbar .btn.previous{left:158px}.tourbar .btn.close-btn{right:10px}.tourbar .close-container{float:right;margin:10px 25px}.tourbar .next-container{float:right;margin:10px 0 10px 25px}.tourbar .previous-container{float:left;margin:10px 25px}.tour-highlight{position:relative}.tour-highlight:after{content:"";position:absolute;right:-20px;top:-20px;height:30px;width:30px;z-index:99999;background:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTYuNzE0IDYuNzE0TDAgMHYyMGgyMGwtNi4yMTQtNi4yMTQgNi4yNi02LjI2TDEyLjk3NS40NTNsLTYuMjYgNi4yNnoiIGZpbGw9IiNEODVEM0MiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==);background-size:30px 30px;-webkit-animation:highlightedElementAnimation 2s infinite alternate;animation:highlightedElementAnimation 2s infinite alternate}@-webkit-keyframes highlightedElementAnimationFrames{0%{right:-20px;top:-20px}to{right:-30px;top:-30px}}@keyframes highlightedElementAnimationFrames{0%{right:-20px;top:-20px}to{right:-30px;top:-30px}}.image-tour-container .carousel{width:960px;height:718px;background:#3c444d;margin-bottom:0}.image-tour-container .carousel .carousel-control{top:52%;background:none;border:none;color:#5cc05c;opacity:1;left:45px;font-size:48px;z-index:60}.image-tour-container .carousel .carousel-control polygon{fill:#5cc05c}.image-tour-container .carousel .carousel-control:hover polygon{fill:#7ecd7e}.image-tour-container .carousel .carousel-control.disabled{display:none}.image-tour-container .carousel .carousel-control:focus{-webkit-box-shadow:none;box-shadow:none}.image-tour-container .carousel .carousel-control.right{right:45px;left:auto}.image-tour-container .carousel .carousel-indicators{bottom:18px;top:inherit;right:50%;-webkit-transform:translate(50%);transform:translate(50%);z-index:60}.image-tour-container .carousel .carousel-indicators li{height:6px;width:6px;cursor:pointer;background:#818d99;border:none;margin-left:10px;margin-bottom:0}.image-tour-container .carousel .carousel-indicators li.active{background-color:#5cc05c}.image-tour-container .carousel .carousel-indicators li:first-child{margin-left:0}.image-tour-container .carousel .item{width:960px;height:716px}.image-tour-container .carousel .item img{width:100%}.image-tour-container .carousel .item.active img:hover{cursor:pointer}.image-tour-container .carousel .help-link{position:absolute;width:150px;height:30px;top:122px;left:563px}.image-tour-container .carousel a#splunk-answers{top:160px;left:504px;width:140px}.image-tour-container .tour-links{position:absolute;top:15px;right:5px;padding:5px;text-align:right;z-index:50;font-size:12px}.image-tour-container .tour-links a{color:#fff;margin-left:15px}.image-tour-container .tour-links a:hover{text-decoration:underline}.image-tour-container .welcome-slide{position:absolute;top:0;left:0;z-index:100}.image-tour-container .tour-btn{background:rgba(0,0,0,.3);position:absolute;top:300px;left:50%;padding:30px 40px;font-size:30px;color:#fff;cursor:pointer;-webkit-transform:translate(-50%);transform:translate(-50%)}.image-tour-container .exit-tour,.image-tour-container .start-tour{color:#5cc05c}.image-tour-container .tour-gutter{background:rgba(60,68,77,.9);height:132px;width:962px;font-size:16px;color:#fff;position:absolute;bottom:0;z-index:50;left:50%;-webkit-transform:translate(-50%);transform:translate(-50%)}.image-tour-container .tour-gutter div.gutter-text{-webkit-transform:translateY(-50%);transform:translateY(-50%);margin:0 auto;position:relative;top:50%;line-height:150%;width:720px;text-align:center}.image-tour-container .tour-gutter a{color:#fff;text-decoration:underline}.image-tour-container .carousel-assets{position:absolute;height:132px;width:960px;bottom:0}.image-tour-container .next-tour,.image-tour-container .try-it-now{display:none}.image-tour-container .try-it-now{position:absolute;right:30px;z-index:500;bottom:50px}@media only screen and (max-height:750px){.image-tour-container .carousel-assets,.image-tour-container .tour-gutter{position:fixed}.image-tour-container .carousel-assets{bottom:-132px;z-index:60}.image-tour-container .carousel-assets .carousel-control{top:inherit;bottom:175px}.image-tour-container .carousel-assets .carousel-indicators{bottom:150px}.image-tour-container .carousel-assets .tour-links{top:inherit;bottom:220px}.image-tour-container .carousel-assets .try-it-now{top:inherit;bottom:180px}}.image-tour .tour-modal{width:960px;margin-left:-480px;height:716px;background:#3c444d;z-index:1061}.image-tour .tour-modal.fade.in{top:15px}.modal-backdrop.tour-backdrop.fade{background:#3c444d;z-index:1060}.modal-backdrop.tour-backdrop.fade.in{opacity:1;background:#3c444d}.shard-interactivetour.modal,.shared-tour-imagetour.modal,.shared-tour-producttours.modal{background-clip:border-box}.shard-interactivetour.modal .modal-header,.shared-tour-imagetour.modal .modal-header,.shared-tour-producttours.modal .modal-header{padding-bottom:10px}.shard-interactivetour.modal .modal-body,.shared-tour-imagetour.modal .modal-body,.shared-tour-producttours.modal .modal-body{padding:0 10px 10px;border-top:0}.shard-interactivetour.modal .modal-body:last-child,.shared-tour-imagetour.modal .modal-body:last-child,.shared-tour-producttours.modal .modal-body:last-child{max-height:none}.introjs-overlay{position:absolute;z-index:999999;background-color:#000;opacity:0;background:radial-gradient(center,ellipse cover,rgba(0,0,0,.4) 0,rgba(0,0,0,.9) 100%)}.introjs-fixParent{z-index:auto!important;opacity:1!important;position:absolute!important;-webkit-transform:none!important;transform:none!important;display:block!important}.introjs-showElement,tr.introjs-showElement>td,tr.introjs-showElement>th{z-index:9999999!important}.introjs-disableInteraction{z-index:99999999!important;position:absolute}a.introjs-showElement{display:inline-block!important}.introjs-relativePosition,tr.introjs-showElement>td,tr.introjs-showElement>th{position:relative}.introjs-helperLayer{position:absolute;z-index:9999998;background-color:hsla(0,0%,100%,.9);border:1px solid rgba(0,0,0,.5);border-radius:4px;-webkit-box-shadow:0 2px 15px rgba(0,0,0,.4);box-shadow:0 2px 15px rgba(0,0,0,.4)}.introjs-tooltipReferenceLayer{position:absolute;z-index:10000000;background-color:transparent}.introjs-helperLayer *,.introjs-helperLayer :after,.introjs-helperLayer :before{-webkit-box-sizing:content-box;box-sizing:content-box}.introjs-helperNumberLayer{position:absolute;top:-16px;left:-16px;z-index:9999999999!important;padding:2px;font-size:13px;font-weight:700;color:#fff;text-align:center;text-shadow:1px 1px 1px rgba(0,0,0,.3);background:-webkit-gradient(linear,left top,left bottom,from(#dc4e41),to(#f7f8fa));background:linear-gradient(180deg,#dc4e41 0,#f7f8fa);width:20px;height:20px;line-height:20px;border:3px solid #fff;border-radius:50%;-webkit-box-shadow:0 2px 5px rgba(0,0,0,.4);box-shadow:0 2px 5px rgba(0,0,0,.4)}.introjs-arrow{border:8px solid rgba(60,68,77,.9);content:"";position:absolute}.introjs-arrow.top,.introjs-arrow.top-right{top:-15px;border-color:transparent transparent rgba(60,68,77,.9)}.introjs-arrow.top-right{right:10px}.introjs-arrow.top-middle{top:-15px;left:50%;margin-left:-5px;border-color:transparent transparent rgba(60,68,77,.9)}.introjs-arrow.right{top:15px}.introjs-arrow.right,.introjs-arrow.right-bottom{right:-15px;border-color:transparent transparent transparent rgba(60,68,77,.9)}.introjs-arrow.right-bottom{bottom:10px}.introjs-arrow.bottom{bottom:-15px;border-color:rgba(60,68,77,.9) transparent transparent}.introjs-arrow.left{top:10px}.introjs-arrow.left,.introjs-arrow.left-bottom{left:-15px;border-color:transparent rgba(60,68,77,.9) transparent transparent}.introjs-arrow.left-bottom{bottom:10px}.introjs-tooltip{position:absolute;padding:40px 60px 10px;text-align:center;color:#fff;background-color:rgba(60,68,77,.9);min-width:400px;max-width:500px;border-radius:0;-webkit-box-shadow:0 1px 10px rgba(0,0,0,.4);box-shadow:0 1px 10px rgba(0,0,0,.4)}.introjs-tooltiptext a{color:#fff;text-decoration:underline}.introjs-tooltipbuttons{text-align:right;white-space:nowrap}.introjs-button{overflow:visible;padding:5px;margin:0;color:#5cc05c;fill:#5cc05c;text-decoration:none;font-size:25px;cursor:pointer;outline:none;position:absolute;top:50%;-webkit-transform:translateY(-45%);transform:translateY(-45%)}.introjs-button:hover polygon{fill:#82ce82}.introjs-button.introjs-disabled{display:none}.introjs-button:focus{-webkit-box-shadow:none;box-shadow:none;background:none}.introjs-tooltiplinks{position:absolute;top:10px;right:5px}.introjs-nexttourbutton,.introjs-skipbutton{font-size:12px;color:#fff;position:relative}.introjs-nexttourbutton:focus,.introjs-nexttourbutton:hover,.introjs-skipbutton:focus,.introjs-skipbutton:hover{color:#fff}.introjs-skipbutton.done{color:#5cc05c}.introjs-prevbutton{left:10px}.introjs-nextbutton{right:10px}.introjs-disabled,.introjs-disabled:focus,.introjs-disabled:hover{color:#818d99;-webkit-box-shadow:none;box-shadow:none;cursor:default;background-image:none;text-decoration:none}.introjs-bullets{text-align:center;padding-top:30px}.introjs-bullets ul{clear:both;margin:15px auto 0;padding:0;display:inline-block}.introjs-bullets ul li{list-style:none;float:left;margin:0 5px}.introjs-bullets ul li a{display:block;width:6px;height:6px;background:#c3cbd4;border-radius:10px;text-decoration:none}.introjs-bullets ul li a.active{background:#5cc05c}.introjs-progress{overflow:hidden;height:10px;margin:10px 0 5px;border-radius:4px;background-color:#e1e6eb}.introjs-progressbar{float:left;width:0;height:100%;font-size:10px;line-height:10px;text-align:center;background-color:#006d9c}.introjsFloatingElement{position:absolute;height:0;width:0;left:50%;top:50%}.introjs-tooltiptext{font-size:16px;line-height:24px}.tours-links{text-align:center;margin:0;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.tours-links li{position:relative;list-style:none;margin-bottom:20px;display:inline-block;text-align:center}.tours-links .mask{position:absolute;top:0;bottom:0;left:0;right:0;opacity:0;border-radius:3px;cursor:pointer;background-color:#5cc05c;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.tours-links .mask:hover{opacity:.1}.tours-links .svg-wrapper{height:84px;padding:10px;-webkit-box-sizing:border-box;box-sizing:border-box}.tours-links .svg-wrapper svg{width:84px;fill:#5cc05c}.tour-link{position:relative;padding:10px;margin:10px;display:inline-block;color:#3c444d!important;font-weight:500;-webkit-box-flex:1;-ms-flex:1 1 0px;flex:1 1 0;max-width:25%;-webkit-transition:opacity .125s,background .05s;transition:opacity .125s,background .05s}.tour-link:hover{background:rgba(195,203,212,.1);text-decoration:none}.tour-link:focus{-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0;text-decoration:none}.tour-link:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.tour-link i{height:84px;padding:32px 40px;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:76px;line-height:60px;color:#5cc05c}[class*=" icon-"]:before,[class^=icon-]:before{font-family:Splunk Icons;font-style:normal;font-weight:400;text-decoration:inherit;line-height:inherit}a [class*=" icon-"],a [class^=icon-]{display:inline-block;text-decoration:none;line-height:inherit}.icon-large{font-size:1.3333333333333333em;vertical-align:middle}.font-icon{font-family:Splunk Icons;font-size:inherit;line-height:inherit}.icon-no-underline:first-child{padding-right:.3em}.icon-no-underline:last-child{padding-left:.3em}.icon-no-underline:first-child:last-child{padding-right:0;padding-left:0}.icon-no-underline:before{text-decoration:none}.padded-icon{margin-right:.5em}.ir{position:relative;display:inline-block;min-width:.5em;text-indent:-9999px;outline:none}.ir:before{position:absolute;top:0;left:0;text-indent:0}.icon-splunk:before{content:"splunk"}.icon-greater:before{content:">"}.icon-hunk:before{content:"\F000"}.icon-enterprise:before{content:"\F001"}.icon-cloud-logo:before{content:"\F002"}.icon-splunk-light:before{content:"\F003"}.icon-circle:before{content:"\ECD0"}.icon-circle-filled:before{content:"\25CF"}.icon-box-filled:before{content:"\25A0"}.icon-triangle-up-small:before{content:"\25B4"}.icon-triangle-right:before{content:"\25B6"}.icon-triangle-right-small:before{content:"\25B8"}.icon-triangle-down:before{content:"\25BC"}.icon-triangle-down-small:before{content:"\25BE"}.icon-triangle-left:before{content:"\25C0"}.icon-triangle-left-small:before{content:"\25C2"}.icon-arrow-up:before{content:"\EC01"}.icon-arrow-right:before{content:"\27A1"}.icon-arrow-down:before{content:"\EC02"}.icon-arrow-left:before{content:"\EC00"}.icon-two-arrows-cycle:before{content:"\EC12"}.icon-external:before{content:"\EC13"}.icon-rotate-counter:before{content:"\21BA"}.icon-rotate:before{content:"\21BB"}.icon-location:before{content:"\EC80"}.icon-chevron-left:before{content:"\2039"}.icon-chevron-right:before{content:"\203A"}.icon-chevron-up:before{content:"\2C4"}.icon-chevron-down:before{content:"\2C5"}.icon-trash:before{content:"\EC66"}.icon-share:before{content:"\27A6"}.icon-export:before{content:"\EC68"}.icon-print:before{content:"\EC89"}.icon-search:before{content:"\EC9B"}.icon-search-thin:before{content:"\ECC2"}.icon-pivot:before{content:"\EC12"}.icon-clone:before{content:"\ECE8"}.icon-pause:before{content:"\EC50"}.icon-stop:before{content:"\25A0"}.icon-play:before{content:"\25B6"}.icon-sort:before{content:"\2195"}.icon-sorted-up:before{content:"\21A5"}.icon-sorted-down:before{content:"\21A7"}.icon-minus:before{content:"\2212"}.icon-minus-circle:before{content:"\2296";margin-right:.25em}.icon-plus:before{content:"+"}.icon-plus-circle:before{content:"\2295"}.icon-x:before{content:"\2717"}.icon-x-circle:before{content:"\2297"}.icon-cancel:before,.icon-close:before{content:"\2717"}.icon-collapse-left:before{content:"\ECE0"}.icon-expand-right:before{content:"\ECE1"}.icon-activity:before{content:"\ECAE"}.icon-string:before{content:"a"}.icon-number:before{content:"#"}.icon-text:before{content:"\ECD9"}.icon-not-allowed:before{content:"\EC9E"}.icon-data:before{content:"\ECA4"}.icon-data-input:before{content:"\ECA3"}.icon-settings:before{content:"\ECA5"}.icon-distributed-environment:before{content:"\ECA6"}.icon-visible:before{content:"\ECC0"}.icon-hidden:before{content:"\ECC1"}.icon-boolean:before{content:"\ECD2"}.icon-menu:before,.icon-rows:before{content:"\EC56"}.icon-tiles:before{content:"\ECF0"}.icon-metric:before{content:"\ECF5"}.icon-event:before{content:"\ECF6"}.icon-rollup:before{content:"\ECF8"}.icon-info:before{content:"i"}.icon-info-circle:before{content:"I"}.icon-question:before{content:"?";font-family:inherit}.icon-question-circle:before{content:"\EC9D"}.icon-box-unchecked:before{content:"\2610"}.icon-box-checked:before{content:"\2611"}.icon-check-circle:before{content:"\ECD3"}.icon-alert-circle:before{content:"\ECD4"}.icon-code:before{content:"\ECD7"}.icon-code-thin:before{content:"\ECD6"}.icon-alert:before{content:"\26A0"}.icon-error:before{content:"\ECE2"}.icon-warning:before{content:"\26A0"}.icon-fullscreen:before{content:"\ECF3"}.icon-bell:before{content:"\EC9C"}.icon-bookmark:before{content:"\ECA1"}.icon-bulb:before{content:"\EC98"}.icon-calendar:before{content:"\EC9A"}.icon-check:before{content:"\2713"}.icon-clock:before{content:"\231A"}.icon-cloud:before{content:"\2601"}.icon-flag:before{content:"\2691"}.icon-gear:before{content:"\2699"}.icon-lightning:before{content:"\2301"}.icon-link:before{content:"\ECF1"}.icon-lock:before{content:"\EC9F"}.icon-lock-unlocked:before{content:"\ECA0"}.icon-mail:before{content:"\2709"}.icon-pencil:before{content:"\270F"}.icon-speech-bubble:before{content:"\EC99"}.icon-star:before{content:"\2605"}.icon-user:before{content:"\EC84"}.icon-clipboard:before{content:"\ECD5"}.icon-paintbrush:before{content:"\ECCA"}.icon-warning-sign:before{content:"\26A0"}.icon-chart-area:before{content:"\ECA9"}.icon-chart-bar:before{content:"\ECAA"}.icon-chart-column:before{content:"\ECAB"}.icon-chart-pie:before{content:"\ECAC"}.icon-chart-scatter:before{content:"\ECAD"}.icon-chart-bubble:before{content:"\ECB8"}.icon-chart-line:before{content:"\ECAE"}.icon-single-value:before{content:"\ECAF"}.icon-gauge-radial:before{content:"\ECA2"}.icon-gauge-marker:before{content:"\ECB0"}.icon-gauge-filler:before{content:"\ECB1"}.icon-choropleth-map:before{content:"\ECB9";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-external-viz:before{content:"\ECF2"}.icon-label-rotation--90:before{content:"\ECE3"}.icon-label-rotation--45:before{content:"\ECE4"}.icon-label-rotation-0:before{content:"\ECE5"}.icon-label-rotation-45:before{content:"\ECE6"}.icon-label-rotation-90:before{content:"\ECE7"}.icon-trellis-layout:before{content:"\F004"}.icon-chart-area-plus-table:before{content:"\ECA9 + \ECA8"}.icon-chart-bar-plus-table:before{content:"\ECAA + \ECA8"}.icon-chart-column-plus-table:before{content:"\ECAB + \ECA8"}.icon-chart-pie-plus-table:before{content:"\ECAC + \ECA8"}.icon-chart-scatter-plus-table:before{content:"\ECAD + \ECA8"}.icon-chart-bubble-plus-table:before{content:"\ECB8 + \ECA8"}.icon-chart-line-plus-table:before{content:"\ECAE + \ECA8"}.icon-single-value-plus-table:before{content:"\ECAF + \ECA8"}.icon-gauge-radial-plus-table:before{content:"\ECA2 + \ECA8"}.icon-gauge-marker-plus-table:before{content:"\ECB0 + \ECA8"}.icon-gauge-filler-plus-table:before{content:"\ECB1 + \ECA8"}.icon-location-plus-table:before{content:"\EC80 + \ECA8"}.icon-choropleth-map-plus-table:before{content:"\ECB9 + \ECA8";-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-external-viz-plus-table:before{content:"\ECF2 + \ECA8"}.icon-list:before{content:"\ECA7"}.icon-table:before{content:"\ECA8"}.icon-bar-beside:before{content:"\ECB2"}.icon-bar-stacked:before{content:"\ECB3"}.icon-bar-stacked-100:before{content:"\ECB4"}.icon-missing-value-skipped:before{content:"\ECB5"}.icon-missing-value-zero:before{content:"\ECB6"}.icon-missing-value-join:before{content:"\ECB7"}.icon-folder:before{content:"\ECE9"}.icon-document:before,.icon-report:before{content:"\ECC3"}.icon-report-search:before{content:"\ECC4"}.icon-report-pivot:before{content:"\ECC5"}.icon-dashboard:before{content:"\ECC6"}.icon-panel:before{content:"\ECC7"}.icon-panel-search:before{content:"\ECC8"}.icon-panel-pivot:before{content:"\ECC9"}.popdown{position:relative}.popdown-dialog{background-color:#fff;border:1px solid #c3cbd4;-webkit-box-shadow:1px 2px 5px rgba(0,0,0,.2);box-shadow:1px 2px 5px rgba(0,0,0,.2);border-radius:2px;top:100%;left:50%;margin:8px 0 0 -103px;display:none;position:absolute;z-index:1059;white-space:normal}.popdown-dialog .arrow{border-bottom:8px solid #c3cbd4;top:-8px;left:50%;margin-left:-4px}.popdown-dialog .arrow,.popdown-dialog .arrow:before{position:absolute;height:0;width:0;border-left:8px solid transparent;border-right:8px solid transparent;content:"";display:block;border-top:0}.popdown-dialog .arrow:before{border-bottom:8px solid #fff;top:1px;left:-8px}.popdown-dialog.up{margin-top:0}.popdown-dialog.up>.arrow{border-top:8px solid #c3cbd4;bottom:-8px}.popdown-dialog.up>.arrow,.popdown-dialog.up>.arrow:before{position:absolute;height:0;width:0;border-left:8px solid transparent;border-right:8px solid transparent;content:"";display:block;border-bottom:0;top:auto}.popdown-dialog.up>.arrow:before{border-top:8px solid #fff;bottom:1px}.popdown-dialog.right{margin-left:5px;margin-top:0}.popdown-dialog.right .arrow{border-right:8px solid #c3cbd4;left:-8px}.popdown-dialog.right .arrow,.popdown-dialog.right .arrow:before{position:absolute;height:0;width:0;border-bottom:8px solid transparent;border-top:8px solid transparent;content:"";display:block;border-left:0;top:50%;margin:-8px 0 0}.popdown-dialog.right .arrow:before{border-right:8px solid #fff;left:1px}.popdown-dialog.pull-right .arrow{left:auto;right:8px}.popdown-dialog.open{display:block}.popdown-dialog:after{content:"";font-size:0;display:inline;overflow:hidden}.popdown-dialog-body{margin:0;border-radius:1px;background-color:#fff}.popdown-dialog-body:after,.popdown-dialog-body:before{display:table;content:"";line-height:0}.popdown-dialog-body:after{clear:both}.popdown-dialog-footer{border-top:1px solid #c3cbd4;padding:5px;border-bottom-left-radius:1px;border-bottom-right-radius:1px}.popdown-dialog-footer:after,.popdown-dialog-footer:before{display:table;content:"";line-height:0}.popdown-dialog-footer:after{clear:both}.popdown-dialog-padded{padding:10px}.dropdown,.dropup{position:relative}.dropdown-toggle:active,.open .dropdown-toggle{outline:0}.caret{display:inline-block;content:"";border:none;width:auto;height:auto;line-height:20px;margin:0;padding-left:.3em;vertical-align:baseline;font-family:Splunk Icons;font-weight:400}.caret,.caret:before{font-size:inherit;text-decoration:none}.caret:before{content:"\25BE"}.icon-no-underline+.caret{padding-left:0}.caret-char{font-family:Splunk Icons;font-weight:400}.caret-char:before{content:"\25BE"}.dropdown-menu{float:left;min-width:160px;list-style:none;word-wrap:break-word;width:20em;line-height:1.33333em;padding:0;background-clip:padding-box}.open>.dropdown-menu{display:block}.dropdown-menu{background-color:#fff;border:1px solid #c3cbd4;-webkit-box-shadow:1px 2px 5px rgba(0,0,0,.2);box-shadow:1px 2px 5px rgba(0,0,0,.2);border-radius:2px;top:100%;left:50%;margin:8px 0 0 -103px;display:none;position:absolute;z-index:1059;white-space:normal}.dropdown-menu .arrow{border-bottom:8px solid #c3cbd4;top:-8px;left:50%;margin-left:-4px}.dropdown-menu .arrow,.dropdown-menu .arrow:before{position:absolute;height:0;width:0;border-left:8px solid transparent;border-right:8px solid transparent;content:"";display:block;border-top:0}.dropdown-menu .arrow:before{border-bottom:8px solid #fff;top:1px;left:-8px}.dropdown-menu.up{margin-top:0}.dropdown-menu.up>.arrow{border-top:8px solid #c3cbd4;bottom:-8px}.dropdown-menu.up>.arrow,.dropdown-menu.up>.arrow:before{position:absolute;height:0;width:0;border-left:8px solid transparent;border-right:8px solid transparent;content:"";display:block;border-bottom:0;top:auto}.dropdown-menu.up>.arrow:before{border-top:8px solid #fff;bottom:1px}.dropdown-menu.right{margin-left:5px;margin-top:0}.dropdown-menu.right .arrow{border-right:8px solid #c3cbd4;left:-8px}.dropdown-menu.right .arrow,.dropdown-menu.right .arrow:before{position:absolute;height:0;width:0;border-bottom:8px solid transparent;border-top:8px solid transparent;content:"";display:block;border-left:0;top:50%;margin:-8px 0 0}.dropdown-menu.right .arrow:before{border-right:8px solid #fff;left:1px}.dropdown-menu.pull-right .arrow{left:auto;right:8px}.dropdown-menu.open{display:block}.dropdown-menu .divider{height:1px;margin:9px 1px;overflow:hidden;background-color:#c3cbd4}.dropdown-menu .info,.dropdown-menu .title{color:#6b7785}.dropdown-menu ul li.info:not(:first-child){border-top:1px solid #c3cbd4}.dropdown-menu ul{list-style:none;margin:0;border-radius:1px;background-color:#fff}.dropdown-menu ul:after,.dropdown-menu ul:before{display:table;content:"";line-height:0}.dropdown-menu ul:after{clear:both}.dropdown-menu ul{overflow-x:hidden;overflow-y:auto;max-width:100%;max-height:270px;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:0}.dropdown-menu ul+ul{margin-top:-1px}.dropdown-menu ul+ul li.title:first-child,.dropdown-menu ul+ul li:first-child>a{border-top:1px solid #c3cbd4}.dropdown-menu .arrow+ul,.dropdown-menu .arrow+ul>li:first-child>a{border-top-left-radius:1px;border-top-right-radius:1px;border-top:none}.dropdown-menu ul:last-of-type,.dropdown-menu ul:last-of-type>li:last-of-type>a{border-bottom-left-radius:1px;border-bottom-right-radius:1px}.dropdown-menu a .icon-check{position:absolute;left:5px;top:5px;color:#00a4fd}.dropdown-menu [class*=" icon-"],.dropdown-menu [class^=icon-]{width:1.25em;text-align:center}.dropdown-menu li{position:relative}.dropdown-menu li.info{padding:5px 10px}.dropdown-menu li.title{text-transform:uppercase;padding:3px 10px}.dropdown-menu li.message{padding:5px 10px}.dropdown-menu li>span.field-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;word-wrap:normal}.dropdown-menu li>a{display:block;clear:both;font-weight:400;line-height:20px;position:relative;color:#5c6773;padding:5px 10px;white-space:normal;text-decoration:none}.dropdown-menu li>a>.info{display:block;font-size:12px}.dropdown-menu li>a:focus{border-collapse:separate;outline:0;text-decoration:none}.dropdown-menu li>a:focus,.dropdown-menu li>a:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.dropdown-menu li>a:focus{-webkit-box-shadow:inset 0 0 2px 1px #fff,inset 0 0 0 2px #00a4fd;box-shadow:inset 0 0 2px 1px #fff,inset 0 0 0 2px #00a4fd}.dropdown-menu li>a:hover{color:#5c6773;background:#f2f4f5}.dropdown-menu li>a.primary-link{margin-right:40px;border-top-right-radius:0;border-bottom-right-radius:0}.dropdown-menu li>a.secondary-link{position:absolute;right:0;top:0;bottom:0;width:40px;padding-left:0;padding-right:0;font-size:16px;text-align:center;border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-menu li>a>.link-description{color:#6b7785;display:block;font-size:.85em}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover,.dropdown-menu li>a.disabled,.dropdown-menu li>a.disabled:focus,.dropdown-menu li>a.disabled:hover{color:#c3cbd4;cursor:not-allowed;text-decoration:none;background-color:transparent;background-image:none;-webkit-box-shadow:none;box-shadow:none}.dropdown-menu .divider{border:none;border-top:1px solid #c3cbd4;margin:0;height:0}.dropdown-menu .divider+li>a{border-top:none}.dropdown-menu .input-container .shared-findinput{width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;padding:5px;margin:0}.dropdown-menu .input-container .search-query{width:100%}.dropdown-truncated li>a{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dropdown-menu-narrow{width:10em}.dropdown-menu-medium{width:25em}.dropdown-menu-wide{width:30em}.dropdown-menu-width-auto{width:auto;max-width:20em}.dropdown-menu-width-auto.dropdown-menu-narrow{max-width:10em}.dropdown-menu-width-auto.dropdown-menu-medium{max-width:25em}.dropdown-menu-width-auto.dropdown-menu-wide{max-width:30em}.dropdown-menu-selectable li>a{padding-left:24px}.navbar .nav>li>.dropdown-menu:after,.navbar .nav>li>.dropdown-menu:before{display:none}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#6b7785}.dropdown-menu-tall ul{max-height:20em;overflow:auto}.dropdown-menu-short ul{max-height:10em;overflow:auto}.dropdown-menu-noscroll ul{max-height:none}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}.dropdown-submenu{position:relative}.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;border-radius:2px 2px 2px 2px}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropdown-submenu:focus>a,.dropdown-submenu:hover>a{text-decoration:none;color:#006eaa;background:#f7f8fa}.dropdown-submenu>a{paddin-right:20px}.dropdown-submenu>a:after{display:block;content:"";position:absolute;right:8px;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);width:0;height:0;border-color:transparent transparent transparent #ccc;border-style:solid;border-width:5px 0 5px 5px}.dropdown-submenu>ul{overflow-x:hidden;overflow-y:auto}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;border-radius:6px 0 6px 6px}.dropup .dropdown-submenu>.dropdown-menu{top:auto;bottom:0;margin-top:0;margin-bottom:-2px;border-radius:5px 5px 5px 0}.dropdown .dropdown-menu .nav-header{padding-left:20px;padding-right:20px}.typeahead{z-index:1051;margin-top:2px;border-radius:3px}.fade{opacity:0;-webkit-transition:opacity .125s;transition:opacity .125s}.fade.in{opacity:1}.collapse{position:relative;height:0;overflow:hidden;-webkit-transition:height .2s ease;transition:height .2s ease}.collapse.in{height:auto}.close{float:right;border-radius:3px;width:27px;height:27px;color:transparent;font-size:0;line-height:0;text-align:center;-webkit-transition:background .2s,color .2s;transition:background .2s,color .2s}.close:before{font-family:Splunk Icons;content:"\2717";font-size:20px;color:#5c6773;line-height:28px;-webkit-transition:color .2s;transition:color .2s}.close:hover{background-color:#f7f8fa;cursor:pointer;text-decoration:none}.close:hover:before{color:#006eaa}.close:focus{-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0;text-decoration:none}.close:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.close:focus:before{color:#006eaa}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.btn{display:inline-block;height:auto;line-height:20px;font-size:14px;-webkit-box-sizing:border-box;box-sizing:border-box;padding:5px 14px;margin-bottom:0;font-weight:400;text-align:center;vertical-align:middle;cursor:pointer;border-radius:3px;white-space:nowrap;background-color:#f7f8fa;border:1px solid #c3cbd4}.btn,.btn:hover{color:#5c6773;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);text-decoration:none;text-shadow:none;-webkit-transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;-webkit-filter:none;filter:none}.btn:hover{background-color:#ebeeef;border-color:#c3cbd4}.btn:focus{background-color:#f7f8fa;border-color:#c3cbd4;color:#5c6773;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);text-shadow:none;-webkit-transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;-webkit-filter:none;filter:none;-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0;text-decoration:none}.btn:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.btn.active,.btn:active{background-color:#e1e6eb;border-color:#c3cbd4;color:#3c444d;-webkit-box-shadow:none;box-shadow:none;text-decoration:none;text-shadow:none;-webkit-transition:none;transition:none;-webkit-filter:none;filter:none}.btn.disabled,.btn.disabled:active,.btn.disabled:focus,.btn.disabled:hover,.btn[disabled],.btn[disabled]:active,.btn[disabled]:focus,.btn[disabled]:hover{background-color:#f7f8fa;border-color:#e1e6eb;color:#6b7785;-webkit-box-shadow:inset 0 -1px 0 #e1e6eb;box-shadow:inset 0 -1px 0 #e1e6eb;text-decoration:none;text-shadow:none;-webkit-transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;-webkit-filter:none;filter:none;cursor:not-allowed}.btn-primary{padding:6px 15px;font-weight:500;background-color:#5cc05c;border:transparent}.btn-primary,.btn-primary:hover{color:#fff;-webkit-box-shadow:inset 0 -2px 0 rgba(0,0,0,.1);box-shadow:inset 0 -2px 0 rgba(0,0,0,.1);text-decoration:none;text-shadow:none;-webkit-transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;-webkit-filter:none;filter:none}.btn-primary:hover{background-color:#40a540;border-color:transparent}.btn-primary:focus{background-color:#5cc05c;border-color:transparent;color:#fff;-webkit-box-shadow:inset 0 -2px 0 rgba(0,0,0,.1);box-shadow:inset 0 -2px 0 rgba(0,0,0,.1);text-shadow:none;-webkit-transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;-webkit-filter:none;filter:none;-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0;text-decoration:none}.btn-primary:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.btn-primary.active,.btn-primary:active{background-color:#389038;color:#fff;-webkit-box-shadow:none;box-shadow:none}.btn-primary.active,.btn-primary.disabled,.btn-primary.disabled:active,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary:active,.btn-primary[disabled],.btn-primary[disabled]:active,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover{border-color:transparent;text-decoration:none;text-shadow:none;-webkit-transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;-webkit-filter:none;filter:none}.btn-primary.disabled,.btn-primary.disabled:active,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled],.btn-primary[disabled]:active,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover{background-color:#9ed99e;color:#dff2df;-webkit-box-shadow:inset 0 -2px 0 rgba(0,0,0,.1);box-shadow:inset 0 -2px 0 rgba(0,0,0,.1);cursor:not-allowed}.btn-secondary{font-weight:500}.btn-secondary:hover{background-color:#ebeeef}.btn-secondary:focus,.btn-secondary:hover{border-color:#c3cbd4;color:#5c6773;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);text-decoration:none;text-shadow:none;-webkit-transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;-webkit-filter:none;filter:none}.btn-secondary:focus{background-color:#f7f8fa;-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0}.btn-secondary:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.btn-secondary.active,.btn-secondary:active{background-color:#e1e6eb;border-color:#c3cbd4;color:#3c444d;-webkit-box-shadow:none;box-shadow:none;text-decoration:none;text-shadow:none;-webkit-transition:none;transition:none;-webkit-filter:none;filter:none}.btn-secondary.disabled,.btn-secondary.disabled:active,.btn-secondary.disabled:focus,.btn-secondary.disabled:hover,.btn-secondary[disabled],.btn-secondary[disabled]:active,.btn-secondary[disabled]:focus,.btn-secondary[disabled]:hover{background-color:#f7f8fa;border-color:#e1e6eb;color:#6b7785;-webkit-box-shadow:inset 0 -1px 0 #e1e6eb;box-shadow:inset 0 -1px 0 #e1e6eb;cursor:not-allowed}.btn-pill,.btn-secondary.disabled,.btn-secondary.disabled:active,.btn-secondary.disabled:focus,.btn-secondary.disabled:hover,.btn-secondary[disabled],.btn-secondary[disabled]:active,.btn-secondary[disabled]:focus,.btn-secondary[disabled]:hover{text-decoration:none;text-shadow:none;-webkit-transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;-webkit-filter:none;filter:none}.btn-pill{display:inline-block;padding:5px 14px;line-height:20px;border-radius:3px;background-color:none;border:1px solid transparent;color:#5c6773;-webkit-box-shadow:none;box-shadow:none}.btn-pill:hover{color:#006eaa;background:#ebeeef;border-color:#c3cbd4;text-decoration:none}.btn-pill:focus{color:#5c6773;background:none;border-color:transparent;-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0;text-decoration:none}.btn-pill:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.btn-pill.active,.btn-pill:active{color:#5c6773;background:#e1e6eb;border-color:transparent;text-decoration:none}.btn-pill.disabled,.btn-pill.disabled:active,.btn-pill.disabled:focus,.btn-pill.disabled:hover,.btn-pill[disabled],.btn-pill[disabled]:active,.btn-pill[disabled]:focus,.btn-pill[disabled]:hover{color:#c3cbd4;background:none;border-color:transparent;text-decoration:none;-webkit-box-shadow:none;box-shadow:none;cursor:not-allowed}.btn-link{background-color:transparent;border-color:transparent;color:#006eaa;-webkit-box-shadow:none;box-shadow:none;text-decoration:none;text-shadow:none;-webkit-transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;-webkit-filter:none;filter:none}.btn-link:hover{color:#006eaa;text-decoration:underline}.btn-link:focus{color:#006eaa;-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0;text-decoration:none}.btn-link:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.btn-link.active,.btn-link:active{color:#006eaa;text-decoration:none}.btn-link.disabled,.btn-link.disabled:active,.btn-link.disabled:focus,.btn-link.disabled:hover,.btn-link[disabled],.btn-link[disabled]:active,.btn-link[disabled]:focus,.btn-link[disabled]:hover{color:#6b7785;text-decoration:none;cursor:not-allowed}.btn-block{display:block;width:100%;padding-left:0;padding-right:0;-webkit-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.btn-draggable{cursor:move;width:150px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;-webkit-box-sizing:border-box;box-sizing:border-box}.btn-draggable .before,.btn-draggable:before{content:"";float:left;margin-left:-8px;height:18px;width:6px;background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Cpath fill='%23818D99' d='M0 0h2v2H0z'/%3E%3C/svg%3E");cursor:move}.btn-draggable.btn-small:before{height:14px}.btn-draggable.btn-mini:before{height:12px}.btn-large{padding:8px 28px}.btn-large [class*=" icon-"],.btn-large [class^=icon-]{margin-top:4px}.btn-large.btn-primary{padding:9px 29px}.btn-small{padding:3px 14px}.btn-small [class*=" icon-"],.btn-small [class^=icon-]{margin-top:0}.btn-small.btn-primary{padding:4px 15px}.btn-mini{padding:0 7px}.btn-mini [class*=" icon-"],.btn-mini [class^=icon-]{margin-top:-1px}.btn-mini.btn-primary{padding:1px 8px}.btn-group>.btn-mini,.btn-mini{font-size:12px;font-weight:500;line-height:18px}.btn-square{padding:6px 0;height:32px;width:32px;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box}@media print{.btn{background:none!important;border:none!important;padding:0!important;color:#3c444d!important;text-shadow:none!important;-webkit-box-shadow:none!important;box-shadow:none!important}.caret{display:none!important}}.btn-combo,.btn-group{position:relative;display:inline-block;font-size:0;white-space:nowrap;vertical-align:middle}.btn-combo+.btn-combo,.btn-group+.btn-group{margin-left:10px}.btn-group>.btn,.btn-group>.btn-combo>.btn{position:relative;border-radius:0}.btn-group>.btn+.btn,.btn-group>.btn+.btn-combo,.btn-group>.btn-combo+.btn,.btn-group>.btn-combo+.btn-combo{margin-left:-1px}.btn-group .btn-pill,.btn-group .dropdown-toggle,.btn-group .popdown-dialog,.btn-group>.btn,.btn-group>.btn-large,.btn-group>.btn-small,.btn-group>.dropdown-menu,.btn-group>.popover,.btn-group ul{font-size:14px}.btn-group>.btn-mini{font-size:12px}.btn-group>.btn-combo:first-child>.btn:first-child,.btn-group>.btn-combo:first-child>.drodown-toggle,.btn-group>.btn:first-child{margin-left:0;border-top-left-radius:3px;border-bottom-left-radius:3px}.btn-group>.btn-combo:last-child>.btn:last-child,.btn-group>.btn-combo:last-child>.dropdown-toggle,.btn-group>.btn:last-child,.btn-group>.dropdown-toggle{border-top-right-radius:3px;border-bottom-right-radius:3px}.btn-group>.btn-combo:first-child>.btn.large:first-child,.btn-group>.btn.large:first-child{margin-left:0;border-top-left-radius:3px;border-bottom-left-radius:3px}.btn-group>.btn-combo:last-child>.btn.large:last-child,.btn-group>.btn-combo:last-child>.large.dropdown-toggle,.btn-group>.btn.large:last-child,.btn-group>.large.dropdown-toggle{border-top-right-radius:3px;border-bottom-right-radius:3px}.btn-group>.btn-combo>.btn.active,.btn-group>.btn-combo>.btn:active,.btn-group>.btn-combo>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:hover{z-index:2}.btn-group>.btn-combo>.btn:focus,.btn-group>.btn:focus{z-index:3}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-combo>.btn:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.btn-combo>.btn:last-child,.btn-combo>.dropdown-toggle{border-top-left-radius:0;border-bottom-left-radius:0}.btn-combo>.btn+.btn{margin-left:-1px}.btn-combo .btn-pill,.btn-combo .dropdown-toggle,.btn-combo .popdown-dialog,.btn-combo>.btn,.btn-combo>.btn-large,.btn-combo>.btn-small,.btn-combo>.dropdown-menu,.btn-combo ul{font-size:14px}.btn-combo>.btn-mini{font-size:12px}.btn-combo:first-child>.btn:first-child{margin-left:0;border-top-left-radius:3px;border-bottom-left-radius:3px}.btn-combo>.dropdown-toggle{border-top-right-radius:3px;border-bottom-right-radius:3px}.btn-toolbar{font-size:0;margin-top:10px;margin-bottom:10px}.btn-toolbar .btn-combo{display:inline-block}.btn-toolbar>.btn+.btn,.btn-toolbar>.btn+.btn-combo,.btn-toolbar>.btn+.btn-group,.btn-toolbar>.btn-combo+.btn,.btn-toolbar>.btn-group+.btn{margin-left:5px}.btn-combo>.btn+.dropdown-toggle,.btn-group>.btn-combo>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px;-webkit-box-shadow:inset 1px 0 0 hsla(0,0%,100%,.125),inset 0 1px 0 hsla(0,0%,100%,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 1px 0 0 hsla(0,0%,100%,.125),inset 0 1px 0 hsla(0,0%,100%,.2),0 1px 2px rgba(0,0,0,.05)}.btn-group>.btn-combo>.btn-mini+.dropdown-toggle,.btn-group>.btn-mini+.dropdown-toggle{padding-left:5px;padding-right:5px}.btn-group>.btn-combo>.btn-large+.dropdown-toggle,.btn-group>.btn-large+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.btn-group.open .btn.dropdown-toggle{background-color:#ebeeef}.btn-group.open .btn-primary.dropdown-toggle{background-color:#40a540}.btn-group.open .btn-danger.dropdown-toggle{background-color:#ea958d}.btn-group.open .btn-success.dropdown-toggle{background-color:#40a540}.btn-group>.btn+div.tooltip+.btn{margin-left:-1px}.btn-group-vertical{display:inline-block}.btn-group-vertical>.btn{display:block;float:none;max-width:100%;border-radius:0}.btn-group-vertical>.btn+.btn{margin-left:0;margin-top:-1px}.btn-group-vertical:first-child{border-radius:3px 3px 0 0}.btn-group-vertical:last-child{border-radius:0 0 3px 3px}.btn-group-vertical>.btn-large:first-child{border-radius:3px 3px 0 0}.btn-group-vertical>.btn-large:last-child{border-radius:0 0 3px 3px}.btn-group-radio>.btn{text-overflow:ellipsis;overflow:hidden;border-color:#c3cbd4}.btn-group-radio>.btn:hover{background-color:#ebeeef}.btn-group-radio>.btn.active,.btn-group-radio>.btn:hover{-webkit-box-shadow:inset 0 2px 0 #d8dfe6;box-shadow:inset 0 2px 0 #d8dfe6}.btn-group-radio>.btn.active{cursor:default;background-color:#e1e6eb;border-color:#c3cbd4}.btn-group-radio>.btn.active:focus{cursor:default;-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0;text-decoration:none}.btn-group-radio>.btn.active:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.btn-group-radio>.btn.active[disabled]{cursor:not-allowed;background-color:#e1e6eb;-webkit-box-shadow:inset 0 2px 0 #d8dfe6;box-shadow:inset 0 2px 0 #d8dfe6;border-color:#e1e6eb}.btn-group-radio>.btn:disabled{-webkit-box-shadow:none;box-shadow:none;border-color:#e1e6eb;background-color:#f7f8fa}body.locale-de .btn-group-radio.locale-responsive-layout{display:block}body.locale-de .btn-group-radio.locale-responsive-layout .btn{border-radius:0;display:block;width:100%;margin-left:0;border-bottom-width:0}body.locale-de .btn-group-radio.locale-responsive-layout .btn:first-child{border-radius:3px 3px 0 0}body.locale-de .btn-group-radio.locale-responsive-layout .btn:last-child{border-radius:0 0 3px 3px;border-bottom-width:1px}.alerts:not(.alerts-view){max-height:500px;overflow-y:auto}.alert{margin-bottom:20px;border-radius:3px;position:relative;padding:8px 35px 8px 27px;word-wrap:break-word;color:#3c444d}.alert .icon-alert{font-size:200%;position:absolute;left:0;top:8px}.alert h4{color:inherit;margin:0}.alert .close{position:relative;top:-2px;right:-21px;line-height:20px}.alert-inline{display:inline-block;border:0;margin-bottom:0}.alert-warning .icon-alert{color:#f8be34}.alert-info .icon-alert{color:#006d9c}.alert-info .icon-alert:before{content:"I"}.alert-success .icon-alert{color:#53a051}.alert-success .icon-alert:before{content:"I"}.alert-404,.alert-error .icon-alert{color:#dc4e41}.alert-404:before,.alert-error .icon-alert:before{content:"\ECE2"}.nav{margin-left:0;margin-bottom:0;list-style:none}.nav>li>a{display:block}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none}.nav>.pull-right{float:right}.nav-header{display:block;padding:3px 15px;font-size:12px;font-weight:700;line-height:20px;color:#818d99;text-shadow:0 1px 0 hsla(0,0%,100%,.5);text-transform:uppercase}.nav li+.nav-header{margin-top:9px}.nav-list{padding-left:15px;padding-right:15px;margin-bottom:0}.nav-list .nav-header,.nav-list>li>a{margin-left:-15px;margin-right:-15px;text-shadow:0 1px 0 hsla(0,0%,100%,.5)}.nav-list>li>a{padding:3px 15px}.nav-list>.active>a,.nav-list>.active>a:focus,.nav-list>.active>a:hover{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.2);background-color:#006eaa}.nav-list [class*=" icon-"],.nav-list [class^=icon-]{margin-right:2px}.nav-list .divider{height:1px;margin:9px 1px;overflow:hidden;background-color:#c3cbd4}.nav-pills:after,.nav-pills:before,.nav-tabs:after,.nav-tabs:before{display:table;content:"";line-height:0}.nav-pills:after,.nav-tabs:after{clear:both}.nav-pills>li,.nav-tabs>li{float:left}.nav-pills>li>a,.nav-tabs>li>a{padding-right:15px;padding-left:15px;margin-right:2px;line-height:14px}.nav-tabs{padding:0 5px;height:38px;background-color:#fff;border-bottom:1px solid #e1e6eb}.nav-tabs>li{position:relative}.nav-tabs>li>a{line-height:34px;padding:2px 15px;color:#5c6773}.nav-tabs>li>a:before{content:"";position:absolute;width:calc(100% - 30px);height:0;bottom:0;left:14px;background-color:#e1e6eb;-webkit-transition:height .2s;transition:height .2s}.nav-tabs>li>a:hover{background:transparent}.nav-tabs>li>a:focus{border-collapse:separate;outline:0;text-decoration:none}.nav-tabs>li>a:focus,.nav-tabs>li>a:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.nav-tabs>li>a:focus{-webkit-box-shadow:inset 0 0 2px 1px #fff,inset 0 0 0 2px #00a4fd;box-shadow:inset 0 0 2px 1px #fff,inset 0 0 0 2px #00a4fd;background-color:transparent;border-radius:3px}.nav-tabs>li:not(.active):hover>a:before{height:3px}.nav-tabs>li.active>a:before{height:3px;background-color:#007abd}.nav-tabs>li.active,.nav-tabs>li>a.active{-webkit-box-shadow:none!important;box-shadow:none!important;border-radius:0!important;font-weight:500;color:#3c444d}.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;border-radius:5px}.nav-pills>.active>a,.nav-pills>.active>a:focus,.nav-pills>.active>a:hover{color:#fff;background-color:#006eaa}.nav-stacked>li{float:none}.nav-stacked>li>a{margin-right:0}.nav-stacked>li.nav-tabs{border-bottom:0}.nav-stacked>li.nav-tabs>li>a{border:1px solid #c3cbd4;border-radius:0}.nav-stacked>li.nav-tabs>li>a:focus,.nav-stacked>li.nav-tabs>li>a:hover{border-color:#c3cbd4;z-index:2}.nav-stacked>li.nav-tabs>li:first-child>a{border-top-right-radius:3px;border-top-left-radius:3px}.nav-stacked>li.nav-tabs>li:last-child>a{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.nav-stacked>li.nav-pills>li>a{margin-bottom:3px}.nav-stacked>li.nav-pills>li:last-child>a{margin-bottom:1px}.nav-tabs .dropdown-menu{border-radius:0 0 3px 3px}.nav-pills .dropdown-menu{border-radius:3px}.nav .dropdown-toggle .caret{margin-top:6px}.nav .dropdown-toggle .caret,.nav .dropdown-toggle:focus .caret,.nav .dropdown-toggle:hover .caret{border-top-color:#006eaa;border-bottom-color:#006eaa}.nav-tabs .dropdown-toggle .caret{margin-top:8px}.nav .active .dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.nav-tabs .active .dropdown-toggle .caret{border-top-color:#5c6773;border-bottom-color:#5c6773}.nav>.dropdown.active>a:focus,.nav>.dropdown.active>a:hover{cursor:pointer}.nav-pills .open .dropdown-toggle,.nav-tabs .open .dropdown-toggle,.nav>li.dropdown.open.active>a:focus,.nav>li.dropdown.open.active>a:hover{color:#fff;background-color:#818d99;border-color:#818d99}.nav li.dropdown.open.active .caret,.nav li.dropdown.open .caret,.nav li.dropdown.open a:focus .caret,.nav li.dropdown.open a:hover .caret{border-top-color:#fff;border-bottom-color:#fff;opacity:1}.tabs-stacked .open>a:focus,.tabs-stacked .open>a:hover{border-color:#818d99}.tabbable:after,.tabbable:before{display:table;content:"";line-height:0}.tabbable:after{clear:both}.tab-content{overflow:auto}.tabs-below>.nav-tabs,.tabs-left>.nav-tabs,.tabs-right>.nav-tabs{border-bottom:0}.pill-content>.pill-pane,.tab-content>.tab-pane{display:none}.pill-content>.active,.tab-content>.active{display:block}.tabs-below>.nav-tabs{border-top:1px solid #c3cbd4}.tabs-below>.nav-tabs>li{margin-top:-1px;margin-bottom:0}.tabs-below>.nav-tabs>li>a{border-radius:0 0 3px 3px}.tabs-below>.nav-tabs>li>a:focus,.tabs-below>.nav-tabs>li>a:hover{border-bottom-color:transparent;border-top-color:#c3cbd4}.tabs-below>.nav-tabs>.active>a,.tabs-below>.nav-tabs>.active>a:focus,.tabs-below>.nav-tabs>.active>a:hover{border-color:transparent #c3cbd4 #c3cbd4}.tabs-left>li,.tabs-right>li{float:none}.tabs-left>li>a,.tabs-right>li>a{min-width:74px;margin-right:0;margin-bottom:3px}.tabs-left>.nav-tabs{float:left;margin-right:19px;border-right:1px solid #c3cbd4}.tabs-left>.nav-tabs>li>a{margin-right:-1px;border-radius:3px 0 0 3px}.tabs-left>.nav-tabs>li>a:focus,.tabs-left>.nav-tabs>li>a:hover{border-color:#e1e6eb #c3cbd4 #e1e6eb #e1e6eb}.tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:focus,.tabs-left>.nav-tabs .active>a:hover{border-color:#c3cbd4 transparent #c3cbd4 #c3cbd4}.tabs-right>.nav-tabs{float:right;margin-left:19px;border-left:1px solid #c3cbd4}.tabs-right>.nav-tabs>li>a{margin-left:-1px;border-radius:0 3px 3px 0}.tabs-right>.nav-tabs>li>a:focus,.tabs-right>.nav-tabs>li>a:hover{border-color:#e1e6eb #e1e6eb #e1e6eb #c3cbd4}.tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:focus,.tabs-right>.nav-tabs .active>a:hover{border-color:#c3cbd4 #c3cbd4 #c3cbd4 transparent}.nav-tabs .dropdown-toggle .caret,.nav .dropdown-toggle .caret,.navbar .nav .dropdown-toggle .caret{margin-top:0}.nav>.disabled>a{color:#c3cbd4}.nav>.disabled>a:focus,.nav>.disabled>a:hover{text-decoration:none;background-color:transparent;cursor:default}@media print{.app-bar,header{display:none!important}.main-tabs{border:none!important}.main-tabs li.active:after,.main-tabs li.active:before,.main-tabs li:not(.active){display:none!important}}.navbar{overflow:visible;margin-bottom:0}.navbar .container{width:auto}.navbar .brand{float:left;display:block;padding:7px 20px;margin-left:-20px;font-size:20px;font-weight:200;color:#006eaa;text-shadow:0 1px 0 #fff}.navbar .brand:focus,.navbar .brand:hover{text-decoration:none}.navbar .divider-vertical{height:34px;margin:0 9px;border-left:1px solid #171d21;border-right:1px solid #fff}.navbar .btn,.navbar .btn-group{margin-top:2px}.navbar .btn-group .btn,.navbar .input-append .btn,.navbar .input-append .btn-group,.navbar .input-prepend .btn,.navbar .input-prepend .btn-group{margin-top:0}.navbar-inner{min-height:34px;padding-left:20px;padding-right:20px;background-image:-webkit-gradient(linear,left top,left bottom,from(#fff),to(#171d21));background-image:linear-gradient(180deg,#fff,#171d21);border:1px solid #000;border-radius:3px;-webkit-box-shadow:0 1px 4px rgba(0,0,0,.065);box-shadow:0 1px 4px rgba(0,0,0,.065)}.navbar-inner:after,.navbar-inner:before{display:table;content:"";line-height:0}.navbar-inner:after{clear:both}.nav-collapse.collapse{height:auto;overflow:visible}.navbar-text{margin-bottom:0;line-height:34px}.navbar-link,.navbar-text{color:#c3cbd4}.navbar-link:focus,.navbar-link:hover{color:#3c444d}.navbar-form{margin-bottom:0}.navbar-form:after,.navbar-form:before{display:table;content:"";line-height:0}.navbar-form:after{clear:both}.navbar-form .checkbox,.navbar-form .radio,.navbar-form input,.navbar-form select{margin-top:2px}.navbar-form .btn,.navbar-form input,.navbar-form select{display:inline-block;margin-bottom:0}.navbar-form input[type=checkbox],.navbar-form input[type=image],.navbar-form input[type=radio]{margin-top:3px}.navbar-form .input-append,.navbar-form .input-prepend{margin-top:5px;white-space:nowrap}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0}.navbar-search{position:relative;float:left;margin-top:2px;margin-bottom:0}.navbar-search .search-query{margin-bottom:0;padding:4px 14px;font-family:Georgia,Times New Roman,Times,serif;font-size:13px;font-weight:400;line-height:1;border-radius:15px}.navbar-static-top{position:static;margin-bottom:0}.navbar-static-top .navbar-inner{border-radius:0}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0}.navbar-fixed-bottom .navbar-inner,.navbar-fixed-top .navbar-inner{padding-left:0;padding-right:0;border-radius:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{border-width:0 0 1px;-webkit-box-shadow:0 1px 10px rgba(0,0,0,.1);box-shadow:0 1px 10px rgba(0,0,0,.1)}.navbar-fixed-top{top:0}.navbar-fixed-bottom{bottom:0}.navbar-fixed-bottom .navbar-inner{border-width:1px 0 0;-webkit-box-shadow:0 -1px 10px rgba(0,0,0,.1);box-shadow:0 -1px 10px rgba(0,0,0,.1)}.navbar-fixed-bottom .container,.navbar-fixed-top .container,.navbar-static-top .container{width:940px}.navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0}.navbar .nav.pull-right{float:right;margin-right:0}.navbar .nav>li{float:left}.navbar .nav>li>a{float:none;padding:7px 15px;color:#c3cbd4;text-decoration:none;text-shadow:0 1px 0 #fff}.navbar .nav>li>a:focus,.navbar .nav>li>a:hover{background-color:transparent;color:#3c444d;text-decoration:none}.navbar .nav>li>.dropdown-menu:before{content:"";display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #c3cbd4;position:absolute;top:-7px;left:9px}.navbar .nav>li>.dropdown-menu:after{content:"";display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #fff;position:absolute;top:-6px;left:10px}.navbar .nav>li.dropdown>a:focus .caret,.navbar .nav>li.dropdown>a:hover .caret{border-top-color:#3c444d;border-bottom-color:#3c444d}.navbar .nav>li.dropdown.active>.dropdown-toggle,.navbar .nav>li.dropdown.open.active>.dropdown-toggle,.navbar .nav>li.dropdown.open>.dropdown-toggle{background-color:#0d1012;color:#5c6773}.navbar .nav>li.dropdown.active>.dropdown-toggle .caret,.navbar .nav>li.dropdown.open.active>.dropdown-toggle .caret,.navbar .nav>li.dropdown.open>.dropdown-toggle .caret{border-top-color:#5c6773;border-bottom-color:#5c6773}.navbar .nav>li.dropdown>.dropdown-toggle .caret{border-top-color:#c3cbd4;border-bottom-color:#c3cbd4}.navbar .nav .dropdown-toggle .caret{margin-top:8px}.navbar .nav>.active>a,.navbar .nav>.active>a:focus,.navbar .nav>.active>a:hover{color:#5c6773;text-decoration:none;background-color:#0d1012;-webkit-box-shadow:inset 0 3px 8px rgba(0,0,0,.125);box-shadow:inset 0 3px 8px rgba(0,0,0,.125)}.navbar .btn-navbar{display:none;float:right;padding:7px 10px;margin-left:5px;margin-right:5px;background-color:#f7f8fa;border-color:#c3cbd4;color:#5c6773;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);text-decoration:none;text-shadow:none;-webkit-transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;-webkit-filter:none;filter:none;-webkit-box-shadow:inset 0 1px 0 hsla(0,0%,100%,.1),0 1px 0 hsla(0,0%,100%,.075);box-shadow:inset 0 1px 0 hsla(0,0%,100%,.1),0 1px 0 hsla(0,0%,100%,.075)}.navbar .btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,.25);box-shadow:0 1px 0 rgba(0,0,0,.25)}.navbar .btn-navbar .icon-bar+.icon-bar{margin-top:3px}.navbar .nav>li>.dropdown-menu.pull-right,.navbar .pull-right>li>.dropdown-menu{left:auto;right:0}.navbar .nav>li>.dropdown-menu.pull-right:before,.navbar .pull-right>li>.dropdown-menu:before{left:auto;right:12px}.navbar .nav>li>.dropdown-menu.pull-right:after,.navbar .pull-right>li>.dropdown-menu:after{left:auto;right:13px}.navbar .nav>li>.dropdown-menu.pull-right .dropdown-menu,.navbar .pull-right>li>.dropdown-menu .dropdown-menu{left:auto;right:100%;margin-left:0;margin-right:-1px;border-radius:6px 0 6px 6px}.navbar-fixed-bottom .nav>li>.dropdown-menu:before{border-top:7px solid #c3cbd4;border-bottom:0;bottom:-7px;top:auto}.navbar-fixed-bottom .nav>li>.dropdown-menu:after{border-top:6px solid #fff;border-bottom:0;bottom:-6px;top:auto}.pagination{height:auto}.pagination>ul{display:inline-block;margin-left:0;margin-bottom:0;list-style:none}.pagination>ul>li{float:left}.pagination>ul>li>a,.pagination>ul>li>span{padding:5px 14px;float:left;line-height:20px;border-radius:3px;background-color:none;border:1px solid transparent;color:#5c6773;-webkit-box-shadow:none;box-shadow:none;text-decoration:none;text-shadow:none;-webkit-transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;-webkit-filter:none;filter:none}.pagination>ul>li>a:hover,.pagination>ul>li>span:hover{color:#006eaa;background:#ebeeef;border-color:#c3cbd4;text-decoration:none}.pagination>ul>li>a:focus,.pagination>ul>li>span:focus{color:#006eaa;background:none;border-color:transparent;-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0;text-decoration:none}.pagination>ul>li>a:focus:active:not([disabled]),.pagination>ul>li>span:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.pagination>ul>li>a.active,.pagination>ul>li>a:active,.pagination>ul>li>span.active,.pagination>ul>li>span:active{color:#5c6773;background:#e1e6eb;border-color:transparent;text-decoration:none}.pagination>ul>li>a.disabled,.pagination>ul>li>a.disabled:active,.pagination>ul>li>a.disabled:focus,.pagination>ul>li>a.disabled:hover,.pagination>ul>li>a[disabled],.pagination>ul>li>a[disabled]:active,.pagination>ul>li>a[disabled]:focus,.pagination>ul>li>a[disabled]:hover,.pagination>ul>li>span.disabled,.pagination>ul>li>span.disabled:active,.pagination>ul>li>span.disabled:focus,.pagination>ul>li>span.disabled:hover,.pagination>ul>li>span[disabled],.pagination>ul>li>span[disabled]:active,.pagination>ul>li>span[disabled]:focus,.pagination>ul>li>span[disabled]:hover{color:#c3cbd4;background:none;border-color:transparent;text-decoration:none;-webkit-box-shadow:none;box-shadow:none;cursor:not-allowed}.pagination>ul>li>a:not(.page-controls),.pagination>ul>li>span:not(.page-controls){padding:5px 10px;margin:0 1px}.pagination>ul>li>a:not(.page-controls).btn-square,.pagination>ul>li>span:not(.page-controls).btn-square{padding:5px 0}.pagination>ul .active>a,.pagination>ul .active>a:hover{cursor:default;border:1px solid #007abd;color:#007abd}.pagination>ul .icon-chevron-left,.pagination>ul .icon-triangle-left-small{padding-right:6.66667px}.pagination>ul .icon-chevron-right,.pagination>ul .icon-triangle-right-small{padding-left:6.66667px}.pagination>ul>.disabled>a,.pagination>ul>.disabled>a:focus,.pagination>ul>.disabled>a:hover,.pagination>ul>.disabled>span{background-color:transparent;border-color:transparent;color:#c3cbd4;cursor:default;-webkit-box-shadow:none;box-shadow:none}.pagination .max-events-per-bucket{color:#f8be34;font-size:18px}.splunk-paginator.splunk-view{padding:0 10px}.splunk-paginator.splunk-view .disabled,.splunk-paginator.splunk-view a.selected{color:#c3cbd4;cursor:default}.splunk-paginator.splunk-view a.selected{color:#006eaa;border:1px solid #006eaa;background:transparent}.splunk-paginator.splunk-view a{border:1px solid transparent;border-radius:3px;color:#5c6773;padding:2px 8px;text-decoration:none;min-width:10px;line-height:20px;display:inline-block;text-align:center}.splunk-paginator.splunk-view a:hover{background:#f7f8fa}.splunk-paginator.splunk-view a:disabled{background:none}.splunk-paginator.splunk-view span{padding-left:5px;padding-right:5px}.pager{margin:20px 0;list-style:none;text-align:center}.pager:after,.pager:before{display:table;content:"";line-height:0}.pager:after{clear:both}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #c3cbd4;border-radius:15px}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#f7f8fa}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{text-decoration:none;background-color:#f7f8fa}.body-modal-open{overflow:hidden}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#3c444d}.modal-backdrop.fade{opacity:0}.modal-backdrop,.modal-backdrop.fade.in{opacity:.8}.modal{position:fixed;top:40px;left:50%;width:550px;margin-left:-275px}.modal .form-horizontal{width:550px;-webkit-box-sizing:border-box;box-sizing:border-box}.modal{z-index:1050;background-color:#fff;border:none;-webkit-box-shadow:0 3px 7px rgba(0,0,0,.3);box-shadow:0 3px 7px rgba(0,0,0,.3);background-clip:border-box;outline:none}.modal.fade{-webkit-transition:opacity .125s,top .125s ease;transition:opacity .125s,top .125s ease;top:0}.modal.fade.in{top:40px}.modal:after{content:"";font-size:0;display:inline;overflow:hidden}.modal-header{border:none;position:relative;background:#fff;padding:20px}.modal-header .modal-title,.modal-header h1,.modal-header h3{font-size:20px;font-weight:500;line-height:22px;margin:0;overflow-wrap:break-word;padding-right:40px}.modal-header .close{top:20px;right:20px;margin-top:-2px;position:absolute;background-color:none;border:1px solid transparent;color:#5c6773;-webkit-box-shadow:none;box-shadow:none;text-decoration:none;text-shadow:none;-webkit-transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;-webkit-filter:none;filter:none}.modal-header .close:hover{color:#006eaa;background:#ebeeef;border-color:#c3cbd4;text-decoration:none}.modal-header .close:focus{color:#006eaa;background:none;border-color:transparent;-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0;text-decoration:none}.modal-header .close:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.modal-header .close.active,.modal-header .close:active{color:#5c6773;background:#e1e6eb;border-color:transparent;text-decoration:none}.modal-header .close.disabled,.modal-header .close.disabled:active,.modal-header .close.disabled:focus,.modal-header .close.disabled:hover,.modal-header .close[disabled],.modal-header .close[disabled]:active,.modal-header .close[disabled]:focus,.modal-header .close[disabled]:hover{color:#c3cbd4;background:none;border-color:transparent;text-decoration:none;-webkit-box-shadow:none;box-shadow:none;cursor:not-allowed}.modal-body{position:relative;padding:0 20px;overflow:visible;max-height:calc(100vh - 246px)}.modal-body:last-child{max-height:calc(100vh - 259px)}.modal-form{margin-bottom:0}.modal-body-scrolling{overflow-y:auto;padding:20px;position:relative;border-top:1px solid #e1e6eb;border-bottom:1px solid #e1e6eb}.modal-footer{padding:20px;margin-bottom:0;text-align:right;background:#fff}.modal-footer:after,.modal-footer:before{display:table;content:"";line-height:0}.modal-footer:after{clear:both}.modal-footer>.btn{min-width:80px}.modal-footer>.btn+.btn:not(.pull-left){margin-left:10px;margin-bottom:0}.modal-footer>.btn-group .btn+.btn{margin-left:-1px}.modal-footer>.btn-block+.btn-block{margin-left:0}.modal-footer:empty{padding:0}.modal-wide{width:800px;margin-left:-400px}.modal-wide .form-horizontal{width:800px;-webkit-box-sizing:border-box;box-sizing:border-box}.modal.disconnection-warning-modal{z-index:1090}.shared-splunkbar-messages-noconnectionoverlay .modal-backdrop{z-index:1080}.modal-loading{text-align:center;color:#6b7785}.shared-whatsnewdialog.modal{width:900px;margin-left:-450px}.shared-whatsnewdialog.modal .modal-body{padding-right:0}.shared-whatsnewdialog h2{font-weight:200;font-size:24px;margin:0 0 20px -20px;padding-left:20px}.shared-whatsnewdialog .feature{display:inline-block;width:260px;margin:0 20px 20px 0;position:relative;vertical-align:top}.shared-whatsnewdialog .feature>h3{margin:0 0 5px}.shared-whatsnewdialog .feature>img{display:block;width:100%;height:170px;border:1px solid #c3cbd4;margin-bottom:10px}.shared-whatsnewdialog .feature>p{margin:0}.shared-whatsnewdialog .feature+h2{padding-top:20px;border-top:1px dotted #c3cbd4}.tooltip{position:absolute;z-index:1070;display:block;visibility:visible;font-size:12px;line-height:1.4;opacity:0}.tooltip.in{opacity:.85}.tooltip.top{margin-top:-3px;padding:5px 0}.tooltip.right{margin-left:3px;padding:0 5px}.tooltip.bottom{margin-top:3px;padding:5px 0}.tooltip.left{margin-left:-3px;padding:0 5px}.tooltip-inner{max-width:200px;padding:6px 12px;color:#fff;text-align:center;text-decoration:none;background-color:#000}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.thumbnails{margin-left:-20px;list-style:none}.thumbnails:after,.thumbnails:before{display:table;content:"";line-height:0}.thumbnails:after{clear:both}.row-fluid .thumbnails{margin-left:0}.thumbnails>li{float:left;margin-bottom:20px;margin-left:20px}.thumbnail{display:block;padding:4px;line-height:20px;border:1px solid #ddd;border-radius:3px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.055);box-shadow:0 1px 3px rgba(0,0,0,.055);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.thumbnail:focus,a.thumbnail:hover{border-color:#006eaa;-webkit-box-shadow:0 1px 4px rgba(0,105,214,.25);box-shadow:0 1px 4px rgba(0,105,214,.25)}.thumbnail>img{display:block;max-width:100%;margin-left:auto;margin-right:auto}.thumbnail .caption{padding:9px;color:#5c6773}.badge,.label{display:inline-block;padding:2px 4px;font-size:11.844px;font-weight:700;line-height:14px;color:#fff;vertical-align:baseline;white-space:nowrap;text-shadow:0 -1px 0 rgba(0,0,0,.25);background-color:#818d99}.label{border-radius:3px}.badge{padding-left:9px;padding-right:9px;border-radius:9px}.badge:empty,.label:empty{display:none}a.badge:focus,a.badge:hover,a.label:focus,a.label:hover{color:#fff;text-decoration:none;cursor:pointer}.badge-important,.label-important{background-color:#f8dcd9}.badge-important[href],.label-important[href]{background-color:#f0b4ad}.badge-warning,.label-warning{background-color:#f1813f}.badge-warning[href],.label-warning[href]{background-color:#ed6212}.badge-success,.label-success{background-color:#53a051}.badge-success[href],.label-success[href]{background-color:#417d3f}.badge-info,.label-info{background-color:#006d9c}.badge-info[href],.label-info[href]{background-color:#004b6b}.badge-inverse,.label-inverse{background-color:#3c444d}.badge-inverse[href],.label-inverse[href]{background-color:#262b31}.btn .badge,.btn .label{position:relative;top:-1px}.btn-mini .badge,.btn-mini .label{top:0}.label{padding:1px 4px 0;border-radius:4px;line-height:17px;font-size:12px;font-weight:400;text-transform:uppercase;color:#3c444d;text-shadow:none;background-color:#c3cbd4;border:1px solid #3c444d}.label [class*=icon-]{font-size:16px;margin-right:3px;vertical-align:middle}.label-important{background-color:#f8dcd9;border-color:#dc4e41;color:#dc4e41}.label-warning{background-color:#fdefe7;border-color:#f1813f;color:#f1813f}.label-success{background-color:#ddecdd;border-color:#53a051;color:#53a051}.label-info{background-color:#fef2d7;border-color:#f8be34;color:#f8be34}.label-inverse{background-color:#5c6773;border-color:#3c444d;color:#fff}@-webkit-keyframes progress-bar-stripes{0%{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{0%{background-position:40px 0}to{background-position:0 0}}.spinner-small{background-image:url(/en-US/static/@000.148/img/skins/default/loading_small.png);background-position:0 0;width:14px;height:14px;background-size:280px 14px}.spinner-medium{background-image:url(/en-US/static/@000.148/img/skins/default/loading_medium.png);background-position:0 0;width:19px;height:19px;background-size:380px 19px}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){.spinner-small{background-image:url(/en-US/static/@000.148/img/skins/default/loading_small_2x.png)}.spinner-medium{background-image:url(/en-US/static/@000.148/img/skins/default/loading_medium_2x.png)}}.progress{overflow:hidden;height:20px;margin-bottom:20px;background-image:-webkit-gradient(linear,left top,left bottom,from(#f5f5f5),to(#f9f9f9));background-image:linear-gradient(180deg,#f5f5f5,#f9f9f9);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1);background-color:#f7f8fa;border-radius:3px}.progress .bar,.progress .progress-bar{width:0;height:100%;color:#fff;float:left;font-size:12px;text-align:center;-webkit-transition:width .6s ease;transition:width .6s ease}.progress .bar{background-color:#007abd;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-box-sizing:border-box;box-sizing:border-box}.progress .bar+.bar{-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,.15),inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 1px 0 0 rgba(0,0,0,.15),inset 0 -1px 0 rgba(0,0,0,.15)}.progress .progress-bar{line-height:20px;background-color:#c3cbd4}.progress .progress-striped.progress-bar{background-color:#c3cbd4}.progress-striped .bar,.progress .progress-striped.progress-bar{background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent);background-size:40px 40px}.progress-striped .bar{background-color:#007abd}.active.progress-bar,.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-danger .bar,.progress .bar-danger{background:#dc4e41}.progress-danger.progress-striped .bar,.progress-striped .bar-danger{background-color:#dc4e41;background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent)}.progress-success .bar,.progress .bar-success{background:#53a051}.progress-striped .bar-success,.progress-success.progress-striped .bar{background-color:#53a051;background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent)}.progress-info .bar,.progress .bar-info{background:#006d9c}.progress-info.progress-striped .bar,.progress-striped .bar-info{background-color:#006d9c;background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent)}.progress-warning .bar,.progress .bar-warning{background:#f1813f}.progress-striped .bar-warning,.progress-warning.progress-striped .bar{background-color:#f1813f;background-image:linear-gradient(45deg,hsla(0,0%,100%,.15) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.15) 0,hsla(0,0%,100%,.15) 75%,transparent 0,transparent)}.accordion{margin-bottom:0;background:#fff}.accordion-heading{border-bottom:0;position:relative}.accordion-heading .accordion-toggle{display:block;padding:5px 14px 5px 30px;line-height:20px;background-color:#f2f4f5;color:#5c6773;text-decoration:none;-webkit-transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;-webkit-filter:none;filter:none;cursor:pointer}.accordion-heading .accordion-toggle .icon-triangle-right-small:before{content:"\203A"}.accordion-heading .accordion-toggle .icon-triangle-down-small:before{content:"\2C5"}.accordion-group{margin-bottom:2px;border:none;border-radius:0}.accordion-group:first-child .accordion-toggle{border-top:none}.accordion-group.active:last-child .accordion-body,.accordion-group:last-child .accordion-toggle{border-bottom:none}.accordion-group .accordion-toggle:focus{-webkit-box-shadow:none;box-shadow:none;border-collapse:separate;outline:0;text-decoration:none}.accordion-group .accordion-toggle:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.accordion-group .accordion-toggle:focus{-webkit-box-shadow:inset 0 0 2px 1px #f2f4f5,inset 0 0 0 2px #00a4fd;box-shadow:inset 0 0 2px 1px #f2f4f5,inset 0 0 0 2px #00a4fd}.accordion-group.active .accordion-toggle{background:#fff;border-bottom:none;cursor:default}.accordion-group.active .accordion-toggle:focus{-webkit-box-shadow:none;box-shadow:none;border-collapse:separate;outline:0;text-decoration:none}.accordion-group.active .accordion-toggle:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.accordion-group.active .accordion-toggle:focus{-webkit-box-shadow:inset 0 0 2px 1px #fff,inset 0 0 0 2px #00a4fd;box-shadow:inset 0 0 2px 1px #fff,inset 0 0 0 2px #00a4fd}.accordion-group:not(.active) .accordion-toggle:hover{background-color:#e1e6eb;-webkit-box-shadow:none;box-shadow:none}.accordion-group:not(.active) .accordion-toggle:hover:focus{-webkit-box-shadow:none;box-shadow:none;border-collapse:separate;outline:0;text-decoration:none}.accordion-group:not(.active) .accordion-toggle:hover:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.accordion-group:not(.active) .accordion-toggle:hover:focus{-webkit-box-shadow:inset 0 0 2px 1px #e1e6eb,inset 0 0 0 2px #00a4fd;box-shadow:inset 0 0 2px 1px #e1e6eb,inset 0 0 0 2px #00a4fd}.icon-accordion-toggle{position:absolute;left:10px}.accordion-body{background-color:#fff}.accordion-inner{padding:10px 20px 20px;border:none}.accordion-inner:after,.accordion-inner:before{display:table;content:"";line-height:0}.accordion-inner:after{clear:both}.accordion-inner,.carousel{position:relative}.carousel{margin-bottom:20px;line-height:1}.carousel-inner{overflow:hidden;width:100%;position:relative}.carousel-inner>.item{display:none;position:relative;-webkit-transition:left .6s ease-in-out;transition:left .6s ease-in-out}.carousel-inner>.item>a>img,.carousel-inner>.item>img{display:block;line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.active,.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left,.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#fff;text-align:center;background:#171d21;border:3px solid #fff;border-radius:23px;opacity:.5}.carousel-control.right{left:auto;right:15px}.carousel-control:focus,.carousel-control:hover{color:#fff;text-decoration:none;opacity:.9}.carousel-indicators{position:absolute;top:15px;right:15px;z-index:5;margin:0;list-style:none}.carousel-indicators li{display:block;float:left;width:10px;height:10px;margin-left:5px;text-indent:-999px;background-color:#c3cbd4;background-color:hsla(0,0%,100%,.25);border-radius:5px}.carousel-indicators .active{background-color:#fff}.carousel-caption{position:absolute;left:0;right:0;bottom:0;padding:15px;background:#3c444d;background:rgba(0,0,0,.75)}.carousel-caption h4,.carousel-caption p{color:#fff;line-height:20px}.carousel-caption h4{margin:0 0 5px}.carousel-caption p{margin-bottom:0}.pull-right{float:right}.pull-left{float:left}.hide{display:none}.show{display:block}.invisible{visibility:hidden}.affix{position:fixed}.clearfix:after,.clearfix:before{display:table;content:"";line-height:0}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0;position:absolute;width:0}.input-block-level{display:block;width:100%;min-height:32px;-webkit-box-sizing:border-box;box-sizing:border-box}.visuallyhidden{clip:rect(0 0 0 0);position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;border:0}.ui-widget{font-family:inherit}.ui-widget-header{font-weight:400;background:transparent;border:0;color:#3c444d}.ui-widget-header a{color:#000}.ui-corner-all{border-radius:2px}.ui-icon{font-family:Splunk Icons;width:20px;height:20px}.ui-tabs .ui-widget-header{background:none;border-bottom:1px solid #c3cbd4;border-radius:0}.ui-tabs .ui-tabs-nav li{margin-bottom:-1px}.ui-tabs .ui-tabs-nav li,.ui-tabs .ui-tabs-nav li.ui-tabs-selected{border-bottom:1px solid #c3cbd4!important}.ui-accordion .ui-accordion-header .ui-icon{left:.5em;margin-top:-8px;position:absolute;top:50%}.ui-accordion-icons .ui-accordion-header a{padding-left:2.2em}#ui-datepicker-div{display:none;z-index:1070!important}.ui-datepicker{border:1px solid #c3cbd4;-webkit-box-shadow:1px 2px 5px rgba(0,0,0,.2);box-shadow:1px 2px 5px rgba(0,0,0,.2);border-radius:2px;top:100%;left:50%;margin:8px 0 0 -103px;display:none;position:absolute;z-index:1059;white-space:normal}.ui-datepicker .arrow{border-bottom:8px solid #c3cbd4;top:-8px;left:50%;margin-left:-4px}.ui-datepicker .arrow,.ui-datepicker .arrow:before{position:absolute;height:0;width:0;border-left:8px solid transparent;border-right:8px solid transparent;content:"";display:block;border-top:0}.ui-datepicker .arrow:before{border-bottom:8px solid #fff;top:1px;left:-8px}.ui-datepicker.up{margin-top:0}.ui-datepicker.up>.arrow{border-top:8px solid #c3cbd4;bottom:-8px}.ui-datepicker.up>.arrow,.ui-datepicker.up>.arrow:before{position:absolute;height:0;width:0;border-left:8px solid transparent;border-right:8px solid transparent;content:"";display:block;border-bottom:0;top:auto}.ui-datepicker.up>.arrow:before{border-top:8px solid #fff;bottom:1px}.ui-datepicker.right{margin-left:5px;margin-top:0}.ui-datepicker.right .arrow{border-right:8px solid #c3cbd4;left:-8px}.ui-datepicker.right .arrow,.ui-datepicker.right .arrow:before{position:absolute;height:0;width:0;border-bottom:8px solid transparent;border-top:8px solid transparent;content:"";display:block;border-left:0;top:50%;margin:-8px 0 0}.ui-datepicker.right .arrow:before{border-right:8px solid #fff;left:1px}.ui-datepicker.pull-right .arrow{left:auto;right:8px}.ui-datepicker.open{display:block}.ui-datepicker{background-color:#fff;width:17em;height:auto;position:relative;padding:5px;margin:0}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0;background:transparent}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:32px;text-align:center}.ui-datepicker .ui-datepicker-next,.ui-datepicker .ui-datepicker-prev{position:absolute;text-decoration:none}.ui-datepicker .ui-datepicker-next .ui-icon,.ui-datepicker .ui-datepicker-prev .ui-icon{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0;position:absolute;width:0;left:0}.ui-datepicker .ui-datepicker-next .ui-icon:after,.ui-datepicker .ui-datepicker-prev .ui-icon:after{display:block;position:absolute;top:0;left:0;text-align:center;width:32px;line-height:32px;color:#5c6773;text-indent:0;font-size:12px;font-family:Splunk Icons}.ui-datepicker .ui-datepicker-prev .ui-icon:after{content:"\25C0"}.ui-datepicker .ui-datepicker-next{top:0;right:0}.ui-datepicker .ui-datepicker-next .ui-icon:after{content:"\25B6"}.ui-datepicker table{width:100%;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker .ui-datepicker-calendar{margin:0}.ui-datepicker .ui-datepicker-calendar th{line-height:10px;padding:20px .3em .7em;color:#6b7785;text-align:center;border:0;font-weight:400}.ui-datepicker .ui-datepicker-calendar td{padding:1px}.ui-datepicker .ui-datepicker-calendar td a{display:block;padding:.2em;text-align:right;color:#5c6773}.ui-datepicker .ui-datepicker-calendar a{border:1px solid #c3cbd4}.ui-datepicker .ui-datepicker-calendar a:hover{text-decoration:none}.ui-datepicker .ui-datepicker-calendar .ui-state-default{background:#fff;border:1px solid #c3cbd4;color:#5c6773}.ui-datepicker .ui-datepicker-calendar .ui-state-active{background-color:#f7f8fa;border-color:#007abd;color:#006eaa}.ui-datepicker .ui-datepicker-calendar .ui-state-hover{border-color:#00a4fd;background:#f7f8fa;color:#006eaa}.ui-datepicker a.ui-corner-all{display:inline-block;padding:5px 14px;border-radius:3px;background-color:none;border-color:transparent;color:#5c6773;-webkit-box-shadow:none;box-shadow:none;text-decoration:none;text-shadow:none;-webkit-transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;-webkit-filter:none;filter:none}.ui-datepicker a.ui-corner-all:hover{text-decoration:none}.ui-datepicker a.ui-corner-all:focus{color:#006eaa;text-decoration:underline;-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0;text-decoration:none}.ui-datepicker a.ui-corner-all:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.ui-datepicker a.ui-corner-all.active,.ui-datepicker a.ui-corner-all:active{color:#006eaa;text-decoration:none}.ui-datepicker a.ui-corner-all.disabled,.ui-datepicker a.ui-corner-all.disabled:active,.ui-datepicker a.ui-corner-all.disabled:focus,.ui-datepicker a.ui-corner-all.disabled:hover,.ui-datepicker a.ui-corner-all[disabled],.ui-datepicker a.ui-corner-all[disabled]:active,.ui-datepicker a.ui-corner-all[disabled]:focus,.ui-datepicker a.ui-corner-all[disabled]:hover{color:#c3cbd4;text-decoration:none;cursor:not-allowed}.ui-datepicker a.ui-corner-all{width:32px;height:32px;text-align:center;padding:0}.ui-datepicker a.ui-corner-all:hover{cursor:pointer;color:#006eaa;background:#f7f8fa;font-weight:400}.ui-datepicker a.ui-corner-all:hover .ui-icon:after{color:#006eaa}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;z-index:99999;display:block}.ui-resizable-autohide .ui-resizable-handle,.ui-resizable-disabled .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-resizable-handle{width:100%;height:9px;background-color:transparent;z-index:1000;cursor:ns-resize;cursor:row-resize;bottom:0}.ui-resizable-handle:before{content:"";position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);margin-top:-1px;display:block;border-radius:3px;border:none;height:6px;width:6px;background-color:rgba(0,0,0,.25)}.ui-resizable-handle .ui-draggable-dragging{position:relative}.ui-resizable:hover .ui-resizable-handle{visibility:visible}
\ No newline at end of file
diff --git a/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/contrib/dashboard-simple-bootstrap.min.css b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/contrib/dashboard-simple-bootstrap.min.css
new file mode 100644
index 00000000..5c632f83
--- /dev/null
+++ b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/contrib/dashboard-simple-bootstrap.min.css
@@ -0,0 +1 @@
+.leaflet-container{z-index:1}.dashboard-wrapper{padding-top:20px}.dashboard-body{padding:0 20px 15px;background-color:#f2f4f5;min-height:500px}.preload .dashboard-row,.preload .fieldset,.preload .preload-hidden{display:none}.preload .dashboard-header:after{content:"Loading...";margin:auto;padding:50px 0}.progress-bar{top:0;bottom:auto}.dashboard-header{margin-bottom:10px;padding-top:10px;min-height:28px}.dashboard-header h2{font-size:24px}.dashboard-header .untitled{font-style:italic}.dashboard-header .edit-dashboard-menu{padding:2px 0 0 20px}.dashboard-header .edit-dashboard-menu .dashboard-source-type{float:right}.dashboard-header .edit-dashboard-menu .tooltip-inner{white-space:normal}.dashboard-header p.description{margin:0 200px 0 0}.dashboard-header .edit-done{margin-left:10px}.dashboard-header .dashboard-menu .edit-btn,.dashboard-header .dashboard-menu .edit-export{margin-right:5px}.dashboard-header .dashboard-menu .edit-other{font-size:18px}.alert-box i{left:20px}.alert-box{padding:14px 14px 14px 45px;position:relative;line-height:1.2;margin-bottom:5px;z-index:10}.dashboard-error .alert i{left:20px}.dashboard-error .alert{padding:14px 14px 14px 45px;position:relative;line-height:1.2;z-index:10;margin:100px 50px}.empty-dashboard{padding:100px 50px}.empty-dashboard .alert i{left:20px}.empty-dashboard .alert{padding:14px 14px 14px 45px;position:relative;line-height:1.2;margin-bottom:5px;z-index:10}#dashboard-editor{width:100%;min-height:500px;height:100%}.add-content-master{width:300px}.add-content-master .header input{border-radius:15px}.add-content-master .header .clear-filter{position:relative;left:-20px;border-radius:5px;height:10px;width:10px;display:inline-block;color:inherit}.add-content-master .header .clear-filter i{font-size:8px;position:relative;top:-4px;left:2px}.add-content-master .panel-contents{width:100%;display:inline-block;overflow-y:auto;position:absolute;top:75px;bottom:0;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.add-content-master .panel-contents .accordion-group{border-left:none;border-right:none;border-top:none;border-radius:0;margin:0}.add-content-master .panel-contents .accordion-group .collapse:not(.in){visibility:hidden;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.add-content-master .panel-contents .accordion-group .collapse.in{visibility:visible}.add-content-master .panel-contents .accordion-group .accordion-toggle:before{content:"\2C5";font-family:Splunk Icons;font-style:normal;font-weight:400;text-decoration:inherit;display:inline-block;width:13px}.add-content-master .panel-contents .accordion-group .accordion-toggle.collapsed:before{content:"\203A"}.add-content-master .panel-contents .accordion-group .accordion-inner{border-top:none;padding:0}.add-content-master .panel-contents a:hover{text-decoration:none;background:#f7f8fa}.add-content-master .panel-contents ul{margin:0;list-style:none}.add-content-master .panel-contents ul li.panel-content{position:relative}.add-content-master .panel-contents ul li.panel-content a{position:relative;padding:7px 10px 7px 31px;overflow:hidden;text-overflow:ellipsis;line-height:16px;display:block;white-space:nowrap;color:#3c444d}.add-content-master .panel-contents ul li.panel-content a:focus{-webkit-box-shadow:none;box-shadow:none;border-collapse:separate;outline:0;text-decoration:none}.add-content-master .panel-contents ul li.panel-content a:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.add-content-master .panel-contents ul li.panel-content a:focus{-webkit-box-shadow:inset 0 0 2px 1px #006eaa,inset 0 0 0 2px #00a4fd;box-shadow:inset 0 0 2px 1px #006eaa,inset 0 0 0 2px #00a4fd}.add-content-master .panel-contents ul li.panel-content a .icons{position:relative;top:2px;font-size:14px;width:40px;text-align:center;margin-left:-15px;display:inline-block}.add-content-master .panel-contents ul li.panel-content a .icons i{margin-right:3px}.add-content-master .panel-contents ul li.panel-content a .icons i.icon-plus{font-size:12px}.add-content-master .panel-contents ul li.panel-content .accordion-group ul a{padding-left:48px}.add-content-master .panel-contents ul li.clone-error a,.add-content-master .panel-contents ul li.parser-error a{cursor:default}.add-content-master .panel-contents ul li.selected a{background:#007abd}.add-content-name.tooltip{word-break:break-all}.sidebar .header{padding:10px;height:55px}.sidebar .header h3{margin-top:0;margin-bottom:3px}.sidebar .footer{position:absolute;bottom:0}.sidebar .content-title-control{margin-top:10px}.sidebar .shared-timerangepicker .btn .time-label{display:inline;vertical-align:baseline}.sidebar .time-range-scope{margin-bottom:0}.sidebar .time-range-scope .controls{float:left;margin-right:10px}.sidebar .preview-body .dashboard-cell{width:100%}.sidebar .preview-body .dashboard-cell .dashboard-panel{margin-right:0}.sidebar .preview-body .shared-controls-textareacontrol textarea{height:80px}.sidebar .preview-body .view-results{visibility:hidden}.time-range-scope .controls{margin-bottom:10px}.input.hidden{display:none}.edit-mode .input.hidden{display:inline-block}.form-settings{float:right}.edit-mode .dashboard-header .title-editor{display:block;width:100%;background-color:transparent}.edit-mode .dashboard-header .title-editor:focus,.edit-mode .dashboard-header .title-editor:hover{background-color:#ebeeef}.edit-mode .dashboard-header .title-editor{line-height:normal}.edit-mode .dashboard-header .label-editor{font-size:24px;font-weight:200;margin-bottom:0}.edit-mode .dashboard-header .description-editor{height:26px;word-break:break-all}.edit-mode .title-editor{-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;box-sizing:border-box;height:auto;border-color:transparent;font-size:inherit;font-weight:inherit}.edit-mode .title-editor:hover:not(:focus){border-color:#c3cbd4;-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa}.edit-mode .title-editor:focus{-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0;text-decoration:none}.edit-mode .title-editor:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.edit-mode .dashboard-row .dashboard-panel h2.panel-title{padding:3px 50px 3px 5px;height:27px;border-bottom:1px solid #c3cbd4}.edit-mode .dashboard-row .dashboard-panel h2.panel-title>.title-editor{font-size:inherit;color:inherit;text-transform:inherit;margin-bottom:5px;padding:4px 6px;width:100%;margin-right:60px;border-color:transparent}.edit-mode .dashboard-row .dashboard-panel h2.panel-title>.title-editor:hover:not(:focus){border-color:#c3cbd4}.edit-mode .dashboard-row .dashboard-panel h2.panel-title>.title-editor:focus{-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0;text-decoration:none}.edit-mode .dashboard-row .dashboard-panel h2.panel-title>.title-editor:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.edit-mode .dashboard-row .dashboard-panel .dashboard-element-editor{position:relative}.edit-mode .dashboard-row .dashboard-panel .panel-element-row{border-top:1px solid #c3cbd4}.edit-mode .dashboard-row .dashboard-panel .dashboard-panel-editor{position:absolute;right:0;top:16px}.edit-mode .dashboard-row .dashboard-panel .dashboard-panel-editor .dropdown-toggle{border-radius:0;display:inline-block;padding:0 10px;line-height:27px;-webkit-box-shadow:none!important;box-shadow:none!important}.edit-mode .dashboard-row .dashboard-panel .dashboard-panel-editor .dropdown-toggle>[class^=icon-]{font-size:1.5em}.edit-mode .dashboard-row .dashboard-panel .dashboard-panel-editor .dropdown-toggle .caret{padding-left:.15em;vertical-align:middle}.edit-mode .dashboard-row .dashboard-panel .dashboard-panel-editor .panel-type-label{padding:3px 10px;text-transform:uppercase}.view-mode .dashboard-panel h2.panel-title.empty{display:none}.view-mode .dashboard-element.table{margin-top:-1px}.edit-mode .dashboard-row{margin-right:-10px}.dashboard-row:after,.dashboard-row:before{display:table;content:"";line-height:0}.dashboard-row:after{clear:both}.dashboard-row .dashboard-cell{float:left}.dashboard-row .dashboard-panel{background:#fff;margin:0 5px 5px 0;position:relative}.dashboard-row .dashboard-panel:after,.dashboard-row .dashboard-panel:before{display:table;content:"";line-height:0}.dashboard-row .dashboard-panel:after{clear:both}.dashboard-row .dashboard-panel h2.panel-title{font-size:16px;line-height:1;font-weight:400;margin:0;padding:12px 55px 7px 12px;word-wrap:break-word;text-rendering:auto}.dashboard-row .dashboard-panel .panel-element-row{clear:both}.dashboard-row .dashboard-panel .panel-element-row div.single{float:left;min-width:200px}.dashboard-row .dashboard-panel .panel-element-row .table{margin-bottom:0}.dashboard-row .dashboard-panel .panel-title.empty+.fieldset.empty+.panel-element-row{border-top:none}.dashboard-row .dashboard-panel .dashboard-element{position:relative}.dashboard-row .dashboard-panel .dashboard-element:hover .ui-resizable-handle{display:block;visibility:visible}.dashboard-row .dashboard-panel .dashboard-element .ui-resizable-handle{display:none;margin-bottom:-1px;position:absolute}.dashboard-row .dashboard-panel .dashboard-element .ui-resizable-handle:before{background-color:#e1e6eb}.dashboard-row .dashboard-panel .dashboard-element .panel-footer{clear:both}.dashboard-row .dashboard-panel .panel-head h3{line-height:1;margin:0;padding:12px 55px 10px 12px;text-rendering:auto;word-wrap:break-word;font-weight:700;font-size:14px}.dashboard-row .dashboard-panel .panel-footer{clear:both}.dashboard-row .dashboard-panel .panel-footer:after,.dashboard-row .dashboard-panel .panel-footer:before{display:table;content:"";line-height:0}.dashboard-row .dashboard-panel .panel-footer:after{clear:both}.dashboard-row .dashboard-panel .panel-footer{height:0;overflow:hidden}.dashboard-row .dashboard-panel .dashboard-element:hover .panel-footer,.dashboard-row .dashboard-panel .panel-footer.show{-webkit-box-sizing:border-box;box-sizing:border-box;height:30px;padding:5px 15px 5px 12px;border-top:none;margin:0 0 -30px;background-color:hsla(0,0%,87.8%,.9);position:relative;z-index:3}.dashboard-row .dashboard-panel .view-results .inspector-link{display:inline-block;margin-right:20px}.dashboard-row .dashboard-panel .view-results .btn-pill{padding:0;height:20px;line-height:20px;width:22px;font-size:15px;text-align:center}.dashboard-row .dashboard-panel .view-results .btn-pill+.btn-pill{margin-left:0}.dashboard-row .dashboard-panel .panel-body{overflow:hidden;clear:both}.dashboard-row .dashboard-panel .panel-body.html,.dashboard-row .dashboard-panel .panel-body.splunk-html{padding:10px}.dashboard-row .dashboard-panel .panel-body.html .splunk-checkbox,.dashboard-row .dashboard-panel .panel-body.html .splunk-checkboxgroup,.dashboard-row .dashboard-panel .panel-body.html .splunk-dropdown,.dashboard-row .dashboard-panel .panel-body.html .splunk-multidropdown,.dashboard-row .dashboard-panel .panel-body.html .splunk-radiogroup,.dashboard-row .dashboard-panel .panel-body.html .splunk-textinput,.dashboard-row .dashboard-panel .panel-body.html .splunk-timerange,.dashboard-row .dashboard-panel .panel-body.html p,.dashboard-row .dashboard-panel .panel-body.splunk-html .splunk-checkbox,.dashboard-row .dashboard-panel .panel-body.splunk-html .splunk-checkboxgroup,.dashboard-row .dashboard-panel .panel-body.splunk-html .splunk-dropdown,.dashboard-row .dashboard-panel .panel-body.splunk-html .splunk-multidropdown,.dashboard-row .dashboard-panel .panel-body.splunk-html .splunk-radiogroup,.dashboard-row .dashboard-panel .panel-body.splunk-html .splunk-textinput,.dashboard-row .dashboard-panel .panel-body.splunk-html .splunk-timerange,.dashboard-row .dashboard-panel .panel-body.splunk-html p{padding:0}.dashboard-row .dashboard-panel .panel-body .splunk-paginator{float:right;padding-right:15px;padding-top:3px}.dashboard-row .dashboard-panel .panel-body .splunk-paginator:empty{height:0;padding:0;margin:0}.dashboard-row .dashboard-panel .panel-body .results-table table tr>td:first-child,.dashboard-row .dashboard-panel .panel-body .results-table table tr>th:first-child,.dashboard-row .dashboard-panel .panel-body .table-row-expanding>tbody>tr>td.expands a,.dashboard-row .dashboard-panel .panel-body .table-row-expanding th.col-info{padding-left:12px}.dashboard-row .dashboard-panel .panel-body .results-table table tr>td:last-child,.dashboard-row .dashboard-panel .panel-body .results-table table tr>th:last-child,.dashboard-row .dashboard-panel .panel-body .table td:last-child,.dashboard-row .dashboard-panel .panel-body .table th:last-child{padding-right:12px}.dashboard-row .dashboard-panel .panel-body .results-table table tr>th:last-child .btn-col-format{margin-right:-12px}.dashboard-row .dashboard-panel .panel-body .lazy-view-container.loading .alert.alert-info i,.dashboard-row .dashboard-panel .panel-body .splunk-message-container .alert.alert-info i,.dashboard-row .dashboard-panel .panel-body .visualization-message .alert.alert-info i{display:none}.dashboard-row .dashboard-panel .panel-body .lazy-view-container.loading .alert .icon-alert,.dashboard-row .dashboard-panel .panel-body .splunk-message-container .alert .icon-alert,.dashboard-row .dashboard-panel .panel-body .visualization-message .alert .icon-alert{float:none;position:static;margin-right:.25em;vertical-align:middle}.dashboard-row .dashboard-panel .panel-body .lazy-view-container.loading .alert,.dashboard-row .dashboard-panel .panel-body .splunk-message-container .alert,.dashboard-row .dashboard-panel .panel-body .visualization-message .alert{text-align:center;border-style:none;font-size:13px}.dashboard-row .dashboard-panel .panel-body .lazy-view-container.loading.compact .alert,.dashboard-row .dashboard-panel .panel-body .splunk-message-container.compact .alert,.dashboard-row .dashboard-panel .panel-body .visualization-message.compact .alert{padding-top:4px;padding-bottom:4px;margin-bottom:0;text-align:left;display:inline}.dashboard-row .dashboard-panel .panel-body .lazy-view-container.loading.compact .alert .icon-alert,.dashboard-row .dashboard-panel .panel-body .splunk-message-container.compact .alert .icon-alert,.dashboard-row .dashboard-panel .panel-body .visualization-message.compact .alert .icon-alert{font-size:150%;top:4px}.dashboard-row .dashboard-panel .panel-body .lazy-view-container.loading,.dashboard-row .dashboard-panel .panel-body .visualization-message{padding-top:54px}.dashboard-row .dashboard-panel .panel-body .splunk-single{min-height:40px;text-align:center}.dashboard-row .dashboard-panel .panel-body .splunk-table:after,.dashboard-row .dashboard-panel .panel-body .splunk-table:before{display:table;content:"";line-height:0}.dashboard-row .dashboard-panel .panel-body .splunk-table:after{clear:both}.dashboard-row .dashboard-panel .panel-body .splunk-table .splunk-paginator{float:right;padding-right:15px}.dashboard-row .dashboard-panel .panel-body p{padding:0 10px}.dashboard-row .dashboard-panel .panel-body .splunk-checkbox,.dashboard-row .dashboard-panel .panel-body .splunk-checkboxgroup,.dashboard-row .dashboard-panel .panel-body .splunk-dropdown,.dashboard-row .dashboard-panel .panel-body .splunk-multidropdown,.dashboard-row .dashboard-panel .panel-body .splunk-radiogroup,.dashboard-row .dashboard-panel .panel-body .splunk-searchbar,.dashboard-row .dashboard-panel .panel-body .splunk-textinput,.dashboard-row .dashboard-panel .panel-body>.splunk-timerange,.dashboard-row .dashboard-panel .panel-body>button{margin:5px 10px}.dashboard-row .dashboard-panel .shared-eventsviewer{border-left:none}.dashboard-row .dashboard-panel ul.shared-eventsviewer{margin-bottom:5px;border-top-style:none}.dashboard-row .dashboard-panel .error-details{display:block;float:right;padding:9px 12px 5px 5px}.dashboard-row .dashboard-panel .error-details i{color:#f8be34}.dashboard-row .dashboard-panel .error-details.severe i{color:#dc4e41}.dashboard-row .dashboard-panel .error-details.severe .error-indicator:hover i{color:#e0ac16;color:#c84535}.dashboard-row .dashboard-panel .error-details .error-indicator{padding:0;height:20px;line-height:20px;width:22px;font-size:15px;text-align:center;border-radius:3px;margin-left:3px}.dashboard-row .dashboard-panel .error-details .error-indicator:hover{background-color:#ebeeef}.dashboard-row .dashboard-panel .error-details .error-indicator i{font-size:18px}.dashboard-row .dashboard-panel .error-details .error-indicator{display:block}.dashboard-row .dashboard-panel .error-details li{padding:5px 10px 5px 25px;position:relative}.dashboard-row .dashboard-panel .error-details li:first-child{border-top:none}.dashboard-row .dashboard-panel .error-details li>i{font-size:18px;position:absolute;left:3px;top:5px}.dashboard-row .dashboard-panel .error-details li.warning>i{color:#f8be34}.dashboard-row .dashboard-panel .error-details li.error>i{color:#dc4e41}.dashboard-row .dashboard-panel .progress-bar .progress-msg{font-size:12px;display:inline-block}.view-mode .refresh-time-indicator{padding:0 10px;z-index:10}.view-mode .refresh-time-indicator .time-freshness{font-size:12px;cursor:default;padding:0;margin:0}.view-mode .refresh-time-indicator{height:24px}.view-mode .with-title .fieldset.empty+.panel-element-row:not(.grouped) .error-details{position:absolute;top:-31px;right:0}.view-mode .element-footer{border-bottom:1px solid transparent}.view-mode .element-footer .menus{display:none;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;position:absolute;right:10px;background-color:#fff;border:1px solid #c3cbd4;border-top:none;margin-top:-1px;padding-left:5px;padding-bottom:2px;border-bottom-left-radius:5px;border-bottom-right-radius:5px;border-top-left-radius:2px;border-top-right-radius:2px;z-index:999}.view-mode .element-footer .menus .btn-pill{width:15px;height:22px;border-radius:0;padding:0 4px;position:relative;line-height:22px;font-size:15px}.view-mode .element-footer .menus .btn-pill i{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.view-mode .element-footer .menus .refresh-time-indicator{display:inline}.view-mode .dashboard-element.active .element-footer{border-bottom:1px solid #c3cbd4}.view-mode .dashboard-element.active .element-footer .menus{display:-webkit-box;display:-ms-flexbox;display:flex}.dashboard-cell.hidden,.dashboard-row.hidden,.edit-mode .element-footer,.edit-mode .refresh-time-indicator,.preview-body .element-footer{display:none}.edit-mode .dashboard-cell.hidden,.edit-mode .dashboard-row.hidden{display:block}.edit-mode .dashboard-cell.hidden .dashboard-panel,.edit-mode .dashboard-row.hidden .dashboard-panel{border-style:dashed}.dashboard-element.hidden{display:none}.edit-mode .dashboard-element.hidden{display:block}.edit-mode .dashboard-element.hidden .panel-body,.edit-mode .dashboard-element.hidden .panel-footer{opacity:.5}.edit-mode .dashboard-element.hidden .panel-head h3{color:#c3cbd4}.edit-mode .dashboard-element.hidden .panel-editor{z-index:99}.dashboard-panel>.drag-handle{height:8px;margin:5px 5px 0;cursor:move;z-index:3}.dashboard-panel>.drag-handle .handle-inner{background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Cpath fill='%23818D99' d='M0 0h2v2H0z'/%3E%3C/svg%3E");cursor:move;height:8px;margin-right:14px}.dashboard-panel>.drag-handle>.delete-panel{display:inline-block;float:right;font-size:17px;padding:0 3px;margin-right:-3px;margin-top:-4px;color:#6b7785}.dashboard-panel>.drag-handle>.delete-panel:focus,.dashboard-panel>.drag-handle>.delete-panel:hover{text-decoration:none;color:#006eaa}.dashboard-panel>.drag-handle>.delete-panel:hover{background:#f7f8fa}.dashboard-panel>.drag-handle>.delete-panel:focus{background-color:rgba(0,164,253,.1);-webkit-box-shadow:none;box-shadow:none;outline:none}.initial-placeholder{height:234px}.initial-placeholder.placeholder-visualizations-singlevalue{height:80px}.dragndrop-enabled .dashboard-row.empty{min-height:20px}.dragndrop-enabled .dashboard-row .dashboard-panel.drag-hover{border-color:#c3cbd4}.dragndrop-enabled .dashboard-row .panel-head h3{padding:11px 15px 8px}.dragndrop-enabled .dashboard-row .panel-element-row+.panel-element-row .panel-head{border-top:1px solid #c3cbd4}.dragndrop-enabled .dashboard-row .dashboard-panel .panel-body .splunk-message-container .alert .icon-alert{color:#dc4e41}.dragndrop-enabled .sortable-placeholder{min-width:10px;float:left}.dragndrop-enabled .sortable-placeholder .dashboard-panel{min-height:200px;background:transparent;border:1px dashed #c3cbd4;-webkit-box-shadow:none;box-shadow:none}.dragndrop-enabled .dashboard-cell{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.dragndrop-enabled .dashboard-cell.ui-sortable-helper .dashboard-panel{-webkit-box-shadow:2px 2px 5px inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 2px 2px 5px 0 -1px 0 rgba(0,0,0,.1)}.dragndrop-enabled .dashboard-row{min-height:100px}.dragndrop-enabled .shared-eventsviewer .table-chrome{border-top:none}.html h1{font-size:20px;font-weight:700}.html h2{font-size:16px;margin:10px 0;font-weight:400}.html h3{font-size:14px;font-weight:700}.html h4{font-size:12px;font-weight:700;margin:0}.html h5{font-size:10.2px}.html .panel-head>h3{font-size:16px;font-weight:400}.view-mode .dashboard-row .dashboard-cell.last-visible .dashboard-panel,.view-mode .dashboard-row .dashboard-cell:last-child .dashboard-panel{margin-right:0}.more-info{width:400px}.more-info .popdown-dialog-body{padding:20px 20px 10px}.splunk-radiogroup .choice{margin-bottom:5px}.splunk-radiogroup input{margin:0 10px 0 2px}.splunk-radiogroup label{display:inline-block;margin-bottom:0;vertical-align:middle}.splunk-radiogroup input[type=radio]{margin:4px;font-size:16px;height:12px;opacity:.01}.splunk-radiogroup input[type=radio]+.radio-label,.splunk-radiogroup input[type=radio]+label{position:relative}.splunk-radiogroup input[type=radio]+.radio-label:after,.splunk-radiogroup input[type=radio]+.radio-label:before,.splunk-radiogroup input[type=radio]+label:after,.splunk-radiogroup input[type=radio]+label:before{content:"";display:inline-block;position:absolute;border-radius:100%}.splunk-radiogroup input[type=radio]+.radio-label:before,.splunk-radiogroup input[type=radio]+label:before{top:-2px;left:-24px;height:16px;width:16px;vertical-align:bottom;background-color:#f7f8fa;border:1px solid #c3cbd4;color:#5c6773;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);text-decoration:none;text-shadow:none;-webkit-transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;-webkit-filter:none;filter:none}.splunk-radiogroup input[type=radio]+.radio-label:after,.splunk-radiogroup input[type=radio]+label:after{top:3px;left:-19px;height:8px;width:8px;background:transparent;vertical-align:bottom}.splunk-radiogroup input[type=radio]+.radio-label:hover:before,.splunk-radiogroup input[type=radio]+label:hover:before{background-color:#ebeeef;border-color:#c3cbd4;color:#5c6773;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,.1);text-decoration:none;text-shadow:none;-webkit-transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;-webkit-filter:none;filter:none}.splunk-radiogroup input[type=radio]+.radio-label:active:before,.splunk-radiogroup input[type=radio]+label:active:before{background-color:#e1e6eb;border-color:#c3cbd4;color:#3c444d;-webkit-box-shadow:none;box-shadow:none;text-decoration:none;text-shadow:none;-webkit-transition:none;transition:none;-webkit-filter:none;filter:none}.splunk-radiogroup input[type=radio]+.radio-label+input[type=radio],.splunk-radiogroup input[type=radio]+label+input[type=radio]{margin-left:20px}.splunk-radiogroup input[type=radio]:checked+.radio-label:after,.splunk-radiogroup input[type=radio]:checked+label:after{background:#3c444d}.splunk-radiogroup input[type=radio]:focus,.splunk-radiogroup input[type=radio]:focus:hover{-webkit-box-shadow:none;box-shadow:none}.splunk-radiogroup input[type=radio]:focus+.radio-label:before,.splunk-radiogroup input[type=radio]:focus+.radio-label:hover:before,.splunk-radiogroup input[type=radio]:focus+label:before,.splunk-radiogroup input[type=radio]:focus+label:hover:before,.splunk-radiogroup input[type=radio]:focus:hover+.radio-label:before,.splunk-radiogroup input[type=radio]:focus:hover+.radio-label:hover:before,.splunk-radiogroup input[type=radio]:focus:hover+label:before,.splunk-radiogroup input[type=radio]:focus:hover+label:hover:before{-webkit-box-shadow:0 0 1px 3px #006eaa;box-shadow:0 0 1px 3px #006eaa;border-collapse:separate;outline:0;text-decoration:none}.splunk-radiogroup input[type=radio]:focus+.radio-label:before:active:not([disabled]),.splunk-radiogroup input[type=radio]:focus+.radio-label:hover:before:active:not([disabled]),.splunk-radiogroup input[type=radio]:focus+label:before:active:not([disabled]),.splunk-radiogroup input[type=radio]:focus+label:hover:before:active:not([disabled]),.splunk-radiogroup input[type=radio]:focus:hover+.radio-label:before:active:not([disabled]),.splunk-radiogroup input[type=radio]:focus:hover+.radio-label:hover:before:active:not([disabled]),.splunk-radiogroup input[type=radio]:focus:hover+label:before:active:not([disabled]),.splunk-radiogroup input[type=radio]:focus:hover+label:hover:before:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.splunk-radiogroup input[type=radio][disabled]+.radio-label:before,.splunk-radiogroup input[type=radio][disabled]+label:before{background-color:#f7f8fa;border-color:#e1e6eb;color:#6b7785;-webkit-box-shadow:inset 0 -1px 0 #e1e6eb;box-shadow:inset 0 -1px 0 #e1e6eb;text-decoration:none;text-shadow:none;-webkit-transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s;transition:background .2s,border .2s,box-shadow .2s,text-decoration .2s,-webkit-box-shadow .2s,-webkit-text-decoration .2s;-webkit-filter:none;filter:none;cursor:not-allowed}.splunk-radiogroup input[type=radio][disabled]+.radio-label:after,.splunk-radiogroup input[type=radio][disabled]+label:after{cursor:not-allowed}.splunk-radiogroup input[type=radio]{margin:4px 6px}.dropdown-menu .dashboard-source-type{float:right}.add-panel-wrapper .controls textarea,.edit-search-string .controls textarea{height:15em;max-height:none}.input-editor-body{display:-webkit-box;display:-ms-flexbox;display:flex;border-bottom:1px solid #c3cbd4}.input-editor-body .input-editor-type{display:inline-block;background-color:#fff;border-right:1px solid #e1e6eb;vertical-align:top;list-style:none;margin:0}.input-editor-body .input-editor-type>li{position:relative}.input-editor-body .input-editor-type>li>a{display:block;padding:10px 20px;max-width:200px;text-overflow:ellipsis;text-decoration:none;overflow:hidden;color:#5c6773}.input-editor-body .input-editor-type>li>a:before{content:"";position:absolute;width:0;height:calc(100% - 20px);top:10px;right:0;-webkit-transition:width .2s;transition:width .2s}.input-editor-body .input-editor-type>li>a:hover:before{width:3px}.input-editor-body .input-editor-type>li>a.selected{background-color:#f2f4f5}.input-editor-body .input-editor-type>li>a.selected:before{background-color:#00a4fd;width:3px}.input-editor-body .input-editor-type>li>a:focus{-webkit-box-shadow:none;box-shadow:none;border-collapse:separate;outline:0;text-decoration:none}.input-editor-body .input-editor-type>li>a:focus:active:not([disabled]){-webkit-box-shadow:none;box-shadow:none}.input-editor-body .input-editor-type>li>a:focus{-webkit-box-shadow:inset 0 0 2px 1px #f2f4f5,inset 0 0 0 2px #00a4fd;box-shadow:inset 0 0 2px 1px #f2f4f5,inset 0 0 0 2px #00a4fd}.input-editor-body .input-editor-type [class*=" icon-"],.input-editor-body .input-editor-type [class^=icon-]{width:1em;text-align:center}.input-editor-body .input-editor-format{display:inline-block;position:relative;width:385px;vertical-align:top}.input-editor-body .input-editor-format a.default-clear-selection{margin-top:10px}.input-editor-body .input-editor-format .controls-stack{padding-bottom:5px;-webkit-box-align:left;-ms-flex-align:left;align-items:left}.input-editor-body .input-editor-format .concertina .concertina-body{position:static;max-height:500px;min-height:100px}.input-editor-body .input-editor-format .splunk-choice-input-message{height:auto}.input-editor-body .input-editor-format .shared-controls-textareacontrol textarea,.input-editor-body .input-editor-format .shared-controls-textcontrol input,.input-editor-body .input-editor-format .splunk-dropdown,.input-editor-body .input-editor-format .splunk-multidropdown{width:200px}.input-editor-body .input-editor-format .shared-controls-syntheticselectcontrol .link-label{float:left;width:162px;overflow:hidden;text-align:left}.input-editor-body .input-editor-format .token-input-settings-body .splunk-choice-input-message{clear:both}.input-editor-body .input-editor-format .token-input-settings-body .shared-timerangepicker{margin-left:0}.input-editor-body .input-editor-format .token-input-settings-body .splunkjs-mvc-simpleform-edit-tokenpreviewcontrol .shared-controls-labelcontrol{width:200px}.input-editor-body .input-editor-format .token-input-settings-body .splunkjs-mvc-simpleform-edit-tokenpreviewcontrol .shared-controls-labelcontrol span{word-break:break-all;white-space:pre-wrap}.input-editor-body .input-editor-format .static-input-settings-body .static-options-heading{margin-bottom:8px}.input-editor-body .input-editor-format .static-input-settings-body .static-options-heading .static-options-heading-name{width:130px;margin-left:40px;float:left}.input-editor-body .input-editor-format .static-input-settings-body .static-options-heading .static-options-heading-value{margin-left:180px}.input-editor-body .input-editor-format .static-input-settings-body .static-options-body{margin-bottom:8px}.input-editor-body .input-editor-format .static-input-settings-body .static-options-body .static-option-pair{padding:5px 0 0;margin:0}.input-editor-body .input-editor-format .static-input-settings-body .static-options-body .static-option-pair .drag-handle{display:inline-block;margin-left:20px;width:10px;height:18px;background:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Cpath fill='%23818D99' d='M0 0h2v2H0z'/%3E%3C/svg%3E");cursor:move}.input-editor-body .input-editor-format .static-input-settings-body .static-options-body .static-option-pair .static-option-label,.input-editor-body .input-editor-format .static-input-settings-body .static-options-body .static-option-pair .static-option-value{display:inline-block;margin-left:5px}.input-editor-body .input-editor-format .static-input-settings-body .static-options-body .static-option-pair .static-option-label input,.input-editor-body .input-editor-format .static-input-settings-body .static-options-body .static-option-pair .static-option-value input{width:130px}.input-editor-body .input-editor-format .static-input-settings-body .static-options-body .static-option-pair .static-option-remove{vertical-align:top;font-size:18px;border:none}.input-editor-body .input-editor-format .dynamic-input-settings-body .splunk-timerange{margin-bottom:10px}.input-editor-body .input-editor-format .dynamic-input-settings-body .search-field-wrapper{width:200px}.input-editor-body .control-label{width:125px;float:left;padding-top:5px;text-align:right}.input-editor-body .controls{margin-left:135px}.input-editor-body-and-flash-message .alert.alert-error{margin-left:20px;margin-bottom:0}.input-editor-body-and-flash-message .alerts.shared-flashmessages{border-bottom:1px solid #c3cbd4}.input-editor-apply,.input-editor-cancel{margin:10px}.input-time .shared-timerangepicker .btn,.input-timerangepicker .shared-timerangepicker .btn{position:relative;width:100%;text-align:left}.input-time .shared-timerangepicker .btn .time-label,.input-timerangepicker .shared-timerangepicker .btn .time-label{max-width:90%;display:inline-block}.input-time .shared-timerangepicker .caret,.input-timerangepicker .shared-timerangepicker .caret{position:absolute;right:10px}@media print{#header,.edit-dashboard-menu,.form-submit,.panel-footer,.ui-resizable-handle{display:none!important}.fieldset .input>label:first-child{font-weight:700}.fieldset .input input{border:none;-webkit-box-shadow:none!important;box-shadow:none!important;-webkit-transition:none!important;transition:none!important}.shared-timerangepicker .btn,.shared-timerangepicker .btn .time-label{max-width:200px!important;width:200px!important;text-align:left}.dashboard-element:not(.table):not(.event){page-break-inside:avoid}.splunk-paginator a.selected{font-weight:700}}.content-preview{width:450px;height:100%}.content-preview,.content-preview .preview-body{-webkit-box-sizing:border-box;box-sizing:border-box}.content-preview .preview-body{overflow-y:auto;position:absolute;width:100%;padding:10px;top:65px;bottom:0}.content-preview .preview-body .control-group{clear:both}.dashboard-list-item .accordion-group{border:none}.dashboard-panel{-webkit-transition:border-color 2s ease-out,border-width 2s ease-out,-webkit-box-shadow 2s ease-out;transition:border-color 2s ease-out,border-width 2s ease-out,-webkit-box-shadow 2s ease-out;transition:border-color 2s ease-out,box-shadow 2s ease-out,border-width 2s ease-out;transition:border-color 2s ease-out,box-shadow 2s ease-out,border-width 2s ease-out,-webkit-box-shadow 2s ease-out}.panel-highlight .dashboard-panel{border-color:#00364d;-webkit-box-shadow:0 0 10px 2px rgba(0,54,77,.4);box-shadow:0 0 10px 2px rgba(0,54,77,.4)}.splunk-header{min-height:20px}.splunk-header>:first-child{height:100%}
\ No newline at end of file
diff --git a/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/contrib/highcharts.js b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/contrib/highcharts.js
new file mode 100644
index 00000000..ef061855
--- /dev/null
+++ b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/contrib/highcharts.js
@@ -0,0 +1,16648 @@
+// ==ClosureCompiler==
+// @compilation_level SIMPLE_OPTIMIZATIONS
+
+/**
+ * @license Highcharts 4.0.4 JS v/Highstock 2.0.4 (2014-09-02)
+ *
+ * (c) 2009-2014 Torstein Honsi
+ *
+ * License: www.highcharts.com/license
+ */
+
+// JSLint options:
+/*global Highcharts, HighchartsAdapter, document, window, navigator, setInterval, clearInterval, clearTimeout, setTimeout, location, jQuery, $, console, each, grep */
+/*jslint ass: true, sloppy: true, forin: true, plusplus: true, nomen: true, vars: true, regexp: true, newcap: true, browser: true, continue: true, white: true */
+(function () {
+
+
+ // encapsulated variables
+ var UNDEFINED,
+ doc = document,
+ win = window,
+ math = Math,
+ mathRound = math.round,
+ mathFloor = math.floor,
+ mathCeil = math.ceil,
+ mathMax = math.max,
+ mathMin = math.min,
+ mathAbs = math.abs,
+ mathCos = math.cos,
+ mathSin = math.sin,
+ mathPI = math.PI,
+ deg2rad = mathPI * 2 / 360,
+
+
+ // some variables
+ userAgent = navigator.userAgent,
+ isOpera = win.opera,
+ isIE = /msie/i.test(userAgent) && !isOpera,
+ docMode8 = doc.documentMode === 8,
+ isWebKit = /AppleWebKit/.test(userAgent),
+ isFirefox = /Firefox/.test(userAgent),
+ isTouchDevice = /(Mobile|Android|Windows Phone)/.test(userAgent),
+ SVG_NS = 'http://www.w3.org/2000/svg',
+ hasSVG = !!doc.createElementNS && !!doc.createElementNS(SVG_NS, 'svg').createSVGRect,
+ hasBidiBug = isFirefox && parseInt(userAgent.split('Firefox/')[1], 10) < 4, // issue #38
+ useCanVG = !hasSVG && !isIE && !!doc.createElement('canvas').getContext,
+ Renderer,
+ hasTouch,
+ symbolSizes = {},
+ idCounter = 0,
+ garbageBin,
+ defaultOptions,
+ dateFormat, // function
+ globalAnimation,
+ pathAnim,
+ timeUnits,
+ error,
+ noop = function () { return UNDEFINED; },
+ charts = [],
+ chartCount = 0,
+ PRODUCT = 'Highcharts 4.0.4',
+ VERSION = '/Highstock 2.0.4',
+
+ // some constants for frequently used strings
+ DIV = 'div',
+ ABSOLUTE = 'absolute',
+ RELATIVE = 'relative',
+ HIDDEN = 'hidden',
+ PREFIX = 'highcharts-',
+ VISIBLE = 'visible',
+ PX = 'px',
+ NONE = 'none',
+ M = 'M',
+ L = 'L',
+ numRegex = /^[0-9]+$/,
+ NORMAL_STATE = '',
+ HOVER_STATE = 'hover',
+ SELECT_STATE = 'select',
+
+ // Object for extending Axis
+ AxisPlotLineOrBandExtension,
+
+ // constants for attributes
+ STROKE_WIDTH = 'stroke-width',
+
+ // time methods, changed based on whether or not UTC is used
+ Date, // Allow using a different Date class
+ makeTime,
+ timezoneOffset,
+ getMinutes,
+ getHours,
+ getDay,
+ getDate,
+ getMonth,
+ getFullYear,
+ setMinutes,
+ setHours,
+ setDate,
+ setMonth,
+ setFullYear,
+
+
+ // lookup over the types and the associated classes
+ seriesTypes = {},
+ Highcharts;
+
+ // The Highcharts namespace
+ if (win.Highcharts) {
+ error(16, true);
+ } else {
+ Highcharts = win.Highcharts = {};
+ }
+
+
+ /**
+ * Extend an object with the members of another
+ * @param {Object} a The object to be extended
+ * @param {Object} b The object to add to the first one
+ */
+ function extend(a, b) {
+ var n;
+ if (!a) {
+ a = {};
+ }
+ for (n in b) {
+ a[n] = b[n];
+ }
+ return a;
+ }
+
+ /**
+ * Deep merge two or more objects and return a third object. If the first argument is
+ * true, the contents of the second object is copied into the first object.
+ * Previously this function redirected to jQuery.extend(true), but this had two limitations.
+ * First, it deep merged arrays, which lead to workarounds in Highcharts. Second,
+ * it copied properties from extended prototypes.
+ */
+ function merge() {
+ var i,
+ args = arguments,
+ len,
+ ret = {},
+ doCopy = function (copy, original) {
+ var value, key;
+
+ // An object is replacing a primitive
+ if (typeof copy !== 'object') {
+ copy = {};
+ }
+
+ for (key in original) {
+ if (original.hasOwnProperty(key)) {
+ value = original[key];
+
+ // Copy the contents of objects, but not arrays or DOM nodes
+ if (value && typeof value === 'object' && Object.prototype.toString.call(value) !== '[object Array]'
+ && key !== 'renderTo' && typeof value.nodeType !== 'number') {
+ copy[key] = doCopy(copy[key] || {}, value);
+
+ // Primitives and arrays are copied over directly
+ } else {
+ copy[key] = original[key];
+ }
+ }
+ }
+ return copy;
+ };
+
+ // If first argument is true, copy into the existing object. Used in setOptions.
+ if (args[0] === true) {
+ ret = args[1];
+ args = Array.prototype.slice.call(args, 2);
+ }
+
+ // For each argument, extend the return
+ len = args.length;
+ for (i = 0; i < len; i++) {
+ ret = doCopy(ret, args[i]);
+ }
+
+ return ret;
+ }
+
+ /**
+ * Shortcut for parseInt
+ * @param {Object} s
+ * @param {Number} mag Magnitude
+ */
+ function pInt(s, mag) {
+ return parseInt(s, mag || 10);
+ }
+
+ /**
+ * Check for string
+ * @param {Object} s
+ */
+ function isString(s) {
+ return typeof s === 'string';
+ }
+
+ /**
+ * Check for object
+ * @param {Object} obj
+ */
+ function isObject(obj) {
+ return obj && typeof obj === 'object';
+ }
+
+ /**
+ * Check for array
+ * @param {Object} obj
+ */
+ function isArray(obj) {
+ return Object.prototype.toString.call(obj) === '[object Array]';
+ }
+
+ /**
+ * Check for number
+ * @param {Object} n
+ */
+ function isNumber(n) {
+ return typeof n === 'number';
+ }
+
+ function log2lin(num) {
+ return math.log(num) / math.LN10;
+ }
+ function lin2log(num) {
+ return math.pow(10, num);
+ }
+
+ /**
+ * Remove last occurence of an item from an array
+ * @param {Array} arr
+ * @param {Mixed} item
+ */
+ function erase(arr, item) {
+ var i = arr.length;
+ while (i--) {
+ if (arr[i] === item) {
+ arr.splice(i, 1);
+ break;
+ }
+ }
+ //return arr;
+ }
+
+ /**
+ * Returns true if the object is not null or undefined. Like MooTools' $.defined.
+ * @param {Object} obj
+ */
+ function defined(obj) {
+ return obj !== UNDEFINED && obj !== null;
+ }
+
+ /**
+ * Set or get an attribute or an object of attributes. Can't use jQuery attr because
+ * it attempts to set expando properties on the SVG element, which is not allowed.
+ *
+ * @param {Object} elem The DOM element to receive the attribute(s)
+ * @param {String|Object} prop The property or an abject of key-value pairs
+ * @param {String} value The value if a single property is set
+ */
+ function attr(elem, prop, value) {
+ var key,
+ ret;
+
+ // if the prop is a string
+ if (isString(prop)) {
+ // set the value
+ if (defined(value)) {
+ elem.setAttribute(prop, value);
+
+ // get the value
+ } else if (elem && elem.getAttribute) { // elem not defined when printing pie demo...
+ ret = elem.getAttribute(prop);
+ }
+
+ // else if prop is defined, it is a hash of key/value pairs
+ } else if (defined(prop) && isObject(prop)) {
+ for (key in prop) {
+ elem.setAttribute(key, prop[key]);
+ }
+ }
+ return ret;
+ }
+ /**
+ * Check if an element is an array, and if not, make it into an array. Like
+ * MooTools' $.splat.
+ */
+ function splat(obj) {
+ return isArray(obj) ? obj : [obj];
+ }
+
+
+ /**
+ * Return the first value that is defined. Like MooTools' $.pick.
+ */
+ function pick() {
+ var args = arguments,
+ i,
+ arg,
+ length = args.length;
+ for (i = 0; i < length; i++) {
+ arg = args[i];
+ if (arg !== UNDEFINED && arg !== null) {
+ return arg;
+ }
+ }
+ }
+
+ /**
+ * Set CSS on a given element
+ * @param {Object} el
+ * @param {Object} styles Style object with camel case property names
+ */
+ function css(el, styles) {
+ if (isIE && !hasSVG) { // #2686
+ if (styles && styles.opacity !== UNDEFINED) {
+ styles.filter = 'alpha(opacity=' + (styles.opacity * 100) + ')';
+ }
+ }
+ extend(el.style, styles);
+ }
+
+ /**
+ * Utility function to create element with attributes and styles
+ * @param {Object} tag
+ * @param {Object} attribs
+ * @param {Object} styles
+ * @param {Object} parent
+ * @param {Object} nopad
+ */
+ function createElement(tag, attribs, styles, parent, nopad) {
+ var el = doc.createElement(tag);
+ if (attribs) {
+ extend(el, attribs);
+ }
+ if (nopad) {
+ css(el, {padding: 0, border: NONE, margin: 0});
+ }
+ if (styles) {
+ css(el, styles);
+ }
+ if (parent) {
+ parent.appendChild(el);
+ }
+ return el;
+ }
+
+ /**
+ * Extend a prototyped class by new members
+ * @param {Object} parent
+ * @param {Object} members
+ */
+ function extendClass(parent, members) {
+ var object = function () { return UNDEFINED; };
+ object.prototype = new parent();
+ extend(object.prototype, members);
+ return object;
+ }
+
+ /**
+ * Format a number and return a string based on input settings
+ * @param {Number} number The input number to format
+ * @param {Number} decimals The amount of decimals
+ * @param {String} decPoint The decimal point, defaults to the one given in the lang options
+ * @param {String} thousandsSep The thousands separator, defaults to the one given in the lang options
+ */
+ function numberFormat(number, decimals, decPoint, thousandsSep) {
+ var externalFn = Highcharts.numberFormat,
+ lang = defaultOptions.lang,
+ // http://kevin.vanzonneveld.net/techblog/article/javascript_equivalent_for_phps_number_format/
+ n = +number || 0,
+ c = decimals === -1 ?
+ (n.toString().split('.')[1] || '').length : // preserve decimals
+ (isNaN(decimals = mathAbs(decimals)) ? 2 : decimals),
+ d = decPoint === undefined ? lang.decimalPoint : decPoint,
+ t = thousandsSep === undefined ? lang.thousandsSep : thousandsSep,
+ s = n < 0 ? "-" : "",
+ i = String(pInt(n = mathAbs(n).toFixed(c))),
+ j = i.length > 3 ? i.length % 3 : 0;
+
+ return externalFn !== numberFormat ?
+ externalFn(number, decimals, decPoint, thousandsSep) :
+ (s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) +
+ (c ? d + mathAbs(n - i).toFixed(c).slice(2) : ""));
+ }
+
+ /**
+ * Pad a string to a given length by adding 0 to the beginning
+ * @param {Number} number
+ * @param {Number} length
+ */
+ function pad(number, length) {
+ // Create an array of the remaining length +1 and join it with 0's
+ return new Array((length || 2) + 1 - String(number).length).join(0) + number;
+ }
+
+ /**
+ * Wrap a method with extended functionality, preserving the original function
+ * @param {Object} obj The context object that the method belongs to
+ * @param {String} method The name of the method to extend
+ * @param {Function} func A wrapper function callback. This function is called with the same arguments
+ * as the original function, except that the original function is unshifted and passed as the first
+ * argument.
+ */
+ function wrap(obj, method, func) {
+ var proceed = obj[method];
+ obj[method] = function () {
+ var args = Array.prototype.slice.call(arguments);
+ args.unshift(proceed);
+ return func.apply(this, args);
+ };
+ }
+
+ /**
+ * Based on http://www.php.net/manual/en/function.strftime.php
+ * @param {String} format
+ * @param {Number} timestamp
+ * @param {Boolean} capitalize
+ */
+ dateFormat = function (format, timestamp, capitalize) {
+ if (!defined(timestamp) || isNaN(timestamp)) {
+ return 'Invalid date';
+ }
+ format = pick(format, '%Y-%m-%d %H:%M:%S');
+
+ var date = new Date(timestamp - timezoneOffset),
+ key, // used in for constuct below
+ // get the basic time values
+ hours = date[getHours](),
+ day = date[getDay](),
+ dayOfMonth = date[getDate](),
+ month = date[getMonth](),
+ fullYear = date[getFullYear](),
+ lang = defaultOptions.lang,
+ langWeekdays = lang.weekdays,
+
+ // List all format keys. Custom formats can be added from the outside.
+ replacements = extend({
+
+ // Day
+ 'a': langWeekdays[day].substr(0, 3), // Short weekday, like 'Mon'
+ 'A': langWeekdays[day], // Long weekday, like 'Monday'
+ 'd': pad(dayOfMonth), // Two digit day of the month, 01 to 31
+ 'e': dayOfMonth, // Day of the month, 1 through 31
+
+ // Week (none implemented)
+ //'W': weekNumber(),
+
+ // Month
+ 'b': lang.shortMonths[month], // Short month, like 'Jan'
+ 'B': lang.months[month], // Long month, like 'January'
+ 'm': pad(month + 1), // Two digit month number, 01 through 12
+
+ // Year
+ 'y': fullYear.toString().substr(2, 2), // Two digits year, like 09 for 2009
+ 'Y': fullYear, // Four digits year, like 2009
+
+ // Time
+ 'H': pad(hours), // Two digits hours in 24h format, 00 through 23
+ 'I': pad((hours % 12) || 12), // Two digits hours in 12h format, 00 through 11
+ 'l': (hours % 12) || 12, // Hours in 12h format, 1 through 12
+ 'M': pad(date[getMinutes]()), // Two digits minutes, 00 through 59
+ 'p': hours < 12 ? 'AM' : 'PM', // Upper case AM or PM
+ 'P': hours < 12 ? 'am' : 'pm', // Lower case AM or PM
+ 'S': pad(date.getSeconds()), // Two digits seconds, 00 through 59
+ 'L': pad(mathRound(timestamp % 1000), 3) // Milliseconds (naming from Ruby)
+ }, Highcharts.dateFormats);
+
+
+ // do the replaces
+ for (key in replacements) {
+ while (format.indexOf('%' + key) !== -1) { // regex would do it in one line, but this is faster
+ format = format.replace('%' + key, typeof replacements[key] === 'function' ? replacements[key](timestamp) : replacements[key]);
+ }
+ }
+
+ // Optionally capitalize the string and return
+ return capitalize ? format.substr(0, 1).toUpperCase() + format.substr(1) : format;
+ };
+
+ /**
+ * Format a single variable. Similar to sprintf, without the % prefix.
+ */
+ function formatSingle(format, val) {
+ var floatRegex = /f$/,
+ decRegex = /\.([0-9])/,
+ lang = defaultOptions.lang,
+ decimals;
+
+ if (floatRegex.test(format)) { // float
+ decimals = format.match(decRegex);
+ decimals = decimals ? decimals[1] : -1;
+ if (val !== null) {
+ val = numberFormat(
+ val,
+ decimals,
+ lang.decimalPoint,
+ format.indexOf(',') > -1 ? lang.thousandsSep : ''
+ );
+ }
+ } else {
+ val = dateFormat(format, val);
+ }
+ return val;
+ }
+
+ /**
+ * Format a string according to a subset of the rules of Python's String.format method.
+ */
+ function format(str, ctx) {
+ var splitter = '{',
+ isInside = false,
+ segment,
+ valueAndFormat,
+ path,
+ i,
+ len,
+ ret = [],
+ val,
+ index;
+
+ while ((index = str.indexOf(splitter)) !== -1) {
+
+ segment = str.slice(0, index);
+ if (isInside) { // we're on the closing bracket looking back
+
+ valueAndFormat = segment.split(':');
+ path = valueAndFormat.shift().split('.'); // get first and leave format
+ len = path.length;
+ val = ctx;
+
+ // Assign deeper paths
+ for (i = 0; i < len; i++) {
+ val = val[path[i]];
+ }
+
+ // Format the replacement
+ if (valueAndFormat.length) {
+ val = formatSingle(valueAndFormat.join(':'), val);
+ }
+
+ // Push the result and advance the cursor
+ ret.push(val);
+
+ } else {
+ ret.push(segment);
+
+ }
+ str = str.slice(index + 1); // the rest
+ isInside = !isInside; // toggle
+ splitter = isInside ? '}' : '{'; // now look for next matching bracket
+ }
+ ret.push(str);
+ return ret.join('');
+ }
+
+ /**
+ * Get the magnitude of a number
+ */
+ function getMagnitude(num) {
+ return math.pow(10, mathFloor(math.log(num) / math.LN10));
+ }
+
+ /**
+ * Take an interval and normalize it to multiples of 1, 2, 2.5 and 5
+ * @param {Number} interval
+ * @param {Array} multiples
+ * @param {Number} magnitude
+ * @param {Object} options
+ */
+ function normalizeTickInterval(interval, multiples, magnitude, allowDecimals) {
+ var normalized, i;
+
+ // round to a tenfold of 1, 2, 2.5 or 5
+ magnitude = pick(magnitude, 1);
+ normalized = interval / magnitude;
+
+ // multiples for a linear scale
+ if (!multiples) {
+ multiples = [1, 2, 2.5, 5, 10];
+
+ // the allowDecimals option
+ if (allowDecimals === false) {
+ if (magnitude === 1) {
+ multiples = [1, 2, 5, 10];
+ } else if (magnitude <= 0.1) {
+ multiples = [1 / magnitude];
+ }
+ }
+ }
+
+ // normalize the interval to the nearest multiple
+ for (i = 0; i < multiples.length; i++) {
+ interval = multiples[i];
+ if (normalized <= (multiples[i] + (multiples[i + 1] || multiples[i])) / 2) {
+ break;
+ }
+ }
+
+ // multiply back to the correct magnitude
+ interval *= magnitude;
+
+ return interval;
+ }
+
+
+ /**
+ * Utility method that sorts an object array and keeping the order of equal items.
+ * ECMA script standard does not specify the behaviour when items are equal.
+ */
+ function stableSort(arr, sortFunction) {
+ var length = arr.length,
+ sortValue,
+ i;
+
+ // Add index to each item
+ for (i = 0; i < length; i++) {
+ arr[i].ss_i = i; // stable sort index
+ }
+
+ arr.sort(function (a, b) {
+ sortValue = sortFunction(a, b);
+ return sortValue === 0 ? a.ss_i - b.ss_i : sortValue;
+ });
+
+ // Remove index from items
+ for (i = 0; i < length; i++) {
+ delete arr[i].ss_i; // stable sort index
+ }
+ }
+
+ /**
+ * Non-recursive method to find the lowest member of an array. Math.min raises a maximum
+ * call stack size exceeded error in Chrome when trying to apply more than 150.000 points. This
+ * method is slightly slower, but safe.
+ */
+ function arrayMin(data) {
+ var i = data.length,
+ min = data[0];
+
+ while (i--) {
+ if (data[i] < min) {
+ min = data[i];
+ }
+ }
+ return min;
+ }
+
+ /**
+ * Non-recursive method to find the lowest member of an array. Math.min raises a maximum
+ * call stack size exceeded error in Chrome when trying to apply more than 150.000 points. This
+ * method is slightly slower, but safe.
+ */
+ function arrayMax(data) {
+ var i = data.length,
+ max = data[0];
+
+ while (i--) {
+ if (data[i] > max) {
+ max = data[i];
+ }
+ }
+ return max;
+ }
+
+ /**
+ * Utility method that destroys any SVGElement or VMLElement that are properties on the given object.
+ * It loops all properties and invokes destroy if there is a destroy method. The property is
+ * then delete'ed.
+ * @param {Object} The object to destroy properties on
+ * @param {Object} Exception, do not destroy this property, only delete it.
+ */
+ function destroyObjectProperties(obj, except) {
+ var n;
+ for (n in obj) {
+ // If the object is non-null and destroy is defined
+ if (obj[n] && obj[n] !== except && obj[n].destroy) {
+ // Invoke the destroy
+ obj[n].destroy();
+ }
+
+ // Delete the property from the object.
+ delete obj[n];
+ }
+ }
+
+
+ /**
+ * Discard an element by moving it to the bin and delete
+ * @param {Object} The HTML node to discard
+ */
+ function discardElement(element) {
+ // create a garbage bin element, not part of the DOM
+ if (!garbageBin) {
+ garbageBin = createElement(DIV);
+ }
+
+ // move the node and empty bin
+ if (element) {
+ garbageBin.appendChild(element);
+ }
+ garbageBin.innerHTML = '';
+ }
+
+ /**
+ * Provide error messages for debugging, with links to online explanation
+ */
+ error = function (code, stop) {
+ var msg = 'Highcharts error #' + code + ': www.highcharts.com/errors/' + code;
+ if (stop) {
+ throw msg;
+ }
+ // else ...
+ if (win.console) {
+ console.log(msg);
+ }
+ };
+
+ /**
+ * Fix JS round off float errors
+ * @param {Number} num
+ */
+ function correctFloat(num) {
+ return parseFloat(
+ num.toPrecision(14)
+ );
+ }
+
+ /**
+ * Set the global animation to either a given value, or fall back to the
+ * given chart's animation option
+ * @param {Object} animation
+ * @param {Object} chart
+ */
+ function setAnimation(animation, chart) {
+ globalAnimation = pick(animation, chart.animation);
+ }
+
+ /**
+ * The time unit lookup
+ */
+ timeUnits = {
+ millisecond: 1,
+ second: 1000,
+ minute: 60000,
+ hour: 3600000,
+ day: 24 * 3600000,
+ week: 7 * 24 * 3600000,
+ month: 31 * 24 * 3600000,
+ year: 31556952000
+ };
+
+
+ /**
+ * Path interpolation algorithm used across adapters
+ */
+ pathAnim = {
+ /**
+ * Prepare start and end values so that the path can be animated one to one
+ */
+ init: function (elem, fromD, toD) {
+ fromD = fromD || '';
+ var shift = elem.shift,
+ bezier = fromD.indexOf('C') > -1,
+ numParams = bezier ? 7 : 3,
+ endLength,
+ slice,
+ i,
+ start = fromD.split(' '),
+ end = [].concat(toD), // copy
+ startBaseLine,
+ endBaseLine,
+ sixify = function (arr) { // in splines make move points have six parameters like bezier curves
+ i = arr.length;
+ while (i--) {
+ if (arr[i] === M) {
+ arr.splice(i + 1, 0, arr[i + 1], arr[i + 2], arr[i + 1], arr[i + 2]);
+ }
+ }
+ };
+
+ if (bezier) {
+ sixify(start);
+ sixify(end);
+ }
+
+ // pull out the base lines before padding
+ if (elem.isArea) {
+ startBaseLine = start.splice(start.length - 6, 6);
+ endBaseLine = end.splice(end.length - 6, 6);
+ }
+
+ // if shifting points, prepend a dummy point to the end path
+ if (shift <= end.length / numParams && start.length === end.length) {
+ while (shift--) {
+ end = [].concat(end).splice(0, numParams).concat(end);
+ }
+ }
+ elem.shift = 0; // reset for following animations
+
+ // copy and append last point until the length matches the end length
+ if (start.length) {
+ endLength = end.length;
+ while (start.length < endLength) {
+
+ //bezier && sixify(start);
+ slice = [].concat(start).splice(start.length - numParams, numParams);
+ if (bezier) { // disable first control point
+ slice[numParams - 6] = slice[numParams - 2];
+ slice[numParams - 5] = slice[numParams - 1];
+ }
+ start = start.concat(slice);
+ }
+ }
+
+ if (startBaseLine) { // append the base lines for areas
+ start = start.concat(startBaseLine);
+ end = end.concat(endBaseLine);
+ }
+ return [start, end];
+ },
+
+ /**
+ * Interpolate each value of the path and return the array
+ */
+ step: function (start, end, pos, complete) {
+ var ret = [],
+ i = start.length,
+ startVal;
+
+ if (pos === 1) { // land on the final path without adjustment points appended in the ends
+ ret = complete;
+
+ } else if (i === end.length && pos < 1) {
+ while (i--) {
+ startVal = parseFloat(start[i]);
+ ret[i] =
+ isNaN(startVal) ? // a letter instruction like M or L
+ start[i] :
+ pos * (parseFloat(end[i] - startVal)) + startVal;
+
+ }
+ } else { // if animation is finished or length not matching, land on right value
+ ret = end;
+ }
+ return ret;
+ }
+ };
+
+
+
+ (function ($) {
+ /**
+ * The default HighchartsAdapter for jQuery
+ */
+ win.HighchartsAdapter = win.HighchartsAdapter || ($ && {
+
+ /**
+ * Initialize the adapter by applying some extensions to jQuery
+ */
+ init: function (pathAnim) {
+
+ // extend the animate function to allow SVG animations
+ var Fx = $.fx;
+
+ /*jslint unparam: true*//* allow unused param x in this function */
+ $.extend($.easing, {
+ easeOutQuad: function (x, t, b, c, d) {
+ return -c * (t /= d) * (t - 2) + b;
+ }
+ });
+ /*jslint unparam: false*/
+
+ // extend some methods to check for elem.attr, which means it is a Highcharts SVG object
+ $.each(['cur', '_default', 'width', 'height', 'opacity'], function (i, fn) {
+ var obj = Fx.step,
+ base;
+
+ // Handle different parent objects
+ if (fn === 'cur') {
+ obj = Fx.prototype; // 'cur', the getter, relates to Fx.prototype
+
+ } else if (fn === '_default' && $.Tween) { // jQuery 1.8 model
+ obj = $.Tween.propHooks[fn];
+ fn = 'set';
+ }
+
+ // Overwrite the method
+ base = obj[fn];
+ if (base) { // step.width and step.height don't exist in jQuery < 1.7
+
+ // create the extended function replacement
+ obj[fn] = function (fx) {
+
+ var elem;
+
+ // Fx.prototype.cur does not use fx argument
+ fx = i ? fx : this;
+
+ // Don't run animations on textual properties like align (#1821)
+ if (fx.prop === 'align') {
+ return;
+ }
+
+ // shortcut
+ elem = fx.elem;
+
+ // Fx.prototype.cur returns the current value. The other ones are setters
+ // and returning a value has no effect.
+ return elem.attr ? // is SVG element wrapper
+ elem.attr(fx.prop, fn === 'cur' ? UNDEFINED : fx.now) : // apply the SVG wrapper's method
+ base.apply(this, arguments); // use jQuery's built-in method
+ };
+ }
+ });
+
+ // Extend the opacity getter, needed for fading opacity with IE9 and jQuery 1.10+
+ wrap($.cssHooks.opacity, 'get', function (proceed, elem, computed) {
+ return elem.attr ? (elem.opacity || 0) : proceed.call(this, elem, computed);
+ });
+
+ // Define the setter function for d (path definitions)
+ this.addAnimSetter('d', function (fx) {
+ var elem = fx.elem,
+ ends;
+
+ // Normally start and end should be set in state == 0, but sometimes,
+ // for reasons unknown, this doesn't happen. Perhaps state == 0 is skipped
+ // in these cases
+ if (!fx.started) {
+ ends = pathAnim.init(elem, elem.d, elem.toD);
+ fx.start = ends[0];
+ fx.end = ends[1];
+ fx.started = true;
+ }
+
+ // Interpolate each value of the path
+ elem.attr('d', pathAnim.step(fx.start, fx.end, fx.pos, elem.toD));
+ });
+
+ /**
+ * Utility for iterating over an array. Parameters are reversed compared to jQuery.
+ * @param {Array} arr
+ * @param {Function} fn
+ */
+ this.each = Array.prototype.forEach ?
+ function (arr, fn) { // modern browsers
+ return Array.prototype.forEach.call(arr, fn);
+
+ } :
+ function (arr, fn) { // legacy
+ var i,
+ len = arr.length;
+ for (i = 0; i < len; i++) {
+ if (fn.call(arr[i], arr[i], i, arr) === false) {
+ return i;
+ }
+ }
+ };
+
+ /**
+ * Register Highcharts as a plugin in the respective framework
+ */
+ $.fn.highcharts = function () {
+ var constr = 'Chart', // default constructor
+ args = arguments,
+ options,
+ ret,
+ chart;
+
+ if (this[0]) {
+
+ if (isString(args[0])) {
+ constr = args[0];
+ args = Array.prototype.slice.call(args, 1);
+ }
+ options = args[0];
+
+ // Create the chart
+ if (options !== UNDEFINED) {
+ /*jslint unused:false*/
+ options.chart = options.chart || {};
+ options.chart.renderTo = this[0];
+ chart = new Highcharts[constr](options, args[1]);
+ ret = this;
+ /*jslint unused:true*/
+ }
+
+ // When called without parameters or with the return argument, get a predefined chart
+ if (options === UNDEFINED) {
+ ret = charts[attr(this[0], 'data-highcharts-chart')];
+ }
+ }
+
+ return ret;
+ };
+
+ },
+
+ /**
+ * Add an animation setter for a specific property
+ */
+ addAnimSetter: function (prop, setter) {
+ // jQuery 1.8 style
+ if ($.Tween) {
+ $.Tween.propHooks[prop] = {
+ set: setter
+ };
+ // pre 1.8
+ } else {
+ $.fx.step[prop] = setter;
+ }
+ },
+
+ /**
+ * Downloads a script and executes a callback when done.
+ * @param {String} scriptLocation
+ * @param {Function} callback
+ */
+ getScript: $.getScript,
+
+ /**
+ * Return the index of an item in an array, or -1 if not found
+ */
+ inArray: $.inArray,
+
+ /**
+ * A direct link to jQuery methods. MooTools and Prototype adapters must be implemented for each case of method.
+ * @param {Object} elem The HTML element
+ * @param {String} method Which method to run on the wrapped element
+ */
+ adapterRun: function (elem, method) {
+ return $(elem)[method]();
+ },
+
+ /**
+ * Filter an array
+ */
+ grep: $.grep,
+
+ /**
+ * Map an array
+ * @param {Array} arr
+ * @param {Function} fn
+ */
+ map: function (arr, fn) {
+ //return jQuery.map(arr, fn);
+ var results = [],
+ i = 0,
+ len = arr.length;
+ for (; i < len; i++) {
+ results[i] = fn.call(arr[i], arr[i], i, arr);
+ }
+ return results;
+
+ },
+
+ /**
+ * Get the position of an element relative to the top left of the page
+ */
+ offset: function (el) {
+ return $(el).offset();
+ },
+
+ /**
+ * Add an event listener
+ * @param {Object} el A HTML element or custom object
+ * @param {String} event The event type
+ * @param {Function} fn The event handler
+ */
+ addEvent: function (el, event, fn) {
+ $(el).bind(event, fn);
+ },
+
+ /**
+ * Remove event added with addEvent
+ * @param {Object} el The object
+ * @param {String} eventType The event type. Leave blank to remove all events.
+ * @param {Function} handler The function to remove
+ */
+ removeEvent: function (el, eventType, handler) {
+ // workaround for jQuery issue with unbinding custom events:
+ // http://forum.jQuery.com/topic/javascript-error-when-unbinding-a-custom-event-using-jQuery-1-4-2
+ var func = doc.removeEventListener ? 'removeEventListener' : 'detachEvent';
+ if (doc[func] && el && !el[func]) {
+ el[func] = function () {};
+ }
+
+ $(el).unbind(eventType, handler);
+ },
+
+ /**
+ * Fire an event on a custom object
+ * @param {Object} el
+ * @param {String} type
+ * @param {Object} eventArguments
+ * @param {Function} defaultFunction
+ */
+ fireEvent: function (el, type, eventArguments, defaultFunction) {
+ var event = $.Event(type),
+ detachedType = 'detached' + type,
+ defaultPrevented;
+
+ // Remove warnings in Chrome when accessing returnValue (#2790), layerX and layerY. Although Highcharts
+ // never uses these properties, Chrome includes them in the default click event and
+ // raises the warning when they are copied over in the extend statement below.
+ //
+ // To avoid problems in IE (see #1010) where we cannot delete the properties and avoid
+ // testing if they are there (warning in chrome) the only option is to test if running IE.
+ if (!isIE && eventArguments) {
+ delete eventArguments.layerX;
+ delete eventArguments.layerY;
+ delete eventArguments.returnValue;
+ }
+
+ extend(event, eventArguments);
+
+ // Prevent jQuery from triggering the object method that is named the
+ // same as the event. For example, if the event is 'select', jQuery
+ // attempts calling el.select and it goes into a loop.
+ if (el[type]) {
+ el[detachedType] = el[type];
+ el[type] = null;
+ }
+
+ // Wrap preventDefault and stopPropagation in try/catch blocks in
+ // order to prevent JS errors when cancelling events on non-DOM
+ // objects. #615.
+ /*jslint unparam: true*/
+ $.each(['preventDefault', 'stopPropagation'], function (i, fn) {
+ var base = event[fn];
+ event[fn] = function () {
+ try {
+ base.call(event);
+ } catch (e) {
+ if (fn === 'preventDefault') {
+ defaultPrevented = true;
+ }
+ }
+ };
+ });
+ /*jslint unparam: false*/
+
+ // trigger it
+ $(el).trigger(event);
+
+ // attach the method
+ if (el[detachedType]) {
+ el[type] = el[detachedType];
+ el[detachedType] = null;
+ }
+
+ if (defaultFunction && !event.isDefaultPrevented() && !defaultPrevented) {
+ defaultFunction(event);
+ }
+ },
+
+ /**
+ * Extension method needed for MooTools
+ */
+ washMouseEvent: function (e) {
+ var ret = e.originalEvent || e;
+
+ // computed by jQuery, needed by IE8
+ if (ret.pageX === UNDEFINED) { // #1236
+ ret.pageX = e.pageX;
+ ret.pageY = e.pageY;
+ }
+
+ return ret;
+ },
+
+ /**
+ * Animate a HTML element or SVG element wrapper
+ * @param {Object} el
+ * @param {Object} params
+ * @param {Object} options jQuery-like animation options: duration, easing, callback
+ */
+ animate: function (el, params, options) {
+ var $el = $(el);
+ if (!el.style) {
+ el.style = {}; // #1881
+ }
+ if (params.d) {
+ el.toD = params.d; // keep the array form for paths, used in $.fx.step.d
+ params.d = 1; // because in jQuery, animating to an array has a different meaning
+ }
+
+ $el.stop();
+ if (params.opacity !== UNDEFINED && el.attr) {
+ params.opacity += 'px'; // force jQuery to use same logic as width and height (#2161)
+ }
+ el.hasAnim = 1; // #3342
+ $el.animate(params, options);
+
+ },
+ /**
+ * Stop running animation
+ */
+ stop: function (el) {
+ if (el.hasAnim) { // #3342, memory leak on calling $(el) from destroy
+ $(el).stop();
+ }
+ }
+ });
+ }(win.jQuery));
+
+
+
+
+ // check for a custom HighchartsAdapter defined prior to this file
+ var globalAdapter = win.HighchartsAdapter,
+ adapter = globalAdapter || {};
+
+ // Initialize the adapter
+ if (globalAdapter) {
+ globalAdapter.init.call(globalAdapter, pathAnim);
+ }
+
+
+ // Utility functions. If the HighchartsAdapter is not defined, adapter is an empty object
+ // and all the utility functions will be null. In that case they are populated by the
+ // default adapters below.
+ var adapterRun = adapter.adapterRun,
+ getScript = adapter.getScript,
+ inArray = adapter.inArray,
+ each = adapter.each,
+ grep = adapter.grep,
+ offset = adapter.offset,
+ map = adapter.map,
+ addEvent = adapter.addEvent,
+ removeEvent = adapter.removeEvent,
+ fireEvent = adapter.fireEvent,
+ washMouseEvent = adapter.washMouseEvent,
+ animate = adapter.animate,
+ stop = adapter.stop;
+
+
+
+
+
+ /* ****************************************************************************
+ * Handle the options *
+ *****************************************************************************/
+ var
+
+ defaultLabelOptions = {
+ enabled: true,
+ // rotation: 0,
+ // align: 'center',
+ x: 0,
+ y: 15,
+ /*formatter: function () {
+ return this.value;
+ },*/
+ style: {
+ color: '#606060',
+ cursor: 'default',
+ fontSize: '11px'
+ }
+ };
+
+ defaultOptions = {
+ colors: ['#7cb5ec', '#434348', '#90ed7d', '#f7a35c',
+ '#8085e9', '#f15c80', '#e4d354', '#8085e8', '#8d4653', '#91e8e1'],
+ symbols: ['circle', 'diamond', 'square', 'triangle', 'triangle-down'],
+ lang: {
+ loading: 'Loading...',
+ months: ['January', 'February', 'March', 'April', 'May', 'June', 'July',
+ 'August', 'September', 'October', 'November', 'December'],
+ shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
+ weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
+ decimalPoint: '.',
+ numericSymbols: ['k', 'M', 'G', 'T', 'P', 'E'], // SI prefixes used in axis labels
+ resetZoom: 'Reset zoom',
+ resetZoomTitle: 'Reset zoom level 1:1',
+ thousandsSep: ','
+ },
+ global: {
+ useUTC: true,
+ //timezoneOffset: 0,
+ canvasToolsURL: 'http://code.highcharts.com@product.cdnpath@//Highstock 2.0.4/modules/canvas-tools.js',
+ VMLRadialGradientURL: 'http://code.highcharts.com@product.cdnpath@//Highstock 2.0.4/gfx/vml-radial-gradient.png'
+ },
+ chart: {
+ //animation: true,
+ //alignTicks: false,
+ //reflow: true,
+ //className: null,
+ //events: { load, selection },
+ //margin: [null],
+ //marginTop: null,
+ //marginRight: null,
+ //marginBottom: null,
+ //marginLeft: null,
+ borderColor: '#4572A7',
+ //borderWidth: 0,
+ borderRadius: 0,
+ defaultSeriesType: 'line',
+ ignoreHiddenSeries: true,
+ //inverted: false,
+ //shadow: false,
+ spacing: [10, 10, 15, 10],
+ //spacingTop: 10,
+ //spacingRight: 10,
+ //spacingBottom: 15,
+ //spacingLeft: 10,
+ //style: {
+ // fontFamily: '"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif', // default font
+ // fontSize: '12px'
+ //},
+ backgroundColor: '#FFFFFF',
+ //plotBackgroundColor: null,
+ plotBorderColor: '#C0C0C0',
+ //plotBorderWidth: 0,
+ //plotShadow: false,
+ //zoomType: ''
+ resetZoomButton: {
+ theme: {
+ zIndex: 20
+ },
+ position: {
+ align: 'right',
+ x: -10,
+ //verticalAlign: 'top',
+ y: 10
+ }
+ // relativeTo: 'plot'
+ }
+ },
+ title: {
+ text: 'Chart title',
+ align: 'center',
+ // floating: false,
+ margin: 15,
+ // x: 0,
+ // verticalAlign: 'top',
+ // y: null,
+ style: {
+ color: '#333333',
+ fontSize: '18px'
+ }
+
+ },
+ subtitle: {
+ text: '',
+ align: 'center',
+ // floating: false
+ // x: 0,
+ // verticalAlign: 'top',
+ // y: null,
+ style: {
+ color: '#555555'
+ }
+ },
+
+ plotOptions: {
+ line: { // base series options
+ allowPointSelect: false,
+ showCheckbox: false,
+ animation: {
+ duration: 1000
+ },
+ //connectNulls: false,
+ //cursor: 'default',
+ //clip: true,
+ //dashStyle: null,
+ //enableMouseTracking: true,
+ events: {},
+ //legendIndex: 0,
+ //linecap: 'round',
+ lineWidth: 2,
+ //shadow: false,
+ // stacking: null,
+ marker: {
+ //enabled: true,
+ //symbol: null,
+ lineWidth: 0,
+ radius: 4,
+ lineColor: '#FFFFFF',
+ //fillColor: null,
+ states: { // states for a single point
+ hover: {
+ enabled: true,
+ lineWidthPlus: 1,
+ radiusPlus: 2
+ },
+ select: {
+ fillColor: '#FFFFFF',
+ lineColor: '#000000',
+ lineWidth: 2
+ }
+ }
+ },
+ point: {
+ events: {}
+ },
+ dataLabels: merge(defaultLabelOptions, {
+ align: 'center',
+ //defer: true,
+ enabled: false,
+ formatter: function () {
+ return this.y === null ? '' : numberFormat(this.y, -1);
+ },
+ verticalAlign: 'bottom', // above singular point
+ y: 0
+ // backgroundColor: undefined,
+ // borderColor: undefined,
+ // borderRadius: undefined,
+ // borderWidth: undefined,
+ // padding: 3,
+ // shadow: false
+ }),
+ cropThreshold: 300, // draw points outside the plot area when the number of points is less than this
+ pointRange: 0,
+ //pointStart: 0,
+ //pointInterval: 1,
+ //showInLegend: null, // auto: true for standalone series, false for linked series
+ states: { // states for the entire series
+ hover: {
+ //enabled: false,
+ lineWidthPlus: 1,
+ marker: {
+ // lineWidth: base + 1,
+ // radius: base + 1
+ },
+ halo: {
+ size: 10,
+ opacity: 0.25
+ }
+ },
+ select: {
+ marker: {}
+ }
+ },
+ stickyTracking: true,
+ //tooltip: {
+ //pointFormat: '\u25CF {series.name}: {point.y}'
+ //valueDecimals: null,
+ //xDateFormat: '%A, %b %e, %Y',
+ //valuePrefix: '',
+ //ySuffix: ''
+ //}
+ turboThreshold: 1000
+ // zIndex: null
+ }
+ },
+ labels: {
+ //items: [],
+ style: {
+ //font: defaultFont,
+ position: ABSOLUTE,
+ color: '#3E576F'
+ }
+ },
+ legend: {
+ enabled: true,
+ align: 'center',
+ //floating: false,
+ layout: 'horizontal',
+ labelFormatter: function () {
+ return this.name;
+ },
+ //borderWidth: 0,
+ borderColor: '#909090',
+ borderRadius: 0,
+ navigation: {
+ // animation: true,
+ activeColor: '#274b6d',
+ // arrowSize: 12
+ inactiveColor: '#CCC'
+ // style: {} // text styles
+ },
+ // margin: 20,
+ // reversed: false,
+ shadow: false,
+ // backgroundColor: null,
+ /*style: {
+ padding: '5px'
+ },*/
+ itemStyle: {
+ color: '#333333',
+ fontSize: '12px',
+ fontWeight: 'bold'
+ },
+ itemHoverStyle: {
+ //cursor: 'pointer', removed as of #601
+ color: '#000'
+ },
+ itemHiddenStyle: {
+ color: '#CCC'
+ },
+ itemCheckboxStyle: {
+ position: ABSOLUTE,
+ width: '13px', // for IE precision
+ height: '13px'
+ },
+ // itemWidth: undefined,
+ // symbolRadius: 0,
+ // symbolWidth: 16,
+ symbolPadding: 5,
+ verticalAlign: 'bottom',
+ // width: undefined,
+ x: 0,
+ y: 0,
+ title: {
+ //text: null,
+ style: {
+ fontWeight: 'bold'
+ }
+ }
+ },
+
+ loading: {
+ // hideDuration: 100,
+ labelStyle: {
+ fontWeight: 'bold',
+ position: RELATIVE,
+ top: '45%'
+ },
+ // showDuration: 0,
+ style: {
+ position: ABSOLUTE,
+ backgroundColor: 'white',
+ opacity: 0.5,
+ textAlign: 'center'
+ }
+ },
+
+ tooltip: {
+ enabled: true,
+ animation: hasSVG,
+ //crosshairs: null,
+ backgroundColor: 'rgba(249, 249, 249, .85)',
+ borderWidth: 1,
+ borderRadius: 3,
+ dateTimeLabelFormats: {
+ millisecond: '%A, %b %e, %H:%M:%S.%L',
+ second: '%A, %b %e, %H:%M:%S',
+ minute: '%A, %b %e, %H:%M',
+ hour: '%A, %b %e, %H:%M',
+ day: '%A, %b %e, %Y',
+ week: 'Week from %A, %b %e, %Y',
+ month: '%B %Y',
+ year: '%Y'
+ },
+ //formatter: defaultFormatter,
+ headerFormat: '{point.key} ',
+ pointFormat: '\u25CF {series.name}: {point.y} ',
+ shadow: true,
+ //shape: 'callout',
+ //shared: false,
+ snap: isTouchDevice ? 25 : 10,
+ style: {
+ color: '#333333',
+ cursor: 'default',
+ fontSize: '12px',
+ padding: '8px',
+ whiteSpace: 'nowrap'
+ }
+ //xDateFormat: '%A, %b %e, %Y',
+ //valueDecimals: null,
+ //valuePrefix: '',
+ //valueSuffix: ''
+ },
+
+ credits: {
+ enabled: true,
+ text: 'Highcharts.com',
+ href: 'http://www.highcharts.com',
+ position: {
+ align: 'right',
+ x: -10,
+ verticalAlign: 'bottom',
+ y: -5
+ },
+ style: {
+ cursor: 'pointer',
+ color: '#909090',
+ fontSize: '9px'
+ }
+ }
+ };
+
+
+
+
+ // Series defaults
+ var defaultPlotOptions = defaultOptions.plotOptions,
+ defaultSeriesOptions = defaultPlotOptions.line;
+
+ // set the default time methods
+ setTimeMethods();
+
+
+
+ /**
+ * Set the time methods globally based on the useUTC option. Time method can be either
+ * local time or UTC (default).
+ */
+ function setTimeMethods() {
+ var useUTC = defaultOptions.global.useUTC,
+ GET = useUTC ? 'getUTC' : 'get',
+ SET = useUTC ? 'setUTC' : 'set';
+
+
+ Date = defaultOptions.global.Date || window.Date;
+ timezoneOffset = ((useUTC && defaultOptions.global.timezoneOffset) || 0) * 60000;
+ makeTime = useUTC ? Date.UTC : function (year, month, date, hours, minutes, seconds) {
+ return new Date(
+ year,
+ month,
+ pick(date, 1),
+ pick(hours, 0),
+ pick(minutes, 0),
+ pick(seconds, 0)
+ ).getTime();
+ };
+ getMinutes = GET + 'Minutes';
+ getHours = GET + 'Hours';
+ getDay = GET + 'Day';
+ getDate = GET + 'Date';
+ getMonth = GET + 'Month';
+ getFullYear = GET + 'FullYear';
+ setMinutes = SET + 'Minutes';
+ setHours = SET + 'Hours';
+ setDate = SET + 'Date';
+ setMonth = SET + 'Month';
+ setFullYear = SET + 'FullYear';
+
+ }
+
+ /**
+ * Merge the default options with custom options and return the new options structure
+ * @param {Object} options The new custom options
+ */
+ function setOptions(options) {
+
+ // Copy in the default options
+ defaultOptions = merge(true, defaultOptions, options);
+
+ // Apply UTC
+ setTimeMethods();
+
+ return defaultOptions;
+ }
+
+ /**
+ * Get the updated default options. Until 3.0.7, merely exposing defaultOptions for outside modules
+ * wasn't enough because the setOptions method created a new object.
+ */
+ function getOptions() {
+ return defaultOptions;
+ }
+
+
+
+
+ /**
+ * Handle color operations. The object methods are chainable.
+ * @param {String} input The input color in either rbga or hex format
+ */
+ var rgbaRegEx = /rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,
+ hexRegEx = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,
+ rgbRegEx = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/;
+
+ var Color = function (input) {
+ // declare variables
+ var rgba = [], result, stops;
+
+ /**
+ * Parse the input color to rgba array
+ * @param {String} input
+ */
+ function init(input) {
+
+ // Gradients
+ if (input && input.stops) {
+ stops = map(input.stops, function (stop) {
+ return Color(stop[1]);
+ });
+
+ // Solid colors
+ } else {
+ // rgba
+ result = rgbaRegEx.exec(input);
+ if (result) {
+ rgba = [pInt(result[1]), pInt(result[2]), pInt(result[3]), parseFloat(result[4], 10)];
+ } else {
+ // hex
+ result = hexRegEx.exec(input);
+ if (result) {
+ rgba = [pInt(result[1], 16), pInt(result[2], 16), pInt(result[3], 16), 1];
+ } else {
+ // rgb
+ result = rgbRegEx.exec(input);
+ if (result) {
+ rgba = [pInt(result[1]), pInt(result[2]), pInt(result[3]), 1];
+ }
+ }
+ }
+ }
+
+ }
+ /**
+ * Return the color a specified format
+ * @param {String} format
+ */
+ function get(format) {
+ var ret;
+
+ if (stops) {
+ ret = merge(input);
+ ret.stops = [].concat(ret.stops);
+ each(stops, function (stop, i) {
+ ret.stops[i] = [ret.stops[i][0], stop.get(format)];
+ });
+
+ // it's NaN if gradient colors on a column chart
+ } else if (rgba && !isNaN(rgba[0])) {
+ if (format === 'rgb') {
+ ret = 'rgb(' + rgba[0] + ',' + rgba[1] + ',' + rgba[2] + ')';
+ } else if (format === 'a') {
+ ret = rgba[3];
+ } else {
+ ret = 'rgba(' + rgba.join(',') + ')';
+ }
+ } else {
+ ret = input;
+ }
+ return ret;
+ }
+
+ /**
+ * Brighten the color
+ * @param {Number} alpha
+ */
+ function brighten(alpha) {
+ if (stops) {
+ each(stops, function (stop) {
+ stop.brighten(alpha);
+ });
+
+ } else if (isNumber(alpha) && alpha !== 0) {
+ var i;
+ for (i = 0; i < 3; i++) {
+ rgba[i] += pInt(alpha * 255);
+
+ if (rgba[i] < 0) {
+ rgba[i] = 0;
+ }
+ if (rgba[i] > 255) {
+ rgba[i] = 255;
+ }
+ }
+ }
+ return this;
+ }
+ /**
+ * Set the color's opacity to a given alpha value
+ * @param {Number} alpha
+ */
+ function setOpacity(alpha) {
+ rgba[3] = alpha;
+ return this;
+ }
+
+ // initialize: parse the input
+ init(input);
+
+ // public methods
+ return {
+ get: get,
+ brighten: brighten,
+ rgba: rgba,
+ setOpacity: setOpacity
+ };
+ };
+
+
+
+
+ /**
+ * A wrapper object for SVG elements
+ */
+ function SVGElement() {}
+
+ SVGElement.prototype = {
+
+ // Default base for animation
+ opacity: 1,
+ // For labels, these CSS properties are applied to the node directly
+ textProps: ['fontSize', 'fontWeight', 'fontFamily', 'color',
+ 'lineHeight', 'width', 'textDecoration', 'textShadow', 'HcTextStroke'],
+
+ /**
+ * Initialize the SVG renderer
+ * @param {Object} renderer
+ * @param {String} nodeName
+ */
+ init: function (renderer, nodeName) {
+ var wrapper = this;
+ wrapper.element = nodeName === 'span' ?
+ createElement(nodeName) :
+ doc.createElementNS(SVG_NS, nodeName);
+ wrapper.renderer = renderer;
+ },
+
+ /**
+ * Animate a given attribute
+ * @param {Object} params
+ * @param {Number} options The same options as in jQuery animation
+ * @param {Function} complete Function to perform at the end of animation
+ */
+ animate: function (params, options, complete) {
+ var animOptions = pick(options, globalAnimation, true);
+ stop(this); // stop regardless of animation actually running, or reverting to .attr (#607)
+ if (animOptions) {
+ animOptions = merge(animOptions, {}); //#2625
+ if (complete) { // allows using a callback with the global animation without overwriting it
+ animOptions.complete = complete;
+ }
+ animate(this, params, animOptions);
+ } else {
+ this.attr(params);
+ if (complete) {
+ complete();
+ }
+ }
+ return this;
+ },
+
+ /**
+ * Build an SVG gradient out of a common JavaScript configuration object
+ */
+ colorGradient: function (color, prop, elem) {
+ var renderer = this.renderer,
+ colorObject,
+ gradName,
+ gradAttr,
+ gradients,
+ gradientObject,
+ stops,
+ stopColor,
+ stopOpacity,
+ radialReference,
+ n,
+ id,
+ key = [];
+
+ // Apply linear or radial gradients
+ if (color.linearGradient) {
+ gradName = 'linearGradient';
+ } else if (color.radialGradient) {
+ gradName = 'radialGradient';
+ }
+
+ if (gradName) {
+ gradAttr = color[gradName];
+ gradients = renderer.gradients;
+ stops = color.stops;
+ radialReference = elem.radialReference;
+
+ // Keep < 2.2 kompatibility
+ if (isArray(gradAttr)) {
+ color[gradName] = gradAttr = {
+ x1: gradAttr[0],
+ y1: gradAttr[1],
+ x2: gradAttr[2],
+ y2: gradAttr[3],
+ gradientUnits: 'userSpaceOnUse'
+ };
+ }
+
+ // Correct the radial gradient for the radial reference system
+ if (gradName === 'radialGradient' && radialReference && !defined(gradAttr.gradientUnits)) {
+ gradAttr = merge(gradAttr, {
+ cx: (radialReference[0] - radialReference[2] / 2) + gradAttr.cx * radialReference[2],
+ cy: (radialReference[1] - radialReference[2] / 2) + gradAttr.cy * radialReference[2],
+ r: gradAttr.r * radialReference[2],
+ gradientUnits: 'userSpaceOnUse'
+ });
+ }
+
+ // Build the unique key to detect whether we need to create a new element (#1282)
+ for (n in gradAttr) {
+ if (n !== 'id') {
+ key.push(n, gradAttr[n]);
+ }
+ }
+ for (n in stops) {
+ key.push(stops[n]);
+ }
+ key = key.join(',');
+
+ // Check if a gradient object with the same config object is created within this renderer
+ if (gradients[key]) {
+ id = gradients[key].attr('id');
+
+ } else {
+
+ // Set the id and create the element
+ gradAttr.id = id = PREFIX + idCounter++;
+ gradients[key] = gradientObject = renderer.createElement(gradName)
+ .attr(gradAttr)
+ .add(renderer.defs);
+
+
+ // The gradient needs to keep a list of stops to be able to destroy them
+ gradientObject.stops = [];
+ each(stops, function (stop) {
+ var stopObject;
+ if (stop[1].indexOf('rgba') === 0) {
+ colorObject = Color(stop[1]);
+ stopColor = colorObject.get('rgb');
+ stopOpacity = colorObject.get('a');
+ } else {
+ stopColor = stop[1];
+ stopOpacity = 1;
+ }
+ stopObject = renderer.createElement('stop').attr({
+ offset: stop[0],
+ 'stop-color': stopColor,
+ 'stop-opacity': stopOpacity
+ }).add(gradientObject);
+
+ // Add the stop element to the gradient
+ gradientObject.stops.push(stopObject);
+ });
+ }
+
+ // Set the reference to the gradient object
+ elem.setAttribute(prop, 'url(' + renderer.url + '#' + id + ')');
+ }
+ },
+
+ /**
+ * Set or get a given attribute
+ * @param {Object|String} hash
+ * @param {Mixed|Undefined} val
+ */
+ attr: function (hash, val) {
+ var key,
+ value,
+ element = this.element,
+ hasSetSymbolSize,
+ ret = this,
+ skipAttr;
+
+ // single key-value pair
+ if (typeof hash === 'string' && val !== UNDEFINED) {
+ key = hash;
+ hash = {};
+ hash[key] = val;
+ }
+
+ // used as a getter: first argument is a string, second is undefined
+ if (typeof hash === 'string') {
+ ret = (this[hash + 'Getter'] || this._defaultGetter).call(this, hash, element);
+
+ // setter
+ } else {
+
+ for (key in hash) {
+ value = hash[key];
+ skipAttr = false;
+
+
+
+ if (this.symbolName && /^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(key)) {
+ if (!hasSetSymbolSize) {
+ this.symbolAttr(hash);
+ hasSetSymbolSize = true;
+ }
+ skipAttr = true;
+ }
+
+ if (this.rotation && (key === 'x' || key === 'y')) {
+ this.doTransform = true;
+ }
+
+ if (!skipAttr) {
+ (this[key + 'Setter'] || this._defaultSetter).call(this, value, key, element);
+ }
+
+ // Let the shadow follow the main element
+ if (this.shadows && /^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(key)) {
+ this.updateShadows(key, value);
+ }
+ }
+
+ // Update transform. Do this outside the loop to prevent redundant updating for batch setting
+ // of attributes.
+ if (this.doTransform) {
+ this.updateTransform();
+ this.doTransform = false;
+ }
+
+ }
+
+ return ret;
+ },
+
+ updateShadows: function (key, value) {
+ var shadows = this.shadows,
+ i = shadows.length;
+ while (i--) {
+ shadows[i].setAttribute(
+ key,
+ key === 'height' ?
+ mathMax(value - (shadows[i].cutHeight || 0), 0) :
+ key === 'd' ? this.d : value
+ );
+ }
+ },
+
+ /**
+ * Add a class name to an element
+ */
+ addClass: function (className) {
+ var element = this.element,
+ currentClassName = attr(element, 'class') || '';
+
+ if (currentClassName.indexOf(className) === -1) {
+ attr(element, 'class', currentClassName + ' ' + className);
+ }
+ return this;
+ },
+ /* hasClass and removeClass are not (yet) needed
+ hasClass: function (className) {
+ return attr(this.element, 'class').indexOf(className) !== -1;
+ },
+ removeClass: function (className) {
+ attr(this.element, 'class', attr(this.element, 'class').replace(className, ''));
+ return this;
+ },
+ */
+
+ /**
+ * If one of the symbol size affecting parameters are changed,
+ * check all the others only once for each call to an element's
+ * .attr() method
+ * @param {Object} hash
+ */
+ symbolAttr: function (hash) {
+ var wrapper = this;
+
+ each(['x', 'y', 'r', 'start', 'end', 'width', 'height', 'innerR', 'anchorX', 'anchorY'], function (key) {
+ wrapper[key] = pick(hash[key], wrapper[key]);
+ });
+
+ wrapper.attr({
+ d: wrapper.renderer.symbols[wrapper.symbolName](
+ wrapper.x,
+ wrapper.y,
+ wrapper.width,
+ wrapper.height,
+ wrapper
+ )
+ });
+ },
+
+ /**
+ * Apply a clipping path to this object
+ * @param {String} id
+ */
+ clip: function (clipRect) {
+ return this.attr('clip-path', clipRect ? 'url(' + this.renderer.url + '#' + clipRect.id + ')' : NONE);
+ },
+
+ /**
+ * Calculate the coordinates needed for drawing a rectangle crisply and return the
+ * calculated attributes
+ * @param {Number} strokeWidth
+ * @param {Number} x
+ * @param {Number} y
+ * @param {Number} width
+ * @param {Number} height
+ */
+ crisp: function (rect) {
+
+ var wrapper = this,
+ key,
+ attribs = {},
+ normalizer,
+ strokeWidth = rect.strokeWidth || wrapper.strokeWidth || 0;
+
+ normalizer = mathRound(strokeWidth) % 2 / 2; // mathRound because strokeWidth can sometimes have roundoff errors
+
+ // normalize for crisp edges
+ rect.x = mathFloor(rect.x || wrapper.x || 0) + normalizer;
+ rect.y = mathFloor(rect.y || wrapper.y || 0) + normalizer;
+ rect.width = mathFloor((rect.width || wrapper.width || 0) - 2 * normalizer);
+ rect.height = mathFloor((rect.height || wrapper.height || 0) - 2 * normalizer);
+ rect.strokeWidth = strokeWidth;
+
+ for (key in rect) {
+ if (wrapper[key] !== rect[key]) { // only set attribute if changed
+ wrapper[key] = attribs[key] = rect[key];
+ }
+ }
+
+ return attribs;
+ },
+
+ /**
+ * Set styles for the element
+ * @param {Object} styles
+ */
+ css: function (styles) {
+ var elemWrapper = this,
+ oldStyles = elemWrapper.styles,
+ newStyles = {},
+ elem = elemWrapper.element,
+ textWidth,
+ n,
+ serializedCss = '',
+ hyphenate,
+ hasNew = !oldStyles;
+
+ // convert legacy
+ if (styles && styles.color) {
+ styles.fill = styles.color;
+ }
+
+ // Filter out existing styles to increase performance (#2640)
+ if (oldStyles) {
+ for (n in styles) {
+ if (styles[n] !== oldStyles[n]) {
+ newStyles[n] = styles[n];
+ hasNew = true;
+ }
+ }
+ }
+ if (hasNew) {
+ textWidth = elemWrapper.textWidth = styles && styles.width && elem.nodeName.toLowerCase() === 'text' && pInt(styles.width);
+
+ // Merge the new styles with the old ones
+ if (oldStyles) {
+ styles = extend(
+ oldStyles,
+ newStyles
+ );
+ }
+
+ // store object
+ elemWrapper.styles = styles;
+
+ if (textWidth && (useCanVG || (!hasSVG && elemWrapper.renderer.forExport))) {
+ delete styles.width;
+ }
+
+ // serialize and set style attribute
+ if (isIE && !hasSVG) {
+ css(elemWrapper.element, styles);
+ } else {
+ /*jslint unparam: true*/
+ hyphenate = function (a, b) { return '-' + b.toLowerCase(); };
+ /*jslint unparam: false*/
+ for (n in styles) {
+ serializedCss += n.replace(/([A-Z])/g, hyphenate) + ':' + styles[n] + ';';
+ }
+ attr(elem, 'style', serializedCss); // #1881
+ }
+
+
+ // re-build text
+ if (textWidth && elemWrapper.added) {
+ elemWrapper.renderer.buildText(elemWrapper);
+ }
+ }
+
+ return elemWrapper;
+ },
+
+ /**
+ * Add an event listener
+ * @param {String} eventType
+ * @param {Function} handler
+ */
+ on: function (eventType, handler) {
+ var svgElement = this,
+ element = svgElement.element;
+
+ // touch
+ if (hasTouch && eventType === 'click') {
+ element.ontouchstart = function (e) {
+ svgElement.touchEventFired = Date.now();
+ e.preventDefault();
+ handler.call(element, e);
+ };
+ element.onclick = function (e) {
+ if (userAgent.indexOf('Android') === -1 || Date.now() - (svgElement.touchEventFired || 0) > 1100) { // #2269
+ handler.call(element, e);
+ }
+ };
+ } else {
+ // simplest possible event model for internal use
+ element['on' + eventType] = handler;
+ }
+ return this;
+ },
+
+ /**
+ * Set the coordinates needed to draw a consistent radial gradient across
+ * pie slices regardless of positioning inside the chart. The format is
+ * [centerX, centerY, diameter] in pixels.
+ */
+ setRadialReference: function (coordinates) {
+ this.element.radialReference = coordinates;
+ return this;
+ },
+
+ /**
+ * Move an object and its children by x and y values
+ * @param {Number} x
+ * @param {Number} y
+ */
+ translate: function (x, y) {
+ return this.attr({
+ translateX: x,
+ translateY: y
+ });
+ },
+
+ /**
+ * Invert a group, rotate and flip
+ */
+ invert: function () {
+ var wrapper = this;
+ wrapper.inverted = true;
+ wrapper.updateTransform();
+ return wrapper;
+ },
+
+ /**
+ * Private method to update the transform attribute based on internal
+ * properties
+ */
+ updateTransform: function () {
+ var wrapper = this,
+ translateX = wrapper.translateX || 0,
+ translateY = wrapper.translateY || 0,
+ scaleX = wrapper.scaleX,
+ scaleY = wrapper.scaleY,
+ inverted = wrapper.inverted,
+ rotation = wrapper.rotation,
+ element = wrapper.element,
+ transform;
+
+ // flipping affects translate as adjustment for flipping around the group's axis
+ if (inverted) {
+ translateX += wrapper.attr('width');
+ translateY += wrapper.attr('height');
+ }
+
+ // Apply translate. Nearly all transformed elements have translation, so instead
+ // of checking for translate = 0, do it always (#1767, #1846).
+ transform = ['translate(' + translateX + ',' + translateY + ')'];
+
+ // apply rotation
+ if (inverted) {
+ transform.push('rotate(90) scale(-1,1)');
+ } else if (rotation) { // text rotation
+ transform.push('rotate(' + rotation + ' ' + (element.getAttribute('x') || 0) + ' ' + (element.getAttribute('y') || 0) + ')');
+ }
+
+ // apply scale
+ if (defined(scaleX) || defined(scaleY)) {
+ transform.push('scale(' + pick(scaleX, 1) + ' ' + pick(scaleY, 1) + ')');
+ }
+
+ if (transform.length) {
+ element.setAttribute('transform', transform.join(' '));
+ }
+ },
+ /**
+ * Bring the element to the front
+ */
+ toFront: function () {
+ var element = this.element;
+ element.parentNode.appendChild(element);
+ return this;
+ },
+
+
+ /**
+ * Break down alignment options like align, verticalAlign, x and y
+ * to x and y relative to the chart.
+ *
+ * @param {Object} alignOptions
+ * @param {Boolean} alignByTranslate
+ * @param {String[Object} box The box to align to, needs a width and height. When the
+ * box is a string, it refers to an object in the Renderer. For example, when
+ * box is 'spacingBox', it refers to Renderer.spacingBox which holds width, height
+ * x and y properties.
+ *
+ */
+ align: function (alignOptions, alignByTranslate, box) {
+ var align,
+ vAlign,
+ x,
+ y,
+ attribs = {},
+ alignTo,
+ renderer = this.renderer,
+ alignedObjects = renderer.alignedObjects;
+
+ // First call on instanciate
+ if (alignOptions) {
+ this.alignOptions = alignOptions;
+ this.alignByTranslate = alignByTranslate;
+ if (!box || isString(box)) { // boxes other than renderer handle this internally
+ this.alignTo = alignTo = box || 'renderer';
+ erase(alignedObjects, this); // prevent duplicates, like legendGroup after resize
+ alignedObjects.push(this);
+ box = null; // reassign it below
+ }
+
+ // When called on resize, no arguments are supplied
+ } else {
+ alignOptions = this.alignOptions;
+ alignByTranslate = this.alignByTranslate;
+ alignTo = this.alignTo;
+ }
+
+ box = pick(box, renderer[alignTo], renderer);
+
+ // Assign variables
+ align = alignOptions.align;
+ vAlign = alignOptions.verticalAlign;
+ x = (box.x || 0) + (alignOptions.x || 0); // default: left align
+ y = (box.y || 0) + (alignOptions.y || 0); // default: top align
+
+ // Align
+ if (align === 'right' || align === 'center') {
+ x += (box.width - (alignOptions.width || 0)) /
+ { right: 1, center: 2 }[align];
+ }
+ attribs[alignByTranslate ? 'translateX' : 'x'] = mathRound(x);
+
+
+ // Vertical align
+ if (vAlign === 'bottom' || vAlign === 'middle') {
+ y += (box.height - (alignOptions.height || 0)) /
+ ({ bottom: 1, middle: 2 }[vAlign] || 1);
+
+ }
+ attribs[alignByTranslate ? 'translateY' : 'y'] = mathRound(y);
+
+ // Animate only if already placed
+ this[this.placed ? 'animate' : 'attr'](attribs);
+ this.placed = true;
+ this.alignAttr = attribs;
+
+ return this;
+ },
+
+ /**
+ * Get the bounding box (width, height, x and y) for the element
+ */
+ getBBox: function () {
+ var wrapper = this,
+ bBox = wrapper.bBox,
+ renderer = wrapper.renderer,
+ width,
+ height,
+ rotation = wrapper.rotation,
+ element = wrapper.element,
+ styles = wrapper.styles,
+ rad = rotation * deg2rad,
+ textStr = wrapper.textStr,
+ cacheKey;
+
+ // Since numbers are monospaced, and numerical labels appear a lot in a chart,
+ // we assume that a label of n characters has the same bounding box as others
+ // of the same length.
+ if (textStr === '' || numRegex.test(textStr)) {
+ cacheKey = 'num.' + textStr.toString().length + (styles ? ('|' + styles.fontSize + '|' + styles.fontFamily) : '');
+
+ } //else { // This code block made demo/waterfall fail, related to buildText
+ // Caching all strings reduces rendering time by 4-5%.
+ // TODO: Check how this affects places where bBox is found on the element
+ //cacheKey = textStr + (styles ? ('|' + styles.fontSize + '|' + styles.fontFamily) : '');
+ //}
+ if (cacheKey) {
+ bBox = renderer.cache[cacheKey];
+ }
+
+ // No cache found
+ if (!bBox) {
+
+ // SVG elements
+ if (element.namespaceURI === SVG_NS || renderer.forExport) {
+ try { // Fails in Firefox if the container has display: none.
+
+ bBox = element.getBBox ?
+ // SVG: use extend because IE9 is not allowed to change width and height in case
+ // of rotation (below)
+ extend({}, element.getBBox()) :
+ // Canvas renderer and legacy IE in export mode
+ {
+ width: element.offsetWidth,
+ height: element.offsetHeight
+ };
+ } catch (e) {}
+
+ // If the bBox is not set, the try-catch block above failed. The other condition
+ // is for Opera that returns a width of -Infinity on hidden elements.
+ if (!bBox || bBox.width < 0) {
+ bBox = { width: 0, height: 0 };
+ }
+
+
+ // VML Renderer or useHTML within SVG
+ } else {
+
+ bBox = wrapper.htmlGetBBox();
+
+ }
+
+ // True SVG elements as well as HTML elements in modern browsers using the .useHTML option
+ // need to compensated for rotation
+ if (renderer.isSVG) {
+ width = bBox.width;
+ height = bBox.height;
+
+ // Workaround for wrong bounding box in IE9 and IE10 (#1101, #1505, #1669, #2568)
+ if (isIE && styles && styles.fontSize === '11px' && height.toPrecision(3) === '16.9') {
+ bBox.height = height = 14;
+ }
+
+ // Adjust for rotated text
+ if (rotation) {
+ bBox.width = mathAbs(height * mathSin(rad)) + mathAbs(width * mathCos(rad));
+ bBox.height = mathAbs(height * mathCos(rad)) + mathAbs(width * mathSin(rad));
+ }
+ }
+
+ // Cache it
+ wrapper.bBox = bBox;
+ if (cacheKey) {
+ renderer.cache[cacheKey] = bBox;
+ }
+ }
+ return bBox;
+ },
+
+ /**
+ * Show the element
+ */
+ show: function (inherit) {
+ // IE9-11 doesn't handle visibilty:inherit well, so we remove the attribute instead (#2881)
+ if (inherit && this.element.namespaceURI === SVG_NS) {
+ this.element.removeAttribute('visibility');
+ } else {
+ this.attr({ visibility: inherit ? 'inherit' : VISIBLE });
+ }
+ return this;
+ },
+
+ /**
+ * Hide the element
+ */
+ hide: function () {
+ return this.attr({ visibility: HIDDEN });
+ },
+
+ fadeOut: function (duration) {
+ var elemWrapper = this;
+ elemWrapper.animate({
+ opacity: 0
+ }, {
+ duration: duration || 150,
+ complete: function () {
+ elemWrapper.attr({ y: -9999 }); // #3088, assuming we're only using this for tooltips
+ }
+ });
+ },
+
+ /**
+ * Add the element
+ * @param {Object|Undefined} parent Can be an element, an element wrapper or undefined
+ * to append the element to the renderer.box.
+ */
+ add: function (parent) {
+
+ var renderer = this.renderer,
+ parentWrapper = parent || renderer,
+ parentNode = parentWrapper.element || renderer.box,
+ childNodes,
+ element = this.element,
+ zIndex = this.zIndex,
+ otherElement,
+ otherZIndex,
+ i,
+ inserted;
+
+ if (parent) {
+ this.parentGroup = parent;
+ }
+
+ // mark as inverted
+ this.parentInverted = parent && parent.inverted;
+
+ // build formatted text
+ if (this.textStr !== undefined) {
+ renderer.buildText(this);
+ }
+
+ // mark the container as having z indexed children
+ if (zIndex) {
+ parentWrapper.handleZ = true;
+ zIndex = pInt(zIndex);
+ }
+
+ // insert according to this and other elements' zIndex
+ if (parentWrapper.handleZ) { // this element or any of its siblings has a z index
+ childNodes = parentNode.childNodes;
+ for (i = 0; i < childNodes.length; i++) {
+ otherElement = childNodes[i];
+ otherZIndex = attr(otherElement, 'zIndex');
+ if (otherElement !== element && (
+ // insert before the first element with a higher zIndex
+ pInt(otherZIndex) > zIndex ||
+ // if no zIndex given, insert before the first element with a zIndex
+ (!defined(zIndex) && defined(otherZIndex))
+
+ )) {
+ parentNode.insertBefore(element, otherElement);
+ inserted = true;
+ break;
+ }
+ }
+ }
+
+ // default: append at the end
+ if (!inserted) {
+ parentNode.appendChild(element);
+ }
+
+ // mark as added
+ this.added = true;
+
+ // fire an event for internal hooks
+ if (this.onAdd) {
+ this.onAdd();
+ }
+
+ return this;
+ },
+
+ /**
+ * Removes a child either by removeChild or move to garbageBin.
+ * Issue 490; in VML removeChild results in Orphaned nodes according to sIEve, discardElement does not.
+ */
+ safeRemoveChild: function (element) {
+ var parentNode = element.parentNode;
+ if (parentNode) {
+ parentNode.removeChild(element);
+ }
+ },
+
+ /**
+ * Destroy the element and element wrapper
+ */
+ destroy: function () {
+ var wrapper = this,
+ element = wrapper.element || {},
+ shadows = wrapper.shadows,
+ parentToClean = wrapper.renderer.isSVG && element.nodeName === 'SPAN' && wrapper.parentGroup,
+ grandParent,
+ key,
+ i;
+
+ // remove events
+ element.onclick = element.onmouseout = element.onmouseover = element.onmousemove = element.point = null;
+ stop(wrapper); // stop running animations
+
+ if (wrapper.clipPath) {
+ wrapper.clipPath = wrapper.clipPath.destroy();
+ }
+
+ // Destroy stops in case this is a gradient object
+ if (wrapper.stops) {
+ for (i = 0; i < wrapper.stops.length; i++) {
+ wrapper.stops[i] = wrapper.stops[i].destroy();
+ }
+ wrapper.stops = null;
+ }
+
+ // remove element
+ wrapper.safeRemoveChild(element);
+
+ // destroy shadows
+ if (shadows) {
+ each(shadows, function (shadow) {
+ wrapper.safeRemoveChild(shadow);
+ });
+ }
+
+ // In case of useHTML, clean up empty containers emulating SVG groups (#1960, #2393, #2697).
+ while (parentToClean && parentToClean.div && parentToClean.div.childNodes.length === 0) {
+ grandParent = parentToClean.parentGroup;
+ wrapper.safeRemoveChild(parentToClean.div);
+ delete parentToClean.div;
+ parentToClean = grandParent;
+ }
+
+ // remove from alignObjects
+ if (wrapper.alignTo) {
+ erase(wrapper.renderer.alignedObjects, wrapper);
+ }
+
+ for (key in wrapper) {
+ delete wrapper[key];
+ }
+
+ return null;
+ },
+
+ /**
+ * Add a shadow to the element. Must be done after the element is added to the DOM
+ * @param {Boolean|Object} shadowOptions
+ */
+ shadow: function (shadowOptions, group, cutOff) {
+ var shadows = [],
+ i,
+ shadow,
+ element = this.element,
+ strokeWidth,
+ shadowWidth,
+ shadowElementOpacity,
+
+ // compensate for inverted plot area
+ transform;
+
+
+ if (shadowOptions) {
+ shadowWidth = pick(shadowOptions.width, 3);
+ shadowElementOpacity = (shadowOptions.opacity || 0.15) / shadowWidth;
+ transform = this.parentInverted ?
+ '(-1,-1)' :
+ '(' + pick(shadowOptions.offsetX, 1) + ', ' + pick(shadowOptions.offsetY, 1) + ')';
+ for (i = 1; i <= shadowWidth; i++) {
+ shadow = element.cloneNode(0);
+ strokeWidth = (shadowWidth * 2) + 1 - (2 * i);
+ attr(shadow, {
+ 'isShadow': 'true',
+ 'stroke': shadowOptions.color || 'black',
+ 'stroke-opacity': shadowElementOpacity * i,
+ 'stroke-width': strokeWidth,
+ 'transform': 'translate' + transform,
+ 'fill': NONE
+ });
+ if (cutOff) {
+ attr(shadow, 'height', mathMax(attr(shadow, 'height') - strokeWidth, 0));
+ shadow.cutHeight = strokeWidth;
+ }
+
+ if (group) {
+ group.element.appendChild(shadow);
+ } else {
+ element.parentNode.insertBefore(shadow, element);
+ }
+
+ shadows.push(shadow);
+ }
+
+ this.shadows = shadows;
+ }
+ return this;
+
+ },
+
+ xGetter: function (key) {
+ if (this.element.nodeName === 'circle') {
+ key = { x: 'cx', y: 'cy' }[key] || key;
+ }
+ return this._defaultGetter(key);
+ },
+
+ /**
+ * Get the current value of an attribute or pseudo attribute, used mainly
+ * for animation.
+ */
+ _defaultGetter: function (key) {
+ var ret = pick(this[key], this.element ? this.element.getAttribute(key) : null, 0);
+
+ if (/^[\-0-9\.]+$/.test(ret)) { // is numerical
+ ret = parseFloat(ret);
+ }
+ return ret;
+ },
+
+
+ dSetter: function (value, key, element) {
+ if (value && value.join) { // join path
+ value = value.join(' ');
+ }
+ if (/(NaN| {2}|^$)/.test(value)) {
+ value = 'M 0 0';
+ }
+ element.setAttribute(key, value);
+
+ this[key] = value;
+ },
+ dashstyleSetter: function (value) {
+ var i;
+ value = value && value.toLowerCase();
+ if (value) {
+ value = value
+ .replace('shortdashdotdot', '3,1,1,1,1,1,')
+ .replace('shortdashdot', '3,1,1,1')
+ .replace('shortdot', '1,1,')
+ .replace('shortdash', '3,1,')
+ .replace('longdash', '8,3,')
+ .replace(/dot/g, '1,3,')
+ .replace('dash', '4,3,')
+ .replace(/,$/, '')
+ .split(','); // ending comma
+
+ i = value.length;
+ while (i--) {
+ value[i] = pInt(value[i]) * this['stroke-width'];
+ }
+ value = value.join(',')
+ .replace('NaN', 'none'); // #3226
+ this.element.setAttribute('stroke-dasharray', value);
+ }
+ },
+ alignSetter: function (value) {
+ this.element.setAttribute('text-anchor', { left: 'start', center: 'middle', right: 'end' }[value]);
+ },
+ opacitySetter: function (value, key, element) {
+ this[key] = value;
+ element.setAttribute(key, value);
+ },
+ titleSetter: function (value) {
+ var titleNode = this.element.getElementsByTagName('title')[0];
+ if (!titleNode) {
+ titleNode = doc.createElementNS(SVG_NS, 'title');
+ this.element.appendChild(titleNode);
+ }
+ titleNode.textContent = pick(value, '').replace(/<[^>]*>/g, ''); // #3276
+ },
+ textSetter: function (value) {
+ if (value !== this.textStr) {
+ // Delete bBox memo when the text changes
+ delete this.bBox;
+
+ this.textStr = value;
+ if (this.added) {
+ this.renderer.buildText(this);
+ }
+ }
+ },
+ fillSetter: function (value, key, element) {
+ if (typeof value === 'string') {
+ element.setAttribute(key, value);
+ } else if (value) {
+ this.colorGradient(value, key, element);
+ }
+ },
+ zIndexSetter: function (value, key, element) {
+ element.setAttribute(key, value);
+ this[key] = value;
+ },
+ _defaultSetter: function (value, key, element) {
+ element.setAttribute(key, value);
+ }
+ };
+
+ // Some shared setters and getters
+ SVGElement.prototype.yGetter = SVGElement.prototype.xGetter;
+ SVGElement.prototype.translateXSetter = SVGElement.prototype.translateYSetter =
+ SVGElement.prototype.rotationSetter = SVGElement.prototype.verticalAlignSetter =
+ SVGElement.prototype.scaleXSetter = SVGElement.prototype.scaleYSetter = function (value, key) {
+ this[key] = value;
+ this.doTransform = true;
+ };
+
+ // WebKit and Batik have problems with a stroke-width of zero, so in this case we remove the
+ // stroke attribute altogether. #1270, #1369, #3065, #3072.
+ SVGElement.prototype['stroke-widthSetter'] = SVGElement.prototype.strokeSetter = function (value, key, element) {
+ this[key] = value;
+ // Only apply the stroke attribute if the stroke width is defined and larger than 0
+ if (this.stroke && this['stroke-width']) {
+ this.strokeWidth = this['stroke-width'];
+ SVGElement.prototype.fillSetter.call(this, this.stroke, 'stroke', element); // use prototype as instance may be overridden
+ element.setAttribute('stroke-width', this['stroke-width']);
+ this.hasStroke = true;
+ } else if (key === 'stroke-width' && value === 0 && this.hasStroke) {
+ element.removeAttribute('stroke');
+ this.hasStroke = false;
+ }
+ };
+
+
+ /**
+ * The default SVG renderer
+ */
+ var SVGRenderer = function () {
+ this.init.apply(this, arguments);
+ };
+ SVGRenderer.prototype = {
+ Element: SVGElement,
+
+ /**
+ * Initialize the SVGRenderer
+ * @param {Object} container
+ * @param {Number} width
+ * @param {Number} height
+ * @param {Boolean} forExport
+ */
+ init: function (container, width, height, style, forExport) {
+ var renderer = this,
+ loc = location,
+ boxWrapper,
+ element,
+ desc;
+
+ boxWrapper = renderer.createElement('svg')
+ .attr({
+ version: '1.1'
+ })
+ .css(this.getStyle(style));
+ element = boxWrapper.element;
+ container.appendChild(element);
+
+ // For browsers other than IE, add the namespace attribute (#1978)
+ if (container.innerHTML.indexOf('xmlns') === -1) {
+ attr(element, 'xmlns', SVG_NS);
+ }
+
+ // object properties
+ renderer.isSVG = true;
+ renderer.box = element;
+ renderer.boxWrapper = boxWrapper;
+ renderer.alignedObjects = [];
+
+ // Page url used for internal references. #24, #672, #1070
+ renderer.url = (isFirefox || isWebKit) && doc.getElementsByTagName('base').length ?
+ loc.href
+ .replace(/#.*?$/, '') // remove the hash
+ .replace(/([\('\)])/g, '\\$1') // escape parantheses and quotes
+ .replace(/ /g, '%20') : // replace spaces (needed for Safari only)
+ '';
+
+ // Add description
+ desc = this.createElement('desc').add();
+ desc.element.appendChild(doc.createTextNode('Created with ' + PRODUCT + ' ' + VERSION));
+
+
+ renderer.defs = this.createElement('defs').add();
+ renderer.forExport = forExport;
+ renderer.gradients = {}; // Object where gradient SvgElements are stored
+ renderer.cache = {}; // Cache for numerical bounding boxes
+
+ renderer.setSize(width, height, false);
+
+
+
+ // Issue 110 workaround:
+ // In Firefox, if a div is positioned by percentage, its pixel position may land
+ // between pixels. The container itself doesn't display this, but an SVG element
+ // inside this container will be drawn at subpixel precision. In order to draw
+ // sharp lines, this must be compensated for. This doesn't seem to work inside
+ // iframes though (like in jsFiddle).
+ var subPixelFix, rect;
+ if (isFirefox && container.getBoundingClientRect) {
+ renderer.subPixelFix = subPixelFix = function () {
+ css(container, { left: 0, top: 0 });
+ rect = container.getBoundingClientRect();
+ css(container, {
+ left: (mathCeil(rect.left) - rect.left) + PX,
+ top: (mathCeil(rect.top) - rect.top) + PX
+ });
+ };
+
+ // run the fix now
+ subPixelFix();
+
+ // run it on resize
+ addEvent(win, 'resize', subPixelFix);
+ }
+ },
+
+ getStyle: function (style) {
+ return (this.style = extend({
+ fontFamily: '"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif', // default font
+ fontSize: '12px'
+ }, style));
+ },
+
+ /**
+ * Detect whether the renderer is hidden. This happens when one of the parent elements
+ * has display: none. #608.
+ */
+ isHidden: function () {
+ return !this.boxWrapper.getBBox().width;
+ },
+
+ /**
+ * Destroys the renderer and its allocated members.
+ */
+ destroy: function () {
+ var renderer = this,
+ rendererDefs = renderer.defs;
+ renderer.box = null;
+ renderer.boxWrapper = renderer.boxWrapper.destroy();
+
+ // Call destroy on all gradient elements
+ destroyObjectProperties(renderer.gradients || {});
+ renderer.gradients = null;
+
+ // Defs are null in VMLRenderer
+ // Otherwise, destroy them here.
+ if (rendererDefs) {
+ renderer.defs = rendererDefs.destroy();
+ }
+
+ // Remove sub pixel fix handler
+ // We need to check that there is a handler, otherwise all functions that are registered for event 'resize' are removed
+ // See issue #982
+ if (renderer.subPixelFix) {
+ removeEvent(win, 'resize', renderer.subPixelFix);
+ }
+
+ renderer.alignedObjects = null;
+
+ return null;
+ },
+
+ /**
+ * Create a wrapper for an SVG element
+ * @param {Object} nodeName
+ */
+ createElement: function (nodeName) {
+ var wrapper = new this.Element();
+ wrapper.init(this, nodeName);
+ return wrapper;
+ },
+
+ /**
+ * Dummy function for use in canvas renderer
+ */
+ draw: function () {},
+
+ /**
+ * Parse a simple HTML string into SVG tspans
+ *
+ * @param {Object} textNode The parent text SVG node
+ */
+ buildText: function (wrapper) {
+ var textNode = wrapper.element,
+ renderer = this,
+ forExport = renderer.forExport,
+ textStr = pick(wrapper.textStr, '').toString(),
+ hasMarkup = textStr.indexOf('<') !== -1,
+ lines,
+ childNodes = textNode.childNodes,
+ styleRegex,
+ hrefRegex,
+ parentX = attr(textNode, 'x'),
+ textStyles = wrapper.styles,
+ width = wrapper.textWidth,
+ textLineHeight = textStyles && textStyles.lineHeight,
+ textStroke = textStyles && textStyles.HcTextStroke,
+ i = childNodes.length,
+ getLineHeight = function (tspan) {
+ return textLineHeight ?
+ pInt(textLineHeight) :
+ renderer.fontMetrics(
+ /(px|em)$/.test(tspan && tspan.style.fontSize) ?
+ tspan.style.fontSize :
+ ((textStyles && textStyles.fontSize) || renderer.style.fontSize || 12),
+ tspan
+ ).h;
+ };
+
+ /// remove old text
+ while (i--) {
+ textNode.removeChild(childNodes[i]);
+ }
+
+ // Skip tspans, add text directly to text node. The forceTSpan is a hook
+ // used in text outline hack.
+ if (!hasMarkup && !textStroke && textStr.indexOf(' ') === -1) {
+ textNode.appendChild(doc.createTextNode(textStr));
+ return;
+
+ // Complex strings, add more logic
+ } else {
+
+ styleRegex = /<.*style="([^"]+)".*>/;
+ hrefRegex = /<.*href="(http[^"]+)".*>/;
+
+ if (width && !wrapper.added) {
+ this.box.appendChild(textNode); // attach it to the DOM to read offset width
+ }
+
+ if (hasMarkup) {
+ lines = textStr
+ .replace(/<(b|strong)>/g, '')
+ .replace(/<(i|em)>/g, '')
+ .replace(//g, '')
+ .split(//g);
+
+ } else {
+ lines = [textStr];
+ }
+
+
+ // remove empty line at end
+ if (lines[lines.length - 1] === '') {
+ lines.pop();
+ }
+
+
+ // build the lines
+ each(lines, function (line, lineNo) {
+ var spans, spanNo = 0;
+
+ line = line.replace(//g, '|||');
+ spans = line.split('|||');
+
+ each(spans, function (span) {
+ if (span !== '' || spans.length === 1) {
+ var attributes = {},
+ tspan = doc.createElementNS(SVG_NS, 'tspan'),
+ spanStyle; // #390
+ if (styleRegex.test(span)) {
+ spanStyle = span.match(styleRegex)[1].replace(/(;| |^)color([ :])/, '$1fill$2');
+ attr(tspan, 'style', spanStyle);
+ }
+ if (hrefRegex.test(span) && !forExport) { // Not for export - #1529
+ attr(tspan, 'onclick', 'location.href=\"' + span.match(hrefRegex)[1] + '\"');
+ css(tspan, { cursor: 'pointer' });
+ }
+
+ span = (span.replace(/<(.|\n)*?>/g, '') || ' ')
+ .replace(/</g, '<')
+ .replace(/>/g, '>');
+
+ // Nested tags aren't supported, and cause crash in Safari (#1596)
+ if (span !== ' ') {
+
+ // add the text node
+ tspan.appendChild(doc.createTextNode(span));
+
+ if (!spanNo) { // first span in a line, align it to the left
+ if (lineNo && parentX !== null) {
+ attributes.x = parentX;
+ }
+ } else {
+ attributes.dx = 0; // #16
+ }
+
+ // add attributes
+ attr(tspan, attributes);
+
+ // Append it
+ textNode.appendChild(tspan);
+
+ // first span on subsequent line, add the line height
+ if (!spanNo && lineNo) {
+
+ // allow getting the right offset height in exporting in IE
+ if (!hasSVG && forExport) {
+ css(tspan, { display: 'block' });
+ }
+
+ // Set the line height based on the font size of either
+ // the text element or the tspan element
+ attr(
+ tspan,
+ 'dy',
+ getLineHeight(tspan)
+ );
+ }
+
+ // check width and apply soft breaks
+ if (width) {
+ var words = span.replace(/([^\^])-/g, '$1- ').split(' '), // #1273
+ hasWhiteSpace = spans.length > 1 || (words.length > 1 && textStyles.whiteSpace !== 'nowrap'),
+ tooLong,
+ actualWidth,
+ hcHeight = textStyles.HcHeight,
+ rest = [],
+ dy = getLineHeight(tspan),
+ softLineNo = 1,
+ bBox;
+
+ while (hasWhiteSpace && (words.length || rest.length)) {
+ delete wrapper.bBox; // delete cache
+ bBox = wrapper.getBBox();
+ actualWidth = bBox.width;
+
+ // Old IE cannot measure the actualWidth for SVG elements (#2314)
+ if (!hasSVG && renderer.forExport) {
+ actualWidth = renderer.measureSpanWidth(tspan.firstChild.data, wrapper.styles);
+ }
+
+ tooLong = actualWidth > width;
+ if (!tooLong || words.length === 1) { // new line needed
+ words = rest;
+ rest = [];
+ if (words.length) {
+ softLineNo++;
+ if (hcHeight && softLineNo * dy > hcHeight) {
+ words = ['...'];
+ wrapper.attr('title', wrapper.textStr);
+ } else {
+
+ tspan = doc.createElementNS(SVG_NS, 'tspan');
+ attr(tspan, {
+ dy: dy,
+ x: parentX
+ });
+ if (spanStyle) { // #390
+ attr(tspan, 'style', spanStyle);
+ }
+ textNode.appendChild(tspan);
+ }
+ }
+ if (actualWidth > width) { // a single word is pressing it out
+ width = actualWidth;
+ }
+ } else { // append to existing line tspan
+ tspan.removeChild(tspan.firstChild);
+ rest.unshift(words.pop());
+ }
+ if (words.length) {
+ tspan.appendChild(doc.createTextNode(words.join(' ').replace(/- /g, '-')));
+ }
+ }
+ }
+
+ spanNo++;
+ }
+ }
+ });
+ });
+ }
+ },
+
+ /**
+ * Create a button with preset states
+ * @param {String} text
+ * @param {Number} x
+ * @param {Number} y
+ * @param {Function} callback
+ * @param {Object} normalState
+ * @param {Object} hoverState
+ * @param {Object} pressedState
+ */
+ button: function (text, x, y, callback, normalState, hoverState, pressedState, disabledState, shape) {
+ var label = this.label(text, x, y, shape, null, null, null, null, 'button'),
+ curState = 0,
+ stateOptions,
+ stateStyle,
+ normalStyle,
+ hoverStyle,
+ pressedStyle,
+ disabledStyle,
+ verticalGradient = { x1: 0, y1: 0, x2: 0, y2: 1 };
+
+ // Normal state - prepare the attributes
+ normalState = merge({
+ 'stroke-width': 1,
+ stroke: '#CCCCCC',
+ fill: {
+ linearGradient: verticalGradient,
+ stops: [
+ [0, '#FEFEFE'],
+ [1, '#F6F6F6']
+ ]
+ },
+ r: 2,
+ padding: 5,
+ style: {
+ color: 'black'
+ }
+ }, normalState);
+ normalStyle = normalState.style;
+ delete normalState.style;
+
+ // Hover state
+ hoverState = merge(normalState, {
+ stroke: '#68A',
+ fill: {
+ linearGradient: verticalGradient,
+ stops: [
+ [0, '#FFF'],
+ [1, '#ACF']
+ ]
+ }
+ }, hoverState);
+ hoverStyle = hoverState.style;
+ delete hoverState.style;
+
+ // Pressed state
+ pressedState = merge(normalState, {
+ stroke: '#68A',
+ fill: {
+ linearGradient: verticalGradient,
+ stops: [
+ [0, '#9BD'],
+ [1, '#CDF']
+ ]
+ }
+ }, pressedState);
+ pressedStyle = pressedState.style;
+ delete pressedState.style;
+
+ // Disabled state
+ disabledState = merge(normalState, {
+ style: {
+ color: '#CCC'
+ }
+ }, disabledState);
+ disabledStyle = disabledState.style;
+ delete disabledState.style;
+
+ // Add the events. IE9 and IE10 need mouseover and mouseout to funciton (#667).
+ addEvent(label.element, isIE ? 'mouseover' : 'mouseenter', function () {
+ if (curState !== 3) {
+ label.attr(hoverState)
+ .css(hoverStyle);
+ }
+ });
+ addEvent(label.element, isIE ? 'mouseout' : 'mouseleave', function () {
+ if (curState !== 3) {
+ stateOptions = [normalState, hoverState, pressedState][curState];
+ stateStyle = [normalStyle, hoverStyle, pressedStyle][curState];
+ label.attr(stateOptions)
+ .css(stateStyle);
+ }
+ });
+
+ label.setState = function (state) {
+ label.state = curState = state;
+ if (!state) {
+ label.attr(normalState)
+ .css(normalStyle);
+ } else if (state === 2) {
+ label.attr(pressedState)
+ .css(pressedStyle);
+ } else if (state === 3) {
+ label.attr(disabledState)
+ .css(disabledStyle);
+ }
+ };
+
+ return label
+ .on('click', function () {
+ if (curState !== 3) {
+ callback.call(label);
+ }
+ })
+ .attr(normalState)
+ .css(extend({ cursor: 'default' }, normalStyle));
+ },
+
+ /**
+ * Make a straight line crisper by not spilling out to neighbour pixels
+ * @param {Array} points
+ * @param {Number} width
+ */
+ crispLine: function (points, width) {
+ // points format: [M, 0, 0, L, 100, 0]
+ // normalize to a crisp line
+ if (points[1] === points[4]) {
+ // Substract due to #1129. Now bottom and left axis gridlines behave the same.
+ points[1] = points[4] = mathRound(points[1]) - (width % 2 / 2);
+ }
+ if (points[2] === points[5]) {
+ points[2] = points[5] = mathRound(points[2]) + (width % 2 / 2);
+ }
+ return points;
+ },
+
+
+ /**
+ * Draw a path
+ * @param {Array} path An SVG path in array form
+ */
+ path: function (path) {
+ var attr = {
+ fill: NONE
+ };
+ if (isArray(path)) {
+ attr.d = path;
+ } else if (isObject(path)) { // attributes
+ extend(attr, path);
+ }
+ return this.createElement('path').attr(attr);
+ },
+
+ /**
+ * Draw and return an SVG circle
+ * @param {Number} x The x position
+ * @param {Number} y The y position
+ * @param {Number} r The radius
+ */
+ circle: function (x, y, r) {
+ var attr = isObject(x) ?
+ x :
+ {
+ x: x,
+ y: y,
+ r: r
+ },
+ wrapper = this.createElement('circle');
+
+ wrapper.xSetter = function (value) {
+ this.element.setAttribute('cx', value);
+ };
+ wrapper.ySetter = function (value) {
+ this.element.setAttribute('cy', value);
+ };
+ return wrapper.attr(attr);
+ },
+
+ /**
+ * Draw and return an arc
+ * @param {Number} x X position
+ * @param {Number} y Y position
+ * @param {Number} r Radius
+ * @param {Number} innerR Inner radius like used in donut charts
+ * @param {Number} start Starting angle
+ * @param {Number} end Ending angle
+ */
+ arc: function (x, y, r, innerR, start, end) {
+ var arc;
+
+ if (isObject(x)) {
+ y = x.y;
+ r = x.r;
+ innerR = x.innerR;
+ start = x.start;
+ end = x.end;
+ x = x.x;
+ }
+
+ // Arcs are defined as symbols for the ability to set
+ // attributes in attr and animate
+ arc = this.symbol('arc', x || 0, y || 0, r || 0, r || 0, {
+ innerR: innerR || 0,
+ start: start || 0,
+ end: end || 0
+ });
+ arc.r = r; // #959
+ return arc;
+ },
+
+ /**
+ * Draw and return a rectangle
+ * @param {Number} x Left position
+ * @param {Number} y Top position
+ * @param {Number} width
+ * @param {Number} height
+ * @param {Number} r Border corner radius
+ * @param {Number} strokeWidth A stroke width can be supplied to allow crisp drawing
+ */
+ rect: function (x, y, width, height, r, strokeWidth) {
+
+ r = isObject(x) ? x.r : r;
+
+ var wrapper = this.createElement('rect'),
+ attribs = isObject(x) ? x : x === UNDEFINED ? {} : {
+ x: x,
+ y: y,
+ width: mathMax(width, 0),
+ height: mathMax(height, 0)
+ };
+
+ if (strokeWidth !== UNDEFINED) {
+ attribs.strokeWidth = strokeWidth;
+ attribs = wrapper.crisp(attribs);
+ }
+
+ if (r) {
+ attribs.r = r;
+ }
+
+ wrapper.rSetter = function (value) {
+ attr(this.element, {
+ rx: value,
+ ry: value
+ });
+ };
+
+ return wrapper.attr(attribs);
+ },
+
+ /**
+ * Resize the box and re-align all aligned elements
+ * @param {Object} width
+ * @param {Object} height
+ * @param {Boolean} animate
+ *
+ */
+ setSize: function (width, height, animate) {
+ var renderer = this,
+ alignedObjects = renderer.alignedObjects,
+ i = alignedObjects.length;
+
+ renderer.width = width;
+ renderer.height = height;
+
+ renderer.boxWrapper[pick(animate, true) ? 'animate' : 'attr']({
+ width: width,
+ height: height
+ });
+
+ while (i--) {
+ alignedObjects[i].align();
+ }
+ },
+
+ /**
+ * Create a group
+ * @param {String} name The group will be given a class name of 'highcharts-{name}'.
+ * This can be used for styling and scripting.
+ */
+ g: function (name) {
+ var elem = this.createElement('g');
+ return defined(name) ? elem.attr({ 'class': PREFIX + name }) : elem;
+ },
+
+ /**
+ * Display an image
+ * @param {String} src
+ * @param {Number} x
+ * @param {Number} y
+ * @param {Number} width
+ * @param {Number} height
+ */
+ image: function (src, x, y, width, height) {
+ var attribs = {
+ preserveAspectRatio: NONE
+ },
+ elemWrapper;
+
+ // optional properties
+ if (arguments.length > 1) {
+ extend(attribs, {
+ x: x,
+ y: y,
+ width: width,
+ height: height
+ });
+ }
+
+ elemWrapper = this.createElement('image').attr(attribs);
+
+ // set the href in the xlink namespace
+ if (elemWrapper.element.setAttributeNS) {
+ elemWrapper.element.setAttributeNS('http://www.w3.org/1999/xlink',
+ 'href', src);
+ } else {
+ // could be exporting in IE
+ // using href throws "not supported" in ie7 and under, requries regex shim to fix later
+ elemWrapper.element.setAttribute('hc-svg-href', src);
+ }
+ return elemWrapper;
+ },
+
+ /**
+ * Draw a symbol out of pre-defined shape paths from the namespace 'symbol' object.
+ *
+ * @param {Object} symbol
+ * @param {Object} x
+ * @param {Object} y
+ * @param {Object} radius
+ * @param {Object} options
+ */
+ symbol: function (symbol, x, y, width, height, options) {
+
+ var obj,
+
+ // get the symbol definition function
+ symbolFn = this.symbols[symbol],
+
+ // check if there's a path defined for this symbol
+ path = symbolFn && symbolFn(
+ mathRound(x),
+ mathRound(y),
+ width,
+ height,
+ options
+ ),
+
+ imageElement,
+ imageRegex = /^url\((.*?)\)$/,
+ imageSrc,
+ imageSize,
+ centerImage;
+
+ if (path) {
+
+ obj = this.path(path);
+ // expando properties for use in animate and attr
+ extend(obj, {
+ symbolName: symbol,
+ x: x,
+ y: y,
+ width: width,
+ height: height
+ });
+ if (options) {
+ extend(obj, options);
+ }
+
+
+ // image symbols
+ } else if (imageRegex.test(symbol)) {
+
+ // On image load, set the size and position
+ centerImage = function (img, size) {
+ if (img.element) { // it may be destroyed in the meantime (#1390)
+ img.attr({
+ width: size[0],
+ height: size[1]
+ });
+
+ if (!img.alignByTranslate) { // #185
+ img.translate(
+ mathRound((width - size[0]) / 2), // #1378
+ mathRound((height - size[1]) / 2)
+ );
+ }
+ }
+ };
+
+ imageSrc = symbol.match(imageRegex)[1];
+ imageSize = symbolSizes[imageSrc] || (options && options.width && options.height && [options.width, options.height]);
+
+ // Ireate the image synchronously, add attribs async
+ obj = this.image(imageSrc)
+ .attr({
+ x: x,
+ y: y
+ });
+ obj.isImg = true;
+
+ if (imageSize) {
+ centerImage(obj, imageSize);
+ } else {
+ // Initialize image to be 0 size so export will still function if there's no cached sizes.
+ obj.attr({ width: 0, height: 0 });
+
+ // Create a dummy JavaScript image to get the width and height. Due to a bug in IE < 8,
+ // the created element must be assigned to a variable in order to load (#292).
+ imageElement = createElement('img', {
+ onload: function () {
+ centerImage(obj, symbolSizes[imageSrc] = [this.width, this.height]);
+ },
+ src: imageSrc
+ });
+ }
+ }
+
+ return obj;
+ },
+
+ /**
+ * An extendable collection of functions for defining symbol paths.
+ */
+ symbols: {
+ 'circle': function (x, y, w, h) {
+ var cpw = 0.166 * w;
+ return [
+ M, x + w / 2, y,
+ 'C', x + w + cpw, y, x + w + cpw, y + h, x + w / 2, y + h,
+ 'C', x - cpw, y + h, x - cpw, y, x + w / 2, y,
+ 'Z'
+ ];
+ },
+
+ 'square': function (x, y, w, h) {
+ return [
+ M, x, y,
+ L, x + w, y,
+ x + w, y + h,
+ x, y + h,
+ 'Z'
+ ];
+ },
+
+ 'triangle': function (x, y, w, h) {
+ return [
+ M, x + w / 2, y,
+ L, x + w, y + h,
+ x, y + h,
+ 'Z'
+ ];
+ },
+
+ 'triangle-down': function (x, y, w, h) {
+ return [
+ M, x, y,
+ L, x + w, y,
+ x + w / 2, y + h,
+ 'Z'
+ ];
+ },
+ 'diamond': function (x, y, w, h) {
+ return [
+ M, x + w / 2, y,
+ L, x + w, y + h / 2,
+ x + w / 2, y + h,
+ x, y + h / 2,
+ 'Z'
+ ];
+ },
+ 'arc': function (x, y, w, h, options) {
+ var start = options.start,
+ radius = options.r || w || h,
+ end = options.end - 0.001, // to prevent cos and sin of start and end from becoming equal on 360 arcs (related: #1561)
+ innerRadius = options.innerR,
+ open = options.open,
+ cosStart = mathCos(start),
+ sinStart = mathSin(start),
+ cosEnd = mathCos(end),
+ sinEnd = mathSin(end),
+ longArc = options.end - start < mathPI ? 0 : 1;
+
+ return [
+ M,
+ x + radius * cosStart,
+ y + radius * sinStart,
+ 'A', // arcTo
+ radius, // x radius
+ radius, // y radius
+ 0, // slanting
+ longArc, // long or short arc
+ 1, // clockwise
+ x + radius * cosEnd,
+ y + radius * sinEnd,
+ open ? M : L,
+ x + innerRadius * cosEnd,
+ y + innerRadius * sinEnd,
+ 'A', // arcTo
+ innerRadius, // x radius
+ innerRadius, // y radius
+ 0, // slanting
+ longArc, // long or short arc
+ 0, // clockwise
+ x + innerRadius * cosStart,
+ y + innerRadius * sinStart,
+
+ open ? '' : 'Z' // close
+ ];
+ },
+
+ /**
+ * Callout shape used for default tooltips, also used for rounded rectangles in VML
+ */
+ callout: function (x, y, w, h, options) {
+ var arrowLength = 6,
+ halfDistance = 6,
+ r = mathMin((options && options.r) || 0, w, h),
+ safeDistance = r + halfDistance,
+ anchorX = options && options.anchorX,
+ anchorY = options && options.anchorY,
+ path,
+ normalizer = mathRound(options.strokeWidth || 0) % 2 / 2; // mathRound because strokeWidth can sometimes have roundoff errors;
+
+ x += normalizer;
+ y += normalizer;
+ path = [
+ 'M', x + r, y,
+ 'L', x + w - r, y, // top side
+ 'C', x + w, y, x + w, y, x + w, y + r, // top-right corner
+ 'L', x + w, y + h - r, // right side
+ 'C', x + w, y + h, x + w, y + h, x + w - r, y + h, // bottom-right corner
+ 'L', x + r, y + h, // bottom side
+ 'C', x, y + h, x, y + h, x, y + h - r, // bottom-left corner
+ 'L', x, y + r, // left side
+ 'C', x, y, x, y, x + r, y // top-right corner
+ ];
+
+ if (anchorX && anchorX > w && anchorY > y + safeDistance && anchorY < y + h - safeDistance) { // replace right side
+ path.splice(13, 3,
+ 'L', x + w, anchorY - halfDistance,
+ x + w + arrowLength, anchorY,
+ x + w, anchorY + halfDistance,
+ x + w, y + h - r
+ );
+ } else if (anchorX && anchorX < 0 && anchorY > y + safeDistance && anchorY < y + h - safeDistance) { // replace left side
+ path.splice(33, 3,
+ 'L', x, anchorY + halfDistance,
+ x - arrowLength, anchorY,
+ x, anchorY - halfDistance,
+ x, y + r
+ );
+ } else if (anchorY && anchorY > h && anchorX > x + safeDistance && anchorX < x + w - safeDistance) { // replace bottom
+ path.splice(23, 3,
+ 'L', anchorX + halfDistance, y + h,
+ anchorX, y + h + arrowLength,
+ anchorX - halfDistance, y + h,
+ x + r, y + h
+ );
+ } else if (anchorY && anchorY < 0 && anchorX > x + safeDistance && anchorX < x + w - safeDistance) { // replace top
+ path.splice(3, 3,
+ 'L', anchorX - halfDistance, y,
+ anchorX, y - arrowLength,
+ anchorX + halfDistance, y,
+ w - r, y
+ );
+ }
+ return path;
+ }
+ },
+
+ /**
+ * Define a clipping rectangle
+ * @param {String} id
+ * @param {Number} x
+ * @param {Number} y
+ * @param {Number} width
+ * @param {Number} height
+ */
+ clipRect: function (x, y, width, height) {
+ var wrapper,
+ id = PREFIX + idCounter++,
+
+ clipPath = this.createElement('clipPath').attr({
+ id: id
+ }).add(this.defs);
+
+ wrapper = this.rect(x, y, width, height, 0).add(clipPath);
+ wrapper.id = id;
+ wrapper.clipPath = clipPath;
+
+ return wrapper;
+ },
+
+
+
+
+
+ /**
+ * Add text to the SVG object
+ * @param {String} str
+ * @param {Number} x Left position
+ * @param {Number} y Top position
+ * @param {Boolean} useHTML Use HTML to render the text
+ */
+ text: function (str, x, y, useHTML) {
+
+ // declare variables
+ var renderer = this,
+ fakeSVG = useCanVG || (!hasSVG && renderer.forExport),
+ wrapper,
+ attr = {};
+
+ if (useHTML && !renderer.forExport) {
+ return renderer.html(str, x, y);
+ }
+
+ attr.x = Math.round(x || 0); // X is always needed for line-wrap logic
+ if (y) {
+ attr.y = Math.round(y);
+ }
+ if (str || str === 0) {
+ attr.text = str;
+ }
+
+ wrapper = renderer.createElement('text')
+ .attr(attr);
+
+ // Prevent wrapping from creating false offsetWidths in export in legacy IE (#1079, #1063)
+ if (fakeSVG) {
+ wrapper.css({
+ position: ABSOLUTE
+ });
+ }
+
+ if (!useHTML) {
+ wrapper.xSetter = function (value, key, element) {
+ var tspans = element.getElementsByTagName('tspan'),
+ tspan,
+ parentVal = element.getAttribute(key),
+ i;
+ for (i = 0; i < tspans.length; i++) {
+ tspan = tspans[i];
+ // If the x values are equal, the tspan represents a linebreak
+ if (tspan.getAttribute(key) === parentVal) {
+ tspan.setAttribute(key, value);
+ }
+ }
+ element.setAttribute(key, value);
+ };
+ }
+
+ return wrapper;
+ },
+
+ /**
+ * Utility to return the baseline offset and total line height from the font size
+ */
+ fontMetrics: function (fontSize, elem) {
+ fontSize = fontSize || this.style.fontSize;
+ if (elem && win.getComputedStyle) {
+ elem = elem.element || elem; // SVGElement
+ fontSize = win.getComputedStyle(elem, "").fontSize;
+ }
+ fontSize = /px/.test(fontSize) ? pInt(fontSize) : /em/.test(fontSize) ? parseFloat(fontSize) * 12 : 12;
+
+ // Empirical values found by comparing font size and bounding box height.
+ // Applies to the default font family. http://jsfiddle.net/highcharts/7xvn7/
+ var lineHeight = fontSize < 24 ? fontSize + 4 : mathRound(fontSize * 1.2),
+ baseline = mathRound(lineHeight * 0.8);
+
+ return {
+ h: lineHeight,
+ b: baseline,
+ f: fontSize
+ };
+ },
+
+ /**
+ * Add a label, a text item that can hold a colored or gradient background
+ * as well as a border and shadow.
+ * @param {string} str
+ * @param {Number} x
+ * @param {Number} y
+ * @param {String} shape
+ * @param {Number} anchorX In case the shape has a pointer, like a flag, this is the
+ * coordinates it should be pinned to
+ * @param {Number} anchorY
+ * @param {Boolean} baseline Whether to position the label relative to the text baseline,
+ * like renderer.text, or to the upper border of the rectangle.
+ * @param {String} className Class name for the group
+ */
+ label: function (str, x, y, shape, anchorX, anchorY, useHTML, baseline, className) {
+
+ var renderer = this,
+ wrapper = renderer.g(className),
+ text = renderer.text('', 0, 0, useHTML)
+ .attr({
+ zIndex: 1
+ }),
+ //.add(wrapper),
+ box,
+ bBox,
+ alignFactor = 0,
+ padding = 3,
+ paddingLeft = 0,
+ width,
+ height,
+ wrapperX,
+ wrapperY,
+ crispAdjust = 0,
+ deferredAttr = {},
+ baselineOffset,
+ needsBox;
+
+ /**
+ * This function runs after the label is added to the DOM (when the bounding box is
+ * available), and after the text of the label is updated to detect the new bounding
+ * box and reflect it in the border box.
+ */
+ function updateBoxSize() {
+ var boxX,
+ boxY,
+ style = text.element.style;
+
+ bBox = (width === undefined || height === undefined || wrapper.styles.textAlign) && text.textStr &&
+ text.getBBox();
+ wrapper.width = (width || bBox.width || 0) + 2 * padding + paddingLeft;
+ wrapper.height = (height || bBox.height || 0) + 2 * padding;
+
+ // update the label-scoped y offset
+ baselineOffset = padding + renderer.fontMetrics(style && style.fontSize, text).b;
+
+
+ if (needsBox) {
+
+ // create the border box if it is not already present
+ if (!box) {
+ boxX = mathRound(-alignFactor * padding);
+ boxY = baseline ? -baselineOffset : 0;
+
+ wrapper.box = box = shape ?
+ renderer.symbol(shape, boxX, boxY, wrapper.width, wrapper.height, deferredAttr) :
+ renderer.rect(boxX, boxY, wrapper.width, wrapper.height, 0, deferredAttr[STROKE_WIDTH]);
+ box.attr('fill', NONE).add(wrapper);
+ }
+
+ // apply the box attributes
+ if (!box.isImg) { // #1630
+ box.attr(extend({
+ width: mathRound(wrapper.width),
+ height: mathRound(wrapper.height)
+ }, deferredAttr));
+ }
+ deferredAttr = null;
+ }
+ }
+
+ /**
+ * This function runs after setting text or padding, but only if padding is changed
+ */
+ function updateTextPadding() {
+ var styles = wrapper.styles,
+ textAlign = styles && styles.textAlign,
+ x = paddingLeft + padding * (1 - alignFactor),
+ y;
+
+ // determin y based on the baseline
+ y = baseline ? 0 : baselineOffset;
+
+ // compensate for alignment
+ if (defined(width) && bBox && (textAlign === 'center' || textAlign === 'right')) {
+ x += { center: 0.5, right: 1 }[textAlign] * (width - bBox.width);
+ }
+
+ // update if anything changed
+ if (x !== text.x || y !== text.y) {
+ text.attr('x', x);
+ if (y !== UNDEFINED) {
+ text.attr('y', y);
+ }
+ }
+
+ // record current values
+ text.x = x;
+ text.y = y;
+ }
+
+ /**
+ * Set a box attribute, or defer it if the box is not yet created
+ * @param {Object} key
+ * @param {Object} value
+ */
+ function boxAttr(key, value) {
+ if (box) {
+ box.attr(key, value);
+ } else {
+ deferredAttr[key] = value;
+ }
+ }
+
+ /**
+ * After the text element is added, get the desired size of the border box
+ * and add it before the text in the DOM.
+ */
+ wrapper.onAdd = function () {
+ text.add(wrapper);
+ wrapper.attr({
+ text: (str || str === 0) ? str : '', // alignment is available now // #3295: 0 not rendered if given as a value
+ x: x,
+ y: y
+ });
+
+ if (box && defined(anchorX)) {
+ wrapper.attr({
+ anchorX: anchorX,
+ anchorY: anchorY
+ });
+ }
+ };
+
+ /*
+ * Add specific attribute setters.
+ */
+
+ // only change local variables
+ wrapper.widthSetter = function (value) {
+ width = value;
+ };
+ wrapper.heightSetter = function (value) {
+ height = value;
+ };
+ wrapper.paddingSetter = function (value) {
+ if (defined(value) && value !== padding) {
+ padding = value;
+ updateTextPadding();
+ }
+ };
+ wrapper.paddingLeftSetter = function (value) {
+ if (defined(value) && value !== paddingLeft) {
+ paddingLeft = value;
+ updateTextPadding();
+ }
+ };
+
+
+ // change local variable and prevent setting attribute on the group
+ wrapper.alignSetter = function (value) {
+ alignFactor = { left: 0, center: 0.5, right: 1 }[value];
+ };
+
+ // apply these to the box and the text alike
+ wrapper.textSetter = function (value) {
+ if (value !== UNDEFINED) {
+ text.textSetter(value);
+ }
+ updateBoxSize();
+ updateTextPadding();
+ };
+
+ // apply these to the box but not to the text
+ wrapper['stroke-widthSetter'] = function (value, key) {
+ if (value) {
+ needsBox = true;
+ }
+ crispAdjust = value % 2 / 2;
+ boxAttr(key, value);
+ };
+ wrapper.strokeSetter = wrapper.fillSetter = wrapper.rSetter = function (value, key) {
+ if (key === 'fill' && value) {
+ needsBox = true;
+ }
+ boxAttr(key, value);
+ };
+ wrapper.anchorXSetter = function (value, key) {
+ anchorX = value;
+ boxAttr(key, value + crispAdjust - wrapperX);
+ };
+ wrapper.anchorYSetter = function (value, key) {
+ anchorY = value;
+ boxAttr(key, value - wrapperY);
+ };
+
+ // rename attributes
+ wrapper.xSetter = function (value) {
+ wrapper.x = value; // for animation getter
+ if (alignFactor) {
+ value -= alignFactor * ((width || bBox.width) + padding);
+ }
+ wrapperX = mathRound(value);
+ wrapper.attr('translateX', wrapperX);
+ };
+ wrapper.ySetter = function (value) {
+ wrapperY = wrapper.y = mathRound(value);
+ wrapper.attr('translateY', wrapperY);
+ };
+
+ // Redirect certain methods to either the box or the text
+ var baseCss = wrapper.css;
+ return extend(wrapper, {
+ /**
+ * Pick up some properties and apply them to the text instead of the wrapper
+ */
+ css: function (styles) {
+ if (styles) {
+ var textStyles = {};
+ styles = merge(styles); // create a copy to avoid altering the original object (#537)
+ each(wrapper.textProps, function (prop) {
+ if (styles[prop] !== UNDEFINED) {
+ textStyles[prop] = styles[prop];
+ delete styles[prop];
+ }
+ });
+ text.css(textStyles);
+ }
+ return baseCss.call(wrapper, styles);
+ },
+ /**
+ * Return the bounding box of the box, not the group
+ */
+ getBBox: function () {
+ return {
+ width: bBox.width + 2 * padding,
+ height: bBox.height + 2 * padding,
+ x: bBox.x - padding,
+ y: bBox.y - padding
+ };
+ },
+ /**
+ * Apply the shadow to the box
+ */
+ shadow: function (b) {
+ if (box) {
+ box.shadow(b);
+ }
+ return wrapper;
+ },
+ /**
+ * Destroy and release memory.
+ */
+ destroy: function () {
+
+ // Added by button implementation
+ removeEvent(wrapper.element, 'mouseenter');
+ removeEvent(wrapper.element, 'mouseleave');
+
+ if (text) {
+ text = text.destroy();
+ }
+ if (box) {
+ box = box.destroy();
+ }
+ // Call base implementation to destroy the rest
+ SVGElement.prototype.destroy.call(wrapper);
+
+ // Release local pointers (#1298)
+ wrapper = renderer = updateBoxSize = updateTextPadding = boxAttr = null;
+ }
+ });
+ }
+ }; // end SVGRenderer
+
+
+ // general renderer
+ Renderer = SVGRenderer;
+
+
+ // extend SvgElement for useHTML option
+ extend(SVGElement.prototype, {
+ /**
+ * Apply CSS to HTML elements. This is used in text within SVG rendering and
+ * by the VML renderer
+ */
+ htmlCss: function (styles) {
+ var wrapper = this,
+ element = wrapper.element,
+ textWidth = styles && element.tagName === 'SPAN' && styles.width;
+
+ if (textWidth) {
+ delete styles.width;
+ wrapper.textWidth = textWidth;
+ wrapper.updateTransform();
+ }
+
+ wrapper.styles = extend(wrapper.styles, styles);
+ css(wrapper.element, styles);
+
+ return wrapper;
+ },
+
+ /**
+ * VML and useHTML method for calculating the bounding box based on offsets
+ * @param {Boolean} refresh Whether to force a fresh value from the DOM or to
+ * use the cached value
+ *
+ * @return {Object} A hash containing values for x, y, width and height
+ */
+
+ htmlGetBBox: function () {
+ var wrapper = this,
+ element = wrapper.element,
+ bBox = wrapper.bBox;
+
+ // faking getBBox in exported SVG in legacy IE
+ if (!bBox) {
+ // faking getBBox in exported SVG in legacy IE (is this a duplicate of the fix for #1079?)
+ if (element.nodeName === 'text') {
+ element.style.position = ABSOLUTE;
+ }
+
+ bBox = wrapper.bBox = {
+ x: element.offsetLeft,
+ y: element.offsetTop,
+ width: element.offsetWidth,
+ height: element.offsetHeight
+ };
+ }
+
+ return bBox;
+ },
+
+ /**
+ * VML override private method to update elements based on internal
+ * properties based on SVG transform
+ */
+ htmlUpdateTransform: function () {
+ // aligning non added elements is expensive
+ if (!this.added) {
+ this.alignOnAdd = true;
+ return;
+ }
+
+ var wrapper = this,
+ renderer = wrapper.renderer,
+ elem = wrapper.element,
+ translateX = wrapper.translateX || 0,
+ translateY = wrapper.translateY || 0,
+ x = wrapper.x || 0,
+ y = wrapper.y || 0,
+ align = wrapper.textAlign || 'left',
+ alignCorrection = { left: 0, center: 0.5, right: 1 }[align],
+ shadows = wrapper.shadows;
+
+ // apply translate
+ css(elem, {
+ marginLeft: translateX,
+ marginTop: translateY
+ });
+ if (shadows) { // used in labels/tooltip
+ each(shadows, function (shadow) {
+ css(shadow, {
+ marginLeft: translateX + 1,
+ marginTop: translateY + 1
+ });
+ });
+ }
+
+ // apply inversion
+ if (wrapper.inverted) { // wrapper is a group
+ each(elem.childNodes, function (child) {
+ renderer.invertChild(child, elem);
+ });
+ }
+
+ if (elem.tagName === 'SPAN') {
+
+ var width,
+ rotation = wrapper.rotation,
+ baseline,
+ textWidth = pInt(wrapper.textWidth),
+ currentTextTransform = [rotation, align, elem.innerHTML, wrapper.textWidth].join(',');
+
+ if (currentTextTransform !== wrapper.cTT) { // do the calculations and DOM access only if properties changed
+
+
+ baseline = renderer.fontMetrics(elem.style.fontSize).b;
+
+ // Renderer specific handling of span rotation
+ if (defined(rotation)) {
+ wrapper.setSpanRotation(rotation, alignCorrection, baseline);
+ }
+
+ width = pick(wrapper.elemWidth, elem.offsetWidth);
+
+ // Update textWidth
+ if (width > textWidth && /[ \-]/.test(elem.textContent || elem.innerText)) { // #983, #1254
+ css(elem, {
+ width: textWidth + PX,
+ display: 'block',
+ whiteSpace: 'normal'
+ });
+ width = textWidth;
+ }
+
+ wrapper.getSpanCorrection(width, baseline, alignCorrection, rotation, align);
+ }
+
+ // apply position with correction
+ css(elem, {
+ left: (x + (wrapper.xCorr || 0)) + PX,
+ top: (y + (wrapper.yCorr || 0)) + PX
+ });
+
+ // force reflow in webkit to apply the left and top on useHTML element (#1249)
+ if (isWebKit) {
+ baseline = elem.offsetHeight; // assigned to baseline for JSLint purpose
+ }
+
+ // record current text transform
+ wrapper.cTT = currentTextTransform;
+ }
+ },
+
+ /**
+ * Set the rotation of an individual HTML span
+ */
+ setSpanRotation: function (rotation, alignCorrection, baseline) {
+ var rotationStyle = {},
+ cssTransformKey = isIE ? '-ms-transform' : isWebKit ? '-webkit-transform' : isFirefox ? 'MozTransform' : isOpera ? '-o-transform' : '';
+
+ rotationStyle[cssTransformKey] = rotationStyle.transform = 'rotate(' + rotation + 'deg)';
+ rotationStyle[cssTransformKey + (isFirefox ? 'Origin' : '-origin')] = rotationStyle.transformOrigin = (alignCorrection * 100) + '% ' + baseline + 'px';
+ css(this.element, rotationStyle);
+ },
+
+ /**
+ * Get the correction in X and Y positioning as the element is rotated.
+ */
+ getSpanCorrection: function (width, baseline, alignCorrection) {
+ this.xCorr = -width * alignCorrection;
+ this.yCorr = -baseline;
+ }
+ });
+
+ // Extend SvgRenderer for useHTML option.
+ extend(SVGRenderer.prototype, {
+ /**
+ * Create HTML text node. This is used by the VML renderer as well as the SVG
+ * renderer through the useHTML option.
+ *
+ * @param {String} str
+ * @param {Number} x
+ * @param {Number} y
+ */
+ html: function (str, x, y) {
+ var wrapper = this.createElement('span'),
+ element = wrapper.element,
+ renderer = wrapper.renderer;
+
+ // Text setter
+ wrapper.textSetter = function (value) {
+ if (value !== element.innerHTML) {
+ delete this.bBox;
+ }
+ element.innerHTML = this.textStr = value;
+ };
+
+ // Various setters which rely on update transform
+ wrapper.xSetter = wrapper.ySetter = wrapper.alignSetter = wrapper.rotationSetter = function (value, key) {
+ if (key === 'align') {
+ key = 'textAlign'; // Do not overwrite the SVGElement.align method. Same as VML.
+ }
+ wrapper[key] = value;
+ wrapper.htmlUpdateTransform();
+ };
+
+ // Set the default attributes
+ wrapper.attr({
+ text: str,
+ x: mathRound(x),
+ y: mathRound(y)
+ })
+ .css({
+ position: ABSOLUTE,
+ whiteSpace: 'nowrap',
+ fontFamily: this.style.fontFamily,
+ fontSize: this.style.fontSize
+ });
+
+ // Use the HTML specific .css method
+ wrapper.css = wrapper.htmlCss;
+
+ // This is specific for HTML within SVG
+ if (renderer.isSVG) {
+ wrapper.add = function (svgGroupWrapper) {
+
+ var htmlGroup,
+ container = renderer.box.parentNode,
+ parentGroup,
+ parents = [];
+
+ this.parentGroup = svgGroupWrapper;
+
+ // Create a mock group to hold the HTML elements
+ if (svgGroupWrapper) {
+ htmlGroup = svgGroupWrapper.div;
+ if (!htmlGroup) {
+
+ // Read the parent chain into an array and read from top down
+ parentGroup = svgGroupWrapper;
+ while (parentGroup) {
+
+ parents.push(parentGroup);
+
+ // Move up to the next parent group
+ parentGroup = parentGroup.parentGroup;
+ }
+
+ // Ensure dynamically updating position when any parent is translated
+ each(parents.reverse(), function (parentGroup) {
+ var htmlGroupStyle;
+
+ // Create a HTML div and append it to the parent div to emulate
+ // the SVG group structure
+ htmlGroup = parentGroup.div = parentGroup.div || createElement(DIV, {
+ className: attr(parentGroup.element, 'class')
+ }, {
+ position: ABSOLUTE,
+ left: (parentGroup.translateX || 0) + PX,
+ top: (parentGroup.translateY || 0) + PX
+ }, htmlGroup || container); // the top group is appended to container
+
+ // Shortcut
+ htmlGroupStyle = htmlGroup.style;
+
+ // Set listeners to update the HTML div's position whenever the SVG group
+ // position is changed
+ extend(parentGroup, {
+ translateXSetter: function (value, key) {
+ htmlGroupStyle.left = value + PX;
+ parentGroup[key] = value;
+ parentGroup.doTransform = true;
+ },
+ translateYSetter: function (value, key) {
+ htmlGroupStyle.top = value + PX;
+ parentGroup[key] = value;
+ parentGroup.doTransform = true;
+ },
+ visibilitySetter: function (value, key) {
+ htmlGroupStyle[key] = value;
+ }
+ });
+ });
+
+ }
+ } else {
+ htmlGroup = container;
+ }
+
+ htmlGroup.appendChild(element);
+
+ // Shared with VML:
+ wrapper.added = true;
+ if (wrapper.alignOnAdd) {
+ wrapper.htmlUpdateTransform();
+ }
+
+ return wrapper;
+ };
+ }
+ return wrapper;
+ }
+ });
+
+ /**
+ * The Tick class
+ */
+ function Tick(axis, pos, type, noLabel) {
+ this.axis = axis;
+ this.pos = pos;
+ this.type = type || '';
+ this.isNew = true;
+
+ if (!type && !noLabel) {
+ this.addLabel();
+ }
+ }
+
+ Tick.prototype = {
+ /**
+ * Write the tick label
+ */
+ addLabel: function () {
+ var tick = this,
+ axis = tick.axis,
+ options = axis.options,
+ chart = axis.chart,
+ horiz = axis.horiz,
+ categories = axis.categories,
+ names = axis.names,
+ pos = tick.pos,
+ labelOptions = options.labels,
+ rotation = labelOptions.rotation,
+ str,
+ tickPositions = axis.tickPositions,
+ width = (horiz && categories &&
+ !labelOptions.step && !labelOptions.staggerLines &&
+ !labelOptions.rotation &&
+ chart.plotWidth / tickPositions.length) ||
+ (!horiz && (chart.margin[3] || chart.chartWidth * 0.33)), // #1580, #1931
+ isFirst = pos === tickPositions[0],
+ isLast = pos === tickPositions[tickPositions.length - 1],
+ css,
+ attr,
+ value = categories ?
+ pick(categories[pos], names[pos], pos) :
+ pos,
+ label = tick.label,
+ tickPositionInfo = tickPositions.info,
+ dateTimeLabelFormat;
+
+ // Set the datetime label format. If a higher rank is set for this position, use that. If not,
+ // use the general format.
+ if (axis.isDatetimeAxis && tickPositionInfo) {
+ dateTimeLabelFormat = options.dateTimeLabelFormats[tickPositionInfo.higherRanks[pos] || tickPositionInfo.unitName];
+ }
+ // set properties for access in render method
+ tick.isFirst = isFirst;
+ tick.isLast = isLast;
+
+ // get the string
+ str = axis.labelFormatter.call({
+ axis: axis,
+ chart: chart,
+ isFirst: isFirst,
+ isLast: isLast,
+ dateTimeLabelFormat: dateTimeLabelFormat,
+ value: axis.isLog ? correctFloat(lin2log(value)) : value
+ });
+
+ // prepare CSS
+ css = width && { width: mathMax(1, mathRound(width - 2 * (labelOptions.padding || 10))) + PX };
+
+ // first call
+ if (!defined(label)) {
+ attr = {
+ align: axis.labelAlign
+ };
+ if (isNumber(rotation)) {
+ attr.rotation = rotation;
+ }
+ if (width && labelOptions.ellipsis) {
+ css.HcHeight = axis.len / tickPositions.length;
+ }
+
+ tick.label = label =
+ defined(str) && labelOptions.enabled ?
+ chart.renderer.text(
+ str,
+ 0,
+ 0,
+ labelOptions.useHTML
+ )
+ .attr(attr)
+ // without position absolute, IE export sometimes is wrong
+ .css(extend(css, labelOptions.style))
+ .add(axis.labelGroup) :
+ null;
+
+ // Set the tick baseline and correct for rotation (#1764)
+ axis.tickBaseline = chart.renderer.fontMetrics(labelOptions.style.fontSize, label).b;
+ if (rotation && axis.side === 2) {
+ axis.tickBaseline *= mathCos(rotation * deg2rad);
+ }
+
+
+ // update
+ } else if (label) {
+ label.attr({
+ text: str
+ })
+ .css(css);
+ }
+ tick.yOffset = label ? pick(labelOptions.y, axis.tickBaseline + (axis.side === 2 ? 8 : -(label.getBBox().height / 2))) : 0;
+ },
+
+ /**
+ * Get the offset height or width of the label
+ */
+ getLabelSize: function () {
+ var label = this.label,
+ axis = this.axis;
+ return label ?
+ label.getBBox()[axis.horiz ? 'height' : 'width'] :
+ 0;
+ },
+
+ /**
+ * Find how far the labels extend to the right and left of the tick's x position. Used for anti-collision
+ * detection with overflow logic.
+ */
+ getLabelSides: function () {
+ var bBox = this.label.getBBox(),
+ axis = this.axis,
+ horiz = axis.horiz,
+ options = axis.options,
+ labelOptions = options.labels,
+ size = horiz ? bBox.width : bBox.height,
+ leftSide = horiz ?
+ labelOptions.x - size * { left: 0, center: 0.5, right: 1 }[axis.labelAlign] :
+ 0,
+ rightSide = horiz ?
+ size + leftSide :
+ size;
+
+ return [leftSide, rightSide];
+ },
+
+ /**
+ * Handle the label overflow by adjusting the labels to the left and right edge, or
+ * hide them if they collide into the neighbour label.
+ */
+ handleOverflow: function (index, xy) {
+ var show = true,
+ axis = this.axis,
+ isFirst = this.isFirst,
+ isLast = this.isLast,
+ horiz = axis.horiz,
+ pxPos = horiz ? xy.x : xy.y,
+ reversed = axis.reversed,
+ tickPositions = axis.tickPositions,
+ sides = this.getLabelSides(),
+ leftSide = sides[0],
+ rightSide = sides[1],
+ axisLeft,
+ axisRight,
+ neighbour,
+ neighbourEdge,
+ line = this.label.line,
+ lineIndex = line || 0,
+ labelEdge = axis.labelEdge,
+ justifyLabel = axis.justifyLabels && (isFirst || isLast),
+ justifyToPlot;
+
+ // Hide it if it now overlaps the neighbour label
+ if (labelEdge[lineIndex] === UNDEFINED || pxPos + leftSide > labelEdge[lineIndex]) {
+ labelEdge[lineIndex] = pxPos + rightSide;
+
+ } else if (!justifyLabel) {
+ show = false;
+ }
+
+ if (justifyLabel) {
+ justifyToPlot = axis.justifyToPlot;
+ axisLeft = justifyToPlot ? axis.pos : 0;
+ axisRight = justifyToPlot ? axisLeft + axis.len : axis.chart.chartWidth;
+
+ // Find the firsth neighbour on the same line
+ do {
+ index += (isFirst ? 1 : -1);
+ neighbour = axis.ticks[tickPositions[index]];
+ } while (tickPositions[index] && (!neighbour || !neighbour.label || neighbour.label.line !== line)); // #3044
+
+ neighbourEdge = neighbour && neighbour.label.xy && neighbour.label.xy.x + neighbour.getLabelSides()[isFirst ? 0 : 1];
+
+ if ((isFirst && !reversed) || (isLast && reversed)) {
+ // Is the label spilling out to the left of the plot area?
+ if (pxPos + leftSide < axisLeft) {
+
+ // Align it to plot left
+ pxPos = axisLeft - leftSide;
+
+ // Hide it if it now overlaps the neighbour label
+ if (neighbour && pxPos + rightSide > neighbourEdge) {
+ show = false;
+ }
+ }
+
+ } else {
+ // Is the label spilling out to the right of the plot area?
+ if (pxPos + rightSide > axisRight) {
+
+ // Align it to plot right
+ pxPos = axisRight - rightSide;
+
+ // Hide it if it now overlaps the neighbour label
+ if (neighbour && pxPos + leftSide < neighbourEdge) {
+ show = false;
+ }
+
+ }
+ }
+
+ // Set the modified x position of the label
+ xy.x = pxPos;
+ }
+ return show;
+ },
+
+ /**
+ * Get the x and y position for ticks and labels
+ */
+ getPosition: function (horiz, pos, tickmarkOffset, old) {
+ var axis = this.axis,
+ chart = axis.chart,
+ cHeight = (old && chart.oldChartHeight) || chart.chartHeight;
+
+ return {
+ x: horiz ?
+ axis.translate(pos + tickmarkOffset, null, null, old) + axis.transB :
+ axis.left + axis.offset + (axis.opposite ? ((old && chart.oldChartWidth) || chart.chartWidth) - axis.right - axis.left : 0),
+
+ y: horiz ?
+ cHeight - axis.bottom + axis.offset - (axis.opposite ? axis.height : 0) :
+ cHeight - axis.translate(pos + tickmarkOffset, null, null, old) - axis.transB
+ };
+
+ },
+
+ /**
+ * Get the x, y position of the tick label
+ */
+ getLabelPosition: function (x, y, label, horiz, labelOptions, tickmarkOffset, index, step) {
+ var axis = this.axis,
+ transA = axis.transA,
+ reversed = axis.reversed,
+ staggerLines = axis.staggerLines;
+
+ x = x + labelOptions.x - (tickmarkOffset && horiz ?
+ tickmarkOffset * transA * (reversed ? -1 : 1) : 0);
+ y = y + this.yOffset - (tickmarkOffset && !horiz ?
+ tickmarkOffset * transA * (reversed ? 1 : -1) : 0);
+
+ // Correct for staggered labels
+ if (staggerLines) {
+ label.line = (index / (step || 1) % staggerLines);
+ y += label.line * (axis.labelOffset / staggerLines);
+ }
+
+ return {
+ x: x,
+ y: y
+ };
+ },
+
+ /**
+ * Extendible method to return the path of the marker
+ */
+ getMarkPath: function (x, y, tickLength, tickWidth, horiz, renderer) {
+ return renderer.crispLine([
+ M,
+ x,
+ y,
+ L,
+ x + (horiz ? 0 : -tickLength),
+ y + (horiz ? tickLength : 0)
+ ], tickWidth);
+ },
+
+ /**
+ * Put everything in place
+ *
+ * @param index {Number}
+ * @param old {Boolean} Use old coordinates to prepare an animation into new position
+ */
+ render: function (index, old, opacity) {
+ var tick = this,
+ axis = tick.axis,
+ options = axis.options,
+ chart = axis.chart,
+ renderer = chart.renderer,
+ horiz = axis.horiz,
+ type = tick.type,
+ label = tick.label,
+ pos = tick.pos,
+ labelOptions = options.labels,
+ gridLine = tick.gridLine,
+ gridPrefix = type ? type + 'Grid' : 'grid',
+ tickPrefix = type ? type + 'Tick' : 'tick',
+ gridLineWidth = options[gridPrefix + 'LineWidth'],
+ gridLineColor = options[gridPrefix + 'LineColor'],
+ dashStyle = options[gridPrefix + 'LineDashStyle'],
+ tickLength = options[tickPrefix + 'Length'],
+ tickWidth = options[tickPrefix + 'Width'] || 0,
+ tickColor = options[tickPrefix + 'Color'],
+ tickPosition = options[tickPrefix + 'Position'],
+ gridLinePath,
+ mark = tick.mark,
+ markPath,
+ step = labelOptions.step,
+ attribs,
+ show = true,
+ tickmarkOffset = axis.tickmarkOffset,
+ xy = tick.getPosition(horiz, pos, tickmarkOffset, old),
+ x = xy.x,
+ y = xy.y,
+ reverseCrisp = ((horiz && x === axis.pos + axis.len) || (!horiz && y === axis.pos)) ? -1 : 1; // #1480, #1687
+
+ opacity = pick(opacity, 1);
+ this.isActive = true;
+
+ // create the grid line
+ if (gridLineWidth) {
+ gridLinePath = axis.getPlotLinePath(pos + tickmarkOffset, gridLineWidth * reverseCrisp, old, true);
+
+ if (gridLine === UNDEFINED) {
+ attribs = {
+ stroke: gridLineColor,
+ 'stroke-width': gridLineWidth
+ };
+ if (dashStyle) {
+ attribs.dashstyle = dashStyle;
+ }
+ if (!type) {
+ attribs.zIndex = 1;
+ }
+ if (old) {
+ attribs.opacity = 0;
+ }
+ tick.gridLine = gridLine =
+ gridLineWidth ?
+ renderer.path(gridLinePath)
+ .attr(attribs).add(axis.gridGroup) :
+ null;
+ }
+
+ // If the parameter 'old' is set, the current call will be followed
+ // by another call, therefore do not do any animations this time
+ if (!old && gridLine && gridLinePath) {
+ gridLine[tick.isNew ? 'attr' : 'animate']({
+ d: gridLinePath,
+ opacity: opacity
+ });
+ }
+ }
+
+ // create the tick mark
+ if (tickWidth && tickLength) {
+
+ // negate the length
+ if (tickPosition === 'inside') {
+ tickLength = -tickLength;
+ }
+ if (axis.opposite) {
+ tickLength = -tickLength;
+ }
+
+ markPath = tick.getMarkPath(x, y, tickLength, tickWidth * reverseCrisp, horiz, renderer);
+ if (mark) { // updating
+ mark.animate({
+ d: markPath,
+ opacity: opacity
+ });
+ } else { // first time
+ tick.mark = renderer.path(
+ markPath
+ ).attr({
+ stroke: tickColor,
+ 'stroke-width': tickWidth,
+ opacity: opacity
+ }).add(axis.axisGroup);
+ }
+ }
+
+ // the label is created on init - now move it into place
+ if (label && !isNaN(x)) {
+ label.xy = xy = tick.getLabelPosition(x, y, label, horiz, labelOptions, tickmarkOffset, index, step);
+
+ // Apply show first and show last. If the tick is both first and last, it is
+ // a single centered tick, in which case we show the label anyway (#2100).
+ if ((tick.isFirst && !tick.isLast && !pick(options.showFirstLabel, 1)) ||
+ (tick.isLast && !tick.isFirst && !pick(options.showLastLabel, 1))) {
+ show = false;
+
+ // Handle label overflow and show or hide accordingly
+ } else if (!axis.isRadial && !labelOptions.step && !labelOptions.rotation && !old && opacity !== 0) {
+ show = tick.handleOverflow(index, xy);
+ }
+
+ // apply step
+ if (step && index % step) {
+ // show those indices dividable by step
+ show = false;
+ }
+
+ // Set the new position, and show or hide
+ if (show && !isNaN(xy.y)) {
+ xy.opacity = opacity;
+ label[tick.isNew ? 'attr' : 'animate'](xy);
+ tick.isNew = false;
+ } else {
+ label.attr('y', -9999); // #1338
+ }
+ }
+ },
+
+ /**
+ * Destructor for the tick prototype
+ */
+ destroy: function () {
+ destroyObjectProperties(this, this.axis);
+ }
+ };
+
+
+
+ /**
+ * The object wrapper for plot lines and plot bands
+ * @param {Object} options
+ */
+ Highcharts.PlotLineOrBand = function (axis, options) {
+ this.axis = axis;
+
+ if (options) {
+ this.options = options;
+ this.id = options.id;
+ }
+ };
+
+ Highcharts.PlotLineOrBand.prototype = {
+
+ /**
+ * Render the plot line or plot band. If it is already existing,
+ * move it.
+ */
+ render: function () {
+ var plotLine = this,
+ axis = plotLine.axis,
+ horiz = axis.horiz,
+ halfPointRange = (axis.pointRange || 0) / 2,
+ options = plotLine.options,
+ optionsLabel = options.label,
+ label = plotLine.label,
+ width = options.width,
+ to = options.to,
+ from = options.from,
+ isBand = defined(from) && defined(to),
+ value = options.value,
+ dashStyle = options.dashStyle,
+ svgElem = plotLine.svgElem,
+ path = [],
+ addEvent,
+ eventType,
+ xs,
+ ys,
+ x,
+ y,
+ color = options.color,
+ zIndex = options.zIndex,
+ events = options.events,
+ attribs = {},
+ renderer = axis.chart.renderer;
+
+ // logarithmic conversion
+ if (axis.isLog) {
+ from = log2lin(from);
+ to = log2lin(to);
+ value = log2lin(value);
+ }
+
+ // plot line
+ if (width) {
+ path = axis.getPlotLinePath(value, width);
+ attribs = {
+ stroke: color,
+ 'stroke-width': width
+ };
+ if (dashStyle) {
+ attribs.dashstyle = dashStyle;
+ }
+ } else if (isBand) { // plot band
+
+ // keep within plot area
+ from = mathMax(from, axis.min - halfPointRange);
+ to = mathMin(to, axis.max + halfPointRange);
+
+ path = axis.getPlotBandPath(from, to, options);
+ if (color) {
+ attribs.fill = color;
+ }
+ if (options.borderWidth) {
+ attribs.stroke = options.borderColor;
+ attribs['stroke-width'] = options.borderWidth;
+ }
+ } else {
+ return;
+ }
+ // zIndex
+ if (defined(zIndex)) {
+ attribs.zIndex = zIndex;
+ }
+
+ // common for lines and bands
+ if (svgElem) {
+ if (path) {
+ svgElem.animate({
+ d: path
+ }, null, svgElem.onGetPath);
+ } else {
+ svgElem.hide();
+ svgElem.onGetPath = function () {
+ svgElem.show();
+ };
+ if (label) {
+ plotLine.label = label = label.destroy();
+ }
+ }
+ } else if (path && path.length) {
+ plotLine.svgElem = svgElem = renderer.path(path)
+ .attr(attribs).add();
+
+ // events
+ if (events) {
+ addEvent = function (eventType) {
+ svgElem.on(eventType, function (e) {
+ events[eventType].apply(plotLine, [e]);
+ });
+ };
+ for (eventType in events) {
+ addEvent(eventType);
+ }
+ }
+ }
+
+ // the plot band/line label
+ if (optionsLabel && defined(optionsLabel.text) && path && path.length && axis.width > 0 && axis.height > 0) {
+ // apply defaults
+ optionsLabel = merge({
+ align: horiz && isBand && 'center',
+ x: horiz ? !isBand && 4 : 10,
+ verticalAlign : !horiz && isBand && 'middle',
+ y: horiz ? isBand ? 16 : 10 : isBand ? 6 : -4,
+ rotation: horiz && !isBand && 90
+ }, optionsLabel);
+
+ // add the SVG element
+ if (!label) {
+ attribs = {
+ align: optionsLabel.textAlign || optionsLabel.align,
+ rotation: optionsLabel.rotation
+ };
+ if (defined(zIndex)) {
+ attribs.zIndex = zIndex;
+ }
+ plotLine.label = label = renderer.text(
+ optionsLabel.text,
+ 0,
+ 0,
+ optionsLabel.useHTML
+ )
+ .attr(attribs)
+ .css(optionsLabel.style)
+ .add();
+ }
+
+ // get the bounding box and align the label
+ // #3000 changed to better handle choice between plotband or plotline
+ xs = [path[1], path[4], (isBand ? path[6] : path[1])];
+ ys = [path[2], path[5], (isBand ? path[7] : path[2])];
+ x = arrayMin(xs);
+ y = arrayMin(ys);
+
+ label.align(optionsLabel, false, {
+ x: x,
+ y: y,
+ width: arrayMax(xs) - x,
+ height: arrayMax(ys) - y
+ });
+ label.show();
+
+ } else if (label) { // move out of sight
+ label.hide();
+ }
+
+ // chainable
+ return plotLine;
+ },
+
+ /**
+ * Remove the plot line or band
+ */
+ destroy: function () {
+ // remove it from the lookup
+ erase(this.axis.plotLinesAndBands, this);
+
+ delete this.axis;
+ destroyObjectProperties(this);
+ }
+ };
+
+ /**
+ * Object with members for extending the Axis prototype
+ */
+
+ AxisPlotLineOrBandExtension = {
+
+ /**
+ * Create the path for a plot band
+ */
+ getPlotBandPath: function (from, to) {
+ var toPath = this.getPlotLinePath(to),
+ path = this.getPlotLinePath(from);
+
+ if (path && toPath) {
+ path.push(
+ toPath[4],
+ toPath[5],
+ toPath[1],
+ toPath[2]
+ );
+ } else { // outside the axis area
+ path = null;
+ }
+
+ return path;
+ },
+
+ addPlotBand: function (options) {
+ return this.addPlotBandOrLine(options, 'plotBands');
+ },
+
+ addPlotLine: function (options) {
+ return this.addPlotBandOrLine(options, 'plotLines');
+ },
+
+ /**
+ * Add a plot band or plot line after render time
+ *
+ * @param options {Object} The plotBand or plotLine configuration object
+ */
+ addPlotBandOrLine: function (options, coll) {
+ var obj = new Highcharts.PlotLineOrBand(this, options).render(),
+ userOptions = this.userOptions;
+
+ if (obj) { // #2189
+ // Add it to the user options for exporting and Axis.update
+ if (coll) {
+ userOptions[coll] = userOptions[coll] || [];
+ userOptions[coll].push(options);
+ }
+ this.plotLinesAndBands.push(obj);
+ }
+
+ return obj;
+ },
+
+ /**
+ * Remove a plot band or plot line from the chart by id
+ * @param {Object} id
+ */
+ removePlotBandOrLine: function (id) {
+ var plotLinesAndBands = this.plotLinesAndBands,
+ options = this.options,
+ userOptions = this.userOptions,
+ i = plotLinesAndBands.length;
+ while (i--) {
+ if (plotLinesAndBands[i].id === id) {
+ plotLinesAndBands[i].destroy();
+ }
+ }
+ each([options.plotLines || [], userOptions.plotLines || [], options.plotBands || [], userOptions.plotBands || []], function (arr) {
+ i = arr.length;
+ while (i--) {
+ if (arr[i].id === id) {
+ erase(arr, arr[i]);
+ }
+ }
+ });
+ }
+ };
+
+
+
+ /**
+ * Create a new axis object
+ * @param {Object} chart
+ * @param {Object} options
+ */
+ function Axis() {
+ this.init.apply(this, arguments);
+ }
+
+ Axis.prototype = {
+
+ /**
+ * Default options for the X axis - the Y axis has extended defaults
+ */
+ defaultOptions: {
+ // allowDecimals: null,
+ // alternateGridColor: null,
+ // categories: [],
+ dateTimeLabelFormats: {
+ millisecond: '%H:%M:%S.%L',
+ second: '%H:%M:%S',
+ minute: '%H:%M',
+ hour: '%H:%M',
+ day: '%e. %b',
+ week: '%e. %b',
+ month: '%b \'%y',
+ year: '%Y'
+ },
+ endOnTick: false,
+ gridLineColor: '#C0C0C0',
+ // gridLineDashStyle: 'solid',
+ // gridLineWidth: 0,
+ // reversed: false,
+
+ labels: defaultLabelOptions,
+ // { step: null },
+ lineColor: '#C0D0E0',
+ lineWidth: 1,
+ //linkedTo: null,
+ //max: undefined,
+ //min: undefined,
+ minPadding: 0.01,
+ maxPadding: 0.01,
+ //minRange: null,
+ minorGridLineColor: '#E0E0E0',
+ // minorGridLineDashStyle: null,
+ minorGridLineWidth: 1,
+ minorTickColor: '#A0A0A0',
+ //minorTickInterval: null,
+ minorTickLength: 2,
+ minorTickPosition: 'outside', // inside or outside
+ //minorTickWidth: 0,
+ //opposite: false,
+ //offset: 0,
+ //plotBands: [{
+ // events: {},
+ // zIndex: 1,
+ // labels: { align, x, verticalAlign, y, style, rotation, textAlign }
+ //}],
+ //plotLines: [{
+ // events: {}
+ // dashStyle: {}
+ // zIndex:
+ // labels: { align, x, verticalAlign, y, style, rotation, textAlign }
+ //}],
+ //reversed: false,
+ // showFirstLabel: true,
+ // showLastLabel: true,
+ startOfWeek: 1,
+ startOnTick: false,
+ tickColor: '#C0D0E0',
+ //tickInterval: null,
+ tickLength: 10,
+ tickmarkPlacement: 'between', // on or between
+ tickPixelInterval: 100,
+ tickPosition: 'outside',
+ tickWidth: 1,
+ title: {
+ //text: null,
+ align: 'middle', // low, middle or high
+ //margin: 0 for horizontal, 10 for vertical axes,
+ //rotation: 0,
+ //side: 'outside',
+ style: {
+ color: '#707070'
+ }
+ //x: 0,
+ //y: 0
+ },
+ type: 'linear' // linear, logarithmic or datetime
+ },
+
+ /**
+ * This options set extends the defaultOptions for Y axes
+ */
+ defaultYAxisOptions: {
+ endOnTick: true,
+ gridLineWidth: 1,
+ tickPixelInterval: 72,
+ showLastLabel: true,
+ labels: {
+ x: -8,
+ y: 3
+ },
+ lineWidth: 0,
+ maxPadding: 0.05,
+ minPadding: 0.05,
+ startOnTick: true,
+ tickWidth: 0,
+ title: {
+ rotation: 270,
+ text: 'Values'
+ },
+ stackLabels: {
+ enabled: false,
+ //align: dynamic,
+ //y: dynamic,
+ //x: dynamic,
+ //verticalAlign: dynamic,
+ //textAlign: dynamic,
+ //rotation: 0,
+ formatter: function () {
+ return numberFormat(this.total, -1);
+ },
+ style: defaultLabelOptions.style
+ }
+ },
+
+ /**
+ * These options extend the defaultOptions for left axes
+ */
+ defaultLeftAxisOptions: {
+ labels: {
+ x: -15,
+ y: null
+ },
+ title: {
+ rotation: 270
+ }
+ },
+
+ /**
+ * These options extend the defaultOptions for right axes
+ */
+ defaultRightAxisOptions: {
+ labels: {
+ x: 15,
+ y: null
+ },
+ title: {
+ rotation: 90
+ }
+ },
+
+ /**
+ * These options extend the defaultOptions for bottom axes
+ */
+ defaultBottomAxisOptions: {
+ labels: {
+ x: 0,
+ y: null // based on font size
+ // overflow: undefined,
+ // staggerLines: null
+ },
+ title: {
+ rotation: 0
+ }
+ },
+ /**
+ * These options extend the defaultOptions for left axes
+ */
+ defaultTopAxisOptions: {
+ labels: {
+ x: 0,
+ y: -15
+ // overflow: undefined
+ // staggerLines: null
+ },
+ title: {
+ rotation: 0
+ }
+ },
+
+ /**
+ * Initialize the axis
+ */
+ init: function (chart, userOptions) {
+
+
+ var isXAxis = userOptions.isX,
+ axis = this;
+
+ // Flag, is the axis horizontal
+ axis.horiz = chart.inverted ? !isXAxis : isXAxis;
+
+ // Flag, isXAxis
+ axis.isXAxis = isXAxis;
+ axis.coll = isXAxis ? 'xAxis' : 'yAxis';
+
+ axis.opposite = userOptions.opposite; // needed in setOptions
+ axis.side = userOptions.side || (axis.horiz ?
+ (axis.opposite ? 0 : 2) : // top : bottom
+ (axis.opposite ? 1 : 3)); // right : left
+
+ axis.setOptions(userOptions);
+
+
+ var options = this.options,
+ type = options.type,
+ isDatetimeAxis = type === 'datetime';
+
+ axis.labelFormatter = options.labels.formatter || axis.defaultLabelFormatter; // can be overwritten by dynamic format
+
+
+ // Flag, stagger lines or not
+ axis.userOptions = userOptions;
+
+ //axis.axisTitleMargin = UNDEFINED,// = options.title.margin,
+ axis.minPixelPadding = 0;
+ //axis.ignoreMinPadding = UNDEFINED; // can be set to true by a column or bar series
+ //axis.ignoreMaxPadding = UNDEFINED;
+
+ axis.chart = chart;
+ axis.reversed = options.reversed;
+ axis.zoomEnabled = options.zoomEnabled !== false;
+
+ // Initial categories
+ axis.categories = options.categories || type === 'category';
+ axis.names = [];
+
+ // Elements
+ //axis.axisGroup = UNDEFINED;
+ //axis.gridGroup = UNDEFINED;
+ //axis.axisTitle = UNDEFINED;
+ //axis.axisLine = UNDEFINED;
+
+ // Shorthand types
+ axis.isLog = type === 'logarithmic';
+ axis.isDatetimeAxis = isDatetimeAxis;
+
+ // Flag, if axis is linked to another axis
+ axis.isLinked = defined(options.linkedTo);
+ // Linked axis.
+ //axis.linkedParent = UNDEFINED;
+
+ // Tick positions
+ //axis.tickPositions = UNDEFINED; // array containing predefined positions
+ // Tick intervals
+ //axis.tickInterval = UNDEFINED;
+ //axis.minorTickInterval = UNDEFINED;
+
+ axis.tickmarkOffset = (axis.categories && options.tickmarkPlacement === 'between' &&
+ pick(options.tickInterval, 1) === 1) ? 0.5 : 0; // #3202
+
+ // Major ticks
+ axis.ticks = {};
+ axis.labelEdge = [];
+ // Minor ticks
+ axis.minorTicks = {};
+ //axis.tickAmount = UNDEFINED;
+
+ // List of plotLines/Bands
+ axis.plotLinesAndBands = [];
+
+ // Alternate bands
+ axis.alternateBands = {};
+
+ // Axis metrics
+ //axis.left = UNDEFINED;
+ //axis.top = UNDEFINED;
+ //axis.width = UNDEFINED;
+ //axis.height = UNDEFINED;
+ //axis.bottom = UNDEFINED;
+ //axis.right = UNDEFINED;
+ //axis.transA = UNDEFINED;
+ //axis.transB = UNDEFINED;
+ //axis.oldTransA = UNDEFINED;
+ axis.len = 0;
+ //axis.oldMin = UNDEFINED;
+ //axis.oldMax = UNDEFINED;
+ //axis.oldUserMin = UNDEFINED;
+ //axis.oldUserMax = UNDEFINED;
+ //axis.oldAxisLength = UNDEFINED;
+ axis.minRange = axis.userMinRange = options.minRange || options.maxZoom;
+ axis.range = options.range;
+ axis.offset = options.offset || 0;
+
+
+ // Dictionary for stacks
+ axis.stacks = {};
+ axis.oldStacks = {};
+
+ // Min and max in the data
+ //axis.dataMin = UNDEFINED,
+ //axis.dataMax = UNDEFINED,
+
+ // The axis range
+ axis.max = null;
+ axis.min = null;
+
+ // User set min and max
+ //axis.userMin = UNDEFINED,
+ //axis.userMax = UNDEFINED,
+
+ // Crosshair options
+ axis.crosshair = pick(options.crosshair, splat(chart.options.tooltip.crosshairs)[isXAxis ? 0 : 1], false);
+ // Run Axis
+
+ var eventType,
+ events = axis.options.events;
+
+ // Register
+ if (inArray(axis, chart.axes) === -1) { // don't add it again on Axis.update()
+ if (isXAxis && !this.isColorAxis) { // #2713
+ chart.axes.splice(chart.xAxis.length, 0, axis);
+ } else {
+ chart.axes.push(axis);
+ }
+
+ chart[axis.coll].push(axis);
+ }
+
+ axis.series = axis.series || []; // populated by Series
+
+ // inverted charts have reversed xAxes as default
+ if (chart.inverted && isXAxis && axis.reversed === UNDEFINED) {
+ axis.reversed = true;
+ }
+
+ axis.removePlotBand = axis.removePlotBandOrLine;
+ axis.removePlotLine = axis.removePlotBandOrLine;
+
+
+ // register event listeners
+ for (eventType in events) {
+ addEvent(axis, eventType, events[eventType]);
+ }
+
+ // extend logarithmic axis
+ if (axis.isLog) {
+ axis.val2lin = log2lin;
+ axis.lin2val = lin2log;
+ }
+ },
+
+ /**
+ * Merge and set options
+ */
+ setOptions: function (userOptions) {
+ this.options = merge(
+ this.defaultOptions,
+ this.isXAxis ? {} : this.defaultYAxisOptions,
+ [this.defaultTopAxisOptions, this.defaultRightAxisOptions,
+ this.defaultBottomAxisOptions, this.defaultLeftAxisOptions][this.side],
+ merge(
+ defaultOptions[this.coll], // if set in setOptions (#1053)
+ userOptions
+ )
+ );
+ },
+
+ /**
+ * The default label formatter. The context is a special config object for the label.
+ */
+ defaultLabelFormatter: function () {
+ var axis = this.axis,
+ value = this.value,
+ categories = axis.categories,
+ dateTimeLabelFormat = this.dateTimeLabelFormat,
+ numericSymbols = defaultOptions.lang.numericSymbols,
+ i = numericSymbols && numericSymbols.length,
+ multi,
+ ret,
+ formatOption = axis.options.labels.format,
+
+ // make sure the same symbol is added for all labels on a linear axis
+ numericSymbolDetector = axis.isLog ? value : axis.tickInterval;
+
+ if (formatOption) {
+ ret = format(formatOption, this);
+
+ } else if (categories) {
+ ret = value;
+
+ } else if (dateTimeLabelFormat) { // datetime axis
+ ret = dateFormat(dateTimeLabelFormat, value);
+
+ } else if (i && numericSymbolDetector >= 1000) {
+ // Decide whether we should add a numeric symbol like k (thousands) or M (millions).
+ // If we are to enable this in tooltip or other places as well, we can move this
+ // logic to the numberFormatter and enable it by a parameter.
+ while (i-- && ret === UNDEFINED) {
+ multi = Math.pow(1000, i + 1);
+ if (numericSymbolDetector >= multi && numericSymbols[i] !== null) {
+ ret = numberFormat(value / multi, -1) + numericSymbols[i];
+ }
+ }
+ }
+
+ if (ret === UNDEFINED) {
+ if (mathAbs(value) >= 10000) { // add thousands separators
+ ret = numberFormat(value, 0);
+
+ } else { // small numbers
+ ret = numberFormat(value, -1, UNDEFINED, ''); // #2466
+ }
+ }
+
+ return ret;
+ },
+
+ /**
+ * Get the minimum and maximum for the series of each axis
+ */
+ getSeriesExtremes: function () {
+ var axis = this,
+ chart = axis.chart;
+
+ axis.hasVisibleSeries = false;
+
+ // Reset properties in case we're redrawing (#3353)
+ axis.dataMin = axis.dataMax = axis.ignoreMinPadding = axis.ignoreMaxPadding = null;
+
+ if (axis.buildStacks) {
+ axis.buildStacks();
+ }
+
+ // loop through this axis' series
+ each(axis.series, function (series) {
+
+ if (series.visible || !chart.options.chart.ignoreHiddenSeries) {
+
+ var seriesOptions = series.options,
+ xData,
+ threshold = seriesOptions.threshold,
+ seriesDataMin,
+ seriesDataMax;
+
+ axis.hasVisibleSeries = true;
+
+ // Validate threshold in logarithmic axes
+ if (axis.isLog && threshold <= 0) {
+ threshold = null;
+ }
+
+ // Get dataMin and dataMax for X axes
+ if (axis.isXAxis) {
+ xData = series.xData;
+ if (xData.length) {
+ axis.dataMin = mathMin(pick(axis.dataMin, xData[0]), arrayMin(xData));
+ axis.dataMax = mathMax(pick(axis.dataMax, xData[0]), arrayMax(xData));
+ }
+
+ // Get dataMin and dataMax for Y axes, as well as handle stacking and processed data
+ } else {
+
+ // Get this particular series extremes
+ series.getExtremes();
+ seriesDataMax = series.dataMax;
+ seriesDataMin = series.dataMin;
+
+ // Get the dataMin and dataMax so far. If percentage is used, the min and max are
+ // always 0 and 100. If seriesDataMin and seriesDataMax is null, then series
+ // doesn't have active y data, we continue with nulls
+ if (defined(seriesDataMin) && defined(seriesDataMax)) {
+ axis.dataMin = mathMin(pick(axis.dataMin, seriesDataMin), seriesDataMin);
+ axis.dataMax = mathMax(pick(axis.dataMax, seriesDataMax), seriesDataMax);
+ }
+
+ // Adjust to threshold
+ if (defined(threshold)) {
+ if (axis.dataMin >= threshold) {
+ axis.dataMin = threshold;
+ axis.ignoreMinPadding = true;
+ } else if (axis.dataMax < threshold) {
+ axis.dataMax = threshold;
+ axis.ignoreMaxPadding = true;
+ }
+ }
+ }
+ }
+ });
+ },
+
+ /**
+ * Translate from axis value to pixel position on the chart, or back
+ *
+ */
+ translate: function (val, backwards, cvsCoord, old, handleLog, pointPlacement) {
+ var axis = this,
+ sign = 1,
+ cvsOffset = 0,
+ localA = old ? axis.oldTransA : axis.transA,
+ localMin = old ? axis.oldMin : axis.min,
+ returnValue,
+ minPixelPadding = axis.minPixelPadding,
+ postTranslate = (axis.options.ordinal || (axis.isLog && handleLog)) && axis.lin2val;
+
+ if (!localA) {
+ localA = axis.transA;
+ }
+
+ // In vertical axes, the canvas coordinates start from 0 at the top like in
+ // SVG.
+ if (cvsCoord) {
+ sign *= -1; // canvas coordinates inverts the value
+ cvsOffset = axis.len;
+ }
+
+ // Handle reversed axis
+ if (axis.reversed) {
+ sign *= -1;
+ cvsOffset -= sign * (axis.sector || axis.len);
+ }
+
+ // From pixels to value
+ if (backwards) { // reverse translation
+
+ val = val * sign + cvsOffset;
+ val -= minPixelPadding;
+ returnValue = val / localA + localMin; // from chart pixel to value
+ if (postTranslate) { // log and ordinal axes
+ returnValue = axis.lin2val(returnValue);
+ }
+
+ // From value to pixels
+ } else {
+ if (postTranslate) { // log and ordinal axes
+ val = axis.val2lin(val);
+ }
+ if (pointPlacement === 'between') {
+ pointPlacement = 0.5;
+ }
+ returnValue = sign * (val - localMin) * localA + cvsOffset + (sign * minPixelPadding) +
+ (isNumber(pointPlacement) ? localA * pointPlacement * axis.pointRange : 0);
+ }
+
+ return returnValue;
+ },
+
+ /**
+ * Utility method to translate an axis value to pixel position.
+ * @param {Number} value A value in terms of axis units
+ * @param {Boolean} paneCoordinates Whether to return the pixel coordinate relative to the chart
+ * or just the axis/pane itself.
+ */
+ toPixels: function (value, paneCoordinates) {
+ return this.translate(value, false, !this.horiz, null, true) + (paneCoordinates ? 0 : this.pos);
+ },
+
+ /*
+ * Utility method to translate a pixel position in to an axis value
+ * @param {Number} pixel The pixel value coordinate
+ * @param {Boolean} paneCoordiantes Whether the input pixel is relative to the chart or just the
+ * axis/pane itself.
+ */
+ toValue: function (pixel, paneCoordinates) {
+ return this.translate(pixel - (paneCoordinates ? 0 : this.pos), true, !this.horiz, null, true);
+ },
+
+ /**
+ * Create the path for a plot line that goes from the given value on
+ * this axis, across the plot to the opposite side
+ * @param {Number} value
+ * @param {Number} lineWidth Used for calculation crisp line
+ * @param {Number] old Use old coordinates (for resizing and rescaling)
+ */
+ getPlotLinePath: function (value, lineWidth, old, force, translatedValue) {
+ var axis = this,
+ chart = axis.chart,
+ axisLeft = axis.left,
+ axisTop = axis.top,
+ x1,
+ y1,
+ x2,
+ y2,
+ cHeight = (old && chart.oldChartHeight) || chart.chartHeight,
+ cWidth = (old && chart.oldChartWidth) || chart.chartWidth,
+ skip,
+ transB = axis.transB;
+
+ translatedValue = pick(translatedValue, axis.translate(value, null, null, old));
+ x1 = x2 = mathRound(translatedValue + transB);
+ y1 = y2 = mathRound(cHeight - translatedValue - transB);
+
+ if (isNaN(translatedValue)) { // no min or max
+ skip = true;
+
+ } else if (axis.horiz) {
+ y1 = axisTop;
+ y2 = cHeight - axis.bottom;
+ if (x1 < axisLeft || x1 > axisLeft + axis.width) {
+ skip = true;
+ }
+ } else {
+ x1 = axisLeft;
+ x2 = cWidth - axis.right;
+
+ if (y1 < axisTop || y1 > axisTop + axis.height) {
+ skip = true;
+ }
+ }
+ return skip && !force ?
+ null :
+ chart.renderer.crispLine([M, x1, y1, L, x2, y2], lineWidth || 1);
+ },
+
+ /**
+ * Set the tick positions of a linear axis to round values like whole tens or every five.
+ */
+ getLinearTickPositions: function (tickInterval, min, max) {
+ var pos,
+ lastPos,
+ roundedMin = correctFloat(mathFloor(min / tickInterval) * tickInterval),
+ roundedMax = correctFloat(mathCeil(max / tickInterval) * tickInterval),
+ tickPositions = [];
+
+ // For single points, add a tick regardless of the relative position (#2662)
+ if (min === max && isNumber(min)) {
+ return [min];
+ }
+
+ // Populate the intermediate values
+ pos = roundedMin;
+ while (pos <= roundedMax) {
+
+ // Place the tick on the rounded value
+ tickPositions.push(pos);
+
+ // Always add the raw tickInterval, not the corrected one.
+ pos = correctFloat(pos + tickInterval);
+
+ // If the interval is not big enough in the current min - max range to actually increase
+ // the loop variable, we need to break out to prevent endless loop. Issue #619
+ if (pos === lastPos) {
+ break;
+ }
+
+ // Record the last value
+ lastPos = pos;
+ }
+ return tickPositions;
+ },
+
+ /**
+ * Return the minor tick positions. For logarithmic axes, reuse the same logic
+ * as for major ticks.
+ */
+ getMinorTickPositions: function () {
+ var axis = this,
+ options = axis.options,
+ tickPositions = axis.tickPositions,
+ minorTickInterval = axis.minorTickInterval,
+ minorTickPositions = [],
+ pos,
+ i,
+ len;
+
+ if (axis.isLog) {
+ len = tickPositions.length;
+ for (i = 1; i < len; i++) {
+ minorTickPositions = minorTickPositions.concat(
+ axis.getLogTickPositions(minorTickInterval, tickPositions[i - 1], tickPositions[i], true)
+ );
+ }
+ } else if (axis.isDatetimeAxis && options.minorTickInterval === 'auto') { // #1314
+ minorTickPositions = minorTickPositions.concat(
+ axis.getTimeTicks(
+ axis.normalizeTimeTickInterval(minorTickInterval),
+ axis.min,
+ axis.max,
+ options.startOfWeek
+ )
+ );
+ if (minorTickPositions[0] < axis.min) {
+ minorTickPositions.shift();
+ }
+ } else {
+ for (pos = axis.min + (tickPositions[0] - axis.min) % minorTickInterval; pos <= axis.max; pos += minorTickInterval) {
+ minorTickPositions.push(pos);
+ }
+ }
+ return minorTickPositions;
+ },
+
+ /**
+ * Adjust the min and max for the minimum range. Keep in mind that the series data is
+ * not yet processed, so we don't have information on data cropping and grouping, or
+ * updated axis.pointRange or series.pointRange. The data can't be processed until
+ * we have finally established min and max.
+ */
+ adjustForMinRange: function () {
+ var axis = this,
+ options = axis.options,
+ min = axis.min,
+ max = axis.max,
+ zoomOffset,
+ spaceAvailable = axis.dataMax - axis.dataMin >= axis.minRange,
+ closestDataRange,
+ i,
+ distance,
+ xData,
+ loopLength,
+ minArgs,
+ maxArgs;
+
+ // Set the automatic minimum range based on the closest point distance
+ if (axis.isXAxis && axis.minRange === UNDEFINED && !axis.isLog) {
+
+ if (defined(options.min) || defined(options.max)) {
+ axis.minRange = null; // don't do this again
+
+ } else {
+
+ // Find the closest distance between raw data points, as opposed to
+ // closestPointRange that applies to processed points (cropped and grouped)
+ each(axis.series, function (series) {
+ xData = series.xData;
+ loopLength = series.xIncrement ? 1 : xData.length - 1;
+ for (i = loopLength; i > 0; i--) {
+ distance = xData[i] - xData[i - 1];
+ if (closestDataRange === UNDEFINED || distance < closestDataRange) {
+ closestDataRange = distance;
+ }
+ }
+ });
+ axis.minRange = mathMin(closestDataRange * 5, axis.dataMax - axis.dataMin);
+ }
+ }
+
+ // if minRange is exceeded, adjust
+ if (max - min < axis.minRange) {
+ var minRange = axis.minRange;
+ zoomOffset = (minRange - max + min) / 2;
+
+ // if min and max options have been set, don't go beyond it
+ minArgs = [min - zoomOffset, pick(options.min, min - zoomOffset)];
+ if (spaceAvailable) { // if space is available, stay within the data range
+ minArgs[2] = axis.dataMin;
+ }
+ min = arrayMax(minArgs);
+
+ maxArgs = [min + minRange, pick(options.max, min + minRange)];
+ if (spaceAvailable) { // if space is availabe, stay within the data range
+ maxArgs[2] = axis.dataMax;
+ }
+
+ max = arrayMin(maxArgs);
+
+ // now if the max is adjusted, adjust the min back
+ if (max - min < minRange) {
+ minArgs[0] = max - minRange;
+ minArgs[1] = pick(options.min, max - minRange);
+ min = arrayMax(minArgs);
+ }
+ }
+
+ // Record modified extremes
+ axis.min = min;
+ axis.max = max;
+ },
+
+ /**
+ * Update translation information
+ */
+ setAxisTranslation: function (saveOld) {
+ var axis = this,
+ range = axis.max - axis.min,
+ pointRange = axis.axisPointRange || 0,
+ closestPointRange,
+ minPointOffset = 0,
+ pointRangePadding = 0,
+ linkedParent = axis.linkedParent,
+ ordinalCorrection,
+ hasCategories = !!axis.categories,
+ transA = axis.transA;
+
+ // Adjust translation for padding. Y axis with categories need to go through the same (#1784).
+ if (axis.isXAxis || hasCategories || pointRange) {
+ if (linkedParent) {
+ minPointOffset = linkedParent.minPointOffset;
+ pointRangePadding = linkedParent.pointRangePadding;
+
+ } else {
+ each(axis.series, function (series) {
+ var seriesPointRange = hasCategories ? 1 : (axis.isXAxis ? series.pointRange : (axis.axisPointRange || 0)), // #2806
+ pointPlacement = series.options.pointPlacement,
+ seriesClosestPointRange = series.closestPointRange;
+
+ if (seriesPointRange > range) { // #1446
+ seriesPointRange = 0;
+ }
+ pointRange = mathMax(pointRange, seriesPointRange);
+
+ // minPointOffset is the value padding to the left of the axis in order to make
+ // room for points with a pointRange, typically columns. When the pointPlacement option
+ // is 'between' or 'on', this padding does not apply.
+ minPointOffset = mathMax(
+ minPointOffset,
+ isString(pointPlacement) ? 0 : seriesPointRange / 2
+ );
+
+ // Determine the total padding needed to the length of the axis to make room for the
+ // pointRange. If the series' pointPlacement is 'on', no padding is added.
+ pointRangePadding = mathMax(
+ pointRangePadding,
+ pointPlacement === 'on' ? 0 : seriesPointRange
+ );
+
+ // Set the closestPointRange
+ if (!series.noSharedTooltip && defined(seriesClosestPointRange)) {
+ closestPointRange = defined(closestPointRange) ?
+ mathMin(closestPointRange, seriesClosestPointRange) :
+ seriesClosestPointRange;
+ }
+ });
+ }
+
+ // Record minPointOffset and pointRangePadding
+ ordinalCorrection = axis.ordinalSlope && closestPointRange ? axis.ordinalSlope / closestPointRange : 1; // #988, #1853
+ axis.minPointOffset = minPointOffset = minPointOffset * ordinalCorrection;
+ axis.pointRangePadding = pointRangePadding = pointRangePadding * ordinalCorrection;
+
+ // pointRange means the width reserved for each point, like in a column chart
+ axis.pointRange = mathMin(pointRange, range);
+
+ // closestPointRange means the closest distance between points. In columns
+ // it is mostly equal to pointRange, but in lines pointRange is 0 while closestPointRange
+ // is some other value
+ axis.closestPointRange = closestPointRange;
+ }
+
+ // Secondary values
+ if (saveOld) {
+ axis.oldTransA = transA;
+ }
+ axis.translationSlope = axis.transA = transA = axis.len / ((range + pointRangePadding) || 1);
+ axis.transB = axis.horiz ? axis.left : axis.bottom; // translation addend
+ axis.minPixelPadding = transA * minPointOffset;
+ },
+
+ /**
+ * Set the tick positions to round values and optionally extend the extremes
+ * to the nearest tick
+ */
+ setTickPositions: function (secondPass) {
+ var axis = this,
+ chart = axis.chart,
+ options = axis.options,
+ startOnTick = options.startOnTick,
+ endOnTick = options.endOnTick,
+ isLog = axis.isLog,
+ isDatetimeAxis = axis.isDatetimeAxis,
+ isXAxis = axis.isXAxis,
+ isLinked = axis.isLinked,
+ tickPositioner = axis.options.tickPositioner,
+ maxPadding = options.maxPadding,
+ minPadding = options.minPadding,
+ length,
+ linkedParentExtremes,
+ tickIntervalOption = options.tickInterval,
+ minTickIntervalOption = options.minTickInterval,
+ tickPixelIntervalOption = options.tickPixelInterval,
+ tickPositions,
+ keepTwoTicksOnly,
+ categories = axis.categories;
+
+ // linked axis gets the extremes from the parent axis
+ if (isLinked) {
+ axis.linkedParent = chart[axis.coll][options.linkedTo];
+ linkedParentExtremes = axis.linkedParent.getExtremes();
+ axis.min = pick(linkedParentExtremes.min, linkedParentExtremes.dataMin);
+ axis.max = pick(linkedParentExtremes.max, linkedParentExtremes.dataMax);
+ if (options.type !== axis.linkedParent.options.type) {
+ error(11, 1); // Can't link axes of different type
+ }
+ } else { // initial min and max from the extreme data values
+ axis.min = pick(axis.userMin, options.min, axis.dataMin);
+ axis.max = pick(axis.userMax, options.max, axis.dataMax);
+ }
+
+ if (isLog) {
+ if (!secondPass && mathMin(axis.min, pick(axis.dataMin, axis.min)) <= 0) { // #978
+ error(10, 1); // Can't plot negative values on log axis
+ }
+ axis.min = correctFloat(log2lin(axis.min)); // correctFloat cures #934
+ axis.max = correctFloat(log2lin(axis.max));
+ }
+
+ // handle zoomed range
+ if (axis.range && defined(axis.max)) {
+ axis.userMin = axis.min = mathMax(axis.min, axis.max - axis.range); // #618
+ axis.userMax = axis.max;
+
+ axis.range = null; // don't use it when running setExtremes
+ }
+
+ // Hook for adjusting this.min and this.max. Used by bubble series.
+ if (axis.beforePadding) {
+ axis.beforePadding();
+ }
+
+ // adjust min and max for the minimum range
+ axis.adjustForMinRange();
+
+ // Pad the values to get clear of the chart's edges. To avoid tickInterval taking the padding
+ // into account, we do this after computing tick interval (#1337).
+ if (!categories && !axis.axisPointRange && !axis.usePercentage && !isLinked && defined(axis.min) && defined(axis.max)) {
+ length = axis.max - axis.min;
+ if (length) {
+ if (!defined(options.min) && !defined(axis.userMin) && minPadding && (axis.dataMin < 0 || !axis.ignoreMinPadding)) {
+ axis.min -= length * minPadding;
+ }
+ if (!defined(options.max) && !defined(axis.userMax) && maxPadding && (axis.dataMax > 0 || !axis.ignoreMaxPadding)) {
+ axis.max += length * maxPadding;
+ }
+ }
+ }
+
+ // Stay within floor and ceiling
+ if (isNumber(options.floor)) {
+ axis.min = mathMax(axis.min, options.floor);
+ }
+ if (isNumber(options.ceiling)) {
+ axis.max = mathMin(axis.max, options.ceiling);
+ }
+
+ // get tickInterval
+ if (axis.min === axis.max || axis.min === undefined || axis.max === undefined) {
+ axis.tickInterval = 1;
+ } else if (isLinked && !tickIntervalOption &&
+ tickPixelIntervalOption === axis.linkedParent.options.tickPixelInterval) {
+ axis.tickInterval = axis.linkedParent.tickInterval;
+ } else {
+ axis.tickInterval = pick(
+ tickIntervalOption,
+ categories ? // for categoried axis, 1 is default, for linear axis use tickPix
+ 1 :
+ // don't let it be more than the data range
+ (axis.max - axis.min) * tickPixelIntervalOption / mathMax(axis.len, tickPixelIntervalOption)
+ );
+ // For squished axes, set only two ticks
+ if (!defined(tickIntervalOption) && axis.len < tickPixelIntervalOption && !this.isRadial &&
+ !this.isLog && !categories && startOnTick && endOnTick) {
+ keepTwoTicksOnly = true;
+ axis.tickInterval /= 4; // tick extremes closer to the real values
+ }
+ }
+
+ // Now we're finished detecting min and max, crop and group series data. This
+ // is in turn needed in order to find tick positions in ordinal axes.
+ if (isXAxis && !secondPass) {
+ each(axis.series, function (series) {
+ series.processData(axis.min !== axis.oldMin || axis.max !== axis.oldMax);
+ });
+ }
+
+ // set the translation factor used in translate function
+ axis.setAxisTranslation(true);
+
+ // hook for ordinal axes and radial axes
+ if (axis.beforeSetTickPositions) {
+ axis.beforeSetTickPositions();
+ }
+
+ // hook for extensions, used in Highstock ordinal axes
+ if (axis.postProcessTickInterval) {
+ axis.tickInterval = axis.postProcessTickInterval(axis.tickInterval);
+ }
+
+ // In column-like charts, don't cramp in more ticks than there are points (#1943)
+ if (axis.pointRange) {
+ axis.tickInterval = mathMax(axis.pointRange, axis.tickInterval);
+ }
+
+ // Before normalizing the tick interval, handle minimum tick interval. This applies only if tickInterval is not defined.
+ if (!tickIntervalOption && axis.tickInterval < minTickIntervalOption) {
+ axis.tickInterval = minTickIntervalOption;
+ }
+
+ // for linear axes, get magnitude and normalize the interval
+ if (!isDatetimeAxis && !isLog) { // linear
+ if (!tickIntervalOption) {
+ axis.tickInterval = normalizeTickInterval(
+ axis.tickInterval,
+ null,
+ getMagnitude(axis.tickInterval),
+ // If the tick interval is between 1 and 5 and the axis max is in the order of
+ // thousands, chances are we are dealing with years. Don't allow decimals. #3363.
+ pick(options.allowDecimals, !(axis.tickInterval > 1 && axis.tickInterval < 5 && axis.max > 1000 && axis.max < 9999))
+ );
+ }
+ }
+
+ // get minorTickInterval
+ axis.minorTickInterval = options.minorTickInterval === 'auto' && axis.tickInterval ?
+ axis.tickInterval / 5 : options.minorTickInterval;
+
+ // find the tick positions
+ axis.tickPositions = tickPositions = options.tickPositions ?
+ [].concat(options.tickPositions) : // Work on a copy (#1565)
+ (tickPositioner && tickPositioner.apply(axis, [axis.min, axis.max]));
+ if (!tickPositions) {
+
+ // Too many ticks
+ if (!axis.ordinalPositions && (axis.max - axis.min) / axis.tickInterval > mathMax(2 * axis.len, 200)) {
+ error(19, true);
+ }
+
+ if (isDatetimeAxis) {
+ tickPositions = axis.getTimeTicks(
+ axis.normalizeTimeTickInterval(axis.tickInterval, options.units),
+ axis.min,
+ axis.max,
+ options.startOfWeek,
+ axis.ordinalPositions,
+ axis.closestPointRange,
+ true
+ );
+ } else if (isLog) {
+ tickPositions = axis.getLogTickPositions(axis.tickInterval, axis.min, axis.max);
+ } else {
+ tickPositions = axis.getLinearTickPositions(axis.tickInterval, axis.min, axis.max);
+ }
+
+ if (keepTwoTicksOnly) {
+ tickPositions.splice(1, tickPositions.length - 2);
+ }
+
+ axis.tickPositions = tickPositions;
+ }
+
+ if (!isLinked) {
+
+ // reset min/max or remove extremes based on start/end on tick
+ var roundedMin = tickPositions[0],
+ roundedMax = tickPositions[tickPositions.length - 1],
+ minPointOffset = axis.minPointOffset || 0,
+ singlePad;
+
+ if (startOnTick) {
+ axis.min = roundedMin;
+ } else if (axis.min - minPointOffset > roundedMin) {
+ tickPositions.shift();
+ }
+
+ if (endOnTick) {
+ axis.max = roundedMax;
+ } else if (axis.max + minPointOffset < roundedMax) {
+ tickPositions.pop();
+ }
+
+ // If no tick are left, set one tick in the middle (#3195)
+ if (tickPositions.length === 0 && defined(roundedMin)) {
+ tickPositions.push((roundedMax + roundedMin) / 2);
+ }
+
+ // When there is only one point, or all points have the same value on this axis, then min
+ // and max are equal and tickPositions.length is 0 or 1. In this case, add some padding
+ // in order to center the point, but leave it with one tick. #1337.
+ if (tickPositions.length === 1) {
+ singlePad = mathAbs(axis.max) > 10e12 ? 1 : 0.001; // The lowest possible number to avoid extra padding on columns (#2619, #2846)
+ axis.min -= singlePad;
+ axis.max += singlePad;
+ }
+ }
+ },
+
+ /**
+ * Set the max ticks of either the x and y axis collection
+ */
+ setMaxTicks: function () {
+
+ var chart = this.chart,
+ maxTicks = chart.maxTicks || {},
+ tickPositions = this.tickPositions,
+ key = this._maxTicksKey = [this.coll, this.pos, this.len].join('-');
+
+ if (!this.isLinked && !this.isDatetimeAxis && tickPositions && tickPositions.length > (maxTicks[key] || 0) && this.options.alignTicks !== false) {
+ maxTicks[key] = tickPositions.length;
+ }
+ chart.maxTicks = maxTicks;
+ },
+
+ /**
+ * When using multiple axes, adjust the number of ticks to match the highest
+ * number of ticks in that group
+ */
+ adjustTickAmount: function () {
+ var axis = this,
+ chart = axis.chart,
+ key = axis._maxTicksKey,
+ tickPositions = axis.tickPositions,
+ maxTicks = chart.maxTicks;
+
+ if (maxTicks && maxTicks[key] && !axis.isDatetimeAxis && !axis.categories && !axis.isLinked &&
+ axis.options.alignTicks !== false && this.min !== UNDEFINED) {
+ var oldTickAmount = axis.tickAmount,
+ calculatedTickAmount = tickPositions.length,
+ tickAmount;
+
+ // set the axis-level tickAmount to use below
+ axis.tickAmount = tickAmount = maxTicks[key];
+
+ if (calculatedTickAmount < tickAmount) {
+ while (tickPositions.length < tickAmount) {
+ tickPositions.push(correctFloat(
+ tickPositions[tickPositions.length - 1] + axis.tickInterval
+ ));
+ }
+ axis.transA *= (calculatedTickAmount - 1) / (tickAmount - 1);
+ axis.max = tickPositions[tickPositions.length - 1];
+
+ }
+ if (defined(oldTickAmount) && tickAmount !== oldTickAmount) {
+ axis.isDirty = true;
+ }
+ }
+ },
+
+ /**
+ * Set the scale based on data min and max, user set min and max or options
+ *
+ */
+ setScale: function () {
+ var axis = this,
+ stacks = axis.stacks,
+ type,
+ i,
+ isDirtyData,
+ isDirtyAxisLength;
+
+ axis.oldMin = axis.min;
+ axis.oldMax = axis.max;
+ axis.oldAxisLength = axis.len;
+
+ // set the new axisLength
+ axis.setAxisSize();
+ //axisLength = horiz ? axisWidth : axisHeight;
+ isDirtyAxisLength = axis.len !== axis.oldAxisLength;
+
+ // is there new data?
+ each(axis.series, function (series) {
+ if (series.isDirtyData || series.isDirty ||
+ series.xAxis.isDirty) { // when x axis is dirty, we need new data extremes for y as well
+ isDirtyData = true;
+ }
+ });
+
+ // do we really need to go through all this?
+ if (isDirtyAxisLength || isDirtyData || axis.isLinked || axis.forceRedraw ||
+ axis.userMin !== axis.oldUserMin || axis.userMax !== axis.oldUserMax) {
+
+ // reset stacks
+ if (!axis.isXAxis) {
+ for (type in stacks) {
+ for (i in stacks[type]) {
+ stacks[type][i].total = null;
+ stacks[type][i].cum = 0;
+ }
+ }
+ }
+
+ axis.forceRedraw = false;
+
+ // get data extremes if needed
+ axis.getSeriesExtremes();
+
+ // get fixed positions based on tickInterval
+ axis.setTickPositions();
+
+ // record old values to decide whether a rescale is necessary later on (#540)
+ axis.oldUserMin = axis.userMin;
+ axis.oldUserMax = axis.userMax;
+
+ // Mark as dirty if it is not already set to dirty and extremes have changed. #595.
+ if (!axis.isDirty) {
+ axis.isDirty = isDirtyAxisLength || axis.min !== axis.oldMin || axis.max !== axis.oldMax;
+ }
+ } else if (!axis.isXAxis) {
+ if (axis.oldStacks) {
+ stacks = axis.stacks = axis.oldStacks;
+ }
+
+ // reset stacks
+ for (type in stacks) {
+ for (i in stacks[type]) {
+ stacks[type][i].cum = stacks[type][i].total;
+ }
+ }
+ }
+
+ // Set the maximum tick amount
+ axis.setMaxTicks();
+ },
+
+ /**
+ * Set the extremes and optionally redraw
+ * @param {Number} newMin
+ * @param {Number} newMax
+ * @param {Boolean} redraw
+ * @param {Boolean|Object} animation Whether to apply animation, and optionally animation
+ * configuration
+ * @param {Object} eventArguments
+ *
+ */
+ setExtremes: function (newMin, newMax, redraw, animation, eventArguments) {
+ var axis = this,
+ chart = axis.chart;
+
+ redraw = pick(redraw, true); // defaults to true
+
+ // Extend the arguments with min and max
+ eventArguments = extend(eventArguments, {
+ min: newMin,
+ max: newMax
+ });
+
+ // Fire the event
+ fireEvent(axis, 'setExtremes', eventArguments, function () { // the default event handler
+
+ axis.userMin = newMin;
+ axis.userMax = newMax;
+ axis.eventArgs = eventArguments;
+
+ // Mark for running afterSetExtremes
+ axis.isDirtyExtremes = true;
+
+ // redraw
+ if (redraw) {
+ chart.redraw(animation);
+ }
+ });
+ },
+
+ /**
+ * Overridable method for zooming chart. Pulled out in a separate method to allow overriding
+ * in stock charts.
+ */
+ zoom: function (newMin, newMax) {
+ var dataMin = this.dataMin,
+ dataMax = this.dataMax,
+ options = this.options;
+
+ // Prevent pinch zooming out of range. Check for defined is for #1946. #1734.
+ if (!this.allowZoomOutside) {
+ if (defined(dataMin) && newMin <= mathMin(dataMin, pick(options.min, dataMin))) {
+ newMin = UNDEFINED;
+ }
+ if (defined(dataMax) && newMax >= mathMax(dataMax, pick(options.max, dataMax))) {
+ newMax = UNDEFINED;
+ }
+ }
+
+ // In full view, displaying the reset zoom button is not required
+ this.displayBtn = newMin !== UNDEFINED || newMax !== UNDEFINED;
+
+ // Do it
+ this.setExtremes(
+ newMin,
+ newMax,
+ false,
+ UNDEFINED,
+ { trigger: 'zoom' }
+ );
+ return true;
+ },
+
+ /**
+ * Update the axis metrics
+ */
+ setAxisSize: function () {
+ var chart = this.chart,
+ options = this.options,
+ offsetLeft = options.offsetLeft || 0,
+ offsetRight = options.offsetRight || 0,
+ horiz = this.horiz,
+ width = pick(options.width, chart.plotWidth - offsetLeft + offsetRight),
+ height = pick(options.height, chart.plotHeight),
+ top = pick(options.top, chart.plotTop),
+ left = pick(options.left, chart.plotLeft + offsetLeft),
+ percentRegex = /%$/;
+
+ // Check for percentage based input values
+ if (percentRegex.test(height)) {
+ height = parseInt(height, 10) / 100 * chart.plotHeight;
+ }
+ if (percentRegex.test(top)) {
+ top = parseInt(top, 10) / 100 * chart.plotHeight + chart.plotTop;
+ }
+
+ // Expose basic values to use in Series object and navigator
+ this.left = left;
+ this.top = top;
+ this.width = width;
+ this.height = height;
+ this.bottom = chart.chartHeight - height - top;
+ this.right = chart.chartWidth - width - left;
+
+ // Direction agnostic properties
+ this.len = mathMax(horiz ? width : height, 0); // mathMax fixes #905
+ this.pos = horiz ? left : top; // distance from SVG origin
+ },
+
+ /**
+ * Get the actual axis extremes
+ */
+ getExtremes: function () {
+ var axis = this,
+ isLog = axis.isLog;
+
+ return {
+ min: isLog ? correctFloat(lin2log(axis.min)) : axis.min,
+ max: isLog ? correctFloat(lin2log(axis.max)) : axis.max,
+ dataMin: axis.dataMin,
+ dataMax: axis.dataMax,
+ userMin: axis.userMin,
+ userMax: axis.userMax
+ };
+ },
+
+ /**
+ * Get the zero plane either based on zero or on the min or max value.
+ * Used in bar and area plots
+ */
+ getThreshold: function (threshold) {
+ var axis = this,
+ isLog = axis.isLog;
+
+ var realMin = isLog ? lin2log(axis.min) : axis.min,
+ realMax = isLog ? lin2log(axis.max) : axis.max;
+
+ if (realMin > threshold || threshold === null) {
+ threshold = realMin;
+ } else if (realMax < threshold) {
+ threshold = realMax;
+ }
+
+ return axis.translate(threshold, 0, 1, 0, 1);
+ },
+
+ /**
+ * Compute auto alignment for the axis label based on which side the axis is on
+ * and the given rotation for the label
+ */
+ autoLabelAlign: function (rotation) {
+ var ret,
+ angle = (pick(rotation, 0) - (this.side * 90) + 720) % 360;
+
+ if (angle > 15 && angle < 165) {
+ ret = 'right';
+ } else if (angle > 195 && angle < 345) {
+ ret = 'left';
+ } else {
+ ret = 'center';
+ }
+ return ret;
+ },
+
+ /**
+ * Render the tick labels to a preliminary position to get their sizes
+ */
+ getOffset: function () {
+ var axis = this,
+ chart = axis.chart,
+ renderer = chart.renderer,
+ options = axis.options,
+ tickPositions = axis.tickPositions,
+ ticks = axis.ticks,
+ horiz = axis.horiz,
+ side = axis.side,
+ invertedSide = chart.inverted ? [1, 0, 3, 2][side] : side,
+ hasData,
+ showAxis,
+ titleOffset = 0,
+ titleOffsetOption,
+ titleMargin = 0,
+ axisTitleOptions = options.title,
+ labelOptions = options.labels,
+ labelOffset = 0, // reset
+ labelOffsetPadded,
+ axisOffset = chart.axisOffset,
+ clipOffset = chart.clipOffset,
+ directionFactor = [-1, 1, 1, -1][side],
+ n,
+ i,
+ autoStaggerLines = 1,
+ maxStaggerLines = pick(labelOptions.maxStaggerLines, 5),
+ sortedPositions,
+ lastRight,
+ overlap,
+ pos,
+ bBox,
+ x,
+ w,
+ lineNo,
+ lineHeightCorrection;
+
+ // For reuse in Axis.render
+ axis.hasData = hasData = (axis.hasVisibleSeries || (defined(axis.min) && defined(axis.max) && !!tickPositions));
+ axis.showAxis = showAxis = hasData || pick(options.showEmpty, true);
+
+ // Set/reset staggerLines
+ axis.staggerLines = axis.horiz && labelOptions.staggerLines;
+
+ // Create the axisGroup and gridGroup elements on first iteration
+ if (!axis.axisGroup) {
+ axis.gridGroup = renderer.g('grid')
+ .attr({ zIndex: options.gridZIndex || 1 })
+ .add();
+ axis.axisGroup = renderer.g('axis')
+ .attr({ zIndex: options.zIndex || 2 })
+ .add();
+ axis.labelGroup = renderer.g('axis-labels')
+ .attr({ zIndex: labelOptions.zIndex || 7 })
+ .addClass(PREFIX + axis.coll.toLowerCase() + '-labels')
+ .add();
+ }
+
+ if (hasData || axis.isLinked) {
+
+ // Set the explicit or automatic label alignment
+ axis.labelAlign = pick(labelOptions.align || axis.autoLabelAlign(labelOptions.rotation));
+
+ // Generate ticks
+ each(tickPositions, function (pos) {
+ if (!ticks[pos]) {
+ ticks[pos] = new Tick(axis, pos);
+ } else {
+ ticks[pos].addLabel(); // update labels depending on tick interval
+ }
+ });
+
+ // Handle automatic stagger lines
+ if (axis.horiz && !axis.staggerLines && maxStaggerLines && !labelOptions.rotation) {
+ sortedPositions = axis.reversed ? [].concat(tickPositions).reverse() : tickPositions;
+ while (autoStaggerLines < maxStaggerLines) {
+ lastRight = [];
+ overlap = false;
+
+ for (i = 0; i < sortedPositions.length; i++) {
+ pos = sortedPositions[i];
+ bBox = ticks[pos].label && ticks[pos].label.getBBox();
+ w = bBox ? bBox.width : 0;
+ lineNo = i % autoStaggerLines;
+
+ if (w) {
+ x = axis.translate(pos); // don't handle log
+ if (lastRight[lineNo] !== UNDEFINED && x < lastRight[lineNo]) {
+ overlap = true;
+ }
+ lastRight[lineNo] = x + w;
+ }
+ }
+ if (overlap) {
+ autoStaggerLines++;
+ } else {
+ break;
+ }
+ }
+
+ if (autoStaggerLines > 1) {
+ axis.staggerLines = autoStaggerLines;
+ }
+ }
+
+
+ each(tickPositions, function (pos) {
+ // left side must be align: right and right side must have align: left for labels
+ if (side === 0 || side === 2 || { 1: 'left', 3: 'right' }[side] === axis.labelAlign) {
+
+ // get the highest offset
+ labelOffset = mathMax(
+ ticks[pos].getLabelSize(),
+ labelOffset
+ );
+ }
+ });
+
+ if (axis.staggerLines) {
+ labelOffset *= axis.staggerLines;
+ axis.labelOffset = labelOffset;
+ }
+
+
+ } else { // doesn't have data
+ for (n in ticks) {
+ ticks[n].destroy();
+ delete ticks[n];
+ }
+ }
+
+ if (axisTitleOptions && axisTitleOptions.text && axisTitleOptions.enabled !== false) {
+ if (!axis.axisTitle) {
+ axis.axisTitle = renderer.text(
+ axisTitleOptions.text,
+ 0,
+ 0,
+ axisTitleOptions.useHTML
+ )
+ .attr({
+ zIndex: 7,
+ rotation: axisTitleOptions.rotation || 0,
+ align:
+ axisTitleOptions.textAlign ||
+ { low: 'left', middle: 'center', high: 'right' }[axisTitleOptions.align]
+ })
+ .addClass(PREFIX + this.coll.toLowerCase() + '-title')
+ .css(axisTitleOptions.style)
+ .add(axis.axisGroup);
+ axis.axisTitle.isNew = true;
+ }
+
+ if (showAxis) {
+ titleOffset = axis.axisTitle.getBBox()[horiz ? 'height' : 'width'];
+ titleOffsetOption = axisTitleOptions.offset;
+ titleMargin = defined(titleOffsetOption) ? 0 : pick(axisTitleOptions.margin, horiz ? 5 : 10);
+ }
+
+ // hide or show the title depending on whether showEmpty is set
+ axis.axisTitle[showAxis ? 'show' : 'hide']();
+ }
+
+ // handle automatic or user set offset
+ axis.offset = directionFactor * pick(options.offset, axisOffset[side]);
+
+ lineHeightCorrection = side === 2 ? axis.tickBaseline : 0;
+ labelOffsetPadded = labelOffset + titleMargin +
+ (labelOffset && (directionFactor * (horiz ? pick(labelOptions.y, axis.tickBaseline + 8) : labelOptions.x) - lineHeightCorrection));
+ axis.axisTitleMargin = pick(titleOffsetOption, labelOffsetPadded);
+
+ axisOffset[side] = mathMax(
+ axisOffset[side],
+ axis.axisTitleMargin + titleOffset + directionFactor * axis.offset,
+ labelOffsetPadded // #3027
+ );
+ clipOffset[invertedSide] = mathMax(clipOffset[invertedSide], mathFloor(options.lineWidth / 2) * 2);
+ },
+
+ /**
+ * Get the path for the axis line
+ */
+ getLinePath: function (lineWidth) {
+ var chart = this.chart,
+ opposite = this.opposite,
+ offset = this.offset,
+ horiz = this.horiz,
+ lineLeft = this.left + (opposite ? this.width : 0) + offset,
+ lineTop = chart.chartHeight - this.bottom - (opposite ? this.height : 0) + offset;
+
+ if (opposite) {
+ lineWidth *= -1; // crispify the other way - #1480, #1687
+ }
+
+ return chart.renderer.crispLine([
+ M,
+ horiz ?
+ this.left :
+ lineLeft,
+ horiz ?
+ lineTop :
+ this.top,
+ L,
+ horiz ?
+ chart.chartWidth - this.right :
+ lineLeft,
+ horiz ?
+ lineTop :
+ chart.chartHeight - this.bottom
+ ], lineWidth);
+ },
+
+ /**
+ * Position the title
+ */
+ getTitlePosition: function () {
+ // compute anchor points for each of the title align options
+ var horiz = this.horiz,
+ axisLeft = this.left,
+ axisTop = this.top,
+ axisLength = this.len,
+ axisTitleOptions = this.options.title,
+ margin = horiz ? axisLeft : axisTop,
+ opposite = this.opposite,
+ offset = this.offset,
+ fontSize = pInt(axisTitleOptions.style.fontSize || 12),
+
+ // the position in the length direction of the axis
+ alongAxis = {
+ low: margin + (horiz ? 0 : axisLength),
+ middle: margin + axisLength / 2,
+ high: margin + (horiz ? axisLength : 0)
+ }[axisTitleOptions.align],
+
+ // the position in the perpendicular direction of the axis
+ offAxis = (horiz ? axisTop + this.height : axisLeft) +
+ (horiz ? 1 : -1) * // horizontal axis reverses the margin
+ (opposite ? -1 : 1) * // so does opposite axes
+ this.axisTitleMargin +
+ (this.side === 2 ? fontSize : 0);
+
+ return {
+ x: horiz ?
+ alongAxis :
+ offAxis + (opposite ? this.width : 0) + offset +
+ (axisTitleOptions.x || 0), // x
+ y: horiz ?
+ offAxis - (opposite ? this.height : 0) + offset :
+ alongAxis + (axisTitleOptions.y || 0) // y
+ };
+ },
+
+ /**
+ * Render the axis
+ */
+ render: function () {
+ var axis = this,
+ horiz = axis.horiz,
+ reversed = axis.reversed,
+ chart = axis.chart,
+ renderer = chart.renderer,
+ options = axis.options,
+ isLog = axis.isLog,
+ isLinked = axis.isLinked,
+ tickPositions = axis.tickPositions,
+ sortedPositions,
+ axisTitle = axis.axisTitle,
+ ticks = axis.ticks,
+ minorTicks = axis.minorTicks,
+ alternateBands = axis.alternateBands,
+ stackLabelOptions = options.stackLabels,
+ alternateGridColor = options.alternateGridColor,
+ tickmarkOffset = axis.tickmarkOffset,
+ lineWidth = options.lineWidth,
+ linePath,
+ hasRendered = chart.hasRendered,
+ slideInTicks = hasRendered && defined(axis.oldMin) && !isNaN(axis.oldMin),
+ hasData = axis.hasData,
+ showAxis = axis.showAxis,
+ from,
+ overflow = options.labels.overflow,
+ justifyLabels = axis.justifyLabels = horiz && overflow !== false,
+ to;
+
+ // Reset
+ axis.labelEdge.length = 0;
+ axis.justifyToPlot = overflow === 'justify';
+
+ // Mark all elements inActive before we go over and mark the active ones
+ each([ticks, minorTicks, alternateBands], function (coll) {
+ var pos;
+ for (pos in coll) {
+ coll[pos].isActive = false;
+ }
+ });
+
+ // If the series has data draw the ticks. Else only the line and title
+ if (hasData || isLinked) {
+
+ // minor ticks
+ if (axis.minorTickInterval && !axis.categories) {
+ each(axis.getMinorTickPositions(), function (pos) {
+ if (!minorTicks[pos]) {
+ minorTicks[pos] = new Tick(axis, pos, 'minor');
+ }
+
+ // render new ticks in old position
+ if (slideInTicks && minorTicks[pos].isNew) {
+ minorTicks[pos].render(null, true);
+ }
+
+ minorTicks[pos].render(null, false, 1);
+ });
+ }
+
+ // Major ticks. Pull out the first item and render it last so that
+ // we can get the position of the neighbour label. #808.
+ if (tickPositions.length) { // #1300
+ sortedPositions = tickPositions.slice();
+ if ((horiz && reversed) || (!horiz && !reversed)) {
+ sortedPositions.reverse();
+ }
+ if (justifyLabels) {
+ sortedPositions = sortedPositions.slice(1).concat([sortedPositions[0]]);
+ }
+ each(sortedPositions, function (pos, i) {
+
+ // Reorganize the indices
+ if (justifyLabels) {
+ i = (i === sortedPositions.length - 1) ? 0 : i + 1;
+ }
+
+ // linked axes need an extra check to find out if
+ if (!isLinked || (pos >= axis.min && pos <= axis.max)) {
+
+ if (!ticks[pos]) {
+ ticks[pos] = new Tick(axis, pos);
+ }
+
+ // render new ticks in old position
+ if (slideInTicks && ticks[pos].isNew) {
+ ticks[pos].render(i, true, 0.1);
+ }
+
+ ticks[pos].render(i);
+ }
+
+ });
+ // In a categorized axis, the tick marks are displayed between labels. So
+ // we need to add a tick mark and grid line at the left edge of the X axis.
+ if (tickmarkOffset && axis.min === 0) {
+ if (!ticks[-1]) {
+ ticks[-1] = new Tick(axis, -1, null, true);
+ }
+ ticks[-1].render(-1);
+ }
+
+ }
+
+ // alternate grid color
+ if (alternateGridColor) {
+ each(tickPositions, function (pos, i) {
+ if (i % 2 === 0 && pos < axis.max) {
+ if (!alternateBands[pos]) {
+ alternateBands[pos] = new Highcharts.PlotLineOrBand(axis);
+ }
+ from = pos + tickmarkOffset; // #949
+ to = tickPositions[i + 1] !== UNDEFINED ? tickPositions[i + 1] + tickmarkOffset : axis.max;
+ alternateBands[pos].options = {
+ from: isLog ? lin2log(from) : from,
+ to: isLog ? lin2log(to) : to,
+ color: alternateGridColor
+ };
+ alternateBands[pos].render();
+ alternateBands[pos].isActive = true;
+ }
+ });
+ }
+
+ // custom plot lines and bands
+ if (!axis._addedPlotLB) { // only first time
+ each((options.plotLines || []).concat(options.plotBands || []), function (plotLineOptions) {
+ axis.addPlotBandOrLine(plotLineOptions);
+ });
+ axis._addedPlotLB = true;
+ }
+
+ } // end if hasData
+
+ // Remove inactive ticks
+ each([ticks, minorTicks, alternateBands], function (coll) {
+ var pos,
+ i,
+ forDestruction = [],
+ delay = globalAnimation ? globalAnimation.duration || 500 : 0,
+ destroyInactiveItems = function () {
+ i = forDestruction.length;
+ while (i--) {
+ // When resizing rapidly, the same items may be destroyed in different timeouts,
+ // or the may be reactivated
+ if (coll[forDestruction[i]] && !coll[forDestruction[i]].isActive) {
+ coll[forDestruction[i]].destroy();
+ delete coll[forDestruction[i]];
+ }
+ }
+
+ };
+
+ for (pos in coll) {
+
+ if (!coll[pos].isActive) {
+ // Render to zero opacity
+ coll[pos].render(pos, false, 0);
+ coll[pos].isActive = false;
+ forDestruction.push(pos);
+ }
+ }
+
+ // When the objects are finished fading out, destroy them
+ if (coll === alternateBands || !chart.hasRendered || !delay) {
+ destroyInactiveItems();
+ } else if (delay) {
+ setTimeout(destroyInactiveItems, delay);
+ }
+ });
+
+ // Static items. As the axis group is cleared on subsequent calls
+ // to render, these items are added outside the group.
+ // axis line
+ if (lineWidth) {
+ linePath = axis.getLinePath(lineWidth);
+ if (!axis.axisLine) {
+ axis.axisLine = renderer.path(linePath)
+ .attr({
+ stroke: options.lineColor,
+ 'stroke-width': lineWidth,
+ zIndex: 7
+ })
+ .add(axis.axisGroup);
+ } else {
+ axis.axisLine.animate({ d: linePath });
+ }
+
+ // show or hide the line depending on options.showEmpty
+ axis.axisLine[showAxis ? 'show' : 'hide']();
+ }
+
+ if (axisTitle && showAxis) {
+
+ axisTitle[axisTitle.isNew ? 'attr' : 'animate'](
+ axis.getTitlePosition()
+ );
+ axisTitle.isNew = false;
+ }
+
+ // Stacked totals:
+ if (stackLabelOptions && stackLabelOptions.enabled) {
+ axis.renderStackTotals();
+ }
+ // End stacked totals
+
+ axis.isDirty = false;
+ },
+
+ /**
+ * Redraw the axis to reflect changes in the data or axis extremes
+ */
+ redraw: function () {
+
+ // render the axis
+ this.render();
+
+ // move plot lines and bands
+ each(this.plotLinesAndBands, function (plotLine) {
+ plotLine.render();
+ });
+
+ // mark associated series as dirty and ready for redraw
+ each(this.series, function (series) {
+ series.isDirty = true;
+ });
+
+ },
+
+ /**
+ * Destroys an Axis instance.
+ */
+ destroy: function (keepEvents) {
+ var axis = this,
+ stacks = axis.stacks,
+ stackKey,
+ plotLinesAndBands = axis.plotLinesAndBands,
+ i;
+
+ // Remove the events
+ if (!keepEvents) {
+ removeEvent(axis);
+ }
+
+ // Destroy each stack total
+ for (stackKey in stacks) {
+ destroyObjectProperties(stacks[stackKey]);
+
+ stacks[stackKey] = null;
+ }
+
+ // Destroy collections
+ each([axis.ticks, axis.minorTicks, axis.alternateBands], function (coll) {
+ destroyObjectProperties(coll);
+ });
+ i = plotLinesAndBands.length;
+ while (i--) { // #1975
+ plotLinesAndBands[i].destroy();
+ }
+
+ // Destroy local variables
+ each(['stackTotalGroup', 'axisLine', 'axisTitle', 'axisGroup', 'cross', 'gridGroup', 'labelGroup'], function (prop) {
+ if (axis[prop]) {
+ axis[prop] = axis[prop].destroy();
+ }
+ });
+
+ // Destroy crosshair
+ if (this.cross) {
+ this.cross.destroy();
+ }
+ },
+
+ /**
+ * Draw the crosshair
+ */
+ drawCrosshair: function (e, point) {
+ if (!this.crosshair) { return; }// Do not draw crosshairs if you don't have too.
+
+ if ((defined(point) || !pick(this.crosshair.snap, true)) === false) {
+ this.hideCrosshair();
+ return;
+ }
+
+ var path,
+ options = this.crosshair,
+ animation = options.animation,
+ pos;
+
+ // Get the path
+ if (!pick(options.snap, true)) {
+ pos = (this.horiz ? e.chartX - this.pos : this.len - e.chartY + this.pos);
+ } else if (defined(point)) {
+ /*jslint eqeq: true*/
+ pos = (this.chart.inverted != this.horiz) ? point.plotX : this.len - point.plotY;
+ /*jslint eqeq: false*/
+ }
+
+ if (this.isRadial) {
+ path = this.getPlotLinePath(this.isXAxis ? point.x : pick(point.stackY, point.y));
+ } else {
+ path = this.getPlotLinePath(null, null, null, null, pos);
+ }
+
+ if (path === null) {
+ this.hideCrosshair();
+ return;
+ }
+
+ // Draw the cross
+ if (this.cross) {
+ this.cross
+ .attr({ visibility: VISIBLE })[animation ? 'animate' : 'attr']({ d: path }, animation);
+ } else {
+ var attribs = {
+ 'stroke-width': options.width || 1,
+ stroke: options.color || '#C0C0C0',
+ zIndex: options.zIndex || 2
+ };
+ if (options.dashStyle) {
+ attribs.dashstyle = options.dashStyle;
+ }
+ this.cross = this.chart.renderer.path(path).attr(attribs).add();
+ }
+ },
+
+ /**
+ * Hide the crosshair.
+ */
+ hideCrosshair: function () {
+ if (this.cross) {
+ this.cross.hide();
+ }
+ }
+ }; // end Axis
+
+ extend(Axis.prototype, AxisPlotLineOrBandExtension);
+
+
+
+ /**
+ * Set the tick positions to a time unit that makes sense, for example
+ * on the first of each month or on every Monday. Return an array
+ * with the time positions. Used in datetime axes as well as for grouping
+ * data on a datetime axis.
+ *
+ * @param {Object} normalizedInterval The interval in axis values (ms) and the count
+ * @param {Number} min The minimum in axis values
+ * @param {Number} max The maximum in axis values
+ * @param {Number} startOfWeek
+ */
+ Axis.prototype.getTimeTicks = function (normalizedInterval, min, max, startOfWeek) {
+ var tickPositions = [],
+ i,
+ higherRanks = {},
+ useUTC = defaultOptions.global.useUTC,
+ minYear, // used in months and years as a basis for Date.UTC()
+ minDate = new Date(min - timezoneOffset),
+ interval = normalizedInterval.unitRange,
+ count = normalizedInterval.count;
+
+ if (defined(min)) { // #1300
+ if (interval >= timeUnits.second) { // second
+ minDate.setMilliseconds(0);
+ minDate.setSeconds(interval >= timeUnits.minute ? 0 :
+ count * mathFloor(minDate.getSeconds() / count));
+ }
+
+ if (interval >= timeUnits.minute) { // minute
+ minDate[setMinutes](interval >= timeUnits.hour ? 0 :
+ count * mathFloor(minDate[getMinutes]() / count));
+ }
+
+ if (interval >= timeUnits.hour) { // hour
+ minDate[setHours](interval >= timeUnits.day ? 0 :
+ count * mathFloor(minDate[getHours]() / count));
+ }
+
+ if (interval >= timeUnits.day) { // day
+ minDate[setDate](interval >= timeUnits.month ? 1 :
+ count * mathFloor(minDate[getDate]() / count));
+ }
+
+ if (interval >= timeUnits.month) { // month
+ minDate[setMonth](interval >= timeUnits.year ? 0 :
+ count * mathFloor(minDate[getMonth]() / count));
+ minYear = minDate[getFullYear]();
+ }
+
+ if (interval >= timeUnits.year) { // year
+ minYear -= minYear % count;
+ minDate[setFullYear](minYear);
+ }
+
+ // week is a special case that runs outside the hierarchy
+ if (interval === timeUnits.week) {
+ // get start of current week, independent of count
+ minDate[setDate](minDate[getDate]() - minDate[getDay]() +
+ pick(startOfWeek, 1));
+ }
+
+
+ // get tick positions
+ i = 1;
+ if (timezoneOffset) {
+ minDate = new Date(minDate.getTime() + timezoneOffset);
+ }
+ minYear = minDate[getFullYear]();
+ var time = minDate.getTime(),
+ minMonth = minDate[getMonth](),
+ minDateDate = minDate[getDate](),
+ localTimezoneOffset = (timeUnits.day +
+ (useUTC ? timezoneOffset : minDate.getTimezoneOffset() * 60 * 1000)
+ ) % timeUnits.day; // #950, #3359
+
+ // iterate and add tick positions at appropriate values
+ while (time < max) {
+ tickPositions.push(time);
+
+ // if the interval is years, use Date.UTC to increase years
+ if (interval === timeUnits.year) {
+ time = makeTime(minYear + i * count, 0);
+
+ // if the interval is months, use Date.UTC to increase months
+ } else if (interval === timeUnits.month) {
+ time = makeTime(minYear, minMonth + i * count);
+
+ // if we're using global time, the interval is not fixed as it jumps
+ // one hour at the DST crossover
+ } else if (!useUTC && (interval === timeUnits.day || interval === timeUnits.week)) {
+ time = makeTime(minYear, minMonth, minDateDate +
+ i * count * (interval === timeUnits.day ? 1 : 7));
+
+ // else, the interval is fixed and we use simple addition
+ } else {
+ time += interval * count;
+ }
+
+ i++;
+ }
+
+ // push the last time
+ tickPositions.push(time);
+
+
+ // mark new days if the time is dividible by day (#1649, #1760)
+ each(grep(tickPositions, function (time) {
+ return interval <= timeUnits.hour && time % timeUnits.day === localTimezoneOffset;
+ }), function (time) {
+ higherRanks[time] = 'day';
+ });
+ }
+
+
+ // record information on the chosen unit - for dynamic label formatter
+ tickPositions.info = extend(normalizedInterval, {
+ higherRanks: higherRanks,
+ totalRange: interval * count
+ });
+
+ return tickPositions;
+ };
+
+ /**
+ * Get a normalized tick interval for dates. Returns a configuration object with
+ * unit range (interval), count and name. Used to prepare data for getTimeTicks.
+ * Previously this logic was part of getTimeTicks, but as getTimeTicks now runs
+ * of segments in stock charts, the normalizing logic was extracted in order to
+ * prevent it for running over again for each segment having the same interval.
+ * #662, #697.
+ */
+ Axis.prototype.normalizeTimeTickInterval = function (tickInterval, unitsOption) {
+ var units = unitsOption || [[
+ 'millisecond', // unit name
+ [1, 2, 5, 10, 20, 25, 50, 100, 200, 500] // allowed multiples
+ ], [
+ 'second',
+ [1, 2, 5, 10, 15, 30]
+ ], [
+ 'minute',
+ [1, 2, 5, 10, 15, 30]
+ ], [
+ 'hour',
+ [1, 2, 3, 4, 6, 8, 12]
+ ], [
+ 'day',
+ [1, 2]
+ ], [
+ 'week',
+ [1, 2]
+ ], [
+ 'month',
+ [1, 2, 3, 4, 6]
+ ], [
+ 'year',
+ null
+ ]],
+ unit = units[units.length - 1], // default unit is years
+ interval = timeUnits[unit[0]],
+ multiples = unit[1],
+ count,
+ i;
+
+ // loop through the units to find the one that best fits the tickInterval
+ for (i = 0; i < units.length; i++) {
+ unit = units[i];
+ interval = timeUnits[unit[0]];
+ multiples = unit[1];
+
+
+ if (units[i + 1]) {
+ // lessThan is in the middle between the highest multiple and the next unit.
+ var lessThan = (interval * multiples[multiples.length - 1] +
+ timeUnits[units[i + 1][0]]) / 2;
+
+ // break and keep the current unit
+ if (tickInterval <= lessThan) {
+ break;
+ }
+ }
+ }
+
+ // prevent 2.5 years intervals, though 25, 250 etc. are allowed
+ if (interval === timeUnits.year && tickInterval < 5 * interval) {
+ multiples = [1, 2, 5];
+ }
+
+ // get the count
+ count = normalizeTickInterval(
+ tickInterval / interval,
+ multiples,
+ unit[0] === 'year' ? mathMax(getMagnitude(tickInterval / interval), 1) : 1 // #1913, #2360
+ );
+
+ return {
+ unitRange: interval,
+ count: count,
+ unitName: unit[0]
+ };
+ };
+
+ /**
+ * The tooltip object
+ * @param {Object} chart The chart instance
+ * @param {Object} options Tooltip options
+ */
+ var Tooltip = Highcharts.Tooltip = function () {
+ this.init.apply(this, arguments);
+ };
+
+ Tooltip.prototype = {
+
+ init: function (chart, options) {
+
+ var borderWidth = options.borderWidth,
+ style = options.style,
+ padding = pInt(style.padding);
+
+ // Save the chart and options
+ this.chart = chart;
+ this.options = options;
+
+ // Keep track of the current series
+ //this.currentSeries = UNDEFINED;
+
+ // List of crosshairs
+ this.crosshairs = [];
+
+ // Current values of x and y when animating
+ this.now = { x: 0, y: 0 };
+
+ // The tooltip is initially hidden
+ this.isHidden = true;
+
+
+ // create the label
+ this.label = chart.renderer.label('', 0, 0, options.shape || 'callout', null, null, options.useHTML, null, 'tooltip')
+ .attr({
+ padding: padding,
+ fill: options.backgroundColor,
+ 'stroke-width': borderWidth,
+ r: options.borderRadius,
+ zIndex: 8
+ })
+ .css(style)
+ .css({ padding: 0 }) // Remove it from VML, the padding is applied as an attribute instead (#1117)
+ .add()
+ .attr({ y: -9999 }); // #2301, #2657
+
+ // When using canVG the shadow shows up as a gray circle
+ // even if the tooltip is hidden.
+ if (!useCanVG) {
+ this.label.shadow(options.shadow);
+ }
+
+ // Public property for getting the shared state.
+ this.shared = options.shared;
+ },
+
+ /**
+ * Destroy the tooltip and its elements.
+ */
+ destroy: function () {
+ // Destroy and clear local variables
+ if (this.label) {
+ this.label = this.label.destroy();
+ }
+ clearTimeout(this.hideTimer);
+ clearTimeout(this.tooltipTimeout);
+ },
+
+ /**
+ * Provide a soft movement for the tooltip
+ *
+ * @param {Number} x
+ * @param {Number} y
+ * @private
+ */
+ move: function (x, y, anchorX, anchorY) {
+ var tooltip = this,
+ now = tooltip.now,
+ animate = tooltip.options.animation !== false && !tooltip.isHidden &&
+ // When we get close to the target position, abort animation and land on the right place (#3056)
+ (mathAbs(x - now.x) > 1 || mathAbs(y - now.y) > 1),
+ skipAnchor = tooltip.followPointer || tooltip.len > 1;
+
+ // Get intermediate values for animation
+ extend(now, {
+ x: animate ? (2 * now.x + x) / 3 : x,
+ y: animate ? (now.y + y) / 2 : y,
+ anchorX: skipAnchor ? UNDEFINED : animate ? (2 * now.anchorX + anchorX) / 3 : anchorX,
+ anchorY: skipAnchor ? UNDEFINED : animate ? (now.anchorY + anchorY) / 2 : anchorY
+ });
+
+ // Move to the intermediate value
+ tooltip.label.attr(now);
+
+
+ // Run on next tick of the mouse tracker
+ if (animate) {
+
+ // Never allow two timeouts
+ clearTimeout(this.tooltipTimeout);
+
+ // Set the fixed interval ticking for the smooth tooltip
+ this.tooltipTimeout = setTimeout(function () {
+ // The interval function may still be running during destroy, so check that the chart is really there before calling.
+ if (tooltip) {
+ tooltip.move(x, y, anchorX, anchorY);
+ }
+ }, 32);
+
+ }
+ },
+
+ /**
+ * Hide the tooltip
+ */
+ hide: function (delay) {
+ var tooltip = this,
+ hoverPoints;
+
+ clearTimeout(this.hideTimer); // disallow duplicate timers (#1728, #1766)
+ if (!this.isHidden) {
+ hoverPoints = this.chart.hoverPoints;
+
+ this.hideTimer = setTimeout(function () {
+ tooltip.label.fadeOut();
+ tooltip.isHidden = true;
+ }, pick(delay, this.options.hideDelay, 500));
+
+ // hide previous hoverPoints and set new
+ if (hoverPoints) {
+ each(hoverPoints, function (point) {
+ point.setState();
+ });
+ }
+
+ this.chart.hoverPoints = null;
+ }
+ },
+
+ /**
+ * Extendable method to get the anchor position of the tooltip
+ * from a point or set of points
+ */
+ getAnchor: function (points, mouseEvent) {
+ var ret,
+ chart = this.chart,
+ inverted = chart.inverted,
+ plotTop = chart.plotTop,
+ plotX = 0,
+ plotY = 0,
+ yAxis;
+
+ points = splat(points);
+
+ // Pie uses a special tooltipPos
+ ret = points[0].tooltipPos;
+
+ // When tooltip follows mouse, relate the position to the mouse
+ if (this.followPointer && mouseEvent) {
+ if (mouseEvent.chartX === UNDEFINED) {
+ mouseEvent = chart.pointer.normalize(mouseEvent);
+ }
+ ret = [
+ mouseEvent.chartX - chart.plotLeft,
+ mouseEvent.chartY - plotTop
+ ];
+ }
+ // When shared, use the average position
+ if (!ret) {
+ each(points, function (point) {
+ yAxis = point.series.yAxis;
+ plotX += point.plotX;
+ plotY += (point.plotLow ? (point.plotLow + point.plotHigh) / 2 : point.plotY) +
+ (!inverted && yAxis ? yAxis.top - plotTop : 0); // #1151
+ });
+
+ plotX /= points.length;
+ plotY /= points.length;
+
+ ret = [
+ inverted ? chart.plotWidth - plotY : plotX,
+ this.shared && !inverted && points.length > 1 && mouseEvent ?
+ mouseEvent.chartY - plotTop : // place shared tooltip next to the mouse (#424)
+ inverted ? chart.plotHeight - plotX : plotY
+ ];
+ }
+
+ return map(ret, mathRound);
+ },
+
+ /**
+ * Place the tooltip in a chart without spilling over
+ * and not covering the point it self.
+ */
+ getPosition: function (boxWidth, boxHeight, point) {
+
+ var chart = this.chart,
+ distance = this.distance,
+ ret = {},
+ swapped,
+ first = ['y', chart.chartHeight, boxHeight, point.plotY + chart.plotTop],
+ second = ['x', chart.chartWidth, boxWidth, point.plotX + chart.plotLeft],
+ // The far side is right or bottom
+ preferFarSide = point.ttBelow || (chart.inverted && !point.negative) || (!chart.inverted && point.negative),
+ /**
+ * Handle the preferred dimension. When the preferred dimension is tooltip
+ * on top or bottom of the point, it will look for space there.
+ */
+ firstDimension = function (dim, outerSize, innerSize, point) {
+ var roomLeft = innerSize < point - distance,
+ roomRight = point + distance + innerSize < outerSize,
+ alignedLeft = point - distance - innerSize,
+ alignedRight = point + distance;
+
+ if (preferFarSide && roomRight) {
+ ret[dim] = alignedRight;
+ } else if (!preferFarSide && roomLeft) {
+ ret[dim] = alignedLeft;
+ } else if (roomLeft) {
+ ret[dim] = alignedLeft;
+ } else if (roomRight) {
+ ret[dim] = alignedRight;
+ } else {
+ return false;
+ }
+ },
+ /**
+ * Handle the secondary dimension. If the preferred dimension is tooltip
+ * on top or bottom of the point, the second dimension is to align the tooltip
+ * above the point, trying to align center but allowing left or right
+ * align within the chart box.
+ */
+ secondDimension = function (dim, outerSize, innerSize, point) {
+ // Too close to the edge, return false and swap dimensions
+ if (point < distance || point > outerSize - distance) {
+ return false;
+
+ // Align left/top
+ } else if (point < innerSize / 2) {
+ ret[dim] = 1;
+ // Align right/bottom
+ } else if (point > outerSize - innerSize / 2) {
+ ret[dim] = outerSize - innerSize - 2;
+ // Align center
+ } else {
+ ret[dim] = point - innerSize / 2;
+ }
+ },
+ /**
+ * Swap the dimensions
+ */
+ swap = function (count) {
+ var temp = first;
+ first = second;
+ second = temp;
+ swapped = count;
+ },
+ run = function () {
+ if (firstDimension.apply(0, first) !== false) {
+ if (secondDimension.apply(0, second) === false && !swapped) {
+ swap(true);
+ run();
+ }
+ } else if (!swapped) {
+ swap(true);
+ run();
+ } else {
+ ret.x = ret.y = 0;
+ }
+ };
+
+ // Under these conditions, prefer the tooltip on the side of the point
+ if (chart.inverted || this.len > 1) {
+ swap();
+ }
+ run();
+
+ return ret;
+
+ },
+
+ /**
+ * In case no user defined formatter is given, this will be used. Note that the context
+ * here is an object holding point, series, x, y etc.
+ */
+ defaultFormatter: function (tooltip) {
+ var items = this.points || splat(this),
+ series = items[0].series,
+ s;
+
+ // build the header
+ s = [tooltip.tooltipHeaderFormatter(items[0])];
+
+ // build the values
+ each(items, function (item) {
+ series = item.series;
+ s.push((series.tooltipFormatter && series.tooltipFormatter(item)) ||
+ item.point.tooltipFormatter(series.tooltipOptions.pointFormat));
+ });
+
+ // footer
+ s.push(tooltip.options.footerFormat || '');
+
+ return s.join('');
+ },
+
+ /**
+ * Refresh the tooltip's text and position.
+ * @param {Object} point
+ */
+ refresh: function (point, mouseEvent) {
+ var tooltip = this,
+ chart = tooltip.chart,
+ label = tooltip.label,
+ options = tooltip.options,
+ x,
+ y,
+ anchor,
+ textConfig = {},
+ text,
+ pointConfig = [],
+ formatter = options.formatter || tooltip.defaultFormatter,
+ hoverPoints = chart.hoverPoints,
+ borderColor,
+ shared = tooltip.shared,
+ currentSeries;
+
+ clearTimeout(this.hideTimer);
+
+ // get the reference point coordinates (pie charts use tooltipPos)
+ tooltip.followPointer = splat(point)[0].series.tooltipOptions.followPointer;
+ anchor = tooltip.getAnchor(point, mouseEvent);
+ x = anchor[0];
+ y = anchor[1];
+
+ // shared tooltip, array is sent over
+ if (shared && !(point.series && point.series.noSharedTooltip)) {
+
+ // hide previous hoverPoints and set new
+
+ chart.hoverPoints = point;
+ if (hoverPoints) {
+ each(hoverPoints, function (point) {
+ point.setState();
+ });
+ }
+
+ each(point, function (item) {
+ item.setState(HOVER_STATE);
+
+ pointConfig.push(item.getLabelConfig());
+ });
+
+ textConfig = {
+ x: point[0].category,
+ y: point[0].y
+ };
+ textConfig.points = pointConfig;
+ this.len = pointConfig.length;
+ point = point[0];
+
+ // single point tooltip
+ } else {
+ textConfig = point.getLabelConfig();
+ }
+ text = formatter.call(textConfig, tooltip);
+
+ // register the current series
+ currentSeries = point.series;
+ this.distance = pick(currentSeries.tooltipOptions.distance, 16);
+
+ // update the inner HTML
+ if (text === false) {
+ this.hide();
+ } else {
+
+ // show it
+ if (tooltip.isHidden) {
+ stop(label);
+ label.attr('opacity', 1).show();
+ }
+
+ // update text
+ label.attr({
+ text: text
+ });
+
+ // set the stroke color of the box
+ borderColor = options.borderColor || point.color || currentSeries.color || '#606060';
+ label.attr({
+ stroke: borderColor
+ });
+
+ tooltip.updatePosition({ plotX: x, plotY: y, negative: point.negative, ttBelow: point.ttBelow });
+
+ this.isHidden = false;
+ }
+ fireEvent(chart, 'tooltipRefresh', {
+ text: text,
+ x: x + chart.plotLeft,
+ y: y + chart.plotTop,
+ borderColor: borderColor
+ });
+ },
+
+ /**
+ * Find the new position and perform the move
+ */
+ updatePosition: function (point) {
+ var chart = this.chart,
+ label = this.label,
+ pos = (this.options.positioner || this.getPosition).call(
+ this,
+ label.width,
+ label.height,
+ point
+ );
+
+ // do the move
+ this.move(
+ mathRound(pos.x),
+ mathRound(pos.y),
+ point.plotX + chart.plotLeft,
+ point.plotY + chart.plotTop
+ );
+ },
+
+
+ /**
+ * Format the header of the tooltip
+ */
+ tooltipHeaderFormatter: function (point) {
+ var series = point.series,
+ tooltipOptions = series.tooltipOptions,
+ dateTimeLabelFormats = tooltipOptions.dateTimeLabelFormats,
+ xDateFormat = tooltipOptions.xDateFormat,
+ xAxis = series.xAxis,
+ isDateTime = xAxis && xAxis.options.type === 'datetime' && isNumber(point.key),
+ headerFormat = tooltipOptions.headerFormat,
+ closestPointRange = xAxis && xAxis.closestPointRange,
+ n;
+
+ // Guess the best date format based on the closest point distance (#568)
+ if (isDateTime && !xDateFormat) {
+ if (closestPointRange) {
+ for (n in timeUnits) {
+ if (timeUnits[n] >= closestPointRange ||
+ // If the point is placed every day at 23:59, we need to show
+ // the minutes as well. This logic only works for time units less than
+ // a day, since all higher time units are dividable by those. #2637.
+ (timeUnits[n] <= timeUnits.day && point.key % timeUnits[n] > 0)) {
+ xDateFormat = dateTimeLabelFormats[n];
+ break;
+ }
+ }
+ } else {
+ xDateFormat = dateTimeLabelFormats.day;
+ }
+
+ xDateFormat = xDateFormat || dateTimeLabelFormats.year; // #2546, 2581
+
+ }
+
+ // Insert the header date format if any
+ if (isDateTime && xDateFormat) {
+ headerFormat = headerFormat.replace('{point.key}', '{point.key:' + xDateFormat + '}');
+ }
+
+ return format(headerFormat, {
+ point: point,
+ series: series
+ });
+ }
+ };
+
+
+
+ var hoverChartIndex;
+
+ // Global flag for touch support
+ hasTouch = doc.documentElement.ontouchstart !== UNDEFINED;
+
+ /**
+ * The mouse tracker object. All methods starting with "on" are primary DOM event handlers.
+ * Subsequent methods should be named differently from what they are doing.
+ * @param {Object} chart The Chart instance
+ * @param {Object} options The root options object
+ */
+ var Pointer = Highcharts.Pointer = function (chart, options) {
+ this.init(chart, options);
+ };
+
+ Pointer.prototype = {
+ /**
+ * Initialize Pointer
+ */
+ init: function (chart, options) {
+
+ var chartOptions = options.chart,
+ chartEvents = chartOptions.events,
+ zoomType = useCanVG ? '' : chartOptions.zoomType,
+ inverted = chart.inverted,
+ zoomX,
+ zoomY;
+
+ // Store references
+ this.options = options;
+ this.chart = chart;
+
+ // Zoom status
+ this.zoomX = zoomX = /x/.test(zoomType);
+ this.zoomY = zoomY = /y/.test(zoomType);
+ this.zoomHor = (zoomX && !inverted) || (zoomY && inverted);
+ this.zoomVert = (zoomY && !inverted) || (zoomX && inverted);
+ this.hasZoom = zoomX || zoomY;
+
+ // Do we need to handle click on a touch device?
+ this.runChartClick = chartEvents && !!chartEvents.click;
+
+ this.pinchDown = [];
+ this.lastValidTouch = {};
+
+ if (Highcharts.Tooltip && options.tooltip.enabled) {
+ chart.tooltip = new Tooltip(chart, options.tooltip);
+ this.followTouchMove = options.tooltip.followTouchMove;
+ }
+
+ this.setDOMEvents();
+ },
+
+ /**
+ * Add crossbrowser support for chartX and chartY
+ * @param {Object} e The event object in standard browsers
+ */
+ normalize: function (e, chartPosition) {
+ var chartX,
+ chartY,
+ ePos;
+
+ // common IE normalizing
+ e = e || window.event;
+
+ // Framework specific normalizing (#1165)
+ e = washMouseEvent(e);
+
+ // More IE normalizing, needs to go after washMouseEvent
+ if (!e.target) {
+ e.target = e.srcElement;
+ }
+
+ // iOS (#2757)
+ ePos = e.touches ? (e.touches.length ? e.touches.item(0) : e.changedTouches[0]) : e;
+
+ // Get mouse position
+ if (!chartPosition) {
+ this.chartPosition = chartPosition = offset(this.chart.container);
+ }
+
+ // chartX and chartY
+ if (ePos.pageX === UNDEFINED) { // IE < 9. #886.
+ chartX = mathMax(e.x, e.clientX - chartPosition.left); // #2005, #2129: the second case is
+ // for IE10 quirks mode within framesets
+ chartY = e.y;
+ } else {
+ chartX = ePos.pageX - chartPosition.left;
+ chartY = ePos.pageY - chartPosition.top;
+ }
+
+ return extend(e, {
+ chartX: mathRound(chartX),
+ chartY: mathRound(chartY)
+ });
+ },
+
+ /**
+ * Get the click position in terms of axis values.
+ *
+ * @param {Object} e A pointer event
+ */
+ getCoordinates: function (e) {
+ var coordinates = {
+ xAxis: [],
+ yAxis: []
+ };
+
+ each(this.chart.axes, function (axis) {
+ coordinates[axis.isXAxis ? 'xAxis' : 'yAxis'].push({
+ axis: axis,
+ value: axis.toValue(e[axis.horiz ? 'chartX' : 'chartY'])
+ });
+ });
+ return coordinates;
+ },
+
+ /**
+ * Return the index in the tooltipPoints array, corresponding to pixel position in
+ * the plot area.
+ */
+ getIndex: function (e) {
+ var chart = this.chart;
+ return chart.inverted ?
+ chart.plotHeight + chart.plotTop - e.chartY :
+ e.chartX - chart.plotLeft;
+ },
+
+ /**
+ * With line type charts with a single tracker, get the point closest to the mouse.
+ * Run Point.onMouseOver and display tooltip for the point or points.
+ */
+ runPointActions: function (e) {
+ var pointer = this,
+ chart = pointer.chart,
+ series = chart.series,
+ tooltip = chart.tooltip,
+ followPointer,
+ point,
+ points,
+ hoverPoint = chart.hoverPoint,
+ hoverSeries = chart.hoverSeries,
+ i,
+ j,
+ distance = chart.chartWidth,
+ index = pointer.getIndex(e),
+ anchor;
+
+ // shared tooltip
+ if (tooltip && pointer.options.tooltip.shared && !(hoverSeries && hoverSeries.noSharedTooltip)) {
+ points = [];
+
+ // loop over all series and find the ones with points closest to the mouse
+ i = series.length;
+ for (j = 0; j < i; j++) {
+ if (series[j].visible &&
+ series[j].options.enableMouseTracking !== false &&
+ !series[j].noSharedTooltip && series[j].singularTooltips !== true && series[j].tooltipPoints.length) {
+ point = series[j].tooltipPoints[index];
+ if (point && point.series) { // not a dummy point, #1544
+ point._dist = mathAbs(index - point.clientX);
+ distance = mathMin(distance, point._dist);
+ points.push(point);
+ }
+ }
+ }
+ // remove furthest points
+ i = points.length;
+ while (i--) {
+ if (points[i]._dist > distance) {
+ points.splice(i, 1);
+ }
+ }
+ // refresh the tooltip if necessary
+ if (points.length && (points[0].clientX !== pointer.hoverX)) {
+ tooltip.refresh(points, e);
+ pointer.hoverX = points[0].clientX;
+ }
+ }
+
+ // Separate tooltip and general mouse events
+ followPointer = hoverSeries && hoverSeries.tooltipOptions.followPointer;
+ if (hoverSeries && hoverSeries.tracker && !followPointer) { // #2584, #2830
+
+ // get the point
+ point = hoverSeries.tooltipPoints[index];
+
+ // a new point is hovered, refresh the tooltip
+ if (point && point !== hoverPoint) {
+
+ // trigger the events
+ point.onMouseOver(e);
+
+ }
+
+ } else if (tooltip && followPointer && !tooltip.isHidden) {
+ anchor = tooltip.getAnchor([{}], e);
+ tooltip.updatePosition({ plotX: anchor[0], plotY: anchor[1] });
+ }
+
+ // Start the event listener to pick up the tooltip
+ if (tooltip && !pointer._onDocumentMouseMove) {
+ pointer._onDocumentMouseMove = function (e) {
+ if (charts[hoverChartIndex]) {
+ charts[hoverChartIndex].pointer.onDocumentMouseMove(e);
+ }
+ };
+ addEvent(doc, 'mousemove', pointer._onDocumentMouseMove);
+ }
+
+ // Draw independent crosshairs
+ each(chart.axes, function (axis) {
+ axis.drawCrosshair(e, pick(point, hoverPoint));
+ });
+ },
+
+
+
+ /**
+ * Reset the tracking by hiding the tooltip, the hover series state and the hover point
+ *
+ * @param allowMove {Boolean} Instead of destroying the tooltip altogether, allow moving it if possible
+ */
+ reset: function (allowMove, delay) {
+ var pointer = this,
+ chart = pointer.chart,
+ hoverSeries = chart.hoverSeries,
+ hoverPoint = chart.hoverPoint,
+ tooltip = chart.tooltip,
+ tooltipPoints = tooltip && tooltip.shared ? chart.hoverPoints : hoverPoint;
+
+ // Narrow in allowMove
+ allowMove = allowMove && tooltip && tooltipPoints;
+
+ // Check if the points have moved outside the plot area, #1003
+ if (allowMove && splat(tooltipPoints)[0].plotX === UNDEFINED) {
+ allowMove = false;
+ }
+
+ // Just move the tooltip, #349
+ if (allowMove) {
+ tooltip.refresh(tooltipPoints);
+ if (hoverPoint) { // #2500
+ hoverPoint.setState(hoverPoint.state, true);
+ }
+
+ // Full reset
+ } else {
+
+ if (hoverPoint) {
+ hoverPoint.onMouseOut();
+ }
+
+ if (hoverSeries) {
+ hoverSeries.onMouseOut();
+ }
+
+ if (tooltip) {
+ tooltip.hide(delay);
+ }
+
+ if (pointer._onDocumentMouseMove) {
+ removeEvent(doc, 'mousemove', pointer._onDocumentMouseMove);
+ pointer._onDocumentMouseMove = null;
+ }
+
+ // Remove crosshairs
+ each(chart.axes, function (axis) {
+ axis.hideCrosshair();
+ });
+
+ pointer.hoverX = null;
+
+ }
+ },
+
+ /**
+ * Scale series groups to a certain scale and translation
+ */
+ scaleGroups: function (attribs, clip) {
+
+ var chart = this.chart,
+ seriesAttribs;
+
+ // Scale each series
+ each(chart.series, function (series) {
+ seriesAttribs = attribs || series.getPlotBox(); // #1701
+ if (series.xAxis && series.xAxis.zoomEnabled) {
+ series.group.attr(seriesAttribs);
+ if (series.markerGroup) {
+ series.markerGroup.attr(seriesAttribs);
+ series.markerGroup.clip(clip ? chart.clipRect : null);
+ }
+ if (series.dataLabelsGroup) {
+ series.dataLabelsGroup.attr(seriesAttribs);
+ }
+ }
+ });
+
+ // Clip
+ chart.clipRect.attr(clip || chart.clipBox);
+ },
+
+ /**
+ * Start a drag operation
+ */
+ dragStart: function (e) {
+ var chart = this.chart;
+
+ // Record the start position
+ chart.mouseIsDown = e.type;
+ chart.cancelClick = false;
+ chart.mouseDownX = this.mouseDownX = e.chartX;
+ chart.mouseDownY = this.mouseDownY = e.chartY;
+ },
+
+ /**
+ * Perform a drag operation in response to a mousemove event while the mouse is down
+ */
+ drag: function (e) {
+
+ var chart = this.chart,
+ chartOptions = chart.options.chart,
+ chartX = e.chartX,
+ chartY = e.chartY,
+ zoomHor = this.zoomHor,
+ zoomVert = this.zoomVert,
+ plotLeft = chart.plotLeft,
+ plotTop = chart.plotTop,
+ plotWidth = chart.plotWidth,
+ plotHeight = chart.plotHeight,
+ clickedInside,
+ size,
+ mouseDownX = this.mouseDownX,
+ mouseDownY = this.mouseDownY,
+ panKey = chartOptions.panKey && e[chartOptions.panKey + 'Key'];
+
+ // If the mouse is outside the plot area, adjust to cooordinates
+ // inside to prevent the selection marker from going outside
+ if (chartX < plotLeft) {
+ chartX = plotLeft;
+ } else if (chartX > plotLeft + plotWidth) {
+ chartX = plotLeft + plotWidth;
+ }
+
+ if (chartY < plotTop) {
+ chartY = plotTop;
+ } else if (chartY > plotTop + plotHeight) {
+ chartY = plotTop + plotHeight;
+ }
+
+ // determine if the mouse has moved more than 10px
+ this.hasDragged = Math.sqrt(
+ Math.pow(mouseDownX - chartX, 2) +
+ Math.pow(mouseDownY - chartY, 2)
+ );
+
+ if (this.hasDragged > 10) {
+ clickedInside = chart.isInsidePlot(mouseDownX - plotLeft, mouseDownY - plotTop);
+
+ // make a selection
+ if (chart.hasCartesianSeries && (this.zoomX || this.zoomY) && clickedInside && !panKey) {
+ if (!this.selectionMarker) {
+ this.selectionMarker = chart.renderer.rect(
+ plotLeft,
+ plotTop,
+ zoomHor ? 1 : plotWidth,
+ zoomVert ? 1 : plotHeight,
+ 0
+ )
+ .attr({
+ fill: chartOptions.selectionMarkerFill || 'rgba(69,114,167,0.25)',
+ zIndex: 7
+ })
+ .add();
+ }
+ }
+
+ // adjust the width of the selection marker
+ if (this.selectionMarker && zoomHor) {
+ size = chartX - mouseDownX;
+ this.selectionMarker.attr({
+ width: mathAbs(size),
+ x: (size > 0 ? 0 : size) + mouseDownX
+ });
+ }
+ // adjust the height of the selection marker
+ if (this.selectionMarker && zoomVert) {
+ size = chartY - mouseDownY;
+ this.selectionMarker.attr({
+ height: mathAbs(size),
+ y: (size > 0 ? 0 : size) + mouseDownY
+ });
+ }
+
+ // panning
+ if (clickedInside && !this.selectionMarker && chartOptions.panning) {
+ chart.pan(e, chartOptions.panning);
+ }
+ }
+ },
+
+ /**
+ * On mouse up or touch end across the entire document, drop the selection.
+ */
+ drop: function (e) {
+ var chart = this.chart,
+ hasPinched = this.hasPinched;
+
+ if (this.selectionMarker) {
+ var selectionData = {
+ xAxis: [],
+ yAxis: [],
+ originalEvent: e.originalEvent || e
+ },
+ selectionBox = this.selectionMarker,
+ selectionLeft = selectionBox.attr ? selectionBox.attr('x') : selectionBox.x,
+ selectionTop = selectionBox.attr ? selectionBox.attr('y') : selectionBox.y,
+ selectionWidth = selectionBox.attr ? selectionBox.attr('width') : selectionBox.width,
+ selectionHeight = selectionBox.attr ? selectionBox.attr('height') : selectionBox.height,
+ runZoom;
+
+ // a selection has been made
+ if (this.hasDragged || hasPinched) {
+
+ // record each axis' min and max
+ each(chart.axes, function (axis) {
+ if (axis.zoomEnabled) {
+ var horiz = axis.horiz,
+ minPixelPadding = e.type === 'touchend' ? axis.minPixelPadding: 0, // #1207, #3075
+ selectionMin = axis.toValue((horiz ? selectionLeft : selectionTop) + minPixelPadding),
+ selectionMax = axis.toValue((horiz ? selectionLeft + selectionWidth : selectionTop + selectionHeight) - minPixelPadding);
+
+ if (!isNaN(selectionMin) && !isNaN(selectionMax)) { // #859
+ selectionData[axis.coll].push({
+ axis: axis,
+ min: mathMin(selectionMin, selectionMax), // for reversed axes,
+ max: mathMax(selectionMin, selectionMax)
+ });
+ runZoom = true;
+ }
+ }
+ });
+ if (runZoom) {
+ fireEvent(chart, 'selection', selectionData, function (args) {
+ chart.zoom(extend(args, hasPinched ? { animation: false } : null));
+ });
+ }
+
+ }
+ this.selectionMarker = this.selectionMarker.destroy();
+
+ // Reset scaling preview
+ if (hasPinched) {
+ this.scaleGroups();
+ }
+ }
+
+ // Reset all
+ if (chart) { // it may be destroyed on mouse up - #877
+ css(chart.container, { cursor: chart._cursor });
+ chart.cancelClick = this.hasDragged > 10; // #370
+ chart.mouseIsDown = this.hasDragged = this.hasPinched = false;
+ this.pinchDown = [];
+ }
+ },
+
+ onContainerMouseDown: function (e) {
+
+ e = this.normalize(e);
+
+ // issue #295, dragging not always working in Firefox
+ if (e.preventDefault) {
+ e.preventDefault();
+ }
+
+ this.dragStart(e);
+ },
+
+
+
+ onDocumentMouseUp: function (e) {
+ if (charts[hoverChartIndex]) {
+ charts[hoverChartIndex].pointer.drop(e);
+ }
+ },
+
+ /**
+ * Special handler for mouse move that will hide the tooltip when the mouse leaves the plotarea.
+ * Issue #149 workaround. The mouseleave event does not always fire.
+ */
+ onDocumentMouseMove: function (e) {
+ var chart = this.chart,
+ chartPosition = this.chartPosition,
+ hoverSeries = chart.hoverSeries;
+
+ e = this.normalize(e, chartPosition);
+
+ // If we're outside, hide the tooltip
+ if (chartPosition && hoverSeries && !this.inClass(e.target, 'highcharts-tracker') &&
+ !chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop)) {
+ this.reset();
+ }
+ },
+
+ /**
+ * When mouse leaves the container, hide the tooltip.
+ */
+ onContainerMouseLeave: function () {
+ var chart = charts[hoverChartIndex];
+ if (chart) {
+ chart.pointer.reset();
+ chart.pointer.chartPosition = null; // also reset the chart position, used in #149 fix
+ }
+ },
+
+ // The mousemove, touchmove and touchstart event handler
+ onContainerMouseMove: function (e) {
+
+ var chart = this.chart;
+
+ hoverChartIndex = chart.index;
+
+ e = this.normalize(e);
+ e.returnValue = false; // #2251, #3224
+
+ if (chart.mouseIsDown === 'mousedown') {
+ this.drag(e);
+ }
+
+ // Show the tooltip and run mouse over events (#977)
+ if ((this.inClass(e.target, 'highcharts-tracker') ||
+ chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop)) && !chart.openMenu) {
+ this.runPointActions(e);
+ }
+ },
+
+ /**
+ * Utility to detect whether an element has, or has a parent with, a specific
+ * class name. Used on detection of tracker objects and on deciding whether
+ * hovering the tooltip should cause the active series to mouse out.
+ */
+ inClass: function (element, className) {
+ var elemClassName;
+ while (element) {
+ elemClassName = attr(element, 'class');
+ if (elemClassName) {
+ if (elemClassName.indexOf(className) !== -1) {
+ return true;
+ } else if (elemClassName.indexOf(PREFIX + 'container') !== -1) {
+ return false;
+ }
+ }
+ element = element.parentNode;
+ }
+ },
+
+ onTrackerMouseOut: function (e) {
+ var series = this.chart.hoverSeries,
+ relatedTarget = e.relatedTarget || e.toElement,
+ relatedSeries = relatedTarget && relatedTarget.point && relatedTarget.point.series; // #2499
+
+ if (series && !series.options.stickyTracking && !this.inClass(relatedTarget, PREFIX + 'tooltip') &&
+ relatedSeries !== series) {
+ series.onMouseOut();
+ }
+ },
+
+ onContainerClick: function (e) {
+ var chart = this.chart,
+ hoverPoint = chart.hoverPoint,
+ plotLeft = chart.plotLeft,
+ plotTop = chart.plotTop;
+
+ e = this.normalize(e);
+ e.cancelBubble = true; // IE specific
+
+ if (!chart.cancelClick) {
+
+ // On tracker click, fire the series and point events. #783, #1583
+ if (hoverPoint && this.inClass(e.target, PREFIX + 'tracker')) {
+
+ // the series click event
+ fireEvent(hoverPoint.series, 'click', extend(e, {
+ point: hoverPoint
+ }));
+
+ // the point click event
+ if (chart.hoverPoint) { // it may be destroyed (#1844)
+ hoverPoint.firePointEvent('click', e);
+ }
+
+ // When clicking outside a tracker, fire a chart event
+ } else {
+ extend(e, this.getCoordinates(e));
+
+ // fire a click event in the chart
+ if (chart.isInsidePlot(e.chartX - plotLeft, e.chartY - plotTop)) {
+ fireEvent(chart, 'click', e);
+ }
+ }
+
+
+ }
+ },
+
+ /**
+ * Set the JS DOM events on the container and document. This method should contain
+ * a one-to-one assignment between methods and their handlers. Any advanced logic should
+ * be moved to the handler reflecting the event's name.
+ */
+ setDOMEvents: function () {
+
+ var pointer = this,
+ container = pointer.chart.container;
+
+ container.onmousedown = function (e) {
+ pointer.onContainerMouseDown(e);
+ };
+ container.onmousemove = function (e) {
+ pointer.onContainerMouseMove(e);
+ };
+ container.onclick = function (e) {
+ pointer.onContainerClick(e);
+ };
+ addEvent(container, 'mouseleave', pointer.onContainerMouseLeave);
+ if (chartCount === 1) {
+ addEvent(doc, 'mouseup', pointer.onDocumentMouseUp);
+ }
+ if (hasTouch) {
+ container.ontouchstart = function (e) {
+ pointer.onContainerTouchStart(e);
+ };
+ container.ontouchmove = function (e) {
+ pointer.onContainerTouchMove(e);
+ };
+ if (chartCount === 1) {
+ addEvent(doc, 'touchend', pointer.onDocumentTouchEnd);
+ }
+ }
+
+ },
+
+ /**
+ * Destroys the Pointer object and disconnects DOM events.
+ */
+ destroy: function () {
+ var prop;
+
+ removeEvent(this.chart.container, 'mouseleave', this.onContainerMouseLeave);
+ if (!chartCount) {
+ removeEvent(doc, 'mouseup', this.onDocumentMouseUp);
+ removeEvent(doc, 'touchend', this.onDocumentTouchEnd);
+ }
+
+ // memory and CPU leak
+ clearInterval(this.tooltipTimeout);
+
+ for (prop in this) {
+ this[prop] = null;
+ }
+ }
+ };
+
+
+
+
+ /* Support for touch devices */
+ extend(Highcharts.Pointer.prototype, {
+
+ /**
+ * Run translation operations
+ */
+ pinchTranslate: function (pinchDown, touches, transform, selectionMarker, clip, lastValidTouch) {
+ if (this.zoomHor || this.pinchHor) {
+ this.pinchTranslateDirection(true, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch);
+ }
+ if (this.zoomVert || this.pinchVert) {
+ this.pinchTranslateDirection(false, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch);
+ }
+ },
+
+ /**
+ * Run translation operations for each direction (horizontal and vertical) independently
+ */
+ pinchTranslateDirection: function (horiz, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch, forcedScale) {
+ var chart = this.chart,
+ xy = horiz ? 'x' : 'y',
+ XY = horiz ? 'X' : 'Y',
+ sChartXY = 'chart' + XY,
+ wh = horiz ? 'width' : 'height',
+ plotLeftTop = chart['plot' + (horiz ? 'Left' : 'Top')],
+ selectionWH,
+ selectionXY,
+ clipXY,
+ scale = forcedScale || 1,
+ inverted = chart.inverted,
+ bounds = chart.bounds[horiz ? 'h' : 'v'],
+ singleTouch = pinchDown.length === 1,
+ touch0Start = pinchDown[0][sChartXY],
+ touch0Now = touches[0][sChartXY],
+ touch1Start = !singleTouch && pinchDown[1][sChartXY],
+ touch1Now = !singleTouch && touches[1][sChartXY],
+ outOfBounds,
+ transformScale,
+ scaleKey,
+ setScale = function () {
+ if (!singleTouch && mathAbs(touch0Start - touch1Start) > 20) { // Don't zoom if fingers are too close on this axis
+ scale = forcedScale || mathAbs(touch0Now - touch1Now) / mathAbs(touch0Start - touch1Start);
+ }
+
+ clipXY = ((plotLeftTop - touch0Now) / scale) + touch0Start;
+ selectionWH = chart['plot' + (horiz ? 'Width' : 'Height')] / scale;
+ };
+
+ // Set the scale, first pass
+ setScale();
+
+ selectionXY = clipXY; // the clip position (x or y) is altered if out of bounds, the selection position is not
+
+ // Out of bounds
+ if (selectionXY < bounds.min) {
+ selectionXY = bounds.min;
+ outOfBounds = true;
+ } else if (selectionXY + selectionWH > bounds.max) {
+ selectionXY = bounds.max - selectionWH;
+ outOfBounds = true;
+ }
+
+ // Is the chart dragged off its bounds, determined by dataMin and dataMax?
+ if (outOfBounds) {
+
+ // Modify the touchNow position in order to create an elastic drag movement. This indicates
+ // to the user that the chart is responsive but can't be dragged further.
+ touch0Now -= 0.8 * (touch0Now - lastValidTouch[xy][0]);
+ if (!singleTouch) {
+ touch1Now -= 0.8 * (touch1Now - lastValidTouch[xy][1]);
+ }
+
+ // Set the scale, second pass to adapt to the modified touchNow positions
+ setScale();
+
+ } else {
+ lastValidTouch[xy] = [touch0Now, touch1Now];
+ }
+
+ // Set geometry for clipping, selection and transformation
+ if (!inverted) { // TODO: implement clipping for inverted charts
+ clip[xy] = clipXY - plotLeftTop;
+ clip[wh] = selectionWH;
+ }
+ scaleKey = inverted ? (horiz ? 'scaleY' : 'scaleX') : 'scale' + XY;
+ transformScale = inverted ? 1 / scale : scale;
+
+ selectionMarker[wh] = selectionWH;
+ selectionMarker[xy] = selectionXY;
+ transform[scaleKey] = scale;
+ transform['translate' + XY] = (transformScale * plotLeftTop) + (touch0Now - (transformScale * touch0Start));
+ },
+
+ /**
+ * Handle touch events with two touches
+ */
+ pinch: function (e) {
+
+ var self = this,
+ chart = self.chart,
+ pinchDown = self.pinchDown,
+ followTouchMove = self.followTouchMove,
+ touches = e.touches,
+ touchesLength = touches.length,
+ lastValidTouch = self.lastValidTouch,
+ hasZoom = self.hasZoom,
+ selectionMarker = self.selectionMarker,
+ transform = {},
+ fireClickEvent = touchesLength === 1 && ((self.inClass(e.target, PREFIX + 'tracker') &&
+ chart.runTrackerClick) || self.runChartClick),
+ clip = {};
+
+ // On touch devices, only proceed to trigger click if a handler is defined
+ if ((hasZoom || followTouchMove) && !fireClickEvent) {
+ e.preventDefault();
+ }
+
+ // Normalize each touch
+ map(touches, function (e) {
+ return self.normalize(e);
+ });
+
+ // Register the touch start position
+ if (e.type === 'touchstart') {
+ each(touches, function (e, i) {
+ pinchDown[i] = { chartX: e.chartX, chartY: e.chartY };
+ });
+ lastValidTouch.x = [pinchDown[0].chartX, pinchDown[1] && pinchDown[1].chartX];
+ lastValidTouch.y = [pinchDown[0].chartY, pinchDown[1] && pinchDown[1].chartY];
+
+ // Identify the data bounds in pixels
+ each(chart.axes, function (axis) {
+ if (axis.zoomEnabled) {
+ var bounds = chart.bounds[axis.horiz ? 'h' : 'v'],
+ minPixelPadding = axis.minPixelPadding,
+ min = axis.toPixels(pick(axis.options.min, axis.dataMin)),
+ max = axis.toPixels(pick(axis.options.max, axis.dataMax)),
+ absMin = mathMin(min, max),
+ absMax = mathMax(min, max);
+
+ // Store the bounds for use in the touchmove handler
+ bounds.min = mathMin(axis.pos, absMin - minPixelPadding);
+ bounds.max = mathMax(axis.pos + axis.len, absMax + minPixelPadding);
+ }
+ });
+ self.res = true; // reset on next move
+
+ // Event type is touchmove, handle panning and pinching
+ } else if (pinchDown.length) { // can be 0 when releasing, if touchend fires first
+
+
+ // Set the marker
+ if (!selectionMarker) {
+ self.selectionMarker = selectionMarker = extend({
+ destroy: noop
+ }, chart.plotBox);
+ }
+
+ self.pinchTranslate(pinchDown, touches, transform, selectionMarker, clip, lastValidTouch);
+
+ self.hasPinched = hasZoom;
+
+ // Scale and translate the groups to provide visual feedback during pinching
+ self.scaleGroups(transform, clip);
+
+ // Optionally move the tooltip on touchmove
+ if (!hasZoom && followTouchMove && touchesLength === 1) {
+ this.runPointActions(self.normalize(e));
+ } else if (self.res) {
+ self.res = false;
+ this.reset(false, 0);
+ }
+ }
+ },
+
+ onContainerTouchStart: function (e) {
+ var chart = this.chart;
+
+ hoverChartIndex = chart.index;
+
+ if (e.touches.length === 1) {
+
+ e = this.normalize(e);
+
+ if (chart.isInsidePlot(e.chartX - chart.plotLeft, e.chartY - chart.plotTop)) {
+
+ // Run mouse events and display tooltip etc
+ this.runPointActions(e);
+
+ this.pinch(e);
+
+ } else {
+ // Hide the tooltip on touching outside the plot area (#1203)
+ this.reset();
+ }
+
+ } else if (e.touches.length === 2) {
+ this.pinch(e);
+ }
+ },
+
+ onContainerTouchMove: function (e) {
+ if (e.touches.length === 1 || e.touches.length === 2) {
+ this.pinch(e);
+ }
+ },
+
+ onDocumentTouchEnd: function (e) {
+ if (charts[hoverChartIndex]) {
+ charts[hoverChartIndex].pointer.drop(e);
+ }
+ }
+
+ });
+
+
+ /**
+ * The overview of the chart's series
+ */
+ var Legend = Highcharts.Legend = function (chart, options) {
+ this.init(chart, options);
+ };
+
+ Legend.prototype = {
+
+ /**
+ * Initialize the legend
+ */
+ init: function (chart, options) {
+
+ var legend = this,
+ itemStyle = options.itemStyle,
+ padding = pick(options.padding, 8),
+ itemMarginTop = options.itemMarginTop || 0;
+
+ this.options = options;
+
+ if (!options.enabled) {
+ return;
+ }
+
+ legend.itemStyle = itemStyle;
+ legend.itemHiddenStyle = merge(itemStyle, options.itemHiddenStyle);
+ legend.itemMarginTop = itemMarginTop;
+ legend.padding = padding;
+ legend.initialItemX = padding;
+ legend.initialItemY = padding - 5; // 5 is the number of pixels above the text
+ legend.maxItemWidth = 0;
+ legend.chart = chart;
+ legend.itemHeight = 0;
+ legend.lastLineHeight = 0;
+ legend.symbolWidth = pick(options.symbolWidth, 16);
+ legend.pages = [];
+
+
+ // Render it
+ legend.render();
+
+ // move checkboxes
+ addEvent(legend.chart, 'endResize', function () {
+ legend.positionCheckboxes();
+ });
+
+ },
+
+ /**
+ * Set the colors for the legend item
+ * @param {Object} item A Series or Point instance
+ * @param {Object} visible Dimmed or colored
+ */
+ colorizeItem: function (item, visible) {
+ var legend = this,
+ options = legend.options,
+ legendItem = item.legendItem,
+ legendLine = item.legendLine,
+ legendSymbol = item.legendSymbol,
+ hiddenColor = legend.itemHiddenStyle.color,
+ textColor = visible ? options.itemStyle.color : hiddenColor,
+ symbolColor = visible ? (item.legendColor || item.color || '#CCC') : hiddenColor,
+ markerOptions = item.options && item.options.marker,
+ symbolAttr = { fill: symbolColor },
+ key,
+ val;
+
+ if (legendItem) {
+ legendItem.css({ fill: textColor, color: textColor }); // color for #1553, oldIE
+ }
+ if (legendLine) {
+ legendLine.attr({ stroke: symbolColor });
+ }
+
+ if (legendSymbol) {
+
+ // Apply marker options
+ if (markerOptions && legendSymbol.isMarker) { // #585
+ symbolAttr.stroke = symbolColor;
+ markerOptions = item.convertAttribs(markerOptions);
+ for (key in markerOptions) {
+ val = markerOptions[key];
+ if (val !== UNDEFINED) {
+ symbolAttr[key] = val;
+ }
+ }
+ }
+
+ legendSymbol.attr(symbolAttr);
+ }
+ },
+
+ /**
+ * Position the legend item
+ * @param {Object} item A Series or Point instance
+ */
+ positionItem: function (item) {
+ var legend = this,
+ options = legend.options,
+ symbolPadding = options.symbolPadding,
+ ltr = !options.rtl,
+ legendItemPos = item._legendItemPos,
+ itemX = legendItemPos[0],
+ itemY = legendItemPos[1],
+ checkbox = item.checkbox;
+
+ if (item.legendGroup) {
+ item.legendGroup.translate(
+ ltr ? itemX : legend.legendWidth - itemX - 2 * symbolPadding - 4,
+ itemY
+ );
+ }
+
+ if (checkbox) {
+ checkbox.x = itemX;
+ checkbox.y = itemY;
+ }
+ },
+
+ /**
+ * Destroy a single legend item
+ * @param {Object} item The series or point
+ */
+ destroyItem: function (item) {
+ var checkbox = item.checkbox;
+
+ // destroy SVG elements
+ each(['legendItem', 'legendLine', 'legendSymbol', 'legendGroup'], function (key) {
+ if (item[key]) {
+ item[key] = item[key].destroy();
+ }
+ });
+
+ if (checkbox) {
+ discardElement(item.checkbox);
+ }
+ },
+
+ /**
+ * Destroys the legend.
+ */
+ destroy: function () {
+ var legend = this,
+ legendGroup = legend.group,
+ box = legend.box;
+
+ if (box) {
+ legend.box = box.destroy();
+ }
+
+ if (legendGroup) {
+ legend.group = legendGroup.destroy();
+ }
+ },
+
+ /**
+ * Position the checkboxes after the width is determined
+ */
+ positionCheckboxes: function (scrollOffset) {
+ var alignAttr = this.group.alignAttr,
+ translateY,
+ clipHeight = this.clipHeight || this.legendHeight;
+
+ if (alignAttr) {
+ translateY = alignAttr.translateY;
+ each(this.allItems, function (item) {
+ var checkbox = item.checkbox,
+ top;
+
+ if (checkbox) {
+ top = (translateY + checkbox.y + (scrollOffset || 0) + 3);
+ css(checkbox, {
+ left: (alignAttr.translateX + item.checkboxOffset + checkbox.x - 20) + PX,
+ top: top + PX,
+ display: top > translateY - 6 && top < translateY + clipHeight - 6 ? '' : NONE
+ });
+ }
+ });
+ }
+ },
+
+ /**
+ * Render the legend title on top of the legend
+ */
+ renderTitle: function () {
+ var options = this.options,
+ padding = this.padding,
+ titleOptions = options.title,
+ titleHeight = 0,
+ bBox;
+
+ if (titleOptions.text) {
+ if (!this.title) {
+ this.title = this.chart.renderer.label(titleOptions.text, padding - 3, padding - 4, null, null, null, null, null, 'legend-title')
+ .attr({ zIndex: 1 })
+ .css(titleOptions.style)
+ .add(this.group);
+ }
+ bBox = this.title.getBBox();
+ titleHeight = bBox.height;
+ this.offsetWidth = bBox.width; // #1717
+ this.contentGroup.attr({ translateY: titleHeight });
+ }
+ this.titleHeight = titleHeight;
+ },
+
+ /**
+ * Render a single specific legend item
+ * @param {Object} item A series or point
+ */
+ renderItem: function (item) {
+ var legend = this,
+ chart = legend.chart,
+ renderer = chart.renderer,
+ options = legend.options,
+ horizontal = options.layout === 'horizontal',
+ symbolWidth = legend.symbolWidth,
+ symbolPadding = options.symbolPadding,
+ itemStyle = legend.itemStyle,
+ itemHiddenStyle = legend.itemHiddenStyle,
+ padding = legend.padding,
+ itemDistance = horizontal ? pick(options.itemDistance, 20) : 0,
+ ltr = !options.rtl,
+ itemHeight,
+ widthOption = options.width,
+ itemMarginBottom = options.itemMarginBottom || 0,
+ itemMarginTop = legend.itemMarginTop,
+ initialItemX = legend.initialItemX,
+ bBox,
+ itemWidth,
+ li = item.legendItem,
+ series = item.series && item.series.drawLegendSymbol ? item.series : item,
+ seriesOptions = series.options,
+ showCheckbox = legend.createCheckboxForItem && seriesOptions && seriesOptions.showCheckbox,
+ useHTML = options.useHTML;
+
+ if (!li) { // generate it once, later move it
+
+ // Generate the group box
+ // A group to hold the symbol and text. Text is to be appended in Legend class.
+ item.legendGroup = renderer.g('legend-item')
+ .attr({ zIndex: 1 })
+ .add(legend.scrollGroup);
+
+ // Generate the list item text and add it to the group
+ item.legendItem = li = renderer.text(
+ options.labelFormat ? format(options.labelFormat, item) : options.labelFormatter.call(item),
+ ltr ? symbolWidth + symbolPadding : -symbolPadding,
+ legend.baseline || 0,
+ useHTML
+ )
+ .css(merge(item.visible ? itemStyle : itemHiddenStyle)) // merge to prevent modifying original (#1021)
+ .attr({
+ align: ltr ? 'left' : 'right',
+ zIndex: 2
+ })
+ .add(item.legendGroup);
+
+ // Get the baseline for the first item - the font size is equal for all
+ if (!legend.baseline) {
+ legend.baseline = renderer.fontMetrics(itemStyle.fontSize, li).f + 3 + itemMarginTop;
+ li.attr('y', legend.baseline);
+ }
+
+ // Draw the legend symbol inside the group box
+ series.drawLegendSymbol(legend, item);
+
+ if (legend.setItemEvents) {
+ legend.setItemEvents(item, li, useHTML, itemStyle, itemHiddenStyle);
+ }
+
+ // Colorize the items
+ legend.colorizeItem(item, item.visible);
+
+ // add the HTML checkbox on top
+ if (showCheckbox) {
+ legend.createCheckboxForItem(item);
+ }
+ }
+
+ // calculate the positions for the next line
+ bBox = li.getBBox();
+
+ itemWidth = item.checkboxOffset =
+ options.itemWidth ||
+ item.legendItemWidth ||
+ symbolWidth + symbolPadding + bBox.width + itemDistance + (showCheckbox ? 20 : 0);
+ legend.itemHeight = itemHeight = mathRound(item.legendItemHeight || bBox.height);
+
+ // if the item exceeds the width, start a new line
+ if (horizontal && legend.itemX - initialItemX + itemWidth >
+ (widthOption || (chart.chartWidth - 2 * padding - initialItemX - options.x))) {
+ legend.itemX = initialItemX;
+ legend.itemY += itemMarginTop + legend.lastLineHeight + itemMarginBottom;
+ legend.lastLineHeight = 0; // reset for next line
+ }
+
+ // If the item exceeds the height, start a new column
+ /*if (!horizontal && legend.itemY + options.y + itemHeight > chart.chartHeight - spacingTop - spacingBottom) {
+ legend.itemY = legend.initialItemY;
+ legend.itemX += legend.maxItemWidth;
+ legend.maxItemWidth = 0;
+ }*/
+
+ // Set the edge positions
+ legend.maxItemWidth = mathMax(legend.maxItemWidth, itemWidth);
+ legend.lastItemY = itemMarginTop + legend.itemY + itemMarginBottom;
+ legend.lastLineHeight = mathMax(itemHeight, legend.lastLineHeight); // #915
+
+ // cache the position of the newly generated or reordered items
+ item._legendItemPos = [legend.itemX, legend.itemY];
+
+ // advance
+ if (horizontal) {
+ legend.itemX += itemWidth;
+
+ } else {
+ legend.itemY += itemMarginTop + itemHeight + itemMarginBottom;
+ legend.lastLineHeight = itemHeight;
+ }
+
+ // the width of the widest item
+ legend.offsetWidth = widthOption || mathMax(
+ (horizontal ? legend.itemX - initialItemX - itemDistance : itemWidth) + padding,
+ legend.offsetWidth
+ );
+ },
+
+ /**
+ * Get all items, which is one item per series for normal series and one item per point
+ * for pie series.
+ */
+ getAllItems: function () {
+ var allItems = [];
+ each(this.chart.series, function (series) {
+ var seriesOptions = series.options;
+
+ // Handle showInLegend. If the series is linked to another series, defaults to false.
+ if (!pick(seriesOptions.showInLegend, !defined(seriesOptions.linkedTo) ? UNDEFINED : false, true)) {
+ return;
+ }
+
+ // use points or series for the legend item depending on legendType
+ allItems = allItems.concat(
+ series.legendItems ||
+ (seriesOptions.legendType === 'point' ?
+ series.data :
+ series)
+ );
+ });
+ return allItems;
+ },
+
+ /**
+ * Render the legend. This method can be called both before and after
+ * chart.render. If called after, it will only rearrange items instead
+ * of creating new ones.
+ */
+ render: function () {
+ var legend = this,
+ chart = legend.chart,
+ renderer = chart.renderer,
+ legendGroup = legend.group,
+ allItems,
+ display,
+ legendWidth,
+ legendHeight,
+ box = legend.box,
+ options = legend.options,
+ padding = legend.padding,
+ legendBorderWidth = options.borderWidth,
+ legendBackgroundColor = options.backgroundColor;
+
+ legend.itemX = legend.initialItemX;
+ legend.itemY = legend.initialItemY;
+ legend.offsetWidth = 0;
+ legend.lastItemY = 0;
+
+ if (!legendGroup) {
+ legend.group = legendGroup = renderer.g('legend')
+ .attr({ zIndex: 7 })
+ .add();
+ legend.contentGroup = renderer.g()
+ .attr({ zIndex: 1 }) // above background
+ .add(legendGroup);
+ legend.scrollGroup = renderer.g()
+ .add(legend.contentGroup);
+ }
+
+ legend.renderTitle();
+
+ // add each series or point
+ allItems = legend.getAllItems();
+
+ // sort by legendIndex
+ stableSort(allItems, function (a, b) {
+ return ((a.options && a.options.legendIndex) || 0) - ((b.options && b.options.legendIndex) || 0);
+ });
+
+ // reversed legend
+ if (options.reversed) {
+ allItems.reverse();
+ }
+
+ legend.allItems = allItems;
+ legend.display = display = !!allItems.length;
+
+ // render the items
+ each(allItems, function (item) {
+ legend.renderItem(item);
+ });
+
+ // Draw the border
+ legendWidth = options.width || legend.offsetWidth;
+ legendHeight = legend.lastItemY + legend.lastLineHeight + legend.titleHeight;
+
+
+ legendHeight = legend.handleOverflow(legendHeight);
+
+ if (legendBorderWidth || legendBackgroundColor) {
+ legendWidth += padding;
+ legendHeight += padding;
+
+ if (!box) {
+ legend.box = box = renderer.rect(
+ 0,
+ 0,
+ legendWidth,
+ legendHeight,
+ options.borderRadius,
+ legendBorderWidth || 0
+ ).attr({
+ stroke: options.borderColor,
+ 'stroke-width': legendBorderWidth || 0,
+ fill: legendBackgroundColor || NONE
+ })
+ .add(legendGroup)
+ .shadow(options.shadow);
+ box.isNew = true;
+
+ } else if (legendWidth > 0 && legendHeight > 0) {
+ box[box.isNew ? 'attr' : 'animate'](
+ box.crisp({ width: legendWidth, height: legendHeight })
+ );
+ box.isNew = false;
+ }
+
+ // hide the border if no items
+ box[display ? 'show' : 'hide']();
+ }
+
+ legend.legendWidth = legendWidth;
+ legend.legendHeight = legendHeight;
+
+ // Now that the legend width and height are established, put the items in the
+ // final position
+ each(allItems, function (item) {
+ legend.positionItem(item);
+ });
+
+ // 1.x compatibility: positioning based on style
+ /*var props = ['left', 'right', 'top', 'bottom'],
+ prop,
+ i = 4;
+ while (i--) {
+ prop = props[i];
+ if (options.style[prop] && options.style[prop] !== 'auto') {
+ options[i < 2 ? 'align' : 'verticalAlign'] = prop;
+ options[i < 2 ? 'x' : 'y'] = pInt(options.style[prop]) * (i % 2 ? -1 : 1);
+ }
+ }*/
+
+ if (display) {
+ legendGroup.align(extend({
+ width: legendWidth,
+ height: legendHeight
+ }, options), true, 'spacingBox');
+ }
+
+ if (!chart.isResizing) {
+ this.positionCheckboxes();
+ }
+ },
+
+ /**
+ * Set up the overflow handling by adding navigation with up and down arrows below the
+ * legend.
+ */
+ handleOverflow: function (legendHeight) {
+ var legend = this,
+ chart = this.chart,
+ renderer = chart.renderer,
+ options = this.options,
+ optionsY = options.y,
+ alignTop = options.verticalAlign === 'top',
+ spaceHeight = chart.spacingBox.height + (alignTop ? -optionsY : optionsY) - this.padding,
+ maxHeight = options.maxHeight,
+ clipHeight,
+ clipRect = this.clipRect,
+ navOptions = options.navigation,
+ animation = pick(navOptions.animation, true),
+ arrowSize = navOptions.arrowSize || 12,
+ nav = this.nav,
+ pages = this.pages,
+ lastY,
+ allItems = this.allItems;
+
+ // Adjust the height
+ if (options.layout === 'horizontal') {
+ spaceHeight /= 2;
+ }
+ if (maxHeight) {
+ spaceHeight = mathMin(spaceHeight, maxHeight);
+ }
+
+ // Reset the legend height and adjust the clipping rectangle
+ pages.length = 0;
+ if (legendHeight > spaceHeight && !options.useHTML) {
+
+ this.clipHeight = clipHeight = mathMax(spaceHeight - 20 - this.titleHeight - this.padding, 0);
+ this.currentPage = pick(this.currentPage, 1);
+ this.fullHeight = legendHeight;
+
+ // Fill pages with Y positions so that the top of each a legend item defines
+ // the scroll top for each page (#2098)
+ each(allItems, function (item, i) {
+ var y = item._legendItemPos[1],
+ h = mathRound(item.legendItem.getBBox().height),
+ len = pages.length;
+
+ if (!len || (y - pages[len - 1] > clipHeight && (lastY || y) !== pages[len - 1])) {
+ pages.push(lastY || y);
+ len++;
+ }
+
+ if (i === allItems.length - 1 && y + h - pages[len - 1] > clipHeight) {
+ pages.push(y);
+ }
+ if (y !== lastY) {
+ lastY = y;
+ }
+ });
+
+ // Only apply clipping if needed. Clipping causes blurred legend in PDF export (#1787)
+ if (!clipRect) {
+ clipRect = legend.clipRect = renderer.clipRect(0, this.padding, 9999, 0);
+ legend.contentGroup.clip(clipRect);
+ }
+ clipRect.attr({
+ height: clipHeight
+ });
+
+ // Add navigation elements
+ if (!nav) {
+ this.nav = nav = renderer.g().attr({ zIndex: 1 }).add(this.group);
+ this.up = renderer.symbol('triangle', 0, 0, arrowSize, arrowSize)
+ .on('click', function () {
+ legend.scroll(-1, animation);
+ })
+ .add(nav);
+ this.pager = renderer.text('', 15, 10)
+ .css(navOptions.style)
+ .add(nav);
+ this.down = renderer.symbol('triangle-down', 0, 0, arrowSize, arrowSize)
+ .on('click', function () {
+ legend.scroll(1, animation);
+ })
+ .add(nav);
+ }
+
+ // Set initial position
+ legend.scroll(0);
+
+ legendHeight = spaceHeight;
+
+ } else if (nav) {
+ clipRect.attr({
+ height: chart.chartHeight
+ });
+ nav.hide();
+ this.scrollGroup.attr({
+ translateY: 1
+ });
+ this.clipHeight = 0; // #1379
+ }
+
+ return legendHeight;
+ },
+
+ /**
+ * Scroll the legend by a number of pages
+ * @param {Object} scrollBy
+ * @param {Object} animation
+ */
+ scroll: function (scrollBy, animation) {
+ var pages = this.pages,
+ pageCount = pages.length,
+ currentPage = this.currentPage + scrollBy,
+ clipHeight = this.clipHeight,
+ navOptions = this.options.navigation,
+ activeColor = navOptions.activeColor,
+ inactiveColor = navOptions.inactiveColor,
+ pager = this.pager,
+ padding = this.padding,
+ scrollOffset;
+
+ // When resizing while looking at the last page
+ if (currentPage > pageCount) {
+ currentPage = pageCount;
+ }
+
+ if (currentPage > 0) {
+
+ if (animation !== UNDEFINED) {
+ setAnimation(animation, this.chart);
+ }
+
+ this.nav.attr({
+ translateX: padding,
+ translateY: clipHeight + this.padding + 7 + this.titleHeight,
+ visibility: VISIBLE
+ });
+ this.up.attr({
+ fill: currentPage === 1 ? inactiveColor : activeColor
+ })
+ .css({
+ cursor: currentPage === 1 ? 'default' : 'pointer'
+ });
+ pager.attr({
+ text: currentPage + '/' + pageCount
+ });
+ this.down.attr({
+ x: 18 + this.pager.getBBox().width, // adjust to text width
+ fill: currentPage === pageCount ? inactiveColor : activeColor
+ })
+ .css({
+ cursor: currentPage === pageCount ? 'default' : 'pointer'
+ });
+
+ scrollOffset = -pages[currentPage - 1] + this.initialItemY;
+
+ this.scrollGroup.animate({
+ translateY: scrollOffset
+ });
+
+ this.currentPage = currentPage;
+ this.positionCheckboxes(scrollOffset);
+ }
+
+ }
+
+ };
+
+ /*
+ * LegendSymbolMixin
+ */
+
+ var LegendSymbolMixin = Highcharts.LegendSymbolMixin = {
+
+ /**
+ * Get the series' symbol in the legend
+ *
+ * @param {Object} legend The legend object
+ * @param {Object} item The series (this) or point
+ */
+ drawRectangle: function (legend, item) {
+ var symbolHeight = legend.options.symbolHeight || 12;
+
+ item.legendSymbol = this.chart.renderer.rect(
+ 0,
+ legend.baseline - 5 - (symbolHeight / 2),
+ legend.symbolWidth,
+ symbolHeight,
+ legend.options.symbolRadius || 0
+ ).attr({
+ zIndex: 3
+ }).add(item.legendGroup);
+
+ },
+
+ /**
+ * Get the series' symbol in the legend. This method should be overridable to create custom
+ * symbols through Highcharts.seriesTypes[type].prototype.drawLegendSymbols.
+ *
+ * @param {Object} legend The legend object
+ */
+ drawLineMarker: function (legend) {
+
+ var options = this.options,
+ markerOptions = options.marker,
+ radius,
+ legendOptions = legend.options,
+ legendSymbol,
+ symbolWidth = legend.symbolWidth,
+ renderer = this.chart.renderer,
+ legendItemGroup = this.legendGroup,
+ verticalCenter = legend.baseline - mathRound(renderer.fontMetrics(legendOptions.itemStyle.fontSize, this.legendItem).b * 0.3),
+ attr;
+
+ // Draw the line
+ if (options.lineWidth) {
+ attr = {
+ 'stroke-width': options.lineWidth
+ };
+ if (options.dashStyle) {
+ attr.dashstyle = options.dashStyle;
+ }
+ this.legendLine = renderer.path([
+ M,
+ 0,
+ verticalCenter,
+ L,
+ symbolWidth,
+ verticalCenter
+ ])
+ .attr(attr)
+ .add(legendItemGroup);
+ }
+
+ // Draw the marker
+ if (markerOptions && markerOptions.enabled !== false) {
+ radius = markerOptions.radius;
+ this.legendSymbol = legendSymbol = renderer.symbol(
+ this.symbol,
+ (symbolWidth / 2) - radius,
+ verticalCenter - radius,
+ 2 * radius,
+ 2 * radius
+ )
+ .add(legendItemGroup);
+ legendSymbol.isMarker = true;
+ }
+ }
+ };
+
+ // Workaround for #2030, horizontal legend items not displaying in IE11 Preview,
+ // and for #2580, a similar drawing flaw in Firefox 26.
+ // TODO: Explore if there's a general cause for this. The problem may be related
+ // to nested group elements, as the legend item texts are within 4 group elements.
+ if (/Trident\/7\.0/.test(userAgent) || isFirefox) {
+ wrap(Legend.prototype, 'positionItem', function (proceed, item) {
+ var legend = this,
+ runPositionItem = function () { // If chart destroyed in sync, this is undefined (#2030)
+ if (item._legendItemPos) {
+ proceed.call(legend, item);
+ }
+ };
+
+ // Do it now, for export and to get checkbox placement
+ runPositionItem();
+
+ // Do it after to work around the core issue
+ setTimeout(runPositionItem);
+ });
+ }
+
+
+ /**
+ * The chart class
+ * @param {Object} options
+ * @param {Function} callback Function to run when the chart has loaded
+ */
+ function Chart() {
+ this.init.apply(this, arguments);
+ }
+
+ Chart.prototype = {
+
+ /**
+ * Initialize the chart
+ */
+ init: function (userOptions, callback) {
+
+ // Handle regular options
+ var options,
+ seriesOptions = userOptions.series; // skip merging data points to increase performance
+
+ userOptions.series = null;
+ options = merge(defaultOptions, userOptions); // do the merge
+ options.series = userOptions.series = seriesOptions; // set back the series data
+ this.userOptions = userOptions;
+
+ var optionsChart = options.chart;
+
+ // Create margin & spacing array
+ this.margin = this.splashArray('margin', optionsChart);
+ this.spacing = this.splashArray('spacing', optionsChart);
+
+ var chartEvents = optionsChart.events;
+
+ //this.runChartClick = chartEvents && !!chartEvents.click;
+ this.bounds = { h: {}, v: {} }; // Pixel data bounds for touch zoom
+
+ this.callback = callback;
+ this.isResizing = 0;
+ this.options = options;
+ //chartTitleOptions = UNDEFINED;
+ //chartSubtitleOptions = UNDEFINED;
+
+ this.axes = [];
+ this.series = [];
+ this.hasCartesianSeries = optionsChart.showAxes;
+ //this.axisOffset = UNDEFINED;
+ //this.maxTicks = UNDEFINED; // handle the greatest amount of ticks on grouped axes
+ //this.inverted = UNDEFINED;
+ //this.loadingShown = UNDEFINED;
+ //this.container = UNDEFINED;
+ //this.chartWidth = UNDEFINED;
+ //this.chartHeight = UNDEFINED;
+ //this.marginRight = UNDEFINED;
+ //this.marginBottom = UNDEFINED;
+ //this.containerWidth = UNDEFINED;
+ //this.containerHeight = UNDEFINED;
+ //this.oldChartWidth = UNDEFINED;
+ //this.oldChartHeight = UNDEFINED;
+
+ //this.renderTo = UNDEFINED;
+ //this.renderToClone = UNDEFINED;
+
+ //this.spacingBox = UNDEFINED
+
+ //this.legend = UNDEFINED;
+
+ // Elements
+ //this.chartBackground = UNDEFINED;
+ //this.plotBackground = UNDEFINED;
+ //this.plotBGImage = UNDEFINED;
+ //this.plotBorder = UNDEFINED;
+ //this.loadingDiv = UNDEFINED;
+ //this.loadingSpan = UNDEFINED;
+
+ var chart = this,
+ eventType;
+
+ // Add the chart to the global lookup
+ chart.index = charts.length;
+ charts.push(chart);
+ chartCount++;
+
+ // Set up auto resize
+ if (optionsChart.reflow !== false) {
+ addEvent(chart, 'load', function () {
+ chart.initReflow();
+ });
+ }
+
+ // Chart event handlers
+ if (chartEvents) {
+ for (eventType in chartEvents) {
+ addEvent(chart, eventType, chartEvents[eventType]);
+ }
+ }
+
+ chart.xAxis = [];
+ chart.yAxis = [];
+
+ // Expose methods and variables
+ chart.animation = useCanVG ? false : pick(optionsChart.animation, true);
+ chart.pointCount = chart.colorCounter = chart.symbolCounter = 0;
+
+ chart.firstRender();
+ },
+
+ /**
+ * Initialize an individual series, called internally before render time
+ */
+ initSeries: function (options) {
+ var chart = this,
+ optionsChart = chart.options.chart,
+ type = options.type || optionsChart.type || optionsChart.defaultSeriesType,
+ series,
+ constr = seriesTypes[type];
+
+ // No such series type
+ if (!constr) {
+ error(17, true);
+ }
+
+ series = new constr();
+ series.init(this, options);
+ return series;
+ },
+
+ /**
+ * Check whether a given point is within the plot area
+ *
+ * @param {Number} plotX Pixel x relative to the plot area
+ * @param {Number} plotY Pixel y relative to the plot area
+ * @param {Boolean} inverted Whether the chart is inverted
+ */
+ isInsidePlot: function (plotX, plotY, inverted) {
+ var x = inverted ? plotY : plotX,
+ y = inverted ? plotX : plotY;
+
+ return x >= 0 &&
+ x <= this.plotWidth &&
+ y >= 0 &&
+ y <= this.plotHeight;
+ },
+
+ /**
+ * Adjust all axes tick amounts
+ */
+ adjustTickAmounts: function () {
+ if (this.options.chart.alignTicks !== false) {
+ each(this.axes, function (axis) {
+ axis.adjustTickAmount();
+ });
+ }
+ this.maxTicks = null;
+ },
+
+ /**
+ * Redraw legend, axes or series based on updated data
+ *
+ * @param {Boolean|Object} animation Whether to apply animation, and optionally animation
+ * configuration
+ */
+ redraw: function (animation) {
+ var chart = this,
+ axes = chart.axes,
+ series = chart.series,
+ pointer = chart.pointer,
+ legend = chart.legend,
+ redrawLegend = chart.isDirtyLegend,
+ hasStackedSeries,
+ hasDirtyStacks,
+ hasCartesianSeries = chart.hasCartesianSeries,
+ isDirtyBox = chart.isDirtyBox, // todo: check if it has actually changed?
+ seriesLength = series.length,
+ i = seriesLength,
+ serie,
+ renderer = chart.renderer,
+ isHiddenChart = renderer.isHidden(),
+ afterRedraw = [];
+
+ setAnimation(animation, chart);
+
+ if (isHiddenChart) {
+ chart.cloneRenderTo();
+ }
+
+ // Adjust title layout (reflow multiline text)
+ chart.layOutTitles();
+
+ // link stacked series
+ while (i--) {
+ serie = series[i];
+
+ if (serie.options.stacking) {
+ hasStackedSeries = true;
+
+ if (serie.isDirty) {
+ hasDirtyStacks = true;
+ break;
+ }
+ }
+ }
+ if (hasDirtyStacks) { // mark others as dirty
+ i = seriesLength;
+ while (i--) {
+ serie = series[i];
+ if (serie.options.stacking) {
+ serie.isDirty = true;
+ }
+ }
+ }
+
+ // handle updated data in the series
+ each(series, function (serie) {
+ if (serie.isDirty) { // prepare the data so axis can read it
+ if (serie.options.legendType === 'point') {
+ redrawLegend = true;
+ }
+ }
+ });
+
+ // handle added or removed series
+ if (redrawLegend && legend.options.enabled) { // series or pie points are added or removed
+ // draw legend graphics
+ legend.render();
+
+ chart.isDirtyLegend = false;
+ }
+
+ // reset stacks
+ if (hasStackedSeries) {
+ chart.getStacks();
+ }
+
+
+ if (hasCartesianSeries) {
+ if (!chart.isResizing) {
+
+ // reset maxTicks
+ chart.maxTicks = null;
+
+ // set axes scales
+ each(axes, function (axis) {
+ axis.setScale();
+ });
+ }
+
+ chart.adjustTickAmounts();
+ }
+
+ chart.getMargins(); // #3098
+
+ if (hasCartesianSeries) {
+ // If one axis is dirty, all axes must be redrawn (#792, #2169)
+ each(axes, function (axis) {
+ if (axis.isDirty) {
+ isDirtyBox = true;
+ }
+ });
+
+ // redraw axes
+ each(axes, function (axis) {
+
+ // Fire 'afterSetExtremes' only if extremes are set
+ if (axis.isDirtyExtremes) { // #821
+ axis.isDirtyExtremes = false;
+ afterRedraw.push(function () { // prevent a recursive call to chart.redraw() (#1119)
+ fireEvent(axis, 'afterSetExtremes', extend(axis.eventArgs, axis.getExtremes())); // #747, #751
+ delete axis.eventArgs;
+ });
+ }
+
+ if (isDirtyBox || hasStackedSeries) {
+ axis.redraw();
+ }
+ });
+ }
+
+ // the plot areas size has changed
+ if (isDirtyBox) {
+ chart.drawChartBox();
+ }
+
+
+ // redraw affected series
+ each(series, function (serie) {
+ if (serie.isDirty && serie.visible &&
+ (!serie.isCartesian || serie.xAxis)) { // issue #153
+ serie.redraw();
+ }
+ });
+
+ // move tooltip or reset
+ if (pointer) {
+ pointer.reset(true);
+ }
+
+ // redraw if canvas
+ renderer.draw();
+
+ // fire the event
+ fireEvent(chart, 'redraw'); // jQuery breaks this when calling it from addEvent. Overwrites chart.redraw
+
+ if (isHiddenChart) {
+ chart.cloneRenderTo(true);
+ }
+
+ // Fire callbacks that are put on hold until after the redraw
+ each(afterRedraw, function (callback) {
+ callback.call();
+ });
+ },
+
+ /**
+ * Get an axis, series or point object by id.
+ * @param id {String} The id as given in the configuration options
+ */
+ get: function (id) {
+ var chart = this,
+ axes = chart.axes,
+ series = chart.series;
+
+ var i,
+ j,
+ points;
+
+ // search axes
+ for (i = 0; i < axes.length; i++) {
+ if (axes[i].options.id === id) {
+ return axes[i];
+ }
+ }
+
+ // search series
+ for (i = 0; i < series.length; i++) {
+ if (series[i].options.id === id) {
+ return series[i];
+ }
+ }
+
+ // search points
+ for (i = 0; i < series.length; i++) {
+ points = series[i].points || [];
+ for (j = 0; j < points.length; j++) {
+ if (points[j].id === id) {
+ return points[j];
+ }
+ }
+ }
+ return null;
+ },
+
+ /**
+ * Create the Axis instances based on the config options
+ */
+ getAxes: function () {
+ var chart = this,
+ options = this.options,
+ xAxisOptions = options.xAxis = splat(options.xAxis || {}),
+ yAxisOptions = options.yAxis = splat(options.yAxis || {}),
+ optionsArray,
+ axis;
+
+ // make sure the options are arrays and add some members
+ each(xAxisOptions, function (axis, i) {
+ axis.index = i;
+ axis.isX = true;
+ });
+
+ each(yAxisOptions, function (axis, i) {
+ axis.index = i;
+ });
+
+ // concatenate all axis options into one array
+ optionsArray = xAxisOptions.concat(yAxisOptions);
+
+ each(optionsArray, function (axisOptions) {
+ axis = new Axis(chart, axisOptions);
+ });
+
+ chart.adjustTickAmounts();
+ },
+
+
+ /**
+ * Get the currently selected points from all series
+ */
+ getSelectedPoints: function () {
+ var points = [];
+ each(this.series, function (serie) {
+ points = points.concat(grep(serie.points || [], function (point) {
+ return point.selected;
+ }));
+ });
+ return points;
+ },
+
+ /**
+ * Get the currently selected series
+ */
+ getSelectedSeries: function () {
+ return grep(this.series, function (serie) {
+ return serie.selected;
+ });
+ },
+
+ /**
+ * Generate stacks for each series and calculate stacks total values
+ */
+ getStacks: function () {
+ var chart = this;
+
+ // reset stacks for each yAxis
+ each(chart.yAxis, function (axis) {
+ if (axis.stacks && axis.hasVisibleSeries) {
+ axis.oldStacks = axis.stacks;
+ }
+ });
+
+ each(chart.series, function (series) {
+ if (series.options.stacking && (series.visible === true || chart.options.chart.ignoreHiddenSeries === false)) {
+ series.stackKey = series.type + pick(series.options.stack, '');
+ }
+ });
+ },
+
+ /**
+ * Show the title and subtitle of the chart
+ *
+ * @param titleOptions {Object} New title options
+ * @param subtitleOptions {Object} New subtitle options
+ *
+ */
+ setTitle: function (titleOptions, subtitleOptions, redraw) {
+ var chart = this,
+ options = chart.options,
+ chartTitleOptions,
+ chartSubtitleOptions;
+
+ chartTitleOptions = options.title = merge(options.title, titleOptions);
+ chartSubtitleOptions = options.subtitle = merge(options.subtitle, subtitleOptions);
+
+ // add title and subtitle
+ each([
+ ['title', titleOptions, chartTitleOptions],
+ ['subtitle', subtitleOptions, chartSubtitleOptions]
+ ], function (arr) {
+ var name = arr[0],
+ title = chart[name],
+ titleOptions = arr[1],
+ chartTitleOptions = arr[2];
+
+ if (title && titleOptions) {
+ chart[name] = title = title.destroy(); // remove old
+ }
+
+ if (chartTitleOptions && chartTitleOptions.text && !title) {
+ chart[name] = chart.renderer.text(
+ chartTitleOptions.text,
+ 0,
+ 0,
+ chartTitleOptions.useHTML
+ )
+ .attr({
+ align: chartTitleOptions.align,
+ 'class': PREFIX + name,
+ zIndex: chartTitleOptions.zIndex || 4
+ })
+ .css(chartTitleOptions.style)
+ .add();
+ }
+ });
+ chart.layOutTitles(redraw);
+ },
+
+ /**
+ * Lay out the chart titles and cache the full offset height for use in getMargins
+ */
+ layOutTitles: function (redraw) {
+ var titleOffset = 0,
+ title = this.title,
+ subtitle = this.subtitle,
+ options = this.options,
+ titleOptions = options.title,
+ subtitleOptions = options.subtitle,
+ requiresDirtyBox,
+ renderer = this.renderer,
+ autoWidth = this.spacingBox.width - 44; // 44 makes room for default context button
+
+ if (title) {
+ title
+ .css({ width: (titleOptions.width || autoWidth) + PX })
+ .align(extend({
+ y: renderer.fontMetrics(titleOptions.style.fontSize, title).b - 3
+ }, titleOptions), false, 'spacingBox');
+
+ if (!titleOptions.floating && !titleOptions.verticalAlign) {
+ titleOffset = title.getBBox().height;
+ }
+ }
+ if (subtitle) {
+ subtitle
+ .css({ width: (subtitleOptions.width || autoWidth) + PX })
+ .align(extend({
+ y: titleOffset + (titleOptions.margin - 13) + renderer.fontMetrics(titleOptions.style.fontSize, subtitle).b
+ }, subtitleOptions), false, 'spacingBox');
+
+ if (!subtitleOptions.floating && !subtitleOptions.verticalAlign) {
+ titleOffset = mathCeil(titleOffset + subtitle.getBBox().height);
+ }
+ }
+
+ requiresDirtyBox = this.titleOffset !== titleOffset;
+ this.titleOffset = titleOffset; // used in getMargins
+
+ if (!this.isDirtyBox && requiresDirtyBox) {
+ this.isDirtyBox = requiresDirtyBox;
+ // Redraw if necessary (#2719, #2744)
+ if (this.hasRendered && pick(redraw, true) && this.isDirtyBox) {
+ this.redraw();
+ }
+ }
+ },
+
+ /**
+ * Get chart width and height according to options and container size
+ */
+ getChartSize: function () {
+ var chart = this,
+ optionsChart = chart.options.chart,
+ widthOption = optionsChart.width,
+ heightOption = optionsChart.height,
+ renderTo = chart.renderToClone || chart.renderTo;
+
+ // get inner width and height from jQuery (#824)
+ if (!defined(widthOption)) {
+ chart.containerWidth = adapterRun(renderTo, 'width');
+ }
+ if (!defined(heightOption)) {
+ chart.containerHeight = adapterRun(renderTo, 'height');
+ }
+
+ chart.chartWidth = mathMax(0, widthOption || chart.containerWidth || 600); // #1393, 1460
+ chart.chartHeight = mathMax(0, pick(heightOption,
+ // the offsetHeight of an empty container is 0 in standard browsers, but 19 in IE7:
+ chart.containerHeight > 19 ? chart.containerHeight : 400));
+ },
+
+ /**
+ * Create a clone of the chart's renderTo div and place it outside the viewport to allow
+ * size computation on chart.render and chart.redraw
+ */
+ cloneRenderTo: function (revert) {
+ var clone = this.renderToClone,
+ container = this.container;
+
+ // Destroy the clone and bring the container back to the real renderTo div
+ if (revert) {
+ if (clone) {
+ this.renderTo.appendChild(container);
+ discardElement(clone);
+ delete this.renderToClone;
+ }
+
+ // Set up the clone
+ } else {
+ if (container && container.parentNode === this.renderTo) {
+ this.renderTo.removeChild(container); // do not clone this
+ }
+ this.renderToClone = clone = this.renderTo.cloneNode(0);
+ css(clone, {
+ position: ABSOLUTE,
+ top: '-9999px',
+ display: 'block' // #833
+ });
+ if (clone.style.setProperty) { // #2631
+ clone.style.setProperty('display', 'block', 'important');
+ }
+ doc.body.appendChild(clone);
+ if (container) {
+ clone.appendChild(container);
+ }
+ }
+ },
+
+ /**
+ * Get the containing element, determine the size and create the inner container
+ * div to hold the chart
+ */
+ getContainer: function () {
+ var chart = this,
+ container,
+ optionsChart = chart.options.chart,
+ chartWidth,
+ chartHeight,
+ renderTo,
+ indexAttrName = 'data-highcharts-chart',
+ oldChartIndex,
+ containerId;
+
+ chart.renderTo = renderTo = optionsChart.renderTo;
+ containerId = PREFIX + idCounter++;
+
+ if (isString(renderTo)) {
+ chart.renderTo = renderTo = doc.getElementById(renderTo);
+ }
+
+ // Display an error if the renderTo is wrong
+ if (!renderTo) {
+ error(13, true);
+ }
+
+ // If the container already holds a chart, destroy it. The check for hasRendered is there
+ // because web pages that are saved to disk from the browser, will preserve the data-highcharts-chart
+ // attribute and the SVG contents, but not an interactive chart. So in this case,
+ // charts[oldChartIndex] will point to the wrong chart if any (#2609).
+ oldChartIndex = pInt(attr(renderTo, indexAttrName));
+ if (!isNaN(oldChartIndex) && charts[oldChartIndex] && charts[oldChartIndex].hasRendered) {
+ charts[oldChartIndex].destroy();
+ }
+
+ // Make a reference to the chart from the div
+ attr(renderTo, indexAttrName, chart.index);
+
+ // remove previous chart
+ renderTo.innerHTML = '';
+
+ // If the container doesn't have an offsetWidth, it has or is a child of a node
+ // that has display:none. We need to temporarily move it out to a visible
+ // state to determine the size, else the legend and tooltips won't render
+ // properly. The allowClone option is used in sparklines as a micro optimization,
+ // saving about 1-2 ms each chart.
+ if (!optionsChart.skipClone && !renderTo.offsetWidth) {
+ chart.cloneRenderTo();
+ }
+
+ // get the width and height
+ chart.getChartSize();
+ chartWidth = chart.chartWidth;
+ chartHeight = chart.chartHeight;
+
+ // create the inner container
+ chart.container = container = createElement(DIV, {
+ className: PREFIX + 'container' +
+ (optionsChart.className ? ' ' + optionsChart.className : ''),
+ id: containerId
+ }, extend({
+ position: RELATIVE,
+ overflow: HIDDEN, // needed for context menu (avoid scrollbars) and
+ // content overflow in IE
+ width: chartWidth + PX,
+ height: chartHeight + PX,
+ textAlign: 'left',
+ lineHeight: 'normal', // #427
+ zIndex: 0, // #1072
+ '-webkit-tap-highlight-color': 'rgba(0,0,0,0)'
+ }, optionsChart.style),
+ chart.renderToClone || renderTo
+ );
+
+ // cache the cursor (#1650)
+ chart._cursor = container.style.cursor;
+
+ // Initialize the renderer
+ chart.renderer =
+ optionsChart.forExport ? // force SVG, used for SVG export
+ new SVGRenderer(container, chartWidth, chartHeight, optionsChart.style, true) :
+ new Renderer(container, chartWidth, chartHeight, optionsChart.style);
+
+ if (useCanVG) {
+ // If we need canvg library, extend and configure the renderer
+ // to get the tracker for translating mouse events
+ chart.renderer.create(chart, container, chartWidth, chartHeight);
+ }
+ },
+
+ /**
+ * Calculate margins by rendering axis labels in a preliminary position. Title,
+ * subtitle and legend have already been rendered at this stage, but will be
+ * moved into their final positions
+ */
+ getMargins: function () {
+ var chart = this,
+ spacing = chart.spacing,
+ axisOffset,
+ legend = chart.legend,
+ margin = chart.margin,
+ legendOptions = chart.options.legend,
+ legendMargin = pick(legendOptions.margin, 20),
+ legendX = legendOptions.x,
+ legendY = legendOptions.y,
+ align = legendOptions.align,
+ verticalAlign = legendOptions.verticalAlign,
+ titleOffset = chart.titleOffset;
+
+ chart.resetMargins();
+ axisOffset = chart.axisOffset;
+
+ // Adjust for title and subtitle
+ if (titleOffset && !defined(margin[0])) {
+ chart.plotTop = mathMax(chart.plotTop, titleOffset + chart.options.title.margin + spacing[0]);
+ }
+
+ // Adjust for legend
+ if (legend.display && !legendOptions.floating) {
+ if (align === 'right') { // horizontal alignment handled first
+ if (!defined(margin[1])) {
+ chart.marginRight = mathMax(
+ chart.marginRight,
+ legend.legendWidth - legendX + legendMargin + spacing[1]
+ );
+ }
+ } else if (align === 'left') {
+ if (!defined(margin[3])) {
+ chart.plotLeft = mathMax(
+ chart.plotLeft,
+ legend.legendWidth + legendX + legendMargin + spacing[3]
+ );
+ }
+
+ } else if (verticalAlign === 'top') {
+ if (!defined(margin[0])) {
+ chart.plotTop = mathMax(
+ chart.plotTop,
+ legend.legendHeight + legendY + legendMargin + spacing[0]
+ );
+ }
+
+ } else if (verticalAlign === 'bottom') {
+ if (!defined(margin[2])) {
+ chart.marginBottom = mathMax(
+ chart.marginBottom,
+ legend.legendHeight - legendY + legendMargin + spacing[2]
+ );
+ }
+ }
+ }
+
+ // adjust for scroller
+ if (chart.extraBottomMargin) {
+ chart.marginBottom += chart.extraBottomMargin;
+ }
+ if (chart.extraTopMargin) {
+ chart.plotTop += chart.extraTopMargin;
+ }
+
+ // pre-render axes to get labels offset width
+ if (chart.hasCartesianSeries) {
+ each(chart.axes, function (axis) {
+ axis.getOffset();
+ });
+ }
+
+ if (!defined(margin[3])) {
+ chart.plotLeft += axisOffset[3];
+ }
+ if (!defined(margin[0])) {
+ chart.plotTop += axisOffset[0];
+ }
+ if (!defined(margin[2])) {
+ chart.marginBottom += axisOffset[2];
+ }
+ if (!defined(margin[1])) {
+ chart.marginRight += axisOffset[1];
+ }
+
+ chart.setChartSize();
+
+ },
+
+ /**
+ * Resize the chart to its container if size is not explicitly set
+ */
+ reflow: function (e) {
+ var chart = this,
+ optionsChart = chart.options.chart,
+ renderTo = chart.renderTo,
+ width = optionsChart.width || adapterRun(renderTo, 'width'),
+ height = optionsChart.height || adapterRun(renderTo, 'height'),
+ target = e ? e.target : win, // #805 - MooTools doesn't supply e
+ doReflow = function () {
+ if (chart.container) { // It may have been destroyed in the meantime (#1257)
+ chart.setSize(width, height, false);
+ chart.hasUserSize = null;
+ }
+ };
+
+ // Width and height checks for display:none. Target is doc in IE8 and Opera,
+ // win in Firefox, Chrome and IE9.
+ if (!chart.hasUserSize && width && height && (target === win || target === doc)) {
+ if (width !== chart.containerWidth || height !== chart.containerHeight) {
+ clearTimeout(chart.reflowTimeout);
+ if (e) { // Called from window.resize
+ chart.reflowTimeout = setTimeout(doReflow, 100);
+ } else { // Called directly (#2224)
+ doReflow();
+ }
+ }
+ chart.containerWidth = width;
+ chart.containerHeight = height;
+ }
+ },
+
+ /**
+ * Add the event handlers necessary for auto resizing
+ */
+ initReflow: function () {
+ var chart = this,
+ reflow = function (e) {
+ chart.reflow(e);
+ };
+
+
+ addEvent(win, 'resize', reflow);
+ addEvent(chart, 'destroy', function () {
+ removeEvent(win, 'resize', reflow);
+ });
+ },
+
+ /**
+ * Resize the chart to a given width and height
+ * @param {Number} width
+ * @param {Number} height
+ * @param {Object|Boolean} animation
+ */
+ setSize: function (width, height, animation) {
+ var chart = this,
+ chartWidth,
+ chartHeight,
+ fireEndResize;
+
+ // Handle the isResizing counter
+ chart.isResizing += 1;
+ fireEndResize = function () {
+ if (chart) {
+ fireEvent(chart, 'endResize', null, function () {
+ chart.isResizing -= 1;
+ });
+ }
+ };
+
+ // set the animation for the current process
+ setAnimation(animation, chart);
+
+ chart.oldChartHeight = chart.chartHeight;
+ chart.oldChartWidth = chart.chartWidth;
+ if (defined(width)) {
+ chart.chartWidth = chartWidth = mathMax(0, mathRound(width));
+ chart.hasUserSize = !!chartWidth;
+ }
+ if (defined(height)) {
+ chart.chartHeight = chartHeight = mathMax(0, mathRound(height));
+ }
+
+ // Resize the container with the global animation applied if enabled (#2503)
+ (globalAnimation ? animate : css)(chart.container, {
+ width: chartWidth + PX,
+ height: chartHeight + PX
+ }, globalAnimation);
+
+ chart.setChartSize(true);
+ chart.renderer.setSize(chartWidth, chartHeight, animation);
+
+ // handle axes
+ chart.maxTicks = null;
+ each(chart.axes, function (axis) {
+ axis.isDirty = true;
+ axis.setScale();
+ });
+
+ // make sure non-cartesian series are also handled
+ each(chart.series, function (serie) {
+ serie.isDirty = true;
+ });
+
+ chart.isDirtyLegend = true; // force legend redraw
+ chart.isDirtyBox = true; // force redraw of plot and chart border
+
+ chart.layOutTitles(); // #2857
+ chart.getMargins();
+
+ chart.redraw(animation);
+
+
+ chart.oldChartHeight = null;
+ fireEvent(chart, 'resize');
+
+ // fire endResize and set isResizing back
+ // If animation is disabled, fire without delay
+ if (globalAnimation === false) {
+ fireEndResize();
+ } else { // else set a timeout with the animation duration
+ setTimeout(fireEndResize, (globalAnimation && globalAnimation.duration) || 500);
+ }
+ },
+
+ /**
+ * Set the public chart properties. This is done before and after the pre-render
+ * to determine margin sizes
+ */
+ setChartSize: function (skipAxes) {
+ var chart = this,
+ inverted = chart.inverted,
+ renderer = chart.renderer,
+ chartWidth = chart.chartWidth,
+ chartHeight = chart.chartHeight,
+ optionsChart = chart.options.chart,
+ spacing = chart.spacing,
+ clipOffset = chart.clipOffset,
+ clipX,
+ clipY,
+ plotLeft,
+ plotTop,
+ plotWidth,
+ plotHeight,
+ plotBorderWidth;
+
+ chart.plotLeft = plotLeft = mathRound(chart.plotLeft);
+ chart.plotTop = plotTop = mathRound(chart.plotTop);
+ chart.plotWidth = plotWidth = mathMax(0, mathRound(chartWidth - plotLeft - chart.marginRight));
+ chart.plotHeight = plotHeight = mathMax(0, mathRound(chartHeight - plotTop - chart.marginBottom));
+
+ chart.plotSizeX = inverted ? plotHeight : plotWidth;
+ chart.plotSizeY = inverted ? plotWidth : plotHeight;
+
+ chart.plotBorderWidth = optionsChart.plotBorderWidth || 0;
+
+ // Set boxes used for alignment
+ chart.spacingBox = renderer.spacingBox = {
+ x: spacing[3],
+ y: spacing[0],
+ width: chartWidth - spacing[3] - spacing[1],
+ height: chartHeight - spacing[0] - spacing[2]
+ };
+ chart.plotBox = renderer.plotBox = {
+ x: plotLeft,
+ y: plotTop,
+ width: plotWidth,
+ height: plotHeight
+ };
+
+ plotBorderWidth = 2 * mathFloor(chart.plotBorderWidth / 2);
+ clipX = mathCeil(mathMax(plotBorderWidth, clipOffset[3]) / 2);
+ clipY = mathCeil(mathMax(plotBorderWidth, clipOffset[0]) / 2);
+ chart.clipBox = {
+ x: clipX,
+ y: clipY,
+ width: mathFloor(chart.plotSizeX - mathMax(plotBorderWidth, clipOffset[1]) / 2 - clipX),
+ height: mathMax(0, mathFloor(chart.plotSizeY - mathMax(plotBorderWidth, clipOffset[2]) / 2 - clipY))
+ };
+
+ if (!skipAxes) {
+ each(chart.axes, function (axis) {
+ axis.setAxisSize();
+ axis.setAxisTranslation();
+ });
+ }
+ },
+
+ /**
+ * Initial margins before auto size margins are applied
+ */
+ resetMargins: function () {
+ var chart = this,
+ spacing = chart.spacing,
+ margin = chart.margin;
+
+ chart.plotTop = pick(margin[0], spacing[0]);
+ chart.marginRight = pick(margin[1], spacing[1]);
+ chart.marginBottom = pick(margin[2], spacing[2]);
+ chart.plotLeft = pick(margin[3], spacing[3]);
+ chart.axisOffset = [0, 0, 0, 0]; // top, right, bottom, left
+ chart.clipOffset = [0, 0, 0, 0];
+ },
+
+ /**
+ * Draw the borders and backgrounds for chart and plot area
+ */
+ drawChartBox: function () {
+ var chart = this,
+ optionsChart = chart.options.chart,
+ renderer = chart.renderer,
+ chartWidth = chart.chartWidth,
+ chartHeight = chart.chartHeight,
+ chartBackground = chart.chartBackground,
+ plotBackground = chart.plotBackground,
+ plotBorder = chart.plotBorder,
+ plotBGImage = chart.plotBGImage,
+ chartBorderWidth = optionsChart.borderWidth || 0,
+ chartBackgroundColor = optionsChart.backgroundColor,
+ plotBackgroundColor = optionsChart.plotBackgroundColor,
+ plotBackgroundImage = optionsChart.plotBackgroundImage,
+ plotBorderWidth = optionsChart.plotBorderWidth || 0,
+ mgn,
+ bgAttr,
+ plotLeft = chart.plotLeft,
+ plotTop = chart.plotTop,
+ plotWidth = chart.plotWidth,
+ plotHeight = chart.plotHeight,
+ plotBox = chart.plotBox,
+ clipRect = chart.clipRect,
+ clipBox = chart.clipBox;
+
+ // Chart area
+ mgn = chartBorderWidth + (optionsChart.shadow ? 8 : 0);
+
+ if (chartBorderWidth || chartBackgroundColor) {
+ if (!chartBackground) {
+
+ bgAttr = {
+ fill: chartBackgroundColor || NONE
+ };
+ if (chartBorderWidth) { // #980
+ bgAttr.stroke = optionsChart.borderColor;
+ bgAttr['stroke-width'] = chartBorderWidth;
+ }
+ chart.chartBackground = renderer.rect(mgn / 2, mgn / 2, chartWidth - mgn, chartHeight - mgn,
+ optionsChart.borderRadius, chartBorderWidth)
+ .attr(bgAttr)
+ .addClass(PREFIX + 'background')
+ .add()
+ .shadow(optionsChart.shadow);
+
+ } else { // resize
+ chartBackground.animate(
+ chartBackground.crisp({ width: chartWidth - mgn, height: chartHeight - mgn })
+ );
+ }
+ }
+
+
+ // Plot background
+ if (plotBackgroundColor) {
+ if (!plotBackground) {
+ chart.plotBackground = renderer.rect(plotLeft, plotTop, plotWidth, plotHeight, 0)
+ .attr({
+ fill: plotBackgroundColor
+ })
+ .add()
+ .shadow(optionsChart.plotShadow);
+ } else {
+ plotBackground.animate(plotBox);
+ }
+ }
+ if (plotBackgroundImage) {
+ if (!plotBGImage) {
+ chart.plotBGImage = renderer.image(plotBackgroundImage, plotLeft, plotTop, plotWidth, plotHeight)
+ .add();
+ } else {
+ plotBGImage.animate(plotBox);
+ }
+ }
+
+ // Plot clip
+ if (!clipRect) {
+ chart.clipRect = renderer.clipRect(clipBox);
+ } else {
+ clipRect.animate({
+ width: clipBox.width,
+ height: clipBox.height
+ });
+ }
+
+ // Plot area border
+ if (plotBorderWidth) {
+ if (!plotBorder) {
+ chart.plotBorder = renderer.rect(plotLeft, plotTop, plotWidth, plotHeight, 0, -plotBorderWidth)
+ .attr({
+ stroke: optionsChart.plotBorderColor,
+ 'stroke-width': plotBorderWidth,
+ fill: NONE,
+ zIndex: 1
+ })
+ .add();
+ } else {
+ plotBorder.animate(
+ plotBorder.crisp({ x: plotLeft, y: plotTop, width: plotWidth, height: plotHeight, strokeWidth: -plotBorderWidth }) //#3282 plotBorder should be negative
+ );
+ }
+ }
+
+ // reset
+ chart.isDirtyBox = false;
+ },
+
+ /**
+ * Detect whether a certain chart property is needed based on inspecting its options
+ * and series. This mainly applies to the chart.invert property, and in extensions to
+ * the chart.angular and chart.polar properties.
+ */
+ propFromSeries: function () {
+ var chart = this,
+ optionsChart = chart.options.chart,
+ klass,
+ seriesOptions = chart.options.series,
+ i,
+ value;
+
+
+ each(['inverted', 'angular', 'polar'], function (key) {
+
+ // The default series type's class
+ klass = seriesTypes[optionsChart.type || optionsChart.defaultSeriesType];
+
+ // Get the value from available chart-wide properties
+ value = (
+ chart[key] || // 1. it is set before
+ optionsChart[key] || // 2. it is set in the options
+ (klass && klass.prototype[key]) // 3. it's default series class requires it
+ );
+
+ // 4. Check if any the chart's series require it
+ i = seriesOptions && seriesOptions.length;
+ while (!value && i--) {
+ klass = seriesTypes[seriesOptions[i].type];
+ if (klass && klass.prototype[key]) {
+ value = true;
+ }
+ }
+
+ // Set the chart property
+ chart[key] = value;
+ });
+
+ },
+
+ /**
+ * Link two or more series together. This is done initially from Chart.render,
+ * and after Chart.addSeries and Series.remove.
+ */
+ linkSeries: function () {
+ var chart = this,
+ chartSeries = chart.series;
+
+ // Reset links
+ each(chartSeries, function (series) {
+ series.linkedSeries.length = 0;
+ });
+
+ // Apply new links
+ each(chartSeries, function (series) {
+ var linkedTo = series.options.linkedTo;
+ if (isString(linkedTo)) {
+ if (linkedTo === ':previous') {
+ linkedTo = chart.series[series.index - 1];
+ } else {
+ linkedTo = chart.get(linkedTo);
+ }
+ if (linkedTo) {
+ linkedTo.linkedSeries.push(series);
+ series.linkedParent = linkedTo;
+ }
+ }
+ });
+ },
+
+ /**
+ * Render series for the chart
+ */
+ renderSeries: function () {
+ each(this.series, function (serie) {
+ serie.translate();
+ if (serie.setTooltipPoints) {
+ serie.setTooltipPoints();
+ }
+ serie.render();
+ });
+ },
+
+ /**
+ * Render labels for the chart
+ */
+ renderLabels: function () {
+ var chart = this,
+ labels = chart.options.labels;
+ if (labels.items) {
+ each(labels.items, function (label) {
+ var style = extend(labels.style, label.style),
+ x = pInt(style.left) + chart.plotLeft,
+ y = pInt(style.top) + chart.plotTop + 12;
+
+ // delete to prevent rewriting in IE
+ delete style.left;
+ delete style.top;
+
+ chart.renderer.text(
+ label.html,
+ x,
+ y
+ )
+ .attr({ zIndex: 2 })
+ .css(style)
+ .add();
+
+ });
+ }
+ },
+
+ /**
+ * Render all graphics for the chart
+ */
+ render: function () {
+ var chart = this,
+ axes = chart.axes,
+ renderer = chart.renderer,
+ options = chart.options;
+
+ // Title
+ chart.setTitle();
+
+
+ // Legend
+ chart.legend = new Legend(chart, options.legend);
+
+ chart.getStacks(); // render stacks
+
+ // Get margins by pre-rendering axes
+ // set axes scales
+ each(axes, function (axis) {
+ axis.setScale();
+ });
+
+ chart.getMargins();
+
+ chart.maxTicks = null; // reset for second pass
+ each(axes, function (axis) {
+ axis.setTickPositions(true); // update to reflect the new margins
+ axis.setMaxTicks();
+ });
+ chart.adjustTickAmounts();
+ chart.getMargins(); // second pass to check for new labels
+
+
+ // Draw the borders and backgrounds
+ chart.drawChartBox();
+
+
+ // Axes
+ if (chart.hasCartesianSeries) {
+ each(axes, function (axis) {
+ axis.render();
+ });
+ }
+
+ // The series
+ if (!chart.seriesGroup) {
+ chart.seriesGroup = renderer.g('series-group')
+ .attr({ zIndex: 3 })
+ .add();
+ }
+ chart.renderSeries();
+
+ // Labels
+ chart.renderLabels();
+
+ // Credits
+ chart.showCredits(options.credits);
+
+ // Set flag
+ chart.hasRendered = true;
+
+ },
+
+ /**
+ * Show chart credits based on config options
+ */
+ showCredits: function (credits) {
+ if (credits.enabled && !this.credits) {
+ this.credits = this.renderer.text(
+ credits.text,
+ 0,
+ 0
+ )
+ .on('click', function () {
+ if (credits.href) {
+ location.href = credits.href;
+ }
+ })
+ .attr({
+ align: credits.position.align,
+ zIndex: 8
+ })
+ .css(credits.style)
+ .add()
+ .align(credits.position);
+ }
+ },
+
+ /**
+ * Clean up memory usage
+ */
+ destroy: function () {
+ var chart = this,
+ axes = chart.axes,
+ series = chart.series,
+ container = chart.container,
+ i,
+ parentNode = container && container.parentNode;
+
+ // fire the chart.destoy event
+ fireEvent(chart, 'destroy');
+
+ // Delete the chart from charts lookup array
+ charts[chart.index] = UNDEFINED;
+ chartCount--;
+ chart.renderTo.removeAttribute('data-highcharts-chart');
+
+ // remove events
+ removeEvent(chart);
+
+ // ==== Destroy collections:
+ // Destroy axes
+ i = axes.length;
+ while (i--) {
+ axes[i] = axes[i].destroy();
+ }
+
+ // Destroy each series
+ i = series.length;
+ while (i--) {
+ series[i] = series[i].destroy();
+ }
+
+ // ==== Destroy chart properties:
+ each(['title', 'subtitle', 'chartBackground', 'plotBackground', 'plotBGImage',
+ 'plotBorder', 'seriesGroup', 'clipRect', 'credits', 'pointer', 'scroller',
+ 'rangeSelector', 'legend', 'resetZoomButton', 'tooltip', 'renderer'], function (name) {
+ var prop = chart[name];
+
+ if (prop && prop.destroy) {
+ chart[name] = prop.destroy();
+ }
+ });
+
+ // remove container and all SVG
+ if (container) { // can break in IE when destroyed before finished loading
+ container.innerHTML = '';
+ removeEvent(container);
+ if (parentNode) {
+ discardElement(container);
+ }
+
+ }
+
+ // clean it all up
+ for (i in chart) {
+ delete chart[i];
+ }
+
+ },
+
+
+ /**
+ * VML namespaces can't be added until after complete. Listening
+ * for Perini's doScroll hack is not enough.
+ */
+ isReadyToRender: function () {
+ var chart = this;
+
+ // Note: in spite of JSLint's complaints, win == win.top is required
+ /*jslint eqeq: true*/
+ if ((!hasSVG && (win == win.top && doc.readyState !== 'complete')) || (useCanVG && !win.canvg)) {
+ /*jslint eqeq: false*/
+ if (useCanVG) {
+ // Delay rendering until canvg library is downloaded and ready
+ CanVGController.push(function () { chart.firstRender(); }, chart.options.global.canvasToolsURL);
+ } else {
+ doc.attachEvent('onreadystatechange', function () {
+ doc.detachEvent('onreadystatechange', chart.firstRender);
+ if (doc.readyState === 'complete') {
+ chart.firstRender();
+ }
+ });
+ }
+ return false;
+ }
+ return true;
+ },
+
+ /**
+ * Prepare for first rendering after all data are loaded
+ */
+ firstRender: function () {
+ var chart = this,
+ options = chart.options,
+ callback = chart.callback;
+
+ // Check whether the chart is ready to render
+ if (!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 (Highcharts.Pointer) {
+ chart.pointer = new Pointer(chart, options);
+ }
+
+ chart.render();
+
+ // add canvas
+ chart.renderer.draw();
+ // run callbacks
+ if (callback) {
+ callback.apply(chart, [chart]);
+ }
+ each(chart.callbacks, function (fn) {
+ fn.apply(chart, [chart]);
+ });
+
+
+ // If the chart was rendered outside the top container, put it back in
+ chart.cloneRenderTo(true);
+
+ fireEvent(chart, 'load');
+
+ },
+
+ /**
+ * Creates arrays for spacing and margin from given options.
+ */
+ splashArray: function (target, options) {
+ var oVar = options[target],
+ tArray = isObject(oVar) ? oVar : [oVar, oVar, oVar, oVar];
+
+ return [pick(options[target + 'Top'], tArray[0]),
+ pick(options[target + 'Right'], tArray[1]),
+ pick(options[target + 'Bottom'], tArray[2]),
+ pick(options[target + 'Left'], tArray[3])];
+ }
+ }; // end Chart
+
+ // Hook for exporting module
+ Chart.prototype.callbacks = [];
+
+
+
+ var CenteredSeriesMixin = Highcharts.CenteredSeriesMixin = {
+ /**
+ * Get the center of the pie based on the size and center options relative to the
+ * plot area. Borrowed by the polar and gauge series types.
+ */
+ getCenter: function () {
+
+ var options = this.options,
+ chart = this.chart,
+ slicingRoom = 2 * (options.slicedOffset || 0),
+ handleSlicingRoom,
+ plotWidth = chart.plotWidth - 2 * slicingRoom,
+ plotHeight = chart.plotHeight - 2 * slicingRoom,
+ centerOption = options.center,
+ positions = [pick(centerOption[0], '50%'), pick(centerOption[1], '50%'), options.size || '100%', options.innerSize || 0],
+ smallestSize = mathMin(plotWidth, plotHeight),
+ isPercent;
+
+ return map(positions, function (length, i) {
+ isPercent = /%$/.test(length);
+ handleSlicingRoom = i < 2 || (i === 2 && isPercent);
+ return (isPercent ?
+ // i == 0: centerX, relative to width
+ // i == 1: centerY, relative to height
+ // i == 2: size, relative to smallestSize
+ // i == 4: innerSize, relative to smallestSize
+ [plotWidth, plotHeight, smallestSize, smallestSize][i] *
+ pInt(length) / 100 :
+ length) + (handleSlicingRoom ? slicingRoom : 0);
+ });
+ }
+ };
+
+
+
+ /**
+ * The Point object and prototype. Inheritable and used as base for PiePoint
+ */
+ var Point = function () {};
+ Point.prototype = {
+
+ /**
+ * Initialize the point
+ * @param {Object} series The series object containing this point
+ * @param {Object} options The data in either number, array or object format
+ */
+ init: function (series, options, x) {
+
+ var point = this,
+ colors;
+ point.series = series;
+ point.applyOptions(options, x);
+ point.pointAttr = {};
+
+ if (series.options.colorByPoint) {
+ colors = series.options.colors || series.chart.options.colors;
+ point.color = point.color || colors[series.colorCounter++];
+ // loop back to zero
+ if (series.colorCounter === colors.length) {
+ series.colorCounter = 0;
+ }
+ }
+
+ series.chart.pointCount++;
+ return point;
+ },
+ /**
+ * Apply the options containing the x and y data and possible some extra properties.
+ * This is called on point init or from point.update.
+ *
+ * @param {Object} options
+ */
+ applyOptions: function (options, x) {
+ var point = this,
+ series = point.series,
+ pointValKey = series.options.pointValKey || series.pointValKey;
+
+ options = Point.prototype.optionsToObject.call(this, options);
+
+ // copy options directly to point
+ extend(point, options);
+ point.options = point.options ? extend(point.options, options) : options;
+
+ // For higher dimension series types. For instance, for ranges, point.y is mapped to point.low.
+ if (pointValKey) {
+ point.y = point[pointValKey];
+ }
+
+ // If no x is set by now, get auto incremented value. All points must have an
+ // x value, however the y value can be null to create a gap in the series
+ if (point.x === UNDEFINED && series) {
+ point.x = x === UNDEFINED ? series.autoIncrement() : x;
+ }
+
+ return point;
+ },
+
+ /**
+ * Transform number or array configs into objects
+ */
+ optionsToObject: function (options) {
+ var ret = {},
+ series = this.series,
+ pointArrayMap = series.pointArrayMap || ['y'],
+ valueCount = pointArrayMap.length,
+ firstItemType,
+ i = 0,
+ j = 0;
+
+ if (typeof options === 'number' || options === null) {
+ ret[pointArrayMap[0]] = options;
+
+ } else if (isArray(options)) {
+ // with leading x value
+ if (options.length > valueCount) {
+ firstItemType = typeof options[0];
+ if (firstItemType === 'string') {
+ ret.name = options[0];
+ } else if (firstItemType === 'number') {
+ ret.x = options[0];
+ }
+ i++;
+ }
+ while (j < valueCount) {
+ ret[pointArrayMap[j++]] = options[i++];
+ }
+ } else if (typeof options === 'object') {
+ ret = options;
+
+ // This is the fastest way to detect if there are individual point dataLabels that need
+ // to be considered in drawDataLabels. These can only occur in object configs.
+ if (options.dataLabels) {
+ series._hasPointLabels = true;
+ }
+
+ // Same approach as above for markers
+ if (options.marker) {
+ series._hasPointMarkers = true;
+ }
+ }
+ return ret;
+ },
+
+ /**
+ * Destroy a point to clear memory. Its reference still stays in series.data.
+ */
+ destroy: function () {
+ var point = this,
+ series = point.series,
+ chart = series.chart,
+ hoverPoints = chart.hoverPoints,
+ prop;
+
+ chart.pointCount--;
+
+ if (hoverPoints) {
+ point.setState();
+ erase(hoverPoints, point);
+ if (!hoverPoints.length) {
+ chart.hoverPoints = null;
+ }
+
+ }
+ if (point === chart.hoverPoint) {
+ point.onMouseOut();
+ }
+
+ // remove all events
+ if (point.graphic || point.dataLabel) { // removeEvent and destroyElements are performance expensive
+ removeEvent(point);
+ point.destroyElements();
+ }
+
+ if (point.legendItem) { // pies have legend items
+ chart.legend.destroyItem(point);
+ }
+
+ for (prop in point) {
+ point[prop] = null;
+ }
+
+
+ },
+
+ /**
+ * Destroy SVG elements associated with the point
+ */
+ destroyElements: function () {
+ var point = this,
+ props = ['graphic', 'dataLabel', 'dataLabelUpper', 'group', 'connector', 'shadowGroup'],
+ prop,
+ i = 6;
+ while (i--) {
+ prop = props[i];
+ if (point[prop]) {
+ point[prop] = point[prop].destroy();
+ }
+ }
+ },
+
+ /**
+ * Return the configuration hash needed for the data label and tooltip formatters
+ */
+ getLabelConfig: function () {
+ var point = this;
+ return {
+ x: point.category,
+ y: point.y,
+ key: point.name || point.category,
+ series: point.series,
+ point: point,
+ percentage: point.percentage,
+ total: point.total || point.stackTotal
+ };
+ },
+
+ /**
+ * Extendable method for formatting each point's tooltip line
+ *
+ * @return {String} A string to be concatenated in to the common tooltip text
+ */
+ tooltipFormatter: function (pointFormat) {
+
+ // Insert options for valueDecimals, valuePrefix, and valueSuffix
+ var series = this.series,
+ seriesTooltipOptions = series.tooltipOptions,
+ valueDecimals = pick(seriesTooltipOptions.valueDecimals, ''),
+ valuePrefix = seriesTooltipOptions.valuePrefix || '',
+ valueSuffix = seriesTooltipOptions.valueSuffix || '';
+
+ // Loop over the point array map and replace unformatted values with sprintf formatting markup
+ each(series.pointArrayMap || ['y'], function (key) {
+ key = '{point.' + key; // without the closing bracket
+ if (valuePrefix || valueSuffix) {
+ pointFormat = pointFormat.replace(key + '}', valuePrefix + key + '}' + valueSuffix);
+ }
+ pointFormat = pointFormat.replace(key + '}', key + ':,.' + valueDecimals + 'f}');
+ });
+
+ return format(pointFormat, {
+ point: this,
+ series: this.series
+ });
+ },
+
+ /**
+ * Fire an event on the Point object. Must not be renamed to fireEvent, as this
+ * causes a name clash in MooTools
+ * @param {String} eventType
+ * @param {Object} eventArgs Additional event arguments
+ * @param {Function} defaultFunction Default event handler
+ */
+ firePointEvent: function (eventType, eventArgs, defaultFunction) {
+ var point = this,
+ series = this.series,
+ seriesOptions = series.options;
+
+ // load event handlers on demand to save time on mouseover/out
+ if (seriesOptions.point.events[eventType] || (point.options && point.options.events && point.options.events[eventType])) {
+ this.importEvents();
+ }
+
+ // add default handler if in selection mode
+ if (eventType === 'click' && seriesOptions.allowPointSelect) {
+ defaultFunction = function (event) {
+ // Control key is for Windows, meta (= Cmd key) for Mac, Shift for Opera
+ point.select(null, event.ctrlKey || event.metaKey || event.shiftKey);
+ };
+ }
+
+ fireEvent(this, eventType, eventArgs, defaultFunction);
+ }
+ };
+
+ /**
+ * @classDescription The base function which all other series types inherit from. The data in the series is stored
+ * in various arrays.
+ *
+ * - First, series.options.data contains all the original config options for
+ * each point whether added by options or methods like series.addPoint.
+ * - Next, series.data contains those values converted to points, but in case the series data length
+ * exceeds the cropThreshold, or if the data is grouped, series.data doesn't contain all the points. It
+ * only contains the points that have been created on demand.
+ * - Then there's series.points that contains all currently visible point objects. In case of cropping,
+ * the cropped-away points are not part of this array. The series.points array starts at series.cropStart
+ * compared to series.data and series.options.data. If however the series data is grouped, these can't
+ * be correlated one to one.
+ * - series.xData and series.processedXData contain clean x values, equivalent to series.data and series.points.
+ * - series.yData and series.processedYData contain clean x values, equivalent to series.data and series.points.
+ *
+ * @param {Object} chart
+ * @param {Object} options
+ */
+ var Series = function () {};
+
+ Series.prototype = {
+
+ isCartesian: true,
+ type: 'line',
+ pointClass: Point,
+ sorted: true, // requires the data to be sorted
+ requireSorting: true,
+ pointAttrToOptions: { // mapping between SVG attributes and the corresponding options
+ stroke: 'lineColor',
+ 'stroke-width': 'lineWidth',
+ fill: 'fillColor',
+ r: 'radius'
+ },
+ axisTypes: ['xAxis', 'yAxis'],
+ colorCounter: 0,
+ parallelArrays: ['x', 'y'], // each point's x and y values are stored in this.xData and this.yData
+ init: function (chart, options) {
+ var series = this,
+ eventType,
+ events,
+ chartSeries = chart.series,
+ sortByIndex = function (a, b) {
+ return pick(a.options.index, a._i) - pick(b.options.index, b._i);
+ };
+
+ series.chart = chart;
+ series.options = options = series.setOptions(options); // merge with plotOptions
+ series.linkedSeries = [];
+
+ // bind the axes
+ series.bindAxes();
+
+ // set some variables
+ extend(series, {
+ name: options.name,
+ state: NORMAL_STATE,
+ pointAttr: {},
+ visible: options.visible !== false, // true by default
+ selected: options.selected === true // false by default
+ });
+
+ // special
+ if (useCanVG) {
+ options.animation = false;
+ }
+
+ // register event listeners
+ events = options.events;
+ for (eventType in events) {
+ addEvent(series, eventType, events[eventType]);
+ }
+ if (
+ (events && events.click) ||
+ (options.point && options.point.events && options.point.events.click) ||
+ options.allowPointSelect
+ ) {
+ chart.runTrackerClick = true;
+ }
+
+ series.getColor();
+ series.getSymbol();
+
+ // Set the data
+ each(series.parallelArrays, function (key) {
+ series[key + 'Data'] = [];
+ });
+ series.setData(options.data, false);
+
+ // Mark cartesian
+ if (series.isCartesian) {
+ chart.hasCartesianSeries = true;
+ }
+
+ // Register it in the chart
+ chartSeries.push(series);
+ series._i = chartSeries.length - 1;
+
+ // Sort series according to index option (#248, #1123, #2456)
+ stableSort(chartSeries, sortByIndex);
+ if (this.yAxis) {
+ stableSort(this.yAxis.series, sortByIndex);
+ }
+
+ each(chartSeries, function (series, i) {
+ series.index = i;
+ series.name = series.name || 'Series ' + (i + 1);
+ });
+
+ },
+
+ /**
+ * Set the xAxis and yAxis properties of cartesian series, and register the series
+ * in the axis.series array
+ */
+ bindAxes: function () {
+ var series = this,
+ seriesOptions = series.options,
+ chart = series.chart,
+ axisOptions;
+
+ each(series.axisTypes || [], function (AXIS) { // repeat for xAxis and yAxis
+
+ each(chart[AXIS], function (axis) { // loop through the chart's axis objects
+ axisOptions = axis.options;
+
+ // apply if the series xAxis or yAxis option mathches the number of the
+ // axis, or if undefined, use the first axis
+ if ((seriesOptions[AXIS] === axisOptions.index) ||
+ (seriesOptions[AXIS] !== UNDEFINED && seriesOptions[AXIS] === axisOptions.id) ||
+ (seriesOptions[AXIS] === UNDEFINED && axisOptions.index === 0)) {
+
+ // register this series in the axis.series lookup
+ axis.series.push(series);
+
+ // set this series.xAxis or series.yAxis reference
+ series[AXIS] = axis;
+
+ // mark dirty for redraw
+ axis.isDirty = true;
+ }
+ });
+
+ // The series needs an X and an Y axis
+ if (!series[AXIS] && series.optionalAxis !== AXIS) {
+ error(18, true);
+ }
+
+ });
+ },
+
+ /**
+ * For simple series types like line and column, the data values are held in arrays like
+ * xData and yData for quick lookup to find extremes and more. For multidimensional series
+ * like bubble and map, this can be extended with arrays like zData and valueData by
+ * adding to the series.parallelArrays array.
+ */
+ updateParallelArrays: function (point, i) {
+ var series = point.series,
+ args = arguments,
+ fn = typeof i === 'number' ?
+ // Insert the value in the given position
+ function (key) {
+ var val = key === 'y' && series.toYData ? series.toYData(point) : point[key];
+ series[key + 'Data'][i] = val;
+ } :
+ // Apply the method specified in i with the following arguments as arguments
+ function (key) {
+ Array.prototype[i].apply(series[key + 'Data'], Array.prototype.slice.call(args, 2));
+ };
+
+ each(series.parallelArrays, fn);
+ },
+
+ /**
+ * Return an auto incremented x value based on the pointStart and pointInterval options.
+ * This is only used if an x value is not given for the point that calls autoIncrement.
+ */
+ autoIncrement: function () {
+ var series = this,
+ options = series.options,
+ xIncrement = series.xIncrement;
+
+ xIncrement = pick(xIncrement, options.pointStart, 0);
+
+ series.pointInterval = pick(series.pointInterval, options.pointInterval, 1);
+
+ series.xIncrement = xIncrement + series.pointInterval;
+ return xIncrement;
+ },
+
+ /**
+ * Divide the series data into segments divided by null values.
+ */
+ getSegments: function () {
+ var series = this,
+ lastNull = -1,
+ segments = [],
+ i,
+ points = series.points,
+ pointsLength = points.length;
+
+ if (pointsLength) { // no action required for []
+
+ // if connect nulls, just remove null points
+ if (series.options.connectNulls) {
+ i = pointsLength;
+ while (i--) {
+ if (points[i].y === null) {
+ points.splice(i, 1);
+ }
+ }
+ if (points.length) {
+ segments = [points];
+ }
+
+ // else, split on null points
+ } else {
+ each(points, function (point, i) {
+ if (point.y === null) {
+ if (i > lastNull + 1) {
+ segments.push(points.slice(lastNull + 1, i));
+ }
+ lastNull = i;
+ } else if (i === pointsLength - 1) { // last value
+ segments.push(points.slice(lastNull + 1, i + 1));
+ }
+ });
+ }
+ }
+
+ // register it
+ series.segments = segments;
+ },
+
+ /**
+ * Set the series options by merging from the options tree
+ * @param {Object} itemOptions
+ */
+ setOptions: function (itemOptions) {
+ var chart = this.chart,
+ chartOptions = chart.options,
+ plotOptions = chartOptions.plotOptions,
+ userOptions = chart.userOptions || {},
+ userPlotOptions = userOptions.plotOptions || {},
+ typeOptions = plotOptions[this.type],
+ options;
+
+ this.userOptions = itemOptions;
+
+ options = merge(
+ typeOptions,
+ plotOptions.series,
+ itemOptions
+ );
+
+ // The tooltip options are merged between global and series specific options
+ this.tooltipOptions = merge(
+ defaultOptions.tooltip,
+ defaultOptions.plotOptions[this.type].tooltip,
+ userOptions.tooltip,
+ userPlotOptions.series && userPlotOptions.series.tooltip,
+ userPlotOptions[this.type] && userPlotOptions[this.type].tooltip,
+ itemOptions.tooltip
+ );
+
+ // Delete marker object if not allowed (#1125)
+ if (typeOptions.marker === null) {
+ delete options.marker;
+ }
+
+ return options;
+
+ },
+
+ getCyclic: function (prop, value, defaults) {
+ var i,
+ userOptions = this.userOptions,
+ indexName = '_' + prop + 'Index',
+ counterName = prop + 'Counter';
+
+ if (!value) {
+ if (defined(userOptions[indexName])) { // after Series.update()
+ i = userOptions[indexName];
+ } else {
+ userOptions[indexName] = i = this.chart[counterName] % defaults.length;
+ this.chart[counterName] += 1;
+ }
+ value = defaults[i];
+ }
+ this[prop] = value;
+ },
+
+ /**
+ * Get the series' color
+ */
+ getColor: function () {
+ if (!this.options.colorByPoint) {
+ this.getCyclic('color', this.options.color || defaultPlotOptions[this.type].color, this.chart.options.colors);
+ }
+ },
+ /**
+ * Get the series' symbol
+ */
+ getSymbol: function () {
+ var seriesMarkerOption = this.options.marker;
+
+ this.getCyclic('symbol', seriesMarkerOption.symbol, this.chart.options.symbols);
+
+ // don't substract radius in image symbols (#604)
+ if (/^url/.test(this.symbol)) {
+ seriesMarkerOption.radius = 0;
+ }
+ },
+
+ drawLegendSymbol: LegendSymbolMixin.drawLineMarker,
+
+ /**
+ * Replace the series data with a new set of data
+ * @param {Object} data
+ * @param {Object} redraw
+ */
+ setData: function (data, redraw, animation, updatePoints) {
+ var series = this,
+ oldData = series.points,
+ oldDataLength = (oldData && oldData.length) || 0,
+ dataLength,
+ options = series.options,
+ chart = series.chart,
+ firstPoint = null,
+ xAxis = series.xAxis,
+ hasCategories = xAxis && !!xAxis.categories,
+ tooltipPoints = series.tooltipPoints,
+ i,
+ turboThreshold = options.turboThreshold,
+ pt,
+ xData = this.xData,
+ yData = this.yData,
+ pointArrayMap = series.pointArrayMap,
+ valueCount = pointArrayMap && pointArrayMap.length;
+
+ data = data || [];
+ dataLength = data.length;
+ redraw = pick(redraw, true);
+
+ // If the point count is the same as is was, just run Point.update which is
+ // cheaper, allows animation, and keeps references to points.
+ if (updatePoints !== false && dataLength && oldDataLength === dataLength && !series.cropped && !series.hasGroupedData) {
+ each(data, function (point, i) {
+ oldData[i].update(point, false, null, false);
+ });
+
+ } else {
+
+ // Reset properties
+ series.xIncrement = null;
+ series.pointRange = hasCategories ? 1 : options.pointRange;
+
+ series.colorCounter = 0; // for series with colorByPoint (#1547)
+
+ // Update parallel arrays
+ each(this.parallelArrays, function (key) {
+ series[key + 'Data'].length = 0;
+ });
+
+ // In turbo mode, only one- or twodimensional arrays of numbers are allowed. The
+ // first value is tested, and we assume that all the rest are defined the same
+ // way. Although the 'for' loops are similar, they are repeated inside each
+ // if-else conditional for max performance.
+ if (turboThreshold && dataLength > turboThreshold) {
+
+ // find the first non-null point
+ i = 0;
+ while (firstPoint === null && i < dataLength) {
+ firstPoint = data[i];
+ i++;
+ }
+
+
+ if (isNumber(firstPoint)) { // assume all points are numbers
+ var x = pick(options.pointStart, 0),
+ pointInterval = pick(options.pointInterval, 1);
+
+ for (i = 0; i < dataLength; i++) {
+ xData[i] = x;
+ yData[i] = data[i];
+ x += pointInterval;
+ }
+ series.xIncrement = x;
+ } else if (isArray(firstPoint)) { // assume all points are arrays
+ if (valueCount) { // [x, low, high] or [x, o, h, l, c]
+ for (i = 0; i < dataLength; i++) {
+ pt = data[i];
+ xData[i] = pt[0];
+ yData[i] = pt.slice(1, valueCount + 1);
+ }
+ } else { // [x, y]
+ for (i = 0; i < dataLength; i++) {
+ pt = data[i];
+ xData[i] = pt[0];
+ yData[i] = pt[1];
+ }
+ }
+ } else {
+ error(12); // Highcharts expects configs to be numbers or arrays in turbo mode
+ }
+ } else {
+ for (i = 0; i < dataLength; i++) {
+ if (data[i] !== UNDEFINED) { // stray commas in oldIE
+ pt = { series: series };
+ series.pointClass.prototype.applyOptions.apply(pt, [data[i]]);
+ series.updateParallelArrays(pt, i);
+ if (hasCategories && pt.name) {
+ xAxis.names[pt.x] = pt.name; // #2046
+ }
+ }
+ }
+ }
+
+ // Forgetting to cast strings to numbers is a common caveat when handling CSV or JSON
+ if (isString(yData[0])) {
+ error(14, true);
+ }
+
+ series.data = [];
+ series.options.data = data;
+ //series.zData = zData;
+
+ // destroy old points
+ i = oldDataLength;
+ while (i--) {
+ if (oldData[i] && oldData[i].destroy) {
+ oldData[i].destroy();
+ }
+ }
+ if (tooltipPoints) { // #2594
+ tooltipPoints.length = 0;
+ }
+
+ // reset minRange (#878)
+ if (xAxis) {
+ xAxis.minRange = xAxis.userMinRange;
+ }
+
+ // redraw
+ series.isDirty = series.isDirtyData = chart.isDirtyBox = true;
+ animation = false;
+ }
+
+ if (redraw) {
+ chart.redraw(animation);
+ }
+ },
+
+ /**
+ * Process the data by cropping away unused data points if the series is longer
+ * than the crop threshold. This saves computing time for lage series.
+ */
+ processData: function (force) {
+ var series = this,
+ processedXData = series.xData, // copied during slice operation below
+ processedYData = series.yData,
+ dataLength = processedXData.length,
+ croppedData,
+ cropStart = 0,
+ cropped,
+ distance,
+ closestPointRange,
+ xAxis = series.xAxis,
+ i, // loop variable
+ options = series.options,
+ cropThreshold = options.cropThreshold,
+ activePointCount = 0,
+ isCartesian = series.isCartesian,
+ xExtremes,
+ min,
+ max;
+
+ // If the series data or axes haven't changed, don't go through this. Return false to pass
+ // the message on to override methods like in data grouping.
+ if (isCartesian && !series.isDirty && !xAxis.isDirty && !series.yAxis.isDirty && !force) {
+ return false;
+ }
+
+ if (xAxis) {
+ xExtremes = xAxis.getExtremes(); // corrected for log axis (#3053)
+ min = xExtremes.min;
+ max = xExtremes.max;
+ }
+
+ // optionally filter out points outside the plot area
+ if (isCartesian && series.sorted && (!cropThreshold || dataLength > cropThreshold || series.forceCrop)) {
+
+ // it's outside current extremes
+ if (processedXData[dataLength - 1] < min || processedXData[0] > max) {
+ processedXData = [];
+ processedYData = [];
+
+ // only crop if it's actually spilling out
+ } else if (processedXData[0] < min || processedXData[dataLength - 1] > max) {
+ croppedData = this.cropData(series.xData, series.yData, min, max);
+ processedXData = croppedData.xData;
+ processedYData = croppedData.yData;
+ cropStart = croppedData.start;
+ cropped = true;
+ activePointCount = processedXData.length;
+ }
+ }
+
+
+ // Find the closest distance between processed points
+ for (i = processedXData.length - 1; i >= 0; i--) {
+ distance = processedXData[i] - processedXData[i - 1];
+
+ if (!cropped && processedXData[i] > min && processedXData[i] < max) {
+ activePointCount++;
+ }
+
+ if (distance > 0 && (closestPointRange === UNDEFINED || distance < closestPointRange)) {
+ closestPointRange = distance;
+
+ // Unsorted data is not supported by the line tooltip, as well as data grouping and
+ // navigation in Stock charts (#725) and width calculation of columns (#1900)
+ } else if (distance < 0 && series.requireSorting) {
+ error(15);
+ }
+ }
+
+ // Record the properties
+ series.cropped = cropped; // undefined or true
+ series.cropStart = cropStart;
+ series.processedXData = processedXData;
+ series.processedYData = processedYData;
+ series.activePointCount = activePointCount;
+
+ if (options.pointRange === null) { // null means auto, as for columns, candlesticks and OHLC
+ series.pointRange = closestPointRange || 1;
+ }
+ series.closestPointRange = closestPointRange;
+
+ },
+
+ /**
+ * Iterate over xData and crop values between min and max. Returns object containing crop start/end
+ * cropped xData with corresponding part of yData, dataMin and dataMax within the cropped range
+ */
+ cropData: function (xData, yData, min, max) {
+ var dataLength = xData.length,
+ cropStart = 0,
+ cropEnd = dataLength,
+ cropShoulder = pick(this.cropShoulder, 1), // line-type series need one point outside
+ i;
+
+ // iterate up to find slice start
+ for (i = 0; i < dataLength; i++) {
+ if (xData[i] >= min) {
+ cropStart = mathMax(0, i - cropShoulder);
+ break;
+ }
+ }
+
+ // proceed to find slice end
+ for (; i < dataLength; i++) {
+ if (xData[i] > max) {
+ cropEnd = i + cropShoulder;
+ break;
+ }
+ }
+
+ return {
+ xData: xData.slice(cropStart, cropEnd),
+ yData: yData.slice(cropStart, cropEnd),
+ start: cropStart,
+ end: cropEnd
+ };
+ },
+
+
+ /**
+ * Generate the data point after the data has been processed by cropping away
+ * unused points and optionally grouped in Highcharts Stock.
+ */
+ generatePoints: function () {
+ var series = this,
+ options = series.options,
+ dataOptions = options.data,
+ data = series.data,
+ dataLength,
+ processedXData = series.processedXData,
+ processedYData = series.processedYData,
+ pointClass = series.pointClass,
+ processedDataLength = processedXData.length,
+ cropStart = series.cropStart || 0,
+ cursor,
+ hasGroupedData = series.hasGroupedData,
+ point,
+ points = [],
+ i;
+
+ if (!data && !hasGroupedData) {
+ var arr = [];
+ arr.length = dataOptions.length;
+ data = series.data = arr;
+ }
+
+ for (i = 0; i < processedDataLength; i++) {
+ cursor = cropStart + i;
+ if (!hasGroupedData) {
+ if (data[cursor]) {
+ point = data[cursor];
+ } else if (dataOptions[cursor] !== UNDEFINED) { // #970
+ data[cursor] = point = (new pointClass()).init(series, dataOptions[cursor], processedXData[i]);
+ }
+ points[i] = point;
+ } else {
+ // splat the y data in case of ohlc data array
+ points[i] = (new pointClass()).init(series, [processedXData[i]].concat(splat(processedYData[i])));
+ }
+ points[i].index = cursor; // For faster access in Point.update
+ }
+
+ // Hide cropped-away points - this only runs when the number of points is above cropThreshold, or when
+ // swithching view from non-grouped data to grouped data (#637)
+ if (data && (processedDataLength !== (dataLength = data.length) || hasGroupedData)) {
+ for (i = 0; i < dataLength; i++) {
+ if (i === cropStart && !hasGroupedData) { // when has grouped data, clear all points
+ i += processedDataLength;
+ }
+ if (data[i]) {
+ data[i].destroyElements();
+ data[i].plotX = UNDEFINED; // #1003
+ }
+ }
+ }
+
+ series.data = data;
+ series.points = points;
+ },
+
+ /**
+ * Calculate Y extremes for visible data
+ */
+ getExtremes: function (yData) {
+ var xAxis = this.xAxis,
+ yAxis = this.yAxis,
+ xData = this.processedXData,
+ yDataLength,
+ activeYData = [],
+ activeCounter = 0,
+ xExtremes = xAxis.getExtremes(), // #2117, need to compensate for log X axis
+ xMin = xExtremes.min,
+ xMax = xExtremes.max,
+ validValue,
+ withinRange,
+ dataMin,
+ dataMax,
+ x,
+ y,
+ i,
+ j;
+
+ yData = yData || this.stackedYData || this.processedYData;
+ yDataLength = yData.length;
+
+ for (i = 0; i < yDataLength; i++) {
+
+ x = xData[i];
+ y = yData[i];
+
+ // For points within the visible range, including the first point outside the
+ // visible range, consider y extremes
+ validValue = y !== null && y !== UNDEFINED && (!yAxis.isLog || (y.length || y > 0));
+ withinRange = this.getExtremesFromAll || this.cropped || ((xData[i + 1] || x) >= xMin &&
+ (xData[i - 1] || x) <= xMax);
+
+ if (validValue && withinRange) {
+
+ j = y.length;
+ if (j) { // array, like ohlc or range data
+ while (j--) {
+ if (y[j] !== null) {
+ activeYData[activeCounter++] = y[j];
+ }
+ }
+ } else {
+ activeYData[activeCounter++] = y;
+ }
+ }
+ }
+ this.dataMin = pick(dataMin, arrayMin(activeYData));
+ this.dataMax = pick(dataMax, arrayMax(activeYData));
+ },
+
+ /**
+ * Translate data points from raw data values to chart specific positioning data
+ * needed later in drawPoints, drawGraph and drawTracker.
+ */
+ translate: function () {
+ if (!this.processedXData) { // hidden series
+ this.processData();
+ }
+ this.generatePoints();
+ var series = this,
+ options = series.options,
+ stacking = options.stacking,
+ xAxis = series.xAxis,
+ categories = xAxis.categories,
+ yAxis = series.yAxis,
+ points = series.points,
+ dataLength = points.length,
+ hasModifyValue = !!series.modifyValue,
+ i,
+ pointPlacement = options.pointPlacement,
+ dynamicallyPlaced = pointPlacement === 'between' || isNumber(pointPlacement),
+ threshold = options.threshold;
+
+ // Translate each point
+ for (i = 0; i < dataLength; i++) {
+ var point = points[i],
+ xValue = point.x,
+ yValue = point.y,
+ yBottom = point.low,
+ stack = stacking && yAxis.stacks[(series.negStacks && yValue < threshold ? '-' : '') + series.stackKey],
+ pointStack,
+ stackValues;
+
+ // Discard disallowed y values for log axes
+ if (yAxis.isLog && yValue <= 0) {
+ point.y = yValue = null;
+ error(10);
+ }
+
+ // Get the plotX translation
+ point.plotX = xAxis.translate(xValue, 0, 0, 0, 1, pointPlacement, this.type === 'flags'); // Math.round fixes #591
+
+
+ // Calculate the bottom y value for stacked series
+ if (stacking && series.visible && stack && stack[xValue]) {
+
+ pointStack = stack[xValue];
+ stackValues = pointStack.points[series.index + ',' + i];
+ yBottom = stackValues[0];
+ yValue = stackValues[1];
+
+ if (yBottom === 0) {
+ yBottom = pick(threshold, yAxis.min);
+ }
+ if (yAxis.isLog && yBottom <= 0) { // #1200, #1232
+ yBottom = null;
+ }
+
+ point.total = point.stackTotal = pointStack.total;
+ point.percentage = pointStack.total && (point.y / pointStack.total * 100);
+ point.stackY = yValue;
+
+ // Place the stack label
+ pointStack.setOffset(series.pointXOffset || 0, series.barW || 0);
+
+ }
+
+ // Set translated yBottom or remove it
+ point.yBottom = defined(yBottom) ?
+ yAxis.translate(yBottom, 0, 1, 0, 1) :
+ null;
+
+ // general hook, used for Highstock compare mode
+ if (hasModifyValue) {
+ yValue = series.modifyValue(yValue, point);
+ }
+
+ // Set the the plotY value, reset it for redraws
+ point.plotY = (typeof yValue === 'number' && yValue !== Infinity) ?
+ //mathRound(yAxis.translate(yValue, 0, 1, 0, 1) * 10) / 10 : // Math.round fixes #591
+ yAxis.translate(yValue, 0, 1, 0, 1) :
+ UNDEFINED;
+
+ // Set client related positions for mouse tracking
+ point.clientX = dynamicallyPlaced ? xAxis.translate(xValue, 0, 0, 0, 1) : point.plotX; // #1514
+
+ point.negative = point.y < (threshold || 0);
+
+ // some API data
+ point.category = categories && categories[point.x] !== UNDEFINED ?
+ categories[point.x] : point.x;
+
+ }
+
+ // now that we have the cropped data, build the segments
+ series.getSegments();
+ },
+
+ /**
+ * Animate in the series
+ */
+ animate: function (init) {
+ var series = this,
+ chart = series.chart,
+ renderer = chart.renderer,
+ clipRect,
+ markerClipRect,
+ animation = series.options.animation,
+ clipBox = series.clipBox || chart.clipBox,
+ inverted = chart.inverted,
+ sharedClipKey;
+
+ // Animation option is set to true
+ if (animation && !isObject(animation)) {
+ animation = defaultPlotOptions[series.type].animation;
+ }
+ sharedClipKey = ['_sharedClip', animation.duration, animation.easing, clipBox.height].join(',');
+
+ // Initialize the animation. Set up the clipping rectangle.
+ if (init) {
+
+ // If a clipping rectangle with the same properties is currently present in the chart, use that.
+ clipRect = chart[sharedClipKey];
+ markerClipRect = chart[sharedClipKey + 'm'];
+ if (!clipRect) {
+ chart[sharedClipKey] = clipRect = renderer.clipRect(
+ extend(clipBox, { width: 0 })
+ );
+
+ chart[sharedClipKey + 'm'] = markerClipRect = renderer.clipRect(
+ -99, // include the width of the first marker
+ inverted ? -chart.plotLeft : -chart.plotTop,
+ 99,
+ inverted ? chart.chartWidth : chart.chartHeight
+ );
+ }
+ series.group.clip(clipRect);
+ series.markerGroup.clip(markerClipRect);
+ series.sharedClipKey = sharedClipKey;
+
+ // Run the animation
+ } else {
+ clipRect = chart[sharedClipKey];
+ if (clipRect) {
+ clipRect.animate({
+ width: chart.plotSizeX
+ }, animation);
+ }
+ if (chart[sharedClipKey + 'm']) {
+ chart[sharedClipKey + 'm'].animate({
+ width: chart.plotSizeX + 99
+ }, animation);
+ }
+
+ // Delete this function to allow it only once
+ series.animate = null;
+
+ }
+ },
+
+ /**
+ * This runs after animation to land on the final plot clipping
+ */
+ afterAnimate: function () {
+ var chart = this.chart,
+ sharedClipKey = this.sharedClipKey,
+ group = this.group,
+ clipBox = this.clipBox;
+
+ if (group && this.options.clip !== false) {
+ if (!sharedClipKey || !clipBox) {
+ group.clip(clipBox ? chart.renderer.clipRect(clipBox) : chart.clipRect);
+ }
+ this.markerGroup.clip(); // no clip
+ }
+
+ fireEvent(this, 'afterAnimate');
+
+ // Remove the shared clipping rectancgle when all series are shown
+ setTimeout(function () {
+ if (sharedClipKey && chart[sharedClipKey]) {
+ if (!clipBox) {
+ chart[sharedClipKey] = chart[sharedClipKey].destroy();
+ }
+ if (chart[sharedClipKey + 'm']) {
+ chart[sharedClipKey + 'm'] = chart[sharedClipKey + 'm'].destroy();
+ }
+ }
+ }, 100);
+ },
+
+ /**
+ * Draw the markers
+ */
+ drawPoints: function () {
+ var series = this,
+ pointAttr,
+ points = series.points,
+ chart = series.chart,
+ plotX,
+ plotY,
+ i,
+ point,
+ radius,
+ symbol,
+ isImage,
+ graphic,
+ options = series.options,
+ seriesMarkerOptions = options.marker,
+ seriesPointAttr = series.pointAttr[''],
+ pointMarkerOptions,
+ hasPointMarker,
+ enabled,
+ isInside,
+ markerGroup = series.markerGroup,
+ globallyEnabled = pick(
+ seriesMarkerOptions.enabled,
+ !series.requireSorting || series.activePointCount < (0.5 * series.xAxis.len / seriesMarkerOptions.radius)
+ );
+
+ if (seriesMarkerOptions.enabled !== false || series._hasPointMarkers) {
+
+ i = points.length;
+ while (i--) {
+ point = points[i];
+ plotX = mathFloor(point.plotX); // #1843
+ plotY = point.plotY;
+ graphic = point.graphic;
+ pointMarkerOptions = point.marker || {};
+ hasPointMarker = !!point.marker;
+ enabled = (globallyEnabled && pointMarkerOptions.enabled === UNDEFINED) || pointMarkerOptions.enabled;
+ isInside = chart.isInsidePlot(mathRound(plotX), plotY, chart.inverted); // #1858
+
+ // only draw the point if y is defined
+ if (enabled && plotY !== UNDEFINED && !isNaN(plotY) && point.y !== null) {
+
+ // shortcuts
+ pointAttr = point.pointAttr[point.selected ? SELECT_STATE : NORMAL_STATE] || seriesPointAttr;
+ radius = pointAttr.r;
+ symbol = pick(pointMarkerOptions.symbol, series.symbol);
+ isImage = symbol.indexOf('url') === 0;
+
+ if (graphic) { // update
+ graphic[isInside ? 'show' : 'hide'](true) // Since the marker group isn't clipped, each individual marker must be toggled
+ .animate(extend({
+ x: plotX - radius,
+ y: plotY - radius
+ }, graphic.symbolName ? { // don't apply to image symbols #507
+ width: 2 * radius,
+ height: 2 * radius
+ } : {}));
+ } else if (isInside && (radius > 0 || isImage)) {
+ point.graphic = graphic = chart.renderer.symbol(
+ symbol,
+ plotX - radius,
+ plotY - radius,
+ 2 * radius,
+ 2 * radius,
+ hasPointMarker ? pointMarkerOptions : seriesMarkerOptions
+ )
+ .attr(pointAttr)
+ .add(markerGroup);
+ }
+
+ } else if (graphic) {
+ point.graphic = graphic.destroy(); // #1269
+ }
+ }
+ }
+
+ },
+
+ /**
+ * Convert state properties from API naming conventions to SVG attributes
+ *
+ * @param {Object} options API options object
+ * @param {Object} base1 SVG attribute object to inherit from
+ * @param {Object} base2 Second level SVG attribute object to inherit from
+ */
+ convertAttribs: function (options, base1, base2, base3) {
+ var conversion = this.pointAttrToOptions,
+ attr,
+ option,
+ obj = {};
+
+ options = options || {};
+ base1 = base1 || {};
+ base2 = base2 || {};
+ base3 = base3 || {};
+
+ for (attr in conversion) {
+ option = conversion[attr];
+ obj[attr] = pick(options[option], base1[attr], base2[attr], base3[attr]);
+ }
+ return obj;
+ },
+
+ /**
+ * Get the state attributes. Each series type has its own set of attributes
+ * that are allowed to change on a point's state change. Series wide attributes are stored for
+ * all series, and additionally point specific attributes are stored for all
+ * points with individual marker options. If such options are not defined for the point,
+ * a reference to the series wide attributes is stored in point.pointAttr.
+ */
+ getAttribs: function () {
+ var series = this,
+ seriesOptions = series.options,
+ normalOptions = defaultPlotOptions[series.type].marker ? seriesOptions.marker : seriesOptions,
+ stateOptions = normalOptions.states,
+ stateOptionsHover = stateOptions[HOVER_STATE],
+ pointStateOptionsHover,
+ seriesColor = series.color,
+ normalDefaults = {
+ stroke: seriesColor,
+ fill: seriesColor
+ },
+ points = series.points || [], // #927
+ i,
+ point,
+ seriesPointAttr = [],
+ pointAttr,
+ pointAttrToOptions = series.pointAttrToOptions,
+ hasPointSpecificOptions = series.hasPointSpecificOptions,
+ negativeColor = seriesOptions.negativeColor,
+ defaultLineColor = normalOptions.lineColor,
+ defaultFillColor = normalOptions.fillColor,
+ turboThreshold = seriesOptions.turboThreshold,
+ attr,
+ key;
+
+ // series type specific modifications
+ if (seriesOptions.marker) { // line, spline, area, areaspline, scatter
+
+ // if no hover radius is given, default to normal radius + 2
+ stateOptionsHover.radius = stateOptionsHover.radius || normalOptions.radius + stateOptionsHover.radiusPlus;
+ stateOptionsHover.lineWidth = stateOptionsHover.lineWidth || normalOptions.lineWidth + stateOptionsHover.lineWidthPlus;
+
+ } else { // column, bar, pie
+
+ // if no hover color is given, brighten the normal color
+ stateOptionsHover.color = stateOptionsHover.color ||
+ Color(stateOptionsHover.color || seriesColor)
+ .brighten(stateOptionsHover.brightness).get();
+ }
+
+ // general point attributes for the series normal state
+ seriesPointAttr[NORMAL_STATE] = series.convertAttribs(normalOptions, normalDefaults);
+
+ // HOVER_STATE and SELECT_STATE states inherit from normal state except the default radius
+ each([HOVER_STATE, SELECT_STATE], function (state) {
+ seriesPointAttr[state] =
+ series.convertAttribs(stateOptions[state], seriesPointAttr[NORMAL_STATE]);
+ });
+
+ // set it
+ series.pointAttr = seriesPointAttr;
+
+
+ // Generate the point-specific attribute collections if specific point
+ // options are given. If not, create a referance to the series wide point
+ // attributes
+ i = points.length;
+ if (!turboThreshold || i < turboThreshold || hasPointSpecificOptions) {
+ while (i--) {
+ point = points[i];
+ normalOptions = (point.options && point.options.marker) || point.options;
+ if (normalOptions && normalOptions.enabled === false) {
+ normalOptions.radius = 0;
+ }
+
+ if (point.negative && negativeColor) {
+ point.color = point.fillColor = negativeColor;
+ }
+
+ hasPointSpecificOptions = seriesOptions.colorByPoint || point.color; // #868
+
+ // check if the point has specific visual options
+ if (point.options) {
+ for (key in pointAttrToOptions) {
+ if (defined(normalOptions[pointAttrToOptions[key]])) {
+ hasPointSpecificOptions = true;
+ }
+ }
+ }
+
+ // a specific marker config object is defined for the individual point:
+ // create it's own attribute collection
+ if (hasPointSpecificOptions) {
+ normalOptions = normalOptions || {};
+ pointAttr = [];
+ stateOptions = normalOptions.states || {}; // reassign for individual point
+ pointStateOptionsHover = stateOptions[HOVER_STATE] = stateOptions[HOVER_STATE] || {};
+
+ // Handle colors for column and pies
+ if (!seriesOptions.marker) { // column, bar, point
+ // If no hover color is given, brighten the normal color. #1619, #2579
+ pointStateOptionsHover.color = pointStateOptionsHover.color || (!point.options.color && stateOptionsHover.color) ||
+ Color(point.color)
+ .brighten(pointStateOptionsHover.brightness || stateOptionsHover.brightness)
+ .get();
+ }
+
+ // normal point state inherits series wide normal state
+ attr = { color: point.color }; // #868
+ if (!defaultFillColor) { // Individual point color or negative color markers (#2219)
+ attr.fillColor = point.color;
+ }
+ if (!defaultLineColor) {
+ attr.lineColor = point.color; // Bubbles take point color, line markers use white
+ }
+ pointAttr[NORMAL_STATE] = series.convertAttribs(extend(attr, normalOptions), seriesPointAttr[NORMAL_STATE]);
+
+ // inherit from point normal and series hover
+ pointAttr[HOVER_STATE] = series.convertAttribs(
+ stateOptions[HOVER_STATE],
+ seriesPointAttr[HOVER_STATE],
+ pointAttr[NORMAL_STATE]
+ );
+
+ // inherit from point normal and series hover
+ pointAttr[SELECT_STATE] = series.convertAttribs(
+ stateOptions[SELECT_STATE],
+ seriesPointAttr[SELECT_STATE],
+ pointAttr[NORMAL_STATE]
+ );
+
+
+ // no marker config object is created: copy a reference to the series-wide
+ // attribute collection
+ } else {
+ pointAttr = seriesPointAttr;
+ }
+
+ point.pointAttr = pointAttr;
+ }
+ }
+ },
+
+ /**
+ * Clear DOM objects and free up memory
+ */
+ destroy: function () {
+ var series = this,
+ chart = series.chart,
+ issue134 = /AppleWebKit\/533/.test(userAgent),
+ destroy,
+ i,
+ data = series.data || [],
+ point,
+ prop,
+ axis;
+
+ // add event hook
+ fireEvent(series, 'destroy');
+
+ // remove all events
+ removeEvent(series);
+
+ // erase from axes
+ each(series.axisTypes || [], function (AXIS) {
+ axis = series[AXIS];
+ if (axis) {
+ erase(axis.series, series);
+ axis.isDirty = axis.forceRedraw = true;
+ }
+ });
+
+ // remove legend items
+ if (series.legendItem) {
+ series.chart.legend.destroyItem(series);
+ }
+
+ // destroy all points with their elements
+ i = data.length;
+ while (i--) {
+ point = data[i];
+ if (point && point.destroy) {
+ point.destroy();
+ }
+ }
+ series.points = null;
+
+ // Clear the animation timeout if we are destroying the series during initial animation
+ clearTimeout(series.animationTimeout);
+
+ // destroy all SVGElements associated to the series
+ each(['area', 'graph', 'dataLabelsGroup', 'group', 'markerGroup', 'tracker',
+ 'graphNeg', 'areaNeg', 'posClip', 'negClip'], function (prop) {
+ if (series[prop]) {
+
+ // issue 134 workaround
+ destroy = issue134 && prop === 'group' ?
+ 'hide' :
+ 'destroy';
+
+ series[prop][destroy]();
+ }
+ });
+
+ // remove from hoverSeries
+ if (chart.hoverSeries === series) {
+ chart.hoverSeries = null;
+ }
+ erase(chart.series, series);
+
+ // clear all members
+ for (prop in series) {
+ delete series[prop];
+ }
+ },
+
+ /**
+ * Return the graph path of a segment
+ */
+ getSegmentPath: function (segment) {
+ var series = this,
+ segmentPath = [],
+ step = series.options.step;
+
+ // build the segment line
+ each(segment, function (point, i) {
+
+ var plotX = point.plotX,
+ plotY = point.plotY,
+ lastPoint;
+
+ if (series.getPointSpline) { // generate the spline as defined in the SplineSeries object
+ segmentPath.push.apply(segmentPath, series.getPointSpline(segment, point, i));
+
+ } else {
+
+ // moveTo or lineTo
+ segmentPath.push(i ? L : M);
+
+ // step line?
+ if (step && i) {
+ lastPoint = segment[i - 1];
+ if (step === 'right') {
+ segmentPath.push(
+ lastPoint.plotX,
+ plotY
+ );
+
+ } else if (step === 'center') {
+ segmentPath.push(
+ (lastPoint.plotX + plotX) / 2,
+ lastPoint.plotY,
+ (lastPoint.plotX + plotX) / 2,
+ plotY
+ );
+
+ } else {
+ segmentPath.push(
+ plotX,
+ lastPoint.plotY
+ );
+ }
+ }
+
+ // normal line to next point
+ segmentPath.push(
+ point.plotX,
+ point.plotY
+ );
+ }
+ });
+
+ return segmentPath;
+ },
+
+ /**
+ * Get the graph path
+ */
+ getGraphPath: function () {
+ var series = this,
+ graphPath = [],
+ segmentPath,
+ singlePoints = []; // used in drawTracker
+
+ // Divide into segments and build graph and area paths
+ each(series.segments, function (segment) {
+
+ segmentPath = series.getSegmentPath(segment);
+
+ // add the segment to the graph, or a single point for tracking
+ if (segment.length > 1) {
+ graphPath = graphPath.concat(segmentPath);
+ } else {
+ singlePoints.push(segment[0]);
+ }
+ });
+
+ // Record it for use in drawGraph and drawTracker, and return graphPath
+ series.singlePoints = singlePoints;
+ series.graphPath = graphPath;
+
+ return graphPath;
+
+ },
+
+ /**
+ * Draw the actual graph
+ */
+ drawGraph: function () {
+ var series = this,
+ options = this.options,
+ props = [['graph', options.lineColor || this.color]],
+ lineWidth = options.lineWidth,
+ dashStyle = options.dashStyle,
+ roundCap = options.linecap !== 'square',
+ graphPath = this.getGraphPath(),
+ negativeColor = options.negativeColor;
+
+ if (negativeColor) {
+ props.push(['graphNeg', negativeColor]);
+ }
+
+ // draw the graph
+ each(props, function (prop, i) {
+ var graphKey = prop[0],
+ graph = series[graphKey],
+ attribs;
+
+ if (graph) {
+ stop(graph); // cancel running animations, #459
+ graph.animate({ d: graphPath });
+
+ } else if (lineWidth && graphPath.length) { // #1487
+ attribs = {
+ stroke: prop[1],
+ 'stroke-width': lineWidth,
+ fill: NONE,
+ zIndex: 1 // #1069
+ };
+ if (dashStyle) {
+ attribs.dashstyle = dashStyle;
+ } else if (roundCap) {
+ attribs['stroke-linecap'] = attribs['stroke-linejoin'] = 'round';
+ }
+
+ series[graphKey] = series.chart.renderer.path(graphPath)
+ .attr(attribs)
+ .add(series.group)
+ .shadow(!i && options.shadow);
+ }
+ });
+ },
+
+ /**
+ * Clip the graphs into the positive and negative coloured graphs
+ */
+ clipNeg: function () {
+ var options = this.options,
+ chart = this.chart,
+ renderer = chart.renderer,
+ negativeColor = options.negativeColor || options.negativeFillColor,
+ translatedThreshold,
+ posAttr,
+ negAttr,
+ graph = this.graph,
+ area = this.area,
+ posClip = this.posClip,
+ negClip = this.negClip,
+ chartWidth = chart.chartWidth,
+ chartHeight = chart.chartHeight,
+ chartSizeMax = mathMax(chartWidth, chartHeight),
+ yAxis = this.yAxis,
+ above,
+ below;
+
+ if (negativeColor && (graph || area)) {
+ translatedThreshold = mathRound(yAxis.toPixels(options.threshold || 0, true));
+ if (translatedThreshold < 0) {
+ chartSizeMax -= translatedThreshold; // #2534
+ }
+ above = {
+ x: 0,
+ y: 0,
+ width: chartSizeMax,
+ height: translatedThreshold
+ };
+ below = {
+ x: 0,
+ y: translatedThreshold,
+ width: chartSizeMax,
+ height: chartSizeMax
+ };
+
+ if (chart.inverted) {
+
+ above.height = below.y = chart.plotWidth - translatedThreshold;
+ if (renderer.isVML) {
+ above = {
+ x: chart.plotWidth - translatedThreshold - chart.plotLeft,
+ y: 0,
+ width: chartWidth,
+ height: chartHeight
+ };
+ below = {
+ x: translatedThreshold + chart.plotLeft - chartWidth,
+ y: 0,
+ width: chart.plotLeft + translatedThreshold,
+ height: chartWidth
+ };
+ }
+ }
+
+ if (yAxis.reversed) {
+ posAttr = below;
+ negAttr = above;
+ } else {
+ posAttr = above;
+ negAttr = below;
+ }
+
+ if (posClip) { // update
+ posClip.animate(posAttr);
+ negClip.animate(negAttr);
+ } else {
+
+ this.posClip = posClip = renderer.clipRect(posAttr);
+ this.negClip = negClip = renderer.clipRect(negAttr);
+
+ if (graph && this.graphNeg) {
+ graph.clip(posClip);
+ this.graphNeg.clip(negClip);
+ }
+
+ if (area) {
+ area.clip(posClip);
+ this.areaNeg.clip(negClip);
+ }
+ }
+ }
+ },
+
+ /**
+ * Initialize and perform group inversion on series.group and series.markerGroup
+ */
+ invertGroups: function () {
+ var series = this,
+ chart = series.chart;
+
+ // Pie, go away (#1736)
+ if (!series.xAxis) {
+ return;
+ }
+
+ // A fixed size is needed for inversion to work
+ function setInvert() {
+ var size = {
+ width: series.yAxis.len,
+ height: series.xAxis.len
+ };
+
+ each(['group', 'markerGroup'], function (groupName) {
+ if (series[groupName]) {
+ series[groupName].attr(size).invert();
+ }
+ });
+ }
+
+ addEvent(chart, 'resize', setInvert); // do it on resize
+ addEvent(series, 'destroy', function () {
+ removeEvent(chart, 'resize', setInvert);
+ });
+
+ // Do it now
+ setInvert(); // do it now
+
+ // On subsequent render and redraw, just do setInvert without setting up events again
+ series.invertGroups = setInvert;
+ },
+
+ /**
+ * General abstraction for creating plot groups like series.group, series.dataLabelsGroup and
+ * series.markerGroup. On subsequent calls, the group will only be adjusted to the updated plot size.
+ */
+ plotGroup: function (prop, name, visibility, zIndex, parent) {
+ var group = this[prop],
+ isNew = !group;
+
+ // Generate it on first call
+ if (isNew) {
+ this[prop] = group = this.chart.renderer.g(name)
+ .attr({
+ visibility: visibility,
+ zIndex: zIndex || 0.1 // IE8 needs this
+ })
+ .add(parent);
+ }
+ // Place it on first and subsequent (redraw) calls
+ group[isNew ? 'attr' : 'animate'](this.getPlotBox());
+ return group;
+ },
+
+ /**
+ * Get the translation and scale for the plot area of this series
+ */
+ getPlotBox: function () {
+ var chart = this.chart,
+ xAxis = this.xAxis,
+ yAxis = this.yAxis;
+
+ // Swap axes for inverted (#2339)
+ if (chart.inverted) {
+ xAxis = yAxis;
+ yAxis = this.xAxis;
+ }
+ return {
+ translateX: xAxis ? xAxis.left : chart.plotLeft,
+ translateY: yAxis ? yAxis.top : chart.plotTop,
+ scaleX: 1, // #1623
+ scaleY: 1
+ };
+ },
+
+ /**
+ * Render the graph and markers
+ */
+ render: function () {
+ var series = this,
+ chart = series.chart,
+ group,
+ options = series.options,
+ animation = options.animation,
+ // Animation doesn't work in IE8 quirks when the group div is hidden,
+ // and looks bad in other oldIE
+ animDuration = (animation && !!series.animate && chart.renderer.isSVG && pick(animation.duration, 500)) || 0,
+ visibility = series.visible ? VISIBLE : HIDDEN,
+ zIndex = options.zIndex,
+ hasRendered = series.hasRendered,
+ chartSeriesGroup = chart.seriesGroup;
+
+ // the group
+ group = series.plotGroup(
+ 'group',
+ 'series',
+ visibility,
+ zIndex,
+ chartSeriesGroup
+ );
+
+ series.markerGroup = series.plotGroup(
+ 'markerGroup',
+ 'markers',
+ visibility,
+ zIndex,
+ chartSeriesGroup
+ );
+
+ // initiate the animation
+ if (animDuration) {
+ series.animate(true);
+ }
+
+ // cache attributes for shapes
+ series.getAttribs();
+
+ // SVGRenderer needs to know this before drawing elements (#1089, #1795)
+ group.inverted = series.isCartesian ? chart.inverted : false;
+
+ // draw the graph if any
+ if (series.drawGraph) {
+ series.drawGraph();
+ series.clipNeg();
+ }
+
+ each(series.points, function (point) {
+ if (point.redraw) {
+ point.redraw();
+ }
+ });
+
+ // draw the data labels (inn pies they go before the points)
+ if (series.drawDataLabels) {
+ series.drawDataLabels();
+ }
+
+ // draw the points
+ if (series.visible) {
+ series.drawPoints();
+ }
+
+
+ // draw the mouse tracking area
+ if (series.drawTracker && series.options.enableMouseTracking !== false) {
+ series.drawTracker();
+ }
+
+ // Handle inverted series and tracker groups
+ if (chart.inverted) {
+ series.invertGroups();
+ }
+
+ // Initial clipping, must be defined after inverting groups for VML
+ if (options.clip !== false && !series.sharedClipKey && !hasRendered) {
+ group.clip(chart.clipRect);
+ }
+
+ // Run the animation
+ if (animDuration) {
+ series.animate();
+ }
+
+ // Call the afterAnimate function on animation complete (but don't overwrite the animation.complete option
+ // which should be available to the user).
+ if (!hasRendered) {
+ if (animDuration) {
+ series.animationTimeout = setTimeout(function () {
+ series.afterAnimate();
+ }, animDuration);
+ } else {
+ series.afterAnimate();
+ }
+ }
+
+ series.isDirty = series.isDirtyData = false; // means data is in accordance with what you see
+ // (See #322) series.isDirty = series.isDirtyData = false; // means data is in accordance with what you see
+ series.hasRendered = true;
+ },
+
+ /**
+ * Redraw the series after an update in the axes.
+ */
+ redraw: function () {
+ var series = this,
+ chart = series.chart,
+ wasDirtyData = series.isDirtyData, // cache it here as it is set to false in render, but used after
+ group = series.group,
+ xAxis = series.xAxis,
+ yAxis = series.yAxis;
+
+ // reposition on resize
+ if (group) {
+ if (chart.inverted) {
+ group.attr({
+ width: chart.plotWidth,
+ height: chart.plotHeight
+ });
+ }
+
+ group.animate({
+ translateX: pick(xAxis && xAxis.left, chart.plotLeft),
+ translateY: pick(yAxis && yAxis.top, chart.plotTop)
+ });
+ }
+
+ series.translate();
+ if (series.setTooltipPoints) {
+ series.setTooltipPoints(true);
+ }
+ series.render();
+
+ if (wasDirtyData) {
+ fireEvent(series, 'updatedData');
+ }
+ }
+ }; // end Series prototype
+
+
+
+ /**
+ * The class for stack items
+ */
+ function StackItem(axis, options, isNegative, x, stackOption) {
+
+ var inverted = axis.chart.inverted;
+
+ this.axis = axis;
+
+ // Tells if the stack is negative
+ this.isNegative = isNegative;
+
+ // Save the options to be able to style the label
+ this.options = options;
+
+ // Save the x value to be able to position the label later
+ this.x = x;
+
+ // Initialize total value
+ this.total = null;
+
+ // This will keep each points' extremes stored by series.index and point index
+ this.points = {};
+
+ // Save the stack option on the series configuration object, and whether to treat it as percent
+ this.stack = stackOption;
+
+ // The align options and text align varies on whether the stack is negative and
+ // if the chart is inverted or not.
+ // First test the user supplied value, then use the dynamic.
+ this.alignOptions = {
+ align: options.align || (inverted ? (isNegative ? 'left' : 'right') : 'center'),
+ verticalAlign: options.verticalAlign || (inverted ? 'middle' : (isNegative ? 'bottom' : 'top')),
+ y: pick(options.y, inverted ? 4 : (isNegative ? 14 : -6)),
+ x: pick(options.x, inverted ? (isNegative ? -6 : 6) : 0)
+ };
+
+ this.textAlign = options.textAlign || (inverted ? (isNegative ? 'right' : 'left') : 'center');
+ }
+
+ StackItem.prototype = {
+ destroy: function () {
+ destroyObjectProperties(this, this.axis);
+ },
+
+ /**
+ * Renders the stack total label and adds it to the stack label group.
+ */
+ render: function (group) {
+ var options = this.options,
+ formatOption = options.format,
+ str = formatOption ?
+ format(formatOption, this) :
+ options.formatter.call(this); // format the text in the label
+
+ // Change the text to reflect the new total and set visibility to hidden in case the serie is hidden
+ if (this.label) {
+ this.label.attr({text: str, visibility: HIDDEN});
+ // Create new label
+ } else {
+ this.label =
+ this.axis.chart.renderer.text(str, null, null, options.useHTML) // dummy positions, actual position updated with setOffset method in columnseries
+ .css(options.style) // apply style
+ .attr({
+ align: this.textAlign, // fix the text-anchor
+ rotation: options.rotation, // rotation
+ visibility: HIDDEN // hidden until setOffset is called
+ })
+ .add(group); // add to the labels-group
+ }
+ },
+
+ /**
+ * Sets the offset that the stack has from the x value and repositions the label.
+ */
+ setOffset: function (xOffset, xWidth) {
+ var stackItem = this,
+ axis = stackItem.axis,
+ chart = axis.chart,
+ inverted = chart.inverted,
+ neg = this.isNegative, // special treatment is needed for negative stacks
+ y = axis.translate(axis.usePercentage ? 100 : this.total, 0, 0, 0, 1), // stack value translated mapped to chart coordinates
+ yZero = axis.translate(0), // stack origin
+ h = mathAbs(y - yZero), // stack height
+ x = chart.xAxis[0].translate(this.x) + xOffset, // stack x position
+ plotHeight = chart.plotHeight,
+ stackBox = { // this is the box for the complete stack
+ x: inverted ? (neg ? y : y - h) : x,
+ y: inverted ? plotHeight - x - xWidth : (neg ? (plotHeight - y - h) : plotHeight - y),
+ width: inverted ? h : xWidth,
+ height: inverted ? xWidth : h
+ },
+ label = this.label,
+ alignAttr;
+
+ if (label) {
+ label.align(this.alignOptions, null, stackBox); // align the label to the box
+
+ // Set visibility (#678)
+ alignAttr = label.alignAttr;
+ label[this.options.crop === false || chart.isInsidePlot(alignAttr.x, alignAttr.y) ? 'show' : 'hide'](true);
+ }
+ }
+ };
+
+
+ // Stacking methods defined on the Axis prototype
+
+ /**
+ * Build the stacks from top down
+ */
+ Axis.prototype.buildStacks = function () {
+ var series = this.series,
+ reversedStacks = pick(this.options.reversedStacks, true),
+ i = series.length;
+ if (!this.isXAxis) {
+ this.usePercentage = false;
+ while (i--) {
+ series[reversedStacks ? i : series.length - i - 1].setStackedPoints();
+ }
+ // Loop up again to compute percent stack
+ if (this.usePercentage) {
+ for (i = 0; i < series.length; i++) {
+ series[i].setPercentStacks();
+ }
+ }
+ }
+ };
+
+ Axis.prototype.renderStackTotals = function () {
+ var axis = this,
+ chart = axis.chart,
+ renderer = chart.renderer,
+ stacks = axis.stacks,
+ stackKey,
+ oneStack,
+ stackCategory,
+ stackTotalGroup = axis.stackTotalGroup;
+
+ // Create a separate group for the stack total labels
+ if (!stackTotalGroup) {
+ axis.stackTotalGroup = stackTotalGroup =
+ renderer.g('stack-labels')
+ .attr({
+ visibility: VISIBLE,
+ zIndex: 6
+ })
+ .add();
+ }
+
+ // plotLeft/Top will change when y axis gets wider so we need to translate the
+ // stackTotalGroup at every render call. See bug #506 and #516
+ stackTotalGroup.translate(chart.plotLeft, chart.plotTop);
+
+ // Render each stack total
+ for (stackKey in stacks) {
+ oneStack = stacks[stackKey];
+ for (stackCategory in oneStack) {
+ oneStack[stackCategory].render(stackTotalGroup);
+ }
+ }
+ };
+
+
+ // Stacking methods defnied for Series prototype
+
+ /**
+ * Adds series' points value to corresponding stack
+ */
+ Series.prototype.setStackedPoints = function () {
+ if (!this.options.stacking || (this.visible !== true && this.chart.options.chart.ignoreHiddenSeries !== false)) {
+ return;
+ }
+
+ var series = this,
+ xData = series.processedXData,
+ yData = series.processedYData,
+ stackedYData = [],
+ yDataLength = yData.length,
+ seriesOptions = series.options,
+ threshold = seriesOptions.threshold,
+ stackOption = seriesOptions.stack,
+ stacking = seriesOptions.stacking,
+ stackKey = series.stackKey,
+ negKey = '-' + stackKey,
+ negStacks = series.negStacks,
+ yAxis = series.yAxis,
+ stacks = yAxis.stacks,
+ oldStacks = yAxis.oldStacks,
+ isNegative,
+ stack,
+ other,
+ key,
+ pointKey,
+ i,
+ x,
+ y;
+
+ // loop over the non-null y values and read them into a local array
+ for (i = 0; i < yDataLength; i++) {
+ x = xData[i];
+ y = yData[i];
+ pointKey = series.index + ',' + i;
+
+ // Read stacked values into a stack based on the x value,
+ // the sign of y and the stack key. Stacking is also handled for null values (#739)
+ isNegative = negStacks && y < threshold;
+ key = isNegative ? negKey : stackKey;
+
+ // Create empty object for this stack if it doesn't exist yet
+ if (!stacks[key]) {
+ stacks[key] = {};
+ }
+
+ // Initialize StackItem for this x
+ if (!stacks[key][x]) {
+ if (oldStacks[key] && oldStacks[key][x]) {
+ stacks[key][x] = oldStacks[key][x];
+ stacks[key][x].total = null;
+ } else {
+ stacks[key][x] = new StackItem(yAxis, yAxis.options.stackLabels, isNegative, x, stackOption);
+ }
+ }
+
+ // If the StackItem doesn't exist, create it first
+ stack = stacks[key][x];
+ stack.points[pointKey] = [stack.cum || 0];
+
+ // Add value to the stack total
+ if (stacking === 'percent') {
+
+ // Percent stacked column, totals are the same for the positive and negative stacks
+ other = isNegative ? stackKey : negKey;
+ if (negStacks && stacks[other] && stacks[other][x]) {
+ other = stacks[other][x];
+ stack.total = other.total = mathMax(other.total, stack.total) + mathAbs(y) || 0;
+
+ // Percent stacked areas
+ } else {
+ stack.total = correctFloat(stack.total + (mathAbs(y) || 0));
+ }
+ } else {
+ stack.total = correctFloat(stack.total + (y || 0));
+ }
+
+ stack.cum = (stack.cum || 0) + (y || 0);
+
+ stack.points[pointKey].push(stack.cum);
+ stackedYData[i] = stack.cum;
+
+ }
+
+ if (stacking === 'percent') {
+ yAxis.usePercentage = true;
+ }
+
+ this.stackedYData = stackedYData; // To be used in getExtremes
+
+ // Reset old stacks
+ yAxis.oldStacks = {};
+ };
+
+ /**
+ * Iterate over all stacks and compute the absolute values to percent
+ */
+ Series.prototype.setPercentStacks = function () {
+ var series = this,
+ stackKey = series.stackKey,
+ stacks = series.yAxis.stacks,
+ processedXData = series.processedXData;
+
+ each([stackKey, '-' + stackKey], function (key) {
+ var i = processedXData.length,
+ x,
+ stack,
+ pointExtremes,
+ totalFactor;
+
+ while (i--) {
+ x = processedXData[i];
+ stack = stacks[key] && stacks[key][x];
+ pointExtremes = stack && stack.points[series.index + ',' + i];
+ if (pointExtremes) {
+ totalFactor = stack.total ? 100 / stack.total : 0;
+ pointExtremes[0] = correctFloat(pointExtremes[0] * totalFactor); // Y bottom value
+ pointExtremes[1] = correctFloat(pointExtremes[1] * totalFactor); // Y value
+ series.stackedYData[i] = pointExtremes[1];
+ }
+ }
+ });
+ };
+
+
+
+ // Extend the Chart prototype for dynamic methods
+ extend(Chart.prototype, {
+
+ /**
+ * Add a series dynamically after time
+ *
+ * @param {Object} options The config options
+ * @param {Boolean} redraw Whether to redraw the chart after adding. Defaults to true.
+ * @param {Boolean|Object} animation Whether to apply animation, and optionally animation
+ * configuration
+ *
+ * @return {Object} series The newly created series object
+ */
+ addSeries: function (options, redraw, animation) {
+ var series,
+ chart = this;
+
+ if (options) {
+ redraw = pick(redraw, true); // defaults to true
+
+ fireEvent(chart, 'addSeries', { options: options }, function () {
+ series = chart.initSeries(options);
+
+ chart.isDirtyLegend = true; // the series array is out of sync with the display
+ chart.linkSeries();
+ if (redraw) {
+ chart.redraw(animation);
+ }
+ });
+ }
+
+ return series;
+ },
+
+ /**
+ * Add an axis to the chart
+ * @param {Object} options The axis option
+ * @param {Boolean} isX Whether it is an X axis or a value axis
+ */
+ addAxis: function (options, isX, redraw, animation) {
+ var key = isX ? 'xAxis' : 'yAxis',
+ chartOptions = this.options,
+ axis;
+
+ /*jslint unused: false*/
+ axis = new Axis(this, merge(options, {
+ index: this[key].length,
+ isX: isX
+ }));
+ /*jslint unused: true*/
+
+ // Push the new axis options to the chart options
+ chartOptions[key] = splat(chartOptions[key] || {});
+ chartOptions[key].push(options);
+
+ if (pick(redraw, true)) {
+ this.redraw(animation);
+ }
+ },
+
+ /**
+ * Dim the chart and show a loading text or symbol
+ * @param {String} str An optional text to show in the loading label instead of the default one
+ */
+ showLoading: function (str) {
+ var chart = this,
+ options = chart.options,
+ loadingDiv = chart.loadingDiv,
+ loadingOptions = options.loading,
+ setLoadingSize = function () {
+ if (loadingDiv) {
+ css(loadingDiv, {
+ left: chart.plotLeft + PX,
+ top: chart.plotTop + PX,
+ width: chart.plotWidth + PX,
+ height: chart.plotHeight + PX
+ });
+ }
+ };
+
+ // create the layer at the first call
+ if (!loadingDiv) {
+ chart.loadingDiv = loadingDiv = createElement(DIV, {
+ className: PREFIX + 'loading'
+ }, extend(loadingOptions.style, {
+ zIndex: 10,
+ display: NONE
+ }), chart.container);
+
+ chart.loadingSpan = createElement(
+ 'span',
+ null,
+ loadingOptions.labelStyle,
+ loadingDiv
+ );
+ addEvent(chart, 'redraw', setLoadingSize); // #1080
+ }
+
+ // update text
+ chart.loadingSpan.innerHTML = str || options.lang.loading;
+
+ // show it
+ if (!chart.loadingShown) {
+ css(loadingDiv, {
+ opacity: 0,
+ display: ''
+ });
+ animate(loadingDiv, {
+ opacity: loadingOptions.style.opacity
+ }, {
+ duration: loadingOptions.showDuration || 0
+ });
+ chart.loadingShown = true;
+ }
+ setLoadingSize();
+ },
+
+ /**
+ * Hide the loading layer
+ */
+ hideLoading: function () {
+ var options = this.options,
+ loadingDiv = this.loadingDiv;
+
+ if (loadingDiv) {
+ animate(loadingDiv, {
+ opacity: 0
+ }, {
+ duration: options.loading.hideDuration || 100,
+ complete: function () {
+ css(loadingDiv, { display: NONE });
+ }
+ });
+ }
+ this.loadingShown = false;
+ }
+ });
+
+ // extend the Point prototype for dynamic methods
+ extend(Point.prototype, {
+ /**
+ * Update the point with new options (typically x/y data) and optionally redraw the series.
+ *
+ * @param {Object} options Point options as defined in the series.data array
+ * @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call
+ * @param {Boolean|Object} animation Whether to apply animation, and optionally animation
+ * configuration
+ *
+ */
+ update: function (options, redraw, animation, runEvent) {
+ var point = this,
+ series = point.series,
+ graphic = point.graphic,
+ i,
+ chart = series.chart,
+ seriesOptions = series.options;
+
+ redraw = pick(redraw, true);
+
+ function update() {
+
+ point.applyOptions(options);
+
+ // Update visuals
+ if (isObject(options) && !isArray(options)) {
+ // Defer the actual redraw until getAttribs has been called (#3260)
+ point.redraw = function () {
+ if (graphic) {
+ if (options && options.marker && options.marker.symbol) {
+ point.graphic = graphic.destroy();
+ } else {
+ graphic.attr(point.pointAttr[point.state || '']);
+ }
+ }
+ if (options && options.dataLabels && point.dataLabel) { // #2468
+ point.dataLabel = point.dataLabel.destroy();
+ }
+ point.redraw = null;
+ };
+ }
+
+ // record changes in the parallel arrays
+ i = point.index;
+ series.updateParallelArrays(point, i);
+
+ seriesOptions.data[i] = point.options;
+
+ // redraw
+ series.isDirty = series.isDirtyData = true;
+ if (!series.fixedBox && series.hasCartesianSeries) { // #1906, #2320
+ chart.isDirtyBox = true;
+ }
+
+ if (seriesOptions.legendType === 'point') { // #1831, #1885
+ chart.legend.destroyItem(point);
+ }
+ if (redraw) {
+ chart.redraw(animation);
+ }
+ }
+
+ // Fire the event with a default handler of doing the update
+ if (runEvent === false) { // When called from setData
+ update();
+ } else {
+ point.firePointEvent('update', { options: options }, update);
+ }
+ },
+
+ /**
+ * Remove a point and optionally redraw the series and if necessary the axes
+ * @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call
+ * @param {Boolean|Object} animation Whether to apply animation, and optionally animation
+ * configuration
+ */
+ remove: function (redraw, animation) {
+ var point = this,
+ series = point.series,
+ points = series.points,
+ chart = series.chart,
+ i,
+ data = series.data;
+
+ setAnimation(animation, chart);
+ redraw = pick(redraw, true);
+
+ // fire the event with a default handler of removing the point
+ point.firePointEvent('remove', null, function () {
+
+ // splice all the parallel arrays
+ i = inArray(point, data);
+ if (data.length === points.length) {
+ points.splice(i, 1);
+ }
+ data.splice(i, 1);
+ series.options.data.splice(i, 1);
+ series.updateParallelArrays(point, 'splice', i, 1);
+
+ point.destroy();
+
+ // redraw
+ series.isDirty = true;
+ series.isDirtyData = true;
+ if (redraw) {
+ chart.redraw();
+ }
+ });
+ }
+ });
+
+ // Extend the series prototype for dynamic methods
+ extend(Series.prototype, {
+ /**
+ * Add a point dynamically after chart load time
+ * @param {Object} options Point options as given in series.data
+ * @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call
+ * @param {Boolean} shift If shift is true, a point is shifted off the start
+ * of the series as one is appended to the end.
+ * @param {Boolean|Object} animation Whether to apply animation, and optionally animation
+ * configuration
+ */
+ addPoint: function (options, redraw, shift, animation) {
+ var series = this,
+ seriesOptions = series.options,
+ data = series.data,
+ graph = series.graph,
+ area = series.area,
+ chart = series.chart,
+ names = series.xAxis && series.xAxis.names,
+ currentShift = (graph && graph.shift) || 0,
+ dataOptions = seriesOptions.data,
+ point,
+ isInTheMiddle,
+ xData = series.xData,
+ x,
+ i;
+
+ setAnimation(animation, chart);
+
+ // Make graph animate sideways
+ if (shift) {
+ each([graph, area, series.graphNeg, series.areaNeg], function (shape) {
+ if (shape) {
+ shape.shift = currentShift + 1;
+ }
+ });
+ }
+ if (area) {
+ area.isArea = true; // needed in animation, both with and without shift
+ }
+
+ // Optional redraw, defaults to true
+ redraw = pick(redraw, true);
+
+ // Get options and push the point to xData, yData and series.options. In series.generatePoints
+ // the Point instance will be created on demand and pushed to the series.data array.
+ point = { series: series };
+ series.pointClass.prototype.applyOptions.apply(point, [options]);
+ x = point.x;
+
+ // Get the insertion point
+ i = xData.length;
+ if (series.requireSorting && x < xData[i - 1]) {
+ isInTheMiddle = true;
+ while (i && xData[i - 1] > x) {
+ i--;
+ }
+ }
+
+ series.updateParallelArrays(point, 'splice', i, 0, 0); // insert undefined item
+ series.updateParallelArrays(point, i); // update it
+
+ if (names && point.name) {
+ names[x] = point.name;
+ }
+ dataOptions.splice(i, 0, options);
+
+ if (isInTheMiddle) {
+ series.data.splice(i, 0, null);
+ series.processData();
+ }
+
+ // Generate points to be added to the legend (#1329)
+ if (seriesOptions.legendType === 'point') {
+ series.generatePoints();
+ }
+
+ // Shift the first point off the parallel arrays
+ // todo: consider series.removePoint(i) method
+ if (shift) {
+ if (data[0] && data[0].remove) {
+ data[0].remove(false);
+ } else {
+ data.shift();
+ series.updateParallelArrays(point, 'shift');
+
+ dataOptions.shift();
+ }
+ }
+
+ // redraw
+ series.isDirty = true;
+ series.isDirtyData = true;
+ if (redraw) {
+ series.getAttribs(); // #1937
+ chart.redraw();
+ }
+ },
+
+ /**
+ * Remove a series and optionally redraw the chart
+ *
+ * @param {Boolean} redraw Whether to redraw the chart or wait for an explicit call
+ * @param {Boolean|Object} animation Whether to apply animation, and optionally animation
+ * configuration
+ */
+
+ remove: function (redraw, animation) {
+ var series = this,
+ chart = series.chart;
+ redraw = pick(redraw, true);
+
+ if (!series.isRemoving) { /* prevent triggering native event in jQuery
+ (calling the remove function from the remove event) */
+ series.isRemoving = true;
+
+ // fire the event with a default handler of removing the point
+ fireEvent(series, 'remove', null, function () {
+
+
+ // destroy elements
+ series.destroy();
+
+
+ // redraw
+ chart.isDirtyLegend = chart.isDirtyBox = true;
+ chart.linkSeries();
+
+ if (redraw) {
+ chart.redraw(animation);
+ }
+ });
+
+ }
+ series.isRemoving = false;
+ },
+
+ /**
+ * Update the series with a new set of options
+ */
+ update: function (newOptions, redraw) {
+ var series = this,
+ chart = this.chart,
+ // must use user options when changing type because this.options is merged
+ // in with type specific plotOptions
+ oldOptions = this.userOptions,
+ oldType = this.type,
+ proto = seriesTypes[oldType].prototype,
+ preserve = ['group', 'markerGroup', 'dataLabelsGroup'],
+ n;
+
+ // Make sure groups are not destroyed (#3094)
+ each(preserve, function (prop) {
+ preserve[prop] = series[prop];
+ delete series[prop];
+ });
+
+ // Do the merge, with some forced options
+ newOptions = merge(oldOptions, {
+ animation: false,
+ index: this.index,
+ pointStart: this.xData[0] // when updating after addPoint
+ }, { data: this.options.data }, newOptions);
+
+ // Destroy the series and reinsert methods from the type prototype
+ this.remove(false);
+ for (n in proto) { // Overwrite series-type specific methods (#2270)
+ if (proto.hasOwnProperty(n)) {
+ this[n] = UNDEFINED;
+ }
+ }
+ extend(this, seriesTypes[newOptions.type || oldType].prototype);
+
+ // Re-register groups (#3094)
+ each(preserve, function (prop) {
+ series[prop] = preserve[prop];
+ });
+
+
+ this.init(chart, newOptions);
+ chart.linkSeries(); // Links are lost in this.remove (#3028)
+ if (pick(redraw, true)) {
+ chart.redraw(false);
+ }
+ }
+ });
+
+ // Extend the Axis.prototype for dynamic methods
+ extend(Axis.prototype, {
+
+ /**
+ * Update the axis with a new options structure
+ */
+ update: function (newOptions, redraw) {
+ var chart = this.chart;
+
+ newOptions = chart.options[this.coll][this.options.index] = merge(this.userOptions, newOptions);
+
+ this.destroy(true);
+ this._addedPlotLB = UNDEFINED; // #1611, #2887
+
+ this.init(chart, extend(newOptions, { events: UNDEFINED }));
+
+ chart.isDirtyBox = true;
+ if (pick(redraw, true)) {
+ chart.redraw();
+ }
+ },
+
+ /**
+ * Remove the axis from the chart
+ */
+ remove: function (redraw) {
+ var chart = this.chart,
+ key = this.coll, // xAxis or yAxis
+ axisSeries = this.series,
+ i = axisSeries.length;
+
+ // Remove associated series (#2687)
+ while (i--) {
+ if (axisSeries[i]) {
+ axisSeries[i].remove(false);
+ }
+ }
+
+ // Remove the axis
+ erase(chart.axes, this);
+ erase(chart[key], this);
+ chart.options[key].splice(this.options.index, 1);
+ each(chart[key], function (axis, i) { // Re-index, #1706
+ axis.options.index = i;
+ });
+ this.destroy();
+ chart.isDirtyBox = true;
+
+ if (pick(redraw, true)) {
+ chart.redraw();
+ }
+ },
+
+ /**
+ * Update the axis title by options
+ */
+ setTitle: function (newTitleOptions, redraw) {
+ this.update({ title: newTitleOptions }, redraw);
+ },
+
+ /**
+ * Set new axis categories and optionally redraw
+ * @param {Array} categories
+ * @param {Boolean} redraw
+ */
+ setCategories: function (categories, redraw) {
+ this.update({ categories: categories }, redraw);
+ }
+
+ });
+
+
+
+
+ /**
+ * LineSeries object
+ */
+ var LineSeries = extendClass(Series);
+ seriesTypes.line = LineSeries;
+
+
+
+ /**
+ * Set the default options for area
+ */
+ defaultPlotOptions.area = merge(defaultSeriesOptions, {
+ threshold: 0
+ // trackByArea: false,
+ // lineColor: null, // overrides color, but lets fillColor be unaltered
+ // fillOpacity: 0.75,
+ // fillColor: null
+ });
+
+ /**
+ * AreaSeries object
+ */
+ var AreaSeries = extendClass(Series, {
+ type: 'area',
+ /**
+ * For stacks, don't split segments on null values. Instead, draw null values with
+ * no marker. Also insert dummy points for any X position that exists in other series
+ * in the stack.
+ */
+ getSegments: function () {
+ var series = this,
+ segments = [],
+ segment = [],
+ keys = [],
+ xAxis = this.xAxis,
+ yAxis = this.yAxis,
+ stack = yAxis.stacks[this.stackKey],
+ pointMap = {},
+ plotX,
+ plotY,
+ points = this.points,
+ connectNulls = this.options.connectNulls,
+ i,
+ x;
+
+ if (this.options.stacking && !this.cropped) { // cropped causes artefacts in Stock, and perf issue
+ // Create a map where we can quickly look up the points by their X value.
+ for (i = 0; i < points.length; i++) {
+ pointMap[points[i].x] = points[i];
+ }
+
+ // Sort the keys (#1651)
+ for (x in stack) {
+ if (stack[x].total !== null) { // nulled after switching between grouping and not (#1651, #2336)
+ keys.push(+x);
+ }
+ }
+ keys.sort(function (a, b) {
+ return a - b;
+ });
+
+ each(keys, function (x) {
+ var y = 0,
+ stackPoint;
+
+ if (connectNulls && (!pointMap[x] || pointMap[x].y === null)) { // #1836
+ return;
+
+ // The point exists, push it to the segment
+ } else if (pointMap[x]) {
+ segment.push(pointMap[x]);
+
+ // There is no point for this X value in this series, so we
+ // insert a dummy point in order for the areas to be drawn
+ // correctly.
+ } else {
+
+ // Loop down the stack to find the series below this one that has
+ // a value (#1991)
+ for (i = series.index; i <= yAxis.series.length; i++) {
+ stackPoint = stack[x].points[i + ',' + x];
+ if (stackPoint) {
+ y = stackPoint[1];
+ break;
+ }
+ }
+
+ plotX = xAxis.translate(x);
+ plotY = yAxis.toPixels(y, true);
+ segment.push({
+ y: null,
+ plotX: plotX,
+ clientX: plotX,
+ plotY: plotY,
+ yBottom: plotY,
+ onMouseOver: noop
+ });
+ }
+ });
+
+ if (segment.length) {
+ segments.push(segment);
+ }
+
+ } else {
+ Series.prototype.getSegments.call(this);
+ segments = this.segments;
+ }
+
+ this.segments = segments;
+ },
+
+ /**
+ * Extend the base Series getSegmentPath method by adding the path for the area.
+ * This path is pushed to the series.areaPath property.
+ */
+ getSegmentPath: function (segment) {
+
+ var segmentPath = Series.prototype.getSegmentPath.call(this, segment), // call base method
+ areaSegmentPath = [].concat(segmentPath), // work on a copy for the area path
+ i,
+ options = this.options,
+ segLength = segmentPath.length,
+ translatedThreshold = this.yAxis.getThreshold(options.threshold), // #2181
+ yBottom;
+
+ if (segLength === 3) { // for animation from 1 to two points
+ areaSegmentPath.push(L, segmentPath[1], segmentPath[2]);
+ }
+ if (options.stacking && !this.closedStacks) {
+
+ // Follow stack back. Todo: implement areaspline. A general solution could be to
+ // reverse the entire graphPath of the previous series, though may be hard with
+ // splines and with series with different extremes
+ for (i = segment.length - 1; i >= 0; i--) {
+
+ yBottom = pick(segment[i].yBottom, translatedThreshold);
+
+ // step line?
+ if (i < segment.length - 1 && options.step) {
+ areaSegmentPath.push(segment[i + 1].plotX, yBottom);
+ }
+
+ areaSegmentPath.push(segment[i].plotX, yBottom);
+ }
+
+ } else { // follow zero line back
+ this.closeSegment(areaSegmentPath, segment, translatedThreshold);
+ }
+ this.areaPath = this.areaPath.concat(areaSegmentPath);
+ return segmentPath;
+ },
+
+ /**
+ * Extendable method to close the segment path of an area. This is overridden in polar
+ * charts.
+ */
+ closeSegment: function (path, segment, translatedThreshold) {
+ path.push(
+ L,
+ segment[segment.length - 1].plotX,
+ translatedThreshold,
+ L,
+ segment[0].plotX,
+ translatedThreshold
+ );
+ },
+
+ /**
+ * Draw the graph and the underlying area. This method calls the Series base
+ * function and adds the area. The areaPath is calculated in the getSegmentPath
+ * method called from Series.prototype.drawGraph.
+ */
+ drawGraph: function () {
+
+ // Define or reset areaPath
+ this.areaPath = [];
+
+ // Call the base method
+ Series.prototype.drawGraph.apply(this);
+
+ // Define local variables
+ var series = this,
+ areaPath = this.areaPath,
+ options = this.options,
+ negativeColor = options.negativeColor,
+ negativeFillColor = options.negativeFillColor,
+ props = [['area', this.color, options.fillColor]]; // area name, main color, fill color
+
+ if (negativeColor || negativeFillColor) {
+ props.push(['areaNeg', negativeColor, negativeFillColor]);
+ }
+
+ each(props, function (prop) {
+ var areaKey = prop[0],
+ area = series[areaKey];
+
+ // Create or update the area
+ if (area) { // update
+ area.animate({ d: areaPath });
+
+ } else { // create
+ series[areaKey] = series.chart.renderer.path(areaPath)
+ .attr({
+ fill: pick(
+ prop[2],
+ Color(prop[1]).setOpacity(pick(options.fillOpacity, 0.75)).get()
+ ),
+ zIndex: 0 // #1069
+ }).add(series.group);
+ }
+ });
+ },
+
+ drawLegendSymbol: LegendSymbolMixin.drawRectangle
+ });
+
+ seriesTypes.area = AreaSeries;
+
+
+ /**
+ * Set the default options for column
+ */
+ defaultPlotOptions.column = merge(defaultSeriesOptions, {
+ borderColor: '#FFFFFF',
+ //borderWidth: 1,
+ borderRadius: 0,
+ //colorByPoint: undefined,
+ groupPadding: 0.2,
+ //grouping: true,
+ marker: null, // point options are specified in the base options
+ pointPadding: 0.1,
+ //pointWidth: null,
+ minPointLength: 0,
+ cropThreshold: 50, // when there are more points, they will not animate out of the chart on xAxis.setExtremes
+ pointRange: null, // null means auto, meaning 1 in a categorized axis and least distance between points if not categories
+ states: {
+ hover: {
+ brightness: 0.1,
+ shadow: false,
+ halo: false
+ },
+ select: {
+ color: '#C0C0C0',
+ borderColor: '#000000',
+ shadow: false
+ }
+ },
+ dataLabels: {
+ align: null, // auto
+ verticalAlign: null, // auto
+ y: null
+ },
+ stickyTracking: false,
+ tooltip: {
+ distance: 6
+ },
+ threshold: 0
+ });
+
+ /**
+ * ColumnSeries object
+ */
+ var ColumnSeries = extendClass(Series, {
+ type: 'column',
+ pointAttrToOptions: { // mapping between SVG attributes and the corresponding options
+ stroke: 'borderColor',
+ fill: 'color',
+ r: 'borderRadius'
+ },
+ cropShoulder: 0,
+ trackerGroups: ['group', 'dataLabelsGroup'],
+ negStacks: true, // use separate negative stacks, unlike area stacks where a negative
+ // point is substracted from previous (#1910)
+
+ /**
+ * Initialize the series
+ */
+ init: function () {
+ Series.prototype.init.apply(this, arguments);
+
+ var series = this,
+ chart = series.chart;
+
+ // if the series is added dynamically, force redraw of other
+ // series affected by a new column
+ if (chart.hasRendered) {
+ each(chart.series, function (otherSeries) {
+ if (otherSeries.type === series.type) {
+ otherSeries.isDirty = true;
+ }
+ });
+ }
+ },
+
+ /**
+ * Return the width and x offset of the columns adjusted for grouping, groupPadding, pointPadding,
+ * pointWidth etc.
+ */
+ getColumnMetrics: function () {
+
+ var series = this,
+ options = series.options,
+ xAxis = series.xAxis,
+ yAxis = series.yAxis,
+ reversedXAxis = xAxis.reversed,
+ stackKey,
+ stackGroups = {},
+ columnIndex,
+ columnCount = 0;
+
+ // Get the total number of column type series.
+ // This is called on every series. Consider moving this logic to a
+ // chart.orderStacks() function and call it on init, addSeries and removeSeries
+ if (options.grouping === false) {
+ columnCount = 1;
+ } else {
+ each(series.chart.series, function (otherSeries) {
+ var otherOptions = otherSeries.options,
+ otherYAxis = otherSeries.yAxis;
+ if (otherSeries.type === series.type && otherSeries.visible &&
+ yAxis.len === otherYAxis.len && yAxis.pos === otherYAxis.pos) { // #642, #2086
+ if (otherOptions.stacking) {
+ stackKey = otherSeries.stackKey;
+ if (stackGroups[stackKey] === UNDEFINED) {
+ stackGroups[stackKey] = columnCount++;
+ }
+ columnIndex = stackGroups[stackKey];
+ } else if (otherOptions.grouping !== false) { // #1162
+ columnIndex = columnCount++;
+ }
+ otherSeries.columnIndex = columnIndex;
+ }
+ });
+ }
+
+ var categoryWidth = mathMin(
+ mathAbs(xAxis.transA) * (xAxis.ordinalSlope || options.pointRange || xAxis.closestPointRange || xAxis.tickInterval || 1), // #2610
+ xAxis.len // #1535
+ ),
+ groupPadding = categoryWidth * options.groupPadding,
+ groupWidth = categoryWidth - 2 * groupPadding,
+ pointOffsetWidth = groupWidth / columnCount,
+ optionPointWidth = options.pointWidth,
+ pointPadding = defined(optionPointWidth) ? (pointOffsetWidth - optionPointWidth) / 2 :
+ pointOffsetWidth * options.pointPadding,
+ pointWidth = pick(optionPointWidth, pointOffsetWidth - 2 * pointPadding), // exact point width, used in polar charts
+ colIndex = (reversedXAxis ?
+ columnCount - (series.columnIndex || 0) : // #1251
+ series.columnIndex) || 0,
+ pointXOffset = pointPadding + (groupPadding + colIndex *
+ pointOffsetWidth - (categoryWidth / 2)) *
+ (reversedXAxis ? -1 : 1);
+
+ // Save it for reading in linked series (Error bars particularly)
+ return (series.columnMetrics = {
+ width: pointWidth,
+ offset: pointXOffset
+ });
+
+ },
+
+ /**
+ * Translate each point to the plot area coordinate system and find shape positions
+ */
+ translate: function () {
+ var series = this,
+ chart = series.chart,
+ options = series.options,
+ borderWidth = series.borderWidth = pick(
+ options.borderWidth,
+ series.activePointCount > 0.5 * series.xAxis.len ? 0 : 1
+ ),
+ yAxis = series.yAxis,
+ threshold = options.threshold,
+ translatedThreshold = series.translatedThreshold = yAxis.getThreshold(threshold),
+ minPointLength = pick(options.minPointLength, 5),
+ metrics = series.getColumnMetrics(),
+ pointWidth = metrics.width,
+ seriesBarW = series.barW = mathMax(pointWidth, 1 + 2 * borderWidth), // postprocessed for border width
+ pointXOffset = series.pointXOffset = metrics.offset,
+ xCrisp = -(borderWidth % 2 ? 0.5 : 0),
+ yCrisp = borderWidth % 2 ? 0.5 : 1;
+
+ if (chart.renderer.isVML && chart.inverted) {
+ yCrisp += 1;
+ }
+
+ // When the pointPadding is 0, we want the columns to be packed tightly, so we allow individual
+ // columns to have individual sizes. When pointPadding is greater, we strive for equal-width
+ // columns (#2694).
+ if (options.pointPadding) {
+ seriesBarW = mathCeil(seriesBarW);
+ }
+
+ Series.prototype.translate.apply(series);
+
+ // Record the new values
+ each(series.points, function (point) {
+ var yBottom = pick(point.yBottom, translatedThreshold),
+ plotY = mathMin(mathMax(-999 - yBottom, point.plotY), yAxis.len + 999 + yBottom), // Don't draw too far outside plot area (#1303, #2241)
+ barX = point.plotX + pointXOffset,
+ barW = seriesBarW,
+ barY = mathMin(plotY, yBottom),
+ right,
+ bottom,
+ fromTop,
+ barH = mathMax(plotY, yBottom) - barY;
+
+ // Handle options.minPointLength
+ if (mathAbs(barH) < minPointLength) {
+ if (minPointLength) {
+ barH = minPointLength;
+ barY =
+ mathRound(mathAbs(barY - translatedThreshold) > minPointLength ? // stacked
+ yBottom - minPointLength : // keep position
+ translatedThreshold - (yAxis.translate(point.y, 0, 1, 0, 1) <= translatedThreshold ? minPointLength : 0)); // use exact yAxis.translation (#1485)
+ }
+ }
+
+ // Cache for access in polar
+ point.barX = barX;
+ point.pointWidth = pointWidth;
+
+ // Fix the tooltip on center of grouped columns (#1216, #424)
+ point.tooltipPos = chart.inverted ?
+ [yAxis.len - plotY, series.xAxis.len - barX - barW / 2] :
+ [barX + barW / 2, plotY + yAxis.pos - chart.plotTop];
+
+ // Round off to obtain crisp edges and avoid overlapping with neighbours (#2694)
+ right = mathRound(barX + barW) + xCrisp;
+ barX = mathRound(barX) + xCrisp;
+ barW = right - barX;
+
+ fromTop = mathAbs(barY) < 0.5;
+ bottom = mathRound(barY + barH) + yCrisp;
+ barY = mathRound(barY) + yCrisp;
+ barH = bottom - barY;
+
+ // Top edges are exceptions
+ if (fromTop) {
+ barY -= 1;
+ barH += 1;
+ }
+
+ // Register shape type and arguments to be used in drawPoints
+ point.shapeType = 'rect';
+ point.shapeArgs = {
+ x: barX,
+ y: barY,
+ width: barW,
+ height: barH
+ };
+
+ });
+
+ },
+
+ getSymbol: noop,
+
+ /**
+ * Use a solid rectangle like the area series types
+ */
+ drawLegendSymbol: LegendSymbolMixin.drawRectangle,
+
+
+ /**
+ * Columns have no graph
+ */
+ drawGraph: noop,
+
+ /**
+ * Draw the columns. For bars, the series.group is rotated, so the same coordinates
+ * apply for columns and bars. This method is inherited by scatter series.
+ *
+ */
+ drawPoints: function () {
+ var series = this,
+ chart = this.chart,
+ options = series.options,
+ renderer = chart.renderer,
+ animationLimit = options.animationLimit || 250,
+ shapeArgs,
+ pointAttr;
+
+ // draw the columns
+ each(series.points, function (point) {
+ var plotY = point.plotY,
+ graphic = point.graphic,
+ borderAttr;
+
+ if (plotY !== UNDEFINED && !isNaN(plotY) && point.y !== null) {
+ shapeArgs = point.shapeArgs;
+
+ borderAttr = defined(series.borderWidth) ? {
+ 'stroke-width': series.borderWidth
+ } : {};
+
+ pointAttr = point.pointAttr[point.selected ? SELECT_STATE : NORMAL_STATE] || series.pointAttr[NORMAL_STATE];
+
+ if (graphic) { // update
+ stop(graphic);
+ graphic.attr(borderAttr)[chart.pointCount < animationLimit ? 'animate' : 'attr'](merge(shapeArgs));
+
+ } else {
+ point.graphic = graphic = renderer[point.shapeType](shapeArgs)
+ .attr(pointAttr)
+ .attr(borderAttr)
+ .add(series.group)
+ .shadow(options.shadow, null, options.stacking && !options.borderRadius);
+ }
+
+ } else if (graphic) {
+ point.graphic = graphic.destroy(); // #1269
+ }
+ });
+ },
+
+ /**
+ * Animate the column heights one by one from zero
+ * @param {Boolean} init Whether to initialize the animation or run it
+ */
+ animate: function (init) {
+ var series = this,
+ yAxis = this.yAxis,
+ options = series.options,
+ inverted = this.chart.inverted,
+ attr = {},
+ translatedThreshold;
+
+ if (hasSVG) { // VML is too slow anyway
+ if (init) {
+ attr.scaleY = 0.001;
+ translatedThreshold = mathMin(yAxis.pos + yAxis.len, mathMax(yAxis.pos, yAxis.toPixels(options.threshold)));
+ if (inverted) {
+ attr.translateX = translatedThreshold - yAxis.len;
+ } else {
+ attr.translateY = translatedThreshold;
+ }
+ series.group.attr(attr);
+
+ } else { // run the animation
+
+ attr.scaleY = 1;
+ attr[inverted ? 'translateX' : 'translateY'] = yAxis.pos;
+ series.group.animate(attr, series.options.animation);
+
+ // delete this function to allow it only once
+ series.animate = null;
+ }
+ }
+ },
+
+ /**
+ * Remove this series from the chart
+ */
+ remove: function () {
+ var series = this,
+ chart = series.chart;
+
+ // column and bar series affects other series of the same type
+ // as they are either stacked or grouped
+ if (chart.hasRendered) {
+ each(chart.series, function (otherSeries) {
+ if (otherSeries.type === series.type) {
+ otherSeries.isDirty = true;
+ }
+ });
+ }
+
+ Series.prototype.remove.apply(series, arguments);
+ }
+ });
+ seriesTypes.column = ColumnSeries;
+
+
+ /**
+ * Set the default options for bar
+ */
+ defaultPlotOptions.bar = merge(defaultPlotOptions.column);
+ /**
+ * The Bar series class
+ */
+ var BarSeries = extendClass(ColumnSeries, {
+ type: 'bar',
+ inverted: true
+ });
+ seriesTypes.bar = BarSeries;
+
+
+
+ /**
+ * Set the default options for scatter
+ */
+ defaultPlotOptions.scatter = merge(defaultSeriesOptions, {
+ lineWidth: 0,
+ tooltip: {
+ headerFormat: '\u25CF {series.name} ',
+ pointFormat: 'x: {point.x} y: {point.y} '
+ },
+ stickyTracking: false
+ });
+
+ /**
+ * The scatter series class
+ */
+ var ScatterSeries = extendClass(Series, {
+ type: 'scatter',
+ sorted: false,
+ requireSorting: false,
+ noSharedTooltip: true,
+ trackerGroups: ['markerGroup', 'dataLabelsGroup'],
+ takeOrdinalPosition: false, // #2342
+ singularTooltips: true,
+ drawGraph: function () {
+ if (this.options.lineWidth) {
+ Series.prototype.drawGraph.call(this);
+ }
+ }
+ });
+
+ seriesTypes.scatter = ScatterSeries;
+
+
+
+ /**
+ * Set the default options for pie
+ */
+ defaultPlotOptions.pie = merge(defaultSeriesOptions, {
+ borderColor: '#FFFFFF',
+ borderWidth: 1,
+ center: [null, null],
+ clip: false,
+ colorByPoint: true, // always true for pies
+ dataLabels: {
+ // align: null,
+ // connectorWidth: 1,
+ // connectorColor: point.color,
+ // connectorPadding: 5,
+ distance: 30,
+ enabled: true,
+ formatter: function () { // #2945
+ return this.point.name;
+ }
+ // softConnector: true,
+ //y: 0
+ },
+ ignoreHiddenPoint: true,
+ //innerSize: 0,
+ legendType: 'point',
+ marker: null, // point options are specified in the base options
+ size: null,
+ showInLegend: false,
+ slicedOffset: 10,
+ states: {
+ hover: {
+ brightness: 0.1,
+ shadow: false
+ }
+ },
+ stickyTracking: false,
+ tooltip: {
+ followPointer: true
+ }
+ });
+
+ /**
+ * Extended point object for pies
+ */
+ var PiePoint = extendClass(Point, {
+ /**
+ * Initiate the pie slice
+ */
+ init: function () {
+
+ Point.prototype.init.apply(this, arguments);
+
+ var point = this,
+ toggleSlice;
+
+ // Disallow negative values (#1530)
+ if (point.y < 0) {
+ point.y = null;
+ }
+
+ //visible: options.visible !== false,
+ extend(point, {
+ visible: point.visible !== false,
+ name: pick(point.name, 'Slice')
+ });
+
+ // add event listener for select
+ toggleSlice = function (e) {
+ point.slice(e.type === 'select');
+ };
+ addEvent(point, 'select', toggleSlice);
+ addEvent(point, 'unselect', toggleSlice);
+
+ return point;
+ },
+
+ /**
+ * Toggle the visibility of the pie slice
+ * @param {Boolean} vis Whether to show the slice or not. If undefined, the
+ * visibility is toggled
+ */
+ setVisible: function (vis) {
+ var point = this,
+ series = point.series,
+ chart = series.chart;
+
+ // if called without an argument, toggle visibility
+ point.visible = point.options.visible = vis = vis === UNDEFINED ? !point.visible : vis;
+ series.options.data[inArray(point, series.data)] = point.options; // update userOptions.data
+
+ // Show and hide associated elements
+ each(['graphic', 'dataLabel', 'connector', 'shadowGroup'], function (key) {
+ if (point[key]) {
+ point[key][vis ? 'show' : 'hide'](true);
+ }
+ });
+
+ if (point.legendItem) {
+ chart.legend.colorizeItem(point, vis);
+ }
+
+ // Handle ignore hidden slices
+ if (!series.isDirty && series.options.ignoreHiddenPoint) {
+ series.isDirty = true;
+ chart.redraw();
+ }
+ },
+
+ /**
+ * Set or toggle whether the slice is cut out from the pie
+ * @param {Boolean} sliced When undefined, the slice state is toggled
+ * @param {Boolean} redraw Whether to redraw the chart. True by default.
+ */
+ slice: function (sliced, redraw, animation) {
+ var point = this,
+ series = point.series,
+ chart = series.chart,
+ translation;
+
+ setAnimation(animation, chart);
+
+ // redraw is true by default
+ redraw = pick(redraw, true);
+
+ // if called without an argument, toggle
+ point.sliced = point.options.sliced = sliced = defined(sliced) ? sliced : !point.sliced;
+ series.options.data[inArray(point, series.data)] = point.options; // update userOptions.data
+
+ translation = sliced ? point.slicedTranslation : {
+ translateX: 0,
+ translateY: 0
+ };
+
+ point.graphic.animate(translation);
+
+ if (point.shadowGroup) {
+ point.shadowGroup.animate(translation);
+ }
+
+ },
+
+ haloPath: function (size) {
+ var shapeArgs = this.shapeArgs,
+ chart = this.series.chart;
+
+ return this.sliced || !this.visible ? [] : this.series.chart.renderer.symbols.arc(chart.plotLeft + shapeArgs.x, chart.plotTop + shapeArgs.y, shapeArgs.r + size, shapeArgs.r + size, {
+ innerR: this.shapeArgs.r,
+ start: shapeArgs.start,
+ end: shapeArgs.end
+ });
+ }
+ });
+
+ /**
+ * The Pie series class
+ */
+ var PieSeries = {
+ type: 'pie',
+ isCartesian: false,
+ pointClass: PiePoint,
+ requireSorting: false,
+ noSharedTooltip: true,
+ trackerGroups: ['group', 'dataLabelsGroup'],
+ axisTypes: [],
+ pointAttrToOptions: { // mapping between SVG attributes and the corresponding options
+ stroke: 'borderColor',
+ 'stroke-width': 'borderWidth',
+ fill: 'color'
+ },
+ singularTooltips: true,
+
+ /**
+ * Pies have one color each point
+ */
+ getColor: noop,
+
+ /**
+ * Animate the pies in
+ */
+ animate: function (init) {
+ var series = this,
+ points = series.points,
+ startAngleRad = series.startAngleRad;
+
+ if (!init) {
+ each(points, function (point) {
+ var graphic = point.graphic,
+ args = point.shapeArgs;
+
+ if (graphic) {
+ // start values
+ graphic.attr({
+ r: series.center[3] / 2, // animate from inner radius (#779)
+ start: startAngleRad,
+ end: startAngleRad
+ });
+
+ // animate
+ graphic.animate({
+ r: args.r,
+ start: args.start,
+ end: args.end
+ }, series.options.animation);
+ }
+ });
+
+ // delete this function to allow it only once
+ series.animate = null;
+ }
+ },
+
+ /**
+ * Extend the basic setData method by running processData and generatePoints immediately,
+ * in order to access the points from the legend.
+ */
+ setData: function (data, redraw, animation, updatePoints) {
+ Series.prototype.setData.call(this, data, false, animation, updatePoints);
+ this.processData();
+ this.generatePoints();
+ if (pick(redraw, true)) {
+ this.chart.redraw(animation);
+ }
+ },
+
+ /**
+ * Extend the generatePoints method by adding total and percentage properties to each point
+ */
+ generatePoints: function () {
+ var i,
+ total = 0,
+ points,
+ len,
+ point,
+ ignoreHiddenPoint = this.options.ignoreHiddenPoint;
+
+ Series.prototype.generatePoints.call(this);
+
+ // Populate local vars
+ points = this.points;
+ len = points.length;
+
+ // Get the total sum
+ for (i = 0; i < len; i++) {
+ point = points[i];
+ total += (ignoreHiddenPoint && !point.visible) ? 0 : point.y;
+ }
+ this.total = total;
+
+ // Set each point's properties
+ for (i = 0; i < len; i++) {
+ point = points[i];
+ point.percentage = total > 0 ? (point.y / total) * 100 : 0;
+ point.total = total;
+ }
+
+ },
+
+ /**
+ * Do translation for pie slices
+ */
+ translate: function (positions) {
+ this.generatePoints();
+
+ var series = this,
+ cumulative = 0,
+ precision = 1000, // issue #172
+ options = series.options,
+ slicedOffset = options.slicedOffset,
+ connectorOffset = slicedOffset + options.borderWidth,
+ start,
+ end,
+ angle,
+ startAngle = options.startAngle || 0,
+ startAngleRad = series.startAngleRad = mathPI / 180 * (startAngle - 90),
+ endAngleRad = series.endAngleRad = mathPI / 180 * ((pick(options.endAngle, startAngle + 360)) - 90),
+ circ = endAngleRad - startAngleRad, //2 * mathPI,
+ points = series.points,
+ radiusX, // the x component of the radius vector for a given point
+ radiusY,
+ labelDistance = options.dataLabels.distance,
+ ignoreHiddenPoint = options.ignoreHiddenPoint,
+ i,
+ len = points.length,
+ point;
+
+ // Get positions - either an integer or a percentage string must be given.
+ // If positions are passed as a parameter, we're in a recursive loop for adjusting
+ // space for data labels.
+ if (!positions) {
+ series.center = positions = series.getCenter();
+ }
+
+ // utility for getting the x value from a given y, used for anticollision logic in data labels
+ series.getX = function (y, left) {
+
+ angle = math.asin(mathMin((y - positions[1]) / (positions[2] / 2 + labelDistance), 1));
+
+ return positions[0] +
+ (left ? -1 : 1) *
+ (mathCos(angle) * (positions[2] / 2 + labelDistance));
+ };
+
+ // Calculate the geometry for each point
+ for (i = 0; i < len; i++) {
+
+ point = points[i];
+
+ // set start and end angle
+ start = startAngleRad + (cumulative * circ);
+ if (!ignoreHiddenPoint || point.visible) {
+ cumulative += point.percentage / 100;
+ }
+ end = startAngleRad + (cumulative * circ);
+
+ // set the shape
+ point.shapeType = 'arc';
+ point.shapeArgs = {
+ x: positions[0],
+ y: positions[1],
+ r: positions[2] / 2,
+ innerR: positions[3] / 2,
+ start: mathRound(start * precision) / precision,
+ end: mathRound(end * precision) / precision
+ };
+
+ // The angle must stay within -90 and 270 (#2645)
+ angle = (end + start) / 2;
+ if (angle > 1.5 * mathPI) {
+ angle -= 2 * mathPI;
+ } else if (angle < -mathPI / 2) {
+ angle += 2 * mathPI;
+ }
+
+ // Center for the sliced out slice
+ point.slicedTranslation = {
+ translateX: mathRound(mathCos(angle) * slicedOffset),
+ translateY: mathRound(mathSin(angle) * slicedOffset)
+ };
+
+ // set the anchor point for tooltips
+ radiusX = mathCos(angle) * positions[2] / 2;
+ radiusY = mathSin(angle) * positions[2] / 2;
+ point.tooltipPos = [
+ positions[0] + radiusX * 0.7,
+ positions[1] + radiusY * 0.7
+ ];
+
+ point.half = angle < -mathPI / 2 || angle > mathPI / 2 ? 1 : 0;
+ point.angle = angle;
+
+ // set the anchor point for data labels
+ connectorOffset = mathMin(connectorOffset, labelDistance / 2); // #1678
+ point.labelPos = [
+ positions[0] + radiusX + mathCos(angle) * labelDistance, // first break of connector
+ positions[1] + radiusY + mathSin(angle) * labelDistance, // a/a
+ positions[0] + radiusX + mathCos(angle) * connectorOffset, // second break, right outside pie
+ positions[1] + radiusY + mathSin(angle) * connectorOffset, // a/a
+ positions[0] + radiusX, // landing point for connector
+ positions[1] + radiusY, // a/a
+ labelDistance < 0 ? // alignment
+ 'center' :
+ point.half ? 'right' : 'left', // alignment
+ angle // center angle
+ ];
+
+ }
+ },
+
+ drawGraph: null,
+
+ /**
+ * Draw the data points
+ */
+ drawPoints: function () {
+ var series = this,
+ chart = series.chart,
+ renderer = chart.renderer,
+ groupTranslation,
+ //center,
+ graphic,
+ //group,
+ shadow = series.options.shadow,
+ shadowGroup,
+ shapeArgs;
+
+ if (shadow && !series.shadowGroup) {
+ series.shadowGroup = renderer.g('shadow')
+ .add(series.group);
+ }
+
+ // draw the slices
+ each(series.points, function (point) {
+ graphic = point.graphic;
+ shapeArgs = point.shapeArgs;
+ shadowGroup = point.shadowGroup;
+
+ // put the shadow behind all points
+ if (shadow && !shadowGroup) {
+ shadowGroup = point.shadowGroup = renderer.g('shadow')
+ .add(series.shadowGroup);
+ }
+
+ // if the point is sliced, use special translation, else use plot area traslation
+ groupTranslation = point.sliced ? point.slicedTranslation : {
+ translateX: 0,
+ translateY: 0
+ };
+
+ //group.translate(groupTranslation[0], groupTranslation[1]);
+ if (shadowGroup) {
+ shadowGroup.attr(groupTranslation);
+ }
+
+ // draw the slice
+ if (graphic) {
+ graphic.animate(extend(shapeArgs, groupTranslation));
+ } else {
+ point.graphic = graphic = renderer[point.shapeType](shapeArgs)
+ .setRadialReference(series.center)
+ .attr(
+ point.pointAttr[point.selected ? SELECT_STATE : NORMAL_STATE]
+ )
+ .attr({
+ 'stroke-linejoin': 'round'
+ //zIndex: 1 // #2722 (reversed)
+ })
+ .attr(groupTranslation)
+ .add(series.group)
+ .shadow(shadow, shadowGroup);
+ }
+
+ // detect point specific visibility (#2430)
+ if (point.visible !== undefined) {
+ point.setVisible(point.visible);
+ }
+
+ });
+
+ },
+
+ /**
+ * Utility for sorting data labels
+ */
+ sortByAngle: function (points, sign) {
+ points.sort(function (a, b) {
+ return a.angle !== undefined && (b.angle - a.angle) * sign;
+ });
+ },
+
+ /**
+ * Use a simple symbol from LegendSymbolMixin
+ */
+ drawLegendSymbol: LegendSymbolMixin.drawRectangle,
+
+ /**
+ * Use the getCenter method from drawLegendSymbol
+ */
+ getCenter: CenteredSeriesMixin.getCenter,
+
+ /**
+ * Pies don't have point marker symbols
+ */
+ getSymbol: noop
+
+ };
+ PieSeries = extendClass(Series, PieSeries);
+ seriesTypes.pie = PieSeries;
+
+
+
+ /**
+ * Draw the data labels
+ */
+ Series.prototype.drawDataLabels = function () {
+
+ var series = this,
+ seriesOptions = series.options,
+ cursor = seriesOptions.cursor,
+ options = seriesOptions.dataLabels,
+ points = series.points,
+ pointOptions,
+ generalOptions,
+ hasRendered = series.hasRendered || 0,
+ str,
+ dataLabelsGroup;
+
+ if (options.enabled || series._hasPointLabels) {
+
+ // Process default alignment of data labels for columns
+ if (series.dlProcessOptions) {
+ series.dlProcessOptions(options);
+ }
+
+ // Create a separate group for the data labels to avoid rotation
+ dataLabelsGroup = series.plotGroup(
+ 'dataLabelsGroup',
+ 'data-labels',
+ options.defer ? HIDDEN : VISIBLE,
+ options.zIndex || 6
+ );
+
+ if (pick(options.defer, true)) {
+ dataLabelsGroup.attr({ opacity: +hasRendered }); // #3300
+ if (!hasRendered) {
+ addEvent(series, 'afterAnimate', function () {
+ if (series.visible) { // #3023, #3024
+ dataLabelsGroup.show();
+ }
+ dataLabelsGroup[seriesOptions.animation ? 'animate' : 'attr']({ opacity: 1 }, { duration: 200 });
+ });
+ }
+ }
+
+ // Make the labels for each point
+ generalOptions = options;
+ each(points, function (point) {
+
+ var enabled,
+ dataLabel = point.dataLabel,
+ labelConfig,
+ attr,
+ name,
+ rotation,
+ connector = point.connector,
+ isNew = true;
+
+ // Determine if each data label is enabled
+ pointOptions = point.options && point.options.dataLabels;
+ enabled = pick(pointOptions && pointOptions.enabled, generalOptions.enabled); // #2282
+
+
+ // If the point is outside the plot area, destroy it. #678, #820
+ if (dataLabel && !enabled) {
+ point.dataLabel = dataLabel.destroy();
+
+ // Individual labels are disabled if the are explicitly disabled
+ // in the point options, or if they fall outside the plot area.
+ } else if (enabled) {
+
+ // Create individual options structure that can be extended without
+ // affecting others
+ options = merge(generalOptions, pointOptions);
+
+ rotation = options.rotation;
+
+ // Get the string
+ labelConfig = point.getLabelConfig();
+ str = options.format ?
+ format(options.format, labelConfig) :
+ options.formatter.call(labelConfig, options);
+
+ // Determine the color
+ options.style.color = pick(options.color, options.style.color, series.color, 'black');
+
+
+ // update existing label
+ if (dataLabel) {
+
+ if (defined(str)) {
+ dataLabel
+ .attr({
+ text: str
+ });
+ isNew = false;
+
+ } else { // #1437 - the label is shown conditionally
+ point.dataLabel = dataLabel = dataLabel.destroy();
+ if (connector) {
+ point.connector = connector.destroy();
+ }
+ }
+
+ // create new label
+ } else if (defined(str)) {
+ attr = {
+ //align: align,
+ fill: options.backgroundColor,
+ stroke: options.borderColor,
+ 'stroke-width': options.borderWidth,
+ r: options.borderRadius || 0,
+ rotation: rotation,
+ padding: options.padding,
+ zIndex: 1
+ };
+ // Remove unused attributes (#947)
+ for (name in attr) {
+ if (attr[name] === UNDEFINED) {
+ delete attr[name];
+ }
+ }
+
+ dataLabel = point.dataLabel = series.chart.renderer[rotation ? 'text' : 'label']( // labels don't support rotation
+ str,
+ 0,
+ -999,
+ null,
+ null,
+ null,
+ options.useHTML
+ )
+ .attr(attr)
+ .css(extend(options.style, cursor && { cursor: cursor }))
+ .add(dataLabelsGroup)
+ .shadow(options.shadow);
+
+ }
+
+ if (dataLabel) {
+ // Now the data label is created and placed at 0,0, so we need to align it
+ series.alignDataLabel(point, dataLabel, options, null, isNew);
+ }
+ }
+ });
+ }
+ };
+
+ /**
+ * Align each individual data label
+ */
+ Series.prototype.alignDataLabel = function (point, dataLabel, options, alignTo, isNew) {
+ var chart = this.chart,
+ inverted = chart.inverted,
+ plotX = pick(point.plotX, -999),
+ plotY = pick(point.plotY, -999),
+ bBox = dataLabel.getBBox(),
+ // Math.round for rounding errors (#2683), alignTo to allow column labels (#2700)
+ visible = this.visible && (point.series.forceDL || chart.isInsidePlot(plotX, mathRound(plotY), inverted) ||
+ (alignTo && chart.isInsidePlot(plotX, inverted ? alignTo.x + 1 : alignTo.y + alignTo.height - 1, inverted))),
+ alignAttr; // the final position;
+
+ if (visible) {
+
+ // The alignment box is a singular point
+ alignTo = extend({
+ x: inverted ? chart.plotWidth - plotY : plotX,
+ y: mathRound(inverted ? chart.plotHeight - plotX : plotY),
+ width: 0,
+ height: 0
+ }, alignTo);
+
+ // Add the text size for alignment calculation
+ extend(options, {
+ width: bBox.width,
+ height: bBox.height
+ });
+
+ // Allow a hook for changing alignment in the last moment, then do the alignment
+ if (options.rotation) { // Fancy box alignment isn't supported for rotated text
+ dataLabel[isNew ? 'attr' : 'animate']({
+ x: alignTo.x + options.x + alignTo.width / 2,
+ y: alignTo.y + options.y + alignTo.height / 2
+ })
+ .attr({ // #3003
+ align: options.align
+ });
+ } else {
+ dataLabel.align(options, null, alignTo);
+ alignAttr = dataLabel.alignAttr;
+
+ // Handle justify or crop
+ if (pick(options.overflow, 'justify') === 'justify') {
+ this.justifyDataLabel(dataLabel, options, alignAttr, bBox, alignTo, isNew);
+
+ } else if (pick(options.crop, true)) {
+ // Now check that the data label is within the plot area
+ visible = chart.isInsidePlot(alignAttr.x, alignAttr.y) && chart.isInsidePlot(alignAttr.x + bBox.width, alignAttr.y + bBox.height);
+
+ }
+ }
+ }
+
+ // Show or hide based on the final aligned position
+ if (!visible) {
+ dataLabel.attr({ y: -999 });
+ dataLabel.placed = false; // don't animate back in
+ }
+
+ };
+
+ /**
+ * If data labels fall partly outside the plot area, align them back in, in a way that
+ * doesn't hide the point.
+ */
+ Series.prototype.justifyDataLabel = function (dataLabel, options, alignAttr, bBox, alignTo, isNew) {
+ var chart = this.chart,
+ align = options.align,
+ verticalAlign = options.verticalAlign,
+ off,
+ justified;
+
+ // Off left
+ off = alignAttr.x;
+ if (off < 0) {
+ if (align === 'right') {
+ options.align = 'left';
+ } else {
+ options.x = -off;
+ }
+ justified = true;
+ }
+
+ // Off right
+ off = alignAttr.x + bBox.width;
+ if (off > chart.plotWidth) {
+ if (align === 'left') {
+ options.align = 'right';
+ } else {
+ options.x = chart.plotWidth - off;
+ }
+ justified = true;
+ }
+
+ // Off top
+ off = alignAttr.y;
+ if (off < 0) {
+ if (verticalAlign === 'bottom') {
+ options.verticalAlign = 'top';
+ } else {
+ options.y = -off;
+ }
+ justified = true;
+ }
+
+ // Off bottom
+ off = alignAttr.y + bBox.height;
+ if (off > chart.plotHeight) {
+ if (verticalAlign === 'top') {
+ options.verticalAlign = 'bottom';
+ } else {
+ options.y = chart.plotHeight - off;
+ }
+ justified = true;
+ }
+
+ if (justified) {
+ dataLabel.placed = !isNew;
+ dataLabel.align(options, null, alignTo);
+ }
+ };
+
+ /**
+ * Override the base drawDataLabels method by pie specific functionality
+ */
+ if (seriesTypes.pie) {
+ seriesTypes.pie.prototype.drawDataLabels = function () {
+ var series = this,
+ data = series.data,
+ point,
+ chart = series.chart,
+ options = series.options.dataLabels,
+ connectorPadding = pick(options.connectorPadding, 10),
+ connectorWidth = pick(options.connectorWidth, 1),
+ plotWidth = chart.plotWidth,
+ plotHeight = chart.plotHeight,
+ connector,
+ connectorPath,
+ softConnector = pick(options.softConnector, true),
+ distanceOption = options.distance,
+ seriesCenter = series.center,
+ radius = seriesCenter[2] / 2,
+ centerY = seriesCenter[1],
+ outside = distanceOption > 0,
+ dataLabel,
+ dataLabelWidth,
+ labelPos,
+ labelHeight,
+ halves = [// divide the points into right and left halves for anti collision
+ [], // right
+ [] // left
+ ],
+ x,
+ y,
+ visibility,
+ rankArr,
+ i,
+ j,
+ overflow = [0, 0, 0, 0], // top, right, bottom, left
+ sort = function (a, b) {
+ return b.y - a.y;
+ };
+
+ // get out if not enabled
+ if (!series.visible || (!options.enabled && !series._hasPointLabels)) {
+ return;
+ }
+
+ // run parent method
+ Series.prototype.drawDataLabels.apply(series);
+
+ // arrange points for detection collision
+ each(data, function (point) {
+ if (point.dataLabel && point.visible) { // #407, #2510
+ halves[point.half].push(point);
+ }
+ });
+
+ /* Loop over the points in each half, starting from the top and bottom
+ * of the pie to detect overlapping labels.
+ */
+ i = 2;
+ while (i--) {
+
+ var slots = [],
+ slotsLength,
+ usedSlots = [],
+ points = halves[i],
+ pos,
+ bottom,
+ length = points.length,
+ slotIndex;
+
+ if (!length) {
+ continue;
+ }
+
+ // Sort by angle
+ series.sortByAngle(points, i - 0.5);
+
+ // Assume equal label heights on either hemisphere (#2630)
+ j = labelHeight = 0;
+ while (!labelHeight && points[j]) { // #1569
+ labelHeight = points[j] && points[j].dataLabel && (points[j].dataLabel.getBBox().height || 21); // 21 is for #968
+ j++;
+ }
+
+ // Only do anti-collision when we are outside the pie and have connectors (#856)
+ if (distanceOption > 0) {
+
+ // Build the slots
+ bottom = mathMin(centerY + radius + distanceOption, chart.plotHeight);
+ for (pos = mathMax(0, centerY - radius - distanceOption); pos <= bottom; pos += labelHeight) {
+ slots.push(pos);
+ }
+ slotsLength = slots.length;
+
+
+ /* Visualize the slots
+ if (!series.slotElements) {
+ series.slotElements = [];
+ }
+ if (i === 1) {
+ series.slotElements.forEach(function (elem) {
+ elem.destroy();
+ });
+ series.slotElements.length = 0;
+ }
+
+ slots.forEach(function (pos, no) {
+ var slotX = series.getX(pos, i) + chart.plotLeft - (i ? 100 : 0),
+ slotY = pos + chart.plotTop;
+
+ if (!isNaN(slotX)) {
+ series.slotElements.push(chart.renderer.rect(slotX, slotY - 7, 100, labelHeight, 1)
+ .attr({
+ 'stroke-width': 1,
+ stroke: 'silver',
+ fill: 'rgba(0,0,255,0.1)'
+ })
+ .add());
+ series.slotElements.push(chart.renderer.text('Slot '+ no, slotX, slotY + 4)
+ .attr({
+ fill: 'silver'
+ }).add());
+ }
+ });
+ // */
+
+ // if there are more values than available slots, remove lowest values
+ if (length > slotsLength) {
+ // create an array for sorting and ranking the points within each quarter
+ rankArr = [].concat(points);
+ rankArr.sort(sort);
+ j = length;
+ while (j--) {
+ rankArr[j].rank = j;
+ }
+ j = length;
+ while (j--) {
+ if (points[j].rank >= slotsLength) {
+ points.splice(j, 1);
+ }
+ }
+ length = points.length;
+ }
+
+ // The label goes to the nearest open slot, but not closer to the edge than
+ // the label's index.
+ for (j = 0; j < length; j++) {
+
+ point = points[j];
+ labelPos = point.labelPos;
+
+ var closest = 9999,
+ distance,
+ slotI;
+
+ // find the closest slot index
+ for (slotI = 0; slotI < slotsLength; slotI++) {
+ distance = mathAbs(slots[slotI] - labelPos[1]);
+ if (distance < closest) {
+ closest = distance;
+ slotIndex = slotI;
+ }
+ }
+
+ // if that slot index is closer to the edges of the slots, move it
+ // to the closest appropriate slot
+ if (slotIndex < j && slots[j] !== null) { // cluster at the top
+ slotIndex = j;
+ } else if (slotsLength < length - j + slotIndex && slots[j] !== null) { // cluster at the bottom
+ slotIndex = slotsLength - length + j;
+ while (slots[slotIndex] === null) { // make sure it is not taken
+ slotIndex++;
+ }
+ } else {
+ // Slot is taken, find next free slot below. In the next run, the next slice will find the
+ // slot above these, because it is the closest one
+ while (slots[slotIndex] === null) { // make sure it is not taken
+ slotIndex++;
+ }
+ }
+
+ usedSlots.push({ i: slotIndex, y: slots[slotIndex] });
+ slots[slotIndex] = null; // mark as taken
+ }
+ // sort them in order to fill in from the top
+ usedSlots.sort(sort);
+ }
+
+ // now the used slots are sorted, fill them up sequentially
+ for (j = 0; j < length; j++) {
+
+ var slot, naturalY;
+
+ point = points[j];
+ labelPos = point.labelPos;
+ dataLabel = point.dataLabel;
+ visibility = point.visible === false ? HIDDEN : VISIBLE;
+ naturalY = labelPos[1];
+
+ if (distanceOption > 0) {
+ slot = usedSlots.pop();
+ slotIndex = slot.i;
+
+ // if the slot next to currrent slot is free, the y value is allowed
+ // to fall back to the natural position
+ y = slot.y;
+ if ((naturalY > y && slots[slotIndex + 1] !== null) ||
+ (naturalY < y && slots[slotIndex - 1] !== null)) {
+ y = mathMin(mathMax(0, naturalY), chart.plotHeight);
+ }
+
+ } else {
+ y = naturalY;
+ }
+
+ // get the x - use the natural x position for first and last slot, to prevent the top
+ // and botton slice connectors from touching each other on either side
+ x = options.justify ?
+ seriesCenter[0] + (i ? -1 : 1) * (radius + distanceOption) :
+ series.getX(y === centerY - radius - distanceOption || y === centerY + radius + distanceOption ? naturalY : y, i);
+
+
+ // Record the placement and visibility
+ dataLabel._attr = {
+ visibility: visibility,
+ align: labelPos[6]
+ };
+ dataLabel._pos = {
+ x: x + options.x +
+ ({ left: connectorPadding, right: -connectorPadding }[labelPos[6]] || 0),
+ y: y + options.y - 10 // 10 is for the baseline (label vs text)
+ };
+ dataLabel.connX = x;
+ dataLabel.connY = y;
+
+
+ // Detect overflowing data labels
+ if (this.options.size === null) {
+ dataLabelWidth = dataLabel.width;
+ // Overflow left
+ if (x - dataLabelWidth < connectorPadding) {
+ overflow[3] = mathMax(mathRound(dataLabelWidth - x + connectorPadding), overflow[3]);
+
+ // Overflow right
+ } else if (x + dataLabelWidth > plotWidth - connectorPadding) {
+ overflow[1] = mathMax(mathRound(x + dataLabelWidth - plotWidth + connectorPadding), overflow[1]);
+ }
+
+ // Overflow top
+ if (y - labelHeight / 2 < 0) {
+ overflow[0] = mathMax(mathRound(-y + labelHeight / 2), overflow[0]);
+
+ // Overflow left
+ } else if (y + labelHeight / 2 > plotHeight) {
+ overflow[2] = mathMax(mathRound(y + labelHeight / 2 - plotHeight), overflow[2]);
+ }
+ }
+ } // for each point
+ } // for each half
+
+ // Do not apply the final placement and draw the connectors until we have verified
+ // that labels are not spilling over.
+ if (arrayMax(overflow) === 0 || this.verifyDataLabelOverflow(overflow)) {
+
+ // Place the labels in the final position
+ this.placeDataLabels();
+
+ // Draw the connectors
+ if (outside && connectorWidth) {
+ each(this.points, function (point) {
+ connector = point.connector;
+ labelPos = point.labelPos;
+ dataLabel = point.dataLabel;
+
+ if (dataLabel && dataLabel._pos) {
+ visibility = dataLabel._attr.visibility;
+ x = dataLabel.connX;
+ y = dataLabel.connY;
+ connectorPath = softConnector ? [
+ M,
+ x + (labelPos[6] === 'left' ? 5 : -5), y, // end of the string at the label
+ 'C',
+ x, y, // first break, next to the label
+ 2 * labelPos[2] - labelPos[4], 2 * labelPos[3] - labelPos[5],
+ labelPos[2], labelPos[3], // second break
+ L,
+ labelPos[4], labelPos[5] // base
+ ] : [
+ M,
+ x + (labelPos[6] === 'left' ? 5 : -5), y, // end of the string at the label
+ L,
+ labelPos[2], labelPos[3], // second break
+ L,
+ labelPos[4], labelPos[5] // base
+ ];
+
+ if (connector) {
+ connector.animate({ d: connectorPath });
+ connector.attr('visibility', visibility);
+
+ } else {
+ point.connector = connector = series.chart.renderer.path(connectorPath).attr({
+ 'stroke-width': connectorWidth,
+ stroke: options.connectorColor || point.color || '#606060',
+ visibility: visibility
+ //zIndex: 0 // #2722 (reversed)
+ })
+ .add(series.dataLabelsGroup);
+ }
+ } else if (connector) {
+ point.connector = connector.destroy();
+ }
+ });
+ }
+ }
+ };
+ /**
+ * Perform the final placement of the data labels after we have verified that they
+ * fall within the plot area.
+ */
+ seriesTypes.pie.prototype.placeDataLabels = function () {
+ each(this.points, function (point) {
+ var dataLabel = point.dataLabel,
+ _pos;
+
+ if (dataLabel) {
+ _pos = dataLabel._pos;
+ if (_pos) {
+ dataLabel.attr(dataLabel._attr);
+ dataLabel[dataLabel.moved ? 'animate' : 'attr'](_pos);
+ dataLabel.moved = true;
+ } else if (dataLabel) {
+ dataLabel.attr({ y: -999 });
+ }
+ }
+ });
+ };
+
+ seriesTypes.pie.prototype.alignDataLabel = noop;
+
+ /**
+ * Verify whether the data labels are allowed to draw, or we should run more translation and data
+ * label positioning to keep them inside the plot area. Returns true when data labels are ready
+ * to draw.
+ */
+ seriesTypes.pie.prototype.verifyDataLabelOverflow = function (overflow) {
+
+ var center = this.center,
+ options = this.options,
+ centerOption = options.center,
+ minSize = options.minSize || 80,
+ newSize = minSize,
+ ret;
+
+ // Handle horizontal size and center
+ if (centerOption[0] !== null) { // Fixed center
+ newSize = mathMax(center[2] - mathMax(overflow[1], overflow[3]), minSize);
+
+ } else { // Auto center
+ newSize = mathMax(
+ center[2] - overflow[1] - overflow[3], // horizontal overflow
+ minSize
+ );
+ center[0] += (overflow[3] - overflow[1]) / 2; // horizontal center
+ }
+
+ // Handle vertical size and center
+ if (centerOption[1] !== null) { // Fixed center
+ newSize = mathMax(mathMin(newSize, center[2] - mathMax(overflow[0], overflow[2])), minSize);
+
+ } else { // Auto center
+ newSize = mathMax(
+ mathMin(
+ newSize,
+ center[2] - overflow[0] - overflow[2] // vertical overflow
+ ),
+ minSize
+ );
+ center[1] += (overflow[0] - overflow[2]) / 2; // vertical center
+ }
+
+ // If the size must be decreased, we need to run translate and drawDataLabels again
+ if (newSize < center[2]) {
+ center[2] = newSize;
+ this.translate(center);
+ each(this.points, function (point) {
+ if (point.dataLabel) {
+ point.dataLabel._pos = null; // reset
+ }
+ });
+
+ if (this.drawDataLabels) {
+ this.drawDataLabels();
+ }
+ // Else, return true to indicate that the pie and its labels is within the plot area
+ } else {
+ ret = true;
+ }
+ return ret;
+ };
+ }
+
+ if (seriesTypes.column) {
+
+ /**
+ * Override the basic data label alignment by adjusting for the position of the column
+ */
+ seriesTypes.column.prototype.alignDataLabel = function (point, dataLabel, options, alignTo, isNew) {
+ var chart = this.chart,
+ inverted = chart.inverted,
+ dlBox = point.dlBox || point.shapeArgs, // data label box for alignment
+ below = point.below || (point.plotY > pick(this.translatedThreshold, chart.plotSizeY)),
+ inside = pick(options.inside, !!this.options.stacking); // draw it inside the box?
+
+ // Align to the column itself, or the top of it
+ if (dlBox) { // Area range uses this method but not alignTo
+ alignTo = merge(dlBox);
+
+ if (inverted) {
+ alignTo = {
+ x: chart.plotWidth - alignTo.y - alignTo.height,
+ y: chart.plotHeight - alignTo.x - alignTo.width,
+ width: alignTo.height,
+ height: alignTo.width
+ };
+ }
+
+ // Compute the alignment box
+ if (!inside) {
+ if (inverted) {
+ alignTo.x += below ? 0 : alignTo.width;
+ alignTo.width = 0;
+ } else {
+ alignTo.y += below ? alignTo.height : 0;
+ alignTo.height = 0;
+ }
+ }
+ }
+
+
+ // When alignment is undefined (typically columns and bars), display the individual
+ // point below or above the point depending on the threshold
+ options.align = pick(
+ options.align,
+ !inverted || inside ? 'center' : below ? 'right' : 'left'
+ );
+ options.verticalAlign = pick(
+ options.verticalAlign,
+ inverted || inside ? 'middle' : below ? 'top' : 'bottom'
+ );
+
+ // Call the parent method
+ Series.prototype.alignDataLabel.call(this, point, dataLabel, options, alignTo, isNew);
+ };
+ }
+
+
+
+
+
+ /**
+ * TrackerMixin for points and graphs
+ */
+
+ var TrackerMixin = Highcharts.TrackerMixin = {
+
+ drawTrackerPoint: function () {
+ var series = this,
+ chart = series.chart,
+ pointer = chart.pointer,
+ cursor = series.options.cursor,
+ css = cursor && { cursor: cursor },
+ onMouseOver = function (e) {
+ var target = e.target,
+ point;
+
+ if (chart.hoverSeries !== series) {
+ series.onMouseOver();
+ }
+
+ while (target && !point) {
+ point = target.point;
+ target = target.parentNode;
+ }
+
+ if (point !== UNDEFINED && point !== chart.hoverPoint) { // undefined on graph in scatterchart
+ point.onMouseOver(e);
+ }
+ };
+
+ // Add reference to the point
+ each(series.points, function (point) {
+ if (point.graphic) {
+ point.graphic.element.point = point;
+ }
+ if (point.dataLabel) {
+ point.dataLabel.element.point = point;
+ }
+ });
+
+ // Add the event listeners, we need to do this only once
+ if (!series._hasTracking) {
+ each(series.trackerGroups, function (key) {
+ if (series[key]) { // we don't always have dataLabelsGroup
+ series[key]
+ .addClass(PREFIX + 'tracker')
+ .on('mouseover', onMouseOver)
+ .on('mouseout', function (e) { pointer.onTrackerMouseOut(e); })
+ .css(css);
+ if (hasTouch) {
+ series[key].on('touchstart', onMouseOver);
+ }
+ }
+ });
+ series._hasTracking = true;
+ }
+ },
+
+ /**
+ * Draw the tracker object that sits above all data labels and markers to
+ * track mouse events on the graph or points. For the line type charts
+ * the tracker uses the same graphPath, but with a greater stroke width
+ * for better control.
+ */
+ drawTrackerGraph: function () {
+ var series = this,
+ options = series.options,
+ trackByArea = options.trackByArea,
+ trackerPath = [].concat(trackByArea ? series.areaPath : series.graphPath),
+ trackerPathLength = trackerPath.length,
+ chart = series.chart,
+ pointer = chart.pointer,
+ renderer = chart.renderer,
+ snap = chart.options.tooltip.snap,
+ tracker = series.tracker,
+ cursor = options.cursor,
+ css = cursor && { cursor: cursor },
+ singlePoints = series.singlePoints,
+ singlePoint,
+ i,
+ onMouseOver = function () {
+ if (chart.hoverSeries !== series) {
+ series.onMouseOver();
+ }
+ },
+ /*
+ * Empirical lowest possible opacities for TRACKER_FILL for an element to stay invisible but clickable
+ * IE6: 0.002
+ * IE7: 0.002
+ * IE8: 0.002
+ * IE9: 0.00000000001 (unlimited)
+ * IE10: 0.0001 (exporting only)
+ * FF: 0.00000000001 (unlimited)
+ * Chrome: 0.000001
+ * Safari: 0.000001
+ * Opera: 0.00000000001 (unlimited)
+ */
+ TRACKER_FILL = 'rgba(192,192,192,' + (hasSVG ? 0.0001 : 0.002) + ')';
+
+ // Extend end points. A better way would be to use round linecaps,
+ // but those are not clickable in VML.
+ if (trackerPathLength && !trackByArea) {
+ i = trackerPathLength + 1;
+ while (i--) {
+ if (trackerPath[i] === M) { // extend left side
+ trackerPath.splice(i + 1, 0, trackerPath[i + 1] - snap, trackerPath[i + 2], L);
+ }
+ if ((i && trackerPath[i] === M) || i === trackerPathLength) { // extend right side
+ trackerPath.splice(i, 0, L, trackerPath[i - 2] + snap, trackerPath[i - 1]);
+ }
+ }
+ }
+
+ // handle single points
+ for (i = 0; i < singlePoints.length; i++) {
+ singlePoint = singlePoints[i];
+ trackerPath.push(M, singlePoint.plotX - snap, singlePoint.plotY,
+ L, singlePoint.plotX + snap, singlePoint.plotY);
+ }
+
+ // draw the tracker
+ if (tracker) {
+ tracker.attr({ d: trackerPath });
+ } else { // create
+
+ series.tracker = renderer.path(trackerPath)
+ .attr({
+ 'stroke-linejoin': 'round', // #1225
+ visibility: series.visible ? VISIBLE : HIDDEN,
+ stroke: TRACKER_FILL,
+ fill: trackByArea ? TRACKER_FILL : NONE,
+ 'stroke-width' : options.lineWidth + (trackByArea ? 0 : 2 * snap),
+ zIndex: 2
+ })
+ .add(series.group);
+
+ // The tracker is added to the series group, which is clipped, but is covered
+ // by the marker group. So the marker group also needs to capture events.
+ each([series.tracker, series.markerGroup], function (tracker) {
+ tracker.addClass(PREFIX + 'tracker')
+ .on('mouseover', onMouseOver)
+ .on('mouseout', function (e) { pointer.onTrackerMouseOut(e); })
+ .css(css);
+
+ if (hasTouch) {
+ tracker.on('touchstart', onMouseOver);
+ }
+ });
+ }
+ }
+ };
+ /* End TrackerMixin */
+
+
+ /**
+ * Add tracking event listener to the series group, so the point graphics
+ * themselves act as trackers
+ */
+
+ if (seriesTypes.column) {
+ ColumnSeries.prototype.drawTracker = TrackerMixin.drawTrackerPoint;
+ }
+
+ if (seriesTypes.pie) {
+ seriesTypes.pie.prototype.drawTracker = TrackerMixin.drawTrackerPoint;
+ }
+
+ if (seriesTypes.scatter) {
+ ScatterSeries.prototype.drawTracker = TrackerMixin.drawTrackerPoint;
+ }
+
+ /*
+ * Extend Legend for item events
+ */
+ extend(Legend.prototype, {
+
+ setItemEvents: function (item, legendItem, useHTML, itemStyle, itemHiddenStyle) {
+ var legend = this;
+ // Set the events on the item group, or in case of useHTML, the item itself (#1249)
+ (useHTML ? legendItem : item.legendGroup).on('mouseover', function () {
+ item.setState(HOVER_STATE);
+ legendItem.css(legend.options.itemHoverStyle);
+ })
+ .on('mouseout', function () {
+ legendItem.css(item.visible ? itemStyle : itemHiddenStyle);
+ item.setState();
+ })
+ .on('click', function (event) {
+ var strLegendItemClick = 'legendItemClick',
+ fnLegendItemClick = function () {
+ item.setVisible();
+ };
+
+ // Pass over the click/touch event. #4.
+ event = {
+ browserEvent: event
+ };
+
+ // click the name or symbol
+ if (item.firePointEvent) { // point
+ item.firePointEvent(strLegendItemClick, event, fnLegendItemClick);
+ } else {
+ fireEvent(item, strLegendItemClick, event, fnLegendItemClick);
+ }
+ });
+ },
+
+ createCheckboxForItem: function (item) {
+ var legend = this;
+
+ item.checkbox = createElement('input', {
+ type: 'checkbox',
+ checked: item.selected,
+ defaultChecked: item.selected // required by IE7
+ }, legend.options.itemCheckboxStyle, legend.chart.container);
+
+ addEvent(item.checkbox, 'click', function (event) {
+ var target = event.target;
+ fireEvent(item, 'checkboxClick', {
+ checked: target.checked
+ },
+ function () {
+ item.select();
+ }
+ );
+ });
+ }
+ });
+
+ /*
+ * Add pointer cursor to legend itemstyle in defaultOptions
+ */
+ defaultOptions.legend.itemStyle.cursor = 'pointer';
+
+
+ /*
+ * Extend the Chart object with interaction
+ */
+
+ extend(Chart.prototype, {
+ /**
+ * Display the zoom button
+ */
+ showResetZoom: function () {
+ var chart = this,
+ lang = defaultOptions.lang,
+ btnOptions = chart.options.chart.resetZoomButton,
+ theme = btnOptions.theme,
+ states = theme.states,
+ alignTo = btnOptions.relativeTo === 'chart' ? null : 'plotBox';
+
+ this.resetZoomButton = chart.renderer.button(lang.resetZoom, null, null, function () { chart.zoomOut(); }, theme, states && states.hover)
+ .attr({
+ align: btnOptions.position.align,
+ title: lang.resetZoomTitle
+ })
+ .add()
+ .align(btnOptions.position, false, alignTo);
+
+ },
+
+ /**
+ * Zoom out to 1:1
+ */
+ zoomOut: function () {
+ var chart = this;
+ fireEvent(chart, 'selection', { resetSelection: true }, function () {
+ chart.zoom();
+ });
+ },
+
+ /**
+ * Zoom into a given portion of the chart given by axis coordinates
+ * @param {Object} event
+ */
+ zoom: function (event) {
+ var chart = this,
+ hasZoomed,
+ pointer = chart.pointer,
+ displayButton = false,
+ resetZoomButton;
+
+ // If zoom is called with no arguments, reset the axes
+ if (!event || event.resetSelection) {
+ each(chart.axes, function (axis) {
+ hasZoomed = axis.zoom();
+ });
+ } else { // else, zoom in on all axes
+ each(event.xAxis.concat(event.yAxis), function (axisData) {
+ var axis = axisData.axis,
+ isXAxis = axis.isXAxis;
+
+ // don't zoom more than minRange
+ if (pointer[isXAxis ? 'zoomX' : 'zoomY'] || pointer[isXAxis ? 'pinchX' : 'pinchY']) {
+ hasZoomed = axis.zoom(axisData.min, axisData.max);
+ if (axis.displayBtn) {
+ displayButton = true;
+ }
+ }
+ });
+ }
+
+ // Show or hide the Reset zoom button
+ resetZoomButton = chart.resetZoomButton;
+ if (displayButton && !resetZoomButton) {
+ chart.showResetZoom();
+ } else if (!displayButton && isObject(resetZoomButton)) {
+ chart.resetZoomButton = resetZoomButton.destroy();
+ }
+
+
+ // Redraw
+ if (hasZoomed) {
+ chart.redraw(
+ pick(chart.options.chart.animation, event && event.animation, chart.pointCount < 100) // animation
+ );
+ }
+ },
+
+ /**
+ * Pan the chart by dragging the mouse across the pane. This function is called
+ * on mouse move, and the distance to pan is computed from chartX compared to
+ * the first chartX position in the dragging operation.
+ */
+ pan: function (e, panning) {
+
+ var chart = this,
+ hoverPoints = chart.hoverPoints,
+ doRedraw;
+
+ // remove active points for shared tooltip
+ if (hoverPoints) {
+ each(hoverPoints, function (point) {
+ point.setState();
+ });
+ }
+
+ each(panning === 'xy' ? [1, 0] : [1], function (isX) { // xy is used in maps
+ var mousePos = e[isX ? 'chartX' : 'chartY'],
+ axis = chart[isX ? 'xAxis' : 'yAxis'][0],
+ startPos = chart[isX ? 'mouseDownX' : 'mouseDownY'],
+ halfPointRange = (axis.pointRange || 0) / 2,
+ extremes = axis.getExtremes(),
+ newMin = axis.toValue(startPos - mousePos, true) + halfPointRange,
+ newMax = axis.toValue(startPos + chart[isX ? 'plotWidth' : 'plotHeight'] - mousePos, true) - halfPointRange;
+
+ if (axis.series.length && newMin > mathMin(extremes.dataMin, extremes.min) && newMax < mathMax(extremes.dataMax, extremes.max)) {
+ axis.setExtremes(newMin, newMax, false, false, { trigger: 'pan' });
+ doRedraw = true;
+ }
+
+ chart[isX ? 'mouseDownX' : 'mouseDownY'] = mousePos; // set new reference for next run
+ });
+
+ if (doRedraw) {
+ chart.redraw(false);
+ }
+ css(chart.container, { cursor: 'move' });
+ }
+ });
+
+ /*
+ * Extend the Point object with interaction
+ */
+ extend(Point.prototype, {
+ /**
+ * Toggle the selection status of a point
+ * @param {Boolean} selected Whether to select or unselect the point.
+ * @param {Boolean} accumulate Whether to add to the previous selection. By default,
+ * this happens if the control key (Cmd on Mac) was pressed during clicking.
+ */
+ select: function (selected, accumulate) {
+ var point = this,
+ series = point.series,
+ chart = series.chart;
+
+ selected = pick(selected, !point.selected);
+
+ // fire the event with the defalut handler
+ point.firePointEvent(selected ? 'select' : 'unselect', { accumulate: accumulate }, function () {
+ point.selected = point.options.selected = selected;
+ series.options.data[inArray(point, series.data)] = point.options;
+
+ point.setState(selected && SELECT_STATE);
+
+ // unselect all other points unless Ctrl or Cmd + click
+ if (!accumulate) {
+ each(chart.getSelectedPoints(), function (loopPoint) {
+ if (loopPoint.selected && loopPoint !== point) {
+ loopPoint.selected = loopPoint.options.selected = false;
+ series.options.data[inArray(loopPoint, series.data)] = loopPoint.options;
+ loopPoint.setState(NORMAL_STATE);
+ loopPoint.firePointEvent('unselect');
+ }
+ });
+ }
+ });
+ },
+
+ /**
+ * Runs on mouse over the point
+ */
+ onMouseOver: function (e) {
+ var point = this,
+ series = point.series,
+ chart = series.chart,
+ tooltip = chart.tooltip,
+ hoverPoint = chart.hoverPoint;
+
+ // set normal state to previous series
+ if (hoverPoint && hoverPoint !== point) {
+ hoverPoint.onMouseOut();
+ }
+
+ // trigger the event
+ point.firePointEvent('mouseOver');
+
+ // update the tooltip
+ if (tooltip && (!tooltip.shared || series.noSharedTooltip)) {
+ tooltip.refresh(point, e);
+ }
+
+ // hover this
+ point.setState(HOVER_STATE);
+ chart.hoverPoint = point;
+ },
+
+ /**
+ * Runs on mouse out from the point
+ */
+ onMouseOut: function () {
+ var chart = this.series.chart,
+ hoverPoints = chart.hoverPoints;
+
+ this.firePointEvent('mouseOut');
+
+ if (!hoverPoints || inArray(this, hoverPoints) === -1) { // #887, #2240
+ this.setState();
+ chart.hoverPoint = null;
+ }
+ },
+
+ /**
+ * Import events from the series' and point's options. Only do it on
+ * demand, to save processing time on hovering.
+ */
+ importEvents: function () {
+ if (!this.hasImportedEvents) {
+ var point = this,
+ options = merge(point.series.options.point, point.options),
+ events = options.events,
+ eventType;
+
+ point.events = events;
+
+ for (eventType in events) {
+ addEvent(point, eventType, events[eventType]);
+ }
+ this.hasImportedEvents = true;
+
+ }
+ },
+
+ /**
+ * Set the point's state
+ * @param {String} state
+ */
+ setState: function (state, move) {
+ var point = this,
+ plotX = point.plotX,
+ plotY = point.plotY,
+ series = point.series,
+ stateOptions = series.options.states,
+ markerOptions = defaultPlotOptions[series.type].marker && series.options.marker,
+ normalDisabled = markerOptions && !markerOptions.enabled,
+ markerStateOptions = markerOptions && markerOptions.states[state],
+ stateDisabled = markerStateOptions && markerStateOptions.enabled === false,
+ stateMarkerGraphic = series.stateMarkerGraphic,
+ pointMarker = point.marker || {},
+ chart = series.chart,
+ radius,
+ halo = series.halo,
+ haloOptions,
+ newSymbol,
+ pointAttr;
+
+ state = state || NORMAL_STATE; // empty string
+ pointAttr = point.pointAttr[state] || series.pointAttr[state];
+
+ if (
+ // already has this state
+ (state === point.state && !move) ||
+ // selected points don't respond to hover
+ (point.selected && state !== SELECT_STATE) ||
+ // series' state options is disabled
+ (stateOptions[state] && stateOptions[state].enabled === false) ||
+ // general point marker's state options is disabled
+ (state && (stateDisabled || (normalDisabled && markerStateOptions.enabled === false))) ||
+ // individual point marker's state options is disabled
+ (state && pointMarker.states && pointMarker.states[state] && pointMarker.states[state].enabled === false) // #1610
+
+ ) {
+ return;
+ }
+
+ // apply hover styles to the existing point
+ if (point.graphic) {
+ radius = markerOptions && point.graphic.symbolName && pointAttr.r;
+ point.graphic.attr(merge(
+ pointAttr,
+ radius ? { // new symbol attributes (#507, #612)
+ x: plotX - radius,
+ y: plotY - radius,
+ width: 2 * radius,
+ height: 2 * radius
+ } : {}
+ ));
+
+ // Zooming in from a range with no markers to a range with markers
+ if (stateMarkerGraphic) {
+ stateMarkerGraphic.hide();
+ }
+ } else {
+ // if a graphic is not applied to each point in the normal state, create a shared
+ // graphic for the hover state
+ if (state && markerStateOptions) {
+ radius = markerStateOptions.radius;
+ newSymbol = pointMarker.symbol || series.symbol;
+
+ // If the point has another symbol than the previous one, throw away the
+ // state marker graphic and force a new one (#1459)
+ if (stateMarkerGraphic && stateMarkerGraphic.currentSymbol !== newSymbol) {
+ stateMarkerGraphic = stateMarkerGraphic.destroy();
+ }
+
+ // Add a new state marker graphic
+ if (!stateMarkerGraphic) {
+ if (newSymbol) {
+ series.stateMarkerGraphic = stateMarkerGraphic = chart.renderer.symbol(
+ newSymbol,
+ plotX - radius,
+ plotY - radius,
+ 2 * radius,
+ 2 * radius
+ )
+ .attr(pointAttr)
+ .add(series.markerGroup);
+ stateMarkerGraphic.currentSymbol = newSymbol;
+ }
+
+ // Move the existing graphic
+ } else {
+ stateMarkerGraphic[move ? 'animate' : 'attr']({ // #1054
+ x: plotX - radius,
+ y: plotY - radius
+ });
+ }
+ }
+
+ if (stateMarkerGraphic) {
+ stateMarkerGraphic[state && chart.isInsidePlot(plotX, plotY, chart.inverted) ? 'show' : 'hide'](); // #2450
+ }
+ }
+
+ // Show me your halo
+ haloOptions = stateOptions[state] && stateOptions[state].halo;
+ if (haloOptions && haloOptions.size) {
+ if (!halo) {
+ series.halo = halo = chart.renderer.path()
+ .add(series.seriesGroup);
+ }
+ halo.attr(extend({
+ fill: Color(point.color || series.color).setOpacity(haloOptions.opacity).get()
+ }, haloOptions.attributes))[move ? 'animate' : 'attr']({
+ d: point.haloPath(haloOptions.size)
+ });
+ } else if (halo) {
+ halo.attr({ d: [] });
+ }
+
+ point.state = state;
+ },
+
+ haloPath: function (size) {
+ var series = this.series,
+ chart = series.chart,
+ plotBox = series.getPlotBox(),
+ inverted = chart.inverted;
+
+ return chart.renderer.symbols.circle(
+ plotBox.translateX + (inverted ? series.yAxis.len - this.plotY : this.plotX) - size,
+ plotBox.translateY + (inverted ? series.xAxis.len - this.plotX : this.plotY) - size,
+ size * 2,
+ size * 2
+ );
+ }
+ });
+
+ /*
+ * Extend the Series object with interaction
+ */
+
+ extend(Series.prototype, {
+ /**
+ * Series mouse over handler
+ */
+ onMouseOver: function () {
+ var series = this,
+ chart = series.chart,
+ hoverSeries = chart.hoverSeries;
+
+ // set normal state to previous series
+ if (hoverSeries && hoverSeries !== series) {
+ hoverSeries.onMouseOut();
+ }
+
+ // trigger the event, but to save processing time,
+ // only if defined
+ if (series.options.events.mouseOver) {
+ fireEvent(series, 'mouseOver');
+ }
+
+ // hover this
+ series.setState(HOVER_STATE);
+ chart.hoverSeries = series;
+ },
+
+ /**
+ * Series mouse out handler
+ */
+ onMouseOut: function () {
+ // trigger the event only if listeners exist
+ var series = this,
+ options = series.options,
+ chart = series.chart,
+ tooltip = chart.tooltip,
+ hoverPoint = chart.hoverPoint;
+
+ // trigger mouse out on the point, which must be in this series
+ if (hoverPoint) {
+ hoverPoint.onMouseOut();
+ }
+
+ // fire the mouse out event
+ if (series && options.events.mouseOut) {
+ fireEvent(series, 'mouseOut');
+ }
+
+
+ // hide the tooltip
+ if (tooltip && !options.stickyTracking && (!tooltip.shared || series.noSharedTooltip)) {
+ tooltip.hide();
+ }
+
+ // set normal state
+ series.setState();
+ chart.hoverSeries = null;
+ },
+
+ /**
+ * Set the state of the graph
+ */
+ setState: function (state) {
+ var series = this,
+ options = series.options,
+ graph = series.graph,
+ graphNeg = series.graphNeg,
+ stateOptions = options.states,
+ lineWidth = options.lineWidth,
+ attribs;
+
+ state = state || NORMAL_STATE;
+
+ if (series.state !== state) {
+ series.state = state;
+
+ if (stateOptions[state] && stateOptions[state].enabled === false) {
+ return;
+ }
+
+ if (state) {
+ lineWidth = stateOptions[state].lineWidth || lineWidth + (stateOptions[state].lineWidthPlus || 0);
+ }
+
+ if (graph && !graph.dashstyle) { // hover is turned off for dashed lines in VML
+ attribs = {
+ 'stroke-width': lineWidth
+ };
+ // use attr because animate will cause any other animation on the graph to stop
+ graph.attr(attribs);
+ if (graphNeg) {
+ graphNeg.attr(attribs);
+ }
+ }
+ }
+ },
+
+ /**
+ * Set the visibility of the graph
+ *
+ * @param vis {Boolean} True to show the series, false to hide. If UNDEFINED,
+ * the visibility is toggled.
+ */
+ setVisible: function (vis, redraw) {
+ var series = this,
+ chart = series.chart,
+ legendItem = series.legendItem,
+ showOrHide,
+ ignoreHiddenSeries = chart.options.chart.ignoreHiddenSeries,
+ oldVisibility = series.visible;
+
+ // if called without an argument, toggle visibility
+ series.visible = vis = series.userOptions.visible = vis === UNDEFINED ? !oldVisibility : vis;
+ showOrHide = vis ? 'show' : 'hide';
+
+ // show or hide elements
+ each(['group', 'dataLabelsGroup', 'markerGroup', 'tracker'], function (key) {
+ if (series[key]) {
+ series[key][showOrHide]();
+ }
+ });
+
+
+ // hide tooltip (#1361)
+ if (chart.hoverSeries === series) {
+ series.onMouseOut();
+ }
+
+
+ if (legendItem) {
+ chart.legend.colorizeItem(series, vis);
+ }
+
+
+ // rescale or adapt to resized chart
+ series.isDirty = true;
+ // in a stack, all other series are affected
+ if (series.options.stacking) {
+ each(chart.series, function (otherSeries) {
+ if (otherSeries.options.stacking && otherSeries.visible) {
+ otherSeries.isDirty = true;
+ }
+ });
+ }
+
+ // show or hide linked series
+ each(series.linkedSeries, function (otherSeries) {
+ otherSeries.setVisible(vis, false);
+ });
+
+ if (ignoreHiddenSeries) {
+ chart.isDirtyBox = true;
+ }
+ if (redraw !== false) {
+ chart.redraw();
+ }
+
+ fireEvent(series, showOrHide);
+ },
+
+ /**
+ * Memorize tooltip texts and positions
+ */
+ setTooltipPoints: function (renew) {
+ var series = this,
+ points = [],
+ pointsLength,
+ low,
+ high,
+ xAxis = series.xAxis,
+ xExtremes = xAxis && xAxis.getExtremes(),
+ axisLength = xAxis ? (xAxis.tooltipLen || xAxis.len) : series.chart.plotSizeX, // tooltipLen and tooltipPosName used in polar
+ point,
+ pointX,
+ nextPoint,
+ i,
+ tooltipPoints = []; // a lookup array for each pixel in the x dimension
+
+ // don't waste resources if tracker is disabled
+ if (series.options.enableMouseTracking === false || series.singularTooltips) {
+ return;
+ }
+
+ // renew
+ if (renew) {
+ series.tooltipPoints = null;
+ }
+
+ // concat segments to overcome null values
+ each(series.segments || series.points, function (segment) {
+ points = points.concat(segment);
+ });
+
+ // Reverse the points in case the X axis is reversed
+ if (xAxis && xAxis.reversed) {
+ points = points.reverse();
+ }
+
+ // Polar needs additional shaping
+ if (series.orderTooltipPoints) {
+ series.orderTooltipPoints(points);
+ }
+
+ // Assign each pixel position to the nearest point
+ pointsLength = points.length;
+ for (i = 0; i < pointsLength; i++) {
+ point = points[i];
+ pointX = point.x;
+ if (pointX >= xExtremes.min && pointX <= xExtremes.max) { // #1149
+ nextPoint = points[i + 1];
+
+ // Set this range's low to the last range's high plus one
+ low = high === UNDEFINED ? 0 : high + 1;
+ // Now find the new high
+ high = points[i + 1] ?
+ mathMin(mathMax(0, mathFloor( // #2070
+ (point.clientX + (nextPoint ? (nextPoint.wrappedClientX || nextPoint.clientX) : axisLength)) / 2
+ )), axisLength) :
+ axisLength;
+
+ while (low >= 0 && low <= high) {
+ tooltipPoints[low++] = point;
+ }
+ }
+ }
+ series.tooltipPoints = tooltipPoints;
+ },
+
+ /**
+ * Show the graph
+ */
+ show: function () {
+ this.setVisible(true);
+ },
+
+ /**
+ * Hide the graph
+ */
+ hide: function () {
+ this.setVisible(false);
+ },
+
+
+ /**
+ * Set the selected state of the graph
+ *
+ * @param selected {Boolean} True to select the series, false to unselect. If
+ * UNDEFINED, the selection state is toggled.
+ */
+ select: function (selected) {
+ var series = this;
+ // if called without an argument, toggle
+ series.selected = selected = (selected === UNDEFINED) ? !series.selected : selected;
+
+ if (series.checkbox) {
+ series.checkbox.checked = selected;
+ }
+
+ fireEvent(series, selected ? 'select' : 'unselect');
+ },
+
+ drawTracker: TrackerMixin.drawTrackerGraph
+ });
+
+ /* ****************************************************************************
+ * Start Bubble series code *
+ *****************************************************************************/
+
+ // 1 - set default options
+ defaultPlotOptions.bubble = merge(defaultPlotOptions.scatter, {
+ dataLabels: {
+ formatter: function () { // #2945
+ return this.point.z;
+ },
+ inside: true,
+ style: {
+ color: 'white',
+ textShadow: '0px 0px 3px black'
+ },
+ verticalAlign: 'middle'
+ },
+ // displayNegative: true,
+ marker: {
+ // fillOpacity: 0.5,
+ lineColor: null, // inherit from series.color
+ lineWidth: 1
+ },
+ minSize: 8,
+ maxSize: '20%',
+ // negativeColor: null,
+ // sizeBy: 'area'
+ states: {
+ hover: {
+ halo: {
+ size: 5
+ }
+ }
+ },
+ tooltip: {
+ pointFormat: '({point.x}, {point.y}), Size: {point.z}'
+ },
+ turboThreshold: 0,
+ zThreshold: 0
+ });
+
+ var BubblePoint = extendClass(Point, {
+ haloPath: function () {
+ return Point.prototype.haloPath.call(this, this.shapeArgs.r + this.series.options.states.hover.halo.size);
+ }
+ });
+
+ // 2 - Create the series object
+ seriesTypes.bubble = extendClass(seriesTypes.scatter, {
+ type: 'bubble',
+ pointClass: BubblePoint,
+ pointArrayMap: ['y', 'z'],
+ parallelArrays: ['x', 'y', 'z'],
+ trackerGroups: ['group', 'dataLabelsGroup'],
+ bubblePadding: true,
+
+ /**
+ * Mapping between SVG attributes and the corresponding options
+ */
+ pointAttrToOptions: {
+ stroke: 'lineColor',
+ 'stroke-width': 'lineWidth',
+ fill: 'fillColor'
+ },
+
+ /**
+ * Apply the fillOpacity to all fill positions
+ */
+ applyOpacity: function (fill) {
+ var markerOptions = this.options.marker,
+ fillOpacity = pick(markerOptions.fillOpacity, 0.5);
+
+ // When called from Legend.colorizeItem, the fill isn't predefined
+ fill = fill || markerOptions.fillColor || this.color;
+
+ if (fillOpacity !== 1) {
+ fill = Color(fill).setOpacity(fillOpacity).get('rgba');
+ }
+ return fill;
+ },
+
+ /**
+ * Extend the convertAttribs method by applying opacity to the fill
+ */
+ convertAttribs: function () {
+ var obj = Series.prototype.convertAttribs.apply(this, arguments);
+
+ obj.fill = this.applyOpacity(obj.fill);
+
+ return obj;
+ },
+
+ /**
+ * Get the radius for each point based on the minSize, maxSize and each point's Z value. This
+ * must be done prior to Series.translate because the axis needs to add padding in
+ * accordance with the point sizes.
+ */
+ getRadii: function (zMin, zMax, minSize, maxSize) {
+ var len,
+ i,
+ pos,
+ zData = this.zData,
+ radii = [],
+ sizeByArea = this.options.sizeBy !== 'width',
+ zRange;
+
+ // Set the shape type and arguments to be picked up in drawPoints
+ for (i = 0, len = zData.length; i < len; i++) {
+ zRange = zMax - zMin;
+ pos = zRange > 0 ? // relative size, a number between 0 and 1
+ (zData[i] - zMin) / (zMax - zMin) :
+ 0.5;
+ if (sizeByArea && pos >= 0) {
+ pos = Math.sqrt(pos);
+ }
+ radii.push(math.ceil(minSize + pos * (maxSize - minSize)) / 2);
+ }
+ this.radii = radii;
+ },
+
+ /**
+ * Perform animation on the bubbles
+ */
+ animate: function (init) {
+ var animation = this.options.animation;
+
+ if (!init) { // run the animation
+ each(this.points, function (point) {
+ var graphic = point.graphic,
+ shapeArgs = point.shapeArgs;
+
+ if (graphic && shapeArgs) {
+ // start values
+ graphic.attr('r', 1);
+
+ // animate
+ graphic.animate({
+ r: shapeArgs.r
+ }, animation);
+ }
+ });
+
+ // delete this function to allow it only once
+ this.animate = null;
+ }
+ },
+
+ /**
+ * Extend the base translate method to handle bubble size
+ */
+ translate: function () {
+
+ var i,
+ data = this.data,
+ point,
+ radius,
+ radii = this.radii;
+
+ // Run the parent method
+ seriesTypes.scatter.prototype.translate.call(this);
+
+ // Set the shape type and arguments to be picked up in drawPoints
+ i = data.length;
+
+ while (i--) {
+ point = data[i];
+ radius = radii ? radii[i] : 0; // #1737
+
+ // Flag for negativeColor to be applied in Series.js
+ point.negative = point.z < (this.options.zThreshold || 0);
+
+ if (radius >= this.minPxSize / 2) {
+ // Shape arguments
+ point.shapeType = 'circle';
+ point.shapeArgs = {
+ x: point.plotX,
+ y: point.plotY,
+ r: radius
+ };
+
+ // Alignment box for the data label
+ point.dlBox = {
+ x: point.plotX - radius,
+ y: point.plotY - radius,
+ width: 2 * radius,
+ height: 2 * radius
+ };
+ } else { // below zThreshold
+ point.shapeArgs = point.plotY = point.dlBox = UNDEFINED; // #1691
+ }
+ }
+ },
+
+ /**
+ * Get the series' symbol in the legend
+ *
+ * @param {Object} legend The legend object
+ * @param {Object} item The series (this) or point
+ */
+ drawLegendSymbol: function (legend, item) {
+ var radius = pInt(legend.itemStyle.fontSize) / 2;
+
+ item.legendSymbol = this.chart.renderer.circle(
+ radius,
+ legend.baseline - radius,
+ radius
+ ).attr({
+ zIndex: 3
+ }).add(item.legendGroup);
+ item.legendSymbol.isMarker = true;
+
+ },
+
+ drawPoints: seriesTypes.column.prototype.drawPoints,
+ alignDataLabel: seriesTypes.column.prototype.alignDataLabel
+ });
+
+ /**
+ * Add logic to pad each axis with the amount of pixels
+ * necessary to avoid the bubbles to overflow.
+ */
+ Axis.prototype.beforePadding = function () {
+ var axis = this,
+ axisLength = this.len,
+ chart = this.chart,
+ pxMin = 0,
+ pxMax = axisLength,
+ isXAxis = this.isXAxis,
+ dataKey = isXAxis ? 'xData' : 'yData',
+ min = this.min,
+ extremes = {},
+ smallestSize = math.min(chart.plotWidth, chart.plotHeight),
+ zMin = Number.MAX_VALUE,
+ zMax = -Number.MAX_VALUE,
+ range = this.max - min,
+ transA = axisLength / range,
+ activeSeries = [];
+
+ // Handle padding on the second pass, or on redraw
+ if (this.tickPositions) {
+ each(this.series, function (series) {
+
+ var seriesOptions = series.options,
+ zData;
+
+ if (series.bubblePadding && (series.visible || !chart.options.chart.ignoreHiddenSeries)) {
+
+ // Correction for #1673
+ axis.allowZoomOutside = true;
+
+ // Cache it
+ activeSeries.push(series);
+
+ if (isXAxis) { // because X axis is evaluated first
+
+ // For each series, translate the size extremes to pixel values
+ each(['minSize', 'maxSize'], function (prop) {
+ var length = seriesOptions[prop],
+ isPercent = /%$/.test(length);
+
+ length = pInt(length);
+ extremes[prop] = isPercent ?
+ smallestSize * length / 100 :
+ length;
+
+ });
+ series.minPxSize = extremes.minSize;
+
+ // Find the min and max Z
+ zData = series.zData;
+ if (zData.length) { // #1735
+ zMin = pick(seriesOptions.zMin, math.min(
+ zMin,
+ math.max(
+ arrayMin(zData),
+ seriesOptions.displayNegative === false ? seriesOptions.zThreshold : -Number.MAX_VALUE
+ )
+ ));
+ zMax = pick(seriesOptions.zMax, math.max(zMax, arrayMax(zData)));
+ }
+ }
+ }
+ });
+
+ each(activeSeries, function (series) {
+
+ var data = series[dataKey],
+ i = data.length,
+ radius;
+
+ if (isXAxis) {
+ series.getRadii(zMin, zMax, extremes.minSize, extremes.maxSize);
+ }
+
+ if (range > 0) {
+ while (i--) {
+ if (typeof data[i] === 'number') {
+ radius = series.radii[i];
+ pxMin = Math.min(((data[i] - min) * transA) - radius, pxMin);
+ pxMax = Math.max(((data[i] - min) * transA) + radius, pxMax);
+ }
+ }
+ }
+ });
+
+ if (activeSeries.length && range > 0 && pick(this.options.min, this.userMin) === UNDEFINED && pick(this.options.max, this.userMax) === UNDEFINED) {
+ pxMax -= axisLength;
+ transA *= (axisLength + pxMin - pxMax) / axisLength;
+ this.min += pxMin / transA;
+ this.max += pxMax / transA;
+ }
+ }
+ };
+
+ /* ****************************************************************************
+ * End Bubble series code *
+ *****************************************************************************/
+
+
+
+ // global variables
+ extend(Highcharts, {
+
+ // Constructors
+ Axis: Axis,
+ Chart: Chart,
+ Color: Color,
+ Point: Point,
+ Tick: Tick,
+ Renderer: Renderer,
+ Series: Series,
+ SVGElement: SVGElement,
+ SVGRenderer: SVGRenderer,
+
+ // Various
+ arrayMin: arrayMin,
+ arrayMax: arrayMax,
+ charts: charts,
+ dateFormat: dateFormat,
+ format: format,
+ pathAnim: pathAnim,
+ getOptions: getOptions,
+ hasBidiBug: hasBidiBug,
+ isTouchDevice: isTouchDevice,
+ numberFormat: numberFormat,
+ seriesTypes: seriesTypes,
+ setOptions: setOptions,
+ addEvent: addEvent,
+ removeEvent: removeEvent,
+ createElement: createElement,
+ discardElement: discardElement,
+ css: css,
+ each: each,
+ extend: extend,
+ map: map,
+ merge: merge,
+ pick: pick,
+ splat: splat,
+ extendClass: extendClass,
+ pInt: pInt,
+ wrap: wrap,
+ svg: hasSVG,
+ canvas: useCanVG,
+ vml: !hasSVG && !useCanVG,
+ product: PRODUCT,
+ version: VERSION
+ });
+
+
+
+ }());
diff --git a/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/contrib/jquery-3.5.0.min.js b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/contrib/jquery-3.5.0.min.js
new file mode 100644
index 00000000..47b63970
--- /dev/null
+++ b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/contrib/jquery-3.5.0.min.js
@@ -0,0 +1,2 @@
+/*! jQuery v3.5.0 | (c) JS Foundation and other contributors | jquery.org/license */
+!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.5.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"
","
"],col:[2,"
","
"],tr:[2,"
","
"],td:[3,"
","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0Sparkline: 1,4,6,6,8,5,3,5
+* $('.sparkline').sparkline();
+* There must be no spaces in the enclosed data set
+*
+* Otherwise values must be an array of numbers or null values
+*
Sparkline: This text replaced if the browser is compatible
+* $('#sparkline1').sparkline([1,4,6,6,8,5,3,5])
+* $('#sparkline2').sparkline([1,4,6,null,null,5,3,5])
+*
+* Values can also be specified in an HTML comment, or as a values attribute:
+*
Sparkline:
+*
Sparkline:
+* $('.sparkline').sparkline();
+*
+* For line charts, x values can also be specified:
+*
Sparkline: 1:1,2.7:4,3.4:6,5:6,6:8,8.7:5,9:3,10:5
+* $('#sparkline1').sparkline([ [1,1], [2.7,4], [3.4,6], [5,6], [6,8], [8.7,5], [9,3], [10,5] ])
+*
+* By default, options should be passed in as teh second argument to the sparkline function:
+* $('.sparkline').sparkline([1,2,3,4], {type: 'bar'})
+*
+* Options can also be set by passing them on the tag itself. This feature is disabled by default though
+* as there's a slight performance overhead:
+* $('.sparkline').sparkline([1,2,3,4], {enableTagOptions: true})
+*
Sparkline: loading
+* Prefix all options supplied as tag attribute with "spark" (configurable by setting tagOptionPrefix)
+*
+* Supported options:
+* lineColor - Color of the line used for the chart
+* fillColor - Color used to fill in the chart - Set to '' or false for a transparent chart
+* width - Width of the chart - Defaults to 3 times the number of values in pixels
+* height - Height of the chart - Defaults to the height of the containing element
+* chartRangeMin - Specify the minimum value to use for the Y range of the chart - Defaults to the minimum value supplied
+* chartRangeMax - Specify the maximum value to use for the Y range of the chart - Defaults to the maximum value supplied
+* chartRangeClip - Clip out of range values to the max/min specified by chartRangeMin and chartRangeMax
+* chartRangeMinX - Specify the minimum value to use for the X range of the chart - Defaults to the minimum value supplied
+* chartRangeMaxX - Specify the maximum value to use for the X range of the chart - Defaults to the maximum value supplied
+* composite - If true then don't erase any existing chart attached to the tag, but draw
+* another chart over the top - Note that width and height are ignored if an
+* existing chart is detected.
+* tagValuesAttribute - Name of tag attribute to check for data values - Defaults to 'values'
+* enableTagOptions - Whether to check tags for sparkline options
+* tagOptionPrefix - Prefix used for options supplied as tag attributes - Defaults to 'spark'
+* disableHiddenCheck - If set to true, then the plugin will assume that charts will never be drawn into a
+* hidden dom element, avoding a browser reflow
+* disableInteraction - If set to true then all mouseover/click interaction behaviour will be disabled,
+* making the plugin perform much like it did in 1.x
+* disableTooltips - If set to true then tooltips will be disabled - Defaults to false (tooltips enabled)
+* disableHighlight - If set to true then highlighting of selected chart elements on mouseover will be disabled
+* defaults to false (highlights enabled)
+* highlightLighten - Factor to lighten/darken highlighted chart values by - Defaults to 1.4 for a 40% increase
+* tooltipContainer - Specify which DOM element the tooltip should be rendered into - defaults to document.body
+* tooltipClassname - Optional CSS classname to apply to tooltips - If not specified then a default style will be applied
+* tooltipOffsetX - How many pixels away from the mouse pointer to render the tooltip on the X axis
+* tooltipOffsetY - How many pixels away from the mouse pointer to render the tooltip on the r axis
+* tooltipFormatter - Optional callback that allows you to override the HTML displayed in the tooltip
+* callback is given arguments of (sparkline, options, fields)
+* tooltipChartTitle - If specified then the tooltip uses the string specified by this setting as a title
+* tooltipFormat - A format string or SPFormat object (or an array thereof for multiple entries)
+* to control the format of the tooltip
+* tooltipPrefix - A string to prepend to each field displayed in a tooltip
+* tooltipSuffix - A string to append to each field displayed in a tooltip
+* tooltipSkipNull - If true then null values will not have a tooltip displayed (defaults to true)
+* tooltipValueLookups - An object or range map to map field values to tooltip strings
+* (eg. to map -1 to "Lost", 0 to "Draw", and 1 to "Win")
+* numberFormatter - Optional callback for formatting numbers in tooltips
+* numberDigitGroupSep - Character to use for group separator in numbers "1,234" - Defaults to ","
+* numberDecimalMark - Character to use for the decimal point when formatting numbers - Defaults to "."
+* numberDigitGroupCount - Number of digits between group separator - Defaults to 3
+*
+* There are 7 types of sparkline, selected by supplying a "type" option of 'line' (default),
+* 'bar', 'tristate', 'bullet', 'discrete', 'pie' or 'box'
+* line - Line chart. Options:
+* spotColor - Set to '' to not end each line in a circular spot
+* minSpotColor - If set, color of spot at minimum value
+* maxSpotColor - If set, color of spot at maximum value
+* spotRadius - Radius in pixels
+* lineWidth - Width of line in pixels
+* normalRangeMin
+* normalRangeMax - If set draws a filled horizontal bar between these two values marking the "normal"
+* or expected range of values
+* normalRangeColor - Color to use for the above bar
+* drawNormalOnTop - Draw the normal range above the chart fill color if true
+* defaultPixelsPerValue - Defaults to 3 pixels of width for each value in the chart
+* highlightSpotColor - The color to use for drawing a highlight spot on mouseover - Set to null to disable
+* highlightLineColor - The color to use for drawing a highlight line on mouseover - Set to null to disable
+* valueSpots - Specify which points to draw spots on, and in which color. Accepts a range map
+*
+* bar - Bar chart. Options:
+* barColor - Color of bars for postive values
+* negBarColor - Color of bars for negative values
+* zeroColor - Color of bars with zero values
+* nullColor - Color of bars with null values - Defaults to omitting the bar entirely
+* barWidth - Width of bars in pixels
+* colorMap - Optional mappnig of values to colors to override the *BarColor values above
+* can be an Array of values to control the color of individual bars or a range map
+* to specify colors for individual ranges of values
+* barSpacing - Gap between bars in pixels
+* zeroAxis - Centers the y-axis around zero if true
+*
+* tristate - Charts values of win (>0), lose (<0) or draw (=0)
+* posBarColor - Color of win values
+* negBarColor - Color of lose values
+* zeroBarColor - Color of draw values
+* barWidth - Width of bars in pixels
+* barSpacing - Gap between bars in pixels
+* colorMap - Optional mappnig of values to colors to override the *BarColor values above
+* can be an Array of values to control the color of individual bars or a range map
+* to specify colors for individual ranges of values
+*
+* discrete - Options:
+* lineHeight - Height of each line in pixels - Defaults to 30% of the graph height
+* thesholdValue - Values less than this value will be drawn using thresholdColor instead of lineColor
+* thresholdColor
+*
+* bullet - Values for bullet graphs msut be in the order: target, performance, range1, range2, range3, ...
+* options:
+* targetColor - The color of the vertical target marker
+* targetWidth - The width of the target marker in pixels
+* performanceColor - The color of the performance measure horizontal bar
+* rangeColors - Colors to use for each qualitative range background color
+*
+* pie - Pie chart. Options:
+* sliceColors - An array of colors to use for pie slices
+* offset - Angle in degrees to offset the first slice - Try -90 or +90
+* borderWidth - Width of border to draw around the pie chart, in pixels - Defaults to 0 (no border)
+* borderColor - Color to use for the pie chart border - Defaults to #000
+*
+* box - Box plot. Options:
+* raw - Set to true to supply pre-computed plot points as values
+* values should be: low_outlier, low_whisker, q1, median, q3, high_whisker, high_outlier
+* When set to false you can supply any number of values and the box plot will
+* be computed for you. Default is false.
+* showOutliers - Set to true (default) to display outliers as circles
+* outlierIQR - Interquartile range used to determine outliers. Default 1.5
+* boxLineColor - Outline color of the box
+* boxFillColor - Fill color for the box
+* whiskerColor - Line color used for whiskers
+* outlierLineColor - Outline color of outlier circles
+* outlierFillColor - Fill color of the outlier circles
+* spotRadius - Radius of outlier circles
+* medianColor - Line color of the median line
+* target - Draw a target cross hair at the supplied value (default undefined)
+*
+*
+*
+* Examples:
+* $('#sparkline1').sparkline(myvalues, { lineColor: '#f00', fillColor: false });
+* $('.barsparks').sparkline('html', { type:'bar', height:'40px', barWidth:5 });
+* $('#tristate').sparkline([1,1,-1,1,0,0,-1], { type:'tristate' }):
+* $('#discrete').sparkline([1,3,4,5,5,3,4,5], { type:'discrete' });
+* $('#bullet').sparkline([10,12,12,9,7], { type:'bullet' });
+* $('#pie').sparkline([1,1,2], { type:'pie' });
+*/
+
+/*jslint regexp: true, browser: true, jquery: true, white: true, nomen: false, plusplus: false, maxerr: 500, indent: 4 */
+
+(function(document, Math, undefined) { // performance/minified-size optimization
+(function(factory) {
+ // Wait until 'jquery-3.5.0.min.js' is loaded before initialising it's return object
+ var waitForjQuery = setInterval(function () {
+ if (typeof $ != 'undefined') {
+ if (jQuery && !jQuery.fn.sparkline) {
+ factory(jQuery);
+ }
+ clearInterval(waitForjQuery);
+ }
+ }, 10);
+}
+(function($) {
+ 'use strict';
+
+ var UNSET_OPTION = {},
+ getDefaults, createClass, SPFormat, clipval, quartile, normalizeValue, normalizeValues,
+ remove, isNumber, all, sum, addCSS, ensureArray, formatNumber, RangeMap,
+ MouseHandler, Tooltip, barHighlightMixin,
+ line, bar, tristate, discrete, bullet, pie, box, defaultStyles, initStyles,
+ VShape, VCanvas_base, VCanvas_canvas, VCanvas_vml, pending, shapeCount = 0;
+
+ /**
+ * Default configuration settings
+ */
+ getDefaults = function () {
+ return {
+ // Settings common to most/all chart types
+ common: {
+ type: 'line',
+ lineColor: '#00f',
+ fillColor: '#cdf',
+ defaultPixelsPerValue: 3,
+ width: 'auto',
+ height: 'auto',
+ composite: false,
+ tagValuesAttribute: 'values',
+ tagOptionsPrefix: 'spark',
+ enableTagOptions: false,
+ enableHighlight: true,
+ highlightLighten: 1.4,
+ tooltipSkipNull: true,
+ tooltipPrefix: '',
+ tooltipSuffix: '',
+ disableHiddenCheck: false,
+ numberFormatter: false,
+ numberDigitGroupCount: 3,
+ numberDigitGroupSep: ',',
+ numberDecimalMark: '.',
+ disableTooltips: false,
+ disableInteraction: false
+ },
+ // Defaults for line charts
+ line: {
+ spotColor: '#f80',
+ highlightSpotColor: '#5f5',
+ highlightLineColor: '#f22',
+ spotRadius: 1.5,
+ minSpotColor: '#f80',
+ maxSpotColor: '#f80',
+ lineWidth: 1,
+ normalRangeMin: undefined,
+ normalRangeMax: undefined,
+ normalRangeColor: '#ccc',
+ drawNormalOnTop: false,
+ chartRangeMin: undefined,
+ chartRangeMax: undefined,
+ chartRangeMinX: undefined,
+ chartRangeMaxX: undefined,
+ tooltipFormat: new SPFormat('● {{prefix}}{{y}}{{suffix}}')
+ },
+ // Defaults for bar charts
+ bar: {
+ barColor: '#3366cc',
+ negBarColor: '#f44',
+ stackedBarColor: ['#3366cc', '#dc3912', '#ff9900', '#109618', '#66aa00',
+ '#dd4477', '#0099c6', '#990099'],
+ zeroColor: undefined,
+ nullColor: undefined,
+ zeroAxis: true,
+ barWidth: 4,
+ barSpacing: 1,
+ chartRangeMax: undefined,
+ chartRangeMin: undefined,
+ chartRangeClip: false,
+ colorMap: undefined,
+ tooltipFormat: new SPFormat('● {{prefix}}{{value}}{{suffix}}')
+ },
+ // Defaults for tristate charts
+ tristate: {
+ barWidth: 4,
+ barSpacing: 1,
+ posBarColor: '#6f6',
+ negBarColor: '#f44',
+ zeroBarColor: '#999',
+ colorMap: {},
+ tooltipFormat: new SPFormat('● {{value:map}}'),
+ tooltipValueLookups: { map: { '-1': 'Loss', '0': 'Draw', '1': 'Win' } }
+ },
+ // Defaults for discrete charts
+ discrete: {
+ lineHeight: 'auto',
+ thresholdColor: undefined,
+ thresholdValue: 0,
+ chartRangeMax: undefined,
+ chartRangeMin: undefined,
+ chartRangeClip: false,
+ tooltipFormat: new SPFormat('{{prefix}}{{value}}{{suffix}}')
+ },
+ // Defaults for bullet charts
+ bullet: {
+ targetColor: '#f33',
+ targetWidth: 3, // width of the target bar in pixels
+ performanceColor: '#33f',
+ rangeColors: ['#d3dafe', '#a8b6ff', '#7f94ff'],
+ base: undefined, // set this to a number to change the base start number
+ tooltipFormat: new SPFormat('{{fieldkey:fields}} - {{value}}'),
+ tooltipValueLookups: { fields: {r: 'Range', p: 'Performance', t: 'Target'} }
+ },
+ // Defaults for pie charts
+ pie: {
+ offset: 0,
+ sliceColors: ['#3366cc', '#dc3912', '#ff9900', '#109618', '#66aa00',
+ '#dd4477', '#0099c6', '#990099'],
+ borderWidth: 0,
+ borderColor: '#000',
+ tooltipFormat: new SPFormat('● {{value}} ({{percent.1}}%)')
+ },
+ // Defaults for box plots
+ box: {
+ raw: false,
+ boxLineColor: '#000',
+ boxFillColor: '#cdf',
+ whiskerColor: '#000',
+ outlierLineColor: '#333',
+ outlierFillColor: '#fff',
+ medianColor: '#f00',
+ showOutliers: true,
+ outlierIQR: 1.5,
+ spotRadius: 1.5,
+ target: undefined,
+ targetColor: '#4a2',
+ chartRangeMax: undefined,
+ chartRangeMin: undefined,
+ tooltipFormat: new SPFormat('{{field:fields}}: {{value}}'),
+ tooltipFormatFieldlistKey: 'field',
+ tooltipValueLookups: { fields: { lq: 'Lower Quartile', med: 'Median',
+ uq: 'Upper Quartile', lo: 'Left Outlier', ro: 'Right Outlier',
+ lw: 'Left Whisker', rw: 'Right Whisker'} }
+ }
+ };
+ };
+
+ // You can have tooltips use a css class other than jqstooltip by specifying tooltipClassname
+ defaultStyles = '.jqstooltip { ' +
+ 'position: absolute;' +
+ 'left: 0px;' +
+ 'top: 0px;' +
+ 'visibility: hidden;' +
+ 'background: rgb(0, 0, 0) transparent;' +
+ 'background-color: rgba(0,0,0,0.6);' +
+ 'filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);' +
+ '-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";' +
+ 'color: white;' +
+ 'font: 10px arial, san serif;' +
+ 'text-align: left;' +
+ 'white-space: nowrap;' +
+ 'padding: 5px;' +
+ 'border: 1px solid white;' +
+ 'z-index: 10000;' +
+ '}' +
+ '.jqsfield { ' +
+ 'color: white;' +
+ 'font: 10px arial, san serif;' +
+ 'text-align: left;' +
+ '}';
+
+ /**
+ * Utilities
+ */
+
+ createClass = function (/* [baseclass, [mixin, ...]], definition */) {
+ var Class, args;
+ Class = function () {
+ this.init.apply(this, arguments);
+ };
+ if (arguments.length > 1) {
+ if (arguments[0]) {
+ Class.prototype = $.extend(new arguments[0](), arguments[arguments.length - 1]);
+ Class._super = arguments[0].prototype;
+ } else {
+ Class.prototype = arguments[arguments.length - 1];
+ }
+ if (arguments.length > 2) {
+ args = Array.prototype.slice.call(arguments, 1, -1);
+ args.unshift(Class.prototype);
+ $.extend.apply($, args);
+ }
+ } else {
+ Class.prototype = arguments[0];
+ }
+ Class.prototype.cls = Class;
+ return Class;
+ };
+
+ /**
+ * Wraps a format string for tooltips
+ * {{x}}
+ * {{x.2}
+ * {{x:months}}
+ */
+ $.SPFormatClass = SPFormat = createClass({
+ fre: /\{\{([\w.]+?)(:(.+?))?\}\}/g,
+ precre: /(\w+)\.(\d+)/,
+
+ init: function (format, fclass) {
+ this.format = format;
+ this.fclass = fclass;
+ },
+
+ render: function (fieldset, lookups, options) {
+ var self = this,
+ fields = fieldset,
+ match, token, lookupkey, fieldvalue, prec;
+ return this.format.replace(this.fre, function () {
+ var lookup;
+ token = arguments[1];
+ lookupkey = arguments[3];
+ match = self.precre.exec(token);
+ if (match) {
+ prec = match[2];
+ token = match[1];
+ } else {
+ prec = false;
+ }
+ fieldvalue = fields[token];
+ if (fieldvalue === undefined) {
+ return '';
+ }
+ if (lookupkey && lookups && lookups[lookupkey]) {
+ lookup = lookups[lookupkey];
+ if (lookup.get) { // RangeMap
+ return lookups[lookupkey].get(fieldvalue) || fieldvalue;
+ } else {
+ return lookups[lookupkey][fieldvalue] || fieldvalue;
+ }
+ }
+ if (isNumber(fieldvalue)) {
+ if (options.get('numberFormatter')) {
+ fieldvalue = options.get('numberFormatter')(fieldvalue);
+ } else {
+ fieldvalue = formatNumber(fieldvalue, prec,
+ options.get('numberDigitGroupCount'),
+ options.get('numberDigitGroupSep'),
+ options.get('numberDecimalMark'));
+ }
+ }
+ return fieldvalue;
+ });
+ }
+ });
+
+ // convience method to avoid needing the new operator
+ $.spformat = function(format, fclass) {
+ return new SPFormat(format, fclass);
+ };
+
+ clipval = function (val, min, max) {
+ if (val < min) {
+ return min;
+ }
+ if (val > max) {
+ return max;
+ }
+ return val;
+ };
+
+ quartile = function (values, q) {
+ var vl;
+ if (q === 2) {
+ vl = Math.floor(values.length / 2);
+ return values.length % 2 ? values[vl] : (values[vl-1] + values[vl]) / 2;
+ } else {
+ if (values.length % 2 ) { // odd
+ vl = (values.length * q + q) / 4;
+ return vl % 1 ? (values[Math.floor(vl)] + values[Math.floor(vl) - 1]) / 2 : values[vl-1];
+ } else { //even
+ vl = (values.length * q + 2) / 4;
+ return vl % 1 ? (values[Math.floor(vl)] + values[Math.floor(vl) - 1]) / 2 : values[vl-1];
+
+ }
+ }
+ };
+
+ normalizeValue = function (val) {
+ var nf;
+ switch (val) {
+ case 'undefined':
+ val = undefined;
+ break;
+ case 'null':
+ val = null;
+ break;
+ case 'true':
+ val = true;
+ break;
+ case 'false':
+ val = false;
+ break;
+ default:
+ nf = parseFloat(val);
+ if (val == nf) {
+ val = nf;
+ }
+ }
+ return val;
+ };
+
+ normalizeValues = function (vals) {
+ var i, result = [];
+ for (i = vals.length; i--;) {
+ result[i] = normalizeValue(vals[i]);
+ }
+ return result;
+ };
+
+ remove = function (vals, filter) {
+ var i, vl, result = [];
+ for (i = 0, vl = vals.length; i < vl; i++) {
+ if (vals[i] !== filter) {
+ result.push(vals[i]);
+ }
+ }
+ return result;
+ };
+
+ isNumber = function (num) {
+ return !isNaN(parseFloat(num)) && isFinite(num);
+ };
+
+ formatNumber = function (num, prec, groupsize, groupsep, decsep) {
+ var p, i;
+ num = (prec === false ? parseFloat(num).toString() : num.toFixed(prec)).split('');
+ p = (p = $.inArray('.', num)) < 0 ? num.length : p;
+ if (p < num.length) {
+ num[p] = decsep;
+ }
+ for (i = p - groupsize; i > 0; i -= groupsize) {
+ num.splice(i, 0, groupsep);
+ }
+ return num.join('');
+ };
+
+ // determine if all values of an array match a value
+ // returns true if the array is empty
+ all = function (val, arr, ignoreNull) {
+ var i;
+ for (i = arr.length; i--; ) {
+ if (ignoreNull && arr[i] === null) continue;
+ if (arr[i] !== val) {
+ return false;
+ }
+ }
+ return true;
+ };
+
+ // sums the numeric values in an array, ignoring other values
+ sum = function (vals) {
+ var total = 0, i;
+ for (i = vals.length; i--;) {
+ total += typeof vals[i] === 'number' ? vals[i] : 0;
+ }
+ return total;
+ };
+
+ ensureArray = function (val) {
+ return $.isArray(val) ? val : [val];
+ };
+
+ // http://paulirish.com/2008/bookmarklet-inject-new-css-rules/
+ addCSS = function(css) {
+ var tag, iefail;
+ if (document.createStyleSheet) {
+ try {
+ document.createStyleSheet().cssText = css;
+ return;
+ } catch (e) {
+ // IE <= 9 maxes out at 31 stylesheets; inject into page instead.
+ iefail = true;
+ }
+ }
+ tag = document.createElement('style');
+ tag.type = 'text/css';
+ document.getElementsByTagName('head')[0].appendChild(tag);
+ if (iefail) {
+ document.styleSheets[document.styleSheets.length - 1].cssText = css;
+ } else {
+ tag[(typeof document.body.style.WebkitAppearance == 'string') /* webkit only */ ? 'innerText' : 'innerHTML'] = css;
+ }
+ };
+
+ // Provide a cross-browser interface to a few simple drawing primitives
+ $.fn.simpledraw = function (width, height, useExisting, interact) {
+ var target, mhandler;
+ if (useExisting && (target = this.data('_jqs_vcanvas'))) {
+ return target;
+ }
+
+ if ($.fn.sparkline.canvas === false) {
+ // We've already determined that neither Canvas nor VML are available
+ return false;
+
+ } else if ($.fn.sparkline.canvas === undefined) {
+ // No function defined yet -- need to see if we support Canvas or VML
+ var el = document.createElement('canvas');
+ if (!!(el.getContext && el.getContext('2d'))) {
+ // Canvas is available
+ $.fn.sparkline.canvas = function(width, height, target, interact) {
+ return new VCanvas_canvas(width, height, target, interact);
+ };
+ } else if (document.namespaces && !document.namespaces.v) {
+ // VML is available
+ document.namespaces.add('v', 'urn:schemas-microsoft-com:vml', '#default#VML');
+ $.fn.sparkline.canvas = function(width, height, target, interact) {
+ return new VCanvas_vml(width, height, target);
+ };
+ } else {
+ // Neither Canvas nor VML are available
+ $.fn.sparkline.canvas = false;
+ return false;
+ }
+ }
+
+ if (width === undefined) {
+ width = $(this).innerWidth();
+ }
+ if (height === undefined) {
+ height = $(this).innerHeight();
+ }
+
+ target = $.fn.sparkline.canvas(width, height, this, interact);
+
+ mhandler = $(this).data('_jqs_mhandler');
+ if (mhandler) {
+ mhandler.registerCanvas(target);
+ }
+ return target;
+ };
+
+ $.fn.cleardraw = function () {
+ var target = this.data('_jqs_vcanvas');
+ if (target) {
+ target.reset();
+ }
+ };
+
+ $.RangeMapClass = RangeMap = createClass({
+ init: function (map) {
+ var key, range, rangelist = [];
+ for (key in map) {
+ if (map.hasOwnProperty(key) && typeof key === 'string' && key.indexOf(':') > -1) {
+ range = key.split(':');
+ range[0] = range[0].length === 0 ? -Infinity : parseFloat(range[0]);
+ range[1] = range[1].length === 0 ? Infinity : parseFloat(range[1]);
+ range[2] = map[key];
+ rangelist.push(range);
+ }
+ }
+ this.map = map;
+ this.rangelist = rangelist || false;
+ },
+
+ get: function (value) {
+ var rangelist = this.rangelist,
+ i, range, result;
+ if ((result = this.map[value]) !== undefined) {
+ return result;
+ }
+ if (rangelist) {
+ for (i = rangelist.length; i--;) {
+ range = rangelist[i];
+ if (range[0] <= value && range[1] >= value) {
+ return range[2];
+ }
+ }
+ }
+ return undefined;
+ }
+ });
+
+ // Convenience function
+ $.range_map = function(map) {
+ return new RangeMap(map);
+ };
+
+ MouseHandler = createClass({
+ init: function (el, options) {
+ var $el = $(el);
+ this.$el = $el;
+ this.options = options;
+ this.currentPageX = 0;
+ this.currentPageY = 0;
+ this.el = el;
+ this.splist = [];
+ this.tooltip = null;
+ this.over = false;
+ this.displayTooltips = !options.get('disableTooltips');
+ this.highlightEnabled = !options.get('disableHighlight');
+ },
+
+ registerSparkline: function (sp) {
+ this.splist.push(sp);
+ if (this.over) {
+ this.updateDisplay();
+ }
+ },
+
+ registerCanvas: function (canvas) {
+ var $canvas = $(canvas.canvas);
+ this.canvas = canvas;
+ this.$canvas = $canvas;
+ $canvas.mouseenter($.proxy(this.mouseenter, this));
+ $canvas.mouseleave($.proxy(this.mouseleave, this));
+ $canvas.click($.proxy(this.mouseclick, this));
+ },
+
+ reset: function (removeTooltip) {
+ this.splist = [];
+ if (this.tooltip && removeTooltip) {
+ this.tooltip.remove();
+ this.tooltip = undefined;
+ }
+ },
+
+ mouseclick: function (e) {
+ var clickEvent = $.Event('sparklineClick');
+ clickEvent.originalEvent = e;
+ clickEvent.sparklines = this.splist;
+ this.$el.trigger(clickEvent);
+ },
+
+ mouseenter: function (e) {
+ $(document.body).unbind('mousemove.jqs');
+ $(document.body).bind('mousemove.jqs', $.proxy(this.mousemove, this));
+ this.over = true;
+ this.currentPageX = e.pageX;
+ this.currentPageY = e.pageY;
+ this.currentEl = e.target;
+ if (!this.tooltip && this.displayTooltips) {
+ this.tooltip = new Tooltip(this.options);
+ this.tooltip.updatePosition(e.pageX, e.pageY);
+ }
+ this.updateDisplay();
+ },
+
+ mouseleave: function () {
+ $(document.body).unbind('mousemove.jqs');
+ var splist = this.splist,
+ spcount = splist.length,
+ needsRefresh = false,
+ sp, i;
+ this.over = false;
+ this.currentEl = null;
+
+ if (this.tooltip) {
+ this.tooltip.remove();
+ this.tooltip = null;
+ }
+
+ for (i = 0; i < spcount; i++) {
+ sp = splist[i];
+ if (sp.clearRegionHighlight()) {
+ needsRefresh = true;
+ }
+ }
+
+ if (needsRefresh) {
+ this.canvas.render();
+ }
+ },
+
+ mousemove: function (e) {
+ this.currentPageX = e.pageX;
+ this.currentPageY = e.pageY;
+ this.currentEl = e.target;
+ if (this.tooltip) {
+ this.tooltip.updatePosition(e.pageX, e.pageY);
+ }
+ this.updateDisplay();
+ },
+
+ updateDisplay: function () {
+ var splist = this.splist,
+ spcount = splist.length,
+ needsRefresh = false,
+ offset = this.$canvas.offset(),
+ localX = this.currentPageX - offset.left,
+ localY = this.currentPageY - offset.top,
+ tooltiphtml, sp, i, result, changeEvent;
+ if (!this.over) {
+ return;
+ }
+ for (i = 0; i < spcount; i++) {
+ sp = splist[i];
+ result = sp.setRegionHighlight(this.currentEl, localX, localY);
+ if (result) {
+ needsRefresh = true;
+ }
+ }
+ if (needsRefresh) {
+ changeEvent = $.Event('sparklineRegionChange');
+ changeEvent.sparklines = this.splist;
+ this.$el.trigger(changeEvent);
+ if (this.tooltip) {
+ tooltiphtml = '';
+ for (i = 0; i < spcount; i++) {
+ sp = splist[i];
+ tooltiphtml += sp.getCurrentRegionTooltip();
+ }
+ this.tooltip.setContent(tooltiphtml);
+ }
+ if (!this.disableHighlight) {
+ this.canvas.render();
+ }
+ }
+ if (result === null) {
+ this.mouseleave();
+ }
+ }
+ });
+
+
+ Tooltip = createClass({
+ sizeStyle: 'position: static !important;' +
+ 'display: block !important;' +
+ 'visibility: hidden !important;' +
+ 'float: left !important;',
+
+ init: function (options) {
+ var tooltipClassname = options.get('tooltipClassname', 'jqstooltip'),
+ sizetipStyle = this.sizeStyle,
+ offset;
+ this.container = options.get('tooltipContainer') || document.body;
+ this.tooltipOffsetX = options.get('tooltipOffsetX', 10);
+ this.tooltipOffsetY = options.get('tooltipOffsetY', 12);
+ // remove any previous lingering tooltip
+ $('#jqssizetip').remove();
+ $('#jqstooltip').remove();
+ this.sizetip = $('', {
+ id: 'jqssizetip',
+ style: sizetipStyle,
+ 'class': tooltipClassname
+ });
+ this.tooltip = $('', {
+ id: 'jqstooltip',
+ 'class': tooltipClassname
+ }).appendTo(this.container);
+ // account for the container's location
+ offset = this.tooltip.offset();
+ this.offsetLeft = offset.left;
+ this.offsetTop = offset.top;
+ this.hidden = true;
+ $(window).unbind('resize.jqs scroll.jqs');
+ $(window).bind('resize.jqs scroll.jqs', $.proxy(this.updateWindowDims, this));
+ this.updateWindowDims();
+ },
+
+ updateWindowDims: function () {
+ this.scrollTop = $(window).scrollTop();
+ this.scrollLeft = $(window).scrollLeft();
+ this.scrollRight = this.scrollLeft + $(window).width();
+ this.updatePosition();
+ },
+
+ getSize: function (content) {
+ this.sizetip.html(content).appendTo(this.container);
+ this.width = this.sizetip.width() + 1;
+ this.height = this.sizetip.height();
+ this.sizetip.remove();
+ },
+
+ setContent: function (content) {
+ if (!content) {
+ this.tooltip.css('visibility', 'hidden');
+ this.hidden = true;
+ return;
+ }
+ this.getSize(content);
+ this.tooltip.html(content)
+ .css({
+ 'width': this.width,
+ 'height': this.height,
+ 'visibility': 'visible'
+ });
+ if (this.hidden) {
+ this.hidden = false;
+ this.updatePosition();
+ }
+ },
+
+ updatePosition: function (x, y) {
+ if (x === undefined) {
+ if (this.mousex === undefined) {
+ return;
+ }
+ x = this.mousex - this.offsetLeft;
+ y = this.mousey - this.offsetTop;
+
+ } else {
+ this.mousex = x = x - this.offsetLeft;
+ this.mousey = y = y - this.offsetTop;
+ }
+ if (!this.height || !this.width || this.hidden) {
+ return;
+ }
+
+ y -= this.height + this.tooltipOffsetY;
+ x += this.tooltipOffsetX;
+
+ if (y < this.scrollTop) {
+ y = this.scrollTop;
+ }
+ if (x < this.scrollLeft) {
+ x = this.scrollLeft;
+ } else if (x + this.width > this.scrollRight) {
+ x = this.scrollRight - this.width;
+ }
+
+ this.tooltip.css({
+ 'left': x,
+ 'top': y
+ });
+ },
+
+ remove: function () {
+ this.tooltip.remove();
+ this.sizetip.remove();
+ this.sizetip = this.tooltip = undefined;
+ $(window).unbind('resize.jqs scroll.jqs');
+ }
+ });
+
+ initStyles = function() {
+ addCSS(defaultStyles);
+ };
+
+ $(initStyles);
+
+ pending = [];
+ $.fn.sparkline = function (userValues, userOptions) {
+ return this.each(function () {
+ var options = new $.fn.sparkline.options(this, userOptions),
+ $this = $(this),
+ render, i;
+ render = function () {
+ var values, width, height, tmp, mhandler, sp, vals;
+ if (userValues === 'html' || userValues === undefined) {
+ vals = this.getAttribute(options.get('tagValuesAttribute'));
+ if (vals === undefined || vals === null) {
+ vals = $this.html();
+ }
+ values = vals.replace(/(^\s*\s*$)|\s+/g, '').split(',');
+ } else {
+ values = userValues;
+ }
+
+ width = options.get('width') === 'auto' ? values.length * options.get('defaultPixelsPerValue') : options.get('width');
+ if (options.get('height') === 'auto') {
+ if (!options.get('composite') || !$.data(this, '_jqs_vcanvas')) {
+ // must be a better way to get the line height
+ tmp = document.createElement('span');
+ tmp.innerHTML = 'a';
+ $this.html(tmp);
+ height = $(tmp).innerHeight() || $(tmp).height();
+ $(tmp).remove();
+ tmp = null;
+ }
+ } else {
+ height = options.get('height');
+ }
+
+ if (!options.get('disableInteraction')) {
+ mhandler = $.data(this, '_jqs_mhandler');
+ if (!mhandler) {
+ mhandler = new MouseHandler(this, options);
+ $.data(this, '_jqs_mhandler', mhandler);
+ } else if (!options.get('composite')) {
+ mhandler.reset();
+ }
+ } else {
+ mhandler = false;
+ }
+
+ if (options.get('composite') && !$.data(this, '_jqs_vcanvas')) {
+ if (!$.data(this, '_jqs_errnotify')) {
+ alert('Attempted to attach a composite sparkline to an element with no existing sparkline');
+ $.data(this, '_jqs_errnotify', true);
+ }
+ return;
+ }
+
+ sp = new $.fn.sparkline[options.get('type')](this, values, options, width, height);
+
+ sp.render();
+
+ if (mhandler) {
+ mhandler.registerSparkline(sp);
+ }
+ };
+ if (($(this).html() && !options.get('disableHiddenCheck') && $(this).is(':hidden')) || !$(this).parents('body').length) {
+ if (!options.get('composite') && $.data(this, '_jqs_pending')) {
+ // remove any existing references to the element
+ for (i = pending.length; i; i--) {
+ if (pending[i - 1][0] == this) {
+ pending.splice(i - 1, 1);
+ }
+ }
+ }
+ pending.push([this, render]);
+ $.data(this, '_jqs_pending', true);
+ } else {
+ render.call(this);
+ }
+ });
+ };
+
+ $.fn.sparkline.defaults = getDefaults();
+
+
+ $.sparkline_display_visible = function () {
+ var el, i, pl;
+ var done = [];
+ for (i = 0, pl = pending.length; i < pl; i++) {
+ el = pending[i][0];
+ if ($(el).is(':visible') && !$(el).parents().is(':hidden')) {
+ pending[i][1].call(el);
+ $.data(pending[i][0], '_jqs_pending', false);
+ done.push(i);
+ } else if (!$(el).closest('html').length && !$.data(el, '_jqs_pending')) {
+ // element has been inserted and removed from the DOM
+ // If it was not yet inserted into the dom then the .data request
+ // will return true.
+ // removing from the dom causes the data to be removed.
+ $.data(pending[i][0], '_jqs_pending', false);
+ done.push(i);
+ }
+ }
+ for (i = done.length; i; i--) {
+ pending.splice(done[i - 1], 1);
+ }
+ };
+
+
+ /**
+ * User option handler
+ */
+ $.fn.sparkline.options = createClass({
+ init: function (tag, userOptions) {
+ var extendedOptions, defaults, base, tagOptionType;
+ this.userOptions = userOptions = userOptions || {};
+ this.tag = tag;
+ this.tagValCache = {};
+ defaults = $.fn.sparkline.defaults;
+ base = defaults.common;
+ this.tagOptionsPrefix = userOptions.enableTagOptions && (userOptions.tagOptionsPrefix || base.tagOptionsPrefix);
+
+ tagOptionType = this.getTagSetting('type');
+ if (tagOptionType === UNSET_OPTION) {
+ extendedOptions = defaults[userOptions.type || base.type];
+ } else {
+ extendedOptions = defaults[tagOptionType];
+ }
+ this.mergedOptions = $.extend({}, base, extendedOptions, userOptions);
+ },
+
+
+ getTagSetting: function (key) {
+ var prefix = this.tagOptionsPrefix,
+ val, i, pairs, keyval;
+ if (prefix === false || prefix === undefined) {
+ return UNSET_OPTION;
+ }
+ if (this.tagValCache.hasOwnProperty(key)) {
+ val = this.tagValCache.key;
+ } else {
+ val = this.tag.getAttribute(prefix + key);
+ if (val === undefined || val === null) {
+ val = UNSET_OPTION;
+ } else if (val.substr(0, 1) === '[') {
+ val = val.substr(1, val.length - 2).split(',');
+ for (i = val.length; i--;) {
+ val[i] = normalizeValue(val[i].replace(/(^\s*)|(\s*$)/g, ''));
+ }
+ } else if (val.substr(0, 1) === '{') {
+ pairs = val.substr(1, val.length - 2).split(',');
+ val = {};
+ for (i = pairs.length; i--;) {
+ keyval = pairs[i].split(':', 2);
+ val[keyval[0].replace(/(^\s*)|(\s*$)/g, '')] = normalizeValue(keyval[1].replace(/(^\s*)|(\s*$)/g, ''));
+ }
+ } else {
+ val = normalizeValue(val);
+ }
+ this.tagValCache.key = val;
+ }
+ return val;
+ },
+
+ get: function (key, defaultval) {
+ var tagOption = this.getTagSetting(key),
+ result;
+ if (tagOption !== UNSET_OPTION) {
+ return tagOption;
+ }
+ return (result = this.mergedOptions[key]) === undefined ? defaultval : result;
+ }
+ });
+
+
+ $.fn.sparkline._base = createClass({
+ disabled: false,
+
+ init: function (el, values, options, width, height) {
+ this.el = el;
+ this.$el = $(el);
+ this.values = values;
+ this.options = options;
+ this.width = width;
+ this.height = height;
+ this.currentRegion = undefined;
+ },
+
+ /**
+ * Setup the canvas
+ */
+ initTarget: function () {
+ var interactive = !this.options.get('disableInteraction');
+ if (!(this.target = this.$el.simpledraw(this.width, this.height, this.options.get('composite'), interactive))) {
+ this.disabled = true;
+ } else {
+ this.canvasWidth = this.target.pixelWidth;
+ this.canvasHeight = this.target.pixelHeight;
+ }
+ },
+
+ /**
+ * Actually render the chart to the canvas
+ */
+ render: function () {
+ if (this.disabled) {
+ this.el.innerHTML = '';
+ return false;
+ }
+ return true;
+ },
+
+ /**
+ * Return a region id for a given x/y co-ordinate
+ */
+ getRegion: function (x, y) {
+ },
+
+ /**
+ * Highlight an item based on the moused-over x,y co-ordinate
+ */
+ setRegionHighlight: function (el, x, y) {
+ var currentRegion = this.currentRegion,
+ highlightEnabled = !this.options.get('disableHighlight'),
+ newRegion;
+ if (x > this.canvasWidth || y > this.canvasHeight || x < 0 || y < 0) {
+ return null;
+ }
+ newRegion = this.getRegion(el, x, y);
+ if (currentRegion !== newRegion) {
+ if (currentRegion !== undefined && highlightEnabled) {
+ this.removeHighlight();
+ }
+ this.currentRegion = newRegion;
+ if (newRegion !== undefined && highlightEnabled) {
+ this.renderHighlight();
+ }
+ return true;
+ }
+ return false;
+ },
+
+ /**
+ * Reset any currently highlighted item
+ */
+ clearRegionHighlight: function () {
+ if (this.currentRegion !== undefined) {
+ this.removeHighlight();
+ this.currentRegion = undefined;
+ return true;
+ }
+ return false;
+ },
+
+ renderHighlight: function () {
+ this.changeHighlight(true);
+ },
+
+ removeHighlight: function () {
+ this.changeHighlight(false);
+ },
+
+ changeHighlight: function (highlight) {},
+
+ /**
+ * Fetch the HTML to display as a tooltip
+ */
+ getCurrentRegionTooltip: function () {
+ var options = this.options,
+ header = '',
+ entries = [],
+ fields, formats, formatlen, fclass, text, i,
+ showFields, showFieldsKey, newFields, fv,
+ formatter, format, fieldlen, j;
+ if (this.currentRegion === undefined) {
+ return '';
+ }
+ fields = this.getCurrentRegionFields();
+ formatter = options.get('tooltipFormatter');
+ if (formatter) {
+ return formatter(this, options, fields);
+ }
+ if (options.get('tooltipChartTitle')) {
+ header += '
' + options.get('tooltipChartTitle') + '
\n';
+ }
+ formats = this.options.get('tooltipFormat');
+ if (!formats) {
+ return '';
+ }
+ if (!$.isArray(formats)) {
+ formats = [formats];
+ }
+ if (!$.isArray(fields)) {
+ fields = [fields];
+ }
+ showFields = this.options.get('tooltipFormatFieldlist');
+ showFieldsKey = this.options.get('tooltipFormatFieldlistKey');
+ if (showFields && showFieldsKey) {
+ // user-selected ordering of fields
+ newFields = [];
+ for (i = fields.length; i--;) {
+ fv = fields[i][showFieldsKey];
+ if ((j = $.inArray(fv, showFields)) != -1) {
+ newFields[j] = fields[i];
+ }
+ }
+ fields = newFields;
+ }
+ formatlen = formats.length;
+ fieldlen = fields.length;
+ for (i = 0; i < formatlen; i++) {
+ format = formats[i];
+ if (typeof format === 'string') {
+ format = new SPFormat(format);
+ }
+ fclass = format.fclass || 'jqsfield';
+ for (j = 0; j < fieldlen; j++) {
+ if (!fields[j].isNull || !options.get('tooltipSkipNull')) {
+ $.extend(fields[j], {
+ prefix: options.get('tooltipPrefix'),
+ suffix: options.get('tooltipSuffix')
+ });
+ text = format.render(fields[j], options.get('tooltipValueLookups'), options);
+ entries.push('
' + text + '
');
+ }
+ }
+ }
+ if (entries.length) {
+ return header + entries.join('\n');
+ }
+ return '';
+ },
+
+ getCurrentRegionFields: function () {},
+
+ calcHighlightColor: function (color, options) {
+ var highlightColor = options.get('highlightColor'),
+ lighten = options.get('highlightLighten'),
+ parse, mult, rgbnew, i;
+ if (highlightColor) {
+ return highlightColor;
+ }
+ if (lighten) {
+ // extract RGB values
+ parse = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(color) || /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(color);
+ if (parse) {
+ rgbnew = [];
+ mult = color.length === 4 ? 16 : 1;
+ for (i = 0; i < 3; i++) {
+ rgbnew[i] = clipval(Math.round(parseInt(parse[i + 1], 16) * mult * lighten), 0, 255);
+ }
+ return 'rgb(' + rgbnew.join(',') + ')';
+ }
+
+ }
+ return color;
+ }
+
+ });
+
+ barHighlightMixin = {
+ changeHighlight: function (highlight) {
+ var currentRegion = this.currentRegion,
+ target = this.target,
+ shapeids = this.regionShapes[currentRegion],
+ newShapes;
+ // will be null if the region value was null
+ if (shapeids) {
+ newShapes = this.renderRegion(currentRegion, highlight);
+ if ($.isArray(newShapes) || $.isArray(shapeids)) {
+ target.replaceWithShapes(shapeids, newShapes);
+ this.regionShapes[currentRegion] = $.map(newShapes, function (newShape) {
+ return newShape.id;
+ });
+ } else {
+ target.replaceWithShape(shapeids, newShapes);
+ this.regionShapes[currentRegion] = newShapes.id;
+ }
+ }
+ },
+
+ render: function () {
+ var values = this.values,
+ target = this.target,
+ regionShapes = this.regionShapes,
+ shapes, ids, i, j;
+
+ if (!this.cls._super.render.call(this)) {
+ return;
+ }
+ for (i = values.length; i--;) {
+ shapes = this.renderRegion(i);
+ if (shapes) {
+ if ($.isArray(shapes)) {
+ ids = [];
+ for (j = shapes.length; j--;) {
+ shapes[j].append();
+ ids.push(shapes[j].id);
+ }
+ regionShapes[i] = ids;
+ } else {
+ shapes.append();
+ regionShapes[i] = shapes.id; // store just the shapeid
+ }
+ } else {
+ // null value
+ regionShapes[i] = null;
+ }
+ }
+ target.render();
+ }
+ };
+
+ /**
+ * Line charts
+ */
+ $.fn.sparkline.line = line = createClass($.fn.sparkline._base, {
+ type: 'line',
+
+ init: function (el, values, options, width, height) {
+ line._super.init.call(this, el, values, options, width, height);
+ this.vertices = [];
+ this.regionMap = [];
+ this.xvalues = [];
+ this.yvalues = [];
+ this.yminmax = [];
+ this.hightlightSpotId = null;
+ this.lastShapeId = null;
+ this.initTarget();
+ },
+
+ getRegion: function (el, x, y) {
+ var i,
+ regionMap = this.regionMap; // maps regions to value positions
+ for (i = regionMap.length; i--;) {
+ if (regionMap[i] !== null && x >= regionMap[i][0] && x <= regionMap[i][1]) {
+ return regionMap[i][2];
+ }
+ }
+ return undefined;
+ },
+
+ getCurrentRegionFields: function () {
+ var currentRegion = this.currentRegion;
+ return {
+ isNull: this.yvalues[currentRegion] === null,
+ x: this.xvalues[currentRegion],
+ y: this.yvalues[currentRegion],
+ color: this.options.get('lineColor'),
+ fillColor: this.options.get('fillColor'),
+ offset: currentRegion
+ };
+ },
+
+ renderHighlight: function () {
+ var currentRegion = this.currentRegion,
+ target = this.target,
+ vertex = this.vertices[currentRegion],
+ options = this.options,
+ spotRadius = options.get('spotRadius'),
+ highlightSpotColor = options.get('highlightSpotColor'),
+ highlightLineColor = options.get('highlightLineColor'),
+ highlightSpot, highlightLine;
+
+ if (!vertex) {
+ return;
+ }
+ if (spotRadius && highlightSpotColor) {
+ highlightSpot = target.drawCircle(vertex[0], vertex[1],
+ spotRadius, undefined, highlightSpotColor);
+ this.highlightSpotId = highlightSpot.id;
+ target.insertAfterShape(this.lastShapeId, highlightSpot);
+ }
+ if (highlightLineColor) {
+ highlightLine = target.drawLine(vertex[0], this.canvasTop, vertex[0],
+ this.canvasTop + this.canvasHeight, highlightLineColor);
+ this.highlightLineId = highlightLine.id;
+ target.insertAfterShape(this.lastShapeId, highlightLine);
+ }
+ },
+
+ removeHighlight: function () {
+ var target = this.target;
+ if (this.highlightSpotId) {
+ target.removeShapeId(this.highlightSpotId);
+ this.highlightSpotId = null;
+ }
+ if (this.highlightLineId) {
+ target.removeShapeId(this.highlightLineId);
+ this.highlightLineId = null;
+ }
+ },
+
+ scanValues: function () {
+ var values = this.values,
+ valcount = values.length,
+ xvalues = this.xvalues,
+ yvalues = this.yvalues,
+ yminmax = this.yminmax,
+ i, val, isStr, isArray, sp;
+ for (i = 0; i < valcount; i++) {
+ val = values[i];
+ isStr = typeof(values[i]) === 'string';
+ isArray = typeof(values[i]) === 'object' && values[i] instanceof Array;
+ sp = isStr && values[i].split(':');
+ if (isStr && sp.length === 2) { // x:y
+ xvalues.push(Number(sp[0]));
+ yvalues.push(Number(sp[1]));
+ yminmax.push(Number(sp[1]));
+ } else if (isArray) {
+ xvalues.push(val[0]);
+ yvalues.push(val[1]);
+ yminmax.push(val[1]);
+ } else {
+ xvalues.push(i);
+ if (values[i] === null || values[i] === 'null') {
+ yvalues.push(null);
+ } else {
+ yvalues.push(Number(val));
+ yminmax.push(Number(val));
+ }
+ }
+ }
+ if (this.options.get('xvalues')) {
+ xvalues = this.options.get('xvalues');
+ }
+
+ this.maxy = this.maxyorg = Math.max.apply(Math, yminmax);
+ this.miny = this.minyorg = Math.min.apply(Math, yminmax);
+
+ this.maxx = Math.max.apply(Math, xvalues);
+ this.minx = Math.min.apply(Math, xvalues);
+
+ this.xvalues = xvalues;
+ this.yvalues = yvalues;
+ this.yminmax = yminmax;
+
+ },
+
+ processRangeOptions: function () {
+ var options = this.options,
+ normalRangeMin = options.get('normalRangeMin'),
+ normalRangeMax = options.get('normalRangeMax');
+
+ if (normalRangeMin !== undefined) {
+ if (normalRangeMin < this.miny) {
+ this.miny = normalRangeMin;
+ }
+ if (normalRangeMax > this.maxy) {
+ this.maxy = normalRangeMax;
+ }
+ }
+ if (options.get('chartRangeMin') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMin') < this.miny)) {
+ this.miny = options.get('chartRangeMin');
+ }
+ if (options.get('chartRangeMax') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMax') > this.maxy)) {
+ this.maxy = options.get('chartRangeMax');
+ }
+ if (options.get('chartRangeMinX') !== undefined && (options.get('chartRangeClipX') || options.get('chartRangeMinX') < this.minx)) {
+ this.minx = options.get('chartRangeMinX');
+ }
+ if (options.get('chartRangeMaxX') !== undefined && (options.get('chartRangeClipX') || options.get('chartRangeMaxX') > this.maxx)) {
+ this.maxx = options.get('chartRangeMaxX');
+ }
+
+ },
+
+ drawNormalRange: function (canvasLeft, canvasTop, canvasHeight, canvasWidth, rangey) {
+ var normalRangeMin = this.options.get('normalRangeMin'),
+ normalRangeMax = this.options.get('normalRangeMax'),
+ ytop = canvasTop + Math.round(canvasHeight - (canvasHeight * ((normalRangeMax - this.miny) / rangey))),
+ height = Math.round((canvasHeight * (normalRangeMax - normalRangeMin)) / rangey);
+ this.target.drawRect(canvasLeft, ytop, canvasWidth, height, undefined, this.options.get('normalRangeColor')).append();
+ },
+
+ render: function () {
+ var options = this.options,
+ target = this.target,
+ canvasWidth = this.canvasWidth,
+ canvasHeight = this.canvasHeight,
+ vertices = this.vertices,
+ spotRadius = options.get('spotRadius'),
+ regionMap = this.regionMap,
+ rangex, rangey, yvallast,
+ canvasTop, canvasLeft,
+ vertex, path, paths, x, y, xnext, xpos, xposnext,
+ last, next, yvalcount, lineShapes, fillShapes, plen,
+ valueSpots, hlSpotsEnabled, color, xvalues, yvalues, i;
+
+ if (!line._super.render.call(this)) {
+ return;
+ }
+
+ this.scanValues();
+ this.processRangeOptions();
+
+ xvalues = this.xvalues;
+ yvalues = this.yvalues;
+
+ if (!this.yminmax.length || this.yvalues.length < 2) {
+ // empty or all null valuess
+ return;
+ }
+
+ canvasTop = canvasLeft = 0;
+
+ rangex = this.maxx - this.minx === 0 ? 1 : this.maxx - this.minx;
+ rangey = this.maxy - this.miny === 0 ? 1 : this.maxy - this.miny;
+ yvallast = this.yvalues.length - 1;
+
+ if (spotRadius && (canvasWidth < (spotRadius * 4) || canvasHeight < (spotRadius * 4))) {
+ spotRadius = 0;
+ }
+ if (spotRadius) {
+ // adjust the canvas size as required so that spots will fit
+ hlSpotsEnabled = options.get('highlightSpotColor') && !options.get('disableInteraction');
+ if (hlSpotsEnabled || options.get('minSpotColor') || (options.get('spotColor') && yvalues[yvallast] === this.miny)) {
+ canvasHeight -= Math.ceil(spotRadius);
+ }
+ if (hlSpotsEnabled || options.get('maxSpotColor') || (options.get('spotColor') && yvalues[yvallast] === this.maxy)) {
+ canvasHeight -= Math.ceil(spotRadius);
+ canvasTop += Math.ceil(spotRadius);
+ }
+ if (hlSpotsEnabled ||
+ ((options.get('minSpotColor') || options.get('maxSpotColor')) && (yvalues[0] === this.miny || yvalues[0] === this.maxy))) {
+ canvasLeft += Math.ceil(spotRadius);
+ canvasWidth -= Math.ceil(spotRadius);
+ }
+ if (hlSpotsEnabled || options.get('spotColor') ||
+ (options.get('minSpotColor') || options.get('maxSpotColor') &&
+ (yvalues[yvallast] === this.miny || yvalues[yvallast] === this.maxy))) {
+ canvasWidth -= Math.ceil(spotRadius);
+ }
+ }
+
+
+ canvasHeight--;
+
+ if (options.get('normalRangeMin') !== undefined && !options.get('drawNormalOnTop')) {
+ this.drawNormalRange(canvasLeft, canvasTop, canvasHeight, canvasWidth, rangey);
+ }
+
+ path = [];
+ paths = [path];
+ last = next = null;
+ yvalcount = yvalues.length;
+ for (i = 0; i < yvalcount; i++) {
+ x = xvalues[i];
+ xnext = xvalues[i + 1];
+ y = yvalues[i];
+ xpos = canvasLeft + Math.round((x - this.minx) * (canvasWidth / rangex));
+ xposnext = i < yvalcount - 1 ? canvasLeft + Math.round((xnext - this.minx) * (canvasWidth / rangex)) : canvasWidth;
+ next = xpos + ((xposnext - xpos) / 2);
+ regionMap[i] = [last || 0, next, i];
+ last = next;
+ if (y === null) {
+ if (i) {
+ if (yvalues[i - 1] !== null) {
+ path = [];
+ paths.push(path);
+ }
+ vertices.push(null);
+ }
+ } else {
+ if (y < this.miny) {
+ y = this.miny;
+ }
+ if (y > this.maxy) {
+ y = this.maxy;
+ }
+ if (!path.length) {
+ // previous value was null
+ path.push([xpos, canvasTop + canvasHeight]);
+ }
+ vertex = [xpos, canvasTop + Math.round(canvasHeight - (canvasHeight * ((y - this.miny) / rangey)))];
+ path.push(vertex);
+ vertices.push(vertex);
+ }
+ }
+
+ lineShapes = [];
+ fillShapes = [];
+ plen = paths.length;
+ for (i = 0; i < plen; i++) {
+ path = paths[i];
+ if (path.length) {
+ if (options.get('fillColor')) {
+ path.push([path[path.length - 1][0], (canvasTop + canvasHeight)]);
+ fillShapes.push(path.slice(0));
+ path.pop();
+ }
+ // if there's only a single point in this path, then we want to display it
+ // as a vertical line which means we keep path[0] as is
+ if (path.length > 2) {
+ // else we want the first value
+ path[0] = [path[0][0], path[1][1]];
+ }
+ lineShapes.push(path);
+ }
+ }
+
+ // draw the fill first, then optionally the normal range, then the line on top of that
+ plen = fillShapes.length;
+ for (i = 0; i < plen; i++) {
+ target.drawShape(fillShapes[i],
+ options.get('fillColor'), options.get('fillColor')).append();
+ }
+
+ if (options.get('normalRangeMin') !== undefined && options.get('drawNormalOnTop')) {
+ this.drawNormalRange(canvasLeft, canvasTop, canvasHeight, canvasWidth, rangey);
+ }
+
+ plen = lineShapes.length;
+ for (i = 0; i < plen; i++) {
+ target.drawShape(lineShapes[i], options.get('lineColor'), undefined,
+ options.get('lineWidth')).append();
+ }
+
+ if (spotRadius && options.get('valueSpots')) {
+ valueSpots = options.get('valueSpots');
+ if (valueSpots.get === undefined) {
+ valueSpots = new RangeMap(valueSpots);
+ }
+ for (i = 0; i < yvalcount; i++) {
+ color = valueSpots.get(yvalues[i]);
+ if (color) {
+ target.drawCircle(canvasLeft + Math.round((xvalues[i] - this.minx) * (canvasWidth / rangex)),
+ canvasTop + Math.round(canvasHeight - (canvasHeight * ((yvalues[i] - this.miny) / rangey))),
+ spotRadius, undefined,
+ color).append();
+ }
+ }
+
+ }
+ if (spotRadius && options.get('spotColor') && yvalues[yvallast] !== null) {
+ target.drawCircle(canvasLeft + Math.round((xvalues[xvalues.length - 1] - this.minx) * (canvasWidth / rangex)),
+ canvasTop + Math.round(canvasHeight - (canvasHeight * ((yvalues[yvallast] - this.miny) / rangey))),
+ spotRadius, undefined,
+ options.get('spotColor')).append();
+ }
+ if (this.maxy !== this.minyorg) {
+ if (spotRadius && options.get('minSpotColor')) {
+ x = xvalues[$.inArray(this.minyorg, yvalues)];
+ target.drawCircle(canvasLeft + Math.round((x - this.minx) * (canvasWidth / rangex)),
+ canvasTop + Math.round(canvasHeight - (canvasHeight * ((this.minyorg - this.miny) / rangey))),
+ spotRadius, undefined,
+ options.get('minSpotColor')).append();
+ }
+ if (spotRadius && options.get('maxSpotColor')) {
+ x = xvalues[$.inArray(this.maxyorg, yvalues)];
+ target.drawCircle(canvasLeft + Math.round((x - this.minx) * (canvasWidth / rangex)),
+ canvasTop + Math.round(canvasHeight - (canvasHeight * ((this.maxyorg - this.miny) / rangey))),
+ spotRadius, undefined,
+ options.get('maxSpotColor')).append();
+ }
+ }
+
+ this.lastShapeId = target.getLastShapeId();
+ this.canvasTop = canvasTop;
+ target.render();
+ }
+ });
+
+ /**
+ * Bar charts
+ */
+ $.fn.sparkline.bar = bar = createClass($.fn.sparkline._base, barHighlightMixin, {
+ type: 'bar',
+
+ init: function (el, values, options, width, height) {
+ var barWidth = parseInt(options.get('barWidth'), 10),
+ barSpacing = parseInt(options.get('barSpacing'), 10),
+ chartRangeMin = options.get('chartRangeMin'),
+ chartRangeMax = options.get('chartRangeMax'),
+ chartRangeClip = options.get('chartRangeClip'),
+ stackMin = Infinity,
+ stackMax = -Infinity,
+ isStackString, groupMin, groupMax, stackRanges,
+ numValues, i, vlen, range, zeroAxis, xaxisOffset, min, max, clipMin, clipMax,
+ stacked, vlist, j, slen, svals, val, yoffset, yMaxCalc, canvasHeightEf;
+ bar._super.init.call(this, el, values, options, width, height);
+
+ // scan values to determine whether to stack bars
+ for (i = 0, vlen = values.length; i < vlen; i++) {
+ val = values[i];
+ isStackString = typeof(val) === 'string' && val.indexOf(':') > -1;
+ if (isStackString || $.isArray(val)) {
+ stacked = true;
+ if (isStackString) {
+ val = values[i] = normalizeValues(val.split(':'));
+ }
+ val = remove(val, null); // min/max will treat null as zero
+ groupMin = Math.min.apply(Math, val);
+ groupMax = Math.max.apply(Math, val);
+ if (groupMin < stackMin) {
+ stackMin = groupMin;
+ }
+ if (groupMax > stackMax) {
+ stackMax = groupMax;
+ }
+ }
+ }
+
+ this.stacked = stacked;
+ this.regionShapes = {};
+ this.barWidth = barWidth;
+ this.barSpacing = barSpacing;
+ this.totalBarWidth = barWidth + barSpacing;
+ this.width = width = (values.length * barWidth) + ((values.length - 1) * barSpacing);
+
+ this.initTarget();
+
+ if (chartRangeClip) {
+ clipMin = chartRangeMin === undefined ? -Infinity : chartRangeMin;
+ clipMax = chartRangeMax === undefined ? Infinity : chartRangeMax;
+ }
+
+ numValues = [];
+ stackRanges = stacked ? [] : numValues;
+ var stackTotals = [];
+ var stackRangesNeg = [];
+ for (i = 0, vlen = values.length; i < vlen; i++) {
+ if (stacked) {
+ vlist = values[i];
+ values[i] = svals = [];
+ stackTotals[i] = 0;
+ stackRanges[i] = stackRangesNeg[i] = 0;
+ for (j = 0, slen = vlist.length; j < slen; j++) {
+ val = svals[j] = chartRangeClip ? clipval(vlist[j], clipMin, clipMax) : vlist[j];
+ if (val !== null) {
+ if (val > 0) {
+ stackTotals[i] += val;
+ }
+ if (stackMin < 0 && stackMax > 0) {
+ if (val < 0) {
+ stackRangesNeg[i] += Math.abs(val);
+ } else {
+ stackRanges[i] += val;
+ }
+ } else {
+ stackRanges[i] += Math.abs(val - (val < 0 ? stackMax : stackMin));
+ }
+ numValues.push(val);
+ }
+ }
+ } else {
+ val = chartRangeClip ? clipval(values[i], clipMin, clipMax) : values[i];
+ val = values[i] = normalizeValue(val);
+ if (val !== null) {
+ numValues.push(val);
+ }
+ }
+ }
+ this.max = max = Math.max.apply(Math, numValues);
+ this.min = min = Math.min.apply(Math, numValues);
+ this.stackMax = stackMax = stacked ? Math.max.apply(Math, stackTotals) : max;
+ this.stackMin = stackMin = stacked ? Math.min.apply(Math, numValues) : min;
+
+ if (options.get('chartRangeMin') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMin') < min)) {
+ min = options.get('chartRangeMin');
+ }
+ if (options.get('chartRangeMax') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMax') > max)) {
+ max = options.get('chartRangeMax');
+ }
+
+ this.zeroAxis = zeroAxis = options.get('zeroAxis', true);
+ if (min <= 0 && max >= 0 && zeroAxis) {
+ xaxisOffset = 0;
+ } else if (zeroAxis == false) {
+ xaxisOffset = min;
+ } else if (min > 0) {
+ xaxisOffset = min;
+ } else {
+ xaxisOffset = max;
+ }
+ this.xaxisOffset = xaxisOffset;
+
+ range = stacked ? (Math.max.apply(Math, stackRanges) + Math.max.apply(Math, stackRangesNeg)) : max - min;
+
+ // as we plot zero/min values a single pixel line, we add a pixel to all other
+ // values - Reduce the effective canvas size to suit
+ this.canvasHeightEf = (zeroAxis && min < 0) ? this.canvasHeight - 2 : this.canvasHeight - 1;
+
+ if (min < xaxisOffset) {
+ yMaxCalc = (stacked && max >= 0) ? stackMax : max;
+ yoffset = (yMaxCalc - xaxisOffset) / range * this.canvasHeight;
+ if (yoffset !== Math.ceil(yoffset)) {
+ this.canvasHeightEf -= 2;
+ yoffset = Math.ceil(yoffset);
+ }
+ } else {
+ yoffset = this.canvasHeight;
+ }
+ this.yoffset = yoffset;
+
+ if ($.isArray(options.get('colorMap'))) {
+ this.colorMapByIndex = options.get('colorMap');
+ this.colorMapByValue = null;
+ } else {
+ this.colorMapByIndex = null;
+ this.colorMapByValue = options.get('colorMap');
+ if (this.colorMapByValue && this.colorMapByValue.get === undefined) {
+ this.colorMapByValue = new RangeMap(this.colorMapByValue);
+ }
+ }
+
+ this.range = range;
+ },
+
+ getRegion: function (el, x, y) {
+ var result = Math.floor(x / this.totalBarWidth);
+ return (result < 0 || result >= this.values.length) ? undefined : result;
+ },
+
+ getCurrentRegionFields: function () {
+ var currentRegion = this.currentRegion,
+ values = ensureArray(this.values[currentRegion]),
+ result = [],
+ value, i;
+ for (i = values.length; i--;) {
+ value = values[i];
+ result.push({
+ isNull: value === null,
+ value: value,
+ color: this.calcColor(i, value, currentRegion),
+ offset: currentRegion
+ });
+ }
+ return result;
+ },
+
+ calcColor: function (stacknum, value, valuenum) {
+ var colorMapByIndex = this.colorMapByIndex,
+ colorMapByValue = this.colorMapByValue,
+ options = this.options,
+ color, newColor;
+ if (this.stacked) {
+ color = options.get('stackedBarColor');
+ } else {
+ color = (value < 0) ? options.get('negBarColor') : options.get('barColor');
+ }
+ if (value === 0 && options.get('zeroColor') !== undefined) {
+ color = options.get('zeroColor');
+ }
+ if (colorMapByValue && (newColor = colorMapByValue.get(value))) {
+ color = newColor;
+ } else if (colorMapByIndex && colorMapByIndex.length > valuenum) {
+ color = colorMapByIndex[valuenum];
+ }
+ return $.isArray(color) ? color[stacknum % color.length] : color;
+ },
+
+ /**
+ * Render bar(s) for a region
+ */
+ renderRegion: function (valuenum, highlight) {
+ var vals = this.values[valuenum],
+ options = this.options,
+ xaxisOffset = this.xaxisOffset,
+ result = [],
+ range = this.range,
+ stacked = this.stacked,
+ target = this.target,
+ x = valuenum * this.totalBarWidth,
+ canvasHeightEf = this.canvasHeightEf,
+ yoffset = this.yoffset,
+ y, height, color, isNull, yoffsetNeg, i, valcount, val, minPlotted, allMin;
+
+ vals = $.isArray(vals) ? vals : [vals];
+ valcount = vals.length;
+ val = vals[0];
+ isNull = all(null, vals);
+ allMin = all(xaxisOffset, vals, true);
+
+ if (isNull) {
+ if (options.get('nullColor')) {
+ color = highlight ? options.get('nullColor') : this.calcHighlightColor(options.get('nullColor'), options);
+ y = (yoffset > 0) ? yoffset - 1 : yoffset;
+ return target.drawRect(x, y, this.barWidth - 1, 0, color, color);
+ } else {
+ return undefined;
+ }
+ }
+ yoffsetNeg = yoffset;
+ for (i = 0; i < valcount; i++) {
+ val = vals[i];
+
+ if (stacked && val === xaxisOffset) {
+ if (!allMin || minPlotted) {
+ continue;
+ }
+ minPlotted = true;
+ }
+
+ if (range > 0) {
+ height = Math.floor(canvasHeightEf * ((Math.abs(val - xaxisOffset) / range))) + 1;
+ } else {
+ height = 1;
+ }
+ if (val < xaxisOffset || (val === xaxisOffset && yoffset === 0)) {
+ y = yoffsetNeg;
+ yoffsetNeg += height;
+ } else {
+ y = yoffset - height;
+ yoffset -= height;
+ }
+ color = this.calcColor(i, val, valuenum);
+ if (highlight) {
+ color = this.calcHighlightColor(color, options);
+ }
+ result.push(target.drawRect(x, y, this.barWidth - 1, height - 1, color, color));
+ }
+ if (result.length === 1) {
+ return result[0];
+ }
+ return result;
+ }
+ });
+
+ /**
+ * Tristate charts
+ */
+ $.fn.sparkline.tristate = tristate = createClass($.fn.sparkline._base, barHighlightMixin, {
+ type: 'tristate',
+
+ init: function (el, values, options, width, height) {
+ var barWidth = parseInt(options.get('barWidth'), 10),
+ barSpacing = parseInt(options.get('barSpacing'), 10);
+ tristate._super.init.call(this, el, values, options, width, height);
+
+ this.regionShapes = {};
+ this.barWidth = barWidth;
+ this.barSpacing = barSpacing;
+ this.totalBarWidth = barWidth + barSpacing;
+ this.values = $.map(values, Number);
+ this.width = width = (values.length * barWidth) + ((values.length - 1) * barSpacing);
+
+ if ($.isArray(options.get('colorMap'))) {
+ this.colorMapByIndex = options.get('colorMap');
+ this.colorMapByValue = null;
+ } else {
+ this.colorMapByIndex = null;
+ this.colorMapByValue = options.get('colorMap');
+ if (this.colorMapByValue && this.colorMapByValue.get === undefined) {
+ this.colorMapByValue = new RangeMap(this.colorMapByValue);
+ }
+ }
+ this.initTarget();
+ },
+
+ getRegion: function (el, x, y) {
+ return Math.floor(x / this.totalBarWidth);
+ },
+
+ getCurrentRegionFields: function () {
+ var currentRegion = this.currentRegion;
+ return {
+ isNull: this.values[currentRegion] === undefined,
+ value: this.values[currentRegion],
+ color: this.calcColor(this.values[currentRegion], currentRegion),
+ offset: currentRegion
+ };
+ },
+
+ calcColor: function (value, valuenum) {
+ var values = this.values,
+ options = this.options,
+ colorMapByIndex = this.colorMapByIndex,
+ colorMapByValue = this.colorMapByValue,
+ color, newColor;
+
+ if (colorMapByValue && (newColor = colorMapByValue.get(value))) {
+ color = newColor;
+ } else if (colorMapByIndex && colorMapByIndex.length > valuenum) {
+ color = colorMapByIndex[valuenum];
+ } else if (values[valuenum] < 0) {
+ color = options.get('negBarColor');
+ } else if (values[valuenum] > 0) {
+ color = options.get('posBarColor');
+ } else {
+ color = options.get('zeroBarColor');
+ }
+ return color;
+ },
+
+ renderRegion: function (valuenum, highlight) {
+ var values = this.values,
+ options = this.options,
+ target = this.target,
+ canvasHeight, height, halfHeight,
+ x, y, color;
+
+ canvasHeight = target.pixelHeight;
+ halfHeight = Math.round(canvasHeight / 2);
+
+ x = valuenum * this.totalBarWidth;
+ if (values[valuenum] < 0) {
+ y = halfHeight;
+ height = halfHeight - 1;
+ } else if (values[valuenum] > 0) {
+ y = 0;
+ height = halfHeight - 1;
+ } else {
+ y = halfHeight - 1;
+ height = 2;
+ }
+ color = this.calcColor(values[valuenum], valuenum);
+ if (color === null) {
+ return;
+ }
+ if (highlight) {
+ color = this.calcHighlightColor(color, options);
+ }
+ return target.drawRect(x, y, this.barWidth - 1, height - 1, color, color);
+ }
+ });
+
+ /**
+ * Discrete charts
+ */
+ $.fn.sparkline.discrete = discrete = createClass($.fn.sparkline._base, barHighlightMixin, {
+ type: 'discrete',
+
+ init: function (el, values, options, width, height) {
+ discrete._super.init.call(this, el, values, options, width, height);
+
+ this.regionShapes = {};
+ this.values = values = $.map(values, Number);
+ this.min = Math.min.apply(Math, values);
+ this.max = Math.max.apply(Math, values);
+ this.range = this.max - this.min;
+ this.width = width = options.get('width') === 'auto' ? values.length * 2 : this.width;
+ this.interval = Math.floor(width / values.length);
+ this.itemWidth = width / values.length;
+ if (options.get('chartRangeMin') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMin') < this.min)) {
+ this.min = options.get('chartRangeMin');
+ }
+ if (options.get('chartRangeMax') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMax') > this.max)) {
+ this.max = options.get('chartRangeMax');
+ }
+ this.initTarget();
+ if (this.target) {
+ this.lineHeight = options.get('lineHeight') === 'auto' ? Math.round(this.canvasHeight * 0.3) : options.get('lineHeight');
+ }
+ },
+
+ getRegion: function (el, x, y) {
+ return Math.floor(x / this.itemWidth);
+ },
+
+ getCurrentRegionFields: function () {
+ var currentRegion = this.currentRegion;
+ return {
+ isNull: this.values[currentRegion] === undefined,
+ value: this.values[currentRegion],
+ offset: currentRegion
+ };
+ },
+
+ renderRegion: function (valuenum, highlight) {
+ var values = this.values,
+ options = this.options,
+ min = this.min,
+ max = this.max,
+ range = this.range,
+ interval = this.interval,
+ target = this.target,
+ canvasHeight = this.canvasHeight,
+ lineHeight = this.lineHeight,
+ pheight = canvasHeight - lineHeight,
+ ytop, val, color, x;
+
+ val = clipval(values[valuenum], min, max);
+ x = valuenum * interval;
+ ytop = Math.round(pheight - pheight * ((val - min) / range));
+ color = (options.get('thresholdColor') && val < options.get('thresholdValue')) ? options.get('thresholdColor') : options.get('lineColor');
+ if (highlight) {
+ color = this.calcHighlightColor(color, options);
+ }
+ return target.drawLine(x, ytop, x, ytop + lineHeight, color);
+ }
+ });
+
+ /**
+ * Bullet charts
+ */
+ $.fn.sparkline.bullet = bullet = createClass($.fn.sparkline._base, {
+ type: 'bullet',
+
+ init: function (el, values, options, width, height) {
+ var min, max, vals;
+ bullet._super.init.call(this, el, values, options, width, height);
+
+ // values: target, performance, range1, range2, range3
+ this.values = values = normalizeValues(values);
+ // target or performance could be null
+ vals = values.slice();
+ vals[0] = vals[0] === null ? vals[2] : vals[0];
+ vals[1] = values[1] === null ? vals[2] : vals[1];
+ min = Math.min.apply(Math, values);
+ max = Math.max.apply(Math, values);
+ if (options.get('base') === undefined) {
+ min = min < 0 ? min : 0;
+ } else {
+ min = options.get('base');
+ }
+ this.min = min;
+ this.max = max;
+ this.range = max - min;
+ this.shapes = {};
+ this.valueShapes = {};
+ this.regiondata = {};
+ this.width = width = options.get('width') === 'auto' ? '4.0em' : width;
+ this.target = this.$el.simpledraw(width, height, options.get('composite'));
+ if (!values.length) {
+ this.disabled = true;
+ }
+ this.initTarget();
+ },
+
+ getRegion: function (el, x, y) {
+ var shapeid = this.target.getShapeAt(el, x, y);
+ return (shapeid !== undefined && this.shapes[shapeid] !== undefined) ? this.shapes[shapeid] : undefined;
+ },
+
+ getCurrentRegionFields: function () {
+ var currentRegion = this.currentRegion;
+ return {
+ fieldkey: currentRegion.substr(0, 1),
+ value: this.values[currentRegion.substr(1)],
+ region: currentRegion
+ };
+ },
+
+ changeHighlight: function (highlight) {
+ var currentRegion = this.currentRegion,
+ shapeid = this.valueShapes[currentRegion],
+ shape;
+ delete this.shapes[shapeid];
+ switch (currentRegion.substr(0, 1)) {
+ case 'r':
+ shape = this.renderRange(currentRegion.substr(1), highlight);
+ break;
+ case 'p':
+ shape = this.renderPerformance(highlight);
+ break;
+ case 't':
+ shape = this.renderTarget(highlight);
+ break;
+ }
+ this.valueShapes[currentRegion] = shape.id;
+ this.shapes[shape.id] = currentRegion;
+ this.target.replaceWithShape(shapeid, shape);
+ },
+
+ renderRange: function (rn, highlight) {
+ var rangeval = this.values[rn],
+ rangewidth = Math.round(this.canvasWidth * ((rangeval - this.min) / this.range)),
+ color = this.options.get('rangeColors')[rn - 2];
+ if (highlight) {
+ color = this.calcHighlightColor(color, this.options);
+ }
+ return this.target.drawRect(0, 0, rangewidth - 1, this.canvasHeight - 1, color, color);
+ },
+
+ renderPerformance: function (highlight) {
+ var perfval = this.values[1],
+ perfwidth = Math.round(this.canvasWidth * ((perfval - this.min) / this.range)),
+ color = this.options.get('performanceColor');
+ if (highlight) {
+ color = this.calcHighlightColor(color, this.options);
+ }
+ return this.target.drawRect(0, Math.round(this.canvasHeight * 0.3), perfwidth - 1,
+ Math.round(this.canvasHeight * 0.4) - 1, color, color);
+ },
+
+ renderTarget: function (highlight) {
+ var targetval = this.values[0],
+ x = Math.round(this.canvasWidth * ((targetval - this.min) / this.range) - (this.options.get('targetWidth') / 2)),
+ targettop = Math.round(this.canvasHeight * 0.10),
+ targetheight = this.canvasHeight - (targettop * 2),
+ color = this.options.get('targetColor');
+ if (highlight) {
+ color = this.calcHighlightColor(color, this.options);
+ }
+ return this.target.drawRect(x, targettop, this.options.get('targetWidth') - 1, targetheight - 1, color, color);
+ },
+
+ render: function () {
+ var vlen = this.values.length,
+ target = this.target,
+ i, shape;
+ if (!bullet._super.render.call(this)) {
+ return;
+ }
+ for (i = 2; i < vlen; i++) {
+ shape = this.renderRange(i).append();
+ this.shapes[shape.id] = 'r' + i;
+ this.valueShapes['r' + i] = shape.id;
+ }
+ if (this.values[1] !== null) {
+ shape = this.renderPerformance().append();
+ this.shapes[shape.id] = 'p1';
+ this.valueShapes.p1 = shape.id;
+ }
+ if (this.values[0] !== null) {
+ shape = this.renderTarget().append();
+ this.shapes[shape.id] = 't0';
+ this.valueShapes.t0 = shape.id;
+ }
+ target.render();
+ }
+ });
+
+ /**
+ * Pie charts
+ */
+ $.fn.sparkline.pie = pie = createClass($.fn.sparkline._base, {
+ type: 'pie',
+
+ init: function (el, values, options, width, height) {
+ var total = 0, i;
+
+ pie._super.init.call(this, el, values, options, width, height);
+
+ this.shapes = {}; // map shape ids to value offsets
+ this.valueShapes = {}; // maps value offsets to shape ids
+ this.values = values = $.map(values, Number);
+
+ if (options.get('width') === 'auto') {
+ this.width = this.height;
+ }
+
+ if (values.length > 0) {
+ for (i = values.length; i--;) {
+ total += values[i];
+ }
+ }
+ this.total = total;
+ this.initTarget();
+ this.radius = Math.floor(Math.min(this.canvasWidth, this.canvasHeight) / 2);
+ },
+
+ getRegion: function (el, x, y) {
+ var shapeid = this.target.getShapeAt(el, x, y);
+ return (shapeid !== undefined && this.shapes[shapeid] !== undefined) ? this.shapes[shapeid] : undefined;
+ },
+
+ getCurrentRegionFields: function () {
+ var currentRegion = this.currentRegion;
+ return {
+ isNull: this.values[currentRegion] === undefined,
+ value: this.values[currentRegion],
+ percent: this.values[currentRegion] / this.total * 100,
+ color: this.options.get('sliceColors')[currentRegion % this.options.get('sliceColors').length],
+ offset: currentRegion
+ };
+ },
+
+ changeHighlight: function (highlight) {
+ var currentRegion = this.currentRegion,
+ newslice = this.renderSlice(currentRegion, highlight),
+ shapeid = this.valueShapes[currentRegion];
+ delete this.shapes[shapeid];
+ this.target.replaceWithShape(shapeid, newslice);
+ this.valueShapes[currentRegion] = newslice.id;
+ this.shapes[newslice.id] = currentRegion;
+ },
+
+ renderSlice: function (valuenum, highlight) {
+ var target = this.target,
+ options = this.options,
+ radius = this.radius,
+ borderWidth = options.get('borderWidth'),
+ offset = options.get('offset'),
+ circle = 2 * Math.PI,
+ values = this.values,
+ total = this.total,
+ next = offset ? (2*Math.PI)*(offset/360) : 0,
+ start, end, i, vlen, color;
+
+ vlen = values.length;
+ for (i = 0; i < vlen; i++) {
+ start = next;
+ end = next;
+ if (total > 0) { // avoid divide by zero
+ end = next + (circle * (values[i] / total));
+ }
+ if (valuenum === i) {
+ color = options.get('sliceColors')[i % options.get('sliceColors').length];
+ if (highlight) {
+ color = this.calcHighlightColor(color, options);
+ }
+
+ return target.drawPieSlice(radius, radius, radius - borderWidth, start, end, undefined, color);
+ }
+ next = end;
+ }
+ },
+
+ render: function () {
+ var target = this.target,
+ values = this.values,
+ options = this.options,
+ radius = this.radius,
+ borderWidth = options.get('borderWidth'),
+ shape, i;
+
+ if (!pie._super.render.call(this)) {
+ return;
+ }
+ if (borderWidth) {
+ target.drawCircle(radius, radius, Math.floor(radius - (borderWidth / 2)),
+ options.get('borderColor'), undefined, borderWidth).append();
+ }
+ for (i = values.length; i--;) {
+ if (values[i]) { // don't render zero values
+ shape = this.renderSlice(i).append();
+ this.valueShapes[i] = shape.id; // store just the shapeid
+ this.shapes[shape.id] = i;
+ }
+ }
+ target.render();
+ }
+ });
+
+ /**
+ * Box plots
+ */
+ $.fn.sparkline.box = box = createClass($.fn.sparkline._base, {
+ type: 'box',
+
+ init: function (el, values, options, width, height) {
+ box._super.init.call(this, el, values, options, width, height);
+ this.values = $.map(values, Number);
+ this.width = options.get('width') === 'auto' ? '4.0em' : width;
+ this.initTarget();
+ if (!this.values.length) {
+ this.disabled = 1;
+ }
+ },
+
+ /**
+ * Simulate a single region
+ */
+ getRegion: function () {
+ return 1;
+ },
+
+ getCurrentRegionFields: function () {
+ var result = [
+ { field: 'lq', value: this.quartiles[0] },
+ { field: 'med', value: this.quartiles[1] },
+ { field: 'uq', value: this.quartiles[2] }
+ ];
+ if (this.loutlier !== undefined) {
+ result.push({ field: 'lo', value: this.loutlier});
+ }
+ if (this.routlier !== undefined) {
+ result.push({ field: 'ro', value: this.routlier});
+ }
+ if (this.lwhisker !== undefined) {
+ result.push({ field: 'lw', value: this.lwhisker});
+ }
+ if (this.rwhisker !== undefined) {
+ result.push({ field: 'rw', value: this.rwhisker});
+ }
+ return result;
+ },
+
+ render: function () {
+ var target = this.target,
+ values = this.values,
+ vlen = values.length,
+ options = this.options,
+ canvasWidth = this.canvasWidth,
+ canvasHeight = this.canvasHeight,
+ minValue = options.get('chartRangeMin') === undefined ? Math.min.apply(Math, values) : options.get('chartRangeMin'),
+ maxValue = options.get('chartRangeMax') === undefined ? Math.max.apply(Math, values) : options.get('chartRangeMax'),
+ canvasLeft = 0,
+ lwhisker, loutlier, iqr, q1, q2, q3, rwhisker, routlier, i,
+ size, unitSize;
+
+ if (!box._super.render.call(this)) {
+ return;
+ }
+
+ if (options.get('raw')) {
+ if (options.get('showOutliers') && values.length > 5) {
+ loutlier = values[0];
+ lwhisker = values[1];
+ q1 = values[2];
+ q2 = values[3];
+ q3 = values[4];
+ rwhisker = values[5];
+ routlier = values[6];
+ } else {
+ lwhisker = values[0];
+ q1 = values[1];
+ q2 = values[2];
+ q3 = values[3];
+ rwhisker = values[4];
+ }
+ } else {
+ values.sort(function (a, b) { return a - b; });
+ q1 = quartile(values, 1);
+ q2 = quartile(values, 2);
+ q3 = quartile(values, 3);
+ iqr = q3 - q1;
+ if (options.get('showOutliers')) {
+ lwhisker = rwhisker = undefined;
+ for (i = 0; i < vlen; i++) {
+ if (lwhisker === undefined && values[i] > q1 - (iqr * options.get('outlierIQR'))) {
+ lwhisker = values[i];
+ }
+ if (values[i] < q3 + (iqr * options.get('outlierIQR'))) {
+ rwhisker = values[i];
+ }
+ }
+ loutlier = values[0];
+ routlier = values[vlen - 1];
+ } else {
+ lwhisker = values[0];
+ rwhisker = values[vlen - 1];
+ }
+ }
+ this.quartiles = [q1, q2, q3];
+ this.lwhisker = lwhisker;
+ this.rwhisker = rwhisker;
+ this.loutlier = loutlier;
+ this.routlier = routlier;
+
+ unitSize = canvasWidth / (maxValue - minValue + 1);
+ if (options.get('showOutliers')) {
+ canvasLeft = Math.ceil(options.get('spotRadius'));
+ canvasWidth -= 2 * Math.ceil(options.get('spotRadius'));
+ unitSize = canvasWidth / (maxValue - minValue + 1);
+ if (loutlier < lwhisker) {
+ target.drawCircle((loutlier - minValue) * unitSize + canvasLeft,
+ canvasHeight / 2,
+ options.get('spotRadius'),
+ options.get('outlierLineColor'),
+ options.get('outlierFillColor')).append();
+ }
+ if (routlier > rwhisker) {
+ target.drawCircle((routlier - minValue) * unitSize + canvasLeft,
+ canvasHeight / 2,
+ options.get('spotRadius'),
+ options.get('outlierLineColor'),
+ options.get('outlierFillColor')).append();
+ }
+ }
+
+ // box
+ target.drawRect(
+ Math.round((q1 - minValue) * unitSize + canvasLeft),
+ Math.round(canvasHeight * 0.1),
+ Math.round((q3 - q1) * unitSize),
+ Math.round(canvasHeight * 0.8),
+ options.get('boxLineColor'),
+ options.get('boxFillColor')).append();
+ // left whisker
+ target.drawLine(
+ Math.round((lwhisker - minValue) * unitSize + canvasLeft),
+ Math.round(canvasHeight / 2),
+ Math.round((q1 - minValue) * unitSize + canvasLeft),
+ Math.round(canvasHeight / 2),
+ options.get('lineColor')).append();
+ target.drawLine(
+ Math.round((lwhisker - minValue) * unitSize + canvasLeft),
+ Math.round(canvasHeight / 4),
+ Math.round((lwhisker - minValue) * unitSize + canvasLeft),
+ Math.round(canvasHeight - canvasHeight / 4),
+ options.get('whiskerColor')).append();
+ // right whisker
+ target.drawLine(Math.round((rwhisker - minValue) * unitSize + canvasLeft),
+ Math.round(canvasHeight / 2),
+ Math.round((q3 - minValue) * unitSize + canvasLeft),
+ Math.round(canvasHeight / 2),
+ options.get('lineColor')).append();
+ target.drawLine(
+ Math.round((rwhisker - minValue) * unitSize + canvasLeft),
+ Math.round(canvasHeight / 4),
+ Math.round((rwhisker - minValue) * unitSize + canvasLeft),
+ Math.round(canvasHeight - canvasHeight / 4),
+ options.get('whiskerColor')).append();
+ // median line
+ target.drawLine(
+ Math.round((q2 - minValue) * unitSize + canvasLeft),
+ Math.round(canvasHeight * 0.1),
+ Math.round((q2 - minValue) * unitSize + canvasLeft),
+ Math.round(canvasHeight * 0.9),
+ options.get('medianColor')).append();
+ if (options.get('target')) {
+ size = Math.ceil(options.get('spotRadius'));
+ target.drawLine(
+ Math.round((options.get('target') - minValue) * unitSize + canvasLeft),
+ Math.round((canvasHeight / 2) - size),
+ Math.round((options.get('target') - minValue) * unitSize + canvasLeft),
+ Math.round((canvasHeight / 2) + size),
+ options.get('targetColor')).append();
+ target.drawLine(
+ Math.round((options.get('target') - minValue) * unitSize + canvasLeft - size),
+ Math.round(canvasHeight / 2),
+ Math.round((options.get('target') - minValue) * unitSize + canvasLeft + size),
+ Math.round(canvasHeight / 2),
+ options.get('targetColor')).append();
+ }
+ target.render();
+ }
+ });
+
+ // Setup a very simple "virtual canvas" to make drawing the few shapes we need easier
+ // This is accessible as $(foo).simpledraw()
+
+ VShape = createClass({
+ init: function (target, id, type, args) {
+ this.target = target;
+ this.id = id;
+ this.type = type;
+ this.args = args;
+ },
+ append: function () {
+ this.target.appendShape(this);
+ return this;
+ }
+ });
+
+ VCanvas_base = createClass({
+ _pxregex: /(\d+)(px)?\s*$/i,
+
+ init: function (width, height, target) {
+ if (!width) {
+ return;
+ }
+ this.width = width;
+ this.height = height;
+ this.target = target;
+ this.lastShapeId = null;
+ if (target[0]) {
+ target = target[0];
+ }
+ $.data(target, '_jqs_vcanvas', this);
+ },
+
+ drawLine: function (x1, y1, x2, y2, lineColor, lineWidth) {
+ return this.drawShape([[x1, y1], [x2, y2]], lineColor, lineWidth);
+ },
+
+ drawShape: function (path, lineColor, fillColor, lineWidth) {
+ return this._genShape('Shape', [path, lineColor, fillColor, lineWidth]);
+ },
+
+ drawCircle: function (x, y, radius, lineColor, fillColor, lineWidth) {
+ return this._genShape('Circle', [x, y, radius, lineColor, fillColor, lineWidth]);
+ },
+
+ drawPieSlice: function (x, y, radius, startAngle, endAngle, lineColor, fillColor) {
+ return this._genShape('PieSlice', [x, y, radius, startAngle, endAngle, lineColor, fillColor]);
+ },
+
+ drawRect: function (x, y, width, height, lineColor, fillColor) {
+ return this._genShape('Rect', [x, y, width, height, lineColor, fillColor]);
+ },
+
+ getElement: function () {
+ return this.canvas;
+ },
+
+ /**
+ * Return the most recently inserted shape id
+ */
+ getLastShapeId: function () {
+ return this.lastShapeId;
+ },
+
+ /**
+ * Clear and reset the canvas
+ */
+ reset: function () {
+ alert('reset not implemented');
+ },
+
+ _insert: function (el, target) {
+ $(target).html(el);
+ },
+
+ /**
+ * Calculate the pixel dimensions of the canvas
+ */
+ _calculatePixelDims: function (width, height, canvas) {
+ // XXX This should probably be a configurable option
+ var match;
+ match = this._pxregex.exec(height);
+ if (match) {
+ this.pixelHeight = match[1];
+ } else {
+ this.pixelHeight = $(canvas).height();
+ }
+ match = this._pxregex.exec(width);
+ if (match) {
+ this.pixelWidth = match[1];
+ } else {
+ this.pixelWidth = $(canvas).width();
+ }
+ },
+
+ /**
+ * Generate a shape object and id for later rendering
+ */
+ _genShape: function (shapetype, shapeargs) {
+ var id = shapeCount++;
+ shapeargs.unshift(id);
+ return new VShape(this, id, shapetype, shapeargs);
+ },
+
+ /**
+ * Add a shape to the end of the render queue
+ */
+ appendShape: function (shape) {
+ alert('appendShape not implemented');
+ },
+
+ /**
+ * Replace one shape with another
+ */
+ replaceWithShape: function (shapeid, shape) {
+ alert('replaceWithShape not implemented');
+ },
+
+ /**
+ * Insert one shape after another in the render queue
+ */
+ insertAfterShape: function (shapeid, shape) {
+ alert('insertAfterShape not implemented');
+ },
+
+ /**
+ * Remove a shape from the queue
+ */
+ removeShapeId: function (shapeid) {
+ alert('removeShapeId not implemented');
+ },
+
+ /**
+ * Find a shape at the specified x/y co-ordinates
+ */
+ getShapeAt: function (el, x, y) {
+ alert('getShapeAt not implemented');
+ },
+
+ /**
+ * Render all queued shapes onto the canvas
+ */
+ render: function () {
+ alert('render not implemented');
+ }
+ });
+
+ VCanvas_canvas = createClass(VCanvas_base, {
+ init: function (width, height, target, interact) {
+ VCanvas_canvas._super.init.call(this, width, height, target);
+ this.canvas = document.createElement('canvas');
+ if (target[0]) {
+ target = target[0];
+ }
+ $.data(target, '_jqs_vcanvas', this);
+ $(this.canvas).css({ display: 'inline-block', width: width, height: height, verticalAlign: 'top' });
+ this._insert(this.canvas, target);
+ this._calculatePixelDims(width, height, this.canvas);
+ this.canvas.width = this.pixelWidth;
+ this.canvas.height = this.pixelHeight;
+ this.interact = interact;
+ this.shapes = {};
+ this.shapeseq = [];
+ this.currentTargetShapeId = undefined;
+ $(this.canvas).css({width: this.pixelWidth, height: this.pixelHeight});
+ },
+
+ _getContext: function (lineColor, fillColor, lineWidth) {
+ var context = this.canvas.getContext('2d');
+ if (lineColor !== undefined) {
+ context.strokeStyle = lineColor;
+ }
+ context.lineWidth = lineWidth === undefined ? 1 : lineWidth;
+ if (fillColor !== undefined) {
+ context.fillStyle = fillColor;
+ }
+ return context;
+ },
+
+ reset: function () {
+ var context = this._getContext();
+ context.clearRect(0, 0, this.pixelWidth, this.pixelHeight);
+ this.shapes = {};
+ this.shapeseq = [];
+ this.currentTargetShapeId = undefined;
+ },
+
+ _drawShape: function (shapeid, path, lineColor, fillColor, lineWidth) {
+ var context = this._getContext(lineColor, fillColor, lineWidth),
+ i, plen;
+ context.beginPath();
+ context.moveTo(path[0][0] + 0.5, path[0][1] + 0.5);
+ for (i = 1, plen = path.length; i < plen; i++) {
+ context.lineTo(path[i][0] + 0.5, path[i][1] + 0.5); // the 0.5 offset gives us crisp pixel-width lines
+ }
+ if (lineColor !== undefined) {
+ context.stroke();
+ }
+ if (fillColor !== undefined) {
+ context.fill();
+ }
+ if (this.targetX !== undefined && this.targetY !== undefined &&
+ context.isPointInPath(this.targetX, this.targetY)) {
+ this.currentTargetShapeId = shapeid;
+ }
+ },
+
+ _drawCircle: function (shapeid, x, y, radius, lineColor, fillColor, lineWidth) {
+ var context = this._getContext(lineColor, fillColor, lineWidth);
+ context.beginPath();
+ context.arc(x, y, radius, 0, 2 * Math.PI, false);
+ if (this.targetX !== undefined && this.targetY !== undefined &&
+ context.isPointInPath(this.targetX, this.targetY)) {
+ this.currentTargetShapeId = shapeid;
+ }
+ if (lineColor !== undefined) {
+ context.stroke();
+ }
+ if (fillColor !== undefined) {
+ context.fill();
+ }
+ },
+
+ _drawPieSlice: function (shapeid, x, y, radius, startAngle, endAngle, lineColor, fillColor) {
+ var context = this._getContext(lineColor, fillColor);
+ context.beginPath();
+ context.moveTo(x, y);
+ context.arc(x, y, radius, startAngle, endAngle, false);
+ context.lineTo(x, y);
+ context.closePath();
+ if (lineColor !== undefined) {
+ context.stroke();
+ }
+ if (fillColor) {
+ context.fill();
+ }
+ if (this.targetX !== undefined && this.targetY !== undefined &&
+ context.isPointInPath(this.targetX, this.targetY)) {
+ this.currentTargetShapeId = shapeid;
+ }
+ },
+
+ _drawRect: function (shapeid, x, y, width, height, lineColor, fillColor) {
+ return this._drawShape(shapeid, [[x, y], [x + width, y], [x + width, y + height], [x, y + height], [x, y]], lineColor, fillColor);
+ },
+
+ appendShape: function (shape) {
+ this.shapes[shape.id] = shape;
+ this.shapeseq.push(shape.id);
+ this.lastShapeId = shape.id;
+ return shape.id;
+ },
+
+ replaceWithShape: function (shapeid, shape) {
+ var shapeseq = this.shapeseq,
+ i;
+ this.shapes[shape.id] = shape;
+ for (i = shapeseq.length; i--;) {
+ if (shapeseq[i] == shapeid) {
+ shapeseq[i] = shape.id;
+ }
+ }
+ delete this.shapes[shapeid];
+ },
+
+ replaceWithShapes: function (shapeids, shapes) {
+ var shapeseq = this.shapeseq,
+ shapemap = {},
+ sid, i, first;
+
+ for (i = shapeids.length; i--;) {
+ shapemap[shapeids[i]] = true;
+ }
+ for (i = shapeseq.length; i--;) {
+ sid = shapeseq[i];
+ if (shapemap[sid]) {
+ shapeseq.splice(i, 1);
+ delete this.shapes[sid];
+ first = i;
+ }
+ }
+ for (i = shapes.length; i--;) {
+ shapeseq.splice(first, 0, shapes[i].id);
+ this.shapes[shapes[i].id] = shapes[i];
+ }
+
+ },
+
+ insertAfterShape: function (shapeid, shape) {
+ var shapeseq = this.shapeseq,
+ i;
+ for (i = shapeseq.length; i--;) {
+ if (shapeseq[i] === shapeid) {
+ shapeseq.splice(i + 1, 0, shape.id);
+ this.shapes[shape.id] = shape;
+ return;
+ }
+ }
+ },
+
+ removeShapeId: function (shapeid) {
+ var shapeseq = this.shapeseq,
+ i;
+ for (i = shapeseq.length; i--;) {
+ if (shapeseq[i] === shapeid) {
+ shapeseq.splice(i, 1);
+ break;
+ }
+ }
+ delete this.shapes[shapeid];
+ },
+
+ getShapeAt: function (el, x, y) {
+ this.targetX = x;
+ this.targetY = y;
+ this.render();
+ return this.currentTargetShapeId;
+ },
+
+ render: function () {
+ var shapeseq = this.shapeseq,
+ shapes = this.shapes,
+ shapeCount = shapeseq.length,
+ context = this._getContext(),
+ shapeid, shape, i;
+ context.clearRect(0, 0, this.pixelWidth, this.pixelHeight);
+ for (i = 0; i < shapeCount; i++) {
+ shapeid = shapeseq[i];
+ shape = shapes[shapeid];
+ this['_draw' + shape.type].apply(this, shape.args);
+ }
+ if (!this.interact) {
+ // not interactive so no need to keep the shapes array
+ this.shapes = {};
+ this.shapeseq = [];
+ }
+ }
+
+ });
+
+ VCanvas_vml = createClass(VCanvas_base, {
+ init: function (width, height, target) {
+ var groupel;
+ VCanvas_vml._super.init.call(this, width, height, target);
+ if (target[0]) {
+ target = target[0];
+ }
+ $.data(target, '_jqs_vcanvas', this);
+ this.canvas = document.createElement('span');
+ $(this.canvas).css({ display: 'inline-block', position: 'relative', overflow: 'hidden', width: width, height: height, margin: '0px', padding: '0px', verticalAlign: 'top'});
+ this._insert(this.canvas, target);
+ this._calculatePixelDims(width, height, this.canvas);
+ this.canvas.width = this.pixelWidth;
+ this.canvas.height = this.pixelHeight;
+ groupel = '';
+ this.canvas.insertAdjacentHTML('beforeEnd', groupel);
+ this.group = $(this.canvas).children()[0];
+ this.rendered = false;
+ this.prerender = '';
+ },
+
+ _drawShape: function (shapeid, path, lineColor, fillColor, lineWidth) {
+ var vpath = [],
+ initial, stroke, fill, closed, vel, plen, i;
+ for (i = 0, plen = path.length; i < plen; i++) {
+ vpath[i] = '' + (path[i][0]) + ',' + (path[i][1]);
+ }
+ initial = vpath.splice(0, 1);
+ lineWidth = lineWidth === undefined ? 1 : lineWidth;
+ stroke = lineColor === undefined ? ' stroked="false" ' : ' strokeWeight="' + lineWidth + 'px" strokeColor="' + lineColor + '" ';
+ fill = fillColor === undefined ? ' filled="false"' : ' fillColor="' + fillColor + '" filled="true" ';
+ closed = vpath[0] === vpath[vpath.length - 1] ? 'x ' : '';
+ vel = '' +
+ ' ';
+ return vel;
+ },
+
+ _drawCircle: function (shapeid, x, y, radius, lineColor, fillColor, lineWidth) {
+ var stroke, fill, vel;
+ x -= radius;
+ y -= radius;
+ stroke = lineColor === undefined ? ' stroked="false" ' : ' strokeWeight="' + lineWidth + 'px" strokeColor="' + lineColor + '" ';
+ fill = fillColor === undefined ? ' filled="false"' : ' fillColor="' + fillColor + '" filled="true" ';
+ vel = '';
+ return vel;
+
+ },
+
+ _drawPieSlice: function (shapeid, x, y, radius, startAngle, endAngle, lineColor, fillColor) {
+ var vpath, startx, starty, endx, endy, stroke, fill, vel;
+ if (startAngle === endAngle) {
+ return ''; // VML seems to have problem when start angle equals end angle.
+ }
+ if ((endAngle - startAngle) === (2 * Math.PI)) {
+ startAngle = 0.0; // VML seems to have a problem when drawing a full circle that doesn't start 0
+ endAngle = (2 * Math.PI);
+ }
+
+ startx = x + Math.round(Math.cos(startAngle) * radius);
+ starty = y + Math.round(Math.sin(startAngle) * radius);
+ endx = x + Math.round(Math.cos(endAngle) * radius);
+ endy = y + Math.round(Math.sin(endAngle) * radius);
+
+ if (startx === endx && starty === endy) {
+ if ((endAngle - startAngle) < Math.PI) {
+ // Prevent very small slices from being mistaken as a whole pie
+ return '';
+ }
+ // essentially going to be the entire circle, so ignore startAngle
+ startx = endx = x + radius;
+ starty = endy = y;
+ }
+
+ if (startx === endx && starty === endy && (endAngle - startAngle) < Math.PI) {
+ return '';
+ }
+
+ vpath = [x - radius, y - radius, x + radius, y + radius, startx, starty, endx, endy];
+ stroke = lineColor === undefined ? ' stroked="false" ' : ' strokeWeight="1px" strokeColor="' + lineColor + '" ';
+ fill = fillColor === undefined ? ' filled="false"' : ' fillColor="' + fillColor + '" filled="true" ';
+ vel = '' +
+ ' ';
+ return vel;
+ },
+
+ _drawRect: function (shapeid, x, y, width, height, lineColor, fillColor) {
+ return this._drawShape(shapeid, [[x, y], [x, y + height], [x + width, y + height], [x + width, y], [x, y]], lineColor, fillColor);
+ },
+
+ reset: function () {
+ this.group.innerHTML = '';
+ },
+
+ appendShape: function (shape) {
+ var vel = this['_draw' + shape.type].apply(this, shape.args);
+ if (this.rendered) {
+ this.group.insertAdjacentHTML('beforeEnd', vel);
+ } else {
+ this.prerender += vel;
+ }
+ this.lastShapeId = shape.id;
+ return shape.id;
+ },
+
+ replaceWithShape: function (shapeid, shape) {
+ var existing = $('#jqsshape' + shapeid),
+ vel = this['_draw' + shape.type].apply(this, shape.args);
+ existing[0].outerHTML = vel;
+ },
+
+ replaceWithShapes: function (shapeids, shapes) {
+ // replace the first shapeid with all the new shapes then toast the remaining old shapes
+ var existing = $('#jqsshape' + shapeids[0]),
+ replace = '',
+ slen = shapes.length,
+ i;
+ for (i = 0; i < slen; i++) {
+ replace += this['_draw' + shapes[i].type].apply(this, shapes[i].args);
+ }
+ existing[0].outerHTML = replace;
+ for (i = 1; i < shapeids.length; i++) {
+ $('#jqsshape' + shapeids[i]).remove();
+ }
+ },
+
+ insertAfterShape: function (shapeid, shape) {
+ var existing = $('#jqsshape' + shapeid),
+ vel = this['_draw' + shape.type].apply(this, shape.args);
+ existing[0].insertAdjacentHTML('afterEnd', vel);
+ },
+
+ removeShapeId: function (shapeid) {
+ var existing = $('#jqsshape' + shapeid);
+ this.group.removeChild(existing[0]);
+ },
+
+ getShapeAt: function (el, x, y) {
+ var shapeid = el.id.substr(8);
+ return shapeid;
+ },
+
+ render: function () {
+ if (!this.rendered) {
+ // batch the intial render into a single repaint
+ this.group.innerHTML = this.prerender;
+ this.rendered = true;
+ }
+ }
+ });
+
+}))}(document, Math));
diff --git a/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/contrib/require.js b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/contrib/require.js
new file mode 100644
index 00000000..77a5bb1d
--- /dev/null
+++ b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/contrib/require.js
@@ -0,0 +1,2076 @@
+/** vim: et:ts=4:sw=4:sts=4
+ * @license RequireJS 2.1.15 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+//Not using strict: uneven strict support in browsers, #392, and causes
+//problems with requirejs.exec()/transpiler plugins that may not be strict.
+/*jslint regexp: true, nomen: true, sloppy: true */
+/*global window, navigator, document, importScripts, setTimeout, opera */
+
+var requirejs, require, define;
+(function (global) {
+ var req, s, head, baseElement, dataMain, src,
+ interactiveScript, currentlyAddingScript, mainScript, subPath,
+ version = '2.1.15',
+ commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
+ cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
+ jsSuffixRegExp = /\.js$/,
+ currDirRegExp = /^\.\//,
+ op = Object.prototype,
+ ostring = op.toString,
+ hasOwn = op.hasOwnProperty,
+ ap = Array.prototype,
+ apsp = ap.splice,
+ isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document),
+ isWebWorker = !isBrowser && typeof importScripts !== 'undefined',
+ //PS3 indicates loaded and complete, but need to wait for complete
+ //specifically. Sequence is 'loading', 'loaded', execution,
+ // then 'complete'. The UA check is unfortunate, but not sure how
+ //to feature test w/o causing perf issues.
+ readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ?
+ /^complete$/ : /^(complete|loaded)$/,
+ defContextName = '_',
+ //Oh the tragedy, detecting opera. See the usage of isOpera for reason.
+ isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]',
+ contexts = {},
+ cfg = {},
+ globalDefQueue = [],
+ useInteractive = false;
+
+ function isFunction(it) {
+ return ostring.call(it) === '[object Function]';
+ }
+
+ function isArray(it) {
+ return ostring.call(it) === '[object Array]';
+ }
+
+ /**
+ * Helper function for iterating over an array. If the func returns
+ * a true value, it will break out of the loop.
+ */
+ function each(ary, func) {
+ if (ary) {
+ var i;
+ for (i = 0; i < ary.length; i += 1) {
+ if (ary[i] && func(ary[i], i, ary)) {
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * Helper function for iterating over an array backwards. If the func
+ * returns a true value, it will break out of the loop.
+ */
+ function eachReverse(ary, func) {
+ if (ary) {
+ var i;
+ for (i = ary.length - 1; i > -1; i -= 1) {
+ if (ary[i] && func(ary[i], i, ary)) {
+ break;
+ }
+ }
+ }
+ }
+
+ function hasProp(obj, prop) {
+ return hasOwn.call(obj, prop);
+ }
+
+ function getOwn(obj, prop) {
+ return hasProp(obj, prop) && obj[prop];
+ }
+
+ /**
+ * Cycles over properties in an object and calls a function for each
+ * property value. If the function returns a truthy value, then the
+ * iteration is stopped.
+ */
+ function eachProp(obj, func) {
+ var prop;
+ for (prop in obj) {
+ if (hasProp(obj, prop)) {
+ if (func(obj[prop], prop)) {
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * Simple function to mix in properties from source into target,
+ * but only if target does not already have a property of the same name.
+ */
+ function mixin(target, source, force, deepStringMixin) {
+ if (source) {
+ eachProp(source, function (value, prop) {
+ if (force || !hasProp(target, prop)) {
+ if (deepStringMixin && typeof value === 'object' && value &&
+ !isArray(value) && !isFunction(value) &&
+ !(value instanceof RegExp)) {
+
+ if (!target[prop]) {
+ target[prop] = {};
+ }
+ mixin(target[prop], value, force, deepStringMixin);
+ } else {
+ target[prop] = value;
+ }
+ }
+ });
+ }
+ return target;
+ }
+
+ //Similar to Function.prototype.bind, but the 'this' object is specified
+ //first, since it is easier to read/figure out what 'this' will be.
+ function bind(obj, fn) {
+ return function () {
+ return fn.apply(obj, arguments);
+ };
+ }
+
+ function scripts() {
+ return document.getElementsByTagName('script');
+ }
+
+ function defaultOnError(err) {
+ throw err;
+ }
+
+ //Allow getting a global that is expressed in
+ //dot notation, like 'a.b.c'.
+ function getGlobal(value) {
+ if (!value) {
+ return value;
+ }
+ var g = global;
+ each(value.split('.'), function (part) {
+ g = g[part];
+ });
+ return g;
+ }
+
+ /**
+ * Constructs an error with a pointer to an URL with more information.
+ * @param {String} id the error ID that maps to an ID on a web page.
+ * @param {String} message human readable error.
+ * @param {Error} [err] the original error, if there is one.
+ *
+ * @returns {Error}
+ */
+ function makeError(id, msg, err, requireModules) {
+ var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
+ e.requireType = id;
+ e.requireModules = requireModules;
+ if (err) {
+ e.originalError = err;
+ }
+ return e;
+ }
+
+ if (typeof define !== 'undefined') {
+ //If a define is already in play via another AMD loader,
+ //do not overwrite.
+ return;
+ }
+
+ if (typeof requirejs !== 'undefined') {
+ if (isFunction(requirejs)) {
+ //Do not overwrite an existing requirejs instance.
+ return;
+ }
+ cfg = requirejs;
+ requirejs = undefined;
+ }
+
+ //Allow for a require config object
+ if (typeof require !== 'undefined' && !isFunction(require)) {
+ //assume it is a config object.
+ cfg = require;
+ require = undefined;
+ }
+
+ function newContext(contextName) {
+ var inCheckLoaded, Module, context, handlers,
+ checkLoadedTimeoutId,
+ config = {
+ //Defaults. Do not set a default for map
+ //config to speed up normalize(), which
+ //will run faster if there is no default.
+ waitSeconds: 7,
+ baseUrl: './',
+ paths: {},
+ bundles: {},
+ pkgs: {},
+ shim: {},
+ config: {}
+ },
+ registry = {},
+ //registry of just enabled modules, to speed
+ //cycle breaking code when lots of modules
+ //are registered, but not activated.
+ enabledRegistry = {},
+ undefEvents = {},
+ defQueue = [],
+ defined = {},
+ urlFetched = {},
+ bundlesMap = {},
+ requireCounter = 1,
+ unnormalizedCounter = 1;
+
+ /**
+ * Trims the . and .. from an array of path segments.
+ * It will keep a leading path segment if a .. will become
+ * the first path segment, to help with module name lookups,
+ * which act like paths, but can be remapped. But the end result,
+ * all paths that use this function should look normalized.
+ * NOTE: this method MODIFIES the input array.
+ * @param {Array} ary the array of path segments.
+ */
+ function trimDots(ary) {
+ var i, part;
+ for (i = 0; i < ary.length; i++) {
+ part = ary[i];
+ if (part === '.') {
+ ary.splice(i, 1);
+ i -= 1;
+ } else if (part === '..') {
+ // If at the start, or previous value is still ..,
+ // keep them so that when converted to a path it may
+ // still work when converted to a path, even though
+ // as an ID it is less than ideal. In larger point
+ // releases, may be better to just kick out an error.
+ if (i === 0 || (i == 1 && ary[2] === '..') || ary[i - 1] === '..') {
+ continue;
+ } else if (i > 0) {
+ ary.splice(i - 1, 2);
+ i -= 2;
+ }
+ }
+ }
+ }
+
+ /**
+ * Given a relative module name, like ./something, normalize it to
+ * a real name that can be mapped to a path.
+ * @param {String} name the relative name
+ * @param {String} baseName a real name that the name arg is relative
+ * to.
+ * @param {Boolean} applyMap apply the map config to the value. Should
+ * only be done if this normalization is for a dependency ID.
+ * @returns {String} normalized name
+ */
+ function normalize(name, baseName, applyMap) {
+ var pkgMain, mapValue, nameParts, i, j, nameSegment, lastIndex,
+ foundMap, foundI, foundStarMap, starI, normalizedBaseParts,
+ baseParts = (baseName && baseName.split('/')),
+ map = config.map,
+ starMap = map && map['*'];
+
+ //Adjust any relative paths.
+ if (name) {
+ name = name.split('/');
+ lastIndex = name.length - 1;
+
+ // If wanting node ID compatibility, strip .js from end
+ // of IDs. Have to do this here, and not in nameToUrl
+ // because node allows either .js or non .js to map
+ // to same file.
+ if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
+ name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
+ }
+
+ // Starts with a '.' so need the baseName
+ if (name[0].charAt(0) === '.' && baseParts) {
+ //Convert baseName to array, and lop off the last part,
+ //so that . matches that 'directory' and not name of the baseName's
+ //module. For instance, baseName of 'one/two/three', maps to
+ //'one/two/three.js', but we want the directory, 'one/two' for
+ //this normalization.
+ normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
+ name = normalizedBaseParts.concat(name);
+ }
+
+ trimDots(name);
+ name = name.join('/');
+ }
+
+ //Apply map config if available.
+ if (applyMap && map && (baseParts || starMap)) {
+ nameParts = name.split('/');
+
+ outerLoop: for (i = nameParts.length; i > 0; i -= 1) {
+ nameSegment = nameParts.slice(0, i).join('/');
+
+ if (baseParts) {
+ //Find the longest baseName segment match in the config.
+ //So, do joins on the biggest to smallest lengths of baseParts.
+ for (j = baseParts.length; j > 0; j -= 1) {
+ mapValue = getOwn(map, baseParts.slice(0, j).join('/'));
+
+ //baseName segment has config, find if it has one for
+ //this name.
+ if (mapValue) {
+ mapValue = getOwn(mapValue, nameSegment);
+ if (mapValue) {
+ //Match, update name to the new value.
+ foundMap = mapValue;
+ foundI = i;
+ break outerLoop;
+ }
+ }
+ }
+ }
+
+ //Check for a star map match, but just hold on to it,
+ //if there is a shorter segment match later in a matching
+ //config, then favor over this star map.
+ if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) {
+ foundStarMap = getOwn(starMap, nameSegment);
+ starI = i;
+ }
+ }
+
+ if (!foundMap && foundStarMap) {
+ foundMap = foundStarMap;
+ foundI = starI;
+ }
+
+ if (foundMap) {
+ nameParts.splice(0, foundI, foundMap);
+ name = nameParts.join('/');
+ }
+ }
+
+ // If the name points to a package's name, use
+ // the package main instead.
+ pkgMain = getOwn(config.pkgs, name);
+
+ return pkgMain ? pkgMain : name;
+ }
+
+ function removeScript(name) {
+ if (isBrowser) {
+ each(scripts(), function (scriptNode) {
+ if (scriptNode.getAttribute('data-requiremodule') === name &&
+ scriptNode.getAttribute('data-requirecontext') === context.contextName) {
+ scriptNode.parentNode.removeChild(scriptNode);
+ return true;
+ }
+ });
+ }
+ }
+
+ function hasPathFallback(id) {
+ var pathConfig = getOwn(config.paths, id);
+ if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) {
+ //Pop off the first array value, since it failed, and
+ //retry
+ pathConfig.shift();
+ context.require.undef(id);
+
+ //Custom require that does not do map translation, since
+ //ID is "absolute", already mapped/resolved.
+ context.makeRequire(null, {
+ skipMap: true
+ })([id]);
+
+ return true;
+ }
+ }
+
+ //Turns a plugin!resource to [plugin, resource]
+ //with the plugin being undefined if the name
+ //did not have a plugin prefix.
+ function splitPrefix(name) {
+ var prefix,
+ index = name ? name.indexOf('!') : -1;
+ if (index > -1) {
+ prefix = name.substring(0, index);
+ name = name.substring(index + 1, name.length);
+ }
+ return [prefix, name];
+ }
+
+ /**
+ * Creates a module mapping that includes plugin prefix, module
+ * name, and path. If parentModuleMap is provided it will
+ * also normalize the name via require.normalize()
+ *
+ * @param {String} name the module name
+ * @param {String} [parentModuleMap] parent module map
+ * for the module name, used to resolve relative names.
+ * @param {Boolean} isNormalized: is the ID already normalized.
+ * This is true if this call is done for a define() module ID.
+ * @param {Boolean} applyMap: apply the map config to the ID.
+ * Should only be true if this map is for a dependency.
+ *
+ * @returns {Object}
+ */
+ function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) {
+ var url, pluginModule, suffix, nameParts,
+ prefix = null,
+ parentName = parentModuleMap ? parentModuleMap.name : null,
+ originalName = name,
+ isDefine = true,
+ normalizedName = '';
+
+ //If no name, then it means it is a require call, generate an
+ //internal name.
+ if (!name) {
+ isDefine = false;
+ name = '_@r' + (requireCounter += 1);
+ }
+
+ nameParts = splitPrefix(name);
+ prefix = nameParts[0];
+ name = nameParts[1];
+
+ if (prefix) {
+ prefix = normalize(prefix, parentName, applyMap);
+ pluginModule = getOwn(defined, prefix);
+ }
+
+ //Account for relative paths if there is a base name.
+ if (name) {
+ if (prefix) {
+ if (pluginModule && pluginModule.normalize) {
+ //Plugin is loaded, use its normalize method.
+ normalizedName = pluginModule.normalize(name, function (name) {
+ return normalize(name, parentName, applyMap);
+ });
+ } else {
+ // If nested plugin references, then do not try to
+ // normalize, as it will not normalize correctly. This
+ // places a restriction on resourceIds, and the longer
+ // term solution is not to normalize until plugins are
+ // loaded and all normalizations to allow for async
+ // loading of a loader plugin. But for now, fixes the
+ // common uses. Details in #1131
+ normalizedName = name.indexOf('!') === -1 ?
+ normalize(name, parentName, applyMap) :
+ name;
+ }
+ } else {
+ //A regular module.
+ normalizedName = normalize(name, parentName, applyMap);
+
+ //Normalized name may be a plugin ID due to map config
+ //application in normalize. The map config values must
+ //already be normalized, so do not need to redo that part.
+ nameParts = splitPrefix(normalizedName);
+ prefix = nameParts[0];
+ normalizedName = nameParts[1];
+ isNormalized = true;
+
+ url = context.nameToUrl(normalizedName);
+ }
+ }
+
+ //If the id is a plugin id that cannot be determined if it needs
+ //normalization, stamp it with a unique ID so two matching relative
+ //ids that may conflict can be separate.
+ suffix = prefix && !pluginModule && !isNormalized ?
+ '_unnormalized' + (unnormalizedCounter += 1) :
+ '';
+
+ return {
+ prefix: prefix,
+ name: normalizedName,
+ parentMap: parentModuleMap,
+ unnormalized: !!suffix,
+ url: url,
+ originalName: originalName,
+ isDefine: isDefine,
+ id: (prefix ?
+ prefix + '!' + normalizedName :
+ normalizedName) + suffix
+ };
+ }
+
+ function getModule(depMap) {
+ var id = depMap.id,
+ mod = getOwn(registry, id);
+
+ if (!mod) {
+ mod = registry[id] = new context.Module(depMap);
+ }
+
+ return mod;
+ }
+
+ function on(depMap, name, fn) {
+ var id = depMap.id,
+ mod = getOwn(registry, id);
+
+ if (hasProp(defined, id) &&
+ (!mod || mod.defineEmitComplete)) {
+ if (name === 'defined') {
+ fn(defined[id]);
+ }
+ } else {
+ mod = getModule(depMap);
+ if (mod.error && name === 'error') {
+ fn(mod.error);
+ } else {
+ mod.on(name, fn);
+ }
+ }
+ }
+
+ function onError(err, errback) {
+ var ids = err.requireModules,
+ notified = false;
+
+ if (errback) {
+ errback(err);
+ } else {
+ each(ids, function (id) {
+ var mod = getOwn(registry, id);
+ if (mod) {
+ //Set error on module, so it skips timeout checks.
+ mod.error = err;
+ if (mod.events.error) {
+ notified = true;
+ mod.emit('error', err);
+ }
+ }
+ });
+
+ if (!notified) {
+ req.onError(err);
+ }
+ }
+ }
+
+ /**
+ * Internal method to transfer globalQueue items to this context's
+ * defQueue.
+ */
+ function takeGlobalQueue() {
+ //Push all the globalDefQueue items into the context's defQueue
+ if (globalDefQueue.length) {
+ //Array splice in the values since the context code has a
+ //local var ref to defQueue, so cannot just reassign the one
+ //on context.
+ apsp.apply(defQueue,
+ [defQueue.length, 0].concat(globalDefQueue));
+ globalDefQueue = [];
+ }
+ }
+
+ handlers = {
+ 'require': function (mod) {
+ if (mod.require) {
+ return mod.require;
+ } else {
+ return (mod.require = context.makeRequire(mod.map));
+ }
+ },
+ 'exports': function (mod) {
+ mod.usingExports = true;
+ if (mod.map.isDefine) {
+ if (mod.exports) {
+ return (defined[mod.map.id] = mod.exports);
+ } else {
+ return (mod.exports = defined[mod.map.id] = {});
+ }
+ }
+ },
+ 'module': function (mod) {
+ if (mod.module) {
+ return mod.module;
+ } else {
+ return (mod.module = {
+ id: mod.map.id,
+ uri: mod.map.url,
+ config: function () {
+ return getOwn(config.config, mod.map.id) || {};
+ },
+ exports: mod.exports || (mod.exports = {})
+ });
+ }
+ }
+ };
+
+ function cleanRegistry(id) {
+ //Clean up machinery used for waiting modules.
+ delete registry[id];
+ delete enabledRegistry[id];
+ }
+
+ function breakCycle(mod, traced, processed) {
+ var id = mod.map.id;
+
+ if (mod.error) {
+ mod.emit('error', mod.error);
+ } else {
+ traced[id] = true;
+ each(mod.depMaps, function (depMap, i) {
+ var depId = depMap.id,
+ dep = getOwn(registry, depId);
+
+ //Only force things that have not completed
+ //being defined, so still in the registry,
+ //and only if it has not been matched up
+ //in the module already.
+ if (dep && !mod.depMatched[i] && !processed[depId]) {
+ if (getOwn(traced, depId)) {
+ mod.defineDep(i, defined[depId]);
+ mod.check(); //pass false?
+ } else {
+ breakCycle(dep, traced, processed);
+ }
+ }
+ });
+ processed[id] = true;
+ }
+ }
+
+ function checkLoaded() {
+ var err, usingPathFallback,
+ waitInterval = config.waitSeconds * 1000,
+ //It is possible to disable the wait interval by using waitSeconds of 0.
+ expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(),
+ noLoads = [],
+ reqCalls = [],
+ stillLoading = false,
+ needCycleCheck = true;
+
+ //Do not bother if this call was a result of a cycle break.
+ if (inCheckLoaded) {
+ return;
+ }
+
+ inCheckLoaded = true;
+
+ //Figure out the state of all the modules.
+ eachProp(enabledRegistry, function (mod) {
+ var map = mod.map,
+ modId = map.id;
+
+ //Skip things that are not enabled or in error state.
+ if (!mod.enabled) {
+ return;
+ }
+
+ if (!map.isDefine) {
+ reqCalls.push(mod);
+ }
+
+ if (!mod.error) {
+ //If the module should be executed, and it has not
+ //been inited and time is up, remember it.
+ if (!mod.inited && expired) {
+ if (hasPathFallback(modId)) {
+ usingPathFallback = true;
+ stillLoading = true;
+ } else {
+ noLoads.push(modId);
+ removeScript(modId);
+ }
+ } else if (!mod.inited && mod.fetched && map.isDefine) {
+ stillLoading = true;
+ if (!map.prefix) {
+ //No reason to keep looking for unfinished
+ //loading. If the only stillLoading is a
+ //plugin resource though, keep going,
+ //because it may be that a plugin resource
+ //is waiting on a non-plugin cycle.
+ return (needCycleCheck = false);
+ }
+ }
+ }
+ });
+
+ if (expired && noLoads.length) {
+ //If wait time expired, throw error of unloaded modules.
+ err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads);
+ err.contextName = context.contextName;
+ return onError(err);
+ }
+
+ //Not expired, check for a cycle.
+ if (needCycleCheck) {
+ each(reqCalls, function (mod) {
+ breakCycle(mod, {}, {});
+ });
+ }
+
+ //If still waiting on loads, and the waiting load is something
+ //other than a plugin resource, or there are still outstanding
+ //scripts, then just try back later.
+ if ((!expired || usingPathFallback) && stillLoading) {
+ //Something is still waiting to load. Wait for it, but only
+ //if a timeout is not already in effect.
+ if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) {
+ checkLoadedTimeoutId = setTimeout(function () {
+ checkLoadedTimeoutId = 0;
+ checkLoaded();
+ }, 50);
+ }
+ }
+
+ inCheckLoaded = false;
+ }
+
+ Module = function (map) {
+ this.events = getOwn(undefEvents, map.id) || {};
+ this.map = map;
+ this.shim = getOwn(config.shim, map.id);
+ this.depExports = [];
+ this.depMaps = [];
+ this.depMatched = [];
+ this.pluginMaps = {};
+ this.depCount = 0;
+
+ /* this.exports this.factory
+ this.depMaps = [],
+ this.enabled, this.fetched
+ */
+ };
+
+ Module.prototype = {
+ init: function (depMaps, factory, errback, options) {
+ options = options || {};
+
+ //Do not do more inits if already done. Can happen if there
+ //are multiple define calls for the same module. That is not
+ //a normal, common case, but it is also not unexpected.
+ if (this.inited) {
+ return;
+ }
+
+ this.factory = factory;
+
+ if (errback) {
+ //Register for errors on this module.
+ this.on('error', errback);
+ } else if (this.events.error) {
+ //If no errback already, but there are error listeners
+ //on this module, set up an errback to pass to the deps.
+ errback = bind(this, function (err) {
+ this.emit('error', err);
+ });
+ }
+
+ //Do a copy of the dependency array, so that
+ //source inputs are not modified. For example
+ //"shim" deps are passed in here directly, and
+ //doing a direct modification of the depMaps array
+ //would affect that config.
+ this.depMaps = depMaps && depMaps.slice(0);
+
+ this.errback = errback;
+
+ //Indicate this module has be initialized
+ this.inited = true;
+
+ this.ignore = options.ignore;
+
+ //Could have option to init this module in enabled mode,
+ //or could have been previously marked as enabled. However,
+ //the dependencies are not known until init is called. So
+ //if enabled previously, now trigger dependencies as enabled.
+ if (options.enabled || this.enabled) {
+ //Enable this module and dependencies.
+ //Will call this.check()
+ this.enable();
+ } else {
+ this.check();
+ }
+ },
+
+ defineDep: function (i, depExports) {
+ //Because of cycles, defined callback for a given
+ //export can be called more than once.
+ if (!this.depMatched[i]) {
+ this.depMatched[i] = true;
+ this.depCount -= 1;
+ this.depExports[i] = depExports;
+ }
+ },
+
+ fetch: function () {
+ if (this.fetched) {
+ return;
+ }
+ this.fetched = true;
+
+ context.startTime = (new Date()).getTime();
+
+ var map = this.map;
+
+ //If the manager is for a plugin managed resource,
+ //ask the plugin to load it now.
+ if (this.shim) {
+ context.makeRequire(this.map, {
+ enableBuildCallback: true
+ })(this.shim.deps || [], bind(this, function () {
+ return map.prefix ? this.callPlugin() : this.load();
+ }));
+ } else {
+ //Regular dependency.
+ return map.prefix ? this.callPlugin() : this.load();
+ }
+ },
+
+ load: function () {
+ var url = this.map.url;
+
+ //Regular dependency.
+ if (!urlFetched[url]) {
+ urlFetched[url] = true;
+ context.load(this.map.id, url);
+ }
+ },
+
+ /**
+ * Checks if the module is ready to define itself, and if so,
+ * define it.
+ */
+ check: function () {
+ if (!this.enabled || this.enabling) {
+ return;
+ }
+
+ var err, cjsModule,
+ id = this.map.id,
+ depExports = this.depExports,
+ exports = this.exports,
+ factory = this.factory;
+
+ if (!this.inited) {
+ this.fetch();
+ } else if (this.error) {
+ this.emit('error', this.error);
+ } else if (!this.defining) {
+ //The factory could trigger another require call
+ //that would result in checking this module to
+ //define itself again. If already in the process
+ //of doing that, skip this work.
+ this.defining = true;
+
+ if (this.depCount < 1 && !this.defined) {
+ if (isFunction(factory)) {
+ //If there is an error listener, favor passing
+ //to that instead of throwing an error. However,
+ //only do it for define()'d modules. require
+ //errbacks should not be called for failures in
+ //their callbacks (#699). However if a global
+ //onError is set, use that.
+ if ((this.events.error && this.map.isDefine) ||
+ req.onError !== defaultOnError) {
+ try {
+ exports = context.execCb(id, factory, depExports, exports);
+ } catch (e) {
+ err = e;
+ }
+ } else {
+ exports = context.execCb(id, factory, depExports, exports);
+ }
+
+ // Favor return value over exports. If node/cjs in play,
+ // then will not have a return value anyway. Favor
+ // module.exports assignment over exports object.
+ if (this.map.isDefine && exports === undefined) {
+ cjsModule = this.module;
+ if (cjsModule) {
+ exports = cjsModule.exports;
+ } else if (this.usingExports) {
+ //exports already set the defined value.
+ exports = this.exports;
+ }
+ }
+
+ if (err) {
+ err.requireMap = this.map;
+ err.requireModules = this.map.isDefine ? [this.map.id] : null;
+ err.requireType = this.map.isDefine ? 'define' : 'require';
+ return onError((this.error = err));
+ }
+
+ } else {
+ //Just a literal value
+ exports = factory;
+ }
+
+ this.exports = exports;
+
+ if (this.map.isDefine && !this.ignore) {
+ defined[id] = exports;
+
+ if (req.onResourceLoad) {
+ req.onResourceLoad(context, this.map, this.depMaps);
+ }
+ }
+
+ //Clean up
+ cleanRegistry(id);
+
+ this.defined = true;
+ }
+
+ //Finished the define stage. Allow calling check again
+ //to allow define notifications below in the case of a
+ //cycle.
+ this.defining = false;
+
+ if (this.defined && !this.defineEmitted) {
+ this.defineEmitted = true;
+ this.emit('defined', this.exports);
+ this.defineEmitComplete = true;
+ }
+
+ }
+ },
+
+ callPlugin: function () {
+ var map = this.map,
+ id = map.id,
+ //Map already normalized the prefix.
+ pluginMap = makeModuleMap(map.prefix);
+
+ //Mark this as a dependency for this plugin, so it
+ //can be traced for cycles.
+ this.depMaps.push(pluginMap);
+
+ on(pluginMap, 'defined', bind(this, function (plugin) {
+ var load, normalizedMap, normalizedMod,
+ bundleId = getOwn(bundlesMap, this.map.id),
+ name = this.map.name,
+ parentName = this.map.parentMap ? this.map.parentMap.name : null,
+ localRequire = context.makeRequire(map.parentMap, {
+ enableBuildCallback: true
+ });
+
+ //If current map is not normalized, wait for that
+ //normalized name to load instead of continuing.
+ if (this.map.unnormalized) {
+ //Normalize the ID if the plugin allows it.
+ if (plugin.normalize) {
+ name = plugin.normalize(name, function (name) {
+ return normalize(name, parentName, true);
+ }) || '';
+ }
+
+ //prefix and name should already be normalized, no need
+ //for applying map config again either.
+ normalizedMap = makeModuleMap(map.prefix + '!' + name,
+ this.map.parentMap);
+ on(normalizedMap,
+ 'defined', bind(this, function (value) {
+ this.init([], function () { return value; }, null, {
+ enabled: true,
+ ignore: true
+ });
+ }));
+
+ normalizedMod = getOwn(registry, normalizedMap.id);
+ if (normalizedMod) {
+ //Mark this as a dependency for this plugin, so it
+ //can be traced for cycles.
+ this.depMaps.push(normalizedMap);
+
+ if (this.events.error) {
+ normalizedMod.on('error', bind(this, function (err) {
+ this.emit('error', err);
+ }));
+ }
+ normalizedMod.enable();
+ }
+
+ return;
+ }
+
+ //If a paths config, then just load that file instead to
+ //resolve the plugin, as it is built into that paths layer.
+ if (bundleId) {
+ this.map.url = context.nameToUrl(bundleId);
+ this.load();
+ return;
+ }
+
+ load = bind(this, function (value) {
+ this.init([], function () { return value; }, null, {
+ enabled: true
+ });
+ });
+
+ load.error = bind(this, function (err) {
+ this.inited = true;
+ this.error = err;
+ err.requireModules = [id];
+
+ //Remove temp unnormalized modules for this module,
+ //since they will never be resolved otherwise now.
+ eachProp(registry, function (mod) {
+ if (mod.map.id.indexOf(id + '_unnormalized') === 0) {
+ cleanRegistry(mod.map.id);
+ }
+ });
+
+ onError(err);
+ });
+
+ //Allow plugins to load other code without having to know the
+ //context or how to 'complete' the load.
+ load.fromText = bind(this, function (text, textAlt) {
+ /*jslint evil: true */
+ var moduleName = map.name,
+ moduleMap = makeModuleMap(moduleName),
+ hasInteractive = useInteractive;
+
+ //As of 2.1.0, support just passing the text, to reinforce
+ //fromText only being called once per resource. Still
+ //support old style of passing moduleName but discard
+ //that moduleName in favor of the internal ref.
+ if (textAlt) {
+ text = textAlt;
+ }
+
+ //Turn off interactive script matching for IE for any define
+ //calls in the text, then turn it back on at the end.
+ if (hasInteractive) {
+ useInteractive = false;
+ }
+
+ //Prime the system by creating a module instance for
+ //it.
+ getModule(moduleMap);
+
+ //Transfer any config to this other module.
+ if (hasProp(config.config, id)) {
+ config.config[moduleName] = config.config[id];
+ }
+
+ try {
+ req.exec(text);
+ } catch (e) {
+ return onError(makeError('fromtexteval',
+ 'fromText eval for ' + id +
+ ' failed: ' + e,
+ e,
+ [id]));
+ }
+
+ if (hasInteractive) {
+ useInteractive = true;
+ }
+
+ //Mark this as a dependency for the plugin
+ //resource
+ this.depMaps.push(moduleMap);
+
+ //Support anonymous modules.
+ context.completeLoad(moduleName);
+
+ //Bind the value of that module to the value for this
+ //resource ID.
+ localRequire([moduleName], load);
+ });
+
+ //Use parentName here since the plugin's name is not reliable,
+ //could be some weird string with no path that actually wants to
+ //reference the parentName's path.
+ plugin.load(map.name, localRequire, load, config);
+ }));
+
+ context.enable(pluginMap, this);
+ this.pluginMaps[pluginMap.id] = pluginMap;
+ },
+
+ enable: function () {
+ enabledRegistry[this.map.id] = this;
+ this.enabled = true;
+
+ //Set flag mentioning that the module is enabling,
+ //so that immediate calls to the defined callbacks
+ //for dependencies do not trigger inadvertent load
+ //with the depCount still being zero.
+ this.enabling = true;
+
+ //Enable each dependency
+ each(this.depMaps, bind(this, function (depMap, i) {
+ var id, mod, handler;
+
+ if (typeof depMap === 'string') {
+ //Dependency needs to be converted to a depMap
+ //and wired up to this module.
+ depMap = makeModuleMap(depMap,
+ (this.map.isDefine ? this.map : this.map.parentMap),
+ false,
+ !this.skipMap);
+ this.depMaps[i] = depMap;
+
+ handler = getOwn(handlers, depMap.id);
+
+ if (handler) {
+ this.depExports[i] = handler(this);
+ return;
+ }
+
+ this.depCount += 1;
+
+ on(depMap, 'defined', bind(this, function (depExports) {
+ this.defineDep(i, depExports);
+ this.check();
+ }));
+
+ if (this.errback) {
+ on(depMap, 'error', bind(this, this.errback));
+ }
+ }
+
+ id = depMap.id;
+ mod = registry[id];
+
+ //Skip special modules like 'require', 'exports', 'module'
+ //Also, don't call enable if it is already enabled,
+ //important in circular dependency cases.
+ if (!hasProp(handlers, id) && mod && !mod.enabled) {
+ context.enable(depMap, this);
+ }
+ }));
+
+ //Enable each plugin that is used in
+ //a dependency
+ eachProp(this.pluginMaps, bind(this, function (pluginMap) {
+ var mod = getOwn(registry, pluginMap.id);
+ if (mod && !mod.enabled) {
+ context.enable(pluginMap, this);
+ }
+ }));
+
+ this.enabling = false;
+
+ this.check();
+ },
+
+ on: function (name, cb) {
+ var cbs = this.events[name];
+ if (!cbs) {
+ cbs = this.events[name] = [];
+ }
+ cbs.push(cb);
+ },
+
+ emit: function (name, evt) {
+ each(this.events[name], function (cb) {
+ cb(evt);
+ });
+ if (name === 'error') {
+ //Now that the error handler was triggered, remove
+ //the listeners, since this broken Module instance
+ //can stay around for a while in the registry.
+ delete this.events[name];
+ }
+ }
+ };
+
+ function callGetModule(args) {
+ //Skip modules already defined.
+ if (!hasProp(defined, args[0])) {
+ getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]);
+ }
+ }
+
+ function removeListener(node, func, name, ieName) {
+ //Favor detachEvent because of IE9
+ //issue, see attachEvent/addEventListener comment elsewhere
+ //in this file.
+ if (node.detachEvent && !isOpera) {
+ //Probably IE. If not it will throw an error, which will be
+ //useful to know.
+ if (ieName) {
+ node.detachEvent(ieName, func);
+ }
+ } else {
+ node.removeEventListener(name, func, false);
+ }
+ }
+
+ /**
+ * Given an event from a script node, get the requirejs info from it,
+ * and then removes the event listeners on the node.
+ * @param {Event} evt
+ * @returns {Object}
+ */
+ function getScriptData(evt) {
+ //Using currentTarget instead of target for Firefox 2.0's sake. Not
+ //all old browsers will be supported, but this one was easy enough
+ //to support and still makes sense.
+ var node = evt.currentTarget || evt.srcElement;
+
+ //Remove the listeners once here.
+ removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange');
+ removeListener(node, context.onScriptError, 'error');
+
+ return {
+ node: node,
+ id: node && node.getAttribute('data-requiremodule')
+ };
+ }
+
+ function intakeDefines() {
+ var args;
+
+ //Any defined modules in the global queue, intake them now.
+ takeGlobalQueue();
+
+ //Make sure any remaining defQueue items get properly processed.
+ while (defQueue.length) {
+ args = defQueue.shift();
+ if (args[0] === null) {
+ return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1]));
+ } else {
+ //args are id, deps, factory. Should be normalized by the
+ //define() function.
+ callGetModule(args);
+ }
+ }
+ }
+
+ context = {
+ config: config,
+ contextName: contextName,
+ registry: registry,
+ defined: defined,
+ urlFetched: urlFetched,
+ defQueue: defQueue,
+ Module: Module,
+ makeModuleMap: makeModuleMap,
+ nextTick: req.nextTick,
+ onError: onError,
+
+ /**
+ * Set a configuration for the context.
+ * @param {Object} cfg config object to integrate.
+ */
+ configure: function (cfg) {
+ //Make sure the baseUrl ends in a slash.
+ if (cfg.baseUrl) {
+ if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') {
+ cfg.baseUrl += '/';
+ }
+ }
+
+ //Save off the paths since they require special processing,
+ //they are additive.
+ var shim = config.shim,
+ objs = {
+ paths: true,
+ bundles: true,
+ config: true,
+ map: true
+ };
+
+ eachProp(cfg, function (value, prop) {
+ if (objs[prop]) {
+ if (!config[prop]) {
+ config[prop] = {};
+ }
+ mixin(config[prop], value, true, true);
+ } else {
+ config[prop] = value;
+ }
+ });
+
+ //Reverse map the bundles
+ if (cfg.bundles) {
+ eachProp(cfg.bundles, function (value, prop) {
+ each(value, function (v) {
+ if (v !== prop) {
+ bundlesMap[v] = prop;
+ }
+ });
+ });
+ }
+
+ //Merge shim
+ if (cfg.shim) {
+ eachProp(cfg.shim, function (value, id) {
+ //Normalize the structure
+ if (isArray(value)) {
+ value = {
+ deps: value
+ };
+ }
+ if ((value.exports || value.init) && !value.exportsFn) {
+ value.exportsFn = context.makeShimExports(value);
+ }
+ shim[id] = value;
+ });
+ config.shim = shim;
+ }
+
+ //Adjust packages if necessary.
+ if (cfg.packages) {
+ each(cfg.packages, function (pkgObj) {
+ var location, name;
+
+ pkgObj = typeof pkgObj === 'string' ? { name: pkgObj } : pkgObj;
+
+ name = pkgObj.name;
+ location = pkgObj.location;
+ if (location) {
+ config.paths[name] = pkgObj.location;
+ }
+
+ //Save pointer to main module ID for pkg name.
+ //Remove leading dot in main, so main paths are normalized,
+ //and remove any trailing .js, since different package
+ //envs have different conventions: some use a module name,
+ //some use a file name.
+ config.pkgs[name] = pkgObj.name + '/' + (pkgObj.main || 'main')
+ .replace(currDirRegExp, '')
+ .replace(jsSuffixRegExp, '');
+ });
+ }
+
+ //If there are any "waiting to execute" modules in the registry,
+ //update the maps for them, since their info, like URLs to load,
+ //may have changed.
+ eachProp(registry, function (mod, id) {
+ //If module already has init called, since it is too
+ //late to modify them, and ignore unnormalized ones
+ //since they are transient.
+ if (!mod.inited && !mod.map.unnormalized) {
+ mod.map = makeModuleMap(id);
+ }
+ });
+
+ //If a deps array or a config callback is specified, then call
+ //require with those args. This is useful when require is defined as a
+ //config object before require.js is loaded.
+ if (cfg.deps || cfg.callback) {
+ context.require(cfg.deps || [], cfg.callback);
+ }
+ },
+
+ makeShimExports: function (value) {
+ function fn() {
+ var ret;
+ if (value.init) {
+ ret = value.init.apply(global, arguments);
+ }
+ return ret || (value.exports && getGlobal(value.exports));
+ }
+ return fn;
+ },
+
+ makeRequire: function (relMap, options) {
+ options = options || {};
+
+ function localRequire(deps, callback, errback) {
+ var id, map, requireMod;
+
+ if (options.enableBuildCallback && callback && isFunction(callback)) {
+ callback.__requireJsBuild = true;
+ }
+
+ if (typeof deps === 'string') {
+ if (isFunction(callback)) {
+ //Invalid call
+ return onError(makeError('requireargs', 'Invalid require call'), errback);
+ }
+
+ //If require|exports|module are requested, get the
+ //value for them from the special handlers. Caveat:
+ //this only works while module is being defined.
+ if (relMap && hasProp(handlers, deps)) {
+ return handlers[deps](registry[relMap.id]);
+ }
+
+ //Synchronous access to one module. If require.get is
+ //available (as in the Node adapter), prefer that.
+ if (req.get) {
+ return req.get(context, deps, relMap, localRequire);
+ }
+
+ //Normalize module name, if it contains . or ..
+ map = makeModuleMap(deps, relMap, false, true);
+ id = map.id;
+
+ if (!hasProp(defined, id)) {
+ return onError(makeError('notloaded', 'Module name "' +
+ id +
+ '" has not been loaded yet for context: ' +
+ contextName +
+ (relMap ? '' : '. Use require([])')));
+ }
+ return defined[id];
+ }
+
+ //Grab defines waiting in the global queue.
+ intakeDefines();
+
+ //Mark all the dependencies as needing to be loaded.
+ context.nextTick(function () {
+ //Some defines could have been added since the
+ //require call, collect them.
+ intakeDefines();
+
+ requireMod = getModule(makeModuleMap(null, relMap));
+
+ //Store if map config should be applied to this require
+ //call for dependencies.
+ requireMod.skipMap = options.skipMap;
+
+ requireMod.init(deps, callback, errback, {
+ enabled: true
+ });
+
+ checkLoaded();
+ });
+
+ return localRequire;
+ }
+
+ mixin(localRequire, {
+ isBrowser: isBrowser,
+
+ /**
+ * Converts a module name + .extension into an URL path.
+ * *Requires* the use of a module name. It does not support using
+ * plain URLs like nameToUrl.
+ */
+ toUrl: function (moduleNamePlusExt) {
+ var ext,
+ index = moduleNamePlusExt.lastIndexOf('.'),
+ segment = moduleNamePlusExt.split('/')[0],
+ isRelative = segment === '.' || segment === '..';
+
+ //Have a file extension alias, and it is not the
+ //dots from a relative path.
+ if (index !== -1 && (!isRelative || index > 1)) {
+ ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length);
+ moduleNamePlusExt = moduleNamePlusExt.substring(0, index);
+ }
+
+ return context.nameToUrl(normalize(moduleNamePlusExt,
+ relMap && relMap.id, true), ext, true);
+ },
+
+ defined: function (id) {
+ return hasProp(defined, makeModuleMap(id, relMap, false, true).id);
+ },
+
+ specified: function (id) {
+ id = makeModuleMap(id, relMap, false, true).id;
+ return hasProp(defined, id) || hasProp(registry, id);
+ }
+ });
+
+ //Only allow undef on top level require calls
+ if (!relMap) {
+ localRequire.undef = function (id) {
+ //Bind any waiting define() calls to this context,
+ //fix for #408
+ takeGlobalQueue();
+
+ var map = makeModuleMap(id, relMap, true),
+ mod = getOwn(registry, id);
+
+ removeScript(id);
+
+ delete defined[id];
+ delete urlFetched[map.url];
+ delete undefEvents[id];
+
+ //Clean queued defines too. Go backwards
+ //in array so that the splices do not
+ //mess up the iteration.
+ eachReverse(defQueue, function(args, i) {
+ if(args[0] === id) {
+ defQueue.splice(i, 1);
+ }
+ });
+
+ if (mod) {
+ //Hold on to listeners in case the
+ //module will be attempted to be reloaded
+ //using a different config.
+ if (mod.events.defined) {
+ undefEvents[id] = mod.events;
+ }
+
+ cleanRegistry(id);
+ }
+ };
+ }
+
+ return localRequire;
+ },
+
+ /**
+ * Called to enable a module if it is still in the registry
+ * awaiting enablement. A second arg, parent, the parent module,
+ * is passed in for context, when this method is overridden by
+ * the optimizer. Not shown here to keep code compact.
+ */
+ enable: function (depMap) {
+ var mod = getOwn(registry, depMap.id);
+ if (mod) {
+ getModule(depMap).enable();
+ }
+ },
+
+ /**
+ * Internal method used by environment adapters to complete a load event.
+ * A load event could be a script load or just a load pass from a synchronous
+ * load call.
+ * @param {String} moduleName the name of the module to potentially complete.
+ */
+ completeLoad: function (moduleName) {
+ var found, args, mod,
+ shim = getOwn(config.shim, moduleName) || {},
+ shExports = shim.exports;
+
+ takeGlobalQueue();
+
+ while (defQueue.length) {
+ args = defQueue.shift();
+ if (args[0] === null) {
+ args[0] = moduleName;
+ //If already found an anonymous module and bound it
+ //to this name, then this is some other anon module
+ //waiting for its completeLoad to fire.
+ if (found) {
+ break;
+ }
+ found = true;
+ } else if (args[0] === moduleName) {
+ //Found matching define call for this script!
+ found = true;
+ }
+
+ callGetModule(args);
+ }
+
+ //Do this after the cycle of callGetModule in case the result
+ //of those calls/init calls changes the registry.
+ mod = getOwn(registry, moduleName);
+
+ if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) {
+ if (config.enforceDefine && (!shExports || !getGlobal(shExports))) {
+ if (hasPathFallback(moduleName)) {
+ return;
+ } else {
+ return onError(makeError('nodefine',
+ 'No define call for ' + moduleName,
+ null,
+ [moduleName]));
+ }
+ } else {
+ //A script that does not call define(), so just simulate
+ //the call for it.
+ callGetModule([moduleName, (shim.deps || []), shim.exportsFn]);
+ }
+ }
+
+ checkLoaded();
+ },
+
+ /**
+ * Converts a module name to a file path. Supports cases where
+ * moduleName may actually be just an URL.
+ * Note that it **does not** call normalize on the moduleName,
+ * it is assumed to have already been normalized. This is an
+ * internal API, not a public one. Use toUrl for the public API.
+ */
+ nameToUrl: function (moduleName, ext, skipExt) {
+ var paths, syms, i, parentModule, url,
+ parentPath, bundleId,
+ pkgMain = getOwn(config.pkgs, moduleName);
+
+ if (pkgMain) {
+ moduleName = pkgMain;
+ }
+
+ bundleId = getOwn(bundlesMap, moduleName);
+
+ if (bundleId) {
+ return context.nameToUrl(bundleId, ext, skipExt);
+ }
+
+ //If a colon is in the URL, it indicates a protocol is used and it is just
+ //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?)
+ //or ends with .js, then assume the user meant to use an url and not a module id.
+ //The slash is important for protocol-less URLs as well as full paths.
+ if (req.jsExtRegExp.test(moduleName)) {
+ //Just a plain path, not module name lookup, so just return it.
+ //Add extension if it is included. This is a bit wonky, only non-.js things pass
+ //an extension, this method probably needs to be reworked.
+ url = moduleName + (ext || '');
+ } else {
+ //A module that needs to be converted to a path.
+ paths = config.paths;
+
+ syms = moduleName.split('/');
+ //For each module name segment, see if there is a path
+ //registered for it. Start with most specific name
+ //and work up from it.
+ for (i = syms.length; i > 0; i -= 1) {
+ parentModule = syms.slice(0, i).join('/');
+
+ parentPath = getOwn(paths, parentModule);
+ if (parentPath) {
+ //If an array, it means there are a few choices,
+ //Choose the one that is desired
+ if (isArray(parentPath)) {
+ parentPath = parentPath[0];
+ }
+ syms.splice(0, i, parentPath);
+ break;
+ }
+ }
+
+ //Join the path parts together, then figure out if baseUrl is needed.
+ url = syms.join('/');
+ url += (ext || (/^data\:|\?/.test(url) || skipExt ? '' : '.js'));
+ url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url;
+ }
+
+ return config.urlArgs ? url +
+ ((url.indexOf('?') === -1 ? '?' : '&') +
+ config.urlArgs) : url;
+ },
+
+ //Delegates to req.load. Broken out as a separate function to
+ //allow overriding in the optimizer.
+ load: function (id, url) {
+ req.load(context, id, url);
+ },
+
+ /**
+ * Executes a module callback function. Broken out as a separate function
+ * solely to allow the build system to sequence the files in the built
+ * layer in the right sequence.
+ *
+ * @private
+ */
+ execCb: function (name, callback, args, exports) {
+ return callback.apply(exports, args);
+ },
+
+ /**
+ * callback for script loads, used to check status of loading.
+ *
+ * @param {Event} evt the event from the browser for the script
+ * that was loaded.
+ */
+ onScriptLoad: function (evt) {
+ //Using currentTarget instead of target for Firefox 2.0's sake. Not
+ //all old browsers will be supported, but this one was easy enough
+ //to support and still makes sense.
+ if (evt.type === 'load' ||
+ (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) {
+ //Reset interactive script so a script node is not held onto for
+ //to long.
+ interactiveScript = null;
+
+ //Pull out the name of the module and the context.
+ var data = getScriptData(evt);
+ context.completeLoad(data.id);
+ }
+ },
+
+ /**
+ * Callback for script errors.
+ */
+ onScriptError: function (evt) {
+ var data = getScriptData(evt);
+ if (!hasPathFallback(data.id)) {
+ return onError(makeError('scripterror', 'Script error for: ' + data.id, evt, [data.id]));
+ }
+ }
+ };
+
+ context.require = context.makeRequire();
+ return context;
+ }
+
+ /**
+ * Main entry point.
+ *
+ * If the only argument to require is a string, then the module that
+ * is represented by that string is fetched for the appropriate context.
+ *
+ * If the first argument is an array, then it will be treated as an array
+ * of dependency string names to fetch. An optional function callback can
+ * be specified to execute when all of those dependencies are available.
+ *
+ * Make a local req variable to help Caja compliance (it assumes things
+ * on a require that are not standardized), and to give a short
+ * name for minification/local scope use.
+ */
+ req = requirejs = function (deps, callback, errback, optional) {
+
+ //Find the right context, use default
+ var context, config,
+ contextName = defContextName;
+
+ // Determine if have config object in the call.
+ if (!isArray(deps) && typeof deps !== 'string') {
+ // deps is a config object
+ config = deps;
+ if (isArray(callback)) {
+ // Adjust args if there are dependencies
+ deps = callback;
+ callback = errback;
+ errback = optional;
+ } else {
+ deps = [];
+ }
+ }
+
+ if (config && config.context) {
+ contextName = config.context;
+ }
+
+ context = getOwn(contexts, contextName);
+ if (!context) {
+ context = contexts[contextName] = req.s.newContext(contextName);
+ }
+
+ if (config) {
+ context.configure(config);
+ }
+
+ return context.require(deps, callback, errback);
+ };
+
+ /**
+ * Support require.config() to make it easier to cooperate with other
+ * AMD loaders on globally agreed names.
+ */
+ req.config = function (config) {
+ return req(config);
+ };
+
+ /**
+ * Execute something after the current tick
+ * of the event loop. Override for other envs
+ * that have a better solution than setTimeout.
+ * @param {Function} fn function to execute later.
+ */
+ req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) {
+ setTimeout(fn, 4);
+ } : function (fn) { fn(); };
+
+ /**
+ * Export require as a global, but only if it does not already exist.
+ */
+ if (!require) {
+ require = req;
+ }
+
+ req.version = version;
+
+ //Used to filter out dependencies that are already paths.
+ req.jsExtRegExp = /^\/|:|\?|\.js$/;
+ req.isBrowser = isBrowser;
+ s = req.s = {
+ contexts: contexts,
+ newContext: newContext
+ };
+
+ //Create default context.
+ req({});
+
+ //Exports some context-sensitive methods on global require.
+ each([
+ 'toUrl',
+ 'undef',
+ 'defined',
+ 'specified'
+ ], function (prop) {
+ //Reference from contexts instead of early binding to default context,
+ //so that during builds, the latest instance of the default context
+ //with its config gets used.
+ req[prop] = function () {
+ var ctx = contexts[defContextName];
+ return ctx.require[prop].apply(ctx, arguments);
+ };
+ });
+
+ if (isBrowser) {
+ head = s.head = document.getElementsByTagName('head')[0];
+ //If BASE tag is in play, using appendChild is a problem for IE6.
+ //When that browser dies, this can be removed. Details in this jQuery bug:
+ //http://dev.jquery.com/ticket/2709
+ baseElement = document.getElementsByTagName('base')[0];
+ if (baseElement) {
+ head = s.head = baseElement.parentNode;
+ }
+ }
+
+ /**
+ * Any errors that require explicitly generates will be passed to this
+ * function. Intercept/override it if you want custom error handling.
+ * @param {Error} err the error object.
+ */
+ req.onError = defaultOnError;
+
+ /**
+ * Creates the node for the load command. Only used in browser envs.
+ */
+ req.createNode = function (config, moduleName, url) {
+ var node = config.xhtml ?
+ document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') :
+ document.createElement('script');
+ node.type = config.scriptType || 'text/javascript';
+ node.charset = 'utf-8';
+ node.async = true;
+ return node;
+ };
+
+ /**
+ * Does the request to load a module for the browser case.
+ * Make this a separate function to allow other environments
+ * to override it.
+ *
+ * @param {Object} context the require context to find state.
+ * @param {String} moduleName the name of the module.
+ * @param {Object} url the URL to the module.
+ */
+ req.load = function (context, moduleName, url) {
+ var config = (context && context.config) || {},
+ node;
+ if (isBrowser) {
+ //In the browser so use a script tag
+ node = req.createNode(config, moduleName, url);
+
+ node.setAttribute('data-requirecontext', context.contextName);
+ node.setAttribute('data-requiremodule', moduleName);
+
+ //Set up load listener. Test attachEvent first because IE9 has
+ //a subtle issue in its addEventListener and script onload firings
+ //that do not match the behavior of all other browsers with
+ //addEventListener support, which fire the onload event for a
+ //script right after the script execution. See:
+ //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution
+ //UNFORTUNATELY Opera implements attachEvent but does not follow the script
+ //script execution mode.
+ if (node.attachEvent &&
+ //Check if node.attachEvent is artificially added by custom script or
+ //natively supported by browser
+ //read https://github.com/jrburke/requirejs/issues/187
+ //if we can NOT find [native code] then it must NOT natively supported.
+ //in IE8, node.attachEvent does not have toString()
+ //Note the test for "[native code" with no closing brace, see:
+ //https://github.com/jrburke/requirejs/issues/273
+ !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) &&
+ !isOpera) {
+ //Probably IE. IE (at least 6-8) do not fire
+ //script onload right after executing the script, so
+ //we cannot tie the anonymous define call to a name.
+ //However, IE reports the script as being in 'interactive'
+ //readyState at the time of the define call.
+ useInteractive = true;
+
+ node.attachEvent('onreadystatechange', context.onScriptLoad);
+ //It would be great to add an error handler here to catch
+ //404s in IE9+. However, onreadystatechange will fire before
+ //the error handler, so that does not help. If addEventListener
+ //is used, then IE will fire error before load, but we cannot
+ //use that pathway given the connect.microsoft.com issue
+ //mentioned above about not doing the 'script execute,
+ //then fire the script load event listener before execute
+ //next script' that other browsers do.
+ //Best hope: IE10 fixes the issues,
+ //and then destroys all installs of IE 6-9.
+ //node.attachEvent('onerror', context.onScriptError);
+ } else {
+ node.addEventListener('load', context.onScriptLoad, false);
+ node.addEventListener('error', context.onScriptError, false);
+ }
+ node.src = url;
+
+ //For some cache cases in IE 6-8, the script executes before the end
+ //of the appendChild execution, so to tie an anonymous define
+ //call to the module name (which is stored on the node), hold on
+ //to a reference to this node, but clear after the DOM insertion.
+ currentlyAddingScript = node;
+ if (baseElement) {
+ head.insertBefore(node, baseElement);
+ } else {
+ head.appendChild(node);
+ }
+ currentlyAddingScript = null;
+
+ return node;
+ } else if (isWebWorker) {
+ try {
+ //In a web worker, use importScripts. This is not a very
+ //efficient use of importScripts, importScripts will block until
+ //its script is downloaded and evaluated. However, if web workers
+ //are in play, the expectation that a build has been done so that
+ //only one script needs to be loaded anyway. This may need to be
+ //reevaluated if other use cases become common.
+ importScripts(url);
+
+ //Account for anonymous modules
+ context.completeLoad(moduleName);
+ } catch (e) {
+ context.onError(makeError('importscripts',
+ 'importScripts failed for ' +
+ moduleName + ' at ' + url,
+ e,
+ [moduleName]));
+ }
+ }
+ };
+
+ function getInteractiveScript() {
+ if (interactiveScript && interactiveScript.readyState === 'interactive') {
+ return interactiveScript;
+ }
+
+ eachReverse(scripts(), function (script) {
+ if (script.readyState === 'interactive') {
+ return (interactiveScript = script);
+ }
+ });
+ return interactiveScript;
+ }
+
+ //Look for a data-main script attribute, which could also adjust the baseUrl.
+ if (isBrowser && !cfg.skipDataMain) {
+ //Figure out baseUrl. Get it from the script tag with require.js in it.
+ eachReverse(scripts(), function (script) {
+ //Set the 'head' where we can append children by
+ //using the script's parent.
+ if (!head) {
+ head = script.parentNode;
+ }
+
+ //Look for a data-main attribute to set main script for the page
+ //to load. If it is there, the path to data main becomes the
+ //baseUrl, if it is not already set.
+ dataMain = script.getAttribute('data-main');
+ if (dataMain) {
+ //Preserve dataMain in case it is a path (i.e. contains '?')
+ mainScript = dataMain;
+
+ //Set final baseUrl if there is not already an explicit one.
+ if (!cfg.baseUrl) {
+ //Pull off the directory of data-main for use as the
+ //baseUrl.
+ src = mainScript.split('/');
+ mainScript = src.pop();
+ subPath = src.length ? src.join('/') + '/' : './';
+
+ cfg.baseUrl = subPath;
+ }
+
+ //Strip off any trailing .js since mainScript is now
+ //like a module name.
+ mainScript = mainScript.replace(jsSuffixRegExp, '');
+
+ //If mainScript is still a path, fall back to dataMain
+ if (req.jsExtRegExp.test(mainScript)) {
+ mainScript = dataMain;
+ }
+
+ //Put the data-main script in the files to load.
+ cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript];
+
+ return true;
+ }
+ });
+ }
+
+ /**
+ * The function that handles definitions of modules. Differs from
+ * require() in that a string for the module should be the first argument,
+ * and the function to execute after dependencies are loaded should
+ * return a value to define the module corresponding to the first argument's
+ * name.
+ */
+ define = function (name, deps, callback) {
+ var node, context;
+
+ //Allow for anonymous modules
+ if (typeof name !== 'string') {
+ //Adjust args appropriately
+ callback = deps;
+ deps = name;
+ name = null;
+ }
+
+ //This module may not have dependencies
+ if (!isArray(deps)) {
+ callback = deps;
+ deps = null;
+ }
+
+ //If no name, and callback is a function, then figure out if it a
+ //CommonJS thing with dependencies.
+ if (!deps && isFunction(callback)) {
+ deps = [];
+ //Remove comments from the callback string,
+ //look for require calls, and pull them into the dependencies,
+ //but only if there are function args.
+ if (callback.length) {
+ callback
+ .toString()
+ .replace(commentRegExp, '')
+ .replace(cjsRequireRegExp, function (match, dep) {
+ deps.push(dep);
+ });
+
+ //May be a CommonJS thing even without require calls, but still
+ //could use exports, and module. Avoid doing exports and module
+ //work though if it just needs require.
+ //REQUIRES the function to expect the CommonJS variables in the
+ //order listed below.
+ deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps);
+ }
+ }
+
+ //If in IE 6-8 and hit an anonymous define() call, do the interactive
+ //work.
+ if (useInteractive) {
+ node = currentlyAddingScript || getInteractiveScript();
+ if (node) {
+ if (!name) {
+ name = node.getAttribute('data-requiremodule');
+ }
+ context = contexts[node.getAttribute('data-requirecontext')];
+ }
+ }
+
+ //Always save off evaluating the def call until the script onload handler.
+ //This allows multiple modules to be in a file without prematurely
+ //tracing dependencies, and allows for anonymous module support,
+ //where the module name is not known until the script onload event
+ //occurs. If no context, use the global queue, and get it processed
+ //in the onscript load callback.
+ (context ? context.defQueue : globalDefQueue).push([name, deps, callback]);
+ };
+
+ define.amd = {
+ jQuery: true
+ };
+
+
+ /**
+ * Executes the text. Normally just uses eval, but can be modified
+ * to use a better, environment-specific call. Only used for transpiling
+ * loader plugins, not for plain JS modules.
+ * @param {String} text the text to execute/evaluate.
+ */
+ req.exec = function (text) {
+ /*jslint evil: true */
+ return eval(text);
+ };
+
+ //Set up with config info.
+ req(cfg);
+}(this));
diff --git a/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/contrib/underscore.js b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/contrib/underscore.js
new file mode 100644
index 00000000..46b2ac67
--- /dev/null
+++ b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/common/contrib/underscore.js
@@ -0,0 +1,2034 @@
+(function () {
+ // Underscore.js 1.13.6
+ // https://underscorejs.org
+ // (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors
+ // Underscore may be freely distributed under the MIT license.
+
+ // Current version.
+ var VERSION = '1.13.6';
+
+ // Establish the root object, `window` (`self`) in the browser, `global`
+ // on the server, or `this` in some virtual machines. We use `self`
+ // instead of `window` for `WebWorker` support.
+ var root = (typeof self == 'object' && self.self === self && self) ||
+ (typeof global == 'object' && global.global === global && global) ||
+ Function('return this')() ||
+ {};
+
+ // Save bytes in the minified (but not gzipped) version:
+ var ArrayProto = Array.prototype, ObjProto = Object.prototype;
+ var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;
+
+ // Create quick reference variables for speed access to core prototypes.
+ var push = ArrayProto.push,
+ slice = ArrayProto.slice,
+ toString = ObjProto.toString,
+ hasOwnProperty = ObjProto.hasOwnProperty;
+
+ // Modern feature detection.
+ var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined',
+ supportsDataView = typeof DataView !== 'undefined';
+
+ // All **ECMAScript 5+** native function implementations that we hope to use
+ // are declared here.
+ var nativeIsArray = Array.isArray,
+ nativeKeys = Object.keys,
+ nativeCreate = Object.create,
+ nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;
+
+ // Create references to these builtin functions because we override them.
+ var _isNaN = isNaN,
+ _isFinite = isFinite;
+
+ // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
+ var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
+ var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
+ 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
+
+ // The largest integer that can be represented exactly.
+ var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
+
+ // Some functions take a variable number of arguments, or a few expected
+ // arguments at the beginning and then a variable number of values to operate
+ // on. This helper accumulates all remaining arguments past the function’s
+ // argument length (or an explicit `startIndex`), into an array that becomes
+ // the last argument. Similar to ES6’s "rest parameter".
+ function restArguments(func, startIndex) {
+ startIndex = startIndex == null ? func.length - 1 : +startIndex;
+ return function() {
+ var length = Math.max(arguments.length - startIndex, 0),
+ rest = Array(length),
+ index = 0;
+ for (; index < length; index++) {
+ rest[index] = arguments[index + startIndex];
+ }
+ switch (startIndex) {
+ case 0: return func.call(this, rest);
+ case 1: return func.call(this, arguments[0], rest);
+ case 2: return func.call(this, arguments[0], arguments[1], rest);
+ }
+ var args = Array(startIndex + 1);
+ for (index = 0; index < startIndex; index++) {
+ args[index] = arguments[index];
+ }
+ args[startIndex] = rest;
+ return func.apply(this, args);
+ };
+ }
+
+ // Is a given variable an object?
+ function isObject(obj) {
+ var type = typeof obj;
+ return type === 'function' || (type === 'object' && !!obj);
+ }
+
+ // Is a given value equal to null?
+ function isNull(obj) {
+ return obj === null;
+ }
+
+ // Is a given variable undefined?
+ function isUndefined(obj) {
+ return obj === void 0;
+ }
+
+ // Is a given value a boolean?
+ function isBoolean(obj) {
+ return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
+ }
+
+ // Is a given value a DOM element?
+ function isElement(obj) {
+ return !!(obj && obj.nodeType === 1);
+ }
+
+ // Internal function for creating a `toString`-based type tester.
+ function tagTester(name) {
+ var tag = '[object ' + name + ']';
+ return function(obj) {
+ return toString.call(obj) === tag;
+ };
+ }
+
+ var isString = tagTester('String');
+
+ var isNumber = tagTester('Number');
+
+ var isDate = tagTester('Date');
+
+ var isRegExp = tagTester('RegExp');
+
+ var isError = tagTester('Error');
+
+ var isSymbol = tagTester('Symbol');
+
+ var isArrayBuffer = tagTester('ArrayBuffer');
+
+ var isFunction = tagTester('Function');
+
+ // Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old
+ // v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).
+ var nodelist = root.document && root.document.childNodes;
+ if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {
+ isFunction = function(obj) {
+ return typeof obj == 'function' || false;
+ };
+ }
+
+ var isFunction$1 = isFunction;
+
+ var hasObjectTag = tagTester('Object');
+
+ // In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`.
+ // In IE 11, the most common among them, this problem also applies to
+ // `Map`, `WeakMap` and `Set`.
+ var hasStringTagBug = (
+ supportsDataView && hasObjectTag(new DataView(new ArrayBuffer(8)))
+ ),
+ isIE11 = (typeof Map !== 'undefined' && hasObjectTag(new Map));
+
+ var isDataView = tagTester('DataView');
+
+ // In IE 10 - Edge 13, we need a different heuristic
+ // to determine whether an object is a `DataView`.
+ function ie10IsDataView(obj) {
+ return obj != null && isFunction$1(obj.getInt8) && isArrayBuffer(obj.buffer);
+ }
+
+ var isDataView$1 = (hasStringTagBug ? ie10IsDataView : isDataView);
+
+ // Is a given value an array?
+ // Delegates to ECMA5's native `Array.isArray`.
+ var isArray = nativeIsArray || tagTester('Array');
+
+ // Internal function to check whether `key` is an own property name of `obj`.
+ function has$1(obj, key) {
+ return obj != null && hasOwnProperty.call(obj, key);
+ }
+
+ var isArguments = tagTester('Arguments');
+
+ // Define a fallback version of the method in browsers (ahem, IE < 9), where
+ // there isn't any inspectable "Arguments" type.
+ (function() {
+ if (!isArguments(arguments)) {
+ isArguments = function(obj) {
+ return has$1(obj, 'callee');
+ };
+ }
+ }());
+
+ var isArguments$1 = isArguments;
+
+ // Is a given object a finite number?
+ function isFinite$1(obj) {
+ return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj));
+ }
+
+ // Is the given value `NaN`?
+ function isNaN$1(obj) {
+ return isNumber(obj) && _isNaN(obj);
+ }
+
+ // Predicate-generating function. Often useful outside of Underscore.
+ function constant(value) {
+ return function() {
+ return value;
+ };
+ }
+
+ // Common internal logic for `isArrayLike` and `isBufferLike`.
+ function createSizePropertyCheck(getSizeProperty) {
+ return function(collection) {
+ var sizeProperty = getSizeProperty(collection);
+ return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX;
+ }
+ }
+
+ // Internal helper to generate a function to obtain property `key` from `obj`.
+ function shallowProperty(key) {
+ return function(obj) {
+ return obj == null ? void 0 : obj[key];
+ };
+ }
+
+ // Internal helper to obtain the `byteLength` property of an object.
+ var getByteLength = shallowProperty('byteLength');
+
+ // Internal helper to determine whether we should spend extensive checks against
+ // `ArrayBuffer` et al.
+ var isBufferLike = createSizePropertyCheck(getByteLength);
+
+ // Is a given value a typed array?
+ var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
+ function isTypedArray(obj) {
+ // `ArrayBuffer.isView` is the most future-proof, so use it when available.
+ // Otherwise, fall back on the above regular expression.
+ return nativeIsView ? (nativeIsView(obj) && !isDataView$1(obj)) :
+ isBufferLike(obj) && typedArrayPattern.test(toString.call(obj));
+ }
+
+ var isTypedArray$1 = supportsArrayBuffer ? isTypedArray : constant(false);
+
+ // Internal helper to obtain the `length` property of an object.
+ var getLength = shallowProperty('length');
+
+ // Internal helper to create a simple lookup structure.
+ // `collectNonEnumProps` used to depend on `_.contains`, but this led to
+ // circular imports. `emulatedSet` is a one-off solution that only works for
+ // arrays of strings.
+ function emulatedSet(keys) {
+ var hash = {};
+ for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;
+ return {
+ contains: function(key) { return hash[key] === true; },
+ push: function(key) {
+ hash[key] = true;
+ return keys.push(key);
+ }
+ };
+ }
+
+ // Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't
+ // be iterated by `for key in ...` and thus missed. Extends `keys` in place if
+ // needed.
+ function collectNonEnumProps(obj, keys) {
+ keys = emulatedSet(keys);
+ var nonEnumIdx = nonEnumerableProps.length;
+ var constructor = obj.constructor;
+ var proto = (isFunction$1(constructor) && constructor.prototype) || ObjProto;
+
+ // Constructor is a special case.
+ var prop = 'constructor';
+ if (has$1(obj, prop) && !keys.contains(prop)) keys.push(prop);
+
+ while (nonEnumIdx--) {
+ prop = nonEnumerableProps[nonEnumIdx];
+ if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {
+ keys.push(prop);
+ }
+ }
+ }
+
+ // Retrieve the names of an object's own properties.
+ // Delegates to **ECMAScript 5**'s native `Object.keys`.
+ function keys(obj) {
+ if (!isObject(obj)) return [];
+ if (nativeKeys) return nativeKeys(obj);
+ var keys = [];
+ for (var key in obj) if (has$1(obj, key)) keys.push(key);
+ // Ahem, IE < 9.
+ if (hasEnumBug) collectNonEnumProps(obj, keys);
+ return keys;
+ }
+
+ // Is a given array, string, or object empty?
+ // An "empty" object has no enumerable own-properties.
+ function isEmpty(obj) {
+ if (obj == null) return true;
+ // Skip the more expensive `toString`-based type checks if `obj` has no
+ // `.length`.
+ var length = getLength(obj);
+ if (typeof length == 'number' && (
+ isArray(obj) || isString(obj) || isArguments$1(obj)
+ )) return length === 0;
+ return getLength(keys(obj)) === 0;
+ }
+
+ // Returns whether an object has a given set of `key:value` pairs.
+ function isMatch(object, attrs) {
+ var _keys = keys(attrs), length = _keys.length;
+ if (object == null) return !length;
+ var obj = Object(object);
+ for (var i = 0; i < length; i++) {
+ var key = _keys[i];
+ if (attrs[key] !== obj[key] || !(key in obj)) return false;
+ }
+ return true;
+ }
+
+ // If Underscore is called as a function, it returns a wrapped object that can
+ // be used OO-style. This wrapper holds altered versions of all functions added
+ // through `_.mixin`. Wrapped objects may be chained.
+ function _$1(obj) {
+ if (obj instanceof _$1) return obj;
+ if (!(this instanceof _$1)) return new _$1(obj);
+ this._wrapped = obj;
+ }
+
+ _$1.VERSION = VERSION;
+
+ // Extracts the result from a wrapped and chained object.
+ _$1.prototype.value = function() {
+ return this._wrapped;
+ };
+
+ // Provide unwrapping proxies for some methods used in engine operations
+ // such as arithmetic and JSON stringification.
+ _$1.prototype.valueOf = _$1.prototype.toJSON = _$1.prototype.value;
+
+ _$1.prototype.toString = function() {
+ return String(this._wrapped);
+ };
+
+ // Internal function to wrap or shallow-copy an ArrayBuffer,
+ // typed array or DataView to a new view, reusing the buffer.
+ function toBufferView(bufferSource) {
+ return new Uint8Array(
+ bufferSource.buffer || bufferSource,
+ bufferSource.byteOffset || 0,
+ getByteLength(bufferSource)
+ );
+ }
+
+ // We use this string twice, so give it a name for minification.
+ var tagDataView = '[object DataView]';
+
+ // Internal recursive comparison function for `_.isEqual`.
+ function eq(a, b, aStack, bStack) {
+ // Identical objects are equal. `0 === -0`, but they aren't identical.
+ // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal).
+ if (a === b) return a !== 0 || 1 / a === 1 / b;
+ // `null` or `undefined` only equal to itself (strict comparison).
+ if (a == null || b == null) return false;
+ // `NaN`s are equivalent, but non-reflexive.
+ if (a !== a) return b !== b;
+ // Exhaust primitive checks
+ var type = typeof a;
+ if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;
+ return deepEq(a, b, aStack, bStack);
+ }
+
+ // Internal recursive comparison function for `_.isEqual`.
+ function deepEq(a, b, aStack, bStack) {
+ // Unwrap any wrapped objects.
+ if (a instanceof _$1) a = a._wrapped;
+ if (b instanceof _$1) b = b._wrapped;
+ // Compare `[[Class]]` names.
+ var className = toString.call(a);
+ if (className !== toString.call(b)) return false;
+ // Work around a bug in IE 10 - Edge 13.
+ if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) {
+ if (!isDataView$1(b)) return false;
+ className = tagDataView;
+ }
+ switch (className) {
+ // These types are compared by value.
+ case '[object RegExp]':
+ // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
+ case '[object String]':
+ // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
+ // equivalent to `new String("5")`.
+ return '' + a === '' + b;
+ case '[object Number]':
+ // `NaN`s are equivalent, but non-reflexive.
+ // Object(NaN) is equivalent to NaN.
+ if (+a !== +a) return +b !== +b;
+ // An `egal` comparison is performed for other numeric values.
+ return +a === 0 ? 1 / +a === 1 / b : +a === +b;
+ case '[object Date]':
+ case '[object Boolean]':
+ // Coerce dates and booleans to numeric primitive values. Dates are compared by their
+ // millisecond representations. Note that invalid dates with millisecond representations
+ // of `NaN` are not equivalent.
+ return +a === +b;
+ case '[object Symbol]':
+ return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);
+ case '[object ArrayBuffer]':
+ case tagDataView:
+ // Coerce to typed array so we can fall through.
+ return deepEq(toBufferView(a), toBufferView(b), aStack, bStack);
+ }
+
+ var areArrays = className === '[object Array]';
+ if (!areArrays && isTypedArray$1(a)) {
+ var byteLength = getByteLength(a);
+ if (byteLength !== getByteLength(b)) return false;
+ if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;
+ areArrays = true;
+ }
+ if (!areArrays) {
+ if (typeof a != 'object' || typeof b != 'object') return false;
+
+ // Objects with different constructors are not equivalent, but `Object`s or `Array`s
+ // from different frames are.
+ var aCtor = a.constructor, bCtor = b.constructor;
+ if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor &&
+ isFunction$1(bCtor) && bCtor instanceof bCtor)
+ && ('constructor' in a && 'constructor' in b)) {
+ return false;
+ }
+ }
+ // Assume equality for cyclic structures. The algorithm for detecting cyclic
+ // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
+
+ // Initializing stack of traversed objects.
+ // It's done here since we only need them for objects and arrays comparison.
+ aStack = aStack || [];
+ bStack = bStack || [];
+ var length = aStack.length;
+ while (length--) {
+ // Linear search. Performance is inversely proportional to the number of
+ // unique nested structures.
+ if (aStack[length] === a) return bStack[length] === b;
+ }
+
+ // Add the first object to the stack of traversed objects.
+ aStack.push(a);
+ bStack.push(b);
+
+ // Recursively compare objects and arrays.
+ if (areArrays) {
+ // Compare array lengths to determine if a deep comparison is necessary.
+ length = a.length;
+ if (length !== b.length) return false;
+ // Deep compare the contents, ignoring non-numeric properties.
+ while (length--) {
+ if (!eq(a[length], b[length], aStack, bStack)) return false;
+ }
+ } else {
+ // Deep compare objects.
+ var _keys = keys(a), key;
+ length = _keys.length;
+ // Ensure that both objects contain the same number of properties before comparing deep equality.
+ if (keys(b).length !== length) return false;
+ while (length--) {
+ // Deep compare each member
+ key = _keys[length];
+ if (!(has$1(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
+ }
+ }
+ // Remove the first object from the stack of traversed objects.
+ aStack.pop();
+ bStack.pop();
+ return true;
+ }
+
+ // Perform a deep comparison to check if two objects are equal.
+ function isEqual(a, b) {
+ return eq(a, b);
+ }
+
+ // Retrieve all the enumerable property names of an object.
+ function allKeys(obj) {
+ if (!isObject(obj)) return [];
+ var keys = [];
+ for (var key in obj) keys.push(key);
+ // Ahem, IE < 9.
+ if (hasEnumBug) collectNonEnumProps(obj, keys);
+ return keys;
+ }
+
+ // Since the regular `Object.prototype.toString` type tests don't work for
+ // some types in IE 11, we use a fingerprinting heuristic instead, based
+ // on the methods. It's not great, but it's the best we got.
+ // The fingerprint method lists are defined below.
+ function ie11fingerprint(methods) {
+ var length = getLength(methods);
+ return function(obj) {
+ if (obj == null) return false;
+ // `Map`, `WeakMap` and `Set` have no enumerable keys.
+ var keys = allKeys(obj);
+ if (getLength(keys)) return false;
+ for (var i = 0; i < length; i++) {
+ if (!isFunction$1(obj[methods[i]])) return false;
+ }
+ // If we are testing against `WeakMap`, we need to ensure that
+ // `obj` doesn't have a `forEach` method in order to distinguish
+ // it from a regular `Map`.
+ return methods !== weakMapMethods || !isFunction$1(obj[forEachName]);
+ };
+ }
+
+ // In the interest of compact minification, we write
+ // each string in the fingerprints only once.
+ var forEachName = 'forEach',
+ hasName = 'has',
+ commonInit = ['clear', 'delete'],
+ mapTail = ['get', hasName, 'set'];
+
+ // `Map`, `WeakMap` and `Set` each have slightly different
+ // combinations of the above sublists.
+ var mapMethods = commonInit.concat(forEachName, mapTail),
+ weakMapMethods = commonInit.concat(mapTail),
+ setMethods = ['add'].concat(commonInit, forEachName, hasName);
+
+ var isMap = isIE11 ? ie11fingerprint(mapMethods) : tagTester('Map');
+
+ var isWeakMap = isIE11 ? ie11fingerprint(weakMapMethods) : tagTester('WeakMap');
+
+ var isSet = isIE11 ? ie11fingerprint(setMethods) : tagTester('Set');
+
+ var isWeakSet = tagTester('WeakSet');
+
+ // Retrieve the values of an object's properties.
+ function values(obj) {
+ var _keys = keys(obj);
+ var length = _keys.length;
+ var values = Array(length);
+ for (var i = 0; i < length; i++) {
+ values[i] = obj[_keys[i]];
+ }
+ return values;
+ }
+
+ // Convert an object into a list of `[key, value]` pairs.
+ // The opposite of `_.object` with one argument.
+ function pairs(obj) {
+ var _keys = keys(obj);
+ var length = _keys.length;
+ var pairs = Array(length);
+ for (var i = 0; i < length; i++) {
+ pairs[i] = [_keys[i], obj[_keys[i]]];
+ }
+ return pairs;
+ }
+
+ // Invert the keys and values of an object. The values must be serializable.
+ function invert(obj) {
+ var result = {};
+ var _keys = keys(obj);
+ for (var i = 0, length = _keys.length; i < length; i++) {
+ result[obj[_keys[i]]] = _keys[i];
+ }
+ return result;
+ }
+
+ // Return a sorted list of the function names available on the object.
+ function functions(obj) {
+ var names = [];
+ for (var key in obj) {
+ if (isFunction$1(obj[key])) names.push(key);
+ }
+ return names.sort();
+ }
+
+ // An internal function for creating assigner functions.
+ function createAssigner(keysFunc, defaults) {
+ return function(obj) {
+ var length = arguments.length;
+ if (defaults) obj = Object(obj);
+ if (length < 2 || obj == null) return obj;
+ for (var index = 1; index < length; index++) {
+ var source = arguments[index],
+ keys = keysFunc(source),
+ l = keys.length;
+ for (var i = 0; i < l; i++) {
+ var key = keys[i];
+ if (!defaults || obj[key] === void 0) obj[key] = source[key];
+ }
+ }
+ return obj;
+ };
+ }
+
+ // Extend a given object with all the properties in passed-in object(s).
+ var extend = createAssigner(allKeys);
+
+ // Assigns a given object with all the own properties in the passed-in
+ // object(s).
+ // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
+ var extendOwn = createAssigner(keys);
+
+ // Fill in a given object with default properties.
+ var defaults = createAssigner(allKeys, true);
+
+ // Create a naked function reference for surrogate-prototype-swapping.
+ function ctor() {
+ return function(){};
+ }
+
+ // An internal function for creating a new object that inherits from another.
+ function baseCreate(prototype) {
+ if (!isObject(prototype)) return {};
+ if (nativeCreate) return nativeCreate(prototype);
+ var Ctor = ctor();
+ Ctor.prototype = prototype;
+ var result = new Ctor;
+ Ctor.prototype = null;
+ return result;
+ }
+
+ // Creates an object that inherits from the given prototype object.
+ // If additional properties are provided then they will be added to the
+ // created object.
+ function create(prototype, props) {
+ var result = baseCreate(prototype);
+ if (props) extendOwn(result, props);
+ return result;
+ }
+
+ // Create a (shallow-cloned) duplicate of an object.
+ function clone(obj) {
+ if (!isObject(obj)) return obj;
+ return isArray(obj) ? obj.slice() : extend({}, obj);
+ }
+
+ // Invokes `interceptor` with the `obj` and then returns `obj`.
+ // The primary purpose of this method is to "tap into" a method chain, in
+ // order to perform operations on intermediate results within the chain.
+ function tap(obj, interceptor) {
+ interceptor(obj);
+ return obj;
+ }
+
+ // Normalize a (deep) property `path` to array.
+ // Like `_.iteratee`, this function can be customized.
+ function toPath$1(path) {
+ return isArray(path) ? path : [path];
+ }
+ _$1.toPath = toPath$1;
+
+ // Internal wrapper for `_.toPath` to enable minification.
+ // Similar to `cb` for `_.iteratee`.
+ function toPath(path) {
+ return _$1.toPath(path);
+ }
+
+ // Internal function to obtain a nested property in `obj` along `path`.
+ function deepGet(obj, path) {
+ var length = path.length;
+ for (var i = 0; i < length; i++) {
+ if (obj == null) return void 0;
+ obj = obj[path[i]];
+ }
+ return length ? obj : void 0;
+ }
+
+ // Get the value of the (deep) property on `path` from `object`.
+ // If any property in `path` does not exist or if the value is
+ // `undefined`, return `defaultValue` instead.
+ // The `path` is normalized through `_.toPath`.
+ function get(object, path, defaultValue) {
+ var value = deepGet(object, toPath(path));
+ return isUndefined(value) ? defaultValue : value;
+ }
+
+ // Shortcut function for checking if an object has a given property directly on
+ // itself (in other words, not on a prototype). Unlike the internal `has`
+ // function, this public version can also traverse nested properties.
+ function has(obj, path) {
+ path = toPath(path);
+ var length = path.length;
+ for (var i = 0; i < length; i++) {
+ var key = path[i];
+ if (!has$1(obj, key)) return false;
+ obj = obj[key];
+ }
+ return !!length;
+ }
+
+ // Keep the identity function around for default iteratees.
+ function identity(value) {
+ return value;
+ }
+
+ // Returns a predicate for checking whether an object has a given set of
+ // `key:value` pairs.
+ function matcher(attrs) {
+ attrs = extendOwn({}, attrs);
+ return function(obj) {
+ return isMatch(obj, attrs);
+ };
+ }
+
+ // Creates a function that, when passed an object, will traverse that object’s
+ // properties down the given `path`, specified as an array of keys or indices.
+ function property(path) {
+ path = toPath(path);
+ return function(obj) {
+ return deepGet(obj, path);
+ };
+ }
+
+ // Internal function that returns an efficient (for current engines) version
+ // of the passed-in callback, to be repeatedly applied in other Underscore
+ // functions.
+ function optimizeCb(func, context, argCount) {
+ if (context === void 0) return func;
+ switch (argCount == null ? 3 : argCount) {
+ case 1: return function(value) {
+ return func.call(context, value);
+ };
+ // The 2-argument case is omitted because we’re not using it.
+ case 3: return function(value, index, collection) {
+ return func.call(context, value, index, collection);
+ };
+ case 4: return function(accumulator, value, index, collection) {
+ return func.call(context, accumulator, value, index, collection);
+ };
+ }
+ return function() {
+ return func.apply(context, arguments);
+ };
+ }
+
+ // An internal function to generate callbacks that can be applied to each
+ // element in a collection, returning the desired result — either `_.identity`,
+ // an arbitrary callback, a property matcher, or a property accessor.
+ function baseIteratee(value, context, argCount) {
+ if (value == null) return identity;
+ if (isFunction$1(value)) return optimizeCb(value, context, argCount);
+ if (isObject(value) && !isArray(value)) return matcher(value);
+ return property(value);
+ }
+
+ // External wrapper for our callback generator. Users may customize
+ // `_.iteratee` if they want additional predicate/iteratee shorthand styles.
+ // This abstraction hides the internal-only `argCount` argument.
+ function iteratee(value, context) {
+ return baseIteratee(value, context, Infinity);
+ }
+ _$1.iteratee = iteratee;
+
+ // The function we call internally to generate a callback. It invokes
+ // `_.iteratee` if overridden, otherwise `baseIteratee`.
+ function cb(value, context, argCount) {
+ if (_$1.iteratee !== iteratee) return _$1.iteratee(value, context);
+ return baseIteratee(value, context, argCount);
+ }
+
+ // Returns the results of applying the `iteratee` to each element of `obj`.
+ // In contrast to `_.map` it returns an object.
+ function mapObject(obj, iteratee, context) {
+ iteratee = cb(iteratee, context);
+ var _keys = keys(obj),
+ length = _keys.length,
+ results = {};
+ for (var index = 0; index < length; index++) {
+ var currentKey = _keys[index];
+ results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
+ }
+ return results;
+ }
+
+ // Predicate-generating function. Often useful outside of Underscore.
+ function noop(){}
+
+ // Generates a function for a given object that returns a given property.
+ function propertyOf(obj) {
+ if (obj == null) return noop;
+ return function(path) {
+ return get(obj, path);
+ };
+ }
+
+ // Run a function **n** times.
+ function times(n, iteratee, context) {
+ var accum = Array(Math.max(0, n));
+ iteratee = optimizeCb(iteratee, context, 1);
+ for (var i = 0; i < n; i++) accum[i] = iteratee(i);
+ return accum;
+ }
+
+ // Return a random integer between `min` and `max` (inclusive).
+ function random(min, max) {
+ if (max == null) {
+ max = min;
+ min = 0;
+ }
+ return min + Math.floor(Math.random() * (max - min + 1));
+ }
+
+ // A (possibly faster) way to get the current timestamp as an integer.
+ var now = Date.now || function() {
+ return new Date().getTime();
+ };
+
+ // Internal helper to generate functions for escaping and unescaping strings
+ // to/from HTML interpolation.
+ function createEscaper(map) {
+ var escaper = function(match) {
+ return map[match];
+ };
+ // Regexes for identifying a key that needs to be escaped.
+ var source = '(?:' + keys(map).join('|') + ')';
+ var testRegexp = RegExp(source);
+ var replaceRegexp = RegExp(source, 'g');
+ return function(string) {
+ string = string == null ? '' : '' + string;
+ return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
+ };
+ }
+
+ // Internal list of HTML entities for escaping.
+ var escapeMap = {
+ '&': '&',
+ '<': '<',
+ '>': '>',
+ '"': '"',
+ "'": ''',
+ '`': '`'
+ };
+
+ // Function for escaping strings to HTML interpolation.
+ var _escape = createEscaper(escapeMap);
+
+ // Internal list of HTML entities for unescaping.
+ var unescapeMap = invert(escapeMap);
+
+ // Function for unescaping strings from HTML interpolation.
+ var _unescape = createEscaper(unescapeMap);
+
+ // By default, Underscore uses ERB-style template delimiters. Change the
+ // following template settings to use alternative delimiters.
+ var templateSettings = _$1.templateSettings = {
+ evaluate: /<%([\s\S]+?)%>/g,
+ interpolate: /<%=([\s\S]+?)%>/g,
+ escape: /<%-([\s\S]+?)%>/g
+ };
+
+ // When customizing `_.templateSettings`, if you don't want to define an
+ // interpolation, evaluation or escaping regex, we need one that is
+ // guaranteed not to match.
+ var noMatch = /(.)^/;
+
+ // Certain characters need to be escaped so that they can be put into a
+ // string literal.
+ var escapes = {
+ "'": "'",
+ '\\': '\\',
+ '\r': 'r',
+ '\n': 'n',
+ '\u2028': 'u2028',
+ '\u2029': 'u2029'
+ };
+
+ var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g;
+
+ function escapeChar(match) {
+ return '\\' + escapes[match];
+ }
+
+ // In order to prevent third-party code injection through
+ // `_.templateSettings.variable`, we test it against the following regular
+ // expression. It is intentionally a bit more liberal than just matching valid
+ // identifiers, but still prevents possible loopholes through defaults or
+ // destructuring assignment.
+ var bareIdentifier = /^\s*(\w|\$)+\s*$/;
+
+ // JavaScript micro-templating, similar to John Resig's implementation.
+ // Underscore templating handles arbitrary delimiters, preserves whitespace,
+ // and correctly escapes quotes within interpolated code.
+ // NB: `oldSettings` only exists for backwards compatibility.
+ function template(text, settings, oldSettings) {
+ if (!settings && oldSettings) settings = oldSettings;
+ settings = defaults({}, settings, _$1.templateSettings);
+
+ // Combine delimiters into one regular expression via alternation.
+ var matcher = RegExp([
+ (settings.escape || noMatch).source,
+ (settings.interpolate || noMatch).source,
+ (settings.evaluate || noMatch).source
+ ].join('|') + '|$', 'g');
+
+ // Compile the template source, escaping string literals appropriately.
+ var index = 0;
+ var source = "__p+='";
+ text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
+ source += text.slice(index, offset).replace(escapeRegExp, escapeChar);
+ index = offset + match.length;
+
+ if (escape) {
+ source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
+ } else if (interpolate) {
+ source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
+ } else if (evaluate) {
+ source += "';\n" + evaluate + "\n__p+='";
+ }
+
+ // Adobe VMs need the match returned to produce the correct offset.
+ return match;
+ });
+ source += "';\n";
+
+ var argument = settings.variable;
+ if (argument) {
+ // Insure against third-party code injection. (CVE-2021-23358)
+ if (!bareIdentifier.test(argument)) throw new Error(
+ 'variable is not a bare identifier: ' + argument
+ );
+ } else {
+ // If a variable is not specified, place data values in local scope.
+ source = 'with(obj||{}){\n' + source + '}\n';
+ argument = 'obj';
+ }
+
+ source = "var __t,__p='',__j=Array.prototype.join," +
+ "print=function(){__p+=__j.call(arguments,'');};\n" +
+ source + 'return __p;\n';
+
+ var render;
+ try {
+ render = new Function(argument, '_', source);
+ } catch (e) {
+ e.source = source;
+ throw e;
+ }
+
+ var template = function(data) {
+ return render.call(this, data, _$1);
+ };
+
+ // Provide the compiled source as a convenience for precompilation.
+ template.source = 'function(' + argument + '){\n' + source + '}';
+
+ return template;
+ }
+
+ // Traverses the children of `obj` along `path`. If a child is a function, it
+ // is invoked with its parent as context. Returns the value of the final
+ // child, or `fallback` if any child is undefined.
+ function result(obj, path, fallback) {
+ path = toPath(path);
+ var length = path.length;
+ if (!length) {
+ return isFunction$1(fallback) ? fallback.call(obj) : fallback;
+ }
+ for (var i = 0; i < length; i++) {
+ var prop = obj == null ? void 0 : obj[path[i]];
+ if (prop === void 0) {
+ prop = fallback;
+ i = length; // Ensure we don't continue iterating.
+ }
+ obj = isFunction$1(prop) ? prop.call(obj) : prop;
+ }
+ return obj;
+ }
+
+ // Generate a unique integer id (unique within the entire client session).
+ // Useful for temporary DOM ids.
+ var idCounter = 0;
+ function uniqueId(prefix) {
+ var id = ++idCounter + '';
+ return prefix ? prefix + id : id;
+ }
+
+ // Start chaining a wrapped Underscore object.
+ function chain(obj) {
+ var instance = _$1(obj);
+ instance._chain = true;
+ return instance;
+ }
+
+ // Internal function to execute `sourceFunc` bound to `context` with optional
+ // `args`. Determines whether to execute a function as a constructor or as a
+ // normal function.
+ function executeBound(sourceFunc, boundFunc, context, callingContext, args) {
+ if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
+ var self = baseCreate(sourceFunc.prototype);
+ var result = sourceFunc.apply(self, args);
+ if (isObject(result)) return result;
+ return self;
+ }
+
+ // Partially apply a function by creating a version that has had some of its
+ // arguments pre-filled, without changing its dynamic `this` context. `_` acts
+ // as a placeholder by default, allowing any combination of arguments to be
+ // pre-filled. Set `_.partial.placeholder` for a custom placeholder argument.
+ var partial = restArguments(function(func, boundArgs) {
+ var placeholder = partial.placeholder;
+ var bound = function() {
+ var position = 0, length = boundArgs.length;
+ var args = Array(length);
+ for (var i = 0; i < length; i++) {
+ args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];
+ }
+ while (position < arguments.length) args.push(arguments[position++]);
+ return executeBound(func, bound, this, this, args);
+ };
+ return bound;
+ });
+
+ partial.placeholder = _$1;
+
+ // Create a function bound to a given object (assigning `this`, and arguments,
+ // optionally).
+ var bind = restArguments(function(func, context, args) {
+ if (!isFunction$1(func)) throw new TypeError('Bind must be called on a function');
+ var bound = restArguments(function(callArgs) {
+ return executeBound(func, bound, context, this, args.concat(callArgs));
+ });
+ return bound;
+ });
+
+ // Internal helper for collection methods to determine whether a collection
+ // should be iterated as an array or as an object.
+ // Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
+ // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094
+ var isArrayLike = createSizePropertyCheck(getLength);
+
+ // Internal implementation of a recursive `flatten` function.
+ function flatten$1(input, depth, strict, output) {
+ output = output || [];
+ if (!depth && depth !== 0) {
+ depth = Infinity;
+ } else if (depth <= 0) {
+ return output.concat(input);
+ }
+ var idx = output.length;
+ for (var i = 0, length = getLength(input); i < length; i++) {
+ var value = input[i];
+ if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) {
+ // Flatten current level of array or arguments object.
+ if (depth > 1) {
+ flatten$1(value, depth - 1, strict, output);
+ idx = output.length;
+ } else {
+ var j = 0, len = value.length;
+ while (j < len) output[idx++] = value[j++];
+ }
+ } else if (!strict) {
+ output[idx++] = value;
+ }
+ }
+ return output;
+ }
+
+ // Bind a number of an object's methods to that object. Remaining arguments
+ // are the method names to be bound. Useful for ensuring that all callbacks
+ // defined on an object belong to it.
+ var bindAll = restArguments(function(obj, keys) {
+ keys = flatten$1(keys, false, false);
+ var index = keys.length;
+ if (index < 1) throw new Error('bindAll must be passed function names');
+ while (index--) {
+ var key = keys[index];
+ obj[key] = bind(obj[key], obj);
+ }
+ return obj;
+ });
+
+ // Memoize an expensive function by storing its results.
+ function memoize(func, hasher) {
+ var memoize = function(key) {
+ var cache = memoize.cache;
+ var address = '' + (hasher ? hasher.apply(this, arguments) : key);
+ if (!has$1(cache, address)) cache[address] = func.apply(this, arguments);
+ return cache[address];
+ };
+ memoize.cache = {};
+ return memoize;
+ }
+
+ // Delays a function for the given number of milliseconds, and then calls
+ // it with the arguments supplied.
+ var delay = restArguments(function(func, wait, args) {
+ return setTimeout(function() {
+ return func.apply(null, args);
+ }, wait);
+ });
+
+ // Defers a function, scheduling it to run after the current call stack has
+ // cleared.
+ var defer = partial(delay, _$1, 1);
+
+ // Returns a function, that, when invoked, will only be triggered at most once
+ // during a given window of time. Normally, the throttled function will run
+ // as much as it can, without ever going more than once per `wait` duration;
+ // but if you'd like to disable the execution on the leading edge, pass
+ // `{leading: false}`. To disable execution on the trailing edge, ditto.
+ function throttle(func, wait, options) {
+ var timeout, context, args, result;
+ var previous = 0;
+ if (!options) options = {};
+
+ var later = function() {
+ previous = options.leading === false ? 0 : now();
+ timeout = null;
+ result = func.apply(context, args);
+ if (!timeout) context = args = null;
+ };
+
+ var throttled = function() {
+ var _now = now();
+ if (!previous && options.leading === false) previous = _now;
+ var remaining = wait - (_now - previous);
+ context = this;
+ args = arguments;
+ if (remaining <= 0 || remaining > wait) {
+ if (timeout) {
+ clearTimeout(timeout);
+ timeout = null;
+ }
+ previous = _now;
+ result = func.apply(context, args);
+ if (!timeout) context = args = null;
+ } else if (!timeout && options.trailing !== false) {
+ timeout = setTimeout(later, remaining);
+ }
+ return result;
+ };
+
+ throttled.cancel = function() {
+ clearTimeout(timeout);
+ previous = 0;
+ timeout = context = args = null;
+ };
+
+ return throttled;
+ }
+
+ // When a sequence of calls of the returned function ends, the argument
+ // function is triggered. The end of a sequence is defined by the `wait`
+ // parameter. If `immediate` is passed, the argument function will be
+ // triggered at the beginning of the sequence instead of at the end.
+ function debounce(func, wait, immediate) {
+ var timeout, previous, args, result, context;
+
+ var later = function() {
+ var passed = now() - previous;
+ if (wait > passed) {
+ timeout = setTimeout(later, wait - passed);
+ } else {
+ timeout = null;
+ if (!immediate) result = func.apply(context, args);
+ // This check is needed because `func` can recursively invoke `debounced`.
+ if (!timeout) args = context = null;
+ }
+ };
+
+ var debounced = restArguments(function(_args) {
+ context = this;
+ args = _args;
+ previous = now();
+ if (!timeout) {
+ timeout = setTimeout(later, wait);
+ if (immediate) result = func.apply(context, args);
+ }
+ return result;
+ });
+
+ debounced.cancel = function() {
+ clearTimeout(timeout);
+ timeout = args = context = null;
+ };
+
+ return debounced;
+ }
+
+ // Returns the first function passed as an argument to the second,
+ // allowing you to adjust arguments, run code before and after, and
+ // conditionally execute the original function.
+ function wrap(func, wrapper) {
+ return partial(wrapper, func);
+ }
+
+ // Returns a negated version of the passed-in predicate.
+ function negate(predicate) {
+ return function() {
+ return !predicate.apply(this, arguments);
+ };
+ }
+
+ // Returns a function that is the composition of a list of functions, each
+ // consuming the return value of the function that follows.
+ function compose() {
+ var args = arguments;
+ var start = args.length - 1;
+ return function() {
+ var i = start;
+ var result = args[start].apply(this, arguments);
+ while (i--) result = args[i].call(this, result);
+ return result;
+ };
+ }
+
+ // Returns a function that will only be executed on and after the Nth call.
+ function after(times, func) {
+ return function() {
+ if (--times < 1) {
+ return func.apply(this, arguments);
+ }
+ };
+ }
+
+ // Returns a function that will only be executed up to (but not including) the
+ // Nth call.
+ function before(times, func) {
+ var memo;
+ return function() {
+ if (--times > 0) {
+ memo = func.apply(this, arguments);
+ }
+ if (times <= 1) func = null;
+ return memo;
+ };
+ }
+
+ // Returns a function that will be executed at most one time, no matter how
+ // often you call it. Useful for lazy initialization.
+ var once = partial(before, 2);
+
+ // Returns the first key on an object that passes a truth test.
+ function findKey(obj, predicate, context) {
+ predicate = cb(predicate, context);
+ var _keys = keys(obj), key;
+ for (var i = 0, length = _keys.length; i < length; i++) {
+ key = _keys[i];
+ if (predicate(obj[key], key, obj)) return key;
+ }
+ }
+
+ // Internal function to generate `_.findIndex` and `_.findLastIndex`.
+ function createPredicateIndexFinder(dir) {
+ return function(array, predicate, context) {
+ predicate = cb(predicate, context);
+ var length = getLength(array);
+ var index = dir > 0 ? 0 : length - 1;
+ for (; index >= 0 && index < length; index += dir) {
+ if (predicate(array[index], index, array)) return index;
+ }
+ return -1;
+ };
+ }
+
+ // Returns the first index on an array-like that passes a truth test.
+ var findIndex = createPredicateIndexFinder(1);
+
+ // Returns the last index on an array-like that passes a truth test.
+ var findLastIndex = createPredicateIndexFinder(-1);
+
+ // Use a comparator function to figure out the smallest index at which
+ // an object should be inserted so as to maintain order. Uses binary search.
+ function sortedIndex(array, obj, iteratee, context) {
+ iteratee = cb(iteratee, context, 1);
+ var value = iteratee(obj);
+ var low = 0, high = getLength(array);
+ while (low < high) {
+ var mid = Math.floor((low + high) / 2);
+ if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
+ }
+ return low;
+ }
+
+ // Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions.
+ function createIndexFinder(dir, predicateFind, sortedIndex) {
+ return function(array, item, idx) {
+ var i = 0, length = getLength(array);
+ if (typeof idx == 'number') {
+ if (dir > 0) {
+ i = idx >= 0 ? idx : Math.max(idx + length, i);
+ } else {
+ length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
+ }
+ } else if (sortedIndex && idx && length) {
+ idx = sortedIndex(array, item);
+ return array[idx] === item ? idx : -1;
+ }
+ if (item !== item) {
+ idx = predicateFind(slice.call(array, i, length), isNaN$1);
+ return idx >= 0 ? idx + i : -1;
+ }
+ for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
+ if (array[idx] === item) return idx;
+ }
+ return -1;
+ };
+ }
+
+ // Return the position of the first occurrence of an item in an array,
+ // or -1 if the item is not included in the array.
+ // If the array is large and already in sort order, pass `true`
+ // for **isSorted** to use binary search.
+ var indexOf = createIndexFinder(1, findIndex, sortedIndex);
+
+ // Return the position of the last occurrence of an item in an array,
+ // or -1 if the item is not included in the array.
+ var lastIndexOf = createIndexFinder(-1, findLastIndex);
+
+ // Return the first value which passes a truth test.
+ function find(obj, predicate, context) {
+ var keyFinder = isArrayLike(obj) ? findIndex : findKey;
+ var key = keyFinder(obj, predicate, context);
+ if (key !== void 0 && key !== -1) return obj[key];
+ }
+
+ // Convenience version of a common use case of `_.find`: getting the first
+ // object containing specific `key:value` pairs.
+ function findWhere(obj, attrs) {
+ return find(obj, matcher(attrs));
+ }
+
+ // The cornerstone for collection functions, an `each`
+ // implementation, aka `forEach`.
+ // Handles raw objects in addition to array-likes. Treats all
+ // sparse array-likes as if they were dense.
+ function each(obj, iteratee, context) {
+ iteratee = optimizeCb(iteratee, context);
+ var i, length;
+ if (isArrayLike(obj)) {
+ for (i = 0, length = obj.length; i < length; i++) {
+ iteratee(obj[i], i, obj);
+ }
+ } else {
+ var _keys = keys(obj);
+ for (i = 0, length = _keys.length; i < length; i++) {
+ iteratee(obj[_keys[i]], _keys[i], obj);
+ }
+ }
+ return obj;
+ }
+
+ // Return the results of applying the iteratee to each element.
+ function map(obj, iteratee, context) {
+ iteratee = cb(iteratee, context);
+ var _keys = !isArrayLike(obj) && keys(obj),
+ length = (_keys || obj).length,
+ results = Array(length);
+ for (var index = 0; index < length; index++) {
+ var currentKey = _keys ? _keys[index] : index;
+ results[index] = iteratee(obj[currentKey], currentKey, obj);
+ }
+ return results;
+ }
+
+ // Internal helper to create a reducing function, iterating left or right.
+ function createReduce(dir) {
+ // Wrap code that reassigns argument variables in a separate function than
+ // the one that accesses `arguments.length` to avoid a perf hit. (#1991)
+ var reducer = function(obj, iteratee, memo, initial) {
+ var _keys = !isArrayLike(obj) && keys(obj),
+ length = (_keys || obj).length,
+ index = dir > 0 ? 0 : length - 1;
+ if (!initial) {
+ memo = obj[_keys ? _keys[index] : index];
+ index += dir;
+ }
+ for (; index >= 0 && index < length; index += dir) {
+ var currentKey = _keys ? _keys[index] : index;
+ memo = iteratee(memo, obj[currentKey], currentKey, obj);
+ }
+ return memo;
+ };
+
+ return function(obj, iteratee, memo, context) {
+ var initial = arguments.length >= 3;
+ return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);
+ };
+ }
+
+ // **Reduce** builds up a single result from a list of values, aka `inject`,
+ // or `foldl`.
+ var reduce = createReduce(1);
+
+ // The right-associative version of reduce, also known as `foldr`.
+ var reduceRight = createReduce(-1);
+
+ // Return all the elements that pass a truth test.
+ function filter(obj, predicate, context) {
+ var results = [];
+ predicate = cb(predicate, context);
+ each(obj, function(value, index, list) {
+ if (predicate(value, index, list)) results.push(value);
+ });
+ return results;
+ }
+
+ // Return all the elements for which a truth test fails.
+ function reject(obj, predicate, context) {
+ return filter(obj, negate(cb(predicate)), context);
+ }
+
+ // Determine whether all of the elements pass a truth test.
+ function every(obj, predicate, context) {
+ predicate = cb(predicate, context);
+ var _keys = !isArrayLike(obj) && keys(obj),
+ length = (_keys || obj).length;
+ for (var index = 0; index < length; index++) {
+ var currentKey = _keys ? _keys[index] : index;
+ if (!predicate(obj[currentKey], currentKey, obj)) return false;
+ }
+ return true;
+ }
+
+ // Determine if at least one element in the object passes a truth test.
+ function some(obj, predicate, context) {
+ predicate = cb(predicate, context);
+ var _keys = !isArrayLike(obj) && keys(obj),
+ length = (_keys || obj).length;
+ for (var index = 0; index < length; index++) {
+ var currentKey = _keys ? _keys[index] : index;
+ if (predicate(obj[currentKey], currentKey, obj)) return true;
+ }
+ return false;
+ }
+
+ // Determine if the array or object contains a given item (using `===`).
+ function contains(obj, item, fromIndex, guard) {
+ if (!isArrayLike(obj)) obj = values(obj);
+ if (typeof fromIndex != 'number' || guard) fromIndex = 0;
+ return indexOf(obj, item, fromIndex) >= 0;
+ }
+
+ // Invoke a method (with arguments) on every item in a collection.
+ var invoke = restArguments(function(obj, path, args) {
+ var contextPath, func;
+ if (isFunction$1(path)) {
+ func = path;
+ } else {
+ path = toPath(path);
+ contextPath = path.slice(0, -1);
+ path = path[path.length - 1];
+ }
+ return map(obj, function(context) {
+ var method = func;
+ if (!method) {
+ if (contextPath && contextPath.length) {
+ context = deepGet(context, contextPath);
+ }
+ if (context == null) return void 0;
+ method = context[path];
+ }
+ return method == null ? method : method.apply(context, args);
+ });
+ });
+
+ // Convenience version of a common use case of `_.map`: fetching a property.
+ function pluck(obj, key) {
+ return map(obj, property(key));
+ }
+
+ // Convenience version of a common use case of `_.filter`: selecting only
+ // objects containing specific `key:value` pairs.
+ function where(obj, attrs) {
+ return filter(obj, matcher(attrs));
+ }
+
+ // Return the maximum element (or element-based computation).
+ function max(obj, iteratee, context) {
+ var result = -Infinity, lastComputed = -Infinity,
+ value, computed;
+ if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) {
+ obj = isArrayLike(obj) ? obj : values(obj);
+ for (var i = 0, length = obj.length; i < length; i++) {
+ value = obj[i];
+ if (value != null && value > result) {
+ result = value;
+ }
+ }
+ } else {
+ iteratee = cb(iteratee, context);
+ each(obj, function(v, index, list) {
+ computed = iteratee(v, index, list);
+ if (computed > lastComputed || (computed === -Infinity && result === -Infinity)) {
+ result = v;
+ lastComputed = computed;
+ }
+ });
+ }
+ return result;
+ }
+
+ // Return the minimum element (or element-based computation).
+ function min(obj, iteratee, context) {
+ var result = Infinity, lastComputed = Infinity,
+ value, computed;
+ if (iteratee == null || (typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null)) {
+ obj = isArrayLike(obj) ? obj : values(obj);
+ for (var i = 0, length = obj.length; i < length; i++) {
+ value = obj[i];
+ if (value != null && value < result) {
+ result = value;
+ }
+ }
+ } else {
+ iteratee = cb(iteratee, context);
+ each(obj, function(v, index, list) {
+ computed = iteratee(v, index, list);
+ if (computed < lastComputed || (computed === Infinity && result === Infinity)) {
+ result = v;
+ lastComputed = computed;
+ }
+ });
+ }
+ return result;
+ }
+
+ // Safely create a real, live array from anything iterable.
+ var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
+ function toArray(obj) {
+ if (!obj) return [];
+ if (isArray(obj)) return slice.call(obj);
+ if (isString(obj)) {
+ // Keep surrogate pair characters together.
+ return obj.match(reStrSymbol);
+ }
+ if (isArrayLike(obj)) return map(obj, identity);
+ return values(obj);
+ }
+
+ // Sample **n** random values from a collection using the modern version of the
+ // [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
+ // If **n** is not specified, returns a single random element.
+ // The internal `guard` argument allows it to work with `_.map`.
+ function sample(obj, n, guard) {
+ if (n == null || guard) {
+ if (!isArrayLike(obj)) obj = values(obj);
+ return obj[random(obj.length - 1)];
+ }
+ var sample = toArray(obj);
+ var length = getLength(sample);
+ n = Math.max(Math.min(n, length), 0);
+ var last = length - 1;
+ for (var index = 0; index < n; index++) {
+ var rand = random(index, last);
+ var temp = sample[index];
+ sample[index] = sample[rand];
+ sample[rand] = temp;
+ }
+ return sample.slice(0, n);
+ }
+
+ // Shuffle a collection.
+ function shuffle(obj) {
+ return sample(obj, Infinity);
+ }
+
+ // Sort the object's values by a criterion produced by an iteratee.
+ function sortBy(obj, iteratee, context) {
+ var index = 0;
+ iteratee = cb(iteratee, context);
+ return pluck(map(obj, function(value, key, list) {
+ return {
+ value: value,
+ index: index++,
+ criteria: iteratee(value, key, list)
+ };
+ }).sort(function(left, right) {
+ var a = left.criteria;
+ var b = right.criteria;
+ if (a !== b) {
+ if (a > b || a === void 0) return 1;
+ if (a < b || b === void 0) return -1;
+ }
+ return left.index - right.index;
+ }), 'value');
+ }
+
+ // An internal function used for aggregate "group by" operations.
+ function group(behavior, partition) {
+ return function(obj, iteratee, context) {
+ var result = partition ? [[], []] : {};
+ iteratee = cb(iteratee, context);
+ each(obj, function(value, index) {
+ var key = iteratee(value, index, obj);
+ behavior(result, value, key);
+ });
+ return result;
+ };
+ }
+
+ // Groups the object's values by a criterion. Pass either a string attribute
+ // to group by, or a function that returns the criterion.
+ var groupBy = group(function(result, value, key) {
+ if (has$1(result, key)) result[key].push(value); else result[key] = [value];
+ });
+
+ // Indexes the object's values by a criterion, similar to `_.groupBy`, but for
+ // when you know that your index values will be unique.
+ var indexBy = group(function(result, value, key) {
+ result[key] = value;
+ });
+
+ // Counts instances of an object that group by a certain criterion. Pass
+ // either a string attribute to count by, or a function that returns the
+ // criterion.
+ var countBy = group(function(result, value, key) {
+ if (has$1(result, key)) result[key]++; else result[key] = 1;
+ });
+
+ // Split a collection into two arrays: one whose elements all pass the given
+ // truth test, and one whose elements all do not pass the truth test.
+ var partition = group(function(result, value, pass) {
+ result[pass ? 0 : 1].push(value);
+ }, true);
+
+ // Return the number of elements in a collection.
+ function size(obj) {
+ if (obj == null) return 0;
+ return isArrayLike(obj) ? obj.length : keys(obj).length;
+ }
+
+ // Internal `_.pick` helper function to determine whether `key` is an enumerable
+ // property name of `obj`.
+ function keyInObj(value, key, obj) {
+ return key in obj;
+ }
+
+ // Return a copy of the object only containing the allowed properties.
+ var pick = restArguments(function(obj, keys) {
+ var result = {}, iteratee = keys[0];
+ if (obj == null) return result;
+ if (isFunction$1(iteratee)) {
+ if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]);
+ keys = allKeys(obj);
+ } else {
+ iteratee = keyInObj;
+ keys = flatten$1(keys, false, false);
+ obj = Object(obj);
+ }
+ for (var i = 0, length = keys.length; i < length; i++) {
+ var key = keys[i];
+ var value = obj[key];
+ if (iteratee(value, key, obj)) result[key] = value;
+ }
+ return result;
+ });
+
+ // Return a copy of the object without the disallowed properties.
+ var omit = restArguments(function(obj, keys) {
+ var iteratee = keys[0], context;
+ if (isFunction$1(iteratee)) {
+ iteratee = negate(iteratee);
+ if (keys.length > 1) context = keys[1];
+ } else {
+ keys = map(flatten$1(keys, false, false), String);
+ iteratee = function(value, key) {
+ return !contains(keys, key);
+ };
+ }
+ return pick(obj, iteratee, context);
+ });
+
+ // Returns everything but the last entry of the array. Especially useful on
+ // the arguments object. Passing **n** will return all the values in
+ // the array, excluding the last N.
+ function initial(array, n, guard) {
+ return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
+ }
+
+ // Get the first element of an array. Passing **n** will return the first N
+ // values in the array. The **guard** check allows it to work with `_.map`.
+ function first(array, n, guard) {
+ if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
+ if (n == null || guard) return array[0];
+ return initial(array, array.length - n);
+ }
+
+ // Returns everything but the first entry of the `array`. Especially useful on
+ // the `arguments` object. Passing an **n** will return the rest N values in the
+ // `array`.
+ function rest(array, n, guard) {
+ return slice.call(array, n == null || guard ? 1 : n);
+ }
+
+ // Get the last element of an array. Passing **n** will return the last N
+ // values in the array.
+ function last(array, n, guard) {
+ if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
+ if (n == null || guard) return array[array.length - 1];
+ return rest(array, Math.max(0, array.length - n));
+ }
+
+ // Trim out all falsy values from an array.
+ function compact(array) {
+ return filter(array, Boolean);
+ }
+
+ // Flatten out an array, either recursively (by default), or up to `depth`.
+ // Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively.
+ function flatten(array, depth) {
+ return flatten$1(array, depth, false);
+ }
+
+ // Take the difference between one array and a number of other arrays.
+ // Only the elements present in just the first array will remain.
+ var difference = restArguments(function(array, rest) {
+ rest = flatten$1(rest, true, true);
+ return filter(array, function(value){
+ return !contains(rest, value);
+ });
+ });
+
+ // Return a version of the array that does not contain the specified value(s).
+ var without = restArguments(function(array, otherArrays) {
+ return difference(array, otherArrays);
+ });
+
+ // Produce a duplicate-free version of the array. If the array has already
+ // been sorted, you have the option of using a faster algorithm.
+ // The faster algorithm will not work with an iteratee if the iteratee
+ // is not a one-to-one function, so providing an iteratee will disable
+ // the faster algorithm.
+ function uniq(array, isSorted, iteratee, context) {
+ if (!isBoolean(isSorted)) {
+ context = iteratee;
+ iteratee = isSorted;
+ isSorted = false;
+ }
+ if (iteratee != null) iteratee = cb(iteratee, context);
+ var result = [];
+ var seen = [];
+ for (var i = 0, length = getLength(array); i < length; i++) {
+ var value = array[i],
+ computed = iteratee ? iteratee(value, i, array) : value;
+ if (isSorted && !iteratee) {
+ if (!i || seen !== computed) result.push(value);
+ seen = computed;
+ } else if (iteratee) {
+ if (!contains(seen, computed)) {
+ seen.push(computed);
+ result.push(value);
+ }
+ } else if (!contains(result, value)) {
+ result.push(value);
+ }
+ }
+ return result;
+ }
+
+ // Produce an array that contains the union: each distinct element from all of
+ // the passed-in arrays.
+ var union = restArguments(function(arrays) {
+ return uniq(flatten$1(arrays, true, true));
+ });
+
+ // Produce an array that contains every item shared between all the
+ // passed-in arrays.
+ function intersection(array) {
+ var result = [];
+ var argsLength = arguments.length;
+ for (var i = 0, length = getLength(array); i < length; i++) {
+ var item = array[i];
+ if (contains(result, item)) continue;
+ var j;
+ for (j = 1; j < argsLength; j++) {
+ if (!contains(arguments[j], item)) break;
+ }
+ if (j === argsLength) result.push(item);
+ }
+ return result;
+ }
+
+ // Complement of zip. Unzip accepts an array of arrays and groups
+ // each array's elements on shared indices.
+ function unzip(array) {
+ var length = (array && max(array, getLength).length) || 0;
+ var result = Array(length);
+
+ for (var index = 0; index < length; index++) {
+ result[index] = pluck(array, index);
+ }
+ return result;
+ }
+
+ // Zip together multiple lists into a single array -- elements that share
+ // an index go together.
+ var zip = restArguments(unzip);
+
+ // Converts lists into objects. Pass either a single array of `[key, value]`
+ // pairs, or two parallel arrays of the same length -- one of keys, and one of
+ // the corresponding values. Passing by pairs is the reverse of `_.pairs`.
+ function object(list, values) {
+ var result = {};
+ for (var i = 0, length = getLength(list); i < length; i++) {
+ if (values) {
+ result[list[i]] = values[i];
+ } else {
+ result[list[i][0]] = list[i][1];
+ }
+ }
+ return result;
+ }
+
+ // Generate an integer Array containing an arithmetic progression. A port of
+ // the native Python `range()` function. See
+ // [the Python documentation](https://docs.python.org/library/functions.html#range).
+ function range(start, stop, step) {
+ if (stop == null) {
+ stop = start || 0;
+ start = 0;
+ }
+ if (!step) {
+ step = stop < start ? -1 : 1;
+ }
+
+ var length = Math.max(Math.ceil((stop - start) / step), 0);
+ var range = Array(length);
+
+ for (var idx = 0; idx < length; idx++, start += step) {
+ range[idx] = start;
+ }
+
+ return range;
+ }
+
+ // Chunk a single array into multiple arrays, each containing `count` or fewer
+ // items.
+ function chunk(array, count) {
+ if (count == null || count < 1) return [];
+ var result = [];
+ var i = 0, length = array.length;
+ while (i < length) {
+ result.push(slice.call(array, i, i += count));
+ }
+ return result;
+ }
+
+ // Helper function to continue chaining intermediate results.
+ function chainResult(instance, obj) {
+ return instance._chain ? _$1(obj).chain() : obj;
+ }
+
+ // Add your own custom functions to the Underscore object.
+ function mixin(obj) {
+ each(functions(obj), function(name) {
+ var func = _$1[name] = obj[name];
+ _$1.prototype[name] = function() {
+ var args = [this._wrapped];
+ push.apply(args, arguments);
+ return chainResult(this, func.apply(_$1, args));
+ };
+ });
+ return _$1;
+ }
+
+ // Add all mutator `Array` functions to the wrapper.
+ each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
+ var method = ArrayProto[name];
+ _$1.prototype[name] = function() {
+ var obj = this._wrapped;
+ if (obj != null) {
+ method.apply(obj, arguments);
+ if ((name === 'shift' || name === 'splice') && obj.length === 0) {
+ delete obj[0];
+ }
+ }
+ return chainResult(this, obj);
+ };
+ });
+
+ // Add all accessor `Array` functions to the wrapper.
+ each(['concat', 'join', 'slice'], function(name) {
+ var method = ArrayProto[name];
+ _$1.prototype[name] = function() {
+ var obj = this._wrapped;
+ if (obj != null) obj = method.apply(obj, arguments);
+ return chainResult(this, obj);
+ };
+ });
+
+ // Named Exports
+
+ var allExports = {
+ __proto__: null,
+ VERSION: VERSION,
+ restArguments: restArguments,
+ isObject: isObject,
+ isNull: isNull,
+ isUndefined: isUndefined,
+ isBoolean: isBoolean,
+ isElement: isElement,
+ isString: isString,
+ isNumber: isNumber,
+ isDate: isDate,
+ isRegExp: isRegExp,
+ isError: isError,
+ isSymbol: isSymbol,
+ isArrayBuffer: isArrayBuffer,
+ isDataView: isDataView$1,
+ isArray: isArray,
+ isFunction: isFunction$1,
+ isArguments: isArguments$1,
+ isFinite: isFinite$1,
+ isNaN: isNaN$1,
+ isTypedArray: isTypedArray$1,
+ isEmpty: isEmpty,
+ isMatch: isMatch,
+ isEqual: isEqual,
+ isMap: isMap,
+ isWeakMap: isWeakMap,
+ isSet: isSet,
+ isWeakSet: isWeakSet,
+ keys: keys,
+ allKeys: allKeys,
+ values: values,
+ pairs: pairs,
+ invert: invert,
+ functions: functions,
+ methods: functions,
+ extend: extend,
+ extendOwn: extendOwn,
+ assign: extendOwn,
+ defaults: defaults,
+ create: create,
+ clone: clone,
+ tap: tap,
+ get: get,
+ has: has,
+ mapObject: mapObject,
+ identity: identity,
+ constant: constant,
+ noop: noop,
+ toPath: toPath$1,
+ property: property,
+ propertyOf: propertyOf,
+ matcher: matcher,
+ matches: matcher,
+ times: times,
+ random: random,
+ now: now,
+ escape: _escape,
+ unescape: _unescape,
+ templateSettings: templateSettings,
+ template: template,
+ result: result,
+ uniqueId: uniqueId,
+ chain: chain,
+ iteratee: iteratee,
+ partial: partial,
+ bind: bind,
+ bindAll: bindAll,
+ memoize: memoize,
+ delay: delay,
+ defer: defer,
+ throttle: throttle,
+ debounce: debounce,
+ wrap: wrap,
+ negate: negate,
+ compose: compose,
+ after: after,
+ before: before,
+ once: once,
+ findKey: findKey,
+ findIndex: findIndex,
+ findLastIndex: findLastIndex,
+ sortedIndex: sortedIndex,
+ indexOf: indexOf,
+ lastIndexOf: lastIndexOf,
+ find: find,
+ detect: find,
+ findWhere: findWhere,
+ each: each,
+ forEach: each,
+ map: map,
+ collect: map,
+ reduce: reduce,
+ foldl: reduce,
+ inject: reduce,
+ reduceRight: reduceRight,
+ foldr: reduceRight,
+ filter: filter,
+ select: filter,
+ reject: reject,
+ every: every,
+ all: every,
+ some: some,
+ any: some,
+ contains: contains,
+ includes: contains,
+ include: contains,
+ invoke: invoke,
+ pluck: pluck,
+ where: where,
+ max: max,
+ min: min,
+ shuffle: shuffle,
+ sample: sample,
+ sortBy: sortBy,
+ groupBy: groupBy,
+ indexBy: indexBy,
+ countBy: countBy,
+ partition: partition,
+ toArray: toArray,
+ size: size,
+ pick: pick,
+ omit: omit,
+ first: first,
+ head: first,
+ take: first,
+ initial: initial,
+ last: last,
+ rest: rest,
+ tail: rest,
+ drop: rest,
+ compact: compact,
+ flatten: flatten,
+ without: without,
+ uniq: uniq,
+ unique: uniq,
+ union: union,
+ intersection: intersection,
+ difference: difference,
+ unzip: unzip,
+ transpose: unzip,
+ zip: zip,
+ object: object,
+ range: range,
+ chunk: chunk,
+ mixin: mixin,
+ 'default': _$1
+ };
+
+ // Default Export
+
+ // Add all of the Underscore functions to the wrapper object.
+ var _ = mixin(allExports);
+ if (typeof define === 'function' && define.amd) {
+ define([], function() {
+ return _;
+ });
+ }
+}).call(this);
+//# sourceURL=underscore-umd.js.map
\ No newline at end of file
diff --git a/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/swc-windows-cp/index.js b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/swc-windows-cp/index.js
new file mode 100644
index 00000000..c13b4694
--- /dev/null
+++ b/deployment-apps/DA-ITSI-CP-windows-dashboards/appserver/static/js/swc-windows-cp/index.js
@@ -0,0 +1,666 @@
+!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.default=t():e.default=t()}(window,(function(){return function(e){function t(t){for(var n,r,o=t[0],a=t[1],s=0,c=[];s=0),l[8]){case"b":o=o.toString(2);break;case"c":o=String.fromCharCode(o);break;case"d":case"i":o=parseInt(o,10);break;case"j":o=JSON.stringify(o,null,l[6]?parseInt(l[6]):0);break;case"e":o=l[7]?o.toExponential(l[7]):o.toExponential();break;case"f":o=l[7]?parseFloat(o).toFixed(l[7]):parseFloat(o);break;case"g":o=l[7]?parseFloat(o).toPrecision(l[7]):parseFloat(o);break;case"o":o=o.toString(8);break;case"s":o=(o=String(o))&&l[7]?o.substring(0,l[7]):o;break;case"u":o>>>=0;break;case"x":o=o.toString(16);break;case"X":o=o.toString(16).toUpperCase()}n.json.test(l[8])?g[g.length]=o:(!n.number.test(l[8])||b&&!l[3]?v="":(v=b?"+":"-",o=o.toString().replace(n.sign,"")),d=l[4]?"0"===l[4]?"0":l[4].charAt(1):" ",u=l[6]-(v+o).length,c=l[6]&&u>0?(h=d,Array(u+1).join(h)):"",g[g.length]=l[5]?v+o+c:"0"===d?v+c+o:c+v+o)}return g.join("")},i.cache={},i.parse=function(e){for(var t=e,i=[],r=[],o=0;t;){if(null!==(i=n.text.exec(t)))r[r.length]=i[0];else if(null!==(i=n.modulo.exec(t)))r[r.length]="%";else{if(null===(i=n.placeholder.exec(t)))throw new SyntaxError("[sprintf] unexpected placeholder");if(i[2]){o|=1;var a=[],s=i[2],l=[];if(null===(l=n.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a[a.length]=l[1];""!==(s=s.substring(l[0].length));)if(null!==(l=n.key_access.exec(s)))a[a.length]=l[1];else{if(null===(l=n.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a[a.length]=l[1]}i[2]=a}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r[r.length]=i}t=t.substring(i[0].length)}return r};function r(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}t.sprintf=i,t.vsprintf=function(e,t,n){return(n=(t||[]).slice(0)).splice(0,0,e),i.apply(null,n)}}("undefined"==typeof window||window)},101:function(e,t,n){(t=e.exports=n(1)(!1)).push([e.i,'/*************************************************************************************************/\n/* BRAND COLORS */\n/* DO NOT USE DIRECTLY! Use $brandColor instead. See brand.*.pcss for definitions. */\n/*************************************************************************************************/\n/* Green Splunk Enterprise */\n/* Orange Splunk Lite */\n/* Brand colors */\n/*===============================================================================================*/\n/* SPLUNK: VARIABLES */\n/* Variables to customize the look and feel of Bootstrap (splunk version). */\n/* See /en-US/static/docs/style/style-guide.html for style guide */\n/*===============================================================================================*/\n/*===============================================================================================*/\n/* WARNING */\n/* This file has an implicit dependency on the brand variables injected by the */\n/* \'splunk-postcss-theme-import\' postcss plugin. */\n/*===============================================================================================*/\n/*===============================================================================================*/\n/* SPLUNK: COLORS */\n/*===============================================================================================*/\n/*************************************************************************************************/\n/* NEUTRAL COLORS */\n/* */\n/* PRE IVORY -> CURRENT VARIABLE */\n/* $black -> $black */\n/* $grayDarker -> $gray20 */\n/* $grayDark -> $gray30 */\n/* $gray -> $gray45 */\n/* $grayLight -> $gray60 */\n/* $grayLightMedium -> $gray80 */\n/* $grayLighter -> $gray92 */\n/* $gray96 */\n/* $offWhite -> $gray98 */\n/* $white -> $white */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* SEMANTIC COLORS */\n/* */\n/* PRE IVORY -> CURRENT VARIABLE */\n/* $red -> $errorColor */\n/* $orange -> $alertColor */\n/* $yellow -> $warningColor */\n/* $yellowLight -> $warningColorL20 */\n/* $yellowLighter -> $warningColorL40 */\n/* $green -> $successColor */\n/* $blue -> $infoColor */\n/* $blueDark -> $infoColorD40 */\n/* $pink -> No Equivalent or $errorColorL30 */\n/* $purple -> No Equivalent */\n/* $teal -> No Equivalent */\n/* $focusColor -> $accentColorL10 */\n/*************************************************************************************************/\n/* Blue Accent */\n/* Red Error */\n/* Orange Alert */\n/* Yellow Warning */\n/* Green Success */\n/* Blue Info */\n/*************************************************************************************************/\n/* CATEGORICAL COLORS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* DIVERGING COLORS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* STATIC PATHS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* TYPOGRAPHY */\n/*************************************************************************************************/\n/* Lite listing pages */\n/* empty to use BS default, $fontFamily */\n/* instead of browser default, bold */\n/*************************************************************************************************/\n/* SCAFFOLDING */\n/*************************************************************************************************/\n/* Border Colors */\n/* aliases: $tableBorderColor $tableBorderColorVertical */\n/* also see: $interactiveBorderColor */\n/* Borders */\n/* Border Radius */\n/* For containers without a wrapper */\n/* For for containers with a wrapper, like popdown */\n/* Padding & Margin */\n/* 200% - 40px */\n/* 150% - 30px */\n/* 75% - 15px */\n/* 50% - 10px */\n/* 25% - 5px */\n/* Popdown Arrows */\n/* Large Icons */\n/*************************************************************************************************/\n/* TRANSITIONS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* HORIZONTAL FORMS & LISTS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Z-INDEX */\n/*************************************************************************************************/\n/* If a variable does not suit your purpose, set a value relatively such as, $zindexModal +1 */\n/* Splunk Lite */\n/* Splunk Lite */\n/* Sidebar Component */\n/* Sidebar Component */\n/* timerange popdown needs to be above modal + backdrop */\n/* top interactive element */\n/* top interactive element */\n/* top uninteractive */\n/* top uninteractive */\n/*************************************************************************************************/\n/* TABLES */\n/*************************************************************************************************/\n/* overall background-color */\n/*************************************************************************************************/\n/* FORMS */\n/*************************************************************************************************/\n/* base input height + 10px vertical padding + 2px top/bottom border */\n/* This is generally overridden. */\n/*************************************************************************************************/\n/* MODAL */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* POPUP */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* TABS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* MENU */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* BASE INTERACTIVE */\n/*************************************************************************************************/\n/* text */\n/* background */\n/* borders */\n/* shadow */\n/*************************************************************************************************/\n/* BASE INTERACTIVE ERROR */\n/*************************************************************************************************/\n/* text */\n/* background */\n/*************************************************************************************************/\n/* BUTTONS */\n/*************************************************************************************************/\n/* 1 rem */\n/*************************************************************************************************/\n/* PRIMARY BUTTONS */\n/*************************************************************************************************/\n/* text */\n/* background */\n/* borders */\n/* shadow */\n/*************************************************************************************************/\n/* PILL BUTTONS */\n/*************************************************************************************************/\n/* text */\n/* background */\n/*************************************************************************************************/\n/* COMPONENT VARIABLES */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* NAVBAR */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* APP BAR */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* ACCORDION */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* CONCERTINA */\n/* Concertina has the same color as Accordion, maybe we should just reuse them? */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* TOOLTIPS & POPOVERS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* SELECTORS FOR CUSTOMIZING SPECIFIC LOCALES */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* DASHBOARDS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* VIZ & VIZ PICKERS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* MAPS */\n/*************************************************************************************************/\n/* leaflet popup defaults */\n/*************************************************************************************************/\n/* Search IDE */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Date Picker */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Time Range Picker */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Events Viewer */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Misc */\n/*************************************************************************************************/\n/*===============================================================================================*/\n/* SPLUNK: MIXINS */\n/* Snippets of reusable CSS to develop faster and keep code readable */\n/*===============================================================================================*/\n/* Reset */\n/* ------------------ */\n/* Link */\n/* ------------------ */\n/*************************************************************************************************/\n/* FOCUS STATES */\n/*************************************************************************************************/\n/* Use when are outer focus glow will be block (i.e Menu Items). Provide background color.*/\n/* Block elements change the background color */\n/* Block elements change the background color and spread via box-shadow */\n/*************************************************************************************************/\n/* INTERACTIVE */\n/* These are by any element that can be clicked, such as buttons, menus and table headings. */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Interactive style: */\n/* @params: */\n/* Background Color */\n/* Border Color */\n/* Box Shadow */\n/* Text Color */\n/* Transition */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Primary interactive style: */\n/* @params: */\n/* Background Color */\n/* Box Shadow */\n/* Text Color */\n/* Transition */\n/*----------------------------------------------*/\n/*************************************************************************************************/\n/* INTERACTIVE ERROR */\n/* These are by any interactive element that is is in an error state. */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* BUTTONS */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Pills, Links */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Define states of buttons: */\n/* :hover, :active, disabled and :focus */\n/* @params: */\n/* Hover Mixin */\n/* Active Mixin */\n/* Disabled Mixin */\n/* Focus Mixin */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Button Padding: */\n/* @params: */\n/* Vertical Padding */\n/* Horizontal Padding */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Primary Button Padding: */\n/* @params: */\n/* Vertical Padding */\n/* Horizontal Padding */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Button Padding For Other Button Sizes: */\n/* @params: */\n/* Vertical Padding */\n/* Horizontal Padding */\n/* Button Icon Margin Top */\n/*----------------------------------------------*/\n/* Draggable Handle */\n/*************************************************************************************************/\n/* FONTS */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Define Font Family: */\n/* @params: */\n/* Font Name */\n/* Name of Font File */\n/* Font Format */\n/* Font Weight */\n/* Font Style */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Create a heading */\n/* @params: */\n/* Font Size */\n/* Margin */\n/* Font Color */\n/* Text Transform */\n/*----------------------------------------------*/\n/*************************************************************************************************/\n/* UTILITY MIXINS */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Clearfix: */\n/* For clearing floats like a boss h5bp.com/q */\n/*----------------------------------------------*/\n/* Placeholder text */\n/* Basic input styles */\n/* Sets Modal width and margin */\n/* Define card style. Add white background and shadow. */\n/* Workaround for table shadows in IE. Don\'t use this mixin, use create-card-table */\n/* Define card style on tables. Adds workaround for IE */\n/* Cover browser specific radio button with styled radio button. */\n/* Can only be used if label comes immediately after input[type=radio] */\n/* Use to cover button in .radio class */\n/*-------------------------------------------------------------------------*/\n/* CSS image replacement */\n/* For clearing floats like a boss h5bp.com/q */\n/* Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 */\n/*-------------------------------------------------------------------------*/\n/*************************************************************************************************/\n/* ICONS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* FORMS */\n/*************************************************************************************************/\n/* Block level inputs */\n/*************************************************************************************************/\n/* COMPONENT MIXINS */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Horizontal Dividers: */\n/* Dividers (basically an hr) within dropdowns */\n/* and nav lists. */\n/* @params: */\n/* Border Color */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Navbar Vertical Align: */\n/* Vertically center elements in the navbar. */\n/* Example: an element has a height of 30px, */\n/* so write out `.navbarVerticalAlign(30px);` */\n/* to calculate the appropriate top margin. */\n/* @params: */\n/* Element Height */\n/*----------------------------------------------*/\n/*************************************************************************************************/\n/* PRINTING */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* POPDOWN */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Arrow: */\n/* Create an arrow. */\n/* @params: */\n/* Arrow Direction (up, down, left, right) */\n/* Arrow Color */\n/* Arrow Size */\n/*----------------------------------------------*/\n/* popdown body */\n/*************************************************************************************************/\n/* FULL PAGE LAYOUT */\n/*************************************************************************************************/\n.view---enterprise---dev---2DvVE {\n width: 230px;\n -webkit-box-flex: 1;\n -ms-flex: 1 1 230px;\n flex: 1 1 230px; /* shrink or grow is fine */\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n position: relative;\n}\n.input---enterprise---dev---QhQwX {\n /* needed for composition */\n}\n/* Some of these need greater specificity than input[type=text] */\n.uneditableInput---enterprise---dev---3BYdC, .input---enterprise---dev---QhQwX[type=text] {\n display: inline-block;\n padding: 5px 8px;\n height: 32px;\n line-height: 20px;\n font-size: 14px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n font-family: "Splunk Platform Sans", "Proxima Nova", Roboto, Droid, "Helvetica Neue", Helvetica, Arial, sans-serif;\n color: #5C6773;\n border: 1px solid #C3CBD4;\n border-radius: 3px;\n vertical-align: middle;\n -webkit-transition: border 0.2s, -webkit-box-shadow 0.2s;\n transition: border 0.2s, -webkit-box-shadow 0.2s;\n transition: border 0.2s, box-shadow 0.2s;\n transition: border 0.2s, box-shadow 0.2s, -webkit-box-shadow 0.2s;\n margin-top: 0;\n margin-bottom: 0;\n box-sizing: border-box;\n\n width: 100%;\n};\n.uneditableInput---enterprise---dev---3BYdC::-webkit-input-placeholder, .input---enterprise---dev---QhQwX[type=text]::-webkit-input-placeholder {\n color: #6b7785;\n opacity:1;\n }\n.uneditableInput---enterprise---dev---3BYdC::-moz-placeholder, .input---enterprise---dev---QhQwX[type=text]::-moz-placeholder {\n color: #6b7785;\n opacity:1;\n }\n.uneditableInput---enterprise---dev---3BYdC:-ms-input-placeholder, .input---enterprise---dev---QhQwX[type=text]:-ms-input-placeholder {\n color: #6b7785;\n opacity:1;\n }\n.uneditableInput---enterprise---dev---3BYdC::-ms-input-placeholder, .input---enterprise---dev---QhQwX[type=text]::-ms-input-placeholder {\n color: #6b7785;\n opacity:1;\n }\n.uneditableInput---enterprise---dev---3BYdC::placeholder, .input---enterprise---dev---QhQwX[type=text]::placeholder {\n color: #6b7785;\n opacity:1;\n }\n/* Focus state */\n.uneditableInput---enterprise---dev---3BYdC:focus, .input---enterprise---dev---QhQwX[type=text]:focus {\n -webkit-box-shadow: 0 0 1px 3px #006EAA;\n box-shadow: 0 0 1px 3px #006EAA;\n border-collapse: separate;\n /* Fix IE9 Issue with box-shadow */\n outline: 0;\n text-decoration: none;\n }\n.uneditableInput---enterprise---dev---3BYdC:focus:active:not([disabled]), .input---enterprise---dev---QhQwX[type=text]:focus:active:not([disabled]) {\n -webkit-box-shadow: none;\n box-shadow: none;\n }\n/* Don\'t show IE clear button when an artificial one is shown. */\n.uneditableInput---enterprise---dev---3BYdC.text-clear---enterprise---dev---2OXID::-ms-clear, .input---enterprise---dev---QhQwX[type=text].text-clear---enterprise---dev---2OXID::-ms-clear {\n display: none;\n width: 0; /* IE 11 on windows 8 */\n height: 0; /* IE 11 on windows 8 */\n }\n.inputCanClear---enterprise---dev---1dyD5 {\n}\n.inputCanClear---enterprise---dev---1dyD5[type=text] {\n padding-right: 30px;\n }\n.inputSearch---enterprise---dev---2pYE3 {\n}\n.clear---enterprise---dev---1cwA4, .searchIcon---enterprise---dev---3t2mr {\n position: absolute;\n right: 8px;\n top: 5px;\n line-height: 22px;\n font-size: 18px;\n color: #6b7785;\n}\n.searchIcon---enterprise---dev---3t2mr {\n top: 6px;\n}\n.placeholder---enterprise---dev---1q52M {\n color: #6b7785;\n position: absolute;\n max-width: 100%;\n top: 3px;\n left: 6px;\n font-size: 14px;\n}\n',""]),t.locals={view:"view---enterprise---dev---2DvVE",input:"input---enterprise---dev---QhQwX",uneditableInput:"uneditableInput---enterprise---dev---3BYdC","text-clear":"text-clear---enterprise---dev---2OXID",inputCanClear:"inputCanClear---enterprise---dev---1dyD5 input---enterprise---dev---QhQwX",inputSearch:"inputSearch---enterprise---dev---2pYE3 inputCanClear---enterprise---dev---1dyD5 input---enterprise---dev---QhQwX",clear:"clear---enterprise---dev---1cwA4",searchIcon:"searchIcon---enterprise---dev---3t2mr",placeholder:"placeholder---enterprise---dev---1q52M"}},102:function(e,t,n){var i=n(181),r=n(544),o=n(545),a=i?i.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?r(e):o(e)}},103:function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},104:function(e,t){e.exports={}},105:function(e,t,n){var i=n(189);e.exports=function(e){return Object(i(e))}},106:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSortedTabbableElements=o,t.handleTab=function(e,t){if(!e.contains(document.activeElement))return null;if("tab"!==(0,i.keycode)(t)||t.metaKey||t.altKey||t.controlKey)return null;var n=o(e);if(0===n.length)return document.activeElement===e?(t.preventDefault(),e):null;var r=t&&t.target||e.querySelector(":focus"),a=n.indexOf(r);-1===a&&(a=t.shiftKey?0:n.length-1);t.shiftKey?n.unshift(n.pop()):n.push(n.shift());return t.preventDefault(),n[a].focus(),n[a]},t.takeFocus=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"first",n=e.querySelector(":focus");if(n)return n;if("first"===t){var i=o(e)[0];if(i)return(0,r.defer)((function(){return i.focus()})),i}if(e.hasAttribute("tabIndex"))return(0,r.defer)((function(){return e.focus()})),e;return null};var i=n(46),r=n(6);function o(e){var t=e.querySelectorAll("a[href], input:not([disabled]), select:not([disabled]),\n textarea:not([disabled]), button:not([disabled]), [tabindex], [contenteditable]"),n=(0,r.filter)(t,(function(e){return!(!((t=e).offsetWidth||t.offsetHeight||t.getClientRects().length>0)||"hidden"===getComputedStyle(t).visibility)&&e.tabIndex>=0||e===document.activeElement;var t})).reduce((function(e,t){var n=e[e.length-1],i="radio"===(null==n?void 0:n.getAttribute("type")),r="radio"===t.getAttribute("type"),o=t.getAttribute("name")===(null==n?void 0:n.getAttribute("name"));return i&&r&&o?t.checked&&(e.pop(),e.push(t)):e.push(t),e}),[]);return(0,r.sortBy)(n,(function(e){return e.tabIndex>0?-1/e.tabIndex:0}))}},107:function(e,t,n){e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=124)}({0:function(e,t){e.exports=n(9)},1:function(e,t){e.exports=n(4)},10:function(e,t){e.exports=n(31)},11:function(e,t){e.exports=n(38)},12:function(e,t){e.exports=n(84)},124:function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),o=n(1),a=n.n(o),s=n(35),l=n.n(s),c=n(37),d=n.n(c),u=n(13),h=n.n(u),p=n(0),f=n(10),m=n(7),g=n(8),b=n(3),v=n.n(b),y=n(12),w=n.n(y),x=n(9),S=n.n(x),k=n(11),C=n.n(k),_=v()(S.a).withConfig({displayName:"SwitchStyles__StyledBox",componentId:"sc-844ieu-0"})(["",";position:relative;padding:calc(("," - ",") / 2) 0;padding:",";flex-shrink:0;&[data-size='small']{font-size:",";padding:calc(("," - ",") / 2) 0;}&[data-error]{color:",";}&[data-disabled]{color:",";}"],Object(p.mixin)("reset")("inline"),Object(p.variable)("inputHeight"),"18px",Object(p.variable)("Switch","padding"),Object(p.variable)("fontSizeSmall"),Object(p.variable)("inputHeightSmall"),"18px",Object(p.variable)("Switch","wrapperErrorColor"),Object(p.variable)("textDisabledColor")),M=function(e){return Object(b.css)(["",";position:relative;width:",";height:",";border:",";border-color:",";color:",";flex:0 0 auto;top:",";&:focus{box-shadow:",";}&[data-selected='true']:not([disabled]),&[data-selected='some']:not([disabled]){border-color:",";background-color:",";}[data-error] > &{border-color:",";color:",";&[data-selected='true']:not([disabled]){border-color:",";}}&[disabled]{border-color:",";color:",";cursor:not-allowed;background-color:'#23242b';}"],Object(p.mixin)("reset")("inline-block"),"18px","18px",Object(p.variable)("border"),Object(p.variable)("Switch",e,"borderColor"),Object(p.variable)("Switch",e,"color"),Object(p.variable)("Switch",e,"top"),Object(p.variable)("Switch",e,"focusShadow"),Object(p.variable)("Switch",e,"selectedBorderColor"),Object(p.variable)("Switch",e,"selectedBackgroundColor"),Object(p.variable)("Switch",e,"errorBorderColor"),Object(p.variable)("Switch",e,"errorColor"),Object(p.variable)("Switch",e,"selectedErrorBorderColor"),Object(p.variable)("Switch",e,"disabledBorderColor"),Object(p.variable)("Switch",e,"disabledColor"))},T=Object(b.css)(["margin:",";&:not([disabled]),&{border-radius:50%;}&[data-selected='true']::after{display:block;content:'';position:absolute;left:4px;top:4px;width:calc("," - 10px);height:calc("," - 10px);border-radius:50%;background-color:currentColor;}"],Object(p.variable)("Switch","Radio","margin"),"18px","18px"),A=Object(b.css)(["&:not([disabled]):hover,&:not([disabled]):focus{::before{display:block;content:'';width:30px;height:30px;background:rgba(255,255,255,0.15);border-radius:50%;position:absolute;top:-7px;left:-7px;}}"]),O=v()(C.a).withConfig({displayName:"SwitchStyles__StyledRadioClickable",componentId:"sc-844ieu-1"})(["",";",";",""],M("Radio"),T,(function(e){return Object(p.variable)("Switch","Radio","hasBackground")(e)&&A})),E=O.withComponent("span"),L=Object(b.css)(["&:not([disabled]):hover,&:not([disabled]):focus{::before{display:block;content:'';width:30px;height:30px;background:rgba(255,255,255,0.15);border-radius:4px;position:absolute;top:-7px;left:-7px;}}"]),P=Object(b.css)(["padding:2px;line-height:",";margin-bottom:0;font-size:10px;text-align:center;vertical-align:middle;border-radius:2px;cursor:pointer;"],"18px"),I=v()(C.a).withConfig({displayName:"SwitchStyles__StyledCheckboxClickable",componentId:"sc-844ieu-2"})(["",";",";",""],M("Checkbox"),P,(function(e){return Object(p.variable)("Switch","Checkbox","hasBackground")(e)&&L})),R=I.withComponent("span"),D=v.a.div.withConfig({displayName:"SwitchStyles__StyledSome",componentId:"sc-844ieu-3"})(["display:block;margin:2px;height:calc("," - 10px);width:calc("," - 10px);background:currentColor;border-radius:1px;"],"18px","18px"),N=v.a.div.withConfig({displayName:"SwitchStyles__StyledIndicator",componentId:"sc-844ieu-4"})(["background-color:",";border-color:",";box-sizing:border-box;border-radius:50%;height:",";height:",";width:",";width:",";margin:",";position:absolute;left:-1px;top:-1px;transition:left ",";[data-selected='true'] &{left:calc(100% - "," + 1px);}"],Object(p.variable)("Switch","Toggle","indicatorBackgroundColor"),Object(p.variable)("Switch","Toggle","indicatorBorderColor"),"18px",Object(p.variable)("Switch","Toggle","indicatorSize"),"18px",Object(p.variable)("Switch","Toggle","indicatorSize"),Object(p.variable)("Switch","Toggle","indicatorMargin"),(function(e){return e.delay}),"18px"),B=v.a.div.withConfig({displayName:"SwitchStyles__StyledToggleOutline",componentId:"sc-844ieu-5"})(["position:absolute;border:1px solid transparent;transition:border-color ",";border-radius:calc("," * 0.5);border-radius:",";top:-1px;right:-1px;bottom:-1px;left:-1px;z-index:1;margin:",";"],(function(e){return e.delay}),"18px",Object(p.variable)("Switch","Toggle","outlineBorderRadius"),Object(p.variable)("Switch","Toggle","outlineMargin")),F=Object(p.variable)("Switch","Toggle","shadow"),j=v()(C.a).withConfig({displayName:"SwitchStyles__StyledToggleClickable",componentId:"sc-844ieu-6"})(["position:relative;width:calc("," * 2);width:",";height:",";background-color:",";border-radius:calc("," * 0.5);transition:background-color ",";flex:0 0 auto;top:",";&:not([disabled]){border:",";border-color:",";box-shadow:",";","{background-color:",";box-shadow:",";border-width:1px;border-style:",";border-radius:50%;}&:hover ","{background-color:",";}&:hover ","{background-color:",";&:focus ","{background:",";}}&:focus ","{background:",";}}&[disabled]{border:1px solid ",";box-shadow:inset 0 2px 0 rgba(0,0,0,0.06);background-color:",";","{background-color:",";border-color:",";border-width:1px;border-style:solid;}}&[data-selected='true']{background-color:",";border-color:",";box-shadow:",";&[disabled]{background-color:",";border-color:transparent;","{background-color:",";}}}[data-error] > &:not([disabled]){background-color:",";}[data-error] > &:not([disabled]) > ","{border-color:",";}&:focus:not([disabled]){outline:0;box-shadow:",";> ","{border-color:",";border-color:",";}}"],"18px",Object(p.variable)("Switch","Toggle","width"),"18px",Object(p.variable)("Switch","Toggle","backgroundColor"),"18px",(function(e){return e.delay}),Object(p.variable)("Switch","Toggle","top"),Object(p.variable)("border"),Object(p.variable)("Switch","Toggle","borderColor"),F,N,Object(p.variable)("Switch","Toggle","indicatorBackgroundColor"),Object(p.variable)("Switch","Toggle","toggleIndicatorShadowOff"),Object(p.variable)("Switch","Toggle","toggleIndicatorBorderStyle"),N,Object(p.variable)("Switch","Toggle","indicatorHoverBackgroundColor"),B,Object(p.variable)("Switch","Toggle","outlineHoverBackgroundColor"),B,Object(p.variable)("Switch","Toggle","outlineHoverBackgroundColor"),B,Object(p.variable)("Switch","Toggle","outlineHoverBackgroundColor"),Object(p.variable)("Switch","Toggle","disabledBorderColor"),Object(p.variable)("Switch","Toggle","disabledBackgroundColor"),N,Object(p.variable)("Switch","Toggle","disabledIndBackgroundColor"),Object(p.variable)("Switch","Toggle","disabledIndBorderColor"),Object(p.variable)("Switch","Toggle","selectedBackgroundColor"),Object(p.variable)("Switch","Toggle","selectedBorderColor"),Object(p.variable)("Switch","Toggle","toggleIndicatorShadowOn"),Object(p.variable)("Switch","Toggle","selectedDisabledBackgroundColor"),N,Object(p.variable)("Switch","Toggle","selectedDisabledIndBackgroundColor"),Object(p.variable)("Switch","Toggle","errorToggleBackgroundColor"),B,Object(p.variable)("Switch","Toggle","errorToggleOutlineBorderColor"),Object(p.variable)("Switch","Toggle","toggleFocusShadow"),B,(function(e){return w()(Object(p.variable)("focusColor")(e)).setAlpha(.8).toRgbString()}),Object(p.variable)("Switch","Toggle","toggleFocusBorderColor")),z=j.withComponent("span"),H=v.a.label.withConfig({displayName:"SwitchStyles__StyledLabel",componentId:"sc-844ieu-7"})(["",";flex:1 1 auto;padding-left:",";color:inherit;&:not([data-disabled='true']){cursor:pointer;}&[data-size='small']{font-size:",";padding-top:1px;position:",";top:",";}"],Object(p.mixin)("reset")("inline-block"),Object(p.variable)("Switch","labelPaddingLeft"),Object(p.variable)("fontSizeSmall"),Object(p.variable)("Switch","labelPosition"),Object(p.variable)("Switch","labelShiftWithSmall"));function V(e){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function $(){return($=Object.assign||function(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function U(e){return(U=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Y(e,t){for(var n=0;nc-n.bottom?"above":"below":"horizontal"===o&&(p=n.left>d-n.right?"left":"right");var f=function(e){var t=e.align,n=e.anchorPos,i=e.outerContainerEl,r=e.padding;switch(e.placement){case"above":return{top:n.top-i.offsetHeight,left:"edge"===t?n.left-r:n.middle-i.offsetWidth/2};case"below":return{top:n.bottom,left:"edge"===t?n.left-r:n.middle-i.offsetWidth/2};case"left":return{top:"edge"===t?n.top-r:n.center-i.offsetHeight/2,left:n.left-i.offsetWidth};case"right":return{top:"edge"===t?n.top-r:n.center-i.offsetHeight/2,left:n.right};default:return{}}}({align:t,anchorPos:n,outerContainerEl:a,padding:s,placement:p}),m=f.top,g=f.left,b="auto",v=d,y=c,x=n.top-a.offsetHeight>0,k=n.bottom+a.offsetHeight0,_=n.right+a.offsetWidthd,T=("edge"===t?n.left-s:n.middle-a.offsetWidth/2)<0,A=("edge"===t?n.top-s:n.top-a.offsetHeight/2)<0,O=("edge"===t?n.top+a.offsetHeight-s:n.bottom+a.offsetHeight/2)>c;if("above"===p){if(!x&&h){if(k)return S(w({},e,{placement:"below"}));if(u&&_)return S(w({},e,{placement:"right"}));if(u&&C)return S(w({},e,{placement:"left"}));r&&(p="misaligned",m=0)}"misaligned"!==p&&(b=c-m-a.offsetHeight,i&&(b=Math.min(b,c-i.top)),m="auto"),M?g=Math.max(d-a.offsetWidth,0):T&&(g=0),r||(y=n.top)}if("below"===p){if(!k&&h){if(x)return S(w({},e,{placement:"above"}));if(u&&_)return S(w({},e,{placement:"right"}));if(u&&C)return S(w({},e,{placement:"left"}));r&&(p="misaligned",m=0)}i&&(m=Math.min(m,i.bottom)),M?g=Math.max(d-a.offsetWidth,0):T&&(g=0),r||(y=c-n.bottom)}if("left"===p){if(!C&&h){if(_)return S(w({},e,{placement:"right"}));if(u&&k)return S(w({},e,{placement:"below"}));if(u&&x)return S(w({},e,{placement:"above"}));r&&(p="misaligned",m=0)}A?m=0:O&&(m=Math.max(c-a.offsetHeight,0)),r||(v=n.left)}if("right"===p){if(!_&&h){if(C)return S(w({},e,{placement:"left"}));if(u&&k)return S(w({},e,{placement:"below"}));if(u&&x)return S(w({},e,{placement:"above"}));r&&(p="misaligned",m=0)}A?m=0:O&&(m=Math.max(c-a.offsetHeight,0)),r||(v=d-n.left)}return{placement:p,maxHeight:y,maxWidth:v,outerContainerStyle:{top:m,left:g,bottom:b}}}var k=function(e){return"".concat(Object(y.variable)("Popover","arrowHeightPixel")(e),"px")},C=p.a.div.withConfig({displayName:"PopoverStyles__Styled",componentId:"sc-1nahsvw-0"})(["position:fixed;z-index:",";left:-300%;top:-300%;pointer-events:",";"],Object(y.variable)("zindexPopover"),(function(e){return e.pointer?"auto":"none"})),_=p.a.div.withConfig({displayName:"PopoverStyles__StyledBoxWrapper",componentId:"sc-1nahsvw-1"})(["",";padding:",";pointer-events:inherit;"],Object(y.mixin)("reset")("block"),(function(e){return"".concat(Object(y.variable)("Popover","paddingPixel")(e),"px")})),M=p.a.div.withConfig({displayName:"PopoverStyles__StyledBox",componentId:"sc-1nahsvw-2"})(["",";background-color:transparent;pointer-events:inherit;"],Object(y.mixin)("reset")("block")),T=p()(M).withConfig({displayName:"PopoverStyles__StyledLight",componentId:"sc-1nahsvw-3"})(["background-color:",";color:",";border:",";box-shadow:",";border-radius:",";"],Object(y.variable)("Popover","lightBackgroundColor"),Object(y.variable)("Popover","lightColor"),Object(y.variable)("Popover","lightBorder"),Object(y.variable)("Popover","lightBoxShadow"),Object(y.variable)("Popover","lightBorderRadius")),A=p()(M).withConfig({displayName:"PopoverStyles__StyledDark",componentId:"sc-1nahsvw-4"})(["background-color:",";color:",";border-radius:",";"],Object(y.variable)("Popover","darkBackgroundColor"),Object(y.variable)("Popover","darkColor"),Object(y.variable)("Popover","darkBorderRadius")),O=Object(h.css)(["width:0;height:0;border-left:"," solid transparent;border-right:"," solid transparent;position:absolute;border-bottom:"," solid ",";@media all and (-ms-high-contrast:none){opacity:inherit;}"],k,k,k,Object(y.variable)("Popover","arrowBorderBottomColor")),E=p.a.div.withConfig({displayName:"PopoverStyles__StyledLightArrow",componentId:"sc-1nahsvw-5"})(["",";&::before{content:'';display:block;width:0;height:0;border-left:"," solid transparent;border-right:"," solid transparent;border-bottom:"," solid ",";position:absolute;top:1px;left:0;margin-left:-",";}"],O,k,k,k,Object(y.variable)("backgroundColor"),k),L=p.a.div.withConfig({displayName:"PopoverStyles__StyledDarkArrow",componentId:"sc-1nahsvw-6"})(["",";border-bottom-color:",";"],O,Object(y.variable)("Popover","darkArrowBorderBottomColor")),P=p.a.div.withConfig({displayName:"PopoverStyles__StyledLowerRightCorner",componentId:"sc-1nahsvw-7"})(["position:fixed;right:0;bottom:0;"]);function I(e){return(I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function R(){return(R=Object.assign||function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:1;return!!e&&!!t&&Object(u.every)(e,(function(e,i){return Object(u.isFinite)(e)?Math.abs(t[i]-e)<=n:t[i]===e}))}var Y=function(e){function t(e){var n,i;B(this,t);for(var o=arguments.length,a=new Array(o>1?o-1:0),l=1;lwindow.innerHeight||e.left<0||e.left>window.innerWidth||!(!t||!(e.height+e.topt.bottom||e.width+e.leftt.right)))&&(this.requestClose({reason:"offScreen"}),!0)}},{key:"requestClose",value:function(e){Object(u.includes)(this.props.closeReasons,e.reason)&&this.props.onRequestClose(e)}},{key:"render",value:function(){var e=this.props.open||this.state.animating;return[r.a.createElement(c.a,{target:this.props.scrollContainer||"window",onScroll:this.handleScroll,onResize:this.setPlacement,key:"eventListener"}),r.a.createElement(g.a,{closeReasons:Object(u.intersection)(this.props.closeReasons,g.a.possibleCloseReasons),open:e,onRequestClose:this.handleRequestClose,key:"Layer"},e&&this.renderLayer())]}}]),t}(i.Component);W(Y,"possibleCloseReasons",["clickAway","escapeKey","offScreen"]),W(Y,"propTypes",{align:a.a.oneOf(["center","edge","theme"]),anchor:function(e){if(e.open){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r=this.props.rowsMin){var c=this.props.rowsMax*i+r+o+a+s+1;l=Math.min(c,l)}var d=this.props.rowsMin*i+r+o+a+s+1;l=Math.max(d,l),this.state.height!==l&&this.setState({height:l})}}var x=n(85),S=n.n(x),k=n(9),C=n.n(k),_=f()(C.a).withConfig({displayName:"TextStyles__StyledBox",componentId:"eg7n6t-0"})(["flex-grow:1;flex-shrink:1;position:relative;&[data-inline]{width:230px;flex-basis:230px;[data-inline] + &{margin-left:",";}}&[data-size='small']{font-size:",";}&[data-size='large']{font-size:",";line-height:",";}"],Object(m.variable)("spacingHalf"),Object(m.variable)("fontSizeSmall"),Object(m.variable)("fontSizeLarge"),Object(m.variable)("lineHeight")),M=function(e,t,n){return Object(p.css)(["",":",";"],e,(function(e){var i=e.customStyle,r=i&&i["padding".concat(S()(t))]||"0px";return r?Object(p.css)(["calc("," + ",")"],n,r):n}))},T=Object(p.css)(["",";"],M("padding-left","left",Object(m.variable)("Text","searchIconPaddingLeft"))),A=Object(p.css)(["",";[data-size='small'] > &{",";}[data-size='large'] > &{",";}"],M("padding-right","right",Object(m.variable)("Text","inputClearOrSearchPaddingRight")),M("padding-right","right","24px"),M("padding-right","right","36px")),O=f.a.input.withConfig({displayName:"TextStyles__StyledInputInput",componentId:"eg7n6t-1"})(["&,&[type]{box-sizing:border-box;display:block;margin:0;line-height:inherit;height:inherit;color:",";border-radius:",";background-color:",";border:",";border-color:",";font-size:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);width:100%;padding-top:",";",";padding-bottom:",";",";min-height:",";font-family:",";position:relative;[data-size='small'] > &{padding-top:3px;",";padding-bottom:3px;",";min-height:",";}[data-size='large'] > &{padding-top:8px;",";padding-bottom:8px;",";min-height:",";}&[data-append]{margin-right:-1px;border-top-right-radius:0;border-bottom-right-radius:0;border-right:none;}&[data-prepend]{border-top-left-radius:0;border-bottom-left-radius:0;}&:focus:not([disabled]){border-color:",";box-shadow:",";color:",";outline:0;border-collapse:separate;z-index:1;&[data-can-clear]{",";}}&[data-error]{border-color:",";color:",";}&::-ms-clear{display:none;width:0;height:0;}&::placeholder{color:",";opacity:1;}}textarea&{resize:none;overflow:auto;}"],Object(m.variable)("Text","inputColor"),Object(m.variable)("borderRadius"),Object(m.variable)("Text","inputBackgroundColor"),Object(m.variable)("border"),Object(m.variable)("Text","inputBorderColor"),Object(m.variable)("Text","spacingQuarter"),M("padding-right","right",Object(m.variable)("Text","spacingHalf")),Object(m.variable)("Text","spacingQuarter"),M("padding-left","left",Object(m.variable)("Text","spacingHalf")),Object(m.variable)("inputHeight"),Object(m.variable)("sansFontFamily"),M("padding-right","right",Object(m.variable)("spacingQuarter")),M("padding-left","left",Object(m.variable)("spacingQuarter")),Object(m.variable)("inputHeightSmall"),M("padding-right","right","11px"),M("padding-left","left","11px"),Object(m.variable)("inputHeightLarge"),Object(m.variable)("Text","inputFocusBorderColor"),Object(m.variable)("Text","inputFocusShadow"),Object(m.variable)("Text","inputFocusColor"),A,Object(m.variable)("Text","inputErrorBorderColor"),Object(m.variable)("Text","inputErrorColor"),Object(m.variable)("textGray")),E=O.withComponent("textarea"),L=f()(O).withConfig({displayName:"TextStyles__StyledInputSearchInput",componentId:"eg7n6t-2"})(["&,&[type]{",";",";}"],A,T),P=f()(E).withConfig({displayName:"TextStyles__StyledInputSearchTextarea",componentId:"eg7n6t-3"})(["&,&[type]{",";",";}"],A,T),I=Object(p.css)(["&,&[type]{color:",";background-color:",";border-color:",";box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);cursor:not-allowed;",";}"],Object(m.variable)("Text","inputDisabledColor"),Object(m.variable)("Text","inputDisabledBackgroundColor"),Object(m.variable)("Text","inputDisabledBorderColor"),(function(e){return e.renderSearchIcon&&T})),R=f()(E).withConfig({displayName:"TextStyles__StyledInputDisabledTextarea",componentId:"eg7n6t-4"})(["&,&[type]{",";}"],I),D=f()(O).withConfig({displayName:"TextStyles__StyledInputDisabledInput",componentId:"eg7n6t-5"})(["&,&[type]{",";}"],I),N=f.a.span.withConfig({displayName:"TextStyles__StyledSearchIconWrapper",componentId:"eg7n6t-6"})(["color:",";position:absolute;z-index:1;[data-size='small'] > &{right:6px;top:6px;}[data-size='medium'] > &{"," top:",";&[disabled]{color:",";}}[data-size='large'] > &{",";top:11px;}"],Object(m.variable)("Text","searchIconWrapperColor"),(function(e){var t=Object(m.variable)("Text","searchIconPosition")(e);return M(Object(m.variable)("Text","searchIconPosition"),t,Object(m.variable)("Text","searchIconWrapperRight"))}),Object(m.variable)("Text","searchIconWrapperTop"),Object(m.variable)("Text","disabledSearchIconColor"),M("right","right","11px")),B=f.a.span.withConfig({displayName:"TextStyles__StyledClear",componentId:"eg7n6t-7"})(["",";position:absolute;",";top:",";font-size:0.83333em;color:",";cursor:pointer;z-index:1;[data-size='small'] > &{padding:7px;}[data-size='medium'] > &{padding:",";}[data-size='large'] > &{padding:11px;}"],Object(m.mixin)("reset")("inline"),M("right","right",Object(m.variable)("Text","clearIconRight")),Object(m.variable)("Text","clearIconTop"),Object(m.variable)("Text","clearColor"),Object(m.variable)("Text","clearIconPadding")),F=f.a.span.withConfig({displayName:"TextStyles__StyledPlaceholder",componentId:"eg7n6t-8"})(["color:",";position:absolute;max-width:100%;font-size:inherit;line-height:inherit;z-index:1;[data-size='small'] > &{top:5px;",";}[data-size='medium'] > &{top:7px;",";}[data-size='large'] > &{top:10px;",";}"],Object(m.variable)("Text","placeholderColor"),M("left","left","7px"),(function(e){return e.renderSearchIcon?M("left","left",Object(m.variable)("Text","placeholderWithSearchLeft")):M("left","left",Object(m.variable)("Text","placeholderMediumSize"))}),M("left","left","12px"));function j(e){return(j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function z(){return(z=Object.assign||function(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function W(e){return(W=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function U(e,t){for(var n=0;n=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function w(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x(e,t){for(var n=0;n &{color:inherit;}"],Object(b.variable)("fontSizeSmall"),Object(b.variable)("ControlGroup","helpColor"));function k(e){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function C(){return(C=Object.assign||function(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function M(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);i=!0);}catch(e){r=!0,o=e}finally{try{i||null==s.return||s.return()}finally{if(r)throw o}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function T(e,t){for(var n=0;n0&&(r.prepend=!0),a("append")&&n1&&(r.inline=!0),"stack"===o&&a("inline")&&(r.inline=!1),a("labelledBy")&&(r.labelledBy=e.labelId),a("describedBy")&&e.props.help&&(r.describedBy=e.helpId),a("labelText")&&(r.labelText=p),1!==O||"fillJoin"!==o&&"fill"!==o||(r.style=t.props.style?Object(s.clone)(t.props.style):{},r.style.flexGrow=1),!m&&t&&(e.hasInputId(t)?r.inputId=t.props.inputId||Object(l.createDOMID)("id"):r.id=t.props.id||Object(l.createDOMID)("id")),Object(i.cloneElement)(t,r)})),P=this.getLinkedId(L);a&&(E["aria-invalid"]=!0);var I="left"===g?{width:b}:null,R=Object(s.isFinite)(b)?"".concat(b,"px"):b,D="left"===g?{marginLeft:"calc(".concat(R," + 20px)")}:null,N="stack"===o?y:d.a,B="left"===g?x:w,F=r.a.createElement(B,{"data-size":k,"data-test":"label",id:this.labelId,htmlFor:m||P,style:I,tooltip:M},p,!u&&M&&" ",!u&&M&&r.a.createElement(f.a,{content:M}));return r.a.createElement(v,C({"data-test":"control-group"},E),u?r.a.createElement(h.a,null,F):F,r.a.createElement(N,{"data-test":"controls",flex:"none"!==o,style:D},L),c&&r.a.createElement(S,{"data-test":"help",id:this.helpId,style:D},c))}}])&&T(n.prototype,o),a&&T(n,a),t}(i.Component);L(P,"propTypes",{children:a.a.node,controlsLayout:a.a.oneOf(["fill","fillJoin","none","stack"]),elementRef:a.a.func,error:a.a.bool,help:a.a.node,hideLabel:a.a.bool,label:a.a.string.isRequired,labelFor:a.a.string,labelPosition:a.a.oneOf(["left","top"]),labelWidth:a.a.oneOfType([a.a.number,a.a.string]),size:a.a.oneOf(["small","medium"]),tooltip:a.a.node}),L(P,"defaultProps",{controlsLayout:"fill",error:!1,hideLabel:!1,labelPosition:"left",labelWidth:120,size:"medium"});var I=P;n.d(t,"default",(function(){return I}))},2:function(e,t){e.exports=n(0)},26:function(e,t){e.exports=n(146)},3:function(e,t){e.exports=n(7)},5:function(e,t){e.exports=n(6)},9:function(e,t){e.exports=n(32)}})},112:function(e,t,n){(t=e.exports=n(1)(!1)).push([e.i,'/*************************************************************************************************/\n/* BRAND COLORS */\n/* DO NOT USE DIRECTLY! Use $brandColor instead. See brand.*.pcss for definitions. */\n/*************************************************************************************************/\n/* Green Splunk Enterprise */\n/* Orange Splunk Lite */\n/* Brand colors */\n/*===============================================================================================*/\n/* SPLUNK: VARIABLES */\n/* Variables to customize the look and feel of Bootstrap (splunk version). */\n/* See /en-US/static/docs/style/style-guide.html for style guide */\n/*===============================================================================================*/\n/*===============================================================================================*/\n/* WARNING */\n/* This file has an implicit dependency on the brand variables injected by the */\n/* \'splunk-postcss-theme-import\' postcss plugin. */\n/*===============================================================================================*/\n/*===============================================================================================*/\n/* SPLUNK: COLORS */\n/*===============================================================================================*/\n/*************************************************************************************************/\n/* NEUTRAL COLORS */\n/* */\n/* PRE IVORY -> CURRENT VARIABLE */\n/* $black -> $black */\n/* $grayDarker -> $gray20 */\n/* $grayDark -> $gray30 */\n/* $gray -> $gray45 */\n/* $grayLight -> $gray60 */\n/* $grayLightMedium -> $gray80 */\n/* $grayLighter -> $gray92 */\n/* $gray96 */\n/* $offWhite -> $gray98 */\n/* $white -> $white */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* SEMANTIC COLORS */\n/* */\n/* PRE IVORY -> CURRENT VARIABLE */\n/* $red -> $errorColor */\n/* $orange -> $alertColor */\n/* $yellow -> $warningColor */\n/* $yellowLight -> $warningColorL20 */\n/* $yellowLighter -> $warningColorL40 */\n/* $green -> $successColor */\n/* $blue -> $infoColor */\n/* $blueDark -> $infoColorD40 */\n/* $pink -> No Equivalent or $errorColorL30 */\n/* $purple -> No Equivalent */\n/* $teal -> No Equivalent */\n/* $focusColor -> $accentColorL10 */\n/*************************************************************************************************/\n/* Blue Accent */\n/* Red Error */\n/* Orange Alert */\n/* Yellow Warning */\n/* Green Success */\n/* Blue Info */\n/*************************************************************************************************/\n/* CATEGORICAL COLORS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* DIVERGING COLORS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* STATIC PATHS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* TYPOGRAPHY */\n/*************************************************************************************************/\n/* Lite listing pages */\n/* empty to use BS default, $fontFamily */\n/* instead of browser default, bold */\n/*************************************************************************************************/\n/* SCAFFOLDING */\n/*************************************************************************************************/\n/* Border Colors */\n/* aliases: $tableBorderColor $tableBorderColorVertical */\n/* also see: $interactiveBorderColor */\n/* Borders */\n/* Border Radius */\n/* For containers without a wrapper */\n/* For for containers with a wrapper, like popdown */\n/* Padding & Margin */\n/* 200% - 40px */\n/* 150% - 30px */\n/* 75% - 15px */\n/* 50% - 10px */\n/* 25% - 5px */\n/* Popdown Arrows */\n/* Large Icons */\n/*************************************************************************************************/\n/* TRANSITIONS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* HORIZONTAL FORMS & LISTS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Z-INDEX */\n/*************************************************************************************************/\n/* If a variable does not suit your purpose, set a value relatively such as, $zindexModal +1 */\n/* Splunk Lite */\n/* Splunk Lite */\n/* Sidebar Component */\n/* Sidebar Component */\n/* timerange popdown needs to be above modal + backdrop */\n/* top interactive element */\n/* top interactive element */\n/* top uninteractive */\n/* top uninteractive */\n/*************************************************************************************************/\n/* TABLES */\n/*************************************************************************************************/\n/* overall background-color */\n/*************************************************************************************************/\n/* FORMS */\n/*************************************************************************************************/\n/* base input height + 10px vertical padding + 2px top/bottom border */\n/* This is generally overridden. */\n/*************************************************************************************************/\n/* MODAL */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* POPUP */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* TABS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* MENU */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* BASE INTERACTIVE */\n/*************************************************************************************************/\n/* text */\n/* background */\n/* borders */\n/* shadow */\n/*************************************************************************************************/\n/* BASE INTERACTIVE ERROR */\n/*************************************************************************************************/\n/* text */\n/* background */\n/*************************************************************************************************/\n/* BUTTONS */\n/*************************************************************************************************/\n/* 1 rem */\n/*************************************************************************************************/\n/* PRIMARY BUTTONS */\n/*************************************************************************************************/\n/* text */\n/* background */\n/* borders */\n/* shadow */\n/*************************************************************************************************/\n/* PILL BUTTONS */\n/*************************************************************************************************/\n/* text */\n/* background */\n/*************************************************************************************************/\n/* COMPONENT VARIABLES */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* NAVBAR */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* APP BAR */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* ACCORDION */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* CONCERTINA */\n/* Concertina has the same color as Accordion, maybe we should just reuse them? */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* TOOLTIPS & POPOVERS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* SELECTORS FOR CUSTOMIZING SPECIFIC LOCALES */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* DASHBOARDS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* VIZ & VIZ PICKERS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* MAPS */\n/*************************************************************************************************/\n/* leaflet popup defaults */\n/*************************************************************************************************/\n/* Search IDE */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Date Picker */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Time Range Picker */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Events Viewer */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Misc */\n/*************************************************************************************************/\n/*===============================================================================================*/\n/* SPLUNK: MIXINS */\n/* Snippets of reusable CSS to develop faster and keep code readable */\n/*===============================================================================================*/\n/* Reset */\n/* ------------------ */\n/* Link */\n/* ------------------ */\n/*************************************************************************************************/\n/* FOCUS STATES */\n/*************************************************************************************************/\n/* Use when are outer focus glow will be block (i.e Menu Items). Provide background color.*/\n/* Block elements change the background color */\n/* Block elements change the background color and spread via box-shadow */\n/*************************************************************************************************/\n/* INTERACTIVE */\n/* These are by any element that can be clicked, such as buttons, menus and table headings. */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Interactive style: */\n/* @params: */\n/* Background Color */\n/* Border Color */\n/* Box Shadow */\n/* Text Color */\n/* Transition */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Primary interactive style: */\n/* @params: */\n/* Background Color */\n/* Box Shadow */\n/* Text Color */\n/* Transition */\n/*----------------------------------------------*/\n/*************************************************************************************************/\n/* INTERACTIVE ERROR */\n/* These are by any interactive element that is is in an error state. */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* BUTTONS */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Pills, Links */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Define states of buttons: */\n/* :hover, :active, disabled and :focus */\n/* @params: */\n/* Hover Mixin */\n/* Active Mixin */\n/* Disabled Mixin */\n/* Focus Mixin */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Button Padding: */\n/* @params: */\n/* Vertical Padding */\n/* Horizontal Padding */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Primary Button Padding: */\n/* @params: */\n/* Vertical Padding */\n/* Horizontal Padding */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Button Padding For Other Button Sizes: */\n/* @params: */\n/* Vertical Padding */\n/* Horizontal Padding */\n/* Button Icon Margin Top */\n/*----------------------------------------------*/\n/* Draggable Handle */\n/*************************************************************************************************/\n/* FONTS */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Define Font Family: */\n/* @params: */\n/* Font Name */\n/* Name of Font File */\n/* Font Format */\n/* Font Weight */\n/* Font Style */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Create a heading */\n/* @params: */\n/* Font Size */\n/* Margin */\n/* Font Color */\n/* Text Transform */\n/*----------------------------------------------*/\n/*************************************************************************************************/\n/* UTILITY MIXINS */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Clearfix: */\n/* For clearing floats like a boss h5bp.com/q */\n/*----------------------------------------------*/\n/* Placeholder text */\n/* Basic input styles */\n/* Sets Modal width and margin */\n/* Define card style. Add white background and shadow. */\n/* Workaround for table shadows in IE. Don\'t use this mixin, use create-card-table */\n/* Define card style on tables. Adds workaround for IE */\n/* Cover browser specific radio button with styled radio button. */\n/* Can only be used if label comes immediately after input[type=radio] */\n/* Use to cover button in .radio class */\n/*-------------------------------------------------------------------------*/\n/* CSS image replacement */\n/* For clearing floats like a boss h5bp.com/q */\n/* Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 */\n/*-------------------------------------------------------------------------*/\n/*************************************************************************************************/\n/* ICONS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* FORMS */\n/*************************************************************************************************/\n/* Block level inputs */\n/*************************************************************************************************/\n/* COMPONENT MIXINS */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Horizontal Dividers: */\n/* Dividers (basically an hr) within dropdowns */\n/* and nav lists. */\n/* @params: */\n/* Border Color */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Navbar Vertical Align: */\n/* Vertically center elements in the navbar. */\n/* Example: an element has a height of 30px, */\n/* so write out `.navbarVerticalAlign(30px);` */\n/* to calculate the appropriate top margin. */\n/* @params: */\n/* Element Height */\n/*----------------------------------------------*/\n/*************************************************************************************************/\n/* PRINTING */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* POPDOWN */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Arrow: */\n/* Create an arrow. */\n/* @params: */\n/* Arrow Direction (up, down, left, right) */\n/* Arrow Color */\n/* Arrow Size */\n/*----------------------------------------------*/\n/* popdown body */\n/*************************************************************************************************/\n/* FULL PAGE LAYOUT */\n/*************************************************************************************************/\n/* Splunk Bar */\n/* ======================= */\n/* Main Container */\n.view---enterprise---dev---3vAb4 {\n -webkit-animation: none 0s ease 0s 1 normal none running;\n animation: none 0s ease 0s 1 normal none running;\n -webkit-backface-visibility: visible;\n backface-visibility: visible;\n background: transparent none repeat 0 0 / auto auto padding-box border-box scroll;\n border: medium none currentColor;\n border-collapse: separate;\n -o-border-image: none;\n border-image: none;\n border-radius: 0;\n border-spacing: 0;\n bottom: auto;\n -webkit-box-shadow: none;\n box-shadow: none;\n -webkit-box-sizing: content-box;\n box-sizing: content-box;\n caption-side: top;\n clear: none;\n clip: auto;\n color: #000;\n -webkit-columns: auto;\n -moz-columns: auto;\n columns: auto;\n -webkit-column-count: auto;\n -moz-column-count: auto;\n column-count: auto;\n -webkit-column-fill: balance;\n -moz-column-fill: balance;\n column-fill: balance;\n -webkit-column-gap: normal;\n -moz-column-gap: normal;\n column-gap: normal;\n -webkit-column-rule: medium none currentColor;\n -moz-column-rule: medium none currentColor;\n column-rule: medium none currentColor;\n -webkit-column-span: 1;\n -moz-column-span: 1;\n column-span: 1;\n -webkit-column-width: auto;\n -moz-column-width: auto;\n column-width: auto;\n content: normal;\n counter-increment: none;\n counter-reset: none;\n cursor: auto;\n direction: ltr;\n display: inline;\n empty-cells: show;\n float: none;\n font-family: serif;\n font-size: medium;\n font-style: normal;\n font-variant: normal;\n font-weight: normal;\n font-stretch: normal;\n line-height: normal;\n height: auto;\n -webkit-hyphens: none;\n -ms-hyphens: none;\n hyphens: none;\n left: auto;\n letter-spacing: normal;\n list-style: disc outside none;\n margin: 0;\n max-height: none;\n max-width: none;\n min-height: 0;\n min-width: 0;\n opacity: 1;\n orphans: 2;\n outline: medium none invert;\n overflow: visible;\n overflow-x: visible;\n overflow-y: visible;\n padding: 0;\n page-break-after: auto;\n page-break-before: auto;\n page-break-inside: auto;\n -webkit-perspective: none;\n perspective: none;\n -webkit-perspective-origin: 50% 50%;\n perspective-origin: 50% 50%;\n position: static;\n right: auto;\n -moz-tab-size: 8;\n -o-tab-size: 8;\n tab-size: 8;\n table-layout: auto;\n text-align: left;\n -moz-text-align-last: auto;\n text-align-last: auto;\n text-decoration: none;\n text-indent: 0;\n text-shadow: none;\n text-transform: none;\n top: auto;\n -webkit-transform: none;\n transform: none;\n -webkit-transform-origin: 50% 50% 0;\n transform-origin: 50% 50% 0;\n -webkit-transform-style: flat;\n transform-style: flat;\n -webkit-transition: none 0s ease 0s;\n transition: none 0s ease 0s;\n unicode-bidi: normal;\n vertical-align: baseline;\n visibility: visible;\n white-space: normal;\n widows: 2;\n width: auto;\n word-spacing: normal;\n z-index: auto;\n display: block;\n min-width:750px;\n height: 34px;\n color: #C3CBD4;\n position:relative;\n margin-bottom: 0;\n background: #171D21;\n font-size: 14px;\n font-family: "Splunk Platform Sans", "Proxima Nova", Roboto, Droid, "Helvetica Neue", Helvetica, Arial, sans-serif;\n line-height: 34px;\n}\n.navBar---enterprise---dev---rJMiE {\n height: 34px;\n line-height: 34px;\n background: #171D21;\n}\n.devTest---enterprise---dev---vtAzY {\n line-height: 25px;\n padding: 2px 10px;\n border-radius: 10px;\n background-color: #F1813F;\n color: #FFFFFF;\n text-transform: uppercase;\n}\n/* Nav */\n.nav---enterprise---dev---1y28g {\n float: left;\n margin: 0;\n padding: 0;\n list-style: none;\n white-space: no-wrap;\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -ms-flex-direction: row;\n flex-direction: row;\n height: inherit;\n line-height: inherit;\n}\n.navRight---enterprise---dev---2r9Nw {\n float: right;\n height: inherit;\n line-height: inherit;\n}\n/* Nav Logo */\n.brand---enterprise---dev---3Kw3W {\n line-height: inherit;\n height: inherit;\n white-space: nowrap;\n display: block;\n color: #FFFFFF;\n padding: 0 20px;\n font-size: 18px;\n float: left;\n text-decoration: none;\n text-rendering: geometricPrecision;\n -webkit-backface-visibility: hidden;\n backface-visibility: hidden;\n}\n.brand---enterprise---dev---3Kw3W:focus {\n -webkit-box-shadow: none;\n box-shadow: none;\n border-collapse: separate;\n /* Fix IE9 Issue with box-shadow */\n outline: 0;\n text-decoration: none;\n }\n.brand---enterprise---dev---3Kw3W:focus:active:not([disabled]) {\n -webkit-box-shadow: none;\n box-shadow: none;\n }\n.brand---enterprise---dev---3Kw3W:focus {\n -webkit-box-shadow: inset 0 0 2px 1px #171D21, inset 0 0 0 2px #00A4FD;\n box-shadow: inset 0 0 2px 1px #171D21, inset 0 0 0 2px #00A4FD;\n color: #FFFFFF;\n background: #171D21;\n outline: none;\n}\n.brand---enterprise---dev---3Kw3W > [data-icon] {\n color: #FFFFFF;\n }\n.gt---enterprise---dev---1FiWZ, .logo---enterprise---dev---3hEOu {\n color: #5CC05C;\n -webkit-transition: text-shadow 0.2s;\n transition: text-shadow 0.2s;\n}\n.icon---enterprise---dev---3m2QC {\n margin-right: 6px;\n vertical-align: middle;\n font-size: 1.4em;\n}\n.productMenuLabelCloud---enterprise---dev---2py8_,\n.helpMenuLabelCloud---enterprise---dev---35h55 {\n display: inline;\n}\n',""]),t.locals={view:"view---enterprise---dev---3vAb4",navBar:"navBar---enterprise---dev---rJMiE",devTest:"devTest---enterprise---dev---vtAzY",nav:"nav---enterprise---dev---1y28g",navRight:"navRight---enterprise---dev---2r9Nw nav---enterprise---dev---1y28g",brand:"brand---enterprise---dev---3Kw3W",gt:"gt---enterprise---dev---1FiWZ",logo:"logo---enterprise---dev---3hEOu",icon:"icon---enterprise---dev---3m2QC",productMenuLabelCloud:"productMenuLabelCloud---enterprise---dev---2py8_",helpMenuLabelCloud:"helpMenuLabelCloud---enterprise---dev---35h55"}},113:function(e,t,n){(t=e.exports=n(1)(!1)).i(n(5),void 0),t.push([e.i,"/*************************************************************************************************/\n/* BRAND COLORS */\n/* DO NOT USE DIRECTLY! Use $brandColor instead. See brand.*.pcss for definitions. */\n/*************************************************************************************************/\n/* Green Splunk Enterprise */\n/* Orange Splunk Lite */\n/* Brand colors */\n/*===============================================================================================*/\n/* SPLUNK: VARIABLES */\n/* Variables to customize the look and feel of Bootstrap (splunk version). */\n/* See /en-US/static/docs/style/style-guide.html for style guide */\n/*===============================================================================================*/\n/*===============================================================================================*/\n/* WARNING */\n/* This file has an implicit dependency on the brand variables injected by the */\n/* 'splunk-postcss-theme-import' postcss plugin. */\n/*===============================================================================================*/\n/*===============================================================================================*/\n/* SPLUNK: COLORS */\n/*===============================================================================================*/\n/*************************************************************************************************/\n/* NEUTRAL COLORS */\n/* */\n/* PRE IVORY -> CURRENT VARIABLE */\n/* $black -> $black */\n/* $grayDarker -> $gray20 */\n/* $grayDark -> $gray30 */\n/* $gray -> $gray45 */\n/* $grayLight -> $gray60 */\n/* $grayLightMedium -> $gray80 */\n/* $grayLighter -> $gray92 */\n/* $gray96 */\n/* $offWhite -> $gray98 */\n/* $white -> $white */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* SEMANTIC COLORS */\n/* */\n/* PRE IVORY -> CURRENT VARIABLE */\n/* $red -> $errorColor */\n/* $orange -> $alertColor */\n/* $yellow -> $warningColor */\n/* $yellowLight -> $warningColorL20 */\n/* $yellowLighter -> $warningColorL40 */\n/* $green -> $successColor */\n/* $blue -> $infoColor */\n/* $blueDark -> $infoColorD40 */\n/* $pink -> No Equivalent or $errorColorL30 */\n/* $purple -> No Equivalent */\n/* $teal -> No Equivalent */\n/* $focusColor -> $accentColorL10 */\n/*************************************************************************************************/\n/* Blue Accent */\n/* Red Error */\n/* Orange Alert */\n/* Yellow Warning */\n/* Green Success */\n/* Blue Info */\n/*************************************************************************************************/\n/* CATEGORICAL COLORS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* DIVERGING COLORS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* STATIC PATHS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* TYPOGRAPHY */\n/*************************************************************************************************/\n/* Lite listing pages */\n/* empty to use BS default, $fontFamily */\n/* instead of browser default, bold */\n/*************************************************************************************************/\n/* SCAFFOLDING */\n/*************************************************************************************************/\n/* Border Colors */\n/* aliases: $tableBorderColor $tableBorderColorVertical */\n/* also see: $interactiveBorderColor */\n/* Borders */\n/* Border Radius */\n/* For containers without a wrapper */\n/* For for containers with a wrapper, like popdown */\n/* Padding & Margin */\n/* 200% - 40px */\n/* 150% - 30px */\n/* 75% - 15px */\n/* 50% - 10px */\n/* 25% - 5px */\n/* Popdown Arrows */\n/* Large Icons */\n/*************************************************************************************************/\n/* TRANSITIONS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* HORIZONTAL FORMS & LISTS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Z-INDEX */\n/*************************************************************************************************/\n/* If a variable does not suit your purpose, set a value relatively such as, $zindexModal +1 */\n/* Splunk Lite */\n/* Splunk Lite */\n/* Sidebar Component */\n/* Sidebar Component */\n/* timerange popdown needs to be above modal + backdrop */\n/* top interactive element */\n/* top interactive element */\n/* top uninteractive */\n/* top uninteractive */\n/*************************************************************************************************/\n/* TABLES */\n/*************************************************************************************************/\n/* overall background-color */\n/*************************************************************************************************/\n/* FORMS */\n/*************************************************************************************************/\n/* base input height + 10px vertical padding + 2px top/bottom border */\n/* This is generally overridden. */\n/*************************************************************************************************/\n/* MODAL */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* POPUP */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* TABS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* MENU */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* BASE INTERACTIVE */\n/*************************************************************************************************/\n/* text */\n/* background */\n/* borders */\n/* shadow */\n/*************************************************************************************************/\n/* BASE INTERACTIVE ERROR */\n/*************************************************************************************************/\n/* text */\n/* background */\n/*************************************************************************************************/\n/* BUTTONS */\n/*************************************************************************************************/\n/* 1 rem */\n/*************************************************************************************************/\n/* PRIMARY BUTTONS */\n/*************************************************************************************************/\n/* text */\n/* background */\n/* borders */\n/* shadow */\n/*************************************************************************************************/\n/* PILL BUTTONS */\n/*************************************************************************************************/\n/* text */\n/* background */\n/*************************************************************************************************/\n/* COMPONENT VARIABLES */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* NAVBAR */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* APP BAR */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* ACCORDION */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* CONCERTINA */\n/* Concertina has the same color as Accordion, maybe we should just reuse them? */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* TOOLTIPS & POPOVERS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* SELECTORS FOR CUSTOMIZING SPECIFIC LOCALES */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* DASHBOARDS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* VIZ & VIZ PICKERS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* MAPS */\n/*************************************************************************************************/\n/* leaflet popup defaults */\n/*************************************************************************************************/\n/* Search IDE */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Date Picker */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Time Range Picker */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Events Viewer */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Misc */\n/*************************************************************************************************/\n/*===============================================================================================*/\n/* SPLUNK: MIXINS */\n/* Snippets of reusable CSS to develop faster and keep code readable */\n/*===============================================================================================*/\n/* Reset */\n/* ------------------ */\n/* Link */\n/* ------------------ */\n/*************************************************************************************************/\n/* FOCUS STATES */\n/*************************************************************************************************/\n/* Use when are outer focus glow will be block (i.e Menu Items). Provide background color.*/\n/* Block elements change the background color */\n/* Block elements change the background color and spread via box-shadow */\n/*************************************************************************************************/\n/* INTERACTIVE */\n/* These are by any element that can be clicked, such as buttons, menus and table headings. */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Interactive style: */\n/* @params: */\n/* Background Color */\n/* Border Color */\n/* Box Shadow */\n/* Text Color */\n/* Transition */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Primary interactive style: */\n/* @params: */\n/* Background Color */\n/* Box Shadow */\n/* Text Color */\n/* Transition */\n/*----------------------------------------------*/\n/*************************************************************************************************/\n/* INTERACTIVE ERROR */\n/* These are by any interactive element that is is in an error state. */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* BUTTONS */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Pills, Links */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Define states of buttons: */\n/* :hover, :active, disabled and :focus */\n/* @params: */\n/* Hover Mixin */\n/* Active Mixin */\n/* Disabled Mixin */\n/* Focus Mixin */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Button Padding: */\n/* @params: */\n/* Vertical Padding */\n/* Horizontal Padding */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Primary Button Padding: */\n/* @params: */\n/* Vertical Padding */\n/* Horizontal Padding */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Button Padding For Other Button Sizes: */\n/* @params: */\n/* Vertical Padding */\n/* Horizontal Padding */\n/* Button Icon Margin Top */\n/*----------------------------------------------*/\n/* Draggable Handle */\n/*************************************************************************************************/\n/* FONTS */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Define Font Family: */\n/* @params: */\n/* Font Name */\n/* Name of Font File */\n/* Font Format */\n/* Font Weight */\n/* Font Style */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Create a heading */\n/* @params: */\n/* Font Size */\n/* Margin */\n/* Font Color */\n/* Text Transform */\n/*----------------------------------------------*/\n/*************************************************************************************************/\n/* UTILITY MIXINS */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Clearfix: */\n/* For clearing floats like a boss h5bp.com/q */\n/*----------------------------------------------*/\n/* Placeholder text */\n/* Basic input styles */\n/* Sets Modal width and margin */\n/* Define card style. Add white background and shadow. */\n/* Workaround for table shadows in IE. Don't use this mixin, use create-card-table */\n/* Define card style on tables. Adds workaround for IE */\n/* Cover browser specific radio button with styled radio button. */\n/* Can only be used if label comes immediately after input[type=radio] */\n/* Use to cover button in .radio class */\n/*-------------------------------------------------------------------------*/\n/* CSS image replacement */\n/* For clearing floats like a boss h5bp.com/q */\n/* Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 */\n/*-------------------------------------------------------------------------*/\n/*************************************************************************************************/\n/* ICONS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* FORMS */\n/*************************************************************************************************/\n/* Block level inputs */\n/*************************************************************************************************/\n/* COMPONENT MIXINS */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Horizontal Dividers: */\n/* Dividers (basically an hr) within dropdowns */\n/* and nav lists. */\n/* @params: */\n/* Border Color */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Navbar Vertical Align: */\n/* Vertically center elements in the navbar. */\n/* Example: an element has a height of 30px, */\n/* so write out `.navbarVerticalAlign(30px);` */\n/* to calculate the appropriate top margin. */\n/* @params: */\n/* Element Height */\n/*----------------------------------------------*/\n/*************************************************************************************************/\n/* PRINTING */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* POPDOWN */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Arrow: */\n/* Create an arrow. */\n/* @params: */\n/* Arrow Direction (up, down, left, right) */\n/* Arrow Color */\n/* Arrow Size */\n/*----------------------------------------------*/\n/* popdown body */\n/*************************************************************************************************/\n/* FULL PAGE LAYOUT */\n/*************************************************************************************************/\n.view---enterprise---dev---1hRLc {\n}\n.dialogPadded---enterprise---dev---2Yhvj {\n}\n.arrow---enterprise---dev---1Qh4l {\n display: none;\n}\n.body---enterprise---dev---1jah1 {\n}\n.footer---enterprise---dev---1vz_m {\n}\n/* Splunk: Dropdown arrow/caret */\n/* =========================== */\n.dropup---enterprise---dev---1wa0M,\n.dropdown---enterprise---dev---2WDCq {\n position: relative;\n}\n.dropdown-toggle---enterprise---dev---1AbhE:active,\n.open---enterprise---dev---2beGa .dropdown-toggle---enterprise---dev---1AbhE {\n outline: 0;\n}\n/* Dropdowns */\n/* --------- */\n.menu---enterprise---dev---27isD {\n}\n.menu---enterprise---dev---27isD li {\n position: relative;\n }\n.menu---enterprise---dev---27isD li > a {\n display: block;\n line-height: 40px;\n padding: 0 50px 0 30px;\n font-size: 17px;\n color: #000000;\n }\n.menu---enterprise---dev---27isD li > a:hover:not(.disabled---enterprise---dev---2dkUB),\n .menu---enterprise---dev---27isD li > a:focus:not(.disabled---enterprise---dev---2dkUB) {\n color: #000000;\n background: #F7F8FA;\n }\n.menu---enterprise---dev---27isD li + li > a {\n border-top: 1px solid #C3CBD4;\n }\n",""]),t.locals={view:"view---enterprise---dev---1hRLc "+n(5).locals.view,dialogPadded:"dialogPadded---enterprise---dev---2Yhvj "+n(5).locals.dialogPadded,arrow:"arrow---enterprise---dev---1Qh4l",body:"body---enterprise---dev---1jah1 "+n(5).locals.body,footer:"footer---enterprise---dev---1vz_m "+n(5).locals.footer,dropup:"dropup---enterprise---dev---1wa0M",dropdown:"dropdown---enterprise---dev---2WDCq","dropdown-toggle":"dropdown-toggle---enterprise---dev---1AbhE",open:"open---enterprise---dev---2beGa",menu:"menu---enterprise---dev---27isD "+n(5).locals.menu,disabled:"disabled---enterprise---dev---2dkUB"}},114:function(e,t,n){"use strict";(function(e){
+/*!
+ * The buffer module from node.js, for the browser.
+ *
+ * @author Feross Aboukhadijeh
+ * @license MIT
+ */
+var i=n(336),r=n(337),o=n(224);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function f(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return H(e).length;default:if(i)return z(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,n){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return M(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return _(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function g(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function b(e,t,n,i,r){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof t&&(t=l.from(t,i)),l.isBuffer(t))return 0===t.length?-1:v(e,t,n,i,r);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,i,r){var o,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,n/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(r){var d=-1;for(o=n;os&&(n=s-l),o=n;o>=0;o--){for(var u=!0,h=0;hr&&(i=r):i=r;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var a=0;a>8,r=n%256,o.push(r),o.push(i);return o}(t,e.length-n),e,n,i)}function _(e,t,n){return 0===t&&n===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,n))}function M(e,t,n){n=Math.min(e.length,n);for(var i=[],r=t;r239?4:c>223?3:c>191?2:1;if(r+u<=n)switch(u){case 1:c<128&&(d=c);break;case 2:128==(192&(o=e[r+1]))&&(l=(31&c)<<6|63&o)>127&&(d=l);break;case 3:o=e[r+1],a=e[r+2],128==(192&o)&&128==(192&a)&&(l=(15&c)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(d=l);break;case 4:o=e[r+1],a=e[r+2],s=e[r+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(d=l)}null===d?(d=65533,u=1):d>65535&&(d-=65536,i.push(d>>>10&1023|55296),d=56320|1023&d),i.push(d),r+=u}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",i=0;for(;i0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},l.prototype.compare=function(e,t,n,i,r){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),t<0||n>e.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&t>=n)return 0;if(i>=r)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(r>>>=0)-(i>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),c=this.slice(i,r),d=e.slice(t,n),u=0;ur)&&(n=r),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return y(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return x(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return k(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;ri)&&(n=i);for(var r="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,n,i,r,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||te.length)throw new RangeError("Index out of range")}function I(e,t,n,i){t<0&&(t=65535+t+1);for(var r=0,o=Math.min(e.length-n,2);r>>8*(i?r:1-r)}function R(e,t,n,i){t<0&&(t=4294967295+t+1);for(var r=0,o=Math.min(e.length-n,4);r>>8*(i?r:3-r)&255}function D(e,t,n,i,r,o){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function N(e,t,n,i,o){return o||D(e,0,n,4),r.write(e,t,n,i,23,4),n+4}function B(e,t,n,i,o){return o||D(e,0,n,8),r.write(e,t,n,i,52,8),n+8}l.prototype.slice=function(e,t){var n,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t0&&(r*=256);)i+=this[e+--t]*r;return i},l.prototype.readUInt8=function(e,t){return t||L(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||L(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||L(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||L(e,t,this.length);for(var i=this[e],r=1,o=0;++o=(r*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||L(e,t,this.length);for(var i=t,r=1,o=this[e+--i];i>0&&(r*=256);)o+=this[e+--i]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||L(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){t||L(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||L(e,4,this.length),r.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||L(e,4,this.length),r.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||L(e,8,this.length),r.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||L(e,8,this.length),r.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,n,i){(e=+e,t|=0,n|=0,i)||P(this,e,t,n,Math.pow(2,8*n)-1,0);var r=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+r]=e/o&255;return t+n},l.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):R(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t|=0,!i){var r=Math.pow(2,8*n-1);P(this,e,t,n,r-1,-r)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},l.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t|=0,!i){var r=Math.pow(2,8*n-1);P(this,e,t,n,r-1,-r)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):R(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):R(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,n){return N(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return N(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,i){if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t=0;--r)e[r+t]=this[r+n];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===i){(t-=3)>-1&&o.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function H(e){return i.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function V(e,t,n,i){for(var r=0;r=t.length||r>=e.length);++r)t[r+n]=e[r];return r}}).call(this,n(20))},115:function(e,t,n){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,i,r){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,n)}));case 3:return t.nextTick((function(){e.call(null,n,i)}));case 4:return t.nextTick((function(){e.call(null,n,i,r)}));default:for(o=new Array(s-1),a=0;a")})),u=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(e,t,n){var h=s(e),p=!o((function(){var t={};return t[h]=function(){return 7},7!=""[e](t)})),f=p?!o((function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[c]=function(){return n}),n[h](""),!t})):void 0;if(!p||!f||"replace"===e&&!d||"split"===e&&!u){var m=/./[h],g=n(a,h,""[e],(function(e,t,n,i,r){return t.exec===l?p&&!r?{done:!0,value:m.call(t,n,i)}:{done:!0,value:e.call(n,t,i)}:{done:!1}})),b=g[0],v=g[1];i(String.prototype,e,b),r(RegExp.prototype,h,2==t?function(e,t){return v.call(e,this,t)}:function(e){return v.call(e,this)})}}},125:function(e,t,n){var i=n(12),r=n(50),o=n(15)("species");e.exports=function(e,t){var n,a=i(e).constructor;return void 0===a||null==(n=i(a)[o])?t:r(n)}},126:function(e,t,n){var i=n(49),r=n(249),o=n(169),a=n(12),s=n(18),l=n(170),c={},d={};(t=e.exports=function(e,t,n,u,h){var p,f,m,g,b=h?function(){return e}:l(e),v=i(n,u,t?2:1),y=0;if("function"!=typeof b)throw TypeError(e+" is not iterable!");if(o(b)){for(p=s(e.length);p>y;y++)if((g=t?v(a(f=e[y])[0],f[1]):v(e[y]))===c||g===d)return g}else for(m=b.call(e);!(f=m.next()).done;)if((g=r(m,v,f.value,t))===c||g===d)return g}).BREAK=c,t.RETURN=d},127:function(e,t,n){"use strict";var i=n(14),r=n(3),o=n(28),a=n(83),s=n(56),l=n(126),c=n(82),d=n(13),u=n(11),h=n(121),p=n(78),f=n(161);e.exports=function(e,t,n,m,g,b){var v=i[e],y=v,w=g?"set":"add",x=y&&y.prototype,S={},k=function(e){var t=x[e];o(x,e,"delete"==e||"has"==e?function(e){return!(b&&!d(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return b&&!d(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,n){return t.call(this,0===e?0:e,n),this})};if("function"==typeof y&&(b||x.forEach&&!u((function(){(new y).entries().next()})))){var C=new y,_=C[w](b?{}:-0,1)!=C,M=u((function(){C.has(1)})),T=h((function(e){new y(e)})),A=!b&&u((function(){for(var e=new y,t=5;t--;)e[w](t,t);return!e.has(-0)}));T||((y=t((function(t,n){c(t,y,e);var i=f(new v,t,y);return null!=n&&l(n,g,i[w],i),i}))).prototype=x,x.constructor=y),(M||A)&&(k("delete"),k("has"),g&&k("get")),(A||_)&&k(w),b&&x.clear&&delete x.clear}else y=m.getConstructor(t,e,g,w),a(y.prototype,n),s.NEED=!0;return p(y,e),S[e]=y,r(r.G+r.W+r.F*(y!=v),S),b||m.setStrong(y,e,g),y}},128:function(e,t,n){for(var i,r=n(14),o=n(35),a=n(66),s=a("typed_array"),l=a("view"),c=!(!r.ArrayBuffer||!r.DataView),d=c,u=0,h="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");u<9;)(i=r[h[u++]])?(o(i.prototype,s,!0),o(i.prototype,l,!0)):d=!1;e.exports={ABV:c,CONSTR:d,TYPED:s,VIEW:l}},129:function(e,t){e.exports=function(e){return"string"!=typeof e?e:(/^['"].*['"]$/.test(e)&&(e=e.slice(1,-1)),/["'() \t\n]/.test(e)?'"'+e.replace(/"/g,'\\"').replace(/\n/g,"\\n")+'"':e)}},13:function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},130:function(e,t,n){"use strict";function i(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:"inline",r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return i({},r?t:{},o?{all:o}:{},{borderWidth:"1px",boxSizing:"border-box",color:e.textColor,cursor:"inherit",display:n,fontFamily:e.fontFamily,fontSize:e.fontSize,lineHeight:e.lineHeight,outline:"medium none ".concat(e.focusColor),visibility:"inherit"})}},t.clearfix=function(){return{"&::after":{display:"table",content:'""',clear:"both"}}},t.ellipsis=function(){return{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},t.printWidth100Percent=function(){return{maxWidth:"100% !important",width:"100% !important",overflow:"hidden !important"}},t.printHide=function(){return{display:"none !important"}},t.printNoBackground=function(){return{background:"none !important"}},t.printWrapAll=function(){return{wordBreak:"break-all !important",wordWrap:"break-word !important",overflowWrap:"break-word !important",whiteSpace:"normal !important"}},t.screenReaderContent=function(){return{position:"absolute",overflow:"hidden",clip:"rect(0 0 0 0)",height:"1px",width:"1px",margin:"-1px",padding:0,border:0}}},131:function(e,t,n){var i=n(533),r=n(534),o=n(535),a=n(536),s=n(537);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var h=c.a.svg.withConfig({displayName:"SVG__InlineSVG",componentId:"sc-12p19go-0"})(["flex:0 0 auto;vertical-align:middle;display:inline-block;"]),p=c.a.svg.withConfig({displayName:"SVG__BlockSVG",componentId:"sc-12p19go-1"})(["flex:0 0 auto;display:block;margin:0 auto;"]),f=c.a.span.withConfig({displayName:"SVG__ScreenReaderContent",componentId:"sc-12p19go-2"})(["position:absolute;overflow:hidden;clip:rect(0 0 0 0);height:1px;width:1px;margin:-1px;padding:0;border:0;"]),m=/-?\d.?\d* -?\d+.?\d* \d+.?\d* \d+.?\d*/,g={children:a.a.node,height:a.a.oneOfType([a.a.number,a.a.string]),hideDefaultTooltip:a.a.bool,inline:a.a.bool,screenReaderText:a.a.oneOfType([a.a.string,a.a.oneOf(["null"])]),size:a.a.oneOfType([a.a.number,a.a.string]),width:a.a.oneOfType([a.a.number,a.a.string]),viewBox:function(e,t,n){var i=e[t];if(!m.test(i))return new Error("Invalid prop value: ".concat(i," for ").concat(t," in ").concat(n,'. Must be four space-separated numbers, such as "0 0 24 24."'))},preserveAspectRatio:a.a.oneOf(["none","xMinYMin","xMidYMin","xMaxYMin","xMinYMid","xMidYMid","xMaxYMid","xMinYMax","xMidYMax","xMaxYMax"])};function b(e){var t=e.children,n=e.height,i=e.hideDefaultTooltip,o=e.inline,a=e.preserveAspectRatio,l=e.screenReaderText,c=e.size,m=e.width,g=e.viewBox,b=u(e,["children","height","hideDefaultTooltip","inline","preserveAspectRatio","screenReaderText","size","width","viewBox"]),v=parseFloat(c),y=Object(s.isString)(c)?c.match(/[^\d]+/):"em",w=parseFloat(g.split(" ")[3],10),x=parseFloat(g.split(" ")[2],10),S=Math.max(x,w),k=Object(s.isUndefined)(n)?w/S*v:n,C=Object(s.isUndefined)(m)?x/S*v:m,_=o?h:p;return r.a.createElement(_,d({focusable:"false",height:Object(s.isString)(k)?k:"".concat(k.toFixed(4)).concat(y),width:Object(s.isString)(C)?C:"".concat(C.toFixed(4)).concat(y),viewBox:g,"aria-hidden":!l,preserveAspectRatio:a,xmlns:"http://www.w3.org/2000/svg"},b),l&&(i?r.a.createElement(f,null,l):r.a.createElement("title",null,l)),t)}t.default=b,b.propTypes=g,b.defaultProps={hideDefaultTooltip:!1,inline:!0,size:.75,preserveAspectRatio:"xMidYMid"}},3:function(e,t){e.exports=n(4)},5:function(e,t){e.exports=n(7)},6:function(e,t){e.exports=n(6)}})},141:function(e,t,n){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(652)),o=i(n(653)),a=i(n(654)),s=i(n(656)),l=i(n(657)),c=i(n(307)),d=i(n(659)),u=i(n(661)),h=i(n(0));i(n(4)),i(n(662));var p,f=(p=null,function(){if(null!==p)return p;var e,t,n,i=!1;try{window.addEventListener("test",null,(e={},t="passive",n={get:function(){i=!0}},Object.defineProperty(e,t,n)))}catch(e){}return p=i,i}()),m={capture:!1,passive:!1};function g(e){return u({},m,e)}function b(e,t,n){var i=[e,t];return i.push(f?n:n.capture),i}function v(e,t,n,i){e.addEventListener.apply(e,b(t,n,i))}function y(e,t,n,i){e.removeEventListener.apply(e,b(t,n,i))}function w(e,t){e.children,e.target;var n=d(e,["children","target"]);Object.keys(n).forEach((function(e){if("on"===e.substring(0,2)){var i=n[e],r=c(i),o="object"===r;if(o||"function"===r){var a="capture"===e.substr(-7).toLowerCase(),s=e.substring(2).toLowerCase();s=a?s.substring(0,s.length-7):s,o?t(s,i.handler,i.options):t(s,i,g({capture:a}))}}}))}var x=function(e){function t(){return r(this,t),a(this,s(t).apply(this,arguments))}return l(t,e),o(t,[{key:"componentDidMount",value:function(){this.applyListeners(v)}},{key:"componentDidUpdate",value:function(e){this.applyListeners(y,e),this.applyListeners(v)}},{key:"componentWillUnmount",value:function(){this.applyListeners(y)}},{key:"applyListeners",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.props,n=t.target;if(n){var i=n;"string"==typeof n&&(i=window[n]),w(t,e.bind(null,i))}}},{key:"render",value:function(){return this.props.children||null}}]),t}(h.PureComponent);x.propTypes={},t.withOptions=function(e,t){return{handler:e,options:g(t)}},t.default=x},142:function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]="number"==typeof e[n]?e[n]:e[n].val);return t},e.exports=t.default},143:function(e,t,n){(function(t){(function(){var n,i,r,o,a,s;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:null!=t&&t.hrtime?(e.exports=function(){return(n()-a)/1e6},i=t.hrtime,o=(n=function(){var e;return 1e9*(e=i())[0]+e[1]})(),s=1e9*t.uptime(),a=o-s):Date.now?(e.exports=function(){return Date.now()-r},r=Date.now()):(e.exports=function(){return(new Date).getTime()-r},r=(new Date).getTime())}).call(this)}).call(this,n(47))},144:function(e,t,n){e.exports=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=157)}({15:function(e,t){e.exports=n(92)},157:function(e,t,n){"use strict";n.r(t);var i=n(2),r=n.n(i),o=n(15),a=n(5),s=n(37),l=n.n(s);function c(e,t){if(null==e)return{};var n,i,r=function(e,t){if(null==e)return{};var n,i,r={},o=Object.keys(e);for(i=0;i=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(){return(u=Object.assign||function(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function R(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function D(e,t){for(var n=0;n1?r-1:0),a=1;a CURRENT VARIABLE */\n/* $black -> $black */\n/* $grayDarker -> $gray20 */\n/* $grayDark -> $gray30 */\n/* $gray -> $gray45 */\n/* $grayLight -> $gray60 */\n/* $grayLightMedium -> $gray80 */\n/* $grayLighter -> $gray92 */\n/* $gray96 */\n/* $offWhite -> $gray98 */\n/* $white -> $white */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* SEMANTIC COLORS */\n/* */\n/* PRE IVORY -> CURRENT VARIABLE */\n/* $red -> $errorColor */\n/* $orange -> $alertColor */\n/* $yellow -> $warningColor */\n/* $yellowLight -> $warningColorL20 */\n/* $yellowLighter -> $warningColorL40 */\n/* $green -> $successColor */\n/* $blue -> $infoColor */\n/* $blueDark -> $infoColorD40 */\n/* $pink -> No Equivalent or $errorColorL30 */\n/* $purple -> No Equivalent */\n/* $teal -> No Equivalent */\n/* $focusColor -> $accentColorL10 */\n/*************************************************************************************************/\n/* Blue Accent */\n/* Red Error */\n/* Orange Alert */\n/* Yellow Warning */\n/* Green Success */\n/* Blue Info */\n/*************************************************************************************************/\n/* CATEGORICAL COLORS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* DIVERGING COLORS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* STATIC PATHS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* TYPOGRAPHY */\n/*************************************************************************************************/\n/* Lite listing pages */\n/* empty to use BS default, $fontFamily */\n/* instead of browser default, bold */\n/*************************************************************************************************/\n/* SCAFFOLDING */\n/*************************************************************************************************/\n/* Border Colors */\n/* aliases: $tableBorderColor $tableBorderColorVertical */\n/* also see: $interactiveBorderColor */\n/* Borders */\n/* Border Radius */\n/* For containers without a wrapper */\n/* For for containers with a wrapper, like popdown */\n/* Padding & Margin */\n/* 200% - 40px */\n/* 150% - 30px */\n/* 75% - 15px */\n/* 50% - 10px */\n/* 25% - 5px */\n/* Popdown Arrows */\n/* Large Icons */\n/*************************************************************************************************/\n/* TRANSITIONS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* HORIZONTAL FORMS & LISTS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Z-INDEX */\n/*************************************************************************************************/\n/* If a variable does not suit your purpose, set a value relatively such as, $zindexModal +1 */\n/* Splunk Lite */\n/* Splunk Lite */\n/* Sidebar Component */\n/* Sidebar Component */\n/* timerange popdown needs to be above modal + backdrop */\n/* top interactive element */\n/* top interactive element */\n/* top uninteractive */\n/* top uninteractive */\n/*************************************************************************************************/\n/* TABLES */\n/*************************************************************************************************/\n/* overall background-color */\n/*************************************************************************************************/\n/* FORMS */\n/*************************************************************************************************/\n/* base input height + 10px vertical padding + 2px top/bottom border */\n/* This is generally overridden. */\n/*************************************************************************************************/\n/* MODAL */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* POPUP */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* TABS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* MENU */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* BASE INTERACTIVE */\n/*************************************************************************************************/\n/* text */\n/* background */\n/* borders */\n/* shadow */\n/*************************************************************************************************/\n/* BASE INTERACTIVE ERROR */\n/*************************************************************************************************/\n/* text */\n/* background */\n/*************************************************************************************************/\n/* BUTTONS */\n/*************************************************************************************************/\n/* 1 rem */\n/*************************************************************************************************/\n/* PRIMARY BUTTONS */\n/*************************************************************************************************/\n/* text */\n/* background */\n/* borders */\n/* shadow */\n/*************************************************************************************************/\n/* PILL BUTTONS */\n/*************************************************************************************************/\n/* text */\n/* background */\n/*************************************************************************************************/\n/* COMPONENT VARIABLES */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* NAVBAR */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* APP BAR */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* ACCORDION */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* CONCERTINA */\n/* Concertina has the same color as Accordion, maybe we should just reuse them? */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* TOOLTIPS & POPOVERS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* SELECTORS FOR CUSTOMIZING SPECIFIC LOCALES */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* DASHBOARDS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* VIZ & VIZ PICKERS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* MAPS */\n/*************************************************************************************************/\n/* leaflet popup defaults */\n/*************************************************************************************************/\n/* Search IDE */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Date Picker */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Time Range Picker */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Events Viewer */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Misc */\n/*************************************************************************************************/\n/*===============================================================================================*/\n/* SPLUNK: MIXINS */\n/* Snippets of reusable CSS to develop faster and keep code readable */\n/*===============================================================================================*/\n/* Reset */\n/* ------------------ */\n/* Link */\n/* ------------------ */\n/*************************************************************************************************/\n/* FOCUS STATES */\n/*************************************************************************************************/\n/* Use when are outer focus glow will be block (i.e Menu Items). Provide background color.*/\n/* Block elements change the background color */\n/* Block elements change the background color and spread via box-shadow */\n/*************************************************************************************************/\n/* INTERACTIVE */\n/* These are by any element that can be clicked, such as buttons, menus and table headings. */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Interactive style: */\n/* @params: */\n/* Background Color */\n/* Border Color */\n/* Box Shadow */\n/* Text Color */\n/* Transition */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Primary interactive style: */\n/* @params: */\n/* Background Color */\n/* Box Shadow */\n/* Text Color */\n/* Transition */\n/*----------------------------------------------*/\n/*************************************************************************************************/\n/* INTERACTIVE ERROR */\n/* These are by any interactive element that is is in an error state. */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* BUTTONS */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Pills, Links */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Define states of buttons: */\n/* :hover, :active, disabled and :focus */\n/* @params: */\n/* Hover Mixin */\n/* Active Mixin */\n/* Disabled Mixin */\n/* Focus Mixin */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Button Padding: */\n/* @params: */\n/* Vertical Padding */\n/* Horizontal Padding */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Primary Button Padding: */\n/* @params: */\n/* Vertical Padding */\n/* Horizontal Padding */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Button Padding For Other Button Sizes: */\n/* @params: */\n/* Vertical Padding */\n/* Horizontal Padding */\n/* Button Icon Margin Top */\n/*----------------------------------------------*/\n/* Draggable Handle */\n/*************************************************************************************************/\n/* FONTS */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Define Font Family: */\n/* @params: */\n/* Font Name */\n/* Name of Font File */\n/* Font Format */\n/* Font Weight */\n/* Font Style */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Create a heading */\n/* @params: */\n/* Font Size */\n/* Margin */\n/* Font Color */\n/* Text Transform */\n/*----------------------------------------------*/\n/*************************************************************************************************/\n/* UTILITY MIXINS */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Clearfix: */\n/* For clearing floats like a boss h5bp.com/q */\n/*----------------------------------------------*/\n/* Placeholder text */\n/* Basic input styles */\n/* Sets Modal width and margin */\n/* Define card style. Add white background and shadow. */\n/* Workaround for table shadows in IE. Don't use this mixin, use create-card-table */\n/* Define card style on tables. Adds workaround for IE */\n/* Cover browser specific radio button with styled radio button. */\n/* Can only be used if label comes immediately after input[type=radio] */\n/* Use to cover button in .radio class */\n/*-------------------------------------------------------------------------*/\n/* CSS image replacement */\n/* For clearing floats like a boss h5bp.com/q */\n/* Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 */\n/*-------------------------------------------------------------------------*/\n/*************************************************************************************************/\n/* ICONS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* FORMS */\n/*************************************************************************************************/\n/* Block level inputs */\n/*************************************************************************************************/\n/* COMPONENT MIXINS */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Horizontal Dividers: */\n/* Dividers (basically an hr) within dropdowns */\n/* and nav lists. */\n/* @params: */\n/* Border Color */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Navbar Vertical Align: */\n/* Vertically center elements in the navbar. */\n/* Example: an element has a height of 30px, */\n/* so write out `.navbarVerticalAlign(30px);` */\n/* to calculate the appropriate top margin. */\n/* @params: */\n/* Element Height */\n/*----------------------------------------------*/\n/*************************************************************************************************/\n/* PRINTING */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* POPDOWN */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Arrow: */\n/* Create an arrow. */\n/* @params: */\n/* Arrow Direction (up, down, left, right) */\n/* Arrow Color */\n/* Arrow Size */\n/*----------------------------------------------*/\n/* popdown body */\n/*************************************************************************************************/\n/* FULL PAGE LAYOUT */\n/*************************************************************************************************/\n.view---enterprise---dev---8RygX {\n line-height: 40px;\n height: 40px;\n}\n.view---enterprise---dev---8RygX:hover {\n color: #FFFFFF;\n outline: none;\n text-decoration: none;\n }\n.view---enterprise---dev---8RygX.active---enterprise---dev---2hf6w, .view---enterprise---dev---8RygX:active {\n color: #FFFFFF;\n }\n.view---enterprise---dev---8RygX:focus {\n -webkit-box-shadow: none;\n box-shadow: none;\n border-collapse: separate;\n /* Fix IE9 Issue with box-shadow */\n outline: 0;\n text-decoration: none;\n }\n.view---enterprise---dev---8RygX:focus:active:not([disabled]) {\n -webkit-box-shadow: none;\n box-shadow: none;\n }\n.view---enterprise---dev---8RygX:focus {\n -webkit-box-shadow: inset 0 0 2px 1px #171D21, inset 0 0 0 2px #00A4FD;\n box-shadow: inset 0 0 2px 1px #171D21, inset 0 0 0 2px #00A4FD;\n color: #FFFFFF;\n background: #171D21;\n}\n.label---enterprise---dev---3D4zN {\n}\n.truncateLabel---enterprise---dev---1tVxW {\n}\n.optionalLabel---enterprise---dev---1WPf1 {\n}\n",""]),t.locals={view:"view---enterprise---dev---8RygX "+n(94).locals.view,active:"active---enterprise---dev---2hf6w",label:"label---enterprise---dev---3D4zN "+n(94).locals.label,truncateLabel:"truncateLabel---enterprise---dev---1tVxW "+n(94).locals.truncateLabel,optionalLabel:"optionalLabel---enterprise---dev---1WPf1 "+n(94).locals.optionalLabel}},148:function(e,t,n){"use strict";e.exports=n(527)},149:function(e,t,n){"use strict";var i,r="object"==typeof Reflect?Reflect:null,o=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};i=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(n,i){function r(n){e.removeListener(t,o),i(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",r),n([].slice.call(arguments))}b(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&b(e,"error",t,n)}(e,r,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var l=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function d(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function u(e,t,n,i){var r,o,a,s;if(c(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"==typeof a?a=o[t]=i?[n,a]:[a,n]:i?a.unshift(n):a.push(n),(r=d(e))>0&&a.length>r&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,s=l,console&&console.warn&&console.warn(s)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=h.bind(i);return r.listener=n,i.wrapFn=r,r}function f(e,t,n){var i=e._events;if(void 0===i)return[];var r=i[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=r[e];if(void 0===l)return!1;if("function"==typeof l)o(l,this,t);else{var c=l.length,d=g(l,c);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,r=o;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1=0;i--)this.removeListener(e,t[i]);return this},s.prototype.listeners=function(e){return f(this,e,!0)},s.prototype.rawListeners=function(e){return f(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},15:function(e,t,n){var i=n(117)("wks"),r=n(66),o=n(14).Symbol,a="function"==typeof o;(e.exports=function(e){return i[e]||(i[e]=a&&o[e]||(a?o:r)("Symbol."+e))}).store=i},150:function(e,t,n){(t=e.exports=n(225)).Stream=t,t.Readable=t,t.Writable=n(151),t.Duplex=n(64),t.Transform=n(229),t.PassThrough=n(344)},151:function(e,t,n){"use strict";(function(t,i,r){var o=n(115);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var i=e.entry;e.entry=null;for(;i;){var r=i.callback;t.pendingcb--,r(n),i=i.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=v;var s,l=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?i:o.nextTick;v.WritableState=b;var c=Object.create(n(96));c.inherits=n(63);var d={deprecate:n(343)},u=n(226),h=n(116).Buffer,p=r.Uint8Array||function(){};var f,m=n(228);function g(){}function b(e,t){s=s||n(64),e=e||{};var i=t instanceof s;this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var r=e.highWaterMark,c=e.writableHighWaterMark,d=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i&&(c||0===c)?c:d,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var u=!1===e.decodeStrings;this.decodeStrings=!u,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,i=n.sync,r=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,i,r){--t.pendingcb,n?(o.nextTick(r,i),o.nextTick(C,e,t),e._writableState.errorEmitted=!0,e.emit("error",i)):(r(i),e._writableState.errorEmitted=!0,e.emit("error",i),C(e,t))}(e,n,i,t,r);else{var a=S(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||x(e,n),i?l(w,e,n,a,r):w(e,n,a,r)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function v(e){if(s=s||n(64),!(f.call(v,this)||this instanceof s))return new v(e);this._writableState=new b(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function y(e,t,n,i,r,o,a){t.writelen=i,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(r,t.onwrite):e._write(r,o,t.onwrite),t.sync=!1}function w(e,t,n,i){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,i(),C(e,t)}function x(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var i=t.bufferedRequestCount,r=new Array(i),o=t.corkedRequestsFree;o.entry=n;for(var s=0,l=!0;n;)r[s]=n,n.isBuf||(l=!1),n=n.next,s+=1;r.allBuffers=l,y(e,t,!0,t.length,r,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,d=n.encoding,u=n.callback;if(y(e,t,!1,t.objectMode?1:c.length,c,d,u),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function S(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),C(e,t)}))}function C(e,t){var n=S(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(k,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}c.inherits(v,u),b.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(b.prototype,"buffer",{get:d.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(e){return!!f.call(this,e)||this===v&&(e&&e._writableState instanceof b)}})):f=function(e){return e instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(e,t,n){var i=this._writableState,r=!1,a=!i.objectMode&&function(e){return h.isBuffer(e)||e instanceof p}(e);return a&&!h.isBuffer(e)&&(e=function(e){return h.from(e)}(e)),"function"==typeof t&&(n=t,t=null),a?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=g),i.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),o.nextTick(t,n)}(this,n):(a||function(e,t,n,i){var r=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(i,a),r=!1),r}(this,i,e,n))&&(i.pendingcb++,r=function(e,t,n,i,r,o){if(!n){var a=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=h.from(t,n));return t}(t,i,r);i!==a&&(n=!0,r="buffer",i=a)}var s=t.objectMode?1:i.length;t.length+=s;var l=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(e,t,n){var i=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function(e,t,n){t.ending=!0,C(e,t),n&&(t.finished?o.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,i,n)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),v.prototype.destroy=m.destroy,v.prototype._undestroy=m.undestroy,v.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(47),n(341).setImmediate,n(20))},152:function(e,t,n){"use strict";var i=n(116).Buffer,r=i.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(i.isEncoding===r||!r(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=d,this.end=u,t=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function d(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function u(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0)return r>0&&(e.lastNeed=r-1),r;if(--i=0)return r>0&&(e.lastNeed=r-2),r;if(--i=0)return r>0&&(2===r?r=0:e.lastNeed=r-3),r;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var i=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},153:function(e,t,n){var i=n(13),r=n(14).document,o=i(r)&&i(r.createElement);e.exports=function(e){return o?r.createElement(e):{}}},154:function(e,t,n){var i=n(40),r=n(18),o=n(68);e.exports=function(e){return function(t,n,a){var s,l=i(t),c=r(l.length),d=o(a,c);if(e&&n!=n){for(;c>d;)if((s=l[d++])!=s)return!0}else for(;c>d;d++)if((e||d in l)&&l[d]===n)return e||d||0;return!e&&-1}}},155:function(e,t,n){var i=n(117)("keys"),r=n(66);e.exports=function(e){return i[e]||(i[e]=r(e))}},156:function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},157:function(e,t,n){var i=n(51);e.exports=Array.isArray||function(e){return"Array"==i(e)}},158:function(e,t,n){var i=n(14).document;e.exports=i&&i.documentElement},159:function(e,t,n){var i=n(13),r=n(12),o=function(e,t){if(r(e),!i(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,i){try{(i=n(49)(Function.call,n(52).f(Object.prototype,"__proto__").set,2))(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,n){return o(e,n),t?e.__proto__=n:i(e,n),e}}({},!1):void 0),check:o}},16:function(e,t,n){(t=e.exports=n(1)(!1)).push([e.i,'/*************************************************************************************************/\n/* BRAND COLORS */\n/* DO NOT USE DIRECTLY! Use $brandColor instead. See brand.*.pcss for definitions. */\n/*************************************************************************************************/\n/* Green Splunk Enterprise */\n/* Orange Splunk Lite */\n/* Brand colors */\n/*===============================================================================================*/\n/* SPLUNK: VARIABLES */\n/* Variables to customize the look and feel of Bootstrap (splunk version). */\n/* See /en-US/static/docs/style/style-guide.html for style guide */\n/*===============================================================================================*/\n/*===============================================================================================*/\n/* WARNING */\n/* This file has an implicit dependency on the brand variables injected by the */\n/* \'splunk-postcss-theme-import\' postcss plugin. */\n/*===============================================================================================*/\n/*===============================================================================================*/\n/* SPLUNK: COLORS */\n/*===============================================================================================*/\n/*************************************************************************************************/\n/* NEUTRAL COLORS */\n/* */\n/* PRE IVORY -> CURRENT VARIABLE */\n/* $black -> $black */\n/* $grayDarker -> $gray20 */\n/* $grayDark -> $gray30 */\n/* $gray -> $gray45 */\n/* $grayLight -> $gray60 */\n/* $grayLightMedium -> $gray80 */\n/* $grayLighter -> $gray92 */\n/* $gray96 */\n/* $offWhite -> $gray98 */\n/* $white -> $white */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* SEMANTIC COLORS */\n/* */\n/* PRE IVORY -> CURRENT VARIABLE */\n/* $red -> $errorColor */\n/* $orange -> $alertColor */\n/* $yellow -> $warningColor */\n/* $yellowLight -> $warningColorL20 */\n/* $yellowLighter -> $warningColorL40 */\n/* $green -> $successColor */\n/* $blue -> $infoColor */\n/* $blueDark -> $infoColorD40 */\n/* $pink -> No Equivalent or $errorColorL30 */\n/* $purple -> No Equivalent */\n/* $teal -> No Equivalent */\n/* $focusColor -> $accentColorL10 */\n/*************************************************************************************************/\n/* Blue Accent */\n/* Red Error */\n/* Orange Alert */\n/* Yellow Warning */\n/* Green Success */\n/* Blue Info */\n/*************************************************************************************************/\n/* CATEGORICAL COLORS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* DIVERGING COLORS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* STATIC PATHS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* TYPOGRAPHY */\n/*************************************************************************************************/\n/* Lite listing pages */\n/* empty to use BS default, $fontFamily */\n/* instead of browser default, bold */\n/*************************************************************************************************/\n/* SCAFFOLDING */\n/*************************************************************************************************/\n/* Border Colors */\n/* aliases: $tableBorderColor $tableBorderColorVertical */\n/* also see: $interactiveBorderColor */\n/* Borders */\n/* Border Radius */\n/* For containers without a wrapper */\n/* For for containers with a wrapper, like popdown */\n/* Padding & Margin */\n/* 200% - 40px */\n/* 150% - 30px */\n/* 75% - 15px */\n/* 50% - 10px */\n/* 25% - 5px */\n/* Popdown Arrows */\n/* Large Icons */\n/*************************************************************************************************/\n/* TRANSITIONS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* HORIZONTAL FORMS & LISTS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Z-INDEX */\n/*************************************************************************************************/\n/* If a variable does not suit your purpose, set a value relatively such as, $zindexModal +1 */\n/* Splunk Lite */\n/* Splunk Lite */\n/* Sidebar Component */\n/* Sidebar Component */\n/* timerange popdown needs to be above modal + backdrop */\n/* top interactive element */\n/* top interactive element */\n/* top uninteractive */\n/* top uninteractive */\n/*************************************************************************************************/\n/* TABLES */\n/*************************************************************************************************/\n/* overall background-color */\n/*************************************************************************************************/\n/* FORMS */\n/*************************************************************************************************/\n/* base input height + 10px vertical padding + 2px top/bottom border */\n/* This is generally overridden. */\n/*************************************************************************************************/\n/* MODAL */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* POPUP */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* TABS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* MENU */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* BASE INTERACTIVE */\n/*************************************************************************************************/\n/* text */\n/* background */\n/* borders */\n/* shadow */\n/*************************************************************************************************/\n/* BASE INTERACTIVE ERROR */\n/*************************************************************************************************/\n/* text */\n/* background */\n/*************************************************************************************************/\n/* BUTTONS */\n/*************************************************************************************************/\n/* 1 rem */\n/*************************************************************************************************/\n/* PRIMARY BUTTONS */\n/*************************************************************************************************/\n/* text */\n/* background */\n/* borders */\n/* shadow */\n/*************************************************************************************************/\n/* PILL BUTTONS */\n/*************************************************************************************************/\n/* text */\n/* background */\n/*************************************************************************************************/\n/* COMPONENT VARIABLES */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* NAVBAR */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* APP BAR */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* ACCORDION */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* CONCERTINA */\n/* Concertina has the same color as Accordion, maybe we should just reuse them? */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* TOOLTIPS & POPOVERS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* SELECTORS FOR CUSTOMIZING SPECIFIC LOCALES */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* DASHBOARDS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* VIZ & VIZ PICKERS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* MAPS */\n/*************************************************************************************************/\n/* leaflet popup defaults */\n/*************************************************************************************************/\n/* Search IDE */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Date Picker */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Time Range Picker */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Events Viewer */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* Misc */\n/*************************************************************************************************/\n/*===============================================================================================*/\n/* SPLUNK: MIXINS */\n/* Snippets of reusable CSS to develop faster and keep code readable */\n/*===============================================================================================*/\n/* Reset */\n/* ------------------ */\n/* Link */\n/* ------------------ */\n/*************************************************************************************************/\n/* FOCUS STATES */\n/*************************************************************************************************/\n/* Use when are outer focus glow will be block (i.e Menu Items). Provide background color.*/\n/* Block elements change the background color */\n/* Block elements change the background color and spread via box-shadow */\n/*************************************************************************************************/\n/* INTERACTIVE */\n/* These are by any element that can be clicked, such as buttons, menus and table headings. */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Interactive style: */\n/* @params: */\n/* Background Color */\n/* Border Color */\n/* Box Shadow */\n/* Text Color */\n/* Transition */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Primary interactive style: */\n/* @params: */\n/* Background Color */\n/* Box Shadow */\n/* Text Color */\n/* Transition */\n/*----------------------------------------------*/\n/*************************************************************************************************/\n/* INTERACTIVE ERROR */\n/* These are by any interactive element that is is in an error state. */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* BUTTONS */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Pills, Links */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Define states of buttons: */\n/* :hover, :active, disabled and :focus */\n/* @params: */\n/* Hover Mixin */\n/* Active Mixin */\n/* Disabled Mixin */\n/* Focus Mixin */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Button Padding: */\n/* @params: */\n/* Vertical Padding */\n/* Horizontal Padding */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Primary Button Padding: */\n/* @params: */\n/* Vertical Padding */\n/* Horizontal Padding */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Button Padding For Other Button Sizes: */\n/* @params: */\n/* Vertical Padding */\n/* Horizontal Padding */\n/* Button Icon Margin Top */\n/*----------------------------------------------*/\n/* Draggable Handle */\n/*************************************************************************************************/\n/* FONTS */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Define Font Family: */\n/* @params: */\n/* Font Name */\n/* Name of Font File */\n/* Font Format */\n/* Font Weight */\n/* Font Style */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Create a heading */\n/* @params: */\n/* Font Size */\n/* Margin */\n/* Font Color */\n/* Text Transform */\n/*----------------------------------------------*/\n/*************************************************************************************************/\n/* UTILITY MIXINS */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Clearfix: */\n/* For clearing floats like a boss h5bp.com/q */\n/*----------------------------------------------*/\n/* Placeholder text */\n/* Basic input styles */\n/* Sets Modal width and margin */\n/* Define card style. Add white background and shadow. */\n/* Workaround for table shadows in IE. Don\'t use this mixin, use create-card-table */\n/* Define card style on tables. Adds workaround for IE */\n/* Cover browser specific radio button with styled radio button. */\n/* Can only be used if label comes immediately after input[type=radio] */\n/* Use to cover button in .radio class */\n/*-------------------------------------------------------------------------*/\n/* CSS image replacement */\n/* For clearing floats like a boss h5bp.com/q */\n/* Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 */\n/*-------------------------------------------------------------------------*/\n/*************************************************************************************************/\n/* ICONS */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* FORMS */\n/*************************************************************************************************/\n/* Block level inputs */\n/*************************************************************************************************/\n/* COMPONENT MIXINS */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Horizontal Dividers: */\n/* Dividers (basically an hr) within dropdowns */\n/* and nav lists. */\n/* @params: */\n/* Border Color */\n/*----------------------------------------------*/\n/*----------------------------------------------*/\n/* Navbar Vertical Align: */\n/* Vertically center elements in the navbar. */\n/* Example: an element has a height of 30px, */\n/* so write out `.navbarVerticalAlign(30px);` */\n/* to calculate the appropriate top margin. */\n/* @params: */\n/* Element Height */\n/*----------------------------------------------*/\n/*************************************************************************************************/\n/* PRINTING */\n/*************************************************************************************************/\n/*************************************************************************************************/\n/* POPDOWN */\n/*************************************************************************************************/\n/*----------------------------------------------*/\n/* Arrow: */\n/* Create an arrow. */\n/* @params: */\n/* Arrow Direction (up, down, left, right) */\n/* Arrow Color */\n/* Arrow Size */\n/*----------------------------------------------*/\n/* popdown body */\n/*************************************************************************************************/\n/* FULL PAGE LAYOUT */\n/*************************************************************************************************/\n/* Splunk: Modals */\n/* ============== */\n/* Background */\n.backdrop---enterprise---dev---iB99T {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1040;\n background-color: #3C444D;\n opacity: 0;\n}\n.backdrop---enterprise---dev---iB99T[data-modal-state=open] {\n opacity: 0.80;\n }\n/* modal container */\n.view---enterprise---dev---3-FWY {\n -webkit-animation: none 0s ease 0s 1 normal none running;\n animation: none 0s ease 0s 1 normal none running;\n -webkit-backface-visibility: visible;\n backface-visibility: visible;\n background: transparent none repeat 0 0 / auto auto padding-box border-box scroll;\n border: medium none currentColor;\n border-collapse: separate;\n -o-border-image: none;\n border-image: none;\n border-radius: 0;\n border-spacing: 0;\n bottom: auto;\n -webkit-box-shadow: none;\n box-shadow: none;\n -webkit-box-sizing: content-box;\n box-sizing: content-box;\n caption-side: top;\n clear: none;\n clip: auto;\n color: #000;\n -webkit-columns: auto;\n -moz-columns: auto;\n columns: auto;\n -webkit-column-count: auto;\n -moz-column-count: auto;\n column-count: auto;\n -webkit-column-fill: balance;\n -moz-column-fill: balance;\n column-fill: balance;\n -webkit-column-gap: normal;\n -moz-column-gap: normal;\n column-gap: normal;\n -webkit-column-rule: medium none currentColor;\n -moz-column-rule: medium none currentColor;\n column-rule: medium none currentColor;\n -webkit-column-span: 1;\n -moz-column-span: 1;\n column-span: 1;\n -webkit-column-width: auto;\n -moz-column-width: auto;\n column-width: auto;\n content: normal;\n counter-increment: none;\n counter-reset: none;\n cursor: auto;\n direction: ltr;\n display: inline;\n empty-cells: show;\n float: none;\n font-family: serif;\n font-size: medium;\n font-style: normal;\n font-variant: normal;\n font-weight: normal;\n font-stretch: normal;\n line-height: normal;\n height: auto;\n -webkit-hyphens: none;\n -ms-hyphens: none;\n hyphens: none;\n left: auto;\n letter-spacing: normal;\n list-style: disc outside none;\n margin: 0;\n max-height: none;\n max-width: none;\n min-height: 0;\n min-width: 0;\n opacity: 1;\n orphans: 2;\n outline: medium none invert;\n overflow: visible;\n overflow-x: visible;\n overflow-y: visible;\n padding: 0;\n page-break-after: auto;\n page-break-before: auto;\n page-break-inside: auto;\n -webkit-perspective: none;\n perspective: none;\n -webkit-perspective-origin: 50% 50%;\n perspective-origin: 50% 50%;\n position: static;\n right: auto;\n -moz-tab-size: 8;\n -o-tab-size: 8;\n tab-size: 8;\n table-layout: auto;\n text-align: left;\n -moz-text-align-last: auto;\n text-align-last: auto;\n text-decoration: none;\n text-indent: 0;\n text-shadow: none;\n text-transform: none;\n top: auto;\n -webkit-transform: none;\n transform: none;\n -webkit-transform-origin: 50% 50% 0;\n transform-origin: 50% 50% 0;\n -webkit-transform-style: flat;\n transform-style: flat;\n -webkit-transition: none 0s ease 0s;\n transition: none 0s ease 0s;\n unicode-bidi: normal;\n vertical-align: baseline;\n visibility: visible;\n white-space: normal;\n widows: 2;\n width: auto;\n word-spacing: normal;\n z-index: auto;\n display: block;\n position: fixed;\n top: 0;\n left: 50%;\n width: 550px;\n margin-left: -275px;\n\n}\n.view---enterprise---dev---3-FWY .form-horizontal---enterprise---dev---2xai_ {\n width: 550px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n }\n.view---enterprise---dev---3-FWY {\n margin-left: -225px;\n z-index: 1050;\n background-color: #FFFFFF;\n border: none;\n -webkit-box-shadow: 0 3px 7px rgba(0,0,0,0.3);\n box-shadow: 0 3px 7px rgba(0,0,0,0.3);\n outline: none;\n -webkit-transition: opacity 0.125s, top 0.125s ease;\n transition: opacity 0.125s, top 0.125s ease;\n opacity: 0;\n font-size: 14px;\n font-family: "Splunk Platform Sans", "Proxima Nova", Roboto, Droid, "Helvetica Neue", Helvetica, Arial, sans-serif;\n}\n/* SPL-68751 - IE10 box shadow animation artifacts fix */\n.view---enterprise---dev---3-FWY:after {\n content: "";\n font-size: 0;\n display: inline;\n overflow: hidden;\n }\n.view---enterprise---dev---3-FWY[data-modal-state=open] {\n top: 40px;\n opacity: 1;\n }\n.view---enterprise---dev---3-FWY [data-icon=splunk] {\n color: #000000;\n }\n/* modal */\n/* Header\n/* =============== */\n.headerWrapper---enterprise---dev---1r5ZO {\n background: #FFFFFF;\n}\n.headerWrapper---enterprise---dev---1r5ZO:empty {\n display: none;\n }\n.header---enterprise---dev---2drCX {\n position: relative;\n padding: 20px;\n}\n.title---enterprise---dev---3FyHm {\n font-size: 18px;\n font-weight: 500;\n line-height: 22px;\n margin: 0;\n overflow-wrap: break-word;\n padding-right: 40px;\n color: #3C444D;\n}\n.closeWrapper---enterprise---dev---1tA_W {\n top: 15px;\n right: 15px;\n position: absolute;\n}\n/* Body\n/* =============== */\n.body---enterprise---dev---3Fy7o {\n max-height: calc(100vh - 200px);\n}\n.body---enterprise---dev---3Fy7o:last-child {\n border-bottom: none;\n }\n.bodyPadded---enterprise---dev---1wE9c {\n padding: 20px;\n}\n.bodyScrolling---enterprise---dev---3Eq-r {\n overflow-y: auto;\n border-top: 1px solid #C3CBD4;\n border-bottom: 1px solid #C3CBD4;\n}\n.bodyScrollingPadded---enterprise---dev---3-Tyf {\n padding: 20px;\n color: #000000;\n}\n/* Footer\n/* =============== */\n.footer---enterprise---dev---3kLNz {\n padding: 20px;\n margin-bottom: 0;\n text-align: right; /* right align buttons */\n background: #FFFFFF;\n border-radius: 0 0 8px 8px;\n}\n.footer---enterprise---dev---3kLNz:before,\n .footer---enterprise---dev---3kLNz:after {\n display: table;\n content: "";\n line-height: 0;\n }\n.footer---enterprise---dev---3kLNz:after {\n clear: both;\n }\n.buttonsLeft---enterprise---dev---2AEZB {\n float: left;\n}\n.buttonsRight---enterprise---dev---3KgCx {\n float: right;\n}\n',""]),t.locals={backdrop:"backdrop---enterprise---dev---iB99T",view:"view---enterprise---dev---3-FWY","form-horizontal":"form-horizontal---enterprise---dev---2xai_",headerWrapper:"headerWrapper---enterprise---dev---1r5ZO",header:"header---enterprise---dev---2drCX headerWrapper---enterprise---dev---1r5ZO",title:"title---enterprise---dev---3FyHm",closeWrapper:"closeWrapper---enterprise---dev---1tA_W",body:"body---enterprise---dev---3Fy7o",bodyPadded:"bodyPadded---enterprise---dev---1wE9c body---enterprise---dev---3Fy7o",bodyScrolling:"bodyScrolling---enterprise---dev---3Eq-r body---enterprise---dev---3Fy7o",bodyScrollingPadded:"bodyScrollingPadded---enterprise---dev---3-Tyf bodyScrolling---enterprise---dev---3Eq-r body---enterprise---dev---3Fy7o",footer:"footer---enterprise---dev---3kLNz",buttonsLeft:"buttonsLeft---enterprise---dev---2AEZB",buttonsRight:"buttonsRight---enterprise---dev---3KgCx"}},160:function(e,t){e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},161:function(e,t,n){var i=n(13),r=n(159).set;e.exports=function(e,t,n){var o,a=t.constructor;return a!==n&&"function"==typeof a&&(o=a.prototype)!==n.prototype&&i(o)&&r&&r(e,o),e}},162:function(e,t){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},163:function(e,t){var n=Math.expm1;e.exports=!n||n(10)>22025.465794806718||n(10)<22025.465794806718||-2e-17!=n(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Math.exp(e)-1}:n},164:function(e,t,n){var i=n(41),r=n(57);e.exports=function(e){return function(t,n){var o,a,s=String(r(t)),l=i(n),c=s.length;return l<0||l>=c?e?"":void 0:(o=s.charCodeAt(l))<55296||o>56319||l+1===c||(a=s.charCodeAt(l+1))<56320||a>57343?e?s.charAt(l):o:e?s.slice(l,l+2):a-56320+(o-55296<<10)+65536}}},165:function(e,t,n){"use strict";var i=n(67),r=n(3),o=n(28),a=n(35),s=n(80),l=n(248),c=n(78),d=n(71),u=n(15)("iterator"),h=!([].keys&&"next"in[].keys()),p=function(){return this};e.exports=function(e,t,n,f,m,g,b){l(n,t,f);var v,y,w,x=function(e){if(!h&&e in _)return _[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},S=t+" Iterator",k="values"==m,C=!1,_=e.prototype,M=_[u]||_["@@iterator"]||m&&_[m],T=M||x(m),A=m?k?x("entries"):T:void 0,O="Array"==t&&_.entries||M;if(O&&(w=d(O.call(new e)))!==Object.prototype&&w.next&&(c(w,S,!0),i||"function"==typeof w[u]||a(w,u,p)),k&&M&&"values"!==M.name&&(C=!0,T=function(){return M.call(this)}),i&&!b||!h&&!C&&_[u]||a(_,u,T),s[t]=T,s[S]=p,m)if(v={values:k?T:x("values"),keys:g?T:x("keys"),entries:A},b)for(y in v)y in _||o(_,y,v[y]);else r(r.P+r.F*(h||C),t,v);return v}},166:function(e,t,n){var i=n(167),r=n(57);e.exports=function(e,t,n){if(i(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(r(e))}},167:function(e,t,n){var i=n(13),r=n(51),o=n(15)("match");e.exports=function(e){var t;return i(e)&&(void 0!==(t=e[o])?!!t:"RegExp"==r(e))}},168:function(e,t,n){var i=n(15)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[i]=!1,!"/./"[e](t)}catch(e){}}return!0}},169:function(e,t,n){var i=n(80),r=n(15)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||o[r]===e)}},17:function(e,t,n){var i=n(12),r=n(231),o=n(55),a=Object.defineProperty;t.f=n(21)?Object.defineProperty:function(e,t,n){if(i(e),t=o(t,!0),i(n),r)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},170:function(e,t,n){var i=n(98),r=n(15)("iterator"),o=n(80);e.exports=n(48).getIteratorMethod=function(e){if(null!=e)return e[r]||e["@@iterator"]||o[i(e)]}},171:function(e,t,n){"use strict";var i=n(27),r=n(68),o=n(18);e.exports=function(e){for(var t=i(this),n=o(t.length),a=arguments.length,s=r(a>1?arguments[1]:void 0,n),l=a>2?arguments[2]:void 0,c=void 0===l?n:r(l,n);c>s;)t[s++]=e;return t}},172:function(e,t,n){"use strict";var i=n(99),r=n(253),o=n(80),a=n(40);e.exports=n(165)(Array,"Array",(function(e,t){this._t=a(e),this._i=0,this._k=t}),(function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,r(1)):r(0,"keys"==t?n:"values"==t?e[n]:[n,e[n]])}),"values"),o.Arguments=o.Array,i("keys"),i("values"),i("entries")},173:function(e,t,n){"use strict";var i,r,o=n(122),a=RegExp.prototype.exec,s=String.prototype.replace,l=a,c=(i=/a/,r=/b*/g,a.call(i,"a"),a.call(r,"a"),0!==i.lastIndex||0!==r.lastIndex),d=void 0!==/()??/.exec("")[1];(c||d)&&(l=function(e){var t,n,i,r,l=this;return d&&(n=new RegExp("^"+l.source+"$(?!\\s)",o.call(l))),c&&(t=l.lastIndex),i=a.call(l,e),c&&i&&(l.lastIndex=l.global?i.index+i[0].length:t),d&&i&&i.length>1&&s.call(i[0],n,(function(){for(r=1;r>1,d=23===t?_(2,-24)-_(2,-77):0,u=0,h=e<0||0===e&&1/e<0?1:0;for((e=C(e))!=e||e===S?(r=e!=e?1:0,i=l):(i=M(T(e)/A),e*(o=_(2,-i))<1&&(i--,o*=2),(e+=i+c>=1?d/o:d*_(2,1-c))*o>=2&&(i++,o/=2),i+c>=l?(r=0,i=l):i+c>=1?(r=(e*o-1)*_(2,t),i+=c):(r=e*_(2,c-1)*_(2,t),i=0));t>=8;a[u++]=255&r,r/=256,t-=8);for(i=i<0;a[u++]=255&i,i/=256,s-=8);return a[--u]|=128*h,a}function I(e,t,n){var i,r=8*n-t-1,o=(1<>1,s=r-7,l=n-1,c=e[l--],d=127&c;for(c>>=7;s>0;d=256*d+e[l],l--,s-=8);for(i=d&(1<<-s)-1,d>>=-s,s+=t;s>0;i=256*i+e[l],l--,s-=8);if(0===d)d=1-a;else{if(d===o)return i?NaN:c?-S:S;i+=_(2,t),d-=a}return(c?-1:1)*i*_(2,d-t)}function R(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function D(e){return[255&e]}function N(e){return[255&e,e>>8&255]}function B(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function F(e){return P(e,52,8)}function j(e){return P(e,23,4)}function z(e,t,n){m(e.prototype,t,{get:function(){return this[n]}})}function H(e,t,n,i){var r=p(+n);if(r+t>e[E])throw x("Wrong index!");var o=e[O]._b,a=r+e[L],s=o.slice(a,a+t);return i?s:s.reverse()}function V(e,t,n,i,r,o){var a=p(+n);if(a+t>e[E])throw x("Wrong index!");for(var s=e[O]._b,l=a+e[L],c=i(+r),d=0;dY;)($=U[Y++])in v||s(v,$,k[$]);o||(W.constructor=v)}var q=new y(new v(2)),G=y.prototype.setInt8;q.setInt8(0,2147483648),q.setInt8(1,2147483649),!q.getInt8(0)&&q.getInt8(1)||l(y.prototype,{setInt8:function(e,t){G.call(this,e,t<<24>>24)},setUint8:function(e,t){G.call(this,e,t<<24>>24)}},!0)}else v=function(e){d(this,v,"ArrayBuffer");var t=p(e);this._b=g.call(new Array(t),0),this[E]=t},y=function(e,t,n){d(this,y,"DataView"),d(e,v,"DataView");var i=e[E],r=u(t);if(r<0||r>i)throw x("Wrong offset!");if(r+(n=void 0===n?i-r:h(n))>i)throw x("Wrong length!");this[O]=e,this[L]=r,this[E]=n},r&&(z(v,"byteLength","_l"),z(y,"buffer","_b"),z(y,"byteLength","_l"),z(y,"byteOffset","_o")),l(y.prototype,{getInt8:function(e){return H(this,1,e)[0]<<24>>24},getUint8:function(e){return H(this,1,e)[0]},getInt16:function(e){var t=H(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=H(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return R(H(this,4,e,arguments[1]))},getUint32:function(e){return R(H(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return I(H(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return I(H(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){V(this,1,e,D,t)},setUint8:function(e,t){V(this,1,e,D,t)},setInt16:function(e,t){V(this,2,e,N,t,arguments[2])},setUint16:function(e,t){V(this,2,e,N,t,arguments[2])},setInt32:function(e,t){V(this,4,e,B,t,arguments[2])},setUint32:function(e,t){V(this,4,e,B,t,arguments[2])},setFloat32:function(e,t){V(this,4,e,j,t,arguments[2])},setFloat64:function(e,t){V(this,8,e,F,t,arguments[2])}});b(v,"ArrayBuffer"),b(y,"DataView"),s(y.prototype,a.VIEW,!0),t.ArrayBuffer=v,t.DataView=y},176:function(e,t){t.BITS=32,t.GROUPS=4,t.RE_ADDRESS=/^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/g,t.RE_SUBNET_STRING=/\/\d{1,2}$/},177:function(e,t){t.BITS=128,t.GROUPS=8,t.SCOPES={0:"Reserved",1:"Interface local",2:"Link local",4:"Admin local",5:"Site local",8:"Organization local",14:"Global",15:"Reserved"},t.TYPES={"ff01::1/128":"Multicast (All nodes on this interface)","ff01::2/128":"Multicast (All routers on this interface)","ff02::1/128":"Multicast (All nodes on this link)","ff02::2/128":"Multicast (All routers on this link)","ff05::2/128":"Multicast (All routers in this site)","ff02::5/128":"Multicast (OSPFv3 AllSPF routers)","ff02::6/128":"Multicast (OSPFv3 AllDR routers)","ff02::9/128":"Multicast (RIP routers)","ff02::a/128":"Multicast (EIGRP routers)","ff02::d/128":"Multicast (PIM routers)","ff02::16/128":"Multicast (MLDv2 reports)","ff01::fb/128":"Multicast (mDNSv6)","ff02::fb/128":"Multicast (mDNSv6)","ff05::fb/128":"Multicast (mDNSv6)","ff02::1:2/128":"Multicast (All DHCP servers and relay agents on this link)","ff05::1:2/128":"Multicast (All DHCP servers and relay agents in this site)","ff02::1:3/128":"Multicast (All DHCP servers on this link)","ff05::1:3/128":"Multicast (All DHCP servers in this site)","::/128":"Unspecified","::1/128":"Loopback","ff00::/8":"Multicast","fe80::/10":"Link-local unicast"},t.RE_BAD_CHARACTERS=/([^0-9a-f:\/%])/gi,t.RE_BAD_ADDRESS=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/gi,t.RE_SUBNET_STRING=/\/\d{1,3}(?=%|$)/,t.RE_ZONE_STRING=/%.*$/,t.RE_URL=new RegExp(/^\[{0,1}([0-9a-f:]+)\]{0,1}/),t.RE_URL_WITH_PORT=new RegExp(/\[([0-9a-f:]+)\]:([0-9]{1,5})/)},178:function(e,t,n){"use strict";t.decode=t.parse=n(509),t.encode=t.stringify=n(510)},179:function(e,t,n){var i=n(543),r=n(549);e.exports=function(e,t){var n=r(e,t);return i(n)?n:void 0}},18:function(e,t,n){var i=n(41),r=Math.min;e.exports=function(e){return e>0?r(i(e),9007199254740991):0}},180:function(e,t,n){var i=n(102),r=n(73);e.exports=function(e){if(!r(e))return!1;var t=i(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},181:function(e,t,n){var i=n(85).Symbol;e.exports=i},182:function(e,t,n){var i=n(273);e.exports=function(e,t,n){"__proto__"==t&&i?i(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},183:function(e,t){var n=Array.isArray;e.exports=n},184:function(e,t,n){var i=n(180),r=n(277);e.exports=function(e){return null!=e&&r(e.length)&&!i(e)}},185:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(e){return e&&e.__esModule?e:{default:e}}(n(286)),r=n(130);function o(e){for(var t=1;t0?i:n)(e)}},189:function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},19:function(e,t,n){(function(e){e.exports=function(){"use strict";var t,i;function r(){return t.apply(null,arguments)}function o(e){return e instanceof Array||"[object Array]"===Object.prototype.toString.call(e)}function a(e){return null!=e&&"[object Object]"===Object.prototype.toString.call(e)}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function l(e){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(e).length;var t;for(t in e)if(s(e,t))return!1;return!0}function c(e){return void 0===e}function d(e){return"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e)}function u(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function h(e,t){var n,i=[];for(n=0;n>>0;for(t=0;t0)for(n=0;n=0?n?"+":"":"-")+Math.pow(10,Math.max(0,r)).toString().substr(1)+i}r.suppressDeprecationWarnings=!1,r.deprecationHandler=null,_=Object.keys?Object.keys:function(e){var t,n=[];for(t in e)s(e,t)&&n.push(t);return n};var P=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,I=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,R={},D={};function N(e,t,n,i){var r=i;"string"==typeof i&&(r=function(){return this[i]()}),e&&(D[e]=r),t&&(D[t[0]]=function(){return L(r.apply(this,arguments),t[1],t[2])}),n&&(D[n]=function(){return this.localeData().ordinal(r.apply(this,arguments),e)})}function B(e,t){return e.isValid()?(t=F(t,e.localeData()),R[t]=R[t]||function(e){var t,n,i,r=e.match(P);for(t=0,n=r.length;t=0&&I.test(e);)e=e.replace(I,i),I.lastIndex=0,n-=1;return e}var j={};function z(e,t){var n=e.toLowerCase();j[n]=j[n+"s"]=j[t]=e}function H(e){return"string"==typeof e?j[e]||j[e.toLowerCase()]:void 0}function V(e){var t,n,i={};for(n in e)s(e,n)&&(t=H(n))&&(i[t]=e[n]);return i}var $={};function W(e,t){$[e]=t}function U(e){return e%4==0&&e%100!=0||e%400==0}function Y(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function q(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=Y(t)),n}function G(e,t){return function(n){return null!=n?(K(this,e,n),r.updateOffset(this,t),this):X(this,e)}}function X(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function K(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&U(e.year())&&1===e.month()&&29===e.date()?(n=q(n),e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Se(n,e.month()))):e._d["set"+(e._isUTC?"UTC":"")+t](n))}var Z,J=/\d/,Q=/\d\d/,ee=/\d{3}/,te=/\d{4}/,ne=/[+-]?\d{6}/,ie=/\d\d?/,re=/\d\d\d\d?/,oe=/\d\d\d\d\d\d?/,ae=/\d{1,3}/,se=/\d{1,4}/,le=/[+-]?\d{1,6}/,ce=/\d+/,de=/[+-]?\d+/,ue=/Z|[+-]\d\d:?\d\d/gi,he=/Z|[+-]\d\d(?::?\d\d)?/gi,pe=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function fe(e,t,n){Z[e]=A(t)?t:function(e,i){return e&&n?n:t}}function me(e,t){return s(Z,e)?Z[e](t._strict,t._locale):new RegExp(ge(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(e,t,n,i,r){return t||n||i||r}))))}function ge(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}Z={};var be,ve={};function ye(e,t){var n,i=t;for("string"==typeof e&&(e=[e]),d(t)&&(i=function(e,n){n[t]=q(e)}),n=0;n68?1900:2e3)};var Ie=G("FullYear",!0);function Re(e,t,n,i,r,o,a){var s;return e<100&&e>=0?(s=new Date(e+400,t,n,i,r,o,a),isFinite(s.getFullYear())&&s.setFullYear(e)):s=new Date(e,t,n,i,r,o,a),s}function De(e){var t,n;return e<100&&e>=0?((n=Array.prototype.slice.call(arguments))[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function Ne(e,t,n){var i=7+t-n;return-(7+De(e,0,i).getUTCDay()-t)%7+i-1}function Be(e,t,n,i,r){var o,a,s=1+7*(t-1)+(7+n-i)%7+Ne(e,i,r);return s<=0?a=Pe(o=e-1)+s:s>Pe(e)?(o=e+1,a=s-Pe(e)):(o=e,a=s),{year:o,dayOfYear:a}}function Fe(e,t,n){var i,r,o=Ne(e.year(),t,n),a=Math.floor((e.dayOfYear()-o-1)/7)+1;return a<1?i=a+je(r=e.year()-1,t,n):a>je(e.year(),t,n)?(i=a-je(e.year(),t,n),r=e.year()+1):(r=e.year(),i=a),{week:i,year:r}}function je(e,t,n){var i=Ne(e,t,n),r=Ne(e+1,t,n);return(Pe(e)-i+r)/7}function ze(e,t){return e.slice(t,7).concat(e.slice(0,t))}N("w",["ww",2],"wo","week"),N("W",["WW",2],"Wo","isoWeek"),z("week","w"),z("isoWeek","W"),W("week",5),W("isoWeek",5),fe("w",ie),fe("ww",ie,Q),fe("W",ie),fe("WW",ie,Q),we(["w","ww","W","WW"],(function(e,t,n,i){t[i.substr(0,1)]=q(e)})),N("d",0,"do","day"),N("dd",0,0,(function(e){return this.localeData().weekdaysMin(this,e)})),N("ddd",0,0,(function(e){return this.localeData().weekdaysShort(this,e)})),N("dddd",0,0,(function(e){return this.localeData().weekdays(this,e)})),N("e",0,0,"weekday"),N("E",0,0,"isoWeekday"),z("day","d"),z("weekday","e"),z("isoWeekday","E"),W("day",11),W("weekday",11),W("isoWeekday",11),fe("d",ie),fe("e",ie),fe("E",ie),fe("dd",(function(e,t){return t.weekdaysMinRegex(e)})),fe("ddd",(function(e,t){return t.weekdaysShortRegex(e)})),fe("dddd",(function(e,t){return t.weekdaysRegex(e)})),we(["dd","ddd","dddd"],(function(e,t,n,i){var r=n._locale.weekdaysParse(e,i,n._strict);null!=r?t.d=r:m(n).invalidWeekday=e})),we(["d","e","E"],(function(e,t,n,i){t[i]=q(e)}));var He="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ve="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),$e="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),We=pe,Ue=pe,Ye=pe;function qe(e,t,n){var i,r,o,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],i=0;i<7;++i)o=f([2e3,1]).day(i),this._minWeekdaysParse[i]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[i]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[i]=this.weekdays(o,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(r=be.call(this._weekdaysParse,a))?r:null:"ddd"===t?-1!==(r=be.call(this._shortWeekdaysParse,a))?r:null:-1!==(r=be.call(this._minWeekdaysParse,a))?r:null:"dddd"===t?-1!==(r=be.call(this._weekdaysParse,a))||-1!==(r=be.call(this._shortWeekdaysParse,a))||-1!==(r=be.call(this._minWeekdaysParse,a))?r:null:"ddd"===t?-1!==(r=be.call(this._shortWeekdaysParse,a))||-1!==(r=be.call(this._weekdaysParse,a))||-1!==(r=be.call(this._minWeekdaysParse,a))?r:null:-1!==(r=be.call(this._minWeekdaysParse,a))||-1!==(r=be.call(this._weekdaysParse,a))||-1!==(r=be.call(this._shortWeekdaysParse,a))?r:null}function Ge(){function e(e,t){return t.length-e.length}var t,n,i,r,o,a=[],s=[],l=[],c=[];for(t=0;t<7;t++)n=f([2e3,1]).day(t),i=ge(this.weekdaysMin(n,"")),r=ge(this.weekdaysShort(n,"")),o=ge(this.weekdays(n,"")),a.push(i),s.push(r),l.push(o),c.push(i),c.push(r),c.push(o);a.sort(e),s.sort(e),l.sort(e),c.sort(e),this._weekdaysRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Xe(){return this.hours()%12||12}function Ke(e,t){N(e,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)}))}function Ze(e,t){return t._meridiemParse}N("H",["HH",2],0,"hour"),N("h",["hh",2],0,Xe),N("k",["kk",2],0,(function(){return this.hours()||24})),N("hmm",0,0,(function(){return""+Xe.apply(this)+L(this.minutes(),2)})),N("hmmss",0,0,(function(){return""+Xe.apply(this)+L(this.minutes(),2)+L(this.seconds(),2)})),N("Hmm",0,0,(function(){return""+this.hours()+L(this.minutes(),2)})),N("Hmmss",0,0,(function(){return""+this.hours()+L(this.minutes(),2)+L(this.seconds(),2)})),Ke("a",!0),Ke("A",!1),z("hour","h"),W("hour",13),fe("a",Ze),fe("A",Ze),fe("H",ie),fe("h",ie),fe("k",ie),fe("HH",ie,Q),fe("hh",ie,Q),fe("kk",ie,Q),fe("hmm",re),fe("hmmss",oe),fe("Hmm",re),fe("Hmmss",oe),ye(["H","HH"],3),ye(["k","kk"],(function(e,t,n){var i=q(e);t[3]=24===i?0:i})),ye(["a","A"],(function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e})),ye(["h","hh"],(function(e,t,n){t[3]=q(e),m(n).bigHour=!0})),ye("hmm",(function(e,t,n){var i=e.length-2;t[3]=q(e.substr(0,i)),t[4]=q(e.substr(i)),m(n).bigHour=!0})),ye("hmmss",(function(e,t,n){var i=e.length-4,r=e.length-2;t[3]=q(e.substr(0,i)),t[4]=q(e.substr(i,2)),t[5]=q(e.substr(r)),m(n).bigHour=!0})),ye("Hmm",(function(e,t,n){var i=e.length-2;t[3]=q(e.substr(0,i)),t[4]=q(e.substr(i))})),ye("Hmmss",(function(e,t,n){var i=e.length-4,r=e.length-2;t[3]=q(e.substr(0,i)),t[4]=q(e.substr(i,2)),t[5]=q(e.substr(r))}));var Je,Qe=G("Hours",!0),et={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:ke,monthsShort:Ce,week:{dow:0,doy:6},weekdays:He,weekdaysMin:$e,weekdaysShort:Ve,meridiemParse:/[ap]\.?m?\.?/i},tt={},nt={};function it(e,t){var n,i=Math.min(e.length,t.length);for(n=0;n0;){if(i=ot(r.slice(0,t).join("-")))return i;if(n&&n.length>=t&&it(r,n)>=t-1)break;t--}o++}return Je}(e)}function ct(e){var t,n=e._a;return n&&-2===m(e).overflow&&(t=n[1]<0||n[1]>11?1:n[2]<1||n[2]>Se(n[0],n[1])?2:n[3]<0||n[3]>24||24===n[3]&&(0!==n[4]||0!==n[5]||0!==n[6])?3:n[4]<0||n[4]>59?4:n[5]<0||n[5]>59?5:n[6]<0||n[6]>999?6:-1,m(e)._overflowDayOfYear&&(t<0||t>2)&&(t=2),m(e)._overflowWeeks&&-1===t&&(t=7),m(e)._overflowWeekday&&-1===t&&(t=8),m(e).overflow=t),e}var dt=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ut=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ht=/Z|[+-]\d\d(?::?\d\d)?/,pt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],ft=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],mt=/^\/?Date\((-?\d+)/i,gt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,bt={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function vt(e){var t,n,i,r,o,a,s=e._i,l=dt.exec(s)||ut.exec(s);if(l){for(m(e).iso=!0,t=0,n=pt.length;t7)&&(l=!0)):(o=e._locale._week.dow,a=e._locale._week.doy,c=Fe(Mt(),o,a),n=xt(t.gg,e._a[0],c.year),i=xt(t.w,c.week),null!=t.d?((r=t.d)<0||r>6)&&(l=!0):null!=t.e?(r=t.e+o,(t.e<0||t.e>6)&&(l=!0)):r=o),i<1||i>je(n,o,a)?m(e)._overflowWeeks=!0:null!=l?m(e)._overflowWeekday=!0:(s=Be(n,i,r,o,a),e._a[0]=s.year,e._dayOfYear=s.dayOfYear)}(e),null!=e._dayOfYear&&(a=xt(e._a[0],i[0]),(e._dayOfYear>Pe(a)||0===e._dayOfYear)&&(m(e)._overflowDayOfYear=!0),n=De(a,0,e._dayOfYear),e._a[1]=n.getUTCMonth(),e._a[2]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=s[t]=i[t];for(;t<7;t++)e._a[t]=s[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[3]&&0===e._a[4]&&0===e._a[5]&&0===e._a[6]&&(e._nextDay=!0,e._a[3]=0),e._d=(e._useUTC?De:Re).apply(null,s),o=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[3]=24),e._w&&void 0!==e._w.d&&e._w.d!==o&&(m(e).weekdayMismatch=!0)}}function kt(e){if(e._f!==r.ISO_8601)if(e._f!==r.RFC_2822){e._a=[],m(e).empty=!0;var t,n,i,o,a,s,l=""+e._i,c=l.length,d=0;for(i=F(e._f,e._locale).match(P)||[],t=0;t0&&m(e).unusedInput.push(a),l=l.slice(l.indexOf(n)+n.length),d+=n.length),D[o]?(n?m(e).empty=!1:m(e).unusedTokens.push(o),xe(o,n,e)):e._strict&&!n&&m(e).unusedTokens.push(o);m(e).charsLeftOver=c-d,l.length>0&&m(e).unusedInput.push(l),e._a[3]<=12&&!0===m(e).bigHour&&e._a[3]>0&&(m(e).bigHour=void 0),m(e).parsedDateParts=e._a.slice(0),m(e).meridiem=e._meridiem,e._a[3]=function(e,t,n){var i;return null==n?t:null!=e.meridiemHour?e.meridiemHour(t,n):null!=e.isPM?((i=e.isPM(n))&&t<12&&(t+=12),i||12!==t||(t=0),t):t}(e._locale,e._a[3],e._meridiem),null!==(s=m(e).era)&&(e._a[0]=e._locale.erasConvertYear(s,e._a[0])),St(e),ct(e)}else wt(e);else vt(e)}function Ct(e){var t=e._i,n=e._f;return e._locale=e._locale||lt(e._l),null===t||void 0===n&&""===t?b({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),S(t)?new x(ct(t)):(u(t)?e._d=t:o(n)?function(e){var t,n,i,r,o,a,s=!1;if(0===e._f.length)return m(e).invalidFormat=!0,void(e._d=new Date(NaN));for(r=0;rthis?this:e:b()}));function Ot(e,t){var n,i;if(1===t.length&&o(t[0])&&(t=t[0]),!t.length)return Mt();for(n=t[0],i=1;i=0?new Date(e+400,t,n)-126227808e5:new Date(e,t,n).valueOf()}function on(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-126227808e5:Date.UTC(e,t,n)}function an(e,t){return t.erasAbbrRegex(e)}function sn(){var e,t,n=[],i=[],r=[],o=[],a=this.eras();for(e=0,t=a.length;e(o=je(e,i,r))&&(t=o),dn.call(this,e,t,n,i,r))}function dn(e,t,n,i,r){var o=Be(e,t,n,i,r),a=De(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}N("N",0,0,"eraAbbr"),N("NN",0,0,"eraAbbr"),N("NNN",0,0,"eraAbbr"),N("NNNN",0,0,"eraName"),N("NNNNN",0,0,"eraNarrow"),N("y",["y",1],"yo","eraYear"),N("y",["yy",2],0,"eraYear"),N("y",["yyy",3],0,"eraYear"),N("y",["yyyy",4],0,"eraYear"),fe("N",an),fe("NN",an),fe("NNN",an),fe("NNNN",(function(e,t){return t.erasNameRegex(e)})),fe("NNNNN",(function(e,t){return t.erasNarrowRegex(e)})),ye(["N","NN","NNN","NNNN","NNNNN"],(function(e,t,n,i){var r=n._locale.erasParse(e,i,n._strict);r?m(n).era=r:m(n).invalidEra=e})),fe("y",ce),fe("yy",ce),fe("yyy",ce),fe("yyyy",ce),fe("yo",(function(e,t){return t._eraYearOrdinalRegex||ce})),ye(["y","yy","yyy","yyyy"],0),ye(["yo"],(function(e,t,n,i){var r;n._locale._eraYearOrdinalRegex&&(r=e.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?t[0]=n._locale.eraYearOrdinalParse(e,r):t[0]=parseInt(e,10)})),N(0,["gg",2],0,(function(){return this.weekYear()%100})),N(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),ln("gggg","weekYear"),ln("ggggg","weekYear"),ln("GGGG","isoWeekYear"),ln("GGGGG","isoWeekYear"),z("weekYear","gg"),z("isoWeekYear","GG"),W("weekYear",1),W("isoWeekYear",1),fe("G",de),fe("g",de),fe("GG",ie,Q),fe("gg",ie,Q),fe("GGGG",se,te),fe("gggg",se,te),fe("GGGGG",le,ne),fe("ggggg",le,ne),we(["gggg","ggggg","GGGG","GGGGG"],(function(e,t,n,i){t[i.substr(0,2)]=q(e)})),we(["gg","GG"],(function(e,t,n,i){t[i]=r.parseTwoDigitYear(e)})),N("Q",0,"Qo","quarter"),z("quarter","Q"),W("quarter",7),fe("Q",J),ye("Q",(function(e,t){t[1]=3*(q(e)-1)})),N("D",["DD",2],"Do","date"),z("date","D"),W("date",9),fe("D",ie),fe("DD",ie,Q),fe("Do",(function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient})),ye(["D","DD"],2),ye("Do",(function(e,t){t[2]=q(e.match(ie)[0])}));var un=G("Date",!0);N("DDD",["DDDD",3],"DDDo","dayOfYear"),z("dayOfYear","DDD"),W("dayOfYear",4),fe("DDD",ae),fe("DDDD",ee),ye(["DDD","DDDD"],(function(e,t,n){n._dayOfYear=q(e)})),N("m",["mm",2],0,"minute"),z("minute","m"),W("minute",14),fe("m",ie),fe("mm",ie,Q),ye(["m","mm"],4);var hn=G("Minutes",!1);N("s",["ss",2],0,"second"),z("second","s"),W("second",15),fe("s",ie),fe("ss",ie,Q),ye(["s","ss"],5);var pn,fn,mn=G("Seconds",!1);for(N("S",0,0,(function(){return~~(this.millisecond()/100)})),N(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),N(0,["SSS",3],0,"millisecond"),N(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),N(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),N(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),N(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),N(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),N(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),z("millisecond","ms"),W("millisecond",16),fe("S",ae,J),fe("SS",ae,Q),fe("SSS",ae,ee),pn="SSSS";pn.length<=9;pn+="S")fe(pn,ce);function gn(e,t){t[6]=q(1e3*("0."+e))}for(pn="S";pn.length<=9;pn+="S")ye(pn,gn);fn=G("Milliseconds",!1),N("z",0,0,"zoneAbbr"),N("zz",0,0,"zoneName");var bn=x.prototype;function vn(e){return e}bn.add=qt,bn.calendar=function(e,t){1===arguments.length&&(arguments[0]?Kt(arguments[0])?(e=arguments[0],t=void 0):Zt(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var n=e||Mt(),i=Bt(n,this).startOf("day"),o=r.calendarFormat(this,i)||"sameElse",a=t&&(A(t[o])?t[o].call(this,n):t[o]);return this.format(a||this.localeData().calendar(o,this,Mt(n)))},bn.clone=function(){return new x(this)},bn.diff=function(e,t,n){var i,r,o;if(!this.isValid())return NaN;if(!(i=Bt(e,this)).isValid())return NaN;switch(r=6e4*(i.utcOffset()-this.utcOffset()),t=H(t)){case"year":o=Jt(this,i)/12;break;case"month":o=Jt(this,i);break;case"quarter":o=Jt(this,i)/3;break;case"second":o=(this-i)/1e3;break;case"minute":o=(this-i)/6e4;break;case"hour":o=(this-i)/36e5;break;case"day":o=(this-i-r)/864e5;break;case"week":o=(this-i-r)/6048e5;break;default:o=this-i}return n?o:Y(o)},bn.endOf=function(e){var t,n;if(void 0===(e=H(e))||"millisecond"===e||!this.isValid())return this;switch(n=this._isUTC?on:rn,e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=36e5-nn(t+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":t=this._d.valueOf(),t+=6e4-nn(t,6e4)-1;break;case"second":t=this._d.valueOf(),t+=1e3-nn(t,1e3)-1}return this._d.setTime(t),r.updateOffset(this,!0),this},bn.format=function(e){e||(e=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var t=B(this,e);return this.localeData().postformat(t)},bn.from=function(e,t){return this.isValid()&&(S(e)&&e.isValid()||Mt(e).isValid())?Vt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},bn.fromNow=function(e){return this.from(Mt(),e)},bn.to=function(e,t){return this.isValid()&&(S(e)&&e.isValid()||Mt(e).isValid())?Vt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},bn.toNow=function(e){return this.to(Mt(),e)},bn.get=function(e){return A(this[e=H(e)])?this[e]():this},bn.invalidAt=function(){return m(this).overflow},bn.isAfter=function(e,t){var n=S(e)?e:Mt(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=H(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()9999?B(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):A(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",B(n,"Z")):B(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},bn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e,t,n,i="moment",r="";return this.isLocal()||(i=0===this.utcOffset()?"moment.utc":"moment.parseZone",r="Z"),e="["+i+'("]',t=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",n=r+'[")]',this.format(e+t+"-MM-DD[T]HH:mm:ss.SSS"+n)},"undefined"!=typeof Symbol&&null!=Symbol.for&&(bn[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),bn.toJSON=function(){return this.isValid()?this.toISOString():null},bn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},bn.unix=function(){return Math.floor(this.valueOf()/1e3)},bn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},bn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},bn.eraName=function(){var e,t,n,i=this.localeData().eras();for(e=0,t=i.length;ethis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},bn.isLocal=function(){return!!this.isValid()&&!this._isUTC},bn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},bn.isUtc=jt,bn.isUTC=jt,bn.zoneAbbr=function(){return this._isUTC?"UTC":""},bn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},bn.dates=C("dates accessor is deprecated. Use date instead.",un),bn.months=C("months accessor is deprecated. Use month instead",Ee),bn.years=C("years accessor is deprecated. Use year instead",Ie),bn.zone=C("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()})),bn.isDSTShifted=C("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!c(this._isDSTShifted))return this._isDSTShifted;var e,t={};return w(t,this),(t=Ct(t))._a?(e=t._isUTC?f(t._a):Mt(t._a),this._isDSTShifted=this.isValid()&&function(e,t,n){var i,r=Math.min(e.length,t.length),o=Math.abs(e.length-t.length),a=0;for(i=0;i0):this._isDSTShifted=!1,this._isDSTShifted}));var yn=E.prototype;function wn(e,t,n,i){var r=lt(),o=f().set(i,t);return r[n](o,e)}function xn(e,t,n){if(d(e)&&(t=e,e=void 0),e=e||"",null!=t)return wn(e,t,n,"month");var i,r=[];for(i=0;i<12;i++)r[i]=wn(e,i,n,"month");return r}function Sn(e,t,n,i){"boolean"==typeof e?(d(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,d(t)&&(n=t,t=void 0),t=t||"");var r,o=lt(),a=e?o._week.dow:0,s=[];if(null!=n)return wn(t,(n+a)%7,i,"day");for(r=0;r<7;r++)s[r]=wn(t,(r+a)%7,i,"day");return s}yn.calendar=function(e,t,n){var i=this._calendar[e]||this._calendar.sameElse;return A(i)?i.call(t,n):i},yn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.match(P).map((function(e){return"MMMM"===e||"MM"===e||"DD"===e||"dddd"===e?e.slice(1):e})).join(""),this._longDateFormat[e])},yn.invalidDate=function(){return this._invalidDate},yn.ordinal=function(e){return this._ordinal.replace("%d",e)},yn.preparse=vn,yn.postformat=vn,yn.relativeTime=function(e,t,n,i){var r=this._relativeTime[n];return A(r)?r(e,t,n,i):r.replace(/%d/i,e)},yn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return A(n)?n(t):n.replace(/%s/i,t)},yn.set=function(e){var t,n;for(n in e)s(e,n)&&(A(t=e[n])?this[n]=t:this["_"+n]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},yn.eras=function(e,t){var n,i,o,a=this._eras||lt("en")._eras;for(n=0,i=a.length;n=0)return l[i]},yn.erasConvertYear=function(e,t){var n=e.since<=e.until?1:-1;return void 0===t?r(e.since).year():r(e.since).year()+(t-e.offset)*n},yn.erasAbbrRegex=function(e){return s(this,"_erasAbbrRegex")||sn.call(this),e?this._erasAbbrRegex:this._erasRegex},yn.erasNameRegex=function(e){return s(this,"_erasNameRegex")||sn.call(this),e?this._erasNameRegex:this._erasRegex},yn.erasNarrowRegex=function(e){return s(this,"_erasNarrowRegex")||sn.call(this),e?this._erasNarrowRegex:this._erasRegex},yn.months=function(e,t){return e?o(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||_e).test(t)?"format":"standalone"][e.month()]:o(this._months)?this._months:this._months.standalone},yn.monthsShort=function(e,t){return e?o(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[_e.test(t)?"format":"standalone"][e.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},yn.monthsParse=function(e,t,n){var i,r,o;if(this._monthsParseExact)return Ae.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),i=0;i<12;i++){if(r=f([2e3,i]),n&&!this._longMonthsParse[i]&&(this._longMonthsParse[i]=new RegExp("^"+this.months(r,"").replace(".","")+"$","i"),this._shortMonthsParse[i]=new RegExp("^"+this.monthsShort(r,"").replace(".","")+"$","i")),n||this._monthsParse[i]||(o="^"+this.months(r,"")+"|^"+this.monthsShort(r,""),this._monthsParse[i]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[i].test(e))return i;if(n&&"MMM"===t&&this._shortMonthsParse[i].test(e))return i;if(!n&&this._monthsParse[i].test(e))return i}},yn.monthsRegex=function(e){return this._monthsParseExact?(s(this,"_monthsRegex")||Le.call(this),e?this._monthsStrictRegex:this._monthsRegex):(s(this,"_monthsRegex")||(this._monthsRegex=Te),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},yn.monthsShortRegex=function(e){return this._monthsParseExact?(s(this,"_monthsRegex")||Le.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(s(this,"_monthsShortRegex")||(this._monthsShortRegex=Me),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},yn.week=function(e){return Fe(e,this._week.dow,this._week.doy).week},yn.firstDayOfYear=function(){return this._week.doy},yn.firstDayOfWeek=function(){return this._week.dow},yn.weekdays=function(e,t){var n=o(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?ze(n,this._week.dow):e?n[e.day()]:n},yn.weekdaysMin=function(e){return!0===e?ze(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},yn.weekdaysShort=function(e){return!0===e?ze(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},yn.weekdaysParse=function(e,t,n){var i,r,o;if(this._weekdaysParseExact)return qe.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),i=0;i<7;i++){if(r=f([2e3,1]).day(i),n&&!this._fullWeekdaysParse[i]&&(this._fullWeekdaysParse[i]=new RegExp("^"+this.weekdays(r,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[i]=new RegExp("^"+this.weekdaysShort(r,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[i]=new RegExp("^"+this.weekdaysMin(r,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[i]||(o="^"+this.weekdays(r,"")+"|^"+this.weekdaysShort(r,"")+"|^"+this.weekdaysMin(r,""),this._weekdaysParse[i]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[i].test(e))return i;if(n&&"ddd"===t&&this._shortWeekdaysParse[i].test(e))return i;if(n&&"dd"===t&&this._minWeekdaysParse[i].test(e))return i;if(!n&&this._weekdaysParse[i].test(e))return i}},yn.weekdaysRegex=function(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ge.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=We),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},yn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ge.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Ue),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},yn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ge.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ye),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},yn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},yn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},at("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10;return e+(1===q(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th")}}),r.lang=C("moment.lang is deprecated. Use moment.locale instead.",at),r.langData=C("moment.langData is deprecated. Use moment.localeData instead.",lt);var kn=Math.abs;function Cn(e,t,n,i){var r=Vt(t,n);return e._milliseconds+=i*r._milliseconds,e._days+=i*r._days,e._months+=i*r._months,e._bubble()}function _n(e){return e<0?Math.floor(e):Math.ceil(e)}function Mn(e){return 4800*e/146097}function Tn(e){return 146097*e/4800}function An(e){return function(){return this.as(e)}}var On=An("ms"),En=An("s"),Ln=An("m"),Pn=An("h"),In=An("d"),Rn=An("w"),Dn=An("M"),Nn=An("Q"),Bn=An("y");function Fn(e){return function(){return this.isValid()?this._data[e]:NaN}}var jn=Fn("milliseconds"),zn=Fn("seconds"),Hn=Fn("minutes"),Vn=Fn("hours"),$n=Fn("days"),Wn=Fn("months"),Un=Fn("years"),Yn=Math.round,qn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Gn(e,t,n,i,r){return r.relativeTime(t||1,!!n,e,i)}var Xn=Math.abs;function Kn(e){return(e>0)-(e<0)||+e}function Zn(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n,i,r,o,a,s,l=Xn(this._milliseconds)/1e3,c=Xn(this._days),d=Xn(this._months),u=this.asSeconds();return u?(e=Y(l/60),t=Y(e/60),l%=60,e%=60,n=Y(d/12),d%=12,i=l?l.toFixed(3).replace(/\.?0+$/,""):"",r=u<0?"-":"",o=Kn(this._months)!==Kn(u)?"-":"",a=Kn(this._days)!==Kn(u)?"-":"",s=Kn(this._milliseconds)!==Kn(u)?"-":"",r+"P"+(n?o+n+"Y":"")+(d?o+d+"M":"")+(c?a+c+"D":"")+(t||e||l?"T":"")+(t?s+t+"H":"")+(e?s+e+"M":"")+(l?s+i+"S":"")):"P0D"}var Jn=Lt.prototype;return Jn.isValid=function(){return this._isValid},Jn.abs=function(){var e=this._data;return this._milliseconds=kn(this._milliseconds),this._days=kn(this._days),this._months=kn(this._months),e.milliseconds=kn(e.milliseconds),e.seconds=kn(e.seconds),e.minutes=kn(e.minutes),e.hours=kn(e.hours),e.months=kn(e.months),e.years=kn(e.years),this},Jn.add=function(e,t){return Cn(this,e,t,1)},Jn.subtract=function(e,t){return Cn(this,e,t,-1)},Jn.as=function(e){if(!this.isValid())return NaN;var t,n,i=this._milliseconds;if("month"===(e=H(e))||"quarter"===e||"year"===e)switch(t=this._days+i/864e5,n=this._months+Mn(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Tn(this._months)),e){case"week":return t/7+i/6048e5;case"day":return t+i/864e5;case"hour":return 24*t+i/36e5;case"minute":return 1440*t+i/6e4;case"second":return 86400*t+i/1e3;case"millisecond":return Math.floor(864e5*t)+i;default:throw new Error("Unknown unit "+e)}},Jn.asMilliseconds=On,Jn.asSeconds=En,Jn.asMinutes=Ln,Jn.asHours=Pn,Jn.asDays=In,Jn.asWeeks=Rn,Jn.asMonths=Dn,Jn.asQuarters=Nn,Jn.asYears=Bn,Jn.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*q(this._months/12):NaN},Jn._bubble=function(){var e,t,n,i,r,o=this._milliseconds,a=this._days,s=this._months,l=this._data;return o>=0&&a>=0&&s>=0||o<=0&&a<=0&&s<=0||(o+=864e5*_n(Tn(s)+a),a=0,s=0),l.milliseconds=o%1e3,e=Y(o/1e3),l.seconds=e%60,t=Y(e/60),l.minutes=t%60,n=Y(t/60),l.hours=n%24,a+=Y(n/24),r=Y(Mn(a)),s+=r,a-=_n(Tn(r)),i=Y(s/12),s%=12,l.days=a,l.months=s,l.years=i,this},Jn.clone=function(){return Vt(this)},Jn.get=function(e){return e=H(e),this.isValid()?this[e+"s"]():NaN},Jn.milliseconds=jn,Jn.seconds=zn,Jn.minutes=Hn,Jn.hours=Vn,Jn.days=$n,Jn.weeks=function(){return Y(this.days()/7)},Jn.months=Wn,Jn.years=Un,Jn.humanize=function(e,t){if(!this.isValid())return this.localeData().invalidDate();var n,i,r=!1,o=qn;return"object"==typeof e&&(t=e,e=!1),"boolean"==typeof e&&(r=e),"object"==typeof t&&(o=Object.assign({},qn,t),null!=t.s&&null==t.ss&&(o.ss=t.s-1)),n=this.localeData(),i=function(e,t,n,i){var r=Vt(e).abs(),o=Yn(r.as("s")),a=Yn(r.as("m")),s=Yn(r.as("h")),l=Yn(r.as("d")),c=Yn(r.as("M")),d=Yn(r.as("w")),u=Yn(r.as("y")),h=o<=n.ss&&["s",o]||o0,h[4]=i,Gn.apply(null,h)}(this,!r,o,n),r&&(i=n.pastFuture(+this,i)),n.postformat(i)},Jn.toISOString=Zn,Jn.toString=Zn,Jn.toJSON=Zn,Jn.locale=Qt,Jn.localeData=tn,Jn.toIsoString=C("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Zn),Jn.lang=en,N("X",0,0,"unix"),N("x",0,0,"valueOf"),fe("x",de),fe("X",/[+-]?\d+(\.\d{1,3})?/),ye("X",(function(e,t,n){n._d=new Date(1e3*parseFloat(e))})),ye("x",(function(e,t,n){n._d=new Date(q(e))})),
+//! moment.js
+r.version="2.29.1",t=Mt,r.fn=bn,r.min=function(){var e=[].slice.call(arguments,0);return Ot("isBefore",e)},r.max=function(){var e=[].slice.call(arguments,0);return Ot("isAfter",e)},r.now=function(){return Date.now?Date.now():+new Date},r.utc=f,r.unix=function(e){return Mt(1e3*e)},r.months=function(e,t){return xn(e,t,"months")},r.isDate=u,r.locale=at,r.invalid=b,r.duration=Vt,r.isMoment=S,r.weekdays=function(e,t,n){return Sn(e,t,n,"weekdays")},r.parseZone=function(){return Mt.apply(null,arguments).parseZone()},r.localeData=lt,r.isDuration=Pt,r.monthsShort=function(e,t){return xn(e,t,"monthsShort")},r.weekdaysMin=function(e,t,n){return Sn(e,t,n,"weekdaysMin")},r.defineLocale=st,r.updateLocale=function(e,t){if(null!=t){var n,i,r=et;null!=tt[e]&&null!=tt[e].parentLocale?tt[e].set(O(tt[e]._config,t)):(null!=(i=ot(e))&&(r=i._config),t=O(r,t),null==i&&(t.abbr=e),(n=new E(t)).parentLocale=tt[e],tt[e]=n),at(e)}else null!=tt[e]&&(null!=tt[e].parentLocale?(tt[e]=tt[e].parentLocale,e===at()&&at(e)):null!=tt[e]&&delete tt[e]);return tt[e]},r.locales=function(){return _(tt)},r.weekdaysShort=function(e,t,n){return Sn(e,t,n,"weekdaysShort")},r.normalizeUnits=H,r.relativeTimeRounding=function(e){return void 0===e?Yn:"function"==typeof e&&(Yn=e,!0)},r.relativeTimeThreshold=function(e,t){return void 0!==qn[e]&&(void 0===t?qn[e]:(qn[e]=t,"s"===e&&(qn.ss=t-1),!0))},r.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},r.prototype=bn,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r}()}).call(this,n(39)(e))},190:function(e,t,n){var i=n(88),r=n(607),o=n(194),a=n(192)("IE_PROTO"),s=function(){},l=function(){var e,t=n(291)("iframe"),i=o.length;for(t.style.display="none",n(610).appendChild(t),t.src="javascript:",(e=t.contentWindow.document).open(),e.write("