wrapper around the
\n var topEl; // the element we want to match the top coordinate of\n var options;\n if (this.rowCnt === 1) {\n topEl = view.el; // will cause the popover to cover any sort of header\n }\n else {\n topEl = this.rowEls[row]; // will align with top of row\n }\n options = {\n className: 'fc-more-popover ' + theme.getClass('popover'),\n parentEl: view.el,\n top: core.computeRect(topEl).top,\n autoHide: true,\n content: function (el) {\n _this.segPopoverTile = new DayTile(el);\n _this.updateSegPopoverTile(_this.props.cells[row][_col].date, segs);\n },\n hide: function () {\n _this.segPopoverTile.destroy();\n _this.segPopoverTile = null;\n _this.segPopover.destroy();\n _this.segPopover = null;\n }\n };\n // Determine horizontal coordinate.\n // We use the moreWrap instead of the to avoid border confusion.\n if (isRtl) {\n options.right = core.computeRect(moreWrap).right + 1; // +1 to be over cell border\n }\n else {\n options.left = core.computeRect(moreWrap).left - 1; // -1 to be over cell border\n }\n this.segPopover = new Popover(options);\n this.segPopover.show();\n calendar.releaseAfterSizingTriggers(); // hack for eventPositioned\n };\n // Given the events within an array of segment objects, reslice them to be in a single day\n DayGrid.prototype.resliceDaySegs = function (segs, dayDate) {\n var dayStart = dayDate;\n var dayEnd = core.addDays(dayStart, 1);\n var dayRange = { start: dayStart, end: dayEnd };\n var newSegs = [];\n for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {\n var seg = segs_1[_i];\n var eventRange = seg.eventRange;\n var origRange = eventRange.range;\n var slicedRange = core.intersectRanges(origRange, dayRange);\n if (slicedRange) {\n newSegs.push(__assign({}, seg, { eventRange: {\n def: eventRange.def,\n ui: __assign({}, eventRange.ui, { durationEditable: false }),\n instance: eventRange.instance,\n range: slicedRange\n }, isStart: seg.isStart && slicedRange.start.valueOf() === origRange.start.valueOf(), isEnd: seg.isEnd && slicedRange.end.valueOf() === origRange.end.valueOf() }));\n }\n }\n return newSegs;\n };\n // Generates the text that should be inside a \"more\" link, given the number of events it represents\n DayGrid.prototype.getMoreLinkText = function (num) {\n var opt = this.context.options.eventLimitText;\n if (typeof opt === 'function') {\n return opt(num);\n }\n else {\n return '+' + num + ' ' + opt;\n }\n };\n // Returns segments within a given cell.\n // If `startLevel` is specified, returns only events including and below that level. Otherwise returns all segs.\n DayGrid.prototype.getCellSegs = function (row, col, startLevel) {\n var segMatrix = this.eventRenderer.rowStructs[row].segMatrix;\n var level = startLevel || 0;\n var segs = [];\n var seg;\n while (level < segMatrix.length) {\n seg = segMatrix[level][col];\n if (seg) {\n segs.push(seg);\n }\n level++;\n }\n return segs;\n };\n return DayGrid;\n }(core.DateComponent));\n\n var WEEK_NUM_FORMAT$1 = core.createFormatter({ week: 'numeric' });\n /* An abstract class for the daygrid views, as well as month view. Renders one or more rows of day cells.\n ----------------------------------------------------------------------------------------------------------------------*/\n // It is a manager for a DayGrid subcomponent, which does most of the heavy lifting.\n // It is responsible for managing width/height.\n var AbstractDayGridView = /** @class */ (function (_super) {\n __extends(AbstractDayGridView, _super);\n function AbstractDayGridView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.processOptions = core.memoize(_this._processOptions);\n _this.renderSkeleton = core.memoizeRendering(_this._renderSkeleton, _this._unrenderSkeleton);\n /* Header Rendering\n ------------------------------------------------------------------------------------------------------------------*/\n // Generates the HTML that will go before the day-of week header cells\n _this.renderHeadIntroHtml = function () {\n var _a = _this.context, theme = _a.theme, options = _a.options;\n if (_this.colWeekNumbersVisible) {\n return '' +\n ' | ' +\n '' + // needed for matchCellWidths\n core.htmlEscape(options.weekLabel) +\n '' +\n ' | ';\n }\n return '';\n };\n /* Day Grid Rendering\n ------------------------------------------------------------------------------------------------------------------*/\n // Generates the HTML that will go before content-skeleton cells that display the day/week numbers\n _this.renderDayGridNumberIntroHtml = function (row, dayGrid) {\n var _a = _this.context, options = _a.options, dateEnv = _a.dateEnv;\n var weekStart = dayGrid.props.cells[row][0].date;\n if (_this.colWeekNumbersVisible) {\n return '' +\n '
' +\n core.buildGotoAnchorHtml(// aside from link, important for matchCellWidths\n options, dateEnv, { date: weekStart, type: 'week', forceOff: dayGrid.colCnt === 1 }, dateEnv.format(weekStart, WEEK_NUM_FORMAT$1) // inner HTML\n ) +\n ' | ';\n }\n return '';\n };\n // Generates the HTML that goes before the day bg cells for each day-row\n _this.renderDayGridBgIntroHtml = function () {\n var theme = _this.context.theme;\n if (_this.colWeekNumbersVisible) {\n return '
| ';\n }\n return '';\n };\n // Generates the HTML that goes before every other type of row generated by DayGrid.\n // Affects mirror-skeleton and highlight-skeleton rows.\n _this.renderDayGridIntroHtml = function () {\n if (_this.colWeekNumbersVisible) {\n return '
| ';\n }\n return '';\n };\n return _this;\n }\n AbstractDayGridView.prototype._processOptions = function (options) {\n if (options.weekNumbers) {\n if (options.weekNumbersWithinDays) {\n this.cellWeekNumbersVisible = true;\n this.colWeekNumbersVisible = false;\n }\n else {\n this.cellWeekNumbersVisible = false;\n this.colWeekNumbersVisible = true;\n }\n }\n else {\n this.colWeekNumbersVisible = false;\n this.cellWeekNumbersVisible = false;\n }\n };\n AbstractDayGridView.prototype.render = function (props, context) {\n _super.prototype.render.call(this, props, context);\n this.processOptions(context.options);\n this.renderSkeleton(context);\n };\n AbstractDayGridView.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.renderSkeleton.unrender();\n };\n AbstractDayGridView.prototype._renderSkeleton = function (context) {\n this.el.classList.add('fc-dayGrid-view');\n this.el.innerHTML = this.renderSkeletonHtml();\n this.scroller = new core.ScrollComponent('hidden', // overflow x\n 'auto' // overflow y\n );\n var dayGridContainerEl = this.scroller.el;\n this.el.querySelector('.fc-body > tr > td').appendChild(dayGridContainerEl);\n dayGridContainerEl.classList.add('fc-day-grid-container');\n var dayGridEl = core.createElement('div', { className: 'fc-day-grid' });\n dayGridContainerEl.appendChild(dayGridEl);\n this.dayGrid = new DayGrid(dayGridEl, {\n renderNumberIntroHtml: this.renderDayGridNumberIntroHtml,\n renderBgIntroHtml: this.renderDayGridBgIntroHtml,\n renderIntroHtml: this.renderDayGridIntroHtml,\n colWeekNumbersVisible: this.colWeekNumbersVisible,\n cellWeekNumbersVisible: this.cellWeekNumbersVisible\n });\n };\n AbstractDayGridView.prototype._unrenderSkeleton = function () {\n this.el.classList.remove('fc-dayGrid-view');\n this.dayGrid.destroy();\n this.scroller.destroy();\n };\n // Builds the HTML skeleton for the view.\n // The day-grid component will render inside of a container defined by this HTML.\n AbstractDayGridView.prototype.renderSkeletonHtml = function () {\n var _a = this.context, theme = _a.theme, options = _a.options;\n return '' +\n '
' +\n (options.columnHeader ?\n '' +\n '' +\n ' | ' +\n '
' +\n '' :\n '') +\n '' +\n '' +\n ' | ' +\n '
' +\n '' +\n '
';\n };\n // Generates an HTML attribute string for setting the width of the week number column, if it is known\n AbstractDayGridView.prototype.weekNumberStyleAttr = function () {\n if (this.weekNumberWidth != null) {\n return 'style=\"width:' + this.weekNumberWidth + 'px\"';\n }\n return '';\n };\n // Determines whether each row should have a constant height\n AbstractDayGridView.prototype.hasRigidRows = function () {\n var eventLimit = this.context.options.eventLimit;\n return eventLimit && typeof eventLimit !== 'number';\n };\n /* Dimensions\n ------------------------------------------------------------------------------------------------------------------*/\n AbstractDayGridView.prototype.updateSize = function (isResize, viewHeight, isAuto) {\n _super.prototype.updateSize.call(this, isResize, viewHeight, isAuto); // will call updateBaseSize. important that executes first\n this.dayGrid.updateSize(isResize);\n };\n // Refreshes the horizontal dimensions of the view\n AbstractDayGridView.prototype.updateBaseSize = function (isResize, viewHeight, isAuto) {\n var dayGrid = this.dayGrid;\n var eventLimit = this.context.options.eventLimit;\n var headRowEl = this.header ? this.header.el : null; // HACK\n var scrollerHeight;\n var scrollbarWidths;\n // hack to give the view some height prior to dayGrid's columns being rendered\n // TODO: separate setting height from scroller VS dayGrid.\n if (!dayGrid.rowEls) {\n if (!isAuto) {\n scrollerHeight = this.computeScrollerHeight(viewHeight);\n this.scroller.setHeight(scrollerHeight);\n }\n return;\n }\n if (this.colWeekNumbersVisible) {\n // Make sure all week number cells running down the side have the same width.\n this.weekNumberWidth = core.matchCellWidths(core.findElements(this.el, '.fc-week-number'));\n }\n // reset all heights to be natural\n this.scroller.clear();\n if (headRowEl) {\n core.uncompensateScroll(headRowEl);\n }\n dayGrid.removeSegPopover(); // kill the \"more\" popover if displayed\n // is the event limit a constant level number?\n if (eventLimit && typeof eventLimit === 'number') {\n dayGrid.limitRows(eventLimit); // limit the levels first so the height can redistribute after\n }\n // distribute the height to the rows\n // (viewHeight is a \"recommended\" value if isAuto)\n scrollerHeight = this.computeScrollerHeight(viewHeight);\n this.setGridHeight(scrollerHeight, isAuto);\n // is the event limit dynamically calculated?\n if (eventLimit && typeof eventLimit !== 'number') {\n dayGrid.limitRows(eventLimit); // limit the levels after the grid's row heights have been set\n }\n if (!isAuto) { // should we force dimensions of the scroll container?\n this.scroller.setHeight(scrollerHeight);\n scrollbarWidths = this.scroller.getScrollbarWidths();\n if (scrollbarWidths.left || scrollbarWidths.right) { // using scrollbars?\n if (headRowEl) {\n core.compensateScroll(headRowEl, scrollbarWidths);\n }\n // doing the scrollbar compensation might have created text overflow which created more height. redo\n scrollerHeight = this.computeScrollerHeight(viewHeight);\n this.scroller.setHeight(scrollerHeight);\n }\n // guarantees the same scrollbar widths\n this.scroller.lockOverflow(scrollbarWidths);\n }\n };\n // given a desired total height of the view, returns what the height of the scroller should be\n AbstractDayGridView.prototype.computeScrollerHeight = function (viewHeight) {\n return viewHeight -\n core.subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller\n };\n // Sets the height of just the DayGrid component in this view\n AbstractDayGridView.prototype.setGridHeight = function (height, isAuto) {\n if (this.context.options.monthMode) {\n // if auto, make the height of each row the height that it would be if there were 6 weeks\n if (isAuto) {\n height *= this.dayGrid.rowCnt / 6;\n }\n core.distributeHeight(this.dayGrid.rowEls, height, !isAuto); // if auto, don't compensate for height-hogging rows\n }\n else {\n if (isAuto) {\n core.undistributeHeight(this.dayGrid.rowEls); // let the rows be their natural height with no expanding\n }\n else {\n core.distributeHeight(this.dayGrid.rowEls, height, true); // true = compensate for height-hogging rows\n }\n }\n };\n /* Scroll\n ------------------------------------------------------------------------------------------------------------------*/\n AbstractDayGridView.prototype.computeDateScroll = function (duration) {\n return { top: 0 };\n };\n AbstractDayGridView.prototype.queryDateScroll = function () {\n return { top: this.scroller.getScrollTop() };\n };\n AbstractDayGridView.prototype.applyDateScroll = function (scroll) {\n if (scroll.top !== undefined) {\n this.scroller.setScrollTop(scroll.top);\n }\n };\n return AbstractDayGridView;\n }(core.View));\n AbstractDayGridView.prototype.dateProfileGeneratorClass = DayGridDateProfileGenerator;\n\n var SimpleDayGrid = /** @class */ (function (_super) {\n __extends(SimpleDayGrid, _super);\n function SimpleDayGrid(dayGrid) {\n var _this = _super.call(this, dayGrid.el) || this;\n _this.slicer = new DayGridSlicer();\n _this.dayGrid = dayGrid;\n return _this;\n }\n SimpleDayGrid.prototype.firstContext = function (context) {\n context.calendar.registerInteractiveComponent(this, { el: this.dayGrid.el });\n };\n SimpleDayGrid.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.context.calendar.unregisterInteractiveComponent(this);\n };\n SimpleDayGrid.prototype.render = function (props, context) {\n var dayGrid = this.dayGrid;\n var dateProfile = props.dateProfile, dayTable = props.dayTable;\n dayGrid.receiveContext(context); // hack because context is used in sliceProps\n dayGrid.receiveProps(__assign({}, this.slicer.sliceProps(props, dateProfile, props.nextDayThreshold, context.calendar, dayGrid, dayTable), { dateProfile: dateProfile, cells: dayTable.cells, isRigid: props.isRigid }), context);\n };\n SimpleDayGrid.prototype.buildPositionCaches = function () {\n this.dayGrid.buildPositionCaches();\n };\n SimpleDayGrid.prototype.queryHit = function (positionLeft, positionTop) {\n var rawHit = this.dayGrid.positionToHit(positionLeft, positionTop);\n if (rawHit) {\n return {\n component: this.dayGrid,\n dateSpan: rawHit.dateSpan,\n dayEl: rawHit.dayEl,\n rect: {\n left: rawHit.relativeRect.left,\n right: rawHit.relativeRect.right,\n top: rawHit.relativeRect.top,\n bottom: rawHit.relativeRect.bottom\n },\n layer: 0\n };\n }\n };\n return SimpleDayGrid;\n }(core.DateComponent));\n var DayGridSlicer = /** @class */ (function (_super) {\n __extends(DayGridSlicer, _super);\n function DayGridSlicer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n DayGridSlicer.prototype.sliceRange = function (dateRange, dayTable) {\n return dayTable.sliceRange(dateRange);\n };\n return DayGridSlicer;\n }(core.Slicer));\n\n var DayGridView = /** @class */ (function (_super) {\n __extends(DayGridView, _super);\n function DayGridView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.buildDayTable = core.memoize(buildDayTable);\n return _this;\n }\n DayGridView.prototype.render = function (props, context) {\n _super.prototype.render.call(this, props, context); // will call _renderSkeleton/_unrenderSkeleton\n var dateProfile = this.props.dateProfile;\n var dayTable = this.dayTable =\n this.buildDayTable(dateProfile, props.dateProfileGenerator);\n if (this.header) {\n this.header.receiveProps({\n dateProfile: dateProfile,\n dates: dayTable.headerDates,\n datesRepDistinctDays: dayTable.rowCnt === 1,\n renderIntroHtml: this.renderHeadIntroHtml\n }, context);\n }\n this.simpleDayGrid.receiveProps({\n dateProfile: dateProfile,\n dayTable: dayTable,\n businessHours: props.businessHours,\n dateSelection: props.dateSelection,\n eventStore: props.eventStore,\n eventUiBases: props.eventUiBases,\n eventSelection: props.eventSelection,\n eventDrag: props.eventDrag,\n eventResize: props.eventResize,\n isRigid: this.hasRigidRows(),\n nextDayThreshold: this.context.nextDayThreshold\n }, context);\n };\n DayGridView.prototype._renderSkeleton = function (context) {\n _super.prototype._renderSkeleton.call(this, context);\n if (context.options.columnHeader) {\n this.header = new core.DayHeader(this.el.querySelector('.fc-head-container'));\n }\n this.simpleDayGrid = new SimpleDayGrid(this.dayGrid);\n };\n DayGridView.prototype._unrenderSkeleton = function () {\n _super.prototype._unrenderSkeleton.call(this);\n if (this.header) {\n this.header.destroy();\n }\n this.simpleDayGrid.destroy();\n };\n return DayGridView;\n }(AbstractDayGridView));\n function buildDayTable(dateProfile, dateProfileGenerator) {\n var daySeries = new core.DaySeries(dateProfile.renderRange, dateProfileGenerator);\n return new core.DayTable(daySeries, /year|month|week/.test(dateProfile.currentRangeUnit));\n }\n\n var main = core.createPlugin({\n defaultView: 'dayGridMonth',\n views: {\n dayGrid: DayGridView,\n dayGridDay: {\n type: 'dayGrid',\n duration: { days: 1 }\n },\n dayGridWeek: {\n type: 'dayGrid',\n duration: { weeks: 1 }\n },\n dayGridMonth: {\n type: 'dayGrid',\n duration: { months: 1 },\n monthMode: true,\n fixedWeekCount: true\n }\n }\n });\n\n exports.AbstractDayGridView = AbstractDayGridView;\n exports.DayBgRow = DayBgRow;\n exports.DayGrid = DayGrid;\n exports.DayGridSlicer = DayGridSlicer;\n exports.DayGridView = DayGridView;\n exports.SimpleDayGrid = SimpleDayGrid;\n exports.buildBasicDayTable = buildDayTable;\n exports.default = main;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","/*!\nFullCalendar Google Calendar Plugin v4.4.2\nDocs & License: https://fullcalendar.io/\n(c) 2019 Adam Shaw\n*/\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@fullcalendar/core')) :\n typeof define === 'function' && define.amd ? define(['exports', '@fullcalendar/core'], factory) :\n (global = global || self, factory(global.FullCalendarGoogleCalendar = {}, global.FullCalendar));\n}(this, function (exports, core) { 'use strict';\n\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation.\r\n\r\n Permission to use, copy, modify, and/or distribute this software for any\r\n purpose with or without fee is hereby granted.\r\n\r\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\n AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\n LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\n OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\n PERFORMANCE OF THIS SOFTWARE.\r\n ***************************************************************************** */\r\n\r\n var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n };\n\n // TODO: expose somehow\n var API_BASE = 'https://www.googleapis.com/calendar/v3/calendars';\n var STANDARD_PROPS = {\n url: String,\n googleCalendarApiKey: String,\n googleCalendarId: String,\n googleCalendarApiBase: String,\n data: null\n };\n var eventSourceDef = {\n parseMeta: function (raw) {\n if (typeof raw === 'string') {\n raw = { url: raw };\n }\n if (typeof raw === 'object') {\n var standardProps = core.refineProps(raw, STANDARD_PROPS);\n if (!standardProps.googleCalendarId && standardProps.url) {\n standardProps.googleCalendarId = parseGoogleCalendarId(standardProps.url);\n }\n delete standardProps.url;\n if (standardProps.googleCalendarId) {\n return standardProps;\n }\n }\n return null;\n },\n fetch: function (arg, onSuccess, onFailure) {\n var calendar = arg.calendar;\n var meta = arg.eventSource.meta;\n var apiKey = meta.googleCalendarApiKey || calendar.opt('googleCalendarApiKey');\n if (!apiKey) {\n onFailure({\n message: 'Specify a googleCalendarApiKey. See http://fullcalendar.io/docs/google_calendar/'\n });\n }\n else {\n var url = buildUrl(meta);\n var requestParams_1 = buildRequestParams(arg.range, apiKey, meta.data, calendar.dateEnv);\n core.requestJson('GET', url, requestParams_1, function (body, xhr) {\n if (body.error) {\n onFailure({\n message: 'Google Calendar API: ' + body.error.message,\n errors: body.error.errors,\n xhr: xhr\n });\n }\n else {\n onSuccess({\n rawEvents: gcalItemsToRawEventDefs(body.items, requestParams_1.timeZone),\n xhr: xhr\n });\n }\n }, function (message, xhr) {\n onFailure({ message: message, xhr: xhr });\n });\n }\n }\n };\n function parseGoogleCalendarId(url) {\n var match;\n // detect if the ID was specified as a single string.\n // will match calendars like \"asdf1234@calendar.google.com\" in addition to person email calendars.\n if (/^[^\\/]+@([^\\/\\.]+\\.)*(google|googlemail|gmail)\\.com$/.test(url)) {\n return url;\n }\n else if ((match = /^https:\\/\\/www.googleapis.com\\/calendar\\/v3\\/calendars\\/([^\\/]*)/.exec(url)) ||\n (match = /^https?:\\/\\/www.google.com\\/calendar\\/feeds\\/([^\\/]*)/.exec(url))) {\n return decodeURIComponent(match[1]);\n }\n }\n function buildUrl(meta) {\n var apiBase = meta.googleCalendarApiBase;\n if (!apiBase) {\n apiBase = API_BASE;\n }\n return apiBase + '/' + encodeURIComponent(meta.googleCalendarId) + '/events';\n }\n function buildRequestParams(range, apiKey, extraParams, dateEnv) {\n var params;\n var startStr;\n var endStr;\n if (dateEnv.canComputeOffset) {\n // strings will naturally have offsets, which GCal needs\n startStr = dateEnv.formatIso(range.start);\n endStr = dateEnv.formatIso(range.end);\n }\n else {\n // when timezone isn't known, we don't know what the UTC offset should be, so ask for +/- 1 day\n // from the UTC day-start to guarantee we're getting all the events\n // (start/end will be UTC-coerced dates, so toISOString is okay)\n startStr = core.addDays(range.start, -1).toISOString();\n endStr = core.addDays(range.end, 1).toISOString();\n }\n params = __assign({}, (extraParams || {}), { key: apiKey, timeMin: startStr, timeMax: endStr, singleEvents: true, maxResults: 9999 });\n if (dateEnv.timeZone !== 'local') {\n params.timeZone = dateEnv.timeZone;\n }\n return params;\n }\n function gcalItemsToRawEventDefs(items, gcalTimezone) {\n return items.map(function (item) {\n return gcalItemToRawEventDef(item, gcalTimezone);\n });\n }\n function gcalItemToRawEventDef(item, gcalTimezone) {\n var url = item.htmlLink || null;\n // make the URLs for each event show times in the correct timezone\n if (url && gcalTimezone) {\n url = injectQsComponent(url, 'ctz=' + gcalTimezone);\n }\n return {\n id: item.id,\n title: item.summary,\n start: item.start.dateTime || item.start.date,\n end: item.end.dateTime || item.end.date,\n url: url,\n location: item.location,\n description: item.description\n };\n }\n // Injects a string like \"arg=value\" into the querystring of a URL\n // TODO: move to a general util file?\n function injectQsComponent(url, component) {\n // inject it after the querystring but before the fragment\n return url.replace(/(\\?.*?)?(#|$)/, function (whole, qs, hash) {\n return (qs ? qs + '&' : '?') + component + hash;\n });\n }\n var main = core.createPlugin({\n eventSourceDefs: [eventSourceDef]\n });\n\n exports.default = main;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","/*!\nFullCalendar Interaction Plugin v4.4.2\nDocs & License: https://fullcalendar.io/\n(c) 2019 Adam Shaw\n*/\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@fullcalendar/core')) :\n typeof define === 'function' && define.amd ? define(['exports', '@fullcalendar/core'], factory) :\n (global = global || self, factory(global.FullCalendarInteraction = {}, global.FullCalendar));\n}(this, function (exports, core) { 'use strict';\n\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation.\r\n\r\n Permission to use, copy, modify, and/or distribute this software for any\r\n purpose with or without fee is hereby granted.\r\n\r\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\n AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\n LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\n OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\n PERFORMANCE OF THIS SOFTWARE.\r\n ***************************************************************************** */\r\n /* global Reflect, Promise */\r\n\r\n var extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n\r\n function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n }\r\n\r\n var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n };\n\n core.config.touchMouseIgnoreWait = 500;\n var ignoreMouseDepth = 0;\n var listenerCnt = 0;\n var isWindowTouchMoveCancelled = false;\n /*\n Uses a \"pointer\" abstraction, which monitors UI events for both mouse and touch.\n Tracks when the pointer \"drags\" on a certain element, meaning down+move+up.\n\n Also, tracks if there was touch-scrolling.\n Also, can prevent touch-scrolling from happening.\n Also, can fire pointermove events when scrolling happens underneath, even when no real pointer movement.\n\n emits:\n - pointerdown\n - pointermove\n - pointerup\n */\n var PointerDragging = /** @class */ (function () {\n function PointerDragging(containerEl) {\n var _this = this;\n this.subjectEl = null;\n this.downEl = null;\n // options that can be directly assigned by caller\n this.selector = ''; // will cause subjectEl in all emitted events to be this element\n this.handleSelector = '';\n this.shouldIgnoreMove = false;\n this.shouldWatchScroll = true; // for simulating pointermove on scroll\n // internal states\n this.isDragging = false;\n this.isTouchDragging = false;\n this.wasTouchScroll = false;\n // Mouse\n // ----------------------------------------------------------------------------------------------------\n this.handleMouseDown = function (ev) {\n if (!_this.shouldIgnoreMouse() &&\n isPrimaryMouseButton(ev) &&\n _this.tryStart(ev)) {\n var pev = _this.createEventFromMouse(ev, true);\n _this.emitter.trigger('pointerdown', pev);\n _this.initScrollWatch(pev);\n if (!_this.shouldIgnoreMove) {\n document.addEventListener('mousemove', _this.handleMouseMove);\n }\n document.addEventListener('mouseup', _this.handleMouseUp);\n }\n };\n this.handleMouseMove = function (ev) {\n var pev = _this.createEventFromMouse(ev);\n _this.recordCoords(pev);\n _this.emitter.trigger('pointermove', pev);\n };\n this.handleMouseUp = function (ev) {\n document.removeEventListener('mousemove', _this.handleMouseMove);\n document.removeEventListener('mouseup', _this.handleMouseUp);\n _this.emitter.trigger('pointerup', _this.createEventFromMouse(ev));\n _this.cleanup(); // call last so that pointerup has access to props\n };\n // Touch\n // ----------------------------------------------------------------------------------------------------\n this.handleTouchStart = function (ev) {\n if (_this.tryStart(ev)) {\n _this.isTouchDragging = true;\n var pev = _this.createEventFromTouch(ev, true);\n _this.emitter.trigger('pointerdown', pev);\n _this.initScrollWatch(pev);\n // unlike mouse, need to attach to target, not document\n // https://stackoverflow.com/a/45760014\n var target = ev.target;\n if (!_this.shouldIgnoreMove) {\n target.addEventListener('touchmove', _this.handleTouchMove);\n }\n target.addEventListener('touchend', _this.handleTouchEnd);\n target.addEventListener('touchcancel', _this.handleTouchEnd); // treat it as a touch end\n // attach a handler to get called when ANY scroll action happens on the page.\n // this was impossible to do with normal on/off because 'scroll' doesn't bubble.\n // http://stackoverflow.com/a/32954565/96342\n window.addEventListener('scroll', _this.handleTouchScroll, true // useCapture\n );\n }\n };\n this.handleTouchMove = function (ev) {\n var pev = _this.createEventFromTouch(ev);\n _this.recordCoords(pev);\n _this.emitter.trigger('pointermove', pev);\n };\n this.handleTouchEnd = function (ev) {\n if (_this.isDragging) { // done to guard against touchend followed by touchcancel\n var target = ev.target;\n target.removeEventListener('touchmove', _this.handleTouchMove);\n target.removeEventListener('touchend', _this.handleTouchEnd);\n target.removeEventListener('touchcancel', _this.handleTouchEnd);\n window.removeEventListener('scroll', _this.handleTouchScroll, true); // useCaptured=true\n _this.emitter.trigger('pointerup', _this.createEventFromTouch(ev));\n _this.cleanup(); // call last so that pointerup has access to props\n _this.isTouchDragging = false;\n startIgnoringMouse();\n }\n };\n this.handleTouchScroll = function () {\n _this.wasTouchScroll = true;\n };\n this.handleScroll = function (ev) {\n if (!_this.shouldIgnoreMove) {\n var pageX = (window.pageXOffset - _this.prevScrollX) + _this.prevPageX;\n var pageY = (window.pageYOffset - _this.prevScrollY) + _this.prevPageY;\n _this.emitter.trigger('pointermove', {\n origEvent: ev,\n isTouch: _this.isTouchDragging,\n subjectEl: _this.subjectEl,\n pageX: pageX,\n pageY: pageY,\n deltaX: pageX - _this.origPageX,\n deltaY: pageY - _this.origPageY\n });\n }\n };\n this.containerEl = containerEl;\n this.emitter = new core.EmitterMixin();\n containerEl.addEventListener('mousedown', this.handleMouseDown);\n containerEl.addEventListener('touchstart', this.handleTouchStart, { passive: true });\n listenerCreated();\n }\n PointerDragging.prototype.destroy = function () {\n this.containerEl.removeEventListener('mousedown', this.handleMouseDown);\n this.containerEl.removeEventListener('touchstart', this.handleTouchStart, { passive: true });\n listenerDestroyed();\n };\n PointerDragging.prototype.tryStart = function (ev) {\n var subjectEl = this.querySubjectEl(ev);\n var downEl = ev.target;\n if (subjectEl &&\n (!this.handleSelector || core.elementClosest(downEl, this.handleSelector))) {\n this.subjectEl = subjectEl;\n this.downEl = downEl;\n this.isDragging = true; // do this first so cancelTouchScroll will work\n this.wasTouchScroll = false;\n return true;\n }\n return false;\n };\n PointerDragging.prototype.cleanup = function () {\n isWindowTouchMoveCancelled = false;\n this.isDragging = false;\n this.subjectEl = null;\n this.downEl = null;\n // keep wasTouchScroll around for later access\n this.destroyScrollWatch();\n };\n PointerDragging.prototype.querySubjectEl = function (ev) {\n if (this.selector) {\n return core.elementClosest(ev.target, this.selector);\n }\n else {\n return this.containerEl;\n }\n };\n PointerDragging.prototype.shouldIgnoreMouse = function () {\n return ignoreMouseDepth || this.isTouchDragging;\n };\n // can be called by user of this class, to cancel touch-based scrolling for the current drag\n PointerDragging.prototype.cancelTouchScroll = function () {\n if (this.isDragging) {\n isWindowTouchMoveCancelled = true;\n }\n };\n // Scrolling that simulates pointermoves\n // ----------------------------------------------------------------------------------------------------\n PointerDragging.prototype.initScrollWatch = function (ev) {\n if (this.shouldWatchScroll) {\n this.recordCoords(ev);\n window.addEventListener('scroll', this.handleScroll, true); // useCapture=true\n }\n };\n PointerDragging.prototype.recordCoords = function (ev) {\n if (this.shouldWatchScroll) {\n this.prevPageX = ev.pageX;\n this.prevPageY = ev.pageY;\n this.prevScrollX = window.pageXOffset;\n this.prevScrollY = window.pageYOffset;\n }\n };\n PointerDragging.prototype.destroyScrollWatch = function () {\n if (this.shouldWatchScroll) {\n window.removeEventListener('scroll', this.handleScroll, true); // useCaptured=true\n }\n };\n // Event Normalization\n // ----------------------------------------------------------------------------------------------------\n PointerDragging.prototype.createEventFromMouse = function (ev, isFirst) {\n var deltaX = 0;\n var deltaY = 0;\n // TODO: repeat code\n if (isFirst) {\n this.origPageX = ev.pageX;\n this.origPageY = ev.pageY;\n }\n else {\n deltaX = ev.pageX - this.origPageX;\n deltaY = ev.pageY - this.origPageY;\n }\n return {\n origEvent: ev,\n isTouch: false,\n subjectEl: this.subjectEl,\n pageX: ev.pageX,\n pageY: ev.pageY,\n deltaX: deltaX,\n deltaY: deltaY\n };\n };\n PointerDragging.prototype.createEventFromTouch = function (ev, isFirst) {\n var touches = ev.touches;\n var pageX;\n var pageY;\n var deltaX = 0;\n var deltaY = 0;\n // if touch coords available, prefer,\n // because FF would give bad ev.pageX ev.pageY\n if (touches && touches.length) {\n pageX = touches[0].pageX;\n pageY = touches[0].pageY;\n }\n else {\n pageX = ev.pageX;\n pageY = ev.pageY;\n }\n // TODO: repeat code\n if (isFirst) {\n this.origPageX = pageX;\n this.origPageY = pageY;\n }\n else {\n deltaX = pageX - this.origPageX;\n deltaY = pageY - this.origPageY;\n }\n return {\n origEvent: ev,\n isTouch: true,\n subjectEl: this.subjectEl,\n pageX: pageX,\n pageY: pageY,\n deltaX: deltaX,\n deltaY: deltaY\n };\n };\n return PointerDragging;\n }());\n // Returns a boolean whether this was a left mouse click and no ctrl key (which means right click on Mac)\n function isPrimaryMouseButton(ev) {\n return ev.button === 0 && !ev.ctrlKey;\n }\n // Ignoring fake mouse events generated by touch\n // ----------------------------------------------------------------------------------------------------\n function startIgnoringMouse() {\n ignoreMouseDepth++;\n setTimeout(function () {\n ignoreMouseDepth--;\n }, core.config.touchMouseIgnoreWait);\n }\n // We want to attach touchmove as early as possible for Safari\n // ----------------------------------------------------------------------------------------------------\n function listenerCreated() {\n if (!(listenerCnt++)) {\n window.addEventListener('touchmove', onWindowTouchMove, { passive: false });\n }\n }\n function listenerDestroyed() {\n if (!(--listenerCnt)) {\n window.removeEventListener('touchmove', onWindowTouchMove, { passive: false });\n }\n }\n function onWindowTouchMove(ev) {\n if (isWindowTouchMoveCancelled) {\n ev.preventDefault();\n }\n }\n\n /*\n An effect in which an element follows the movement of a pointer across the screen.\n The moving element is a clone of some other element.\n Must call start + handleMove + stop.\n */\n var ElementMirror = /** @class */ (function () {\n function ElementMirror() {\n this.isVisible = false; // must be explicitly enabled\n this.sourceEl = null;\n this.mirrorEl = null;\n this.sourceElRect = null; // screen coords relative to viewport\n // options that can be set directly by caller\n this.parentNode = document.body;\n this.zIndex = 9999;\n this.revertDuration = 0;\n }\n ElementMirror.prototype.start = function (sourceEl, pageX, pageY) {\n this.sourceEl = sourceEl;\n this.sourceElRect = this.sourceEl.getBoundingClientRect();\n this.origScreenX = pageX - window.pageXOffset;\n this.origScreenY = pageY - window.pageYOffset;\n this.deltaX = 0;\n this.deltaY = 0;\n this.updateElPosition();\n };\n ElementMirror.prototype.handleMove = function (pageX, pageY) {\n this.deltaX = (pageX - window.pageXOffset) - this.origScreenX;\n this.deltaY = (pageY - window.pageYOffset) - this.origScreenY;\n this.updateElPosition();\n };\n // can be called before start\n ElementMirror.prototype.setIsVisible = function (bool) {\n if (bool) {\n if (!this.isVisible) {\n if (this.mirrorEl) {\n this.mirrorEl.style.display = '';\n }\n this.isVisible = bool; // needs to happen before updateElPosition\n this.updateElPosition(); // because was not updating the position while invisible\n }\n }\n else {\n if (this.isVisible) {\n if (this.mirrorEl) {\n this.mirrorEl.style.display = 'none';\n }\n this.isVisible = bool;\n }\n }\n };\n // always async\n ElementMirror.prototype.stop = function (needsRevertAnimation, callback) {\n var _this = this;\n var done = function () {\n _this.cleanup();\n callback();\n };\n if (needsRevertAnimation &&\n this.mirrorEl &&\n this.isVisible &&\n this.revertDuration && // if 0, transition won't work\n (this.deltaX || this.deltaY) // if same coords, transition won't work\n ) {\n this.doRevertAnimation(done, this.revertDuration);\n }\n else {\n setTimeout(done, 0);\n }\n };\n ElementMirror.prototype.doRevertAnimation = function (callback, revertDuration) {\n var mirrorEl = this.mirrorEl;\n var finalSourceElRect = this.sourceEl.getBoundingClientRect(); // because autoscrolling might have happened\n mirrorEl.style.transition =\n 'top ' + revertDuration + 'ms,' +\n 'left ' + revertDuration + 'ms';\n core.applyStyle(mirrorEl, {\n left: finalSourceElRect.left,\n top: finalSourceElRect.top\n });\n core.whenTransitionDone(mirrorEl, function () {\n mirrorEl.style.transition = '';\n callback();\n });\n };\n ElementMirror.prototype.cleanup = function () {\n if (this.mirrorEl) {\n core.removeElement(this.mirrorEl);\n this.mirrorEl = null;\n }\n this.sourceEl = null;\n };\n ElementMirror.prototype.updateElPosition = function () {\n if (this.sourceEl && this.isVisible) {\n core.applyStyle(this.getMirrorEl(), {\n left: this.sourceElRect.left + this.deltaX,\n top: this.sourceElRect.top + this.deltaY\n });\n }\n };\n ElementMirror.prototype.getMirrorEl = function () {\n var sourceElRect = this.sourceElRect;\n var mirrorEl = this.mirrorEl;\n if (!mirrorEl) {\n mirrorEl = this.mirrorEl = this.sourceEl.cloneNode(true); // cloneChildren=true\n // we don't want long taps or any mouse interaction causing selection/menus.\n // would use preventSelection(), but that prevents selectstart, causing problems.\n mirrorEl.classList.add('fc-unselectable');\n mirrorEl.classList.add('fc-dragging');\n core.applyStyle(mirrorEl, {\n position: 'fixed',\n zIndex: this.zIndex,\n visibility: '',\n boxSizing: 'border-box',\n width: sourceElRect.right - sourceElRect.left,\n height: sourceElRect.bottom - sourceElRect.top,\n right: 'auto',\n bottom: 'auto',\n margin: 0\n });\n this.parentNode.appendChild(mirrorEl);\n }\n return mirrorEl;\n };\n return ElementMirror;\n }());\n\n /*\n Is a cache for a given element's scroll information (all the info that ScrollController stores)\n in addition the \"client rectangle\" of the element.. the area within the scrollbars.\n\n The cache can be in one of two modes:\n - doesListening:false - ignores when the container is scrolled by someone else\n - doesListening:true - watch for scrolling and update the cache\n */\n var ScrollGeomCache = /** @class */ (function (_super) {\n __extends(ScrollGeomCache, _super);\n function ScrollGeomCache(scrollController, doesListening) {\n var _this = _super.call(this) || this;\n _this.handleScroll = function () {\n _this.scrollTop = _this.scrollController.getScrollTop();\n _this.scrollLeft = _this.scrollController.getScrollLeft();\n _this.handleScrollChange();\n };\n _this.scrollController = scrollController;\n _this.doesListening = doesListening;\n _this.scrollTop = _this.origScrollTop = scrollController.getScrollTop();\n _this.scrollLeft = _this.origScrollLeft = scrollController.getScrollLeft();\n _this.scrollWidth = scrollController.getScrollWidth();\n _this.scrollHeight = scrollController.getScrollHeight();\n _this.clientWidth = scrollController.getClientWidth();\n _this.clientHeight = scrollController.getClientHeight();\n _this.clientRect = _this.computeClientRect(); // do last in case it needs cached values\n if (_this.doesListening) {\n _this.getEventTarget().addEventListener('scroll', _this.handleScroll);\n }\n return _this;\n }\n ScrollGeomCache.prototype.destroy = function () {\n if (this.doesListening) {\n this.getEventTarget().removeEventListener('scroll', this.handleScroll);\n }\n };\n ScrollGeomCache.prototype.getScrollTop = function () {\n return this.scrollTop;\n };\n ScrollGeomCache.prototype.getScrollLeft = function () {\n return this.scrollLeft;\n };\n ScrollGeomCache.prototype.setScrollTop = function (top) {\n this.scrollController.setScrollTop(top);\n if (!this.doesListening) {\n // we are not relying on the element to normalize out-of-bounds scroll values\n // so we need to sanitize ourselves\n this.scrollTop = Math.max(Math.min(top, this.getMaxScrollTop()), 0);\n this.handleScrollChange();\n }\n };\n ScrollGeomCache.prototype.setScrollLeft = function (top) {\n this.scrollController.setScrollLeft(top);\n if (!this.doesListening) {\n // we are not relying on the element to normalize out-of-bounds scroll values\n // so we need to sanitize ourselves\n this.scrollLeft = Math.max(Math.min(top, this.getMaxScrollLeft()), 0);\n this.handleScrollChange();\n }\n };\n ScrollGeomCache.prototype.getClientWidth = function () {\n return this.clientWidth;\n };\n ScrollGeomCache.prototype.getClientHeight = function () {\n return this.clientHeight;\n };\n ScrollGeomCache.prototype.getScrollWidth = function () {\n return this.scrollWidth;\n };\n ScrollGeomCache.prototype.getScrollHeight = function () {\n return this.scrollHeight;\n };\n ScrollGeomCache.prototype.handleScrollChange = function () {\n };\n return ScrollGeomCache;\n }(core.ScrollController));\n var ElementScrollGeomCache = /** @class */ (function (_super) {\n __extends(ElementScrollGeomCache, _super);\n function ElementScrollGeomCache(el, doesListening) {\n return _super.call(this, new core.ElementScrollController(el), doesListening) || this;\n }\n ElementScrollGeomCache.prototype.getEventTarget = function () {\n return this.scrollController.el;\n };\n ElementScrollGeomCache.prototype.computeClientRect = function () {\n return core.computeInnerRect(this.scrollController.el);\n };\n return ElementScrollGeomCache;\n }(ScrollGeomCache));\n var WindowScrollGeomCache = /** @class */ (function (_super) {\n __extends(WindowScrollGeomCache, _super);\n function WindowScrollGeomCache(doesListening) {\n return _super.call(this, new core.WindowScrollController(), doesListening) || this;\n }\n WindowScrollGeomCache.prototype.getEventTarget = function () {\n return window;\n };\n WindowScrollGeomCache.prototype.computeClientRect = function () {\n return {\n left: this.scrollLeft,\n right: this.scrollLeft + this.clientWidth,\n top: this.scrollTop,\n bottom: this.scrollTop + this.clientHeight\n };\n };\n // the window is the only scroll object that changes it's rectangle relative\n // to the document's topleft as it scrolls\n WindowScrollGeomCache.prototype.handleScrollChange = function () {\n this.clientRect = this.computeClientRect();\n };\n return WindowScrollGeomCache;\n }(ScrollGeomCache));\n\n // If available we are using native \"performance\" API instead of \"Date\"\n // Read more about it on MDN:\n // https://developer.mozilla.org/en-US/docs/Web/API/Performance\n var getTime = typeof performance === 'function' ? performance.now : Date.now;\n /*\n For a pointer interaction, automatically scrolls certain scroll containers when the pointer\n approaches the edge.\n\n The caller must call start + handleMove + stop.\n */\n var AutoScroller = /** @class */ (function () {\n function AutoScroller() {\n var _this = this;\n // options that can be set by caller\n this.isEnabled = true;\n this.scrollQuery = [window, '.fc-scroller'];\n this.edgeThreshold = 50; // pixels\n this.maxVelocity = 300; // pixels per second\n // internal state\n this.pointerScreenX = null;\n this.pointerScreenY = null;\n this.isAnimating = false;\n this.scrollCaches = null;\n // protect against the initial pointerdown being too close to an edge and starting the scroll\n this.everMovedUp = false;\n this.everMovedDown = false;\n this.everMovedLeft = false;\n this.everMovedRight = false;\n this.animate = function () {\n if (_this.isAnimating) { // wasn't cancelled between animation calls\n var edge = _this.computeBestEdge(_this.pointerScreenX + window.pageXOffset, _this.pointerScreenY + window.pageYOffset);\n if (edge) {\n var now = getTime();\n _this.handleSide(edge, (now - _this.msSinceRequest) / 1000);\n _this.requestAnimation(now);\n }\n else {\n _this.isAnimating = false; // will stop animation\n }\n }\n };\n }\n AutoScroller.prototype.start = function (pageX, pageY) {\n if (this.isEnabled) {\n this.scrollCaches = this.buildCaches();\n this.pointerScreenX = null;\n this.pointerScreenY = null;\n this.everMovedUp = false;\n this.everMovedDown = false;\n this.everMovedLeft = false;\n this.everMovedRight = false;\n this.handleMove(pageX, pageY);\n }\n };\n AutoScroller.prototype.handleMove = function (pageX, pageY) {\n if (this.isEnabled) {\n var pointerScreenX = pageX - window.pageXOffset;\n var pointerScreenY = pageY - window.pageYOffset;\n var yDelta = this.pointerScreenY === null ? 0 : pointerScreenY - this.pointerScreenY;\n var xDelta = this.pointerScreenX === null ? 0 : pointerScreenX - this.pointerScreenX;\n if (yDelta < 0) {\n this.everMovedUp = true;\n }\n else if (yDelta > 0) {\n this.everMovedDown = true;\n }\n if (xDelta < 0) {\n this.everMovedLeft = true;\n }\n else if (xDelta > 0) {\n this.everMovedRight = true;\n }\n this.pointerScreenX = pointerScreenX;\n this.pointerScreenY = pointerScreenY;\n if (!this.isAnimating) {\n this.isAnimating = true;\n this.requestAnimation(getTime());\n }\n }\n };\n AutoScroller.prototype.stop = function () {\n if (this.isEnabled) {\n this.isAnimating = false; // will stop animation\n for (var _i = 0, _a = this.scrollCaches; _i < _a.length; _i++) {\n var scrollCache = _a[_i];\n scrollCache.destroy();\n }\n this.scrollCaches = null;\n }\n };\n AutoScroller.prototype.requestAnimation = function (now) {\n this.msSinceRequest = now;\n requestAnimationFrame(this.animate);\n };\n AutoScroller.prototype.handleSide = function (edge, seconds) {\n var scrollCache = edge.scrollCache;\n var edgeThreshold = this.edgeThreshold;\n var invDistance = edgeThreshold - edge.distance;\n var velocity = // the closer to the edge, the faster we scroll\n (invDistance * invDistance) / (edgeThreshold * edgeThreshold) * // quadratic\n this.maxVelocity * seconds;\n var sign = 1;\n switch (edge.name) {\n case 'left':\n sign = -1;\n // falls through\n case 'right':\n scrollCache.setScrollLeft(scrollCache.getScrollLeft() + velocity * sign);\n break;\n case 'top':\n sign = -1;\n // falls through\n case 'bottom':\n scrollCache.setScrollTop(scrollCache.getScrollTop() + velocity * sign);\n break;\n }\n };\n // left/top are relative to document topleft\n AutoScroller.prototype.computeBestEdge = function (left, top) {\n var edgeThreshold = this.edgeThreshold;\n var bestSide = null;\n for (var _i = 0, _a = this.scrollCaches; _i < _a.length; _i++) {\n var scrollCache = _a[_i];\n var rect = scrollCache.clientRect;\n var leftDist = left - rect.left;\n var rightDist = rect.right - left;\n var topDist = top - rect.top;\n var bottomDist = rect.bottom - top;\n // completely within the rect?\n if (leftDist >= 0 && rightDist >= 0 && topDist >= 0 && bottomDist >= 0) {\n if (topDist <= edgeThreshold && this.everMovedUp && scrollCache.canScrollUp() &&\n (!bestSide || bestSide.distance > topDist)) {\n bestSide = { scrollCache: scrollCache, name: 'top', distance: topDist };\n }\n if (bottomDist <= edgeThreshold && this.everMovedDown && scrollCache.canScrollDown() &&\n (!bestSide || bestSide.distance > bottomDist)) {\n bestSide = { scrollCache: scrollCache, name: 'bottom', distance: bottomDist };\n }\n if (leftDist <= edgeThreshold && this.everMovedLeft && scrollCache.canScrollLeft() &&\n (!bestSide || bestSide.distance > leftDist)) {\n bestSide = { scrollCache: scrollCache, name: 'left', distance: leftDist };\n }\n if (rightDist <= edgeThreshold && this.everMovedRight && scrollCache.canScrollRight() &&\n (!bestSide || bestSide.distance > rightDist)) {\n bestSide = { scrollCache: scrollCache, name: 'right', distance: rightDist };\n }\n }\n }\n return bestSide;\n };\n AutoScroller.prototype.buildCaches = function () {\n return this.queryScrollEls().map(function (el) {\n if (el === window) {\n return new WindowScrollGeomCache(false); // false = don't listen to user-generated scrolls\n }\n else {\n return new ElementScrollGeomCache(el, false); // false = don't listen to user-generated scrolls\n }\n });\n };\n AutoScroller.prototype.queryScrollEls = function () {\n var els = [];\n for (var _i = 0, _a = this.scrollQuery; _i < _a.length; _i++) {\n var query = _a[_i];\n if (typeof query === 'object') {\n els.push(query);\n }\n else {\n els.push.apply(els, Array.prototype.slice.call(document.querySelectorAll(query)));\n }\n }\n return els;\n };\n return AutoScroller;\n }());\n\n /*\n Monitors dragging on an element. Has a number of high-level features:\n - minimum distance required before dragging\n - minimum wait time (\"delay\") before dragging\n - a mirror element that follows the pointer\n */\n var FeaturefulElementDragging = /** @class */ (function (_super) {\n __extends(FeaturefulElementDragging, _super);\n function FeaturefulElementDragging(containerEl) {\n var _this = _super.call(this, containerEl) || this;\n // options that can be directly set by caller\n // the caller can also set the PointerDragging's options as well\n _this.delay = null;\n _this.minDistance = 0;\n _this.touchScrollAllowed = true; // prevents drag from starting and blocks scrolling during drag\n _this.mirrorNeedsRevert = false;\n _this.isInteracting = false; // is the user validly moving the pointer? lasts until pointerup\n _this.isDragging = false; // is it INTENTFULLY dragging? lasts until after revert animation\n _this.isDelayEnded = false;\n _this.isDistanceSurpassed = false;\n _this.delayTimeoutId = null;\n _this.onPointerDown = function (ev) {\n if (!_this.isDragging) { // so new drag doesn't happen while revert animation is going\n _this.isInteracting = true;\n _this.isDelayEnded = false;\n _this.isDistanceSurpassed = false;\n core.preventSelection(document.body);\n core.preventContextMenu(document.body);\n // prevent links from being visited if there's an eventual drag.\n // also prevents selection in older browsers (maybe?).\n // not necessary for touch, besides, browser would complain about passiveness.\n if (!ev.isTouch) {\n ev.origEvent.preventDefault();\n }\n _this.emitter.trigger('pointerdown', ev);\n if (!_this.pointer.shouldIgnoreMove) {\n // actions related to initiating dragstart+dragmove+dragend...\n _this.mirror.setIsVisible(false); // reset. caller must set-visible\n _this.mirror.start(ev.subjectEl, ev.pageX, ev.pageY); // must happen on first pointer down\n _this.startDelay(ev);\n if (!_this.minDistance) {\n _this.handleDistanceSurpassed(ev);\n }\n }\n }\n };\n _this.onPointerMove = function (ev) {\n if (_this.isInteracting) { // if false, still waiting for previous drag's revert\n _this.emitter.trigger('pointermove', ev);\n if (!_this.isDistanceSurpassed) {\n var minDistance = _this.minDistance;\n var distanceSq = void 0; // current distance from the origin, squared\n var deltaX = ev.deltaX, deltaY = ev.deltaY;\n distanceSq = deltaX * deltaX + deltaY * deltaY;\n if (distanceSq >= minDistance * minDistance) { // use pythagorean theorem\n _this.handleDistanceSurpassed(ev);\n }\n }\n if (_this.isDragging) {\n // a real pointer move? (not one simulated by scrolling)\n if (ev.origEvent.type !== 'scroll') {\n _this.mirror.handleMove(ev.pageX, ev.pageY);\n _this.autoScroller.handleMove(ev.pageX, ev.pageY);\n }\n _this.emitter.trigger('dragmove', ev);\n }\n }\n };\n _this.onPointerUp = function (ev) {\n if (_this.isInteracting) { // if false, still waiting for previous drag's revert\n _this.isInteracting = false;\n core.allowSelection(document.body);\n core.allowContextMenu(document.body);\n _this.emitter.trigger('pointerup', ev); // can potentially set mirrorNeedsRevert\n if (_this.isDragging) {\n _this.autoScroller.stop();\n _this.tryStopDrag(ev); // which will stop the mirror\n }\n if (_this.delayTimeoutId) {\n clearTimeout(_this.delayTimeoutId);\n _this.delayTimeoutId = null;\n }\n }\n };\n var pointer = _this.pointer = new PointerDragging(containerEl);\n pointer.emitter.on('pointerdown', _this.onPointerDown);\n pointer.emitter.on('pointermove', _this.onPointerMove);\n pointer.emitter.on('pointerup', _this.onPointerUp);\n _this.mirror = new ElementMirror();\n _this.autoScroller = new AutoScroller();\n return _this;\n }\n FeaturefulElementDragging.prototype.destroy = function () {\n this.pointer.destroy();\n };\n FeaturefulElementDragging.prototype.startDelay = function (ev) {\n var _this = this;\n if (typeof this.delay === 'number') {\n this.delayTimeoutId = setTimeout(function () {\n _this.delayTimeoutId = null;\n _this.handleDelayEnd(ev);\n }, this.delay); // not assignable to number!\n }\n else {\n this.handleDelayEnd(ev);\n }\n };\n FeaturefulElementDragging.prototype.handleDelayEnd = function (ev) {\n this.isDelayEnded = true;\n this.tryStartDrag(ev);\n };\n FeaturefulElementDragging.prototype.handleDistanceSurpassed = function (ev) {\n this.isDistanceSurpassed = true;\n this.tryStartDrag(ev);\n };\n FeaturefulElementDragging.prototype.tryStartDrag = function (ev) {\n if (this.isDelayEnded && this.isDistanceSurpassed) {\n if (!this.pointer.wasTouchScroll || this.touchScrollAllowed) {\n this.isDragging = true;\n this.mirrorNeedsRevert = false;\n this.autoScroller.start(ev.pageX, ev.pageY);\n this.emitter.trigger('dragstart', ev);\n if (this.touchScrollAllowed === false) {\n this.pointer.cancelTouchScroll();\n }\n }\n }\n };\n FeaturefulElementDragging.prototype.tryStopDrag = function (ev) {\n // .stop() is ALWAYS asynchronous, which we NEED because we want all pointerup events\n // that come from the document to fire beforehand. much more convenient this way.\n this.mirror.stop(this.mirrorNeedsRevert, this.stopDrag.bind(this, ev) // bound with args\n );\n };\n FeaturefulElementDragging.prototype.stopDrag = function (ev) {\n this.isDragging = false;\n this.emitter.trigger('dragend', ev);\n };\n // fill in the implementations...\n FeaturefulElementDragging.prototype.setIgnoreMove = function (bool) {\n this.pointer.shouldIgnoreMove = bool;\n };\n FeaturefulElementDragging.prototype.setMirrorIsVisible = function (bool) {\n this.mirror.setIsVisible(bool);\n };\n FeaturefulElementDragging.prototype.setMirrorNeedsRevert = function (bool) {\n this.mirrorNeedsRevert = bool;\n };\n FeaturefulElementDragging.prototype.setAutoScrollEnabled = function (bool) {\n this.autoScroller.isEnabled = bool;\n };\n return FeaturefulElementDragging;\n }(core.ElementDragging));\n\n /*\n When this class is instantiated, it records the offset of an element (relative to the document topleft),\n and continues to monitor scrolling, updating the cached coordinates if it needs to.\n Does not access the DOM after instantiation, so highly performant.\n\n Also keeps track of all scrolling/overflow:hidden containers that are parents of the given element\n and an determine if a given point is inside the combined clipping rectangle.\n */\n var OffsetTracker = /** @class */ (function () {\n function OffsetTracker(el) {\n this.origRect = core.computeRect(el);\n // will work fine for divs that have overflow:hidden\n this.scrollCaches = core.getClippingParents(el).map(function (el) {\n return new ElementScrollGeomCache(el, true); // listen=true\n });\n }\n OffsetTracker.prototype.destroy = function () {\n for (var _i = 0, _a = this.scrollCaches; _i < _a.length; _i++) {\n var scrollCache = _a[_i];\n scrollCache.destroy();\n }\n };\n OffsetTracker.prototype.computeLeft = function () {\n var left = this.origRect.left;\n for (var _i = 0, _a = this.scrollCaches; _i < _a.length; _i++) {\n var scrollCache = _a[_i];\n left += scrollCache.origScrollLeft - scrollCache.getScrollLeft();\n }\n return left;\n };\n OffsetTracker.prototype.computeTop = function () {\n var top = this.origRect.top;\n for (var _i = 0, _a = this.scrollCaches; _i < _a.length; _i++) {\n var scrollCache = _a[_i];\n top += scrollCache.origScrollTop - scrollCache.getScrollTop();\n }\n return top;\n };\n OffsetTracker.prototype.isWithinClipping = function (pageX, pageY) {\n var point = { left: pageX, top: pageY };\n for (var _i = 0, _a = this.scrollCaches; _i < _a.length; _i++) {\n var scrollCache = _a[_i];\n if (!isIgnoredClipping(scrollCache.getEventTarget()) &&\n !core.pointInsideRect(point, scrollCache.clientRect)) {\n return false;\n }\n }\n return true;\n };\n return OffsetTracker;\n }());\n // certain clipping containers should never constrain interactions, like and \n // https://github.com/fullcalendar/fullcalendar/issues/3615\n function isIgnoredClipping(node) {\n var tagName = node.tagName;\n return tagName === 'HTML' || tagName === 'BODY';\n }\n\n /*\n Tracks movement over multiple droppable areas (aka \"hits\")\n that exist in one or more DateComponents.\n Relies on an existing draggable.\n\n emits:\n - pointerdown\n - dragstart\n - hitchange - fires initially, even if not over a hit\n - pointerup\n - (hitchange - again, to null, if ended over a hit)\n - dragend\n */\n var HitDragging = /** @class */ (function () {\n function HitDragging(dragging, droppableStore) {\n var _this = this;\n // options that can be set by caller\n this.useSubjectCenter = false;\n this.requireInitial = true; // if doesn't start out on a hit, won't emit any events\n this.initialHit = null;\n this.movingHit = null;\n this.finalHit = null; // won't ever be populated if shouldIgnoreMove\n this.handlePointerDown = function (ev) {\n var dragging = _this.dragging;\n _this.initialHit = null;\n _this.movingHit = null;\n _this.finalHit = null;\n _this.prepareHits();\n _this.processFirstCoord(ev);\n if (_this.initialHit || !_this.requireInitial) {\n dragging.setIgnoreMove(false);\n _this.emitter.trigger('pointerdown', ev); // TODO: fire this before computing processFirstCoord, so listeners can cancel. this gets fired by almost every handler :(\n }\n else {\n dragging.setIgnoreMove(true);\n }\n };\n this.handleDragStart = function (ev) {\n _this.emitter.trigger('dragstart', ev);\n _this.handleMove(ev, true); // force = fire even if initially null\n };\n this.handleDragMove = function (ev) {\n _this.emitter.trigger('dragmove', ev);\n _this.handleMove(ev);\n };\n this.handlePointerUp = function (ev) {\n _this.releaseHits();\n _this.emitter.trigger('pointerup', ev);\n };\n this.handleDragEnd = function (ev) {\n if (_this.movingHit) {\n _this.emitter.trigger('hitupdate', null, true, ev);\n }\n _this.finalHit = _this.movingHit;\n _this.movingHit = null;\n _this.emitter.trigger('dragend', ev);\n };\n this.droppableStore = droppableStore;\n dragging.emitter.on('pointerdown', this.handlePointerDown);\n dragging.emitter.on('dragstart', this.handleDragStart);\n dragging.emitter.on('dragmove', this.handleDragMove);\n dragging.emitter.on('pointerup', this.handlePointerUp);\n dragging.emitter.on('dragend', this.handleDragEnd);\n this.dragging = dragging;\n this.emitter = new core.EmitterMixin();\n }\n // sets initialHit\n // sets coordAdjust\n HitDragging.prototype.processFirstCoord = function (ev) {\n var origPoint = { left: ev.pageX, top: ev.pageY };\n var adjustedPoint = origPoint;\n var subjectEl = ev.subjectEl;\n var subjectRect;\n if (subjectEl !== document) {\n subjectRect = core.computeRect(subjectEl);\n adjustedPoint = core.constrainPoint(adjustedPoint, subjectRect);\n }\n var initialHit = this.initialHit = this.queryHitForOffset(adjustedPoint.left, adjustedPoint.top);\n if (initialHit) {\n if (this.useSubjectCenter && subjectRect) {\n var slicedSubjectRect = core.intersectRects(subjectRect, initialHit.rect);\n if (slicedSubjectRect) {\n adjustedPoint = core.getRectCenter(slicedSubjectRect);\n }\n }\n this.coordAdjust = core.diffPoints(adjustedPoint, origPoint);\n }\n else {\n this.coordAdjust = { left: 0, top: 0 };\n }\n };\n HitDragging.prototype.handleMove = function (ev, forceHandle) {\n var hit = this.queryHitForOffset(ev.pageX + this.coordAdjust.left, ev.pageY + this.coordAdjust.top);\n if (forceHandle || !isHitsEqual(this.movingHit, hit)) {\n this.movingHit = hit;\n this.emitter.trigger('hitupdate', hit, false, ev);\n }\n };\n HitDragging.prototype.prepareHits = function () {\n this.offsetTrackers = core.mapHash(this.droppableStore, function (interactionSettings) {\n interactionSettings.component.buildPositionCaches();\n return new OffsetTracker(interactionSettings.el);\n });\n };\n HitDragging.prototype.releaseHits = function () {\n var offsetTrackers = this.offsetTrackers;\n for (var id in offsetTrackers) {\n offsetTrackers[id].destroy();\n }\n this.offsetTrackers = {};\n };\n HitDragging.prototype.queryHitForOffset = function (offsetLeft, offsetTop) {\n var _a = this, droppableStore = _a.droppableStore, offsetTrackers = _a.offsetTrackers;\n var bestHit = null;\n for (var id in droppableStore) {\n var component = droppableStore[id].component;\n var offsetTracker = offsetTrackers[id];\n if (offsetTracker.isWithinClipping(offsetLeft, offsetTop)) {\n var originLeft = offsetTracker.computeLeft();\n var originTop = offsetTracker.computeTop();\n var positionLeft = offsetLeft - originLeft;\n var positionTop = offsetTop - originTop;\n var origRect = offsetTracker.origRect;\n var width = origRect.right - origRect.left;\n var height = origRect.bottom - origRect.top;\n if (\n // must be within the element's bounds\n positionLeft >= 0 && positionLeft < width &&\n positionTop >= 0 && positionTop < height) {\n var hit = component.queryHit(positionLeft, positionTop, width, height);\n if (hit &&\n (\n // make sure the hit is within activeRange, meaning it's not a deal cell\n !component.props.dateProfile || // hack for DayTile\n core.rangeContainsRange(component.props.dateProfile.activeRange, hit.dateSpan.range)) &&\n (!bestHit || hit.layer > bestHit.layer)) {\n // TODO: better way to re-orient rectangle\n hit.rect.left += originLeft;\n hit.rect.right += originLeft;\n hit.rect.top += originTop;\n hit.rect.bottom += originTop;\n bestHit = hit;\n }\n }\n }\n }\n return bestHit;\n };\n return HitDragging;\n }());\n function isHitsEqual(hit0, hit1) {\n if (!hit0 && !hit1) {\n return true;\n }\n if (Boolean(hit0) !== Boolean(hit1)) {\n return false;\n }\n return core.isDateSpansEqual(hit0.dateSpan, hit1.dateSpan);\n }\n\n /*\n Monitors when the user clicks on a specific date/time of a component.\n A pointerdown+pointerup on the same \"hit\" constitutes a click.\n */\n var DateClicking = /** @class */ (function (_super) {\n __extends(DateClicking, _super);\n function DateClicking(settings) {\n var _this = _super.call(this, settings) || this;\n _this.handlePointerDown = function (ev) {\n var dragging = _this.dragging;\n // do this in pointerdown (not dragend) because DOM might be mutated by the time dragend is fired\n dragging.setIgnoreMove(!_this.component.isValidDateDownEl(dragging.pointer.downEl));\n };\n // won't even fire if moving was ignored\n _this.handleDragEnd = function (ev) {\n var component = _this.component;\n var _a = component.context, calendar = _a.calendar, view = _a.view;\n var pointer = _this.dragging.pointer;\n if (!pointer.wasTouchScroll) {\n var _b = _this.hitDragging, initialHit = _b.initialHit, finalHit = _b.finalHit;\n if (initialHit && finalHit && isHitsEqual(initialHit, finalHit)) {\n calendar.triggerDateClick(initialHit.dateSpan, initialHit.dayEl, view, ev.origEvent);\n }\n }\n };\n var component = settings.component;\n // we DO want to watch pointer moves because otherwise finalHit won't get populated\n _this.dragging = new FeaturefulElementDragging(component.el);\n _this.dragging.autoScroller.isEnabled = false;\n var hitDragging = _this.hitDragging = new HitDragging(_this.dragging, core.interactionSettingsToStore(settings));\n hitDragging.emitter.on('pointerdown', _this.handlePointerDown);\n hitDragging.emitter.on('dragend', _this.handleDragEnd);\n return _this;\n }\n DateClicking.prototype.destroy = function () {\n this.dragging.destroy();\n };\n return DateClicking;\n }(core.Interaction));\n\n /*\n Tracks when the user selects a portion of time of a component,\n constituted by a drag over date cells, with a possible delay at the beginning of the drag.\n */\n var DateSelecting = /** @class */ (function (_super) {\n __extends(DateSelecting, _super);\n function DateSelecting(settings) {\n var _this = _super.call(this, settings) || this;\n _this.dragSelection = null;\n _this.handlePointerDown = function (ev) {\n var _a = _this, component = _a.component, dragging = _a.dragging;\n var options = component.context.options;\n var canSelect = options.selectable &&\n component.isValidDateDownEl(ev.origEvent.target);\n // don't bother to watch expensive moves if component won't do selection\n dragging.setIgnoreMove(!canSelect);\n // if touch, require user to hold down\n dragging.delay = ev.isTouch ? getComponentTouchDelay(component) : null;\n };\n _this.handleDragStart = function (ev) {\n _this.component.context.calendar.unselect(ev); // unselect previous selections\n };\n _this.handleHitUpdate = function (hit, isFinal) {\n var calendar = _this.component.context.calendar;\n var dragSelection = null;\n var isInvalid = false;\n if (hit) {\n dragSelection = joinHitsIntoSelection(_this.hitDragging.initialHit, hit, calendar.pluginSystem.hooks.dateSelectionTransformers);\n if (!dragSelection || !_this.component.isDateSelectionValid(dragSelection)) {\n isInvalid = true;\n dragSelection = null;\n }\n }\n if (dragSelection) {\n calendar.dispatch({ type: 'SELECT_DATES', selection: dragSelection });\n }\n else if (!isFinal) { // only unselect if moved away while dragging\n calendar.dispatch({ type: 'UNSELECT_DATES' });\n }\n if (!isInvalid) {\n core.enableCursor();\n }\n else {\n core.disableCursor();\n }\n if (!isFinal) {\n _this.dragSelection = dragSelection; // only clear if moved away from all hits while dragging\n }\n };\n _this.handlePointerUp = function (pev) {\n if (_this.dragSelection) {\n // selection is already rendered, so just need to report selection\n _this.component.context.calendar.triggerDateSelect(_this.dragSelection, pev);\n _this.dragSelection = null;\n }\n };\n var component = settings.component;\n var options = component.context.options;\n var dragging = _this.dragging = new FeaturefulElementDragging(component.el);\n dragging.touchScrollAllowed = false;\n dragging.minDistance = options.selectMinDistance || 0;\n dragging.autoScroller.isEnabled = options.dragScroll;\n var hitDragging = _this.hitDragging = new HitDragging(_this.dragging, core.interactionSettingsToStore(settings));\n hitDragging.emitter.on('pointerdown', _this.handlePointerDown);\n hitDragging.emitter.on('dragstart', _this.handleDragStart);\n hitDragging.emitter.on('hitupdate', _this.handleHitUpdate);\n hitDragging.emitter.on('pointerup', _this.handlePointerUp);\n return _this;\n }\n DateSelecting.prototype.destroy = function () {\n this.dragging.destroy();\n };\n return DateSelecting;\n }(core.Interaction));\n function getComponentTouchDelay(component) {\n var options = component.context.options;\n var delay = options.selectLongPressDelay;\n if (delay == null) {\n delay = options.longPressDelay;\n }\n return delay;\n }\n function joinHitsIntoSelection(hit0, hit1, dateSelectionTransformers) {\n var dateSpan0 = hit0.dateSpan;\n var dateSpan1 = hit1.dateSpan;\n var ms = [\n dateSpan0.range.start,\n dateSpan0.range.end,\n dateSpan1.range.start,\n dateSpan1.range.end\n ];\n ms.sort(core.compareNumbers);\n var props = {};\n for (var _i = 0, dateSelectionTransformers_1 = dateSelectionTransformers; _i < dateSelectionTransformers_1.length; _i++) {\n var transformer = dateSelectionTransformers_1[_i];\n var res = transformer(hit0, hit1);\n if (res === false) {\n return null;\n }\n else if (res) {\n __assign(props, res);\n }\n }\n props.range = { start: ms[0], end: ms[3] };\n props.allDay = dateSpan0.allDay;\n return props;\n }\n\n var EventDragging = /** @class */ (function (_super) {\n __extends(EventDragging, _super);\n function EventDragging(settings) {\n var _this = _super.call(this, settings) || this;\n // internal state\n _this.subjectSeg = null; // the seg being selected/dragged\n _this.isDragging = false;\n _this.eventRange = null;\n _this.relevantEvents = null; // the events being dragged\n _this.receivingCalendar = null;\n _this.validMutation = null;\n _this.mutatedRelevantEvents = null;\n _this.handlePointerDown = function (ev) {\n var origTarget = ev.origEvent.target;\n var _a = _this, component = _a.component, dragging = _a.dragging;\n var mirror = dragging.mirror;\n var options = component.context.options;\n var initialCalendar = component.context.calendar;\n var subjectSeg = _this.subjectSeg = core.getElSeg(ev.subjectEl);\n var eventRange = _this.eventRange = subjectSeg.eventRange;\n var eventInstanceId = eventRange.instance.instanceId;\n _this.relevantEvents = core.getRelevantEvents(initialCalendar.state.eventStore, eventInstanceId);\n dragging.minDistance = ev.isTouch ? 0 : options.eventDragMinDistance;\n dragging.delay =\n // only do a touch delay if touch and this event hasn't been selected yet\n (ev.isTouch && eventInstanceId !== component.props.eventSelection) ?\n getComponentTouchDelay$1(component) :\n null;\n mirror.parentNode = initialCalendar.el;\n mirror.revertDuration = options.dragRevertDuration;\n var isValid = component.isValidSegDownEl(origTarget) &&\n !core.elementClosest(origTarget, '.fc-resizer'); // NOT on a resizer\n dragging.setIgnoreMove(!isValid);\n // disable dragging for elements that are resizable (ie, selectable)\n // but are not draggable\n _this.isDragging = isValid &&\n ev.subjectEl.classList.contains('fc-draggable');\n };\n _this.handleDragStart = function (ev) {\n var context = _this.component.context;\n var initialCalendar = context.calendar;\n var eventRange = _this.eventRange;\n var eventInstanceId = eventRange.instance.instanceId;\n if (ev.isTouch) {\n // need to select a different event?\n if (eventInstanceId !== _this.component.props.eventSelection) {\n initialCalendar.dispatch({ type: 'SELECT_EVENT', eventInstanceId: eventInstanceId });\n }\n }\n else {\n // if now using mouse, but was previous touch interaction, clear selected event\n initialCalendar.dispatch({ type: 'UNSELECT_EVENT' });\n }\n if (_this.isDragging) {\n initialCalendar.unselect(ev); // unselect *date* selection\n initialCalendar.publiclyTrigger('eventDragStart', [\n {\n el: _this.subjectSeg.el,\n event: new core.EventApi(initialCalendar, eventRange.def, eventRange.instance),\n jsEvent: ev.origEvent,\n view: context.view\n }\n ]);\n }\n };\n _this.handleHitUpdate = function (hit, isFinal) {\n if (!_this.isDragging) {\n return;\n }\n var relevantEvents = _this.relevantEvents;\n var initialHit = _this.hitDragging.initialHit;\n var initialCalendar = _this.component.context.calendar;\n // states based on new hit\n var receivingCalendar = null;\n var mutation = null;\n var mutatedRelevantEvents = null;\n var isInvalid = false;\n var interaction = {\n affectedEvents: relevantEvents,\n mutatedEvents: core.createEmptyEventStore(),\n isEvent: true,\n origSeg: _this.subjectSeg\n };\n if (hit) {\n var receivingComponent = hit.component;\n receivingCalendar = receivingComponent.context.calendar;\n var receivingOptions = receivingComponent.context.options;\n if (initialCalendar === receivingCalendar ||\n receivingOptions.editable && receivingOptions.droppable) {\n mutation = computeEventMutation(initialHit, hit, receivingCalendar.pluginSystem.hooks.eventDragMutationMassagers);\n if (mutation) {\n mutatedRelevantEvents = core.applyMutationToEventStore(relevantEvents, receivingCalendar.eventUiBases, mutation, receivingCalendar);\n interaction.mutatedEvents = mutatedRelevantEvents;\n if (!receivingComponent.isInteractionValid(interaction)) {\n isInvalid = true;\n mutation = null;\n mutatedRelevantEvents = null;\n interaction.mutatedEvents = core.createEmptyEventStore();\n }\n }\n }\n else {\n receivingCalendar = null;\n }\n }\n _this.displayDrag(receivingCalendar, interaction);\n if (!isInvalid) {\n core.enableCursor();\n }\n else {\n core.disableCursor();\n }\n if (!isFinal) {\n if (initialCalendar === receivingCalendar && // TODO: write test for this\n isHitsEqual(initialHit, hit)) {\n mutation = null;\n }\n _this.dragging.setMirrorNeedsRevert(!mutation);\n // render the mirror if no already-rendered mirror\n // TODO: wish we could somehow wait for dispatch to guarantee render\n _this.dragging.setMirrorIsVisible(!hit || !document.querySelector('.fc-mirror'));\n // assign states based on new hit\n _this.receivingCalendar = receivingCalendar;\n _this.validMutation = mutation;\n _this.mutatedRelevantEvents = mutatedRelevantEvents;\n }\n };\n _this.handlePointerUp = function () {\n if (!_this.isDragging) {\n _this.cleanup(); // because handleDragEnd won't fire\n }\n };\n _this.handleDragEnd = function (ev) {\n if (_this.isDragging) {\n var context = _this.component.context;\n var initialCalendar_1 = context.calendar;\n var initialView = context.view;\n var _a = _this, receivingCalendar = _a.receivingCalendar, validMutation = _a.validMutation;\n var eventDef = _this.eventRange.def;\n var eventInstance = _this.eventRange.instance;\n var eventApi = new core.EventApi(initialCalendar_1, eventDef, eventInstance);\n var relevantEvents_1 = _this.relevantEvents;\n var mutatedRelevantEvents = _this.mutatedRelevantEvents;\n var finalHit = _this.hitDragging.finalHit;\n _this.clearDrag(); // must happen after revert animation\n initialCalendar_1.publiclyTrigger('eventDragStop', [\n {\n el: _this.subjectSeg.el,\n event: eventApi,\n jsEvent: ev.origEvent,\n view: initialView\n }\n ]);\n if (validMutation) {\n // dropped within same calendar\n if (receivingCalendar === initialCalendar_1) {\n initialCalendar_1.dispatch({\n type: 'MERGE_EVENTS',\n eventStore: mutatedRelevantEvents\n });\n var transformed = {};\n for (var _i = 0, _b = initialCalendar_1.pluginSystem.hooks.eventDropTransformers; _i < _b.length; _i++) {\n var transformer = _b[_i];\n __assign(transformed, transformer(validMutation, initialCalendar_1));\n }\n var eventDropArg = __assign({}, transformed, { el: ev.subjectEl, delta: validMutation.datesDelta, oldEvent: eventApi, event: new core.EventApi(// the data AFTER the mutation\n initialCalendar_1, mutatedRelevantEvents.defs[eventDef.defId], eventInstance ? mutatedRelevantEvents.instances[eventInstance.instanceId] : null), revert: function () {\n initialCalendar_1.dispatch({\n type: 'MERGE_EVENTS',\n eventStore: relevantEvents_1\n });\n }, jsEvent: ev.origEvent, view: initialView });\n initialCalendar_1.publiclyTrigger('eventDrop', [eventDropArg]);\n // dropped in different calendar\n }\n else if (receivingCalendar) {\n initialCalendar_1.publiclyTrigger('eventLeave', [\n {\n draggedEl: ev.subjectEl,\n event: eventApi,\n view: initialView\n }\n ]);\n initialCalendar_1.dispatch({\n type: 'REMOVE_EVENT_INSTANCES',\n instances: _this.mutatedRelevantEvents.instances\n });\n receivingCalendar.dispatch({\n type: 'MERGE_EVENTS',\n eventStore: _this.mutatedRelevantEvents\n });\n if (ev.isTouch) {\n receivingCalendar.dispatch({\n type: 'SELECT_EVENT',\n eventInstanceId: eventInstance.instanceId\n });\n }\n var dropArg = __assign({}, receivingCalendar.buildDatePointApi(finalHit.dateSpan), { draggedEl: ev.subjectEl, jsEvent: ev.origEvent, view: finalHit.component // should this be finalHit.component.view? See #4644\n });\n receivingCalendar.publiclyTrigger('drop', [dropArg]);\n receivingCalendar.publiclyTrigger('eventReceive', [\n {\n draggedEl: ev.subjectEl,\n event: new core.EventApi(// the data AFTER the mutation\n receivingCalendar, mutatedRelevantEvents.defs[eventDef.defId], mutatedRelevantEvents.instances[eventInstance.instanceId]),\n view: finalHit.component // should this be finalHit.component.view? See #4644\n }\n ]);\n }\n }\n else {\n initialCalendar_1.publiclyTrigger('_noEventDrop');\n }\n }\n _this.cleanup();\n };\n var component = _this.component;\n var options = component.context.options;\n var dragging = _this.dragging = new FeaturefulElementDragging(component.el);\n dragging.pointer.selector = EventDragging.SELECTOR;\n dragging.touchScrollAllowed = false;\n dragging.autoScroller.isEnabled = options.dragScroll;\n var hitDragging = _this.hitDragging = new HitDragging(_this.dragging, core.interactionSettingsStore);\n hitDragging.useSubjectCenter = settings.useEventCenter;\n hitDragging.emitter.on('pointerdown', _this.handlePointerDown);\n hitDragging.emitter.on('dragstart', _this.handleDragStart);\n hitDragging.emitter.on('hitupdate', _this.handleHitUpdate);\n hitDragging.emitter.on('pointerup', _this.handlePointerUp);\n hitDragging.emitter.on('dragend', _this.handleDragEnd);\n return _this;\n }\n EventDragging.prototype.destroy = function () {\n this.dragging.destroy();\n };\n // render a drag state on the next receivingCalendar\n EventDragging.prototype.displayDrag = function (nextCalendar, state) {\n var initialCalendar = this.component.context.calendar;\n var prevCalendar = this.receivingCalendar;\n // does the previous calendar need to be cleared?\n if (prevCalendar && prevCalendar !== nextCalendar) {\n // does the initial calendar need to be cleared?\n // if so, don't clear all the way. we still need to to hide the affectedEvents\n if (prevCalendar === initialCalendar) {\n prevCalendar.dispatch({\n type: 'SET_EVENT_DRAG',\n state: {\n affectedEvents: state.affectedEvents,\n mutatedEvents: core.createEmptyEventStore(),\n isEvent: true,\n origSeg: state.origSeg\n }\n });\n // completely clear the old calendar if it wasn't the initial\n }\n else {\n prevCalendar.dispatch({ type: 'UNSET_EVENT_DRAG' });\n }\n }\n if (nextCalendar) {\n nextCalendar.dispatch({ type: 'SET_EVENT_DRAG', state: state });\n }\n };\n EventDragging.prototype.clearDrag = function () {\n var initialCalendar = this.component.context.calendar;\n var receivingCalendar = this.receivingCalendar;\n if (receivingCalendar) {\n receivingCalendar.dispatch({ type: 'UNSET_EVENT_DRAG' });\n }\n // the initial calendar might have an dummy drag state from displayDrag\n if (initialCalendar !== receivingCalendar) {\n initialCalendar.dispatch({ type: 'UNSET_EVENT_DRAG' });\n }\n };\n EventDragging.prototype.cleanup = function () {\n this.subjectSeg = null;\n this.isDragging = false;\n this.eventRange = null;\n this.relevantEvents = null;\n this.receivingCalendar = null;\n this.validMutation = null;\n this.mutatedRelevantEvents = null;\n };\n EventDragging.SELECTOR = '.fc-draggable, .fc-resizable'; // TODO: test this in IE11\n return EventDragging;\n }(core.Interaction));\n function computeEventMutation(hit0, hit1, massagers) {\n var dateSpan0 = hit0.dateSpan;\n var dateSpan1 = hit1.dateSpan;\n var date0 = dateSpan0.range.start;\n var date1 = dateSpan1.range.start;\n var standardProps = {};\n if (dateSpan0.allDay !== dateSpan1.allDay) {\n standardProps.allDay = dateSpan1.allDay;\n standardProps.hasEnd = hit1.component.context.options.allDayMaintainDuration;\n if (dateSpan1.allDay) {\n // means date1 is already start-of-day,\n // but date0 needs to be converted\n date0 = core.startOfDay(date0);\n }\n }\n var delta = core.diffDates(date0, date1, hit0.component.context.dateEnv, hit0.component === hit1.component ?\n hit0.component.largeUnit :\n null);\n if (delta.milliseconds) { // has hours/minutes/seconds\n standardProps.allDay = false;\n }\n var mutation = {\n datesDelta: delta,\n standardProps: standardProps\n };\n for (var _i = 0, massagers_1 = massagers; _i < massagers_1.length; _i++) {\n var massager = massagers_1[_i];\n massager(mutation, hit0, hit1);\n }\n return mutation;\n }\n function getComponentTouchDelay$1(component) {\n var options = component.context.options;\n var delay = options.eventLongPressDelay;\n if (delay == null) {\n delay = options.longPressDelay;\n }\n return delay;\n }\n\n var EventDragging$1 = /** @class */ (function (_super) {\n __extends(EventDragging, _super);\n function EventDragging(settings) {\n var _this = _super.call(this, settings) || this;\n // internal state\n _this.draggingSeg = null; // TODO: rename to resizingSeg? subjectSeg?\n _this.eventRange = null;\n _this.relevantEvents = null;\n _this.validMutation = null;\n _this.mutatedRelevantEvents = null;\n _this.handlePointerDown = function (ev) {\n var component = _this.component;\n var seg = _this.querySeg(ev);\n var eventRange = _this.eventRange = seg.eventRange;\n _this.dragging.minDistance = component.context.options.eventDragMinDistance;\n // if touch, need to be working with a selected event\n _this.dragging.setIgnoreMove(!_this.component.isValidSegDownEl(ev.origEvent.target) ||\n (ev.isTouch && _this.component.props.eventSelection !== eventRange.instance.instanceId));\n };\n _this.handleDragStart = function (ev) {\n var _a = _this.component.context, calendar = _a.calendar, view = _a.view;\n var eventRange = _this.eventRange;\n _this.relevantEvents = core.getRelevantEvents(calendar.state.eventStore, _this.eventRange.instance.instanceId);\n _this.draggingSeg = _this.querySeg(ev);\n calendar.unselect();\n calendar.publiclyTrigger('eventResizeStart', [\n {\n el: _this.draggingSeg.el,\n event: new core.EventApi(calendar, eventRange.def, eventRange.instance),\n jsEvent: ev.origEvent,\n view: view\n }\n ]);\n };\n _this.handleHitUpdate = function (hit, isFinal, ev) {\n var calendar = _this.component.context.calendar;\n var relevantEvents = _this.relevantEvents;\n var initialHit = _this.hitDragging.initialHit;\n var eventInstance = _this.eventRange.instance;\n var mutation = null;\n var mutatedRelevantEvents = null;\n var isInvalid = false;\n var interaction = {\n affectedEvents: relevantEvents,\n mutatedEvents: core.createEmptyEventStore(),\n isEvent: true,\n origSeg: _this.draggingSeg\n };\n if (hit) {\n mutation = computeMutation(initialHit, hit, ev.subjectEl.classList.contains('fc-start-resizer'), eventInstance.range, calendar.pluginSystem.hooks.eventResizeJoinTransforms);\n }\n if (mutation) {\n mutatedRelevantEvents = core.applyMutationToEventStore(relevantEvents, calendar.eventUiBases, mutation, calendar);\n interaction.mutatedEvents = mutatedRelevantEvents;\n if (!_this.component.isInteractionValid(interaction)) {\n isInvalid = true;\n mutation = null;\n mutatedRelevantEvents = null;\n interaction.mutatedEvents = null;\n }\n }\n if (mutatedRelevantEvents) {\n calendar.dispatch({\n type: 'SET_EVENT_RESIZE',\n state: interaction\n });\n }\n else {\n calendar.dispatch({ type: 'UNSET_EVENT_RESIZE' });\n }\n if (!isInvalid) {\n core.enableCursor();\n }\n else {\n core.disableCursor();\n }\n if (!isFinal) {\n if (mutation && isHitsEqual(initialHit, hit)) {\n mutation = null;\n }\n _this.validMutation = mutation;\n _this.mutatedRelevantEvents = mutatedRelevantEvents;\n }\n };\n _this.handleDragEnd = function (ev) {\n var _a = _this.component.context, calendar = _a.calendar, view = _a.view;\n var eventDef = _this.eventRange.def;\n var eventInstance = _this.eventRange.instance;\n var eventApi = new core.EventApi(calendar, eventDef, eventInstance);\n var relevantEvents = _this.relevantEvents;\n var mutatedRelevantEvents = _this.mutatedRelevantEvents;\n calendar.publiclyTrigger('eventResizeStop', [\n {\n el: _this.draggingSeg.el,\n event: eventApi,\n jsEvent: ev.origEvent,\n view: view\n }\n ]);\n if (_this.validMutation) {\n calendar.dispatch({\n type: 'MERGE_EVENTS',\n eventStore: mutatedRelevantEvents\n });\n calendar.publiclyTrigger('eventResize', [\n {\n el: _this.draggingSeg.el,\n startDelta: _this.validMutation.startDelta || core.createDuration(0),\n endDelta: _this.validMutation.endDelta || core.createDuration(0),\n prevEvent: eventApi,\n event: new core.EventApi(// the data AFTER the mutation\n calendar, mutatedRelevantEvents.defs[eventDef.defId], eventInstance ? mutatedRelevantEvents.instances[eventInstance.instanceId] : null),\n revert: function () {\n calendar.dispatch({\n type: 'MERGE_EVENTS',\n eventStore: relevantEvents\n });\n },\n jsEvent: ev.origEvent,\n view: view\n }\n ]);\n }\n else {\n calendar.publiclyTrigger('_noEventResize');\n }\n // reset all internal state\n _this.draggingSeg = null;\n _this.relevantEvents = null;\n _this.validMutation = null;\n // okay to keep eventInstance around. useful to set it in handlePointerDown\n };\n var component = settings.component;\n var dragging = _this.dragging = new FeaturefulElementDragging(component.el);\n dragging.pointer.selector = '.fc-resizer';\n dragging.touchScrollAllowed = false;\n dragging.autoScroller.isEnabled = component.context.options.dragScroll;\n var hitDragging = _this.hitDragging = new HitDragging(_this.dragging, core.interactionSettingsToStore(settings));\n hitDragging.emitter.on('pointerdown', _this.handlePointerDown);\n hitDragging.emitter.on('dragstart', _this.handleDragStart);\n hitDragging.emitter.on('hitupdate', _this.handleHitUpdate);\n hitDragging.emitter.on('dragend', _this.handleDragEnd);\n return _this;\n }\n EventDragging.prototype.destroy = function () {\n this.dragging.destroy();\n };\n EventDragging.prototype.querySeg = function (ev) {\n return core.getElSeg(core.elementClosest(ev.subjectEl, this.component.fgSegSelector));\n };\n return EventDragging;\n }(core.Interaction));\n function computeMutation(hit0, hit1, isFromStart, instanceRange, transforms) {\n var dateEnv = hit0.component.context.dateEnv;\n var date0 = hit0.dateSpan.range.start;\n var date1 = hit1.dateSpan.range.start;\n var delta = core.diffDates(date0, date1, dateEnv, hit0.component.largeUnit);\n var props = {};\n for (var _i = 0, transforms_1 = transforms; _i < transforms_1.length; _i++) {\n var transform = transforms_1[_i];\n var res = transform(hit0, hit1);\n if (res === false) {\n return null;\n }\n else if (res) {\n __assign(props, res);\n }\n }\n if (isFromStart) {\n if (dateEnv.add(instanceRange.start, delta) < instanceRange.end) {\n props.startDelta = delta;\n return props;\n }\n }\n else {\n if (dateEnv.add(instanceRange.end, delta) > instanceRange.start) {\n props.endDelta = delta;\n return props;\n }\n }\n return null;\n }\n\n var UnselectAuto = /** @class */ (function () {\n function UnselectAuto(calendar) {\n var _this = this;\n this.isRecentPointerDateSelect = false; // wish we could use a selector to detect date selection, but uses hit system\n this.onSelect = function (selectInfo) {\n if (selectInfo.jsEvent) {\n _this.isRecentPointerDateSelect = true;\n }\n };\n this.onDocumentPointerUp = function (pev) {\n var _a = _this, calendar = _a.calendar, documentPointer = _a.documentPointer;\n var state = calendar.state;\n // touch-scrolling should never unfocus any type of selection\n if (!documentPointer.wasTouchScroll) {\n if (state.dateSelection && // an existing date selection?\n !_this.isRecentPointerDateSelect // a new pointer-initiated date selection since last onDocumentPointerUp?\n ) {\n var unselectAuto = calendar.viewOpt('unselectAuto');\n var unselectCancel = calendar.viewOpt('unselectCancel');\n if (unselectAuto && (!unselectAuto || !core.elementClosest(documentPointer.downEl, unselectCancel))) {\n calendar.unselect(pev);\n }\n }\n if (state.eventSelection && // an existing event selected?\n !core.elementClosest(documentPointer.downEl, EventDragging.SELECTOR) // interaction DIDN'T start on an event\n ) {\n calendar.dispatch({ type: 'UNSELECT_EVENT' });\n }\n }\n _this.isRecentPointerDateSelect = false;\n };\n this.calendar = calendar;\n var documentPointer = this.documentPointer = new PointerDragging(document);\n documentPointer.shouldIgnoreMove = true;\n documentPointer.shouldWatchScroll = false;\n documentPointer.emitter.on('pointerup', this.onDocumentPointerUp);\n /*\n TODO: better way to know about whether there was a selection with the pointer\n */\n calendar.on('select', this.onSelect);\n }\n UnselectAuto.prototype.destroy = function () {\n this.calendar.off('select', this.onSelect);\n this.documentPointer.destroy();\n };\n return UnselectAuto;\n }());\n\n /*\n Given an already instantiated draggable object for one-or-more elements,\n Interprets any dragging as an attempt to drag an events that lives outside\n of a calendar onto a calendar.\n */\n var ExternalElementDragging = /** @class */ (function () {\n function ExternalElementDragging(dragging, suppliedDragMeta) {\n var _this = this;\n this.receivingCalendar = null;\n this.droppableEvent = null; // will exist for all drags, even if create:false\n this.suppliedDragMeta = null;\n this.dragMeta = null;\n this.handleDragStart = function (ev) {\n _this.dragMeta = _this.buildDragMeta(ev.subjectEl);\n };\n this.handleHitUpdate = function (hit, isFinal, ev) {\n var dragging = _this.hitDragging.dragging;\n var receivingCalendar = null;\n var droppableEvent = null;\n var isInvalid = false;\n var interaction = {\n affectedEvents: core.createEmptyEventStore(),\n mutatedEvents: core.createEmptyEventStore(),\n isEvent: _this.dragMeta.create,\n origSeg: null\n };\n if (hit) {\n receivingCalendar = hit.component.context.calendar;\n if (_this.canDropElOnCalendar(ev.subjectEl, receivingCalendar)) {\n droppableEvent = computeEventForDateSpan(hit.dateSpan, _this.dragMeta, receivingCalendar);\n interaction.mutatedEvents = core.eventTupleToStore(droppableEvent);\n isInvalid = !core.isInteractionValid(interaction, receivingCalendar);\n if (isInvalid) {\n interaction.mutatedEvents = core.createEmptyEventStore();\n droppableEvent = null;\n }\n }\n }\n _this.displayDrag(receivingCalendar, interaction);\n // show mirror if no already-rendered mirror element OR if we are shutting down the mirror (?)\n // TODO: wish we could somehow wait for dispatch to guarantee render\n dragging.setMirrorIsVisible(isFinal || !droppableEvent || !document.querySelector('.fc-mirror'));\n if (!isInvalid) {\n core.enableCursor();\n }\n else {\n core.disableCursor();\n }\n if (!isFinal) {\n dragging.setMirrorNeedsRevert(!droppableEvent);\n _this.receivingCalendar = receivingCalendar;\n _this.droppableEvent = droppableEvent;\n }\n };\n this.handleDragEnd = function (pev) {\n var _a = _this, receivingCalendar = _a.receivingCalendar, droppableEvent = _a.droppableEvent;\n _this.clearDrag();\n if (receivingCalendar && droppableEvent) {\n var finalHit = _this.hitDragging.finalHit;\n var finalView = finalHit.component.context.view;\n var dragMeta = _this.dragMeta;\n var arg = __assign({}, receivingCalendar.buildDatePointApi(finalHit.dateSpan), { draggedEl: pev.subjectEl, jsEvent: pev.origEvent, view: finalView });\n receivingCalendar.publiclyTrigger('drop', [arg]);\n if (dragMeta.create) {\n receivingCalendar.dispatch({\n type: 'MERGE_EVENTS',\n eventStore: core.eventTupleToStore(droppableEvent)\n });\n if (pev.isTouch) {\n receivingCalendar.dispatch({\n type: 'SELECT_EVENT',\n eventInstanceId: droppableEvent.instance.instanceId\n });\n }\n // signal that an external event landed\n receivingCalendar.publiclyTrigger('eventReceive', [\n {\n draggedEl: pev.subjectEl,\n event: new core.EventApi(receivingCalendar, droppableEvent.def, droppableEvent.instance),\n view: finalView\n }\n ]);\n }\n }\n _this.receivingCalendar = null;\n _this.droppableEvent = null;\n };\n var hitDragging = this.hitDragging = new HitDragging(dragging, core.interactionSettingsStore);\n hitDragging.requireInitial = false; // will start outside of a component\n hitDragging.emitter.on('dragstart', this.handleDragStart);\n hitDragging.emitter.on('hitupdate', this.handleHitUpdate);\n hitDragging.emitter.on('dragend', this.handleDragEnd);\n this.suppliedDragMeta = suppliedDragMeta;\n }\n ExternalElementDragging.prototype.buildDragMeta = function (subjectEl) {\n if (typeof this.suppliedDragMeta === 'object') {\n return core.parseDragMeta(this.suppliedDragMeta);\n }\n else if (typeof this.suppliedDragMeta === 'function') {\n return core.parseDragMeta(this.suppliedDragMeta(subjectEl));\n }\n else {\n return getDragMetaFromEl(subjectEl);\n }\n };\n ExternalElementDragging.prototype.displayDrag = function (nextCalendar, state) {\n var prevCalendar = this.receivingCalendar;\n if (prevCalendar && prevCalendar !== nextCalendar) {\n prevCalendar.dispatch({ type: 'UNSET_EVENT_DRAG' });\n }\n if (nextCalendar) {\n nextCalendar.dispatch({ type: 'SET_EVENT_DRAG', state: state });\n }\n };\n ExternalElementDragging.prototype.clearDrag = function () {\n if (this.receivingCalendar) {\n this.receivingCalendar.dispatch({ type: 'UNSET_EVENT_DRAG' });\n }\n };\n ExternalElementDragging.prototype.canDropElOnCalendar = function (el, receivingCalendar) {\n var dropAccept = receivingCalendar.opt('dropAccept');\n if (typeof dropAccept === 'function') {\n return dropAccept(el);\n }\n else if (typeof dropAccept === 'string' && dropAccept) {\n return Boolean(core.elementMatches(el, dropAccept));\n }\n return true;\n };\n return ExternalElementDragging;\n }());\n // Utils for computing event store from the DragMeta\n // ----------------------------------------------------------------------------------------------------\n function computeEventForDateSpan(dateSpan, dragMeta, calendar) {\n var defProps = __assign({}, dragMeta.leftoverProps);\n for (var _i = 0, _a = calendar.pluginSystem.hooks.externalDefTransforms; _i < _a.length; _i++) {\n var transform = _a[_i];\n __assign(defProps, transform(dateSpan, dragMeta));\n }\n var def = core.parseEventDef(defProps, dragMeta.sourceId, dateSpan.allDay, calendar.opt('forceEventDuration') || Boolean(dragMeta.duration), // hasEnd\n calendar);\n var start = dateSpan.range.start;\n // only rely on time info if drop zone is all-day,\n // otherwise, we already know the time\n if (dateSpan.allDay && dragMeta.startTime) {\n start = calendar.dateEnv.add(start, dragMeta.startTime);\n }\n var end = dragMeta.duration ?\n calendar.dateEnv.add(start, dragMeta.duration) :\n calendar.getDefaultEventEnd(dateSpan.allDay, start);\n var instance = core.createEventInstance(def.defId, { start: start, end: end });\n return { def: def, instance: instance };\n }\n // Utils for extracting data from element\n // ----------------------------------------------------------------------------------------------------\n function getDragMetaFromEl(el) {\n var str = getEmbeddedElData(el, 'event');\n var obj = str ?\n JSON.parse(str) :\n { create: false }; // if no embedded data, assume no event creation\n return core.parseDragMeta(obj);\n }\n core.config.dataAttrPrefix = '';\n function getEmbeddedElData(el, name) {\n var prefix = core.config.dataAttrPrefix;\n var prefixedName = (prefix ? prefix + '-' : '') + name;\n return el.getAttribute('data-' + prefixedName) || '';\n }\n\n /*\n Makes an element (that is *external* to any calendar) draggable.\n Can pass in data that determines how an event will be created when dropped onto a calendar.\n Leverages FullCalendar's internal drag-n-drop functionality WITHOUT a third-party drag system.\n */\n var ExternalDraggable = /** @class */ (function () {\n function ExternalDraggable(el, settings) {\n var _this = this;\n if (settings === void 0) { settings = {}; }\n this.handlePointerDown = function (ev) {\n var dragging = _this.dragging;\n var _a = _this.settings, minDistance = _a.minDistance, longPressDelay = _a.longPressDelay;\n dragging.minDistance =\n minDistance != null ?\n minDistance :\n (ev.isTouch ? 0 : core.globalDefaults.eventDragMinDistance);\n dragging.delay =\n ev.isTouch ? // TODO: eventually read eventLongPressDelay instead vvv\n (longPressDelay != null ? longPressDelay : core.globalDefaults.longPressDelay) :\n 0;\n };\n this.handleDragStart = function (ev) {\n if (ev.isTouch &&\n _this.dragging.delay &&\n ev.subjectEl.classList.contains('fc-event')) {\n _this.dragging.mirror.getMirrorEl().classList.add('fc-selected');\n }\n };\n this.settings = settings;\n var dragging = this.dragging = new FeaturefulElementDragging(el);\n dragging.touchScrollAllowed = false;\n if (settings.itemSelector != null) {\n dragging.pointer.selector = settings.itemSelector;\n }\n if (settings.appendTo != null) {\n dragging.mirror.parentNode = settings.appendTo; // TODO: write tests\n }\n dragging.emitter.on('pointerdown', this.handlePointerDown);\n dragging.emitter.on('dragstart', this.handleDragStart);\n new ExternalElementDragging(dragging, settings.eventData);\n }\n ExternalDraggable.prototype.destroy = function () {\n this.dragging.destroy();\n };\n return ExternalDraggable;\n }());\n\n /*\n Detects when a *THIRD-PARTY* drag-n-drop system interacts with elements.\n The third-party system is responsible for drawing the visuals effects of the drag.\n This class simply monitors for pointer movements and fires events.\n It also has the ability to hide the moving element (the \"mirror\") during the drag.\n */\n var InferredElementDragging = /** @class */ (function (_super) {\n __extends(InferredElementDragging, _super);\n function InferredElementDragging(containerEl) {\n var _this = _super.call(this, containerEl) || this;\n _this.shouldIgnoreMove = false;\n _this.mirrorSelector = '';\n _this.currentMirrorEl = null;\n _this.handlePointerDown = function (ev) {\n _this.emitter.trigger('pointerdown', ev);\n if (!_this.shouldIgnoreMove) {\n // fire dragstart right away. does not support delay or min-distance\n _this.emitter.trigger('dragstart', ev);\n }\n };\n _this.handlePointerMove = function (ev) {\n if (!_this.shouldIgnoreMove) {\n _this.emitter.trigger('dragmove', ev);\n }\n };\n _this.handlePointerUp = function (ev) {\n _this.emitter.trigger('pointerup', ev);\n if (!_this.shouldIgnoreMove) {\n // fire dragend right away. does not support a revert animation\n _this.emitter.trigger('dragend', ev);\n }\n };\n var pointer = _this.pointer = new PointerDragging(containerEl);\n pointer.emitter.on('pointerdown', _this.handlePointerDown);\n pointer.emitter.on('pointermove', _this.handlePointerMove);\n pointer.emitter.on('pointerup', _this.handlePointerUp);\n return _this;\n }\n InferredElementDragging.prototype.destroy = function () {\n this.pointer.destroy();\n };\n InferredElementDragging.prototype.setIgnoreMove = function (bool) {\n this.shouldIgnoreMove = bool;\n };\n InferredElementDragging.prototype.setMirrorIsVisible = function (bool) {\n if (bool) {\n // restore a previously hidden element.\n // use the reference in case the selector class has already been removed.\n if (this.currentMirrorEl) {\n this.currentMirrorEl.style.visibility = '';\n this.currentMirrorEl = null;\n }\n }\n else {\n var mirrorEl = this.mirrorSelector ?\n document.querySelector(this.mirrorSelector) :\n null;\n if (mirrorEl) {\n this.currentMirrorEl = mirrorEl;\n mirrorEl.style.visibility = 'hidden';\n }\n }\n };\n return InferredElementDragging;\n }(core.ElementDragging));\n\n /*\n Bridges third-party drag-n-drop systems with FullCalendar.\n Must be instantiated and destroyed by caller.\n */\n var ThirdPartyDraggable = /** @class */ (function () {\n function ThirdPartyDraggable(containerOrSettings, settings) {\n var containerEl = document;\n if (\n // wish we could just test instanceof EventTarget, but doesn't work in IE11\n containerOrSettings === document ||\n containerOrSettings instanceof Element) {\n containerEl = containerOrSettings;\n settings = settings || {};\n }\n else {\n settings = (containerOrSettings || {});\n }\n var dragging = this.dragging = new InferredElementDragging(containerEl);\n if (typeof settings.itemSelector === 'string') {\n dragging.pointer.selector = settings.itemSelector;\n }\n else if (containerEl === document) {\n dragging.pointer.selector = '[data-event]';\n }\n if (typeof settings.mirrorSelector === 'string') {\n dragging.mirrorSelector = settings.mirrorSelector;\n }\n new ExternalElementDragging(dragging, settings.eventData);\n }\n ThirdPartyDraggable.prototype.destroy = function () {\n this.dragging.destroy();\n };\n return ThirdPartyDraggable;\n }());\n\n var main = core.createPlugin({\n componentInteractions: [DateClicking, DateSelecting, EventDragging, EventDragging$1],\n calendarInteractions: [UnselectAuto],\n elementDraggingImpl: FeaturefulElementDragging\n });\n\n exports.Draggable = ExternalDraggable;\n exports.FeaturefulElementDragging = FeaturefulElementDragging;\n exports.PointerDragging = PointerDragging;\n exports.ThirdPartyDraggable = ThirdPartyDraggable;\n exports.default = main;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","/*!\nFullCalendar List View Plugin v4.4.2\nDocs & License: https://fullcalendar.io/\n(c) 2019 Adam Shaw\n*/\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@fullcalendar/core')) :\n typeof define === 'function' && define.amd ? define(['exports', '@fullcalendar/core'], factory) :\n (global = global || self, factory(global.FullCalendarList = {}, global.FullCalendar));\n}(this, function (exports, core) { 'use strict';\n\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation.\r\n\r\n Permission to use, copy, modify, and/or distribute this software for any\r\n purpose with or without fee is hereby granted.\r\n\r\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\n AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\n LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\n OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\n PERFORMANCE OF THIS SOFTWARE.\r\n ***************************************************************************** */\r\n /* global Reflect, Promise */\r\n\r\n var extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n\r\n function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n }\n\n var ListEventRenderer = /** @class */ (function (_super) {\n __extends(ListEventRenderer, _super);\n function ListEventRenderer(listView) {\n var _this = _super.call(this) || this;\n _this.listView = listView;\n return _this;\n }\n ListEventRenderer.prototype.attachSegs = function (segs) {\n if (!segs.length) {\n this.listView.renderEmptyMessage();\n }\n else {\n this.listView.renderSegList(segs);\n }\n };\n ListEventRenderer.prototype.detachSegs = function () {\n };\n // generates the HTML for a single event row\n ListEventRenderer.prototype.renderSegHtml = function (seg) {\n var _a = this.context, theme = _a.theme, options = _a.options;\n var eventRange = seg.eventRange;\n var eventDef = eventRange.def;\n var eventInstance = eventRange.instance;\n var eventUi = eventRange.ui;\n var url = eventDef.url;\n var classes = ['fc-list-item'].concat(eventUi.classNames);\n var bgColor = eventUi.backgroundColor;\n var timeHtml;\n if (eventDef.allDay) {\n timeHtml = core.getAllDayHtml(options);\n }\n else if (core.isMultiDayRange(eventRange.range)) {\n if (seg.isStart) {\n timeHtml = core.htmlEscape(this._getTimeText(eventInstance.range.start, seg.end, false // allDay\n ));\n }\n else if (seg.isEnd) {\n timeHtml = core.htmlEscape(this._getTimeText(seg.start, eventInstance.range.end, false // allDay\n ));\n }\n else { // inner segment that lasts the whole day\n timeHtml = core.getAllDayHtml(options);\n }\n }\n else {\n // Display the normal time text for the *event's* times\n timeHtml = core.htmlEscape(this.getTimeText(eventRange));\n }\n if (url) {\n classes.push('fc-has-url');\n }\n return '
' +\n (this.displayEventTime ?\n '' +\n (timeHtml || '') +\n ' | ' :\n '') +\n '' +\n '' +\n ' | ' +\n '' +\n '' +\n core.htmlEscape(eventDef.title || '') +\n '' +\n ' | ' +\n '
';\n };\n // like \"4:00am\"\n ListEventRenderer.prototype.computeEventTimeFormat = function () {\n return {\n hour: 'numeric',\n minute: '2-digit',\n meridiem: 'short'\n };\n };\n return ListEventRenderer;\n }(core.FgEventRenderer));\n\n /*\n Responsible for the scroller, and forwarding event-related actions into the \"grid\".\n */\n var ListView = /** @class */ (function (_super) {\n __extends(ListView, _super);\n function ListView(viewSpec, parentEl) {\n var _this = _super.call(this, viewSpec, parentEl) || this;\n _this.computeDateVars = core.memoize(computeDateVars);\n _this.eventStoreToSegs = core.memoize(_this._eventStoreToSegs);\n _this.renderSkeleton = core.memoizeRendering(_this._renderSkeleton, _this._unrenderSkeleton);\n var eventRenderer = _this.eventRenderer = new ListEventRenderer(_this);\n _this.renderContent = core.memoizeRendering(eventRenderer.renderSegs.bind(eventRenderer), eventRenderer.unrender.bind(eventRenderer), [_this.renderSkeleton]);\n return _this;\n }\n ListView.prototype.firstContext = function (context) {\n context.calendar.registerInteractiveComponent(this, {\n el: this.el\n // TODO: make aware that it doesn't do Hits\n });\n };\n ListView.prototype.render = function (props, context) {\n _super.prototype.render.call(this, props, context);\n var _a = this.computeDateVars(props.dateProfile), dayDates = _a.dayDates, dayRanges = _a.dayRanges;\n this.dayDates = dayDates;\n this.renderSkeleton(context);\n this.renderContent(context, this.eventStoreToSegs(props.eventStore, props.eventUiBases, dayRanges));\n };\n ListView.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.renderSkeleton.unrender();\n this.renderContent.unrender();\n this.context.calendar.unregisterInteractiveComponent(this);\n };\n ListView.prototype._renderSkeleton = function (context) {\n var theme = context.theme;\n this.el.classList.add('fc-list-view');\n var listViewClassNames = (theme.getClass('listView') || '').split(' '); // wish we didn't have to do this\n for (var _i = 0, listViewClassNames_1 = listViewClassNames; _i < listViewClassNames_1.length; _i++) {\n var listViewClassName = listViewClassNames_1[_i];\n if (listViewClassName) { // in case input was empty string\n this.el.classList.add(listViewClassName);\n }\n }\n this.scroller = new core.ScrollComponent('hidden', // overflow x\n 'auto' // overflow y\n );\n this.el.appendChild(this.scroller.el);\n this.contentEl = this.scroller.el; // shortcut\n };\n ListView.prototype._unrenderSkeleton = function () {\n // TODO: remove classNames\n this.scroller.destroy(); // will remove the Grid too\n };\n ListView.prototype.updateSize = function (isResize, viewHeight, isAuto) {\n _super.prototype.updateSize.call(this, isResize, viewHeight, isAuto);\n this.eventRenderer.computeSizes(isResize);\n this.eventRenderer.assignSizes(isResize);\n this.scroller.clear(); // sets height to 'auto' and clears overflow\n if (!isAuto) {\n this.scroller.setHeight(this.computeScrollerHeight(viewHeight));\n }\n };\n ListView.prototype.computeScrollerHeight = function (viewHeight) {\n return viewHeight -\n core.subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller\n };\n ListView.prototype._eventStoreToSegs = function (eventStore, eventUiBases, dayRanges) {\n return this.eventRangesToSegs(core.sliceEventStore(eventStore, eventUiBases, this.props.dateProfile.activeRange, this.context.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 _a = this.context, dateEnv = _a.dateEnv, nextDayThreshold = _a.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++) {\n segRange = core.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 ListView.prototype.renderEmptyMessage = function () {\n this.contentEl.innerHTML =\n '
' + // TODO: try less wraps\n '
' +\n '
' +\n core.htmlEscape(this.context.options.noEventsMessage) +\n '
' +\n '
' +\n '
';\n };\n // called by ListEventRenderer\n ListView.prototype.renderSegList = function (allSegs) {\n var theme = this.context.theme;\n var segsByDay = this.groupSegsByDay(allSegs); // sparse array\n var dayIndex;\n var daySegs;\n var i;\n var tableEl = core.htmlToElement('
');\n var tbodyEl = tableEl.querySelector('tbody');\n for (dayIndex = 0; dayIndex < segsByDay.length; dayIndex++) {\n daySegs = segsByDay[dayIndex];\n if (daySegs) { // sparse array, so might be undefined\n // append a day header\n tbodyEl.appendChild(this.buildDayHeaderRow(this.dayDates[dayIndex]));\n daySegs = this.eventRenderer.sortEventSegs(daySegs);\n for (i = 0; i < daySegs.length; i++) {\n tbodyEl.appendChild(daySegs[i].el); // append event row\n }\n }\n }\n this.contentEl.innerHTML = '';\n this.contentEl.appendChild(tableEl);\n };\n // Returns a sparse array of arrays, segs grouped by their dayIndex\n ListView.prototype.groupSegsByDay = function (segs) {\n var segsByDay = []; // sparse array\n var i;\n var seg;\n for (i = 0; i < segs.length; i++) {\n seg = segs[i];\n (segsByDay[seg.dayIndex] || (segsByDay[seg.dayIndex] = []))\n .push(seg);\n }\n return segsByDay;\n };\n // generates the HTML for the day headers that live amongst the event rows\n ListView.prototype.buildDayHeaderRow = function (dayDate) {\n var _a = this.context, theme = _a.theme, dateEnv = _a.dateEnv, options = _a.options;\n var mainFormat = core.createFormatter(options.listDayFormat); // TODO: cache\n var altFormat = core.createFormatter(options.listDayAltFormat); // TODO: cache\n return core.createElement('tr', {\n className: 'fc-list-heading',\n 'data-date': dateEnv.formatIso(dayDate, { omitTime: true })\n }, '
' +\n (mainFormat ?\n core.buildGotoAnchorHtml(options, dateEnv, dayDate, { 'class': 'fc-list-heading-main' }, core.htmlEscape(dateEnv.format(dayDate, mainFormat)) // inner HTML\n ) :\n '') +\n (altFormat ?\n core.buildGotoAnchorHtml(options, dateEnv, dayDate, { 'class': 'fc-list-heading-alt' }, core.htmlEscape(dateEnv.format(dayDate, altFormat)) // inner HTML\n ) :\n '') +\n ' | ');\n };\n return ListView;\n }(core.View));\n ListView.prototype.fgSegSelector = '.fc-list-item'; // which elements accept event actions\n function computeDateVars(dateProfile) {\n var dayStart = core.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: core.addDays(dayStart, 1)\n });\n dayStart = core.addDays(dayStart, 1);\n }\n return { dayDates: dayDates, dayRanges: dayRanges };\n }\n\n var main = core.createPlugin({\n views: {\n list: {\n class: 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 header\n },\n listWeek: {\n type: 'list',\n duration: { weeks: 1 },\n listDayFormat: { weekday: 'long' },\n listDayAltFormat: { month: 'long', day: 'numeric', year: 'numeric' }\n },\n listMonth: {\n type: 'list',\n duration: { month: 1 },\n listDayAltFormat: { weekday: 'long' } // day-of-week is nice-to-have\n },\n listYear: {\n type: 'list',\n duration: { year: 1 },\n listDayAltFormat: { weekday: 'long' } // day-of-week is nice-to-have\n }\n }\n });\n\n exports.ListView = ListView;\n exports.default = main;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","/*!\nFullCalendar Time Grid Plugin v4.4.2\nDocs & License: https://fullcalendar.io/\n(c) 2019 Adam Shaw\n*/\n\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@fullcalendar/core'), require('@fullcalendar/daygrid')) :\n typeof define === 'function' && define.amd ? define(['exports', '@fullcalendar/core', '@fullcalendar/daygrid'], factory) :\n (global = global || self, factory(global.FullCalendarTimeGrid = {}, global.FullCalendar, global.FullCalendarDayGrid));\n}(this, function (exports, core, daygrid) { 'use strict';\n\n /*! *****************************************************************************\r\n Copyright (c) Microsoft Corporation.\r\n\r\n Permission to use, copy, modify, and/or distribute this software for any\r\n purpose with or without fee is hereby granted.\r\n\r\n THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\n REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\n AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\n INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\n LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\n OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\n PERFORMANCE OF THIS SOFTWARE.\r\n ***************************************************************************** */\r\n /* global Reflect, Promise */\r\n\r\n var extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n };\r\n\r\n function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n }\r\n\r\n var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n };\n\n /*\n Only handles foreground segs.\n Does not own rendering. Use for low-level util methods by TimeGrid.\n */\n var TimeGridEventRenderer = /** @class */ (function (_super) {\n __extends(TimeGridEventRenderer, _super);\n function TimeGridEventRenderer(timeGrid) {\n var _this = _super.call(this) || this;\n _this.timeGrid = timeGrid;\n return _this;\n }\n TimeGridEventRenderer.prototype.renderSegs = function (context, segs, mirrorInfo) {\n _super.prototype.renderSegs.call(this, context, segs, mirrorInfo);\n // TODO: dont do every time. memoize\n this.fullTimeFormat = core.createFormatter({\n hour: 'numeric',\n minute: '2-digit',\n separator: this.context.options.defaultRangeSeparator\n });\n };\n // Given an array of foreground segments, render a DOM element for each, computes position,\n // and attaches to the column inner-container elements.\n TimeGridEventRenderer.prototype.attachSegs = function (segs, mirrorInfo) {\n var segsByCol = this.timeGrid.groupSegsByCol(segs);\n // order the segs within each column\n // TODO: have groupSegsByCol do this?\n for (var col = 0; col < segsByCol.length; col++) {\n segsByCol[col] = this.sortEventSegs(segsByCol[col]);\n }\n this.segsByCol = segsByCol;\n this.timeGrid.attachSegsByCol(segsByCol, this.timeGrid.fgContainerEls);\n };\n TimeGridEventRenderer.prototype.detachSegs = function (segs) {\n segs.forEach(function (seg) {\n core.removeElement(seg.el);\n });\n this.segsByCol = null;\n };\n TimeGridEventRenderer.prototype.computeSegSizes = function (allSegs) {\n var _a = this, timeGrid = _a.timeGrid, segsByCol = _a.segsByCol;\n var colCnt = timeGrid.colCnt;\n timeGrid.computeSegVerticals(allSegs); // horizontals relies on this\n if (segsByCol) {\n for (var col = 0; col < colCnt; col++) {\n this.computeSegHorizontals(segsByCol[col]); // compute horizontal coordinates, z-index's, and reorder the array\n }\n }\n };\n TimeGridEventRenderer.prototype.assignSegSizes = function (allSegs) {\n var _a = this, timeGrid = _a.timeGrid, segsByCol = _a.segsByCol;\n var colCnt = timeGrid.colCnt;\n timeGrid.assignSegVerticals(allSegs); // horizontals relies on this\n if (segsByCol) {\n for (var col = 0; col < colCnt; col++) {\n this.assignSegCss(segsByCol[col]);\n }\n }\n };\n // Computes a default event time formatting string if `eventTimeFormat` is not explicitly defined\n TimeGridEventRenderer.prototype.computeEventTimeFormat = function () {\n return {\n hour: 'numeric',\n minute: '2-digit',\n meridiem: false\n };\n };\n // Computes a default `displayEventEnd` value if one is not expliclty defined\n TimeGridEventRenderer.prototype.computeDisplayEventEnd = function () {\n return true;\n };\n // Renders the HTML for a single event segment's default rendering\n TimeGridEventRenderer.prototype.renderSegHtml = function (seg, mirrorInfo) {\n var eventRange = seg.eventRange;\n var eventDef = eventRange.def;\n var eventUi = eventRange.ui;\n var allDay = eventDef.allDay;\n var isDraggable = core.computeEventDraggable(this.context, eventDef, eventUi);\n var isResizableFromStart = seg.isStart && core.computeEventStartResizable(this.context, eventDef, eventUi);\n var isResizableFromEnd = seg.isEnd && core.computeEventEndResizable(this.context, eventDef, eventUi);\n var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd, mirrorInfo);\n var skinCss = core.cssToStr(this.getSkinCss(eventUi));\n var timeText;\n var fullTimeText; // more verbose time text. for the print stylesheet\n var startTimeText; // just the start time text\n classes.unshift('fc-time-grid-event');\n // if the event appears to span more than one day...\n if (core.isMultiDayRange(eventRange.range)) {\n // Don't display time text on segments that run entirely through a day.\n // That would appear as midnight-midnight and would look dumb.\n // Otherwise, display the time text for the *segment's* times (like 6pm-midnight or midnight-10am)\n if (seg.isStart || seg.isEnd) {\n var unzonedStart = seg.start;\n var unzonedEnd = seg.end;\n timeText = this._getTimeText(unzonedStart, unzonedEnd, allDay); // TODO: give the timezones\n fullTimeText = this._getTimeText(unzonedStart, unzonedEnd, allDay, this.fullTimeFormat);\n startTimeText = this._getTimeText(unzonedStart, unzonedEnd, allDay, null, false); // displayEnd=false\n }\n }\n else {\n // Display the normal time text for the *event's* times\n timeText = this.getTimeText(eventRange);\n fullTimeText = this.getTimeText(eventRange, this.fullTimeFormat);\n startTimeText = this.getTimeText(eventRange, null, false); // displayEnd=false\n }\n return '
' +\n '' +\n (timeText ?\n '
' +\n '' + core.htmlEscape(timeText) + '' +\n '
' :\n '') +\n (eventDef.title ?\n '
' +\n core.htmlEscape(eventDef.title) +\n '
' :\n '') +\n '
' +\n /* TODO: write CSS for this\n (isResizableFromStart ?\n '' :\n ''\n ) +\n */\n (isResizableFromEnd ?\n '' :\n '') +\n '';\n };\n // Given an array of segments that are all in the same column, sets the backwardCoord and forwardCoord on each.\n // Assumed the segs are already ordered.\n // NOTE: Also reorders the given array by date!\n TimeGridEventRenderer.prototype.computeSegHorizontals = function (segs) {\n var levels;\n var level0;\n var i;\n levels = buildSlotSegLevels(segs);\n computeForwardSlotSegs(levels);\n if ((level0 = levels[0])) {\n for (i = 0; i < level0.length; i++) {\n computeSlotSegPressures(level0[i]);\n }\n for (i = 0; i < level0.length; i++) {\n this.computeSegForwardBack(level0[i], 0, 0);\n }\n }\n };\n // Calculate seg.forwardCoord and seg.backwardCoord for the segment, where both values range\n // from 0 to 1. If the calendar is left-to-right, the seg.backwardCoord maps to \"left\" and\n // seg.forwardCoord maps to \"right\" (via percentage). Vice-versa if the calendar is right-to-left.\n //\n // The segment might be part of a \"series\", which means consecutive segments with the same pressure\n // who's width is unknown until an edge has been hit. `seriesBackwardPressure` is the number of\n // segments behind this one in the current series, and `seriesBackwardCoord` is the starting\n // coordinate of the first segment in the series.\n TimeGridEventRenderer.prototype.computeSegForwardBack = function (seg, seriesBackwardPressure, seriesBackwardCoord) {\n var forwardSegs = seg.forwardSegs;\n var i;\n if (seg.forwardCoord === undefined) { // not already computed\n if (!forwardSegs.length) {\n // if there are no forward segments, this segment should butt up against the edge\n seg.forwardCoord = 1;\n }\n else {\n // sort highest pressure first\n this.sortForwardSegs(forwardSegs);\n // this segment's forwardCoord will be calculated from the backwardCoord of the\n // highest-pressure forward segment.\n this.computeSegForwardBack(forwardSegs[0], seriesBackwardPressure + 1, seriesBackwardCoord);\n seg.forwardCoord = forwardSegs[0].backwardCoord;\n }\n // calculate the backwardCoord from the forwardCoord. consider the series\n seg.backwardCoord = seg.forwardCoord -\n (seg.forwardCoord - seriesBackwardCoord) / // available width for series\n (seriesBackwardPressure + 1); // # of segments in the series\n // use this segment's coordinates to computed the coordinates of the less-pressurized\n // forward segments\n for (i = 0; i < forwardSegs.length; i++) {\n this.computeSegForwardBack(forwardSegs[i], 0, seg.forwardCoord);\n }\n }\n };\n TimeGridEventRenderer.prototype.sortForwardSegs = function (forwardSegs) {\n var objs = forwardSegs.map(buildTimeGridSegCompareObj);\n var specs = [\n // put higher-pressure first\n { field: 'forwardPressure', order: -1 },\n // put segments that are closer to initial edge first (and favor ones with no coords yet)\n { field: 'backwardCoord', order: 1 }\n ].concat(this.context.eventOrderSpecs);\n objs.sort(function (obj0, obj1) {\n return core.compareByFieldSpecs(obj0, obj1, specs);\n });\n return objs.map(function (c) {\n return c._seg;\n });\n };\n // Given foreground event segments that have already had their position coordinates computed,\n // assigns position-related CSS values to their elements.\n TimeGridEventRenderer.prototype.assignSegCss = function (segs) {\n for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) {\n var seg = segs_1[_i];\n core.applyStyle(seg.el, this.generateSegCss(seg));\n if (seg.level > 0) {\n seg.el.classList.add('fc-time-grid-event-inset');\n }\n // if the event is short that the title will be cut off,\n // attach a className that condenses the title into the time area.\n if (seg.eventRange.def.title && seg.bottom - seg.top < 30) {\n seg.el.classList.add('fc-short'); // TODO: \"condensed\" is a better name\n }\n }\n };\n // Generates an object with CSS properties/values that should be applied to an event segment element.\n // Contains important positioning-related properties that should be applied to any event element, customized or not.\n TimeGridEventRenderer.prototype.generateSegCss = function (seg) {\n var shouldOverlap = this.context.options.slotEventOverlap;\n var backwardCoord = seg.backwardCoord; // the left side if LTR. the right side if RTL. floating-point\n var forwardCoord = seg.forwardCoord; // the right side if LTR. the left side if RTL. floating-point\n var props = this.timeGrid.generateSegVerticalCss(seg); // get top/bottom first\n var isRtl = this.context.isRtl;\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 forwardCoord = Math.min(1, backwardCoord + (forwardCoord - backwardCoord) * 2);\n }\n if (isRtl) {\n left = 1 - forwardCoord;\n right = backwardCoord;\n }\n else {\n left = backwardCoord;\n right = 1 - forwardCoord;\n }\n props.zIndex = seg.level + 1; // convert from 0-base to 1-based\n props.left = left * 100 + '%';\n props.right = right * 100 + '%';\n if (shouldOverlap && seg.forwardPressure) {\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 TimeGridEventRenderer;\n }(core.FgEventRenderer));\n // Builds an array of segments \"levels\". The first level will be the leftmost tier of segments if the calendar is\n // left-to-right, or the rightmost if the calendar is right-to-left. Assumes the segments are already ordered by date.\n function buildSlotSegLevels(segs) {\n var levels = [];\n var i;\n var seg;\n var j;\n for (i = 0; i < segs.length; i++) {\n seg = segs[i];\n // go through all the levels and stop on the first level where there are no collisions\n for (j = 0; j < levels.length; j++) {\n if (!computeSlotSegCollisions(seg, levels[j]).length) {\n break;\n }\n }\n seg.level = j;\n (levels[j] || (levels[j] = [])).push(seg);\n }\n return levels;\n }\n // For every segment, figure out the other segments that are in subsequent\n // levels that also occupy the same vertical space. Accumulate in seg.forwardSegs\n function computeForwardSlotSegs(levels) {\n var i;\n var level;\n var j;\n var seg;\n var k;\n for (i = 0; i < levels.length; i++) {\n level = levels[i];\n for (j = 0; j < level.length; j++) {\n seg = level[j];\n seg.forwardSegs = [];\n for (k = i + 1; k < levels.length; k++) {\n computeSlotSegCollisions(seg, levels[k], seg.forwardSegs);\n }\n }\n }\n }\n // Figure out which path forward (via seg.forwardSegs) results in the longest path until\n // the furthest edge is reached. The number of segments in this path will be seg.forwardPressure\n function computeSlotSegPressures(seg) {\n var forwardSegs = seg.forwardSegs;\n var forwardPressure = 0;\n var i;\n var forwardSeg;\n if (seg.forwardPressure === undefined) { // not already computed\n for (i = 0; i < forwardSegs.length; i++) {\n forwardSeg = forwardSegs[i];\n // figure out the child's maximum forward path\n computeSlotSegPressures(forwardSeg);\n // either use the existing maximum, or use the child's forward pressure\n // plus one (for the forwardSeg itself)\n forwardPressure = Math.max(forwardPressure, 1 + forwardSeg.forwardPressure);\n }\n seg.forwardPressure = forwardPressure;\n }\n }\n // Find all the segments in `otherSegs` that vertically collide with `seg`.\n // Append into an optionally-supplied `results` array and return.\n function computeSlotSegCollisions(seg, otherSegs, results) {\n if (results === void 0) { results = []; }\n for (var i = 0; i < otherSegs.length; i++) {\n if (isSlotSegCollision(seg, otherSegs[i])) {\n results.push(otherSegs[i]);\n }\n }\n return results;\n }\n // Do these segments occupy the same vertical space?\n function isSlotSegCollision(seg1, seg2) {\n return seg1.bottom > seg2.top && seg1.top < seg2.bottom;\n }\n function buildTimeGridSegCompareObj(seg) {\n var obj = core.buildSegCompareObj(seg);\n obj.forwardPressure = seg.forwardPressure;\n obj.backwardCoord = seg.backwardCoord;\n return obj;\n }\n\n var TimeGridMirrorRenderer = /** @class */ (function (_super) {\n __extends(TimeGridMirrorRenderer, _super);\n function TimeGridMirrorRenderer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TimeGridMirrorRenderer.prototype.attachSegs = function (segs, mirrorInfo) {\n this.segsByCol = this.timeGrid.groupSegsByCol(segs);\n this.timeGrid.attachSegsByCol(this.segsByCol, this.timeGrid.mirrorContainerEls);\n this.sourceSeg = mirrorInfo.sourceSeg;\n };\n TimeGridMirrorRenderer.prototype.generateSegCss = function (seg) {\n var props = _super.prototype.generateSegCss.call(this, seg);\n var sourceSeg = this.sourceSeg;\n if (sourceSeg && sourceSeg.col === seg.col) {\n var sourceSegProps = _super.prototype.generateSegCss.call(this, sourceSeg);\n props.left = sourceSegProps.left;\n props.right = sourceSegProps.right;\n props.marginLeft = sourceSegProps.marginLeft;\n props.marginRight = sourceSegProps.marginRight;\n }\n return props;\n };\n return TimeGridMirrorRenderer;\n }(TimeGridEventRenderer));\n\n var TimeGridFillRenderer = /** @class */ (function (_super) {\n __extends(TimeGridFillRenderer, _super);\n function TimeGridFillRenderer(timeGrid) {\n var _this = _super.call(this) || this;\n _this.timeGrid = timeGrid;\n return _this;\n }\n TimeGridFillRenderer.prototype.attachSegs = function (type, segs) {\n var timeGrid = this.timeGrid;\n var containerEls;\n // TODO: more efficient lookup\n if (type === 'bgEvent') {\n containerEls = timeGrid.bgContainerEls;\n }\n else if (type === 'businessHours') {\n containerEls = timeGrid.businessContainerEls;\n }\n else if (type === 'highlight') {\n containerEls = timeGrid.highlightContainerEls;\n }\n timeGrid.attachSegsByCol(timeGrid.groupSegsByCol(segs), containerEls);\n return segs.map(function (seg) {\n return seg.el;\n });\n };\n TimeGridFillRenderer.prototype.computeSegSizes = function (segs) {\n this.timeGrid.computeSegVerticals(segs);\n };\n TimeGridFillRenderer.prototype.assignSegSizes = function (segs) {\n this.timeGrid.assignSegVerticals(segs);\n };\n return TimeGridFillRenderer;\n }(core.FillRenderer));\n\n /* A component that renders one or more columns of vertical time slots\n ----------------------------------------------------------------------------------------------------------------------*/\n // potential nice values for the slot-duration and interval-duration\n // from largest to smallest\n var AGENDA_STOCK_SUB_DURATIONS = [\n { hours: 1 },\n { minutes: 30 },\n { minutes: 15 },\n { seconds: 30 },\n { seconds: 15 }\n ];\n var TimeGrid = /** @class */ (function (_super) {\n __extends(TimeGrid, _super);\n function TimeGrid(el, renderProps) {\n var _this = _super.call(this, el) || this;\n _this.isSlatSizesDirty = false;\n _this.isColSizesDirty = false;\n _this.processOptions = core.memoize(_this._processOptions);\n _this.renderSkeleton = core.memoizeRendering(_this._renderSkeleton);\n _this.renderSlats = core.memoizeRendering(_this._renderSlats, null, [_this.renderSkeleton]);\n _this.renderColumns = core.memoizeRendering(_this._renderColumns, _this._unrenderColumns, [_this.renderSkeleton]);\n _this.renderProps = renderProps;\n var renderColumns = _this.renderColumns;\n var eventRenderer = _this.eventRenderer = new TimeGridEventRenderer(_this);\n var fillRenderer = _this.fillRenderer = new TimeGridFillRenderer(_this);\n _this.mirrorRenderer = new TimeGridMirrorRenderer(_this);\n _this.renderBusinessHours = core.memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'businessHours'), fillRenderer.unrender.bind(fillRenderer, 'businessHours'), [renderColumns]);\n _this.renderDateSelection = core.memoizeRendering(_this._renderDateSelection, _this._unrenderDateSelection, [renderColumns]);\n _this.renderFgEvents = core.memoizeRendering(eventRenderer.renderSegs.bind(eventRenderer), eventRenderer.unrender.bind(eventRenderer), [renderColumns]);\n _this.renderBgEvents = core.memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'bgEvent'), fillRenderer.unrender.bind(fillRenderer, 'bgEvent'), [renderColumns]);\n _this.renderEventSelection = core.memoizeRendering(eventRenderer.selectByInstanceId.bind(eventRenderer), eventRenderer.unselectByInstanceId.bind(eventRenderer), [_this.renderFgEvents]);\n _this.renderEventDrag = core.memoizeRendering(_this._renderEventDrag, _this._unrenderEventDrag, [renderColumns]);\n _this.renderEventResize = core.memoizeRendering(_this._renderEventResize, _this._unrenderEventResize, [renderColumns]);\n return _this;\n }\n /* Options\n ------------------------------------------------------------------------------------------------------------------*/\n // Parses various options into properties of this object\n // MUST have context already set\n TimeGrid.prototype._processOptions = function (options) {\n var slotDuration = options.slotDuration, snapDuration = options.snapDuration;\n var snapsPerSlot;\n var input;\n slotDuration = core.createDuration(slotDuration);\n snapDuration = snapDuration ? core.createDuration(snapDuration) : slotDuration;\n snapsPerSlot = core.wholeDivideDurations(slotDuration, snapDuration);\n if (snapsPerSlot === null) {\n snapDuration = slotDuration;\n snapsPerSlot = 1;\n // TODO: say warning?\n }\n this.slotDuration = slotDuration;\n this.snapDuration = snapDuration;\n this.snapsPerSlot = snapsPerSlot;\n // might be an array value (for TimelineView).\n // if so, getting the most granular entry (the last one probably).\n input = options.slotLabelFormat;\n if (Array.isArray(input)) {\n input = input[input.length - 1];\n }\n this.labelFormat = core.createFormatter(input || {\n hour: 'numeric',\n minute: '2-digit',\n omitZeroMinute: true,\n meridiem: 'short'\n });\n input = options.slotLabelInterval;\n this.labelInterval = input ?\n core.createDuration(input) :\n this.computeLabelInterval(slotDuration);\n };\n // Computes an automatic value for slotLabelInterval\n TimeGrid.prototype.computeLabelInterval = function (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 = AGENDA_STOCK_SUB_DURATIONS.length - 1; i >= 0; i--) {\n labelInterval = core.createDuration(AGENDA_STOCK_SUB_DURATIONS[i]);\n slotsPerLabel = core.wholeDivideDurations(labelInterval, slotDuration);\n if (slotsPerLabel !== null && slotsPerLabel > 1) {\n return labelInterval;\n }\n }\n return slotDuration; // fall back\n };\n /* Rendering\n ------------------------------------------------------------------------------------------------------------------*/\n TimeGrid.prototype.render = function (props, context) {\n this.processOptions(context.options);\n var cells = props.cells;\n this.colCnt = cells.length;\n this.renderSkeleton(context.theme);\n this.renderSlats(props.dateProfile);\n this.renderColumns(props.cells, props.dateProfile);\n this.renderBusinessHours(context, props.businessHourSegs);\n this.renderDateSelection(props.dateSelectionSegs);\n this.renderFgEvents(context, props.fgEventSegs);\n this.renderBgEvents(context, props.bgEventSegs);\n this.renderEventSelection(props.eventSelection);\n this.renderEventDrag(props.eventDrag);\n this.renderEventResize(props.eventResize);\n };\n TimeGrid.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n // should unrender everything else too\n this.renderSlats.unrender();\n this.renderColumns.unrender();\n this.renderSkeleton.unrender();\n };\n TimeGrid.prototype.updateSize = function (isResize) {\n var _a = this, fillRenderer = _a.fillRenderer, eventRenderer = _a.eventRenderer, mirrorRenderer = _a.mirrorRenderer;\n if (isResize || this.isSlatSizesDirty) {\n this.buildSlatPositions();\n this.isSlatSizesDirty = false;\n }\n if (isResize || this.isColSizesDirty) {\n this.buildColPositions();\n this.isColSizesDirty = false;\n }\n fillRenderer.computeSizes(isResize);\n eventRenderer.computeSizes(isResize);\n mirrorRenderer.computeSizes(isResize);\n fillRenderer.assignSizes(isResize);\n eventRenderer.assignSizes(isResize);\n mirrorRenderer.assignSizes(isResize);\n };\n TimeGrid.prototype._renderSkeleton = function (theme) {\n var el = this.el;\n el.innerHTML =\n '
' +\n '
' +\n '
';\n this.rootBgContainerEl = el.querySelector('.fc-bg');\n this.slatContainerEl = el.querySelector('.fc-slats');\n this.bottomRuleEl = el.querySelector('.fc-divider');\n };\n TimeGrid.prototype._renderSlats = function (dateProfile) {\n var theme = this.context.theme;\n this.slatContainerEl.innerHTML =\n '
' +\n this.renderSlatRowHtml(dateProfile) +\n '
';\n this.slatEls = core.findElements(this.slatContainerEl, 'tr');\n this.slatPositions = new core.PositionCache(this.el, this.slatEls, false, true // vertical\n );\n this.isSlatSizesDirty = true;\n };\n // Generates the HTML for the horizontal \"slats\" that run width-wise. Has a time axis on a side. Depends on RTL.\n TimeGrid.prototype.renderSlatRowHtml = function (dateProfile) {\n var _a = this.context, dateEnv = _a.dateEnv, theme = _a.theme, isRtl = _a.isRtl;\n var html = '';\n var dayStart = core.startOfDay(dateProfile.renderRange.start);\n var slotTime = dateProfile.minTime;\n var slotIterator = core.createDuration(0);\n var slotDate; // will be on the view's first day, but we only care about its time\n var isLabeled;\n var axisHtml;\n // Calculate the time for each slot\n while (core.asRoughMs(slotTime) < core.asRoughMs(dateProfile.maxTime)) {\n slotDate = dateEnv.add(dayStart, slotTime);\n isLabeled = core.wholeDivideDurations(slotIterator, this.labelInterval) !== null;\n axisHtml =\n '
' +\n (isLabeled ?\n '' + // for matchCellWidths\n core.htmlEscape(dateEnv.format(slotDate, this.labelFormat)) +\n '' :\n '') +\n ' | ';\n html +=\n '
' +\n (!isRtl ? axisHtml : '') +\n ' | ' +\n (isRtl ? axisHtml : '') +\n '
';\n slotTime = core.addDurations(slotTime, this.slotDuration);\n slotIterator = core.addDurations(slotIterator, this.slotDuration);\n }\n return html;\n };\n TimeGrid.prototype._renderColumns = function (cells, dateProfile) {\n var _a = this.context, calendar = _a.calendar, view = _a.view, isRtl = _a.isRtl, theme = _a.theme, dateEnv = _a.dateEnv;\n var bgRow = new daygrid.DayBgRow(this.context);\n this.rootBgContainerEl.innerHTML =\n '
' +\n bgRow.renderHtml({\n cells: cells,\n dateProfile: dateProfile,\n renderIntroHtml: this.renderProps.renderBgIntroHtml\n }) +\n '
';\n this.colEls = core.findElements(this.el, '.fc-day, .fc-disabled-day');\n for (var col = 0; col < this.colCnt; col++) {\n calendar.publiclyTrigger('dayRender', [\n {\n date: dateEnv.toDate(cells[col].date),\n el: this.colEls[col],\n view: view\n }\n ]);\n }\n if (isRtl) {\n this.colEls.reverse();\n }\n this.colPositions = new core.PositionCache(this.el, this.colEls, true, // horizontal\n false);\n this.renderContentSkeleton();\n this.isColSizesDirty = true;\n };\n TimeGrid.prototype._unrenderColumns = function () {\n this.unrenderContentSkeleton();\n };\n /* Content Skeleton\n ------------------------------------------------------------------------------------------------------------------*/\n // Renders the DOM that the view's content will live in\n TimeGrid.prototype.renderContentSkeleton = function () {\n var isRtl = this.context.isRtl;\n var parts = [];\n var skeletonEl;\n parts.push(this.renderProps.renderIntroHtml());\n for (var i = 0; i < this.colCnt; i++) {\n parts.push('
' +\n '' +\n ' ' +\n ' ' +\n ' ' +\n ' ' +\n ' ' +\n ' ' +\n ' | ');\n }\n if (isRtl) {\n parts.reverse();\n }\n skeletonEl = this.contentSkeletonEl = core.htmlToElement('
' +\n '
' +\n '' + parts.join('') + '
' +\n '
' +\n '
');\n this.colContainerEls = core.findElements(skeletonEl, '.fc-content-col');\n this.mirrorContainerEls = core.findElements(skeletonEl, '.fc-mirror-container');\n this.fgContainerEls = core.findElements(skeletonEl, '.fc-event-container:not(.fc-mirror-container)');\n this.bgContainerEls = core.findElements(skeletonEl, '.fc-bgevent-container');\n this.highlightContainerEls = core.findElements(skeletonEl, '.fc-highlight-container');\n this.businessContainerEls = core.findElements(skeletonEl, '.fc-business-container');\n if (isRtl) {\n this.colContainerEls.reverse();\n this.mirrorContainerEls.reverse();\n this.fgContainerEls.reverse();\n this.bgContainerEls.reverse();\n this.highlightContainerEls.reverse();\n this.businessContainerEls.reverse();\n }\n this.el.appendChild(skeletonEl);\n };\n TimeGrid.prototype.unrenderContentSkeleton = function () {\n core.removeElement(this.contentSkeletonEl);\n };\n // Given a flat array of segments, return an array of sub-arrays, grouped by each segment's col\n TimeGrid.prototype.groupSegsByCol = function (segs) {\n var segsByCol = [];\n var i;\n for (i = 0; i < this.colCnt; i++) {\n segsByCol.push([]);\n }\n for (i = 0; i < segs.length; i++) {\n segsByCol[segs[i].col].push(segs[i]);\n }\n return segsByCol;\n };\n // Given segments grouped by column, insert the segments' elements into a parallel array of container\n // elements, each living within a column.\n TimeGrid.prototype.attachSegsByCol = function (segsByCol, containerEls) {\n var col;\n var segs;\n var i;\n for (col = 0; col < this.colCnt; col++) { // iterate each column grouping\n segs = segsByCol[col];\n for (i = 0; i < segs.length; i++) {\n containerEls[col].appendChild(segs[i].el);\n }\n }\n };\n /* Now Indicator\n ------------------------------------------------------------------------------------------------------------------*/\n TimeGrid.prototype.getNowIndicatorUnit = function () {\n return 'minute'; // will refresh on the minute\n };\n TimeGrid.prototype.renderNowIndicator = function (segs, date) {\n // HACK: if date columns not ready for some reason (scheduler)\n if (!this.colContainerEls) {\n return;\n }\n var top = this.computeDateTop(date);\n var nodes = [];\n var i;\n // render lines within the columns\n for (i = 0; i < segs.length; i++) {\n var lineEl = core.createElement('div', { className: 'fc-now-indicator fc-now-indicator-line' });\n lineEl.style.top = top + 'px';\n this.colContainerEls[segs[i].col].appendChild(lineEl);\n nodes.push(lineEl);\n }\n // render an arrow over the axis\n if (segs.length > 0) { // is the current time in view?\n var arrowEl = core.createElement('div', { className: 'fc-now-indicator fc-now-indicator-arrow' });\n arrowEl.style.top = top + 'px';\n this.contentSkeletonEl.appendChild(arrowEl);\n nodes.push(arrowEl);\n }\n this.nowIndicatorEls = nodes;\n };\n TimeGrid.prototype.unrenderNowIndicator = function () {\n if (this.nowIndicatorEls) {\n this.nowIndicatorEls.forEach(core.removeElement);\n this.nowIndicatorEls = null;\n }\n };\n /* Coordinates\n ------------------------------------------------------------------------------------------------------------------*/\n TimeGrid.prototype.getTotalSlatHeight = function () {\n return this.slatContainerEl.getBoundingClientRect().height;\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 TimeGrid.prototype.computeDateTop = function (when, startOfDayDate) {\n if (!startOfDayDate) {\n startOfDayDate = core.startOfDay(when);\n }\n return this.computeTimeTop(core.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 TimeGrid.prototype.computeTimeTop = function (duration) {\n var len = this.slatEls.length;\n var dateProfile = this.props.dateProfile;\n var slatCoverage = (duration.milliseconds - core.asRoughMs(dateProfile.minTime)) / core.asRoughMs(this.slotDuration); // floating-point value of # of slots covered\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 minTime/maxTime 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 this.slatPositions.tops[slatIndex] +\n this.slatPositions.getHeight(slatIndex) * slatRemainder;\n };\n // For each segment in an array, computes and assigns its top and bottom properties\n TimeGrid.prototype.computeSegVerticals = function (segs) {\n var options = this.context.options;\n var eventMinHeight = options.timeGridEventMinHeight;\n var i;\n var seg;\n var dayDate;\n for (i = 0; i < segs.length; i++) {\n seg = segs[i];\n dayDate = this.props.cells[seg.col].date;\n seg.top = this.computeDateTop(seg.start, dayDate);\n seg.bottom = Math.max(seg.top + eventMinHeight, this.computeDateTop(seg.end, dayDate));\n }\n };\n // Given segments that already have their top/bottom properties computed, applies those values to\n // the segments' elements.\n TimeGrid.prototype.assignSegVerticals = function (segs) {\n var i;\n var seg;\n for (i = 0; i < segs.length; i++) {\n seg = segs[i];\n core.applyStyle(seg.el, this.generateSegVerticalCss(seg));\n }\n };\n // Generates an object with CSS properties for the top/bottom coordinates of a segment element\n TimeGrid.prototype.generateSegVerticalCss = function (seg) {\n return {\n top: seg.top,\n bottom: -seg.bottom // flipped because needs to be space beyond bottom edge of event container\n };\n };\n /* Sizing\n ------------------------------------------------------------------------------------------------------------------*/\n TimeGrid.prototype.buildPositionCaches = function () {\n this.buildColPositions();\n this.buildSlatPositions();\n };\n TimeGrid.prototype.buildColPositions = function () {\n this.colPositions.build();\n };\n TimeGrid.prototype.buildSlatPositions = function () {\n this.slatPositions.build();\n };\n /* Hit System\n ------------------------------------------------------------------------------------------------------------------*/\n TimeGrid.prototype.positionToHit = function (positionLeft, positionTop) {\n var dateEnv = this.context.dateEnv;\n var _a = this, snapsPerSlot = _a.snapsPerSlot, slatPositions = _a.slatPositions, colPositions = _a.colPositions;\n var colIndex = colPositions.leftToIndex(positionLeft);\n var slatIndex = slatPositions.topToIndex(positionTop);\n if (colIndex != null && slatIndex != null) {\n var slatTop = slatPositions.tops[slatIndex];\n var slatHeight = slatPositions.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 = core.addDurations(this.props.dateProfile.minTime, core.multiplyDuration(this.snapDuration, snapIndex));\n var start = dateEnv.add(dayDate, time);\n var end = dateEnv.add(start, this.snapDuration);\n return {\n col: colIndex,\n dateSpan: {\n range: { start: start, end: end },\n allDay: false\n },\n dayEl: this.colEls[colIndex],\n relativeRect: {\n left: colPositions.lefts[colIndex],\n right: colPositions.rights[colIndex],\n top: slatTop,\n bottom: slatTop + slatHeight\n }\n };\n }\n };\n /* Event Drag Visualization\n ------------------------------------------------------------------------------------------------------------------*/\n TimeGrid.prototype._renderEventDrag = function (state) {\n if (state) {\n this.eventRenderer.hideByHash(state.affectedInstances);\n if (state.isEvent) {\n this.mirrorRenderer.renderSegs(this.context, state.segs, { isDragging: true, sourceSeg: state.sourceSeg });\n }\n else {\n this.fillRenderer.renderSegs('highlight', this.context, state.segs);\n }\n }\n };\n TimeGrid.prototype._unrenderEventDrag = function (state) {\n if (state) {\n this.eventRenderer.showByHash(state.affectedInstances);\n if (state.isEvent) {\n this.mirrorRenderer.unrender(this.context, state.segs, { isDragging: true, sourceSeg: state.sourceSeg });\n }\n else {\n this.fillRenderer.unrender('highlight', this.context);\n }\n }\n };\n /* Event Resize Visualization\n ------------------------------------------------------------------------------------------------------------------*/\n TimeGrid.prototype._renderEventResize = function (state) {\n if (state) {\n this.eventRenderer.hideByHash(state.affectedInstances);\n this.mirrorRenderer.renderSegs(this.context, state.segs, { isResizing: true, sourceSeg: state.sourceSeg });\n }\n };\n TimeGrid.prototype._unrenderEventResize = function (state) {\n if (state) {\n this.eventRenderer.showByHash(state.affectedInstances);\n this.mirrorRenderer.unrender(this.context, state.segs, { isResizing: true, sourceSeg: state.sourceSeg });\n }\n };\n /* Selection\n ------------------------------------------------------------------------------------------------------------------*/\n // Renders a visual indication of a selection. Overrides the default, which was to simply render a highlight.\n TimeGrid.prototype._renderDateSelection = function (segs) {\n if (segs) {\n if (this.context.options.selectMirror) {\n this.mirrorRenderer.renderSegs(this.context, segs, { isSelecting: true });\n }\n else {\n this.fillRenderer.renderSegs('highlight', this.context, segs);\n }\n }\n };\n TimeGrid.prototype._unrenderDateSelection = function (segs) {\n if (segs) {\n if (this.context.options.selectMirror) {\n this.mirrorRenderer.unrender(this.context, segs, { isSelecting: true });\n }\n else {\n this.fillRenderer.unrender('highlight', this.context);\n }\n }\n };\n return TimeGrid;\n }(core.DateComponent));\n\n var 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 else {\n return ['timed'];\n }\n };\n AllDaySplitter.prototype.getKeysForEventDef = function (eventDef) {\n if (!eventDef.allDay) {\n return ['timed'];\n }\n else if (core.hasBgRendering(eventDef)) {\n return ['timed', 'allDay'];\n }\n else {\n return ['allDay'];\n }\n };\n return AllDaySplitter;\n }(core.Splitter));\n\n var TIMEGRID_ALL_DAY_EVENT_LIMIT = 5;\n var WEEK_HEADER_FORMAT = core.createFormatter({ week: 'short' });\n /* An abstract class for all timegrid-related views. Displays one more columns with time slots running vertically.\n ----------------------------------------------------------------------------------------------------------------------*/\n // Is a manager for the TimeGrid subcomponent and possibly the DayGrid subcomponent (if allDaySlot is on).\n // Responsible for managing width/height.\n var AbstractTimeGridView = /** @class */ (function (_super) {\n __extends(AbstractTimeGridView, _super);\n function AbstractTimeGridView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.splitter = new AllDaySplitter();\n _this.renderSkeleton = core.memoizeRendering(_this._renderSkeleton, _this._unrenderSkeleton);\n /* Header Render Methods\n ------------------------------------------------------------------------------------------------------------------*/\n // Generates the HTML that will go before the day-of week header cells\n _this.renderHeadIntroHtml = function () {\n var _a = _this.context, theme = _a.theme, dateEnv = _a.dateEnv, options = _a.options;\n var range = _this.props.dateProfile.renderRange;\n var dayCnt = core.diffDays(range.start, range.end);\n var weekText;\n if (options.weekNumbers) {\n weekText = dateEnv.format(range.start, WEEK_HEADER_FORMAT);\n return '' +\n '
' +\n core.buildGotoAnchorHtml(// aside from link, important for matchCellWidths\n options, dateEnv, { date: range.start, type: 'week', forceOff: dayCnt > 1 }, core.htmlEscape(weekText) // inner HTML\n ) +\n ' | ';\n }\n else {\n return '
| ';\n }\n };\n /* Time Grid Render Methods\n ------------------------------------------------------------------------------------------------------------------*/\n // Generates the HTML that goes before the bg of the TimeGrid slot area. Long vertical column.\n _this.renderTimeGridBgIntroHtml = function () {\n var theme = _this.context.theme;\n return '
| ';\n };\n // Generates the HTML that goes before all other types of cells.\n // Affects content-skeleton, mirror-skeleton, highlight-skeleton for both the time-grid and day-grid.\n _this.renderTimeGridIntroHtml = function () {\n return '
| ';\n };\n /* Day Grid Render Methods\n ------------------------------------------------------------------------------------------------------------------*/\n // Generates the HTML that goes before the all-day cells\n _this.renderDayGridBgIntroHtml = function () {\n var _a = _this.context, theme = _a.theme, options = _a.options;\n return '' +\n '
' +\n '' + // needed for matchCellWidths\n core.getAllDayHtml(options) +\n '' +\n ' | ';\n };\n // Generates the HTML that goes before all other types of cells.\n // Affects content-skeleton, mirror-skeleton, highlight-skeleton for both the time-grid and day-grid.\n _this.renderDayGridIntroHtml = function () {\n return '
| ';\n };\n return _this;\n }\n AbstractTimeGridView.prototype.render = function (props, context) {\n _super.prototype.render.call(this, props, context);\n this.renderSkeleton(context);\n };\n AbstractTimeGridView.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.renderSkeleton.unrender();\n };\n AbstractTimeGridView.prototype._renderSkeleton = function (context) {\n this.el.classList.add('fc-timeGrid-view');\n this.el.innerHTML = this.renderSkeletonHtml();\n this.scroller = new core.ScrollComponent('hidden', // overflow x\n 'auto' // overflow y\n );\n var timeGridWrapEl = this.scroller.el;\n this.el.querySelector('.fc-body > tr > td').appendChild(timeGridWrapEl);\n timeGridWrapEl.classList.add('fc-time-grid-container');\n var timeGridEl = core.createElement('div', { className: 'fc-time-grid' });\n timeGridWrapEl.appendChild(timeGridEl);\n this.timeGrid = new TimeGrid(timeGridEl, {\n renderBgIntroHtml: this.renderTimeGridBgIntroHtml,\n renderIntroHtml: this.renderTimeGridIntroHtml\n });\n if (context.options.allDaySlot) { // should we display the \"all-day\" area?\n this.dayGrid = new daygrid.DayGrid(// the all-day subcomponent of this view\n this.el.querySelector('.fc-day-grid'), {\n renderNumberIntroHtml: this.renderDayGridIntroHtml,\n renderBgIntroHtml: this.renderDayGridBgIntroHtml,\n renderIntroHtml: this.renderDayGridIntroHtml,\n colWeekNumbersVisible: false,\n cellWeekNumbersVisible: false\n });\n // have the day-grid extend it's coordinate area over the
dividing the two grids\n var dividerEl = this.el.querySelector('.fc-divider');\n this.dayGrid.bottomCoordPadding = dividerEl.getBoundingClientRect().height;\n }\n };\n AbstractTimeGridView.prototype._unrenderSkeleton = function () {\n this.el.classList.remove('fc-timeGrid-view');\n this.timeGrid.destroy();\n if (this.dayGrid) {\n this.dayGrid.destroy();\n }\n this.scroller.destroy();\n };\n /* Rendering\n ------------------------------------------------------------------------------------------------------------------*/\n // Builds the HTML skeleton for the view.\n // The day-grid and time-grid components will render inside containers defined by this HTML.\n AbstractTimeGridView.prototype.renderSkeletonHtml = function () {\n var _a = this.context, theme = _a.theme, options = _a.options;\n return '' +\n '
' +\n (options.columnHeader ?\n '' +\n '' +\n ' | ' +\n '
' +\n '' :\n '') +\n '' +\n '' +\n '' +\n (options.allDaySlot ?\n '' +\n ' ' :\n '') +\n ' | ' +\n '
' +\n '' +\n '
';\n };\n /* Now Indicator\n ------------------------------------------------------------------------------------------------------------------*/\n AbstractTimeGridView.prototype.getNowIndicatorUnit = function () {\n return this.timeGrid.getNowIndicatorUnit();\n };\n // subclasses should implement\n // renderNowIndicator(date: DateMarker) {\n // }\n AbstractTimeGridView.prototype.unrenderNowIndicator = function () {\n this.timeGrid.unrenderNowIndicator();\n };\n /* Dimensions\n ------------------------------------------------------------------------------------------------------------------*/\n AbstractTimeGridView.prototype.updateSize = function (isResize, viewHeight, isAuto) {\n _super.prototype.updateSize.call(this, isResize, viewHeight, isAuto); // will call updateBaseSize. important that executes first\n this.timeGrid.updateSize(isResize);\n if (this.dayGrid) {\n this.dayGrid.updateSize(isResize);\n }\n };\n // Adjusts the vertical dimensions of the view to the specified values\n AbstractTimeGridView.prototype.updateBaseSize = function (isResize, viewHeight, isAuto) {\n var _this = this;\n var eventLimit;\n var scrollerHeight;\n var scrollbarWidths;\n // make all axis cells line up\n this.axisWidth = core.matchCellWidths(core.findElements(this.el, '.fc-axis'));\n // hack to give the view some height prior to timeGrid's columns being rendered\n // TODO: separate setting height from scroller VS timeGrid.\n if (!this.timeGrid.colEls) {\n if (!isAuto) {\n scrollerHeight = this.computeScrollerHeight(viewHeight);\n this.scroller.setHeight(scrollerHeight);\n }\n return;\n }\n // set of fake row elements that must compensate when scroller has scrollbars\n var noScrollRowEls = core.findElements(this.el, '.fc-row').filter(function (node) {\n return !_this.scroller.el.contains(node);\n });\n // reset all dimensions back to the original state\n this.timeGrid.bottomRuleEl.style.display = 'none'; // will be shown later if this
is necessary\n this.scroller.clear(); // sets height to 'auto' and clears overflow\n noScrollRowEls.forEach(core.uncompensateScroll);\n // limit number of events in the all-day area\n if (this.dayGrid) {\n this.dayGrid.removeSegPopover(); // kill the \"more\" popover if displayed\n eventLimit = this.context.options.eventLimit;\n if (eventLimit && typeof eventLimit !== 'number') {\n eventLimit = TIMEGRID_ALL_DAY_EVENT_LIMIT; // make sure \"auto\" goes to a real number\n }\n if (eventLimit) {\n this.dayGrid.limitRows(eventLimit);\n }\n }\n if (!isAuto) { // should we force dimensions of the scroll container?\n scrollerHeight = this.computeScrollerHeight(viewHeight);\n this.scroller.setHeight(scrollerHeight);\n scrollbarWidths = this.scroller.getScrollbarWidths();\n if (scrollbarWidths.left || scrollbarWidths.right) { // using scrollbars?\n // make the all-day and header rows lines up\n noScrollRowEls.forEach(function (rowEl) {\n core.compensateScroll(rowEl, scrollbarWidths);\n });\n // the scrollbar compensation might have changed text flow, which might affect height, so recalculate\n // and reapply the desired height to the scroller.\n scrollerHeight = this.computeScrollerHeight(viewHeight);\n this.scroller.setHeight(scrollerHeight);\n }\n // guarantees the same scrollbar widths\n this.scroller.lockOverflow(scrollbarWidths);\n // if there's any space below the slats, show the horizontal rule.\n // this won't cause any new overflow, because lockOverflow already called.\n if (this.timeGrid.getTotalSlatHeight() < scrollerHeight) {\n this.timeGrid.bottomRuleEl.style.display = '';\n }\n }\n };\n // given a desired total height of the view, returns what the height of the scroller should be\n AbstractTimeGridView.prototype.computeScrollerHeight = function (viewHeight) {\n return viewHeight -\n core.subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller\n };\n /* Scroll\n ------------------------------------------------------------------------------------------------------------------*/\n // Computes the initial pre-configured scroll state prior to allowing the user to change it\n AbstractTimeGridView.prototype.computeDateScroll = function (duration) {\n var top = this.timeGrid.computeTimeTop(duration);\n // zoom can give weird floating-point values. rather scroll a little bit further\n top = Math.ceil(top);\n if (top) {\n top++; // to overcome top border that slots beyond the first have. looks better\n }\n return { top: top };\n };\n AbstractTimeGridView.prototype.queryDateScroll = function () {\n return { top: this.scroller.getScrollTop() };\n };\n AbstractTimeGridView.prototype.applyDateScroll = function (scroll) {\n if (scroll.top !== undefined) {\n this.scroller.setScrollTop(scroll.top);\n }\n };\n // Generates an HTML attribute string for setting the width of the axis, if it is known\n AbstractTimeGridView.prototype.axisStyleAttr = function () {\n if (this.axisWidth != null) {\n return 'style=\"width:' + this.axisWidth + 'px\"';\n }\n return '';\n };\n return AbstractTimeGridView;\n }(core.View));\n AbstractTimeGridView.prototype.usesMinMaxTime = true; // indicates that minTime/maxTime affects rendering\n\n var SimpleTimeGrid = /** @class */ (function (_super) {\n __extends(SimpleTimeGrid, _super);\n function SimpleTimeGrid(timeGrid) {\n var _this = _super.call(this, timeGrid.el) || this;\n _this.buildDayRanges = core.memoize(buildDayRanges);\n _this.slicer = new TimeGridSlicer();\n _this.timeGrid = timeGrid;\n return _this;\n }\n SimpleTimeGrid.prototype.firstContext = function (context) {\n context.calendar.registerInteractiveComponent(this, {\n el: this.timeGrid.el\n });\n };\n SimpleTimeGrid.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n this.context.calendar.unregisterInteractiveComponent(this);\n };\n SimpleTimeGrid.prototype.render = function (props, context) {\n var dateEnv = this.context.dateEnv;\n var dateProfile = props.dateProfile, dayTable = props.dayTable;\n var dayRanges = this.dayRanges = this.buildDayRanges(dayTable, dateProfile, dateEnv);\n var timeGrid = this.timeGrid;\n timeGrid.receiveContext(context); // hack because context is used in sliceProps\n timeGrid.receiveProps(__assign({}, this.slicer.sliceProps(props, dateProfile, null, context.calendar, timeGrid, dayRanges), { dateProfile: dateProfile, cells: dayTable.cells[0] }), context);\n };\n SimpleTimeGrid.prototype.renderNowIndicator = function (date) {\n this.timeGrid.renderNowIndicator(this.slicer.sliceNowDate(date, this.timeGrid, this.dayRanges), date);\n };\n SimpleTimeGrid.prototype.buildPositionCaches = function () {\n this.timeGrid.buildPositionCaches();\n };\n SimpleTimeGrid.prototype.queryHit = function (positionLeft, positionTop) {\n var rawHit = this.timeGrid.positionToHit(positionLeft, positionTop);\n if (rawHit) {\n return {\n component: this.timeGrid,\n dateSpan: rawHit.dateSpan,\n dayEl: rawHit.dayEl,\n rect: {\n left: rawHit.relativeRect.left,\n right: rawHit.relativeRect.right,\n top: rawHit.relativeRect.top,\n bottom: rawHit.relativeRect.bottom\n },\n layer: 0\n };\n }\n };\n return SimpleTimeGrid;\n }(core.DateComponent));\n function buildDayRanges(dayTable, dateProfile, dateEnv) {\n var ranges = [];\n for (var _i = 0, _a = dayTable.headerDates; _i < _a.length; _i++) {\n var date = _a[_i];\n ranges.push({\n start: dateEnv.add(date, dateProfile.minTime),\n end: dateEnv.add(date, dateProfile.maxTime)\n });\n }\n return ranges;\n }\n var TimeGridSlicer = /** @class */ (function (_super) {\n __extends(TimeGridSlicer, _super);\n function TimeGridSlicer() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TimeGridSlicer.prototype.sliceRange = function (range, dayRanges) {\n var segs = [];\n for (var col = 0; col < dayRanges.length; col++) {\n var segRange = core.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 TimeGridSlicer;\n }(core.Slicer));\n\n var TimeGridView = /** @class */ (function (_super) {\n __extends(TimeGridView, _super);\n function TimeGridView() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.buildDayTable = core.memoize(buildDayTable);\n return _this;\n }\n TimeGridView.prototype.render = function (props, context) {\n _super.prototype.render.call(this, props, context); // for flags for updateSize. also _renderSkeleton/_unrenderSkeleton\n var _a = this.props, dateProfile = _a.dateProfile, dateProfileGenerator = _a.dateProfileGenerator;\n var nextDayThreshold = context.nextDayThreshold;\n var dayTable = this.buildDayTable(dateProfile, dateProfileGenerator);\n var splitProps = this.splitter.splitProps(props);\n if (this.header) {\n this.header.receiveProps({\n dateProfile: dateProfile,\n dates: dayTable.headerDates,\n datesRepDistinctDays: true,\n renderIntroHtml: this.renderHeadIntroHtml\n }, context);\n }\n this.simpleTimeGrid.receiveProps(__assign({}, splitProps['timed'], { dateProfile: dateProfile,\n dayTable: dayTable }), context);\n if (this.simpleDayGrid) {\n this.simpleDayGrid.receiveProps(__assign({}, splitProps['allDay'], { dateProfile: dateProfile,\n dayTable: dayTable,\n nextDayThreshold: nextDayThreshold, isRigid: false }), context);\n }\n this.startNowIndicator(dateProfile, dateProfileGenerator);\n };\n TimeGridView.prototype._renderSkeleton = function (context) {\n _super.prototype._renderSkeleton.call(this, context);\n if (context.options.columnHeader) {\n this.header = new core.DayHeader(this.el.querySelector('.fc-head-container'));\n }\n this.simpleTimeGrid = new SimpleTimeGrid(this.timeGrid);\n if (this.dayGrid) {\n this.simpleDayGrid = new daygrid.SimpleDayGrid(this.dayGrid);\n }\n };\n TimeGridView.prototype._unrenderSkeleton = function () {\n _super.prototype._unrenderSkeleton.call(this);\n if (this.header) {\n this.header.destroy();\n }\n this.simpleTimeGrid.destroy();\n if (this.simpleDayGrid) {\n this.simpleDayGrid.destroy();\n }\n };\n TimeGridView.prototype.renderNowIndicator = function (date) {\n this.simpleTimeGrid.renderNowIndicator(date);\n };\n return TimeGridView;\n }(AbstractTimeGridView));\n function buildDayTable(dateProfile, dateProfileGenerator) {\n var daySeries = new core.DaySeries(dateProfile.renderRange, dateProfileGenerator);\n return new core.DayTable(daySeries, false);\n }\n\n var main = core.createPlugin({\n defaultView: 'timeGridWeek',\n views: {\n timeGrid: {\n class: TimeGridView,\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\n exports.AbstractTimeGridView = AbstractTimeGridView;\n exports.TimeGrid = TimeGrid;\n exports.TimeGridSlicer = TimeGridSlicer;\n exports.TimeGridView = TimeGridView;\n exports.buildDayRanges = buildDayRanges;\n exports.buildDayTable = buildDayTable;\n exports.default = main;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","// FullCalendar - Full-sized, drag & drop event calendar in JavaScript: https://fullcalendar.io/\r\n\r\nwindow.FullCalendar = require('@fullcalendar/core/main.js');\r\nwindow.FullCalendarDayGrid = require('@fullcalendar/daygrid/main.js');\r\nwindow.FullCalendarGoogleCalendar = require('@fullcalendar/google-calendar/main.js');\r\nwindow.FullCalendarInteraction = require('@fullcalendar/interaction/main.js');\r\nwindow.FullCalendarList = require('@fullcalendar/list/main.js');\r\nwindow.FullCalendarTimeGrid = require('@fullcalendar/timegrid/main.js');\r\n\r\nrequire('./fullcalendar.scss');\r\n","// extracted by mini-css-extract-plugin"],"sourceRoot":""}