{"version":3,"file":"vis-timeline-graph2d.min.mjs","sources":["../../lib/module/moment.js","../../lib/util.js","../../lib/timeline/component/Component.js","../../lib/timeline/DateUtil.js","../../lib/timeline/Range.js","../../lib/module/hammer.js","../../lib/hammerUtil.js","../../lib/timeline/TimeStep.js","../../lib/timeline/component/TimeAxis.js","../../lib/shared/Activator.js","../../lib/timeline/locales.js","../../lib/timeline/component/CustomTime.js","../../lib/timeline/Core.js","../../lib/timeline/component/CurrentTime.js","../../lib/timeline/Stack.js","../../lib/timeline/component/Group.js","../../lib/timeline/component/BackgroundGroup.js","../../lib/timeline/component/item/Item.js","../../lib/timeline/component/item/BoxItem.js","../../lib/timeline/component/item/PointItem.js","../../lib/timeline/component/item/RangeItem.js","../../lib/timeline/component/item/BackgroundItem.js","../../lib/shared/Popup.js","../../lib/timeline/component/item/ClusterItem.js","../../lib/timeline/component/ClusterGenerator.js","../../lib/timeline/component/ItemSet.js","../../lib/shared/Validator.js","../../lib/timeline/optionsTimeline.js","../../lib/shared/ColorPicker.js","../../lib/shared/Configurator.js","../../lib/timeline/Timeline.js","../../lib/DOMutil.js","../../lib/timeline/component/DataScale.js","../../lib/timeline/component/DataAxis.js","../../lib/timeline/component/graph2d_types/points.js","../../lib/timeline/component/graph2d_types/bar.js","../../lib/timeline/component/graph2d_types/line.js","../../lib/timeline/component/GraphGroup.js","../../lib/timeline/component/Legend.js","../../lib/timeline/component/LineGraph.js","../../lib/timeline/optionsGraph2d.js","../../lib/timeline/Graph2d.js","../../lib/entry-esnext.js"],"sourcesContent":["import bundledMoment from \"moment\";\n\n// Check if Moment.js is already loaded in the browser window, if so, use this\n// instance, else use bundled Moment.js.\nconst moment =\n  (typeof window !== \"undefined\" && window[\"moment\"]) || bundledMoment;\n\nexport default moment;\n","// utility functions\n\nexport * from \"vis-util/esnext\";\nimport * as util from \"vis-util/esnext\";\nimport { getType, isNumber, isString } from \"vis-util/esnext\";\nimport { DataSet, createNewDataPipeFrom } from \"vis-data/esnext\";\nimport { isDataViewLike as isDataViewLikeUpstream } from \"vis-data/esnext\";\n\nimport moment from \"moment\";\nimport xssFilter from \"xss\";\n\nexport { v4 as randomUUID } from \"uuid\";\n/**\n * Test if an object implements the DataView interface from vis-data.\n * Uses the idProp property instead of expecting a hardcoded id field \"id\".\n * @param {Object} obj The object to test.\n * @returns {boolean} True if the object implements vis-data DataView interface otherwise false.\n */\nexport function isDataViewLike(obj) {\n  if (!obj) {\n    return false;\n  }\n  let idProp = obj.idProp ?? obj._idProp;\n  if (!idProp) {\n    return false;\n  }\n  return isDataViewLikeUpstream(idProp, obj);\n}\n\n// parse ASP.Net Date pattern,\n// for example '/Date(1198908717056)/' or '/Date(1198908717056-0700)/'\n// code from http://momentjs.com/\nconst ASPDateRegex = /^\\/?Date\\((-?\\d+)/i;\nconst NumericRegex = /^\\d+$/;\n/**\n * Convert an object into another type\n *\n * @param {Object} object - Value of unknown type.\n * @param {string} type - Name of the desired type.\n *\n * @returns {Object} Object in the desired type.\n * @throws Error\n */\nexport function convert(object, type) {\n  let match;\n\n  if (object === undefined) {\n    return undefined;\n  }\n  if (object === null) {\n    return null;\n  }\n\n  if (!type) {\n    return object;\n  }\n  if (!(typeof type === \"string\") && !(type instanceof String)) {\n    throw new Error(\"Type must be a string\");\n  }\n\n  //noinspection FallthroughInSwitchStatementJS\n  switch (type) {\n    case \"boolean\":\n    case \"Boolean\":\n      return Boolean(object);\n\n    case \"number\":\n    case \"Number\":\n      if (isString(object) && !isNaN(Date.parse(object))) {\n        return moment(object).valueOf();\n      } else {\n        // @TODO: I don't think that Number and String constructors are a good idea.\n        // This could also fail if the object doesn't have valueOf method or if it's redefined.\n        // For example: Object.create(null) or { valueOf: 7 }.\n        return Number(object.valueOf());\n      }\n    case \"string\":\n    case \"String\":\n      return String(object);\n\n    case \"Date\":\n      try {\n        return convert(object, \"Moment\").toDate();\n      } catch (e) {\n        if (e instanceof TypeError) {\n          throw new TypeError(\n            \"Cannot convert object of type \" +\n              getType(object) +\n              \" to type \" +\n              type,\n          );\n        } else {\n          throw e;\n        }\n      }\n\n    case \"Moment\":\n      if (isNumber(object)) {\n        return moment(object);\n      }\n      if (object instanceof Date) {\n        return moment(object.valueOf());\n      } else if (moment.isMoment(object)) {\n        return moment(object);\n      }\n      if (isString(object)) {\n        match = ASPDateRegex.exec(object);\n        if (match) {\n          // object is an ASP date\n          return moment(Number(match[1])); // parse number\n        }\n        match = NumericRegex.exec(object);\n\n        if (match) {\n          return moment(Number(object));\n        }\n\n        return moment(object); // parse string\n      } else {\n        throw new TypeError(\n          \"Cannot convert object of type \" +\n            getType(object) +\n            \" to type \" +\n            type,\n        );\n      }\n\n    case \"ISODate\":\n      if (isNumber(object)) {\n        return new Date(object);\n      } else if (object instanceof Date) {\n        return object.toISOString();\n      } else if (moment.isMoment(object)) {\n        return object.toDate().toISOString();\n      } else if (isString(object)) {\n        match = ASPDateRegex.exec(object);\n        if (match) {\n          // object is an ASP date\n          return new Date(Number(match[1])).toISOString(); // parse number\n        } else {\n          return moment(object).format(); // ISO 8601\n        }\n      } else {\n        throw new Error(\n          \"Cannot convert object of type \" +\n            getType(object) +\n            \" to type ISODate\",\n        );\n      }\n\n    case \"ASPDate\":\n      if (isNumber(object)) {\n        return \"/Date(\" + object + \")/\";\n      } else if (object instanceof Date || moment.isMoment(object)) {\n        return \"/Date(\" + object.valueOf() + \")/\";\n      } else if (isString(object)) {\n        match = ASPDateRegex.exec(object);\n        let value;\n        if (match) {\n          // object is an ASP date\n          value = new Date(Number(match[1])).valueOf(); // parse number\n        } else {\n          value = new Date(object).valueOf(); // parse string\n        }\n        return \"/Date(\" + value + \")/\";\n      } else {\n        throw new Error(\n          \"Cannot convert object of type \" +\n            getType(object) +\n            \" to type ASPDate\",\n        );\n      }\n\n    default:\n      throw new Error(`Unknown type ${type}`);\n  }\n}\n\n/**\n * Create a Data Set like wrapper to seamlessly coerce data types.\n *\n * @param {Object} rawDS - The Data Set with raw uncoerced data.\n * @param {Object} type - A record assigning a data type to property name.\n * @param {string} type.start - Data type name of property 'start'. Default: Date.\n * @param {string} type.end - Data type name of property 'end'. Default: Date.\n *\n * @remarks\n * The write operations (`add`, `remove`, `update` and `updateOnly`) write into\n * the raw (uncoerced) data set. These values are then picked up by a pipe\n * which coerces the values using the [[convert]] function and feeds them into\n * the coerced data set. When querying (`forEach`, `get`, `getIds`, `off` and\n * `on`) the values are then fetched from the coerced data set and already have\n * the required data types. The values are coerced only once when inserted and\n * then the same value is returned each time until it is updated or deleted.\n *\n * For example: `typeCoercedDataSet.add({ id: 7, start: \"2020-01-21\" })` would\n * result in `typeCoercedDataSet.get(7)` returning `{ id: 7, start: moment(new\n * Date(\"2020-01-21\")).toDate() }`.\n *\n * Use the dispose method prior to throwing a reference to this away. Otherwise\n * the pipe connecting the two Data Sets will keep the unaccessible coerced\n * Data Set alive and updated as long as the raw Data Set exists.\n *\n * @returns {Object} A Data Set like object that saves data into the raw Data Set and\n * retrieves them from the coerced Data Set.\n */\nexport function typeCoerceDataSet(\n  rawDS,\n  type = { start: \"Date\", end: \"Date\" },\n) {\n  const idProp = rawDS._idProp;\n  const coercedDS = new DataSet({ fieldId: idProp });\n\n  const pipe = createNewDataPipeFrom(rawDS)\n    .map((item) =>\n      Object.keys(item).reduce((acc, key) => {\n        acc[key] = convert(item[key], type[key]);\n        return acc;\n      }, {}),\n    )\n    .to(coercedDS);\n\n  pipe.all().start();\n\n  return {\n    // Write only.\n    add: (...args) => rawDS.getDataSet().add(...args),\n    remove: (...args) => rawDS.getDataSet().remove(...args),\n    update: (...args) => rawDS.getDataSet().update(...args),\n    updateOnly: (...args) => rawDS.getDataSet().updateOnly(...args),\n    clear: (...args) => rawDS.getDataSet().clear(...args),\n\n    // Read only.\n    forEach: coercedDS.forEach.bind(coercedDS),\n    get: coercedDS.get.bind(coercedDS),\n    getIds: coercedDS.getIds.bind(coercedDS),\n    off: coercedDS.off.bind(coercedDS),\n    on: coercedDS.on.bind(coercedDS),\n\n    get length() {\n      return coercedDS.length;\n    },\n\n    // Non standard.\n    idProp,\n    type,\n\n    rawDS,\n    coercedDS,\n    dispose: () => pipe.stop(),\n  };\n}\n\n// Configure XSS protection\nconst setupXSSCleaner = (options) => {\n  const customXSS = new xssFilter.FilterXSS(options);\n\n  return (input) => {\n    if (typeof input === \"string\") {\n      return customXSS.process(input);\n    }\n    return input; // Leave other types unchanged\n  };\n};\nconst setupNoOpCleaner = (string) => string;\n\n// when nothing else is configured: filter XSS with the lib's default options\nlet configuredXSSProtection = setupXSSCleaner();\n\nconst setupXSSProtection = (options) => {\n  // No options? Do nothing.\n  if (!options) {\n    return;\n  }\n\n  // Disable XSS protection completely on request\n  if (options.disabled === true) {\n    configuredXSSProtection = setupNoOpCleaner;\n    console.warn(\n      \"You disabled XSS protection for vis-Timeline. I sure hope you know what you're doing!\",\n    );\n  } else {\n    // Configure XSS protection with some custom options.\n    // For a list of valid options check the lib's documentation:\n    // https://github.com/leizongmin/js-xss#custom-filter-rules\n    if (options.filterOptions) {\n      configuredXSSProtection = setupXSSCleaner(options.filterOptions);\n    }\n  }\n};\n\nconst availableUtils = {\n  ...util,\n  convert,\n  setupXSSProtection,\n};\n\nObject.defineProperty(availableUtils, \"xss\", {\n  get: function () {\n    return configuredXSSProtection;\n  },\n});\n\nexport default availableUtils;\n","import util from \"../../util.js\";\n\n/** Prototype for visual components */\nexport default class Component {\n  /**\n   */\n  constructor() {\n    this.options = null;\n    this.props = null;\n  }\n\n  /**\n   * Set options for the component. The new options will be merged into the\n   * current options.\n   * @param {Object} options\n   */\n  setOptions(options) {\n    if (options) {\n      util.extend(this.options, options);\n    }\n  }\n\n  /**\n   * Repaint the component\n   * @return {boolean} Returns true if the component is resized\n   */\n  redraw() {\n    // should be implemented by the component\n    return false;\n  }\n\n  /**\n   * Destroy the component. Cleanup DOM and event listeners\n   */\n  destroy() {\n    // should be implemented by the component\n  }\n\n  /**\n   * Test whether the component is resized since the last time _isResized() was\n   * called.\n   * @return {Boolean} Returns true if the component is resized\n   * @protected\n   */\n  _isResized() {\n    const resized =\n      this.props._previousWidth !== this.props.width ||\n      this.props._previousHeight !== this.props.height;\n\n    this.props._previousWidth = this.props.width;\n    this.props._previousHeight = this.props.height;\n\n    return resized;\n  }\n}\n","/**\n * used in Core to convert the options into a volatile variable\n *\n * @param {function} moment\n * @param {Object} body\n * @param {Array | Object} hiddenDates\n * @returns {number}\n */\nexport function convertHiddenOptions(moment, body, hiddenDates) {\n  if (hiddenDates && !Array.isArray(hiddenDates)) {\n    return convertHiddenOptions(moment, body, [hiddenDates]);\n  }\n\n  body.hiddenDates = [];\n  if (hiddenDates) {\n    if (Array.isArray(hiddenDates) == true) {\n      for (let i = 0; i < hiddenDates.length; i++) {\n        if (hiddenDates[i].repeat === undefined) {\n          const dateItem = {};\n          dateItem.start = moment(hiddenDates[i].start).toDate().valueOf();\n          dateItem.end = moment(hiddenDates[i].end).toDate().valueOf();\n          body.hiddenDates.push(dateItem);\n        }\n      }\n      body.hiddenDates.sort((a, b) => a.start - b.start); // sort by start time\n    }\n  }\n}\n\n/**\n * create new entrees for the repeating hidden dates\n *\n * @param {function} moment\n * @param {Object} body\n * @param {Array | Object} hiddenDates\n * @returns {null}\n */\nexport function updateHiddenDates(moment, body, hiddenDates) {\n  if (hiddenDates && !Array.isArray(hiddenDates)) {\n    return updateHiddenDates(moment, body, [hiddenDates]);\n  }\n\n  if (hiddenDates && body.domProps.centerContainer.width !== undefined) {\n    convertHiddenOptions(moment, body, hiddenDates);\n\n    const start = moment(body.range.start);\n    const end = moment(body.range.end);\n\n    const totalRange = body.range.end - body.range.start;\n    const pixelTime = totalRange / body.domProps.centerContainer.width;\n\n    for (let i = 0; i < hiddenDates.length; i++) {\n      if (hiddenDates[i].repeat !== undefined) {\n        let startDate = moment(hiddenDates[i].start);\n        let endDate = moment(hiddenDates[i].end);\n\n        if (startDate._d == \"Invalid Date\") {\n          throw new Error(\n            `Supplied start date is not valid: ${hiddenDates[i].start}`,\n          );\n        }\n        if (endDate._d == \"Invalid Date\") {\n          throw new Error(\n            `Supplied end date is not valid: ${hiddenDates[i].end}`,\n          );\n        }\n\n        const duration = endDate - startDate;\n        if (duration >= 4 * pixelTime) {\n          let offset = 0;\n          let runUntil = end.clone();\n          switch (hiddenDates[i].repeat) {\n            case \"daily\": // case of time\n              if (startDate.day() != endDate.day()) {\n                offset = 1;\n              }\n              startDate = startDate\n                .dayOfYear(start.dayOfYear())\n                .year(start.year())\n                .subtract(7, \"days\");\n\n              endDate = endDate\n                .dayOfYear(start.dayOfYear())\n                .year(start.year())\n                .subtract(7 - offset, \"days\");\n\n              runUntil.add(1, \"weeks\");\n              break;\n            case \"weekly\": {\n              const dayOffset = endDate.diff(startDate, \"days\");\n              const day = startDate.day();\n\n              // set the start date to the range.start\n              startDate = startDate\n                .date(start.date())\n                .month(start.month())\n                .year(start.year());\n              endDate = startDate.clone();\n\n              // force\n              startDate = startDate.day(day).subtract(1, \"weeks\");\n              endDate = endDate\n                .day(day)\n                .add(dayOffset, \"days\")\n                .subtract(1, \"weeks\");\n\n              runUntil.add(1, \"weeks\");\n              break;\n            }\n            case \"monthly\":\n              if (startDate.month() != endDate.month()) {\n                offset = 1;\n              }\n              startDate = startDate\n                .month(start.month())\n                .year(start.year())\n                .subtract(1, \"months\");\n\n              endDate = endDate\n                .month(start.month())\n                .year(start.year())\n                .subtract(1, \"months\")\n                .add(offset, \"months\");\n\n              runUntil.add(1, \"months\");\n              break;\n            case \"yearly\":\n              if (startDate.year() != endDate.year()) {\n                offset = 1;\n              }\n              startDate = startDate.year(start.year()).subtract(1, \"years\");\n              endDate = endDate\n                .year(start.year())\n                .subtract(1, \"years\")\n                .add(offset, \"years\");\n\n              runUntil.add(1, \"years\");\n              break;\n            default:\n              console.log(\n                \"Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:\",\n                hiddenDates[i].repeat,\n              );\n              return;\n          }\n          while (startDate < runUntil) {\n            body.hiddenDates.push({\n              start: startDate.valueOf(),\n              end: endDate.valueOf(),\n            });\n            switch (hiddenDates[i].repeat) {\n              case \"daily\":\n                startDate = startDate.add(1, \"days\");\n                endDate = endDate.add(1, \"days\");\n                break;\n              case \"weekly\":\n                startDate = startDate.add(1, \"weeks\");\n                endDate = endDate.add(1, \"weeks\");\n                break;\n              case \"monthly\":\n                startDate = startDate.add(1, \"months\");\n                endDate = endDate.add(1, \"months\");\n                break;\n              case \"yearly\":\n                startDate = startDate.add(1, \"y\");\n                endDate = endDate.add(1, \"y\");\n                break;\n              default:\n                console.log(\n                  \"Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:\",\n                  hiddenDates[i].repeat,\n                );\n                return;\n            }\n          }\n          body.hiddenDates.push({\n            start: startDate.valueOf(),\n            end: endDate.valueOf(),\n          });\n        }\n      }\n    }\n    // remove duplicates, merge where possible\n    removeDuplicates(body);\n    // ensure the new positions are not on hidden dates\n    const startHidden = getIsHidden(body.range.start, body.hiddenDates);\n    const endHidden = getIsHidden(body.range.end, body.hiddenDates);\n    let rangeStart = body.range.start;\n    let rangeEnd = body.range.end;\n    if (startHidden.hidden == true) {\n      rangeStart =\n        body.range.startToFront == true\n          ? startHidden.startDate - 1\n          : startHidden.endDate + 1;\n    }\n    if (endHidden.hidden == true) {\n      rangeEnd =\n        body.range.endToFront == true\n          ? endHidden.startDate - 1\n          : endHidden.endDate + 1;\n    }\n    if (startHidden.hidden == true || endHidden.hidden == true) {\n      body.range._applyRange(rangeStart, rangeEnd);\n    }\n  }\n}\n\n/**\n * remove duplicates from the hidden dates list. Duplicates are evil. They mess everything up.\n * Scales with N^2\n *\n * @param {Object} body\n */\nexport function removeDuplicates(body) {\n  const hiddenDates = body.hiddenDates;\n  const safeDates = [];\n  for (var i = 0; i < hiddenDates.length; i++) {\n    for (let j = 0; j < hiddenDates.length; j++) {\n      if (\n        i != j &&\n        hiddenDates[j].remove != true &&\n        hiddenDates[i].remove != true\n      ) {\n        // j inside i\n        if (\n          hiddenDates[j].start >= hiddenDates[i].start &&\n          hiddenDates[j].end <= hiddenDates[i].end\n        ) {\n          hiddenDates[j].remove = true;\n        }\n        // j start inside i\n        else if (\n          hiddenDates[j].start >= hiddenDates[i].start &&\n          hiddenDates[j].start <= hiddenDates[i].end\n        ) {\n          hiddenDates[i].end = hiddenDates[j].end;\n          hiddenDates[j].remove = true;\n        }\n        // j end inside i\n        else if (\n          hiddenDates[j].end >= hiddenDates[i].start &&\n          hiddenDates[j].end <= hiddenDates[i].end\n        ) {\n          hiddenDates[i].start = hiddenDates[j].start;\n          hiddenDates[j].remove = true;\n        }\n      }\n    }\n  }\n\n  for (i = 0; i < hiddenDates.length; i++) {\n    if (hiddenDates[i].remove !== true) {\n      safeDates.push(hiddenDates[i]);\n    }\n  }\n\n  body.hiddenDates = safeDates;\n  body.hiddenDates.sort((a, b) => a.start - b.start); // sort by start time\n}\n\n/**\n * Prints dates to console\n * @param {array} dates\n */\nexport function printDates(dates) {\n  for (let i = 0; i < dates.length; i++) {\n    console.log(\n      i,\n      new Date(dates[i].start),\n      new Date(dates[i].end),\n      dates[i].start,\n      dates[i].end,\n      dates[i].remove,\n    );\n  }\n}\n\n/**\n * Used in TimeStep to avoid the hidden times.\n * @param {function} moment\n * @param {TimeStep} timeStep\n * @param {Date} previousTime\n */\nexport function stepOverHiddenDates(moment, timeStep, previousTime) {\n  let stepInHidden = false;\n  const currentValue = timeStep.current.valueOf();\n  for (let i = 0; i < timeStep.hiddenDates.length; i++) {\n    const startDate = timeStep.hiddenDates[i].start;\n    var endDate = timeStep.hiddenDates[i].end;\n    if (currentValue >= startDate && currentValue < endDate) {\n      stepInHidden = true;\n      break;\n    }\n  }\n\n  if (\n    stepInHidden == true &&\n    currentValue < timeStep._end.valueOf() &&\n    currentValue != previousTime\n  ) {\n    const prevValue = moment(previousTime);\n    const newValue = moment(endDate);\n    //check if the next step should be major\n    if (prevValue.year() != newValue.year()) {\n      timeStep.switchedYear = true;\n    } else if (prevValue.month() != newValue.month()) {\n      timeStep.switchedMonth = true;\n    } else if (prevValue.dayOfYear() != newValue.dayOfYear()) {\n      timeStep.switchedDay = true;\n    }\n\n    timeStep.current = newValue;\n  }\n}\n\n///**\n// * Used in TimeStep to avoid the hidden times.\n// * @param timeStep\n// * @param previousTime\n// */\n//checkFirstStep = function(timeStep) {\n//  var stepInHidden = false;\n//  var currentValue = timeStep.current.valueOf();\n//  for (var i = 0; i < timeStep.hiddenDates.length; i++) {\n//    var startDate = timeStep.hiddenDates[i].start;\n//    var endDate = timeStep.hiddenDates[i].end;\n//    if (currentValue >= startDate && currentValue < endDate) {\n//      stepInHidden = true;\n//      break;\n//    }\n//  }\n//\n//  if (stepInHidden == true && currentValue <= timeStep._end.valueOf()) {\n//    var newValue = moment(endDate);\n//    timeStep.current = newValue.toDate();\n//  }\n//};\n\n/**\n * replaces the Core toScreen methods\n *\n * @param {timeline.Core} Core\n * @param {Date} time\n * @param {number} width\n * @returns {number}\n */\nexport function toScreen(Core, time, width) {\n  let conversion;\n  if (Core.body.hiddenDates.length == 0) {\n    conversion = Core.range.conversion(width);\n    return (time.valueOf() - conversion.offset) * conversion.scale;\n  } else {\n    const hidden = getIsHidden(time, Core.body.hiddenDates);\n    if (hidden.hidden == true) {\n      time = hidden.startDate;\n    }\n\n    const duration = getHiddenDurationBetween(\n      Core.body.hiddenDates,\n      Core.range.start,\n      Core.range.end,\n    );\n    if (time < Core.range.start) {\n      conversion = Core.range.conversion(width, duration);\n      const hiddenBeforeStart = getHiddenDurationBeforeStart(\n        Core.body.hiddenDates,\n        time,\n        conversion.offset,\n      );\n      time = Core.options.moment(time).toDate().valueOf();\n      time = time + hiddenBeforeStart;\n      return -(conversion.offset - time.valueOf()) * conversion.scale;\n    } else if (time > Core.range.end) {\n      const rangeAfterEnd = { start: Core.range.start, end: time };\n      time = correctTimeForHidden(\n        Core.options.moment,\n        Core.body.hiddenDates,\n        rangeAfterEnd,\n        time,\n      );\n      conversion = Core.range.conversion(width, duration);\n      return (time.valueOf() - conversion.offset) * conversion.scale;\n    } else {\n      time = correctTimeForHidden(\n        Core.options.moment,\n        Core.body.hiddenDates,\n        Core.range,\n        time,\n      );\n      conversion = Core.range.conversion(width, duration);\n      return (time.valueOf() - conversion.offset) * conversion.scale;\n    }\n  }\n}\n\n/**\n * Replaces the core toTime methods\n *\n * @param {timeline.Core} Core\n * @param {number} x\n * @param {number} width\n * @returns {Date}\n */\nexport function toTime(Core, x, width) {\n  if (Core.body.hiddenDates.length == 0) {\n    const conversion = Core.range.conversion(width);\n    return new Date(x / conversion.scale + conversion.offset);\n  } else {\n    const hiddenDuration = getHiddenDurationBetween(\n      Core.body.hiddenDates,\n      Core.range.start,\n      Core.range.end,\n    );\n    const totalDuration = Core.range.end - Core.range.start - hiddenDuration;\n    const partialDuration = (totalDuration * x) / width;\n    const accumulatedHiddenDuration = getAccumulatedHiddenDuration(\n      Core.body.hiddenDates,\n      Core.range,\n      partialDuration,\n    );\n\n    return new Date(\n      accumulatedHiddenDuration + partialDuration + Core.range.start,\n    );\n  }\n}\n\n/**\n * Support function\n *\n * @param {Array.<{start: Window.start, end: *}>} hiddenDates\n * @param {number} start\n * @param {number} end\n * @returns {number}\n */\nexport function getHiddenDurationBetween(hiddenDates, start, end) {\n  let duration = 0;\n  for (let i = 0; i < hiddenDates.length; i++) {\n    const startDate = hiddenDates[i].start;\n    const endDate = hiddenDates[i].end;\n    // if time after the cutout, and the\n    if (startDate >= start && endDate < end) {\n      duration += endDate - startDate;\n    }\n  }\n  return duration;\n}\n\n/**\n * Support function\n *\n * @param {Array.<{start: Window.start, end: *}>} hiddenDates\n * @param {number} start\n * @param {number} end\n * @returns {number}\n */\nexport function getHiddenDurationBeforeStart(hiddenDates, start, end) {\n  let duration = 0;\n  for (let i = 0; i < hiddenDates.length; i++) {\n    const startDate = hiddenDates[i].start;\n    const endDate = hiddenDates[i].end;\n\n    if (startDate >= start && endDate <= end) {\n      duration += endDate - startDate;\n    }\n  }\n  return duration;\n}\n\n/**\n * Support function\n * @param {function} moment\n * @param {Array.<{start: Window.start, end: *}>} hiddenDates\n * @param {{start: number, end: number}} range\n * @param {Date} time\n * @returns {number}\n */\nexport function correctTimeForHidden(moment, hiddenDates, range, time) {\n  time = moment(time).toDate().valueOf();\n  time -= getHiddenDurationBefore(moment, hiddenDates, range, time);\n  return time;\n}\n\n/**\n * Support function\n * @param {function} moment\n * @param {Array.<{start: Window.start, end: *}>} hiddenDates\n * @param {{start: number, end: number}} range\n * @param {Date} time\n * @returns {number}\n */\nexport function getHiddenDurationBefore(moment, hiddenDates, range, time) {\n  let timeOffset = 0;\n  time = moment(time).toDate().valueOf();\n\n  for (let i = 0; i < hiddenDates.length; i++) {\n    const startDate = hiddenDates[i].start;\n    const endDate = hiddenDates[i].end;\n    // if time after the cutout, and the\n    if (startDate >= range.start && endDate < range.end) {\n      if (time >= endDate) {\n        timeOffset += endDate - startDate;\n      }\n    }\n  }\n  return timeOffset;\n}\n\n/**\n * sum the duration from start to finish, including the hidden duration,\n * until the required amount has been reached, return the accumulated hidden duration\n * @param {Array.<{start: Window.start, end: *}>} hiddenDates\n * @param {{start: number, end: number}} range\n * @param {number} [requiredDuration=0]\n * @returns {number}\n */\nexport function getAccumulatedHiddenDuration(\n  hiddenDates,\n  range,\n  requiredDuration,\n) {\n  let hiddenDuration = 0;\n  let duration = 0;\n  let previousPoint = range.start;\n  //printDates(hiddenDates)\n  for (let i = 0; i < hiddenDates.length; i++) {\n    const startDate = hiddenDates[i].start;\n    const endDate = hiddenDates[i].end;\n    // if time after the cutout, and the\n    if (startDate >= range.start && endDate < range.end) {\n      duration += startDate - previousPoint;\n      previousPoint = endDate;\n      if (duration >= requiredDuration) {\n        break;\n      } else {\n        hiddenDuration += endDate - startDate;\n      }\n    }\n  }\n\n  return hiddenDuration;\n}\n\n/**\n * used to step over to either side of a hidden block. Correction is disabled on tablets, might be set to true\n * @param {Array.<{start: Window.start, end: *}>} hiddenDates\n * @param {Date} time\n * @param {number} direction\n * @param {boolean} correctionEnabled\n * @returns {Date|number}\n */\nexport function snapAwayFromHidden(\n  hiddenDates,\n  time,\n  direction,\n  correctionEnabled,\n) {\n  const isHidden = getIsHidden(time, hiddenDates);\n  if (isHidden.hidden == true) {\n    if (direction < 0) {\n      if (correctionEnabled == true) {\n        return isHidden.startDate - (isHidden.endDate - time) - 1;\n      } else {\n        return isHidden.startDate - 1;\n      }\n    } else {\n      if (correctionEnabled == true) {\n        return isHidden.endDate + (time - isHidden.startDate) + 1;\n      } else {\n        return isHidden.endDate + 1;\n      }\n    }\n  } else {\n    return time;\n  }\n}\n\n/**\n * Check if a time is hidden\n *\n * @param {Date} time\n * @param {Array.<{start: Window.start, end: *}>} hiddenDates\n * @returns {{hidden: boolean, startDate: Window.start, endDate: *}}\n */\nexport function getIsHidden(time, hiddenDates) {\n  for (let i = 0; i < hiddenDates.length; i++) {\n    var startDate = hiddenDates[i].start;\n    var endDate = hiddenDates[i].end;\n\n    if (time >= startDate && time < endDate) {\n      // if the start is entering a hidden zone\n      return { hidden: true, startDate, endDate };\n    }\n  }\n  return { hidden: false, startDate, endDate };\n}\n","import util from \"../util.js\";\nimport moment from \"../module/moment.js\";\nimport Component from \"./component/Component.js\";\nimport * as DateUtil from \"./DateUtil.js\";\n\n/**\n * A Range controls a numeric range with a start and end value.\n * The Range adjusts the range based on mouse events or programmatic changes,\n * and triggers events when the range is changing or has been changed.\n */\nexport default class Range extends Component {\n  /**\n   * @param {{dom: Object, domProps: Object, emitter: Emitter}} body\n   * @param {Object} [options]    See description at Range.setOptions\n   * @constructor Range\n   * @extends Component\n   */\n  constructor(body, options) {\n    super();\n    const now = moment().hours(0).minutes(0).seconds(0).milliseconds(0);\n    const start = now.clone().add(-3, \"days\").valueOf();\n    const end = now.clone().add(3, \"days\").valueOf();\n    this.millisecondsPerPixelCache = undefined;\n\n    if (options === undefined) {\n      this.start = start;\n      this.end = end;\n    } else {\n      this.start = options.start || start;\n      this.end = options.end || end;\n    }\n\n    this.rolling = false;\n\n    this.body = body;\n    this.deltaDifference = 0;\n    this.scaleOffset = 0;\n    this.startToFront = false;\n    this.endToFront = true;\n\n    // default options\n    this.defaultOptions = {\n      rtl: false,\n      start: null,\n      end: null,\n      moment,\n      direction: \"horizontal\", // 'horizontal' or 'vertical'\n      moveable: true,\n      zoomable: true,\n      min: null,\n      max: null,\n      zoomMin: 10, // milliseconds\n      zoomMax: 1000 * 60 * 60 * 24 * 365 * 10000, // milliseconds\n      rollingMode: {\n        follow: false,\n        offset: 0.5,\n      },\n    };\n    this.options = util.extend({}, this.defaultOptions);\n    this.props = {\n      touch: {},\n    };\n    this.animationTimer = null;\n\n    // drag listeners for dragging\n    this.body.emitter.on(\"panstart\", this._onDragStart.bind(this));\n    this.body.emitter.on(\"panmove\", this._onDrag.bind(this));\n    this.body.emitter.on(\"panend\", this._onDragEnd.bind(this));\n\n    // mouse wheel for zooming\n    this.body.emitter.on(\"mousewheel\", this._onMouseWheel.bind(this));\n\n    // pinch to zoom\n    this.body.emitter.on(\"touch\", this._onTouch.bind(this));\n    this.body.emitter.on(\"pinch\", this._onPinch.bind(this));\n\n    // on click of rolling mode button\n    this.body.dom.rollingModeBtn.addEventListener(\n      \"click\",\n      this.startRolling.bind(this),\n    );\n\n    this.setOptions(options);\n  }\n\n  /**\n   * Set options for the range controller\n   * @param {Object} options      Available options:\n   *                              {number | Date | String} start  Start date for the range\n   *                              {number | Date | String} end    End date for the range\n   *                              {number} min    Minimum value for start\n   *                              {number} max    Maximum value for end\n   *                              {number} zoomMin    Set a minimum value for\n   *                                                  (end - start).\n   *                              {number} zoomMax    Set a maximum value for\n   *                                                  (end - start).\n   *                              {boolean} moveable Enable moving of the range\n   *                                                 by dragging. True by default\n   *                              {boolean} zoomable Enable zooming of the range\n   *                                                 by pinching/scrolling. True by default\n   */\n  setOptions(options) {\n    if (options) {\n      // copy the options that we know\n      const fields = [\n        \"animation\",\n        \"direction\",\n        \"min\",\n        \"max\",\n        \"zoomMin\",\n        \"zoomMax\",\n        \"moveable\",\n        \"zoomable\",\n        \"moment\",\n        \"activate\",\n        \"hiddenDates\",\n        \"zoomKey\",\n        \"zoomFriction\",\n        \"rtl\",\n        \"showCurrentTime\",\n        \"rollingMode\",\n        \"horizontalScroll\",\n        \"horizontalScrollKey\",\n        \"horizontalScrollInvert\",\n        \"verticalScroll\",\n      ];\n      util.selectiveExtend(fields, this.options, options);\n\n      if (options.rollingMode && options.rollingMode.follow) {\n        this.startRolling();\n      }\n      if (\"start\" in options || \"end\" in options) {\n        // apply a new range. both start and end are optional\n        this.setRange(options.start, options.end);\n      }\n    }\n  }\n\n  /**\n   * Start auto refreshing the current time bar\n   */\n  startRolling() {\n    const me = this;\n\n    /**\n     *  Updates the current time.\n     */\n    function update() {\n      me.stopRolling();\n      me.rolling = true;\n\n      let interval = me.end - me.start;\n      const t = util.convert(new Date(), \"Date\").valueOf();\n      const rollingModeOffset =\n        (me.options.rollingMode && me.options.rollingMode.offset) || 0.5;\n\n      const start = t - interval * rollingModeOffset;\n      const end = t + interval * (1 - rollingModeOffset);\n\n      const options = {\n        animation: false,\n      };\n      me.setRange(start, end, options);\n\n      // determine interval to refresh\n      const scale = me.conversion(me.body.domProps.center.width).scale;\n      interval = 1 / scale / 10;\n      if (interval < 30) interval = 30;\n      if (interval > 1000) interval = 1000;\n\n      me.body.dom.rollingModeBtn.style.visibility = \"hidden\";\n      // start a renderTimer to adjust for the new time\n      me.currentTimeTimer = setTimeout(update, interval);\n    }\n\n    update();\n  }\n\n  /**\n   * Stop auto refreshing the current time bar\n   */\n  stopRolling() {\n    if (this.currentTimeTimer !== undefined) {\n      clearTimeout(this.currentTimeTimer);\n      this.rolling = false;\n      this.body.dom.rollingModeBtn.style.visibility = \"visible\";\n    }\n  }\n\n  /**\n   * Set a new start and end range\n   * @param {Date | number | string} start\n   * @param {Date | number | string} end\n   * @param {Object} options      Available options:\n   *                              {boolean | {duration: number, easingFunction: string}} [animation=false]\n   *                                    If true, the range is animated\n   *                                    smoothly to the new window. An object can be\n   *                                    provided to specify duration and easing function.\n   *                                    Default duration is 500 ms, and default easing\n   *                                    function is 'easeInOutQuad'.\n   *                              {boolean} [byUser=false]\n   *                              {Event}  event  Mouse event\n   * @param {Function} callback     a callback function to be executed at the end of this function\n   * @param {Function} frameCallback    a callback function executed each frame of the range animation.\n   *                                    The callback will be passed three parameters:\n   *                                    {number} easeCoefficient    an easing coefficent\n   *                                    {boolean} willDraw          If true the caller will redraw after the callback completes\n   *                                    {boolean} done              If true then animation is ending after the current frame\n   * @return {void}\n   */\n  setRange(start, end, options, callback, frameCallback) {\n    if (!options) {\n      options = {};\n    }\n    if (options.byUser !== true) {\n      options.byUser = false;\n    }\n    const me = this;\n    const finalStart =\n      start != undefined ? util.convert(start, \"Date\").valueOf() : null;\n    const finalEnd =\n      end != undefined ? util.convert(end, \"Date\").valueOf() : null;\n    this._cancelAnimation();\n    this.millisecondsPerPixelCache = undefined;\n\n    if (options.animation) {\n      // true or an Object\n      const initStart = this.start;\n      const initEnd = this.end;\n      const duration =\n        typeof options.animation === \"object\" && \"duration\" in options.animation\n          ? options.animation.duration\n          : 500;\n      const easingName =\n        typeof options.animation === \"object\" &&\n        \"easingFunction\" in options.animation\n          ? options.animation.easingFunction\n          : \"easeInOutQuad\";\n      const easingFunction = util.easingFunctions[easingName];\n      if (!easingFunction) {\n        throw new Error(\n          `Unknown easing function ${JSON.stringify(easingName)}. Choose from: ${Object.keys(util.easingFunctions).join(\", \")}`,\n        );\n      }\n\n      const initTime = Date.now();\n      let anyChanged = false;\n\n      const next = () => {\n        if (!me.props.touch.dragging) {\n          const now = Date.now();\n          const time = now - initTime;\n          const ease = easingFunction(time / duration);\n          const done = time > duration;\n          const s =\n            done || finalStart === null\n              ? finalStart\n              : initStart + (finalStart - initStart) * ease;\n          const e =\n            done || finalEnd === null\n              ? finalEnd\n              : initEnd + (finalEnd - initEnd) * ease;\n\n          changed = me._applyRange(s, e);\n          DateUtil.updateHiddenDates(\n            me.options.moment,\n            me.body,\n            me.options.hiddenDates,\n          );\n          anyChanged = anyChanged || changed;\n\n          const params = {\n            start: new Date(me.start),\n            end: new Date(me.end),\n            byUser: options.byUser,\n            event: options.event,\n          };\n\n          if (frameCallback) {\n            frameCallback(ease, changed, done);\n          }\n\n          if (changed) {\n            me.body.emitter.emit(\"rangechange\", params);\n          }\n\n          if (done) {\n            if (anyChanged) {\n              me.body.emitter.emit(\"rangechanged\", params);\n              if (callback) {\n                return callback();\n              }\n            }\n          } else {\n            // animate with as high as possible frame rate, leave 20 ms in between\n            // each to prevent the browser from blocking\n            me.animationTimer = setTimeout(next, 20);\n          }\n        }\n      };\n\n      return next();\n    } else {\n      var changed = this._applyRange(finalStart, finalEnd);\n      DateUtil.updateHiddenDates(\n        this.options.moment,\n        this.body,\n        this.options.hiddenDates,\n      );\n      if (changed) {\n        const params = {\n          start: new Date(this.start),\n          end: new Date(this.end),\n          byUser: options.byUser,\n          event: options.event,\n        };\n\n        this.body.emitter.emit(\"rangechange\", params);\n        clearTimeout(me.timeoutID);\n        me.timeoutID = setTimeout(() => {\n          me.body.emitter.emit(\"rangechanged\", params);\n        }, 200);\n        if (callback) {\n          return callback();\n        }\n      }\n    }\n  }\n\n  /**\n   * Get the number of milliseconds per pixel.\n   *\n   * @returns {undefined|number}\n   */\n  getMillisecondsPerPixel() {\n    if (this.millisecondsPerPixelCache === undefined) {\n      this.millisecondsPerPixelCache =\n        (this.end - this.start) / this.body.dom.center.clientWidth;\n    }\n    return this.millisecondsPerPixelCache;\n  }\n\n  /**\n   * Stop an animation\n   * @private\n   */\n  _cancelAnimation() {\n    if (this.animationTimer) {\n      clearTimeout(this.animationTimer);\n      this.animationTimer = null;\n    }\n  }\n\n  /**\n   * Set a new start and end range. This method is the same as setRange, but\n   * does not trigger a range change and range changed event, and it returns\n   * true when the range is changed\n   * @param {number} [start]\n   * @param {number} [end]\n   * @return {boolean} changed\n   * @private\n   */\n  _applyRange(start, end) {\n    let newStart =\n      start != null ? util.convert(start, \"Date\").valueOf() : this.start;\n    let newEnd = end != null ? util.convert(end, \"Date\").valueOf() : this.end;\n    const max =\n      this.options.max != null\n        ? util.convert(this.options.max, \"Date\").valueOf()\n        : null;\n    const min =\n      this.options.min != null\n        ? util.convert(this.options.min, \"Date\").valueOf()\n        : null;\n    let diff;\n\n    // check for valid number\n    if (isNaN(newStart) || newStart === null) {\n      throw new Error(`Invalid start \"${start}\"`);\n    }\n    if (isNaN(newEnd) || newEnd === null) {\n      throw new Error(`Invalid end \"${end}\"`);\n    }\n\n    // prevent end < start\n    if (newEnd < newStart) {\n      newEnd = newStart;\n    }\n\n    // prevent start < min\n    if (min !== null) {\n      if (newStart < min) {\n        diff = min - newStart;\n        newStart += diff;\n        newEnd += diff;\n\n        // prevent end > max\n        if (max != null) {\n          if (newEnd > max) {\n            newEnd = max;\n          }\n        }\n      }\n    }\n\n    // prevent end > max\n    if (max !== null) {\n      if (newEnd > max) {\n        diff = newEnd - max;\n        newStart -= diff;\n        newEnd -= diff;\n\n        // prevent start < min\n        if (min != null) {\n          if (newStart < min) {\n            newStart = min;\n          }\n        }\n      }\n    }\n\n    // prevent (end-start) < zoomMin\n    if (this.options.zoomMin !== null) {\n      let zoomMin = parseFloat(this.options.zoomMin);\n      if (zoomMin < 0) {\n        zoomMin = 0;\n      }\n      if (newEnd - newStart < zoomMin) {\n        // compensate for a scale of 0.5 ms\n        const compensation = 0.5;\n        if (\n          this.end - this.start === zoomMin &&\n          newStart >= this.start - compensation &&\n          newEnd <= this.end\n        ) {\n          // ignore this action, we are already zoomed to the minimum\n          newStart = this.start;\n          newEnd = this.end;\n        } else {\n          // zoom to the minimum\n          diff = zoomMin - (newEnd - newStart);\n          newStart -= diff / 2;\n          newEnd += diff / 2;\n        }\n      }\n    }\n\n    // prevent (end-start) > zoomMax\n    if (this.options.zoomMax !== null) {\n      let zoomMax = parseFloat(this.options.zoomMax);\n      if (zoomMax < 0) {\n        zoomMax = 0;\n      }\n\n      if (newEnd - newStart > zoomMax) {\n        if (\n          this.end - this.start === zoomMax &&\n          newStart < this.start &&\n          newEnd > this.end\n        ) {\n          // ignore this action, we are already zoomed to the maximum\n          newStart = this.start;\n          newEnd = this.end;\n        } else {\n          // zoom to the maximum\n          diff = newEnd - newStart - zoomMax;\n          newStart += diff / 2;\n          newEnd -= diff / 2;\n        }\n      }\n    }\n\n    const changed = this.start != newStart || this.end != newEnd;\n\n    // if the new range does NOT overlap with the old range, emit checkRangedItems to avoid not showing ranged items (ranged meaning has end time, not necessarily of type Range)\n    if (\n      !(\n        (newStart >= this.start && newStart <= this.end) ||\n        (newEnd >= this.start && newEnd <= this.end)\n      ) &&\n      !(\n        (this.start >= newStart && this.start <= newEnd) ||\n        (this.end >= newStart && this.end <= newEnd)\n      )\n    ) {\n      this.body.emitter.emit(\"checkRangedItems\");\n    }\n\n    this.start = newStart;\n    this.end = newEnd;\n    return changed;\n  }\n\n  /**\n   * Retrieve the current range.\n   * @return {Object} An object with start and end properties\n   */\n  getRange() {\n    return {\n      start: this.start,\n      end: this.end,\n    };\n  }\n\n  /**\n   * Calculate the conversion offset and scale for current range, based on\n   * the provided width\n   * @param {number} width\n   * @param {number} [totalHidden=0]\n   * @returns {{offset: number, scale: number}} conversion\n   */\n  conversion(width, totalHidden) {\n    return Range.conversion(this.start, this.end, width, totalHidden);\n  }\n\n  /**\n   * Static method to calculate the conversion offset and scale for a range,\n   * based on the provided start, end, and width\n   * @param {number} start\n   * @param {number} end\n   * @param {number} width\n   * @param {number} [totalHidden=0]\n   * @returns {{offset: number, scale: number}} conversion\n   */\n  static conversion(start, end, width, totalHidden) {\n    if (totalHidden === undefined) {\n      totalHidden = 0;\n    }\n    if (width != 0 && end - start != 0) {\n      return {\n        offset: start,\n        scale: width / (end - start - totalHidden),\n      };\n    } else {\n      return {\n        offset: 0,\n        scale: 1,\n      };\n    }\n  }\n\n  /**\n   * Start dragging horizontally or vertically\n   * @param {Event} event\n   * @private\n   */\n  _onDragStart(event) {\n    this.deltaDifference = 0;\n    this.previousDelta = 0;\n\n    // only allow dragging when configured as movable\n    if (!this.options.moveable) return;\n\n    // only start dragging when the mouse is inside the current range\n    if (!this._isInsideRange(event)) return;\n\n    // refuse to drag when we where pinching to prevent the timeline make a jump\n    // when releasing the fingers in opposite order from the touch screen\n    if (!this.props.touch.allowDragging) return;\n\n    this.stopRolling();\n\n    this.props.touch.start = this.start;\n    this.props.touch.end = this.end;\n    this.props.touch.dragging = true;\n\n    if (this.body.dom.root) {\n      this.body.dom.root.style.cursor = \"move\";\n    }\n  }\n\n  /**\n   * Perform dragging operation\n   * @param {Event} event\n   * @private\n   */\n  _onDrag(event) {\n    if (!event) return;\n\n    if (!this.props.touch.dragging) return;\n\n    // only allow dragging when configured as movable\n    if (!this.options.moveable) return;\n\n    // TODO: this may be redundant in hammerjs2\n    // refuse to drag when we where pinching to prevent the timeline make a jump\n    // when releasing the fingers in opposite order from the touch screen\n    if (!this.props.touch.allowDragging) return;\n\n    const direction = this.options.direction;\n    validateDirection(direction);\n    let delta = direction == \"horizontal\" ? event.deltaX : event.deltaY;\n    delta -= this.deltaDifference;\n    let interval = this.props.touch.end - this.props.touch.start;\n\n    // normalize dragging speed if cutout is in between.\n    const duration = DateUtil.getHiddenDurationBetween(\n      this.body.hiddenDates,\n      this.start,\n      this.end,\n    );\n    interval -= duration;\n\n    const width =\n      direction == \"horizontal\"\n        ? this.body.domProps.center.width\n        : this.body.domProps.center.height;\n    let diffRange;\n    if (this.options.rtl) {\n      diffRange = (delta / width) * interval;\n    } else {\n      diffRange = (-delta / width) * interval;\n    }\n\n    const newStart = this.props.touch.start + diffRange;\n    const newEnd = this.props.touch.end + diffRange;\n\n    // snapping times away from hidden zones\n    const safeStart = DateUtil.snapAwayFromHidden(\n      this.body.hiddenDates,\n      newStart,\n      this.previousDelta - delta,\n      true,\n    );\n    const safeEnd = DateUtil.snapAwayFromHidden(\n      this.body.hiddenDates,\n      newEnd,\n      this.previousDelta - delta,\n      true,\n    );\n    if (safeStart != newStart || safeEnd != newEnd) {\n      this.deltaDifference += delta;\n      this.props.touch.start = safeStart;\n      this.props.touch.end = safeEnd;\n      this._onDrag(event);\n      return;\n    }\n\n    this.previousDelta = delta;\n    this._applyRange(newStart, newEnd);\n\n    const startDate = new Date(this.start);\n    const endDate = new Date(this.end);\n\n    // fire a rangechange event\n    this.body.emitter.emit(\"rangechange\", {\n      start: startDate,\n      end: endDate,\n      byUser: true,\n      event,\n    });\n\n    // fire a panmove event\n    this.body.emitter.emit(\"panmove\");\n  }\n\n  /**\n   * Stop dragging operation\n   * @param {event} event\n   * @private\n   */\n  _onDragEnd(event) {\n    if (!this.props.touch.dragging) return;\n\n    // only allow dragging when configured as movable\n    if (!this.options.moveable) return;\n\n    // TODO: this may be redundant in hammerjs2\n    // refuse to drag when we where pinching to prevent the timeline make a jump\n    // when releasing the fingers in opposite order from the touch screen\n    if (!this.props.touch.allowDragging) return;\n\n    this.props.touch.dragging = false;\n    if (this.body.dom.root) {\n      this.body.dom.root.style.cursor = \"auto\";\n    }\n\n    // fire a rangechanged event\n    this.body.emitter.emit(\"rangechanged\", {\n      start: new Date(this.start),\n      end: new Date(this.end),\n      byUser: true,\n      event,\n    });\n  }\n\n  /**\n   * Event handler for mouse wheel event, used to zoom\n   * Code from http://adomas.org/javascript-mouse-wheel/\n   * @param {Event} event\n   * @private\n   */\n  _onMouseWheel(event) {\n    // retrieve delta\n    let delta = 0;\n    if (event.wheelDelta) {\n      /* IE/Opera. */\n      delta = event.wheelDelta / 120;\n    } else if (event.detail) {\n      /* Mozilla case. */\n      // In Mozilla, sign of delta is different than in IE.\n      // Also, delta is multiple of 3.\n      delta = -event.detail / 3;\n    } else if (event.deltaY) {\n      delta = -event.deltaY / 3;\n    }\n\n    // don't allow zoom when the according key is pressed and the zoomKey option or not zoomable but movable\n    if (\n      (this.options.zoomKey &&\n        !event[this.options.zoomKey] &&\n        this.options.zoomable) ||\n      (!this.options.zoomable && this.options.moveable)\n    ) {\n      return;\n    }\n\n    // only allow zooming when configured as zoomable and moveable\n    if (!(this.options.zoomable && this.options.moveable)) return;\n\n    // only zoom when the mouse is inside the current range\n    if (!this._isInsideRange(event)) return;\n\n    // If delta is nonzero, handle it.\n    // Basically, delta is now positive if wheel was scrolled up,\n    // and negative, if wheel was scrolled down.\n    if (delta) {\n      // perform the zoom action. Delta is normally 1 or -1\n\n      // adjust a negative delta such that zooming in with delta 0.1\n      // equals zooming out with a delta -0.1\n\n      const zoomFriction = this.options.zoomFriction || 5;\n      let scale;\n      if (delta < 0) {\n        scale = 1 - delta / zoomFriction;\n      } else {\n        scale = 1 / (1 + delta / zoomFriction);\n      }\n\n      // calculate center, the date to zoom around\n      let pointerDate;\n      if (this.rolling) {\n        const rollingModeOffset =\n          (this.options.rollingMode && this.options.rollingMode.offset) || 0.5;\n        pointerDate = this.start + (this.end - this.start) * rollingModeOffset;\n      } else {\n        const pointer = this.getPointer(\n          { x: event.clientX, y: event.clientY },\n          this.body.dom.center,\n        );\n        pointerDate = this._pointerToDate(pointer);\n      }\n      this.zoom(scale, pointerDate, delta, event);\n\n      // Prevent default actions caused by mouse wheel\n      // (else the page and timeline both scroll)\n      event.preventDefault();\n    }\n  }\n\n  /**\n   * Start of a touch gesture\n   * @param {Event} event\n   * @private\n   */\n  _onTouch(event) {\n    // eslint-disable-line no-unused-vars\n    this.props.touch.start = this.start;\n    this.props.touch.end = this.end;\n    this.props.touch.allowDragging = true;\n    this.props.touch.center = null;\n    this.props.touch.centerDate = null;\n    this.scaleOffset = 0;\n    this.deltaDifference = 0;\n    // Disable the browser default handling of this event.\n    util.preventDefault(event);\n  }\n\n  /**\n   * Handle pinch event\n   * @param {Event} event\n   * @private\n   */\n  _onPinch(event) {\n    // only allow zooming when configured as zoomable and moveable\n    if (!(this.options.zoomable && this.options.moveable)) return;\n\n    // Disable the browser default handling of this event.\n    util.preventDefault(event);\n\n    this.props.touch.allowDragging = false;\n\n    if (!this.props.touch.center) {\n      this.props.touch.center = this.getPointer(\n        event.center,\n        this.body.dom.center,\n      );\n      this.props.touch.centerDate = this._pointerToDate(\n        this.props.touch.center,\n      );\n    }\n\n    this.stopRolling();\n    const scale = 1 / (event.scale + this.scaleOffset);\n    const centerDate = this.props.touch.centerDate;\n\n    const hiddenDuration = DateUtil.getHiddenDurationBetween(\n      this.body.hiddenDates,\n      this.start,\n      this.end,\n    );\n    const hiddenDurationBefore = DateUtil.getHiddenDurationBefore(\n      this.options.moment,\n      this.body.hiddenDates,\n      this,\n      centerDate,\n    );\n    const hiddenDurationAfter = hiddenDuration - hiddenDurationBefore;\n\n    // calculate new start and end\n    let newStart =\n      centerDate -\n      hiddenDurationBefore +\n      (this.props.touch.start - (centerDate - hiddenDurationBefore)) * scale;\n    let newEnd =\n      centerDate +\n      hiddenDurationAfter +\n      (this.props.touch.end - (centerDate + hiddenDurationAfter)) * scale;\n\n    // snapping times away from hidden zones\n    this.startToFront = 1 - scale <= 0; // used to do the right auto correction with periodic hidden times\n    this.endToFront = scale - 1 <= 0; // used to do the right auto correction with periodic hidden times\n\n    const safeStart = DateUtil.snapAwayFromHidden(\n      this.body.hiddenDates,\n      newStart,\n      1 - scale,\n      true,\n    );\n    const safeEnd = DateUtil.snapAwayFromHidden(\n      this.body.hiddenDates,\n      newEnd,\n      scale - 1,\n      true,\n    );\n    if (safeStart != newStart || safeEnd != newEnd) {\n      this.props.touch.start = safeStart;\n      this.props.touch.end = safeEnd;\n      this.scaleOffset = 1 - event.scale;\n      newStart = safeStart;\n      newEnd = safeEnd;\n    }\n\n    const options = {\n      animation: false,\n      byUser: true,\n      event,\n    };\n    this.setRange(newStart, newEnd, options);\n\n    this.startToFront = false; // revert to default\n    this.endToFront = true; // revert to default\n  }\n\n  /**\n   * Test whether the mouse from a mouse event is inside the visible window,\n   * between the current start and end date\n   * @param {Object} event\n   * @return {boolean} Returns true when inside the visible window\n   * @private\n   */\n  _isInsideRange(event) {\n    // calculate the time where the mouse is, check whether inside\n    // and no scroll action should happen.\n    const clientX = event.center ? event.center.x : event.clientX;\n    const centerContainerRect =\n      this.body.dom.centerContainer.getBoundingClientRect();\n    const x = this.options.rtl\n      ? clientX - centerContainerRect.left\n      : centerContainerRect.right - clientX;\n    const time = this.body.util.toTime(x);\n\n    return time >= this.start && time <= this.end;\n  }\n\n  /**\n   * Helper function to calculate the center date for zooming\n   * @param {{x: number, y: number}} pointer\n   * @return {number} date\n   * @private\n   */\n  _pointerToDate(pointer) {\n    let conversion;\n    const direction = this.options.direction;\n\n    validateDirection(direction);\n\n    if (direction == \"horizontal\") {\n      return this.body.util.toTime(pointer.x).valueOf();\n    } else {\n      const height = this.body.domProps.center.height;\n      conversion = this.conversion(height);\n      return pointer.y / conversion.scale + conversion.offset;\n    }\n  }\n\n  /**\n   * Get the pointer location relative to the location of the dom element\n   * @param {{x: number, y: number}} touch\n   * @param {Element} element   HTML DOM element\n   * @return {{x: number, y: number}} pointer\n   * @private\n   */\n  getPointer(touch, element) {\n    const elementRect = element.getBoundingClientRect();\n    if (this.options.rtl) {\n      return {\n        x: elementRect.right - touch.x,\n        y: touch.y - elementRect.top,\n      };\n    } else {\n      return {\n        x: touch.x - elementRect.left,\n        y: touch.y - elementRect.top,\n      };\n    }\n  }\n\n  /**\n   * Zoom the range the given scale in or out. Start and end date will\n   * be adjusted, and the timeline will be redrawn. You can optionally give a\n   * date around which to zoom.\n   * For example, try scale = 0.9 or 1.1\n   * @param {number} scale      Scaling factor. Values above 1 will zoom out,\n   *                            values below 1 will zoom in.\n   * @param {number} [center]   Value representing a date around which will\n   *                            be zoomed.\n   * @param {number} delta\n   * @param {Event} event\n   */\n  zoom(scale, center, delta, event) {\n    // if centerDate is not provided, take it half between start Date and end Date\n    if (center == null) {\n      center = (this.start + this.end) / 2;\n    }\n\n    const hiddenDuration = DateUtil.getHiddenDurationBetween(\n      this.body.hiddenDates,\n      this.start,\n      this.end,\n    );\n    const hiddenDurationBefore = DateUtil.getHiddenDurationBefore(\n      this.options.moment,\n      this.body.hiddenDates,\n      this,\n      center,\n    );\n    const hiddenDurationAfter = hiddenDuration - hiddenDurationBefore;\n\n    // calculate new start and end\n    let newStart =\n      center -\n      hiddenDurationBefore +\n      (this.start - (center - hiddenDurationBefore)) * scale;\n    let newEnd =\n      center +\n      hiddenDurationAfter +\n      (this.end - (center + hiddenDurationAfter)) * scale;\n\n    // snapping times away from hidden zones\n    this.startToFront = delta > 0 ? false : true; // used to do the right autocorrection with periodic hidden times\n    this.endToFront = -delta > 0 ? false : true; // used to do the right autocorrection with periodic hidden times\n    const safeStart = DateUtil.snapAwayFromHidden(\n      this.body.hiddenDates,\n      newStart,\n      delta,\n      true,\n    );\n    const safeEnd = DateUtil.snapAwayFromHidden(\n      this.body.hiddenDates,\n      newEnd,\n      -delta,\n      true,\n    );\n    if (safeStart != newStart || safeEnd != newEnd) {\n      newStart = safeStart;\n      newEnd = safeEnd;\n    }\n\n    const options = {\n      animation: false,\n      byUser: true,\n      event,\n    };\n    this.setRange(newStart, newEnd, options);\n\n    this.startToFront = false; // revert to default\n    this.endToFront = true; // revert to default\n  }\n\n  /**\n   * Move the range with a given delta to the left or right. Start and end\n   * value will be adjusted. For example, try delta = 0.1 or -0.1\n   * @param {number}  delta     Moving amount. Positive value will move right,\n   *                            negative value will move left\n   */\n  move(delta) {\n    // zoom start Date and end Date relative to the centerDate\n    const diff = this.end - this.start;\n\n    // apply new values\n    const newStart = this.start + diff * delta;\n    const newEnd = this.end + diff * delta;\n\n    // TODO: reckon with min and max range\n\n    this.start = newStart;\n    this.end = newEnd;\n  }\n\n  /**\n   * Move the range to a new center point\n   * @param {number} moveTo      New center point of the range\n   */\n  moveTo(moveTo) {\n    const center = (this.start + this.end) / 2;\n\n    const diff = center - moveTo;\n\n    // calculate new start and end\n    const newStart = this.start - diff;\n    const newEnd = this.end - diff;\n\n    const options = {\n      animation: false,\n      byUser: true,\n      event: null,\n    };\n    this.setRange(newStart, newEnd, options);\n  }\n\n  /**\n   * Destroy the Range\n   */\n  destroy() {\n    this.stopRolling();\n  }\n}\n\n/**\n * Test whether direction has a valid value\n * @param {string} direction    'horizontal' or 'vertical'\n */\nfunction validateDirection(direction) {\n  if (direction != \"horizontal\" && direction != \"vertical\") {\n    throw new TypeError(\n      `Unknown direction \"${direction}\". Choose \"horizontal\" or \"vertical\".`,\n    );\n  }\n}\n","import PropagatingHammer from \"propagating-hammerjs\";\nimport Hammer from \"@egjs/hammerjs\";\n\n/**\n * Setup a mock hammer.js object, for unit testing.\n *\n * Inspiration: https://github.com/uber/deck.gl/pull/658\n *\n * @returns {{on: noop, off: noop, destroy: noop, emit: noop, get: get}}\n */\nfunction hammerMock() {\n  const noop = () => {};\n\n  return {\n    on: noop,\n    off: noop,\n    destroy: noop,\n    emit: noop,\n\n    get() {\n      return {\n        set: noop,\n      };\n    },\n  };\n}\n\nlet modifiedHammer;\n\nif (typeof window !== \"undefined\") {\n  const OurHammer = window[\"Hammer\"] || Hammer;\n  modifiedHammer = PropagatingHammer(OurHammer, {\n    preventDefault: \"mouse\",\n  });\n} else {\n  modifiedHammer = function () {\n    // hammer.js is only available in a browser, not in node.js. Replacing it with a mock object.\n    return hammerMock();\n  };\n}\n\nexport default modifiedHammer;\n","/**\n * Register a touch event, taking place before a gesture\n * @param {Hammer} hammer       A hammer instance\n * @param {function} callback   Callback, called as callback(event)\n */\nexport function onTouch(hammer, callback) {\n  callback.inputHandler = function (event) {\n    if (event.isFirst) {\n      callback(event);\n    }\n  };\n\n  hammer.on(\"hammer.input\", callback.inputHandler);\n}\n\n/**\n * Register a release event, taking place after a gesture\n * @param {Hammer} hammer       A hammer instance\n * @param {function} callback   Callback, called as callback(event)\n * @returns {*}\n */\nexport function onRelease(hammer, callback) {\n  callback.inputHandler = function (event) {\n    if (event.isFinal) {\n      callback(event);\n    }\n  };\n\n  return hammer.on(\"hammer.input\", callback.inputHandler);\n}\n\n/**\n * Unregister a touch event, taking place before a gesture\n * @param {Hammer} hammer       A hammer instance\n * @param {function} callback   Callback, called as callback(event)\n */\nexport function offTouch(hammer, callback) {\n  hammer.off(\"hammer.input\", callback.inputHandler);\n}\n\n/**\n * Unregister a release event, taking place before a gesture\n * @param {Hammer} hammer       A hammer instance\n * @param {function} callback   Callback, called as callback(event)\n */\n\nexport const offRelease = offTouch;\n\n/**\n * Hack the PinchRecognizer such that it doesn't prevent default behavior\n * for vertical panning.\n *\n * Yeah ... this is quite a hack ... see https://github.com/hammerjs/hammer.js/issues/932\n *\n * @param {Hammer.Pinch} pinchRecognizer\n * @return {Hammer.Pinch} returns the pinchRecognizer\n */\nexport function disablePreventDefaultVertically(pinchRecognizer) {\n  const TOUCH_ACTION_PAN_Y = \"pan-y\";\n\n  pinchRecognizer.getTouchAction = function () {\n    // default method returns [TOUCH_ACTION_NONE]\n    return [TOUCH_ACTION_PAN_Y];\n  };\n\n  return pinchRecognizer;\n}\n","import moment from \"../module/moment.js\";\nimport * as DateUtil from \"./DateUtil.js\";\nimport util from \"../util.js\";\n\n/**\n * The class TimeStep is an iterator for dates. You provide a start date and an\n * end date. The class itself determines the best scale (step size) based on the\n * provided start Date, end Date, and minimumStep.\n *\n * If minimumStep is provided, the step size is chosen as close as possible\n * to the minimumStep but larger than minimumStep. If minimumStep is not\n * provided, the scale is set to 1 DAY.\n * The minimumStep should correspond with the onscreen size of about 6 characters\n *\n * Alternatively, you can set a scale by hand.\n * After creation, you can initialize the class by executing first(). Then you\n * can iterate from the start date to the end date via next(). You can check if\n * the end date is reached with the function hasNext(). After each step, you can\n * retrieve the current date via getCurrent().\n * The TimeStep has scales ranging from milliseconds, seconds, minutes, hours,\n * days, to years.\n *\n * Version: 1.2\n *\n */\nclass TimeStep {\n  /**\n   * @param {Date} [start]         The start date, for example new Date(2010, 9, 21)\n   *                               or new Date(2010, 9, 21, 23, 45, 00)\n   * @param {Date} [end]           The end date\n   * @param {number} [minimumStep] Optional. Minimum step size in milliseconds\n   * @param {Date|Array.<Date>} [hiddenDates] Optional.\n   * @param {{showMajorLabels: boolean, showWeekScale: boolean}} [options] Optional.\n   * @constructor  TimeStep\n   */\n  constructor(start, end, minimumStep, hiddenDates, options) {\n    this.moment = (options && options.moment) || moment;\n    this.options = options ? options : {};\n\n    // variables\n    this.current = this.moment();\n    this._start = this.moment();\n    this._end = this.moment();\n\n    this.autoScale = true;\n    this.scale = \"day\";\n    this.step = 1;\n\n    // initialize the range\n    this.setRange(start, end, minimumStep);\n\n    // hidden Dates options\n    this.switchedDay = false;\n    this.switchedMonth = false;\n    this.switchedYear = false;\n    if (Array.isArray(hiddenDates)) {\n      this.hiddenDates = hiddenDates;\n    } else if (hiddenDates != undefined) {\n      this.hiddenDates = [hiddenDates];\n    } else {\n      this.hiddenDates = [];\n    }\n\n    this.format = TimeStep.FORMAT; // default formatting\n  }\n\n  /**\n   * Set custom constructor function for moment. Can be used to set dates\n   * to UTC or to set a utcOffset.\n   * @param {function} moment\n   */\n  setMoment(moment) {\n    this.moment = moment;\n\n    // update the date properties, can have a new utcOffset\n    this.current = this.moment(this.current.valueOf());\n    this._start = this.moment(this._start.valueOf());\n    this._end = this.moment(this._end.valueOf());\n  }\n\n  /**\n   * Set custom formatting for the minor an major labels of the TimeStep.\n   * Both `minorLabels` and `majorLabels` are an Object with properties:\n   * 'millisecond', 'second', 'minute', 'hour', 'weekday', 'day', 'week', 'month', 'year'.\n   * @param {{minorLabels: Object, majorLabels: Object}} format\n   */\n  setFormat(format) {\n    const defaultFormat = util.deepExtend({}, TimeStep.FORMAT);\n    this.format = util.deepExtend(defaultFormat, format);\n  }\n\n  /**\n   * Set a new range\n   * If minimumStep is provided, the step size is chosen as close as possible\n   * to the minimumStep but larger than minimumStep. If minimumStep is not\n   * provided, the scale is set to 1 DAY.\n   * The minimumStep should correspond with the onscreen size of about 6 characters\n   * @param {Date} [start]      The start date and time.\n   * @param {Date} [end]        The end date and time.\n   * @param {int} [minimumStep] Optional. Minimum step size in milliseconds\n   */\n  setRange(start, end, minimumStep) {\n    if (!(start instanceof Date) || !(end instanceof Date)) {\n      throw \"No legal start or end date in method setRange\";\n    }\n\n    this._start =\n      start != undefined ? this.moment(start.valueOf()) : Date.now();\n    this._end = end != undefined ? this.moment(end.valueOf()) : Date.now();\n\n    if (this.autoScale) {\n      this.setMinimumStep(minimumStep);\n    }\n  }\n\n  /**\n   * Set the range iterator to the start date.\n   */\n  start() {\n    this.current = this._start.clone();\n    this.roundToMinor();\n  }\n\n  /**\n   * Round the current date to the first minor date value\n   * This must be executed once when the current date is set to start Date\n   */\n  roundToMinor() {\n    // round to floor\n    // to prevent year & month scales rounding down to the first day of week we perform this separately\n    if (this.scale == \"week\") {\n      this.current.weekday(0);\n    }\n    // IMPORTANT: we have no breaks in this switch! (this is no bug)\n    // noinspection FallThroughInSwitchStatementJS\n    switch (this.scale) {\n      case \"year\":\n        this.current = this.current\n          .year(this.step * Math.floor(this.current.year() / this.step))\n          .month(0);\n      // eslint-disable-next-line no-fallthrough\n      case \"month\":\n        this.current = this.current.date(1);\n      // eslint-disable-next-line no-fallthrough\n      case \"week\":\n      case \"day\":\n      case \"weekday\":\n        this.current = this.current.hours(0);\n      // eslint-disable-next-line no-fallthrough\n      case \"hour\":\n        this.current = this.current.minutes(0);\n      // eslint-disable-next-line no-fallthrough\n      case \"minute\":\n        this.current = this.current.seconds(0);\n      // eslint-disable-next-line no-fallthrough\n      case \"second\":\n        this.current = this.current.milliseconds(0);\n      //case 'millisecond': // nothing to do for milliseconds\n    }\n\n    if (this.step != 1) {\n      // round down to the first minor value that is a multiple of the current step size\n      let priorCurrent = this.current.clone();\n      switch (this.scale) {\n        case \"millisecond\":\n          this.current = this.current.subtract(\n            this.current.milliseconds() % this.step,\n            \"milliseconds\",\n          );\n          break;\n        case \"second\":\n          this.current = this.current.subtract(\n            this.current.seconds() % this.step,\n            \"seconds\",\n          );\n          break;\n        case \"minute\":\n          this.current = this.current.subtract(\n            this.current.minutes() % this.step,\n            \"minutes\",\n          );\n          break;\n        case \"hour\":\n          this.current = this.current.subtract(\n            this.current.hours() % this.step,\n            \"hours\",\n          );\n          break;\n        case \"weekday\": // intentional fall through\n        case \"day\":\n          this.current = this.current.subtract(\n            (this.current.date() - 1) % this.step,\n            \"day\",\n          );\n          break;\n        case \"week\":\n          this.current = this.current.subtract(\n            this.current.week() % this.step,\n            \"week\",\n          );\n          break;\n        case \"month\":\n          this.current = this.current.subtract(\n            this.current.month() % this.step,\n            \"month\",\n          );\n          break;\n        case \"year\":\n          this.current = this.current.subtract(\n            this.current.year() % this.step,\n            \"year\",\n          );\n          break;\n        default:\n          break;\n      }\n      if (!priorCurrent.isSame(this.current)) {\n        this.current = this.moment(\n          DateUtil.snapAwayFromHidden(\n            this.hiddenDates,\n            this.current.valueOf(),\n            -1,\n            true,\n          ),\n        );\n      }\n    }\n  }\n\n  /**\n   * Check if the there is a next step\n   * @return {boolean}  true if the current date has not passed the end date\n   */\n  hasNext() {\n    return this.current.valueOf() <= this._end.valueOf();\n  }\n\n  /**\n   * Do the next step\n   */\n  next() {\n    const prev = this.current.valueOf();\n\n    // Two cases, needed to prevent issues with switching daylight savings\n    // (end of March and end of October)\n    switch (this.scale) {\n      case \"millisecond\":\n        this.current = this.current.add(this.step, \"millisecond\");\n        break;\n      case \"second\":\n        this.current = this.current.add(this.step, \"second\");\n        break;\n      case \"minute\":\n        this.current = this.current.add(this.step, \"minute\");\n        break;\n      case \"hour\":\n        this.current = this.current.add(this.step, \"hour\");\n\n        if (this.current.month() < 6) {\n          this.current = this.current.subtract(\n            this.current.hours() % this.step,\n            \"hour\",\n          );\n        } else {\n          if (this.current.hours() % this.step !== 0) {\n            this.current = this.current.add(\n              this.step - (this.current.hours() % this.step),\n              \"hour\",\n            );\n          }\n        }\n        break;\n      case \"weekday\": // intentional fall through\n      case \"day\":\n        this.current = this.current.add(this.step, \"day\");\n        break;\n      case \"week\":\n        if (this.current.weekday() !== 0) {\n          // we had a month break not correlating with a week's start before\n          this.current = this.current.weekday(0).add(this.step, \"week\"); // switch back to week cycles\n        } else if (this.options.showMajorLabels === false) {\n          this.current = this.current.add(this.step, \"week\"); // the default case\n        } else {\n          // first day of the week\n          const nextWeek = this.current.clone();\n          nextWeek.add(1, \"week\");\n          if (nextWeek.isSame(this.current, \"month\")) {\n            // is the first day of the next week in the same month?\n            this.current = this.current.add(this.step, \"week\"); // the default case\n          } else {\n            // inject a step at each first day of the month\n            this.current = this.current.add(this.step, \"week\").date(1);\n          }\n        }\n        break;\n      case \"month\":\n        this.current = this.current.add(this.step, \"month\");\n        break;\n      case \"year\":\n        this.current = this.current.add(this.step, \"year\");\n        break;\n      default:\n        break;\n    }\n\n    if (this.step != 1) {\n      // round down to the correct major value\n      switch (this.scale) {\n        case \"millisecond\":\n          if (\n            this.current.milliseconds() > 0 &&\n            this.current.milliseconds() < this.step\n          )\n            this.current = this.current.milliseconds(0);\n          break;\n        case \"second\":\n          if (this.current.seconds() > 0 && this.current.seconds() < this.step)\n            this.current = this.current.seconds(0);\n          break;\n        case \"minute\":\n          if (this.current.minutes() > 0 && this.current.minutes() < this.step)\n            this.current = this.current.minutes(0);\n          break;\n        case \"hour\":\n          if (this.current.hours() > 0 && this.current.hours() < this.step)\n            this.current = this.current.hours(0);\n          break;\n        case \"weekday\": // intentional fall through\n        case \"day\":\n          if (this.current.date() < this.step + 1)\n            this.current = this.current.date(1);\n          break;\n        case \"week\":\n          if (this.current.week() < this.step)\n            this.current = this.current.week(1); // week numbering starts at 1, not 0\n          break;\n        case \"month\":\n          if (this.current.month() < this.step)\n            this.current = this.current.month(0);\n          break;\n        case \"year\":\n          break; // nothing to do for year\n        default:\n          break;\n      }\n    }\n\n    // safety mechanism: if current time is still unchanged, move to the end\n    if (this.current.valueOf() == prev) {\n      this.current = this._end.clone();\n    }\n\n    // Reset switches for year, month and day. Will get set to true where appropriate in DateUtil.stepOverHiddenDates\n    this.switchedDay = false;\n    this.switchedMonth = false;\n    this.switchedYear = false;\n\n    DateUtil.stepOverHiddenDates(this.moment, this, prev);\n  }\n\n  /**\n   * Get the current datetime\n   * @return {Moment}  current The current date\n   */\n  getCurrent() {\n    return this.current.clone();\n  }\n\n  /**\n   * Set a custom scale. Autoscaling will be disabled.\n   * For example setScale('minute', 5) will result\n   * in minor steps of 5 minutes, and major steps of an hour.\n   *\n   * @param {{scale: string, step: number}} params\n   *                               An object containing two properties:\n   *                               - A string 'scale'. Choose from 'millisecond', 'second',\n   *                                 'minute', 'hour', 'weekday', 'day', 'week', 'month', 'year'.\n   *                               - A number 'step'. A step size, by default 1.\n   *                                 Choose for example 1, 2, 5, or 10.\n   */\n  setScale(params) {\n    if (params && typeof params.scale == \"string\") {\n      this.scale = params.scale;\n      this.step = params.step > 0 ? params.step : 1;\n      this.autoScale = false;\n    }\n  }\n\n  /**\n   * Enable or disable autoscaling\n   * @param {boolean} enable  If true, autoascaling is set true\n   */\n  setAutoScale(enable) {\n    this.autoScale = enable;\n  }\n\n  /**\n   * Automatically determine the scale that bests fits the provided minimum step\n   * @param {number} [minimumStep]  The minimum step size in milliseconds\n   */\n  setMinimumStep(minimumStep) {\n    if (minimumStep == undefined) {\n      return;\n    }\n\n    //var b = asc + ds;\n\n    const stepYear = 1000 * 60 * 60 * 24 * 30 * 12;\n    const stepMonth = 1000 * 60 * 60 * 24 * 30;\n    const stepDay = 1000 * 60 * 60 * 24;\n    const stepHour = 1000 * 60 * 60;\n    const stepMinute = 1000 * 60;\n    const stepSecond = 1000;\n    const stepMillisecond = 1;\n\n    // find the smallest step that is larger than the provided minimumStep\n    if (stepYear * 1000 > minimumStep) {\n      this.scale = \"year\";\n      this.step = 1000;\n    }\n    if (stepYear * 500 > minimumStep) {\n      this.scale = \"year\";\n      this.step = 500;\n    }\n    if (stepYear * 100 > minimumStep) {\n      this.scale = \"year\";\n      this.step = 100;\n    }\n    if (stepYear * 50 > minimumStep) {\n      this.scale = \"year\";\n      this.step = 50;\n    }\n    if (stepYear * 10 > minimumStep) {\n      this.scale = \"year\";\n      this.step = 10;\n    }\n    if (stepYear * 5 > minimumStep) {\n      this.scale = \"year\";\n      this.step = 5;\n    }\n    if (stepYear > minimumStep) {\n      this.scale = \"year\";\n      this.step = 1;\n    }\n    if (stepMonth * 3 > minimumStep) {\n      this.scale = \"month\";\n      this.step = 3;\n    }\n    if (stepMonth > minimumStep) {\n      this.scale = \"month\";\n      this.step = 1;\n    }\n    if (stepDay * 7 > minimumStep && this.options.showWeekScale) {\n      this.scale = \"week\";\n      this.step = 1;\n    }\n    if (stepDay * 2 > minimumStep) {\n      this.scale = \"day\";\n      this.step = 2;\n    }\n    if (stepDay > minimumStep) {\n      this.scale = \"day\";\n      this.step = 1;\n    }\n    if (stepDay / 2 > minimumStep) {\n      this.scale = \"weekday\";\n      this.step = 1;\n    }\n    if (stepHour * 4 > minimumStep) {\n      this.scale = \"hour\";\n      this.step = 4;\n    }\n    if (stepHour > minimumStep) {\n      this.scale = \"hour\";\n      this.step = 1;\n    }\n    if (stepMinute * 15 > minimumStep) {\n      this.scale = \"minute\";\n      this.step = 15;\n    }\n    if (stepMinute * 10 > minimumStep) {\n      this.scale = \"minute\";\n      this.step = 10;\n    }\n    if (stepMinute * 5 > minimumStep) {\n      this.scale = \"minute\";\n      this.step = 5;\n    }\n    if (stepMinute > minimumStep) {\n      this.scale = \"minute\";\n      this.step = 1;\n    }\n    if (stepSecond * 15 > minimumStep) {\n      this.scale = \"second\";\n      this.step = 15;\n    }\n    if (stepSecond * 10 > minimumStep) {\n      this.scale = \"second\";\n      this.step = 10;\n    }\n    if (stepSecond * 5 > minimumStep) {\n      this.scale = \"second\";\n      this.step = 5;\n    }\n    if (stepSecond > minimumStep) {\n      this.scale = \"second\";\n      this.step = 1;\n    }\n    if (stepMillisecond * 200 > minimumStep) {\n      this.scale = \"millisecond\";\n      this.step = 200;\n    }\n    if (stepMillisecond * 100 > minimumStep) {\n      this.scale = \"millisecond\";\n      this.step = 100;\n    }\n    if (stepMillisecond * 50 > minimumStep) {\n      this.scale = \"millisecond\";\n      this.step = 50;\n    }\n    if (stepMillisecond * 10 > minimumStep) {\n      this.scale = \"millisecond\";\n      this.step = 10;\n    }\n    if (stepMillisecond * 5 > minimumStep) {\n      this.scale = \"millisecond\";\n      this.step = 5;\n    }\n    if (stepMillisecond > minimumStep) {\n      this.scale = \"millisecond\";\n      this.step = 1;\n    }\n  }\n\n  /**\n   * Snap a date to a rounded value.\n   * The snap intervals are dependent on the current scale and step.\n   * Static function\n   * @param {Date} date    the date to be snapped.\n   * @param {string} scale Current scale, can be 'millisecond', 'second',\n   *                       'minute', 'hour', 'weekday, 'day', 'week', 'month', 'year'.\n   * @param {number} step  Current step (1, 2, 4, 5, ...\n   * @return {Date} snappedDate\n   */\n  static snap(date, scale, step) {\n    let clone = moment(date);\n\n    if (scale == \"year\") {\n      const year = clone.year() + Math.round(clone.month() / 12);\n      clone = clone\n        .year(Math.round(year / step) * step)\n        .month(0)\n        .date(0)\n        .hours(0)\n        .minutes(0)\n        .seconds(0)\n        .milliseconds(0);\n    } else if (scale == \"month\") {\n      if (clone.date() > 15) {\n        clone = clone.date(1).add(1, \"month\"); // important: first set Date to 1, after that change the month.\n      } else {\n        clone = clone.date(1);\n      }\n\n      clone = clone.hours(0).minutes(0).seconds(0).milliseconds(0);\n    } else if (scale == \"week\") {\n      if (clone.weekday() > 2) {\n        // doing it the momentjs locale aware way\n        clone = clone.weekday(0).add(1, \"week\");\n      } else {\n        clone = clone.weekday(0);\n      }\n\n      clone = clone.hours(0).minutes(0).seconds(0).milliseconds(0);\n    } else if (scale == \"day\") {\n      //noinspection FallthroughInSwitchStatementJS\n      switch (step) {\n        case 5:\n        case 2:\n          clone = clone.hours(Math.round(clone.hours() / 24) * 24);\n          break;\n        default:\n          clone = clone.hours(Math.round(clone.hours() / 12) * 12);\n          break;\n      }\n      clone = clone.minutes(0).seconds(0).milliseconds(0);\n    } else if (scale == \"weekday\") {\n      //noinspection FallthroughInSwitchStatementJS\n      switch (step) {\n        case 5:\n        case 2:\n          clone = clone.hours(Math.round(clone.hours() / 12) * 12);\n          break;\n        default:\n          clone = clone.hours(Math.round(clone.hours() / 6) * 6);\n          break;\n      }\n      clone = clone.minutes(0).seconds(0).milliseconds(0);\n    } else if (scale == \"hour\") {\n      switch (step) {\n        case 4:\n          clone = clone.minutes(Math.round(clone.minutes() / 60) * 60);\n          break;\n        default:\n          clone = clone.minutes(Math.round(clone.minutes() / 30) * 30);\n          break;\n      }\n      clone = clone.seconds(0).milliseconds(0);\n    } else if (scale == \"minute\") {\n      //noinspection FallthroughInSwitchStatementJS\n      switch (step) {\n        case 15:\n        case 10:\n          clone = clone.minutes(Math.round(clone.minutes() / 5) * 5).seconds(0);\n          break;\n        case 5:\n          clone = clone.seconds(Math.round(clone.seconds() / 60) * 60);\n          break;\n        default:\n          clone = clone.seconds(Math.round(clone.seconds() / 30) * 30);\n          break;\n      }\n      clone = clone.milliseconds(0);\n    } else if (scale == \"second\") {\n      //noinspection FallthroughInSwitchStatementJS\n      switch (step) {\n        case 15:\n        case 10:\n          clone = clone\n            .seconds(Math.round(clone.seconds() / 5) * 5)\n            .milliseconds(0);\n          break;\n        case 5:\n          clone = clone.milliseconds(\n            Math.round(clone.milliseconds() / 1000) * 1000,\n          );\n          break;\n        default:\n          clone = clone.milliseconds(\n            Math.round(clone.milliseconds() / 500) * 500,\n          );\n          break;\n      }\n    } else if (scale == \"millisecond\") {\n      const _step = step > 5 ? step / 2 : 1;\n      clone = clone.milliseconds(\n        Math.round(clone.milliseconds() / _step) * _step,\n      );\n    }\n\n    return clone;\n  }\n\n  /**\n   * Check if the current value is a major value (for example when the step\n   * is DAY, a major value is each first day of the MONTH)\n   * @return {boolean} true if current date is major, else false.\n   */\n  isMajor() {\n    if (this.switchedYear == true) {\n      switch (this.scale) {\n        case \"year\":\n        case \"month\":\n        case \"week\":\n        case \"weekday\":\n        case \"day\":\n        case \"hour\":\n        case \"minute\":\n        case \"second\":\n        case \"millisecond\":\n          return true;\n        default:\n          return false;\n      }\n    } else if (this.switchedMonth == true) {\n      switch (this.scale) {\n        case \"week\":\n        case \"weekday\":\n        case \"day\":\n        case \"hour\":\n        case \"minute\":\n        case \"second\":\n        case \"millisecond\":\n          return true;\n        default:\n          return false;\n      }\n    } else if (this.switchedDay == true) {\n      switch (this.scale) {\n        case \"millisecond\":\n        case \"second\":\n        case \"minute\":\n        case \"hour\":\n          return true;\n        default:\n          return false;\n      }\n    }\n\n    const date = this.moment(this.current);\n    switch (this.scale) {\n      case \"millisecond\":\n        return date.milliseconds() == 0;\n      case \"second\":\n        return date.seconds() == 0;\n      case \"minute\":\n        return date.hours() == 0 && date.minutes() == 0;\n      case \"hour\":\n        return date.hours() == 0;\n      case \"weekday\": // intentional fall through\n      case \"day\":\n        return this.options.showWeekScale\n          ? date.isoWeekday() == 1\n          : date.date() == 1;\n      case \"week\":\n        return date.date() == 1;\n      case \"month\":\n        return date.month() == 0;\n      case \"year\":\n        return false;\n      default:\n        return false;\n    }\n  }\n\n  /**\n   * Returns formatted text for the minor axislabel, depending on the current\n   * date and the scale. For example when scale is MINUTE, the current time is\n   * formatted as \"hh:mm\".\n   * @param {Date} [date=this.current] custom date. if not provided, current date is taken\n   * @returns {String}\n   */\n  getLabelMinor(date) {\n    if (date == undefined) {\n      date = this.current;\n    }\n    if (date instanceof Date) {\n      date = this.moment(date);\n    }\n\n    if (typeof this.format.minorLabels === \"function\") {\n      return this.format.minorLabels(date, this.scale, this.step);\n    }\n\n    const format = this.format.minorLabels[this.scale];\n    // noinspection FallThroughInSwitchStatementJS\n    switch (this.scale) {\n      case \"week\":\n        // Don't draw the minor label if this date is the first day of a month AND if it's NOT the start of the week.\n        // The 'date' variable may actually be the 'next' step when called from TimeAxis' _repaintLabels.\n        if (date.date() === 1 && date.weekday() !== 0) {\n          return \"\";\n        }\n      // eslint-disable-next-line no-fallthrough\n      default:\n        return format && format.length > 0\n          ? this.moment(date).format(format)\n          : \"\";\n    }\n  }\n\n  /**\n   * Returns formatted text for the major axis label, depending on the current\n   * date and the scale. For example when scale is MINUTE, the major scale is\n   * hours, and the hour will be formatted as \"hh\".\n   * @param {Date} [date=this.current] custom date. if not provided, current date is taken\n   * @returns {String}\n   */\n  getLabelMajor(date) {\n    if (date == undefined) {\n      date = this.current;\n    }\n    if (date instanceof Date) {\n      date = this.moment(date);\n    }\n\n    if (typeof this.format.majorLabels === \"function\") {\n      return this.format.majorLabels(date, this.scale, this.step);\n    }\n\n    const format = this.format.majorLabels[this.scale];\n    return format && format.length > 0 ? this.moment(date).format(format) : \"\";\n  }\n\n  /**\n   * get class name\n   * @return {string} class name\n   */\n  getClassName() {\n    const _moment = this.moment;\n    const m = this.moment(this.current);\n    const current = m.locale ? m.locale(\"en\") : m.lang(\"en\"); // old versions of moment have .lang() function\n    const step = this.step;\n    const classNames = [];\n\n    /**\n     *\n     * @param {number} value\n     * @returns {String}\n     */\n    function even(value) {\n      return (value / step) % 2 == 0 ? \" vis-even\" : \" vis-odd\";\n    }\n\n    /**\n     *\n     * @param {Date} date\n     * @returns {String}\n     */\n    function today(date) {\n      if (date.isSame(Date.now(), \"day\")) {\n        return \" vis-today\";\n      }\n      if (date.isSame(_moment().add(1, \"day\"), \"day\")) {\n        return \" vis-tomorrow\";\n      }\n      if (date.isSame(_moment().add(-1, \"day\"), \"day\")) {\n        return \" vis-yesterday\";\n      }\n      return \"\";\n    }\n\n    /**\n     *\n     * @param {Date} date\n     * @returns {String}\n     */\n    function currentWeek(date) {\n      return date.isSame(Date.now(), \"week\") ? \" vis-current-week\" : \"\";\n    }\n\n    /**\n     *\n     * @param {Date} date\n     * @returns {String}\n     */\n    function currentMonth(date) {\n      return date.isSame(Date.now(), \"month\") ? \" vis-current-month\" : \"\";\n    }\n\n    /**\n     *\n     * @param {Date} date\n     * @returns {String}\n     */\n    function currentYear(date) {\n      return date.isSame(Date.now(), \"year\") ? \" vis-current-year\" : \"\";\n    }\n\n    switch (this.scale) {\n      case \"millisecond\":\n        classNames.push(today(current));\n        classNames.push(even(current.milliseconds()));\n        break;\n      case \"second\":\n        classNames.push(today(current));\n        classNames.push(even(current.seconds()));\n        break;\n      case \"minute\":\n        classNames.push(today(current));\n        classNames.push(even(current.minutes()));\n        break;\n      case \"hour\":\n        classNames.push(\n          `vis-h${current.hours()}${this.step == 4 ? \"-h\" + (current.hours() + 4) : \"\"}`,\n        );\n        classNames.push(today(current));\n        classNames.push(even(current.hours()));\n        break;\n      case \"weekday\":\n        classNames.push(`vis-${current.format(\"dddd\").toLowerCase()}`);\n        classNames.push(today(current));\n        classNames.push(currentWeek(current));\n        classNames.push(even(current.date()));\n        break;\n      case \"day\":\n        classNames.push(`vis-day${current.date()}`);\n        classNames.push(`vis-${current.format(\"MMMM\").toLowerCase()}`);\n        classNames.push(today(current));\n        classNames.push(currentMonth(current));\n        classNames.push(this.step <= 2 ? today(current) : \"\");\n        classNames.push(\n          this.step <= 2 ? `vis-${current.format(\"dddd\").toLowerCase()}` : \"\",\n        );\n        classNames.push(even(current.date() - 1));\n        break;\n      case \"week\":\n        classNames.push(`vis-week${current.format(\"w\")}`);\n        classNames.push(currentWeek(current));\n        classNames.push(even(current.week()));\n        break;\n      case \"month\":\n        classNames.push(`vis-${current.format(\"MMMM\").toLowerCase()}`);\n        classNames.push(currentMonth(current));\n        classNames.push(even(current.month()));\n        break;\n      case \"year\":\n        classNames.push(`vis-year${current.year()}`);\n        classNames.push(currentYear(current));\n        classNames.push(even(current.year()));\n        break;\n    }\n    return classNames.filter(String).join(\" \");\n  }\n}\n\n// Time formatting\nTimeStep.FORMAT = {\n  minorLabels: {\n    millisecond: \"SSS\",\n    second: \"s\",\n    minute: \"HH:mm\",\n    hour: \"HH:mm\",\n    weekday: \"ddd D\",\n    day: \"D\",\n    week: \"w\",\n    month: \"MMM\",\n    year: \"YYYY\",\n  },\n  majorLabels: {\n    millisecond: \"HH:mm:ss\",\n    second: \"D MMMM HH:mm\",\n    minute: \"ddd D MMMM\",\n    hour: \"ddd D MMMM\",\n    weekday: \"MMMM YYYY\",\n    day: \"MMMM YYYY\",\n    week: \"MMMM YYYY\",\n    month: \"YYYY\",\n    year: \"\",\n  },\n};\n\nexport default TimeStep;\n","import util from \"../../util.js\";\nimport Component from \"./Component.js\";\nimport TimeStep from \"../TimeStep.js\";\nimport * as DateUtil from \"../DateUtil.js\";\nimport moment from \"../../module/moment.js\";\n\n/** A horizontal time axis */\nclass TimeAxis extends Component {\n  /**\n   * @param {{dom: Object, domProps: Object, emitter: Emitter, range: Range}} body\n   * @param {Object} [options]        See TimeAxis.setOptions for the available\n   *                                  options.\n   * @constructor TimeAxis\n   * @extends Component\n   */\n  constructor(body, options) {\n    super();\n    this.dom = {\n      foreground: null,\n      lines: [],\n      majorTexts: [],\n      minorTexts: [],\n      redundant: {\n        lines: [],\n        majorTexts: [],\n        minorTexts: [],\n      },\n    };\n    this.props = {\n      range: {\n        start: 0,\n        end: 0,\n        minimumStep: 0,\n      },\n      lineTop: 0,\n    };\n\n    this.defaultOptions = {\n      orientation: {\n        axis: \"bottom\",\n      }, // axis orientation: 'top' or 'bottom'\n      showMinorLabels: true,\n      showMajorLabels: true,\n      showWeekScale: false,\n      maxMinorChars: 7,\n      format: util.extend({}, TimeStep.FORMAT),\n      moment,\n      timeAxis: null,\n    };\n    this.options = util.extend({}, this.defaultOptions);\n\n    this.body = body;\n\n    // create the HTML DOM\n    this._create();\n\n    this.setOptions(options);\n  }\n\n  /**\n   * Set options for the TimeAxis.\n   * Parameters will be merged in current options.\n   * @param {Object} options  Available options:\n   *                          {string} [orientation.axis]\n   *                          {boolean} [showMinorLabels]\n   *                          {boolean} [showMajorLabels]\n   *                          {boolean} [showWeekScale]\n   */\n  setOptions(options) {\n    if (options) {\n      // copy all options that we know\n      util.selectiveExtend(\n        [\n          \"showMinorLabels\",\n          \"showMajorLabels\",\n          \"showWeekScale\",\n          \"maxMinorChars\",\n          \"hiddenDates\",\n          \"timeAxis\",\n          \"moment\",\n          \"rtl\",\n        ],\n        this.options,\n        options,\n      );\n\n      // deep copy the format options\n      util.selectiveDeepExtend([\"format\"], this.options, options);\n\n      if (\"orientation\" in options) {\n        if (typeof options.orientation === \"string\") {\n          this.options.orientation.axis = options.orientation;\n        } else if (\n          typeof options.orientation === \"object\" &&\n          \"axis\" in options.orientation\n        ) {\n          this.options.orientation.axis = options.orientation.axis;\n        }\n      }\n\n      // apply locale to moment.js\n      // TODO: not so nice, this is applied globally to moment.js\n      if (\"locale\" in options) {\n        if (typeof moment.locale === \"function\") {\n          // moment.js 2.8.1+\n          moment.locale(options.locale);\n        } else {\n          moment.lang(options.locale);\n        }\n      }\n    }\n  }\n\n  /**\n   * Create the HTML DOM for the TimeAxis\n   */\n  _create() {\n    this.dom.foreground = document.createElement(\"div\");\n    this.dom.background = document.createElement(\"div\");\n\n    this.dom.foreground.className = \"vis-time-axis vis-foreground\";\n    this.dom.background.className = \"vis-time-axis vis-background\";\n  }\n\n  /**\n   * Destroy the TimeAxis\n   */\n  destroy() {\n    // remove from DOM\n    if (this.dom.foreground.parentNode) {\n      this.dom.foreground.parentNode.removeChild(this.dom.foreground);\n    }\n    if (this.dom.background.parentNode) {\n      this.dom.background.parentNode.removeChild(this.dom.background);\n    }\n\n    this.body = null;\n  }\n\n  /**\n   * Repaint the component\n   * @return {boolean} Returns true if the component is resized\n   */\n  redraw() {\n    const props = this.props;\n    const foreground = this.dom.foreground;\n    const background = this.dom.background;\n\n    // determine the correct parent DOM element (depending on option orientation)\n    const parent =\n      this.options.orientation.axis == \"top\"\n        ? this.body.dom.top\n        : this.body.dom.bottom;\n    const parentChanged = foreground.parentNode !== parent;\n\n    // calculate character width and height\n    this._calculateCharSize();\n\n    // TODO: recalculate sizes only needed when parent is resized or options is changed\n    const showMinorLabels =\n      this.options.showMinorLabels && this.options.orientation.axis !== \"none\";\n    const showMajorLabels =\n      this.options.showMajorLabels && this.options.orientation.axis !== \"none\";\n\n    // determine the width and height of the elemens for the axis\n    props.minorLabelHeight = showMinorLabels ? props.minorCharHeight : 0;\n    props.majorLabelHeight = showMajorLabels ? props.majorCharHeight : 0;\n    props.height = props.minorLabelHeight + props.majorLabelHeight;\n    props.width = foreground.offsetWidth;\n\n    props.minorLineHeight =\n      this.body.domProps.root.height -\n      props.majorLabelHeight -\n      (this.options.orientation.axis == \"top\"\n        ? this.body.domProps.bottom.height\n        : this.body.domProps.top.height);\n    props.minorLineWidth = 1; // TODO: really calculate width\n    props.majorLineHeight = props.minorLineHeight + props.majorLabelHeight;\n    props.majorLineWidth = 1; // TODO: really calculate width\n\n    //  take foreground and background offline while updating (is almost twice as fast)\n    const foregroundNextSibling = foreground.nextSibling;\n    const backgroundNextSibling = background.nextSibling;\n    foreground.parentNode && foreground.parentNode.removeChild(foreground);\n    background.parentNode && background.parentNode.removeChild(background);\n\n    foreground.style.height = `${this.props.height}px`;\n\n    this._repaintLabels();\n\n    // put DOM online again (at the same place)\n    if (foregroundNextSibling) {\n      parent.insertBefore(foreground, foregroundNextSibling);\n    } else {\n      parent.appendChild(foreground);\n    }\n    if (backgroundNextSibling) {\n      this.body.dom.backgroundVertical.insertBefore(\n        background,\n        backgroundNextSibling,\n      );\n    } else {\n      this.body.dom.backgroundVertical.appendChild(background);\n    }\n    return this._isResized() || parentChanged;\n  }\n\n  /**\n   * Repaint major and minor text labels and vertical grid lines\n   * @private\n   */\n  _repaintLabels() {\n    const orientation = this.options.orientation.axis;\n\n    // calculate range and step (step such that we have space for 7 characters per label)\n    const start = util.convert(this.body.range.start, \"Number\");\n    const end = util.convert(this.body.range.end, \"Number\");\n    const timeLabelsize = this.body.util\n      .toTime((this.props.minorCharWidth || 10) * this.options.maxMinorChars)\n      .valueOf();\n    let minimumStep =\n      timeLabelsize -\n      DateUtil.getHiddenDurationBefore(\n        this.options.moment,\n        this.body.hiddenDates,\n        this.body.range,\n        timeLabelsize,\n      );\n    minimumStep -= this.body.util.toTime(0).valueOf();\n\n    const step = new TimeStep(\n      new Date(start),\n      new Date(end),\n      minimumStep,\n      this.body.hiddenDates,\n      this.options,\n    );\n    step.setMoment(this.options.moment);\n    if (this.options.format) {\n      step.setFormat(this.options.format);\n    }\n    if (this.options.timeAxis) {\n      step.setScale(this.options.timeAxis);\n    }\n    this.step = step;\n\n    // Move all DOM elements to a \"redundant\" list, where they\n    // can be picked for re-use, and clear the lists with lines and texts.\n    // At the end of the function _repaintLabels, left over elements will be cleaned up\n    const dom = this.dom;\n    dom.redundant.lines = dom.lines;\n    dom.redundant.majorTexts = dom.majorTexts;\n    dom.redundant.minorTexts = dom.minorTexts;\n    dom.lines = [];\n    dom.majorTexts = [];\n    dom.minorTexts = [];\n\n    let current;\n    let next;\n    let x;\n    let xNext;\n    let isMajor;\n    let showMinorGrid;\n    let width = 0;\n    let prevWidth;\n    let line;\n    let xFirstMajorLabel = undefined;\n    let count = 0;\n    const MAX = 1000;\n    let className;\n\n    step.start();\n    next = step.getCurrent();\n    xNext = this.body.util.toScreen(next);\n    while (step.hasNext() && count < MAX) {\n      count++;\n\n      isMajor = step.isMajor();\n      className = step.getClassName();\n\n      current = next;\n      x = xNext;\n\n      step.next();\n      next = step.getCurrent();\n      xNext = this.body.util.toScreen(next);\n\n      prevWidth = width;\n      width = xNext - x;\n      switch (step.scale) {\n        case \"week\":\n          showMinorGrid = true;\n          break;\n        default:\n          showMinorGrid = width >= prevWidth * 0.4;\n          break; // prevent displaying of the 31th of the month on a scale of 5 days\n      }\n\n      if (this.options.showMinorLabels && showMinorGrid) {\n        var label = this._repaintMinorText(\n          x,\n          step.getLabelMinor(current),\n          orientation,\n          className,\n        );\n        label.style.width = `${width}px`; // set width to prevent overflow\n      }\n\n      if (isMajor && this.options.showMajorLabels) {\n        if (x > 0) {\n          if (xFirstMajorLabel == undefined) {\n            xFirstMajorLabel = x;\n          }\n          label = this._repaintMajorText(\n            x,\n            step.getLabelMajor(current),\n            orientation,\n            className,\n          );\n        }\n        line = this._repaintMajorLine(x, width, orientation, className);\n      } else {\n        // minor line\n        if (showMinorGrid) {\n          line = this._repaintMinorLine(x, width, orientation, className);\n        } else {\n          if (line) {\n            // adjust the width of the previous grid\n            line.style.width = `${parseInt(line.style.width) + width}px`;\n          }\n        }\n      }\n    }\n\n    if (count === MAX && !warnedForOverflow) {\n      console.warn(\n        `Something is wrong with the Timeline scale. Limited drawing of grid lines to ${MAX} lines.`,\n      );\n      warnedForOverflow = true;\n    }\n\n    // create a major label on the left when needed\n    if (this.options.showMajorLabels) {\n      const leftTime = this.body.util.toTime(0); // upper bound estimation\n      const leftText = step.getLabelMajor(leftTime);\n      const widthText =\n        leftText.length * (this.props.majorCharWidth || 10) + 10;\n\n      if (xFirstMajorLabel == undefined || widthText < xFirstMajorLabel) {\n        this._repaintMajorText(0, leftText, orientation, className);\n      }\n    }\n\n    // Cleanup leftover DOM elements from the redundant list\n    util.forEach(this.dom.redundant, (arr) => {\n      while (arr.length) {\n        const elem = arr.pop();\n        if (elem && elem.parentNode) {\n          elem.parentNode.removeChild(elem);\n        }\n      }\n    });\n  }\n\n  /**\n   * Create a minor label for the axis at position x\n   * @param {number} x\n   * @param {string} text\n   * @param {string} orientation   \"top\" or \"bottom\" (default)\n   * @param {string} className\n   * @return {Element} Returns the HTML element of the created label\n   * @private\n   */\n  _repaintMinorText(x, text, orientation, className) {\n    // reuse redundant label\n    let label = this.dom.redundant.minorTexts.shift();\n\n    if (!label) {\n      // create new label\n      const content = document.createTextNode(\"\");\n      label = document.createElement(\"div\");\n      label.appendChild(content);\n      this.dom.foreground.appendChild(label);\n    }\n    this.dom.minorTexts.push(label);\n    label.innerHTML = util.xss(text);\n\n    let y = orientation == \"top\" ? this.props.majorLabelHeight : 0;\n    this._setXY(label, x, y);\n\n    label.className = `vis-text vis-minor ${className}`;\n    //label.title = title;  // TODO: this is a heavy operation\n\n    return label;\n  }\n\n  /**\n   * Create a Major label for the axis at position x\n   * @param {number} x\n   * @param {string} text\n   * @param {string} orientation   \"top\" or \"bottom\" (default)\n   * @param {string} className\n   * @return {Element} Returns the HTML element of the created label\n   * @private\n   */\n  _repaintMajorText(x, text, orientation, className) {\n    // reuse redundant label\n    let label = this.dom.redundant.majorTexts.shift();\n\n    if (!label) {\n      // create label\n      const content = document.createElement(\"div\");\n      label = document.createElement(\"div\");\n      label.appendChild(content);\n      this.dom.foreground.appendChild(label);\n    }\n\n    label.childNodes[0].innerHTML = util.xss(text);\n    label.className = `vis-text vis-major ${className}`;\n    //label.title = title; // TODO: this is a heavy operation\n\n    let y = orientation == \"top\" ? 0 : this.props.minorLabelHeight;\n    this._setXY(label, x, y);\n\n    this.dom.majorTexts.push(label);\n    return label;\n  }\n\n  /**\n   * sets xy\n   * @param {string} label\n   * @param {number} x\n   * @param {number} y\n   * @private\n   */\n  _setXY(label, x, y) {\n    // If rtl is true, inverse x.\n    const directionX = this.options.rtl ? x * -1 : x;\n    label.style.transform = `translate(${directionX}px, ${y}px)`;\n  }\n\n  /**\n   * Create a minor line for the axis at position x\n   * @param {number} left\n   * @param {number} width\n   * @param {string} orientation   \"top\" or \"bottom\" (default)\n   * @param {string} className\n   * @return {Element} Returns the created line\n   * @private\n   */\n  _repaintMinorLine(left, width, orientation, className) {\n    // reuse redundant line\n    let line = this.dom.redundant.lines.shift();\n    if (!line) {\n      // create vertical line\n      line = document.createElement(\"div\");\n      this.dom.background.appendChild(line);\n    }\n    this.dom.lines.push(line);\n\n    const props = this.props;\n\n    line.style.width = `${width}px`;\n    line.style.height = `${props.minorLineHeight}px`;\n\n    let y =\n      orientation == \"top\"\n        ? props.majorLabelHeight\n        : this.body.domProps.top.height;\n    let x = left - props.minorLineWidth / 2;\n\n    this._setXY(line, x, y);\n    line.className = `vis-grid ${this.options.rtl ? \"vis-vertical-rtl\" : \"vis-vertical\"} vis-minor ${className}`;\n\n    return line;\n  }\n\n  /**\n   * Create a Major line for the axis at position x\n   * @param {number} left\n   * @param {number} width\n   * @param {string} orientation   \"top\" or \"bottom\" (default)\n   * @param {string} className\n   * @return {Element} Returns the created line\n   * @private\n   */\n  _repaintMajorLine(left, width, orientation, className) {\n    // reuse redundant line\n    let line = this.dom.redundant.lines.shift();\n    if (!line) {\n      // create vertical line\n      line = document.createElement(\"div\");\n      this.dom.background.appendChild(line);\n    }\n    this.dom.lines.push(line);\n\n    const props = this.props;\n\n    line.style.width = `${width}px`;\n    line.style.height = `${props.majorLineHeight}px`;\n\n    let y = orientation == \"top\" ? 0 : this.body.domProps.top.height;\n    let x = left - props.majorLineWidth / 2;\n\n    this._setXY(line, x, y);\n    line.className = `vis-grid ${this.options.rtl ? \"vis-vertical-rtl\" : \"vis-vertical\"} vis-major ${className}`;\n\n    return line;\n  }\n\n  /**\n   * Determine the size of text on the axis (both major and minor axis).\n   * The size is calculated only once and then cached in this.props.\n   * @private\n   */\n  _calculateCharSize() {\n    // Note: We calculate char size with every redraw. Size may change, for\n    // example when any of the timelines parents had display:none for example.\n\n    // determine the char width and height on the minor axis\n    if (!this.dom.measureCharMinor) {\n      this.dom.measureCharMinor = document.createElement(\"DIV\");\n      this.dom.measureCharMinor.className = \"vis-text vis-minor vis-measure\";\n      this.dom.measureCharMinor.style.position = \"absolute\";\n\n      this.dom.measureCharMinor.appendChild(document.createTextNode(\"0\"));\n      this.dom.foreground.appendChild(this.dom.measureCharMinor);\n    }\n    this.props.minorCharHeight = this.dom.measureCharMinor.clientHeight;\n    this.props.minorCharWidth = this.dom.measureCharMinor.clientWidth;\n\n    // determine the char width and height on the major axis\n    if (!this.dom.measureCharMajor) {\n      this.dom.measureCharMajor = document.createElement(\"DIV\");\n      this.dom.measureCharMajor.className = \"vis-text vis-major vis-measure\";\n      this.dom.measureCharMajor.style.position = \"absolute\";\n\n      this.dom.measureCharMajor.appendChild(document.createTextNode(\"0\"));\n      this.dom.foreground.appendChild(this.dom.measureCharMajor);\n    }\n    this.props.majorCharHeight = this.dom.measureCharMajor.clientHeight;\n    this.props.majorCharWidth = this.dom.measureCharMajor.clientWidth;\n  }\n}\n\nvar warnedForOverflow = false;\n\nexport default TimeAxis;\n","import keycharm from \"keycharm\";\nimport Emitter from \"component-emitter\";\nimport Hammer from \"../module/hammer.js\";\nimport util from \"../util.js\";\n\n/**\n * Turn an element into an clickToUse element.\n * When not active, the element has a transparent overlay. When the overlay is\n * clicked, the mode is changed to active.\n * When active, the element is displayed with a blue border around it, and\n * the interactive contents of the element can be used. When clicked outside\n * the element, the elements mode is changed to inactive.\n * @param {Element} container\n * @constructor Activator\n */\nfunction Activator(container) {\n  this.active = false;\n\n  this.dom = {\n    container: container,\n  };\n\n  this.dom.overlay = document.createElement(\"div\");\n  this.dom.overlay.className = \"vis-overlay\";\n\n  this.dom.container.appendChild(this.dom.overlay);\n\n  this.hammer = Hammer(this.dom.overlay);\n  this.hammer.on(\"tap\", this._onTapOverlay.bind(this));\n\n  // block all touch events (except tap)\n  var me = this;\n  var events = [\n    \"tap\",\n    \"doubletap\",\n    \"press\",\n    \"pinch\",\n    \"pan\",\n    \"panstart\",\n    \"panmove\",\n    \"panend\",\n  ];\n  events.forEach(function (event) {\n    me.hammer.on(event, function (event) {\n      event.stopPropagation();\n    });\n  });\n\n  // attach a click event to the window, in order to deactivate when clicking outside the timeline\n  if (document && document.body) {\n    this.onClick = function (event) {\n      if (!_hasParent(event.target, container)) {\n        me.deactivate();\n      }\n    };\n    document.body.addEventListener(\"click\", this.onClick);\n  }\n\n  if (this.keycharm !== undefined) {\n    this.keycharm.destroy();\n  }\n  this.keycharm = keycharm();\n\n  // keycharm listener only bounded when active)\n  this.escListener = this.deactivate.bind(this);\n}\n\n// turn into an event emitter\nEmitter(Activator.prototype);\n\n// The currently active activator\nActivator.current = null;\n\n/**\n * Destroy the activator. Cleans up all created DOM and event listeners\n */\nActivator.prototype.destroy = function () {\n  this.deactivate();\n\n  // remove dom\n  this.dom.overlay.parentNode.removeChild(this.dom.overlay);\n\n  // remove global event listener\n  if (this.onClick) {\n    document.body.removeEventListener(\"click\", this.onClick);\n  }\n  // remove keycharm\n  if (this.keycharm !== undefined) {\n    this.keycharm.destroy();\n  }\n  this.keycharm = null;\n  // cleanup hammer instances\n  this.hammer.destroy();\n  this.hammer = null;\n  // FIXME: cleaning up hammer instances doesn't work (Timeline not removed from memory)\n};\n\n/**\n * Activate the element\n * Overlay is hidden, element is decorated with a blue shadow border\n */\nActivator.prototype.activate = function () {\n  // we allow only one active activator at a time\n  if (Activator.current) {\n    Activator.current.deactivate();\n  }\n  Activator.current = this;\n\n  this.active = true;\n  this.dom.overlay.style.display = \"none\";\n  util.addClassName(this.dom.container, \"vis-active\");\n\n  this.emit(\"change\");\n  this.emit(\"activate\");\n\n  // ugly hack: bind ESC after emitting the events, as the Network rebinds all\n  // keyboard events on a 'change' event\n  this.keycharm.bind(\"esc\", this.escListener);\n};\n\n/**\n * Deactivate the element\n * Overlay is displayed on top of the element\n */\nActivator.prototype.deactivate = function () {\n  if (Activator.current === this) {\n    Activator.current = null;\n  }\n\n  this.active = false;\n  this.dom.overlay.style.display = \"\";\n  util.removeClassName(this.dom.container, \"vis-active\");\n  this.keycharm.unbind(\"esc\", this.escListener);\n\n  this.emit(\"change\");\n  this.emit(\"deactivate\");\n};\n\n/**\n * Handle a tap event: activate the container\n * @param {Event}  event   The event\n * @private\n */\nActivator.prototype._onTapOverlay = function (event) {\n  // activate the container\n  this.activate();\n  event.stopPropagation();\n};\n\n/**\n * Test whether the element has the requested parent element somewhere in\n * its chain of parent nodes.\n * @param {HTMLElement} element\n * @param {HTMLElement} parent\n * @returns {boolean} Returns true when the parent is found somewhere in the\n *                    chain of parent nodes.\n * @private\n */\nfunction _hasParent(element, parent) {\n  while (element) {\n    if (element === parent) {\n      return true;\n    }\n    element = element.parentNode;\n  }\n  return false;\n}\n\nexport default Activator;\n","/*\n * IMPORTANT: Locales for Moment has to be imported in the legacy and standalone\n * entry points. For the peer build it's users responsibility to do so.\n */\n\n// English\nconst en = {\n  current: \"current\",\n  time: \"time\",\n  deleteSelected: \"Delete selected\",\n};\nconst en_EN = en;\nconst en_US = en;\n\n// Italiano\nconst it = {\n  current: \"attuale\",\n  time: \"tempo\",\n  deleteSelected: \"Cancella la selezione\",\n};\nconst it_IT = it;\nconst it_CH = it;\n\n// Dutch\nconst nl = {\n  current: \"huidige\",\n  time: \"tijd\",\n  deleteSelected: \"Selectie verwijderen\",\n};\nconst nl_NL = nl;\nconst nl_BE = nl;\n\n// German\nconst de = {\n  current: \"Aktuelle\",\n  time: \"Zeit\",\n  deleteSelected: \"L\\u00f6sche Auswahl\",\n};\nconst de_DE = de;\nconst de_CH = de;\n\n// French\nconst fr = {\n  current: \"actuel\",\n  time: \"heure\",\n  deleteSelected: \"Effacer la selection\",\n};\nconst fr_FR = fr;\nconst fr_CA = fr;\nconst fr_BE = fr;\nconst fr_CH = fr;\n\n// Espanol\nconst es = {\n  current: \"actual\",\n  time: \"hora\",\n  deleteSelected: \"Eliminar selecci\\u00f3n\",\n};\nconst es_ES = es;\n\n// Ukrainian\nconst uk = {\n  current: \"поточний\",\n  time: \"час\",\n  deleteSelected: \"Видалити обране\",\n};\nconst uk_UA = uk;\n\n// Russian\nconst ru = {\n  current: \"текущее\",\n  time: \"время\",\n  deleteSelected: \"Удалить выбранное\",\n};\nconst ru_RU = ru;\n\n// Polish\nconst pl = {\n  current: \"aktualny\",\n  time: \"czas\",\n  deleteSelected: \"Usuń wybrane\",\n};\nconst pl_PL = pl;\n\n// Portuguese\nconst pt = {\n  current: \"atual\",\n  time: \"data\",\n  deleteSelected: \"Apagar selecionado\",\n};\nconst pt_BR = pt;\nconst pt_PT = pt;\n\n// Turkish\nconst tr = {\n  current: \"güncel\",\n  time: \"zaman\",\n  deleteSelected: \"Seçileni sil\",\n};\nconst tr_TR = tr;\n\n// Japanese\nconst ja = {\n  current: \"現在\",\n  time: \"時刻\",\n  deleteSelected: \"選択されたものを削除\",\n};\nconst ja_JP = ja;\n\n// Swedish\nconst sv = {\n  current: \"nuvarande\",\n  time: \"tid\",\n  deleteSelected: \"Radera valda\",\n};\nconst sv_SE = sv;\n\n// Norwegian\nconst nb = {\n  current: \"nåværende\",\n  time: \"tid\",\n  deleteSelected: \"Slett valgte\",\n};\nconst nb_NO = nb;\nconst nn = nb;\nconst nn_NO = nb;\n\n// Lithuanian\nconst lt = {\n  current: \"einamas\",\n  time: \"laikas\",\n  deleteSelected: \"Pašalinti pasirinktą\",\n};\nconst lt_LT = lt;\n\nconst locales = {\n  en,\n  en_EN,\n  en_US,\n  it,\n  it_IT,\n  it_CH,\n  nl,\n  nl_NL,\n  nl_BE,\n  de,\n  de_DE,\n  de_CH,\n  fr,\n  fr_FR,\n  fr_CA,\n  fr_BE,\n  fr_CH,\n  es,\n  es_ES,\n  uk,\n  uk_UA,\n  ru,\n  ru_RU,\n  pl,\n  pl_PL,\n  pt,\n  pt_BR,\n  pt_PT,\n  tr,\n  tr_TR,\n  ja,\n  ja_JP,\n  lt,\n  lt_LT,\n  sv,\n  sv_SE,\n  nb,\n  nn,\n  nb_NO,\n  nn_NO,\n};\n\nexport default locales;\n","import Hammer from \"../../module/hammer.js\";\nimport util from \"../../util.js\";\nimport Component from \"./Component.js\";\nimport moment from \"../../module/moment.js\";\nimport locales from \"../locales.js\";\n\n/** A custom time bar */\nclass CustomTime extends Component {\n  /**\n   * @param {{range: Range, dom: Object}} body\n   * @param {Object} [options]        Available parameters:\n   *                                  {number | string} id\n   *                                  {string} locales\n   *                                  {string} locale\n   * @constructor CustomTime\n   * @extends Component\n   */\n  constructor(body, options) {\n    super();\n    this.body = body;\n\n    // default options\n    this.defaultOptions = {\n      moment,\n      locales,\n      locale: \"en\",\n      id: undefined,\n      title: undefined,\n    };\n    this.options = util.extend({}, this.defaultOptions);\n    this.setOptions(options);\n    this.options.locales = util.extend({}, locales, this.options.locales);\n    const defaultLocales =\n      this.defaultOptions.locales[this.defaultOptions.locale];\n    Object.keys(this.options.locales).forEach((locale) => {\n      this.options.locales[locale] = util.extend(\n        {},\n        defaultLocales,\n        this.options.locales[locale],\n      );\n    });\n\n    if (options && options.time != null) {\n      this.customTime = options.time;\n    } else {\n      this.customTime = new Date();\n    }\n\n    this.eventParams = {}; // stores state parameters while dragging the bar\n\n    // create the DOM\n    this._create();\n  }\n\n  /**\n   * Set options for the component. Options will be merged in current options.\n   * @param {Object} options  Available parameters:\n   *                                  {number | string} id\n   *                                  {string} locales\n   *                                  {string} locale\n   */\n  setOptions(options) {\n    if (options) {\n      // copy all options that we know\n      util.selectiveExtend(\n        [\"moment\", \"locale\", \"locales\", \"id\", \"title\", \"rtl\", \"snap\"],\n        this.options,\n        options,\n      );\n    }\n  }\n\n  /**\n   * Create the DOM for the custom time\n   * @private\n   */\n  _create() {\n    const bar = document.createElement(\"div\");\n    bar[\"custom-time\"] = this;\n    bar.className = `vis-custom-time ${this.options.id || \"\"}`;\n    bar.style.position = \"absolute\";\n    bar.style.top = \"0px\";\n    bar.style.height = \"100%\";\n    this.bar = bar;\n\n    const drag = document.createElement(\"div\");\n    drag.style.position = \"relative\";\n    drag.style.top = \"0px\";\n    if (this.options.rtl) {\n      drag.style.right = \"-10px\";\n    } else {\n      drag.style.left = \"-10px\";\n    }\n    drag.style.height = \"100%\";\n    drag.style.width = \"20px\";\n\n    /**\n     *\n     * @param {WheelEvent} e\n     */\n    function onMouseWheel(e) {\n      this.body.range._onMouseWheel(e);\n    }\n\n    if (drag.addEventListener) {\n      // IE9, Chrome, Safari, Opera\n      drag.addEventListener(\"mousewheel\", onMouseWheel.bind(this), false);\n      // Firefox\n      drag.addEventListener(\"DOMMouseScroll\", onMouseWheel.bind(this), false);\n    } else {\n      // IE 6/7/8\n      drag.attachEvent(\"onmousewheel\", onMouseWheel.bind(this));\n    }\n\n    bar.appendChild(drag);\n    // attach event listeners\n    this.hammer = new Hammer(drag);\n    this.hammer.on(\"panstart\", this._onDragStart.bind(this));\n    this.hammer.on(\"panmove\", this._onDrag.bind(this));\n    this.hammer.on(\"panend\", this._onDragEnd.bind(this));\n    this.hammer\n      .get(\"pan\")\n      .set({ threshold: 5, direction: Hammer.DIRECTION_ALL });\n    // delay addition on item click for trackpads...\n    this.hammer.get(\"press\").set({ time: 10000 });\n  }\n\n  /**\n   * Destroy the CustomTime bar\n   */\n  destroy() {\n    this.hide();\n\n    this.hammer.destroy();\n    this.hammer = null;\n\n    this.body = null;\n  }\n\n  /**\n   * Repaint the component\n   * @return {boolean} Returns true if the component is resized\n   */\n  redraw() {\n    const parent = this.body.dom.backgroundVertical;\n    if (this.bar.parentNode != parent) {\n      // attach to the dom\n      if (this.bar.parentNode) {\n        this.bar.parentNode.removeChild(this.bar);\n      }\n      parent.appendChild(this.bar);\n    }\n\n    const x = this.body.util.toScreen(this.customTime);\n\n    let locale = this.options.locales[this.options.locale];\n    if (!locale) {\n      if (!this.warned) {\n        console.warn(\n          `WARNING: options.locales['${this.options.locale}'] not found. See https://visjs.github.io/vis-timeline/docs/timeline/#Localization`,\n        );\n        this.warned = true;\n      }\n      locale = this.options.locales[\"en\"]; // fall back on english when not available\n    }\n\n    let title = this.options.title;\n    // To hide the title completely use empty string ''.\n    if (title === undefined) {\n      title = `${locale.time}: ${this.options.moment(this.customTime).format(\"dddd, MMMM Do YYYY, H:mm:ss\")}`;\n      title = title.charAt(0).toUpperCase() + title.substring(1);\n    } else if (typeof title === \"function\") {\n      title = title.call(this, this.customTime);\n    }\n\n    this.options.rtl\n      ? (this.bar.style.right = `${x}px`)\n      : (this.bar.style.left = `${x}px`);\n    this.bar.title = title;\n\n    return false;\n  }\n\n  /**\n   * Remove the CustomTime from the DOM\n   */\n  hide() {\n    // remove the line from the DOM\n    if (this.bar.parentNode) {\n      this.bar.parentNode.removeChild(this.bar);\n    }\n  }\n\n  /**\n   * Set custom time.\n   * @param {Date | number | string} time\n   */\n  setCustomTime(time) {\n    this.customTime = util.convert(time, \"Date\");\n    this.redraw();\n  }\n\n  /**\n   * Retrieve the current custom time.\n   * @return {Date} customTime\n   */\n  getCustomTime() {\n    return new Date(this.customTime.valueOf());\n  }\n\n  /**\n   * Set custom marker.\n   * @param {string} [title] Title of the custom marker\n   * @param {boolean} [editable] Make the custom marker editable.\n   */\n  setCustomMarker(title, editable) {\n    if (this.marker) {\n      this.bar.removeChild(this.marker);\n    }\n    this.marker = document.createElement(\"div\");\n    this.marker.className = `vis-custom-time-marker`;\n    this.marker.innerHTML = util.xss(title);\n    this.marker.style.position = \"absolute\";\n\n    if (editable) {\n      this.marker.setAttribute(\"contenteditable\", \"true\");\n      this.marker.addEventListener(\"pointerdown\", () => {\n        this.marker.focus();\n      });\n      this.marker.addEventListener(\"input\", this._onMarkerChange.bind(this));\n      // The editable div element has no change event, so here emulates the change event.\n      this.marker.title = title;\n      this.marker.addEventListener(\"blur\", (event) => {\n        if (this.title != event.target.innerHTML) {\n          this._onMarkerChanged(event);\n          this.title = event.target.innerHTML;\n        }\n      });\n    }\n\n    this.bar.appendChild(this.marker);\n  }\n\n  /**\n   * Set custom title.\n   * @param {Date | number | string} title\n   */\n  setCustomTitle(title) {\n    this.options.title = title;\n  }\n\n  /**\n   * Start moving horizontally\n   * @param {Event} event\n   * @private\n   */\n  _onDragStart(event) {\n    this.eventParams.dragging = true;\n    this.eventParams.customTime = this.customTime;\n\n    event.stopPropagation();\n  }\n\n  /**\n   * Perform moving operating.\n   * @param {Event} event\n   * @private\n   */\n  _onDrag(event) {\n    if (!this.eventParams.dragging) return;\n\n    let deltaX = this.options.rtl ? -1 * event.deltaX : event.deltaX;\n\n    const x = this.body.util.toScreen(this.eventParams.customTime) + deltaX;\n    const time = this.body.util.toTime(x);\n\n    const scale = this.body.util.getScale();\n    const step = this.body.util.getStep();\n    const snap = this.options.snap;\n\n    const snappedTime = snap ? snap(time, scale, step) : time;\n\n    this.setCustomTime(snappedTime);\n\n    // fire a timechange event\n    this.body.emitter.emit(\"timechange\", {\n      id: this.options.id,\n      time: new Date(this.customTime.valueOf()),\n      event,\n    });\n\n    event.stopPropagation();\n  }\n\n  /**\n   * Stop moving operating.\n   * @param {Event} event\n   * @private\n   */\n  _onDragEnd(event) {\n    if (!this.eventParams.dragging) return;\n\n    // fire a timechanged event\n    this.body.emitter.emit(\"timechanged\", {\n      id: this.options.id,\n      time: new Date(this.customTime.valueOf()),\n      event,\n    });\n\n    event.stopPropagation();\n  }\n\n  /**\n   * Perform input operating.\n   * @param {Event} event\n   * @private\n   */\n  _onMarkerChange(event) {\n    this.body.emitter.emit(\"markerchange\", {\n      id: this.options.id,\n      title: event.target.innerHTML,\n      event,\n    });\n\n    event.stopPropagation();\n  }\n\n  /**\n   * Perform change operating.\n   * @param {Event} event\n   * @private\n   */\n  _onMarkerChanged(event) {\n    this.body.emitter.emit(\"markerchanged\", {\n      id: this.options.id,\n      title: event.target.innerHTML,\n      event,\n    });\n\n    event.stopPropagation();\n  }\n\n  /**\n   * Find a custom time from an event target:\n   * searches for the attribute 'custom-time' in the event target's element tree\n   * @param {Event} event\n   * @return {CustomTime | null} customTime\n   */\n  static customTimeFromTarget(event) {\n    let target = event.target;\n    while (target) {\n      if (Object.prototype.hasOwnProperty.call(target, \"custom-time\")) {\n        return target[\"custom-time\"];\n      }\n      target = target.parentNode;\n    }\n\n    return null;\n  }\n}\n\nexport default CustomTime;\n","import Emitter from \"component-emitter\";\nimport Hammer from \"../module/hammer.js\";\nimport * as hammerUtil from \"../hammerUtil.js\";\nimport util from \"../util.js\";\nimport TimeAxis from \"./component/TimeAxis.js\";\nimport Activator from \"../shared/Activator.js\";\nimport * as DateUtil from \"./DateUtil.js\";\nimport CustomTime from \"./component/CustomTime.js\";\n\n/**\n * Create a timeline visualization\n * @constructor Core\n */\nclass Core {\n  /**\n   * Create the main DOM for the Core: a root panel containing left, right,\n   * top, bottom, content, and background panel.\n   * @param {Element} container  The container element where the Core will\n   *                             be attached.\n   * @protected\n   */\n  _create(container) {\n    this.dom = {};\n\n    this.dom.container = container;\n    this.dom.container.style.position = \"relative\";\n\n    this.dom.root = document.createElement(\"div\");\n    this.dom.background = document.createElement(\"div\");\n    this.dom.backgroundVertical = document.createElement(\"div\");\n    this.dom.backgroundHorizontal = document.createElement(\"div\");\n    this.dom.centerContainer = document.createElement(\"div\");\n    this.dom.leftContainer = document.createElement(\"div\");\n    this.dom.rightContainer = document.createElement(\"div\");\n    this.dom.center = document.createElement(\"div\");\n    this.dom.left = document.createElement(\"div\");\n    this.dom.right = document.createElement(\"div\");\n    this.dom.top = document.createElement(\"div\");\n    this.dom.bottom = document.createElement(\"div\");\n    this.dom.shadowTop = document.createElement(\"div\");\n    this.dom.shadowBottom = document.createElement(\"div\");\n    this.dom.shadowTopLeft = document.createElement(\"div\");\n    this.dom.shadowBottomLeft = document.createElement(\"div\");\n    this.dom.shadowTopRight = document.createElement(\"div\");\n    this.dom.shadowBottomRight = document.createElement(\"div\");\n    this.dom.rollingModeBtn = document.createElement(\"div\");\n    this.dom.loadingScreen = document.createElement(\"div\");\n\n    this.dom.root.className = \"vis-timeline\";\n    this.dom.background.className = \"vis-panel vis-background\";\n    this.dom.backgroundVertical.className =\n      \"vis-panel vis-background vis-vertical\";\n    this.dom.backgroundHorizontal.className =\n      \"vis-panel vis-background vis-horizontal\";\n    this.dom.centerContainer.className = \"vis-panel vis-center\";\n    this.dom.leftContainer.className = \"vis-panel vis-left\";\n    this.dom.rightContainer.className = \"vis-panel vis-right\";\n    this.dom.top.className = \"vis-panel vis-top\";\n    this.dom.bottom.className = \"vis-panel vis-bottom\";\n    this.dom.left.className = \"vis-content\";\n    this.dom.center.className = \"vis-content\";\n    this.dom.right.className = \"vis-content\";\n    this.dom.shadowTop.className = \"vis-shadow vis-top\";\n    this.dom.shadowBottom.className = \"vis-shadow vis-bottom\";\n    this.dom.shadowTopLeft.className = \"vis-shadow vis-top\";\n    this.dom.shadowBottomLeft.className = \"vis-shadow vis-bottom\";\n    this.dom.shadowTopRight.className = \"vis-shadow vis-top\";\n    this.dom.shadowBottomRight.className = \"vis-shadow vis-bottom\";\n    this.dom.rollingModeBtn.className = \"vis-rolling-mode-btn\";\n    this.dom.loadingScreen.className = \"vis-loading-screen\";\n\n    this.dom.root.appendChild(this.dom.background);\n    this.dom.root.appendChild(this.dom.backgroundVertical);\n    this.dom.root.appendChild(this.dom.backgroundHorizontal);\n    this.dom.root.appendChild(this.dom.centerContainer);\n    this.dom.root.appendChild(this.dom.leftContainer);\n    this.dom.root.appendChild(this.dom.rightContainer);\n    this.dom.root.appendChild(this.dom.top);\n    this.dom.root.appendChild(this.dom.bottom);\n    this.dom.root.appendChild(this.dom.rollingModeBtn);\n\n    this.dom.centerContainer.appendChild(this.dom.center);\n    this.dom.leftContainer.appendChild(this.dom.left);\n    this.dom.rightContainer.appendChild(this.dom.right);\n    this.dom.centerContainer.appendChild(this.dom.shadowTop);\n    this.dom.centerContainer.appendChild(this.dom.shadowBottom);\n    this.dom.leftContainer.appendChild(this.dom.shadowTopLeft);\n    this.dom.leftContainer.appendChild(this.dom.shadowBottomLeft);\n    this.dom.rightContainer.appendChild(this.dom.shadowTopRight);\n    this.dom.rightContainer.appendChild(this.dom.shadowBottomRight);\n\n    // size properties of each of the panels\n    this.props = {\n      root: {},\n      background: {},\n      centerContainer: {},\n      leftContainer: {},\n      rightContainer: {},\n      center: {},\n      left: {},\n      right: {},\n      top: {},\n      bottom: {},\n      border: {},\n      scrollTop: 0,\n      scrollTopMin: 0,\n    };\n\n    this.on(\"rangechange\", () => {\n      if (this.initialDrawDone === true) {\n        this._redraw();\n      }\n    });\n    this.on(\"rangechanged\", () => {\n      if (!this.initialRangeChangeDone) {\n        this.initialRangeChangeDone = true;\n      }\n    });\n    this.on(\"touch\", this._onTouch.bind(this));\n    this.on(\"panmove\", this._onDrag.bind(this));\n\n    const me = this;\n    this._origRedraw = this._redraw.bind(this);\n    this._redraw = util.throttle(this._origRedraw);\n\n    this.on(\"_change\", (properties) => {\n      if (\n        me.itemSet &&\n        me.itemSet.initialItemSetDrawn &&\n        properties &&\n        properties.queue == true\n      ) {\n        me._redraw();\n      } else {\n        me._origRedraw();\n      }\n    });\n\n    // create event listeners for all interesting events, these events will be\n    // emitted via emitter\n    this.hammer = new Hammer(this.dom.root);\n    const pinchRecognizer = this.hammer.get(\"pinch\").set({ enable: true });\n    pinchRecognizer &&\n      hammerUtil.disablePreventDefaultVertically(pinchRecognizer);\n    this.hammer\n      .get(\"pan\")\n      .set({ threshold: 5, direction: Hammer.DIRECTION_ALL });\n    this.timelineListeners = {};\n\n    const events = [\n      \"tap\",\n      \"doubletap\",\n      \"press\",\n      \"pinch\",\n      \"pan\",\n      \"panstart\",\n      \"panmove\",\n      \"panend\",\n      // TODO: cleanup\n      //'touch', 'pinch',\n      //'tap', 'doubletap', 'hold',\n      //'dragstart', 'drag', 'dragend',\n      //'mousewheel', 'DOMMouseScroll' // DOMMouseScroll is needed for Firefox\n    ];\n    events.forEach((type) => {\n      const listener = (event) => {\n        if (me.isActive()) {\n          me.emit(type, event);\n        }\n      };\n      me.hammer.on(type, listener);\n      me.timelineListeners[type] = listener;\n    });\n\n    // emulate a touch event (emitted before the start of a pan, pinch, tap, or press)\n    hammerUtil.onTouch(this.hammer, (event) => {\n      me.emit(\"touch\", event);\n    });\n\n    // emulate a release event (emitted after a pan, pinch, tap, or press)\n    hammerUtil.onRelease(this.hammer, (event) => {\n      me.emit(\"release\", event);\n    });\n\n    /**\n     *\n     * @param {WheelEvent} event\n     */\n    function onMouseWheel(event) {\n      // Only allow scroll-wheel interaction if timeline is active and clickToUse is set to true.\n      if (!this.isActive()) return;\n\n      this.emit(\"mousewheel\", event);\n\n      // Prevent scrolling when zooming (no zoom key, or pressing zoom key)\n      if (this.options.preferZoom) {\n        // Return if key not configured OR is currently pressed (zoom only).\n        // TODO: Possible Bug: Should it not be the inverse behaviour? Aka. if pressed should allow user to scroll?\n        if (!this.options.zoomKey || event[this.options.zoomKey]) return;\n      } else {\n        // Return if key configured AND currently pressed\n        if (this.options.zoomKey && event[this.options.zoomKey]) return;\n      }\n\n      // Don't preventDefault if you can't scroll\n      if (!this.options.verticalScroll && !this.options.horizontalScroll)\n        return;\n\n      // deltaX and deltaY normalization from jquery.mousewheel.js\n      let deltaX = 0;\n      let deltaY = 0;\n\n      // Old school scrollwheel delta\n      if (\"detail\" in event) deltaY = event.detail * -1;\n      if (\"wheelDelta\" in event) deltaY = event.wheelDelta;\n      if (\"wheelDeltaY\" in event) deltaY = event.wheelDeltaY;\n      if (\"wheelDeltaX\" in event) deltaX = event.wheelDeltaX * -1;\n\n      // Firefox < 17 horizontal scrolling related to DOMMouseScroll event\n      if (\"axis\" in event && event.axis === event.HORIZONTAL_AXIS) {\n        deltaX = deltaY * -1;\n        deltaY = 0;\n      }\n\n      // New school wheel delta (wheel event)\n      if (\"deltaY\" in event) {\n        deltaY = event.deltaY * -1;\n      }\n      if (\"deltaX\" in event) {\n        deltaX = event.deltaX;\n      }\n\n      // Reasonable default wheel deltas\n      var LINE_HEIGHT = 40;\n      var PAGE_HEIGHT = 800;\n\n      // Normalize deltas\n      if (event.deltaMode) {\n        if (event.deltaMode === 1) {\n          // delta in LINE units\n          deltaX *= LINE_HEIGHT;\n          deltaY *= LINE_HEIGHT;\n        } else {\n          // delta in PAGE units\n          deltaX *= LINE_HEIGHT;\n          deltaY *= PAGE_HEIGHT;\n        }\n      }\n\n      // Vertical scroll preferred unless 'horizontalScrollKey' is configured and currently pressed.\n      const isVerticalScrollingPreferred = this.options.verticalScroll;\n      const isCurrentlyScrollingWithVerticalScrollWheel =\n        Math.abs(deltaY) >= Math.abs(deltaX);\n      const isHorizontalScrollKeyConfiguredAndPressed =\n        this.options.horizontalScroll &&\n        this.options.horizontalScrollKey &&\n        event[this.options.horizontalScrollKey];\n      if (\n        isVerticalScrollingPreferred &&\n        isCurrentlyScrollingWithVerticalScrollWheel &&\n        !isHorizontalScrollKeyConfiguredAndPressed\n      ) {\n        const current = this.props.scrollTop;\n        const adjusted = current + deltaY;\n\n        const newScrollTop = this._setScrollTop(adjusted);\n        if (newScrollTop !== current) {\n          this._redraw();\n          this.emit(\"scroll\", event);\n\n          // Prevent default actions caused by mouse wheel\n          // (else the page and timeline both scroll)\n          event.preventDefault();\n        }\n\n        return;\n      }\n\n      // If option 'verticalScroll' disabled or 'horizontalScroll' is configured\n      if (this.options.horizontalScroll) {\n        this.range.stopRolling();\n\n        // Depending on the mouse wheel used chose the delta (some mice have the hardware for both)\n        const delta = isCurrentlyScrollingWithVerticalScrollWheel\n          ? deltaY\n          : deltaX;\n\n        // Calculate a single scroll jump relative to the range scale\n        let diff = ((delta / 120) * (this.range.end - this.range.start)) / 20;\n\n        // Invert scroll direction\n        //  ...unless the user uses a horizontal mouse-wheel as found on the \"Logi Master\" series.\n        // In other words only invert the direction when a vertical scroll-wheel is used.\n        // Reason: Usually the user controls this behaviour via the driver software and it isn't linked to the vertical-scroll behaviour.\n        if (\n          this.options.horizontalScrollInvert &&\n          isCurrentlyScrollingWithVerticalScrollWheel\n        )\n          diff = -diff;\n\n        // calculate new start and end\n        const newStart = this.range.start + diff;\n        const newEnd = this.range.end + diff;\n        const options = {\n          animation: false,\n          byUser: true,\n          event: event,\n        };\n        this.range.setRange(newStart, newEnd, options);\n\n        event.preventDefault();\n\n        // Here in case of any future behaviour following after\n        return;\n      }\n    }\n\n    // Add modern wheel event listener\n    const wheelType =\n      \"onwheel\" in document.createElement(\"div\")\n        ? \"wheel\" // Modern browsers support \"wheel\"\n        : document.onmousewheel !== undefined\n          ? \"mousewheel\" // Webkit and IE support at least \"mousewheel\"\n          : // DOMMouseScroll - Older Firefox versions use \"DOMMouseScroll\"\n            // onmousewheel - All the use \"onmousewheel\"\n            this.dom.centerContainer.addEventListener\n            ? \"DOMMouseScroll\"\n            : \"onmousewheel\";\n    this.dom.top.addEventListener ? \"DOMMouseScroll\" : \"onmousewheel\";\n    this.dom.bottom.addEventListener ? \"DOMMouseScroll\" : \"onmousewheel\";\n    this.dom.centerContainer.addEventListener(\n      wheelType,\n      onMouseWheel.bind(this),\n      false,\n    );\n    this.dom.top.addEventListener(wheelType, onMouseWheel.bind(this), false);\n    this.dom.bottom.addEventListener(wheelType, onMouseWheel.bind(this), false);\n\n    /**\n     *\n     * @param {scroll} event\n     */\n    function onMouseScrollSide(event) {\n      if (!me.options.verticalScroll) return;\n\n      event.preventDefault();\n      if (me.isActive()) {\n        const adjusted = -event.target.scrollTop;\n        me._setScrollTop(adjusted);\n        me._redraw();\n        me.emit(\"scrollSide\", event);\n      }\n    }\n\n    this.dom.left.parentNode.addEventListener(\n      \"scroll\",\n      onMouseScrollSide.bind(this),\n    );\n    this.dom.right.parentNode.addEventListener(\n      \"scroll\",\n      onMouseScrollSide.bind(this),\n    );\n\n    let itemAddedToTimeline = false;\n\n    /**\n     *\n     * @param {dragover} event\n     * @returns {boolean}\n     */\n    function handleDragOver(event) {\n      if (event.preventDefault) {\n        me.emit(\"dragover\", me.getEventProperties(event));\n        event.preventDefault(); // Necessary. Allows us to drop.\n      }\n\n      // make sure your target is a timeline element\n      if (!(event.target.className.indexOf(\"timeline\") > -1)) return;\n\n      // make sure only one item is added every time you're over the timeline\n      if (itemAddedToTimeline) return;\n\n      event.dataTransfer.dropEffect = \"move\";\n      itemAddedToTimeline = true;\n      return false;\n    }\n\n    /**\n     *\n     * @param {drop} event\n     * @returns {boolean}\n     */\n    function handleDrop(event) {\n      // prevent redirect to blank page - Firefox\n      if (event.preventDefault) {\n        event.preventDefault();\n      }\n      if (event.stopPropagation) {\n        event.stopPropagation();\n      }\n      // return when dropping non-timeline items\n      try {\n        var itemData = JSON.parse(event.dataTransfer.getData(\"text\"));\n        if (!itemData || !itemData.content) return;\n      } catch (err) {\n        return false;\n      }\n\n      itemAddedToTimeline = false;\n      event.center = {\n        x: event.clientX,\n        y: event.clientY,\n      };\n\n      if (itemData.target !== \"item\") {\n        me.itemSet._onAddItem(event);\n      } else {\n        me.itemSet._onDropObjectOnItem(event);\n      }\n      me.emit(\"drop\", me.getEventProperties(event));\n      return false;\n    }\n\n    this.dom.center.addEventListener(\n      \"dragover\",\n      handleDragOver.bind(this),\n      false,\n    );\n    this.dom.center.addEventListener(\"drop\", handleDrop.bind(this), false);\n\n    this.customTimes = [];\n\n    // store state information needed for touch events\n    this.touch = {};\n\n    this.redrawCount = 0;\n    this.initialDrawDone = false;\n    this.initialRangeChangeDone = false;\n\n    // attach the root panel to the provided container\n    if (!container) throw new Error(\"No container provided\");\n    container.appendChild(this.dom.root);\n    container.appendChild(this.dom.loadingScreen);\n  }\n\n  /**\n   * Set options. Options will be passed to all components loaded in the Timeline.\n   * @param {Object} [options]\n   *                           {String} orientation\n   *                              Vertical orientation for the Timeline,\n   *                              can be 'bottom' (default) or 'top'.\n   *                           {string | number} width\n   *                              Width for the timeline, a number in pixels or\n   *                              a css string like '1000px' or '75%'. '100%' by default.\n   *                           {string | number} height\n   *                              Fixed height for the Timeline, a number in pixels or\n   *                              a css string like '400px' or '75%'. If undefined,\n   *                              The Timeline will automatically size such that\n   *                              its contents fit.\n   *                           {string | number} minHeight\n   *                              Minimum height for the Timeline, a number in pixels or\n   *                              a css string like '400px' or '75%'.\n   *                           {string | number} maxHeight\n   *                              Maximum height for the Timeline, a number in pixels or\n   *                              a css string like '400px' or '75%'.\n   *                           {number | Date | string} start\n   *                              Start date for the visible window\n   *                           {number | Date | string} end\n   *                              End date for the visible window\n   */\n  setOptions(options) {\n    if (options) {\n      // copy the known options\n      const fields = [\n        \"width\",\n        \"height\",\n        \"minHeight\",\n        \"maxHeight\",\n        \"autoResize\",\n        \"start\",\n        \"end\",\n        \"clickToUse\",\n        \"dataAttributes\",\n        \"hiddenDates\",\n        \"locale\",\n        \"locales\",\n        \"moment\",\n        \"preferZoom\",\n        \"rtl\",\n        \"zoomKey\",\n        \"horizontalScroll\",\n        \"horizontalScrollKey\",\n        \"horizontalScrollInvert\",\n        \"verticalScroll\",\n        \"longSelectPressTime\",\n        \"snap\",\n      ];\n      util.selectiveExtend(fields, this.options, options);\n      this.dom.rollingModeBtn.style.visibility = \"hidden\";\n\n      if (this.options.rtl) {\n        this.dom.container.style.direction = \"rtl\";\n        this.dom.backgroundVertical.className =\n          \"vis-panel vis-background vis-vertical-rtl\";\n      }\n\n      if (this.options.verticalScroll) {\n        if (this.options.rtl) {\n          this.dom.rightContainer.className =\n            \"vis-panel vis-right vis-vertical-scroll\";\n        } else {\n          this.dom.leftContainer.className =\n            \"vis-panel vis-left vis-vertical-scroll\";\n        }\n      }\n\n      if (typeof this.options.orientation !== \"object\") {\n        this.options.orientation = { item: undefined, axis: undefined };\n      }\n      if (\"orientation\" in options) {\n        if (typeof options.orientation === \"string\") {\n          this.options.orientation = {\n            item: options.orientation,\n            axis: options.orientation,\n          };\n        } else if (typeof options.orientation === \"object\") {\n          if (\"item\" in options.orientation) {\n            this.options.orientation.item = options.orientation.item;\n          }\n          if (\"axis\" in options.orientation) {\n            this.options.orientation.axis = options.orientation.axis;\n          }\n        }\n      }\n\n      if (this.options.orientation.axis === \"both\") {\n        if (!this.timeAxis2) {\n          const timeAxis2 = (this.timeAxis2 = new TimeAxis(\n            this.body,\n            this.options,\n          ));\n          timeAxis2.setOptions = (options) => {\n            const _options = options ? util.extend({}, options) : {};\n            _options.orientation = \"top\"; // override the orientation option, always top\n            TimeAxis.prototype.setOptions.call(timeAxis2, _options);\n          };\n          this.components.push(timeAxis2);\n        }\n      } else {\n        if (this.timeAxis2) {\n          const index = this.components.indexOf(this.timeAxis2);\n          if (index !== -1) {\n            this.components.splice(index, 1);\n          }\n          this.timeAxis2.destroy();\n          this.timeAxis2 = null;\n        }\n      }\n\n      // if the graph2d's drawPoints is a function delegate the callback to the onRender property\n      if (typeof options.drawPoints == \"function\") {\n        options.drawPoints = {\n          onRender: options.drawPoints,\n        };\n      }\n\n      if (\"hiddenDates\" in this.options) {\n        DateUtil.convertHiddenOptions(\n          this.options.moment,\n          this.body,\n          this.options.hiddenDates,\n        );\n      }\n\n      if (\"clickToUse\" in options) {\n        if (options.clickToUse) {\n          if (!this.activator) {\n            this.activator = new Activator(this.dom.root);\n          }\n        } else {\n          if (this.activator) {\n            this.activator.destroy();\n            delete this.activator;\n          }\n        }\n      }\n\n      // enable/disable autoResize\n      this._initAutoResize();\n    }\n\n    // propagate options to all components\n    this.components.forEach((component) => component.setOptions(options));\n\n    // enable/disable configure\n    if (\"configure\" in options) {\n      if (!this.configurator) {\n        this.configurator = this._createConfigurator();\n      }\n\n      this.configurator.setOptions(options.configure);\n\n      // collect the settings of all components, and pass them to the configuration system\n      const appliedOptions = util.deepExtend({}, this.options);\n      this.components.forEach((component) => {\n        util.deepExtend(appliedOptions, component.options);\n      });\n      this.configurator.setModuleOptions({ global: appliedOptions });\n    }\n\n    this._redraw();\n  }\n\n  /**\n   * Returns true when the Timeline is active.\n   * @returns {boolean}\n   */\n  isActive() {\n    return !this.activator || this.activator.active;\n  }\n\n  /**\n   * Destroy the Core, clean up all DOM elements and event listeners.\n   */\n  destroy() {\n    // unbind datasets\n    this.setItems(null);\n    this.setGroups(null);\n\n    // remove all event listeners\n    this.off();\n\n    // stop checking for changed size\n    this._stopAutoResize();\n\n    // remove from DOM\n    if (this.dom.root.parentNode) {\n      this.dom.root.parentNode.removeChild(this.dom.root);\n    }\n    this.dom = null;\n\n    // remove Activator\n    if (this.activator) {\n      this.activator.destroy();\n      delete this.activator;\n    }\n\n    // cleanup hammer touch events\n    for (const event in this.timelineListeners) {\n      if (Object.prototype.hasOwnProperty.call(this.timelineListeners, event)) {\n        delete this.timelineListeners[event];\n      }\n    }\n    this.timelineListeners = null;\n    this.hammer && this.hammer.destroy();\n    this.hammer = null;\n\n    // give all components the opportunity to cleanup\n    this.components.forEach((component) => component.destroy());\n\n    this.body = null;\n  }\n\n  /**\n   * Set a custom time bar\n   * @param {Date} time\n   * @param {number} [id=undefined] Optional id of the custom time bar to be adjusted.\n   */\n  setCustomTime(time, id) {\n    const customTimes = this.customTimes.filter(\n      (component) => id === component.options.id,\n    );\n\n    if (customTimes.length === 0) {\n      throw new Error(`No custom time bar found with id ${JSON.stringify(id)}`);\n    }\n\n    if (customTimes.length > 0) {\n      customTimes[0].setCustomTime(time);\n    }\n  }\n\n  /**\n   * Retrieve the current custom time.\n   * @param {number} [id=undefined]    Id of the custom time bar.\n   * @return {Date | undefined} customTime\n   */\n  getCustomTime(id) {\n    const customTimes = this.customTimes.filter(\n      (component) => component.options.id === id,\n    );\n\n    if (customTimes.length === 0) {\n      throw new Error(`No custom time bar found with id ${JSON.stringify(id)}`);\n    }\n    return customTimes[0].getCustomTime();\n  }\n\n  /**\n   * Set a custom marker for the custom time bar.\n   * @param {string} [title] Title of the custom marker.\n   * @param {number} [id=undefined] Id of the custom marker.\n   * @param {boolean} [editable=false] Make the custom marker editable.\n   */\n  setCustomTimeMarker(title, id, editable) {\n    const customTimes = this.customTimes.filter(\n      (component) => component.options.id === id,\n    );\n\n    if (customTimes.length === 0) {\n      throw new Error(`No custom time bar found with id ${JSON.stringify(id)}`);\n    }\n    if (customTimes.length > 0) {\n      customTimes[0].setCustomMarker(title, editable);\n    }\n  }\n\n  /**\n   * Set a custom title for the custom time bar.\n   * @param {string} [title] Custom title\n   * @param {number} [id=undefined]    Id of the custom time bar.\n   * @returns {*}\n   */\n  setCustomTimeTitle(title, id) {\n    const customTimes = this.customTimes.filter(\n      (component) => component.options.id === id,\n    );\n\n    if (customTimes.length === 0) {\n      throw new Error(`No custom time bar found with id ${JSON.stringify(id)}`);\n    }\n    if (customTimes.length > 0) {\n      return customTimes[0].setCustomTitle(title);\n    }\n  }\n\n  /**\n   * Retrieve meta information from an event.\n   * Should be overridden by classes extending Core\n   * @param {Event} event\n   * @return {Object} An object with related information.\n   */\n  getEventProperties(event) {\n    return { event };\n  }\n\n  /**\n   * Add custom vertical bar\n   * @param {Date | string | number} [time]  A Date, unix timestamp, or\n   *                                         ISO date string. Time point where\n   *                                         the new bar should be placed.\n   *                                         If not provided, `new Date()` will\n   *                                         be used.\n   * @param {number | string} [id=undefined] Id of the new bar. Optional\n   * @return {number | string}               Returns the id of the new bar\n   */\n  addCustomTime(time, id) {\n    const timestamp =\n      time !== undefined ? util.convert(time, \"Date\") : new Date();\n\n    const exists = this.customTimes.some(\n      (customTime) => customTime.options.id === id,\n    );\n    if (exists) {\n      throw new Error(\n        `A custom time with id ${JSON.stringify(id)} already exists`,\n      );\n    }\n\n    const customTime = new CustomTime(\n      this.body,\n      util.extend({}, this.options, {\n        time: timestamp,\n        id,\n        snap: this.itemSet ? this.itemSet.options.snap : this.options.snap,\n      }),\n    );\n\n    this.customTimes.push(customTime);\n    this.components.push(customTime);\n    this._redraw();\n\n    return id;\n  }\n\n  /**\n   * Remove previously added custom bar\n   * @param {int} id ID of the custom bar to be removed\n   * [at]returns {boolean} True if the bar exists and is removed, false otherwise\n   */\n  removeCustomTime(id) {\n    const customTimes = this.customTimes.filter((bar) => bar.options.id === id);\n\n    if (customTimes.length === 0) {\n      throw new Error(`No custom time bar found with id ${JSON.stringify(id)}`);\n    }\n\n    customTimes.forEach((customTime) => {\n      this.customTimes.splice(this.customTimes.indexOf(customTime), 1);\n      this.components.splice(this.components.indexOf(customTime), 1);\n      customTime.destroy();\n    });\n  }\n\n  /**\n   * Get the id's of the currently visible items.\n   * @returns {Array} The ids of the visible items\n   */\n  getVisibleItems() {\n    return (this.itemSet && this.itemSet.getVisibleItems()) || [];\n  }\n\n  /**\n   * Get the id's of the items at specific time, where a click takes place on the timeline.\n   * @param {Date} timeOfEvent The point in time to query items.\n   * @returns {Array} The ids of all items in existence at the time of event.\n   */\n  getItemsAtCurrentTime(timeOfEvent) {\n    this.time = timeOfEvent;\n    return (\n      (this.itemSet && this.itemSet.getItemsAtCurrentTime(this.time)) || []\n    );\n  }\n\n  /**\n   * Get the id's of the currently visible groups.\n   * @returns {Array} The ids of the visible groups\n   */\n  getVisibleGroups() {\n    return (this.itemSet && this.itemSet.getVisibleGroups()) || [];\n  }\n\n  /**\n   * Set Core window such that it fits all items\n   * @param {Object} [options]  Available options:\n   *                                `animation: boolean | {duration: number, easingFunction: string}`\n   *                                    If true (default), the range is animated\n   *                                    smoothly to the new window. An object can be\n   *                                    provided to specify duration and easing function.\n   *                                    Default duration is 500 ms, and default easing\n   *                                    function is 'easeInOutQuad'.\n   * @param {function} [callback] a callback funtion to be executed at the end of this function\n   */\n  fit(options, callback) {\n    const range = this.getDataRange();\n\n    // skip range set if there is no min and max date\n    if (range.min === null && range.max === null) {\n      return;\n    }\n\n    // apply a margin of 1% left and right of the data\n    const interval = range.max - range.min;\n    const min = new Date(range.min.valueOf() - interval * 0.01);\n    const max = new Date(range.max.valueOf() + interval * 0.01);\n    const animation =\n      options && options.animation !== undefined ? options.animation : true;\n    this.range.setRange(min, max, { animation }, callback);\n  }\n\n  /**\n   * Calculate the data range of the items start and end dates\n   * [at]returns {{min: [Date], max: [Date]}}\n   * @protected\n   */\n  getDataRange() {\n    // must be implemented by Timeline and Graph2d\n    throw new Error(\"Cannot invoke abstract method getDataRange\");\n  }\n\n  /**\n   * Set the visible window. Both parameters are optional, you can change only\n   * start or only end. Syntax:\n   *\n   *     TimeLine.setWindow(start, end)\n   *     TimeLine.setWindow(start, end, options)\n   *     TimeLine.setWindow(range)\n   *\n   * Where start and end can be a Date, number, or string, and range is an\n   * object with properties start and end.\n   *\n   * @param {Date | number | string | Object} [start] Start date of visible window\n   * @param {Date | number | string} [end]            End date of visible window\n   * @param {Object} [options]  Available options:\n   *                                `animation: boolean | {duration: number, easingFunction: string}`\n   *                                    If true (default), the range is animated\n   *                                    smoothly to the new window. An object can be\n   *                                    provided to specify duration and easing function.\n   *                                    Default duration is 500 ms, and default easing\n   *                                    function is 'easeInOutQuad'.\n   * @param {function} [callback] a callback funtion to be executed at the end of this function\n   */\n  setWindow(start, end, options, callback) {\n    if (typeof arguments[2] == \"function\") {\n      callback = arguments[2];\n      options = {};\n    }\n    let animation;\n    let range;\n    if (arguments.length == 1) {\n      range = arguments[0];\n      animation = range.animation !== undefined ? range.animation : true;\n      this.range.setRange(range.start, range.end, { animation });\n    } else if (arguments.length == 2 && typeof arguments[1] == \"function\") {\n      range = arguments[0];\n      callback = arguments[1];\n      animation = range.animation !== undefined ? range.animation : true;\n      this.range.setRange(range.start, range.end, { animation }, callback);\n    } else {\n      animation =\n        options && options.animation !== undefined ? options.animation : true;\n      this.range.setRange(start, end, { animation }, callback);\n    }\n  }\n\n  /**\n   * Move the window such that given time is centered on screen.\n   * @param {Date | number | string} time\n   * @param {Object} [options]  Available options:\n   *                                `animation: boolean | {duration: number, easingFunction: string}`\n   *                                    If true (default), the range is animated\n   *                                    smoothly to the new window. An object can be\n   *                                    provided to specify duration and easing function.\n   *                                    Default duration is 500 ms, and default easing\n   *                                    function is 'easeInOutQuad'.\n   * @param {function} [callback] a callback funtion to be executed at the end of this function\n   */\n  moveTo(time, options, callback) {\n    if (typeof arguments[1] == \"function\") {\n      callback = arguments[1];\n      options = {};\n    }\n    const interval = this.range.end - this.range.start;\n    const t = util.convert(time, \"Date\").valueOf();\n\n    const start = t - interval / 2;\n    const end = t + interval / 2;\n    const animation =\n      options && options.animation !== undefined ? options.animation : true;\n\n    this.range.setRange(start, end, { animation }, callback);\n  }\n\n  /**\n   * Get the visible window\n   * @return {{start: Date, end: Date}}   Visible range\n   */\n  getWindow() {\n    const range = this.range.getRange();\n    return {\n      start: new Date(range.start),\n      end: new Date(range.end),\n    };\n  }\n\n  /**\n   * Zoom in the window such that given time is centered on screen.\n   * @param {number} percentage - must be between [0..1]\n   * @param {Object} [options]  Available options:\n   *                                `animation: boolean | {duration: number, easingFunction: string}`\n   *                                    If true (default), the range is animated\n   *                                    smoothly to the new window. An object can be\n   *                                    provided to specify duration and easing function.\n   *                                    Default duration is 500 ms, and default easing\n   *                                    function is 'easeInOutQuad'.\n   * @param {function} [callback] a callback funtion to be executed at the end of this function\n   */\n  zoomIn(percentage, options, callback) {\n    if (!percentage || percentage < 0 || percentage > 1) return;\n    if (typeof arguments[1] == \"function\") {\n      callback = arguments[1];\n      options = {};\n    }\n    const range = this.getWindow();\n    const start = range.start.valueOf();\n    const end = range.end.valueOf();\n    const interval = end - start;\n    const newInterval = interval / (1 + percentage);\n    const distance = (interval - newInterval) / 2;\n    const newStart = start + distance;\n    const newEnd = end - distance;\n\n    this.setWindow(newStart, newEnd, options, callback);\n  }\n\n  /**\n   * Zoom out the window such that given time is centered on screen.\n   * @param {number} percentage - must be between [0..1]\n   * @param {Object} [options]  Available options:\n   *                                `animation: boolean | {duration: number, easingFunction: string}`\n   *                                    If true (default), the range is animated\n   *                                    smoothly to the new window. An object can be\n   *                                    provided to specify duration and easing function.\n   *                                    Default duration is 500 ms, and default easing\n   *                                    function is 'easeInOutQuad'.\n   * @param {function} [callback] a callback funtion to be executed at the end of this function\n   */\n  zoomOut(percentage, options, callback) {\n    if (!percentage || percentage < 0 || percentage > 1) return;\n    if (typeof arguments[1] == \"function\") {\n      callback = arguments[1];\n      options = {};\n    }\n    const range = this.getWindow();\n    const start = range.start.valueOf();\n    const end = range.end.valueOf();\n    const interval = end - start;\n    const newStart = start - (interval * percentage) / 2;\n    const newEnd = end + (interval * percentage) / 2;\n\n    this.setWindow(newStart, newEnd, options, callback);\n  }\n\n  /**\n   * Force a redraw. Can be overridden by implementations of Core\n   *\n   * Note: this function will be overridden on construction with a trottled version\n   */\n  redraw() {\n    this._redraw();\n  }\n\n  /**\n   * Redraw for internal use. Redraws all components. See also the public\n   * method redraw.\n   * @protected\n   */\n  _redraw() {\n    this.redrawCount++;\n    const dom = this.dom;\n\n    if (!dom || !dom.container || dom.root.offsetWidth == 0) return; // when destroyed, or invisible\n\n    let resized = false;\n    const options = this.options;\n    const props = this.props;\n\n    DateUtil.updateHiddenDates(\n      this.options.moment,\n      this.body,\n      this.options.hiddenDates,\n    );\n\n    // update class names\n    if (options.orientation == \"top\") {\n      util.addClassName(dom.root, \"vis-top\");\n      util.removeClassName(dom.root, \"vis-bottom\");\n    } else {\n      util.removeClassName(dom.root, \"vis-top\");\n      util.addClassName(dom.root, \"vis-bottom\");\n    }\n\n    if (options.rtl) {\n      util.addClassName(dom.root, \"vis-rtl\");\n      util.removeClassName(dom.root, \"vis-ltr\");\n    } else {\n      util.addClassName(dom.root, \"vis-ltr\");\n      util.removeClassName(dom.root, \"vis-rtl\");\n    }\n\n    // update root width and height options\n    dom.root.style.maxHeight = util.option.asSize(options.maxHeight, \"\");\n    dom.root.style.minHeight = util.option.asSize(options.minHeight, \"\");\n    dom.root.style.width = util.option.asSize(options.width, \"\");\n    const rootOffsetWidth = dom.root.offsetWidth;\n\n    // calculate border widths\n    props.border.left = 1;\n    props.border.right = 1;\n    props.border.top = 1;\n    props.border.bottom = 1;\n\n    // calculate the heights. If any of the side panels is empty, we set the height to\n    // minus the border width, such that the border will be invisible\n    props.center.height = dom.center.offsetHeight;\n    props.left.height = dom.left.offsetHeight;\n    props.right.height = dom.right.offsetHeight;\n    props.top.height = dom.top.clientHeight || -props.border.top;\n    props.bottom.height =\n      Math.round(dom.bottom.getBoundingClientRect().height) ||\n      dom.bottom.clientHeight ||\n      -props.border.bottom;\n\n    // TODO: compensate borders when any of the panels is empty.\n\n    // apply auto height\n    // TODO: only calculate autoHeight when needed (else we cause an extra reflow/repaint of the DOM)\n    const contentHeight = Math.max(\n      props.left.height,\n      props.center.height,\n      props.right.height,\n    );\n    const autoHeight =\n      props.top.height +\n      contentHeight +\n      props.bottom.height +\n      props.border.top +\n      props.border.bottom;\n    dom.root.style.height = util.option.asSize(\n      options.height,\n      `${autoHeight}px`,\n    );\n\n    // calculate heights of the content panels\n    props.root.height = dom.root.offsetHeight;\n    props.background.height = props.root.height;\n    const containerHeight =\n      props.root.height - props.top.height - props.bottom.height;\n    props.centerContainer.height = containerHeight;\n    props.leftContainer.height = containerHeight;\n    props.rightContainer.height = props.leftContainer.height;\n\n    // calculate the widths of the panels\n    props.root.width = rootOffsetWidth;\n    props.background.width = props.root.width;\n\n    if (!this.initialDrawDone) {\n      props.scrollbarWidth = util.getScrollBarWidth();\n    }\n\n    const leftContainerClientWidth = dom.leftContainer.clientWidth;\n    const rightContainerClientWidth = dom.rightContainer.clientWidth;\n\n    if (options.verticalScroll) {\n      if (options.rtl) {\n        props.left.width = leftContainerClientWidth || -props.border.left;\n        props.right.width =\n          rightContainerClientWidth + props.scrollbarWidth ||\n          -props.border.right;\n      } else {\n        props.left.width =\n          leftContainerClientWidth + props.scrollbarWidth || -props.border.left;\n        props.right.width = rightContainerClientWidth || -props.border.right;\n      }\n    } else {\n      props.left.width = leftContainerClientWidth || -props.border.left;\n      props.right.width = rightContainerClientWidth || -props.border.right;\n    }\n\n    this._setDOM();\n\n    // update the scrollTop, feasible range for the offset can be changed\n    // when the height of the Core or of the contents of the center changed\n    let offset = this._updateScrollTop();\n\n    // reposition the scrollable contents\n    if (options.orientation.item != \"top\") {\n      offset += Math.max(\n        props.centerContainer.height -\n          props.center.height -\n          props.border.top -\n          props.border.bottom,\n        0,\n      );\n    }\n    dom.center.style.transform = `translateY(${offset}px)`;\n\n    // show shadows when vertical scrolling is available\n    const visibilityTop = props.scrollTop == 0 ? \"hidden\" : \"\";\n    const visibilityBottom =\n      props.scrollTop == props.scrollTopMin ? \"hidden\" : \"\";\n    dom.shadowTop.style.visibility = visibilityTop;\n    dom.shadowBottom.style.visibility = visibilityBottom;\n    dom.shadowTopLeft.style.visibility = visibilityTop;\n    dom.shadowBottomLeft.style.visibility = visibilityBottom;\n    dom.shadowTopRight.style.visibility = visibilityTop;\n    dom.shadowBottomRight.style.visibility = visibilityBottom;\n\n    if (options.verticalScroll) {\n      dom.rightContainer.className = \"vis-panel vis-right vis-vertical-scroll\";\n      dom.leftContainer.className = \"vis-panel vis-left vis-vertical-scroll\";\n\n      dom.shadowTopRight.style.visibility = \"hidden\";\n      dom.shadowBottomRight.style.visibility = \"hidden\";\n      dom.shadowTopLeft.style.visibility = \"hidden\";\n      dom.shadowBottomLeft.style.visibility = \"hidden\";\n\n      dom.left.style.top = \"0px\";\n      dom.right.style.top = \"0px\";\n    }\n\n    if (\n      !options.verticalScroll ||\n      props.center.height < props.centerContainer.height\n    ) {\n      dom.left.style.top = `${offset}px`;\n      dom.right.style.top = `${offset}px`;\n      dom.rightContainer.className = dom.rightContainer.className.replace(\n        new RegExp(\"(?:^|\\\\s)\" + \"vis-vertical-scroll\" + \"(?:\\\\s|$)\"),\n        \" \",\n      );\n      dom.leftContainer.className = dom.leftContainer.className.replace(\n        new RegExp(\"(?:^|\\\\s)\" + \"vis-vertical-scroll\" + \"(?:\\\\s|$)\"),\n        \" \",\n      );\n      props.left.width = leftContainerClientWidth || -props.border.left;\n      props.right.width = rightContainerClientWidth || -props.border.right;\n      this._setDOM();\n    }\n\n    // enable/disable vertical panning\n    const contentsOverflow = props.center.height > props.centerContainer.height;\n    this.hammer.get(\"pan\").set({\n      direction: contentsOverflow\n        ? Hammer.DIRECTION_ALL\n        : Hammer.DIRECTION_HORIZONTAL,\n    });\n\n    // set the long press time\n    this.hammer.get(\"press\").set({\n      time: this.options.longSelectPressTime,\n    });\n\n    // redraw all components\n    this.components.forEach((component) => {\n      resized = component.redraw() || resized;\n    });\n    const MAX_REDRAW = 5;\n    if (resized) {\n      if (this.redrawCount < MAX_REDRAW) {\n        this.body.emitter.emit(\"_change\");\n        return;\n      } else {\n        console.log(\"WARNING: infinite loop in redraw?\");\n      }\n    } else {\n      this.redrawCount = 0;\n    }\n\n    //Emit public 'changed' event for UI updates, see issue #1592\n    this.body.emitter.emit(\"changed\");\n  }\n\n  /**\n   * sets the basic DOM components needed for the timeline\\graph2d\n   */\n  _setDOM() {\n    const props = this.props;\n    const dom = this.dom;\n\n    props.leftContainer.width = props.left.width;\n    props.rightContainer.width = props.right.width;\n    const centerWidth = props.root.width - props.left.width - props.right.width;\n    props.center.width = centerWidth;\n    props.centerContainer.width = centerWidth;\n    props.top.width = centerWidth;\n    props.bottom.width = centerWidth;\n\n    // resize the panels\n    dom.background.style.height = `${props.background.height}px`;\n    dom.backgroundVertical.style.height = `${props.background.height}px`;\n    dom.backgroundHorizontal.style.height = `${props.centerContainer.height}px`;\n    dom.centerContainer.style.height = `${props.centerContainer.height}px`;\n    dom.leftContainer.style.height = `${props.leftContainer.height}px`;\n    dom.rightContainer.style.height = `${props.rightContainer.height}px`;\n\n    dom.background.style.width = `${props.background.width}px`;\n    dom.backgroundVertical.style.width = `${props.centerContainer.width}px`;\n    dom.backgroundHorizontal.style.width = `${props.background.width}px`;\n    dom.centerContainer.style.width = `${props.center.width}px`;\n    dom.top.style.width = `${props.top.width}px`;\n    dom.bottom.style.width = `${props.bottom.width}px`;\n\n    // reposition the panels\n    dom.background.style.left = \"0\";\n    dom.background.style.top = \"0\";\n    dom.backgroundVertical.style.left = `${props.left.width + props.border.left}px`;\n    dom.backgroundVertical.style.top = \"0\";\n    dom.backgroundHorizontal.style.left = \"0\";\n    dom.backgroundHorizontal.style.top = `${props.top.height}px`;\n    dom.centerContainer.style.left = `${props.left.width}px`;\n    dom.centerContainer.style.top = `${props.top.height}px`;\n    dom.leftContainer.style.left = \"0\";\n    dom.leftContainer.style.top = `${props.top.height}px`;\n    dom.rightContainer.style.left = `${props.left.width + props.center.width}px`;\n    dom.rightContainer.style.top = `${props.top.height}px`;\n    dom.top.style.left = `${props.left.width}px`;\n    dom.top.style.top = \"0\";\n    dom.bottom.style.left = `${props.left.width}px`;\n    dom.bottom.style.top = `${props.top.height + props.centerContainer.height}px`;\n    dom.center.style.left = \"0\";\n    dom.left.style.left = \"0\";\n    dom.right.style.left = \"0\";\n  }\n\n  /**\n   * Set a current time. This can be used for example to ensure that a client's\n   * time is synchronized with a shared server time.\n   * Only applicable when option `showCurrentTime` is true.\n   * @param {Date | string | number} time     A Date, unix timestamp, or\n   *                                          ISO date string.\n   */\n  setCurrentTime(time) {\n    if (!this.currentTime) {\n      throw new Error(\"Option showCurrentTime must be true\");\n    }\n\n    this.currentTime.setCurrentTime(time);\n  }\n\n  /**\n   * Get the current time.\n   * Only applicable when option `showCurrentTime` is true.\n   * @return {Date} Returns the current time.\n   */\n  getCurrentTime() {\n    if (!this.currentTime) {\n      throw new Error(\"Option showCurrentTime must be true\");\n    }\n\n    return this.currentTime.getCurrentTime();\n  }\n\n  /**\n   * Convert a position on screen (pixels) to a datetime\n   * @param {int}     x    Position on the screen in pixels\n   * @return {Date}   time The datetime the corresponds with given position x\n   * @protected\n   * TODO: move this function to Range\n   */\n  _toTime(x) {\n    return DateUtil.toTime(this, x, this.props.center.width);\n  }\n\n  /**\n   * Convert a position on the global screen (pixels) to a datetime\n   * @param {int}     x    Position on the screen in pixels\n   * @return {Date}   time The datetime the corresponds with given position x\n   * @protected\n   * TODO: move this function to Range\n   */\n  _toGlobalTime(x) {\n    return DateUtil.toTime(this, x, this.props.root.width);\n    //var conversion = this.range.conversion(this.props.root.width);\n    //return new Date(x / conversion.scale + conversion.offset);\n  }\n\n  /**\n   * Convert a datetime (Date object) into a position on the screen\n   * @param {Date}   time A date\n   * @return {int}   x    The position on the screen in pixels which corresponds\n   *                      with the given date.\n   * @protected\n   * TODO: move this function to Range\n   */\n  _toScreen(time) {\n    return DateUtil.toScreen(this, time, this.props.center.width);\n  }\n\n  /**\n   * Convert a datetime (Date object) into a position on the root\n   * This is used to get the pixel density estimate for the screen, not the center panel\n   * @param {Date}   time A date\n   * @return {int}   x    The position on root in pixels which corresponds\n   *                      with the given date.\n   * @protected\n   * TODO: move this function to Range\n   */\n  _toGlobalScreen(time) {\n    return DateUtil.toScreen(this, time, this.props.root.width);\n    //var conversion = this.range.conversion(this.props.root.width);\n    //return (time.valueOf() - conversion.offset) * conversion.scale;\n  }\n\n  /**\n   * Initialize watching when option autoResize is true\n   * @private\n   */\n  _initAutoResize() {\n    if (this.options.autoResize == true) {\n      this._startAutoResize();\n    } else {\n      this._stopAutoResize();\n    }\n  }\n\n  /**\n   * Watch for changes in the size of the container. On resize, the Panel will\n   * automatically redraw itself.\n   * @private\n   */\n  _startAutoResize() {\n    const me = this;\n\n    this._stopAutoResize();\n\n    this._onResize = () => {\n      if (me.options.autoResize != true) {\n        // stop watching when the option autoResize is changed to false\n        me._stopAutoResize();\n        return;\n      }\n\n      if (me.dom.root) {\n        const rootOffsetHeight = me.dom.root.offsetHeight;\n        const rootOffsetWidth = me.dom.root.offsetWidth;\n        // check whether the frame is resized\n        // Note: we compare offsetWidth here, not clientWidth. For some reason,\n        // IE does not restore the clientWidth from 0 to the actual width after\n        // changing the timeline's container display style from none to visible\n        if (\n          rootOffsetWidth != me.props.lastWidth ||\n          rootOffsetHeight != me.props.lastHeight\n        ) {\n          me.props.lastWidth = rootOffsetWidth;\n          me.props.lastHeight = rootOffsetHeight;\n          me.props.scrollbarWidth = util.getScrollBarWidth();\n\n          me.body.emitter.emit(\"_change\");\n        }\n      }\n    };\n\n    // add event listener to window resize\n    window.addEventListener(\"resize\", this._onResize);\n\n    //Prevent initial unnecessary redraw\n    if (me.dom.root) {\n      me.props.lastWidth = me.dom.root.offsetWidth;\n      me.props.lastHeight = me.dom.root.offsetHeight;\n    }\n\n    this.watchTimer = setInterval(this._onResize, 1000);\n  }\n\n  /**\n   * Stop watching for a resize of the frame.\n   * @private\n   */\n  _stopAutoResize() {\n    if (this.watchTimer) {\n      clearInterval(this.watchTimer);\n      this.watchTimer = undefined;\n    }\n\n    // remove event listener on window.resize\n    if (this._onResize) {\n      window.removeEventListener(\"resize\", this._onResize);\n      this._onResize = null;\n    }\n  }\n\n  /**\n   * Start moving the timeline vertically\n   * @private\n   */\n  _onTouch() {\n    this.touch.allowDragging = true;\n    this.touch.initialScrollTop = this.props.scrollTop;\n  }\n\n  /**\n   * Start moving the timeline vertically\n   * @private\n   */\n  _onPinch() {\n    this.touch.allowDragging = false;\n  }\n\n  /**\n   * Move the timeline vertically\n   * @param {Event} event\n   * @private\n   */\n  _onDrag(event) {\n    if (!event) return;\n    // refuse to drag when we where pinching to prevent the timeline make a jump\n    // when releasing the fingers in opposite order from the touch screen\n    if (!this.touch.allowDragging) return;\n\n    const delta = event.deltaY;\n\n    const oldScrollTop = this._getScrollTop();\n    const newScrollTop = this._setScrollTop(\n      this.touch.initialScrollTop + delta,\n    );\n\n    if (this.options.verticalScroll) {\n      this.dom.left.parentNode.scrollTop = -this.props.scrollTop;\n      this.dom.right.parentNode.scrollTop = -this.props.scrollTop;\n    }\n\n    if (newScrollTop != oldScrollTop) {\n      this.emit(\"verticalDrag\");\n    }\n  }\n\n  /**\n   * Apply a scrollTop\n   * @param {number} scrollTop\n   * @returns {number} scrollTop  Returns the applied scrollTop\n   * @private\n   */\n  _setScrollTop(scrollTop) {\n    this.props.scrollTop = scrollTop;\n    this._updateScrollTop();\n    return this.props.scrollTop;\n  }\n\n  /**\n   * Update the current scrollTop when the height of  the containers has been changed\n   * @returns {number} scrollTop  Returns the applied scrollTop\n   * @private\n   */\n  _updateScrollTop() {\n    // recalculate the scrollTopMin\n    const scrollTopMin = Math.min(\n      this.props.centerContainer.height -\n        this.props.border.top -\n        this.props.border.bottom -\n        this.props.center.height,\n      0,\n    ); // is negative or zero\n    if (scrollTopMin != this.props.scrollTopMin) {\n      // in case of bottom orientation, change the scrollTop such that the contents\n      // do not move relative to the time axis at the bottom\n      if (this.options.orientation.item != \"top\") {\n        this.props.scrollTop += scrollTopMin - this.props.scrollTopMin;\n      }\n      this.props.scrollTopMin = scrollTopMin;\n    }\n\n    // limit the scrollTop to the feasible scroll range\n    if (this.props.scrollTop > 0) this.props.scrollTop = 0;\n    if (this.props.scrollTop < scrollTopMin)\n      this.props.scrollTop = scrollTopMin;\n\n    if (this.options.verticalScroll) {\n      this.dom.left.parentNode.scrollTop = -this.props.scrollTop;\n      this.dom.right.parentNode.scrollTop = -this.props.scrollTop;\n    }\n    return this.props.scrollTop;\n  }\n\n  /**\n   * Get the current scrollTop\n   * @returns {number} scrollTop\n   * @private\n   */\n  _getScrollTop() {\n    return this.props.scrollTop;\n  }\n\n  /**\n   * Load a configurator\n   * [at]returns {Object}\n   * @private\n   */\n  _createConfigurator() {\n    throw new Error(\"Cannot invoke abstract method _createConfigurator\");\n  }\n}\n\n// turn Core into an event emitter\nEmitter(Core.prototype);\n\nexport default Core;\n","import util from \"../../util.js\";\nimport Component from \"./Component.js\";\nimport moment from \"../../module/moment.js\";\nimport locales from \"../locales.js\";\n\n/**\n * A current time bar\n */\nclass CurrentTime extends Component {\n  /**\n   * @param {{range: Range, dom: Object, domProps: Object}} body\n   * @param {Object} [options]        Available parameters:\n   *                                  {Boolean} [showCurrentTime]\n   *                                  {String}  [alignCurrentTime]\n   * @constructor CurrentTime\n   * @extends Component\n   */\n  constructor(body, options) {\n    super();\n    this.body = body;\n\n    // default options\n    this.defaultOptions = {\n      rtl: false,\n      showCurrentTime: true,\n      alignCurrentTime: undefined,\n\n      moment,\n      locales,\n      locale: \"en\",\n    };\n    this.options = util.extend({}, this.defaultOptions);\n    this.setOptions(options);\n    this.options.locales = util.extend({}, locales, this.options.locales);\n    const defaultLocales =\n      this.defaultOptions.locales[this.defaultOptions.locale];\n    Object.keys(this.options.locales).forEach((locale) => {\n      this.options.locales[locale] = util.extend(\n        {},\n        defaultLocales,\n        this.options.locales[locale],\n      );\n    });\n    this.offset = 0;\n\n    this._create();\n  }\n\n  /**\n   * Create the HTML DOM for the current time bar\n   * @private\n   */\n  _create() {\n    const bar = document.createElement(\"div\");\n    bar.className = \"vis-current-time\";\n    bar.style.position = \"absolute\";\n    bar.style.top = \"0px\";\n    bar.style.height = \"100%\";\n\n    this.bar = bar;\n  }\n\n  /**\n   * Destroy the CurrentTime bar\n   */\n  destroy() {\n    this.options.showCurrentTime = false;\n    this.redraw(); // will remove the bar from the DOM and stop refreshing\n\n    this.body = null;\n  }\n\n  /**\n   * Set options for the component. Options will be merged in current options.\n   * @param {Object} options  Available parameters:\n   *                          {boolean} [showCurrentTime]\n   *                          {String}  [alignCurrentTime]\n   */\n  setOptions(options) {\n    if (options) {\n      // copy all options that we know\n      util.selectiveExtend(\n        [\n          \"rtl\",\n          \"showCurrentTime\",\n          \"alignCurrentTime\",\n          \"moment\",\n          \"locale\",\n          \"locales\",\n        ],\n        this.options,\n        options,\n      );\n    }\n  }\n\n  /**\n   * Repaint the component\n   * @return {boolean} Returns true if the component is resized\n   */\n  redraw() {\n    if (this.options.showCurrentTime) {\n      const parent = this.body.dom.backgroundVertical;\n      if (this.bar.parentNode != parent) {\n        // attach to the dom\n        if (this.bar.parentNode) {\n          this.bar.parentNode.removeChild(this.bar);\n        }\n        parent.appendChild(this.bar);\n\n        this.start();\n      }\n\n      let now = this.options.moment(Date.now() + this.offset);\n\n      if (this.options.alignCurrentTime) {\n        now = now.startOf(this.options.alignCurrentTime);\n      }\n\n      const x = this.body.util.toScreen(now);\n\n      let locale = this.options.locales[this.options.locale];\n      if (!locale) {\n        if (!this.warned) {\n          console.warn(\n            `WARNING: options.locales['${this.options.locale}'] not found. See https://visjs.github.io/vis-timeline/docs/timeline/#Localization`,\n          );\n          this.warned = true;\n        }\n        locale = this.options.locales[\"en\"]; // fall back on english when not available\n      }\n      let title = `${locale.current} ${locale.time}: ${now.format(\"dddd, MMMM Do YYYY, H:mm:ss\")}`;\n      title = title.charAt(0).toUpperCase() + title.substring(1);\n\n      if (this.options.rtl) {\n        this.bar.style.transform = `translateX(${x * -1}px)`;\n      } else {\n        this.bar.style.transform = `translateX(${x}px)`;\n      }\n      this.bar.title = title;\n    } else {\n      // remove the line from the DOM\n      if (this.bar.parentNode) {\n        this.bar.parentNode.removeChild(this.bar);\n      }\n      this.stop();\n    }\n\n    return false;\n  }\n\n  /**\n   * Start auto refreshing the current time bar\n   */\n  start() {\n    const me = this;\n\n    /**\n     *  Updates the current time.\n     */\n    function update() {\n      me.stop();\n\n      // determine interval to refresh\n      const scale = me.body.range.conversion(\n        me.body.domProps.center.width,\n      ).scale;\n      let interval = 1 / scale / 10;\n      if (interval < 30) interval = 30;\n      if (interval > 1000) interval = 1000;\n\n      me.redraw();\n      me.body.emitter.emit(\"currentTimeTick\");\n\n      // start a renderTimer to adjust for the new time\n      me.currentTimeTimer = setTimeout(update, interval);\n    }\n\n    update();\n  }\n\n  /**\n   * Stop auto refreshing the current time bar\n   */\n  stop() {\n    if (this.currentTimeTimer !== undefined) {\n      clearTimeout(this.currentTimeTimer);\n      delete this.currentTimeTimer;\n    }\n  }\n\n  /**\n   * Set a current time. This can be used for example to ensure that a client's\n   * time is synchronized with a shared server time.\n   * @param {Date | string | number} time     A Date, unix timestamp, or\n   *                                          ISO date string.\n   */\n  setCurrentTime(time) {\n    const t = util.convert(time, \"Date\").valueOf();\n    const now = Date.now();\n    this.offset = t - now;\n    this.redraw();\n  }\n\n  /**\n   * Get the current time.\n   * @return {Date} Returns the current time.\n   */\n  getCurrentTime() {\n    return new Date(Date.now() + this.offset);\n  }\n}\n\nexport default CurrentTime;\n","// Utility functions for ordering and stacking of items\nconst EPSILON = 0.001; // used when checking collisions, to prevent round-off errors\n\n/**\n * Order items by their start data\n * @param {Item[]} items\n */\nexport function orderByStart(items) {\n  items.sort((a, b) => a.data.start - b.data.start);\n}\n\n/**\n * Order items by their end date. If they have no end date, their start date\n * is used.\n * @param {Item[]} items\n */\nexport function orderByEnd(items) {\n  items.sort((a, b) => {\n    const aTime = \"end\" in a.data ? a.data.end : a.data.start;\n    const bTime = \"end\" in b.data ? b.data.end : b.data.start;\n\n    return aTime - bTime;\n  });\n}\n\n/**\n * Adjust vertical positions of the items such that they don't overlap each\n * other.\n * @param {Item[]} items\n *            All visible items\n * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin\n *            Margins between items and between items and the axis.\n * @param {boolean} [force=false]\n *            If true, all items will be repositioned. If false (default), only\n *            items having a top===null will be re-stacked\n * @param {function} shouldBailItemsRedrawFunction\n *            bailing function\n * @return {boolean} shouldBail\n */\nexport function stack(items, margin, force, shouldBailItemsRedrawFunction) {\n  const stackingResult = performStacking(\n    items,\n    margin.item,\n    false,\n    (item) => item.stack && (force || item.top === null),\n    (item) => item.stack,\n    () => margin.axis,\n    shouldBailItemsRedrawFunction,\n  );\n\n  // If shouldBail function returned true during stacking calculation\n  return stackingResult === null;\n}\n\n/**\n * Adjust vertical positions of the items within a single subgroup such that they\n * don't overlap each other.\n * @param {Item[]} items\n *            All items withina subgroup\n * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin\n *            Margins between items and between items and the axis.\n * @param {subgroup} subgroup\n *            The subgroup that is being stacked\n */\nexport function substack(items, margin, subgroup) {\n  const subgroupHeight = performStacking(\n    items,\n    margin.item,\n    false,\n    (item) => item.stack,\n    () => true,\n    (item) => item.baseTop,\n  );\n  subgroup.height = subgroupHeight - subgroup.top + 0.5 * margin.item.vertical;\n}\n\n/**\n * Adjust vertical positions of the items without stacking them\n * @param {Item[]} items\n *            All visible items\n * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin\n *            Margins between items and between items and the axis.\n * @param {subgroups[]} subgroups\n *            All subgroups\n * @param {boolean} isStackSubgroups\n */\nexport function nostack(items, margin, subgroups, isStackSubgroups) {\n  for (let i = 0; i < items.length; i++) {\n    if (items[i].data.subgroup == undefined) {\n      items[i].top = margin.item.vertical;\n      continue;\n    }\n    if (items[i].data.subgroup === undefined || !isStackSubgroups) continue;\n\n    let newTop = 0;\n    for (const subgroup in subgroups) {\n      if (\n        !Object.prototype.hasOwnProperty.call(subgroups, subgroup) ||\n        subgroups[subgroup].visible !== true ||\n        subgroups[subgroup].index >= subgroups[items[i].data.subgroup].index\n      )\n        continue;\n\n      newTop += subgroups[subgroup].height;\n      subgroups[items[i].data.subgroup].top = newTop;\n    }\n    items[i].top = newTop + 0.5 * margin.item.vertical;\n  }\n\n  if (!isStackSubgroups) stackSubgroups(items, margin, subgroups);\n}\n\n/**\n * Adjust vertical positions of the subgroups such that they don't overlap each\n * other.\n * @param {Array.<timeline.Item>} items\n * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin Margins between items and between items and the axis.\n * @param {subgroups[]} subgroups\n *            All subgroups\n */\nexport function stackSubgroups(items, margin, subgroups) {\n  performStacking(\n    Object.values(subgroups).sort((a, b) => {\n      if (a.index > b.index) return 1;\n      if (a.index < b.index) return -1;\n      return 0;\n    }),\n    {\n      vertical: 0,\n    },\n    true,\n    () => true,\n    () => true,\n    () => 0,\n  );\n\n  for (let i = 0; i < items.length; i++) {\n    if (items[i].data.subgroup !== undefined) {\n      items[i].top =\n        subgroups[items[i].data.subgroup].top + 0.5 * margin.item.vertical;\n    }\n  }\n}\n\n/**\n * Adjust vertical positions of the subgroups such that they don't overlap each\n * other, then stacks the contents of each subgroup individually.\n * @param {Item[]} subgroupItems\n *            All the items in a subgroup\n * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin\n *            Margins between items and between items and the axis.\n * @param {subgroups[]} subgroups\n *            All subgroups\n */\nexport function stackSubgroupsWithInnerStack(subgroupItems, margin, subgroups) {\n  let doSubStack = false;\n\n  // Run subgroups in their order (if any)\n  const subgroupOrder = [];\n\n  for (let subgroup in subgroups) {\n    if (Object.prototype.hasOwnProperty.call(subgroups[subgroup], \"index\")) {\n      subgroupOrder[subgroups[subgroup].index] = subgroup;\n    } else {\n      subgroupOrder.push(subgroup);\n    }\n  }\n\n  for (let j = 0; j < subgroupOrder.length; j++) {\n    let subgroup = subgroupOrder[j];\n    if (!Object.prototype.hasOwnProperty.call(subgroups, subgroup)) continue;\n\n    doSubStack = doSubStack || subgroups[subgroup].stack;\n    subgroups[subgroup].top = 0;\n\n    for (const otherSubgroup in subgroups) {\n      if (\n        subgroups[otherSubgroup].visible &&\n        subgroups[subgroup].index > subgroups[otherSubgroup].index\n      ) {\n        subgroups[subgroup].top += subgroups[otherSubgroup].height;\n      }\n    }\n\n    const items = subgroupItems[subgroup];\n    for (let i = 0; i < items.length; i++) {\n      if (items[i].data.subgroup === undefined) continue;\n\n      items[i].top =\n        subgroups[items[i].data.subgroup].top + 0.5 * margin.item.vertical;\n      if (subgroups[subgroup].stack) items[i].baseTop = items[i].top;\n    }\n\n    if (doSubStack && subgroups[subgroup].stack)\n      substack(subgroupItems[subgroup], margin, subgroups[subgroup]);\n  }\n}\n\n/**\n * Reusable stacking function\n *\n * @param {Item[]} items\n * An array of items to consider during stacking.\n * @param {{horizontal: number, vertical: number}} margins\n * Margins to be used for collision checking and placement of items.\n * @param {boolean} compareTimes\n * By default, horizontal collision is checked based on the spatial position of the items (left/right and width).\n * If this argument is true, horizontal collision will instead be checked based on the start/end times of each item.\n * Vertical collision is always checked spatially.\n * @param {function(Item): number | null} shouldStack\n * A callback function which is called before we start to process an item. The return value indicates whether the item will be processed.\n * @param {function(Item): boolean} shouldOthersStack\n * A callback function which indicates whether other items should consider this item when being stacked.\n * @param {function(Item): number} getInitialHeight\n * A callback function which determines the height items are initially placed at\n * @param {function(): boolean} shouldBail\n * A callback function which should indicate if the stacking process should be aborted.\n *\n * @returns {null|number}\n * if shouldBail was triggered, returns null\n * otherwise, returns the maximum height\n */\nfunction performStacking(\n  items,\n  margins,\n  compareTimes,\n  shouldStack,\n  shouldOthersStack,\n  getInitialHeight,\n  shouldBail,\n) {\n  // Time-based horizontal comparison\n  let getItemStart = (item) => item.start;\n  let getItemEnd = (item) => item.end;\n  if (!compareTimes) {\n    // Spatial horizontal comparisons\n    const rtl = !!(items[0] && items[0].options.rtl);\n    if (rtl) {\n      getItemStart = (item) => item.right;\n    } else {\n      getItemStart = (item) => item.left;\n    }\n    getItemEnd = (item) => getItemStart(item) + item.width + margins.horizontal;\n  }\n\n  const itemsToPosition = [];\n  const itemsAlreadyPositioned = []; // It's vital that this array is kept sorted based on the start of each item\n\n  // If the order we needed to place items was based purely on the start of each item, we could calculate stacking very efficiently.\n  // Unfortunately for us, this is not guaranteed. But the order is often based on the start of items at least to some degree, and\n  // we can use this to make some optimisations. While items are proceeding in order of start, we can keep moving our search indexes\n  // forwards. Then if we encounter an item that's out of order, we reset our indexes and search from the beginning of the array again.\n  let previousStart = null;\n  let insertionIndex = 0;\n\n  // First let's handle any immoveable items\n  for (const item of items) {\n    if (shouldStack(item)) {\n      itemsToPosition.push(item);\n    } else {\n      if (shouldOthersStack(item)) {\n        const itemStart = getItemStart(item);\n\n        // We need to put immoveable items into itemsAlreadyPositioned and ensure that this array is sorted.\n        // We could simply insert them, and then use JavaScript's sort function to sort them afterwards.\n        // This would achieve an average complexity of O(n log n).\n        //\n        // Instead, I'm gambling that the start of each item will usually be the same or later than the\n        // start of the previous item. While this holds (best case), we can insert items in O(n).\n        // In the worst case (where each item starts before the previous item) this grows to O(n^2).\n        //\n        // I am making the assumption that for most datasets, the \"order\" function will have relatively low cardinality,\n        // and therefore this tradeoff should be easily worth it.\n        if (previousStart !== null && itemStart < previousStart - EPSILON) {\n          insertionIndex = 0;\n        }\n        previousStart = itemStart;\n\n        insertionIndex = findIndexFrom(\n          itemsAlreadyPositioned,\n          (i) => getItemStart(i) - EPSILON > itemStart,\n          insertionIndex,\n        );\n\n        itemsAlreadyPositioned.splice(insertionIndex, 0, item);\n        insertionIndex++;\n      }\n    }\n  }\n\n  // Now we can loop through each item (in order) and find a position for them\n  previousStart = null;\n  let previousEnd = null;\n  insertionIndex = 0;\n  let horizontalOverlapStartIndex = 0;\n  let horizontalOverlapEndIndex = 0;\n  let maxHeight = 0;\n  while (itemsToPosition.length > 0) {\n    const item = itemsToPosition.shift();\n\n    item.top = getInitialHeight(item);\n\n    const itemStart = getItemStart(item);\n    const itemEnd = getItemEnd(item);\n    if (previousStart !== null && itemStart < previousStart - EPSILON) {\n      horizontalOverlapStartIndex = 0;\n      horizontalOverlapEndIndex = 0;\n      insertionIndex = 0;\n      previousEnd = null;\n    }\n    if (previousStart === null || itemStart > previousStart + EPSILON) {\n      // Take advantage of the sorted itemsAlreadyPositioned array to narrow down the search\n      horizontalOverlapStartIndex = findIndexFrom(\n        itemsAlreadyPositioned,\n        (i) => itemStart < getItemEnd(i) - EPSILON,\n        horizontalOverlapStartIndex,\n      );\n    }\n    previousStart = itemStart;\n\n    // Since items aren't sorted by end time, it might increase or decrease from one item to the next. In order to keep an efficient search area, we will seek forwards/backwards accordingly.\n    if (previousEnd === null || previousEnd < itemEnd - EPSILON) {\n      horizontalOverlapEndIndex = findIndexFrom(\n        itemsAlreadyPositioned,\n        (i) => itemEnd < getItemStart(i) - EPSILON,\n        Math.max(horizontalOverlapStartIndex, horizontalOverlapEndIndex),\n      );\n    }\n    if (previousEnd !== null && previousEnd - EPSILON > itemEnd) {\n      horizontalOverlapEndIndex =\n        findLastIndexBetween(\n          itemsAlreadyPositioned,\n          (i) => itemEnd + EPSILON >= getItemStart(i),\n          horizontalOverlapStartIndex,\n          horizontalOverlapEndIndex,\n        ) + 1;\n    }\n    previousEnd = itemEnd;\n\n    // Sort by vertical position so we don't have to reconsider past items if we move an item\n    const horizontallyCollidingItems = filterBetween(\n      itemsAlreadyPositioned,\n      (i) => itemStart < getItemEnd(i) - EPSILON,\n      horizontalOverlapStartIndex,\n      horizontalOverlapEndIndex,\n    ).sort((a, b) => a.top - b.top);\n\n    // Keep moving the item down until it stops colliding with any other items\n    for (let i2 = 0; i2 < horizontallyCollidingItems.length; i2++) {\n      const otherItem = horizontallyCollidingItems[i2];\n\n      if (checkVerticalSpatialCollision(item, otherItem, margins)) {\n        item.top = otherItem.top + otherItem.height + margins.vertical;\n      }\n    }\n\n    if (shouldOthersStack(item)) {\n      // Insert the item into itemsAlreadyPositioned, ensuring itemsAlreadyPositioned remains sorted.\n      // In the best case, we can insert an item in constant time O(1). In the worst case, we insert an item in linear time O(n).\n      // In both cases, this is better than doing a naive insert and then sort, which would cost on average O(n log n).\n      insertionIndex = findIndexFrom(\n        itemsAlreadyPositioned,\n        (i) => getItemStart(i) - EPSILON > itemStart,\n        insertionIndex,\n      );\n\n      itemsAlreadyPositioned.splice(insertionIndex, 0, item);\n\n      if (insertionIndex < horizontalOverlapStartIndex) {\n        horizontalOverlapStartIndex++;\n      }\n\n      if (insertionIndex <= horizontalOverlapEndIndex) {\n        horizontalOverlapEndIndex++;\n      }\n\n      insertionIndex++;\n    }\n\n    // Keep track of the tallest item we've seen before\n    const currentHeight = item.top + item.height;\n    if (currentHeight > maxHeight) {\n      maxHeight = currentHeight;\n    }\n\n    if (shouldBail && shouldBail()) {\n      return null;\n    }\n  }\n\n  return maxHeight;\n}\n\n/**\n * Test if the two provided items collide\n * The items must have parameters left, width, top, and height.\n * @param {Item} a          The first item\n * @param {Item} b          The second item\n * @param {{vertical: number}} margin\n *                          An object containing a horizontal and vertical\n *                          minimum required margin.\n * @return {boolean}        true if a and b collide, else false\n */\nfunction checkVerticalSpatialCollision(a, b, margin) {\n  return (\n    a.top - margin.vertical + EPSILON < b.top + b.height &&\n    a.top + a.height + margin.vertical - EPSILON > b.top\n  );\n}\n\n/**\n * Find index of first item to meet predicate after a certain index.\n * If no such item is found, returns the length of the array.\n *\n * @param {any[]} arr The array\n * @param {function(item): boolean} predicate A function that should return true when a suitable item is found\n * @param {number|undefined} startIndex The index to start search from (inclusive). Optional, if not provided will search from the beginning of the array.\n *\n * @return {number}\n */\nfunction findIndexFrom(arr, predicate, startIndex) {\n  if (!startIndex) {\n    startIndex = 0;\n  }\n  for (let i = startIndex; i < arr.length; i++) {\n    if (predicate(arr[i])) {\n      return i;\n    }\n  }\n  return arr.length;\n}\n\n/**\n * Find index of last item to meet predicate within a given range.\n * If no such item is found, returns the index prior to the start of the range.\n *\n * @param {any[]} arr The array\n * @param {function(item): boolean} predicate A function that should return true when a suitable item is found\n * @param {number|undefined} startIndex The earliest index to search to (inclusive). Optional, if not provided will continue until the start of the array.\n * @param {number|undefined} endIndex The end of the search range (exclusive). The search will begin on the index prior to this value. Optional, defaults to the end of array.\n *\n * @return {number}\n */\nfunction findLastIndexBetween(arr, predicate, startIndex, endIndex) {\n  if (!startIndex) {\n    startIndex = 0;\n  }\n\n  if (!endIndex) {\n    endIndex = arr.length;\n  }\n\n  for (let i = endIndex - 1; i >= startIndex; i--) {\n    if (predicate(arr[i])) {\n      return i;\n    }\n  }\n\n  return startIndex - 1;\n}\n\n/**\n * Takes an array and returns an array containing only items which meet a predicate within a given range.\n *\n * @param {any[]} arr The array\n * @param {function(item): boolean} predicate A function that should return true for items which should be included within the result\n * @param {number|undefined} startIndex The earliest index to include (inclusive). Optional, if not provided will continue until the start of the array.\n * @param {number|undefined} endIndex The end of the range to filter (exclusive). Optional, defaults to the end of array.\n *\n * @return {number}\n */\nfunction filterBetween(arr, predicate, startIndex, endIndex) {\n  if (!startIndex) {\n    startIndex = 0;\n  }\n  if (endIndex) {\n    endIndex = Math.min(endIndex, arr.length);\n  } else {\n    endIndex = arr.length;\n  }\n\n  const result = [];\n  for (let i = startIndex; i < endIndex; i++) {\n    if (predicate(arr[i])) {\n      result.push(arr[i]);\n    }\n  }\n  return result;\n}\n","import util from \"../../util.js\";\nimport * as stack from \"../Stack.js\";\n\nconst UNGROUPED = \"__ungrouped__\"; // reserved group id for ungrouped items\nconst BACKGROUND = \"__background__\"; // reserved group id for background items without group\n\nexport const ReservedGroupIds = {\n  UNGROUPED,\n  BACKGROUND,\n};\n\n/**\n * @constructor Group\n */\nclass Group {\n  /**\n   * @param {number | string} groupId\n   * @param {Object} data\n   * @param {ItemSet} itemSet\n   * @constructor Group\n   */\n  constructor(groupId, data, itemSet) {\n    this.groupId = groupId;\n    this.subgroups = {};\n    this.subgroupStack = {};\n    this.subgroupStackAll = false;\n    this.subgroupVisibility = {};\n    this.doInnerStack = false;\n    this.shouldBailStackItems = false;\n    this.subgroupIndex = 0;\n    this.subgroupOrderer = data && data.subgroupOrder;\n    this.itemSet = itemSet;\n    this.isVisible = null;\n    this.height = 0;\n    this.stackDirty = true; // if true, items will be restacked on next redraw\n\n    // This is a stack of functions (`() => void`) that will be executed before\n    // the instance is disposed off (method `dispose`). Anything that needs to\n    // be manually disposed off before garbage collection happens (or so that\n    // garbage collection can happen) should be added to this stack.\n    this._disposeCallbacks = [];\n\n    if (data && data.nestedGroups) {\n      this.nestedGroups = data.nestedGroups;\n      if (data.showNested == false) {\n        this.showNested = false;\n      } else {\n        this.showNested = true;\n      }\n    }\n\n    if (data && data.subgroupStack) {\n      if (typeof data.subgroupStack === \"boolean\") {\n        this.doInnerStack = data.subgroupStack;\n        this.subgroupStackAll = data.subgroupStack;\n      } else {\n        // We might be doing stacking on specific sub groups, but only\n        // if at least one is set to do stacking\n        for (const key in data.subgroupStack) {\n          if (!Object.prototype.hasOwnProperty.call(data.subgroupStack, key))\n            continue;\n          this.subgroupStack[key] = data.subgroupStack[key];\n          this.doInnerStack = this.doInnerStack || data.subgroupStack[key];\n        }\n      }\n    }\n\n    if (data && data.heightMode) {\n      this.heightMode = data.heightMode;\n    } else {\n      this.heightMode = itemSet.options.groupHeightMode;\n    }\n\n    this.nestedInGroup = null;\n\n    this.dom = {};\n    this.props = {\n      label: {\n        width: 0,\n        height: 0,\n      },\n    };\n    this.className = null;\n\n    this.items = {}; // items filtered by groupId of this group\n    this.visibleItems = []; // items currently visible in window\n    this.itemsInRange = []; // items currently in range\n    this.orderedItems = {\n      byStart: [],\n      byEnd: [],\n    };\n    this.checkRangedItems = false; // needed to refresh the ranged items if the window is programatically changed with NO overlap.\n\n    const handleCheckRangedItems = () => {\n      this.checkRangedItems = true;\n    };\n    this.itemSet.body.emitter.on(\"checkRangedItems\", handleCheckRangedItems);\n    this._disposeCallbacks.push(() => {\n      this.itemSet.body.emitter.off(\"checkRangedItems\", handleCheckRangedItems);\n    });\n\n    this._create();\n\n    this.setData(data);\n  }\n\n  /**\n   * Create DOM elements for the group\n   * @private\n   */\n  _create() {\n    const label = document.createElement(\"div\");\n    if (this.itemSet.options.groupEditable.order) {\n      label.className = \"vis-label draggable\";\n    } else {\n      label.className = \"vis-label\";\n    }\n    this.dom.label = label;\n\n    const inner = document.createElement(\"div\");\n    inner.className = \"vis-inner\";\n    label.appendChild(inner);\n    this.dom.inner = inner;\n\n    const foreground = document.createElement(\"div\");\n    foreground.className = \"vis-group\";\n    foreground[\"vis-group\"] = this;\n    this.dom.foreground = foreground;\n\n    this.dom.background = document.createElement(\"div\");\n    this.dom.background.className = \"vis-group\";\n\n    this.dom.axis = document.createElement(\"div\");\n    this.dom.axis.className = \"vis-group\";\n\n    // create a hidden marker to detect when the Timelines container is attached\n    // to the DOM, or the style of a parent of the Timeline is changed from\n    // display:none is changed to visible.\n    this.dom.marker = document.createElement(\"div\");\n    this.dom.marker.style.visibility = \"hidden\";\n    this.dom.marker.style.position = \"absolute\";\n    this.dom.marker.innerHTML = \"\";\n    this.dom.background.appendChild(this.dom.marker);\n  }\n\n  /**\n   * Set the group data for this group\n   * @param {Object} data   Group data, can contain properties content and className\n   */\n  setData(data) {\n    if (this.itemSet.groupTouchParams.isDragging) return;\n\n    // update contents\n    let content;\n    let templateFunction;\n\n    if (data && data.subgroupVisibility) {\n      for (const key in data.subgroupVisibility) {\n        if (!Object.prototype.hasOwnProperty.call(data.subgroupVisibility, key))\n          continue;\n        this.subgroupVisibility[key] = data.subgroupVisibility[key];\n      }\n    }\n\n    if (this.itemSet.options && this.itemSet.options.groupTemplate) {\n      templateFunction = this.itemSet.options.groupTemplate.bind(this);\n      content = templateFunction(data, this.dom.inner);\n    } else {\n      content = data && data.content;\n    }\n\n    if (content instanceof Element) {\n      while (this.dom.inner.firstChild) {\n        this.dom.inner.removeChild(this.dom.inner.firstChild);\n      }\n      this.dom.inner.appendChild(content);\n    } else if (content instanceof Object && content.isReactComponent) {\n      // Do nothing. Component was rendered into the node be ReactDOM.render.\n      // That branch is necessary for evasion of a second call templateFunction.\n      // Supports only React < 16(due to the asynchronous nature of React 16).\n    } else if (content instanceof Object) {\n      templateFunction(data, this.dom.inner);\n    } else if (content !== undefined && content !== null) {\n      this.dom.inner.innerHTML = util.xss(content);\n    } else {\n      this.dom.inner.innerHTML = util.xss(this.groupId || \"\"); // groupId can be null\n    }\n\n    // update title\n    this.dom.label.title = (data && data.title) || \"\";\n    if (!this.dom.inner.firstChild) {\n      util.addClassName(this.dom.inner, \"vis-hidden\");\n    } else {\n      util.removeClassName(this.dom.inner, \"vis-hidden\");\n    }\n\n    if (data && data.nestedGroups) {\n      if (!this.nestedGroups || this.nestedGroups != data.nestedGroups) {\n        this.nestedGroups = data.nestedGroups;\n      }\n\n      if (data.showNested !== undefined || this.showNested === undefined) {\n        if (data.showNested == false) {\n          this.showNested = false;\n        } else {\n          this.showNested = true;\n        }\n      }\n\n      util.addClassName(this.dom.label, \"vis-nesting-group\");\n      if (this.showNested) {\n        util.removeClassName(this.dom.label, \"collapsed\");\n        util.addClassName(this.dom.label, \"expanded\");\n      } else {\n        util.removeClassName(this.dom.label, \"expanded\");\n        util.addClassName(this.dom.label, \"collapsed\");\n      }\n    } else if (this.nestedGroups) {\n      this.nestedGroups = null;\n      util.removeClassName(this.dom.label, \"collapsed\");\n      util.removeClassName(this.dom.label, \"expanded\");\n      util.removeClassName(this.dom.label, \"vis-nesting-group\");\n    }\n\n    if (data && (data.treeLevel || data.nestedInGroup)) {\n      util.addClassName(this.dom.label, \"vis-nested-group\");\n      if (data.treeLevel) {\n        util.addClassName(this.dom.label, \"vis-group-level-\" + data.treeLevel);\n      } else {\n        // Nesting level is unknown, but we're sure it's at least 1\n        util.addClassName(this.dom.label, \"vis-group-level-unknown-but-gte1\");\n      }\n    } else {\n      util.addClassName(this.dom.label, \"vis-group-level-0\");\n    }\n\n    // update className\n    const className = (data && data.className) || null;\n    if (className != this.className) {\n      if (this.className) {\n        util.removeClassName(this.dom.label, this.className);\n        util.removeClassName(this.dom.foreground, this.className);\n        util.removeClassName(this.dom.background, this.className);\n        util.removeClassName(this.dom.axis, this.className);\n      }\n      util.addClassName(this.dom.label, className);\n      util.addClassName(this.dom.foreground, className);\n      util.addClassName(this.dom.background, className);\n      util.addClassName(this.dom.axis, className);\n      this.className = className;\n    }\n\n    // update style\n    if (this.style) {\n      util.removeCssText(this.dom.label, this.style);\n      this.style = null;\n    }\n    if (data && data.style) {\n      util.addCssText(this.dom.label, data.style);\n      this.style = data.style;\n    }\n  }\n\n  /**\n   * Get the width of the group label\n   * @return {number} width\n   */\n  getLabelWidth() {\n    return this.props.label.width;\n  }\n\n  /**\n   * check if group has had an initial height hange\n   * @returns {boolean}\n   */\n  _didMarkerHeightChange() {\n    const markerHeight = this.dom.marker.clientHeight;\n    if (markerHeight != this.lastMarkerHeight) {\n      this.lastMarkerHeight = markerHeight;\n      const redrawQueue = {};\n      let redrawQueueLength = 0;\n\n      util.forEach(this.items, (item, key) => {\n        item.dirty = true;\n        if (item.displayed) {\n          const returnQueue = true;\n          redrawQueue[key] = item.redraw(returnQueue);\n          redrawQueueLength = redrawQueue[key].length;\n        }\n      });\n\n      const needRedraw = redrawQueueLength > 0;\n      if (needRedraw) {\n        // redraw all regular items\n        for (let i = 0; i < redrawQueueLength; i++) {\n          util.forEach(redrawQueue, (fns) => {\n            fns[i]();\n          });\n        }\n      }\n      return true;\n    } else {\n      return false;\n    }\n  }\n\n  /**\n   * calculate group dimentions and position\n   * @param {number} pixels\n   */\n  _calculateGroupSizeAndPosition() {\n    const { offsetTop, offsetLeft, offsetWidth } = this.dom.foreground;\n    this.top = offsetTop;\n    this.right = offsetLeft;\n    this.width = offsetWidth;\n  }\n\n  /**\n   * checks if should bail redraw of items\n   * @returns {boolean} should bail\n   */\n  _shouldBailItemsRedraw() {\n    const me = this;\n    const timeoutOptions = this.itemSet.options.onTimeout;\n    const bailOptions = {\n      relativeBailingTime: this.itemSet.itemsSettingTime,\n      bailTimeMs: timeoutOptions && timeoutOptions.timeoutMs,\n      userBailFunction: timeoutOptions && timeoutOptions.callback,\n      shouldBailStackItems: this.shouldBailStackItems,\n    };\n    let bail = null;\n    if (!this.itemSet.initialDrawDone) {\n      if (bailOptions.shouldBailStackItems) {\n        return true;\n      }\n      if (\n        Math.abs(Date.now() - new Date(bailOptions.relativeBailingTime)) >\n        bailOptions.bailTimeMs\n      ) {\n        if (\n          bailOptions.userBailFunction &&\n          this.itemSet.userContinueNotBail == null\n        ) {\n          bailOptions.userBailFunction((didUserContinue) => {\n            me.itemSet.userContinueNotBail = didUserContinue;\n            bail = !didUserContinue;\n          });\n        } else if (me.itemSet.userContinueNotBail == false) {\n          bail = true;\n        } else {\n          bail = false;\n        }\n      }\n    }\n\n    return bail;\n  }\n\n  /**\n   * redraws items\n   * @param {boolean} forceRestack\n   * @param {boolean} lastIsVisible\n   * @param {number} margin\n   * @param {object} range\n   * @private\n   */\n  _redrawItems(forceRestack, lastIsVisible, margin, range) {\n    const restack =\n      forceRestack || this.stackDirty || (this.isVisible && !lastIsVisible);\n\n    // if restacking, reposition visible items vertically\n    if (restack) {\n      const orderedItems = {\n        byEnd: this.orderedItems.byEnd.filter((item) => !item.isCluster),\n        byStart: this.orderedItems.byStart.filter((item) => !item.isCluster),\n      };\n\n      const orderedClusters = {\n        byEnd: [\n          ...new Set(\n            this.orderedItems.byEnd\n              .map((item) => item.cluster)\n              .filter((item) => !!item),\n          ),\n        ],\n        byStart: [\n          ...new Set(\n            this.orderedItems.byStart\n              .map((item) => item.cluster)\n              .filter((item) => !!item),\n          ),\n        ],\n      };\n\n      /**\n       * Get all visible items in range\n       * @return {array} items\n       */\n      const getVisibleItems = () => {\n        const visibleItems = this._updateItemsInRange(\n          orderedItems,\n          this.visibleItems.filter((item) => !item.isCluster),\n          range,\n        );\n        const visibleClusters = this._updateClustersInRange(\n          orderedClusters,\n          this.visibleItems.filter((item) => item.isCluster),\n          range,\n        );\n        return [...visibleItems, ...visibleClusters];\n      };\n\n      /**\n       * Get visible items grouped by subgroup\n       * @param {function} orderFn An optional function to order items inside the subgroups\n       * @return {Object}\n       */\n      const getVisibleItemsGroupedBySubgroup = (orderFn) => {\n        let visibleSubgroupsItems = {};\n        for (const subgroup in this.subgroups) {\n          if (!Object.prototype.hasOwnProperty.call(this.subgroups, subgroup))\n            continue;\n          const items = this.visibleItems.filter(\n            (item) => item.data.subgroup === subgroup,\n          );\n          visibleSubgroupsItems[subgroup] = orderFn\n            ? items.sort((a, b) => orderFn(a.data, b.data))\n            : items;\n        }\n        return visibleSubgroupsItems;\n      };\n\n      if (typeof this.itemSet.options.order === \"function\") {\n        // a custom order function\n        //show all items\n        const me = this;\n        if (this.doInnerStack && this.itemSet.options.stackSubgroups) {\n          // Order the items within each subgroup\n          const visibleSubgroupsItems = getVisibleItemsGroupedBySubgroup(\n            this.itemSet.options.order,\n          );\n          stack.stackSubgroupsWithInnerStack(\n            visibleSubgroupsItems,\n            margin,\n            this.subgroups,\n          );\n          this.visibleItems = getVisibleItems();\n          this._updateSubGroupHeights(margin);\n        } else {\n          this.visibleItems = getVisibleItems();\n          this._updateSubGroupHeights(margin);\n          // order all items and force a restacking\n          // order all items outside clusters and force a restacking\n          const customOrderedItems = this.visibleItems\n            .slice()\n            .filter(\n              (item) => item.isCluster || (!item.isCluster && !item.cluster),\n            )\n            .sort((a, b) => {\n              return me.itemSet.options.order(a.data, b.data);\n            });\n          this.shouldBailStackItems = stack.stack(\n            customOrderedItems,\n            margin,\n            true,\n            this._shouldBailItemsRedraw.bind(this),\n          );\n        }\n      } else {\n        // no custom order function, lazy stacking\n        this.visibleItems = getVisibleItems();\n        this._updateSubGroupHeights(margin);\n\n        if (this.itemSet.options.stack) {\n          if (this.doInnerStack && this.itemSet.options.stackSubgroups) {\n            const visibleSubgroupsItems = getVisibleItemsGroupedBySubgroup();\n            stack.stackSubgroupsWithInnerStack(\n              visibleSubgroupsItems,\n              margin,\n              this.subgroups,\n            );\n          } else {\n            // TODO: ugly way to access options...\n            this.shouldBailStackItems = stack.stack(\n              this.visibleItems,\n              margin,\n              true,\n              this._shouldBailItemsRedraw.bind(this),\n            );\n          }\n        } else {\n          // no stacking\n          stack.nostack(\n            this.visibleItems,\n            margin,\n            this.subgroups,\n            this.itemSet.options.stackSubgroups,\n          );\n        }\n      }\n\n      for (let i = 0; i < this.visibleItems.length; i++) {\n        this.visibleItems[i].repositionX();\n        if (\n          this.subgroupVisibility[this.visibleItems[i].data.subgroup] !==\n          undefined\n        ) {\n          if (!this.subgroupVisibility[this.visibleItems[i].data.subgroup]) {\n            this.visibleItems[i].hide();\n          }\n        }\n      }\n\n      if (this.itemSet.options.cluster) {\n        util.forEach(this.items, (item) => {\n          if (item.cluster && item.displayed) {\n            item.hide();\n          }\n        });\n      }\n\n      if (this.shouldBailStackItems) {\n        this.itemSet.body.emitter.emit(\"destroyTimeline\");\n      }\n      this.stackDirty = false;\n    }\n  }\n\n  /**\n   * check if group resized\n   * @param {boolean} resized\n   * @param {number} height\n   * @return {boolean} did resize\n   */\n  _didResize(resized, height) {\n    resized = util.updateProperty(this, \"height\", height) || resized;\n    // recalculate size of label\n    const labelWidth = this.dom.inner.clientWidth;\n    const labelHeight = this.dom.inner.clientHeight;\n    resized =\n      util.updateProperty(this.props.label, \"width\", labelWidth) || resized;\n    resized =\n      util.updateProperty(this.props.label, \"height\", labelHeight) || resized;\n    return resized;\n  }\n\n  /**\n   * apply group height\n   * @param {number} height\n   */\n  _applyGroupHeight(height) {\n    this.dom.background.style.height = `${height}px`;\n    this.dom.foreground.style.height = `${height}px`;\n    this.dom.label.style.height = `${height}px`;\n  }\n\n  /**\n   * update vertical position of items after they are re-stacked and the height of the group is calculated\n   * @param {number} margin\n   */\n  _updateItemsVerticalPosition(margin) {\n    for (let i = 0, ii = this.visibleItems.length; i < ii; i++) {\n      const item = this.visibleItems[i];\n      item.repositionY(margin);\n      if (!this.isVisible && this.groupId != ReservedGroupIds.BACKGROUND) {\n        if (item.displayed) item.hide();\n      }\n    }\n  }\n\n  /**\n   * Repaint this group\n   * @param {{start: number, end: number}} range\n   * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin\n   * @param {boolean} [forceRestack=false]  Force restacking of all items\n   * @param {boolean} [returnQueue=false]  return the queue or if the group resized\n   * @return {boolean} Returns true if the group is resized or the redraw queue if returnQueue=true\n   */\n  redraw(range, margin, forceRestack, returnQueue) {\n    let resized = false;\n    const lastIsVisible = this.isVisible;\n    let height;\n\n    const queue = [\n      () => {\n        forceRestack = this._didMarkerHeightChange.call(this) || forceRestack;\n      },\n\n      // recalculate the height of the subgroups\n      this._updateSubGroupHeights.bind(this, margin),\n\n      // calculate actual size and position\n      this._calculateGroupSizeAndPosition.bind(this),\n\n      () => {\n        this.isVisible = this._isGroupVisible.bind(this)(range, margin);\n      },\n\n      () => {\n        this._redrawItems.bind(this)(\n          forceRestack,\n          lastIsVisible,\n          margin,\n          range,\n        );\n      },\n\n      // update subgroups\n      this._updateSubgroupsSizes.bind(this),\n\n      () => {\n        height = this.height = this._calculateHeight.bind(this)(margin);\n      },\n\n      // calculate actual size and position again\n      this._calculateGroupSizeAndPosition.bind(this),\n\n      () => {\n        resized = this._didResize.bind(this)(resized, height);\n      },\n\n      () => {\n        this._applyGroupHeight.bind(this)(height);\n      },\n\n      () => {\n        this._updateItemsVerticalPosition.bind(this)(margin);\n      },\n\n      (() => {\n        if (!this.isVisible && this.height) {\n          resized = false;\n        }\n        return resized;\n      }).bind(this),\n    ];\n\n    if (returnQueue) {\n      return queue;\n    } else {\n      let result;\n      queue.forEach((fn) => {\n        result = fn();\n      });\n      return result;\n    }\n  }\n\n  /**\n   * recalculate the height of the subgroups\n   *\n   * @param {{item: timeline.Item}} margin\n   * @private\n   */\n  _updateSubGroupHeights(margin) {\n    if (Object.keys(this.subgroups).length > 0) {\n      const me = this;\n\n      this._resetSubgroups();\n\n      util.forEach(this.visibleItems, (item) => {\n        if (item.data.subgroup !== undefined) {\n          me.subgroups[item.data.subgroup].height = Math.max(\n            me.subgroups[item.data.subgroup].height,\n            item.height + margin.item.vertical,\n          );\n          me.subgroups[item.data.subgroup].visible =\n            typeof this.subgroupVisibility[item.data.subgroup] === \"undefined\"\n              ? true\n              : Boolean(this.subgroupVisibility[item.data.subgroup]);\n        }\n      });\n    }\n  }\n\n  /**\n   * check if group is visible\n   *\n   * @param {timeline.Range} range\n   * @param {{axis: timeline.DataAxis}} margin\n   * @returns {boolean} is visible\n   * @private\n   */\n  _isGroupVisible(range, margin) {\n    return (\n      this.top <=\n        range.body.domProps.centerContainer.height -\n          range.body.domProps.scrollTop +\n          margin.axis &&\n      this.top + this.height + margin.axis >= -range.body.domProps.scrollTop\n    );\n  }\n\n  /**\n   * recalculate the height of the group\n   * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin\n   * @returns {number} Returns the height\n   * @private\n   */\n  _calculateHeight(margin) {\n    // recalculate the height of the group\n    let height;\n\n    let items;\n\n    if (this.heightMode === \"fixed\") {\n      items = util.toArray(this.items);\n    } else {\n      // default or 'auto'\n      items = this.visibleItems;\n    }\n\n    if (!this.isVisible && this.height) {\n      height = Math.max(this.height, this.props.label.height);\n    } else if (items.length > 0) {\n      let min = items[0].top;\n      let max = items[0].top + items[0].height;\n      util.forEach(items, (item) => {\n        min = Math.min(min, item.top);\n        max = Math.max(max, item.top + item.height);\n      });\n      if (min > margin.axis) {\n        // there is an empty gap between the lowest item and the axis\n        const offset = min - margin.axis;\n        max -= offset;\n        util.forEach(items, (item) => {\n          item.top -= offset;\n        });\n      }\n      height = Math.ceil(max + margin.item.vertical / 2);\n      if (this.heightMode !== \"fitItems\") {\n        height = Math.max(height, this.props.label.height);\n      }\n    } else {\n      height = 0 || this.props.label.height;\n    }\n    return height;\n  }\n\n  /**\n   * Show this group: attach to the DOM\n   */\n  show() {\n    if (!this.dom.label.parentNode) {\n      this.itemSet.dom.labelSet.appendChild(this.dom.label);\n    }\n\n    if (!this.dom.foreground.parentNode) {\n      this.itemSet.dom.foreground.appendChild(this.dom.foreground);\n    }\n\n    if (!this.dom.background.parentNode) {\n      this.itemSet.dom.background.appendChild(this.dom.background);\n    }\n\n    if (!this.dom.axis.parentNode) {\n      this.itemSet.dom.axis.appendChild(this.dom.axis);\n    }\n  }\n\n  /**\n   * Hide this group: remove from the DOM\n   */\n  hide() {\n    const label = this.dom.label;\n    if (label.parentNode) {\n      label.parentNode.removeChild(label);\n    }\n\n    const foreground = this.dom.foreground;\n    if (foreground.parentNode) {\n      foreground.parentNode.removeChild(foreground);\n    }\n\n    const background = this.dom.background;\n    if (background.parentNode) {\n      background.parentNode.removeChild(background);\n    }\n\n    const axis = this.dom.axis;\n    if (axis.parentNode) {\n      axis.parentNode.removeChild(axis);\n    }\n  }\n\n  /**\n   * Add an item to the group\n   * @param {Item} item\n   */\n  add(item) {\n    this.items[item.id] = item;\n    item.setParent(this);\n    this.stackDirty = true;\n    // add to\n    if (item.data.subgroup !== undefined) {\n      this._addToSubgroup(item);\n      this.orderSubgroups();\n    }\n\n    if (!this.visibleItems.includes(item)) {\n      const range = this.itemSet.body.range; // TODO: not nice accessing the range like this\n      this._checkIfVisible(item, this.visibleItems, range);\n    }\n  }\n\n  /**\n   * add item to subgroup\n   * @param {object} item\n   * @param {string} subgroupId\n   */\n  _addToSubgroup(item, subgroupId = item.data.subgroup) {\n    if (subgroupId != undefined && this.subgroups[subgroupId] === undefined) {\n      this.subgroups[subgroupId] = {\n        height: 0,\n        top: 0,\n        start: item.data.start,\n        end: item.data.end || item.data.start,\n        visible: false,\n        index: this.subgroupIndex,\n        items: [],\n        stack: this.subgroupStackAll || this.subgroupStack[subgroupId] || false,\n      };\n      this.subgroupIndex++;\n    }\n\n    if (\n      new Date(item.data.start) < new Date(this.subgroups[subgroupId].start)\n    ) {\n      this.subgroups[subgroupId].start = item.data.start;\n    }\n\n    const itemEnd = item.data.end || item.data.start;\n    if (new Date(itemEnd) > new Date(this.subgroups[subgroupId].end)) {\n      this.subgroups[subgroupId].end = itemEnd;\n    }\n\n    this.subgroups[subgroupId].items.push(item);\n  }\n\n  /**\n   * update subgroup sizes\n   */\n  _updateSubgroupsSizes() {\n    const me = this;\n    if (me.subgroups) {\n      for (const subgroup in me.subgroups) {\n        if (!Object.prototype.hasOwnProperty.call(me.subgroups, subgroup))\n          continue;\n\n        const initialEnd =\n          me.subgroups[subgroup].items[0].data.end ||\n          me.subgroups[subgroup].items[0].data.start;\n        let newStart = me.subgroups[subgroup].items[0].data.start;\n        let newEnd = initialEnd - 1;\n\n        me.subgroups[subgroup].items.forEach((item) => {\n          if (new Date(item.data.start) < new Date(newStart)) {\n            newStart = item.data.start;\n          }\n\n          const itemEnd = item.data.end || item.data.start;\n          if (new Date(itemEnd) > new Date(newEnd)) {\n            newEnd = itemEnd;\n          }\n        });\n\n        me.subgroups[subgroup].start = newStart;\n        me.subgroups[subgroup].end = new Date(newEnd - 1); // -1 to compensate for colliding end to start subgroups;\n      }\n    }\n  }\n\n  /**\n   * order subgroups\n   */\n  orderSubgroups() {\n    if (this.subgroupOrderer !== undefined) {\n      const sortArray = [];\n      if (typeof this.subgroupOrderer == \"string\") {\n        for (const subgroup in this.subgroups) {\n          if (!Object.prototype.hasOwnProperty.call(this.subgroups, subgroup))\n            continue;\n          sortArray.push({\n            subgroup,\n            sortField:\n              this.subgroups[subgroup].items[0].data[this.subgroupOrderer],\n          });\n        }\n        sortArray.sort((a, b) => a.sortField - b.sortField);\n      } else if (typeof this.subgroupOrderer == \"function\") {\n        for (const subgroup in this.subgroups) {\n          if (!Object.prototype.hasOwnProperty.call(this.subgroups, subgroup))\n            continue;\n          sortArray.push(this.subgroups[subgroup].items[0].data);\n        }\n        sortArray.sort(this.subgroupOrderer);\n      }\n\n      if (sortArray.length > 0) {\n        for (let i = 0; i < sortArray.length; i++) {\n          this.subgroups[sortArray[i].subgroup].index = i;\n        }\n      }\n    }\n  }\n\n  /**\n   * add item to subgroup\n   */\n  _resetSubgroups() {\n    for (const subgroup in this.subgroups) {\n      if (!Object.prototype.hasOwnProperty.call(this.subgroups, subgroup))\n        continue;\n      this.subgroups[subgroup].visible = false;\n      this.subgroups[subgroup].height = 0;\n    }\n  }\n\n  /**\n   * Remove an item from the group\n   * @param {Item} item\n   */\n  remove(item) {\n    delete this.items[item.id];\n    item.setParent(null);\n    this.stackDirty = true;\n\n    // remove from visible items\n    const index = this.visibleItems.indexOf(item);\n    if (index != -1) this.visibleItems.splice(index, 1);\n\n    if (item.data.subgroup !== undefined) {\n      this._removeFromSubgroup(item);\n      this.orderSubgroups();\n    }\n  }\n\n  /**\n   * remove item from subgroup\n   * @param {object} item\n   * @param {string} subgroupId\n   */\n  _removeFromSubgroup(item, subgroupId = item.data.subgroup) {\n    if (subgroupId != undefined) {\n      const subgroup = this.subgroups[subgroupId];\n      if (subgroup) {\n        const itemIndex = subgroup.items.indexOf(item);\n        //  Check the item is actually in this subgroup. How should items not in the group be handled?\n        if (itemIndex >= 0) {\n          subgroup.items.splice(itemIndex, 1);\n          if (!subgroup.items.length) {\n            delete this.subgroups[subgroupId];\n          } else {\n            this._updateSubgroupsSizes();\n          }\n        }\n      }\n    }\n  }\n\n  /**\n   * Remove an item from the corresponding DataSet\n   * @param {Item} item\n   */\n  removeFromDataSet(item) {\n    this.itemSet.removeItem(item.id);\n  }\n\n  /**\n   * Reorder the items\n   */\n  order() {\n    const array = util.toArray(this.items);\n    const startArray = [];\n    const endArray = [];\n\n    for (let i = 0; i < array.length; i++) {\n      if (array[i].data.end !== undefined) {\n        endArray.push(array[i]);\n      }\n      startArray.push(array[i]);\n    }\n    this.orderedItems = {\n      byStart: startArray,\n      byEnd: endArray,\n    };\n\n    stack.orderByStart(this.orderedItems.byStart);\n    stack.orderByEnd(this.orderedItems.byEnd);\n  }\n\n  /**\n   * Update the visible items\n   * @param {{byStart: Item[], byEnd: Item[]}} orderedItems   All items ordered by start date and by end date\n   * @param {Item[]} oldVisibleItems                          The previously visible items.\n   * @param {{start: number, end: number}} range              Visible range\n   * @return {Item[]} visibleItems                            The new visible items.\n   * @private\n   */\n  _updateItemsInRange(orderedItems, oldVisibleItems, range) {\n    const visibleItems = [];\n    const visibleItemsLookup = {}; // we keep this to quickly look up if an item already exists in the list without using indexOf on visibleItems\n\n    if (\n      !this.isVisible &&\n      this.height !== undefined &&\n      this.groupId != ReservedGroupIds.BACKGROUND\n    ) {\n      for (let i = 0; i < oldVisibleItems.length; i++) {\n        var item = oldVisibleItems[i];\n        if (item.displayed) item.hide();\n      }\n      return visibleItems;\n    }\n\n    const interval = (range.end - range.start) / 4;\n    const lowerBound = range.start - interval;\n    const upperBound = range.end + interval;\n\n    // this function is used to do the binary search for items having start date only.\n    const startSearchFunction = (value) => {\n      if (value < lowerBound) {\n        return -1;\n      } else if (value <= upperBound) {\n        return 0;\n      } else {\n        return 1;\n      }\n    };\n\n    // this function is used to do the binary search for items having start and end dates (range).\n    const endSearchFunction = (data) => {\n      const { start, end } = data;\n      if (end < lowerBound) {\n        return -1;\n      } else if (start <= upperBound) {\n        return 0;\n      } else {\n        return 1;\n      }\n    };\n\n    // first check if the items that were in view previously are still in view.\n    // IMPORTANT: this handles the case for the items with startdate before the window and enddate after the window!\n    // also cleans up invisible items.\n    if (oldVisibleItems.length > 0) {\n      for (let i = 0; i < oldVisibleItems.length; i++) {\n        this._checkIfVisibleWithReference(\n          oldVisibleItems[i],\n          visibleItems,\n          visibleItemsLookup,\n          range,\n        );\n      }\n    }\n\n    // we do a binary search for the items that have only start values.\n    const initialPosByStart = util.binarySearchCustom(\n      orderedItems.byStart,\n      startSearchFunction,\n      \"data\",\n      \"start\",\n    );\n\n    // trace the visible items from the inital start pos both ways until an invisible item is found, we only look at the start values.\n    this._traceVisible(\n      initialPosByStart,\n      orderedItems.byStart,\n      visibleItems,\n      visibleItemsLookup,\n      (item) => item.data.start < lowerBound || item.data.start > upperBound,\n    );\n\n    // if the window has changed programmatically without overlapping the old window, the ranged items with start < lowerBound and end > upperbound are not shown.\n    // We therefore have to brute force check all items in the byEnd list\n    if (this.checkRangedItems == true) {\n      this.checkRangedItems = false;\n      for (let i = 0; i < orderedItems.byEnd.length; i++) {\n        this._checkIfVisibleWithReference(\n          orderedItems.byEnd[i],\n          visibleItems,\n          visibleItemsLookup,\n          range,\n        );\n      }\n    } else {\n      // we do a binary search for the items that have defined end times.\n      const initialPosByEnd = util.binarySearchCustom(\n        orderedItems.byEnd,\n        endSearchFunction,\n        \"data\",\n      );\n\n      // trace the visible items from the inital start pos both ways until an invisible item is found, we only look at the end values.\n      this._traceVisible(\n        initialPosByEnd,\n        orderedItems.byEnd,\n        visibleItems,\n        visibleItemsLookup,\n        (item) => item.data.end < lowerBound || item.data.start > upperBound,\n      );\n    }\n\n    this._sortVisibleItems(\n      orderedItems.byStart,\n      visibleItems,\n      visibleItemsLookup,\n    );\n\n    const redrawQueue = {};\n    let redrawQueueLength = 0;\n\n    for (let i = 0; i < visibleItems.length; i++) {\n      const item = visibleItems[i];\n      if (!item.displayed) {\n        const returnQueue = true;\n        redrawQueue[i] = item.redraw(returnQueue);\n        redrawQueueLength = redrawQueue[i].length;\n      }\n    }\n\n    const needRedraw = redrawQueueLength > 0;\n    if (needRedraw) {\n      // redraw all regular items\n      for (let j = 0; j < redrawQueueLength; j++) {\n        util.forEach(redrawQueue, (fns) => {\n          fns[j]();\n        });\n      }\n    }\n\n    for (let i = 0; i < visibleItems.length; i++) {\n      visibleItems[i].repositionX();\n    }\n\n    return visibleItems;\n  }\n\n  /**\n   * trace visible items in group\n   * @param {number} initialPos\n   * @param {array} items\n   * @param {aray} visibleItems\n   * @param {object} visibleItemsLookup\n   * @param {function} breakCondition\n   */\n  _traceVisible(\n    initialPos,\n    items,\n    visibleItems,\n    visibleItemsLookup,\n    breakCondition,\n  ) {\n    if (initialPos != -1) {\n      for (let i = initialPos; i >= 0; i--) {\n        let item = items[i];\n        if (breakCondition(item)) {\n          break;\n        } else {\n          if (!(item.isCluster && !item.hasItems()) && !item.cluster) {\n            if (visibleItemsLookup[item.id] === undefined) {\n              visibleItemsLookup[item.id] = true;\n              visibleItems.unshift(item);\n            }\n          }\n        }\n      }\n\n      for (let i = initialPos + 1; i < items.length; i++) {\n        let item = items[i];\n        if (breakCondition(item)) {\n          break;\n        } else {\n          if (!(item.isCluster && !item.hasItems()) && !item.cluster) {\n            if (visibleItemsLookup[item.id] === undefined) {\n              visibleItemsLookup[item.id] = true;\n              visibleItems.push(item);\n            }\n          }\n        }\n      }\n    }\n  }\n\n  /**\n   * by-ref reordering of visibleItems array to match\n   * the specified item superset order\n   * @param {array} orderedItems\n   * @param {aray} visibleItems\n   * @param {object} visibleItemsLookup\n   */\n  _sortVisibleItems(orderedItems, visibleItems, visibleItemsLookup) {\n    visibleItems.length = 0; // Clear visibleItems array in-place\n    for (let i = 0; i < orderedItems.length; i++) {\n      let item = orderedItems[i];\n      if (visibleItemsLookup[item.id]) {\n        visibleItems.push(item);\n      }\n    }\n  }\n\n  /**\n   * this function is very similar to the _checkIfInvisible() but it does not\n   * return booleans, hides the item if it should not be seen and always adds to\n   * the visibleItems.\n   * this one is for brute forcing and hiding.\n   *\n   * @param {Item} item\n   * @param {Array} visibleItems\n   * @param {{start:number, end:number}} range\n   * @private\n   */\n  _checkIfVisible(item, visibleItems, range) {\n    if (item.isVisible(range)) {\n      if (!item.displayed) item.show();\n      // reposition item horizontally\n      item.repositionX();\n      visibleItems.push(item);\n    } else {\n      if (item.displayed) item.hide();\n    }\n  }\n\n  /**\n   * this function is very similar to the _checkIfInvisible() but it does not\n   * return booleans, hides the item if it should not be seen and always adds to\n   * the visibleItems.\n   * this one is for brute forcing and hiding.\n   *\n   * @param {Item} item\n   * @param {Array.<timeline.Item>} visibleItems\n   * @param {Object<number, boolean>} visibleItemsLookup\n   * @param {{start:number, end:number}} range\n   * @private\n   */\n  _checkIfVisibleWithReference(item, visibleItems, visibleItemsLookup, range) {\n    if (item.isVisible(range)) {\n      if (visibleItemsLookup[item.id] === undefined) {\n        visibleItemsLookup[item.id] = true;\n        visibleItems.push(item);\n      }\n    } else {\n      if (item.displayed) item.hide();\n    }\n  }\n\n  /**\n   * Update the visible items\n   * @param {array} orderedClusters\n   * @param {array} oldVisibleClusters\n   * @param {{start: number, end: number}} range\n   * @return {Item[]} visibleItems\n   * @private\n   */\n  _updateClustersInRange(orderedClusters, oldVisibleClusters, range) {\n    // Clusters can overlap each other so we cannot use binary search here\n    const visibleClusters = [];\n    const visibleClustersLookup = {}; // we keep this to quickly look up if an item already exists in the list without using indexOf on visibleItems\n\n    if (oldVisibleClusters.length > 0) {\n      for (let i = 0; i < oldVisibleClusters.length; i++) {\n        this._checkIfVisibleWithReference(\n          oldVisibleClusters[i],\n          visibleClusters,\n          visibleClustersLookup,\n          range,\n        );\n      }\n    }\n\n    for (let i = 0; i < orderedClusters.byStart.length; i++) {\n      this._checkIfVisibleWithReference(\n        orderedClusters.byStart[i],\n        visibleClusters,\n        visibleClustersLookup,\n        range,\n      );\n    }\n\n    for (let i = 0; i < orderedClusters.byEnd.length; i++) {\n      this._checkIfVisibleWithReference(\n        orderedClusters.byEnd[i],\n        visibleClusters,\n        visibleClustersLookup,\n        range,\n      );\n    }\n\n    const redrawQueue = {};\n    let redrawQueueLength = 0;\n\n    for (let i = 0; i < visibleClusters.length; i++) {\n      const item = visibleClusters[i];\n      if (!item.displayed) {\n        const returnQueue = true;\n        redrawQueue[i] = item.redraw(returnQueue);\n        redrawQueueLength = redrawQueue[i].length;\n      }\n    }\n\n    const needRedraw = redrawQueueLength > 0;\n    if (needRedraw) {\n      // redraw all regular items\n      for (var j = 0; j < redrawQueueLength; j++) {\n        util.forEach(redrawQueue, function (fns) {\n          fns[j]();\n        });\n      }\n    }\n\n    for (let i = 0; i < visibleClusters.length; i++) {\n      visibleClusters[i].repositionX();\n    }\n\n    return visibleClusters;\n  }\n\n  /**\n   * change item subgroup\n   * @param {object} item\n   * @param {string} oldSubgroup\n   * @param {string} newSubgroup\n   */\n  changeSubgroup(item, oldSubgroup, newSubgroup) {\n    this._removeFromSubgroup(item, oldSubgroup);\n    this._addToSubgroup(item, newSubgroup);\n    this.orderSubgroups();\n  }\n\n  /**\n   * Call this method before you lose the last reference to an instance of this.\n   * It will remove listeners etc.\n   */\n  dispose() {\n    this.hide();\n\n    let disposeCallback;\n    while ((disposeCallback = this._disposeCallbacks.pop())) {\n      disposeCallback();\n    }\n  }\n}\n\nexport default Group;\n","import Group from \"./Group.js\";\n\n/**\n * @constructor BackgroundGroup\n * @extends Group\n */\nclass BackgroundGroup extends Group {\n  /**\n   * @param {number | string} groupId\n   * @param {Object} data\n   * @param {ItemSet} itemSet\n   */\n  constructor(groupId, data, itemSet) {\n    super(groupId, data, itemSet);\n    // Group.call(this, groupId, data, itemSet);\n\n    this.width = 0;\n    this.height = 0;\n    this.top = 0;\n    this.left = 0;\n  }\n\n  /**\n   * Repaint this group\n   * @param {{start: number, end: number}} range\n   * @param {{item: {horizontal: number, vertical: number}, axis: number}} margin\n   * @return {boolean} Returns true if the group is resized\n   */\n  redraw(range, margin) {\n    const resized = false;\n\n    this.visibleItems = this._updateItemsInRange(\n      this.orderedItems,\n      this.visibleItems,\n      range,\n    );\n\n    // calculate actual size\n    this.width = this.dom.background.offsetWidth;\n\n    // apply new height (just always zero for BackgroundGroup\n    this.dom.background.style.height = \"0\";\n\n    // update vertical position of items after they are re-stacked and the height of the group is calculated\n    for (let i = 0, ii = this.visibleItems.length; i < ii; i++) {\n      const item = this.visibleItems[i];\n      item.repositionY(margin);\n    }\n\n    return resized;\n  }\n\n  /**\n   * Show this group: attach to the DOM\n   */\n  show() {\n    if (!this.dom.background.parentNode) {\n      this.itemSet.dom.background.appendChild(this.dom.background);\n    }\n  }\n}\n\nexport default BackgroundGroup;\n","import Hammer from \"../../../module/hammer.js\";\nimport util from \"../../../util.js\";\nimport moment from \"../../../module/moment.js\";\nimport locales from \"../../locales.js\";\n\n/**\n * Item\n */\nclass Item {\n  /**\n   * @constructor Item\n   * @param {Object} data             Object containing (optional) parameters type,\n   *                                  start, end, content, group, className.\n   * @param {{toScreen: function, toTime: function}} conversion\n   *                                  Conversion functions from time to screen and vice versa\n   * @param {Object} options          Configuration options\n   *                                  // TODO: describe available options\n   */\n  constructor(data, conversion, options) {\n    this.id = null;\n    this.parent = null;\n    this.data = data;\n    this.dom = null;\n    this.conversion = conversion || {};\n    this.defaultOptions = {\n      locales,\n      locale: \"en\",\n    };\n    this.options = util.extend({}, this.defaultOptions, options);\n    this.options.locales = util.extend({}, locales, this.options.locales);\n    const defaultLocales =\n      this.defaultOptions.locales[this.defaultOptions.locale];\n    Object.keys(this.options.locales).forEach((locale) => {\n      this.options.locales[locale] = util.extend(\n        {},\n        defaultLocales,\n        this.options.locales[locale],\n      );\n    });\n    this.selected = false;\n    this.displayed = false;\n    this.groupShowing = true;\n    this.selectable = (options && options.selectable) || false;\n    this.dirty = true;\n\n    this.top = null;\n    this.right = null;\n    this.left = null;\n    this.width = null;\n    this.height = null;\n\n    this.setSelectability(data);\n\n    this.editable = null;\n    this._updateEditStatus();\n  }\n\n  /**\n   * Select current item\n   */\n  select() {\n    if (this.selectable) {\n      this.selected = true;\n      this.dirty = true;\n      if (this.displayed) this.redraw();\n    }\n  }\n\n  /**\n   * Unselect current item\n   */\n  unselect() {\n    this.selected = false;\n    this.dirty = true;\n    if (this.displayed) this.redraw();\n  }\n\n  /**\n   * Set data for the item. Existing data will be updated. The id should not\n   * be changed. When the item is displayed, it will be redrawn immediately.\n   * @param {Object} data\n   */\n  setData(data) {\n    const groupChanged =\n      data.group != undefined && this.data.group != data.group;\n    if (groupChanged && this.parent != null) {\n      this.parent.itemSet._moveToGroup(this, data.group);\n    }\n\n    this.setSelectability(data);\n\n    if (this.parent) {\n      this.parent.stackDirty = true;\n    }\n\n    const subGroupChanged =\n      data.subgroup != undefined && this.data.subgroup != data.subgroup;\n    if (subGroupChanged && this.parent != null) {\n      this.parent.changeSubgroup(this, this.data.subgroup, data.subgroup);\n    }\n\n    this.data = data;\n    this._updateEditStatus();\n    this.dirty = true;\n    if (this.displayed) this.redraw();\n  }\n\n  /**\n   * Set whether the item can be selected.\n   * Can only be set/unset if the timeline's `selectable` configuration option is `true`.\n   * @param {Object} data `data` from `constructor` and `setData`\n   */\n  setSelectability(data) {\n    if (data) {\n      this.selectable =\n        typeof data.selectable === \"undefined\"\n          ? true\n          : Boolean(data.selectable);\n    }\n  }\n\n  /**\n   * Set a parent for the item\n   * @param {Group} parent\n   */\n  setParent(parent) {\n    if (this.displayed) {\n      this.hide();\n      this.parent = parent;\n      if (this.parent) {\n        this.show();\n      }\n    } else {\n      this.parent = parent;\n    }\n  }\n\n  /**\n   * Check whether this item is visible inside given range\n   * @returns {boolean} True if visible\n   */\n  isVisible() {\n    return false;\n  }\n\n  /**\n   * Show the Item in the DOM (when not already visible)\n   * @return {Boolean} changed\n   */\n  show() {\n    return false;\n  }\n\n  /**\n   * Hide the Item from the DOM (when visible)\n   * @return {Boolean} changed\n   */\n  hide() {\n    return false;\n  }\n\n  /**\n   * Repaint the item\n   */\n  redraw() {\n    // should be implemented by the item\n  }\n\n  /**\n   * Reposition the Item horizontally\n   */\n  repositionX() {\n    // should be implemented by the item\n  }\n\n  /**\n   * Reposition the Item vertically\n   */\n  repositionY() {\n    // should be implemented by the item\n  }\n\n  /**\n   * Repaint a drag area on the center of the item when the item is selected\n   * @protected\n   */\n  _repaintDragCenter() {\n    if (this.selected && this.editable.updateTime && !this.dom.dragCenter) {\n      const me = this;\n      // create and show drag area\n      const dragCenter = document.createElement(\"div\");\n      dragCenter.className = \"vis-drag-center\";\n      dragCenter.dragCenterItem = this;\n      this.hammerDragCenter = new Hammer(dragCenter);\n\n      this.hammerDragCenter.on(\"tap\", (event) => {\n        me.parent.itemSet.body.emitter.emit(\"click\", {\n          event,\n          item: me.id,\n        });\n      });\n      this.hammerDragCenter.on(\"doubletap\", (event) => {\n        event.stopPropagation();\n        me.parent.itemSet._onUpdateItem(me);\n        me.parent.itemSet.body.emitter.emit(\"doubleClick\", {\n          event,\n          item: me.id,\n        });\n      });\n      this.hammerDragCenter.on(\"panstart\", (event) => {\n        // do not allow this event to propagate to the Range\n        event.stopPropagation();\n        me.parent.itemSet._onDragStart(event);\n      });\n      this.hammerDragCenter.on(\n        \"panmove\",\n        me.parent.itemSet._onDrag.bind(me.parent.itemSet),\n      );\n      this.hammerDragCenter.on(\n        \"panend\",\n        me.parent.itemSet._onDragEnd.bind(me.parent.itemSet),\n      );\n      // delay addition on item click for trackpads...\n      this.hammerDragCenter.get(\"press\").set({ time: 10000 });\n\n      if (this.dom.box) {\n        if (this.dom.dragLeft) {\n          this.dom.box.insertBefore(dragCenter, this.dom.dragLeft);\n        } else {\n          this.dom.box.appendChild(dragCenter);\n        }\n      } else if (this.dom.point) {\n        this.dom.point.appendChild(dragCenter);\n      }\n\n      this.dom.dragCenter = dragCenter;\n    } else if (!this.selected && this.dom.dragCenter) {\n      // delete drag area\n      if (this.dom.dragCenter.parentNode) {\n        this.dom.dragCenter.parentNode.removeChild(this.dom.dragCenter);\n      }\n      this.dom.dragCenter = null;\n\n      if (this.hammerDragCenter) {\n        this.hammerDragCenter.destroy();\n        this.hammerDragCenter = null;\n      }\n    }\n  }\n\n  /**\n   * Repaint a delete button on the top right of the item when the item is selected\n   * @param {HTMLElement} anchor\n   * @protected\n   */\n  _repaintDeleteButton(anchor) {\n    const editable =\n      ((this.options.editable.overrideItems || this.editable == null) &&\n        this.options.editable.remove) ||\n      (!this.options.editable.overrideItems &&\n        this.editable != null &&\n        this.editable.remove);\n\n    if (this.selected && editable && !this.dom.deleteButton) {\n      // create and show button\n      const me = this;\n\n      const deleteButton = document.createElement(\"div\");\n\n      if (this.options.rtl) {\n        deleteButton.className = \"vis-delete-rtl\";\n      } else {\n        deleteButton.className = \"vis-delete\";\n      }\n      let optionsLocale = this.options.locales[this.options.locale];\n      if (!optionsLocale) {\n        if (!this.warned) {\n          console.warn(\n            `WARNING: options.locales['${this.options.locale}'] not found. See https://visjs.github.io/vis-timeline/docs/timeline/#Localization`,\n          );\n          this.warned = true;\n        }\n        optionsLocale = this.options.locales[\"en\"]; // fall back on english when not available\n      }\n      deleteButton.title = optionsLocale.deleteSelected;\n\n      // TODO: be able to destroy the delete button\n      this.hammerDeleteButton = new Hammer(deleteButton).on(\"tap\", (event) => {\n        event.stopPropagation();\n        me.parent.removeFromDataSet(me);\n      });\n\n      anchor.appendChild(deleteButton);\n      this.dom.deleteButton = deleteButton;\n    } else if ((!this.selected || !editable) && this.dom.deleteButton) {\n      // remove button\n      if (this.dom.deleteButton.parentNode) {\n        this.dom.deleteButton.parentNode.removeChild(this.dom.deleteButton);\n      }\n      this.dom.deleteButton = null;\n\n      if (this.hammerDeleteButton) {\n        this.hammerDeleteButton.destroy();\n        this.hammerDeleteButton = null;\n      }\n    }\n  }\n\n  /**\n   * Repaint a onChange tooltip on the top right of the item when the item is selected\n   * @param {HTMLElement} anchor\n   * @protected\n   */\n  _repaintOnItemUpdateTimeTooltip(anchor) {\n    if (!this.options.tooltipOnItemUpdateTime) return;\n\n    const editable =\n      (this.options.editable.updateTime || this.data.editable === true) &&\n      this.data.editable !== false;\n\n    if (this.selected && editable && !this.dom.onItemUpdateTimeTooltip) {\n      const onItemUpdateTimeTooltip = document.createElement(\"div\");\n\n      onItemUpdateTimeTooltip.className = \"vis-onUpdateTime-tooltip\";\n      anchor.appendChild(onItemUpdateTimeTooltip);\n      this.dom.onItemUpdateTimeTooltip = onItemUpdateTimeTooltip;\n    } else if (!this.selected && this.dom.onItemUpdateTimeTooltip) {\n      // remove button\n      if (this.dom.onItemUpdateTimeTooltip.parentNode) {\n        this.dom.onItemUpdateTimeTooltip.parentNode.removeChild(\n          this.dom.onItemUpdateTimeTooltip,\n        );\n      }\n      this.dom.onItemUpdateTimeTooltip = null;\n    }\n\n    // position onChange tooltip\n    if (this.dom.onItemUpdateTimeTooltip) {\n      // only show when editing\n      this.dom.onItemUpdateTimeTooltip.style.visibility = this.parent.itemSet\n        .touchParams.itemIsDragging\n        ? \"visible\"\n        : \"hidden\";\n\n      // position relative to item's content\n      this.dom.onItemUpdateTimeTooltip.style.transform = \"translateX(-50%)\";\n      this.dom.onItemUpdateTimeTooltip.style.left = \"50%\";\n\n      // position above or below the item depending on the item's position in the window\n      const tooltipOffset = 50; // TODO: should be tooltip height (depends on template)\n      const scrollTop = this.parent.itemSet.body.domProps.scrollTop;\n\n      // TODO: this.top for orientation:true is actually the items distance from the bottom...\n      // (should be this.bottom)\n      let itemDistanceFromTop;\n      if (this.options.orientation.item == \"top\") {\n        itemDistanceFromTop = this.top;\n      } else {\n        itemDistanceFromTop = this.parent.height - this.top - this.height;\n      }\n      const isCloseToTop =\n        itemDistanceFromTop + this.parent.top - tooltipOffset < -scrollTop;\n\n      if (isCloseToTop) {\n        this.dom.onItemUpdateTimeTooltip.style.bottom = \"\";\n        this.dom.onItemUpdateTimeTooltip.style.top = `${this.height + 2}px`;\n      } else {\n        this.dom.onItemUpdateTimeTooltip.style.top = \"\";\n        this.dom.onItemUpdateTimeTooltip.style.bottom = `${this.height + 2}px`;\n      }\n\n      // handle tooltip content\n      let content;\n      let templateFunction;\n\n      if (\n        this.options.tooltipOnItemUpdateTime &&\n        this.options.tooltipOnItemUpdateTime.template\n      ) {\n        templateFunction =\n          this.options.tooltipOnItemUpdateTime.template.bind(this);\n        content = templateFunction(this.data);\n      } else {\n        content = `start: ${moment(this.data.start).format(\"MM/DD/YYYY hh:mm\")}`;\n        if (this.data.end) {\n          content += `<br> end: ${moment(this.data.end).format(\"MM/DD/YYYY hh:mm\")}`;\n        }\n      }\n      this.dom.onItemUpdateTimeTooltip.innerHTML = util.xss(content);\n    }\n  }\n\n  /**\n   * get item data\n   * @return {object}\n   * @private\n   */\n  _getItemData() {\n    return this.parent.itemSet.itemsData.get(this.id);\n  }\n\n  /**\n   * Set HTML contents for the item\n   * @param {Element} element   HTML element to fill with the contents\n   * @private\n   */\n  _updateContents(element) {\n    let content;\n    let changed;\n    let templateFunction;\n    let itemVisibleFrameContent;\n    let visibleFrameTemplateFunction;\n    const itemData = this._getItemData(); // get a clone of the data from the dataset\n\n    const frameElement = this.dom.box || this.dom.point;\n    const itemVisibleFrameContentElement = frameElement.getElementsByClassName(\n      \"vis-item-visible-frame\",\n    )[0];\n\n    if (this.options.visibleFrameTemplate) {\n      visibleFrameTemplateFunction =\n        this.options.visibleFrameTemplate.bind(this);\n      itemVisibleFrameContent = util.xss(\n        visibleFrameTemplateFunction(itemData, itemVisibleFrameContentElement),\n      );\n    } else {\n      itemVisibleFrameContent = \"\";\n    }\n\n    if (itemVisibleFrameContentElement) {\n      if (\n        itemVisibleFrameContent instanceof Object &&\n        !(itemVisibleFrameContent instanceof Element)\n      ) {\n        visibleFrameTemplateFunction(itemData, itemVisibleFrameContentElement);\n      } else {\n        changed =\n          this._contentToString(this.itemVisibleFrameContent) !==\n          this._contentToString(itemVisibleFrameContent);\n        if (changed) {\n          // only replace the content when changed\n          if (itemVisibleFrameContent instanceof Element) {\n            itemVisibleFrameContentElement.innerHTML = \"\";\n            itemVisibleFrameContentElement.appendChild(itemVisibleFrameContent);\n          } else if (itemVisibleFrameContent != undefined) {\n            itemVisibleFrameContentElement.innerHTML = util.xss(\n              itemVisibleFrameContent,\n            );\n          } else {\n            if (\n              !(\n                this.data.type == \"background\" &&\n                this.data.content === undefined\n              )\n            ) {\n              throw new Error(`Property \"content\" missing in item ${this.id}`);\n            }\n          }\n\n          this.itemVisibleFrameContent = itemVisibleFrameContent;\n        }\n      }\n    }\n\n    if (this.options.template) {\n      templateFunction = this.options.template.bind(this);\n      content = templateFunction(itemData, element, this.data);\n    } else {\n      content = this.data.content;\n    }\n\n    if (content instanceof Object && !(content instanceof Element)) {\n      templateFunction(itemData, element);\n    } else {\n      changed =\n        this._contentToString(this.content) !== this._contentToString(content);\n      if (changed) {\n        // only replace the content when changed\n        if (content instanceof Element) {\n          element.innerHTML = \"\";\n          element.appendChild(content);\n        } else if (content != undefined) {\n          element.innerHTML = util.xss(content);\n        } else {\n          if (\n            !(this.data.type == \"background\" && this.data.content === undefined)\n          ) {\n            throw new Error(`Property \"content\" missing in item ${this.id}`);\n          }\n        }\n        this.content = content;\n      }\n    }\n  }\n\n  /**\n   * Process dataAttributes timeline option and set as data- attributes on dom.content\n   * @param {Element} element   HTML element to which the attributes will be attached\n   * @private\n   */\n  _updateDataAttributes(element) {\n    if (this.options.dataAttributes && this.options.dataAttributes.length > 0) {\n      let attributes = [];\n\n      if (Array.isArray(this.options.dataAttributes)) {\n        attributes = this.options.dataAttributes;\n      } else if (this.options.dataAttributes == \"all\") {\n        attributes = Object.keys(this.data);\n      } else {\n        return;\n      }\n\n      for (const name of attributes) {\n        const value = this.data[name];\n\n        if (value != null) {\n          element.setAttribute(`data-${name}`, value);\n        } else {\n          element.removeAttribute(`data-${name}`);\n        }\n      }\n    }\n  }\n\n  /**\n   * Update custom styles of the element\n   * @param {Element} element\n   * @private\n   */\n  _updateStyle(element) {\n    // remove old styles\n    if (this.style) {\n      util.removeCssText(element, this.style);\n      this.style = null;\n    }\n\n    // append new styles\n    if (this.data.style) {\n      util.addCssText(element, this.data.style);\n      this.style = this.data.style;\n    }\n  }\n\n  /**\n   * Stringify the items contents\n   * @param {string | Element | undefined} content\n   * @returns {string | undefined}\n   * @private\n   */\n  _contentToString(content) {\n    if (typeof content === \"string\") return content;\n    if (content && \"outerHTML\" in content) return content.outerHTML;\n    return content;\n  }\n\n  /**\n   * Update the editability of this item.\n   */\n  _updateEditStatus() {\n    if (this.options) {\n      if (typeof this.options.editable === \"boolean\") {\n        this.editable = {\n          updateTime: this.options.editable,\n          updateGroup: this.options.editable,\n          remove: this.options.editable,\n        };\n      } else if (typeof this.options.editable === \"object\") {\n        this.editable = {};\n        util.selectiveExtend(\n          [\"updateTime\", \"updateGroup\", \"remove\"],\n          this.editable,\n          this.options.editable,\n        );\n      }\n    }\n    // Item data overrides, except if options.editable.overrideItems is set.\n    if (\n      !this.options ||\n      !this.options.editable ||\n      this.options.editable.overrideItems !== true\n    ) {\n      if (this.data) {\n        if (typeof this.data.editable === \"boolean\") {\n          this.editable = {\n            updateTime: this.data.editable,\n            updateGroup: this.data.editable,\n            remove: this.data.editable,\n          };\n        } else if (typeof this.data.editable === \"object\") {\n          // TODO: in timeline.js 5.0, we should change this to not reset options from the timeline configuration.\n          // Basically just remove the next line...\n          this.editable = {};\n          util.selectiveExtend(\n            [\"updateTime\", \"updateGroup\", \"remove\"],\n            this.editable,\n            this.data.editable,\n          );\n        }\n      }\n    }\n  }\n\n  /**\n   * Return the width of the item left from its start date\n   * @return {number}\n   */\n  getWidthLeft() {\n    return 0;\n  }\n\n  /**\n   * Return the width of the item right from the max of its start and end date\n   * @return {number}\n   */\n  getWidthRight() {\n    return 0;\n  }\n\n  /**\n   * Return the title of the item\n   * @return {string | undefined}\n   */\n  getTitle() {\n    if (this.options.tooltip && this.options.tooltip.template) {\n      const templateFunction = this.options.tooltip.template.bind(this);\n      return templateFunction(this._getItemData(), this.data);\n    }\n\n    return this.data.title;\n  }\n}\n\nItem.prototype.stack = true;\n\nexport default Item;\n","import Item from \"./Item.js\";\n\n/**\n * @constructor BoxItem\n * @extends Item\n */\nclass BoxItem extends Item {\n  /**\n   * @param {Object} data             Object containing parameters start\n   *                                  content, className.\n   * @param {{toScreen: function, toTime: function}} conversion\n   *                                  Conversion functions from time to screen and vice versa\n   * @param {Object} [options]        Configuration options\n   *                                  // TODO: describe available options\n   */\n  constructor(data, conversion, options) {\n    super(data, conversion, options);\n    this.props = {\n      dot: {\n        width: 0,\n        height: 0,\n      },\n      line: {\n        width: 0,\n        height: 0,\n      },\n    };\n    // validate data\n    if (data) {\n      if (data.start == undefined) {\n        throw new Error(`Property \"start\" missing in item ${data}`);\n      }\n    }\n  }\n\n  /**\n   * Check whether this item is visible inside given range\n   * @param {{start: number, end: number}} range with a timestamp for start and end\n   * @returns {boolean} True if visible\n   */\n  isVisible(range) {\n    if (this.cluster) {\n      return false;\n    }\n    // determine visibility\n    let isVisible;\n    const align = this.data.align || this.options.align;\n    const widthInMs = this.width * range.getMillisecondsPerPixel();\n\n    if (align == \"right\") {\n      isVisible =\n        this.data.start.getTime() > range.start &&\n        this.data.start.getTime() - widthInMs < range.end;\n    } else if (align == \"left\") {\n      isVisible =\n        this.data.start.getTime() + widthInMs > range.start &&\n        this.data.start.getTime() < range.end;\n    } else {\n      // default or 'center'\n      isVisible =\n        this.data.start.getTime() + widthInMs / 2 > range.start &&\n        this.data.start.getTime() - widthInMs / 2 < range.end;\n    }\n    return isVisible;\n  }\n\n  /**\n   * create DOM element\n   * @private\n   */\n  _createDomElement() {\n    if (!this.dom) {\n      // create DOM\n      this.dom = {};\n\n      // create main box\n      this.dom.box = document.createElement(\"DIV\");\n\n      // contents box (inside the background box). used for making margins\n      this.dom.content = document.createElement(\"DIV\");\n      this.dom.content.className = \"vis-item-content\";\n      this.dom.box.appendChild(this.dom.content);\n\n      // line to axis\n      this.dom.line = document.createElement(\"DIV\");\n      this.dom.line.className = \"vis-line\";\n\n      // dot on axis\n      this.dom.dot = document.createElement(\"DIV\");\n      this.dom.dot.className = \"vis-dot\";\n\n      // attach this item as attribute\n      this.dom.box[\"vis-item\"] = this;\n\n      this.dirty = true;\n    }\n  }\n\n  /**\n   * append DOM element\n   * @private\n   */\n  _appendDomElement() {\n    if (!this.parent) {\n      throw new Error(\"Cannot redraw item: no parent attached\");\n    }\n    if (!this.dom.box.parentNode) {\n      const foreground = this.parent.dom.foreground;\n      if (!foreground)\n        throw new Error(\n          \"Cannot redraw item: parent has no foreground container element\",\n        );\n      foreground.appendChild(this.dom.box);\n    }\n    if (!this.dom.line.parentNode) {\n      var background = this.parent.dom.background;\n      if (!background)\n        throw new Error(\n          \"Cannot redraw item: parent has no background container element\",\n        );\n      background.appendChild(this.dom.line);\n    }\n    if (!this.dom.dot.parentNode) {\n      const axis = this.parent.dom.axis;\n      if (!background)\n        throw new Error(\n          \"Cannot redraw item: parent has no axis container element\",\n        );\n      axis.appendChild(this.dom.dot);\n    }\n    this.displayed = true;\n  }\n\n  /**\n   * update dirty DOM element\n   * @private\n   */\n  _updateDirtyDomComponents() {\n    // An item is marked dirty when:\n    // - the item is not yet rendered\n    // - the item's data is changed\n    // - the item is selected/deselected\n    if (this.dirty) {\n      this._updateContents(this.dom.content);\n      this._updateDataAttributes(this.dom.box);\n      this._updateStyle(this.dom.box);\n\n      const editable = this.editable.updateTime || this.editable.updateGroup;\n\n      // update class\n      const className =\n        (this.data.className ? \" \" + this.data.className : \"\") +\n        (this.selected ? \" vis-selected\" : \"\") +\n        (editable ? \" vis-editable\" : \" vis-readonly\");\n      this.dom.box.className = `vis-item vis-box${className}`;\n      this.dom.line.className = `vis-item vis-line${className}`;\n      this.dom.dot.className = `vis-item vis-dot${className}`;\n    }\n  }\n\n  /**\n   * get DOM components sizes\n   * @return {object}\n   * @private\n   */\n  _getDomComponentsSizes() {\n    return {\n      previous: {\n        right: this.dom.box.style.right,\n        left: this.dom.box.style.left,\n      },\n      dot: {\n        height: this.dom.dot.offsetHeight,\n        width: this.dom.dot.offsetWidth,\n      },\n      line: {\n        width: this.dom.line.offsetWidth,\n      },\n      box: {\n        width: this.dom.box.offsetWidth,\n        height: this.dom.box.offsetHeight,\n      },\n    };\n  }\n\n  /**\n   * update DOM components sizes\n   * @param {object} sizes\n   * @private\n   */\n  _updateDomComponentsSizes(sizes) {\n    if (this.options.rtl) {\n      this.dom.box.style.right = \"0px\";\n    } else {\n      this.dom.box.style.left = \"0px\";\n    }\n\n    // recalculate size\n    this.props.dot.height = sizes.dot.height;\n    this.props.dot.width = sizes.dot.width;\n    this.props.line.width = sizes.line.width;\n    this.width = sizes.box.width;\n    this.height = sizes.box.height;\n\n    // restore previous position\n    if (this.options.rtl) {\n      this.dom.box.style.right = sizes.previous.right;\n    } else {\n      this.dom.box.style.left = sizes.previous.left;\n    }\n\n    this.dirty = false;\n  }\n\n  /**\n   * repaint DOM additionals\n   * @private\n   */\n  _repaintDomAdditionals() {\n    this._repaintOnItemUpdateTimeTooltip(this.dom.box);\n    this._repaintDragCenter();\n    this._repaintDeleteButton(this.dom.box);\n  }\n\n  /**\n   * Repaint the item\n   * @param {boolean} [returnQueue=false]  return the queue\n   * @return {boolean} the redraw queue if returnQueue=true\n   */\n  redraw(returnQueue) {\n    let sizes;\n    const queue = [\n      // create item DOM\n      this._createDomElement.bind(this),\n\n      // append DOM to parent DOM\n      this._appendDomElement.bind(this),\n\n      // update dirty DOM\n      this._updateDirtyDomComponents.bind(this),\n\n      () => {\n        if (this.dirty) {\n          sizes = this._getDomComponentsSizes();\n        }\n      },\n\n      () => {\n        if (this.dirty) {\n          this._updateDomComponentsSizes.bind(this)(sizes);\n        }\n      },\n\n      // repaint DOM additionals\n      this._repaintDomAdditionals.bind(this),\n    ];\n\n    if (returnQueue) {\n      return queue;\n    } else {\n      let result;\n      queue.forEach((fn) => {\n        result = fn();\n      });\n      return result;\n    }\n  }\n\n  /**\n   * Show the item in the DOM (when not already visible). The items DOM will\n   * be created when needed.\n   * @param {boolean} [returnQueue=false]  whether to return a queue of functions to execute instead of just executing them\n   * @return {boolean} the redraw queue if returnQueue=true\n   */\n  show(returnQueue) {\n    if (!this.displayed) {\n      return this.redraw(returnQueue);\n    }\n  }\n\n  /**\n   * Hide the item from the DOM (when visible)\n   */\n  hide() {\n    if (this.displayed) {\n      const dom = this.dom;\n\n      if (dom.box.remove) dom.box.remove();\n      else if (dom.box.parentNode) dom.box.parentNode.removeChild(dom.box); // IE11\n\n      if (dom.line.remove) dom.line.remove();\n      else if (dom.line.parentNode) dom.line.parentNode.removeChild(dom.line); // IE11\n\n      if (dom.dot.remove) dom.dot.remove();\n      else if (dom.dot.parentNode) dom.dot.parentNode.removeChild(dom.dot); // IE11\n\n      this.displayed = false;\n    }\n  }\n\n  /**\n   * Reposition the item XY\n   */\n  repositionXY() {\n    const rtl = this.options.rtl;\n\n    const repositionXY = (element, x, y, rtl = false) => {\n      if (x === undefined && y === undefined) return;\n      // If rtl invert the number.\n      const directionX = rtl ? x * -1 : x;\n\n      //no y. translate x\n      if (y === undefined) {\n        element.style.transform = `translateX(${directionX}px)`;\n        return;\n      }\n\n      //no x. translate y\n      if (x === undefined) {\n        element.style.transform = `translateY(${y}px)`;\n        return;\n      }\n\n      element.style.transform = `translate(${directionX}px, ${y}px)`;\n    };\n    repositionXY(this.dom.box, this.boxX, this.boxY, rtl);\n    repositionXY(this.dom.dot, this.dotX, this.dotY, rtl);\n    repositionXY(this.dom.line, this.lineX, this.lineY, rtl);\n  }\n\n  /**\n   * Reposition the item horizontally\n   * @Override\n   */\n  repositionX() {\n    const start = this.conversion.toScreen(this.data.start);\n    const align =\n      this.data.align === undefined ? this.options.align : this.data.align;\n    const lineWidth = this.props.line.width;\n    const dotWidth = this.props.dot.width;\n\n    if (align == \"right\") {\n      // calculate right position of the box\n      this.boxX = start - this.width;\n      this.lineX = start - lineWidth;\n      this.dotX = start - lineWidth / 2 - dotWidth / 2;\n    } else if (align == \"left\") {\n      // calculate left position of the box\n      this.boxX = start;\n      this.lineX = start;\n      this.dotX = start + lineWidth / 2 - dotWidth / 2;\n    } else {\n      // default or 'center'\n      this.boxX = start - this.width / 2;\n      this.lineX = this.options.rtl ? start - lineWidth : start - lineWidth / 2;\n      this.dotX = start - dotWidth / 2;\n    }\n\n    if (this.options.rtl) this.right = this.boxX;\n    else this.left = this.boxX;\n\n    this.repositionXY();\n  }\n\n  /**\n   * Reposition the item vertically\n   * @Override\n   */\n  repositionY() {\n    const orientation = this.options.orientation.item;\n    const lineStyle = this.dom.line.style;\n\n    if (orientation == \"top\") {\n      const lineHeight = this.parent.top + this.top + 1;\n\n      this.boxY = this.top || 0;\n      lineStyle.height = `${lineHeight}px`;\n      lineStyle.bottom = \"\";\n      lineStyle.top = \"0\";\n    } else {\n      // orientation 'bottom'\n      const itemSetHeight = this.parent.itemSet.props.height; // TODO: this is nasty\n      const lineHeight =\n        itemSetHeight - this.parent.top - this.parent.height + this.top;\n\n      this.boxY = this.parent.height - this.top - (this.height || 0);\n      lineStyle.height = `${lineHeight}px`;\n      lineStyle.top = \"\";\n      lineStyle.bottom = \"0\";\n    }\n\n    this.dotY = -this.props.dot.height / 2;\n\n    this.repositionXY();\n  }\n\n  /**\n   * Return the width of the item left from its start date\n   * @return {number}\n   */\n  getWidthLeft() {\n    return this.width / 2;\n  }\n\n  /**\n   * Return the width of the item right from its start date\n   * @return {number}\n   */\n  getWidthRight() {\n    return this.width / 2;\n  }\n}\n\nexport default BoxItem;\n","import Item from \"./Item.js\";\n\n/**\n * @constructor PointItem\n * @extends Item\n */\nclass PointItem extends Item {\n  /**\n   * @param {Object} data             Object containing parameters start\n   *                                  content, className.\n   * @param {{toScreen: function, toTime: function}} conversion\n   *                                  Conversion functions from time to screen and vice versa\n   * @param {Object} [options]        Configuration options\n   *                                  // TODO: describe available options\n   */\n  constructor(data, conversion, options) {\n    super(data, conversion, options);\n    this.props = {\n      dot: {\n        top: 0,\n        width: 0,\n        height: 0,\n      },\n      content: {\n        height: 0,\n        marginLeft: 0,\n        marginRight: 0,\n      },\n    };\n    // validate data\n    if (data) {\n      if (data.start == undefined) {\n        throw new Error(`Property \"start\" missing in item ${data}`);\n      }\n    }\n  }\n\n  /**\n   * Check whether this item is visible inside given range\n   * @param {{start: number, end: number}} range with a timestamp for start and end\n   * @returns {boolean} True if visible\n   */\n  isVisible(range) {\n    if (this.cluster) {\n      return false;\n    }\n    // determine visibility\n    const widthInMs = this.width * range.getMillisecondsPerPixel();\n\n    return (\n      this.data.start.getTime() + widthInMs > range.start &&\n      this.data.start < range.end\n    );\n  }\n\n  /**\n   * create DOM element\n   * @private\n   */\n  _createDomElement() {\n    if (!this.dom) {\n      // create DOM\n      this.dom = {};\n\n      // background box\n      this.dom.point = document.createElement(\"div\");\n      // className is updated in redraw()\n\n      // contents box, right from the dot\n      this.dom.content = document.createElement(\"div\");\n      this.dom.content.className = \"vis-item-content\";\n      this.dom.point.appendChild(this.dom.content);\n\n      // dot at start\n      this.dom.dot = document.createElement(\"div\");\n      this.dom.point.appendChild(this.dom.dot);\n\n      // attach this item as attribute\n      this.dom.point[\"vis-item\"] = this;\n\n      this.dirty = true;\n    }\n  }\n\n  /**\n   * append DOM element\n   * @private\n   */\n  _appendDomElement() {\n    if (!this.parent) {\n      throw new Error(\"Cannot redraw item: no parent attached\");\n    }\n    if (!this.dom.point.parentNode) {\n      const foreground = this.parent.dom.foreground;\n      if (!foreground) {\n        throw new Error(\n          \"Cannot redraw item: parent has no foreground container element\",\n        );\n      }\n      foreground.appendChild(this.dom.point);\n    }\n    this.displayed = true;\n  }\n\n  /**\n   * update dirty DOM components\n   * @private\n   */\n  _updateDirtyDomComponents() {\n    // An item is marked dirty when:\n    // - the item is not yet rendered\n    // - the item's data is changed\n    // - the item is selected/deselected\n    if (this.dirty) {\n      this._updateContents(this.dom.content);\n      this._updateDataAttributes(this.dom.point);\n      this._updateStyle(this.dom.point);\n\n      const editable = this.editable.updateTime || this.editable.updateGroup;\n      // update class\n      const className =\n        (this.data.className ? \" \" + this.data.className : \"\") +\n        (this.selected ? \" vis-selected\" : \"\") +\n        (editable ? \" vis-editable\" : \" vis-readonly\");\n      this.dom.point.className = `vis-item vis-point${className}`;\n      this.dom.dot.className = `vis-item vis-dot${className}`;\n    }\n  }\n\n  /**\n   * get DOM component sizes\n   * @return {object}\n   * @private\n   */\n  _getDomComponentsSizes() {\n    return {\n      dot: {\n        width: this.dom.dot.offsetWidth,\n        height: this.dom.dot.offsetHeight,\n      },\n      content: {\n        width: this.dom.content.offsetWidth,\n        height: this.dom.content.offsetHeight,\n      },\n      point: {\n        width: this.dom.point.offsetWidth,\n        height: this.dom.point.offsetHeight,\n      },\n    };\n  }\n\n  /**\n   * update DOM components sizes\n   * @param {array} sizes\n   * @private\n   */\n  _updateDomComponentsSizes(sizes) {\n    // recalculate size of dot and contents\n    this.props.dot.width = sizes.dot.width;\n    this.props.dot.height = sizes.dot.height;\n    this.props.content.height = sizes.content.height;\n\n    // resize contents\n    if (this.options.rtl) {\n      this.dom.content.style.marginRight = `${this.props.dot.width / 2}px`;\n    } else {\n      this.dom.content.style.marginLeft = `${this.props.dot.width / 2}px`;\n    }\n    //this.dom.content.style.marginRight = ... + 'px'; // TODO: margin right\n\n    // recalculate size\n    this.width = sizes.point.width;\n    this.height = sizes.point.height;\n\n    // reposition the dot\n    this.dom.dot.style.top = `${(this.height - this.props.dot.height) / 2}px`;\n\n    const dotWidth = this.props.dot.width;\n    const translateX = this.options.rtl ? dotWidth / 2 : (dotWidth / 2) * -1;\n    this.dom.dot.style.transform = `translateX(${translateX}px`;\n    this.dirty = false;\n  }\n\n  /**\n   * Repain DOM additionals\n   * @private\n   */\n  _repaintDomAdditionals() {\n    this._repaintOnItemUpdateTimeTooltip(this.dom.point);\n    this._repaintDragCenter();\n    this._repaintDeleteButton(this.dom.point);\n  }\n\n  /**\n   * Repaint the item\n   * @param {boolean} [returnQueue=false]  return the queue\n   * @return {boolean} the redraw queue if returnQueue=true\n   */\n  redraw(returnQueue) {\n    let sizes;\n    const queue = [\n      // create item DOM\n      this._createDomElement.bind(this),\n\n      // append DOM to parent DOM\n      this._appendDomElement.bind(this),\n\n      // update dirty DOM\n      this._updateDirtyDomComponents.bind(this),\n\n      () => {\n        if (this.dirty) {\n          sizes = this._getDomComponentsSizes();\n        }\n      },\n\n      () => {\n        if (this.dirty) {\n          this._updateDomComponentsSizes.bind(this)(sizes);\n        }\n      },\n\n      // repaint DOM additionals\n      this._repaintDomAdditionals.bind(this),\n    ];\n\n    if (returnQueue) {\n      return queue;\n    } else {\n      let result;\n      queue.forEach((fn) => {\n        result = fn();\n      });\n      return result;\n    }\n  }\n\n  /**\n   * Reposition XY\n   */\n  repositionXY() {\n    const rtl = this.options.rtl;\n\n    const repositionXY = (element, x, y, rtl = false) => {\n      if (x === undefined && y === undefined) return;\n      // If rtl invert the number.\n      const directionX = rtl ? x * -1 : x;\n\n      //no y. translate x\n      if (y === undefined) {\n        element.style.transform = `translateX(${directionX}px)`;\n        return;\n      }\n\n      //no x. translate y\n      if (x === undefined) {\n        element.style.transform = `translateY(${y}px)`;\n        return;\n      }\n\n      element.style.transform = `translate(${directionX}px, ${y}px)`;\n    };\n    repositionXY(this.dom.point, this.pointX, this.pointY, rtl);\n  }\n\n  /**\n   * Show the item in the DOM (when not already visible). The items DOM will\n   * be created when needed.\n   * @param {boolean} [returnQueue=false]  whether to return a queue of functions to execute instead of just executing them\n   * @return {boolean} the redraw queue if returnQueue=true\n   */\n  show(returnQueue) {\n    if (!this.displayed) {\n      return this.redraw(returnQueue);\n    }\n  }\n\n  /**\n   * Hide the item from the DOM (when visible)\n   */\n  hide() {\n    if (this.displayed) {\n      if (this.dom.point.parentNode) {\n        this.dom.point.parentNode.removeChild(this.dom.point);\n      }\n\n      this.displayed = false;\n    }\n  }\n\n  /**\n   * Reposition the item horizontally\n   * @Override\n   */\n  repositionX() {\n    const start = this.conversion.toScreen(this.data.start);\n\n    this.pointX = start;\n    if (this.options.rtl) {\n      this.right = start - this.props.dot.width;\n    } else {\n      this.left = start - this.props.dot.width;\n    }\n\n    this.repositionXY();\n  }\n\n  /**\n   * Reposition the item vertically\n   * @Override\n   */\n  repositionY() {\n    const orientation = this.options.orientation.item;\n    if (orientation == \"top\") {\n      this.pointY = this.top;\n    } else {\n      this.pointY = this.parent.height - this.top - this.height;\n    }\n\n    this.repositionXY();\n  }\n\n  /**\n   * Return the width of the item left from its start date\n   * @return {number}\n   */\n  getWidthLeft() {\n    return this.props.dot.width;\n  }\n\n  /**\n   * Return the width of the item right from  its start date\n   * @return {number}\n   */\n  getWidthRight() {\n    return this.props.dot.width;\n  }\n}\n\nexport default PointItem;\n","import Item from \"./Item.js\";\n\n/**\n * @constructor RangeItem\n * @extends Item\n */\nclass RangeItem extends Item {\n  /**\n   * @param {Object} data             Object containing parameters start, end\n   *                                  content, className.\n   * @param {{toScreen: function, toTime: function}} conversion\n   *                                  Conversion functions from time to screen and vice versa\n   * @param {Object} [options]        Configuration options\n   *                                  // TODO: describe options\n   */\n  constructor(data, conversion, options) {\n    super(data, conversion, options);\n    this.props = {\n      content: {\n        width: 0,\n      },\n    };\n    this.overflow = false; // if contents can overflow (css styling), this flag is set to true\n    // validate data\n    if (data) {\n      if (data.start == undefined) {\n        throw new Error(`Property \"start\" missing in item ${data.id}`);\n      }\n      if (data.end == undefined) {\n        throw new Error(`Property \"end\" missing in item ${data.id}`);\n      }\n    }\n  }\n\n  /**\n   * Check whether this item is visible inside given range\n   *\n   * @param {timeline.Range} range with a timestamp for start and end\n   * @returns {boolean} True if visible\n   */\n  isVisible(range) {\n    if (this.cluster) {\n      return false;\n    }\n    // determine visibility\n    return this.data.start < range.end && this.data.end > range.start;\n  }\n\n  /**\n   * create DOM elements\n   * @private\n   */\n  _createDomElement() {\n    if (!this.dom) {\n      // create DOM\n      this.dom = {};\n\n      // background box\n      this.dom.box = document.createElement(\"div\");\n      // className is updated in redraw()\n\n      // frame box (to prevent the item contents from overflowing)\n      this.dom.frame = document.createElement(\"div\");\n      this.dom.frame.className = \"vis-item-overflow\";\n      this.dom.box.appendChild(this.dom.frame);\n\n      // visible frame box (showing the frame that is always visible)\n      this.dom.visibleFrame = document.createElement(\"div\");\n      this.dom.visibleFrame.className = \"vis-item-visible-frame\";\n      this.dom.box.appendChild(this.dom.visibleFrame);\n\n      // contents box\n      this.dom.content = document.createElement(\"div\");\n      this.dom.content.className = \"vis-item-content\";\n      this.dom.frame.appendChild(this.dom.content);\n\n      // attach this item as attribute\n      this.dom.box[\"vis-item\"] = this;\n\n      this.dirty = true;\n    }\n  }\n\n  /**\n   * append element to DOM\n   * @private\n   */\n  _appendDomElement() {\n    if (!this.parent) {\n      throw new Error(\"Cannot redraw item: no parent attached\");\n    }\n    if (!this.dom.box.parentNode) {\n      const foreground = this.parent.dom.foreground;\n      if (!foreground) {\n        throw new Error(\n          \"Cannot redraw item: parent has no foreground container element\",\n        );\n      }\n      foreground.appendChild(this.dom.box);\n    }\n    this.displayed = true;\n  }\n\n  /**\n   * update dirty DOM components\n   * @private\n   */\n  _updateDirtyDomComponents() {\n    // update dirty DOM. An item is marked dirty when:\n    // - the item is not yet rendered\n    // - the item's data is changed\n    // - the item is selected/deselected\n    if (this.dirty) {\n      this._updateContents(this.dom.content);\n      this._updateDataAttributes(this.dom.box);\n      this._updateStyle(this.dom.box);\n\n      const editable = this.editable.updateTime || this.editable.updateGroup;\n\n      // update class\n      const className =\n        (this.data.className ? \" \" + this.data.className : \"\") +\n        (this.selected ? \" vis-selected\" : \"\") +\n        (editable ? \" vis-editable\" : \" vis-readonly\");\n      this.dom.box.className = this.baseClassName + className;\n\n      // turn off max-width to be able to calculate the real width\n      // this causes an extra browser repaint/reflow, but so be it\n      this.dom.content.style.maxWidth = \"none\";\n    }\n  }\n\n  /**\n   * get DOM component sizes\n   * @return {object}\n   * @private\n   */\n  _getDomComponentsSizes() {\n    // determine from css whether this box has overflow\n    this.overflow =\n      window.getComputedStyle(this.dom.frame).overflow !== \"hidden\";\n    this.whiteSpace =\n      window.getComputedStyle(this.dom.content).whiteSpace !== \"nowrap\";\n    return {\n      content: {\n        width: this.dom.content.offsetWidth,\n      },\n      box: {\n        height: this.dom.box.offsetHeight,\n      },\n    };\n  }\n\n  /**\n   * update DOM component sizes\n   * @param {array} sizes\n   * @private\n   */\n  _updateDomComponentsSizes(sizes) {\n    this.props.content.width = sizes.content.width;\n    this.height = sizes.box.height;\n    this.dom.content.style.maxWidth = \"\";\n    this.dirty = false;\n  }\n\n  /**\n   * repaint DOM additional components\n   * @private\n   */\n  _repaintDomAdditionals() {\n    this._repaintOnItemUpdateTimeTooltip(this.dom.box);\n    this._repaintDeleteButton(this.dom.box);\n    this._repaintDragCenter();\n    this._repaintDragLeft();\n    this._repaintDragRight();\n  }\n\n  /**\n   * Repaint the item\n   * @param {boolean} [returnQueue=false]  return the queue\n   * @return {boolean} the redraw queue if returnQueue=true\n   */\n  redraw(returnQueue) {\n    let sizes;\n    const queue = [\n      // create item DOM\n      this._createDomElement.bind(this),\n\n      // append DOM to parent DOM\n      this._appendDomElement.bind(this),\n\n      // update dirty DOM\n      this._updateDirtyDomComponents.bind(this),\n\n      () => {\n        if (this.dirty) {\n          sizes = this._getDomComponentsSizes.bind(this)();\n        }\n      },\n\n      () => {\n        if (this.dirty) {\n          this._updateDomComponentsSizes.bind(this)(sizes);\n        }\n      },\n\n      // repaint DOM additionals\n      this._repaintDomAdditionals.bind(this),\n    ];\n\n    if (returnQueue) {\n      return queue;\n    } else {\n      let result;\n      queue.forEach((fn) => {\n        result = fn();\n      });\n      return result;\n    }\n  }\n\n  /**\n   * Show the item in the DOM (when not already visible). The items DOM will\n   * be created when needed.\n   * @param {boolean} [returnQueue=false]  whether to return a queue of functions to execute instead of just executing them\n   * @return {boolean} the redraw queue if returnQueue=true\n   */\n  show(returnQueue) {\n    if (!this.displayed) {\n      return this.redraw(returnQueue);\n    }\n  }\n\n  /**\n   * Hide the item from the DOM (when visible)\n   */\n  hide() {\n    if (this.displayed) {\n      const box = this.dom.box;\n\n      if (box.parentNode) {\n        box.parentNode.removeChild(box);\n      }\n\n      this.displayed = false;\n    }\n  }\n\n  /**\n   * Reposition the item horizontally\n   * @param {boolean} [limitSize=true] If true (default), the width of the range\n   *                                   item will be limited, as the browser cannot\n   *                                   display very wide divs. This means though\n   *                                   that the applied left and width may\n   *                                   not correspond to the ranges start and end\n   * @Override\n   */\n  repositionX(limitSize) {\n    const parentWidth = this.parent.width;\n    let start = this.conversion.toScreen(this.data.start);\n    let end = this.conversion.toScreen(this.data.end);\n    const align =\n      this.data.align === undefined ? this.options.align : this.data.align;\n    let contentStartPosition;\n    let contentWidth;\n\n    // limit the width of the range, as browsers cannot draw very wide divs\n    // unless limitSize: false is explicitly set in item data\n    if (\n      this.data.limitSize !== false &&\n      (limitSize === undefined || limitSize === true)\n    ) {\n      if (start < -parentWidth) {\n        start = -parentWidth;\n      }\n      if (end > 2 * parentWidth) {\n        end = 2 * parentWidth;\n      }\n    }\n\n    //round to 3 decimals to compensate floating-point values rounding\n    const boxWidth = Math.max(Math.round((end - start) * 1000) / 1000, 1);\n\n    if (this.overflow) {\n      if (this.options.rtl) {\n        this.right = start;\n      } else {\n        this.left = start;\n      }\n      this.width = boxWidth + this.props.content.width;\n      contentWidth = this.props.content.width;\n\n      // Note: The calculation of width is an optimistic calculation, giving\n      //       a width which will not change when moving the Timeline\n      //       So no re-stacking needed, which is nicer for the eye;\n    } else {\n      if (this.options.rtl) {\n        this.right = start;\n      } else {\n        this.left = start;\n      }\n      this.width = boxWidth;\n      contentWidth = Math.min(end - start, this.props.content.width);\n    }\n\n    if (this.options.rtl) {\n      this.dom.box.style.transform = `translateX(${this.right * -1}px)`;\n    } else {\n      this.dom.box.style.transform = `translateX(${this.left}px)`;\n    }\n    this.dom.box.style.width = `${boxWidth}px`;\n    if (this.whiteSpace) {\n      this.height = this.dom.box.offsetHeight;\n    }\n\n    switch (align) {\n      case \"left\":\n        this.dom.content.style.transform = \"translateX(0)\";\n        break;\n\n      case \"right\":\n        if (this.options.rtl) {\n          const translateX = Math.max(boxWidth - contentWidth, 0) * -1;\n          this.dom.content.style.transform = `translateX(${translateX}px)`;\n        } else {\n          this.dom.content.style.transform = `translateX(${Math.max(boxWidth - contentWidth, 0)}px)`;\n        }\n        break;\n\n      case \"center\":\n        if (this.options.rtl) {\n          const translateX = Math.max((boxWidth - contentWidth) / 2, 0) * -1;\n          this.dom.content.style.transform = `translateX(${translateX}px)`;\n        } else {\n          this.dom.content.style.transform = `translateX(${Math.max((boxWidth - contentWidth) / 2, 0)}px)`;\n        }\n\n        break;\n\n      default: // 'auto'\n        // when range exceeds left of the window, position the contents at the left of the visible area\n        if (this.overflow) {\n          if (end > 0) {\n            contentStartPosition = Math.max(-start, 0);\n          } else {\n            contentStartPosition = -contentWidth; // ensure it's not visible anymore\n          }\n        } else {\n          if (start < 0) {\n            contentStartPosition = -start;\n          } else {\n            contentStartPosition = 0;\n          }\n        }\n        if (this.options.rtl) {\n          const translateX = contentStartPosition * -1;\n          this.dom.content.style.transform = `translateX(${translateX}px)`;\n        } else {\n          this.dom.content.style.transform = `translateX(${contentStartPosition}px)`;\n          // this.dom.content.style.width = `calc(100% - ${contentStartPosition}px)`;\n        }\n    }\n  }\n\n  /**\n   * Reposition the item vertically\n   * @Override\n   */\n  repositionY() {\n    const orientation = this.options.orientation.item;\n    const box = this.dom.box;\n\n    if (orientation == \"top\") {\n      box.style.top = `${this.top}px`;\n    } else {\n      box.style.top = `${this.parent.height - this.top - this.height}px`;\n    }\n  }\n\n  /**\n   * Repaint a drag area on the left side of the range when the range is selected\n   * @protected\n   */\n  _repaintDragLeft() {\n    if (\n      (this.selected || this.options.itemsAlwaysDraggable.range) &&\n      this.editable.updateTime &&\n      !this.dom.dragLeft\n    ) {\n      // create and show drag area\n      const dragLeft = document.createElement(\"div\");\n      dragLeft.className = \"vis-drag-left\";\n      dragLeft.dragLeftItem = this;\n\n      this.dom.box.appendChild(dragLeft);\n      this.dom.dragLeft = dragLeft;\n    } else if (\n      !this.selected &&\n      !this.options.itemsAlwaysDraggable.range &&\n      this.dom.dragLeft\n    ) {\n      // delete drag area\n      if (this.dom.dragLeft.parentNode) {\n        this.dom.dragLeft.parentNode.removeChild(this.dom.dragLeft);\n      }\n      this.dom.dragLeft = null;\n    }\n  }\n\n  /**\n   * Repaint a drag area on the right side of the range when the range is selected\n   * @protected\n   */\n  _repaintDragRight() {\n    if (\n      (this.selected || this.options.itemsAlwaysDraggable.range) &&\n      this.editable.updateTime &&\n      !this.dom.dragRight\n    ) {\n      // create and show drag area\n      const dragRight = document.createElement(\"div\");\n      dragRight.className = \"vis-drag-right\";\n      dragRight.dragRightItem = this;\n\n      this.dom.box.appendChild(dragRight);\n      this.dom.dragRight = dragRight;\n    } else if (\n      !this.selected &&\n      !this.options.itemsAlwaysDraggable.range &&\n      this.dom.dragRight\n    ) {\n      // delete drag area\n      if (this.dom.dragRight.parentNode) {\n        this.dom.dragRight.parentNode.removeChild(this.dom.dragRight);\n      }\n      this.dom.dragRight = null;\n    }\n  }\n}\n\nRangeItem.prototype.baseClassName = \"vis-item vis-range\";\n\nexport default RangeItem;\n","import Item from \"./Item.js\";\nimport BackgroundGroup from \"../BackgroundGroup.js\";\nimport RangeItem from \"./RangeItem.js\";\n\n/**\n * @constructor BackgroundItem\n * @extends Item\n */\nclass BackgroundItem extends Item {\n  /**\n   * @constructor BackgroundItem\n   * @param {Object} data             Object containing parameters start, end\n   *                                  content, className.\n   * @param {{toScreen: function, toTime: function}} conversion\n   *                                  Conversion functions from time to screen and vice versa\n   * @param {Object} [options]        Configuration options\n   *                                  // TODO: describe options\n   * // TODO: implement support for the BackgroundItem just having a start, then being displayed as a sort of an annotation\n   */\n  constructor(data, conversion, options) {\n    super(data, conversion, options);\n    this.props = {\n      content: {\n        width: 0,\n      },\n    };\n    this.overflow = false; // if contents can overflow (css styling), this flag is set to true\n\n    // validate data\n    if (data) {\n      if (data.start == undefined) {\n        throw new Error(`Property \"start\" missing in item ${data.id}`);\n      }\n      if (data.end == undefined) {\n        throw new Error(`Property \"end\" missing in item ${data.id}`);\n      }\n    }\n  }\n\n  /**\n   * Check whether this item is visible inside given range\n   * @param {timeline.Range} range with a timestamp for start and end\n   * @returns {boolean} True if visible\n   */\n  isVisible(range) {\n    // determine visibility\n    return this.data.start < range.end && this.data.end > range.start;\n  }\n\n  /**\n   * create DOM element\n   * @private\n   */\n  _createDomElement() {\n    if (!this.dom) {\n      // create DOM\n      this.dom = {};\n\n      // background box\n      this.dom.box = document.createElement(\"div\");\n      // className is updated in redraw()\n\n      // frame box (to prevent the item contents from overflowing\n      this.dom.frame = document.createElement(\"div\");\n      this.dom.frame.className = \"vis-item-overflow\";\n      this.dom.box.appendChild(this.dom.frame);\n\n      // contents box\n      this.dom.content = document.createElement(\"div\");\n      this.dom.content.className = \"vis-item-content\";\n      this.dom.frame.appendChild(this.dom.content);\n\n      // Note: we do NOT attach this item as attribute to the DOM,\n      //       such that background items cannot be selected\n      //this.dom.box['vis-item'] = this;\n\n      this.dirty = true;\n    }\n  }\n\n  /**\n   * append DOM element\n   * @private\n   */\n  _appendDomElement() {\n    if (!this.parent) {\n      throw new Error(\"Cannot redraw item: no parent attached\");\n    }\n    if (!this.dom.box.parentNode) {\n      const background = this.parent.dom.background;\n      if (!background) {\n        throw new Error(\n          \"Cannot redraw item: parent has no background container element\",\n        );\n      }\n      background.appendChild(this.dom.box);\n    }\n    this.displayed = true;\n  }\n\n  /**\n   * update DOM Dirty components\n   * @private\n   */\n  _updateDirtyDomComponents() {\n    // update dirty DOM. An item is marked dirty when:\n    // - the item is not yet rendered\n    // - the item's data is changed\n    // - the item is selected/deselected\n    if (this.dirty) {\n      this._updateContents(this.dom.content);\n      this._updateDataAttributes(this.dom.content);\n      this._updateStyle(this.dom.box);\n\n      // update class\n      const className =\n        (this.data.className ? \" \" + this.data.className : \"\") +\n        (this.selected ? \" vis-selected\" : \"\");\n      this.dom.box.className = this.baseClassName + className;\n    }\n  }\n\n  /**\n   * get DOM components sizes\n   * @return {object}\n   * @private\n   */\n  _getDomComponentsSizes() {\n    // determine from css whether this box has overflow\n    this.overflow =\n      window.getComputedStyle(this.dom.content).overflow !== \"hidden\";\n    return {\n      content: {\n        width: this.dom.content.offsetWidth,\n      },\n    };\n  }\n\n  /**\n   * update DOM components sizes\n   * @param {object} sizes\n   * @private\n   */\n  _updateDomComponentsSizes(sizes) {\n    // recalculate size\n    this.props.content.width = sizes.content.width;\n    this.height = 0; // set height zero, so this item will be ignored when stacking items\n\n    this.dirty = false;\n  }\n\n  /**\n   * repaint DOM additionals\n   * @private\n   */\n  _repaintDomAdditionals() {}\n\n  /**\n   * Repaint the item\n   * @param {boolean} [returnQueue=false]  return the queue\n   * @return {boolean} the redraw result or the redraw queue if returnQueue=true\n   */\n  redraw(returnQueue) {\n    let sizes;\n    const queue = [\n      // create item DOM\n      this._createDomElement.bind(this),\n\n      // append DOM to parent DOM\n      this._appendDomElement.bind(this),\n\n      this._updateDirtyDomComponents.bind(this),\n\n      () => {\n        if (this.dirty) {\n          sizes = this._getDomComponentsSizes.bind(this)();\n        }\n      },\n\n      () => {\n        if (this.dirty) {\n          this._updateDomComponentsSizes.bind(this)(sizes);\n        }\n      },\n\n      // repaint DOM additionals\n      this._repaintDomAdditionals.bind(this),\n    ];\n\n    if (returnQueue) {\n      return queue;\n    } else {\n      let result;\n      queue.forEach((fn) => {\n        result = fn();\n      });\n      return result;\n    }\n  }\n\n  /**\n   * Reposition the item vertically\n   * @Override\n   */\n  repositionY() {\n    let height;\n    const orientation = this.options.orientation.item;\n\n    // special positioning for subgroups\n    if (this.data.subgroup !== undefined) {\n      // TODO: instead of calculating the top position of the subgroups here for every BackgroundItem, calculate the top of the subgroup once in Itemset\n      const itemSubgroup = this.data.subgroup;\n\n      this.dom.box.style.height = `${this.parent.subgroups[itemSubgroup].height}px`;\n\n      if (orientation == \"top\") {\n        this.dom.box.style.top = `${this.parent.top + this.parent.subgroups[itemSubgroup].top}px`;\n      } else {\n        this.dom.box.style.top = `${this.parent.top + this.parent.height - this.parent.subgroups[itemSubgroup].top - this.parent.subgroups[itemSubgroup].height}px`;\n      }\n      this.dom.box.style.bottom = \"\";\n    }\n    // and in the case of no subgroups:\n    else {\n      // we want backgrounds with groups to only show in groups.\n      if (this.parent instanceof BackgroundGroup) {\n        // if the item is not in a group:\n        height = Math.max(\n          this.parent.height,\n          this.parent.itemSet.body.domProps.center.height,\n          this.parent.itemSet.body.domProps.centerContainer.height,\n        );\n        this.dom.box.style.bottom = orientation == \"bottom\" ? \"0\" : \"\";\n        this.dom.box.style.top = orientation == \"top\" ? \"0\" : \"\";\n      } else {\n        height = this.parent.height;\n        // same alignment for items when orientation is top or bottom\n        this.dom.box.style.top = `${this.parent.top}px`;\n        this.dom.box.style.bottom = \"\";\n      }\n    }\n    this.dom.box.style.height = `${height}px`;\n  }\n}\n\nBackgroundItem.prototype.baseClassName = \"vis-item vis-background\";\n\nBackgroundItem.prototype.stack = false;\n\n/**\n * Show the item in the DOM (when not already visible). The items DOM will\n * be created when needed.\n */\nBackgroundItem.prototype.show = RangeItem.prototype.show;\n\n/**\n * Hide the item from the DOM (when visible)\n * @return {Boolean} changed\n */\nBackgroundItem.prototype.hide = RangeItem.prototype.hide;\n\n/**\n * Reposition the item horizontally\n * @Override\n */\nBackgroundItem.prototype.repositionX = RangeItem.prototype.repositionX;\n\nexport default BackgroundItem;\n","import util from \"../util.js\";\n\n/**\n * Popup is a class to create a popup window with some text\n */\nclass Popup {\n  /**\n   * @param {Element} container       The container object.\n   * @param {string}  overflowMethod  How the popup should act to overflowing ('flip', 'cap' or 'none')\n   */\n  constructor(container, overflowMethod) {\n    this.container = container;\n    this.overflowMethod = overflowMethod || \"cap\";\n\n    this.x = 0;\n    this.y = 0;\n    this.padding = 5;\n    this.hidden = false;\n\n    // create the frame\n    this.frame = document.createElement(\"div\");\n    this.frame.className = \"vis-tooltip\";\n    this.container.appendChild(this.frame);\n  }\n\n  /**\n   * @param {number} x   Horizontal position of the popup window\n   * @param {number} y   Vertical position of the popup window\n   */\n  setPosition(x, y) {\n    this.x = parseInt(x);\n    this.y = parseInt(y);\n  }\n\n  /**\n   * Set the content for the popup window. This can be HTML code or text.\n   * @param {string | Element} content\n   */\n  setText(content) {\n    if (content instanceof Element) {\n      this.frame.innerHTML = \"\";\n      this.frame.appendChild(content);\n    } else {\n      this.frame.innerHTML = util.xss(content); // string containing text or HTML\n    }\n  }\n\n  /**\n   * Show the popup window\n   * @param {boolean} [doShow]    Show or hide the window\n   */\n  show(doShow) {\n    if (doShow === undefined) {\n      doShow = true;\n    }\n\n    if (doShow === true) {\n      var height = this.frame.clientHeight;\n      var width = this.frame.clientWidth;\n      var maxHeight = this.frame.parentNode.clientHeight;\n      var maxWidth = this.frame.parentNode.clientWidth;\n\n      var left = 0,\n        top = 0;\n\n      if (this.overflowMethod == \"flip\" || this.overflowMethod == \"none\") {\n        let isLeft = false,\n          isTop = true; // Where around the position it's located\n\n        if (this.overflowMethod == \"flip\") {\n          if (this.y - height < this.padding) {\n            isTop = false;\n          }\n\n          if (this.x + width > maxWidth - this.padding) {\n            isLeft = true;\n          }\n        }\n\n        if (isLeft) {\n          left = this.x - width;\n        } else {\n          left = this.x;\n        }\n\n        if (isTop) {\n          top = this.y - height;\n        } else {\n          top = this.y;\n        }\n      } else {\n        // this.overflowMethod == 'cap'\n        top = this.y - height;\n        if (top + height + this.padding > maxHeight) {\n          top = maxHeight - height - this.padding;\n        }\n        if (top < this.padding) {\n          top = this.padding;\n        }\n\n        left = this.x;\n        if (left + width + this.padding > maxWidth) {\n          left = maxWidth - width - this.padding;\n        }\n        if (left < this.padding) {\n          left = this.padding;\n        }\n      }\n\n      this.frame.style.left = left + \"px\";\n      this.frame.style.top = top + \"px\";\n      this.frame.style.visibility = \"visible\";\n      this.hidden = false;\n    } else {\n      this.hide();\n    }\n  }\n\n  /**\n   * Hide the popup window\n   */\n  hide() {\n    this.hidden = true;\n    this.frame.style.left = \"0\";\n    this.frame.style.top = \"0\";\n    this.frame.style.visibility = \"hidden\";\n  }\n\n  /**\n   * Remove the popup window\n   */\n  destroy() {\n    this.frame.parentNode.removeChild(this.frame); // Remove element from DOM\n  }\n}\n\nexport default Popup;\n","import { randomUUID } from \"../../../util.js\";\nimport Item from \"./Item.js\";\n\n/**\n * ClusterItem\n */\nclass ClusterItem extends Item {\n  /**\n   * @constructor Item\n   * @param {Object} data             Object containing (optional) parameters type,\n   *                                  start, end, content, group, className.\n   * @param {{toScreen: function, toTime: function}} conversion\n   *                                  Conversion functions from time to screen and vice versa\n   * @param {Object} options          Configuration options\n   *                                  // TODO: describe available options\n   */\n  constructor(data, conversion, options) {\n    const modifiedOptions = Object.assign(\n      {},\n      { fitOnDoubleClick: true },\n      options,\n      { editable: false },\n    );\n    super(data, conversion, modifiedOptions);\n\n    this.props = {\n      content: {\n        width: 0,\n        height: 0,\n      },\n    };\n\n    if (!data || data.uiItems == undefined) {\n      throw new Error('Property \"uiItems\" missing in item ' + data.id);\n    }\n\n    this.id = randomUUID();\n    this.group = data.group;\n    this._setupRange();\n\n    this.emitter = this.data.eventEmitter;\n    this.range = this.data.range;\n    this.attached = false;\n    this.isCluster = true;\n    this.data.isCluster = true;\n  }\n\n  /**\n   * check if there are items\n   * @return {boolean}\n   */\n  hasItems() {\n    return this.data.uiItems && this.data.uiItems.length && this.attached;\n  }\n\n  /**\n   * set UI items\n   * @param {array} items\n   */\n  setUiItems(items) {\n    this.detach();\n\n    this.data.uiItems = items;\n\n    this._setupRange();\n\n    this.attach();\n  }\n\n  /**\n   * check is visible\n   * @param {object} range\n   * @return {boolean}\n   */\n  isVisible(range) {\n    const rangeWidth = this.data.end ? this.data.end - this.data.start : 0;\n    const widthInMs = this.width * range.getMillisecondsPerPixel();\n    const end = Math.max(\n      this.data.start.getTime() + rangeWidth,\n      this.data.start.getTime() + widthInMs,\n    );\n    return this.data.start < range.end && end > range.start && this.hasItems();\n  }\n\n  /**\n   * get cluster data\n   * @return {object}\n   */\n  getData() {\n    return {\n      isCluster: true,\n      id: this.id,\n      items: this.data.items || [],\n      data: this.data,\n    };\n  }\n\n  /**\n   * redraw cluster item\n   * @param {boolean} returnQueue\n   * @return {boolean}\n   */\n  redraw(returnQueue) {\n    var sizes;\n    var queue = [\n      // create item DOM\n      this._createDomElement.bind(this),\n\n      // append DOM to parent DOM\n      this._appendDomElement.bind(this),\n\n      // update dirty DOM\n      this._updateDirtyDomComponents.bind(this),\n\n      function () {\n        if (this.dirty) {\n          sizes = this._getDomComponentsSizes();\n        }\n      }.bind(this),\n\n      function () {\n        if (this.dirty) {\n          this._updateDomComponentsSizes.bind(this)(sizes);\n        }\n      }.bind(this),\n\n      // repaint DOM additionals\n      this._repaintDomAdditionals.bind(this),\n    ];\n\n    if (returnQueue) {\n      return queue;\n    } else {\n      var result;\n      queue.forEach(function (fn) {\n        result = fn();\n      });\n      return result;\n    }\n  }\n\n  /**\n   * show cluster item\n   */\n  show() {\n    if (!this.displayed) {\n      this.redraw();\n    }\n  }\n\n  /**\n   * Hide the item from the DOM (when visible)\n   */\n  hide() {\n    if (this.displayed) {\n      var dom = this.dom;\n      if (dom.box.parentNode) {\n        dom.box.parentNode.removeChild(dom.box);\n      }\n\n      if (this.options.showStipes) {\n        if (dom.line.parentNode) {\n          dom.line.parentNode.removeChild(dom.line);\n        }\n        if (dom.dot.parentNode) {\n          dom.dot.parentNode.removeChild(dom.dot);\n        }\n      }\n      this.displayed = false;\n    }\n  }\n\n  /**\n   * reposition item x axis\n   */\n  repositionX() {\n    let start = this.conversion.toScreen(this.data.start);\n    let end = this.data.end ? this.conversion.toScreen(this.data.end) : 0;\n    if (end) {\n      this.repositionXWithRanges(start, end);\n    } else {\n      let align =\n        this.data.align === undefined ? this.options.align : this.data.align;\n      this.repositionXWithoutRanges(start, align);\n    }\n\n    if (this.options.showStipes) {\n      this.dom.line.style.display = this._isStipeVisible() ? \"block\" : \"none\";\n      this.dom.dot.style.display = this._isStipeVisible() ? \"block\" : \"none\";\n\n      if (this._isStipeVisible()) {\n        this.repositionStype(start, end);\n      }\n    }\n  }\n\n  /**\n   * reposition item stype\n   * @param {date} start\n   * @param {date} end\n   */\n  repositionStype(start, end) {\n    this.dom.line.style.display = \"block\";\n    this.dom.dot.style.display = \"block\";\n    const lineOffsetWidth = this.dom.line.offsetWidth;\n    const dotOffsetWidth = this.dom.dot.offsetWidth;\n\n    if (end) {\n      const lineOffset = lineOffsetWidth + start + (end - start) / 2;\n      const dotOffset = lineOffset - dotOffsetWidth / 2;\n      const lineOffsetDirection = this.options.rtl\n        ? lineOffset * -1\n        : lineOffset;\n      const dotOffsetDirection = this.options.rtl ? dotOffset * -1 : dotOffset;\n\n      this.dom.line.style.transform = `translateX(${lineOffsetDirection}px)`;\n      this.dom.dot.style.transform = `translateX(${dotOffsetDirection}px)`;\n    } else {\n      const lineOffsetDirection = this.options.rtl ? start * -1 : start;\n      const dotOffsetDirection = this.options.rtl\n        ? (start - dotOffsetWidth / 2) * -1\n        : start - dotOffsetWidth / 2;\n\n      this.dom.line.style.transform = `translateX(${lineOffsetDirection}px)`;\n      this.dom.dot.style.transform = `translateX(${dotOffsetDirection}px)`;\n    }\n  }\n\n  /**\n   * reposition x without ranges\n   * @param {date} start\n   * @param {string} align\n   */\n  repositionXWithoutRanges(start, align) {\n    // calculate left position of the box\n    if (align == \"right\") {\n      if (this.options.rtl) {\n        this.right = start - this.width;\n\n        // reposition box, line, and dot\n        this.dom.box.style.right = this.right + \"px\";\n      } else {\n        this.left = start - this.width;\n\n        // reposition box, line, and dot\n        this.dom.box.style.left = this.left + \"px\";\n      }\n    } else if (align == \"left\") {\n      if (this.options.rtl) {\n        this.right = start;\n\n        // reposition box, line, and dot\n        this.dom.box.style.right = this.right + \"px\";\n      } else {\n        this.left = start;\n\n        // reposition box, line, and dot\n        this.dom.box.style.left = this.left + \"px\";\n      }\n    } else {\n      // default or 'center'\n      if (this.options.rtl) {\n        this.right = start - this.width / 2;\n\n        // reposition box, line, and dot\n        this.dom.box.style.right = this.right + \"px\";\n      } else {\n        this.left = start - this.width / 2;\n\n        // reposition box, line, and dot\n        this.dom.box.style.left = this.left + \"px\";\n      }\n    }\n  }\n\n  /**\n   * reposition x with ranges\n   * @param {date} start\n   * @param {date} end\n   */\n  repositionXWithRanges(start, end) {\n    let boxWidth = Math.round(Math.max(end - start + 0.5, 1));\n\n    if (this.options.rtl) {\n      this.right = start;\n    } else {\n      this.left = start;\n    }\n\n    this.width = Math.max(boxWidth, this.minWidth || 0);\n\n    if (this.options.rtl) {\n      this.dom.box.style.right = this.right + \"px\";\n    } else {\n      this.dom.box.style.left = this.left + \"px\";\n    }\n\n    this.dom.box.style.width = boxWidth + \"px\";\n  }\n\n  /**\n   * reposition item y axis\n   */\n  repositionY() {\n    var orientation = this.options.orientation.item;\n    var box = this.dom.box;\n    if (orientation == \"top\") {\n      box.style.top = (this.top || 0) + \"px\";\n    } else {\n      // orientation 'bottom'\n      box.style.top = (this.parent.height - this.top - this.height || 0) + \"px\";\n    }\n\n    if (this.options.showStipes) {\n      if (orientation == \"top\") {\n        this.dom.line.style.top = \"0\";\n        this.dom.line.style.height = this.parent.top + this.top + 1 + \"px\";\n        this.dom.line.style.bottom = \"\";\n      } else {\n        // orientation 'bottom'\n        var itemSetHeight = this.parent.itemSet.props.height;\n        var lineHeight =\n          itemSetHeight - this.parent.top - this.parent.height + this.top;\n        this.dom.line.style.top = itemSetHeight - lineHeight + \"px\";\n        this.dom.line.style.bottom = \"0\";\n      }\n\n      this.dom.dot.style.top = -this.dom.dot.offsetHeight / 2 + \"px\";\n    }\n  }\n\n  /**\n   * get width left\n   * @return {number}\n   */\n  getWidthLeft() {\n    return this.width / 2;\n  }\n\n  /**\n   * get width right\n   * @return {number}\n   */\n  getWidthRight() {\n    return this.width / 2;\n  }\n\n  /**\n   * move cluster item\n   */\n  move() {\n    this.repositionX();\n    this.repositionY();\n  }\n\n  /**\n   * attach\n   */\n  attach() {\n    for (let item of this.data.uiItems) {\n      item.cluster = this;\n    }\n\n    this.data.items = this.data.uiItems.map((item) => item.data);\n\n    this.attached = true;\n    this.dirty = true;\n  }\n\n  /**\n   * detach\n   * @param {boolean} detachFromParent\n   * @return {void}\n   */\n  detach(detachFromParent = false) {\n    if (!this.hasItems()) {\n      return;\n    }\n\n    for (let item of this.data.uiItems) {\n      delete item.cluster;\n    }\n\n    this.attached = false;\n\n    if (detachFromParent && this.group) {\n      this.group.remove(this);\n      this.group = null;\n    }\n\n    this.data.items = [];\n    this.dirty = true;\n  }\n\n  /**\n   * handle on double click\n   */\n  _onDoubleClick() {\n    this._fit();\n  }\n\n  /**\n   * set range\n   */\n  _setupRange() {\n    const stats = this.data.uiItems.map((item) => ({\n      start: item.data.start.valueOf(),\n      end: item.data.end ? item.data.end.valueOf() : item.data.start.valueOf(),\n    }));\n\n    this.data.min = Math.min(\n      ...stats.map((s) => Math.min(s.start, s.end || s.start)),\n    );\n    this.data.max = Math.max(\n      ...stats.map((s) => Math.max(s.start, s.end || s.start)),\n    );\n    const centers = this.data.uiItems.map((item) => item.center);\n    const avg =\n      centers.reduce((sum, value) => sum + value, 0) / this.data.uiItems.length;\n\n    if (this.data.uiItems.some((item) => item.data.end)) {\n      // contains ranges\n      this.data.start = new Date(this.data.min);\n      this.data.end = new Date(this.data.max);\n    } else {\n      this.data.start = new Date(avg);\n      this.data.end = null;\n    }\n  }\n\n  /**\n   * get UI items\n   * @return {array}\n   */\n  _getUiItems() {\n    if (this.data.uiItems && this.data.uiItems.length) {\n      return this.data.uiItems.filter((item) => item.cluster === this);\n    }\n\n    return [];\n  }\n\n  /**\n   * create DOM element\n   */\n  _createDomElement() {\n    if (!this.dom) {\n      // create DOM\n      this.dom = {};\n\n      // create main box\n      this.dom.box = document.createElement(\"DIV\");\n\n      // contents box (inside the background box). used for making margins\n      this.dom.content = document.createElement(\"DIV\");\n      this.dom.content.className = \"vis-item-content\";\n\n      this.dom.box.appendChild(this.dom.content);\n\n      if (this.options.showStipes) {\n        // line to axis\n        this.dom.line = document.createElement(\"DIV\");\n        this.dom.line.className = \"vis-cluster-line\";\n        this.dom.line.style.display = \"none\";\n\n        // dot on axis\n        this.dom.dot = document.createElement(\"DIV\");\n        this.dom.dot.className = \"vis-cluster-dot\";\n        this.dom.dot.style.display = \"none\";\n      }\n\n      if (this.options.fitOnDoubleClick) {\n        this.dom.box.ondblclick =\n          ClusterItem.prototype._onDoubleClick.bind(this);\n      }\n\n      // attach this item as attribute\n      this.dom.box[\"vis-item\"] = this;\n\n      this.dirty = true;\n    }\n  }\n\n  /**\n   * append element to DOM\n   */\n  _appendDomElement() {\n    if (!this.parent) {\n      throw new Error(\"Cannot redraw item: no parent attached\");\n    }\n\n    if (!this.dom.box.parentNode) {\n      const foreground = this.parent.dom.foreground;\n      if (!foreground) {\n        throw new Error(\n          \"Cannot redraw item: parent has no foreground container element\",\n        );\n      }\n\n      foreground.appendChild(this.dom.box);\n    }\n\n    const background = this.parent.dom.background;\n\n    if (this.options.showStipes) {\n      if (!this.dom.line.parentNode) {\n        if (!background)\n          throw new Error(\n            \"Cannot redraw item: parent has no background container element\",\n          );\n        background.appendChild(this.dom.line);\n      }\n\n      if (!this.dom.dot.parentNode) {\n        var axis = this.parent.dom.axis;\n        if (!background)\n          throw new Error(\n            \"Cannot redraw item: parent has no axis container element\",\n          );\n        axis.appendChild(this.dom.dot);\n      }\n    }\n\n    this.displayed = true;\n  }\n\n  /**\n   * update dirty DOM components\n   */\n  _updateDirtyDomComponents() {\n    // An item is marked dirty when:\n    // - the item is not yet rendered\n    // - the item's data is changed\n    // - the item is selected/deselected\n    if (this.dirty) {\n      this._updateContents(this.dom.content);\n      this._updateDataAttributes(this.dom.box);\n      this._updateStyle(this.dom.box);\n\n      // update class\n      const className =\n        this.baseClassName +\n        \" \" +\n        (this.data.className ? \" \" + this.data.className : \"\") +\n        (this.selected ? \" vis-selected\" : \"\") +\n        \" vis-readonly\";\n      this.dom.box.className = \"vis-item \" + className;\n\n      if (this.options.showStipes) {\n        this.dom.line.className =\n          \"vis-item vis-cluster-line \" + (this.selected ? \" vis-selected\" : \"\");\n        this.dom.dot.className =\n          \"vis-item vis-cluster-dot \" + (this.selected ? \" vis-selected\" : \"\");\n      }\n\n      if (this.data.end) {\n        // turn off max-width to be able to calculate the real width\n        // this causes an extra browser repaint/reflow, but so be it\n        this.dom.content.style.maxWidth = \"none\";\n      }\n    }\n  }\n\n  /**\n   * get DOM components sizes\n   * @return {object}\n   */\n  _getDomComponentsSizes() {\n    const sizes = {\n      previous: {\n        right: this.dom.box.style.right,\n        left: this.dom.box.style.left,\n      },\n      box: {\n        width: this.dom.box.offsetWidth,\n        height: this.dom.box.offsetHeight,\n      },\n    };\n\n    if (this.options.showStipes) {\n      sizes.dot = {\n        height: this.dom.dot.offsetHeight,\n        width: this.dom.dot.offsetWidth,\n      };\n      sizes.line = {\n        width: this.dom.line.offsetWidth,\n      };\n    }\n\n    return sizes;\n  }\n\n  /**\n   * update DOM components sizes\n   * @param {object} sizes\n   */\n  _updateDomComponentsSizes(sizes) {\n    if (this.options.rtl) {\n      this.dom.box.style.right = \"0px\";\n    } else {\n      this.dom.box.style.left = \"0px\";\n    }\n\n    // recalculate size\n    if (!this.data.end) {\n      this.width = sizes.box.width;\n    } else {\n      this.minWidth = sizes.box.width;\n    }\n\n    this.height = sizes.box.height;\n\n    // restore previous position\n    if (this.options.rtl) {\n      this.dom.box.style.right = sizes.previous.right;\n    } else {\n      this.dom.box.style.left = sizes.previous.left;\n    }\n\n    this.dirty = false;\n  }\n\n  /**\n   * repaint DOM additional components\n   */\n  _repaintDomAdditionals() {\n    this._repaintOnItemUpdateTimeTooltip(this.dom.box);\n  }\n\n  /**\n   * check is stripe visible\n   * @return {number}\n   * @private\n   */\n  _isStipeVisible() {\n    return this.minWidth >= this.width || !this.data.end;\n  }\n\n  /**\n   * get fit range\n   * @return {object}\n   * @private\n   */\n  _getFitRange() {\n    const offset = (0.05 * (this.data.max - this.data.min)) / 2;\n    return {\n      fitStart: this.data.min - offset,\n      fitEnd: this.data.max + offset,\n    };\n  }\n\n  /**\n   * fit\n   * @private\n   */\n  _fit() {\n    if (this.emitter) {\n      const { fitStart, fitEnd } = this._getFitRange();\n\n      const fitArgs = {\n        start: new Date(fitStart),\n        end: new Date(fitEnd),\n        animation: true,\n      };\n\n      this.emitter.emit(\"fit\", fitArgs);\n    }\n  }\n\n  /**\n   * get item data\n   * @return {object}\n   * @private\n   */\n  _getItemData() {\n    return this.data;\n  }\n}\n\nClusterItem.prototype.baseClassName = \"vis-item vis-range vis-cluster\";\nexport default ClusterItem;\n","import ClusterItem from \"./item/ClusterItem.js\";\n\nconst UNGROUPED = \"__ungrouped__\"; // reserved group id for ungrouped items\nconst BACKGROUND = \"__background__\"; // reserved group id for background items without group\n\nexport const ReservedGroupIds = {\n  UNGROUPED,\n  BACKGROUND,\n};\n\n/**\n * An Cluster generator generates cluster items\n */\nexport default class ClusterGenerator {\n  /**\n   * @param {ItemSet} itemSet itemsSet instance\n   * @constructor ClusterGenerator\n   */\n  constructor(itemSet) {\n    this.itemSet = itemSet;\n    this.groups = {};\n    this.cache = {};\n    this.cache[-1] = [];\n  }\n\n  /**\n   * @param {Object} itemData             Object containing parameters start content, className.\n   * @param {{toScreen: function, toTime: function}} conversion\n   *                                  Conversion functions from time to screen and vice versa\n   * @param {Object} [options]        Configuration options\n   * @return {Object} newItem\n   */\n  createClusterItem(itemData, conversion, options) {\n    const newItem = new ClusterItem(itemData, conversion, options);\n    return newItem;\n  }\n\n  /**\n   * Set the items to be clustered.\n   * This will clear cached clusters.\n   * @param {Item[]} items\n   * @param {Object} [options]  Available options:\n   *                            {boolean} applyOnChangedLevel\n   *                                If true (default), the changed data is applied\n   *                                as soon the cluster level changes. If false,\n   *                                The changed data is applied immediately\n   */\n  setItems(items, options) {\n    this.items = items || [];\n    this.dataChanged = true;\n    this.applyOnChangedLevel = false;\n\n    if (options && options.applyOnChangedLevel) {\n      this.applyOnChangedLevel = options.applyOnChangedLevel;\n    }\n  }\n\n  /**\n   * Update the current data set: clear cache, and recalculate the clustering for\n   * the current level\n   */\n  updateData() {\n    this.dataChanged = true;\n    this.applyOnChangedLevel = false;\n  }\n\n  /**\n   * Cluster the items which are too close together\n   * @param {array} oldClusters\n   * @param {number} scale      The scale of the current window : (windowWidth / (endDate - startDate))\n   * @param {{maxItems: number, clusterCriteria: function, titleTemplate: string}} options\n   * @return {array} clusters\n   */\n  getClusters(oldClusters, scale, options) {\n    let { maxItems, clusterCriteria } =\n      typeof options === \"boolean\" ? {} : options;\n\n    if (!clusterCriteria) {\n      clusterCriteria = () => true;\n    }\n\n    maxItems = maxItems || 1;\n\n    let level = -1;\n    let granularity = 2;\n    let timeWindow = 0;\n\n    if (scale > 0) {\n      if (scale >= 1) {\n        return [];\n      }\n\n      level = Math.abs(\n        Math.round(Math.log(100 / scale) / Math.log(granularity)),\n      );\n      timeWindow = Math.abs(Math.pow(granularity, level));\n    }\n\n    // clear the cache when and re-generate groups the data when needed.\n    if (this.dataChanged) {\n      const levelChanged = level != this.cacheLevel;\n      const applyDataNow = this.applyOnChangedLevel ? levelChanged : true;\n      if (applyDataNow) {\n        this._dropLevelsCache();\n        this._filterData();\n      }\n    }\n\n    this.cacheLevel = level;\n    let clusters = this.cache[level];\n    if (!clusters) {\n      clusters = [];\n      for (let groupName in this.groups) {\n        if (!Object.prototype.hasOwnProperty.call(this.groups, groupName))\n          continue;\n\n        const items = this.groups[groupName];\n        const iMax = items.length;\n        let i = 0;\n\n        while (i < iMax) {\n          // find all items around current item, within the timeWindow\n          let item = items[i];\n          let neighbors = 1; // start at 1, to include itself)\n\n          // loop through items left from the current item\n          let j = i - 1;\n          while (j >= 0 && item.center - items[j].center < timeWindow / 2) {\n            if (\n              !items[j].cluster &&\n              clusterCriteria(item.data, items[j].data)\n            ) {\n              neighbors++;\n            }\n            j--;\n          }\n\n          // loop through items right from the current item\n          let k = i + 1;\n          while (\n            k < items.length &&\n            items[k].center - item.center < timeWindow / 2\n          ) {\n            if (clusterCriteria(item.data, items[k].data)) {\n              neighbors++;\n            }\n            k++;\n          }\n\n          // loop through the created clusters\n          let l = clusters.length - 1;\n          while (l >= 0 && item.center - clusters[l].center < timeWindow) {\n            if (\n              item.group == clusters[l].group &&\n              clusterCriteria(item.data, clusters[l].data)\n            ) {\n              neighbors++;\n            }\n            l--;\n          }\n\n          // aggregate until the number of items is within maxItems\n          if (neighbors > maxItems) {\n            // too busy in this window.\n            const num = neighbors - maxItems + 1;\n            const clusterItems = [];\n\n            // append the items to the cluster,\n            // and calculate the average start for the cluster\n            let m = i;\n            while (clusterItems.length < num && m < items.length) {\n              if (clusterCriteria(items[i].data, items[m].data)) {\n                clusterItems.push(items[m]);\n              }\n              m++;\n            }\n\n            const groupId = this.itemSet.getGroupId(item.data);\n            const group =\n              this.itemSet.groups[groupId] ||\n              this.itemSet.groups[ReservedGroupIds.UNGROUPED];\n            let cluster = this._getClusterForItems(\n              clusterItems,\n              group,\n              oldClusters,\n              options,\n            );\n            clusters.push(cluster);\n\n            i += num;\n          } else {\n            delete item.cluster;\n            i += 1;\n          }\n        }\n      }\n\n      this.cache[level] = clusters;\n    }\n\n    return clusters;\n  }\n\n  /**\n   * Filter the items per group.\n   * @private\n   */\n  _filterData() {\n    // filter per group\n    const groups = {};\n    this.groups = groups;\n\n    // split the items per group\n    for (const item of Object.values(this.items)) {\n      // put the item in the correct group\n      const groupName = item.parent ? item.parent.groupId : \"\";\n      let group = groups[groupName];\n      if (!group) {\n        group = [];\n        groups[groupName] = group;\n      }\n      group.push(item);\n\n      // calculate the center of the item\n      if (item.data.start) {\n        if (item.data.end) {\n          // range\n          item.center =\n            (item.data.start.valueOf() + item.data.end.valueOf()) / 2;\n        } else {\n          // box, dot\n          item.center = item.data.start.valueOf();\n        }\n      }\n    }\n\n    // sort the items per group\n    for (let currentGroupName in groups) {\n      if (!Object.prototype.hasOwnProperty.call(groups, currentGroupName))\n        continue;\n      groups[currentGroupName].sort((a, b) => a.center - b.center);\n    }\n\n    this.dataChanged = false;\n  }\n\n  /**\n   * Create new cluster or return existing\n   * @private\n   * @param {array} clusterItems\n   * @param {object} group\n   * @param {array} oldClusters\n   * @param {object} options\n   * @returns {object} cluster\n   */\n  _getClusterForItems(clusterItems, group, oldClusters, options) {\n    const oldClustersLookup = (oldClusters || []).map((cluster) => ({\n      cluster,\n      itemsIds: new Set(cluster.data.uiItems.map((item) => item.id)),\n    }));\n    let cluster;\n    if (oldClustersLookup.length) {\n      for (let oldClusterData of oldClustersLookup) {\n        if (\n          oldClusterData.itemsIds.size === clusterItems.length &&\n          clusterItems.every((clusterItem) =>\n            oldClusterData.itemsIds.has(clusterItem.id),\n          )\n        ) {\n          cluster = oldClusterData.cluster;\n          break;\n        }\n      }\n    }\n\n    if (cluster) {\n      cluster.setUiItems(clusterItems);\n      if (cluster.group !== group) {\n        if (cluster.group) {\n          cluster.group.remove(cluster);\n        }\n\n        if (group) {\n          group.add(cluster);\n          cluster.group = group;\n        }\n      }\n      return cluster;\n    }\n\n    let titleTemplate = options.titleTemplate || \"\";\n    const conversion = {\n      toScreen: this.itemSet.body.util.toScreen,\n      toTime: this.itemSet.body.util.toTime,\n    };\n\n    const title = titleTemplate.replace(/{count}/, clusterItems.length);\n    const clusterContent =\n      '<div title=\"' + title + '\">' + clusterItems.length + \"</div>\";\n    const clusterOptions = Object.assign({}, options, this.itemSet.options);\n    const data = {\n      content: clusterContent,\n      title: title,\n      group: group,\n      uiItems: clusterItems,\n      eventEmitter: this.itemSet.body.emitter,\n      range: this.itemSet.body.range,\n    };\n    cluster = this.createClusterItem(data, conversion, clusterOptions);\n\n    if (group) {\n      group.add(cluster);\n      cluster.group = group;\n    }\n\n    cluster.attach();\n\n    return cluster;\n  }\n\n  /**\n   * Drop cache\n   * @private\n   */\n  _dropLevelsCache() {\n    this.cache = {};\n    this.cacheLevel = -1;\n    this.cache[this.cacheLevel] = [];\n  }\n}\n","import Hammer from \"../../module/hammer.js\";\nimport util, {\n  typeCoerceDataSet,\n  randomUUID,\n  isDataViewLike,\n} from \"../../util.js\";\nimport TimeStep from \"../TimeStep.js\";\nimport Component from \"./Component.js\";\nimport Group from \"./Group.js\";\nimport BackgroundGroup from \"./BackgroundGroup.js\";\nimport BoxItem from \"./item/BoxItem.js\";\nimport PointItem from \"./item/PointItem.js\";\nimport RangeItem from \"./item/RangeItem.js\";\nimport BackgroundItem from \"./item/BackgroundItem.js\";\nimport Popup from \"../../shared/Popup.js\";\nimport ClusterGenerator from \"./ClusterGenerator.js\";\n\nconst UNGROUPED = \"__ungrouped__\"; // reserved group id for ungrouped items\nconst BACKGROUND = \"__background__\"; // reserved group id for background items without group\n\nexport const ReservedGroupIds = {\n  UNGROUPED,\n  BACKGROUND,\n};\n\n/**\n * An ItemSet holds a set of items and ranges which can be displayed in a\n * range. The width is determined by the parent of the ItemSet, and the height\n * is determined by the size of the items.\n */\nclass ItemSet extends Component {\n  /**\n   * @param {{dom: Object, domProps: Object, emitter: Emitter, range: Range}} body\n   * @param {Object} [options]      See ItemSet.setOptions for the available options.\n   * @constructor ItemSet\n   * @extends Component\n   */\n  constructor(body, options) {\n    super();\n    this.body = body;\n    this.defaultOptions = {\n      type: null, // 'box', 'point', 'range', 'background'\n      orientation: {\n        item: \"bottom\", // item orientation: 'top' or 'bottom'\n      },\n      align: \"auto\", // alignment of box items\n      stack: true,\n      stackSubgroups: true,\n      groupOrderSwap(fromGroup, toGroup) {\n        const targetOrder = toGroup.order;\n        toGroup.order = fromGroup.order;\n        fromGroup.order = targetOrder;\n      },\n      groupOrder: \"order\",\n\n      selectable: true,\n      multiselect: false,\n      longSelectPressTime: 251,\n      itemsAlwaysDraggable: {\n        item: false,\n        range: false,\n      },\n\n      editable: {\n        updateTime: false,\n        updateGroup: false,\n        add: false,\n        remove: false,\n        overrideItems: false,\n      },\n\n      groupEditable: {\n        order: false,\n        add: false,\n        remove: false,\n      },\n\n      snap: TimeStep.snap,\n\n      // Only called when `objectData.target === 'item'.\n      onDropObjectOnItem(_objectData, item, callback) {\n        callback(item);\n      },\n      onAdd(item, callback) {\n        callback(item);\n      },\n      onUpdate(item, callback) {\n        callback(item);\n      },\n      onMove(item, callback) {\n        callback(item);\n      },\n      onRemove(item, callback) {\n        callback(item);\n      },\n      onMoving(item, callback) {\n        callback(item);\n      },\n      onAddGroup(item, callback) {\n        callback(item);\n      },\n      onMoveGroup(item, callback) {\n        callback(item);\n      },\n      onRemoveGroup(item, callback) {\n        callback(item);\n      },\n\n      margin: {\n        item: {\n          horizontal: 10,\n          vertical: 10,\n        },\n        axis: 20,\n      },\n\n      showTooltips: true,\n\n      tooltip: {\n        followMouse: false,\n        overflowMethod: \"flip\",\n        delay: 500,\n      },\n\n      tooltipOnItemUpdateTime: false,\n    };\n\n    // options is shared by this ItemSet and all its items\n    this.options = util.extend({}, this.defaultOptions);\n    this.options.rtl = options.rtl;\n    this.options.onTimeout = options.onTimeout;\n\n    this.conversion = {\n      toScreen: body.util.toScreen,\n      toTime: body.util.toTime,\n    };\n    this.dom = {};\n    this.props = {};\n    this.hammer = null;\n\n    const me = this;\n    this.itemsData = null; // DataSet\n    this.groupsData = null; // DataSet\n    this.itemsSettingTime = null;\n    this.initialItemSetDrawn = false;\n    this.userContinueNotBail = null;\n\n    this.sequentialSelection = false;\n\n    // listeners for the DataSet of the items\n    this.itemListeners = {\n      add(_event, params) {\n        me._onAdd(params.items);\n        if (me.options.cluster) {\n          me.clusterGenerator.setItems(me.items, {\n            applyOnChangedLevel: false,\n          });\n        }\n        me.redraw();\n      },\n      update(_event, params) {\n        me._onUpdate(params.items);\n        if (me.options.cluster) {\n          me.clusterGenerator.setItems(me.items, {\n            applyOnChangedLevel: false,\n          });\n        }\n        me.redraw();\n      },\n      remove(_event, params) {\n        me._onRemove(params.items);\n        if (me.options.cluster) {\n          me.clusterGenerator.setItems(me.items, {\n            applyOnChangedLevel: false,\n          });\n        }\n        me.redraw();\n      },\n    };\n\n    // listeners for the DataSet of the groups\n    this.groupListeners = {\n      add(_event, params, senderId) {\n        me._onAddGroups(params.items);\n\n        if (me.groupsData && me.groupsData.length > 0) {\n          const groupsData = me.groupsData.getDataSet();\n          groupsData.get().forEach((groupData) => {\n            if (groupData.nestedGroups) {\n              if (groupData.showNested != false) {\n                groupData.showNested = true;\n              }\n              let updatedGroups = [];\n              groupData.nestedGroups.forEach((nestedGroupId) => {\n                const updatedNestedGroup = groupsData.get(nestedGroupId);\n                if (!updatedNestedGroup) {\n                  return;\n                }\n                updatedNestedGroup.nestedInGroup = groupData.id;\n                if (groupData.showNested == false) {\n                  updatedNestedGroup.visible = false;\n                }\n                updatedGroups = updatedGroups.concat(updatedNestedGroup);\n              });\n              groupsData.update(updatedGroups, senderId);\n            }\n          });\n        }\n      },\n      update(_event, params) {\n        me._onUpdateGroups(params.items);\n      },\n      remove(_event, params) {\n        me._onRemoveGroups(params.items);\n      },\n    };\n\n    this.items = {}; // object with an Item for every data item\n    this.groups = {}; // Group object for every group\n    this.groupIds = [];\n\n    this.selection = []; // list with the ids of all selected nodes\n\n    this.popup = null;\n    this.popupTimer = null;\n\n    this.touchParams = {}; // stores properties while dragging\n    this.groupTouchParams = {\n      group: null,\n      isDragging: false,\n    };\n\n    // create the HTML DOM\n    this._create();\n\n    this.setOptions(options);\n    this.clusters = [];\n  }\n\n  /**\n   * Create the HTML DOM for the ItemSet\n   */\n  _create() {\n    const frame = document.createElement(\"div\");\n    frame.className = \"vis-itemset\";\n    frame[\"vis-itemset\"] = this;\n    this.dom.frame = frame;\n\n    // create background panel\n    const background = document.createElement(\"div\");\n    background.className = \"vis-background\";\n    frame.appendChild(background);\n    this.dom.background = background;\n\n    // create foreground panel\n    const foreground = document.createElement(\"div\");\n    foreground.className = \"vis-foreground\";\n    frame.appendChild(foreground);\n    this.dom.foreground = foreground;\n\n    // create axis panel\n    const axis = document.createElement(\"div\");\n    axis.className = \"vis-axis\";\n    this.dom.axis = axis;\n\n    // create labelset\n    const labelSet = document.createElement(\"div\");\n    labelSet.className = \"vis-labelset\";\n    this.dom.labelSet = labelSet;\n\n    // create ungrouped Group\n    this._updateUngrouped();\n\n    // create background Group\n    const backgroundGroup = new BackgroundGroup(BACKGROUND, null, this);\n    backgroundGroup.show();\n    this.groups[BACKGROUND] = backgroundGroup;\n\n    // attach event listeners\n    // Note: we bind to the centerContainer for the case where the height\n    //       of the center container is larger than of the ItemSet, so we\n    //       can click in the empty area to create a new item or deselect an item.\n    this.hammer = new Hammer(this.body.dom.centerContainer);\n\n    // drag items when selected\n    this.hammer.on(\"hammer.input\", (event) => {\n      if (event.isFirst) {\n        this._onTouch(event);\n      }\n    });\n    this.hammer.on(\"panstart\", this._onDragStart.bind(this));\n    this.hammer.on(\"panmove\", this._onDrag.bind(this));\n    this.hammer.on(\"panend\", this._onDragEnd.bind(this));\n    this.hammer.get(\"pan\").set({ threshold: 5, direction: Hammer.ALL });\n    // delay addition on item click for trackpads...\n    this.hammer.get(\"press\").set({ time: 10000 });\n\n    // single select (or unselect) when tapping an item\n    this.hammer.on(\"tap\", this._onSelectItem.bind(this));\n\n    // multi select when holding mouse/touch, or on ctrl+click\n    this.hammer.on(\"press\", this._onMultiSelectItem.bind(this));\n    // delay addition on item click for trackpads...\n    this.hammer.get(\"press\").set({ time: 10000 });\n\n    // add item on doubletap\n    this.hammer.on(\"doubletap\", this._onAddItem.bind(this));\n\n    if (this.options.rtl) {\n      this.groupHammer = new Hammer(this.body.dom.rightContainer);\n    } else {\n      this.groupHammer = new Hammer(this.body.dom.leftContainer);\n    }\n\n    this.groupHammer.on(\"tap\", this._onGroupClick.bind(this));\n    this.groupHammer.on(\"panstart\", this._onGroupDragStart.bind(this));\n    this.groupHammer.on(\"panmove\", this._onGroupDrag.bind(this));\n    this.groupHammer.on(\"panend\", this._onGroupDragEnd.bind(this));\n    this.groupHammer\n      .get(\"pan\")\n      .set({ threshold: 5, direction: Hammer.DIRECTION_VERTICAL });\n\n    this.body.dom.centerContainer.addEventListener(\n      \"mouseover\",\n      this._onMouseOver.bind(this),\n    );\n    this.body.dom.centerContainer.addEventListener(\n      \"mouseout\",\n      this._onMouseOut.bind(this),\n    );\n    this.body.dom.centerContainer.addEventListener(\n      \"mousemove\",\n      this._onMouseMove.bind(this),\n    );\n    // right-click on timeline\n    this.body.dom.centerContainer.addEventListener(\n      \"contextmenu\",\n      this._onDragEnd.bind(this),\n    );\n\n    this.body.dom.centerContainer.addEventListener(\n      \"mousewheel\",\n      this._onMouseWheel.bind(this),\n    );\n\n    // attach to the DOM\n    this.show();\n  }\n\n  /**\n   * Set options for the ItemSet. Existing options will be extended/overwritten.\n   * @param {Object} [options] The following options are available:\n   *                           {string} type\n   *                              Default type for the items. Choose from 'box'\n   *                              (default), 'point', 'range', or 'background'.\n   *                              The default style can be overwritten by\n   *                              individual items.\n   *                           {string} align\n   *                              Alignment for the items, only applicable for\n   *                              BoxItem. Choose 'center' (default), 'left', or\n   *                              'right'.\n   *                           {string} orientation.item\n   *                              Orientation of the item set. Choose 'top' or\n   *                              'bottom' (default).\n   *                           {Function} groupOrder\n   *                              A sorting function for ordering groups\n   *                           {boolean} stack\n   *                              If true (default), items will be stacked on\n   *                              top of each other.\n   *                           {number} margin.axis\n   *                              Margin between the axis and the items in pixels.\n   *                              Default is 20.\n   *                           {number} margin.item.horizontal\n   *                              Horizontal margin between items in pixels.\n   *                              Default is 10.\n   *                           {number} margin.item.vertical\n   *                              Vertical Margin between items in pixels.\n   *                              Default is 10.\n   *                           {number} margin.item\n   *                              Margin between items in pixels in both horizontal\n   *                              and vertical direction. Default is 10.\n   *                           {number} margin\n   *                              Set margin for both axis and items in pixels.\n   *                           {boolean} selectable\n   *                              If true (default), items can be selected.\n   *                           {boolean} multiselect\n   *                              If true, multiple items can be selected.\n   *                              False by default.\n   *                           {boolean} editable\n   *                              Set all editable options to true or false\n   *                           {boolean} editable.updateTime\n   *                              Allow dragging an item to an other moment in time\n   *                           {boolean} editable.updateGroup\n   *                              Allow dragging an item to an other group\n   *                           {boolean} editable.add\n   *                              Allow creating new items on double tap\n   *                           {boolean} editable.remove\n   *                              Allow removing items by clicking the delete button\n   *                              top right of a selected item.\n   *                           {Function(item: Item, callback: Function)} onAdd\n   *                              Callback function triggered when an item is about to be added:\n   *                              when the user double taps an empty space in the Timeline.\n   *                           {Function(item: Item, callback: Function)} onUpdate\n   *                              Callback function fired when an item is about to be updated.\n   *                              This function typically has to show a dialog where the user\n   *                              change the item. If not implemented, nothing happens.\n   *                           {Function(item: Item, callback: Function)} onMove\n   *                              Fired when an item has been moved. If not implemented,\n   *                              the move action will be accepted.\n   *                           {Function(item: Item, callback: Function)} onRemove\n   *                              Fired when an item is about to be deleted.\n   *                              If not implemented, the item will be always removed.\n   */\n  setOptions(options) {\n    if (options) {\n      // copy all options that we know\n      const fields = [\n        \"type\",\n        \"rtl\",\n        \"align\",\n        \"order\",\n        \"stack\",\n        \"stackSubgroups\",\n        \"selectable\",\n        \"multiselect\",\n        \"sequentialSelection\",\n        \"multiselectPerGroup\",\n        \"longSelectPressTime\",\n        \"groupOrder\",\n        \"dataAttributes\",\n        \"template\",\n        \"groupTemplate\",\n        \"visibleFrameTemplate\",\n        \"hide\",\n        \"snap\",\n        \"groupOrderSwap\",\n        \"showTooltips\",\n        \"tooltip\",\n        \"tooltipOnItemUpdateTime\",\n        \"groupHeightMode\",\n        \"onTimeout\",\n      ];\n      util.selectiveExtend(fields, this.options, options);\n\n      if (\"itemsAlwaysDraggable\" in options) {\n        if (typeof options.itemsAlwaysDraggable === \"boolean\") {\n          this.options.itemsAlwaysDraggable.item = options.itemsAlwaysDraggable;\n          this.options.itemsAlwaysDraggable.range = false;\n        } else if (typeof options.itemsAlwaysDraggable === \"object\") {\n          util.selectiveExtend(\n            [\"item\", \"range\"],\n            this.options.itemsAlwaysDraggable,\n            options.itemsAlwaysDraggable,\n          );\n          // only allow range always draggable when item is always draggable as well\n          if (!this.options.itemsAlwaysDraggable.item) {\n            this.options.itemsAlwaysDraggable.range = false;\n          }\n        }\n      }\n\n      if (\"sequentialSelection\" in options) {\n        if (typeof options.sequentialSelection === \"boolean\") {\n          this.options.sequentialSelection = options.sequentialSelection;\n        }\n      }\n\n      if (\"orientation\" in options) {\n        if (typeof options.orientation === \"string\") {\n          this.options.orientation.item =\n            options.orientation === \"top\" ? \"top\" : \"bottom\";\n        } else if (\n          typeof options.orientation === \"object\" &&\n          \"item\" in options.orientation\n        ) {\n          this.options.orientation.item = options.orientation.item;\n        }\n      }\n\n      if (\"margin\" in options) {\n        if (typeof options.margin === \"number\") {\n          this.options.margin.axis = options.margin;\n          this.options.margin.item.horizontal = options.margin;\n          this.options.margin.item.vertical = options.margin;\n        } else if (typeof options.margin === \"object\") {\n          util.selectiveExtend([\"axis\"], this.options.margin, options.margin);\n          if (\"item\" in options.margin) {\n            if (typeof options.margin.item === \"number\") {\n              this.options.margin.item.horizontal = options.margin.item;\n              this.options.margin.item.vertical = options.margin.item;\n            } else if (typeof options.margin.item === \"object\") {\n              util.selectiveExtend(\n                [\"horizontal\", \"vertical\"],\n                this.options.margin.item,\n                options.margin.item,\n              );\n            }\n          }\n        }\n      }\n\n      [\"locale\", \"locales\"].forEach((key) => {\n        if (key in options) {\n          this.options[key] = options[key];\n        }\n      });\n\n      if (\"editable\" in options) {\n        if (typeof options.editable === \"boolean\") {\n          this.options.editable.updateTime = options.editable;\n          this.options.editable.updateGroup = options.editable;\n          this.options.editable.add = options.editable;\n          this.options.editable.remove = options.editable;\n          this.options.editable.overrideItems = false;\n        } else if (typeof options.editable === \"object\") {\n          util.selectiveExtend(\n            [\"updateTime\", \"updateGroup\", \"add\", \"remove\", \"overrideItems\"],\n            this.options.editable,\n            options.editable,\n          );\n        }\n      }\n\n      if (\"groupEditable\" in options) {\n        if (typeof options.groupEditable === \"boolean\") {\n          this.options.groupEditable.order = options.groupEditable;\n          this.options.groupEditable.add = options.groupEditable;\n          this.options.groupEditable.remove = options.groupEditable;\n        } else if (typeof options.groupEditable === \"object\") {\n          util.selectiveExtend(\n            [\"order\", \"add\", \"remove\"],\n            this.options.groupEditable,\n            options.groupEditable,\n          );\n        }\n      }\n\n      // callback functions\n      const addCallback = (name) => {\n        const fn = options[name];\n        if (fn) {\n          if (!(typeof fn === \"function\")) {\n            throw new Error(\n              `option ${name} must be a function ${name}(item, callback)`,\n            );\n          }\n          this.options[name] = fn;\n        }\n      };\n      [\n        \"onDropObjectOnItem\",\n        \"onAdd\",\n        \"onUpdate\",\n        \"onRemove\",\n        \"onMove\",\n        \"onMoving\",\n        \"onAddGroup\",\n        \"onMoveGroup\",\n        \"onRemoveGroup\",\n      ].forEach(addCallback);\n\n      if (options.cluster) {\n        Object.assign(this.options, {\n          cluster: options.cluster,\n        });\n        if (!this.clusterGenerator) {\n          this.clusterGenerator = new ClusterGenerator(this);\n        }\n        this.clusterGenerator.setItems(this.items, {\n          applyOnChangedLevel: false,\n        });\n        this.markDirty({ refreshItems: true, restackGroups: true });\n\n        this.redraw();\n      } else if (this.clusterGenerator) {\n        this._detachAllClusters();\n        this.clusters = [];\n        this.clusterGenerator = null;\n        this.options.cluster = undefined;\n        this.markDirty({ refreshItems: true, restackGroups: true });\n\n        this.redraw();\n      } else {\n        // force the itemSet to refresh: options like orientation and margins may be changed\n        this.markDirty();\n      }\n    }\n  }\n\n  /**\n   * Mark the ItemSet dirty so it will refresh everything with next redraw.\n   * Optionally, all items can be marked as dirty and be refreshed.\n   * @param {{refreshItems: boolean}} [options]\n   */\n  markDirty(options) {\n    this.groupIds = [];\n\n    if (options) {\n      if (options.refreshItems) {\n        util.forEach(this.items, (item) => {\n          item.dirty = true;\n          if (item.displayed) item.redraw();\n        });\n      }\n\n      if (options.restackGroups) {\n        util.forEach(this.groups, (group, key) => {\n          if (key === BACKGROUND) return;\n          group.stackDirty = true;\n        });\n      }\n    }\n  }\n\n  /**\n   * Destroy the ItemSet\n   */\n  destroy() {\n    this.clearPopupTimer();\n    this.hide();\n    this.setItems(null);\n    this.setGroups(null);\n\n    this.hammer && this.hammer.destroy();\n    this.groupHammer && this.groupHammer.destroy();\n    this.hammer = null;\n\n    this.body = null;\n    this.conversion = null;\n  }\n\n  /**\n   * Hide the component from the DOM\n   */\n  hide() {\n    // remove the frame containing the items\n    if (this.dom.frame.parentNode) {\n      this.dom.frame.parentNode.removeChild(this.dom.frame);\n    }\n\n    // remove the axis with dots\n    if (this.dom.axis.parentNode) {\n      this.dom.axis.parentNode.removeChild(this.dom.axis);\n    }\n\n    // remove the labelset containing all group labels\n    if (this.dom.labelSet.parentNode) {\n      this.dom.labelSet.parentNode.removeChild(this.dom.labelSet);\n    }\n  }\n\n  /**\n   * Show the component in the DOM (when not already visible).\n   */\n  show() {\n    // show frame containing the items\n    if (!this.dom.frame.parentNode) {\n      this.body.dom.center.appendChild(this.dom.frame);\n    }\n\n    // show axis with dots\n    if (!this.dom.axis.parentNode) {\n      this.body.dom.backgroundVertical.appendChild(this.dom.axis);\n    }\n\n    // show labelset containing labels\n    if (!this.dom.labelSet.parentNode) {\n      if (this.options.rtl) {\n        this.body.dom.right.appendChild(this.dom.labelSet);\n      } else {\n        this.body.dom.left.appendChild(this.dom.labelSet);\n      }\n    }\n  }\n\n  /**\n   * Activates the popup timer to show the given popup after a fixed time.\n   * @param {Popup} popup\n   */\n  setPopupTimer(popup) {\n    this.clearPopupTimer();\n    if (popup) {\n      const delay =\n        this.options.tooltip.delay ||\n        typeof this.options.tooltip.delay === \"number\"\n          ? this.options.tooltip.delay\n          : 500;\n      this.popupTimer = setTimeout(function () {\n        popup.show();\n      }, delay);\n    }\n  }\n\n  /**\n   * Clears the popup timer for the tooltip.\n   */\n  clearPopupTimer() {\n    if (this.popupTimer != null) {\n      clearTimeout(this.popupTimer);\n      this.popupTimer = null;\n    }\n  }\n\n  /**\n   * Set selected items by their id. Replaces the current selection\n   * Unknown id's are silently ignored.\n   * @param {string[] | string} [ids] An array with zero or more id's of the items to be\n   *                                  selected, or a single item id. If ids is undefined\n   *                                  or an empty array, all items will be unselected.\n   */\n  setSelection(ids) {\n    if (ids == undefined) {\n      ids = [];\n    }\n\n    if (!Array.isArray(ids)) {\n      ids = [ids];\n    }\n\n    const idsToDeselect = this.selection.filter((id) => ids.indexOf(id) === -1);\n\n    // unselect currently selected items\n    for (let selectedId of idsToDeselect) {\n      const item = this.getItemById(selectedId);\n      if (item) {\n        item.unselect();\n      }\n    }\n\n    // select items\n    this.selection = [...ids];\n    for (let id of ids) {\n      const item = this.getItemById(id);\n      if (item) {\n        item.select();\n      }\n    }\n  }\n\n  /**\n   * Get the selected items by their id\n   * @return {Array} ids  The ids of the selected items\n   */\n  getSelection() {\n    return this.selection.concat([]);\n  }\n\n  /**\n   * Get the id's of the currently visible items.\n   * @returns {Array} The ids of the visible items\n   */\n  getVisibleItems() {\n    const range = this.body.range.getRange();\n    let right;\n    let left;\n\n    if (this.options.rtl) {\n      right = this.body.util.toScreen(range.start);\n      left = this.body.util.toScreen(range.end);\n    } else {\n      left = this.body.util.toScreen(range.start);\n      right = this.body.util.toScreen(range.end);\n    }\n\n    const ids = [];\n    for (const groupId in this.groups) {\n      if (!Object.prototype.hasOwnProperty.call(this.groups, groupId)) continue;\n\n      const group = this.groups[groupId];\n      const rawVisibleItems = group.isVisible ? group.visibleItems : [];\n\n      // filter the \"raw\" set with visibleItems into a set which is really\n      // visible by pixels\n      for (const item of rawVisibleItems) {\n        // TODO: also check whether visible vertically\n        if (this.options.rtl) {\n          if (item.right < left && item.right + item.width > right) {\n            ids.push(item.id);\n          }\n        } else {\n          if (item.left < right && item.left + item.width > left) {\n            ids.push(item.id);\n          }\n        }\n      }\n    }\n\n    return ids;\n  }\n\n  /**\n   * Get the id's of the items at specific time, where a click takes place on the timeline.\n   * @param {Date} timeOfEvent The point in time to query items.\n   * @returns {Array} The ids of all items in existence at the time of click event on the timeline.\n   */\n  getItemsAtCurrentTime(timeOfEvent) {\n    let right;\n    let left;\n\n    if (this.options.rtl) {\n      right = this.body.util.toScreen(timeOfEvent);\n      left = this.body.util.toScreen(timeOfEvent);\n    } else {\n      left = this.body.util.toScreen(timeOfEvent);\n      right = this.body.util.toScreen(timeOfEvent);\n    }\n\n    const ids = [];\n    for (const groupId in this.groups) {\n      if (!Object.prototype.hasOwnProperty.call(this.groups, groupId)) continue;\n\n      const group = this.groups[groupId];\n      const rawVisibleItems = group.isVisible ? group.visibleItems : [];\n\n      // filter the \"raw\" set with visibleItems into a set which is really\n      // visible by pixels\n      for (const item of rawVisibleItems) {\n        if (this.options.rtl) {\n          if (item.right < left && item.right + item.width > right) {\n            ids.push(item.id);\n          }\n        } else {\n          if (item.left < right && item.left + item.width > left) {\n            ids.push(item.id);\n          }\n        }\n      }\n    }\n\n    return ids;\n  }\n\n  /**\n   * Get the id's of the currently visible groups.\n   * @returns {Array} The ids of the visible groups\n   */\n  getVisibleGroups() {\n    const ids = [];\n\n    for (const groupId in this.groups) {\n      if (!Object.prototype.hasOwnProperty.call(this.groups, groupId)) continue;\n\n      const group = this.groups[groupId];\n      if (group.isVisible) ids.push(groupId);\n    }\n\n    return ids;\n  }\n\n  /**\n   * get item by id\n   * @param {string} id\n   * @return {object} item\n   */\n  getItemById(id) {\n    return this.items[id] || this.clusters.find((cluster) => cluster.id === id);\n  }\n\n  /**\n   * Deselect a selected item\n   * @param {string | number} id\n   * @private\n   */\n  _deselect(id) {\n    const selection = this.selection;\n    for (let i = 0, ii = selection.length; i < ii; i++) {\n      if (selection[i] == id) {\n        // non-strict comparison!\n        selection.splice(i, 1);\n        break;\n      }\n    }\n  }\n\n  /**\n   * Repaint the component\n   * @return {boolean} Returns true if the component is resized\n   */\n  redraw() {\n    const margin = this.options.margin;\n    const range = this.body.range;\n    const asSize = util.option.asSize;\n    const options = this.options;\n    const orientation = options.orientation.item;\n    let resized = false;\n    const frame = this.dom.frame;\n\n    // recalculate absolute position (before redrawing groups)\n    this.props.top =\n      this.body.domProps.top.height + this.body.domProps.border.top;\n\n    if (this.options.rtl) {\n      this.props.right =\n        this.body.domProps.right.width + this.body.domProps.border.right;\n    } else {\n      this.props.left =\n        this.body.domProps.left.width + this.body.domProps.border.left;\n    }\n\n    // update class name\n    frame.className = \"vis-itemset\";\n\n    if (this.options.cluster) {\n      this._clusterItems();\n    }\n\n    // reorder the groups (if needed)\n    resized = this._orderGroups() || resized;\n\n    // check whether zoomed (in that case we need to re-stack everything)\n    // TODO: would be nicer to get this as a trigger from Range\n    const visibleInterval = range.end - range.start;\n    const zoomed =\n      visibleInterval != this.lastVisibleInterval ||\n      this.props.width != this.props.lastWidth;\n    const scrolled = range.start != this.lastRangeStart;\n    const changedStackOption = options.stack != this.lastStack;\n    const changedStackSubgroupsOption =\n      options.stackSubgroups != this.lastStackSubgroups;\n    const forceRestack =\n      zoomed || scrolled || changedStackOption || changedStackSubgroupsOption;\n    this.lastVisibleInterval = visibleInterval;\n    this.lastRangeStart = range.start;\n    this.lastStack = options.stack;\n    this.lastStackSubgroups = options.stackSubgroups;\n\n    this.props.lastWidth = this.props.width;\n    const firstGroup = this._firstGroup();\n    const firstMargin = {\n      item: margin.item,\n      axis: margin.axis,\n    };\n    const nonFirstMargin = {\n      item: margin.item,\n      axis: margin.item.vertical / 2,\n    };\n    let height = 0;\n    const minHeight = margin.axis + margin.item.vertical;\n\n    // redraw the background group\n    this.groups[BACKGROUND].redraw(range, nonFirstMargin, forceRestack);\n\n    const redrawQueue = {};\n    let redrawQueueLength = 0;\n\n    // collect redraw functions\n    util.forEach(this.groups, (group, key) => {\n      if (key === BACKGROUND) return;\n      const groupMargin = group == firstGroup ? firstMargin : nonFirstMargin;\n      const returnQueue = true;\n      redrawQueue[key] = group.redraw(\n        range,\n        groupMargin,\n        forceRestack,\n        returnQueue,\n      );\n      redrawQueueLength = redrawQueue[key].length;\n    });\n\n    const needRedraw = redrawQueueLength > 0;\n    if (needRedraw) {\n      const redrawResults = {};\n\n      for (let i = 0; i < redrawQueueLength; i++) {\n        util.forEach(redrawQueue, (fns, key) => {\n          redrawResults[key] = fns[i]();\n        });\n      }\n\n      // redraw all regular groups\n      util.forEach(this.groups, (group, key) => {\n        if (key === BACKGROUND) return;\n        const groupResized = redrawResults[key];\n        resized = groupResized || resized;\n        height += group.height;\n      });\n      height = Math.max(height, minHeight);\n    }\n\n    height = Math.max(height, minHeight);\n\n    // update frame height\n    frame.style.height = asSize(height);\n\n    // calculate actual size\n    this.props.width = frame.offsetWidth;\n    this.props.height = height;\n\n    // reposition axis\n    this.dom.axis.style.top = asSize(\n      orientation == \"top\"\n        ? this.body.domProps.top.height + this.body.domProps.border.top\n        : this.body.domProps.top.height +\n            this.body.domProps.centerContainer.height,\n    );\n    if (this.options.rtl) {\n      this.dom.axis.style.right = \"0\";\n    } else {\n      this.dom.axis.style.left = \"0\";\n    }\n\n    this.hammer.get(\"press\").set({ time: this.options.longSelectPressTime });\n\n    this.initialItemSetDrawn = true;\n    // check if this component is resized\n    resized = this._isResized() || resized;\n\n    return resized;\n  }\n\n  /**\n   * Get the first group, aligned with the axis\n   * @return {Group | null} firstGroup\n   * @private\n   */\n  _firstGroup() {\n    const firstGroupIndex =\n      this.options.orientation.item == \"top\" ? 0 : this.groupIds.length - 1;\n    const firstGroupId = this.groupIds[firstGroupIndex];\n    const firstGroup = this.groups[firstGroupId] || this.groups[UNGROUPED];\n\n    return firstGroup || null;\n  }\n\n  /**\n   * Create or delete the group holding all ungrouped items. This group is used when\n   * there are no groups specified.\n   * @protected\n   */\n  _updateUngrouped() {\n    let ungrouped = this.groups[UNGROUPED];\n    let item;\n    let itemId;\n\n    if (this.groupsData) {\n      // remove the group holding all ungrouped items\n      if (ungrouped) {\n        ungrouped.dispose();\n        delete this.groups[UNGROUPED];\n\n        for (itemId in this.items) {\n          if (!Object.prototype.hasOwnProperty.call(this.items, itemId))\n            continue;\n          item = this.items[itemId];\n          item.parent && item.parent.remove(item);\n          const groupId = this.getGroupId(item.data);\n          const group = this.groups[groupId];\n          (group && group.add(item)) || item.hide();\n        }\n      }\n    } else {\n      // create a group holding all (unfiltered) items\n      if (!ungrouped) {\n        const id = null;\n        const data = null;\n        ungrouped = new Group(id, data, this);\n        this.groups[UNGROUPED] = ungrouped;\n\n        for (itemId in this.items) {\n          if (!Object.prototype.hasOwnProperty.call(this.items, itemId))\n            continue;\n          item = this.items[itemId];\n          ungrouped.add(item);\n        }\n\n        ungrouped.show();\n      }\n    }\n  }\n\n  /**\n   * Get the element for the labelset\n   * @return {HTMLElement} labelSet\n   */\n  getLabelSet() {\n    return this.dom.labelSet;\n  }\n\n  /**\n   * Set items\n   * @param {vis.DataSet | null} items\n   */\n  setItems(items) {\n    this.itemsSettingTime = new Date();\n    const me = this;\n    let ids;\n    const oldItemsData = this.itemsData;\n\n    // replace the dataset\n    if (!items) {\n      this.itemsData = null;\n    } else if (isDataViewLike(items)) {\n      this.itemsData = typeCoerceDataSet(items);\n    } else {\n      throw new TypeError(\n        \"Data must implement the interface of DataSet or DataView\",\n      );\n    }\n\n    if (oldItemsData) {\n      // unsubscribe from old dataset\n      util.forEach(this.itemListeners, (callback, event) => {\n        oldItemsData.off(event, callback);\n      });\n\n      // stop maintaining a coerced version of the old data set\n      oldItemsData.dispose();\n\n      // remove all drawn items\n      ids = oldItemsData.getIds();\n      this._onRemove(ids);\n    }\n\n    if (this.itemsData) {\n      // subscribe to new dataset\n      const id = this.id;\n      util.forEach(this.itemListeners, (callback, event) => {\n        me.itemsData.on(event, callback, id);\n      });\n\n      // add all new items\n      ids = this.itemsData.getIds();\n      this._onAdd(ids);\n\n      // update the group holding all ungrouped items\n      this._updateUngrouped();\n    }\n\n    this.body.emitter.emit(\"_change\", { queue: true });\n  }\n\n  /**\n   * Get the current items\n   * @returns {vis.DataSet | null}\n   */\n  getItems() {\n    return this.itemsData != null ? this.itemsData.rawDS : null;\n  }\n\n  /**\n   * Set groups\n   * @param {vis.DataSet} groups\n   */\n  setGroups(groups) {\n    const me = this;\n    let ids;\n\n    // unsubscribe from current dataset\n    if (this.groupsData) {\n      util.forEach(this.groupListeners, (callback, event) => {\n        me.groupsData.off(event, callback);\n      });\n\n      // remove all drawn groups\n      ids = this.groupsData.getIds();\n      this.groupsData = null;\n      this._onRemoveGroups(ids); // note: this will cause a redraw\n    }\n\n    // replace the dataset\n    if (!groups) {\n      this.groupsData = null;\n    } else if (isDataViewLike(groups)) {\n      this.groupsData = groups;\n    } else {\n      throw new TypeError(\n        \"Data must implement the interface of DataSet or DataView\",\n      );\n    }\n\n    if (this.groupsData) {\n      // go over all groups nesting\n      const groupsData = this.groupsData.getDataSet();\n\n      groupsData.get().forEach((group) => {\n        if (group.nestedGroups) {\n          group.nestedGroups.forEach((nestedGroupId) => {\n            const updatedNestedGroup = groupsData.get(nestedGroupId);\n            updatedNestedGroup.nestedInGroup = group.id;\n            if (group.showNested == false) {\n              updatedNestedGroup.visible = false;\n            }\n            groupsData.update(updatedNestedGroup);\n          });\n        }\n      });\n\n      // subscribe to new dataset\n      const id = this.id;\n      util.forEach(this.groupListeners, (callback, event) => {\n        me.groupsData.on(event, callback, id);\n      });\n\n      // draw all ms\n      ids = this.groupsData.getIds();\n      this._onAddGroups(ids);\n    }\n\n    // update the group holding all ungrouped items\n    this._updateUngrouped();\n\n    // update the order of all items in each group\n    this._order();\n\n    if (this.options.cluster) {\n      this.clusterGenerator.updateData();\n      this._clusterItems();\n      this.markDirty({ refreshItems: true, restackGroups: true });\n    }\n\n    this.body.emitter.emit(\"_change\", { queue: true });\n  }\n\n  /**\n   * Get the current groups\n   * @returns {vis.DataSet | null} groups\n   */\n  getGroups() {\n    return this.groupsData;\n  }\n\n  /**\n   * Remove an item by its id\n   * @param {string | number} id\n   */\n  removeItem(id) {\n    const item = this.itemsData.get(id);\n\n    if (item) {\n      // confirm deletion\n      this.options.onRemove(item, (item) => {\n        if (item) {\n          // remove by id here, it is possible that an item has no id defined\n          // itself, so better not delete by the item itself\n          this.itemsData.remove(id);\n        }\n      });\n    }\n  }\n\n  /**\n   * Get the time of an item based on it's data and options.type\n   * @param {Object} itemData\n   * @returns {string} Returns the type\n   * @private\n   */\n  _getType(itemData) {\n    return (\n      itemData.type || this.options.type || (itemData.end ? \"range\" : \"box\")\n    );\n  }\n\n  /**\n   * Get the group id for an item\n   * @param {Object} itemData\n   * @returns {string} Returns the groupId\n   * @private\n   */\n  getGroupId(itemData) {\n    const type = this._getType(itemData);\n    if (type == \"background\" && itemData.group == undefined) {\n      return BACKGROUND;\n    } else {\n      return this.groupsData ? itemData.group : UNGROUPED;\n    }\n  }\n\n  /**\n   * Handle updated items\n   * @param {number[]} ids\n   * @protected\n   */\n  _onUpdate(ids) {\n    const me = this;\n\n    ids.forEach((id) => {\n      const itemData = me.itemsData.get(id);\n      let item = me.items[id];\n      const type = itemData ? me._getType(itemData) : null;\n\n      const constructor = ItemSet.types[type];\n      let selected;\n\n      if (item) {\n        // update item\n        if (!constructor || !(item instanceof constructor)) {\n          // item type has changed, delete the item and recreate it\n          selected = item.selected; // preserve selection of this item\n          me._removeItem(item);\n          item = null;\n        } else {\n          me._updateItem(item, itemData);\n        }\n      }\n\n      if (!item && itemData) {\n        // create item\n        if (constructor) {\n          item = new constructor(itemData, me.conversion, me.options);\n          item.id = id; // TODO: not so nice setting id afterwards\n\n          me._addItem(item);\n          if (selected) {\n            this.selection.push(id);\n            item.select();\n          }\n        } else {\n          throw new TypeError(`Unknown item type \"${type}\"`);\n        }\n      }\n    });\n\n    this._order();\n\n    if (this.options.cluster) {\n      this.clusterGenerator.setItems(this.items, {\n        applyOnChangedLevel: false,\n      });\n      this._clusterItems();\n    }\n\n    this.body.emitter.emit(\"_change\", { queue: true });\n  }\n\n  /**\n   * Handle removed items\n   * @param {number[]} ids\n   * @protected\n   */\n  _onRemove(ids) {\n    let count = 0;\n    const me = this;\n    ids.forEach((id) => {\n      const item = me.items[id];\n      if (item) {\n        count++;\n        me._removeItem(item);\n      }\n    });\n\n    if (count) {\n      // update order\n      this._order();\n      this.body.emitter.emit(\"_change\", { queue: true });\n    }\n  }\n\n  /**\n   * Update the order of item in all groups\n   * @private\n   */\n  _order() {\n    // reorder the items in all groups\n    // TODO: optimization: only reorder groups affected by the changed items\n    util.forEach(this.groups, (group) => {\n      group.order();\n    });\n  }\n\n  /**\n   * Handle updated groups\n   * @param {number[]} ids\n   * @private\n   */\n  _onUpdateGroups(ids) {\n    this._onAddGroups(ids);\n  }\n\n  /**\n   * Handle changed groups (added or updated)\n   * @param {number[]} ids\n   * @private\n   */\n  _onAddGroups(ids) {\n    const me = this;\n\n    ids.forEach((id) => {\n      const groupData = me.groupsData.get(id);\n      let group = me.groups[id];\n\n      if (!group) {\n        // check for reserved ids\n        if (id == UNGROUPED || id == BACKGROUND) {\n          throw new Error(`Illegal group id. ${id} is a reserved id.`);\n        }\n\n        const groupOptions = Object.create(me.options);\n        util.extend(groupOptions, {\n          height: null,\n        });\n\n        group = new Group(id, groupData, me);\n        me.groups[id] = group;\n\n        // add items with this groupId to the new group\n        for (const itemId in me.items) {\n          if (!Object.prototype.hasOwnProperty.call(me.items, itemId)) continue;\n\n          const item = me.items[itemId];\n          if (item.data.group == id) group.add(item);\n        }\n\n        group.order();\n        group.show();\n      } else {\n        // update group\n        group.setData(groupData);\n      }\n    });\n\n    this.body.emitter.emit(\"_change\", { queue: true });\n  }\n\n  /**\n   * Handle removed groups\n   * @param {number[]} ids\n   * @private\n   */\n  _onRemoveGroups(ids) {\n    ids.forEach((id) => {\n      const group = this.groups[id];\n\n      if (group) {\n        group.dispose();\n        delete this.groups[id];\n      }\n    });\n\n    if (this.options.cluster) {\n      this.clusterGenerator.updateData();\n      this._clusterItems();\n    }\n\n    this.markDirty({ restackGroups: !!this.options.cluster });\n    this.body.emitter.emit(\"_change\", { queue: true });\n  }\n\n  /**\n   * Reorder the groups if needed\n   * @return {boolean} changed\n   * @private\n   */\n  _orderGroups() {\n    if (this.groupsData) {\n      // reorder the groups\n      let groupIds = this.groupsData.getIds({\n        order: this.options.groupOrder,\n      });\n\n      groupIds = this._orderNestedGroups(groupIds);\n\n      const changed = !util.equalArray(groupIds, this.groupIds);\n      if (changed) {\n        // hide all groups, removes them from the DOM\n        const groups = this.groups;\n        groupIds.forEach((groupId) => {\n          groups[groupId].hide();\n        });\n\n        // show the groups again, attach them to the DOM in correct order\n        groupIds.forEach((groupId) => {\n          groups[groupId].show();\n        });\n\n        this.groupIds = groupIds;\n      }\n\n      return changed;\n    } else {\n      return false;\n    }\n  }\n\n  /**\n   * Reorder the nested groups\n   *\n   * @param {Array.<number>} groupIds\n   * @returns {Array.<number>}\n   * @private\n   */\n  _orderNestedGroups(groupIds) {\n    /**\n     * Recursively order nested groups\n     *\n     * @param {ItemSet} t\n     * @param {Array.<number>} groupIds\n     * @returns {Array.<number>}\n     * @private\n     */\n    function getOrderedNestedGroups(t, groupIds) {\n      let result = [];\n      groupIds.forEach((groupId) => {\n        result.push(groupId);\n        const groupData = t.groupsData.get(groupId);\n        if (groupData.nestedGroups) {\n          const nestedGroupIds = t.groupsData\n            .get({\n              filter(nestedGroup) {\n                return nestedGroup.nestedInGroup == groupId;\n              },\n              order: t.options.groupOrder,\n            })\n            .map((nestedGroup) => nestedGroup.id);\n          result = result.concat(getOrderedNestedGroups(t, nestedGroupIds));\n        }\n      });\n\n      return result;\n    }\n\n    const topGroupIds = groupIds.filter(\n      (groupId) => !this.groupsData.get(groupId).nestedInGroup,\n    );\n\n    return getOrderedNestedGroups(this, topGroupIds);\n  }\n\n  /**\n   * Add a new item\n   * @param {Item} item\n   * @private\n   */\n  _addItem(item) {\n    this.items[item.id] = item;\n\n    // add to group\n    const groupId = this.getGroupId(item.data);\n    const group = this.groups[groupId];\n\n    if (!group) {\n      item.groupShowing = false;\n    } else if (group && group.data && group.data.showNested) {\n      item.groupShowing = true;\n    }\n\n    if (group) group.add(item);\n  }\n\n  /**\n   * Update an existing item\n   * @param {Item} item\n   * @param {Object} itemData\n   * @private\n   */\n  _updateItem(item, itemData) {\n    // update the items data (will redraw the item when displayed)\n    item.setData(itemData);\n\n    const groupId = this.getGroupId(item.data);\n    const group = this.groups[groupId];\n    if (!group) {\n      item.groupShowing = false;\n    } else if (group && group.data && group.data.showNested) {\n      item.groupShowing = true;\n    }\n  }\n\n  /**\n   * Delete an item from the ItemSet: remove it from the DOM, from the map\n   * with items, and from the map with visible items, and from the selection\n   * @param {Item} item\n   * @private\n   */\n  _removeItem(item) {\n    // remove from DOM\n    item.hide();\n\n    // remove from items\n    delete this.items[item.id];\n\n    // remove from selection\n    const index = this.selection.indexOf(item.id);\n    if (index != -1) this.selection.splice(index, 1);\n\n    // remove from group\n    item.parent && item.parent.remove(item);\n\n    // remove Tooltip from DOM\n    if (this.popup != null) {\n      this.popup.hide();\n    }\n  }\n\n  /**\n   * Create an array containing all items being a range (having an end date)\n   * @param {Array.<Object>} array\n   * @returns {Array}\n   * @private\n   */\n  _constructByEndArray(array) {\n    const endArray = [];\n\n    for (let i = 0; i < array.length; i++) {\n      if (array[i] instanceof RangeItem) {\n        endArray.push(array[i]);\n      }\n    }\n    return endArray;\n  }\n\n  /**\n   * Register the clicked item on touch, before dragStart is initiated.\n   *\n   * dragStart is initiated from a mousemove event, AFTER the mouse/touch is\n   * already moving. Therefore, the mouse/touch can sometimes be above an other\n   * DOM element than the item itself.\n   *\n   * @param {Event} event\n   * @private\n   */\n  _onTouch(event) {\n    // store the touched item, used in _onDragStart\n    this.touchParams.item = this.itemFromTarget(event);\n    this.touchParams.dragLeftItem = event.target.dragLeftItem || false;\n    this.touchParams.dragRightItem = event.target.dragRightItem || false;\n    this.touchParams.itemProps = null;\n  }\n\n  /**\n   * Given an group id, returns the index it has.\n   *\n   * @param {number} groupId\n   * @returns {number} index / groupId\n   * @private\n   */\n  _getGroupIndex(groupId) {\n    for (let i = 0; i < this.groupIds.length; i++) {\n      if (groupId == this.groupIds[i]) return i;\n    }\n  }\n\n  /**\n   * Start dragging the selected events\n   * @param {Event} event\n   * @private\n   */\n  _onDragStart(event) {\n    if (this.touchParams.itemIsDragging) {\n      return;\n    }\n    const item = this.touchParams.item || null;\n    const me = this;\n    let props;\n\n    if (item && (item.selected || this.options.itemsAlwaysDraggable.item)) {\n      if (\n        this.options.editable.overrideItems &&\n        !this.options.editable.updateTime &&\n        !this.options.editable.updateGroup\n      ) {\n        return;\n      }\n\n      // override options.editable\n      if (\n        item.editable != null &&\n        !item.editable.updateTime &&\n        !item.editable.updateGroup &&\n        !this.options.editable.overrideItems\n      ) {\n        return;\n      }\n\n      const dragLeftItem = this.touchParams.dragLeftItem;\n      const dragRightItem = this.touchParams.dragRightItem;\n      this.touchParams.itemIsDragging = true;\n      this.touchParams.selectedItem = item;\n\n      if (dragLeftItem) {\n        props = {\n          item: dragLeftItem,\n          initialX: event.center.x,\n          dragLeft: true,\n          data: this._cloneItemData(item.data),\n        };\n\n        this.touchParams.itemProps = [props];\n      } else if (dragRightItem) {\n        props = {\n          item: dragRightItem,\n          initialX: event.center.x,\n          dragRight: true,\n          data: this._cloneItemData(item.data),\n        };\n\n        this.touchParams.itemProps = [props];\n      } else if (\n        this.options.editable.add &&\n        (event.srcEvent.ctrlKey || event.srcEvent.metaKey)\n      ) {\n        // create a new range item when dragging with ctrl key down\n        this._onDragStartAddItem(event);\n      } else {\n        if (this.groupIds.length < 1) {\n          // Mitigates a race condition if _onDragStart() is\n          // called after markDirty() without redraw() being called between.\n          this.redraw();\n        }\n\n        const baseGroupIndex = this._getGroupIndex(item.data.group);\n\n        const itemsToDrag =\n          this.options.itemsAlwaysDraggable.item && !item.selected\n            ? [item.id]\n            : this.getSelection();\n\n        this.touchParams.itemProps = itemsToDrag.map((id) => {\n          const item = me.items[id];\n          const groupIndex = me._getGroupIndex(item.data.group);\n          return {\n            item,\n            initialX: event.center.x,\n            groupOffset: baseGroupIndex - groupIndex,\n            data: this._cloneItemData(item.data),\n          };\n        });\n      }\n\n      event.stopPropagation();\n    } else if (\n      this.options.editable.add &&\n      (event.srcEvent.ctrlKey || event.srcEvent.metaKey)\n    ) {\n      // create a new range item when dragging with ctrl key down\n      this._onDragStartAddItem(event);\n    }\n  }\n\n  /**\n   * Start creating a new range item by dragging.\n   * @param {Event} event\n   * @private\n   */\n  _onDragStartAddItem(event) {\n    const snap = this.options.snap || null;\n    const frameRect = this.dom.frame.getBoundingClientRect();\n\n    // plus (if rtl) 10 to compensate for the drag starting as soon as you've moved 10px\n    const x = this.options.rtl\n      ? frameRect.right - event.center.x + 10\n      : event.center.x - frameRect.left - 10;\n\n    const time = this.body.util.toTime(x);\n    const scale = this.body.util.getScale();\n    const step = this.body.util.getStep();\n    const start = snap ? snap(time, scale, step) : time;\n    const end = start;\n\n    const itemData = {\n      type: \"range\",\n      start,\n      end,\n      content: \"new item\",\n    };\n\n    const id = randomUUID();\n    itemData[this.itemsData.idProp] = id;\n\n    const group = this.groupFromTarget(event);\n    if (group) {\n      itemData.group = group.groupId;\n    }\n    const newItem = new RangeItem(itemData, this.conversion, this.options);\n    newItem.id = id; // TODO: not so nice setting id afterwards\n    newItem.data = this._cloneItemData(itemData);\n    this._addItem(newItem);\n    this.touchParams.selectedItem = newItem;\n\n    const props = {\n      item: newItem,\n      initialX: event.center.x,\n      data: newItem.data,\n    };\n\n    if (this.options.rtl) {\n      props.dragLeft = true;\n    } else {\n      props.dragRight = true;\n    }\n    this.touchParams.itemProps = [props];\n\n    event.stopPropagation();\n  }\n\n  /**\n   * Drag selected items\n   * @param {Event} event\n   * @private\n   */\n  _onDrag(event) {\n    if (this.popup != null && this.options.showTooltips && !this.popup.hidden) {\n      // this.popup.hide();\n      const container = this.body.dom.centerContainer;\n      const containerRect = container.getBoundingClientRect();\n      this.popup.setPosition(\n        event.center.x - containerRect.left + container.offsetLeft,\n        event.center.y - containerRect.top + container.offsetTop,\n      );\n      this.popup.show(); // redraw\n    }\n\n    if (this.touchParams.itemProps) {\n      event.stopPropagation();\n\n      const me = this;\n      const snap = this.options.snap || null;\n      const domRootOffsetLeft = this.body.dom.root.offsetLeft;\n      const xOffset = this.options.rtl\n        ? domRootOffsetLeft + this.body.domProps.right.width\n        : domRootOffsetLeft + this.body.domProps.left.width;\n      const scale = this.body.util.getScale();\n      const step = this.body.util.getStep();\n\n      //only calculate the new group for the item that's actually dragged\n      const selectedItem = this.touchParams.selectedItem;\n      const updateGroupAllowed =\n        ((this.options.editable.overrideItems ||\n          selectedItem.editable == null) &&\n          this.options.editable.updateGroup) ||\n        (!this.options.editable.overrideItems &&\n          selectedItem.editable != null &&\n          selectedItem.editable.updateGroup);\n      let newGroupBase = null;\n      if (updateGroupAllowed && selectedItem) {\n        if (selectedItem.data.group != undefined) {\n          // drag from one group to another\n          const group = me.groupFromTarget(event);\n          if (group) {\n            //we know the offset for all items, so the new group for all items\n            //will be relative to this one.\n            newGroupBase = this._getGroupIndex(group.groupId);\n          }\n        }\n      }\n\n      // move\n      this.touchParams.itemProps.forEach((props) => {\n        const current = me.body.util.toTime(event.center.x - xOffset);\n        const initial = me.body.util.toTime(props.initialX - xOffset);\n        let offset;\n        let initialStart;\n        let initialEnd;\n        let start;\n        let end;\n\n        if (this.options.rtl) {\n          offset = -(current - initial); // ms\n        } else {\n          offset = current - initial; // ms\n        }\n\n        let itemData = this._cloneItemData(props.item.data); // clone the data\n        if (\n          props.item.editable != null &&\n          !props.item.editable.updateTime &&\n          !props.item.editable.updateGroup &&\n          !me.options.editable.overrideItems\n        ) {\n          return;\n        }\n\n        const updateTimeAllowed =\n          ((this.options.editable.overrideItems ||\n            selectedItem.editable == null) &&\n            this.options.editable.updateTime) ||\n          (!this.options.editable.overrideItems &&\n            selectedItem.editable != null &&\n            selectedItem.editable.updateTime);\n        if (updateTimeAllowed) {\n          if (props.dragLeft) {\n            // drag left side of a range item\n            if (this.options.rtl) {\n              if (itemData.end != undefined) {\n                initialEnd = util.convert(props.data.end, \"Date\");\n                end = new Date(initialEnd.valueOf() + offset);\n                // TODO: pass a Moment instead of a Date to snap(). (Breaking change)\n                itemData.end = snap ? snap(end, scale, step) : end;\n              }\n            } else {\n              if (itemData.start != undefined) {\n                initialStart = util.convert(props.data.start, \"Date\");\n                start = new Date(initialStart.valueOf() + offset);\n                // TODO: pass a Moment instead of a Date to snap(). (Breaking change)\n                itemData.start = snap ? snap(start, scale, step) : start;\n              }\n            }\n          } else if (props.dragRight) {\n            // drag right side of a range item\n            if (this.options.rtl) {\n              if (itemData.start != undefined) {\n                initialStart = util.convert(props.data.start, \"Date\");\n                start = new Date(initialStart.valueOf() + offset);\n                // TODO: pass a Moment instead of a Date to snap(). (Breaking change)\n                itemData.start = snap ? snap(start, scale, step) : start;\n              }\n            } else {\n              if (itemData.end != undefined) {\n                initialEnd = util.convert(props.data.end, \"Date\");\n                end = new Date(initialEnd.valueOf() + offset);\n                // TODO: pass a Moment instead of a Date to snap(). (Breaking change)\n                itemData.end = snap ? snap(end, scale, step) : end;\n              }\n            }\n          } else {\n            // drag both start and end\n            if (itemData.start != undefined) {\n              initialStart = util.convert(props.data.start, \"Date\").valueOf();\n              start = new Date(initialStart + offset);\n\n              if (itemData.end != undefined) {\n                initialEnd = util.convert(props.data.end, \"Date\");\n                const duration = initialEnd.valueOf() - initialStart.valueOf();\n\n                // TODO: pass a Moment instead of a Date to snap(). (Breaking change)\n                itemData.start = snap ? snap(start, scale, step) : start;\n                itemData.end = new Date(itemData.start.valueOf() + duration);\n              } else {\n                // TODO: pass a Moment instead of a Date to snap(). (Breaking change)\n                itemData.start = snap ? snap(start, scale, step) : start;\n              }\n            }\n          }\n        }\n\n        if (\n          updateGroupAllowed &&\n          !props.dragLeft &&\n          !props.dragRight &&\n          newGroupBase != null\n        ) {\n          if (itemData.group != undefined) {\n            let newOffset = newGroupBase - props.groupOffset;\n\n            //make sure we stay in bounds\n            newOffset = Math.max(0, newOffset);\n            newOffset = Math.min(me.groupIds.length - 1, newOffset);\n            itemData.group = me.groupIds[newOffset];\n          }\n        }\n\n        // confirm moving the item\n        itemData = this._cloneItemData(itemData); // convert start and end to the correct type\n        me.options.onMoving(itemData, (itemData) => {\n          if (itemData) {\n            props.item.setData(this._cloneItemData(itemData, \"Date\"));\n          }\n        });\n      });\n\n      this.body.emitter.emit(\"_change\");\n    }\n  }\n\n  /**\n   * Move an item to another group\n   * @param {Item} item\n   * @param {string | number} groupId\n   * @private\n   */\n  _moveToGroup(item, groupId) {\n    const group = this.groups[groupId];\n    if (group && group.groupId != item.data.group) {\n      const oldGroup = item.parent;\n      oldGroup.remove(item);\n      oldGroup.order();\n\n      item.data.group = group.groupId;\n\n      group.add(item);\n      group.order();\n    }\n  }\n\n  /**\n   * End of dragging selected items\n   * @param {Event} event\n   * @private\n   */\n  _onDragEnd(event) {\n    this.touchParams.itemIsDragging = false;\n    if (this.touchParams.itemProps) {\n      event.stopPropagation();\n\n      const me = this;\n      const itemProps = this.touchParams.itemProps;\n      this.touchParams.itemProps = null;\n\n      itemProps.forEach((props) => {\n        const id = props.item.id;\n        const exists = me.itemsData.get(id) != null;\n\n        if (!exists) {\n          // add a new item\n          me.options.onAdd(props.item.data, (itemData) => {\n            me._removeItem(props.item); // remove temporary item\n            if (itemData) {\n              me.itemsData.add(itemData);\n            }\n\n            // force re-stacking of all items next redraw\n            me.body.emitter.emit(\"_change\");\n          });\n        } else {\n          // update existing item\n          const itemData = this._cloneItemData(props.item.data); // convert start and end to the correct type\n          me.options.onMove(itemData, (itemData) => {\n            if (itemData) {\n              // apply changes\n              itemData[this.itemsData.idProp] = id; // ensure the item contains its id (can be undefined)\n              this.itemsData.update(itemData);\n            } else {\n              // restore original values\n              props.item.setData(props.data);\n\n              me.body.emitter.emit(\"_change\");\n            }\n          });\n        }\n      });\n    }\n  }\n\n  /**\n   * On group click\n   * @param {Event} event\n   * @private\n   */\n  _onGroupClick(event) {\n    const group = this.groupFromTarget(event);\n    setTimeout(() => {\n      this.toggleGroupShowNested(group);\n    }, 1);\n  }\n\n  /**\n   * Toggle show nested\n   * @param {object} group\n   * @param {boolean} force\n   */\n  toggleGroupShowNested(group, force = undefined) {\n    if (!group || !group.nestedGroups) return;\n\n    const groupsData = this.groupsData.getDataSet();\n\n    if (force != undefined) {\n      group.showNested = !!force;\n    } else {\n      group.showNested = !group.showNested;\n    }\n\n    let nestingGroup = groupsData.get(group.groupId);\n    nestingGroup.showNested = group.showNested;\n\n    let fullNestedGroups = group.nestedGroups;\n    let nextLevel = fullNestedGroups;\n    while (nextLevel.length > 0) {\n      let current = nextLevel;\n      nextLevel = [];\n      for (let i = 0; i < current.length; i++) {\n        let node = groupsData.get(current[i]);\n        if (node.nestedGroups) {\n          nextLevel = nextLevel.concat(node.nestedGroups);\n        }\n      }\n      if (nextLevel.length > 0) {\n        fullNestedGroups = fullNestedGroups.concat(nextLevel);\n      }\n    }\n    var nestedGroups;\n    if (nestingGroup.showNested) {\n      var showNestedGroups = groupsData.get(nestingGroup.nestedGroups);\n      for (let i = 0; i < showNestedGroups.length; i++) {\n        let group = showNestedGroups[i];\n        if (\n          group.nestedGroups &&\n          group.nestedGroups.length > 0 &&\n          (group.showNested == undefined || group.showNested == true)\n        ) {\n          showNestedGroups.push(...groupsData.get(group.nestedGroups));\n        }\n      }\n      nestedGroups = showNestedGroups.map(function (nestedGroup) {\n        if (nestedGroup.visible == undefined) {\n          nestedGroup.visible = true;\n        }\n        nestedGroup.visible = !!nestingGroup.showNested;\n\n        return nestedGroup;\n      });\n    } else {\n      nestedGroups = groupsData\n        .get(fullNestedGroups)\n        .map(function (nestedGroup) {\n          if (nestedGroup.visible == undefined) {\n            nestedGroup.visible = true;\n          }\n          nestedGroup.visible = !!nestingGroup.showNested;\n          return nestedGroup;\n        });\n    }\n\n    groupsData.update(nestedGroups.concat(nestingGroup));\n\n    if (nestingGroup.showNested) {\n      util.removeClassName(group.dom.label, \"collapsed\");\n      util.addClassName(group.dom.label, \"expanded\");\n    } else {\n      util.removeClassName(group.dom.label, \"expanded\");\n      util.addClassName(group.dom.label, \"collapsed\");\n    }\n  }\n\n  /**\n   * Toggle group drag classname\n   * @param {object} group\n   */\n  toggleGroupDragClassName(group) {\n    group.dom.label.classList.toggle(\"vis-group-is-dragging\");\n    group.dom.foreground.classList.toggle(\"vis-group-is-dragging\");\n  }\n\n  /**\n   * on drag start\n   * @param {Event} event\n   * @return {void}\n   * @private\n   */\n  _onGroupDragStart(event) {\n    if (this.groupTouchParams.isDragging) return;\n\n    if (this.options.groupEditable.order) {\n      this.groupTouchParams.group = this.groupFromTarget(event);\n\n      if (this.groupTouchParams.group) {\n        event.stopPropagation();\n\n        this.groupTouchParams.isDragging = true;\n        this.toggleGroupDragClassName(this.groupTouchParams.group);\n\n        this.groupTouchParams.originalOrder = this.groupsData.getIds({\n          order: this.options.groupOrder,\n        });\n      }\n    }\n  }\n\n  /**\n   * on drag\n   * @param {Event} event\n   * @return {void}\n   * @private\n   */\n  _onGroupDrag(event) {\n    if (this.options.groupEditable.order && this.groupTouchParams.group) {\n      event.stopPropagation();\n\n      const groupsData = this.groupsData.getDataSet();\n      // drag from one group to another\n      const group = this.groupFromTarget(event);\n\n      // try to avoid toggling when groups differ in height\n      if (group && group.height != this.groupTouchParams.group.height) {\n        const movingUp = group.top < this.groupTouchParams.group.top;\n        const clientY = event.center ? event.center.y : event.clientY;\n        const targetGroup = group.dom.foreground.getBoundingClientRect();\n        const draggedGroupHeight = this.groupTouchParams.group.height;\n        if (movingUp) {\n          // skip swapping the groups when the dragged group is not below clientY afterwards\n          if (targetGroup.top + draggedGroupHeight < clientY) {\n            return;\n          }\n        } else {\n          const targetGroupHeight = group.height;\n          // skip swapping the groups when the dragged group is not below clientY afterwards\n          if (\n            targetGroup.top + targetGroupHeight - draggedGroupHeight >\n            clientY\n          ) {\n            return;\n          }\n        }\n      }\n\n      if (group && group != this.groupTouchParams.group) {\n        const targetGroup = groupsData.get(group.groupId);\n        const draggedGroup = groupsData.get(\n          this.groupTouchParams.group.groupId,\n        );\n\n        // switch groups\n        if (draggedGroup && targetGroup) {\n          this.options.groupOrderSwap(draggedGroup, targetGroup, groupsData);\n          groupsData.update(draggedGroup);\n          groupsData.update(targetGroup);\n        }\n\n        // fetch current order of groups\n        const newOrder = groupsData.getIds({\n          order: this.options.groupOrder,\n        });\n\n        // in case of changes since _onGroupDragStart\n        if (!util.equalArray(newOrder, this.groupTouchParams.originalOrder)) {\n          const origOrder = this.groupTouchParams.originalOrder;\n          const draggedId = this.groupTouchParams.group.groupId;\n          const numGroups = Math.min(origOrder.length, newOrder.length);\n          let curPos = 0;\n          let newOffset = 0;\n          let orgOffset = 0;\n          while (curPos < numGroups) {\n            // as long as the groups are where they should be step down along the groups order\n            while (\n              curPos + newOffset < numGroups &&\n              curPos + orgOffset < numGroups &&\n              newOrder[curPos + newOffset] == origOrder[curPos + orgOffset]\n            ) {\n              curPos++;\n            }\n\n            // all ok\n            if (curPos + newOffset >= numGroups) {\n              break;\n            }\n\n            // not all ok\n            // if dragged group was move upwards everything below should have an offset\n            if (newOrder[curPos + newOffset] == draggedId) {\n              newOffset = 1;\n            }\n            // if dragged group was move downwards everything above should have an offset\n            else if (origOrder[curPos + orgOffset] == draggedId) {\n              orgOffset = 1;\n            }\n            // found a group (apart from dragged group) that has the wrong position -> switch with the\n            // group at the position where other one should be, fix index arrays and continue\n            else {\n              const slippedPosition = newOrder.indexOf(\n                origOrder[curPos + orgOffset],\n              );\n              const switchGroup = groupsData.get(newOrder[curPos + newOffset]);\n              const shouldBeGroup = groupsData.get(\n                origOrder[curPos + orgOffset],\n              );\n              this.options.groupOrderSwap(\n                switchGroup,\n                shouldBeGroup,\n                groupsData,\n              );\n              groupsData.update(switchGroup);\n              groupsData.update(shouldBeGroup);\n\n              const switchGroupId = newOrder[curPos + newOffset];\n              newOrder[curPos + newOffset] = origOrder[curPos + orgOffset];\n              newOrder[slippedPosition] = switchGroupId;\n\n              curPos++;\n            }\n          }\n        }\n      }\n    }\n  }\n\n  /**\n   * on drag end\n   * @param {Event} event\n   * @return {void}\n   * @private\n   */\n  _onGroupDragEnd(event) {\n    this.groupTouchParams.isDragging = false;\n\n    if (this.options.groupEditable.order && this.groupTouchParams.group) {\n      event.stopPropagation();\n\n      // update existing group\n      const me = this;\n      const id = me.groupTouchParams.group.groupId;\n      const dataset = me.groupsData.getDataSet();\n      const groupData = util.extend({}, dataset.get(id)); // clone the data\n      me.options.onMoveGroup(groupData, (groupData) => {\n        if (groupData) {\n          // apply changes\n          groupData[dataset._idProp] = id; // ensure the group contains its id (can be undefined)\n          dataset.update(groupData);\n        } else {\n          // fetch current order of groups\n          const newOrder = dataset.getIds({\n            order: me.options.groupOrder,\n          });\n\n          // restore original order\n          if (!util.equalArray(newOrder, me.groupTouchParams.originalOrder)) {\n            const origOrder = me.groupTouchParams.originalOrder;\n            const numGroups = Math.min(origOrder.length, newOrder.length);\n            let curPos = 0;\n            while (curPos < numGroups) {\n              // as long as the groups are where they should be step down along the groups order\n              while (\n                curPos < numGroups &&\n                newOrder[curPos] == origOrder[curPos]\n              ) {\n                curPos++;\n              }\n\n              // all ok\n              if (curPos >= numGroups) {\n                break;\n              }\n\n              // found a group that has the wrong position -> switch with the\n              // group at the position where other one should be, fix index arrays and continue\n              const slippedPosition = newOrder.indexOf(origOrder[curPos]);\n              const switchGroup = dataset.get(newOrder[curPos]);\n              const shouldBeGroup = dataset.get(origOrder[curPos]);\n              me.options.groupOrderSwap(switchGroup, shouldBeGroup, dataset);\n              dataset.update(switchGroup);\n              dataset.update(shouldBeGroup);\n\n              const switchGroupId = newOrder[curPos];\n              newOrder[curPos] = origOrder[curPos];\n              newOrder[slippedPosition] = switchGroupId;\n\n              curPos++;\n            }\n          }\n        }\n      });\n\n      me.body.emitter.emit(\"groupDragged\", { groupId: id });\n      this.toggleGroupDragClassName(this.groupTouchParams.group);\n      this.groupTouchParams.group = null;\n    }\n  }\n\n  /**\n   * Handle selecting/deselecting an item when tapping it\n   * @param {Event} event\n   * @private\n   */\n  _onSelectItem(event) {\n    if (!this.options.selectable) return;\n\n    const ctrlKey =\n      event.srcEvent && (event.srcEvent.ctrlKey || event.srcEvent.metaKey);\n    const shiftKey = event.srcEvent && event.srcEvent.shiftKey;\n    if (ctrlKey || shiftKey) {\n      this._onMultiSelectItem(event);\n      return;\n    }\n\n    const oldSelection = this.getSelection();\n\n    const item = this.itemFromTarget(event);\n    const selection = item && item.selectable ? [item.id] : [];\n    this.setSelection(selection);\n\n    const newSelection = this.getSelection();\n\n    // emit a select event,\n    // except when old selection is empty and new selection is still empty\n    if (newSelection.length > 0 || oldSelection.length > 0) {\n      this.body.emitter.emit(\"select\", {\n        items: newSelection,\n        event,\n      });\n    }\n  }\n\n  /**\n   * Handle hovering an item\n   * @param {Event} event\n   * @private\n   */\n  _onMouseOver(event) {\n    const item = this.itemFromTarget(event);\n    if (!item) return;\n\n    // Item we just left\n    const related = this.itemFromRelatedTarget(event);\n    if (item === related) {\n      // We haven't changed item, just element in the item\n      return;\n    }\n\n    const title = item.getTitle();\n    if (this.options.showTooltips && title) {\n      if (this.popup == null) {\n        this.popup = new Popup(\n          this.body.dom.root,\n          this.options.tooltip.overflowMethod || \"flip\",\n        );\n      }\n\n      this.popup.setText(title);\n      const container = this.body.dom.centerContainer;\n      const containerRect = container.getBoundingClientRect();\n      this.popup.setPosition(\n        event.clientX - containerRect.left + container.offsetLeft,\n        event.clientY - containerRect.top + container.offsetTop,\n      );\n      this.setPopupTimer(this.popup);\n    } else {\n      // Hovering over item without a title, hide popup\n      // Needed instead of _just_ in _onMouseOut due to #2572\n      this.clearPopupTimer();\n      if (this.popup != null) {\n        this.popup.hide();\n      }\n    }\n\n    this.body.emitter.emit(\"itemover\", {\n      item: item.id,\n      event,\n    });\n  }\n\n  /**\n   * on mouse start\n   * @param {Event} event\n   * @return {void}\n   * @private\n   */\n  _onMouseOut(event) {\n    const item = this.itemFromTarget(event);\n    if (!item) return;\n\n    // Item we are going to\n    const related = this.itemFromRelatedTarget(event);\n    if (item === related) {\n      // We aren't changing item, just element in the item\n      return;\n    }\n\n    this.clearPopupTimer();\n    if (this.popup != null) {\n      this.popup.hide();\n    }\n\n    this.body.emitter.emit(\"itemout\", {\n      item: item.id,\n      event,\n    });\n  }\n\n  /**\n   * on mouse move\n   * @param {Event} event\n   * @return {void}\n   * @private\n   */\n  _onMouseMove(event) {\n    const item = this.itemFromTarget(event);\n    if (!item) return;\n\n    if (this.popupTimer != null) {\n      // restart timer\n      this.setPopupTimer(this.popup);\n    }\n\n    if (\n      this.options.showTooltips &&\n      this.options.tooltip.followMouse &&\n      this.popup &&\n      !this.popup.hidden\n    ) {\n      const container = this.body.dom.centerContainer;\n      const containerRect = container.getBoundingClientRect();\n      this.popup.setPosition(\n        event.clientX - containerRect.left + container.offsetLeft,\n        event.clientY - containerRect.top + container.offsetTop,\n      );\n      this.popup.show(); // Redraw\n    }\n  }\n\n  /**\n   * Handle mousewheel\n   * @param {Event}  event   The event\n   * @private\n   */\n  _onMouseWheel(event) {\n    if (this.touchParams.itemIsDragging) {\n      this._onDragEnd(event);\n    }\n  }\n\n  /**\n   * Handle updates of an item on double tap\n   * @param {timeline.Item}  item   The item\n   * @private\n   */\n  _onUpdateItem(item) {\n    if (!this.options.selectable) return;\n    if (!this.options.editable.updateTime && !this.options.editable.updateGroup)\n      return;\n\n    const me = this;\n\n    if (item) {\n      // execute async handler to update the item (or cancel it)\n      const itemData = me.itemsData.get(item.id); // get a clone of the data from the dataset\n      this.options.onUpdate(itemData, (itemData) => {\n        if (itemData) {\n          me.itemsData.update(itemData);\n        }\n      });\n    }\n  }\n\n  /**\n   * Handle drop event of data on item\n   * Only called when `objectData.target === 'item'.\n   * @param {Event} event The event\n   * @private\n   */\n  _onDropObjectOnItem(event) {\n    const item = this.itemFromTarget(event);\n    const objectData = JSON.parse(event.dataTransfer.getData(\"text\"));\n    this.options.onDropObjectOnItem(objectData, item);\n  }\n\n  /**\n   * Handle creation of an item on double tap or drop of a drag event\n   * @param {Event} event   The event\n   * @private\n   */\n  _onAddItem(event) {\n    if (!this.options.selectable) return;\n    if (!this.options.editable.add) return;\n\n    const me = this;\n    const snap = this.options.snap || null;\n\n    // add item\n    const frameRect = this.dom.frame.getBoundingClientRect();\n    const x = this.options.rtl\n      ? frameRect.right - event.center.x\n      : event.center.x - frameRect.left;\n    const start = this.body.util.toTime(x);\n    const scale = this.body.util.getScale();\n    const step = this.body.util.getStep();\n    let end;\n\n    let newItemData;\n    if (event.type == \"drop\") {\n      newItemData = JSON.parse(event.dataTransfer.getData(\"text\"));\n      newItemData.content = newItemData.content\n        ? newItemData.content\n        : \"new item\";\n      newItemData.start = newItemData.start\n        ? newItemData.start\n        : snap\n          ? snap(start, scale, step)\n          : start;\n      newItemData.type = newItemData.type || \"box\";\n      newItemData[this.itemsData.idProp] = newItemData.id || randomUUID();\n\n      if (newItemData.type == \"range\" && !newItemData.end) {\n        end = this.body.util.toTime(x + this.props.width / 5);\n        newItemData.end = snap ? snap(end, scale, step) : end;\n      }\n    } else {\n      newItemData = {\n        start: snap ? snap(start, scale, step) : start,\n        content: \"new item\",\n      };\n      newItemData[this.itemsData.idProp] = randomUUID();\n\n      // when default type is a range, add a default end date to the new item\n      if (this.options.type === \"range\") {\n        end = this.body.util.toTime(x + this.props.width / 5);\n        newItemData.end = snap ? snap(end, scale, step) : end;\n      }\n    }\n\n    const group = this.groupFromTarget(event);\n    if (group) {\n      newItemData.group = group.groupId;\n    }\n\n    // execute async handler to customize (or cancel) adding an item\n    newItemData = this._cloneItemData(newItemData); // convert start and end to the correct type\n    this.options.onAdd(newItemData, (item) => {\n      if (item) {\n        me.itemsData.add(item);\n        if (event.type == \"drop\") {\n          me.setSelection([item.id]);\n        }\n        // TODO: need to trigger a redraw?\n      }\n    });\n  }\n\n  /**\n   * Handle selecting/deselecting multiple items when holding an item\n   * @param {Event} event\n   * @private\n   */\n  _onMultiSelectItem(event) {\n    if (!this.options.selectable) return;\n\n    const item = this.itemFromTarget(event);\n\n    if (item) {\n      // multi select items (if allowed)\n\n      let selection = this.options.multiselect\n        ? this.getSelection() // take current selection\n        : []; // deselect current selection\n\n      const shiftKey = (event.srcEvent && event.srcEvent.shiftKey) || false;\n\n      if (\n        (shiftKey || this.options.sequentialSelection) &&\n        this.options.multiselect\n      ) {\n        // select all items between the old selection and the tapped item\n        const itemGroup = this.itemsData.get(item.id).group;\n\n        // when filtering get the group of the last selected item\n        let lastSelectedGroup = undefined;\n        if (this.options.multiselectPerGroup) {\n          if (selection.length > 0) {\n            lastSelectedGroup = this.itemsData.get(selection[0]).group;\n          }\n        }\n\n        // determine the selection range\n        if (\n          !this.options.multiselectPerGroup ||\n          lastSelectedGroup == undefined ||\n          lastSelectedGroup == itemGroup\n        ) {\n          selection.push(item.id);\n        }\n        const range = ItemSet._getItemRange(this.itemsData.get(selection));\n\n        if (\n          !this.options.multiselectPerGroup ||\n          lastSelectedGroup == itemGroup\n        ) {\n          // select all items within the selection range\n          selection = [];\n          for (const id in this.items) {\n            if (!Object.prototype.hasOwnProperty.call(this.items, id)) continue;\n\n            const _item = this.items[id];\n            const start = _item.data.start;\n            const end = _item.data.end !== undefined ? _item.data.end : start;\n\n            if (\n              start >= range.min &&\n              end <= range.max &&\n              (!this.options.multiselectPerGroup ||\n                lastSelectedGroup == this.itemsData.get(_item.id).group) &&\n              !(_item instanceof BackgroundItem)\n            ) {\n              selection.push(_item.id); // do not use id but item.id, id itself is stringified\n            }\n          }\n        }\n      } else {\n        // add/remove this item from the current selection\n        const index = selection.indexOf(item.id);\n        if (index == -1) {\n          // item is not yet selected -> select it\n          selection.push(item.id);\n        } else {\n          // item is already selected -> deselect it\n          selection.splice(index, 1);\n        }\n      }\n\n      const filteredSelection = selection.filter(\n        (item) => this.getItemById(item).selectable,\n      );\n\n      this.setSelection(filteredSelection);\n\n      this.body.emitter.emit(\"select\", {\n        items: this.getSelection(),\n        event,\n      });\n    }\n  }\n\n  /**\n   * Calculate the time range of a list of items\n   * @param {Array.<Object>} itemsData\n   * @return {{min: Date, max: Date}} Returns the range of the provided items\n   * @private\n   */\n  static _getItemRange(itemsData) {\n    let max = null;\n    let min = null;\n\n    itemsData.forEach((data) => {\n      if (min == null || data.start < min) {\n        min = data.start;\n      }\n\n      if (data.end != undefined) {\n        if (max == null || data.end > max) {\n          max = data.end;\n        }\n      } else {\n        if (max == null || data.start > max) {\n          max = data.start;\n        }\n      }\n    });\n\n    return {\n      min,\n      max,\n    };\n  }\n\n  /**\n   * Find an item from an element:\n   * searches for the attribute 'vis-item' in the element's tree\n   * @param {HTMLElement} element\n   * @return {Item | null} item\n   */\n  itemFromElement(element) {\n    let cur = element;\n    while (cur) {\n      if (Object.prototype.hasOwnProperty.call(cur, \"vis-item\")) {\n        return cur[\"vis-item\"];\n      }\n      cur = cur.parentNode;\n    }\n\n    return null;\n  }\n\n  /**\n   * Find an item from an event target:\n   * searches for the attribute 'vis-item' in the event target's element tree\n   * @param {Event} event\n   * @return {Item | null} item\n   */\n  itemFromTarget(event) {\n    return this.itemFromElement(event.target);\n  }\n\n  /**\n   * Find an item from an event's related target:\n   * searches for the attribute 'vis-item' in the related target's element tree\n   * @param {Event} event\n   * @return {Item | null} item\n   */\n  itemFromRelatedTarget(event) {\n    return this.itemFromElement(event.relatedTarget);\n  }\n\n  /**\n   * Find the Group from an event target:\n   * searches for the attribute 'vis-group' in the event target's element tree\n   * @param {Event} event\n   * @return {Group | null} group\n   */\n  groupFromTarget(event) {\n    const clientY = event.center ? event.center.y : event.clientY;\n    let groupIds = this.groupIds;\n\n    if (groupIds.length <= 0 && this.groupsData) {\n      groupIds = this.groupsData.getIds({\n        order: this.options.groupOrder,\n      });\n    }\n\n    for (let i = 0; i < groupIds.length; i++) {\n      const groupId = groupIds[i];\n      const group = this.groups[groupId];\n      const foreground = group.dom.foreground;\n      const foregroundRect = foreground.getBoundingClientRect();\n      if (\n        clientY >= foregroundRect.top &&\n        clientY < foregroundRect.top + foreground.offsetHeight\n      ) {\n        return group;\n      }\n\n      if (this.options.orientation.item === \"top\") {\n        if (i === this.groupIds.length - 1 && clientY > foregroundRect.top) {\n          return group;\n        }\n      } else {\n        if (i === 0 && clientY < foregroundRect.top + foreground.offset) {\n          return group;\n        }\n      }\n    }\n\n    return null;\n  }\n\n  /**\n   * Find the ItemSet from an event target:\n   * searches for the attribute 'vis-itemset' in the event target's element tree\n   * @param {Event} event\n   * @return {ItemSet | null} item\n   */\n  static itemSetFromTarget(event) {\n    let target = event.target;\n    while (target) {\n      if (Object.prototype.hasOwnProperty.call(target, \"vis-itemset\")) {\n        return target[\"vis-itemset\"];\n      }\n      target = target.parentNode;\n    }\n\n    return null;\n  }\n\n  /**\n   * Clone the data of an item, and \"normalize\" it: convert the start and end date\n   * to the type (Date, Moment, ...) configured in the DataSet. If not configured,\n   * start and end are converted to Date.\n   * @param {Object} itemData, typically `item.data`\n   * @param {string} [type]  Optional Date type. If not provided, the type from the DataSet is taken\n   * @return {Object} The cloned object\n   * @private\n   */\n  _cloneItemData(itemData, type) {\n    const clone = util.extend({}, itemData);\n\n    if (!type) {\n      // convert start and end date to the type (Date, Moment, ...) configured in the DataSet\n      type = this.itemsData.type;\n    }\n\n    if (clone.start != undefined) {\n      clone.start = util.convert(clone.start, (type && type.start) || \"Date\");\n    }\n    if (clone.end != undefined) {\n      clone.end = util.convert(clone.end, (type && type.end) || \"Date\");\n    }\n\n    return clone;\n  }\n\n  /**\n   * cluster items\n   * @return {void}\n   * @private\n   */\n  _clusterItems() {\n    if (!this.options.cluster) {\n      return;\n    }\n\n    const { scale } = this.body.range.conversion(\n      this.body.domProps.center.width,\n    );\n    const clusters = this.clusterGenerator.getClusters(\n      this.clusters,\n      scale,\n      this.options.cluster,\n    );\n\n    if (this.clusters != clusters) {\n      this._detachAllClusters();\n\n      if (clusters) {\n        for (let cluster of clusters) {\n          cluster.attach();\n        }\n        this.clusters = clusters;\n      }\n\n      this._updateClusters(clusters);\n    }\n  }\n\n  /**\n   * detach all cluster items\n   * @private\n   */\n  _detachAllClusters() {\n    if (this.options.cluster) {\n      if (this.clusters && this.clusters.length) {\n        for (let cluster of this.clusters) {\n          cluster.detach();\n        }\n      }\n    }\n  }\n\n  /**\n   * update clusters\n   * @param {array} clusters\n   * @private\n   */\n  _updateClusters(clusters) {\n    if (this.clusters && this.clusters.length) {\n      const newClustersIds = new Set(clusters.map((cluster) => cluster.id));\n      const clustersToUnselect = this.clusters.filter(\n        (cluster) => !newClustersIds.has(cluster.id),\n      );\n      let selectionChanged = false;\n      for (let cluster of clustersToUnselect) {\n        const selectedIdx = this.selection.indexOf(cluster.id);\n        if (selectedIdx !== -1) {\n          cluster.unselect();\n          this.selection.splice(selectedIdx, 1);\n          selectionChanged = true;\n        }\n      }\n\n      if (selectionChanged) {\n        const newSelection = this.getSelection();\n        this.body.emitter.emit(\"select\", {\n          items: newSelection,\n          event: event,\n        });\n      }\n    }\n\n    this.clusters = clusters || [];\n  }\n}\n\n// available item types will be registered here\nItemSet.types = {\n  background: BackgroundItem,\n  box: BoxItem,\n  range: RangeItem,\n  point: PointItem,\n};\n\n/**\n * Handle added items\n * @param {number[]} ids\n * @protected\n */\nItemSet.prototype._onAdd = ItemSet.prototype._onUpdate;\n\nexport default ItemSet;\n","import util from \"../util.js\";\n\nlet errorFound = false;\nlet allOptions;\nlet printStyle = \"background: #FFeeee; color: #dd0000\";\n/**\n *  Used to validate options.\n */\nclass Validator {\n  /**\n   * @ignore\n   */\n  constructor() {}\n\n  /**\n   * Main function to be called\n   * @param {Object} options\n   * @param {Object} referenceOptions\n   * @param {Object} subObject\n   * @returns {boolean}\n   * @static\n   */\n  static validate(options, referenceOptions, subObject) {\n    errorFound = false;\n    allOptions = referenceOptions;\n    let usedOptions = referenceOptions;\n    if (subObject !== undefined) {\n      usedOptions = referenceOptions[subObject];\n    }\n    Validator.parse(options, usedOptions, []);\n    return errorFound;\n  }\n\n  /**\n   * Will traverse an object recursively and check every value\n   * @param {Object} options\n   * @param {Object} referenceOptions\n   * @param {array} path    | where to look for the actual option\n   * @static\n   */\n  static parse(options, referenceOptions, path) {\n    for (let option in options) {\n      if (!Object.prototype.hasOwnProperty.call(options, option)) continue;\n      Validator.check(option, options, referenceOptions, path);\n    }\n  }\n\n  /**\n   * Check every value. If the value is an object, call the parse function on that object.\n   * @param {string} option\n   * @param {Object} options\n   * @param {Object} referenceOptions\n   * @param {array} path    | where to look for the actual option\n   * @static\n   */\n  static check(option, options, referenceOptions, path) {\n    if (\n      referenceOptions[option] === undefined &&\n      referenceOptions.__any__ === undefined\n    ) {\n      Validator.getSuggestion(option, referenceOptions, path);\n      return;\n    }\n\n    let referenceOption = option;\n    let is_object = true;\n\n    if (\n      referenceOptions[option] === undefined &&\n      referenceOptions.__any__ !== undefined\n    ) {\n      // NOTE: This only triggers if the __any__ is in the top level of the options object.\n      //       THAT'S A REALLY BAD PLACE TO ALLOW IT!!!!\n      // TODO: Examine if needed, remove if possible\n\n      // __any__ is a wildcard. Any value is accepted and will be further analysed by reference.\n      referenceOption = \"__any__\";\n\n      // if the any-subgroup is not a predefined object in the configurator,\n      // we do not look deeper into the object.\n      is_object = Validator.getType(options[option]) === \"object\";\n    } else {\n      // Since all options in the reference are objects, we can check whether\n      // they are supposed to be the object to look for the __type__ field.\n      // if this is an object, we check if the correct type has been supplied to account for shorthand options.\n    }\n\n    let refOptionObj = referenceOptions[referenceOption];\n    if (is_object && refOptionObj.__type__ !== undefined) {\n      refOptionObj = refOptionObj.__type__;\n    }\n\n    Validator.checkFields(\n      option,\n      options,\n      referenceOptions,\n      referenceOption,\n      refOptionObj,\n      path,\n    );\n  }\n\n  /**\n   *\n   * @param {string}  option           | the option property\n   * @param {Object}  options          | The supplied options object\n   * @param {Object}  referenceOptions | The reference options containing all options and their allowed formats\n   * @param {string}  referenceOption  | Usually this is the same as option, except when handling an __any__ tag.\n   * @param {string}  refOptionObj     | This is the type object from the reference options\n   * @param {Array}   path             | where in the object is the option\n   * @static\n   */\n  static checkFields(\n    option,\n    options,\n    referenceOptions,\n    referenceOption,\n    refOptionObj,\n    path,\n  ) {\n    let log = function (message) {\n      console.log(\n        \"%c\" + message + Validator.printLocation(path, option),\n        printStyle,\n      );\n    };\n\n    let optionType = Validator.getType(options[option]);\n    let refOptionType = refOptionObj[optionType];\n\n    if (refOptionType !== undefined) {\n      // if the type is correct, we check if it is supposed to be one of a few select values\n      if (\n        Validator.getType(refOptionType) === \"array\" &&\n        refOptionType.indexOf(options[option]) === -1\n      ) {\n        log(\n          'Invalid option detected in \"' +\n            option +\n            '\".' +\n            \" Allowed values are:\" +\n            Validator.print(refOptionType) +\n            ' not \"' +\n            options[option] +\n            '\". ',\n        );\n        errorFound = true;\n      } else if (optionType === \"object\" && referenceOption !== \"__any__\") {\n        path = util.copyAndExtendArray(path, option);\n        Validator.parse(\n          options[option],\n          referenceOptions[referenceOption],\n          path,\n        );\n      }\n    } else if (refOptionObj[\"any\"] === undefined) {\n      // type of the field is incorrect and the field cannot be any\n      log(\n        'Invalid type received for \"' +\n          option +\n          '\". Expected: ' +\n          Validator.print(Object.keys(refOptionObj)) +\n          \". Received [\" +\n          optionType +\n          '] \"' +\n          options[option] +\n          '\"',\n      );\n      errorFound = true;\n    }\n  }\n\n  /**\n   *\n   * @param {Object|boolean|number|string|Array.<number>|Date|Node|Moment|undefined|null} object\n   * @returns {string}\n   * @static\n   */\n  static getType(object) {\n    var type = typeof object;\n\n    if (type === \"object\") {\n      if (object === null) {\n        return \"null\";\n      }\n      if (object instanceof Boolean) {\n        return \"boolean\";\n      }\n      if (object instanceof Number) {\n        return \"number\";\n      }\n      if (object instanceof String) {\n        return \"string\";\n      }\n      if (Array.isArray(object)) {\n        return \"array\";\n      }\n      if (object instanceof Date) {\n        return \"date\";\n      }\n      if (object.nodeType !== undefined) {\n        return \"dom\";\n      }\n      if (object._isAMomentObject === true) {\n        return \"moment\";\n      }\n      return \"object\";\n    } else if (type === \"number\") {\n      return \"number\";\n    } else if (type === \"boolean\") {\n      return \"boolean\";\n    } else if (type === \"string\") {\n      return \"string\";\n    } else if (type === undefined) {\n      return \"undefined\";\n    }\n    return type;\n  }\n\n  /**\n   * @param {string} option\n   * @param {Object} options\n   * @param {Array.<string>} path\n   * @static\n   */\n  static getSuggestion(option, options, path) {\n    let localSearch = Validator.findInOptions(option, options, path, false);\n    let globalSearch = Validator.findInOptions(option, allOptions, [], true);\n\n    let localSearchThreshold = 8;\n    let globalSearchThreshold = 4;\n\n    let msg;\n    if (localSearch.indexMatch !== undefined) {\n      msg =\n        \" in \" +\n        Validator.printLocation(localSearch.path, option, \"\") +\n        'Perhaps it was incomplete? Did you mean: \"' +\n        localSearch.indexMatch +\n        '\"?\\n\\n';\n    } else if (\n      globalSearch.distance <= globalSearchThreshold &&\n      localSearch.distance > globalSearch.distance\n    ) {\n      msg =\n        \" in \" +\n        Validator.printLocation(localSearch.path, option, \"\") +\n        \"Perhaps it was misplaced? Matching option found at: \" +\n        Validator.printLocation(\n          globalSearch.path,\n          globalSearch.closestMatch,\n          \"\",\n        );\n    } else if (localSearch.distance <= localSearchThreshold) {\n      msg =\n        '. Did you mean \"' +\n        localSearch.closestMatch +\n        '\"?' +\n        Validator.printLocation(localSearch.path, option);\n    } else {\n      msg =\n        \". Did you mean one of these: \" +\n        Validator.print(Object.keys(options)) +\n        Validator.printLocation(path, option);\n    }\n\n    console.log(\n      '%cUnknown option detected: \"' + option + '\"' + msg,\n      printStyle,\n    );\n    errorFound = true;\n  }\n\n  /**\n   * traverse the options in search for a match.\n   * @param {string} option\n   * @param {Object} options\n   * @param {Array} path    | where to look for the actual option\n   * @param {boolean} [recursive=false]\n   * @returns {{closestMatch: string, path: Array, distance: number}}\n   * @static\n   */\n  static findInOptions(option, options, path, recursive = false) {\n    let min = 1e9;\n    let closestMatch = \"\";\n    let closestMatchPath = [];\n    let lowerCaseOption = option.toLowerCase();\n    let indexMatch = undefined;\n    for (let op in options) {\n      if (!Object.prototype.hasOwnProperty.call(options, op)) continue;\n\n      let distance;\n      if (options[op].__type__ !== undefined && recursive === true) {\n        let result = Validator.findInOptions(\n          option,\n          options[op],\n          util.copyAndExtendArray(path, op),\n        );\n        if (min > result.distance) {\n          closestMatch = result.closestMatch;\n          closestMatchPath = result.path;\n          min = result.distance;\n          indexMatch = result.indexMatch;\n        }\n      } else {\n        if (op.toLowerCase().indexOf(lowerCaseOption) !== -1) {\n          indexMatch = op;\n        }\n        distance = Validator.levenshteinDistance(option, op);\n        if (min > distance) {\n          closestMatch = op;\n          closestMatchPath = util.copyArray(path);\n          min = distance;\n        }\n      }\n    }\n    return {\n      closestMatch: closestMatch,\n      path: closestMatchPath,\n      distance: min,\n      indexMatch: indexMatch,\n    };\n  }\n\n  /**\n   * @param {Array.<string>} path\n   * @param {Object} option\n   * @param {string} prefix\n   * @returns {String}\n   * @static\n   */\n  static printLocation(path, option, prefix = \"Problem value found at: \\n\") {\n    let str = \"\\n\\n\" + prefix + \"options = {\\n\";\n    for (let i = 0; i < path.length; i++) {\n      for (let j = 0; j < i + 1; j++) {\n        str += \"  \";\n      }\n      str += path[i] + \": {\\n\";\n    }\n    for (let j = 0; j < path.length + 1; j++) {\n      str += \"  \";\n    }\n    str += option + \"\\n\";\n    for (let i = 0; i < path.length + 1; i++) {\n      for (let j = 0; j < path.length - i; j++) {\n        str += \"  \";\n      }\n      str += \"}\\n\";\n    }\n    return str + \"\\n\\n\";\n  }\n\n  /**\n   * @param {Object} options\n   * @returns {String}\n   * @static\n   */\n  static print(options) {\n    return JSON.stringify(options)\n      .replace(/(\\\")|(\\[)|(\\])|(,\"__type__\")/g, \"\")\n      .replace(/(\\,)/g, \", \");\n  }\n\n  /**\n   *  Compute the edit distance between the two given strings\n   * http://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Levenshtein_distance#JavaScript\n   *\n   * Copyright (c) 2011 Andrei Mackenzie\n   *\n   * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n   *\n   * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n   *\n   * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n   *\n   * @param {string} a\n   * @param {string} b\n   * @returns {Array.<Array.<number>>}}\n   * @static\n   */\n  static levenshteinDistance(a, b) {\n    if (a.length === 0) return b.length;\n    if (b.length === 0) return a.length;\n\n    var matrix = [];\n\n    // increment along the first column of each row\n    var i;\n    for (i = 0; i <= b.length; i++) {\n      matrix[i] = [i];\n    }\n\n    // increment each column in the first row\n    var j;\n    for (j = 0; j <= a.length; j++) {\n      matrix[0][j] = j;\n    }\n\n    // Fill in the rest of the matrix\n    for (i = 1; i <= b.length; i++) {\n      for (j = 1; j <= a.length; j++) {\n        if (b.charAt(i - 1) == a.charAt(j - 1)) {\n          matrix[i][j] = matrix[i - 1][j - 1];\n        } else {\n          matrix[i][j] = Math.min(\n            matrix[i - 1][j - 1] + 1, // substitution\n            Math.min(\n              matrix[i][j - 1] + 1, // insertion\n              matrix[i - 1][j] + 1,\n            ),\n          ); // deletion\n        }\n      }\n    }\n\n    return matrix[b.length][a.length];\n  }\n}\n\nexport { Validator, printStyle };\n","/**\n * This object contains all possible options. It will check if the types are correct, if required if the option is one\n * of the allowed values.\n *\n * __any__ means that the name of the property does not matter.\n * __type__ is a required field for all objects and contains the allowed types of all objects\n */\nlet string = \"string\";\nlet bool = \"boolean\";\nlet number = \"number\";\nlet array = \"array\";\nlet date = \"date\";\nlet object = \"object\"; // should only be in a __type__ property\nlet dom = \"dom\";\nlet moment = \"moment\";\nlet any = \"any\";\n\nlet allOptions = {\n  configure: {\n    enabled: { boolean: bool },\n    filter: { boolean: bool, function: \"function\" },\n    container: { dom },\n    __type__: { object, boolean: bool, function: \"function\" },\n  },\n\n  //globals :\n  align: { string },\n  alignCurrentTime: { string, undefined: \"undefined\" },\n  rtl: { boolean: bool, undefined: \"undefined\" },\n  rollingMode: {\n    follow: { boolean: bool },\n    offset: { number, undefined: \"undefined\" },\n    __type__: { object },\n  },\n  onTimeout: {\n    timeoutMs: { number },\n    callback: { function: \"function\" },\n    __type__: { object },\n  },\n  verticalScroll: { boolean: bool, undefined: \"undefined\" },\n  horizontalScroll: { boolean: bool, undefined: \"undefined\" },\n  horizontalScrollKey: { string: string, undefined: \"undefined\" },\n  horizontalScrollInvert: { boolean: bool, undefined: \"undefined\" },\n  autoResize: { boolean: bool },\n  throttleRedraw: { number }, // TODO: DEPRICATED see https://github.com/almende/vis/issues/2511\n  clickToUse: { boolean: bool },\n  dataAttributes: { string, array },\n  editable: {\n    add: { boolean: bool, undefined: \"undefined\" },\n    remove: { boolean: bool, undefined: \"undefined\" },\n    updateGroup: { boolean: bool, undefined: \"undefined\" },\n    updateTime: { boolean: bool, undefined: \"undefined\" },\n    overrideItems: { boolean: bool, undefined: \"undefined\" },\n    __type__: { boolean: bool, object },\n  },\n  end: { number, date, string, moment },\n  format: {\n    minorLabels: {\n      millisecond: { string, undefined: \"undefined\" },\n      second: { string, undefined: \"undefined\" },\n      minute: { string, undefined: \"undefined\" },\n      hour: { string, undefined: \"undefined\" },\n      weekday: { string, undefined: \"undefined\" },\n      day: { string, undefined: \"undefined\" },\n      week: { string, undefined: \"undefined\" },\n      month: { string, undefined: \"undefined\" },\n      year: { string, undefined: \"undefined\" },\n      __type__: { object, function: \"function\" },\n    },\n    majorLabels: {\n      millisecond: { string, undefined: \"undefined\" },\n      second: { string, undefined: \"undefined\" },\n      minute: { string, undefined: \"undefined\" },\n      hour: { string, undefined: \"undefined\" },\n      weekday: { string, undefined: \"undefined\" },\n      day: { string, undefined: \"undefined\" },\n      week: { string, undefined: \"undefined\" },\n      month: { string, undefined: \"undefined\" },\n      year: { string, undefined: \"undefined\" },\n      __type__: { object, function: \"function\" },\n    },\n    __type__: { object },\n  },\n  moment: { function: \"function\" },\n  groupHeightMode: { string },\n  groupOrder: { string, function: \"function\" },\n  groupEditable: {\n    add: { boolean: bool, undefined: \"undefined\" },\n    remove: { boolean: bool, undefined: \"undefined\" },\n    order: { boolean: bool, undefined: \"undefined\" },\n    __type__: { boolean: bool, object },\n  },\n  groupOrderSwap: { function: \"function\" },\n  height: { string, number },\n  hiddenDates: {\n    start: { date, number, string, moment },\n    end: { date, number, string, moment },\n    repeat: { string },\n    __type__: { object, array },\n  },\n  itemsAlwaysDraggable: {\n    item: { boolean: bool, undefined: \"undefined\" },\n    range: { boolean: bool, undefined: \"undefined\" },\n    __type__: { boolean: bool, object },\n  },\n  limitSize: { boolean: bool },\n  locale: { string },\n  locales: {\n    __any__: { any },\n    __type__: { object },\n  },\n  longSelectPressTime: { number },\n  margin: {\n    axis: { number },\n    item: {\n      horizontal: { number, undefined: \"undefined\" },\n      vertical: { number, undefined: \"undefined\" },\n      __type__: { object, number },\n    },\n    __type__: { object, number },\n  },\n  max: { date, number, string, moment },\n  maxHeight: { number, string },\n  maxMinorChars: { number },\n  min: { date, number, string, moment },\n  minHeight: { number, string },\n  moveable: { boolean: bool },\n  multiselect: { boolean: bool },\n  multiselectPerGroup: { boolean: bool },\n  onAdd: { function: \"function\" },\n  onDropObjectOnItem: { function: \"function\" },\n  onUpdate: { function: \"function\" },\n  onMove: { function: \"function\" },\n  onMoving: { function: \"function\" },\n  onRemove: { function: \"function\" },\n  onAddGroup: { function: \"function\" },\n  onMoveGroup: { function: \"function\" },\n  onRemoveGroup: { function: \"function\" },\n  onInitialDrawComplete: { function: \"function\" },\n  order: { function: \"function\" },\n  orientation: {\n    axis: { string, undefined: \"undefined\" },\n    item: { string, undefined: \"undefined\" },\n    __type__: { string, object },\n  },\n  selectable: { boolean: bool },\n  sequentialSelection: { boolean: bool },\n  showCurrentTime: { boolean: bool },\n  showMajorLabels: { boolean: bool },\n  showMinorLabels: { boolean: bool },\n  showWeekScale: { boolean: bool },\n  stack: { boolean: bool },\n  stackSubgroups: { boolean: bool },\n  cluster: {\n    maxItems: { number: number, undefined: \"undefined\" },\n    titleTemplate: { string: string, undefined: \"undefined\" },\n    clusterCriteria: { function: \"function\", undefined: \"undefined\" },\n    showStipes: { boolean: bool, undefined: \"undefined\" },\n    fitOnDoubleClick: { boolean: bool, undefined: \"undefined\" },\n    __type__: { boolean: bool, object },\n  },\n  snap: { function: \"function\", null: \"null\" },\n  start: { date, number, string, moment },\n  template: { function: \"function\" },\n  loadingScreenTemplate: { function: \"function\" },\n  groupTemplate: { function: \"function\" },\n  visibleFrameTemplate: { string, function: \"function\" },\n  showTooltips: { boolean: bool },\n  tooltip: {\n    followMouse: { boolean: bool },\n    overflowMethod: { string: [\"cap\", \"flip\", \"none\"] },\n    delay: { number },\n    template: { function: \"function\" },\n    __type__: { object },\n  },\n  tooltipOnItemUpdateTime: {\n    template: { function: \"function\" },\n    __type__: { boolean: bool, object },\n  },\n  timeAxis: {\n    scale: { string, undefined: \"undefined\" },\n    step: { number, undefined: \"undefined\" },\n    __type__: { object },\n  },\n  type: { string },\n  width: { string, number },\n  preferZoom: { boolean: bool },\n  zoomable: { boolean: bool },\n  zoomKey: { string: [\"ctrlKey\", \"altKey\", \"shiftKey\", \"metaKey\", \"\"] },\n  zoomFriction: { number },\n  zoomMax: { number },\n  zoomMin: { number },\n  xss: {\n    disabled: { boolean: bool },\n    filterOptions: {\n      __any__: { any },\n      __type__: { object },\n    },\n    __type__: { object },\n  },\n  __type__: { object },\n};\n\nlet configureOptions = {\n  global: {\n    align: [\"center\", \"left\", \"right\"],\n    alignCurrentTime: [\n      \"none\",\n      \"year\",\n      \"month\",\n      \"quarter\",\n      \"week\",\n      \"isoWeek\",\n      \"day\",\n      \"date\",\n      \"hour\",\n      \"minute\",\n      \"second\",\n    ],\n    direction: false,\n    autoResize: true,\n    clickToUse: false,\n    // dataAttributes: ['all'], // FIXME: can be 'all' or string[]\n    editable: {\n      add: false,\n      remove: false,\n      updateGroup: false,\n      updateTime: false,\n    },\n    end: \"\",\n    format: {\n      minorLabels: {\n        millisecond: \"SSS\",\n        second: \"s\",\n        minute: \"HH:mm\",\n        hour: \"HH:mm\",\n        weekday: \"ddd D\",\n        day: \"D\",\n        week: \"w\",\n        month: \"MMM\",\n        year: \"YYYY\",\n      },\n      majorLabels: {\n        millisecond: \"HH:mm:ss\",\n        second: \"D MMMM HH:mm\",\n        minute: \"ddd D MMMM\",\n        hour: \"ddd D MMMM\",\n        weekday: \"MMMM YYYY\",\n        day: \"MMMM YYYY\",\n        week: \"MMMM YYYY\",\n        month: \"YYYY\",\n        year: \"\",\n      },\n    },\n    groupHeightMode: [\"auto\", \"fixed\", \"fitItems\"],\n    //groupOrder: {string, 'function': 'function'},\n    groupsDraggable: false,\n    height: \"\",\n    //hiddenDates: {object, array},\n    locale: \"\",\n    longSelectPressTime: 251,\n    margin: {\n      axis: [20, 0, 100, 1],\n      item: {\n        horizontal: [10, 0, 100, 1],\n        vertical: [10, 0, 100, 1],\n      },\n    },\n    max: \"\",\n    maxHeight: \"\",\n    maxMinorChars: [7, 0, 20, 1],\n    min: \"\",\n    minHeight: \"\",\n    moveable: false,\n    multiselect: false,\n    multiselectPerGroup: false,\n    //onAdd: {'function': 'function'},\n    //onUpdate: {'function': 'function'},\n    //onMove: {'function': 'function'},\n    //onMoving: {'function': 'function'},\n    //onRename: {'function': 'function'},\n    //order: {'function': 'function'},\n    orientation: {\n      axis: [\"both\", \"bottom\", \"top\"],\n      item: [\"bottom\", \"top\"],\n    },\n    preferZoom: false,\n    selectable: true,\n    showCurrentTime: false,\n    showMajorLabels: true,\n    showMinorLabels: true,\n    stack: true,\n    stackSubgroups: true,\n    cluster: false,\n    //snap: {'function': 'function', nada},\n    start: \"\",\n    //template: {'function': 'function'},\n    //timeAxis: {\n    //  scale: ['millisecond', 'second', 'minute', 'hour', 'weekday', 'day', 'week', 'month', 'year'],\n    //  step: [1, 1, 10, 1]\n    //},\n    showTooltips: true,\n    tooltip: {\n      followMouse: false,\n      overflowMethod: \"flip\",\n      delay: [500, 0, 99999, 100],\n    },\n    tooltipOnItemUpdateTime: false,\n    type: [\"box\", \"point\", \"range\", \"background\"],\n    width: \"100%\",\n    zoomable: true,\n    zoomKey: [\"ctrlKey\", \"altKey\", \"shiftKey\", \"metaKey\", \"\"],\n    zoomMax: [315360000000000, 10, 315360000000000, 1],\n    zoomMin: [10, 10, 315360000000000, 1],\n    xss: { disabled: false },\n  },\n};\n\nexport { allOptions, configureOptions };\n","import Hammer from \"../module/hammer.js\";\nimport * as hammerUtil from \"../hammerUtil.js\";\nimport util from \"../util.js\";\n\nvar htmlColors = {\n  black: \"#000000\",\n  navy: \"#000080\",\n  darkblue: \"#00008B\",\n  mediumblue: \"#0000CD\",\n  blue: \"#0000FF\",\n  darkgreen: \"#006400\",\n  green: \"#008000\",\n  teal: \"#008080\",\n  darkcyan: \"#008B8B\",\n  deepskyblue: \"#00BFFF\",\n  darkturquoise: \"#00CED1\",\n  mediumspringgreen: \"#00FA9A\",\n  lime: \"#00FF00\",\n  springgreen: \"#00FF7F\",\n  aqua: \"#00FFFF\",\n  cyan: \"#00FFFF\",\n  midnightblue: \"#191970\",\n  dodgerblue: \"#1E90FF\",\n  lightseagreen: \"#20B2AA\",\n  forestgreen: \"#228B22\",\n  seagreen: \"#2E8B57\",\n  darkslategray: \"#2F4F4F\",\n  limegreen: \"#32CD32\",\n  mediumseagreen: \"#3CB371\",\n  turquoise: \"#40E0D0\",\n  royalblue: \"#4169E1\",\n  steelblue: \"#4682B4\",\n  darkslateblue: \"#483D8B\",\n  mediumturquoise: \"#48D1CC\",\n  indigo: \"#4B0082\",\n  darkolivegreen: \"#556B2F\",\n  cadetblue: \"#5F9EA0\",\n  cornflowerblue: \"#6495ED\",\n  mediumaquamarine: \"#66CDAA\",\n  dimgray: \"#696969\",\n  slateblue: \"#6A5ACD\",\n  olivedrab: \"#6B8E23\",\n  slategray: \"#708090\",\n  lightslategray: \"#778899\",\n  mediumslateblue: \"#7B68EE\",\n  lawngreen: \"#7CFC00\",\n  chartreuse: \"#7FFF00\",\n  aquamarine: \"#7FFFD4\",\n  maroon: \"#800000\",\n  purple: \"#800080\",\n  olive: \"#808000\",\n  gray: \"#808080\",\n  skyblue: \"#87CEEB\",\n  lightskyblue: \"#87CEFA\",\n  blueviolet: \"#8A2BE2\",\n  darkred: \"#8B0000\",\n  darkmagenta: \"#8B008B\",\n  saddlebrown: \"#8B4513\",\n  darkseagreen: \"#8FBC8F\",\n  lightgreen: \"#90EE90\",\n  mediumpurple: \"#9370D8\",\n  darkviolet: \"#9400D3\",\n  palegreen: \"#98FB98\",\n  darkorchid: \"#9932CC\",\n  yellowgreen: \"#9ACD32\",\n  sienna: \"#A0522D\",\n  brown: \"#A52A2A\",\n  darkgray: \"#A9A9A9\",\n  lightblue: \"#ADD8E6\",\n  greenyellow: \"#ADFF2F\",\n  paleturquoise: \"#AFEEEE\",\n  lightsteelblue: \"#B0C4DE\",\n  powderblue: \"#B0E0E6\",\n  firebrick: \"#B22222\",\n  darkgoldenrod: \"#B8860B\",\n  mediumorchid: \"#BA55D3\",\n  rosybrown: \"#BC8F8F\",\n  darkkhaki: \"#BDB76B\",\n  silver: \"#C0C0C0\",\n  mediumvioletred: \"#C71585\",\n  indianred: \"#CD5C5C\",\n  peru: \"#CD853F\",\n  chocolate: \"#D2691E\",\n  tan: \"#D2B48C\",\n  lightgrey: \"#D3D3D3\",\n  palevioletred: \"#D87093\",\n  thistle: \"#D8BFD8\",\n  orchid: \"#DA70D6\",\n  goldenrod: \"#DAA520\",\n  crimson: \"#DC143C\",\n  gainsboro: \"#DCDCDC\",\n  plum: \"#DDA0DD\",\n  burlywood: \"#DEB887\",\n  lightcyan: \"#E0FFFF\",\n  lavender: \"#E6E6FA\",\n  darksalmon: \"#E9967A\",\n  violet: \"#EE82EE\",\n  palegoldenrod: \"#EEE8AA\",\n  lightcoral: \"#F08080\",\n  khaki: \"#F0E68C\",\n  aliceblue: \"#F0F8FF\",\n  honeydew: \"#F0FFF0\",\n  azure: \"#F0FFFF\",\n  sandybrown: \"#F4A460\",\n  wheat: \"#F5DEB3\",\n  beige: \"#F5F5DC\",\n  whitesmoke: \"#F5F5F5\",\n  mintcream: \"#F5FFFA\",\n  ghostwhite: \"#F8F8FF\",\n  salmon: \"#FA8072\",\n  antiquewhite: \"#FAEBD7\",\n  linen: \"#FAF0E6\",\n  lightgoldenrodyellow: \"#FAFAD2\",\n  oldlace: \"#FDF5E6\",\n  red: \"#FF0000\",\n  fuchsia: \"#FF00FF\",\n  magenta: \"#FF00FF\",\n  deeppink: \"#FF1493\",\n  orangered: \"#FF4500\",\n  tomato: \"#FF6347\",\n  hotpink: \"#FF69B4\",\n  coral: \"#FF7F50\",\n  darkorange: \"#FF8C00\",\n  lightsalmon: \"#FFA07A\",\n  orange: \"#FFA500\",\n  lightpink: \"#FFB6C1\",\n  pink: \"#FFC0CB\",\n  gold: \"#FFD700\",\n  peachpuff: \"#FFDAB9\",\n  navajowhite: \"#FFDEAD\",\n  moccasin: \"#FFE4B5\",\n  bisque: \"#FFE4C4\",\n  mistyrose: \"#FFE4E1\",\n  blanchedalmond: \"#FFEBCD\",\n  papayawhip: \"#FFEFD5\",\n  lavenderblush: \"#FFF0F5\",\n  seashell: \"#FFF5EE\",\n  cornsilk: \"#FFF8DC\",\n  lemonchiffon: \"#FFFACD\",\n  floralwhite: \"#FFFAF0\",\n  snow: \"#FFFAFA\",\n  yellow: \"#FFFF00\",\n  lightyellow: \"#FFFFE0\",\n  ivory: \"#FFFFF0\",\n  white: \"#FFFFFF\",\n};\n\n/**\n * @param {number} [pixelRatio=1]\n */\nclass ColorPicker {\n  /**\n   * @param {number} [pixelRatio=1]\n   */\n  constructor(pixelRatio = 1) {\n    this.pixelRatio = pixelRatio;\n    this.generated = false;\n    this.centerCoordinates = { x: 289 / 2, y: 289 / 2 };\n    this.r = 289 * 0.49;\n    this.color = { r: 255, g: 255, b: 255, a: 1.0 };\n    this.hueCircle = undefined;\n    this.initialColor = { r: 255, g: 255, b: 255, a: 1.0 };\n    this.previousColor = undefined;\n    this.applied = false;\n\n    // bound by\n    this.updateCallback = () => {};\n    this.closeCallback = () => {};\n\n    // create all DOM elements\n    this._create();\n  }\n\n  /**\n   * this inserts the colorPicker into a div from the DOM\n   * @param {Element} container\n   */\n  insertTo(container) {\n    if (this.hammer !== undefined) {\n      this.hammer.destroy();\n      this.hammer = undefined;\n    }\n    this.container = container;\n    this.container.appendChild(this.frame);\n    this._bindHammer();\n\n    this._setSize();\n  }\n\n  /**\n   * the callback is executed on apply and save. Bind it to the application\n   * @param {function} callback\n   */\n  setUpdateCallback(callback) {\n    if (typeof callback === \"function\") {\n      this.updateCallback = callback;\n    } else {\n      throw new Error(\n        \"Function attempted to set as colorPicker update callback is not a function.\",\n      );\n    }\n  }\n\n  /**\n   * the callback is executed on apply and save. Bind it to the application\n   * @param {function} callback\n   */\n  setCloseCallback(callback) {\n    if (typeof callback === \"function\") {\n      this.closeCallback = callback;\n    } else {\n      throw new Error(\n        \"Function attempted to set as colorPicker closing callback is not a function.\",\n      );\n    }\n  }\n\n  /**\n   *\n   * @param {string} color\n   * @returns {String}\n   * @private\n   */\n  _isColorString(color) {\n    if (typeof color === \"string\") {\n      return htmlColors[color];\n    }\n  }\n\n  /**\n   * Set the color of the colorPicker\n   * Supported formats:\n   * 'red'                   --> HTML color string\n   * '#ffffff'               --> hex string\n   * 'rgb(255,255,255)'      --> rgb string\n   * 'rgba(255,255,255,1.0)' --> rgba string\n   * {r:255,g:255,b:255}     --> rgb object\n   * {r:255,g:255,b:255,a:1.0} --> rgba object\n   * @param {string|Object} color\n   * @param {boolean} [setInitial=true]\n   */\n  setColor(color, setInitial = true) {\n    if (color === \"none\") {\n      return;\n    }\n\n    let rgba;\n\n    // if a html color shorthand is used, convert to hex\n    var htmlColor = this._isColorString(color);\n    if (htmlColor !== undefined) {\n      color = htmlColor;\n    }\n\n    // check format\n    if (util.isString(color) === true) {\n      if (util.isValidRGB(color) === true) {\n        let rgbaArray = color\n          .substr(4)\n          .substr(0, color.length - 5)\n          .split(\",\");\n        rgba = { r: rgbaArray[0], g: rgbaArray[1], b: rgbaArray[2], a: 1.0 };\n      } else if (util.isValidRGBA(color) === true) {\n        let rgbaArray = color\n          .substr(5)\n          .substr(0, color.length - 6)\n          .split(\",\");\n        rgba = {\n          r: rgbaArray[0],\n          g: rgbaArray[1],\n          b: rgbaArray[2],\n          a: rgbaArray[3],\n        };\n      } else if (util.isValidHex(color) === true) {\n        let rgbObj = util.hexToRGB(color);\n        rgba = { r: rgbObj.r, g: rgbObj.g, b: rgbObj.b, a: 1.0 };\n      }\n    } else {\n      if (color instanceof Object) {\n        if (\n          color.r !== undefined &&\n          color.g !== undefined &&\n          color.b !== undefined\n        ) {\n          let alpha = color.a !== undefined ? color.a : \"1.0\";\n          rgba = { r: color.r, g: color.g, b: color.b, a: alpha };\n        }\n      }\n    }\n\n    // set color\n    if (rgba === undefined) {\n      throw new Error(\n        \"Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: \" +\n          JSON.stringify(color),\n      );\n    } else {\n      this._setColor(rgba, setInitial);\n    }\n  }\n\n  /**\n   * this shows the color picker.\n   * The hue circle is constructed once and stored.\n   */\n  show() {\n    if (this.closeCallback !== undefined) {\n      this.closeCallback();\n      this.closeCallback = undefined;\n    }\n\n    this.applied = false;\n    this.frame.style.display = \"block\";\n    this._generateHueCircle();\n  }\n\n  // ------------------------------------------ PRIVATE ----------------------------- //\n\n  /**\n   * Hide the picker. Is called by the cancel button.\n   * Optional boolean to store the previous color for easy access later on.\n   * @param {boolean} [storePrevious=true]\n   * @private\n   */\n  _hide(storePrevious = true) {\n    // store the previous color for next time;\n    if (storePrevious === true) {\n      this.previousColor = util.extend({}, this.color);\n    }\n\n    if (this.applied === true) {\n      this.updateCallback(this.initialColor);\n    }\n\n    this.frame.style.display = \"none\";\n\n    // call the closing callback, restoring the onclick method.\n    // this is in a setTimeout because it will trigger the show again before the click is done.\n    setTimeout(() => {\n      if (this.closeCallback !== undefined) {\n        this.closeCallback();\n        this.closeCallback = undefined;\n      }\n    }, 0);\n  }\n\n  /**\n   * bound to the save button. Saves and hides.\n   * @private\n   */\n  _save() {\n    this.updateCallback(this.color);\n    this.applied = false;\n    this._hide();\n  }\n\n  /**\n   * Bound to apply button. Saves but does not close. Is undone by the cancel button.\n   * @private\n   */\n  _apply() {\n    this.applied = true;\n    this.updateCallback(this.color);\n    this._updatePicker(this.color);\n  }\n\n  /**\n   * load the color from the previous session.\n   * @private\n   */\n  _loadLast() {\n    if (this.previousColor !== undefined) {\n      this.setColor(this.previousColor, false);\n    } else {\n      alert(\"There is no last color to load...\");\n    }\n  }\n\n  /**\n   * set the color, place the picker\n   * @param {Object} rgba\n   * @param {boolean} [setInitial=true]\n   * @private\n   */\n  _setColor(rgba, setInitial = true) {\n    // store the initial color\n    if (setInitial === true) {\n      this.initialColor = util.extend({}, rgba);\n    }\n\n    this.color = rgba;\n    let hsv = util.RGBToHSV(rgba.r, rgba.g, rgba.b);\n\n    let angleConvert = 2 * Math.PI;\n    let radius = this.r * hsv.s;\n    let x = this.centerCoordinates.x + radius * Math.sin(angleConvert * hsv.h);\n    let y = this.centerCoordinates.y + radius * Math.cos(angleConvert * hsv.h);\n\n    this.colorPickerSelector.style.left =\n      x - 0.5 * this.colorPickerSelector.clientWidth + \"px\";\n    this.colorPickerSelector.style.top =\n      y - 0.5 * this.colorPickerSelector.clientHeight + \"px\";\n\n    this._updatePicker(rgba);\n  }\n\n  /**\n   * bound to opacity control\n   * @param {number} value\n   * @private\n   */\n  _setOpacity(value) {\n    this.color.a = value / 100;\n    this._updatePicker(this.color);\n  }\n\n  /**\n   * bound to brightness control\n   * @param {number} value\n   * @private\n   */\n  _setBrightness(value) {\n    let hsv = util.RGBToHSV(this.color.r, this.color.g, this.color.b);\n    hsv.v = value / 100;\n    let rgba = util.HSVToRGB(hsv.h, hsv.s, hsv.v);\n    rgba[\"a\"] = this.color.a;\n    this.color = rgba;\n    this._updatePicker();\n  }\n\n  /**\n   * update the color picker. A black circle overlays the hue circle to mimic the brightness decreasing.\n   * @param {Object} rgba\n   * @private\n   */\n  _updatePicker(rgba = this.color) {\n    let hsv = util.RGBToHSV(rgba.r, rgba.g, rgba.b);\n    let ctx = this.colorPickerCanvas.getContext(\"2d\");\n    if (this.pixelRation === undefined) {\n      this.pixelRatio =\n        (window.devicePixelRatio || 1) /\n        (ctx.webkitBackingStorePixelRatio ||\n          ctx.mozBackingStorePixelRatio ||\n          ctx.msBackingStorePixelRatio ||\n          ctx.oBackingStorePixelRatio ||\n          ctx.backingStorePixelRatio ||\n          1);\n    }\n    ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n\n    // clear the canvas\n    let w = this.colorPickerCanvas.clientWidth;\n    let h = this.colorPickerCanvas.clientHeight;\n    ctx.clearRect(0, 0, w, h);\n\n    ctx.putImageData(this.hueCircle, 0, 0);\n    ctx.fillStyle = \"rgba(0,0,0,\" + (1 - hsv.v) + \")\";\n    ctx.circle(this.centerCoordinates.x, this.centerCoordinates.y, this.r);\n    ctx.fill();\n\n    this.brightnessRange.value = 100 * hsv.v;\n    this.opacityRange.value = 100 * rgba.a;\n\n    this.initialColorDiv.style.backgroundColor =\n      \"rgba(\" +\n      this.initialColor.r +\n      \",\" +\n      this.initialColor.g +\n      \",\" +\n      this.initialColor.b +\n      \",\" +\n      this.initialColor.a +\n      \")\";\n    this.newColorDiv.style.backgroundColor =\n      \"rgba(\" +\n      this.color.r +\n      \",\" +\n      this.color.g +\n      \",\" +\n      this.color.b +\n      \",\" +\n      this.color.a +\n      \")\";\n  }\n\n  /**\n   * used by create to set the size of the canvas.\n   * @private\n   */\n  _setSize() {\n    this.colorPickerCanvas.style.width = \"100%\";\n    this.colorPickerCanvas.style.height = \"100%\";\n\n    this.colorPickerCanvas.width = 289 * this.pixelRatio;\n    this.colorPickerCanvas.height = 289 * this.pixelRatio;\n  }\n\n  /**\n   * create all dom elements\n   * TODO: cleanup, lots of similar dom elements\n   * @private\n   */\n  _create() {\n    this.frame = document.createElement(\"div\");\n    this.frame.className = \"vis-color-picker\";\n\n    this.colorPickerDiv = document.createElement(\"div\");\n    this.colorPickerSelector = document.createElement(\"div\");\n    this.colorPickerSelector.className = \"vis-selector\";\n    this.colorPickerDiv.appendChild(this.colorPickerSelector);\n\n    this.colorPickerCanvas = document.createElement(\"canvas\");\n    this.colorPickerDiv.appendChild(this.colorPickerCanvas);\n\n    if (!this.colorPickerCanvas.getContext) {\n      let noCanvas = document.createElement(\"DIV\");\n      noCanvas.style.color = \"red\";\n      noCanvas.style.fontWeight = \"bold\";\n      noCanvas.style.padding = \"10px\";\n      noCanvas.innerHTML = \"Error: your browser does not support HTML canvas\";\n      this.colorPickerCanvas.appendChild(noCanvas);\n    } else {\n      let ctx = this.colorPickerCanvas.getContext(\"2d\");\n      this.pixelRatio =\n        (window.devicePixelRatio || 1) /\n        (ctx.webkitBackingStorePixelRatio ||\n          ctx.mozBackingStorePixelRatio ||\n          ctx.msBackingStorePixelRatio ||\n          ctx.oBackingStorePixelRatio ||\n          ctx.backingStorePixelRatio ||\n          1);\n      this.colorPickerCanvas\n        .getContext(\"2d\")\n        .setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n    }\n\n    this.colorPickerDiv.className = \"vis-color\";\n\n    this.opacityDiv = document.createElement(\"div\");\n    this.opacityDiv.className = \"vis-opacity\";\n\n    this.brightnessDiv = document.createElement(\"div\");\n    this.brightnessDiv.className = \"vis-brightness\";\n\n    this.arrowDiv = document.createElement(\"div\");\n    this.arrowDiv.className = \"vis-arrow\";\n\n    this.opacityRange = document.createElement(\"input\");\n    try {\n      this.opacityRange.type = \"range\"; // Not supported on IE9\n      this.opacityRange.min = \"0\";\n      this.opacityRange.max = \"100\";\n    } catch (err) {\n      // TODO: Add some error handling and remove this lint exception\n    } // eslint-disable-line no-empty\n    this.opacityRange.value = \"100\";\n    this.opacityRange.className = \"vis-range\";\n\n    this.brightnessRange = document.createElement(\"input\");\n    try {\n      this.brightnessRange.type = \"range\"; // Not supported on IE9\n      this.brightnessRange.min = \"0\";\n      this.brightnessRange.max = \"100\";\n    } catch (err) {\n      // TODO: Add some error handling and remove this lint exception\n    } // eslint-disable-line no-empty\n    this.brightnessRange.value = \"100\";\n    this.brightnessRange.className = \"vis-range\";\n\n    this.opacityDiv.appendChild(this.opacityRange);\n    this.brightnessDiv.appendChild(this.brightnessRange);\n\n    var me = this;\n    this.opacityRange.onchange = function () {\n      me._setOpacity(this.value);\n    };\n    this.opacityRange.oninput = function () {\n      me._setOpacity(this.value);\n    };\n    this.brightnessRange.onchange = function () {\n      me._setBrightness(this.value);\n    };\n    this.brightnessRange.oninput = function () {\n      me._setBrightness(this.value);\n    };\n\n    this.brightnessLabel = document.createElement(\"div\");\n    this.brightnessLabel.className = \"vis-label vis-brightness\";\n    this.brightnessLabel.innerHTML = \"brightness:\";\n\n    this.opacityLabel = document.createElement(\"div\");\n    this.opacityLabel.className = \"vis-label vis-opacity\";\n    this.opacityLabel.innerHTML = \"opacity:\";\n\n    this.newColorDiv = document.createElement(\"div\");\n    this.newColorDiv.className = \"vis-new-color\";\n    this.newColorDiv.innerHTML = \"new\";\n\n    this.initialColorDiv = document.createElement(\"div\");\n    this.initialColorDiv.className = \"vis-initial-color\";\n    this.initialColorDiv.innerHTML = \"initial\";\n\n    this.cancelButton = document.createElement(\"div\");\n    this.cancelButton.className = \"vis-button vis-cancel\";\n    this.cancelButton.innerHTML = \"cancel\";\n    this.cancelButton.onclick = this._hide.bind(this, false);\n\n    this.applyButton = document.createElement(\"div\");\n    this.applyButton.className = \"vis-button vis-apply\";\n    this.applyButton.innerHTML = \"apply\";\n    this.applyButton.onclick = this._apply.bind(this);\n\n    this.saveButton = document.createElement(\"div\");\n    this.saveButton.className = \"vis-button vis-save\";\n    this.saveButton.innerHTML = \"save\";\n    this.saveButton.onclick = this._save.bind(this);\n\n    this.loadButton = document.createElement(\"div\");\n    this.loadButton.className = \"vis-button vis-load\";\n    this.loadButton.innerHTML = \"load last\";\n    this.loadButton.onclick = this._loadLast.bind(this);\n\n    this.frame.appendChild(this.colorPickerDiv);\n    this.frame.appendChild(this.arrowDiv);\n    this.frame.appendChild(this.brightnessLabel);\n    this.frame.appendChild(this.brightnessDiv);\n    this.frame.appendChild(this.opacityLabel);\n    this.frame.appendChild(this.opacityDiv);\n    this.frame.appendChild(this.newColorDiv);\n    this.frame.appendChild(this.initialColorDiv);\n\n    this.frame.appendChild(this.cancelButton);\n    this.frame.appendChild(this.applyButton);\n    this.frame.appendChild(this.saveButton);\n    this.frame.appendChild(this.loadButton);\n  }\n\n  /**\n   * bind hammer to the color picker\n   * @private\n   */\n  _bindHammer() {\n    this.drag = {};\n    this.pinch = {};\n    this.hammer = new Hammer(this.colorPickerCanvas);\n    this.hammer.get(\"pinch\").set({ enable: true });\n\n    hammerUtil.onTouch(this.hammer, (event) => {\n      this._moveSelector(event);\n    });\n    this.hammer.on(\"tap\", (event) => {\n      this._moveSelector(event);\n    });\n    this.hammer.on(\"panstart\", (event) => {\n      this._moveSelector(event);\n    });\n    this.hammer.on(\"panmove\", (event) => {\n      this._moveSelector(event);\n    });\n    this.hammer.on(\"panend\", (event) => {\n      this._moveSelector(event);\n    });\n  }\n\n  /**\n   * generate the hue circle. This is relatively heavy (200ms) and is done only once on the first time it is shown.\n   * @private\n   */\n  _generateHueCircle() {\n    if (this.generated === false) {\n      let ctx = this.colorPickerCanvas.getContext(\"2d\");\n      if (this.pixelRation === undefined) {\n        this.pixelRatio =\n          (window.devicePixelRatio || 1) /\n          (ctx.webkitBackingStorePixelRatio ||\n            ctx.mozBackingStorePixelRatio ||\n            ctx.msBackingStorePixelRatio ||\n            ctx.oBackingStorePixelRatio ||\n            ctx.backingStorePixelRatio ||\n            1);\n      }\n      ctx.setTransform(this.pixelRatio, 0, 0, this.pixelRatio, 0, 0);\n\n      // clear the canvas\n      let w = this.colorPickerCanvas.clientWidth;\n      let h = this.colorPickerCanvas.clientHeight;\n      ctx.clearRect(0, 0, w, h);\n\n      // draw hue circle\n      let x, y, hue, sat;\n      this.centerCoordinates = { x: w * 0.5, y: h * 0.5 };\n      this.r = 0.49 * w;\n      let angleConvert = (2 * Math.PI) / 360;\n      let hfac = 1 / 360;\n      let sfac = 1 / this.r;\n      let rgb;\n      for (hue = 0; hue < 360; hue++) {\n        for (sat = 0; sat < this.r; sat++) {\n          x = this.centerCoordinates.x + sat * Math.sin(angleConvert * hue);\n          y = this.centerCoordinates.y + sat * Math.cos(angleConvert * hue);\n          rgb = util.HSVToRGB(hue * hfac, sat * sfac, 1);\n          ctx.fillStyle = \"rgb(\" + rgb.r + \",\" + rgb.g + \",\" + rgb.b + \")\";\n          ctx.fillRect(x - 0.5, y - 0.5, 2, 2);\n        }\n      }\n      ctx.strokeStyle = \"rgba(0,0,0,1)\";\n      ctx.circle(this.centerCoordinates.x, this.centerCoordinates.y, this.r);\n      ctx.stroke();\n\n      this.hueCircle = ctx.getImageData(0, 0, w, h);\n    }\n    this.generated = true;\n  }\n\n  /**\n   * move the selector. This is called by hammer functions.\n   *\n   * @param {Event}  event   The event\n   * @private\n   */\n  _moveSelector(event) {\n    let rect = this.colorPickerDiv.getBoundingClientRect();\n    let left = event.center.x - rect.left;\n    let top = event.center.y - rect.top;\n\n    let centerY = 0.5 * this.colorPickerDiv.clientHeight;\n    let centerX = 0.5 * this.colorPickerDiv.clientWidth;\n\n    let x = left - centerX;\n    let y = top - centerY;\n\n    let angle = Math.atan2(x, y);\n    let radius = 0.98 * Math.min(Math.sqrt(x * x + y * y), centerX);\n\n    let newTop = Math.cos(angle) * radius + centerY;\n    let newLeft = Math.sin(angle) * radius + centerX;\n\n    this.colorPickerSelector.style.top =\n      newTop - 0.5 * this.colorPickerSelector.clientHeight + \"px\";\n    this.colorPickerSelector.style.left =\n      newLeft - 0.5 * this.colorPickerSelector.clientWidth + \"px\";\n\n    // set color\n    let h = angle / (2 * Math.PI);\n    h = h < 0 ? h + 1 : h;\n    let s = radius / this.r;\n    let hsv = util.RGBToHSV(this.color.r, this.color.g, this.color.b);\n    hsv.h = h;\n    hsv.s = s;\n    let rgba = util.HSVToRGB(hsv.h, hsv.s, hsv.v);\n    rgba[\"a\"] = this.color.a;\n    this.color = rgba;\n\n    // update previews\n    this.initialColorDiv.style.backgroundColor =\n      \"rgba(\" +\n      this.initialColor.r +\n      \",\" +\n      this.initialColor.g +\n      \",\" +\n      this.initialColor.b +\n      \",\" +\n      this.initialColor.a +\n      \")\";\n    this.newColorDiv.style.backgroundColor =\n      \"rgba(\" +\n      this.color.r +\n      \",\" +\n      this.color.g +\n      \",\" +\n      this.color.b +\n      \",\" +\n      this.color.a +\n      \")\";\n  }\n}\n\nexport default ColorPicker;\n","import util from \"../util.js\";\nimport ColorPicker from \"./ColorPicker.js\";\n\n/**\n * The way this works is for all properties of this.possible options, you can supply the property name in any form to list the options.\n * Boolean options are recognised as Boolean\n * Number options should be written as array: [default value, min value, max value, stepsize]\n * Colors should be written as array: ['color', '#ffffff']\n * Strings with should be written as array: [option1, option2, option3, ..]\n *\n * The options are matched with their counterparts in each of the modules and the values used in the configuration are\n */\nclass Configurator {\n  /**\n   * @param {Object} parentModule        | the location where parentModule.setOptions() can be called\n   * @param {Object} defaultContainer    | the default container of the module\n   * @param {Object} configureOptions    | the fully configured and predefined options set found in allOptions.js\n   * @param {number} pixelRatio          | canvas pixel ratio\n   */\n  constructor(\n    parentModule,\n    defaultContainer,\n    configureOptions,\n    pixelRatio = 1,\n  ) {\n    this.parent = parentModule;\n    this.changedOptions = [];\n    this.container = defaultContainer;\n    this.allowCreation = false;\n\n    this.options = {};\n    this.initialized = false;\n    this.popupCounter = 0;\n    this.defaultOptions = {\n      enabled: false,\n      filter: true,\n      container: undefined,\n      showButton: true,\n    };\n    util.extend(this.options, this.defaultOptions);\n\n    this.configureOptions = configureOptions;\n    this.moduleOptions = {};\n    this.domElements = [];\n    this.popupDiv = {};\n    this.popupLimit = 5;\n    this.popupHistory = {};\n    this.colorPicker = new ColorPicker(pixelRatio);\n    this.wrapper = undefined;\n  }\n\n  /**\n   * refresh all options.\n   * Because all modules parse their options by themselves, we just use their options. We copy them here.\n   *\n   * @param {Object} options\n   */\n  setOptions(options) {\n    if (options !== undefined) {\n      // reset the popup history because the indices may have been changed.\n      this.popupHistory = {};\n      this._removePopup();\n\n      let enabled = true;\n      if (typeof options === \"string\") {\n        this.options.filter = options;\n      } else if (Array.isArray(options)) {\n        this.options.filter = options.join();\n      } else if (typeof options === \"object\") {\n        if (options == null) {\n          throw new TypeError(\"options cannot be null\");\n        }\n        if (options.container !== undefined) {\n          this.options.container = options.container;\n        }\n        if (options.filter !== undefined) {\n          this.options.filter = options.filter;\n        }\n        if (options.showButton !== undefined) {\n          this.options.showButton = options.showButton;\n        }\n        if (options.enabled !== undefined) {\n          enabled = options.enabled;\n        }\n      } else if (typeof options === \"boolean\") {\n        this.options.filter = true;\n        enabled = options;\n      } else if (typeof options === \"function\") {\n        this.options.filter = options;\n        enabled = true;\n      }\n      if (this.options.filter === false) {\n        enabled = false;\n      }\n\n      this.options.enabled = enabled;\n    }\n    this._clean();\n  }\n\n  /**\n   *\n   * @param {Object} moduleOptions\n   */\n  setModuleOptions(moduleOptions) {\n    this.moduleOptions = moduleOptions;\n    if (this.options.enabled === true) {\n      this._clean();\n      if (this.options.container !== undefined) {\n        this.container = this.options.container;\n      }\n      this._create();\n    }\n  }\n\n  /**\n   * Create all DOM elements\n   * @private\n   */\n  _create() {\n    this._clean();\n    this.changedOptions = [];\n\n    let filter = this.options.filter;\n    let counter = 0;\n    let show = false;\n    for (let option in this.configureOptions) {\n      if (!Object.prototype.hasOwnProperty.call(this.configureOptions, option))\n        continue;\n\n      this.allowCreation = false;\n      show = false;\n\n      if (typeof filter === \"function\") {\n        show = filter(option, []);\n        show =\n          show ||\n          this._handleObject(this.configureOptions[option], [option], true);\n      } else if (filter === true || filter.indexOf(option) !== -1) {\n        show = true;\n      }\n\n      if (show !== false) {\n        this.allowCreation = true;\n\n        // linebreak between categories\n        if (counter > 0) {\n          this._makeItem([]);\n        }\n        // a header for the category\n        this._makeHeader(option);\n\n        // get the sub options\n        this._handleObject(this.configureOptions[option], [option]);\n      }\n\n      counter++;\n    }\n    this._makeButton();\n    this._push();\n    //~ this.colorPicker.insertTo(this.container);\n  }\n\n  /**\n   * draw all DOM elements on the screen\n   * @private\n   */\n  _push() {\n    this.wrapper = document.createElement(\"div\");\n    this.wrapper.className = \"vis-configuration-wrapper\";\n    this.container.appendChild(this.wrapper);\n    for (var i = 0; i < this.domElements.length; i++) {\n      this.wrapper.appendChild(this.domElements[i]);\n    }\n\n    this._showPopupIfNeeded();\n  }\n\n  /**\n   * delete all DOM elements\n   * @private\n   */\n  _clean() {\n    for (var i = 0; i < this.domElements.length; i++) {\n      this.wrapper.removeChild(this.domElements[i]);\n    }\n\n    if (this.wrapper !== undefined) {\n      this.container.removeChild(this.wrapper);\n      this.wrapper = undefined;\n    }\n    this.domElements = [];\n\n    this._removePopup();\n  }\n\n  /**\n   * get the value from the actualOptions if it exists\n   * @param {array} path    | where to look for the actual option\n   * @returns {*}\n   * @private\n   */\n  _getValue(path) {\n    let base = this.moduleOptions;\n    for (let i = 0; i < path.length; i++) {\n      if (base[path[i]] !== undefined) {\n        base = base[path[i]];\n      } else {\n        base = undefined;\n        break;\n      }\n    }\n    return base;\n  }\n\n  /**\n   * all option elements are wrapped in an item\n   * @param {Array} path    | where to look for the actual option\n   * @param {Array.<Element>} domElements\n   * @returns {number}\n   * @private\n   */\n  _makeItem(path, ...domElements) {\n    if (this.allowCreation === true) {\n      let item = document.createElement(\"div\");\n      item.className =\n        \"vis-configuration vis-config-item vis-config-s\" + path.length;\n      domElements.forEach((element) => {\n        item.appendChild(element);\n      });\n      this.domElements.push(item);\n      return this.domElements.length;\n    }\n    return 0;\n  }\n\n  /**\n   * header for major subjects\n   * @param {string} name\n   * @private\n   */\n  _makeHeader(name) {\n    let div = document.createElement(\"div\");\n    div.className = \"vis-configuration vis-config-header\";\n    div.innerHTML = util.xss(name);\n    this._makeItem([], div);\n  }\n\n  /**\n   * make a label, if it is an object label, it gets different styling.\n   * @param {string} name\n   * @param {array} path    | where to look for the actual option\n   * @param {string} objectLabel\n   * @returns {HTMLElement}\n   * @private\n   */\n  _makeLabel(name, path, objectLabel = false) {\n    let div = document.createElement(\"div\");\n    div.className =\n      \"vis-configuration vis-config-label vis-config-s\" + path.length;\n    if (objectLabel === true) {\n      div.innerHTML = util.xss(\"<i><b>\" + name + \":</b></i>\");\n    } else {\n      div.innerHTML = util.xss(name + \":\");\n    }\n    return div;\n  }\n\n  /**\n   * make a dropdown list for multiple possible string optoins\n   * @param {Array.<number>} arr\n   * @param {number} value\n   * @param {array} path    | where to look for the actual option\n   * @private\n   */\n  _makeDropdown(arr, value, path) {\n    let select = document.createElement(\"select\");\n    select.className = \"vis-configuration vis-config-select\";\n    let selectedValue = 0;\n    if (value !== undefined) {\n      if (arr.indexOf(value) !== -1) {\n        selectedValue = arr.indexOf(value);\n      }\n    }\n\n    for (let i = 0; i < arr.length; i++) {\n      let option = document.createElement(\"option\");\n      option.value = arr[i];\n      if (i === selectedValue) {\n        option.selected = \"selected\";\n      }\n      option.innerHTML = arr[i];\n      select.appendChild(option);\n    }\n\n    let me = this;\n    select.onchange = function () {\n      me._update(this.value, path);\n    };\n\n    let label = this._makeLabel(path[path.length - 1], path);\n    this._makeItem(path, label, select);\n  }\n\n  /**\n   * make a range object for numeric options\n   * @param {Array.<number>} arr\n   * @param {number} value\n   * @param {array} path    | where to look for the actual option\n   * @private\n   */\n  _makeRange(arr, value, path) {\n    let defaultValue = arr[0];\n    let min = arr[1];\n    let max = arr[2];\n    let step = arr[3];\n    let range = document.createElement(\"input\");\n    range.className = \"vis-configuration vis-config-range\";\n    try {\n      range.type = \"range\"; // not supported on IE9\n      range.min = min;\n      range.max = max;\n    } catch (err) {\n      // TODO: Add some error handling and remove this lint exception\n    } // eslint-disable-line no-empty\n    range.step = step;\n\n    // set up the popup settings in case they are needed.\n    let popupString = \"\";\n    let popupValue = 0;\n\n    if (value !== undefined) {\n      let factor = 1.2;\n      if (value < 0 && value * factor < min) {\n        range.min = Math.ceil(value * factor);\n        popupValue = range.min;\n        popupString = \"range increased\";\n      } else if (value / factor < min) {\n        range.min = Math.ceil(value / factor);\n        popupValue = range.min;\n        popupString = \"range increased\";\n      }\n      if (value * factor > max && max !== 1) {\n        range.max = Math.ceil(value * factor);\n        popupValue = range.max;\n        popupString = \"range increased\";\n      }\n      range.value = value;\n    } else {\n      range.value = defaultValue;\n    }\n\n    let input = document.createElement(\"input\");\n    input.className = \"vis-configuration vis-config-rangeinput\";\n    input.value = Number(range.value);\n\n    var me = this;\n    range.onchange = function () {\n      input.value = this.value;\n      me._update(Number(this.value), path);\n    };\n    range.oninput = function () {\n      input.value = this.value;\n    };\n\n    let label = this._makeLabel(path[path.length - 1], path);\n    let itemIndex = this._makeItem(path, label, range, input);\n\n    // if a popup is needed AND it has not been shown for this value, show it.\n    if (popupString !== \"\" && this.popupHistory[itemIndex] !== popupValue) {\n      this.popupHistory[itemIndex] = popupValue;\n      this._setupPopup(popupString, itemIndex);\n    }\n  }\n\n  /**\n   * make a button object\n   * @private\n   */\n  _makeButton() {\n    if (this.options.showButton === true) {\n      let generateButton = document.createElement(\"div\");\n      generateButton.className = \"vis-configuration vis-config-button\";\n      generateButton.innerHTML = \"generate options\";\n      generateButton.onclick = () => {\n        this._printOptions();\n      };\n      generateButton.onmouseover = () => {\n        generateButton.className = \"vis-configuration vis-config-button hover\";\n      };\n      generateButton.onmouseout = () => {\n        generateButton.className = \"vis-configuration vis-config-button\";\n      };\n\n      this.optionsContainer = document.createElement(\"div\");\n      this.optionsContainer.className =\n        \"vis-configuration vis-config-option-container\";\n\n      this.domElements.push(this.optionsContainer);\n      this.domElements.push(generateButton);\n    }\n  }\n\n  /**\n   * prepare the popup\n   * @param {string} string\n   * @param {number} index\n   * @private\n   */\n  _setupPopup(string, index) {\n    if (\n      this.initialized === true &&\n      this.allowCreation === true &&\n      this.popupCounter < this.popupLimit\n    ) {\n      let div = document.createElement(\"div\");\n      div.id = \"vis-configuration-popup\";\n      div.className = \"vis-configuration-popup\";\n      div.innerHTML = util.xss(string);\n      div.onclick = () => {\n        this._removePopup();\n      };\n      this.popupCounter += 1;\n      this.popupDiv = { html: div, index: index };\n    }\n  }\n\n  /**\n   * remove the popup from the dom\n   * @private\n   */\n  _removePopup() {\n    if (this.popupDiv.html !== undefined) {\n      this.popupDiv.html.parentNode.removeChild(this.popupDiv.html);\n      clearTimeout(this.popupDiv.hideTimeout);\n      clearTimeout(this.popupDiv.deleteTimeout);\n      this.popupDiv = {};\n    }\n  }\n\n  /**\n   * Show the popup if it is needed.\n   * @private\n   */\n  _showPopupIfNeeded() {\n    if (this.popupDiv.html !== undefined) {\n      let correspondingElement = this.domElements[this.popupDiv.index];\n      let rect = correspondingElement.getBoundingClientRect();\n      this.popupDiv.html.style.left = rect.left + \"px\";\n      this.popupDiv.html.style.top = rect.top - 30 + \"px\"; // 30 is the height;\n      document.body.appendChild(this.popupDiv.html);\n      this.popupDiv.hideTimeout = setTimeout(() => {\n        this.popupDiv.html.style.opacity = 0;\n      }, 1500);\n      this.popupDiv.deleteTimeout = setTimeout(() => {\n        this._removePopup();\n      }, 1800);\n    }\n  }\n\n  /**\n   * make a checkbox for boolean options.\n   * @param {number} defaultValue\n   * @param {number} value\n   * @param {array} path    | where to look for the actual option\n   * @private\n   */\n  _makeCheckbox(defaultValue, value, path) {\n    var checkbox = document.createElement(\"input\");\n    checkbox.type = \"checkbox\";\n    checkbox.className = \"vis-configuration vis-config-checkbox\";\n    checkbox.checked = defaultValue;\n    if (value !== undefined) {\n      checkbox.checked = value;\n      if (value !== defaultValue) {\n        if (typeof defaultValue === \"object\") {\n          if (value !== defaultValue.enabled) {\n            this.changedOptions.push({ path: path, value: value });\n          }\n        } else {\n          this.changedOptions.push({ path: path, value: value });\n        }\n      }\n    }\n\n    let me = this;\n    checkbox.onchange = function () {\n      me._update(this.checked, path);\n    };\n\n    let label = this._makeLabel(path[path.length - 1], path);\n    this._makeItem(path, label, checkbox);\n  }\n\n  /**\n   * make a text input field for string options.\n   * @param {number} defaultValue\n   * @param {number} value\n   * @param {array} path    | where to look for the actual option\n   * @private\n   */\n  _makeTextInput(defaultValue, value, path) {\n    var checkbox = document.createElement(\"input\");\n    checkbox.type = \"text\";\n    checkbox.className = \"vis-configuration vis-config-text\";\n    checkbox.value = value;\n    if (value !== defaultValue) {\n      this.changedOptions.push({ path: path, value: value });\n    }\n\n    let me = this;\n    checkbox.onchange = function () {\n      me._update(this.value, path);\n    };\n\n    let label = this._makeLabel(path[path.length - 1], path);\n    this._makeItem(path, label, checkbox);\n  }\n\n  /**\n   * make a color field with a color picker for color fields\n   * @param {Array.<number>} arr\n   * @param {number} value\n   * @param {array} path    | where to look for the actual option\n   * @private\n   */\n  _makeColorField(arr, value, path) {\n    let defaultColor = arr[1];\n    let div = document.createElement(\"div\");\n    value = value === undefined ? defaultColor : value;\n\n    if (value !== \"none\") {\n      div.className = \"vis-configuration vis-config-colorBlock\";\n      div.style.backgroundColor = value;\n    } else {\n      div.className = \"vis-configuration vis-config-colorBlock none\";\n    }\n\n    value = value === undefined ? defaultColor : value;\n    div.onclick = () => {\n      this._showColorPicker(value, div, path);\n    };\n\n    let label = this._makeLabel(path[path.length - 1], path);\n    this._makeItem(path, label, div);\n  }\n\n  /**\n   * used by the color buttons to call the color picker.\n   * @param {number} value\n   * @param {HTMLElement} div\n   * @param {array} path    | where to look for the actual option\n   * @private\n   */\n  _showColorPicker(value, div, path) {\n    // clear the callback from this div\n    div.onclick = function () {};\n\n    this.colorPicker.insertTo(div);\n    this.colorPicker.show();\n\n    this.colorPicker.setColor(value);\n    this.colorPicker.setUpdateCallback((color) => {\n      let colorString =\n        \"rgba(\" + color.r + \",\" + color.g + \",\" + color.b + \",\" + color.a + \")\";\n      div.style.backgroundColor = colorString;\n      this._update(colorString, path);\n    });\n\n    // on close of the colorpicker, restore the callback.\n    this.colorPicker.setCloseCallback(() => {\n      div.onclick = () => {\n        this._showColorPicker(value, div, path);\n      };\n    });\n  }\n\n  /**\n   * parse an object and draw the correct items\n   * @param {Object} obj\n   * @param {array} [path=[]]    | where to look for the actual option\n   * @param {boolean} [checkOnly=false]\n   * @returns {boolean}\n   * @private\n   */\n  _handleObject(obj, path = [], checkOnly = false) {\n    let show = false;\n    let filter = this.options.filter;\n    let visibleInSet = false;\n    for (let subObj in obj) {\n      if (!Object.prototype.hasOwnProperty.call(obj, subObj)) continue;\n\n      show = true;\n      let item = obj[subObj];\n      let newPath = util.copyAndExtendArray(path, subObj);\n\n      if (typeof filter === \"function\") {\n        show = filter(subObj, path);\n\n        // if needed we must go deeper into the object.\n        if (show === false) {\n          if (\n            !Array.isArray(item) &&\n            typeof item !== \"string\" &&\n            typeof item !== \"boolean\" &&\n            item instanceof Object\n          ) {\n            this.allowCreation = false;\n            show = this._handleObject(item, newPath, true);\n            this.allowCreation = checkOnly === false;\n          }\n        }\n      }\n\n      if (show !== false) {\n        visibleInSet = true;\n        let value = this._getValue(newPath);\n\n        if (Array.isArray(item)) {\n          this._handleArray(item, value, newPath);\n        } else if (typeof item === \"string\") {\n          this._makeTextInput(item, value, newPath);\n        } else if (typeof item === \"boolean\") {\n          this._makeCheckbox(item, value, newPath);\n        } else if (item instanceof Object) {\n          // collapse the physics options that are not enabled\n          let draw = true;\n          if (path.indexOf(\"physics\") !== -1) {\n            if (this.moduleOptions.physics.solver !== subObj) {\n              draw = false;\n            }\n          }\n\n          if (draw === true) {\n            // initially collapse options with an disabled enabled option.\n            if (item.enabled !== undefined) {\n              let enabledPath = util.copyAndExtendArray(newPath, \"enabled\");\n              let enabledValue = this._getValue(enabledPath);\n              if (enabledValue === true) {\n                let label = this._makeLabel(subObj, newPath, true);\n                this._makeItem(newPath, label);\n                visibleInSet =\n                  this._handleObject(item, newPath) || visibleInSet;\n              } else {\n                this._makeCheckbox(item, enabledValue, newPath);\n              }\n            } else {\n              let label = this._makeLabel(subObj, newPath, true);\n              this._makeItem(newPath, label);\n              visibleInSet = this._handleObject(item, newPath) || visibleInSet;\n            }\n          }\n        } else {\n          console.error(\"dont know how to handle\", item, subObj, newPath);\n        }\n      }\n    }\n    return visibleInSet;\n  }\n\n  /**\n   * handle the array type of option\n   * @param {Array.<number>} arr\n   * @param {number} value\n   * @param {array} path    | where to look for the actual option\n   * @private\n   */\n  _handleArray(arr, value, path) {\n    if (typeof arr[0] === \"string\" && arr[0] === \"color\") {\n      this._makeColorField(arr, value, path);\n      if (arr[1] !== value) {\n        this.changedOptions.push({ path: path, value: value });\n      }\n    } else if (typeof arr[0] === \"string\") {\n      this._makeDropdown(arr, value, path);\n      if (arr[0] !== value) {\n        this.changedOptions.push({ path: path, value: value });\n      }\n    } else if (typeof arr[0] === \"number\") {\n      this._makeRange(arr, value, path);\n      if (arr[0] !== value) {\n        this.changedOptions.push({ path: path, value: Number(value) });\n      }\n    }\n  }\n\n  /**\n   * called to update the network with the new settings.\n   * @param {number} value\n   * @param {array} path    | where to look for the actual option\n   * @private\n   */\n  _update(value, path) {\n    let options = this._constructOptions(value, path);\n\n    if (\n      this.parent.body &&\n      this.parent.body.emitter &&\n      this.parent.body.emitter.emit\n    ) {\n      this.parent.body.emitter.emit(\"configChange\", options);\n    }\n    this.initialized = true;\n    this.parent.setOptions(options);\n  }\n\n  /**\n   *\n   * @param {string|Boolean} value\n   * @param {Array.<string>} path\n   * @param {{}} optionsObj\n   * @returns {{}}\n   * @private\n   */\n  _constructOptions(value, path, optionsObj = {}) {\n    let pointer = optionsObj;\n\n    // when dropdown boxes can be string or boolean, we typecast it into correct types\n    value = value === \"true\" ? true : value;\n    value = value === \"false\" ? false : value;\n\n    for (let i = 0; i < path.length; i++) {\n      if (path[i] !== \"global\") {\n        if (pointer[path[i]] === undefined) {\n          pointer[path[i]] = {};\n        }\n        if (i !== path.length - 1) {\n          pointer = pointer[path[i]];\n        } else {\n          pointer[path[i]] = value;\n        }\n      }\n    }\n    return optionsObj;\n  }\n\n  /**\n   * @private\n   */\n  _printOptions() {\n    let options = this.getOptions();\n    this.optionsContainer.innerHTML =\n      \"<pre>var options = \" + JSON.stringify(options, null, 2) + \"</pre>\";\n  }\n\n  /**\n   *\n   * @returns {{}} options\n   */\n  getOptions() {\n    let options = {};\n    for (var i = 0; i < this.changedOptions.length; i++) {\n      this._constructOptions(\n        this.changedOptions[i].value,\n        this.changedOptions[i].path,\n        options,\n      );\n    }\n    return options;\n  }\n}\n\nexport default Configurator;\n","import moment from \"../module/moment.js\";\nimport util, { typeCoerceDataSet, isDataViewLike } from \"../util.js\";\nimport { DataSet, DataView } from \"vis-data/esnext\";\nimport Range from \"./Range.js\";\nimport Core from \"./Core.js\";\nimport TimeAxis from \"./component/TimeAxis.js\";\nimport CurrentTime from \"./component/CurrentTime.js\";\nimport CustomTime from \"./component/CustomTime.js\";\nimport ItemSet from \"./component/ItemSet.js\";\n\nimport { Validator } from \"../shared/Validator.js\";\nimport { printStyle } from \"../shared/Validator.js\";\nimport { allOptions } from \"./optionsTimeline.js\";\nimport { configureOptions } from \"./optionsTimeline.js\";\n\nimport Configurator from \"../shared/Configurator.js\";\n\n/**\n * Create a timeline visualization\n * @extends Core\n */\nexport default class Timeline extends Core {\n  /**\n   * @param {HTMLElement} container\n   * @param {vis.DataSet | vis.DataView | Array} [items]\n   * @param {vis.DataSet | vis.DataView | Array} [groups]\n   * @param {Object} [options]  See Timeline.setOptions for the available options.\n   * @constructor Timeline\n   */\n  constructor(container, items, groups, options) {\n    super();\n    this.initTime = new Date();\n    this.itemsDone = false;\n\n    if (!(this instanceof Timeline)) {\n      throw new SyntaxError(\"Constructor must be called with the new operator\");\n    }\n\n    // if the third element is options, the forth is groups (optionally);\n    if (\n      !(Array.isArray(groups) || isDataViewLike(groups)) &&\n      groups instanceof Object\n    ) {\n      const forthArgument = options;\n      options = groups;\n      groups = forthArgument;\n    }\n\n    // TODO: REMOVE THIS in the next MAJOR release\n    // see https://github.com/almende/vis/issues/2511\n    if (options && options.throttleRedraw) {\n      console.warn(\n        'Timeline option \"throttleRedraw\" is DEPRICATED and no longer supported. It will be removed in the next MAJOR release.',\n      );\n    }\n\n    const me = this;\n    this.defaultOptions = {\n      autoResize: true,\n      longSelectPressTime: 251,\n      orientation: {\n        axis: \"bottom\", // axis orientation: 'bottom', 'top', or 'both'\n        item: \"bottom\", // not relevant\n      },\n      moment,\n    };\n    this.options = util.deepExtend({}, this.defaultOptions);\n    options && util.setupXSSProtection(options.xss);\n\n    // Create the DOM, props, and emitter\n    this._create(container);\n    if (!options || (options && typeof options.rtl == \"undefined\")) {\n      this.dom.root.style.visibility = \"hidden\";\n      let directionFromDom;\n      let domNode = this.dom.root;\n      while (!directionFromDom && domNode) {\n        directionFromDom = window.getComputedStyle(domNode, null).direction;\n        domNode = domNode.parentElement;\n      }\n      this.options.rtl =\n        directionFromDom && directionFromDom.toLowerCase() == \"rtl\";\n    } else {\n      this.options.rtl = options.rtl;\n    }\n\n    if (options) {\n      if (options.rollingMode) {\n        this.options.rollingMode = options.rollingMode;\n      }\n      if (options.onInitialDrawComplete) {\n        this.options.onInitialDrawComplete = options.onInitialDrawComplete;\n      }\n      if (options.onTimeout) {\n        this.options.onTimeout = options.onTimeout;\n      }\n      if (options.loadingScreenTemplate) {\n        this.options.loadingScreenTemplate = options.loadingScreenTemplate;\n      }\n    }\n\n    // Prepare loading screen\n    const loadingScreenFragment = document.createElement(\"div\");\n    if (this.options.loadingScreenTemplate) {\n      const templateFunction = this.options.loadingScreenTemplate.bind(this);\n      const loadingScreen = templateFunction(this.dom.loadingScreen);\n      if (\n        loadingScreen instanceof Object &&\n        !(loadingScreen instanceof Element)\n      ) {\n        templateFunction(loadingScreenFragment);\n      } else {\n        if (loadingScreen instanceof Element) {\n          loadingScreenFragment.innerHTML = \"\";\n          loadingScreenFragment.appendChild(loadingScreen);\n        } else if (loadingScreen != undefined) {\n          loadingScreenFragment.innerHTML = util.xss(loadingScreen);\n        }\n      }\n    }\n    this.dom.loadingScreen.appendChild(loadingScreenFragment);\n\n    // all components listed here will be repainted automatically\n    this.components = [];\n\n    this.body = {\n      dom: this.dom,\n      domProps: this.props,\n      emitter: {\n        on: this.on.bind(this),\n        off: this.off.bind(this),\n        emit: this.emit.bind(this),\n      },\n      hiddenDates: [],\n      util: {\n        getScale() {\n          return me.timeAxis.step.scale;\n        },\n        getStep() {\n          return me.timeAxis.step.step;\n        },\n\n        toScreen: me._toScreen.bind(me),\n        toGlobalScreen: me._toGlobalScreen.bind(me), // this refers to the root.width\n        toTime: me._toTime.bind(me),\n        toGlobalTime: me._toGlobalTime.bind(me),\n      },\n    };\n\n    // range\n    this.range = new Range(this.body, this.options);\n    this.components.push(this.range);\n    this.body.range = this.range;\n\n    // time axis\n    this.timeAxis = new TimeAxis(this.body, this.options);\n    this.timeAxis2 = null; // used in case of orientation option 'both'\n    this.components.push(this.timeAxis);\n\n    // current time bar\n    this.currentTime = new CurrentTime(this.body, this.options);\n    this.components.push(this.currentTime);\n\n    // item set\n    this.itemSet = new ItemSet(this.body, this.options);\n    this.components.push(this.itemSet);\n\n    this.itemsData = null; // DataSet\n    this.groupsData = null; // DataSet\n\n    /**\n     * Emit an event.\n     * @param {string} eventName Name of event.\n     * @param {Event} event The event object.\n     */\n    function emit(eventName, event) {\n      if (!me.hasListeners(eventName)) return;\n\n      me.emit(eventName, me.getEventProperties(event));\n    }\n\n    this.dom.root.onclick = (event) => emit(\"click\", event);\n    this.dom.root.ondblclick = (event) => emit(\"doubleClick\", event);\n    this.dom.root.oncontextmenu = (event) => emit(\"contextmenu\", event);\n    this.dom.root.onmouseover = (event) => emit(\"mouseOver\", event);\n    if (window.PointerEvent) {\n      this.dom.root.onpointerdown = (event) => emit(\"mouseDown\", event);\n      this.dom.root.onpointermove = (event) => emit(\"mouseMove\", event);\n      this.dom.root.onpointerup = (event) => emit(\"mouseUp\", event);\n    } else {\n      this.dom.root.onmousemove = (event) => emit(\"mouseMove\", event);\n      this.dom.root.onmousedown = (event) => emit(\"mouseDown\", event);\n      this.dom.root.onmouseup = (event) => emit(\"mouseUp\", event);\n    }\n\n    //Single time autoscale/fit\n    this.initialFitDone = false;\n    this.on(\"changed\", () => {\n      if (me.itemsData == null) return;\n      if (!me.initialFitDone && !me.options.rollingMode) {\n        me.initialFitDone = true;\n        if (me.options.start != undefined || me.options.end != undefined) {\n          if (me.options.start == undefined || me.options.end == undefined) {\n            var range = me.getItemRange();\n          }\n\n          const start =\n            me.options.start != undefined ? me.options.start : range.min;\n          const end = me.options.end != undefined ? me.options.end : range.max;\n          me.setWindow(start, end, { animation: false });\n        } else {\n          me.fit({ animation: false });\n        }\n      }\n\n      if (\n        !me.initialDrawDone &&\n        (me.initialRangeChangeDone ||\n          (!me.options.start && !me.options.end) ||\n          me.options.rollingMode)\n      ) {\n        me.initialDrawDone = true;\n        me.itemSet.initialDrawDone = true;\n        me.dom.root.style.visibility = \"visible\";\n        me.dom.loadingScreen.parentNode.removeChild(me.dom.loadingScreen);\n        if (me.options.onInitialDrawComplete) {\n          setTimeout(() => {\n            return me.options.onInitialDrawComplete();\n          }, 0);\n        }\n      }\n    });\n\n    this.on(\"destroyTimeline\", () => {\n      me.destroy();\n    });\n\n    // apply options\n    if (options) {\n      this.setOptions(options);\n    }\n\n    this.body.emitter.on(\"fit\", (args) => {\n      this._onFit(args);\n      this.redraw();\n    });\n\n    // IMPORTANT: THIS HAPPENS BEFORE SET ITEMS!\n    if (groups) {\n      this.setGroups(groups);\n    }\n\n    // create itemset\n    if (items) {\n      this.setItems(items);\n    }\n\n    // draw for the first time\n    this._redraw();\n  }\n\n  /**\n   * Load a configurator\n   * @return {Object}\n   * @private\n   */\n  _createConfigurator() {\n    return new Configurator(this, this.dom.container, configureOptions);\n  }\n\n  /**\n   * Force a redraw. The size of all items will be recalculated.\n   * Can be useful to manually redraw when option autoResize=false and the window\n   * has been resized, or when the items CSS has been changed.\n   *\n   * Note: this function will be overridden on construction with a trottled version\n   */\n  redraw() {\n    this.itemSet && this.itemSet.markDirty({ refreshItems: true });\n    this._redraw();\n  }\n\n  /**\n   * Remove an item from the group\n   * @param {object} options\n   */\n  setOptions(options) {\n    // validate options\n    let errorFound = Validator.validate(options, allOptions);\n\n    if (errorFound === true) {\n      console.log(\n        \"%cErrors have been found in the supplied options object.\",\n        printStyle,\n      );\n    }\n\n    Core.prototype.setOptions.call(this, options);\n\n    if (\"type\" in options) {\n      if (options.type !== this.options.type) {\n        this.options.type = options.type;\n\n        // force recreation of all items\n        const itemsData = this.itemsData;\n        if (itemsData) {\n          const selection = this.getSelection();\n          this.setItems(null); // remove all\n          this.setItems(itemsData.rawDS); // add all\n          this.setSelection(selection); // restore selection\n        }\n      }\n    }\n  }\n\n  /**\n   * Set items\n   * @param {vis.DataSet | Array | null} items\n   */\n  setItems(items) {\n    this.itemsDone = false;\n\n    // convert to type DataSet when needed\n    let newDataSet;\n    if (!items) {\n      newDataSet = null;\n    } else if (isDataViewLike(items)) {\n      newDataSet = typeCoerceDataSet(items);\n    } else {\n      // turn an array into a dataset\n      newDataSet = typeCoerceDataSet(new DataSet(items));\n    }\n\n    // set items\n    if (this.itemsData) {\n      // stop maintaining a coerced version of the old data set\n      this.itemsData.dispose();\n    }\n    this.itemsData = newDataSet;\n    this.itemSet &&\n      this.itemSet.setItems(newDataSet != null ? newDataSet.rawDS : null);\n  }\n\n  /**\n   * Set groups\n   * @param {vis.DataSet | Array} groups\n   */\n  setGroups(groups) {\n    // convert to type DataSet when needed\n    let newDataSet;\n    const filter = (group) => group.visible !== false;\n\n    if (!groups) {\n      newDataSet = null;\n    } else {\n      // If groups is array, turn to DataSet & build dataview from that\n      if (Array.isArray(groups)) groups = new DataSet(groups);\n\n      newDataSet = new DataView(groups, { filter });\n    }\n\n    // This looks weird but it's necessary to prevent memory leaks.\n    //\n    // The problem is that the DataView will exist as long as the DataSet it's\n    // connected to. This will force it to swap the groups DataSet for it's own\n    // DataSet. In this arrangement it will become unreferenced from the outside\n    // and garbage collected.\n    //\n    // IMPORTANT NOTE: If `this.groupsData` is a DataView was created in this\n    // method. Even if the original is a DataView already a new one has been\n    // created and assigned to `this.groupsData`. In case this changes in the\n    // future it will be necessary to rework this!!!!\n    if (\n      this.groupsData != null &&\n      typeof this.groupsData.setData === \"function\"\n    ) {\n      this.groupsData.setData(null);\n    }\n    this.groupsData = newDataSet;\n    this.itemSet.setGroups(newDataSet);\n  }\n\n  /**\n   * Set both items and groups in one go\n   * @param {{items: (Array | vis.DataSet), groups: (Array | vis.DataSet)}} data\n   */\n  setData(data) {\n    if (data && data.groups) {\n      this.setGroups(data.groups);\n    }\n\n    if (data && data.items) {\n      this.setItems(data.items);\n    }\n  }\n\n  /**\n   * Set selected items by their id. Replaces the current selection\n   * Unknown id's are silently ignored.\n   * @param {string[] | string} [ids]  An array with zero or more id's of the items to be\n   *                                selected. If ids is an empty array, all items will be\n   *                                unselected.\n   * @param {Object} [options]      Available options:\n   *                                `focus: boolean`\n   *                                    If true, focus will be set to the selected item(s)\n   *                                `animation: boolean | {duration: number, easingFunction: string}`\n   *                                    If true (default), the range is animated\n   *                                    smoothly to the new window. An object can be\n   *                                    provided to specify duration and easing function.\n   *                                    Default duration is 500 ms, and default easing\n   *                                    function is 'easeInOutQuad'.\n   *                                    Only applicable when option focus is true.\n   */\n  setSelection(ids, options) {\n    this.itemSet && this.itemSet.setSelection(ids);\n\n    if (options && options.focus) {\n      this.focus(ids, options);\n    }\n  }\n\n  /**\n   * Get the selected items by their id\n   * @return {Array} ids  The ids of the selected items\n   */\n  getSelection() {\n    return (this.itemSet && this.itemSet.getSelection()) || [];\n  }\n\n  /**\n   * Adjust the visible window such that the selected item (or multiple items)\n   * are centered on screen.\n   * @param {string | String[]} id     An item id or array with item ids\n   * @param {Object} [options]      Available options:\n   *                                `animation: boolean | {duration: number, easingFunction: string}`\n   *                                    If true (default), the range is animated\n   *                                    smoothly to the new window. An object can be\n   *                                    provided to specify duration and easing function.\n   *                                    Default duration is 500 ms, and default easing\n   *                                    function is 'easeInOutQuad'.\n   *                                `zoom: boolean`\n   *                                    If true (default), the timeline will\n   *                                    zoom on the element after focus it.\n   */\n  focus(id, options) {\n    if (!this.itemsData || id == undefined) return;\n\n    const ids = Array.isArray(id) ? id : [id];\n\n    // get the specified item(s)\n    const itemsData = this.itemsData.get(ids);\n\n    // calculate minimum start and maximum end of specified items\n    let start = null;\n    let end = null;\n    itemsData.forEach((itemData) => {\n      const s = itemData.start.valueOf();\n      const e =\n        \"end\" in itemData ? itemData.end.valueOf() : itemData.start.valueOf();\n\n      if (start === null || s < start) {\n        start = s;\n      }\n\n      if (end === null || e > end) {\n        end = e;\n      }\n    });\n\n    if (start !== null && end !== null) {\n      const me = this;\n      // Use the first item for the vertical focus\n      const item = this.itemSet.items[ids[0]];\n      let startPos = this._getScrollTop() * -1;\n      let initialVerticalScroll = null;\n\n      // Setup a handler for each frame of the vertical scroll\n      const verticalAnimationFrame = (ease, willDraw, done) => {\n        const verticalScroll = getItemVerticalScroll(me, item);\n\n        if (verticalScroll === false) {\n          return; // We don't need to scroll, so do nothing\n        }\n\n        if (!initialVerticalScroll) {\n          initialVerticalScroll = verticalScroll;\n        }\n\n        if (\n          initialVerticalScroll.itemTop == verticalScroll.itemTop &&\n          !initialVerticalScroll.shouldScroll\n        ) {\n          return; // We don't need to scroll, so do nothing\n        } else if (\n          initialVerticalScroll.itemTop != verticalScroll.itemTop &&\n          verticalScroll.shouldScroll\n        ) {\n          // The redraw shifted elements, so reset the animation to correct\n          initialVerticalScroll = verticalScroll;\n          startPos = me._getScrollTop() * -1;\n        }\n\n        const from = startPos;\n        const to = initialVerticalScroll.scrollOffset;\n        const scrollTop = done ? to : from + (to - from) * ease;\n\n        me._setScrollTop(-scrollTop);\n\n        if (!willDraw) {\n          me._redraw();\n        }\n      };\n\n      // Enforces the final vertical scroll position\n      const setFinalVerticalPosition = () => {\n        const finalVerticalScroll = getItemVerticalScroll(me, item);\n\n        if (\n          finalVerticalScroll.shouldScroll &&\n          finalVerticalScroll.itemTop != initialVerticalScroll.itemTop\n        ) {\n          me._setScrollTop(-finalVerticalScroll.scrollOffset);\n          me._redraw();\n        }\n      };\n\n      // Perform one last check at the end to make sure the final vertical\n      // position is correct\n      const finalVerticalCallback = () => {\n        // Double check we ended at the proper scroll position\n        setFinalVerticalPosition();\n\n        // Let the redraw settle and finalize the position.\n        setTimeout(setFinalVerticalPosition, 100);\n      };\n\n      // calculate the new middle and interval for the window\n      const zoom = options && options.zoom !== undefined ? options.zoom : true;\n      const middle = (start + end) / 2;\n      const interval = zoom\n        ? (end - start) * 1.1\n        : Math.max(this.range.end - this.range.start, (end - start) * 1.1);\n\n      const animation =\n        options && options.animation !== undefined ? options.animation : true;\n\n      if (!animation) {\n        // We aren't animating so set a default so that the final callback forces the vertical location\n        initialVerticalScroll = {\n          shouldScroll: false,\n          scrollOffset: -1,\n          itemTop: -1,\n        };\n      }\n\n      this.range.stopRolling();\n      this.range.setRange(\n        middle - interval / 2,\n        middle + interval / 2,\n        { animation },\n        finalVerticalCallback,\n        verticalAnimationFrame,\n      );\n    }\n  }\n\n  /**\n   * Set Timeline window such that it fits all items\n   * @param {Object} [options]  Available options:\n   *                                `animation: boolean | {duration: number, easingFunction: string}`\n   *                                    If true (default), the range is animated\n   *                                    smoothly to the new window. An object can be\n   *                                    provided to specify duration and easing function.\n   *                                    Default duration is 500 ms, and default easing\n   *                                    function is 'easeInOutQuad'.\n   * @param {function} [callback]\n   */\n  fit(options, callback) {\n    const animation =\n      options && options.animation !== undefined ? options.animation : true;\n    let range;\n\n    if (\n      this.itemsData.length === 1 &&\n      this.itemsData.get()[0].end === undefined\n    ) {\n      // a single item -> don't fit, just show a range around the item from -4 to +3 days\n      range = this.getDataRange();\n      this.moveTo(range.min.valueOf(), { animation }, callback);\n    } else {\n      // exactly fit the items (plus a small margin)\n      range = this.getItemRange();\n      this.range.setRange(range.min, range.max, { animation }, callback);\n    }\n  }\n\n  /**\n   * Determine the range of the items, taking into account their actual width\n   * and a margin of 10 pixels on both sides.\n   *\n   * @returns {{min: Date, max: Date}}\n   */\n  getItemRange() {\n    // get a rough approximation for the range based on the items start and end dates\n    const range = this.getDataRange();\n    let min = range.min !== null ? range.min.valueOf() : null;\n    let max = range.max !== null ? range.max.valueOf() : null;\n    let minItem = null;\n    let maxItem = null;\n\n    if (min != null && max != null) {\n      let interval = max - min; // ms\n      if (interval <= 0) {\n        interval = 10;\n      }\n      const factor = interval / this.props.center.width;\n\n      const redrawQueue = {};\n      let redrawQueueLength = 0;\n\n      // collect redraw functions\n      util.forEach(this.itemSet.items, (item, key) => {\n        if (item.groupShowing) {\n          const returnQueue = true;\n          redrawQueue[key] = item.redraw(returnQueue);\n          redrawQueueLength = redrawQueue[key].length;\n        }\n      });\n\n      const needRedraw = redrawQueueLength > 0;\n      if (needRedraw) {\n        // redraw all regular items\n        for (let i = 0; i < redrawQueueLength; i++) {\n          util.forEach(redrawQueue, (fns) => {\n            fns[i]();\n          });\n        }\n      }\n\n      // calculate the date of the left side and right side of the items given\n      util.forEach(this.itemSet.items, (item) => {\n        const start = getStart(item);\n        const end = getEnd(item);\n        let startSide;\n        let endSide;\n\n        if (this.options.rtl) {\n          startSide = start - (item.getWidthRight() + 10) * factor;\n          endSide = end + (item.getWidthLeft() + 10) * factor;\n        } else {\n          startSide = start - (item.getWidthLeft() + 10) * factor;\n          endSide = end + (item.getWidthRight() + 10) * factor;\n        }\n\n        if (startSide < min) {\n          min = startSide;\n          minItem = item;\n        }\n        if (endSide > max) {\n          max = endSide;\n          maxItem = item;\n        }\n      });\n\n      if (minItem && maxItem) {\n        const lhs = minItem.getWidthLeft() + 10;\n        const rhs = maxItem.getWidthRight() + 10;\n        const delta = this.props.center.width - lhs - rhs; // px\n\n        if (delta > 0) {\n          if (this.options.rtl) {\n            min = getStart(minItem) - (rhs * interval) / delta; // ms\n            max = getEnd(maxItem) + (lhs * interval) / delta; // ms\n          } else {\n            min = getStart(minItem) - (lhs * interval) / delta; // ms\n            max = getEnd(maxItem) + (rhs * interval) / delta; // ms\n          }\n        }\n      }\n    }\n\n    return {\n      min: min != null ? new Date(min) : null,\n      max: max != null ? new Date(max) : null,\n    };\n  }\n\n  /**\n   * Calculate the data range of the items start and end dates\n   * @returns {{min: Date, max: Date}}\n   */\n  getDataRange() {\n    let min = null;\n    let max = null;\n\n    if (this.itemsData) {\n      this.itemsData.forEach((item) => {\n        const start = util.convert(item.start, \"Date\").valueOf();\n        const end = util\n          .convert(item.end != undefined ? item.end : item.start, \"Date\")\n          .valueOf();\n        if (min === null || start < min) {\n          min = start;\n        }\n        if (max === null || end > max) {\n          max = end;\n        }\n      });\n    }\n\n    return {\n      min: min != null ? new Date(min) : null,\n      max: max != null ? new Date(max) : null,\n    };\n  }\n\n  /**\n   * Generate Timeline related information from an event\n   * @param {Event} event\n   * @return {Object} An object with related information, like on which area\n   *                  The event happened, whether clicked on an item, etc.\n   */\n  getEventProperties(event) {\n    const clientX = event.center ? event.center.x : event.clientX;\n    const clientY = event.center ? event.center.y : event.clientY;\n    const centerContainerRect =\n      this.dom.centerContainer.getBoundingClientRect();\n    const x = this.options.rtl\n      ? centerContainerRect.right - clientX\n      : clientX - centerContainerRect.left;\n    const y = clientY - centerContainerRect.top;\n\n    const item = this.itemSet.itemFromTarget(event);\n    const group = this.itemSet.groupFromTarget(event);\n    const customTime = CustomTime.customTimeFromTarget(event);\n\n    const snap = this.itemSet.options.snap || null;\n    const scale = this.body.util.getScale();\n    const step = this.body.util.getStep();\n    const time = this._toTime(x);\n    const snappedTime = snap ? snap(time, scale, step) : time;\n\n    const element = util.getTarget(event);\n    let what = null;\n    if (item != null) {\n      what = \"item\";\n    } else if (customTime != null) {\n      what = \"custom-time\";\n    } else if (util.hasParent(element, this.timeAxis.dom.foreground)) {\n      what = \"axis\";\n    } else if (\n      this.timeAxis2 &&\n      util.hasParent(element, this.timeAxis2.dom.foreground)\n    ) {\n      what = \"axis\";\n    } else if (util.hasParent(element, this.itemSet.dom.labelSet)) {\n      what = \"group-label\";\n    } else if (util.hasParent(element, this.currentTime.bar)) {\n      what = \"current-time\";\n    } else if (util.hasParent(element, this.dom.center)) {\n      what = \"background\";\n    }\n\n    return {\n      event,\n      item: item ? item.id : null,\n      isCluster: item ? !!item.isCluster : false,\n      items: item ? item.items || [] : null,\n      group: group ? group.groupId : null,\n      customTime: customTime ? customTime.options.id : null,\n      what,\n      pageX: event.srcEvent ? event.srcEvent.pageX : event.pageX,\n      pageY: event.srcEvent ? event.srcEvent.pageY : event.pageY,\n      x,\n      y,\n      time,\n      snappedTime,\n    };\n  }\n\n  /**\n   * Toggle Timeline rolling mode\n   */\n  toggleRollingMode() {\n    if (this.range.rolling) {\n      this.range.stopRolling();\n    } else {\n      if (this.options.rollingMode == undefined) {\n        this.setOptions(this.options);\n      }\n      this.range.startRolling();\n    }\n  }\n\n  /**\n   * redraw\n   * @private\n   */\n  _redraw() {\n    Core.prototype._redraw.call(this);\n  }\n\n  /**\n   * on fit callback\n   * @param {object} args\n   * @private\n   */\n  _onFit(args) {\n    const { start, end, animation } = args;\n    if (!end) {\n      this.moveTo(start.valueOf(), {\n        animation,\n      });\n    } else {\n      this.range.setRange(start, end, {\n        animation: animation,\n      });\n    }\n  }\n}\n\n/**\n *\n * @param {timeline.Item} item\n * @returns {number}\n */\nfunction getStart(item) {\n  return util.convert(item.data.start, \"Date\").valueOf();\n}\n\n/**\n *\n * @param {timeline.Item} item\n * @returns {number}\n */\nfunction getEnd(item) {\n  const end = item.data.end != undefined ? item.data.end : item.data.start;\n  return util.convert(end, \"Date\").valueOf();\n}\n\n/**\n * @param {vis.Timeline} timeline\n * @param {timeline.Item} item\n * @return {{shouldScroll: bool, scrollOffset: number, itemTop: number}}\n */\nfunction getItemVerticalScroll(timeline, item) {\n  if (!item.parent) {\n    // The item no longer exists, so ignore this focus.\n    return false;\n  }\n\n  const itemsetHeight = timeline.options.rtl\n    ? timeline.props.rightContainer.height\n    : timeline.props.leftContainer.height;\n  const contentHeight = timeline.props.center.height;\n\n  const group = item.parent;\n  let offset = group.top;\n  let shouldScroll = true;\n  const orientation = timeline.timeAxis.options.orientation.axis;\n\n  const itemTop = () => {\n    if (orientation == \"bottom\") {\n      return group.height - item.top - item.height;\n    } else {\n      return item.top;\n    }\n  };\n\n  const currentScrollHeight = timeline._getScrollTop() * -1;\n  const targetOffset = offset + itemTop();\n  const height = item.height;\n\n  if (targetOffset < currentScrollHeight) {\n    if (offset + itemsetHeight <= offset + itemTop() + height) {\n      offset += itemTop() - timeline.itemSet.options.margin.item.vertical;\n    }\n  } else if (targetOffset + height > currentScrollHeight + itemsetHeight) {\n    offset +=\n      itemTop() +\n      height -\n      itemsetHeight +\n      timeline.itemSet.options.margin.item.vertical;\n  } else {\n    shouldScroll = false;\n  }\n\n  offset = Math.min(offset, contentHeight - itemsetHeight);\n\n  return { shouldScroll, scrollOffset: offset, itemTop: targetOffset };\n}\n","// DOM utility methods\n\n/**\n * this prepares the JSON container for allocating SVG elements\n * @param {Object} JSONcontainer\n * @private\n */\nexport function prepareElements(JSONcontainer) {\n  // cleanup the redundant svgElements;\n  for (var elementType in JSONcontainer) {\n    if (!Object.prototype.hasOwnProperty.call(JSONcontainer, elementType))\n      continue;\n    JSONcontainer[elementType].redundant = JSONcontainer[elementType].used;\n    JSONcontainer[elementType].used = [];\n  }\n}\n\n/**\n * this cleans up all the unused SVG elements. By asking for the parentNode, we only need to supply the JSON container from\n * which to remove the redundant elements.\n *\n * @param {Object} JSONcontainer\n * @private\n */\nexport function cleanupElements(JSONcontainer) {\n  // cleanup the redundant svgElements;\n  for (var elementType in JSONcontainer) {\n    if (!Object.prototype.hasOwnProperty.call(JSONcontainer, elementType))\n      continue;\n    const elementTypeJsonContainer = JSONcontainer[elementType];\n    for (var i = 0; i < elementTypeJsonContainer.redundant.length; i++) {\n      elementTypeJsonContainer.redundant[i].parentNode.removeChild(\n        elementTypeJsonContainer.redundant[i],\n      );\n    }\n    elementTypeJsonContainer.redundant = [];\n  }\n}\n\n/**\n * Ensures that all elements are removed first up so they can be recreated cleanly\n * @param {Object} JSONcontainer\n */\nexport function resetElements(JSONcontainer) {\n  prepareElements(JSONcontainer);\n  cleanupElements(JSONcontainer);\n  prepareElements(JSONcontainer);\n}\n\n/**\n * Allocate or generate an SVG element if needed. Store a reference to it in the JSON container and draw it in the svgContainer\n * the JSON container and the SVG container have to be supplied so other svg containers (like the legend) can use this.\n *\n * @param {string} elementType\n * @param {Object} JSONcontainer\n * @param {Object} svgContainer\n * @returns {Element}\n * @private\n */\nexport function getSVGElement(elementType, JSONcontainer, svgContainer) {\n  var element;\n  // allocate SVG element, if it doesnt yet exist, create one.\n  if (Object.prototype.hasOwnProperty.call(JSONcontainer, elementType)) {\n    // this element has been created before\n    // check if there is an redundant element\n    if (JSONcontainer[elementType].redundant.length > 0) {\n      element = JSONcontainer[elementType].redundant[0];\n      JSONcontainer[elementType].redundant.shift();\n    } else {\n      // create a new element and add it to the SVG\n      element = document.createElementNS(\n        \"http://www.w3.org/2000/svg\",\n        elementType,\n      );\n      svgContainer.appendChild(element);\n    }\n  } else {\n    // create a new element and add it to the SVG, also create a new object in the svgElements to keep track of it.\n    element = document.createElementNS(\n      \"http://www.w3.org/2000/svg\",\n      elementType,\n    );\n    JSONcontainer[elementType] = { used: [], redundant: [] };\n    svgContainer.appendChild(element);\n  }\n  JSONcontainer[elementType].used.push(element);\n  return element;\n}\n\n/**\n * Allocate or generate an SVG element if needed. Store a reference to it in the JSON container and draw it in the svgContainer\n * the JSON container and the SVG container have to be supplied so other svg containers (like the legend) can use this.\n *\n * @param {string} elementType\n * @param {Object} JSONcontainer\n * @param {Element} DOMContainer\n * @param {Element} insertBefore\n * @returns {*}\n */\nexport function getDOMElement(\n  elementType,\n  JSONcontainer,\n  DOMContainer,\n  insertBefore,\n) {\n  var element;\n  // allocate DOM element, if it doesnt yet exist, create one.\n  if (Object.prototype.hasOwnProperty.call(JSONcontainer, elementType)) {\n    // this element has been created before\n    // check if there is an redundant element\n    if (JSONcontainer[elementType].redundant.length > 0) {\n      element = JSONcontainer[elementType].redundant[0];\n      JSONcontainer[elementType].redundant.shift();\n    } else {\n      // create a new element and add it to the SVG\n      element = document.createElement(elementType);\n      if (insertBefore !== undefined) {\n        DOMContainer.insertBefore(element, insertBefore);\n      } else {\n        DOMContainer.appendChild(element);\n      }\n    }\n  } else {\n    // create a new element and add it to the SVG, also create a new object in the svgElements to keep track of it.\n    element = document.createElement(elementType);\n    JSONcontainer[elementType] = { used: [], redundant: [] };\n    if (insertBefore !== undefined) {\n      DOMContainer.insertBefore(element, insertBefore);\n    } else {\n      DOMContainer.appendChild(element);\n    }\n  }\n  JSONcontainer[elementType].used.push(element);\n  return element;\n}\n\n/**\n * Draw a point object. This is a separate function because it can also be called by the legend.\n * The reason the JSONcontainer and the target SVG svgContainer have to be supplied is so the legend can use these functions\n * as well.\n *\n * @param {number} x\n * @param {number} y\n * @param {Object} groupTemplate: A template containing the necessary information to draw the datapoint e.g., {style: 'circle', size: 5, className: 'className' }\n * @param {Object} JSONcontainer\n * @param {Object} svgContainer\n * @param {Object} labelObj\n * @returns {vis.PointItem}\n */\nexport function drawPoint(\n  x,\n  y,\n  groupTemplate,\n  JSONcontainer,\n  svgContainer,\n  labelObj,\n) {\n  var point;\n  if (groupTemplate.style == \"circle\") {\n    point = getSVGElement(\"circle\", JSONcontainer, svgContainer);\n    point.setAttributeNS(null, \"cx\", x);\n    point.setAttributeNS(null, \"cy\", y);\n    point.setAttributeNS(null, \"r\", 0.5 * groupTemplate.size);\n  } else {\n    point = getSVGElement(\"rect\", JSONcontainer, svgContainer);\n    point.setAttributeNS(null, \"x\", x - 0.5 * groupTemplate.size);\n    point.setAttributeNS(null, \"y\", y - 0.5 * groupTemplate.size);\n    point.setAttributeNS(null, \"width\", groupTemplate.size);\n    point.setAttributeNS(null, \"height\", groupTemplate.size);\n  }\n\n  if (groupTemplate.styles !== undefined) {\n    point.setAttributeNS(null, \"style\", groupTemplate.styles);\n  }\n  point.setAttributeNS(null, \"class\", groupTemplate.className + \" vis-point\");\n  //handle label\n\n  if (labelObj) {\n    var label = getSVGElement(\"text\", JSONcontainer, svgContainer);\n    if (labelObj.xOffset) {\n      x = x + labelObj.xOffset;\n    }\n\n    if (labelObj.yOffset) {\n      y = y + labelObj.yOffset;\n    }\n    if (labelObj.content) {\n      label.textContent = labelObj.content;\n    }\n\n    if (labelObj.className) {\n      label.setAttributeNS(null, \"class\", labelObj.className + \" vis-label\");\n    }\n    label.setAttributeNS(null, \"x\", x);\n    label.setAttributeNS(null, \"y\", y);\n  }\n\n  return point;\n}\n\n/**\n * draw a bar SVG element centered on the X coordinate\n *\n * @param {number} x\n * @param {number} y\n * @param {number} width\n * @param {number} height\n * @param {string} className\n * @param {Object} JSONcontainer\n * @param {Object} svgContainer\n * @param {string} style\n */\nexport function drawBar(\n  x,\n  y,\n  width,\n  height,\n  className,\n  JSONcontainer,\n  svgContainer,\n  style,\n) {\n  if (height != 0) {\n    if (height < 0) {\n      height *= -1;\n      y -= height;\n    }\n    var rect = getSVGElement(\"rect\", JSONcontainer, svgContainer);\n    rect.setAttributeNS(null, \"x\", x - 0.5 * width);\n    rect.setAttributeNS(null, \"y\", y);\n    rect.setAttributeNS(null, \"width\", width);\n    rect.setAttributeNS(null, \"height\", height);\n    rect.setAttributeNS(null, \"class\", className);\n    if (style) {\n      rect.setAttributeNS(null, \"style\", style);\n    }\n  }\n}\n\n/**\n * get default language\n * @returns {string}\n */\nexport function getNavigatorLanguage() {\n  try {\n    if (!navigator) return \"en\";\n    if (navigator.languages && navigator.languages.length) {\n      return navigator.languages;\n    } else {\n      return (\n        navigator.userLanguage ||\n        navigator.language ||\n        navigator.browserLanguage ||\n        \"en\"\n      );\n    }\n  } catch (error) {\n    return \"en\";\n  }\n}\n","/** DataScale */\nclass DataScale {\n  /**\n   *\n   * @param {number} start\n   * @param {number} end\n   * @param {boolean} autoScaleStart\n   * @param {boolean} autoScaleEnd\n   * @param {number} containerHeight\n   * @param {number} majorCharHeight\n   * @param {boolean} zeroAlign\n   * @param {function} formattingFunction\n   * @constructor DataScale\n   */\n  constructor(\n    start,\n    end,\n    autoScaleStart,\n    autoScaleEnd,\n    containerHeight,\n    majorCharHeight,\n    zeroAlign = false,\n    formattingFunction = false,\n  ) {\n    this.majorSteps = [1, 2, 5, 10];\n    this.minorSteps = [0.25, 0.5, 1, 2];\n    this.customLines = null;\n\n    this.containerHeight = containerHeight;\n    this.majorCharHeight = majorCharHeight;\n    this._start = start;\n    this._end = end;\n\n    this.scale = 1;\n    this.minorStepIdx = -1;\n    this.magnitudefactor = 1;\n    this.determineScale();\n\n    this.zeroAlign = zeroAlign;\n    this.autoScaleStart = autoScaleStart;\n    this.autoScaleEnd = autoScaleEnd;\n\n    this.formattingFunction = formattingFunction;\n\n    if (autoScaleStart || autoScaleEnd) {\n      const me = this;\n      const roundToMinor = (value) => {\n        const rounded =\n          value -\n          (value % (me.magnitudefactor * me.minorSteps[me.minorStepIdx]));\n        if (\n          value % (me.magnitudefactor * me.minorSteps[me.minorStepIdx]) >\n          0.5 * (me.magnitudefactor * me.minorSteps[me.minorStepIdx])\n        ) {\n          return rounded + me.magnitudefactor * me.minorSteps[me.minorStepIdx];\n        } else {\n          return rounded;\n        }\n      };\n      if (autoScaleStart) {\n        this._start -=\n          this.magnitudefactor * 2 * this.minorSteps[this.minorStepIdx];\n        this._start = roundToMinor(this._start);\n      }\n\n      if (autoScaleEnd) {\n        this._end += this.magnitudefactor * this.minorSteps[this.minorStepIdx];\n        this._end = roundToMinor(this._end);\n      }\n      this.determineScale();\n    }\n  }\n\n  /**\n   * set chart height\n   * @param {number} majorCharHeight\n   */\n  setCharHeight(majorCharHeight) {\n    this.majorCharHeight = majorCharHeight;\n  }\n\n  /**\n   * set height\n   * @param {number} containerHeight\n   */\n  setHeight(containerHeight) {\n    this.containerHeight = containerHeight;\n  }\n\n  /**\n   * determine scale\n   */\n  determineScale() {\n    const range = this._end - this._start;\n    this.scale = this.containerHeight / range;\n    const minimumStepValue = this.majorCharHeight / this.scale;\n    const orderOfMagnitude =\n      range > 0 ? Math.round(Math.log(range) / Math.LN10) : 0;\n\n    this.minorStepIdx = -1;\n    this.magnitudefactor = Math.pow(10, orderOfMagnitude);\n\n    let start = 0;\n    if (orderOfMagnitude < 0) {\n      start = orderOfMagnitude;\n    }\n\n    let solutionFound = false;\n    for (let l = start; Math.abs(l) <= Math.abs(orderOfMagnitude); l++) {\n      this.magnitudefactor = Math.pow(10, l);\n      for (let j = 0; j < this.minorSteps.length; j++) {\n        const stepSize = this.magnitudefactor * this.minorSteps[j];\n        if (stepSize >= minimumStepValue) {\n          solutionFound = true;\n          this.minorStepIdx = j;\n          break;\n        }\n      }\n      if (solutionFound === true) {\n        break;\n      }\n    }\n  }\n\n  /**\n   * returns if value is major\n   * @param {number} value\n   * @returns {boolean}\n   */\n  is_major(value) {\n    return (\n      value % (this.magnitudefactor * this.majorSteps[this.minorStepIdx]) === 0\n    );\n  }\n\n  /**\n   * returns step size\n   * @returns {number}\n   */\n  getStep() {\n    return this.magnitudefactor * this.minorSteps[this.minorStepIdx];\n  }\n\n  /**\n   * returns first major\n   * @returns {number}\n   */\n  getFirstMajor() {\n    const majorStep = this.magnitudefactor * this.majorSteps[this.minorStepIdx];\n    return this.convertValue(\n      this._start + ((majorStep - (this._start % majorStep)) % majorStep),\n    );\n  }\n\n  /**\n   * returns first major\n   * @param {date} current\n   * @returns {date} formatted date\n   */\n  formatValue(current) {\n    let returnValue = current.toPrecision(5);\n    if (typeof this.formattingFunction === \"function\") {\n      returnValue = this.formattingFunction(current);\n    }\n\n    if (typeof returnValue === \"number\") {\n      return `${returnValue}`;\n    } else if (typeof returnValue === \"string\") {\n      return returnValue;\n    } else {\n      return current.toPrecision(5);\n    }\n  }\n\n  /**\n   * returns lines\n   * @returns {object} lines\n   */\n  getLines() {\n    const lines = [];\n    const step = this.getStep();\n    const bottomOffset = (step - (this._start % step)) % step;\n    for (\n      let i = this._start + bottomOffset;\n      this._end - i > 0.00001;\n      i += step\n    ) {\n      if (i != this._start) {\n        //Skip the bottom line\n        lines.push({\n          major: this.is_major(i),\n          y: this.convertValue(i),\n          val: this.formatValue(i),\n        });\n      }\n    }\n    return lines;\n  }\n\n  /**\n   * follow scale\n   * @param {object} other\n   */\n  followScale(other) {\n    const oldStepIdx = this.minorStepIdx;\n    const oldStart = this._start;\n    const oldEnd = this._end;\n\n    const me = this;\n    const increaseMagnitude = () => {\n      me.magnitudefactor *= 2;\n    };\n    const decreaseMagnitude = () => {\n      me.magnitudefactor /= 2;\n    };\n\n    if (\n      (other.minorStepIdx <= 1 && this.minorStepIdx <= 1) ||\n      (other.minorStepIdx > 1 && this.minorStepIdx > 1)\n    ) {\n      //easy, no need to change stepIdx nor multiplication factor\n    } else if (other.minorStepIdx < this.minorStepIdx) {\n      //I'm 5, they are 4 per major.\n      this.minorStepIdx = 1;\n      if (oldStepIdx == 2) {\n        increaseMagnitude();\n      } else {\n        increaseMagnitude();\n        increaseMagnitude();\n      }\n    } else {\n      //I'm 4, they are 5 per major\n      this.minorStepIdx = 2;\n      if (oldStepIdx == 1) {\n        decreaseMagnitude();\n      } else {\n        decreaseMagnitude();\n        decreaseMagnitude();\n      }\n    }\n\n    //Get masters stats:\n    const otherZero = other.convertValue(0);\n    const otherStep = other.getStep() * other.scale;\n\n    let done = false;\n    let count = 0;\n    //Loop until magnitude is correct for given constrains.\n    while (!done && count++ < 5) {\n      //Get my stats:\n      this.scale =\n        otherStep / (this.minorSteps[this.minorStepIdx] * this.magnitudefactor);\n      const newRange = this.containerHeight / this.scale;\n\n      //For the case the magnitudefactor has changed:\n      this._start = oldStart;\n      this._end = this._start + newRange;\n\n      const myOriginalZero = this._end * this.scale;\n      const majorStep =\n        this.magnitudefactor * this.majorSteps[this.minorStepIdx];\n      const majorOffset = this.getFirstMajor() - other.getFirstMajor();\n\n      if (this.zeroAlign) {\n        const zeroOffset = otherZero - myOriginalZero;\n        this._end += zeroOffset / this.scale;\n        this._start = this._end - newRange;\n      } else {\n        if (!this.autoScaleStart) {\n          this._start += majorStep - majorOffset / this.scale;\n          this._end = this._start + newRange;\n        } else {\n          this._start -= majorOffset / this.scale;\n          this._end = this._start + newRange;\n        }\n      }\n      if (!this.autoScaleEnd && this._end > oldEnd + 0.00001) {\n        //Need to decrease magnitude to prevent scale overshoot! (end)\n        decreaseMagnitude();\n        done = false;\n        continue;\n      }\n      if (!this.autoScaleStart && this._start < oldStart - 0.00001) {\n        if (this.zeroAlign && oldStart >= 0) {\n          console.warn(\"Can't adhere to given 'min' range, due to zeroalign\");\n        } else {\n          //Need to decrease magnitude to prevent scale overshoot! (start)\n          decreaseMagnitude();\n          done = false;\n          continue;\n        }\n      }\n      if (\n        this.autoScaleStart &&\n        this.autoScaleEnd &&\n        newRange < oldEnd - oldStart\n      ) {\n        increaseMagnitude();\n        done = false;\n        continue;\n      }\n      done = true;\n    }\n  }\n\n  /**\n   * convert value\n   * @param {number} value\n   * @returns {number}\n   */\n  convertValue(value) {\n    return this.containerHeight - (value - this._start) * this.scale;\n  }\n\n  /**\n   * returns screen to value\n   * @param {number} pixels\n   * @returns {number}\n   */\n  screenToValue(pixels) {\n    return (this.containerHeight - pixels) / this.scale + this._start;\n  }\n}\n\nexport default DataScale;\n","import util, { randomUUID } from \"../../util.js\";\nimport * as DOMutil from \"../../DOMutil.js\";\nimport Component from \"./Component.js\";\nimport DataScale from \"./DataScale.js\";\n\n/** A horizontal time axis */\nclass DataAxis extends Component {\n  /**\n   * @param {Object} body\n   * @param {Object} [options]        See DataAxis.setOptions for the available\n   *                                  options.\n   * @param {SVGElement} svg\n   * @param {timeline.LineGraph.options} linegraphOptions\n   * @constructor DataAxis\n   * @extends Component\n   */\n  constructor(body, options, svg, linegraphOptions) {\n    super();\n    this.id = randomUUID();\n    this.body = body;\n\n    this.defaultOptions = {\n      orientation: \"left\", // supported: 'left', 'right'\n      showMinorLabels: true,\n      showMajorLabels: true,\n      showWeekScale: false,\n      icons: false,\n      majorLinesOffset: 7,\n      minorLinesOffset: 4,\n      labelOffsetX: 10,\n      labelOffsetY: 2,\n      iconWidth: 20,\n      width: \"40px\",\n      visible: true,\n      alignZeros: true,\n      left: {\n        range: { min: undefined, max: undefined },\n        format(value) {\n          return `${parseFloat(value.toPrecision(3))}`;\n        },\n        title: { text: undefined, style: undefined },\n      },\n      right: {\n        range: { min: undefined, max: undefined },\n        format(value) {\n          return `${parseFloat(value.toPrecision(3))}`;\n        },\n        title: { text: undefined, style: undefined },\n      },\n    };\n\n    this.linegraphOptions = linegraphOptions;\n    this.linegraphSVG = svg;\n    this.props = {};\n    this.DOMelements = {\n      // dynamic elements\n      lines: {},\n      labels: {},\n      title: {},\n    };\n\n    this.dom = {};\n    this.scale = undefined;\n    this.range = { start: 0, end: 0 };\n\n    this.options = util.extend({}, this.defaultOptions);\n    this.conversionFactor = 1;\n\n    this.setOptions(options);\n    this.width = Number(`${this.options.width}`.replace(\"px\", \"\"));\n    this.minWidth = this.width;\n    this.height = this.linegraphSVG.getBoundingClientRect().height;\n    this.hidden = false;\n\n    this.stepPixels = 25;\n    this.zeroCrossing = -1;\n    this.amountOfSteps = -1;\n\n    this.lineOffset = 0;\n    this.master = true;\n    this.masterAxis = null;\n    this.svgElements = {};\n    this.iconsRemoved = false;\n\n    this.groups = {};\n    this.amountOfGroups = 0;\n\n    // create the HTML DOM\n    this._create();\n    if (this.scale == undefined) {\n      this._redrawLabels();\n    }\n    this.framework = {\n      svg: this.svg,\n      svgElements: this.svgElements,\n      options: this.options,\n      groups: this.groups,\n    };\n\n    const me = this;\n    this.body.emitter.on(\"verticalDrag\", () => {\n      me.dom.lineContainer.style.top = `${me.body.domProps.scrollTop}px`;\n    });\n  }\n\n  /**\n   * Adds group to data axis\n   * @param {string} label\n   * @param {object} graphOptions\n   */\n  addGroup(label, graphOptions) {\n    if (!Object.prototype.hasOwnProperty.call(this.groups, label)) {\n      this.groups[label] = graphOptions;\n    }\n    this.amountOfGroups += 1;\n  }\n\n  /**\n   * updates group of data axis\n   * @param {string} label\n   * @param {object} graphOptions\n   */\n  updateGroup(label, graphOptions) {\n    if (!Object.prototype.hasOwnProperty.call(this.groups, label)) {\n      this.amountOfGroups += 1;\n    }\n    this.groups[label] = graphOptions;\n  }\n\n  /**\n   * removes group of data axis\n   * @param {string} label\n   */\n  removeGroup(label) {\n    if (Object.prototype.hasOwnProperty.call(this.groups, label)) {\n      delete this.groups[label];\n      this.amountOfGroups -= 1;\n    }\n  }\n\n  /**\n   * sets options\n   * @param {object} options\n   */\n  setOptions(options) {\n    if (options) {\n      let redraw = false;\n      if (\n        this.options.orientation != options.orientation &&\n        options.orientation !== undefined\n      ) {\n        redraw = true;\n      }\n      const fields = [\n        \"orientation\",\n        \"showMinorLabels\",\n        \"showMajorLabels\",\n        \"icons\",\n        \"majorLinesOffset\",\n        \"minorLinesOffset\",\n        \"labelOffsetX\",\n        \"labelOffsetY\",\n        \"iconWidth\",\n        \"width\",\n        \"visible\",\n        \"left\",\n        \"right\",\n        \"alignZeros\",\n      ];\n      util.selectiveDeepExtend(fields, this.options, options);\n\n      this.minWidth = Number(`${this.options.width}`.replace(\"px\", \"\"));\n      if (redraw === true && this.dom.frame) {\n        this.hide();\n        this.show();\n      }\n    }\n  }\n\n  /**\n   * Create the HTML DOM for the DataAxis\n   */\n  _create() {\n    this.dom.frame = document.createElement(\"div\");\n    this.dom.frame.style.width = this.options.width;\n    this.dom.frame.style.height = this.height;\n\n    this.dom.lineContainer = document.createElement(\"div\");\n    this.dom.lineContainer.style.width = \"100%\";\n    this.dom.lineContainer.style.height = this.height;\n    this.dom.lineContainer.style.position = \"relative\";\n    this.dom.lineContainer.style.visibility = \"visible\";\n    this.dom.lineContainer.style.display = \"block\";\n\n    // create svg element for graph drawing.\n    this.svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n    this.svg.style.position = \"absolute\";\n    this.svg.style.top = \"0px\";\n    this.svg.style.height = \"100%\";\n    this.svg.style.width = \"100%\";\n    this.svg.style.display = \"block\";\n    this.dom.frame.appendChild(this.svg);\n  }\n\n  /**\n   * redraws groups icons\n   */\n  _redrawGroupIcons() {\n    DOMutil.prepareElements(this.svgElements);\n\n    let x;\n    const iconWidth = this.options.iconWidth;\n    const iconHeight = 15;\n    const iconOffset = 4;\n    let y = iconOffset + 0.5 * iconHeight;\n\n    if (this.options.orientation === \"left\") {\n      x = iconOffset;\n    } else {\n      x = this.width - iconWidth - iconOffset;\n    }\n\n    const groupArray = Object.keys(this.groups);\n    groupArray.sort((a, b) => (a < b ? -1 : 1));\n\n    for (const groupId of groupArray) {\n      if (\n        this.groups[groupId].visible === true &&\n        (this.linegraphOptions.visibility[groupId] === undefined ||\n          this.linegraphOptions.visibility[groupId] === true)\n      ) {\n        this.groups[groupId].getLegend(\n          iconWidth,\n          iconHeight,\n          this.framework,\n          x,\n          y,\n        );\n        y += iconHeight + iconOffset;\n      }\n    }\n\n    DOMutil.cleanupElements(this.svgElements);\n    this.iconsRemoved = false;\n  }\n\n  /**\n   * Cleans up icons\n   */\n  _cleanupIcons() {\n    if (this.iconsRemoved === false) {\n      DOMutil.prepareElements(this.svgElements);\n      DOMutil.cleanupElements(this.svgElements);\n      this.iconsRemoved = true;\n    }\n  }\n\n  /**\n   * Create the HTML DOM for the DataAxis\n   */\n  show() {\n    this.hidden = false;\n    if (!this.dom.frame.parentNode) {\n      if (this.options.orientation === \"left\") {\n        this.body.dom.left.appendChild(this.dom.frame);\n      } else {\n        this.body.dom.right.appendChild(this.dom.frame);\n      }\n    }\n\n    if (!this.dom.lineContainer.parentNode) {\n      this.body.dom.backgroundHorizontal.appendChild(this.dom.lineContainer);\n    }\n    this.dom.lineContainer.style.display = \"block\";\n  }\n\n  /**\n   * Create the HTML DOM for the DataAxis\n   */\n  hide() {\n    this.hidden = true;\n    if (this.dom.frame.parentNode) {\n      this.dom.frame.parentNode.removeChild(this.dom.frame);\n    }\n\n    this.dom.lineContainer.style.display = \"none\";\n  }\n\n  /**\n   * Set a range (start and end)\n   * @param {number} start\n   * @param {number} end\n   */\n  setRange(start, end) {\n    this.range.start = start;\n    this.range.end = end;\n  }\n\n  /**\n   * Repaint the component\n   * @return {boolean} Returns true if the component is resized\n   */\n  redraw() {\n    let resized = false;\n    let activeGroups = 0;\n\n    // Make sure the line container adheres to the vertical scrolling.\n    this.dom.lineContainer.style.top = `${this.body.domProps.scrollTop}px`;\n\n    for (const groupId in this.groups) {\n      if (!Object.prototype.hasOwnProperty.call(this.groups, groupId)) continue;\n\n      if (\n        this.groups[groupId].visible === true &&\n        (this.linegraphOptions.visibility[groupId] === undefined ||\n          this.linegraphOptions.visibility[groupId] === true)\n      )\n        activeGroups++;\n    }\n    if (this.amountOfGroups === 0 || activeGroups === 0) {\n      this.hide();\n    } else {\n      this.show();\n      this.height = Number(this.linegraphSVG.style.height.replace(\"px\", \"\"));\n\n      // svg offsetheight did not work in firefox and explorer...\n      this.dom.lineContainer.style.height = `${this.height}px`;\n      this.width =\n        this.options.visible === true\n          ? Number(`${this.options.width}`.replace(\"px\", \"\"))\n          : 0;\n\n      const props = this.props;\n      const frame = this.dom.frame;\n\n      // update classname\n      frame.className = \"vis-data-axis\";\n\n      // calculate character width and height\n      this._calculateCharSize();\n\n      const orientation = this.options.orientation;\n      const showMinorLabels = this.options.showMinorLabels;\n      const showMajorLabels = this.options.showMajorLabels;\n\n      const backgroundHorizontalOffsetWidth =\n        this.body.dom.backgroundHorizontal.offsetWidth;\n\n      // determine the width and height of the elements for the axis\n      props.minorLabelHeight = showMinorLabels ? props.minorCharHeight : 0;\n      props.majorLabelHeight = showMajorLabels ? props.majorCharHeight : 0;\n\n      props.minorLineWidth =\n        backgroundHorizontalOffsetWidth -\n        this.lineOffset -\n        this.width +\n        2 * this.options.minorLinesOffset;\n      props.minorLineHeight = 1;\n      props.majorLineWidth =\n        backgroundHorizontalOffsetWidth -\n        this.lineOffset -\n        this.width +\n        2 * this.options.majorLinesOffset;\n      props.majorLineHeight = 1;\n\n      //  take frame offline while updating (is almost twice as fast)\n      if (orientation === \"left\") {\n        frame.style.top = \"0\";\n        frame.style.left = \"0\";\n        frame.style.bottom = \"\";\n        frame.style.width = `${this.width}px`;\n        frame.style.height = `${this.height}px`;\n        this.props.width = this.body.domProps.left.width;\n        this.props.height = this.body.domProps.left.height;\n      } else {\n        // right\n        frame.style.top = \"\";\n        frame.style.bottom = \"0\";\n        frame.style.left = \"0\";\n        frame.style.width = `${this.width}px`;\n        frame.style.height = `${this.height}px`;\n        this.props.width = this.body.domProps.right.width;\n        this.props.height = this.body.domProps.right.height;\n      }\n\n      resized = this._redrawLabels();\n      resized = this._isResized() || resized;\n\n      if (this.options.icons === true) {\n        this._redrawGroupIcons();\n      } else {\n        this._cleanupIcons();\n      }\n\n      this._redrawTitle(orientation);\n    }\n    return resized;\n  }\n\n  /**\n   * Repaint major and minor text labels and vertical grid lines\n   *\n   * @returns {boolean}\n   * @private\n   */\n  _redrawLabels() {\n    let resized = false;\n    DOMutil.prepareElements(this.DOMelements.lines);\n    DOMutil.prepareElements(this.DOMelements.labels);\n    const orientation = this.options[\"orientation\"];\n    const customRange =\n      this.options[orientation].range != undefined\n        ? this.options[orientation].range\n        : {};\n\n    //Override range with manual options:\n    let autoScaleEnd = true;\n    if (customRange.max != undefined) {\n      this.range.end = customRange.max;\n      autoScaleEnd = false;\n    }\n    let autoScaleStart = true;\n    if (customRange.min != undefined) {\n      this.range.start = customRange.min;\n      autoScaleStart = false;\n    }\n\n    this.scale = new DataScale(\n      this.range.start,\n      this.range.end,\n      autoScaleStart,\n      autoScaleEnd,\n      this.dom.frame.offsetHeight,\n      this.props.majorCharHeight,\n      this.options.alignZeros,\n      this.options[orientation].format,\n    );\n\n    if (this.master === false && this.masterAxis != undefined) {\n      this.scale.followScale(this.masterAxis.scale);\n      this.dom.lineContainer.style.display = \"none\";\n    } else {\n      this.dom.lineContainer.style.display = \"block\";\n    }\n\n    //Is updated in side-effect of _redrawLabel():\n    this.maxLabelSize = 0;\n\n    const lines = this.scale.getLines();\n    lines.forEach((line) => {\n      const y = line.y;\n      const isMajor = line.major;\n      if (this.options[\"showMinorLabels\"] && isMajor === false) {\n        this._redrawLabel(\n          y - 2,\n          line.val,\n          orientation,\n          \"vis-y-axis vis-minor\",\n          this.props.minorCharHeight,\n        );\n      }\n      if (isMajor) {\n        if (y >= 0) {\n          this._redrawLabel(\n            y - 2,\n            line.val,\n            orientation,\n            \"vis-y-axis vis-major\",\n            this.props.majorCharHeight,\n          );\n        }\n      }\n      if (this.master === true) {\n        if (isMajor) {\n          this._redrawLine(\n            y,\n            orientation,\n            \"vis-grid vis-horizontal vis-major\",\n            this.options.majorLinesOffset,\n            this.props.majorLineWidth,\n          );\n        } else {\n          this._redrawLine(\n            y,\n            orientation,\n            \"vis-grid vis-horizontal vis-minor\",\n            this.options.minorLinesOffset,\n            this.props.minorLineWidth,\n          );\n        }\n      }\n    });\n\n    // Note that title is rotated, so we're using the height, not width!\n    let titleWidth = 0;\n    if (\n      this.options[orientation].title !== undefined &&\n      this.options[orientation].title.text !== undefined\n    ) {\n      titleWidth = this.props.titleCharHeight;\n    }\n    const offset =\n      this.options.icons === true\n        ? Math.max(this.options.iconWidth, titleWidth) +\n          this.options.labelOffsetX +\n          15\n        : titleWidth + this.options.labelOffsetX + 15;\n\n    // this will resize the yAxis to accommodate the labels.\n    if (\n      this.maxLabelSize > this.width - offset &&\n      this.options.visible === true\n    ) {\n      this.width = this.maxLabelSize + offset;\n      this.options.width = `${this.width}px`;\n      DOMutil.cleanupElements(this.DOMelements.lines);\n      DOMutil.cleanupElements(this.DOMelements.labels);\n      this.redraw();\n      resized = true;\n    }\n    // this will resize the yAxis if it is too big for the labels.\n    else if (\n      this.maxLabelSize < this.width - offset &&\n      this.options.visible === true &&\n      this.width > this.minWidth\n    ) {\n      this.width = Math.max(this.minWidth, this.maxLabelSize + offset);\n      this.options.width = `${this.width}px`;\n      DOMutil.cleanupElements(this.DOMelements.lines);\n      DOMutil.cleanupElements(this.DOMelements.labels);\n      this.redraw();\n      resized = true;\n    } else {\n      DOMutil.cleanupElements(this.DOMelements.lines);\n      DOMutil.cleanupElements(this.DOMelements.labels);\n      resized = false;\n    }\n\n    return resized;\n  }\n\n  /**\n   * converts value\n   * @param {number} value\n   * @returns {number} converted number\n   */\n  convertValue(value) {\n    return this.scale.convertValue(value);\n  }\n\n  /**\n   * converts value\n   * @param {number} x\n   * @returns {number} screen value\n   */\n  screenToValue(x) {\n    return this.scale.screenToValue(x);\n  }\n\n  /**\n   * Create a label for the axis at position x\n   *\n   * @param {number} y\n   * @param {string} text\n   * @param {'top'|'right'|'bottom'|'left'} orientation\n   * @param {string} className\n   * @param {number} characterHeight\n   * @private\n   */\n  _redrawLabel(y, text, orientation, className, characterHeight) {\n    // reuse redundant label\n    const label = DOMutil.getDOMElement(\n      \"div\",\n      this.DOMelements.labels,\n      this.dom.frame,\n    ); //this.dom.redundant.labels.shift();\n    label.className = className;\n    label.innerHTML = util.xss(text);\n    if (orientation === \"left\") {\n      label.style.left = `-${this.options.labelOffsetX}px`;\n      label.style.textAlign = \"right\";\n    } else {\n      label.style.right = `-${this.options.labelOffsetX}px`;\n      label.style.textAlign = \"left\";\n    }\n\n    label.style.top = `${y - 0.5 * characterHeight + this.options.labelOffsetY}px`;\n\n    text += \"\";\n\n    const largestWidth = Math.max(\n      this.props.majorCharWidth,\n      this.props.minorCharWidth,\n    );\n    if (this.maxLabelSize < text.length * largestWidth) {\n      this.maxLabelSize = text.length * largestWidth;\n    }\n  }\n\n  /**\n   * Create a minor line for the axis at position y\n   * @param {number} y\n   * @param {'top'|'right'|'bottom'|'left'} orientation\n   * @param {string} className\n   * @param {number} offset\n   * @param {number} width\n   */\n  _redrawLine(y, orientation, className, offset, width) {\n    if (this.master === true) {\n      const line = DOMutil.getDOMElement(\n        \"div\",\n        this.DOMelements.lines,\n        this.dom.lineContainer,\n      ); //this.dom.redundant.lines.shift();\n      line.className = className;\n      line.innerHTML = \"\";\n\n      if (orientation === \"left\") {\n        line.style.left = `${this.width - offset}px`;\n      } else {\n        line.style.right = `${this.width - offset}px`;\n      }\n\n      line.style.width = `${width}px`;\n      line.style.top = `${y}px`;\n    }\n  }\n\n  /**\n   * Create a title for the axis\n   * @private\n   * @param {'top'|'right'|'bottom'|'left'} orientation\n   */\n  _redrawTitle(orientation) {\n    DOMutil.prepareElements(this.DOMelements.title);\n\n    // Check if the title is defined for this axes\n    if (\n      this.options[orientation].title !== undefined &&\n      this.options[orientation].title.text !== undefined\n    ) {\n      const title = DOMutil.getDOMElement(\n        \"div\",\n        this.DOMelements.title,\n        this.dom.frame,\n      );\n      title.className = `vis-y-axis vis-title vis-${orientation}`;\n      title.innerHTML = util.xss(this.options[orientation].title.text);\n\n      // Add style - if provided\n      if (this.options[orientation].title.style !== undefined) {\n        util.addCssText(title, this.options[orientation].title.style);\n      }\n\n      if (orientation === \"left\") {\n        title.style.left = `${this.props.titleCharHeight}px`;\n      } else {\n        title.style.right = `${this.props.titleCharHeight}px`;\n      }\n\n      title.style.width = `${this.height}px`;\n    }\n\n    // we need to clean up in case we did not use all elements.\n    DOMutil.cleanupElements(this.DOMelements.title);\n  }\n\n  /**\n   * Determine the size of text on the axis (both major and minor axis).\n   * The size is calculated only once and then cached in this.props.\n   * @private\n   */\n  _calculateCharSize() {\n    // determine the char width and height on the minor axis\n    if (!(\"minorCharHeight\" in this.props)) {\n      const textMinor = document.createTextNode(\"0\");\n      const measureCharMinor = document.createElement(\"div\");\n      measureCharMinor.className = \"vis-y-axis vis-minor vis-measure\";\n      measureCharMinor.appendChild(textMinor);\n      this.dom.frame.appendChild(measureCharMinor);\n\n      this.props.minorCharHeight = measureCharMinor.clientHeight;\n      this.props.minorCharWidth = measureCharMinor.clientWidth;\n\n      this.dom.frame.removeChild(measureCharMinor);\n    }\n\n    if (!(\"majorCharHeight\" in this.props)) {\n      const textMajor = document.createTextNode(\"0\");\n      const measureCharMajor = document.createElement(\"div\");\n      measureCharMajor.className = \"vis-y-axis vis-major vis-measure\";\n      measureCharMajor.appendChild(textMajor);\n      this.dom.frame.appendChild(measureCharMajor);\n\n      this.props.majorCharHeight = measureCharMajor.clientHeight;\n      this.props.majorCharWidth = measureCharMajor.clientWidth;\n\n      this.dom.frame.removeChild(measureCharMajor);\n    }\n\n    if (!(\"titleCharHeight\" in this.props)) {\n      const textTitle = document.createTextNode(\"0\");\n      const measureCharTitle = document.createElement(\"div\");\n      measureCharTitle.className = \"vis-y-axis vis-title vis-measure\";\n      measureCharTitle.appendChild(textTitle);\n      this.dom.frame.appendChild(measureCharTitle);\n\n      this.props.titleCharHeight = measureCharTitle.clientHeight;\n      this.props.titleCharWidth = measureCharTitle.clientWidth;\n\n      this.dom.frame.removeChild(measureCharTitle);\n    }\n  }\n}\n\nexport default DataAxis;\n","import * as DOMutil from \"../../../DOMutil.js\";\n\n/**\n *\n *\n * @constructor Points\n */\nfunction Points() {}\n\n/**\n * draw the data points\n *\n * @param {Array} dataset\n * @param {GraphGroup} group\n * @param {Object} framework            | SVG DOM element\n * @param {number} [offset]\n */\nPoints.draw = function (dataset, group, framework, offset) {\n  offset = offset || 0;\n  var callback = getCallback(framework, group);\n\n  for (var i = 0; i < dataset.length; i++) {\n    if (!callback) {\n      // draw the point the simple way.\n      DOMutil.drawPoint(\n        dataset[i].screen_x + offset,\n        dataset[i].screen_y,\n        getGroupTemplate(group),\n        framework.svgElements,\n        framework.svg,\n        dataset[i].label,\n      );\n    } else {\n      var callbackResult = callback(dataset[i], group); // result might be true, false or an object\n      if (callbackResult === true || typeof callbackResult === \"object\") {\n        DOMutil.drawPoint(\n          dataset[i].screen_x + offset,\n          dataset[i].screen_y,\n          getGroupTemplate(group, callbackResult),\n          framework.svgElements,\n          framework.svg,\n          dataset[i].label,\n        );\n      }\n    }\n  }\n};\n\nPoints.drawIcon = function (group, x, y, iconWidth, iconHeight, framework) {\n  var fillHeight = iconHeight * 0.5;\n\n  var outline = DOMutil.getSVGElement(\n    \"rect\",\n    framework.svgElements,\n    framework.svg,\n  );\n  outline.setAttributeNS(null, \"x\", x);\n  outline.setAttributeNS(null, \"y\", y - fillHeight);\n  outline.setAttributeNS(null, \"width\", iconWidth);\n  outline.setAttributeNS(null, \"height\", 2 * fillHeight);\n  outline.setAttributeNS(null, \"class\", \"vis-outline\");\n\n  //Don't call callback on icon\n  DOMutil.drawPoint(\n    x + 0.5 * iconWidth,\n    y,\n    getGroupTemplate(group),\n    framework.svgElements,\n    framework.svg,\n  );\n};\n\n/**\n *\n * @param {vis.Group} group\n * @param {any} callbackResult\n * @returns {{style: *, styles: (*|string), size: *, className: *}}\n */\nfunction getGroupTemplate(group, callbackResult) {\n  callbackResult = typeof callbackResult === \"undefined\" ? {} : callbackResult;\n  return {\n    style: callbackResult.style || group.options.drawPoints.style,\n    styles: callbackResult.styles || group.options.drawPoints.styles,\n    size: callbackResult.size || group.options.drawPoints.size,\n    className: callbackResult.className || group.className,\n  };\n}\n\n/**\n *\n * @param {Object} framework            | SVG DOM element\n * @param {vis.Group} group\n * @returns {function}\n */\nfunction getCallback(framework, group) {\n  var callback = undefined;\n  // check for the graph2d onRender\n  if (\n    framework.options &&\n    framework.options.drawPoints &&\n    framework.options.drawPoints.onRender &&\n    typeof framework.options.drawPoints.onRender == \"function\"\n  ) {\n    callback = framework.options.drawPoints.onRender;\n  }\n\n  // override it with the group onRender if defined\n  if (\n    group.group.options &&\n    group.group.options.drawPoints &&\n    group.group.options.drawPoints.onRender &&\n    typeof group.group.options.drawPoints.onRender == \"function\"\n  ) {\n    callback = group.group.options.drawPoints.onRender;\n  }\n  return callback;\n}\n\nexport default Points;\n","import * as DOMutil from \"../../../DOMutil.js\";\nimport Points from \"./points.js\";\n\n/**\n *\n * @constructor Bargraph\n */\nfunction Bargraph() {}\n\nBargraph.drawIcon = function (group, x, y, iconWidth, iconHeight, framework) {\n  var fillHeight = iconHeight * 0.5;\n  var outline = DOMutil.getSVGElement(\n    \"rect\",\n    framework.svgElements,\n    framework.svg,\n  );\n  outline.setAttributeNS(null, \"x\", x);\n  outline.setAttributeNS(null, \"y\", y - fillHeight);\n  outline.setAttributeNS(null, \"width\", iconWidth);\n  outline.setAttributeNS(null, \"height\", 2 * fillHeight);\n  outline.setAttributeNS(null, \"class\", \"vis-outline\");\n\n  var barWidth = Math.round(0.3 * iconWidth);\n  var originalWidth = group.options.barChart.width;\n  var scale = originalWidth / barWidth;\n  var bar1Height = Math.round(0.4 * iconHeight);\n  var bar2Height = Math.round(0.75 * iconHeight);\n\n  var offset = Math.round((iconWidth - 2 * barWidth) / 3);\n\n  DOMutil.drawBar(\n    x + 0.5 * barWidth + offset,\n    y + fillHeight - bar1Height - 1,\n    barWidth,\n    bar1Height,\n    group.className + \" vis-bar\",\n    framework.svgElements,\n    framework.svg,\n    group.style,\n  );\n  DOMutil.drawBar(\n    x + 1.5 * barWidth + offset + 2,\n    y + fillHeight - bar2Height - 1,\n    barWidth,\n    bar2Height,\n    group.className + \" vis-bar\",\n    framework.svgElements,\n    framework.svg,\n    group.style,\n  );\n\n  if (group.options.drawPoints.enabled == true) {\n    var groupTemplate = {\n      style: group.options.drawPoints.style,\n      styles: group.options.drawPoints.styles,\n      size: group.options.drawPoints.size / scale,\n      className: group.className,\n    };\n    DOMutil.drawPoint(\n      x + 0.5 * barWidth + offset,\n      y + fillHeight - bar1Height - 1,\n      groupTemplate,\n      framework.svgElements,\n      framework.svg,\n    );\n    DOMutil.drawPoint(\n      x + 1.5 * barWidth + offset + 2,\n      y + fillHeight - bar2Height - 1,\n      groupTemplate,\n      framework.svgElements,\n      framework.svg,\n    );\n  }\n};\n\n/**\n * draw a bar graph\n *\n * @param {Array.<vis.GraphGroup.id>} groupIds\n * @param {Object} processedGroupData\n * @param {{svg: Object, svgElements: Array.<Object>, options: Object, groups: Array.<vis.Group>}} framework\n */\nBargraph.draw = function (groupIds, processedGroupData, framework) {\n  var combinedData = [];\n  var intersections = {};\n  var coreDistance;\n  var key, drawData;\n  var group;\n  var i, j;\n  var barPoints = 0;\n\n  // combine all barchart data\n  for (i = 0; i < groupIds.length; i++) {\n    group = framework.groups[groupIds[i]];\n    if (group.options.style === \"bar\") {\n      if (\n        group.visible === true &&\n        (framework.options.groups.visibility[groupIds[i]] === undefined ||\n          framework.options.groups.visibility[groupIds[i]] === true)\n      ) {\n        for (j = 0; j < processedGroupData[groupIds[i]].length; j++) {\n          combinedData.push({\n            screen_x: processedGroupData[groupIds[i]][j].screen_x,\n            screen_end: processedGroupData[groupIds[i]][j].screen_end,\n            screen_y: processedGroupData[groupIds[i]][j].screen_y,\n            x: processedGroupData[groupIds[i]][j].x,\n            end: processedGroupData[groupIds[i]][j].end,\n            y: processedGroupData[groupIds[i]][j].y,\n            groupId: groupIds[i],\n            label: processedGroupData[groupIds[i]][j].label,\n          });\n          barPoints += 1;\n        }\n      }\n    }\n  }\n\n  if (barPoints === 0) {\n    return;\n  }\n\n  // sort by time and by group\n  combinedData.sort(function (a, b) {\n    if (a.screen_x === b.screen_x) {\n      return a.groupId < b.groupId ? -1 : 1;\n    } else {\n      return a.screen_x - b.screen_x;\n    }\n  });\n\n  // get intersections\n  Bargraph._getDataIntersections(intersections, combinedData);\n\n  // plot barchart\n  for (i = 0; i < combinedData.length; i++) {\n    group = framework.groups[combinedData[i].groupId];\n    var minWidth =\n      group.options.barChart.minWidth != undefined\n        ? group.options.barChart.minWidth\n        : 0.1 * group.options.barChart.width;\n\n    key = combinedData[i].screen_x;\n    var heightOffset = 0;\n    if (intersections[key] === undefined) {\n      if (i + 1 < combinedData.length) {\n        coreDistance = Math.abs(combinedData[i + 1].screen_x - key);\n      }\n      drawData = Bargraph._getSafeDrawData(coreDistance, group, minWidth);\n    } else {\n      var nextKey =\n        i + (intersections[key].amount - intersections[key].resolved);\n      if (nextKey < combinedData.length) {\n        coreDistance = Math.abs(combinedData[nextKey].screen_x - key);\n      }\n      drawData = Bargraph._getSafeDrawData(coreDistance, group, minWidth);\n      intersections[key].resolved += 1;\n\n      if (\n        group.options.stack === true &&\n        group.options.excludeFromStacking !== true\n      ) {\n        if (combinedData[i].screen_y < group.zeroPosition) {\n          heightOffset = intersections[key].accumulatedNegative;\n          intersections[key].accumulatedNegative +=\n            group.zeroPosition - combinedData[i].screen_y;\n        } else {\n          heightOffset = intersections[key].accumulatedPositive;\n          intersections[key].accumulatedPositive +=\n            group.zeroPosition - combinedData[i].screen_y;\n        }\n      } else if (group.options.barChart.sideBySide === true) {\n        drawData.width = drawData.width / intersections[key].amount;\n        drawData.offset +=\n          intersections[key].resolved * drawData.width -\n          0.5 * drawData.width * (intersections[key].amount + 1);\n      }\n    }\n\n    let dataWidth = drawData.width;\n    let start = combinedData[i].screen_x;\n\n    // are we drawing explicit boxes? (we supplied an end value)\n    if (combinedData[i].screen_end != undefined) {\n      dataWidth = combinedData[i].screen_end - combinedData[i].screen_x;\n      start += dataWidth * 0.5;\n    } else {\n      start += drawData.offset;\n    }\n\n    DOMutil.drawBar(\n      start,\n      combinedData[i].screen_y - heightOffset,\n      dataWidth,\n      group.zeroPosition - combinedData[i].screen_y,\n      group.className + \" vis-bar\",\n      framework.svgElements,\n      framework.svg,\n      group.style,\n    );\n\n    // draw points\n    if (group.options.drawPoints.enabled === true) {\n      let pointData = {\n        screen_x: combinedData[i].screen_x,\n        screen_y: combinedData[i].screen_y - heightOffset,\n        x: combinedData[i].x,\n        y: combinedData[i].y,\n        groupId: combinedData[i].groupId,\n        label: combinedData[i].label,\n      };\n      Points.draw([pointData], group, framework, drawData.offset);\n      //DOMutil.drawPoint(combinedData[i].x + drawData.offset, combinedData[i].y, group, framework.svgElements, framework.svg);\n    }\n  }\n};\n\n/**\n * Fill the intersections object with counters of how many datapoints share the same x coordinates\n * @param {Object} intersections\n * @param {Array.<Object>} combinedData\n * @private\n */\nBargraph._getDataIntersections = function (intersections, combinedData) {\n  // get intersections\n  var coreDistance;\n  for (var i = 0; i < combinedData.length; i++) {\n    if (i + 1 < combinedData.length) {\n      coreDistance = Math.abs(\n        combinedData[i + 1].screen_x - combinedData[i].screen_x,\n      );\n    }\n    if (i > 0) {\n      coreDistance = Math.min(\n        coreDistance,\n        Math.abs(combinedData[i - 1].screen_x - combinedData[i].screen_x),\n      );\n    }\n    if (coreDistance === 0) {\n      if (intersections[combinedData[i].screen_x] === undefined) {\n        intersections[combinedData[i].screen_x] = {\n          amount: 0,\n          resolved: 0,\n          accumulatedPositive: 0,\n          accumulatedNegative: 0,\n        };\n      }\n      intersections[combinedData[i].screen_x].amount += 1;\n    }\n  }\n};\n\n/**\n * Get the width and offset for bargraphs based on the coredistance between datapoints\n *\n * @param {number} coreDistance\n * @param {vis.Group} group\n * @param {number} minWidth\n * @returns {{width: number, offset: number}}\n * @private\n */\nBargraph._getSafeDrawData = function (coreDistance, group, minWidth) {\n  var width, offset;\n  if (coreDistance < group.options.barChart.width && coreDistance > 0) {\n    width = coreDistance < minWidth ? minWidth : coreDistance;\n\n    offset = 0; // recalculate offset with the new width;\n    if (group.options.barChart.align === \"left\") {\n      offset -= 0.5 * coreDistance;\n    } else if (group.options.barChart.align === \"right\") {\n      offset += 0.5 * coreDistance;\n    }\n  } else {\n    // default settings\n    width = group.options.barChart.width;\n    offset = 0;\n    if (group.options.barChart.align === \"left\") {\n      offset -= 0.5 * group.options.barChart.width;\n    } else if (group.options.barChart.align === \"right\") {\n      offset += 0.5 * group.options.barChart.width;\n    }\n  }\n\n  return { width: width, offset: offset };\n};\n\nBargraph.getStackedYRange = function (\n  combinedData,\n  groupRanges,\n  groupIds,\n  groupLabel,\n  orientation,\n) {\n  if (combinedData.length > 0) {\n    // sort by time and by group\n    combinedData.sort(function (a, b) {\n      if (a.screen_x === b.screen_x) {\n        return a.groupId < b.groupId ? -1 : 1;\n      } else {\n        return a.screen_x - b.screen_x;\n      }\n    });\n    var intersections = {};\n\n    Bargraph._getDataIntersections(intersections, combinedData);\n    groupRanges[groupLabel] = Bargraph._getStackedYRange(\n      intersections,\n      combinedData,\n    );\n    groupRanges[groupLabel].yAxisOrientation = orientation;\n    groupIds.push(groupLabel);\n  }\n};\n\nBargraph._getStackedYRange = function (intersections, combinedData) {\n  var key;\n  var yMin = combinedData[0].screen_y;\n  var yMax = combinedData[0].screen_y;\n  for (var i = 0; i < combinedData.length; i++) {\n    key = combinedData[i].screen_x;\n    if (intersections[key] === undefined) {\n      yMin = yMin > combinedData[i].screen_y ? combinedData[i].screen_y : yMin;\n      yMax = yMax < combinedData[i].screen_y ? combinedData[i].screen_y : yMax;\n    } else {\n      if (combinedData[i].screen_y < 0) {\n        intersections[key].accumulatedNegative += combinedData[i].screen_y;\n      } else {\n        intersections[key].accumulatedPositive += combinedData[i].screen_y;\n      }\n    }\n  }\n  for (var xpos in intersections) {\n    if (!Object.prototype.hasOwnProperty.call(intersections, xpos)) continue;\n\n    yMin =\n      yMin > intersections[xpos].accumulatedNegative\n        ? intersections[xpos].accumulatedNegative\n        : yMin;\n    yMin =\n      yMin > intersections[xpos].accumulatedPositive\n        ? intersections[xpos].accumulatedPositive\n        : yMin;\n    yMax =\n      yMax < intersections[xpos].accumulatedNegative\n        ? intersections[xpos].accumulatedNegative\n        : yMax;\n    yMax =\n      yMax < intersections[xpos].accumulatedPositive\n        ? intersections[xpos].accumulatedPositive\n        : yMax;\n  }\n\n  return { min: yMin, max: yMax };\n};\n\nexport default Bargraph;\n","import * as DOMutil from \"../../../DOMutil.js\";\n\n/**\n *\n * @constructor Line\n */\nfunction Line() {}\n\nLine.calcPath = function (dataset, group) {\n  if (dataset != null) {\n    if (dataset.length > 0) {\n      var d = [];\n\n      // construct path from dataset\n      if (group.options.interpolation.enabled == true) {\n        d = Line._catmullRom(dataset, group);\n      } else {\n        d = Line._linear(dataset);\n      }\n      return d;\n    }\n  }\n};\n\nLine.drawIcon = function (group, x, y, iconWidth, iconHeight, framework) {\n  var fillHeight = iconHeight * 0.5;\n  var path, fillPath;\n\n  var outline = DOMutil.getSVGElement(\n    \"rect\",\n    framework.svgElements,\n    framework.svg,\n  );\n  outline.setAttributeNS(null, \"x\", x);\n  outline.setAttributeNS(null, \"y\", y - fillHeight);\n  outline.setAttributeNS(null, \"width\", iconWidth);\n  outline.setAttributeNS(null, \"height\", 2 * fillHeight);\n  outline.setAttributeNS(null, \"class\", \"vis-outline\");\n\n  path = DOMutil.getSVGElement(\"path\", framework.svgElements, framework.svg);\n  path.setAttributeNS(null, \"class\", group.className);\n  if (group.style !== undefined) {\n    path.setAttributeNS(null, \"style\", group.style);\n  }\n\n  path.setAttributeNS(\n    null,\n    \"d\",\n    \"M\" + x + \",\" + y + \" L\" + (x + iconWidth) + \",\" + y + \"\",\n  );\n  if (group.options.shaded.enabled == true) {\n    fillPath = DOMutil.getSVGElement(\n      \"path\",\n      framework.svgElements,\n      framework.svg,\n    );\n    if (group.options.shaded.orientation == \"top\") {\n      fillPath.setAttributeNS(\n        null,\n        \"d\",\n        \"M\" +\n          x +\n          \", \" +\n          (y - fillHeight) +\n          \"L\" +\n          x +\n          \",\" +\n          y +\n          \" L\" +\n          (x + iconWidth) +\n          \",\" +\n          y +\n          \" L\" +\n          (x + iconWidth) +\n          \",\" +\n          (y - fillHeight),\n      );\n    } else {\n      fillPath.setAttributeNS(\n        null,\n        \"d\",\n        \"M\" +\n          x +\n          \",\" +\n          y +\n          \" \" +\n          \"L\" +\n          x +\n          \",\" +\n          (y + fillHeight) +\n          \" \" +\n          \"L\" +\n          (x + iconWidth) +\n          \",\" +\n          (y + fillHeight) +\n          \"L\" +\n          (x + iconWidth) +\n          \",\" +\n          y,\n      );\n    }\n    fillPath.setAttributeNS(null, \"class\", group.className + \" vis-icon-fill\");\n    if (\n      group.options.shaded.style !== undefined &&\n      group.options.shaded.style !== \"\"\n    ) {\n      fillPath.setAttributeNS(null, \"style\", group.options.shaded.style);\n    }\n  }\n\n  if (group.options.drawPoints.enabled == true) {\n    var groupTemplate = {\n      style: group.options.drawPoints.style,\n      styles: group.options.drawPoints.styles,\n      size: group.options.drawPoints.size,\n      className: group.className,\n    };\n    DOMutil.drawPoint(\n      x + 0.5 * iconWidth,\n      y,\n      groupTemplate,\n      framework.svgElements,\n      framework.svg,\n    );\n  }\n};\n\nLine.drawShading = function (pathArray, group, subPathArray, framework) {\n  // append shading to the path\n  if (group.options.shaded.enabled == true) {\n    var svgHeight = Number(framework.svg.style.height.replace(\"px\", \"\"));\n    var fillPath = DOMutil.getSVGElement(\n      \"path\",\n      framework.svgElements,\n      framework.svg,\n    );\n    var type = \"L\";\n    if (group.options.interpolation.enabled == true) {\n      type = \"C\";\n    }\n    var dFill;\n    var zero = 0;\n    if (group.options.shaded.orientation == \"top\") {\n      zero = 0;\n    } else if (group.options.shaded.orientation == \"bottom\") {\n      zero = svgHeight;\n    } else {\n      zero = Math.min(Math.max(0, group.zeroPosition), svgHeight);\n    }\n    if (\n      group.options.shaded.orientation == \"group\" &&\n      subPathArray != null &&\n      subPathArray != undefined\n    ) {\n      dFill =\n        \"M\" +\n        pathArray[0][0] +\n        \",\" +\n        pathArray[0][1] +\n        \" \" +\n        this.serializePath(pathArray, type, false) +\n        \" L\" +\n        subPathArray[subPathArray.length - 1][0] +\n        \",\" +\n        subPathArray[subPathArray.length - 1][1] +\n        \" \" +\n        this.serializePath(subPathArray, type, true) +\n        subPathArray[0][0] +\n        \",\" +\n        subPathArray[0][1] +\n        \" Z\";\n    } else {\n      dFill =\n        \"M\" +\n        pathArray[0][0] +\n        \",\" +\n        pathArray[0][1] +\n        \" \" +\n        this.serializePath(pathArray, type, false) +\n        \" V\" +\n        zero +\n        \" H\" +\n        pathArray[0][0] +\n        \" Z\";\n    }\n\n    fillPath.setAttributeNS(null, \"class\", group.className + \" vis-fill\");\n    if (group.options.shaded.style !== undefined) {\n      fillPath.setAttributeNS(null, \"style\", group.options.shaded.style);\n    }\n    fillPath.setAttributeNS(null, \"d\", dFill);\n  }\n};\n\n/**\n * draw a line graph\n *\n * @param {Array.<Object>} pathArray\n * @param {vis.Group} group\n * @param {{svg: Object, svgElements: Array.<Object>, options: Object, groups: Array.<vis.Group>}} framework\n */\nLine.draw = function (pathArray, group, framework) {\n  if (pathArray != null && pathArray != undefined) {\n    var path = DOMutil.getSVGElement(\n      \"path\",\n      framework.svgElements,\n      framework.svg,\n    );\n    path.setAttributeNS(null, \"class\", group.className);\n    if (group.style !== undefined) {\n      path.setAttributeNS(null, \"style\", group.style);\n    }\n\n    var type = \"L\";\n    if (group.options.interpolation.enabled == true) {\n      type = \"C\";\n    }\n    // copy properties to path for drawing.\n    path.setAttributeNS(\n      null,\n      \"d\",\n      \"M\" +\n        pathArray[0][0] +\n        \",\" +\n        pathArray[0][1] +\n        \" \" +\n        this.serializePath(pathArray, type, false),\n    );\n  }\n};\n\nLine.serializePath = function (pathArray, type, inverse) {\n  if (pathArray.length < 2) {\n    //Too little data to create a path.\n    return \"\";\n  }\n  var d = type;\n  var i;\n  if (inverse) {\n    for (i = pathArray.length - 2; i > 0; i--) {\n      d += pathArray[i][0] + \",\" + pathArray[i][1] + \" \";\n    }\n  } else {\n    for (i = 1; i < pathArray.length; i++) {\n      d += pathArray[i][0] + \",\" + pathArray[i][1] + \" \";\n    }\n  }\n  return d;\n};\n\n/**\n * This uses an uniform parametrization of the interpolation algorithm:\n * 'On the Parameterization of Catmull-Rom Curves' by Cem Yuksel et al.\n * @param {Array.<Object>} data\n * @returns {string}\n * @private\n */\nLine._catmullRomUniform = function (data) {\n  // catmull rom\n  var p0, p1, p2, p3, bp1, bp2;\n  var d = [];\n  d.push([Math.round(data[0].screen_x), Math.round(data[0].screen_y)]);\n  var normalization = 1 / 6;\n  var length = data.length;\n  for (var i = 0; i < length - 1; i++) {\n    p0 = i == 0 ? data[0] : data[i - 1];\n    p1 = data[i];\n    p2 = data[i + 1];\n    p3 = i + 2 < length ? data[i + 2] : p2;\n\n    // Catmull-Rom to Cubic Bezier conversion matrix\n    //    0       1       0       0\n    //  -1/6      1      1/6      0\n    //    0      1/6      1     -1/6\n    //    0       0       1       0\n\n    //    bp0 = { x: p1.x,                               y: p1.y };\n    bp1 = {\n      screen_x: (-p0.screen_x + 6 * p1.screen_x + p2.screen_x) * normalization,\n      screen_y: (-p0.screen_y + 6 * p1.screen_y + p2.screen_y) * normalization,\n    };\n    bp2 = {\n      screen_x: (p1.screen_x + 6 * p2.screen_x - p3.screen_x) * normalization,\n      screen_y: (p1.screen_y + 6 * p2.screen_y - p3.screen_y) * normalization,\n    };\n    //    bp0 = { x: p2.x,                               y: p2.y };\n\n    d.push([bp1.screen_x, bp1.screen_y]);\n    d.push([bp2.screen_x, bp2.screen_y]);\n    d.push([p2.screen_x, p2.screen_y]);\n  }\n\n  return d;\n};\n\n/**\n * This uses either the chordal or centripetal parameterization of the catmull-rom algorithm.\n * By default, the centripetal parameterization is used because this gives the nicest results.\n * These parameterizations are relatively heavy because the distance between 4 points have to be calculated.\n *\n * One optimization can be used to reuse distances since this is a sliding window approach.\n * @param {Array.<Object>} data\n * @param {vis.GraphGroup} group\n * @returns {string}\n * @private\n */\nLine._catmullRom = function (data, group) {\n  var alpha = group.options.interpolation.alpha;\n  if (alpha == 0 || alpha === undefined) {\n    return this._catmullRomUniform(data);\n  } else {\n    var p0, p1, p2, p3, bp1, bp2, d1, d2, d3, A, B, N, M;\n    var d3powA, d2powA, d3pow2A, d2pow2A, d1pow2A, d1powA;\n    var d = [];\n    d.push([Math.round(data[0].screen_x), Math.round(data[0].screen_y)]);\n    var length = data.length;\n    for (var i = 0; i < length - 1; i++) {\n      p0 = i == 0 ? data[0] : data[i - 1];\n      p1 = data[i];\n      p2 = data[i + 1];\n      p3 = i + 2 < length ? data[i + 2] : p2;\n\n      d1 = Math.sqrt(\n        Math.pow(p0.screen_x - p1.screen_x, 2) +\n          Math.pow(p0.screen_y - p1.screen_y, 2),\n      );\n      d2 = Math.sqrt(\n        Math.pow(p1.screen_x - p2.screen_x, 2) +\n          Math.pow(p1.screen_y - p2.screen_y, 2),\n      );\n      d3 = Math.sqrt(\n        Math.pow(p2.screen_x - p3.screen_x, 2) +\n          Math.pow(p2.screen_y - p3.screen_y, 2),\n      );\n\n      // Catmull-Rom to Cubic Bezier conversion matrix\n\n      // A = 2d1^2a + 3d1^a * d2^a + d3^2a\n      // B = 2d3^2a + 3d3^a * d2^a + d2^2a\n\n      // [   0             1            0          0          ]\n      // [   -d2^2a /N     A/N          d1^2a /N   0          ]\n      // [   0             d3^2a /M     B/M        -d2^2a /M  ]\n      // [   0             0            1          0          ]\n\n      d3powA = Math.pow(d3, alpha);\n      d3pow2A = Math.pow(d3, 2 * alpha);\n      d2powA = Math.pow(d2, alpha);\n      d2pow2A = Math.pow(d2, 2 * alpha);\n      d1powA = Math.pow(d1, alpha);\n      d1pow2A = Math.pow(d1, 2 * alpha);\n\n      A = 2 * d1pow2A + 3 * d1powA * d2powA + d2pow2A;\n      B = 2 * d3pow2A + 3 * d3powA * d2powA + d2pow2A;\n      N = 3 * d1powA * (d1powA + d2powA);\n      if (N > 0) {\n        N = 1 / N;\n      }\n      M = 3 * d3powA * (d3powA + d2powA);\n      if (M > 0) {\n        M = 1 / M;\n      }\n\n      bp1 = {\n        screen_x:\n          (-d2pow2A * p0.screen_x + A * p1.screen_x + d1pow2A * p2.screen_x) *\n          N,\n        screen_y:\n          (-d2pow2A * p0.screen_y + A * p1.screen_y + d1pow2A * p2.screen_y) *\n          N,\n      };\n\n      bp2 = {\n        screen_x:\n          (d3pow2A * p1.screen_x + B * p2.screen_x - d2pow2A * p3.screen_x) * M,\n        screen_y:\n          (d3pow2A * p1.screen_y + B * p2.screen_y - d2pow2A * p3.screen_y) * M,\n      };\n\n      if (bp1.screen_x == 0 && bp1.screen_y == 0) {\n        bp1 = p1;\n      }\n      if (bp2.screen_x == 0 && bp2.screen_y == 0) {\n        bp2 = p2;\n      }\n      d.push([bp1.screen_x, bp1.screen_y]);\n      d.push([bp2.screen_x, bp2.screen_y]);\n      d.push([p2.screen_x, p2.screen_y]);\n    }\n\n    return d;\n  }\n};\n\n/**\n * this generates the SVG path for a linear drawing between datapoints.\n * @param {Array.<Object>} data\n * @returns {string}\n * @private\n */\nLine._linear = function (data) {\n  // linear\n  var d = [];\n  for (var i = 0; i < data.length; i++) {\n    d.push([data[i].screen_x, data[i].screen_y]);\n  }\n  return d;\n};\n\nexport default Line;\n","import util from \"../../util.js\";\nimport Bars from \"./graph2d_types/bar.js\";\nimport Lines from \"./graph2d_types/line.js\";\nimport Points from \"./graph2d_types/points.js\";\n\n/**\n * /**\n * @param {object} group            | the object of the group from the dataset\n * @param {string} groupId          | ID of the group\n * @param {object} options          | the default options\n * @param {array} groupsUsingDefaultStyles  | this array has one entree.\n *                                            It is passed as an array so it is passed by reference.\n *                                            It enumerates through the default styles\n * @constructor GraphGroup\n */\nfunction GraphGroup(group, groupId, options, groupsUsingDefaultStyles) {\n  this.id = groupId;\n  var fields = [\n    \"sampling\",\n    \"style\",\n    \"sort\",\n    \"yAxisOrientation\",\n    \"barChart\",\n    \"drawPoints\",\n    \"shaded\",\n    \"interpolation\",\n    \"zIndex\",\n    \"excludeFromStacking\",\n    \"excludeFromLegend\",\n  ];\n  this.options = util.selectiveBridgeObject(fields, options);\n  this.usingDefaultStyle = group.className === undefined;\n  this.groupsUsingDefaultStyles = groupsUsingDefaultStyles;\n  this.zeroPosition = 0;\n  this.update(group);\n  if (this.usingDefaultStyle == true) {\n    this.groupsUsingDefaultStyles[0] += 1;\n  }\n  this.itemsData = [];\n  this.visible = group.visible === undefined ? true : group.visible;\n}\n\n/**\n * this loads a reference to all items in this group into this group.\n * @param {array} items\n */\nGraphGroup.prototype.setItems = function (items) {\n  if (items != null) {\n    this.itemsData = items;\n    if (this.options.sort == true) {\n      util.insertSort(this.itemsData, function (a, b) {\n        return a.x > b.x ? 1 : -1;\n      });\n    }\n  } else {\n    this.itemsData = [];\n  }\n};\n\nGraphGroup.prototype.getItems = function () {\n  return this.itemsData;\n};\n\n/**\n * this is used for barcharts and shading, this way, we only have to calculate it once.\n * @param {number} pos\n */\nGraphGroup.prototype.setZeroPosition = function (pos) {\n  this.zeroPosition = pos;\n};\n\n/**\n * set the options of the graph group over the default options.\n * @param {Object} options\n */\nGraphGroup.prototype.setOptions = function (options) {\n  if (options !== undefined) {\n    var fields = [\n      \"sampling\",\n      \"style\",\n      \"sort\",\n      \"yAxisOrientation\",\n      \"barChart\",\n      \"zIndex\",\n      \"excludeFromStacking\",\n      \"excludeFromLegend\",\n    ];\n    util.selectiveDeepExtend(fields, this.options, options);\n\n    // if the group's drawPoints is a function delegate the callback to the onRender property\n    if (typeof options.drawPoints == \"function\") {\n      options.drawPoints = {\n        onRender: options.drawPoints,\n      };\n    }\n\n    util.mergeOptions(this.options, options, \"interpolation\");\n    util.mergeOptions(this.options, options, \"drawPoints\");\n    util.mergeOptions(this.options, options, \"shaded\");\n\n    if (options.interpolation) {\n      if (typeof options.interpolation == \"object\") {\n        if (options.interpolation.parametrization) {\n          if (options.interpolation.parametrization == \"uniform\") {\n            this.options.interpolation.alpha = 0;\n          } else if (options.interpolation.parametrization == \"chordal\") {\n            this.options.interpolation.alpha = 1.0;\n          } else {\n            this.options.interpolation.parametrization = \"centripetal\";\n            this.options.interpolation.alpha = 0.5;\n          }\n        }\n      }\n    }\n  }\n};\n\n/**\n * this updates the current group class with the latest group dataset entree, used in _updateGroup in linegraph\n * @param {vis.Group} group\n */\nGraphGroup.prototype.update = function (group) {\n  this.group = group;\n  this.content = group.content || \"graph\";\n  this.className =\n    group.className ||\n    this.className ||\n    \"vis-graph-group\" + (this.groupsUsingDefaultStyles[0] % 10);\n  this.visible = group.visible === undefined ? true : group.visible;\n  this.style = group.style;\n  this.setOptions(group.options);\n};\n\n/**\n * return the legend entree for this group.\n *\n * @param {number} iconWidth\n * @param {number} iconHeight\n * @param {{svg: (*|Element), svgElements: Object, options: Object, groups: Array.<Object>}} framework\n * @param {number} x\n * @param {number} y\n * @returns {{icon: (*|Element), label: (*|string), orientation: *}}\n */\nGraphGroup.prototype.getLegend = function (\n  iconWidth,\n  iconHeight,\n  framework,\n  x,\n  y,\n) {\n  if (framework == undefined || framework == null) {\n    var svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n    framework = {\n      svg: svg,\n      svgElements: {},\n      options: this.options,\n      groups: [this],\n    };\n  }\n  if (x == undefined || x == null) {\n    x = 0;\n  }\n  if (y == undefined || y == null) {\n    y = 0.5 * iconHeight;\n  }\n  switch (this.options.style) {\n    case \"line\":\n      Lines.drawIcon(this, x, y, iconWidth, iconHeight, framework);\n      break;\n    case \"points\": //explicit no break\n    case \"point\":\n      Points.drawIcon(this, x, y, iconWidth, iconHeight, framework);\n      break;\n    case \"bar\":\n      Bars.drawIcon(this, x, y, iconWidth, iconHeight, framework);\n      break;\n  }\n  return {\n    icon: framework.svg,\n    label: this.content,\n    orientation: this.options.yAxisOrientation,\n  };\n};\n\nGraphGroup.prototype.getYRange = function (groupData) {\n  var yMin = groupData[0].y;\n  var yMax = groupData[0].y;\n  for (var j = 0; j < groupData.length; j++) {\n    yMin = yMin > groupData[j].y ? groupData[j].y : yMin;\n    yMax = yMax < groupData[j].y ? groupData[j].y : yMax;\n  }\n  return {\n    min: yMin,\n    max: yMax,\n    yAxisOrientation: this.options.yAxisOrientation,\n  };\n};\n\nexport default GraphGroup;\n","import util from \"../../util.js\";\nimport * as DOMutil from \"../../DOMutil.js\";\nimport Component from \"./Component.js\";\n\n/**\n * Legend for Graph2d\n *\n * @param {vis.Graph2d.body} body\n * @param {vis.Graph2d.options} options\n * @param {number} side\n * @param {vis.LineGraph.options} linegraphOptions\n * @constructor Legend\n * @extends Component\n */\nfunction Legend(body, options, side, linegraphOptions) {\n  this.body = body;\n  this.defaultOptions = {\n    enabled: false,\n    icons: true,\n    iconSize: 20,\n    iconSpacing: 6,\n    left: {\n      visible: true,\n      position: \"top-left\", // top/bottom - left,center,right\n    },\n    right: {\n      visible: true,\n      position: \"top-right\", // top/bottom - left,center,right\n    },\n  };\n\n  this.side = side;\n  this.options = util.extend({}, this.defaultOptions);\n  this.linegraphOptions = linegraphOptions;\n\n  this.svgElements = {};\n  this.dom = {};\n  this.groups = {};\n  this.amountOfGroups = 0;\n  this._create();\n  this.framework = {\n    svg: this.svg,\n    svgElements: this.svgElements,\n    options: this.options,\n    groups: this.groups,\n  };\n\n  this.setOptions(options);\n}\n\nLegend.prototype = new Component();\n\nLegend.prototype.clear = function () {\n  this.groups = {};\n  this.amountOfGroups = 0;\n};\n\nLegend.prototype.addGroup = function (label, graphOptions) {\n  // Include a group only if the group option 'excludeFromLegend: false' is not set.\n  if (graphOptions.options.excludeFromLegend != true) {\n    if (!Object.prototype.hasOwnProperty.call(this.groups, label)) {\n      this.groups[label] = graphOptions;\n    }\n    this.amountOfGroups += 1;\n  }\n};\n\nLegend.prototype.updateGroup = function (label, graphOptions) {\n  this.groups[label] = graphOptions;\n};\n\nLegend.prototype.removeGroup = function (label) {\n  if (Object.prototype.hasOwnProperty.call(this.groups, label)) {\n    delete this.groups[label];\n    this.amountOfGroups -= 1;\n  }\n};\n\nLegend.prototype._create = function () {\n  this.dom.frame = document.createElement(\"div\");\n  this.dom.frame.className = \"vis-legend\";\n  this.dom.frame.style.position = \"absolute\";\n  this.dom.frame.style.top = \"10px\";\n  this.dom.frame.style.display = \"block\";\n\n  this.dom.textArea = document.createElement(\"div\");\n  this.dom.textArea.className = \"vis-legend-text\";\n  this.dom.textArea.style.position = \"relative\";\n  this.dom.textArea.style.top = \"0px\";\n\n  this.svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n  this.svg.style.position = \"absolute\";\n  this.svg.style.top = 0 + \"px\";\n  this.svg.style.width = this.options.iconSize + 5 + \"px\";\n  this.svg.style.height = \"100%\";\n\n  this.dom.frame.appendChild(this.svg);\n  this.dom.frame.appendChild(this.dom.textArea);\n};\n\n/**\n * Hide the component from the DOM\n */\nLegend.prototype.hide = function () {\n  // remove the frame containing the items\n  if (this.dom.frame.parentNode) {\n    this.dom.frame.parentNode.removeChild(this.dom.frame);\n  }\n};\n\n/**\n * Show the component in the DOM (when not already visible).\n */\nLegend.prototype.show = function () {\n  // show frame containing the items\n  if (!this.dom.frame.parentNode) {\n    this.body.dom.center.appendChild(this.dom.frame);\n  }\n};\n\nLegend.prototype.setOptions = function (options) {\n  var fields = [\"enabled\", \"orientation\", \"icons\", \"left\", \"right\"];\n  util.selectiveDeepExtend(fields, this.options, options);\n};\n\nLegend.prototype.redraw = function () {\n  var activeGroups = 0;\n  var groupArray = Object.keys(this.groups);\n  groupArray.sort(function (a, b) {\n    return a < b ? -1 : 1;\n  });\n\n  for (var i = 0; i < groupArray.length; i++) {\n    var groupId = groupArray[i];\n    if (\n      this.groups[groupId].visible == true &&\n      (this.linegraphOptions.visibility[groupId] === undefined ||\n        this.linegraphOptions.visibility[groupId] == true)\n    ) {\n      activeGroups++;\n    }\n  }\n\n  if (\n    this.options[this.side].visible == false ||\n    this.amountOfGroups == 0 ||\n    this.options.enabled == false ||\n    activeGroups == 0\n  ) {\n    this.hide();\n  } else {\n    this.show();\n    if (\n      this.options[this.side].position == \"top-left\" ||\n      this.options[this.side].position == \"bottom-left\"\n    ) {\n      this.dom.frame.style.left = \"4px\";\n      this.dom.frame.style.textAlign = \"left\";\n      this.dom.textArea.style.textAlign = \"left\";\n      this.dom.textArea.style.left = this.options.iconSize + 15 + \"px\";\n      this.dom.textArea.style.right = \"\";\n      this.svg.style.left = 0 + \"px\";\n      this.svg.style.right = \"\";\n    } else {\n      this.dom.frame.style.right = \"4px\";\n      this.dom.frame.style.textAlign = \"right\";\n      this.dom.textArea.style.textAlign = \"right\";\n      this.dom.textArea.style.right = this.options.iconSize + 15 + \"px\";\n      this.dom.textArea.style.left = \"\";\n      this.svg.style.right = 0 + \"px\";\n      this.svg.style.left = \"\";\n    }\n\n    if (\n      this.options[this.side].position == \"top-left\" ||\n      this.options[this.side].position == \"top-right\"\n    ) {\n      this.dom.frame.style.top =\n        4 - Number(this.body.dom.center.style.top.replace(\"px\", \"\")) + \"px\";\n      this.dom.frame.style.bottom = \"\";\n    } else {\n      var scrollableHeight =\n        this.body.domProps.center.height -\n        this.body.domProps.centerContainer.height;\n      this.dom.frame.style.bottom =\n        4 +\n        scrollableHeight +\n        Number(this.body.dom.center.style.top.replace(\"px\", \"\")) +\n        \"px\";\n      this.dom.frame.style.top = \"\";\n    }\n\n    if (this.options.icons == false) {\n      this.dom.frame.style.width = this.dom.textArea.offsetWidth + 10 + \"px\";\n      this.dom.textArea.style.right = \"\";\n      this.dom.textArea.style.left = \"\";\n      this.svg.style.width = \"0px\";\n    } else {\n      this.dom.frame.style.width =\n        this.options.iconSize + 15 + this.dom.textArea.offsetWidth + 10 + \"px\";\n      this.drawLegendIcons();\n    }\n\n    var content = \"\";\n    for (i = 0; i < groupArray.length; i++) {\n      groupId = groupArray[i];\n      if (\n        this.groups[groupId].visible == true &&\n        (this.linegraphOptions.visibility[groupId] === undefined ||\n          this.linegraphOptions.visibility[groupId] == true)\n      ) {\n        content += this.groups[groupId].content + \"<br />\";\n      }\n    }\n    this.dom.textArea.innerHTML = util.xss(content);\n    this.dom.textArea.style.lineHeight =\n      0.75 * this.options.iconSize + this.options.iconSpacing + \"px\";\n  }\n};\n\nLegend.prototype.drawLegendIcons = function () {\n  if (this.dom.frame.parentNode) {\n    var groupArray = Object.keys(this.groups);\n    groupArray.sort(function (a, b) {\n      return a < b ? -1 : 1;\n    });\n\n    // this resets the elements so the order is maintained\n    DOMutil.resetElements(this.svgElements);\n\n    var padding = window.getComputedStyle(this.dom.frame).paddingTop;\n    var iconOffset = Number(padding.replace(\"px\", \"\"));\n    var x = iconOffset;\n    var iconWidth = this.options.iconSize;\n    var iconHeight = 0.75 * this.options.iconSize;\n    var y = iconOffset + 0.5 * iconHeight + 3;\n\n    this.svg.style.width = iconWidth + 5 + iconOffset + \"px\";\n\n    for (var i = 0; i < groupArray.length; i++) {\n      var groupId = groupArray[i];\n      if (\n        this.groups[groupId].visible == true &&\n        (this.linegraphOptions.visibility[groupId] === undefined ||\n          this.linegraphOptions.visibility[groupId] == true)\n      ) {\n        this.groups[groupId].getLegend(\n          iconWidth,\n          iconHeight,\n          this.framework,\n          x,\n          y,\n        );\n        y += iconHeight + this.options.iconSpacing;\n      }\n    }\n  }\n};\n\nexport default Legend;\n","import util, {\n  typeCoerceDataSet,\n  randomUUID,\n  isDataViewLike,\n} from \"../../util.js\";\nimport * as DOMutil from \"../../DOMutil.js\";\nimport Component from \"./Component.js\";\nimport DataAxis from \"./DataAxis.js\";\nimport GraphGroup from \"./GraphGroup.js\";\nimport Legend from \"./Legend.js\";\nimport Bars from \"./graph2d_types/bar.js\";\nimport Lines from \"./graph2d_types/line.js\";\nimport Points from \"./graph2d_types/points.js\";\n\nvar UNGROUPED = \"__ungrouped__\"; // reserved group id for ungrouped items\n\n/**\n * This is the constructor of the LineGraph. It requires a Timeline body and options.\n *\n * @param {vis.Timeline.body} body\n * @param {Object} options\n * @constructor LineGraph\n * @extends Component\n */\nfunction LineGraph(body, options) {\n  this.id = randomUUID();\n  this.body = body;\n\n  this.defaultOptions = {\n    yAxisOrientation: \"left\",\n    defaultGroup: \"default\",\n    sort: true,\n    sampling: true,\n    stack: false,\n    graphHeight: \"400px\",\n    shaded: {\n      enabled: false,\n      orientation: \"bottom\", // top, bottom, zero\n    },\n    style: \"line\", // line, bar\n    barChart: {\n      width: 50,\n      sideBySide: false,\n      align: \"center\", // left, center, right\n    },\n    interpolation: {\n      enabled: true,\n      parametrization: \"centripetal\", // uniform (alpha = 0.0), chordal (alpha = 1.0), centripetal (alpha = 0.5)\n      alpha: 0.5,\n    },\n    drawPoints: {\n      enabled: true,\n      size: 6,\n      style: \"square\", // square, circle\n    },\n    dataAxis: {}, //Defaults are done on DataAxis level\n    legend: {}, //Defaults are done on Legend level\n    groups: {\n      visibility: {},\n    },\n  };\n\n  // options is shared by this lineGraph and all its items\n  this.options = util.extend({}, this.defaultOptions);\n  this.dom = {};\n  this.props = {};\n  this.hammer = null;\n  this.groups = {};\n  this.abortedGraphUpdate = false;\n  this.updateSVGheight = false;\n  this.updateSVGheightOnResize = false;\n  this.forceGraphUpdate = true;\n\n  var me = this;\n  this.itemsData = null; // DataSet\n  this.groupsData = null; // DataSet\n\n  // listeners for the DataSet of the items\n  this.itemListeners = {\n    add: function (_event, params) {\n      me._onAdd(params.items);\n    },\n    update: function (_event, params) {\n      me._onUpdate(params.items);\n    },\n    remove: function (_event, params) {\n      me._onRemove(params.items);\n    },\n  };\n\n  // listeners for the DataSet of the groups\n  this.groupListeners = {\n    add: function (_event, params) {\n      me._onAddGroups(params.items);\n    },\n    update: function (_event, params) {\n      me._onUpdateGroups(params.items);\n    },\n    remove: function (_event, params) {\n      me._onRemoveGroups(params.items);\n    },\n  };\n\n  this.items = {}; // object with an Item for every data item\n  this.selection = []; // list with the ids of all selected nodes\n  this.lastStart = this.body.range.start;\n  this.touchParams = {}; // stores properties while dragging\n\n  this.svgElements = {};\n  this.setOptions(options);\n  this.groupsUsingDefaultStyles = [0];\n  this.body.emitter.on(\"rangechanged\", function () {\n    me.svg.style.left = util.option.asSize(-me.props.width);\n\n    me.forceGraphUpdate = true;\n    //Is this local redraw necessary? (Core also does a change event!)\n    me.redraw.call(me);\n  });\n\n  // create the HTML DOM\n  this._create();\n  this.framework = {\n    svg: this.svg,\n    svgElements: this.svgElements,\n    options: this.options,\n    groups: this.groups,\n  };\n}\n\nLineGraph.prototype = new Component();\n\n/**\n * Create the HTML DOM for the ItemSet\n */\nLineGraph.prototype._create = function () {\n  var frame = document.createElement(\"div\");\n  frame.className = \"vis-line-graph\";\n  this.dom.frame = frame;\n\n  // create svg element for graph drawing.\n  this.svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n  this.svg.style.position = \"relative\";\n  this.svg.style.height =\n    (\"\" + this.options.graphHeight).replace(\"px\", \"\") + \"px\";\n  this.svg.style.display = \"block\";\n  frame.appendChild(this.svg);\n\n  // data axis\n  this.options.dataAxis.orientation = \"left\";\n  this.yAxisLeft = new DataAxis(\n    this.body,\n    this.options.dataAxis,\n    this.svg,\n    this.options.groups,\n  );\n\n  this.options.dataAxis.orientation = \"right\";\n  this.yAxisRight = new DataAxis(\n    this.body,\n    this.options.dataAxis,\n    this.svg,\n    this.options.groups,\n  );\n  delete this.options.dataAxis.orientation;\n\n  // legends\n  this.legendLeft = new Legend(\n    this.body,\n    this.options.legend,\n    \"left\",\n    this.options.groups,\n  );\n  this.legendRight = new Legend(\n    this.body,\n    this.options.legend,\n    \"right\",\n    this.options.groups,\n  );\n\n  this.show();\n};\n\n/**\n * set the options of the LineGraph. the mergeOptions is used for subObjects that have an enabled element.\n * @param {object} options\n */\nLineGraph.prototype.setOptions = function (options) {\n  if (options) {\n    var fields = [\n      \"sampling\",\n      \"defaultGroup\",\n      \"stack\",\n      \"height\",\n      \"graphHeight\",\n      \"yAxisOrientation\",\n      \"style\",\n      \"barChart\",\n      \"dataAxis\",\n      \"sort\",\n      \"groups\",\n    ];\n    if (options.graphHeight === undefined && options.height !== undefined) {\n      this.updateSVGheight = true;\n      this.updateSVGheightOnResize = true;\n    } else if (\n      this.body.domProps.centerContainer.height !== undefined &&\n      options.graphHeight !== undefined\n    ) {\n      if (\n        parseInt((options.graphHeight + \"\").replace(\"px\", \"\")) <\n        this.body.domProps.centerContainer.height\n      ) {\n        this.updateSVGheight = true;\n      }\n    }\n    util.selectiveDeepExtend(fields, this.options, options);\n    util.mergeOptions(this.options, options, \"interpolation\");\n    util.mergeOptions(this.options, options, \"drawPoints\");\n    util.mergeOptions(this.options, options, \"shaded\");\n    util.mergeOptions(this.options, options, \"legend\");\n\n    if (options.interpolation) {\n      if (typeof options.interpolation == \"object\") {\n        if (options.interpolation.parametrization) {\n          if (options.interpolation.parametrization == \"uniform\") {\n            this.options.interpolation.alpha = 0;\n          } else if (options.interpolation.parametrization == \"chordal\") {\n            this.options.interpolation.alpha = 1.0;\n          } else {\n            this.options.interpolation.parametrization = \"centripetal\";\n            this.options.interpolation.alpha = 0.5;\n          }\n        }\n      }\n    }\n\n    if (this.yAxisLeft) {\n      if (options.dataAxis !== undefined) {\n        this.yAxisLeft.setOptions(this.options.dataAxis);\n        this.yAxisRight.setOptions(this.options.dataAxis);\n      }\n    }\n\n    if (this.legendLeft) {\n      if (options.legend !== undefined) {\n        this.legendLeft.setOptions(this.options.legend);\n        this.legendRight.setOptions(this.options.legend);\n      }\n    }\n\n    if (Object.prototype.hasOwnProperty.call(this.groups, UNGROUPED)) {\n      this.groups[UNGROUPED].setOptions(options);\n    }\n  }\n\n  // this is used to redraw the graph if the visibility of the groups is changed.\n  if (this.dom.frame) {\n    //not on initial run?\n    this.forceGraphUpdate = true;\n    this.body.emitter.emit(\"_change\", { queue: true });\n  }\n};\n\n/**\n * Hide the component from the DOM\n */\nLineGraph.prototype.hide = function () {\n  // remove the frame containing the items\n  if (this.dom.frame.parentNode) {\n    this.dom.frame.parentNode.removeChild(this.dom.frame);\n  }\n};\n\n/**\n * Show the component in the DOM (when not already visible).\n */\nLineGraph.prototype.show = function () {\n  // show frame containing the items\n  if (!this.dom.frame.parentNode) {\n    this.body.dom.center.appendChild(this.dom.frame);\n  }\n};\n\n/**\n * Set items\n * @param {vis.DataSet | null} items\n */\nLineGraph.prototype.setItems = function (items) {\n  var me = this,\n    ids,\n    oldItemsData = this.itemsData;\n\n  // replace the dataset\n  if (!items) {\n    this.itemsData = null;\n  } else if (isDataViewLike(items)) {\n    this.itemsData = typeCoerceDataSet(items);\n  } else {\n    throw new TypeError(\n      \"Data must implement the interface of DataSet or DataView\",\n    );\n  }\n\n  if (oldItemsData) {\n    // unsubscribe from old dataset\n    util.forEach(this.itemListeners, function (callback, event) {\n      oldItemsData.off(event, callback);\n    });\n\n    // stop maintaining a coerced version of the old data set\n    oldItemsData.dispose();\n\n    // remove all drawn items\n    ids = oldItemsData.getIds();\n    this._onRemove(ids);\n  }\n\n  if (this.itemsData) {\n    // subscribe to new dataset\n    var id = this.id;\n    util.forEach(this.itemListeners, function (callback, event) {\n      me.itemsData.on(event, callback, id);\n    });\n\n    // add all new items\n    ids = this.itemsData.getIds();\n    this._onAdd(ids);\n  }\n};\n\n/**\n * Set groups\n * @param {vis.DataSet} groups\n */\nLineGraph.prototype.setGroups = function (groups) {\n  var me = this;\n  var ids;\n\n  // unsubscribe from current dataset\n  if (this.groupsData) {\n    util.forEach(this.groupListeners, function (callback, event) {\n      me.groupsData.off(event, callback);\n    });\n\n    // remove all drawn groups\n    ids = this.groupsData.getIds();\n    this.groupsData = null;\n    for (var i = 0; i < ids.length; i++) {\n      this._removeGroup(ids[i]);\n    }\n  }\n\n  // replace the dataset\n  if (!groups) {\n    this.groupsData = null;\n  } else if (isDataViewLike(groups)) {\n    this.groupsData = groups;\n  } else {\n    throw new TypeError(\n      \"Data must implement the interface of DataSet or DataView\",\n    );\n  }\n\n  if (this.groupsData) {\n    // subscribe to new dataset\n    var id = this.id;\n    util.forEach(this.groupListeners, function (callback, event) {\n      me.groupsData.on(event, callback, id);\n    });\n\n    // draw all ms\n    ids = this.groupsData.getIds();\n    this._onAddGroups(ids);\n  }\n};\n\nLineGraph.prototype._onUpdate = function (ids) {\n  this._updateAllGroupData(ids);\n};\nLineGraph.prototype._onAdd = function (ids) {\n  this._onUpdate(ids);\n};\nLineGraph.prototype._onRemove = function (ids) {\n  this._onUpdate(ids);\n};\nLineGraph.prototype._onUpdateGroups = function (groupIds) {\n  this._updateAllGroupData(null, groupIds);\n};\nLineGraph.prototype._onAddGroups = function (groupIds) {\n  this._onUpdateGroups(groupIds);\n};\n\n/**\n * this cleans the group out off the legends and the dataaxis, updates the ungrouped and updates the graph\n * @param {Array} groupIds\n * @private\n */\nLineGraph.prototype._onRemoveGroups = function (groupIds) {\n  for (var i = 0; i < groupIds.length; i++) {\n    this._removeGroup(groupIds[i]);\n  }\n  this.forceGraphUpdate = true;\n  this.body.emitter.emit(\"_change\", { queue: true });\n};\n\n/**\n * this cleans the group out off the legends and the dataaxis\n * @param {vis.GraphGroup.id} groupId\n * @private\n */\nLineGraph.prototype._removeGroup = function (groupId) {\n  if (!Object.prototype.hasOwnProperty.call(this.groups, groupId)) return;\n\n  if (this.groups[groupId].options.yAxisOrientation == \"right\") {\n    this.yAxisRight.removeGroup(groupId);\n    this.legendRight.removeGroup(groupId);\n    this.legendRight.redraw();\n  } else {\n    this.yAxisLeft.removeGroup(groupId);\n    this.legendLeft.removeGroup(groupId);\n    this.legendLeft.redraw();\n  }\n  delete this.groups[groupId];\n};\n\n/**\n * update a group object with the group dataset entree\n *\n * @param {vis.GraphGroup} group\n * @param {vis.GraphGroup.id} groupId\n * @private\n */\nLineGraph.prototype._updateGroup = function (group, groupId) {\n  if (!Object.prototype.hasOwnProperty.call(this.groups, groupId)) {\n    this.groups[groupId] = new GraphGroup(\n      group,\n      groupId,\n      this.options,\n      this.groupsUsingDefaultStyles,\n    );\n    if (this.groups[groupId].options.yAxisOrientation == \"right\") {\n      this.yAxisRight.addGroup(groupId, this.groups[groupId]);\n      this.legendRight.addGroup(groupId, this.groups[groupId]);\n    } else {\n      this.yAxisLeft.addGroup(groupId, this.groups[groupId]);\n      this.legendLeft.addGroup(groupId, this.groups[groupId]);\n    }\n  } else {\n    this.groups[groupId].update(group);\n    if (this.groups[groupId].options.yAxisOrientation == \"right\") {\n      this.yAxisRight.updateGroup(groupId, this.groups[groupId]);\n      this.legendRight.updateGroup(groupId, this.groups[groupId]);\n      //If yAxisOrientation changed, clean out the group from the other axis.\n      this.yAxisLeft.removeGroup(groupId);\n      this.legendLeft.removeGroup(groupId);\n    } else {\n      this.yAxisLeft.updateGroup(groupId, this.groups[groupId]);\n      this.legendLeft.updateGroup(groupId, this.groups[groupId]);\n      //If yAxisOrientation changed, clean out the group from the other axis.\n      this.yAxisRight.removeGroup(groupId);\n      this.legendRight.removeGroup(groupId);\n    }\n  }\n  this.legendLeft.redraw();\n  this.legendRight.redraw();\n};\n\n/**\n * this updates all groups, it is used when there is an update the the itemset.\n *\n * @param  {Array} ids\n * @param  {Array} groupIds\n * @private\n */\nLineGraph.prototype._updateAllGroupData = function (ids, groupIds) {\n  if (this.itemsData != null) {\n    var groupsContent = {};\n    var items = this.itemsData.get();\n    var fieldId = this.itemsData.idProp;\n    var idMap = {};\n    if (ids) {\n      ids.map(function (id) {\n        idMap[id] = id;\n      });\n    }\n\n    //pre-Determine array sizes, for more efficient memory claim\n    var groupCounts = {};\n    for (var i = 0; i < items.length; i++) {\n      var item = items[i];\n      var groupId = item.group;\n      if (groupId === null || groupId === undefined) {\n        groupId = UNGROUPED;\n      }\n      Object.prototype.hasOwnProperty.call(groupCounts, groupId)\n        ? groupCounts[groupId]++\n        : (groupCounts[groupId] = 1);\n    }\n\n    //Pre-load arrays from existing groups if items are not changed (not in ids)\n    var existingItemsMap = {};\n    if (!groupIds && ids) {\n      for (groupId in this.groups) {\n        if (!Object.prototype.hasOwnProperty.call(this.groups, groupId))\n          continue;\n\n        group = this.groups[groupId];\n        var existing_items = group.getItems();\n\n        groupsContent[groupId] = existing_items.filter(function (item) {\n          existingItemsMap[item[fieldId]] = item[fieldId];\n          return item[fieldId] !== idMap[item[fieldId]];\n        });\n\n        var newLength = groupCounts[groupId];\n        groupCounts[groupId] -= groupsContent[groupId].length;\n\n        if (groupsContent[groupId].length < newLength)\n          groupsContent[groupId][newLength - 1] = {};\n      }\n    }\n\n    //Now insert data into the arrays.\n    for (i = 0; i < items.length; i++) {\n      item = items[i];\n      groupId = item.group;\n      if (groupId === null || groupId === undefined) {\n        groupId = UNGROUPED;\n      }\n      if (\n        !groupIds &&\n        ids &&\n        item[fieldId] !== idMap[item[fieldId]] &&\n        Object.prototype.hasOwnProperty.call(existingItemsMap, item[fieldId])\n      ) {\n        continue;\n      }\n      if (!Object.prototype.hasOwnProperty.call(groupsContent, groupId)) {\n        groupsContent[groupId] = new Array(groupCounts[groupId]);\n      }\n      //Copy data (because of unmodifiable DataView input.\n      var extended = util.bridgeObject(item);\n      extended.x = util.convert(item.x, \"Date\");\n      extended.end = util.convert(item.end, \"Date\");\n      extended.orginalY = item.y; //real Y\n      extended.y = Number(item.y);\n      extended[fieldId] = item[fieldId];\n\n      var index = groupsContent[groupId].length - groupCounts[groupId]--;\n      groupsContent[groupId][index] = extended;\n    }\n\n    //Make sure all groups are present, to allow removal of old groups\n    for (groupId in this.groups) {\n      if (\n        !Object.prototype.hasOwnProperty.call(this.groups, groupId) ||\n        Object.prototype.hasOwnProperty.call(groupsContent, groupId)\n      )\n        continue;\n      groupsContent[groupId] = new Array(0);\n    }\n\n    //Update legendas, style and axis\n    for (groupId in groupsContent) {\n      if (!Object.prototype.hasOwnProperty.call(groupsContent, groupId))\n        continue;\n\n      if (groupsContent[groupId].length == 0) {\n        if (Object.prototype.hasOwnProperty.call(this.groups, groupId)) {\n          this._removeGroup(groupId);\n        }\n      } else {\n        var group = undefined;\n        if (this.groupsData != undefined) {\n          group = this.groupsData.get(groupId);\n        }\n        if (group == undefined) {\n          group = { id: groupId, content: this.options.defaultGroup + groupId };\n        }\n        this._updateGroup(group, groupId);\n        this.groups[groupId].setItems(groupsContent[groupId]);\n      }\n    }\n    this.forceGraphUpdate = true;\n    this.body.emitter.emit(\"_change\", { queue: true });\n  }\n};\n\n/**\n * Redraw the component, mandatory function\n * @return {boolean} Returns true if the component is resized\n */\nLineGraph.prototype.redraw = function () {\n  var resized = false;\n\n  // calculate actual size and position\n  this.props.width = this.dom.frame.offsetWidth;\n  this.props.height =\n    this.body.domProps.centerContainer.height -\n    this.body.domProps.border.top -\n    this.body.domProps.border.bottom;\n\n  // check if this component is resized\n  resized = this._isResized() || resized;\n\n  // check whether zoomed (in that case we need to re-stack everything)\n  var visibleInterval = this.body.range.end - this.body.range.start;\n  var zoomed = visibleInterval != this.lastVisibleInterval;\n  this.lastVisibleInterval = visibleInterval;\n\n  // the svg element is three times as big as the width, this allows for fully dragging left and right\n  // without reloading the graph. the controls for this are bound to events in the constructor\n  if (resized == true) {\n    this.svg.style.width = util.option.asSize(3 * this.props.width);\n    this.svg.style.left = util.option.asSize(-this.props.width);\n\n    // if the height of the graph is set as proportional, change the height of the svg\n    if (\n      (this.options.height + \"\").indexOf(\"%\") != -1 ||\n      this.updateSVGheightOnResize == true\n    ) {\n      this.updateSVGheight = true;\n    }\n  }\n\n  // update the height of the graph on each redraw of the graph.\n  if (this.updateSVGheight == true) {\n    if (this.options.graphHeight != this.props.height + \"px\") {\n      this.options.graphHeight = this.props.height + \"px\";\n      this.svg.style.height = this.props.height + \"px\";\n    }\n    this.updateSVGheight = false;\n  } else {\n    this.svg.style.height =\n      (\"\" + this.options.graphHeight).replace(\"px\", \"\") + \"px\";\n  }\n\n  // zoomed is here to ensure that animations are shown correctly.\n  if (\n    resized == true ||\n    zoomed == true ||\n    this.abortedGraphUpdate == true ||\n    this.forceGraphUpdate == true\n  ) {\n    resized = this._updateGraph() || resized;\n    this.forceGraphUpdate = false;\n    this.lastStart = this.body.range.start;\n    this.svg.style.left = -this.props.width + \"px\";\n  } else {\n    // move the whole svg while dragging\n    if (this.lastStart != 0) {\n      var offset = this.body.range.start - this.lastStart;\n      var range = this.body.range.end - this.body.range.start;\n      if (this.props.width != 0) {\n        var rangePerPixelInv = this.props.width / range;\n        var xOffset = offset * rangePerPixelInv;\n        this.svg.style.left = -this.props.width - xOffset + \"px\";\n      }\n    }\n  }\n  this.legendLeft.redraw();\n  this.legendRight.redraw();\n  return resized;\n};\n\nLineGraph.prototype._getSortedGroupIds = function () {\n  // getting group Ids\n  var grouplist = [];\n  for (var groupId in this.groups) {\n    if (Object.prototype.hasOwnProperty.call(this.groups, groupId)) {\n      var group = this.groups[groupId];\n      if (\n        group.visible == true &&\n        (this.options.groups.visibility[groupId] === undefined ||\n          this.options.groups.visibility[groupId] == true)\n      ) {\n        grouplist.push({ id: groupId, zIndex: group.options.zIndex });\n      }\n    }\n  }\n  util.insertSort(grouplist, function (a, b) {\n    var az = a.zIndex;\n    var bz = b.zIndex;\n    if (az === undefined) az = 0;\n    if (bz === undefined) bz = 0;\n    return az == bz ? 0 : az < bz ? -1 : 1;\n  });\n  var groupIds = new Array(grouplist.length);\n  for (var i = 0; i < grouplist.length; i++) {\n    groupIds[i] = grouplist[i].id;\n  }\n  return groupIds;\n};\n\n/**\n * Update and redraw the graph.\n *\n * @returns {boolean}\n * @private\n */\nLineGraph.prototype._updateGraph = function () {\n  // reset the svg elements\n  DOMutil.prepareElements(this.svgElements);\n  if (this.props.width != 0 && this.itemsData != null) {\n    var group, i;\n    var groupRanges = {};\n    var changeCalled = false;\n    // this is the range of the SVG canvas\n    var minDate = this.body.util.toGlobalTime(-this.body.domProps.root.width);\n    var maxDate = this.body.util.toGlobalTime(\n      2 * this.body.domProps.root.width,\n    );\n\n    // getting group Ids\n    var groupIds = this._getSortedGroupIds();\n    if (groupIds.length > 0) {\n      var groupsData = {};\n\n      // fill groups data, this only loads the data we require based on the timewindow\n      this._getRelevantData(groupIds, groupsData, minDate, maxDate);\n\n      // apply sampling, if disabled, it will pass through this function.\n      this._applySampling(groupIds, groupsData);\n\n      // we transform the X coordinates to detect collisions\n      for (i = 0; i < groupIds.length; i++) {\n        this._convertXcoordinates(groupsData[groupIds[i]]);\n      }\n\n      // now all needed data has been collected we start the processing.\n      this._getYRanges(groupIds, groupsData, groupRanges);\n\n      // update the Y axis first, we use this data to draw at the correct Y points\n      changeCalled = this._updateYAxis(groupIds, groupRanges);\n\n      //  at changeCalled, abort this update cycle as the graph needs another update with new Width input from the Redraw container.\n      //  Cleanup SVG elements on abort.\n      if (changeCalled == true) {\n        DOMutil.cleanupElements(this.svgElements);\n        this.abortedGraphUpdate = true;\n        return true;\n      }\n      this.abortedGraphUpdate = false;\n\n      // With the yAxis scaled correctly, use this to get the Y values of the points.\n      var below = undefined;\n      for (i = 0; i < groupIds.length; i++) {\n        group = this.groups[groupIds[i]];\n        if (this.options.stack === true && this.options.style === \"line\") {\n          if (\n            group.options.excludeFromStacking == undefined ||\n            !group.options.excludeFromStacking\n          ) {\n            if (below != undefined) {\n              this._stack(groupsData[group.id], groupsData[below.id]);\n              if (\n                group.options.shaded.enabled == true &&\n                group.options.shaded.orientation !== \"group\"\n              ) {\n                if (\n                  group.options.shaded.orientation == \"top\" &&\n                  below.options.shaded.orientation !== \"group\"\n                ) {\n                  below.options.shaded.orientation = \"group\";\n                  below.options.shaded.groupId = group.id;\n                } else {\n                  group.options.shaded.orientation = \"group\";\n                  group.options.shaded.groupId = below.id;\n                }\n              }\n            }\n            below = group;\n          }\n        }\n        this._convertYcoordinates(groupsData[groupIds[i]], group);\n      }\n\n      //Precalculate paths and draw shading if appropriate. This will make sure the shading is always behind any lines.\n      var paths = {};\n      for (i = 0; i < groupIds.length; i++) {\n        group = this.groups[groupIds[i]];\n        if (\n          group.options.style === \"line\" &&\n          group.options.shaded.enabled == true\n        ) {\n          var dataset = groupsData[groupIds[i]];\n          if (dataset == null || dataset.length == 0) {\n            continue;\n          }\n          if (!Object.prototype.hasOwnProperty.call(paths, groupIds[i])) {\n            paths[groupIds[i]] = Lines.calcPath(dataset, group);\n          }\n          if (group.options.shaded.orientation === \"group\") {\n            var subGroupId = group.options.shaded.groupId;\n            if (groupIds.indexOf(subGroupId) === -1) {\n              console.log(\n                group.id + \": Unknown shading group target given:\" + subGroupId,\n              );\n              continue;\n            }\n            if (!Object.prototype.hasOwnProperty.call(paths, subGroupId)) {\n              paths[subGroupId] = Lines.calcPath(\n                groupsData[subGroupId],\n                this.groups[subGroupId],\n              );\n            }\n            Lines.drawShading(\n              paths[groupIds[i]],\n              group,\n              paths[subGroupId],\n              this.framework,\n            );\n          } else {\n            Lines.drawShading(\n              paths[groupIds[i]],\n              group,\n              undefined,\n              this.framework,\n            );\n          }\n        }\n      }\n\n      // draw the groups, calculating paths if still necessary.\n      Bars.draw(groupIds, groupsData, this.framework);\n      for (i = 0; i < groupIds.length; i++) {\n        group = this.groups[groupIds[i]];\n        if (groupsData[groupIds[i]].length > 0) {\n          switch (group.options.style) {\n            case \"line\":\n              if (!Object.prototype.hasOwnProperty.call(paths, groupIds[i])) {\n                paths[groupIds[i]] = Lines.calcPath(\n                  groupsData[groupIds[i]],\n                  group,\n                );\n              }\n              Lines.draw(paths[groupIds[i]], group, this.framework);\n\n            // eslint-disable-next-line no-fallthrough\n            case \"point\":\n            // eslint-disable-next-line no-fallthrough\n            case \"points\":\n              if (\n                group.options.style == \"point\" ||\n                group.options.style == \"points\" ||\n                group.options.drawPoints.enabled == true\n              ) {\n                Points.draw(groupsData[groupIds[i]], group, this.framework);\n              }\n              break;\n            case \"bar\":\n            // bar needs to be drawn enmasse\n            // eslint-disable-next-line no-fallthrough\n            default:\n            //do nothing...\n          }\n        }\n      }\n    }\n  }\n\n  // cleanup unused svg elements\n  DOMutil.cleanupElements(this.svgElements);\n  return false;\n};\n\nLineGraph.prototype._stack = function (data, subData) {\n  var index, dx, dy, subPrevPoint, subNextPoint;\n  index = 0;\n  // for each data point we look for a matching on in the set below\n  for (var j = 0; j < data.length; j++) {\n    subPrevPoint = undefined;\n    subNextPoint = undefined;\n    // we look for time matches or a before-after point\n    for (var k = index; k < subData.length; k++) {\n      // if times match exactly\n      if (subData[k].x === data[j].x) {\n        subPrevPoint = subData[k];\n        subNextPoint = subData[k];\n        index = k;\n        break;\n      } else if (subData[k].x > data[j].x) {\n        // overshoot\n        subNextPoint = subData[k];\n        if (k == 0) {\n          subPrevPoint = subNextPoint;\n        } else {\n          subPrevPoint = subData[k - 1];\n        }\n        index = k;\n        break;\n      }\n    }\n    // in case the last data point has been used, we assume it stays like this.\n    if (subNextPoint === undefined) {\n      subPrevPoint = subData[subData.length - 1];\n      subNextPoint = subData[subData.length - 1];\n    }\n    // linear interpolation\n    dx = subNextPoint.x - subPrevPoint.x;\n    dy = subNextPoint.y - subPrevPoint.y;\n    if (dx == 0) {\n      data[j].y = data[j].orginalY + subNextPoint.y;\n    } else {\n      data[j].y =\n        data[j].orginalY +\n        (dy / dx) * (data[j].x - subPrevPoint.x) +\n        subPrevPoint.y; // ax + b where b is data[j].y\n    }\n  }\n};\n\n/**\n * first select and preprocess the data from the datasets.\n * the groups have their preselection of data, we now loop over this data to see\n * what data we need to draw. Sorted data is much faster.\n * more optimization is possible by doing the sampling before and using the binary search\n * to find the end date to determine the increment.\n *\n * @param {array}  groupIds\n * @param {object} groupsData\n * @param {date}   minDate\n * @param {date}   maxDate\n * @private\n */\nLineGraph.prototype._getRelevantData = function (\n  groupIds,\n  groupsData,\n  minDate,\n  maxDate,\n) {\n  var group, i, j, item;\n  if (groupIds.length > 0) {\n    for (i = 0; i < groupIds.length; i++) {\n      group = this.groups[groupIds[i]];\n      var itemsData = group.getItems();\n      // optimization for sorted data\n      if (group.options.sort == true) {\n        var dateComparator = function (a, b) {\n          return a.getTime() == b.getTime() ? 0 : a < b ? -1 : 1;\n        };\n        var first = Math.max(\n          0,\n          util.binarySearchValue(\n            itemsData,\n            minDate,\n            \"x\",\n            \"before\",\n            dateComparator,\n          ),\n        );\n        var last = Math.min(\n          itemsData.length,\n          util.binarySearchValue(\n            itemsData,\n            maxDate,\n            \"x\",\n            \"after\",\n            dateComparator,\n          ) + 1,\n        );\n        if (last <= 0) {\n          last = itemsData.length;\n        }\n        var dataContainer = new Array(last - first);\n        for (j = first; j < last; j++) {\n          item = group.itemsData[j];\n          dataContainer[j - first] = item;\n        }\n        groupsData[groupIds[i]] = dataContainer;\n      } else {\n        // If unsorted data, all data is relevant, just returning entire structure\n        groupsData[groupIds[i]] = group.itemsData;\n      }\n    }\n  }\n};\n\n/**\n *\n * @param {Array.<vis.GraphGroup.id>} groupIds\n * @param {vis.DataSet} groupsData\n * @private\n */\nLineGraph.prototype._applySampling = function (groupIds, groupsData) {\n  var group;\n  if (groupIds.length > 0) {\n    for (var i = 0; i < groupIds.length; i++) {\n      group = this.groups[groupIds[i]];\n      if (group.options.sampling == true) {\n        var dataContainer = groupsData[groupIds[i]];\n        if (dataContainer.length > 0) {\n          var increment = 1;\n          var amountOfPoints = dataContainer.length;\n\n          // the global screen is used because changing the width of the yAxis may affect the increment, resulting in an endless loop\n          // of width changing of the yAxis.\n          //TODO: This assumes sorted data, but that's not guaranteed!\n          var xDistance =\n            this.body.util.toGlobalScreen(\n              dataContainer[dataContainer.length - 1].x,\n            ) - this.body.util.toGlobalScreen(dataContainer[0].x);\n          var pointsPerPixel = amountOfPoints / xDistance;\n          increment = Math.min(\n            Math.ceil(0.2 * amountOfPoints),\n            Math.max(1, Math.round(pointsPerPixel)),\n          );\n\n          var sampledData = new Array(amountOfPoints);\n          for (var j = 0; j < amountOfPoints; j += increment) {\n            var idx = Math.round(j / increment);\n            sampledData[idx] = dataContainer[j];\n          }\n          groupsData[groupIds[i]] = sampledData.splice(\n            0,\n            Math.round(amountOfPoints / increment),\n          );\n        }\n      }\n    }\n  }\n};\n\n/**\n *\n * @param {Array.<vis.GraphGroup.id>} groupIds\n * @param {vis.DataSet} groupsData\n * @param {object} groupRanges  | this is being filled here\n * @private\n */\nLineGraph.prototype._getYRanges = function (groupIds, groupsData, groupRanges) {\n  var groupData, group, i;\n  var combinedDataLeft = [];\n  var combinedDataRight = [];\n  var options;\n  if (groupIds.length > 0) {\n    for (i = 0; i < groupIds.length; i++) {\n      groupData = groupsData[groupIds[i]];\n      options = this.groups[groupIds[i]].options;\n      if (groupData.length > 0) {\n        group = this.groups[groupIds[i]];\n        // if bar graphs are stacked, their range need to be handled differently and accumulated over all groups.\n        if (options.stack === true && options.style === \"bar\") {\n          if (options.yAxisOrientation === \"left\") {\n            combinedDataLeft = combinedDataLeft.concat(groupData);\n          } else {\n            combinedDataRight = combinedDataRight.concat(groupData);\n          }\n        } else {\n          groupRanges[groupIds[i]] = group.getYRange(groupData, groupIds[i]);\n        }\n      }\n    }\n\n    // if bar graphs are stacked, their range need to be handled differently and accumulated over all groups.\n    Bars.getStackedYRange(\n      combinedDataLeft,\n      groupRanges,\n      groupIds,\n      \"__barStackLeft\",\n      \"left\",\n    );\n    Bars.getStackedYRange(\n      combinedDataRight,\n      groupRanges,\n      groupIds,\n      \"__barStackRight\",\n      \"right\",\n    );\n  }\n};\n\n/**\n * this sets the Y ranges for the Y axis. It also determines which of the axis should be shown or hidden.\n * @param {Array.<vis.GraphGroup.id>} groupIds\n * @param {Object} groupRanges\n * @returns {boolean} resized\n * @private\n */\nLineGraph.prototype._updateYAxis = function (groupIds, groupRanges) {\n  var resized = false;\n  var yAxisLeftUsed = false;\n  var yAxisRightUsed = false;\n  var minLeft = 1e9,\n    minRight = 1e9,\n    maxLeft = -1e9,\n    maxRight = -1e9,\n    minVal,\n    maxVal;\n  // if groups are present\n  if (groupIds.length > 0) {\n    // this is here to make sure that if there are no items in the axis but there are groups, that there is no infinite draw/redraw loop.\n    for (var i = 0; i < groupIds.length; i++) {\n      var group = this.groups[groupIds[i]];\n      if (group && group.options.yAxisOrientation != \"right\") {\n        yAxisLeftUsed = true;\n        minLeft = 1e9;\n        maxLeft = -1e9;\n      } else if (group && group.options.yAxisOrientation) {\n        yAxisRightUsed = true;\n        minRight = 1e9;\n        maxRight = -1e9;\n      }\n    }\n\n    // if there are items:\n    for (i = 0; i < groupIds.length; i++) {\n      if (\n        !Object.prototype.hasOwnProperty.call(groupRanges, groupIds[i]) ||\n        groupRanges[groupIds[i]].ignore === true\n      )\n        continue;\n\n      minVal = groupRanges[groupIds[i]].min;\n      maxVal = groupRanges[groupIds[i]].max;\n\n      if (groupRanges[groupIds[i]].yAxisOrientation != \"right\") {\n        yAxisLeftUsed = true;\n        minLeft = minLeft > minVal ? minVal : minLeft;\n        maxLeft = maxLeft < maxVal ? maxVal : maxLeft;\n      } else {\n        yAxisRightUsed = true;\n        minRight = minRight > minVal ? minVal : minRight;\n        maxRight = maxRight < maxVal ? maxVal : maxRight;\n      }\n    }\n\n    if (yAxisLeftUsed == true) {\n      this.yAxisLeft.setRange(minLeft, maxLeft);\n    }\n    if (yAxisRightUsed == true) {\n      this.yAxisRight.setRange(minRight, maxRight);\n    }\n  }\n  resized = this._toggleAxisVisiblity(yAxisLeftUsed, this.yAxisLeft) || resized;\n  resized =\n    this._toggleAxisVisiblity(yAxisRightUsed, this.yAxisRight) || resized;\n\n  if (yAxisRightUsed == true && yAxisLeftUsed == true) {\n    this.yAxisLeft.drawIcons = true;\n    this.yAxisRight.drawIcons = true;\n  } else {\n    this.yAxisLeft.drawIcons = false;\n    this.yAxisRight.drawIcons = false;\n  }\n  this.yAxisRight.master = !yAxisLeftUsed;\n  this.yAxisRight.masterAxis = this.yAxisLeft;\n\n  if (this.yAxisRight.master == false) {\n    if (yAxisRightUsed == true) {\n      this.yAxisLeft.lineOffset = this.yAxisRight.width;\n    } else {\n      this.yAxisLeft.lineOffset = 0;\n    }\n\n    resized = this.yAxisLeft.redraw() || resized;\n    resized = this.yAxisRight.redraw() || resized;\n  } else {\n    resized = this.yAxisRight.redraw() || resized;\n  }\n\n  // clean the accumulated lists\n  var tempGroups = [\n    \"__barStackLeft\",\n    \"__barStackRight\",\n    \"__lineStackLeft\",\n    \"__lineStackRight\",\n  ];\n  for (i = 0; i < tempGroups.length; i++) {\n    if (groupIds.indexOf(tempGroups[i]) != -1) {\n      groupIds.splice(groupIds.indexOf(tempGroups[i]), 1);\n    }\n  }\n\n  return resized;\n};\n\n/**\n * This shows or hides the Y axis if needed. If there is a change, the changed event is emitted by the updateYAxis function\n *\n * @param {boolean} axisUsed\n * @param {vis.DataAxis}  axis\n * @returns {boolean}\n * @private\n */\nLineGraph.prototype._toggleAxisVisiblity = function (axisUsed, axis) {\n  var changed = false;\n  if (axisUsed == false) {\n    if (axis.dom.frame.parentNode && axis.hidden == false) {\n      axis.hide();\n      changed = true;\n    }\n  } else {\n    if (!axis.dom.frame.parentNode && axis.hidden == true) {\n      axis.show();\n      changed = true;\n    }\n  }\n  return changed;\n};\n\n/**\n * This uses the DataAxis object to generate the correct X coordinate on the SVG window. It uses the\n * util function toScreen to get the x coordinate from the timestamp. It also pre-filters the data and get the minMax ranges for\n * the yAxis.\n *\n * @param {Array.<Object>} datapoints\n * @private\n */\nLineGraph.prototype._convertXcoordinates = function (datapoints) {\n  var toScreen = this.body.util.toScreen;\n  for (var i = 0; i < datapoints.length; i++) {\n    datapoints[i].screen_x = toScreen(datapoints[i].x) + this.props.width;\n    datapoints[i].screen_y = datapoints[i].y; //starting point for range calculations\n    if (datapoints[i].end != undefined) {\n      datapoints[i].screen_end = toScreen(datapoints[i].end) + this.props.width;\n    } else {\n      datapoints[i].screen_end = undefined;\n    }\n  }\n};\n\n/**\n * This uses the DataAxis object to generate the correct X coordinate on the SVG window. It uses the\n * util function toScreen to get the x coordinate from the timestamp. It also pre-filters the data and get the minMax ranges for\n * the yAxis.\n *\n * @param {Array.<Object>} datapoints\n * @param {vis.GraphGroup} group\n * @private\n */\nLineGraph.prototype._convertYcoordinates = function (datapoints, group) {\n  var axis = this.yAxisLeft;\n  var svgHeight = Number(this.svg.style.height.replace(\"px\", \"\"));\n  if (group.options.yAxisOrientation == \"right\") {\n    axis = this.yAxisRight;\n  }\n  for (var i = 0; i < datapoints.length; i++) {\n    datapoints[i].screen_y = Math.round(axis.convertValue(datapoints[i].y));\n  }\n  group.setZeroPosition(Math.min(svgHeight, axis.convertValue(0)));\n};\n\nexport default LineGraph;\n","/**\n * This object contains all possible options. It will check if the types are correct, if required if the option is one\n * of the allowed values.\n *\n * __any__ means that the name of the property does not matter.\n * __type__ is a required field for all objects and contains the allowed types of all objects\n */\nlet string = \"string\";\nlet bool = \"boolean\";\nlet number = \"number\";\nlet array = \"array\";\nlet date = \"date\";\nlet object = \"object\"; // should only be in a __type__ property\nlet dom = \"dom\";\nlet moment = \"moment\";\nlet any = \"any\";\n\nlet allOptions = {\n  configure: {\n    enabled: { boolean: bool },\n    filter: { boolean: bool, function: \"function\" },\n    container: { dom },\n    __type__: { object, boolean: bool, function: \"function\" },\n  },\n\n  //globals :\n  alignCurrentTime: { string, undefined: \"undefined\" },\n  yAxisOrientation: { string: [\"left\", \"right\"] },\n  defaultGroup: { string },\n  sort: { boolean: bool },\n  sampling: { boolean: bool },\n  stack: { boolean: bool },\n  graphHeight: { string, number },\n  shaded: {\n    enabled: { boolean: bool },\n    orientation: { string: [\"bottom\", \"top\", \"zero\", \"group\"] }, // top, bottom, zero, group\n    groupId: { object },\n    __type__: { boolean: bool, object },\n  },\n  style: { string: [\"line\", \"bar\", \"points\"] }, // line, bar\n  barChart: {\n    width: { number },\n    minWidth: { number },\n    sideBySide: { boolean: bool },\n    align: { string: [\"left\", \"center\", \"right\"] },\n    __type__: { object },\n  },\n  interpolation: {\n    enabled: { boolean: bool },\n    parametrization: { string: [\"centripetal\", \"chordal\", \"uniform\"] }, // uniform (alpha = 0.0), chordal (alpha = 1.0), centripetal (alpha = 0.5)\n    alpha: { number },\n    __type__: { object, boolean: bool },\n  },\n  drawPoints: {\n    enabled: { boolean: bool },\n    onRender: { function: \"function\" },\n    size: { number },\n    style: { string: [\"square\", \"circle\"] }, // square, circle\n    __type__: { object, boolean: bool, function: \"function\" },\n  },\n  dataAxis: {\n    showMinorLabels: { boolean: bool },\n    showMajorLabels: { boolean: bool },\n    showWeekScale: { boolean: bool },\n    icons: { boolean: bool },\n    width: { string, number },\n    visible: { boolean: bool },\n    alignZeros: { boolean: bool },\n    left: {\n      range: {\n        min: { number, undefined: \"undefined\" },\n        max: { number, undefined: \"undefined\" },\n        __type__: { object },\n      },\n      format: { function: \"function\" },\n      title: {\n        text: { string, number, undefined: \"undefined\" },\n        style: { string, undefined: \"undefined\" },\n        __type__: { object },\n      },\n      __type__: { object },\n    },\n    right: {\n      range: {\n        min: { number, undefined: \"undefined\" },\n        max: { number, undefined: \"undefined\" },\n        __type__: { object },\n      },\n      format: { function: \"function\" },\n      title: {\n        text: { string, number, undefined: \"undefined\" },\n        style: { string, undefined: \"undefined\" },\n        __type__: { object },\n      },\n      __type__: { object },\n    },\n    __type__: { object },\n  },\n  legend: {\n    enabled: { boolean: bool },\n    icons: { boolean: bool },\n    left: {\n      visible: { boolean: bool },\n      position: {\n        string: [\"top-right\", \"bottom-right\", \"top-left\", \"bottom-left\"],\n      },\n      __type__: { object },\n    },\n    right: {\n      visible: { boolean: bool },\n      position: {\n        string: [\"top-right\", \"bottom-right\", \"top-left\", \"bottom-left\"],\n      },\n      __type__: { object },\n    },\n    __type__: { object, boolean: bool },\n  },\n  groups: {\n    visibility: { any },\n    __type__: { object },\n  },\n\n  autoResize: { boolean: bool },\n  throttleRedraw: { number }, // TODO: DEPRICATED see https://github.com/almende/vis/issues/2511\n  clickToUse: { boolean: bool },\n  end: { number, date, string, moment },\n  format: {\n    minorLabels: {\n      millisecond: { string, undefined: \"undefined\" },\n      second: { string, undefined: \"undefined\" },\n      minute: { string, undefined: \"undefined\" },\n      hour: { string, undefined: \"undefined\" },\n      weekday: { string, undefined: \"undefined\" },\n      day: { string, undefined: \"undefined\" },\n      week: { string, undefined: \"undefined\" },\n      month: { string, undefined: \"undefined\" },\n      quarter: { string, undefined: \"undefined\" },\n      year: { string, undefined: \"undefined\" },\n      __type__: { object },\n    },\n    majorLabels: {\n      millisecond: { string, undefined: \"undefined\" },\n      second: { string, undefined: \"undefined\" },\n      minute: { string, undefined: \"undefined\" },\n      hour: { string, undefined: \"undefined\" },\n      weekday: { string, undefined: \"undefined\" },\n      day: { string, undefined: \"undefined\" },\n      week: { string, undefined: \"undefined\" },\n      month: { string, undefined: \"undefined\" },\n      quarter: { string, undefined: \"undefined\" },\n      year: { string, undefined: \"undefined\" },\n      __type__: { object },\n    },\n    __type__: { object },\n  },\n  moment: { function: \"function\" },\n  height: { string, number },\n  hiddenDates: {\n    start: { date, number, string, moment },\n    end: { date, number, string, moment },\n    repeat: { string },\n    __type__: { object, array },\n  },\n  locale: { string },\n  locales: {\n    __any__: { any },\n    __type__: { object },\n  },\n  max: { date, number, string, moment },\n  maxHeight: { number, string },\n  maxMinorChars: { number },\n  min: { date, number, string, moment },\n  minHeight: { number, string },\n  moveable: { boolean: bool },\n  multiselect: { boolean: bool },\n  orientation: { string },\n  showCurrentTime: { boolean: bool },\n  showMajorLabels: { boolean: bool },\n  showMinorLabels: { boolean: bool },\n  showWeekScale: { boolean: bool },\n  snap: { function: \"function\", null: \"null\" },\n  start: { date, number, string, moment },\n  timeAxis: {\n    scale: { string, undefined: \"undefined\" },\n    step: { number, undefined: \"undefined\" },\n    __type__: { object },\n  },\n  width: { string, number },\n  zoomable: { boolean: bool },\n  zoomKey: { string: [\"ctrlKey\", \"altKey\", \"metaKey\", \"\"] },\n  zoomMax: { number },\n  zoomMin: { number },\n  zIndex: { number },\n  __type__: { object },\n};\n\nlet configureOptions = {\n  global: {\n    alignCurrentTime: [\n      \"none\",\n      \"year\",\n      \"month\",\n      \"quarter\",\n      \"week\",\n      \"isoWeek\",\n      \"day\",\n      \"date\",\n      \"hour\",\n      \"minute\",\n      \"second\",\n    ],\n    //yAxisOrientation: ['left','right'], // TDOO: enable as soon as Grahp2d doesn't crash when changing this on the fly\n    sort: true,\n    sampling: true,\n    stack: false,\n    shaded: {\n      enabled: false,\n      orientation: [\"zero\", \"top\", \"bottom\", \"group\"], // zero, top, bottom\n    },\n    style: [\"line\", \"bar\", \"points\"], // line, bar\n    barChart: {\n      width: [50, 5, 100, 5],\n      minWidth: [50, 5, 100, 5],\n      sideBySide: false,\n      align: [\"left\", \"center\", \"right\"], // left, center, right\n    },\n    interpolation: {\n      enabled: true,\n      parametrization: [\"centripetal\", \"chordal\", \"uniform\"], // uniform (alpha = 0.0), chordal (alpha = 1.0), centripetal (alpha = 0.5)\n    },\n    drawPoints: {\n      enabled: true,\n      size: [6, 2, 30, 1],\n      style: [\"square\", \"circle\"], // square, circle\n    },\n    dataAxis: {\n      showMinorLabels: true,\n      showMajorLabels: true,\n      showWeekScale: false,\n      icons: false,\n      width: [40, 0, 200, 1],\n      visible: true,\n      alignZeros: true,\n      left: {\n        //range: {min:'undefined': 'undefined'ined,max:'undefined': 'undefined'ined},\n        //format: function (value) {return value;},\n        title: { text: \"\", style: \"\" },\n      },\n      right: {\n        //range: {min:'undefined': 'undefined'ined,max:'undefined': 'undefined'ined},\n        //format: function (value) {return value;},\n        title: { text: \"\", style: \"\" },\n      },\n    },\n    legend: {\n      enabled: false,\n      icons: true,\n      left: {\n        visible: true,\n        position: [\"top-right\", \"bottom-right\", \"top-left\", \"bottom-left\"], // top/bottom - left,right\n      },\n      right: {\n        visible: true,\n        position: [\"top-right\", \"bottom-right\", \"top-left\", \"bottom-left\"], // top/bottom - left,right\n      },\n    },\n\n    autoResize: true,\n    clickToUse: false,\n    end: \"\",\n    format: {\n      minorLabels: {\n        millisecond: \"SSS\",\n        second: \"s\",\n        minute: \"HH:mm\",\n        hour: \"HH:mm\",\n        weekday: \"ddd D\",\n        day: \"D\",\n        week: \"w\",\n        month: \"MMM\",\n        quarter: \"[Q]Q\",\n        year: \"YYYY\",\n      },\n      majorLabels: {\n        millisecond: \"HH:mm:ss\",\n        second: \"D MMMM HH:mm\",\n        minute: \"ddd D MMMM\",\n        hour: \"ddd D MMMM\",\n        weekday: \"MMMM YYYY\",\n        day: \"MMMM YYYY\",\n        week: \"MMMM YYYY\",\n        month: \"YYYY\",\n        quarter: \"YYYY\",\n        year: \"\",\n      },\n    },\n\n    height: \"\",\n    locale: \"\",\n    max: \"\",\n    maxHeight: \"\",\n    maxMinorChars: [7, 0, 20, 1],\n    min: \"\",\n    minHeight: \"\",\n    moveable: true,\n    orientation: [\"both\", \"bottom\", \"top\"],\n    showCurrentTime: false,\n    showMajorLabels: true,\n    showMinorLabels: true,\n    showWeekScale: false,\n    start: \"\",\n    width: \"100%\",\n    zoomable: true,\n    zoomKey: [\"ctrlKey\", \"altKey\", \"metaKey\", \"\"],\n    zoomMax: [315360000000000, 10, 315360000000000, 1],\n    zoomMin: [10, 10, 315360000000000, 1],\n    zIndex: 0,\n  },\n};\n\nexport { allOptions, configureOptions };\n","import moment from \"../module/moment.js\";\nimport util, { typeCoerceDataSet, isDataViewLike } from \"../util.js\";\nimport { DataSet } from \"vis-data/esnext\";\nimport Range from \"./Range.js\";\nimport Core from \"./Core.js\";\nimport TimeAxis from \"./component/TimeAxis.js\";\nimport CurrentTime from \"./component/CurrentTime.js\";\nimport CustomTime from \"./component/CustomTime.js\";\nimport LineGraph from \"./component/LineGraph.js\";\n\nimport { Validator } from \"../shared/Validator.js\";\nimport { printStyle } from \"../shared/Validator.js\";\nimport { allOptions } from \"./optionsGraph2d.js\";\nimport { configureOptions } from \"./optionsGraph2d.js\";\n\nimport Configurator from \"../shared/Configurator.js\";\n\n/**\n * Create a timeline visualization\n * @param {HTMLElement} container\n * @param {vis.DataSet | Array} [items]\n * @param {vis.DataSet | Array | vis.DataView | Object} [groups]\n * @param {Object} [options]  See Graph2d.setOptions for the available options.\n * @constructor Graph2d\n * @extends Core\n */\nfunction Graph2d(container, items, groups, options) {\n  // if the third element is options, the forth is groups (optionally);\n  if (\n    !(Array.isArray(groups) || isDataViewLike(groups)) &&\n    groups instanceof Object\n  ) {\n    var forthArgument = options;\n    options = groups;\n    groups = forthArgument;\n  }\n\n  // TODO: REMOVE THIS in the next MAJOR release\n  // see https://github.com/almende/vis/issues/2511\n  if (options && options.throttleRedraw) {\n    console.warn(\n      'Graph2d option \"throttleRedraw\" is DEPRICATED and no longer supported. It will be removed in the next MAJOR release.',\n    );\n  }\n\n  var me = this;\n  this.defaultOptions = {\n    start: null,\n    end: null,\n\n    autoResize: true,\n\n    orientation: {\n      axis: \"bottom\", // axis orientation: 'bottom', 'top', or 'both'\n      item: \"bottom\", // not relevant for Graph2d\n    },\n\n    moment: moment,\n\n    width: null,\n    height: null,\n    maxHeight: null,\n    minHeight: null,\n  };\n  this.options = util.deepExtend({}, this.defaultOptions);\n\n  // Create the DOM, props, and emitter\n  this._create(container);\n\n  // all components listed here will be repainted automatically\n  this.components = [];\n\n  this.body = {\n    dom: this.dom,\n    domProps: this.props,\n    emitter: {\n      on: this.on.bind(this),\n      off: this.off.bind(this),\n      emit: this.emit.bind(this),\n    },\n    hiddenDates: [],\n    util: {\n      getScale() {\n        return me.timeAxis.step.scale;\n      },\n      getStep() {\n        return me.timeAxis.step.step;\n      },\n\n      toScreen: me._toScreen.bind(me),\n      toGlobalScreen: me._toGlobalScreen.bind(me), // this refers to the root.width\n      toTime: me._toTime.bind(me),\n      toGlobalTime: me._toGlobalTime.bind(me),\n    },\n  };\n\n  // range\n  this.range = new Range(this.body);\n  this.components.push(this.range);\n  this.body.range = this.range;\n\n  // time axis\n  this.timeAxis = new TimeAxis(this.body);\n  this.components.push(this.timeAxis);\n  //this.body.util.snap = this.timeAxis.snap.bind(this.timeAxis);\n\n  // current time bar\n  this.currentTime = new CurrentTime(this.body);\n  this.components.push(this.currentTime);\n\n  // item set\n  this.linegraph = new LineGraph(this.body);\n\n  this.components.push(this.linegraph);\n\n  this.itemsData = null; // DataSet\n  this.groupsData = null; // DataSet\n\n  this.on(\"tap\", function (event) {\n    me.emit(\"click\", me.getEventProperties(event));\n  });\n  this.on(\"doubletap\", function (event) {\n    me.emit(\"doubleClick\", me.getEventProperties(event));\n  });\n  this.dom.root.oncontextmenu = function (event) {\n    me.emit(\"contextmenu\", me.getEventProperties(event));\n  };\n\n  //Single time autoscale/fit\n  this.initialFitDone = false;\n  this.on(\"changed\", function () {\n    if (me.itemsData == null) return;\n    if (!me.initialFitDone && !me.options.rollingMode) {\n      me.initialFitDone = true;\n      if (me.options.start != undefined || me.options.end != undefined) {\n        if (me.options.start == undefined || me.options.end == undefined) {\n          var range = me.getItemRange();\n        }\n\n        var start =\n          me.options.start != undefined ? me.options.start : range.min;\n        var end = me.options.end != undefined ? me.options.end : range.max;\n        me.setWindow(start, end, { animation: false });\n      } else {\n        me.fit({ animation: false });\n      }\n    }\n\n    if (\n      !me.initialDrawDone &&\n      (me.initialRangeChangeDone ||\n        (!me.options.start && !me.options.end) ||\n        me.options.rollingMode)\n    ) {\n      me.initialDrawDone = true;\n      me.dom.root.style.visibility = \"visible\";\n      me.dom.loadingScreen.parentNode.removeChild(me.dom.loadingScreen);\n      if (me.options.onInitialDrawComplete) {\n        setTimeout(() => {\n          return me.options.onInitialDrawComplete();\n        }, 0);\n      }\n    }\n  });\n\n  // apply options\n  if (options) {\n    this.setOptions(options);\n  }\n\n  // IMPORTANT: THIS HAPPENS BEFORE SET ITEMS!\n  if (groups) {\n    this.setGroups(groups);\n  }\n\n  // create itemset\n  if (items) {\n    this.setItems(items);\n  }\n\n  // draw for the first time\n  this._redraw();\n}\n\n// Extend the functionality from Core\nGraph2d.prototype = new Core();\n\nGraph2d.prototype.setOptions = function (options) {\n  // validate options\n  let errorFound = Validator.validate(options, allOptions);\n  if (errorFound === true) {\n    console.log(\n      \"%cErrors have been found in the supplied options object.\",\n      printStyle,\n    );\n  }\n\n  Core.prototype.setOptions.call(this, options);\n};\n\n/**\n * Set items\n * @param {vis.DataSet | Array | null} items\n */\nGraph2d.prototype.setItems = function (items) {\n  var initialLoad = this.itemsData == null;\n\n  // convert to type DataSet when needed\n  var newDataSet;\n  if (!items) {\n    newDataSet = null;\n  } else if (isDataViewLike(items)) {\n    newDataSet = typeCoerceDataSet(items);\n  } else {\n    // turn an array into a dataset\n    newDataSet = typeCoerceDataSet(new DataSet(items));\n  }\n\n  // set items\n  if (this.itemsData) {\n    // stop maintaining a coerced version of the old data set\n    this.itemsData.dispose();\n  }\n  this.itemsData = newDataSet;\n  this.linegraph &&\n    this.linegraph.setItems(newDataSet != null ? newDataSet.rawDS : null);\n\n  if (initialLoad) {\n    if (this.options.start != undefined || this.options.end != undefined) {\n      var start = this.options.start != undefined ? this.options.start : null;\n      var end = this.options.end != undefined ? this.options.end : null;\n      this.setWindow(start, end, { animation: false });\n    } else {\n      this.fit({ animation: false });\n    }\n  }\n};\n\n/**\n * Set groups\n * @param {vis.DataSet | Array} groups\n */\nGraph2d.prototype.setGroups = function (groups) {\n  // convert to type DataSet when needed\n  var newDataSet;\n  if (!groups) {\n    newDataSet = null;\n  } else if (isDataViewLike(groups)) {\n    newDataSet = groups;\n  } else {\n    // turn an array into a dataset\n    newDataSet = new DataSet(groups);\n  }\n\n  this.groupsData = newDataSet;\n  this.linegraph.setGroups(newDataSet);\n};\n\n/**\n * Returns an object containing an SVG element with the icon of the group (size determined by iconWidth and iconHeight), the label of the group (content) and the yAxisOrientation of the group (left or right).\n * @param {vis.GraphGroup.id} groupId\n * @param {number} width\n * @param {number} height\n * @returns {{icon: SVGElement, label: string, orientation: string}|string}\n */\nGraph2d.prototype.getLegend = function (groupId, width, height) {\n  if (width === undefined) {\n    width = 15;\n  }\n  if (height === undefined) {\n    height = 15;\n  }\n  if (this.linegraph.groups[groupId] !== undefined) {\n    return this.linegraph.groups[groupId].getLegend(width, height);\n  } else {\n    return \"cannot find group:'\" + groupId + \"'\";\n  }\n};\n\n/**\n * This checks if the visible option of the supplied group (by ID) is true or false.\n * @param {vis.GraphGroup.id} groupId\n * @returns {boolean}\n */\nGraph2d.prototype.isGroupVisible = function (groupId) {\n  if (this.linegraph.groups[groupId] !== undefined) {\n    return (\n      this.linegraph.groups[groupId].visible &&\n      (this.linegraph.options.groups.visibility[groupId] === undefined ||\n        this.linegraph.options.groups.visibility[groupId] == true)\n    );\n  } else {\n    return false;\n  }\n};\n\n/**\n * Get the data range of the item set.\n * @returns {{min: Date, max: Date}} range  A range with a start and end Date.\n *                                          When no minimum is found, min==null\n *                                          When no maximum is found, max==null\n */\nGraph2d.prototype.getDataRange = function () {\n  var min = null;\n  var max = null;\n\n  // calculate min from start filed\n  for (var groupId in this.linegraph.groups) {\n    if (\n      !Object.prototype.hasOwnProperty.call(this.linegraph.groups, groupId) ||\n      this.linegraph.groups[groupId].visible !== true\n    )\n      continue;\n\n    for (var i = 0; i < this.linegraph.groups[groupId].itemsData.length; i++) {\n      var item = this.linegraph.groups[groupId].itemsData[i];\n      var value = util.convert(item.x, \"Date\").valueOf();\n      min = min == null ? value : min > value ? value : min;\n      max = max == null ? value : max < value ? value : max;\n    }\n  }\n\n  return {\n    min: min != null ? new Date(min) : null,\n    max: max != null ? new Date(max) : null,\n  };\n};\n\n/**\n * Generate Timeline related information from an event\n * @param {Event} event\n * @return {Object} An object with related information, like on which area\n *                  The event happened, whether clicked on an item, etc.\n */\nGraph2d.prototype.getEventProperties = function (event) {\n  var clientX = event.center ? event.center.x : event.clientX;\n  var clientY = event.center ? event.center.y : event.clientY;\n  var x = clientX - util.getAbsoluteLeft(this.dom.centerContainer);\n  var y = clientY - util.getAbsoluteTop(this.dom.centerContainer);\n  var time = this._toTime(x);\n\n  var customTime = CustomTime.customTimeFromTarget(event);\n\n  var element = util.getTarget(event);\n  var what = null;\n  if (util.hasParent(element, this.timeAxis.dom.foreground)) {\n    what = \"axis\";\n  } else if (\n    this.timeAxis2 &&\n    util.hasParent(element, this.timeAxis2.dom.foreground)\n  ) {\n    what = \"axis\";\n  } else if (util.hasParent(element, this.linegraph.yAxisLeft.dom.frame)) {\n    what = \"data-axis\";\n  } else if (util.hasParent(element, this.linegraph.yAxisRight.dom.frame)) {\n    what = \"data-axis\";\n  } else if (util.hasParent(element, this.linegraph.legendLeft.dom.frame)) {\n    what = \"legend\";\n  } else if (util.hasParent(element, this.linegraph.legendRight.dom.frame)) {\n    what = \"legend\";\n  } else if (customTime != null) {\n    what = \"custom-time\";\n  } else if (util.hasParent(element, this.currentTime.bar)) {\n    what = \"current-time\";\n  } else if (util.hasParent(element, this.dom.center)) {\n    what = \"background\";\n  }\n\n  var value = [];\n  var yAxisLeft = this.linegraph.yAxisLeft;\n  var yAxisRight = this.linegraph.yAxisRight;\n  if (!yAxisLeft.hidden && this.itemsData.length > 0) {\n    value.push(yAxisLeft.screenToValue(y));\n  }\n  if (!yAxisRight.hidden && this.itemsData.length > 0) {\n    value.push(yAxisRight.screenToValue(y));\n  }\n\n  return {\n    event: event,\n    customTime: customTime ? customTime.options.id : null,\n    what: what,\n    pageX: event.srcEvent ? event.srcEvent.pageX : event.pageX,\n    pageY: event.srcEvent ? event.srcEvent.pageY : event.pageY,\n    x: x,\n    y: y,\n    time: time,\n    value: value,\n  };\n};\n\n/**\n * Load a configurator\n * @return {Object}\n * @private\n */\nGraph2d.prototype._createConfigurator = function () {\n  return new Configurator(this, this.dom.container, configureOptions);\n};\n\nexport default Graph2d;\n","// Locales have to be supplied by the user.\n\n// styles\nimport \"./shared/activator.css\";\nimport \"./shared/bootstrap.css\";\nimport \"./shared/configuration.css\";\nimport \"./shared/tooltip.css\";\nimport \"./timeline/component/css/animation.css\";\nimport \"./timeline/component/css/currenttime.css\";\nimport \"./timeline/component/css/customtime.css\";\nimport \"./timeline/component/css/dataaxis.css\";\nimport \"./timeline/component/css/item.css\";\nimport \"./timeline/component/css/itemset.css\";\nimport \"./timeline/component/css/labelset.css\";\nimport \"./timeline/component/css/panel.css\";\nimport \"./timeline/component/css/pathStyles.css\";\nimport \"./timeline/component/css/timeaxis.css\";\nimport \"./timeline/component/css/timeline.css\";\n\n// Timeline\nimport Timeline from \"./timeline/Timeline.js\";\nimport Graph2d from \"./timeline/Graph2d.js\";\n\nimport Core from \"./timeline/Core.js\";\nimport * as DateUtil from \"./timeline/DateUtil.js\";\nimport Range from \"./timeline/Range.js\";\nimport * as stack from \"./timeline/Stack.js\";\nimport TimeStep from \"./timeline/TimeStep.js\";\n\nimport Item from \"./timeline/component/item/Item.js\";\nimport BackgroundItem from \"./timeline/component/item/BackgroundItem.js\";\nimport BoxItem from \"./timeline/component/item/BoxItem.js\";\nimport ClusterItem from \"./timeline/component/item/ClusterItem.js\";\nimport PointItem from \"./timeline/component/item/PointItem.js\";\nimport RangeItem from \"./timeline/component/item/RangeItem.js\";\n\nimport BackgroundGroup from \"./timeline/component/BackgroundGroup.js\";\nimport Component from \"./timeline/component/Component.js\";\nimport CurrentTime from \"./timeline/component/CurrentTime.js\";\nimport CustomTime from \"./timeline/component/CustomTime.js\";\nimport DataAxis from \"./timeline/component/DataAxis.js\";\nimport DataScale from \"./timeline/component/DataScale.js\";\nimport GraphGroup from \"./timeline/component/GraphGroup.js\";\nimport Group from \"./timeline/component/Group.js\";\nimport ItemSet from \"./timeline/component/ItemSet.js\";\nimport Legend from \"./timeline/component/Legend.js\";\nimport LineGraph from \"./timeline/component/LineGraph.js\";\nimport TimeAxis from \"./timeline/component/TimeAxis.js\";\n\n// TODO: This should probably be moved somewhere else to ensure that both builds\n// behave the same way.\nimport moment from \"moment\";\nimport { getNavigatorLanguage } from \"./DOMutil.js\";\nconst defaultLanguage = getNavigatorLanguage();\nmoment.locale(defaultLanguage);\n\nconst timeline = {\n  Core,\n  DateUtil,\n  Range,\n  stack,\n  TimeStep,\n\n  components: {\n    items: {\n      Item,\n      BackgroundItem,\n      BoxItem,\n      ClusterItem,\n      PointItem,\n      RangeItem,\n    },\n\n    BackgroundGroup,\n    Component,\n    CurrentTime,\n    CustomTime,\n    DataAxis,\n    DataScale,\n    GraphGroup,\n    Group,\n    ItemSet,\n    Legend,\n    LineGraph,\n    TimeAxis,\n  },\n};\n\nexport { Graph2d, Timeline, timeline };\n"],"names":["moment","window","bundledMoment","isDataViewLike","obj","idProp","_idProp","isDataViewLikeUpstream","ASPDateRegex","NumericRegex","convert","object","type","match","undefined","String","Error","Boolean","isString","isNaN","Date","parse","valueOf","Number","toDate","e","TypeError","getType","isNumber","isMoment","exec","toISOString","format","value","typeCoerceDataSet","rawDS","start","end","coercedDS","DataSet","fieldId","pipe","createNewDataPipeFrom","map","item","Object","keys","reduce","acc","key","to","all","add","args","getDataSet","remove","update","updateOnly","clear","forEach","bind","get","getIds","off","on","length","dispose","stop","setupXSSCleaner","options","customXSS","xssFilter","FilterXSS","input","process","setupNoOpCleaner","string","configuredXSSProtection","availableUtils","util","setupXSSProtection","disabled","console","warn","filterOptions","defineProperty","Component","constructor","this","props","setOptions","extend","redraw","destroy","_isResized","resized","_previousWidth","width","_previousHeight","height","convertHiddenOptions","body","hiddenDates","Array","isArray","i","repeat","dateItem","push","sort","a","b","updateHiddenDates","domProps","centerContainer","range","pixelTime","startDate","endDate","_d","offset","runUntil","clone","day","dayOfYear","year","subtract","dayOffset","diff","date","month","log","removeDuplicates","startHidden","getIsHidden","endHidden","rangeStart","rangeEnd","hidden","startToFront","endToFront","_applyRange","safeDates","j","stepOverHiddenDates","timeStep","previousTime","stepInHidden","currentValue","current","_end","prevValue","newValue","switchedYear","switchedMonth","switchedDay","toScreen","Core","time","conversion","scale","duration","getHiddenDurationBetween","hiddenBeforeStart","getHiddenDurationBeforeStart","rangeAfterEnd","correctTimeForHidden","toTime","x","hiddenDuration","partialDuration","accumulatedHiddenDuration","getAccumulatedHiddenDuration","getHiddenDurationBefore","timeOffset","requiredDuration","previousPoint","snapAwayFromHidden","direction","correctionEnabled","isHidden","dates","Range","super","now","hours","minutes","seconds","milliseconds","millisecondsPerPixelCache","rolling","deltaDifference","scaleOffset","defaultOptions","rtl","moveable","zoomable","min","max","zoomMin","zoomMax","rollingMode","follow","touch","animationTimer","emitter","_onDragStart","_onDrag","_onDragEnd","_onMouseWheel","_onTouch","_onPinch","dom","rollingModeBtn","addEventListener","startRolling","fields","selectiveExtend","setRange","me","stopRolling","interval","t","rollingModeOffset","animation","center","style","visibility","currentTimeTimer","setTimeout","clearTimeout","callback","frameCallback","byUser","finalStart","finalEnd","_cancelAnimation","initStart","initEnd","easingName","easingFunction","easingFunctions","JSON","stringify","join","initTime","anyChanged","next","dragging","ease","done","s","changed","DateUtil.updateHiddenDates","params","event","emit","timeoutID","getMillisecondsPerPixel","clientWidth","newStart","newEnd","parseFloat","compensation","getRange","totalHidden","previousDelta","_isInsideRange","allowDragging","root","cursor","validateDirection","delta","deltaX","deltaY","DateUtil.getHiddenDurationBetween","diffRange","safeStart","DateUtil.snapAwayFromHidden","safeEnd","wheelDelta","detail","zoomKey","zoomFriction","pointerDate","pointer","getPointer","clientX","y","clientY","_pointerToDate","zoom","preventDefault","centerDate","hiddenDurationBefore","DateUtil.getHiddenDurationBefore","hiddenDurationAfter","centerContainerRect","getBoundingClientRect","left","right","element","elementRect","top","move","moveTo","modifiedHammer","PropagatingHammer","Hammer","noop","set","hammerMock","onTouch","hammer","inputHandler","isFirst","TimeStep","minimumStep","_start","autoScale","step","FORMAT","setMoment","setFormat","defaultFormat","deepExtend","setMinimumStep","roundToMinor","weekday","Math","floor","priorCurrent","week","isSame","hasNext","prev","showMajorLabels","nextWeek","DateUtil.stepOverHiddenDates","getCurrent","setScale","setAutoScale","enable","stepYear","stepMonth","stepDay","stepHour","stepMinute","stepSecond","showWeekScale","stepMillisecond","snap","round","_step","isMajor","isoWeekday","getLabelMinor","minorLabels","getLabelMajor","majorLabels","getClassName","_moment","m","locale","lang","classNames","even","today","currentWeek","currentMonth","toLowerCase","currentYear","filter","millisecond","second","minute","hour","TimeAxis","foreground","lines","majorTexts","minorTexts","redundant","lineTop","orientation","axis","showMinorLabels","maxMinorChars","timeAxis","_create","selectiveDeepExtend","document","createElement","background","className","parentNode","removeChild","parent","bottom","parentChanged","_calculateCharSize","minorLabelHeight","minorCharHeight","majorLabelHeight","majorCharHeight","offsetWidth","minorLineHeight","minorLineWidth","majorLineHeight","majorLineWidth","foregroundNextSibling","nextSibling","backgroundNextSibling","_repaintLabels","insertBefore","appendChild","backgroundVertical","timeLabelsize","minorCharWidth","xNext","showMinorGrid","prevWidth","line","xFirstMajorLabel","count","MAX","label","_repaintMinorText","_repaintMajorText","_repaintMajorLine","_repaintMinorLine","parseInt","warnedForOverflow","leftTime","leftText","widthText","majorCharWidth","arr","elem","pop","text","shift","content","createTextNode","innerHTML","xss","_setXY","childNodes","directionX","transform","measureCharMinor","position","clientHeight","measureCharMajor","Activator","container","active","overlay","_onTapOverlay","stopPropagation","onClick","_hasParent","target","deactivate","keycharm","escListener","Emitter","prototype","removeEventListener","activate","display","addClassName","removeClassName","unbind","en","deleteSelected","it","nl","de","fr","es","uk","ru","pl","pt","tr","ja","sv","nb","lt","locales","en_EN","en_US","it_IT","it_CH","nl_NL","nl_BE","de_DE","de_CH","fr_FR","fr_CA","fr_BE","fr_CH","es_ES","uk_UA","ru_RU","pl_PL","pt_BR","pt_PT","tr_TR","ja_JP","lt_LT","sv_SE","nn","nb_NO","nn_NO","CustomTime","id","title","defaultLocales","customTime","eventParams","bar","drag","onMouseWheel","attachEvent","threshold","DIRECTION_ALL","hide","warned","charAt","toUpperCase","substring","call","setCustomTime","getCustomTime","setCustomMarker","editable","marker","setAttribute","focus","_onMarkerChange","_onMarkerChanged","setCustomTitle","getScale","getStep","snappedTime","customTimeFromTarget","hasOwnProperty","backgroundHorizontal","leftContainer","rightContainer","shadowTop","shadowBottom","shadowTopLeft","shadowBottomLeft","shadowTopRight","shadowBottomRight","loadingScreen","border","scrollTop","scrollTopMin","initialDrawDone","_redraw","initialRangeChangeDone","_origRedraw","throttle","properties","itemSet","initialItemSetDrawn","queue","pinchRecognizer","getTouchAction","hammerUtil.disablePreventDefaultVertically","timelineListeners","isActive","preferZoom","verticalScroll","horizontalScroll","wheelDeltaY","wheelDeltaX","HORIZONTAL_AXIS","deltaMode","isVerticalScrollingPreferred","isCurrentlyScrollingWithVerticalScrollWheel","abs","isHorizontalScrollKeyConfiguredAndPressed","horizontalScrollKey","adjusted","_setScrollTop","horizontalScrollInvert","listener","hammerUtil.onTouch","isFinal","wheelType","onmousewheel","onMouseScrollSide","itemAddedToTimeline","getEventProperties","indexOf","dataTransfer","dropEffect","itemData","getData","err","_onAddItem","_onDropObjectOnItem","customTimes","redrawCount","timeAxis2","_options","components","index","splice","drawPoints","onRender","DateUtil.convertHiddenOptions","clickToUse","activator","_initAutoResize","component","configurator","_createConfigurator","configure","appliedOptions","setModuleOptions","global","setItems","setGroups","_stopAutoResize","setCustomTimeMarker","setCustomTimeTitle","addCustomTime","timestamp","exists","some","removeCustomTime","getVisibleItems","getItemsAtCurrentTime","timeOfEvent","getVisibleGroups","fit","getDataRange","setWindow","arguments","getWindow","zoomIn","percentage","distance","zoomOut","maxHeight","option","asSize","minHeight","rootOffsetWidth","offsetHeight","contentHeight","autoHeight","containerHeight","scrollbarWidth","getScrollBarWidth","leftContainerClientWidth","rightContainerClientWidth","_setDOM","_updateScrollTop","visibilityTop","visibilityBottom","replace","RegExp","contentsOverflow","DIRECTION_HORIZONTAL","longSelectPressTime","centerWidth","setCurrentTime","currentTime","getCurrentTime","_toTime","DateUtil.toTime","_toGlobalTime","_toScreen","DateUtil.toScreen","_toGlobalScreen","autoResize","_startAutoResize","_onResize","rootOffsetHeight","lastWidth","lastHeight","watchTimer","setInterval","clearInterval","initialScrollTop","oldScrollTop","_getScrollTop","newScrollTop","CurrentTime","showCurrentTime","alignCurrentTime","startOf","EPSILON","orderByStart","items","data","orderByEnd","stack","margin","force","shouldBailItemsRedrawFunction","performStacking","substack","subgroup","subgroupHeight","baseTop","vertical","nostack","subgroups","isStackSubgroups","newTop","visible","stackSubgroups","values","stackSubgroupsWithInnerStack","subgroupItems","doSubStack","subgroupOrder","otherSubgroup","margins","compareTimes","shouldStack","shouldOthersStack","getInitialHeight","shouldBail","getItemStart","getItemEnd","horizontal","itemsToPosition","itemsAlreadyPositioned","previousStart","insertionIndex","itemStart","findIndexFrom","previousEnd","horizontalOverlapStartIndex","horizontalOverlapEndIndex","itemEnd","findLastIndexBetween","horizontallyCollidingItems","filterBetween","i2","otherItem","checkVerticalSpatialCollision","currentHeight","predicate","startIndex","endIndex","result","ReservedGroupIds","Group","groupId","subgroupStack","subgroupStackAll","subgroupVisibility","doInnerStack","shouldBailStackItems","subgroupIndex","subgroupOrderer","isVisible","stackDirty","_disposeCallbacks","nestedGroups","showNested","heightMode","groupHeightMode","nestedInGroup","visibleItems","itemsInRange","orderedItems","byStart","byEnd","checkRangedItems","handleCheckRangedItems","setData","groupEditable","order","inner","groupTouchParams","isDragging","templateFunction","groupTemplate","Element","firstChild","isReactComponent","treeLevel","removeCssText","addCssText","getLabelWidth","_didMarkerHeightChange","markerHeight","lastMarkerHeight","redrawQueue","redrawQueueLength","dirty","displayed","returnQueue","fns","_calculateGroupSizeAndPosition","offsetTop","offsetLeft","_shouldBailItemsRedraw","timeoutOptions","onTimeout","bailOptions","relativeBailingTime","itemsSettingTime","bailTimeMs","timeoutMs","userBailFunction","bail","userContinueNotBail","didUserContinue","_redrawItems","forceRestack","lastIsVisible","isCluster","orderedClusters","Set","cluster","_updateItemsInRange","_updateClustersInRange","getVisibleItemsGroupedBySubgroup","orderFn","visibleSubgroupsItems","stack.stackSubgroupsWithInnerStack","_updateSubGroupHeights","customOrderedItems","slice","stack.stack","stack.nostack","repositionX","_didResize","updateProperty","labelWidth","labelHeight","_applyGroupHeight","_updateItemsVerticalPosition","ii","repositionY","_isGroupVisible","_updateSubgroupsSizes","_calculateHeight","fn","_resetSubgroups","toArray","ceil","show","labelSet","setParent","_addToSubgroup","orderSubgroups","includes","_checkIfVisible","subgroupId","initialEnd","sortArray","sortField","_removeFromSubgroup","itemIndex","removeFromDataSet","removeItem","array","startArray","endArray","stack.orderByStart","stack.orderByEnd","oldVisibleItems","visibleItemsLookup","lowerBound","upperBound","endSearchFunction","_checkIfVisibleWithReference","initialPosByStart","binarySearchCustom","_traceVisible","initialPosByEnd","_sortVisibleItems","initialPos","breakCondition","hasItems","unshift","oldVisibleClusters","visibleClusters","visibleClustersLookup","changeSubgroup","oldSubgroup","newSubgroup","disposeCallback","BackgroundGroup","Item","selected","groupShowing","selectable","setSelectability","_updateEditStatus","select","unselect","group","_moveToGroup","_repaintDragCenter","updateTime","dragCenter","dragCenterItem","hammerDragCenter","_onUpdateItem","box","dragLeft","point","_repaintDeleteButton","anchor","overrideItems","deleteButton","optionsLocale","hammerDeleteButton","_repaintOnItemUpdateTimeTooltip","tooltipOnItemUpdateTime","onItemUpdateTimeTooltip","touchParams","itemIsDragging","tooltipOffset","itemDistanceFromTop","template","_getItemData","itemsData","_updateContents","itemVisibleFrameContent","visibleFrameTemplateFunction","itemVisibleFrameContentElement","getElementsByClassName","visibleFrameTemplate","_contentToString","_updateDataAttributes","dataAttributes","attributes","name","removeAttribute","_updateStyle","outerHTML","updateGroup","getWidthLeft","getWidthRight","getTitle","tooltip","BoxItem","dot","align","widthInMs","getTime","_createDomElement","_appendDomElement","_updateDirtyDomComponents","_getDomComponentsSizes","previous","_updateDomComponentsSizes","sizes","_repaintDomAdditionals","repositionXY","boxX","boxY","dotX","dotY","lineX","lineY","lineWidth","dotWidth","lineStyle","lineHeight","PointItem","marginLeft","marginRight","translateX","pointX","pointY","RangeItem","overflow","frame","visibleFrame","baseClassName","maxWidth","getComputedStyle","whiteSpace","_repaintDragLeft","_repaintDragRight","limitSize","parentWidth","contentStartPosition","contentWidth","boxWidth","itemsAlwaysDraggable","dragLeftItem","dragRight","dragRightItem","BackgroundItem","itemSubgroup","Popup","overflowMethod","padding","setPosition","setText","doShow","isLeft","isTop","ClusterItem","assign","fitOnDoubleClick","uiItems","randomUUID","_setupRange","eventEmitter","attached","setUiItems","detach","attach","rangeWidth","showStipes","repositionXWithRanges","repositionXWithoutRanges","_isStipeVisible","repositionStype","lineOffsetWidth","dotOffsetWidth","lineOffset","dotOffset","lineOffsetDirection","dotOffsetDirection","minWidth","itemSetHeight","detachFromParent","_onDoubleClick","_fit","stats","avg","sum","_getUiItems","ondblclick","_getFitRange","fitStart","fitEnd","fitArgs","ClusterGenerator","groups","cache","createClusterItem","dataChanged","applyOnChangedLevel","updateData","getClusters","oldClusters","maxItems","clusterCriteria","level","timeWindow","pow","levelChanged","cacheLevel","_dropLevelsCache","_filterData","clusters","groupName","iMax","neighbors","k","l","num","clusterItems","getGroupId","_getClusterForItems","currentGroupName","oldClustersLookup","itemsIds","oldClusterData","size","every","clusterItem","has","titleTemplate","clusterContent","clusterOptions","UNGROUPED","BACKGROUND","ItemSet","groupOrderSwap","fromGroup","toGroup","targetOrder","groupOrder","multiselect","onDropObjectOnItem","_objectData","onAdd","onUpdate","onMove","onRemove","onMoving","onAddGroup","onMoveGroup","onRemoveGroup","showTooltips","followMouse","delay","groupsData","sequentialSelection","itemListeners","_event","_onAdd","clusterGenerator","_onUpdate","_onRemove","groupListeners","senderId","_onAddGroups","groupData","updatedGroups","nestedGroupId","updatedNestedGroup","concat","_onUpdateGroups","_onRemoveGroups","groupIds","selection","popup","popupTimer","_updateUngrouped","backgroundGroup","ALL","_onSelectItem","_onMultiSelectItem","groupHammer","_onGroupClick","_onGroupDragStart","_onGroupDrag","_onGroupDragEnd","DIRECTION_VERTICAL","_onMouseOver","_onMouseOut","_onMouseMove","markDirty","refreshItems","restackGroups","_detachAllClusters","clearPopupTimer","setPopupTimer","setSelection","ids","idsToDeselect","selectedId","getItemById","getSelection","rawVisibleItems","find","_deselect","_clusterItems","_orderGroups","visibleInterval","zoomed","lastVisibleInterval","scrolled","lastRangeStart","changedStackOption","lastStack","changedStackSubgroupsOption","lastStackSubgroups","firstGroup","_firstGroup","firstMargin","nonFirstMargin","groupMargin","redrawResults","groupResized","firstGroupIndex","firstGroupId","itemId","ungrouped","getLabelSet","oldItemsData","getItems","_order","getGroups","_getType","types","_updateItem","_removeItem","_addItem","groupOptions","create","_orderNestedGroups","equalArray","getOrderedNestedGroups","nestedGroupIds","nestedGroup","_constructByEndArray","itemFromTarget","itemProps","_getGroupIndex","selectedItem","initialX","_cloneItemData","srcEvent","ctrlKey","metaKey","_onDragStartAddItem","baseGroupIndex","itemsToDrag","groupIndex","groupOffset","frameRect","groupFromTarget","newItem","containerRect","domRootOffsetLeft","xOffset","updateGroupAllowed","newGroupBase","initial","initialStart","newOffset","oldGroup","toggleGroupShowNested","nestingGroup","fullNestedGroups","nextLevel","node","showNestedGroups","toggleGroupDragClassName","classList","toggle","originalOrder","movingUp","targetGroup","draggedGroupHeight","targetGroupHeight","draggedGroup","newOrder","origOrder","draggedId","numGroups","curPos","orgOffset","slippedPosition","switchGroup","shouldBeGroup","switchGroupId","dataset","shiftKey","oldSelection","newSelection","itemFromRelatedTarget","objectData","newItemData","itemGroup","lastSelectedGroup","multiselectPerGroup","_getItemRange","_item","filteredSelection","itemFromElement","cur","relatedTarget","foregroundRect","itemSetFromTarget","_updateClusters","newClustersIds","clustersToUnselect","selectionChanged","selectedIdx","allOptions","errorFound","printStyle","Validator","validate","referenceOptions","subObject","usedOptions","path","check","__any__","getSuggestion","referenceOption","is_object","refOptionObj","__type__","checkFields","message","printLocation","optionType","refOptionType","print","copyAndExtendArray","nodeType","_isAMomentObject","msg","localSearch","findInOptions","globalSearch","indexMatch","closestMatch","recursive","closestMatchPath","lowerCaseOption","op","levenshteinDistance","copyArray","prefix","str","matrix","bool","number","enabled","boolean","function","throttleRedraw","any","onInitialDrawComplete","null","loadingScreenTemplate","configureOptions","groupsDraggable","htmlColors","black","navy","darkblue","mediumblue","blue","darkgreen","green","teal","darkcyan","deepskyblue","darkturquoise","mediumspringgreen","lime","springgreen","aqua","cyan","midnightblue","dodgerblue","lightseagreen","forestgreen","seagreen","darkslategray","limegreen","mediumseagreen","turquoise","royalblue","steelblue","darkslateblue","mediumturquoise","indigo","darkolivegreen","cadetblue","cornflowerblue","mediumaquamarine","dimgray","slateblue","olivedrab","slategray","lightslategray","mediumslateblue","lawngreen","chartreuse","aquamarine","maroon","purple","olive","gray","skyblue","lightskyblue","blueviolet","darkred","darkmagenta","saddlebrown","darkseagreen","lightgreen","mediumpurple","darkviolet","palegreen","darkorchid","yellowgreen","sienna","brown","darkgray","lightblue","greenyellow","paleturquoise","lightsteelblue","powderblue","firebrick","darkgoldenrod","mediumorchid","rosybrown","darkkhaki","silver","mediumvioletred","indianred","peru","chocolate","tan","lightgrey","palevioletred","thistle","orchid","goldenrod","crimson","gainsboro","plum","burlywood","lightcyan","lavender","darksalmon","violet","palegoldenrod","lightcoral","khaki","aliceblue","honeydew","azure","sandybrown","wheat","beige","whitesmoke","mintcream","ghostwhite","salmon","antiquewhite","linen","lightgoldenrodyellow","oldlace","red","fuchsia","magenta","deeppink","orangered","tomato","hotpink","coral","darkorange","lightsalmon","orange","lightpink","pink","gold","peachpuff","navajowhite","moccasin","bisque","mistyrose","blanchedalmond","papayawhip","lavenderblush","seashell","cornsilk","lemonchiffon","floralwhite","snow","yellow","lightyellow","ivory","white","ColorPicker","pixelRatio","generated","centerCoordinates","r","color","g","hueCircle","initialColor","previousColor","applied","updateCallback","closeCallback","insertTo","_bindHammer","_setSize","setUpdateCallback","setCloseCallback","_isColorString","setColor","setInitial","rgba","htmlColor","isValidRGB","rgbaArray","substr","split","isValidRGBA","isValidHex","rgbObj","hexToRGB","alpha","_setColor","_generateHueCircle","_hide","storePrevious","_save","_apply","_updatePicker","_loadLast","alert","hsv","RGBToHSV","angleConvert","PI","radius","sin","h","cos","colorPickerSelector","_setOpacity","_setBrightness","v","HSVToRGB","ctx","colorPickerCanvas","getContext","pixelRation","devicePixelRatio","webkitBackingStorePixelRatio","mozBackingStorePixelRatio","msBackingStorePixelRatio","oBackingStorePixelRatio","backingStorePixelRatio","setTransform","w","clearRect","putImageData","fillStyle","circle","fill","brightnessRange","opacityRange","initialColorDiv","backgroundColor","newColorDiv","colorPickerDiv","noCanvas","fontWeight","opacityDiv","brightnessDiv","arrowDiv","onchange","oninput","brightnessLabel","opacityLabel","cancelButton","onclick","applyButton","saveButton","loadButton","pinch","_moveSelector","hue","sat","rgb","hfac","sfac","fillRect","strokeStyle","stroke","getImageData","rect","centerY","centerX","angle","atan2","sqrt","newLeft","Configurator","parentModule","defaultContainer","changedOptions","allowCreation","initialized","popupCounter","showButton","moduleOptions","domElements","popupDiv","popupLimit","popupHistory","colorPicker","wrapper","_removePopup","_clean","counter","_handleObject","_makeItem","_makeHeader","_makeButton","_push","_showPopupIfNeeded","_getValue","base","div","_makeLabel","objectLabel","_makeDropdown","selectedValue","_update","_makeRange","defaultValue","popupString","popupValue","factor","_setupPopup","generateButton","_printOptions","onmouseover","onmouseout","optionsContainer","html","hideTimeout","deleteTimeout","opacity","_makeCheckbox","checkbox","checked","_makeTextInput","_makeColorField","defaultColor","_showColorPicker","colorString","checkOnly","visibleInSet","subObj","newPath","_handleArray","draw","physics","solver","enabledPath","enabledValue","error","_constructOptions","optionsObj","getOptions","Timeline","itemsDone","SyntaxError","forthArgument","directionFromDom","domNode","parentElement","loadingScreenFragment","eventName","hasListeners","toGlobalScreen","toGlobalTime","oncontextmenu","PointerEvent","onpointerdown","onpointermove","onpointerup","onmousemove","onmousedown","onmouseup","initialFitDone","getItemRange","_onFit","newDataSet","DataView","startPos","initialVerticalScroll","verticalAnimationFrame","willDraw","getItemVerticalScroll","itemTop","shouldScroll","from","scrollOffset","setFinalVerticalPosition","finalVerticalScroll","finalVerticalCallback","middle","minItem","maxItem","getStart","getEnd","startSide","endSide","lhs","rhs","getTarget","what","hasParent","pageX","pageY","toggleRollingMode","timeline","itemsetHeight","currentScrollHeight","targetOffset","prepareElements","JSONcontainer","elementType","used","cleanupElements","elementTypeJsonContainer","getSVGElement","svgContainer","createElementNS","getDOMElement","DOMContainer","drawPoint","labelObj","setAttributeNS","styles","yOffset","textContent","drawBar","DataScale","autoScaleStart","autoScaleEnd","zeroAlign","formattingFunction","majorSteps","minorSteps","customLines","minorStepIdx","magnitudefactor","determineScale","rounded","setCharHeight","setHeight","minimumStepValue","orderOfMagnitude","LN10","solutionFound","is_major","getFirstMajor","majorStep","convertValue","formatValue","returnValue","toPrecision","getLines","bottomOffset","major","val","followScale","other","oldStepIdx","oldStart","oldEnd","increaseMagnitude","decreaseMagnitude","otherZero","otherStep","newRange","myOriginalZero","majorOffset","zeroOffset","screenToValue","pixels","DataAxis","svg","linegraphOptions","icons","majorLinesOffset","minorLinesOffset","labelOffsetX","labelOffsetY","iconWidth","alignZeros","linegraphSVG","DOMelements","labels","conversionFactor","stepPixels","zeroCrossing","amountOfSteps","master","masterAxis","svgElements","iconsRemoved","amountOfGroups","_redrawLabels","framework","lineContainer","addGroup","graphOptions","removeGroup","_redrawGroupIcons","DOMutil.prepareElements","iconOffset","groupArray","getLegend","iconHeight","DOMutil.cleanupElements","_cleanupIcons","activeGroups","backgroundHorizontalOffsetWidth","_redrawTitle","customRange","maxLabelSize","_redrawLabel","_redrawLine","titleWidth","titleCharHeight","characterHeight","DOMutil.getDOMElement","textAlign","largestWidth","textMinor","textMajor","textTitle","measureCharTitle","titleCharWidth","Points","getGroupTemplate","callbackResult","Bargraph","Line","GraphGroup","groupsUsingDefaultStyles","selectiveBridgeObject","usingDefaultStyle","zeroPosition","Legend","side","iconSize","iconSpacing","getCallback","DOMutil.drawPoint","screen_x","screen_y","drawIcon","fillHeight","outline","DOMutil.getSVGElement","barWidth","barChart","bar1Height","bar2Height","DOMutil.drawBar","processedGroupData","coreDistance","drawData","combinedData","intersections","barPoints","screen_end","_getDataIntersections","heightOffset","_getSafeDrawData","nextKey","amount","resolved","excludeFromStacking","accumulatedNegative","accumulatedPositive","sideBySide","dataWidth","pointData","getStackedYRange","groupRanges","groupLabel","_getStackedYRange","yAxisOrientation","yMin","yMax","xpos","calcPath","interpolation","_catmullRom","_linear","fillPath","shaded","drawShading","pathArray","subPathArray","dFill","svgHeight","zero","serializePath","inverse","d","_catmullRomUniform","p0","p1","p2","p3","bp1","bp2","normalization","d1","d2","d3","A","B","N","M","d3powA","d2powA","d3pow2A","d2pow2A","d1pow2A","d1powA","insertSort","setZeroPosition","pos","mergeOptions","parametrization","Lines","Bars","icon","getYRange","excludeFromLegend","textArea","scrollableHeight","drawLegendIcons","paddingTop","LineGraph","defaultGroup","sampling","graphHeight","dataAxis","legend","abortedGraphUpdate","updateSVGheight","updateSVGheightOnResize","forceGraphUpdate","lastStart","yAxisLeft","yAxisRight","legendLeft","legendRight","_removeGroup","_updateAllGroupData","_updateGroup","groupsContent","idMap","groupCounts","existingItemsMap","existing_items","newLength","extended","bridgeObject","orginalY","_updateGraph","_getSortedGroupIds","grouplist","zIndex","az","bz","minDate","maxDate","_getRelevantData","_applySampling","_convertXcoordinates","_getYRanges","_updateYAxis","below","_stack","_convertYcoordinates","paths","subGroupId","subData","dx","dy","subPrevPoint","subNextPoint","dateComparator","first","binarySearchValue","last","dataContainer","increment","amountOfPoints","pointsPerPixel","sampledData","combinedDataLeft","combinedDataRight","minVal","maxVal","yAxisLeftUsed","yAxisRightUsed","minLeft","minRight","maxLeft","maxRight","ignore","_toggleAxisVisiblity","drawIcons","tempGroups","axisUsed","datapoints","quarter","Graph2d","linegraph","initialLoad","isGroupVisible","getAbsoluteLeft","getAbsoluteTop","defaultLanguage","navigator","languages","userLanguage","language","browserLanguage","getNavigatorLanguage","DateUtil"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;6bAIA,MAAMA,EACe,oBAAXC,QAA0BA,OAAe,QAAMC,ECalD,SAASC,EAAeC,GAC7B,IAAKA,EACH,OAAO,EAET,IAAIC,EAASD,EAAIC,QAAUD,EAAIE,QAC/B,QAAKD,GAGEE,EAAuBF,EAAQD,EACxC,CAKA,MAAMI,EAAe,qBACfC,EAAe,QAUd,SAASC,EAAQC,EAAQC,GAC9B,IAAIC,EAEJ,QAAeC,IAAXH,EAAJ,CAGA,GAAe,OAAXA,EACF,OAAO,KAGT,IAAKC,EACH,OAAOD,EAET,GAAsB,iBAATC,KAAwBA,aAAgBG,QACnD,MAAM,IAAIC,MAAM,yBAIlB,OAAQJ,GACN,IAAK,UACL,IAAK,UACH,OAAOK,QAAQN,GAEjB,IAAK,SACL,IAAK,SACH,OAAIO,EAASP,KAAYQ,MAAMC,KAAKC,MAAMV,IACjCX,EAAOW,GAAQW,UAKfC,OAAOZ,EAAOW,WAEzB,IAAK,SACL,IAAK,SACH,OAAOP,OAAOJ,GAEhB,IAAK,OACH,IACE,OAAOD,EAAQC,EAAQ,UAAUa,QACnC,CAAE,MAAOC,GACP,MAAIA,aAAaC,UACT,IAAIA,UACR,iCACEC,EAAQhB,GAC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