serves as a min-height\n },\n }, arg.tableColGroupNode, createElement('tbody', {}, typeof chunkConfig.rowContent === 'function' ? chunkConfig.rowContent(arg) : chunkConfig.rowContent));\n return content;\n}\nfunction isColPropsEqual(cols0, cols1) {\n return isArraysEqual(cols0, cols1, isPropsEqual);\n}\nfunction renderMicroColGroup(cols, shrinkWidth) {\n var colNodes = [];\n /*\n for ColProps with spans, it would have been great to make a single \n HOWEVER, Chrome was getting messing up distributing the width to / | elements with colspans.\n SOLUTION: making individual elements makes Chrome behave.\n */\n for (var _i = 0, cols_1 = cols; _i < cols_1.length; _i++) {\n var colProps = cols_1[_i];\n var span = colProps.span || 1;\n for (var i = 0; i < span; i += 1) {\n colNodes.push(createElement(\"col\", { style: {\n width: colProps.width === 'shrink' ? sanitizeShrinkWidth(shrinkWidth) : (colProps.width || ''),\n minWidth: colProps.minWidth || '',\n } }));\n }\n }\n return createElement.apply(void 0, __spreadArray(['colgroup', {}], colNodes));\n}\nfunction sanitizeShrinkWidth(shrinkWidth) {\n /* why 4? if we do 0, it will kill any border, which are needed for computeSmallestCellWidth\n 4 accounts for 2 2-pixel borders. TODO: better solution? */\n return shrinkWidth == null ? 4 : shrinkWidth;\n}\nfunction hasShrinkWidth(cols) {\n for (var _i = 0, cols_2 = cols; _i < cols_2.length; _i++) {\n var col = cols_2[_i];\n if (col.width === 'shrink') {\n return true;\n }\n }\n return false;\n}\nfunction getScrollGridClassNames(liquid, context) {\n var classNames = [\n 'fc-scrollgrid',\n context.theme.getClass('table'),\n ];\n if (liquid) {\n classNames.push('fc-scrollgrid-liquid');\n }\n return classNames;\n}\nfunction getSectionClassNames(sectionConfig, wholeTableVGrow) {\n var classNames = [\n 'fc-scrollgrid-section',\n \"fc-scrollgrid-section-\" + sectionConfig.type,\n sectionConfig.className, // used?\n ];\n if (wholeTableVGrow && sectionConfig.liquid && sectionConfig.maxHeight == null) {\n classNames.push('fc-scrollgrid-section-liquid');\n }\n if (sectionConfig.isSticky) {\n classNames.push('fc-scrollgrid-section-sticky');\n }\n return classNames;\n}\nfunction renderScrollShim(arg) {\n return (createElement(\"div\", { className: \"fc-scrollgrid-sticky-shim\", style: {\n width: arg.clientWidth,\n minWidth: arg.tableMinWidth,\n } }));\n}\nfunction getStickyHeaderDates(options) {\n var stickyHeaderDates = options.stickyHeaderDates;\n if (stickyHeaderDates == null || stickyHeaderDates === 'auto') {\n stickyHeaderDates = options.height === 'auto' || options.viewHeight === 'auto';\n }\n return stickyHeaderDates;\n}\nfunction getStickyFooterScrollbar(options) {\n var stickyFooterScrollbar = options.stickyFooterScrollbar;\n if (stickyFooterScrollbar == null || stickyFooterScrollbar === 'auto') {\n stickyFooterScrollbar = options.height === 'auto' || options.viewHeight === 'auto';\n }\n return stickyFooterScrollbar;\n}\n\nvar SimpleScrollGrid = /** @class */ (function (_super) {\n __extends(SimpleScrollGrid, _super);\n function SimpleScrollGrid() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.processCols = memoize(function (a) { return a; }, isColPropsEqual); // so we get same `cols` props every time\n // yucky to memoize VNodes, but much more efficient for consumers\n _this.renderMicroColGroup = memoize(renderMicroColGroup);\n _this.scrollerRefs = new RefMap();\n _this.scrollerElRefs = new RefMap(_this._handleScrollerEl.bind(_this));\n _this.state = {\n shrinkWidth: null,\n forceYScrollbars: false,\n scrollerClientWidths: {},\n scrollerClientHeights: {},\n };\n // TODO: can do a really simple print-view. dont need to join rows\n _this.handleSizing = function () {\n _this.setState(__assign({ shrinkWidth: _this.computeShrinkWidth() }, _this.computeScrollerDims()));\n };\n return _this;\n }\n SimpleScrollGrid.prototype.render = function () {\n var _a = this, props = _a.props, state = _a.state, context = _a.context;\n var sectionConfigs = props.sections || [];\n var cols = this.processCols(props.cols);\n var microColGroupNode = this.renderMicroColGroup(cols, state.shrinkWidth);\n var classNames = getScrollGridClassNames(props.liquid, context);\n if (props.collapsibleWidth) {\n classNames.push('fc-scrollgrid-collapsible');\n }\n // TODO: make DRY\n var configCnt = sectionConfigs.length;\n var configI = 0;\n var currentConfig;\n var headSectionNodes = [];\n var bodySectionNodes = [];\n var footSectionNodes = [];\n while (configI < configCnt && (currentConfig = sectionConfigs[configI]).type === 'header') {\n headSectionNodes.push(this.renderSection(currentConfig, microColGroupNode));\n configI += 1;\n }\n while (configI < configCnt && (currentConfig = sectionConfigs[configI]).type === 'body') {\n bodySectionNodes.push(this.renderSection(currentConfig, microColGroupNode));\n configI += 1;\n }\n while (configI < configCnt && (currentConfig = sectionConfigs[configI]).type === 'footer') {\n footSectionNodes.push(this.renderSection(currentConfig, microColGroupNode));\n configI += 1;\n }\n // firefox bug: when setting height on table and there is a thead or tfoot,\n // the necessary height:100% on the liquid-height body section forces the *whole* table to be taller. (bug #5524)\n // use getCanVGrowWithinCell as a way to detect table-stupid firefox.\n // if so, use a simpler dom structure, jam everything into a lone tbody.\n var isBuggy = !getCanVGrowWithinCell();\n return createElement('table', {\n className: classNames.join(' '),\n style: { height: props.height },\n }, Boolean(!isBuggy && headSectionNodes.length) && createElement.apply(void 0, __spreadArray(['thead', {}], headSectionNodes)), Boolean(!isBuggy && bodySectionNodes.length) && createElement.apply(void 0, __spreadArray(['tbody', {}], bodySectionNodes)), Boolean(!isBuggy && footSectionNodes.length) && createElement.apply(void 0, __spreadArray(['tfoot', {}], footSectionNodes)), isBuggy && createElement.apply(void 0, __spreadArray(__spreadArray(__spreadArray(['tbody', {}], headSectionNodes), bodySectionNodes), footSectionNodes)));\n };\n SimpleScrollGrid.prototype.renderSection = function (sectionConfig, microColGroupNode) {\n if ('outerContent' in sectionConfig) {\n return (createElement(Fragment, { key: sectionConfig.key }, sectionConfig.outerContent));\n }\n return (createElement(\"tr\", { key: sectionConfig.key, className: getSectionClassNames(sectionConfig, this.props.liquid).join(' ') }, this.renderChunkTd(sectionConfig, microColGroupNode, sectionConfig.chunk)));\n };\n SimpleScrollGrid.prototype.renderChunkTd = function (sectionConfig, microColGroupNode, chunkConfig) {\n if ('outerContent' in chunkConfig) {\n return chunkConfig.outerContent;\n }\n var props = this.props;\n var _a = this.state, forceYScrollbars = _a.forceYScrollbars, scrollerClientWidths = _a.scrollerClientWidths, scrollerClientHeights = _a.scrollerClientHeights;\n var needsYScrolling = getAllowYScrolling(props, sectionConfig); // TODO: do lazily. do in section config?\n var isLiquid = getSectionHasLiquidHeight(props, sectionConfig);\n // for `!props.liquid` - is WHOLE scrollgrid natural height?\n // TODO: do same thing in advanced scrollgrid? prolly not b/c always has horizontal scrollbars\n var overflowY = !props.liquid ? 'visible' :\n forceYScrollbars ? 'scroll' :\n !needsYScrolling ? 'hidden' :\n 'auto';\n var sectionKey = sectionConfig.key;\n var content = renderChunkContent(sectionConfig, chunkConfig, {\n tableColGroupNode: microColGroupNode,\n tableMinWidth: '',\n clientWidth: (!props.collapsibleWidth && scrollerClientWidths[sectionKey] !== undefined) ? scrollerClientWidths[sectionKey] : null,\n clientHeight: scrollerClientHeights[sectionKey] !== undefined ? scrollerClientHeights[sectionKey] : null,\n expandRows: sectionConfig.expandRows,\n syncRowHeights: false,\n rowSyncHeights: [],\n reportRowHeightChange: function () { },\n });\n return (createElement(\"td\", { ref: chunkConfig.elRef },\n createElement(\"div\", { className: \"fc-scroller-harness\" + (isLiquid ? ' fc-scroller-harness-liquid' : '') },\n createElement(Scroller, { ref: this.scrollerRefs.createRef(sectionKey), elRef: this.scrollerElRefs.createRef(sectionKey), overflowY: overflowY, overflowX: !props.liquid ? 'visible' : 'hidden' /* natural height? */, maxHeight: sectionConfig.maxHeight, liquid: isLiquid, liquidIsAbsolute // because its within a harness\n : true }, content))));\n };\n SimpleScrollGrid.prototype._handleScrollerEl = function (scrollerEl, key) {\n var section = getSectionByKey(this.props.sections, key);\n if (section) {\n setRef(section.chunk.scrollerElRef, scrollerEl);\n }\n };\n SimpleScrollGrid.prototype.componentDidMount = function () {\n this.handleSizing();\n this.context.addResizeHandler(this.handleSizing);\n };\n SimpleScrollGrid.prototype.componentDidUpdate = function () {\n // TODO: need better solution when state contains non-sizing things\n this.handleSizing();\n };\n SimpleScrollGrid.prototype.componentWillUnmount = function () {\n this.context.removeResizeHandler(this.handleSizing);\n };\n SimpleScrollGrid.prototype.computeShrinkWidth = function () {\n return hasShrinkWidth(this.props.cols)\n ? computeShrinkWidth(this.scrollerElRefs.getAll())\n : 0;\n };\n SimpleScrollGrid.prototype.computeScrollerDims = function () {\n var scrollbarWidth = getScrollbarWidths();\n var _a = this, scrollerRefs = _a.scrollerRefs, scrollerElRefs = _a.scrollerElRefs;\n var forceYScrollbars = false;\n var scrollerClientWidths = {};\n var scrollerClientHeights = {};\n for (var sectionKey in scrollerRefs.currentMap) {\n var scroller = scrollerRefs.currentMap[sectionKey];\n if (scroller && scroller.needsYScrolling()) {\n forceYScrollbars = true;\n break;\n }\n }\n for (var _i = 0, _b = this.props.sections; _i < _b.length; _i++) {\n var section = _b[_i];\n var sectionKey = section.key;\n var scrollerEl = scrollerElRefs.currentMap[sectionKey];\n if (scrollerEl) {\n var harnessEl = scrollerEl.parentNode; // TODO: weird way to get this. need harness b/c doesn't include table borders\n scrollerClientWidths[sectionKey] = Math.floor(harnessEl.getBoundingClientRect().width - (forceYScrollbars\n ? scrollbarWidth.y // use global because scroller might not have scrollbars yet but will need them in future\n : 0));\n scrollerClientHeights[sectionKey] = Math.floor(harnessEl.getBoundingClientRect().height);\n }\n }\n return { forceYScrollbars: forceYScrollbars, scrollerClientWidths: scrollerClientWidths, scrollerClientHeights: scrollerClientHeights };\n };\n return SimpleScrollGrid;\n}(BaseComponent));\nSimpleScrollGrid.addStateEquality({\n scrollerClientWidths: isPropsEqual,\n scrollerClientHeights: isPropsEqual,\n});\nfunction getSectionByKey(sections, key) {\n for (var _i = 0, sections_1 = sections; _i < sections_1.length; _i++) {\n var section = sections_1[_i];\n if (section.key === key) {\n return section;\n }\n }\n return null;\n}\n\nvar EventRoot = /** @class */ (function (_super) {\n __extends(EventRoot, _super);\n function EventRoot() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.elRef = createRef();\n return _this;\n }\n EventRoot.prototype.render = function () {\n var _a = this, props = _a.props, context = _a.context;\n var options = context.options;\n var seg = props.seg;\n var eventRange = seg.eventRange;\n var ui = eventRange.ui;\n var hookProps = {\n event: new EventApi(context, eventRange.def, eventRange.instance),\n view: context.viewApi,\n timeText: props.timeText,\n textColor: ui.textColor,\n backgroundColor: ui.backgroundColor,\n borderColor: ui.borderColor,\n isDraggable: !props.disableDragging && computeSegDraggable(seg, context),\n isStartResizable: !props.disableResizing && computeSegStartResizable(seg, context),\n isEndResizable: !props.disableResizing && computeSegEndResizable(seg),\n isMirror: Boolean(props.isDragging || props.isResizing || props.isDateSelecting),\n isStart: Boolean(seg.isStart),\n isEnd: Boolean(seg.isEnd),\n isPast: Boolean(props.isPast),\n isFuture: Boolean(props.isFuture),\n isToday: Boolean(props.isToday),\n isSelected: Boolean(props.isSelected),\n isDragging: Boolean(props.isDragging),\n isResizing: Boolean(props.isResizing),\n };\n var standardClassNames = getEventClassNames(hookProps).concat(ui.classNames);\n return (createElement(RenderHook, { hookProps: hookProps, classNames: options.eventClassNames, content: options.eventContent, defaultContent: props.defaultContent, didMount: options.eventDidMount, willUnmount: options.eventWillUnmount, elRef: this.elRef }, function (rootElRef, customClassNames, innerElRef, innerContent) { return props.children(rootElRef, standardClassNames.concat(customClassNames), innerElRef, innerContent, hookProps); }));\n };\n EventRoot.prototype.componentDidMount = function () {\n setElSeg(this.elRef.current, this.props.seg);\n };\n /*\n need to re-assign seg to the element if seg changes, even if the element is the same\n */\n EventRoot.prototype.componentDidUpdate = function (prevProps) {\n var seg = this.props.seg;\n if (seg !== prevProps.seg) {\n setElSeg(this.elRef.current, seg);\n }\n };\n return EventRoot;\n}(BaseComponent));\n\n// should not be a purecomponent\nvar StandardEvent = /** @class */ (function (_super) {\n __extends(StandardEvent, _super);\n function StandardEvent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n StandardEvent.prototype.render = function () {\n var _a = this, props = _a.props, context = _a.context;\n var seg = props.seg;\n var timeFormat = context.options.eventTimeFormat || props.defaultTimeFormat;\n var timeText = buildSegTimeText(seg, timeFormat, context, props.defaultDisplayEventTime, props.defaultDisplayEventEnd);\n return (createElement(EventRoot, { seg: seg, timeText: timeText, disableDragging: props.disableDragging, disableResizing: props.disableResizing, defaultContent: props.defaultContent || renderInnerContent$1, isDragging: props.isDragging, isResizing: props.isResizing, isDateSelecting: props.isDateSelecting, isSelected: props.isSelected, isPast: props.isPast, isFuture: props.isFuture, isToday: props.isToday }, function (rootElRef, classNames, innerElRef, innerContent, hookProps) { return (createElement(\"a\", __assign({ className: props.extraClassNames.concat(classNames).join(' '), style: {\n borderColor: hookProps.borderColor,\n backgroundColor: hookProps.backgroundColor,\n }, ref: rootElRef }, getSegAnchorAttrs(seg)),\n createElement(\"div\", { className: \"fc-event-main\", ref: innerElRef, style: { color: hookProps.textColor } }, innerContent),\n hookProps.isStartResizable &&\n createElement(\"div\", { className: \"fc-event-resizer fc-event-resizer-start\" }),\n hookProps.isEndResizable &&\n createElement(\"div\", { className: \"fc-event-resizer fc-event-resizer-end\" }))); }));\n };\n return StandardEvent;\n}(BaseComponent));\nfunction renderInnerContent$1(innerProps) {\n return (createElement(\"div\", { className: \"fc-event-main-frame\" },\n innerProps.timeText && (createElement(\"div\", { className: \"fc-event-time\" }, innerProps.timeText)),\n createElement(\"div\", { className: \"fc-event-title-container\" },\n createElement(\"div\", { className: \"fc-event-title fc-sticky\" }, innerProps.event.title || createElement(Fragment, null, \"\\u00A0\")))));\n}\nfunction getSegAnchorAttrs(seg) {\n var url = seg.eventRange.def.url;\n return url ? { href: url } : {};\n}\n\nvar NowIndicatorRoot = function (props) { return (createElement(ViewContextType.Consumer, null, function (context) {\n var options = context.options;\n var hookProps = {\n isAxis: props.isAxis,\n date: context.dateEnv.toDate(props.date),\n view: context.viewApi,\n };\n return (createElement(RenderHook, { hookProps: hookProps, classNames: options.nowIndicatorClassNames, content: options.nowIndicatorContent, didMount: options.nowIndicatorDidMount, willUnmount: options.nowIndicatorWillUnmount }, props.children));\n})); };\n\nvar DAY_NUM_FORMAT = createFormatter({ day: 'numeric' });\nvar DayCellContent = /** @class */ (function (_super) {\n __extends(DayCellContent, _super);\n function DayCellContent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DayCellContent.prototype.render = function () {\n var _a = this, props = _a.props, context = _a.context;\n var options = context.options;\n var hookProps = refineDayCellHookProps({\n date: props.date,\n dateProfile: props.dateProfile,\n todayRange: props.todayRange,\n showDayNumber: props.showDayNumber,\n extraProps: props.extraHookProps,\n viewApi: context.viewApi,\n dateEnv: context.dateEnv,\n });\n return (createElement(ContentHook, { hookProps: hookProps, content: options.dayCellContent, defaultContent: props.defaultContent }, props.children));\n };\n return DayCellContent;\n}(BaseComponent));\nfunction refineDayCellHookProps(raw) {\n var date = raw.date, dateEnv = raw.dateEnv;\n var dayMeta = getDateMeta(date, raw.todayRange, null, raw.dateProfile);\n return __assign(__assign(__assign({ date: dateEnv.toDate(date), view: raw.viewApi }, dayMeta), { dayNumberText: raw.showDayNumber ? dateEnv.format(date, DAY_NUM_FORMAT) : '' }), raw.extraProps);\n}\n\nvar DayCellRoot = /** @class */ (function (_super) {\n __extends(DayCellRoot, _super);\n function DayCellRoot() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.refineHookProps = memoizeObjArg(refineDayCellHookProps);\n _this.normalizeClassNames = buildClassNameNormalizer();\n return _this;\n }\n DayCellRoot.prototype.render = function () {\n var _a = this, props = _a.props, context = _a.context;\n var options = context.options;\n var hookProps = this.refineHookProps({\n date: props.date,\n dateProfile: props.dateProfile,\n todayRange: props.todayRange,\n showDayNumber: props.showDayNumber,\n extraProps: props.extraHookProps,\n viewApi: context.viewApi,\n dateEnv: context.dateEnv,\n });\n var classNames = getDayClassNames(hookProps, context.theme).concat(hookProps.isDisabled\n ? [] // don't use custom classNames if disabled\n : this.normalizeClassNames(options.dayCellClassNames, hookProps));\n var dataAttrs = hookProps.isDisabled ? {} : {\n 'data-date': formatDayString(props.date),\n };\n return (createElement(MountHook, { hookProps: hookProps, didMount: options.dayCellDidMount, willUnmount: options.dayCellWillUnmount, elRef: props.elRef }, function (rootElRef) { return props.children(rootElRef, classNames, dataAttrs, hookProps.isDisabled); }));\n };\n return DayCellRoot;\n}(BaseComponent));\n\nfunction renderFill(fillType) {\n return (createElement(\"div\", { className: \"fc-\" + fillType }));\n}\nvar BgEvent = function (props) { return (createElement(EventRoot, { defaultContent: renderInnerContent, seg: props.seg /* uselesss i think */, timeText: \"\", disableDragging: true, disableResizing: true, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: false, isPast: props.isPast, isFuture: props.isFuture, isToday: props.isToday }, function (rootElRef, classNames, innerElRef, innerContent, hookProps) { return (createElement(\"div\", { ref: rootElRef, className: ['fc-bg-event'].concat(classNames).join(' '), style: {\n backgroundColor: hookProps.backgroundColor,\n } }, innerContent)); })); };\nfunction renderInnerContent(props) {\n var title = props.event.title;\n return title && (createElement(\"div\", { className: \"fc-event-title\" }, props.event.title));\n}\n\nvar WeekNumberRoot = function (props) { return (createElement(ViewContextType.Consumer, null, function (context) {\n var dateEnv = context.dateEnv, options = context.options;\n var date = props.date;\n var format = options.weekNumberFormat || props.defaultFormat;\n var num = dateEnv.computeWeekNumber(date); // TODO: somehow use for formatting as well?\n var text = dateEnv.format(date, format);\n var hookProps = { num: num, text: text, date: date };\n return (createElement(RenderHook, { hookProps: hookProps, classNames: options.weekNumberClassNames, content: options.weekNumberContent, defaultContent: renderInner, didMount: options.weekNumberDidMount, willUnmount: options.weekNumberWillUnmount }, props.children));\n})); };\nfunction renderInner(innerProps) {\n return innerProps.text;\n}\n\nvar PADDING_FROM_VIEWPORT = 10;\nvar Popover = /** @class */ (function (_super) {\n __extends(Popover, _super);\n function Popover() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.handleRootEl = function (el) {\n _this.rootEl = el;\n if (_this.props.elRef) {\n setRef(_this.props.elRef, el);\n }\n };\n // Triggered when the user clicks *anywhere* in the document, for the autoHide feature\n _this.handleDocumentMousedown = function (ev) {\n // only hide the popover if the click happened outside the popover\n var target = getEventTargetViaRoot(ev);\n if (!_this.rootEl.contains(target)) {\n _this.handleCloseClick();\n }\n };\n _this.handleCloseClick = function () {\n var onClose = _this.props.onClose;\n if (onClose) {\n onClose();\n }\n };\n return _this;\n }\n Popover.prototype.render = function () {\n var theme = this.context.theme;\n var props = this.props;\n var classNames = [\n 'fc-popover',\n theme.getClass('popover'),\n ].concat(props.extraClassNames || []);\n return createPortal(createElement(\"div\", __assign({ className: classNames.join(' ') }, props.extraAttrs, { ref: this.handleRootEl }),\n createElement(\"div\", { className: 'fc-popover-header ' + theme.getClass('popoverHeader') },\n createElement(\"span\", { className: \"fc-popover-title\" }, props.title),\n createElement(\"span\", { className: 'fc-popover-close ' + theme.getIconClass('close'), onClick: this.handleCloseClick })),\n createElement(\"div\", { className: 'fc-popover-body ' + theme.getClass('popoverContent') }, props.children)), props.parentEl);\n };\n Popover.prototype.componentDidMount = function () {\n document.addEventListener('mousedown', this.handleDocumentMousedown);\n this.updateSize();\n };\n Popover.prototype.componentWillUnmount = function () {\n document.removeEventListener('mousedown', this.handleDocumentMousedown);\n };\n Popover.prototype.updateSize = function () {\n var isRtl = this.context.isRtl;\n var _a = this.props, alignmentEl = _a.alignmentEl, alignGridTop = _a.alignGridTop;\n var rootEl = this.rootEl;\n var alignmentRect = computeClippedClientRect(alignmentEl);\n if (alignmentRect) {\n var popoverDims = rootEl.getBoundingClientRect();\n // position relative to viewport\n var popoverTop = alignGridTop\n ? elementClosest(alignmentEl, '.fc-scrollgrid').getBoundingClientRect().top\n : alignmentRect.top;\n var popoverLeft = isRtl ? alignmentRect.right - popoverDims.width : alignmentRect.left;\n // constrain\n popoverTop = Math.max(popoverTop, PADDING_FROM_VIEWPORT);\n popoverLeft = Math.min(popoverLeft, document.documentElement.clientWidth - PADDING_FROM_VIEWPORT - popoverDims.width);\n popoverLeft = Math.max(popoverLeft, PADDING_FROM_VIEWPORT);\n var origin_1 = rootEl.offsetParent.getBoundingClientRect();\n applyStyle(rootEl, {\n top: popoverTop - origin_1.top,\n left: popoverLeft - origin_1.left,\n });\n }\n };\n return Popover;\n}(BaseComponent));\n\nvar MorePopover = /** @class */ (function (_super) {\n __extends(MorePopover, _super);\n function MorePopover() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.handleRootEl = function (rootEl) {\n _this.rootEl = rootEl;\n if (rootEl) {\n _this.context.registerInteractiveComponent(_this, {\n el: rootEl,\n useEventCenter: false,\n });\n }\n else {\n _this.context.unregisterInteractiveComponent(_this);\n }\n };\n return _this;\n }\n MorePopover.prototype.render = function () {\n var _a = this.context, options = _a.options, dateEnv = _a.dateEnv;\n var props = this.props;\n var startDate = props.startDate, todayRange = props.todayRange, dateProfile = props.dateProfile;\n var title = dateEnv.format(startDate, options.dayPopoverFormat);\n return (createElement(DayCellRoot, { date: startDate, dateProfile: dateProfile, todayRange: todayRange, elRef: this.handleRootEl }, function (rootElRef, dayClassNames, dataAttrs) { return (createElement(Popover, { elRef: rootElRef, title: title, extraClassNames: ['fc-more-popover'].concat(dayClassNames), extraAttrs: dataAttrs /* TODO: make these time-based when not whole-day? */, parentEl: props.parentEl, alignmentEl: props.alignmentEl, alignGridTop: props.alignGridTop, onClose: props.onClose },\n createElement(DayCellContent, { date: startDate, dateProfile: dateProfile, todayRange: todayRange }, function (innerElRef, innerContent) { return (innerContent &&\n createElement(\"div\", { className: \"fc-more-popover-misc\", ref: innerElRef }, innerContent)); }),\n props.children)); }));\n };\n MorePopover.prototype.queryHit = function (positionLeft, positionTop, elWidth, elHeight) {\n var _a = this, rootEl = _a.rootEl, props = _a.props;\n if (positionLeft >= 0 && positionLeft < elWidth &&\n positionTop >= 0 && positionTop < elHeight) {\n return {\n dateProfile: props.dateProfile,\n dateSpan: __assign({ allDay: true, range: {\n start: props.startDate,\n end: props.endDate,\n } }, props.extraDateSpan),\n dayEl: rootEl,\n rect: {\n left: 0,\n top: 0,\n right: elWidth,\n bottom: elHeight,\n },\n layer: 1, // important when comparing with hits from other components\n };\n }\n return null;\n };\n return MorePopover;\n}(DateComponent));\n\nvar MoreLinkRoot = /** @class */ (function (_super) {\n __extends(MoreLinkRoot, _super);\n function MoreLinkRoot() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.linkElRef = createRef();\n _this.state = {\n isPopoverOpen: false,\n };\n _this.handleClick = function (ev) {\n var _a = _this, props = _a.props, context = _a.context;\n var moreLinkClick = context.options.moreLinkClick;\n var date = computeRange(props).start;\n function buildPublicSeg(seg) {\n var _a = seg.eventRange, def = _a.def, instance = _a.instance, range = _a.range;\n return {\n event: new EventApi(context, def, instance),\n start: context.dateEnv.toDate(range.start),\n end: context.dateEnv.toDate(range.end),\n isStart: seg.isStart,\n isEnd: seg.isEnd,\n };\n }\n if (typeof moreLinkClick === 'function') {\n moreLinkClick = moreLinkClick({\n date: date,\n allDay: Boolean(props.allDayDate),\n allSegs: props.allSegs.map(buildPublicSeg),\n hiddenSegs: props.hiddenSegs.map(buildPublicSeg),\n jsEvent: ev,\n view: context.viewApi,\n });\n }\n if (!moreLinkClick || moreLinkClick === 'popover') {\n _this.setState({ isPopoverOpen: true });\n }\n else if (typeof moreLinkClick === 'string') { // a view name\n context.calendarApi.zoomTo(date, moreLinkClick);\n }\n };\n _this.handlePopoverClose = function () {\n _this.setState({ isPopoverOpen: false });\n };\n return _this;\n }\n MoreLinkRoot.prototype.render = function () {\n var _this = this;\n var props = this.props;\n return (createElement(ViewContextType.Consumer, null, function (context) {\n var viewApi = context.viewApi, options = context.options, calendarApi = context.calendarApi;\n var moreLinkText = options.moreLinkText;\n var moreCnt = props.moreCnt;\n var range = computeRange(props);\n var hookProps = {\n num: moreCnt,\n shortText: \"+\" + moreCnt,\n text: typeof moreLinkText === 'function'\n ? moreLinkText.call(calendarApi, moreCnt)\n : \"+\" + moreCnt + \" \" + moreLinkText,\n view: viewApi,\n };\n return (createElement(Fragment, null,\n Boolean(props.moreCnt) && (createElement(RenderHook, { elRef: _this.linkElRef, hookProps: hookProps, classNames: options.moreLinkClassNames, content: options.moreLinkContent, defaultContent: props.defaultContent || renderMoreLinkInner, didMount: options.moreLinkDidMount, willUnmount: options.moreLinkWillUnmount }, function (rootElRef, customClassNames, innerElRef, innerContent) { return props.children(rootElRef, ['fc-more-link'].concat(customClassNames), innerElRef, innerContent, _this.handleClick); })),\n _this.state.isPopoverOpen && (createElement(MorePopover, { startDate: range.start, endDate: range.end, dateProfile: props.dateProfile, todayRange: props.todayRange, extraDateSpan: props.extraDateSpan, parentEl: _this.parentEl, alignmentEl: props.alignmentElRef.current, alignGridTop: props.alignGridTop, onClose: _this.handlePopoverClose }, props.popoverContent()))));\n }));\n };\n MoreLinkRoot.prototype.componentDidMount = function () {\n this.updateParentEl();\n };\n MoreLinkRoot.prototype.componentDidUpdate = function () {\n this.updateParentEl();\n };\n MoreLinkRoot.prototype.updateParentEl = function () {\n if (this.linkElRef.current) {\n this.parentEl = elementClosest(this.linkElRef.current, '.fc-view-harness');\n }\n };\n return MoreLinkRoot;\n}(BaseComponent));\nfunction renderMoreLinkInner(props) {\n return props.text;\n}\nfunction computeRange(props) {\n if (props.allDayDate) {\n return {\n start: props.allDayDate,\n end: addDays(props.allDayDate, 1),\n };\n }\n var hiddenSegs = props.hiddenSegs;\n return {\n start: computeEarliestSegStart(hiddenSegs),\n end: computeLatestSegEnd(hiddenSegs),\n };\n}\nfunction computeEarliestSegStart(segs) {\n return segs.reduce(pickEarliestStart).eventRange.range.start;\n}\nfunction pickEarliestStart(seg0, seg1) {\n return seg0.eventRange.range.start < seg1.eventRange.range.start ? seg0 : seg1;\n}\nfunction computeLatestSegEnd(segs) {\n return segs.reduce(pickLatestEnd).eventRange.range.end;\n}\nfunction pickLatestEnd(seg0, seg1) {\n return seg0.eventRange.range.end > seg1.eventRange.range.end ? seg0 : seg1;\n}\n\n// exports\n// --------------------------------------------------------------------------------------------------\nvar version = '5.9.0'; // important to type it, so .d.ts has generic string\n\nexport { BASE_OPTION_DEFAULTS, BASE_OPTION_REFINERS, BaseComponent, BgEvent, CalendarApi, CalendarContent, CalendarDataManager, CalendarDataProvider, CalendarRoot, ContentHook, CustomContentRenderContext, DateComponent, DateEnv, DateProfileGenerator, DayCellContent, DayCellRoot, DayHeader, DaySeriesModel, DayTableModel, DelayedRunner, ElementDragging, ElementScrollController, Emitter, EventApi, EventRoot, EventSourceApi, Interaction, MoreLinkRoot, MountHook, NamedTimeZoneImpl, NowIndicatorRoot, NowTimer, PositionCache, RefMap, RenderHook, ScrollController, ScrollResponder, Scroller, SegHierarchy, SimpleScrollGrid, Slicer, Splitter, StandardEvent, TableDateCell, TableDowCell, Theme, ViewApi, ViewContextType, ViewRoot, WeekNumberRoot, WindowScrollController, addDays, addDurations, addMs, addWeeks, allowContextMenu, allowSelection, applyMutationToEventStore, applyStyle, applyStyleProp, asCleanDays, asRoughMinutes, asRoughMs, asRoughSeconds, binarySearch, buildClassNameNormalizer, buildEntryKey, buildEventApis, buildEventRangeKey, buildHashFromArray, buildIsoString, buildNavLinkData, buildSegCompareObj, buildSegTimeText, collectFromHash, combineEventUis, compareByFieldSpec, compareByFieldSpecs, compareNumbers, compareObjs, computeEarliestSegStart, computeEdges, computeFallbackHeaderFormat, computeHeightAndMargins, computeInnerRect, computeRect, computeSegDraggable, computeSegEndResizable, computeSegStartResizable, computeShrinkWidth, computeSmallestCellWidth, computeVisibleDayRange, config, constrainPoint, createDuration, createEmptyEventStore, createEventInstance, createEventUi, createFormatter, createPlugin, diffDates, diffDayAndTime, diffDays, diffPoints, diffWeeks, diffWholeDays, diffWholeWeeks, disableCursor, elementClosest, elementMatches, enableCursor, eventTupleToStore, filterEventStoreDefs, filterHash, findDirectChildren, findElements, flexibleCompare, formatDate, formatDayString, formatIsoTimeString, formatRange, getAllowYScrolling, getCanVGrowWithinCell, getClippingParents, getDateMeta, getDayClassNames, getDefaultEventEnd, getElRoot, getElSeg, getEntrySpanEnd, getEventClassNames, getEventTargetViaRoot, getIsRtlScrollbarOnLeft, getRectCenter, getRelevantEvents, getScrollGridClassNames, getScrollbarWidths, getSectionClassNames, getSectionHasLiquidHeight, getSegMeta, getSlotClassNames, getStickyFooterScrollbar, getStickyHeaderDates, getUnequalProps, globalLocales, globalPlugins, greatestDurationDenominator, groupIntersectingEntries, guid, hasBgRendering, hasShrinkWidth, identity, interactionSettingsStore, interactionSettingsToStore, intersectRanges, intersectRects, intersectSpans, isArraysEqual, isColPropsEqual, isDateSelectionValid, isDateSpansEqual, isInt, isInteractionValid, isMultiDayRange, isPropsEqual, isPropsValid, isValidDate, joinSpans, listenBySelector, mapHash, memoize, memoizeArraylike, memoizeHashlike, memoizeObjArg, mergeEventStores, multiplyDuration, padStart, parseBusinessHours, parseClassNames, parseDragMeta, parseEventDef, parseFieldSpecs, parse as parseMarker, pointInsideRect, preventContextMenu, preventDefault, preventSelection, rangeContainsMarker, rangeContainsRange, rangesEqual, rangesIntersect, refineEventDef, refineProps, removeElement, removeExact, renderChunkContent, renderFill, renderMicroColGroup, renderScrollShim, requestJson, sanitizeShrinkWidth, setElSeg, setRef, sliceEventStore, sliceEvents, sortEventSegs, startOfDay, translateRect, triggerDateSelect, unpromisify, version, whenTransitionDone, wholeDivideDurations };\n//# sourceMappingURL=main.js.map\n","/*!\nFullCalendar v5.9.0\nDocs & License: https://fullcalendar.io/\n(c) 2021 Adam Shaw\n*/\nimport './vdom.js';\nimport { __extends, __assign } from 'tslib';\nimport { render, createElement, CalendarRoot, CustomContentRenderContext, CalendarContent, unmountComponentAtNode, flushToDom, DelayedRunner, CalendarDataManager, isArraysEqual, applyStyleProp, CalendarApi } from '@fullcalendar/common';\nexport * from '@fullcalendar/common';\n\nvar Calendar = /** @class */ (function (_super) {\n __extends(Calendar, _super);\n function Calendar(el, optionOverrides) {\n if (optionOverrides === void 0) { optionOverrides = {}; }\n var _this = _super.call(this) || this;\n _this.isRendering = false;\n _this.isRendered = false;\n _this.currentClassNames = [];\n _this.customContentRenderId = 0; // will affect custom generated classNames?\n _this.handleAction = function (action) {\n // actions we know we want to render immediately\n switch (action.type) {\n case 'SET_EVENT_DRAG':\n case 'SET_EVENT_RESIZE':\n _this.renderRunner.tryDrain();\n }\n };\n _this.handleData = function (data) {\n _this.currentData = data;\n _this.renderRunner.request(data.calendarOptions.rerenderDelay);\n };\n _this.handleRenderRequest = function () {\n if (_this.isRendering) {\n _this.isRendered = true;\n var currentData_1 = _this.currentData;\n render(createElement(CalendarRoot, { options: currentData_1.calendarOptions, theme: currentData_1.theme, emitter: currentData_1.emitter }, function (classNames, height, isHeightAuto, forPrint) {\n _this.setClassNames(classNames);\n _this.setHeight(height);\n return (createElement(CustomContentRenderContext.Provider, { value: _this.customContentRenderId },\n createElement(CalendarContent, __assign({ isHeightAuto: isHeightAuto, forPrint: forPrint }, currentData_1))));\n }), _this.el);\n }\n else if (_this.isRendered) {\n _this.isRendered = false;\n unmountComponentAtNode(_this.el);\n _this.setClassNames([]);\n _this.setHeight('');\n }\n flushToDom();\n };\n _this.el = el;\n _this.renderRunner = new DelayedRunner(_this.handleRenderRequest);\n new CalendarDataManager({\n optionOverrides: optionOverrides,\n calendarApi: _this,\n onAction: _this.handleAction,\n onData: _this.handleData,\n });\n return _this;\n }\n Object.defineProperty(Calendar.prototype, \"view\", {\n get: function () { return this.currentData.viewApi; } // for public API\n ,\n enumerable: false,\n configurable: true\n });\n Calendar.prototype.render = function () {\n var wasRendering = this.isRendering;\n if (!wasRendering) {\n this.isRendering = true;\n }\n else {\n this.customContentRenderId += 1;\n }\n this.renderRunner.request();\n if (wasRendering) {\n this.updateSize();\n }\n };\n Calendar.prototype.destroy = function () {\n if (this.isRendering) {\n this.isRendering = false;\n this.renderRunner.request();\n }\n };\n Calendar.prototype.updateSize = function () {\n _super.prototype.updateSize.call(this);\n flushToDom();\n };\n Calendar.prototype.batchRendering = function (func) {\n this.renderRunner.pause('batchRendering');\n func();\n this.renderRunner.resume('batchRendering');\n };\n Calendar.prototype.pauseRendering = function () {\n this.renderRunner.pause('pauseRendering');\n };\n Calendar.prototype.resumeRendering = function () {\n this.renderRunner.resume('pauseRendering', true);\n };\n Calendar.prototype.resetOptions = function (optionOverrides, append) {\n this.currentDataManager.resetOptions(optionOverrides, append);\n };\n Calendar.prototype.setClassNames = function (classNames) {\n if (!isArraysEqual(classNames, this.currentClassNames)) {\n var classList = this.el.classList;\n for (var _i = 0, _a = this.currentClassNames; _i < _a.length; _i++) {\n var className = _a[_i];\n classList.remove(className);\n }\n for (var _b = 0, classNames_1 = classNames; _b < classNames_1.length; _b++) {\n var className = classNames_1[_b];\n classList.add(className);\n }\n this.currentClassNames = classNames;\n }\n };\n Calendar.prototype.setHeight = function (height) {\n applyStyleProp(this.el, 'height', height);\n };\n return Calendar;\n}(CalendarApi));\n\nexport { Calendar };\n//# sourceMappingURL=main.js.map\n","export const OPTION_IS_COMPLEX = {\n headerToolbar: true,\n footerToolbar: true,\n events: true,\n eventSources: true,\n resources: true\n};\n//# sourceMappingURL=options.js.map","// TODO: add types!\n/*\nworks with objects and arrays\n*/\nexport function shallowCopy(val) {\n if (typeof val === 'object') {\n if (Array.isArray(val)) {\n val = Array.prototype.slice.call(val);\n }\n else if (val) { // non-null\n val = { ...val };\n }\n }\n return val;\n}\nexport function mapHash(input, func) {\n const output = {};\n for (const key in input) {\n if (input.hasOwnProperty(key)) {\n output[key] = func(input[key], key);\n }\n }\n return output;\n}\n//# sourceMappingURL=utils.js.map","import { createApp, h } from 'vue';\nimport { createPlugin } from '@fullcalendar/core';\n/*\nwrap it in an object with a `vue` key, which the custom content-type handler system will look for\n*/\nexport function wrapVDomGenerator(vDomGenerator) {\n return function (props) {\n return { vue: vDomGenerator(props) };\n };\n}\nexport function createVueContentTypePlugin(appContext) {\n return createPlugin({\n contentTypeHandlers: {\n vue: () => buildVDomHandler(appContext), // looks for the `vue` key\n }\n });\n}\nfunction buildVDomHandler(appContext) {\n let currentEl;\n let app;\n let componentInstance;\n function render(el, vDomContent) {\n if (currentEl !== el) {\n if (currentEl && app) { // if changing elements, recreate the vue\n app.unmount();\n }\n currentEl = el;\n }\n if (!app) {\n app = initApp(vDomContent, appContext);\n // vue's mount method *replaces* the given element. create an artificial inner el\n let innerEl = document.createElement('span');\n el.appendChild(innerEl);\n componentInstance = app.mount(innerEl);\n }\n else {\n componentInstance.content = vDomContent;\n }\n }\n function destroy() {\n if (app) { // needed?\n app.unmount();\n }\n }\n return { render, destroy };\n}\nfunction initApp(initialContent, appContext) {\n // TODO: do something with appContext\n return createApp({\n data() {\n return {\n content: initialContent,\n };\n },\n render() {\n let { content } = this;\n // the slot result can be an array, but the returned value of a vue component's\n // render method must be a single node.\n if (content.length === 1) {\n return content[0];\n }\n else {\n return h('span', {}, content);\n }\n }\n });\n}\n//# sourceMappingURL=custom-content-type.js.map","import { defineComponent, h } from 'vue';\nimport { Calendar } from '@fullcalendar/core';\nimport { OPTION_IS_COMPLEX } from './options';\nimport { shallowCopy, mapHash } from './utils';\nimport { wrapVDomGenerator, createVueContentTypePlugin } from './custom-content-type';\nconst FullCalendar = defineComponent({\n props: {\n options: Object\n },\n data: initData,\n render() {\n return h('div', {\n // when renderId is changed, Vue will trigger a real-DOM async rerender, calling beforeUpdate/updated\n attrs: { 'data-fc-render-id': this.renderId }\n });\n },\n mounted() {\n let internal = this.$options;\n internal.slotOptions = mapHash(this.$slots, wrapVDomGenerator); // needed for buildOptions\n let calendarOptions = this.buildOptions(this.options, this.$.appContext);\n let calendar = new Calendar(this.$el, calendarOptions);\n internal.calendar = calendar;\n calendar.render();\n },\n methods: {\n getApi,\n buildOptions,\n },\n beforeUpdate() {\n this.getApi().resumeRendering(); // the watcher handlers paused it\n },\n beforeUnmount() {\n this.getApi().destroy();\n },\n watch: buildWatchers()\n});\nexport default FullCalendar;\nfunction initData() {\n return {\n renderId: 0\n };\n}\nfunction buildOptions(suppliedOptions, appContext) {\n let internal = this.$options;\n suppliedOptions = suppliedOptions || {};\n return {\n ...internal.slotOptions,\n ...suppliedOptions,\n plugins: (suppliedOptions.plugins || []).concat([\n createVueContentTypePlugin(appContext)\n ])\n };\n}\nfunction getApi() {\n let internal = this.$options;\n return internal.calendar;\n}\nfunction buildWatchers() {\n let watchers = {\n // watches changes of ALL options and their nested objects,\n // but this is only a means to be notified of top-level non-complex options changes.\n options: {\n deep: true,\n handler(options) {\n let calendar = this.getApi();\n calendar.pauseRendering();\n let calendarOptions = this.buildOptions(options, this.$.appContext);\n calendar.resetOptions(calendarOptions);\n this.renderId++; // will queue a rerender\n }\n }\n };\n for (let complexOptionName in OPTION_IS_COMPLEX) {\n // handlers called when nested objects change\n watchers[`options.${complexOptionName}`] = {\n deep: true,\n handler(val) {\n // unfortunately the handler is called with undefined if new props were set, but the complex one wasn't ever set\n if (val !== undefined) {\n let calendar = this.getApi();\n calendar.pauseRendering();\n calendar.resetOptions({\n // the only reason we shallow-copy is to trick FC into knowing there's a nested change.\n // TODO: future versions of FC will more gracefully handle event option-changes that are same-reference.\n [complexOptionName]: shallowCopy(val)\n }, true);\n this.renderId++; // will queue a rerender\n }\n }\n };\n }\n return watchers;\n}\n//# sourceMappingURL=FullCalendar.js.map","import FullCalendarComponent from './FullCalendar';\nexport default FullCalendarComponent;\n// so can access any of the utils/types from this lib\nexport * from '@fullcalendar/core';\n//# sourceMappingURL=main.js.map","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar 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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\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\nexport 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}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","/*!\nFullCalendar v5.9.0\nDocs & License: https://fullcalendar.io/\n(c) 2021 Adam Shaw\n*/\nimport './main.css';\n\nimport { createRef, getStickyHeaderDates, createElement, ViewRoot, SimpleScrollGrid, getStickyFooterScrollbar, renderScrollShim, DateComponent, buildNavLinkData, DayCellContent, Fragment, BaseComponent, createFormatter, StandardEvent, buildSegTimeText, EventRoot, memoize, MoreLinkRoot, getSegMeta, setRef, DayCellRoot, WeekNumberRoot, buildEntryKey, intersectSpans, SegHierarchy, intersectRanges, addDays, RefMap, sortEventSegs, isPropsEqual, buildEventRangeKey, BgEvent, renderFill, PositionCache, NowTimer, Slicer, DayHeader, DaySeriesModel, DayTableModel, addWeeks, diffWeeks, DateProfileGenerator, createPlugin } from '@fullcalendar/common';\nimport { __extends, __assign, __spreadArray } from 'tslib';\n\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 Table subcomponent, which does most of the heavy lifting.\n// It is responsible for managing width/height.\nvar TableView = /** @class */ (function (_super) {\n __extends(TableView, _super);\n function TableView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.headerElRef = createRef();\n return _this;\n }\n TableView.prototype.renderSimpleLayout = function (headerRowContent, bodyContent) {\n var _a = this, props = _a.props, context = _a.context;\n var sections = [];\n var stickyHeaderDates = getStickyHeaderDates(context.options);\n if (headerRowContent) {\n sections.push({\n type: 'header',\n key: 'header',\n isSticky: stickyHeaderDates,\n chunk: {\n elRef: this.headerElRef,\n tableClassName: 'fc-col-header',\n rowContent: headerRowContent,\n },\n });\n }\n sections.push({\n type: 'body',\n key: 'body',\n liquid: true,\n chunk: { content: bodyContent },\n });\n return (createElement(ViewRoot, { viewSpec: context.viewSpec }, function (rootElRef, classNames) { return (createElement(\"div\", { ref: rootElRef, className: ['fc-daygrid'].concat(classNames).join(' ') },\n createElement(SimpleScrollGrid, { liquid: !props.isHeightAuto && !props.forPrint, collapsibleWidth: props.forPrint, cols: [] /* TODO: make optional? */, sections: sections }))); }));\n };\n TableView.prototype.renderHScrollLayout = function (headerRowContent, bodyContent, colCnt, dayMinWidth) {\n var ScrollGrid = this.context.pluginHooks.scrollGridImpl;\n if (!ScrollGrid) {\n throw new Error('No ScrollGrid implementation');\n }\n var _a = this, props = _a.props, context = _a.context;\n var stickyHeaderDates = !props.forPrint && getStickyHeaderDates(context.options);\n var stickyFooterScrollbar = !props.forPrint && getStickyFooterScrollbar(context.options);\n var sections = [];\n if (headerRowContent) {\n sections.push({\n type: 'header',\n key: 'header',\n isSticky: stickyHeaderDates,\n chunks: [{\n key: 'main',\n elRef: this.headerElRef,\n tableClassName: 'fc-col-header',\n rowContent: headerRowContent,\n }],\n });\n }\n sections.push({\n type: 'body',\n key: 'body',\n liquid: true,\n chunks: [{\n key: 'main',\n content: bodyContent,\n }],\n });\n if (stickyFooterScrollbar) {\n sections.push({\n type: 'footer',\n key: 'footer',\n isSticky: true,\n chunks: [{\n key: 'main',\n content: renderScrollShim,\n }],\n });\n }\n return (createElement(ViewRoot, { viewSpec: context.viewSpec }, function (rootElRef, classNames) { return (createElement(\"div\", { ref: rootElRef, className: ['fc-daygrid'].concat(classNames).join(' ') },\n createElement(ScrollGrid, { liquid: !props.isHeightAuto && !props.forPrint, collapsibleWidth: props.forPrint, colGroups: [{ cols: [{ span: colCnt, minWidth: dayMinWidth }] }], sections: sections }))); }));\n };\n return TableView;\n}(DateComponent));\n\nfunction splitSegsByRow(segs, rowCnt) {\n var byRow = [];\n for (var i = 0; i < rowCnt; i += 1) {\n byRow[i] = [];\n }\n for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {\n var seg = segs_1[_i];\n byRow[seg.row].push(seg);\n }\n return byRow;\n}\nfunction splitSegsByFirstCol(segs, colCnt) {\n var byCol = [];\n for (var i = 0; i < colCnt; i += 1) {\n byCol[i] = [];\n }\n for (var _i = 0, segs_2 = segs; _i < segs_2.length; _i++) {\n var seg = segs_2[_i];\n byCol[seg.firstCol].push(seg);\n }\n return byCol;\n}\nfunction splitInteractionByRow(ui, rowCnt) {\n var byRow = [];\n if (!ui) {\n for (var i = 0; i < rowCnt; i += 1) {\n byRow[i] = null;\n }\n }\n else {\n for (var i = 0; i < rowCnt; i += 1) {\n byRow[i] = {\n affectedInstances: ui.affectedInstances,\n isEvent: ui.isEvent,\n segs: [],\n };\n }\n for (var _i = 0, _a = ui.segs; _i < _a.length; _i++) {\n var seg = _a[_i];\n byRow[seg.row].segs.push(seg);\n }\n }\n return byRow;\n}\n\nvar TableCellTop = /** @class */ (function (_super) {\n __extends(TableCellTop, _super);\n function TableCellTop() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TableCellTop.prototype.render = function () {\n var props = this.props;\n var navLinkAttrs = this.context.options.navLinks\n ? { 'data-navlink': buildNavLinkData(props.date), tabIndex: 0 }\n : {};\n return (createElement(DayCellContent, { date: props.date, dateProfile: props.dateProfile, todayRange: props.todayRange, showDayNumber: props.showDayNumber, extraHookProps: props.extraHookProps, defaultContent: renderTopInner }, function (innerElRef, innerContent) { return ((innerContent || props.forceDayTop) && (createElement(\"div\", { className: \"fc-daygrid-day-top\", ref: innerElRef },\n createElement(\"a\", __assign({ className: \"fc-daygrid-day-number\" }, navLinkAttrs), innerContent || createElement(Fragment, null, \"\\u00A0\"))))); }));\n };\n return TableCellTop;\n}(BaseComponent));\nfunction renderTopInner(props) {\n return props.dayNumberText;\n}\n\nvar DEFAULT_TABLE_EVENT_TIME_FORMAT = createFormatter({\n hour: 'numeric',\n minute: '2-digit',\n omitZeroMinute: true,\n meridiem: 'narrow',\n});\nfunction hasListItemDisplay(seg) {\n var display = seg.eventRange.ui.display;\n return display === 'list-item' || (display === 'auto' &&\n !seg.eventRange.def.allDay &&\n seg.firstCol === seg.lastCol && // can't be multi-day\n seg.isStart && // \"\n seg.isEnd // \"\n );\n}\n\nvar TableBlockEvent = /** @class */ (function (_super) {\n __extends(TableBlockEvent, _super);\n function TableBlockEvent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TableBlockEvent.prototype.render = function () {\n var props = this.props;\n return (createElement(StandardEvent, __assign({}, props, { extraClassNames: ['fc-daygrid-event', 'fc-daygrid-block-event', 'fc-h-event'], defaultTimeFormat: DEFAULT_TABLE_EVENT_TIME_FORMAT, defaultDisplayEventEnd: props.defaultDisplayEventEnd, disableResizing: !props.seg.eventRange.def.allDay })));\n };\n return TableBlockEvent;\n}(BaseComponent));\n\nvar TableListItemEvent = /** @class */ (function (_super) {\n __extends(TableListItemEvent, _super);\n function TableListItemEvent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TableListItemEvent.prototype.render = function () {\n var _a = this, props = _a.props, context = _a.context;\n var timeFormat = context.options.eventTimeFormat || DEFAULT_TABLE_EVENT_TIME_FORMAT;\n var timeText = buildSegTimeText(props.seg, timeFormat, context, true, props.defaultDisplayEventEnd);\n return (createElement(EventRoot, { seg: props.seg, timeText: timeText, defaultContent: renderInnerContent, isDragging: props.isDragging, isResizing: false, isDateSelecting: false, isSelected: props.isSelected, isPast: props.isPast, isFuture: props.isFuture, isToday: props.isToday }, function (rootElRef, classNames, innerElRef, innerContent) { return ( // we don't use styles!\n createElement(\"a\", __assign({ className: ['fc-daygrid-event', 'fc-daygrid-dot-event'].concat(classNames).join(' '), ref: rootElRef }, getSegAnchorAttrs(props.seg)), innerContent)); }));\n };\n return TableListItemEvent;\n}(BaseComponent));\nfunction renderInnerContent(innerProps) {\n return (createElement(Fragment, null,\n createElement(\"div\", { className: \"fc-daygrid-event-dot\", style: { borderColor: innerProps.borderColor || innerProps.backgroundColor } }),\n innerProps.timeText && (createElement(\"div\", { className: \"fc-event-time\" }, innerProps.timeText)),\n createElement(\"div\", { className: \"fc-event-title\" }, innerProps.event.title || createElement(Fragment, null, \"\\u00A0\"))));\n}\nfunction getSegAnchorAttrs(seg) {\n var url = seg.eventRange.def.url;\n return url ? { href: url } : {};\n}\n\nvar TableCellMoreLink = /** @class */ (function (_super) {\n __extends(TableCellMoreLink, _super);\n function TableCellMoreLink() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.compileSegs = memoize(compileSegs);\n return _this;\n }\n TableCellMoreLink.prototype.render = function () {\n var props = this.props;\n var _a = this.compileSegs(props.singlePlacements), allSegs = _a.allSegs, invisibleSegs = _a.invisibleSegs;\n return (createElement(MoreLinkRoot, { dateProfile: props.dateProfile, todayRange: props.todayRange, allDayDate: props.allDayDate, moreCnt: props.moreCnt, allSegs: allSegs, hiddenSegs: invisibleSegs, alignmentElRef: props.alignmentElRef, alignGridTop: props.alignGridTop, extraDateSpan: props.extraDateSpan, popoverContent: function () {\n var isForcedInvisible = (props.eventDrag ? props.eventDrag.affectedInstances : null) ||\n (props.eventResize ? props.eventResize.affectedInstances : null) ||\n {};\n return (createElement(Fragment, null, allSegs.map(function (seg) {\n var instanceId = seg.eventRange.instance.instanceId;\n return (createElement(\"div\", { className: \"fc-daygrid-event-harness\", key: instanceId, style: {\n visibility: isForcedInvisible[instanceId] ? 'hidden' : '',\n } }, hasListItemDisplay(seg) ? (createElement(TableListItemEvent, __assign({ seg: seg, isDragging: false, isSelected: instanceId === props.eventSelection, defaultDisplayEventEnd: false }, getSegMeta(seg, props.todayRange)))) : (createElement(TableBlockEvent, __assign({ seg: seg, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: instanceId === props.eventSelection, defaultDisplayEventEnd: false }, getSegMeta(seg, props.todayRange))))));\n })));\n } }, function (rootElRef, classNames, innerElRef, innerContent, handleClick) { return (createElement(\"a\", { ref: rootElRef, className: ['fc-daygrid-more-link'].concat(classNames).join(' '), onClick: handleClick }, innerContent)); }));\n };\n return TableCellMoreLink;\n}(BaseComponent));\nfunction compileSegs(singlePlacements) {\n var allSegs = [];\n var invisibleSegs = [];\n for (var _i = 0, singlePlacements_1 = singlePlacements; _i < singlePlacements_1.length; _i++) {\n var placement = singlePlacements_1[_i];\n allSegs.push(placement.seg);\n if (!placement.isVisible) {\n invisibleSegs.push(placement.seg);\n }\n }\n return { allSegs: allSegs, invisibleSegs: invisibleSegs };\n}\n\nvar DEFAULT_WEEK_NUM_FORMAT = createFormatter({ week: 'narrow' });\nvar TableCell = /** @class */ (function (_super) {\n __extends(TableCell, _super);\n function TableCell() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.rootElRef = createRef();\n _this.handleRootEl = function (el) {\n setRef(_this.rootElRef, el);\n setRef(_this.props.elRef, el);\n };\n return _this;\n }\n TableCell.prototype.render = function () {\n var _a = this, props = _a.props, context = _a.context, rootElRef = _a.rootElRef;\n var options = context.options;\n var date = props.date, dateProfile = props.dateProfile;\n var navLinkAttrs = options.navLinks\n ? { 'data-navlink': buildNavLinkData(date, 'week'), tabIndex: 0 }\n : {};\n return (createElement(DayCellRoot, { date: date, dateProfile: dateProfile, todayRange: props.todayRange, showDayNumber: props.showDayNumber, extraHookProps: props.extraHookProps, elRef: this.handleRootEl }, function (dayElRef, dayClassNames, rootDataAttrs, isDisabled) { return (createElement(\"td\", __assign({ ref: dayElRef, className: ['fc-daygrid-day'].concat(dayClassNames, props.extraClassNames || []).join(' ') }, rootDataAttrs, props.extraDataAttrs),\n createElement(\"div\", { className: \"fc-daygrid-day-frame fc-scrollgrid-sync-inner\", ref: props.innerElRef /* different from hook system! RENAME */ },\n props.showWeekNumber && (createElement(WeekNumberRoot, { date: date, defaultFormat: DEFAULT_WEEK_NUM_FORMAT }, function (weekElRef, weekClassNames, innerElRef, innerContent) { return (createElement(\"a\", __assign({ ref: weekElRef, className: ['fc-daygrid-week-number'].concat(weekClassNames).join(' ') }, navLinkAttrs), innerContent)); })),\n !isDisabled && (createElement(TableCellTop, { date: date, dateProfile: dateProfile, showDayNumber: props.showDayNumber, forceDayTop: props.forceDayTop, todayRange: props.todayRange, extraHookProps: props.extraHookProps })),\n createElement(\"div\", { className: \"fc-daygrid-day-events\", ref: props.fgContentElRef },\n props.fgContent,\n createElement(\"div\", { className: \"fc-daygrid-day-bottom\", style: { marginTop: props.moreMarginTop } },\n createElement(TableCellMoreLink, { allDayDate: date, singlePlacements: props.singlePlacements, moreCnt: props.moreCnt, alignmentElRef: rootElRef, alignGridTop: !props.showDayNumber, extraDateSpan: props.extraDateSpan, dateProfile: props.dateProfile, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, todayRange: props.todayRange }))),\n createElement(\"div\", { className: \"fc-daygrid-day-bg\" }, props.bgContent)))); }));\n };\n return TableCell;\n}(DateComponent));\n\nfunction computeFgSegPlacement(segs, // assumed already sorted\ndayMaxEvents, dayMaxEventRows, strictOrder, eventInstanceHeights, maxContentHeight, cells) {\n var hierarchy = new DayGridSegHierarchy();\n hierarchy.allowReslicing = true;\n hierarchy.strictOrder = strictOrder;\n if (dayMaxEvents === true || dayMaxEventRows === true) {\n hierarchy.maxCoord = maxContentHeight;\n hierarchy.hiddenConsumes = true;\n }\n else if (typeof dayMaxEvents === 'number') {\n hierarchy.maxStackCnt = dayMaxEvents;\n }\n else if (typeof dayMaxEventRows === 'number') {\n hierarchy.maxStackCnt = dayMaxEventRows;\n hierarchy.hiddenConsumes = true;\n }\n // create segInputs only for segs with known heights\n var segInputs = [];\n var unknownHeightSegs = [];\n for (var i = 0; i < segs.length; i += 1) {\n var seg = segs[i];\n var instanceId = seg.eventRange.instance.instanceId;\n var eventHeight = eventInstanceHeights[instanceId];\n if (eventHeight != null) {\n segInputs.push({\n index: i,\n thickness: eventHeight,\n span: {\n start: seg.firstCol,\n end: seg.lastCol + 1,\n },\n });\n }\n else {\n unknownHeightSegs.push(seg);\n }\n }\n var hiddenEntries = hierarchy.addSegs(segInputs);\n var segRects = hierarchy.toRects();\n var _a = placeRects(segRects, segs, cells), singleColPlacements = _a.singleColPlacements, multiColPlacements = _a.multiColPlacements, leftoverMargins = _a.leftoverMargins;\n var moreCnts = [];\n var moreMarginTops = [];\n // add segs with unknown heights\n for (var _i = 0, unknownHeightSegs_1 = unknownHeightSegs; _i < unknownHeightSegs_1.length; _i++) {\n var seg = unknownHeightSegs_1[_i];\n multiColPlacements[seg.firstCol].push({\n seg: seg,\n isVisible: false,\n isAbsolute: true,\n absoluteTop: 0,\n marginTop: 0,\n });\n for (var col = seg.firstCol; col <= seg.lastCol; col += 1) {\n singleColPlacements[col].push({\n seg: resliceSeg(seg, col, col + 1, cells),\n isVisible: false,\n isAbsolute: false,\n absoluteTop: 0,\n marginTop: 0,\n });\n }\n }\n // add the hidden entries\n for (var col = 0; col < cells.length; col += 1) {\n moreCnts.push(0);\n }\n for (var _b = 0, hiddenEntries_1 = hiddenEntries; _b < hiddenEntries_1.length; _b++) {\n var hiddenEntry = hiddenEntries_1[_b];\n var seg = segs[hiddenEntry.index];\n var hiddenSpan = hiddenEntry.span;\n multiColPlacements[hiddenSpan.start].push({\n seg: resliceSeg(seg, hiddenSpan.start, hiddenSpan.end, cells),\n isVisible: false,\n isAbsolute: true,\n absoluteTop: 0,\n marginTop: 0,\n });\n for (var col = hiddenSpan.start; col < hiddenSpan.end; col += 1) {\n moreCnts[col] += 1;\n singleColPlacements[col].push({\n seg: resliceSeg(seg, col, col + 1, cells),\n isVisible: false,\n isAbsolute: false,\n absoluteTop: 0,\n marginTop: 0,\n });\n }\n }\n // deal with leftover margins\n for (var col = 0; col < cells.length; col += 1) {\n moreMarginTops.push(leftoverMargins[col]);\n }\n return { singleColPlacements: singleColPlacements, multiColPlacements: multiColPlacements, moreCnts: moreCnts, moreMarginTops: moreMarginTops };\n}\n// rects ordered by top coord, then left\nfunction placeRects(allRects, segs, cells) {\n var rectsByEachCol = groupRectsByEachCol(allRects, cells.length);\n var singleColPlacements = [];\n var multiColPlacements = [];\n var leftoverMargins = [];\n for (var col = 0; col < cells.length; col += 1) {\n var rects = rectsByEachCol[col];\n // compute all static segs in singlePlacements\n var singlePlacements = [];\n var currentHeight = 0;\n var currentMarginTop = 0;\n for (var _i = 0, rects_1 = rects; _i < rects_1.length; _i++) {\n var rect = rects_1[_i];\n var seg = segs[rect.index];\n singlePlacements.push({\n seg: resliceSeg(seg, col, col + 1, cells),\n isVisible: true,\n isAbsolute: false,\n absoluteTop: rect.levelCoord,\n marginTop: rect.levelCoord - currentHeight,\n });\n currentHeight = rect.levelCoord + rect.thickness;\n }\n // compute mixed static/absolute segs in multiPlacements\n var multiPlacements = [];\n currentHeight = 0;\n currentMarginTop = 0;\n for (var _a = 0, rects_2 = rects; _a < rects_2.length; _a++) {\n var rect = rects_2[_a];\n var seg = segs[rect.index];\n var isAbsolute = rect.span.end - rect.span.start > 1; // multi-column?\n var isFirstCol = rect.span.start === col;\n currentMarginTop += rect.levelCoord - currentHeight; // amount of space since bottom of previous seg\n currentHeight = rect.levelCoord + rect.thickness; // height will now be bottom of current seg\n if (isAbsolute) {\n currentMarginTop += rect.thickness;\n if (isFirstCol) {\n multiPlacements.push({\n seg: resliceSeg(seg, rect.span.start, rect.span.end, cells),\n isVisible: true,\n isAbsolute: true,\n absoluteTop: rect.levelCoord,\n marginTop: 0,\n });\n }\n }\n else if (isFirstCol) {\n multiPlacements.push({\n seg: resliceSeg(seg, rect.span.start, rect.span.end, cells),\n isVisible: true,\n isAbsolute: false,\n absoluteTop: rect.levelCoord,\n marginTop: currentMarginTop, // claim the margin\n });\n currentMarginTop = 0;\n }\n }\n singleColPlacements.push(singlePlacements);\n multiColPlacements.push(multiPlacements);\n leftoverMargins.push(currentMarginTop);\n }\n return { singleColPlacements: singleColPlacements, multiColPlacements: multiColPlacements, leftoverMargins: leftoverMargins };\n}\nfunction groupRectsByEachCol(rects, colCnt) {\n var rectsByEachCol = [];\n for (var col = 0; col < colCnt; col += 1) {\n rectsByEachCol.push([]);\n }\n for (var _i = 0, rects_3 = rects; _i < rects_3.length; _i++) {\n var rect = rects_3[_i];\n for (var col = rect.span.start; col < rect.span.end; col += 1) {\n rectsByEachCol[col].push(rect);\n }\n }\n return rectsByEachCol;\n}\nfunction resliceSeg(seg, spanStart, spanEnd, cells) {\n if (seg.firstCol === spanStart && seg.lastCol === spanEnd - 1) {\n return seg;\n }\n var eventRange = seg.eventRange;\n var origRange = eventRange.range;\n var slicedRange = intersectRanges(origRange, {\n start: cells[spanStart].date,\n end: addDays(cells[spanEnd - 1].date, 1),\n });\n return __assign(__assign({}, seg), { firstCol: spanStart, lastCol: spanEnd - 1, eventRange: {\n def: eventRange.def,\n ui: __assign(__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}\nvar DayGridSegHierarchy = /** @class */ (function (_super) {\n __extends(DayGridSegHierarchy, _super);\n function DayGridSegHierarchy() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n // config\n _this.hiddenConsumes = false;\n // allows us to keep hidden entries in the hierarchy so they take up space\n _this.forceHidden = {};\n return _this;\n }\n DayGridSegHierarchy.prototype.addSegs = function (segInputs) {\n var _this = this;\n var hiddenSegs = _super.prototype.addSegs.call(this, segInputs);\n var entriesByLevel = this.entriesByLevel;\n var excludeHidden = function (entry) { return !_this.forceHidden[buildEntryKey(entry)]; };\n // remove the forced-hidden segs\n for (var level = 0; level < entriesByLevel.length; level += 1) {\n entriesByLevel[level] = entriesByLevel[level].filter(excludeHidden);\n }\n return hiddenSegs;\n };\n DayGridSegHierarchy.prototype.handleInvalidInsertion = function (insertion, entry, hiddenEntries) {\n var _a = this, entriesByLevel = _a.entriesByLevel, forceHidden = _a.forceHidden;\n var touchingEntry = insertion.touchingEntry, touchingLevel = insertion.touchingLevel, touchingLateral = insertion.touchingLateral;\n if (this.hiddenConsumes && touchingEntry) {\n var touchingEntryId = buildEntryKey(touchingEntry);\n // if not already hidden\n if (!forceHidden[touchingEntryId]) {\n if (this.allowReslicing) {\n var placeholderEntry = __assign(__assign({}, touchingEntry), { span: intersectSpans(touchingEntry.span, entry.span) });\n var placeholderEntryId = buildEntryKey(placeholderEntry);\n forceHidden[placeholderEntryId] = true;\n entriesByLevel[touchingLevel][touchingLateral] = placeholderEntry; // replace touchingEntry with our placeholder\n this.splitEntry(touchingEntry, entry, hiddenEntries); // split up the touchingEntry, reinsert it\n }\n else {\n forceHidden[touchingEntryId] = true;\n hiddenEntries.push(touchingEntry);\n }\n }\n }\n return _super.prototype.handleInvalidInsertion.call(this, insertion, entry, hiddenEntries);\n };\n return DayGridSegHierarchy;\n}(SegHierarchy));\n\nvar TableRow = /** @class */ (function (_super) {\n __extends(TableRow, _super);\n function TableRow() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.cellElRefs = new RefMap(); // the | \n _this.frameElRefs = new RefMap(); // the fc-daygrid-day-frame\n _this.fgElRefs = new RefMap(); // the fc-daygrid-day-events\n _this.segHarnessRefs = new RefMap(); // indexed by \"instanceId:firstCol\"\n _this.rootElRef = createRef();\n _this.state = {\n framePositions: null,\n maxContentHeight: null,\n eventInstanceHeights: {},\n };\n return _this;\n }\n TableRow.prototype.render = function () {\n var _this = this;\n var _a = this, props = _a.props, state = _a.state, context = _a.context;\n var options = context.options;\n var colCnt = props.cells.length;\n var businessHoursByCol = splitSegsByFirstCol(props.businessHourSegs, colCnt);\n var bgEventSegsByCol = splitSegsByFirstCol(props.bgEventSegs, colCnt);\n var highlightSegsByCol = splitSegsByFirstCol(this.getHighlightSegs(), colCnt);\n var mirrorSegsByCol = splitSegsByFirstCol(this.getMirrorSegs(), colCnt);\n var _b = computeFgSegPlacement(sortEventSegs(props.fgEventSegs, options.eventOrder), props.dayMaxEvents, props.dayMaxEventRows, options.eventOrderStrict, state.eventInstanceHeights, state.maxContentHeight, props.cells), singleColPlacements = _b.singleColPlacements, multiColPlacements = _b.multiColPlacements, moreCnts = _b.moreCnts, moreMarginTops = _b.moreMarginTops;\n var isForcedInvisible = // TODO: messy way to compute this\n (props.eventDrag && props.eventDrag.affectedInstances) ||\n (props.eventResize && props.eventResize.affectedInstances) ||\n {};\n return (createElement(\"tr\", { ref: this.rootElRef },\n props.renderIntro && props.renderIntro(),\n props.cells.map(function (cell, col) {\n var normalFgNodes = _this.renderFgSegs(col, props.forPrint ? singleColPlacements[col] : multiColPlacements[col], props.todayRange, isForcedInvisible);\n var mirrorFgNodes = _this.renderFgSegs(col, buildMirrorPlacements(mirrorSegsByCol[col], multiColPlacements), props.todayRange, {}, Boolean(props.eventDrag), Boolean(props.eventResize), false);\n return (createElement(TableCell, { key: cell.key, elRef: _this.cellElRefs.createRef(cell.key), innerElRef: _this.frameElRefs.createRef(cell.key) /* FF | problem, but okay to use for left/right. TODO: rename prop */, dateProfile: props.dateProfile, date: cell.date, showDayNumber: props.showDayNumbers, showWeekNumber: props.showWeekNumbers && col === 0, forceDayTop: props.showWeekNumbers /* even displaying weeknum for row, not necessarily day */, todayRange: props.todayRange, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, extraHookProps: cell.extraHookProps, extraDataAttrs: cell.extraDataAttrs, extraClassNames: cell.extraClassNames, extraDateSpan: cell.extraDateSpan, moreCnt: moreCnts[col], moreMarginTop: moreMarginTops[col], singlePlacements: singleColPlacements[col], fgContentElRef: _this.fgElRefs.createRef(cell.key), fgContent: ( // Fragment scopes the keys\n createElement(Fragment, null,\n createElement(Fragment, null, normalFgNodes),\n createElement(Fragment, null, mirrorFgNodes))), bgContent: ( // Fragment scopes the keys\n createElement(Fragment, null,\n _this.renderFillSegs(highlightSegsByCol[col], 'highlight'),\n _this.renderFillSegs(businessHoursByCol[col], 'non-business'),\n _this.renderFillSegs(bgEventSegsByCol[col], 'bg-event'))) }));\n })));\n };\n TableRow.prototype.componentDidMount = function () {\n this.updateSizing(true);\n };\n TableRow.prototype.componentDidUpdate = function (prevProps, prevState) {\n var currentProps = this.props;\n this.updateSizing(!isPropsEqual(prevProps, currentProps));\n };\n TableRow.prototype.getHighlightSegs = function () {\n var props = this.props;\n if (props.eventDrag && props.eventDrag.segs.length) { // messy check\n return props.eventDrag.segs;\n }\n if (props.eventResize && props.eventResize.segs.length) { // messy check\n return props.eventResize.segs;\n }\n return props.dateSelectionSegs;\n };\n TableRow.prototype.getMirrorSegs = function () {\n var props = this.props;\n if (props.eventResize && props.eventResize.segs.length) { // messy check\n return props.eventResize.segs;\n }\n return [];\n };\n TableRow.prototype.renderFgSegs = function (col, segPlacements, todayRange, isForcedInvisible, isDragging, isResizing, isDateSelecting) {\n var context = this.context;\n var eventSelection = this.props.eventSelection;\n var framePositions = this.state.framePositions;\n var defaultDisplayEventEnd = this.props.cells.length === 1; // colCnt === 1\n var isMirror = isDragging || isResizing || isDateSelecting;\n var nodes = [];\n if (framePositions) {\n for (var _i = 0, segPlacements_1 = segPlacements; _i < segPlacements_1.length; _i++) {\n var placement = segPlacements_1[_i];\n var seg = placement.seg;\n var instanceId = seg.eventRange.instance.instanceId;\n var key = instanceId + ':' + col;\n var isVisible = placement.isVisible && !isForcedInvisible[instanceId];\n var isAbsolute = placement.isAbsolute;\n var left = '';\n var right = '';\n if (isAbsolute) {\n if (context.isRtl) {\n right = 0;\n left = framePositions.lefts[seg.lastCol] - framePositions.lefts[seg.firstCol];\n }\n else {\n left = 0;\n right = framePositions.rights[seg.firstCol] - framePositions.rights[seg.lastCol];\n }\n }\n /*\n known bug: events that are force to be list-item but span multiple days still take up space in later columns\n todo: in print view, for multi-day events, don't display title within non-start/end segs\n */\n nodes.push(createElement(\"div\", { className: 'fc-daygrid-event-harness' + (isAbsolute ? ' fc-daygrid-event-harness-abs' : ''), key: key, ref: isMirror ? null : this.segHarnessRefs.createRef(key), style: {\n visibility: isVisible ? '' : 'hidden',\n marginTop: isAbsolute ? '' : placement.marginTop,\n top: isAbsolute ? placement.absoluteTop : '',\n left: left,\n right: right,\n } }, hasListItemDisplay(seg) ? (createElement(TableListItemEvent, __assign({ seg: seg, isDragging: isDragging, isSelected: instanceId === eventSelection, defaultDisplayEventEnd: defaultDisplayEventEnd }, getSegMeta(seg, todayRange)))) : (createElement(TableBlockEvent, __assign({ seg: seg, isDragging: isDragging, isResizing: isResizing, isDateSelecting: isDateSelecting, isSelected: instanceId === eventSelection, defaultDisplayEventEnd: defaultDisplayEventEnd }, getSegMeta(seg, todayRange))))));\n }\n }\n return nodes;\n };\n TableRow.prototype.renderFillSegs = function (segs, fillType) {\n var isRtl = this.context.isRtl;\n var todayRange = this.props.todayRange;\n var framePositions = this.state.framePositions;\n var nodes = [];\n if (framePositions) {\n for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {\n var seg = segs_1[_i];\n var leftRightCss = isRtl ? {\n right: 0,\n left: framePositions.lefts[seg.lastCol] - framePositions.lefts[seg.firstCol],\n } : {\n left: 0,\n right: framePositions.rights[seg.firstCol] - framePositions.rights[seg.lastCol],\n };\n nodes.push(createElement(\"div\", { key: buildEventRangeKey(seg.eventRange), className: \"fc-daygrid-bg-harness\", style: leftRightCss }, fillType === 'bg-event' ?\n createElement(BgEvent, __assign({ seg: seg }, getSegMeta(seg, todayRange))) :\n renderFill(fillType)));\n }\n }\n return createElement.apply(void 0, __spreadArray([Fragment, {}], nodes));\n };\n TableRow.prototype.updateSizing = function (isExternalSizingChange) {\n var _a = this, props = _a.props, frameElRefs = _a.frameElRefs;\n if (!props.forPrint &&\n props.clientWidth !== null // positioning ready?\n ) {\n if (isExternalSizingChange) {\n var frameEls = props.cells.map(function (cell) { return frameElRefs.currentMap[cell.key]; });\n if (frameEls.length) {\n var originEl = this.rootElRef.current;\n this.setState({\n framePositions: new PositionCache(originEl, frameEls, true, // isHorizontal\n false),\n });\n }\n }\n var limitByContentHeight = props.dayMaxEvents === true || props.dayMaxEventRows === true;\n this.setState({\n eventInstanceHeights: this.queryEventInstanceHeights(),\n maxContentHeight: limitByContentHeight ? this.computeMaxContentHeight() : null,\n });\n }\n };\n TableRow.prototype.queryEventInstanceHeights = function () {\n var segElMap = this.segHarnessRefs.currentMap;\n var eventInstanceHeights = {};\n // get the max height amongst instance segs\n for (var key in segElMap) {\n var height = Math.round(segElMap[key].getBoundingClientRect().height);\n var instanceId = key.split(':')[0]; // deconstruct how renderFgSegs makes the key\n eventInstanceHeights[instanceId] = Math.max(eventInstanceHeights[instanceId] || 0, height);\n }\n return eventInstanceHeights;\n };\n TableRow.prototype.computeMaxContentHeight = function () {\n var firstKey = this.props.cells[0].key;\n var cellEl = this.cellElRefs.currentMap[firstKey];\n var fcContainerEl = this.fgElRefs.currentMap[firstKey];\n return cellEl.getBoundingClientRect().bottom - fcContainerEl.getBoundingClientRect().top;\n };\n TableRow.prototype.getCellEls = function () {\n var elMap = this.cellElRefs.currentMap;\n return this.props.cells.map(function (cell) { return elMap[cell.key]; });\n };\n return TableRow;\n}(DateComponent));\nTableRow.addStateEquality({\n eventInstanceHeights: isPropsEqual,\n});\nfunction buildMirrorPlacements(mirrorSegs, colPlacements) {\n if (!mirrorSegs.length) {\n return [];\n }\n var topsByInstanceId = buildAbsoluteTopHash(colPlacements); // TODO: cache this at first render?\n return mirrorSegs.map(function (seg) { return ({\n seg: seg,\n isVisible: true,\n isAbsolute: true,\n absoluteTop: topsByInstanceId[seg.eventRange.instance.instanceId],\n marginTop: 0,\n }); });\n}\nfunction buildAbsoluteTopHash(colPlacements) {\n var topsByInstanceId = {};\n for (var _i = 0, colPlacements_1 = colPlacements; _i < colPlacements_1.length; _i++) {\n var placements = colPlacements_1[_i];\n for (var _a = 0, placements_1 = placements; _a < placements_1.length; _a++) {\n var placement = placements_1[_a];\n topsByInstanceId[placement.seg.eventRange.instance.instanceId] = placement.absoluteTop;\n }\n }\n return topsByInstanceId;\n}\n\nvar Table = /** @class */ (function (_super) {\n __extends(Table, _super);\n function Table() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.splitBusinessHourSegs = memoize(splitSegsByRow);\n _this.splitBgEventSegs = memoize(splitSegsByRow);\n _this.splitFgEventSegs = memoize(splitSegsByRow);\n _this.splitDateSelectionSegs = memoize(splitSegsByRow);\n _this.splitEventDrag = memoize(splitInteractionByRow);\n _this.splitEventResize = memoize(splitInteractionByRow);\n _this.rowRefs = new RefMap();\n _this.handleRootEl = function (rootEl) {\n _this.rootEl = rootEl;\n if (rootEl) {\n _this.context.registerInteractiveComponent(_this, {\n el: rootEl,\n isHitComboAllowed: _this.props.isHitComboAllowed,\n });\n }\n else {\n _this.context.unregisterInteractiveComponent(_this);\n }\n };\n return _this;\n }\n Table.prototype.render = function () {\n var _this = this;\n var props = this.props;\n var dateProfile = props.dateProfile, dayMaxEventRows = props.dayMaxEventRows, dayMaxEvents = props.dayMaxEvents, expandRows = props.expandRows;\n var rowCnt = props.cells.length;\n var businessHourSegsByRow = this.splitBusinessHourSegs(props.businessHourSegs, rowCnt);\n var bgEventSegsByRow = this.splitBgEventSegs(props.bgEventSegs, rowCnt);\n var fgEventSegsByRow = this.splitFgEventSegs(props.fgEventSegs, rowCnt);\n var dateSelectionSegsByRow = this.splitDateSelectionSegs(props.dateSelectionSegs, rowCnt);\n var eventDragByRow = this.splitEventDrag(props.eventDrag, rowCnt);\n var eventResizeByRow = this.splitEventResize(props.eventResize, rowCnt);\n var limitViaBalanced = dayMaxEvents === true || dayMaxEventRows === true;\n // if rows can't expand to fill fixed height, can't do balanced-height event limit\n // TODO: best place to normalize these options?\n if (limitViaBalanced && !expandRows) {\n limitViaBalanced = false;\n dayMaxEventRows = null;\n dayMaxEvents = null;\n }\n var classNames = [\n 'fc-daygrid-body',\n limitViaBalanced ? 'fc-daygrid-body-balanced' : 'fc-daygrid-body-unbalanced',\n expandRows ? '' : 'fc-daygrid-body-natural', // will height of one row depend on the others?\n ];\n return (createElement(\"div\", { className: classNames.join(' '), ref: this.handleRootEl, style: {\n // these props are important to give this wrapper correct dimensions for interactions\n // TODO: if we set it here, can we avoid giving to inner tables?\n width: props.clientWidth,\n minWidth: props.tableMinWidth,\n } },\n createElement(NowTimer, { unit: \"day\" }, function (nowDate, todayRange) { return (createElement(Fragment, null,\n createElement(\"table\", { className: \"fc-scrollgrid-sync-table\", style: {\n width: props.clientWidth,\n minWidth: props.tableMinWidth,\n height: expandRows ? props.clientHeight : '',\n } },\n props.colGroupNode,\n createElement(\"tbody\", null, props.cells.map(function (cells, row) { return (createElement(TableRow, { ref: _this.rowRefs.createRef(row), key: cells.length\n ? cells[0].date.toISOString() /* best? or put key on cell? or use diff formatter? */\n : row // in case there are no cells (like when resource view is loading)\n , showDayNumbers: rowCnt > 1, showWeekNumbers: props.showWeekNumbers, todayRange: todayRange, dateProfile: dateProfile, cells: cells, renderIntro: props.renderRowIntro, businessHourSegs: businessHourSegsByRow[row], eventSelection: props.eventSelection, bgEventSegs: bgEventSegsByRow[row].filter(isSegAllDay) /* hack */, fgEventSegs: fgEventSegsByRow[row], dateSelectionSegs: dateSelectionSegsByRow[row], eventDrag: eventDragByRow[row], eventResize: eventResizeByRow[row], dayMaxEvents: dayMaxEvents, dayMaxEventRows: dayMaxEventRows, clientWidth: props.clientWidth, clientHeight: props.clientHeight, forPrint: props.forPrint })); }))))); })));\n };\n // Hit System\n // ----------------------------------------------------------------------------------------------------\n Table.prototype.prepareHits = function () {\n this.rowPositions = new PositionCache(this.rootEl, this.rowRefs.collect().map(function (rowObj) { return rowObj.getCellEls()[0]; }), // first cell el in each row. TODO: not optimal\n false, true);\n this.colPositions = new PositionCache(this.rootEl, this.rowRefs.currentMap[0].getCellEls(), // cell els in first row\n true, // horizontal\n false);\n };\n Table.prototype.queryHit = function (positionLeft, positionTop) {\n var _a = this, colPositions = _a.colPositions, rowPositions = _a.rowPositions;\n var col = colPositions.leftToIndex(positionLeft);\n var row = rowPositions.topToIndex(positionTop);\n if (row != null && col != null) {\n var cell = this.props.cells[row][col];\n return {\n dateProfile: this.props.dateProfile,\n dateSpan: __assign({ range: this.getCellRange(row, col), allDay: true }, cell.extraDateSpan),\n dayEl: this.getCellEl(row, col),\n rect: {\n left: colPositions.lefts[col],\n right: colPositions.rights[col],\n top: rowPositions.tops[row],\n bottom: rowPositions.bottoms[row],\n },\n layer: 0,\n };\n }\n return null;\n };\n Table.prototype.getCellEl = function (row, col) {\n return this.rowRefs.currentMap[row].getCellEls()[col]; // TODO: not optimal\n };\n Table.prototype.getCellRange = function (row, col) {\n var start = this.props.cells[row][col].date;\n var end = addDays(start, 1);\n return { start: start, end: end };\n };\n return Table;\n}(DateComponent));\nfunction isSegAllDay(seg) {\n return seg.eventRange.def.allDay;\n}\n\nvar DayTableSlicer = /** @class */ (function (_super) {\n __extends(DayTableSlicer, _super);\n function DayTableSlicer() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.forceDayIfListItem = true;\n return _this;\n }\n DayTableSlicer.prototype.sliceRange = function (dateRange, dayTableModel) {\n return dayTableModel.sliceRange(dateRange);\n };\n return DayTableSlicer;\n}(Slicer));\n\nvar DayTable = /** @class */ (function (_super) {\n __extends(DayTable, _super);\n function DayTable() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.slicer = new DayTableSlicer();\n _this.tableRef = createRef();\n return _this;\n }\n DayTable.prototype.render = function () {\n var _a = this, props = _a.props, context = _a.context;\n return (createElement(Table, __assign({ ref: this.tableRef }, this.slicer.sliceProps(props, props.dateProfile, props.nextDayThreshold, context, props.dayTableModel), { dateProfile: props.dateProfile, cells: props.dayTableModel.cells, colGroupNode: props.colGroupNode, tableMinWidth: props.tableMinWidth, renderRowIntro: props.renderRowIntro, dayMaxEvents: props.dayMaxEvents, dayMaxEventRows: props.dayMaxEventRows, showWeekNumbers: props.showWeekNumbers, expandRows: props.expandRows, headerAlignElRef: props.headerAlignElRef, clientWidth: props.clientWidth, clientHeight: props.clientHeight, forPrint: props.forPrint })));\n };\n return DayTable;\n}(DateComponent));\n\nvar DayTableView = /** @class */ (function (_super) {\n __extends(DayTableView, _super);\n function DayTableView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.buildDayTableModel = memoize(buildDayTableModel);\n _this.headerRef = createRef();\n _this.tableRef = createRef();\n return _this;\n }\n DayTableView.prototype.render = function () {\n var _this = this;\n var _a = this.context, options = _a.options, dateProfileGenerator = _a.dateProfileGenerator;\n var props = this.props;\n var dayTableModel = this.buildDayTableModel(props.dateProfile, dateProfileGenerator);\n var headerContent = options.dayHeaders && (createElement(DayHeader, { ref: this.headerRef, dateProfile: props.dateProfile, dates: dayTableModel.headerDates, datesRepDistinctDays: dayTableModel.rowCnt === 1 }));\n var bodyContent = function (contentArg) { return (createElement(DayTable, { ref: _this.tableRef, dateProfile: props.dateProfile, dayTableModel: dayTableModel, businessHours: props.businessHours, dateSelection: props.dateSelection, eventStore: props.eventStore, eventUiBases: props.eventUiBases, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, nextDayThreshold: options.nextDayThreshold, colGroupNode: contentArg.tableColGroupNode, tableMinWidth: contentArg.tableMinWidth, dayMaxEvents: options.dayMaxEvents, dayMaxEventRows: options.dayMaxEventRows, showWeekNumbers: options.weekNumbers, expandRows: !props.isHeightAuto, headerAlignElRef: _this.headerElRef, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, forPrint: props.forPrint })); };\n return options.dayMinWidth\n ? this.renderHScrollLayout(headerContent, bodyContent, dayTableModel.colCnt, options.dayMinWidth)\n : this.renderSimpleLayout(headerContent, bodyContent);\n };\n return DayTableView;\n}(TableView));\nfunction buildDayTableModel(dateProfile, dateProfileGenerator) {\n var daySeries = new DaySeriesModel(dateProfile.renderRange, dateProfileGenerator);\n return new DayTableModel(daySeries, /year|month|week/.test(dateProfile.currentRangeUnit));\n}\n\nvar TableDateProfileGenerator = /** @class */ (function (_super) {\n __extends(TableDateProfileGenerator, _super);\n function TableDateProfileGenerator() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n // Computes the date range that will be rendered.\n TableDateProfileGenerator.prototype.buildRenderRange = function (currentRange, currentRangeUnit, isRangeAllDay) {\n var dateEnv = this.props.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 = addWeeks(endOfWeek, 1);\n }\n }\n // ensure 6 weeks\n if (this.props.monthMode &&\n this.props.fixedWeekCount) {\n var rowCnt = Math.ceil(// could be partial weeks due to hiddenDays\n diffWeeks(start, end));\n end = addWeeks(end, 6 - rowCnt);\n }\n return { start: start, end: end };\n };\n return TableDateProfileGenerator;\n}(DateProfileGenerator));\n\nvar main = createPlugin({\n initialView: 'dayGridMonth',\n views: {\n dayGrid: {\n component: DayTableView,\n dateProfileGeneratorClass: TableDateProfileGenerator,\n },\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\nexport default main;\nexport { DayTableView as DayGridView, DayTable, DayTableSlicer, Table, TableView, buildDayTableModel };\n//# sourceMappingURL=main.js.map\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar 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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\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\nexport 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}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","/*!\nFullCalendar v5.9.0\nDocs & License: https://fullcalendar.io/\n(c) 2021 Adam Shaw\n*/\nimport './main.css';\n\nimport { hasBgRendering, Splitter, createFormatter, createElement, ViewContextType, RenderHook, BaseComponent, createRef, diffDays, buildNavLinkData, WeekNumberRoot, getStickyHeaderDates, ViewRoot, SimpleScrollGrid, getStickyFooterScrollbar, NowTimer, NowIndicatorRoot, renderScrollShim, DateComponent, rangeContainsMarker, startOfDay, asRoughMs, createDuration, RefMap, PositionCache, MoreLinkRoot, setRef, SegHierarchy, groupIntersectingEntries, buildEntryKey, binarySearch, getEntrySpanEnd, StandardEvent, DayCellContent, Fragment, getSegMeta, memoize, sortEventSegs, DayCellRoot, buildIsoString, computeEarliestSegStart, buildEventRangeKey, BgEvent, renderFill, addDurations, multiplyDuration, wholeDivideDurations, intersectRanges, Slicer, formatIsoTimeString, DayHeader, DaySeriesModel, DayTableModel, createPlugin } from '@fullcalendar/common';\nimport { __extends, __assign } from 'tslib';\nimport { DayTable } from '@fullcalendar/daygrid';\n\nvar AllDaySplitter = /** @class */ (function (_super) {\n __extends(AllDaySplitter, _super);\n function AllDaySplitter() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n AllDaySplitter.prototype.getKeyInfo = function () {\n return {\n allDay: {},\n timed: {},\n };\n };\n AllDaySplitter.prototype.getKeysForDateSpan = function (dateSpan) {\n if (dateSpan.allDay) {\n return ['allDay'];\n }\n return ['timed'];\n };\n AllDaySplitter.prototype.getKeysForEventDef = function (eventDef) {\n if (!eventDef.allDay) {\n return ['timed'];\n }\n if (hasBgRendering(eventDef)) {\n return ['timed', 'allDay'];\n }\n return ['allDay'];\n };\n return AllDaySplitter;\n}(Splitter));\n\nvar DEFAULT_SLAT_LABEL_FORMAT = createFormatter({\n hour: 'numeric',\n minute: '2-digit',\n omitZeroMinute: true,\n meridiem: 'short',\n});\nfunction TimeColsAxisCell(props) {\n var classNames = [\n 'fc-timegrid-slot',\n 'fc-timegrid-slot-label',\n props.isLabeled ? 'fc-scrollgrid-shrink' : 'fc-timegrid-slot-minor',\n ];\n return (createElement(ViewContextType.Consumer, null, function (context) {\n if (!props.isLabeled) {\n return (createElement(\"td\", { className: classNames.join(' '), \"data-time\": props.isoTimeStr }));\n }\n var dateEnv = context.dateEnv, options = context.options, viewApi = context.viewApi;\n var labelFormat = // TODO: fully pre-parse\n options.slotLabelFormat == null ? DEFAULT_SLAT_LABEL_FORMAT :\n Array.isArray(options.slotLabelFormat) ? createFormatter(options.slotLabelFormat[0]) :\n createFormatter(options.slotLabelFormat);\n var hookProps = {\n level: 0,\n time: props.time,\n date: dateEnv.toDate(props.date),\n view: viewApi,\n text: dateEnv.format(props.date, labelFormat),\n };\n return (createElement(RenderHook, { hookProps: hookProps, classNames: options.slotLabelClassNames, content: options.slotLabelContent, defaultContent: renderInnerContent, didMount: options.slotLabelDidMount, willUnmount: options.slotLabelWillUnmount }, function (rootElRef, customClassNames, innerElRef, innerContent) { return (createElement(\"td\", { ref: rootElRef, className: classNames.concat(customClassNames).join(' '), \"data-time\": props.isoTimeStr },\n createElement(\"div\", { className: \"fc-timegrid-slot-label-frame fc-scrollgrid-shrink-frame\" },\n createElement(\"div\", { className: \"fc-timegrid-slot-label-cushion fc-scrollgrid-shrink-cushion\", ref: innerElRef }, innerContent)))); }));\n }));\n}\nfunction renderInnerContent(props) {\n return props.text;\n}\n\nvar TimeBodyAxis = /** @class */ (function (_super) {\n __extends(TimeBodyAxis, _super);\n function TimeBodyAxis() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TimeBodyAxis.prototype.render = function () {\n return this.props.slatMetas.map(function (slatMeta) { return (createElement(\"tr\", { key: slatMeta.key },\n createElement(TimeColsAxisCell, __assign({}, slatMeta)))); });\n };\n return TimeBodyAxis;\n}(BaseComponent));\n\nvar DEFAULT_WEEK_NUM_FORMAT = createFormatter({ week: 'short' });\nvar AUTO_ALL_DAY_MAX_EVENT_ROWS = 5;\nvar TimeColsView = /** @class */ (function (_super) {\n __extends(TimeColsView, _super);\n function TimeColsView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.allDaySplitter = new AllDaySplitter(); // for use by subclasses\n _this.headerElRef = createRef();\n _this.rootElRef = createRef();\n _this.scrollerElRef = createRef();\n _this.state = {\n slatCoords: null,\n };\n _this.handleScrollTopRequest = function (scrollTop) {\n var scrollerEl = _this.scrollerElRef.current;\n if (scrollerEl) { // TODO: not sure how this could ever be null. weirdness with the reducer\n scrollerEl.scrollTop = scrollTop;\n }\n };\n /* Header Render Methods\n ------------------------------------------------------------------------------------------------------------------*/\n _this.renderHeadAxis = function (rowKey, frameHeight) {\n if (frameHeight === void 0) { frameHeight = ''; }\n var options = _this.context.options;\n var dateProfile = _this.props.dateProfile;\n var range = dateProfile.renderRange;\n var dayCnt = diffDays(range.start, range.end);\n var navLinkAttrs = (options.navLinks && dayCnt === 1) // only do in day views (to avoid doing in week views that dont need it)\n ? { 'data-navlink': buildNavLinkData(range.start, 'week'), tabIndex: 0 }\n : {};\n if (options.weekNumbers && rowKey === 'day') {\n return (createElement(WeekNumberRoot, { date: range.start, defaultFormat: DEFAULT_WEEK_NUM_FORMAT }, function (rootElRef, classNames, innerElRef, innerContent) { return (createElement(\"th\", { ref: rootElRef, className: [\n 'fc-timegrid-axis',\n 'fc-scrollgrid-shrink',\n ].concat(classNames).join(' ') },\n createElement(\"div\", { className: \"fc-timegrid-axis-frame fc-scrollgrid-shrink-frame fc-timegrid-axis-frame-liquid\", style: { height: frameHeight } },\n createElement(\"a\", __assign({ ref: innerElRef, className: \"fc-timegrid-axis-cushion fc-scrollgrid-shrink-cushion fc-scrollgrid-sync-inner\" }, navLinkAttrs), innerContent)))); }));\n }\n return (createElement(\"th\", { className: \"fc-timegrid-axis\" },\n createElement(\"div\", { className: \"fc-timegrid-axis-frame\", style: { height: frameHeight } })));\n };\n /* Table Component Render Methods\n ------------------------------------------------------------------------------------------------------------------*/\n // only a one-way height sync. we don't send the axis inner-content height to the DayGrid,\n // but DayGrid still needs to have classNames on inner elements in order to measure.\n _this.renderTableRowAxis = function (rowHeight) {\n var _a = _this.context, options = _a.options, viewApi = _a.viewApi;\n var hookProps = {\n text: options.allDayText,\n view: viewApi,\n };\n return (\n // TODO: make reusable hook. used in list view too\n createElement(RenderHook, { hookProps: hookProps, classNames: options.allDayClassNames, content: options.allDayContent, defaultContent: renderAllDayInner, didMount: options.allDayDidMount, willUnmount: options.allDayWillUnmount }, function (rootElRef, classNames, innerElRef, innerContent) { return (createElement(\"td\", { ref: rootElRef, className: [\n 'fc-timegrid-axis',\n 'fc-scrollgrid-shrink',\n ].concat(classNames).join(' ') },\n createElement(\"div\", { className: 'fc-timegrid-axis-frame fc-scrollgrid-shrink-frame' + (rowHeight == null ? ' fc-timegrid-axis-frame-liquid' : ''), style: { height: rowHeight } },\n createElement(\"span\", { className: \"fc-timegrid-axis-cushion fc-scrollgrid-shrink-cushion fc-scrollgrid-sync-inner\", ref: innerElRef }, innerContent)))); }));\n };\n _this.handleSlatCoords = function (slatCoords) {\n _this.setState({ slatCoords: slatCoords });\n };\n return _this;\n }\n // rendering\n // ----------------------------------------------------------------------------------------------------\n TimeColsView.prototype.renderSimpleLayout = function (headerRowContent, allDayContent, timeContent) {\n var _a = this, context = _a.context, props = _a.props;\n var sections = [];\n var stickyHeaderDates = getStickyHeaderDates(context.options);\n if (headerRowContent) {\n sections.push({\n type: 'header',\n key: 'header',\n isSticky: stickyHeaderDates,\n chunk: {\n elRef: this.headerElRef,\n tableClassName: 'fc-col-header',\n rowContent: headerRowContent,\n },\n });\n }\n if (allDayContent) {\n sections.push({\n type: 'body',\n key: 'all-day',\n chunk: { content: allDayContent },\n });\n sections.push({\n type: 'body',\n key: 'all-day-divider',\n outerContent: ( // TODO: rename to cellContent so don't need to define | ?\n createElement(\"tr\", { className: \"fc-scrollgrid-section\" },\n createElement(\"td\", { className: 'fc-timegrid-divider ' + context.theme.getClass('tableCellShaded') }))),\n });\n }\n sections.push({\n type: 'body',\n key: 'body',\n liquid: true,\n expandRows: Boolean(context.options.expandRows),\n chunk: {\n scrollerElRef: this.scrollerElRef,\n content: timeContent,\n },\n });\n return (createElement(ViewRoot, { viewSpec: context.viewSpec, elRef: this.rootElRef }, function (rootElRef, classNames) { return (createElement(\"div\", { className: ['fc-timegrid'].concat(classNames).join(' '), ref: rootElRef },\n createElement(SimpleScrollGrid, { liquid: !props.isHeightAuto && !props.forPrint, collapsibleWidth: props.forPrint, cols: [{ width: 'shrink' }], sections: sections }))); }));\n };\n TimeColsView.prototype.renderHScrollLayout = function (headerRowContent, allDayContent, timeContent, colCnt, dayMinWidth, slatMetas, slatCoords) {\n var _this = this;\n var ScrollGrid = this.context.pluginHooks.scrollGridImpl;\n if (!ScrollGrid) {\n throw new Error('No ScrollGrid implementation');\n }\n var _a = this, context = _a.context, props = _a.props;\n var stickyHeaderDates = !props.forPrint && getStickyHeaderDates(context.options);\n var stickyFooterScrollbar = !props.forPrint && getStickyFooterScrollbar(context.options);\n var sections = [];\n if (headerRowContent) {\n sections.push({\n type: 'header',\n key: 'header',\n isSticky: stickyHeaderDates,\n syncRowHeights: true,\n chunks: [\n {\n key: 'axis',\n rowContent: function (arg) { return (createElement(\"tr\", null, _this.renderHeadAxis('day', arg.rowSyncHeights[0]))); },\n },\n {\n key: 'cols',\n elRef: this.headerElRef,\n tableClassName: 'fc-col-header',\n rowContent: headerRowContent,\n },\n ],\n });\n }\n if (allDayContent) {\n sections.push({\n type: 'body',\n key: 'all-day',\n syncRowHeights: true,\n chunks: [\n {\n key: 'axis',\n rowContent: function (contentArg) { return (createElement(\"tr\", null, _this.renderTableRowAxis(contentArg.rowSyncHeights[0]))); },\n },\n {\n key: 'cols',\n content: allDayContent,\n },\n ],\n });\n sections.push({\n key: 'all-day-divider',\n type: 'body',\n outerContent: ( // TODO: rename to cellContent so don't need to define
?\n createElement(\"tr\", { className: \"fc-scrollgrid-section\" },\n createElement(\"td\", { colSpan: 2, className: 'fc-timegrid-divider ' + context.theme.getClass('tableCellShaded') }))),\n });\n }\n var isNowIndicator = context.options.nowIndicator;\n sections.push({\n type: 'body',\n key: 'body',\n liquid: true,\n expandRows: Boolean(context.options.expandRows),\n chunks: [\n {\n key: 'axis',\n content: function (arg) { return (\n // TODO: make this now-indicator arrow more DRY with TimeColsContent\n createElement(\"div\", { className: \"fc-timegrid-axis-chunk\" },\n createElement(\"table\", { style: { height: arg.expandRows ? arg.clientHeight : '' } },\n arg.tableColGroupNode,\n createElement(\"tbody\", null,\n createElement(TimeBodyAxis, { slatMetas: slatMetas }))),\n createElement(\"div\", { className: \"fc-timegrid-now-indicator-container\" },\n createElement(NowTimer, { unit: isNowIndicator ? 'minute' : 'day' /* hacky */ }, function (nowDate) {\n var nowIndicatorTop = isNowIndicator &&\n slatCoords &&\n slatCoords.safeComputeTop(nowDate); // might return void\n if (typeof nowIndicatorTop === 'number') {\n return (createElement(NowIndicatorRoot, { isAxis: true, date: nowDate }, function (rootElRef, classNames, innerElRef, innerContent) { return (createElement(\"div\", { ref: rootElRef, className: ['fc-timegrid-now-indicator-arrow'].concat(classNames).join(' '), style: { top: nowIndicatorTop } }, innerContent)); }));\n }\n return null;\n })))); },\n },\n {\n key: 'cols',\n scrollerElRef: this.scrollerElRef,\n content: timeContent,\n },\n ],\n });\n if (stickyFooterScrollbar) {\n sections.push({\n key: 'footer',\n type: 'footer',\n isSticky: true,\n chunks: [\n {\n key: 'axis',\n content: renderScrollShim,\n },\n {\n key: 'cols',\n content: renderScrollShim,\n },\n ],\n });\n }\n return (createElement(ViewRoot, { viewSpec: context.viewSpec, elRef: this.rootElRef }, function (rootElRef, classNames) { return (createElement(\"div\", { className: ['fc-timegrid'].concat(classNames).join(' '), ref: rootElRef },\n createElement(ScrollGrid, { liquid: !props.isHeightAuto && !props.forPrint, collapsibleWidth: false, colGroups: [\n { width: 'shrink', cols: [{ width: 'shrink' }] },\n { cols: [{ span: colCnt, minWidth: dayMinWidth }] },\n ], sections: sections }))); }));\n };\n /* Dimensions\n ------------------------------------------------------------------------------------------------------------------*/\n TimeColsView.prototype.getAllDayMaxEventProps = function () {\n var _a = this.context.options, dayMaxEvents = _a.dayMaxEvents, dayMaxEventRows = _a.dayMaxEventRows;\n if (dayMaxEvents === true || dayMaxEventRows === true) { // is auto?\n dayMaxEvents = undefined;\n dayMaxEventRows = AUTO_ALL_DAY_MAX_EVENT_ROWS; // make sure \"auto\" goes to a real number\n }\n return { dayMaxEvents: dayMaxEvents, dayMaxEventRows: dayMaxEventRows };\n };\n return TimeColsView;\n}(DateComponent));\nfunction renderAllDayInner(hookProps) {\n return hookProps.text;\n}\n\nvar TimeColsSlatsCoords = /** @class */ (function () {\n function TimeColsSlatsCoords(positions, dateProfile, slotDuration) {\n this.positions = positions;\n this.dateProfile = dateProfile;\n this.slotDuration = slotDuration;\n }\n TimeColsSlatsCoords.prototype.safeComputeTop = function (date) {\n var dateProfile = this.dateProfile;\n if (rangeContainsMarker(dateProfile.currentRange, date)) {\n var startOfDayDate = startOfDay(date);\n var timeMs = date.valueOf() - startOfDayDate.valueOf();\n if (timeMs >= asRoughMs(dateProfile.slotMinTime) &&\n timeMs < asRoughMs(dateProfile.slotMaxTime)) {\n return this.computeTimeTop(createDuration(timeMs));\n }\n }\n return null;\n };\n // Computes the top coordinate, relative to the bounds of the grid, of the given date.\n // A `startOfDayDate` must be given for avoiding ambiguity over how to treat midnight.\n TimeColsSlatsCoords.prototype.computeDateTop = function (when, startOfDayDate) {\n if (!startOfDayDate) {\n startOfDayDate = startOfDay(when);\n }\n return this.computeTimeTop(createDuration(when.valueOf() - startOfDayDate.valueOf()));\n };\n // Computes the top coordinate, relative to the bounds of the grid, of the given time (a Duration).\n // This is a makeshify way to compute the time-top. Assumes all slatMetas dates are uniform.\n // Eventually allow computation with arbirary slat dates.\n TimeColsSlatsCoords.prototype.computeTimeTop = function (duration) {\n var _a = this, positions = _a.positions, dateProfile = _a.dateProfile;\n var len = positions.els.length;\n // floating-point value of # of slots covered\n var slatCoverage = (duration.milliseconds - asRoughMs(dateProfile.slotMinTime)) / asRoughMs(this.slotDuration);\n var slatIndex;\n var slatRemainder;\n // compute a floating-point number for how many slats should be progressed through.\n // from 0 to number of slats (inclusive)\n // constrained because slotMinTime/slotMaxTime might be customized.\n slatCoverage = Math.max(0, slatCoverage);\n slatCoverage = Math.min(len, slatCoverage);\n // an integer index of the furthest whole slat\n // from 0 to number slats (*exclusive*, so len-1)\n slatIndex = Math.floor(slatCoverage);\n slatIndex = Math.min(slatIndex, len - 1);\n // how much further through the slatIndex slat (from 0.0-1.0) must be covered in addition.\n // could be 1.0 if slatCoverage is covering *all* the slots\n slatRemainder = slatCoverage - slatIndex;\n return positions.tops[slatIndex] +\n positions.getHeight(slatIndex) * slatRemainder;\n };\n return TimeColsSlatsCoords;\n}());\n\nvar TimeColsSlatsBody = /** @class */ (function (_super) {\n __extends(TimeColsSlatsBody, _super);\n function TimeColsSlatsBody() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TimeColsSlatsBody.prototype.render = function () {\n var _a = this, props = _a.props, context = _a.context;\n var options = context.options;\n var slatElRefs = props.slatElRefs;\n return (createElement(\"tbody\", null, props.slatMetas.map(function (slatMeta, i) {\n var hookProps = {\n time: slatMeta.time,\n date: context.dateEnv.toDate(slatMeta.date),\n view: context.viewApi,\n };\n var classNames = [\n 'fc-timegrid-slot',\n 'fc-timegrid-slot-lane',\n slatMeta.isLabeled ? '' : 'fc-timegrid-slot-minor',\n ];\n return (createElement(\"tr\", { key: slatMeta.key, ref: slatElRefs.createRef(slatMeta.key) },\n props.axis && (createElement(TimeColsAxisCell, __assign({}, slatMeta))),\n createElement(RenderHook, { hookProps: hookProps, classNames: options.slotLaneClassNames, content: options.slotLaneContent, didMount: options.slotLaneDidMount, willUnmount: options.slotLaneWillUnmount }, function (rootElRef, customClassNames, innerElRef, innerContent) { return (createElement(\"td\", { ref: rootElRef, className: classNames.concat(customClassNames).join(' '), \"data-time\": slatMeta.isoTimeStr }, innerContent)); })));\n })));\n };\n return TimeColsSlatsBody;\n}(BaseComponent));\n\n/*\nfor the horizontal \"slats\" that run width-wise. Has a time axis on a side. Depends on RTL.\n*/\nvar TimeColsSlats = /** @class */ (function (_super) {\n __extends(TimeColsSlats, _super);\n function TimeColsSlats() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.rootElRef = createRef();\n _this.slatElRefs = new RefMap();\n return _this;\n }\n TimeColsSlats.prototype.render = function () {\n var _a = this, props = _a.props, context = _a.context;\n return (createElement(\"div\", { className: \"fc-timegrid-slots\", ref: this.rootElRef },\n createElement(\"table\", { className: context.theme.getClass('table'), style: {\n minWidth: props.tableMinWidth,\n width: props.clientWidth,\n height: props.minHeight,\n } },\n props.tableColGroupNode /* relies on there only being a single for the axis */,\n createElement(TimeColsSlatsBody, { slatElRefs: this.slatElRefs, axis: props.axis, slatMetas: props.slatMetas }))));\n };\n TimeColsSlats.prototype.componentDidMount = function () {\n this.updateSizing();\n };\n TimeColsSlats.prototype.componentDidUpdate = function () {\n this.updateSizing();\n };\n TimeColsSlats.prototype.componentWillUnmount = function () {\n if (this.props.onCoords) {\n this.props.onCoords(null);\n }\n };\n TimeColsSlats.prototype.updateSizing = function () {\n var _a = this, context = _a.context, props = _a.props;\n if (props.onCoords &&\n props.clientWidth !== null // means sizing has stabilized\n ) {\n var rootEl = this.rootElRef.current;\n if (rootEl.offsetHeight) { // not hidden by css\n props.onCoords(new TimeColsSlatsCoords(new PositionCache(this.rootElRef.current, collectSlatEls(this.slatElRefs.currentMap, props.slatMetas), false, true), this.props.dateProfile, context.options.slotDuration));\n }\n }\n };\n return TimeColsSlats;\n}(BaseComponent));\nfunction collectSlatEls(elMap, slatMetas) {\n return slatMetas.map(function (slatMeta) { return elMap[slatMeta.key]; });\n}\n\nfunction splitSegsByCol(segs, colCnt) {\n var segsByCol = [];\n var i;\n for (i = 0; i < colCnt; i += 1) {\n segsByCol.push([]);\n }\n if (segs) {\n for (i = 0; i < segs.length; i += 1) {\n segsByCol[segs[i].col].push(segs[i]);\n }\n }\n return segsByCol;\n}\nfunction splitInteractionByCol(ui, colCnt) {\n var byRow = [];\n if (!ui) {\n for (var i = 0; i < colCnt; i += 1) {\n byRow[i] = null;\n }\n }\n else {\n for (var i = 0; i < colCnt; i += 1) {\n byRow[i] = {\n affectedInstances: ui.affectedInstances,\n isEvent: ui.isEvent,\n segs: [],\n };\n }\n for (var _i = 0, _a = ui.segs; _i < _a.length; _i++) {\n var seg = _a[_i];\n byRow[seg.col].segs.push(seg);\n }\n }\n return byRow;\n}\n\nvar TimeColMoreLink = /** @class */ (function (_super) {\n __extends(TimeColMoreLink, _super);\n function TimeColMoreLink() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.rootElRef = createRef();\n return _this;\n }\n TimeColMoreLink.prototype.render = function () {\n var _this = this;\n var props = this.props;\n return (createElement(MoreLinkRoot, { allDayDate: null, moreCnt: props.hiddenSegs.length, allSegs: props.hiddenSegs, hiddenSegs: props.hiddenSegs, alignmentElRef: this.rootElRef, defaultContent: renderMoreLinkInner, extraDateSpan: props.extraDateSpan, dateProfile: props.dateProfile, todayRange: props.todayRange, popoverContent: function () { return renderPlainFgSegs(props.hiddenSegs, props); } }, function (rootElRef, classNames, innerElRef, innerContent, handleClick) { return (createElement(\"a\", { ref: function (el) {\n setRef(rootElRef, el);\n setRef(_this.rootElRef, el);\n }, className: ['fc-timegrid-more-link'].concat(classNames).join(' '), style: { top: props.top, bottom: props.bottom }, onClick: handleClick },\n createElement(\"div\", { ref: innerElRef, className: \"fc-timegrid-more-link-inner fc-sticky\" }, innerContent))); }));\n };\n return TimeColMoreLink;\n}(BaseComponent));\nfunction renderMoreLinkInner(props) {\n return props.shortText;\n}\n\n// segInputs assumed sorted\nfunction buildPositioning(segInputs, strictOrder, maxStackCnt) {\n var hierarchy = new SegHierarchy();\n if (strictOrder != null) {\n hierarchy.strictOrder = strictOrder;\n }\n if (maxStackCnt != null) {\n hierarchy.maxStackCnt = maxStackCnt;\n }\n var hiddenEntries = hierarchy.addSegs(segInputs);\n var hiddenGroups = groupIntersectingEntries(hiddenEntries);\n var web = buildWeb(hierarchy);\n web = stretchWeb(web, 1); // all levelCoords/thickness will have 0.0-1.0\n var segRects = webToRects(web);\n return { segRects: segRects, hiddenGroups: hiddenGroups };\n}\nfunction buildWeb(hierarchy) {\n var entriesByLevel = hierarchy.entriesByLevel;\n var buildNode = cacheable(function (level, lateral) { return level + ':' + lateral; }, function (level, lateral) {\n var siblingRange = findNextLevelSegs(hierarchy, level, lateral);\n var nextLevelRes = buildNodes(siblingRange, buildNode);\n var entry = entriesByLevel[level][lateral];\n return [\n __assign(__assign({}, entry), { nextLevelNodes: nextLevelRes[0] }),\n entry.thickness + nextLevelRes[1], // the pressure builds\n ];\n });\n return buildNodes(entriesByLevel.length\n ? { level: 0, lateralStart: 0, lateralEnd: entriesByLevel[0].length }\n : null, buildNode)[0];\n}\nfunction buildNodes(siblingRange, buildNode) {\n if (!siblingRange) {\n return [[], 0];\n }\n var level = siblingRange.level, lateralStart = siblingRange.lateralStart, lateralEnd = siblingRange.lateralEnd;\n var lateral = lateralStart;\n var pairs = [];\n while (lateral < lateralEnd) {\n pairs.push(buildNode(level, lateral));\n lateral += 1;\n }\n pairs.sort(cmpDescPressures);\n return [\n pairs.map(extractNode),\n pairs[0][1], // first item's pressure\n ];\n}\nfunction cmpDescPressures(a, b) {\n return b[1] - a[1];\n}\nfunction extractNode(a) {\n return a[0];\n}\nfunction findNextLevelSegs(hierarchy, subjectLevel, subjectLateral) {\n var levelCoords = hierarchy.levelCoords, entriesByLevel = hierarchy.entriesByLevel;\n var subjectEntry = entriesByLevel[subjectLevel][subjectLateral];\n var afterSubject = levelCoords[subjectLevel] + subjectEntry.thickness;\n var levelCnt = levelCoords.length;\n var level = subjectLevel;\n // skip past levels that are too high up\n for (; level < levelCnt && levelCoords[level] < afterSubject; level += 1)\n ; // do nothing\n for (; level < levelCnt; level += 1) {\n var entries = entriesByLevel[level];\n var entry = void 0;\n var searchIndex = binarySearch(entries, subjectEntry.span.start, getEntrySpanEnd);\n var lateralStart = searchIndex[0] + searchIndex[1]; // if exact match (which doesn't collide), go to next one\n var lateralEnd = lateralStart;\n while ( // loop through entries that horizontally intersect\n (entry = entries[lateralEnd]) && // but not past the whole seg list\n entry.span.start < subjectEntry.span.end) {\n lateralEnd += 1;\n }\n if (lateralStart < lateralEnd) {\n return { level: level, lateralStart: lateralStart, lateralEnd: lateralEnd };\n }\n }\n return null;\n}\nfunction stretchWeb(topLevelNodes, totalThickness) {\n var stretchNode = cacheable(function (node, startCoord, prevThickness) { return buildEntryKey(node); }, function (node, startCoord, prevThickness) {\n var nextLevelNodes = node.nextLevelNodes, thickness = node.thickness;\n var allThickness = thickness + prevThickness;\n var thicknessFraction = thickness / allThickness;\n var endCoord;\n var newChildren = [];\n if (!nextLevelNodes.length) {\n endCoord = totalThickness;\n }\n else {\n for (var _i = 0, nextLevelNodes_1 = nextLevelNodes; _i < nextLevelNodes_1.length; _i++) {\n var childNode = nextLevelNodes_1[_i];\n if (endCoord === undefined) {\n var res = stretchNode(childNode, startCoord, allThickness);\n endCoord = res[0];\n newChildren.push(res[1]);\n }\n else {\n var res = stretchNode(childNode, endCoord, 0);\n newChildren.push(res[1]);\n }\n }\n }\n var newThickness = (endCoord - startCoord) * thicknessFraction;\n return [endCoord - newThickness, __assign(__assign({}, node), { thickness: newThickness, nextLevelNodes: newChildren })];\n });\n return topLevelNodes.map(function (node) { return stretchNode(node, 0, 0)[1]; });\n}\n// not sorted in any particular order\nfunction webToRects(topLevelNodes) {\n var rects = [];\n var processNode = cacheable(function (node, levelCoord, stackDepth) { return buildEntryKey(node); }, function (node, levelCoord, stackDepth) {\n var rect = __assign(__assign({}, node), { levelCoord: levelCoord,\n stackDepth: stackDepth, stackForward: 0 });\n rects.push(rect);\n return (rect.stackForward = processNodes(node.nextLevelNodes, levelCoord + node.thickness, stackDepth + 1) + 1);\n });\n function processNodes(nodes, levelCoord, stackDepth) {\n var stackForward = 0;\n for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {\n var node = nodes_1[_i];\n stackForward = Math.max(processNode(node, levelCoord, stackDepth), stackForward);\n }\n return stackForward;\n }\n processNodes(topLevelNodes, 0, 0);\n return rects; // TODO: sort rects by levelCoord to be consistent with toRects?\n}\n// TODO: move to general util\nfunction cacheable(keyFunc, workFunc) {\n var cache = {};\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var key = keyFunc.apply(void 0, args);\n return (key in cache)\n ? cache[key]\n : (cache[key] = workFunc.apply(void 0, args));\n };\n}\n\nfunction computeSegVCoords(segs, colDate, slatCoords, eventMinHeight) {\n if (slatCoords === void 0) { slatCoords = null; }\n if (eventMinHeight === void 0) { eventMinHeight = 0; }\n var vcoords = [];\n if (slatCoords) {\n for (var i = 0; i < segs.length; i += 1) {\n var seg = segs[i];\n var spanStart = slatCoords.computeDateTop(seg.start, colDate);\n var spanEnd = Math.max(spanStart + (eventMinHeight || 0), // :(\n slatCoords.computeDateTop(seg.end, colDate));\n vcoords.push({\n start: Math.round(spanStart),\n end: Math.round(spanEnd), //\n });\n }\n }\n return vcoords;\n}\nfunction computeFgSegPlacements(segs, segVCoords, // might not have for every seg\neventOrderStrict, eventMaxStack) {\n var segInputs = [];\n var dumbSegs = []; // segs without coords\n for (var i = 0; i < segs.length; i += 1) {\n var vcoords = segVCoords[i];\n if (vcoords) {\n segInputs.push({\n index: i,\n thickness: 1,\n span: vcoords,\n });\n }\n else {\n dumbSegs.push(segs[i]);\n }\n }\n var _a = buildPositioning(segInputs, eventOrderStrict, eventMaxStack), segRects = _a.segRects, hiddenGroups = _a.hiddenGroups;\n var segPlacements = [];\n for (var _i = 0, segRects_1 = segRects; _i < segRects_1.length; _i++) {\n var segRect = segRects_1[_i];\n segPlacements.push({\n seg: segs[segRect.index],\n rect: segRect,\n });\n }\n for (var _b = 0, dumbSegs_1 = dumbSegs; _b < dumbSegs_1.length; _b++) {\n var dumbSeg = dumbSegs_1[_b];\n segPlacements.push({ seg: dumbSeg, rect: null });\n }\n return { segPlacements: segPlacements, hiddenGroups: hiddenGroups };\n}\n\nvar DEFAULT_TIME_FORMAT = createFormatter({\n hour: 'numeric',\n minute: '2-digit',\n meridiem: false,\n});\nvar TimeColEvent = /** @class */ (function (_super) {\n __extends(TimeColEvent, _super);\n function TimeColEvent() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TimeColEvent.prototype.render = function () {\n var classNames = [\n 'fc-timegrid-event',\n 'fc-v-event',\n ];\n if (this.props.isShort) {\n classNames.push('fc-timegrid-event-short');\n }\n return (createElement(StandardEvent, __assign({}, this.props, { defaultTimeFormat: DEFAULT_TIME_FORMAT, extraClassNames: classNames })));\n };\n return TimeColEvent;\n}(BaseComponent));\n\nvar TimeColMisc = /** @class */ (function (_super) {\n __extends(TimeColMisc, _super);\n function TimeColMisc() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TimeColMisc.prototype.render = function () {\n var props = this.props;\n return (createElement(DayCellContent, { date: props.date, dateProfile: props.dateProfile, todayRange: props.todayRange, extraHookProps: props.extraHookProps }, function (innerElRef, innerContent) { return (innerContent &&\n createElement(\"div\", { className: \"fc-timegrid-col-misc\", ref: innerElRef }, innerContent)); }));\n };\n return TimeColMisc;\n}(BaseComponent));\n\nvar TimeCol = /** @class */ (function (_super) {\n __extends(TimeCol, _super);\n function TimeCol() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.sortEventSegs = memoize(sortEventSegs);\n return _this;\n }\n // TODO: memoize event-placement?\n TimeCol.prototype.render = function () {\n var _this = this;\n var _a = this, props = _a.props, context = _a.context;\n var isSelectMirror = context.options.selectMirror;\n var mirrorSegs = (props.eventDrag && props.eventDrag.segs) ||\n (props.eventResize && props.eventResize.segs) ||\n (isSelectMirror && props.dateSelectionSegs) ||\n [];\n var interactionAffectedInstances = // TODO: messy way to compute this\n (props.eventDrag && props.eventDrag.affectedInstances) ||\n (props.eventResize && props.eventResize.affectedInstances) ||\n {};\n var sortedFgSegs = this.sortEventSegs(props.fgEventSegs, context.options.eventOrder);\n return (createElement(DayCellRoot, { elRef: props.elRef, date: props.date, dateProfile: props.dateProfile, todayRange: props.todayRange, extraHookProps: props.extraHookProps }, function (rootElRef, classNames, dataAttrs) { return (createElement(\"td\", __assign({ ref: rootElRef, className: ['fc-timegrid-col'].concat(classNames, props.extraClassNames || []).join(' ') }, dataAttrs, props.extraDataAttrs),\n createElement(\"div\", { className: \"fc-timegrid-col-frame\" },\n createElement(\"div\", { className: \"fc-timegrid-col-bg\" },\n _this.renderFillSegs(props.businessHourSegs, 'non-business'),\n _this.renderFillSegs(props.bgEventSegs, 'bg-event'),\n _this.renderFillSegs(props.dateSelectionSegs, 'highlight')),\n createElement(\"div\", { className: \"fc-timegrid-col-events\" }, _this.renderFgSegs(sortedFgSegs, interactionAffectedInstances, false, false, false)),\n createElement(\"div\", { className: \"fc-timegrid-col-events\" }, _this.renderFgSegs(mirrorSegs, {}, Boolean(props.eventDrag), Boolean(props.eventResize), Boolean(isSelectMirror))),\n createElement(\"div\", { className: \"fc-timegrid-now-indicator-container\" }, _this.renderNowIndicator(props.nowIndicatorSegs)),\n createElement(TimeColMisc, { date: props.date, dateProfile: props.dateProfile, todayRange: props.todayRange, extraHookProps: props.extraHookProps })))); }));\n };\n TimeCol.prototype.renderFgSegs = function (sortedFgSegs, segIsInvisible, isDragging, isResizing, isDateSelecting) {\n var props = this.props;\n if (props.forPrint) {\n return renderPlainFgSegs(sortedFgSegs, props);\n }\n return this.renderPositionedFgSegs(sortedFgSegs, segIsInvisible, isDragging, isResizing, isDateSelecting);\n };\n TimeCol.prototype.renderPositionedFgSegs = function (segs, // if not mirror, needs to be sorted\n segIsInvisible, isDragging, isResizing, isDateSelecting) {\n var _this = this;\n var _a = this.context.options, eventMaxStack = _a.eventMaxStack, eventShortHeight = _a.eventShortHeight, eventOrderStrict = _a.eventOrderStrict, eventMinHeight = _a.eventMinHeight;\n var _b = this.props, date = _b.date, slatCoords = _b.slatCoords, eventSelection = _b.eventSelection, todayRange = _b.todayRange, nowDate = _b.nowDate;\n var isMirror = isDragging || isResizing || isDateSelecting;\n var segVCoords = computeSegVCoords(segs, date, slatCoords, eventMinHeight);\n var _c = computeFgSegPlacements(segs, segVCoords, eventOrderStrict, eventMaxStack), segPlacements = _c.segPlacements, hiddenGroups = _c.hiddenGroups;\n return (createElement(Fragment, null,\n this.renderHiddenGroups(hiddenGroups, segs),\n segPlacements.map(function (segPlacement) {\n var seg = segPlacement.seg, rect = segPlacement.rect;\n var instanceId = seg.eventRange.instance.instanceId;\n var isVisible = isMirror || Boolean(!segIsInvisible[instanceId] && rect);\n var vStyle = computeSegVStyle(rect && rect.span);\n var hStyle = (!isMirror && rect) ? _this.computeSegHStyle(rect) : { left: 0, right: 0 };\n var isInset = Boolean(rect) && rect.stackForward > 0;\n var isShort = Boolean(rect) && (rect.span.end - rect.span.start) < eventShortHeight; // look at other places for this problem\n return (createElement(\"div\", { className: 'fc-timegrid-event-harness' +\n (isInset ? ' fc-timegrid-event-harness-inset' : ''), key: instanceId, style: __assign(__assign({ visibility: isVisible ? '' : 'hidden' }, vStyle), hStyle) },\n createElement(TimeColEvent, __assign({ seg: seg, isDragging: isDragging, isResizing: isResizing, isDateSelecting: isDateSelecting, isSelected: instanceId === eventSelection, isShort: isShort }, getSegMeta(seg, todayRange, nowDate)))));\n })));\n };\n // will already have eventMinHeight applied because segInputs already had it\n TimeCol.prototype.renderHiddenGroups = function (hiddenGroups, segs) {\n var _a = this.props, extraDateSpan = _a.extraDateSpan, dateProfile = _a.dateProfile, todayRange = _a.todayRange, nowDate = _a.nowDate, eventSelection = _a.eventSelection, eventDrag = _a.eventDrag, eventResize = _a.eventResize;\n return (createElement(Fragment, null, hiddenGroups.map(function (hiddenGroup) {\n var positionCss = computeSegVStyle(hiddenGroup.span);\n var hiddenSegs = compileSegsFromEntries(hiddenGroup.entries, segs);\n return (createElement(TimeColMoreLink, { key: buildIsoString(computeEarliestSegStart(hiddenSegs)), hiddenSegs: hiddenSegs, top: positionCss.top, bottom: positionCss.bottom, extraDateSpan: extraDateSpan, dateProfile: dateProfile, todayRange: todayRange, nowDate: nowDate, eventSelection: eventSelection, eventDrag: eventDrag, eventResize: eventResize }));\n })));\n };\n TimeCol.prototype.renderFillSegs = function (segs, fillType) {\n var _a = this, props = _a.props, context = _a.context;\n var segVCoords = computeSegVCoords(segs, props.date, props.slatCoords, context.options.eventMinHeight); // don't assume all populated\n var children = segVCoords.map(function (vcoords, i) {\n var seg = segs[i];\n return (createElement(\"div\", { key: buildEventRangeKey(seg.eventRange), className: \"fc-timegrid-bg-harness\", style: computeSegVStyle(vcoords) }, fillType === 'bg-event' ?\n createElement(BgEvent, __assign({ seg: seg }, getSegMeta(seg, props.todayRange, props.nowDate))) :\n renderFill(fillType)));\n });\n return createElement(Fragment, null, children);\n };\n TimeCol.prototype.renderNowIndicator = function (segs) {\n var _a = this.props, slatCoords = _a.slatCoords, date = _a.date;\n if (!slatCoords) {\n return null;\n }\n return segs.map(function (seg, i) { return (createElement(NowIndicatorRoot, { isAxis: false, date: date, \n // key doesn't matter. will only ever be one\n key: i }, function (rootElRef, classNames, innerElRef, innerContent) { return (createElement(\"div\", { ref: rootElRef, className: ['fc-timegrid-now-indicator-line'].concat(classNames).join(' '), style: { top: slatCoords.computeDateTop(seg.start, date) } }, innerContent)); })); });\n };\n TimeCol.prototype.computeSegHStyle = function (segHCoords) {\n var _a = this.context, isRtl = _a.isRtl, options = _a.options;\n var shouldOverlap = options.slotEventOverlap;\n var nearCoord = segHCoords.levelCoord; // the left side if LTR. the right side if RTL. floating-point\n var farCoord = segHCoords.levelCoord + segHCoords.thickness; // the right side if LTR. the left side if RTL. floating-point\n var left; // amount of space from left edge, a fraction of the total width\n var right; // amount of space from right edge, a fraction of the total width\n if (shouldOverlap) {\n // double the width, but don't go beyond the maximum forward coordinate (1.0)\n farCoord = Math.min(1, nearCoord + (farCoord - nearCoord) * 2);\n }\n if (isRtl) {\n left = 1 - farCoord;\n right = nearCoord;\n }\n else {\n left = nearCoord;\n right = 1 - farCoord;\n }\n var props = {\n zIndex: segHCoords.stackDepth + 1,\n left: left * 100 + '%',\n right: right * 100 + '%',\n };\n if (shouldOverlap && !segHCoords.stackForward) {\n // add padding to the edge so that forward stacked events don't cover the resizer's icon\n props[isRtl ? 'marginLeft' : 'marginRight'] = 10 * 2; // 10 is a guesstimate of the icon's width\n }\n return props;\n };\n return TimeCol;\n}(BaseComponent));\nfunction renderPlainFgSegs(sortedFgSegs, _a) {\n var todayRange = _a.todayRange, nowDate = _a.nowDate, eventSelection = _a.eventSelection, eventDrag = _a.eventDrag, eventResize = _a.eventResize;\n var hiddenInstances = (eventDrag ? eventDrag.affectedInstances : null) ||\n (eventResize ? eventResize.affectedInstances : null) ||\n {};\n return (createElement(Fragment, null, sortedFgSegs.map(function (seg) {\n var instanceId = seg.eventRange.instance.instanceId;\n return (createElement(\"div\", { key: instanceId, style: { visibility: hiddenInstances[instanceId] ? 'hidden' : '' } },\n createElement(TimeColEvent, __assign({ seg: seg, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: instanceId === eventSelection, isShort: false }, getSegMeta(seg, todayRange, nowDate)))));\n })));\n}\nfunction computeSegVStyle(segVCoords) {\n if (!segVCoords) {\n return { top: '', bottom: '' };\n }\n return {\n top: segVCoords.start,\n bottom: -segVCoords.end,\n };\n}\nfunction compileSegsFromEntries(segEntries, allSegs) {\n return segEntries.map(function (segEntry) { return allSegs[segEntry.index]; });\n}\n\nvar TimeColsContent = /** @class */ (function (_super) {\n __extends(TimeColsContent, _super);\n function TimeColsContent() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.splitFgEventSegs = memoize(splitSegsByCol);\n _this.splitBgEventSegs = memoize(splitSegsByCol);\n _this.splitBusinessHourSegs = memoize(splitSegsByCol);\n _this.splitNowIndicatorSegs = memoize(splitSegsByCol);\n _this.splitDateSelectionSegs = memoize(splitSegsByCol);\n _this.splitEventDrag = memoize(splitInteractionByCol);\n _this.splitEventResize = memoize(splitInteractionByCol);\n _this.rootElRef = createRef();\n _this.cellElRefs = new RefMap();\n return _this;\n }\n TimeColsContent.prototype.render = function () {\n var _this = this;\n var _a = this, props = _a.props, context = _a.context;\n var nowIndicatorTop = context.options.nowIndicator &&\n props.slatCoords &&\n props.slatCoords.safeComputeTop(props.nowDate); // might return void\n var colCnt = props.cells.length;\n var fgEventSegsByRow = this.splitFgEventSegs(props.fgEventSegs, colCnt);\n var bgEventSegsByRow = this.splitBgEventSegs(props.bgEventSegs, colCnt);\n var businessHourSegsByRow = this.splitBusinessHourSegs(props.businessHourSegs, colCnt);\n var nowIndicatorSegsByRow = this.splitNowIndicatorSegs(props.nowIndicatorSegs, colCnt);\n var dateSelectionSegsByRow = this.splitDateSelectionSegs(props.dateSelectionSegs, colCnt);\n var eventDragByRow = this.splitEventDrag(props.eventDrag, colCnt);\n var eventResizeByRow = this.splitEventResize(props.eventResize, colCnt);\n return (createElement(\"div\", { className: \"fc-timegrid-cols\", ref: this.rootElRef },\n createElement(\"table\", { style: {\n minWidth: props.tableMinWidth,\n width: props.clientWidth,\n } },\n props.tableColGroupNode,\n createElement(\"tbody\", null,\n createElement(\"tr\", null,\n props.axis && (createElement(\"td\", { className: \"fc-timegrid-col fc-timegrid-axis\" },\n createElement(\"div\", { className: \"fc-timegrid-col-frame\" },\n createElement(\"div\", { className: \"fc-timegrid-now-indicator-container\" }, typeof nowIndicatorTop === 'number' && (createElement(NowIndicatorRoot, { isAxis: true, date: props.nowDate }, function (rootElRef, classNames, innerElRef, innerContent) { return (createElement(\"div\", { ref: rootElRef, className: ['fc-timegrid-now-indicator-arrow'].concat(classNames).join(' '), style: { top: nowIndicatorTop } }, innerContent)); })))))),\n props.cells.map(function (cell, i) { return (createElement(TimeCol, { key: cell.key, elRef: _this.cellElRefs.createRef(cell.key), dateProfile: props.dateProfile, date: cell.date, nowDate: props.nowDate, todayRange: props.todayRange, extraHookProps: cell.extraHookProps, extraDataAttrs: cell.extraDataAttrs, extraClassNames: cell.extraClassNames, extraDateSpan: cell.extraDateSpan, fgEventSegs: fgEventSegsByRow[i], bgEventSegs: bgEventSegsByRow[i], businessHourSegs: businessHourSegsByRow[i], nowIndicatorSegs: nowIndicatorSegsByRow[i], dateSelectionSegs: dateSelectionSegsByRow[i], eventDrag: eventDragByRow[i], eventResize: eventResizeByRow[i], slatCoords: props.slatCoords, eventSelection: props.eventSelection, forPrint: props.forPrint })); }))))));\n };\n TimeColsContent.prototype.componentDidMount = function () {\n this.updateCoords();\n };\n TimeColsContent.prototype.componentDidUpdate = function () {\n this.updateCoords();\n };\n TimeColsContent.prototype.updateCoords = function () {\n var props = this.props;\n if (props.onColCoords &&\n props.clientWidth !== null // means sizing has stabilized\n ) {\n props.onColCoords(new PositionCache(this.rootElRef.current, collectCellEls(this.cellElRefs.currentMap, props.cells), true, // horizontal\n false));\n }\n };\n return TimeColsContent;\n}(BaseComponent));\nfunction collectCellEls(elMap, cells) {\n return cells.map(function (cell) { return elMap[cell.key]; });\n}\n\n/* A component that renders one or more columns of vertical time slots\n----------------------------------------------------------------------------------------------------------------------*/\nvar TimeCols = /** @class */ (function (_super) {\n __extends(TimeCols, _super);\n function TimeCols() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.processSlotOptions = memoize(processSlotOptions);\n _this.state = {\n slatCoords: null,\n };\n _this.handleRootEl = function (el) {\n if (el) {\n _this.context.registerInteractiveComponent(_this, {\n el: el,\n isHitComboAllowed: _this.props.isHitComboAllowed,\n });\n }\n else {\n _this.context.unregisterInteractiveComponent(_this);\n }\n };\n _this.handleScrollRequest = function (request) {\n var onScrollTopRequest = _this.props.onScrollTopRequest;\n var slatCoords = _this.state.slatCoords;\n if (onScrollTopRequest && slatCoords) {\n if (request.time) {\n var top_1 = slatCoords.computeTimeTop(request.time);\n top_1 = Math.ceil(top_1); // zoom can give weird floating-point values. rather scroll a little bit further\n if (top_1) {\n top_1 += 1; // to overcome top border that slots beyond the first have. looks better\n }\n onScrollTopRequest(top_1);\n }\n return true;\n }\n return false;\n };\n _this.handleColCoords = function (colCoords) {\n _this.colCoords = colCoords;\n };\n _this.handleSlatCoords = function (slatCoords) {\n _this.setState({ slatCoords: slatCoords });\n if (_this.props.onSlatCoords) {\n _this.props.onSlatCoords(slatCoords);\n }\n };\n return _this;\n }\n TimeCols.prototype.render = function () {\n var _a = this, props = _a.props, state = _a.state;\n return (createElement(\"div\", { className: \"fc-timegrid-body\", ref: this.handleRootEl, style: {\n // these props are important to give this wrapper correct dimensions for interactions\n // TODO: if we set it here, can we avoid giving to inner tables?\n width: props.clientWidth,\n minWidth: props.tableMinWidth,\n } },\n createElement(TimeColsSlats, { axis: props.axis, dateProfile: props.dateProfile, slatMetas: props.slatMetas, clientWidth: props.clientWidth, minHeight: props.expandRows ? props.clientHeight : '', tableMinWidth: props.tableMinWidth, tableColGroupNode: props.axis ? props.tableColGroupNode : null /* axis depends on the colgroup's shrinking */, onCoords: this.handleSlatCoords }),\n createElement(TimeColsContent, { cells: props.cells, axis: props.axis, dateProfile: props.dateProfile, businessHourSegs: props.businessHourSegs, bgEventSegs: props.bgEventSegs, fgEventSegs: props.fgEventSegs, dateSelectionSegs: props.dateSelectionSegs, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, todayRange: props.todayRange, nowDate: props.nowDate, nowIndicatorSegs: props.nowIndicatorSegs, clientWidth: props.clientWidth, tableMinWidth: props.tableMinWidth, tableColGroupNode: props.tableColGroupNode, slatCoords: state.slatCoords, onColCoords: this.handleColCoords, forPrint: props.forPrint })));\n };\n TimeCols.prototype.componentDidMount = function () {\n this.scrollResponder = this.context.createScrollResponder(this.handleScrollRequest);\n };\n TimeCols.prototype.componentDidUpdate = function (prevProps) {\n this.scrollResponder.update(prevProps.dateProfile !== this.props.dateProfile);\n };\n TimeCols.prototype.componentWillUnmount = function () {\n this.scrollResponder.detach();\n };\n TimeCols.prototype.queryHit = function (positionLeft, positionTop) {\n var _a = this.context, dateEnv = _a.dateEnv, options = _a.options;\n var colCoords = this.colCoords;\n var dateProfile = this.props.dateProfile;\n var slatCoords = this.state.slatCoords;\n var _b = this.processSlotOptions(this.props.slotDuration, options.snapDuration), snapDuration = _b.snapDuration, snapsPerSlot = _b.snapsPerSlot;\n var colIndex = colCoords.leftToIndex(positionLeft);\n var slatIndex = slatCoords.positions.topToIndex(positionTop);\n if (colIndex != null && slatIndex != null) {\n var cell = this.props.cells[colIndex];\n var slatTop = slatCoords.positions.tops[slatIndex];\n var slatHeight = slatCoords.positions.getHeight(slatIndex);\n var partial = (positionTop - slatTop) / slatHeight; // floating point number between 0 and 1\n var localSnapIndex = Math.floor(partial * snapsPerSlot); // the snap # relative to start of slat\n var snapIndex = slatIndex * snapsPerSlot + localSnapIndex;\n var dayDate = this.props.cells[colIndex].date;\n var time = addDurations(dateProfile.slotMinTime, multiplyDuration(snapDuration, snapIndex));\n var start = dateEnv.add(dayDate, time);\n var end = dateEnv.add(start, snapDuration);\n return {\n dateProfile: dateProfile,\n dateSpan: __assign({ range: { start: start, end: end }, allDay: false }, cell.extraDateSpan),\n dayEl: colCoords.els[colIndex],\n rect: {\n left: colCoords.lefts[colIndex],\n right: colCoords.rights[colIndex],\n top: slatTop,\n bottom: slatTop + slatHeight,\n },\n layer: 0,\n };\n }\n return null;\n };\n return TimeCols;\n}(DateComponent));\nfunction processSlotOptions(slotDuration, snapDurationOverride) {\n var snapDuration = snapDurationOverride || slotDuration;\n var snapsPerSlot = wholeDivideDurations(slotDuration, snapDuration);\n if (snapsPerSlot === null) {\n snapDuration = slotDuration;\n snapsPerSlot = 1;\n // TODO: say warning?\n }\n return { snapDuration: snapDuration, snapsPerSlot: snapsPerSlot };\n}\n\nvar DayTimeColsSlicer = /** @class */ (function (_super) {\n __extends(DayTimeColsSlicer, _super);\n function DayTimeColsSlicer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DayTimeColsSlicer.prototype.sliceRange = function (range, dayRanges) {\n var segs = [];\n for (var col = 0; col < dayRanges.length; col += 1) {\n var segRange = intersectRanges(range, dayRanges[col]);\n if (segRange) {\n segs.push({\n start: segRange.start,\n end: segRange.end,\n isStart: segRange.start.valueOf() === range.start.valueOf(),\n isEnd: segRange.end.valueOf() === range.end.valueOf(),\n col: col,\n });\n }\n }\n return segs;\n };\n return DayTimeColsSlicer;\n}(Slicer));\n\nvar DayTimeCols = /** @class */ (function (_super) {\n __extends(DayTimeCols, _super);\n function DayTimeCols() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.buildDayRanges = memoize(buildDayRanges);\n _this.slicer = new DayTimeColsSlicer();\n _this.timeColsRef = createRef();\n return _this;\n }\n DayTimeCols.prototype.render = function () {\n var _this = this;\n var _a = this, props = _a.props, context = _a.context;\n var dateProfile = props.dateProfile, dayTableModel = props.dayTableModel;\n var isNowIndicator = context.options.nowIndicator;\n var dayRanges = this.buildDayRanges(dayTableModel, dateProfile, context.dateEnv);\n // give it the first row of cells\n // TODO: would move this further down hierarchy, but sliceNowDate needs it\n return (createElement(NowTimer, { unit: isNowIndicator ? 'minute' : 'day' }, function (nowDate, todayRange) { return (createElement(TimeCols, __assign({ ref: _this.timeColsRef }, _this.slicer.sliceProps(props, dateProfile, null, context, dayRanges), { forPrint: props.forPrint, axis: props.axis, dateProfile: dateProfile, slatMetas: props.slatMetas, slotDuration: props.slotDuration, cells: dayTableModel.cells[0], tableColGroupNode: props.tableColGroupNode, tableMinWidth: props.tableMinWidth, clientWidth: props.clientWidth, clientHeight: props.clientHeight, expandRows: props.expandRows, nowDate: nowDate, nowIndicatorSegs: isNowIndicator && _this.slicer.sliceNowDate(nowDate, context, dayRanges), todayRange: todayRange, onScrollTopRequest: props.onScrollTopRequest, onSlatCoords: props.onSlatCoords }))); }));\n };\n return DayTimeCols;\n}(DateComponent));\nfunction buildDayRanges(dayTableModel, dateProfile, dateEnv) {\n var ranges = [];\n for (var _i = 0, _a = dayTableModel.headerDates; _i < _a.length; _i++) {\n var date = _a[_i];\n ranges.push({\n start: dateEnv.add(date, dateProfile.slotMinTime),\n end: dateEnv.add(date, dateProfile.slotMaxTime),\n });\n }\n return ranges;\n}\n\n// potential nice values for the slot-duration and interval-duration\n// from largest to smallest\nvar STOCK_SUB_DURATIONS = [\n { hours: 1 },\n { minutes: 30 },\n { minutes: 15 },\n { seconds: 30 },\n { seconds: 15 },\n];\nfunction buildSlatMetas(slotMinTime, slotMaxTime, explicitLabelInterval, slotDuration, dateEnv) {\n var dayStart = new Date(0);\n var slatTime = slotMinTime;\n var slatIterator = createDuration(0);\n var labelInterval = explicitLabelInterval || computeLabelInterval(slotDuration);\n var metas = [];\n while (asRoughMs(slatTime) < asRoughMs(slotMaxTime)) {\n var date = dateEnv.add(dayStart, slatTime);\n var isLabeled = wholeDivideDurations(slatIterator, labelInterval) !== null;\n metas.push({\n date: date,\n time: slatTime,\n key: date.toISOString(),\n isoTimeStr: formatIsoTimeString(date),\n isLabeled: isLabeled,\n });\n slatTime = addDurations(slatTime, slotDuration);\n slatIterator = addDurations(slatIterator, slotDuration);\n }\n return metas;\n}\n// Computes an automatic value for slotLabelInterval\nfunction computeLabelInterval(slotDuration) {\n var i;\n var labelInterval;\n var slotsPerLabel;\n // find the smallest stock label interval that results in more than one slots-per-label\n for (i = STOCK_SUB_DURATIONS.length - 1; i >= 0; i -= 1) {\n labelInterval = createDuration(STOCK_SUB_DURATIONS[i]);\n slotsPerLabel = wholeDivideDurations(labelInterval, slotDuration);\n if (slotsPerLabel !== null && slotsPerLabel > 1) {\n return labelInterval;\n }\n }\n return slotDuration; // fall back\n}\n\nvar DayTimeColsView = /** @class */ (function (_super) {\n __extends(DayTimeColsView, _super);\n function DayTimeColsView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.buildTimeColsModel = memoize(buildTimeColsModel);\n _this.buildSlatMetas = memoize(buildSlatMetas);\n return _this;\n }\n DayTimeColsView.prototype.render = function () {\n var _this = this;\n var _a = this.context, options = _a.options, dateEnv = _a.dateEnv, dateProfileGenerator = _a.dateProfileGenerator;\n var props = this.props;\n var dateProfile = props.dateProfile;\n var dayTableModel = this.buildTimeColsModel(dateProfile, dateProfileGenerator);\n var splitProps = this.allDaySplitter.splitProps(props);\n var slatMetas = this.buildSlatMetas(dateProfile.slotMinTime, dateProfile.slotMaxTime, options.slotLabelInterval, options.slotDuration, dateEnv);\n var dayMinWidth = options.dayMinWidth;\n var hasAttachedAxis = !dayMinWidth;\n var hasDetachedAxis = dayMinWidth;\n var headerContent = options.dayHeaders && (createElement(DayHeader, { dates: dayTableModel.headerDates, dateProfile: dateProfile, datesRepDistinctDays: true, renderIntro: hasAttachedAxis ? this.renderHeadAxis : null }));\n var allDayContent = (options.allDaySlot !== false) && (function (contentArg) { return (createElement(DayTable, __assign({}, splitProps.allDay, { dateProfile: dateProfile, dayTableModel: dayTableModel, nextDayThreshold: options.nextDayThreshold, tableMinWidth: contentArg.tableMinWidth, colGroupNode: contentArg.tableColGroupNode, renderRowIntro: hasAttachedAxis ? _this.renderTableRowAxis : null, showWeekNumbers: false, expandRows: false, headerAlignElRef: _this.headerElRef, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, forPrint: props.forPrint }, _this.getAllDayMaxEventProps()))); });\n var timeGridContent = function (contentArg) { return (createElement(DayTimeCols, __assign({}, splitProps.timed, { dayTableModel: dayTableModel, dateProfile: dateProfile, axis: hasAttachedAxis, slotDuration: options.slotDuration, slatMetas: slatMetas, forPrint: props.forPrint, tableColGroupNode: contentArg.tableColGroupNode, tableMinWidth: contentArg.tableMinWidth, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, onSlatCoords: _this.handleSlatCoords, expandRows: contentArg.expandRows, onScrollTopRequest: _this.handleScrollTopRequest }))); };\n return hasDetachedAxis\n ? this.renderHScrollLayout(headerContent, allDayContent, timeGridContent, dayTableModel.colCnt, dayMinWidth, slatMetas, this.state.slatCoords)\n : this.renderSimpleLayout(headerContent, allDayContent, timeGridContent);\n };\n return DayTimeColsView;\n}(TimeColsView));\nfunction buildTimeColsModel(dateProfile, dateProfileGenerator) {\n var daySeries = new DaySeriesModel(dateProfile.renderRange, dateProfileGenerator);\n return new DayTableModel(daySeries, false);\n}\n\nvar OPTION_REFINERS = {\n allDaySlot: Boolean,\n};\n\nvar main = createPlugin({\n initialView: 'timeGridWeek',\n optionRefiners: OPTION_REFINERS,\n views: {\n timeGrid: {\n component: DayTimeColsView,\n usesMinMaxTime: true,\n allDaySlot: true,\n slotDuration: '00:30:00',\n slotEventOverlap: true, // a bad name. confused with overlap/constraint system\n },\n timeGridDay: {\n type: 'timeGrid',\n duration: { days: 1 },\n },\n timeGridWeek: {\n type: 'timeGrid',\n duration: { weeks: 1 },\n },\n },\n});\n\nexport default main;\nexport { DayTimeCols, DayTimeColsSlicer, DayTimeColsView, TimeCols, TimeColsSlatsCoords, TimeColsView, buildDayRanges, buildSlatMetas, buildTimeColsModel };\n//# sourceMappingURL=main.js.map\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar 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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\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\nexport 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}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","/*!\nFullCalendar v5.9.0\nDocs & License: https://fullcalendar.io/\n(c) 2021 Adam Shaw\n*/\nimport './main.css';\n\nimport { getDateMeta, buildNavLinkData, getDayClassNames, createElement, RenderHook, formatDayString, BaseComponent, Fragment, createFormatter, EventRoot, isMultiDayRange, buildSegTimeText, memoize, ViewRoot, Scroller, NowTimer, sortEventSegs, getSegMeta, sliceEventStore, intersectRanges, DateComponent, startOfDay, addDays, identity, createPlugin } from '@fullcalendar/common';\nimport { __extends, __assign } from 'tslib';\n\nvar ListViewHeaderRow = /** @class */ (function (_super) {\n __extends(ListViewHeaderRow, _super);\n function ListViewHeaderRow() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ListViewHeaderRow.prototype.render = function () {\n var _a = this.props, dayDate = _a.dayDate, todayRange = _a.todayRange;\n var _b = this.context, theme = _b.theme, dateEnv = _b.dateEnv, options = _b.options, viewApi = _b.viewApi;\n var dayMeta = getDateMeta(dayDate, todayRange);\n // will ever be falsy?\n var text = options.listDayFormat ? dateEnv.format(dayDate, options.listDayFormat) : '';\n // will ever be falsy? also, BAD NAME \"alt\"\n var sideText = options.listDaySideFormat ? dateEnv.format(dayDate, options.listDaySideFormat) : '';\n var navLinkData = options.navLinks\n ? buildNavLinkData(dayDate)\n : null;\n var hookProps = __assign({ date: dateEnv.toDate(dayDate), view: viewApi, text: text,\n sideText: sideText,\n navLinkData: navLinkData }, dayMeta);\n var classNames = ['fc-list-day'].concat(getDayClassNames(dayMeta, theme));\n // TODO: make a reusable HOC for dayHeader (used in daygrid/timegrid too)\n return (createElement(RenderHook, { hookProps: hookProps, classNames: options.dayHeaderClassNames, content: options.dayHeaderContent, defaultContent: renderInnerContent, didMount: options.dayHeaderDidMount, willUnmount: options.dayHeaderWillUnmount }, function (rootElRef, customClassNames, innerElRef, innerContent) { return (createElement(\"tr\", { ref: rootElRef, className: classNames.concat(customClassNames).join(' '), \"data-date\": formatDayString(dayDate) },\n createElement(\"th\", { colSpan: 3 },\n createElement(\"div\", { className: 'fc-list-day-cushion ' + theme.getClass('tableCellShaded'), ref: innerElRef }, innerContent)))); }));\n };\n return ListViewHeaderRow;\n}(BaseComponent));\nfunction renderInnerContent(props) {\n var navLinkAttrs = props.navLinkData // is there a type for this?\n ? { 'data-navlink': props.navLinkData, tabIndex: 0 }\n : {};\n return (createElement(Fragment, null,\n props.text && (createElement(\"a\", __assign({ className: \"fc-list-day-text\" }, navLinkAttrs), props.text)),\n props.sideText && (createElement(\"a\", __assign({ className: \"fc-list-day-side-text\" }, navLinkAttrs), props.sideText))));\n}\n\nvar DEFAULT_TIME_FORMAT = createFormatter({\n hour: 'numeric',\n minute: '2-digit',\n meridiem: 'short',\n});\nvar ListViewEventRow = /** @class */ (function (_super) {\n __extends(ListViewEventRow, _super);\n function ListViewEventRow() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ListViewEventRow.prototype.render = function () {\n var _a = this, props = _a.props, context = _a.context;\n var seg = props.seg;\n var timeFormat = context.options.eventTimeFormat || DEFAULT_TIME_FORMAT;\n return (createElement(EventRoot, { seg: seg, timeText: \"\" // BAD. because of all-day content\n , disableDragging: true, disableResizing: true, defaultContent: renderEventInnerContent, isPast: props.isPast, isFuture: props.isFuture, isToday: props.isToday, isSelected: props.isSelected, isDragging: props.isDragging, isResizing: props.isResizing, isDateSelecting: props.isDateSelecting }, function (rootElRef, classNames, innerElRef, innerContent, hookProps) { return (createElement(\"tr\", { className: ['fc-list-event', hookProps.event.url ? 'fc-event-forced-url' : ''].concat(classNames).join(' '), ref: rootElRef },\n buildTimeContent(seg, timeFormat, context),\n createElement(\"td\", { className: \"fc-list-event-graphic\" },\n createElement(\"span\", { className: \"fc-list-event-dot\", style: { borderColor: hookProps.borderColor || hookProps.backgroundColor } })),\n createElement(\"td\", { className: \"fc-list-event-title\", ref: innerElRef }, innerContent))); }));\n };\n return ListViewEventRow;\n}(BaseComponent));\nfunction renderEventInnerContent(props) {\n var event = props.event;\n var url = event.url;\n var anchorAttrs = url ? { href: url } : {};\n return (createElement(\"a\", __assign({}, anchorAttrs), event.title));\n}\nfunction buildTimeContent(seg, timeFormat, context) {\n var options = context.options;\n if (options.displayEventTime !== false) {\n var eventDef = seg.eventRange.def;\n var eventInstance = seg.eventRange.instance;\n var doAllDay = false;\n var timeText = void 0;\n if (eventDef.allDay) {\n doAllDay = true;\n }\n else if (isMultiDayRange(seg.eventRange.range)) { // TODO: use (!isStart || !isEnd) instead?\n if (seg.isStart) {\n timeText = buildSegTimeText(seg, timeFormat, context, null, null, eventInstance.range.start, seg.end);\n }\n else if (seg.isEnd) {\n timeText = buildSegTimeText(seg, timeFormat, context, null, null, seg.start, eventInstance.range.end);\n }\n else {\n doAllDay = true;\n }\n }\n else {\n timeText = buildSegTimeText(seg, timeFormat, context);\n }\n if (doAllDay) {\n var hookProps = {\n text: context.options.allDayText,\n view: context.viewApi,\n };\n return (createElement(RenderHook, { hookProps: hookProps, classNames: options.allDayClassNames, content: options.allDayContent, defaultContent: renderAllDayInner, didMount: options.allDayDidMount, willUnmount: options.allDayWillUnmount }, function (rootElRef, classNames, innerElRef, innerContent) { return (createElement(\"td\", { className: ['fc-list-event-time'].concat(classNames).join(' '), ref: rootElRef }, innerContent)); }));\n }\n return (createElement(\"td\", { className: \"fc-list-event-time\" }, timeText));\n }\n return null;\n}\nfunction renderAllDayInner(hookProps) {\n return hookProps.text;\n}\n\n/*\nResponsible for the scroller, and forwarding event-related actions into the \"grid\".\n*/\nvar ListView = /** @class */ (function (_super) {\n __extends(ListView, _super);\n function ListView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.computeDateVars = memoize(computeDateVars);\n _this.eventStoreToSegs = memoize(_this._eventStoreToSegs);\n _this.setRootEl = function (rootEl) {\n if (rootEl) {\n _this.context.registerInteractiveComponent(_this, {\n el: rootEl,\n });\n }\n else {\n _this.context.unregisterInteractiveComponent(_this);\n }\n };\n return _this;\n }\n ListView.prototype.render = function () {\n var _this = this;\n var _a = this, props = _a.props, context = _a.context;\n var extraClassNames = [\n 'fc-list',\n context.theme.getClass('table'),\n context.options.stickyHeaderDates !== false ? 'fc-list-sticky' : '',\n ];\n var _b = this.computeDateVars(props.dateProfile), dayDates = _b.dayDates, dayRanges = _b.dayRanges;\n var eventSegs = this.eventStoreToSegs(props.eventStore, props.eventUiBases, dayRanges);\n return (createElement(ViewRoot, { viewSpec: context.viewSpec, elRef: this.setRootEl }, function (rootElRef, classNames) { return (createElement(\"div\", { ref: rootElRef, className: extraClassNames.concat(classNames).join(' ') },\n createElement(Scroller, { liquid: !props.isHeightAuto, overflowX: props.isHeightAuto ? 'visible' : 'hidden', overflowY: props.isHeightAuto ? 'visible' : 'auto' }, eventSegs.length > 0 ?\n _this.renderSegList(eventSegs, dayDates) :\n _this.renderEmptyMessage()))); }));\n };\n ListView.prototype.renderEmptyMessage = function () {\n var _a = this.context, options = _a.options, viewApi = _a.viewApi;\n var hookProps = {\n text: options.noEventsText,\n view: viewApi,\n };\n return (createElement(RenderHook, { hookProps: hookProps, classNames: options.noEventsClassNames, content: options.noEventsContent, defaultContent: renderNoEventsInner, didMount: options.noEventsDidMount, willUnmount: options.noEventsWillUnmount }, function (rootElRef, classNames, innerElRef, innerContent) { return (createElement(\"div\", { className: ['fc-list-empty'].concat(classNames).join(' '), ref: rootElRef },\n createElement(\"div\", { className: \"fc-list-empty-cushion\", ref: innerElRef }, innerContent))); }));\n };\n ListView.prototype.renderSegList = function (allSegs, dayDates) {\n var _a = this.context, theme = _a.theme, options = _a.options;\n var segsByDay = groupSegsByDay(allSegs); // sparse array\n return (createElement(NowTimer, { unit: \"day\" }, function (nowDate, todayRange) {\n var innerNodes = [];\n for (var dayIndex = 0; dayIndex < segsByDay.length; dayIndex += 1) {\n var daySegs = segsByDay[dayIndex];\n if (daySegs) { // sparse array, so might be undefined\n var dayStr = dayDates[dayIndex].toISOString();\n // append a day header\n innerNodes.push(createElement(ListViewHeaderRow, { key: dayStr, dayDate: dayDates[dayIndex], todayRange: todayRange }));\n daySegs = sortEventSegs(daySegs, options.eventOrder);\n for (var _i = 0, daySegs_1 = daySegs; _i < daySegs_1.length; _i++) {\n var seg = daySegs_1[_i];\n innerNodes.push(createElement(ListViewEventRow, __assign({ key: dayStr + ':' + seg.eventRange.instance.instanceId /* are multiple segs for an instanceId */, seg: seg, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: false }, getSegMeta(seg, todayRange, nowDate))));\n }\n }\n }\n return (createElement(\"table\", { className: 'fc-list-table ' + theme.getClass('table') },\n createElement(\"tbody\", null, innerNodes)));\n }));\n };\n ListView.prototype._eventStoreToSegs = function (eventStore, eventUiBases, dayRanges) {\n return this.eventRangesToSegs(sliceEventStore(eventStore, eventUiBases, this.props.dateProfile.activeRange, this.context.options.nextDayThreshold).fg, dayRanges);\n };\n ListView.prototype.eventRangesToSegs = function (eventRanges, dayRanges) {\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.eventRangeToSegs(eventRange, dayRanges));\n }\n return segs;\n };\n ListView.prototype.eventRangeToSegs = function (eventRange, dayRanges) {\n var dateEnv = this.context.dateEnv;\n var nextDayThreshold = this.context.options.nextDayThreshold;\n var range = eventRange.range;\n var allDay = eventRange.def.allDay;\n var dayIndex;\n var segRange;\n var seg;\n var segs = [];\n for (dayIndex = 0; dayIndex < dayRanges.length; dayIndex += 1) {\n segRange = intersectRanges(range, dayRanges[dayIndex]);\n if (segRange) {\n seg = {\n component: this,\n eventRange: eventRange,\n start: segRange.start,\n end: segRange.end,\n isStart: eventRange.isStart && segRange.start.valueOf() === range.start.valueOf(),\n isEnd: eventRange.isEnd && segRange.end.valueOf() === range.end.valueOf(),\n dayIndex: dayIndex,\n };\n segs.push(seg);\n // detect when range won't go fully into the next day,\n // and mutate the latest seg to the be the end.\n if (!seg.isEnd && !allDay &&\n dayIndex + 1 < dayRanges.length &&\n range.end <\n dateEnv.add(dayRanges[dayIndex + 1].start, nextDayThreshold)) {\n seg.end = range.end;\n seg.isEnd = true;\n break;\n }\n }\n }\n return segs;\n };\n return ListView;\n}(DateComponent));\nfunction renderNoEventsInner(hookProps) {\n return hookProps.text;\n}\nfunction computeDateVars(dateProfile) {\n var dayStart = startOfDay(dateProfile.renderRange.start);\n var viewEnd = dateProfile.renderRange.end;\n var dayDates = [];\n var dayRanges = [];\n while (dayStart < viewEnd) {\n dayDates.push(dayStart);\n dayRanges.push({\n start: dayStart,\n end: addDays(dayStart, 1),\n });\n dayStart = addDays(dayStart, 1);\n }\n return { dayDates: dayDates, dayRanges: dayRanges };\n}\n// Returns a sparse array of arrays, segs grouped by their dayIndex\nfunction groupSegsByDay(segs) {\n var segsByDay = []; // sparse array\n var i;\n var seg;\n for (i = 0; i < segs.length; i += 1) {\n seg = segs[i];\n (segsByDay[seg.dayIndex] || (segsByDay[seg.dayIndex] = []))\n .push(seg);\n }\n return segsByDay;\n}\n\nvar OPTION_REFINERS = {\n listDayFormat: createFalsableFormatter,\n listDaySideFormat: createFalsableFormatter,\n noEventsClassNames: identity,\n noEventsContent: identity,\n noEventsDidMount: identity,\n noEventsWillUnmount: identity,\n // noEventsText is defined in base options\n};\nfunction createFalsableFormatter(input) {\n return input === false ? null : createFormatter(input);\n}\n\nvar main = createPlugin({\n optionRefiners: OPTION_REFINERS,\n views: {\n list: {\n component: ListView,\n buttonTextKey: 'list',\n listDayFormat: { month: 'long', day: 'numeric', year: 'numeric' }, // like \"January 1, 2016\"\n },\n listDay: {\n type: 'list',\n duration: { days: 1 },\n listDayFormat: { weekday: 'long' }, // day-of-week is all we need. full date is probably in headerToolbar\n },\n listWeek: {\n type: 'list',\n duration: { weeks: 1 },\n listDayFormat: { weekday: 'long' },\n listDaySideFormat: { month: 'long', day: 'numeric', year: 'numeric' },\n },\n listMonth: {\n type: 'list',\n duration: { month: 1 },\n listDaySideFormat: { weekday: 'long' }, // day-of-week is nice-to-have\n },\n listYear: {\n type: 'list',\n duration: { year: 1 },\n listDaySideFormat: { weekday: 'long' }, // day-of-week is nice-to-have\n },\n },\n});\n\nexport default main;\nexport { ListView };\n//# sourceMappingURL=main.js.map\n","\r\nimport { defineComponent, onBeforeMount, ref } from \"vue\";\r\nimport FullCalendar, {CalendarOptions,EventApi,} from \"@fullcalendar/vue3\";\r\nimport dayGridPlugin from \"@fullcalendar/daygrid\";\r\nimport timeGridPlugin from \"@fullcalendar/timegrid\";\r\nimport listPlugin from \"@fullcalendar/list\";\r\nimport moment from \"moment\";\r\nimport ApiService from \"@/core/services/ApiService\";\r\n\r\nexport default defineComponent({\r\n name: \"dashboard\",\r\n components: {\r\n FullCalendar\r\n },\r\n props:{\r\n openEditModal : {\r\n type:Function,\r\n default: () => ({}),\r\n },\r\n openShowModal : {\r\n type:Function,\r\n default: () => ({}),\r\n }\r\n },\r\n setup(props) {\r\n const todayDate = moment().startOf(\"day\");\r\n const YM = todayDate.format(\"YYYY-MM\");\r\n const YESTERDAY = todayDate\r\n .clone()\r\n .subtract(1, \"day\")\r\n .format(\"YYYY-MM-DD\");\r\n const TODAY = todayDate.format(\"YYYY-MM-DD\");\r\n const TOMORROW = todayDate\r\n .clone()\r\n .add(1, \"day\")\r\n .format(\"YYYY-MM-DD\");\r\n\r\n const calendarOptions = ref({\r\n plugins: [dayGridPlugin, timeGridPlugin, listPlugin],\r\n headerToolbar: {\r\n left: \"prev,next today\",\r\n center: \"title\",\r\n right:\r\n \"dayGridMonth,timeGridWeek,timeGridDay,listMonth\",\r\n },\r\n\r\n height: 800,\r\n contentHeight: 780,\r\n aspectRatio: 3, // see: https://fullcalendar.io/docs/aspectRatio\r\n\r\n nowIndicator: true,\r\n now: TODAY,\r\n\r\n views: {\r\n dayGridMonth: { buttonText: \"month\" },\r\n timeGridWeek: { buttonText: \"week\" },\r\n timeGridDay: { buttonText: \"day\" },\r\n },\r\n\r\n initialView: \"listMonth\",\r\n initialDate: TODAY,\r\n\r\n dayMaxEvents: true, // allow \"more\" link when too many events\r\n navLinks: true,\r\n eventClick : function(info){\r\n const eventObj = info.event;\r\n if(props.openEditModal.name != 'default'){\r\n props.openEditModal(eventObj.extendedProps.rawData);\r\n }\r\n else if(props.openShowModal.name != 'default'){\r\n props.openShowModal(eventObj.extendedProps.rawData);\r\n }\r\n },\r\n events: [],\r\n });\r\n\r\n const getEvents = async () => {\r\n await new Promise((resolve, reject) => { \r\n ApiService.setHeader(); \r\n ApiService.get(\"event\")\r\n .then(({ data }) => {\r\n var events = data.data.map((x) => { \r\n x.start = moment(x.start_date).format(\"YYYY-MM-DD\"); \r\n x.end = moment(x.end_date).add({ days: 1 }).format(\"YYYY-MM-DD\"); \r\n x.rawData = {...x};\r\n return x;});\r\n calendarOptions.value.events = events;\r\n resolve(data.data);\r\n })\r\n .catch(({ response }) => {\r\n reject(new Error ('getEvents error => '+response.data.errors));\r\n });\r\n });\r\n }\r\n\r\n onBeforeMount(() => {\r\n getEvents();\r\n })\r\n \r\n return {\r\n calendarOptions,\r\n getEvents\r\n }\r\n },\r\n});\r\n","import { render } from \"./Calendar.vue?vue&type=template&id=0b73d9d8\"\nimport script from \"./Calendar.vue?vue&type=script&lang=ts\"\nexport * from \"./Calendar.vue?vue&type=script&lang=ts\"\nscript.render = render\n\nexport default script","import store from \"@/store\";\r\nimport { Actions } from \"@/store/enums/StoreEnums\";\r\n\r\n/**\r\n * Sets current page breadcrumbs\r\n * @param {string} pageTitle Current page title\r\n * @param {Array} breadcrumbs Current page breadcrumbs\r\n */\r\nexport const setCurrentPageBreadcrumbs = (\r\n pageTitle: string,\r\n breadcrumbs: Array\r\n): void => {\r\n store.dispatch(Actions.SET_BREADCRUMB_ACTION, {\r\n title: pageTitle,\r\n pageBreadcrumbPath: breadcrumbs,\r\n });\r\n};\r\n\r\n/**\r\n * Sets current page breadcrumbs\r\n * @param {string} title Current page title name\r\n */\r\nexport const setCurrentPageTitle = (title: string): void => {\r\n store.dispatch(Actions.SET_BREADCRUMB_ACTION, {\r\n title: title,\r\n });\r\n};\r\n"],"sourceRoot":""}