/******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ "./node_modules/@fullcalendar/common/main.js": /*!***************************************************!*\ !*** ./node_modules/@fullcalendar/common/main.js ***! \***************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "BASE_OPTION_DEFAULTS": () => (/* binding */ BASE_OPTION_DEFAULTS), /* harmony export */ "BASE_OPTION_REFINERS": () => (/* binding */ BASE_OPTION_REFINERS), /* harmony export */ "BaseComponent": () => (/* binding */ BaseComponent), /* harmony export */ "BgEvent": () => (/* binding */ BgEvent), /* harmony export */ "CalendarApi": () => (/* binding */ CalendarApi), /* harmony export */ "CalendarContent": () => (/* binding */ CalendarContent), /* harmony export */ "CalendarDataManager": () => (/* binding */ CalendarDataManager), /* harmony export */ "CalendarDataProvider": () => (/* binding */ CalendarDataProvider), /* harmony export */ "CalendarRoot": () => (/* binding */ CalendarRoot), /* harmony export */ "Component": () => (/* reexport safe */ _vdom_js__WEBPACK_IMPORTED_MODULE_1__.Component), /* harmony export */ "ContentHook": () => (/* binding */ ContentHook), /* harmony export */ "CustomContentRenderContext": () => (/* binding */ CustomContentRenderContext), /* harmony export */ "DateComponent": () => (/* binding */ DateComponent), /* harmony export */ "DateEnv": () => (/* binding */ DateEnv), /* harmony export */ "DateProfileGenerator": () => (/* binding */ DateProfileGenerator), /* harmony export */ "DayCellContent": () => (/* binding */ DayCellContent), /* harmony export */ "DayCellRoot": () => (/* binding */ DayCellRoot), /* harmony export */ "DayHeader": () => (/* binding */ DayHeader), /* harmony export */ "DaySeriesModel": () => (/* binding */ DaySeriesModel), /* harmony export */ "DayTableModel": () => (/* binding */ DayTableModel), /* harmony export */ "DelayedRunner": () => (/* binding */ DelayedRunner), /* harmony export */ "ElementDragging": () => (/* binding */ ElementDragging), /* harmony export */ "ElementScrollController": () => (/* binding */ ElementScrollController), /* harmony export */ "Emitter": () => (/* binding */ Emitter), /* harmony export */ "EventApi": () => (/* binding */ EventApi), /* harmony export */ "EventRoot": () => (/* binding */ EventRoot), /* harmony export */ "EventSourceApi": () => (/* binding */ EventSourceApi), /* harmony export */ "Fragment": () => (/* reexport safe */ _vdom_js__WEBPACK_IMPORTED_MODULE_1__.Fragment), /* harmony export */ "Interaction": () => (/* binding */ Interaction), /* harmony export */ "MoreLinkRoot": () => (/* binding */ MoreLinkRoot), /* harmony export */ "MountHook": () => (/* binding */ MountHook), /* harmony export */ "NamedTimeZoneImpl": () => (/* binding */ NamedTimeZoneImpl), /* harmony export */ "NowIndicatorRoot": () => (/* binding */ NowIndicatorRoot), /* harmony export */ "NowTimer": () => (/* binding */ NowTimer), /* harmony export */ "PositionCache": () => (/* binding */ PositionCache), /* harmony export */ "RefMap": () => (/* binding */ RefMap), /* harmony export */ "RenderHook": () => (/* binding */ RenderHook), /* harmony export */ "ScrollController": () => (/* binding */ ScrollController), /* harmony export */ "ScrollResponder": () => (/* binding */ ScrollResponder), /* harmony export */ "Scroller": () => (/* binding */ Scroller), /* harmony export */ "SegHierarchy": () => (/* binding */ SegHierarchy), /* harmony export */ "SimpleScrollGrid": () => (/* binding */ SimpleScrollGrid), /* harmony export */ "Slicer": () => (/* binding */ Slicer), /* harmony export */ "Splitter": () => (/* binding */ Splitter), /* harmony export */ "StandardEvent": () => (/* binding */ StandardEvent), /* harmony export */ "TableDateCell": () => (/* binding */ TableDateCell), /* harmony export */ "TableDowCell": () => (/* binding */ TableDowCell), /* harmony export */ "Theme": () => (/* binding */ Theme), /* harmony export */ "ViewApi": () => (/* binding */ ViewApi), /* harmony export */ "ViewContextType": () => (/* binding */ ViewContextType), /* harmony export */ "ViewRoot": () => (/* binding */ ViewRoot), /* harmony export */ "WeekNumberRoot": () => (/* binding */ WeekNumberRoot), /* harmony export */ "WindowScrollController": () => (/* binding */ WindowScrollController), /* harmony export */ "addDays": () => (/* binding */ addDays), /* harmony export */ "addDurations": () => (/* binding */ addDurations), /* harmony export */ "addMs": () => (/* binding */ addMs), /* harmony export */ "addWeeks": () => (/* binding */ addWeeks), /* harmony export */ "allowContextMenu": () => (/* binding */ allowContextMenu), /* harmony export */ "allowSelection": () => (/* binding */ allowSelection), /* harmony export */ "applyMutationToEventStore": () => (/* binding */ applyMutationToEventStore), /* harmony export */ "applyStyle": () => (/* binding */ applyStyle), /* harmony export */ "applyStyleProp": () => (/* binding */ applyStyleProp), /* harmony export */ "asCleanDays": () => (/* binding */ asCleanDays), /* harmony export */ "asRoughMinutes": () => (/* binding */ asRoughMinutes), /* harmony export */ "asRoughMs": () => (/* binding */ asRoughMs), /* harmony export */ "asRoughSeconds": () => (/* binding */ asRoughSeconds), /* harmony export */ "binarySearch": () => (/* binding */ binarySearch), /* harmony export */ "buildClassNameNormalizer": () => (/* binding */ buildClassNameNormalizer), /* harmony export */ "buildEntryKey": () => (/* binding */ buildEntryKey), /* harmony export */ "buildEventApis": () => (/* binding */ buildEventApis), /* harmony export */ "buildEventRangeKey": () => (/* binding */ buildEventRangeKey), /* harmony export */ "buildHashFromArray": () => (/* binding */ buildHashFromArray), /* harmony export */ "buildIsoString": () => (/* binding */ buildIsoString), /* harmony export */ "buildNavLinkAttrs": () => (/* binding */ buildNavLinkAttrs), /* harmony export */ "buildSegCompareObj": () => (/* binding */ buildSegCompareObj), /* harmony export */ "buildSegTimeText": () => (/* binding */ buildSegTimeText), /* harmony export */ "collectFromHash": () => (/* binding */ collectFromHash), /* harmony export */ "combineEventUis": () => (/* binding */ combineEventUis), /* harmony export */ "compareByFieldSpec": () => (/* binding */ compareByFieldSpec), /* harmony export */ "compareByFieldSpecs": () => (/* binding */ compareByFieldSpecs), /* harmony export */ "compareNumbers": () => (/* binding */ compareNumbers), /* harmony export */ "compareObjs": () => (/* binding */ compareObjs), /* harmony export */ "computeEarliestSegStart": () => (/* binding */ computeEarliestSegStart), /* harmony export */ "computeEdges": () => (/* binding */ computeEdges), /* harmony export */ "computeFallbackHeaderFormat": () => (/* binding */ computeFallbackHeaderFormat), /* harmony export */ "computeHeightAndMargins": () => (/* binding */ computeHeightAndMargins), /* harmony export */ "computeInnerRect": () => (/* binding */ computeInnerRect), /* harmony export */ "computeRect": () => (/* binding */ computeRect), /* harmony export */ "computeSegDraggable": () => (/* binding */ computeSegDraggable), /* harmony export */ "computeSegEndResizable": () => (/* binding */ computeSegEndResizable), /* harmony export */ "computeSegStartResizable": () => (/* binding */ computeSegStartResizable), /* harmony export */ "computeShrinkWidth": () => (/* binding */ computeShrinkWidth), /* harmony export */ "computeSmallestCellWidth": () => (/* binding */ computeSmallestCellWidth), /* harmony export */ "computeVisibleDayRange": () => (/* binding */ computeVisibleDayRange), /* harmony export */ "config": () => (/* binding */ config), /* harmony export */ "constrainPoint": () => (/* binding */ constrainPoint), /* harmony export */ "createAriaClickAttrs": () => (/* binding */ createAriaClickAttrs), /* harmony export */ "createContext": () => (/* reexport safe */ _vdom_js__WEBPACK_IMPORTED_MODULE_1__.createContext), /* harmony export */ "createDuration": () => (/* binding */ createDuration), /* harmony export */ "createElement": () => (/* reexport safe */ _vdom_js__WEBPACK_IMPORTED_MODULE_1__.createElement), /* harmony export */ "createEmptyEventStore": () => (/* binding */ createEmptyEventStore), /* harmony export */ "createEventInstance": () => (/* binding */ createEventInstance), /* harmony export */ "createEventUi": () => (/* binding */ createEventUi), /* harmony export */ "createFormatter": () => (/* binding */ createFormatter), /* harmony export */ "createPlugin": () => (/* binding */ createPlugin), /* harmony export */ "createPortal": () => (/* reexport safe */ _vdom_js__WEBPACK_IMPORTED_MODULE_1__.createPortal), /* harmony export */ "createRef": () => (/* reexport safe */ _vdom_js__WEBPACK_IMPORTED_MODULE_1__.createRef), /* harmony export */ "diffDates": () => (/* binding */ diffDates), /* harmony export */ "diffDayAndTime": () => (/* binding */ diffDayAndTime), /* harmony export */ "diffDays": () => (/* binding */ diffDays), /* harmony export */ "diffPoints": () => (/* binding */ diffPoints), /* harmony export */ "diffWeeks": () => (/* binding */ diffWeeks), /* harmony export */ "diffWholeDays": () => (/* binding */ diffWholeDays), /* harmony export */ "diffWholeWeeks": () => (/* binding */ diffWholeWeeks), /* harmony export */ "disableCursor": () => (/* binding */ disableCursor), /* harmony export */ "elementClosest": () => (/* binding */ elementClosest), /* harmony export */ "elementMatches": () => (/* binding */ elementMatches), /* harmony export */ "enableCursor": () => (/* binding */ enableCursor), /* harmony export */ "eventTupleToStore": () => (/* binding */ eventTupleToStore), /* harmony export */ "filterEventStoreDefs": () => (/* binding */ filterEventStoreDefs), /* harmony export */ "filterHash": () => (/* binding */ filterHash), /* harmony export */ "findDirectChildren": () => (/* binding */ findDirectChildren), /* harmony export */ "findElements": () => (/* binding */ findElements), /* harmony export */ "flexibleCompare": () => (/* binding */ flexibleCompare), /* harmony export */ "flushSync": () => (/* reexport safe */ _vdom_js__WEBPACK_IMPORTED_MODULE_1__.flushSync), /* harmony export */ "formatDate": () => (/* binding */ formatDate), /* harmony export */ "formatDayString": () => (/* binding */ formatDayString), /* harmony export */ "formatIsoTimeString": () => (/* binding */ formatIsoTimeString), /* harmony export */ "formatRange": () => (/* binding */ formatRange), /* harmony export */ "getAllowYScrolling": () => (/* binding */ getAllowYScrolling), /* harmony export */ "getCanVGrowWithinCell": () => (/* binding */ getCanVGrowWithinCell), /* harmony export */ "getClippingParents": () => (/* binding */ getClippingParents), /* harmony export */ "getDateMeta": () => (/* binding */ getDateMeta), /* harmony export */ "getDayClassNames": () => (/* binding */ getDayClassNames), /* harmony export */ "getDefaultEventEnd": () => (/* binding */ getDefaultEventEnd), /* harmony export */ "getElRoot": () => (/* binding */ getElRoot), /* harmony export */ "getElSeg": () => (/* binding */ getElSeg), /* harmony export */ "getEntrySpanEnd": () => (/* binding */ getEntrySpanEnd), /* harmony export */ "getEventClassNames": () => (/* binding */ getEventClassNames), /* harmony export */ "getEventTargetViaRoot": () => (/* binding */ getEventTargetViaRoot), /* harmony export */ "getIsRtlScrollbarOnLeft": () => (/* binding */ getIsRtlScrollbarOnLeft), /* harmony export */ "getRectCenter": () => (/* binding */ getRectCenter), /* harmony export */ "getRelevantEvents": () => (/* binding */ getRelevantEvents), /* harmony export */ "getScrollGridClassNames": () => (/* binding */ getScrollGridClassNames), /* harmony export */ "getScrollbarWidths": () => (/* binding */ getScrollbarWidths), /* harmony export */ "getSectionClassNames": () => (/* binding */ getSectionClassNames), /* harmony export */ "getSectionHasLiquidHeight": () => (/* binding */ getSectionHasLiquidHeight), /* harmony export */ "getSegAnchorAttrs": () => (/* binding */ getSegAnchorAttrs), /* harmony export */ "getSegMeta": () => (/* binding */ getSegMeta), /* harmony export */ "getSlotClassNames": () => (/* binding */ getSlotClassNames), /* harmony export */ "getStickyFooterScrollbar": () => (/* binding */ getStickyFooterScrollbar), /* harmony export */ "getStickyHeaderDates": () => (/* binding */ getStickyHeaderDates), /* harmony export */ "getUnequalProps": () => (/* binding */ getUnequalProps), /* harmony export */ "getUniqueDomId": () => (/* binding */ getUniqueDomId), /* harmony export */ "globalLocales": () => (/* binding */ globalLocales), /* harmony export */ "globalPlugins": () => (/* binding */ globalPlugins), /* harmony export */ "greatestDurationDenominator": () => (/* binding */ greatestDurationDenominator), /* harmony export */ "groupIntersectingEntries": () => (/* binding */ groupIntersectingEntries), /* harmony export */ "guid": () => (/* binding */ guid), /* harmony export */ "hasBgRendering": () => (/* binding */ hasBgRendering), /* harmony export */ "hasShrinkWidth": () => (/* binding */ hasShrinkWidth), /* harmony export */ "identity": () => (/* binding */ identity), /* harmony export */ "interactionSettingsStore": () => (/* binding */ interactionSettingsStore), /* harmony export */ "interactionSettingsToStore": () => (/* binding */ interactionSettingsToStore), /* harmony export */ "intersectRanges": () => (/* binding */ intersectRanges), /* harmony export */ "intersectRects": () => (/* binding */ intersectRects), /* harmony export */ "intersectSpans": () => (/* binding */ intersectSpans), /* harmony export */ "isArraysEqual": () => (/* binding */ isArraysEqual), /* harmony export */ "isColPropsEqual": () => (/* binding */ isColPropsEqual), /* harmony export */ "isDateSelectionValid": () => (/* binding */ isDateSelectionValid), /* harmony export */ "isDateSpansEqual": () => (/* binding */ isDateSpansEqual), /* harmony export */ "isInt": () => (/* binding */ isInt), /* harmony export */ "isInteractionValid": () => (/* binding */ isInteractionValid), /* harmony export */ "isMultiDayRange": () => (/* binding */ isMultiDayRange), /* harmony export */ "isPropsEqual": () => (/* binding */ isPropsEqual), /* harmony export */ "isPropsValid": () => (/* binding */ isPropsValid), /* harmony export */ "isValidDate": () => (/* binding */ isValidDate), /* harmony export */ "joinSpans": () => (/* binding */ joinSpans), /* harmony export */ "listenBySelector": () => (/* binding */ listenBySelector), /* harmony export */ "mapHash": () => (/* binding */ mapHash), /* harmony export */ "memoize": () => (/* binding */ memoize), /* harmony export */ "memoizeArraylike": () => (/* binding */ memoizeArraylike), /* harmony export */ "memoizeHashlike": () => (/* binding */ memoizeHashlike), /* harmony export */ "memoizeObjArg": () => (/* binding */ memoizeObjArg), /* harmony export */ "mergeEventStores": () => (/* binding */ mergeEventStores), /* harmony export */ "multiplyDuration": () => (/* binding */ multiplyDuration), /* harmony export */ "padStart": () => (/* binding */ padStart), /* harmony export */ "parseBusinessHours": () => (/* binding */ parseBusinessHours), /* harmony export */ "parseClassNames": () => (/* binding */ parseClassNames), /* harmony export */ "parseDragMeta": () => (/* binding */ parseDragMeta), /* harmony export */ "parseEventDef": () => (/* binding */ parseEventDef), /* harmony export */ "parseFieldSpecs": () => (/* binding */ parseFieldSpecs), /* harmony export */ "parseMarker": () => (/* binding */ parse), /* harmony export */ "pointInsideRect": () => (/* binding */ pointInsideRect), /* harmony export */ "preventContextMenu": () => (/* binding */ preventContextMenu), /* harmony export */ "preventDefault": () => (/* binding */ preventDefault), /* harmony export */ "preventSelection": () => (/* binding */ preventSelection), /* harmony export */ "rangeContainsMarker": () => (/* binding */ rangeContainsMarker), /* harmony export */ "rangeContainsRange": () => (/* binding */ rangeContainsRange), /* harmony export */ "rangesEqual": () => (/* binding */ rangesEqual), /* harmony export */ "rangesIntersect": () => (/* binding */ rangesIntersect), /* harmony export */ "refineEventDef": () => (/* binding */ refineEventDef), /* harmony export */ "refineProps": () => (/* binding */ refineProps), /* harmony export */ "removeElement": () => (/* binding */ removeElement), /* harmony export */ "removeExact": () => (/* binding */ removeExact), /* harmony export */ "render": () => (/* reexport safe */ _vdom_js__WEBPACK_IMPORTED_MODULE_1__.render), /* harmony export */ "renderChunkContent": () => (/* binding */ renderChunkContent), /* harmony export */ "renderFill": () => (/* binding */ renderFill), /* harmony export */ "renderMicroColGroup": () => (/* binding */ renderMicroColGroup), /* harmony export */ "renderScrollShim": () => (/* binding */ renderScrollShim), /* harmony export */ "requestJson": () => (/* binding */ requestJson), /* harmony export */ "sanitizeShrinkWidth": () => (/* binding */ sanitizeShrinkWidth), /* harmony export */ "setElSeg": () => (/* binding */ setElSeg), /* harmony export */ "setRef": () => (/* binding */ setRef), /* harmony export */ "sliceEventStore": () => (/* binding */ sliceEventStore), /* harmony export */ "sliceEvents": () => (/* binding */ sliceEvents), /* harmony export */ "sortEventSegs": () => (/* binding */ sortEventSegs), /* harmony export */ "startOfDay": () => (/* binding */ startOfDay), /* harmony export */ "translateRect": () => (/* binding */ translateRect), /* harmony export */ "triggerDateSelect": () => (/* binding */ triggerDateSelect), /* harmony export */ "unmountComponentAtNode": () => (/* reexport safe */ _vdom_js__WEBPACK_IMPORTED_MODULE_1__.unmountComponentAtNode), /* harmony export */ "unpromisify": () => (/* binding */ unpromisify), /* harmony export */ "version": () => (/* binding */ version), /* harmony export */ "whenTransitionDone": () => (/* binding */ whenTransitionDone), /* harmony export */ "wholeDivideDurations": () => (/* binding */ wholeDivideDurations) /* harmony export */ }); /* harmony import */ var _main_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./main.css */ "./node_modules/@fullcalendar/common/main.css"); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var _vdom_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./vdom.js */ "./node_modules/@fullcalendar/common/vdom.js"); /*! FullCalendar v5.11.3 Docs & License: https://fullcalendar.io/ (c) 2022 Adam Shaw */ // no public types yet. when there are, export from: // import {} from './api-type-deps' var EventSourceApi = /** @class */ (function () { function EventSourceApi(context, internalEventSource) { this.context = context; this.internalEventSource = internalEventSource; } EventSourceApi.prototype.remove = function () { this.context.dispatch({ type: 'REMOVE_EVENT_SOURCE', sourceId: this.internalEventSource.sourceId, }); }; EventSourceApi.prototype.refetch = function () { this.context.dispatch({ type: 'FETCH_EVENT_SOURCES', sourceIds: [this.internalEventSource.sourceId], isRefetch: true, }); }; Object.defineProperty(EventSourceApi.prototype, "id", { get: function () { return this.internalEventSource.publicId; }, enumerable: false, configurable: true }); Object.defineProperty(EventSourceApi.prototype, "url", { get: function () { return this.internalEventSource.meta.url; }, enumerable: false, configurable: true }); Object.defineProperty(EventSourceApi.prototype, "format", { get: function () { return this.internalEventSource.meta.format; // TODO: bad. not guaranteed }, enumerable: false, configurable: true }); return EventSourceApi; }()); function removeElement(el) { if (el.parentNode) { el.parentNode.removeChild(el); } } // Querying // ---------------------------------------------------------------------------------------------------------------- function elementClosest(el, selector) { if (el.closest) { return el.closest(selector); // really bad fallback for IE // from https://developer.mozilla.org/en-US/docs/Web/API/Element/closest } if (!document.documentElement.contains(el)) { return null; } do { if (elementMatches(el, selector)) { return el; } el = (el.parentElement || el.parentNode); } while (el !== null && el.nodeType === 1); return null; } function elementMatches(el, selector) { var method = el.matches || el.matchesSelector || el.msMatchesSelector; return method.call(el, selector); } // accepts multiple subject els // returns a real array. good for methods like forEach // TODO: accept the document function findElements(container, selector) { var containers = container instanceof HTMLElement ? [container] : container; var allMatches = []; for (var i = 0; i < containers.length; i += 1) { var matches = containers[i].querySelectorAll(selector); for (var j = 0; j < matches.length; j += 1) { allMatches.push(matches[j]); } } return allMatches; } // accepts multiple subject els // only queries direct child elements // TODO: rename to findDirectChildren! function findDirectChildren(parent, selector) { var parents = parent instanceof HTMLElement ? [parent] : parent; var allMatches = []; for (var i = 0; i < parents.length; i += 1) { var childNodes = parents[i].children; // only ever elements for (var j = 0; j < childNodes.length; j += 1) { var childNode = childNodes[j]; if (!selector || elementMatches(childNode, selector)) { allMatches.push(childNode); } } } return allMatches; } // Style // ---------------------------------------------------------------------------------------------------------------- var PIXEL_PROP_RE = /(top|left|right|bottom|width|height)$/i; function applyStyle(el, props) { for (var propName in props) { applyStyleProp(el, propName, props[propName]); } } function applyStyleProp(el, name, val) { if (val == null) { el.style[name] = ''; } else if (typeof val === 'number' && PIXEL_PROP_RE.test(name)) { el.style[name] = val + "px"; } else { el.style[name] = val; } } // Event Handling // ---------------------------------------------------------------------------------------------------------------- // if intercepting bubbled events at the document/window/body level, // and want to see originating element (the 'target'), use this util instead // of `ev.target` because it goes within web-component boundaries. function getEventTargetViaRoot(ev) { var _a, _b; return (_b = (_a = ev.composedPath) === null || _a === void 0 ? void 0 : _a.call(ev)[0]) !== null && _b !== void 0 ? _b : ev.target; } // Shadow DOM consuderations // ---------------------------------------------------------------------------------------------------------------- function getElRoot(el) { return el.getRootNode ? el.getRootNode() : document; } // Unique ID for DOM attribute var guid$1 = 0; function getUniqueDomId() { guid$1 += 1; return 'fc-dom-' + guid$1; } // Stops a mouse/touch event from doing it's native browser action function preventDefault(ev) { ev.preventDefault(); } // Event Delegation // ---------------------------------------------------------------------------------------------------------------- function buildDelegationHandler(selector, handler) { return function (ev) { var matchedChild = elementClosest(ev.target, selector); if (matchedChild) { handler.call(matchedChild, ev, matchedChild); } }; } function listenBySelector(container, eventType, selector, handler) { var attachedHandler = buildDelegationHandler(selector, handler); container.addEventListener(eventType, attachedHandler); return function () { container.removeEventListener(eventType, attachedHandler); }; } function listenToHoverBySelector(container, selector, onMouseEnter, onMouseLeave) { var currentMatchedChild; return listenBySelector(container, 'mouseover', selector, function (mouseOverEv, matchedChild) { if (matchedChild !== currentMatchedChild) { currentMatchedChild = matchedChild; onMouseEnter(mouseOverEv, matchedChild); var realOnMouseLeave_1 = function (mouseLeaveEv) { currentMatchedChild = null; onMouseLeave(mouseLeaveEv, matchedChild); matchedChild.removeEventListener('mouseleave', realOnMouseLeave_1); }; // listen to the next mouseleave, and then unattach matchedChild.addEventListener('mouseleave', realOnMouseLeave_1); } }); } // Animation // ---------------------------------------------------------------------------------------------------------------- var transitionEventNames = [ 'webkitTransitionEnd', 'otransitionend', 'oTransitionEnd', 'msTransitionEnd', 'transitionend', ]; // triggered only when the next single subsequent transition finishes function whenTransitionDone(el, callback) { var realCallback = function (ev) { callback(ev); transitionEventNames.forEach(function (eventName) { el.removeEventListener(eventName, realCallback); }); }; transitionEventNames.forEach(function (eventName) { el.addEventListener(eventName, realCallback); // cross-browser way to determine when the transition finishes }); } // ARIA workarounds // ---------------------------------------------------------------------------------------------------------------- function createAriaClickAttrs(handler) { return (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({ onClick: handler }, createAriaKeyboardAttrs(handler)); } function createAriaKeyboardAttrs(handler) { return { tabIndex: 0, onKeyDown: function (ev) { if (ev.key === 'Enter' || ev.key === ' ') { handler(ev); ev.preventDefault(); // if space, don't scroll down page } }, }; } var guidNumber = 0; function guid() { guidNumber += 1; return String(guidNumber); } /* FullCalendar-specific DOM Utilities ----------------------------------------------------------------------------------------------------------------------*/ // Make the mouse cursor express that an event is not allowed in the current area function disableCursor() { document.body.classList.add('fc-not-allowed'); } // Returns the mouse cursor to its original look function enableCursor() { document.body.classList.remove('fc-not-allowed'); } /* Selection ----------------------------------------------------------------------------------------------------------------------*/ function preventSelection(el) { el.classList.add('fc-unselectable'); el.addEventListener('selectstart', preventDefault); } function allowSelection(el) { el.classList.remove('fc-unselectable'); el.removeEventListener('selectstart', preventDefault); } /* Context Menu ----------------------------------------------------------------------------------------------------------------------*/ function preventContextMenu(el) { el.addEventListener('contextmenu', preventDefault); } function allowContextMenu(el) { el.removeEventListener('contextmenu', preventDefault); } function parseFieldSpecs(input) { var specs = []; var tokens = []; var i; var token; if (typeof input === 'string') { tokens = input.split(/\s*,\s*/); } else if (typeof input === 'function') { tokens = [input]; } else if (Array.isArray(input)) { tokens = input; } for (i = 0; i < tokens.length; i += 1) { token = tokens[i]; if (typeof token === 'string') { specs.push(token.charAt(0) === '-' ? { field: token.substring(1), order: -1 } : { field: token, order: 1 }); } else if (typeof token === 'function') { specs.push({ func: token }); } } return specs; } function compareByFieldSpecs(obj0, obj1, fieldSpecs) { var i; var cmp; for (i = 0; i < fieldSpecs.length; i += 1) { cmp = compareByFieldSpec(obj0, obj1, fieldSpecs[i]); if (cmp) { return cmp; } } return 0; } function compareByFieldSpec(obj0, obj1, fieldSpec) { if (fieldSpec.func) { return fieldSpec.func(obj0, obj1); } return flexibleCompare(obj0[fieldSpec.field], obj1[fieldSpec.field]) * (fieldSpec.order || 1); } function flexibleCompare(a, b) { if (!a && !b) { return 0; } if (b == null) { return -1; } if (a == null) { return 1; } if (typeof a === 'string' || typeof b === 'string') { return String(a).localeCompare(String(b)); } return a - b; } /* String Utilities ----------------------------------------------------------------------------------------------------------------------*/ function padStart(val, len) { var s = String(val); return '000'.substr(0, len - s.length) + s; } function formatWithOrdinals(formatter, args, fallbackText) { if (typeof formatter === 'function') { return formatter.apply(void 0, args); } if (typeof formatter === 'string') { // non-blank string return args.reduce(function (str, arg, index) { return (str.replace('$' + index, arg || '')); }, formatter); } return fallbackText; } /* Number Utilities ----------------------------------------------------------------------------------------------------------------------*/ function compareNumbers(a, b) { return a - b; } function isInt(n) { return n % 1 === 0; } /* FC-specific DOM dimension stuff ----------------------------------------------------------------------------------------------------------------------*/ function computeSmallestCellWidth(cellEl) { var allWidthEl = cellEl.querySelector('.fc-scrollgrid-shrink-frame'); var contentWidthEl = cellEl.querySelector('.fc-scrollgrid-shrink-cushion'); if (!allWidthEl) { throw new Error('needs fc-scrollgrid-shrink-frame className'); // TODO: use const } if (!contentWidthEl) { throw new Error('needs fc-scrollgrid-shrink-cushion className'); } return cellEl.getBoundingClientRect().width - allWidthEl.getBoundingClientRect().width + // the cell padding+border contentWidthEl.getBoundingClientRect().width; } var DAY_IDS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat']; // Adding function addWeeks(m, n) { var a = dateToUtcArray(m); a[2] += n * 7; return arrayToUtcDate(a); } function addDays(m, n) { var a = dateToUtcArray(m); a[2] += n; return arrayToUtcDate(a); } function addMs(m, n) { var a = dateToUtcArray(m); a[6] += n; return arrayToUtcDate(a); } // Diffing (all return floats) // TODO: why not use ranges? function diffWeeks(m0, m1) { return diffDays(m0, m1) / 7; } function diffDays(m0, m1) { return (m1.valueOf() - m0.valueOf()) / (1000 * 60 * 60 * 24); } function diffHours(m0, m1) { return (m1.valueOf() - m0.valueOf()) / (1000 * 60 * 60); } function diffMinutes(m0, m1) { return (m1.valueOf() - m0.valueOf()) / (1000 * 60); } function diffSeconds(m0, m1) { return (m1.valueOf() - m0.valueOf()) / 1000; } function diffDayAndTime(m0, m1) { var m0day = startOfDay(m0); var m1day = startOfDay(m1); return { years: 0, months: 0, days: Math.round(diffDays(m0day, m1day)), milliseconds: (m1.valueOf() - m1day.valueOf()) - (m0.valueOf() - m0day.valueOf()), }; } // Diffing Whole Units function diffWholeWeeks(m0, m1) { var d = diffWholeDays(m0, m1); if (d !== null && d % 7 === 0) { return d / 7; } return null; } function diffWholeDays(m0, m1) { if (timeAsMs(m0) === timeAsMs(m1)) { return Math.round(diffDays(m0, m1)); } return null; } // Start-Of function startOfDay(m) { return arrayToUtcDate([ m.getUTCFullYear(), m.getUTCMonth(), m.getUTCDate(), ]); } function startOfHour(m) { return arrayToUtcDate([ m.getUTCFullYear(), m.getUTCMonth(), m.getUTCDate(), m.getUTCHours(), ]); } function startOfMinute(m) { return arrayToUtcDate([ m.getUTCFullYear(), m.getUTCMonth(), m.getUTCDate(), m.getUTCHours(), m.getUTCMinutes(), ]); } function startOfSecond(m) { return arrayToUtcDate([ m.getUTCFullYear(), m.getUTCMonth(), m.getUTCDate(), m.getUTCHours(), m.getUTCMinutes(), m.getUTCSeconds(), ]); } // Week Computation function weekOfYear(marker, dow, doy) { var y = marker.getUTCFullYear(); var w = weekOfGivenYear(marker, y, dow, doy); if (w < 1) { return weekOfGivenYear(marker, y - 1, dow, doy); } var nextW = weekOfGivenYear(marker, y + 1, dow, doy); if (nextW >= 1) { return Math.min(w, nextW); } return w; } function weekOfGivenYear(marker, year, dow, doy) { var firstWeekStart = arrayToUtcDate([year, 0, 1 + firstWeekOffset(year, dow, doy)]); var dayStart = startOfDay(marker); var days = Math.round(diffDays(firstWeekStart, dayStart)); return Math.floor(days / 7) + 1; // zero-indexed } // start-of-first-week - start-of-year function firstWeekOffset(year, dow, doy) { // first-week day -- which january is always in the first week (4 for iso, 1 for other) var fwd = 7 + dow - doy; // first-week day local weekday -- which local weekday is fwd var fwdlw = (7 + arrayToUtcDate([year, 0, fwd]).getUTCDay() - dow) % 7; return -fwdlw + fwd - 1; } // Array Conversion function dateToLocalArray(date) { return [ date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds(), ]; } function arrayToLocalDate(a) { return new Date(a[0], a[1] || 0, a[2] == null ? 1 : a[2], // day of month a[3] || 0, a[4] || 0, a[5] || 0); } function dateToUtcArray(date) { return [ date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds(), ]; } function arrayToUtcDate(a) { // according to web standards (and Safari), a month index is required. // massage if only given a year. if (a.length === 1) { a = a.concat([0]); } return new Date(Date.UTC.apply(Date, a)); } // Other Utils function isValidDate(m) { return !isNaN(m.valueOf()); } function timeAsMs(m) { return m.getUTCHours() * 1000 * 60 * 60 + m.getUTCMinutes() * 1000 * 60 + m.getUTCSeconds() * 1000 + m.getUTCMilliseconds(); } function createEventInstance(defId, range, forcedStartTzo, forcedEndTzo) { return { instanceId: guid(), defId: defId, range: range, forcedStartTzo: forcedStartTzo == null ? null : forcedStartTzo, forcedEndTzo: forcedEndTzo == null ? null : forcedEndTzo, }; } var hasOwnProperty = Object.prototype.hasOwnProperty; // Merges an array of objects into a single object. // The second argument allows for an array of property names who's object values will be merged together. function mergeProps(propObjs, complexPropsMap) { var dest = {}; if (complexPropsMap) { for (var name_1 in complexPropsMap) { var complexObjs = []; // collect the trailing object values, stopping when a non-object is discovered for (var i = propObjs.length - 1; i >= 0; i -= 1) { var val = propObjs[i][name_1]; if (typeof val === 'object' && val) { // non-null object complexObjs.unshift(val); } else if (val !== undefined) { dest[name_1] = val; // if there were no objects, this value will be used break; } } // if the trailing values were objects, use the merged value if (complexObjs.length) { dest[name_1] = mergeProps(complexObjs); } } } // copy values into the destination, going from last to first for (var i = propObjs.length - 1; i >= 0; i -= 1) { var props = propObjs[i]; for (var name_2 in props) { if (!(name_2 in dest)) { // if already assigned by previous props or complex props, don't reassign dest[name_2] = props[name_2]; } } } return dest; } function filterHash(hash, func) { var filtered = {}; for (var key in hash) { if (func(hash[key], key)) { filtered[key] = hash[key]; } } return filtered; } function mapHash(hash, func) { var newHash = {}; for (var key in hash) { newHash[key] = func(hash[key], key); } return newHash; } function arrayToHash(a) { var hash = {}; for (var _i = 0, a_1 = a; _i < a_1.length; _i++) { var item = a_1[_i]; hash[item] = true; } return hash; } function buildHashFromArray(a, func) { var hash = {}; for (var i = 0; i < a.length; i += 1) { var tuple = func(a[i], i); hash[tuple[0]] = tuple[1]; } return hash; } function hashValuesToArray(obj) { var a = []; for (var key in obj) { a.push(obj[key]); } return a; } function isPropsEqual(obj0, obj1) { if (obj0 === obj1) { return true; } for (var key in obj0) { if (hasOwnProperty.call(obj0, key)) { if (!(key in obj1)) { return false; } } } for (var key in obj1) { if (hasOwnProperty.call(obj1, key)) { if (obj0[key] !== obj1[key]) { return false; } } } return true; } function getUnequalProps(obj0, obj1) { var keys = []; for (var key in obj0) { if (hasOwnProperty.call(obj0, key)) { if (!(key in obj1)) { keys.push(key); } } } for (var key in obj1) { if (hasOwnProperty.call(obj1, key)) { if (obj0[key] !== obj1[key]) { keys.push(key); } } } return keys; } function compareObjs(oldProps, newProps, equalityFuncs) { if (equalityFuncs === void 0) { equalityFuncs = {}; } if (oldProps === newProps) { return true; } for (var key in newProps) { if (key in oldProps && isObjValsEqual(oldProps[key], newProps[key], equalityFuncs[key])) ; else { return false; } } // check for props that were omitted in the new for (var key in oldProps) { if (!(key in newProps)) { return false; } } return true; } /* assumed "true" equality for handler names like "onReceiveSomething" */ function isObjValsEqual(val0, val1, comparator) { if (val0 === val1 || comparator === true) { return true; } if (comparator) { return comparator(val0, val1); } return false; } function collectFromHash(hash, startIndex, endIndex, step) { if (startIndex === void 0) { startIndex = 0; } if (step === void 0) { step = 1; } var res = []; if (endIndex == null) { endIndex = Object.keys(hash).length; } for (var i = startIndex; i < endIndex; i += step) { var val = hash[i]; if (val !== undefined) { // will disregard undefined for sparse arrays res.push(val); } } return res; } function parseRecurring(refined, defaultAllDay, dateEnv, recurringTypes) { for (var i = 0; i < recurringTypes.length; i += 1) { var parsed = recurringTypes[i].parse(refined, dateEnv); if (parsed) { var allDay = refined.allDay; if (allDay == null) { allDay = defaultAllDay; if (allDay == null) { allDay = parsed.allDayGuess; if (allDay == null) { allDay = false; } } } return { allDay: allDay, duration: parsed.duration, typeData: parsed.typeData, typeId: i, }; } } return null; } function expandRecurring(eventStore, framingRange, context) { var dateEnv = context.dateEnv, pluginHooks = context.pluginHooks, options = context.options; var defs = eventStore.defs, instances = eventStore.instances; // remove existing recurring instances // TODO: bad. always expand events as a second step instances = filterHash(instances, function (instance) { return !defs[instance.defId].recurringDef; }); for (var defId in defs) { var def = defs[defId]; if (def.recurringDef) { var duration = def.recurringDef.duration; if (!duration) { duration = def.allDay ? options.defaultAllDayEventDuration : options.defaultTimedEventDuration; } var starts = expandRecurringRanges(def, duration, framingRange, dateEnv, pluginHooks.recurringTypes); for (var _i = 0, starts_1 = starts; _i < starts_1.length; _i++) { var start = starts_1[_i]; var instance = createEventInstance(defId, { start: start, end: dateEnv.add(start, duration), }); instances[instance.instanceId] = instance; } } } return { defs: defs, instances: instances }; } /* Event MUST have a recurringDef */ function expandRecurringRanges(eventDef, duration, framingRange, dateEnv, recurringTypes) { var typeDef = recurringTypes[eventDef.recurringDef.typeId]; var markers = typeDef.expand(eventDef.recurringDef.typeData, { start: dateEnv.subtract(framingRange.start, duration), end: framingRange.end, }, dateEnv); // the recurrence plugins don't guarantee that all-day events are start-of-day, so we have to if (eventDef.allDay) { markers = markers.map(startOfDay); } return markers; } var INTERNAL_UNITS = ['years', 'months', 'days', 'milliseconds']; var PARSE_RE = /^(-?)(?:(\d+)\.)?(\d+):(\d\d)(?::(\d\d)(?:\.(\d\d\d))?)?/; // Parsing and Creation function createDuration(input, unit) { var _a; if (typeof input === 'string') { return parseString(input); } if (typeof input === 'object' && input) { // non-null object return parseObject(input); } if (typeof input === 'number') { return parseObject((_a = {}, _a[unit || 'milliseconds'] = input, _a)); } return null; } function parseString(s) { var m = PARSE_RE.exec(s); if (m) { var sign = m[1] ? -1 : 1; return { years: 0, months: 0, days: sign * (m[2] ? parseInt(m[2], 10) : 0), milliseconds: sign * ((m[3] ? parseInt(m[3], 10) : 0) * 60 * 60 * 1000 + // hours (m[4] ? parseInt(m[4], 10) : 0) * 60 * 1000 + // minutes (m[5] ? parseInt(m[5], 10) : 0) * 1000 + // seconds (m[6] ? parseInt(m[6], 10) : 0) // ms ), }; } return null; } function parseObject(obj) { var duration = { years: obj.years || obj.year || 0, months: obj.months || obj.month || 0, days: obj.days || obj.day || 0, milliseconds: (obj.hours || obj.hour || 0) * 60 * 60 * 1000 + // hours (obj.minutes || obj.minute || 0) * 60 * 1000 + // minutes (obj.seconds || obj.second || 0) * 1000 + // seconds (obj.milliseconds || obj.millisecond || obj.ms || 0), // ms }; var weeks = obj.weeks || obj.week; if (weeks) { duration.days += weeks * 7; duration.specifiedWeeks = true; } return duration; } // Equality function durationsEqual(d0, d1) { return d0.years === d1.years && d0.months === d1.months && d0.days === d1.days && d0.milliseconds === d1.milliseconds; } function asCleanDays(dur) { if (!dur.years && !dur.months && !dur.milliseconds) { return dur.days; } return 0; } // Simple Math function addDurations(d0, d1) { return { years: d0.years + d1.years, months: d0.months + d1.months, days: d0.days + d1.days, milliseconds: d0.milliseconds + d1.milliseconds, }; } function subtractDurations(d1, d0) { return { years: d1.years - d0.years, months: d1.months - d0.months, days: d1.days - d0.days, milliseconds: d1.milliseconds - d0.milliseconds, }; } function multiplyDuration(d, n) { return { years: d.years * n, months: d.months * n, days: d.days * n, milliseconds: d.milliseconds * n, }; } // Conversions // "Rough" because they are based on average-case Gregorian months/years function asRoughYears(dur) { return asRoughDays(dur) / 365; } function asRoughMonths(dur) { return asRoughDays(dur) / 30; } function asRoughDays(dur) { return asRoughMs(dur) / 864e5; } function asRoughMinutes(dur) { return asRoughMs(dur) / (1000 * 60); } function asRoughSeconds(dur) { return asRoughMs(dur) / 1000; } function asRoughMs(dur) { return dur.years * (365 * 864e5) + dur.months * (30 * 864e5) + dur.days * 864e5 + dur.milliseconds; } // Advanced Math function wholeDivideDurations(numerator, denominator) { var res = null; for (var i = 0; i < INTERNAL_UNITS.length; i += 1) { var unit = INTERNAL_UNITS[i]; if (denominator[unit]) { var localRes = numerator[unit] / denominator[unit]; if (!isInt(localRes) || (res !== null && res !== localRes)) { return null; } res = localRes; } else if (numerator[unit]) { // needs to divide by something but can't! return null; } } return res; } function greatestDurationDenominator(dur) { var ms = dur.milliseconds; if (ms) { if (ms % 1000 !== 0) { return { unit: 'millisecond', value: ms }; } if (ms % (1000 * 60) !== 0) { return { unit: 'second', value: ms / 1000 }; } if (ms % (1000 * 60 * 60) !== 0) { return { unit: 'minute', value: ms / (1000 * 60) }; } if (ms) { return { unit: 'hour', value: ms / (1000 * 60 * 60) }; } } if (dur.days) { if (dur.specifiedWeeks && dur.days % 7 === 0) { return { unit: 'week', value: dur.days / 7 }; } return { unit: 'day', value: dur.days }; } if (dur.months) { return { unit: 'month', value: dur.months }; } if (dur.years) { return { unit: 'year', value: dur.years }; } return { unit: 'millisecond', value: 0 }; } // timeZoneOffset is in minutes function buildIsoString(marker, timeZoneOffset, stripZeroTime) { if (stripZeroTime === void 0) { stripZeroTime = false; } var s = marker.toISOString(); s = s.replace('.000', ''); if (stripZeroTime) { s = s.replace('T00:00:00Z', ''); } if (s.length > 10) { // time part wasn't stripped, can add timezone info if (timeZoneOffset == null) { s = s.replace('Z', ''); } else if (timeZoneOffset !== 0) { s = s.replace('Z', formatTimeZoneOffset(timeZoneOffset, true)); } // otherwise, its UTC-0 and we want to keep the Z } return s; } // formats the date, but with no time part // TODO: somehow merge with buildIsoString and stripZeroTime // TODO: rename. omit "string" function formatDayString(marker) { return marker.toISOString().replace(/T.*$/, ''); } // TODO: use Date::toISOString and use everything after the T? function formatIsoTimeString(marker) { return padStart(marker.getUTCHours(), 2) + ':' + padStart(marker.getUTCMinutes(), 2) + ':' + padStart(marker.getUTCSeconds(), 2); } function formatTimeZoneOffset(minutes, doIso) { if (doIso === void 0) { doIso = false; } var sign = minutes < 0 ? '-' : '+'; var abs = Math.abs(minutes); var hours = Math.floor(abs / 60); var mins = Math.round(abs % 60); if (doIso) { return sign + padStart(hours, 2) + ":" + padStart(mins, 2); } return "GMT" + sign + hours + (mins ? ":" + padStart(mins, 2) : ''); } // TODO: new util arrayify? function removeExact(array, exactVal) { var removeCnt = 0; var i = 0; while (i < array.length) { if (array[i] === exactVal) { array.splice(i, 1); removeCnt += 1; } else { i += 1; } } return removeCnt; } function isArraysEqual(a0, a1, equalityFunc) { if (a0 === a1) { return true; } var len = a0.length; var i; if (len !== a1.length) { // not array? or not same length? return false; } for (i = 0; i < len; i += 1) { if (!(equalityFunc ? equalityFunc(a0[i], a1[i]) : a0[i] === a1[i])) { return false; } } return true; } function memoize(workerFunc, resEquality, teardownFunc) { var currentArgs; var currentRes; return function () { var newArgs = []; for (var _i = 0; _i < arguments.length; _i++) { newArgs[_i] = arguments[_i]; } if (!currentArgs) { currentRes = workerFunc.apply(this, newArgs); } else if (!isArraysEqual(currentArgs, newArgs)) { if (teardownFunc) { teardownFunc(currentRes); } var res = workerFunc.apply(this, newArgs); if (!resEquality || !resEquality(res, currentRes)) { currentRes = res; } } currentArgs = newArgs; return currentRes; }; } function memoizeObjArg(workerFunc, resEquality, teardownFunc) { var _this = this; var currentArg; var currentRes; return function (newArg) { if (!currentArg) { currentRes = workerFunc.call(_this, newArg); } else if (!isPropsEqual(currentArg, newArg)) { if (teardownFunc) { teardownFunc(currentRes); } var res = workerFunc.call(_this, newArg); if (!resEquality || !resEquality(res, currentRes)) { currentRes = res; } } currentArg = newArg; return currentRes; }; } function memoizeArraylike(// used at all? workerFunc, resEquality, teardownFunc) { var _this = this; var currentArgSets = []; var currentResults = []; return function (newArgSets) { var currentLen = currentArgSets.length; var newLen = newArgSets.length; var i = 0; for (; i < currentLen; i += 1) { if (!newArgSets[i]) { // one of the old sets no longer exists if (teardownFunc) { teardownFunc(currentResults[i]); } } else if (!isArraysEqual(currentArgSets[i], newArgSets[i])) { if (teardownFunc) { teardownFunc(currentResults[i]); } var res = workerFunc.apply(_this, newArgSets[i]); if (!resEquality || !resEquality(res, currentResults[i])) { currentResults[i] = res; } } } for (; i < newLen; i += 1) { currentResults[i] = workerFunc.apply(_this, newArgSets[i]); } currentArgSets = newArgSets; currentResults.splice(newLen); // remove excess return currentResults; }; } function memoizeHashlike(workerFunc, resEquality, teardownFunc) { var _this = this; var currentArgHash = {}; var currentResHash = {}; return function (newArgHash) { var newResHash = {}; for (var key in newArgHash) { if (!currentResHash[key]) { newResHash[key] = workerFunc.apply(_this, newArgHash[key]); } else if (!isArraysEqual(currentArgHash[key], newArgHash[key])) { if (teardownFunc) { teardownFunc(currentResHash[key]); } var res = workerFunc.apply(_this, newArgHash[key]); newResHash[key] = (resEquality && resEquality(res, currentResHash[key])) ? currentResHash[key] : res; } else { newResHash[key] = currentResHash[key]; } } currentArgHash = newArgHash; currentResHash = newResHash; return newResHash; }; } var EXTENDED_SETTINGS_AND_SEVERITIES = { week: 3, separator: 0, omitZeroMinute: 0, meridiem: 0, omitCommas: 0, }; var STANDARD_DATE_PROP_SEVERITIES = { timeZoneName: 7, era: 6, year: 5, month: 4, day: 2, weekday: 2, hour: 1, minute: 1, second: 1, }; var MERIDIEM_RE = /\s*([ap])\.?m\.?/i; // eats up leading spaces too var COMMA_RE = /,/g; // we need re for globalness var MULTI_SPACE_RE = /\s+/g; var LTR_RE = /\u200e/g; // control character var UTC_RE = /UTC|GMT/; var NativeFormatter = /** @class */ (function () { function NativeFormatter(formatSettings) { var standardDateProps = {}; var extendedSettings = {}; var severity = 0; for (var name_1 in formatSettings) { if (name_1 in EXTENDED_SETTINGS_AND_SEVERITIES) { extendedSettings[name_1] = formatSettings[name_1]; severity = Math.max(EXTENDED_SETTINGS_AND_SEVERITIES[name_1], severity); } else { standardDateProps[name_1] = formatSettings[name_1]; if (name_1 in STANDARD_DATE_PROP_SEVERITIES) { // TODO: what about hour12? no severity severity = Math.max(STANDARD_DATE_PROP_SEVERITIES[name_1], severity); } } } this.standardDateProps = standardDateProps; this.extendedSettings = extendedSettings; this.severity = severity; this.buildFormattingFunc = memoize(buildFormattingFunc); } NativeFormatter.prototype.format = function (date, context) { return this.buildFormattingFunc(this.standardDateProps, this.extendedSettings, context)(date); }; NativeFormatter.prototype.formatRange = function (start, end, context, betterDefaultSeparator) { var _a = this, standardDateProps = _a.standardDateProps, extendedSettings = _a.extendedSettings; var diffSeverity = computeMarkerDiffSeverity(start.marker, end.marker, context.calendarSystem); if (!diffSeverity) { return this.format(start, context); } var biggestUnitForPartial = diffSeverity; if (biggestUnitForPartial > 1 && // the two dates are different in a way that's larger scale than time (standardDateProps.year === 'numeric' || standardDateProps.year === '2-digit') && (standardDateProps.month === 'numeric' || standardDateProps.month === '2-digit') && (standardDateProps.day === 'numeric' || standardDateProps.day === '2-digit')) { biggestUnitForPartial = 1; // make it look like the dates are only different in terms of time } var full0 = this.format(start, context); var full1 = this.format(end, context); if (full0 === full1) { return full0; } var partialDateProps = computePartialFormattingOptions(standardDateProps, biggestUnitForPartial); var partialFormattingFunc = buildFormattingFunc(partialDateProps, extendedSettings, context); var partial0 = partialFormattingFunc(start); var partial1 = partialFormattingFunc(end); var insertion = findCommonInsertion(full0, partial0, full1, partial1); var separator = extendedSettings.separator || betterDefaultSeparator || context.defaultSeparator || ''; if (insertion) { return insertion.before + partial0 + separator + partial1 + insertion.after; } return full0 + separator + full1; }; NativeFormatter.prototype.getLargestUnit = function () { switch (this.severity) { case 7: case 6: case 5: return 'year'; case 4: return 'month'; case 3: return 'week'; case 2: return 'day'; default: return 'time'; // really? } }; return NativeFormatter; }()); function buildFormattingFunc(standardDateProps, extendedSettings, context) { var standardDatePropCnt = Object.keys(standardDateProps).length; if (standardDatePropCnt === 1 && standardDateProps.timeZoneName === 'short') { return function (date) { return (formatTimeZoneOffset(date.timeZoneOffset)); }; } if (standardDatePropCnt === 0 && extendedSettings.week) { return function (date) { return (formatWeekNumber(context.computeWeekNumber(date.marker), context.weekText, context.weekTextLong, context.locale, extendedSettings.week)); }; } return buildNativeFormattingFunc(standardDateProps, extendedSettings, context); } function buildNativeFormattingFunc(standardDateProps, extendedSettings, context) { standardDateProps = (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, standardDateProps); // copy extendedSettings = (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, extendedSettings); // copy sanitizeSettings(standardDateProps, extendedSettings); standardDateProps.timeZone = 'UTC'; // we leverage the only guaranteed timeZone for our UTC markers var normalFormat = new Intl.DateTimeFormat(context.locale.codes, standardDateProps); var zeroFormat; // needed? if (extendedSettings.omitZeroMinute) { var zeroProps = (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, standardDateProps); delete zeroProps.minute; // seconds and ms were already considered in sanitizeSettings zeroFormat = new Intl.DateTimeFormat(context.locale.codes, zeroProps); } return function (date) { var marker = date.marker; var format; if (zeroFormat && !marker.getUTCMinutes()) { format = zeroFormat; } else { format = normalFormat; } var s = format.format(marker); return postProcess(s, date, standardDateProps, extendedSettings, context); }; } function sanitizeSettings(standardDateProps, extendedSettings) { // deal with a browser inconsistency where formatting the timezone // requires that the hour/minute be present. if (standardDateProps.timeZoneName) { if (!standardDateProps.hour) { standardDateProps.hour = '2-digit'; } if (!standardDateProps.minute) { standardDateProps.minute = '2-digit'; } } // only support short timezone names if (standardDateProps.timeZoneName === 'long') { standardDateProps.timeZoneName = 'short'; } // if requesting to display seconds, MUST display minutes if (extendedSettings.omitZeroMinute && (standardDateProps.second || standardDateProps.millisecond)) { delete extendedSettings.omitZeroMinute; } } function postProcess(s, date, standardDateProps, extendedSettings, context) { s = s.replace(LTR_RE, ''); // remove left-to-right control chars. do first. good for other regexes if (standardDateProps.timeZoneName === 'short') { s = injectTzoStr(s, (context.timeZone === 'UTC' || date.timeZoneOffset == null) ? 'UTC' : // important to normalize for IE, which does "GMT" formatTimeZoneOffset(date.timeZoneOffset)); } if (extendedSettings.omitCommas) { s = s.replace(COMMA_RE, '').trim(); } if (extendedSettings.omitZeroMinute) { s = s.replace(':00', ''); // zeroFormat doesn't always achieve this } // ^ do anything that might create adjacent spaces before this point, // because MERIDIEM_RE likes to eat up loading spaces if (extendedSettings.meridiem === false) { s = s.replace(MERIDIEM_RE, '').trim(); } else if (extendedSettings.meridiem === 'narrow') { // a/p s = s.replace(MERIDIEM_RE, function (m0, m1) { return m1.toLocaleLowerCase(); }); } else if (extendedSettings.meridiem === 'short') { // am/pm s = s.replace(MERIDIEM_RE, function (m0, m1) { return m1.toLocaleLowerCase() + "m"; }); } else if (extendedSettings.meridiem === 'lowercase') { // other meridiem transformers already converted to lowercase s = s.replace(MERIDIEM_RE, function (m0) { return m0.toLocaleLowerCase(); }); } s = s.replace(MULTI_SPACE_RE, ' '); s = s.trim(); return s; } function injectTzoStr(s, tzoStr) { var replaced = false; s = s.replace(UTC_RE, function () { replaced = true; return tzoStr; }); // IE11 doesn't include UTC/GMT in the original string, so append to end if (!replaced) { s += " " + tzoStr; } return s; } function formatWeekNumber(num, weekText, weekTextLong, locale, display) { var parts = []; if (display === 'long') { parts.push(weekTextLong); } else if (display === 'short' || display === 'narrow') { parts.push(weekText); } if (display === 'long' || display === 'short') { parts.push(' '); } parts.push(locale.simpleNumberFormat.format(num)); if (locale.options.direction === 'rtl') { // TODO: use control characters instead? parts.reverse(); } return parts.join(''); } // Range Formatting Utils // 0 = exactly the same // 1 = different by time // and bigger function computeMarkerDiffSeverity(d0, d1, ca) { if (ca.getMarkerYear(d0) !== ca.getMarkerYear(d1)) { return 5; } if (ca.getMarkerMonth(d0) !== ca.getMarkerMonth(d1)) { return 4; } if (ca.getMarkerDay(d0) !== ca.getMarkerDay(d1)) { return 2; } if (timeAsMs(d0) !== timeAsMs(d1)) { return 1; } return 0; } function computePartialFormattingOptions(options, biggestUnit) { var partialOptions = {}; for (var name_2 in options) { if (!(name_2 in STANDARD_DATE_PROP_SEVERITIES) || // not a date part prop (like timeZone) STANDARD_DATE_PROP_SEVERITIES[name_2] <= biggestUnit) { partialOptions[name_2] = options[name_2]; } } return partialOptions; } function findCommonInsertion(full0, partial0, full1, partial1) { var i0 = 0; while (i0 < full0.length) { var found0 = full0.indexOf(partial0, i0); if (found0 === -1) { break; } var before0 = full0.substr(0, found0); i0 = found0 + partial0.length; var after0 = full0.substr(i0); var i1 = 0; while (i1 < full1.length) { var found1 = full1.indexOf(partial1, i1); if (found1 === -1) { break; } var before1 = full1.substr(0, found1); i1 = found1 + partial1.length; var after1 = full1.substr(i1); if (before0 === before1 && after0 === after1) { return { before: before0, after: after0, }; } } } return null; } function expandZonedMarker(dateInfo, calendarSystem) { var a = calendarSystem.markerToArray(dateInfo.marker); return { marker: dateInfo.marker, timeZoneOffset: dateInfo.timeZoneOffset, array: a, year: a[0], month: a[1], day: a[2], hour: a[3], minute: a[4], second: a[5], millisecond: a[6], }; } function createVerboseFormattingArg(start, end, context, betterDefaultSeparator) { var startInfo = expandZonedMarker(start, context.calendarSystem); var endInfo = end ? expandZonedMarker(end, context.calendarSystem) : null; return { date: startInfo, start: startInfo, end: endInfo, timeZone: context.timeZone, localeCodes: context.locale.codes, defaultSeparator: betterDefaultSeparator || context.defaultSeparator, }; } /* TODO: fix the terminology of "formatter" vs "formatting func" */ /* At the time of instantiation, this object does not know which cmd-formatting system it will use. It receives this at the time of formatting, as a setting. */ var CmdFormatter = /** @class */ (function () { function CmdFormatter(cmdStr) { this.cmdStr = cmdStr; } CmdFormatter.prototype.format = function (date, context, betterDefaultSeparator) { return context.cmdFormatter(this.cmdStr, createVerboseFormattingArg(date, null, context, betterDefaultSeparator)); }; CmdFormatter.prototype.formatRange = function (start, end, context, betterDefaultSeparator) { return context.cmdFormatter(this.cmdStr, createVerboseFormattingArg(start, end, context, betterDefaultSeparator)); }; return CmdFormatter; }()); var FuncFormatter = /** @class */ (function () { function FuncFormatter(func) { this.func = func; } FuncFormatter.prototype.format = function (date, context, betterDefaultSeparator) { return this.func(createVerboseFormattingArg(date, null, context, betterDefaultSeparator)); }; FuncFormatter.prototype.formatRange = function (start, end, context, betterDefaultSeparator) { return this.func(createVerboseFormattingArg(start, end, context, betterDefaultSeparator)); }; return FuncFormatter; }()); function createFormatter(input) { if (typeof input === 'object' && input) { // non-null object return new NativeFormatter(input); } if (typeof input === 'string') { return new CmdFormatter(input); } if (typeof input === 'function') { return new FuncFormatter(input); } return null; } // base options // ------------ var BASE_OPTION_REFINERS = { navLinkDayClick: identity, navLinkWeekClick: identity, duration: createDuration, bootstrapFontAwesome: identity, buttonIcons: identity, customButtons: identity, defaultAllDayEventDuration: createDuration, defaultTimedEventDuration: createDuration, nextDayThreshold: createDuration, scrollTime: createDuration, scrollTimeReset: Boolean, slotMinTime: createDuration, slotMaxTime: createDuration, dayPopoverFormat: createFormatter, slotDuration: createDuration, snapDuration: createDuration, headerToolbar: identity, footerToolbar: identity, defaultRangeSeparator: String, titleRangeSeparator: String, forceEventDuration: Boolean, dayHeaders: Boolean, dayHeaderFormat: createFormatter, dayHeaderClassNames: identity, dayHeaderContent: identity, dayHeaderDidMount: identity, dayHeaderWillUnmount: identity, dayCellClassNames: identity, dayCellContent: identity, dayCellDidMount: identity, dayCellWillUnmount: identity, initialView: String, aspectRatio: Number, weekends: Boolean, weekNumberCalculation: identity, weekNumbers: Boolean, weekNumberClassNames: identity, weekNumberContent: identity, weekNumberDidMount: identity, weekNumberWillUnmount: identity, editable: Boolean, viewClassNames: identity, viewDidMount: identity, viewWillUnmount: identity, nowIndicator: Boolean, nowIndicatorClassNames: identity, nowIndicatorContent: identity, nowIndicatorDidMount: identity, nowIndicatorWillUnmount: identity, showNonCurrentDates: Boolean, lazyFetching: Boolean, startParam: String, endParam: String, timeZoneParam: String, timeZone: String, locales: identity, locale: identity, themeSystem: String, dragRevertDuration: Number, dragScroll: Boolean, allDayMaintainDuration: Boolean, unselectAuto: Boolean, dropAccept: identity, eventOrder: parseFieldSpecs, eventOrderStrict: Boolean, handleWindowResize: Boolean, windowResizeDelay: Number, longPressDelay: Number, eventDragMinDistance: Number, expandRows: Boolean, height: identity, contentHeight: identity, direction: String, weekNumberFormat: createFormatter, eventResizableFromStart: Boolean, displayEventTime: Boolean, displayEventEnd: Boolean, weekText: String, weekTextLong: String, progressiveEventRendering: Boolean, businessHours: identity, initialDate: identity, now: identity, eventDataTransform: identity, stickyHeaderDates: identity, stickyFooterScrollbar: identity, viewHeight: identity, defaultAllDay: Boolean, eventSourceFailure: identity, eventSourceSuccess: identity, eventDisplay: String, eventStartEditable: Boolean, eventDurationEditable: Boolean, eventOverlap: identity, eventConstraint: identity, eventAllow: identity, eventBackgroundColor: String, eventBorderColor: String, eventTextColor: String, eventColor: String, eventClassNames: identity, eventContent: identity, eventDidMount: identity, eventWillUnmount: identity, selectConstraint: identity, selectOverlap: identity, selectAllow: identity, droppable: Boolean, unselectCancel: String, slotLabelFormat: identity, slotLaneClassNames: identity, slotLaneContent: identity, slotLaneDidMount: identity, slotLaneWillUnmount: identity, slotLabelClassNames: identity, slotLabelContent: identity, slotLabelDidMount: identity, slotLabelWillUnmount: identity, dayMaxEvents: identity, dayMaxEventRows: identity, dayMinWidth: Number, slotLabelInterval: createDuration, allDayText: String, allDayClassNames: identity, allDayContent: identity, allDayDidMount: identity, allDayWillUnmount: identity, slotMinWidth: Number, navLinks: Boolean, eventTimeFormat: createFormatter, rerenderDelay: Number, moreLinkText: identity, moreLinkHint: identity, selectMinDistance: Number, selectable: Boolean, selectLongPressDelay: Number, eventLongPressDelay: Number, selectMirror: Boolean, eventMaxStack: Number, eventMinHeight: Number, eventMinWidth: Number, eventShortHeight: Number, slotEventOverlap: Boolean, plugins: identity, firstDay: Number, dayCount: Number, dateAlignment: String, dateIncrement: createDuration, hiddenDays: identity, monthMode: Boolean, fixedWeekCount: Boolean, validRange: identity, visibleRange: identity, titleFormat: identity, eventInteractive: Boolean, // only used by list-view, but languages define the value, so we need it in base options noEventsText: String, viewHint: identity, navLinkHint: identity, closeHint: String, timeHint: String, eventHint: String, moreLinkClick: identity, moreLinkClassNames: identity, moreLinkContent: identity, moreLinkDidMount: identity, moreLinkWillUnmount: identity, }; // do NOT give a type here. need `typeof BASE_OPTION_DEFAULTS` to give real results. // raw values. var BASE_OPTION_DEFAULTS = { eventDisplay: 'auto', defaultRangeSeparator: ' - ', titleRangeSeparator: ' \u2013 ', defaultTimedEventDuration: '01:00:00', defaultAllDayEventDuration: { day: 1 }, forceEventDuration: false, nextDayThreshold: '00:00:00', dayHeaders: true, initialView: '', aspectRatio: 1.35, headerToolbar: { start: 'title', center: '', end: 'today prev,next', }, weekends: true, weekNumbers: false, weekNumberCalculation: 'local', editable: false, nowIndicator: false, scrollTime: '06:00:00', scrollTimeReset: true, slotMinTime: '00:00:00', slotMaxTime: '24:00:00', showNonCurrentDates: true, lazyFetching: true, startParam: 'start', endParam: 'end', timeZoneParam: 'timeZone', timeZone: 'local', locales: [], locale: '', themeSystem: 'standard', dragRevertDuration: 500, dragScroll: true, allDayMaintainDuration: false, unselectAuto: true, dropAccept: '*', eventOrder: 'start,-duration,allDay,title', dayPopoverFormat: { month: 'long', day: 'numeric', year: 'numeric' }, handleWindowResize: true, windowResizeDelay: 100, longPressDelay: 1000, eventDragMinDistance: 5, expandRows: false, navLinks: false, selectable: false, eventMinHeight: 15, eventMinWidth: 30, eventShortHeight: 30, }; // calendar listeners // ------------------ var CALENDAR_LISTENER_REFINERS = { datesSet: identity, eventsSet: identity, eventAdd: identity, eventChange: identity, eventRemove: identity, windowResize: identity, eventClick: identity, eventMouseEnter: identity, eventMouseLeave: identity, select: identity, unselect: identity, loading: identity, // internal _unmount: identity, _beforeprint: identity, _afterprint: identity, _noEventDrop: identity, _noEventResize: identity, _resize: identity, _scrollRequest: identity, }; // calendar-specific options // ------------------------- var CALENDAR_OPTION_REFINERS = { buttonText: identity, buttonHints: identity, views: identity, plugins: identity, initialEvents: identity, events: identity, eventSources: identity, }; var COMPLEX_OPTION_COMPARATORS = { headerToolbar: isMaybeObjectsEqual, footerToolbar: isMaybeObjectsEqual, buttonText: isMaybeObjectsEqual, buttonHints: isMaybeObjectsEqual, buttonIcons: isMaybeObjectsEqual, dateIncrement: isMaybeObjectsEqual, }; function isMaybeObjectsEqual(a, b) { if (typeof a === 'object' && typeof b === 'object' && a && b) { // both non-null objects return isPropsEqual(a, b); } return a === b; } // view-specific options // --------------------- var VIEW_OPTION_REFINERS = { type: String, component: identity, buttonText: String, buttonTextKey: String, dateProfileGeneratorClass: identity, usesMinMaxTime: Boolean, classNames: identity, content: identity, didMount: identity, willUnmount: identity, }; // util funcs // ---------------------------------------------------------------------------------------------------- function mergeRawOptions(optionSets) { return mergeProps(optionSets, COMPLEX_OPTION_COMPARATORS); } function refineProps(input, refiners) { var refined = {}; var extra = {}; for (var propName in refiners) { if (propName in input) { refined[propName] = refiners[propName](input[propName]); } } for (var propName in input) { if (!(propName in refiners)) { extra[propName] = input[propName]; } } return { refined: refined, extra: extra }; } function identity(raw) { return raw; } function parseEvents(rawEvents, eventSource, context, allowOpenRange) { var eventStore = createEmptyEventStore(); var eventRefiners = buildEventRefiners(context); for (var _i = 0, rawEvents_1 = rawEvents; _i < rawEvents_1.length; _i++) { var rawEvent = rawEvents_1[_i]; var tuple = parseEvent(rawEvent, eventSource, context, allowOpenRange, eventRefiners); if (tuple) { eventTupleToStore(tuple, eventStore); } } return eventStore; } function eventTupleToStore(tuple, eventStore) { if (eventStore === void 0) { eventStore = createEmptyEventStore(); } eventStore.defs[tuple.def.defId] = tuple.def; if (tuple.instance) { eventStore.instances[tuple.instance.instanceId] = tuple.instance; } return eventStore; } // retrieves events that have the same groupId as the instance specified by `instanceId` // or they are the same as the instance. // why might instanceId not be in the store? an event from another calendar? function getRelevantEvents(eventStore, instanceId) { var instance = eventStore.instances[instanceId]; if (instance) { var def_1 = eventStore.defs[instance.defId]; // get events/instances with same group var newStore = filterEventStoreDefs(eventStore, function (lookDef) { return isEventDefsGrouped(def_1, lookDef); }); // add the original // TODO: wish we could use eventTupleToStore or something like it newStore.defs[def_1.defId] = def_1; newStore.instances[instance.instanceId] = instance; return newStore; } return createEmptyEventStore(); } function isEventDefsGrouped(def0, def1) { return Boolean(def0.groupId && def0.groupId === def1.groupId); } function createEmptyEventStore() { return { defs: {}, instances: {} }; } function mergeEventStores(store0, store1) { return { defs: (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, store0.defs), store1.defs), instances: (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, store0.instances), store1.instances), }; } function filterEventStoreDefs(eventStore, filterFunc) { var defs = filterHash(eventStore.defs, filterFunc); var instances = filterHash(eventStore.instances, function (instance) { return (defs[instance.defId] // still exists? ); }); return { defs: defs, instances: instances }; } function excludeSubEventStore(master, sub) { var defs = master.defs, instances = master.instances; var filteredDefs = {}; var filteredInstances = {}; for (var defId in defs) { if (!sub.defs[defId]) { // not explicitly excluded filteredDefs[defId] = defs[defId]; } } for (var instanceId in instances) { if (!sub.instances[instanceId] && // not explicitly excluded filteredDefs[instances[instanceId].defId] // def wasn't filtered away ) { filteredInstances[instanceId] = instances[instanceId]; } } return { defs: filteredDefs, instances: filteredInstances, }; } function normalizeConstraint(input, context) { if (Array.isArray(input)) { return parseEvents(input, null, context, true); // allowOpenRange=true } if (typeof input === 'object' && input) { // non-null object return parseEvents([input], null, context, true); // allowOpenRange=true } if (input != null) { return String(input); } return null; } function parseClassNames(raw) { if (Array.isArray(raw)) { return raw; } if (typeof raw === 'string') { return raw.split(/\s+/); } return []; } // TODO: better called "EventSettings" or "EventConfig" // TODO: move this file into structs // TODO: separate constraint/overlap/allow, because selection uses only that, not other props var EVENT_UI_REFINERS = { display: String, editable: Boolean, startEditable: Boolean, durationEditable: Boolean, constraint: identity, overlap: identity, allow: identity, className: parseClassNames, classNames: parseClassNames, color: String, backgroundColor: String, borderColor: String, textColor: String, }; var EMPTY_EVENT_UI = { display: null, startEditable: null, durationEditable: null, constraints: [], overlap: null, allows: [], backgroundColor: '', borderColor: '', textColor: '', classNames: [], }; function createEventUi(refined, context) { var constraint = normalizeConstraint(refined.constraint, context); return { display: refined.display || null, startEditable: refined.startEditable != null ? refined.startEditable : refined.editable, durationEditable: refined.durationEditable != null ? refined.durationEditable : refined.editable, constraints: constraint != null ? [constraint] : [], overlap: refined.overlap != null ? refined.overlap : null, allows: refined.allow != null ? [refined.allow] : [], backgroundColor: refined.backgroundColor || refined.color || '', borderColor: refined.borderColor || refined.color || '', textColor: refined.textColor || '', classNames: (refined.className || []).concat(refined.classNames || []), // join singular and plural }; } // TODO: prevent against problems with <2 args! function combineEventUis(uis) { return uis.reduce(combineTwoEventUis, EMPTY_EVENT_UI); } function combineTwoEventUis(item0, item1) { return { display: item1.display != null ? item1.display : item0.display, startEditable: item1.startEditable != null ? item1.startEditable : item0.startEditable, durationEditable: item1.durationEditable != null ? item1.durationEditable : item0.durationEditable, constraints: item0.constraints.concat(item1.constraints), overlap: typeof item1.overlap === 'boolean' ? item1.overlap : item0.overlap, allows: item0.allows.concat(item1.allows), backgroundColor: item1.backgroundColor || item0.backgroundColor, borderColor: item1.borderColor || item0.borderColor, textColor: item1.textColor || item0.textColor, classNames: item0.classNames.concat(item1.classNames), }; } var EVENT_NON_DATE_REFINERS = { id: String, groupId: String, title: String, url: String, interactive: Boolean, }; var EVENT_DATE_REFINERS = { start: identity, end: identity, date: identity, allDay: Boolean, }; var EVENT_REFINERS = (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, EVENT_NON_DATE_REFINERS), EVENT_DATE_REFINERS), { extendedProps: identity }); function parseEvent(raw, eventSource, context, allowOpenRange, refiners) { if (refiners === void 0) { refiners = buildEventRefiners(context); } var _a = refineEventDef(raw, context, refiners), refined = _a.refined, extra = _a.extra; var defaultAllDay = computeIsDefaultAllDay(eventSource, context); var recurringRes = parseRecurring(refined, defaultAllDay, context.dateEnv, context.pluginHooks.recurringTypes); if (recurringRes) { var def = parseEventDef(refined, extra, eventSource ? eventSource.sourceId : '', recurringRes.allDay, Boolean(recurringRes.duration), context); def.recurringDef = { typeId: recurringRes.typeId, typeData: recurringRes.typeData, duration: recurringRes.duration, }; return { def: def, instance: null }; } var singleRes = parseSingle(refined, defaultAllDay, context, allowOpenRange); if (singleRes) { var def = parseEventDef(refined, extra, eventSource ? eventSource.sourceId : '', singleRes.allDay, singleRes.hasEnd, context); var instance = createEventInstance(def.defId, singleRes.range, singleRes.forcedStartTzo, singleRes.forcedEndTzo); return { def: def, instance: instance }; } return null; } function refineEventDef(raw, context, refiners) { if (refiners === void 0) { refiners = buildEventRefiners(context); } return refineProps(raw, refiners); } function buildEventRefiners(context) { return (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, EVENT_UI_REFINERS), EVENT_REFINERS), context.pluginHooks.eventRefiners); } /* Will NOT populate extendedProps with the leftover properties. Will NOT populate date-related props. */ function parseEventDef(refined, extra, sourceId, allDay, hasEnd, context) { var def = { title: refined.title || '', groupId: refined.groupId || '', publicId: refined.id || '', url: refined.url || '', recurringDef: null, defId: guid(), sourceId: sourceId, allDay: allDay, hasEnd: hasEnd, interactive: refined.interactive, ui: createEventUi(refined, context), extendedProps: (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, (refined.extendedProps || {})), extra), }; for (var _i = 0, _a = context.pluginHooks.eventDefMemberAdders; _i < _a.length; _i++) { var memberAdder = _a[_i]; (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)(def, memberAdder(refined)); } // help out EventApi from having user modify props Object.freeze(def.ui.classNames); Object.freeze(def.extendedProps); return def; } function parseSingle(refined, defaultAllDay, context, allowOpenRange) { var allDay = refined.allDay; var startMeta; var startMarker = null; var hasEnd = false; var endMeta; var endMarker = null; var startInput = refined.start != null ? refined.start : refined.date; startMeta = context.dateEnv.createMarkerMeta(startInput); if (startMeta) { startMarker = startMeta.marker; } else if (!allowOpenRange) { return null; } if (refined.end != null) { endMeta = context.dateEnv.createMarkerMeta(refined.end); } if (allDay == null) { if (defaultAllDay != null) { allDay = defaultAllDay; } else { // fall back to the date props LAST allDay = (!startMeta || startMeta.isTimeUnspecified) && (!endMeta || endMeta.isTimeUnspecified); } } if (allDay && startMarker) { startMarker = startOfDay(startMarker); } if (endMeta) { endMarker = endMeta.marker; if (allDay) { endMarker = startOfDay(endMarker); } if (startMarker && endMarker <= startMarker) { endMarker = null; } } if (endMarker) { hasEnd = true; } else if (!allowOpenRange) { hasEnd = context.options.forceEventDuration || false; endMarker = context.dateEnv.add(startMarker, allDay ? context.options.defaultAllDayEventDuration : context.options.defaultTimedEventDuration); } return { allDay: allDay, hasEnd: hasEnd, range: { start: startMarker, end: endMarker }, forcedStartTzo: startMeta ? startMeta.forcedTzo : null, forcedEndTzo: endMeta ? endMeta.forcedTzo : null, }; } function computeIsDefaultAllDay(eventSource, context) { var res = null; if (eventSource) { res = eventSource.defaultAllDay; } if (res == null) { res = context.options.defaultAllDay; } return res; } /* Date stuff that doesn't belong in datelib core ----------------------------------------------------------------------------------------------------------------------*/ // given a timed range, computes an all-day range that has the same exact duration, // but whose start time is aligned with the start of the day. function computeAlignedDayRange(timedRange) { var dayCnt = Math.floor(diffDays(timedRange.start, timedRange.end)) || 1; var start = startOfDay(timedRange.start); var end = addDays(start, dayCnt); return { start: start, end: end }; } // given a timed range, computes an all-day range based on how for the end date bleeds into the next day // TODO: give nextDayThreshold a default arg function computeVisibleDayRange(timedRange, nextDayThreshold) { if (nextDayThreshold === void 0) { nextDayThreshold = createDuration(0); } var startDay = null; var endDay = null; if (timedRange.end) { endDay = startOfDay(timedRange.end); var endTimeMS = timedRange.end.valueOf() - endDay.valueOf(); // # of milliseconds into `endDay` // If the end time is actually inclusively part of the next day and is equal to or // beyond the next day threshold, adjust the end to be the exclusive end of `endDay`. // Otherwise, leaving it as inclusive will cause it to exclude `endDay`. if (endTimeMS && endTimeMS >= asRoughMs(nextDayThreshold)) { endDay = addDays(endDay, 1); } } if (timedRange.start) { startDay = startOfDay(timedRange.start); // the beginning of the day the range starts // If end is within `startDay` but not past nextDayThreshold, assign the default duration of one day. if (endDay && endDay <= startDay) { endDay = addDays(startDay, 1); } } return { start: startDay, end: endDay }; } // spans from one day into another? function isMultiDayRange(range) { var visibleRange = computeVisibleDayRange(range); return diffDays(visibleRange.start, visibleRange.end) > 1; } function diffDates(date0, date1, dateEnv, largeUnit) { if (largeUnit === 'year') { return createDuration(dateEnv.diffWholeYears(date0, date1), 'year'); } if (largeUnit === 'month') { return createDuration(dateEnv.diffWholeMonths(date0, date1), 'month'); } return diffDayAndTime(date0, date1); // returns a duration } function parseRange(input, dateEnv) { var start = null; var end = null; if (input.start) { start = dateEnv.createMarker(input.start); } if (input.end) { end = dateEnv.createMarker(input.end); } if (!start && !end) { return null; } if (start && end && end < start) { return null; } return { start: start, end: end }; } // SIDE-EFFECT: will mutate ranges. // Will return a new array result. function invertRanges(ranges, constraintRange) { var invertedRanges = []; var start = constraintRange.start; // the end of the previous range. the start of the new range var i; var dateRange; // ranges need to be in order. required for our date-walking algorithm ranges.sort(compareRanges); for (i = 0; i < ranges.length; i += 1) { dateRange = ranges[i]; // add the span of time before the event (if there is any) if (dateRange.start > start) { // compare millisecond time (skip any ambig logic) invertedRanges.push({ start: start, end: dateRange.start }); } if (dateRange.end > start) { start = dateRange.end; } } // add the span of time after the last event (if there is any) if (start < constraintRange.end) { // compare millisecond time (skip any ambig logic) invertedRanges.push({ start: start, end: constraintRange.end }); } return invertedRanges; } function compareRanges(range0, range1) { return range0.start.valueOf() - range1.start.valueOf(); // earlier ranges go first } function intersectRanges(range0, range1) { var start = range0.start, end = range0.end; var newRange = null; if (range1.start !== null) { if (start === null) { start = range1.start; } else { start = new Date(Math.max(start.valueOf(), range1.start.valueOf())); } } if (range1.end != null) { if (end === null) { end = range1.end; } else { end = new Date(Math.min(end.valueOf(), range1.end.valueOf())); } } if (start === null || end === null || start < end) { newRange = { start: start, end: end }; } return newRange; } function rangesEqual(range0, range1) { return (range0.start === null ? null : range0.start.valueOf()) === (range1.start === null ? null : range1.start.valueOf()) && (range0.end === null ? null : range0.end.valueOf()) === (range1.end === null ? null : range1.end.valueOf()); } function rangesIntersect(range0, range1) { return (range0.end === null || range1.start === null || range0.end > range1.start) && (range0.start === null || range1.end === null || range0.start < range1.end); } function rangeContainsRange(outerRange, innerRange) { return (outerRange.start === null || (innerRange.start !== null && innerRange.start >= outerRange.start)) && (outerRange.end === null || (innerRange.end !== null && innerRange.end <= outerRange.end)); } function rangeContainsMarker(range, date) { return (range.start === null || date >= range.start) && (range.end === null || date < range.end); } // If the given date is not within the given range, move it inside. // (If it's past the end, make it one millisecond before the end). function constrainMarkerToRange(date, range) { if (range.start != null && date < range.start) { return range.start; } if (range.end != null && date >= range.end) { return new Date(range.end.valueOf() - 1); } return date; } /* Specifying nextDayThreshold signals that all-day ranges should be sliced. */ function sliceEventStore(eventStore, eventUiBases, framingRange, nextDayThreshold) { var inverseBgByGroupId = {}; var inverseBgByDefId = {}; var defByGroupId = {}; var bgRanges = []; var fgRanges = []; var eventUis = compileEventUis(eventStore.defs, eventUiBases); for (var defId in eventStore.defs) { var def = eventStore.defs[defId]; var ui = eventUis[def.defId]; if (ui.display === 'inverse-background') { if (def.groupId) { inverseBgByGroupId[def.groupId] = []; if (!defByGroupId[def.groupId]) { defByGroupId[def.groupId] = def; } } else { inverseBgByDefId[defId] = []; } } } for (var instanceId in eventStore.instances) { var instance = eventStore.instances[instanceId]; var def = eventStore.defs[instance.defId]; var ui = eventUis[def.defId]; var origRange = instance.range; var normalRange = (!def.allDay && nextDayThreshold) ? computeVisibleDayRange(origRange, nextDayThreshold) : origRange; var slicedRange = intersectRanges(normalRange, framingRange); if (slicedRange) { if (ui.display === 'inverse-background') { if (def.groupId) { inverseBgByGroupId[def.groupId].push(slicedRange); } else { inverseBgByDefId[instance.defId].push(slicedRange); } } else if (ui.display !== 'none') { (ui.display === 'background' ? bgRanges : fgRanges).push({ def: def, ui: ui, instance: instance, range: slicedRange, isStart: normalRange.start && normalRange.start.valueOf() === slicedRange.start.valueOf(), isEnd: normalRange.end && normalRange.end.valueOf() === slicedRange.end.valueOf(), }); } } } for (var groupId in inverseBgByGroupId) { // BY GROUP var ranges = inverseBgByGroupId[groupId]; var invertedRanges = invertRanges(ranges, framingRange); for (var _i = 0, invertedRanges_1 = invertedRanges; _i < invertedRanges_1.length; _i++) { var invertedRange = invertedRanges_1[_i]; var def = defByGroupId[groupId]; var ui = eventUis[def.defId]; bgRanges.push({ def: def, ui: ui, instance: null, range: invertedRange, isStart: false, isEnd: false, }); } } for (var defId in inverseBgByDefId) { var ranges = inverseBgByDefId[defId]; var invertedRanges = invertRanges(ranges, framingRange); for (var _a = 0, invertedRanges_2 = invertedRanges; _a < invertedRanges_2.length; _a++) { var invertedRange = invertedRanges_2[_a]; bgRanges.push({ def: eventStore.defs[defId], ui: eventUis[defId], instance: null, range: invertedRange, isStart: false, isEnd: false, }); } } return { bg: bgRanges, fg: fgRanges }; } function hasBgRendering(def) { return def.ui.display === 'background' || def.ui.display === 'inverse-background'; } function setElSeg(el, seg) { el.fcSeg = seg; } function getElSeg(el) { return el.fcSeg || el.parentNode.fcSeg || // for the harness null; } // event ui computation function compileEventUis(eventDefs, eventUiBases) { return mapHash(eventDefs, function (eventDef) { return compileEventUi(eventDef, eventUiBases); }); } function compileEventUi(eventDef, eventUiBases) { var uis = []; if (eventUiBases['']) { uis.push(eventUiBases['']); } if (eventUiBases[eventDef.defId]) { uis.push(eventUiBases[eventDef.defId]); } uis.push(eventDef.ui); return combineEventUis(uis); } function sortEventSegs(segs, eventOrderSpecs) { var objs = segs.map(buildSegCompareObj); objs.sort(function (obj0, obj1) { return compareByFieldSpecs(obj0, obj1, eventOrderSpecs); }); return objs.map(function (c) { return c._seg; }); } // returns a object with all primitive props that can be compared function buildSegCompareObj(seg) { var eventRange = seg.eventRange; var eventDef = eventRange.def; var range = eventRange.instance ? eventRange.instance.range : eventRange.range; var start = range.start ? range.start.valueOf() : 0; // TODO: better support for open-range events var end = range.end ? range.end.valueOf() : 0; // " return (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, eventDef.extendedProps), eventDef), { id: eventDef.publicId, start: start, end: end, duration: end - start, allDay: Number(eventDef.allDay), _seg: seg }); } function computeSegDraggable(seg, context) { var pluginHooks = context.pluginHooks; var transformers = pluginHooks.isDraggableTransformers; var _a = seg.eventRange, def = _a.def, ui = _a.ui; var val = ui.startEditable; for (var _i = 0, transformers_1 = transformers; _i < transformers_1.length; _i++) { var transformer = transformers_1[_i]; val = transformer(val, def, ui, context); } return val; } function computeSegStartResizable(seg, context) { return seg.isStart && seg.eventRange.ui.durationEditable && context.options.eventResizableFromStart; } function computeSegEndResizable(seg, context) { return seg.isEnd && seg.eventRange.ui.durationEditable; } function buildSegTimeText(seg, timeFormat, context, defaultDisplayEventTime, // defaults to true defaultDisplayEventEnd, // defaults to true startOverride, endOverride) { var dateEnv = context.dateEnv, options = context.options; var displayEventTime = options.displayEventTime, displayEventEnd = options.displayEventEnd; var eventDef = seg.eventRange.def; var eventInstance = seg.eventRange.instance; if (displayEventTime == null) { displayEventTime = defaultDisplayEventTime !== false; } if (displayEventEnd == null) { displayEventEnd = defaultDisplayEventEnd !== false; } var wholeEventStart = eventInstance.range.start; var wholeEventEnd = eventInstance.range.end; var segStart = startOverride || seg.start || seg.eventRange.range.start; var segEnd = endOverride || seg.end || seg.eventRange.range.end; var isStartDay = startOfDay(wholeEventStart).valueOf() === startOfDay(segStart).valueOf(); var isEndDay = startOfDay(addMs(wholeEventEnd, -1)).valueOf() === startOfDay(addMs(segEnd, -1)).valueOf(); if (displayEventTime && !eventDef.allDay && (isStartDay || isEndDay)) { segStart = isStartDay ? wholeEventStart : segStart; segEnd = isEndDay ? wholeEventEnd : segEnd; if (displayEventEnd && eventDef.hasEnd) { return dateEnv.formatRange(segStart, segEnd, timeFormat, { forcedStartTzo: startOverride ? null : eventInstance.forcedStartTzo, forcedEndTzo: endOverride ? null : eventInstance.forcedEndTzo, }); } return dateEnv.format(segStart, timeFormat, { forcedTzo: startOverride ? null : eventInstance.forcedStartTzo, // nooooo, same }); } return ''; } function getSegMeta(seg, todayRange, nowDate) { var segRange = seg.eventRange.range; return { isPast: segRange.end < (nowDate || todayRange.start), isFuture: segRange.start >= (nowDate || todayRange.end), isToday: todayRange && rangeContainsMarker(todayRange, segRange.start), }; } function getEventClassNames(props) { var classNames = ['fc-event']; if (props.isMirror) { classNames.push('fc-event-mirror'); } if (props.isDraggable) { classNames.push('fc-event-draggable'); } if (props.isStartResizable || props.isEndResizable) { classNames.push('fc-event-resizable'); } if (props.isDragging) { classNames.push('fc-event-dragging'); } if (props.isResizing) { classNames.push('fc-event-resizing'); } if (props.isSelected) { classNames.push('fc-event-selected'); } if (props.isStart) { classNames.push('fc-event-start'); } if (props.isEnd) { classNames.push('fc-event-end'); } if (props.isPast) { classNames.push('fc-event-past'); } if (props.isToday) { classNames.push('fc-event-today'); } if (props.isFuture) { classNames.push('fc-event-future'); } return classNames; } function buildEventRangeKey(eventRange) { return eventRange.instance ? eventRange.instance.instanceId : eventRange.def.defId + ":" + eventRange.range.start.toISOString(); // inverse-background events don't have specific instances. TODO: better solution } function getSegAnchorAttrs(seg, context) { var _a = seg.eventRange, def = _a.def, instance = _a.instance; var url = def.url; if (url) { return { href: url }; } var emitter = context.emitter, options = context.options; var eventInteractive = options.eventInteractive; if (eventInteractive == null) { eventInteractive = def.interactive; if (eventInteractive == null) { eventInteractive = Boolean(emitter.hasHandlers('eventClick')); } } // mock what happens in EventClicking if (eventInteractive) { // only attach keyboard-related handlers because click handler is already done in EventClicking return createAriaKeyboardAttrs(function (ev) { emitter.trigger('eventClick', { el: ev.target, event: new EventApi(context, def, instance), jsEvent: ev, view: context.viewApi, }); }); } return {}; } var STANDARD_PROPS = { start: identity, end: identity, allDay: Boolean, }; function parseDateSpan(raw, dateEnv, defaultDuration) { var span = parseOpenDateSpan(raw, dateEnv); var range = span.range; if (!range.start) { return null; } if (!range.end) { if (defaultDuration == null) { return null; } range.end = dateEnv.add(range.start, defaultDuration); } return span; } /* TODO: somehow combine with parseRange? Will return null if the start/end props were present but parsed invalidly. */ function parseOpenDateSpan(raw, dateEnv) { var _a = refineProps(raw, STANDARD_PROPS), standardProps = _a.refined, extra = _a.extra; var startMeta = standardProps.start ? dateEnv.createMarkerMeta(standardProps.start) : null; var endMeta = standardProps.end ? dateEnv.createMarkerMeta(standardProps.end) : null; var allDay = standardProps.allDay; if (allDay == null) { allDay = (startMeta && startMeta.isTimeUnspecified) && (!endMeta || endMeta.isTimeUnspecified); } return (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({ range: { start: startMeta ? startMeta.marker : null, end: endMeta ? endMeta.marker : null, }, allDay: allDay }, extra); } function isDateSpansEqual(span0, span1) { return rangesEqual(span0.range, span1.range) && span0.allDay === span1.allDay && isSpanPropsEqual(span0, span1); } // the NON-DATE-RELATED props function isSpanPropsEqual(span0, span1) { for (var propName in span1) { if (propName !== 'range' && propName !== 'allDay') { if (span0[propName] !== span1[propName]) { return false; } } } // are there any props that span0 has that span1 DOESN'T have? // both have range/allDay, so no need to special-case. for (var propName in span0) { if (!(propName in span1)) { return false; } } return true; } function buildDateSpanApi(span, dateEnv) { return (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, buildRangeApi(span.range, dateEnv, span.allDay)), { allDay: span.allDay }); } function buildRangeApiWithTimeZone(range, dateEnv, omitTime) { return (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, buildRangeApi(range, dateEnv, omitTime)), { timeZone: dateEnv.timeZone }); } function buildRangeApi(range, dateEnv, omitTime) { return { start: dateEnv.toDate(range.start), end: dateEnv.toDate(range.end), startStr: dateEnv.formatIso(range.start, { omitTime: omitTime }), endStr: dateEnv.formatIso(range.end, { omitTime: omitTime }), }; } function fabricateEventRange(dateSpan, eventUiBases, context) { var res = refineEventDef({ editable: false }, context); var def = parseEventDef(res.refined, res.extra, '', // sourceId dateSpan.allDay, true, // hasEnd context); return { def: def, ui: compileEventUi(def, eventUiBases), instance: createEventInstance(def.defId, dateSpan.range), range: dateSpan.range, isStart: true, isEnd: true, }; } function triggerDateSelect(selection, pev, context) { context.emitter.trigger('select', (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, buildDateSpanApiWithContext(selection, context)), { jsEvent: pev ? pev.origEvent : null, view: context.viewApi || context.calendarApi.view })); } function triggerDateUnselect(pev, context) { context.emitter.trigger('unselect', { jsEvent: pev ? pev.origEvent : null, view: context.viewApi || context.calendarApi.view, }); } function buildDateSpanApiWithContext(dateSpan, context) { var props = {}; for (var _i = 0, _a = context.pluginHooks.dateSpanTransforms; _i < _a.length; _i++) { var transform = _a[_i]; (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)(props, transform(dateSpan, context)); } (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)(props, buildDateSpanApi(dateSpan, context.dateEnv)); return props; } // Given an event's allDay status and start date, return what its fallback end date should be. // TODO: rename to computeDefaultEventEnd function getDefaultEventEnd(allDay, marker, context) { var dateEnv = context.dateEnv, options = context.options; var end = marker; if (allDay) { end = startOfDay(end); end = dateEnv.add(end, options.defaultAllDayEventDuration); } else { end = dateEnv.add(end, options.defaultTimedEventDuration); } return end; } // applies the mutation to ALL defs/instances within the event store function applyMutationToEventStore(eventStore, eventConfigBase, mutation, context) { var eventConfigs = compileEventUis(eventStore.defs, eventConfigBase); var dest = createEmptyEventStore(); for (var defId in eventStore.defs) { var def = eventStore.defs[defId]; dest.defs[defId] = applyMutationToEventDef(def, eventConfigs[defId], mutation, context); } for (var instanceId in eventStore.instances) { var instance = eventStore.instances[instanceId]; var def = dest.defs[instance.defId]; // important to grab the newly modified def dest.instances[instanceId] = applyMutationToEventInstance(instance, def, eventConfigs[instance.defId], mutation, context); } return dest; } function applyMutationToEventDef(eventDef, eventConfig, mutation, context) { var standardProps = mutation.standardProps || {}; // if hasEnd has not been specified, guess a good value based on deltas. // if duration will change, there's no way the default duration will persist, // and thus, we need to mark the event as having a real end if (standardProps.hasEnd == null && eventConfig.durationEditable && (mutation.startDelta || mutation.endDelta)) { standardProps.hasEnd = true; // TODO: is this mutation okay? } var copy = (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, eventDef), standardProps), { ui: (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, eventDef.ui), standardProps.ui) }); if (mutation.extendedProps) { copy.extendedProps = (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, copy.extendedProps), mutation.extendedProps); } for (var _i = 0, _a = context.pluginHooks.eventDefMutationAppliers; _i < _a.length; _i++) { var applier = _a[_i]; applier(copy, mutation, context); } if (!copy.hasEnd && context.options.forceEventDuration) { copy.hasEnd = true; } return copy; } function applyMutationToEventInstance(eventInstance, eventDef, // must first be modified by applyMutationToEventDef eventConfig, mutation, context) { var dateEnv = context.dateEnv; var forceAllDay = mutation.standardProps && mutation.standardProps.allDay === true; var clearEnd = mutation.standardProps && mutation.standardProps.hasEnd === false; var copy = (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, eventInstance); if (forceAllDay) { copy.range = computeAlignedDayRange(copy.range); } if (mutation.datesDelta && eventConfig.startEditable) { copy.range = { start: dateEnv.add(copy.range.start, mutation.datesDelta), end: dateEnv.add(copy.range.end, mutation.datesDelta), }; } if (mutation.startDelta && eventConfig.durationEditable) { copy.range = { start: dateEnv.add(copy.range.start, mutation.startDelta), end: copy.range.end, }; } if (mutation.endDelta && eventConfig.durationEditable) { copy.range = { start: copy.range.start, end: dateEnv.add(copy.range.end, mutation.endDelta), }; } if (clearEnd) { copy.range = { start: copy.range.start, end: getDefaultEventEnd(eventDef.allDay, copy.range.start, context), }; } // in case event was all-day but the supplied deltas were not // better util for this? if (eventDef.allDay) { copy.range = { start: startOfDay(copy.range.start), end: startOfDay(copy.range.end), }; } // handle invalid durations if (copy.range.end < copy.range.start) { copy.range.end = getDefaultEventEnd(eventDef.allDay, copy.range.start, context); } return copy; } // no public types yet. when there are, export from: // import {} from './api-type-deps' var ViewApi = /** @class */ (function () { function ViewApi(type, getCurrentData, dateEnv) { this.type = type; this.getCurrentData = getCurrentData; this.dateEnv = dateEnv; } Object.defineProperty(ViewApi.prototype, "calendar", { get: function () { return this.getCurrentData().calendarApi; }, enumerable: false, configurable: true }); Object.defineProperty(ViewApi.prototype, "title", { get: function () { return this.getCurrentData().viewTitle; }, enumerable: false, configurable: true }); Object.defineProperty(ViewApi.prototype, "activeStart", { get: function () { return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.start); }, enumerable: false, configurable: true }); Object.defineProperty(ViewApi.prototype, "activeEnd", { get: function () { return this.dateEnv.toDate(this.getCurrentData().dateProfile.activeRange.end); }, enumerable: false, configurable: true }); Object.defineProperty(ViewApi.prototype, "currentStart", { get: function () { return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.start); }, enumerable: false, configurable: true }); Object.defineProperty(ViewApi.prototype, "currentEnd", { get: function () { return this.dateEnv.toDate(this.getCurrentData().dateProfile.currentRange.end); }, enumerable: false, configurable: true }); ViewApi.prototype.getOption = function (name) { return this.getCurrentData().options[name]; // are the view-specific options }; return ViewApi; }()); var EVENT_SOURCE_REFINERS = { id: String, defaultAllDay: Boolean, url: String, format: String, events: identity, eventDataTransform: identity, // for any network-related sources success: identity, failure: identity, }; function parseEventSource(raw, context, refiners) { if (refiners === void 0) { refiners = buildEventSourceRefiners(context); } var rawObj; if (typeof raw === 'string') { rawObj = { url: raw }; } else if (typeof raw === 'function' || Array.isArray(raw)) { rawObj = { events: raw }; } else if (typeof raw === 'object' && raw) { // not null rawObj = raw; } if (rawObj) { var _a = refineProps(rawObj, refiners), refined = _a.refined, extra = _a.extra; var metaRes = buildEventSourceMeta(refined, context); if (metaRes) { return { _raw: raw, isFetching: false, latestFetchId: '', fetchRange: null, defaultAllDay: refined.defaultAllDay, eventDataTransform: refined.eventDataTransform, success: refined.success, failure: refined.failure, publicId: refined.id || '', sourceId: guid(), sourceDefId: metaRes.sourceDefId, meta: metaRes.meta, ui: createEventUi(refined, context), extendedProps: extra, }; } } return null; } function buildEventSourceRefiners(context) { return (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, EVENT_UI_REFINERS), EVENT_SOURCE_REFINERS), context.pluginHooks.eventSourceRefiners); } function buildEventSourceMeta(raw, context) { var defs = context.pluginHooks.eventSourceDefs; for (var i = defs.length - 1; i >= 0; i -= 1) { // later-added plugins take precedence var def = defs[i]; var meta = def.parseMeta(raw); if (meta) { return { sourceDefId: i, meta: meta }; } } return null; } function reduceCurrentDate(currentDate, action) { switch (action.type) { case 'CHANGE_DATE': return action.dateMarker; default: return currentDate; } } function getInitialDate(options, dateEnv) { var initialDateInput = options.initialDate; // compute the initial ambig-timezone date if (initialDateInput != null) { return dateEnv.createMarker(initialDateInput); } return getNow(options.now, dateEnv); // getNow already returns unzoned } function getNow(nowInput, dateEnv) { if (typeof nowInput === 'function') { nowInput = nowInput(); } if (nowInput == null) { return dateEnv.createNowMarker(); } return dateEnv.createMarker(nowInput); } var CalendarApi = /** @class */ (function () { function CalendarApi() { } CalendarApi.prototype.getCurrentData = function () { return this.currentDataManager.getCurrentData(); }; CalendarApi.prototype.dispatch = function (action) { return this.currentDataManager.dispatch(action); }; Object.defineProperty(CalendarApi.prototype, "view", { get: function () { return this.getCurrentData().viewApi; } // for public API , enumerable: false, configurable: true }); CalendarApi.prototype.batchRendering = function (callback) { callback(); }; CalendarApi.prototype.updateSize = function () { this.trigger('_resize', true); }; // Options // ----------------------------------------------------------------------------------------------------------------- CalendarApi.prototype.setOption = function (name, val) { this.dispatch({ type: 'SET_OPTION', optionName: name, rawOptionValue: val, }); }; CalendarApi.prototype.getOption = function (name) { return this.currentDataManager.currentCalendarOptionsInput[name]; }; CalendarApi.prototype.getAvailableLocaleCodes = function () { return Object.keys(this.getCurrentData().availableRawLocales); }; // Trigger // ----------------------------------------------------------------------------------------------------------------- CalendarApi.prototype.on = function (handlerName, handler) { var currentDataManager = this.currentDataManager; if (currentDataManager.currentCalendarOptionsRefiners[handlerName]) { currentDataManager.emitter.on(handlerName, handler); } else { console.warn("Unknown listener name '" + handlerName + "'"); } }; CalendarApi.prototype.off = function (handlerName, handler) { this.currentDataManager.emitter.off(handlerName, handler); }; // not meant for public use CalendarApi.prototype.trigger = function (handlerName) { var _a; var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; } (_a = this.currentDataManager.emitter).trigger.apply(_a, (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__spreadArray)([handlerName], args)); }; // View // ----------------------------------------------------------------------------------------------------------------- CalendarApi.prototype.changeView = function (viewType, dateOrRange) { var _this = this; this.batchRendering(function () { _this.unselect(); if (dateOrRange) { if (dateOrRange.start && dateOrRange.end) { // a range _this.dispatch({ type: 'CHANGE_VIEW_TYPE', viewType: viewType, }); _this.dispatch({ type: 'SET_OPTION', optionName: 'visibleRange', rawOptionValue: dateOrRange, }); } else { var dateEnv = _this.getCurrentData().dateEnv; _this.dispatch({ type: 'CHANGE_VIEW_TYPE', viewType: viewType, dateMarker: dateEnv.createMarker(dateOrRange), }); } } else { _this.dispatch({ type: 'CHANGE_VIEW_TYPE', viewType: viewType, }); } }); }; // Forces navigation to a view for the given date. // `viewType` can be a specific view name or a generic one like "week" or "day". // needs to change CalendarApi.prototype.zoomTo = function (dateMarker, viewType) { var state = this.getCurrentData(); var spec; viewType = viewType || 'day'; // day is default zoom spec = state.viewSpecs[viewType] || this.getUnitViewSpec(viewType); this.unselect(); if (spec) { this.dispatch({ type: 'CHANGE_VIEW_TYPE', viewType: spec.type, dateMarker: dateMarker, }); } else { this.dispatch({ type: 'CHANGE_DATE', dateMarker: dateMarker, }); } }; // Given a duration singular unit, like "week" or "day", finds a matching view spec. // Preference is given to views that have corresponding buttons. CalendarApi.prototype.getUnitViewSpec = function (unit) { var _a = this.getCurrentData(), viewSpecs = _a.viewSpecs, toolbarConfig = _a.toolbarConfig; var viewTypes = [].concat(toolbarConfig.header ? toolbarConfig.header.viewsWithButtons : [], toolbarConfig.footer ? toolbarConfig.footer.viewsWithButtons : []); var i; var spec; for (var viewType in viewSpecs) { viewTypes.push(viewType); } for (i = 0; i < viewTypes.length; i += 1) { spec = viewSpecs[viewTypes[i]]; if (spec) { if (spec.singleUnit === unit) { return spec; } } } return null; }; // Current Date // ----------------------------------------------------------------------------------------------------------------- CalendarApi.prototype.prev = function () { this.unselect(); this.dispatch({ type: 'PREV' }); }; CalendarApi.prototype.next = function () { this.unselect(); this.dispatch({ type: 'NEXT' }); }; CalendarApi.prototype.prevYear = function () { var state = this.getCurrentData(); this.unselect(); this.dispatch({ type: 'CHANGE_DATE', dateMarker: state.dateEnv.addYears(state.currentDate, -1), }); }; CalendarApi.prototype.nextYear = function () { var state = this.getCurrentData(); this.unselect(); this.dispatch({ type: 'CHANGE_DATE', dateMarker: state.dateEnv.addYears(state.currentDate, 1), }); }; CalendarApi.prototype.today = function () { var state = this.getCurrentData(); this.unselect(); this.dispatch({ type: 'CHANGE_DATE', dateMarker: getNow(state.calendarOptions.now, state.dateEnv), }); }; CalendarApi.prototype.gotoDate = function (zonedDateInput) { var state = this.getCurrentData(); this.unselect(); this.dispatch({ type: 'CHANGE_DATE', dateMarker: state.dateEnv.createMarker(zonedDateInput), }); }; CalendarApi.prototype.incrementDate = function (deltaInput) { var state = this.getCurrentData(); var delta = createDuration(deltaInput); if (delta) { // else, warn about invalid input? this.unselect(); this.dispatch({ type: 'CHANGE_DATE', dateMarker: state.dateEnv.add(state.currentDate, delta), }); } }; // for external API CalendarApi.prototype.getDate = function () { var state = this.getCurrentData(); return state.dateEnv.toDate(state.currentDate); }; // Date Formatting Utils // ----------------------------------------------------------------------------------------------------------------- CalendarApi.prototype.formatDate = function (d, formatter) { var dateEnv = this.getCurrentData().dateEnv; return dateEnv.format(dateEnv.createMarker(d), createFormatter(formatter)); }; // `settings` is for formatter AND isEndExclusive CalendarApi.prototype.formatRange = function (d0, d1, settings) { var dateEnv = this.getCurrentData().dateEnv; return dateEnv.formatRange(dateEnv.createMarker(d0), dateEnv.createMarker(d1), createFormatter(settings), settings); }; CalendarApi.prototype.formatIso = function (d, omitTime) { var dateEnv = this.getCurrentData().dateEnv; return dateEnv.formatIso(dateEnv.createMarker(d), { omitTime: omitTime }); }; // Date Selection / Event Selection / DayClick // ----------------------------------------------------------------------------------------------------------------- // this public method receives start/end dates in any format, with any timezone // NOTE: args were changed from v3 CalendarApi.prototype.select = function (dateOrObj, endDate) { var selectionInput; if (endDate == null) { if (dateOrObj.start != null) { selectionInput = dateOrObj; } else { selectionInput = { start: dateOrObj, end: null, }; } } else { selectionInput = { start: dateOrObj, end: endDate, }; } var state = this.getCurrentData(); var selection = parseDateSpan(selectionInput, state.dateEnv, createDuration({ days: 1 })); if (selection) { // throw parse error otherwise? this.dispatch({ type: 'SELECT_DATES', selection: selection }); triggerDateSelect(selection, null, state); } }; // public method CalendarApi.prototype.unselect = function (pev) { var state = this.getCurrentData(); if (state.dateSelection) { this.dispatch({ type: 'UNSELECT_DATES' }); triggerDateUnselect(pev, state); } }; // Public Events API // ----------------------------------------------------------------------------------------------------------------- CalendarApi.prototype.addEvent = function (eventInput, sourceInput) { if (eventInput instanceof EventApi) { var def = eventInput._def; var instance = eventInput._instance; var currentData = this.getCurrentData(); // not already present? don't want to add an old snapshot if (!currentData.eventStore.defs[def.defId]) { this.dispatch({ type: 'ADD_EVENTS', eventStore: eventTupleToStore({ def: def, instance: instance }), // TODO: better util for two args? }); this.triggerEventAdd(eventInput); } return eventInput; } var state = this.getCurrentData(); var eventSource; if (sourceInput instanceof EventSourceApi) { eventSource = sourceInput.internalEventSource; } else if (typeof sourceInput === 'boolean') { if (sourceInput) { // true. part of the first event source eventSource = hashValuesToArray(state.eventSources)[0]; } } else if (sourceInput != null) { // an ID. accepts a number too var sourceApi = this.getEventSourceById(sourceInput); // TODO: use an internal function if (!sourceApi) { console.warn("Could not find an event source with ID \"" + sourceInput + "\""); // TODO: test return null; } eventSource = sourceApi.internalEventSource; } var tuple = parseEvent(eventInput, eventSource, state, false); if (tuple) { var newEventApi = new EventApi(state, tuple.def, tuple.def.recurringDef ? null : tuple.instance); this.dispatch({ type: 'ADD_EVENTS', eventStore: eventTupleToStore(tuple), }); this.triggerEventAdd(newEventApi); return newEventApi; } return null; }; CalendarApi.prototype.triggerEventAdd = function (eventApi) { var _this = this; var emitter = this.getCurrentData().emitter; emitter.trigger('eventAdd', { event: eventApi, relatedEvents: [], revert: function () { _this.dispatch({ type: 'REMOVE_EVENTS', eventStore: eventApiToStore(eventApi), }); }, }); }; // TODO: optimize CalendarApi.prototype.getEventById = function (id) { var state = this.getCurrentData(); var _a = state.eventStore, defs = _a.defs, instances = _a.instances; id = String(id); for (var defId in defs) { var def = defs[defId]; if (def.publicId === id) { if (def.recurringDef) { return new EventApi(state, def, null); } for (var instanceId in instances) { var instance = instances[instanceId]; if (instance.defId === def.defId) { return new EventApi(state, def, instance); } } } } return null; }; CalendarApi.prototype.getEvents = function () { var currentData = this.getCurrentData(); return buildEventApis(currentData.eventStore, currentData); }; CalendarApi.prototype.removeAllEvents = function () { this.dispatch({ type: 'REMOVE_ALL_EVENTS' }); }; // Public Event Sources API // ----------------------------------------------------------------------------------------------------------------- CalendarApi.prototype.getEventSources = function () { var state = this.getCurrentData(); var sourceHash = state.eventSources; var sourceApis = []; for (var internalId in sourceHash) { sourceApis.push(new EventSourceApi(state, sourceHash[internalId])); } return sourceApis; }; CalendarApi.prototype.getEventSourceById = function (id) { var state = this.getCurrentData(); var sourceHash = state.eventSources; id = String(id); for (var sourceId in sourceHash) { if (sourceHash[sourceId].publicId === id) { return new EventSourceApi(state, sourceHash[sourceId]); } } return null; }; CalendarApi.prototype.addEventSource = function (sourceInput) { var state = this.getCurrentData(); if (sourceInput instanceof EventSourceApi) { // not already present? don't want to add an old snapshot if (!state.eventSources[sourceInput.internalEventSource.sourceId]) { this.dispatch({ type: 'ADD_EVENT_SOURCES', sources: [sourceInput.internalEventSource], }); } return sourceInput; } var eventSource = parseEventSource(sourceInput, state); if (eventSource) { // TODO: error otherwise? this.dispatch({ type: 'ADD_EVENT_SOURCES', sources: [eventSource] }); return new EventSourceApi(state, eventSource); } return null; }; CalendarApi.prototype.removeAllEventSources = function () { this.dispatch({ type: 'REMOVE_ALL_EVENT_SOURCES' }); }; CalendarApi.prototype.refetchEvents = function () { this.dispatch({ type: 'FETCH_EVENT_SOURCES', isRefetch: true }); }; // Scroll // ----------------------------------------------------------------------------------------------------------------- CalendarApi.prototype.scrollToTime = function (timeInput) { var time = createDuration(timeInput); if (time) { this.trigger('_scrollRequest', { time: time }); } }; return CalendarApi; }()); var EventApi = /** @class */ (function () { // instance will be null if expressing a recurring event that has no current instances, // OR if trying to validate an incoming external event that has no dates assigned function EventApi(context, def, instance) { this._context = context; this._def = def; this._instance = instance || null; } /* TODO: make event struct more responsible for this */ EventApi.prototype.setProp = function (name, val) { var _a, _b; if (name in EVENT_DATE_REFINERS) { console.warn('Could not set date-related prop \'name\'. Use one of the date-related methods instead.'); // TODO: make proper aliasing system? } else if (name === 'id') { val = EVENT_NON_DATE_REFINERS[name](val); this.mutate({ standardProps: { publicId: val }, // hardcoded internal name }); } else if (name in EVENT_NON_DATE_REFINERS) { val = EVENT_NON_DATE_REFINERS[name](val); this.mutate({ standardProps: (_a = {}, _a[name] = val, _a), }); } else if (name in EVENT_UI_REFINERS) { var ui = EVENT_UI_REFINERS[name](val); if (name === 'color') { ui = { backgroundColor: val, borderColor: val }; } else if (name === 'editable') { ui = { startEditable: val, durationEditable: val }; } else { ui = (_b = {}, _b[name] = val, _b); } this.mutate({ standardProps: { ui: ui }, }); } else { console.warn("Could not set prop '" + name + "'. Use setExtendedProp instead."); } }; EventApi.prototype.setExtendedProp = function (name, val) { var _a; this.mutate({ extendedProps: (_a = {}, _a[name] = val, _a), }); }; EventApi.prototype.setStart = function (startInput, options) { if (options === void 0) { options = {}; } var dateEnv = this._context.dateEnv; var start = dateEnv.createMarker(startInput); if (start && this._instance) { // TODO: warning if parsed bad var instanceRange = this._instance.range; var startDelta = diffDates(instanceRange.start, start, dateEnv, options.granularity); // what if parsed bad!? if (options.maintainDuration) { this.mutate({ datesDelta: startDelta }); } else { this.mutate({ startDelta: startDelta }); } } }; EventApi.prototype.setEnd = function (endInput, options) { if (options === void 0) { options = {}; } var dateEnv = this._context.dateEnv; var end; if (endInput != null) { end = dateEnv.createMarker(endInput); if (!end) { return; // TODO: warning if parsed bad } } if (this._instance) { if (end) { var endDelta = diffDates(this._instance.range.end, end, dateEnv, options.granularity); this.mutate({ endDelta: endDelta }); } else { this.mutate({ standardProps: { hasEnd: false } }); } } }; EventApi.prototype.setDates = function (startInput, endInput, options) { if (options === void 0) { options = {}; } var dateEnv = this._context.dateEnv; var standardProps = { allDay: options.allDay }; var start = dateEnv.createMarker(startInput); var end; if (!start) { return; // TODO: warning if parsed bad } if (endInput != null) { end = dateEnv.createMarker(endInput); if (!end) { // TODO: warning if parsed bad return; } } if (this._instance) { var instanceRange = this._instance.range; // when computing the diff for an event being converted to all-day, // compute diff off of the all-day values the way event-mutation does. if (options.allDay === true) { instanceRange = computeAlignedDayRange(instanceRange); } var startDelta = diffDates(instanceRange.start, start, dateEnv, options.granularity); if (end) { var endDelta = diffDates(instanceRange.end, end, dateEnv, options.granularity); if (durationsEqual(startDelta, endDelta)) { this.mutate({ datesDelta: startDelta, standardProps: standardProps }); } else { this.mutate({ startDelta: startDelta, endDelta: endDelta, standardProps: standardProps }); } } else { // means "clear the end" standardProps.hasEnd = false; this.mutate({ datesDelta: startDelta, standardProps: standardProps }); } } }; EventApi.prototype.moveStart = function (deltaInput) { var delta = createDuration(deltaInput); if (delta) { // TODO: warning if parsed bad this.mutate({ startDelta: delta }); } }; EventApi.prototype.moveEnd = function (deltaInput) { var delta = createDuration(deltaInput); if (delta) { // TODO: warning if parsed bad this.mutate({ endDelta: delta }); } }; EventApi.prototype.moveDates = function (deltaInput) { var delta = createDuration(deltaInput); if (delta) { // TODO: warning if parsed bad this.mutate({ datesDelta: delta }); } }; EventApi.prototype.setAllDay = function (allDay, options) { if (options === void 0) { options = {}; } var standardProps = { allDay: allDay }; var maintainDuration = options.maintainDuration; if (maintainDuration == null) { maintainDuration = this._context.options.allDayMaintainDuration; } if (this._def.allDay !== allDay) { standardProps.hasEnd = maintainDuration; } this.mutate({ standardProps: standardProps }); }; EventApi.prototype.formatRange = function (formatInput) { var dateEnv = this._context.dateEnv; var instance = this._instance; var formatter = createFormatter(formatInput); if (this._def.hasEnd) { return dateEnv.formatRange(instance.range.start, instance.range.end, formatter, { forcedStartTzo: instance.forcedStartTzo, forcedEndTzo: instance.forcedEndTzo, }); } return dateEnv.format(instance.range.start, formatter, { forcedTzo: instance.forcedStartTzo, }); }; EventApi.prototype.mutate = function (mutation) { var instance = this._instance; if (instance) { var def = this._def; var context_1 = this._context; var eventStore_1 = context_1.getCurrentData().eventStore; var relevantEvents = getRelevantEvents(eventStore_1, instance.instanceId); var eventConfigBase = { '': { display: '', startEditable: true, durationEditable: true, constraints: [], overlap: null, allows: [], backgroundColor: '', borderColor: '', textColor: '', classNames: [], }, }; relevantEvents = applyMutationToEventStore(relevantEvents, eventConfigBase, mutation, context_1); var oldEvent = new EventApi(context_1, def, instance); // snapshot this._def = relevantEvents.defs[def.defId]; this._instance = relevantEvents.instances[instance.instanceId]; context_1.dispatch({ type: 'MERGE_EVENTS', eventStore: relevantEvents, }); context_1.emitter.trigger('eventChange', { oldEvent: oldEvent, event: this, relatedEvents: buildEventApis(relevantEvents, context_1, instance), revert: function () { context_1.dispatch({ type: 'RESET_EVENTS', eventStore: eventStore_1, }); }, }); } }; EventApi.prototype.remove = function () { var context = this._context; var asStore = eventApiToStore(this); context.dispatch({ type: 'REMOVE_EVENTS', eventStore: asStore, }); context.emitter.trigger('eventRemove', { event: this, relatedEvents: [], revert: function () { context.dispatch({ type: 'MERGE_EVENTS', eventStore: asStore, }); }, }); }; Object.defineProperty(EventApi.prototype, "source", { get: function () { var sourceId = this._def.sourceId; if (sourceId) { return new EventSourceApi(this._context, this._context.getCurrentData().eventSources[sourceId]); } return null; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "start", { get: function () { return this._instance ? this._context.dateEnv.toDate(this._instance.range.start) : null; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "end", { get: function () { return (this._instance && this._def.hasEnd) ? this._context.dateEnv.toDate(this._instance.range.end) : null; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "startStr", { get: function () { var instance = this._instance; if (instance) { return this._context.dateEnv.formatIso(instance.range.start, { omitTime: this._def.allDay, forcedTzo: instance.forcedStartTzo, }); } return ''; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "endStr", { get: function () { var instance = this._instance; if (instance && this._def.hasEnd) { return this._context.dateEnv.formatIso(instance.range.end, { omitTime: this._def.allDay, forcedTzo: instance.forcedEndTzo, }); } return ''; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "id", { // computable props that all access the def // TODO: find a TypeScript-compatible way to do this at scale get: function () { return this._def.publicId; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "groupId", { get: function () { return this._def.groupId; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "allDay", { get: function () { return this._def.allDay; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "title", { get: function () { return this._def.title; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "url", { get: function () { return this._def.url; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "display", { get: function () { return this._def.ui.display || 'auto'; } // bad. just normalize the type earlier , enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "startEditable", { get: function () { return this._def.ui.startEditable; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "durationEditable", { get: function () { return this._def.ui.durationEditable; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "constraint", { get: function () { return this._def.ui.constraints[0] || null; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "overlap", { get: function () { return this._def.ui.overlap; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "allow", { get: function () { return this._def.ui.allows[0] || null; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "backgroundColor", { get: function () { return this._def.ui.backgroundColor; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "borderColor", { get: function () { return this._def.ui.borderColor; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "textColor", { get: function () { return this._def.ui.textColor; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "classNames", { // NOTE: user can't modify these because Object.freeze was called in event-def parsing get: function () { return this._def.ui.classNames; }, enumerable: false, configurable: true }); Object.defineProperty(EventApi.prototype, "extendedProps", { get: function () { return this._def.extendedProps; }, enumerable: false, configurable: true }); EventApi.prototype.toPlainObject = function (settings) { if (settings === void 0) { settings = {}; } var def = this._def; var ui = def.ui; var _a = this, startStr = _a.startStr, endStr = _a.endStr; var res = {}; if (def.title) { res.title = def.title; } if (startStr) { res.start = startStr; } if (endStr) { res.end = endStr; } if (def.publicId) { res.id = def.publicId; } if (def.groupId) { res.groupId = def.groupId; } if (def.url) { res.url = def.url; } if (ui.display && ui.display !== 'auto') { res.display = ui.display; } // TODO: what about recurring-event properties??? // TODO: include startEditable/durationEditable/constraint/overlap/allow if (settings.collapseColor && ui.backgroundColor && ui.backgroundColor === ui.borderColor) { res.color = ui.backgroundColor; } else { if (ui.backgroundColor) { res.backgroundColor = ui.backgroundColor; } if (ui.borderColor) { res.borderColor = ui.borderColor; } } if (ui.textColor) { res.textColor = ui.textColor; } if (ui.classNames.length) { res.classNames = ui.classNames; } if (Object.keys(def.extendedProps).length) { if (settings.collapseExtendedProps) { (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)(res, def.extendedProps); } else { res.extendedProps = def.extendedProps; } } return res; }; EventApi.prototype.toJSON = function () { return this.toPlainObject(); }; return EventApi; }()); function eventApiToStore(eventApi) { var _a, _b; var def = eventApi._def; var instance = eventApi._instance; return { defs: (_a = {}, _a[def.defId] = def, _a), instances: instance ? (_b = {}, _b[instance.instanceId] = instance, _b) : {}, }; } function buildEventApis(eventStore, context, excludeInstance) { var defs = eventStore.defs, instances = eventStore.instances; var eventApis = []; var excludeInstanceId = excludeInstance ? excludeInstance.instanceId : ''; for (var id in instances) { var instance = instances[id]; var def = defs[instance.defId]; if (instance.instanceId !== excludeInstanceId) { eventApis.push(new EventApi(context, def, instance)); } } return eventApis; } var calendarSystemClassMap = {}; function registerCalendarSystem(name, theClass) { calendarSystemClassMap[name] = theClass; } function createCalendarSystem(name) { return new calendarSystemClassMap[name](); } var GregorianCalendarSystem = /** @class */ (function () { function GregorianCalendarSystem() { } GregorianCalendarSystem.prototype.getMarkerYear = function (d) { return d.getUTCFullYear(); }; GregorianCalendarSystem.prototype.getMarkerMonth = function (d) { return d.getUTCMonth(); }; GregorianCalendarSystem.prototype.getMarkerDay = function (d) { return d.getUTCDate(); }; GregorianCalendarSystem.prototype.arrayToMarker = function (arr) { return arrayToUtcDate(arr); }; GregorianCalendarSystem.prototype.markerToArray = function (marker) { return dateToUtcArray(marker); }; return GregorianCalendarSystem; }()); registerCalendarSystem('gregory', GregorianCalendarSystem); var ISO_RE = /^\s*(\d{4})(-?(\d{2})(-?(\d{2})([T ](\d{2}):?(\d{2})(:?(\d{2})(\.(\d+))?)?(Z|(([-+])(\d{2})(:?(\d{2}))?))?)?)?)?$/; function parse(str) { var m = ISO_RE.exec(str); if (m) { var marker = new Date(Date.UTC(Number(m[1]), m[3] ? Number(m[3]) - 1 : 0, Number(m[5] || 1), Number(m[7] || 0), Number(m[8] || 0), Number(m[10] || 0), m[12] ? Number("0." + m[12]) * 1000 : 0)); if (isValidDate(marker)) { var timeZoneOffset = null; if (m[13]) { timeZoneOffset = (m[15] === '-' ? -1 : 1) * (Number(m[16] || 0) * 60 + Number(m[18] || 0)); } return { marker: marker, isTimeUnspecified: !m[6], timeZoneOffset: timeZoneOffset, }; } } return null; } var DateEnv = /** @class */ (function () { function DateEnv(settings) { var timeZone = this.timeZone = settings.timeZone; var isNamedTimeZone = timeZone !== 'local' && timeZone !== 'UTC'; if (settings.namedTimeZoneImpl && isNamedTimeZone) { this.namedTimeZoneImpl = new settings.namedTimeZoneImpl(timeZone); } this.canComputeOffset = Boolean(!isNamedTimeZone || this.namedTimeZoneImpl); this.calendarSystem = createCalendarSystem(settings.calendarSystem); this.locale = settings.locale; this.weekDow = settings.locale.week.dow; this.weekDoy = settings.locale.week.doy; if (settings.weekNumberCalculation === 'ISO') { this.weekDow = 1; this.weekDoy = 4; } if (typeof settings.firstDay === 'number') { this.weekDow = settings.firstDay; } if (typeof settings.weekNumberCalculation === 'function') { this.weekNumberFunc = settings.weekNumberCalculation; } this.weekText = settings.weekText != null ? settings.weekText : settings.locale.options.weekText; this.weekTextLong = (settings.weekTextLong != null ? settings.weekTextLong : settings.locale.options.weekTextLong) || this.weekText; this.cmdFormatter = settings.cmdFormatter; this.defaultSeparator = settings.defaultSeparator; } // Creating / Parsing DateEnv.prototype.createMarker = function (input) { var meta = this.createMarkerMeta(input); if (meta === null) { return null; } return meta.marker; }; DateEnv.prototype.createNowMarker = function () { if (this.canComputeOffset) { return this.timestampToMarker(new Date().valueOf()); } // if we can't compute the current date val for a timezone, // better to give the current local date vals than UTC return arrayToUtcDate(dateToLocalArray(new Date())); }; DateEnv.prototype.createMarkerMeta = function (input) { if (typeof input === 'string') { return this.parse(input); } var marker = null; if (typeof input === 'number') { marker = this.timestampToMarker(input); } else if (input instanceof Date) { input = input.valueOf(); if (!isNaN(input)) { marker = this.timestampToMarker(input); } } else if (Array.isArray(input)) { marker = arrayToUtcDate(input); } if (marker === null || !isValidDate(marker)) { return null; } return { marker: marker, isTimeUnspecified: false, forcedTzo: null }; }; DateEnv.prototype.parse = function (s) { var parts = parse(s); if (parts === null) { return null; } var marker = parts.marker; var forcedTzo = null; if (parts.timeZoneOffset !== null) { if (this.canComputeOffset) { marker = this.timestampToMarker(marker.valueOf() - parts.timeZoneOffset * 60 * 1000); } else { forcedTzo = parts.timeZoneOffset; } } return { marker: marker, isTimeUnspecified: parts.isTimeUnspecified, forcedTzo: forcedTzo }; }; // Accessors DateEnv.prototype.getYear = function (marker) { return this.calendarSystem.getMarkerYear(marker); }; DateEnv.prototype.getMonth = function (marker) { return this.calendarSystem.getMarkerMonth(marker); }; // Adding / Subtracting DateEnv.prototype.add = function (marker, dur) { var a = this.calendarSystem.markerToArray(marker); a[0] += dur.years; a[1] += dur.months; a[2] += dur.days; a[6] += dur.milliseconds; return this.calendarSystem.arrayToMarker(a); }; DateEnv.prototype.subtract = function (marker, dur) { var a = this.calendarSystem.markerToArray(marker); a[0] -= dur.years; a[1] -= dur.months; a[2] -= dur.days; a[6] -= dur.milliseconds; return this.calendarSystem.arrayToMarker(a); }; DateEnv.prototype.addYears = function (marker, n) { var a = this.calendarSystem.markerToArray(marker); a[0] += n; return this.calendarSystem.arrayToMarker(a); }; DateEnv.prototype.addMonths = function (marker, n) { var a = this.calendarSystem.markerToArray(marker); a[1] += n; return this.calendarSystem.arrayToMarker(a); }; // Diffing Whole Units DateEnv.prototype.diffWholeYears = function (m0, m1) { var calendarSystem = this.calendarSystem; if (timeAsMs(m0) === timeAsMs(m1) && calendarSystem.getMarkerDay(m0) === calendarSystem.getMarkerDay(m1) && calendarSystem.getMarkerMonth(m0) === calendarSystem.getMarkerMonth(m1)) { return calendarSystem.getMarkerYear(m1) - calendarSystem.getMarkerYear(m0); } return null; }; DateEnv.prototype.diffWholeMonths = function (m0, m1) { var calendarSystem = this.calendarSystem; if (timeAsMs(m0) === timeAsMs(m1) && calendarSystem.getMarkerDay(m0) === calendarSystem.getMarkerDay(m1)) { return (calendarSystem.getMarkerMonth(m1) - calendarSystem.getMarkerMonth(m0)) + (calendarSystem.getMarkerYear(m1) - calendarSystem.getMarkerYear(m0)) * 12; } return null; }; // Range / Duration DateEnv.prototype.greatestWholeUnit = function (m0, m1) { var n = this.diffWholeYears(m0, m1); if (n !== null) { return { unit: 'year', value: n }; } n = this.diffWholeMonths(m0, m1); if (n !== null) { return { unit: 'month', value: n }; } n = diffWholeWeeks(m0, m1); if (n !== null) { return { unit: 'week', value: n }; } n = diffWholeDays(m0, m1); if (n !== null) { return { unit: 'day', value: n }; } n = diffHours(m0, m1); if (isInt(n)) { return { unit: 'hour', value: n }; } n = diffMinutes(m0, m1); if (isInt(n)) { return { unit: 'minute', value: n }; } n = diffSeconds(m0, m1); if (isInt(n)) { return { unit: 'second', value: n }; } return { unit: 'millisecond', value: m1.valueOf() - m0.valueOf() }; }; DateEnv.prototype.countDurationsBetween = function (m0, m1, d) { // TODO: can use greatestWholeUnit var diff; if (d.years) { diff = this.diffWholeYears(m0, m1); if (diff !== null) { return diff / asRoughYears(d); } } if (d.months) { diff = this.diffWholeMonths(m0, m1); if (diff !== null) { return diff / asRoughMonths(d); } } if (d.days) { diff = diffWholeDays(m0, m1); if (diff !== null) { return diff / asRoughDays(d); } } return (m1.valueOf() - m0.valueOf()) / asRoughMs(d); }; // Start-Of // these DON'T return zoned-dates. only UTC start-of dates DateEnv.prototype.startOf = function (m, unit) { if (unit === 'year') { return this.startOfYear(m); } if (unit === 'month') { return this.startOfMonth(m); } if (unit === 'week') { return this.startOfWeek(m); } if (unit === 'day') { return startOfDay(m); } if (unit === 'hour') { return startOfHour(m); } if (unit === 'minute') { return startOfMinute(m); } if (unit === 'second') { return startOfSecond(m); } return null; }; DateEnv.prototype.startOfYear = function (m) { return this.calendarSystem.arrayToMarker([ this.calendarSystem.getMarkerYear(m), ]); }; DateEnv.prototype.startOfMonth = function (m) { return this.calendarSystem.arrayToMarker([ this.calendarSystem.getMarkerYear(m), this.calendarSystem.getMarkerMonth(m), ]); }; DateEnv.prototype.startOfWeek = function (m) { return this.calendarSystem.arrayToMarker([ this.calendarSystem.getMarkerYear(m), this.calendarSystem.getMarkerMonth(m), m.getUTCDate() - ((m.getUTCDay() - this.weekDow + 7) % 7), ]); }; // Week Number DateEnv.prototype.computeWeekNumber = function (marker) { if (this.weekNumberFunc) { return this.weekNumberFunc(this.toDate(marker)); } return weekOfYear(marker, this.weekDow, this.weekDoy); }; // TODO: choke on timeZoneName: long DateEnv.prototype.format = function (marker, formatter, dateOptions) { if (dateOptions === void 0) { dateOptions = {}; } return formatter.format({ marker: marker, timeZoneOffset: dateOptions.forcedTzo != null ? dateOptions.forcedTzo : this.offsetForMarker(marker), }, this); }; DateEnv.prototype.formatRange = function (start, end, formatter, dateOptions) { if (dateOptions === void 0) { dateOptions = {}; } if (dateOptions.isEndExclusive) { end = addMs(end, -1); } return formatter.formatRange({ marker: start, timeZoneOffset: dateOptions.forcedStartTzo != null ? dateOptions.forcedStartTzo : this.offsetForMarker(start), }, { marker: end, timeZoneOffset: dateOptions.forcedEndTzo != null ? dateOptions.forcedEndTzo : this.offsetForMarker(end), }, this, dateOptions.defaultSeparator); }; /* DUMB: the omitTime arg is dumb. if we omit the time, we want to omit the timezone offset. and if we do that, might as well use buildIsoString or some other util directly */ DateEnv.prototype.formatIso = function (marker, extraOptions) { if (extraOptions === void 0) { extraOptions = {}; } var timeZoneOffset = null; if (!extraOptions.omitTimeZoneOffset) { if (extraOptions.forcedTzo != null) { timeZoneOffset = extraOptions.forcedTzo; } else { timeZoneOffset = this.offsetForMarker(marker); } } return buildIsoString(marker, timeZoneOffset, extraOptions.omitTime); }; // TimeZone DateEnv.prototype.timestampToMarker = function (ms) { if (this.timeZone === 'local') { return arrayToUtcDate(dateToLocalArray(new Date(ms))); } if (this.timeZone === 'UTC' || !this.namedTimeZoneImpl) { return new Date(ms); } return arrayToUtcDate(this.namedTimeZoneImpl.timestampToArray(ms)); }; DateEnv.prototype.offsetForMarker = function (m) { if (this.timeZone === 'local') { return -arrayToLocalDate(dateToUtcArray(m)).getTimezoneOffset(); // convert "inverse" offset to "normal" offset } if (this.timeZone === 'UTC') { return 0; } if (this.namedTimeZoneImpl) { return this.namedTimeZoneImpl.offsetForArray(dateToUtcArray(m)); } return null; }; // Conversion DateEnv.prototype.toDate = function (m, forcedTzo) { if (this.timeZone === 'local') { return arrayToLocalDate(dateToUtcArray(m)); } if (this.timeZone === 'UTC') { return new Date(m.valueOf()); // make sure it's a copy } if (!this.namedTimeZoneImpl) { return new Date(m.valueOf() - (forcedTzo || 0)); } return new Date(m.valueOf() - this.namedTimeZoneImpl.offsetForArray(dateToUtcArray(m)) * 1000 * 60); }; return DateEnv; }()); var globalLocales = []; var MINIMAL_RAW_EN_LOCALE = { code: 'en', week: { dow: 0, doy: 4, // 4 days need to be within the year to be considered the first week }, direction: 'ltr', buttonText: { prev: 'prev', next: 'next', prevYear: 'prev year', nextYear: 'next year', year: 'year', today: 'today', month: 'month', week: 'week', day: 'day', list: 'list', }, weekText: 'W', weekTextLong: 'Week', closeHint: 'Close', timeHint: 'Time', eventHint: 'Event', allDayText: 'all-day', moreLinkText: 'more', noEventsText: 'No events to display', }; var RAW_EN_LOCALE = (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, MINIMAL_RAW_EN_LOCALE), { // Includes things we don't want other locales to inherit, // things that derive from other translatable strings. buttonHints: { prev: 'Previous $0', next: 'Next $0', today: function (buttonText, unit) { return (unit === 'day') ? 'Today' : "This " + buttonText; }, }, viewHint: '$0 view', navLinkHint: 'Go to $0', moreLinkHint: function (eventCnt) { return "Show " + eventCnt + " more event" + (eventCnt === 1 ? '' : 's'); } }); function organizeRawLocales(explicitRawLocales) { var defaultCode = explicitRawLocales.length > 0 ? explicitRawLocales[0].code : 'en'; var allRawLocales = globalLocales.concat(explicitRawLocales); var rawLocaleMap = { en: RAW_EN_LOCALE, }; for (var _i = 0, allRawLocales_1 = allRawLocales; _i < allRawLocales_1.length; _i++) { var rawLocale = allRawLocales_1[_i]; rawLocaleMap[rawLocale.code] = rawLocale; } return { map: rawLocaleMap, defaultCode: defaultCode, }; } function buildLocale(inputSingular, available) { if (typeof inputSingular === 'object' && !Array.isArray(inputSingular)) { return parseLocale(inputSingular.code, [inputSingular.code], inputSingular); } return queryLocale(inputSingular, available); } function queryLocale(codeArg, available) { var codes = [].concat(codeArg || []); // will convert to array var raw = queryRawLocale(codes, available) || RAW_EN_LOCALE; return parseLocale(codeArg, codes, raw); } function queryRawLocale(codes, available) { for (var i = 0; i < codes.length; i += 1) { var parts = codes[i].toLocaleLowerCase().split('-'); for (var j = parts.length; j > 0; j -= 1) { var simpleId = parts.slice(0, j).join('-'); if (available[simpleId]) { return available[simpleId]; } } } return null; } function parseLocale(codeArg, codes, raw) { var merged = mergeProps([MINIMAL_RAW_EN_LOCALE, raw], ['buttonText']); delete merged.code; // don't want this part of the options var week = merged.week; delete merged.week; return { codeArg: codeArg, codes: codes, week: week, simpleNumberFormat: new Intl.NumberFormat(codeArg), options: merged, }; } function formatDate(dateInput, options) { if (options === void 0) { options = {}; } var dateEnv = buildDateEnv$1(options); var formatter = createFormatter(options); var dateMeta = dateEnv.createMarkerMeta(dateInput); if (!dateMeta) { // TODO: warning? return ''; } return dateEnv.format(dateMeta.marker, formatter, { forcedTzo: dateMeta.forcedTzo, }); } function formatRange(startInput, endInput, options) { var dateEnv = buildDateEnv$1(typeof options === 'object' && options ? options : {}); // pass in if non-null object var formatter = createFormatter(options); var startMeta = dateEnv.createMarkerMeta(startInput); var endMeta = dateEnv.createMarkerMeta(endInput); if (!startMeta || !endMeta) { // TODO: warning? return ''; } return dateEnv.formatRange(startMeta.marker, endMeta.marker, formatter, { forcedStartTzo: startMeta.forcedTzo, forcedEndTzo: endMeta.forcedTzo, isEndExclusive: options.isEndExclusive, defaultSeparator: BASE_OPTION_DEFAULTS.defaultRangeSeparator, }); } // TODO: more DRY and optimized function buildDateEnv$1(settings) { var locale = buildLocale(settings.locale || 'en', organizeRawLocales([]).map); // TODO: don't hardcode 'en' everywhere return new DateEnv((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({ timeZone: BASE_OPTION_DEFAULTS.timeZone, calendarSystem: 'gregory' }, settings), { locale: locale })); } var DEF_DEFAULTS = { startTime: '09:00', endTime: '17:00', daysOfWeek: [1, 2, 3, 4, 5], display: 'inverse-background', classNames: 'fc-non-business', groupId: '_businessHours', // so multiple defs get grouped }; /* TODO: pass around as EventDefHash!!! */ function parseBusinessHours(input, context) { return parseEvents(refineInputs(input), null, context); } function refineInputs(input) { var rawDefs; if (input === true) { rawDefs = [{}]; // will get DEF_DEFAULTS verbatim } else if (Array.isArray(input)) { // if specifying an array, every sub-definition NEEDS a day-of-week rawDefs = input.filter(function (rawDef) { return rawDef.daysOfWeek; }); } else if (typeof input === 'object' && input) { // non-null object rawDefs = [input]; } else { // is probably false rawDefs = []; } rawDefs = rawDefs.map(function (rawDef) { return ((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, DEF_DEFAULTS), rawDef)); }); return rawDefs; } function pointInsideRect(point, rect) { return point.left >= rect.left && point.left < rect.right && point.top >= rect.top && point.top < rect.bottom; } // Returns a new rectangle that is the intersection of the two rectangles. If they don't intersect, returns false function intersectRects(rect1, rect2) { var res = { left: Math.max(rect1.left, rect2.left), right: Math.min(rect1.right, rect2.right), top: Math.max(rect1.top, rect2.top), bottom: Math.min(rect1.bottom, rect2.bottom), }; if (res.left < res.right && res.top < res.bottom) { return res; } return false; } function translateRect(rect, deltaX, deltaY) { return { left: rect.left + deltaX, right: rect.right + deltaX, top: rect.top + deltaY, bottom: rect.bottom + deltaY, }; } // Returns a new point that will have been moved to reside within the given rectangle function constrainPoint(point, rect) { return { left: Math.min(Math.max(point.left, rect.left), rect.right), top: Math.min(Math.max(point.top, rect.top), rect.bottom), }; } // Returns a point that is the center of the given rectangle function getRectCenter(rect) { return { left: (rect.left + rect.right) / 2, top: (rect.top + rect.bottom) / 2, }; } // Subtracts point2's coordinates from point1's coordinates, returning a delta function diffPoints(point1, point2) { return { left: point1.left - point2.left, top: point1.top - point2.top, }; } var canVGrowWithinCell; function getCanVGrowWithinCell() { if (canVGrowWithinCell == null) { canVGrowWithinCell = computeCanVGrowWithinCell(); } return canVGrowWithinCell; } function computeCanVGrowWithinCell() { // for SSR, because this function is call immediately at top-level // TODO: just make this logic execute top-level, immediately, instead of doing lazily if (typeof document === 'undefined') { return true; } var el = document.createElement('div'); el.style.position = 'absolute'; el.style.top = '0px'; el.style.left = '0px'; el.innerHTML = '
/ | elements with colspans.
SOLUTION: making individual | _this.frameElRefs = new _fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.RefMap(); // the fc-daygrid-day-frame _this.fgElRefs = new _fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.RefMap(); // the fc-daygrid-day-events _this.segHarnessRefs = new _fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.RefMap(); // indexed by "instanceId:firstCol" _this.rootElRef = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createRef)(); _this.state = { framePositions: null, maxContentHeight: null, eventInstanceHeights: {}, }; return _this; } TableRow.prototype.render = function () { var _this = this; var _a = this, props = _a.props, state = _a.state, context = _a.context; var options = context.options; var colCnt = props.cells.length; var businessHoursByCol = splitSegsByFirstCol(props.businessHourSegs, colCnt); var bgEventSegsByCol = splitSegsByFirstCol(props.bgEventSegs, colCnt); var highlightSegsByCol = splitSegsByFirstCol(this.getHighlightSegs(), colCnt); var mirrorSegsByCol = splitSegsByFirstCol(this.getMirrorSegs(), colCnt); var _b = computeFgSegPlacement((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.sortEventSegs)(props.fgEventSegs, options.eventOrder), props.dayMaxEvents, props.dayMaxEventRows, options.eventOrderStrict, state.eventInstanceHeights, state.maxContentHeight, props.cells), singleColPlacements = _b.singleColPlacements, multiColPlacements = _b.multiColPlacements, moreCnts = _b.moreCnts, moreMarginTops = _b.moreMarginTops; var isForcedInvisible = // TODO: messy way to compute this (props.eventDrag && props.eventDrag.affectedInstances) || (props.eventResize && props.eventResize.affectedInstances) || {}; return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("tr", { ref: this.rootElRef, role: "row" }, props.renderIntro && props.renderIntro(), props.cells.map(function (cell, col) { var normalFgNodes = _this.renderFgSegs(col, props.forPrint ? singleColPlacements[col] : multiColPlacements[col], props.todayRange, isForcedInvisible); var mirrorFgNodes = _this.renderFgSegs(col, buildMirrorPlacements(mirrorSegsByCol[col], multiColPlacements), props.todayRange, {}, Boolean(props.eventDrag), Boolean(props.eventResize), false); return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(TableCell, { key: cell.key, elRef: _this.cellElRefs.createRef(cell.key), innerElRef: _this.frameElRefs.createRef(cell.key) /* FF | problem, but okay to use for left/right. TODO: rename prop */, dateProfile: props.dateProfile, date: cell.date, showDayNumber: props.showDayNumbers, showWeekNumber: props.showWeekNumbers && col === 0, forceDayTop: props.showWeekNumbers /* even displaying weeknum for row, not necessarily day */, todayRange: props.todayRange, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, extraHookProps: cell.extraHookProps, extraDataAttrs: cell.extraDataAttrs, extraClassNames: cell.extraClassNames, extraDateSpan: cell.extraDateSpan, moreCnt: moreCnts[col], moreMarginTop: moreMarginTops[col], singlePlacements: singleColPlacements[col], fgContentElRef: _this.fgElRefs.createRef(cell.key), fgContent: ( // Fragment scopes the keys (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, normalFgNodes), (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, mirrorFgNodes))), bgContent: ( // Fragment scopes the keys (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, _this.renderFillSegs(highlightSegsByCol[col], 'highlight'), _this.renderFillSegs(businessHoursByCol[col], 'non-business'), _this.renderFillSegs(bgEventSegsByCol[col], 'bg-event'))) })); }))); }; TableRow.prototype.componentDidMount = function () { this.updateSizing(true); }; TableRow.prototype.componentDidUpdate = function (prevProps, prevState) { var currentProps = this.props; this.updateSizing(!(0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.isPropsEqual)(prevProps, currentProps)); }; TableRow.prototype.getHighlightSegs = function () { var props = this.props; if (props.eventDrag && props.eventDrag.segs.length) { // messy check return props.eventDrag.segs; } if (props.eventResize && props.eventResize.segs.length) { // messy check return props.eventResize.segs; } return props.dateSelectionSegs; }; TableRow.prototype.getMirrorSegs = function () { var props = this.props; if (props.eventResize && props.eventResize.segs.length) { // messy check return props.eventResize.segs; } return []; }; TableRow.prototype.renderFgSegs = function (col, segPlacements, todayRange, isForcedInvisible, isDragging, isResizing, isDateSelecting) { var context = this.context; var eventSelection = this.props.eventSelection; var framePositions = this.state.framePositions; var defaultDisplayEventEnd = this.props.cells.length === 1; // colCnt === 1 var isMirror = isDragging || isResizing || isDateSelecting; var nodes = []; if (framePositions) { for (var _i = 0, segPlacements_1 = segPlacements; _i < segPlacements_1.length; _i++) { var placement = segPlacements_1[_i]; var seg = placement.seg; var instanceId = seg.eventRange.instance.instanceId; var key = instanceId + ':' + col; var isVisible = placement.isVisible && !isForcedInvisible[instanceId]; var isAbsolute = placement.isAbsolute; var left = ''; var right = ''; if (isAbsolute) { if (context.isRtl) { right = 0; left = framePositions.lefts[seg.lastCol] - framePositions.lefts[seg.firstCol]; } else { left = 0; right = framePositions.rights[seg.firstCol] - framePositions.rights[seg.lastCol]; } } /* known bug: events that are force to be list-item but span multiple days still take up space in later columns todo: in print view, for multi-day events, don't display title within non-start/end segs */ nodes.push((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("div", { className: 'fc-daygrid-event-harness' + (isAbsolute ? ' fc-daygrid-event-harness-abs' : ''), key: key, ref: isMirror ? null : this.segHarnessRefs.createRef(key), style: { visibility: isVisible ? '' : 'hidden', marginTop: isAbsolute ? '' : placement.marginTop, top: isAbsolute ? placement.absoluteTop : '', left: left, right: right, } }, hasListItemDisplay(seg) ? ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(TableListItemEvent, (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({ seg: seg, isDragging: isDragging, isSelected: instanceId === eventSelection, defaultDisplayEventEnd: defaultDisplayEventEnd }, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.getSegMeta)(seg, todayRange)))) : ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(TableBlockEvent, (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({ seg: seg, isDragging: isDragging, isResizing: isResizing, isDateSelecting: isDateSelecting, isSelected: instanceId === eventSelection, defaultDisplayEventEnd: defaultDisplayEventEnd }, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.getSegMeta)(seg, todayRange)))))); } } return nodes; }; TableRow.prototype.renderFillSegs = function (segs, fillType) { var isRtl = this.context.isRtl; var todayRange = this.props.todayRange; var framePositions = this.state.framePositions; var nodes = []; if (framePositions) { for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) { var seg = segs_1[_i]; var leftRightCss = isRtl ? { right: 0, left: framePositions.lefts[seg.lastCol] - framePositions.lefts[seg.firstCol], } : { left: 0, right: framePositions.rights[seg.firstCol] - framePositions.rights[seg.lastCol], }; nodes.push((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("div", { key: (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.buildEventRangeKey)(seg.eventRange), className: "fc-daygrid-bg-harness", style: leftRightCss }, fillType === 'bg-event' ? (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.BgEvent, (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({ seg: seg }, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.getSegMeta)(seg, todayRange))) : (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.renderFill)(fillType))); } } return _fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement.apply(void 0, (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__spreadArray)([_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.Fragment, {}], nodes)); }; TableRow.prototype.updateSizing = function (isExternalSizingChange) { var _a = this, props = _a.props, frameElRefs = _a.frameElRefs; if (!props.forPrint && props.clientWidth !== null // positioning ready? ) { if (isExternalSizingChange) { var frameEls = props.cells.map(function (cell) { return frameElRefs.currentMap[cell.key]; }); if (frameEls.length) { var originEl = this.rootElRef.current; this.setState({ framePositions: new _fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.PositionCache(originEl, frameEls, true, // isHorizontal false), }); } } var oldInstanceHeights = this.state.eventInstanceHeights; var newInstanceHeights = this.queryEventInstanceHeights(); var limitByContentHeight = props.dayMaxEvents === true || props.dayMaxEventRows === true; this.safeSetState({ // HACK to prevent oscillations of events being shown/hidden from max-event-rows // Essentially, once you compute an element's height, never null-out. // TODO: always display all events, as visibility:hidden? eventInstanceHeights: (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, oldInstanceHeights), newInstanceHeights), maxContentHeight: limitByContentHeight ? this.computeMaxContentHeight() : null, }); } }; TableRow.prototype.queryEventInstanceHeights = function () { var segElMap = this.segHarnessRefs.currentMap; var eventInstanceHeights = {}; // get the max height amongst instance segs for (var key in segElMap) { var height = Math.round(segElMap[key].getBoundingClientRect().height); var instanceId = key.split(':')[0]; // deconstruct how renderFgSegs makes the key eventInstanceHeights[instanceId] = Math.max(eventInstanceHeights[instanceId] || 0, height); } return eventInstanceHeights; }; TableRow.prototype.computeMaxContentHeight = function () { var firstKey = this.props.cells[0].key; var cellEl = this.cellElRefs.currentMap[firstKey]; var fcContainerEl = this.fgElRefs.currentMap[firstKey]; return cellEl.getBoundingClientRect().bottom - fcContainerEl.getBoundingClientRect().top; }; TableRow.prototype.getCellEls = function () { var elMap = this.cellElRefs.currentMap; return this.props.cells.map(function (cell) { return elMap[cell.key]; }); }; return TableRow; }(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.DateComponent)); TableRow.addStateEquality({ eventInstanceHeights: _fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.isPropsEqual, }); function buildMirrorPlacements(mirrorSegs, colPlacements) { if (!mirrorSegs.length) { return []; } var topsByInstanceId = buildAbsoluteTopHash(colPlacements); // TODO: cache this at first render? return mirrorSegs.map(function (seg) { return ({ seg: seg, isVisible: true, isAbsolute: true, absoluteTop: topsByInstanceId[seg.eventRange.instance.instanceId], marginTop: 0, }); }); } function buildAbsoluteTopHash(colPlacements) { var topsByInstanceId = {}; for (var _i = 0, colPlacements_1 = colPlacements; _i < colPlacements_1.length; _i++) { var placements = colPlacements_1[_i]; for (var _a = 0, placements_1 = placements; _a < placements_1.length; _a++) { var placement = placements_1[_a]; topsByInstanceId[placement.seg.eventRange.instance.instanceId] = placement.absoluteTop; } } return topsByInstanceId; } var Table = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__extends)(Table, _super); function Table() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.splitBusinessHourSegs = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.memoize)(splitSegsByRow); _this.splitBgEventSegs = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.memoize)(splitSegsByRow); _this.splitFgEventSegs = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.memoize)(splitSegsByRow); _this.splitDateSelectionSegs = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.memoize)(splitSegsByRow); _this.splitEventDrag = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.memoize)(splitInteractionByRow); _this.splitEventResize = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.memoize)(splitInteractionByRow); _this.rowRefs = new _fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.RefMap(); _this.handleRootEl = function (rootEl) { _this.rootEl = rootEl; if (rootEl) { _this.context.registerInteractiveComponent(_this, { el: rootEl, isHitComboAllowed: _this.props.isHitComboAllowed, }); } else { _this.context.unregisterInteractiveComponent(_this); } }; return _this; } Table.prototype.render = function () { var _this = this; var props = this.props; var dateProfile = props.dateProfile, dayMaxEventRows = props.dayMaxEventRows, dayMaxEvents = props.dayMaxEvents, expandRows = props.expandRows; var rowCnt = props.cells.length; var businessHourSegsByRow = this.splitBusinessHourSegs(props.businessHourSegs, rowCnt); var bgEventSegsByRow = this.splitBgEventSegs(props.bgEventSegs, rowCnt); var fgEventSegsByRow = this.splitFgEventSegs(props.fgEventSegs, rowCnt); var dateSelectionSegsByRow = this.splitDateSelectionSegs(props.dateSelectionSegs, rowCnt); var eventDragByRow = this.splitEventDrag(props.eventDrag, rowCnt); var eventResizeByRow = this.splitEventResize(props.eventResize, rowCnt); var limitViaBalanced = dayMaxEvents === true || dayMaxEventRows === true; // if rows can't expand to fill fixed height, can't do balanced-height event limit // TODO: best place to normalize these options? if (limitViaBalanced && !expandRows) { limitViaBalanced = false; dayMaxEventRows = null; dayMaxEvents = null; } var classNames = [ 'fc-daygrid-body', limitViaBalanced ? 'fc-daygrid-body-balanced' : 'fc-daygrid-body-unbalanced', expandRows ? '' : 'fc-daygrid-body-natural', // will height of one row depend on the others? ]; return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("div", { className: classNames.join(' '), ref: this.handleRootEl, style: { // these props are important to give this wrapper correct dimensions for interactions // TODO: if we set it here, can we avoid giving to inner tables? width: props.clientWidth, minWidth: props.tableMinWidth, } }, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.NowTimer, { unit: "day" }, function (nowDate, todayRange) { return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("table", { role: "presentation", className: "fc-scrollgrid-sync-table", style: { width: props.clientWidth, minWidth: props.tableMinWidth, height: expandRows ? props.clientHeight : '', } }, props.colGroupNode, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("tbody", { role: "presentation" }, props.cells.map(function (cells, row) { return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(TableRow, { ref: _this.rowRefs.createRef(row), key: cells.length ? cells[0].date.toISOString() /* best? or put key on cell? or use diff formatter? */ : row // in case there are no cells (like when resource view is loading) , showDayNumbers: rowCnt > 1, showWeekNumbers: props.showWeekNumbers, todayRange: todayRange, dateProfile: dateProfile, cells: cells, renderIntro: props.renderRowIntro, businessHourSegs: businessHourSegsByRow[row], eventSelection: props.eventSelection, bgEventSegs: bgEventSegsByRow[row].filter(isSegAllDay) /* hack */, fgEventSegs: fgEventSegsByRow[row], dateSelectionSegs: dateSelectionSegsByRow[row], eventDrag: eventDragByRow[row], eventResize: eventResizeByRow[row], dayMaxEvents: dayMaxEvents, dayMaxEventRows: dayMaxEventRows, clientWidth: props.clientWidth, clientHeight: props.clientHeight, forPrint: props.forPrint })); }))))); }))); }; // Hit System // ---------------------------------------------------------------------------------------------------- Table.prototype.prepareHits = function () { this.rowPositions = new _fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.PositionCache(this.rootEl, this.rowRefs.collect().map(function (rowObj) { return rowObj.getCellEls()[0]; }), // first cell el in each row. TODO: not optimal false, true); this.colPositions = new _fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.PositionCache(this.rootEl, this.rowRefs.currentMap[0].getCellEls(), // cell els in first row true, // horizontal false); }; Table.prototype.queryHit = function (positionLeft, positionTop) { var _a = this, colPositions = _a.colPositions, rowPositions = _a.rowPositions; var col = colPositions.leftToIndex(positionLeft); var row = rowPositions.topToIndex(positionTop); if (row != null && col != null) { var cell = this.props.cells[row][col]; return { dateProfile: this.props.dateProfile, dateSpan: (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({ range: this.getCellRange(row, col), allDay: true }, cell.extraDateSpan), dayEl: this.getCellEl(row, col), rect: { left: colPositions.lefts[col], right: colPositions.rights[col], top: rowPositions.tops[row], bottom: rowPositions.bottoms[row], }, layer: 0, }; } return null; }; Table.prototype.getCellEl = function (row, col) { return this.rowRefs.currentMap[row].getCellEls()[col]; // TODO: not optimal }; Table.prototype.getCellRange = function (row, col) { var start = this.props.cells[row][col].date; var end = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.addDays)(start, 1); return { start: start, end: end }; }; return Table; }(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.DateComponent)); function isSegAllDay(seg) { return seg.eventRange.def.allDay; } var DayTableSlicer = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__extends)(DayTableSlicer, _super); function DayTableSlicer() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.forceDayIfListItem = true; return _this; } DayTableSlicer.prototype.sliceRange = function (dateRange, dayTableModel) { return dayTableModel.sliceRange(dateRange); }; return DayTableSlicer; }(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.Slicer)); var DayTable = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__extends)(DayTable, _super); function DayTable() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.slicer = new DayTableSlicer(); _this.tableRef = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createRef)(); return _this; } DayTable.prototype.render = function () { var _a = this, props = _a.props, context = _a.context; return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(Table, (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({ ref: this.tableRef }, this.slicer.sliceProps(props, props.dateProfile, props.nextDayThreshold, context, props.dayTableModel), { dateProfile: props.dateProfile, cells: props.dayTableModel.cells, colGroupNode: props.colGroupNode, tableMinWidth: props.tableMinWidth, renderRowIntro: props.renderRowIntro, dayMaxEvents: props.dayMaxEvents, dayMaxEventRows: props.dayMaxEventRows, showWeekNumbers: props.showWeekNumbers, expandRows: props.expandRows, headerAlignElRef: props.headerAlignElRef, clientWidth: props.clientWidth, clientHeight: props.clientHeight, forPrint: props.forPrint }))); }; return DayTable; }(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.DateComponent)); var DayTableView = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__extends)(DayTableView, _super); function DayTableView() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.buildDayTableModel = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.memoize)(buildDayTableModel); _this.headerRef = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createRef)(); _this.tableRef = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createRef)(); return _this; } DayTableView.prototype.render = function () { var _this = this; var _a = this.context, options = _a.options, dateProfileGenerator = _a.dateProfileGenerator; var props = this.props; var dayTableModel = this.buildDayTableModel(props.dateProfile, dateProfileGenerator); var headerContent = options.dayHeaders && ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.DayHeader, { ref: this.headerRef, dateProfile: props.dateProfile, dates: dayTableModel.headerDates, datesRepDistinctDays: dayTableModel.rowCnt === 1 })); var bodyContent = function (contentArg) { return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(DayTable, { ref: _this.tableRef, dateProfile: props.dateProfile, dayTableModel: dayTableModel, businessHours: props.businessHours, dateSelection: props.dateSelection, eventStore: props.eventStore, eventUiBases: props.eventUiBases, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, nextDayThreshold: options.nextDayThreshold, colGroupNode: contentArg.tableColGroupNode, tableMinWidth: contentArg.tableMinWidth, dayMaxEvents: options.dayMaxEvents, dayMaxEventRows: options.dayMaxEventRows, showWeekNumbers: options.weekNumbers, expandRows: !props.isHeightAuto, headerAlignElRef: _this.headerElRef, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, forPrint: props.forPrint })); }; return options.dayMinWidth ? this.renderHScrollLayout(headerContent, bodyContent, dayTableModel.colCnt, options.dayMinWidth) : this.renderSimpleLayout(headerContent, bodyContent); }; return DayTableView; }(TableView)); function buildDayTableModel(dateProfile, dateProfileGenerator) { var daySeries = new _fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.DaySeriesModel(dateProfile.renderRange, dateProfileGenerator); return new _fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.DayTableModel(daySeries, /year|month|week/.test(dateProfile.currentRangeUnit)); } var TableDateProfileGenerator = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__extends)(TableDateProfileGenerator, _super); function TableDateProfileGenerator() { return _super !== null && _super.apply(this, arguments) || this; } // Computes the date range that will be rendered. TableDateProfileGenerator.prototype.buildRenderRange = function (currentRange, currentRangeUnit, isRangeAllDay) { var dateEnv = this.props.dateEnv; var renderRange = _super.prototype.buildRenderRange.call(this, currentRange, currentRangeUnit, isRangeAllDay); var start = renderRange.start; var end = renderRange.end; var endOfWeek; // year and month views should be aligned with weeks. this is already done for week if (/^(year|month)$/.test(currentRangeUnit)) { start = dateEnv.startOfWeek(start); // make end-of-week if not already endOfWeek = dateEnv.startOfWeek(end); if (endOfWeek.valueOf() !== end.valueOf()) { end = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.addWeeks)(endOfWeek, 1); } } // ensure 6 weeks if (this.props.monthMode && this.props.fixedWeekCount) { var rowCnt = Math.ceil(// could be partial weeks due to hiddenDays (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.diffWeeks)(start, end)); end = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.addWeeks)(end, 6 - rowCnt); } return { start: start, end: end }; }; return TableDateProfileGenerator; }(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.DateProfileGenerator)); var main = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createPlugin)({ initialView: 'dayGridMonth', views: { dayGrid: { component: DayTableView, dateProfileGeneratorClass: TableDateProfileGenerator, }, dayGridDay: { type: 'dayGrid', duration: { days: 1 }, }, dayGridWeek: { type: 'dayGrid', duration: { weeks: 1 }, }, dayGridMonth: { type: 'dayGrid', duration: { months: 1 }, monthMode: true, fixedWeekCount: true, }, }, }); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (main); //# sourceMappingURL=main.js.map /***/ }), /***/ "./node_modules/@fullcalendar/interaction/main.js": /*!********************************************************!*\ !*** ./node_modules/@fullcalendar/interaction/main.js ***! \********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "Draggable": () => (/* binding */ ExternalDraggable), /* harmony export */ "FeaturefulElementDragging": () => (/* binding */ FeaturefulElementDragging), /* harmony export */ "PointerDragging": () => (/* binding */ PointerDragging), /* harmony export */ "ThirdPartyDraggable": () => (/* binding */ ThirdPartyDraggable), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @fullcalendar/common */ "./node_modules/@fullcalendar/common/main.js"); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /*! FullCalendar v5.11.3 Docs & License: https://fullcalendar.io/ (c) 2022 Adam Shaw */ _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.config.touchMouseIgnoreWait = 500; var ignoreMouseDepth = 0; var listenerCnt = 0; var isWindowTouchMoveCancelled = false; /* Uses a "pointer" abstraction, which monitors UI events for both mouse and touch. Tracks when the pointer "drags" on a certain element, meaning down+move+up. Also, tracks if there was touch-scrolling. Also, can prevent touch-scrolling from happening. Also, can fire pointermove events when scrolling happens underneath, even when no real pointer movement. emits: - pointerdown - pointermove - pointerup */ var PointerDragging = /** @class */ (function () { function PointerDragging(containerEl) { var _this = this; this.subjectEl = null; // options that can be directly assigned by caller this.selector = ''; // will cause subjectEl in all emitted events to be this element this.handleSelector = ''; this.shouldIgnoreMove = false; this.shouldWatchScroll = true; // for simulating pointermove on scroll // internal states this.isDragging = false; this.isTouchDragging = false; this.wasTouchScroll = false; // Mouse // ---------------------------------------------------------------------------------------------------- this.handleMouseDown = function (ev) { if (!_this.shouldIgnoreMouse() && isPrimaryMouseButton(ev) && _this.tryStart(ev)) { var pev = _this.createEventFromMouse(ev, true); _this.emitter.trigger('pointerdown', pev); _this.initScrollWatch(pev); if (!_this.shouldIgnoreMove) { document.addEventListener('mousemove', _this.handleMouseMove); } document.addEventListener('mouseup', _this.handleMouseUp); } }; this.handleMouseMove = function (ev) { var pev = _this.createEventFromMouse(ev); _this.recordCoords(pev); _this.emitter.trigger('pointermove', pev); }; this.handleMouseUp = function (ev) { document.removeEventListener('mousemove', _this.handleMouseMove); document.removeEventListener('mouseup', _this.handleMouseUp); _this.emitter.trigger('pointerup', _this.createEventFromMouse(ev)); _this.cleanup(); // call last so that pointerup has access to props }; // Touch // ---------------------------------------------------------------------------------------------------- this.handleTouchStart = function (ev) { if (_this.tryStart(ev)) { _this.isTouchDragging = true; var pev = _this.createEventFromTouch(ev, true); _this.emitter.trigger('pointerdown', pev); _this.initScrollWatch(pev); // unlike mouse, need to attach to target, not document // https://stackoverflow.com/a/45760014 var targetEl = ev.target; if (!_this.shouldIgnoreMove) { targetEl.addEventListener('touchmove', _this.handleTouchMove); } targetEl.addEventListener('touchend', _this.handleTouchEnd); targetEl.addEventListener('touchcancel', _this.handleTouchEnd); // treat it as a touch end // attach a handler to get called when ANY scroll action happens on the page. // this was impossible to do with normal on/off because 'scroll' doesn't bubble. // http://stackoverflow.com/a/32954565/96342 window.addEventListener('scroll', _this.handleTouchScroll, true); } }; this.handleTouchMove = function (ev) { var pev = _this.createEventFromTouch(ev); _this.recordCoords(pev); _this.emitter.trigger('pointermove', pev); }; this.handleTouchEnd = function (ev) { if (_this.isDragging) { // done to guard against touchend followed by touchcancel var targetEl = ev.target; targetEl.removeEventListener('touchmove', _this.handleTouchMove); targetEl.removeEventListener('touchend', _this.handleTouchEnd); targetEl.removeEventListener('touchcancel', _this.handleTouchEnd); window.removeEventListener('scroll', _this.handleTouchScroll, true); // useCaptured=true _this.emitter.trigger('pointerup', _this.createEventFromTouch(ev)); _this.cleanup(); // call last so that pointerup has access to props _this.isTouchDragging = false; startIgnoringMouse(); } }; this.handleTouchScroll = function () { _this.wasTouchScroll = true; }; this.handleScroll = function (ev) { if (!_this.shouldIgnoreMove) { var pageX = (window.pageXOffset - _this.prevScrollX) + _this.prevPageX; var pageY = (window.pageYOffset - _this.prevScrollY) + _this.prevPageY; _this.emitter.trigger('pointermove', { origEvent: ev, isTouch: _this.isTouchDragging, subjectEl: _this.subjectEl, pageX: pageX, pageY: pageY, deltaX: pageX - _this.origPageX, deltaY: pageY - _this.origPageY, }); } }; this.containerEl = containerEl; this.emitter = new _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.Emitter(); containerEl.addEventListener('mousedown', this.handleMouseDown); containerEl.addEventListener('touchstart', this.handleTouchStart, { passive: true }); listenerCreated(); } PointerDragging.prototype.destroy = function () { this.containerEl.removeEventListener('mousedown', this.handleMouseDown); this.containerEl.removeEventListener('touchstart', this.handleTouchStart, { passive: true }); listenerDestroyed(); }; PointerDragging.prototype.tryStart = function (ev) { var subjectEl = this.querySubjectEl(ev); var downEl = ev.target; if (subjectEl && (!this.handleSelector || (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.elementClosest)(downEl, this.handleSelector))) { this.subjectEl = subjectEl; this.isDragging = true; // do this first so cancelTouchScroll will work this.wasTouchScroll = false; return true; } return false; }; PointerDragging.prototype.cleanup = function () { isWindowTouchMoveCancelled = false; this.isDragging = false; this.subjectEl = null; // keep wasTouchScroll around for later access this.destroyScrollWatch(); }; PointerDragging.prototype.querySubjectEl = function (ev) { if (this.selector) { return (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.elementClosest)(ev.target, this.selector); } return this.containerEl; }; PointerDragging.prototype.shouldIgnoreMouse = function () { return ignoreMouseDepth || this.isTouchDragging; }; // can be called by user of this class, to cancel touch-based scrolling for the current drag PointerDragging.prototype.cancelTouchScroll = function () { if (this.isDragging) { isWindowTouchMoveCancelled = true; } }; // Scrolling that simulates pointermoves // ---------------------------------------------------------------------------------------------------- PointerDragging.prototype.initScrollWatch = function (ev) { if (this.shouldWatchScroll) { this.recordCoords(ev); window.addEventListener('scroll', this.handleScroll, true); // useCapture=true } }; PointerDragging.prototype.recordCoords = function (ev) { if (this.shouldWatchScroll) { this.prevPageX = ev.pageX; this.prevPageY = ev.pageY; this.prevScrollX = window.pageXOffset; this.prevScrollY = window.pageYOffset; } }; PointerDragging.prototype.destroyScrollWatch = function () { if (this.shouldWatchScroll) { window.removeEventListener('scroll', this.handleScroll, true); // useCaptured=true } }; // Event Normalization // ---------------------------------------------------------------------------------------------------- PointerDragging.prototype.createEventFromMouse = function (ev, isFirst) { var deltaX = 0; var deltaY = 0; // TODO: repeat code if (isFirst) { this.origPageX = ev.pageX; this.origPageY = ev.pageY; } else { deltaX = ev.pageX - this.origPageX; deltaY = ev.pageY - this.origPageY; } return { origEvent: ev, isTouch: false, subjectEl: this.subjectEl, pageX: ev.pageX, pageY: ev.pageY, deltaX: deltaX, deltaY: deltaY, }; }; PointerDragging.prototype.createEventFromTouch = function (ev, isFirst) { var touches = ev.touches; var pageX; var pageY; var deltaX = 0; var deltaY = 0; // if touch coords available, prefer, // because FF would give bad ev.pageX ev.pageY if (touches && touches.length) { pageX = touches[0].pageX; pageY = touches[0].pageY; } else { pageX = ev.pageX; pageY = ev.pageY; } // TODO: repeat code if (isFirst) { this.origPageX = pageX; this.origPageY = pageY; } else { deltaX = pageX - this.origPageX; deltaY = pageY - this.origPageY; } return { origEvent: ev, isTouch: true, subjectEl: this.subjectEl, pageX: pageX, pageY: pageY, deltaX: deltaX, deltaY: deltaY, }; }; return PointerDragging; }()); // Returns a boolean whether this was a left mouse click and no ctrl key (which means right click on Mac) function isPrimaryMouseButton(ev) { return ev.button === 0 && !ev.ctrlKey; } // Ignoring fake mouse events generated by touch // ---------------------------------------------------------------------------------------------------- function startIgnoringMouse() { ignoreMouseDepth += 1; setTimeout(function () { ignoreMouseDepth -= 1; }, _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.config.touchMouseIgnoreWait); } // We want to attach touchmove as early as possible for Safari // ---------------------------------------------------------------------------------------------------- function listenerCreated() { listenerCnt += 1; if (listenerCnt === 1) { window.addEventListener('touchmove', onWindowTouchMove, { passive: false }); } } function listenerDestroyed() { listenerCnt -= 1; if (!listenerCnt) { window.removeEventListener('touchmove', onWindowTouchMove, { passive: false }); } } function onWindowTouchMove(ev) { if (isWindowTouchMoveCancelled) { ev.preventDefault(); } } /* An effect in which an element follows the movement of a pointer across the screen. The moving element is a clone of some other element. Must call start + handleMove + stop. */ var ElementMirror = /** @class */ (function () { function ElementMirror() { this.isVisible = false; // must be explicitly enabled this.sourceEl = null; this.mirrorEl = null; this.sourceElRect = null; // screen coords relative to viewport // options that can be set directly by caller this.parentNode = document.body; // HIGHLY SUGGESTED to set this to sidestep ShadowDOM issues this.zIndex = 9999; this.revertDuration = 0; } ElementMirror.prototype.start = function (sourceEl, pageX, pageY) { this.sourceEl = sourceEl; this.sourceElRect = this.sourceEl.getBoundingClientRect(); this.origScreenX = pageX - window.pageXOffset; this.origScreenY = pageY - window.pageYOffset; this.deltaX = 0; this.deltaY = 0; this.updateElPosition(); }; ElementMirror.prototype.handleMove = function (pageX, pageY) { this.deltaX = (pageX - window.pageXOffset) - this.origScreenX; this.deltaY = (pageY - window.pageYOffset) - this.origScreenY; this.updateElPosition(); }; // can be called before start ElementMirror.prototype.setIsVisible = function (bool) { if (bool) { if (!this.isVisible) { if (this.mirrorEl) { this.mirrorEl.style.display = ''; } this.isVisible = bool; // needs to happen before updateElPosition this.updateElPosition(); // because was not updating the position while invisible } } else if (this.isVisible) { if (this.mirrorEl) { this.mirrorEl.style.display = 'none'; } this.isVisible = bool; } }; // always async ElementMirror.prototype.stop = function (needsRevertAnimation, callback) { var _this = this; var done = function () { _this.cleanup(); callback(); }; if (needsRevertAnimation && this.mirrorEl && this.isVisible && this.revertDuration && // if 0, transition won't work (this.deltaX || this.deltaY) // if same coords, transition won't work ) { this.doRevertAnimation(done, this.revertDuration); } else { setTimeout(done, 0); } }; ElementMirror.prototype.doRevertAnimation = function (callback, revertDuration) { var mirrorEl = this.mirrorEl; var finalSourceElRect = this.sourceEl.getBoundingClientRect(); // because autoscrolling might have happened mirrorEl.style.transition = 'top ' + revertDuration + 'ms,' + 'left ' + revertDuration + 'ms'; (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.applyStyle)(mirrorEl, { left: finalSourceElRect.left, top: finalSourceElRect.top, }); (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.whenTransitionDone)(mirrorEl, function () { mirrorEl.style.transition = ''; callback(); }); }; ElementMirror.prototype.cleanup = function () { if (this.mirrorEl) { (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.removeElement)(this.mirrorEl); this.mirrorEl = null; } this.sourceEl = null; }; ElementMirror.prototype.updateElPosition = function () { if (this.sourceEl && this.isVisible) { (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.applyStyle)(this.getMirrorEl(), { left: this.sourceElRect.left + this.deltaX, top: this.sourceElRect.top + this.deltaY, }); } }; ElementMirror.prototype.getMirrorEl = function () { var sourceElRect = this.sourceElRect; var mirrorEl = this.mirrorEl; if (!mirrorEl) { mirrorEl = this.mirrorEl = this.sourceEl.cloneNode(true); // cloneChildren=true // we don't want long taps or any mouse interaction causing selection/menus. // would use preventSelection(), but that prevents selectstart, causing problems. mirrorEl.classList.add('fc-unselectable'); mirrorEl.classList.add('fc-event-dragging'); (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.applyStyle)(mirrorEl, { position: 'fixed', zIndex: this.zIndex, visibility: '', boxSizing: 'border-box', width: sourceElRect.right - sourceElRect.left, height: sourceElRect.bottom - sourceElRect.top, right: 'auto', bottom: 'auto', margin: 0, }); this.parentNode.appendChild(mirrorEl); } return mirrorEl; }; return ElementMirror; }()); /* Is a cache for a given element's scroll information (all the info that ScrollController stores) in addition the "client rectangle" of the element.. the area within the scrollbars. The cache can be in one of two modes: - doesListening:false - ignores when the container is scrolled by someone else - doesListening:true - watch for scrolling and update the cache */ var ScrollGeomCache = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__extends)(ScrollGeomCache, _super); function ScrollGeomCache(scrollController, doesListening) { var _this = _super.call(this) || this; _this.handleScroll = function () { _this.scrollTop = _this.scrollController.getScrollTop(); _this.scrollLeft = _this.scrollController.getScrollLeft(); _this.handleScrollChange(); }; _this.scrollController = scrollController; _this.doesListening = doesListening; _this.scrollTop = _this.origScrollTop = scrollController.getScrollTop(); _this.scrollLeft = _this.origScrollLeft = scrollController.getScrollLeft(); _this.scrollWidth = scrollController.getScrollWidth(); _this.scrollHeight = scrollController.getScrollHeight(); _this.clientWidth = scrollController.getClientWidth(); _this.clientHeight = scrollController.getClientHeight(); _this.clientRect = _this.computeClientRect(); // do last in case it needs cached values if (_this.doesListening) { _this.getEventTarget().addEventListener('scroll', _this.handleScroll); } return _this; } ScrollGeomCache.prototype.destroy = function () { if (this.doesListening) { this.getEventTarget().removeEventListener('scroll', this.handleScroll); } }; ScrollGeomCache.prototype.getScrollTop = function () { return this.scrollTop; }; ScrollGeomCache.prototype.getScrollLeft = function () { return this.scrollLeft; }; ScrollGeomCache.prototype.setScrollTop = function (top) { this.scrollController.setScrollTop(top); if (!this.doesListening) { // we are not relying on the element to normalize out-of-bounds scroll values // so we need to sanitize ourselves this.scrollTop = Math.max(Math.min(top, this.getMaxScrollTop()), 0); this.handleScrollChange(); } }; ScrollGeomCache.prototype.setScrollLeft = function (top) { this.scrollController.setScrollLeft(top); if (!this.doesListening) { // we are not relying on the element to normalize out-of-bounds scroll values // so we need to sanitize ourselves this.scrollLeft = Math.max(Math.min(top, this.getMaxScrollLeft()), 0); this.handleScrollChange(); } }; ScrollGeomCache.prototype.getClientWidth = function () { return this.clientWidth; }; ScrollGeomCache.prototype.getClientHeight = function () { return this.clientHeight; }; ScrollGeomCache.prototype.getScrollWidth = function () { return this.scrollWidth; }; ScrollGeomCache.prototype.getScrollHeight = function () { return this.scrollHeight; }; ScrollGeomCache.prototype.handleScrollChange = function () { }; return ScrollGeomCache; }(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.ScrollController)); var ElementScrollGeomCache = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__extends)(ElementScrollGeomCache, _super); function ElementScrollGeomCache(el, doesListening) { return _super.call(this, new _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.ElementScrollController(el), doesListening) || this; } ElementScrollGeomCache.prototype.getEventTarget = function () { return this.scrollController.el; }; ElementScrollGeomCache.prototype.computeClientRect = function () { return (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.computeInnerRect)(this.scrollController.el); }; return ElementScrollGeomCache; }(ScrollGeomCache)); var WindowScrollGeomCache = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__extends)(WindowScrollGeomCache, _super); function WindowScrollGeomCache(doesListening) { return _super.call(this, new _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.WindowScrollController(), doesListening) || this; } WindowScrollGeomCache.prototype.getEventTarget = function () { return window; }; WindowScrollGeomCache.prototype.computeClientRect = function () { return { left: this.scrollLeft, right: this.scrollLeft + this.clientWidth, top: this.scrollTop, bottom: this.scrollTop + this.clientHeight, }; }; // the window is the only scroll object that changes it's rectangle relative // to the document's topleft as it scrolls WindowScrollGeomCache.prototype.handleScrollChange = function () { this.clientRect = this.computeClientRect(); }; return WindowScrollGeomCache; }(ScrollGeomCache)); // If available we are using native "performance" API instead of "Date" // Read more about it on MDN: // https://developer.mozilla.org/en-US/docs/Web/API/Performance var getTime = typeof performance === 'function' ? performance.now : Date.now; /* For a pointer interaction, automatically scrolls certain scroll containers when the pointer approaches the edge. The caller must call start + handleMove + stop. */ var AutoScroller = /** @class */ (function () { function AutoScroller() { var _this = this; // options that can be set by caller this.isEnabled = true; this.scrollQuery = [window, '.fc-scroller']; this.edgeThreshold = 50; // pixels this.maxVelocity = 300; // pixels per second // internal state this.pointerScreenX = null; this.pointerScreenY = null; this.isAnimating = false; this.scrollCaches = null; // protect against the initial pointerdown being too close to an edge and starting the scroll this.everMovedUp = false; this.everMovedDown = false; this.everMovedLeft = false; this.everMovedRight = false; this.animate = function () { if (_this.isAnimating) { // wasn't cancelled between animation calls var edge = _this.computeBestEdge(_this.pointerScreenX + window.pageXOffset, _this.pointerScreenY + window.pageYOffset); if (edge) { var now = getTime(); _this.handleSide(edge, (now - _this.msSinceRequest) / 1000); _this.requestAnimation(now); } else { _this.isAnimating = false; // will stop animation } } }; } AutoScroller.prototype.start = function (pageX, pageY, scrollStartEl) { if (this.isEnabled) { this.scrollCaches = this.buildCaches(scrollStartEl); this.pointerScreenX = null; this.pointerScreenY = null; this.everMovedUp = false; this.everMovedDown = false; this.everMovedLeft = false; this.everMovedRight = false; this.handleMove(pageX, pageY); } }; AutoScroller.prototype.handleMove = function (pageX, pageY) { if (this.isEnabled) { var pointerScreenX = pageX - window.pageXOffset; var pointerScreenY = pageY - window.pageYOffset; var yDelta = this.pointerScreenY === null ? 0 : pointerScreenY - this.pointerScreenY; var xDelta = this.pointerScreenX === null ? 0 : pointerScreenX - this.pointerScreenX; if (yDelta < 0) { this.everMovedUp = true; } else if (yDelta > 0) { this.everMovedDown = true; } if (xDelta < 0) { this.everMovedLeft = true; } else if (xDelta > 0) { this.everMovedRight = true; } this.pointerScreenX = pointerScreenX; this.pointerScreenY = pointerScreenY; if (!this.isAnimating) { this.isAnimating = true; this.requestAnimation(getTime()); } } }; AutoScroller.prototype.stop = function () { if (this.isEnabled) { this.isAnimating = false; // will stop animation for (var _i = 0, _a = this.scrollCaches; _i < _a.length; _i++) { var scrollCache = _a[_i]; scrollCache.destroy(); } this.scrollCaches = null; } }; AutoScroller.prototype.requestAnimation = function (now) { this.msSinceRequest = now; requestAnimationFrame(this.animate); }; AutoScroller.prototype.handleSide = function (edge, seconds) { var scrollCache = edge.scrollCache; var edgeThreshold = this.edgeThreshold; var invDistance = edgeThreshold - edge.distance; var velocity = // the closer to the edge, the faster we scroll ((invDistance * invDistance) / (edgeThreshold * edgeThreshold)) * // quadratic this.maxVelocity * seconds; var sign = 1; switch (edge.name) { case 'left': sign = -1; // falls through case 'right': scrollCache.setScrollLeft(scrollCache.getScrollLeft() + velocity * sign); break; case 'top': sign = -1; // falls through case 'bottom': scrollCache.setScrollTop(scrollCache.getScrollTop() + velocity * sign); break; } }; // left/top are relative to document topleft AutoScroller.prototype.computeBestEdge = function (left, top) { var edgeThreshold = this.edgeThreshold; var bestSide = null; var scrollCaches = this.scrollCaches || []; for (var _i = 0, scrollCaches_1 = scrollCaches; _i < scrollCaches_1.length; _i++) { var scrollCache = scrollCaches_1[_i]; var rect = scrollCache.clientRect; var leftDist = left - rect.left; var rightDist = rect.right - left; var topDist = top - rect.top; var bottomDist = rect.bottom - top; // completely within the rect? if (leftDist >= 0 && rightDist >= 0 && topDist >= 0 && bottomDist >= 0) { if (topDist <= edgeThreshold && this.everMovedUp && scrollCache.canScrollUp() && (!bestSide || bestSide.distance > topDist)) { bestSide = { scrollCache: scrollCache, name: 'top', distance: topDist }; } if (bottomDist <= edgeThreshold && this.everMovedDown && scrollCache.canScrollDown() && (!bestSide || bestSide.distance > bottomDist)) { bestSide = { scrollCache: scrollCache, name: 'bottom', distance: bottomDist }; } if (leftDist <= edgeThreshold && this.everMovedLeft && scrollCache.canScrollLeft() && (!bestSide || bestSide.distance > leftDist)) { bestSide = { scrollCache: scrollCache, name: 'left', distance: leftDist }; } if (rightDist <= edgeThreshold && this.everMovedRight && scrollCache.canScrollRight() && (!bestSide || bestSide.distance > rightDist)) { bestSide = { scrollCache: scrollCache, name: 'right', distance: rightDist }; } } } return bestSide; }; AutoScroller.prototype.buildCaches = function (scrollStartEl) { return this.queryScrollEls(scrollStartEl).map(function (el) { if (el === window) { return new WindowScrollGeomCache(false); // false = don't listen to user-generated scrolls } return new ElementScrollGeomCache(el, false); // false = don't listen to user-generated scrolls }); }; AutoScroller.prototype.queryScrollEls = function (scrollStartEl) { var els = []; for (var _i = 0, _a = this.scrollQuery; _i < _a.length; _i++) { var query = _a[_i]; if (typeof query === 'object') { els.push(query); } else { els.push.apply(els, Array.prototype.slice.call((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.getElRoot)(scrollStartEl).querySelectorAll(query))); } } return els; }; return AutoScroller; }()); /* Monitors dragging on an element. Has a number of high-level features: - minimum distance required before dragging - minimum wait time ("delay") before dragging - a mirror element that follows the pointer */ var FeaturefulElementDragging = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__extends)(FeaturefulElementDragging, _super); function FeaturefulElementDragging(containerEl, selector) { var _this = _super.call(this, containerEl) || this; _this.containerEl = containerEl; // options that can be directly set by caller // the caller can also set the PointerDragging's options as well _this.delay = null; _this.minDistance = 0; _this.touchScrollAllowed = true; // prevents drag from starting and blocks scrolling during drag _this.mirrorNeedsRevert = false; _this.isInteracting = false; // is the user validly moving the pointer? lasts until pointerup _this.isDragging = false; // is it INTENTFULLY dragging? lasts until after revert animation _this.isDelayEnded = false; _this.isDistanceSurpassed = false; _this.delayTimeoutId = null; _this.onPointerDown = function (ev) { if (!_this.isDragging) { // so new drag doesn't happen while revert animation is going _this.isInteracting = true; _this.isDelayEnded = false; _this.isDistanceSurpassed = false; (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.preventSelection)(document.body); (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.preventContextMenu)(document.body); // prevent links from being visited if there's an eventual drag. // also prevents selection in older browsers (maybe?). // not necessary for touch, besides, browser would complain about passiveness. if (!ev.isTouch) { ev.origEvent.preventDefault(); } _this.emitter.trigger('pointerdown', ev); if (_this.isInteracting && // not destroyed via pointerdown handler !_this.pointer.shouldIgnoreMove) { // actions related to initiating dragstart+dragmove+dragend... _this.mirror.setIsVisible(false); // reset. caller must set-visible _this.mirror.start(ev.subjectEl, ev.pageX, ev.pageY); // must happen on first pointer down _this.startDelay(ev); if (!_this.minDistance) { _this.handleDistanceSurpassed(ev); } } } }; _this.onPointerMove = function (ev) { if (_this.isInteracting) { _this.emitter.trigger('pointermove', ev); if (!_this.isDistanceSurpassed) { var minDistance = _this.minDistance; var distanceSq = void 0; // current distance from the origin, squared var deltaX = ev.deltaX, deltaY = ev.deltaY; distanceSq = deltaX * deltaX + deltaY * deltaY; if (distanceSq >= minDistance * minDistance) { // use pythagorean theorem _this.handleDistanceSurpassed(ev); } } if (_this.isDragging) { // a real pointer move? (not one simulated by scrolling) if (ev.origEvent.type !== 'scroll') { _this.mirror.handleMove(ev.pageX, ev.pageY); _this.autoScroller.handleMove(ev.pageX, ev.pageY); } _this.emitter.trigger('dragmove', ev); } } }; _this.onPointerUp = function (ev) { if (_this.isInteracting) { _this.isInteracting = false; (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.allowSelection)(document.body); (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.allowContextMenu)(document.body); _this.emitter.trigger('pointerup', ev); // can potentially set mirrorNeedsRevert if (_this.isDragging) { _this.autoScroller.stop(); _this.tryStopDrag(ev); // which will stop the mirror } if (_this.delayTimeoutId) { clearTimeout(_this.delayTimeoutId); _this.delayTimeoutId = null; } } }; var pointer = _this.pointer = new PointerDragging(containerEl); pointer.emitter.on('pointerdown', _this.onPointerDown); pointer.emitter.on('pointermove', _this.onPointerMove); pointer.emitter.on('pointerup', _this.onPointerUp); if (selector) { pointer.selector = selector; } _this.mirror = new ElementMirror(); _this.autoScroller = new AutoScroller(); return _this; } FeaturefulElementDragging.prototype.destroy = function () { this.pointer.destroy(); // HACK: simulate a pointer-up to end the current drag // TODO: fire 'dragend' directly and stop interaction. discourage use of pointerup event (b/c might not fire) this.onPointerUp({}); }; FeaturefulElementDragging.prototype.startDelay = function (ev) { var _this = this; if (typeof this.delay === 'number') { this.delayTimeoutId = setTimeout(function () { _this.delayTimeoutId = null; _this.handleDelayEnd(ev); }, this.delay); // not assignable to number! } else { this.handleDelayEnd(ev); } }; FeaturefulElementDragging.prototype.handleDelayEnd = function (ev) { this.isDelayEnded = true; this.tryStartDrag(ev); }; FeaturefulElementDragging.prototype.handleDistanceSurpassed = function (ev) { this.isDistanceSurpassed = true; this.tryStartDrag(ev); }; FeaturefulElementDragging.prototype.tryStartDrag = function (ev) { if (this.isDelayEnded && this.isDistanceSurpassed) { if (!this.pointer.wasTouchScroll || this.touchScrollAllowed) { this.isDragging = true; this.mirrorNeedsRevert = false; this.autoScroller.start(ev.pageX, ev.pageY, this.containerEl); this.emitter.trigger('dragstart', ev); if (this.touchScrollAllowed === false) { this.pointer.cancelTouchScroll(); } } } }; FeaturefulElementDragging.prototype.tryStopDrag = function (ev) { // .stop() is ALWAYS asynchronous, which we NEED because we want all pointerup events // that come from the document to fire beforehand. much more convenient this way. this.mirror.stop(this.mirrorNeedsRevert, this.stopDrag.bind(this, ev)); }; FeaturefulElementDragging.prototype.stopDrag = function (ev) { this.isDragging = false; this.emitter.trigger('dragend', ev); }; // fill in the implementations... FeaturefulElementDragging.prototype.setIgnoreMove = function (bool) { this.pointer.shouldIgnoreMove = bool; }; FeaturefulElementDragging.prototype.setMirrorIsVisible = function (bool) { this.mirror.setIsVisible(bool); }; FeaturefulElementDragging.prototype.setMirrorNeedsRevert = function (bool) { this.mirrorNeedsRevert = bool; }; FeaturefulElementDragging.prototype.setAutoScrollEnabled = function (bool) { this.autoScroller.isEnabled = bool; }; return FeaturefulElementDragging; }(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.ElementDragging)); /* When this class is instantiated, it records the offset of an element (relative to the document topleft), and continues to monitor scrolling, updating the cached coordinates if it needs to. Does not access the DOM after instantiation, so highly performant. Also keeps track of all scrolling/overflow:hidden containers that are parents of the given element and an determine if a given point is inside the combined clipping rectangle. */ var OffsetTracker = /** @class */ (function () { function OffsetTracker(el) { this.origRect = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.computeRect)(el); // will work fine for divs that have overflow:hidden this.scrollCaches = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.getClippingParents)(el).map(function (scrollEl) { return new ElementScrollGeomCache(scrollEl, true); }); } OffsetTracker.prototype.destroy = function () { for (var _i = 0, _a = this.scrollCaches; _i < _a.length; _i++) { var scrollCache = _a[_i]; scrollCache.destroy(); } }; OffsetTracker.prototype.computeLeft = function () { var left = this.origRect.left; for (var _i = 0, _a = this.scrollCaches; _i < _a.length; _i++) { var scrollCache = _a[_i]; left += scrollCache.origScrollLeft - scrollCache.getScrollLeft(); } return left; }; OffsetTracker.prototype.computeTop = function () { var top = this.origRect.top; for (var _i = 0, _a = this.scrollCaches; _i < _a.length; _i++) { var scrollCache = _a[_i]; top += scrollCache.origScrollTop - scrollCache.getScrollTop(); } return top; }; OffsetTracker.prototype.isWithinClipping = function (pageX, pageY) { var point = { left: pageX, top: pageY }; for (var _i = 0, _a = this.scrollCaches; _i < _a.length; _i++) { var scrollCache = _a[_i]; if (!isIgnoredClipping(scrollCache.getEventTarget()) && !(0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.pointInsideRect)(point, scrollCache.clientRect)) { return false; } } return true; }; return OffsetTracker; }()); // certain clipping containers should never constrain interactions, like and // https://github.com/fullcalendar/fullcalendar/issues/3615 function isIgnoredClipping(node) { var tagName = node.tagName; return tagName === 'HTML' || tagName === 'BODY'; } /* Tracks movement over multiple droppable areas (aka "hits") that exist in one or more DateComponents. Relies on an existing draggable. emits: - pointerdown - dragstart - hitchange - fires initially, even if not over a hit - pointerup - (hitchange - again, to null, if ended over a hit) - dragend */ var HitDragging = /** @class */ (function () { function HitDragging(dragging, droppableStore) { var _this = this; // options that can be set by caller this.useSubjectCenter = false; this.requireInitial = true; // if doesn't start out on a hit, won't emit any events this.initialHit = null; this.movingHit = null; this.finalHit = null; // won't ever be populated if shouldIgnoreMove this.handlePointerDown = function (ev) { var dragging = _this.dragging; _this.initialHit = null; _this.movingHit = null; _this.finalHit = null; _this.prepareHits(); _this.processFirstCoord(ev); if (_this.initialHit || !_this.requireInitial) { dragging.setIgnoreMove(false); // TODO: fire this before computing processFirstCoord, so listeners can cancel. this gets fired by almost every handler :( _this.emitter.trigger('pointerdown', ev); } else { dragging.setIgnoreMove(true); } }; this.handleDragStart = function (ev) { _this.emitter.trigger('dragstart', ev); _this.handleMove(ev, true); // force = fire even if initially null }; this.handleDragMove = function (ev) { _this.emitter.trigger('dragmove', ev); _this.handleMove(ev); }; this.handlePointerUp = function (ev) { _this.releaseHits(); _this.emitter.trigger('pointerup', ev); }; this.handleDragEnd = function (ev) { if (_this.movingHit) { _this.emitter.trigger('hitupdate', null, true, ev); } _this.finalHit = _this.movingHit; _this.movingHit = null; _this.emitter.trigger('dragend', ev); }; this.droppableStore = droppableStore; dragging.emitter.on('pointerdown', this.handlePointerDown); dragging.emitter.on('dragstart', this.handleDragStart); dragging.emitter.on('dragmove', this.handleDragMove); dragging.emitter.on('pointerup', this.handlePointerUp); dragging.emitter.on('dragend', this.handleDragEnd); this.dragging = dragging; this.emitter = new _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.Emitter(); } // sets initialHit // sets coordAdjust HitDragging.prototype.processFirstCoord = function (ev) { var origPoint = { left: ev.pageX, top: ev.pageY }; var adjustedPoint = origPoint; var subjectEl = ev.subjectEl; var subjectRect; if (subjectEl instanceof HTMLElement) { // i.e. not a Document/ShadowRoot subjectRect = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.computeRect)(subjectEl); adjustedPoint = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.constrainPoint)(adjustedPoint, subjectRect); } var initialHit = this.initialHit = this.queryHitForOffset(adjustedPoint.left, adjustedPoint.top); if (initialHit) { if (this.useSubjectCenter && subjectRect) { var slicedSubjectRect = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.intersectRects)(subjectRect, initialHit.rect); if (slicedSubjectRect) { adjustedPoint = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.getRectCenter)(slicedSubjectRect); } } this.coordAdjust = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.diffPoints)(adjustedPoint, origPoint); } else { this.coordAdjust = { left: 0, top: 0 }; } }; HitDragging.prototype.handleMove = function (ev, forceHandle) { var hit = this.queryHitForOffset(ev.pageX + this.coordAdjust.left, ev.pageY + this.coordAdjust.top); if (forceHandle || !isHitsEqual(this.movingHit, hit)) { this.movingHit = hit; this.emitter.trigger('hitupdate', hit, false, ev); } }; HitDragging.prototype.prepareHits = function () { this.offsetTrackers = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.mapHash)(this.droppableStore, function (interactionSettings) { interactionSettings.component.prepareHits(); return new OffsetTracker(interactionSettings.el); }); }; HitDragging.prototype.releaseHits = function () { var offsetTrackers = this.offsetTrackers; for (var id in offsetTrackers) { offsetTrackers[id].destroy(); } this.offsetTrackers = {}; }; HitDragging.prototype.queryHitForOffset = function (offsetLeft, offsetTop) { var _a = this, droppableStore = _a.droppableStore, offsetTrackers = _a.offsetTrackers; var bestHit = null; for (var id in droppableStore) { var component = droppableStore[id].component; var offsetTracker = offsetTrackers[id]; if (offsetTracker && // wasn't destroyed mid-drag offsetTracker.isWithinClipping(offsetLeft, offsetTop)) { var originLeft = offsetTracker.computeLeft(); var originTop = offsetTracker.computeTop(); var positionLeft = offsetLeft - originLeft; var positionTop = offsetTop - originTop; var origRect = offsetTracker.origRect; var width = origRect.right - origRect.left; var height = origRect.bottom - origRect.top; if ( // must be within the element's bounds positionLeft >= 0 && positionLeft < width && positionTop >= 0 && positionTop < height) { var hit = component.queryHit(positionLeft, positionTop, width, height); if (hit && ( // make sure the hit is within activeRange, meaning it's not a dead cell (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.rangeContainsRange)(hit.dateProfile.activeRange, hit.dateSpan.range)) && (!bestHit || hit.layer > bestHit.layer)) { hit.componentId = id; hit.context = component.context; // TODO: better way to re-orient rectangle hit.rect.left += originLeft; hit.rect.right += originLeft; hit.rect.top += originTop; hit.rect.bottom += originTop; bestHit = hit; } } } } return bestHit; }; return HitDragging; }()); function isHitsEqual(hit0, hit1) { if (!hit0 && !hit1) { return true; } if (Boolean(hit0) !== Boolean(hit1)) { return false; } return (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.isDateSpansEqual)(hit0.dateSpan, hit1.dateSpan); } function buildDatePointApiWithContext(dateSpan, context) { var props = {}; for (var _i = 0, _a = context.pluginHooks.datePointTransforms; _i < _a.length; _i++) { var transform = _a[_i]; (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)(props, transform(dateSpan, context)); } (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)(props, buildDatePointApi(dateSpan, context.dateEnv)); return props; } function buildDatePointApi(span, dateEnv) { return { date: dateEnv.toDate(span.range.start), dateStr: dateEnv.formatIso(span.range.start, { omitTime: span.allDay }), allDay: span.allDay, }; } /* Monitors when the user clicks on a specific date/time of a component. A pointerdown+pointerup on the same "hit" constitutes a click. */ var DateClicking = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__extends)(DateClicking, _super); function DateClicking(settings) { var _this = _super.call(this, settings) || this; _this.handlePointerDown = function (pev) { var dragging = _this.dragging; var downEl = pev.origEvent.target; // do this in pointerdown (not dragend) because DOM might be mutated by the time dragend is fired dragging.setIgnoreMove(!_this.component.isValidDateDownEl(downEl)); }; // won't even fire if moving was ignored _this.handleDragEnd = function (ev) { var component = _this.component; var pointer = _this.dragging.pointer; if (!pointer.wasTouchScroll) { var _a = _this.hitDragging, initialHit = _a.initialHit, finalHit = _a.finalHit; if (initialHit && finalHit && isHitsEqual(initialHit, finalHit)) { var context = component.context; var arg = (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)({}, buildDatePointApiWithContext(initialHit.dateSpan, context)), { dayEl: initialHit.dayEl, jsEvent: ev.origEvent, view: context.viewApi || context.calendarApi.view }); context.emitter.trigger('dateClick', arg); } } }; // we DO want to watch pointer moves because otherwise finalHit won't get populated _this.dragging = new FeaturefulElementDragging(settings.el); _this.dragging.autoScroller.isEnabled = false; var hitDragging = _this.hitDragging = new HitDragging(_this.dragging, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.interactionSettingsToStore)(settings)); hitDragging.emitter.on('pointerdown', _this.handlePointerDown); hitDragging.emitter.on('dragend', _this.handleDragEnd); return _this; } DateClicking.prototype.destroy = function () { this.dragging.destroy(); }; return DateClicking; }(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.Interaction)); /* Tracks when the user selects a portion of time of a component, constituted by a drag over date cells, with a possible delay at the beginning of the drag. */ var DateSelecting = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__extends)(DateSelecting, _super); function DateSelecting(settings) { var _this = _super.call(this, settings) || this; _this.dragSelection = null; _this.handlePointerDown = function (ev) { var _a = _this, component = _a.component, dragging = _a.dragging; var options = component.context.options; var canSelect = options.selectable && component.isValidDateDownEl(ev.origEvent.target); // don't bother to watch expensive moves if component won't do selection dragging.setIgnoreMove(!canSelect); // if touch, require user to hold down dragging.delay = ev.isTouch ? getComponentTouchDelay$1(component) : null; }; _this.handleDragStart = function (ev) { _this.component.context.calendarApi.unselect(ev); // unselect previous selections }; _this.handleHitUpdate = function (hit, isFinal) { var context = _this.component.context; var dragSelection = null; var isInvalid = false; if (hit) { var initialHit = _this.hitDragging.initialHit; var disallowed = hit.componentId === initialHit.componentId && _this.isHitComboAllowed && !_this.isHitComboAllowed(initialHit, hit); if (!disallowed) { dragSelection = joinHitsIntoSelection(initialHit, hit, context.pluginHooks.dateSelectionTransformers); } if (!dragSelection || !(0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.isDateSelectionValid)(dragSelection, hit.dateProfile, context)) { isInvalid = true; dragSelection = null; } } if (dragSelection) { context.dispatch({ type: 'SELECT_DATES', selection: dragSelection }); } else if (!isFinal) { // only unselect if moved away while dragging context.dispatch({ type: 'UNSELECT_DATES' }); } if (!isInvalid) { (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.enableCursor)(); } else { (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.disableCursor)(); } if (!isFinal) { _this.dragSelection = dragSelection; // only clear if moved away from all hits while dragging } }; _this.handlePointerUp = function (pev) { if (_this.dragSelection) { // selection is already rendered, so just need to report selection (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.triggerDateSelect)(_this.dragSelection, pev, _this.component.context); _this.dragSelection = null; } }; var component = settings.component; var options = component.context.options; var dragging = _this.dragging = new FeaturefulElementDragging(settings.el); dragging.touchScrollAllowed = false; dragging.minDistance = options.selectMinDistance || 0; dragging.autoScroller.isEnabled = options.dragScroll; var hitDragging = _this.hitDragging = new HitDragging(_this.dragging, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.interactionSettingsToStore)(settings)); hitDragging.emitter.on('pointerdown', _this.handlePointerDown); hitDragging.emitter.on('dragstart', _this.handleDragStart); hitDragging.emitter.on('hitupdate', _this.handleHitUpdate); hitDragging.emitter.on('pointerup', _this.handlePointerUp); return _this; } DateSelecting.prototype.destroy = function () { this.dragging.destroy(); }; return DateSelecting; }(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.Interaction)); function getComponentTouchDelay$1(component) { var options = component.context.options; var delay = options.selectLongPressDelay; if (delay == null) { delay = options.longPressDelay; } return delay; } function joinHitsIntoSelection(hit0, hit1, dateSelectionTransformers) { var dateSpan0 = hit0.dateSpan; var dateSpan1 = hit1.dateSpan; var ms = [ dateSpan0.range.start, dateSpan0.range.end, dateSpan1.range.start, dateSpan1.range.end, ]; ms.sort(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.compareNumbers); var props = {}; for (var _i = 0, dateSelectionTransformers_1 = dateSelectionTransformers; _i < dateSelectionTransformers_1.length; _i++) { var transformer = dateSelectionTransformers_1[_i]; var res = transformer(hit0, hit1); if (res === false) { return null; } if (res) { (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)(props, res); } } props.range = { start: ms[0], end: ms[3] }; props.allDay = dateSpan0.allDay; return props; } var EventDragging = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__extends)(EventDragging, _super); function EventDragging(settings) { var _this = _super.call(this, settings) || this; // internal state _this.subjectEl = null; _this.subjectSeg = null; // the seg being selected/dragged _this.isDragging = false; _this.eventRange = null; _this.relevantEvents = null; // the events being dragged _this.receivingContext = null; _this.validMutation = null; _this.mutatedRelevantEvents = null; _this.handlePointerDown = function (ev) { var origTarget = ev.origEvent.target; var _a = _this, component = _a.component, dragging = _a.dragging; var mirror = dragging.mirror; var options = component.context.options; var initialContext = component.context; _this.subjectEl = ev.subjectEl; var subjectSeg = _this.subjectSeg = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.getElSeg)(ev.subjectEl); var eventRange = _this.eventRange = subjectSeg.eventRange; var eventInstanceId = eventRange.instance.instanceId; _this.relevantEvents = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.getRelevantEvents)(initialContext.getCurrentData().eventStore, eventInstanceId); dragging.minDistance = ev.isTouch ? 0 : options.eventDragMinDistance; dragging.delay = // only do a touch delay if touch and this event hasn't been selected yet (ev.isTouch && eventInstanceId !== component.props.eventSelection) ? getComponentTouchDelay(component) : null; if (options.fixedMirrorParent) { mirror.parentNode = options.fixedMirrorParent; } else { mirror.parentNode = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.elementClosest)(origTarget, '.fc'); } mirror.revertDuration = options.dragRevertDuration; var isValid = component.isValidSegDownEl(origTarget) && !(0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.elementClosest)(origTarget, '.fc-event-resizer'); // NOT on a resizer dragging.setIgnoreMove(!isValid); // disable dragging for elements that are resizable (ie, selectable) // but are not draggable _this.isDragging = isValid && ev.subjectEl.classList.contains('fc-event-draggable'); }; _this.handleDragStart = function (ev) { var initialContext = _this.component.context; var eventRange = _this.eventRange; var eventInstanceId = eventRange.instance.instanceId; if (ev.isTouch) { // need to select a different event? if (eventInstanceId !== _this.component.props.eventSelection) { initialContext.dispatch({ type: 'SELECT_EVENT', eventInstanceId: eventInstanceId }); } } else { // if now using mouse, but was previous touch interaction, clear selected event initialContext.dispatch({ type: 'UNSELECT_EVENT' }); } if (_this.isDragging) { initialContext.calendarApi.unselect(ev); // unselect *date* selection initialContext.emitter.trigger('eventDragStart', { el: _this.subjectEl, event: new _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.EventApi(initialContext, eventRange.def, eventRange.instance), jsEvent: ev.origEvent, view: initialContext.viewApi, }); } }; _this.handleHitUpdate = function (hit, isFinal) { if (!_this.isDragging) { return; } var relevantEvents = _this.relevantEvents; var initialHit = _this.hitDragging.initialHit; var initialContext = _this.component.context; // states based on new hit var receivingContext = null; var mutation = null; var mutatedRelevantEvents = null; var isInvalid = false; var interaction = { affectedEvents: relevantEvents, mutatedEvents: (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.createEmptyEventStore)(), isEvent: true, }; if (hit) { receivingContext = hit.context; var receivingOptions = receivingContext.options; if (initialContext === receivingContext || (receivingOptions.editable && receivingOptions.droppable)) { mutation = computeEventMutation(initialHit, hit, receivingContext.getCurrentData().pluginHooks.eventDragMutationMassagers); if (mutation) { mutatedRelevantEvents = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.applyMutationToEventStore)(relevantEvents, receivingContext.getCurrentData().eventUiBases, mutation, receivingContext); interaction.mutatedEvents = mutatedRelevantEvents; if (!(0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.isInteractionValid)(interaction, hit.dateProfile, receivingContext)) { isInvalid = true; mutation = null; mutatedRelevantEvents = null; interaction.mutatedEvents = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.createEmptyEventStore)(); } } } else { receivingContext = null; } } _this.displayDrag(receivingContext, interaction); if (!isInvalid) { (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.enableCursor)(); } else { (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.disableCursor)(); } if (!isFinal) { if (initialContext === receivingContext && // TODO: write test for this isHitsEqual(initialHit, hit)) { mutation = null; } _this.dragging.setMirrorNeedsRevert(!mutation); // render the mirror if no already-rendered mirror // TODO: wish we could somehow wait for dispatch to guarantee render _this.dragging.setMirrorIsVisible(!hit || !(0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.getElRoot)(_this.subjectEl).querySelector('.fc-event-mirror')); // assign states based on new hit _this.receivingContext = receivingContext; _this.validMutation = mutation; _this.mutatedRelevantEvents = mutatedRelevantEvents; } }; _this.handlePointerUp = function () { if (!_this.isDragging) { _this.cleanup(); // because handleDragEnd won't fire } }; _this.handleDragEnd = function (ev) { if (_this.isDragging) { var initialContext_1 = _this.component.context; var initialView = initialContext_1.viewApi; var _a = _this, receivingContext_1 = _a.receivingContext, validMutation = _a.validMutation; var eventDef = _this.eventRange.def; var eventInstance = _this.eventRange.instance; var eventApi = new _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.EventApi(initialContext_1, eventDef, eventInstance); var relevantEvents_1 = _this.relevantEvents; var mutatedRelevantEvents_1 = _this.mutatedRelevantEvents; var finalHit = _this.hitDragging.finalHit; _this.clearDrag(); // must happen after revert animation initialContext_1.emitter.trigger('eventDragStop', { el: _this.subjectEl, event: eventApi, jsEvent: ev.origEvent, view: initialView, }); if (validMutation) { // dropped within same calendar if (receivingContext_1 === initialContext_1) { var updatedEventApi = new _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.EventApi(initialContext_1, mutatedRelevantEvents_1.defs[eventDef.defId], eventInstance ? mutatedRelevantEvents_1.instances[eventInstance.instanceId] : null); initialContext_1.dispatch({ type: 'MERGE_EVENTS', eventStore: mutatedRelevantEvents_1, }); var eventChangeArg = { oldEvent: eventApi, event: updatedEventApi, relatedEvents: (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.buildEventApis)(mutatedRelevantEvents_1, initialContext_1, eventInstance), revert: function () { initialContext_1.dispatch({ type: 'MERGE_EVENTS', eventStore: relevantEvents_1, // the pre-change data }); }, }; var transformed = {}; for (var _i = 0, _b = initialContext_1.getCurrentData().pluginHooks.eventDropTransformers; _i < _b.length; _i++) { var transformer = _b[_i]; (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)(transformed, transformer(validMutation, initialContext_1)); } initialContext_1.emitter.trigger('eventDrop', (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)({}, eventChangeArg), transformed), { el: ev.subjectEl, delta: validMutation.datesDelta, jsEvent: ev.origEvent, view: initialView })); initialContext_1.emitter.trigger('eventChange', eventChangeArg); // dropped in different calendar } else if (receivingContext_1) { var eventRemoveArg = { event: eventApi, relatedEvents: (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.buildEventApis)(relevantEvents_1, initialContext_1, eventInstance), revert: function () { initialContext_1.dispatch({ type: 'MERGE_EVENTS', eventStore: relevantEvents_1, }); }, }; initialContext_1.emitter.trigger('eventLeave', (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)({}, eventRemoveArg), { draggedEl: ev.subjectEl, view: initialView })); initialContext_1.dispatch({ type: 'REMOVE_EVENTS', eventStore: relevantEvents_1, }); initialContext_1.emitter.trigger('eventRemove', eventRemoveArg); var addedEventDef = mutatedRelevantEvents_1.defs[eventDef.defId]; var addedEventInstance = mutatedRelevantEvents_1.instances[eventInstance.instanceId]; var addedEventApi = new _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.EventApi(receivingContext_1, addedEventDef, addedEventInstance); receivingContext_1.dispatch({ type: 'MERGE_EVENTS', eventStore: mutatedRelevantEvents_1, }); var eventAddArg = { event: addedEventApi, relatedEvents: (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.buildEventApis)(mutatedRelevantEvents_1, receivingContext_1, addedEventInstance), revert: function () { receivingContext_1.dispatch({ type: 'REMOVE_EVENTS', eventStore: mutatedRelevantEvents_1, }); }, }; receivingContext_1.emitter.trigger('eventAdd', eventAddArg); if (ev.isTouch) { receivingContext_1.dispatch({ type: 'SELECT_EVENT', eventInstanceId: eventInstance.instanceId, }); } receivingContext_1.emitter.trigger('drop', (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)({}, buildDatePointApiWithContext(finalHit.dateSpan, receivingContext_1)), { draggedEl: ev.subjectEl, jsEvent: ev.origEvent, view: finalHit.context.viewApi })); receivingContext_1.emitter.trigger('eventReceive', (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)({}, eventAddArg), { draggedEl: ev.subjectEl, view: finalHit.context.viewApi })); } } else { initialContext_1.emitter.trigger('_noEventDrop'); } } _this.cleanup(); }; var component = _this.component; var options = component.context.options; var dragging = _this.dragging = new FeaturefulElementDragging(settings.el); dragging.pointer.selector = EventDragging.SELECTOR; dragging.touchScrollAllowed = false; dragging.autoScroller.isEnabled = options.dragScroll; var hitDragging = _this.hitDragging = new HitDragging(_this.dragging, _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.interactionSettingsStore); hitDragging.useSubjectCenter = settings.useEventCenter; hitDragging.emitter.on('pointerdown', _this.handlePointerDown); hitDragging.emitter.on('dragstart', _this.handleDragStart); hitDragging.emitter.on('hitupdate', _this.handleHitUpdate); hitDragging.emitter.on('pointerup', _this.handlePointerUp); hitDragging.emitter.on('dragend', _this.handleDragEnd); return _this; } EventDragging.prototype.destroy = function () { this.dragging.destroy(); }; // render a drag state on the next receivingCalendar EventDragging.prototype.displayDrag = function (nextContext, state) { var initialContext = this.component.context; var prevContext = this.receivingContext; // does the previous calendar need to be cleared? if (prevContext && prevContext !== nextContext) { // does the initial calendar need to be cleared? // if so, don't clear all the way. we still need to to hide the affectedEvents if (prevContext === initialContext) { prevContext.dispatch({ type: 'SET_EVENT_DRAG', state: { affectedEvents: state.affectedEvents, mutatedEvents: (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.createEmptyEventStore)(), isEvent: true, }, }); // completely clear the old calendar if it wasn't the initial } else { prevContext.dispatch({ type: 'UNSET_EVENT_DRAG' }); } } if (nextContext) { nextContext.dispatch({ type: 'SET_EVENT_DRAG', state: state }); } }; EventDragging.prototype.clearDrag = function () { var initialCalendar = this.component.context; var receivingContext = this.receivingContext; if (receivingContext) { receivingContext.dispatch({ type: 'UNSET_EVENT_DRAG' }); } // the initial calendar might have an dummy drag state from displayDrag if (initialCalendar !== receivingContext) { initialCalendar.dispatch({ type: 'UNSET_EVENT_DRAG' }); } }; EventDragging.prototype.cleanup = function () { this.subjectSeg = null; this.isDragging = false; this.eventRange = null; this.relevantEvents = null; this.receivingContext = null; this.validMutation = null; this.mutatedRelevantEvents = null; }; // TODO: test this in IE11 // QUESTION: why do we need it on the resizable??? EventDragging.SELECTOR = '.fc-event-draggable, .fc-event-resizable'; return EventDragging; }(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.Interaction)); function computeEventMutation(hit0, hit1, massagers) { var dateSpan0 = hit0.dateSpan; var dateSpan1 = hit1.dateSpan; var date0 = dateSpan0.range.start; var date1 = dateSpan1.range.start; var standardProps = {}; if (dateSpan0.allDay !== dateSpan1.allDay) { standardProps.allDay = dateSpan1.allDay; standardProps.hasEnd = hit1.context.options.allDayMaintainDuration; if (dateSpan1.allDay) { // means date1 is already start-of-day, // but date0 needs to be converted date0 = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.startOfDay)(date0); } } var delta = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.diffDates)(date0, date1, hit0.context.dateEnv, hit0.componentId === hit1.componentId ? hit0.largeUnit : null); if (delta.milliseconds) { // has hours/minutes/seconds standardProps.allDay = false; } var mutation = { datesDelta: delta, standardProps: standardProps, }; for (var _i = 0, massagers_1 = massagers; _i < massagers_1.length; _i++) { var massager = massagers_1[_i]; massager(mutation, hit0, hit1); } return mutation; } function getComponentTouchDelay(component) { var options = component.context.options; var delay = options.eventLongPressDelay; if (delay == null) { delay = options.longPressDelay; } return delay; } var EventResizing = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__extends)(EventResizing, _super); function EventResizing(settings) { var _this = _super.call(this, settings) || this; // internal state _this.draggingSegEl = null; _this.draggingSeg = null; // TODO: rename to resizingSeg? subjectSeg? _this.eventRange = null; _this.relevantEvents = null; _this.validMutation = null; _this.mutatedRelevantEvents = null; _this.handlePointerDown = function (ev) { var component = _this.component; var segEl = _this.querySegEl(ev); var seg = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.getElSeg)(segEl); var eventRange = _this.eventRange = seg.eventRange; _this.dragging.minDistance = component.context.options.eventDragMinDistance; // if touch, need to be working with a selected event _this.dragging.setIgnoreMove(!_this.component.isValidSegDownEl(ev.origEvent.target) || (ev.isTouch && _this.component.props.eventSelection !== eventRange.instance.instanceId)); }; _this.handleDragStart = function (ev) { var context = _this.component.context; var eventRange = _this.eventRange; _this.relevantEvents = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.getRelevantEvents)(context.getCurrentData().eventStore, _this.eventRange.instance.instanceId); var segEl = _this.querySegEl(ev); _this.draggingSegEl = segEl; _this.draggingSeg = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.getElSeg)(segEl); context.calendarApi.unselect(); context.emitter.trigger('eventResizeStart', { el: segEl, event: new _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.EventApi(context, eventRange.def, eventRange.instance), jsEvent: ev.origEvent, view: context.viewApi, }); }; _this.handleHitUpdate = function (hit, isFinal, ev) { var context = _this.component.context; var relevantEvents = _this.relevantEvents; var initialHit = _this.hitDragging.initialHit; var eventInstance = _this.eventRange.instance; var mutation = null; var mutatedRelevantEvents = null; var isInvalid = false; var interaction = { affectedEvents: relevantEvents, mutatedEvents: (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.createEmptyEventStore)(), isEvent: true, }; if (hit) { var disallowed = hit.componentId === initialHit.componentId && _this.isHitComboAllowed && !_this.isHitComboAllowed(initialHit, hit); if (!disallowed) { mutation = computeMutation(initialHit, hit, ev.subjectEl.classList.contains('fc-event-resizer-start'), eventInstance.range); } } if (mutation) { mutatedRelevantEvents = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.applyMutationToEventStore)(relevantEvents, context.getCurrentData().eventUiBases, mutation, context); interaction.mutatedEvents = mutatedRelevantEvents; if (!(0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.isInteractionValid)(interaction, hit.dateProfile, context)) { isInvalid = true; mutation = null; mutatedRelevantEvents = null; interaction.mutatedEvents = null; } } if (mutatedRelevantEvents) { context.dispatch({ type: 'SET_EVENT_RESIZE', state: interaction, }); } else { context.dispatch({ type: 'UNSET_EVENT_RESIZE' }); } if (!isInvalid) { (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.enableCursor)(); } else { (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.disableCursor)(); } if (!isFinal) { if (mutation && isHitsEqual(initialHit, hit)) { mutation = null; } _this.validMutation = mutation; _this.mutatedRelevantEvents = mutatedRelevantEvents; } }; _this.handleDragEnd = function (ev) { var context = _this.component.context; var eventDef = _this.eventRange.def; var eventInstance = _this.eventRange.instance; var eventApi = new _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.EventApi(context, eventDef, eventInstance); var relevantEvents = _this.relevantEvents; var mutatedRelevantEvents = _this.mutatedRelevantEvents; context.emitter.trigger('eventResizeStop', { el: _this.draggingSegEl, event: eventApi, jsEvent: ev.origEvent, view: context.viewApi, }); if (_this.validMutation) { var updatedEventApi = new _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.EventApi(context, mutatedRelevantEvents.defs[eventDef.defId], eventInstance ? mutatedRelevantEvents.instances[eventInstance.instanceId] : null); context.dispatch({ type: 'MERGE_EVENTS', eventStore: mutatedRelevantEvents, }); var eventChangeArg = { oldEvent: eventApi, event: updatedEventApi, relatedEvents: (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.buildEventApis)(mutatedRelevantEvents, context, eventInstance), revert: function () { context.dispatch({ type: 'MERGE_EVENTS', eventStore: relevantEvents, // the pre-change events }); }, }; context.emitter.trigger('eventResize', (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)({}, eventChangeArg), { el: _this.draggingSegEl, startDelta: _this.validMutation.startDelta || (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.createDuration)(0), endDelta: _this.validMutation.endDelta || (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.createDuration)(0), jsEvent: ev.origEvent, view: context.viewApi })); context.emitter.trigger('eventChange', eventChangeArg); } else { context.emitter.trigger('_noEventResize'); } // reset all internal state _this.draggingSeg = null; _this.relevantEvents = null; _this.validMutation = null; // okay to keep eventInstance around. useful to set it in handlePointerDown }; var component = settings.component; var dragging = _this.dragging = new FeaturefulElementDragging(settings.el); dragging.pointer.selector = '.fc-event-resizer'; dragging.touchScrollAllowed = false; dragging.autoScroller.isEnabled = component.context.options.dragScroll; var hitDragging = _this.hitDragging = new HitDragging(_this.dragging, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.interactionSettingsToStore)(settings)); hitDragging.emitter.on('pointerdown', _this.handlePointerDown); hitDragging.emitter.on('dragstart', _this.handleDragStart); hitDragging.emitter.on('hitupdate', _this.handleHitUpdate); hitDragging.emitter.on('dragend', _this.handleDragEnd); return _this; } EventResizing.prototype.destroy = function () { this.dragging.destroy(); }; EventResizing.prototype.querySegEl = function (ev) { return (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.elementClosest)(ev.subjectEl, '.fc-event'); }; return EventResizing; }(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.Interaction)); function computeMutation(hit0, hit1, isFromStart, instanceRange) { var dateEnv = hit0.context.dateEnv; var date0 = hit0.dateSpan.range.start; var date1 = hit1.dateSpan.range.start; var delta = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.diffDates)(date0, date1, dateEnv, hit0.largeUnit); if (isFromStart) { if (dateEnv.add(instanceRange.start, delta) < instanceRange.end) { return { startDelta: delta }; } } else if (dateEnv.add(instanceRange.end, delta) > instanceRange.start) { return { endDelta: delta }; } return null; } var UnselectAuto = /** @class */ (function () { function UnselectAuto(context) { var _this = this; this.context = context; this.isRecentPointerDateSelect = false; // wish we could use a selector to detect date selection, but uses hit system this.matchesCancel = false; this.matchesEvent = false; this.onSelect = function (selectInfo) { if (selectInfo.jsEvent) { _this.isRecentPointerDateSelect = true; } }; this.onDocumentPointerDown = function (pev) { var unselectCancel = _this.context.options.unselectCancel; var downEl = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.getEventTargetViaRoot)(pev.origEvent); _this.matchesCancel = !!(0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.elementClosest)(downEl, unselectCancel); _this.matchesEvent = !!(0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.elementClosest)(downEl, EventDragging.SELECTOR); // interaction started on an event? }; this.onDocumentPointerUp = function (pev) { var context = _this.context; var documentPointer = _this.documentPointer; var calendarState = context.getCurrentData(); // touch-scrolling should never unfocus any type of selection if (!documentPointer.wasTouchScroll) { if (calendarState.dateSelection && // an existing date selection? !_this.isRecentPointerDateSelect // a new pointer-initiated date selection since last onDocumentPointerUp? ) { var unselectAuto = context.options.unselectAuto; if (unselectAuto && (!unselectAuto || !_this.matchesCancel)) { context.calendarApi.unselect(pev); } } if (calendarState.eventSelection && // an existing event selected? !_this.matchesEvent // interaction DIDN'T start on an event ) { context.dispatch({ type: 'UNSELECT_EVENT' }); } } _this.isRecentPointerDateSelect = false; }; var documentPointer = this.documentPointer = new PointerDragging(document); documentPointer.shouldIgnoreMove = true; documentPointer.shouldWatchScroll = false; documentPointer.emitter.on('pointerdown', this.onDocumentPointerDown); documentPointer.emitter.on('pointerup', this.onDocumentPointerUp); /* TODO: better way to know about whether there was a selection with the pointer */ context.emitter.on('select', this.onSelect); } UnselectAuto.prototype.destroy = function () { this.context.emitter.off('select', this.onSelect); this.documentPointer.destroy(); }; return UnselectAuto; }()); var OPTION_REFINERS = { fixedMirrorParent: _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.identity, }; var LISTENER_REFINERS = { dateClick: _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.identity, eventDragStart: _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.identity, eventDragStop: _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.identity, eventDrop: _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.identity, eventResizeStart: _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.identity, eventResizeStop: _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.identity, eventResize: _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.identity, drop: _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.identity, eventReceive: _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.identity, eventLeave: _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.identity, }; /* Given an already instantiated draggable object for one-or-more elements, Interprets any dragging as an attempt to drag an events that lives outside of a calendar onto a calendar. */ var ExternalElementDragging = /** @class */ (function () { function ExternalElementDragging(dragging, suppliedDragMeta) { var _this = this; this.receivingContext = null; this.droppableEvent = null; // will exist for all drags, even if create:false this.suppliedDragMeta = null; this.dragMeta = null; this.handleDragStart = function (ev) { _this.dragMeta = _this.buildDragMeta(ev.subjectEl); }; this.handleHitUpdate = function (hit, isFinal, ev) { var dragging = _this.hitDragging.dragging; var receivingContext = null; var droppableEvent = null; var isInvalid = false; var interaction = { affectedEvents: (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.createEmptyEventStore)(), mutatedEvents: (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.createEmptyEventStore)(), isEvent: _this.dragMeta.create, }; if (hit) { receivingContext = hit.context; if (_this.canDropElOnCalendar(ev.subjectEl, receivingContext)) { droppableEvent = computeEventForDateSpan(hit.dateSpan, _this.dragMeta, receivingContext); interaction.mutatedEvents = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.eventTupleToStore)(droppableEvent); isInvalid = !(0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.isInteractionValid)(interaction, hit.dateProfile, receivingContext); if (isInvalid) { interaction.mutatedEvents = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.createEmptyEventStore)(); droppableEvent = null; } } } _this.displayDrag(receivingContext, interaction); // show mirror if no already-rendered mirror element OR if we are shutting down the mirror (?) // TODO: wish we could somehow wait for dispatch to guarantee render dragging.setMirrorIsVisible(isFinal || !droppableEvent || !document.querySelector('.fc-event-mirror')); if (!isInvalid) { (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.enableCursor)(); } else { (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.disableCursor)(); } if (!isFinal) { dragging.setMirrorNeedsRevert(!droppableEvent); _this.receivingContext = receivingContext; _this.droppableEvent = droppableEvent; } }; this.handleDragEnd = function (pev) { var _a = _this, receivingContext = _a.receivingContext, droppableEvent = _a.droppableEvent; _this.clearDrag(); if (receivingContext && droppableEvent) { var finalHit = _this.hitDragging.finalHit; var finalView = finalHit.context.viewApi; var dragMeta = _this.dragMeta; receivingContext.emitter.trigger('drop', (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)({}, buildDatePointApiWithContext(finalHit.dateSpan, receivingContext)), { draggedEl: pev.subjectEl, jsEvent: pev.origEvent, view: finalView })); if (dragMeta.create) { var addingEvents_1 = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.eventTupleToStore)(droppableEvent); receivingContext.dispatch({ type: 'MERGE_EVENTS', eventStore: addingEvents_1, }); if (pev.isTouch) { receivingContext.dispatch({ type: 'SELECT_EVENT', eventInstanceId: droppableEvent.instance.instanceId, }); } // signal that an external event landed receivingContext.emitter.trigger('eventReceive', { event: new _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.EventApi(receivingContext, droppableEvent.def, droppableEvent.instance), relatedEvents: [], revert: function () { receivingContext.dispatch({ type: 'REMOVE_EVENTS', eventStore: addingEvents_1, }); }, draggedEl: pev.subjectEl, view: finalView, }); } } _this.receivingContext = null; _this.droppableEvent = null; }; var hitDragging = this.hitDragging = new HitDragging(dragging, _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.interactionSettingsStore); hitDragging.requireInitial = false; // will start outside of a component hitDragging.emitter.on('dragstart', this.handleDragStart); hitDragging.emitter.on('hitupdate', this.handleHitUpdate); hitDragging.emitter.on('dragend', this.handleDragEnd); this.suppliedDragMeta = suppliedDragMeta; } ExternalElementDragging.prototype.buildDragMeta = function (subjectEl) { if (typeof this.suppliedDragMeta === 'object') { return (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.parseDragMeta)(this.suppliedDragMeta); } if (typeof this.suppliedDragMeta === 'function') { return (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.parseDragMeta)(this.suppliedDragMeta(subjectEl)); } return getDragMetaFromEl(subjectEl); }; ExternalElementDragging.prototype.displayDrag = function (nextContext, state) { var prevContext = this.receivingContext; if (prevContext && prevContext !== nextContext) { prevContext.dispatch({ type: 'UNSET_EVENT_DRAG' }); } if (nextContext) { nextContext.dispatch({ type: 'SET_EVENT_DRAG', state: state }); } }; ExternalElementDragging.prototype.clearDrag = function () { if (this.receivingContext) { this.receivingContext.dispatch({ type: 'UNSET_EVENT_DRAG' }); } }; ExternalElementDragging.prototype.canDropElOnCalendar = function (el, receivingContext) { var dropAccept = receivingContext.options.dropAccept; if (typeof dropAccept === 'function') { return dropAccept.call(receivingContext.calendarApi, el); } if (typeof dropAccept === 'string' && dropAccept) { return Boolean((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.elementMatches)(el, dropAccept)); } return true; }; return ExternalElementDragging; }()); // Utils for computing event store from the DragMeta // ---------------------------------------------------------------------------------------------------- function computeEventForDateSpan(dateSpan, dragMeta, context) { var defProps = (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)({}, dragMeta.leftoverProps); for (var _i = 0, _a = context.pluginHooks.externalDefTransforms; _i < _a.length; _i++) { var transform = _a[_i]; (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__assign)(defProps, transform(dateSpan, dragMeta)); } var _b = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.refineEventDef)(defProps, context), refined = _b.refined, extra = _b.extra; var def = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.parseEventDef)(refined, extra, dragMeta.sourceId, dateSpan.allDay, context.options.forceEventDuration || Boolean(dragMeta.duration), // hasEnd context); var start = dateSpan.range.start; // only rely on time info if drop zone is all-day, // otherwise, we already know the time if (dateSpan.allDay && dragMeta.startTime) { start = context.dateEnv.add(start, dragMeta.startTime); } var end = dragMeta.duration ? context.dateEnv.add(start, dragMeta.duration) : (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.getDefaultEventEnd)(dateSpan.allDay, start, context); var instance = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.createEventInstance)(def.defId, { start: start, end: end }); return { def: def, instance: instance }; } // Utils for extracting data from element // ---------------------------------------------------------------------------------------------------- function getDragMetaFromEl(el) { var str = getEmbeddedElData(el, 'event'); var obj = str ? JSON.parse(str) : { create: false }; // if no embedded data, assume no event creation return (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.parseDragMeta)(obj); } _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.config.dataAttrPrefix = ''; function getEmbeddedElData(el, name) { var prefix = _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.config.dataAttrPrefix; var prefixedName = (prefix ? prefix + '-' : '') + name; return el.getAttribute('data-' + prefixedName) || ''; } /* Makes an element (that is *external* to any calendar) draggable. Can pass in data that determines how an event will be created when dropped onto a calendar. Leverages FullCalendar's internal drag-n-drop functionality WITHOUT a third-party drag system. */ var ExternalDraggable = /** @class */ (function () { function ExternalDraggable(el, settings) { var _this = this; if (settings === void 0) { settings = {}; } this.handlePointerDown = function (ev) { var dragging = _this.dragging; var _a = _this.settings, minDistance = _a.minDistance, longPressDelay = _a.longPressDelay; dragging.minDistance = minDistance != null ? minDistance : (ev.isTouch ? 0 : _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.BASE_OPTION_DEFAULTS.eventDragMinDistance); dragging.delay = ev.isTouch ? // TODO: eventually read eventLongPressDelay instead vvv (longPressDelay != null ? longPressDelay : _fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.BASE_OPTION_DEFAULTS.longPressDelay) : 0; }; this.handleDragStart = function (ev) { if (ev.isTouch && _this.dragging.delay && ev.subjectEl.classList.contains('fc-event')) { _this.dragging.mirror.getMirrorEl().classList.add('fc-event-selected'); } }; this.settings = settings; var dragging = this.dragging = new FeaturefulElementDragging(el); dragging.touchScrollAllowed = false; if (settings.itemSelector != null) { dragging.pointer.selector = settings.itemSelector; } if (settings.appendTo != null) { dragging.mirror.parentNode = settings.appendTo; // TODO: write tests } dragging.emitter.on('pointerdown', this.handlePointerDown); dragging.emitter.on('dragstart', this.handleDragStart); new ExternalElementDragging(dragging, settings.eventData); // eslint-disable-line no-new } ExternalDraggable.prototype.destroy = function () { this.dragging.destroy(); }; return ExternalDraggable; }()); /* Detects when a *THIRD-PARTY* drag-n-drop system interacts with elements. The third-party system is responsible for drawing the visuals effects of the drag. This class simply monitors for pointer movements and fires events. It also has the ability to hide the moving element (the "mirror") during the drag. */ var InferredElementDragging = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__extends)(InferredElementDragging, _super); function InferredElementDragging(containerEl) { var _this = _super.call(this, containerEl) || this; _this.shouldIgnoreMove = false; _this.mirrorSelector = ''; _this.currentMirrorEl = null; _this.handlePointerDown = function (ev) { _this.emitter.trigger('pointerdown', ev); if (!_this.shouldIgnoreMove) { // fire dragstart right away. does not support delay or min-distance _this.emitter.trigger('dragstart', ev); } }; _this.handlePointerMove = function (ev) { if (!_this.shouldIgnoreMove) { _this.emitter.trigger('dragmove', ev); } }; _this.handlePointerUp = function (ev) { _this.emitter.trigger('pointerup', ev); if (!_this.shouldIgnoreMove) { // fire dragend right away. does not support a revert animation _this.emitter.trigger('dragend', ev); } }; var pointer = _this.pointer = new PointerDragging(containerEl); pointer.emitter.on('pointerdown', _this.handlePointerDown); pointer.emitter.on('pointermove', _this.handlePointerMove); pointer.emitter.on('pointerup', _this.handlePointerUp); return _this; } InferredElementDragging.prototype.destroy = function () { this.pointer.destroy(); }; InferredElementDragging.prototype.setIgnoreMove = function (bool) { this.shouldIgnoreMove = bool; }; InferredElementDragging.prototype.setMirrorIsVisible = function (bool) { if (bool) { // restore a previously hidden element. // use the reference in case the selector class has already been removed. if (this.currentMirrorEl) { this.currentMirrorEl.style.visibility = ''; this.currentMirrorEl = null; } } else { var mirrorEl = this.mirrorSelector // TODO: somehow query FullCalendars WITHIN shadow-roots ? document.querySelector(this.mirrorSelector) : null; if (mirrorEl) { this.currentMirrorEl = mirrorEl; mirrorEl.style.visibility = 'hidden'; } } }; return InferredElementDragging; }(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.ElementDragging)); /* Bridges third-party drag-n-drop systems with FullCalendar. Must be instantiated and destroyed by caller. */ var ThirdPartyDraggable = /** @class */ (function () { function ThirdPartyDraggable(containerOrSettings, settings) { var containerEl = document; if ( // wish we could just test instanceof EventTarget, but doesn't work in IE11 containerOrSettings === document || containerOrSettings instanceof Element) { containerEl = containerOrSettings; settings = settings || {}; } else { settings = (containerOrSettings || {}); } var dragging = this.dragging = new InferredElementDragging(containerEl); if (typeof settings.itemSelector === 'string') { dragging.pointer.selector = settings.itemSelector; } else if (containerEl === document) { dragging.pointer.selector = '[data-event]'; } if (typeof settings.mirrorSelector === 'string') { dragging.mirrorSelector = settings.mirrorSelector; } new ExternalElementDragging(dragging, settings.eventData); // eslint-disable-line no-new } ThirdPartyDraggable.prototype.destroy = function () { this.dragging.destroy(); }; return ThirdPartyDraggable; }()); var main = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_0__.createPlugin)({ componentInteractions: [DateClicking, DateSelecting, EventDragging, EventResizing], calendarInteractions: [UnselectAuto], elementDraggingImpl: FeaturefulElementDragging, optionRefiners: OPTION_REFINERS, listenerRefiners: LISTENER_REFINERS, }); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (main); //# sourceMappingURL=main.js.map /***/ }), /***/ "./node_modules/@fullcalendar/list/main.js": /*!*************************************************!*\ !*** ./node_modules/@fullcalendar/list/main.js ***! \*************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "ListView": () => (/* binding */ ListView), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _main_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./main.css */ "./node_modules/@fullcalendar/list/main.css"); /* harmony import */ var _fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @fullcalendar/common */ "./node_modules/@fullcalendar/common/main.js"); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /*! FullCalendar v5.11.3 Docs & License: https://fullcalendar.io/ (c) 2022 Adam Shaw */ var ListViewHeaderRow = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__extends)(ListViewHeaderRow, _super); function ListViewHeaderRow() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.state = { textId: (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.getUniqueDomId)(), }; return _this; } ListViewHeaderRow.prototype.render = function () { var _a = this.context, theme = _a.theme, dateEnv = _a.dateEnv, options = _a.options, viewApi = _a.viewApi; var _b = this.props, cellId = _b.cellId, dayDate = _b.dayDate, todayRange = _b.todayRange; var textId = this.state.textId; var dayMeta = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.getDateMeta)(dayDate, todayRange); // will ever be falsy? var text = options.listDayFormat ? dateEnv.format(dayDate, options.listDayFormat) : ''; // will ever be falsy? also, BAD NAME "alt" var sideText = options.listDaySideFormat ? dateEnv.format(dayDate, options.listDaySideFormat) : ''; var hookProps = (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({ date: dateEnv.toDate(dayDate), view: viewApi, textId: textId, text: text, sideText: sideText, navLinkAttrs: (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.buildNavLinkAttrs)(this.context, dayDate), sideNavLinkAttrs: (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.buildNavLinkAttrs)(this.context, dayDate, 'day', false) }, dayMeta); var classNames = ['fc-list-day'].concat((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.getDayClassNames)(dayMeta, theme)); // TODO: make a reusable HOC for dayHeader (used in daygrid/timegrid too) return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.RenderHook, { hookProps: hookProps, classNames: options.dayHeaderClassNames, content: options.dayHeaderContent, defaultContent: renderInnerContent, didMount: options.dayHeaderDidMount, willUnmount: options.dayHeaderWillUnmount }, function (rootElRef, customClassNames, innerElRef, innerContent) { return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("tr", { ref: rootElRef, className: classNames.concat(customClassNames).join(' '), "data-date": (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.formatDayString)(dayDate) }, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("th", { scope: "colgroup", colSpan: 3, id: cellId, "aria-labelledby": textId }, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("div", { className: 'fc-list-day-cushion ' + theme.getClass('tableCellShaded'), ref: innerElRef }, innerContent)))); })); }; return ListViewHeaderRow; }(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.BaseComponent)); function renderInnerContent(props) { return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, props.text && ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("a", (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({ id: props.textId, className: "fc-list-day-text" }, props.navLinkAttrs), props.text)), props.sideText && ( /* not keyboard tabbable */(0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("a", (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({ "aria-hidden": true, className: "fc-list-day-side-text" }, props.sideNavLinkAttrs), props.sideText)))); } var DEFAULT_TIME_FORMAT = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createFormatter)({ hour: 'numeric', minute: '2-digit', meridiem: 'short', }); var ListViewEventRow = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__extends)(ListViewEventRow, _super); function ListViewEventRow() { return _super !== null && _super.apply(this, arguments) || this; } ListViewEventRow.prototype.render = function () { var _a = this, props = _a.props, context = _a.context; var seg = props.seg, timeHeaderId = props.timeHeaderId, eventHeaderId = props.eventHeaderId, dateHeaderId = props.dateHeaderId; var timeFormat = context.options.eventTimeFormat || DEFAULT_TIME_FORMAT; return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.EventRoot, { seg: seg, timeText: "" // BAD. because of all-day content , disableDragging: true, disableResizing: true, defaultContent: function () { return renderEventInnerContent(seg, context); } /* weird */, isPast: props.isPast, isFuture: props.isFuture, isToday: props.isToday, isSelected: props.isSelected, isDragging: props.isDragging, isResizing: props.isResizing, isDateSelecting: props.isDateSelecting }, function (rootElRef, classNames, innerElRef, innerContent, hookProps) { return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("tr", { className: ['fc-list-event', hookProps.event.url ? 'fc-event-forced-url' : ''].concat(classNames).join(' '), ref: rootElRef }, buildTimeContent(seg, timeFormat, context, timeHeaderId, dateHeaderId), (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("td", { "aria-hidden": true, className: "fc-list-event-graphic" }, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("span", { className: "fc-list-event-dot", style: { borderColor: hookProps.borderColor || hookProps.backgroundColor } })), (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("td", { ref: innerElRef, headers: eventHeaderId + " " + dateHeaderId, className: "fc-list-event-title" }, innerContent))); })); }; return ListViewEventRow; }(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.BaseComponent)); function renderEventInnerContent(seg, context) { var interactiveAttrs = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.getSegAnchorAttrs)(seg, context); return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("a", (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, interactiveAttrs), seg.eventRange.def.title)); } function buildTimeContent(seg, timeFormat, context, timeHeaderId, dateHeaderId) { var options = context.options; if (options.displayEventTime !== false) { var eventDef = seg.eventRange.def; var eventInstance = seg.eventRange.instance; var doAllDay = false; var timeText = void 0; if (eventDef.allDay) { doAllDay = true; } else if ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.isMultiDayRange)(seg.eventRange.range)) { // TODO: use (!isStart || !isEnd) instead? if (seg.isStart) { timeText = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.buildSegTimeText)(seg, timeFormat, context, null, null, eventInstance.range.start, seg.end); } else if (seg.isEnd) { timeText = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.buildSegTimeText)(seg, timeFormat, context, null, null, seg.start, eventInstance.range.end); } else { doAllDay = true; } } else { timeText = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.buildSegTimeText)(seg, timeFormat, context); } if (doAllDay) { var hookProps = { text: context.options.allDayText, view: context.viewApi, }; return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.RenderHook, { hookProps: hookProps, classNames: options.allDayClassNames, content: options.allDayContent, defaultContent: renderAllDayInner, didMount: options.allDayDidMount, willUnmount: options.allDayWillUnmount }, function (rootElRef, classNames, innerElRef, innerContent) { return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("td", { ref: rootElRef, headers: timeHeaderId + " " + dateHeaderId, className: ['fc-list-event-time'].concat(classNames).join(' ') }, innerContent)); })); } return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("td", { className: "fc-list-event-time" }, timeText)); } return null; } function renderAllDayInner(hookProps) { return hookProps.text; } /* Responsible for the scroller, and forwarding event-related actions into the "grid". */ var ListView = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__extends)(ListView, _super); function ListView() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.computeDateVars = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.memoize)(computeDateVars); _this.eventStoreToSegs = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.memoize)(_this._eventStoreToSegs); _this.state = { timeHeaderId: (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.getUniqueDomId)(), eventHeaderId: (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.getUniqueDomId)(), dateHeaderIdRoot: (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.getUniqueDomId)(), }; _this.setRootEl = function (rootEl) { if (rootEl) { _this.context.registerInteractiveComponent(_this, { el: rootEl, }); } else { _this.context.unregisterInteractiveComponent(_this); } }; return _this; } ListView.prototype.render = function () { var _this = this; var _a = this, props = _a.props, context = _a.context; var extraClassNames = [ 'fc-list', context.theme.getClass('table'), context.options.stickyHeaderDates !== false ? 'fc-list-sticky' : '', ]; var _b = this.computeDateVars(props.dateProfile), dayDates = _b.dayDates, dayRanges = _b.dayRanges; var eventSegs = this.eventStoreToSegs(props.eventStore, props.eventUiBases, dayRanges); return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.ViewRoot, { viewSpec: context.viewSpec, elRef: this.setRootEl }, function (rootElRef, classNames) { return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("div", { ref: rootElRef, className: extraClassNames.concat(classNames).join(' ') }, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.Scroller, { liquid: !props.isHeightAuto, overflowX: props.isHeightAuto ? 'visible' : 'hidden', overflowY: props.isHeightAuto ? 'visible' : 'auto' }, eventSegs.length > 0 ? _this.renderSegList(eventSegs, dayDates) : _this.renderEmptyMessage()))); })); }; ListView.prototype.renderEmptyMessage = function () { var _a = this.context, options = _a.options, viewApi = _a.viewApi; var hookProps = { text: options.noEventsText, view: viewApi, }; return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.RenderHook, { hookProps: hookProps, classNames: options.noEventsClassNames, content: options.noEventsContent, defaultContent: renderNoEventsInner, didMount: options.noEventsDidMount, willUnmount: options.noEventsWillUnmount }, function (rootElRef, classNames, innerElRef, innerContent) { return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("div", { className: ['fc-list-empty'].concat(classNames).join(' '), ref: rootElRef }, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("div", { className: "fc-list-empty-cushion", ref: innerElRef }, innerContent))); })); }; ListView.prototype.renderSegList = function (allSegs, dayDates) { var _a = this.context, theme = _a.theme, options = _a.options; var _b = this.state, timeHeaderId = _b.timeHeaderId, eventHeaderId = _b.eventHeaderId, dateHeaderIdRoot = _b.dateHeaderIdRoot; var segsByDay = groupSegsByDay(allSegs); // sparse array return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.NowTimer, { unit: "day" }, function (nowDate, todayRange) { var innerNodes = []; for (var dayIndex = 0; dayIndex < segsByDay.length; dayIndex += 1) { var daySegs = segsByDay[dayIndex]; if (daySegs) { // sparse array, so might be undefined var dayStr = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.formatDayString)(dayDates[dayIndex]); var dateHeaderId = dateHeaderIdRoot + '-' + dayStr; // append a day header innerNodes.push((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(ListViewHeaderRow, { key: dayStr, cellId: dateHeaderId, dayDate: dayDates[dayIndex], todayRange: todayRange })); daySegs = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.sortEventSegs)(daySegs, options.eventOrder); for (var _i = 0, daySegs_1 = daySegs; _i < daySegs_1.length; _i++) { var seg = daySegs_1[_i]; innerNodes.push((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(ListViewEventRow, (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({ key: dayStr + ':' + seg.eventRange.instance.instanceId /* are multiple segs for an instanceId */, seg: seg, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: false, timeHeaderId: timeHeaderId, eventHeaderId: eventHeaderId, dateHeaderId: dateHeaderId }, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.getSegMeta)(seg, todayRange, nowDate)))); } } } return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("table", { className: 'fc-list-table ' + theme.getClass('table') }, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("thead", null, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("tr", null, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("th", { scope: "col", id: timeHeaderId }, options.timeHint), (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("th", { scope: "col", "aria-hidden": true }), (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("th", { scope: "col", id: eventHeaderId }, options.eventHint))), (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("tbody", null, innerNodes))); })); }; ListView.prototype._eventStoreToSegs = function (eventStore, eventUiBases, dayRanges) { return this.eventRangesToSegs((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.sliceEventStore)(eventStore, eventUiBases, this.props.dateProfile.activeRange, this.context.options.nextDayThreshold).fg, dayRanges); }; ListView.prototype.eventRangesToSegs = function (eventRanges, dayRanges) { var segs = []; for (var _i = 0, eventRanges_1 = eventRanges; _i < eventRanges_1.length; _i++) { var eventRange = eventRanges_1[_i]; segs.push.apply(segs, this.eventRangeToSegs(eventRange, dayRanges)); } return segs; }; ListView.prototype.eventRangeToSegs = function (eventRange, dayRanges) { var dateEnv = this.context.dateEnv; var nextDayThreshold = this.context.options.nextDayThreshold; var range = eventRange.range; var allDay = eventRange.def.allDay; var dayIndex; var segRange; var seg; var segs = []; for (dayIndex = 0; dayIndex < dayRanges.length; dayIndex += 1) { segRange = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.intersectRanges)(range, dayRanges[dayIndex]); if (segRange) { seg = { component: this, eventRange: eventRange, start: segRange.start, end: segRange.end, isStart: eventRange.isStart && segRange.start.valueOf() === range.start.valueOf(), isEnd: eventRange.isEnd && segRange.end.valueOf() === range.end.valueOf(), dayIndex: dayIndex, }; segs.push(seg); // detect when range won't go fully into the next day, // and mutate the latest seg to the be the end. if (!seg.isEnd && !allDay && dayIndex + 1 < dayRanges.length && range.end < dateEnv.add(dayRanges[dayIndex + 1].start, nextDayThreshold)) { seg.end = range.end; seg.isEnd = true; break; } } } return segs; }; return ListView; }(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.DateComponent)); function renderNoEventsInner(hookProps) { return hookProps.text; } function computeDateVars(dateProfile) { var dayStart = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.startOfDay)(dateProfile.renderRange.start); var viewEnd = dateProfile.renderRange.end; var dayDates = []; var dayRanges = []; while (dayStart < viewEnd) { dayDates.push(dayStart); dayRanges.push({ start: dayStart, end: (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.addDays)(dayStart, 1), }); dayStart = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.addDays)(dayStart, 1); } return { dayDates: dayDates, dayRanges: dayRanges }; } // Returns a sparse array of arrays, segs grouped by their dayIndex function groupSegsByDay(segs) { var segsByDay = []; // sparse array var i; var seg; for (i = 0; i < segs.length; i += 1) { seg = segs[i]; (segsByDay[seg.dayIndex] || (segsByDay[seg.dayIndex] = [])) .push(seg); } return segsByDay; } var OPTION_REFINERS = { listDayFormat: createFalsableFormatter, listDaySideFormat: createFalsableFormatter, noEventsClassNames: _fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.identity, noEventsContent: _fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.identity, noEventsDidMount: _fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.identity, noEventsWillUnmount: _fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.identity, // noEventsText is defined in base options }; function createFalsableFormatter(input) { return input === false ? null : (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createFormatter)(input); } var main = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createPlugin)({ optionRefiners: OPTION_REFINERS, views: { list: { component: ListView, buttonTextKey: 'list', listDayFormat: { month: 'long', day: 'numeric', year: 'numeric' }, // like "January 1, 2016" }, listDay: { type: 'list', duration: { days: 1 }, listDayFormat: { weekday: 'long' }, // day-of-week is all we need. full date is probably in headerToolbar }, listWeek: { type: 'list', duration: { weeks: 1 }, listDayFormat: { weekday: 'long' }, listDaySideFormat: { month: 'long', day: 'numeric', year: 'numeric' }, }, listMonth: { type: 'list', duration: { month: 1 }, listDaySideFormat: { weekday: 'long' }, // day-of-week is nice-to-have }, listYear: { type: 'list', duration: { year: 1 }, listDaySideFormat: { weekday: 'long' }, // day-of-week is nice-to-have }, }, }); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (main); //# sourceMappingURL=main.js.map /***/ }), /***/ "./node_modules/@fullcalendar/timegrid/main.js": /*!*****************************************************!*\ !*** ./node_modules/@fullcalendar/timegrid/main.js ***! \*****************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "DayTimeCols": () => (/* binding */ DayTimeCols), /* harmony export */ "DayTimeColsSlicer": () => (/* binding */ DayTimeColsSlicer), /* harmony export */ "DayTimeColsView": () => (/* binding */ DayTimeColsView), /* harmony export */ "TimeCols": () => (/* binding */ TimeCols), /* harmony export */ "TimeColsSlatsCoords": () => (/* binding */ TimeColsSlatsCoords), /* harmony export */ "TimeColsView": () => (/* binding */ TimeColsView), /* harmony export */ "buildDayRanges": () => (/* binding */ buildDayRanges), /* harmony export */ "buildSlatMetas": () => (/* binding */ buildSlatMetas), /* harmony export */ "buildTimeColsModel": () => (/* binding */ buildTimeColsModel), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _main_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./main.css */ "./node_modules/@fullcalendar/timegrid/main.css"); /* harmony import */ var _fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @fullcalendar/common */ "./node_modules/@fullcalendar/common/main.js"); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); /* harmony import */ var _fullcalendar_daygrid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @fullcalendar/daygrid */ "./node_modules/@fullcalendar/daygrid/main.js"); /*! FullCalendar v5.11.3 Docs & License: https://fullcalendar.io/ (c) 2022 Adam Shaw */ var AllDaySplitter = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(AllDaySplitter, _super); function AllDaySplitter() { return _super !== null && _super.apply(this, arguments) || this; } AllDaySplitter.prototype.getKeyInfo = function () { return { allDay: {}, timed: {}, }; }; AllDaySplitter.prototype.getKeysForDateSpan = function (dateSpan) { if (dateSpan.allDay) { return ['allDay']; } return ['timed']; }; AllDaySplitter.prototype.getKeysForEventDef = function (eventDef) { if (!eventDef.allDay) { return ['timed']; } if ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.hasBgRendering)(eventDef)) { return ['timed', 'allDay']; } return ['allDay']; }; return AllDaySplitter; }(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.Splitter)); var DEFAULT_SLAT_LABEL_FORMAT = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createFormatter)({ hour: 'numeric', minute: '2-digit', omitZeroMinute: true, meridiem: 'short', }); function TimeColsAxisCell(props) { var classNames = [ 'fc-timegrid-slot', 'fc-timegrid-slot-label', props.isLabeled ? 'fc-scrollgrid-shrink' : 'fc-timegrid-slot-minor', ]; return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.ViewContextType.Consumer, null, function (context) { if (!props.isLabeled) { return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("td", { className: classNames.join(' '), "data-time": props.isoTimeStr })); } var dateEnv = context.dateEnv, options = context.options, viewApi = context.viewApi; var labelFormat = // TODO: fully pre-parse options.slotLabelFormat == null ? DEFAULT_SLAT_LABEL_FORMAT : Array.isArray(options.slotLabelFormat) ? (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createFormatter)(options.slotLabelFormat[0]) : (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createFormatter)(options.slotLabelFormat); var hookProps = { level: 0, time: props.time, date: dateEnv.toDate(props.date), view: viewApi, text: dateEnv.format(props.date, labelFormat), }; return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.RenderHook, { hookProps: hookProps, classNames: options.slotLabelClassNames, content: options.slotLabelContent, defaultContent: renderInnerContent, didMount: options.slotLabelDidMount, willUnmount: options.slotLabelWillUnmount }, function (rootElRef, customClassNames, innerElRef, innerContent) { return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("td", { ref: rootElRef, className: classNames.concat(customClassNames).join(' '), "data-time": props.isoTimeStr }, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("div", { className: "fc-timegrid-slot-label-frame fc-scrollgrid-shrink-frame" }, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("div", { className: "fc-timegrid-slot-label-cushion fc-scrollgrid-shrink-cushion", ref: innerElRef }, innerContent)))); })); })); } function renderInnerContent(props) { return props.text; } var TimeBodyAxis = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(TimeBodyAxis, _super); function TimeBodyAxis() { return _super !== null && _super.apply(this, arguments) || this; } TimeBodyAxis.prototype.render = function () { return this.props.slatMetas.map(function (slatMeta) { return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("tr", { key: slatMeta.key }, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(TimeColsAxisCell, (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)({}, slatMeta)))); }); }; return TimeBodyAxis; }(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.BaseComponent)); var DEFAULT_WEEK_NUM_FORMAT = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createFormatter)({ week: 'short' }); var AUTO_ALL_DAY_MAX_EVENT_ROWS = 5; var TimeColsView = /** @class */ (function (_super) { (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__extends)(TimeColsView, _super); function TimeColsView() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.allDaySplitter = new AllDaySplitter(); // for use by subclasses _this.headerElRef = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createRef)(); _this.rootElRef = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createRef)(); _this.scrollerElRef = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createRef)(); _this.state = { slatCoords: null, }; _this.handleScrollTopRequest = function (scrollTop) { var scrollerEl = _this.scrollerElRef.current; if (scrollerEl) { // TODO: not sure how this could ever be null. weirdness with the reducer scrollerEl.scrollTop = scrollTop; } }; /* Header Render Methods ------------------------------------------------------------------------------------------------------------------*/ _this.renderHeadAxis = function (rowKey, frameHeight) { if (frameHeight === void 0) { frameHeight = ''; } var options = _this.context.options; var dateProfile = _this.props.dateProfile; var range = dateProfile.renderRange; var dayCnt = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.diffDays)(range.start, range.end); var navLinkAttrs = (dayCnt === 1) // only do in day views (to avoid doing in week views that dont need it) ? (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.buildNavLinkAttrs)(_this.context, range.start, 'week') : {}; if (options.weekNumbers && rowKey === 'day') { return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.WeekNumberRoot, { date: range.start, defaultFormat: DEFAULT_WEEK_NUM_FORMAT }, function (rootElRef, classNames, innerElRef, innerContent) { return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("th", { ref: rootElRef, "aria-hidden": true, className: [ 'fc-timegrid-axis', 'fc-scrollgrid-shrink', ].concat(classNames).join(' ') }, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("div", { className: "fc-timegrid-axis-frame fc-scrollgrid-shrink-frame fc-timegrid-axis-frame-liquid", style: { height: frameHeight } }, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("a", (0,tslib__WEBPACK_IMPORTED_MODULE_3__.__assign)({ ref: innerElRef, className: "fc-timegrid-axis-cushion fc-scrollgrid-shrink-cushion fc-scrollgrid-sync-inner" }, navLinkAttrs), innerContent)))); })); } return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("th", { "aria-hidden": true, className: "fc-timegrid-axis" }, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("div", { className: "fc-timegrid-axis-frame", style: { height: frameHeight } }))); }; /* Table Component Render Methods ------------------------------------------------------------------------------------------------------------------*/ // only a one-way height sync. we don't send the axis inner-content height to the DayGrid, // but DayGrid still needs to have classNames on inner elements in order to measure. _this.renderTableRowAxis = function (rowHeight) { var _a = _this.context, options = _a.options, viewApi = _a.viewApi; var hookProps = { text: options.allDayText, view: viewApi, }; return ( // TODO: make reusable hook. used in list view too (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)(_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.RenderHook, { hookProps: hookProps, classNames: options.allDayClassNames, content: options.allDayContent, defaultContent: renderAllDayInner, didMount: options.allDayDidMount, willUnmount: options.allDayWillUnmount }, function (rootElRef, classNames, innerElRef, innerContent) { return ((0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("td", { ref: rootElRef, "aria-hidden": true, className: [ 'fc-timegrid-axis', 'fc-scrollgrid-shrink', ].concat(classNames).join(' ') }, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("div", { className: 'fc-timegrid-axis-frame fc-scrollgrid-shrink-frame' + (rowHeight == null ? ' fc-timegrid-axis-frame-liquid' : ''), style: { height: rowHeight } }, (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.createElement)("span", { className: "fc-timegrid-axis-cushion fc-scrollgrid-shrink-cushion fc-scrollgrid-sync-inner", ref: innerElRef }, innerContent)))); })); }; _this.handleSlatCoords = function (slatCoords) { _this.setState({ slatCoords: slatCoords }); }; return _this; } // rendering // ---------------------------------------------------------------------------------------------------- TimeColsView.prototype.renderSimpleLayout = function (headerRowContent, allDayContent, timeContent) { var _a = this, context = _a.context, props = _a.props; var sections = []; var stickyHeaderDates = (0,_fullcalendar_common__WEBPACK_IMPORTED_MODULE_1__.getStickyHeaderDates)(context.options); if (headerRowContent) { sections.push({ type: 'header', key: 'header', isSticky: stickyHeaderDates, chunk: { elRef: this.headerElRef, tableClassName: 'fc-col-header', rowContent: headerRowContent, }, }); } if (allDayContent) { sections.push({ type: 'body', key: 'all-day', chunk: { content: allDayContent }, }); sections.push({ type: 'body', key: 'all-day-divider', outerContent: ( // TODO: rename to cellContent so don't need to define |
---|---|
*/\n }\n.fc-daygrid-event { /* make root-level, because will be dragged-and-dropped outside of a component root */\n position: relative; /* for z-indexes assigned later */\n white-space: nowrap;\n border-radius: 3px; /* dot event needs this to when selected */\n font-size: .85em;\n font-size: var(--fc-small-font-size, .85em);\n}\n/* --- the rectangle (\"block\") style of event --- */\n.fc-daygrid-block-event .fc-event-time {\n font-weight: bold;\n }\n.fc-daygrid-block-event .fc-event-time,\n .fc-daygrid-block-event .fc-event-title {\n padding: 1px;\n }\n/* --- the dot style of event --- */\n.fc-daygrid-dot-event {\n display: flex;\n align-items: center;\n padding: 2px 0\n\n}\n.fc-daygrid-dot-event .fc-event-title {\n flex-grow: 1;\n flex-shrink: 1;\n min-width: 0; /* important for allowing to shrink all the way */\n overflow: hidden;\n font-weight: bold;\n }\n.fc-daygrid-dot-event:hover,\n .fc-daygrid-dot-event.fc-event-mirror {\n background: rgba(0, 0, 0, 0.1);\n }\n.fc-daygrid-dot-event.fc-event-selected:before {\n /* expand hit area */\n top: -10px;\n bottom: -10px;\n }\n.fc-daygrid-event-dot { /* the actual dot */\n margin: 0 4px;\n box-sizing: content-box;\n width: 0;\n height: 0;\n border: 4px solid #3788d8;\n border: calc(var(--fc-daygrid-event-dot-width, 8px) / 2) solid var(--fc-event-border-color, #3788d8);\n border-radius: 4px;\n border-radius: calc(var(--fc-daygrid-event-dot-width, 8px) / 2);\n}\n/* --- spacing between time and title --- */\n.fc-direction-ltr .fc-daygrid-event .fc-event-time {\n margin-right: 3px;\n }\n.fc-direction-rtl .fc-daygrid-event .fc-event-time {\n margin-left: 3px;\n }\n", ""]); // Exports /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[6].oneOf[1].use[2]!./node_modules/@fullcalendar/list/main.css": /*!************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[6].oneOf[1].use[2]!./node_modules/@fullcalendar/list/main.css ***! \************************************************************************************************************************************************************************************************************/ /***/ ((module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__); // Imports var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]}); // Module ___CSS_LOADER_EXPORT___.push([module.id, "\n:root {\n --fc-list-event-dot-width: 10px;\n --fc-list-event-hover-bg-color: #f5f5f5;\n}\n.fc-theme-standard .fc-list {\n border: 1px solid #ddd;\n border: 1px solid var(--fc-border-color, #ddd);\n }\n.fc {\n\n /* message when no events */\n\n}\n.fc .fc-list-empty {\n background-color: rgba(208, 208, 208, 0.3);\n background-color: var(--fc-neutral-bg-color, rgba(208, 208, 208, 0.3));\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center; /* vertically aligns fc-list-empty-inner */\n }\n.fc .fc-list-empty-cushion {\n margin: 5em 0;\n }\n.fc {\n\n /* table within the scroller */\n /* ---------------------------------------------------------------------------------------------------- */\n\n}\n.fc .fc-list-table {\n width: 100%;\n border-style: hidden; /* kill outer border on theme */\n }\n.fc .fc-list-table tr > * {\n border-left: 0;\n border-right: 0;\n }\n.fc .fc-list-sticky .fc-list-day > * { /* the cells */\n position: sticky;\n top: 0;\n background: #fff;\n background: var(--fc-page-bg-color, #fff); /* for when headers are styled to be transparent and sticky */\n }\n.fc {\n\n /* only exists for aria reasons, hide for non-screen-readers */\n\n}\n.fc .fc-list-table thead {\n position: absolute;\n left: -10000px;\n }\n.fc {\n\n /* the table's border-style:hidden gets confused by hidden thead. force-hide top border of first cell */\n\n}\n.fc .fc-list-table tbody > tr:first-child th {\n border-top: 0;\n }\n.fc .fc-list-table th {\n padding: 0; /* uses an inner-wrapper instead... */\n }\n.fc .fc-list-table td,\n .fc .fc-list-day-cushion {\n padding: 8px 14px;\n }\n.fc {\n\n\n /* date heading rows */\n /* ---------------------------------------------------------------------------------------------------- */\n\n}\n.fc .fc-list-day-cushion:after {\n content: \"\";\n clear: both;\n display: table; /* clear floating */\n }\n.fc-theme-standard .fc-list-day-cushion {\n background-color: rgba(208, 208, 208, 0.3);\n background-color: var(--fc-neutral-bg-color, rgba(208, 208, 208, 0.3));\n }\n.fc-direction-ltr .fc-list-day-text,\n.fc-direction-rtl .fc-list-day-side-text {\n float: left;\n}\n.fc-direction-ltr .fc-list-day-side-text,\n.fc-direction-rtl .fc-list-day-text {\n float: right;\n}\n/* make the dot closer to the event title */\n.fc-direction-ltr .fc-list-table .fc-list-event-graphic { padding-right: 0 }\n.fc-direction-rtl .fc-list-table .fc-list-event-graphic { padding-left: 0 }\n.fc .fc-list-event.fc-event-forced-url {\n cursor: pointer; /* whole row will seem clickable */\n }\n.fc .fc-list-event:hover td {\n background-color: #f5f5f5;\n background-color: var(--fc-list-event-hover-bg-color, #f5f5f5);\n }\n.fc {\n\n /* shrink certain cols */\n\n}\n.fc .fc-list-event-graphic,\n .fc .fc-list-event-time {\n white-space: nowrap;\n width: 1px;\n }\n.fc .fc-list-event-dot {\n display: inline-block;\n box-sizing: content-box;\n width: 0;\n height: 0;\n border: 5px solid #3788d8;\n border: calc(var(--fc-list-event-dot-width, 10px) / 2) solid var(--fc-event-border-color, #3788d8);\n border-radius: 5px;\n border-radius: calc(var(--fc-list-event-dot-width, 10px) / 2);\n }\n.fc {\n\n /* reset styling */\n\n}\n.fc .fc-list-event-title a {\n color: inherit;\n text-decoration: none;\n }\n.fc {\n\n /* underline link when hovering over any part of row */\n\n}\n.fc .fc-list-event.fc-event-forced-url:hover a {\n text-decoration: underline;\n }\n", ""]); // Exports /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___); /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[6].oneOf[1].use[2]!./node_modules/@fullcalendar/timegrid/main.css": /*!****************************************************************************************************************************************************************************************************************!*\ !*** ./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].oneOf[1].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[6].oneOf[1].use[2]!./node_modules/@fullcalendar/timegrid/main.css ***! \****************************************************************************************************************************************************************************************************************/ /***/ ((module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js"); /* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__); // Imports var ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]}); // Module ___CSS_LOADER_EXPORT___.push([module.id, "\n/*\nA VERTICAL event\n*/\n\n.fc-v-event { /* allowed to be top-level */\n display: block;\n border: 1px solid #3788d8;\n border: 1px solid var(--fc-event-border-color, #3788d8);\n background-color: #3788d8;\n background-color: var(--fc-event-bg-color, #3788d8)\n\n}\n\n.fc-v-event .fc-event-main {\n color: #fff;\n color: var(--fc-event-text-color, #fff);\n height: 100%;\n }\n\n.fc-v-event .fc-event-main-frame {\n height: 100%;\n display: flex;\n flex-direction: column;\n }\n\n.fc-v-event .fc-event-time {\n flex-grow: 0;\n flex-shrink: 0;\n max-height: 100%;\n overflow: hidden;\n }\n\n.fc-v-event .fc-event-title-container { /* a container for the sticky cushion */\n flex-grow: 1;\n flex-shrink: 1;\n min-height: 0; /* important for allowing to shrink all the way */\n }\n\n.fc-v-event .fc-event-title { /* will have fc-sticky on it */\n top: 0;\n bottom: 0;\n max-height: 100%; /* clip overflow */\n overflow: hidden;\n }\n\n.fc-v-event:not(.fc-event-start) {\n border-top-width: 0;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n\n.fc-v-event:not(.fc-event-end) {\n border-bottom-width: 0;\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n }\n\n.fc-v-event.fc-event-selected:before {\n /* expand hit area */\n left: -10px;\n right: -10px;\n }\n\n.fc-v-event {\n\n /* resizer (mouse AND touch) */\n\n}\n\n.fc-v-event .fc-event-resizer-start {\n cursor: n-resize;\n }\n\n.fc-v-event .fc-event-resizer-end {\n cursor: s-resize;\n }\n\n.fc-v-event {\n\n /* resizer for MOUSE */\n\n}\n\n.fc-v-event:not(.fc-event-selected) .fc-event-resizer {\n height: 8px;\n height: var(--fc-event-resizer-thickness, 8px);\n left: 0;\n right: 0;\n }\n\n.fc-v-event:not(.fc-event-selected) .fc-event-resizer-start {\n top: -4px;\n top: calc(var(--fc-event-resizer-thickness, 8px) / -2);\n }\n\n.fc-v-event:not(.fc-event-selected) .fc-event-resizer-end {\n bottom: -4px;\n bottom: calc(var(--fc-event-resizer-thickness, 8px) / -2);\n }\n\n.fc-v-event {\n\n /* resizer for TOUCH (when event is \"selected\") */\n\n}\n\n.fc-v-event.fc-event-selected .fc-event-resizer {\n left: 50%;\n margin-left: -4px;\n margin-left: calc(var(--fc-event-resizer-dot-total-width, 8px) / -2);\n }\n\n.fc-v-event.fc-event-selected .fc-event-resizer-start {\n top: -4px;\n top: calc(var(--fc-event-resizer-dot-total-width, 8px) / -2);\n }\n\n.fc-v-event.fc-event-selected .fc-event-resizer-end {\n bottom: -4px;\n bottom: calc(var(--fc-event-resizer-dot-total-width, 8px) / -2);\n }\n.fc .fc-timegrid .fc-daygrid-body { /* the all-day daygrid within the timegrid view */\n z-index: 2; /* put above the timegrid-body so that more-popover is above everything. TODO: better solution */\n }\n.fc .fc-timegrid-divider {\n padding: 0 0 2px; /* browsers get confused when you set height. use padding instead */\n }\n.fc .fc-timegrid-body {\n position: relative;\n z-index: 1; /* scope the z-indexes of slots and cols */\n min-height: 100%; /* fill height always, even when slat table doesn't grow */\n }\n.fc .fc-timegrid-axis-chunk { /* for advanced ScrollGrid */\n position: relative /* offset parent for now-indicator-container */\n\n }\n.fc .fc-timegrid-axis-chunk > table {\n position: relative;\n z-index: 1; /* above the now-indicator-container */\n }\n.fc .fc-timegrid-slots {\n position: relative;\n z-index: 1;\n }\n.fc .fc-timegrid-slot { /* a | */\n height: 1.5em;\n border-bottom: 0 /* each cell owns its top border */\n }\n.fc .fc-timegrid-slot:empty:before {\n content: '\\00a0'; /* make sure there's at least an empty space to create height for height syncing */\n }\n.fc .fc-timegrid-slot-minor {\n border-top-style: dotted;\n }\n.fc .fc-timegrid-slot-label-cushion {\n display: inline-block;\n white-space: nowrap;\n }\n.fc .fc-timegrid-slot-label {\n vertical-align: middle; /* vertical align the slots */\n }\n.fc {\n\n\n /* slots AND axis cells (top-left corner of view including the \"all-day\" text) */\n\n}\n.fc .fc-timegrid-axis-cushion,\n .fc .fc-timegrid-slot-label-cushion {\n padding: 0 4px;\n }\n.fc {\n\n\n /* axis cells (top-left corner of view including the \"all-day\" text) */\n /* vertical align is more complicated, uses flexbox */\n\n}\n.fc .fc-timegrid-axis-frame-liquid {\n height: 100%; /* will need liquid-hack in FF */\n }\n.fc .fc-timegrid-axis-frame {\n overflow: hidden;\n display: flex;\n align-items: center; /* vertical align */\n justify-content: flex-end; /* horizontal align. matches text-align below */\n }\n.fc .fc-timegrid-axis-cushion {\n max-width: 60px; /* limits the width of the \"all-day\" text */\n flex-shrink: 0; /* allows text to expand how it normally would, regardless of constrained width */\n }\n.fc-direction-ltr .fc-timegrid-slot-label-frame {\n text-align: right;\n }\n.fc-direction-rtl .fc-timegrid-slot-label-frame {\n text-align: left;\n }\n.fc-liquid-hack .fc-timegrid-axis-frame-liquid {\n height: auto;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n }\n.fc .fc-timegrid-col.fc-day-today {\n background-color: rgba(255, 220, 40, 0.15);\n background-color: var(--fc-today-bg-color, rgba(255, 220, 40, 0.15));\n }\n.fc .fc-timegrid-col-frame {\n min-height: 100%; /* liquid-hack is below */\n position: relative;\n }\n.fc-media-screen.fc-liquid-hack .fc-timegrid-col-frame {\n height: auto;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n }\n.fc-media-screen .fc-timegrid-cols {\n position: absolute; /* no z-index. children will decide and go above slots */\n top: 0;\n left: 0;\n right: 0;\n bottom: 0\n }\n.fc-media-screen .fc-timegrid-cols > table {\n height: 100%;\n }\n.fc-media-screen .fc-timegrid-col-bg,\n .fc-media-screen .fc-timegrid-col-events,\n .fc-media-screen .fc-timegrid-now-indicator-container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n }\n.fc {\n\n /* bg */\n\n}\n.fc .fc-timegrid-col-bg {\n z-index: 2; /* TODO: kill */\n }\n.fc .fc-timegrid-col-bg .fc-non-business { z-index: 1 }\n.fc .fc-timegrid-col-bg .fc-bg-event { z-index: 2 }\n.fc .fc-timegrid-col-bg .fc-highlight { z-index: 3 }\n.fc .fc-timegrid-bg-harness {\n position: absolute; /* top/bottom will be set by JS */\n left: 0;\n right: 0;\n }\n.fc {\n\n /* fg events */\n /* (the mirror segs are put into a separate container with same classname, */\n /* and they must be after the normal seg container to appear at a higher z-index) */\n\n}\n.fc .fc-timegrid-col-events {\n z-index: 3;\n /* child event segs have z-indexes that are scoped within this div */\n }\n.fc {\n\n /* now indicator */\n\n}\n.fc .fc-timegrid-now-indicator-container {\n bottom: 0;\n overflow: hidden; /* don't let overflow of lines/arrows cause unnecessary scrolling */\n /* z-index is set on the individual elements */\n }\n.fc-direction-ltr .fc-timegrid-col-events {\n margin: 0 2.5% 0 2px;\n }\n.fc-direction-rtl .fc-timegrid-col-events {\n margin: 0 2px 0 2.5%;\n }\n.fc-timegrid-event-harness {\n position: absolute /* top/left/right/bottom will all be set by JS */\n}\n.fc-timegrid-event-harness > .fc-timegrid-event {\n position: absolute; /* absolute WITHIN the harness */\n top: 0; /* for when not yet positioned */\n bottom: 0; /* \" */\n left: 0;\n right: 0;\n }\n.fc-timegrid-event-harness-inset .fc-timegrid-event,\n.fc-timegrid-event.fc-event-mirror,\n.fc-timegrid-more-link {\n box-shadow: 0px 0px 0px 1px #fff;\n box-shadow: 0px 0px 0px 1px var(--fc-page-bg-color, #fff);\n}\n.fc-timegrid-event,\n.fc-timegrid-more-link { /* events need to be root */\n font-size: .85em;\n font-size: var(--fc-small-font-size, .85em);\n border-radius: 3px;\n}\n.fc-timegrid-event { /* events need to be root */\n margin-bottom: 1px /* give some space from bottom */\n}\n.fc-timegrid-event .fc-event-main {\n padding: 1px 1px 0;\n }\n.fc-timegrid-event .fc-event-time {\n white-space: nowrap;\n font-size: .85em;\n font-size: var(--fc-small-font-size, .85em);\n margin-bottom: 1px;\n }\n.fc-timegrid-event-short .fc-event-main-frame {\n flex-direction: row;\n overflow: hidden;\n }\n.fc-timegrid-event-short .fc-event-time:after {\n content: '\\00a0-\\00a0'; /* dash surrounded by non-breaking spaces */\n }\n.fc-timegrid-event-short .fc-event-title {\n font-size: .85em;\n font-size: var(--fc-small-font-size, .85em)\n }\n.fc-timegrid-more-link { /* does NOT inherit from fc-timegrid-event */\n position: absolute;\n z-index: 9999; /* hack */\n color: inherit;\n color: var(--fc-more-link-text-color, inherit);\n background: #d0d0d0;\n background: var(--fc-more-link-bg-color, #d0d0d0);\n cursor: pointer;\n margin-bottom: 1px; /* match space below fc-timegrid-event */\n}\n.fc-timegrid-more-link-inner { /* has fc-sticky */\n padding: 3px 2px;\n top: 0;\n}\n.fc-direction-ltr .fc-timegrid-more-link {\n right: 0;\n }\n.fc-direction-rtl .fc-timegrid-more-link {\n left: 0;\n }\n.fc {\n\n /* line */\n\n}\n.fc .fc-timegrid-now-indicator-line {\n position: absolute;\n z-index: 4;\n left: 0;\n right: 0;\n border-style: solid;\n border-color: red;\n border-color: var(--fc-now-indicator-color, red);\n border-width: 1px 0 0;\n }\n.fc {\n\n /* arrow */\n\n}\n.fc .fc-timegrid-now-indicator-arrow {\n position: absolute;\n z-index: 4;\n margin-top: -5px; /* vertically center on top coordinate */\n border-style: solid;\n border-color: red;\n border-color: var(--fc-now-indicator-color, red);\n }\n.fc-direction-ltr .fc-timegrid-now-indicator-arrow {\n left: 0;\n\n /* triangle pointing right. TODO: mixin */\n border-width: 5px 0 5px 6px;\n border-top-color: transparent;\n border-bottom-color: transparent;\n }\n.fc-direction-rtl .fc-timegrid-now-indicator-arrow {\n right: 0;\n\n /* triangle pointing left. TODO: mixin */\n border-width: 5px 6px 5px 0;\n border-top-color: transparent;\n border-bottom-color: transparent;\n }\n", ""]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
/***/ }),
/***/ "./node_modules/css-loader/dist/runtime/api.js":
/*!*****************************************************!*\
!*** ./node_modules/css-loader/dist/runtime/api.js ***!
\*****************************************************/
/***/ ((module) => {
"use strict";
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
// css base code, injected by the css-loader
// eslint-disable-next-line func-names
module.exports = function (cssWithMappingToString) {
var list = []; // return the list of modules as css string
list.toString = function toString() {
return this.map(function (item) {
var content = cssWithMappingToString(item);
if (item[2]) {
return "@media ".concat(item[2], " {").concat(content, "}");
}
return content;
}).join("");
}; // import a list of modules into the list
// eslint-disable-next-line func-names
list.i = function (modules, mediaQuery, dedupe) {
if (typeof modules === "string") {
// eslint-disable-next-line no-param-reassign
modules = [[null, modules, ""]];
}
var alreadyImportedModules = {};
if (dedupe) {
for (var i = 0; i < this.length; i++) {
// eslint-disable-next-line prefer-destructuring
var id = this[i][0];
if (id != null) {
alreadyImportedModules[id] = true;
}
}
}
for (var _i = 0; _i < modules.length; _i++) {
var item = [].concat(modules[_i]);
if (dedupe && alreadyImportedModules[item[0]]) {
// eslint-disable-next-line no-continue
continue;
}
if (mediaQuery) {
if (!item[2]) {
item[2] = mediaQuery;
} else {
item[2] = "".concat(mediaQuery, " and ").concat(item[2]);
}
}
list.push(item);
}
};
return list;
};
/***/ }),
/***/ "./node_modules/flatpickr/dist/esm/index.js":
/*!**************************************************!*\
!*** ./node_modules/flatpickr/dist/esm/index.js ***!
\**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _types_options__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types/options */ "./node_modules/flatpickr/dist/esm/types/options.js");
/* harmony import */ var _l10n_default__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./l10n/default */ "./node_modules/flatpickr/dist/esm/l10n/default.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/flatpickr/dist/esm/utils/index.js");
/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/dom */ "./node_modules/flatpickr/dist/esm/utils/dom.js");
/* harmony import */ var _utils_dates__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/dates */ "./node_modules/flatpickr/dist/esm/utils/dates.js");
/* harmony import */ var _utils_formatting__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/formatting */ "./node_modules/flatpickr/dist/esm/utils/formatting.js");
/* harmony import */ var _utils_polyfills__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/polyfills */ "./node_modules/flatpickr/dist/esm/utils/polyfills.js");
/* harmony import */ var _utils_polyfills__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_utils_polyfills__WEBPACK_IMPORTED_MODULE_6__);
var __assign = (undefined && undefined.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __spreadArrays = (undefined && undefined.__spreadArrays) || function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
var DEBOUNCED_CHANGE_MS = 300;
function FlatpickrInstance(element, instanceConfig) {
var self = {
config: __assign(__assign({}, _types_options__WEBPACK_IMPORTED_MODULE_0__.defaults), flatpickr.defaultConfig),
l10n: _l10n_default__WEBPACK_IMPORTED_MODULE_1__["default"],
};
self.parseDate = (0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.createDateParser)({ config: self.config, l10n: self.l10n });
self._handlers = [];
self.pluginElements = [];
self.loadedPlugins = [];
self._bind = bind;
self._setHoursFromDate = setHoursFromDate;
self._positionCalendar = positionCalendar;
self.changeMonth = changeMonth;
self.changeYear = changeYear;
self.clear = clear;
self.close = close;
self.onMouseOver = onMouseOver;
self._createElement = _utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement;
self.createDay = createDay;
self.destroy = destroy;
self.isEnabled = isEnabled;
self.jumpToDate = jumpToDate;
self.updateValue = updateValue;
self.open = open;
self.redraw = redraw;
self.set = set;
self.setDate = setDate;
self.toggle = toggle;
function setupHelperFunctions() {
self.utils = {
getDaysInMonth: function (month, yr) {
if (month === void 0) { month = self.currentMonth; }
if (yr === void 0) { yr = self.currentYear; }
if (month === 1 && ((yr % 4 === 0 && yr % 100 !== 0) || yr % 400 === 0))
return 29;
return self.l10n.daysInMonth[month];
},
};
}
function init() {
self.element = self.input = element;
self.isOpen = false;
parseConfig();
setupLocale();
setupInputs();
setupDates();
setupHelperFunctions();
if (!self.isMobile)
build();
bindEvents();
if (self.selectedDates.length || self.config.noCalendar) {
if (self.config.enableTime) {
setHoursFromDate(self.config.noCalendar ? self.latestSelectedDateObj : undefined);
}
updateValue(false);
}
setCalendarWidth();
var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
if (!self.isMobile && isSafari) {
positionCalendar();
}
triggerEvent("onReady");
}
function getClosestActiveElement() {
var _a;
return (((_a = self.calendarContainer) === null || _a === void 0 ? void 0 : _a.getRootNode())
.activeElement || document.activeElement);
}
function bindToInstance(fn) {
return fn.bind(self);
}
function setCalendarWidth() {
var config = self.config;
if (config.weekNumbers === false && config.showMonths === 1) {
return;
}
else if (config.noCalendar !== true) {
window.requestAnimationFrame(function () {
if (self.calendarContainer !== undefined) {
self.calendarContainer.style.visibility = "hidden";
self.calendarContainer.style.display = "block";
}
if (self.daysContainer !== undefined) {
var daysWidth = (self.days.offsetWidth + 1) * config.showMonths;
self.daysContainer.style.width = daysWidth + "px";
self.calendarContainer.style.width =
daysWidth +
(self.weekWrapper !== undefined
? self.weekWrapper.offsetWidth
: 0) +
"px";
self.calendarContainer.style.removeProperty("visibility");
self.calendarContainer.style.removeProperty("display");
}
});
}
}
function updateTime(e) {
if (self.selectedDates.length === 0) {
var defaultDate = self.config.minDate === undefined ||
(0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.compareDates)(new Date(), self.config.minDate) >= 0
? new Date()
: new Date(self.config.minDate.getTime());
var defaults = (0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.getDefaultHours)(self.config);
defaultDate.setHours(defaults.hours, defaults.minutes, defaults.seconds, defaultDate.getMilliseconds());
self.selectedDates = [defaultDate];
self.latestSelectedDateObj = defaultDate;
}
if (e !== undefined && e.type !== "blur") {
timeWrapper(e);
}
var prevValue = self._input.value;
setHoursFromInputs();
updateValue();
if (self._input.value !== prevValue) {
self._debouncedChange();
}
}
function ampm2military(hour, amPM) {
return (hour % 12) + 12 * (0,_utils__WEBPACK_IMPORTED_MODULE_2__.int)(amPM === self.l10n.amPM[1]);
}
function military2ampm(hour) {
switch (hour % 24) {
case 0:
case 12:
return 12;
default:
return hour % 12;
}
}
function setHoursFromInputs() {
if (self.hourElement === undefined || self.minuteElement === undefined)
return;
var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24, minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, seconds = self.secondElement !== undefined
? (parseInt(self.secondElement.value, 10) || 0) % 60
: 0;
if (self.amPM !== undefined) {
hours = ampm2military(hours, self.amPM.textContent);
}
var limitMinHours = self.config.minTime !== undefined ||
(self.config.minDate &&
self.minDateHasTime &&
self.latestSelectedDateObj &&
(0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.compareDates)(self.latestSelectedDateObj, self.config.minDate, true) ===
0);
var limitMaxHours = self.config.maxTime !== undefined ||
(self.config.maxDate &&
self.maxDateHasTime &&
self.latestSelectedDateObj &&
(0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.compareDates)(self.latestSelectedDateObj, self.config.maxDate, true) ===
0);
if (self.config.maxTime !== undefined &&
self.config.minTime !== undefined &&
self.config.minTime > self.config.maxTime) {
var minBound = (0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.calculateSecondsSinceMidnight)(self.config.minTime.getHours(), self.config.minTime.getMinutes(), self.config.minTime.getSeconds());
var maxBound = (0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.calculateSecondsSinceMidnight)(self.config.maxTime.getHours(), self.config.maxTime.getMinutes(), self.config.maxTime.getSeconds());
var currentTime = (0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.calculateSecondsSinceMidnight)(hours, minutes, seconds);
if (currentTime > maxBound && currentTime < minBound) {
var result = (0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.parseSeconds)(minBound);
hours = result[0];
minutes = result[1];
seconds = result[2];
}
}
else {
if (limitMaxHours) {
var maxTime = self.config.maxTime !== undefined
? self.config.maxTime
: self.config.maxDate;
hours = Math.min(hours, maxTime.getHours());
if (hours === maxTime.getHours())
minutes = Math.min(minutes, maxTime.getMinutes());
if (minutes === maxTime.getMinutes())
seconds = Math.min(seconds, maxTime.getSeconds());
}
if (limitMinHours) {
var minTime = self.config.minTime !== undefined
? self.config.minTime
: self.config.minDate;
hours = Math.max(hours, minTime.getHours());
if (hours === minTime.getHours() && minutes < minTime.getMinutes())
minutes = minTime.getMinutes();
if (minutes === minTime.getMinutes())
seconds = Math.max(seconds, minTime.getSeconds());
}
}
setHours(hours, minutes, seconds);
}
function setHoursFromDate(dateObj) {
var date = dateObj || self.latestSelectedDateObj;
if (date && date instanceof Date) {
setHours(date.getHours(), date.getMinutes(), date.getSeconds());
}
}
function setHours(hours, minutes, seconds) {
if (self.latestSelectedDateObj !== undefined) {
self.latestSelectedDateObj.setHours(hours % 24, minutes, seconds || 0, 0);
}
if (!self.hourElement || !self.minuteElement || self.isMobile)
return;
self.hourElement.value = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.pad)(!self.config.time_24hr
? ((12 + hours) % 12) + 12 * (0,_utils__WEBPACK_IMPORTED_MODULE_2__.int)(hours % 12 === 0)
: hours);
self.minuteElement.value = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.pad)(minutes);
if (self.amPM !== undefined)
self.amPM.textContent = self.l10n.amPM[(0,_utils__WEBPACK_IMPORTED_MODULE_2__.int)(hours >= 12)];
if (self.secondElement !== undefined)
self.secondElement.value = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.pad)(seconds);
}
function onYearInput(event) {
var eventTarget = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.getEventTarget)(event);
var year = parseInt(eventTarget.value) + (event.delta || 0);
if (year / 1000 > 1 ||
(event.key === "Enter" && !/[^\d]/.test(year.toString()))) {
changeYear(year);
}
}
function bind(element, event, handler, options) {
if (event instanceof Array)
return event.forEach(function (ev) { return bind(element, ev, handler, options); });
if (element instanceof Array)
return element.forEach(function (el) { return bind(el, event, handler, options); });
element.addEventListener(event, handler, options);
self._handlers.push({
remove: function () { return element.removeEventListener(event, handler, options); },
});
}
function triggerChange() {
triggerEvent("onChange");
}
function bindEvents() {
if (self.config.wrap) {
["open", "close", "toggle", "clear"].forEach(function (evt) {
Array.prototype.forEach.call(self.element.querySelectorAll("[data-" + evt + "]"), function (el) {
return bind(el, "click", self[evt]);
});
});
}
if (self.isMobile) {
setupMobile();
return;
}
var debouncedResize = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.debounce)(onResize, 50);
self._debouncedChange = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.debounce)(triggerChange, DEBOUNCED_CHANGE_MS);
if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent))
bind(self.daysContainer, "mouseover", function (e) {
if (self.config.mode === "range")
onMouseOver((0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.getEventTarget)(e));
});
bind(self._input, "keydown", onKeyDown);
if (self.calendarContainer !== undefined) {
bind(self.calendarContainer, "keydown", onKeyDown);
}
if (!self.config.inline && !self.config.static)
bind(window, "resize", debouncedResize);
if (window.ontouchstart !== undefined)
bind(window.document, "touchstart", documentClick);
else
bind(window.document, "mousedown", documentClick);
bind(window.document, "focus", documentClick, { capture: true });
if (self.config.clickOpens === true) {
bind(self._input, "focus", self.open);
bind(self._input, "click", self.open);
}
if (self.daysContainer !== undefined) {
bind(self.monthNav, "click", onMonthNavClick);
bind(self.monthNav, ["keyup", "increment"], onYearInput);
bind(self.daysContainer, "click", selectDate);
}
if (self.timeContainer !== undefined &&
self.minuteElement !== undefined &&
self.hourElement !== undefined) {
var selText = function (e) {
return (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.getEventTarget)(e).select();
};
bind(self.timeContainer, ["increment"], updateTime);
bind(self.timeContainer, "blur", updateTime, { capture: true });
bind(self.timeContainer, "click", timeIncrement);
bind([self.hourElement, self.minuteElement], ["focus", "click"], selText);
if (self.secondElement !== undefined)
bind(self.secondElement, "focus", function () { return self.secondElement && self.secondElement.select(); });
if (self.amPM !== undefined) {
bind(self.amPM, "click", function (e) {
updateTime(e);
});
}
}
if (self.config.allowInput) {
bind(self._input, "blur", onBlur);
}
}
function jumpToDate(jumpDate, triggerChange) {
var jumpTo = jumpDate !== undefined
? self.parseDate(jumpDate)
: self.latestSelectedDateObj ||
(self.config.minDate && self.config.minDate > self.now
? self.config.minDate
: self.config.maxDate && self.config.maxDate < self.now
? self.config.maxDate
: self.now);
var oldYear = self.currentYear;
var oldMonth = self.currentMonth;
try {
if (jumpTo !== undefined) {
self.currentYear = jumpTo.getFullYear();
self.currentMonth = jumpTo.getMonth();
}
}
catch (e) {
e.message = "Invalid date supplied: " + jumpTo;
self.config.errorHandler(e);
}
if (triggerChange && self.currentYear !== oldYear) {
triggerEvent("onYearChange");
buildMonthSwitch();
}
if (triggerChange &&
(self.currentYear !== oldYear || self.currentMonth !== oldMonth)) {
triggerEvent("onMonthChange");
}
self.redraw();
}
function timeIncrement(e) {
var eventTarget = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.getEventTarget)(e);
if (~eventTarget.className.indexOf("arrow"))
incrementNumInput(e, eventTarget.classList.contains("arrowUp") ? 1 : -1);
}
function incrementNumInput(e, delta, inputElem) {
var target = e && (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.getEventTarget)(e);
var input = inputElem ||
(target && target.parentNode && target.parentNode.firstChild);
var event = createEvent("increment");
event.delta = delta;
input && input.dispatchEvent(event);
}
function build() {
var fragment = window.document.createDocumentFragment();
self.calendarContainer = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("div", "flatpickr-calendar");
self.calendarContainer.tabIndex = -1;
if (!self.config.noCalendar) {
fragment.appendChild(buildMonthNav());
self.innerContainer = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("div", "flatpickr-innerContainer");
if (self.config.weekNumbers) {
var _a = buildWeeks(), weekWrapper = _a.weekWrapper, weekNumbers = _a.weekNumbers;
self.innerContainer.appendChild(weekWrapper);
self.weekNumbers = weekNumbers;
self.weekWrapper = weekWrapper;
}
self.rContainer = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("div", "flatpickr-rContainer");
self.rContainer.appendChild(buildWeekdays());
if (!self.daysContainer) {
self.daysContainer = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("div", "flatpickr-days");
self.daysContainer.tabIndex = -1;
}
buildDays();
self.rContainer.appendChild(self.daysContainer);
self.innerContainer.appendChild(self.rContainer);
fragment.appendChild(self.innerContainer);
}
if (self.config.enableTime) {
fragment.appendChild(buildTime());
}
(0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.toggleClass)(self.calendarContainer, "rangeMode", self.config.mode === "range");
(0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.toggleClass)(self.calendarContainer, "animate", self.config.animate === true);
(0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.toggleClass)(self.calendarContainer, "multiMonth", self.config.showMonths > 1);
self.calendarContainer.appendChild(fragment);
var customAppend = self.config.appendTo !== undefined &&
self.config.appendTo.nodeType !== undefined;
if (self.config.inline || self.config.static) {
self.calendarContainer.classList.add(self.config.inline ? "inline" : "static");
if (self.config.inline) {
if (!customAppend && self.element.parentNode)
self.element.parentNode.insertBefore(self.calendarContainer, self._input.nextSibling);
else if (self.config.appendTo !== undefined)
self.config.appendTo.appendChild(self.calendarContainer);
}
if (self.config.static) {
var wrapper = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("div", "flatpickr-wrapper");
if (self.element.parentNode)
self.element.parentNode.insertBefore(wrapper, self.element);
wrapper.appendChild(self.element);
if (self.altInput)
wrapper.appendChild(self.altInput);
wrapper.appendChild(self.calendarContainer);
}
}
if (!self.config.static && !self.config.inline)
(self.config.appendTo !== undefined
? self.config.appendTo
: window.document.body).appendChild(self.calendarContainer);
}
function createDay(className, date, _dayNumber, i) {
var dateIsEnabled = isEnabled(date, true), dayElement = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("span", className, date.getDate().toString());
dayElement.dateObj = date;
dayElement.$i = i;
dayElement.setAttribute("aria-label", self.formatDate(date, self.config.ariaDateFormat));
if (className.indexOf("hidden") === -1 &&
(0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.compareDates)(date, self.now) === 0) {
self.todayDateElem = dayElement;
dayElement.classList.add("today");
dayElement.setAttribute("aria-current", "date");
}
if (dateIsEnabled) {
dayElement.tabIndex = -1;
if (isDateSelected(date)) {
dayElement.classList.add("selected");
self.selectedDateElem = dayElement;
if (self.config.mode === "range") {
(0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.toggleClass)(dayElement, "startRange", self.selectedDates[0] &&
(0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.compareDates)(date, self.selectedDates[0], true) === 0);
(0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.toggleClass)(dayElement, "endRange", self.selectedDates[1] &&
(0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.compareDates)(date, self.selectedDates[1], true) === 0);
if (className === "nextMonthDay")
dayElement.classList.add("inRange");
}
}
}
else {
dayElement.classList.add("flatpickr-disabled");
}
if (self.config.mode === "range") {
if (isDateInRange(date) && !isDateSelected(date))
dayElement.classList.add("inRange");
}
if (self.weekNumbers &&
self.config.showMonths === 1 &&
className !== "prevMonthDay" &&
i % 7 === 6) {
self.weekNumbers.insertAdjacentHTML("beforeend", "" + self.config.getWeek(date) + "");
}
triggerEvent("onDayCreate", dayElement);
return dayElement;
}
function focusOnDayElem(targetNode) {
targetNode.focus();
if (self.config.mode === "range")
onMouseOver(targetNode);
}
function getFirstAvailableDay(delta) {
var startMonth = delta > 0 ? 0 : self.config.showMonths - 1;
var endMonth = delta > 0 ? self.config.showMonths : -1;
for (var m = startMonth; m != endMonth; m += delta) {
var month = self.daysContainer.children[m];
var startIndex = delta > 0 ? 0 : month.children.length - 1;
var endIndex = delta > 0 ? month.children.length : -1;
for (var i = startIndex; i != endIndex; i += delta) {
var c = month.children[i];
if (c.className.indexOf("hidden") === -1 && isEnabled(c.dateObj))
return c;
}
}
return undefined;
}
function getNextAvailableDay(current, delta) {
var givenMonth = current.className.indexOf("Month") === -1
? current.dateObj.getMonth()
: self.currentMonth;
var endMonth = delta > 0 ? self.config.showMonths : -1;
var loopDelta = delta > 0 ? 1 : -1;
for (var m = givenMonth - self.currentMonth; m != endMonth; m += loopDelta) {
var month = self.daysContainer.children[m];
var startIndex = givenMonth - self.currentMonth === m
? current.$i + delta
: delta < 0
? month.children.length - 1
: 0;
var numMonthDays = month.children.length;
for (var i = startIndex; i >= 0 && i < numMonthDays && i != (delta > 0 ? numMonthDays : -1); i += loopDelta) {
var c = month.children[i];
if (c.className.indexOf("hidden") === -1 &&
isEnabled(c.dateObj) &&
Math.abs(current.$i - i) >= Math.abs(delta))
return focusOnDayElem(c);
}
}
self.changeMonth(loopDelta);
focusOnDay(getFirstAvailableDay(loopDelta), 0);
return undefined;
}
function focusOnDay(current, offset) {
var activeElement = getClosestActiveElement();
var dayFocused = isInView(activeElement || document.body);
var startElem = current !== undefined
? current
: dayFocused
? activeElement
: self.selectedDateElem !== undefined && isInView(self.selectedDateElem)
? self.selectedDateElem
: self.todayDateElem !== undefined && isInView(self.todayDateElem)
? self.todayDateElem
: getFirstAvailableDay(offset > 0 ? 1 : -1);
if (startElem === undefined) {
self._input.focus();
}
else if (!dayFocused) {
focusOnDayElem(startElem);
}
else {
getNextAvailableDay(startElem, offset);
}
}
function buildMonthDays(year, month) {
var firstOfMonth = (new Date(year, month, 1).getDay() - self.l10n.firstDayOfWeek + 7) % 7;
var prevMonthDays = self.utils.getDaysInMonth((month - 1 + 12) % 12, year);
var daysInMonth = self.utils.getDaysInMonth(month, year), days = window.document.createDocumentFragment(), isMultiMonth = self.config.showMonths > 1, prevMonthDayClass = isMultiMonth ? "prevMonthDay hidden" : "prevMonthDay", nextMonthDayClass = isMultiMonth ? "nextMonthDay hidden" : "nextMonthDay";
var dayNumber = prevMonthDays + 1 - firstOfMonth, dayIndex = 0;
for (; dayNumber <= prevMonthDays; dayNumber++, dayIndex++) {
days.appendChild(createDay("flatpickr-day " + prevMonthDayClass, new Date(year, month - 1, dayNumber), dayNumber, dayIndex));
}
for (dayNumber = 1; dayNumber <= daysInMonth; dayNumber++, dayIndex++) {
days.appendChild(createDay("flatpickr-day", new Date(year, month, dayNumber), dayNumber, dayIndex));
}
for (var dayNum = daysInMonth + 1; dayNum <= 42 - firstOfMonth &&
(self.config.showMonths === 1 || dayIndex % 7 !== 0); dayNum++, dayIndex++) {
days.appendChild(createDay("flatpickr-day " + nextMonthDayClass, new Date(year, month + 1, dayNum % daysInMonth), dayNum, dayIndex));
}
var dayContainer = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("div", "dayContainer");
dayContainer.appendChild(days);
return dayContainer;
}
function buildDays() {
if (self.daysContainer === undefined) {
return;
}
(0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.clearNode)(self.daysContainer);
if (self.weekNumbers)
(0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.clearNode)(self.weekNumbers);
var frag = document.createDocumentFragment();
for (var i = 0; i < self.config.showMonths; i++) {
var d = new Date(self.currentYear, self.currentMonth, 1);
d.setMonth(self.currentMonth + i);
frag.appendChild(buildMonthDays(d.getFullYear(), d.getMonth()));
}
self.daysContainer.appendChild(frag);
self.days = self.daysContainer.firstChild;
if (self.config.mode === "range" && self.selectedDates.length === 1) {
onMouseOver();
}
}
function buildMonthSwitch() {
if (self.config.showMonths > 1 ||
self.config.monthSelectorType !== "dropdown")
return;
var shouldBuildMonth = function (month) {
if (self.config.minDate !== undefined &&
self.currentYear === self.config.minDate.getFullYear() &&
month < self.config.minDate.getMonth()) {
return false;
}
return !(self.config.maxDate !== undefined &&
self.currentYear === self.config.maxDate.getFullYear() &&
month > self.config.maxDate.getMonth());
};
self.monthsDropdownContainer.tabIndex = -1;
self.monthsDropdownContainer.innerHTML = "";
for (var i = 0; i < 12; i++) {
if (!shouldBuildMonth(i))
continue;
var month = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("option", "flatpickr-monthDropdown-month");
month.value = new Date(self.currentYear, i).getMonth().toString();
month.textContent = (0,_utils_formatting__WEBPACK_IMPORTED_MODULE_5__.monthToStr)(i, self.config.shorthandCurrentMonth, self.l10n);
month.tabIndex = -1;
if (self.currentMonth === i) {
month.selected = true;
}
self.monthsDropdownContainer.appendChild(month);
}
}
function buildMonth() {
var container = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("div", "flatpickr-month");
var monthNavFragment = window.document.createDocumentFragment();
var monthElement;
if (self.config.showMonths > 1 ||
self.config.monthSelectorType === "static") {
monthElement = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("span", "cur-month");
}
else {
self.monthsDropdownContainer = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("select", "flatpickr-monthDropdown-months");
self.monthsDropdownContainer.setAttribute("aria-label", self.l10n.monthAriaLabel);
bind(self.monthsDropdownContainer, "change", function (e) {
var target = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.getEventTarget)(e);
var selectedMonth = parseInt(target.value, 10);
self.changeMonth(selectedMonth - self.currentMonth);
triggerEvent("onMonthChange");
});
buildMonthSwitch();
monthElement = self.monthsDropdownContainer;
}
var yearInput = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createNumberInput)("cur-year", { tabindex: "-1" });
var yearElement = yearInput.getElementsByTagName("input")[0];
yearElement.setAttribute("aria-label", self.l10n.yearAriaLabel);
if (self.config.minDate) {
yearElement.setAttribute("min", self.config.minDate.getFullYear().toString());
}
if (self.config.maxDate) {
yearElement.setAttribute("max", self.config.maxDate.getFullYear().toString());
yearElement.disabled =
!!self.config.minDate &&
self.config.minDate.getFullYear() === self.config.maxDate.getFullYear();
}
var currentMonth = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("div", "flatpickr-current-month");
currentMonth.appendChild(monthElement);
currentMonth.appendChild(yearInput);
monthNavFragment.appendChild(currentMonth);
container.appendChild(monthNavFragment);
return {
container: container,
yearElement: yearElement,
monthElement: monthElement,
};
}
function buildMonths() {
(0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.clearNode)(self.monthNav);
self.monthNav.appendChild(self.prevMonthNav);
if (self.config.showMonths) {
self.yearElements = [];
self.monthElements = [];
}
for (var m = self.config.showMonths; m--;) {
var month = buildMonth();
self.yearElements.push(month.yearElement);
self.monthElements.push(month.monthElement);
self.monthNav.appendChild(month.container);
}
self.monthNav.appendChild(self.nextMonthNav);
}
function buildMonthNav() {
self.monthNav = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("div", "flatpickr-months");
self.yearElements = [];
self.monthElements = [];
self.prevMonthNav = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("span", "flatpickr-prev-month");
self.prevMonthNav.innerHTML = self.config.prevArrow;
self.nextMonthNav = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("span", "flatpickr-next-month");
self.nextMonthNav.innerHTML = self.config.nextArrow;
buildMonths();
Object.defineProperty(self, "_hidePrevMonthArrow", {
get: function () { return self.__hidePrevMonthArrow; },
set: function (bool) {
if (self.__hidePrevMonthArrow !== bool) {
(0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.toggleClass)(self.prevMonthNav, "flatpickr-disabled", bool);
self.__hidePrevMonthArrow = bool;
}
},
});
Object.defineProperty(self, "_hideNextMonthArrow", {
get: function () { return self.__hideNextMonthArrow; },
set: function (bool) {
if (self.__hideNextMonthArrow !== bool) {
(0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.toggleClass)(self.nextMonthNav, "flatpickr-disabled", bool);
self.__hideNextMonthArrow = bool;
}
},
});
self.currentYearElement = self.yearElements[0];
updateNavigationCurrentMonth();
return self.monthNav;
}
function buildTime() {
self.calendarContainer.classList.add("hasTime");
if (self.config.noCalendar)
self.calendarContainer.classList.add("noCalendar");
var defaults = (0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.getDefaultHours)(self.config);
self.timeContainer = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("div", "flatpickr-time");
self.timeContainer.tabIndex = -1;
var separator = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("span", "flatpickr-time-separator", ":");
var hourInput = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createNumberInput)("flatpickr-hour", {
"aria-label": self.l10n.hourAriaLabel,
});
self.hourElement = hourInput.getElementsByTagName("input")[0];
var minuteInput = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createNumberInput)("flatpickr-minute", {
"aria-label": self.l10n.minuteAriaLabel,
});
self.minuteElement = minuteInput.getElementsByTagName("input")[0];
self.hourElement.tabIndex = self.minuteElement.tabIndex = -1;
self.hourElement.value = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.pad)(self.latestSelectedDateObj
? self.latestSelectedDateObj.getHours()
: self.config.time_24hr
? defaults.hours
: military2ampm(defaults.hours));
self.minuteElement.value = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.pad)(self.latestSelectedDateObj
? self.latestSelectedDateObj.getMinutes()
: defaults.minutes);
self.hourElement.setAttribute("step", self.config.hourIncrement.toString());
self.minuteElement.setAttribute("step", self.config.minuteIncrement.toString());
self.hourElement.setAttribute("min", self.config.time_24hr ? "0" : "1");
self.hourElement.setAttribute("max", self.config.time_24hr ? "23" : "12");
self.hourElement.setAttribute("maxlength", "2");
self.minuteElement.setAttribute("min", "0");
self.minuteElement.setAttribute("max", "59");
self.minuteElement.setAttribute("maxlength", "2");
self.timeContainer.appendChild(hourInput);
self.timeContainer.appendChild(separator);
self.timeContainer.appendChild(minuteInput);
if (self.config.time_24hr)
self.timeContainer.classList.add("time24hr");
if (self.config.enableSeconds) {
self.timeContainer.classList.add("hasSeconds");
var secondInput = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createNumberInput)("flatpickr-second");
self.secondElement = secondInput.getElementsByTagName("input")[0];
self.secondElement.value = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.pad)(self.latestSelectedDateObj
? self.latestSelectedDateObj.getSeconds()
: defaults.seconds);
self.secondElement.setAttribute("step", self.minuteElement.getAttribute("step"));
self.secondElement.setAttribute("min", "0");
self.secondElement.setAttribute("max", "59");
self.secondElement.setAttribute("maxlength", "2");
self.timeContainer.appendChild((0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("span", "flatpickr-time-separator", ":"));
self.timeContainer.appendChild(secondInput);
}
if (!self.config.time_24hr) {
self.amPM = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("span", "flatpickr-am-pm", self.l10n.amPM[(0,_utils__WEBPACK_IMPORTED_MODULE_2__.int)((self.latestSelectedDateObj
? self.hourElement.value
: self.config.defaultHour) > 11)]);
self.amPM.title = self.l10n.toggleTitle;
self.amPM.tabIndex = -1;
self.timeContainer.appendChild(self.amPM);
}
return self.timeContainer;
}
function buildWeekdays() {
if (!self.weekdayContainer)
self.weekdayContainer = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("div", "flatpickr-weekdays");
else
(0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.clearNode)(self.weekdayContainer);
for (var i = self.config.showMonths; i--;) {
var container = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("div", "flatpickr-weekdaycontainer");
self.weekdayContainer.appendChild(container);
}
updateWeekdays();
return self.weekdayContainer;
}
function updateWeekdays() {
if (!self.weekdayContainer) {
return;
}
var firstDayOfWeek = self.l10n.firstDayOfWeek;
var weekdays = __spreadArrays(self.l10n.weekdays.shorthand);
if (firstDayOfWeek > 0 && firstDayOfWeek < weekdays.length) {
weekdays = __spreadArrays(weekdays.splice(firstDayOfWeek, weekdays.length), weekdays.splice(0, firstDayOfWeek));
}
for (var i = self.config.showMonths; i--;) {
self.weekdayContainer.children[i].innerHTML = "\n \n " + weekdays.join("") + "\n \n ";
}
}
function buildWeeks() {
self.calendarContainer.classList.add("hasWeeks");
var weekWrapper = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("div", "flatpickr-weekwrapper");
weekWrapper.appendChild((0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("span", "flatpickr-weekday", self.l10n.weekAbbreviation));
var weekNumbers = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("div", "flatpickr-weeks");
weekWrapper.appendChild(weekNumbers);
return {
weekWrapper: weekWrapper,
weekNumbers: weekNumbers,
};
}
function changeMonth(value, isOffset) {
if (isOffset === void 0) { isOffset = true; }
var delta = isOffset ? value : value - self.currentMonth;
if ((delta < 0 && self._hidePrevMonthArrow === true) ||
(delta > 0 && self._hideNextMonthArrow === true))
return;
self.currentMonth += delta;
if (self.currentMonth < 0 || self.currentMonth > 11) {
self.currentYear += self.currentMonth > 11 ? 1 : -1;
self.currentMonth = (self.currentMonth + 12) % 12;
triggerEvent("onYearChange");
buildMonthSwitch();
}
buildDays();
triggerEvent("onMonthChange");
updateNavigationCurrentMonth();
}
function clear(triggerChangeEvent, toInitial) {
if (triggerChangeEvent === void 0) { triggerChangeEvent = true; }
if (toInitial === void 0) { toInitial = true; }
self.input.value = "";
if (self.altInput !== undefined)
self.altInput.value = "";
if (self.mobileInput !== undefined)
self.mobileInput.value = "";
self.selectedDates = [];
self.latestSelectedDateObj = undefined;
if (toInitial === true) {
self.currentYear = self._initialDate.getFullYear();
self.currentMonth = self._initialDate.getMonth();
}
if (self.config.enableTime === true) {
var _a = (0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.getDefaultHours)(self.config), hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds;
setHours(hours, minutes, seconds);
}
self.redraw();
if (triggerChangeEvent)
triggerEvent("onChange");
}
function close() {
self.isOpen = false;
if (!self.isMobile) {
if (self.calendarContainer !== undefined) {
self.calendarContainer.classList.remove("open");
}
if (self._input !== undefined) {
self._input.classList.remove("active");
}
}
triggerEvent("onClose");
}
function destroy() {
if (self.config !== undefined)
triggerEvent("onDestroy");
for (var i = self._handlers.length; i--;) {
self._handlers[i].remove();
}
self._handlers = [];
if (self.mobileInput) {
if (self.mobileInput.parentNode)
self.mobileInput.parentNode.removeChild(self.mobileInput);
self.mobileInput = undefined;
}
else if (self.calendarContainer && self.calendarContainer.parentNode) {
if (self.config.static && self.calendarContainer.parentNode) {
var wrapper = self.calendarContainer.parentNode;
wrapper.lastChild && wrapper.removeChild(wrapper.lastChild);
if (wrapper.parentNode) {
while (wrapper.firstChild)
wrapper.parentNode.insertBefore(wrapper.firstChild, wrapper);
wrapper.parentNode.removeChild(wrapper);
}
}
else
self.calendarContainer.parentNode.removeChild(self.calendarContainer);
}
if (self.altInput) {
self.input.type = "text";
if (self.altInput.parentNode)
self.altInput.parentNode.removeChild(self.altInput);
delete self.altInput;
}
if (self.input) {
self.input.type = self.input._type;
self.input.classList.remove("flatpickr-input");
self.input.removeAttribute("readonly");
}
[
"_showTimeInput",
"latestSelectedDateObj",
"_hideNextMonthArrow",
"_hidePrevMonthArrow",
"__hideNextMonthArrow",
"__hidePrevMonthArrow",
"isMobile",
"isOpen",
"selectedDateElem",
"minDateHasTime",
"maxDateHasTime",
"days",
"daysContainer",
"_input",
"_positionElement",
"innerContainer",
"rContainer",
"monthNav",
"todayDateElem",
"calendarContainer",
"weekdayContainer",
"prevMonthNav",
"nextMonthNav",
"monthsDropdownContainer",
"currentMonthElement",
"currentYearElement",
"navigationCurrentMonth",
"selectedDateElem",
"config",
].forEach(function (k) {
try {
delete self[k];
}
catch (_) { }
});
}
function isCalendarElem(elem) {
return self.calendarContainer.contains(elem);
}
function documentClick(e) {
if (self.isOpen && !self.config.inline) {
var eventTarget_1 = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.getEventTarget)(e);
var isCalendarElement = isCalendarElem(eventTarget_1);
var isInput = eventTarget_1 === self.input ||
eventTarget_1 === self.altInput ||
self.element.contains(eventTarget_1) ||
(e.path &&
e.path.indexOf &&
(~e.path.indexOf(self.input) ||
~e.path.indexOf(self.altInput)));
var lostFocus = !isInput &&
!isCalendarElement &&
!isCalendarElem(e.relatedTarget);
var isIgnored = !self.config.ignoredFocusElements.some(function (elem) {
return elem.contains(eventTarget_1);
});
if (lostFocus && isIgnored) {
if (self.config.allowInput) {
self.setDate(self._input.value, false, self.config.altInput
? self.config.altFormat
: self.config.dateFormat);
}
if (self.timeContainer !== undefined &&
self.minuteElement !== undefined &&
self.hourElement !== undefined &&
self.input.value !== "" &&
self.input.value !== undefined) {
updateTime();
}
self.close();
if (self.config &&
self.config.mode === "range" &&
self.selectedDates.length === 1)
self.clear(false);
}
}
}
function changeYear(newYear) {
if (!newYear ||
(self.config.minDate && newYear < self.config.minDate.getFullYear()) ||
(self.config.maxDate && newYear > self.config.maxDate.getFullYear()))
return;
var newYearNum = newYear, isNewYear = self.currentYear !== newYearNum;
self.currentYear = newYearNum || self.currentYear;
if (self.config.maxDate &&
self.currentYear === self.config.maxDate.getFullYear()) {
self.currentMonth = Math.min(self.config.maxDate.getMonth(), self.currentMonth);
}
else if (self.config.minDate &&
self.currentYear === self.config.minDate.getFullYear()) {
self.currentMonth = Math.max(self.config.minDate.getMonth(), self.currentMonth);
}
if (isNewYear) {
self.redraw();
triggerEvent("onYearChange");
buildMonthSwitch();
}
}
function isEnabled(date, timeless) {
var _a;
if (timeless === void 0) { timeless = true; }
var dateToCheck = self.parseDate(date, undefined, timeless);
if ((self.config.minDate &&
dateToCheck &&
(0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.compareDates)(dateToCheck, self.config.minDate, timeless !== undefined ? timeless : !self.minDateHasTime) < 0) ||
(self.config.maxDate &&
dateToCheck &&
(0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.compareDates)(dateToCheck, self.config.maxDate, timeless !== undefined ? timeless : !self.maxDateHasTime) > 0))
return false;
if (!self.config.enable && self.config.disable.length === 0)
return true;
if (dateToCheck === undefined)
return false;
var bool = !!self.config.enable, array = (_a = self.config.enable) !== null && _a !== void 0 ? _a : self.config.disable;
for (var i = 0, d = void 0; i < array.length; i++) {
d = array[i];
if (typeof d === "function" &&
d(dateToCheck))
return bool;
else if (d instanceof Date &&
dateToCheck !== undefined &&
d.getTime() === dateToCheck.getTime())
return bool;
else if (typeof d === "string") {
var parsed = self.parseDate(d, undefined, true);
return parsed && parsed.getTime() === dateToCheck.getTime()
? bool
: !bool;
}
else if (typeof d === "object" &&
dateToCheck !== undefined &&
d.from &&
d.to &&
dateToCheck.getTime() >= d.from.getTime() &&
dateToCheck.getTime() <= d.to.getTime())
return bool;
}
return !bool;
}
function isInView(elem) {
if (self.daysContainer !== undefined)
return (elem.className.indexOf("hidden") === -1 &&
elem.className.indexOf("flatpickr-disabled") === -1 &&
self.daysContainer.contains(elem));
return false;
}
function onBlur(e) {
var isInput = e.target === self._input;
var valueChanged = self._input.value.trimEnd() !== getDateStr();
if (isInput &&
valueChanged &&
!(e.relatedTarget && isCalendarElem(e.relatedTarget))) {
self.setDate(self._input.value, true, e.target === self.altInput
? self.config.altFormat
: self.config.dateFormat);
}
}
function onKeyDown(e) {
var eventTarget = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.getEventTarget)(e);
var isInput = self.config.wrap
? element.contains(eventTarget)
: eventTarget === self._input;
var allowInput = self.config.allowInput;
var allowKeydown = self.isOpen && (!allowInput || !isInput);
var allowInlineKeydown = self.config.inline && isInput && !allowInput;
if (e.keyCode === 13 && isInput) {
if (allowInput) {
self.setDate(self._input.value, true, eventTarget === self.altInput
? self.config.altFormat
: self.config.dateFormat);
self.close();
return eventTarget.blur();
}
else {
self.open();
}
}
else if (isCalendarElem(eventTarget) ||
allowKeydown ||
allowInlineKeydown) {
var isTimeObj = !!self.timeContainer &&
self.timeContainer.contains(eventTarget);
switch (e.keyCode) {
case 13:
if (isTimeObj) {
e.preventDefault();
updateTime();
focusAndClose();
}
else
selectDate(e);
break;
case 27:
e.preventDefault();
focusAndClose();
break;
case 8:
case 46:
if (isInput && !self.config.allowInput) {
e.preventDefault();
self.clear();
}
break;
case 37:
case 39:
if (!isTimeObj && !isInput) {
e.preventDefault();
var activeElement = getClosestActiveElement();
if (self.daysContainer !== undefined &&
(allowInput === false ||
(activeElement && isInView(activeElement)))) {
var delta_1 = e.keyCode === 39 ? 1 : -1;
if (!e.ctrlKey)
focusOnDay(undefined, delta_1);
else {
e.stopPropagation();
changeMonth(delta_1);
focusOnDay(getFirstAvailableDay(1), 0);
}
}
}
else if (self.hourElement)
self.hourElement.focus();
break;
case 38:
case 40:
e.preventDefault();
var delta = e.keyCode === 40 ? 1 : -1;
if ((self.daysContainer &&
eventTarget.$i !== undefined) ||
eventTarget === self.input ||
eventTarget === self.altInput) {
if (e.ctrlKey) {
e.stopPropagation();
changeYear(self.currentYear - delta);
focusOnDay(getFirstAvailableDay(1), 0);
}
else if (!isTimeObj)
focusOnDay(undefined, delta * 7);
}
else if (eventTarget === self.currentYearElement) {
changeYear(self.currentYear - delta);
}
else if (self.config.enableTime) {
if (!isTimeObj && self.hourElement)
self.hourElement.focus();
updateTime(e);
self._debouncedChange();
}
break;
case 9:
if (isTimeObj) {
var elems = [
self.hourElement,
self.minuteElement,
self.secondElement,
self.amPM,
]
.concat(self.pluginElements)
.filter(function (x) { return x; });
var i = elems.indexOf(eventTarget);
if (i !== -1) {
var target = elems[i + (e.shiftKey ? -1 : 1)];
e.preventDefault();
(target || self._input).focus();
}
}
else if (!self.config.noCalendar &&
self.daysContainer &&
self.daysContainer.contains(eventTarget) &&
e.shiftKey) {
e.preventDefault();
self._input.focus();
}
break;
default:
break;
}
}
if (self.amPM !== undefined && eventTarget === self.amPM) {
switch (e.key) {
case self.l10n.amPM[0].charAt(0):
case self.l10n.amPM[0].charAt(0).toLowerCase():
self.amPM.textContent = self.l10n.amPM[0];
setHoursFromInputs();
updateValue();
break;
case self.l10n.amPM[1].charAt(0):
case self.l10n.amPM[1].charAt(0).toLowerCase():
self.amPM.textContent = self.l10n.amPM[1];
setHoursFromInputs();
updateValue();
break;
}
}
if (isInput || isCalendarElem(eventTarget)) {
triggerEvent("onKeyDown", e);
}
}
function onMouseOver(elem, cellClass) {
if (cellClass === void 0) { cellClass = "flatpickr-day"; }
if (self.selectedDates.length !== 1 ||
(elem &&
(!elem.classList.contains(cellClass) ||
elem.classList.contains("flatpickr-disabled"))))
return;
var hoverDate = elem
? elem.dateObj.getTime()
: self.days.firstElementChild.dateObj.getTime(), initialDate = self.parseDate(self.selectedDates[0], undefined, true).getTime(), rangeStartDate = Math.min(hoverDate, self.selectedDates[0].getTime()), rangeEndDate = Math.max(hoverDate, self.selectedDates[0].getTime());
var containsDisabled = false;
var minRange = 0, maxRange = 0;
for (var t = rangeStartDate; t < rangeEndDate; t += _utils_dates__WEBPACK_IMPORTED_MODULE_4__.duration.DAY) {
if (!isEnabled(new Date(t), true)) {
containsDisabled =
containsDisabled || (t > rangeStartDate && t < rangeEndDate);
if (t < initialDate && (!minRange || t > minRange))
minRange = t;
else if (t > initialDate && (!maxRange || t < maxRange))
maxRange = t;
}
}
var hoverableCells = Array.from(self.rContainer.querySelectorAll("*:nth-child(-n+" + self.config.showMonths + ") > ." + cellClass));
hoverableCells.forEach(function (dayElem) {
var date = dayElem.dateObj;
var timestamp = date.getTime();
var outOfRange = (minRange > 0 && timestamp < minRange) ||
(maxRange > 0 && timestamp > maxRange);
if (outOfRange) {
dayElem.classList.add("notAllowed");
["inRange", "startRange", "endRange"].forEach(function (c) {
dayElem.classList.remove(c);
});
return;
}
else if (containsDisabled && !outOfRange)
return;
["startRange", "inRange", "endRange", "notAllowed"].forEach(function (c) {
dayElem.classList.remove(c);
});
if (elem !== undefined) {
elem.classList.add(hoverDate <= self.selectedDates[0].getTime()
? "startRange"
: "endRange");
if (initialDate < hoverDate && timestamp === initialDate)
dayElem.classList.add("startRange");
else if (initialDate > hoverDate && timestamp === initialDate)
dayElem.classList.add("endRange");
if (timestamp >= minRange &&
(maxRange === 0 || timestamp <= maxRange) &&
(0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.isBetween)(timestamp, initialDate, hoverDate))
dayElem.classList.add("inRange");
}
});
}
function onResize() {
if (self.isOpen && !self.config.static && !self.config.inline)
positionCalendar();
}
function open(e, positionElement) {
if (positionElement === void 0) { positionElement = self._positionElement; }
if (self.isMobile === true) {
if (e) {
e.preventDefault();
var eventTarget = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.getEventTarget)(e);
if (eventTarget) {
eventTarget.blur();
}
}
if (self.mobileInput !== undefined) {
self.mobileInput.focus();
self.mobileInput.click();
}
triggerEvent("onOpen");
return;
}
else if (self._input.disabled || self.config.inline) {
return;
}
var wasOpen = self.isOpen;
self.isOpen = true;
if (!wasOpen) {
self.calendarContainer.classList.add("open");
self._input.classList.add("active");
triggerEvent("onOpen");
positionCalendar(positionElement);
}
if (self.config.enableTime === true && self.config.noCalendar === true) {
if (self.config.allowInput === false &&
(e === undefined ||
!self.timeContainer.contains(e.relatedTarget))) {
setTimeout(function () { return self.hourElement.select(); }, 50);
}
}
}
function minMaxDateSetter(type) {
return function (date) {
var dateObj = (self.config["_" + type + "Date"] = self.parseDate(date, self.config.dateFormat));
var inverseDateObj = self.config["_" + (type === "min" ? "max" : "min") + "Date"];
if (dateObj !== undefined) {
self[type === "min" ? "minDateHasTime" : "maxDateHasTime"] =
dateObj.getHours() > 0 ||
dateObj.getMinutes() > 0 ||
dateObj.getSeconds() > 0;
}
if (self.selectedDates) {
self.selectedDates = self.selectedDates.filter(function (d) { return isEnabled(d); });
if (!self.selectedDates.length && type === "min")
setHoursFromDate(dateObj);
updateValue();
}
if (self.daysContainer) {
redraw();
if (dateObj !== undefined)
self.currentYearElement[type] = dateObj.getFullYear().toString();
else
self.currentYearElement.removeAttribute(type);
self.currentYearElement.disabled =
!!inverseDateObj &&
dateObj !== undefined &&
inverseDateObj.getFullYear() === dateObj.getFullYear();
}
};
}
function parseConfig() {
var boolOpts = [
"wrap",
"weekNumbers",
"allowInput",
"allowInvalidPreload",
"clickOpens",
"time_24hr",
"enableTime",
"noCalendar",
"altInput",
"shorthandCurrentMonth",
"inline",
"static",
"enableSeconds",
"disableMobile",
];
var userConfig = __assign(__assign({}, JSON.parse(JSON.stringify(element.dataset || {}))), instanceConfig);
var formats = {};
self.config.parseDate = userConfig.parseDate;
self.config.formatDate = userConfig.formatDate;
Object.defineProperty(self.config, "enable", {
get: function () { return self.config._enable; },
set: function (dates) {
self.config._enable = parseDateRules(dates);
},
});
Object.defineProperty(self.config, "disable", {
get: function () { return self.config._disable; },
set: function (dates) {
self.config._disable = parseDateRules(dates);
},
});
var timeMode = userConfig.mode === "time";
if (!userConfig.dateFormat && (userConfig.enableTime || timeMode)) {
var defaultDateFormat = flatpickr.defaultConfig.dateFormat || _types_options__WEBPACK_IMPORTED_MODULE_0__.defaults.dateFormat;
formats.dateFormat =
userConfig.noCalendar || timeMode
? "H:i" + (userConfig.enableSeconds ? ":S" : "")
: defaultDateFormat + " H:i" + (userConfig.enableSeconds ? ":S" : "");
}
if (userConfig.altInput &&
(userConfig.enableTime || timeMode) &&
!userConfig.altFormat) {
var defaultAltFormat = flatpickr.defaultConfig.altFormat || _types_options__WEBPACK_IMPORTED_MODULE_0__.defaults.altFormat;
formats.altFormat =
userConfig.noCalendar || timeMode
? "h:i" + (userConfig.enableSeconds ? ":S K" : " K")
: defaultAltFormat + (" h:i" + (userConfig.enableSeconds ? ":S" : "") + " K");
}
Object.defineProperty(self.config, "minDate", {
get: function () { return self.config._minDate; },
set: minMaxDateSetter("min"),
});
Object.defineProperty(self.config, "maxDate", {
get: function () { return self.config._maxDate; },
set: minMaxDateSetter("max"),
});
var minMaxTimeSetter = function (type) { return function (val) {
self.config[type === "min" ? "_minTime" : "_maxTime"] = self.parseDate(val, "H:i:S");
}; };
Object.defineProperty(self.config, "minTime", {
get: function () { return self.config._minTime; },
set: minMaxTimeSetter("min"),
});
Object.defineProperty(self.config, "maxTime", {
get: function () { return self.config._maxTime; },
set: minMaxTimeSetter("max"),
});
if (userConfig.mode === "time") {
self.config.noCalendar = true;
self.config.enableTime = true;
}
Object.assign(self.config, formats, userConfig);
for (var i = 0; i < boolOpts.length; i++)
self.config[boolOpts[i]] =
self.config[boolOpts[i]] === true ||
self.config[boolOpts[i]] === "true";
_types_options__WEBPACK_IMPORTED_MODULE_0__.HOOKS.filter(function (hook) { return self.config[hook] !== undefined; }).forEach(function (hook) {
self.config[hook] = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.arrayify)(self.config[hook] || []).map(bindToInstance);
});
self.isMobile =
!self.config.disableMobile &&
!self.config.inline &&
self.config.mode === "single" &&
!self.config.disable.length &&
!self.config.enable &&
!self.config.weekNumbers &&
/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
for (var i = 0; i < self.config.plugins.length; i++) {
var pluginConf = self.config.plugins[i](self) || {};
for (var key in pluginConf) {
if (_types_options__WEBPACK_IMPORTED_MODULE_0__.HOOKS.indexOf(key) > -1) {
self.config[key] = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.arrayify)(pluginConf[key])
.map(bindToInstance)
.concat(self.config[key]);
}
else if (typeof userConfig[key] === "undefined")
self.config[key] = pluginConf[key];
}
}
if (!userConfig.altInputClass) {
self.config.altInputClass =
getInputElem().className + " " + self.config.altInputClass;
}
triggerEvent("onParseConfig");
}
function getInputElem() {
return self.config.wrap
? element.querySelector("[data-input]")
: element;
}
function setupLocale() {
if (typeof self.config.locale !== "object" &&
typeof flatpickr.l10ns[self.config.locale] === "undefined")
self.config.errorHandler(new Error("flatpickr: invalid locale " + self.config.locale));
self.l10n = __assign(__assign({}, flatpickr.l10ns.default), (typeof self.config.locale === "object"
? self.config.locale
: self.config.locale !== "default"
? flatpickr.l10ns[self.config.locale]
: undefined));
_utils_formatting__WEBPACK_IMPORTED_MODULE_5__.tokenRegex.D = "(" + self.l10n.weekdays.shorthand.join("|") + ")";
_utils_formatting__WEBPACK_IMPORTED_MODULE_5__.tokenRegex.l = "(" + self.l10n.weekdays.longhand.join("|") + ")";
_utils_formatting__WEBPACK_IMPORTED_MODULE_5__.tokenRegex.M = "(" + self.l10n.months.shorthand.join("|") + ")";
_utils_formatting__WEBPACK_IMPORTED_MODULE_5__.tokenRegex.F = "(" + self.l10n.months.longhand.join("|") + ")";
_utils_formatting__WEBPACK_IMPORTED_MODULE_5__.tokenRegex.K = "(" + self.l10n.amPM[0] + "|" + self.l10n.amPM[1] + "|" + self.l10n.amPM[0].toLowerCase() + "|" + self.l10n.amPM[1].toLowerCase() + ")";
var userConfig = __assign(__assign({}, instanceConfig), JSON.parse(JSON.stringify(element.dataset || {})));
if (userConfig.time_24hr === undefined &&
flatpickr.defaultConfig.time_24hr === undefined) {
self.config.time_24hr = self.l10n.time_24hr;
}
self.formatDate = (0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.createDateFormatter)(self);
self.parseDate = (0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.createDateParser)({ config: self.config, l10n: self.l10n });
}
function positionCalendar(customPositionElement) {
if (typeof self.config.position === "function") {
return void self.config.position(self, customPositionElement);
}
if (self.calendarContainer === undefined)
return;
triggerEvent("onPreCalendarPosition");
var positionElement = customPositionElement || self._positionElement;
var calendarHeight = Array.prototype.reduce.call(self.calendarContainer.children, (function (acc, child) { return acc + child.offsetHeight; }), 0), calendarWidth = self.calendarContainer.offsetWidth, configPos = self.config.position.split(" "), configPosVertical = configPos[0], configPosHorizontal = configPos.length > 1 ? configPos[1] : null, inputBounds = positionElement.getBoundingClientRect(), distanceFromBottom = window.innerHeight - inputBounds.bottom, showOnTop = configPosVertical === "above" ||
(configPosVertical !== "below" &&
distanceFromBottom < calendarHeight &&
inputBounds.top > calendarHeight);
var top = window.pageYOffset +
inputBounds.top +
(!showOnTop ? positionElement.offsetHeight + 2 : -calendarHeight - 2);
(0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.toggleClass)(self.calendarContainer, "arrowTop", !showOnTop);
(0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.toggleClass)(self.calendarContainer, "arrowBottom", showOnTop);
if (self.config.inline)
return;
var left = window.pageXOffset + inputBounds.left;
var isCenter = false;
var isRight = false;
if (configPosHorizontal === "center") {
left -= (calendarWidth - inputBounds.width) / 2;
isCenter = true;
}
else if (configPosHorizontal === "right") {
left -= calendarWidth - inputBounds.width;
isRight = true;
}
(0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.toggleClass)(self.calendarContainer, "arrowLeft", !isCenter && !isRight);
(0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.toggleClass)(self.calendarContainer, "arrowCenter", isCenter);
(0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.toggleClass)(self.calendarContainer, "arrowRight", isRight);
var right = window.document.body.offsetWidth -
(window.pageXOffset + inputBounds.right);
var rightMost = left + calendarWidth > window.document.body.offsetWidth;
var centerMost = right + calendarWidth > window.document.body.offsetWidth;
(0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.toggleClass)(self.calendarContainer, "rightMost", rightMost);
if (self.config.static)
return;
self.calendarContainer.style.top = top + "px";
if (!rightMost) {
self.calendarContainer.style.left = left + "px";
self.calendarContainer.style.right = "auto";
}
else if (!centerMost) {
self.calendarContainer.style.left = "auto";
self.calendarContainer.style.right = right + "px";
}
else {
var doc = getDocumentStyleSheet();
if (doc === undefined)
return;
var bodyWidth = window.document.body.offsetWidth;
var centerLeft = Math.max(0, bodyWidth / 2 - calendarWidth / 2);
var centerBefore = ".flatpickr-calendar.centerMost:before";
var centerAfter = ".flatpickr-calendar.centerMost:after";
var centerIndex = doc.cssRules.length;
var centerStyle = "{left:" + inputBounds.left + "px;right:auto;}";
(0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.toggleClass)(self.calendarContainer, "rightMost", false);
(0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.toggleClass)(self.calendarContainer, "centerMost", true);
doc.insertRule(centerBefore + "," + centerAfter + centerStyle, centerIndex);
self.calendarContainer.style.left = centerLeft + "px";
self.calendarContainer.style.right = "auto";
}
}
function getDocumentStyleSheet() {
var editableSheet = null;
for (var i = 0; i < document.styleSheets.length; i++) {
var sheet = document.styleSheets[i];
if (!sheet.cssRules)
continue;
try {
sheet.cssRules;
}
catch (err) {
continue;
}
editableSheet = sheet;
break;
}
return editableSheet != null ? editableSheet : createStyleSheet();
}
function createStyleSheet() {
var style = document.createElement("style");
document.head.appendChild(style);
return style.sheet;
}
function redraw() {
if (self.config.noCalendar || self.isMobile)
return;
buildMonthSwitch();
updateNavigationCurrentMonth();
buildDays();
}
function focusAndClose() {
self._input.focus();
if (window.navigator.userAgent.indexOf("MSIE") !== -1 ||
navigator.msMaxTouchPoints !== undefined) {
setTimeout(self.close, 0);
}
else {
self.close();
}
}
function selectDate(e) {
e.preventDefault();
e.stopPropagation();
var isSelectable = function (day) {
return day.classList &&
day.classList.contains("flatpickr-day") &&
!day.classList.contains("flatpickr-disabled") &&
!day.classList.contains("notAllowed");
};
var t = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.findParent)((0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.getEventTarget)(e), isSelectable);
if (t === undefined)
return;
var target = t;
var selectedDate = (self.latestSelectedDateObj = new Date(target.dateObj.getTime()));
var shouldChangeMonth = (selectedDate.getMonth() < self.currentMonth ||
selectedDate.getMonth() >
self.currentMonth + self.config.showMonths - 1) &&
self.config.mode !== "range";
self.selectedDateElem = target;
if (self.config.mode === "single")
self.selectedDates = [selectedDate];
else if (self.config.mode === "multiple") {
var selectedIndex = isDateSelected(selectedDate);
if (selectedIndex)
self.selectedDates.splice(parseInt(selectedIndex), 1);
else
self.selectedDates.push(selectedDate);
}
else if (self.config.mode === "range") {
if (self.selectedDates.length === 2) {
self.clear(false, false);
}
self.latestSelectedDateObj = selectedDate;
self.selectedDates.push(selectedDate);
if ((0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.compareDates)(selectedDate, self.selectedDates[0], true) !== 0)
self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); });
}
setHoursFromInputs();
if (shouldChangeMonth) {
var isNewYear = self.currentYear !== selectedDate.getFullYear();
self.currentYear = selectedDate.getFullYear();
self.currentMonth = selectedDate.getMonth();
if (isNewYear) {
triggerEvent("onYearChange");
buildMonthSwitch();
}
triggerEvent("onMonthChange");
}
updateNavigationCurrentMonth();
buildDays();
updateValue();
if (!shouldChangeMonth &&
self.config.mode !== "range" &&
self.config.showMonths === 1)
focusOnDayElem(target);
else if (self.selectedDateElem !== undefined &&
self.hourElement === undefined) {
self.selectedDateElem && self.selectedDateElem.focus();
}
if (self.hourElement !== undefined)
self.hourElement !== undefined && self.hourElement.focus();
if (self.config.closeOnSelect) {
var single = self.config.mode === "single" && !self.config.enableTime;
var range = self.config.mode === "range" &&
self.selectedDates.length === 2 &&
!self.config.enableTime;
if (single || range) {
focusAndClose();
}
}
triggerChange();
}
var CALLBACKS = {
locale: [setupLocale, updateWeekdays],
showMonths: [buildMonths, setCalendarWidth, buildWeekdays],
minDate: [jumpToDate],
maxDate: [jumpToDate],
positionElement: [updatePositionElement],
clickOpens: [
function () {
if (self.config.clickOpens === true) {
bind(self._input, "focus", self.open);
bind(self._input, "click", self.open);
}
else {
self._input.removeEventListener("focus", self.open);
self._input.removeEventListener("click", self.open);
}
},
],
};
function set(option, value) {
if (option !== null && typeof option === "object") {
Object.assign(self.config, option);
for (var key in option) {
if (CALLBACKS[key] !== undefined)
CALLBACKS[key].forEach(function (x) { return x(); });
}
}
else {
self.config[option] = value;
if (CALLBACKS[option] !== undefined)
CALLBACKS[option].forEach(function (x) { return x(); });
else if (_types_options__WEBPACK_IMPORTED_MODULE_0__.HOOKS.indexOf(option) > -1)
self.config[option] = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.arrayify)(value);
}
self.redraw();
updateValue(true);
}
function setSelectedDate(inputDate, format) {
var dates = [];
if (inputDate instanceof Array)
dates = inputDate.map(function (d) { return self.parseDate(d, format); });
else if (inputDate instanceof Date || typeof inputDate === "number")
dates = [self.parseDate(inputDate, format)];
else if (typeof inputDate === "string") {
switch (self.config.mode) {
case "single":
case "time":
dates = [self.parseDate(inputDate, format)];
break;
case "multiple":
dates = inputDate
.split(self.config.conjunction)
.map(function (date) { return self.parseDate(date, format); });
break;
case "range":
dates = inputDate
.split(self.l10n.rangeSeparator)
.map(function (date) { return self.parseDate(date, format); });
break;
default:
break;
}
}
else
self.config.errorHandler(new Error("Invalid date supplied: " + JSON.stringify(inputDate)));
self.selectedDates = (self.config.allowInvalidPreload
? dates
: dates.filter(function (d) { return d instanceof Date && isEnabled(d, false); }));
if (self.config.mode === "range")
self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); });
}
function setDate(date, triggerChange, format) {
if (triggerChange === void 0) { triggerChange = false; }
if (format === void 0) { format = self.config.dateFormat; }
if ((date !== 0 && !date) || (date instanceof Array && date.length === 0))
return self.clear(triggerChange);
setSelectedDate(date, format);
self.latestSelectedDateObj =
self.selectedDates[self.selectedDates.length - 1];
self.redraw();
jumpToDate(undefined, triggerChange);
setHoursFromDate();
if (self.selectedDates.length === 0) {
self.clear(false);
}
updateValue(triggerChange);
if (triggerChange)
triggerEvent("onChange");
}
function parseDateRules(arr) {
return arr
.slice()
.map(function (rule) {
if (typeof rule === "string" ||
typeof rule === "number" ||
rule instanceof Date) {
return self.parseDate(rule, undefined, true);
}
else if (rule &&
typeof rule === "object" &&
rule.from &&
rule.to)
return {
from: self.parseDate(rule.from, undefined),
to: self.parseDate(rule.to, undefined),
};
return rule;
})
.filter(function (x) { return x; });
}
function setupDates() {
self.selectedDates = [];
self.now = self.parseDate(self.config.now) || new Date();
var preloadedDate = self.config.defaultDate ||
((self.input.nodeName === "INPUT" ||
self.input.nodeName === "TEXTAREA") &&
self.input.placeholder &&
self.input.value === self.input.placeholder
? null
: self.input.value);
if (preloadedDate)
setSelectedDate(preloadedDate, self.config.dateFormat);
self._initialDate =
self.selectedDates.length > 0
? self.selectedDates[0]
: self.config.minDate &&
self.config.minDate.getTime() > self.now.getTime()
? self.config.minDate
: self.config.maxDate &&
self.config.maxDate.getTime() < self.now.getTime()
? self.config.maxDate
: self.now;
self.currentYear = self._initialDate.getFullYear();
self.currentMonth = self._initialDate.getMonth();
if (self.selectedDates.length > 0)
self.latestSelectedDateObj = self.selectedDates[0];
if (self.config.minTime !== undefined)
self.config.minTime = self.parseDate(self.config.minTime, "H:i");
if (self.config.maxTime !== undefined)
self.config.maxTime = self.parseDate(self.config.maxTime, "H:i");
self.minDateHasTime =
!!self.config.minDate &&
(self.config.minDate.getHours() > 0 ||
self.config.minDate.getMinutes() > 0 ||
self.config.minDate.getSeconds() > 0);
self.maxDateHasTime =
!!self.config.maxDate &&
(self.config.maxDate.getHours() > 0 ||
self.config.maxDate.getMinutes() > 0 ||
self.config.maxDate.getSeconds() > 0);
}
function setupInputs() {
self.input = getInputElem();
if (!self.input) {
self.config.errorHandler(new Error("Invalid input element specified"));
return;
}
self.input._type = self.input.type;
self.input.type = "text";
self.input.classList.add("flatpickr-input");
self._input = self.input;
if (self.config.altInput) {
self.altInput = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)(self.input.nodeName, self.config.altInputClass);
self._input = self.altInput;
self.altInput.placeholder = self.input.placeholder;
self.altInput.disabled = self.input.disabled;
self.altInput.required = self.input.required;
self.altInput.tabIndex = self.input.tabIndex;
self.altInput.type = "text";
self.input.setAttribute("type", "hidden");
if (!self.config.static && self.input.parentNode)
self.input.parentNode.insertBefore(self.altInput, self.input.nextSibling);
}
if (!self.config.allowInput)
self._input.setAttribute("readonly", "readonly");
updatePositionElement();
}
function updatePositionElement() {
self._positionElement = self.config.positionElement || self._input;
}
function setupMobile() {
var inputType = self.config.enableTime
? self.config.noCalendar
? "time"
: "datetime-local"
: "date";
self.mobileInput = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.createElement)("input", self.input.className + " flatpickr-mobile");
self.mobileInput.tabIndex = 1;
self.mobileInput.type = inputType;
self.mobileInput.disabled = self.input.disabled;
self.mobileInput.required = self.input.required;
self.mobileInput.placeholder = self.input.placeholder;
self.mobileFormatStr =
inputType === "datetime-local"
? "Y-m-d\\TH:i:S"
: inputType === "date"
? "Y-m-d"
: "H:i:S";
if (self.selectedDates.length > 0) {
self.mobileInput.defaultValue = self.mobileInput.value = self.formatDate(self.selectedDates[0], self.mobileFormatStr);
}
if (self.config.minDate)
self.mobileInput.min = self.formatDate(self.config.minDate, "Y-m-d");
if (self.config.maxDate)
self.mobileInput.max = self.formatDate(self.config.maxDate, "Y-m-d");
if (self.input.getAttribute("step"))
self.mobileInput.step = String(self.input.getAttribute("step"));
self.input.type = "hidden";
if (self.altInput !== undefined)
self.altInput.type = "hidden";
try {
if (self.input.parentNode)
self.input.parentNode.insertBefore(self.mobileInput, self.input.nextSibling);
}
catch (_a) { }
bind(self.mobileInput, "change", function (e) {
self.setDate((0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.getEventTarget)(e).value, false, self.mobileFormatStr);
triggerEvent("onChange");
triggerEvent("onClose");
});
}
function toggle(e) {
if (self.isOpen === true)
return self.close();
self.open(e);
}
function triggerEvent(event, data) {
if (self.config === undefined)
return;
var hooks = self.config[event];
if (hooks !== undefined && hooks.length > 0) {
for (var i = 0; hooks[i] && i < hooks.length; i++)
hooks[i](self.selectedDates, self.input.value, self, data);
}
if (event === "onChange") {
self.input.dispatchEvent(createEvent("change"));
self.input.dispatchEvent(createEvent("input"));
}
}
function createEvent(name) {
var e = document.createEvent("Event");
e.initEvent(name, true, true);
return e;
}
function isDateSelected(date) {
for (var i = 0; i < self.selectedDates.length; i++) {
var selectedDate = self.selectedDates[i];
if (selectedDate instanceof Date &&
(0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.compareDates)(selectedDate, date) === 0)
return "" + i;
}
return false;
}
function isDateInRange(date) {
if (self.config.mode !== "range" || self.selectedDates.length < 2)
return false;
return ((0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.compareDates)(date, self.selectedDates[0]) >= 0 &&
(0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.compareDates)(date, self.selectedDates[1]) <= 0);
}
function updateNavigationCurrentMonth() {
if (self.config.noCalendar || self.isMobile || !self.monthNav)
return;
self.yearElements.forEach(function (yearElement, i) {
var d = new Date(self.currentYear, self.currentMonth, 1);
d.setMonth(self.currentMonth + i);
if (self.config.showMonths > 1 ||
self.config.monthSelectorType === "static") {
self.monthElements[i].textContent =
(0,_utils_formatting__WEBPACK_IMPORTED_MODULE_5__.monthToStr)(d.getMonth(), self.config.shorthandCurrentMonth, self.l10n) + " ";
}
else {
self.monthsDropdownContainer.value = d.getMonth().toString();
}
yearElement.value = d.getFullYear().toString();
});
self._hidePrevMonthArrow =
self.config.minDate !== undefined &&
(self.currentYear === self.config.minDate.getFullYear()
? self.currentMonth <= self.config.minDate.getMonth()
: self.currentYear < self.config.minDate.getFullYear());
self._hideNextMonthArrow =
self.config.maxDate !== undefined &&
(self.currentYear === self.config.maxDate.getFullYear()
? self.currentMonth + 1 > self.config.maxDate.getMonth()
: self.currentYear > self.config.maxDate.getFullYear());
}
function getDateStr(specificFormat) {
var format = specificFormat ||
(self.config.altInput ? self.config.altFormat : self.config.dateFormat);
return self.selectedDates
.map(function (dObj) { return self.formatDate(dObj, format); })
.filter(function (d, i, arr) {
return self.config.mode !== "range" ||
self.config.enableTime ||
arr.indexOf(d) === i;
})
.join(self.config.mode !== "range"
? self.config.conjunction
: self.l10n.rangeSeparator);
}
function updateValue(triggerChange) {
if (triggerChange === void 0) { triggerChange = true; }
if (self.mobileInput !== undefined && self.mobileFormatStr) {
self.mobileInput.value =
self.latestSelectedDateObj !== undefined
? self.formatDate(self.latestSelectedDateObj, self.mobileFormatStr)
: "";
}
self.input.value = getDateStr(self.config.dateFormat);
if (self.altInput !== undefined) {
self.altInput.value = getDateStr(self.config.altFormat);
}
if (triggerChange !== false)
triggerEvent("onValueUpdate");
}
function onMonthNavClick(e) {
var eventTarget = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.getEventTarget)(e);
var isPrevMonth = self.prevMonthNav.contains(eventTarget);
var isNextMonth = self.nextMonthNav.contains(eventTarget);
if (isPrevMonth || isNextMonth) {
changeMonth(isPrevMonth ? -1 : 1);
}
else if (self.yearElements.indexOf(eventTarget) >= 0) {
eventTarget.select();
}
else if (eventTarget.classList.contains("arrowUp")) {
self.changeYear(self.currentYear + 1);
}
else if (eventTarget.classList.contains("arrowDown")) {
self.changeYear(self.currentYear - 1);
}
}
function timeWrapper(e) {
e.preventDefault();
var isKeyDown = e.type === "keydown", eventTarget = (0,_utils_dom__WEBPACK_IMPORTED_MODULE_3__.getEventTarget)(e), input = eventTarget;
if (self.amPM !== undefined && eventTarget === self.amPM) {
self.amPM.textContent =
self.l10n.amPM[(0,_utils__WEBPACK_IMPORTED_MODULE_2__.int)(self.amPM.textContent === self.l10n.amPM[0])];
}
var min = parseFloat(input.getAttribute("min")), max = parseFloat(input.getAttribute("max")), step = parseFloat(input.getAttribute("step")), curValue = parseInt(input.value, 10), delta = e.delta ||
(isKeyDown ? (e.which === 38 ? 1 : -1) : 0);
var newValue = curValue + step * delta;
if (typeof input.value !== "undefined" && input.value.length === 2) {
var isHourElem = input === self.hourElement, isMinuteElem = input === self.minuteElement;
if (newValue < min) {
newValue =
max +
newValue +
(0,_utils__WEBPACK_IMPORTED_MODULE_2__.int)(!isHourElem) +
((0,_utils__WEBPACK_IMPORTED_MODULE_2__.int)(isHourElem) && (0,_utils__WEBPACK_IMPORTED_MODULE_2__.int)(!self.amPM));
if (isMinuteElem)
incrementNumInput(undefined, -1, self.hourElement);
}
else if (newValue > max) {
newValue =
input === self.hourElement ? newValue - max - (0,_utils__WEBPACK_IMPORTED_MODULE_2__.int)(!self.amPM) : min;
if (isMinuteElem)
incrementNumInput(undefined, 1, self.hourElement);
}
if (self.amPM &&
isHourElem &&
(step === 1
? newValue + curValue === 23
: Math.abs(newValue - curValue) > step)) {
self.amPM.textContent =
self.l10n.amPM[(0,_utils__WEBPACK_IMPORTED_MODULE_2__.int)(self.amPM.textContent === self.l10n.amPM[0])];
}
input.value = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.pad)(newValue);
}
}
init();
return self;
}
function _flatpickr(nodeList, config) {
var nodes = Array.prototype.slice
.call(nodeList)
.filter(function (x) { return x instanceof HTMLElement; });
var instances = [];
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
try {
if (node.getAttribute("data-fp-omit") !== null)
continue;
if (node._flatpickr !== undefined) {
node._flatpickr.destroy();
node._flatpickr = undefined;
}
node._flatpickr = FlatpickrInstance(node, config || {});
instances.push(node._flatpickr);
}
catch (e) {
console.error(e);
}
}
return instances.length === 1 ? instances[0] : instances;
}
if (typeof HTMLElement !== "undefined" &&
typeof HTMLCollection !== "undefined" &&
typeof NodeList !== "undefined") {
HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function (config) {
return _flatpickr(this, config);
};
HTMLElement.prototype.flatpickr = function (config) {
return _flatpickr([this], config);
};
}
var flatpickr = function (selector, config) {
if (typeof selector === "string") {
return _flatpickr(window.document.querySelectorAll(selector), config);
}
else if (selector instanceof Node) {
return _flatpickr([selector], config);
}
else {
return _flatpickr(selector, config);
}
};
flatpickr.defaultConfig = {};
flatpickr.l10ns = {
en: __assign({}, _l10n_default__WEBPACK_IMPORTED_MODULE_1__["default"]),
default: __assign({}, _l10n_default__WEBPACK_IMPORTED_MODULE_1__["default"]),
};
flatpickr.localize = function (l10n) {
flatpickr.l10ns.default = __assign(__assign({}, flatpickr.l10ns.default), l10n);
};
flatpickr.setDefaults = function (config) {
flatpickr.defaultConfig = __assign(__assign({}, flatpickr.defaultConfig), config);
};
flatpickr.parseDate = (0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.createDateParser)({});
flatpickr.formatDate = (0,_utils_dates__WEBPACK_IMPORTED_MODULE_4__.createDateFormatter)({});
flatpickr.compareDates = _utils_dates__WEBPACK_IMPORTED_MODULE_4__.compareDates;
if (typeof jQuery !== "undefined" && typeof jQuery.fn !== "undefined") {
jQuery.fn.flatpickr = function (config) {
return _flatpickr(this, config);
};
}
Date.prototype.fp_incr = function (days) {
return new Date(this.getFullYear(), this.getMonth(), this.getDate() + (typeof days === "string" ? parseInt(days, 10) : days));
};
if (typeof window !== "undefined") {
window.flatpickr = flatpickr;
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (flatpickr);
/***/ }),
/***/ "./node_modules/flatpickr/dist/esm/l10n/default.js":
/*!*********************************************************!*\
!*** ./node_modules/flatpickr/dist/esm/l10n/default.js ***!
\*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */ "english": () => (/* binding */ english)
/* harmony export */ });
var english = {
weekdays: {
shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
longhand: [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
],
},
months: {
shorthand: [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
],
longhand: [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
],
},
daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
firstDayOfWeek: 0,
ordinal: function (nth) {
var s = nth % 100;
if (s > 3 && s < 21)
return "th";
switch (s % 10) {
case 1:
return "st";
case 2:
return "nd";
case 3:
return "rd";
default:
return "th";
}
},
rangeSeparator: " to ",
weekAbbreviation: "Wk",
scrollTitle: "Scroll to increment",
toggleTitle: "Click to toggle",
amPM: ["AM", "PM"],
yearAriaLabel: "Year",
monthAriaLabel: "Month",
hourAriaLabel: "Hour",
minuteAriaLabel: "Minute",
time_24hr: false,
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (english);
/***/ }),
/***/ "./node_modules/flatpickr/dist/esm/types/options.js":
/*!**********************************************************!*\
!*** ./node_modules/flatpickr/dist/esm/types/options.js ***!
\**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "HOOKS": () => (/* binding */ HOOKS),
/* harmony export */ "defaults": () => (/* binding */ defaults)
/* harmony export */ });
var HOOKS = [
"onChange",
"onClose",
"onDayCreate",
"onDestroy",
"onKeyDown",
"onMonthChange",
"onOpen",
"onParseConfig",
"onReady",
"onValueUpdate",
"onYearChange",
"onPreCalendarPosition",
];
var defaults = {
_disable: [],
allowInput: false,
allowInvalidPreload: false,
altFormat: "F j, Y",
altInput: false,
altInputClass: "form-control input",
animate: typeof window === "object" &&
window.navigator.userAgent.indexOf("MSIE") === -1,
ariaDateFormat: "F j, Y",
autoFillDefaultTime: true,
clickOpens: true,
closeOnSelect: true,
conjunction: ", ",
dateFormat: "Y-m-d",
defaultHour: 12,
defaultMinute: 0,
defaultSeconds: 0,
disable: [],
disableMobile: false,
enableSeconds: false,
enableTime: false,
errorHandler: function (err) {
return typeof console !== "undefined" && console.warn(err);
},
getWeek: function (givenDate) {
var date = new Date(givenDate.getTime());
date.setHours(0, 0, 0, 0);
date.setDate(date.getDate() + 3 - ((date.getDay() + 6) % 7));
var week1 = new Date(date.getFullYear(), 0, 4);
return (1 +
Math.round(((date.getTime() - week1.getTime()) / 86400000 -
3 +
((week1.getDay() + 6) % 7)) /
7));
},
hourIncrement: 1,
ignoredFocusElements: [],
inline: false,
locale: "default",
minuteIncrement: 5,
mode: "single",
monthSelectorType: "dropdown",
nextArrow: "",
noCalendar: false,
now: new Date(),
onChange: [],
onClose: [],
onDayCreate: [],
onDestroy: [],
onKeyDown: [],
onMonthChange: [],
onOpen: [],
onParseConfig: [],
onReady: [],
onValueUpdate: [],
onYearChange: [],
onPreCalendarPosition: [],
plugins: [],
position: "auto",
positionElement: undefined,
prevArrow: "",
shorthandCurrentMonth: false,
showMonths: 1,
static: false,
time_24hr: false,
weekNumbers: false,
wrap: false,
};
/***/ }),
/***/ "./node_modules/flatpickr/dist/esm/utils/dates.js":
/*!********************************************************!*\
!*** ./node_modules/flatpickr/dist/esm/utils/dates.js ***!
\********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "calculateSecondsSinceMidnight": () => (/* binding */ calculateSecondsSinceMidnight),
/* harmony export */ "compareDates": () => (/* binding */ compareDates),
/* harmony export */ "compareTimes": () => (/* binding */ compareTimes),
/* harmony export */ "createDateFormatter": () => (/* binding */ createDateFormatter),
/* harmony export */ "createDateParser": () => (/* binding */ createDateParser),
/* harmony export */ "duration": () => (/* binding */ duration),
/* harmony export */ "getDefaultHours": () => (/* binding */ getDefaultHours),
/* harmony export */ "isBetween": () => (/* binding */ isBetween),
/* harmony export */ "parseSeconds": () => (/* binding */ parseSeconds)
/* harmony export */ });
/* harmony import */ var _formatting__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./formatting */ "./node_modules/flatpickr/dist/esm/utils/formatting.js");
/* harmony import */ var _types_options__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../types/options */ "./node_modules/flatpickr/dist/esm/types/options.js");
/* harmony import */ var _l10n_default__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../l10n/default */ "./node_modules/flatpickr/dist/esm/l10n/default.js");
var createDateFormatter = function (_a) {
var _b = _a.config, config = _b === void 0 ? _types_options__WEBPACK_IMPORTED_MODULE_1__.defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? _l10n_default__WEBPACK_IMPORTED_MODULE_2__.english : _c, _d = _a.isMobile, isMobile = _d === void 0 ? false : _d;
return function (dateObj, frmt, overrideLocale) {
var locale = overrideLocale || l10n;
if (config.formatDate !== undefined && !isMobile) {
return config.formatDate(dateObj, frmt, locale);
}
return frmt
.split("")
.map(function (c, i, arr) {
return _formatting__WEBPACK_IMPORTED_MODULE_0__.formats[c] && arr[i - 1] !== "\\"
? _formatting__WEBPACK_IMPORTED_MODULE_0__.formats[c](dateObj, locale, config)
: c !== "\\"
? c
: "";
})
.join("");
};
};
var createDateParser = function (_a) {
var _b = _a.config, config = _b === void 0 ? _types_options__WEBPACK_IMPORTED_MODULE_1__.defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? _l10n_default__WEBPACK_IMPORTED_MODULE_2__.english : _c;
return function (date, givenFormat, timeless, customLocale) {
if (date !== 0 && !date)
return undefined;
var locale = customLocale || l10n;
var parsedDate;
var dateOrig = date;
if (date instanceof Date)
parsedDate = new Date(date.getTime());
else if (typeof date !== "string" &&
date.toFixed !== undefined)
parsedDate = new Date(date);
else if (typeof date === "string") {
var format = givenFormat || (config || _types_options__WEBPACK_IMPORTED_MODULE_1__.defaults).dateFormat;
var datestr = String(date).trim();
if (datestr === "today") {
parsedDate = new Date();
timeless = true;
}
else if (config && config.parseDate) {
parsedDate = config.parseDate(date, format);
}
else if (/Z$/.test(datestr) ||
/GMT$/.test(datestr)) {
parsedDate = new Date(date);
}
else {
var matched = void 0, ops = [];
for (var i = 0, matchIndex = 0, regexStr = ""; i < format.length; i++) {
var token = format[i];
var isBackSlash = token === "\\";
var escaped = format[i - 1] === "\\" || isBackSlash;
if (_formatting__WEBPACK_IMPORTED_MODULE_0__.tokenRegex[token] && !escaped) {
regexStr += _formatting__WEBPACK_IMPORTED_MODULE_0__.tokenRegex[token];
var match = new RegExp(regexStr).exec(date);
if (match && (matched = true)) {
ops[token !== "Y" ? "push" : "unshift"]({
fn: _formatting__WEBPACK_IMPORTED_MODULE_0__.revFormat[token],
val: match[++matchIndex],
});
}
}
else if (!isBackSlash)
regexStr += ".";
}
parsedDate =
!config || !config.noCalendar
? new Date(new Date().getFullYear(), 0, 1, 0, 0, 0, 0)
: new Date(new Date().setHours(0, 0, 0, 0));
ops.forEach(function (_a) {
var fn = _a.fn, val = _a.val;
return (parsedDate = fn(parsedDate, val, locale) || parsedDate);
});
parsedDate = matched ? parsedDate : undefined;
}
}
if (!(parsedDate instanceof Date && !isNaN(parsedDate.getTime()))) {
config.errorHandler(new Error("Invalid date provided: " + dateOrig));
return undefined;
}
if (timeless === true)
parsedDate.setHours(0, 0, 0, 0);
return parsedDate;
};
};
function compareDates(date1, date2, timeless) {
if (timeless === void 0) { timeless = true; }
if (timeless !== false) {
return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -
new Date(date2.getTime()).setHours(0, 0, 0, 0));
}
return date1.getTime() - date2.getTime();
}
function compareTimes(date1, date2) {
return (3600 * (date1.getHours() - date2.getHours()) +
60 * (date1.getMinutes() - date2.getMinutes()) +
date1.getSeconds() -
date2.getSeconds());
}
var isBetween = function (ts, ts1, ts2) {
return ts > Math.min(ts1, ts2) && ts < Math.max(ts1, ts2);
};
var calculateSecondsSinceMidnight = function (hours, minutes, seconds) {
return hours * 3600 + minutes * 60 + seconds;
};
var parseSeconds = function (secondsSinceMidnight) {
var hours = Math.floor(secondsSinceMidnight / 3600), minutes = (secondsSinceMidnight - hours * 3600) / 60;
return [hours, minutes, secondsSinceMidnight - hours * 3600 - minutes * 60];
};
var duration = {
DAY: 86400000,
};
function getDefaultHours(config) {
var hours = config.defaultHour;
var minutes = config.defaultMinute;
var seconds = config.defaultSeconds;
if (config.minDate !== undefined) {
var minHour = config.minDate.getHours();
var minMinutes = config.minDate.getMinutes();
var minSeconds = config.minDate.getSeconds();
if (hours < minHour) {
hours = minHour;
}
if (hours === minHour && minutes < minMinutes) {
minutes = minMinutes;
}
if (hours === minHour && minutes === minMinutes && seconds < minSeconds)
seconds = config.minDate.getSeconds();
}
if (config.maxDate !== undefined) {
var maxHr = config.maxDate.getHours();
var maxMinutes = config.maxDate.getMinutes();
hours = Math.min(hours, maxHr);
if (hours === maxHr)
minutes = Math.min(maxMinutes, minutes);
if (hours === maxHr && minutes === maxMinutes)
seconds = config.maxDate.getSeconds();
}
return { hours: hours, minutes: minutes, seconds: seconds };
}
/***/ }),
/***/ "./node_modules/flatpickr/dist/esm/utils/dom.js":
/*!******************************************************!*\
!*** ./node_modules/flatpickr/dist/esm/utils/dom.js ***!
\******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "clearNode": () => (/* binding */ clearNode),
/* harmony export */ "createElement": () => (/* binding */ createElement),
/* harmony export */ "createNumberInput": () => (/* binding */ createNumberInput),
/* harmony export */ "findParent": () => (/* binding */ findParent),
/* harmony export */ "getEventTarget": () => (/* binding */ getEventTarget),
/* harmony export */ "toggleClass": () => (/* binding */ toggleClass)
/* harmony export */ });
function toggleClass(elem, className, bool) {
if (bool === true)
return elem.classList.add(className);
elem.classList.remove(className);
}
function createElement(tag, className, content) {
var e = window.document.createElement(tag);
className = className || "";
content = content || "";
e.className = className;
if (content !== undefined)
e.textContent = content;
return e;
}
function clearNode(node) {
while (node.firstChild)
node.removeChild(node.firstChild);
}
function findParent(node, condition) {
if (condition(node))
return node;
else if (node.parentNode)
return findParent(node.parentNode, condition);
return undefined;
}
function createNumberInput(inputClassName, opts) {
var wrapper = createElement("div", "numInputWrapper"), numInput = createElement("input", "numInput " + inputClassName), arrowUp = createElement("span", "arrowUp"), arrowDown = createElement("span", "arrowDown");
if (navigator.userAgent.indexOf("MSIE 9.0") === -1) {
numInput.type = "number";
}
else {
numInput.type = "text";
numInput.pattern = "\\d*";
}
if (opts !== undefined)
for (var key in opts)
numInput.setAttribute(key, opts[key]);
wrapper.appendChild(numInput);
wrapper.appendChild(arrowUp);
wrapper.appendChild(arrowDown);
return wrapper;
}
function getEventTarget(event) {
try {
if (typeof event.composedPath === "function") {
var path = event.composedPath();
return path[0];
}
return event.target;
}
catch (error) {
return event.target;
}
}
/***/ }),
/***/ "./node_modules/flatpickr/dist/esm/utils/formatting.js":
/*!*************************************************************!*\
!*** ./node_modules/flatpickr/dist/esm/utils/formatting.js ***!
\*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "formats": () => (/* binding */ formats),
/* harmony export */ "monthToStr": () => (/* binding */ monthToStr),
/* harmony export */ "revFormat": () => (/* binding */ revFormat),
/* harmony export */ "tokenRegex": () => (/* binding */ tokenRegex)
/* harmony export */ });
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./node_modules/flatpickr/dist/esm/utils/index.js");
var doNothing = function () { return undefined; };
var monthToStr = function (monthNumber, shorthand, locale) { return locale.months[shorthand ? "shorthand" : "longhand"][monthNumber]; };
var revFormat = {
D: doNothing,
F: function (dateObj, monthName, locale) {
dateObj.setMonth(locale.months.longhand.indexOf(monthName));
},
G: function (dateObj, hour) {
dateObj.setHours((dateObj.getHours() >= 12 ? 12 : 0) + parseFloat(hour));
},
H: function (dateObj, hour) {
dateObj.setHours(parseFloat(hour));
},
J: function (dateObj, day) {
dateObj.setDate(parseFloat(day));
},
K: function (dateObj, amPM, locale) {
dateObj.setHours((dateObj.getHours() % 12) +
12 * (0,_utils__WEBPACK_IMPORTED_MODULE_0__.int)(new RegExp(locale.amPM[1], "i").test(amPM)));
},
M: function (dateObj, shortMonth, locale) {
dateObj.setMonth(locale.months.shorthand.indexOf(shortMonth));
},
S: function (dateObj, seconds) {
dateObj.setSeconds(parseFloat(seconds));
},
U: function (_, unixSeconds) { return new Date(parseFloat(unixSeconds) * 1000); },
W: function (dateObj, weekNum, locale) {
var weekNumber = parseInt(weekNum);
var date = new Date(dateObj.getFullYear(), 0, 2 + (weekNumber - 1) * 7, 0, 0, 0, 0);
date.setDate(date.getDate() - date.getDay() + locale.firstDayOfWeek);
return date;
},
Y: function (dateObj, year) {
dateObj.setFullYear(parseFloat(year));
},
Z: function (_, ISODate) { return new Date(ISODate); },
d: function (dateObj, day) {
dateObj.setDate(parseFloat(day));
},
h: function (dateObj, hour) {
dateObj.setHours((dateObj.getHours() >= 12 ? 12 : 0) + parseFloat(hour));
},
i: function (dateObj, minutes) {
dateObj.setMinutes(parseFloat(minutes));
},
j: function (dateObj, day) {
dateObj.setDate(parseFloat(day));
},
l: doNothing,
m: function (dateObj, month) {
dateObj.setMonth(parseFloat(month) - 1);
},
n: function (dateObj, month) {
dateObj.setMonth(parseFloat(month) - 1);
},
s: function (dateObj, seconds) {
dateObj.setSeconds(parseFloat(seconds));
},
u: function (_, unixMillSeconds) {
return new Date(parseFloat(unixMillSeconds));
},
w: doNothing,
y: function (dateObj, year) {
dateObj.setFullYear(2000 + parseFloat(year));
},
};
var tokenRegex = {
D: "",
F: "",
G: "(\\d\\d|\\d)",
H: "(\\d\\d|\\d)",
J: "(\\d\\d|\\d)\\w+",
K: "",
M: "",
S: "(\\d\\d|\\d)",
U: "(.+)",
W: "(\\d\\d|\\d)",
Y: "(\\d{4})",
Z: "(.+)",
d: "(\\d\\d|\\d)",
h: "(\\d\\d|\\d)",
i: "(\\d\\d|\\d)",
j: "(\\d\\d|\\d)",
l: "",
m: "(\\d\\d|\\d)",
n: "(\\d\\d|\\d)",
s: "(\\d\\d|\\d)",
u: "(.+)",
w: "(\\d\\d|\\d)",
y: "(\\d{2})",
};
var formats = {
Z: function (date) { return date.toISOString(); },
D: function (date, locale, options) {
return locale.weekdays.shorthand[formats.w(date, locale, options)];
},
F: function (date, locale, options) {
return monthToStr(formats.n(date, locale, options) - 1, false, locale);
},
G: function (date, locale, options) {
return (0,_utils__WEBPACK_IMPORTED_MODULE_0__.pad)(formats.h(date, locale, options));
},
H: function (date) { return (0,_utils__WEBPACK_IMPORTED_MODULE_0__.pad)(date.getHours()); },
J: function (date, locale) {
return locale.ordinal !== undefined
? date.getDate() + locale.ordinal(date.getDate())
: date.getDate();
},
K: function (date, locale) { return locale.amPM[(0,_utils__WEBPACK_IMPORTED_MODULE_0__.int)(date.getHours() > 11)]; },
M: function (date, locale) {
return monthToStr(date.getMonth(), true, locale);
},
S: function (date) { return (0,_utils__WEBPACK_IMPORTED_MODULE_0__.pad)(date.getSeconds()); },
U: function (date) { return date.getTime() / 1000; },
W: function (date, _, options) {
return options.getWeek(date);
},
Y: function (date) { return (0,_utils__WEBPACK_IMPORTED_MODULE_0__.pad)(date.getFullYear(), 4); },
d: function (date) { return (0,_utils__WEBPACK_IMPORTED_MODULE_0__.pad)(date.getDate()); },
h: function (date) { return (date.getHours() % 12 ? date.getHours() % 12 : 12); },
i: function (date) { return (0,_utils__WEBPACK_IMPORTED_MODULE_0__.pad)(date.getMinutes()); },
j: function (date) { return date.getDate(); },
l: function (date, locale) {
return locale.weekdays.longhand[date.getDay()];
},
m: function (date) { return (0,_utils__WEBPACK_IMPORTED_MODULE_0__.pad)(date.getMonth() + 1); },
n: function (date) { return date.getMonth() + 1; },
s: function (date) { return date.getSeconds(); },
u: function (date) { return date.getTime(); },
w: function (date) { return date.getDay(); },
y: function (date) { return String(date.getFullYear()).substring(2); },
};
/***/ }),
/***/ "./node_modules/flatpickr/dist/esm/utils/index.js":
/*!********************************************************!*\
!*** ./node_modules/flatpickr/dist/esm/utils/index.js ***!
\********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "arrayify": () => (/* binding */ arrayify),
/* harmony export */ "debounce": () => (/* binding */ debounce),
/* harmony export */ "int": () => (/* binding */ int),
/* harmony export */ "pad": () => (/* binding */ pad)
/* harmony export */ });
var pad = function (number, length) {
if (length === void 0) { length = 2; }
return ("000" + number).slice(length * -1);
};
var int = function (bool) { return (bool === true ? 1 : 0); };
function debounce(fn, wait) {
var t;
return function () {
var _this = this;
var args = arguments;
clearTimeout(t);
t = setTimeout(function () { return fn.apply(_this, args); }, wait);
};
}
var arrayify = function (obj) {
return obj instanceof Array ? obj : [obj];
};
/***/ }),
/***/ "./node_modules/flatpickr/dist/esm/utils/polyfills.js":
/*!************************************************************!*\
!*** ./node_modules/flatpickr/dist/esm/utils/polyfills.js ***!
\************************************************************/
/***/ (() => {
"use strict";
if (typeof Object.assign !== "function") {
Object.assign = function (target) {
var args = [];
for (var _i = 1; _i < arguments.length; _i++) {
args[_i - 1] = arguments[_i];
}
if (!target) {
throw TypeError("Cannot convert undefined or null to object");
}
var _loop_1 = function (source) {
if (source) {
Object.keys(source).forEach(function (key) { return (target[key] = source[key]); });
}
};
for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {
var source = args_1[_a];
_loop_1(source);
}
return target;
};
}
/***/ }),
/***/ "./node_modules/flatpickr/dist/l10n/fr.js":
/*!************************************************!*\
!*** ./node_modules/flatpickr/dist/l10n/fr.js ***!
\************************************************/
/***/ (function(__unused_webpack_module, exports) {
(function (global, factory) {
true ? factory(exports) :
0;
}(this, (function (exports) { 'use strict';
var fp = typeof window !== "undefined" && window.flatpickr !== undefined
? window.flatpickr
: {
l10ns: {},
};
var French = {
firstDayOfWeek: 1,
weekdays: {
shorthand: ["dim", "lun", "mar", "mer", "jeu", "ven", "sam"],
longhand: [
"dimanche",
"lundi",
"mardi",
"mercredi",
"jeudi",
"vendredi",
"samedi",
],
},
months: {
shorthand: [
"janv",
"févr",
"mars",
"avr",
"mai",
"juin",
"juil",
"août",
"sept",
"oct",
"nov",
"déc",
],
longhand: [
"janvier",
"février",
"mars",
"avril",
"mai",
"juin",
"juillet",
"août",
"septembre",
"octobre",
"novembre",
"décembre",
],
},
ordinal: function (nth) {
if (nth > 1)
return "";
return "er";
},
rangeSeparator: " au ",
weekAbbreviation: "Sem",
scrollTitle: "Défiler pour augmenter la valeur",
toggleTitle: "Cliquer pour basculer",
time_24hr: true,
};
fp.l10ns.fr = French;
var fr = fp.l10ns;
exports.French = French;
exports.default = fr;
Object.defineProperty(exports, '__esModule', { value: true });
})));
/***/ }),
/***/ "./node_modules/jquery/external/sizzle/dist/sizzle.js":
/*!************************************************************!*\
!*** ./node_modules/jquery/external/sizzle/dist/sizzle.js ***!
\************************************************************/
/***/ ((module, exports, __webpack_require__) => {
var __WEBPACK_AMD_DEFINE_RESULT__;/*!
* Sizzle CSS Selector Engine v2.3.6
* https://sizzlejs.com/
*
* Copyright JS Foundation and other contributors
* Released under the MIT license
* https://js.foundation/
*
* Date: 2021-02-16
*/
( function( window ) {
var i,
support,
Expr,
getText,
isXML,
tokenize,
compile,
select,
outermostContext,
sortInput,
hasDuplicate,
// Local document vars
setDocument,
document,
docElem,
documentIsHTML,
rbuggyQSA,
rbuggyMatches,
matches,
contains,
// Instance-specific data
expando = "sizzle" + 1 * new Date(),
preferredDoc = window.document,
dirruns = 0,
done = 0,
classCache = createCache(),
tokenCache = createCache(),
compilerCache = createCache(),
nonnativeSelectorCache = createCache(),
sortOrder = function( a, b ) {
if ( a === b ) {
hasDuplicate = true;
}
return 0;
},
// Instance methods
hasOwn = ( {} ).hasOwnProperty,
arr = [],
pop = arr.pop,
pushNative = arr.push,
push = arr.push,
slice = arr.slice,
// Use a stripped-down indexOf as it's faster than native
// https://jsperf.com/thor-indexof-vs-for/5
indexOf = function( list, elem ) {
var i = 0,
len = list.length;
for ( ; i < len; i++ ) {
if ( list[ i ] === elem ) {
return i;
}
}
return -1;
},
booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" +
"ismap|loop|multiple|open|readonly|required|scoped",
// Regular expressions
// http://www.w3.org/TR/css3-selectors/#whitespace
whitespace = "[\\x20\\t\\r\\n\\f]",
// https://www.w3.org/TR/css-syntax-3/#ident-token-diagram
identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace +
"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",
// Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
// Operator (capture 2)
"*([*^$|!~]?=)" + whitespace +
// "Attribute values must be CSS identifiers [capture 5]
// or strings [capture 3 or capture 4]"
"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
whitespace + "*\\]",
pseudos = ":(" + identifier + ")(?:\\((" +
// To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
// 1. quoted (capture 3; capture 4 or capture 5)
"('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
// 2. simple (capture 6)
"((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
// 3. anything else (capture 2)
".*" +
")\\)|)",
// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
rwhitespace = new RegExp( whitespace + "+", "g" ),
rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" +
whitespace + "+$", "g" ),
rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace +
"*" ),
rdescend = new RegExp( whitespace + "|>" ),
rpseudo = new RegExp( pseudos ),
ridentifier = new RegExp( "^" + identifier + "$" ),
matchExpr = {
"ID": new RegExp( "^#(" + identifier + ")" ),
"CLASS": new RegExp( "^\\.(" + identifier + ")" ),
"TAG": new RegExp( "^(" + identifier + "|[*])" ),
"ATTR": new RegExp( "^" + attributes ),
"PSEUDO": new RegExp( "^" + pseudos ),
"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" +
whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" +
whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
"bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
// For use in libraries implementing .is()
// We use this for POS matching in `select`
"needsContext": new RegExp( "^" + whitespace +
"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
"*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
},
rhtml = /HTML$/i,
rinputs = /^(?:input|select|textarea|button)$/i,
rheader = /^h\d$/i,
rnative = /^[^{]+\{\s*\[native \w/,
// Easily-parseable/retrievable ID or TAG or CLASS selectors
rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
rsibling = /[+~]/,
// CSS escapes
// http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ),
funescape = function( escape, nonHex ) {
var high = "0x" + escape.slice( 1 ) - 0x10000;
return nonHex ?
// Strip the backslash prefix from a non-hex escape sequence
nonHex :
// Replace a hexadecimal escape sequence with the encoded Unicode code point
// Support: IE <=11+
// For values outside the Basic Multilingual Plane (BMP), manually construct a
// surrogate pair
high < 0 ?
String.fromCharCode( high + 0x10000 ) :
String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
},
// CSS string/identifier serialization
// https://drafts.csswg.org/cssom/#common-serializing-idioms
rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,
fcssescape = function( ch, asCodePoint ) {
if ( asCodePoint ) {
// U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER
if ( ch === "\0" ) {
return "\uFFFD";
}
// Control characters and (dependent upon position) numbers get escaped as code points
return ch.slice( 0, -1 ) + "\\" +
ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " ";
}
// Other potentially-special ASCII characters get backslash-escaped
return "\\" + ch;
},
// Used for iframes
// See setDocument()
// Removing the function wrapper causes a "Permission Denied"
// error in IE
unloadHandler = function() {
setDocument();
},
inDisabledFieldset = addCombinator(
function( elem ) {
return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset";
},
{ dir: "parentNode", next: "legend" }
);
// Optimize for push.apply( _, NodeList )
try {
push.apply(
( arr = slice.call( preferredDoc.childNodes ) ),
preferredDoc.childNodes
);
// Support: Android<4.0
// Detect silently failing push.apply
// eslint-disable-next-line no-unused-expressions
arr[ preferredDoc.childNodes.length ].nodeType;
} catch ( e ) {
push = { apply: arr.length ?
// Leverage slice if possible
function( target, els ) {
pushNative.apply( target, slice.call( els ) );
} :
// Support: IE<9
// Otherwise append directly
function( target, els ) {
var j = target.length,
i = 0;
// Can't trust NodeList.length
while ( ( target[ j++ ] = els[ i++ ] ) ) {}
target.length = j - 1;
}
};
}
function Sizzle( selector, context, results, seed ) {
var m, i, elem, nid, match, groups, newSelector,
newContext = context && context.ownerDocument,
// nodeType defaults to 9, since context defaults to document
nodeType = context ? context.nodeType : 9;
results = results || [];
// Return early from calls with invalid selector or context
if ( typeof selector !== "string" || !selector ||
nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
return results;
}
// Try to shortcut find operations (as opposed to filters) in HTML documents
if ( !seed ) {
setDocument( context );
context = context || document;
if ( documentIsHTML ) {
// If the selector is sufficiently simple, try using a "get*By*" DOM method
// (excepting DocumentFragment context, where the methods don't exist)
if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) {
// ID selector
if ( ( m = match[ 1 ] ) ) {
// Document context
if ( nodeType === 9 ) {
if ( ( elem = context.getElementById( m ) ) ) {
// Support: IE, Opera, Webkit
// TODO: identify versions
// getElementById can match elements by name instead of ID
if ( elem.id === m ) {
results.push( elem );
return results;
}
} else {
return results;
}
// Element context
} else {
// Support: IE, Opera, Webkit
// TODO: identify versions
// getElementById can match elements by name instead of ID
if ( newContext && ( elem = newContext.getElementById( m ) ) &&
contains( context, elem ) &&
elem.id === m ) {
results.push( elem );
return results;
}
}
// Type selector
} else if ( match[ 2 ] ) {
push.apply( results, context.getElementsByTagName( selector ) );
return results;
// Class selector
} else if ( ( m = match[ 3 ] ) && support.getElementsByClassName &&
context.getElementsByClassName ) {
push.apply( results, context.getElementsByClassName( m ) );
return results;
}
}
// Take advantage of querySelectorAll
if ( support.qsa &&
!nonnativeSelectorCache[ selector + " " ] &&
( !rbuggyQSA || !rbuggyQSA.test( selector ) ) &&
// Support: IE 8 only
// Exclude object elements
( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) {
newSelector = selector;
newContext = context;
// qSA considers elements outside a scoping root when evaluating child or
// descendant combinators, which is not what we want.
// In such cases, we work around the behavior by prefixing every selector in the
// list with an ID selector referencing the scope context.
// The technique has to be used as well when a leading combinator is used
// as such selectors are not recognized by querySelectorAll.
// Thanks to Andrew Dupont for this technique.
if ( nodeType === 1 &&
( rdescend.test( selector ) || rcombinators.test( selector ) ) ) {
// Expand context for sibling selectors
newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
context;
// We can use :scope instead of the ID hack if the browser
// supports it & if we're not changing the context.
if ( newContext !== context || !support.scope ) {
// Capture the context ID, setting it first if necessary
if ( ( nid = context.getAttribute( "id" ) ) ) {
nid = nid.replace( rcssescape, fcssescape );
} else {
context.setAttribute( "id", ( nid = expando ) );
}
}
// Prefix every selector in the list
groups = tokenize( selector );
i = groups.length;
while ( i-- ) {
groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " +
toSelector( groups[ i ] );
}
newSelector = groups.join( "," );
}
try {
push.apply( results,
newContext.querySelectorAll( newSelector )
);
return results;
} catch ( qsaError ) {
nonnativeSelectorCache( selector, true );
} finally {
if ( nid === expando ) {
context.removeAttribute( "id" );
}
}
}
}
}
// All others
return select( selector.replace( rtrim, "$1" ), context, results, seed );
}
/**
* Create key-value caches of limited size
* @returns {function(string, object)} Returns the Object data after storing it on itself with
* property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
* deleting the oldest entry
*/
function createCache() {
var keys = [];
function cache( key, value ) {
// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
if ( keys.push( key + " " ) > Expr.cacheLength ) {
// Only keep the most recent entries
delete cache[ keys.shift() ];
}
return ( cache[ key + " " ] = value );
}
return cache;
}
/**
* Mark a function for special use by Sizzle
* @param {Function} fn The function to mark
*/
function markFunction( fn ) {
fn[ expando ] = true;
return fn;
}
/**
* Support testing using an element
* @param {Function} fn Passed the created element and returns a boolean result
*/
function assert( fn ) {
var el = document.createElement( "fieldset" );
try {
return !!fn( el );
} catch ( e ) {
return false;
} finally {
// Remove from its parent by default
if ( el.parentNode ) {
el.parentNode.removeChild( el );
}
// release memory in IE
el = null;
}
}
/**
* Adds the same handler for all of the specified attrs
* @param {String} attrs Pipe-separated list of attributes
* @param {Function} handler The method that will be applied
*/
function addHandle( attrs, handler ) {
var arr = attrs.split( "|" ),
i = arr.length;
while ( i-- ) {
Expr.attrHandle[ arr[ i ] ] = handler;
}
}
/**
* Checks document order of two siblings
* @param {Element} a
* @param {Element} b
* @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
*/
function siblingCheck( a, b ) {
var cur = b && a,
diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
a.sourceIndex - b.sourceIndex;
// Use IE sourceIndex if available on both nodes
if ( diff ) {
return diff;
}
// Check if b follows a
if ( cur ) {
while ( ( cur = cur.nextSibling ) ) {
if ( cur === b ) {
return -1;
}
}
}
return a ? 1 : -1;
}
/**
* Returns a function to use in pseudos for input types
* @param {String} type
*/
function createInputPseudo( type ) {
return function( elem ) {
var name = elem.nodeName.toLowerCase();
return name === "input" && elem.type === type;
};
}
/**
* Returns a function to use in pseudos for buttons
* @param {String} type
*/
function createButtonPseudo( type ) {
return function( elem ) {
var name = elem.nodeName.toLowerCase();
return ( name === "input" || name === "button" ) && elem.type === type;
};
}
/**
* Returns a function to use in pseudos for :enabled/:disabled
* @param {Boolean} disabled true for :disabled; false for :enabled
*/
function createDisabledPseudo( disabled ) {
// Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable
return function( elem ) {
// Only certain elements can match :enabled or :disabled
// https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled
// https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled
if ( "form" in elem ) {
// Check for inherited disabledness on relevant non-disabled elements:
// * listed form-associated elements in a disabled fieldset
// https://html.spec.whatwg.org/multipage/forms.html#category-listed
// https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled
// * option elements in a disabled optgroup
// https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled
// All such elements have a "form" property.
if ( elem.parentNode && elem.disabled === false ) {
// Option elements defer to a parent optgroup if present
if ( "label" in elem ) {
if ( "label" in elem.parentNode ) {
return elem.parentNode.disabled === disabled;
} else {
return elem.disabled === disabled;
}
}
// Support: IE 6 - 11
// Use the isDisabled shortcut property to check for disabled fieldset ancestors
return elem.isDisabled === disabled ||
// Where there is no isDisabled, check manually
/* jshint -W018 */
elem.isDisabled !== !disabled &&
inDisabledFieldset( elem ) === disabled;
}
return elem.disabled === disabled;
// Try to winnow out elements that can't be disabled before trusting the disabled property.
// Some victims get caught in our net (label, legend, menu, track), but it shouldn't
// even exist on them, let alone have a boolean value.
} else if ( "label" in elem ) {
return elem.disabled === disabled;
}
// Remaining elements are neither :enabled nor :disabled
return false;
};
}
/**
* Returns a function to use in pseudos for positionals
* @param {Function} fn
*/
function createPositionalPseudo( fn ) {
return markFunction( function( argument ) {
argument = +argument;
return markFunction( function( seed, matches ) {
var j,
matchIndexes = fn( [], seed.length, argument ),
i = matchIndexes.length;
// Match elements found at the specified indexes
while ( i-- ) {
if ( seed[ ( j = matchIndexes[ i ] ) ] ) {
seed[ j ] = !( matches[ j ] = seed[ j ] );
}
}
} );
} );
}
/**
* Checks a node for validity as a Sizzle context
* @param {Element|Object=} context
* @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
*/
function testContext( context ) {
return context && typeof context.getElementsByTagName !== "undefined" && context;
}
// Expose support vars for convenience
support = Sizzle.support = {};
/**
* Detects XML nodes
* @param {Element|Object} elem An element or a document
* @returns {Boolean} True iff elem is a non-HTML XML node
*/
isXML = Sizzle.isXML = function( elem ) {
var namespace = elem && elem.namespaceURI,
docElem = elem && ( elem.ownerDocument || elem ).documentElement;
// Support: IE <=8
// Assume HTML when documentElement doesn't yet exist, such as inside loading iframes
// https://bugs.jquery.com/ticket/4833
return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" );
};
/**
* Sets document-related variables once based on the current document
* @param {Element|Object} [doc] An element or document object to use to set the document
* @returns {Object} Returns the current document
*/
setDocument = Sizzle.setDocument = function( node ) {
var hasCompare, subWindow,
doc = node ? node.ownerDocument || node : preferredDoc;
// Return early if doc is invalid or already selected
// Support: IE 11+, Edge 17 - 18+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
// two documents; shallow comparisons work.
// eslint-disable-next-line eqeqeq
if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) {
return document;
}
// Update global variables
document = doc;
docElem = document.documentElement;
documentIsHTML = !isXML( document );
// Support: IE 9 - 11+, Edge 12 - 18+
// Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
// Support: IE 11+, Edge 17 - 18+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
// two documents; shallow comparisons work.
// eslint-disable-next-line eqeqeq
if ( preferredDoc != document &&
( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
// Support: IE 11, Edge
if ( subWindow.addEventListener ) {
subWindow.addEventListener( "unload", unloadHandler, false );
// Support: IE 9 - 10 only
} else if ( subWindow.attachEvent ) {
subWindow.attachEvent( "onunload", unloadHandler );
}
}
// Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only,
// Safari 4 - 5 only, Opera <=11.6 - 12.x only
// IE/Edge & older browsers don't support the :scope pseudo-class.
// Support: Safari 6.0 only
// Safari 6.0 supports :scope but it's an alias of :root there.
support.scope = assert( function( el ) {
docElem.appendChild( el ).appendChild( document.createElement( "div" ) );
return typeof el.querySelectorAll !== "undefined" &&
!el.querySelectorAll( ":scope fieldset div" ).length;
} );
/* Attributes
---------------------------------------------------------------------- */
// Support: IE<8
// Verify that getAttribute really returns attributes and not properties
// (excepting IE8 booleans)
support.attributes = assert( function( el ) {
el.className = "i";
return !el.getAttribute( "className" );
} );
/* getElement(s)By*
---------------------------------------------------------------------- */
// Check if getElementsByTagName("*") returns only elements
support.getElementsByTagName = assert( function( el ) {
el.appendChild( document.createComment( "" ) );
return !el.getElementsByTagName( "*" ).length;
} );
// Support: IE<9
support.getElementsByClassName = rnative.test( document.getElementsByClassName );
// Support: IE<10
// Check if getElementById returns elements by name
// The broken getElementById methods don't pick up programmatically-set names,
// so use a roundabout getElementsByName test
support.getById = assert( function( el ) {
docElem.appendChild( el ).id = expando;
return !document.getElementsByName || !document.getElementsByName( expando ).length;
} );
// ID filter and find
if ( support.getById ) {
Expr.filter[ "ID" ] = function( id ) {
var attrId = id.replace( runescape, funescape );
return function( elem ) {
return elem.getAttribute( "id" ) === attrId;
};
};
Expr.find[ "ID" ] = function( id, context ) {
if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
var elem = context.getElementById( id );
return elem ? [ elem ] : [];
}
};
} else {
Expr.filter[ "ID" ] = function( id ) {
var attrId = id.replace( runescape, funescape );
return function( elem ) {
var node = typeof elem.getAttributeNode !== "undefined" &&
elem.getAttributeNode( "id" );
return node && node.value === attrId;
};
};
// Support: IE 6 - 7 only
// getElementById is not reliable as a find shortcut
Expr.find[ "ID" ] = function( id, context ) {
if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
var node, i, elems,
elem = context.getElementById( id );
if ( elem ) {
// Verify the id attribute
node = elem.getAttributeNode( "id" );
if ( node && node.value === id ) {
return [ elem ];
}
// Fall back on getElementsByName
elems = context.getElementsByName( id );
i = 0;
while ( ( elem = elems[ i++ ] ) ) {
node = elem.getAttributeNode( "id" );
if ( node && node.value === id ) {
return [ elem ];
}
}
}
return [];
}
};
}
// Tag
Expr.find[ "TAG" ] = support.getElementsByTagName ?
function( tag, context ) {
if ( typeof context.getElementsByTagName !== "undefined" ) {
return context.getElementsByTagName( tag );
// DocumentFragment nodes don't have gEBTN
} else if ( support.qsa ) {
return context.querySelectorAll( tag );
}
} :
function( tag, context ) {
var elem,
tmp = [],
i = 0,
// By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
results = context.getElementsByTagName( tag );
// Filter out possible comments
if ( tag === "*" ) {
while ( ( elem = results[ i++ ] ) ) {
if ( elem.nodeType === 1 ) {
tmp.push( elem );
}
}
return tmp;
}
return results;
};
// Class
Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) {
if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
return context.getElementsByClassName( className );
}
};
/* QSA/matchesSelector
---------------------------------------------------------------------- */
// QSA and matchesSelector support
// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
rbuggyMatches = [];
// qSa(:focus) reports false when true (Chrome 21)
// We allow this because of a bug in IE8/9 that throws an error
// whenever `document.activeElement` is accessed on an iframe
// So, we allow :focus to pass through QSA all the time to avoid the IE error
// See https://bugs.jquery.com/ticket/13378
rbuggyQSA = [];
if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) {
// Build QSA regex
// Regex strategy adopted from Diego Perini
assert( function( el ) {
var input;
// Select is set to empty string on purpose
// This is to test IE's treatment of not explicitly
// setting a boolean content attribute,
// since its presence should be enough
// https://bugs.jquery.com/ticket/12359
docElem.appendChild( el ).innerHTML = "" +
"";
// Support: IE8, Opera 11-12.16
// Nothing should be selected when empty strings follow ^= or $= or *=
// The test attribute must be unknown in Opera but "safe" for WinRT
// https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) {
rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
}
// Support: IE8
// Boolean attributes and "value" are not treated correctly
if ( !el.querySelectorAll( "[selected]" ).length ) {
rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
}
// Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
rbuggyQSA.push( "~=" );
}
// Support: IE 11+, Edge 15 - 18+
// IE 11/Edge don't find elements on a `[name='']` query in some cases.
// Adding a temporary attribute to the document before the selection works
// around the issue.
// Interestingly, IE 10 & older don't seem to have the issue.
input = document.createElement( "input" );
input.setAttribute( "name", "" );
el.appendChild( input );
if ( !el.querySelectorAll( "[name='']" ).length ) {
rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +
whitespace + "*(?:''|\"\")" );
}
// Webkit/Opera - :checked should return selected option elements
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
// IE8 throws error here and will not see later tests
if ( !el.querySelectorAll( ":checked" ).length ) {
rbuggyQSA.push( ":checked" );
}
// Support: Safari 8+, iOS 8+
// https://bugs.webkit.org/show_bug.cgi?id=136851
// In-page `selector#id sibling-combinator selector` fails
if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
rbuggyQSA.push( ".#.+[+~]" );
}
// Support: Firefox <=3.6 - 5 only
// Old Firefox doesn't throw on a badly-escaped identifier.
el.querySelectorAll( "\\\f" );
rbuggyQSA.push( "[\\r\\n\\f]" );
} );
assert( function( el ) {
el.innerHTML = "" +
"";
// Support: Windows 8 Native Apps
// The type and name attributes are restricted during .innerHTML assignment
var input = document.createElement( "input" );
input.setAttribute( "type", "hidden" );
el.appendChild( input ).setAttribute( "name", "D" );
// Support: IE8
// Enforce case-sensitivity of name attribute
if ( el.querySelectorAll( "[name=d]" ).length ) {
rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
}
// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
// IE8 throws error here and will not see later tests
if ( el.querySelectorAll( ":enabled" ).length !== 2 ) {
rbuggyQSA.push( ":enabled", ":disabled" );
}
// Support: IE9-11+
// IE's :disabled selector does not pick up the children of disabled fieldsets
docElem.appendChild( el ).disabled = true;
if ( el.querySelectorAll( ":disabled" ).length !== 2 ) {
rbuggyQSA.push( ":enabled", ":disabled" );
}
// Support: Opera 10 - 11 only
// Opera 10-11 does not throw on post-comma invalid pseudos
el.querySelectorAll( "*,:x" );
rbuggyQSA.push( ",.*:" );
} );
}
if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches ||
docElem.webkitMatchesSelector ||
docElem.mozMatchesSelector ||
docElem.oMatchesSelector ||
docElem.msMatchesSelector ) ) ) ) {
assert( function( el ) {
// Check to see if it's possible to do matchesSelector
// on a disconnected node (IE 9)
support.disconnectedMatch = matches.call( el, "*" );
// This should fail with an exception
// Gecko does not error, returns false instead
matches.call( el, "[s!='']:x" );
rbuggyMatches.push( "!=", pseudos );
} );
}
rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) );
/* Contains
---------------------------------------------------------------------- */
hasCompare = rnative.test( docElem.compareDocumentPosition );
// Element contains another
// Purposefully self-exclusive
// As in, an element does not contain itself
contains = hasCompare || rnative.test( docElem.contains ) ?
function( a, b ) {
var adown = a.nodeType === 9 ? a.documentElement : a,
bup = b && b.parentNode;
return a === bup || !!( bup && bup.nodeType === 1 && (
adown.contains ?
adown.contains( bup ) :
a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
) );
} :
function( a, b ) {
if ( b ) {
while ( ( b = b.parentNode ) ) {
if ( b === a ) {
return true;
}
}
}
return false;
};
/* Sorting
---------------------------------------------------------------------- */
// Document order sorting
sortOrder = hasCompare ?
function( a, b ) {
// Flag for duplicate removal
if ( a === b ) {
hasDuplicate = true;
return 0;
}
// Sort on method existence if only one input has compareDocumentPosition
var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
if ( compare ) {
return compare;
}
// Calculate position if both inputs belong to the same document
// Support: IE 11+, Edge 17 - 18+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
// two documents; shallow comparisons work.
// eslint-disable-next-line eqeqeq
compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?
a.compareDocumentPosition( b ) :
// Otherwise we know they are disconnected
1;
// Disconnected nodes
if ( compare & 1 ||
( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) {
// Choose the first element that is related to our preferred document
// Support: IE 11+, Edge 17 - 18+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
// two documents; shallow comparisons work.
// eslint-disable-next-line eqeqeq
if ( a == document || a.ownerDocument == preferredDoc &&
contains( preferredDoc, a ) ) {
return -1;
}
// Support: IE 11+, Edge 17 - 18+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
// two documents; shallow comparisons work.
// eslint-disable-next-line eqeqeq
if ( b == document || b.ownerDocument == preferredDoc &&
contains( preferredDoc, b ) ) {
return 1;
}
// Maintain original order
return sortInput ?
( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
0;
}
return compare & 4 ? -1 : 1;
} :
function( a, b ) {
// Exit early if the nodes are identical
if ( a === b ) {
hasDuplicate = true;
return 0;
}
var cur,
i = 0,
aup = a.parentNode,
bup = b.parentNode,
ap = [ a ],
bp = [ b ];
// Parentless nodes are either documents or disconnected
if ( !aup || !bup ) {
// Support: IE 11+, Edge 17 - 18+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
// two documents; shallow comparisons work.
/* eslint-disable eqeqeq */
return a == document ? -1 :
b == document ? 1 :
/* eslint-enable eqeqeq */
aup ? -1 :
bup ? 1 :
sortInput ?
( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
0;
// If the nodes are siblings, we can do a quick check
} else if ( aup === bup ) {
return siblingCheck( a, b );
}
// Otherwise we need full lists of their ancestors for comparison
cur = a;
while ( ( cur = cur.parentNode ) ) {
ap.unshift( cur );
}
cur = b;
while ( ( cur = cur.parentNode ) ) {
bp.unshift( cur );
}
// Walk down the tree looking for a discrepancy
while ( ap[ i ] === bp[ i ] ) {
i++;
}
return i ?
// Do a sibling check if the nodes have a common ancestor
siblingCheck( ap[ i ], bp[ i ] ) :
// Otherwise nodes in our document sort first
// Support: IE 11+, Edge 17 - 18+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
// two documents; shallow comparisons work.
/* eslint-disable eqeqeq */
ap[ i ] == preferredDoc ? -1 :
bp[ i ] == preferredDoc ? 1 :
/* eslint-enable eqeqeq */
0;
};
return document;
};
Sizzle.matches = function( expr, elements ) {
return Sizzle( expr, null, null, elements );
};
Sizzle.matchesSelector = function( elem, expr ) {
setDocument( elem );
if ( support.matchesSelector && documentIsHTML &&
!nonnativeSelectorCache[ expr + " " ] &&
( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
try {
var ret = matches.call( elem, expr );
// IE 9's matchesSelector returns false on disconnected nodes
if ( ret || support.disconnectedMatch ||
// As well, disconnected nodes are said to be in a document
// fragment in IE 9
elem.document && elem.document.nodeType !== 11 ) {
return ret;
}
} catch ( e ) {
nonnativeSelectorCache( expr, true );
}
}
return Sizzle( expr, document, null, [ elem ] ).length > 0;
};
Sizzle.contains = function( context, elem ) {
// Set document vars if needed
// Support: IE 11+, Edge 17 - 18+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
// two documents; shallow comparisons work.
// eslint-disable-next-line eqeqeq
if ( ( context.ownerDocument || context ) != document ) {
setDocument( context );
}
return contains( context, elem );
};
Sizzle.attr = function( elem, name ) {
// Set document vars if needed
// Support: IE 11+, Edge 17 - 18+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
// two documents; shallow comparisons work.
// eslint-disable-next-line eqeqeq
if ( ( elem.ownerDocument || elem ) != document ) {
setDocument( elem );
}
var fn = Expr.attrHandle[ name.toLowerCase() ],
// Don't get fooled by Object.prototype properties (jQuery #13807)
val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
fn( elem, name, !documentIsHTML ) :
undefined;
return val !== undefined ?
val :
support.attributes || !documentIsHTML ?
elem.getAttribute( name ) :
( val = elem.getAttributeNode( name ) ) && val.specified ?
val.value :
null;
};
Sizzle.escape = function( sel ) {
return ( sel + "" ).replace( rcssescape, fcssescape );
};
Sizzle.error = function( msg ) {
throw new Error( "Syntax error, unrecognized expression: " + msg );
};
/**
* Document sorting and removing duplicates
* @param {ArrayLike} results
*/
Sizzle.uniqueSort = function( results ) {
var elem,
duplicates = [],
j = 0,
i = 0;
// Unless we *know* we can detect duplicates, assume their presence
hasDuplicate = !support.detectDuplicates;
sortInput = !support.sortStable && results.slice( 0 );
results.sort( sortOrder );
if ( hasDuplicate ) {
while ( ( elem = results[ i++ ] ) ) {
if ( elem === results[ i ] ) {
j = duplicates.push( i );
}
}
while ( j-- ) {
results.splice( duplicates[ j ], 1 );
}
}
// Clear input after sorting to release objects
// See https://github.com/jquery/sizzle/pull/225
sortInput = null;
return results;
};
/**
* Utility function for retrieving the text value of an array of DOM nodes
* @param {Array|Element} elem
*/
getText = Sizzle.getText = function( elem ) {
var node,
ret = "",
i = 0,
nodeType = elem.nodeType;
if ( !nodeType ) {
// If no nodeType, this is expected to be an array
while ( ( node = elem[ i++ ] ) ) {
// Do not traverse comment nodes
ret += getText( node );
}
} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
// Use textContent for elements
// innerText usage removed for consistency of new lines (jQuery #11153)
if ( typeof elem.textContent === "string" ) {
return elem.textContent;
} else {
// Traverse its children
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
ret += getText( elem );
}
}
} else if ( nodeType === 3 || nodeType === 4 ) {
return elem.nodeValue;
}
// Do not include comment or processing instruction nodes
return ret;
};
Expr = Sizzle.selectors = {
// Can be adjusted by the user
cacheLength: 50,
createPseudo: markFunction,
match: matchExpr,
attrHandle: {},
find: {},
relative: {
">": { dir: "parentNode", first: true },
" ": { dir: "parentNode" },
"+": { dir: "previousSibling", first: true },
"~": { dir: "previousSibling" }
},
preFilter: {
"ATTR": function( match ) {
match[ 1 ] = match[ 1 ].replace( runescape, funescape );
// Move the given value to match[3] whether quoted or unquoted
match[ 3 ] = ( match[ 3 ] || match[ 4 ] ||
match[ 5 ] || "" ).replace( runescape, funescape );
if ( match[ 2 ] === "~=" ) {
match[ 3 ] = " " + match[ 3 ] + " ";
}
return match.slice( 0, 4 );
},
"CHILD": function( match ) {
/* matches from matchExpr["CHILD"]
1 type (only|nth|...)
2 what (child|of-type)
3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
4 xn-component of xn+y argument ([+-]?\d*n|)
5 sign of xn-component
6 x of xn-component
7 sign of y-component
8 y of y-component
*/
match[ 1 ] = match[ 1 ].toLowerCase();
if ( match[ 1 ].slice( 0, 3 ) === "nth" ) {
// nth-* requires argument
if ( !match[ 3 ] ) {
Sizzle.error( match[ 0 ] );
}
// numeric x and y parameters for Expr.filter.CHILD
// remember that false/true cast respectively to 0/1
match[ 4 ] = +( match[ 4 ] ?
match[ 5 ] + ( match[ 6 ] || 1 ) :
2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) );
match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" );
// other types prohibit arguments
} else if ( match[ 3 ] ) {
Sizzle.error( match[ 0 ] );
}
return match;
},
"PSEUDO": function( match ) {
var excess,
unquoted = !match[ 6 ] && match[ 2 ];
if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) {
return null;
}
// Accept quoted arguments as-is
if ( match[ 3 ] ) {
match[ 2 ] = match[ 4 ] || match[ 5 ] || "";
// Strip excess characters from unquoted arguments
} else if ( unquoted && rpseudo.test( unquoted ) &&
// Get excess from tokenize (recursively)
( excess = tokenize( unquoted, true ) ) &&
// advance to the next closing parenthesis
( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) {
// excess is a negative index
match[ 0 ] = match[ 0 ].slice( 0, excess );
match[ 2 ] = unquoted.slice( 0, excess );
}
// Return only captures needed by the pseudo filter method (type and argument)
return match.slice( 0, 3 );
}
},
filter: {
"TAG": function( nodeNameSelector ) {
var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
return nodeNameSelector === "*" ?
function() {
return true;
} :
function( elem ) {
return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
};
},
"CLASS": function( className ) {
var pattern = classCache[ className + " " ];
return pattern ||
( pattern = new RegExp( "(^|" + whitespace +
")" + className + "(" + whitespace + "|$)" ) ) && classCache(
className, function( elem ) {
return pattern.test(
typeof elem.className === "string" && elem.className ||
typeof elem.getAttribute !== "undefined" &&
elem.getAttribute( "class" ) ||
""
);
} );
},
"ATTR": function( name, operator, check ) {
return function( elem ) {
var result = Sizzle.attr( elem, name );
if ( result == null ) {
return operator === "!=";
}
if ( !operator ) {
return true;
}
result += "";
/* eslint-disable max-len */
return operator === "=" ? result === check :
operator === "!=" ? result !== check :
operator === "^=" ? check && result.indexOf( check ) === 0 :
operator === "*=" ? check && result.indexOf( check ) > -1 :
operator === "$=" ? check && result.slice( -check.length ) === check :
operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
false;
/* eslint-enable max-len */
};
},
"CHILD": function( type, what, _argument, first, last ) {
var simple = type.slice( 0, 3 ) !== "nth",
forward = type.slice( -4 ) !== "last",
ofType = what === "of-type";
return first === 1 && last === 0 ?
// Shortcut for :nth-*(n)
function( elem ) {
return !!elem.parentNode;
} :
function( elem, _context, xml ) {
var cache, uniqueCache, outerCache, node, nodeIndex, start,
dir = simple !== forward ? "nextSibling" : "previousSibling",
parent = elem.parentNode,
name = ofType && elem.nodeName.toLowerCase(),
useCache = !xml && !ofType,
diff = false;
if ( parent ) {
// :(first|last|only)-(child|of-type)
if ( simple ) {
while ( dir ) {
node = elem;
while ( ( node = node[ dir ] ) ) {
if ( ofType ?
node.nodeName.toLowerCase() === name :
node.nodeType === 1 ) {
return false;
}
}
// Reverse direction for :only-* (if we haven't yet done so)
start = dir = type === "only" && !start && "nextSibling";
}
return true;
}
start = [ forward ? parent.firstChild : parent.lastChild ];
// non-xml :nth-child(...) stores cache data on `parent`
if ( forward && useCache ) {
// Seek `elem` from a previously-cached index
// ...in a gzip-friendly way
node = parent;
outerCache = node[ expando ] || ( node[ expando ] = {} );
// Support: IE <9 only
// Defend against cloned attroperties (jQuery gh-1709)
uniqueCache = outerCache[ node.uniqueID ] ||
( outerCache[ node.uniqueID ] = {} );
cache = uniqueCache[ type ] || [];
nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
diff = nodeIndex && cache[ 2 ];
node = nodeIndex && parent.childNodes[ nodeIndex ];
while ( ( node = ++nodeIndex && node && node[ dir ] ||
// Fallback to seeking `elem` from the start
( diff = nodeIndex = 0 ) || start.pop() ) ) {
// When found, cache indexes on `parent` and break
if ( node.nodeType === 1 && ++diff && node === elem ) {
uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
break;
}
}
} else {
// Use previously-cached element index if available
if ( useCache ) {
// ...in a gzip-friendly way
node = elem;
outerCache = node[ expando ] || ( node[ expando ] = {} );
// Support: IE <9 only
// Defend against cloned attroperties (jQuery gh-1709)
uniqueCache = outerCache[ node.uniqueID ] ||
( outerCache[ node.uniqueID ] = {} );
cache = uniqueCache[ type ] || [];
nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
diff = nodeIndex;
}
// xml :nth-child(...)
// or :nth-last-child(...) or :nth(-last)?-of-type(...)
if ( diff === false ) {
// Use the same loop as above to seek `elem` from the start
while ( ( node = ++nodeIndex && node && node[ dir ] ||
( diff = nodeIndex = 0 ) || start.pop() ) ) {
if ( ( ofType ?
node.nodeName.toLowerCase() === name :
node.nodeType === 1 ) &&
++diff ) {
// Cache the index of each encountered element
if ( useCache ) {
outerCache = node[ expando ] ||
( node[ expando ] = {} );
// Support: IE <9 only
// Defend against cloned attroperties (jQuery gh-1709)
uniqueCache = outerCache[ node.uniqueID ] ||
( outerCache[ node.uniqueID ] = {} );
uniqueCache[ type ] = [ dirruns, diff ];
}
if ( node === elem ) {
break;
}
}
}
}
}
// Incorporate the offset, then check against cycle size
diff -= last;
return diff === first || ( diff % first === 0 && diff / first >= 0 );
}
};
},
"PSEUDO": function( pseudo, argument ) {
// pseudo-class names are case-insensitive
// http://www.w3.org/TR/selectors/#pseudo-classes
// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
// Remember that setFilters inherits from pseudos
var args,
fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
Sizzle.error( "unsupported pseudo: " + pseudo );
// The user may use createPseudo to indicate that
// arguments are needed to create the filter function
// just as Sizzle does
if ( fn[ expando ] ) {
return fn( argument );
}
// But maintain support for old signatures
if ( fn.length > 1 ) {
args = [ pseudo, pseudo, "", argument ];
return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
markFunction( function( seed, matches ) {
var idx,
matched = fn( seed, argument ),
i = matched.length;
while ( i-- ) {
idx = indexOf( seed, matched[ i ] );
seed[ idx ] = !( matches[ idx ] = matched[ i ] );
}
} ) :
function( elem ) {
return fn( elem, 0, args );
};
}
return fn;
}
},
pseudos: {
// Potentially complex pseudos
"not": markFunction( function( selector ) {
// Trim the selector passed to compile
// to avoid treating leading and trailing
// spaces as combinators
var input = [],
results = [],
matcher = compile( selector.replace( rtrim, "$1" ) );
return matcher[ expando ] ?
markFunction( function( seed, matches, _context, xml ) {
var elem,
unmatched = matcher( seed, null, xml, [] ),
i = seed.length;
// Match elements unmatched by `matcher`
while ( i-- ) {
if ( ( elem = unmatched[ i ] ) ) {
seed[ i ] = !( matches[ i ] = elem );
}
}
} ) :
function( elem, _context, xml ) {
input[ 0 ] = elem;
matcher( input, null, xml, results );
// Don't keep the element (issue #299)
input[ 0 ] = null;
return !results.pop();
};
} ),
"has": markFunction( function( selector ) {
return function( elem ) {
return Sizzle( selector, elem ).length > 0;
};
} ),
"contains": markFunction( function( text ) {
text = text.replace( runescape, funescape );
return function( elem ) {
return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1;
};
} ),
// "Whether an element is represented by a :lang() selector
// is based solely on the element's language value
// being equal to the identifier C,
// or beginning with the identifier C immediately followed by "-".
// The matching of C against the element's language value is performed case-insensitively.
// The identifier C does not have to be a valid language name."
// http://www.w3.org/TR/selectors/#lang-pseudo
"lang": markFunction( function( lang ) {
// lang value must be a valid identifier
if ( !ridentifier.test( lang || "" ) ) {
Sizzle.error( "unsupported lang: " + lang );
}
lang = lang.replace( runescape, funescape ).toLowerCase();
return function( elem ) {
var elemLang;
do {
if ( ( elemLang = documentIsHTML ?
elem.lang :
elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) {
elemLang = elemLang.toLowerCase();
return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
}
} while ( ( elem = elem.parentNode ) && elem.nodeType === 1 );
return false;
};
} ),
// Miscellaneous
"target": function( elem ) {
var hash = window.location && window.location.hash;
return hash && hash.slice( 1 ) === elem.id;
},
"root": function( elem ) {
return elem === docElem;
},
"focus": function( elem ) {
return elem === document.activeElement &&
( !document.hasFocus || document.hasFocus() ) &&
!!( elem.type || elem.href || ~elem.tabIndex );
},
// Boolean properties
"enabled": createDisabledPseudo( false ),
"disabled": createDisabledPseudo( true ),
"checked": function( elem ) {
// In CSS3, :checked should return both checked and selected elements
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
var nodeName = elem.nodeName.toLowerCase();
return ( nodeName === "input" && !!elem.checked ) ||
( nodeName === "option" && !!elem.selected );
},
"selected": function( elem ) {
// Accessing this property makes selected-by-default
// options in Safari work properly
if ( elem.parentNode ) {
// eslint-disable-next-line no-unused-expressions
elem.parentNode.selectedIndex;
}
return elem.selected === true;
},
// Contents
"empty": function( elem ) {
// http://www.w3.org/TR/selectors/#empty-pseudo
// :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
// but not by others (comment: 8; processing instruction: 7; etc.)
// nodeType < 6 works because attributes (2) do not appear as children
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
if ( elem.nodeType < 6 ) {
return false;
}
}
return true;
},
"parent": function( elem ) {
return !Expr.pseudos[ "empty" ]( elem );
},
// Element/input types
"header": function( elem ) {
return rheader.test( elem.nodeName );
},
"input": function( elem ) {
return rinputs.test( elem.nodeName );
},
"button": function( elem ) {
var name = elem.nodeName.toLowerCase();
return name === "input" && elem.type === "button" || name === "button";
},
"text": function( elem ) {
var attr;
return elem.nodeName.toLowerCase() === "input" &&
elem.type === "text" &&
// Support: IE<8
// New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
( ( attr = elem.getAttribute( "type" ) ) == null ||
attr.toLowerCase() === "text" );
},
// Position-in-collection
"first": createPositionalPseudo( function() {
return [ 0 ];
} ),
"last": createPositionalPseudo( function( _matchIndexes, length ) {
return [ length - 1 ];
} ),
"eq": createPositionalPseudo( function( _matchIndexes, length, argument ) {
return [ argument < 0 ? argument + length : argument ];
} ),
"even": createPositionalPseudo( function( matchIndexes, length ) {
var i = 0;
for ( ; i < length; i += 2 ) {
matchIndexes.push( i );
}
return matchIndexes;
} ),
"odd": createPositionalPseudo( function( matchIndexes, length ) {
var i = 1;
for ( ; i < length; i += 2 ) {
matchIndexes.push( i );
}
return matchIndexes;
} ),
"lt": createPositionalPseudo( function( matchIndexes, length, argument ) {
var i = argument < 0 ?
argument + length :
argument > length ?
length :
argument;
for ( ; --i >= 0; ) {
matchIndexes.push( i );
}
return matchIndexes;
} ),
"gt": createPositionalPseudo( function( matchIndexes, length, argument ) {
var i = argument < 0 ? argument + length : argument;
for ( ; ++i < length; ) {
matchIndexes.push( i );
}
return matchIndexes;
} )
}
};
Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ];
// Add button/input type pseudos
for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
Expr.pseudos[ i ] = createInputPseudo( i );
}
for ( i in { submit: true, reset: true } ) {
Expr.pseudos[ i ] = createButtonPseudo( i );
}
// Easy API for creating new setFilters
function setFilters() {}
setFilters.prototype = Expr.filters = Expr.pseudos;
Expr.setFilters = new setFilters();
tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
var matched, match, tokens, type,
soFar, groups, preFilters,
cached = tokenCache[ selector + " " ];
if ( cached ) {
return parseOnly ? 0 : cached.slice( 0 );
}
soFar = selector;
groups = [];
preFilters = Expr.preFilter;
while ( soFar ) {
// Comma and first run
if ( !matched || ( match = rcomma.exec( soFar ) ) ) {
if ( match ) {
// Don't consume trailing commas as valid
soFar = soFar.slice( match[ 0 ].length ) || soFar;
}
groups.push( ( tokens = [] ) );
}
matched = false;
// Combinators
if ( ( match = rcombinators.exec( soFar ) ) ) {
matched = match.shift();
tokens.push( {
value: matched,
// Cast descendant combinators to space
type: match[ 0 ].replace( rtrim, " " )
} );
soFar = soFar.slice( matched.length );
}
// Filters
for ( type in Expr.filter ) {
if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] ||
( match = preFilters[ type ]( match ) ) ) ) {
matched = match.shift();
tokens.push( {
value: matched,
type: type,
matches: match
} );
soFar = soFar.slice( matched.length );
}
}
if ( !matched ) {
break;
}
}
// Return the length of the invalid excess
// if we're just parsing
// Otherwise, throw an error or return tokens
return parseOnly ?
soFar.length :
soFar ?
Sizzle.error( selector ) :
// Cache the tokens
tokenCache( selector, groups ).slice( 0 );
};
function toSelector( tokens ) {
var i = 0,
len = tokens.length,
selector = "";
for ( ; i < len; i++ ) {
selector += tokens[ i ].value;
}
return selector;
}
function addCombinator( matcher, combinator, base ) {
var dir = combinator.dir,
skip = combinator.next,
key = skip || dir,
checkNonElements = base && key === "parentNode",
doneName = done++;
return combinator.first ?
// Check against closest ancestor/preceding element
function( elem, context, xml ) {
while ( ( elem = elem[ dir ] ) ) {
if ( elem.nodeType === 1 || checkNonElements ) {
return matcher( elem, context, xml );
}
}
return false;
} :
// Check against all ancestor/preceding elements
function( elem, context, xml ) {
var oldCache, uniqueCache, outerCache,
newCache = [ dirruns, doneName ];
// We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
if ( xml ) {
while ( ( elem = elem[ dir ] ) ) {
if ( elem.nodeType === 1 || checkNonElements ) {
if ( matcher( elem, context, xml ) ) {
return true;
}
}
}
} else {
while ( ( elem = elem[ dir ] ) ) {
if ( elem.nodeType === 1 || checkNonElements ) {
outerCache = elem[ expando ] || ( elem[ expando ] = {} );
// Support: IE <9 only
// Defend against cloned attroperties (jQuery gh-1709)
uniqueCache = outerCache[ elem.uniqueID ] ||
( outerCache[ elem.uniqueID ] = {} );
if ( skip && skip === elem.nodeName.toLowerCase() ) {
elem = elem[ dir ] || elem;
} else if ( ( oldCache = uniqueCache[ key ] ) &&
oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
// Assign to newCache so results back-propagate to previous elements
return ( newCache[ 2 ] = oldCache[ 2 ] );
} else {
// Reuse newcache so results back-propagate to previous elements
uniqueCache[ key ] = newCache;
// A match means we're done; a fail means we have to keep checking
if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) {
return true;
}
}
}
}
}
return false;
};
}
function elementMatcher( matchers ) {
return matchers.length > 1 ?
function( elem, context, xml ) {
var i = matchers.length;
while ( i-- ) {
if ( !matchers[ i ]( elem, context, xml ) ) {
return false;
}
}
return true;
} :
matchers[ 0 ];
}
function multipleContexts( selector, contexts, results ) {
var i = 0,
len = contexts.length;
for ( ; i < len; i++ ) {
Sizzle( selector, contexts[ i ], results );
}
return results;
}
function condense( unmatched, map, filter, context, xml ) {
var elem,
newUnmatched = [],
i = 0,
len = unmatched.length,
mapped = map != null;
for ( ; i < len; i++ ) {
if ( ( elem = unmatched[ i ] ) ) {
if ( !filter || filter( elem, context, xml ) ) {
newUnmatched.push( elem );
if ( mapped ) {
map.push( i );
}
}
}
}
return newUnmatched;
}
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
if ( postFilter && !postFilter[ expando ] ) {
postFilter = setMatcher( postFilter );
}
if ( postFinder && !postFinder[ expando ] ) {
postFinder = setMatcher( postFinder, postSelector );
}
return markFunction( function( seed, results, context, xml ) {
var temp, i, elem,
preMap = [],
postMap = [],
preexisting = results.length,
// Get initial elements from seed or context
elems = seed || multipleContexts(
selector || "*",
context.nodeType ? [ context ] : context,
[]
),
// Prefilter to get matcher input, preserving a map for seed-results synchronization
matcherIn = preFilter && ( seed || !selector ) ?
condense( elems, preMap, preFilter, context, xml ) :
elems,
matcherOut = matcher ?
// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
// ...intermediate processing is necessary
[] :
// ...otherwise use results directly
results :
matcherIn;
// Find primary matches
if ( matcher ) {
matcher( matcherIn, matcherOut, context, xml );
}
// Apply postFilter
if ( postFilter ) {
temp = condense( matcherOut, postMap );
postFilter( temp, [], context, xml );
// Un-match failing elements by moving them back to matcherIn
i = temp.length;
while ( i-- ) {
if ( ( elem = temp[ i ] ) ) {
matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem );
}
}
}
if ( seed ) {
if ( postFinder || preFilter ) {
if ( postFinder ) {
// Get the final matcherOut by condensing this intermediate into postFinder contexts
temp = [];
i = matcherOut.length;
while ( i-- ) {
if ( ( elem = matcherOut[ i ] ) ) {
// Restore matcherIn since elem is not yet a final match
temp.push( ( matcherIn[ i ] = elem ) );
}
}
postFinder( null, ( matcherOut = [] ), temp, xml );
}
// Move matched elements from seed to results to keep them synchronized
i = matcherOut.length;
while ( i-- ) {
if ( ( elem = matcherOut[ i ] ) &&
( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) {
seed[ temp ] = !( results[ temp ] = elem );
}
}
}
// Add elements to results, through postFinder if defined
} else {
matcherOut = condense(
matcherOut === results ?
matcherOut.splice( preexisting, matcherOut.length ) :
matcherOut
);
if ( postFinder ) {
postFinder( null, results, matcherOut, xml );
} else {
push.apply( results, matcherOut );
}
}
} );
}
function matcherFromTokens( tokens ) {
var checkContext, matcher, j,
len = tokens.length,
leadingRelative = Expr.relative[ tokens[ 0 ].type ],
implicitRelative = leadingRelative || Expr.relative[ " " ],
i = leadingRelative ? 1 : 0,
// The foundational matcher ensures that elements are reachable from top-level context(s)
matchContext = addCombinator( function( elem ) {
return elem === checkContext;
}, implicitRelative, true ),
matchAnyContext = addCombinator( function( elem ) {
return indexOf( checkContext, elem ) > -1;
}, implicitRelative, true ),
matchers = [ function( elem, context, xml ) {
var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
( checkContext = context ).nodeType ?
matchContext( elem, context, xml ) :
matchAnyContext( elem, context, xml ) );
// Avoid hanging onto element (issue #299)
checkContext = null;
return ret;
} ];
for ( ; i < len; i++ ) {
if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) {
matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
} else {
matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches );
// Return special upon seeing a positional matcher
if ( matcher[ expando ] ) {
// Find the next relative operator (if any) for proper handling
j = ++i;
for ( ; j < len; j++ ) {
if ( Expr.relative[ tokens[ j ].type ] ) {
break;
}
}
return setMatcher(
i > 1 && elementMatcher( matchers ),
i > 1 && toSelector(
// If the preceding token was a descendant combinator, insert an implicit any-element `*`
tokens
.slice( 0, i - 1 )
.concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } )
).replace( rtrim, "$1" ),
matcher,
i < j && matcherFromTokens( tokens.slice( i, j ) ),
j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ),
j < len && toSelector( tokens )
);
}
matchers.push( matcher );
}
}
return elementMatcher( matchers );
}
function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
var bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
superMatcher = function( seed, context, xml, results, outermost ) {
var elem, j, matcher,
matchedCount = 0,
i = "0",
unmatched = seed && [],
setMatched = [],
contextBackup = outermostContext,
// We must always have either seed elements or outermost context
elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ),
// Use integer dirruns iff this is the outermost matcher
dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ),
len = elems.length;
if ( outermost ) {
// Support: IE 11+, Edge 17 - 18+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
// two documents; shallow comparisons work.
// eslint-disable-next-line eqeqeq
outermostContext = context == document || context || outermost;
}
// Add elements passing elementMatchers directly to results
// Support: IE<9, Safari
// Tolerate NodeList properties (IE: "length"; Safari: " ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
// Otherwise use the full result
responseText );
// If the request succeeds, this function gets "data", "status", "jqXHR"
// but they are ignored because response was set above.
// If it fails, this function gets "jqXHR", "status", "error"
} ).always( callback && function( jqXHR, status ) {
self.each( function() {
callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] );
} );
} );
}
return this;
};
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
/***/ }),
/***/ "./node_modules/jquery/src/ajax/script.js":
/*!************************************************!*\
!*** ./node_modules/jquery/src/ajax/script.js ***!
\************************************************/
/***/ ((module, exports, __webpack_require__) => {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;!(__WEBPACK_AMD_DEFINE_ARRAY__ = [
__webpack_require__(/*! ../core */ "./node_modules/jquery/src/core.js"),
__webpack_require__(/*! ../var/document */ "./node_modules/jquery/src/var/document.js"),
__webpack_require__(/*! ../ajax */ "./node_modules/jquery/src/ajax.js")
], __WEBPACK_AMD_DEFINE_RESULT__ = (function( jQuery, document ) {
"use strict";
// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432)
jQuery.ajaxPrefilter( function( s ) {
if ( s.crossDomain ) {
s.contents.script = false;
}
} );
// Install script dataType
jQuery.ajaxSetup( {
accepts: {
script: "text/javascript, application/javascript, " +
"application/ecmascript, application/x-ecmascript"
},
contents: {
script: /\b(?:java|ecma)script\b/
},
converters: {
"text script": function( text ) {
jQuery.globalEval( text );
return text;
}
}
} );
// Handle cache's special case and crossDomain
jQuery.ajaxPrefilter( "script", function( s ) {
if ( s.cache === undefined ) {
s.cache = false;
}
if ( s.crossDomain ) {
s.type = "GET";
}
} );
// Bind script tag hack transport
jQuery.ajaxTransport( "script", function( s ) {
// This transport only deals with cross domain or forced-by-attrs requests
if ( s.crossDomain || s.scriptAttrs ) {
var script, callback;
return {
send: function( _, complete ) {
script = jQuery( " |