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AAK,IAAI,EAAyB,EAAK,IAC3E,EAAoB,WAAc,OAAO,EAAe,EAAsB,IAAI,MAAU,EAC5F,EAAW,EACT,YAAY,EAlBG,UAmBf,EACF,EAAU,OACR,EACA,YAAW,WACT,EAAW,YAAY,EArBV,KAsBb,GACJ,GAAG,GACP,OAAO,WACH,aAAa,GACb,cAAc,EAClB,CACJ,GAAG,CAAC,IAEG,EAAO,CAAE,YAAa,EAAa,OAD7B,EAAS,CAAE,SAAU,YAAe,EAAuB,CAAE,KAAM,EAAW,IAAiB,CAAE,IAAK,EAAW,MAElI,CAEA,SAAS,EAAsB,GAC3B,IAAI,EAAS,EAAG,OACZ,EAAY,IAAqB,UACjC,EAAa,IACb,EAAqC,eAAd,EAE3B,OAAO,EAAO,CAAE,mBADS,SAAU,GAAQ,OAAQ,EAAS,CAAE,SAAU,YAAe,EAAuB,CAAE,KAAM,EAAW,IAAU,CAAE,IAAK,EAAW,IAAY,GAE7K,CAEA,IAAI,EAAQ,CACR,SAAU,EACV,QAAS,EACT,OAAQ,EACR,WAAY,CACR,YAAa,EACb,KAAM,IAId,EAAQ,oBAAsB,EAC9B,EAAQ,eAAiB,EACzB,EAAQ,gBAAkB,EAC1B,EAAQ,iBAAmB,EAC3B,EAAQ,sBAAwB,EAChC,EAAiB,QAAI,EACrB,EAAQ,mBAAqB,EAE7B,OAAO,eAAe,EAAS,aAAc,CAAE,OAAO,GAEzD","file":"/npm/react-headless-timeline@0.3.4/dist/react-headless-timeline.umd.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/react-headless-timeline@0.3.4/dist/react-headless-timeline.umd.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n * react-headless-timeline v0.3.4\n * Copyright Dawid Zajac <zajdawid@protonmail.com>\n */\n\n(function (global, factory) {\n    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :\n    typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :\n    (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global[\"react-headless-timeline\"] = {}, global.React));\n})(this, (function (exports, React) { 'use strict';\n\n    function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\n    var React__default = /*#__PURE__*/_interopDefaultLegacy(React);\n\n    /*! *****************************************************************************\r\n    Copyright (c) Microsoft Corporation.\r\n\r\n    Permission to use, copy, modify, and/or distribute this software for any\r\n    purpose with or without fee is hereby granted.\r\n\r\n    THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\n    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\n    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\n    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\n    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\n    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\n    PERFORMANCE OF THIS SOFTWARE.\r\n    ***************************************************************************** */\r\n    /* global Reflect, Promise */\r\n\r\n    var extendStatics = function(d, b) {\r\n        extendStatics = Object.setPrototypeOf ||\r\n            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n        return extendStatics(d, b);\r\n    };\r\n\r\n    function __extends(d, b) {\r\n        extendStatics(d, b);\r\n        function __() { this.constructor = d; }\r\n        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n    }\r\n\r\n    var __assign = function() {\r\n        __assign = Object.assign || function __assign(t) {\r\n            for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n                s = arguments[i];\r\n                for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n            }\r\n            return t;\r\n        };\r\n        return __assign.apply(this, arguments);\r\n    };\n\n    function toInteger(dirtyNumber) {\n      if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {\n        return NaN;\n      }\n\n      var number = Number(dirtyNumber);\n\n      if (isNaN(number)) {\n        return number;\n      }\n\n      return number < 0 ? Math.ceil(number) : Math.floor(number);\n    }\n\n    function requiredArgs(required, args) {\n      if (args.length < required) {\n        throw new TypeError(required + ' argument' + (required > 1 ? 's' : '') + ' required, but only ' + args.length + ' present');\n      }\n    }\n\n    /**\n     * @name toDate\n     * @category Common Helpers\n     * @summary Convert the given argument to an instance of Date.\n     *\n     * @description\n     * Convert the given argument to an instance of Date.\n     *\n     * If the argument is an instance of Date, the function returns its clone.\n     *\n     * If the argument is a number, it is treated as a timestamp.\n     *\n     * If the argument is none of the above, the function returns Invalid Date.\n     *\n     * **Note**: *all* Date arguments passed to any *date-fns* function is processed by `toDate`.\n     *\n     * @param {Date|Number} argument - the value to convert\n     * @returns {Date} the parsed date in the local time zone\n     * @throws {TypeError} 1 argument required\n     *\n     * @example\n     * // Clone the date:\n     * const result = toDate(new Date(2014, 1, 11, 11, 30, 30))\n     * //=> Tue Feb 11 2014 11:30:30\n     *\n     * @example\n     * // Convert the timestamp to date:\n     * const result = toDate(1392098430000)\n     * //=> Tue Feb 11 2014 11:30:30\n     */\n\n    function toDate(argument) {\n      requiredArgs(1, arguments);\n      var argStr = Object.prototype.toString.call(argument); // Clone the date\n\n      if (argument instanceof Date || typeof argument === 'object' && argStr === '[object Date]') {\n        // Prevent the date to lose the milliseconds when passed to new Date() in IE10\n        return new Date(argument.getTime());\n      } else if (typeof argument === 'number' || argStr === '[object Number]') {\n        return new Date(argument);\n      } else {\n        if ((typeof argument === 'string' || argStr === '[object String]') && typeof console !== 'undefined') {\n          // eslint-disable-next-line no-console\n          console.warn(\"Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments\"); // eslint-disable-next-line no-console\n\n          console.warn(new Error().stack);\n        }\n\n        return new Date(NaN);\n      }\n    }\n\n    /**\n     * @name addDays\n     * @category Day Helpers\n     * @summary Add the specified number of days to the given date.\n     *\n     * @description\n     * Add the specified number of days to the given date.\n     *\n     * @param {Date|Number} date - the date to be changed\n     * @param {Number} amount - the amount of days to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n     * @returns {Date} - the new date with the days added\n     * @throws {TypeError} - 2 arguments required\n     *\n     * @example\n     * // Add 10 days to 1 September 2014:\n     * const result = addDays(new Date(2014, 8, 1), 10)\n     * //=> Thu Sep 11 2014 00:00:00\n     */\n\n    function addDays(dirtyDate, dirtyAmount) {\n      requiredArgs(2, arguments);\n      var date = toDate(dirtyDate);\n      var amount = toInteger(dirtyAmount);\n\n      if (isNaN(amount)) {\n        return new Date(NaN);\n      }\n\n      if (!amount) {\n        // If 0 days, no-op to avoid changing times in the hour before end of DST\n        return date;\n      }\n\n      date.setDate(date.getDate() + amount);\n      return date;\n    }\n\n    /**\n     * @name addMonths\n     * @category Month Helpers\n     * @summary Add the specified number of months to the given date.\n     *\n     * @description\n     * Add the specified number of months to the given date.\n     *\n     * @param {Date|Number} date - the date to be changed\n     * @param {Number} amount - the amount of months to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n     * @returns {Date} the new date with the months added\n     * @throws {TypeError} 2 arguments required\n     *\n     * @example\n     * // Add 5 months to 1 September 2014:\n     * const result = addMonths(new Date(2014, 8, 1), 5)\n     * //=> Sun Feb 01 2015 00:00:00\n     */\n\n    function addMonths(dirtyDate, dirtyAmount) {\n      requiredArgs(2, arguments);\n      var date = toDate(dirtyDate);\n      var amount = toInteger(dirtyAmount);\n\n      if (isNaN(amount)) {\n        return new Date(NaN);\n      }\n\n      if (!amount) {\n        // If 0 months, no-op to avoid changing times in the hour before end of DST\n        return date;\n      }\n\n      var dayOfMonth = date.getDate(); // The JS Date object supports date math by accepting out-of-bounds values for\n      // month, day, etc. For example, new Date(2020, 0, 0) returns 31 Dec 2019 and\n      // new Date(2020, 13, 1) returns 1 Feb 2021.  This is *almost* the behavior we\n      // want except that dates will wrap around the end of a month, meaning that\n      // new Date(2020, 13, 31) will return 3 Mar 2021 not 28 Feb 2021 as desired. So\n      // we'll default to the end of the desired month by adding 1 to the desired\n      // month and using a date of 0 to back up one day to the end of the desired\n      // month.\n\n      var endOfDesiredMonth = new Date(date.getTime());\n      endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);\n      var daysInMonth = endOfDesiredMonth.getDate();\n\n      if (dayOfMonth >= daysInMonth) {\n        // If we're already at the end of the month, then this is the correct date\n        // and we're done.\n        return endOfDesiredMonth;\n      } else {\n        // Otherwise, we now know that setting the original day-of-month value won't\n        // cause an overflow, so set the desired day-of-month. Note that we can't\n        // just set the date of `endOfDesiredMonth` because that object may have had\n        // its time changed in the unusual case where where a DST transition was on\n        // the last day of the month and its local time was in the hour skipped or\n        // repeated next to a DST transition.  So we use `date` instead which is\n        // guaranteed to still have the original time.\n        date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);\n        return date;\n      }\n    }\n\n    /**\n     * @name add\n     * @category Common Helpers\n     * @summary Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.\n     *\n     * @description\n     * Add the specified years, months, weeks, days, hours, minutes and seconds to the given date.\n     *\n     * @param {Date|Number} date - the date to be changed\n     * @param {Duration} duration - the object with years, months, weeks, days, hours, minutes and seconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n     *\n     * | Key            | Description                        |\n     * |----------------|------------------------------------|\n     * | years          | Amount of years to be added        |\n     * | months         | Amount of months to be added       |\n     * | weeks          | Amount of weeks to be added        |\n     * | days           | Amount of days to be added         |\n     * | hours          | Amount of hours to be added        |\n     * | minutes        | Amount of minutes to be added      |\n     * | seconds        | Amount of seconds to be added      |\n     *\n     * All values default to 0\n     *\n     * @returns {Date} the new date with the seconds added\n     * @throws {TypeError} 2 arguments required\n     *\n     * @example\n     * // Add the following duration to 1 September 2014, 10:19:50\n     * const result = add(new Date(2014, 8, 1, 10, 19, 50), {\n     *   years: 2,\n     *   months: 9,\n     *   weeks: 1,\n     *   days: 7,\n     *   hours: 5,\n     *   minutes: 9,\n     *   seconds: 30,\n     * })\n     * //=> Thu Jun 15 2017 15:29:20\n     */\n    function add(dirtyDate, duration) {\n      requiredArgs(2, arguments);\n      if (!duration || typeof duration !== 'object') return new Date(NaN);\n      var years = duration.years ? toInteger(duration.years) : 0;\n      var months = duration.months ? toInteger(duration.months) : 0;\n      var weeks = duration.weeks ? toInteger(duration.weeks) : 0;\n      var days = duration.days ? toInteger(duration.days) : 0;\n      var hours = duration.hours ? toInteger(duration.hours) : 0;\n      var minutes = duration.minutes ? toInteger(duration.minutes) : 0;\n      var seconds = duration.seconds ? toInteger(duration.seconds) : 0; // Add years and months\n\n      var date = toDate(dirtyDate);\n      var dateWithMonths = months || years ? addMonths(date, months + years * 12) : date; // Add weeks and days\n\n      var dateWithDays = days || weeks ? addDays(dateWithMonths, days + weeks * 7) : dateWithMonths; // Add days, hours, minutes and seconds\n\n      var minutesToAdd = minutes + hours * 60;\n      var secondsToAdd = seconds + minutesToAdd * 60;\n      var msToAdd = secondsToAdd * 1000;\n      var finalDate = new Date(dateWithDays.getTime() + msToAdd);\n      return finalDate;\n    }\n\n    /**\n     * @name addMilliseconds\n     * @category Millisecond Helpers\n     * @summary Add the specified number of milliseconds to the given date.\n     *\n     * @description\n     * Add the specified number of milliseconds to the given date.\n     *\n     * @param {Date|Number} date - the date to be changed\n     * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n     * @returns {Date} the new date with the milliseconds added\n     * @throws {TypeError} 2 arguments required\n     *\n     * @example\n     * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n     * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n     * //=> Thu Jul 10 2014 12:45:30.750\n     */\n\n    function addMilliseconds(dirtyDate, dirtyAmount) {\n      requiredArgs(2, arguments);\n      var timestamp = toDate(dirtyDate).getTime();\n      var amount = toInteger(dirtyAmount);\n      return new Date(timestamp + amount);\n    }\n\n    var MILLISECONDS_IN_MINUTE$1 = 60000;\n    /**\n     * @name addMinutes\n     * @category Minute Helpers\n     * @summary Add the specified number of minutes to the given date.\n     *\n     * @description\n     * Add the specified number of minutes to the given date.\n     *\n     * @param {Date|Number} date - the date to be changed\n     * @param {Number} amount - the amount of minutes to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n     * @returns {Date} the new date with the minutes added\n     * @throws {TypeError} 2 arguments required\n     *\n     * @example\n     * // Add 30 minutes to 10 July 2014 12:00:00:\n     * const result = addMinutes(new Date(2014, 6, 10, 12, 0), 30)\n     * //=> Thu Jul 10 2014 12:30:00\n     */\n\n    function addMinutes(dirtyDate, dirtyAmount) {\n      requiredArgs(2, arguments);\n      var amount = toInteger(dirtyAmount);\n      return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_MINUTE$1);\n    }\n\n    /**\n     * @name differenceInMilliseconds\n     * @category Millisecond Helpers\n     * @summary Get the number of milliseconds between the given dates.\n     *\n     * @description\n     * Get the number of milliseconds between the given dates.\n     *\n     * @param {Date|Number} dateLeft - the later date\n     * @param {Date|Number} dateRight - the earlier date\n     * @returns {Number} the number of milliseconds\n     * @throws {TypeError} 2 arguments required\n     *\n     * @example\n     * // How many milliseconds are between\n     * // 2 July 2014 12:30:20.600 and 2 July 2014 12:30:21.700?\n     * const result = differenceInMilliseconds(\n     *   new Date(2014, 6, 2, 12, 30, 21, 700),\n     *   new Date(2014, 6, 2, 12, 30, 20, 600)\n     * )\n     * //=> 1100\n     */\n\n    function differenceInMilliseconds(dateLeft, dateRight) {\n      requiredArgs(2, arguments);\n      return toDate(dateLeft).getTime() - toDate(dateRight).getTime();\n    }\n\n    var roundingMap = {\n      ceil: Math.ceil,\n      round: Math.round,\n      floor: Math.floor,\n      trunc: function (value) {\n        return value < 0 ? Math.ceil(value) : Math.floor(value);\n      } // Math.trunc is not supported by IE\n\n    };\n    var defaultRoundingMethod = 'trunc';\n    function getRoundingMethod(method) {\n      return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];\n    }\n\n    /**\n     * @name roundToNearestMinutes\n     * @category Minute Helpers\n     * @summary Rounds the given date to the nearest minute\n     *\n     * @description\n     * Rounds the given date to the nearest minute (or number of minutes).\n     * Rounds up when the given date is exactly between the nearest round minutes.\n     *\n     * @param {Date|Number} date - the date to round\n     * @param {Object} [options] - an object with options.\n     * @param {Number} [options.nearestTo=1] - nearest number of minutes to round to. E.g. `15` to round to quarter hours.\n     * @param {String} [options.roundingMethod='trunc'] - a rounding method (`ceil`, `floor`, `round` or `trunc`)\n     * @returns {Date} the new date rounded to the closest minute\n     * @throws {TypeError} 1 argument required\n     * @throws {RangeError} `options.nearestTo` must be between 1 and 30\n     *\n     * @example\n     * // Round 10 July 2014 12:12:34 to nearest minute:\n     * const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34))\n     * //=> Thu Jul 10 2014 12:13:00\n     *\n     * @example\n     * // Round 10 July 2014 12:07:30 to nearest quarter hour:\n     * const result = roundToNearestMinutes(new Date(2014, 6, 10, 12, 12, 34), { nearestTo: 15 })\n     * // rounds up because given date is exactly between 12:00:00 and 12:15:00\n     * //=> Thu Jul 10 2014 12:15:00\n     */\n\n    function roundToNearestMinutes(dirtyDate, options) {\n      var _options$nearestTo;\n\n      if (arguments.length < 1) {\n        throw new TypeError('1 argument required, but only none provided present');\n      }\n\n      var nearestTo = toInteger((_options$nearestTo = options === null || options === void 0 ? void 0 : options.nearestTo) !== null && _options$nearestTo !== void 0 ? _options$nearestTo : 1);\n\n      if (nearestTo < 1 || nearestTo > 30) {\n        throw new RangeError('`options.nearestTo` must be between 1 and 30');\n      }\n\n      var date = toDate(dirtyDate);\n      var seconds = date.getSeconds(); // relevant if nearestTo is 1, which is the default case\n\n      var minutes = date.getMinutes() + seconds / 60;\n      var roundingMethod = getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod);\n      var roundedMinutes = roundingMethod(minutes / nearestTo) * nearestTo;\n      var remainderMinutes = minutes % nearestTo;\n      var addedMinutes = Math.round(remainderMinutes / nearestTo) * nearestTo;\n      return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), roundedMinutes + addedMinutes);\n    }\n\n    var LibError = (function (_super) {\n        __extends(LibError, _super);\n        function LibError(message) {\n            var _this = _super.call(this, message) || this;\n            _this.name = '[react-headless-timeline]';\n            return _this;\n        }\n        return LibError;\n    }(Error));\n\n    var DEFAULT_TIMELINE_DIRECTION = 'horizontal';\n\n    var TimelineCtx = React.createContext(undefined);\n    function TimelineProvider(_a) {\n        var children = _a.children, startDate = _a.startDate, endDate = _a.endDate, _b = _a.direction, direction = _b === void 0 ? DEFAULT_TIMELINE_DIRECTION : _b;\n        return (React__default[\"default\"].createElement(TimelineCtx.Provider, { value: {\n                startDate: startDate,\n                endDate: endDate,\n                direction: direction,\n            } }, children));\n    }\n    var useTimelineContext = function () {\n        var value = React.useContext(TimelineCtx);\n        if (!value) {\n            throw new LibError('\"useTimelineContext\" cannot be used outside of the TimelineCtx!');\n        }\n        return value;\n    };\n\n    var useOffsetCalculator = function () {\n        var timeline = useTimelineContext();\n        return function (startDate) {\n            var timelineDatesDiff = Math.abs(differenceInMilliseconds(timeline.endDate, timeline.startDate));\n            var startDatesDiff = Math.abs(differenceInMilliseconds(startDate, timeline.startDate));\n            var offsetPercentage = (startDatesDiff * 100) / timelineDatesDiff;\n            return \"\".concat(offsetPercentage, \"%\");\n        };\n    };\n\n    var useSizeCalculator = function () {\n        var timeline = useTimelineContext();\n        return function (_a) {\n            var startDate = _a.startDate, endDate = _a.endDate;\n            var timelineDatesDiff = Math.abs(differenceInMilliseconds(timeline.endDate, timeline.startDate));\n            var eventDatesDiff = Math.abs(differenceInMilliseconds(endDate, startDate));\n            var sizePercentage = (eventDatesDiff * 100) / timelineDatesDiff;\n            return \"\".concat(sizePercentage, \"%\");\n        };\n    };\n\n    var MILLISECONDS_IN_SECOND$1 = 1000;\n    var MIN_CELLS_QTY = 2;\n    var DEFAULT_CELLS_QTY = MIN_CELLS_QTY;\n    function TimelineHeaders(_a) {\n        var _b = _a.cells, cells = _b === void 0 ? DEFAULT_CELLS_QTY : _b, render = _a.render;\n        var _c = useTimelineContext(), startDate = _c.startDate, endDate = _c.endDate, direction = _c.direction;\n        var calcOffset = useOffsetCalculator();\n        var hasMoreCellsThanRequired = cells > MIN_CELLS_QTY;\n        var isHorizontalTimeline = direction === 'horizontal';\n        var cellSizeMs = Math.round((endDate.getTime() - startDate.getTime()) / (cells - 1));\n        var headers = hasMoreCellsThanRequired\n            ? new Array(cells).fill(null).reduce(function (dates, _, index) {\n                dates.push(add(startDate, { seconds: (cellSizeMs / MILLISECONDS_IN_SECOND$1) * index }));\n                return dates;\n            }, [])\n            : [startDate, endDate];\n        var getHeaderStyles = function (header) { return (__assign({ position: 'absolute' }, (isHorizontalTimeline ? { left: calcOffset(header) } : { top: calcOffset(header) }))); };\n        return render({ headers: headers, getHeaderStyles: getHeaderStyles });\n    }\n\n    function TimelineEvents(_a) {\n        var render = _a.render;\n        var direction = useTimelineContext().direction;\n        var calcOffset = useOffsetCalculator();\n        var calcSize = useSizeCalculator();\n        var isHorizontalTimeline = direction === 'horizontal';\n        var getEventStyles = function (evt) { return (__assign({ position: 'absolute' }, (isHorizontalTimeline\n            ? { width: calcSize(evt), left: calcOffset(evt.startDate) }\n            : { height: calcSize(evt), top: calcOffset(evt.startDate) }))); };\n        return render({ getEventStyles: getEventStyles });\n    }\n\n    var MILLISECONDS_IN_SECOND = 1000;\n    var SECONDS_IN_MINUTE = 60;\n    var MILLISECONDS_IN_MINUTE = SECONDS_IN_MINUTE * MILLISECONDS_IN_SECOND;\n    var DEFAULT_UPDATE_INTERVAL = 'minute';\n    function TimelineCurrentTime(_a) {\n        var _b = _a.updateInterval, updateInterval = _b === void 0 ? DEFAULT_UPDATE_INTERVAL : _b, render = _a.render;\n        var _c = React.useState(new Date()), currentTime = _c[0], setCurrentTime = _c[1];\n        var direction = useTimelineContext().direction;\n        var calcOffset = useOffsetCalculator();\n        var isSecondInterval = updateInterval === 'second';\n        var isHorizontalTimeline = direction === 'horizontal';\n        React.useEffect(function () {\n            var now = new Date();\n            var nearestMinFromNow = roundToNearestMinutes(now);\n            var nextFullMinuteFromNow = +nearestMinFromNow < +now ? addMinutes(nearestMinFromNow, 1) : nearestMinFromNow;\n            var nowToNextFullMinuteInMilliseconds = Math.abs(differenceInMilliseconds(now, nextFullMinuteFromNow));\n            var updateCurrentTime = function () { return setCurrentTime(roundToNearestMinutes(new Date())); };\n            var interval = isSecondInterval\n                ? setInterval(updateCurrentTime, MILLISECONDS_IN_SECOND)\n                : undefined;\n            var timeout = isSecondInterval\n                ? undefined\n                : setTimeout(function () {\n                    interval = setInterval(updateCurrentTime, MILLISECONDS_IN_MINUTE);\n                    updateCurrentTime();\n                }, nowToNextFullMinuteInMilliseconds);\n            return function () {\n                clearTimeout(timeout);\n                clearInterval(interval);\n            };\n        }, [updateInterval]);\n        var styles = __assign({ position: 'absolute' }, (isHorizontalTimeline ? { left: calcOffset(currentTime) } : { top: calcOffset(currentTime) }));\n        return render({ currentTime: currentTime, styles: styles });\n    }\n\n    function TimelineTimeIndicator(_a) {\n        var render = _a.render;\n        var direction = useTimelineContext().direction;\n        var calcOffset = useOffsetCalculator();\n        var isHorizontalTimeline = direction === 'horizontal';\n        var getIndicatorStyles = function (date) { return (__assign({ position: 'absolute' }, (isHorizontalTimeline ? { left: calcOffset(date) } : { top: calcOffset(date) }))); };\n        return render({ getIndicatorStyles: getIndicatorStyles });\n    }\n\n    var index = {\n        Provider: TimelineProvider,\n        Headers: TimelineHeaders,\n        Events: TimelineEvents,\n        Indicators: {\n            CurrentTime: TimelineCurrentTime,\n            Time: TimelineTimeIndicator,\n        },\n    };\n\n    exports.TimelineCurrentTime = TimelineCurrentTime;\n    exports.TimelineEvents = TimelineEvents;\n    exports.TimelineHeaders = TimelineHeaders;\n    exports.TimelineProvider = TimelineProvider;\n    exports.TimelineTimeIndicator = TimelineTimeIndicator;\n    exports[\"default\"] = index;\n    exports.useTimelineContext = useTimelineContext;\n\n    Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n"]}