From ec0be4dc38f2fb30b1289ed30db388f944a339e6 Mon Sep 17 00:00:00 2001 From: josdejong Date: Tue, 21 May 2013 15:15:47 +0200 Subject: [PATCH] DataView correctly translates and propagates events, as seen from its own point of view. --- src/dataset.js | 2 +- src/dataview.js | 106 ++++++++++++++++++++++++++++++++++++----------- vis.js | 108 ++++++++++++++++++++++++++++++++++++------------ vis.min.js | 6 +-- 4 files changed, 167 insertions(+), 55 deletions(-) diff --git a/src/dataset.js b/src/dataset.js index 703e8712..8df4c5ae 100644 --- a/src/dataset.js +++ b/src/dataset.js @@ -36,7 +36,7 @@ * @constructor DataSet */ function DataSet (options) { - var me = this; + this.id = util.randomUUID(); this.options = options || {}; this.data = {}; // map with data indexed by id diff --git a/src/dataview.js b/src/dataview.js index 1cc8242e..e67db290 100644 --- a/src/dataview.js +++ b/src/dataview.js @@ -9,7 +9,10 @@ * @constructor DataView */ function DataView (data, options) { + this.id = util.randomUUID(); + this.data = null; + this.ids = {}; // ids of the items currently in memory (just contains a boolean true) this.options = options || {}; this.fieldId = 'id'; // name of the field containing id this.subscribers = {}; // event subscribers @@ -35,12 +38,14 @@ DataView.prototype.setData = function (data) { this.data.unsubscribe('*', this.listener); } - // trigger a remove of all drawn items - dataItems = this.get({fields: [this.fieldId, 'group']}); + // trigger a remove of all items in memory ids = []; - for (i = 0, len = dataItems.length; i < len; i++) { - ids[i] = dataItems[i].id; + for (var id in this.ids) { + if (this.ids.hasOwnProperty(id)) { + ids.push(id); + } } + this.ids = {}; this._trigger('remove', {items: ids}); } @@ -53,10 +58,10 @@ DataView.prototype.setData = function (data) { 'id'; // trigger an add of all added items - dataItems = this.get({fields: [this.fieldId, 'group']}); - ids = []; - for (i = 0, len = dataItems.length; i < len; i++) { - ids[i] = dataItems[i].id; + ids = this.data.getIds({filter: this.options && this.options.filter}); + for (i = 0, len = ids.length; i < len; i++) { + id = ids[i]; + this.ids[id] = true; } this._trigger('add', {items: ids}); @@ -188,27 +193,78 @@ DataView.prototype.getIds = function (options) { * @private */ DataView.prototype._onEvent = function (event, params, senderId) { - var items = params && params.items, + var i, len, id, item, + ids = params && params.items, data = this.data, - fieldId = this.fieldId, - filter = this.options.filter, - filteredItems = []; + added = [], + updated = [], + removed = []; - if (items && data && filter) { - filteredItems = data.get(items, { - filter: filter - }).map(function (item) { - return item[fieldId]; - }); + if (ids && data) { + switch (event) { + case 'add': + // filter the ids of the added items + for (i = 0, len = ids.length; i < len; i++) { + id = ids[i]; + item = this.get(id); + if (item) { + this.ids[id] = true; + added.push(id); + } + } + + break; + + case 'update': + // determine the event from the views viewpoint: an updated + // item can be added, updated, or removed from this view. + for (i = 0, len = ids.length; i < len; i++) { + id = ids[i]; + item = this.get(id); - // TODO: dataview must trigger events from its own point of view: - // a changed item can be: - // - added to the filtered set - // - removed from the filtered set - // - changed in the filtered set + if (item) { + if (this.ids[id]) { + updated.push(id); + } + else { + this.ids[id] = true; + added.push(id); + } + } + else { + if (this.ids[id]) { + delete this.ids[id]; + removed.push(id); + } + else { + // nothing interesting for me :-( + } + } + } + + break; + + case 'remove': + // filter the ids of the removed items + for (i = 0, len = ids.length; i < len; i++) { + id = ids[i]; + if (this.ids[id]) { + delete this.ids[id]; + removed.push(id); + } + } - if (filteredItems.length) { - this._trigger(event, {items: filteredItems}, senderId); + break; + } + + if (added.length) { + this._trigger('add', {items: added}, senderId); + } + if (updated.length) { + this._trigger('update', {items: updated}, senderId); + } + if (removed.length) { + this._trigger('remove', {items: removed}, senderId); } } }; diff --git a/vis.js b/vis.js index 0c245b1c..b9847046 100644 --- a/vis.js +++ b/vis.js @@ -1517,7 +1517,7 @@ TimeStep.prototype.getLabelMajor = function(date) { * @constructor DataSet */ function DataSet (options) { - var me = this; + this.id = util.randomUUID(); this.options = options || {}; this.data = {}; // map with data indexed by id @@ -2303,7 +2303,10 @@ DataSet.prototype._appendRow = function (dataTable, columns, item) { * @constructor DataView */ function DataView (data, options) { + this.id = util.randomUUID(); + this.data = null; + this.ids = {}; // ids of the items currently in memory (just contains a boolean true) this.options = options || {}; this.fieldId = 'id'; // name of the field containing id this.subscribers = {}; // event subscribers @@ -2329,12 +2332,14 @@ DataView.prototype.setData = function (data) { this.data.unsubscribe('*', this.listener); } - // trigger a remove of all drawn items - dataItems = this.get({fields: [this.fieldId, 'group']}); + // trigger a remove of all items in memory ids = []; - for (i = 0, len = dataItems.length; i < len; i++) { - ids[i] = dataItems[i].id; + for (var id in this.ids) { + if (this.ids.hasOwnProperty(id)) { + ids.push(id); + } } + this.ids = {}; this._trigger('remove', {items: ids}); } @@ -2347,10 +2352,10 @@ DataView.prototype.setData = function (data) { 'id'; // trigger an add of all added items - dataItems = this.get({fields: [this.fieldId, 'group']}); - ids = []; - for (i = 0, len = dataItems.length; i < len; i++) { - ids[i] = dataItems[i].id; + ids = this.data.getIds({filter: this.options && this.options.filter}); + for (i = 0, len = ids.length; i < len; i++) { + id = ids[i]; + this.ids[id] = true; } this._trigger('add', {items: ids}); @@ -2482,27 +2487,78 @@ DataView.prototype.getIds = function (options) { * @private */ DataView.prototype._onEvent = function (event, params, senderId) { - var items = params && params.items, + var i, len, id, item, + ids = params && params.items, data = this.data, - fieldId = this.fieldId, - filter = this.options.filter, - filteredItems = []; + added = [], + updated = [], + removed = []; - if (items && data && filter) { - filteredItems = data.get(items, { - filter: filter - }).map(function (item) { - return item[fieldId]; - }); + if (ids && data) { + switch (event) { + case 'add': + // filter the ids of the added items + for (i = 0, len = ids.length; i < len; i++) { + id = ids[i]; + item = this.get(id); + if (item) { + this.ids[id] = true; + added.push(id); + } + } + + break; + + case 'update': + // determine the event from the views viewpoint: an updated + // item can be added, updated, or removed from this view. + for (i = 0, len = ids.length; i < len; i++) { + id = ids[i]; + item = this.get(id); + + if (item) { + if (this.ids[id]) { + updated.push(id); + } + else { + this.ids[id] = true; + added.push(id); + } + } + else { + if (this.ids[id]) { + delete this.ids[id]; + removed.push(id); + } + else { + // nothing interesting for me :-( + } + } + } - // TODO: dataview must trigger events from its own point of view: - // a changed item can be: - // - added to the filtered set - // - removed from the filtered set - // - changed in the filtered set + break; - if (filteredItems.length) { - this._trigger(event, {items: filteredItems}, senderId); + case 'remove': + // filter the ids of the removed items + for (i = 0, len = ids.length; i < len; i++) { + id = ids[i]; + if (this.ids[id]) { + delete this.ids[id]; + removed.push(id); + } + } + + break; + } + + if (added.length) { + this._trigger('add', {items: added}, senderId); + } + if (updated.length) { + this._trigger('update', {items: updated}, senderId); + } + if (removed.length) { + this._trigger('remove', {items: removed}, senderId); } } }; diff --git a/vis.min.js b/vis.min.js index e996f838..e842083e 100644 --- a/vis.min.js +++ b/vis.min.js @@ -22,6 +22,6 @@ * License for the specific language governing permissions and limitations under * the License. */ -(function(t){if("function"==typeof bootstrap)bootstrap("vis",t);else if("object"==typeof exports)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeVis=t}else"undefined"!=typeof window?window.vis=t():global.vis=t()})(function(){var t;return function(t,e,n){function i(n,r){if(!e[n]){if(!t[n]){var s="function"==typeof require&&require;if(!r&&s)return s(n,!0);if(o)return o(n,!0);throw Error("Cannot find module '"+n+"'")}var a=e[n]={exports:{}};t[n][0].call(a.exports,function(e){var o=t[n][1][e];return i(o?o:e)},a,a.exports)}return e[n].exports}for(var o="function"==typeof require&&require,r=0;n.length>r;r++)i(n[r]);return i}({1:[function(e,n,i){function o(t){if(this.options=t||{},this.data={},this.fieldId=this.options.fieldId||"id",this.fieldTypes={},this.options.fieldTypes)for(var e in this.options.fieldTypes)if(this.options.fieldTypes.hasOwnProperty(e)){var n=this.options.fieldTypes[e];this.fieldTypes[e]="Date"==n||"ISODate"==n||"ASPDate"==n?"Date":n}this.subscribers={},this.internalIds={}}function r(t,e){this.data=null,this.options=e||{},this.fieldId="id",this.subscribers={};var n=this;this.listener=function(){n._onEvent.apply(n,arguments)},this.setData(t)}function s(t,e){this.parent=t,this.options={order:function(t,e){if(t instanceof y){if(e instanceof y){var n=t.data.end-t.data.start,i=e.data.end-e.data.start;return n-i||t.data.start-e.data.start}return-1}return e instanceof y?1:t.data.start-e.data.start}},this.ordered=[],this.setOptions(e)}function a(t){this.id=T.randomUUID(),this.start=0,this.end=0,this.options={min:null,max:null,zoomMin:null,zoomMax:null},this.setOptions(t),this.listeners=[]}function h(){this.subscriptions=[]}function p(){this.id=T.randomUUID(),this.components={},this.repaintTimer=void 0,this.reflowTimer=void 0}function u(){this.id=null,this.parent=null,this.depends=null,this.controller=null,this.options=null,this.frame=null,this.top=0,this.left=0,this.width=0,this.height=0}function c(t,e,n){this.id=T.randomUUID(),this.parent=t,this.depends=e,this.options={},this.setOptions(n)}function d(t,e){this.id=T.randomUUID(),this.container=t,this.options={autoResize:!0},this.listeners={},this.setOptions(e)}function l(t,e,n){this.id=T.randomUUID(),this.parent=t,this.depends=e,this.dom={majorLines:[],majorTexts:[],minorLines:[],minorTexts:[],redundant:{majorLines:[],majorTexts:[],minorLines:[],minorTexts:[]}},this.props={range:{start:0,end:0,minimumStep:0},lineTop:0},this.options={orientation:"bottom",showMinorLabels:!0,showMajorLabels:!0},this.conversion=null,this.range=null,this.setOptions(n)}function f(t,e,n){this.id=T.randomUUID(),this.parent=t,this.depends=e,this.options={style:"box",align:"center",orientation:"bottom",margin:{axis:20,item:10},padding:5},this.dom={};var i=this;this.items=null,this.range=null,this.listeners={add:function(t,e,n){n!=i.id&&i._onAdd(e.items)},update:function(t,e,n){n!=i.id&&i._onUpdate(e.items)},remove:function(t,e,n){n!=i.id&&i._onRemove(e.items)}},this.contents={},this.queue={},this.stack=new s(this),this.conversion=null,n&&this.setOptions(n)}function m(t,e,n){this.parent=t,this.data=e,this.dom=null,this.options=n,this.selected=!1,this.visible=!1,this.top=0,this.left=0,this.width=0,this.height=0}function g(t,e,n){this.props={dot:{left:0,top:0,width:0,height:0},line:{top:0,left:0,width:0,height:0}},m.call(this,t,e,n)}function v(t,e,n){this.props={dot:{top:0,width:0,height:0},content:{height:0,marginLeft:0}},m.call(this,t,e,n)}function y(t,e,n){this.props={content:{left:0,width:0}},m.call(this,t,e,n)}function w(t,e,n){this.id=T.randomUUID(),this.parent=t,this.depends=e,this.options={},this.range=null,this.items=null,this.groups=null,this.contents=[],this.queue={};var i=this;this.listeners={add:function(t,e){i._onAdd(e.items)},update:function(t,e){i._onUpdate(e.items)},remove:function(t,e){i._onRemove(e.items)}},n&&this.setOptions(n)}function b(t,e,n){var i=this;if(this.options={orientation:"bottom",zoomMin:10,zoomMax:31536e10,moveable:!0,zoomable:!0},this.controller=new p,!t)throw Error("No container element provided");this.main=new d(t,{autoResize:!1}),this.controller.add(this.main);var o=S().hours(0).minutes(0).seconds(0).milliseconds(0);this.range=new a({start:o.clone().add("days",-3).valueOf(),end:o.clone().add("days",4).valueOf()}),this.range.subscribe(this.main,"move","horizontal"),this.range.subscribe(this.main,"zoom","horizontal"),this.range.on("rangechange",function(){var t=!0;i.controller.requestReflow(t)}),this.range.on("rangechanged",function(){var t=!0;i.controller.requestReflow(t)}),this.timeaxis=new l(this.main,[],{orientation:this.options.orientation,range:this.range}),this.timeaxis.setRange(this.range),this.controller.add(this.timeaxis),this.setGroups(null),this.items=null,this.groups=null,n&&this.setOptions(n),e&&this.setItems(e)}var S=e("moment"),T={};T.isNumber=function(t){return t instanceof Number||"number"==typeof t},T.isString=function(t){return t instanceof String||"string"==typeof t},T.isDate=function(t){if(t instanceof Date)return!0;if(T.isString(t)){var e=E.exec(t);if(e)return!0;if(!isNaN(Date.parse(t)))return!0}return!1},T.isDataTable=function(t){return"undefined"!=typeof google&&google.visualization&&google.visualization.DataTable&&t instanceof google.visualization.DataTable},T.randomUUID=function(){var t=function(){return Math.floor(65536*Math.random()).toString(16)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},T.extend=function(t){for(var e=1,n=arguments.length;n>e;e++){var i=arguments[e];for(var o in i)i.hasOwnProperty(o)&&void 0!==i[o]&&(t[o]=i[o])}return t},T.cast=function(t,e){var n;if(void 0===t)return void 0;if(null===t)return null;if(!e)return t;if("string"!=typeof e&&!(e instanceof String))throw Error("Type must be a string");switch(e){case"boolean":case"Boolean":return Boolean(t);case"number":case"Number":return Number(t);case"string":case"String":return t+"";case"Date":if(T.isNumber(t))return new Date(t);if(t instanceof Date)return new Date(t.valueOf());if(S.isMoment(t))return new Date(t.valueOf());if(T.isString(t))return n=E.exec(t),n?new Date(Number(n[1])):S(t).toDate();throw Error("Cannot cast object of type "+T.getType(t)+" to type Date");case"Moment":if(T.isNumber(t))return S(t);if(t instanceof Date)return S(t.valueOf());if(S.isMoment(t))return S.clone();if(T.isString(t))return n=E.exec(t),n?S(Number(n[1])):S(t);throw Error("Cannot cast object of type "+T.getType(t)+" to type Date");case"ISODate":if(t instanceof Date)return t.toISOString();if(S.isMoment(t))return t.toDate().toISOString();if(T.isNumber(t)||T.isString(t))return S(t).toDate().toISOString();throw Error("Cannot cast object of type "+T.getType(t)+" to type ISODate");case"ASPDate":if(t instanceof Date)return"/Date("+t.valueOf()+")/";if(T.isNumber(t)||T.isString(t))return"/Date("+S(t).valueOf()+")/";throw Error("Cannot cast object of type "+T.getType(t)+" to type ASPDate");default:throw Error("Cannot cast object of type "+T.getType(t)+' to type "'+e+'"')}};var E=/^\/?Date\((\-?\d+)/i;if(T.getType=function(t){var e=typeof t;return"object"==e?null==t?"null":t instanceof Boolean?"Boolean":t instanceof Number?"Number":t instanceof String?"String":t instanceof Array?"Array":t instanceof Date?"Date":"Object":"number"==e?"Number":"boolean"==e?"Boolean":"string"==e?"String":e},T.getAbsoluteLeft=function(t){for(var e=document.documentElement,n=document.body,i=t.offsetLeft,o=t.offsetParent;null!=o&&o!=n&&o!=e;)i+=o.offsetLeft,i-=o.scrollLeft,o=o.offsetParent;return i},T.getAbsoluteTop=function(t){for(var e=document.documentElement,n=document.body,i=t.offsetTop,o=t.offsetParent;null!=o&&o!=n&&o!=e;)i+=o.offsetTop,i-=o.scrollTop,o=o.offsetParent;return i},T.getPageY=function(t){if("pageY"in t)return t.pageY;var e;e="targetTouches"in t&&t.targetTouches.length?t.targetTouches[0].clientY:t.clientY;var n=document.documentElement,i=document.body;return e+(n&&n.scrollTop||i&&i.scrollTop||0)-(n&&n.clientTop||i&&i.clientTop||0)},T.getPageX=function(t){if("pageY"in t)return t.pageX;var e;e="targetTouches"in t&&t.targetTouches.length?t.targetTouches[0].clientX:t.clientX;var n=document.documentElement,i=document.body;return e+(n&&n.scrollLeft||i&&i.scrollLeft||0)-(n&&n.clientLeft||i&&i.clientLeft||0)},T.addClassName=function(t,e){var n=t.className.split(" ");-1==n.indexOf(e)&&(n.push(e),t.className=n.join(" "))},T.removeClassName=function(t,e){var n=t.className.split(" "),i=n.indexOf(e);-1!=i&&(n.splice(i,1),t.className=n.join(" "))},T.forEach=function(t,e){var n,i;if(t instanceof Array)for(n=0,i=t.length;i>n;n++)e(t[n],n,t);else for(n in t)t.hasOwnProperty(n)&&e(t[n],n,t)},T.updateProperty=function(t,e,n){return t[e]!==n?(t[e]=n,!0):!1},T.addEventListener=function(t,e,n,i){t.addEventListener?(void 0===i&&(i=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.addEventListener(e,n,i)):t.attachEvent("on"+e,n)},T.removeEventListener=function(t,e,n,i){t.removeEventListener?(void 0===i&&(i=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.removeEventListener(e,n,i)):t.detachEvent("on"+e,n)},T.getTarget=function(t){t||(t=window.event);var e;return t.target?e=t.target:t.srcElement&&(e=t.srcElement),void 0!=e.nodeType&&3==e.nodeType&&(e=e.parentNode),e},T.stopPropagation=function(t){t||(t=window.event),t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},T.preventDefault=function(t){t||(t=window.event),t.preventDefault?t.preventDefault():t.returnValue=!1},T.option={},T.option.asBoolean=function(t,e){return"function"==typeof t&&(t=t()),null!=t?0!=t:e||null},T.option.asNumber=function(t,e){return"function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null},T.option.asString=function(t,e){return"function"==typeof t&&(t=t()),null!=t?t+"":e||null},T.option.asSize=function(t,e){return"function"==typeof t&&(t=t()),T.isString(t)?t:T.isNumber(t)?t+"px":e||null},T.option.asElement=function(t,e){return"function"==typeof t&&(t=t()),t||e||null},T.loadCss=function(t){if("undefined"!=typeof document){var e=document.createElement("style");e.type="text/css",e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(e)}},!Array.prototype.indexOf){Array.prototype.indexOf=function(t){for(var e=0;this.length>e;e++)if(this[e]==t)return e;return-1};try{console.log("Warning: Ancient browser detected. Please update your browser")}catch(M){}}Array.prototype.forEach||(Array.prototype.forEach=function(t,e){for(var n=0,i=this.length;i>n;++n)t.call(e||this,this[n],n,this)}),Array.prototype.map||(Array.prototype.map=function(t,e){var n,i,o;if(null==this)throw new TypeError(" this is null or not defined");var r=Object(this),s=r.length>>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(e&&(n=e),i=Array(s),o=0;s>o;){var a,h;o in r&&(a=r[o],h=t.call(n,a,o,r),i[o]=h),o++}return i}),Array.prototype.filter||(Array.prototype.filter=function(t){"use strict";if(null==this)throw new TypeError;var e=Object(this),n=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var i=[],o=arguments[1],r=0;n>r;r++)if(r in e){var s=e[r];t.call(o,s,r,e)&&i.push(s)}return i}),Object.keys||(Object.keys=function(){var t=Object.prototype.hasOwnProperty,e=!{toString:null}.propertyIsEnumerable("toString"),n=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],i=n.length;return function(o){if("object"!=typeof o&&"function"!=typeof o||null===o)throw new TypeError("Object.keys called on non-object");var r=[];for(var s in o)t.call(o,s)&&r.push(s);if(e)for(var a=0;i>a;a++)t.call(o,n[a])&&r.push(n[a]);return r}}()),Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),n=this,i=function(){},o=function(){return n.apply(this instanceof i&&t?this:t,e.concat(Array.prototype.slice.call(arguments)))};return i.prototype=this.prototype,o.prototype=new i,o});var _={listeners:[],indexOf:function(t){for(var e=this.listeners,n=0,i=this.listeners.length;i>n;n++){var o=e[n];if(o&&o.object==t)return n}return-1},addListener:function(t,e,n){var i=this.indexOf(t),o=this.listeners[i];o||(o={object:t,events:{}},this.listeners.push(o));var r=o.events[e];r||(r=[],o.events[e]=r),-1==r.indexOf(n)&&r.push(n)},removeListener:function(t,e,n){var i=this.indexOf(t),o=this.listeners[i];if(o){var r=o.events[e];r&&(i=r.indexOf(n),-1!=i&&r.splice(i,1),0==r.length&&delete o.events[e]);var s=0,a=o.events;for(var h in a)a.hasOwnProperty(h)&&s++;0==s&&delete this.listeners[i]}},removeAllListeners:function(){this.listeners=[]},trigger:function(t,e,n){var i=this.indexOf(t),o=this.listeners[i];if(o){var r=o.events[e];if(r)for(var s=0,a=r.length;a>s;s++)r[s](n)}}};TimeStep=function(t,e,n){this.current=new Date,this._start=new Date,this._end=new Date,this.autoScale=!0,this.scale=TimeStep.SCALE.DAY,this.step=1,this.setRange(t,e,n)},TimeStep.SCALE={MILLISECOND:1,SECOND:2,MINUTE:3,HOUR:4,DAY:5,WEEKDAY:6,MONTH:7,YEAR:8},TimeStep.prototype.setRange=function(t,e,n){t instanceof Date&&e instanceof Date&&(this._start=void 0!=t?new Date(t.valueOf()):new Date,this._end=void 0!=e?new Date(e.valueOf()):new Date,this.autoScale&&this.setMinimumStep(n))},TimeStep.prototype.first=function(){this.current=new Date(this._start.valueOf()),this.roundToMinor()},TimeStep.prototype.roundToMinor=function(){switch(this.scale){case TimeStep.SCALE.YEAR:this.current.setFullYear(this.step*Math.floor(this.current.getFullYear()/this.step)),this.current.setMonth(0);case TimeStep.SCALE.MONTH:this.current.setDate(1);case TimeStep.SCALE.DAY:case TimeStep.SCALE.WEEKDAY:this.current.setHours(0);case TimeStep.SCALE.HOUR:this.current.setMinutes(0);case TimeStep.SCALE.MINUTE:this.current.setSeconds(0);case TimeStep.SCALE.SECOND:this.current.setMilliseconds(0)}if(1!=this.step)switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current.setMilliseconds(this.current.getMilliseconds()-this.current.getMilliseconds()%this.step);break;case TimeStep.SCALE.SECOND:this.current.setSeconds(this.current.getSeconds()-this.current.getSeconds()%this.step);break;case TimeStep.SCALE.MINUTE:this.current.setMinutes(this.current.getMinutes()-this.current.getMinutes()%this.step);break;case TimeStep.SCALE.HOUR:this.current.setHours(this.current.getHours()-this.current.getHours()%this.step);break;case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:this.current.setDate(this.current.getDate()-1-(this.current.getDate()-1)%this.step+1);break;case TimeStep.SCALE.MONTH:this.current.setMonth(this.current.getMonth()-this.current.getMonth()%this.step);break;case TimeStep.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()-this.current.getFullYear()%this.step);break;default:}},TimeStep.prototype.hasNext=function(){return this.current.valueOf()<=this._end.valueOf()},TimeStep.prototype.next=function(){var t=this.current.valueOf();if(6>this.current.getMonth())switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current=new Date(this.current.valueOf()+this.step);break;case TimeStep.SCALE.SECOND:this.current=new Date(this.current.valueOf()+1e3*this.step);break;case TimeStep.SCALE.MINUTE:this.current=new Date(this.current.valueOf()+60*1e3*this.step);break;case TimeStep.SCALE.HOUR:this.current=new Date(this.current.valueOf()+60*60*1e3*this.step);var e=this.current.getHours();this.current.setHours(e-e%this.step);break;case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:this.current.setDate(this.current.getDate()+this.step);break;case TimeStep.SCALE.MONTH:this.current.setMonth(this.current.getMonth()+this.step);break;case TimeStep.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()+this.step);break;default:}else switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current=new Date(this.current.valueOf()+this.step);break;case TimeStep.SCALE.SECOND:this.current.setSeconds(this.current.getSeconds()+this.step);break;case TimeStep.SCALE.MINUTE:this.current.setMinutes(this.current.getMinutes()+this.step);break;case TimeStep.SCALE.HOUR:this.current.setHours(this.current.getHours()+this.step);break;case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:this.current.setDate(this.current.getDate()+this.step);break;case TimeStep.SCALE.MONTH:this.current.setMonth(this.current.getMonth()+this.step);break;case TimeStep.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()+this.step);break;default:}if(1!=this.step)switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current.getMilliseconds()0&&(this.step=e),this.autoScale=!1},TimeStep.prototype.setAutoScale=function(t){this.autoScale=t},TimeStep.prototype.setMinimumStep=function(t){if(void 0!=t){var e=31104e6,n=2592e6,i=864e5,o=36e5,r=6e4,s=1e3,a=1;1e3*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=1e3),500*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=500),100*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=100),50*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=50),10*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=10),5*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=5),e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=1),3*n>t&&(this.scale=TimeStep.SCALE.MONTH,this.step=3),n>t&&(this.scale=TimeStep.SCALE.MONTH,this.step=1),5*i>t&&(this.scale=TimeStep.SCALE.DAY,this.step=5),2*i>t&&(this.scale=TimeStep.SCALE.DAY,this.step=2),i>t&&(this.scale=TimeStep.SCALE.DAY,this.step=1),i/2>t&&(this.scale=TimeStep.SCALE.WEEKDAY,this.step=1),4*o>t&&(this.scale=TimeStep.SCALE.HOUR,this.step=4),o>t&&(this.scale=TimeStep.SCALE.HOUR,this.step=1),15*r>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=15),10*r>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=10),5*r>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=5),r>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=1),15*s>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=15),10*s>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=10),5*s>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=5),s>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=1),200*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=200),100*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=100),50*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=50),10*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=10),5*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=5),a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=1)}},TimeStep.prototype.snap=function(t){if(this.scale==TimeStep.SCALE.YEAR){var e=t.getFullYear()+Math.round(t.getMonth()/12);t.setFullYear(Math.round(e/this.step)*this.step),t.setMonth(0),t.setDate(0),t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.MONTH)t.getDate()>15?(t.setDate(1),t.setMonth(t.getMonth()+1)):t.setDate(1),t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0);else if(this.scale==TimeStep.SCALE.DAY||this.scale==TimeStep.SCALE.WEEKDAY){switch(this.step){case 5:case 2:t.setHours(24*Math.round(t.getHours()/24));break;default:t.setHours(12*Math.round(t.getHours()/12))}t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.HOUR){switch(this.step){case 4:t.setMinutes(60*Math.round(t.getMinutes()/60));break;default:t.setMinutes(30*Math.round(t.getMinutes()/30))}t.setSeconds(0),t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.MINUTE){switch(this.step){case 15:case 10:t.setMinutes(5*Math.round(t.getMinutes()/5)),t.setSeconds(0);break;case 5:t.setSeconds(60*Math.round(t.getSeconds()/60));break;default:t.setSeconds(30*Math.round(t.getSeconds()/30))}t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.SECOND)switch(this.step){case 15:case 10:t.setSeconds(5*Math.round(t.getSeconds()/5)),t.setMilliseconds(0);break;case 5:t.setMilliseconds(1e3*Math.round(t.getMilliseconds()/1e3));break;default:t.setMilliseconds(500*Math.round(t.getMilliseconds()/500))}else if(this.scale==TimeStep.SCALE.MILLISECOND){var n=this.step>5?this.step/2:1;t.setMilliseconds(Math.round(t.getMilliseconds()/n)*n)}},TimeStep.prototype.isMajor=function(){switch(this.scale){case TimeStep.SCALE.MILLISECOND:return 0==this.current.getMilliseconds();case TimeStep.SCALE.SECOND:return 0==this.current.getSeconds();case TimeStep.SCALE.MINUTE:return 0==this.current.getHours()&&0==this.current.getMinutes();case TimeStep.SCALE.HOUR:return 0==this.current.getHours();case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:return 1==this.current.getDate();case TimeStep.SCALE.MONTH:return 0==this.current.getMonth();case TimeStep.SCALE.YEAR:return!1;default:return!1}},TimeStep.prototype.getLabelMinor=function(t){switch(void 0==t&&(t=this.current),this.scale){case TimeStep.SCALE.MILLISECOND:return S(t).format("SSS");case TimeStep.SCALE.SECOND:return S(t).format("s");case TimeStep.SCALE.MINUTE:return S(t).format("HH:mm");case TimeStep.SCALE.HOUR:return S(t).format("HH:mm");case TimeStep.SCALE.WEEKDAY:return S(t).format("ddd D");case TimeStep.SCALE.DAY:return S(t).format("D");case TimeStep.SCALE.MONTH:return S(t).format("MMM");case TimeStep.SCALE.YEAR:return S(t).format("YYYY");default:return""}},TimeStep.prototype.getLabelMajor=function(t){switch(void 0==t&&(t=this.current),this.scale){case TimeStep.SCALE.MILLISECOND:return S(t).format("HH:mm:ss");case TimeStep.SCALE.SECOND:return S(t).format("D MMMM HH:mm");case TimeStep.SCALE.MINUTE:case TimeStep.SCALE.HOUR:return S(t).format("ddd D MMMM");case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:return S(t).format("MMMM YYYY");case TimeStep.SCALE.MONTH:return S(t).format("YYYY");case TimeStep.SCALE.YEAR:return"";default:return""}},o.prototype.subscribe=function(t,e,n){var i=this.subscribers[t];i||(i=[],this.subscribers[t]=i),i.push({id:n?n+"":null,callback:e})},o.prototype.unsubscribe=function(t,e){var n=this.subscribers[t];n&&(this.subscribers[t]=n.filter(function(t){return t.callback!=e}))},o.prototype._trigger=function(t,e,n){if("*"==t)throw Error("Cannot trigger event *");var i=[];t in this.subscribers&&(i=i.concat(this.subscribers[t])),"*"in this.subscribers&&(i=i.concat(this.subscribers["*"]));for(var o=0;i.length>o;o++){var r=i[o];r.callback&&r.callback(t,e,n||null)}},o.prototype.add=function(t,e){var n,i=[],o=this;if(t instanceof Array)for(var r=0,s=t.length;s>r;r++)n=o._addItem(t[r]),i.push(n);else if(T.isDataTable(t))for(var a=this._getColumnNames(t),h=0,p=t.getNumberOfRows();p>h;h++){for(var u={},c=0,d=a.length;d>c;c++){var l=a[c];u[l]=t.getValue(h,c)}n=o._addItem(u),i.push(n)}else{if(!(t instanceof Object))throw Error("Unknown dataType");n=o._addItem(t),i.push(n)}i.length&&this._trigger("add",{items:i},e)},o.prototype.update=function(t,e){var n=[],i=[],o=this,r=o.fieldId,s=function(t){var e=t[r];o.data[e]?(e=o._updateItem(t),i.push(e)):(e=o._addItem(t),n.push(e))};if(t instanceof Array)for(var a=0,h=t.length;h>a;a++)s(t[a]);else if(T.isDataTable(t))for(var p=this._getColumnNames(t),u=0,c=t.getNumberOfRows();c>u;u++){for(var d={},l=0,f=p.length;f>l;l++){var m=p[l];d[m]=t.getValue(u,l)}s(d)}else{if(!(t instanceof Object))throw Error("Unknown dataType");s(t)}n.length&&this._trigger("add",{items:n},e),i.length&&this._trigger("update",{items:i},e)},o.prototype.get=function(){var t,e,n,i,o=this,r=T.getType(arguments[0]);"String"==r||"Number"==r?(t=arguments[0],n=arguments[1],i=arguments[2]):"Array"==r?(e=arguments[0],n=arguments[1],i=arguments[2]):(n=arguments[0],i=arguments[1]);var s;if(n&&n.type){if(s="DataTable"==n.type?"DataTable":"Array",i&&s!=T.getType(i))throw Error('Type of parameter "data" ('+T.getType(i)+") "+"does not correspond with specified options.type ("+n.type+")");if("DataTable"==s&&!T.isDataTable(i))throw Error('Parameter "data" must be a DataTable when options.type is "DataTable"')}else s=i?"DataTable"==T.getType(i)?"DataTable":"Array":"Array";var a,h,p,u,c=this._composeItemOptions(n);if("DataTable"==s){var d=this._getColumnNames(i);if(void 0!=t)a=o._getItem(t,c),a&&this._appendRow(i,d,a);else if(void 0!=e)for(p=0,u=e.length;u>p;p++)a=o._getItem(e[p],c),a&&o._appendRow(i,d,a);else for(h in this.data)this.data.hasOwnProperty(h)&&(a=o._getItem(h,c),a&&o._appendRow(i,d,a))}else{if(i||(i=[]),void 0!=t)return o._getItem(t,c);if(void 0!=e)for(p=0,u=e.length;u>p;p++)a=o._getItem(e[p],c),a&&i.push(a);else for(h in this.data)this.data.hasOwnProperty(h)&&(a=o._getItem(h,c),a&&i.push(a))}return i},o.prototype.getIds=function(t){var e,n,i=this.data,o=[];if(t&&t.filter){var r=this._composeItemOptions({filter:t&&t.filter});for(e in i)i.hasOwnProperty(e)&&(n=this._getItem(e,r),n&&o.push(n[this.fieldId]))}else for(e in i)i.hasOwnProperty(e)&&(n=i[e],o.push(n[this.fieldId]));return o},o.prototype.forEach=function(t,e){var n,i=this._composeItemOptions(e),o=this.data;for(var r in o)o.hasOwnProperty(r)&&(n=this._getItem(r,i),n&&t(n,r))},o.prototype.map=function(t,e){var n,i=this._composeItemOptions(e),o=[],r=this.data;for(var s in r)r.hasOwnProperty(s)&&(n=this._getItem(s,i),n&&o.push(t(n,s)));return o},o.prototype._composeItemOptions=function(t){var e={};return t&&(e.fieldTypes={},this.options&&this.options.fieldTypes&&T.extend(e.fieldTypes,this.options.fieldTypes),t.fieldTypes&&T.extend(e.fieldTypes,t.fieldTypes),t.fields&&(e.fields=t.fields),t.filter&&(e.filter=t.filter)),e},o.prototype.remove=function(t,e){var n,i,o=[];if(T.isNumber(t)||T.isString(t))delete this.data[t],delete this.internalIds[t],o.push(t);else if(t instanceof Array){for(n=0,i=t.length;i>n;n++)this.remove(t[n]);o=items.concat(t)}else if(t instanceof Object)for(n in this.data)this.data.hasOwnProperty(n)&&this.data[n]==t&&(delete this.data[n],delete this.internalIds[n],o.push(n));o.length&&this._trigger("remove",{items:o},e)},o.prototype.clear=function(t){var e=Object.keys(this.data);this.data={},this.internalIds={},this._trigger("remove",{items:e},t)},o.prototype.max=function(t){var e=this.data,n=null,i=null;for(var o in e)if(e.hasOwnProperty(o)){var r=e[o],s=r[t];null!=s&&(!n||s>i)&&(n=r,i=s)}return n},o.prototype.min=function(t){var e=this.data,n=null,i=null;for(var o in e)if(e.hasOwnProperty(o)){var r=e[o],s=r[t];null!=s&&(!n||i>s)&&(n=r,i=s)}return n},o.prototype.distinct=function(t){var e=this.data,n=[],i=this.options.fieldTypes[t],o=0;for(var r in e)if(e.hasOwnProperty(r)){for(var s=e[r],a=T.cast(s[t],i),h=!1,p=0;o>p;p++)if(n[p]==a){h=!0;break}h||(n[o]=a,o++)}return n},o.prototype._addItem=function(t){var e=t[this.fieldId];if(void 0!=e){if(this.data[e])throw Error("Cannot add item: item with id "+e+" already exists")}else e=T.randomUUID(),t[this.fieldId]=e,this.internalIds[e]=t;var n={};for(var i in t)if(t.hasOwnProperty(i)){var o=this.fieldTypes[i];n[i]=T.cast(t[i],o)}return this.data[e]=n,e},o.prototype._getItem=function(t,e){var n,i,o=this.data[t];if(!o)return null;var r={},s=this.fieldId,a=this.internalIds;if(e.fieldTypes){var h=e.fieldTypes;for(n in o)o.hasOwnProperty(n)&&(i=o[n],n==s&&i in a||(r[n]=T.cast(i,h[n])))}else for(n in o)o.hasOwnProperty(n)&&(i=o[n],n==s&&i in a||(r[n]=i));if(e.filter&&!e.filter(r))return null;if(e.fields){var p={},u=e.fields;for(n in r)r.hasOwnProperty(n)&&-1!=u.indexOf(n)&&(p[n]=r[n]);return p}return r},o.prototype._updateItem=function(t){var e=t[this.fieldId];if(void 0==e)throw Error("Cannot update item: item has no id (item: "+JSON.stringify(t)+")");var n=this.data[e];if(!n)throw Error("Cannot update item: no item with id "+e+" found");for(var i in t)if(t.hasOwnProperty(i)){var o=this.fieldTypes[i];n[i]=T.cast(t[i],o)}return e},o.prototype._getColumnNames=function(t){for(var e=[],n=0,i=t.getNumberOfColumns();i>n;n++)e[n]=t.getColumnId(n)||t.getColumnLabel(n);return e},o.prototype._appendRow=function(t,e,n){for(var i=t.addRow(),o=0,r=e.length;r>o;o++){var s=e[o];t.setValue(i,o,n[s])}},r.prototype.setData=function(t){var e,n,i,o;if(this.data){for(this.data.unsubscribe&&this.data.unsubscribe("*",this.listener),n=this.get({fields:[this.fieldId,"group"]}),e=[],i=0,o=n.length;o>i;i++)e[i]=n[i].id;this._trigger("remove",{items:e})}if(this.data=t,this.data){for(this.fieldId=this.options.fieldId||this.data&&this.data.options&&this.data.options.fieldId||"id",n=this.get({fields:[this.fieldId,"group"]}),e=[],i=0,o=n.length;o>i;i++)e[i]=n[i].id;this._trigger("add",{items:e}),this.data.subscribe&&this.data.subscribe("*",this.listener)}},r.prototype.get=function(){var t,e,n,i=this,o=T.getType(arguments[0]);"String"==o||"Number"==o||"Array"==o?(t=arguments[0],e=arguments[1],n=arguments[2]):(e=arguments[0],n=arguments[1]);var r=T.extend({},this.options,e);this.options.filter&&e&&e.filter&&(r.filter=function(t){return i.options.filter(t)&&e.filter(t)});var s=[];return void 0!=t&&s.push(t),s.push(r),s.push(n),this.data&&this.data.get.apply(this.data,s)},r.prototype.getIds=function(t){var e;if(this.data){var n,i=this.options.filter;n=t&&t.filter?i?function(e){return i(e)&&t.filter(e)}:t.filter:i,e=this.data.getIds({filter:n})}else e=[];return e},r.prototype._onEvent=function(t,e,n){var i=e&&e.items,o=this.data,r=this.fieldId,s=this.options.filter,a=[];i&&o&&s&&(a=o.get(i,{filter:s}).map(function(t){return t[r]}),a.length&&this._trigger(t,{items:a},n))},r.prototype.subscribe=o.prototype.subscribe,r.prototype.unsubscribe=o.prototype.unsubscribe,r.prototype._trigger=o.prototype._trigger,s.prototype.setOptions=function(t){T.extend(this.options,t)},s.prototype.update=function(){this._order(),this._stack()},s.prototype._order=function(){var t=this.parent.contents;if(!t)throw Error("Cannot stack items: parent does not contain items");var e=[],n=0;T.forEach(t,function(t){t.visible&&(e[n]=t,n++)});var i=this.options.order;if("function"!=typeof this.options.order)throw Error("Option order must be a function");e.sort(i),this.ordered=e},s.prototype._stack=function(){var t,e,n=this.ordered,i=this.options,o="top"==i.orientation,r=i.margin&&i.margin.item||0;for(t=0,e=n.length;e>t;t++){var s=n[t],a=null;do a=this.checkOverlap(n,t,0,t-1,r),null!=a&&(s.top=o?a.top+a.height+r:a.top-s.height-r);while(a)}},s.prototype.checkOverlap=function(t,e,n,i,o){for(var r=this.collision,s=t[e],a=i;a>=n;a--){var h=t[a];if(r(s,h,o)&&a!=e)return h}return null},s.prototype.collision=function(t,e,n){return t.left-ne.left&&t.top-ne.top},a.prototype.setOptions=function(t){T.extend(this.options,t),(null!=t.start||null!=t.end)&&this.setRange(t.start,t.end)},a.prototype.subscribe=function(t,e,n){var i,o=this;if("horizontal"!=n&&"vertical"!=n)throw new TypeError('Unknown direction "'+n+'". '+'Choose "horizontal" or "vertical".');if("move"==e)i={component:t,event:e,direction:n,callback:function(t){o._onMouseDown(t,i)},params:{}},t.on("mousedown",i.callback),o.listeners.push(i);else{if("zoom"!=e)throw new TypeError('Unknown event "'+e+'". '+'Choose "move" or "zoom".');i={component:t,event:e,direction:n,callback:function(t){o._onMouseWheel(t,i)},params:{}},t.on("mousewheel",i.callback),o.listeners.push(i)}},a.prototype.on=function(t,e){_.addListener(this,t,e)},a.prototype._trigger=function(t){_.trigger(this,t,{start:this.start,end:this.end})},a.prototype.setRange=function(t,e){var n=this._applyRange(t,e); -n&&(this._trigger("rangechange"),this._trigger("rangechanged"))},a.prototype._applyRange=function(t,e){var n,i=null!=t?T.cast(t,"Number"):this.start,o=null!=e?T.cast(e,"Number"):this.end;if(isNaN(i))throw Error('Invalid start "'+t+'"');if(isNaN(o))throw Error('Invalid end "'+e+'"');if(i>o&&(o=i),null!=this.options.min){var r=this.options.min.valueOf();r>i&&(n=r-i,i+=n,o+=n)}if(null!=this.options.max){var s=this.options.max.valueOf();o>s&&(n=o-s,i-=n,o-=n)}if(null!=this.options.zoomMin){var a=this.options.zoomMin.valueOf();0>a&&(a=0),a>o-i&&(this.end-this.start>a?(n=a-(o-i),i-=n/2,o+=n/2):(i=this.start,o=this.end))}if(null!=this.options.zoomMax){var h=this.options.zoomMax.valueOf();0>h&&(h=0),o-i>h&&(h>this.end-this.start?(n=o-i-h,i+=n/2,o-=n/2):(i=this.start,o=this.end))}var p=this.start!=i||this.end!=o;return this.start=i,this.end=o,p},a.prototype.getRange=function(){return{start:this.start,end:this.end}},a.prototype.conversion=function(t){return this.start,this.end,a.conversion(this.start,this.end,t)},a.conversion=function(t,e,n){return 0!=n&&0!=e-t?{offset:t,factor:n/(e-t)}:{offset:0,factor:1}},a.prototype._onMouseDown=function(t,e){t=t||window.event;var n=e.params,i=t.which?1==t.which:1==t.button;if(i){n.mouseX=T.getPageX(t),n.mouseY=T.getPageY(t),n.previousLeft=0,n.previousOffset=0,n.moved=!1,n.start=this.start,n.end=this.end;var o=e.component.frame;o&&(o.style.cursor="move");var r=this;n.onMouseMove||(n.onMouseMove=function(t){r._onMouseMove(t,e)},T.addEventListener(document,"mousemove",n.onMouseMove)),n.onMouseUp||(n.onMouseUp=function(t){r._onMouseUp(t,e)},T.addEventListener(document,"mouseup",n.onMouseUp)),T.preventDefault(t)}},a.prototype._onMouseMove=function(t,e){t=t||window.event;var n=e.params,i=T.getPageX(t),o=T.getPageY(t);void 0==n.mouseX&&(n.mouseX=i),void 0==n.mouseY&&(n.mouseY=o);var r=i-n.mouseX,s=o-n.mouseY,a="horizontal"==e.direction?r:s;Math.abs(a)>=1&&(n.moved=!0);var h=n.end-n.start,p="horizontal"==e.direction?e.component.width:e.component.height,u=-a/p*h;this._applyRange(n.start+u,n.end+u),this._trigger("rangechange"),T.preventDefault(t)},a.prototype._onMouseUp=function(t,e){t=t||window.event;var n=e.params;e.component.frame&&(e.component.frame.style.cursor="auto"),n.onMouseMove&&(T.removeEventListener(document,"mousemove",n.onMouseMove),n.onMouseMove=null),n.onMouseUp&&(T.removeEventListener(document,"mouseup",n.onMouseUp),n.onMouseUp=null),n.moved&&this._trigger("rangechanged")},a.prototype._onMouseWheel=function(t,e){t=t||window.event;var n=0;if(t.wheelDelta?n=t.wheelDelta/120:t.detail&&(n=-t.detail/3),n){var i=this,o=function(){var o=n/5,r=null,s=e.component.frame;if(s){var a,h;if("horizontal"==e.direction){a=e.component.width,h=i.conversion(a);var p=T.getAbsoluteLeft(s),u=T.getPageX(t);r=(u-p)/h.factor+h.offset}else{a=e.component.height,h=i.conversion(a);var c=T.getAbsoluteTop(s),d=T.getPageY(t);r=(c+a-d-c)/h.factor+h.offset}}i.zoom(o,r)};o()}T.preventDefault(t)},a.prototype.zoom=function(t,e){null==e&&(e=(this.start+this.end)/2),t>=1&&(t=.9),-1>=t&&(t=-.9),0>t&&(t/=1+t);var n=this.start-e,i=this.end-e,o=this.start-n*t,r=this.end-i*t;this.setRange(o,r)},a.prototype.move=function(t){var e=this.end-this.start,n=this.start+e*t,i=this.end+e*t;this.start=n,this.end=i},h.prototype.on=function(t,e,n){var i=t instanceof RegExp?t:RegExp(t.replace("*","\\w+")),o={id:T.randomUUID(),event:t,regexp:i,callback:"function"==typeof e?e:null,target:n};return this.subscriptions.push(o),o.id},h.prototype.off=function(t){for(var e=0;this.subscriptions.length>e;){var n=this.subscriptions[e],i=!0;if(t instanceof Object)for(var o in t)t.hasOwnProperty(o)&&t[o]!==n[o]&&(i=!1);else i=n.id==t;i?this.subscriptions.splice(e,1):e++}},h.prototype.emit=function(t,e,n){for(var i=0;this.subscriptions.length>i;i++){var o=this.subscriptions[i];o.regexp.test(t)&&o.callback&&o.callback(t,e,n)}},p.prototype.add=function(t){if(void 0==t.id)throw Error("Component has no field id");if(!(t instanceof u||t instanceof p))throw new TypeError("Component must be an instance of prototype Component or Controller");t.controller=this,this.components[t.id]=t},p.prototype.remove=function(t){var e;for(e in this.components)if(this.components.hasOwnProperty(e)&&(e==t||this.components[e]==t))break;e&&delete this.components[e]},p.prototype.requestReflow=function(t){if(t)this.reflow();else if(!this.reflowTimer){var e=this;this.reflowTimer=setTimeout(function(){e.reflowTimer=void 0,e.reflow()},0)}},p.prototype.requestRepaint=function(t){if(t)this.repaint();else if(!this.repaintTimer){var e=this;this.repaintTimer=setTimeout(function(){e.repaintTimer=void 0,e.repaint()},0)}},p.prototype.repaint=function(){function t(i,o){o in n||(i.depends&&i.depends.forEach(function(e){t(e,e.id)}),i.parent&&t(i.parent,i.parent.id),e=i.repaint()||e,n[o]=!0)}var e=!1;this.repaintTimer&&(clearTimeout(this.repaintTimer),this.repaintTimer=void 0);var n={};T.forEach(this.components,t),e&&this.reflow()},p.prototype.reflow=function(){function t(i,o){o in n||(i.depends&&i.depends.forEach(function(e){t(e,e.id)}),i.parent&&t(i.parent,i.parent.id),e=i.reflow()||e,n[o]=!0)}var e=!1;this.reflowTimer&&(clearTimeout(this.reflowTimer),this.reflowTimer=void 0);var n={};T.forEach(this.components,t),e&&this.repaint()},u.prototype.setOptions=function(t){t&&(T.extend(this.options,t),this.controller&&(this.requestRepaint(),this.requestReflow()))},u.prototype.getContainer=function(){return null},u.prototype.getFrame=function(){return this.frame},u.prototype.repaint=function(){return!1},u.prototype.reflow=function(){return!1},u.prototype.hide=function(){return this.frame&&this.frame.parentNode?(this.frame.parentNode.removeChild(this.frame),!0):!1},u.prototype.show=function(){return this.frame&&this.frame.parentNode?!1:this.repaint()},u.prototype.requestRepaint=function(){if(!this.controller)throw Error("Cannot request a repaint: no controller configured");this.controller.requestRepaint()},u.prototype.requestReflow=function(){if(!this.controller)throw Error("Cannot request a reflow: no controller configured");this.controller.requestReflow()},c.prototype=new u,c.prototype.getContainer=function(){return this.frame},c.prototype.repaint=function(){var t=0,e=T.updateProperty,n=T.option.asSize,i=this.options,o=this.frame;if(o||(o=document.createElement("div"),o.className="panel",i.className&&("function"==typeof i.className?T.addClassName(o,i.className()+""):T.addClassName(o,i.className+"")),this.frame=o,t+=1),!o.parentNode){if(!this.parent)throw Error("Cannot repaint panel: no parent attached");var r=this.parent.getContainer();if(!r)throw Error("Cannot repaint panel: parent has no container element");r.appendChild(o),t+=1}return t+=e(o.style,"top",n(i.top,"0px")),t+=e(o.style,"left",n(i.left,"0px")),t+=e(o.style,"width",n(i.width,"100%")),t+=e(o.style,"height",n(i.height,"100%")),t>0},c.prototype.reflow=function(){var t=0,e=T.updateProperty,n=this.frame;return n?(t+=e(this,"top",n.offsetTop),t+=e(this,"left",n.offsetLeft),t+=e(this,"width",n.offsetWidth),t+=e(this,"height",n.offsetHeight)):t+=1,t>0},d.prototype=new c,d.prototype.setOptions=function(t){T.extend(this.options,t),this.options.autoResize?this._watch():this._unwatch()},d.prototype.repaint=function(){var t=0,e=T.updateProperty,n=T.option.asSize,i=this.options,o=this.frame;if(o||(o=document.createElement("div"),o.className="graph panel",i.className&&T.addClassName(o,T.option.asString(i.className)),this.frame=o,t+=1),!o.parentNode){if(!this.container)throw Error("Cannot repaint root panel: no container attached");this.container.appendChild(o),t+=1}return t+=e(o.style,"top",n(i.top,"0px")),t+=e(o.style,"left",n(i.left,"0px")),t+=e(o.style,"width",n(i.width,"100%")),t+=e(o.style,"height",n(i.height,"100%")),this._updateEventEmitters(),t>0},d.prototype.reflow=function(){var t=0,e=T.updateProperty,n=this.frame;return n?(t+=e(this,"top",n.offsetTop),t+=e(this,"left",n.offsetLeft),t+=e(this,"width",n.offsetWidth),t+=e(this,"height",n.offsetHeight)):t+=1,t>0},d.prototype._watch=function(){var t=this;this._unwatch();var e=function(){return t.options.autoResize?(t.frame&&(t.frame.clientWidth!=t.width||t.frame.clientHeight!=t.height)&&t.requestReflow(),void 0):(t._unwatch(),void 0)};T.addEventListener(window,"resize",e),this.watchTimer=setInterval(e,1e3)},d.prototype._unwatch=function(){this.watchTimer&&(clearInterval(this.watchTimer),this.watchTimer=void 0)},d.prototype.on=function(t,e){var n=this.listeners[t];n||(n=[],this.listeners[t]=n),n.push(e),this._updateEventEmitters()},d.prototype._updateEventEmitters=function(){if(this.listeners){var t=this;T.forEach(this.listeners,function(e,n){if(t.emitters||(t.emitters={}),!(n in t.emitters)){var i=t.frame;if(i){var o=function(t){e.forEach(function(e){e(t)})};t.emitters[n]=o,T.addEventListener(i,n,o)}}})}},l.prototype=new u,l.prototype.setOptions=function(t){T.extend(this.options,t)},l.prototype.setRange=function(t){if(!(t instanceof a||t&&t.start&&t.end))throw new TypeError("Range must be an instance of Range, or an object containing start and end.");this.range=t},l.prototype.toTime=function(t){var e=this.conversion;return new Date(t/e.factor+e.offset)},l.prototype.toScreen=function(t){var e=this.conversion;return(t.valueOf()-e.offset)*e.factor},l.prototype.repaint=function(){var t=0,e=T.updateProperty,n=T.option.asSize,i=this.options,o=this.props,r=this.step,s=this.frame;if(s||(s=document.createElement("div"),this.frame=s,t+=1),s.className="axis "+i.orientation,!s.parentNode){if(!this.parent)throw Error("Cannot repaint time axis: no parent attached");var a=this.parent.getContainer();if(!a)throw Error("Cannot repaint time axis: parent has no container element");a.appendChild(s),t+=1}var h=s.parentNode;if(h){var p=s.nextSibling;h.removeChild(s);var u=i.orientation,c="bottom"==u&&this.props.parentHeight&&this.height?this.props.parentHeight-this.height+"px":"0px";if(t+=e(s.style,"top",n(i.top,c)),t+=e(s.style,"left",n(i.left,"0px")),t+=e(s.style,"width",n(i.width,"100%")),t+=e(s.style,"height",n(i.height,this.height+"px")),this._repaintMeasureChars(),this.step){this._repaintStart(),r.first();for(var d=void 0,l=0;r.hasNext()&&1e3>l;){l++;var f=r.getCurrent(),m=this.toScreen(f),g=r.isMajor();i.showMinorLabels&&this._repaintMinorText(m,r.getLabelMinor()),g&&i.showMajorLabels?(m>0&&(void 0==d&&(d=m),this._repaintMajorText(m,r.getLabelMajor())),this._repaintMajorLine(m)):this._repaintMinorLine(m),r.next()}if(i.showMajorLabels){var v=this.toTime(0),y=r.getLabelMajor(v),w=y.length*(o.majorCharWidth||10)+10;(void 0==d||d>w)&&this._repaintMajorText(0,y)}this._repaintEnd()}this._repaintLine(),p?h.insertBefore(s,p):h.appendChild(s)}return t>0},l.prototype._repaintStart=function(){var t=this.dom,e=t.redundant;e.majorLines=t.majorLines,e.majorTexts=t.majorTexts,e.minorLines=t.minorLines,e.minorTexts=t.minorTexts,t.majorLines=[],t.majorTexts=[],t.minorLines=[],t.minorTexts=[]},l.prototype._repaintEnd=function(){T.forEach(this.dom.redundant,function(t){for(;t.length;){var e=t.pop();e&&e.parentNode&&e.parentNode.removeChild(e)}})},l.prototype._repaintMinorText=function(t,e){var n=this.dom.redundant.minorTexts.shift();if(!n){var i=document.createTextNode("");n=document.createElement("div"),n.appendChild(i),n.className="text minor",this.frame.appendChild(n)}this.dom.minorTexts.push(n),n.childNodes[0].nodeValue=e,n.style.left=t+"px",n.style.top=this.props.minorLabelTop+"px"},l.prototype._repaintMajorText=function(t,e){var n=this.dom.redundant.majorTexts.shift();if(!n){var i=document.createTextNode(e);n=document.createElement("div"),n.className="text major",n.appendChild(i),this.frame.appendChild(n)}this.dom.majorTexts.push(n),n.childNodes[0].nodeValue=e,n.style.top=this.props.majorLabelTop+"px",n.style.left=t+"px"},l.prototype._repaintMinorLine=function(t){var e=this.dom.redundant.minorLines.shift();e||(e=document.createElement("div"),e.className="grid vertical minor",this.frame.appendChild(e)),this.dom.minorLines.push(e);var n=this.props;e.style.top=n.minorLineTop+"px",e.style.height=n.minorLineHeight+"px",e.style.left=t-n.minorLineWidth/2+"px"},l.prototype._repaintMajorLine=function(t){var e=this.dom.redundant.majorLines.shift();e||(e=document.createElement("DIV"),e.className="grid vertical major",this.frame.appendChild(e)),this.dom.majorLines.push(e);var n=this.props;e.style.top=n.majorLineTop+"px",e.style.left=t-n.majorLineWidth/2+"px",e.style.height=n.majorLineHeight+"px"},l.prototype._repaintLine=function(){var t=this.dom.line,e=this.frame,n=this.options;n.showMinorLabels||n.showMajorLabels?(t?(e.removeChild(t),e.appendChild(t)):(t=document.createElement("div"),t.className="grid horizontal major",e.appendChild(t),this.dom.line=t),t.style.top=this.props.lineTop+"px"):t&&axis.parentElement&&(e.removeChild(axis.line),delete this.dom.line)},l.prototype._repaintMeasureChars=function(){var t,e=this.dom;if(!e.measureCharMinor){t=document.createTextNode("0");var n=document.createElement("DIV");n.className="text minor measure",n.appendChild(t),this.frame.appendChild(n),e.measureCharMinor=n}if(!e.measureCharMajor){t=document.createTextNode("0");var i=document.createElement("DIV");i.className="text major measure",i.appendChild(t),this.frame.appendChild(i),e.measureCharMajor=i}},l.prototype.reflow=function(){var t=0,e=T.updateProperty,n=this.frame,i=this.range;if(!i)throw Error("Cannot repaint time axis: no range configured");if(n){t+=e(this,"top",n.offsetTop),t+=e(this,"left",n.offsetLeft);var o=this.props,r=this.options.showMinorLabels,s=this.options.showMajorLabels,a=this.dom.measureCharMinor,h=this.dom.measureCharMajor;a&&(o.minorCharHeight=a.clientHeight,o.minorCharWidth=a.clientWidth),h&&(o.majorCharHeight=h.clientHeight,o.majorCharWidth=h.clientWidth);var p=n.parentNode?n.parentNode.offsetHeight:0;switch(p!=o.parentHeight&&(o.parentHeight=p,t+=1),this.options.orientation){case"bottom":o.minorLabelHeight=r?o.minorCharHeight:0,o.majorLabelHeight=s?o.majorCharHeight:0,o.minorLabelTop=0,o.majorLabelTop=o.minorLabelTop+o.minorLabelHeight,o.minorLineTop=-this.top,o.minorLineHeight=Math.max(this.top+o.majorLabelHeight,0),o.minorLineWidth=1,o.majorLineTop=-this.top,o.majorLineHeight=Math.max(this.top+o.minorLabelHeight+o.majorLabelHeight,0),o.majorLineWidth=1,o.lineTop=0;break;case"top":o.minorLabelHeight=r?o.minorCharHeight:0,o.majorLabelHeight=s?o.majorCharHeight:0,o.majorLabelTop=0,o.minorLabelTop=o.majorLabelTop+o.majorLabelHeight,o.minorLineTop=o.minorLabelTop,o.minorLineHeight=Math.max(p-o.majorLabelHeight-this.top),o.minorLineWidth=1,o.majorLineTop=0,o.majorLineHeight=Math.max(p-this.top),o.majorLineWidth=1,o.lineTop=o.majorLabelHeight+o.minorLabelHeight;break;default:throw Error('Unkown orientation "'+this.options.orientation+'"')}var u=o.minorLabelHeight+o.majorLabelHeight;t+=e(this,"width",n.offsetWidth),t+=e(this,"height",u),this._updateConversion();var c=T.cast(i.start,"Date"),d=T.cast(i.end,"Date"),l=this.toTime(5*(o.minorCharWidth||10))-this.toTime(0);this.step=new TimeStep(c,d,l),t+=e(o.range,"start",c.valueOf()),t+=e(o.range,"end",d.valueOf()),t+=e(o.range,"minimumStep",l.valueOf())}return t>0},l.prototype._updateConversion=function(){var t=this.range;if(!t)throw Error("No range configured");this.conversion=t.conversion?t.conversion(this.width):a.conversion(t.start,t.end,this.width)},f.prototype=new c,f.types={box:g,range:y,point:v},f.prototype.setOptions=function(t){T.extend(this.options,t),this.stack.setOptions(this.options)},f.prototype.setRange=function(t){if(!(t instanceof a||t&&t.start&&t.end))throw new TypeError("Range must be an instance of Range, or an object containing start and end.");this.range=t},f.prototype.repaint=function(){var t=0,e=T.updateProperty,n=T.option.asSize,i=this.options,o=this.frame;if(!o){o=document.createElement("div"),o.className="itemset",i.className&&T.addClassName(o,T.option.asString(i.className));var r=document.createElement("div");r.className="background",o.appendChild(r),this.dom.background=r;var s=document.createElement("div");s.className="foreground",o.appendChild(s),this.dom.foreground=s;var a=document.createElement("div");a.className="itemset-axis",this.dom.axis=a,this.frame=o,t+=1}if(!this.parent)throw Error("Cannot repaint itemset: no parent attached");var h=this.parent.getContainer();if(!h)throw Error("Cannot repaint itemset: parent has no container element");o.parentNode||(h.appendChild(o),t+=1),this.dom.axis.parentNode||(h.appendChild(this.dom.axis),t+=1),t+=e(o.style,"left",n(i.left,"0px")),t+=e(o.style,"top",n(i.top,"0px")),t+=e(o.style,"width",n(i.width,"100%")),t+=e(o.style,"height",n(i.height,this.height+"px")),t+=e(this.dom.axis.style,"left",n(i.left,"0px")),t+=e(this.dom.axis.style,"width",n(i.width,"100%")),t+="bottom"==this.options.orientation?e(this.dom.axis.style,"top",this.height+this.top+"px"):e(this.dom.axis.style,"top",this.top+"px"),this._updateConversion();var p=this,u=this.queue,c=this.items,d=this.contents,l={fields:[c&&c.fieldId||"id","start","end","content","type"]};return Object.keys(u).forEach(function(e){var n=u[e],o=d[e];switch(n){case"add":case"update":var r=c&&c.get(e,l);if(r){var s=r.type||r.start&&r.end&&"range"||"box",a=f.types[s];if(o&&(a&&o instanceof a?(o.data=r,t++):(t+=o.hide(),o=null)),!o){if(!a)throw new TypeError('Unknown item type "'+s+'"');o=new a(p,r,i),t++}d[e]=o}delete u[e];break;case"remove":o&&(t+=o.hide()),delete d[e],delete u[e];break;default:console.log('Error: unknown action "'+n+'"')}}),T.forEach(this.contents,function(e){e.visible?(t+=e.show(),e.reposition()):t+=e.hide()}),t>0},f.prototype.getForeground=function(){return this.dom.foreground},f.prototype.getBackground=function(){return this.dom.background},f.prototype.getAxis=function(){return this.dom.axis},f.prototype.reflow=function(){var t=0,e=this.options,n=T.updateProperty,i=T.option.asNumber,o=this.frame;if(o){this._updateConversion(),T.forEach(this.contents,function(e){t+=e.reflow()}),this.stack.update();var r,s=i(e.maxHeight);if(null!=e.height)r=o.offsetHeight;else{var a=this.stack.ordered;if(a.length){var h=a[0].top,p=a[0].top+a[0].height;T.forEach(a,function(t){h=Math.min(h,t.top),p=Math.max(p,t.top+t.height)}),r=p-h+e.margin.axis+e.margin.item}else r=e.margin.axis+e.margin.item}null!=s&&(r=Math.min(r,s)),t+=n(this,"height",r),t+=n(this,"top",o.offsetTop),t+=n(this,"left",o.offsetLeft),t+=n(this,"width",o.offsetWidth)}else t+=1;return t>0},f.prototype.hide=function(){var t=!1;return this.frame&&this.frame.parentNode&&(this.frame.parentNode.removeChild(this.frame),t=!0),this.dom.axis&&this.dom.axis.parentNode&&(this.dom.axis.parentNode.removeChild(this.dom.axis),t=!0),t},f.prototype.setItems=function(t){var e,n,i,s=this,a=this.items;if(a&&(T.forEach(this.listeners,function(t,e){a.unsubscribe(e,t)}),n=this.items.fieldId,e=a.get({fields:[n]}),i=[],T.forEach(e,function(t,e){i[e]=t[n]}),this._onRemove(i)),t){if(!(t instanceof o||t instanceof r))throw new TypeError("Data must be an instance of DataSet");this.items=t}else this.items=null;if(this.items){var h=this.id;T.forEach(this.listeners,function(t,e){s.items.subscribe(e,t,h)}),n=this.items.fieldId,e=this.items.get({fields:[n]}),i=[],T.forEach(e,function(t,e){i[e]=t[n]}),this._onAdd(i)}},f.prototype.getItems=function(){return this.items},f.prototype._onUpdate=function(t){this._toQueue("update",t)},f.prototype._onAdd=function(t){this._toQueue("add",t)},f.prototype._onRemove=function(t){this._toQueue("remove",t)},f.prototype._toQueue=function(t,e){var n=this.queue;e.forEach(function(e){n[e]=t}),this.controller&&this.requestRepaint()},f.prototype._updateConversion=function(){var t=this.range;if(!t)throw Error("No range configured");this.conversion=t.conversion?t.conversion(this.width):a.conversion(t.start,t.end,this.width)},f.prototype.toTime=function(t){var e=this.conversion;return new Date(t/e.factor+e.offset)},f.prototype.toScreen=function(t){var e=this.conversion;return(t.valueOf()-e.offset)*e.factor},m.prototype.select=function(){this.selected=!0},m.prototype.unselect=function(){this.selected=!1},m.prototype.show=function(){return!1},m.prototype.hide=function(){return!1},m.prototype.repaint=function(){return!1},m.prototype.reflow=function(){return!1},g.prototype=new m(null,null),g.prototype.select=function(){this.selected=!0},g.prototype.unselect=function(){this.selected=!1},g.prototype.repaint=function(){var t=!1,e=this.dom;if(e||(this._create(),e=this.dom,t=!0),e){if(!this.options&&!this.parent)throw Error("Cannot repaint item: no parent attached");var n=this.parent.getForeground();if(!n)throw Error("Cannot repaint time axis: parent has no foreground container element");var i=this.parent.getBackground();if(!i)throw Error("Cannot repaint time axis: parent has no background container element");var o=this.parent.getAxis();if(!i)throw Error("Cannot repaint time axis: parent has no axis container element");if(e.box.parentNode||(n.appendChild(e.box),t=!0),e.line.parentNode||(i.appendChild(e.line),t=!0),e.dot.parentNode||(o.appendChild(e.dot),t=!0),this.data.content!=this.content){if(this.content=this.data.content,this.content instanceof Element)e.content.innerHTML="",e.content.appendChild(this.content);else{if(void 0==this.data.content)throw Error('Property "content" missing in item '+this.data.id);e.content.innerHTML=this.content}t=!0}var r=(this.data.className?" "+this.data.className:"")+(this.selected?" selected":"");this.className!=r&&(this.className=r,e.box.className="item box"+r,e.line.className="item line"+r,e.dot.className="item dot"+r,t=!0)}return t},g.prototype.show=function(){return this.dom&&this.dom.box.parentNode?!1:this.repaint()},g.prototype.hide=function(){var t=!1,e=this.dom;return e&&(e.box.parentNode&&(e.box.parentNode.removeChild(e.box),t=!0),e.line.parentNode&&e.line.parentNode.removeChild(e.line),e.dot.parentNode&&e.dot.parentNode.removeChild(e.dot)),t},g.prototype.reflow=function(){var t,e,n,i,o,r,s,a,h,p,u,c=0;if(void 0==this.data.start)throw Error('Property "start" missing in item '+this.data.id);if(p=this.data,u=this.parent&&this.parent.range,this.visible=p&&u?p.start>u.start&&p.start0},g.prototype._create=function(){var t=this.dom;t||(this.dom=t={},t.box=document.createElement("DIV"),t.content=document.createElement("DIV"),t.content.className="content",t.box.appendChild(t.content),t.line=document.createElement("DIV"),t.line.className="line",t.dot=document.createElement("DIV"),t.dot.className="dot")},g.prototype.reposition=function(){var t=this.dom,e=this.props,n=this.options.orientation;if(t){var i=t.box,o=t.line,r=t.dot;i.style.left=this.left+"px",i.style.top=this.top+"px",o.style.left=e.line.left+"px","top"==n?(o.style.top="0px",o.style.height=this.top+"px"):(o.style.top=this.top+this.height+"px",o.style.height=Math.max(this.parent.height-this.top-this.height+this.props.dot.height/2,0)+"px"),r.style.left=e.dot.left+"px",r.style.top=e.dot.top+"px"}},v.prototype=new m(null,null),v.prototype.select=function(){this.selected=!0},v.prototype.unselect=function(){this.selected=!1},v.prototype.repaint=function(){var t=!1,e=this.dom;if(e||(this._create(),e=this.dom,t=!0),e){if(!this.options&&!this.options.parent)throw Error("Cannot repaint item: no parent attached");var n=this.parent.getForeground();if(!n)throw Error("Cannot repaint time axis: parent has no foreground container element");if(e.point.parentNode||(n.appendChild(e.point),n.appendChild(e.point),t=!0),this.data.content!=this.content){if(this.content=this.data.content,this.content instanceof Element)e.content.innerHTML="",e.content.appendChild(this.content);else{if(void 0==this.data.content)throw Error('Property "content" missing in item '+this.data.id);e.content.innerHTML=this.content}t=!0}var i=(this.data.className?" "+this.data.className:"")+(this.selected?" selected":"");this.className!=i&&(this.className=i,e.point.className="item point"+i,t=!0)}return t},v.prototype.show=function(){return this.dom&&this.dom.point.parentNode?!1:this.repaint()},v.prototype.hide=function(){var t=!1,e=this.dom;return e&&e.point.parentNode&&(e.point.parentNode.removeChild(e.point),t=!0),t},v.prototype.reflow=function(){var t,e,n,i,o,r,s,a,h,p=0;if(void 0==this.data.start)throw Error('Property "start" missing in item '+this.data.id);if(a=this.data,h=this.parent&&this.parent.range,this.visible=a&&h?a.start>h.start&&a.start0},v.prototype._create=function(){var t=this.dom;t||(this.dom=t={},t.point=document.createElement("div"),t.content=document.createElement("div"),t.content.className="content",t.point.appendChild(t.content),t.dot=document.createElement("div"),t.dot.className="dot",t.point.appendChild(t.dot))},v.prototype.reposition=function(){var t=this.dom,e=this.props;t&&(t.point.style.top=this.top+"px",t.point.style.left=this.left+"px",t.content.style.marginLeft=e.content.marginLeft+"px",t.dot.style.top=e.dot.top+"px")},y.prototype=new m(null,null),y.prototype.select=function(){this.selected=!0},y.prototype.unselect=function(){this.selected=!1},y.prototype.repaint=function(){var t=!1,e=this.dom;if(e||(this._create(),e=this.dom,t=!0),e){if(!this.options&&!this.options.parent)throw Error("Cannot repaint item: no parent attached");var n=this.parent.getForeground();if(!n)throw Error("Cannot repaint time axis: parent has no foreground container element");if(e.box.parentNode||(n.appendChild(e.box),t=!0),this.data.content!=this.content){if(this.content=this.data.content,this.content instanceof Element)e.content.innerHTML="",e.content.appendChild(this.content);else{if(void 0==this.data.content)throw Error('Property "content" missing in item '+this.data.id);e.content.innerHTML=this.content}t=!0}var i=this.data.className?""+this.data.className:"";this.className!=i&&(this.className=i,e.box.className="item range"+i,t=!0)}return t},y.prototype.show=function(){return this.dom&&this.dom.box.parentNode?!1:this.repaint()},y.prototype.hide=function(){var t=!1,e=this.dom;return e&&e.box.parentNode&&(e.box.parentNode.removeChild(e.box),t=!0),t},y.prototype.reflow=function(){var t,e,n,i,o,r,s,a,h,p,u,c,d,l,f=0;if(void 0==this.data.start)throw Error('Property "start" missing in item '+this.data.id);if(void 0==this.data.end)throw Error('Property "end" missing in item '+this.data.id);return s=this.data,a=this.parent&&this.parent.range,this.visible=s&&a?s.starta.start:!1,this.visible&&(t=this.dom,t?(e=this.props,n=this.options,i=this.parent,o=i.toScreen(this.data.start),r=i.toScreen(this.data.end),h=T.updateProperty,p=t.box,u=i.width,d=n.orientation,f+=h(e.content,"width",t.content.offsetWidth),f+=h(this,"height",p.offsetHeight),-u>o&&(o=-u),r>2*u&&(r=2*u),c=0>o?Math.min(-o,r-o-e.content.width-2*n.padding):0,f+=h(e.content,"left",c),"top"==d?(l=n.margin.axis,f+=h(this,"top",l)):(l=i.height-this.height-n.margin.axis,f+=h(this,"top",l)),f+=h(this,"left",o),f+=h(this,"width",Math.max(r-o,1))):f+=1),f>0},y.prototype._create=function(){var t=this.dom;t||(this.dom=t={},t.box=document.createElement("div"),t.content=document.createElement("div"),t.content.className="content",t.box.appendChild(t.content))},y.prototype.reposition=function(){var t=this.dom,e=this.props;t&&(t.box.style.top=this.top+"px",t.box.style.left=this.left+"px",t.box.style.width=this.width+"px",t.content.style.left=e.content.left+"px")},w.prototype=new c,w.prototype.setOptions=function(t){T.extend(this.options,t);var e=this;T.forEach(this.contents,function(t){t.itemset.setOptions(e.options)})},w.prototype.setRange=function(){},w.prototype.setItems=function(t){this.items=t,T.forEach(this.contents,function(e){e.view.setData(t)})},w.prototype.getItems=function(){return this.items},w.prototype.setRange=function(t){this.range=t},w.prototype.setGroups=function(t){var e,n,i=this;if(this.groups&&(T.forEach(this.listeners,function(t,e){i.groups.unsubscribe(e,t)}),e=this.groups.get({fields:["id"]}),n=[],T.forEach(e,function(t,e){n[e]=t.id}),this._onRemove(n)),t?t instanceof o?this.groups=t:(this.groups=new o({fieldTypes:{start:"Date",end:"Date"}}),this.groups.add(t)):this.groups=null,this.groups){var r=this.id;T.forEach(this.listeners,function(t,e){i.groups.subscribe(e,t,r)}),e=this.groups.get({fields:["id"]}),n=[],T.forEach(e,function(t,e){n[e]=t.id}),this._onAdd(n)}},w.prototype.getGroups=function(){return this.groups},w.prototype.repaint=function(){var t=0,e=T.updateProperty,n=T.option.asSize,i=this.options,o=this.frame;if(o||(o=document.createElement("div"),o.className="groupset",i.className&&T.addClassName(o,T.option.asString(i.className)),this.frame=o,t+=1),!this.parent)throw Error("Cannot repaint groupset: no parent attached");var s=this.parent.getContainer();if(!s)throw Error("Cannot repaint groupset: parent has no container element");o.parentNode||(s.appendChild(o),t+=1),t+=e(o.style,"height",n(i.height,this.height+"px")),t+=e(o.style,"top",n(i.top,"0px")),t+=e(o.style,"left",n(i.left,"0px")),t+=e(o.style,"width",n(i.width,"100%"));var a=this,h=this.queue,p=(this.items,this.contents),u=this.groups,c=Object.keys(h);if(c.length){c.forEach(function(e){for(var n=h[e],i=null,o=-1,s=0;p.length>s;s++)if(p[s].id==e){i=p[s],o=s;break}switch(n){case"add":case"update":if(!i){var c=new f(a);c.setOptions(a.options),c.setRange(a.range);var d=new r(a.items,{filter:function(t){return t.group==e}});c.setItems(d),a.controller.add(c),i={id:e,view:d,itemset:c},p.push(i)}i.data=u.get(e),delete h[e];break;case"remove":i&&(t+=i.itemset.hide(),i.itemset.setItems(),a.controller.remove(i.itemset),p.splice(o,1)),delete h[e];break;default:console.log('Error: unknown action "'+n+'"')}});var d=null;T.forEach(this.contents,function(t){var e=d&&d.itemset;t.itemset.options.top=e?function(){return e.top+e.height}:0,d=t})}return T.forEach(this.contents,function(e){t+=e.itemset.repaint()}),t>0},w.prototype.getContainer=function(){return this.frame},w.prototype.reflow=function(){var t=0,e=this.options,n=T.updateProperty,i=T.option.asNumber,o=this.frame;if(o){T.forEach(this.contents,function(e){t+=e.itemset.reflow()});var r,s=i(e.maxHeight);null!=e.height?r=o.offsetHeight:(r=0,T.forEach(this.contents,function(t){r+=t.itemset.height})),null!=s&&(r=Math.min(r,s)),t+=n(this,"height",r),t+=n(this,"top",o.offsetTop),t+=n(this,"left",o.offsetLeft),t+=n(this,"width",o.offsetWidth)}return t>0},w.prototype.hide=function(){return this.frame&&this.frame.parentNode?(this.frame.parentNode.removeChild(this.frame),!0):!1},w.prototype.show=function(){return this.frame&&this.frame.parentNode?!1:this.repaint()},w.prototype._onUpdate=function(t){this._toQueue(t,"update")},w.prototype._onAdd=function(t){this._toQueue(t,"add")},w.prototype._onRemove=function(t){this._toQueue(t,"remove")},w.prototype._toQueue=function(t,e){var n=this.queue;t.forEach(function(t){n[t]=e}),this.controller&&this.requestRepaint() -},b.prototype.setOptions=function(t){T.extend(this.options,t),this.timeaxis.setOptions({orientation:this.options.orientation,showMinorLabels:this.options.showMinorLabels,showMajorLabels:this.options.showMajorLabels}),this.range.setOptions({min:this.options.min,max:this.options.max,zoomMin:this.options.zoomMin,zoomMax:this.options.zoomMax});var e,n,i,o,r=this;if(e="top"==this.options.orientation?function(){return r.timeaxis.height}:function(){return r.main.height-r.timeaxis.height-r.content.height},this.options.height?(i=this.options.height,n=function(){return r.main.height-r.timeaxis.height}):(i=function(){return r.timeaxis.height+r.content.height},n=null),this.options.maxHeight){if(!T.isNumber(this.options.maxHeight))throw new TypeError("Number expected for property maxHeight");o=function(){return r.options.maxHeight-r.timeaxis.height}}this.main.setOptions({height:i}),this.content.setOptions({orientation:this.options.orientation,top:e,height:n,maxHeight:o}),this.controller.repaint()},b.prototype.setItems=function(t){var e,n=null==this.items;if(t?t instanceof o&&(e=t):e=null,t instanceof o||(e=new o({fieldTypes:{start:"Date",end:"Date"}}),e.add(t)),this.items=e,this.content.setItems(e),n&&(void 0==this.options.start||void 0==this.options.end)){var i=this.getItemRange(),r=i.min,s=i.max;if(null!=r&&null!=s){var a=s.valueOf()-r.valueOf();r=new Date(r.valueOf()-.05*a),s=new Date(s.valueOf()+.05*a)}void 0!=this.options.start&&(r=new Date(this.options.start.valueOf())),void 0!=this.options.end&&(s=new Date(this.options.end.valueOf())),(null!=r||null!=s)&&this.range.setRange(r,s)}},b.prototype.setGroups=function(t){this.groups=t;var e=this.groups?w:f;this.content instanceof e||(this.content&&(this.content.hide(),this.content.setItems&&this.content.setItems(),this.content.setGroups&&this.content.setGroups(),this.controller.remove(this.content)),this.content=new e(this.main,[this.timeaxis]),this.content.setRange&&this.content.setRange(this.range),this.content.setItems&&this.content.setItems(this.items),this.content.setGroups&&this.content.setGroups(this.groups),this.controller.add(this.content),this.setOptions(this.options))},b.prototype.getItemRange=function(){var t=this.items,e=null,n=null;if(t){var i=t.min("start");e=i?i.start.valueOf():null;var o=t.max("start");o&&(n=o.start.valueOf());var r=t.max("end");r&&(n=null==n?r.end.valueOf():Math.max(n,r.end.valueOf()))}return{min:null!=e?new Date(e):null,max:null!=n?new Date(n):null}};var C={util:T,events:_,Controller:p,DataSet:o,DataView:r,Range:a,Stack:s,TimeStep:TimeStep,EventBus:h,components:{items:{Item:m,ItemBox:g,ItemPoint:v,ItemRange:y},Component:u,Panel:c,RootPanel:d,ItemSet:f,TimeAxis:l},Timeline:b};i!==void 0&&(i=C),n!==void 0&&n.exports!==void 0&&(n.exports=C),"function"==typeof t&&t(function(){return C}),"undefined"!=typeof window&&(window.vis=C),T.loadCss("/* vis.js stylesheet */\n\n.graph {\n position: relative;\n border: 1px solid #bfbfbf;\n}\n\n.graph .panel {\n position: absolute;\n}\n\n.graph .groupset {\n position: absolute;\n padding: 0;\n margin: 0;\n}\n\n\n.graph .itemset {\n position: absolute;\n padding: 0;\n margin: 0;\n overflow: hidden;\n}\n\n.graph .background {\n}\n\n.graph .foreground {\n}\n\n.graph .itemset-axis {\n position: absolute;\n}\n\n.graph .groupset .itemset-axis {\n border-top: 1px solid #bfbfbf;\n}\n\n.graph .groupset .itemset-axis:last-child {\n border-top: none;\n}\n\n\n.graph .item {\n position: absolute;\n color: #1A1A1A;\n border-color: #97B0F8;\n background-color: #D5DDF6;\n display: inline-block;\n}\n\n.graph .item.selected {\n border-color: #FFC200;\n background-color: #FFF785;\n z-index: 999;\n}\n\n.graph .item.cluster {\n /* TODO: use another color or pattern? */\n background: #97B0F8 url('img/cluster_bg.png');\n color: white;\n}\n.graph .item.cluster.point {\n border-color: #D5DDF6;\n}\n\n.graph .item.box {\n text-align: center;\n border-style: solid;\n border-width: 1px;\n border-radius: 5px;\n -moz-border-radius: 5px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.point {\n background: none;\n}\n\n.graph .dot {\n border: 5px solid #97B0F8;\n position: absolute;\n border-radius: 5px;\n -moz-border-radius: 5px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.range {\n overflow: hidden;\n border-style: solid;\n border-width: 1px;\n border-radius: 2px;\n -moz-border-radius: 2px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.range .drag-left {\n cursor: w-resize;\n z-index: 1000;\n}\n\n.graph .item.range .drag-right {\n cursor: e-resize;\n z-index: 1000;\n}\n\n.graph .item.range .content {\n position: relative;\n display: inline-block;\n}\n\n.graph .item.line {\n position: absolute;\n width: 0;\n border-left-width: 1px;\n border-left-style: solid;\n}\n\n.graph .item .content {\n margin: 5px;\n white-space: nowrap;\n overflow: hidden;\n}\n\n/* TODO: better css name, 'graph' is way to generic */\n\n.graph {\n overflow: hidden;\n}\n\n.graph .axis {\n position: relative;\n}\n\n.graph .axis .text {\n position: absolute;\n color: #4d4d4d;\n padding: 3px;\n white-space: nowrap;\n}\n\n.graph .axis .text.measure {\n position: absolute;\n padding-left: 0;\n padding-right: 0;\n margin-left: 0;\n margin-right: 0;\n visibility: hidden;\n}\n\n.graph .axis .grid.vertical {\n position: absolute;\n width: 0;\n border-right: 1px solid;\n}\n\n.graph .axis .grid.horizontal {\n position: absolute;\n left: 0;\n width: 100%;\n height: 0;\n border-bottom: 1px solid;\n}\n\n.graph .axis .grid.minor {\n border-color: #e5e5e5;\n}\n\n.graph .axis .grid.major {\n border-color: #bfbfbf;\n}\n\n")},{moment:2}],2:[function(e,n){(function(){(function(i){function o(t,e){return function(n){return c(t.call(this,n),e)}}function r(t){return function(e){return this.lang().ordinal(t.call(this,e))}}function s(){}function a(t){p(this,t)}function h(t){var e=this._data={},n=t.years||t.year||t.y||0,i=t.months||t.month||t.M||0,o=t.weeks||t.week||t.w||0,r=t.days||t.day||t.d||0,s=t.hours||t.hour||t.h||0,a=t.minutes||t.minute||t.m||0,h=t.seconds||t.second||t.s||0,p=t.milliseconds||t.millisecond||t.ms||0;this._milliseconds=p+1e3*h+6e4*a+36e5*s,this._days=r+7*o,this._months=i+12*n,e.milliseconds=p%1e3,h+=u(p/1e3),e.seconds=h%60,a+=u(h/60),e.minutes=a%60,s+=u(a/60),e.hours=s%24,r+=u(s/24),r+=7*o,e.days=r%30,i+=u(r/30),e.months=i%12,n+=u(i/12),e.years=n}function p(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function u(t){return 0>t?Math.ceil(t):Math.floor(t)}function c(t,e){for(var n=t+"";e>n.length;)n="0"+n;return n}function d(t,e,n){var i,o=e._milliseconds,r=e._days,s=e._months;o&&t._d.setTime(+t+o*n),r&&t.date(t.date()+r*n),s&&(i=t.date(),t.date(1).month(t.month()+s*n).date(Math.min(i,t.daysInMonth())))}function l(t){return"[object Array]"===Object.prototype.toString.call(t)}function f(t,e){var n,i=Math.min(t.length,e.length),o=Math.abs(t.length-e.length),r=0;for(n=0;i>n;n++)~~t[n]!==~~e[n]&&r++;return r+o}function m(t,e){return e.abbr=t,R[t]||(R[t]=new s),R[t].set(e),R[t]}function g(t){return t?(!R[t]&&P&&e("./lang/"+t),R[t]):I.fn._lang}function v(t){return t.match(/\[.*\]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function y(t){var e,n,i=t.match(F);for(e=0,n=i.length;n>e;e++)i[e]=ae[i[e]]?ae[i[e]]:v(i[e]);return function(o){var r="";for(e=0;n>e;e++)r+="function"==typeof i[e].call?i[e].call(o,t):i[e];return r}}function w(t,e){function n(e){return t.lang().longDateFormat(e)||e}for(var i=5;i--&&z.test(e);)e=e.replace(z,n);return oe[e]||(oe[e]=y(e)),oe[e](t)}function b(t){switch(t){case"DDDD":return V;case"YYYY":return B;case"YYYYY":return Z;case"S":case"SS":case"SSS":case"DDD":return q;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":case"a":case"A":return X;case"X":return J;case"Z":case"ZZ":return K;case"T":return G;case"MM":case"DD":case"YY":case"HH":case"hh":case"mm":case"ss":case"M":case"D":case"d":case"H":case"h":case"m":case"s":return W;default:return RegExp(t.replace("\\",""))}}function S(t,e,n){var i,o=n._a;switch(t){case"M":case"MM":o[1]=null==e?0:~~e-1;break;case"MMM":case"MMMM":i=g(n._l).monthsParse(e),null!=i?o[1]=i:n._isValid=!1;break;case"D":case"DD":case"DDD":case"DDDD":null!=e&&(o[2]=~~e);break;case"YY":o[0]=~~e+(~~e>68?1900:2e3);break;case"YYYY":case"YYYYY":o[0]=~~e;break;case"a":case"A":n._isPm="pm"===(e+"").toLowerCase();break;case"H":case"HH":case"h":case"hh":o[3]=~~e;break;case"m":case"mm":o[4]=~~e;break;case"s":case"ss":o[5]=~~e;break;case"S":case"SS":case"SSS":o[6]=~~(1e3*("0."+e));break;case"X":n._d=new Date(1e3*parseFloat(e));break;case"Z":case"ZZ":n._useUTC=!0,i=(e+"").match(ee),i&&i[1]&&(n._tzh=~~i[1]),i&&i[2]&&(n._tzm=~~i[2]),i&&"+"===i[0]&&(n._tzh=-n._tzh,n._tzm=-n._tzm)}null==e&&(n._isValid=!1)}function T(t){var e,n,i=[];if(!t._d){for(e=0;7>e;e++)t._a[e]=i[e]=null==t._a[e]?2===e?1:0:t._a[e];i[3]+=t._tzh||0,i[4]+=t._tzm||0,n=new Date(0),t._useUTC?(n.setUTCFullYear(i[0],i[1],i[2]),n.setUTCHours(i[3],i[4],i[5],i[6])):(n.setFullYear(i[0],i[1],i[2]),n.setHours(i[3],i[4],i[5],i[6])),t._d=n}}function E(t){var e,n,i=t._f.match(F),o=t._i;for(t._a=[],e=0;i.length>e;e++)n=(b(i[e]).exec(o)||[])[0],n&&(o=o.slice(o.indexOf(n)+n.length)),ae[i[e]]&&S(i[e],n,t);t._isPm&&12>t._a[3]&&(t._a[3]+=12),t._isPm===!1&&12===t._a[3]&&(t._a[3]=0),T(t)}function M(t){for(var e,n,i,o,r=99;t._f.length;){if(e=p({},t),e._f=t._f.pop(),E(e),n=new a(e),n.isValid()){i=n;break}o=f(e._a,n.toArray()),r>o&&(r=o,i=n)}p(t,i)}function _(t){var e,n=t._i;if(Q.exec(n)){for(t._f="YYYY-MM-DDT",e=0;4>e;e++)if(te[e][1].exec(n)){t._f+=te[e][0];break}K.exec(n)&&(t._f+=" Z"),E(t)}else t._d=new Date(n)}function C(t){var e=t._i,n=U.exec(e);e===i?t._d=new Date:n?t._d=new Date(+n[1]):"string"==typeof e?_(t):l(e)?(t._a=e.slice(0),T(t)):t._d=e instanceof Date?new Date(+e):new Date(e)}function x(t,e,n,i,o){return o.relativeTime(e||1,!!n,t,i)}function D(t,e,n){var i=j(Math.abs(t)/1e3),o=j(i/60),r=j(o/60),s=j(r/24),a=j(s/365),h=45>i&&["s",i]||1===o&&["m"]||45>o&&["mm",o]||1===r&&["h"]||22>r&&["hh",r]||1===s&&["d"]||25>=s&&["dd",s]||45>=s&&["M"]||345>s&&["MM",j(s/30)]||1===a&&["y"]||["yy",a];return h[2]=e,h[3]=t>0,h[4]=n,x.apply({},h)}function L(t,e,n){var i=n-e,o=n-t.day();return o>i&&(o-=7),i-7>o&&(o+=7),Math.ceil(I(t).add("d",o).dayOfYear()/7)}function O(t){var e=t._i,n=t._f;return null===e||""===e?null:("string"==typeof e&&(t._i=e=g().preparse(e)),I.isMoment(e)?(t=p({},e),t._d=new Date(+e._d)):n?l(n)?M(t):E(t):C(t),new a(t))}function N(t,e){I.fn[t]=I.fn[t+"s"]=function(t){var n=this._isUTC?"UTC":"";return null!=t?(this._d["set"+n+e](t),this):this._d["get"+n+e]()}}function A(t){I.duration.fn[t]=function(){return this._data[t]}}function Y(t,e){I.duration.fn["as"+t]=function(){return+this/e}}for(var I,k,H="2.0.0",j=Math.round,R={},P=n!==i&&n.exports,U=/^\/?Date\((\-?\d+)/i,F=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,z=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,W=/\d\d?/,q=/\d{1,3}/,V=/\d{3}/,B=/\d{1,4}/,Z=/[+\-]?\d{1,6}/,X=/[0-9]*[a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF]+\s*?[\u0600-\u06FF]+/i,K=/Z|[\+\-]\d\d:?\d\d/i,G=/T/i,J=/[\+\-]?\d+(\.\d{1,3})?/,Q=/^\s*\d{4}-\d\d-\d\d((T| )(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,$="YYYY-MM-DDTHH:mm:ssZ",te=[["HH:mm:ss.S",/(T| )\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],ee=/([\+\-]|\d\d)/gi,ne="Month|Date|Hours|Minutes|Seconds|Milliseconds".split("|"),ie={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},oe={},re="DDD w W M D d".split(" "),se="M D H h m s w W".split(" "),ae={M:function(){return this.month()+1},MMM:function(t){return this.lang().monthsShort(this,t)},MMMM:function(t){return this.lang().months(this,t)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(t){return this.lang().weekdaysMin(this,t)},ddd:function(t){return this.lang().weekdaysShort(this,t)},dddd:function(t){return this.lang().weekdays(this,t)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return c(this.year()%100,2)},YYYY:function(){return c(this.year(),4)},YYYYY:function(){return c(this.year(),5)},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return~~(this.milliseconds()/100)},SS:function(){return c(~~(this.milliseconds()/10),2)},SSS:function(){return c(this.milliseconds(),3)},Z:function(){var t=-this.zone(),e="+";return 0>t&&(t=-t,e="-"),e+c(~~(t/60),2)+":"+c(~~t%60,2)},ZZ:function(){var t=-this.zone(),e="+";return 0>t&&(t=-t,e="-"),e+c(~~(10*t/6),4)},X:function(){return this.unix()}};re.length;)k=re.pop(),ae[k+"o"]=r(ae[k]);for(;se.length;)k=se.pop(),ae[k+k]=o(ae[k],2);for(ae.DDDD=o(ae.DDD,3),s.prototype={set:function(t){var e,n;for(n in t)e=t[n],"function"==typeof e?this[n]=e:this["_"+n]=e},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(t){return this._months[t.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(t){return this._monthsShort[t.month()]},monthsParse:function(t){var e,n,i;for(this._monthsParse||(this._monthsParse=[]),e=0;12>e;e++)if(this._monthsParse[e]||(n=I([2e3,e]),i="^"+this.months(n,"")+"|^"+this.monthsShort(n,""),this._monthsParse[e]=RegExp(i.replace(".",""),"i")),this._monthsParse[e].test(t))return e},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(t){return this._weekdays[t.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(t){return this._weekdaysShort[t.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(t){return this._weekdaysMin[t.day()]},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(t){var e=this._longDateFormat[t];return!e&&this._longDateFormat[t.toUpperCase()]&&(e=this._longDateFormat[t.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t]=e),e},meridiem:function(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},calendar:function(t,e){var n=this._calendar[t];return"function"==typeof n?n.apply(e):n},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(t,e,n,i){var o=this._relativeTime[n];return"function"==typeof o?o(t,e,n,i):o.replace(/%d/i,t)},pastFuture:function(t,e){var n=this._relativeTime[t>0?"future":"past"];return"function"==typeof n?n(e):n.replace(/%s/i,e)},ordinal:function(t){return this._ordinal.replace("%d",t)},_ordinal:"%d",preparse:function(t){return t},postformat:function(t){return t},week:function(t){return L(t,this._week.dow,this._week.doy)},_week:{dow:0,doy:6}},I=function(t,e,n){return O({_i:t,_f:e,_l:n,_isUTC:!1})},I.utc=function(t,e,n){return O({_useUTC:!0,_isUTC:!0,_l:n,_i:t,_f:e})},I.unix=function(t){return I(1e3*t)},I.duration=function(t,e){var n,i=I.isDuration(t),o="number"==typeof t,r=i?t._data:o?{}:t;return o&&(e?r[e]=t:r.milliseconds=t),n=new h(r),i&&t.hasOwnProperty("_lang")&&(n._lang=t._lang),n},I.version=H,I.defaultFormat=$,I.lang=function(t,e){return t?(e?m(t,e):R[t]||g(t),I.duration.fn._lang=I.fn._lang=g(t),i):I.fn._lang._abbr},I.langData=function(t){return t&&t._lang&&t._lang._abbr&&(t=t._lang._abbr),g(t)},I.isMoment=function(t){return t instanceof a},I.isDuration=function(t){return t instanceof h},I.fn=a.prototype={clone:function(){return I(this)},valueOf:function(){return+this._d},unix:function(){return Math.floor(+this._d/1e3)},toString:function(){return this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._d},toJSON:function(){return I.utc(this).format("YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var t=this;return[t.year(),t.month(),t.date(),t.hours(),t.minutes(),t.seconds(),t.milliseconds()]},isValid:function(){return null==this._isValid&&(this._isValid=this._a?!f(this._a,(this._isUTC?I.utc(this._a):I(this._a)).toArray()):!isNaN(this._d.getTime())),!!this._isValid},utc:function(){return this._isUTC=!0,this},local:function(){return this._isUTC=!1,this},format:function(t){var e=w(this,t||I.defaultFormat);return this.lang().postformat(e)},add:function(t,e){var n;return n="string"==typeof t?I.duration(+e,t):I.duration(t,e),d(this,n,1),this},subtract:function(t,e){var n;return n="string"==typeof t?I.duration(+e,t):I.duration(t,e),d(this,n,-1),this},diff:function(t,e,n){var i,o,r=this._isUTC?I(t).utc():I(t).local(),s=6e4*(this.zone()-r.zone());return e&&(e=e.replace(/s$/,"")),"year"===e||"month"===e?(i=432e5*(this.daysInMonth()+r.daysInMonth()),o=12*(this.year()-r.year())+(this.month()-r.month()),o+=(this-I(this).startOf("month")-(r-I(r).startOf("month")))/i,"year"===e&&(o/=12)):(i=this-r-s,o="second"===e?i/1e3:"minute"===e?i/6e4:"hour"===e?i/36e5:"day"===e?i/864e5:"week"===e?i/6048e5:i),n?o:u(o)},from:function(t,e){return I.duration(this.diff(t)).lang(this.lang()._abbr).humanize(!e)},fromNow:function(t){return this.from(I(),t)},calendar:function(){var t=this.diff(I().startOf("day"),"days",!0),e=-6>t?"sameElse":-1>t?"lastWeek":0>t?"lastDay":1>t?"sameDay":2>t?"nextDay":7>t?"nextWeek":"sameElse";return this.format(this.lang().calendar(e,this))},isLeapYear:function(){var t=this.year();return 0===t%4&&0!==t%100||0===t%400},isDST:function(){return this.zone()+I(t).startOf(e)},isBefore:function(t,e){return e=e!==i?e:"millisecond",+this.clone().startOf(e)<+I(t).startOf(e)},isSame:function(t,e){return e=e!==i?e:"millisecond",+this.clone().startOf(e)===+I(t).startOf(e)},zone:function(){return this._isUTC?0:this._d.getTimezoneOffset()},daysInMonth:function(){return I.utc([this.year(),this.month()+1,0]).date()},dayOfYear:function(t){var e=j((I(this).startOf("day")-I(this).startOf("year"))/864e5)+1;return null==t?e:this.add("d",t-e)},isoWeek:function(t){var e=L(this,1,4);return null==t?e:this.add("d",7*(t-e))},week:function(t){var e=this.lang().week(this);return null==t?e:this.add("d",7*(t-e))},lang:function(t){return t===i?this._lang:(this._lang=g(t),this)}},k=0;ne.length>k;k++)N(ne[k].toLowerCase().replace(/s$/,""),ne[k]);N("year","FullYear"),I.fn.days=I.fn.day,I.fn.weeks=I.fn.week,I.fn.isoWeeks=I.fn.isoWeek,I.duration.fn=h.prototype={weeks:function(){return u(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+2592e6*this._months},humanize:function(t){var e=+this,n=D(e,!t,this.lang());return t&&(n=this.lang().pastFuture(e,n)),this.lang().postformat(n)},lang:I.fn.lang};for(k in ie)ie.hasOwnProperty(k)&&(Y(k,ie[k]),A(k.toLowerCase()));Y("Weeks",6048e5),I.lang("en",{ordinal:function(t){var e=t%10,n=1===~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),P&&(n.exports=I),"undefined"==typeof ender&&(this.moment=I),"function"==typeof t&&t.amd&&t("moment",[],function(){return I})}).call(this)})()},{}]},{},[1])(1)}); \ No newline at end of file +(function(t){if("function"==typeof bootstrap)bootstrap("vis",t);else if("object"==typeof exports)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeVis=t}else"undefined"!=typeof window?window.vis=t():global.vis=t()})(function(){var t;return function(t,e,i){function n(i,o){if(!e[i]){if(!t[i]){var r="function"==typeof require&&require;if(!o&&r)return r(i,!0);if(s)return s(i,!0);throw Error("Cannot find module '"+i+"'")}var a=e[i]={exports:{}};t[i][0].call(a.exports,function(e){var s=t[i][1][e];return n(s?s:e)},a,a.exports)}return e[i].exports}for(var s="function"==typeof require&&require,o=0;i.length>o;o++)n(i[o]);return n}({1:[function(e,i,n){function s(t){if(this.id=T.randomUUID(),this.options=t||{},this.data={},this.fieldId=this.options.fieldId||"id",this.fieldTypes={},this.options.fieldTypes)for(var e in this.options.fieldTypes)if(this.options.fieldTypes.hasOwnProperty(e)){var i=this.options.fieldTypes[e];this.fieldTypes[e]="Date"==i||"ISODate"==i||"ASPDate"==i?"Date":i}this.subscribers={},this.internalIds={}}function o(t,e){this.id=T.randomUUID(),this.data=null,this.ids={},this.options=e||{},this.fieldId="id",this.subscribers={};var i=this;this.listener=function(){i._onEvent.apply(i,arguments)},this.setData(t)}function r(t,e){this.parent=t,this.options={order:function(t,e){if(t instanceof y){if(e instanceof y){var i=t.data.end-t.data.start,n=e.data.end-e.data.start;return i-n||t.data.start-e.data.start}return-1}return e instanceof y?1:t.data.start-e.data.start}},this.ordered=[],this.setOptions(e)}function a(t){this.id=T.randomUUID(),this.start=0,this.end=0,this.options={min:null,max:null,zoomMin:null,zoomMax:null},this.setOptions(t),this.listeners=[]}function h(){this.subscriptions=[]}function p(){this.id=T.randomUUID(),this.components={},this.repaintTimer=void 0,this.reflowTimer=void 0}function u(){this.id=null,this.parent=null,this.depends=null,this.controller=null,this.options=null,this.frame=null,this.top=0,this.left=0,this.width=0,this.height=0}function c(t,e,i){this.id=T.randomUUID(),this.parent=t,this.depends=e,this.options={},this.setOptions(i)}function d(t,e){this.id=T.randomUUID(),this.container=t,this.options={autoResize:!0},this.listeners={},this.setOptions(e)}function l(t,e,i){this.id=T.randomUUID(),this.parent=t,this.depends=e,this.dom={majorLines:[],majorTexts:[],minorLines:[],minorTexts:[],redundant:{majorLines:[],majorTexts:[],minorLines:[],minorTexts:[]}},this.props={range:{start:0,end:0,minimumStep:0},lineTop:0},this.options={orientation:"bottom",showMinorLabels:!0,showMajorLabels:!0},this.conversion=null,this.range=null,this.setOptions(i)}function f(t,e,i){this.id=T.randomUUID(),this.parent=t,this.depends=e,this.options={style:"box",align:"center",orientation:"bottom",margin:{axis:20,item:10},padding:5},this.dom={};var n=this;this.items=null,this.range=null,this.listeners={add:function(t,e,i){i!=n.id&&n._onAdd(e.items)},update:function(t,e,i){i!=n.id&&n._onUpdate(e.items)},remove:function(t,e,i){i!=n.id&&n._onRemove(e.items)}},this.contents={},this.queue={},this.stack=new r(this),this.conversion=null,i&&this.setOptions(i)}function m(t,e,i){this.parent=t,this.data=e,this.dom=null,this.options=i,this.selected=!1,this.visible=!1,this.top=0,this.left=0,this.width=0,this.height=0}function g(t,e,i){this.props={dot:{left:0,top:0,width:0,height:0},line:{top:0,left:0,width:0,height:0}},m.call(this,t,e,i)}function v(t,e,i){this.props={dot:{top:0,width:0,height:0},content:{height:0,marginLeft:0}},m.call(this,t,e,i)}function y(t,e,i){this.props={content:{left:0,width:0}},m.call(this,t,e,i)}function w(t,e,i){this.id=T.randomUUID(),this.parent=t,this.depends=e,this.options={},this.range=null,this.items=null,this.groups=null,this.contents=[],this.queue={};var n=this;this.listeners={add:function(t,e){n._onAdd(e.items)},update:function(t,e){n._onUpdate(e.items)},remove:function(t,e){n._onRemove(e.items)}},i&&this.setOptions(i)}function b(t,e,i){var n=this;if(this.options={orientation:"bottom",zoomMin:10,zoomMax:31536e10,moveable:!0,zoomable:!0},this.controller=new p,!t)throw Error("No container element provided");this.main=new d(t,{autoResize:!1}),this.controller.add(this.main);var s=S().hours(0).minutes(0).seconds(0).milliseconds(0);this.range=new a({start:s.clone().add("days",-3).valueOf(),end:s.clone().add("days",4).valueOf()}),this.range.subscribe(this.main,"move","horizontal"),this.range.subscribe(this.main,"zoom","horizontal"),this.range.on("rangechange",function(){var t=!0;n.controller.requestReflow(t)}),this.range.on("rangechanged",function(){var t=!0;n.controller.requestReflow(t)}),this.timeaxis=new l(this.main,[],{orientation:this.options.orientation,range:this.range}),this.timeaxis.setRange(this.range),this.controller.add(this.timeaxis),this.setGroups(null),this.items=null,this.groups=null,i&&this.setOptions(i),e&&this.setItems(e)}var S=e("moment"),T={};T.isNumber=function(t){return t instanceof Number||"number"==typeof t},T.isString=function(t){return t instanceof String||"string"==typeof t},T.isDate=function(t){if(t instanceof Date)return!0;if(T.isString(t)){var e=E.exec(t);if(e)return!0;if(!isNaN(Date.parse(t)))return!0}return!1},T.isDataTable=function(t){return"undefined"!=typeof google&&google.visualization&&google.visualization.DataTable&&t instanceof google.visualization.DataTable},T.randomUUID=function(){var t=function(){return Math.floor(65536*Math.random()).toString(16)};return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},T.extend=function(t){for(var e=1,i=arguments.length;i>e;e++){var n=arguments[e];for(var s in n)n.hasOwnProperty(s)&&void 0!==n[s]&&(t[s]=n[s])}return t},T.cast=function(t,e){var i;if(void 0===t)return void 0;if(null===t)return null;if(!e)return t;if("string"!=typeof e&&!(e instanceof String))throw Error("Type must be a string");switch(e){case"boolean":case"Boolean":return Boolean(t);case"number":case"Number":return Number(t);case"string":case"String":return t+"";case"Date":if(T.isNumber(t))return new Date(t);if(t instanceof Date)return new Date(t.valueOf());if(S.isMoment(t))return new Date(t.valueOf());if(T.isString(t))return i=E.exec(t),i?new Date(Number(i[1])):S(t).toDate();throw Error("Cannot cast object of type "+T.getType(t)+" to type Date");case"Moment":if(T.isNumber(t))return S(t);if(t instanceof Date)return S(t.valueOf());if(S.isMoment(t))return S.clone();if(T.isString(t))return i=E.exec(t),i?S(Number(i[1])):S(t);throw Error("Cannot cast object of type "+T.getType(t)+" to type Date");case"ISODate":if(t instanceof Date)return t.toISOString();if(S.isMoment(t))return t.toDate().toISOString();if(T.isNumber(t)||T.isString(t))return S(t).toDate().toISOString();throw Error("Cannot cast object of type "+T.getType(t)+" to type ISODate");case"ASPDate":if(t instanceof Date)return"/Date("+t.valueOf()+")/";if(T.isNumber(t)||T.isString(t))return"/Date("+S(t).valueOf()+")/";throw Error("Cannot cast object of type "+T.getType(t)+" to type ASPDate");default:throw Error("Cannot cast object of type "+T.getType(t)+' to type "'+e+'"')}};var E=/^\/?Date\((\-?\d+)/i;if(T.getType=function(t){var e=typeof t;return"object"==e?null==t?"null":t instanceof Boolean?"Boolean":t instanceof Number?"Number":t instanceof String?"String":t instanceof Array?"Array":t instanceof Date?"Date":"Object":"number"==e?"Number":"boolean"==e?"Boolean":"string"==e?"String":e},T.getAbsoluteLeft=function(t){for(var e=document.documentElement,i=document.body,n=t.offsetLeft,s=t.offsetParent;null!=s&&s!=i&&s!=e;)n+=s.offsetLeft,n-=s.scrollLeft,s=s.offsetParent;return n},T.getAbsoluteTop=function(t){for(var e=document.documentElement,i=document.body,n=t.offsetTop,s=t.offsetParent;null!=s&&s!=i&&s!=e;)n+=s.offsetTop,n-=s.scrollTop,s=s.offsetParent;return n},T.getPageY=function(t){if("pageY"in t)return t.pageY;var e;e="targetTouches"in t&&t.targetTouches.length?t.targetTouches[0].clientY:t.clientY;var i=document.documentElement,n=document.body;return e+(i&&i.scrollTop||n&&n.scrollTop||0)-(i&&i.clientTop||n&&n.clientTop||0)},T.getPageX=function(t){if("pageY"in t)return t.pageX;var e;e="targetTouches"in t&&t.targetTouches.length?t.targetTouches[0].clientX:t.clientX;var i=document.documentElement,n=document.body;return e+(i&&i.scrollLeft||n&&n.scrollLeft||0)-(i&&i.clientLeft||n&&n.clientLeft||0)},T.addClassName=function(t,e){var i=t.className.split(" ");-1==i.indexOf(e)&&(i.push(e),t.className=i.join(" "))},T.removeClassName=function(t,e){var i=t.className.split(" "),n=i.indexOf(e);-1!=n&&(i.splice(n,1),t.className=i.join(" "))},T.forEach=function(t,e){var i,n;if(t instanceof Array)for(i=0,n=t.length;n>i;i++)e(t[i],i,t);else for(i in t)t.hasOwnProperty(i)&&e(t[i],i,t)},T.updateProperty=function(t,e,i){return t[e]!==i?(t[e]=i,!0):!1},T.addEventListener=function(t,e,i,n){t.addEventListener?(void 0===n&&(n=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.addEventListener(e,i,n)):t.attachEvent("on"+e,i)},T.removeEventListener=function(t,e,i,n){t.removeEventListener?(void 0===n&&(n=!1),"mousewheel"===e&&navigator.userAgent.indexOf("Firefox")>=0&&(e="DOMMouseScroll"),t.removeEventListener(e,i,n)):t.detachEvent("on"+e,i)},T.getTarget=function(t){t||(t=window.event);var e;return t.target?e=t.target:t.srcElement&&(e=t.srcElement),void 0!=e.nodeType&&3==e.nodeType&&(e=e.parentNode),e},T.stopPropagation=function(t){t||(t=window.event),t.stopPropagation?t.stopPropagation():t.cancelBubble=!0},T.preventDefault=function(t){t||(t=window.event),t.preventDefault?t.preventDefault():t.returnValue=!1},T.option={},T.option.asBoolean=function(t,e){return"function"==typeof t&&(t=t()),null!=t?0!=t:e||null},T.option.asNumber=function(t,e){return"function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null},T.option.asString=function(t,e){return"function"==typeof t&&(t=t()),null!=t?t+"":e||null},T.option.asSize=function(t,e){return"function"==typeof t&&(t=t()),T.isString(t)?t:T.isNumber(t)?t+"px":e||null},T.option.asElement=function(t,e){return"function"==typeof t&&(t=t()),t||e||null},T.loadCss=function(t){if("undefined"!=typeof document){var e=document.createElement("style");e.type="text/css",e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(e)}},!Array.prototype.indexOf){Array.prototype.indexOf=function(t){for(var e=0;this.length>e;e++)if(this[e]==t)return e;return-1};try{console.log("Warning: Ancient browser detected. Please update your browser")}catch(M){}}Array.prototype.forEach||(Array.prototype.forEach=function(t,e){for(var i=0,n=this.length;n>i;++i)t.call(e||this,this[i],i,this)}),Array.prototype.map||(Array.prototype.map=function(t,e){var i,n,s;if(null==this)throw new TypeError(" this is null or not defined");var o=Object(this),r=o.length>>>0;if("function"!=typeof t)throw new TypeError(t+" is not a function");for(e&&(i=e),n=Array(r),s=0;r>s;){var a,h;s in o&&(a=o[s],h=t.call(i,a,s,o),n[s]=h),s++}return n}),Array.prototype.filter||(Array.prototype.filter=function(t){"use strict";if(null==this)throw new TypeError;var e=Object(this),i=e.length>>>0;if("function"!=typeof t)throw new TypeError;for(var n=[],s=arguments[1],o=0;i>o;o++)if(o in e){var r=e[o];t.call(s,r,o,e)&&n.push(r)}return n}),Object.keys||(Object.keys=function(){var t=Object.prototype.hasOwnProperty,e=!{toString:null}.propertyIsEnumerable("toString"),i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],n=i.length;return function(s){if("object"!=typeof s&&"function"!=typeof s||null===s)throw new TypeError("Object.keys called on non-object");var o=[];for(var r in s)t.call(s,r)&&o.push(r);if(e)for(var a=0;n>a;a++)t.call(s,i[a])&&o.push(i[a]);return o}}()),Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),Function.prototype.bind||(Function.prototype.bind=function(t){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var e=Array.prototype.slice.call(arguments,1),i=this,n=function(){},s=function(){return i.apply(this instanceof n&&t?this:t,e.concat(Array.prototype.slice.call(arguments)))};return n.prototype=this.prototype,s.prototype=new n,s});var _={listeners:[],indexOf:function(t){for(var e=this.listeners,i=0,n=this.listeners.length;n>i;i++){var s=e[i];if(s&&s.object==t)return i}return-1},addListener:function(t,e,i){var n=this.indexOf(t),s=this.listeners[n];s||(s={object:t,events:{}},this.listeners.push(s));var o=s.events[e];o||(o=[],s.events[e]=o),-1==o.indexOf(i)&&o.push(i)},removeListener:function(t,e,i){var n=this.indexOf(t),s=this.listeners[n];if(s){var o=s.events[e];o&&(n=o.indexOf(i),-1!=n&&o.splice(n,1),0==o.length&&delete s.events[e]);var r=0,a=s.events;for(var h in a)a.hasOwnProperty(h)&&r++;0==r&&delete this.listeners[n]}},removeAllListeners:function(){this.listeners=[]},trigger:function(t,e,i){var n=this.indexOf(t),s=this.listeners[n];if(s){var o=s.events[e];if(o)for(var r=0,a=o.length;a>r;r++)o[r](i)}}};TimeStep=function(t,e,i){this.current=new Date,this._start=new Date,this._end=new Date,this.autoScale=!0,this.scale=TimeStep.SCALE.DAY,this.step=1,this.setRange(t,e,i)},TimeStep.SCALE={MILLISECOND:1,SECOND:2,MINUTE:3,HOUR:4,DAY:5,WEEKDAY:6,MONTH:7,YEAR:8},TimeStep.prototype.setRange=function(t,e,i){t instanceof Date&&e instanceof Date&&(this._start=void 0!=t?new Date(t.valueOf()):new Date,this._end=void 0!=e?new Date(e.valueOf()):new Date,this.autoScale&&this.setMinimumStep(i))},TimeStep.prototype.first=function(){this.current=new Date(this._start.valueOf()),this.roundToMinor()},TimeStep.prototype.roundToMinor=function(){switch(this.scale){case TimeStep.SCALE.YEAR:this.current.setFullYear(this.step*Math.floor(this.current.getFullYear()/this.step)),this.current.setMonth(0);case TimeStep.SCALE.MONTH:this.current.setDate(1);case TimeStep.SCALE.DAY:case TimeStep.SCALE.WEEKDAY:this.current.setHours(0);case TimeStep.SCALE.HOUR:this.current.setMinutes(0);case TimeStep.SCALE.MINUTE:this.current.setSeconds(0);case TimeStep.SCALE.SECOND:this.current.setMilliseconds(0)}if(1!=this.step)switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current.setMilliseconds(this.current.getMilliseconds()-this.current.getMilliseconds()%this.step);break;case TimeStep.SCALE.SECOND:this.current.setSeconds(this.current.getSeconds()-this.current.getSeconds()%this.step);break;case TimeStep.SCALE.MINUTE:this.current.setMinutes(this.current.getMinutes()-this.current.getMinutes()%this.step);break;case TimeStep.SCALE.HOUR:this.current.setHours(this.current.getHours()-this.current.getHours()%this.step);break;case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:this.current.setDate(this.current.getDate()-1-(this.current.getDate()-1)%this.step+1);break;case TimeStep.SCALE.MONTH:this.current.setMonth(this.current.getMonth()-this.current.getMonth()%this.step);break;case TimeStep.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()-this.current.getFullYear()%this.step);break;default:}},TimeStep.prototype.hasNext=function(){return this.current.valueOf()<=this._end.valueOf()},TimeStep.prototype.next=function(){var t=this.current.valueOf();if(6>this.current.getMonth())switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current=new Date(this.current.valueOf()+this.step);break;case TimeStep.SCALE.SECOND:this.current=new Date(this.current.valueOf()+1e3*this.step);break;case TimeStep.SCALE.MINUTE:this.current=new Date(this.current.valueOf()+60*1e3*this.step);break;case TimeStep.SCALE.HOUR:this.current=new Date(this.current.valueOf()+60*60*1e3*this.step);var e=this.current.getHours();this.current.setHours(e-e%this.step);break;case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:this.current.setDate(this.current.getDate()+this.step);break;case TimeStep.SCALE.MONTH:this.current.setMonth(this.current.getMonth()+this.step);break;case TimeStep.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()+this.step);break;default:}else switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current=new Date(this.current.valueOf()+this.step);break;case TimeStep.SCALE.SECOND:this.current.setSeconds(this.current.getSeconds()+this.step);break;case TimeStep.SCALE.MINUTE:this.current.setMinutes(this.current.getMinutes()+this.step);break;case TimeStep.SCALE.HOUR:this.current.setHours(this.current.getHours()+this.step);break;case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:this.current.setDate(this.current.getDate()+this.step);break;case TimeStep.SCALE.MONTH:this.current.setMonth(this.current.getMonth()+this.step);break;case TimeStep.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()+this.step);break;default:}if(1!=this.step)switch(this.scale){case TimeStep.SCALE.MILLISECOND:this.current.getMilliseconds()0&&(this.step=e),this.autoScale=!1},TimeStep.prototype.setAutoScale=function(t){this.autoScale=t},TimeStep.prototype.setMinimumStep=function(t){if(void 0!=t){var e=31104e6,i=2592e6,n=864e5,s=36e5,o=6e4,r=1e3,a=1;1e3*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=1e3),500*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=500),100*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=100),50*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=50),10*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=10),5*e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=5),e>t&&(this.scale=TimeStep.SCALE.YEAR,this.step=1),3*i>t&&(this.scale=TimeStep.SCALE.MONTH,this.step=3),i>t&&(this.scale=TimeStep.SCALE.MONTH,this.step=1),5*n>t&&(this.scale=TimeStep.SCALE.DAY,this.step=5),2*n>t&&(this.scale=TimeStep.SCALE.DAY,this.step=2),n>t&&(this.scale=TimeStep.SCALE.DAY,this.step=1),n/2>t&&(this.scale=TimeStep.SCALE.WEEKDAY,this.step=1),4*s>t&&(this.scale=TimeStep.SCALE.HOUR,this.step=4),s>t&&(this.scale=TimeStep.SCALE.HOUR,this.step=1),15*o>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=15),10*o>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=10),5*o>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=5),o>t&&(this.scale=TimeStep.SCALE.MINUTE,this.step=1),15*r>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=15),10*r>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=10),5*r>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=5),r>t&&(this.scale=TimeStep.SCALE.SECOND,this.step=1),200*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=200),100*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=100),50*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=50),10*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=10),5*a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=5),a>t&&(this.scale=TimeStep.SCALE.MILLISECOND,this.step=1)}},TimeStep.prototype.snap=function(t){if(this.scale==TimeStep.SCALE.YEAR){var e=t.getFullYear()+Math.round(t.getMonth()/12);t.setFullYear(Math.round(e/this.step)*this.step),t.setMonth(0),t.setDate(0),t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.MONTH)t.getDate()>15?(t.setDate(1),t.setMonth(t.getMonth()+1)):t.setDate(1),t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0);else if(this.scale==TimeStep.SCALE.DAY||this.scale==TimeStep.SCALE.WEEKDAY){switch(this.step){case 5:case 2:t.setHours(24*Math.round(t.getHours()/24));break;default:t.setHours(12*Math.round(t.getHours()/12))}t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.HOUR){switch(this.step){case 4:t.setMinutes(60*Math.round(t.getMinutes()/60));break;default:t.setMinutes(30*Math.round(t.getMinutes()/30))}t.setSeconds(0),t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.MINUTE){switch(this.step){case 15:case 10:t.setMinutes(5*Math.round(t.getMinutes()/5)),t.setSeconds(0);break;case 5:t.setSeconds(60*Math.round(t.getSeconds()/60));break;default:t.setSeconds(30*Math.round(t.getSeconds()/30))}t.setMilliseconds(0)}else if(this.scale==TimeStep.SCALE.SECOND)switch(this.step){case 15:case 10:t.setSeconds(5*Math.round(t.getSeconds()/5)),t.setMilliseconds(0);break;case 5:t.setMilliseconds(1e3*Math.round(t.getMilliseconds()/1e3));break;default:t.setMilliseconds(500*Math.round(t.getMilliseconds()/500))}else if(this.scale==TimeStep.SCALE.MILLISECOND){var i=this.step>5?this.step/2:1;t.setMilliseconds(Math.round(t.getMilliseconds()/i)*i)}},TimeStep.prototype.isMajor=function(){switch(this.scale){case TimeStep.SCALE.MILLISECOND:return 0==this.current.getMilliseconds();case TimeStep.SCALE.SECOND:return 0==this.current.getSeconds();case TimeStep.SCALE.MINUTE:return 0==this.current.getHours()&&0==this.current.getMinutes();case TimeStep.SCALE.HOUR:return 0==this.current.getHours();case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:return 1==this.current.getDate();case TimeStep.SCALE.MONTH:return 0==this.current.getMonth();case TimeStep.SCALE.YEAR:return!1;default:return!1}},TimeStep.prototype.getLabelMinor=function(t){switch(void 0==t&&(t=this.current),this.scale){case TimeStep.SCALE.MILLISECOND:return S(t).format("SSS");case TimeStep.SCALE.SECOND:return S(t).format("s");case TimeStep.SCALE.MINUTE:return S(t).format("HH:mm");case TimeStep.SCALE.HOUR:return S(t).format("HH:mm");case TimeStep.SCALE.WEEKDAY:return S(t).format("ddd D");case TimeStep.SCALE.DAY:return S(t).format("D");case TimeStep.SCALE.MONTH:return S(t).format("MMM");case TimeStep.SCALE.YEAR:return S(t).format("YYYY");default:return""}},TimeStep.prototype.getLabelMajor=function(t){switch(void 0==t&&(t=this.current),this.scale){case TimeStep.SCALE.MILLISECOND:return S(t).format("HH:mm:ss");case TimeStep.SCALE.SECOND:return S(t).format("D MMMM HH:mm");case TimeStep.SCALE.MINUTE:case TimeStep.SCALE.HOUR:return S(t).format("ddd D MMMM");case TimeStep.SCALE.WEEKDAY:case TimeStep.SCALE.DAY:return S(t).format("MMMM YYYY");case TimeStep.SCALE.MONTH:return S(t).format("YYYY");case TimeStep.SCALE.YEAR:return"";default:return""}},s.prototype.subscribe=function(t,e,i){var n=this.subscribers[t];n||(n=[],this.subscribers[t]=n),n.push({id:i?i+"":null,callback:e})},s.prototype.unsubscribe=function(t,e){var i=this.subscribers[t];i&&(this.subscribers[t]=i.filter(function(t){return t.callback!=e}))},s.prototype._trigger=function(t,e,i){if("*"==t)throw Error("Cannot trigger event *");var n=[];t in this.subscribers&&(n=n.concat(this.subscribers[t])),"*"in this.subscribers&&(n=n.concat(this.subscribers["*"]));for(var s=0;n.length>s;s++){var o=n[s];o.callback&&o.callback(t,e,i||null)}},s.prototype.add=function(t,e){var i,n=[],s=this;if(t instanceof Array)for(var o=0,r=t.length;r>o;o++)i=s._addItem(t[o]),n.push(i);else if(T.isDataTable(t))for(var a=this._getColumnNames(t),h=0,p=t.getNumberOfRows();p>h;h++){for(var u={},c=0,d=a.length;d>c;c++){var l=a[c];u[l]=t.getValue(h,c)}i=s._addItem(u),n.push(i)}else{if(!(t instanceof Object))throw Error("Unknown dataType");i=s._addItem(t),n.push(i)}n.length&&this._trigger("add",{items:n},e)},s.prototype.update=function(t,e){var i=[],n=[],s=this,o=s.fieldId,r=function(t){var e=t[o];s.data[e]?(e=s._updateItem(t),n.push(e)):(e=s._addItem(t),i.push(e))};if(t instanceof Array)for(var a=0,h=t.length;h>a;a++)r(t[a]);else if(T.isDataTable(t))for(var p=this._getColumnNames(t),u=0,c=t.getNumberOfRows();c>u;u++){for(var d={},l=0,f=p.length;f>l;l++){var m=p[l];d[m]=t.getValue(u,l)}r(d)}else{if(!(t instanceof Object))throw Error("Unknown dataType");r(t)}i.length&&this._trigger("add",{items:i},e),n.length&&this._trigger("update",{items:n},e)},s.prototype.get=function(){var t,e,i,n,s=this,o=T.getType(arguments[0]);"String"==o||"Number"==o?(t=arguments[0],i=arguments[1],n=arguments[2]):"Array"==o?(e=arguments[0],i=arguments[1],n=arguments[2]):(i=arguments[0],n=arguments[1]);var r;if(i&&i.type){if(r="DataTable"==i.type?"DataTable":"Array",n&&r!=T.getType(n))throw Error('Type of parameter "data" ('+T.getType(n)+") "+"does not correspond with specified options.type ("+i.type+")");if("DataTable"==r&&!T.isDataTable(n))throw Error('Parameter "data" must be a DataTable when options.type is "DataTable"')}else r=n?"DataTable"==T.getType(n)?"DataTable":"Array":"Array";var a,h,p,u,c=this._composeItemOptions(i);if("DataTable"==r){var d=this._getColumnNames(n);if(void 0!=t)a=s._getItem(t,c),a&&this._appendRow(n,d,a);else if(void 0!=e)for(p=0,u=e.length;u>p;p++)a=s._getItem(e[p],c),a&&s._appendRow(n,d,a);else for(h in this.data)this.data.hasOwnProperty(h)&&(a=s._getItem(h,c),a&&s._appendRow(n,d,a))}else{if(n||(n=[]),void 0!=t)return s._getItem(t,c);if(void 0!=e)for(p=0,u=e.length;u>p;p++)a=s._getItem(e[p],c),a&&n.push(a);else for(h in this.data)this.data.hasOwnProperty(h)&&(a=s._getItem(h,c),a&&n.push(a))}return n},s.prototype.getIds=function(t){var e,i,n=this.data,s=[];if(t&&t.filter){var o=this._composeItemOptions({filter:t&&t.filter});for(e in n)n.hasOwnProperty(e)&&(i=this._getItem(e,o),i&&s.push(i[this.fieldId]))}else for(e in n)n.hasOwnProperty(e)&&(i=n[e],s.push(i[this.fieldId]));return s},s.prototype.forEach=function(t,e){var i,n=this._composeItemOptions(e),s=this.data;for(var o in s)s.hasOwnProperty(o)&&(i=this._getItem(o,n),i&&t(i,o))},s.prototype.map=function(t,e){var i,n=this._composeItemOptions(e),s=[],o=this.data;for(var r in o)o.hasOwnProperty(r)&&(i=this._getItem(r,n),i&&s.push(t(i,r)));return s},s.prototype._composeItemOptions=function(t){var e={};return t&&(e.fieldTypes={},this.options&&this.options.fieldTypes&&T.extend(e.fieldTypes,this.options.fieldTypes),t.fieldTypes&&T.extend(e.fieldTypes,t.fieldTypes),t.fields&&(e.fields=t.fields),t.filter&&(e.filter=t.filter)),e},s.prototype.remove=function(t,e){var i,n,s=[];if(T.isNumber(t)||T.isString(t))delete this.data[t],delete this.internalIds[t],s.push(t);else if(t instanceof Array){for(i=0,n=t.length;n>i;i++)this.remove(t[i]);s=items.concat(t)}else if(t instanceof Object)for(i in this.data)this.data.hasOwnProperty(i)&&this.data[i]==t&&(delete this.data[i],delete this.internalIds[i],s.push(i));s.length&&this._trigger("remove",{items:s},e)},s.prototype.clear=function(t){var e=Object.keys(this.data);this.data={},this.internalIds={},this._trigger("remove",{items:e},t)},s.prototype.max=function(t){var e=this.data,i=null,n=null;for(var s in e)if(e.hasOwnProperty(s)){var o=e[s],r=o[t];null!=r&&(!i||r>n)&&(i=o,n=r)}return i},s.prototype.min=function(t){var e=this.data,i=null,n=null;for(var s in e)if(e.hasOwnProperty(s)){var o=e[s],r=o[t];null!=r&&(!i||n>r)&&(i=o,n=r)}return i},s.prototype.distinct=function(t){var e=this.data,i=[],n=this.options.fieldTypes[t],s=0;for(var o in e)if(e.hasOwnProperty(o)){for(var r=e[o],a=T.cast(r[t],n),h=!1,p=0;s>p;p++)if(i[p]==a){h=!0;break}h||(i[s]=a,s++)}return i},s.prototype._addItem=function(t){var e=t[this.fieldId];if(void 0!=e){if(this.data[e])throw Error("Cannot add item: item with id "+e+" already exists")}else e=T.randomUUID(),t[this.fieldId]=e,this.internalIds[e]=t;var i={};for(var n in t)if(t.hasOwnProperty(n)){var s=this.fieldTypes[n];i[n]=T.cast(t[n],s)}return this.data[e]=i,e},s.prototype._getItem=function(t,e){var i,n,s=this.data[t];if(!s)return null;var o={},r=this.fieldId,a=this.internalIds;if(e.fieldTypes){var h=e.fieldTypes;for(i in s)s.hasOwnProperty(i)&&(n=s[i],i==r&&n in a||(o[i]=T.cast(n,h[i])))}else for(i in s)s.hasOwnProperty(i)&&(n=s[i],i==r&&n in a||(o[i]=n));if(e.filter&&!e.filter(o))return null;if(e.fields){var p={},u=e.fields;for(i in o)o.hasOwnProperty(i)&&-1!=u.indexOf(i)&&(p[i]=o[i]);return p}return o},s.prototype._updateItem=function(t){var e=t[this.fieldId];if(void 0==e)throw Error("Cannot update item: item has no id (item: "+JSON.stringify(t)+")");var i=this.data[e];if(!i)throw Error("Cannot update item: no item with id "+e+" found");for(var n in t)if(t.hasOwnProperty(n)){var s=this.fieldTypes[n];i[n]=T.cast(t[n],s)}return e},s.prototype._getColumnNames=function(t){for(var e=[],i=0,n=t.getNumberOfColumns();n>i;i++)e[i]=t.getColumnId(i)||t.getColumnLabel(i);return e},s.prototype._appendRow=function(t,e,i){for(var n=t.addRow(),s=0,o=e.length;o>s;s++){var r=e[s];t.setValue(n,s,i[r])}},o.prototype.setData=function(t){var e,i,n;if(this.data){this.data.unsubscribe&&this.data.unsubscribe("*",this.listener),e=[];for(var s in this.ids)this.ids.hasOwnProperty(s)&&e.push(s);this.ids={},this._trigger("remove",{items:e})}if(this.data=t,this.data){for(this.fieldId=this.options.fieldId||this.data&&this.data.options&&this.data.options.fieldId||"id",e=this.data.getIds({filter:this.options&&this.options.filter}),i=0,n=e.length;n>i;i++)s=e[i],this.ids[s]=!0;this._trigger("add",{items:e}),this.data.subscribe&&this.data.subscribe("*",this.listener)}},o.prototype.get=function(){var t,e,i,n=this,s=T.getType(arguments[0]);"String"==s||"Number"==s||"Array"==s?(t=arguments[0],e=arguments[1],i=arguments[2]):(e=arguments[0],i=arguments[1]);var o=T.extend({},this.options,e);this.options.filter&&e&&e.filter&&(o.filter=function(t){return n.options.filter(t)&&e.filter(t)});var r=[];return void 0!=t&&r.push(t),r.push(o),r.push(i),this.data&&this.data.get.apply(this.data,r)},o.prototype.getIds=function(t){var e;if(this.data){var i,n=this.options.filter;i=t&&t.filter?n?function(e){return n(e)&&t.filter(e)}:t.filter:n,e=this.data.getIds({filter:i})}else e=[];return e},o.prototype._onEvent=function(t,e,i){var n,s,o,r,a=e&&e.items,h=this.data,p=[],u=[],c=[];if(a&&h){switch(t){case"add":for(n=0,s=a.length;s>n;n++)o=a[n],r=this.get(o),r&&(this.ids[o]=!0,p.push(o));break;case"update":for(n=0,s=a.length;s>n;n++)o=a[n],r=this.get(o),r?this.ids[o]?u.push(o):(this.ids[o]=!0,p.push(o)):this.ids[o]&&(delete this.ids[o],c.push(o));break;case"remove":for(n=0,s=a.length;s>n;n++)o=a[n],this.ids[o]&&(delete this.ids[o],c.push(o))}p.length&&this._trigger("add",{items:p},i),u.length&&this._trigger("update",{items:u},i),c.length&&this._trigger("remove",{items:c},i)}},o.prototype.subscribe=s.prototype.subscribe,o.prototype.unsubscribe=s.prototype.unsubscribe,o.prototype._trigger=s.prototype._trigger,r.prototype.setOptions=function(t){T.extend(this.options,t)},r.prototype.update=function(){this._order(),this._stack()},r.prototype._order=function(){var t=this.parent.contents;if(!t)throw Error("Cannot stack items: parent does not contain items");var e=[],i=0;T.forEach(t,function(t){t.visible&&(e[i]=t,i++)});var n=this.options.order;if("function"!=typeof this.options.order)throw Error("Option order must be a function");e.sort(n),this.ordered=e},r.prototype._stack=function(){var t,e,i=this.ordered,n=this.options,s="top"==n.orientation,o=n.margin&&n.margin.item||0;for(t=0,e=i.length;e>t;t++){var r=i[t],a=null;do a=this.checkOverlap(i,t,0,t-1,o),null!=a&&(r.top=s?a.top+a.height+o:a.top-r.height-o);while(a)}},r.prototype.checkOverlap=function(t,e,i,n,s){for(var o=this.collision,r=t[e],a=n;a>=i;a--){var h=t[a];if(o(r,h,s)&&a!=e)return h}return null},r.prototype.collision=function(t,e,i){return t.left-ie.left&&t.top-ie.top},a.prototype.setOptions=function(t){T.extend(this.options,t),(null!=t.start||null!=t.end)&&this.setRange(t.start,t.end)},a.prototype.subscribe=function(t,e,i){var n,s=this;if("horizontal"!=i&&"vertical"!=i)throw new TypeError('Unknown direction "'+i+'". '+'Choose "horizontal" or "vertical".');if("move"==e)n={component:t,event:e,direction:i,callback:function(t){s._onMouseDown(t,n)},params:{}},t.on("mousedown",n.callback),s.listeners.push(n); +else{if("zoom"!=e)throw new TypeError('Unknown event "'+e+'". '+'Choose "move" or "zoom".');n={component:t,event:e,direction:i,callback:function(t){s._onMouseWheel(t,n)},params:{}},t.on("mousewheel",n.callback),s.listeners.push(n)}},a.prototype.on=function(t,e){_.addListener(this,t,e)},a.prototype._trigger=function(t){_.trigger(this,t,{start:this.start,end:this.end})},a.prototype.setRange=function(t,e){var i=this._applyRange(t,e);i&&(this._trigger("rangechange"),this._trigger("rangechanged"))},a.prototype._applyRange=function(t,e){var i,n=null!=t?T.cast(t,"Number"):this.start,s=null!=e?T.cast(e,"Number"):this.end;if(isNaN(n))throw Error('Invalid start "'+t+'"');if(isNaN(s))throw Error('Invalid end "'+e+'"');if(n>s&&(s=n),null!=this.options.min){var o=this.options.min.valueOf();o>n&&(i=o-n,n+=i,s+=i)}if(null!=this.options.max){var r=this.options.max.valueOf();s>r&&(i=s-r,n-=i,s-=i)}if(null!=this.options.zoomMin){var a=this.options.zoomMin.valueOf();0>a&&(a=0),a>s-n&&(this.end-this.start>a?(i=a-(s-n),n-=i/2,s+=i/2):(n=this.start,s=this.end))}if(null!=this.options.zoomMax){var h=this.options.zoomMax.valueOf();0>h&&(h=0),s-n>h&&(h>this.end-this.start?(i=s-n-h,n+=i/2,s-=i/2):(n=this.start,s=this.end))}var p=this.start!=n||this.end!=s;return this.start=n,this.end=s,p},a.prototype.getRange=function(){return{start:this.start,end:this.end}},a.prototype.conversion=function(t){return this.start,this.end,a.conversion(this.start,this.end,t)},a.conversion=function(t,e,i){return 0!=i&&0!=e-t?{offset:t,factor:i/(e-t)}:{offset:0,factor:1}},a.prototype._onMouseDown=function(t,e){t=t||window.event;var i=e.params,n=t.which?1==t.which:1==t.button;if(n){i.mouseX=T.getPageX(t),i.mouseY=T.getPageY(t),i.previousLeft=0,i.previousOffset=0,i.moved=!1,i.start=this.start,i.end=this.end;var s=e.component.frame;s&&(s.style.cursor="move");var o=this;i.onMouseMove||(i.onMouseMove=function(t){o._onMouseMove(t,e)},T.addEventListener(document,"mousemove",i.onMouseMove)),i.onMouseUp||(i.onMouseUp=function(t){o._onMouseUp(t,e)},T.addEventListener(document,"mouseup",i.onMouseUp)),T.preventDefault(t)}},a.prototype._onMouseMove=function(t,e){t=t||window.event;var i=e.params,n=T.getPageX(t),s=T.getPageY(t);void 0==i.mouseX&&(i.mouseX=n),void 0==i.mouseY&&(i.mouseY=s);var o=n-i.mouseX,r=s-i.mouseY,a="horizontal"==e.direction?o:r;Math.abs(a)>=1&&(i.moved=!0);var h=i.end-i.start,p="horizontal"==e.direction?e.component.width:e.component.height,u=-a/p*h;this._applyRange(i.start+u,i.end+u),this._trigger("rangechange"),T.preventDefault(t)},a.prototype._onMouseUp=function(t,e){t=t||window.event;var i=e.params;e.component.frame&&(e.component.frame.style.cursor="auto"),i.onMouseMove&&(T.removeEventListener(document,"mousemove",i.onMouseMove),i.onMouseMove=null),i.onMouseUp&&(T.removeEventListener(document,"mouseup",i.onMouseUp),i.onMouseUp=null),i.moved&&this._trigger("rangechanged")},a.prototype._onMouseWheel=function(t,e){t=t||window.event;var i=0;if(t.wheelDelta?i=t.wheelDelta/120:t.detail&&(i=-t.detail/3),i){var n=this,s=function(){var s=i/5,o=null,r=e.component.frame;if(r){var a,h;if("horizontal"==e.direction){a=e.component.width,h=n.conversion(a);var p=T.getAbsoluteLeft(r),u=T.getPageX(t);o=(u-p)/h.factor+h.offset}else{a=e.component.height,h=n.conversion(a);var c=T.getAbsoluteTop(r),d=T.getPageY(t);o=(c+a-d-c)/h.factor+h.offset}}n.zoom(s,o)};s()}T.preventDefault(t)},a.prototype.zoom=function(t,e){null==e&&(e=(this.start+this.end)/2),t>=1&&(t=.9),-1>=t&&(t=-.9),0>t&&(t/=1+t);var i=this.start-e,n=this.end-e,s=this.start-i*t,o=this.end-n*t;this.setRange(s,o)},a.prototype.move=function(t){var e=this.end-this.start,i=this.start+e*t,n=this.end+e*t;this.start=i,this.end=n},h.prototype.on=function(t,e,i){var n=t instanceof RegExp?t:RegExp(t.replace("*","\\w+")),s={id:T.randomUUID(),event:t,regexp:n,callback:"function"==typeof e?e:null,target:i};return this.subscriptions.push(s),s.id},h.prototype.off=function(t){for(var e=0;this.subscriptions.length>e;){var i=this.subscriptions[e],n=!0;if(t instanceof Object)for(var s in t)t.hasOwnProperty(s)&&t[s]!==i[s]&&(n=!1);else n=i.id==t;n?this.subscriptions.splice(e,1):e++}},h.prototype.emit=function(t,e,i){for(var n=0;this.subscriptions.length>n;n++){var s=this.subscriptions[n];s.regexp.test(t)&&s.callback&&s.callback(t,e,i)}},p.prototype.add=function(t){if(void 0==t.id)throw Error("Component has no field id");if(!(t instanceof u||t instanceof p))throw new TypeError("Component must be an instance of prototype Component or Controller");t.controller=this,this.components[t.id]=t},p.prototype.remove=function(t){var e;for(e in this.components)if(this.components.hasOwnProperty(e)&&(e==t||this.components[e]==t))break;e&&delete this.components[e]},p.prototype.requestReflow=function(t){if(t)this.reflow();else if(!this.reflowTimer){var e=this;this.reflowTimer=setTimeout(function(){e.reflowTimer=void 0,e.reflow()},0)}},p.prototype.requestRepaint=function(t){if(t)this.repaint();else if(!this.repaintTimer){var e=this;this.repaintTimer=setTimeout(function(){e.repaintTimer=void 0,e.repaint()},0)}},p.prototype.repaint=function(){function t(n,s){s in i||(n.depends&&n.depends.forEach(function(e){t(e,e.id)}),n.parent&&t(n.parent,n.parent.id),e=n.repaint()||e,i[s]=!0)}var e=!1;this.repaintTimer&&(clearTimeout(this.repaintTimer),this.repaintTimer=void 0);var i={};T.forEach(this.components,t),e&&this.reflow()},p.prototype.reflow=function(){function t(n,s){s in i||(n.depends&&n.depends.forEach(function(e){t(e,e.id)}),n.parent&&t(n.parent,n.parent.id),e=n.reflow()||e,i[s]=!0)}var e=!1;this.reflowTimer&&(clearTimeout(this.reflowTimer),this.reflowTimer=void 0);var i={};T.forEach(this.components,t),e&&this.repaint()},u.prototype.setOptions=function(t){t&&(T.extend(this.options,t),this.controller&&(this.requestRepaint(),this.requestReflow()))},u.prototype.getContainer=function(){return null},u.prototype.getFrame=function(){return this.frame},u.prototype.repaint=function(){return!1},u.prototype.reflow=function(){return!1},u.prototype.hide=function(){return this.frame&&this.frame.parentNode?(this.frame.parentNode.removeChild(this.frame),!0):!1},u.prototype.show=function(){return this.frame&&this.frame.parentNode?!1:this.repaint()},u.prototype.requestRepaint=function(){if(!this.controller)throw Error("Cannot request a repaint: no controller configured");this.controller.requestRepaint()},u.prototype.requestReflow=function(){if(!this.controller)throw Error("Cannot request a reflow: no controller configured");this.controller.requestReflow()},c.prototype=new u,c.prototype.getContainer=function(){return this.frame},c.prototype.repaint=function(){var t=0,e=T.updateProperty,i=T.option.asSize,n=this.options,s=this.frame;if(s||(s=document.createElement("div"),s.className="panel",n.className&&("function"==typeof n.className?T.addClassName(s,n.className()+""):T.addClassName(s,n.className+"")),this.frame=s,t+=1),!s.parentNode){if(!this.parent)throw Error("Cannot repaint panel: no parent attached");var o=this.parent.getContainer();if(!o)throw Error("Cannot repaint panel: parent has no container element");o.appendChild(s),t+=1}return t+=e(s.style,"top",i(n.top,"0px")),t+=e(s.style,"left",i(n.left,"0px")),t+=e(s.style,"width",i(n.width,"100%")),t+=e(s.style,"height",i(n.height,"100%")),t>0},c.prototype.reflow=function(){var t=0,e=T.updateProperty,i=this.frame;return i?(t+=e(this,"top",i.offsetTop),t+=e(this,"left",i.offsetLeft),t+=e(this,"width",i.offsetWidth),t+=e(this,"height",i.offsetHeight)):t+=1,t>0},d.prototype=new c,d.prototype.setOptions=function(t){T.extend(this.options,t),this.options.autoResize?this._watch():this._unwatch()},d.prototype.repaint=function(){var t=0,e=T.updateProperty,i=T.option.asSize,n=this.options,s=this.frame;if(s||(s=document.createElement("div"),s.className="graph panel",n.className&&T.addClassName(s,T.option.asString(n.className)),this.frame=s,t+=1),!s.parentNode){if(!this.container)throw Error("Cannot repaint root panel: no container attached");this.container.appendChild(s),t+=1}return t+=e(s.style,"top",i(n.top,"0px")),t+=e(s.style,"left",i(n.left,"0px")),t+=e(s.style,"width",i(n.width,"100%")),t+=e(s.style,"height",i(n.height,"100%")),this._updateEventEmitters(),t>0},d.prototype.reflow=function(){var t=0,e=T.updateProperty,i=this.frame;return i?(t+=e(this,"top",i.offsetTop),t+=e(this,"left",i.offsetLeft),t+=e(this,"width",i.offsetWidth),t+=e(this,"height",i.offsetHeight)):t+=1,t>0},d.prototype._watch=function(){var t=this;this._unwatch();var e=function(){return t.options.autoResize?(t.frame&&(t.frame.clientWidth!=t.width||t.frame.clientHeight!=t.height)&&t.requestReflow(),void 0):(t._unwatch(),void 0)};T.addEventListener(window,"resize",e),this.watchTimer=setInterval(e,1e3)},d.prototype._unwatch=function(){this.watchTimer&&(clearInterval(this.watchTimer),this.watchTimer=void 0)},d.prototype.on=function(t,e){var i=this.listeners[t];i||(i=[],this.listeners[t]=i),i.push(e),this._updateEventEmitters()},d.prototype._updateEventEmitters=function(){if(this.listeners){var t=this;T.forEach(this.listeners,function(e,i){if(t.emitters||(t.emitters={}),!(i in t.emitters)){var n=t.frame;if(n){var s=function(t){e.forEach(function(e){e(t)})};t.emitters[i]=s,T.addEventListener(n,i,s)}}})}},l.prototype=new u,l.prototype.setOptions=function(t){T.extend(this.options,t)},l.prototype.setRange=function(t){if(!(t instanceof a||t&&t.start&&t.end))throw new TypeError("Range must be an instance of Range, or an object containing start and end.");this.range=t},l.prototype.toTime=function(t){var e=this.conversion;return new Date(t/e.factor+e.offset)},l.prototype.toScreen=function(t){var e=this.conversion;return(t.valueOf()-e.offset)*e.factor},l.prototype.repaint=function(){var t=0,e=T.updateProperty,i=T.option.asSize,n=this.options,s=this.props,o=this.step,r=this.frame;if(r||(r=document.createElement("div"),this.frame=r,t+=1),r.className="axis "+n.orientation,!r.parentNode){if(!this.parent)throw Error("Cannot repaint time axis: no parent attached");var a=this.parent.getContainer();if(!a)throw Error("Cannot repaint time axis: parent has no container element");a.appendChild(r),t+=1}var h=r.parentNode;if(h){var p=r.nextSibling;h.removeChild(r);var u=n.orientation,c="bottom"==u&&this.props.parentHeight&&this.height?this.props.parentHeight-this.height+"px":"0px";if(t+=e(r.style,"top",i(n.top,c)),t+=e(r.style,"left",i(n.left,"0px")),t+=e(r.style,"width",i(n.width,"100%")),t+=e(r.style,"height",i(n.height,this.height+"px")),this._repaintMeasureChars(),this.step){this._repaintStart(),o.first();for(var d=void 0,l=0;o.hasNext()&&1e3>l;){l++;var f=o.getCurrent(),m=this.toScreen(f),g=o.isMajor();n.showMinorLabels&&this._repaintMinorText(m,o.getLabelMinor()),g&&n.showMajorLabels?(m>0&&(void 0==d&&(d=m),this._repaintMajorText(m,o.getLabelMajor())),this._repaintMajorLine(m)):this._repaintMinorLine(m),o.next()}if(n.showMajorLabels){var v=this.toTime(0),y=o.getLabelMajor(v),w=y.length*(s.majorCharWidth||10)+10;(void 0==d||d>w)&&this._repaintMajorText(0,y)}this._repaintEnd()}this._repaintLine(),p?h.insertBefore(r,p):h.appendChild(r)}return t>0},l.prototype._repaintStart=function(){var t=this.dom,e=t.redundant;e.majorLines=t.majorLines,e.majorTexts=t.majorTexts,e.minorLines=t.minorLines,e.minorTexts=t.minorTexts,t.majorLines=[],t.majorTexts=[],t.minorLines=[],t.minorTexts=[]},l.prototype._repaintEnd=function(){T.forEach(this.dom.redundant,function(t){for(;t.length;){var e=t.pop();e&&e.parentNode&&e.parentNode.removeChild(e)}})},l.prototype._repaintMinorText=function(t,e){var i=this.dom.redundant.minorTexts.shift();if(!i){var n=document.createTextNode("");i=document.createElement("div"),i.appendChild(n),i.className="text minor",this.frame.appendChild(i)}this.dom.minorTexts.push(i),i.childNodes[0].nodeValue=e,i.style.left=t+"px",i.style.top=this.props.minorLabelTop+"px"},l.prototype._repaintMajorText=function(t,e){var i=this.dom.redundant.majorTexts.shift();if(!i){var n=document.createTextNode(e);i=document.createElement("div"),i.className="text major",i.appendChild(n),this.frame.appendChild(i)}this.dom.majorTexts.push(i),i.childNodes[0].nodeValue=e,i.style.top=this.props.majorLabelTop+"px",i.style.left=t+"px"},l.prototype._repaintMinorLine=function(t){var e=this.dom.redundant.minorLines.shift();e||(e=document.createElement("div"),e.className="grid vertical minor",this.frame.appendChild(e)),this.dom.minorLines.push(e);var i=this.props;e.style.top=i.minorLineTop+"px",e.style.height=i.minorLineHeight+"px",e.style.left=t-i.minorLineWidth/2+"px"},l.prototype._repaintMajorLine=function(t){var e=this.dom.redundant.majorLines.shift();e||(e=document.createElement("DIV"),e.className="grid vertical major",this.frame.appendChild(e)),this.dom.majorLines.push(e);var i=this.props;e.style.top=i.majorLineTop+"px",e.style.left=t-i.majorLineWidth/2+"px",e.style.height=i.majorLineHeight+"px"},l.prototype._repaintLine=function(){var t=this.dom.line,e=this.frame,i=this.options;i.showMinorLabels||i.showMajorLabels?(t?(e.removeChild(t),e.appendChild(t)):(t=document.createElement("div"),t.className="grid horizontal major",e.appendChild(t),this.dom.line=t),t.style.top=this.props.lineTop+"px"):t&&axis.parentElement&&(e.removeChild(axis.line),delete this.dom.line)},l.prototype._repaintMeasureChars=function(){var t,e=this.dom;if(!e.measureCharMinor){t=document.createTextNode("0");var i=document.createElement("DIV");i.className="text minor measure",i.appendChild(t),this.frame.appendChild(i),e.measureCharMinor=i}if(!e.measureCharMajor){t=document.createTextNode("0");var n=document.createElement("DIV");n.className="text major measure",n.appendChild(t),this.frame.appendChild(n),e.measureCharMajor=n}},l.prototype.reflow=function(){var t=0,e=T.updateProperty,i=this.frame,n=this.range;if(!n)throw Error("Cannot repaint time axis: no range configured");if(i){t+=e(this,"top",i.offsetTop),t+=e(this,"left",i.offsetLeft);var s=this.props,o=this.options.showMinorLabels,r=this.options.showMajorLabels,a=this.dom.measureCharMinor,h=this.dom.measureCharMajor;a&&(s.minorCharHeight=a.clientHeight,s.minorCharWidth=a.clientWidth),h&&(s.majorCharHeight=h.clientHeight,s.majorCharWidth=h.clientWidth);var p=i.parentNode?i.parentNode.offsetHeight:0;switch(p!=s.parentHeight&&(s.parentHeight=p,t+=1),this.options.orientation){case"bottom":s.minorLabelHeight=o?s.minorCharHeight:0,s.majorLabelHeight=r?s.majorCharHeight:0,s.minorLabelTop=0,s.majorLabelTop=s.minorLabelTop+s.minorLabelHeight,s.minorLineTop=-this.top,s.minorLineHeight=Math.max(this.top+s.majorLabelHeight,0),s.minorLineWidth=1,s.majorLineTop=-this.top,s.majorLineHeight=Math.max(this.top+s.minorLabelHeight+s.majorLabelHeight,0),s.majorLineWidth=1,s.lineTop=0;break;case"top":s.minorLabelHeight=o?s.minorCharHeight:0,s.majorLabelHeight=r?s.majorCharHeight:0,s.majorLabelTop=0,s.minorLabelTop=s.majorLabelTop+s.majorLabelHeight,s.minorLineTop=s.minorLabelTop,s.minorLineHeight=Math.max(p-s.majorLabelHeight-this.top),s.minorLineWidth=1,s.majorLineTop=0,s.majorLineHeight=Math.max(p-this.top),s.majorLineWidth=1,s.lineTop=s.majorLabelHeight+s.minorLabelHeight;break;default:throw Error('Unkown orientation "'+this.options.orientation+'"')}var u=s.minorLabelHeight+s.majorLabelHeight;t+=e(this,"width",i.offsetWidth),t+=e(this,"height",u),this._updateConversion();var c=T.cast(n.start,"Date"),d=T.cast(n.end,"Date"),l=this.toTime(5*(s.minorCharWidth||10))-this.toTime(0);this.step=new TimeStep(c,d,l),t+=e(s.range,"start",c.valueOf()),t+=e(s.range,"end",d.valueOf()),t+=e(s.range,"minimumStep",l.valueOf())}return t>0},l.prototype._updateConversion=function(){var t=this.range;if(!t)throw Error("No range configured");this.conversion=t.conversion?t.conversion(this.width):a.conversion(t.start,t.end,this.width)},f.prototype=new c,f.types={box:g,range:y,point:v},f.prototype.setOptions=function(t){T.extend(this.options,t),this.stack.setOptions(this.options)},f.prototype.setRange=function(t){if(!(t instanceof a||t&&t.start&&t.end))throw new TypeError("Range must be an instance of Range, or an object containing start and end.");this.range=t},f.prototype.repaint=function(){var t=0,e=T.updateProperty,i=T.option.asSize,n=this.options,s=this.frame;if(!s){s=document.createElement("div"),s.className="itemset",n.className&&T.addClassName(s,T.option.asString(n.className));var o=document.createElement("div");o.className="background",s.appendChild(o),this.dom.background=o;var r=document.createElement("div");r.className="foreground",s.appendChild(r),this.dom.foreground=r;var a=document.createElement("div");a.className="itemset-axis",this.dom.axis=a,this.frame=s,t+=1}if(!this.parent)throw Error("Cannot repaint itemset: no parent attached");var h=this.parent.getContainer();if(!h)throw Error("Cannot repaint itemset: parent has no container element");s.parentNode||(h.appendChild(s),t+=1),this.dom.axis.parentNode||(h.appendChild(this.dom.axis),t+=1),t+=e(s.style,"left",i(n.left,"0px")),t+=e(s.style,"top",i(n.top,"0px")),t+=e(s.style,"width",i(n.width,"100%")),t+=e(s.style,"height",i(n.height,this.height+"px")),t+=e(this.dom.axis.style,"left",i(n.left,"0px")),t+=e(this.dom.axis.style,"width",i(n.width,"100%")),t+="bottom"==this.options.orientation?e(this.dom.axis.style,"top",this.height+this.top+"px"):e(this.dom.axis.style,"top",this.top+"px"),this._updateConversion();var p=this,u=this.queue,c=this.items,d=this.contents,l={fields:[c&&c.fieldId||"id","start","end","content","type"]};return Object.keys(u).forEach(function(e){var i=u[e],s=d[e];switch(i){case"add":case"update":var o=c&&c.get(e,l);if(o){var r=o.type||o.start&&o.end&&"range"||"box",a=f.types[r];if(s&&(a&&s instanceof a?(s.data=o,t++):(t+=s.hide(),s=null)),!s){if(!a)throw new TypeError('Unknown item type "'+r+'"');s=new a(p,o,n),t++}d[e]=s}delete u[e];break;case"remove":s&&(t+=s.hide()),delete d[e],delete u[e];break;default:console.log('Error: unknown action "'+i+'"')}}),T.forEach(this.contents,function(e){e.visible?(t+=e.show(),e.reposition()):t+=e.hide()}),t>0},f.prototype.getForeground=function(){return this.dom.foreground},f.prototype.getBackground=function(){return this.dom.background},f.prototype.getAxis=function(){return this.dom.axis},f.prototype.reflow=function(){var t=0,e=this.options,i=T.updateProperty,n=T.option.asNumber,s=this.frame;if(s){this._updateConversion(),T.forEach(this.contents,function(e){t+=e.reflow()}),this.stack.update();var o,r=n(e.maxHeight);if(null!=e.height)o=s.offsetHeight;else{var a=this.stack.ordered;if(a.length){var h=a[0].top,p=a[0].top+a[0].height;T.forEach(a,function(t){h=Math.min(h,t.top),p=Math.max(p,t.top+t.height)}),o=p-h+e.margin.axis+e.margin.item}else o=e.margin.axis+e.margin.item}null!=r&&(o=Math.min(o,r)),t+=i(this,"height",o),t+=i(this,"top",s.offsetTop),t+=i(this,"left",s.offsetLeft),t+=i(this,"width",s.offsetWidth)}else t+=1;return t>0},f.prototype.hide=function(){var t=!1;return this.frame&&this.frame.parentNode&&(this.frame.parentNode.removeChild(this.frame),t=!0),this.dom.axis&&this.dom.axis.parentNode&&(this.dom.axis.parentNode.removeChild(this.dom.axis),t=!0),t},f.prototype.setItems=function(t){var e,i,n,r=this,a=this.items;if(a&&(T.forEach(this.listeners,function(t,e){a.unsubscribe(e,t)}),i=this.items.fieldId,e=a.get({fields:[i]}),n=[],T.forEach(e,function(t,e){n[e]=t[i]}),this._onRemove(n)),t){if(!(t instanceof s||t instanceof o))throw new TypeError("Data must be an instance of DataSet");this.items=t}else this.items=null;if(this.items){var h=this.id;T.forEach(this.listeners,function(t,e){r.items.subscribe(e,t,h)}),i=this.items.fieldId,e=this.items.get({fields:[i]}),n=[],T.forEach(e,function(t,e){n[e]=t[i]}),this._onAdd(n)}},f.prototype.getItems=function(){return this.items},f.prototype._onUpdate=function(t){this._toQueue("update",t)},f.prototype._onAdd=function(t){this._toQueue("add",t)},f.prototype._onRemove=function(t){this._toQueue("remove",t)},f.prototype._toQueue=function(t,e){var i=this.queue;e.forEach(function(e){i[e]=t}),this.controller&&this.requestRepaint()},f.prototype._updateConversion=function(){var t=this.range;if(!t)throw Error("No range configured");this.conversion=t.conversion?t.conversion(this.width):a.conversion(t.start,t.end,this.width)},f.prototype.toTime=function(t){var e=this.conversion;return new Date(t/e.factor+e.offset)},f.prototype.toScreen=function(t){var e=this.conversion;return(t.valueOf()-e.offset)*e.factor},m.prototype.select=function(){this.selected=!0},m.prototype.unselect=function(){this.selected=!1},m.prototype.show=function(){return!1},m.prototype.hide=function(){return!1},m.prototype.repaint=function(){return!1},m.prototype.reflow=function(){return!1},g.prototype=new m(null,null),g.prototype.select=function(){this.selected=!0},g.prototype.unselect=function(){this.selected=!1},g.prototype.repaint=function(){var t=!1,e=this.dom;if(e||(this._create(),e=this.dom,t=!0),e){if(!this.options&&!this.parent)throw Error("Cannot repaint item: no parent attached");var i=this.parent.getForeground();if(!i)throw Error("Cannot repaint time axis: parent has no foreground container element");var n=this.parent.getBackground();if(!n)throw Error("Cannot repaint time axis: parent has no background container element");var s=this.parent.getAxis();if(!n)throw Error("Cannot repaint time axis: parent has no axis container element");if(e.box.parentNode||(i.appendChild(e.box),t=!0),e.line.parentNode||(n.appendChild(e.line),t=!0),e.dot.parentNode||(s.appendChild(e.dot),t=!0),this.data.content!=this.content){if(this.content=this.data.content,this.content instanceof Element)e.content.innerHTML="",e.content.appendChild(this.content);else{if(void 0==this.data.content)throw Error('Property "content" missing in item '+this.data.id);e.content.innerHTML=this.content}t=!0}var o=(this.data.className?" "+this.data.className:"")+(this.selected?" selected":"");this.className!=o&&(this.className=o,e.box.className="item box"+o,e.line.className="item line"+o,e.dot.className="item dot"+o,t=!0)}return t},g.prototype.show=function(){return this.dom&&this.dom.box.parentNode?!1:this.repaint()},g.prototype.hide=function(){var t=!1,e=this.dom;return e&&(e.box.parentNode&&(e.box.parentNode.removeChild(e.box),t=!0),e.line.parentNode&&e.line.parentNode.removeChild(e.line),e.dot.parentNode&&e.dot.parentNode.removeChild(e.dot)),t},g.prototype.reflow=function(){var t,e,i,n,s,o,r,a,h,p,u,c=0;if(void 0==this.data.start)throw Error('Property "start" missing in item '+this.data.id);if(p=this.data,u=this.parent&&this.parent.range,this.visible=p&&u?p.start>u.start&&p.start0},g.prototype._create=function(){var t=this.dom;t||(this.dom=t={},t.box=document.createElement("DIV"),t.content=document.createElement("DIV"),t.content.className="content",t.box.appendChild(t.content),t.line=document.createElement("DIV"),t.line.className="line",t.dot=document.createElement("DIV"),t.dot.className="dot")},g.prototype.reposition=function(){var t=this.dom,e=this.props,i=this.options.orientation;if(t){var n=t.box,s=t.line,o=t.dot;n.style.left=this.left+"px",n.style.top=this.top+"px",s.style.left=e.line.left+"px","top"==i?(s.style.top="0px",s.style.height=this.top+"px"):(s.style.top=this.top+this.height+"px",s.style.height=Math.max(this.parent.height-this.top-this.height+this.props.dot.height/2,0)+"px"),o.style.left=e.dot.left+"px",o.style.top=e.dot.top+"px"}},v.prototype=new m(null,null),v.prototype.select=function(){this.selected=!0},v.prototype.unselect=function(){this.selected=!1},v.prototype.repaint=function(){var t=!1,e=this.dom;if(e||(this._create(),e=this.dom,t=!0),e){if(!this.options&&!this.options.parent)throw Error("Cannot repaint item: no parent attached");var i=this.parent.getForeground();if(!i)throw Error("Cannot repaint time axis: parent has no foreground container element");if(e.point.parentNode||(i.appendChild(e.point),i.appendChild(e.point),t=!0),this.data.content!=this.content){if(this.content=this.data.content,this.content instanceof Element)e.content.innerHTML="",e.content.appendChild(this.content);else{if(void 0==this.data.content)throw Error('Property "content" missing in item '+this.data.id);e.content.innerHTML=this.content}t=!0}var n=(this.data.className?" "+this.data.className:"")+(this.selected?" selected":"");this.className!=n&&(this.className=n,e.point.className="item point"+n,t=!0)}return t},v.prototype.show=function(){return this.dom&&this.dom.point.parentNode?!1:this.repaint()},v.prototype.hide=function(){var t=!1,e=this.dom;return e&&e.point.parentNode&&(e.point.parentNode.removeChild(e.point),t=!0),t},v.prototype.reflow=function(){var t,e,i,n,s,o,r,a,h,p=0;if(void 0==this.data.start)throw Error('Property "start" missing in item '+this.data.id);if(a=this.data,h=this.parent&&this.parent.range,this.visible=a&&h?a.start>h.start&&a.start0},v.prototype._create=function(){var t=this.dom;t||(this.dom=t={},t.point=document.createElement("div"),t.content=document.createElement("div"),t.content.className="content",t.point.appendChild(t.content),t.dot=document.createElement("div"),t.dot.className="dot",t.point.appendChild(t.dot))},v.prototype.reposition=function(){var t=this.dom,e=this.props;t&&(t.point.style.top=this.top+"px",t.point.style.left=this.left+"px",t.content.style.marginLeft=e.content.marginLeft+"px",t.dot.style.top=e.dot.top+"px")},y.prototype=new m(null,null),y.prototype.select=function(){this.selected=!0},y.prototype.unselect=function(){this.selected=!1},y.prototype.repaint=function(){var t=!1,e=this.dom;if(e||(this._create(),e=this.dom,t=!0),e){if(!this.options&&!this.options.parent)throw Error("Cannot repaint item: no parent attached");var i=this.parent.getForeground();if(!i)throw Error("Cannot repaint time axis: parent has no foreground container element");if(e.box.parentNode||(i.appendChild(e.box),t=!0),this.data.content!=this.content){if(this.content=this.data.content,this.content instanceof Element)e.content.innerHTML="",e.content.appendChild(this.content);else{if(void 0==this.data.content)throw Error('Property "content" missing in item '+this.data.id);e.content.innerHTML=this.content}t=!0}var n=this.data.className?""+this.data.className:"";this.className!=n&&(this.className=n,e.box.className="item range"+n,t=!0)}return t},y.prototype.show=function(){return this.dom&&this.dom.box.parentNode?!1:this.repaint()},y.prototype.hide=function(){var t=!1,e=this.dom;return e&&e.box.parentNode&&(e.box.parentNode.removeChild(e.box),t=!0),t},y.prototype.reflow=function(){var t,e,i,n,s,o,r,a,h,p,u,c,d,l,f=0;if(void 0==this.data.start)throw Error('Property "start" missing in item '+this.data.id);if(void 0==this.data.end)throw Error('Property "end" missing in item '+this.data.id);return r=this.data,a=this.parent&&this.parent.range,this.visible=r&&a?r.starta.start:!1,this.visible&&(t=this.dom,t?(e=this.props,i=this.options,n=this.parent,s=n.toScreen(this.data.start),o=n.toScreen(this.data.end),h=T.updateProperty,p=t.box,u=n.width,d=i.orientation,f+=h(e.content,"width",t.content.offsetWidth),f+=h(this,"height",p.offsetHeight),-u>s&&(s=-u),o>2*u&&(o=2*u),c=0>s?Math.min(-s,o-s-e.content.width-2*i.padding):0,f+=h(e.content,"left",c),"top"==d?(l=i.margin.axis,f+=h(this,"top",l)):(l=n.height-this.height-i.margin.axis,f+=h(this,"top",l)),f+=h(this,"left",s),f+=h(this,"width",Math.max(o-s,1))):f+=1),f>0},y.prototype._create=function(){var t=this.dom;t||(this.dom=t={},t.box=document.createElement("div"),t.content=document.createElement("div"),t.content.className="content",t.box.appendChild(t.content))},y.prototype.reposition=function(){var t=this.dom,e=this.props;t&&(t.box.style.top=this.top+"px",t.box.style.left=this.left+"px",t.box.style.width=this.width+"px",t.content.style.left=e.content.left+"px")},w.prototype=new c,w.prototype.setOptions=function(t){T.extend(this.options,t);var e=this;T.forEach(this.contents,function(t){t.itemset.setOptions(e.options)})},w.prototype.setRange=function(){},w.prototype.setItems=function(t){this.items=t,T.forEach(this.contents,function(e){e.view.setData(t)})},w.prototype.getItems=function(){return this.items},w.prototype.setRange=function(t){this.range=t},w.prototype.setGroups=function(t){var e,i,n=this;if(this.groups&&(T.forEach(this.listeners,function(t,e){n.groups.unsubscribe(e,t)}),e=this.groups.get({fields:["id"]}),i=[],T.forEach(e,function(t,e){i[e]=t.id}),this._onRemove(i)),t?t instanceof s?this.groups=t:(this.groups=new s({fieldTypes:{start:"Date",end:"Date"}}),this.groups.add(t)):this.groups=null,this.groups){var o=this.id;T.forEach(this.listeners,function(t,e){n.groups.subscribe(e,t,o)}),e=this.groups.get({fields:["id"]}),i=[],T.forEach(e,function(t,e){i[e]=t.id}),this._onAdd(i)}},w.prototype.getGroups=function(){return this.groups},w.prototype.repaint=function(){var t=0,e=T.updateProperty,i=T.option.asSize,n=this.options,s=this.frame;if(s||(s=document.createElement("div"),s.className="groupset",n.className&&T.addClassName(s,T.option.asString(n.className)),this.frame=s,t+=1),!this.parent)throw Error("Cannot repaint groupset: no parent attached");var r=this.parent.getContainer();if(!r)throw Error("Cannot repaint groupset: parent has no container element");s.parentNode||(r.appendChild(s),t+=1),t+=e(s.style,"height",i(n.height,this.height+"px")),t+=e(s.style,"top",i(n.top,"0px")),t+=e(s.style,"left",i(n.left,"0px")),t+=e(s.style,"width",i(n.width,"100%"));var a=this,h=this.queue,p=(this.items,this.contents),u=this.groups,c=Object.keys(h);if(c.length){c.forEach(function(e){for(var i=h[e],n=null,s=-1,r=0;p.length>r;r++)if(p[r].id==e){n=p[r],s=r;break}switch(i){case"add":case"update":if(!n){var c=new f(a);c.setOptions(a.options),c.setRange(a.range);var d=new o(a.items,{filter:function(t){return t.group==e}});c.setItems(d),a.controller.add(c),n={id:e,view:d,itemset:c},p.push(n)}n.data=u.get(e),delete h[e];break;case"remove":n&&(t+=n.itemset.hide(),n.itemset.setItems(),a.controller.remove(n.itemset),p.splice(s,1)),delete h[e];break;default:console.log('Error: unknown action "'+i+'"')}});var d=null;T.forEach(this.contents,function(t){var e=d&&d.itemset;t.itemset.options.top=e?function(){return e.top+e.height}:0,d=t})}return T.forEach(this.contents,function(e){t+=e.itemset.repaint()}),t>0},w.prototype.getContainer=function(){return this.frame},w.prototype.reflow=function(){var t=0,e=this.options,i=T.updateProperty,n=T.option.asNumber,s=this.frame;if(s){T.forEach(this.contents,function(e){t+=e.itemset.reflow()});var o,r=n(e.maxHeight);null!=e.height?o=s.offsetHeight:(o=0,T.forEach(this.contents,function(t){o+=t.itemset.height})),null!=r&&(o=Math.min(o,r)),t+=i(this,"height",o),t+=i(this,"top",s.offsetTop),t+=i(this,"left",s.offsetLeft),t+=i(this,"width",s.offsetWidth)}return t>0},w.prototype.hide=function(){return this.frame&&this.frame.parentNode?(this.frame.parentNode.removeChild(this.frame),!0):!1 +},w.prototype.show=function(){return this.frame&&this.frame.parentNode?!1:this.repaint()},w.prototype._onUpdate=function(t){this._toQueue(t,"update")},w.prototype._onAdd=function(t){this._toQueue(t,"add")},w.prototype._onRemove=function(t){this._toQueue(t,"remove")},w.prototype._toQueue=function(t,e){var i=this.queue;t.forEach(function(t){i[t]=e}),this.controller&&this.requestRepaint()},b.prototype.setOptions=function(t){T.extend(this.options,t),this.timeaxis.setOptions({orientation:this.options.orientation,showMinorLabels:this.options.showMinorLabels,showMajorLabels:this.options.showMajorLabels}),this.range.setOptions({min:this.options.min,max:this.options.max,zoomMin:this.options.zoomMin,zoomMax:this.options.zoomMax});var e,i,n,s,o=this;if(e="top"==this.options.orientation?function(){return o.timeaxis.height}:function(){return o.main.height-o.timeaxis.height-o.content.height},this.options.height?(n=this.options.height,i=function(){return o.main.height-o.timeaxis.height}):(n=function(){return o.timeaxis.height+o.content.height},i=null),this.options.maxHeight){if(!T.isNumber(this.options.maxHeight))throw new TypeError("Number expected for property maxHeight");s=function(){return o.options.maxHeight-o.timeaxis.height}}this.main.setOptions({height:n}),this.content.setOptions({orientation:this.options.orientation,top:e,height:i,maxHeight:s}),this.controller.repaint()},b.prototype.setItems=function(t){var e,i=null==this.items;if(t?t instanceof s&&(e=t):e=null,t instanceof s||(e=new s({fieldTypes:{start:"Date",end:"Date"}}),e.add(t)),this.items=e,this.content.setItems(e),i&&(void 0==this.options.start||void 0==this.options.end)){var n=this.getItemRange(),o=n.min,r=n.max;if(null!=o&&null!=r){var a=r.valueOf()-o.valueOf();o=new Date(o.valueOf()-.05*a),r=new Date(r.valueOf()+.05*a)}void 0!=this.options.start&&(o=new Date(this.options.start.valueOf())),void 0!=this.options.end&&(r=new Date(this.options.end.valueOf())),(null!=o||null!=r)&&this.range.setRange(o,r)}},b.prototype.setGroups=function(t){this.groups=t;var e=this.groups?w:f;this.content instanceof e||(this.content&&(this.content.hide(),this.content.setItems&&this.content.setItems(),this.content.setGroups&&this.content.setGroups(),this.controller.remove(this.content)),this.content=new e(this.main,[this.timeaxis]),this.content.setRange&&this.content.setRange(this.range),this.content.setItems&&this.content.setItems(this.items),this.content.setGroups&&this.content.setGroups(this.groups),this.controller.add(this.content),this.setOptions(this.options))},b.prototype.getItemRange=function(){var t=this.items,e=null,i=null;if(t){var n=t.min("start");e=n?n.start.valueOf():null;var s=t.max("start");s&&(i=s.start.valueOf());var o=t.max("end");o&&(i=null==i?o.end.valueOf():Math.max(i,o.end.valueOf()))}return{min:null!=e?new Date(e):null,max:null!=i?new Date(i):null}};var C={util:T,events:_,Controller:p,DataSet:s,DataView:o,Range:a,Stack:r,TimeStep:TimeStep,EventBus:h,components:{items:{Item:m,ItemBox:g,ItemPoint:v,ItemRange:y},Component:u,Panel:c,RootPanel:d,ItemSet:f,TimeAxis:l},Timeline:b};n!==void 0&&(n=C),i!==void 0&&i.exports!==void 0&&(i.exports=C),"function"==typeof t&&t(function(){return C}),"undefined"!=typeof window&&(window.vis=C),T.loadCss("/* vis.js stylesheet */\n\n.graph {\n position: relative;\n border: 1px solid #bfbfbf;\n}\n\n.graph .panel {\n position: absolute;\n}\n\n.graph .groupset {\n position: absolute;\n padding: 0;\n margin: 0;\n}\n\n\n.graph .itemset {\n position: absolute;\n padding: 0;\n margin: 0;\n overflow: hidden;\n}\n\n.graph .background {\n}\n\n.graph .foreground {\n}\n\n.graph .itemset-axis {\n position: absolute;\n}\n\n.graph .groupset .itemset-axis {\n border-top: 1px solid #bfbfbf;\n}\n\n.graph .groupset .itemset-axis:last-child {\n border-top: none;\n}\n\n\n.graph .item {\n position: absolute;\n color: #1A1A1A;\n border-color: #97B0F8;\n background-color: #D5DDF6;\n display: inline-block;\n}\n\n.graph .item.selected {\n border-color: #FFC200;\n background-color: #FFF785;\n z-index: 999;\n}\n\n.graph .item.cluster {\n /* TODO: use another color or pattern? */\n background: #97B0F8 url('img/cluster_bg.png');\n color: white;\n}\n.graph .item.cluster.point {\n border-color: #D5DDF6;\n}\n\n.graph .item.box {\n text-align: center;\n border-style: solid;\n border-width: 1px;\n border-radius: 5px;\n -moz-border-radius: 5px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.point {\n background: none;\n}\n\n.graph .dot {\n border: 5px solid #97B0F8;\n position: absolute;\n border-radius: 5px;\n -moz-border-radius: 5px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.range {\n overflow: hidden;\n border-style: solid;\n border-width: 1px;\n border-radius: 2px;\n -moz-border-radius: 2px; /* For Firefox 3.6 and older */\n}\n\n.graph .item.range .drag-left {\n cursor: w-resize;\n z-index: 1000;\n}\n\n.graph .item.range .drag-right {\n cursor: e-resize;\n z-index: 1000;\n}\n\n.graph .item.range .content {\n position: relative;\n display: inline-block;\n}\n\n.graph .item.line {\n position: absolute;\n width: 0;\n border-left-width: 1px;\n border-left-style: solid;\n}\n\n.graph .item .content {\n margin: 5px;\n white-space: nowrap;\n overflow: hidden;\n}\n\n/* TODO: better css name, 'graph' is way to generic */\n\n.graph {\n overflow: hidden;\n}\n\n.graph .axis {\n position: relative;\n}\n\n.graph .axis .text {\n position: absolute;\n color: #4d4d4d;\n padding: 3px;\n white-space: nowrap;\n}\n\n.graph .axis .text.measure {\n position: absolute;\n padding-left: 0;\n padding-right: 0;\n margin-left: 0;\n margin-right: 0;\n visibility: hidden;\n}\n\n.graph .axis .grid.vertical {\n position: absolute;\n width: 0;\n border-right: 1px solid;\n}\n\n.graph .axis .grid.horizontal {\n position: absolute;\n left: 0;\n width: 100%;\n height: 0;\n border-bottom: 1px solid;\n}\n\n.graph .axis .grid.minor {\n border-color: #e5e5e5;\n}\n\n.graph .axis .grid.major {\n border-color: #bfbfbf;\n}\n\n")},{moment:2}],2:[function(e,i){(function(){(function(n){function s(t,e){return function(i){return c(t.call(this,i),e)}}function o(t){return function(e){return this.lang().ordinal(t.call(this,e))}}function r(){}function a(t){p(this,t)}function h(t){var e=this._data={},i=t.years||t.year||t.y||0,n=t.months||t.month||t.M||0,s=t.weeks||t.week||t.w||0,o=t.days||t.day||t.d||0,r=t.hours||t.hour||t.h||0,a=t.minutes||t.minute||t.m||0,h=t.seconds||t.second||t.s||0,p=t.milliseconds||t.millisecond||t.ms||0;this._milliseconds=p+1e3*h+6e4*a+36e5*r,this._days=o+7*s,this._months=n+12*i,e.milliseconds=p%1e3,h+=u(p/1e3),e.seconds=h%60,a+=u(h/60),e.minutes=a%60,r+=u(a/60),e.hours=r%24,o+=u(r/24),o+=7*s,e.days=o%30,n+=u(o/30),e.months=n%12,i+=u(n/12),e.years=i}function p(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function u(t){return 0>t?Math.ceil(t):Math.floor(t)}function c(t,e){for(var i=t+"";e>i.length;)i="0"+i;return i}function d(t,e,i){var n,s=e._milliseconds,o=e._days,r=e._months;s&&t._d.setTime(+t+s*i),o&&t.date(t.date()+o*i),r&&(n=t.date(),t.date(1).month(t.month()+r*i).date(Math.min(n,t.daysInMonth())))}function l(t){return"[object Array]"===Object.prototype.toString.call(t)}function f(t,e){var i,n=Math.min(t.length,e.length),s=Math.abs(t.length-e.length),o=0;for(i=0;n>i;i++)~~t[i]!==~~e[i]&&o++;return o+s}function m(t,e){return e.abbr=t,R[t]||(R[t]=new r),R[t].set(e),R[t]}function g(t){return t?(!R[t]&&U&&e("./lang/"+t),R[t]):I.fn._lang}function v(t){return t.match(/\[.*\]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function y(t){var e,i,n=t.match(F);for(e=0,i=n.length;i>e;e++)n[e]=ae[n[e]]?ae[n[e]]:v(n[e]);return function(s){var o="";for(e=0;i>e;e++)o+="function"==typeof n[e].call?n[e].call(s,t):n[e];return o}}function w(t,e){function i(e){return t.lang().longDateFormat(e)||e}for(var n=5;n--&&z.test(e);)e=e.replace(z,i);return se[e]||(se[e]=y(e)),se[e](t)}function b(t){switch(t){case"DDDD":return V;case"YYYY":return B;case"YYYYY":return Z;case"S":case"SS":case"SSS":case"DDD":return q;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":case"a":case"A":return X;case"X":return J;case"Z":case"ZZ":return K;case"T":return G;case"MM":case"DD":case"YY":case"HH":case"hh":case"mm":case"ss":case"M":case"D":case"d":case"H":case"h":case"m":case"s":return W;default:return RegExp(t.replace("\\",""))}}function S(t,e,i){var n,s=i._a;switch(t){case"M":case"MM":s[1]=null==e?0:~~e-1;break;case"MMM":case"MMMM":n=g(i._l).monthsParse(e),null!=n?s[1]=n:i._isValid=!1;break;case"D":case"DD":case"DDD":case"DDDD":null!=e&&(s[2]=~~e);break;case"YY":s[0]=~~e+(~~e>68?1900:2e3);break;case"YYYY":case"YYYYY":s[0]=~~e;break;case"a":case"A":i._isPm="pm"===(e+"").toLowerCase();break;case"H":case"HH":case"h":case"hh":s[3]=~~e;break;case"m":case"mm":s[4]=~~e;break;case"s":case"ss":s[5]=~~e;break;case"S":case"SS":case"SSS":s[6]=~~(1e3*("0."+e));break;case"X":i._d=new Date(1e3*parseFloat(e));break;case"Z":case"ZZ":i._useUTC=!0,n=(e+"").match(ee),n&&n[1]&&(i._tzh=~~n[1]),n&&n[2]&&(i._tzm=~~n[2]),n&&"+"===n[0]&&(i._tzh=-i._tzh,i._tzm=-i._tzm)}null==e&&(i._isValid=!1)}function T(t){var e,i,n=[];if(!t._d){for(e=0;7>e;e++)t._a[e]=n[e]=null==t._a[e]?2===e?1:0:t._a[e];n[3]+=t._tzh||0,n[4]+=t._tzm||0,i=new Date(0),t._useUTC?(i.setUTCFullYear(n[0],n[1],n[2]),i.setUTCHours(n[3],n[4],n[5],n[6])):(i.setFullYear(n[0],n[1],n[2]),i.setHours(n[3],n[4],n[5],n[6])),t._d=i}}function E(t){var e,i,n=t._f.match(F),s=t._i;for(t._a=[],e=0;n.length>e;e++)i=(b(n[e]).exec(s)||[])[0],i&&(s=s.slice(s.indexOf(i)+i.length)),ae[n[e]]&&S(n[e],i,t);t._isPm&&12>t._a[3]&&(t._a[3]+=12),t._isPm===!1&&12===t._a[3]&&(t._a[3]=0),T(t)}function M(t){for(var e,i,n,s,o=99;t._f.length;){if(e=p({},t),e._f=t._f.pop(),E(e),i=new a(e),i.isValid()){n=i;break}s=f(e._a,i.toArray()),o>s&&(o=s,n=i)}p(t,n)}function _(t){var e,i=t._i;if(Q.exec(i)){for(t._f="YYYY-MM-DDT",e=0;4>e;e++)if(te[e][1].exec(i)){t._f+=te[e][0];break}K.exec(i)&&(t._f+=" Z"),E(t)}else t._d=new Date(i)}function C(t){var e=t._i,i=P.exec(e);e===n?t._d=new Date:i?t._d=new Date(+i[1]):"string"==typeof e?_(t):l(e)?(t._a=e.slice(0),T(t)):t._d=e instanceof Date?new Date(+e):new Date(e)}function D(t,e,i,n,s){return s.relativeTime(e||1,!!i,t,n)}function x(t,e,i){var n=j(Math.abs(t)/1e3),s=j(n/60),o=j(s/60),r=j(o/24),a=j(r/365),h=45>n&&["s",n]||1===s&&["m"]||45>s&&["mm",s]||1===o&&["h"]||22>o&&["hh",o]||1===r&&["d"]||25>=r&&["dd",r]||45>=r&&["M"]||345>r&&["MM",j(r/30)]||1===a&&["y"]||["yy",a];return h[2]=e,h[3]=t>0,h[4]=i,D.apply({},h)}function L(t,e,i){var n=i-e,s=i-t.day();return s>n&&(s-=7),n-7>s&&(s+=7),Math.ceil(I(t).add("d",s).dayOfYear()/7)}function O(t){var e=t._i,i=t._f;return null===e||""===e?null:("string"==typeof e&&(t._i=e=g().preparse(e)),I.isMoment(e)?(t=p({},e),t._d=new Date(+e._d)):i?l(i)?M(t):E(t):C(t),new a(t))}function N(t,e){I.fn[t]=I.fn[t+"s"]=function(t){var i=this._isUTC?"UTC":"";return null!=t?(this._d["set"+i+e](t),this):this._d["get"+i+e]()}}function A(t){I.duration.fn[t]=function(){return this._data[t]}}function Y(t,e){I.duration.fn["as"+t]=function(){return+this/e}}for(var I,k,H="2.0.0",j=Math.round,R={},U=i!==n&&i.exports,P=/^\/?Date\((\-?\d+)/i,F=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|YYYYY|YYYY|YY|a|A|hh?|HH?|mm?|ss?|SS?S?|X|zz?|ZZ?|.)/g,z=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,W=/\d\d?/,q=/\d{1,3}/,V=/\d{3}/,B=/\d{1,4}/,Z=/[+\-]?\d{1,6}/,X=/[0-9]*[a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF]+\s*?[\u0600-\u06FF]+/i,K=/Z|[\+\-]\d\d:?\d\d/i,G=/T/i,J=/[\+\-]?\d+(\.\d{1,3})?/,Q=/^\s*\d{4}-\d\d-\d\d((T| )(\d\d(:\d\d(:\d\d(\.\d\d?\d?)?)?)?)?([\+\-]\d\d:?\d\d)?)?/,$="YYYY-MM-DDTHH:mm:ssZ",te=[["HH:mm:ss.S",/(T| )\d\d:\d\d:\d\d\.\d{1,3}/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],ee=/([\+\-]|\d\d)/gi,ie="Month|Date|Hours|Minutes|Seconds|Milliseconds".split("|"),ne={Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6},se={},oe="DDD w W M D d".split(" "),re="M D H h m s w W".split(" "),ae={M:function(){return this.month()+1},MMM:function(t){return this.lang().monthsShort(this,t)},MMMM:function(t){return this.lang().months(this,t)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(t){return this.lang().weekdaysMin(this,t)},ddd:function(t){return this.lang().weekdaysShort(this,t)},dddd:function(t){return this.lang().weekdays(this,t)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return c(this.year()%100,2)},YYYY:function(){return c(this.year(),4)},YYYYY:function(){return c(this.year(),5)},a:function(){return this.lang().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.lang().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return~~(this.milliseconds()/100)},SS:function(){return c(~~(this.milliseconds()/10),2)},SSS:function(){return c(this.milliseconds(),3)},Z:function(){var t=-this.zone(),e="+";return 0>t&&(t=-t,e="-"),e+c(~~(t/60),2)+":"+c(~~t%60,2)},ZZ:function(){var t=-this.zone(),e="+";return 0>t&&(t=-t,e="-"),e+c(~~(10*t/6),4)},X:function(){return this.unix()}};oe.length;)k=oe.pop(),ae[k+"o"]=o(ae[k]);for(;re.length;)k=re.pop(),ae[k+k]=s(ae[k],2);for(ae.DDDD=s(ae.DDD,3),r.prototype={set:function(t){var e,i;for(i in t)e=t[i],"function"==typeof e?this[i]=e:this["_"+i]=e},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(t){return this._months[t.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(t){return this._monthsShort[t.month()]},monthsParse:function(t){var e,i,n;for(this._monthsParse||(this._monthsParse=[]),e=0;12>e;e++)if(this._monthsParse[e]||(i=I([2e3,e]),n="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[e]=RegExp(n.replace(".",""),"i")),this._monthsParse[e].test(t))return e},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(t){return this._weekdays[t.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(t){return this._weekdaysShort[t.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(t){return this._weekdaysMin[t.day()]},_longDateFormat:{LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D YYYY",LLL:"MMMM D YYYY LT",LLLL:"dddd, MMMM D YYYY LT"},longDateFormat:function(t){var e=this._longDateFormat[t];return!e&&this._longDateFormat[t.toUpperCase()]&&(e=this._longDateFormat[t.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t]=e),e},meridiem:function(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[last] dddd [at] LT",sameElse:"L"},calendar:function(t,e){var i=this._calendar[t];return"function"==typeof i?i.apply(e):i},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(t,e,i,n){var s=this._relativeTime[i];return"function"==typeof s?s(t,e,i,n):s.replace(/%d/i,t)},pastFuture:function(t,e){var i=this._relativeTime[t>0?"future":"past"];return"function"==typeof i?i(e):i.replace(/%s/i,e)},ordinal:function(t){return this._ordinal.replace("%d",t)},_ordinal:"%d",preparse:function(t){return t},postformat:function(t){return t},week:function(t){return L(t,this._week.dow,this._week.doy)},_week:{dow:0,doy:6}},I=function(t,e,i){return O({_i:t,_f:e,_l:i,_isUTC:!1})},I.utc=function(t,e,i){return O({_useUTC:!0,_isUTC:!0,_l:i,_i:t,_f:e})},I.unix=function(t){return I(1e3*t)},I.duration=function(t,e){var i,n=I.isDuration(t),s="number"==typeof t,o=n?t._data:s?{}:t;return s&&(e?o[e]=t:o.milliseconds=t),i=new h(o),n&&t.hasOwnProperty("_lang")&&(i._lang=t._lang),i},I.version=H,I.defaultFormat=$,I.lang=function(t,e){return t?(e?m(t,e):R[t]||g(t),I.duration.fn._lang=I.fn._lang=g(t),n):I.fn._lang._abbr},I.langData=function(t){return t&&t._lang&&t._lang._abbr&&(t=t._lang._abbr),g(t)},I.isMoment=function(t){return t instanceof a},I.isDuration=function(t){return t instanceof h},I.fn=a.prototype={clone:function(){return I(this)},valueOf:function(){return+this._d},unix:function(){return Math.floor(+this._d/1e3)},toString:function(){return this.format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._d},toJSON:function(){return I.utc(this).format("YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var t=this;return[t.year(),t.month(),t.date(),t.hours(),t.minutes(),t.seconds(),t.milliseconds()]},isValid:function(){return null==this._isValid&&(this._isValid=this._a?!f(this._a,(this._isUTC?I.utc(this._a):I(this._a)).toArray()):!isNaN(this._d.getTime())),!!this._isValid},utc:function(){return this._isUTC=!0,this},local:function(){return this._isUTC=!1,this},format:function(t){var e=w(this,t||I.defaultFormat);return this.lang().postformat(e)},add:function(t,e){var i;return i="string"==typeof t?I.duration(+e,t):I.duration(t,e),d(this,i,1),this},subtract:function(t,e){var i;return i="string"==typeof t?I.duration(+e,t):I.duration(t,e),d(this,i,-1),this},diff:function(t,e,i){var n,s,o=this._isUTC?I(t).utc():I(t).local(),r=6e4*(this.zone()-o.zone());return e&&(e=e.replace(/s$/,"")),"year"===e||"month"===e?(n=432e5*(this.daysInMonth()+o.daysInMonth()),s=12*(this.year()-o.year())+(this.month()-o.month()),s+=(this-I(this).startOf("month")-(o-I(o).startOf("month")))/n,"year"===e&&(s/=12)):(n=this-o-r,s="second"===e?n/1e3:"minute"===e?n/6e4:"hour"===e?n/36e5:"day"===e?n/864e5:"week"===e?n/6048e5:n),i?s:u(s)},from:function(t,e){return I.duration(this.diff(t)).lang(this.lang()._abbr).humanize(!e)},fromNow:function(t){return this.from(I(),t)},calendar:function(){var t=this.diff(I().startOf("day"),"days",!0),e=-6>t?"sameElse":-1>t?"lastWeek":0>t?"lastDay":1>t?"sameDay":2>t?"nextDay":7>t?"nextWeek":"sameElse";return this.format(this.lang().calendar(e,this))},isLeapYear:function(){var t=this.year();return 0===t%4&&0!==t%100||0===t%400},isDST:function(){return this.zone()+I(t).startOf(e)},isBefore:function(t,e){return e=e!==n?e:"millisecond",+this.clone().startOf(e)<+I(t).startOf(e)},isSame:function(t,e){return e=e!==n?e:"millisecond",+this.clone().startOf(e)===+I(t).startOf(e)},zone:function(){return this._isUTC?0:this._d.getTimezoneOffset()},daysInMonth:function(){return I.utc([this.year(),this.month()+1,0]).date()},dayOfYear:function(t){var e=j((I(this).startOf("day")-I(this).startOf("year"))/864e5)+1;return null==t?e:this.add("d",t-e)},isoWeek:function(t){var e=L(this,1,4);return null==t?e:this.add("d",7*(t-e))},week:function(t){var e=this.lang().week(this);return null==t?e:this.add("d",7*(t-e))},lang:function(t){return t===n?this._lang:(this._lang=g(t),this)}},k=0;ie.length>k;k++)N(ie[k].toLowerCase().replace(/s$/,""),ie[k]);N("year","FullYear"),I.fn.days=I.fn.day,I.fn.weeks=I.fn.week,I.fn.isoWeeks=I.fn.isoWeek,I.duration.fn=h.prototype={weeks:function(){return u(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+2592e6*this._months},humanize:function(t){var e=+this,i=x(e,!t,this.lang());return t&&(i=this.lang().pastFuture(e,i)),this.lang().postformat(i)},lang:I.fn.lang};for(k in ne)ne.hasOwnProperty(k)&&(Y(k,ne[k]),A(k.toLowerCase()));Y("Weeks",6048e5),I.lang("en",{ordinal:function(t){var e=t%10,i=1===~~(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+i}}),U&&(i.exports=I),"undefined"==typeof ender&&(this.moment=I),"function"==typeof t&&t.amd&&t("moment",[],function(){return I})}).call(this)})()},{}]},{},[1])(1)}); \ No newline at end of file