{"version":3,"file":"../script.min.js","sources":["script.min.js"],"sourcesContent":["(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i= rect.left &&\n point.left < rect.right &&\n point.top >= rect.top &&\n point.top < rect.bottom;\n }\n // Returns a new rectangle that is the intersection of the two rectangles. If they don't intersect, returns false\n function intersectRects(rect1, rect2) {\n var res = {\n left: Math.max(rect1.left, rect2.left),\n right: Math.min(rect1.right, rect2.right),\n top: Math.max(rect1.top, rect2.top),\n bottom: Math.min(rect1.bottom, rect2.bottom)\n };\n if (res.left < res.right && res.top < res.bottom) {\n return res;\n }\n return false;\n }\n function translateRect(rect, deltaX, deltaY) {\n return {\n left: rect.left + deltaX,\n right: rect.right + deltaX,\n top: rect.top + deltaY,\n bottom: rect.bottom + deltaY\n };\n }\n // Returns a new point that will have been moved to reside within the given rectangle\n function constrainPoint(point, rect) {\n return {\n left: Math.min(Math.max(point.left, rect.left), rect.right),\n top: Math.min(Math.max(point.top, rect.top), rect.bottom)\n };\n }\n // Returns a point that is the center of the given rectangle\n function getRectCenter(rect) {\n return {\n left: (rect.left + rect.right) / 2,\n top: (rect.top + rect.bottom) / 2\n };\n }\n // Subtracts point2's coordinates from point1's coordinates, returning a delta\n function diffPoints(point1, point2) {\n return {\n left: point1.left - point2.left,\n top: point1.top - point2.top\n };\n }\n\n // Logic for determining if, when the element is right-to-left, the scrollbar appears on the left side\n var isRtlScrollbarOnLeft = null;\n function getIsRtlScrollbarOnLeft() {\n if (isRtlScrollbarOnLeft === null) {\n isRtlScrollbarOnLeft = computeIsRtlScrollbarOnLeft();\n }\n return isRtlScrollbarOnLeft;\n }\n function computeIsRtlScrollbarOnLeft() {\n var outerEl = createElement('div', {\n style: {\n position: 'absolute',\n top: -1000,\n left: 0,\n border: 0,\n padding: 0,\n overflow: 'scroll',\n direction: 'rtl'\n }\n }, '
');\n document.body.appendChild(outerEl);\n var innerEl = outerEl.firstChild;\n var res = innerEl.getBoundingClientRect().left > outerEl.getBoundingClientRect().left;\n removeElement(outerEl);\n return res;\n }\n // The scrollbar width computations in computeEdges are sometimes flawed when it comes to\n // retina displays, rounding, and IE11. Massage them into a usable value.\n function sanitizeScrollbarWidth(width) {\n width = Math.max(0, width); // no negatives\n width = Math.round(width);\n return width;\n }\n\n function computeEdges(el, getPadding) {\n if (getPadding === void 0) { getPadding = false; }\n var computedStyle = window.getComputedStyle(el);\n var borderLeft = parseInt(computedStyle.borderLeftWidth, 10) || 0;\n var borderRight = parseInt(computedStyle.borderRightWidth, 10) || 0;\n var borderTop = parseInt(computedStyle.borderTopWidth, 10) || 0;\n var borderBottom = parseInt(computedStyle.borderBottomWidth, 10) || 0;\n // must use offset(Width|Height) because compatible with client(Width|Height)\n var scrollbarLeftRight = sanitizeScrollbarWidth(el.offsetWidth - el.clientWidth - borderLeft - borderRight);\n var scrollbarBottom = sanitizeScrollbarWidth(el.offsetHeight - el.clientHeight - borderTop - borderBottom);\n var res = {\n borderLeft: borderLeft,\n borderRight: borderRight,\n borderTop: borderTop,\n borderBottom: borderBottom,\n scrollbarBottom: scrollbarBottom,\n scrollbarLeft: 0,\n scrollbarRight: 0\n };\n if (getIsRtlScrollbarOnLeft() && computedStyle.direction === 'rtl') { // is the scrollbar on the left side?\n res.scrollbarLeft = scrollbarLeftRight;\n }\n else {\n res.scrollbarRight = scrollbarLeftRight;\n }\n if (getPadding) {\n res.paddingLeft = parseInt(computedStyle.paddingLeft, 10) || 0;\n res.paddingRight = parseInt(computedStyle.paddingRight, 10) || 0;\n res.paddingTop = parseInt(computedStyle.paddingTop, 10) || 0;\n res.paddingBottom = parseInt(computedStyle.paddingBottom, 10) || 0;\n }\n return res;\n }\n function computeInnerRect(el, goWithinPadding) {\n if (goWithinPadding === void 0) { goWithinPadding = false; }\n var outerRect = computeRect(el);\n var edges = computeEdges(el, goWithinPadding);\n var res = {\n left: outerRect.left + edges.borderLeft + edges.scrollbarLeft,\n right: outerRect.right - edges.borderRight - edges.scrollbarRight,\n top: outerRect.top + edges.borderTop,\n bottom: outerRect.bottom - edges.borderBottom - edges.scrollbarBottom\n };\n if (goWithinPadding) {\n res.left += edges.paddingLeft;\n res.right -= edges.paddingRight;\n res.top += edges.paddingTop;\n res.bottom -= edges.paddingBottom;\n }\n return res;\n }\n function computeRect(el) {\n var rect = el.getBoundingClientRect();\n return {\n left: rect.left + window.pageXOffset,\n top: rect.top + window.pageYOffset,\n right: rect.right + window.pageXOffset,\n bottom: rect.bottom + window.pageYOffset\n };\n }\n function computeViewportRect() {\n return {\n left: window.pageXOffset,\n right: window.pageXOffset + document.documentElement.clientWidth,\n top: window.pageYOffset,\n bottom: window.pageYOffset + document.documentElement.clientHeight\n };\n }\n function computeHeightAndMargins(el) {\n return el.getBoundingClientRect().height + computeVMargins(el);\n }\n function computeVMargins(el) {\n var computed = window.getComputedStyle(el);\n return parseInt(computed.marginTop, 10) +\n parseInt(computed.marginBottom, 10);\n }\n // does not return window\n function getClippingParents(el) {\n var parents = [];\n while (el instanceof HTMLElement) { // will stop when gets to document or null\n var computedStyle = window.getComputedStyle(el);\n if (computedStyle.position === 'fixed') {\n break;\n }\n if ((/(auto|scroll)/).test(computedStyle.overflow + computedStyle.overflowY + computedStyle.overflowX)) {\n parents.push(el);\n }\n el = el.parentNode;\n }\n return parents;\n }\n function computeClippingRect(el) {\n return getClippingParents(el)\n .map(function (el) {\n return computeInnerRect(el);\n })\n .concat(computeViewportRect())\n .reduce(function (rect0, rect1) {\n return intersectRects(rect0, rect1) || rect1; // should always intersect\n });\n }\n\n // Stops a mouse/touch event from doing it's native browser action\n function preventDefault(ev) {\n ev.preventDefault();\n }\n // Event Delegation\n // ----------------------------------------------------------------------------------------------------------------\n function listenBySelector(container, eventType, selector, handler) {\n function realHandler(ev) {\n var matchedChild = elementClosest(ev.target, selector);\n if (matchedChild) {\n handler.call(matchedChild, ev, matchedChild);\n }\n }\n container.addEventListener(eventType, realHandler);\n return function () {\n container.removeEventListener(eventType, realHandler);\n };\n }\n function listenToHoverBySelector(container, selector, onMouseEnter, onMouseLeave) {\n var currentMatchedChild;\n return listenBySelector(container, 'mouseover', selector, function (ev, matchedChild) {\n if (matchedChild !== currentMatchedChild) {\n currentMatchedChild = matchedChild;\n onMouseEnter(ev, matchedChild);\n var realOnMouseLeave_1 = function (ev) {\n currentMatchedChild = null;\n onMouseLeave(ev, matchedChild);\n matchedChild.removeEventListener('mouseleave', realOnMouseLeave_1);\n };\n // listen to the next mouseleave, and then unattach\n matchedChild.addEventListener('mouseleave', realOnMouseLeave_1);\n }\n });\n }\n // Animation\n // ----------------------------------------------------------------------------------------------------------------\n var transitionEventNames = [\n 'webkitTransitionEnd',\n 'otransitionend',\n 'oTransitionEnd',\n 'msTransitionEnd',\n 'transitionend'\n ];\n // triggered only when the next single subsequent transition finishes\n function whenTransitionDone(el, callback) {\n var realCallback = function (ev) {\n callback(ev);\n transitionEventNames.forEach(function (eventName) {\n el.removeEventListener(eventName, realCallback);\n });\n };\n transitionEventNames.forEach(function (eventName) {\n el.addEventListener(eventName, realCallback); // cross-browser way to determine when the transition finishes\n });\n }\n\n var DAY_IDS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];\n // Adding\n function addWeeks(m, n) {\n var a = dateToUtcArray(m);\n a[2] += n * 7;\n return arrayToUtcDate(a);\n }\n function addDays(m, n) {\n var a = dateToUtcArray(m);\n a[2] += n;\n return arrayToUtcDate(a);\n }\n function addMs(m, n) {\n var a = dateToUtcArray(m);\n a[6] += n;\n return arrayToUtcDate(a);\n }\n // Diffing (all return floats)\n function diffWeeks(m0, m1) {\n return diffDays(m0, m1) / 7;\n }\n function diffDays(m0, m1) {\n return (m1.valueOf() - m0.valueOf()) / (1000 * 60 * 60 * 24);\n }\n function diffHours(m0, m1) {\n return (m1.valueOf() - m0.valueOf()) / (1000 * 60 * 60);\n }\n function diffMinutes(m0, m1) {\n return (m1.valueOf() - m0.valueOf()) / (1000 * 60);\n }\n function diffSeconds(m0, m1) {\n return (m1.valueOf() - m0.valueOf()) / 1000;\n }\n function diffDayAndTime(m0, m1) {\n var m0day = startOfDay(m0);\n var m1day = startOfDay(m1);\n return {\n years: 0,\n months: 0,\n days: Math.round(diffDays(m0day, m1day)),\n milliseconds: (m1.valueOf() - m1day.valueOf()) - (m0.valueOf() - m0day.valueOf())\n };\n }\n // Diffing Whole Units\n function diffWholeWeeks(m0, m1) {\n var d = diffWholeDays(m0, m1);\n if (d !== null && d % 7 === 0) {\n return d / 7;\n }\n return null;\n }\n function diffWholeDays(m0, m1) {\n if (timeAsMs(m0) === timeAsMs(m1)) {\n return Math.round(diffDays(m0, m1));\n }\n return null;\n }\n // Start-Of\n function startOfDay(m) {\n return arrayToUtcDate([\n m.getUTCFullYear(),\n m.getUTCMonth(),\n m.getUTCDate()\n ]);\n }\n function startOfHour(m) {\n return arrayToUtcDate([\n m.getUTCFullYear(),\n m.getUTCMonth(),\n m.getUTCDate(),\n m.getUTCHours()\n ]);\n }\n function startOfMinute(m) {\n return arrayToUtcDate([\n m.getUTCFullYear(),\n m.getUTCMonth(),\n m.getUTCDate(),\n m.getUTCHours(),\n m.getUTCMinutes()\n ]);\n }\n function startOfSecond(m) {\n return arrayToUtcDate([\n m.getUTCFullYear(),\n m.getUTCMonth(),\n m.getUTCDate(),\n m.getUTCHours(),\n m.getUTCMinutes(),\n m.getUTCSeconds()\n ]);\n }\n // Week Computation\n function weekOfYear(marker, dow, doy) {\n var y = marker.getUTCFullYear();\n var w = weekOfGivenYear(marker, y, dow, doy);\n if (w < 1) {\n return weekOfGivenYear(marker, y - 1, dow, doy);\n }\n var nextW = weekOfGivenYear(marker, y + 1, dow, doy);\n if (nextW >= 1) {\n return Math.min(w, nextW);\n }\n return w;\n }\n function weekOfGivenYear(marker, year, dow, doy) {\n var firstWeekStart = arrayToUtcDate([year, 0, 1 + firstWeekOffset(year, dow, doy)]);\n var dayStart = startOfDay(marker);\n var days = Math.round(diffDays(firstWeekStart, dayStart));\n return Math.floor(days / 7) + 1; // zero-indexed\n }\n // start-of-first-week - start-of-year\n function firstWeekOffset(year, dow, doy) {\n // first-week day -- which january is always in the first week (4 for iso, 1 for other)\n var fwd = 7 + dow - doy;\n // first-week day local weekday -- which local weekday is fwd\n var fwdlw = (7 + arrayToUtcDate([year, 0, fwd]).getUTCDay() - dow) % 7;\n return -fwdlw + fwd - 1;\n }\n // Array Conversion\n function dateToLocalArray(date) {\n return [\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n date.getHours(),\n date.getMinutes(),\n date.getSeconds(),\n date.getMilliseconds()\n ];\n }\n function arrayToLocalDate(a) {\n return new Date(a[0], a[1] || 0, a[2] == null ? 1 : a[2], // day of month\n a[3] || 0, a[4] || 0, a[5] || 0);\n }\n function dateToUtcArray(date) {\n return [\n date.getUTCFullYear(),\n date.getUTCMonth(),\n date.getUTCDate(),\n date.getUTCHours(),\n date.getUTCMinutes(),\n date.getUTCSeconds(),\n date.getUTCMilliseconds()\n ];\n }\n function arrayToUtcDate(a) {\n // according to web standards (and Safari), a month index is required.\n // massage if only given a year.\n if (a.length === 1) {\n a = a.concat([0]);\n }\n return new Date(Date.UTC.apply(Date, a));\n }\n // Other Utils\n function isValidDate(m) {\n return !isNaN(m.valueOf());\n }\n function timeAsMs(m) {\n return m.getUTCHours() * 1000 * 60 * 60 +\n m.getUTCMinutes() * 1000 * 60 +\n m.getUTCSeconds() * 1000 +\n m.getUTCMilliseconds();\n }\n\n var INTERNAL_UNITS = ['years', 'months', 'days', 'milliseconds'];\n var PARSE_RE = /^(-?)(?:(\\d+)\\.)?(\\d+):(\\d\\d)(?::(\\d\\d)(?:\\.(\\d\\d\\d))?)?/;\n // Parsing and Creation\n function createDuration(input, unit) {\n var _a;\n if (typeof input === 'string') {\n return parseString(input);\n }\n else if (typeof input === 'object' && input) { // non-null object\n return normalizeObject(input);\n }\n else if (typeof input === 'number') {\n return normalizeObject((_a = {}, _a[unit || 'milliseconds'] = input, _a));\n }\n else {\n return null;\n }\n }\n function parseString(s) {\n var m = PARSE_RE.exec(s);\n if (m) {\n var sign = m[1] ? -1 : 1;\n return {\n years: 0,\n months: 0,\n days: sign * (m[2] ? parseInt(m[2], 10) : 0),\n milliseconds: sign * ((m[3] ? parseInt(m[3], 10) : 0) * 60 * 60 * 1000 + // hours\n (m[4] ? parseInt(m[4], 10) : 0) * 60 * 1000 + // minutes\n (m[5] ? parseInt(m[5], 10) : 0) * 1000 + // seconds\n (m[6] ? parseInt(m[6], 10) : 0) // ms\n )\n };\n }\n return null;\n }\n function normalizeObject(obj) {\n return {\n years: obj.years || obj.year || 0,\n months: obj.months || obj.month || 0,\n days: (obj.days || obj.day || 0) +\n getWeeksFromInput(obj) * 7,\n milliseconds: (obj.hours || obj.hour || 0) * 60 * 60 * 1000 + // hours\n (obj.minutes || obj.minute || 0) * 60 * 1000 + // minutes\n (obj.seconds || obj.second || 0) * 1000 + // seconds\n (obj.milliseconds || obj.millisecond || obj.ms || 0) // ms\n };\n }\n function getWeeksFromInput(obj) {\n return obj.weeks || obj.week || 0;\n }\n // Equality\n function durationsEqual(d0, d1) {\n return d0.years === d1.years &&\n d0.months === d1.months &&\n d0.days === d1.days &&\n d0.milliseconds === d1.milliseconds;\n }\n function isSingleDay(dur) {\n return dur.years === 0 && dur.months === 0 && dur.days === 1 && dur.milliseconds === 0;\n }\n // Simple Math\n function addDurations(d0, d1) {\n return {\n years: d0.years + d1.years,\n months: d0.months + d1.months,\n days: d0.days + d1.days,\n milliseconds: d0.milliseconds + d1.milliseconds\n };\n }\n function subtractDurations(d1, d0) {\n return {\n years: d1.years - d0.years,\n months: d1.months - d0.months,\n days: d1.days - d0.days,\n milliseconds: d1.milliseconds - d0.milliseconds\n };\n }\n function multiplyDuration(d, n) {\n return {\n years: d.years * n,\n months: d.months * n,\n days: d.days * n,\n milliseconds: d.milliseconds * n\n };\n }\n // Conversions\n // \"Rough\" because they are based on average-case Gregorian months/years\n function asRoughYears(dur) {\n return asRoughDays(dur) / 365;\n }\n function asRoughMonths(dur) {\n return asRoughDays(dur) / 30;\n }\n function asRoughDays(dur) {\n return asRoughMs(dur) / 864e5;\n }\n function asRoughMinutes(dur) {\n return asRoughMs(dur) / (1000 * 60);\n }\n function asRoughSeconds(dur) {\n return asRoughMs(dur) / 1000;\n }\n function asRoughMs(dur) {\n return dur.years * (365 * 864e5) +\n dur.months * (30 * 864e5) +\n dur.days * 864e5 +\n dur.milliseconds;\n }\n // Advanced Math\n function wholeDivideDurations(numerator, denominator) {\n var res = null;\n for (var i = 0; i < INTERNAL_UNITS.length; i++) {\n var unit = INTERNAL_UNITS[i];\n if (denominator[unit]) {\n var localRes = numerator[unit] / denominator[unit];\n if (!isInt(localRes) || (res !== null && res !== localRes)) {\n return null;\n }\n res = localRes;\n }\n else if (numerator[unit]) {\n // needs to divide by something but can't!\n return null;\n }\n }\n return res;\n }\n function greatestDurationDenominator(dur, dontReturnWeeks) {\n var ms = dur.milliseconds;\n if (ms) {\n if (ms % 1000 !== 0) {\n return { unit: 'millisecond', value: ms };\n }\n if (ms % (1000 * 60) !== 0) {\n return { unit: 'second', value: ms / 1000 };\n }\n if (ms % (1000 * 60 * 60) !== 0) {\n return { unit: 'minute', value: ms / (1000 * 60) };\n }\n if (ms) {\n return { unit: 'hour', value: ms / (1000 * 60 * 60) };\n }\n }\n if (dur.days) {\n if (!dontReturnWeeks && dur.days % 7 === 0) {\n return { unit: 'week', value: dur.days / 7 };\n }\n return { unit: 'day', value: dur.days };\n }\n if (dur.months) {\n return { unit: 'month', value: dur.months };\n }\n if (dur.years) {\n return { unit: 'year', value: dur.years };\n }\n return { unit: 'millisecond', value: 0 };\n }\n\n /* FullCalendar-specific DOM Utilities\n ----------------------------------------------------------------------------------------------------------------------*/\n // Given the scrollbar widths of some other container, create borders/margins on rowEls in order to match the left\n // and right space that was offset by the scrollbars. A 1-pixel border first, then margin beyond that.\n function compensateScroll(rowEl, scrollbarWidths) {\n if (scrollbarWidths.left) {\n applyStyle(rowEl, {\n borderLeftWidth: 1,\n marginLeft: scrollbarWidths.left - 1\n });\n }\n if (scrollbarWidths.right) {\n applyStyle(rowEl, {\n borderRightWidth: 1,\n marginRight: scrollbarWidths.right - 1\n });\n }\n }\n // Undoes compensateScroll and restores all borders/margins\n function uncompensateScroll(rowEl) {\n applyStyle(rowEl, {\n marginLeft: '',\n marginRight: '',\n borderLeftWidth: '',\n borderRightWidth: ''\n });\n }\n // Make the mouse cursor express that an event is not allowed in the current area\n function disableCursor() {\n document.body.classList.add('fc-not-allowed');\n }\n // Returns the mouse cursor to its original look\n function enableCursor() {\n document.body.classList.remove('fc-not-allowed');\n }\n // Given a total available height to fill, have `els` (essentially child rows) expand to accomodate.\n // By default, all elements that are shorter than the recommended height are expanded uniformly, not considering\n // any other els that are already too tall. if `shouldRedistribute` is on, it considers these tall rows and\n // reduces the available height.\n function distributeHeight(els, availableHeight, shouldRedistribute) {\n // *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,\n // and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.\n var minOffset1 = Math.floor(availableHeight / els.length); // for non-last element\n var minOffset2 = Math.floor(availableHeight - minOffset1 * (els.length - 1)); // for last element *FLOORING NOTE*\n var flexEls = []; // elements that are allowed to expand. array of DOM nodes\n var flexOffsets = []; // amount of vertical space it takes up\n var flexHeights = []; // actual css height\n var usedHeight = 0;\n undistributeHeight(els); // give all elements their natural height\n // find elements that are below the recommended height (expandable).\n // important to query for heights in a single first pass (to avoid reflow oscillation).\n els.forEach(function (el, i) {\n var minOffset = i === els.length - 1 ? minOffset2 : minOffset1;\n var naturalHeight = el.getBoundingClientRect().height;\n var naturalOffset = naturalHeight + computeVMargins(el);\n if (naturalOffset < minOffset) {\n flexEls.push(el);\n flexOffsets.push(naturalOffset);\n flexHeights.push(naturalHeight);\n }\n else {\n // this element stretches past recommended height (non-expandable). mark the space as occupied.\n usedHeight += naturalOffset;\n }\n });\n // readjust the recommended height to only consider the height available to non-maxed-out rows.\n if (shouldRedistribute) {\n availableHeight -= usedHeight;\n minOffset1 = Math.floor(availableHeight / flexEls.length);\n minOffset2 = Math.floor(availableHeight - minOffset1 * (flexEls.length - 1)); // *FLOORING NOTE*\n }\n // assign heights to all expandable elements\n flexEls.forEach(function (el, i) {\n var minOffset = i === flexEls.length - 1 ? minOffset2 : minOffset1;\n var naturalOffset = flexOffsets[i];\n var naturalHeight = flexHeights[i];\n var newHeight = minOffset - (naturalOffset - naturalHeight); // subtract the margin/padding\n if (naturalOffset < minOffset) { // we check this again because redistribution might have changed things\n el.style.height = newHeight + 'px';\n }\n });\n }\n // Undoes distrubuteHeight, restoring all els to their natural height\n function undistributeHeight(els) {\n els.forEach(function (el) {\n el.style.height = '';\n });\n }\n // Given `els`, a set of cells, find the cell with the largest natural width and set the widths of all the\n // cells to be that width.\n // PREREQUISITE: if you want a cell to take up width, it needs to have a single inner element w/ display:inline\n function matchCellWidths(els) {\n var maxInnerWidth = 0;\n els.forEach(function (el) {\n var innerEl = el.firstChild; // hopefully an element\n if (innerEl instanceof HTMLElement) {\n var innerWidth_1 = innerEl.getBoundingClientRect().width;\n if (innerWidth_1 > maxInnerWidth) {\n maxInnerWidth = innerWidth_1;\n }\n }\n });\n maxInnerWidth++; // sometimes not accurate of width the text needs to stay on one line. insurance\n els.forEach(function (el) {\n el.style.width = maxInnerWidth + 'px';\n });\n return maxInnerWidth;\n }\n // Given one element that resides inside another,\n // Subtracts the height of the inner element from the outer element.\n function subtractInnerElHeight(outerEl, innerEl) {\n // effin' IE8/9/10/11 sometimes returns 0 for dimensions. this weird hack was the only thing that worked\n var reflowStyleProps = {\n position: 'relative',\n left: -1 // ensure reflow in case the el was already relative. negative is less likely to cause new scroll\n };\n applyStyle(outerEl, reflowStyleProps);\n applyStyle(innerEl, reflowStyleProps);\n var diff = // grab the dimensions\n outerEl.getBoundingClientRect().height -\n innerEl.getBoundingClientRect().height;\n // undo hack\n var resetStyleProps = { position: '', left: '' };\n applyStyle(outerEl, resetStyleProps);\n applyStyle(innerEl, resetStyleProps);\n return diff;\n }\n /* Selection\n ----------------------------------------------------------------------------------------------------------------------*/\n function preventSelection(el) {\n el.classList.add('fc-unselectable');\n el.addEventListener('selectstart', preventDefault);\n }\n function allowSelection(el) {\n el.classList.remove('fc-unselectable');\n el.removeEventListener('selectstart', preventDefault);\n }\n /* Context Menu\n ----------------------------------------------------------------------------------------------------------------------*/\n function preventContextMenu(el) {\n el.addEventListener('contextmenu', preventDefault);\n }\n function allowContextMenu(el) {\n el.removeEventListener('contextmenu', preventDefault);\n }\n /* Object Ordering by Field\n ----------------------------------------------------------------------------------------------------------------------*/\n function parseFieldSpecs(input) {\n var specs = [];\n var tokens = [];\n var i;\n var token;\n if (typeof input === 'string') {\n tokens = input.split(/\\s*,\\s*/);\n }\n else if (typeof input === 'function') {\n tokens = [input];\n }\n else if (Array.isArray(input)) {\n tokens = input;\n }\n for (i = 0; i < tokens.length; i++) {\n token = tokens[i];\n if (typeof token === 'string') {\n specs.push(token.charAt(0) === '-' ?\n { field: token.substring(1), order: -1 } :\n { field: token, order: 1 });\n }\n else if (typeof token === 'function') {\n specs.push({ func: token });\n }\n }\n return specs;\n }\n function compareByFieldSpecs(obj0, obj1, fieldSpecs) {\n var i;\n var cmp;\n for (i = 0; i < fieldSpecs.length; i++) {\n cmp = compareByFieldSpec(obj0, obj1, fieldSpecs[i]);\n if (cmp) {\n return cmp;\n }\n }\n return 0;\n }\n function compareByFieldSpec(obj0, obj1, fieldSpec) {\n if (fieldSpec.func) {\n return fieldSpec.func(obj0, obj1);\n }\n return flexibleCompare(obj0[fieldSpec.field], obj1[fieldSpec.field])\n * (fieldSpec.order || 1);\n }\n function flexibleCompare(a, b) {\n if (!a && !b) {\n return 0;\n }\n if (b == null) {\n return -1;\n }\n if (a == null) {\n return 1;\n }\n if (typeof a === 'string' || typeof b === 'string') {\n return String(a).localeCompare(String(b));\n }\n return a - b;\n }\n /* String Utilities\n ----------------------------------------------------------------------------------------------------------------------*/\n function capitaliseFirstLetter(str) {\n return str.charAt(0).toUpperCase() + str.slice(1);\n }\n function padStart(val, len) {\n var s = String(val);\n return '000'.substr(0, len - s.length) + s;\n }\n /* Number Utilities\n ----------------------------------------------------------------------------------------------------------------------*/\n function compareNumbers(a, b) {\n return a - b;\n }\n function isInt(n) {\n return n % 1 === 0;\n }\n /* Weird Utilities\n ----------------------------------------------------------------------------------------------------------------------*/\n function applyAll(functions, thisObj, args) {\n if (typeof functions === 'function') { // supplied a single function\n functions = [functions];\n }\n if (functions) {\n var i = void 0;\n var ret = void 0;\n for (i = 0; i < functions.length; i++) {\n ret = functions[i].apply(thisObj, args) || ret;\n }\n return ret;\n }\n }\n function firstDefined() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n for (var i = 0; i < args.length; i++) {\n if (args[i] !== undefined) {\n return args[i];\n }\n }\n }\n // Returns a function, that, as long as it continues to be invoked, will not\n // be triggered. The function will be called after it stops being called for\n // N milliseconds. If `immediate` is passed, trigger the function on the\n // leading edge, instead of the trailing.\n // https://github.com/jashkenas/underscore/blob/1.6.0/underscore.js#L714\n function debounce(func, wait) {\n var timeout;\n var args;\n var context;\n var timestamp;\n var result;\n var later = function () {\n var last = new Date().valueOf() - timestamp;\n if (last < wait) {\n timeout = setTimeout(later, wait - last);\n }\n else {\n timeout = null;\n result = func.apply(context, args);\n context = args = null;\n }\n };\n return function () {\n context = this;\n args = arguments;\n timestamp = new Date().valueOf();\n if (!timeout) {\n timeout = setTimeout(later, wait);\n }\n return result;\n };\n }\n // Number and Boolean are only types that defaults or not computed for\n // TODO: write more comments\n function refineProps(rawProps, processors, defaults, leftoverProps) {\n if (defaults === void 0) { defaults = {}; }\n var refined = {};\n for (var key in processors) {\n var processor = processors[key];\n if (rawProps[key] !== undefined) {\n // found\n if (processor === Function) {\n refined[key] = typeof rawProps[key] === 'function' ? rawProps[key] : null;\n }\n else if (processor) { // a refining function?\n refined[key] = processor(rawProps[key]);\n }\n else {\n refined[key] = rawProps[key];\n }\n }\n else if (defaults[key] !== undefined) {\n // there's an explicit default\n refined[key] = defaults[key];\n }\n else {\n // must compute a default\n if (processor === String) {\n refined[key] = ''; // empty string is default for String\n }\n else if (!processor || processor === Number || processor === Boolean || processor === Function) {\n refined[key] = null; // assign null for other non-custom processor funcs\n }\n else {\n refined[key] = processor(null); // run the custom processor func\n }\n }\n }\n if (leftoverProps) {\n for (var key in rawProps) {\n if (processors[key] === undefined) {\n leftoverProps[key] = rawProps[key];\n }\n }\n }\n return refined;\n }\n /* Date stuff that doesn't belong in datelib core\n ----------------------------------------------------------------------------------------------------------------------*/\n // given a timed range, computes an all-day range that has the same exact duration,\n // but whose start time is aligned with the start of the day.\n function computeAlignedDayRange(timedRange) {\n var dayCnt = Math.floor(diffDays(timedRange.start, timedRange.end)) || 1;\n var start = startOfDay(timedRange.start);\n var end = addDays(start, dayCnt);\n return { start: start, end: end };\n }\n // given a timed range, computes an all-day range based on how for the end date bleeds into the next day\n // TODO: give nextDayThreshold a default arg\n function computeVisibleDayRange(timedRange, nextDayThreshold) {\n if (nextDayThreshold === void 0) { nextDayThreshold = createDuration(0); }\n var startDay = null;\n var endDay = null;\n if (timedRange.end) {\n endDay = startOfDay(timedRange.end);\n var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay`\n // If the end time is actually inclusively part of the next day and is equal to or\n // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`.\n // Otherwise, leaving it as inclusive will cause it to exclude `endDay`.\n if (endTimeMS && endTimeMS >= asRoughMs(nextDayThreshold)) {\n endDay = addDays(endDay, 1);\n }\n }\n if (timedRange.start) {\n startDay = startOfDay(timedRange.start); // the beginning of the day the range starts\n // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day.\n if (endDay && endDay <= startDay) {\n endDay = addDays(startDay, 1);\n }\n }\n return { start: startDay, end: endDay };\n }\n // spans from one day into another?\n function isMultiDayRange(range) {\n var visibleRange = computeVisibleDayRange(range);\n return diffDays(visibleRange.start, visibleRange.end) > 1;\n }\n function diffDates(date0, date1, dateEnv, largeUnit) {\n if (largeUnit === 'year') {\n return createDuration(dateEnv.diffWholeYears(date0, date1), 'year');\n }\n else if (largeUnit === 'month') {\n return createDuration(dateEnv.diffWholeMonths(date0, date1), 'month');\n }\n else {\n return diffDayAndTime(date0, date1); // returns a duration\n }\n }\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 parseRecurring(eventInput, allDayDefault, dateEnv, recurringTypes, leftovers) {\n for (var i = 0; i < recurringTypes.length; i++) {\n var localLeftovers = {};\n var parsed = recurringTypes[i].parse(eventInput, localLeftovers, dateEnv);\n if (parsed) {\n var allDay = localLeftovers.allDay;\n delete localLeftovers.allDay; // remove from leftovers\n if (allDay == null) {\n allDay = allDayDefault;\n if (allDay == null) {\n allDay = parsed.allDayGuess;\n if (allDay == null) {\n allDay = false;\n }\n }\n }\n __assign(leftovers, localLeftovers);\n return {\n allDay: allDay,\n duration: parsed.duration,\n typeData: parsed.typeData,\n typeId: i\n };\n }\n }\n return null;\n }\n /*\n Event MUST have a recurringDef\n */\n function expandRecurringRanges(eventDef, duration, framingRange, dateEnv, recurringTypes) {\n var typeDef = recurringTypes[eventDef.recurringDef.typeId];\n var markers = typeDef.expand(eventDef.recurringDef.typeData, {\n start: dateEnv.subtract(framingRange.start, duration),\n end: framingRange.end\n }, dateEnv);\n // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to\n if (eventDef.allDay) {\n markers = markers.map(startOfDay);\n }\n return markers;\n }\n\n var hasOwnProperty = Object.prototype.hasOwnProperty;\n // Merges an array of objects into a single object.\n // The second argument allows for an array of property names who's object values will be merged together.\n function mergeProps(propObjs, complexProps) {\n var dest = {};\n var i;\n var name;\n var complexObjs;\n var j;\n var val;\n var props;\n if (complexProps) {\n for (i = 0; i < complexProps.length; i++) {\n name = complexProps[i];\n complexObjs = [];\n // collect the trailing object values, stopping when a non-object is discovered\n for (j = propObjs.length - 1; j >= 0; j--) {\n val = propObjs[j][name];\n if (typeof val === 'object' && val) { // non-null object\n complexObjs.unshift(val);\n }\n else if (val !== undefined) {\n dest[name] = val; // if there were no objects, this value will be used\n break;\n }\n }\n // if the trailing values were objects, use the merged value\n if (complexObjs.length) {\n dest[name] = mergeProps(complexObjs);\n }\n }\n }\n // copy values into the destination, going from last to first\n for (i = propObjs.length - 1; i >= 0; i--) {\n props = propObjs[i];\n for (name in props) {\n if (!(name in dest)) { // if already assigned by previous props or complex props, don't reassign\n dest[name] = props[name];\n }\n }\n }\n return dest;\n }\n function filterHash(hash, func) {\n var filtered = {};\n for (var key in hash) {\n if (func(hash[key], key)) {\n filtered[key] = hash[key];\n }\n }\n return filtered;\n }\n function mapHash(hash, func) {\n var newHash = {};\n for (var key in hash) {\n newHash[key] = func(hash[key], key);\n }\n return newHash;\n }\n function arrayToHash(a) {\n var hash = {};\n for (var _i = 0, a_1 = a; _i < a_1.length; _i++) {\n var item = a_1[_i];\n hash[item] = true;\n }\n return hash;\n }\n function hashValuesToArray(obj) {\n var a = [];\n for (var key in obj) {\n a.push(obj[key]);\n }\n return a;\n }\n function isPropsEqual(obj0, obj1) {\n for (var key in obj0) {\n if (hasOwnProperty.call(obj0, key)) {\n if (!(key in obj1)) {\n return false;\n }\n }\n }\n for (var key in obj1) {\n if (hasOwnProperty.call(obj1, key)) {\n if (obj0[key] !== obj1[key]) {\n return false;\n }\n }\n }\n return true;\n }\n\n function parseEvents(rawEvents, sourceId, calendar, allowOpenRange) {\n var eventStore = createEmptyEventStore();\n for (var _i = 0, rawEvents_1 = rawEvents; _i < rawEvents_1.length; _i++) {\n var rawEvent = rawEvents_1[_i];\n var tuple = parseEvent(rawEvent, sourceId, calendar, allowOpenRange);\n if (tuple) {\n eventTupleToStore(tuple, eventStore);\n }\n }\n return eventStore;\n }\n function eventTupleToStore(tuple, eventStore) {\n if (eventStore === void 0) { eventStore = createEmptyEventStore(); }\n eventStore.defs[tuple.def.defId] = tuple.def;\n if (tuple.instance) {\n eventStore.instances[tuple.instance.instanceId] = tuple.instance;\n }\n return eventStore;\n }\n function expandRecurring(eventStore, framingRange, calendar) {\n var dateEnv = calendar.dateEnv;\n var defs = eventStore.defs, instances = eventStore.instances;\n // remove existing recurring instances\n instances = filterHash(instances, function (instance) {\n return !defs[instance.defId].recurringDef;\n });\n for (var defId in defs) {\n var def = defs[defId];\n if (def.recurringDef) {\n var duration = def.recurringDef.duration;\n if (!duration) {\n duration = def.allDay ?\n calendar.defaultAllDayEventDuration :\n calendar.defaultTimedEventDuration;\n }\n var starts = expandRecurringRanges(def, duration, framingRange, calendar.dateEnv, calendar.pluginSystem.hooks.recurringTypes);\n for (var _i = 0, starts_1 = starts; _i < starts_1.length; _i++) {\n var start = starts_1[_i];\n var instance = createEventInstance(defId, {\n start: start,\n end: dateEnv.add(start, duration)\n });\n instances[instance.instanceId] = instance;\n }\n }\n }\n return { defs: defs, instances: instances };\n }\n // retrieves events that have the same groupId as the instance specified by `instanceId`\n // or they are the same as the instance.\n // why might instanceId not be in the store? an event from another calendar?\n function getRelevantEvents(eventStore, instanceId) {\n var instance = eventStore.instances[instanceId];\n if (instance) {\n var def_1 = eventStore.defs[instance.defId];\n // get events/instances with same group\n var newStore = filterEventStoreDefs(eventStore, function (lookDef) {\n return isEventDefsGrouped(def_1, lookDef);\n });\n // add the original\n // TODO: wish we could use eventTupleToStore or something like it\n newStore.defs[def_1.defId] = def_1;\n newStore.instances[instance.instanceId] = instance;\n return newStore;\n }\n return createEmptyEventStore();\n }\n function isEventDefsGrouped(def0, def1) {\n return Boolean(def0.groupId && def0.groupId === def1.groupId);\n }\n function transformRawEvents(rawEvents, eventSource, calendar) {\n var calEachTransform = calendar.opt('eventDataTransform');\n var sourceEachTransform = eventSource ? eventSource.eventDataTransform : null;\n if (sourceEachTransform) {\n rawEvents = transformEachRawEvent(rawEvents, sourceEachTransform);\n }\n if (calEachTransform) {\n rawEvents = transformEachRawEvent(rawEvents, calEachTransform);\n }\n return rawEvents;\n }\n function transformEachRawEvent(rawEvents, func) {\n var refinedEvents;\n if (!func) {\n refinedEvents = rawEvents;\n }\n else {\n refinedEvents = [];\n for (var _i = 0, rawEvents_2 = rawEvents; _i < rawEvents_2.length; _i++) {\n var rawEvent = rawEvents_2[_i];\n var refinedEvent = func(rawEvent);\n if (refinedEvent) {\n refinedEvents.push(refinedEvent);\n }\n else if (refinedEvent == null) {\n refinedEvents.push(rawEvent);\n } // if a different falsy value, do nothing\n }\n }\n return refinedEvents;\n }\n function createEmptyEventStore() {\n return { defs: {}, instances: {} };\n }\n function mergeEventStores(store0, store1) {\n return {\n defs: __assign({}, store0.defs, store1.defs),\n instances: __assign({}, store0.instances, store1.instances)\n };\n }\n function filterEventStoreDefs(eventStore, filterFunc) {\n var defs = filterHash(eventStore.defs, filterFunc);\n var instances = filterHash(eventStore.instances, function (instance) {\n return defs[instance.defId]; // still exists?\n });\n return { defs: defs, instances: instances };\n }\n\n function parseRange(input, dateEnv) {\n var start = null;\n var end = null;\n if (input.start) {\n start = dateEnv.createMarker(input.start);\n }\n if (input.end) {\n end = dateEnv.createMarker(input.end);\n }\n if (!start && !end) {\n return null;\n }\n if (start && end && end < start) {\n return null;\n }\n return { start: start, end: end };\n }\n // SIDE-EFFECT: will mutate ranges.\n // Will return a new array result.\n function invertRanges(ranges, constraintRange) {\n var invertedRanges = [];\n var start = constraintRange.start; // the end of the previous range. the start of the new range\n var i;\n var dateRange;\n // ranges need to be in order. required for our date-walking algorithm\n ranges.sort(compareRanges);\n for (i = 0; i < ranges.length; i++) {\n dateRange = ranges[i];\n // add the span of time before the event (if there is any)\n if (dateRange.start > start) { // compare millisecond time (skip any ambig logic)\n invertedRanges.push({ start: start, end: dateRange.start });\n }\n if (dateRange.end > start) {\n start = dateRange.end;\n }\n }\n // add the span of time after the last event (if there is any)\n if (start < constraintRange.end) { // compare millisecond time (skip any ambig logic)\n invertedRanges.push({ start: start, end: constraintRange.end });\n }\n return invertedRanges;\n }\n function compareRanges(range0, range1) {\n return range0.start.valueOf() - range1.start.valueOf(); // earlier ranges go first\n }\n function intersectRanges(range0, range1) {\n var start = range0.start;\n var end = range0.end;\n var newRange = null;\n if (range1.start !== null) {\n if (start === null) {\n start = range1.start;\n }\n else {\n start = new Date(Math.max(start.valueOf(), range1.start.valueOf()));\n }\n }\n if (range1.end != null) {\n if (end === null) {\n end = range1.end;\n }\n else {\n end = new Date(Math.min(end.valueOf(), range1.end.valueOf()));\n }\n }\n if (start === null || end === null || start < end) {\n newRange = { start: start, end: end };\n }\n return newRange;\n }\n function rangesEqual(range0, range1) {\n return (range0.start === null ? null : range0.start.valueOf()) === (range1.start === null ? null : range1.start.valueOf()) &&\n (range0.end === null ? null : range0.end.valueOf()) === (range1.end === null ? null : range1.end.valueOf());\n }\n function rangesIntersect(range0, range1) {\n return (range0.end === null || range1.start === null || range0.end > range1.start) &&\n (range0.start === null || range1.end === null || range0.start < range1.end);\n }\n function rangeContainsRange(outerRange, innerRange) {\n return (outerRange.start === null || (innerRange.start !== null && innerRange.start >= outerRange.start)) &&\n (outerRange.end === null || (innerRange.end !== null && innerRange.end <= outerRange.end));\n }\n function rangeContainsMarker(range, date) {\n return (range.start === null || date >= range.start) &&\n (range.end === null || date < range.end);\n }\n // If the given date is not within the given range, move it inside.\n // (If it's past the end, make it one millisecond before the end).\n function constrainMarkerToRange(date, range) {\n if (range.start != null && date < range.start) {\n return range.start;\n }\n if (range.end != null && date >= range.end) {\n return new Date(range.end.valueOf() - 1);\n }\n return date;\n }\n\n function removeExact(array, exactVal) {\n var removeCnt = 0;\n var i = 0;\n while (i < array.length) {\n if (array[i] === exactVal) {\n array.splice(i, 1);\n removeCnt++;\n }\n else {\n i++;\n }\n }\n return removeCnt;\n }\n function isArraysEqual(a0, a1) {\n var len = a0.length;\n var i;\n if (len !== a1.length) { // not array? or not same length?\n return false;\n }\n for (i = 0; i < len; i++) {\n if (a0[i] !== a1[i]) {\n return false;\n }\n }\n return true;\n }\n\n function memoize(workerFunc) {\n var args;\n var res;\n return function () {\n if (!args || !isArraysEqual(args, arguments)) {\n args = arguments;\n res = workerFunc.apply(this, arguments);\n }\n return res;\n };\n }\n /*\n always executes the workerFunc, but if the result is equal to the previous result,\n return the previous result instead.\n */\n function memoizeOutput(workerFunc, equalityFunc) {\n var cachedRes = null;\n return function () {\n var newRes = workerFunc.apply(this, arguments);\n if (cachedRes === null || !(cachedRes === newRes || equalityFunc(cachedRes, newRes))) {\n cachedRes = newRes;\n }\n return cachedRes;\n };\n }\n\n var EXTENDED_SETTINGS_AND_SEVERITIES = {\n week: 3,\n separator: 0,\n omitZeroMinute: 0,\n meridiem: 0,\n omitCommas: 0\n };\n var STANDARD_DATE_PROP_SEVERITIES = {\n timeZoneName: 7,\n era: 6,\n year: 5,\n month: 4,\n day: 2,\n weekday: 2,\n hour: 1,\n minute: 1,\n second: 1\n };\n var MERIDIEM_RE = /\\s*([ap])\\.?m\\.?/i; // eats up leading spaces too\n var COMMA_RE = /,/g; // we need re for globalness\n var MULTI_SPACE_RE = /\\s+/g;\n var LTR_RE = /\\u200e/g; // control character\n var UTC_RE = /UTC|GMT/;\n var NativeFormatter = /** @class */ (function () {\n function NativeFormatter(formatSettings) {\n var standardDateProps = {};\n var extendedSettings = {};\n var severity = 0;\n for (var name_1 in formatSettings) {\n if (name_1 in EXTENDED_SETTINGS_AND_SEVERITIES) {\n extendedSettings[name_1] = formatSettings[name_1];\n severity = Math.max(EXTENDED_SETTINGS_AND_SEVERITIES[name_1], severity);\n }\n else {\n standardDateProps[name_1] = formatSettings[name_1];\n if (name_1 in STANDARD_DATE_PROP_SEVERITIES) {\n severity = Math.max(STANDARD_DATE_PROP_SEVERITIES[name_1], severity);\n }\n }\n }\n this.standardDateProps = standardDateProps;\n this.extendedSettings = extendedSettings;\n this.severity = severity;\n this.buildFormattingFunc = memoize(buildFormattingFunc);\n }\n NativeFormatter.prototype.format = function (date, context) {\n return this.buildFormattingFunc(this.standardDateProps, this.extendedSettings, context)(date);\n };\n NativeFormatter.prototype.formatRange = function (start, end, context) {\n var _a = this, standardDateProps = _a.standardDateProps, extendedSettings = _a.extendedSettings;\n var diffSeverity = computeMarkerDiffSeverity(start.marker, end.marker, context.calendarSystem);\n if (!diffSeverity) {\n return this.format(start, context);\n }\n var biggestUnitForPartial = diffSeverity;\n if (biggestUnitForPartial > 1 && // the two dates are different in a way that's larger scale than time\n (standardDateProps.year === 'numeric' || standardDateProps.year === '2-digit') &&\n (standardDateProps.month === 'numeric' || standardDateProps.month === '2-digit') &&\n (standardDateProps.day === 'numeric' || standardDateProps.day === '2-digit')) {\n biggestUnitForPartial = 1; // make it look like the dates are only different in terms of time\n }\n var full0 = this.format(start, context);\n var full1 = this.format(end, context);\n if (full0 === full1) {\n return full0;\n }\n var partialDateProps = computePartialFormattingOptions(standardDateProps, biggestUnitForPartial);\n var partialFormattingFunc = buildFormattingFunc(partialDateProps, extendedSettings, context);\n var partial0 = partialFormattingFunc(start);\n var partial1 = partialFormattingFunc(end);\n var insertion = findCommonInsertion(full0, partial0, full1, partial1);\n var separator = extendedSettings.separator || '';\n if (insertion) {\n return insertion.before + partial0 + separator + partial1 + insertion.after;\n }\n return full0 + separator + full1;\n };\n NativeFormatter.prototype.getLargestUnit = function () {\n switch (this.severity) {\n case 7:\n case 6:\n case 5:\n return 'year';\n case 4:\n return 'month';\n case 3:\n return 'week';\n default:\n return 'day';\n }\n };\n return NativeFormatter;\n }());\n function buildFormattingFunc(standardDateProps, extendedSettings, context) {\n var standardDatePropCnt = Object.keys(standardDateProps).length;\n if (standardDatePropCnt === 1 && standardDateProps.timeZoneName === 'short') {\n return function (date) {\n return formatTimeZoneOffset(date.timeZoneOffset);\n };\n }\n if (standardDatePropCnt === 0 && extendedSettings.week) {\n return function (date) {\n return formatWeekNumber(context.computeWeekNumber(date.marker), context.weekLabel, context.locale, extendedSettings.week);\n };\n }\n return buildNativeFormattingFunc(standardDateProps, extendedSettings, context);\n }\n function buildNativeFormattingFunc(standardDateProps, extendedSettings, context) {\n standardDateProps = __assign({}, standardDateProps); // copy\n extendedSettings = __assign({}, extendedSettings); // copy\n sanitizeSettings(standardDateProps, extendedSettings);\n standardDateProps.timeZone = 'UTC'; // we leverage the only guaranteed timeZone for our UTC markers\n var normalFormat = new Intl.DateTimeFormat(context.locale.codes, standardDateProps);\n var zeroFormat; // needed?\n if (extendedSettings.omitZeroMinute) {\n var zeroProps = __assign({}, standardDateProps);\n delete zeroProps.minute; // seconds and ms were already considered in sanitizeSettings\n zeroFormat = new Intl.DateTimeFormat(context.locale.codes, zeroProps);\n }\n return function (date) {\n var marker = date.marker;\n var format;\n if (zeroFormat && !marker.getUTCMinutes()) {\n format = zeroFormat;\n }\n else {\n format = normalFormat;\n }\n var s = format.format(marker);\n return postProcess(s, date, standardDateProps, extendedSettings, context);\n };\n }\n function sanitizeSettings(standardDateProps, extendedSettings) {\n // deal with a browser inconsistency where formatting the timezone\n // requires that the hour/minute be present.\n if (standardDateProps.timeZoneName) {\n if (!standardDateProps.hour) {\n standardDateProps.hour = '2-digit';\n }\n if (!standardDateProps.minute) {\n standardDateProps.minute = '2-digit';\n }\n }\n // only support short timezone names\n if (standardDateProps.timeZoneName === 'long') {\n standardDateProps.timeZoneName = 'short';\n }\n // if requesting to display seconds, MUST display minutes\n if (extendedSettings.omitZeroMinute && (standardDateProps.second || standardDateProps.millisecond)) {\n delete extendedSettings.omitZeroMinute;\n }\n }\n function postProcess(s, date, standardDateProps, extendedSettings, context) {\n s = s.replace(LTR_RE, ''); // remove left-to-right control chars. do first. good for other regexes\n if (standardDateProps.timeZoneName === 'short') {\n s = injectTzoStr(s, (context.timeZone === 'UTC' || date.timeZoneOffset == null) ?\n 'UTC' : // important to normalize for IE, which does \"GMT\"\n formatTimeZoneOffset(date.timeZoneOffset));\n }\n if (extendedSettings.omitCommas) {\n s = s.replace(COMMA_RE, '').trim();\n }\n if (extendedSettings.omitZeroMinute) {\n s = s.replace(':00', ''); // zeroFormat doesn't always achieve this\n }\n // ^ do anything that might create adjacent spaces before this point,\n // because MERIDIEM_RE likes to eat up loading spaces\n if (extendedSettings.meridiem === false) {\n s = s.replace(MERIDIEM_RE, '').trim();\n }\n else if (extendedSettings.meridiem === 'narrow') { // a/p\n s = s.replace(MERIDIEM_RE, function (m0, m1) {\n return m1.toLocaleLowerCase();\n });\n }\n else if (extendedSettings.meridiem === 'short') { // am/pm\n s = s.replace(MERIDIEM_RE, function (m0, m1) {\n return m1.toLocaleLowerCase() + 'm';\n });\n }\n else if (extendedSettings.meridiem === 'lowercase') { // other meridiem transformers already converted to lowercase\n s = s.replace(MERIDIEM_RE, function (m0) {\n return m0.toLocaleLowerCase();\n });\n }\n s = s.replace(MULTI_SPACE_RE, ' ');\n s = s.trim();\n return s;\n }\n function injectTzoStr(s, tzoStr) {\n var replaced = false;\n s = s.replace(UTC_RE, function () {\n replaced = true;\n return tzoStr;\n });\n // IE11 doesn't include UTC/GMT in the original string, so append to end\n if (!replaced) {\n s += ' ' + tzoStr;\n }\n return s;\n }\n function formatWeekNumber(num, weekLabel, locale, display) {\n var parts = [];\n if (display === 'narrow') {\n parts.push(weekLabel);\n }\n else if (display === 'short') {\n parts.push(weekLabel, ' ');\n }\n // otherwise, considered 'numeric'\n parts.push(locale.simpleNumberFormat.format(num));\n if (locale.options.isRtl) { // TODO: use control characters instead?\n parts.reverse();\n }\n return parts.join('');\n }\n // Range Formatting Utils\n // 0 = exactly the same\n // 1 = different by time\n // and bigger\n function computeMarkerDiffSeverity(d0, d1, ca) {\n if (ca.getMarkerYear(d0) !== ca.getMarkerYear(d1)) {\n return 5;\n }\n if (ca.getMarkerMonth(d0) !== ca.getMarkerMonth(d1)) {\n return 4;\n }\n if (ca.getMarkerDay(d0) !== ca.getMarkerDay(d1)) {\n return 2;\n }\n if (timeAsMs(d0) !== timeAsMs(d1)) {\n return 1;\n }\n return 0;\n }\n function computePartialFormattingOptions(options, biggestUnit) {\n var partialOptions = {};\n for (var name_2 in options) {\n if (!(name_2 in STANDARD_DATE_PROP_SEVERITIES) || // not a date part prop (like timeZone)\n STANDARD_DATE_PROP_SEVERITIES[name_2] <= biggestUnit) {\n partialOptions[name_2] = options[name_2];\n }\n }\n return partialOptions;\n }\n function findCommonInsertion(full0, partial0, full1, partial1) {\n var i0 = 0;\n while (i0 < full0.length) {\n var found0 = full0.indexOf(partial0, i0);\n if (found0 === -1) {\n break;\n }\n var before0 = full0.substr(0, found0);\n i0 = found0 + partial0.length;\n var after0 = full0.substr(i0);\n var i1 = 0;\n while (i1 < full1.length) {\n var found1 = full1.indexOf(partial1, i1);\n if (found1 === -1) {\n break;\n }\n var before1 = full1.substr(0, found1);\n i1 = found1 + partial1.length;\n var after1 = full1.substr(i1);\n if (before0 === before1 && after0 === after1) {\n return {\n before: before0,\n after: after0\n };\n }\n }\n }\n return null;\n }\n\n /*\n TODO: fix the terminology of \"formatter\" vs \"formatting func\"\n */\n /*\n At the time of instantiation, this object does not know which cmd-formatting system it will use.\n It receives this at the time of formatting, as a setting.\n */\n var CmdFormatter = /** @class */ (function () {\n function CmdFormatter(cmdStr, separator) {\n this.cmdStr = cmdStr;\n this.separator = separator;\n }\n CmdFormatter.prototype.format = function (date, context) {\n return context.cmdFormatter(this.cmdStr, createVerboseFormattingArg(date, null, context, this.separator));\n };\n CmdFormatter.prototype.formatRange = function (start, end, context) {\n return context.cmdFormatter(this.cmdStr, createVerboseFormattingArg(start, end, context, this.separator));\n };\n return CmdFormatter;\n }());\n\n var FuncFormatter = /** @class */ (function () {\n function FuncFormatter(func) {\n this.func = func;\n }\n FuncFormatter.prototype.format = function (date, context) {\n return this.func(createVerboseFormattingArg(date, null, context));\n };\n FuncFormatter.prototype.formatRange = function (start, end, context) {\n return this.func(createVerboseFormattingArg(start, end, context));\n };\n return FuncFormatter;\n }());\n\n // Formatter Object Creation\n function createFormatter(input, defaultSeparator) {\n if (typeof input === 'object' && input) { // non-null object\n if (typeof defaultSeparator === 'string') {\n input = __assign({ separator: defaultSeparator }, input);\n }\n return new NativeFormatter(input);\n }\n else if (typeof input === 'string') {\n return new CmdFormatter(input, defaultSeparator);\n }\n else if (typeof input === 'function') {\n return new FuncFormatter(input);\n }\n }\n // String Utils\n // timeZoneOffset is in minutes\n function buildIsoString(marker, timeZoneOffset, stripZeroTime) {\n if (stripZeroTime === void 0) { stripZeroTime = false; }\n var s = marker.toISOString();\n s = s.replace('.000', '');\n if (stripZeroTime) {\n s = s.replace('T00:00:00Z', '');\n }\n if (s.length > 10) { // time part wasn't stripped, can add timezone info\n if (timeZoneOffset == null) {\n s = s.replace('Z', '');\n }\n else if (timeZoneOffset !== 0) {\n s = s.replace('Z', formatTimeZoneOffset(timeZoneOffset, true));\n }\n // otherwise, its UTC-0 and we want to keep the Z\n }\n return s;\n }\n function formatIsoTimeString(marker) {\n return padStart(marker.getUTCHours(), 2) + ':' +\n padStart(marker.getUTCMinutes(), 2) + ':' +\n padStart(marker.getUTCSeconds(), 2);\n }\n function formatTimeZoneOffset(minutes, doIso) {\n if (doIso === void 0) { doIso = false; }\n var sign = minutes < 0 ? '-' : '+';\n var abs = Math.abs(minutes);\n var hours = Math.floor(abs / 60);\n var mins = Math.round(abs % 60);\n if (doIso) {\n return sign + padStart(hours, 2) + ':' + padStart(mins, 2);\n }\n else {\n return 'GMT' + sign + hours + (mins ? ':' + padStart(mins, 2) : '');\n }\n }\n // Arg Utils\n function createVerboseFormattingArg(start, end, context, separator) {\n var startInfo = expandZonedMarker(start, context.calendarSystem);\n var endInfo = end ? expandZonedMarker(end, context.calendarSystem) : null;\n return {\n date: startInfo,\n start: startInfo,\n end: endInfo,\n timeZone: context.timeZone,\n localeCodes: context.locale.codes,\n separator: separator\n };\n }\n function expandZonedMarker(dateInfo, calendarSystem) {\n var a = calendarSystem.markerToArray(dateInfo.marker);\n return {\n marker: dateInfo.marker,\n timeZoneOffset: dateInfo.timeZoneOffset,\n array: a,\n year: a[0],\n month: a[1],\n day: a[2],\n hour: a[3],\n minute: a[4],\n second: a[5],\n millisecond: a[6]\n };\n }\n\n var EventSourceApi = /** @class */ (function () {\n function EventSourceApi(calendar, internalEventSource) {\n this.calendar = calendar;\n this.internalEventSource = internalEventSource;\n }\n EventSourceApi.prototype.remove = function () {\n this.calendar.dispatch({\n type: 'REMOVE_EVENT_SOURCE',\n sourceId: this.internalEventSource.sourceId\n });\n };\n EventSourceApi.prototype.refetch = function () {\n this.calendar.dispatch({\n type: 'FETCH_EVENT_SOURCES',\n sourceIds: [this.internalEventSource.sourceId]\n });\n };\n Object.defineProperty(EventSourceApi.prototype, \"id\", {\n get: function () {\n return this.internalEventSource.publicId;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventSourceApi.prototype, \"url\", {\n // only relevant to json-feed event sources\n get: function () {\n return this.internalEventSource.meta.url;\n },\n enumerable: true,\n configurable: true\n });\n return EventSourceApi;\n }());\n\n var EventApi = /** @class */ (function () {\n function EventApi(calendar, def, instance) {\n this._calendar = calendar;\n this._def = def;\n this._instance = instance || null;\n }\n /*\n TODO: make event struct more responsible for this\n */\n EventApi.prototype.setProp = function (name, val) {\n var _a, _b;\n if (name in DATE_PROPS) ;\n else if (name in NON_DATE_PROPS) {\n if (typeof NON_DATE_PROPS[name] === 'function') {\n val = NON_DATE_PROPS[name](val);\n }\n this.mutate({\n standardProps: (_a = {}, _a[name] = val, _a)\n });\n }\n else if (name in UNSCOPED_EVENT_UI_PROPS) {\n var ui = void 0;\n if (typeof UNSCOPED_EVENT_UI_PROPS[name] === 'function') {\n val = UNSCOPED_EVENT_UI_PROPS[name](val);\n }\n if (name === 'color') {\n ui = { backgroundColor: val, borderColor: val };\n }\n else if (name === 'editable') {\n ui = { startEditable: val, durationEditable: val };\n }\n else {\n ui = (_b = {}, _b[name] = val, _b);\n }\n this.mutate({\n standardProps: { ui: ui }\n });\n }\n };\n EventApi.prototype.setExtendedProp = function (name, val) {\n var _a;\n this.mutate({\n extendedProps: (_a = {}, _a[name] = val, _a)\n });\n };\n EventApi.prototype.setStart = function (startInput, options) {\n if (options === void 0) { options = {}; }\n var dateEnv = this._calendar.dateEnv;\n var start = dateEnv.createMarker(startInput);\n if (start && this._instance) { // TODO: warning if parsed bad\n var instanceRange = this._instance.range;\n var startDelta = diffDates(instanceRange.start, start, dateEnv, options.granularity); // what if parsed bad!?\n if (options.maintainDuration) {\n this.mutate({ datesDelta: startDelta });\n }\n else {\n this.mutate({ startDelta: startDelta });\n }\n }\n };\n EventApi.prototype.setEnd = function (endInput, options) {\n if (options === void 0) { options = {}; }\n var dateEnv = this._calendar.dateEnv;\n var end;\n if (endInput != null) {\n end = dateEnv.createMarker(endInput);\n if (!end) {\n return; // TODO: warning if parsed bad\n }\n }\n if (this._instance) {\n if (end) {\n var endDelta = diffDates(this._instance.range.end, end, dateEnv, options.granularity);\n this.mutate({ endDelta: endDelta });\n }\n else {\n this.mutate({ standardProps: { hasEnd: false } });\n }\n }\n };\n EventApi.prototype.setDates = function (startInput, endInput, options) {\n if (options === void 0) { options = {}; }\n var dateEnv = this._calendar.dateEnv;\n var standardProps = { allDay: options.allDay };\n var start = dateEnv.createMarker(startInput);\n var end;\n if (!start) {\n return; // TODO: warning if parsed bad\n }\n if (endInput != null) {\n end = dateEnv.createMarker(endInput);\n if (!end) { // TODO: warning if parsed bad\n return;\n }\n }\n if (this._instance) {\n var instanceRange = this._instance.range;\n // when computing the diff for an event being converted to all-day,\n // compute diff off of the all-day values the way event-mutation does.\n if (options.allDay === true) {\n instanceRange = computeAlignedDayRange(instanceRange);\n }\n var startDelta = diffDates(instanceRange.start, start, dateEnv, options.granularity);\n if (end) {\n var endDelta = diffDates(instanceRange.end, end, dateEnv, options.granularity);\n if (durationsEqual(startDelta, endDelta)) {\n this.mutate({ datesDelta: startDelta, standardProps: standardProps });\n }\n else {\n this.mutate({ startDelta: startDelta, endDelta: endDelta, standardProps: standardProps });\n }\n }\n else { // means \"clear the end\"\n standardProps.hasEnd = false;\n this.mutate({ datesDelta: startDelta, standardProps: standardProps });\n }\n }\n };\n EventApi.prototype.moveStart = function (deltaInput) {\n var delta = createDuration(deltaInput);\n if (delta) { // TODO: warning if parsed bad\n this.mutate({ startDelta: delta });\n }\n };\n EventApi.prototype.moveEnd = function (deltaInput) {\n var delta = createDuration(deltaInput);\n if (delta) { // TODO: warning if parsed bad\n this.mutate({ endDelta: delta });\n }\n };\n EventApi.prototype.moveDates = function (deltaInput) {\n var delta = createDuration(deltaInput);\n if (delta) { // TODO: warning if parsed bad\n this.mutate({ datesDelta: delta });\n }\n };\n EventApi.prototype.setAllDay = function (allDay, options) {\n if (options === void 0) { options = {}; }\n var standardProps = { allDay: allDay };\n var maintainDuration = options.maintainDuration;\n if (maintainDuration == null) {\n maintainDuration = this._calendar.opt('allDayMaintainDuration');\n }\n if (this._def.allDay !== allDay) {\n standardProps.hasEnd = maintainDuration;\n }\n this.mutate({ standardProps: standardProps });\n };\n EventApi.prototype.formatRange = function (formatInput) {\n var dateEnv = this._calendar.dateEnv;\n var instance = this._instance;\n var formatter = createFormatter(formatInput, this._calendar.opt('defaultRangeSeparator'));\n if (this._def.hasEnd) {\n return dateEnv.formatRange(instance.range.start, instance.range.end, formatter, {\n forcedStartTzo: instance.forcedStartTzo,\n forcedEndTzo: instance.forcedEndTzo\n });\n }\n else {\n return dateEnv.format(instance.range.start, formatter, {\n forcedTzo: instance.forcedStartTzo\n });\n }\n };\n EventApi.prototype.mutate = function (mutation) {\n var def = this._def;\n var instance = this._instance;\n if (instance) {\n this._calendar.dispatch({\n type: 'MUTATE_EVENTS',\n instanceId: instance.instanceId,\n mutation: mutation,\n fromApi: true\n });\n var eventStore = this._calendar.state.eventStore;\n this._def = eventStore.defs[def.defId];\n this._instance = eventStore.instances[instance.instanceId];\n }\n };\n EventApi.prototype.remove = function () {\n this._calendar.dispatch({\n type: 'REMOVE_EVENT_DEF',\n defId: this._def.defId\n });\n };\n Object.defineProperty(EventApi.prototype, \"source\", {\n get: function () {\n var sourceId = this._def.sourceId;\n if (sourceId) {\n return new EventSourceApi(this._calendar, this._calendar.state.eventSources[sourceId]);\n }\n return null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"start\", {\n get: function () {\n return this._instance ?\n this._calendar.dateEnv.toDate(this._instance.range.start) :\n null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"end\", {\n get: function () {\n return (this._instance && this._def.hasEnd) ?\n this._calendar.dateEnv.toDate(this._instance.range.end) :\n null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"id\", {\n // computable props that all access the def\n // TODO: find a TypeScript-compatible way to do this at scale\n get: function () { return this._def.publicId; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"groupId\", {\n get: function () { return this._def.groupId; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"allDay\", {\n get: function () { return this._def.allDay; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"title\", {\n get: function () { return this._def.title; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"url\", {\n get: function () { return this._def.url; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"rendering\", {\n get: function () { return this._def.rendering; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"startEditable\", {\n get: function () { return this._def.ui.startEditable; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"durationEditable\", {\n get: function () { return this._def.ui.durationEditable; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"constraint\", {\n get: function () { return this._def.ui.constraints[0] || null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"overlap\", {\n get: function () { return this._def.ui.overlap; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"allow\", {\n get: function () { return this._def.ui.allows[0] || null; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"backgroundColor\", {\n get: function () { return this._def.ui.backgroundColor; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"borderColor\", {\n get: function () { return this._def.ui.borderColor; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"textColor\", {\n get: function () { return this._def.ui.textColor; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"classNames\", {\n // NOTE: user can't modify these because Object.freeze was called in event-def parsing\n get: function () { return this._def.ui.classNames; },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(EventApi.prototype, \"extendedProps\", {\n get: function () { return this._def.extendedProps; },\n enumerable: true,\n configurable: true\n });\n return EventApi;\n }());\n\n /*\n Specifying nextDayThreshold signals that all-day ranges should be sliced.\n */\n function sliceEventStore(eventStore, eventUiBases, framingRange, nextDayThreshold) {\n var inverseBgByGroupId = {};\n var inverseBgByDefId = {};\n var defByGroupId = {};\n var bgRanges = [];\n var fgRanges = [];\n var eventUis = compileEventUis(eventStore.defs, eventUiBases);\n for (var defId in eventStore.defs) {\n var def = eventStore.defs[defId];\n if (def.rendering === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId] = [];\n if (!defByGroupId[def.groupId]) {\n defByGroupId[def.groupId] = def;\n }\n }\n else {\n inverseBgByDefId[defId] = [];\n }\n }\n }\n for (var instanceId in eventStore.instances) {\n var instance = eventStore.instances[instanceId];\n var def = eventStore.defs[instance.defId];\n var ui = eventUis[def.defId];\n var origRange = instance.range;\n var normalRange = (!def.allDay && nextDayThreshold) ?\n computeVisibleDayRange(origRange, nextDayThreshold) :\n origRange;\n var slicedRange = intersectRanges(normalRange, framingRange);\n if (slicedRange) {\n if (def.rendering === 'inverse-background') {\n if (def.groupId) {\n inverseBgByGroupId[def.groupId].push(slicedRange);\n }\n else {\n inverseBgByDefId[instance.defId].push(slicedRange);\n }\n }\n else {\n (def.rendering === 'background' ? bgRanges : fgRanges).push({\n def: def,\n ui: ui,\n instance: instance,\n range: slicedRange,\n isStart: normalRange.start && normalRange.start.valueOf() === slicedRange.start.valueOf(),\n isEnd: normalRange.end && normalRange.end.valueOf() === slicedRange.end.valueOf()\n });\n }\n }\n }\n for (var groupId in inverseBgByGroupId) { // BY GROUP\n var ranges = inverseBgByGroupId[groupId];\n var invertedRanges = invertRanges(ranges, framingRange);\n for (var _i = 0, invertedRanges_1 = invertedRanges; _i < invertedRanges_1.length; _i++) {\n var invertedRange = invertedRanges_1[_i];\n var def = defByGroupId[groupId];\n var ui = eventUis[def.defId];\n bgRanges.push({\n def: def,\n ui: ui,\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false\n });\n }\n }\n for (var defId in inverseBgByDefId) {\n var ranges = inverseBgByDefId[defId];\n var invertedRanges = invertRanges(ranges, framingRange);\n for (var _a = 0, invertedRanges_2 = invertedRanges; _a < invertedRanges_2.length; _a++) {\n var invertedRange = invertedRanges_2[_a];\n bgRanges.push({\n def: eventStore.defs[defId],\n ui: eventUis[defId],\n instance: null,\n range: invertedRange,\n isStart: false,\n isEnd: false\n });\n }\n }\n return { bg: bgRanges, fg: fgRanges };\n }\n function hasBgRendering(def) {\n return def.rendering === 'background' || def.rendering === 'inverse-background';\n }\n function filterSegsViaEls(context, segs, isMirror) {\n var calendar = context.calendar, view = context.view;\n if (calendar.hasPublicHandlers('eventRender')) {\n segs = segs.filter(function (seg) {\n var custom = calendar.publiclyTrigger('eventRender', [\n {\n event: new EventApi(calendar, seg.eventRange.def, seg.eventRange.instance),\n isMirror: isMirror,\n isStart: seg.isStart,\n isEnd: seg.isEnd,\n // TODO: include seg.range once all components consistently generate it\n el: seg.el,\n view: view\n }\n ]);\n if (custom === false) { // means don't render at all\n return false;\n }\n else if (custom && custom !== true) {\n seg.el = custom;\n }\n return true;\n });\n }\n for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {\n var seg = segs_1[_i];\n setElSeg(seg.el, seg);\n }\n return segs;\n }\n function setElSeg(el, seg) {\n el.fcSeg = seg;\n }\n function getElSeg(el) {\n return el.fcSeg || null;\n }\n // event ui computation\n function compileEventUis(eventDefs, eventUiBases) {\n return mapHash(eventDefs, function (eventDef) {\n return compileEventUi(eventDef, eventUiBases);\n });\n }\n function compileEventUi(eventDef, eventUiBases) {\n var uis = [];\n if (eventUiBases['']) {\n uis.push(eventUiBases['']);\n }\n if (eventUiBases[eventDef.defId]) {\n uis.push(eventUiBases[eventDef.defId]);\n }\n uis.push(eventDef.ui);\n return combineEventUis(uis);\n }\n // triggers\n function triggerRenderedSegs(context, segs, isMirrors) {\n var calendar = context.calendar, view = context.view;\n if (calendar.hasPublicHandlers('eventPositioned')) {\n for (var _i = 0, segs_2 = segs; _i < segs_2.length; _i++) {\n var seg = segs_2[_i];\n calendar.publiclyTriggerAfterSizing('eventPositioned', [\n {\n event: new EventApi(calendar, seg.eventRange.def, seg.eventRange.instance),\n isMirror: isMirrors,\n isStart: seg.isStart,\n isEnd: seg.isEnd,\n el: seg.el,\n view: view\n }\n ]);\n }\n }\n if (!calendar.state.eventSourceLoadingLevel) { // avoid initial empty state while pending\n calendar.afterSizingTriggers._eventsPositioned = [null]; // fire once\n }\n }\n function triggerWillRemoveSegs(context, segs, isMirrors) {\n var calendar = context.calendar, view = context.view;\n for (var _i = 0, segs_3 = segs; _i < segs_3.length; _i++) {\n var seg = segs_3[_i];\n calendar.trigger('eventElRemove', seg.el);\n }\n if (calendar.hasPublicHandlers('eventDestroy')) {\n for (var _a = 0, segs_4 = segs; _a < segs_4.length; _a++) {\n var seg = segs_4[_a];\n calendar.publiclyTrigger('eventDestroy', [\n {\n event: new EventApi(calendar, seg.eventRange.def, seg.eventRange.instance),\n isMirror: isMirrors,\n el: seg.el,\n view: view\n }\n ]);\n }\n }\n }\n // is-interactable\n function computeEventDraggable(context, eventDef, eventUi) {\n var calendar = context.calendar, view = context.view;\n var transformers = calendar.pluginSystem.hooks.isDraggableTransformers;\n var val = eventUi.startEditable;\n for (var _i = 0, transformers_1 = transformers; _i < transformers_1.length; _i++) {\n var transformer = transformers_1[_i];\n val = transformer(val, eventDef, eventUi, view);\n }\n return val;\n }\n function computeEventStartResizable(context, eventDef, eventUi) {\n return eventUi.durationEditable && context.options.eventResizableFromStart;\n }\n function computeEventEndResizable(context, eventDef, eventUi) {\n return eventUi.durationEditable;\n }\n\n // applies the mutation to ALL defs/instances within the event store\n function applyMutationToEventStore(eventStore, eventConfigBase, mutation, calendar) {\n var eventConfigs = compileEventUis(eventStore.defs, eventConfigBase);\n var dest = createEmptyEventStore();\n for (var defId in eventStore.defs) {\n var def = eventStore.defs[defId];\n dest.defs[defId] = applyMutationToEventDef(def, eventConfigs[defId], mutation, calendar.pluginSystem.hooks.eventDefMutationAppliers, calendar);\n }\n for (var instanceId in eventStore.instances) {\n var instance = eventStore.instances[instanceId];\n var def = dest.defs[instance.defId]; // important to grab the newly modified def\n dest.instances[instanceId] = applyMutationToEventInstance(instance, def, eventConfigs[instance.defId], mutation, calendar);\n }\n return dest;\n }\n function applyMutationToEventDef(eventDef, eventConfig, mutation, appliers, calendar) {\n var standardProps = mutation.standardProps || {};\n // if hasEnd has not been specified, guess a good value based on deltas.\n // if duration will change, there's no way the default duration will persist,\n // and thus, we need to mark the event as having a real end\n if (standardProps.hasEnd == null &&\n eventConfig.durationEditable &&\n (mutation.startDelta || mutation.endDelta)) {\n standardProps.hasEnd = true; // TODO: is this mutation okay?\n }\n var copy = __assign({}, eventDef, standardProps, { ui: __assign({}, eventDef.ui, standardProps.ui) });\n if (mutation.extendedProps) {\n copy.extendedProps = __assign({}, copy.extendedProps, mutation.extendedProps);\n }\n for (var _i = 0, appliers_1 = appliers; _i < appliers_1.length; _i++) {\n var applier = appliers_1[_i];\n applier(copy, mutation, calendar);\n }\n if (!copy.hasEnd && calendar.opt('forceEventDuration')) {\n copy.hasEnd = true;\n }\n return copy;\n }\n function applyMutationToEventInstance(eventInstance, eventDef, // must first be modified by applyMutationToEventDef\n eventConfig, mutation, calendar) {\n var dateEnv = calendar.dateEnv;\n var forceAllDay = mutation.standardProps && mutation.standardProps.allDay === true;\n var clearEnd = mutation.standardProps && mutation.standardProps.hasEnd === false;\n var copy = __assign({}, eventInstance);\n if (forceAllDay) {\n copy.range = computeAlignedDayRange(copy.range);\n }\n if (mutation.datesDelta && eventConfig.startEditable) {\n copy.range = {\n start: dateEnv.add(copy.range.start, mutation.datesDelta),\n end: dateEnv.add(copy.range.end, mutation.datesDelta)\n };\n }\n if (mutation.startDelta && eventConfig.durationEditable) {\n copy.range = {\n start: dateEnv.add(copy.range.start, mutation.startDelta),\n end: copy.range.end\n };\n }\n if (mutation.endDelta && eventConfig.durationEditable) {\n copy.range = {\n start: copy.range.start,\n end: dateEnv.add(copy.range.end, mutation.endDelta)\n };\n }\n if (clearEnd) {\n copy.range = {\n start: copy.range.start,\n end: calendar.getDefaultEventEnd(eventDef.allDay, copy.range.start)\n };\n }\n // in case event was all-day but the supplied deltas were not\n // better util for this?\n if (eventDef.allDay) {\n copy.range = {\n start: startOfDay(copy.range.start),\n end: startOfDay(copy.range.end)\n };\n }\n // handle invalid durations\n if (copy.range.end < copy.range.start) {\n copy.range.end = calendar.getDefaultEventEnd(eventDef.allDay, copy.range.start);\n }\n return copy;\n }\n\n function reduceEventStore (eventStore, action, eventSources, dateProfile, calendar) {\n switch (action.type) {\n case 'RECEIVE_EVENTS': // raw\n return receiveRawEvents(eventStore, eventSources[action.sourceId], action.fetchId, action.fetchRange, action.rawEvents, calendar);\n case 'ADD_EVENTS': // already parsed, but not expanded\n return addEvent(eventStore, action.eventStore, // new ones\n dateProfile ? dateProfile.activeRange : null, calendar);\n case 'MERGE_EVENTS': // already parsed and expanded\n return mergeEventStores(eventStore, action.eventStore);\n case 'PREV': // TODO: how do we track all actions that affect dateProfile :(\n case 'NEXT':\n case 'SET_DATE':\n case 'SET_VIEW_TYPE':\n if (dateProfile) {\n return expandRecurring(eventStore, dateProfile.activeRange, calendar);\n }\n else {\n return eventStore;\n }\n case 'CHANGE_TIMEZONE':\n return rezoneDates(eventStore, action.oldDateEnv, calendar.dateEnv);\n case 'MUTATE_EVENTS':\n return applyMutationToRelated(eventStore, action.instanceId, action.mutation, action.fromApi, calendar);\n case 'REMOVE_EVENT_INSTANCES':\n return excludeInstances(eventStore, action.instances);\n case 'REMOVE_EVENT_DEF':\n return filterEventStoreDefs(eventStore, function (eventDef) {\n return eventDef.defId !== action.defId;\n });\n case 'REMOVE_EVENT_SOURCE':\n return excludeEventsBySourceId(eventStore, action.sourceId);\n case 'REMOVE_ALL_EVENT_SOURCES':\n return filterEventStoreDefs(eventStore, function (eventDef) {\n return !eventDef.sourceId; // only keep events with no source id\n });\n case 'REMOVE_ALL_EVENTS':\n return createEmptyEventStore();\n case 'RESET_EVENTS':\n return {\n defs: eventStore.defs,\n instances: eventStore.instances\n };\n default:\n return eventStore;\n }\n }\n function receiveRawEvents(eventStore, eventSource, fetchId, fetchRange, rawEvents, calendar) {\n if (eventSource && // not already removed\n fetchId === eventSource.latestFetchId // TODO: wish this logic was always in event-sources\n ) {\n var subset = parseEvents(transformRawEvents(rawEvents, eventSource, calendar), eventSource.sourceId, calendar);\n if (fetchRange) {\n subset = expandRecurring(subset, fetchRange, calendar);\n }\n return mergeEventStores(excludeEventsBySourceId(eventStore, eventSource.sourceId), subset);\n }\n return eventStore;\n }\n function addEvent(eventStore, subset, expandRange, calendar) {\n if (expandRange) {\n subset = expandRecurring(subset, expandRange, calendar);\n }\n return mergeEventStores(eventStore, subset);\n }\n function rezoneDates(eventStore, oldDateEnv, newDateEnv) {\n var defs = eventStore.defs;\n var instances = mapHash(eventStore.instances, function (instance) {\n var def = defs[instance.defId];\n if (def.allDay || def.recurringDef) {\n return instance; // isn't dependent on timezone\n }\n else {\n return __assign({}, instance, { range: {\n start: newDateEnv.createMarker(oldDateEnv.toDate(instance.range.start, instance.forcedStartTzo)),\n end: newDateEnv.createMarker(oldDateEnv.toDate(instance.range.end, instance.forcedEndTzo))\n }, forcedStartTzo: newDateEnv.canComputeOffset ? null : instance.forcedStartTzo, forcedEndTzo: newDateEnv.canComputeOffset ? null : instance.forcedEndTzo });\n }\n });\n return { defs: defs, instances: instances };\n }\n function applyMutationToRelated(eventStore, instanceId, mutation, fromApi, calendar) {\n var relevant = getRelevantEvents(eventStore, instanceId);\n var eventConfigBase = fromApi ?\n { '': {\n startEditable: true,\n durationEditable: true,\n constraints: [],\n overlap: null,\n allows: [],\n backgroundColor: '',\n borderColor: '',\n textColor: '',\n classNames: []\n } } :\n calendar.eventUiBases;\n relevant = applyMutationToEventStore(relevant, eventConfigBase, mutation, calendar);\n return mergeEventStores(eventStore, relevant);\n }\n function excludeEventsBySourceId(eventStore, sourceId) {\n return filterEventStoreDefs(eventStore, function (eventDef) {\n return eventDef.sourceId !== sourceId;\n });\n }\n // QUESTION: why not just return instances? do a general object-property-exclusion util\n function excludeInstances(eventStore, removals) {\n return {\n defs: eventStore.defs,\n instances: filterHash(eventStore.instances, function (instance) {\n return !removals[instance.instanceId];\n })\n };\n }\n\n // high-level segmenting-aware tester functions\n // ------------------------------------------------------------------------------------------------------------------------\n function isInteractionValid(interaction, calendar) {\n return isNewPropsValid({ eventDrag: interaction }, calendar); // HACK: the eventDrag props is used for ALL interactions\n }\n function isDateSelectionValid(dateSelection, calendar) {\n return isNewPropsValid({ dateSelection: dateSelection }, calendar);\n }\n function isNewPropsValid(newProps, calendar) {\n var view = calendar.view;\n var props = __assign({ businessHours: view ? view.props.businessHours : createEmptyEventStore(), dateSelection: '', eventStore: calendar.state.eventStore, eventUiBases: calendar.eventUiBases, eventSelection: '', eventDrag: null, eventResize: null }, newProps);\n return (calendar.pluginSystem.hooks.isPropsValid || isPropsValid)(props, calendar);\n }\n function isPropsValid(state, calendar, dateSpanMeta, filterConfig) {\n if (dateSpanMeta === void 0) { dateSpanMeta = {}; }\n if (state.eventDrag && !isInteractionPropsValid(state, calendar, dateSpanMeta, filterConfig)) {\n return false;\n }\n if (state.dateSelection && !isDateSelectionPropsValid(state, calendar, dateSpanMeta, filterConfig)) {\n return false;\n }\n return true;\n }\n // Moving Event Validation\n // ------------------------------------------------------------------------------------------------------------------------\n function isInteractionPropsValid(state, calendar, dateSpanMeta, filterConfig) {\n var interaction = state.eventDrag; // HACK: the eventDrag props is used for ALL interactions\n var subjectEventStore = interaction.mutatedEvents;\n var subjectDefs = subjectEventStore.defs;\n var subjectInstances = subjectEventStore.instances;\n var subjectConfigs = compileEventUis(subjectDefs, interaction.isEvent ?\n state.eventUiBases :\n { '': calendar.selectionConfig } // if not a real event, validate as a selection\n );\n if (filterConfig) {\n subjectConfigs = mapHash(subjectConfigs, filterConfig);\n }\n var otherEventStore = excludeInstances(state.eventStore, interaction.affectedEvents.instances); // exclude the subject events. TODO: exclude defs too?\n var otherDefs = otherEventStore.defs;\n var otherInstances = otherEventStore.instances;\n var otherConfigs = compileEventUis(otherDefs, state.eventUiBases);\n for (var subjectInstanceId in subjectInstances) {\n var subjectInstance = subjectInstances[subjectInstanceId];\n var subjectRange = subjectInstance.range;\n var subjectConfig = subjectConfigs[subjectInstance.defId];\n var subjectDef = subjectDefs[subjectInstance.defId];\n // constraint\n if (!allConstraintsPass(subjectConfig.constraints, subjectRange, otherEventStore, state.businessHours, calendar)) {\n return false;\n }\n // overlap\n var overlapFunc = calendar.opt('eventOverlap');\n if (typeof overlapFunc !== 'function') {\n overlapFunc = null;\n }\n for (var otherInstanceId in otherInstances) {\n var otherInstance = otherInstances[otherInstanceId];\n // intersect! evaluate\n if (rangesIntersect(subjectRange, otherInstance.range)) {\n var otherOverlap = otherConfigs[otherInstance.defId].overlap;\n // consider the other event's overlap. only do this if the subject event is a \"real\" event\n if (otherOverlap === false && interaction.isEvent) {\n return false;\n }\n if (subjectConfig.overlap === false) {\n return false;\n }\n if (overlapFunc && !overlapFunc(new EventApi(calendar, otherDefs[otherInstance.defId], otherInstance), // still event\n new EventApi(calendar, subjectDef, subjectInstance) // moving event\n )) {\n return false;\n }\n }\n }\n // allow (a function)\n var calendarEventStore = calendar.state.eventStore; // need global-to-calendar, not local to component (splittable)state\n for (var _i = 0, _a = subjectConfig.allows; _i < _a.length; _i++) {\n var subjectAllow = _a[_i];\n var subjectDateSpan = __assign({}, dateSpanMeta, { range: subjectInstance.range, allDay: subjectDef.allDay });\n var origDef = calendarEventStore.defs[subjectDef.defId];\n var origInstance = calendarEventStore.instances[subjectInstanceId];\n var eventApi = void 0;\n if (origDef) { // was previously in the calendar\n eventApi = new EventApi(calendar, origDef, origInstance);\n }\n else { // was an external event\n eventApi = new EventApi(calendar, subjectDef); // no instance, because had no dates\n }\n if (!subjectAllow(calendar.buildDateSpanApi(subjectDateSpan), eventApi)) {\n return false;\n }\n }\n }\n return true;\n }\n // Date Selection Validation\n // ------------------------------------------------------------------------------------------------------------------------\n function isDateSelectionPropsValid(state, calendar, dateSpanMeta, filterConfig) {\n var relevantEventStore = state.eventStore;\n var relevantDefs = relevantEventStore.defs;\n var relevantInstances = relevantEventStore.instances;\n var selection = state.dateSelection;\n var selectionRange = selection.range;\n var selectionConfig = calendar.selectionConfig;\n if (filterConfig) {\n selectionConfig = filterConfig(selectionConfig);\n }\n // constraint\n if (!allConstraintsPass(selectionConfig.constraints, selectionRange, relevantEventStore, state.businessHours, calendar)) {\n return false;\n }\n // overlap\n var overlapFunc = calendar.opt('selectOverlap');\n if (typeof overlapFunc !== 'function') {\n overlapFunc = null;\n }\n for (var relevantInstanceId in relevantInstances) {\n var relevantInstance = relevantInstances[relevantInstanceId];\n // intersect! evaluate\n if (rangesIntersect(selectionRange, relevantInstance.range)) {\n if (selectionConfig.overlap === false) {\n return false;\n }\n if (overlapFunc && !overlapFunc(new EventApi(calendar, relevantDefs[relevantInstance.defId], relevantInstance))) {\n return false;\n }\n }\n }\n // allow (a function)\n for (var _i = 0, _a = selectionConfig.allows; _i < _a.length; _i++) {\n var selectionAllow = _a[_i];\n var fullDateSpan = __assign({}, dateSpanMeta, selection);\n if (!selectionAllow(calendar.buildDateSpanApi(fullDateSpan), null)) {\n return false;\n }\n }\n return true;\n }\n // Constraint Utils\n // ------------------------------------------------------------------------------------------------------------------------\n function allConstraintsPass(constraints, subjectRange, otherEventStore, businessHoursUnexpanded, calendar) {\n for (var _i = 0, constraints_1 = constraints; _i < constraints_1.length; _i++) {\n var constraint = constraints_1[_i];\n if (!anyRangesContainRange(constraintToRanges(constraint, subjectRange, otherEventStore, businessHoursUnexpanded, calendar), subjectRange)) {\n return false;\n }\n }\n return true;\n }\n function constraintToRanges(constraint, subjectRange, // for expanding a recurring constraint, or expanding business hours\n otherEventStore, // for if constraint is an even group ID\n businessHoursUnexpanded, // for if constraint is 'businessHours'\n calendar // for expanding businesshours\n ) {\n if (constraint === 'businessHours') {\n return eventStoreToRanges(expandRecurring(businessHoursUnexpanded, subjectRange, calendar));\n }\n else if (typeof constraint === 'string') { // an group ID\n return eventStoreToRanges(filterEventStoreDefs(otherEventStore, function (eventDef) {\n return eventDef.groupId === constraint;\n }));\n }\n else if (typeof constraint === 'object' && constraint) { // non-null object\n return eventStoreToRanges(expandRecurring(constraint, subjectRange, calendar));\n }\n return []; // if it's false\n }\n // TODO: move to event-store file?\n function eventStoreToRanges(eventStore) {\n var instances = eventStore.instances;\n var ranges = [];\n for (var instanceId in instances) {\n ranges.push(instances[instanceId].range);\n }\n return ranges;\n }\n // TODO: move to geom file?\n function anyRangesContainRange(outerRanges, innerRange) {\n for (var _i = 0, outerRanges_1 = outerRanges; _i < outerRanges_1.length; _i++) {\n var outerRange = outerRanges_1[_i];\n if (rangeContainsRange(outerRange, innerRange)) {\n return true;\n }\n }\n return false;\n }\n // Parsing\n // ------------------------------------------------------------------------------------------------------------------------\n function normalizeConstraint(input, calendar) {\n if (Array.isArray(input)) {\n return parseEvents(input, '', calendar, true); // allowOpenRange=true\n }\n else if (typeof input === 'object' && input) { // non-null object\n return parseEvents([input], '', calendar, true); // allowOpenRange=true\n }\n else if (input != null) {\n return String(input);\n }\n else {\n return null;\n }\n }\n\n function htmlEscape(s) {\n return (s + '').replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/'/g, ''')\n .replace(/\"/g, '"')\n .replace(/\\n/g, '
');\n }\n // Given a hash of CSS properties, returns a string of CSS.\n // Uses property names as-is (no camel-case conversion). Will not make statements for null/undefined values.\n function cssToStr(cssProps) {\n var statements = [];\n for (var name_1 in cssProps) {\n var val = cssProps[name_1];\n if (val != null && val !== '') {\n statements.push(name_1 + ':' + val);\n }\n }\n return statements.join(';');\n }\n // Given an object hash of HTML attribute names to values,\n // generates a string that can be injected between < > in HTML\n function attrsToStr(attrs) {\n var parts = [];\n for (var name_2 in attrs) {\n var val = attrs[name_2];\n if (val != null) {\n parts.push(name_2 + '=\"' + htmlEscape(val) + '\"');\n }\n }\n return parts.join(' ');\n }\n function parseClassName(raw) {\n if (Array.isArray(raw)) {\n return raw;\n }\n else if (typeof raw === 'string') {\n return raw.split(/\\s+/);\n }\n else {\n return [];\n }\n }\n\n var UNSCOPED_EVENT_UI_PROPS = {\n editable: Boolean,\n startEditable: Boolean,\n durationEditable: Boolean,\n constraint: null,\n overlap: null,\n allow: null,\n className: parseClassName,\n classNames: parseClassName,\n color: String,\n backgroundColor: String,\n borderColor: String,\n textColor: String\n };\n function processUnscopedUiProps(rawProps, calendar, leftovers) {\n var props = refineProps(rawProps, UNSCOPED_EVENT_UI_PROPS, {}, leftovers);\n var constraint = normalizeConstraint(props.constraint, calendar);\n return {\n startEditable: props.startEditable != null ? props.startEditable : props.editable,\n durationEditable: props.durationEditable != null ? props.durationEditable : props.editable,\n constraints: constraint != null ? [constraint] : [],\n overlap: props.overlap,\n allows: props.allow != null ? [props.allow] : [],\n backgroundColor: props.backgroundColor || props.color,\n borderColor: props.borderColor || props.color,\n textColor: props.textColor,\n classNames: props.classNames.concat(props.className)\n };\n }\n function processScopedUiProps(prefix, rawScoped, calendar, leftovers) {\n var rawUnscoped = {};\n var wasFound = {};\n for (var key in UNSCOPED_EVENT_UI_PROPS) {\n var scopedKey = prefix + capitaliseFirstLetter(key);\n rawUnscoped[key] = rawScoped[scopedKey];\n wasFound[scopedKey] = true;\n }\n if (prefix === 'event') {\n rawUnscoped.editable = rawScoped.editable; // special case. there is no 'eventEditable', just 'editable'\n }\n if (leftovers) {\n for (var key in rawScoped) {\n if (!wasFound[key]) {\n leftovers[key] = rawScoped[key];\n }\n }\n }\n return processUnscopedUiProps(rawUnscoped, calendar);\n }\n var EMPTY_EVENT_UI = {\n startEditable: null,\n durationEditable: null,\n constraints: [],\n overlap: null,\n allows: [],\n backgroundColor: '',\n borderColor: '',\n textColor: '',\n classNames: []\n };\n // prevent against problems with <2 args!\n function combineEventUis(uis) {\n return uis.reduce(combineTwoEventUis, EMPTY_EVENT_UI);\n }\n function combineTwoEventUis(item0, item1) {\n return {\n startEditable: item1.startEditable != null ? item1.startEditable : item0.startEditable,\n durationEditable: item1.durationEditable != null ? item1.durationEditable : item0.durationEditable,\n constraints: item0.constraints.concat(item1.constraints),\n overlap: typeof item1.overlap === 'boolean' ? item1.overlap : item0.overlap,\n allows: item0.allows.concat(item1.allows),\n backgroundColor: item1.backgroundColor || item0.backgroundColor,\n borderColor: item1.borderColor || item0.borderColor,\n textColor: item1.textColor || item0.textColor,\n classNames: item0.classNames.concat(item1.classNames)\n };\n }\n\n var NON_DATE_PROPS = {\n id: String,\n groupId: String,\n title: String,\n url: String,\n rendering: String,\n extendedProps: null\n };\n var DATE_PROPS = {\n start: null,\n date: null,\n end: null,\n allDay: null\n };\n var uid = 0;\n function parseEvent(raw, sourceId, calendar, allowOpenRange) {\n var allDayDefault = computeIsAllDayDefault(sourceId, calendar);\n var leftovers0 = {};\n var recurringRes = parseRecurring(raw, // raw, but with single-event stuff stripped out\n allDayDefault, calendar.dateEnv, calendar.pluginSystem.hooks.recurringTypes, leftovers0 // will populate with non-recurring props\n );\n if (recurringRes) {\n var def = parseEventDef(leftovers0, sourceId, recurringRes.allDay, Boolean(recurringRes.duration), calendar);\n def.recurringDef = {\n typeId: recurringRes.typeId,\n typeData: recurringRes.typeData,\n duration: recurringRes.duration\n };\n return { def: def, instance: null };\n }\n else {\n var leftovers1 = {};\n var singleRes = parseSingle(raw, allDayDefault, calendar, leftovers1, allowOpenRange);\n if (singleRes) {\n var def = parseEventDef(leftovers1, sourceId, singleRes.allDay, singleRes.hasEnd, calendar);\n var instance = createEventInstance(def.defId, singleRes.range, singleRes.forcedStartTzo, singleRes.forcedEndTzo);\n return { def: def, instance: instance };\n }\n }\n return null;\n }\n /*\n Will NOT populate extendedProps with the leftover properties.\n Will NOT populate date-related props.\n The EventNonDateInput has been normalized (id => publicId, etc).\n */\n function parseEventDef(raw, sourceId, allDay, hasEnd, calendar) {\n var leftovers = {};\n var def = pluckNonDateProps(raw, calendar, leftovers);\n def.defId = String(uid++);\n def.sourceId = sourceId;\n def.allDay = allDay;\n def.hasEnd = hasEnd;\n for (var _i = 0, _a = calendar.pluginSystem.hooks.eventDefParsers; _i < _a.length; _i++) {\n var eventDefParser = _a[_i];\n var newLeftovers = {};\n eventDefParser(def, leftovers, newLeftovers);\n leftovers = newLeftovers;\n }\n def.extendedProps = __assign(leftovers, def.extendedProps || {});\n // help out EventApi from having user modify props\n Object.freeze(def.ui.classNames);\n Object.freeze(def.extendedProps);\n return def;\n }\n function createEventInstance(defId, range, forcedStartTzo, forcedEndTzo) {\n return {\n instanceId: String(uid++),\n defId: defId,\n range: range,\n forcedStartTzo: forcedStartTzo == null ? null : forcedStartTzo,\n forcedEndTzo: forcedEndTzo == null ? null : forcedEndTzo\n };\n }\n function parseSingle(raw, allDayDefault, calendar, leftovers, allowOpenRange) {\n var props = pluckDateProps(raw, leftovers);\n var allDay = props.allDay;\n var startMeta;\n var startMarker = null;\n var hasEnd = false;\n var endMeta;\n var endMarker = null;\n startMeta = calendar.dateEnv.createMarkerMeta(props.start);\n if (startMeta) {\n startMarker = startMeta.marker;\n }\n else if (!allowOpenRange) {\n return null;\n }\n if (props.end != null) {\n endMeta = calendar.dateEnv.createMarkerMeta(props.end);\n }\n if (allDay == null) {\n if (allDayDefault != null) {\n allDay = allDayDefault;\n }\n else {\n // fall back to the date props LAST\n allDay = (!startMeta || startMeta.isTimeUnspecified) &&\n (!endMeta || endMeta.isTimeUnspecified);\n }\n }\n if (allDay && startMarker) {\n startMarker = startOfDay(startMarker);\n }\n if (endMeta) {\n endMarker = endMeta.marker;\n if (allDay) {\n endMarker = startOfDay(endMarker);\n }\n if (startMarker && endMarker <= startMarker) {\n endMarker = null;\n }\n }\n if (endMarker) {\n hasEnd = true;\n }\n else if (!allowOpenRange) {\n hasEnd = calendar.opt('forceEventDuration') || false;\n endMarker = calendar.dateEnv.add(startMarker, allDay ?\n calendar.defaultAllDayEventDuration :\n calendar.defaultTimedEventDuration);\n }\n return {\n allDay: allDay,\n hasEnd: hasEnd,\n range: { start: startMarker, end: endMarker },\n forcedStartTzo: startMeta ? startMeta.forcedTzo : null,\n forcedEndTzo: endMeta ? endMeta.forcedTzo : null\n };\n }\n function pluckDateProps(raw, leftovers) {\n var props = refineProps(raw, DATE_PROPS, {}, leftovers);\n props.start = (props.start !== null) ? props.start : props.date;\n delete props.date;\n return props;\n }\n function pluckNonDateProps(raw, calendar, leftovers) {\n var preLeftovers = {};\n var props = refineProps(raw, NON_DATE_PROPS, {}, preLeftovers);\n var ui = processUnscopedUiProps(preLeftovers, calendar, leftovers);\n props.publicId = props.id;\n delete props.id;\n props.ui = ui;\n return props;\n }\n function computeIsAllDayDefault(sourceId, calendar) {\n var res = null;\n if (sourceId) {\n var source = calendar.state.eventSources[sourceId];\n res = source.allDayDefault;\n }\n if (res == null) {\n res = calendar.opt('allDayDefault');\n }\n return res;\n }\n\n var DEF_DEFAULTS = {\n startTime: '09:00',\n endTime: '17:00',\n daysOfWeek: [1, 2, 3, 4, 5],\n rendering: 'inverse-background',\n classNames: 'fc-nonbusiness',\n groupId: '_businessHours' // so multiple defs get grouped\n };\n /*\n TODO: pass around as EventDefHash!!!\n */\n function parseBusinessHours(input, calendar) {\n return parseEvents(refineInputs(input), '', calendar);\n }\n function refineInputs(input) {\n var rawDefs;\n if (input === true) {\n rawDefs = [{}]; // will get DEF_DEFAULTS verbatim\n }\n else if (Array.isArray(input)) {\n // if specifying an array, every sub-definition NEEDS a day-of-week\n rawDefs = input.filter(function (rawDef) {\n return rawDef.daysOfWeek;\n });\n }\n else if (typeof input === 'object' && input) { // non-null object\n rawDefs = [input];\n }\n else { // is probably false\n rawDefs = [];\n }\n rawDefs = rawDefs.map(function (rawDef) {\n return __assign({}, DEF_DEFAULTS, rawDef);\n });\n return rawDefs;\n }\n\n function memoizeRendering(renderFunc, unrenderFunc, dependencies) {\n if (dependencies === void 0) { dependencies = []; }\n var dependents = [];\n var thisContext;\n var prevArgs;\n function unrender() {\n if (prevArgs) {\n for (var _i = 0, dependents_1 = dependents; _i < dependents_1.length; _i++) {\n var dependent = dependents_1[_i];\n dependent.unrender();\n }\n if (unrenderFunc) {\n unrenderFunc.apply(thisContext, prevArgs);\n }\n prevArgs = null;\n }\n }\n function res() {\n if (!prevArgs || !isArraysEqual(prevArgs, arguments)) {\n unrender();\n thisContext = this;\n prevArgs = arguments;\n renderFunc.apply(this, arguments);\n }\n }\n res.dependents = dependents;\n res.unrender = unrender;\n for (var _i = 0, dependencies_1 = dependencies; _i < dependencies_1.length; _i++) {\n var dependency = dependencies_1[_i];\n dependency.dependents.push(res);\n }\n return res;\n }\n\n var EMPTY_EVENT_STORE = createEmptyEventStore(); // for purecomponents. TODO: keep elsewhere\n var Splitter = /** @class */ (function () {\n function Splitter() {\n this.getKeysForEventDefs = memoize(this._getKeysForEventDefs);\n this.splitDateSelection = memoize(this._splitDateSpan);\n this.splitEventStore = memoize(this._splitEventStore);\n this.splitIndividualUi = memoize(this._splitIndividualUi);\n this.splitEventDrag = memoize(this._splitInteraction);\n this.splitEventResize = memoize(this._splitInteraction);\n this.eventUiBuilders = {}; // TODO: typescript protection\n }\n Splitter.prototype.splitProps = function (props) {\n var _this = this;\n var keyInfos = this.getKeyInfo(props);\n var defKeys = this.getKeysForEventDefs(props.eventStore);\n var dateSelections = this.splitDateSelection(props.dateSelection);\n var individualUi = this.splitIndividualUi(props.eventUiBases, defKeys); // the individual *bases*\n var eventStores = this.splitEventStore(props.eventStore, defKeys);\n var eventDrags = this.splitEventDrag(props.eventDrag);\n var eventResizes = this.splitEventResize(props.eventResize);\n var splitProps = {};\n this.eventUiBuilders = mapHash(keyInfos, function (info, key) {\n return _this.eventUiBuilders[key] || memoize(buildEventUiForKey);\n });\n for (var key in keyInfos) {\n var keyInfo = keyInfos[key];\n var eventStore = eventStores[key] || EMPTY_EVENT_STORE;\n var buildEventUi = this.eventUiBuilders[key];\n splitProps[key] = {\n businessHours: keyInfo.businessHours || props.businessHours,\n dateSelection: dateSelections[key] || null,\n eventStore: eventStore,\n eventUiBases: buildEventUi(props.eventUiBases[''], keyInfo.ui, individualUi[key]),\n eventSelection: eventStore.instances[props.eventSelection] ? props.eventSelection : '',\n eventDrag: eventDrags[key] || null,\n eventResize: eventResizes[key] || null\n };\n }\n return splitProps;\n };\n Splitter.prototype._splitDateSpan = function (dateSpan) {\n var dateSpans = {};\n if (dateSpan) {\n var keys = this.getKeysForDateSpan(dateSpan);\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n dateSpans[key] = dateSpan;\n }\n }\n return dateSpans;\n };\n Splitter.prototype._getKeysForEventDefs = function (eventStore) {\n var _this = this;\n return mapHash(eventStore.defs, function (eventDef) {\n return _this.getKeysForEventDef(eventDef);\n });\n };\n Splitter.prototype._splitEventStore = function (eventStore, defKeys) {\n var defs = eventStore.defs, instances = eventStore.instances;\n var splitStores = {};\n for (var defId in defs) {\n for (var _i = 0, _a = defKeys[defId]; _i < _a.length; _i++) {\n var key = _a[_i];\n if (!splitStores[key]) {\n splitStores[key] = createEmptyEventStore();\n }\n splitStores[key].defs[defId] = defs[defId];\n }\n }\n for (var instanceId in instances) {\n var instance = instances[instanceId];\n for (var _b = 0, _c = defKeys[instance.defId]; _b < _c.length; _b++) {\n var key = _c[_b];\n if (splitStores[key]) { // must have already been created\n splitStores[key].instances[instanceId] = instance;\n }\n }\n }\n return splitStores;\n };\n Splitter.prototype._splitIndividualUi = function (eventUiBases, defKeys) {\n var splitHashes = {};\n for (var defId in eventUiBases) {\n if (defId) { // not the '' key\n for (var _i = 0, _a = defKeys[defId]; _i < _a.length; _i++) {\n var key = _a[_i];\n if (!splitHashes[key]) {\n splitHashes[key] = {};\n }\n splitHashes[key][defId] = eventUiBases[defId];\n }\n }\n }\n return splitHashes;\n };\n Splitter.prototype._splitInteraction = function (interaction) {\n var splitStates = {};\n if (interaction) {\n var affectedStores_1 = this._splitEventStore(interaction.affectedEvents, this._getKeysForEventDefs(interaction.affectedEvents) // can't use cached. might be events from other calendar\n );\n // can't rely on defKeys because event data is mutated\n var mutatedKeysByDefId = this._getKeysForEventDefs(interaction.mutatedEvents);\n var mutatedStores_1 = this._splitEventStore(interaction.mutatedEvents, mutatedKeysByDefId);\n var populate = function (key) {\n if (!splitStates[key]) {\n splitStates[key] = {\n affectedEvents: affectedStores_1[key] || EMPTY_EVENT_STORE,\n mutatedEvents: mutatedStores_1[key] || EMPTY_EVENT_STORE,\n isEvent: interaction.isEvent,\n origSeg: interaction.origSeg\n };\n }\n };\n for (var key in affectedStores_1) {\n populate(key);\n }\n for (var key in mutatedStores_1) {\n populate(key);\n }\n }\n return splitStates;\n };\n return Splitter;\n }());\n function buildEventUiForKey(allUi, eventUiForKey, individualUi) {\n var baseParts = [];\n if (allUi) {\n baseParts.push(allUi);\n }\n if (eventUiForKey) {\n baseParts.push(eventUiForKey);\n }\n var stuff = {\n '': combineEventUis(baseParts)\n };\n if (individualUi) {\n __assign(stuff, individualUi);\n }\n return stuff;\n }\n\n // Generates HTML for an anchor to another view into the calendar.\n // Will either generate an tag or a non-clickable tag, depending on enabled settings.\n // `gotoOptions` can either be a DateMarker, or an object with the form:\n // { date, type, forceOff }\n // `type` is a view-type like \"day\" or \"week\". default value is \"day\".\n // `attrs` and `innerHtml` are use to generate the rest of the HTML tag.\n function buildGotoAnchorHtml(allOptions, dateEnv, gotoOptions, attrs, innerHtml) {\n var date;\n var type;\n var forceOff;\n var finalOptions;\n if (gotoOptions instanceof Date) {\n date = gotoOptions; // a single date-like input\n }\n else {\n date = gotoOptions.date;\n type = gotoOptions.type;\n forceOff = gotoOptions.forceOff;\n }\n finalOptions = {\n date: dateEnv.formatIso(date, { omitTime: true }),\n type: type || 'day'\n };\n if (typeof attrs === 'string') {\n innerHtml = attrs;\n attrs = null;\n }\n attrs = attrs ? ' ' + attrsToStr(attrs) : ''; // will have a leading space\n innerHtml = innerHtml || '';\n if (!forceOff && allOptions.navLinks) {\n return '' +\n innerHtml +\n '';\n }\n else {\n return '' +\n innerHtml +\n '';\n }\n }\n function getAllDayHtml(allOptions) {\n return allOptions.allDayHtml || htmlEscape(allOptions.allDayText);\n }\n // Computes HTML classNames for a single-day element\n function getDayClasses(date, dateProfile, context, noThemeHighlight) {\n var calendar = context.calendar, options = context.options, theme = context.theme, dateEnv = context.dateEnv;\n var classes = [];\n var todayStart;\n var todayEnd;\n if (!rangeContainsMarker(dateProfile.activeRange, date)) {\n classes.push('fc-disabled-day');\n }\n else {\n classes.push('fc-' + DAY_IDS[date.getUTCDay()]);\n if (options.monthMode &&\n dateEnv.getMonth(date) !== dateEnv.getMonth(dateProfile.currentRange.start)) {\n classes.push('fc-other-month');\n }\n todayStart = startOfDay(calendar.getNow());\n todayEnd = addDays(todayStart, 1);\n if (date < todayStart) {\n classes.push('fc-past');\n }\n else if (date >= todayEnd) {\n classes.push('fc-future');\n }\n else {\n classes.push('fc-today');\n if (noThemeHighlight !== true) {\n classes.push(theme.getClass('today'));\n }\n }\n }\n return classes;\n }\n\n // given a function that resolves a result asynchronously.\n // the function can either call passed-in success and failure callbacks,\n // or it can return a promise.\n // if you need to pass additional params to func, bind them first.\n function unpromisify(func, success, failure) {\n // guard against success/failure callbacks being called more than once\n // and guard against a promise AND callback being used together.\n var isResolved = false;\n var wrappedSuccess = function () {\n if (!isResolved) {\n isResolved = true;\n success.apply(this, arguments);\n }\n };\n var wrappedFailure = function () {\n if (!isResolved) {\n isResolved = true;\n if (failure) {\n failure.apply(this, arguments);\n }\n }\n };\n var res = func(wrappedSuccess, wrappedFailure);\n if (res && typeof res.then === 'function') {\n res.then(wrappedSuccess, wrappedFailure);\n }\n }\n\n var Mixin = /** @class */ (function () {\n function Mixin() {\n }\n // mix into a CLASS\n Mixin.mixInto = function (destClass) {\n this.mixIntoObj(destClass.prototype);\n };\n // mix into ANY object\n Mixin.mixIntoObj = function (destObj) {\n var _this = this;\n Object.getOwnPropertyNames(this.prototype).forEach(function (name) {\n if (!destObj[name]) { // if destination doesn't already define it\n destObj[name] = _this.prototype[name];\n }\n });\n };\n /*\n will override existing methods\n TODO: remove! not used anymore\n */\n Mixin.mixOver = function (destClass) {\n var _this = this;\n Object.getOwnPropertyNames(this.prototype).forEach(function (name) {\n destClass.prototype[name] = _this.prototype[name];\n });\n };\n return Mixin;\n }());\n\n /*\n USAGE:\n import { default as EmitterMixin, EmitterInterface } from './EmitterMixin'\n in class:\n on: EmitterInterface['on']\n one: EmitterInterface['one']\n off: EmitterInterface['off']\n trigger: EmitterInterface['trigger']\n triggerWith: EmitterInterface['triggerWith']\n hasHandlers: EmitterInterface['hasHandlers']\n after class:\n EmitterMixin.mixInto(TheClass)\n */\n var EmitterMixin = /** @class */ (function (_super) {\n __extends(EmitterMixin, _super);\n function EmitterMixin() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n EmitterMixin.prototype.on = function (type, handler) {\n addToHash(this._handlers || (this._handlers = {}), type, handler);\n return this; // for chaining\n };\n // todo: add comments\n EmitterMixin.prototype.one = function (type, handler) {\n addToHash(this._oneHandlers || (this._oneHandlers = {}), type, handler);\n return this; // for chaining\n };\n EmitterMixin.prototype.off = function (type, handler) {\n if (this._handlers) {\n removeFromHash(this._handlers, type, handler);\n }\n if (this._oneHandlers) {\n removeFromHash(this._oneHandlers, type, handler);\n }\n return this; // for chaining\n };\n EmitterMixin.prototype.trigger = function (type) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n this.triggerWith(type, this, args);\n return this; // for chaining\n };\n EmitterMixin.prototype.triggerWith = function (type, context, args) {\n if (this._handlers) {\n applyAll(this._handlers[type], context, args);\n }\n if (this._oneHandlers) {\n applyAll(this._oneHandlers[type], context, args);\n delete this._oneHandlers[type]; // will never fire again\n }\n return this; // for chaining\n };\n EmitterMixin.prototype.hasHandlers = function (type) {\n return (this._handlers && this._handlers[type] && this._handlers[type].length) ||\n (this._oneHandlers && this._oneHandlers[type] && this._oneHandlers[type].length);\n };\n return EmitterMixin;\n }(Mixin));\n function addToHash(hash, type, handler) {\n (hash[type] || (hash[type] = []))\n .push(handler);\n }\n function removeFromHash(hash, type, handler) {\n if (handler) {\n if (hash[type]) {\n hash[type] = hash[type].filter(function (func) {\n return func !== handler;\n });\n }\n }\n else {\n delete hash[type]; // remove all handler funcs for this type\n }\n }\n\n /*\n Records offset information for a set of elements, relative to an origin element.\n Can record the left/right OR the top/bottom OR both.\n Provides methods for querying the cache by position.\n */\n var PositionCache = /** @class */ (function () {\n function PositionCache(originEl, els, isHorizontal, isVertical) {\n this.originEl = originEl;\n this.els = els;\n this.isHorizontal = isHorizontal;\n this.isVertical = isVertical;\n }\n // Queries the els for coordinates and stores them.\n // Call this method before using and of the get* methods below.\n PositionCache.prototype.build = function () {\n var originEl = this.originEl;\n var originClientRect = this.originClientRect =\n originEl.getBoundingClientRect(); // relative to viewport top-left\n if (this.isHorizontal) {\n this.buildElHorizontals(originClientRect.left);\n }\n if (this.isVertical) {\n this.buildElVerticals(originClientRect.top);\n }\n };\n // Populates the left/right internal coordinate arrays\n PositionCache.prototype.buildElHorizontals = function (originClientLeft) {\n var lefts = [];\n var rights = [];\n for (var _i = 0, _a = this.els; _i < _a.length; _i++) {\n var el = _a[_i];\n var rect = el.getBoundingClientRect();\n lefts.push(rect.left - originClientLeft);\n rights.push(rect.right - originClientLeft);\n }\n this.lefts = lefts;\n this.rights = rights;\n };\n // Populates the top/bottom internal coordinate arrays\n PositionCache.prototype.buildElVerticals = function (originClientTop) {\n var tops = [];\n var bottoms = [];\n for (var _i = 0, _a = this.els; _i < _a.length; _i++) {\n var el = _a[_i];\n var rect = el.getBoundingClientRect();\n tops.push(rect.top - originClientTop);\n bottoms.push(rect.bottom - originClientTop);\n }\n this.tops = tops;\n this.bottoms = bottoms;\n };\n // Given a left offset (from document left), returns the index of the el that it horizontally intersects.\n // If no intersection is made, returns undefined.\n PositionCache.prototype.leftToIndex = function (leftPosition) {\n var lefts = this.lefts;\n var rights = this.rights;\n var len = lefts.length;\n var i;\n for (i = 0; i < len; i++) {\n if (leftPosition >= lefts[i] && leftPosition < rights[i]) {\n return i;\n }\n }\n };\n // Given a top offset (from document top), returns the index of the el that it vertically intersects.\n // If no intersection is made, returns undefined.\n PositionCache.prototype.topToIndex = function (topPosition) {\n var tops = this.tops;\n var bottoms = this.bottoms;\n var len = tops.length;\n var i;\n for (i = 0; i < len; i++) {\n if (topPosition >= tops[i] && topPosition < bottoms[i]) {\n return i;\n }\n }\n };\n // Gets the width of the element at the given index\n PositionCache.prototype.getWidth = function (leftIndex) {\n return this.rights[leftIndex] - this.lefts[leftIndex];\n };\n // Gets the height of the element at the given index\n PositionCache.prototype.getHeight = function (topIndex) {\n return this.bottoms[topIndex] - this.tops[topIndex];\n };\n return PositionCache;\n }());\n\n /*\n An object for getting/setting scroll-related information for an element.\n Internally, this is done very differently for window versus DOM element,\n so this object serves as a common interface.\n */\n var ScrollController = /** @class */ (function () {\n function ScrollController() {\n }\n ScrollController.prototype.getMaxScrollTop = function () {\n return this.getScrollHeight() - this.getClientHeight();\n };\n ScrollController.prototype.getMaxScrollLeft = function () {\n return this.getScrollWidth() - this.getClientWidth();\n };\n ScrollController.prototype.canScrollVertically = function () {\n return this.getMaxScrollTop() > 0;\n };\n ScrollController.prototype.canScrollHorizontally = function () {\n return this.getMaxScrollLeft() > 0;\n };\n ScrollController.prototype.canScrollUp = function () {\n return this.getScrollTop() > 0;\n };\n ScrollController.prototype.canScrollDown = function () {\n return this.getScrollTop() < this.getMaxScrollTop();\n };\n ScrollController.prototype.canScrollLeft = function () {\n return this.getScrollLeft() > 0;\n };\n ScrollController.prototype.canScrollRight = function () {\n return this.getScrollLeft() < this.getMaxScrollLeft();\n };\n return ScrollController;\n }());\n var ElementScrollController = /** @class */ (function (_super) {\n __extends(ElementScrollController, _super);\n function ElementScrollController(el) {\n var _this = _super.call(this) || this;\n _this.el = el;\n return _this;\n }\n ElementScrollController.prototype.getScrollTop = function () {\n return this.el.scrollTop;\n };\n ElementScrollController.prototype.getScrollLeft = function () {\n return this.el.scrollLeft;\n };\n ElementScrollController.prototype.setScrollTop = function (top) {\n this.el.scrollTop = top;\n };\n ElementScrollController.prototype.setScrollLeft = function (left) {\n this.el.scrollLeft = left;\n };\n ElementScrollController.prototype.getScrollWidth = function () {\n return this.el.scrollWidth;\n };\n ElementScrollController.prototype.getScrollHeight = function () {\n return this.el.scrollHeight;\n };\n ElementScrollController.prototype.getClientHeight = function () {\n return this.el.clientHeight;\n };\n ElementScrollController.prototype.getClientWidth = function () {\n return this.el.clientWidth;\n };\n return ElementScrollController;\n }(ScrollController));\n var WindowScrollController = /** @class */ (function (_super) {\n __extends(WindowScrollController, _super);\n function WindowScrollController() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n WindowScrollController.prototype.getScrollTop = function () {\n return window.pageYOffset;\n };\n WindowScrollController.prototype.getScrollLeft = function () {\n return window.pageXOffset;\n };\n WindowScrollController.prototype.setScrollTop = function (n) {\n window.scroll(window.pageXOffset, n);\n };\n WindowScrollController.prototype.setScrollLeft = function (n) {\n window.scroll(n, window.pageYOffset);\n };\n WindowScrollController.prototype.getScrollWidth = function () {\n return document.documentElement.scrollWidth;\n };\n WindowScrollController.prototype.getScrollHeight = function () {\n return document.documentElement.scrollHeight;\n };\n WindowScrollController.prototype.getClientHeight = function () {\n return document.documentElement.clientHeight;\n };\n WindowScrollController.prototype.getClientWidth = function () {\n return document.documentElement.clientWidth;\n };\n return WindowScrollController;\n }(ScrollController));\n\n /*\n Embodies a div that has potential scrollbars\n */\n var ScrollComponent = /** @class */ (function (_super) {\n __extends(ScrollComponent, _super);\n function ScrollComponent(overflowX, overflowY) {\n var _this = _super.call(this, createElement('div', {\n className: 'fc-scroller'\n })) || this;\n _this.overflowX = overflowX;\n _this.overflowY = overflowY;\n _this.applyOverflow();\n return _this;\n }\n // sets to natural height, unlocks overflow\n ScrollComponent.prototype.clear = function () {\n this.setHeight('auto');\n this.applyOverflow();\n };\n ScrollComponent.prototype.destroy = function () {\n removeElement(this.el);\n };\n // Overflow\n // -----------------------------------------------------------------------------------------------------------------\n ScrollComponent.prototype.applyOverflow = function () {\n applyStyle(this.el, {\n overflowX: this.overflowX,\n overflowY: this.overflowY\n });\n };\n // Causes any 'auto' overflow values to resolves to 'scroll' or 'hidden'.\n // Useful for preserving scrollbar widths regardless of future resizes.\n // Can pass in scrollbarWidths for optimization.\n ScrollComponent.prototype.lockOverflow = function (scrollbarWidths) {\n var overflowX = this.overflowX;\n var overflowY = this.overflowY;\n scrollbarWidths = scrollbarWidths || this.getScrollbarWidths();\n if (overflowX === 'auto') {\n overflowX = (scrollbarWidths.bottom || // horizontal scrollbars?\n this.canScrollHorizontally() // OR scrolling pane with massless scrollbars?\n ) ? 'scroll' : 'hidden';\n }\n if (overflowY === 'auto') {\n overflowY = (scrollbarWidths.left || scrollbarWidths.right || // horizontal scrollbars?\n this.canScrollVertically() // OR scrolling pane with massless scrollbars?\n ) ? 'scroll' : 'hidden';\n }\n applyStyle(this.el, { overflowX: overflowX, overflowY: overflowY });\n };\n ScrollComponent.prototype.setHeight = function (height) {\n applyStyleProp(this.el, 'height', height);\n };\n ScrollComponent.prototype.getScrollbarWidths = function () {\n var edges = computeEdges(this.el);\n return {\n left: edges.scrollbarLeft,\n right: edges.scrollbarRight,\n bottom: edges.scrollbarBottom\n };\n };\n return ScrollComponent;\n }(ElementScrollController));\n\n var Theme = /** @class */ (function () {\n function Theme(calendarOptions) {\n this.calendarOptions = calendarOptions;\n this.processIconOverride();\n }\n Theme.prototype.processIconOverride = function () {\n if (this.iconOverrideOption) {\n this.setIconOverride(this.calendarOptions[this.iconOverrideOption]);\n }\n };\n Theme.prototype.setIconOverride = function (iconOverrideHash) {\n var iconClassesCopy;\n var buttonName;\n if (typeof iconOverrideHash === 'object' && iconOverrideHash) { // non-null object\n iconClassesCopy = __assign({}, this.iconClasses);\n for (buttonName in iconOverrideHash) {\n iconClassesCopy[buttonName] = this.applyIconOverridePrefix(iconOverrideHash[buttonName]);\n }\n this.iconClasses = iconClassesCopy;\n }\n else if (iconOverrideHash === false) {\n this.iconClasses = {};\n }\n };\n Theme.prototype.applyIconOverridePrefix = function (className) {\n var prefix = this.iconOverridePrefix;\n if (prefix && className.indexOf(prefix) !== 0) { // if not already present\n className = prefix + className;\n }\n return className;\n };\n Theme.prototype.getClass = function (key) {\n return this.classes[key] || '';\n };\n Theme.prototype.getIconClass = function (buttonName) {\n var className = this.iconClasses[buttonName];\n if (className) {\n return this.baseIconClass + ' ' + className;\n }\n return '';\n };\n Theme.prototype.getCustomButtonIconClass = function (customButtonProps) {\n var className;\n if (this.iconOverrideCustomButtonOption) {\n className = customButtonProps[this.iconOverrideCustomButtonOption];\n if (className) {\n return this.baseIconClass + ' ' + this.applyIconOverridePrefix(className);\n }\n }\n return '';\n };\n return Theme;\n }());\n Theme.prototype.classes = {};\n Theme.prototype.iconClasses = {};\n Theme.prototype.baseIconClass = '';\n Theme.prototype.iconOverridePrefix = '';\n\n var guid = 0;\n var ComponentContext = /** @class */ (function () {\n function ComponentContext(calendar, theme, dateEnv, options, view) {\n this.calendar = calendar;\n this.theme = theme;\n this.dateEnv = dateEnv;\n this.options = options;\n this.view = view;\n this.isRtl = options.dir === 'rtl';\n this.eventOrderSpecs = parseFieldSpecs(options.eventOrder);\n this.nextDayThreshold = createDuration(options.nextDayThreshold);\n }\n ComponentContext.prototype.extend = function (options, view) {\n return new ComponentContext(this.calendar, this.theme, this.dateEnv, options || this.options, view || this.view);\n };\n return ComponentContext;\n }());\n var Component = /** @class */ (function () {\n function Component() {\n this.everRendered = false;\n this.uid = String(guid++);\n }\n Component.addEqualityFuncs = function (newFuncs) {\n this.prototype.equalityFuncs = __assign({}, this.prototype.equalityFuncs, newFuncs);\n };\n Component.prototype.receiveProps = function (props, context) {\n this.receiveContext(context);\n var _a = recycleProps(this.props || {}, props, this.equalityFuncs), anyChanges = _a.anyChanges, comboProps = _a.comboProps;\n this.props = comboProps;\n if (anyChanges) {\n if (this.everRendered) {\n this.beforeUpdate();\n }\n this.render(comboProps, context);\n if (this.everRendered) {\n this.afterUpdate();\n }\n }\n this.everRendered = true;\n };\n Component.prototype.receiveContext = function (context) {\n var oldContext = this.context;\n this.context = context;\n if (!oldContext) {\n this.firstContext(context);\n }\n };\n Component.prototype.render = function (props, context) {\n };\n Component.prototype.firstContext = function (context) {\n };\n Component.prototype.beforeUpdate = function () {\n };\n Component.prototype.afterUpdate = function () {\n };\n // after destroy is called, this component won't ever be used again\n Component.prototype.destroy = function () {\n };\n return Component;\n }());\n Component.prototype.equalityFuncs = {};\n /*\n Reuses old values when equal. If anything is unequal, returns newProps as-is.\n Great for PureComponent, but won't be feasible with React, so just eliminate and use React's DOM diffing.\n */\n function recycleProps(oldProps, newProps, equalityFuncs) {\n var comboProps = {}; // some old, some new\n var anyChanges = false;\n for (var key in newProps) {\n if (key in oldProps && (oldProps[key] === newProps[key] ||\n (equalityFuncs[key] && equalityFuncs[key](oldProps[key], newProps[key])))) {\n // equal to old? use old prop\n comboProps[key] = oldProps[key];\n }\n else {\n comboProps[key] = newProps[key];\n anyChanges = true;\n }\n }\n for (var key in oldProps) {\n if (!(key in newProps)) {\n anyChanges = true;\n break;\n }\n }\n return { anyChanges: anyChanges, comboProps: comboProps };\n }\n\n /*\n PURPOSES:\n - hook up to fg, fill, and mirror renderers\n - interface for dragging and hits\n */\n var DateComponent = /** @class */ (function (_super) {\n __extends(DateComponent, _super);\n function DateComponent(el) {\n var _this = _super.call(this) || this;\n _this.el = el;\n return _this;\n }\n DateComponent.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n removeElement(this.el);\n };\n // Hit System\n // -----------------------------------------------------------------------------------------------------------------\n DateComponent.prototype.buildPositionCaches = function () {\n };\n DateComponent.prototype.queryHit = function (positionLeft, positionTop, elWidth, elHeight) {\n return null; // this should be abstract\n };\n // Validation\n // -----------------------------------------------------------------------------------------------------------------\n DateComponent.prototype.isInteractionValid = function (interaction) {\n var calendar = this.context.calendar;\n var dateProfile = this.props.dateProfile; // HACK\n var instances = interaction.mutatedEvents.instances;\n if (dateProfile) { // HACK for DayTile\n for (var instanceId in instances) {\n if (!rangeContainsRange(dateProfile.validRange, instances[instanceId].range)) {\n return false;\n }\n }\n }\n return isInteractionValid(interaction, calendar);\n };\n DateComponent.prototype.isDateSelectionValid = function (selection) {\n var calendar = this.context.calendar;\n var dateProfile = this.props.dateProfile; // HACK\n if (dateProfile && // HACK for DayTile\n !rangeContainsRange(dateProfile.validRange, selection.range)) {\n return false;\n }\n return isDateSelectionValid(selection, calendar);\n };\n // Pointer Interaction Utils\n // -----------------------------------------------------------------------------------------------------------------\n DateComponent.prototype.isValidSegDownEl = function (el) {\n return !this.props.eventDrag && // HACK\n !this.props.eventResize && // HACK\n !elementClosest(el, '.fc-mirror') &&\n (this.isPopover() || !this.isInPopover(el));\n // ^above line ensures we don't detect a seg interaction within a nested component.\n // it's a HACK because it only supports a popover as the nested component.\n };\n DateComponent.prototype.isValidDateDownEl = function (el) {\n var segEl = elementClosest(el, this.fgSegSelector);\n return (!segEl || segEl.classList.contains('fc-mirror')) &&\n !elementClosest(el, '.fc-more') && // a \"more..\" link\n !elementClosest(el, 'a[data-goto]') && // a clickable nav link\n !this.isInPopover(el);\n };\n DateComponent.prototype.isPopover = function () {\n return this.el.classList.contains('fc-popover');\n };\n DateComponent.prototype.isInPopover = function (el) {\n return Boolean(elementClosest(el, '.fc-popover'));\n };\n return DateComponent;\n }(Component));\n DateComponent.prototype.fgSegSelector = '.fc-event-container > *';\n DateComponent.prototype.bgSegSelector = '.fc-bgevent:not(.fc-nonbusiness)';\n\n var uid$1 = 0;\n function createPlugin(input) {\n return {\n id: String(uid$1++),\n deps: input.deps || [],\n reducers: input.reducers || [],\n eventDefParsers: input.eventDefParsers || [],\n isDraggableTransformers: input.isDraggableTransformers || [],\n eventDragMutationMassagers: input.eventDragMutationMassagers || [],\n eventDefMutationAppliers: input.eventDefMutationAppliers || [],\n dateSelectionTransformers: input.dateSelectionTransformers || [],\n datePointTransforms: input.datePointTransforms || [],\n dateSpanTransforms: input.dateSpanTransforms || [],\n views: input.views || {},\n viewPropsTransformers: input.viewPropsTransformers || [],\n isPropsValid: input.isPropsValid || null,\n externalDefTransforms: input.externalDefTransforms || [],\n eventResizeJoinTransforms: input.eventResizeJoinTransforms || [],\n viewContainerModifiers: input.viewContainerModifiers || [],\n eventDropTransformers: input.eventDropTransformers || [],\n componentInteractions: input.componentInteractions || [],\n calendarInteractions: input.calendarInteractions || [],\n themeClasses: input.themeClasses || {},\n eventSourceDefs: input.eventSourceDefs || [],\n cmdFormatter: input.cmdFormatter,\n recurringTypes: input.recurringTypes || [],\n namedTimeZonedImpl: input.namedTimeZonedImpl,\n defaultView: input.defaultView || '',\n elementDraggingImpl: input.elementDraggingImpl,\n optionChangeHandlers: input.optionChangeHandlers || {}\n };\n }\n var PluginSystem = /** @class */ (function () {\n function PluginSystem() {\n this.hooks = {\n reducers: [],\n eventDefParsers: [],\n isDraggableTransformers: [],\n eventDragMutationMassagers: [],\n eventDefMutationAppliers: [],\n dateSelectionTransformers: [],\n datePointTransforms: [],\n dateSpanTransforms: [],\n views: {},\n viewPropsTransformers: [],\n isPropsValid: null,\n externalDefTransforms: [],\n eventResizeJoinTransforms: [],\n viewContainerModifiers: [],\n eventDropTransformers: [],\n componentInteractions: [],\n calendarInteractions: [],\n themeClasses: {},\n eventSourceDefs: [],\n cmdFormatter: null,\n recurringTypes: [],\n namedTimeZonedImpl: null,\n defaultView: '',\n elementDraggingImpl: null,\n optionChangeHandlers: {}\n };\n this.addedHash = {};\n }\n PluginSystem.prototype.add = function (plugin) {\n if (!this.addedHash[plugin.id]) {\n this.addedHash[plugin.id] = true;\n for (var _i = 0, _a = plugin.deps; _i < _a.length; _i++) {\n var dep = _a[_i];\n this.add(dep);\n }\n this.hooks = combineHooks(this.hooks, plugin);\n }\n };\n return PluginSystem;\n }());\n function combineHooks(hooks0, hooks1) {\n return {\n reducers: hooks0.reducers.concat(hooks1.reducers),\n eventDefParsers: hooks0.eventDefParsers.concat(hooks1.eventDefParsers),\n isDraggableTransformers: hooks0.isDraggableTransformers.concat(hooks1.isDraggableTransformers),\n eventDragMutationMassagers: hooks0.eventDragMutationMassagers.concat(hooks1.eventDragMutationMassagers),\n eventDefMutationAppliers: hooks0.eventDefMutationAppliers.concat(hooks1.eventDefMutationAppliers),\n dateSelectionTransformers: hooks0.dateSelectionTransformers.concat(hooks1.dateSelectionTransformers),\n datePointTransforms: hooks0.datePointTransforms.concat(hooks1.datePointTransforms),\n dateSpanTransforms: hooks0.dateSpanTransforms.concat(hooks1.dateSpanTransforms),\n views: __assign({}, hooks0.views, hooks1.views),\n viewPropsTransformers: hooks0.viewPropsTransformers.concat(hooks1.viewPropsTransformers),\n isPropsValid: hooks1.isPropsValid || hooks0.isPropsValid,\n externalDefTransforms: hooks0.externalDefTransforms.concat(hooks1.externalDefTransforms),\n eventResizeJoinTransforms: hooks0.eventResizeJoinTransforms.concat(hooks1.eventResizeJoinTransforms),\n viewContainerModifiers: hooks0.viewContainerModifiers.concat(hooks1.viewContainerModifiers),\n eventDropTransformers: hooks0.eventDropTransformers.concat(hooks1.eventDropTransformers),\n calendarInteractions: hooks0.calendarInteractions.concat(hooks1.calendarInteractions),\n componentInteractions: hooks0.componentInteractions.concat(hooks1.componentInteractions),\n themeClasses: __assign({}, hooks0.themeClasses, hooks1.themeClasses),\n eventSourceDefs: hooks0.eventSourceDefs.concat(hooks1.eventSourceDefs),\n cmdFormatter: hooks1.cmdFormatter || hooks0.cmdFormatter,\n recurringTypes: hooks0.recurringTypes.concat(hooks1.recurringTypes),\n namedTimeZonedImpl: hooks1.namedTimeZonedImpl || hooks0.namedTimeZonedImpl,\n defaultView: hooks0.defaultView || hooks1.defaultView,\n elementDraggingImpl: hooks0.elementDraggingImpl || hooks1.elementDraggingImpl,\n optionChangeHandlers: __assign({}, hooks0.optionChangeHandlers, hooks1.optionChangeHandlers)\n };\n }\n\n var eventSourceDef = {\n ignoreRange: true,\n parseMeta: function (raw) {\n if (Array.isArray(raw)) { // short form\n return raw;\n }\n else if (Array.isArray(raw.events)) {\n return raw.events;\n }\n return null;\n },\n fetch: function (arg, success) {\n success({\n rawEvents: arg.eventSource.meta\n });\n }\n };\n var ArrayEventSourcePlugin = createPlugin({\n eventSourceDefs: [eventSourceDef]\n });\n\n var eventSourceDef$1 = {\n parseMeta: function (raw) {\n if (typeof raw === 'function') { // short form\n return raw;\n }\n else if (typeof raw.events === 'function') {\n return raw.events;\n }\n return null;\n },\n fetch: function (arg, success, failure) {\n var dateEnv = arg.calendar.dateEnv;\n var func = arg.eventSource.meta;\n unpromisify(func.bind(null, {\n start: dateEnv.toDate(arg.range.start),\n end: dateEnv.toDate(arg.range.end),\n startStr: dateEnv.formatIso(arg.range.start),\n endStr: dateEnv.formatIso(arg.range.end),\n timeZone: dateEnv.timeZone\n }), function (rawEvents) {\n success({ rawEvents: rawEvents }); // needs an object response\n }, failure // send errorObj directly to failure callback\n );\n }\n };\n var FuncEventSourcePlugin = createPlugin({\n eventSourceDefs: [eventSourceDef$1]\n });\n\n function requestJson(method, url, params, successCallback, failureCallback) {\n method = method.toUpperCase();\n var body = null;\n if (method === 'GET') {\n url = injectQueryStringParams(url, params);\n }\n else {\n body = encodeParams(params);\n }\n var xhr = new XMLHttpRequest();\n xhr.open(method, url, true);\n if (method !== 'GET') {\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n }\n xhr.onload = function () {\n if (xhr.status >= 200 && xhr.status < 400) {\n try {\n var res = JSON.parse(xhr.responseText);\n successCallback(res, xhr);\n }\n catch (err) {\n failureCallback('Failure parsing JSON', xhr);\n }\n }\n else {\n failureCallback('Request failed', xhr);\n }\n };\n xhr.onerror = function () {\n failureCallback('Request failed', xhr);\n };\n xhr.send(body);\n }\n function injectQueryStringParams(url, params) {\n return url +\n (url.indexOf('?') === -1 ? '?' : '&') +\n encodeParams(params);\n }\n function encodeParams(params) {\n var parts = [];\n for (var key in params) {\n parts.push(encodeURIComponent(key) + '=' + encodeURIComponent(params[key]));\n }\n return parts.join('&');\n }\n\n var eventSourceDef$2 = {\n parseMeta: function (raw) {\n if (typeof raw === 'string') { // short form\n raw = { url: raw };\n }\n else if (!raw || typeof raw !== 'object' || !raw.url) {\n return null;\n }\n return {\n url: raw.url,\n method: (raw.method || 'GET').toUpperCase(),\n extraParams: raw.extraParams,\n startParam: raw.startParam,\n endParam: raw.endParam,\n timeZoneParam: raw.timeZoneParam\n };\n },\n fetch: function (arg, success, failure) {\n var meta = arg.eventSource.meta;\n var requestParams = buildRequestParams(meta, arg.range, arg.calendar);\n requestJson(meta.method, meta.url, requestParams, function (rawEvents, xhr) {\n success({ rawEvents: rawEvents, xhr: xhr });\n }, function (errorMessage, xhr) {\n failure({ message: errorMessage, xhr: xhr });\n });\n }\n };\n var JsonFeedEventSourcePlugin = createPlugin({\n eventSourceDefs: [eventSourceDef$2]\n });\n function buildRequestParams(meta, range, calendar) {\n var dateEnv = calendar.dateEnv;\n var startParam;\n var endParam;\n var timeZoneParam;\n var customRequestParams;\n var params = {};\n startParam = meta.startParam;\n if (startParam == null) {\n startParam = calendar.opt('startParam');\n }\n endParam = meta.endParam;\n if (endParam == null) {\n endParam = calendar.opt('endParam');\n }\n timeZoneParam = meta.timeZoneParam;\n if (timeZoneParam == null) {\n timeZoneParam = calendar.opt('timeZoneParam');\n }\n // retrieve any outbound GET/POST data from the options\n if (typeof meta.extraParams === 'function') {\n // supplied as a function that returns a key/value object\n customRequestParams = meta.extraParams();\n }\n else {\n // probably supplied as a straight key/value object\n customRequestParams = meta.extraParams || {};\n }\n __assign(params, customRequestParams);\n params[startParam] = dateEnv.formatIso(range.start);\n params[endParam] = dateEnv.formatIso(range.end);\n if (dateEnv.timeZone !== 'local') {\n params[timeZoneParam] = dateEnv.timeZone;\n }\n return params;\n }\n\n var recurring = {\n parse: function (rawEvent, leftoverProps, dateEnv) {\n var createMarker = dateEnv.createMarker.bind(dateEnv);\n var processors = {\n daysOfWeek: null,\n startTime: createDuration,\n endTime: createDuration,\n startRecur: createMarker,\n endRecur: createMarker\n };\n var props = refineProps(rawEvent, processors, {}, leftoverProps);\n var anyValid = false;\n for (var propName in props) {\n if (props[propName] != null) {\n anyValid = true;\n break;\n }\n }\n if (anyValid) {\n var duration = null;\n if ('duration' in leftoverProps) {\n duration = createDuration(leftoverProps.duration);\n delete leftoverProps.duration;\n }\n if (!duration && props.startTime && props.endTime) {\n duration = subtractDurations(props.endTime, props.startTime);\n }\n return {\n allDayGuess: Boolean(!props.startTime && !props.endTime),\n duration: duration,\n typeData: props // doesn't need endTime anymore but oh well\n };\n }\n return null;\n },\n expand: function (typeData, framingRange, dateEnv) {\n var clippedFramingRange = intersectRanges(framingRange, { start: typeData.startRecur, end: typeData.endRecur });\n if (clippedFramingRange) {\n return expandRanges(typeData.daysOfWeek, typeData.startTime, clippedFramingRange, dateEnv);\n }\n else {\n return [];\n }\n }\n };\n var SimpleRecurrencePlugin = createPlugin({\n recurringTypes: [recurring]\n });\n function expandRanges(daysOfWeek, startTime, framingRange, dateEnv) {\n var dowHash = daysOfWeek ? arrayToHash(daysOfWeek) : null;\n var dayMarker = startOfDay(framingRange.start);\n var endMarker = framingRange.end;\n var instanceStarts = [];\n while (dayMarker < endMarker) {\n var instanceStart \n // if everyday, or this particular day-of-week\n = void 0;\n // if everyday, or this particular day-of-week\n if (!dowHash || dowHash[dayMarker.getUTCDay()]) {\n if (startTime) {\n instanceStart = dateEnv.add(dayMarker, startTime);\n }\n else {\n instanceStart = dayMarker;\n }\n instanceStarts.push(instanceStart);\n }\n dayMarker = addDays(dayMarker, 1);\n }\n return instanceStarts;\n }\n\n var DefaultOptionChangeHandlers = createPlugin({\n optionChangeHandlers: {\n events: function (events, calendar, deepEqual) {\n handleEventSources([events], calendar, deepEqual);\n },\n eventSources: handleEventSources,\n plugins: handlePlugins\n }\n });\n function handleEventSources(inputs, calendar, deepEqual) {\n var unfoundSources = hashValuesToArray(calendar.state.eventSources);\n var newInputs = [];\n for (var _i = 0, inputs_1 = inputs; _i < inputs_1.length; _i++) {\n var input = inputs_1[_i];\n var inputFound = false;\n for (var i = 0; i < unfoundSources.length; i++) {\n if (deepEqual(unfoundSources[i]._raw, input)) {\n unfoundSources.splice(i, 1); // delete\n inputFound = true;\n break;\n }\n }\n if (!inputFound) {\n newInputs.push(input);\n }\n }\n for (var _a = 0, unfoundSources_1 = unfoundSources; _a < unfoundSources_1.length; _a++) {\n var unfoundSource = unfoundSources_1[_a];\n calendar.dispatch({\n type: 'REMOVE_EVENT_SOURCE',\n sourceId: unfoundSource.sourceId\n });\n }\n for (var _b = 0, newInputs_1 = newInputs; _b < newInputs_1.length; _b++) {\n var newInput = newInputs_1[_b];\n calendar.addEventSource(newInput);\n }\n }\n // shortcoming: won't remove plugins\n function handlePlugins(inputs, calendar) {\n calendar.addPluginInputs(inputs); // will gracefully handle duplicates\n }\n\n var config = {}; // TODO: make these options\n var globalDefaults = {\n defaultRangeSeparator: ' - ',\n titleRangeSeparator: ' \\u2013 ',\n defaultTimedEventDuration: '01:00:00',\n defaultAllDayEventDuration: { day: 1 },\n forceEventDuration: false,\n nextDayThreshold: '00:00:00',\n // display\n columnHeader: true,\n defaultView: '',\n aspectRatio: 1.35,\n header: {\n left: 'title',\n center: '',\n right: 'today prev,next'\n },\n weekends: true,\n weekNumbers: false,\n weekNumberCalculation: 'local',\n editable: false,\n // nowIndicator: false,\n scrollTime: '06:00:00',\n minTime: '00:00:00',\n maxTime: '24:00:00',\n showNonCurrentDates: true,\n // event ajax\n lazyFetching: true,\n startParam: 'start',\n endParam: 'end',\n timeZoneParam: 'timeZone',\n timeZone: 'local',\n // allDayDefault: undefined,\n // locale\n locales: [],\n locale: '',\n // dir: will get this from the default locale\n // buttonIcons: null,\n // allows setting a min-height to the event segment to prevent short events overlapping each other\n timeGridEventMinHeight: 0,\n themeSystem: 'standard',\n // eventResizableFromStart: false,\n dragRevertDuration: 500,\n dragScroll: true,\n allDayMaintainDuration: false,\n // selectable: false,\n unselectAuto: true,\n // selectMinDistance: 0,\n dropAccept: '*',\n eventOrder: 'start,-duration,allDay,title',\n // ^ if start tie, longer events go before shorter. final tie-breaker is title text\n // rerenderDelay: null,\n eventLimit: false,\n eventLimitClick: 'popover',\n dayPopoverFormat: { month: 'long', day: 'numeric', year: 'numeric' },\n handleWindowResize: true,\n windowResizeDelay: 100,\n longPressDelay: 1000,\n eventDragMinDistance: 5 // only applies to mouse\n };\n var rtlDefaults = {\n header: {\n left: 'next,prev today',\n center: '',\n right: 'title'\n },\n buttonIcons: {\n // TODO: make RTL support the responibility of the theme\n prev: 'fc-icon-chevron-right',\n next: 'fc-icon-chevron-left',\n prevYear: 'fc-icon-chevrons-right',\n nextYear: 'fc-icon-chevrons-left'\n }\n };\n var complexOptions = [\n 'header',\n 'footer',\n 'buttonText',\n 'buttonIcons'\n ];\n // Merges an array of option objects into a single object\n function mergeOptions(optionObjs) {\n return mergeProps(optionObjs, complexOptions);\n }\n // TODO: move this stuff to a \"plugin\"-related file...\n var INTERNAL_PLUGINS = [\n ArrayEventSourcePlugin,\n FuncEventSourcePlugin,\n JsonFeedEventSourcePlugin,\n SimpleRecurrencePlugin,\n DefaultOptionChangeHandlers\n ];\n function refinePluginDefs(pluginInputs) {\n var plugins = [];\n for (var _i = 0, pluginInputs_1 = pluginInputs; _i < pluginInputs_1.length; _i++) {\n var pluginInput = pluginInputs_1[_i];\n if (typeof pluginInput === 'string') {\n var globalName = 'FullCalendar' + capitaliseFirstLetter(pluginInput);\n if (!window[globalName]) {\n console.warn('Plugin file not loaded for ' + pluginInput);\n }\n else {\n plugins.push(window[globalName].default); // is an ES6 module\n }\n }\n else {\n plugins.push(pluginInput);\n }\n }\n return INTERNAL_PLUGINS.concat(plugins);\n }\n\n var RAW_EN_LOCALE = {\n code: 'en',\n week: {\n dow: 0,\n doy: 4 // 4 days need to be within the year to be considered the first week\n },\n dir: 'ltr',\n buttonText: {\n prev: 'prev',\n next: 'next',\n prevYear: 'prev year',\n nextYear: 'next year',\n year: 'year',\n today: 'today',\n month: 'month',\n week: 'week',\n day: 'day',\n list: 'list'\n },\n weekLabel: 'W',\n allDayText: 'all-day',\n eventLimitText: 'more',\n noEventsMessage: 'No events to display'\n };\n function parseRawLocales(explicitRawLocales) {\n var defaultCode = explicitRawLocales.length > 0 ? explicitRawLocales[0].code : 'en';\n var globalArray = window['FullCalendarLocalesAll'] || []; // from locales-all.js\n var globalObject = window['FullCalendarLocales'] || {}; // from locales/*.js. keys are meaningless\n var allRawLocales = globalArray.concat(// globalArray is low prio\n hashValuesToArray(globalObject), // medium prio\n explicitRawLocales // highest prio\n );\n var rawLocaleMap = {\n en: RAW_EN_LOCALE // necessary?\n };\n for (var _i = 0, allRawLocales_1 = allRawLocales; _i < allRawLocales_1.length; _i++) {\n var rawLocale = allRawLocales_1[_i];\n rawLocaleMap[rawLocale.code] = rawLocale;\n }\n return {\n map: rawLocaleMap,\n defaultCode: defaultCode\n };\n }\n function buildLocale(inputSingular, available) {\n if (typeof inputSingular === 'object' && !Array.isArray(inputSingular)) {\n return parseLocale(inputSingular.code, [inputSingular.code], inputSingular);\n }\n else {\n return queryLocale(inputSingular, available);\n }\n }\n function queryLocale(codeArg, available) {\n var codes = [].concat(codeArg || []); // will convert to array\n var raw = queryRawLocale(codes, available) || RAW_EN_LOCALE;\n return parseLocale(codeArg, codes, raw);\n }\n function queryRawLocale(codes, available) {\n for (var i = 0; i < codes.length; i++) {\n var parts = codes[i].toLocaleLowerCase().split('-');\n for (var j = parts.length; j > 0; j--) {\n var simpleId = parts.slice(0, j).join('-');\n if (available[simpleId]) {\n return available[simpleId];\n }\n }\n }\n return null;\n }\n function parseLocale(codeArg, codes, raw) {\n var merged = mergeProps([RAW_EN_LOCALE, raw], ['buttonText']);\n delete merged.code; // don't want this part of the options\n var week = merged.week;\n delete merged.week;\n return {\n codeArg: codeArg,\n codes: codes,\n week: week,\n simpleNumberFormat: new Intl.NumberFormat(codeArg),\n options: merged\n };\n }\n\n var OptionsManager = /** @class */ (function () {\n function OptionsManager(overrides) {\n this.overrides = __assign({}, overrides); // make a copy\n this.dynamicOverrides = {};\n this.compute();\n }\n OptionsManager.prototype.mutate = function (updates, removals, isDynamic) {\n if (!Object.keys(updates).length && !removals.length) {\n return;\n }\n var overrideHash = isDynamic ? this.dynamicOverrides : this.overrides;\n __assign(overrideHash, updates);\n for (var _i = 0, removals_1 = removals; _i < removals_1.length; _i++) {\n var propName = removals_1[_i];\n delete overrideHash[propName];\n }\n this.compute();\n };\n // Computes the flattened options hash for the calendar and assigns to `this.options`.\n // Assumes this.overrides and this.dynamicOverrides have already been initialized.\n OptionsManager.prototype.compute = function () {\n // TODO: not a very efficient system\n var locales = firstDefined(// explicit locale option given?\n this.dynamicOverrides.locales, this.overrides.locales, globalDefaults.locales);\n var locale = firstDefined(// explicit locales option given?\n this.dynamicOverrides.locale, this.overrides.locale, globalDefaults.locale);\n var available = parseRawLocales(locales);\n var localeDefaults = buildLocale(locale || available.defaultCode, available.map).options;\n var dir = firstDefined(// based on options computed so far, is direction RTL?\n this.dynamicOverrides.dir, this.overrides.dir, localeDefaults.dir);\n var dirDefaults = dir === 'rtl' ? rtlDefaults : {};\n this.dirDefaults = dirDefaults;\n this.localeDefaults = localeDefaults;\n this.computed = mergeOptions([\n globalDefaults,\n dirDefaults,\n localeDefaults,\n this.overrides,\n this.dynamicOverrides\n ]);\n };\n return OptionsManager;\n }());\n\n var calendarSystemClassMap = {};\n function registerCalendarSystem(name, theClass) {\n calendarSystemClassMap[name] = theClass;\n }\n function createCalendarSystem(name) {\n return new calendarSystemClassMap[name]();\n }\n var GregorianCalendarSystem = /** @class */ (function () {\n function GregorianCalendarSystem() {\n }\n GregorianCalendarSystem.prototype.getMarkerYear = function (d) {\n return d.getUTCFullYear();\n };\n GregorianCalendarSystem.prototype.getMarkerMonth = function (d) {\n return d.getUTCMonth();\n };\n GregorianCalendarSystem.prototype.getMarkerDay = function (d) {\n return d.getUTCDate();\n };\n GregorianCalendarSystem.prototype.arrayToMarker = function (arr) {\n return arrayToUtcDate(arr);\n };\n GregorianCalendarSystem.prototype.markerToArray = function (marker) {\n return dateToUtcArray(marker);\n };\n return GregorianCalendarSystem;\n }());\n registerCalendarSystem('gregory', GregorianCalendarSystem);\n\n var ISO_RE = /^\\s*(\\d{4})(-(\\d{2})(-(\\d{2})([T ](\\d{2}):(\\d{2})(:(\\d{2})(\\.(\\d+))?)?(Z|(([-+])(\\d{2})(:?(\\d{2}))?))?)?)?)?$/;\n function parse(str) {\n var m = ISO_RE.exec(str);\n if (m) {\n var marker = new Date(Date.UTC(Number(m[1]), m[3] ? Number(m[3]) - 1 : 0, Number(m[5] || 1), Number(m[7] || 0), Number(m[8] || 0), Number(m[10] || 0), m[12] ? Number('0.' + m[12]) * 1000 : 0));\n if (isValidDate(marker)) {\n var timeZoneOffset = null;\n if (m[13]) {\n timeZoneOffset = (m[15] === '-' ? -1 : 1) * (Number(m[16] || 0) * 60 +\n Number(m[18] || 0));\n }\n return {\n marker: marker,\n isTimeUnspecified: !m[6],\n timeZoneOffset: timeZoneOffset\n };\n }\n }\n return null;\n }\n\n var DateEnv = /** @class */ (function () {\n function DateEnv(settings) {\n var timeZone = this.timeZone = settings.timeZone;\n var isNamedTimeZone = timeZone !== 'local' && timeZone !== 'UTC';\n if (settings.namedTimeZoneImpl && isNamedTimeZone) {\n this.namedTimeZoneImpl = new settings.namedTimeZoneImpl(timeZone);\n }\n this.canComputeOffset = Boolean(!isNamedTimeZone || this.namedTimeZoneImpl);\n this.calendarSystem = createCalendarSystem(settings.calendarSystem);\n this.locale = settings.locale;\n this.weekDow = settings.locale.week.dow;\n this.weekDoy = settings.locale.week.doy;\n if (settings.weekNumberCalculation === 'ISO') {\n this.weekDow = 1;\n this.weekDoy = 4;\n }\n if (typeof settings.firstDay === 'number') {\n this.weekDow = settings.firstDay;\n }\n if (typeof settings.weekNumberCalculation === 'function') {\n this.weekNumberFunc = settings.weekNumberCalculation;\n }\n this.weekLabel = settings.weekLabel != null ? settings.weekLabel : settings.locale.options.weekLabel;\n this.cmdFormatter = settings.cmdFormatter;\n }\n // Creating / Parsing\n DateEnv.prototype.createMarker = function (input) {\n var meta = this.createMarkerMeta(input);\n if (meta === null) {\n return null;\n }\n return meta.marker;\n };\n DateEnv.prototype.createNowMarker = function () {\n if (this.canComputeOffset) {\n return this.timestampToMarker(new Date().valueOf());\n }\n else {\n // if we can't compute the current date val for a timezone,\n // better to give the current local date vals than UTC\n return arrayToUtcDate(dateToLocalArray(new Date()));\n }\n };\n DateEnv.prototype.createMarkerMeta = function (input) {\n if (typeof input === 'string') {\n return this.parse(input);\n }\n var marker = null;\n if (typeof input === 'number') {\n marker = this.timestampToMarker(input);\n }\n else if (input instanceof Date) {\n input = input.valueOf();\n if (!isNaN(input)) {\n marker = this.timestampToMarker(input);\n }\n }\n else if (Array.isArray(input)) {\n marker = arrayToUtcDate(input);\n }\n if (marker === null || !isValidDate(marker)) {\n return null;\n }\n return { marker: marker, isTimeUnspecified: false, forcedTzo: null };\n };\n DateEnv.prototype.parse = function (s) {\n var parts = parse(s);\n if (parts === null) {\n return null;\n }\n var marker = parts.marker;\n var forcedTzo = null;\n if (parts.timeZoneOffset !== null) {\n if (this.canComputeOffset) {\n marker = this.timestampToMarker(marker.valueOf() - parts.timeZoneOffset * 60 * 1000);\n }\n else {\n forcedTzo = parts.timeZoneOffset;\n }\n }\n return { marker: marker, isTimeUnspecified: parts.isTimeUnspecified, forcedTzo: forcedTzo };\n };\n // Accessors\n DateEnv.prototype.getYear = function (marker) {\n return this.calendarSystem.getMarkerYear(marker);\n };\n DateEnv.prototype.getMonth = function (marker) {\n return this.calendarSystem.getMarkerMonth(marker);\n };\n // Adding / Subtracting\n DateEnv.prototype.add = function (marker, dur) {\n var a = this.calendarSystem.markerToArray(marker);\n a[0] += dur.years;\n a[1] += dur.months;\n a[2] += dur.days;\n a[6] += dur.milliseconds;\n return this.calendarSystem.arrayToMarker(a);\n };\n DateEnv.prototype.subtract = function (marker, dur) {\n var a = this.calendarSystem.markerToArray(marker);\n a[0] -= dur.years;\n a[1] -= dur.months;\n a[2] -= dur.days;\n a[6] -= dur.milliseconds;\n return this.calendarSystem.arrayToMarker(a);\n };\n DateEnv.prototype.addYears = function (marker, n) {\n var a = this.calendarSystem.markerToArray(marker);\n a[0] += n;\n return this.calendarSystem.arrayToMarker(a);\n };\n DateEnv.prototype.addMonths = function (marker, n) {\n var a = this.calendarSystem.markerToArray(marker);\n a[1] += n;\n return this.calendarSystem.arrayToMarker(a);\n };\n // Diffing Whole Units\n DateEnv.prototype.diffWholeYears = function (m0, m1) {\n var calendarSystem = this.calendarSystem;\n if (timeAsMs(m0) === timeAsMs(m1) &&\n calendarSystem.getMarkerDay(m0) === calendarSystem.getMarkerDay(m1) &&\n calendarSystem.getMarkerMonth(m0) === calendarSystem.getMarkerMonth(m1)) {\n return calendarSystem.getMarkerYear(m1) - calendarSystem.getMarkerYear(m0);\n }\n return null;\n };\n DateEnv.prototype.diffWholeMonths = function (m0, m1) {\n var calendarSystem = this.calendarSystem;\n if (timeAsMs(m0) === timeAsMs(m1) &&\n calendarSystem.getMarkerDay(m0) === calendarSystem.getMarkerDay(m1)) {\n return (calendarSystem.getMarkerMonth(m1) - calendarSystem.getMarkerMonth(m0)) +\n (calendarSystem.getMarkerYear(m1) - calendarSystem.getMarkerYear(m0)) * 12;\n }\n return null;\n };\n // Range / Duration\n DateEnv.prototype.greatestWholeUnit = function (m0, m1) {\n var n = this.diffWholeYears(m0, m1);\n if (n !== null) {\n return { unit: 'year', value: n };\n }\n n = this.diffWholeMonths(m0, m1);\n if (n !== null) {\n return { unit: 'month', value: n };\n }\n n = diffWholeWeeks(m0, m1);\n if (n !== null) {\n return { unit: 'week', value: n };\n }\n n = diffWholeDays(m0, m1);\n if (n !== null) {\n return { unit: 'day', value: n };\n }\n n = diffHours(m0, m1);\n if (isInt(n)) {\n return { unit: 'hour', value: n };\n }\n n = diffMinutes(m0, m1);\n if (isInt(n)) {\n return { unit: 'minute', value: n };\n }\n n = diffSeconds(m0, m1);\n if (isInt(n)) {\n return { unit: 'second', value: n };\n }\n return { unit: 'millisecond', value: m1.valueOf() - m0.valueOf() };\n };\n DateEnv.prototype.countDurationsBetween = function (m0, m1, d) {\n // TODO: can use greatestWholeUnit\n var diff;\n if (d.years) {\n diff = this.diffWholeYears(m0, m1);\n if (diff !== null) {\n return diff / asRoughYears(d);\n }\n }\n if (d.months) {\n diff = this.diffWholeMonths(m0, m1);\n if (diff !== null) {\n return diff / asRoughMonths(d);\n }\n }\n if (d.days) {\n diff = diffWholeDays(m0, m1);\n if (diff !== null) {\n return diff / asRoughDays(d);\n }\n }\n return (m1.valueOf() - m0.valueOf()) / asRoughMs(d);\n };\n // Start-Of\n DateEnv.prototype.startOf = function (m, unit) {\n if (unit === 'year') {\n return this.startOfYear(m);\n }\n else if (unit === 'month') {\n return this.startOfMonth(m);\n }\n else if (unit === 'week') {\n return this.startOfWeek(m);\n }\n else if (unit === 'day') {\n return startOfDay(m);\n }\n else if (unit === 'hour') {\n return startOfHour(m);\n }\n else if (unit === 'minute') {\n return startOfMinute(m);\n }\n else if (unit === 'second') {\n return startOfSecond(m);\n }\n };\n DateEnv.prototype.startOfYear = function (m) {\n return this.calendarSystem.arrayToMarker([\n this.calendarSystem.getMarkerYear(m)\n ]);\n };\n DateEnv.prototype.startOfMonth = function (m) {\n return this.calendarSystem.arrayToMarker([\n this.calendarSystem.getMarkerYear(m),\n this.calendarSystem.getMarkerMonth(m)\n ]);\n };\n DateEnv.prototype.startOfWeek = function (m) {\n return this.calendarSystem.arrayToMarker([\n this.calendarSystem.getMarkerYear(m),\n this.calendarSystem.getMarkerMonth(m),\n m.getUTCDate() - ((m.getUTCDay() - this.weekDow + 7) % 7)\n ]);\n };\n // Week Number\n DateEnv.prototype.computeWeekNumber = function (marker) {\n if (this.weekNumberFunc) {\n return this.weekNumberFunc(this.toDate(marker));\n }\n else {\n return weekOfYear(marker, this.weekDow, this.weekDoy);\n }\n };\n // TODO: choke on timeZoneName: long\n DateEnv.prototype.format = function (marker, formatter, dateOptions) {\n if (dateOptions === void 0) { dateOptions = {}; }\n return formatter.format({\n marker: marker,\n timeZoneOffset: dateOptions.forcedTzo != null ?\n dateOptions.forcedTzo :\n this.offsetForMarker(marker)\n }, this);\n };\n DateEnv.prototype.formatRange = function (start, end, formatter, dateOptions) {\n if (dateOptions === void 0) { dateOptions = {}; }\n if (dateOptions.isEndExclusive) {\n end = addMs(end, -1);\n }\n return formatter.formatRange({\n marker: start,\n timeZoneOffset: dateOptions.forcedStartTzo != null ?\n dateOptions.forcedStartTzo :\n this.offsetForMarker(start)\n }, {\n marker: end,\n timeZoneOffset: dateOptions.forcedEndTzo != null ?\n dateOptions.forcedEndTzo :\n this.offsetForMarker(end)\n }, this);\n };\n DateEnv.prototype.formatIso = function (marker, extraOptions) {\n if (extraOptions === void 0) { extraOptions = {}; }\n var timeZoneOffset = null;\n if (!extraOptions.omitTimeZoneOffset) {\n if (extraOptions.forcedTzo != null) {\n timeZoneOffset = extraOptions.forcedTzo;\n }\n else {\n timeZoneOffset = this.offsetForMarker(marker);\n }\n }\n return buildIsoString(marker, timeZoneOffset, extraOptions.omitTime);\n };\n // TimeZone\n DateEnv.prototype.timestampToMarker = function (ms) {\n if (this.timeZone === 'local') {\n return arrayToUtcDate(dateToLocalArray(new Date(ms)));\n }\n else if (this.timeZone === 'UTC' || !this.namedTimeZoneImpl) {\n return new Date(ms);\n }\n else {\n return arrayToUtcDate(this.namedTimeZoneImpl.timestampToArray(ms));\n }\n };\n DateEnv.prototype.offsetForMarker = function (m) {\n if (this.timeZone === 'local') {\n return -arrayToLocalDate(dateToUtcArray(m)).getTimezoneOffset(); // convert \"inverse\" offset to \"normal\" offset\n }\n else if (this.timeZone === 'UTC') {\n return 0;\n }\n else if (this.namedTimeZoneImpl) {\n return this.namedTimeZoneImpl.offsetForArray(dateToUtcArray(m));\n }\n return null;\n };\n // Conversion\n DateEnv.prototype.toDate = function (m, forcedTzo) {\n if (this.timeZone === 'local') {\n return arrayToLocalDate(dateToUtcArray(m));\n }\n else if (this.timeZone === 'UTC') {\n return new Date(m.valueOf()); // make sure it's a copy\n }\n else if (!this.namedTimeZoneImpl) {\n return new Date(m.valueOf() - (forcedTzo || 0));\n }\n else {\n return new Date(m.valueOf() -\n this.namedTimeZoneImpl.offsetForArray(dateToUtcArray(m)) * 1000 * 60 // convert minutes -> ms\n );\n }\n };\n return DateEnv;\n }());\n\n var SIMPLE_SOURCE_PROPS = {\n id: String,\n allDayDefault: Boolean,\n eventDataTransform: Function,\n success: Function,\n failure: Function\n };\n var uid$2 = 0;\n function doesSourceNeedRange(eventSource, calendar) {\n var defs = calendar.pluginSystem.hooks.eventSourceDefs;\n return !defs[eventSource.sourceDefId].ignoreRange;\n }\n function parseEventSource(raw, calendar) {\n var defs = calendar.pluginSystem.hooks.eventSourceDefs;\n for (var i = defs.length - 1; i >= 0; i--) { // later-added plugins take precedence\n var def = defs[i];\n var meta = def.parseMeta(raw);\n if (meta) {\n var res = parseEventSourceProps(typeof raw === 'object' ? raw : {}, meta, i, calendar);\n res._raw = raw;\n return res;\n }\n }\n return null;\n }\n function parseEventSourceProps(raw, meta, sourceDefId, calendar) {\n var leftovers0 = {};\n var props = refineProps(raw, SIMPLE_SOURCE_PROPS, {}, leftovers0);\n var leftovers1 = {};\n var ui = processUnscopedUiProps(leftovers0, calendar, leftovers1);\n props.isFetching = false;\n props.latestFetchId = '';\n props.fetchRange = null;\n props.publicId = String(raw.id || '');\n props.sourceId = String(uid$2++);\n props.sourceDefId = sourceDefId;\n props.meta = meta;\n props.ui = ui;\n props.extendedProps = leftovers1;\n return props;\n }\n\n function reduceEventSources (eventSources, action, dateProfile, calendar) {\n switch (action.type) {\n case 'ADD_EVENT_SOURCES': // already parsed\n return addSources(eventSources, action.sources, dateProfile ? dateProfile.activeRange : null, calendar);\n case 'REMOVE_EVENT_SOURCE':\n return removeSource(eventSources, action.sourceId);\n case 'PREV': // TODO: how do we track all actions that affect dateProfile :(\n case 'NEXT':\n case 'SET_DATE':\n case 'SET_VIEW_TYPE':\n if (dateProfile) {\n return fetchDirtySources(eventSources, dateProfile.activeRange, calendar);\n }\n else {\n return eventSources;\n }\n case 'FETCH_EVENT_SOURCES':\n case 'CHANGE_TIMEZONE':\n return fetchSourcesByIds(eventSources, action.sourceIds ?\n arrayToHash(action.sourceIds) :\n excludeStaticSources(eventSources, calendar), dateProfile ? dateProfile.activeRange : null, calendar);\n case 'RECEIVE_EVENTS':\n case 'RECEIVE_EVENT_ERROR':\n return receiveResponse(eventSources, action.sourceId, action.fetchId, action.fetchRange);\n case 'REMOVE_ALL_EVENT_SOURCES':\n return {};\n default:\n return eventSources;\n }\n }\n var uid$3 = 0;\n function addSources(eventSourceHash, sources, fetchRange, calendar) {\n var hash = {};\n for (var _i = 0, sources_1 = sources; _i < sources_1.length; _i++) {\n var source = sources_1[_i];\n hash[source.sourceId] = source;\n }\n if (fetchRange) {\n hash = fetchDirtySources(hash, fetchRange, calendar);\n }\n return __assign({}, eventSourceHash, hash);\n }\n function removeSource(eventSourceHash, sourceId) {\n return filterHash(eventSourceHash, function (eventSource) {\n return eventSource.sourceId !== sourceId;\n });\n }\n function fetchDirtySources(sourceHash, fetchRange, calendar) {\n return fetchSourcesByIds(sourceHash, filterHash(sourceHash, function (eventSource) {\n return isSourceDirty(eventSource, fetchRange, calendar);\n }), fetchRange, calendar);\n }\n function isSourceDirty(eventSource, fetchRange, calendar) {\n if (!doesSourceNeedRange(eventSource, calendar)) {\n return !eventSource.latestFetchId;\n }\n else {\n return !calendar.opt('lazyFetching') ||\n !eventSource.fetchRange ||\n eventSource.isFetching || // always cancel outdated in-progress fetches\n fetchRange.start < eventSource.fetchRange.start ||\n fetchRange.end > eventSource.fetchRange.end;\n }\n }\n function fetchSourcesByIds(prevSources, sourceIdHash, fetchRange, calendar) {\n var nextSources = {};\n for (var sourceId in prevSources) {\n var source = prevSources[sourceId];\n if (sourceIdHash[sourceId]) {\n nextSources[sourceId] = fetchSource(source, fetchRange, calendar);\n }\n else {\n nextSources[sourceId] = source;\n }\n }\n return nextSources;\n }\n function fetchSource(eventSource, fetchRange, calendar) {\n var sourceDef = calendar.pluginSystem.hooks.eventSourceDefs[eventSource.sourceDefId];\n var fetchId = String(uid$3++);\n sourceDef.fetch({\n eventSource: eventSource,\n calendar: calendar,\n range: fetchRange\n }, function (res) {\n var rawEvents = res.rawEvents;\n var calSuccess = calendar.opt('eventSourceSuccess');\n var calSuccessRes;\n var sourceSuccessRes;\n if (eventSource.success) {\n sourceSuccessRes = eventSource.success(rawEvents, res.xhr);\n }\n if (calSuccess) {\n calSuccessRes = calSuccess(rawEvents, res.xhr);\n }\n rawEvents = sourceSuccessRes || calSuccessRes || rawEvents;\n calendar.dispatch({\n type: 'RECEIVE_EVENTS',\n sourceId: eventSource.sourceId,\n fetchId: fetchId,\n fetchRange: fetchRange,\n rawEvents: rawEvents\n });\n }, function (error) {\n var callFailure = calendar.opt('eventSourceFailure');\n console.warn(error.message, error);\n if (eventSource.failure) {\n eventSource.failure(error);\n }\n if (callFailure) {\n callFailure(error);\n }\n calendar.dispatch({\n type: 'RECEIVE_EVENT_ERROR',\n sourceId: eventSource.sourceId,\n fetchId: fetchId,\n fetchRange: fetchRange,\n error: error\n });\n });\n return __assign({}, eventSource, { isFetching: true, latestFetchId: fetchId });\n }\n function receiveResponse(sourceHash, sourceId, fetchId, fetchRange) {\n var _a;\n var eventSource = sourceHash[sourceId];\n if (eventSource && // not already removed\n fetchId === eventSource.latestFetchId) {\n return __assign({}, sourceHash, (_a = {}, _a[sourceId] = __assign({}, eventSource, { isFetching: false, fetchRange: fetchRange // also serves as a marker that at least one fetch has completed\n }), _a));\n }\n return sourceHash;\n }\n function excludeStaticSources(eventSources, calendar) {\n return filterHash(eventSources, function (eventSource) {\n return doesSourceNeedRange(eventSource, calendar);\n });\n }\n\n var DateProfileGenerator = /** @class */ (function () {\n function DateProfileGenerator(viewSpec, calendar) {\n this.viewSpec = viewSpec;\n this.options = viewSpec.options;\n this.dateEnv = calendar.dateEnv;\n this.calendar = calendar;\n this.initHiddenDays();\n }\n /* Date Range Computation\n ------------------------------------------------------------------------------------------------------------------*/\n // Builds a structure with info about what the dates/ranges will be for the \"prev\" view.\n DateProfileGenerator.prototype.buildPrev = function (currentDateProfile, currentDate) {\n var dateEnv = this.dateEnv;\n var prevDate = dateEnv.subtract(dateEnv.startOf(currentDate, currentDateProfile.currentRangeUnit), // important for start-of-month\n currentDateProfile.dateIncrement);\n return this.build(prevDate, -1);\n };\n // Builds a structure with info about what the dates/ranges will be for the \"next\" view.\n DateProfileGenerator.prototype.buildNext = function (currentDateProfile, currentDate) {\n var dateEnv = this.dateEnv;\n var nextDate = dateEnv.add(dateEnv.startOf(currentDate, currentDateProfile.currentRangeUnit), // important for start-of-month\n currentDateProfile.dateIncrement);\n return this.build(nextDate, 1);\n };\n // Builds a structure holding dates/ranges for rendering around the given date.\n // Optional direction param indicates whether the date is being incremented/decremented\n // from its previous value. decremented = -1, incremented = 1 (default).\n DateProfileGenerator.prototype.build = function (currentDate, direction, forceToValid) {\n if (forceToValid === void 0) { forceToValid = false; }\n var validRange;\n var minTime = null;\n var maxTime = null;\n var currentInfo;\n var isRangeAllDay;\n var renderRange;\n var activeRange;\n var isValid;\n validRange = this.buildValidRange();\n validRange = this.trimHiddenDays(validRange);\n if (forceToValid) {\n currentDate = constrainMarkerToRange(currentDate, validRange);\n }\n currentInfo = this.buildCurrentRangeInfo(currentDate, direction);\n isRangeAllDay = /^(year|month|week|day)$/.test(currentInfo.unit);\n renderRange = this.buildRenderRange(this.trimHiddenDays(currentInfo.range), currentInfo.unit, isRangeAllDay);\n renderRange = this.trimHiddenDays(renderRange);\n activeRange = renderRange;\n if (!this.options.showNonCurrentDates) {\n activeRange = intersectRanges(activeRange, currentInfo.range);\n }\n minTime = createDuration(this.options.minTime);\n maxTime = createDuration(this.options.maxTime);\n activeRange = this.adjustActiveRange(activeRange, minTime, maxTime);\n activeRange = intersectRanges(activeRange, validRange); // might return null\n // it's invalid if the originally requested date is not contained,\n // or if the range is completely outside of the valid range.\n isValid = rangesIntersect(currentInfo.range, validRange);\n return {\n // constraint for where prev/next operations can go and where events can be dragged/resized to.\n // an object with optional start and end properties.\n validRange: validRange,\n // range the view is formally responsible for.\n // for example, a month view might have 1st-31st, excluding padded dates\n currentRange: currentInfo.range,\n // name of largest unit being displayed, like \"month\" or \"week\"\n currentRangeUnit: currentInfo.unit,\n isRangeAllDay: isRangeAllDay,\n // dates that display events and accept drag-n-drop\n // will be `null` if no dates accept events\n activeRange: activeRange,\n // date range with a rendered skeleton\n // includes not-active days that need some sort of DOM\n renderRange: renderRange,\n // Duration object that denotes the first visible time of any given day\n minTime: minTime,\n // Duration object that denotes the exclusive visible end time of any given day\n maxTime: maxTime,\n isValid: isValid,\n // how far the current date will move for a prev/next operation\n dateIncrement: this.buildDateIncrement(currentInfo.duration)\n // pass a fallback (might be null) ^\n };\n };\n // Builds an object with optional start/end properties.\n // Indicates the minimum/maximum dates to display.\n // not responsible for trimming hidden days.\n DateProfileGenerator.prototype.buildValidRange = function () {\n return this.getRangeOption('validRange', this.calendar.getNow()) ||\n { start: null, end: null }; // completely open-ended\n };\n // Builds a structure with info about the \"current\" range, the range that is\n // highlighted as being the current month for example.\n // See build() for a description of `direction`.\n // Guaranteed to have `range` and `unit` properties. `duration` is optional.\n DateProfileGenerator.prototype.buildCurrentRangeInfo = function (date, direction) {\n var _a = this, viewSpec = _a.viewSpec, dateEnv = _a.dateEnv;\n var duration = null;\n var unit = null;\n var range = null;\n var dayCount;\n if (viewSpec.duration) {\n duration = viewSpec.duration;\n unit = viewSpec.durationUnit;\n range = this.buildRangeFromDuration(date, direction, duration, unit);\n }\n else if ((dayCount = this.options.dayCount)) {\n unit = 'day';\n range = this.buildRangeFromDayCount(date, direction, dayCount);\n }\n else if ((range = this.buildCustomVisibleRange(date))) {\n unit = dateEnv.greatestWholeUnit(range.start, range.end).unit;\n }\n else {\n duration = this.getFallbackDuration();\n unit = greatestDurationDenominator(duration).unit;\n range = this.buildRangeFromDuration(date, direction, duration, unit);\n }\n return { duration: duration, unit: unit, range: range };\n };\n DateProfileGenerator.prototype.getFallbackDuration = function () {\n return createDuration({ day: 1 });\n };\n // Returns a new activeRange to have time values (un-ambiguate)\n // minTime or maxTime causes the range to expand.\n DateProfileGenerator.prototype.adjustActiveRange = function (range, minTime, maxTime) {\n var dateEnv = this.dateEnv;\n var start = range.start;\n var end = range.end;\n if (this.viewSpec.class.prototype.usesMinMaxTime) {\n // expand active range if minTime is negative (why not when positive?)\n if (asRoughDays(minTime) < 0) {\n start = startOfDay(start); // necessary?\n start = dateEnv.add(start, minTime);\n }\n // expand active range if maxTime is beyond one day (why not when positive?)\n if (asRoughDays(maxTime) > 1) {\n end = startOfDay(end); // necessary?\n end = addDays(end, -1);\n end = dateEnv.add(end, maxTime);\n }\n }\n return { start: start, end: end };\n };\n // Builds the \"current\" range when it is specified as an explicit duration.\n // `unit` is the already-computed greatestDurationDenominator unit of duration.\n DateProfileGenerator.prototype.buildRangeFromDuration = function (date, direction, duration, unit) {\n var dateEnv = this.dateEnv;\n var alignment = this.options.dateAlignment;\n var dateIncrementInput;\n var dateIncrementDuration;\n var start;\n var end;\n var res;\n // compute what the alignment should be\n if (!alignment) {\n dateIncrementInput = this.options.dateIncrement;\n if (dateIncrementInput) {\n dateIncrementDuration = createDuration(dateIncrementInput);\n // use the smaller of the two units\n if (asRoughMs(dateIncrementDuration) < asRoughMs(duration)) {\n alignment = greatestDurationDenominator(dateIncrementDuration, !getWeeksFromInput(dateIncrementInput)).unit;\n }\n else {\n alignment = unit;\n }\n }\n else {\n alignment = unit;\n }\n }\n // if the view displays a single day or smaller\n if (asRoughDays(duration) <= 1) {\n if (this.isHiddenDay(start)) {\n start = this.skipHiddenDays(start, direction);\n start = startOfDay(start);\n }\n }\n function computeRes() {\n start = dateEnv.startOf(date, alignment);\n end = dateEnv.add(start, duration);\n res = { start: start, end: end };\n }\n computeRes();\n // if range is completely enveloped by hidden days, go past the hidden days\n if (!this.trimHiddenDays(res)) {\n date = this.skipHiddenDays(date, direction);\n computeRes();\n }\n return res;\n };\n // Builds the \"current\" range when a dayCount is specified.\n DateProfileGenerator.prototype.buildRangeFromDayCount = function (date, direction, dayCount) {\n var dateEnv = this.dateEnv;\n var customAlignment = this.options.dateAlignment;\n var runningCount = 0;\n var start = date;\n var end;\n if (customAlignment) {\n start = dateEnv.startOf(start, customAlignment);\n }\n start = startOfDay(start);\n start = this.skipHiddenDays(start, direction);\n end = start;\n do {\n end = addDays(end, 1);\n if (!this.isHiddenDay(end)) {\n runningCount++;\n }\n } while (runningCount < dayCount);\n return { start: start, end: end };\n };\n // Builds a normalized range object for the \"visible\" range,\n // which is a way to define the currentRange and activeRange at the same time.\n DateProfileGenerator.prototype.buildCustomVisibleRange = function (date) {\n var dateEnv = this.dateEnv;\n var visibleRange = this.getRangeOption('visibleRange', dateEnv.toDate(date));\n if (visibleRange && (visibleRange.start == null || visibleRange.end == null)) {\n return null;\n }\n return visibleRange;\n };\n // Computes the range that will represent the element/cells for *rendering*,\n // but which may have voided days/times.\n // not responsible for trimming hidden days.\n DateProfileGenerator.prototype.buildRenderRange = function (currentRange, currentRangeUnit, isRangeAllDay) {\n return currentRange;\n };\n // Compute the duration value that should be added/substracted to the current date\n // when a prev/next operation happens.\n DateProfileGenerator.prototype.buildDateIncrement = function (fallback) {\n var dateIncrementInput = this.options.dateIncrement;\n var customAlignment;\n if (dateIncrementInput) {\n return createDuration(dateIncrementInput);\n }\n else if ((customAlignment = this.options.dateAlignment)) {\n return createDuration(1, customAlignment);\n }\n else if (fallback) {\n return fallback;\n }\n else {\n return createDuration({ days: 1 });\n }\n };\n // Arguments after name will be forwarded to a hypothetical function value\n // WARNING: passed-in arguments will be given to generator functions as-is and can cause side-effects.\n // Always clone your objects if you fear mutation.\n DateProfileGenerator.prototype.getRangeOption = function (name) {\n var otherArgs = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n otherArgs[_i - 1] = arguments[_i];\n }\n var val = this.options[name];\n if (typeof val === 'function') {\n val = val.apply(null, otherArgs);\n }\n if (val) {\n val = parseRange(val, this.dateEnv);\n }\n if (val) {\n val = computeVisibleDayRange(val);\n }\n return val;\n };\n /* Hidden Days\n ------------------------------------------------------------------------------------------------------------------*/\n // Initializes internal variables related to calculating hidden days-of-week\n DateProfileGenerator.prototype.initHiddenDays = function () {\n var hiddenDays = this.options.hiddenDays || []; // array of day-of-week indices that are hidden\n var isHiddenDayHash = []; // is the day-of-week hidden? (hash with day-of-week-index -> bool)\n var dayCnt = 0;\n var i;\n if (this.options.weekends === false) {\n hiddenDays.push(0, 6); // 0=sunday, 6=saturday\n }\n for (i = 0; i < 7; i++) {\n if (!(isHiddenDayHash[i] = hiddenDays.indexOf(i) !== -1)) {\n dayCnt++;\n }\n }\n if (!dayCnt) {\n throw new Error('invalid hiddenDays'); // all days were hidden? bad.\n }\n this.isHiddenDayHash = isHiddenDayHash;\n };\n // Remove days from the beginning and end of the range that are computed as hidden.\n // If the whole range is trimmed off, returns null\n DateProfileGenerator.prototype.trimHiddenDays = function (range) {\n var start = range.start;\n var end = range.end;\n if (start) {\n start = this.skipHiddenDays(start);\n }\n if (end) {\n end = this.skipHiddenDays(end, -1, true);\n }\n if (start == null || end == null || start < end) {\n return { start: start, end: end };\n }\n return null;\n };\n // Is the current day hidden?\n // `day` is a day-of-week index (0-6), or a Date (used for UTC)\n DateProfileGenerator.prototype.isHiddenDay = function (day) {\n if (day instanceof Date) {\n day = day.getUTCDay();\n }\n return this.isHiddenDayHash[day];\n };\n // Incrementing the current day until it is no longer a hidden day, returning a copy.\n // DOES NOT CONSIDER validRange!\n // If the initial value of `date` is not a hidden day, don't do anything.\n // Pass `isExclusive` as `true` if you are dealing with an end date.\n // `inc` defaults to `1` (increment one day forward each time)\n DateProfileGenerator.prototype.skipHiddenDays = function (date, inc, isExclusive) {\n if (inc === void 0) { inc = 1; }\n if (isExclusive === void 0) { isExclusive = false; }\n while (this.isHiddenDayHash[(date.getUTCDay() + (isExclusive ? inc : 0) + 7) % 7]) {\n date = addDays(date, inc);\n }\n return date;\n };\n return DateProfileGenerator;\n }());\n // TODO: find a way to avoid comparing DateProfiles. it's tedious\n function isDateProfilesEqual(p0, p1) {\n return rangesEqual(p0.validRange, p1.validRange) &&\n rangesEqual(p0.activeRange, p1.activeRange) &&\n rangesEqual(p0.renderRange, p1.renderRange) &&\n durationsEqual(p0.minTime, p1.minTime) &&\n durationsEqual(p0.maxTime, p1.maxTime);\n /*\n TODO: compare more?\n currentRange: DateRange\n currentRangeUnit: string\n isRangeAllDay: boolean\n isValid: boolean\n dateIncrement: Duration\n */\n }\n\n function reduce (state, action, calendar) {\n var viewType = reduceViewType(state.viewType, action);\n var dateProfile = reduceDateProfile(state.dateProfile, action, state.currentDate, viewType, calendar);\n var eventSources = reduceEventSources(state.eventSources, action, dateProfile, calendar);\n var nextState = __assign({}, state, { viewType: viewType,\n dateProfile: dateProfile, currentDate: reduceCurrentDate(state.currentDate, action, dateProfile), eventSources: eventSources, eventStore: reduceEventStore(state.eventStore, action, eventSources, dateProfile, calendar), dateSelection: reduceDateSelection(state.dateSelection, action, calendar), eventSelection: reduceSelectedEvent(state.eventSelection, action), eventDrag: reduceEventDrag(state.eventDrag, action, eventSources, calendar), eventResize: reduceEventResize(state.eventResize, action, eventSources, calendar), eventSourceLoadingLevel: computeLoadingLevel(eventSources), loadingLevel: computeLoadingLevel(eventSources) });\n for (var _i = 0, _a = calendar.pluginSystem.hooks.reducers; _i < _a.length; _i++) {\n var reducerFunc = _a[_i];\n nextState = reducerFunc(nextState, action, calendar);\n }\n // console.log(action.type, nextState)\n return nextState;\n }\n function reduceViewType(currentViewType, action) {\n switch (action.type) {\n case 'SET_VIEW_TYPE':\n return action.viewType;\n default:\n return currentViewType;\n }\n }\n function reduceDateProfile(currentDateProfile, action, currentDate, viewType, calendar) {\n var newDateProfile;\n switch (action.type) {\n case 'PREV':\n newDateProfile = calendar.dateProfileGenerators[viewType].buildPrev(currentDateProfile, currentDate);\n break;\n case 'NEXT':\n newDateProfile = calendar.dateProfileGenerators[viewType].buildNext(currentDateProfile, currentDate);\n break;\n case 'SET_DATE':\n if (!currentDateProfile.activeRange ||\n !rangeContainsMarker(currentDateProfile.currentRange, action.dateMarker)) {\n newDateProfile = calendar.dateProfileGenerators[viewType].build(action.dateMarker, undefined, true // forceToValid\n );\n }\n break;\n case 'SET_VIEW_TYPE':\n var generator = calendar.dateProfileGenerators[viewType];\n if (!generator) {\n throw new Error(viewType ?\n 'The FullCalendar view \"' + viewType + '\" does not exist. Make sure your plugins are loaded correctly.' :\n 'No available FullCalendar view plugins.');\n }\n newDateProfile = generator.build(action.dateMarker || currentDate, undefined, true // forceToValid\n );\n break;\n }\n if (newDateProfile &&\n newDateProfile.isValid &&\n !(currentDateProfile && isDateProfilesEqual(currentDateProfile, newDateProfile))) {\n return newDateProfile;\n }\n else {\n return currentDateProfile;\n }\n }\n function reduceCurrentDate(currentDate, action, dateProfile) {\n switch (action.type) {\n case 'PREV':\n case 'NEXT':\n if (!rangeContainsMarker(dateProfile.currentRange, currentDate)) {\n return dateProfile.currentRange.start;\n }\n else {\n return currentDate;\n }\n case 'SET_DATE':\n case 'SET_VIEW_TYPE':\n var newDate = action.dateMarker || currentDate;\n if (dateProfile.activeRange && !rangeContainsMarker(dateProfile.activeRange, newDate)) {\n return dateProfile.currentRange.start;\n }\n else {\n return newDate;\n }\n default:\n return currentDate;\n }\n }\n function reduceDateSelection(currentSelection, action, calendar) {\n switch (action.type) {\n case 'SELECT_DATES':\n return action.selection;\n case 'UNSELECT_DATES':\n return null;\n default:\n return currentSelection;\n }\n }\n function reduceSelectedEvent(currentInstanceId, action) {\n switch (action.type) {\n case 'SELECT_EVENT':\n return action.eventInstanceId;\n case 'UNSELECT_EVENT':\n return '';\n default:\n return currentInstanceId;\n }\n }\n function reduceEventDrag(currentDrag, action, sources, calendar) {\n switch (action.type) {\n case 'SET_EVENT_DRAG':\n var newDrag = action.state;\n return {\n affectedEvents: newDrag.affectedEvents,\n mutatedEvents: newDrag.mutatedEvents,\n isEvent: newDrag.isEvent,\n origSeg: newDrag.origSeg\n };\n case 'UNSET_EVENT_DRAG':\n return null;\n default:\n return currentDrag;\n }\n }\n function reduceEventResize(currentResize, action, sources, calendar) {\n switch (action.type) {\n case 'SET_EVENT_RESIZE':\n var newResize = action.state;\n return {\n affectedEvents: newResize.affectedEvents,\n mutatedEvents: newResize.mutatedEvents,\n isEvent: newResize.isEvent,\n origSeg: newResize.origSeg\n };\n case 'UNSET_EVENT_RESIZE':\n return null;\n default:\n return currentResize;\n }\n }\n function computeLoadingLevel(eventSources) {\n var cnt = 0;\n for (var sourceId in eventSources) {\n if (eventSources[sourceId].isFetching) {\n cnt++;\n }\n }\n return cnt;\n }\n\n var STANDARD_PROPS = {\n start: null,\n end: null,\n allDay: Boolean\n };\n function parseDateSpan(raw, dateEnv, defaultDuration) {\n var span = parseOpenDateSpan(raw, dateEnv);\n var range = span.range;\n if (!range.start) {\n return null;\n }\n if (!range.end) {\n if (defaultDuration == null) {\n return null;\n }\n else {\n range.end = dateEnv.add(range.start, defaultDuration);\n }\n }\n return span;\n }\n /*\n TODO: somehow combine with parseRange?\n Will return null if the start/end props were present but parsed invalidly.\n */\n function parseOpenDateSpan(raw, dateEnv) {\n var leftovers = {};\n var standardProps = refineProps(raw, STANDARD_PROPS, {}, leftovers);\n var startMeta = standardProps.start ? dateEnv.createMarkerMeta(standardProps.start) : null;\n var endMeta = standardProps.end ? dateEnv.createMarkerMeta(standardProps.end) : null;\n var allDay = standardProps.allDay;\n if (allDay == null) {\n allDay = (startMeta && startMeta.isTimeUnspecified) &&\n (!endMeta || endMeta.isTimeUnspecified);\n }\n // use this leftover object as the selection object\n leftovers.range = {\n start: startMeta ? startMeta.marker : null,\n end: endMeta ? endMeta.marker : null\n };\n leftovers.allDay = allDay;\n return leftovers;\n }\n function isDateSpansEqual(span0, span1) {\n return rangesEqual(span0.range, span1.range) &&\n span0.allDay === span1.allDay &&\n isSpanPropsEqual(span0, span1);\n }\n // the NON-DATE-RELATED props\n function isSpanPropsEqual(span0, span1) {\n for (var propName in span1) {\n if (propName !== 'range' && propName !== 'allDay') {\n if (span0[propName] !== span1[propName]) {\n return false;\n }\n }\n }\n // are there any props that span0 has that span1 DOESN'T have?\n // both have range/allDay, so no need to special-case.\n for (var propName in span0) {\n if (!(propName in span1)) {\n return false;\n }\n }\n return true;\n }\n function buildDateSpanApi(span, dateEnv) {\n return {\n start: dateEnv.toDate(span.range.start),\n end: dateEnv.toDate(span.range.end),\n startStr: dateEnv.formatIso(span.range.start, { omitTime: span.allDay }),\n endStr: dateEnv.formatIso(span.range.end, { omitTime: span.allDay }),\n allDay: span.allDay\n };\n }\n function buildDatePointApi(span, dateEnv) {\n return {\n date: dateEnv.toDate(span.range.start),\n dateStr: dateEnv.formatIso(span.range.start, { omitTime: span.allDay }),\n allDay: span.allDay\n };\n }\n function fabricateEventRange(dateSpan, eventUiBases, calendar) {\n var def = parseEventDef({ editable: false }, '', // sourceId\n dateSpan.allDay, true, // hasEnd\n calendar);\n return {\n def: def,\n ui: compileEventUi(def, eventUiBases),\n instance: createEventInstance(def.defId, dateSpan.range),\n range: dateSpan.range,\n isStart: true,\n isEnd: true\n };\n }\n\n function compileViewDefs(defaultConfigs, overrideConfigs) {\n var hash = {};\n var viewType;\n for (viewType in defaultConfigs) {\n ensureViewDef(viewType, hash, defaultConfigs, overrideConfigs);\n }\n for (viewType in overrideConfigs) {\n ensureViewDef(viewType, hash, defaultConfigs, overrideConfigs);\n }\n return hash;\n }\n function ensureViewDef(viewType, hash, defaultConfigs, overrideConfigs) {\n if (hash[viewType]) {\n return hash[viewType];\n }\n var viewDef = buildViewDef(viewType, hash, defaultConfigs, overrideConfigs);\n if (viewDef) {\n hash[viewType] = viewDef;\n }\n return viewDef;\n }\n function buildViewDef(viewType, hash, defaultConfigs, overrideConfigs) {\n var defaultConfig = defaultConfigs[viewType];\n var overrideConfig = overrideConfigs[viewType];\n var queryProp = function (name) {\n return (defaultConfig && defaultConfig[name] !== null) ? defaultConfig[name] :\n ((overrideConfig && overrideConfig[name] !== null) ? overrideConfig[name] : null);\n };\n var theClass = queryProp('class');\n var superType = queryProp('superType');\n if (!superType && theClass) {\n superType =\n findViewNameBySubclass(theClass, overrideConfigs) ||\n findViewNameBySubclass(theClass, defaultConfigs);\n }\n var superDef = null;\n if (superType) {\n if (superType === viewType) {\n throw new Error('Can\\'t have a custom view type that references itself');\n }\n superDef = ensureViewDef(superType, hash, defaultConfigs, overrideConfigs);\n }\n if (!theClass && superDef) {\n theClass = superDef.class;\n }\n if (!theClass) {\n return null; // don't throw a warning, might be settings for a single-unit view\n }\n return {\n type: viewType,\n class: theClass,\n defaults: __assign({}, (superDef ? superDef.defaults : {}), (defaultConfig ? defaultConfig.options : {})),\n overrides: __assign({}, (superDef ? superDef.overrides : {}), (overrideConfig ? overrideConfig.options : {}))\n };\n }\n function findViewNameBySubclass(viewSubclass, configs) {\n var superProto = Object.getPrototypeOf(viewSubclass.prototype);\n for (var viewType in configs) {\n var parsed = configs[viewType];\n // need DIRECT subclass, so instanceof won't do it\n if (parsed.class && parsed.class.prototype === superProto) {\n return viewType;\n }\n }\n return '';\n }\n\n function parseViewConfigs(inputs) {\n return mapHash(inputs, parseViewConfig);\n }\n var VIEW_DEF_PROPS = {\n type: String,\n class: null\n };\n function parseViewConfig(input) {\n if (typeof input === 'function') {\n input = { class: input };\n }\n var options = {};\n var props = refineProps(input, VIEW_DEF_PROPS, {}, options);\n return {\n superType: props.type,\n class: props.class,\n options: options\n };\n }\n\n function buildViewSpecs(defaultInputs, optionsManager) {\n var defaultConfigs = parseViewConfigs(defaultInputs);\n var overrideConfigs = parseViewConfigs(optionsManager.overrides.views);\n var viewDefs = compileViewDefs(defaultConfigs, overrideConfigs);\n return mapHash(viewDefs, function (viewDef) {\n return buildViewSpec(viewDef, overrideConfigs, optionsManager);\n });\n }\n function buildViewSpec(viewDef, overrideConfigs, optionsManager) {\n var durationInput = viewDef.overrides.duration ||\n viewDef.defaults.duration ||\n optionsManager.dynamicOverrides.duration ||\n optionsManager.overrides.duration;\n var duration = null;\n var durationUnit = '';\n var singleUnit = '';\n var singleUnitOverrides = {};\n if (durationInput) {\n duration = createDuration(durationInput);\n if (duration) { // valid?\n var denom = greatestDurationDenominator(duration, !getWeeksFromInput(durationInput));\n durationUnit = denom.unit;\n if (denom.value === 1) {\n singleUnit = durationUnit;\n singleUnitOverrides = overrideConfigs[durationUnit] ? overrideConfigs[durationUnit].options : {};\n }\n }\n }\n var queryButtonText = function (options) {\n var buttonTextMap = options.buttonText || {};\n var buttonTextKey = viewDef.defaults.buttonTextKey;\n if (buttonTextKey != null && buttonTextMap[buttonTextKey] != null) {\n return buttonTextMap[buttonTextKey];\n }\n if (buttonTextMap[viewDef.type] != null) {\n return buttonTextMap[viewDef.type];\n }\n if (buttonTextMap[singleUnit] != null) {\n return buttonTextMap[singleUnit];\n }\n };\n return {\n type: viewDef.type,\n class: viewDef.class,\n duration: duration,\n durationUnit: durationUnit,\n singleUnit: singleUnit,\n options: __assign({}, globalDefaults, viewDef.defaults, optionsManager.dirDefaults, optionsManager.localeDefaults, optionsManager.overrides, singleUnitOverrides, viewDef.overrides, optionsManager.dynamicOverrides),\n buttonTextOverride: queryButtonText(optionsManager.dynamicOverrides) ||\n queryButtonText(optionsManager.overrides) || // constructor-specified buttonText lookup hash takes precedence\n viewDef.overrides.buttonText,\n buttonTextDefault: queryButtonText(optionsManager.localeDefaults) ||\n queryButtonText(optionsManager.dirDefaults) ||\n viewDef.defaults.buttonText ||\n queryButtonText(globalDefaults) ||\n viewDef.type // fall back to given view name\n };\n }\n\n var Toolbar = /** @class */ (function (_super) {\n __extends(Toolbar, _super);\n function Toolbar(extraClassName) {\n var _this = _super.call(this) || this;\n _this._renderLayout = memoizeRendering(_this.renderLayout, _this.unrenderLayout);\n _this._updateTitle = memoizeRendering(_this.updateTitle, null, [_this._renderLayout]);\n _this._updateActiveButton = memoizeRendering(_this.updateActiveButton, null, [_this._renderLayout]);\n _this._updateToday = memoizeRendering(_this.updateToday, null, [_this._renderLayout]);\n _this._updatePrev = memoizeRendering(_this.updatePrev, null, [_this._renderLayout]);\n _this._updateNext = memoizeRendering(_this.updateNext, null, [_this._renderLayout]);\n _this.el = createElement('div', { className: 'fc-toolbar ' + extraClassName });\n return _this;\n }\n Toolbar.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this._renderLayout.unrender(); // should unrender everything else\n removeElement(this.el);\n };\n Toolbar.prototype.render = function (props) {\n this._renderLayout(props.layout);\n this._updateTitle(props.title);\n this._updateActiveButton(props.activeButton);\n this._updateToday(props.isTodayEnabled);\n this._updatePrev(props.isPrevEnabled);\n this._updateNext(props.isNextEnabled);\n };\n Toolbar.prototype.renderLayout = function (layout) {\n var el = this.el;\n this.viewsWithButtons = [];\n appendToElement(el, this.renderSection('left', layout.left));\n appendToElement(el, this.renderSection('center', layout.center));\n appendToElement(el, this.renderSection('right', layout.right));\n };\n Toolbar.prototype.unrenderLayout = function () {\n this.el.innerHTML = '';\n };\n Toolbar.prototype.renderSection = function (position, buttonStr) {\n var _this = this;\n var _a = this.context, theme = _a.theme, calendar = _a.calendar;\n var optionsManager = calendar.optionsManager;\n var viewSpecs = calendar.viewSpecs;\n var sectionEl = createElement('div', { className: 'fc-' + position });\n var calendarCustomButtons = optionsManager.computed.customButtons || {};\n var calendarButtonTextOverrides = optionsManager.overrides.buttonText || {};\n var calendarButtonText = optionsManager.computed.buttonText || {};\n if (buttonStr) {\n buttonStr.split(' ').forEach(function (buttonGroupStr, i) {\n var groupChildren = [];\n var isOnlyButtons = true;\n var groupEl;\n buttonGroupStr.split(',').forEach(function (buttonName, j) {\n var customButtonProps;\n var viewSpec;\n var buttonClick;\n var buttonIcon; // only one of these will be set\n var buttonText; // \"\n var buttonInnerHtml;\n var buttonClasses;\n var buttonEl;\n var buttonAriaAttr;\n if (buttonName === 'title') {\n groupChildren.push(htmlToElement('

 

')); // we always want it to take up height\n isOnlyButtons = false;\n }\n else {\n if ((customButtonProps = calendarCustomButtons[buttonName])) {\n buttonClick = function (ev) {\n if (customButtonProps.click) {\n customButtonProps.click.call(buttonEl, ev);\n }\n };\n (buttonIcon = theme.getCustomButtonIconClass(customButtonProps)) ||\n (buttonIcon = theme.getIconClass(buttonName)) ||\n (buttonText = customButtonProps.text);\n }\n else if ((viewSpec = viewSpecs[buttonName])) {\n _this.viewsWithButtons.push(buttonName);\n buttonClick = function () {\n calendar.changeView(buttonName);\n };\n (buttonText = viewSpec.buttonTextOverride) ||\n (buttonIcon = theme.getIconClass(buttonName)) ||\n (buttonText = viewSpec.buttonTextDefault);\n }\n else if (calendar[buttonName]) { // a calendar method\n buttonClick = function () {\n calendar[buttonName]();\n };\n (buttonText = calendarButtonTextOverrides[buttonName]) ||\n (buttonIcon = theme.getIconClass(buttonName)) ||\n (buttonText = calendarButtonText[buttonName]);\n // ^ everything else is considered default\n }\n if (buttonClick) {\n buttonClasses = [\n 'fc-' + buttonName + '-button',\n theme.getClass('button')\n ];\n if (buttonText) {\n buttonInnerHtml = htmlEscape(buttonText);\n buttonAriaAttr = '';\n }\n else if (buttonIcon) {\n buttonInnerHtml = \"\";\n buttonAriaAttr = ' aria-label=\"' + buttonName + '\"';\n }\n buttonEl = htmlToElement(// type=\"button\" so that it doesn't submit a form\n '');\n buttonEl.addEventListener('click', buttonClick);\n groupChildren.push(buttonEl);\n }\n }\n });\n if (groupChildren.length > 1) {\n groupEl = document.createElement('div');\n var buttonGroupClassName = theme.getClass('buttonGroup');\n if (isOnlyButtons && buttonGroupClassName) {\n groupEl.classList.add(buttonGroupClassName);\n }\n appendToElement(groupEl, groupChildren);\n sectionEl.appendChild(groupEl);\n }\n else {\n appendToElement(sectionEl, groupChildren); // 1 or 0 children\n }\n });\n }\n return sectionEl;\n };\n Toolbar.prototype.updateToday = function (isTodayEnabled) {\n this.toggleButtonEnabled('today', isTodayEnabled);\n };\n Toolbar.prototype.updatePrev = function (isPrevEnabled) {\n this.toggleButtonEnabled('prev', isPrevEnabled);\n };\n Toolbar.prototype.updateNext = function (isNextEnabled) {\n this.toggleButtonEnabled('next', isNextEnabled);\n };\n Toolbar.prototype.updateTitle = function (text) {\n findElements(this.el, 'h2').forEach(function (titleEl) {\n titleEl.innerText = text;\n });\n };\n Toolbar.prototype.updateActiveButton = function (buttonName) {\n var theme = this.context.theme;\n var className = theme.getClass('buttonActive');\n findElements(this.el, 'button').forEach(function (buttonEl) {\n if (buttonName && buttonEl.classList.contains('fc-' + buttonName + '-button')) {\n buttonEl.classList.add(className);\n }\n else {\n buttonEl.classList.remove(className);\n }\n });\n };\n Toolbar.prototype.toggleButtonEnabled = function (buttonName, bool) {\n findElements(this.el, '.fc-' + buttonName + '-button').forEach(function (buttonEl) {\n buttonEl.disabled = !bool;\n });\n };\n return Toolbar;\n }(Component));\n\n var CalendarComponent = /** @class */ (function (_super) {\n __extends(CalendarComponent, _super);\n function CalendarComponent(el) {\n var _this = _super.call(this) || this;\n _this.elClassNames = [];\n _this.renderSkeleton = memoizeRendering(_this._renderSkeleton, _this._unrenderSkeleton);\n _this.renderToolbars = memoizeRendering(_this._renderToolbars, _this._unrenderToolbars, [_this.renderSkeleton]);\n _this.buildComponentContext = memoize(buildComponentContext);\n _this.buildViewPropTransformers = memoize(buildViewPropTransformers);\n _this.el = el;\n _this.computeTitle = memoize(computeTitle);\n _this.parseBusinessHours = memoize(function (input) {\n return parseBusinessHours(input, _this.context.calendar);\n });\n return _this;\n }\n CalendarComponent.prototype.render = function (props, context) {\n this.freezeHeight();\n var title = this.computeTitle(props.dateProfile, props.viewSpec.options);\n this.renderSkeleton(context);\n this.renderToolbars(props.viewSpec, props.dateProfile, props.currentDate, title);\n this.renderView(props, title);\n this.updateSize();\n this.thawHeight();\n };\n CalendarComponent.prototype.destroy = function () {\n if (this.header) {\n this.header.destroy();\n }\n if (this.footer) {\n this.footer.destroy();\n }\n this.renderSkeleton.unrender(); // will call destroyView\n _super.prototype.destroy.call(this);\n };\n CalendarComponent.prototype._renderSkeleton = function (context) {\n this.updateElClassNames(context);\n prependToElement(this.el, this.contentEl = createElement('div', { className: 'fc-view-container' }));\n var calendar = context.calendar;\n for (var _i = 0, _a = calendar.pluginSystem.hooks.viewContainerModifiers; _i < _a.length; _i++) {\n var modifyViewContainer = _a[_i];\n modifyViewContainer(this.contentEl, calendar);\n }\n };\n CalendarComponent.prototype._unrenderSkeleton = function () {\n // weird to have this here\n if (this.view) {\n this.savedScroll = this.view.queryScroll();\n this.view.destroy();\n this.view = null;\n }\n removeElement(this.contentEl);\n this.removeElClassNames();\n };\n CalendarComponent.prototype.removeElClassNames = function () {\n var classList = this.el.classList;\n for (var _i = 0, _a = this.elClassNames; _i < _a.length; _i++) {\n var className = _a[_i];\n classList.remove(className);\n }\n this.elClassNames = [];\n };\n CalendarComponent.prototype.updateElClassNames = function (context) {\n this.removeElClassNames();\n var theme = context.theme, options = context.options;\n this.elClassNames = [\n 'fc',\n 'fc-' + options.dir,\n theme.getClass('widget')\n ];\n var classList = this.el.classList;\n for (var _i = 0, _a = this.elClassNames; _i < _a.length; _i++) {\n var className = _a[_i];\n classList.add(className);\n }\n };\n CalendarComponent.prototype._renderToolbars = function (viewSpec, dateProfile, currentDate, title) {\n var _a = this, context = _a.context, header = _a.header, footer = _a.footer;\n var options = context.options, calendar = context.calendar;\n var headerLayout = options.header;\n var footerLayout = options.footer;\n var dateProfileGenerator = this.props.dateProfileGenerator;\n var now = calendar.getNow();\n var todayInfo = dateProfileGenerator.build(now);\n var prevInfo = dateProfileGenerator.buildPrev(dateProfile, currentDate);\n var nextInfo = dateProfileGenerator.buildNext(dateProfile, currentDate);\n var toolbarProps = {\n title: title,\n activeButton: viewSpec.type,\n isTodayEnabled: todayInfo.isValid && !rangeContainsMarker(dateProfile.currentRange, now),\n isPrevEnabled: prevInfo.isValid,\n isNextEnabled: nextInfo.isValid\n };\n if (headerLayout) {\n if (!header) {\n header = this.header = new Toolbar('fc-header-toolbar');\n prependToElement(this.el, header.el);\n }\n header.receiveProps(__assign({ layout: headerLayout }, toolbarProps), context);\n }\n else if (header) {\n header.destroy();\n header = this.header = null;\n }\n if (footerLayout) {\n if (!footer) {\n footer = this.footer = new Toolbar('fc-footer-toolbar');\n appendToElement(this.el, footer.el);\n }\n footer.receiveProps(__assign({ layout: footerLayout }, toolbarProps), context);\n }\n else if (footer) {\n footer.destroy();\n footer = this.footer = null;\n }\n };\n CalendarComponent.prototype._unrenderToolbars = function () {\n if (this.header) {\n this.header.destroy();\n this.header = null;\n }\n if (this.footer) {\n this.footer.destroy();\n this.footer = null;\n }\n };\n CalendarComponent.prototype.renderView = function (props, title) {\n var view = this.view;\n var _a = this.context, calendar = _a.calendar, options = _a.options;\n var viewSpec = props.viewSpec, dateProfileGenerator = props.dateProfileGenerator;\n if (!view || view.viewSpec !== viewSpec) {\n if (view) {\n view.destroy();\n }\n view = this.view = new viewSpec['class'](viewSpec, this.contentEl);\n if (this.savedScroll) {\n view.addScroll(this.savedScroll, true);\n this.savedScroll = null;\n }\n }\n view.title = title; // for the API\n var viewProps = {\n dateProfileGenerator: dateProfileGenerator,\n dateProfile: props.dateProfile,\n businessHours: this.parseBusinessHours(viewSpec.options.businessHours),\n eventStore: props.eventStore,\n eventUiBases: props.eventUiBases,\n dateSelection: props.dateSelection,\n eventSelection: props.eventSelection,\n eventDrag: props.eventDrag,\n eventResize: props.eventResize\n };\n var transformers = this.buildViewPropTransformers(calendar.pluginSystem.hooks.viewPropsTransformers);\n for (var _i = 0, transformers_1 = transformers; _i < transformers_1.length; _i++) {\n var transformer = transformers_1[_i];\n __assign(viewProps, transformer.transform(viewProps, viewSpec, props, options));\n }\n view.receiveProps(viewProps, this.buildComponentContext(this.context, viewSpec, view));\n };\n // Sizing\n // -----------------------------------------------------------------------------------------------------------------\n CalendarComponent.prototype.updateSize = function (isResize) {\n if (isResize === void 0) { isResize = false; }\n var view = this.view;\n if (!view) {\n return; // why?\n }\n if (isResize || this.isHeightAuto == null) {\n this.computeHeightVars();\n }\n view.updateSize(isResize, this.viewHeight, this.isHeightAuto);\n view.updateNowIndicator(); // we need to guarantee this will run after updateSize\n view.popScroll(isResize);\n };\n CalendarComponent.prototype.computeHeightVars = function () {\n var calendar = this.context.calendar; // yuck. need to handle dynamic options\n var heightInput = calendar.opt('height');\n var contentHeightInput = calendar.opt('contentHeight');\n this.isHeightAuto = heightInput === 'auto' || contentHeightInput === 'auto';\n if (typeof contentHeightInput === 'number') { // exists and not 'auto'\n this.viewHeight = contentHeightInput;\n }\n else if (typeof contentHeightInput === 'function') { // exists and is a function\n this.viewHeight = contentHeightInput();\n }\n else if (typeof heightInput === 'number') { // exists and not 'auto'\n this.viewHeight = heightInput - this.queryToolbarsHeight();\n }\n else if (typeof heightInput === 'function') { // exists and is a function\n this.viewHeight = heightInput() - this.queryToolbarsHeight();\n }\n else if (heightInput === 'parent') { // set to height of parent element\n var parentEl = this.el.parentNode;\n this.viewHeight = parentEl.getBoundingClientRect().height - this.queryToolbarsHeight();\n }\n else {\n this.viewHeight = Math.round(this.contentEl.getBoundingClientRect().width /\n Math.max(calendar.opt('aspectRatio'), .5));\n }\n };\n CalendarComponent.prototype.queryToolbarsHeight = function () {\n var height = 0;\n if (this.header) {\n height += computeHeightAndMargins(this.header.el);\n }\n if (this.footer) {\n height += computeHeightAndMargins(this.footer.el);\n }\n return height;\n };\n // Height \"Freezing\"\n // -----------------------------------------------------------------------------------------------------------------\n CalendarComponent.prototype.freezeHeight = function () {\n applyStyle(this.el, {\n height: this.el.getBoundingClientRect().height,\n overflow: 'hidden'\n });\n };\n CalendarComponent.prototype.thawHeight = function () {\n applyStyle(this.el, {\n height: '',\n overflow: ''\n });\n };\n return CalendarComponent;\n }(Component));\n // Title and Date Formatting\n // -----------------------------------------------------------------------------------------------------------------\n // Computes what the title at the top of the calendar should be for this view\n function computeTitle(dateProfile, viewOptions) {\n var range;\n // for views that span a large unit of time, show the proper interval, ignoring stray days before and after\n if (/^(year|month)$/.test(dateProfile.currentRangeUnit)) {\n range = dateProfile.currentRange;\n }\n else { // for day units or smaller, use the actual day range\n range = dateProfile.activeRange;\n }\n return this.context.dateEnv.formatRange(range.start, range.end, createFormatter(viewOptions.titleFormat || computeTitleFormat(dateProfile), viewOptions.titleRangeSeparator), { isEndExclusive: dateProfile.isRangeAllDay });\n }\n // Generates the format string that should be used to generate the title for the current date range.\n // Attempts to compute the most appropriate format if not explicitly specified with `titleFormat`.\n function computeTitleFormat(dateProfile) {\n var currentRangeUnit = dateProfile.currentRangeUnit;\n if (currentRangeUnit === 'year') {\n return { year: 'numeric' };\n }\n else if (currentRangeUnit === 'month') {\n return { year: 'numeric', month: 'long' }; // like \"September 2014\"\n }\n else {\n var days = diffWholeDays(dateProfile.currentRange.start, dateProfile.currentRange.end);\n if (days !== null && days > 1) {\n // multi-day range. shorter, like \"Sep 9 - 10 2014\"\n return { year: 'numeric', month: 'short', day: 'numeric' };\n }\n else {\n // one day. longer, like \"September 9 2014\"\n return { year: 'numeric', month: 'long', day: 'numeric' };\n }\n }\n }\n // build a context scoped to the view\n function buildComponentContext(context, viewSpec, view) {\n return context.extend(viewSpec.options, view);\n }\n // Plugin\n // -----------------------------------------------------------------------------------------------------------------\n function buildViewPropTransformers(theClasses) {\n return theClasses.map(function (theClass) {\n return new theClass();\n });\n }\n\n var Interaction = /** @class */ (function () {\n function Interaction(settings) {\n this.component = settings.component;\n }\n Interaction.prototype.destroy = function () {\n };\n return Interaction;\n }());\n function parseInteractionSettings(component, input) {\n return {\n component: component,\n el: input.el,\n useEventCenter: input.useEventCenter != null ? input.useEventCenter : true\n };\n }\n function interactionSettingsToStore(settings) {\n var _a;\n return _a = {},\n _a[settings.component.uid] = settings,\n _a;\n }\n // global state\n var interactionSettingsStore = {};\n\n /*\n Detects when the user clicks on an event within a DateComponent\n */\n var EventClicking = /** @class */ (function (_super) {\n __extends(EventClicking, _super);\n function EventClicking(settings) {\n var _this = _super.call(this, settings) || this;\n _this.handleSegClick = function (ev, segEl) {\n var component = _this.component;\n var _a = component.context, calendar = _a.calendar, view = _a.view;\n var seg = getElSeg(segEl);\n if (seg && // might be the
surrounding the more link\n component.isValidSegDownEl(ev.target)) {\n // our way to simulate a link click for elements that can't be tags\n // grab before trigger fired in case trigger trashes DOM thru rerendering\n var hasUrlContainer = elementClosest(ev.target, '.fc-has-url');\n var url = hasUrlContainer ? hasUrlContainer.querySelector('a[href]').href : '';\n calendar.publiclyTrigger('eventClick', [\n {\n el: segEl,\n event: new EventApi(component.context.calendar, seg.eventRange.def, seg.eventRange.instance),\n jsEvent: ev,\n view: view\n }\n ]);\n if (url && !ev.defaultPrevented) {\n window.location.href = url;\n }\n }\n };\n var component = settings.component;\n _this.destroy = listenBySelector(component.el, 'click', component.fgSegSelector + ',' + component.bgSegSelector, _this.handleSegClick);\n return _this;\n }\n return EventClicking;\n }(Interaction));\n\n /*\n Triggers events and adds/removes core classNames when the user's pointer\n enters/leaves event-elements of a component.\n */\n var EventHovering = /** @class */ (function (_super) {\n __extends(EventHovering, _super);\n function EventHovering(settings) {\n var _this = _super.call(this, settings) || this;\n // for simulating an eventMouseLeave when the event el is destroyed while mouse is over it\n _this.handleEventElRemove = function (el) {\n if (el === _this.currentSegEl) {\n _this.handleSegLeave(null, _this.currentSegEl);\n }\n };\n _this.handleSegEnter = function (ev, segEl) {\n if (getElSeg(segEl)) { // TODO: better way to make sure not hovering over more+ link or its wrapper\n segEl.classList.add('fc-allow-mouse-resize');\n _this.currentSegEl = segEl;\n _this.triggerEvent('eventMouseEnter', ev, segEl);\n }\n };\n _this.handleSegLeave = function (ev, segEl) {\n if (_this.currentSegEl) {\n segEl.classList.remove('fc-allow-mouse-resize');\n _this.currentSegEl = null;\n _this.triggerEvent('eventMouseLeave', ev, segEl);\n }\n };\n var component = settings.component;\n _this.removeHoverListeners = listenToHoverBySelector(component.el, component.fgSegSelector + ',' + component.bgSegSelector, _this.handleSegEnter, _this.handleSegLeave);\n // how to make sure component already has context?\n component.context.calendar.on('eventElRemove', _this.handleEventElRemove);\n return _this;\n }\n EventHovering.prototype.destroy = function () {\n this.removeHoverListeners();\n this.component.context.calendar.off('eventElRemove', this.handleEventElRemove);\n };\n EventHovering.prototype.triggerEvent = function (publicEvName, ev, segEl) {\n var component = this.component;\n var _a = component.context, calendar = _a.calendar, view = _a.view;\n var seg = getElSeg(segEl);\n if (!ev || component.isValidSegDownEl(ev.target)) {\n calendar.publiclyTrigger(publicEvName, [\n {\n el: segEl,\n event: new EventApi(calendar, seg.eventRange.def, seg.eventRange.instance),\n jsEvent: ev,\n view: view\n }\n ]);\n }\n };\n return EventHovering;\n }(Interaction));\n\n var StandardTheme = /** @class */ (function (_super) {\n __extends(StandardTheme, _super);\n function StandardTheme() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return StandardTheme;\n }(Theme));\n StandardTheme.prototype.classes = {\n widget: 'fc-unthemed',\n widgetHeader: 'fc-widget-header',\n widgetContent: 'fc-widget-content',\n buttonGroup: 'fc-button-group',\n button: 'fc-button fc-button-primary',\n buttonActive: 'fc-button-active',\n popoverHeader: 'fc-widget-header',\n popoverContent: 'fc-widget-content',\n // day grid\n headerRow: 'fc-widget-header',\n dayRow: 'fc-widget-content',\n // list view\n listView: 'fc-widget-content'\n };\n StandardTheme.prototype.baseIconClass = 'fc-icon';\n StandardTheme.prototype.iconClasses = {\n close: 'fc-icon-x',\n prev: 'fc-icon-chevron-left',\n next: 'fc-icon-chevron-right',\n prevYear: 'fc-icon-chevrons-left',\n nextYear: 'fc-icon-chevrons-right'\n };\n StandardTheme.prototype.iconOverrideOption = 'buttonIcons';\n StandardTheme.prototype.iconOverrideCustomButtonOption = 'icon';\n StandardTheme.prototype.iconOverridePrefix = 'fc-icon-';\n\n var Calendar = /** @class */ (function () {\n function Calendar(el, overrides) {\n var _this = this;\n this.buildComponentContext = memoize(buildComponentContext$1);\n this.parseRawLocales = memoize(parseRawLocales);\n this.buildLocale = memoize(buildLocale);\n this.buildDateEnv = memoize(buildDateEnv);\n this.buildTheme = memoize(buildTheme);\n this.buildEventUiSingleBase = memoize(this._buildEventUiSingleBase);\n this.buildSelectionConfig = memoize(this._buildSelectionConfig);\n this.buildEventUiBySource = memoizeOutput(buildEventUiBySource, isPropsEqual);\n this.buildEventUiBases = memoize(buildEventUiBases);\n this.interactionsStore = {};\n this.actionQueue = [];\n this.isReducing = false;\n // isDisplaying: boolean = false // installed in DOM? accepting renders?\n this.needsRerender = false; // needs a render?\n this.isRendering = false; // currently in the executeRender function?\n this.renderingPauseDepth = 0;\n this.buildDelayedRerender = memoize(buildDelayedRerender);\n this.afterSizingTriggers = {};\n this.isViewUpdated = false;\n this.isDatesUpdated = false;\n this.isEventsUpdated = false;\n this.el = el;\n this.optionsManager = new OptionsManager(overrides || {});\n this.pluginSystem = new PluginSystem();\n // only do once. don't do in handleOptions. because can't remove plugins\n this.addPluginInputs(this.optionsManager.computed.plugins || []);\n this.handleOptions(this.optionsManager.computed);\n this.publiclyTrigger('_init'); // for tests\n this.hydrate();\n this.calendarInteractions = this.pluginSystem.hooks.calendarInteractions\n .map(function (calendarInteractionClass) {\n return new calendarInteractionClass(_this);\n });\n }\n Calendar.prototype.addPluginInputs = function (pluginInputs) {\n var pluginDefs = refinePluginDefs(pluginInputs);\n for (var _i = 0, pluginDefs_1 = pluginDefs; _i < pluginDefs_1.length; _i++) {\n var pluginDef = pluginDefs_1[_i];\n this.pluginSystem.add(pluginDef);\n }\n };\n Object.defineProperty(Calendar.prototype, \"view\", {\n // public API\n get: function () {\n return this.component ? this.component.view : null;\n },\n enumerable: true,\n configurable: true\n });\n // Public API for rendering\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.render = function () {\n if (!this.component) {\n this.component = new CalendarComponent(this.el);\n this.renderableEventStore = createEmptyEventStore();\n this.bindHandlers();\n this.executeRender();\n }\n else {\n this.requestRerender();\n }\n };\n Calendar.prototype.destroy = function () {\n if (this.component) {\n this.unbindHandlers();\n this.component.destroy(); // don't null-out. in case API needs access\n this.component = null; // umm ???\n for (var _i = 0, _a = this.calendarInteractions; _i < _a.length; _i++) {\n var interaction = _a[_i];\n interaction.destroy();\n }\n this.publiclyTrigger('_destroyed');\n }\n };\n // Handlers\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.bindHandlers = function () {\n var _this = this;\n // event delegation for nav links\n this.removeNavLinkListener = listenBySelector(this.el, 'click', 'a[data-goto]', function (ev, anchorEl) {\n var gotoOptions = anchorEl.getAttribute('data-goto');\n gotoOptions = gotoOptions ? JSON.parse(gotoOptions) : {};\n var dateEnv = _this.dateEnv;\n var dateMarker = dateEnv.createMarker(gotoOptions.date);\n var viewType = gotoOptions.type;\n // property like \"navLinkDayClick\". might be a string or a function\n var customAction = _this.viewOpt('navLink' + capitaliseFirstLetter(viewType) + 'Click');\n if (typeof customAction === 'function') {\n customAction(dateEnv.toDate(dateMarker), ev);\n }\n else {\n if (typeof customAction === 'string') {\n viewType = customAction;\n }\n _this.zoomTo(dateMarker, viewType);\n }\n });\n if (this.opt('handleWindowResize')) {\n window.addEventListener('resize', this.windowResizeProxy = debounce(// prevents rapid calls\n this.windowResize.bind(this), this.opt('windowResizeDelay')));\n }\n };\n Calendar.prototype.unbindHandlers = function () {\n this.removeNavLinkListener();\n if (this.windowResizeProxy) {\n window.removeEventListener('resize', this.windowResizeProxy);\n this.windowResizeProxy = null;\n }\n };\n // Dispatcher\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.hydrate = function () {\n var _this = this;\n this.state = this.buildInitialState();\n var rawSources = this.opt('eventSources') || [];\n var singleRawSource = this.opt('events');\n var sources = []; // parsed\n if (singleRawSource) {\n rawSources.unshift(singleRawSource);\n }\n for (var _i = 0, rawSources_1 = rawSources; _i < rawSources_1.length; _i++) {\n var rawSource = rawSources_1[_i];\n var source = parseEventSource(rawSource, this);\n if (source) {\n sources.push(source);\n }\n }\n this.batchRendering(function () {\n _this.dispatch({ type: 'INIT' }); // pass in sources here?\n _this.dispatch({ type: 'ADD_EVENT_SOURCES', sources: sources });\n _this.dispatch({\n type: 'SET_VIEW_TYPE',\n viewType: _this.opt('defaultView') || _this.pluginSystem.hooks.defaultView\n });\n });\n };\n Calendar.prototype.buildInitialState = function () {\n return {\n viewType: null,\n loadingLevel: 0,\n eventSourceLoadingLevel: 0,\n currentDate: this.getInitialDate(),\n dateProfile: null,\n eventSources: {},\n eventStore: createEmptyEventStore(),\n dateSelection: null,\n eventSelection: '',\n eventDrag: null,\n eventResize: null\n };\n };\n Calendar.prototype.dispatch = function (action) {\n this.actionQueue.push(action);\n if (!this.isReducing) {\n this.isReducing = true;\n var oldState = this.state;\n while (this.actionQueue.length) {\n this.state = this.reduce(this.state, this.actionQueue.shift(), this);\n }\n var newState = this.state;\n this.isReducing = false;\n if (!oldState.loadingLevel && newState.loadingLevel) {\n this.publiclyTrigger('loading', [true]);\n }\n else if (oldState.loadingLevel && !newState.loadingLevel) {\n this.publiclyTrigger('loading', [false]);\n }\n var view = this.component && this.component.view;\n if (oldState.eventStore !== newState.eventStore) {\n if (oldState.eventStore) {\n this.isEventsUpdated = true;\n }\n }\n if (oldState.dateProfile !== newState.dateProfile) {\n if (oldState.dateProfile && view) { // why would view be null!?\n this.publiclyTrigger('datesDestroy', [\n {\n view: view,\n el: view.el\n }\n ]);\n }\n this.isDatesUpdated = true;\n }\n if (oldState.viewType !== newState.viewType) {\n if (oldState.viewType && view) { // why would view be null!?\n this.publiclyTrigger('viewSkeletonDestroy', [\n {\n view: view,\n el: view.el\n }\n ]);\n }\n this.isViewUpdated = true;\n }\n this.requestRerender();\n }\n };\n Calendar.prototype.reduce = function (state, action, calendar) {\n return reduce(state, action, calendar);\n };\n // Render Queue\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.requestRerender = function () {\n this.needsRerender = true;\n this.delayedRerender(); // will call a debounced-version of tryRerender\n };\n Calendar.prototype.tryRerender = function () {\n if (this.component && // must be accepting renders\n this.needsRerender && // indicates that a rerender was requested\n !this.renderingPauseDepth && // not paused\n !this.isRendering // not currently in the render loop\n ) {\n this.executeRender();\n }\n };\n Calendar.prototype.batchRendering = function (func) {\n this.renderingPauseDepth++;\n func();\n this.renderingPauseDepth--;\n if (this.needsRerender) {\n this.requestRerender();\n }\n };\n // Rendering\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.executeRender = function () {\n // clear these BEFORE the render so that new values will accumulate during render\n this.needsRerender = false;\n this.isRendering = true;\n this.renderComponent();\n this.isRendering = false;\n // received a rerender request while rendering\n if (this.needsRerender) {\n this.delayedRerender();\n }\n };\n /*\n don't call this directly. use executeRender instead\n */\n Calendar.prototype.renderComponent = function () {\n var _a = this, state = _a.state, component = _a.component;\n var viewType = state.viewType;\n var viewSpec = this.viewSpecs[viewType];\n if (!viewSpec) {\n throw new Error(\"View type \\\"\" + viewType + \"\\\" is not valid\");\n }\n // if event sources are still loading and progressive rendering hasn't been enabled,\n // keep rendering the last fully loaded set of events\n var renderableEventStore = this.renderableEventStore =\n (state.eventSourceLoadingLevel && !this.opt('progressiveEventRendering')) ?\n this.renderableEventStore :\n state.eventStore;\n var eventUiSingleBase = this.buildEventUiSingleBase(viewSpec.options);\n var eventUiBySource = this.buildEventUiBySource(state.eventSources);\n var eventUiBases = this.eventUiBases = this.buildEventUiBases(renderableEventStore.defs, eventUiSingleBase, eventUiBySource);\n component.receiveProps(__assign({}, state, { viewSpec: viewSpec, dateProfileGenerator: this.dateProfileGenerators[viewType], dateProfile: state.dateProfile, eventStore: renderableEventStore, eventUiBases: eventUiBases, dateSelection: state.dateSelection, eventSelection: state.eventSelection, eventDrag: state.eventDrag, eventResize: state.eventResize }), this.buildComponentContext(this.theme, this.dateEnv, this.optionsManager.computed));\n if (this.isViewUpdated) {\n this.isViewUpdated = false;\n this.publiclyTrigger('viewSkeletonRender', [\n {\n view: component.view,\n el: component.view.el\n }\n ]);\n }\n if (this.isDatesUpdated) {\n this.isDatesUpdated = false;\n this.publiclyTrigger('datesRender', [\n {\n view: component.view,\n el: component.view.el\n }\n ]);\n }\n if (this.isEventsUpdated) {\n this.isEventsUpdated = false;\n }\n this.releaseAfterSizingTriggers();\n };\n // Options\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.setOption = function (name, val) {\n var _a;\n this.mutateOptions((_a = {}, _a[name] = val, _a), [], true);\n };\n Calendar.prototype.getOption = function (name) {\n return this.optionsManager.computed[name];\n };\n Calendar.prototype.opt = function (name) {\n return this.optionsManager.computed[name];\n };\n Calendar.prototype.viewOpt = function (name) {\n return this.viewOpts()[name];\n };\n Calendar.prototype.viewOpts = function () {\n return this.viewSpecs[this.state.viewType].options;\n };\n /*\n handles option changes (like a diff)\n */\n Calendar.prototype.mutateOptions = function (updates, removals, isDynamic, deepEqual) {\n var _this = this;\n var changeHandlers = this.pluginSystem.hooks.optionChangeHandlers;\n var normalUpdates = {};\n var specialUpdates = {};\n var oldDateEnv = this.dateEnv; // do this before handleOptions\n var isTimeZoneDirty = false;\n var isSizeDirty = false;\n var anyDifficultOptions = Boolean(removals.length);\n for (var name_1 in updates) {\n if (changeHandlers[name_1]) {\n specialUpdates[name_1] = updates[name_1];\n }\n else {\n normalUpdates[name_1] = updates[name_1];\n }\n }\n for (var name_2 in normalUpdates) {\n if (/^(height|contentHeight|aspectRatio)$/.test(name_2)) {\n isSizeDirty = true;\n }\n else if (/^(defaultDate|defaultView)$/.test(name_2)) ;\n else {\n anyDifficultOptions = true;\n if (name_2 === 'timeZone') {\n isTimeZoneDirty = true;\n }\n }\n }\n this.optionsManager.mutate(normalUpdates, removals, isDynamic);\n if (anyDifficultOptions) {\n this.handleOptions(this.optionsManager.computed);\n }\n this.batchRendering(function () {\n if (anyDifficultOptions) {\n if (isTimeZoneDirty) {\n _this.dispatch({\n type: 'CHANGE_TIMEZONE',\n oldDateEnv: oldDateEnv\n });\n }\n /* HACK\n has the same effect as calling this.requestRerender()\n but recomputes the state's dateProfile\n */\n _this.dispatch({\n type: 'SET_VIEW_TYPE',\n viewType: _this.state.viewType\n });\n }\n else if (isSizeDirty) {\n _this.updateSize();\n }\n // special updates\n if (deepEqual) {\n for (var name_3 in specialUpdates) {\n changeHandlers[name_3](specialUpdates[name_3], _this, deepEqual);\n }\n }\n });\n };\n /*\n rebuilds things based off of a complete set of refined options\n */\n Calendar.prototype.handleOptions = function (options) {\n var _this = this;\n var pluginHooks = this.pluginSystem.hooks;\n this.defaultAllDayEventDuration = createDuration(options.defaultAllDayEventDuration);\n this.defaultTimedEventDuration = createDuration(options.defaultTimedEventDuration);\n this.delayedRerender = this.buildDelayedRerender(options.rerenderDelay);\n this.theme = this.buildTheme(options);\n var available = this.parseRawLocales(options.locales);\n this.availableRawLocales = available.map;\n var locale = this.buildLocale(options.locale || available.defaultCode, available.map);\n this.dateEnv = this.buildDateEnv(locale, options.timeZone, pluginHooks.namedTimeZonedImpl, options.firstDay, options.weekNumberCalculation, options.weekLabel, pluginHooks.cmdFormatter);\n this.selectionConfig = this.buildSelectionConfig(options); // needs dateEnv. do after :(\n // ineffecient to do every time?\n this.viewSpecs = buildViewSpecs(pluginHooks.views, this.optionsManager);\n // ineffecient to do every time?\n this.dateProfileGenerators = mapHash(this.viewSpecs, function (viewSpec) {\n return new viewSpec.class.prototype.dateProfileGeneratorClass(viewSpec, _this);\n });\n };\n Calendar.prototype.getAvailableLocaleCodes = function () {\n return Object.keys(this.availableRawLocales);\n };\n Calendar.prototype._buildSelectionConfig = function (rawOpts) {\n return processScopedUiProps('select', rawOpts, this);\n };\n Calendar.prototype._buildEventUiSingleBase = function (rawOpts) {\n if (rawOpts.editable) { // so 'editable' affected events\n rawOpts = __assign({}, rawOpts, { eventEditable: true });\n }\n return processScopedUiProps('event', rawOpts, this);\n };\n // Trigger\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.hasPublicHandlers = function (name) {\n return this.hasHandlers(name) ||\n this.opt(name); // handler specified in options\n };\n Calendar.prototype.publiclyTrigger = function (name, args) {\n var optHandler = this.opt(name);\n this.triggerWith(name, this, args);\n if (optHandler) {\n return optHandler.apply(this, args);\n }\n };\n Calendar.prototype.publiclyTriggerAfterSizing = function (name, args) {\n var afterSizingTriggers = this.afterSizingTriggers;\n (afterSizingTriggers[name] || (afterSizingTriggers[name] = [])).push(args);\n };\n Calendar.prototype.releaseAfterSizingTriggers = function () {\n var afterSizingTriggers = this.afterSizingTriggers;\n for (var name_4 in afterSizingTriggers) {\n for (var _i = 0, _a = afterSizingTriggers[name_4]; _i < _a.length; _i++) {\n var args = _a[_i];\n this.publiclyTrigger(name_4, args);\n }\n }\n this.afterSizingTriggers = {};\n };\n // View\n // -----------------------------------------------------------------------------------------------------------------\n // Returns a boolean about whether the view is okay to instantiate at some point\n Calendar.prototype.isValidViewType = function (viewType) {\n return Boolean(this.viewSpecs[viewType]);\n };\n Calendar.prototype.changeView = function (viewType, dateOrRange) {\n var dateMarker = null;\n if (dateOrRange) {\n if (dateOrRange.start && dateOrRange.end) { // a range\n this.optionsManager.mutate({ visibleRange: dateOrRange }, []); // will not rerender\n this.handleOptions(this.optionsManager.computed); // ...but yuck\n }\n else { // a date\n dateMarker = this.dateEnv.createMarker(dateOrRange); // just like gotoDate\n }\n }\n this.unselect();\n this.dispatch({\n type: 'SET_VIEW_TYPE',\n viewType: viewType,\n dateMarker: dateMarker\n });\n };\n // Forces navigation to a view for the given date.\n // `viewType` can be a specific view name or a generic one like \"week\" or \"day\".\n // needs to change\n Calendar.prototype.zoomTo = function (dateMarker, viewType) {\n var spec;\n viewType = viewType || 'day'; // day is default zoom\n spec = this.viewSpecs[viewType] ||\n this.getUnitViewSpec(viewType);\n this.unselect();\n if (spec) {\n this.dispatch({\n type: 'SET_VIEW_TYPE',\n viewType: spec.type,\n dateMarker: dateMarker\n });\n }\n else {\n this.dispatch({\n type: 'SET_DATE',\n dateMarker: dateMarker\n });\n }\n };\n // Given a duration singular unit, like \"week\" or \"day\", finds a matching view spec.\n // Preference is given to views that have corresponding buttons.\n Calendar.prototype.getUnitViewSpec = function (unit) {\n var component = this.component;\n var viewTypes = [];\n var i;\n var spec;\n // put views that have buttons first. there will be duplicates, but oh\n if (component.header) {\n viewTypes.push.apply(viewTypes, component.header.viewsWithButtons);\n }\n if (component.footer) {\n viewTypes.push.apply(viewTypes, component.footer.viewsWithButtons);\n }\n for (var viewType in this.viewSpecs) {\n viewTypes.push(viewType);\n }\n for (i = 0; i < viewTypes.length; i++) {\n spec = this.viewSpecs[viewTypes[i]];\n if (spec) {\n if (spec.singleUnit === unit) {\n return spec;\n }\n }\n }\n };\n // Current Date\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.getInitialDate = function () {\n var defaultDateInput = this.opt('defaultDate');\n // compute the initial ambig-timezone date\n if (defaultDateInput != null) {\n return this.dateEnv.createMarker(defaultDateInput);\n }\n else {\n return this.getNow(); // getNow already returns unzoned\n }\n };\n Calendar.prototype.prev = function () {\n this.unselect();\n this.dispatch({ type: 'PREV' });\n };\n Calendar.prototype.next = function () {\n this.unselect();\n this.dispatch({ type: 'NEXT' });\n };\n Calendar.prototype.prevYear = function () {\n this.unselect();\n this.dispatch({\n type: 'SET_DATE',\n dateMarker: this.dateEnv.addYears(this.state.currentDate, -1)\n });\n };\n Calendar.prototype.nextYear = function () {\n this.unselect();\n this.dispatch({\n type: 'SET_DATE',\n dateMarker: this.dateEnv.addYears(this.state.currentDate, 1)\n });\n };\n Calendar.prototype.today = function () {\n this.unselect();\n this.dispatch({\n type: 'SET_DATE',\n dateMarker: this.getNow()\n });\n };\n Calendar.prototype.gotoDate = function (zonedDateInput) {\n this.unselect();\n this.dispatch({\n type: 'SET_DATE',\n dateMarker: this.dateEnv.createMarker(zonedDateInput)\n });\n };\n Calendar.prototype.incrementDate = function (deltaInput) {\n var delta = createDuration(deltaInput);\n if (delta) { // else, warn about invalid input?\n this.unselect();\n this.dispatch({\n type: 'SET_DATE',\n dateMarker: this.dateEnv.add(this.state.currentDate, delta)\n });\n }\n };\n // for external API\n Calendar.prototype.getDate = function () {\n return this.dateEnv.toDate(this.state.currentDate);\n };\n // Date Formatting Utils\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.formatDate = function (d, formatter) {\n var dateEnv = this.dateEnv;\n return dateEnv.format(dateEnv.createMarker(d), createFormatter(formatter));\n };\n // `settings` is for formatter AND isEndExclusive\n Calendar.prototype.formatRange = function (d0, d1, settings) {\n var dateEnv = this.dateEnv;\n return dateEnv.formatRange(dateEnv.createMarker(d0), dateEnv.createMarker(d1), createFormatter(settings, this.opt('defaultRangeSeparator')), settings);\n };\n Calendar.prototype.formatIso = function (d, omitTime) {\n var dateEnv = this.dateEnv;\n return dateEnv.formatIso(dateEnv.createMarker(d), { omitTime: omitTime });\n };\n // Sizing\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.windowResize = function (ev) {\n if (!this.isHandlingWindowResize &&\n this.component && // why?\n ev.target === window // not a jqui resize event\n ) {\n this.isHandlingWindowResize = true;\n this.updateSize();\n this.publiclyTrigger('windowResize', [this.view]);\n this.isHandlingWindowResize = false;\n }\n };\n Calendar.prototype.updateSize = function () {\n if (this.component) { // when?\n this.component.updateSize(true);\n }\n };\n // Component Registration\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.registerInteractiveComponent = function (component, settingsInput) {\n var settings = parseInteractionSettings(component, settingsInput);\n var DEFAULT_INTERACTIONS = [\n EventClicking,\n EventHovering\n ];\n var interactionClasses = DEFAULT_INTERACTIONS.concat(this.pluginSystem.hooks.componentInteractions);\n var interactions = interactionClasses.map(function (interactionClass) {\n return new interactionClass(settings);\n });\n this.interactionsStore[component.uid] = interactions;\n interactionSettingsStore[component.uid] = settings;\n };\n Calendar.prototype.unregisterInteractiveComponent = function (component) {\n for (var _i = 0, _a = this.interactionsStore[component.uid]; _i < _a.length; _i++) {\n var listener = _a[_i];\n listener.destroy();\n }\n delete this.interactionsStore[component.uid];\n delete interactionSettingsStore[component.uid];\n };\n // Date Selection / Event Selection / DayClick\n // -----------------------------------------------------------------------------------------------------------------\n // this public method receives start/end dates in any format, with any timezone\n // NOTE: args were changed from v3\n Calendar.prototype.select = function (dateOrObj, endDate) {\n var selectionInput;\n if (endDate == null) {\n if (dateOrObj.start != null) {\n selectionInput = dateOrObj;\n }\n else {\n selectionInput = {\n start: dateOrObj,\n end: null\n };\n }\n }\n else {\n selectionInput = {\n start: dateOrObj,\n end: endDate\n };\n }\n var selection = parseDateSpan(selectionInput, this.dateEnv, createDuration({ days: 1 }) // TODO: cache this?\n );\n if (selection) { // throw parse error otherwise?\n this.dispatch({ type: 'SELECT_DATES', selection: selection });\n this.triggerDateSelect(selection);\n }\n };\n // public method\n Calendar.prototype.unselect = function (pev) {\n if (this.state.dateSelection) {\n this.dispatch({ type: 'UNSELECT_DATES' });\n this.triggerDateUnselect(pev);\n }\n };\n Calendar.prototype.triggerDateSelect = function (selection, pev) {\n var arg = __assign({}, this.buildDateSpanApi(selection), { jsEvent: pev ? pev.origEvent : null, view: this.view });\n this.publiclyTrigger('select', [arg]);\n };\n Calendar.prototype.triggerDateUnselect = function (pev) {\n this.publiclyTrigger('unselect', [\n {\n jsEvent: pev ? pev.origEvent : null,\n view: this.view\n }\n ]);\n };\n // TODO: receive pev?\n Calendar.prototype.triggerDateClick = function (dateSpan, dayEl, view, ev) {\n var arg = __assign({}, this.buildDatePointApi(dateSpan), { dayEl: dayEl, jsEvent: ev, // Is this always a mouse event? See #4655\n view: view });\n this.publiclyTrigger('dateClick', [arg]);\n };\n Calendar.prototype.buildDatePointApi = function (dateSpan) {\n var props = {};\n for (var _i = 0, _a = this.pluginSystem.hooks.datePointTransforms; _i < _a.length; _i++) {\n var transform = _a[_i];\n __assign(props, transform(dateSpan, this));\n }\n __assign(props, buildDatePointApi(dateSpan, this.dateEnv));\n return props;\n };\n Calendar.prototype.buildDateSpanApi = function (dateSpan) {\n var props = {};\n for (var _i = 0, _a = this.pluginSystem.hooks.dateSpanTransforms; _i < _a.length; _i++) {\n var transform = _a[_i];\n __assign(props, transform(dateSpan, this));\n }\n __assign(props, buildDateSpanApi(dateSpan, this.dateEnv));\n return props;\n };\n // Date Utils\n // -----------------------------------------------------------------------------------------------------------------\n // Returns a DateMarker for the current date, as defined by the client's computer or from the `now` option\n Calendar.prototype.getNow = function () {\n var now = this.opt('now');\n if (typeof now === 'function') {\n now = now();\n }\n if (now == null) {\n return this.dateEnv.createNowMarker();\n }\n return this.dateEnv.createMarker(now);\n };\n // Event-Date Utilities\n // -----------------------------------------------------------------------------------------------------------------\n // Given an event's allDay status and start date, return what its fallback end date should be.\n // TODO: rename to computeDefaultEventEnd\n Calendar.prototype.getDefaultEventEnd = function (allDay, marker) {\n var end = marker;\n if (allDay) {\n end = startOfDay(end);\n end = this.dateEnv.add(end, this.defaultAllDayEventDuration);\n }\n else {\n end = this.dateEnv.add(end, this.defaultTimedEventDuration);\n }\n return end;\n };\n // Public Events API\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.addEvent = function (eventInput, sourceInput) {\n if (eventInput instanceof EventApi) {\n var def = eventInput._def;\n var instance = eventInput._instance;\n // not already present? don't want to add an old snapshot\n if (!this.state.eventStore.defs[def.defId]) {\n this.dispatch({\n type: 'ADD_EVENTS',\n eventStore: eventTupleToStore({ def: def, instance: instance }) // TODO: better util for two args?\n });\n }\n return eventInput;\n }\n var sourceId;\n if (sourceInput instanceof EventSourceApi) {\n sourceId = sourceInput.internalEventSource.sourceId;\n }\n else if (sourceInput != null) {\n var sourceApi = this.getEventSourceById(sourceInput); // TODO: use an internal function\n if (!sourceApi) {\n console.warn('Could not find an event source with ID \"' + sourceInput + '\"'); // TODO: test\n return null;\n }\n else {\n sourceId = sourceApi.internalEventSource.sourceId;\n }\n }\n var tuple = parseEvent(eventInput, sourceId, this);\n if (tuple) {\n this.dispatch({\n type: 'ADD_EVENTS',\n eventStore: eventTupleToStore(tuple)\n });\n return new EventApi(this, tuple.def, tuple.def.recurringDef ? null : tuple.instance);\n }\n return null;\n };\n // TODO: optimize\n Calendar.prototype.getEventById = function (id) {\n var _a = this.state.eventStore, defs = _a.defs, instances = _a.instances;\n id = String(id);\n for (var defId in defs) {\n var def = defs[defId];\n if (def.publicId === id) {\n if (def.recurringDef) {\n return new EventApi(this, def, null);\n }\n else {\n for (var instanceId in instances) {\n var instance = instances[instanceId];\n if (instance.defId === def.defId) {\n return new EventApi(this, def, instance);\n }\n }\n }\n }\n }\n return null;\n };\n Calendar.prototype.getEvents = function () {\n var _a = this.state.eventStore, defs = _a.defs, instances = _a.instances;\n var eventApis = [];\n for (var id in instances) {\n var instance = instances[id];\n var def = defs[instance.defId];\n eventApis.push(new EventApi(this, def, instance));\n }\n return eventApis;\n };\n Calendar.prototype.removeAllEvents = function () {\n this.dispatch({ type: 'REMOVE_ALL_EVENTS' });\n };\n Calendar.prototype.rerenderEvents = function () {\n this.dispatch({ type: 'RESET_EVENTS' });\n };\n // Public Event Sources API\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.getEventSources = function () {\n var sourceHash = this.state.eventSources;\n var sourceApis = [];\n for (var internalId in sourceHash) {\n sourceApis.push(new EventSourceApi(this, sourceHash[internalId]));\n }\n return sourceApis;\n };\n Calendar.prototype.getEventSourceById = function (id) {\n var sourceHash = this.state.eventSources;\n id = String(id);\n for (var sourceId in sourceHash) {\n if (sourceHash[sourceId].publicId === id) {\n return new EventSourceApi(this, sourceHash[sourceId]);\n }\n }\n return null;\n };\n Calendar.prototype.addEventSource = function (sourceInput) {\n if (sourceInput instanceof EventSourceApi) {\n // not already present? don't want to add an old snapshot\n if (!this.state.eventSources[sourceInput.internalEventSource.sourceId]) {\n this.dispatch({\n type: 'ADD_EVENT_SOURCES',\n sources: [sourceInput.internalEventSource]\n });\n }\n return sourceInput;\n }\n var eventSource = parseEventSource(sourceInput, this);\n if (eventSource) { // TODO: error otherwise?\n this.dispatch({ type: 'ADD_EVENT_SOURCES', sources: [eventSource] });\n return new EventSourceApi(this, eventSource);\n }\n return null;\n };\n Calendar.prototype.removeAllEventSources = function () {\n this.dispatch({ type: 'REMOVE_ALL_EVENT_SOURCES' });\n };\n Calendar.prototype.refetchEvents = function () {\n this.dispatch({ type: 'FETCH_EVENT_SOURCES' });\n };\n // Scroll\n // -----------------------------------------------------------------------------------------------------------------\n Calendar.prototype.scrollToTime = function (timeInput) {\n var duration = createDuration(timeInput);\n if (duration) {\n this.component.view.scrollToDuration(duration);\n }\n };\n return Calendar;\n }());\n EmitterMixin.mixInto(Calendar);\n // for memoizers\n // -----------------------------------------------------------------------------------------------------------------\n function buildComponentContext$1(theme, dateEnv, options) {\n return new ComponentContext(this, theme, dateEnv, options, null);\n }\n function buildDateEnv(locale, timeZone, namedTimeZoneImpl, firstDay, weekNumberCalculation, weekLabel, cmdFormatter) {\n return new DateEnv({\n calendarSystem: 'gregory',\n timeZone: timeZone,\n namedTimeZoneImpl: namedTimeZoneImpl,\n locale: locale,\n weekNumberCalculation: weekNumberCalculation,\n firstDay: firstDay,\n weekLabel: weekLabel,\n cmdFormatter: cmdFormatter\n });\n }\n function buildTheme(calendarOptions) {\n var themeClass = this.pluginSystem.hooks.themeClasses[calendarOptions.themeSystem] || StandardTheme;\n return new themeClass(calendarOptions);\n }\n function buildDelayedRerender(wait) {\n var func = this.tryRerender.bind(this);\n if (wait != null) {\n func = debounce(func, wait);\n }\n return func;\n }\n function buildEventUiBySource(eventSources) {\n return mapHash(eventSources, function (eventSource) {\n return eventSource.ui;\n });\n }\n function buildEventUiBases(eventDefs, eventUiSingleBase, eventUiBySource) {\n var eventUiBases = { '': eventUiSingleBase };\n for (var defId in eventDefs) {\n var def = eventDefs[defId];\n if (def.sourceId && eventUiBySource[def.sourceId]) {\n eventUiBases[defId] = eventUiBySource[def.sourceId];\n }\n }\n return eventUiBases;\n }\n\n var View = /** @class */ (function (_super) {\n __extends(View, _super);\n function View(viewSpec, parentEl) {\n var _this = _super.call(this, createElement('div', { className: 'fc-view fc-' + viewSpec.type + '-view' })) || this;\n _this.renderDatesMem = memoizeRendering(_this.renderDatesWrap, _this.unrenderDatesWrap);\n _this.renderBusinessHoursMem = memoizeRendering(_this.renderBusinessHours, _this.unrenderBusinessHours, [_this.renderDatesMem]);\n _this.renderDateSelectionMem = memoizeRendering(_this.renderDateSelectionWrap, _this.unrenderDateSelectionWrap, [_this.renderDatesMem]);\n _this.renderEventsMem = memoizeRendering(_this.renderEvents, _this.unrenderEvents, [_this.renderDatesMem]);\n _this.renderEventSelectionMem = memoizeRendering(_this.renderEventSelectionWrap, _this.unrenderEventSelectionWrap, [_this.renderEventsMem]);\n _this.renderEventDragMem = memoizeRendering(_this.renderEventDragWrap, _this.unrenderEventDragWrap, [_this.renderDatesMem]);\n _this.renderEventResizeMem = memoizeRendering(_this.renderEventResizeWrap, _this.unrenderEventResizeWrap, [_this.renderDatesMem]);\n _this.viewSpec = viewSpec;\n _this.type = viewSpec.type;\n parentEl.appendChild(_this.el);\n _this.initialize();\n return _this;\n }\n View.prototype.initialize = function () {\n };\n Object.defineProperty(View.prototype, \"activeStart\", {\n // Date Setting/Unsetting\n // -----------------------------------------------------------------------------------------------------------------\n get: function () {\n return this.context.dateEnv.toDate(this.props.dateProfile.activeRange.start);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(View.prototype, \"activeEnd\", {\n get: function () {\n return this.context.dateEnv.toDate(this.props.dateProfile.activeRange.end);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(View.prototype, \"currentStart\", {\n get: function () {\n return this.context.dateEnv.toDate(this.props.dateProfile.currentRange.start);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(View.prototype, \"currentEnd\", {\n get: function () {\n return this.context.dateEnv.toDate(this.props.dateProfile.currentRange.end);\n },\n enumerable: true,\n configurable: true\n });\n // General Rendering\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.render = function (props, context) {\n this.renderDatesMem(props.dateProfile);\n this.renderBusinessHoursMem(props.businessHours);\n this.renderDateSelectionMem(props.dateSelection);\n this.renderEventsMem(props.eventStore);\n this.renderEventSelectionMem(props.eventSelection);\n this.renderEventDragMem(props.eventDrag);\n this.renderEventResizeMem(props.eventResize);\n };\n View.prototype.beforeUpdate = function () {\n this.addScroll(this.queryScroll());\n };\n View.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.renderDatesMem.unrender(); // should unrender everything else\n };\n // Sizing\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.updateSize = function (isResize, viewHeight, isAuto) {\n var calendar = this.context.calendar;\n if (isResize) {\n this.addScroll(this.queryScroll()); // NOTE: same code as in beforeUpdate\n }\n if (isResize || // HACKS...\n calendar.isViewUpdated ||\n calendar.isDatesUpdated ||\n calendar.isEventsUpdated) {\n // sort of the catch-all sizing\n // anything that might cause dimension changes\n this.updateBaseSize(isResize, viewHeight, isAuto);\n }\n // NOTE: popScroll is called by CalendarComponent\n };\n View.prototype.updateBaseSize = function (isResize, viewHeight, isAuto) {\n };\n // Date Rendering\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.renderDatesWrap = function (dateProfile) {\n this.renderDates(dateProfile);\n this.addScroll({\n duration: createDuration(this.context.options.scrollTime)\n });\n };\n View.prototype.unrenderDatesWrap = function () {\n this.stopNowIndicator();\n this.unrenderDates();\n };\n View.prototype.renderDates = function (dateProfile) { };\n View.prototype.unrenderDates = function () { };\n // Business Hours\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.renderBusinessHours = function (businessHours) { };\n View.prototype.unrenderBusinessHours = function () { };\n // Date Selection\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.renderDateSelectionWrap = function (selection) {\n if (selection) {\n this.renderDateSelection(selection);\n }\n };\n View.prototype.unrenderDateSelectionWrap = function (selection) {\n if (selection) {\n this.unrenderDateSelection(selection);\n }\n };\n View.prototype.renderDateSelection = function (selection) { };\n View.prototype.unrenderDateSelection = function (selection) { };\n // Event Rendering\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.renderEvents = function (eventStore) { };\n View.prototype.unrenderEvents = function () { };\n // util for subclasses\n View.prototype.sliceEvents = function (eventStore, allDay) {\n var props = this.props;\n return sliceEventStore(eventStore, props.eventUiBases, props.dateProfile.activeRange, allDay ? this.context.nextDayThreshold : null).fg;\n };\n // Event Selection\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.renderEventSelectionWrap = function (instanceId) {\n if (instanceId) {\n this.renderEventSelection(instanceId);\n }\n };\n View.prototype.unrenderEventSelectionWrap = function (instanceId) {\n if (instanceId) {\n this.unrenderEventSelection(instanceId);\n }\n };\n View.prototype.renderEventSelection = function (instanceId) { };\n View.prototype.unrenderEventSelection = function (instanceId) { };\n // Event Drag\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.renderEventDragWrap = function (state) {\n if (state) {\n this.renderEventDrag(state);\n }\n };\n View.prototype.unrenderEventDragWrap = function (state) {\n if (state) {\n this.unrenderEventDrag(state);\n }\n };\n View.prototype.renderEventDrag = function (state) { };\n View.prototype.unrenderEventDrag = function (state) { };\n // Event Resize\n // -----------------------------------------------------------------------------------------------------------------\n View.prototype.renderEventResizeWrap = function (state) {\n if (state) {\n this.renderEventResize(state);\n }\n };\n View.prototype.unrenderEventResizeWrap = function (state) {\n if (state) {\n this.unrenderEventResize(state);\n }\n };\n View.prototype.renderEventResize = function (state) { };\n View.prototype.unrenderEventResize = function (state) { };\n /* Now Indicator\n ------------------------------------------------------------------------------------------------------------------*/\n // Immediately render the current time indicator and begins re-rendering it at an interval,\n // which is defined by this.getNowIndicatorUnit().\n // TODO: somehow do this for the current whole day's background too\n // USAGE: must be called manually from subclasses' render methods! don't need to call stopNowIndicator tho\n View.prototype.startNowIndicator = function (dateProfile, dateProfileGenerator) {\n var _this = this;\n var _a = this.context, calendar = _a.calendar, dateEnv = _a.dateEnv, options = _a.options;\n var unit;\n var update;\n var delay; // ms wait value\n if (options.nowIndicator && !this.initialNowDate) {\n unit = this.getNowIndicatorUnit(dateProfile, dateProfileGenerator);\n if (unit) {\n update = this.updateNowIndicator.bind(this);\n this.initialNowDate = calendar.getNow();\n this.initialNowQueriedMs = new Date().valueOf();\n // wait until the beginning of the next interval\n delay = dateEnv.add(dateEnv.startOf(this.initialNowDate, unit), createDuration(1, unit)).valueOf() - this.initialNowDate.valueOf();\n // TODO: maybe always use setTimeout, waiting until start of next unit\n this.nowIndicatorTimeoutID = setTimeout(function () {\n _this.nowIndicatorTimeoutID = null;\n update();\n if (unit === 'second') {\n delay = 1000; // every second\n }\n else {\n delay = 1000 * 60; // otherwise, every minute\n }\n _this.nowIndicatorIntervalID = setInterval(update, delay); // update every interval\n }, delay);\n }\n // rendering will be initiated in updateSize\n }\n };\n // rerenders the now indicator, computing the new current time from the amount of time that has passed\n // since the initial getNow call.\n View.prototype.updateNowIndicator = function () {\n if (this.props.dateProfile && // a way to determine if dates were rendered yet\n this.initialNowDate // activated before?\n ) {\n this.unrenderNowIndicator(); // won't unrender if unnecessary\n this.renderNowIndicator(addMs(this.initialNowDate, new Date().valueOf() - this.initialNowQueriedMs));\n this.isNowIndicatorRendered = true;\n }\n };\n // Immediately unrenders the view's current time indicator and stops any re-rendering timers.\n // Won't cause side effects if indicator isn't rendered.\n View.prototype.stopNowIndicator = function () {\n if (this.nowIndicatorTimeoutID) {\n clearTimeout(this.nowIndicatorTimeoutID);\n this.nowIndicatorTimeoutID = null;\n }\n if (this.nowIndicatorIntervalID) {\n clearInterval(this.nowIndicatorIntervalID);\n this.nowIndicatorIntervalID = null;\n }\n if (this.isNowIndicatorRendered) {\n this.unrenderNowIndicator();\n this.isNowIndicatorRendered = false;\n }\n };\n View.prototype.getNowIndicatorUnit = function (dateProfile, dateProfileGenerator) {\n // subclasses should implement\n };\n // Renders a current time indicator at the given datetime\n View.prototype.renderNowIndicator = function (date) {\n // SUBCLASSES MUST PASS TO CHILDREN!\n };\n // Undoes the rendering actions from renderNowIndicator\n View.prototype.unrenderNowIndicator = function () {\n // SUBCLASSES MUST PASS TO CHILDREN!\n };\n /* Scroller\n ------------------------------------------------------------------------------------------------------------------*/\n View.prototype.addScroll = function (scroll, isForced) {\n if (isForced) {\n scroll.isForced = isForced;\n }\n __assign(this.queuedScroll || (this.queuedScroll = {}), scroll);\n };\n View.prototype.popScroll = function (isResize) {\n this.applyQueuedScroll(isResize);\n this.queuedScroll = null;\n };\n View.prototype.applyQueuedScroll = function (isResize) {\n if (this.queuedScroll) {\n this.applyScroll(this.queuedScroll, isResize);\n }\n };\n View.prototype.queryScroll = function () {\n var scroll = {};\n if (this.props.dateProfile) { // dates rendered yet?\n __assign(scroll, this.queryDateScroll());\n }\n return scroll;\n };\n View.prototype.applyScroll = function (scroll, isResize) {\n var duration = scroll.duration, isForced = scroll.isForced;\n if (duration != null && !isForced) {\n delete scroll.duration;\n if (this.props.dateProfile) { // dates rendered yet?\n __assign(scroll, this.computeDateScroll(duration));\n }\n }\n if (this.props.dateProfile) { // dates rendered yet?\n this.applyDateScroll(scroll);\n }\n };\n View.prototype.computeDateScroll = function (duration) {\n return {}; // subclasses must implement\n };\n View.prototype.queryDateScroll = function () {\n return {}; // subclasses must implement\n };\n View.prototype.applyDateScroll = function (scroll) {\n // subclasses must implement\n };\n // for API\n View.prototype.scrollToDuration = function (duration) {\n this.applyScroll({ duration: duration }, false);\n };\n return View;\n }(DateComponent));\n EmitterMixin.mixInto(View);\n View.prototype.usesMinMaxTime = false;\n View.prototype.dateProfileGeneratorClass = DateProfileGenerator;\n\n var FgEventRenderer = /** @class */ (function () {\n function FgEventRenderer() {\n this.segs = [];\n this.isSizeDirty = false;\n }\n FgEventRenderer.prototype.renderSegs = function (context, segs, mirrorInfo) {\n this.context = context;\n this.rangeUpdated(); // called too frequently :(\n // render an `.el` on each seg\n // returns a subset of the segs. segs that were actually rendered\n segs = this.renderSegEls(segs, mirrorInfo);\n this.segs = segs;\n this.attachSegs(segs, mirrorInfo);\n this.isSizeDirty = true;\n triggerRenderedSegs(this.context, this.segs, Boolean(mirrorInfo));\n };\n FgEventRenderer.prototype.unrender = function (context, _segs, mirrorInfo) {\n triggerWillRemoveSegs(this.context, this.segs, Boolean(mirrorInfo));\n this.detachSegs(this.segs);\n this.segs = [];\n };\n // Updates values that rely on options and also relate to range\n FgEventRenderer.prototype.rangeUpdated = function () {\n var options = this.context.options;\n var displayEventTime;\n var displayEventEnd;\n this.eventTimeFormat = createFormatter(options.eventTimeFormat || this.computeEventTimeFormat(), options.defaultRangeSeparator);\n displayEventTime = options.displayEventTime;\n if (displayEventTime == null) {\n displayEventTime = this.computeDisplayEventTime(); // might be based off of range\n }\n displayEventEnd = options.displayEventEnd;\n if (displayEventEnd == null) {\n displayEventEnd = this.computeDisplayEventEnd(); // might be based off of range\n }\n this.displayEventTime = displayEventTime;\n this.displayEventEnd = displayEventEnd;\n };\n // Renders and assigns an `el` property for each foreground event segment.\n // Only returns segments that successfully rendered.\n FgEventRenderer.prototype.renderSegEls = function (segs, mirrorInfo) {\n var html = '';\n var i;\n if (segs.length) { // don't build an empty html string\n // build a large concatenation of event segment HTML\n for (i = 0; i < segs.length; i++) {\n html += this.renderSegHtml(segs[i], mirrorInfo);\n }\n // Grab individual elements from the combined HTML string. Use each as the default rendering.\n // Then, compute the 'el' for each segment. An el might be null if the eventRender callback returned false.\n htmlToElements(html).forEach(function (el, i) {\n var seg = segs[i];\n if (el) {\n seg.el = el;\n }\n });\n segs = filterSegsViaEls(this.context, segs, Boolean(mirrorInfo));\n }\n return segs;\n };\n // Generic utility for generating the HTML classNames for an event segment's element\n FgEventRenderer.prototype.getSegClasses = function (seg, isDraggable, isResizable, mirrorInfo) {\n var classes = [\n 'fc-event',\n seg.isStart ? 'fc-start' : 'fc-not-start',\n seg.isEnd ? 'fc-end' : 'fc-not-end'\n ].concat(seg.eventRange.ui.classNames);\n if (isDraggable) {\n classes.push('fc-draggable');\n }\n if (isResizable) {\n classes.push('fc-resizable');\n }\n if (mirrorInfo) {\n classes.push('fc-mirror');\n if (mirrorInfo.isDragging) {\n classes.push('fc-dragging');\n }\n if (mirrorInfo.isResizing) {\n classes.push('fc-resizing');\n }\n }\n return classes;\n };\n // Compute the text that should be displayed on an event's element.\n // `range` can be the Event object itself, or something range-like, with at least a `start`.\n // If event times are disabled, or the event has no time, will return a blank string.\n // If not specified, formatter will default to the eventTimeFormat setting,\n // and displayEnd will default to the displayEventEnd setting.\n FgEventRenderer.prototype.getTimeText = function (eventRange, formatter, displayEnd) {\n var def = eventRange.def, instance = eventRange.instance;\n return this._getTimeText(instance.range.start, def.hasEnd ? instance.range.end : null, def.allDay, formatter, displayEnd, instance.forcedStartTzo, instance.forcedEndTzo);\n };\n FgEventRenderer.prototype._getTimeText = function (start, end, allDay, formatter, displayEnd, forcedStartTzo, forcedEndTzo) {\n var dateEnv = this.context.dateEnv;\n if (formatter == null) {\n formatter = this.eventTimeFormat;\n }\n if (displayEnd == null) {\n displayEnd = this.displayEventEnd;\n }\n if (this.displayEventTime && !allDay) {\n if (displayEnd && end) {\n return dateEnv.formatRange(start, end, formatter, {\n forcedStartTzo: forcedStartTzo,\n forcedEndTzo: forcedEndTzo\n });\n }\n else {\n return dateEnv.format(start, formatter, {\n forcedTzo: forcedStartTzo\n });\n }\n }\n return '';\n };\n FgEventRenderer.prototype.computeEventTimeFormat = function () {\n return {\n hour: 'numeric',\n minute: '2-digit',\n omitZeroMinute: true\n };\n };\n FgEventRenderer.prototype.computeDisplayEventTime = function () {\n return true;\n };\n FgEventRenderer.prototype.computeDisplayEventEnd = function () {\n return true;\n };\n // Utility for generating event skin-related CSS properties\n FgEventRenderer.prototype.getSkinCss = function (ui) {\n return {\n 'background-color': ui.backgroundColor,\n 'border-color': ui.borderColor,\n color: ui.textColor\n };\n };\n FgEventRenderer.prototype.sortEventSegs = function (segs) {\n var specs = this.context.eventOrderSpecs;\n var objs = segs.map(buildSegCompareObj);\n objs.sort(function (obj0, obj1) {\n return compareByFieldSpecs(obj0, obj1, specs);\n });\n return objs.map(function (c) {\n return c._seg;\n });\n };\n FgEventRenderer.prototype.computeSizes = function (force) {\n if (force || this.isSizeDirty) {\n this.computeSegSizes(this.segs);\n }\n };\n FgEventRenderer.prototype.assignSizes = function (force) {\n if (force || this.isSizeDirty) {\n this.assignSegSizes(this.segs);\n this.isSizeDirty = false;\n }\n };\n FgEventRenderer.prototype.computeSegSizes = function (segs) {\n };\n FgEventRenderer.prototype.assignSegSizes = function (segs) {\n };\n // Manipulation on rendered segs\n FgEventRenderer.prototype.hideByHash = function (hash) {\n if (hash) {\n for (var _i = 0, _a = this.segs; _i < _a.length; _i++) {\n var seg = _a[_i];\n if (hash[seg.eventRange.instance.instanceId]) {\n seg.el.style.visibility = 'hidden';\n }\n }\n }\n };\n FgEventRenderer.prototype.showByHash = function (hash) {\n if (hash) {\n for (var _i = 0, _a = this.segs; _i < _a.length; _i++) {\n var seg = _a[_i];\n if (hash[seg.eventRange.instance.instanceId]) {\n seg.el.style.visibility = '';\n }\n }\n }\n };\n FgEventRenderer.prototype.selectByInstanceId = function (instanceId) {\n if (instanceId) {\n for (var _i = 0, _a = this.segs; _i < _a.length; _i++) {\n var seg = _a[_i];\n var eventInstance = seg.eventRange.instance;\n if (eventInstance && eventInstance.instanceId === instanceId &&\n seg.el // necessary?\n ) {\n seg.el.classList.add('fc-selected');\n }\n }\n }\n };\n FgEventRenderer.prototype.unselectByInstanceId = function (instanceId) {\n if (instanceId) {\n for (var _i = 0, _a = this.segs; _i < _a.length; _i++) {\n var seg = _a[_i];\n if (seg.el) { // necessary?\n seg.el.classList.remove('fc-selected');\n }\n }\n }\n };\n return FgEventRenderer;\n }());\n // returns a object with all primitive props that can be compared\n function buildSegCompareObj(seg) {\n var eventDef = seg.eventRange.def;\n var range = seg.eventRange.instance.range;\n var start = range.start ? range.start.valueOf() : 0; // TODO: better support for open-range events\n var end = range.end ? range.end.valueOf() : 0; // \"\n return __assign({}, eventDef.extendedProps, eventDef, { id: eventDef.publicId, start: start,\n end: end, duration: end - start, allDay: Number(eventDef.allDay), _seg: seg // for later retrieval\n });\n }\n\n /*\n TODO: when refactoring this class, make a new FillRenderer instance for each `type`\n */\n var FillRenderer = /** @class */ (function () {\n function FillRenderer() {\n this.fillSegTag = 'div';\n this.dirtySizeFlags = {};\n this.containerElsByType = {};\n this.segsByType = {};\n }\n FillRenderer.prototype.getSegsByType = function (type) {\n return this.segsByType[type] || [];\n };\n FillRenderer.prototype.renderSegs = function (type, context, segs) {\n var _a;\n this.context = context;\n var renderedSegs = this.renderSegEls(type, segs); // assignes `.el` to each seg. returns successfully rendered segs\n var containerEls = this.attachSegs(type, renderedSegs);\n if (containerEls) {\n (_a = (this.containerElsByType[type] || (this.containerElsByType[type] = []))).push.apply(_a, containerEls);\n }\n this.segsByType[type] = renderedSegs;\n if (type === 'bgEvent') {\n triggerRenderedSegs(context, renderedSegs, false); // isMirror=false\n }\n this.dirtySizeFlags[type] = true;\n };\n // Unrenders a specific type of fill that is currently rendered on the grid\n FillRenderer.prototype.unrender = function (type, context) {\n var segs = this.segsByType[type];\n if (segs) {\n if (type === 'bgEvent') {\n triggerWillRemoveSegs(context, segs, false); // isMirror=false\n }\n this.detachSegs(type, segs);\n }\n };\n // Renders and assigns an `el` property for each fill segment. Generic enough to work with different types.\n // Only returns segments that successfully rendered.\n FillRenderer.prototype.renderSegEls = function (type, segs) {\n var _this = this;\n var html = '';\n var i;\n if (segs.length) {\n // build a large concatenation of segment HTML\n for (i = 0; i < segs.length; i++) {\n html += this.renderSegHtml(type, segs[i]);\n }\n // Grab individual elements from the combined HTML string. Use each as the default rendering.\n // Then, compute the 'el' for each segment.\n htmlToElements(html).forEach(function (el, i) {\n var seg = segs[i];\n if (el) {\n seg.el = el;\n }\n });\n if (type === 'bgEvent') {\n segs = filterSegsViaEls(this.context, segs, false // isMirror. background events can never be mirror elements\n );\n }\n // correct element type? (would be bad if a non-TD were inserted into a table for example)\n segs = segs.filter(function (seg) {\n return elementMatches(seg.el, _this.fillSegTag);\n });\n }\n return segs;\n };\n // Builds the HTML needed for one fill segment. Generic enough to work with different types.\n FillRenderer.prototype.renderSegHtml = function (type, seg) {\n var css = null;\n var classNames = [];\n if (type !== 'highlight' && type !== 'businessHours') {\n css = {\n 'background-color': seg.eventRange.ui.backgroundColor\n };\n }\n if (type !== 'highlight') {\n classNames = classNames.concat(seg.eventRange.ui.classNames);\n }\n if (type === 'businessHours') {\n classNames.push('fc-bgevent');\n }\n else {\n classNames.push('fc-' + type.toLowerCase());\n }\n return '<' + this.fillSegTag +\n (classNames.length ? ' class=\"' + classNames.join(' ') + '\"' : '') +\n (css ? ' style=\"' + cssToStr(css) + '\"' : '') +\n '>';\n };\n FillRenderer.prototype.detachSegs = function (type, segs) {\n var containerEls = this.containerElsByType[type];\n if (containerEls) {\n containerEls.forEach(removeElement);\n delete this.containerElsByType[type];\n }\n };\n FillRenderer.prototype.computeSizes = function (force) {\n for (var type in this.segsByType) {\n if (force || this.dirtySizeFlags[type]) {\n this.computeSegSizes(this.segsByType[type]);\n }\n }\n };\n FillRenderer.prototype.assignSizes = function (force) {\n for (var type in this.segsByType) {\n if (force || this.dirtySizeFlags[type]) {\n this.assignSegSizes(this.segsByType[type]);\n }\n }\n this.dirtySizeFlags = {};\n };\n FillRenderer.prototype.computeSegSizes = function (segs) {\n };\n FillRenderer.prototype.assignSegSizes = function (segs) {\n };\n return FillRenderer;\n }());\n\n var NamedTimeZoneImpl = /** @class */ (function () {\n function NamedTimeZoneImpl(timeZoneName) {\n this.timeZoneName = timeZoneName;\n }\n return NamedTimeZoneImpl;\n }());\n\n /*\n An abstraction for a dragging interaction originating on an event.\n Does higher-level things than PointerDragger, such as possibly:\n - a \"mirror\" that moves with the pointer\n - a minimum number of pixels or other criteria for a true drag to begin\n\n subclasses must emit:\n - pointerdown\n - dragstart\n - dragmove\n - pointerup\n - dragend\n */\n var ElementDragging = /** @class */ (function () {\n function ElementDragging(el) {\n this.emitter = new EmitterMixin();\n }\n ElementDragging.prototype.destroy = function () {\n };\n ElementDragging.prototype.setMirrorIsVisible = function (bool) {\n // optional if subclass doesn't want to support a mirror\n };\n ElementDragging.prototype.setMirrorNeedsRevert = function (bool) {\n // optional if subclass doesn't want to support a mirror\n };\n ElementDragging.prototype.setAutoScrollEnabled = function (bool) {\n // optional\n };\n return ElementDragging;\n }());\n\n function formatDate(dateInput, settings) {\n if (settings === void 0) { settings = {}; }\n var dateEnv = buildDateEnv$1(settings);\n var formatter = createFormatter(settings);\n var dateMeta = dateEnv.createMarkerMeta(dateInput);\n if (!dateMeta) { // TODO: warning?\n return '';\n }\n return dateEnv.format(dateMeta.marker, formatter, {\n forcedTzo: dateMeta.forcedTzo\n });\n }\n function formatRange(startInput, endInput, settings // mixture of env and formatter settings\n ) {\n var dateEnv = buildDateEnv$1(typeof settings === 'object' && settings ? settings : {}); // pass in if non-null object\n var formatter = createFormatter(settings, globalDefaults.defaultRangeSeparator);\n var startMeta = dateEnv.createMarkerMeta(startInput);\n var endMeta = dateEnv.createMarkerMeta(endInput);\n if (!startMeta || !endMeta) { // TODO: warning?\n return '';\n }\n return dateEnv.formatRange(startMeta.marker, endMeta.marker, formatter, {\n forcedStartTzo: startMeta.forcedTzo,\n forcedEndTzo: endMeta.forcedTzo,\n isEndExclusive: settings.isEndExclusive\n });\n }\n // TODO: more DRY and optimized\n function buildDateEnv$1(settings) {\n var locale = buildLocale(settings.locale || 'en', parseRawLocales([]).map); // TODO: don't hardcode 'en' everywhere\n // ensure required settings\n settings = __assign({ timeZone: globalDefaults.timeZone, calendarSystem: 'gregory' }, settings, { locale: locale });\n return new DateEnv(settings);\n }\n\n var DRAG_META_PROPS = {\n startTime: createDuration,\n duration: createDuration,\n create: Boolean,\n sourceId: String\n };\n var DRAG_META_DEFAULTS = {\n create: true\n };\n function parseDragMeta(raw) {\n var leftoverProps = {};\n var refined = refineProps(raw, DRAG_META_PROPS, DRAG_META_DEFAULTS, leftoverProps);\n refined.leftoverProps = leftoverProps;\n return refined;\n }\n\n // Computes a default column header formatting string if `colFormat` is not explicitly defined\n function computeFallbackHeaderFormat(datesRepDistinctDays, dayCnt) {\n // if more than one week row, or if there are a lot of columns with not much space,\n // put just the day numbers will be in each cell\n if (!datesRepDistinctDays || dayCnt > 10) {\n return { weekday: 'short' }; // \"Sat\"\n }\n else if (dayCnt > 1) {\n return { weekday: 'short', month: 'numeric', day: 'numeric', omitCommas: true }; // \"Sat 11/12\"\n }\n else {\n return { weekday: 'long' }; // \"Saturday\"\n }\n }\n function renderDateCell(dateMarker, dateProfile, datesRepDistinctDays, colCnt, colHeadFormat, context, colspan, otherAttrs) {\n var dateEnv = context.dateEnv, theme = context.theme, options = context.options;\n var isDateValid = rangeContainsMarker(dateProfile.activeRange, dateMarker); // TODO: called too frequently. cache somehow.\n var classNames = [\n 'fc-day-header',\n theme.getClass('widgetHeader')\n ];\n var innerHtml;\n if (typeof options.columnHeaderHtml === 'function') {\n innerHtml = options.columnHeaderHtml(dateEnv.toDate(dateMarker));\n }\n else if (typeof options.columnHeaderText === 'function') {\n innerHtml = htmlEscape(options.columnHeaderText(dateEnv.toDate(dateMarker)));\n }\n else {\n innerHtml = htmlEscape(dateEnv.format(dateMarker, colHeadFormat));\n }\n // if only one row of days, the classNames on the header can represent the specific days beneath\n if (datesRepDistinctDays) {\n classNames = classNames.concat(\n // includes the day-of-week class\n // noThemeHighlight=true (don't highlight the header)\n getDayClasses(dateMarker, dateProfile, context, true));\n }\n else {\n classNames.push('fc-' + DAY_IDS[dateMarker.getUTCDay()]); // only add the day-of-week class\n }\n return '' +\n ' 1 ?\n ' colspan=\"' + colspan + '\"' :\n '') +\n (otherAttrs ?\n ' ' + otherAttrs :\n '') +\n '>' +\n (isDateValid ?\n // don't make a link if the heading could represent multiple days, or if there's only one day (forceOff)\n buildGotoAnchorHtml(options, dateEnv, { date: dateMarker, forceOff: !datesRepDistinctDays || colCnt === 1 }, innerHtml) :\n // if not valid, display text, but no link\n innerHtml) +\n '';\n }\n\n var DayHeader = /** @class */ (function (_super) {\n __extends(DayHeader, _super);\n function DayHeader(parentEl) {\n var _this = _super.call(this) || this;\n _this.renderSkeleton = memoizeRendering(_this._renderSkeleton, _this._unrenderSkeleton);\n _this.parentEl = parentEl;\n return _this;\n }\n DayHeader.prototype.render = function (props, context) {\n var dates = props.dates, datesRepDistinctDays = props.datesRepDistinctDays;\n var parts = [];\n this.renderSkeleton(context);\n if (props.renderIntroHtml) {\n parts.push(props.renderIntroHtml());\n }\n var colHeadFormat = createFormatter(context.options.columnHeaderFormat ||\n computeFallbackHeaderFormat(datesRepDistinctDays, dates.length));\n for (var _i = 0, dates_1 = dates; _i < dates_1.length; _i++) {\n var date = dates_1[_i];\n parts.push(renderDateCell(date, props.dateProfile, datesRepDistinctDays, dates.length, colHeadFormat, context));\n }\n if (context.isRtl) {\n parts.reverse();\n }\n this.thead.innerHTML = '' + parts.join('') + '';\n };\n DayHeader.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.renderSkeleton.unrender();\n };\n DayHeader.prototype._renderSkeleton = function (context) {\n var theme = context.theme;\n var parentEl = this.parentEl;\n parentEl.innerHTML = ''; // because might be nbsp\n parentEl.appendChild(this.el = htmlToElement('
' +\n '' +\n '' +\n '
' +\n '
'));\n this.thead = this.el.querySelector('thead');\n };\n DayHeader.prototype._unrenderSkeleton = function () {\n removeElement(this.el);\n };\n return DayHeader;\n }(Component));\n\n var DaySeries = /** @class */ (function () {\n function DaySeries(range, dateProfileGenerator) {\n var date = range.start;\n var end = range.end;\n var indices = [];\n var dates = [];\n var dayIndex = -1;\n while (date < end) { // loop each day from start to end\n if (dateProfileGenerator.isHiddenDay(date)) {\n indices.push(dayIndex + 0.5); // mark that it's between indices\n }\n else {\n dayIndex++;\n indices.push(dayIndex);\n dates.push(date);\n }\n date = addDays(date, 1);\n }\n this.dates = dates;\n this.indices = indices;\n this.cnt = dates.length;\n }\n DaySeries.prototype.sliceRange = function (range) {\n var firstIndex = this.getDateDayIndex(range.start); // inclusive first index\n var lastIndex = this.getDateDayIndex(addDays(range.end, -1)); // inclusive last index\n var clippedFirstIndex = Math.max(0, firstIndex);\n var clippedLastIndex = Math.min(this.cnt - 1, lastIndex);\n // deal with in-between indices\n clippedFirstIndex = Math.ceil(clippedFirstIndex); // in-between starts round to next cell\n clippedLastIndex = Math.floor(clippedLastIndex); // in-between ends round to prev cell\n if (clippedFirstIndex <= clippedLastIndex) {\n return {\n firstIndex: clippedFirstIndex,\n lastIndex: clippedLastIndex,\n isStart: firstIndex === clippedFirstIndex,\n isEnd: lastIndex === clippedLastIndex\n };\n }\n else {\n return null;\n }\n };\n // Given a date, returns its chronolocial cell-index from the first cell of the grid.\n // If the date lies between cells (because of hiddenDays), returns a floating-point value between offsets.\n // If before the first offset, returns a negative number.\n // If after the last offset, returns an offset past the last cell offset.\n // Only works for *start* dates of cells. Will not work for exclusive end dates for cells.\n DaySeries.prototype.getDateDayIndex = function (date) {\n var indices = this.indices;\n var dayOffset = Math.floor(diffDays(this.dates[0], date));\n if (dayOffset < 0) {\n return indices[0] - 1;\n }\n else if (dayOffset >= indices.length) {\n return indices[indices.length - 1] + 1;\n }\n else {\n return indices[dayOffset];\n }\n };\n return DaySeries;\n }());\n\n var DayTable = /** @class */ (function () {\n function DayTable(daySeries, breakOnWeeks) {\n var dates = daySeries.dates;\n var daysPerRow;\n var firstDay;\n var rowCnt;\n if (breakOnWeeks) {\n // count columns until the day-of-week repeats\n firstDay = dates[0].getUTCDay();\n for (daysPerRow = 1; daysPerRow < dates.length; daysPerRow++) {\n if (dates[daysPerRow].getUTCDay() === firstDay) {\n break;\n }\n }\n rowCnt = Math.ceil(dates.length / daysPerRow);\n }\n else {\n rowCnt = 1;\n daysPerRow = dates.length;\n }\n this.rowCnt = rowCnt;\n this.colCnt = daysPerRow;\n this.daySeries = daySeries;\n this.cells = this.buildCells();\n this.headerDates = this.buildHeaderDates();\n }\n DayTable.prototype.buildCells = function () {\n var rows = [];\n for (var row = 0; row < this.rowCnt; row++) {\n var cells = [];\n for (var col = 0; col < this.colCnt; col++) {\n cells.push(this.buildCell(row, col));\n }\n rows.push(cells);\n }\n return rows;\n };\n DayTable.prototype.buildCell = function (row, col) {\n return {\n date: this.daySeries.dates[row * this.colCnt + col]\n };\n };\n DayTable.prototype.buildHeaderDates = function () {\n var dates = [];\n for (var col = 0; col < this.colCnt; col++) {\n dates.push(this.cells[0][col].date);\n }\n return dates;\n };\n DayTable.prototype.sliceRange = function (range) {\n var colCnt = this.colCnt;\n var seriesSeg = this.daySeries.sliceRange(range);\n var segs = [];\n if (seriesSeg) {\n var firstIndex = seriesSeg.firstIndex, lastIndex = seriesSeg.lastIndex;\n var index = firstIndex;\n while (index <= lastIndex) {\n var row = Math.floor(index / colCnt);\n var nextIndex = Math.min((row + 1) * colCnt, lastIndex + 1);\n segs.push({\n row: row,\n firstCol: index % colCnt,\n lastCol: (nextIndex - 1) % colCnt,\n isStart: seriesSeg.isStart && index === firstIndex,\n isEnd: seriesSeg.isEnd && (nextIndex - 1) === lastIndex\n });\n index = nextIndex;\n }\n }\n return segs;\n };\n return DayTable;\n }());\n\n var Slicer = /** @class */ (function () {\n function Slicer() {\n this.sliceBusinessHours = memoize(this._sliceBusinessHours);\n this.sliceDateSelection = memoize(this._sliceDateSpan);\n this.sliceEventStore = memoize(this._sliceEventStore);\n this.sliceEventDrag = memoize(this._sliceInteraction);\n this.sliceEventResize = memoize(this._sliceInteraction);\n }\n Slicer.prototype.sliceProps = function (props, dateProfile, nextDayThreshold, calendar, component) {\n var extraArgs = [];\n for (var _i = 5; _i < arguments.length; _i++) {\n extraArgs[_i - 5] = arguments[_i];\n }\n var eventUiBases = props.eventUiBases;\n var eventSegs = this.sliceEventStore.apply(this, [props.eventStore, eventUiBases, dateProfile, nextDayThreshold, component].concat(extraArgs));\n return {\n dateSelectionSegs: this.sliceDateSelection.apply(this, [props.dateSelection, eventUiBases, component].concat(extraArgs)),\n businessHourSegs: this.sliceBusinessHours.apply(this, [props.businessHours, dateProfile, nextDayThreshold, calendar, component].concat(extraArgs)),\n fgEventSegs: eventSegs.fg,\n bgEventSegs: eventSegs.bg,\n eventDrag: this.sliceEventDrag.apply(this, [props.eventDrag, eventUiBases, dateProfile, nextDayThreshold, component].concat(extraArgs)),\n eventResize: this.sliceEventResize.apply(this, [props.eventResize, eventUiBases, dateProfile, nextDayThreshold, component].concat(extraArgs)),\n eventSelection: props.eventSelection\n }; // TODO: give interactionSegs?\n };\n Slicer.prototype.sliceNowDate = function (// does not memoize\n date, component) {\n var extraArgs = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n extraArgs[_i - 2] = arguments[_i];\n }\n return this._sliceDateSpan.apply(this, [{ range: { start: date, end: addMs(date, 1) }, allDay: false },\n {},\n component].concat(extraArgs));\n };\n Slicer.prototype._sliceBusinessHours = function (businessHours, dateProfile, nextDayThreshold, calendar, component) {\n var extraArgs = [];\n for (var _i = 5; _i < arguments.length; _i++) {\n extraArgs[_i - 5] = arguments[_i];\n }\n if (!businessHours) {\n return [];\n }\n return this._sliceEventStore.apply(this, [expandRecurring(businessHours, computeActiveRange(dateProfile, Boolean(nextDayThreshold)), calendar),\n {},\n dateProfile,\n nextDayThreshold,\n component].concat(extraArgs)).bg;\n };\n Slicer.prototype._sliceEventStore = function (eventStore, eventUiBases, dateProfile, nextDayThreshold, component) {\n var extraArgs = [];\n for (var _i = 5; _i < arguments.length; _i++) {\n extraArgs[_i - 5] = arguments[_i];\n }\n if (eventStore) {\n var rangeRes = sliceEventStore(eventStore, eventUiBases, computeActiveRange(dateProfile, Boolean(nextDayThreshold)), nextDayThreshold);\n return {\n bg: this.sliceEventRanges(rangeRes.bg, component, extraArgs),\n fg: this.sliceEventRanges(rangeRes.fg, component, extraArgs)\n };\n }\n else {\n return { bg: [], fg: [] };\n }\n };\n Slicer.prototype._sliceInteraction = function (interaction, eventUiBases, dateProfile, nextDayThreshold, component) {\n var extraArgs = [];\n for (var _i = 5; _i < arguments.length; _i++) {\n extraArgs[_i - 5] = arguments[_i];\n }\n if (!interaction) {\n return null;\n }\n var rangeRes = sliceEventStore(interaction.mutatedEvents, eventUiBases, computeActiveRange(dateProfile, Boolean(nextDayThreshold)), nextDayThreshold);\n return {\n segs: this.sliceEventRanges(rangeRes.fg, component, extraArgs),\n affectedInstances: interaction.affectedEvents.instances,\n isEvent: interaction.isEvent,\n sourceSeg: interaction.origSeg\n };\n };\n Slicer.prototype._sliceDateSpan = function (dateSpan, eventUiBases, component) {\n var extraArgs = [];\n for (var _i = 3; _i < arguments.length; _i++) {\n extraArgs[_i - 3] = arguments[_i];\n }\n if (!dateSpan) {\n return [];\n }\n var eventRange = fabricateEventRange(dateSpan, eventUiBases, component.context.calendar);\n var segs = this.sliceRange.apply(this, [dateSpan.range].concat(extraArgs));\n for (var _a = 0, segs_1 = segs; _a < segs_1.length; _a++) {\n var seg = segs_1[_a];\n seg.component = component;\n seg.eventRange = eventRange;\n }\n return segs;\n };\n /*\n \"complete\" seg means it has component and eventRange\n */\n Slicer.prototype.sliceEventRanges = function (eventRanges, component, // TODO: kill\n extraArgs) {\n var segs = [];\n for (var _i = 0, eventRanges_1 = eventRanges; _i < eventRanges_1.length; _i++) {\n var eventRange = eventRanges_1[_i];\n segs.push.apply(segs, this.sliceEventRange(eventRange, component, extraArgs));\n }\n return segs;\n };\n /*\n \"complete\" seg means it has component and eventRange\n */\n Slicer.prototype.sliceEventRange = function (eventRange, component, // TODO: kill\n extraArgs) {\n var segs = this.sliceRange.apply(this, [eventRange.range].concat(extraArgs));\n for (var _i = 0, segs_2 = segs; _i < segs_2.length; _i++) {\n var seg = segs_2[_i];\n seg.component = component;\n seg.eventRange = eventRange;\n seg.isStart = eventRange.isStart && seg.isStart;\n seg.isEnd = eventRange.isEnd && seg.isEnd;\n }\n return segs;\n };\n return Slicer;\n }());\n /*\n for incorporating minTime/maxTime if appropriate\n TODO: should be part of DateProfile!\n TimelineDateProfile already does this btw\n */\n function computeActiveRange(dateProfile, isComponentAllDay) {\n var range = dateProfile.activeRange;\n if (isComponentAllDay) {\n return range;\n }\n return {\n start: addMs(range.start, dateProfile.minTime.milliseconds),\n end: addMs(range.end, dateProfile.maxTime.milliseconds - 864e5) // 864e5 = ms in a day\n };\n }\n\n // exports\n // --------------------------------------------------------------------------------------------------\n var version = '4.4.2';\n\n exports.Calendar = Calendar;\n exports.Component = Component;\n exports.ComponentContext = ComponentContext;\n exports.DateComponent = DateComponent;\n exports.DateEnv = DateEnv;\n exports.DateProfileGenerator = DateProfileGenerator;\n exports.DayHeader = DayHeader;\n exports.DaySeries = DaySeries;\n exports.DayTable = DayTable;\n exports.ElementDragging = ElementDragging;\n exports.ElementScrollController = ElementScrollController;\n exports.EmitterMixin = EmitterMixin;\n exports.EventApi = EventApi;\n exports.FgEventRenderer = FgEventRenderer;\n exports.FillRenderer = FillRenderer;\n exports.Interaction = Interaction;\n exports.Mixin = Mixin;\n exports.NamedTimeZoneImpl = NamedTimeZoneImpl;\n exports.PositionCache = PositionCache;\n exports.ScrollComponent = ScrollComponent;\n exports.ScrollController = ScrollController;\n exports.Slicer = Slicer;\n exports.Splitter = Splitter;\n exports.Theme = Theme;\n exports.View = View;\n exports.WindowScrollController = WindowScrollController;\n exports.addDays = addDays;\n exports.addDurations = addDurations;\n exports.addMs = addMs;\n exports.addWeeks = addWeeks;\n exports.allowContextMenu = allowContextMenu;\n exports.allowSelection = allowSelection;\n exports.appendToElement = appendToElement;\n exports.applyAll = applyAll;\n exports.applyMutationToEventStore = applyMutationToEventStore;\n exports.applyStyle = applyStyle;\n exports.applyStyleProp = applyStyleProp;\n exports.asRoughMinutes = asRoughMinutes;\n exports.asRoughMs = asRoughMs;\n exports.asRoughSeconds = asRoughSeconds;\n exports.buildGotoAnchorHtml = buildGotoAnchorHtml;\n exports.buildSegCompareObj = buildSegCompareObj;\n exports.capitaliseFirstLetter = capitaliseFirstLetter;\n exports.combineEventUis = combineEventUis;\n exports.compareByFieldSpec = compareByFieldSpec;\n exports.compareByFieldSpecs = compareByFieldSpecs;\n exports.compareNumbers = compareNumbers;\n exports.compensateScroll = compensateScroll;\n exports.computeClippingRect = computeClippingRect;\n exports.computeEdges = computeEdges;\n exports.computeEventDraggable = computeEventDraggable;\n exports.computeEventEndResizable = computeEventEndResizable;\n exports.computeEventStartResizable = computeEventStartResizable;\n exports.computeFallbackHeaderFormat = computeFallbackHeaderFormat;\n exports.computeHeightAndMargins = computeHeightAndMargins;\n exports.computeInnerRect = computeInnerRect;\n exports.computeRect = computeRect;\n exports.computeVisibleDayRange = computeVisibleDayRange;\n exports.config = config;\n exports.constrainPoint = constrainPoint;\n exports.createDuration = createDuration;\n exports.createElement = createElement;\n exports.createEmptyEventStore = createEmptyEventStore;\n exports.createEventInstance = createEventInstance;\n exports.createFormatter = createFormatter;\n exports.createPlugin = createPlugin;\n exports.cssToStr = cssToStr;\n exports.debounce = debounce;\n exports.diffDates = diffDates;\n exports.diffDayAndTime = diffDayAndTime;\n exports.diffDays = diffDays;\n exports.diffPoints = diffPoints;\n exports.diffWeeks = diffWeeks;\n exports.diffWholeDays = diffWholeDays;\n exports.diffWholeWeeks = diffWholeWeeks;\n exports.disableCursor = disableCursor;\n exports.distributeHeight = distributeHeight;\n exports.elementClosest = elementClosest;\n exports.elementMatches = elementMatches;\n exports.enableCursor = enableCursor;\n exports.eventTupleToStore = eventTupleToStore;\n exports.filterEventStoreDefs = filterEventStoreDefs;\n exports.filterHash = filterHash;\n exports.findChildren = findChildren;\n exports.findElements = findElements;\n exports.flexibleCompare = flexibleCompare;\n exports.forceClassName = forceClassName;\n exports.formatDate = formatDate;\n exports.formatIsoTimeString = formatIsoTimeString;\n exports.formatRange = formatRange;\n exports.getAllDayHtml = getAllDayHtml;\n exports.getClippingParents = getClippingParents;\n exports.getDayClasses = getDayClasses;\n exports.getElSeg = getElSeg;\n exports.getRectCenter = getRectCenter;\n exports.getRelevantEvents = getRelevantEvents;\n exports.globalDefaults = globalDefaults;\n exports.greatestDurationDenominator = greatestDurationDenominator;\n exports.hasBgRendering = hasBgRendering;\n exports.htmlEscape = htmlEscape;\n exports.htmlToElement = htmlToElement;\n exports.insertAfterElement = insertAfterElement;\n exports.interactionSettingsStore = interactionSettingsStore;\n exports.interactionSettingsToStore = interactionSettingsToStore;\n exports.intersectRanges = intersectRanges;\n exports.intersectRects = intersectRects;\n exports.isArraysEqual = isArraysEqual;\n exports.isDateSpansEqual = isDateSpansEqual;\n exports.isInt = isInt;\n exports.isInteractionValid = isInteractionValid;\n exports.isMultiDayRange = isMultiDayRange;\n exports.isPropsEqual = isPropsEqual;\n exports.isPropsValid = isPropsValid;\n exports.isSingleDay = isSingleDay;\n exports.isValidDate = isValidDate;\n exports.listenBySelector = listenBySelector;\n exports.mapHash = mapHash;\n exports.matchCellWidths = matchCellWidths;\n exports.memoize = memoize;\n exports.memoizeOutput = memoizeOutput;\n exports.memoizeRendering = memoizeRendering;\n exports.mergeEventStores = mergeEventStores;\n exports.multiplyDuration = multiplyDuration;\n exports.padStart = padStart;\n exports.parseBusinessHours = parseBusinessHours;\n exports.parseDragMeta = parseDragMeta;\n exports.parseEventDef = parseEventDef;\n exports.parseFieldSpecs = parseFieldSpecs;\n exports.parseMarker = parse;\n exports.pointInsideRect = pointInsideRect;\n exports.prependToElement = prependToElement;\n exports.preventContextMenu = preventContextMenu;\n exports.preventDefault = preventDefault;\n exports.preventSelection = preventSelection;\n exports.processScopedUiProps = processScopedUiProps;\n exports.rangeContainsMarker = rangeContainsMarker;\n exports.rangeContainsRange = rangeContainsRange;\n exports.rangesEqual = rangesEqual;\n exports.rangesIntersect = rangesIntersect;\n exports.refineProps = refineProps;\n exports.removeElement = removeElement;\n exports.removeExact = removeExact;\n exports.renderDateCell = renderDateCell;\n exports.requestJson = requestJson;\n exports.sliceEventStore = sliceEventStore;\n exports.startOfDay = startOfDay;\n exports.subtractInnerElHeight = subtractInnerElHeight;\n exports.translateRect = translateRect;\n exports.uncompensateScroll = uncompensateScroll;\n exports.undistributeHeight = undistributeHeight;\n exports.unpromisify = unpromisify;\n exports.version = version;\n exports.whenTransitionDone = whenTransitionDone;\n exports.wholeDivideDurations = wholeDivideDurations;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n\n},{}],3:[function(require,module,exports){\n/*!\nFullCalendar Day Grid Plugin v4.4.2\nDocs & License: https://fullcalendar.io/\n(c) 2019 Adam Shaw\n*/\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@fullcalendar/core')) :\n typeof define === 'function' && define.amd ? define(['exports', '@fullcalendar/core'], factory) :\n (global = global || self, factory(global.FullCalendarDayGrid = {}, global.FullCalendar));\n}(this, function (exports, core) { 'use strict';\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 var DayGridDateProfileGenerator = /** @class */ (function (_super) {\n __extends(DayGridDateProfileGenerator, _super);\n function DayGridDateProfileGenerator() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n // Computes the date range that will be rendered.\n DayGridDateProfileGenerator.prototype.buildRenderRange = function (currentRange, currentRangeUnit, isRangeAllDay) {\n var dateEnv = this.dateEnv;\n var renderRange = _super.prototype.buildRenderRange.call(this, currentRange, currentRangeUnit, isRangeAllDay);\n var start = renderRange.start;\n var end = renderRange.end;\n var endOfWeek;\n // year and month views should be aligned with weeks. this is already done for week\n if (/^(year|month)$/.test(currentRangeUnit)) {\n start = dateEnv.startOfWeek(start);\n // make end-of-week if not already\n endOfWeek = dateEnv.startOfWeek(end);\n if (endOfWeek.valueOf() !== end.valueOf()) {\n end = core.addWeeks(endOfWeek, 1);\n }\n }\n // ensure 6 weeks\n if (this.options.monthMode &&\n this.options.fixedWeekCount) {\n var rowCnt = Math.ceil(// could be partial weeks due to hiddenDays\n core.diffWeeks(start, end));\n end = core.addWeeks(end, 6 - rowCnt);\n }\n return { start: start, end: end };\n };\n return DayGridDateProfileGenerator;\n }(core.DateProfileGenerator));\n\n /* A rectangular panel that is absolutely positioned over other content\n ------------------------------------------------------------------------------------------------------------------------\n Options:\n - className (string)\n - content (HTML string, element, or element array)\n - parentEl\n - top\n - left\n - right (the x coord of where the right edge should be. not a \"CSS\" right)\n - autoHide (boolean)\n - show (callback)\n - hide (callback)\n */\n var Popover = /** @class */ (function () {\n function Popover(options) {\n var _this = this;\n this.isHidden = true;\n this.margin = 10; // the space required between the popover and the edges of the scroll container\n // Triggered when the user clicks *anywhere* in the document, for the autoHide feature\n this.documentMousedown = function (ev) {\n // only hide the popover if the click happened outside the popover\n if (_this.el && !_this.el.contains(ev.target)) {\n _this.hide();\n }\n };\n this.options = options;\n }\n // Shows the popover on the specified position. Renders it if not already\n Popover.prototype.show = function () {\n if (this.isHidden) {\n if (!this.el) {\n this.render();\n }\n this.el.style.display = '';\n this.position();\n this.isHidden = false;\n this.trigger('show');\n }\n };\n // Hides the popover, through CSS, but does not remove it from the DOM\n Popover.prototype.hide = function () {\n if (!this.isHidden) {\n this.el.style.display = 'none';\n this.isHidden = true;\n this.trigger('hide');\n }\n };\n // Creates `this.el` and renders content inside of it\n Popover.prototype.render = function () {\n var _this = this;\n var options = this.options;\n var el = this.el = core.createElement('div', {\n className: 'fc-popover ' + (options.className || ''),\n style: {\n top: '0',\n left: '0'\n }\n });\n if (typeof options.content === 'function') {\n options.content(el);\n }\n options.parentEl.appendChild(el);\n // when a click happens on anything inside with a 'fc-close' className, hide the popover\n core.listenBySelector(el, 'click', '.fc-close', function (ev) {\n _this.hide();\n });\n if (options.autoHide) {\n document.addEventListener('mousedown', this.documentMousedown);\n }\n };\n // Hides and unregisters any handlers\n Popover.prototype.destroy = function () {\n this.hide();\n if (this.el) {\n core.removeElement(this.el);\n this.el = null;\n }\n document.removeEventListener('mousedown', this.documentMousedown);\n };\n // Positions the popover optimally, using the top/left/right options\n Popover.prototype.position = function () {\n var options = this.options;\n var el = this.el;\n var elDims = el.getBoundingClientRect(); // only used for width,height\n var origin = core.computeRect(el.offsetParent);\n var clippingRect = core.computeClippingRect(options.parentEl);\n var top; // the \"position\" (not \"offset\") values for the popover\n var left; //\n // compute top and left\n top = options.top || 0;\n if (options.left !== undefined) {\n left = options.left;\n }\n else if (options.right !== undefined) {\n left = options.right - elDims.width; // derive the left value from the right value\n }\n else {\n left = 0;\n }\n // constrain to the view port. if constrained by two edges, give precedence to top/left\n top = Math.min(top, clippingRect.bottom - elDims.height - this.margin);\n top = Math.max(top, clippingRect.top + this.margin);\n left = Math.min(left, clippingRect.right - elDims.width - this.margin);\n left = Math.max(left, clippingRect.left + this.margin);\n core.applyStyle(el, {\n top: top - origin.top,\n left: left - origin.left\n });\n };\n // Triggers a callback. Calls a function in the option hash of the same name.\n // Arguments beyond the first `name` are forwarded on.\n // TODO: better code reuse for this. Repeat code\n // can kill this???\n Popover.prototype.trigger = function (name) {\n if (this.options[name]) {\n this.options[name].apply(this, Array.prototype.slice.call(arguments, 1));\n }\n };\n return Popover;\n }());\n\n /* Event-rendering methods for the DayGrid class\n ----------------------------------------------------------------------------------------------------------------------*/\n // \"Simple\" is bad a name. has nothing to do with SimpleDayGrid\n var SimpleDayGridEventRenderer = /** @class */ (function (_super) {\n __extends(SimpleDayGridEventRenderer, _super);\n function SimpleDayGridEventRenderer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n // Builds the HTML to be used for the default element for an individual segment\n SimpleDayGridEventRenderer.prototype.renderSegHtml = function (seg, mirrorInfo) {\n var context = this.context;\n var eventRange = seg.eventRange;\n var eventDef = eventRange.def;\n var eventUi = eventRange.ui;\n var allDay = eventDef.allDay;\n var isDraggable = core.computeEventDraggable(context, eventDef, eventUi);\n var isResizableFromStart = allDay && seg.isStart && core.computeEventStartResizable(context, eventDef, eventUi);\n var isResizableFromEnd = allDay && seg.isEnd && core.computeEventEndResizable(context, eventDef, eventUi);\n var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd, mirrorInfo);\n var skinCss = core.cssToStr(this.getSkinCss(eventUi));\n var timeHtml = '';\n var timeText;\n var titleHtml;\n classes.unshift('fc-day-grid-event', 'fc-h-event');\n // Only display a timed events time if it is the starting segment\n if (seg.isStart) {\n timeText = this.getTimeText(eventRange);\n if (timeText) {\n timeHtml = '' + core.htmlEscape(timeText) + '';\n }\n }\n titleHtml =\n '' +\n (core.htmlEscape(eventDef.title || '') || ' ') + // we always want one line of height\n '';\n return '
' +\n '
' +\n (context.options.dir === 'rtl' ?\n titleHtml + ' ' + timeHtml : // put a natural space in between\n timeHtml + ' ' + titleHtml //\n ) +\n '
' +\n (isResizableFromStart ?\n '
' :\n '') +\n (isResizableFromEnd ?\n '
' :\n '') +\n '
';\n };\n // Computes a default event time formatting string if `eventTimeFormat` is not explicitly defined\n SimpleDayGridEventRenderer.prototype.computeEventTimeFormat = function () {\n return {\n hour: 'numeric',\n minute: '2-digit',\n omitZeroMinute: true,\n meridiem: 'narrow'\n };\n };\n SimpleDayGridEventRenderer.prototype.computeDisplayEventEnd = function () {\n return false; // TODO: somehow consider the originating DayGrid's column count\n };\n return SimpleDayGridEventRenderer;\n }(core.FgEventRenderer));\n\n /* Event-rendering methods for the DayGrid class\n ----------------------------------------------------------------------------------------------------------------------*/\n var DayGridEventRenderer = /** @class */ (function (_super) {\n __extends(DayGridEventRenderer, _super);\n function DayGridEventRenderer(dayGrid) {\n var _this = _super.call(this) || this;\n _this.dayGrid = dayGrid;\n return _this;\n }\n // Renders the given foreground event segments onto the grid\n DayGridEventRenderer.prototype.attachSegs = function (segs, mirrorInfo) {\n var rowStructs = this.rowStructs = this.renderSegRows(segs);\n // append to each row's content skeleton\n this.dayGrid.rowEls.forEach(function (rowNode, i) {\n rowNode.querySelector('.fc-content-skeleton > table').appendChild(rowStructs[i].tbodyEl);\n });\n // removes the \"more..\" events popover\n if (!mirrorInfo) {\n this.dayGrid.removeSegPopover();\n }\n };\n // Unrenders all currently rendered foreground event segments\n DayGridEventRenderer.prototype.detachSegs = function () {\n var rowStructs = this.rowStructs || [];\n var rowStruct;\n while ((rowStruct = rowStructs.pop())) {\n core.removeElement(rowStruct.tbodyEl);\n }\n this.rowStructs = null;\n };\n // Uses the given events array to generate elements that should be appended to each row's content skeleton.\n // Returns an array of rowStruct objects (see the bottom of `renderSegRow`).\n // PRECONDITION: each segment shoud already have a rendered and assigned `.el`\n DayGridEventRenderer.prototype.renderSegRows = function (segs) {\n var rowStructs = [];\n var segRows;\n var row;\n segRows = this.groupSegRows(segs); // group into nested arrays\n // iterate each row of segment groupings\n for (row = 0; row < segRows.length; row++) {\n rowStructs.push(this.renderSegRow(row, segRows[row]));\n }\n return rowStructs;\n };\n // Given a row # and an array of segments all in the same row, render a element, a skeleton that contains\n // the segments. Returns object with a bunch of internal data about how the render was calculated.\n // NOTE: modifies rowSegs\n DayGridEventRenderer.prototype.renderSegRow = function (row, rowSegs) {\n var isRtl = this.context.isRtl;\n var dayGrid = this.dayGrid;\n var colCnt = dayGrid.colCnt;\n var segLevels = this.buildSegLevels(rowSegs); // group into sub-arrays of levels\n var levelCnt = Math.max(1, segLevels.length); // ensure at least one level\n var tbody = document.createElement('tbody');\n var segMatrix = []; // lookup for which segments are rendered into which level+col cells\n var cellMatrix = []; // lookup for all elements of the level+col matrix\n var loneCellMatrix = []; // lookup for elements that only take up a single column\n var i;\n var levelSegs;\n var col;\n var tr;\n var j;\n var seg;\n var td;\n // populates empty cells from the current column (`col`) to `endCol`\n function emptyCellsUntil(endCol) {\n while (col < endCol) {\n // try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh cell\n td = (loneCellMatrix[i - 1] || [])[col];\n if (td) {\n td.rowSpan = (td.rowSpan || 1) + 1;\n }\n else {\n td = document.createElement('td');\n tr.appendChild(td);\n }\n cellMatrix[i][col] = td;\n loneCellMatrix[i][col] = td;\n col++;\n }\n }\n for (i = 0; i < levelCnt; i++) { // iterate through all levels\n levelSegs = segLevels[i];\n col = 0;\n tr = document.createElement('tr');\n segMatrix.push([]);\n cellMatrix.push([]);\n loneCellMatrix.push([]);\n // levelCnt might be 1 even though there are no actual levels. protect against this.\n // this single empty row is useful for styling.\n if (levelSegs) {\n for (j = 0; j < levelSegs.length; j++) { // iterate through segments in level\n seg = levelSegs[j];\n var leftCol = isRtl ? (colCnt - 1 - seg.lastCol) : seg.firstCol;\n var rightCol = isRtl ? (colCnt - 1 - seg.firstCol) : seg.lastCol;\n emptyCellsUntil(leftCol);\n // create a container that occupies or more columns. append the event element.\n td = core.createElement('td', { className: 'fc-event-container' }, seg.el);\n if (leftCol !== rightCol) {\n td.colSpan = rightCol - leftCol + 1;\n }\n else { // a single-column segment\n loneCellMatrix[i][col] = td;\n }\n while (col <= rightCol) {\n cellMatrix[i][col] = td;\n segMatrix[i][col] = seg;\n col++;\n }\n tr.appendChild(td);\n }\n }\n emptyCellsUntil(colCnt); // finish off the row\n var introHtml = dayGrid.renderProps.renderIntroHtml();\n if (introHtml) {\n if (isRtl) {\n core.appendToElement(tr, introHtml);\n }\n else {\n core.prependToElement(tr, introHtml);\n }\n }\n tbody.appendChild(tr);\n }\n return {\n row: row,\n tbodyEl: tbody,\n cellMatrix: cellMatrix,\n segMatrix: segMatrix,\n segLevels: segLevels,\n segs: rowSegs\n };\n };\n // Stacks a flat array of segments, which are all assumed to be in the same row, into subarrays of vertical levels.\n // NOTE: modifies segs\n DayGridEventRenderer.prototype.buildSegLevels = function (segs) {\n var isRtl = this.context.isRtl;\n var colCnt = this.dayGrid.colCnt;\n var levels = [];\n var i;\n var seg;\n var j;\n // Give preference to elements with certain criteria, so they have\n // a chance to be closer to the top.\n segs = this.sortEventSegs(segs);\n for (i = 0; i < segs.length; i++) {\n seg = segs[i];\n // loop through levels, starting with the topmost, until the segment doesn't collide with other segments\n for (j = 0; j < levels.length; j++) {\n if (!isDaySegCollision(seg, levels[j])) {\n break;\n }\n }\n // `j` now holds the desired subrow index\n seg.level = j;\n seg.leftCol = isRtl ? (colCnt - 1 - seg.lastCol) : seg.firstCol; // for sorting only\n seg.rightCol = isRtl ? (colCnt - 1 - seg.firstCol) : seg.lastCol // for sorting only\n ;\n (levels[j] || (levels[j] = [])).push(seg);\n }\n // order segments left-to-right. very important if calendar is RTL\n for (j = 0; j < levels.length; j++) {\n levels[j].sort(compareDaySegCols);\n }\n return levels;\n };\n // Given a flat array of segments, return an array of sub-arrays, grouped by each segment's row\n DayGridEventRenderer.prototype.groupSegRows = function (segs) {\n var segRows = [];\n var i;\n for (i = 0; i < this.dayGrid.rowCnt; i++) {\n segRows.push([]);\n }\n for (i = 0; i < segs.length; i++) {\n segRows[segs[i].row].push(segs[i]);\n }\n return segRows;\n };\n // Computes a default `displayEventEnd` value if one is not expliclty defined\n DayGridEventRenderer.prototype.computeDisplayEventEnd = function () {\n return this.dayGrid.colCnt === 1; // we'll likely have space if there's only one day\n };\n return DayGridEventRenderer;\n }(SimpleDayGridEventRenderer));\n // Computes whether two segments' columns collide. They are assumed to be in the same row.\n function isDaySegCollision(seg, otherSegs) {\n var i;\n var otherSeg;\n for (i = 0; i < otherSegs.length; i++) {\n otherSeg = otherSegs[i];\n if (otherSeg.firstCol <= seg.lastCol &&\n otherSeg.lastCol >= seg.firstCol) {\n return true;\n }\n }\n return false;\n }\n // A cmp function for determining the leftmost event\n function compareDaySegCols(a, b) {\n return a.leftCol - b.leftCol;\n }\n\n var DayGridMirrorRenderer = /** @class */ (function (_super) {\n __extends(DayGridMirrorRenderer, _super);\n function DayGridMirrorRenderer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DayGridMirrorRenderer.prototype.attachSegs = function (segs, mirrorInfo) {\n var sourceSeg = mirrorInfo.sourceSeg;\n var rowStructs = this.rowStructs = this.renderSegRows(segs);\n // inject each new event skeleton into each associated row\n this.dayGrid.rowEls.forEach(function (rowNode, row) {\n var skeletonEl = core.htmlToElement('
'); // will be absolutely positioned\n var skeletonTopEl;\n var skeletonTop;\n // If there is an original segment, match the top position. Otherwise, put it at the row's top level\n if (sourceSeg && sourceSeg.row === row) {\n skeletonTopEl = sourceSeg.el;\n }\n else {\n skeletonTopEl = rowNode.querySelector('.fc-content-skeleton tbody');\n if (!skeletonTopEl) { // when no events\n skeletonTopEl = rowNode.querySelector('.fc-content-skeleton table');\n }\n }\n skeletonTop = skeletonTopEl.getBoundingClientRect().top -\n rowNode.getBoundingClientRect().top; // the offsetParent origin\n skeletonEl.style.top = skeletonTop + 'px';\n skeletonEl.querySelector('table').appendChild(rowStructs[row].tbodyEl);\n rowNode.appendChild(skeletonEl);\n });\n };\n return DayGridMirrorRenderer;\n }(DayGridEventRenderer));\n\n var EMPTY_CELL_HTML = '';\n var DayGridFillRenderer = /** @class */ (function (_super) {\n __extends(DayGridFillRenderer, _super);\n function DayGridFillRenderer(dayGrid) {\n var _this = _super.call(this) || this;\n _this.fillSegTag = 'td'; // override the default tag name\n _this.dayGrid = dayGrid;\n return _this;\n }\n DayGridFillRenderer.prototype.renderSegs = function (type, context, segs) {\n // don't render timed background events\n if (type === 'bgEvent') {\n segs = segs.filter(function (seg) {\n return seg.eventRange.def.allDay;\n });\n }\n _super.prototype.renderSegs.call(this, type, context, segs);\n };\n DayGridFillRenderer.prototype.attachSegs = function (type, segs) {\n var els = [];\n var i;\n var seg;\n var skeletonEl;\n for (i = 0; i < segs.length; i++) {\n seg = segs[i];\n skeletonEl = this.renderFillRow(type, seg);\n this.dayGrid.rowEls[seg.row].appendChild(skeletonEl);\n els.push(skeletonEl);\n }\n return els;\n };\n // Generates the HTML needed for one row of a fill. Requires the seg's el to be rendered.\n DayGridFillRenderer.prototype.renderFillRow = function (type, seg) {\n var dayGrid = this.dayGrid;\n var isRtl = this.context.isRtl;\n var colCnt = dayGrid.colCnt;\n var leftCol = isRtl ? (colCnt - 1 - seg.lastCol) : seg.firstCol;\n var rightCol = isRtl ? (colCnt - 1 - seg.firstCol) : seg.lastCol;\n var startCol = leftCol;\n var endCol = rightCol + 1;\n var className;\n var skeletonEl;\n var trEl;\n if (type === 'businessHours') {\n className = 'bgevent';\n }\n else {\n className = type.toLowerCase();\n }\n skeletonEl = core.htmlToElement('
' +\n '
' +\n '
');\n trEl = skeletonEl.getElementsByTagName('tr')[0];\n if (startCol > 0) {\n core.appendToElement(trEl, \n // will create (startCol + 1) td's\n new Array(startCol + 1).join(EMPTY_CELL_HTML));\n }\n seg.el.colSpan = endCol - startCol;\n trEl.appendChild(seg.el);\n if (endCol < colCnt) {\n core.appendToElement(trEl, \n // will create (colCnt - endCol) td's\n new Array(colCnt - endCol + 1).join(EMPTY_CELL_HTML));\n }\n var introHtml = dayGrid.renderProps.renderIntroHtml();\n if (introHtml) {\n if (isRtl) {\n core.appendToElement(trEl, introHtml);\n }\n else {\n core.prependToElement(trEl, introHtml);\n }\n }\n return skeletonEl;\n };\n return DayGridFillRenderer;\n }(core.FillRenderer));\n\n var DayTile = /** @class */ (function (_super) {\n __extends(DayTile, _super);\n function DayTile(el) {\n var _this = _super.call(this, el) || this;\n var eventRenderer = _this.eventRenderer = new DayTileEventRenderer(_this);\n var renderFrame = _this.renderFrame = core.memoizeRendering(_this._renderFrame);\n _this.renderFgEvents = core.memoizeRendering(eventRenderer.renderSegs.bind(eventRenderer), eventRenderer.unrender.bind(eventRenderer), [renderFrame]);\n _this.renderEventSelection = core.memoizeRendering(eventRenderer.selectByInstanceId.bind(eventRenderer), eventRenderer.unselectByInstanceId.bind(eventRenderer), [_this.renderFgEvents]);\n _this.renderEventDrag = core.memoizeRendering(eventRenderer.hideByHash.bind(eventRenderer), eventRenderer.showByHash.bind(eventRenderer), [renderFrame]);\n _this.renderEventResize = core.memoizeRendering(eventRenderer.hideByHash.bind(eventRenderer), eventRenderer.showByHash.bind(eventRenderer), [renderFrame]);\n return _this;\n }\n DayTile.prototype.firstContext = function (context) {\n context.calendar.registerInteractiveComponent(this, {\n el: this.el,\n useEventCenter: false\n });\n };\n DayTile.prototype.render = function (props, context) {\n this.renderFrame(props.date);\n this.renderFgEvents(context, props.fgSegs);\n this.renderEventSelection(props.eventSelection);\n this.renderEventDrag(props.eventDragInstances);\n this.renderEventResize(props.eventResizeInstances);\n };\n DayTile.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.renderFrame.unrender(); // should unrender everything else\n this.context.calendar.unregisterInteractiveComponent(this);\n };\n DayTile.prototype._renderFrame = function (date) {\n var _a = this.context, theme = _a.theme, dateEnv = _a.dateEnv, options = _a.options;\n var title = dateEnv.format(date, core.createFormatter(options.dayPopoverFormat) // TODO: cache\n );\n this.el.innerHTML =\n '
' +\n '' +\n core.htmlEscape(title) +\n '' +\n '' +\n '
' +\n '
' +\n '
' +\n '
';\n this.segContainerEl = this.el.querySelector('.fc-event-container');\n };\n DayTile.prototype.queryHit = function (positionLeft, positionTop, elWidth, elHeight) {\n var date = this.props.date; // HACK\n if (positionLeft < elWidth && positionTop < elHeight) {\n return {\n component: this,\n dateSpan: {\n allDay: true,\n range: { start: date, end: core.addDays(date, 1) }\n },\n dayEl: this.el,\n rect: {\n left: 0,\n top: 0,\n right: elWidth,\n bottom: elHeight\n },\n layer: 1\n };\n }\n };\n return DayTile;\n }(core.DateComponent));\n var DayTileEventRenderer = /** @class */ (function (_super) {\n __extends(DayTileEventRenderer, _super);\n function DayTileEventRenderer(dayTile) {\n var _this = _super.call(this) || this;\n _this.dayTile = dayTile;\n return _this;\n }\n DayTileEventRenderer.prototype.attachSegs = function (segs) {\n for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {\n var seg = segs_1[_i];\n this.dayTile.segContainerEl.appendChild(seg.el);\n }\n };\n DayTileEventRenderer.prototype.detachSegs = function (segs) {\n for (var _i = 0, segs_2 = segs; _i < segs_2.length; _i++) {\n var seg = segs_2[_i];\n core.removeElement(seg.el);\n }\n };\n return DayTileEventRenderer;\n }(SimpleDayGridEventRenderer));\n\n var DayBgRow = /** @class */ (function () {\n function DayBgRow(context) {\n this.context = context;\n }\n DayBgRow.prototype.renderHtml = function (props) {\n var parts = [];\n if (props.renderIntroHtml) {\n parts.push(props.renderIntroHtml());\n }\n for (var _i = 0, _a = props.cells; _i < _a.length; _i++) {\n var cell = _a[_i];\n parts.push(renderCellHtml(cell.date, props.dateProfile, this.context, cell.htmlAttrs));\n }\n if (!props.cells.length) {\n parts.push('');\n }\n if (this.context.options.dir === 'rtl') {\n parts.reverse();\n }\n return '' + parts.join('') + '';\n };\n return DayBgRow;\n }());\n function renderCellHtml(date, dateProfile, context, otherAttrs) {\n var dateEnv = context.dateEnv, theme = context.theme;\n var isDateValid = core.rangeContainsMarker(dateProfile.activeRange, date); // TODO: called too frequently. cache somehow.\n var classes = core.getDayClasses(date, dateProfile, context);\n classes.unshift('fc-day', theme.getClass('widgetContent'));\n return '';\n }\n\n var DAY_NUM_FORMAT = core.createFormatter({ day: 'numeric' });\n var WEEK_NUM_FORMAT = core.createFormatter({ week: 'numeric' });\n var DayGrid = /** @class */ (function (_super) {\n __extends(DayGrid, _super);\n function DayGrid(el, renderProps) {\n var _this = _super.call(this, el) || this;\n _this.bottomCoordPadding = 0; // hack for extending the hit area for the last row of the coordinate grid\n _this.isCellSizesDirty = false;\n _this.renderProps = renderProps;\n var eventRenderer = _this.eventRenderer = new DayGridEventRenderer(_this);\n var fillRenderer = _this.fillRenderer = new DayGridFillRenderer(_this);\n _this.mirrorRenderer = new DayGridMirrorRenderer(_this);\n var renderCells = _this.renderCells = core.memoizeRendering(_this._renderCells, _this._unrenderCells);\n _this.renderBusinessHours = core.memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'businessHours'), fillRenderer.unrender.bind(fillRenderer, 'businessHours'), [renderCells]);\n _this.renderDateSelection = core.memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'highlight'), fillRenderer.unrender.bind(fillRenderer, 'highlight'), [renderCells]);\n _this.renderBgEvents = core.memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'bgEvent'), fillRenderer.unrender.bind(fillRenderer, 'bgEvent'), [renderCells]);\n _this.renderFgEvents = core.memoizeRendering(eventRenderer.renderSegs.bind(eventRenderer), eventRenderer.unrender.bind(eventRenderer), [renderCells]);\n _this.renderEventSelection = core.memoizeRendering(eventRenderer.selectByInstanceId.bind(eventRenderer), eventRenderer.unselectByInstanceId.bind(eventRenderer), [_this.renderFgEvents]);\n _this.renderEventDrag = core.memoizeRendering(_this._renderEventDrag, _this._unrenderEventDrag, [renderCells]);\n _this.renderEventResize = core.memoizeRendering(_this._renderEventResize, _this._unrenderEventResize, [renderCells]);\n return _this;\n }\n DayGrid.prototype.render = function (props, context) {\n var cells = props.cells;\n this.rowCnt = cells.length;\n this.colCnt = cells[0].length;\n this.renderCells(cells, props.isRigid);\n this.renderBusinessHours(context, props.businessHourSegs);\n this.renderDateSelection(context, props.dateSelectionSegs);\n this.renderBgEvents(context, props.bgEventSegs);\n this.renderFgEvents(context, props.fgEventSegs);\n this.renderEventSelection(props.eventSelection);\n this.renderEventDrag(props.eventDrag);\n this.renderEventResize(props.eventResize);\n if (this.segPopoverTile) {\n this.updateSegPopoverTile();\n }\n };\n DayGrid.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.renderCells.unrender(); // will unrender everything else\n };\n DayGrid.prototype.getCellRange = function (row, col) {\n var start = this.props.cells[row][col].date;\n var end = core.addDays(start, 1);\n return { start: start, end: end };\n };\n DayGrid.prototype.updateSegPopoverTile = function (date, segs) {\n var ownProps = this.props;\n this.segPopoverTile.receiveProps({\n date: date || this.segPopoverTile.props.date,\n fgSegs: segs || this.segPopoverTile.props.fgSegs,\n eventSelection: ownProps.eventSelection,\n eventDragInstances: ownProps.eventDrag ? ownProps.eventDrag.affectedInstances : null,\n eventResizeInstances: ownProps.eventResize ? ownProps.eventResize.affectedInstances : null\n }, this.context);\n };\n /* Date Rendering\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype._renderCells = function (cells, isRigid) {\n var _a = this.context, calendar = _a.calendar, view = _a.view, isRtl = _a.isRtl, dateEnv = _a.dateEnv;\n var _b = this, rowCnt = _b.rowCnt, colCnt = _b.colCnt;\n var html = '';\n var row;\n var col;\n for (row = 0; row < rowCnt; row++) {\n html += this.renderDayRowHtml(row, isRigid);\n }\n this.el.innerHTML = html;\n this.rowEls = core.findElements(this.el, '.fc-row');\n this.cellEls = core.findElements(this.el, '.fc-day, .fc-disabled-day');\n if (isRtl) {\n this.cellEls.reverse();\n }\n this.rowPositions = new core.PositionCache(this.el, this.rowEls, false, true // vertical\n );\n this.colPositions = new core.PositionCache(this.el, this.cellEls.slice(0, colCnt), // only the first row\n true, false // horizontal\n );\n // trigger dayRender with each cell's element\n for (row = 0; row < rowCnt; row++) {\n for (col = 0; col < colCnt; col++) {\n calendar.publiclyTrigger('dayRender', [\n {\n date: dateEnv.toDate(cells[row][col].date),\n el: this.getCellEl(row, col),\n view: view\n }\n ]);\n }\n }\n this.isCellSizesDirty = true;\n };\n DayGrid.prototype._unrenderCells = function () {\n this.removeSegPopover();\n };\n // Generates the HTML for a single row, which is a div that wraps a table.\n // `row` is the row number.\n DayGrid.prototype.renderDayRowHtml = function (row, isRigid) {\n var theme = this.context.theme;\n var classes = ['fc-row', 'fc-week', theme.getClass('dayRow')];\n if (isRigid) {\n classes.push('fc-rigid');\n }\n var bgRow = new DayBgRow(this.context);\n return '' +\n '
' +\n '
' +\n '' +\n bgRow.renderHtml({\n cells: this.props.cells[row],\n dateProfile: this.props.dateProfile,\n renderIntroHtml: this.renderProps.renderBgIntroHtml\n }) +\n '
' +\n '
' +\n '
' +\n '' +\n (this.getIsNumbersVisible() ?\n '' +\n this.renderNumberTrHtml(row) +\n '' :\n '') +\n '
' +\n '
' +\n '
';\n };\n DayGrid.prototype.getIsNumbersVisible = function () {\n return this.getIsDayNumbersVisible() ||\n this.renderProps.cellWeekNumbersVisible ||\n this.renderProps.colWeekNumbersVisible;\n };\n DayGrid.prototype.getIsDayNumbersVisible = function () {\n return this.rowCnt > 1;\n };\n /* Grid Number Rendering\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype.renderNumberTrHtml = function (row) {\n var isRtl = this.context.isRtl;\n var intro = this.renderProps.renderNumberIntroHtml(row, this);\n return '' +\n '' +\n (isRtl ? '' : intro) +\n this.renderNumberCellsHtml(row) +\n (isRtl ? intro : '') +\n '';\n };\n DayGrid.prototype.renderNumberCellsHtml = function (row) {\n var htmls = [];\n var col;\n var date;\n for (col = 0; col < this.colCnt; col++) {\n date = this.props.cells[row][col].date;\n htmls.push(this.renderNumberCellHtml(date));\n }\n if (this.context.isRtl) {\n htmls.reverse();\n }\n return htmls.join('');\n };\n // Generates the HTML for the s of the \"number\" row in the DayGrid's content skeleton.\n // The number row will only exist if either day numbers or week numbers are turned on.\n DayGrid.prototype.renderNumberCellHtml = function (date) {\n var _a = this.context, dateEnv = _a.dateEnv, options = _a.options;\n var html = '';\n var isDateValid = core.rangeContainsMarker(this.props.dateProfile.activeRange, date); // TODO: called too frequently. cache somehow.\n var isDayNumberVisible = this.getIsDayNumbersVisible() && isDateValid;\n var classes;\n var weekCalcFirstDow;\n if (!isDayNumberVisible && !this.renderProps.cellWeekNumbersVisible) {\n // no numbers in day cell (week number must be along the side)\n return ''; // will create an empty space above events :(\n }\n classes = core.getDayClasses(date, this.props.dateProfile, this.context);\n classes.unshift('fc-day-top');\n if (this.renderProps.cellWeekNumbersVisible) {\n weekCalcFirstDow = dateEnv.weekDow;\n }\n html += '';\n if (this.renderProps.cellWeekNumbersVisible && (date.getUTCDay() === weekCalcFirstDow)) {\n html += core.buildGotoAnchorHtml(options, dateEnv, { date: date, type: 'week' }, { 'class': 'fc-week-number' }, dateEnv.format(date, WEEK_NUM_FORMAT) // inner HTML\n );\n }\n if (isDayNumberVisible) {\n html += core.buildGotoAnchorHtml(options, dateEnv, date, { 'class': 'fc-day-number' }, dateEnv.format(date, DAY_NUM_FORMAT) // inner HTML\n );\n }\n html += '';\n return html;\n };\n /* Sizing\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype.updateSize = function (isResize) {\n var calendar = this.context.calendar;\n var _a = this, fillRenderer = _a.fillRenderer, eventRenderer = _a.eventRenderer, mirrorRenderer = _a.mirrorRenderer;\n if (isResize ||\n this.isCellSizesDirty ||\n calendar.isEventsUpdated // hack\n ) {\n this.buildPositionCaches();\n this.isCellSizesDirty = false;\n }\n fillRenderer.computeSizes(isResize);\n eventRenderer.computeSizes(isResize);\n mirrorRenderer.computeSizes(isResize);\n fillRenderer.assignSizes(isResize);\n eventRenderer.assignSizes(isResize);\n mirrorRenderer.assignSizes(isResize);\n };\n DayGrid.prototype.buildPositionCaches = function () {\n this.buildColPositions();\n this.buildRowPositions();\n };\n DayGrid.prototype.buildColPositions = function () {\n this.colPositions.build();\n };\n DayGrid.prototype.buildRowPositions = function () {\n this.rowPositions.build();\n this.rowPositions.bottoms[this.rowCnt - 1] += this.bottomCoordPadding; // hack\n };\n /* Hit System\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype.positionToHit = function (leftPosition, topPosition) {\n var _a = this, colPositions = _a.colPositions, rowPositions = _a.rowPositions;\n var col = colPositions.leftToIndex(leftPosition);\n var row = rowPositions.topToIndex(topPosition);\n if (row != null && col != null) {\n return {\n row: row,\n col: col,\n dateSpan: {\n range: this.getCellRange(row, col),\n allDay: true\n },\n dayEl: this.getCellEl(row, col),\n relativeRect: {\n left: colPositions.lefts[col],\n right: colPositions.rights[col],\n top: rowPositions.tops[row],\n bottom: rowPositions.bottoms[row]\n }\n };\n }\n };\n /* Cell System\n ------------------------------------------------------------------------------------------------------------------*/\n // FYI: the first column is the leftmost column, regardless of date\n DayGrid.prototype.getCellEl = function (row, col) {\n return this.cellEls[row * this.colCnt + col];\n };\n /* Event Drag Visualization\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype._renderEventDrag = function (state) {\n if (state) {\n this.eventRenderer.hideByHash(state.affectedInstances);\n this.fillRenderer.renderSegs('highlight', this.context, state.segs);\n }\n };\n DayGrid.prototype._unrenderEventDrag = function (state) {\n if (state) {\n this.eventRenderer.showByHash(state.affectedInstances);\n this.fillRenderer.unrender('highlight', this.context);\n }\n };\n /* Event Resize Visualization\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype._renderEventResize = function (state) {\n if (state) {\n this.eventRenderer.hideByHash(state.affectedInstances);\n this.fillRenderer.renderSegs('highlight', this.context, state.segs);\n this.mirrorRenderer.renderSegs(this.context, state.segs, { isResizing: true, sourceSeg: state.sourceSeg });\n }\n };\n DayGrid.prototype._unrenderEventResize = function (state) {\n if (state) {\n this.eventRenderer.showByHash(state.affectedInstances);\n this.fillRenderer.unrender('highlight', this.context);\n this.mirrorRenderer.unrender(this.context, state.segs, { isResizing: true, sourceSeg: state.sourceSeg });\n }\n };\n /* More+ Link Popover\n ------------------------------------------------------------------------------------------------------------------*/\n DayGrid.prototype.removeSegPopover = function () {\n if (this.segPopover) {\n this.segPopover.hide(); // in handler, will call segPopover's removeElement\n }\n };\n // Limits the number of \"levels\" (vertically stacking layers of events) for each row of the grid.\n // `levelLimit` can be false (don't limit), a number, or true (should be computed).\n DayGrid.prototype.limitRows = function (levelLimit) {\n var rowStructs = this.eventRenderer.rowStructs || [];\n var row; // row #\n var rowLevelLimit;\n for (row = 0; row < rowStructs.length; row++) {\n this.unlimitRow(row);\n if (!levelLimit) {\n rowLevelLimit = false;\n }\n else if (typeof levelLimit === 'number') {\n rowLevelLimit = levelLimit;\n }\n else {\n rowLevelLimit = this.computeRowLevelLimit(row);\n }\n if (rowLevelLimit !== false) {\n this.limitRow(row, rowLevelLimit);\n }\n }\n };\n // Computes the number of levels a row will accomodate without going outside its bounds.\n // Assumes the row is \"rigid\" (maintains a constant height regardless of what is inside).\n // `row` is the row number.\n DayGrid.prototype.computeRowLevelLimit = function (row) {\n var rowEl = this.rowEls[row]; // the containing \"fake\" row div\n var rowBottom = rowEl.getBoundingClientRect().bottom; // relative to viewport!\n var trEls = core.findChildren(this.eventRenderer.rowStructs[row].tbodyEl);\n var i;\n var trEl;\n // Reveal one level at a time and stop when we find one out of bounds\n for (i = 0; i < trEls.length; i++) {\n trEl = trEls[i];\n trEl.classList.remove('fc-limited'); // reset to original state (reveal)\n if (trEl.getBoundingClientRect().bottom > rowBottom) {\n return i;\n }\n }\n return false; // should not limit at all\n };\n // Limits the given grid row to the maximum number of levels and injects \"more\" links if necessary.\n // `row` is the row number.\n // `levelLimit` is a number for the maximum (inclusive) number of levels allowed.\n DayGrid.prototype.limitRow = function (row, levelLimit) {\n var _this = this;\n var colCnt = this.colCnt;\n var isRtl = this.context.isRtl;\n var rowStruct = this.eventRenderer.rowStructs[row];\n var moreNodes = []; // array of \"more\" links and DOM nodes\n var col = 0; // col #, left-to-right (not chronologically)\n var levelSegs; // array of segment objects in the last allowable level, ordered left-to-right\n var cellMatrix; // a matrix (by level, then column) of all elements in the row\n var limitedNodes; // array of temporarily hidden level and segment DOM nodes\n var i;\n var seg;\n var segsBelow; // array of segment objects below `seg` in the current `col`\n var totalSegsBelow; // total number of segments below `seg` in any of the columns `seg` occupies\n var colSegsBelow; // array of segment arrays, below seg, one for each column (offset from segs's first column)\n var td;\n var rowSpan;\n var segMoreNodes; // array of \"more\" cells that will stand-in for the current seg's cell\n var j;\n var moreTd;\n var moreWrap;\n var moreLink;\n // Iterates through empty level cells and places \"more\" links inside if need be\n var emptyCellsUntil = function (endCol) {\n while (col < endCol) {\n segsBelow = _this.getCellSegs(row, col, levelLimit);\n if (segsBelow.length) {\n td = cellMatrix[levelLimit - 1][col];\n moreLink = _this.renderMoreLink(row, col, segsBelow);\n moreWrap = core.createElement('div', null, moreLink);\n td.appendChild(moreWrap);\n moreNodes.push(moreWrap);\n }\n col++;\n }\n };\n if (levelLimit && levelLimit < rowStruct.segLevels.length) { // is it actually over the limit?\n levelSegs = rowStruct.segLevels[levelLimit - 1];\n cellMatrix = rowStruct.cellMatrix;\n limitedNodes = core.findChildren(rowStruct.tbodyEl).slice(levelLimit); // get level elements past the limit\n limitedNodes.forEach(function (node) {\n node.classList.add('fc-limited'); // hide elements and get a simple DOM-nodes array\n });\n // iterate though segments in the last allowable level\n for (i = 0; i < levelSegs.length; i++) {\n seg = levelSegs[i];\n var leftCol = isRtl ? (colCnt - 1 - seg.lastCol) : seg.firstCol;\n var rightCol = isRtl ? (colCnt - 1 - seg.firstCol) : seg.lastCol;\n emptyCellsUntil(leftCol); // process empty cells before the segment\n // determine *all* segments below `seg` that occupy the same columns\n colSegsBelow = [];\n totalSegsBelow = 0;\n while (col <= rightCol) {\n segsBelow = this.getCellSegs(row, col, levelLimit);\n colSegsBelow.push(segsBelow);\n totalSegsBelow += segsBelow.length;\n col++;\n }\n if (totalSegsBelow) { // do we need to replace this segment with one or many \"more\" links?\n td = cellMatrix[levelLimit - 1][leftCol]; // the segment's parent cell\n rowSpan = td.rowSpan || 1;\n segMoreNodes = [];\n // make a replacement for each column the segment occupies. will be one for each colspan\n for (j = 0; j < colSegsBelow.length; j++) {\n moreTd = core.createElement('td', { className: 'fc-more-cell', rowSpan: rowSpan });\n segsBelow = colSegsBelow[j];\n moreLink = this.renderMoreLink(row, leftCol + j, [seg].concat(segsBelow) // count seg as hidden too\n );\n moreWrap = core.createElement('div', null, moreLink);\n moreTd.appendChild(moreWrap);\n segMoreNodes.push(moreTd);\n moreNodes.push(moreTd);\n }\n td.classList.add('fc-limited');\n core.insertAfterElement(td, segMoreNodes);\n limitedNodes.push(td);\n }\n }\n emptyCellsUntil(this.colCnt); // finish off the level\n rowStruct.moreEls = moreNodes; // for easy undoing later\n rowStruct.limitedEls = limitedNodes; // for easy undoing later\n }\n };\n // Reveals all levels and removes all \"more\"-related elements for a grid's row.\n // `row` is a row number.\n DayGrid.prototype.unlimitRow = function (row) {\n var rowStruct = this.eventRenderer.rowStructs[row];\n if (rowStruct.moreEls) {\n rowStruct.moreEls.forEach(core.removeElement);\n rowStruct.moreEls = null;\n }\n if (rowStruct.limitedEls) {\n rowStruct.limitedEls.forEach(function (limitedEl) {\n limitedEl.classList.remove('fc-limited');\n });\n rowStruct.limitedEls = null;\n }\n };\n // Renders an element that represents hidden event element for a cell.\n // Responsible for attaching click handler as well.\n DayGrid.prototype.renderMoreLink = function (row, col, hiddenSegs) {\n var _this = this;\n var _a = this.context, calendar = _a.calendar, view = _a.view, dateEnv = _a.dateEnv, options = _a.options, isRtl = _a.isRtl;\n var a = core.createElement('a', { className: 'fc-more' });\n a.innerText = this.getMoreLinkText(hiddenSegs.length);\n a.addEventListener('click', function (ev) {\n var clickOption = options.eventLimitClick;\n var _col = isRtl ? _this.colCnt - col - 1 : col; // HACK: props.cells has different dir system?\n var date = _this.props.cells[row][_col].date;\n var moreEl = ev.currentTarget;\n var dayEl = _this.getCellEl(row, col);\n var allSegs = _this.getCellSegs(row, col);\n // rescope the segments to be within the cell's date\n var reslicedAllSegs = _this.resliceDaySegs(allSegs, date);\n var reslicedHiddenSegs = _this.resliceDaySegs(hiddenSegs, date);\n if (typeof clickOption === 'function') {\n // the returned value can be an atomic option\n clickOption = calendar.publiclyTrigger('eventLimitClick', [\n {\n date: dateEnv.toDate(date),\n allDay: true,\n dayEl: dayEl,\n moreEl: moreEl,\n segs: reslicedAllSegs,\n hiddenSegs: reslicedHiddenSegs,\n jsEvent: ev,\n view: view\n }\n ]);\n }\n if (clickOption === 'popover') {\n _this.showSegPopover(row, col, moreEl, reslicedAllSegs);\n }\n else if (typeof clickOption === 'string') { // a view name\n calendar.zoomTo(date, clickOption);\n }\n });\n return a;\n };\n // Reveals the popover that displays all events within a cell\n DayGrid.prototype.showSegPopover = function (row, col, moreLink, segs) {\n var _this = this;\n var _a = this.context, calendar = _a.calendar, view = _a.view, theme = _a.theme, isRtl = _a.isRtl;\n var _col = isRtl ? this.colCnt - col - 1 : col; // HACK: props.cells has different dir system?\n var moreWrap = moreLink.parentNode; // the
wrapper around the \n var topEl; // the element we want to match the top coordinate of\n var options;\n if (this.rowCnt === 1) {\n topEl = view.el; // will cause the popover to cover any sort of header\n }\n else {\n topEl = this.rowEls[row]; // will align with top of row\n }\n options = {\n className: 'fc-more-popover ' + theme.getClass('popover'),\n parentEl: view.el,\n top: core.computeRect(topEl).top,\n autoHide: true,\n content: function (el) {\n _this.segPopoverTile = new DayTile(el);\n _this.updateSegPopoverTile(_this.props.cells[row][_col].date, segs);\n },\n hide: function () {\n _this.segPopoverTile.destroy();\n _this.segPopoverTile = null;\n _this.segPopover.destroy();\n _this.segPopover = null;\n }\n };\n // Determine horizontal coordinate.\n // We use the moreWrap instead of the to avoid border confusion.\n if (isRtl) {\n options.right = core.computeRect(moreWrap).right + 1; // +1 to be over cell border\n }\n else {\n options.left = core.computeRect(moreWrap).left - 1; // -1 to be over cell border\n }\n this.segPopover = new Popover(options);\n this.segPopover.show();\n calendar.releaseAfterSizingTriggers(); // hack for eventPositioned\n };\n // Given the events within an array of segment objects, reslice them to be in a single day\n DayGrid.prototype.resliceDaySegs = function (segs, dayDate) {\n var dayStart = dayDate;\n var dayEnd = core.addDays(dayStart, 1);\n var dayRange = { start: dayStart, end: dayEnd };\n var newSegs = [];\n for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {\n var seg = segs_1[_i];\n var eventRange = seg.eventRange;\n var origRange = eventRange.range;\n var slicedRange = core.intersectRanges(origRange, dayRange);\n if (slicedRange) {\n newSegs.push(__assign({}, seg, { eventRange: {\n def: eventRange.def,\n ui: __assign({}, eventRange.ui, { durationEditable: false }),\n instance: eventRange.instance,\n range: slicedRange\n }, isStart: seg.isStart && slicedRange.start.valueOf() === origRange.start.valueOf(), isEnd: seg.isEnd && slicedRange.end.valueOf() === origRange.end.valueOf() }));\n }\n }\n return newSegs;\n };\n // Generates the text that should be inside a \"more\" link, given the number of events it represents\n DayGrid.prototype.getMoreLinkText = function (num) {\n var opt = this.context.options.eventLimitText;\n if (typeof opt === 'function') {\n return opt(num);\n }\n else {\n return '+' + num + ' ' + opt;\n }\n };\n // Returns segments within a given cell.\n // If `startLevel` is specified, returns only events including and below that level. Otherwise returns all segs.\n DayGrid.prototype.getCellSegs = function (row, col, startLevel) {\n var segMatrix = this.eventRenderer.rowStructs[row].segMatrix;\n var level = startLevel || 0;\n var segs = [];\n var seg;\n while (level < segMatrix.length) {\n seg = segMatrix[level][col];\n if (seg) {\n segs.push(seg);\n }\n level++;\n }\n return segs;\n };\n return DayGrid;\n }(core.DateComponent));\n\n var WEEK_NUM_FORMAT$1 = core.createFormatter({ week: 'numeric' });\n /* An abstract class for the daygrid views, as well as month view. Renders one or more rows of day cells.\n ----------------------------------------------------------------------------------------------------------------------*/\n // It is a manager for a DayGrid subcomponent, which does most of the heavy lifting.\n // It is responsible for managing width/height.\n var AbstractDayGridView = /** @class */ (function (_super) {\n __extends(AbstractDayGridView, _super);\n function AbstractDayGridView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.processOptions = core.memoize(_this._processOptions);\n _this.renderSkeleton = core.memoizeRendering(_this._renderSkeleton, _this._unrenderSkeleton);\n /* Header Rendering\n ------------------------------------------------------------------------------------------------------------------*/\n // Generates the HTML that will go before the day-of week header cells\n _this.renderHeadIntroHtml = function () {\n var _a = _this.context, theme = _a.theme, options = _a.options;\n if (_this.colWeekNumbersVisible) {\n return '' +\n '' +\n '' + // needed for matchCellWidths\n core.htmlEscape(options.weekLabel) +\n '' +\n '';\n }\n return '';\n };\n /* Day Grid Rendering\n ------------------------------------------------------------------------------------------------------------------*/\n // Generates the HTML that will go before content-skeleton cells that display the day/week numbers\n _this.renderDayGridNumberIntroHtml = function (row, dayGrid) {\n var _a = _this.context, options = _a.options, dateEnv = _a.dateEnv;\n var weekStart = dayGrid.props.cells[row][0].date;\n if (_this.colWeekNumbersVisible) {\n return '' +\n '' +\n core.buildGotoAnchorHtml(// aside from link, important for matchCellWidths\n options, dateEnv, { date: weekStart, type: 'week', forceOff: dayGrid.colCnt === 1 }, dateEnv.format(weekStart, WEEK_NUM_FORMAT$1) // inner HTML\n ) +\n '';\n }\n return '';\n };\n // Generates the HTML that goes before the day bg cells for each day-row\n _this.renderDayGridBgIntroHtml = function () {\n var theme = _this.context.theme;\n if (_this.colWeekNumbersVisible) {\n return '';\n }\n return '';\n };\n // Generates the HTML that goes before every other type of row generated by DayGrid.\n // Affects mirror-skeleton and highlight-skeleton rows.\n _this.renderDayGridIntroHtml = function () {\n if (_this.colWeekNumbersVisible) {\n return '';\n }\n return '';\n };\n return _this;\n }\n AbstractDayGridView.prototype._processOptions = function (options) {\n if (options.weekNumbers) {\n if (options.weekNumbersWithinDays) {\n this.cellWeekNumbersVisible = true;\n this.colWeekNumbersVisible = false;\n }\n else {\n this.cellWeekNumbersVisible = false;\n this.colWeekNumbersVisible = true;\n }\n }\n else {\n this.colWeekNumbersVisible = false;\n this.cellWeekNumbersVisible = false;\n }\n };\n AbstractDayGridView.prototype.render = function (props, context) {\n _super.prototype.render.call(this, props, context);\n this.processOptions(context.options);\n this.renderSkeleton(context);\n };\n AbstractDayGridView.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.renderSkeleton.unrender();\n };\n AbstractDayGridView.prototype._renderSkeleton = function (context) {\n this.el.classList.add('fc-dayGrid-view');\n this.el.innerHTML = this.renderSkeletonHtml();\n this.scroller = new core.ScrollComponent('hidden', // overflow x\n 'auto' // overflow y\n );\n var dayGridContainerEl = this.scroller.el;\n this.el.querySelector('.fc-body > tr > td').appendChild(dayGridContainerEl);\n dayGridContainerEl.classList.add('fc-day-grid-container');\n var dayGridEl = core.createElement('div', { className: 'fc-day-grid' });\n dayGridContainerEl.appendChild(dayGridEl);\n this.dayGrid = new DayGrid(dayGridEl, {\n renderNumberIntroHtml: this.renderDayGridNumberIntroHtml,\n renderBgIntroHtml: this.renderDayGridBgIntroHtml,\n renderIntroHtml: this.renderDayGridIntroHtml,\n colWeekNumbersVisible: this.colWeekNumbersVisible,\n cellWeekNumbersVisible: this.cellWeekNumbersVisible\n });\n };\n AbstractDayGridView.prototype._unrenderSkeleton = function () {\n this.el.classList.remove('fc-dayGrid-view');\n this.dayGrid.destroy();\n this.scroller.destroy();\n };\n // Builds the HTML skeleton for the view.\n // The day-grid component will render inside of a container defined by this HTML.\n AbstractDayGridView.prototype.renderSkeletonHtml = function () {\n var _a = this.context, theme = _a.theme, options = _a.options;\n return '' +\n '' +\n (options.columnHeader ?\n '' +\n '' +\n '' +\n '' +\n '' :\n '') +\n '' +\n '' +\n '' +\n '' +\n '' +\n '
 
';\n };\n // Generates an HTML attribute string for setting the width of the week number column, if it is known\n AbstractDayGridView.prototype.weekNumberStyleAttr = function () {\n if (this.weekNumberWidth != null) {\n return 'style=\"width:' + this.weekNumberWidth + 'px\"';\n }\n return '';\n };\n // Determines whether each row should have a constant height\n AbstractDayGridView.prototype.hasRigidRows = function () {\n var eventLimit = this.context.options.eventLimit;\n return eventLimit && typeof eventLimit !== 'number';\n };\n /* Dimensions\n ------------------------------------------------------------------------------------------------------------------*/\n AbstractDayGridView.prototype.updateSize = function (isResize, viewHeight, isAuto) {\n _super.prototype.updateSize.call(this, isResize, viewHeight, isAuto); // will call updateBaseSize. important that executes first\n this.dayGrid.updateSize(isResize);\n };\n // Refreshes the horizontal dimensions of the view\n AbstractDayGridView.prototype.updateBaseSize = function (isResize, viewHeight, isAuto) {\n var dayGrid = this.dayGrid;\n var eventLimit = this.context.options.eventLimit;\n var headRowEl = this.header ? this.header.el : null; // HACK\n var scrollerHeight;\n var scrollbarWidths;\n // hack to give the view some height prior to dayGrid's columns being rendered\n // TODO: separate setting height from scroller VS dayGrid.\n if (!dayGrid.rowEls) {\n if (!isAuto) {\n scrollerHeight = this.computeScrollerHeight(viewHeight);\n this.scroller.setHeight(scrollerHeight);\n }\n return;\n }\n if (this.colWeekNumbersVisible) {\n // Make sure all week number cells running down the side have the same width.\n this.weekNumberWidth = core.matchCellWidths(core.findElements(this.el, '.fc-week-number'));\n }\n // reset all heights to be natural\n this.scroller.clear();\n if (headRowEl) {\n core.uncompensateScroll(headRowEl);\n }\n dayGrid.removeSegPopover(); // kill the \"more\" popover if displayed\n // is the event limit a constant level number?\n if (eventLimit && typeof eventLimit === 'number') {\n dayGrid.limitRows(eventLimit); // limit the levels first so the height can redistribute after\n }\n // distribute the height to the rows\n // (viewHeight is a \"recommended\" value if isAuto)\n scrollerHeight = this.computeScrollerHeight(viewHeight);\n this.setGridHeight(scrollerHeight, isAuto);\n // is the event limit dynamically calculated?\n if (eventLimit && typeof eventLimit !== 'number') {\n dayGrid.limitRows(eventLimit); // limit the levels after the grid's row heights have been set\n }\n if (!isAuto) { // should we force dimensions of the scroll container?\n this.scroller.setHeight(scrollerHeight);\n scrollbarWidths = this.scroller.getScrollbarWidths();\n if (scrollbarWidths.left || scrollbarWidths.right) { // using scrollbars?\n if (headRowEl) {\n core.compensateScroll(headRowEl, scrollbarWidths);\n }\n // doing the scrollbar compensation might have created text overflow which created more height. redo\n scrollerHeight = this.computeScrollerHeight(viewHeight);\n this.scroller.setHeight(scrollerHeight);\n }\n // guarantees the same scrollbar widths\n this.scroller.lockOverflow(scrollbarWidths);\n }\n };\n // given a desired total height of the view, returns what the height of the scroller should be\n AbstractDayGridView.prototype.computeScrollerHeight = function (viewHeight) {\n return viewHeight -\n core.subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller\n };\n // Sets the height of just the DayGrid component in this view\n AbstractDayGridView.prototype.setGridHeight = function (height, isAuto) {\n if (this.context.options.monthMode) {\n // if auto, make the height of each row the height that it would be if there were 6 weeks\n if (isAuto) {\n height *= this.dayGrid.rowCnt / 6;\n }\n core.distributeHeight(this.dayGrid.rowEls, height, !isAuto); // if auto, don't compensate for height-hogging rows\n }\n else {\n if (isAuto) {\n core.undistributeHeight(this.dayGrid.rowEls); // let the rows be their natural height with no expanding\n }\n else {\n core.distributeHeight(this.dayGrid.rowEls, height, true); // true = compensate for height-hogging rows\n }\n }\n };\n /* Scroll\n ------------------------------------------------------------------------------------------------------------------*/\n AbstractDayGridView.prototype.computeDateScroll = function (duration) {\n return { top: 0 };\n };\n AbstractDayGridView.prototype.queryDateScroll = function () {\n return { top: this.scroller.getScrollTop() };\n };\n AbstractDayGridView.prototype.applyDateScroll = function (scroll) {\n if (scroll.top !== undefined) {\n this.scroller.setScrollTop(scroll.top);\n }\n };\n return AbstractDayGridView;\n }(core.View));\n AbstractDayGridView.prototype.dateProfileGeneratorClass = DayGridDateProfileGenerator;\n\n var SimpleDayGrid = /** @class */ (function (_super) {\n __extends(SimpleDayGrid, _super);\n function SimpleDayGrid(dayGrid) {\n var _this = _super.call(this, dayGrid.el) || this;\n _this.slicer = new DayGridSlicer();\n _this.dayGrid = dayGrid;\n return _this;\n }\n SimpleDayGrid.prototype.firstContext = function (context) {\n context.calendar.registerInteractiveComponent(this, { el: this.dayGrid.el });\n };\n SimpleDayGrid.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.context.calendar.unregisterInteractiveComponent(this);\n };\n SimpleDayGrid.prototype.render = function (props, context) {\n var dayGrid = this.dayGrid;\n var dateProfile = props.dateProfile, dayTable = props.dayTable;\n dayGrid.receiveContext(context); // hack because context is used in sliceProps\n dayGrid.receiveProps(__assign({}, this.slicer.sliceProps(props, dateProfile, props.nextDayThreshold, context.calendar, dayGrid, dayTable), { dateProfile: dateProfile, cells: dayTable.cells, isRigid: props.isRigid }), context);\n };\n SimpleDayGrid.prototype.buildPositionCaches = function () {\n this.dayGrid.buildPositionCaches();\n };\n SimpleDayGrid.prototype.queryHit = function (positionLeft, positionTop) {\n var rawHit = this.dayGrid.positionToHit(positionLeft, positionTop);\n if (rawHit) {\n return {\n component: this.dayGrid,\n dateSpan: rawHit.dateSpan,\n dayEl: rawHit.dayEl,\n rect: {\n left: rawHit.relativeRect.left,\n right: rawHit.relativeRect.right,\n top: rawHit.relativeRect.top,\n bottom: rawHit.relativeRect.bottom\n },\n layer: 0\n };\n }\n };\n return SimpleDayGrid;\n }(core.DateComponent));\n var DayGridSlicer = /** @class */ (function (_super) {\n __extends(DayGridSlicer, _super);\n function DayGridSlicer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DayGridSlicer.prototype.sliceRange = function (dateRange, dayTable) {\n return dayTable.sliceRange(dateRange);\n };\n return DayGridSlicer;\n }(core.Slicer));\n\n var DayGridView = /** @class */ (function (_super) {\n __extends(DayGridView, _super);\n function DayGridView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.buildDayTable = core.memoize(buildDayTable);\n return _this;\n }\n DayGridView.prototype.render = function (props, context) {\n _super.prototype.render.call(this, props, context); // will call _renderSkeleton/_unrenderSkeleton\n var dateProfile = this.props.dateProfile;\n var dayTable = this.dayTable =\n this.buildDayTable(dateProfile, props.dateProfileGenerator);\n if (this.header) {\n this.header.receiveProps({\n dateProfile: dateProfile,\n dates: dayTable.headerDates,\n datesRepDistinctDays: dayTable.rowCnt === 1,\n renderIntroHtml: this.renderHeadIntroHtml\n }, context);\n }\n this.simpleDayGrid.receiveProps({\n dateProfile: dateProfile,\n dayTable: dayTable,\n businessHours: props.businessHours,\n dateSelection: props.dateSelection,\n eventStore: props.eventStore,\n eventUiBases: props.eventUiBases,\n eventSelection: props.eventSelection,\n eventDrag: props.eventDrag,\n eventResize: props.eventResize,\n isRigid: this.hasRigidRows(),\n nextDayThreshold: this.context.nextDayThreshold\n }, context);\n };\n DayGridView.prototype._renderSkeleton = function (context) {\n _super.prototype._renderSkeleton.call(this, context);\n if (context.options.columnHeader) {\n this.header = new core.DayHeader(this.el.querySelector('.fc-head-container'));\n }\n this.simpleDayGrid = new SimpleDayGrid(this.dayGrid);\n };\n DayGridView.prototype._unrenderSkeleton = function () {\n _super.prototype._unrenderSkeleton.call(this);\n if (this.header) {\n this.header.destroy();\n }\n this.simpleDayGrid.destroy();\n };\n return DayGridView;\n }(AbstractDayGridView));\n function buildDayTable(dateProfile, dateProfileGenerator) {\n var daySeries = new core.DaySeries(dateProfile.renderRange, dateProfileGenerator);\n return new core.DayTable(daySeries, /year|month|week/.test(dateProfile.currentRangeUnit));\n }\n\n var main = core.createPlugin({\n defaultView: 'dayGridMonth',\n views: {\n dayGrid: DayGridView,\n dayGridDay: {\n type: 'dayGrid',\n duration: { days: 1 }\n },\n dayGridWeek: {\n type: 'dayGrid',\n duration: { weeks: 1 }\n },\n dayGridMonth: {\n type: 'dayGrid',\n duration: { months: 1 },\n monthMode: true,\n fixedWeekCount: true\n }\n }\n });\n\n exports.AbstractDayGridView = AbstractDayGridView;\n exports.DayBgRow = DayBgRow;\n exports.DayGrid = DayGrid;\n exports.DayGridSlicer = DayGridSlicer;\n exports.DayGridView = DayGridView;\n exports.SimpleDayGrid = SimpleDayGrid;\n exports.buildBasicDayTable = buildDayTable;\n exports.default = main;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n\n},{\"@fullcalendar/core\":2}],4:[function(require,module,exports){\n(function (process){(function (){\n/**\n * @popperjs/core v2.5.3 - MIT License\n */\n\n'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction getBoundingClientRect(element) {\n var rect = element.getBoundingClientRect();\n return {\n width: rect.width,\n height: rect.height,\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n left: rect.left,\n x: rect.left,\n y: rect.top\n };\n}\n\n/*:: import type { Window } from '../types'; */\n\n/*:: declare function getWindow(node: Node | Window): Window; */\nfunction getWindow(node) {\n if (node.toString() !== '[object Window]') {\n var ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}\n\nfunction getWindowScroll(node) {\n var win = getWindow(node);\n var scrollLeft = win.pageXOffset;\n var scrollTop = win.pageYOffset;\n return {\n scrollLeft: scrollLeft,\n scrollTop: scrollTop\n };\n}\n\n/*:: declare function isElement(node: mixed): boolean %checks(node instanceof\n Element); */\n\nfunction isElement(node) {\n var OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n/*:: declare function isHTMLElement(node: mixed): boolean %checks(node instanceof\n HTMLElement); */\n\n\nfunction isHTMLElement(node) {\n var OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n/*:: declare function isShadowRoot(node: mixed): boolean %checks(node instanceof\n ShadowRoot); */\n\n\nfunction isShadowRoot(node) {\n var OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nfunction getHTMLElementScroll(element) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n}\n\nfunction getNodeScroll(node) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}\n\nfunction getNodeName(element) {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}\n\nfunction getDocumentElement(element) {\n // $FlowFixMe: assume body is always available\n return ((isElement(element) ? element.ownerDocument : element.document) || window.document).documentElement;\n}\n\nfunction getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;\n}\n\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\n\nfunction isScrollParent(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n var _getComputedStyle = getComputedStyle(element),\n overflow = _getComputedStyle.overflow,\n overflowX = _getComputedStyle.overflowX,\n overflowY = _getComputedStyle.overflowY;\n\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}\n\n// Composite means it takes into account transforms as well as layout.\n\nfunction getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n\n var documentElement = getDocumentElement(offsetParent);\n var rect = getBoundingClientRect(elementOrVirtualElement);\n var isOffsetParentAnElement = isHTMLElement(offsetParent);\n var scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n var offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height\n };\n}\n\n// Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\nfunction getLayoutRect(element) {\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width: element.offsetWidth,\n height: element.offsetHeight\n };\n}\n\nfunction getParentNode(element) {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (// $FlowFixMe: this is a quicker (but less type safe) way to save quite some bytes from the bundle\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || // DOM Element detected\n // $FlowFixMe: need a better way to handle this...\n element.host || // ShadowRoot detected\n // $FlowFixMe: HTMLElement is a Node\n getDocumentElement(element) // fallback\n\n );\n}\n\nfunction getScrollParent(node) {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}\n\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the \nreference element's position.\n*/\n\nfunction listScrollParents(element, list) {\n if (list === void 0) {\n list = [];\n }\n\n var scrollParent = getScrollParent(element);\n var isBody = getNodeName(scrollParent) === 'body';\n var win = getWindow(scrollParent);\n var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;\n var updatedList = list.concat(target);\n return isBody ? updatedList : // $FlowFixMe: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}\n\nfunction isTableElement(element) {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n var offsetParent = element.offsetParent;\n\n if (offsetParent) {\n var html = getDocumentElement(offsetParent);\n\n if (getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && getComputedStyle(html).position !== 'static') {\n return html;\n }\n }\n\n return offsetParent;\n} // `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\n\n\nfunction getContainingBlock(element) {\n var currentNode = getParentNode(element);\n\n while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {\n var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n\n if (css.transform !== 'none' || css.perspective !== 'none' || css.willChange && css.willChange !== 'auto') {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nfunction getOffsetParent(element) {\n var window = getWindow(element);\n var offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static') {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}\n\nvar top = 'top';\nvar bottom = 'bottom';\nvar right = 'right';\nvar left = 'left';\nvar auto = 'auto';\nvar basePlacements = [top, bottom, right, left];\nvar start = 'start';\nvar end = 'end';\nvar clippingParents = 'clippingParents';\nvar viewport = 'viewport';\nvar popper = 'popper';\nvar reference = 'reference';\nvar variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {\n return acc.concat([placement + \"-\" + start, placement + \"-\" + end]);\n}, []);\nvar placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {\n return acc.concat([placement, placement + \"-\" + start, placement + \"-\" + end]);\n}, []); // modifiers that need to read the DOM\n\nvar beforeRead = 'beforeRead';\nvar read = 'read';\nvar afterRead = 'afterRead'; // pure-logic modifiers\n\nvar beforeMain = 'beforeMain';\nvar main = 'main';\nvar afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)\n\nvar beforeWrite = 'beforeWrite';\nvar write = 'write';\nvar afterWrite = 'afterWrite';\nvar modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];\n\nfunction order(modifiers) {\n var map = new Map();\n var visited = new Set();\n var result = [];\n modifiers.forEach(function (modifier) {\n map.set(modifier.name, modifier);\n }); // On visiting object, check for its dependencies and visit them recursively\n\n function sort(modifier) {\n visited.add(modifier.name);\n var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);\n requires.forEach(function (dep) {\n if (!visited.has(dep)) {\n var depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n result.push(modifier);\n }\n\n modifiers.forEach(function (modifier) {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n return result;\n}\n\nfunction orderModifiers(modifiers) {\n // order based on dependencies\n var orderedModifiers = order(modifiers); // order based on phase\n\n return modifierPhases.reduce(function (acc, phase) {\n return acc.concat(orderedModifiers.filter(function (modifier) {\n return modifier.phase === phase;\n }));\n }, []);\n}\n\nfunction debounce(fn) {\n var pending;\n return function () {\n if (!pending) {\n pending = new Promise(function (resolve) {\n Promise.resolve().then(function () {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}\n\nfunction format(str) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return [].concat(args).reduce(function (p, c) {\n return p.replace(/%s/, c);\n }, str);\n}\n\nvar INVALID_MODIFIER_ERROR = 'Popper: modifier \"%s\" provided an invalid %s property, expected %s but got %s';\nvar MISSING_DEPENDENCY_ERROR = 'Popper: modifier \"%s\" requires \"%s\", but \"%s\" modifier is not available';\nvar VALID_PROPERTIES = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options'];\nfunction validateModifiers(modifiers) {\n modifiers.forEach(function (modifier) {\n Object.keys(modifier).forEach(function (key) {\n switch (key) {\n case 'name':\n if (typeof modifier.name !== 'string') {\n console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '\"name\"', '\"string\"', \"\\\"\" + String(modifier.name) + \"\\\"\"));\n }\n\n break;\n\n case 'enabled':\n if (typeof modifier.enabled !== 'boolean') {\n console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '\"enabled\"', '\"boolean\"', \"\\\"\" + String(modifier.enabled) + \"\\\"\"));\n }\n\n case 'phase':\n if (modifierPhases.indexOf(modifier.phase) < 0) {\n console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '\"phase\"', \"either \" + modifierPhases.join(', '), \"\\\"\" + String(modifier.phase) + \"\\\"\"));\n }\n\n break;\n\n case 'fn':\n if (typeof modifier.fn !== 'function') {\n console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '\"fn\"', '\"function\"', \"\\\"\" + String(modifier.fn) + \"\\\"\"));\n }\n\n break;\n\n case 'effect':\n if (typeof modifier.effect !== 'function') {\n console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '\"effect\"', '\"function\"', \"\\\"\" + String(modifier.fn) + \"\\\"\"));\n }\n\n break;\n\n case 'requires':\n if (!Array.isArray(modifier.requires)) {\n console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '\"requires\"', '\"array\"', \"\\\"\" + String(modifier.requires) + \"\\\"\"));\n }\n\n break;\n\n case 'requiresIfExists':\n if (!Array.isArray(modifier.requiresIfExists)) {\n console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '\"requiresIfExists\"', '\"array\"', \"\\\"\" + String(modifier.requiresIfExists) + \"\\\"\"));\n }\n\n break;\n\n case 'options':\n case 'data':\n break;\n\n default:\n console.error(\"PopperJS: an invalid property has been provided to the \\\"\" + modifier.name + \"\\\" modifier, valid properties are \" + VALID_PROPERTIES.map(function (s) {\n return \"\\\"\" + s + \"\\\"\";\n }).join(', ') + \"; but \\\"\" + key + \"\\\" was provided.\");\n }\n\n modifier.requires && modifier.requires.forEach(function (requirement) {\n if (modifiers.find(function (mod) {\n return mod.name === requirement;\n }) == null) {\n console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement));\n }\n });\n });\n });\n}\n\nfunction uniqueBy(arr, fn) {\n var identifiers = new Set();\n return arr.filter(function (item) {\n var identifier = fn(item);\n\n if (!identifiers.has(identifier)) {\n identifiers.add(identifier);\n return true;\n }\n });\n}\n\nfunction getBasePlacement(placement) {\n return placement.split('-')[0];\n}\n\nfunction mergeByName(modifiers) {\n var merged = modifiers.reduce(function (merged, current) {\n var existing = merged[current.name];\n merged[current.name] = existing ? Object.assign(Object.assign(Object.assign({}, existing), current), {}, {\n options: Object.assign(Object.assign({}, existing.options), current.options),\n data: Object.assign(Object.assign({}, existing.data), current.data)\n }) : current;\n return merged;\n }, {}); // IE11 does not support Object.values\n\n return Object.keys(merged).map(function (key) {\n return merged[key];\n });\n}\n\nfunction getViewportRect(element) {\n var win = getWindow(element);\n var html = getDocumentElement(element);\n var visualViewport = win.visualViewport;\n var width = html.clientWidth;\n var height = html.clientHeight;\n var x = 0;\n var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper\n // can be obscured underneath it.\n // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even\n // if it isn't open, so if this isn't available, the popper will be detected\n // to overflow the bottom of the screen too early.\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)\n // In Chrome, it returns a value very close to 0 (+/-) but contains rounding\n // errors due to floating point numbers, so we need to check precision.\n // Safari returns a number <= 0, usually < -1 when pinch-zoomed\n // Feature detection fails in mobile emulation mode in Chrome.\n // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <\n // 0.001\n // Fallback here: \"Not Safari\" userAgent\n\n if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width: width,\n height: height,\n x: x + getWindowScrollBarX(element),\n y: y\n };\n}\n\n// of the `` and `` rect bounds if horizontally scrollable\n\nfunction getDocumentRect(element) {\n var html = getDocumentElement(element);\n var winScroll = getWindowScroll(element);\n var body = element.ownerDocument.body;\n var width = Math.max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n var height = Math.max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n var x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n var y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += Math.max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width: width,\n height: height,\n x: x,\n y: y\n };\n}\n\nfunction contains(parent, child) {\n var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (isShadowRoot(rootNode)) {\n var next = child;\n\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n } // $FlowFixMe: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n } // Give up, the result is false\n\n\n return false;\n}\n\nfunction rectToClientRect(rect) {\n return Object.assign(Object.assign({}, rect), {}, {\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n });\n}\n\nfunction getInnerBoundingClientRect(element) {\n var rect = getBoundingClientRect(element);\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n return rect;\n}\n\nfunction getClientRectFromMixedType(element, clippingParent) {\n return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingParents(element) {\n var clippingParents = listScrollParents(getParentNode(element));\n var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;\n\n if (!isElement(clipperElement)) {\n return [];\n } // $FlowFixMe: https://github.com/facebook/flow/issues/1414\n\n\n return clippingParents.filter(function (clippingParent) {\n return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body';\n });\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping parents\n\n\nfunction getClippingRect(element, boundary, rootBoundary) {\n var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);\n var clippingParents = [].concat(mainClippingParents, [rootBoundary]);\n var firstClippingParent = clippingParents[0];\n var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {\n var rect = getClientRectFromMixedType(element, clippingParent);\n accRect.top = Math.max(rect.top, accRect.top);\n accRect.right = Math.min(rect.right, accRect.right);\n accRect.bottom = Math.min(rect.bottom, accRect.bottom);\n accRect.left = Math.max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent));\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n return clippingRect;\n}\n\nfunction getVariation(placement) {\n return placement.split('-')[1];\n}\n\nfunction getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}\n\nfunction computeOffsets(_ref) {\n var reference = _ref.reference,\n element = _ref.element,\n placement = _ref.placement;\n var basePlacement = placement ? getBasePlacement(placement) : null;\n var variation = placement ? getVariation(placement) : null;\n var commonX = reference.x + reference.width / 2 - element.width / 2;\n var commonY = reference.y + reference.height / 2 - element.height / 2;\n var offsets;\n\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height\n };\n break;\n\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY\n };\n break;\n\n default:\n offsets = {\n x: reference.x,\n y: reference.y\n };\n }\n\n var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;\n\n if (mainAxis != null) {\n var len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] = Math.floor(offsets[mainAxis]) - Math.floor(reference[len] / 2 - element[len] / 2);\n break;\n\n case end:\n offsets[mainAxis] = Math.floor(offsets[mainAxis]) + Math.ceil(reference[len] / 2 - element[len] / 2);\n break;\n }\n }\n\n return offsets;\n}\n\nfunction getFreshSideObject() {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n };\n}\n\nfunction mergePaddingObject(paddingObject) {\n return Object.assign(Object.assign({}, getFreshSideObject()), paddingObject);\n}\n\nfunction expandToHashMap(value, keys) {\n return keys.reduce(function (hashMap, key) {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}\n\nfunction detectOverflow(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n _options$placement = _options.placement,\n placement = _options$placement === void 0 ? state.placement : _options$placement,\n _options$boundary = _options.boundary,\n boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,\n _options$rootBoundary = _options.rootBoundary,\n rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,\n _options$elementConte = _options.elementContext,\n elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,\n _options$altBoundary = _options.altBoundary,\n altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,\n _options$padding = _options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));\n var altContext = elementContext === popper ? reference : popper;\n var referenceElement = state.elements.reference;\n var popperRect = state.rects.popper;\n var element = state.elements[altBoundary ? altContext : elementContext];\n var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);\n var referenceClientRect = getBoundingClientRect(referenceElement);\n var popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement: placement\n });\n var popperClientRect = rectToClientRect(Object.assign(Object.assign({}, popperRect), popperOffsets));\n var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n\n var overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element\n\n if (elementContext === popper && offsetData) {\n var offset = offsetData[placement];\n Object.keys(overflowOffsets).forEach(function (key) {\n var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}\n\nvar INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';\nvar INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';\nvar DEFAULT_OPTIONS = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute'\n};\n\nfunction areValidElements() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return !args.some(function (element) {\n return !(element && typeof element.getBoundingClientRect === 'function');\n });\n}\n\nfunction popperGenerator(generatorOptions) {\n if (generatorOptions === void 0) {\n generatorOptions = {};\n }\n\n var _generatorOptions = generatorOptions,\n _generatorOptions$def = _generatorOptions.defaultModifiers,\n defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,\n _generatorOptions$def2 = _generatorOptions.defaultOptions,\n defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;\n return function createPopper(reference, popper, options) {\n if (options === void 0) {\n options = defaultOptions;\n }\n\n var state = {\n placement: 'bottom',\n orderedModifiers: [],\n options: Object.assign(Object.assign({}, DEFAULT_OPTIONS), defaultOptions),\n modifiersData: {},\n elements: {\n reference: reference,\n popper: popper\n },\n attributes: {},\n styles: {}\n };\n var effectCleanupFns = [];\n var isDestroyed = false;\n var instance = {\n state: state,\n setOptions: function setOptions(options) {\n cleanupModifierEffects();\n state.options = Object.assign(Object.assign(Object.assign({}, defaultOptions), state.options), options);\n state.scrollParents = {\n reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],\n popper: listScrollParents(popper)\n }; // Orders the modifiers based on their dependencies and `phase`\n // properties\n\n var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers\n\n state.orderedModifiers = orderedModifiers.filter(function (m) {\n return m.enabled;\n }); // Validate the provided modifiers so that the consumer will get warned\n // if one of the modifiers is invalid for any reason\n\n if (process.env.NODE_ENV !== \"production\") {\n var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) {\n var name = _ref.name;\n return name;\n });\n validateModifiers(modifiers);\n\n if (getBasePlacement(state.options.placement) === auto) {\n var flipModifier = state.orderedModifiers.find(function (_ref2) {\n var name = _ref2.name;\n return name === 'flip';\n });\n\n if (!flipModifier) {\n console.error(['Popper: \"auto\" placements require the \"flip\" modifier be', 'present and enabled to work.'].join(' '));\n }\n }\n\n var _getComputedStyle = getComputedStyle(popper),\n marginTop = _getComputedStyle.marginTop,\n marginRight = _getComputedStyle.marginRight,\n marginBottom = _getComputedStyle.marginBottom,\n marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can\n // cause bugs with positioning, so we'll warn the consumer\n\n\n if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) {\n return parseFloat(margin);\n })) {\n console.warn(['Popper: CSS \"margin\" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' '));\n }\n }\n\n runModifierEffects();\n return instance.update();\n },\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate: function forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n var _state$elements = state.elements,\n reference = _state$elements.reference,\n popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return;\n } // Store the reference and popper rects to be read by modifiers\n\n\n state.rects = {\n reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),\n popper: getLayoutRect(popper)\n }; // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n\n state.reset = false;\n state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n\n state.orderedModifiers.forEach(function (modifier) {\n return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);\n });\n var __debug_loops__ = 0;\n\n for (var index = 0; index < state.orderedModifiers.length; index++) {\n if (process.env.NODE_ENV !== \"production\") {\n __debug_loops__ += 1;\n\n if (__debug_loops__ > 100) {\n console.error(INFINITE_LOOP_ERROR);\n break;\n }\n }\n\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n var _state$orderedModifie = state.orderedModifiers[index],\n fn = _state$orderedModifie.fn,\n _state$orderedModifie2 = _state$orderedModifie.options,\n _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,\n name = _state$orderedModifie.name;\n\n if (typeof fn === 'function') {\n state = fn({\n state: state,\n options: _options,\n name: name,\n instance: instance\n }) || state;\n }\n }\n },\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce(function () {\n return new Promise(function (resolve) {\n instance.forceUpdate();\n resolve(state);\n });\n }),\n destroy: function destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n }\n };\n\n if (!areValidElements(reference, popper)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(INVALID_ELEMENT_ERROR);\n }\n\n return instance;\n }\n\n instance.setOptions(options).then(function (state) {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n }); // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n\n function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref3) {\n var name = _ref3.name,\n _ref3$options = _ref3.options,\n options = _ref3$options === void 0 ? {} : _ref3$options,\n effect = _ref3.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach(function (fn) {\n return fn();\n });\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\n\nvar passive = {\n passive: true\n};\n\nfunction effect(_ref) {\n var state = _ref.state,\n instance = _ref.instance,\n options = _ref.options;\n var _options$scroll = options.scroll,\n scroll = _options$scroll === void 0 ? true : _options$scroll,\n _options$resize = options.resize,\n resize = _options$resize === void 0 ? true : _options$resize;\n var window = getWindow(state.elements.popper);\n var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);\n\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return function () {\n if (scroll) {\n scrollParents.forEach(function (scrollParent) {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nvar eventListeners = {\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: function fn() {},\n effect: effect,\n data: {}\n};\n\nfunction popperOffsets(_ref) {\n var state = _ref.state,\n name = _ref.name;\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nvar popperOffsets$1 = {\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {}\n};\n\nvar unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto'\n}; // Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\n\nfunction roundOffsets(_ref) {\n var x = _ref.x,\n y = _ref.y;\n var win = window;\n var dpr = win.devicePixelRatio || 1;\n return {\n x: Math.round(x * dpr) / dpr || 0,\n y: Math.round(y * dpr) / dpr || 0\n };\n}\n\nfunction mapToStyles(_ref2) {\n var _Object$assign2;\n\n var popper = _ref2.popper,\n popperRect = _ref2.popperRect,\n placement = _ref2.placement,\n offsets = _ref2.offsets,\n position = _ref2.position,\n gpuAcceleration = _ref2.gpuAcceleration,\n adaptive = _ref2.adaptive;\n\n var _roundOffsets = roundOffsets(offsets),\n x = _roundOffsets.x,\n y = _roundOffsets.y;\n\n var hasX = offsets.hasOwnProperty('x');\n var hasY = offsets.hasOwnProperty('y');\n var sideX = left;\n var sideY = top;\n var win = window;\n\n if (adaptive) {\n var offsetParent = getOffsetParent(popper);\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n } // $FlowFixMe: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n\n /*:: offsetParent = (offsetParent: Element); */\n\n\n if (placement === top) {\n sideY = bottom;\n y -= offsetParent.clientHeight - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (placement === left) {\n sideX = right;\n x -= offsetParent.clientWidth - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n var commonStyles = Object.assign({\n position: position\n }, adaptive && unsetSides);\n\n if (gpuAcceleration) {\n var _Object$assign;\n\n return Object.assign(Object.assign({}, commonStyles), {}, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) < 2 ? \"translate(\" + x + \"px, \" + y + \"px)\" : \"translate3d(\" + x + \"px, \" + y + \"px, 0)\", _Object$assign));\n }\n\n return Object.assign(Object.assign({}, commonStyles), {}, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + \"px\" : '', _Object$assign2[sideX] = hasX ? x + \"px\" : '', _Object$assign2.transform = '', _Object$assign2));\n}\n\nfunction computeStyles(_ref3) {\n var state = _ref3.state,\n options = _ref3.options;\n var _options$gpuAccelerat = options.gpuAcceleration,\n gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,\n _options$adaptive = options.adaptive,\n adaptive = _options$adaptive === void 0 ? true : _options$adaptive;\n\n if (process.env.NODE_ENV !== \"production\") {\n var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || '';\n\n if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) {\n return transitionProperty.indexOf(property) >= 0;\n })) {\n console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: \"transform\", \"top\", \"right\", \"bottom\", \"left\".', '\\n\\n', 'Disable the \"computeStyles\" modifier\\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\\n\\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' '));\n }\n }\n\n var commonStyles = {\n placement: getBasePlacement(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration: gpuAcceleration\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = Object.assign(Object.assign({}, state.styles.popper), mapToStyles(Object.assign(Object.assign({}, commonStyles), {}, {\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive: adaptive\n })));\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = Object.assign(Object.assign({}, state.styles.arrow), mapToStyles(Object.assign(Object.assign({}, commonStyles), {}, {\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false\n })));\n }\n\n state.attributes.popper = Object.assign(Object.assign({}, state.attributes.popper), {}, {\n 'data-popper-placement': state.placement\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nvar computeStyles$1 = {\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {}\n};\n\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles(_ref) {\n var state = _ref.state;\n Object.keys(state.elements).forEach(function (name) {\n var style = state.styles[name] || {};\n var attributes = state.attributes[name] || {};\n var element = state.elements[name]; // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (name) {\n var value = attributes[name];\n\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect$1(_ref2) {\n var state = _ref2.state;\n var initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0'\n },\n arrow: {\n position: 'absolute'\n },\n reference: {}\n };\n Object.assign(state.elements.popper.style, initialStyles.popper);\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return function () {\n Object.keys(state.elements).forEach(function (name) {\n var element = state.elements[name];\n var attributes = state.attributes[name] || {};\n var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them\n\n var style = styleProperties.reduce(function (style, property) {\n style[property] = '';\n return style;\n }, {}); // arrow is optional + virtual elements\n\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n } // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe\n\n\n Object.assign(element.style, style);\n Object.keys(attributes).forEach(function (attribute) {\n element.removeAttribute(attribute);\n });\n });\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nvar applyStyles$1 = {\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect: effect$1,\n requires: ['computeStyles']\n};\n\nfunction distanceAndSkiddingToXY(placement, rects, offset) {\n var basePlacement = getBasePlacement(placement);\n var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n var _ref = typeof offset === 'function' ? offset(Object.assign(Object.assign({}, rects), {}, {\n placement: placement\n })) : offset,\n skidding = _ref[0],\n distance = _ref[1];\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n return [left, right].indexOf(basePlacement) >= 0 ? {\n x: distance,\n y: skidding\n } : {\n x: skidding,\n y: distance\n };\n}\n\nfunction offset(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$offset = options.offset,\n offset = _options$offset === void 0 ? [0, 0] : _options$offset;\n var data = placements.reduce(function (acc, placement) {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n var _data$state$placement = data[state.placement],\n x = _data$state$placement.x,\n y = _data$state$placement.y;\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nvar offset$1 = {\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset\n};\n\nvar hash = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nfunction getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, function (matched) {\n return hash[matched];\n });\n}\n\nvar hash$1 = {\n start: 'end',\n end: 'start'\n};\nfunction getOppositeVariationPlacement(placement) {\n return placement.replace(/start|end/g, function (matched) {\n return hash$1[matched];\n });\n}\n\n/*:: type OverflowsMap = { [ComputedPlacement]: number }; */\n\n/*;; type OverflowsMap = { [key in ComputedPlacement]: number }; */\nfunction computeAutoPlacement(state, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n placement = _options.placement,\n boundary = _options.boundary,\n rootBoundary = _options.rootBoundary,\n padding = _options.padding,\n flipVariations = _options.flipVariations,\n _options$allowedAutoP = _options.allowedAutoPlacements,\n allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;\n var variation = getVariation(placement);\n var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {\n return getVariation(placement) === variation;\n }) : basePlacements; // $FlowFixMe\n\n var allowedPlacements = placements$1.filter(function (placement) {\n return allowedAutoPlacements.indexOf(placement) >= 0;\n });\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements$1;\n\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, \"auto\" cannot be used to allow \"bottom-start\".', 'Use \"auto-start\" instead.'].join(' '));\n }\n } // $FlowFixMe: Flow seems to have problems with two array unions...\n\n\n var overflows = allowedPlacements.reduce(function (acc, placement) {\n acc[placement] = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding\n })[getBasePlacement(placement)];\n return acc;\n }, {});\n return Object.keys(overflows).sort(function (a, b) {\n return overflows[a] - overflows[b];\n });\n}\n\nfunction getExpandedFallbackPlacements(placement) {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n var oppositePlacement = getOppositePlacement(placement);\n return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];\n}\n\nfunction flip(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,\n specifiedFallbackPlacements = options.fallbackPlacements,\n padding = options.padding,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n _options$flipVariatio = options.flipVariations,\n flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,\n allowedAutoPlacements = options.allowedAutoPlacements;\n var preferredPlacement = state.options.placement;\n var basePlacement = getBasePlacement(preferredPlacement);\n var isBasePlacement = basePlacement === preferredPlacement;\n var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));\n var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {\n return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n flipVariations: flipVariations,\n allowedAutoPlacements: allowedAutoPlacements\n }) : placement);\n }, []);\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var checksMap = new Map();\n var makeFallbackChecks = true;\n var firstFittingPlacement = placements[0];\n\n for (var i = 0; i < placements.length; i++) {\n var placement = placements[i];\n\n var _basePlacement = getBasePlacement(placement);\n\n var isStartVariation = getVariation(placement) === start;\n var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;\n var len = isVertical ? 'width' : 'height';\n var overflow = detectOverflow(state, {\n placement: placement,\n boundary: boundary,\n rootBoundary: rootBoundary,\n altBoundary: altBoundary,\n padding: padding\n });\n var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n var altVariationSide = getOppositePlacement(mainVariationSide);\n var checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[_basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);\n }\n\n if (checks.every(function (check) {\n return check;\n })) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n var numberOfChecks = flipVariations ? 3 : 1;\n\n var _loop = function _loop(_i) {\n var fittingPlacement = placements.find(function (placement) {\n var checks = checksMap.get(placement);\n\n if (checks) {\n return checks.slice(0, _i).every(function (check) {\n return check;\n });\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n return \"break\";\n }\n };\n\n for (var _i = numberOfChecks; _i > 0; _i--) {\n var _ret = _loop(_i);\n\n if (_ret === \"break\") break;\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n} // eslint-disable-next-line import/no-unused-modules\n\n\nvar flip$1 = {\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: {\n _skip: false\n }\n};\n\nfunction getAltAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\n\nfunction within(min, value, max) {\n return Math.max(min, Math.min(value, max));\n}\n\nfunction preventOverflow(_ref) {\n var state = _ref.state,\n options = _ref.options,\n name = _ref.name;\n var _options$mainAxis = options.mainAxis,\n checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,\n _options$altAxis = options.altAxis,\n checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,\n boundary = options.boundary,\n rootBoundary = options.rootBoundary,\n altBoundary = options.altBoundary,\n padding = options.padding,\n _options$tether = options.tether,\n tether = _options$tether === void 0 ? true : _options$tether,\n _options$tetherOffset = options.tetherOffset,\n tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;\n var overflow = detectOverflow(state, {\n boundary: boundary,\n rootBoundary: rootBoundary,\n padding: padding,\n altBoundary: altBoundary\n });\n var basePlacement = getBasePlacement(state.placement);\n var variation = getVariation(state.placement);\n var isBasePlacement = !variation;\n var mainAxis = getMainAxisFromPlacement(basePlacement);\n var altAxis = getAltAxis(mainAxis);\n var popperOffsets = state.modifiersData.popperOffsets;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign(Object.assign({}, state.rects), {}, {\n placement: state.placement\n })) : tetherOffset;\n var data = {\n x: 0,\n y: 0\n };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n var mainSide = mainAxis === 'y' ? top : left;\n var altSide = mainAxis === 'y' ? bottom : right;\n var len = mainAxis === 'y' ? 'height' : 'width';\n var offset = popperOffsets[mainAxis];\n var min = popperOffsets[mainAxis] + overflow[mainSide];\n var max = popperOffsets[mainAxis] - overflow[altSide];\n var additive = tether ? -popperRect[len] / 2 : 0;\n var minLen = variation === start ? referenceRect[len] : popperRect[len];\n var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n\n var arrowElement = state.elements.arrow;\n var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {\n width: 0,\n height: 0\n };\n var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();\n var arrowPaddingMin = arrowPaddingObject[mainSide];\n var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n\n var arrowLen = within(0, referenceRect[len], arrowRect[len]);\n var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue;\n var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue;\n var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);\n var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;\n var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0;\n var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset;\n var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue;\n var preventedOffset = within(tether ? Math.min(min, tetherMin) : min, offset, tether ? Math.max(max, tetherMax) : max);\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n var _mainSide = mainAxis === 'x' ? top : left;\n\n var _altSide = mainAxis === 'x' ? bottom : right;\n\n var _offset = popperOffsets[altAxis];\n\n var _min = _offset + overflow[_mainSide];\n\n var _max = _offset - overflow[_altSide];\n\n var _preventedOffset = within(_min, _offset, _max);\n\n popperOffsets[altAxis] = _preventedOffset;\n data[altAxis] = _preventedOffset - _offset;\n }\n\n state.modifiersData[name] = data;\n} // eslint-disable-next-line import/no-unused-modules\n\n\nvar preventOverflow$1 = {\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset']\n};\n\nfunction arrow(_ref) {\n var _state$modifiersData$;\n\n var state = _ref.state,\n name = _ref.name;\n var arrowElement = state.elements.arrow;\n var popperOffsets = state.modifiersData.popperOffsets;\n var basePlacement = getBasePlacement(state.placement);\n var axis = getMainAxisFromPlacement(basePlacement);\n var isVertical = [left, right].indexOf(basePlacement) >= 0;\n var len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n var paddingObject = state.modifiersData[name + \"#persistent\"].padding;\n var arrowRect = getLayoutRect(arrowElement);\n var minProp = axis === 'y' ? top : left;\n var maxProp = axis === 'y' ? bottom : right;\n var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];\n var startDiff = popperOffsets[axis] - state.rects.reference[axis];\n var arrowOffsetParent = getOffsetParent(arrowElement);\n var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n\n var min = paddingObject[minProp];\n var max = clientSize - arrowRect[len] - paddingObject[maxProp];\n var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n var offset = within(min, center, max); // Prevents breaking syntax highlighting...\n\n var axisProp = axis;\n state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);\n}\n\nfunction effect$2(_ref2) {\n var state = _ref2.state,\n options = _ref2.options,\n name = _ref2.name;\n var _options$element = options.element,\n arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element,\n _options$padding = options.padding,\n padding = _options$padding === void 0 ? 0 : _options$padding;\n\n if (arrowElement == null) {\n return;\n } // CSS selector\n\n\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (process.env.NODE_ENV !== \"production\") {\n if (!isHTMLElement(arrowElement)) {\n console.error(['Popper: \"arrow\" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' '));\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.error(['Popper: \"arrow\" modifier\\'s `element` must be a child of the popper', 'element.'].join(' '));\n }\n\n return;\n }\n\n state.elements.arrow = arrowElement;\n state.modifiersData[name + \"#persistent\"] = {\n padding: mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements))\n };\n} // eslint-disable-next-line import/no-unused-modules\n\n\nvar arrow$1 = {\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect: effect$2,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow']\n};\n\nfunction getSideOffsets(overflow, rect, preventedOffsets) {\n if (preventedOffsets === void 0) {\n preventedOffsets = {\n x: 0,\n y: 0\n };\n }\n\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return [top, right, bottom, left].some(function (side) {\n return overflow[side] >= 0;\n });\n}\n\nfunction hide(_ref) {\n var state = _ref.state,\n name = _ref.name;\n var referenceRect = state.rects.reference;\n var popperRect = state.rects.popper;\n var preventedOffsets = state.modifiersData.preventOverflow;\n var referenceOverflow = detectOverflow(state, {\n elementContext: 'reference'\n });\n var popperAltOverflow = detectOverflow(state, {\n altBoundary: true\n });\n var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);\n var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);\n var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n state.modifiersData[name] = {\n referenceClippingOffsets: referenceClippingOffsets,\n popperEscapeOffsets: popperEscapeOffsets,\n isReferenceHidden: isReferenceHidden,\n hasPopperEscaped: hasPopperEscaped\n };\n state.attributes.popper = Object.assign(Object.assign({}, state.attributes.popper), {}, {\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped\n });\n} // eslint-disable-next-line import/no-unused-modules\n\n\nvar hide$1 = {\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide\n};\n\nvar defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1];\nvar createPopper = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers\n}); // eslint-disable-next-line import/no-unused-modules\n\nvar defaultModifiers$1 = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];\nvar createPopper$1 = /*#__PURE__*/popperGenerator({\n defaultModifiers: defaultModifiers$1\n}); // eslint-disable-next-line import/no-unused-modules\n\nexports.applyStyles = applyStyles$1;\nexports.arrow = arrow$1;\nexports.computeStyles = computeStyles$1;\nexports.createPopper = createPopper$1;\nexports.createPopperLite = createPopper;\nexports.defaultModifiers = defaultModifiers$1;\nexports.detectOverflow = detectOverflow;\nexports.eventListeners = eventListeners;\nexports.flip = flip$1;\nexports.hide = hide$1;\nexports.offset = offset$1;\nexports.popperGenerator = popperGenerator;\nexports.popperOffsets = popperOffsets$1;\nexports.preventOverflow = preventOverflow$1;\n\n\n}).call(this)}).call(this,require('_process'))\n\n},{\"_process\":19}],5:[function(require,module,exports){\n!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports.AOS=t():e.AOS=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p=\"dist/\",t(0)}([function(e,t,n){\"use strict\";function o(e){return e&&e.__esModule?e:{default:e}}var i=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]&&arguments[0];if(e&&(k=!0),k)return w=(0,y.default)(w,x),(0,b.default)(w,x.once),w},O=function(){w=(0,h.default)(),j()},M=function(){w.forEach(function(e,t){e.node.removeAttribute(\"data-aos\"),e.node.removeAttribute(\"data-aos-easing\"),e.node.removeAttribute(\"data-aos-duration\"),e.node.removeAttribute(\"data-aos-delay\")})},S=function(e){return e===!0||\"mobile\"===e&&p.default.mobile()||\"phone\"===e&&p.default.phone()||\"tablet\"===e&&p.default.tablet()||\"function\"==typeof e&&e()===!0},_=function(e){x=i(x,e),w=(0,h.default)();var t=document.all&&!window.atob;return S(x.disable)||t?M():(x.disableMutationObserver||d.default.isSupported()||(console.info('\\n aos: MutationObserver is not supported on this browser,\\n code mutations observing has been disabled.\\n You may have to call \"refreshHard()\" by yourself.\\n '),x.disableMutationObserver=!0),document.querySelector(\"body\").setAttribute(\"data-aos-easing\",x.easing),document.querySelector(\"body\").setAttribute(\"data-aos-duration\",x.duration),document.querySelector(\"body\").setAttribute(\"data-aos-delay\",x.delay),\"DOMContentLoaded\"===x.startEvent&&[\"complete\",\"interactive\"].indexOf(document.readyState)>-1?j(!0):\"load\"===x.startEvent?window.addEventListener(x.startEvent,function(){j(!0)}):document.addEventListener(x.startEvent,function(){j(!0)}),window.addEventListener(\"resize\",(0,s.default)(j,x.debounceDelay,!0)),window.addEventListener(\"orientationchange\",(0,s.default)(j,x.debounceDelay,!0)),window.addEventListener(\"scroll\",(0,u.default)(function(){(0,b.default)(w,x.once)},x.throttleDelay)),x.disableMutationObserver||d.default.ready(\"[data-aos]\",O),w)};e.exports={init:_,refresh:j,refreshHard:O}},function(e,t){},,,,,function(e,t){(function(t){\"use strict\";function n(e,t,n){function o(t){var n=b,o=v;return b=v=void 0,k=t,g=e.apply(o,n)}function r(e){return k=e,h=setTimeout(f,t),M?o(e):g}function a(e){var n=e-w,o=e-k,i=t-n;return S?j(i,y-o):i}function c(e){var n=e-w,o=e-k;return void 0===w||n>=t||n<0||S&&o>=y}function f(){var e=O();return c(e)?d(e):void(h=setTimeout(f,a(e)))}function d(e){return h=void 0,_&&b?o(e):(b=v=void 0,g)}function l(){void 0!==h&&clearTimeout(h),k=0,b=w=v=h=void 0}function p(){return void 0===h?g:d(O())}function m(){var e=O(),n=c(e);if(b=arguments,v=this,w=e,n){if(void 0===h)return r(w);if(S)return h=setTimeout(f,t),o(w)}return void 0===h&&(h=setTimeout(f,t)),g}var b,v,y,g,h,w,k=0,M=!1,S=!1,_=!0;if(\"function\"!=typeof e)throw new TypeError(s);return t=u(t)||0,i(n)&&(M=!!n.leading,S=\"maxWait\"in n,y=S?x(u(n.maxWait)||0,t):y,_=\"trailing\"in n?!!n.trailing:_),m.cancel=l,m.flush=p,m}function o(e,t,o){var r=!0,a=!0;if(\"function\"!=typeof e)throw new TypeError(s);return i(o)&&(r=\"leading\"in o?!!o.leading:r,a=\"trailing\"in o?!!o.trailing:a),n(e,t,{leading:r,maxWait:t,trailing:a})}function i(e){var t=\"undefined\"==typeof e?\"undefined\":c(e);return!!e&&(\"object\"==t||\"function\"==t)}function r(e){return!!e&&\"object\"==(\"undefined\"==typeof e?\"undefined\":c(e))}function a(e){return\"symbol\"==(\"undefined\"==typeof e?\"undefined\":c(e))||r(e)&&k.call(e)==d}function u(e){if(\"number\"==typeof e)return e;if(a(e))return f;if(i(e)){var t=\"function\"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+\"\":t}if(\"string\"!=typeof e)return 0===e?e:+e;e=e.replace(l,\"\");var n=m.test(e);return n||b.test(e)?v(e.slice(2),n?2:8):p.test(e)?f:+e}var c=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},s=\"Expected a function\",f=NaN,d=\"[object Symbol]\",l=/^\\s+|\\s+$/g,p=/^[-+]0x[0-9a-f]+$/i,m=/^0b[01]+$/i,b=/^0o[0-7]+$/i,v=parseInt,y=\"object\"==(\"undefined\"==typeof t?\"undefined\":c(t))&&t&&t.Object===Object&&t,g=\"object\"==(\"undefined\"==typeof self?\"undefined\":c(self))&&self&&self.Object===Object&&self,h=y||g||Function(\"return this\")(),w=Object.prototype,k=w.toString,x=Math.max,j=Math.min,O=function(){return h.Date.now()};e.exports=o}).call(t,function(){return this}())},function(e,t){(function(t){\"use strict\";function n(e,t,n){function i(t){var n=b,o=v;return b=v=void 0,O=t,g=e.apply(o,n)}function r(e){return O=e,h=setTimeout(f,t),M?i(e):g}function u(e){var n=e-w,o=e-O,i=t-n;return S?x(i,y-o):i}function s(e){var n=e-w,o=e-O;return void 0===w||n>=t||n<0||S&&o>=y}function f(){var e=j();return s(e)?d(e):void(h=setTimeout(f,u(e)))}function d(e){return h=void 0,_&&b?i(e):(b=v=void 0,g)}function l(){void 0!==h&&clearTimeout(h),O=0,b=w=v=h=void 0}function p(){return void 0===h?g:d(j())}function m(){var e=j(),n=s(e);if(b=arguments,v=this,w=e,n){if(void 0===h)return r(w);if(S)return h=setTimeout(f,t),i(w)}return void 0===h&&(h=setTimeout(f,t)),g}var b,v,y,g,h,w,O=0,M=!1,S=!1,_=!0;if(\"function\"!=typeof e)throw new TypeError(c);return t=a(t)||0,o(n)&&(M=!!n.leading,S=\"maxWait\"in n,y=S?k(a(n.maxWait)||0,t):y,_=\"trailing\"in n?!!n.trailing:_),m.cancel=l,m.flush=p,m}function o(e){var t=\"undefined\"==typeof e?\"undefined\":u(e);return!!e&&(\"object\"==t||\"function\"==t)}function i(e){return!!e&&\"object\"==(\"undefined\"==typeof e?\"undefined\":u(e))}function r(e){return\"symbol\"==(\"undefined\"==typeof e?\"undefined\":u(e))||i(e)&&w.call(e)==f}function a(e){if(\"number\"==typeof e)return e;if(r(e))return s;if(o(e)){var t=\"function\"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+\"\":t}if(\"string\"!=typeof e)return 0===e?e:+e;e=e.replace(d,\"\");var n=p.test(e);return n||m.test(e)?b(e.slice(2),n?2:8):l.test(e)?s:+e}var u=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e},c=\"Expected a function\",s=NaN,f=\"[object Symbol]\",d=/^\\s+|\\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,m=/^0o[0-7]+$/i,b=parseInt,v=\"object\"==(\"undefined\"==typeof t?\"undefined\":u(t))&&t&&t.Object===Object&&t,y=\"object\"==(\"undefined\"==typeof self?\"undefined\":u(self))&&self&&self.Object===Object&&self,g=v||y||Function(\"return this\")(),h=Object.prototype,w=h.toString,k=Math.max,x=Math.min,j=function(){return g.Date.now()};e.exports=n}).call(t,function(){return this}())},function(e,t){\"use strict\";function n(e){var t=void 0,o=void 0,i=void 0;for(t=0;te.position?e.node.classList.add(\"aos-animate\"):\"undefined\"!=typeof o&&(\"false\"===o||!n&&\"true\"!==o)&&e.node.classList.remove(\"aos-animate\")},o=function(e,t){var o=window.pageYOffset,i=window.innerHeight;e.forEach(function(e,r){n(e,i+o,t)})};t.default=o},function(e,t,n){\"use strict\";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,\"__esModule\",{value:!0});var i=n(12),r=o(i),a=function(e,t){return e.forEach(function(e,n){e.node.classList.add(\"aos-init\"),e.position=(0,r.default)(e.node,t.offset)}),e};t.default=a},function(e,t,n){\"use strict\";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,\"__esModule\",{value:!0});var i=n(13),r=o(i),a=function(e,t){var n=0,o=0,i=window.innerHeight,a={offset:e.getAttribute(\"data-aos-offset\"),anchor:e.getAttribute(\"data-aos-anchor\"),anchorPlacement:e.getAttribute(\"data-aos-anchor-placement\")};switch(a.offset&&!isNaN(a.offset)&&(o=parseInt(a.offset)),a.anchor&&document.querySelectorAll(a.anchor)&&(e=document.querySelectorAll(a.anchor)[0]),n=(0,r.default)(e).top,a.anchorPlacement){case\"top-bottom\":break;case\"center-bottom\":n+=e.offsetHeight/2;break;case\"bottom-bottom\":n+=e.offsetHeight;break;case\"top-center\":n+=i/2;break;case\"bottom-center\":n+=i/2+e.offsetHeight;break;case\"center-center\":n+=i/2+e.offsetHeight/2;break;case\"top-top\":n+=i;break;case\"bottom-top\":n+=e.offsetHeight+i;break;case\"center-top\":n+=e.offsetHeight/2+i}return a.anchorPlacement||a.offset||isNaN(t)||(o=t),n+o};t.default=a},function(e,t){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=function(e){for(var t=0,n=0;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);)t+=e.offsetLeft-(\"BODY\"!=e.tagName?e.scrollLeft:0),n+=e.offsetTop-(\"BODY\"!=e.tagName?e.scrollTop:0),e=e.offsetParent;return{top:n,left:t}};t.default=n},function(e,t){\"use strict\";Object.defineProperty(t,\"__esModule\",{value:!0});var n=function(e){return e=e||document.querySelectorAll(\"[data-aos]\"),Array.prototype.map.call(e,function(e){return{node:e}})};t.default=n}])});\n},{}],6:[function(require,module,exports){\n/*!\n * Bootstrap v4.5.3 (https://getbootstrap.com/)\n * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n */\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery'), require('popper.js')) :\n typeof define === 'function' && define.amd ? define(['exports', 'jquery', 'popper.js'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bootstrap = {}, global.jQuery, global.Popper));\n}(this, (function (exports, $, Popper) { 'use strict';\n\n function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\n var $__default = /*#__PURE__*/_interopDefaultLegacy($);\n var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper);\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n }\n\n function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n }\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.5.3): util.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n /**\n * ------------------------------------------------------------------------\n * Private TransitionEnd Helpers\n * ------------------------------------------------------------------------\n */\n\n var TRANSITION_END = 'transitionend';\n var MAX_UID = 1000000;\n var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)\n\n function toType(obj) {\n if (obj === null || typeof obj === 'undefined') {\n return \"\" + obj;\n }\n\n return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase();\n }\n\n function getSpecialTransitionEndEvent() {\n return {\n bindType: TRANSITION_END,\n delegateType: TRANSITION_END,\n handle: function handle(event) {\n if ($__default['default'](event.target).is(this)) {\n return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params\n }\n\n return undefined;\n }\n };\n }\n\n function transitionEndEmulator(duration) {\n var _this = this;\n\n var called = false;\n $__default['default'](this).one(Util.TRANSITION_END, function () {\n called = true;\n });\n setTimeout(function () {\n if (!called) {\n Util.triggerTransitionEnd(_this);\n }\n }, duration);\n return this;\n }\n\n function setTransitionEndSupport() {\n $__default['default'].fn.emulateTransitionEnd = transitionEndEmulator;\n $__default['default'].event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();\n }\n /**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\n\n var Util = {\n TRANSITION_END: 'bsTransitionEnd',\n getUID: function getUID(prefix) {\n do {\n prefix += ~~(Math.random() * MAX_UID); // \"~~\" acts like a faster Math.floor() here\n } while (document.getElementById(prefix));\n\n return prefix;\n },\n getSelectorFromElement: function getSelectorFromElement(element) {\n var selector = element.getAttribute('data-target');\n\n if (!selector || selector === '#') {\n var hrefAttr = element.getAttribute('href');\n selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';\n }\n\n try {\n return document.querySelector(selector) ? selector : null;\n } catch (_) {\n return null;\n }\n },\n getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {\n if (!element) {\n return 0;\n } // Get transition-duration of the element\n\n\n var transitionDuration = $__default['default'](element).css('transition-duration');\n var transitionDelay = $__default['default'](element).css('transition-delay');\n var floatTransitionDuration = parseFloat(transitionDuration);\n var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found\n\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0;\n } // If multiple durations are defined, take the first\n\n\n transitionDuration = transitionDuration.split(',')[0];\n transitionDelay = transitionDelay.split(',')[0];\n return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;\n },\n reflow: function reflow(element) {\n return element.offsetHeight;\n },\n triggerTransitionEnd: function triggerTransitionEnd(element) {\n $__default['default'](element).trigger(TRANSITION_END);\n },\n supportsTransitionEnd: function supportsTransitionEnd() {\n return Boolean(TRANSITION_END);\n },\n isElement: function isElement(obj) {\n return (obj[0] || obj).nodeType;\n },\n typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {\n for (var property in configTypes) {\n if (Object.prototype.hasOwnProperty.call(configTypes, property)) {\n var expectedTypes = configTypes[property];\n var value = config[property];\n var valueType = value && Util.isElement(value) ? 'element' : toType(value);\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new Error(componentName.toUpperCase() + \": \" + (\"Option \\\"\" + property + \"\\\" provided type \\\"\" + valueType + \"\\\" \") + (\"but expected type \\\"\" + expectedTypes + \"\\\".\"));\n }\n }\n }\n },\n findShadowRoot: function findShadowRoot(element) {\n if (!document.documentElement.attachShadow) {\n return null;\n } // Can find the shadow root otherwise it'll return the document\n\n\n if (typeof element.getRootNode === 'function') {\n var root = element.getRootNode();\n return root instanceof ShadowRoot ? root : null;\n }\n\n if (element instanceof ShadowRoot) {\n return element;\n } // when we don't find a shadow root\n\n\n if (!element.parentNode) {\n return null;\n }\n\n return Util.findShadowRoot(element.parentNode);\n },\n jQueryDetection: function jQueryDetection() {\n if (typeof $__default['default'] === 'undefined') {\n throw new TypeError('Bootstrap\\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\\'s JavaScript.');\n }\n\n var version = $__default['default'].fn.jquery.split(' ')[0].split('.');\n var minMajor = 1;\n var ltMajor = 2;\n var minMinor = 9;\n var minPatch = 1;\n var maxMajor = 4;\n\n if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {\n throw new Error('Bootstrap\\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');\n }\n }\n };\n Util.jQueryDetection();\n setTransitionEndSupport();\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME = 'alert';\n var VERSION = '4.5.3';\n var DATA_KEY = 'bs.alert';\n var EVENT_KEY = \".\" + DATA_KEY;\n var DATA_API_KEY = '.data-api';\n var JQUERY_NO_CONFLICT = $__default['default'].fn[NAME];\n var SELECTOR_DISMISS = '[data-dismiss=\"alert\"]';\n var EVENT_CLOSE = \"close\" + EVENT_KEY;\n var EVENT_CLOSED = \"closed\" + EVENT_KEY;\n var EVENT_CLICK_DATA_API = \"click\" + EVENT_KEY + DATA_API_KEY;\n var CLASS_NAME_ALERT = 'alert';\n var CLASS_NAME_FADE = 'fade';\n var CLASS_NAME_SHOW = 'show';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n var Alert = /*#__PURE__*/function () {\n function Alert(element) {\n this._element = element;\n } // Getters\n\n\n var _proto = Alert.prototype;\n\n // Public\n _proto.close = function close(element) {\n var rootElement = this._element;\n\n if (element) {\n rootElement = this._getRootElement(element);\n }\n\n var customEvent = this._triggerCloseEvent(rootElement);\n\n if (customEvent.isDefaultPrevented()) {\n return;\n }\n\n this._removeElement(rootElement);\n };\n\n _proto.dispose = function dispose() {\n $__default['default'].removeData(this._element, DATA_KEY);\n this._element = null;\n } // Private\n ;\n\n _proto._getRootElement = function _getRootElement(element) {\n var selector = Util.getSelectorFromElement(element);\n var parent = false;\n\n if (selector) {\n parent = document.querySelector(selector);\n }\n\n if (!parent) {\n parent = $__default['default'](element).closest(\".\" + CLASS_NAME_ALERT)[0];\n }\n\n return parent;\n };\n\n _proto._triggerCloseEvent = function _triggerCloseEvent(element) {\n var closeEvent = $__default['default'].Event(EVENT_CLOSE);\n $__default['default'](element).trigger(closeEvent);\n return closeEvent;\n };\n\n _proto._removeElement = function _removeElement(element) {\n var _this = this;\n\n $__default['default'](element).removeClass(CLASS_NAME_SHOW);\n\n if (!$__default['default'](element).hasClass(CLASS_NAME_FADE)) {\n this._destroyElement(element);\n\n return;\n }\n\n var transitionDuration = Util.getTransitionDurationFromElement(element);\n $__default['default'](element).one(Util.TRANSITION_END, function (event) {\n return _this._destroyElement(element, event);\n }).emulateTransitionEnd(transitionDuration);\n };\n\n _proto._destroyElement = function _destroyElement(element) {\n $__default['default'](element).detach().trigger(EVENT_CLOSED).remove();\n } // Static\n ;\n\n Alert._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $element = $__default['default'](this);\n var data = $element.data(DATA_KEY);\n\n if (!data) {\n data = new Alert(this);\n $element.data(DATA_KEY, data);\n }\n\n if (config === 'close') {\n data[config](this);\n }\n });\n };\n\n Alert._handleDismiss = function _handleDismiss(alertInstance) {\n return function (event) {\n if (event) {\n event.preventDefault();\n }\n\n alertInstance.close(this);\n };\n };\n\n _createClass(Alert, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION;\n }\n }]);\n\n return Alert;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $__default['default'](document).on(EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert._handleDismiss(new Alert()));\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $__default['default'].fn[NAME] = Alert._jQueryInterface;\n $__default['default'].fn[NAME].Constructor = Alert;\n\n $__default['default'].fn[NAME].noConflict = function () {\n $__default['default'].fn[NAME] = JQUERY_NO_CONFLICT;\n return Alert._jQueryInterface;\n };\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME$1 = 'button';\n var VERSION$1 = '4.5.3';\n var DATA_KEY$1 = 'bs.button';\n var EVENT_KEY$1 = \".\" + DATA_KEY$1;\n var DATA_API_KEY$1 = '.data-api';\n var JQUERY_NO_CONFLICT$1 = $__default['default'].fn[NAME$1];\n var CLASS_NAME_ACTIVE = 'active';\n var CLASS_NAME_BUTTON = 'btn';\n var CLASS_NAME_FOCUS = 'focus';\n var SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^=\"button\"]';\n var SELECTOR_DATA_TOGGLES = '[data-toggle=\"buttons\"]';\n var SELECTOR_DATA_TOGGLE = '[data-toggle=\"button\"]';\n var SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle=\"buttons\"] .btn';\n var SELECTOR_INPUT = 'input:not([type=\"hidden\"])';\n var SELECTOR_ACTIVE = '.active';\n var SELECTOR_BUTTON = '.btn';\n var EVENT_CLICK_DATA_API$1 = \"click\" + EVENT_KEY$1 + DATA_API_KEY$1;\n var EVENT_FOCUS_BLUR_DATA_API = \"focus\" + EVENT_KEY$1 + DATA_API_KEY$1 + \" \" + (\"blur\" + EVENT_KEY$1 + DATA_API_KEY$1);\n var EVENT_LOAD_DATA_API = \"load\" + EVENT_KEY$1 + DATA_API_KEY$1;\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n var Button = /*#__PURE__*/function () {\n function Button(element) {\n this._element = element;\n this.shouldAvoidTriggerChange = false;\n } // Getters\n\n\n var _proto = Button.prototype;\n\n // Public\n _proto.toggle = function toggle() {\n var triggerChangeEvent = true;\n var addAriaPressed = true;\n var rootElement = $__default['default'](this._element).closest(SELECTOR_DATA_TOGGLES)[0];\n\n if (rootElement) {\n var input = this._element.querySelector(SELECTOR_INPUT);\n\n if (input) {\n if (input.type === 'radio') {\n if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE)) {\n triggerChangeEvent = false;\n } else {\n var activeElement = rootElement.querySelector(SELECTOR_ACTIVE);\n\n if (activeElement) {\n $__default['default'](activeElement).removeClass(CLASS_NAME_ACTIVE);\n }\n }\n }\n\n if (triggerChangeEvent) {\n // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input\n if (input.type === 'checkbox' || input.type === 'radio') {\n input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE);\n }\n\n if (!this.shouldAvoidTriggerChange) {\n $__default['default'](input).trigger('change');\n }\n }\n\n input.focus();\n addAriaPressed = false;\n }\n }\n\n if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {\n if (addAriaPressed) {\n this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE));\n }\n\n if (triggerChangeEvent) {\n $__default['default'](this._element).toggleClass(CLASS_NAME_ACTIVE);\n }\n }\n };\n\n _proto.dispose = function dispose() {\n $__default['default'].removeData(this._element, DATA_KEY$1);\n this._element = null;\n } // Static\n ;\n\n Button._jQueryInterface = function _jQueryInterface(config, avoidTriggerChange) {\n return this.each(function () {\n var $element = $__default['default'](this);\n var data = $element.data(DATA_KEY$1);\n\n if (!data) {\n data = new Button(this);\n $element.data(DATA_KEY$1, data);\n }\n\n data.shouldAvoidTriggerChange = avoidTriggerChange;\n\n if (config === 'toggle') {\n data[config]();\n }\n });\n };\n\n _createClass(Button, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION$1;\n }\n }]);\n\n return Button;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $__default['default'](document).on(EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE_CARROT, function (event) {\n var button = event.target;\n var initialButton = button;\n\n if (!$__default['default'](button).hasClass(CLASS_NAME_BUTTON)) {\n button = $__default['default'](button).closest(SELECTOR_BUTTON)[0];\n }\n\n if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) {\n event.preventDefault(); // work around Firefox bug #1540995\n } else {\n var inputBtn = button.querySelector(SELECTOR_INPUT);\n\n if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) {\n event.preventDefault(); // work around Firefox bug #1540995\n\n return;\n }\n\n if (initialButton.tagName === 'INPUT' || button.tagName !== 'LABEL') {\n Button._jQueryInterface.call($__default['default'](button), 'toggle', initialButton.tagName === 'INPUT');\n }\n }\n }).on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) {\n var button = $__default['default'](event.target).closest(SELECTOR_BUTTON)[0];\n $__default['default'](button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type));\n });\n $__default['default'](window).on(EVENT_LOAD_DATA_API, function () {\n // ensure correct active class is set to match the controls' actual values/states\n // find all checkboxes/readio buttons inside data-toggle groups\n var buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS));\n\n for (var i = 0, len = buttons.length; i < len; i++) {\n var button = buttons[i];\n var input = button.querySelector(SELECTOR_INPUT);\n\n if (input.checked || input.hasAttribute('checked')) {\n button.classList.add(CLASS_NAME_ACTIVE);\n } else {\n button.classList.remove(CLASS_NAME_ACTIVE);\n }\n } // find all button toggles\n\n\n buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE));\n\n for (var _i = 0, _len = buttons.length; _i < _len; _i++) {\n var _button = buttons[_i];\n\n if (_button.getAttribute('aria-pressed') === 'true') {\n _button.classList.add(CLASS_NAME_ACTIVE);\n } else {\n _button.classList.remove(CLASS_NAME_ACTIVE);\n }\n }\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $__default['default'].fn[NAME$1] = Button._jQueryInterface;\n $__default['default'].fn[NAME$1].Constructor = Button;\n\n $__default['default'].fn[NAME$1].noConflict = function () {\n $__default['default'].fn[NAME$1] = JQUERY_NO_CONFLICT$1;\n return Button._jQueryInterface;\n };\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME$2 = 'carousel';\n var VERSION$2 = '4.5.3';\n var DATA_KEY$2 = 'bs.carousel';\n var EVENT_KEY$2 = \".\" + DATA_KEY$2;\n var DATA_API_KEY$2 = '.data-api';\n var JQUERY_NO_CONFLICT$2 = $__default['default'].fn[NAME$2];\n var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key\n\n var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key\n\n var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch\n\n var SWIPE_THRESHOLD = 40;\n var Default = {\n interval: 5000,\n keyboard: true,\n slide: false,\n pause: 'hover',\n wrap: true,\n touch: true\n };\n var DefaultType = {\n interval: '(number|boolean)',\n keyboard: 'boolean',\n slide: '(boolean|string)',\n pause: '(string|boolean)',\n wrap: 'boolean',\n touch: 'boolean'\n };\n var DIRECTION_NEXT = 'next';\n var DIRECTION_PREV = 'prev';\n var DIRECTION_LEFT = 'left';\n var DIRECTION_RIGHT = 'right';\n var EVENT_SLIDE = \"slide\" + EVENT_KEY$2;\n var EVENT_SLID = \"slid\" + EVENT_KEY$2;\n var EVENT_KEYDOWN = \"keydown\" + EVENT_KEY$2;\n var EVENT_MOUSEENTER = \"mouseenter\" + EVENT_KEY$2;\n var EVENT_MOUSELEAVE = \"mouseleave\" + EVENT_KEY$2;\n var EVENT_TOUCHSTART = \"touchstart\" + EVENT_KEY$2;\n var EVENT_TOUCHMOVE = \"touchmove\" + EVENT_KEY$2;\n var EVENT_TOUCHEND = \"touchend\" + EVENT_KEY$2;\n var EVENT_POINTERDOWN = \"pointerdown\" + EVENT_KEY$2;\n var EVENT_POINTERUP = \"pointerup\" + EVENT_KEY$2;\n var EVENT_DRAG_START = \"dragstart\" + EVENT_KEY$2;\n var EVENT_LOAD_DATA_API$1 = \"load\" + EVENT_KEY$2 + DATA_API_KEY$2;\n var EVENT_CLICK_DATA_API$2 = \"click\" + EVENT_KEY$2 + DATA_API_KEY$2;\n var CLASS_NAME_CAROUSEL = 'carousel';\n var CLASS_NAME_ACTIVE$1 = 'active';\n var CLASS_NAME_SLIDE = 'slide';\n var CLASS_NAME_RIGHT = 'carousel-item-right';\n var CLASS_NAME_LEFT = 'carousel-item-left';\n var CLASS_NAME_NEXT = 'carousel-item-next';\n var CLASS_NAME_PREV = 'carousel-item-prev';\n var CLASS_NAME_POINTER_EVENT = 'pointer-event';\n var SELECTOR_ACTIVE$1 = '.active';\n var SELECTOR_ACTIVE_ITEM = '.active.carousel-item';\n var SELECTOR_ITEM = '.carousel-item';\n var SELECTOR_ITEM_IMG = '.carousel-item img';\n var SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev';\n var SELECTOR_INDICATORS = '.carousel-indicators';\n var SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]';\n var SELECTOR_DATA_RIDE = '[data-ride=\"carousel\"]';\n var PointerType = {\n TOUCH: 'touch',\n PEN: 'pen'\n };\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n var Carousel = /*#__PURE__*/function () {\n function Carousel(element, config) {\n this._items = null;\n this._interval = null;\n this._activeElement = null;\n this._isPaused = false;\n this._isSliding = false;\n this.touchTimeout = null;\n this.touchStartX = 0;\n this.touchDeltaX = 0;\n this._config = this._getConfig(config);\n this._element = element;\n this._indicatorsElement = this._element.querySelector(SELECTOR_INDICATORS);\n this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;\n this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);\n\n this._addEventListeners();\n } // Getters\n\n\n var _proto = Carousel.prototype;\n\n // Public\n _proto.next = function next() {\n if (!this._isSliding) {\n this._slide(DIRECTION_NEXT);\n }\n };\n\n _proto.nextWhenVisible = function nextWhenVisible() {\n var $element = $__default['default'](this._element); // Don't call next when the page isn't visible\n // or the carousel or its parent isn't visible\n\n if (!document.hidden && $element.is(':visible') && $element.css('visibility') !== 'hidden') {\n this.next();\n }\n };\n\n _proto.prev = function prev() {\n if (!this._isSliding) {\n this._slide(DIRECTION_PREV);\n }\n };\n\n _proto.pause = function pause(event) {\n if (!event) {\n this._isPaused = true;\n }\n\n if (this._element.querySelector(SELECTOR_NEXT_PREV)) {\n Util.triggerTransitionEnd(this._element);\n this.cycle(true);\n }\n\n clearInterval(this._interval);\n this._interval = null;\n };\n\n _proto.cycle = function cycle(event) {\n if (!event) {\n this._isPaused = false;\n }\n\n if (this._interval) {\n clearInterval(this._interval);\n this._interval = null;\n }\n\n if (this._config.interval && !this._isPaused) {\n this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);\n }\n };\n\n _proto.to = function to(index) {\n var _this = this;\n\n this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM);\n\n var activeIndex = this._getItemIndex(this._activeElement);\n\n if (index > this._items.length - 1 || index < 0) {\n return;\n }\n\n if (this._isSliding) {\n $__default['default'](this._element).one(EVENT_SLID, function () {\n return _this.to(index);\n });\n return;\n }\n\n if (activeIndex === index) {\n this.pause();\n this.cycle();\n return;\n }\n\n var direction = index > activeIndex ? DIRECTION_NEXT : DIRECTION_PREV;\n\n this._slide(direction, this._items[index]);\n };\n\n _proto.dispose = function dispose() {\n $__default['default'](this._element).off(EVENT_KEY$2);\n $__default['default'].removeData(this._element, DATA_KEY$2);\n this._items = null;\n this._config = null;\n this._element = null;\n this._interval = null;\n this._isPaused = null;\n this._isSliding = null;\n this._activeElement = null;\n this._indicatorsElement = null;\n } // Private\n ;\n\n _proto._getConfig = function _getConfig(config) {\n config = _extends({}, Default, config);\n Util.typeCheckConfig(NAME$2, config, DefaultType);\n return config;\n };\n\n _proto._handleSwipe = function _handleSwipe() {\n var absDeltax = Math.abs(this.touchDeltaX);\n\n if (absDeltax <= SWIPE_THRESHOLD) {\n return;\n }\n\n var direction = absDeltax / this.touchDeltaX;\n this.touchDeltaX = 0; // swipe left\n\n if (direction > 0) {\n this.prev();\n } // swipe right\n\n\n if (direction < 0) {\n this.next();\n }\n };\n\n _proto._addEventListeners = function _addEventListeners() {\n var _this2 = this;\n\n if (this._config.keyboard) {\n $__default['default'](this._element).on(EVENT_KEYDOWN, function (event) {\n return _this2._keydown(event);\n });\n }\n\n if (this._config.pause === 'hover') {\n $__default['default'](this._element).on(EVENT_MOUSEENTER, function (event) {\n return _this2.pause(event);\n }).on(EVENT_MOUSELEAVE, function (event) {\n return _this2.cycle(event);\n });\n }\n\n if (this._config.touch) {\n this._addTouchEventListeners();\n }\n };\n\n _proto._addTouchEventListeners = function _addTouchEventListeners() {\n var _this3 = this;\n\n if (!this._touchSupported) {\n return;\n }\n\n var start = function start(event) {\n if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {\n _this3.touchStartX = event.originalEvent.clientX;\n } else if (!_this3._pointerEvent) {\n _this3.touchStartX = event.originalEvent.touches[0].clientX;\n }\n };\n\n var move = function move(event) {\n // ensure swiping with one touch and not pinching\n if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {\n _this3.touchDeltaX = 0;\n } else {\n _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX;\n }\n };\n\n var end = function end(event) {\n if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {\n _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;\n }\n\n _this3._handleSwipe();\n\n if (_this3._config.pause === 'hover') {\n // If it's a touch-enabled device, mouseenter/leave are fired as\n // part of the mouse compatibility events on first tap - the carousel\n // would stop cycling until user tapped out of it;\n // here, we listen for touchend, explicitly pause the carousel\n // (as if it's the second time we tap on it, mouseenter compat event\n // is NOT fired) and after a timeout (to allow for mouse compatibility\n // events to fire) we explicitly restart cycling\n _this3.pause();\n\n if (_this3.touchTimeout) {\n clearTimeout(_this3.touchTimeout);\n }\n\n _this3.touchTimeout = setTimeout(function (event) {\n return _this3.cycle(event);\n }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);\n }\n };\n\n $__default['default'](this._element.querySelectorAll(SELECTOR_ITEM_IMG)).on(EVENT_DRAG_START, function (e) {\n return e.preventDefault();\n });\n\n if (this._pointerEvent) {\n $__default['default'](this._element).on(EVENT_POINTERDOWN, function (event) {\n return start(event);\n });\n $__default['default'](this._element).on(EVENT_POINTERUP, function (event) {\n return end(event);\n });\n\n this._element.classList.add(CLASS_NAME_POINTER_EVENT);\n } else {\n $__default['default'](this._element).on(EVENT_TOUCHSTART, function (event) {\n return start(event);\n });\n $__default['default'](this._element).on(EVENT_TOUCHMOVE, function (event) {\n return move(event);\n });\n $__default['default'](this._element).on(EVENT_TOUCHEND, function (event) {\n return end(event);\n });\n }\n };\n\n _proto._keydown = function _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return;\n }\n\n switch (event.which) {\n case ARROW_LEFT_KEYCODE:\n event.preventDefault();\n this.prev();\n break;\n\n case ARROW_RIGHT_KEYCODE:\n event.preventDefault();\n this.next();\n break;\n }\n };\n\n _proto._getItemIndex = function _getItemIndex(element) {\n this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(SELECTOR_ITEM)) : [];\n return this._items.indexOf(element);\n };\n\n _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {\n var isNextDirection = direction === DIRECTION_NEXT;\n var isPrevDirection = direction === DIRECTION_PREV;\n\n var activeIndex = this._getItemIndex(activeElement);\n\n var lastItemIndex = this._items.length - 1;\n var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;\n\n if (isGoingToWrap && !this._config.wrap) {\n return activeElement;\n }\n\n var delta = direction === DIRECTION_PREV ? -1 : 1;\n var itemIndex = (activeIndex + delta) % this._items.length;\n return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];\n };\n\n _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {\n var targetIndex = this._getItemIndex(relatedTarget);\n\n var fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM));\n\n var slideEvent = $__default['default'].Event(EVENT_SLIDE, {\n relatedTarget: relatedTarget,\n direction: eventDirectionName,\n from: fromIndex,\n to: targetIndex\n });\n $__default['default'](this._element).trigger(slideEvent);\n return slideEvent;\n };\n\n _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {\n if (this._indicatorsElement) {\n var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE$1));\n $__default['default'](indicators).removeClass(CLASS_NAME_ACTIVE$1);\n\n var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];\n\n if (nextIndicator) {\n $__default['default'](nextIndicator).addClass(CLASS_NAME_ACTIVE$1);\n }\n }\n };\n\n _proto._slide = function _slide(direction, element) {\n var _this4 = this;\n\n var activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM);\n\n var activeElementIndex = this._getItemIndex(activeElement);\n\n var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);\n\n var nextElementIndex = this._getItemIndex(nextElement);\n\n var isCycling = Boolean(this._interval);\n var directionalClassName;\n var orderClassName;\n var eventDirectionName;\n\n if (direction === DIRECTION_NEXT) {\n directionalClassName = CLASS_NAME_LEFT;\n orderClassName = CLASS_NAME_NEXT;\n eventDirectionName = DIRECTION_LEFT;\n } else {\n directionalClassName = CLASS_NAME_RIGHT;\n orderClassName = CLASS_NAME_PREV;\n eventDirectionName = DIRECTION_RIGHT;\n }\n\n if (nextElement && $__default['default'](nextElement).hasClass(CLASS_NAME_ACTIVE$1)) {\n this._isSliding = false;\n return;\n }\n\n var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);\n\n if (slideEvent.isDefaultPrevented()) {\n return;\n }\n\n if (!activeElement || !nextElement) {\n // Some weirdness is happening, so we bail\n return;\n }\n\n this._isSliding = true;\n\n if (isCycling) {\n this.pause();\n }\n\n this._setActiveIndicatorElement(nextElement);\n\n var slidEvent = $__default['default'].Event(EVENT_SLID, {\n relatedTarget: nextElement,\n direction: eventDirectionName,\n from: activeElementIndex,\n to: nextElementIndex\n });\n\n if ($__default['default'](this._element).hasClass(CLASS_NAME_SLIDE)) {\n $__default['default'](nextElement).addClass(orderClassName);\n Util.reflow(nextElement);\n $__default['default'](activeElement).addClass(directionalClassName);\n $__default['default'](nextElement).addClass(directionalClassName);\n var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);\n\n if (nextElementInterval) {\n this._config.defaultInterval = this._config.defaultInterval || this._config.interval;\n this._config.interval = nextElementInterval;\n } else {\n this._config.interval = this._config.defaultInterval || this._config.interval;\n }\n\n var transitionDuration = Util.getTransitionDurationFromElement(activeElement);\n $__default['default'](activeElement).one(Util.TRANSITION_END, function () {\n $__default['default'](nextElement).removeClass(directionalClassName + \" \" + orderClassName).addClass(CLASS_NAME_ACTIVE$1);\n $__default['default'](activeElement).removeClass(CLASS_NAME_ACTIVE$1 + \" \" + orderClassName + \" \" + directionalClassName);\n _this4._isSliding = false;\n setTimeout(function () {\n return $__default['default'](_this4._element).trigger(slidEvent);\n }, 0);\n }).emulateTransitionEnd(transitionDuration);\n } else {\n $__default['default'](activeElement).removeClass(CLASS_NAME_ACTIVE$1);\n $__default['default'](nextElement).addClass(CLASS_NAME_ACTIVE$1);\n this._isSliding = false;\n $__default['default'](this._element).trigger(slidEvent);\n }\n\n if (isCycling) {\n this.cycle();\n }\n } // Static\n ;\n\n Carousel._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $__default['default'](this).data(DATA_KEY$2);\n\n var _config = _extends({}, Default, $__default['default'](this).data());\n\n if (typeof config === 'object') {\n _config = _extends({}, _config, config);\n }\n\n var action = typeof config === 'string' ? config : _config.slide;\n\n if (!data) {\n data = new Carousel(this, _config);\n $__default['default'](this).data(DATA_KEY$2, data);\n }\n\n if (typeof config === 'number') {\n data.to(config);\n } else if (typeof action === 'string') {\n if (typeof data[action] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + action + \"\\\"\");\n }\n\n data[action]();\n } else if (_config.interval && _config.ride) {\n data.pause();\n data.cycle();\n }\n });\n };\n\n Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {\n var selector = Util.getSelectorFromElement(this);\n\n if (!selector) {\n return;\n }\n\n var target = $__default['default'](selector)[0];\n\n if (!target || !$__default['default'](target).hasClass(CLASS_NAME_CAROUSEL)) {\n return;\n }\n\n var config = _extends({}, $__default['default'](target).data(), $__default['default'](this).data());\n\n var slideIndex = this.getAttribute('data-slide-to');\n\n if (slideIndex) {\n config.interval = false;\n }\n\n Carousel._jQueryInterface.call($__default['default'](target), config);\n\n if (slideIndex) {\n $__default['default'](target).data(DATA_KEY$2).to(slideIndex);\n }\n\n event.preventDefault();\n };\n\n _createClass(Carousel, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION$2;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }]);\n\n return Carousel;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $__default['default'](document).on(EVENT_CLICK_DATA_API$2, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler);\n $__default['default'](window).on(EVENT_LOAD_DATA_API$1, function () {\n var carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE));\n\n for (var i = 0, len = carousels.length; i < len; i++) {\n var $carousel = $__default['default'](carousels[i]);\n\n Carousel._jQueryInterface.call($carousel, $carousel.data());\n }\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $__default['default'].fn[NAME$2] = Carousel._jQueryInterface;\n $__default['default'].fn[NAME$2].Constructor = Carousel;\n\n $__default['default'].fn[NAME$2].noConflict = function () {\n $__default['default'].fn[NAME$2] = JQUERY_NO_CONFLICT$2;\n return Carousel._jQueryInterface;\n };\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME$3 = 'collapse';\n var VERSION$3 = '4.5.3';\n var DATA_KEY$3 = 'bs.collapse';\n var EVENT_KEY$3 = \".\" + DATA_KEY$3;\n var DATA_API_KEY$3 = '.data-api';\n var JQUERY_NO_CONFLICT$3 = $__default['default'].fn[NAME$3];\n var Default$1 = {\n toggle: true,\n parent: ''\n };\n var DefaultType$1 = {\n toggle: 'boolean',\n parent: '(string|element)'\n };\n var EVENT_SHOW = \"show\" + EVENT_KEY$3;\n var EVENT_SHOWN = \"shown\" + EVENT_KEY$3;\n var EVENT_HIDE = \"hide\" + EVENT_KEY$3;\n var EVENT_HIDDEN = \"hidden\" + EVENT_KEY$3;\n var EVENT_CLICK_DATA_API$3 = \"click\" + EVENT_KEY$3 + DATA_API_KEY$3;\n var CLASS_NAME_SHOW$1 = 'show';\n var CLASS_NAME_COLLAPSE = 'collapse';\n var CLASS_NAME_COLLAPSING = 'collapsing';\n var CLASS_NAME_COLLAPSED = 'collapsed';\n var DIMENSION_WIDTH = 'width';\n var DIMENSION_HEIGHT = 'height';\n var SELECTOR_ACTIVES = '.show, .collapsing';\n var SELECTOR_DATA_TOGGLE$1 = '[data-toggle=\"collapse\"]';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n var Collapse = /*#__PURE__*/function () {\n function Collapse(element, config) {\n this._isTransitioning = false;\n this._element = element;\n this._config = this._getConfig(config);\n this._triggerArray = [].slice.call(document.querySelectorAll(\"[data-toggle=\\\"collapse\\\"][href=\\\"#\" + element.id + \"\\\"],\" + (\"[data-toggle=\\\"collapse\\\"][data-target=\\\"#\" + element.id + \"\\\"]\")));\n var toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$1));\n\n for (var i = 0, len = toggleList.length; i < len; i++) {\n var elem = toggleList[i];\n var selector = Util.getSelectorFromElement(elem);\n var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {\n return foundElem === element;\n });\n\n if (selector !== null && filterElement.length > 0) {\n this._selector = selector;\n\n this._triggerArray.push(elem);\n }\n }\n\n this._parent = this._config.parent ? this._getParent() : null;\n\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._element, this._triggerArray);\n }\n\n if (this._config.toggle) {\n this.toggle();\n }\n } // Getters\n\n\n var _proto = Collapse.prototype;\n\n // Public\n _proto.toggle = function toggle() {\n if ($__default['default'](this._element).hasClass(CLASS_NAME_SHOW$1)) {\n this.hide();\n } else {\n this.show();\n }\n };\n\n _proto.show = function show() {\n var _this = this;\n\n if (this._isTransitioning || $__default['default'](this._element).hasClass(CLASS_NAME_SHOW$1)) {\n return;\n }\n\n var actives;\n var activesData;\n\n if (this._parent) {\n actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES)).filter(function (elem) {\n if (typeof _this._config.parent === 'string') {\n return elem.getAttribute('data-parent') === _this._config.parent;\n }\n\n return elem.classList.contains(CLASS_NAME_COLLAPSE);\n });\n\n if (actives.length === 0) {\n actives = null;\n }\n }\n\n if (actives) {\n activesData = $__default['default'](actives).not(this._selector).data(DATA_KEY$3);\n\n if (activesData && activesData._isTransitioning) {\n return;\n }\n }\n\n var startEvent = $__default['default'].Event(EVENT_SHOW);\n $__default['default'](this._element).trigger(startEvent);\n\n if (startEvent.isDefaultPrevented()) {\n return;\n }\n\n if (actives) {\n Collapse._jQueryInterface.call($__default['default'](actives).not(this._selector), 'hide');\n\n if (!activesData) {\n $__default['default'](actives).data(DATA_KEY$3, null);\n }\n }\n\n var dimension = this._getDimension();\n\n $__default['default'](this._element).removeClass(CLASS_NAME_COLLAPSE).addClass(CLASS_NAME_COLLAPSING);\n this._element.style[dimension] = 0;\n\n if (this._triggerArray.length) {\n $__default['default'](this._triggerArray).removeClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', true);\n }\n\n this.setTransitioning(true);\n\n var complete = function complete() {\n $__default['default'](_this._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE + \" \" + CLASS_NAME_SHOW$1);\n _this._element.style[dimension] = '';\n\n _this.setTransitioning(false);\n\n $__default['default'](_this._element).trigger(EVENT_SHOWN);\n };\n\n var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);\n var scrollSize = \"scroll\" + capitalizedDimension;\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $__default['default'](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n this._element.style[dimension] = this._element[scrollSize] + \"px\";\n };\n\n _proto.hide = function hide() {\n var _this2 = this;\n\n if (this._isTransitioning || !$__default['default'](this._element).hasClass(CLASS_NAME_SHOW$1)) {\n return;\n }\n\n var startEvent = $__default['default'].Event(EVENT_HIDE);\n $__default['default'](this._element).trigger(startEvent);\n\n if (startEvent.isDefaultPrevented()) {\n return;\n }\n\n var dimension = this._getDimension();\n\n this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + \"px\";\n Util.reflow(this._element);\n $__default['default'](this._element).addClass(CLASS_NAME_COLLAPSING).removeClass(CLASS_NAME_COLLAPSE + \" \" + CLASS_NAME_SHOW$1);\n var triggerArrayLength = this._triggerArray.length;\n\n if (triggerArrayLength > 0) {\n for (var i = 0; i < triggerArrayLength; i++) {\n var trigger = this._triggerArray[i];\n var selector = Util.getSelectorFromElement(trigger);\n\n if (selector !== null) {\n var $elem = $__default['default']([].slice.call(document.querySelectorAll(selector)));\n\n if (!$elem.hasClass(CLASS_NAME_SHOW$1)) {\n $__default['default'](trigger).addClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', false);\n }\n }\n }\n }\n\n this.setTransitioning(true);\n\n var complete = function complete() {\n _this2.setTransitioning(false);\n\n $__default['default'](_this2._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE).trigger(EVENT_HIDDEN);\n };\n\n this._element.style[dimension] = '';\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $__default['default'](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n };\n\n _proto.setTransitioning = function setTransitioning(isTransitioning) {\n this._isTransitioning = isTransitioning;\n };\n\n _proto.dispose = function dispose() {\n $__default['default'].removeData(this._element, DATA_KEY$3);\n this._config = null;\n this._parent = null;\n this._element = null;\n this._triggerArray = null;\n this._isTransitioning = null;\n } // Private\n ;\n\n _proto._getConfig = function _getConfig(config) {\n config = _extends({}, Default$1, config);\n config.toggle = Boolean(config.toggle); // Coerce string values\n\n Util.typeCheckConfig(NAME$3, config, DefaultType$1);\n return config;\n };\n\n _proto._getDimension = function _getDimension() {\n var hasWidth = $__default['default'](this._element).hasClass(DIMENSION_WIDTH);\n return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT;\n };\n\n _proto._getParent = function _getParent() {\n var _this3 = this;\n\n var parent;\n\n if (Util.isElement(this._config.parent)) {\n parent = this._config.parent; // It's a jQuery object\n\n if (typeof this._config.parent.jquery !== 'undefined') {\n parent = this._config.parent[0];\n }\n } else {\n parent = document.querySelector(this._config.parent);\n }\n\n var selector = \"[data-toggle=\\\"collapse\\\"][data-parent=\\\"\" + this._config.parent + \"\\\"]\";\n var children = [].slice.call(parent.querySelectorAll(selector));\n $__default['default'](children).each(function (i, element) {\n _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);\n });\n return parent;\n };\n\n _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {\n var isOpen = $__default['default'](element).hasClass(CLASS_NAME_SHOW$1);\n\n if (triggerArray.length) {\n $__default['default'](triggerArray).toggleClass(CLASS_NAME_COLLAPSED, !isOpen).attr('aria-expanded', isOpen);\n }\n } // Static\n ;\n\n Collapse._getTargetFromElement = function _getTargetFromElement(element) {\n var selector = Util.getSelectorFromElement(element);\n return selector ? document.querySelector(selector) : null;\n };\n\n Collapse._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $element = $__default['default'](this);\n var data = $element.data(DATA_KEY$3);\n\n var _config = _extends({}, Default$1, $element.data(), typeof config === 'object' && config ? config : {});\n\n if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) {\n _config.toggle = false;\n }\n\n if (!data) {\n data = new Collapse(this, _config);\n $element.data(DATA_KEY$3, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Collapse, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION$3;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default$1;\n }\n }]);\n\n return Collapse;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $__default['default'](document).on(EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$1, function (event) {\n // preventDefault only for
elements (which change the URL) not inside the collapsible element\n if (event.currentTarget.tagName === 'A') {\n event.preventDefault();\n }\n\n var $trigger = $__default['default'](this);\n var selector = Util.getSelectorFromElement(this);\n var selectors = [].slice.call(document.querySelectorAll(selector));\n $__default['default'](selectors).each(function () {\n var $target = $__default['default'](this);\n var data = $target.data(DATA_KEY$3);\n var config = data ? 'toggle' : $trigger.data();\n\n Collapse._jQueryInterface.call($target, config);\n });\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $__default['default'].fn[NAME$3] = Collapse._jQueryInterface;\n $__default['default'].fn[NAME$3].Constructor = Collapse;\n\n $__default['default'].fn[NAME$3].noConflict = function () {\n $__default['default'].fn[NAME$3] = JQUERY_NO_CONFLICT$3;\n return Collapse._jQueryInterface;\n };\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME$4 = 'dropdown';\n var VERSION$4 = '4.5.3';\n var DATA_KEY$4 = 'bs.dropdown';\n var EVENT_KEY$4 = \".\" + DATA_KEY$4;\n var DATA_API_KEY$4 = '.data-api';\n var JQUERY_NO_CONFLICT$4 = $__default['default'].fn[NAME$4];\n var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key\n\n var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key\n\n var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key\n\n var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key\n\n var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key\n\n var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)\n\n var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + \"|\" + ARROW_DOWN_KEYCODE + \"|\" + ESCAPE_KEYCODE);\n var EVENT_HIDE$1 = \"hide\" + EVENT_KEY$4;\n var EVENT_HIDDEN$1 = \"hidden\" + EVENT_KEY$4;\n var EVENT_SHOW$1 = \"show\" + EVENT_KEY$4;\n var EVENT_SHOWN$1 = \"shown\" + EVENT_KEY$4;\n var EVENT_CLICK = \"click\" + EVENT_KEY$4;\n var EVENT_CLICK_DATA_API$4 = \"click\" + EVENT_KEY$4 + DATA_API_KEY$4;\n var EVENT_KEYDOWN_DATA_API = \"keydown\" + EVENT_KEY$4 + DATA_API_KEY$4;\n var EVENT_KEYUP_DATA_API = \"keyup\" + EVENT_KEY$4 + DATA_API_KEY$4;\n var CLASS_NAME_DISABLED = 'disabled';\n var CLASS_NAME_SHOW$2 = 'show';\n var CLASS_NAME_DROPUP = 'dropup';\n var CLASS_NAME_DROPRIGHT = 'dropright';\n var CLASS_NAME_DROPLEFT = 'dropleft';\n var CLASS_NAME_MENURIGHT = 'dropdown-menu-right';\n var CLASS_NAME_POSITION_STATIC = 'position-static';\n var SELECTOR_DATA_TOGGLE$2 = '[data-toggle=\"dropdown\"]';\n var SELECTOR_FORM_CHILD = '.dropdown form';\n var SELECTOR_MENU = '.dropdown-menu';\n var SELECTOR_NAVBAR_NAV = '.navbar-nav';\n var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';\n var PLACEMENT_TOP = 'top-start';\n var PLACEMENT_TOPEND = 'top-end';\n var PLACEMENT_BOTTOM = 'bottom-start';\n var PLACEMENT_BOTTOMEND = 'bottom-end';\n var PLACEMENT_RIGHT = 'right-start';\n var PLACEMENT_LEFT = 'left-start';\n var Default$2 = {\n offset: 0,\n flip: true,\n boundary: 'scrollParent',\n reference: 'toggle',\n display: 'dynamic',\n popperConfig: null\n };\n var DefaultType$2 = {\n offset: '(number|string|function)',\n flip: 'boolean',\n boundary: '(string|element)',\n reference: '(string|element)',\n display: 'string',\n popperConfig: '(null|object)'\n };\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n var Dropdown = /*#__PURE__*/function () {\n function Dropdown(element, config) {\n this._element = element;\n this._popper = null;\n this._config = this._getConfig(config);\n this._menu = this._getMenuElement();\n this._inNavbar = this._detectNavbar();\n\n this._addEventListeners();\n } // Getters\n\n\n var _proto = Dropdown.prototype;\n\n // Public\n _proto.toggle = function toggle() {\n if (this._element.disabled || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED)) {\n return;\n }\n\n var isActive = $__default['default'](this._menu).hasClass(CLASS_NAME_SHOW$2);\n\n Dropdown._clearMenus();\n\n if (isActive) {\n return;\n }\n\n this.show(true);\n };\n\n _proto.show = function show(usePopper) {\n if (usePopper === void 0) {\n usePopper = false;\n }\n\n if (this._element.disabled || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED) || $__default['default'](this._menu).hasClass(CLASS_NAME_SHOW$2)) {\n return;\n }\n\n var relatedTarget = {\n relatedTarget: this._element\n };\n var showEvent = $__default['default'].Event(EVENT_SHOW$1, relatedTarget);\n\n var parent = Dropdown._getParentFromElement(this._element);\n\n $__default['default'](parent).trigger(showEvent);\n\n if (showEvent.isDefaultPrevented()) {\n return;\n } // Disable totally Popper.js for Dropdown in Navbar\n\n\n if (!this._inNavbar && usePopper) {\n /**\n * Check for Popper dependency\n * Popper - https://popper.js.org\n */\n if (typeof Popper__default['default'] === 'undefined') {\n throw new TypeError('Bootstrap\\'s dropdowns require Popper.js (https://popper.js.org/)');\n }\n\n var referenceElement = this._element;\n\n if (this._config.reference === 'parent') {\n referenceElement = parent;\n } else if (Util.isElement(this._config.reference)) {\n referenceElement = this._config.reference; // Check if it's jQuery element\n\n if (typeof this._config.reference.jquery !== 'undefined') {\n referenceElement = this._config.reference[0];\n }\n } // If boundary is not `scrollParent`, then set position to `static`\n // to allow the menu to \"escape\" the scroll parent's boundaries\n // https://github.com/twbs/bootstrap/issues/24251\n\n\n if (this._config.boundary !== 'scrollParent') {\n $__default['default'](parent).addClass(CLASS_NAME_POSITION_STATIC);\n }\n\n this._popper = new Popper__default['default'](referenceElement, this._menu, this._getPopperConfig());\n } // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n\n\n if ('ontouchstart' in document.documentElement && $__default['default'](parent).closest(SELECTOR_NAVBAR_NAV).length === 0) {\n $__default['default'](document.body).children().on('mouseover', null, $__default['default'].noop);\n }\n\n this._element.focus();\n\n this._element.setAttribute('aria-expanded', true);\n\n $__default['default'](this._menu).toggleClass(CLASS_NAME_SHOW$2);\n $__default['default'](parent).toggleClass(CLASS_NAME_SHOW$2).trigger($__default['default'].Event(EVENT_SHOWN$1, relatedTarget));\n };\n\n _proto.hide = function hide() {\n if (this._element.disabled || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED) || !$__default['default'](this._menu).hasClass(CLASS_NAME_SHOW$2)) {\n return;\n }\n\n var relatedTarget = {\n relatedTarget: this._element\n };\n var hideEvent = $__default['default'].Event(EVENT_HIDE$1, relatedTarget);\n\n var parent = Dropdown._getParentFromElement(this._element);\n\n $__default['default'](parent).trigger(hideEvent);\n\n if (hideEvent.isDefaultPrevented()) {\n return;\n }\n\n if (this._popper) {\n this._popper.destroy();\n }\n\n $__default['default'](this._menu).toggleClass(CLASS_NAME_SHOW$2);\n $__default['default'](parent).toggleClass(CLASS_NAME_SHOW$2).trigger($__default['default'].Event(EVENT_HIDDEN$1, relatedTarget));\n };\n\n _proto.dispose = function dispose() {\n $__default['default'].removeData(this._element, DATA_KEY$4);\n $__default['default'](this._element).off(EVENT_KEY$4);\n this._element = null;\n this._menu = null;\n\n if (this._popper !== null) {\n this._popper.destroy();\n\n this._popper = null;\n }\n };\n\n _proto.update = function update() {\n this._inNavbar = this._detectNavbar();\n\n if (this._popper !== null) {\n this._popper.scheduleUpdate();\n }\n } // Private\n ;\n\n _proto._addEventListeners = function _addEventListeners() {\n var _this = this;\n\n $__default['default'](this._element).on(EVENT_CLICK, function (event) {\n event.preventDefault();\n event.stopPropagation();\n\n _this.toggle();\n });\n };\n\n _proto._getConfig = function _getConfig(config) {\n config = _extends({}, this.constructor.Default, $__default['default'](this._element).data(), config);\n Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType);\n return config;\n };\n\n _proto._getMenuElement = function _getMenuElement() {\n if (!this._menu) {\n var parent = Dropdown._getParentFromElement(this._element);\n\n if (parent) {\n this._menu = parent.querySelector(SELECTOR_MENU);\n }\n }\n\n return this._menu;\n };\n\n _proto._getPlacement = function _getPlacement() {\n var $parentDropdown = $__default['default'](this._element.parentNode);\n var placement = PLACEMENT_BOTTOM; // Handle dropup\n\n if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) {\n placement = $__default['default'](this._menu).hasClass(CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP;\n } else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) {\n placement = PLACEMENT_RIGHT;\n } else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) {\n placement = PLACEMENT_LEFT;\n } else if ($__default['default'](this._menu).hasClass(CLASS_NAME_MENURIGHT)) {\n placement = PLACEMENT_BOTTOMEND;\n }\n\n return placement;\n };\n\n _proto._detectNavbar = function _detectNavbar() {\n return $__default['default'](this._element).closest('.navbar').length > 0;\n };\n\n _proto._getOffset = function _getOffset() {\n var _this2 = this;\n\n var offset = {};\n\n if (typeof this._config.offset === 'function') {\n offset.fn = function (data) {\n data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {});\n return data;\n };\n } else {\n offset.offset = this._config.offset;\n }\n\n return offset;\n };\n\n _proto._getPopperConfig = function _getPopperConfig() {\n var popperConfig = {\n placement: this._getPlacement(),\n modifiers: {\n offset: this._getOffset(),\n flip: {\n enabled: this._config.flip\n },\n preventOverflow: {\n boundariesElement: this._config.boundary\n }\n }\n }; // Disable Popper.js if we have a static display\n\n if (this._config.display === 'static') {\n popperConfig.modifiers.applyStyle = {\n enabled: false\n };\n }\n\n return _extends({}, popperConfig, this._config.popperConfig);\n } // Static\n ;\n\n Dropdown._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $__default['default'](this).data(DATA_KEY$4);\n\n var _config = typeof config === 'object' ? config : null;\n\n if (!data) {\n data = new Dropdown(this, _config);\n $__default['default'](this).data(DATA_KEY$4, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n Dropdown._clearMenus = function _clearMenus(event) {\n if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {\n return;\n }\n\n var toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$2));\n\n for (var i = 0, len = toggles.length; i < len; i++) {\n var parent = Dropdown._getParentFromElement(toggles[i]);\n\n var context = $__default['default'](toggles[i]).data(DATA_KEY$4);\n var relatedTarget = {\n relatedTarget: toggles[i]\n };\n\n if (event && event.type === 'click') {\n relatedTarget.clickEvent = event;\n }\n\n if (!context) {\n continue;\n }\n\n var dropdownMenu = context._menu;\n\n if (!$__default['default'](parent).hasClass(CLASS_NAME_SHOW$2)) {\n continue;\n }\n\n if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $__default['default'].contains(parent, event.target)) {\n continue;\n }\n\n var hideEvent = $__default['default'].Event(EVENT_HIDE$1, relatedTarget);\n $__default['default'](parent).trigger(hideEvent);\n\n if (hideEvent.isDefaultPrevented()) {\n continue;\n } // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n\n\n if ('ontouchstart' in document.documentElement) {\n $__default['default'](document.body).children().off('mouseover', null, $__default['default'].noop);\n }\n\n toggles[i].setAttribute('aria-expanded', 'false');\n\n if (context._popper) {\n context._popper.destroy();\n }\n\n $__default['default'](dropdownMenu).removeClass(CLASS_NAME_SHOW$2);\n $__default['default'](parent).removeClass(CLASS_NAME_SHOW$2).trigger($__default['default'].Event(EVENT_HIDDEN$1, relatedTarget));\n }\n };\n\n Dropdown._getParentFromElement = function _getParentFromElement(element) {\n var parent;\n var selector = Util.getSelectorFromElement(element);\n\n if (selector) {\n parent = document.querySelector(selector);\n }\n\n return parent || element.parentNode;\n } // eslint-disable-next-line complexity\n ;\n\n Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {\n // If not input/textarea:\n // - And not a key in REGEXP_KEYDOWN => not a dropdown command\n // If input/textarea:\n // - If space key => not a dropdown command\n // - If key is other than escape\n // - If key is not up or down => not a dropdown command\n // - If trigger inside the menu => not a dropdown command\n if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $__default['default'](event.target).closest(SELECTOR_MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {\n return;\n }\n\n if (this.disabled || $__default['default'](this).hasClass(CLASS_NAME_DISABLED)) {\n return;\n }\n\n var parent = Dropdown._getParentFromElement(this);\n\n var isActive = $__default['default'](parent).hasClass(CLASS_NAME_SHOW$2);\n\n if (!isActive && event.which === ESCAPE_KEYCODE) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n if (!isActive || event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE) {\n if (event.which === ESCAPE_KEYCODE) {\n $__default['default'](parent.querySelector(SELECTOR_DATA_TOGGLE$2)).trigger('focus');\n }\n\n $__default['default'](this).trigger('click');\n return;\n }\n\n var items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS)).filter(function (item) {\n return $__default['default'](item).is(':visible');\n });\n\n if (items.length === 0) {\n return;\n }\n\n var index = items.indexOf(event.target);\n\n if (event.which === ARROW_UP_KEYCODE && index > 0) {\n // Up\n index--;\n }\n\n if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {\n // Down\n index++;\n }\n\n if (index < 0) {\n index = 0;\n }\n\n items[index].focus();\n };\n\n _createClass(Dropdown, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION$4;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default$2;\n }\n }, {\n key: \"DefaultType\",\n get: function get() {\n return DefaultType$2;\n }\n }]);\n\n return Dropdown;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $__default['default'](document).on(EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$2, Dropdown._dataApiKeydownHandler).on(EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown._dataApiKeydownHandler).on(EVENT_CLICK_DATA_API$4 + \" \" + EVENT_KEYUP_DATA_API, Dropdown._clearMenus).on(EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$2, function (event) {\n event.preventDefault();\n event.stopPropagation();\n\n Dropdown._jQueryInterface.call($__default['default'](this), 'toggle');\n }).on(EVENT_CLICK_DATA_API$4, SELECTOR_FORM_CHILD, function (e) {\n e.stopPropagation();\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $__default['default'].fn[NAME$4] = Dropdown._jQueryInterface;\n $__default['default'].fn[NAME$4].Constructor = Dropdown;\n\n $__default['default'].fn[NAME$4].noConflict = function () {\n $__default['default'].fn[NAME$4] = JQUERY_NO_CONFLICT$4;\n return Dropdown._jQueryInterface;\n };\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME$5 = 'modal';\n var VERSION$5 = '4.5.3';\n var DATA_KEY$5 = 'bs.modal';\n var EVENT_KEY$5 = \".\" + DATA_KEY$5;\n var DATA_API_KEY$5 = '.data-api';\n var JQUERY_NO_CONFLICT$5 = $__default['default'].fn[NAME$5];\n var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key\n\n var Default$3 = {\n backdrop: true,\n keyboard: true,\n focus: true,\n show: true\n };\n var DefaultType$3 = {\n backdrop: '(boolean|string)',\n keyboard: 'boolean',\n focus: 'boolean',\n show: 'boolean'\n };\n var EVENT_HIDE$2 = \"hide\" + EVENT_KEY$5;\n var EVENT_HIDE_PREVENTED = \"hidePrevented\" + EVENT_KEY$5;\n var EVENT_HIDDEN$2 = \"hidden\" + EVENT_KEY$5;\n var EVENT_SHOW$2 = \"show\" + EVENT_KEY$5;\n var EVENT_SHOWN$2 = \"shown\" + EVENT_KEY$5;\n var EVENT_FOCUSIN = \"focusin\" + EVENT_KEY$5;\n var EVENT_RESIZE = \"resize\" + EVENT_KEY$5;\n var EVENT_CLICK_DISMISS = \"click.dismiss\" + EVENT_KEY$5;\n var EVENT_KEYDOWN_DISMISS = \"keydown.dismiss\" + EVENT_KEY$5;\n var EVENT_MOUSEUP_DISMISS = \"mouseup.dismiss\" + EVENT_KEY$5;\n var EVENT_MOUSEDOWN_DISMISS = \"mousedown.dismiss\" + EVENT_KEY$5;\n var EVENT_CLICK_DATA_API$5 = \"click\" + EVENT_KEY$5 + DATA_API_KEY$5;\n var CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable';\n var CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure';\n var CLASS_NAME_BACKDROP = 'modal-backdrop';\n var CLASS_NAME_OPEN = 'modal-open';\n var CLASS_NAME_FADE$1 = 'fade';\n var CLASS_NAME_SHOW$3 = 'show';\n var CLASS_NAME_STATIC = 'modal-static';\n var SELECTOR_DIALOG = '.modal-dialog';\n var SELECTOR_MODAL_BODY = '.modal-body';\n var SELECTOR_DATA_TOGGLE$3 = '[data-toggle=\"modal\"]';\n var SELECTOR_DATA_DISMISS = '[data-dismiss=\"modal\"]';\n var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';\n var SELECTOR_STICKY_CONTENT = '.sticky-top';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n var Modal = /*#__PURE__*/function () {\n function Modal(element, config) {\n this._config = this._getConfig(config);\n this._element = element;\n this._dialog = element.querySelector(SELECTOR_DIALOG);\n this._backdrop = null;\n this._isShown = false;\n this._isBodyOverflowing = false;\n this._ignoreBackdropClick = false;\n this._isTransitioning = false;\n this._scrollbarWidth = 0;\n } // Getters\n\n\n var _proto = Modal.prototype;\n\n // Public\n _proto.toggle = function toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget);\n };\n\n _proto.show = function show(relatedTarget) {\n var _this = this;\n\n if (this._isShown || this._isTransitioning) {\n return;\n }\n\n if ($__default['default'](this._element).hasClass(CLASS_NAME_FADE$1)) {\n this._isTransitioning = true;\n }\n\n var showEvent = $__default['default'].Event(EVENT_SHOW$2, {\n relatedTarget: relatedTarget\n });\n $__default['default'](this._element).trigger(showEvent);\n\n if (this._isShown || showEvent.isDefaultPrevented()) {\n return;\n }\n\n this._isShown = true;\n\n this._checkScrollbar();\n\n this._setScrollbar();\n\n this._adjustDialog();\n\n this._setEscapeEvent();\n\n this._setResizeEvent();\n\n $__default['default'](this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function (event) {\n return _this.hide(event);\n });\n $__default['default'](this._dialog).on(EVENT_MOUSEDOWN_DISMISS, function () {\n $__default['default'](_this._element).one(EVENT_MOUSEUP_DISMISS, function (event) {\n if ($__default['default'](event.target).is(_this._element)) {\n _this._ignoreBackdropClick = true;\n }\n });\n });\n\n this._showBackdrop(function () {\n return _this._showElement(relatedTarget);\n });\n };\n\n _proto.hide = function hide(event) {\n var _this2 = this;\n\n if (event) {\n event.preventDefault();\n }\n\n if (!this._isShown || this._isTransitioning) {\n return;\n }\n\n var hideEvent = $__default['default'].Event(EVENT_HIDE$2);\n $__default['default'](this._element).trigger(hideEvent);\n\n if (!this._isShown || hideEvent.isDefaultPrevented()) {\n return;\n }\n\n this._isShown = false;\n var transition = $__default['default'](this._element).hasClass(CLASS_NAME_FADE$1);\n\n if (transition) {\n this._isTransitioning = true;\n }\n\n this._setEscapeEvent();\n\n this._setResizeEvent();\n\n $__default['default'](document).off(EVENT_FOCUSIN);\n $__default['default'](this._element).removeClass(CLASS_NAME_SHOW$3);\n $__default['default'](this._element).off(EVENT_CLICK_DISMISS);\n $__default['default'](this._dialog).off(EVENT_MOUSEDOWN_DISMISS);\n\n if (transition) {\n var transitionDuration = Util.getTransitionDurationFromElement(this._element);\n $__default['default'](this._element).one(Util.TRANSITION_END, function (event) {\n return _this2._hideModal(event);\n }).emulateTransitionEnd(transitionDuration);\n } else {\n this._hideModal();\n }\n };\n\n _proto.dispose = function dispose() {\n [window, this._element, this._dialog].forEach(function (htmlElement) {\n return $__default['default'](htmlElement).off(EVENT_KEY$5);\n });\n /**\n * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`\n * Do not move `document` in `htmlElements` array\n * It will remove `EVENT_CLICK_DATA_API` event that should remain\n */\n\n $__default['default'](document).off(EVENT_FOCUSIN);\n $__default['default'].removeData(this._element, DATA_KEY$5);\n this._config = null;\n this._element = null;\n this._dialog = null;\n this._backdrop = null;\n this._isShown = null;\n this._isBodyOverflowing = null;\n this._ignoreBackdropClick = null;\n this._isTransitioning = null;\n this._scrollbarWidth = null;\n };\n\n _proto.handleUpdate = function handleUpdate() {\n this._adjustDialog();\n } // Private\n ;\n\n _proto._getConfig = function _getConfig(config) {\n config = _extends({}, Default$3, config);\n Util.typeCheckConfig(NAME$5, config, DefaultType$3);\n return config;\n };\n\n _proto._triggerBackdropTransition = function _triggerBackdropTransition() {\n var _this3 = this;\n\n if (this._config.backdrop === 'static') {\n var hideEventPrevented = $__default['default'].Event(EVENT_HIDE_PREVENTED);\n $__default['default'](this._element).trigger(hideEventPrevented);\n\n if (hideEventPrevented.isDefaultPrevented()) {\n return;\n }\n\n var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;\n\n if (!isModalOverflowing) {\n this._element.style.overflowY = 'hidden';\n }\n\n this._element.classList.add(CLASS_NAME_STATIC);\n\n var modalTransitionDuration = Util.getTransitionDurationFromElement(this._dialog);\n $__default['default'](this._element).off(Util.TRANSITION_END);\n $__default['default'](this._element).one(Util.TRANSITION_END, function () {\n _this3._element.classList.remove(CLASS_NAME_STATIC);\n\n if (!isModalOverflowing) {\n $__default['default'](_this3._element).one(Util.TRANSITION_END, function () {\n _this3._element.style.overflowY = '';\n }).emulateTransitionEnd(_this3._element, modalTransitionDuration);\n }\n }).emulateTransitionEnd(modalTransitionDuration);\n\n this._element.focus();\n } else {\n this.hide();\n }\n };\n\n _proto._showElement = function _showElement(relatedTarget) {\n var _this4 = this;\n\n var transition = $__default['default'](this._element).hasClass(CLASS_NAME_FADE$1);\n var modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null;\n\n if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {\n // Don't move modal's DOM position\n document.body.appendChild(this._element);\n }\n\n this._element.style.display = 'block';\n\n this._element.removeAttribute('aria-hidden');\n\n this._element.setAttribute('aria-modal', true);\n\n this._element.setAttribute('role', 'dialog');\n\n if ($__default['default'](this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) {\n modalBody.scrollTop = 0;\n } else {\n this._element.scrollTop = 0;\n }\n\n if (transition) {\n Util.reflow(this._element);\n }\n\n $__default['default'](this._element).addClass(CLASS_NAME_SHOW$3);\n\n if (this._config.focus) {\n this._enforceFocus();\n }\n\n var shownEvent = $__default['default'].Event(EVENT_SHOWN$2, {\n relatedTarget: relatedTarget\n });\n\n var transitionComplete = function transitionComplete() {\n if (_this4._config.focus) {\n _this4._element.focus();\n }\n\n _this4._isTransitioning = false;\n $__default['default'](_this4._element).trigger(shownEvent);\n };\n\n if (transition) {\n var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);\n $__default['default'](this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);\n } else {\n transitionComplete();\n }\n };\n\n _proto._enforceFocus = function _enforceFocus() {\n var _this5 = this;\n\n $__default['default'](document).off(EVENT_FOCUSIN) // Guard against infinite focus loop\n .on(EVENT_FOCUSIN, function (event) {\n if (document !== event.target && _this5._element !== event.target && $__default['default'](_this5._element).has(event.target).length === 0) {\n _this5._element.focus();\n }\n });\n };\n\n _proto._setEscapeEvent = function _setEscapeEvent() {\n var _this6 = this;\n\n if (this._isShown) {\n $__default['default'](this._element).on(EVENT_KEYDOWN_DISMISS, function (event) {\n if (_this6._config.keyboard && event.which === ESCAPE_KEYCODE$1) {\n event.preventDefault();\n\n _this6.hide();\n } else if (!_this6._config.keyboard && event.which === ESCAPE_KEYCODE$1) {\n _this6._triggerBackdropTransition();\n }\n });\n } else if (!this._isShown) {\n $__default['default'](this._element).off(EVENT_KEYDOWN_DISMISS);\n }\n };\n\n _proto._setResizeEvent = function _setResizeEvent() {\n var _this7 = this;\n\n if (this._isShown) {\n $__default['default'](window).on(EVENT_RESIZE, function (event) {\n return _this7.handleUpdate(event);\n });\n } else {\n $__default['default'](window).off(EVENT_RESIZE);\n }\n };\n\n _proto._hideModal = function _hideModal() {\n var _this8 = this;\n\n this._element.style.display = 'none';\n\n this._element.setAttribute('aria-hidden', true);\n\n this._element.removeAttribute('aria-modal');\n\n this._element.removeAttribute('role');\n\n this._isTransitioning = false;\n\n this._showBackdrop(function () {\n $__default['default'](document.body).removeClass(CLASS_NAME_OPEN);\n\n _this8._resetAdjustments();\n\n _this8._resetScrollbar();\n\n $__default['default'](_this8._element).trigger(EVENT_HIDDEN$2);\n });\n };\n\n _proto._removeBackdrop = function _removeBackdrop() {\n if (this._backdrop) {\n $__default['default'](this._backdrop).remove();\n this._backdrop = null;\n }\n };\n\n _proto._showBackdrop = function _showBackdrop(callback) {\n var _this9 = this;\n\n var animate = $__default['default'](this._element).hasClass(CLASS_NAME_FADE$1) ? CLASS_NAME_FADE$1 : '';\n\n if (this._isShown && this._config.backdrop) {\n this._backdrop = document.createElement('div');\n this._backdrop.className = CLASS_NAME_BACKDROP;\n\n if (animate) {\n this._backdrop.classList.add(animate);\n }\n\n $__default['default'](this._backdrop).appendTo(document.body);\n $__default['default'](this._element).on(EVENT_CLICK_DISMISS, function (event) {\n if (_this9._ignoreBackdropClick) {\n _this9._ignoreBackdropClick = false;\n return;\n }\n\n if (event.target !== event.currentTarget) {\n return;\n }\n\n _this9._triggerBackdropTransition();\n });\n\n if (animate) {\n Util.reflow(this._backdrop);\n }\n\n $__default['default'](this._backdrop).addClass(CLASS_NAME_SHOW$3);\n\n if (!callback) {\n return;\n }\n\n if (!animate) {\n callback();\n return;\n }\n\n var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);\n $__default['default'](this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);\n } else if (!this._isShown && this._backdrop) {\n $__default['default'](this._backdrop).removeClass(CLASS_NAME_SHOW$3);\n\n var callbackRemove = function callbackRemove() {\n _this9._removeBackdrop();\n\n if (callback) {\n callback();\n }\n };\n\n if ($__default['default'](this._element).hasClass(CLASS_NAME_FADE$1)) {\n var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);\n\n $__default['default'](this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);\n } else {\n callbackRemove();\n }\n } else if (callback) {\n callback();\n }\n } // ----------------------------------------------------------------------\n // the following methods are used to handle overflowing modals\n // todo (fat): these should probably be refactored out of modal.js\n // ----------------------------------------------------------------------\n ;\n\n _proto._adjustDialog = function _adjustDialog() {\n var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;\n\n if (!this._isBodyOverflowing && isModalOverflowing) {\n this._element.style.paddingLeft = this._scrollbarWidth + \"px\";\n }\n\n if (this._isBodyOverflowing && !isModalOverflowing) {\n this._element.style.paddingRight = this._scrollbarWidth + \"px\";\n }\n };\n\n _proto._resetAdjustments = function _resetAdjustments() {\n this._element.style.paddingLeft = '';\n this._element.style.paddingRight = '';\n };\n\n _proto._checkScrollbar = function _checkScrollbar() {\n var rect = document.body.getBoundingClientRect();\n this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth;\n this._scrollbarWidth = this._getScrollbarWidth();\n };\n\n _proto._setScrollbar = function _setScrollbar() {\n var _this10 = this;\n\n if (this._isBodyOverflowing) {\n // Note: DOMNode.style.paddingRight returns the actual value or '' if not set\n // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set\n var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT));\n var stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT)); // Adjust fixed content padding\n\n $__default['default'](fixedContent).each(function (index, element) {\n var actualPadding = element.style.paddingRight;\n var calculatedPadding = $__default['default'](element).css('padding-right');\n $__default['default'](element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + \"px\");\n }); // Adjust sticky content margin\n\n $__default['default'](stickyContent).each(function (index, element) {\n var actualMargin = element.style.marginRight;\n var calculatedMargin = $__default['default'](element).css('margin-right');\n $__default['default'](element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + \"px\");\n }); // Adjust body padding\n\n var actualPadding = document.body.style.paddingRight;\n var calculatedPadding = $__default['default'](document.body).css('padding-right');\n $__default['default'](document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + \"px\");\n }\n\n $__default['default'](document.body).addClass(CLASS_NAME_OPEN);\n };\n\n _proto._resetScrollbar = function _resetScrollbar() {\n // Restore fixed content padding\n var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT));\n $__default['default'](fixedContent).each(function (index, element) {\n var padding = $__default['default'](element).data('padding-right');\n $__default['default'](element).removeData('padding-right');\n element.style.paddingRight = padding ? padding : '';\n }); // Restore sticky content\n\n var elements = [].slice.call(document.querySelectorAll(\"\" + SELECTOR_STICKY_CONTENT));\n $__default['default'](elements).each(function (index, element) {\n var margin = $__default['default'](element).data('margin-right');\n\n if (typeof margin !== 'undefined') {\n $__default['default'](element).css('margin-right', margin).removeData('margin-right');\n }\n }); // Restore body padding\n\n var padding = $__default['default'](document.body).data('padding-right');\n $__default['default'](document.body).removeData('padding-right');\n document.body.style.paddingRight = padding ? padding : '';\n };\n\n _proto._getScrollbarWidth = function _getScrollbarWidth() {\n // thx d.walsh\n var scrollDiv = document.createElement('div');\n scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER;\n document.body.appendChild(scrollDiv);\n var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;\n document.body.removeChild(scrollDiv);\n return scrollbarWidth;\n } // Static\n ;\n\n Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n var data = $__default['default'](this).data(DATA_KEY$5);\n\n var _config = _extends({}, Default$3, $__default['default'](this).data(), typeof config === 'object' && config ? config : {});\n\n if (!data) {\n data = new Modal(this, _config);\n $__default['default'](this).data(DATA_KEY$5, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config](relatedTarget);\n } else if (_config.show) {\n data.show(relatedTarget);\n }\n });\n };\n\n _createClass(Modal, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION$5;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default$3;\n }\n }]);\n\n return Modal;\n }();\n /**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\n\n $__default['default'](document).on(EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$3, function (event) {\n var _this11 = this;\n\n var target;\n var selector = Util.getSelectorFromElement(this);\n\n if (selector) {\n target = document.querySelector(selector);\n }\n\n var config = $__default['default'](target).data(DATA_KEY$5) ? 'toggle' : _extends({}, $__default['default'](target).data(), $__default['default'](this).data());\n\n if (this.tagName === 'A' || this.tagName === 'AREA') {\n event.preventDefault();\n }\n\n var $target = $__default['default'](target).one(EVENT_SHOW$2, function (showEvent) {\n if (showEvent.isDefaultPrevented()) {\n // Only register focus restorer if modal will actually get shown\n return;\n }\n\n $target.one(EVENT_HIDDEN$2, function () {\n if ($__default['default'](_this11).is(':visible')) {\n _this11.focus();\n }\n });\n });\n\n Modal._jQueryInterface.call($__default['default'](target), config, this);\n });\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n $__default['default'].fn[NAME$5] = Modal._jQueryInterface;\n $__default['default'].fn[NAME$5].Constructor = Modal;\n\n $__default['default'].fn[NAME$5].noConflict = function () {\n $__default['default'].fn[NAME$5] = JQUERY_NO_CONFLICT$5;\n return Modal._jQueryInterface;\n };\n\n /**\n * --------------------------------------------------------------------------\n * Bootstrap (v4.5.3): tools/sanitizer.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];\n var ARIA_ATTRIBUTE_PATTERN = /^aria-[\\w-]*$/i;\n var DefaultWhitelist = {\n // Global attributes allowed on any supplied element below.\n '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],\n a: ['target', 'href', 'title', 'rel'],\n area: [],\n b: [],\n br: [],\n col: [],\n code: [],\n div: [],\n em: [],\n hr: [],\n h1: [],\n h2: [],\n h3: [],\n h4: [],\n h5: [],\n h6: [],\n i: [],\n img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],\n li: [],\n ol: [],\n p: [],\n pre: [],\n s: [],\n small: [],\n span: [],\n sub: [],\n sup: [],\n strong: [],\n u: [],\n ul: []\n };\n /**\n * A pattern that recognizes a commonly useful subset of URLs that are safe.\n *\n * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts\n */\n\n var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi;\n /**\n * A pattern that matches safe data URLs. Only matches image, video and audio types.\n *\n * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts\n */\n\n var DATA_URL_PATTERN = /^data:(?:image\\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\\/(?:mpeg|mp4|ogg|webm)|audio\\/(?:mp3|oga|ogg|opus));base64,[\\d+/a-z]+=*$/i;\n\n function allowedAttribute(attr, allowedAttributeList) {\n var attrName = attr.nodeName.toLowerCase();\n\n if (allowedAttributeList.indexOf(attrName) !== -1) {\n if (uriAttrs.indexOf(attrName) !== -1) {\n return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));\n }\n\n return true;\n }\n\n var regExp = allowedAttributeList.filter(function (attrRegex) {\n return attrRegex instanceof RegExp;\n }); // Check if a regular expression validates the attribute.\n\n for (var i = 0, len = regExp.length; i < len; i++) {\n if (attrName.match(regExp[i])) {\n return true;\n }\n }\n\n return false;\n }\n\n function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {\n if (unsafeHtml.length === 0) {\n return unsafeHtml;\n }\n\n if (sanitizeFn && typeof sanitizeFn === 'function') {\n return sanitizeFn(unsafeHtml);\n }\n\n var domParser = new window.DOMParser();\n var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');\n var whitelistKeys = Object.keys(whiteList);\n var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));\n\n var _loop = function _loop(i, len) {\n var el = elements[i];\n var elName = el.nodeName.toLowerCase();\n\n if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {\n el.parentNode.removeChild(el);\n return \"continue\";\n }\n\n var attributeList = [].slice.call(el.attributes);\n var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);\n attributeList.forEach(function (attr) {\n if (!allowedAttribute(attr, whitelistedAttributes)) {\n el.removeAttribute(attr.nodeName);\n }\n });\n };\n\n for (var i = 0, len = elements.length; i < len; i++) {\n var _ret = _loop(i);\n\n if (_ret === \"continue\") continue;\n }\n\n return createdDocument.body.innerHTML;\n }\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME$6 = 'tooltip';\n var VERSION$6 = '4.5.3';\n var DATA_KEY$6 = 'bs.tooltip';\n var EVENT_KEY$6 = \".\" + DATA_KEY$6;\n var JQUERY_NO_CONFLICT$6 = $__default['default'].fn[NAME$6];\n var CLASS_PREFIX = 'bs-tooltip';\n var BSCLS_PREFIX_REGEX = new RegExp(\"(^|\\\\s)\" + CLASS_PREFIX + \"\\\\S+\", 'g');\n var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];\n var DefaultType$4 = {\n animation: 'boolean',\n template: 'string',\n title: '(string|element|function)',\n trigger: 'string',\n delay: '(number|object)',\n html: 'boolean',\n selector: '(string|boolean)',\n placement: '(string|function)',\n offset: '(number|string|function)',\n container: '(string|element|boolean)',\n fallbackPlacement: '(string|array)',\n boundary: '(string|element)',\n sanitize: 'boolean',\n sanitizeFn: '(null|function)',\n whiteList: 'object',\n popperConfig: '(null|object)'\n };\n var AttachmentMap = {\n AUTO: 'auto',\n TOP: 'top',\n RIGHT: 'right',\n BOTTOM: 'bottom',\n LEFT: 'left'\n };\n var Default$4 = {\n animation: true,\n template: '
' + '
' + '
',\n trigger: 'hover focus',\n title: '',\n delay: 0,\n html: false,\n selector: false,\n placement: 'top',\n offset: 0,\n container: false,\n fallbackPlacement: 'flip',\n boundary: 'scrollParent',\n sanitize: true,\n sanitizeFn: null,\n whiteList: DefaultWhitelist,\n popperConfig: null\n };\n var HOVER_STATE_SHOW = 'show';\n var HOVER_STATE_OUT = 'out';\n var Event = {\n HIDE: \"hide\" + EVENT_KEY$6,\n HIDDEN: \"hidden\" + EVENT_KEY$6,\n SHOW: \"show\" + EVENT_KEY$6,\n SHOWN: \"shown\" + EVENT_KEY$6,\n INSERTED: \"inserted\" + EVENT_KEY$6,\n CLICK: \"click\" + EVENT_KEY$6,\n FOCUSIN: \"focusin\" + EVENT_KEY$6,\n FOCUSOUT: \"focusout\" + EVENT_KEY$6,\n MOUSEENTER: \"mouseenter\" + EVENT_KEY$6,\n MOUSELEAVE: \"mouseleave\" + EVENT_KEY$6\n };\n var CLASS_NAME_FADE$2 = 'fade';\n var CLASS_NAME_SHOW$4 = 'show';\n var SELECTOR_TOOLTIP_INNER = '.tooltip-inner';\n var SELECTOR_ARROW = '.arrow';\n var TRIGGER_HOVER = 'hover';\n var TRIGGER_FOCUS = 'focus';\n var TRIGGER_CLICK = 'click';\n var TRIGGER_MANUAL = 'manual';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n var Tooltip = /*#__PURE__*/function () {\n function Tooltip(element, config) {\n if (typeof Popper__default['default'] === 'undefined') {\n throw new TypeError('Bootstrap\\'s tooltips require Popper.js (https://popper.js.org/)');\n } // private\n\n\n this._isEnabled = true;\n this._timeout = 0;\n this._hoverState = '';\n this._activeTrigger = {};\n this._popper = null; // Protected\n\n this.element = element;\n this.config = this._getConfig(config);\n this.tip = null;\n\n this._setListeners();\n } // Getters\n\n\n var _proto = Tooltip.prototype;\n\n // Public\n _proto.enable = function enable() {\n this._isEnabled = true;\n };\n\n _proto.disable = function disable() {\n this._isEnabled = false;\n };\n\n _proto.toggleEnabled = function toggleEnabled() {\n this._isEnabled = !this._isEnabled;\n };\n\n _proto.toggle = function toggle(event) {\n if (!this._isEnabled) {\n return;\n }\n\n if (event) {\n var dataKey = this.constructor.DATA_KEY;\n var context = $__default['default'](event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $__default['default'](event.currentTarget).data(dataKey, context);\n }\n\n context._activeTrigger.click = !context._activeTrigger.click;\n\n if (context._isWithActiveTrigger()) {\n context._enter(null, context);\n } else {\n context._leave(null, context);\n }\n } else {\n if ($__default['default'](this.getTipElement()).hasClass(CLASS_NAME_SHOW$4)) {\n this._leave(null, this);\n\n return;\n }\n\n this._enter(null, this);\n }\n };\n\n _proto.dispose = function dispose() {\n clearTimeout(this._timeout);\n $__default['default'].removeData(this.element, this.constructor.DATA_KEY);\n $__default['default'](this.element).off(this.constructor.EVENT_KEY);\n $__default['default'](this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);\n\n if (this.tip) {\n $__default['default'](this.tip).remove();\n }\n\n this._isEnabled = null;\n this._timeout = null;\n this._hoverState = null;\n this._activeTrigger = null;\n\n if (this._popper) {\n this._popper.destroy();\n }\n\n this._popper = null;\n this.element = null;\n this.config = null;\n this.tip = null;\n };\n\n _proto.show = function show() {\n var _this = this;\n\n if ($__default['default'](this.element).css('display') === 'none') {\n throw new Error('Please use show on visible elements');\n }\n\n var showEvent = $__default['default'].Event(this.constructor.Event.SHOW);\n\n if (this.isWithContent() && this._isEnabled) {\n $__default['default'](this.element).trigger(showEvent);\n var shadowRoot = Util.findShadowRoot(this.element);\n var isInTheDom = $__default['default'].contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);\n\n if (showEvent.isDefaultPrevented() || !isInTheDom) {\n return;\n }\n\n var tip = this.getTipElement();\n var tipId = Util.getUID(this.constructor.NAME);\n tip.setAttribute('id', tipId);\n this.element.setAttribute('aria-describedby', tipId);\n this.setContent();\n\n if (this.config.animation) {\n $__default['default'](tip).addClass(CLASS_NAME_FADE$2);\n }\n\n var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;\n\n var attachment = this._getAttachment(placement);\n\n this.addAttachmentClass(attachment);\n\n var container = this._getContainer();\n\n $__default['default'](tip).data(this.constructor.DATA_KEY, this);\n\n if (!$__default['default'].contains(this.element.ownerDocument.documentElement, this.tip)) {\n $__default['default'](tip).appendTo(container);\n }\n\n $__default['default'](this.element).trigger(this.constructor.Event.INSERTED);\n this._popper = new Popper__default['default'](this.element, tip, this._getPopperConfig(attachment));\n $__default['default'](tip).addClass(CLASS_NAME_SHOW$4); // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n\n if ('ontouchstart' in document.documentElement) {\n $__default['default'](document.body).children().on('mouseover', null, $__default['default'].noop);\n }\n\n var complete = function complete() {\n if (_this.config.animation) {\n _this._fixTransition();\n }\n\n var prevHoverState = _this._hoverState;\n _this._hoverState = null;\n $__default['default'](_this.element).trigger(_this.constructor.Event.SHOWN);\n\n if (prevHoverState === HOVER_STATE_OUT) {\n _this._leave(null, _this);\n }\n };\n\n if ($__default['default'](this.tip).hasClass(CLASS_NAME_FADE$2)) {\n var transitionDuration = Util.getTransitionDurationFromElement(this.tip);\n $__default['default'](this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n }\n };\n\n _proto.hide = function hide(callback) {\n var _this2 = this;\n\n var tip = this.getTipElement();\n var hideEvent = $__default['default'].Event(this.constructor.Event.HIDE);\n\n var complete = function complete() {\n if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {\n tip.parentNode.removeChild(tip);\n }\n\n _this2._cleanTipClass();\n\n _this2.element.removeAttribute('aria-describedby');\n\n $__default['default'](_this2.element).trigger(_this2.constructor.Event.HIDDEN);\n\n if (_this2._popper !== null) {\n _this2._popper.destroy();\n }\n\n if (callback) {\n callback();\n }\n };\n\n $__default['default'](this.element).trigger(hideEvent);\n\n if (hideEvent.isDefaultPrevented()) {\n return;\n }\n\n $__default['default'](tip).removeClass(CLASS_NAME_SHOW$4); // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n\n if ('ontouchstart' in document.documentElement) {\n $__default['default'](document.body).children().off('mouseover', null, $__default['default'].noop);\n }\n\n this._activeTrigger[TRIGGER_CLICK] = false;\n this._activeTrigger[TRIGGER_FOCUS] = false;\n this._activeTrigger[TRIGGER_HOVER] = false;\n\n if ($__default['default'](this.tip).hasClass(CLASS_NAME_FADE$2)) {\n var transitionDuration = Util.getTransitionDurationFromElement(tip);\n $__default['default'](tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);\n } else {\n complete();\n }\n\n this._hoverState = '';\n };\n\n _proto.update = function update() {\n if (this._popper !== null) {\n this._popper.scheduleUpdate();\n }\n } // Protected\n ;\n\n _proto.isWithContent = function isWithContent() {\n return Boolean(this.getTitle());\n };\n\n _proto.addAttachmentClass = function addAttachmentClass(attachment) {\n $__default['default'](this.getTipElement()).addClass(CLASS_PREFIX + \"-\" + attachment);\n };\n\n _proto.getTipElement = function getTipElement() {\n this.tip = this.tip || $__default['default'](this.config.template)[0];\n return this.tip;\n };\n\n _proto.setContent = function setContent() {\n var tip = this.getTipElement();\n this.setElementContent($__default['default'](tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle());\n $__default['default'](tip).removeClass(CLASS_NAME_FADE$2 + \" \" + CLASS_NAME_SHOW$4);\n };\n\n _proto.setElementContent = function setElementContent($element, content) {\n if (typeof content === 'object' && (content.nodeType || content.jquery)) {\n // Content is a DOM node or a jQuery\n if (this.config.html) {\n if (!$__default['default'](content).parent().is($element)) {\n $element.empty().append(content);\n }\n } else {\n $element.text($__default['default'](content).text());\n }\n\n return;\n }\n\n if (this.config.html) {\n if (this.config.sanitize) {\n content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);\n }\n\n $element.html(content);\n } else {\n $element.text(content);\n }\n };\n\n _proto.getTitle = function getTitle() {\n var title = this.element.getAttribute('data-original-title');\n\n if (!title) {\n title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;\n }\n\n return title;\n } // Private\n ;\n\n _proto._getPopperConfig = function _getPopperConfig(attachment) {\n var _this3 = this;\n\n var defaultBsConfig = {\n placement: attachment,\n modifiers: {\n offset: this._getOffset(),\n flip: {\n behavior: this.config.fallbackPlacement\n },\n arrow: {\n element: SELECTOR_ARROW\n },\n preventOverflow: {\n boundariesElement: this.config.boundary\n }\n },\n onCreate: function onCreate(data) {\n if (data.originalPlacement !== data.placement) {\n _this3._handlePopperPlacementChange(data);\n }\n },\n onUpdate: function onUpdate(data) {\n return _this3._handlePopperPlacementChange(data);\n }\n };\n return _extends({}, defaultBsConfig, this.config.popperConfig);\n };\n\n _proto._getOffset = function _getOffset() {\n var _this4 = this;\n\n var offset = {};\n\n if (typeof this.config.offset === 'function') {\n offset.fn = function (data) {\n data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element) || {});\n return data;\n };\n } else {\n offset.offset = this.config.offset;\n }\n\n return offset;\n };\n\n _proto._getContainer = function _getContainer() {\n if (this.config.container === false) {\n return document.body;\n }\n\n if (Util.isElement(this.config.container)) {\n return $__default['default'](this.config.container);\n }\n\n return $__default['default'](document).find(this.config.container);\n };\n\n _proto._getAttachment = function _getAttachment(placement) {\n return AttachmentMap[placement.toUpperCase()];\n };\n\n _proto._setListeners = function _setListeners() {\n var _this5 = this;\n\n var triggers = this.config.trigger.split(' ');\n triggers.forEach(function (trigger) {\n if (trigger === 'click') {\n $__default['default'](_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {\n return _this5.toggle(event);\n });\n } else if (trigger !== TRIGGER_MANUAL) {\n var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;\n var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;\n $__default['default'](_this5.element).on(eventIn, _this5.config.selector, function (event) {\n return _this5._enter(event);\n }).on(eventOut, _this5.config.selector, function (event) {\n return _this5._leave(event);\n });\n }\n });\n\n this._hideModalHandler = function () {\n if (_this5.element) {\n _this5.hide();\n }\n };\n\n $__default['default'](this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);\n\n if (this.config.selector) {\n this.config = _extends({}, this.config, {\n trigger: 'manual',\n selector: ''\n });\n } else {\n this._fixTitle();\n }\n };\n\n _proto._fixTitle = function _fixTitle() {\n var titleType = typeof this.element.getAttribute('data-original-title');\n\n if (this.element.getAttribute('title') || titleType !== 'string') {\n this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');\n this.element.setAttribute('title', '');\n }\n };\n\n _proto._enter = function _enter(event, context) {\n var dataKey = this.constructor.DATA_KEY;\n context = context || $__default['default'](event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $__default['default'](event.currentTarget).data(dataKey, context);\n }\n\n if (event) {\n context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;\n }\n\n if ($__default['default'](context.getTipElement()).hasClass(CLASS_NAME_SHOW$4) || context._hoverState === HOVER_STATE_SHOW) {\n context._hoverState = HOVER_STATE_SHOW;\n return;\n }\n\n clearTimeout(context._timeout);\n context._hoverState = HOVER_STATE_SHOW;\n\n if (!context.config.delay || !context.config.delay.show) {\n context.show();\n return;\n }\n\n context._timeout = setTimeout(function () {\n if (context._hoverState === HOVER_STATE_SHOW) {\n context.show();\n }\n }, context.config.delay.show);\n };\n\n _proto._leave = function _leave(event, context) {\n var dataKey = this.constructor.DATA_KEY;\n context = context || $__default['default'](event.currentTarget).data(dataKey);\n\n if (!context) {\n context = new this.constructor(event.currentTarget, this._getDelegateConfig());\n $__default['default'](event.currentTarget).data(dataKey, context);\n }\n\n if (event) {\n context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;\n }\n\n if (context._isWithActiveTrigger()) {\n return;\n }\n\n clearTimeout(context._timeout);\n context._hoverState = HOVER_STATE_OUT;\n\n if (!context.config.delay || !context.config.delay.hide) {\n context.hide();\n return;\n }\n\n context._timeout = setTimeout(function () {\n if (context._hoverState === HOVER_STATE_OUT) {\n context.hide();\n }\n }, context.config.delay.hide);\n };\n\n _proto._isWithActiveTrigger = function _isWithActiveTrigger() {\n for (var trigger in this._activeTrigger) {\n if (this._activeTrigger[trigger]) {\n return true;\n }\n }\n\n return false;\n };\n\n _proto._getConfig = function _getConfig(config) {\n var dataAttributes = $__default['default'](this.element).data();\n Object.keys(dataAttributes).forEach(function (dataAttr) {\n if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {\n delete dataAttributes[dataAttr];\n }\n });\n config = _extends({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {});\n\n if (typeof config.delay === 'number') {\n config.delay = {\n show: config.delay,\n hide: config.delay\n };\n }\n\n if (typeof config.title === 'number') {\n config.title = config.title.toString();\n }\n\n if (typeof config.content === 'number') {\n config.content = config.content.toString();\n }\n\n Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType);\n\n if (config.sanitize) {\n config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);\n }\n\n return config;\n };\n\n _proto._getDelegateConfig = function _getDelegateConfig() {\n var config = {};\n\n if (this.config) {\n for (var key in this.config) {\n if (this.constructor.Default[key] !== this.config[key]) {\n config[key] = this.config[key];\n }\n }\n }\n\n return config;\n };\n\n _proto._cleanTipClass = function _cleanTipClass() {\n var $tip = $__default['default'](this.getTipElement());\n var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);\n\n if (tabClass !== null && tabClass.length) {\n $tip.removeClass(tabClass.join(''));\n }\n };\n\n _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {\n this.tip = popperData.instance.popper;\n\n this._cleanTipClass();\n\n this.addAttachmentClass(this._getAttachment(popperData.placement));\n };\n\n _proto._fixTransition = function _fixTransition() {\n var tip = this.getTipElement();\n var initConfigAnimation = this.config.animation;\n\n if (tip.getAttribute('x-placement') !== null) {\n return;\n }\n\n $__default['default'](tip).removeClass(CLASS_NAME_FADE$2);\n this.config.animation = false;\n this.hide();\n this.show();\n this.config.animation = initConfigAnimation;\n } // Static\n ;\n\n Tooltip._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var $element = $__default['default'](this);\n var data = $element.data(DATA_KEY$6);\n\n var _config = typeof config === 'object' && config;\n\n if (!data && /dispose|hide/.test(config)) {\n return;\n }\n\n if (!data) {\n data = new Tooltip(this, _config);\n $element.data(DATA_KEY$6, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Tooltip, null, [{\n key: \"VERSION\",\n get: function get() {\n return VERSION$6;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default$4;\n }\n }, {\n key: \"NAME\",\n get: function get() {\n return NAME$6;\n }\n }, {\n key: \"DATA_KEY\",\n get: function get() {\n return DATA_KEY$6;\n }\n }, {\n key: \"Event\",\n get: function get() {\n return Event;\n }\n }, {\n key: \"EVENT_KEY\",\n get: function get() {\n return EVENT_KEY$6;\n }\n }, {\n key: \"DefaultType\",\n get: function get() {\n return DefaultType$4;\n }\n }]);\n\n return Tooltip;\n }();\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n\n $__default['default'].fn[NAME$6] = Tooltip._jQueryInterface;\n $__default['default'].fn[NAME$6].Constructor = Tooltip;\n\n $__default['default'].fn[NAME$6].noConflict = function () {\n $__default['default'].fn[NAME$6] = JQUERY_NO_CONFLICT$6;\n return Tooltip._jQueryInterface;\n };\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME$7 = 'popover';\n var VERSION$7 = '4.5.3';\n var DATA_KEY$7 = 'bs.popover';\n var EVENT_KEY$7 = \".\" + DATA_KEY$7;\n var JQUERY_NO_CONFLICT$7 = $__default['default'].fn[NAME$7];\n var CLASS_PREFIX$1 = 'bs-popover';\n var BSCLS_PREFIX_REGEX$1 = new RegExp(\"(^|\\\\s)\" + CLASS_PREFIX$1 + \"\\\\S+\", 'g');\n\n var Default$5 = _extends({}, Tooltip.Default, {\n placement: 'right',\n trigger: 'click',\n content: '',\n template: '
' + '
' + '

' + '
'\n });\n\n var DefaultType$5 = _extends({}, Tooltip.DefaultType, {\n content: '(string|element|function)'\n });\n\n var CLASS_NAME_FADE$3 = 'fade';\n var CLASS_NAME_SHOW$5 = 'show';\n var SELECTOR_TITLE = '.popover-header';\n var SELECTOR_CONTENT = '.popover-body';\n var Event$1 = {\n HIDE: \"hide\" + EVENT_KEY$7,\n HIDDEN: \"hidden\" + EVENT_KEY$7,\n SHOW: \"show\" + EVENT_KEY$7,\n SHOWN: \"shown\" + EVENT_KEY$7,\n INSERTED: \"inserted\" + EVENT_KEY$7,\n CLICK: \"click\" + EVENT_KEY$7,\n FOCUSIN: \"focusin\" + EVENT_KEY$7,\n FOCUSOUT: \"focusout\" + EVENT_KEY$7,\n MOUSEENTER: \"mouseenter\" + EVENT_KEY$7,\n MOUSELEAVE: \"mouseleave\" + EVENT_KEY$7\n };\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n var Popover = /*#__PURE__*/function (_Tooltip) {\n _inheritsLoose(Popover, _Tooltip);\n\n function Popover() {\n return _Tooltip.apply(this, arguments) || this;\n }\n\n var _proto = Popover.prototype;\n\n // Overrides\n _proto.isWithContent = function isWithContent() {\n return this.getTitle() || this._getContent();\n };\n\n _proto.addAttachmentClass = function addAttachmentClass(attachment) {\n $__default['default'](this.getTipElement()).addClass(CLASS_PREFIX$1 + \"-\" + attachment);\n };\n\n _proto.getTipElement = function getTipElement() {\n this.tip = this.tip || $__default['default'](this.config.template)[0];\n return this.tip;\n };\n\n _proto.setContent = function setContent() {\n var $tip = $__default['default'](this.getTipElement()); // We use append for html objects to maintain js events\n\n this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle());\n\n var content = this._getContent();\n\n if (typeof content === 'function') {\n content = content.call(this.element);\n }\n\n this.setElementContent($tip.find(SELECTOR_CONTENT), content);\n $tip.removeClass(CLASS_NAME_FADE$3 + \" \" + CLASS_NAME_SHOW$5);\n } // Private\n ;\n\n _proto._getContent = function _getContent() {\n return this.element.getAttribute('data-content') || this.config.content;\n };\n\n _proto._cleanTipClass = function _cleanTipClass() {\n var $tip = $__default['default'](this.getTipElement());\n var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1);\n\n if (tabClass !== null && tabClass.length > 0) {\n $tip.removeClass(tabClass.join(''));\n }\n } // Static\n ;\n\n Popover._jQueryInterface = function _jQueryInterface(config) {\n return this.each(function () {\n var data = $__default['default'](this).data(DATA_KEY$7);\n\n var _config = typeof config === 'object' ? config : null;\n\n if (!data && /dispose|hide/.test(config)) {\n return;\n }\n\n if (!data) {\n data = new Popover(this, _config);\n $__default['default'](this).data(DATA_KEY$7, data);\n }\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(\"No method named \\\"\" + config + \"\\\"\");\n }\n\n data[config]();\n }\n });\n };\n\n _createClass(Popover, null, [{\n key: \"VERSION\",\n // Getters\n get: function get() {\n return VERSION$7;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default$5;\n }\n }, {\n key: \"NAME\",\n get: function get() {\n return NAME$7;\n }\n }, {\n key: \"DATA_KEY\",\n get: function get() {\n return DATA_KEY$7;\n }\n }, {\n key: \"Event\",\n get: function get() {\n return Event$1;\n }\n }, {\n key: \"EVENT_KEY\",\n get: function get() {\n return EVENT_KEY$7;\n }\n }, {\n key: \"DefaultType\",\n get: function get() {\n return DefaultType$5;\n }\n }]);\n\n return Popover;\n }(Tooltip);\n /**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\n\n $__default['default'].fn[NAME$7] = Popover._jQueryInterface;\n $__default['default'].fn[NAME$7].Constructor = Popover;\n\n $__default['default'].fn[NAME$7].noConflict = function () {\n $__default['default'].fn[NAME$7] = JQUERY_NO_CONFLICT$7;\n return Popover._jQueryInterface;\n };\n\n /**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\n var NAME$8 = 'scrollspy';\n var VERSION$8 = '4.5.3';\n var DATA_KEY$8 = 'bs.scrollspy';\n var EVENT_KEY$8 = \".\" + DATA_KEY$8;\n var DATA_API_KEY$6 = '.data-api';\n var JQUERY_NO_CONFLICT$8 = $__default['default'].fn[NAME$8];\n var Default$6 = {\n offset: 10,\n method: 'auto',\n target: ''\n };\n var DefaultType$6 = {\n offset: 'number',\n method: 'string',\n target: '(string|element)'\n };\n var EVENT_ACTIVATE = \"activate\" + EVENT_KEY$8;\n var EVENT_SCROLL = \"scroll\" + EVENT_KEY$8;\n var EVENT_LOAD_DATA_API$2 = \"load\" + EVENT_KEY$8 + DATA_API_KEY$6;\n var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';\n var CLASS_NAME_ACTIVE$2 = 'active';\n var SELECTOR_DATA_SPY = '[data-spy=\"scroll\"]';\n var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';\n var SELECTOR_NAV_LINKS = '.nav-link';\n var SELECTOR_NAV_ITEMS = '.nav-item';\n var SELECTOR_LIST_ITEMS = '.list-group-item';\n var SELECTOR_DROPDOWN = '.dropdown';\n var SELECTOR_DROPDOWN_ITEMS = '.dropdown-item';\n var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';\n var METHOD_OFFSET = 'offset';\n var METHOD_POSITION = 'position';\n /**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n var ScrollSpy = /*#__PURE__*/function () {\n function ScrollSpy(element, config) {\n var _this = this;\n\n this._element = element;\n this._scrollElement = element.tagName === 'BODY' ? window : element;\n this._config = this._getConfig(config);\n this._selector = this._config.target + \" \" + SELECTOR_NAV_LINKS + \",\" + (this._config.target + \" \" + SELECTOR_LIST_ITEMS + \",\") + (this._config.target + \" \" + SELECTOR_DROPDOWN_ITEMS);\n this._offsets = [];\n this._targets = [];\n this._activeTarget = null;\n this._scrollHeight = 0;\n $__default['default'](this._scrollElement).on(EVENT_SCROLL, function (event) {\n return _this._process(event);\n });\n this.refresh();\n\n this._process();\n } // Getters\n\n\n var _proto = ScrollSpy.prototype;\n\n // Public\n _proto.refresh = function refresh() {\n var _this2 = this;\n\n var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION;\n var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;\n var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0;\n this._offsets = [];\n this._targets = [];\n this._scrollHeight = this._getScrollHeight();\n var targets = [].slice.call(document.querySelectorAll(this._selector));\n targets.map(function (element) {\n var target;\n var targetSelector = Util.getSelectorFromElement(element);\n\n if (targetSelector) {\n target = document.querySelector(targetSelector);\n }\n\n if (target) {\n var targetBCR = target.getBoundingClientRect();\n\n if (targetBCR.width || targetBCR.height) {\n // TODO (fat): remove sketch reliance on jQuery position/offset\n return [$__default['default'](target)[offsetMethod]().top + offsetBase, targetSelector];\n }\n }\n\n return null;\n }).filter(function (item) {\n return item;\n }).sort(function (a, b) {\n return a[0] - b[0];\n }).forEach(function (item) {\n _this2._offsets.push(item[0]);\n\n _this2._targets.push(item[1]);\n });\n };\n\n _proto.dispose = function dispose() {\n $__default['default'].removeData(this._element, DATA_KEY$8);\n $__default['default'](this._scrollElement).off(EVENT_KEY$8);\n this._element = null;\n this._scrollElement = null;\n this._config = null;\n this._selector = null;\n this._offsets = null;\n this._targets = null;\n this._activeTarget = null;\n this._scrollHeight = null;\n } // Private\n ;\n\n _proto._getConfig = function _getConfig(config) {\n config = _extends({}, Default$6, typeof config === 'object' && config ? config : {});\n\n if (typeof config.target !== 'string' && Util.isElement(config.target)) {\n var id = $__default['default'](config.target).attr('id');\n\n if (!id) {\n id = Util.getUID(NAME$8);\n $__default['default'](config.target).attr('id', id);\n }\n\n config.target = \"#\" + id;\n }\n\n Util.typeCheckConfig(NAME$8, config, DefaultType$6);\n return config;\n };\n\n _proto._getScrollTop = function _getScrollTop() {\n return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;\n };\n\n _proto._getScrollHeight = function _getScrollHeight() {\n return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);\n };\n\n _proto._getOffsetHeight = function _getOffsetHeight() {\n return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;\n };\n\n _proto._process = function _process() {\n var scrollTop = this._getScrollTop() + this._config.offset;\n\n var scrollHeight = this._getScrollHeight();\n\n var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();\n\n if (this._scrollHeight !== scrollHeight) {\n this.refresh();\n }\n\n if (scrollTop >= maxScroll) {\n var target = this._targets[this._targets.length - 1];\n\n if (this._activeTarget !== target) {\n this._activate(target);\n }\n\n return;\n }\n\n if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {\n this._activeTarget = null;\n\n this._clear();\n\n return;\n }\n\n for (var i = this._offsets.length; i--;) {\n var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);\n\n if (isActiveTarget) {\n this._activate(this._targets[i]);\n }\n }\n };\n\n _proto._activate = function _activate(target) {\n this._activeTarget = target;\n\n this._clear();\n\n var queries = this._selector.split(',').map(function (selector) {\n return selector + \"[data-target=\\\"\" + target + \"\\\"],\" + selector + \"[href=\\\"\" + target + \"\\\"]\";\n });\n\n var $link = $__default['default']([].slice.call(document.querySelectorAll(queries.join(','))));\n\n if ($link.hasClass(CLASS_NAME_DROPDOWN_ITEM)) {\n $link.closest(SELECTOR_DROPDOWN).find(SELECTOR_DROPDOWN_TOGGLE).addClass(CLASS_NAME_ACTIVE$2);\n $link.addClass(CLASS_NAME_ACTIVE$2);\n } else {\n // Set triggered link as active\n $link.addClass(CLASS_NAME_ACTIVE$2); // Set triggered links parents as active\n // With both
    and