(self["webpackChunkramsey_plus_forms"] = self["webpackChunkramsey_plus_forms"] || []).push([[86],{ /***/ 8: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const debounce$1 = __webpack_require__(6773); function debounce(func, debounceMs = 0, options = {}) { if (typeof options !== 'object') { options = {}; } const { leading = false, trailing = true, maxWait } = options; const edges = Array(2); if (leading) { edges[0] = 'leading'; } if (trailing) { edges[1] = 'trailing'; } let result = undefined; let pendingAt = null; const _debounced = debounce$1.debounce(function (...args) { result = func.apply(this, args); pendingAt = null; }, debounceMs, { edges }); const debounced = function (...args) { if (maxWait != null) { if (pendingAt === null) { pendingAt = Date.now(); } if (Date.now() - pendingAt >= maxWait) { result = func.apply(this, args); pendingAt = Date.now(); _debounced.cancel(); _debounced.schedule(); return result; } } _debounced.apply(this, args); return result; }; const flush = () => { _debounced.flush(); return result; }; debounced.cancel = _debounced.cancel; debounced.flush = flush; return debounced; } exports.debounce = debounce; /***/ }), /***/ 25: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = __webpack_require__(1334).last; /***/ }), /***/ 58: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const isLength = __webpack_require__(9181); function isArrayLike(value) { return value != null && typeof value !== 'function' && isLength.isLength(value.length); } exports.isArrayLike = isArrayLike; /***/ }), /***/ 184: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = __webpack_require__(4259).sortBy; /***/ }), /***/ 196: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ a: () => (/* binding */ svgPropertiesAndEvents) /* harmony export */ }); /* unused harmony export svgPropertiesAndEventsFromUnknown */ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6540); /* harmony import */ var _excludeEventProps__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8129); /* harmony import */ var _svgPropertiesNoEvents__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5448); /** * Filters an object to only include SVG properties, data attributes, and event handlers. * @param obj - The object to filter. * @returns A new object containing only valid SVG properties, data attributes, and event handlers. */ function svgPropertiesAndEvents(obj) { var result = {}; // for ... in loop is 10x faster than Object.entries + filter + Object.fromEntries in Chrome for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { if ((0,_svgPropertiesNoEvents__WEBPACK_IMPORTED_MODULE_2__/* .isSvgElementPropKey */ .Rw)(key) || (0,_svgPropertiesNoEvents__WEBPACK_IMPORTED_MODULE_2__/* .isDataAttribute */ .Xc)(key) || (0,_excludeEventProps__WEBPACK_IMPORTED_MODULE_1__/* .isEventKey */ .q)(key)) { result[key] = obj[key]; } } } return result; } /** * Function to filter SVG properties from various input types. * The input types can be: * - A record of string keys to any values, in which case it returns a record of only SVG properties * - A React element, in which case it returns the props of the element filtered to only SVG properties * - Anything else, in which case it returns null * * This function has a wide-open return type, because it will read and filter the props of an arbitrary React element. * This can be SVG, HTML, whatnot, with arbitrary values, so we can't type it more specifically. * * If you wish to have a type-safe version, use svgPropertiesNoEvents directly with a typed object. * * @param input - The input to filter, which can be a record, a React element, or other types. * @returns A record of SVG properties if the input is a record or React element, otherwise null. */ function svgPropertiesAndEventsFromUnknown(input) { if (input == null) { return null; } if (/*#__PURE__*/isValidElement(input)) { // @ts-expect-error we can't type this better because input can be any React element return svgPropertiesAndEvents(input.props); } if (typeof input === 'object' && !Array.isArray(input)) { return svgPropertiesAndEvents(input); } return null; } /***/ }), /***/ 228: /***/ ((module) => { "use strict"; var has = Object.prototype.hasOwnProperty , prefix = '~'; /** * Constructor to create a storage for our `EE` objects. * An `Events` instance is a plain object whose properties are event names. * * @constructor * @private */ function Events() {} // // We try to not inherit from `Object.prototype`. In some engines creating an // instance in this way is faster than calling `Object.create(null)` directly. // If `Object.create(null)` is not supported we prefix the event names with a // character to make sure that the built-in object properties are not // overridden or used as an attack vector. // if (Object.create) { Events.prototype = Object.create(null); // // This hack is needed because the `__proto__` property is still inherited in // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. // if (!new Events().__proto__) prefix = false; } /** * Representation of a single event listener. * * @param {Function} fn The listener function. * @param {*} context The context to invoke the listener with. * @param {Boolean} [once=false] Specify if the listener is a one-time listener. * @constructor * @private */ function EE(fn, context, once) { this.fn = fn; this.context = context; this.once = once || false; } /** * Add a listener for a given event. * * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. * @param {(String|Symbol)} event The event name. * @param {Function} fn The listener function. * @param {*} context The context to invoke the listener with. * @param {Boolean} once Specify if the listener is a one-time listener. * @returns {EventEmitter} * @private */ function addListener(emitter, event, fn, context, once) { if (typeof fn !== 'function') { throw new TypeError('The listener must be a function'); } var listener = new EE(fn, context || emitter, once) , evt = prefix ? prefix + event : event; if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); else emitter._events[evt] = [emitter._events[evt], listener]; return emitter; } /** * Clear event by name. * * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. * @param {(String|Symbol)} evt The Event name. * @private */ function clearEvent(emitter, evt) { if (--emitter._eventsCount === 0) emitter._events = new Events(); else delete emitter._events[evt]; } /** * Minimal `EventEmitter` interface that is molded against the Node.js * `EventEmitter` interface. * * @constructor * @public */ function EventEmitter() { this._events = new Events(); this._eventsCount = 0; } /** * Return an array listing the events for which the emitter has registered * listeners. * * @returns {Array} * @public */ EventEmitter.prototype.eventNames = function eventNames() { var names = [] , events , name; if (this._eventsCount === 0) return names; for (name in (events = this._events)) { if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); } if (Object.getOwnPropertySymbols) { return names.concat(Object.getOwnPropertySymbols(events)); } return names; }; /** * Return the listeners registered for a given event. * * @param {(String|Symbol)} event The event name. * @returns {Array} The registered listeners. * @public */ EventEmitter.prototype.listeners = function listeners(event) { var evt = prefix ? prefix + event : event , handlers = this._events[evt]; if (!handlers) return []; if (handlers.fn) return [handlers.fn]; for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { ee[i] = handlers[i].fn; } return ee; }; /** * Return the number of listeners listening to a given event. * * @param {(String|Symbol)} event The event name. * @returns {Number} The number of listeners. * @public */ EventEmitter.prototype.listenerCount = function listenerCount(event) { var evt = prefix ? prefix + event : event , listeners = this._events[evt]; if (!listeners) return 0; if (listeners.fn) return 1; return listeners.length; }; /** * Calls each of the listeners registered for a given event. * * @param {(String|Symbol)} event The event name. * @returns {Boolean} `true` if the event had listeners, else `false`. * @public */ EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { var evt = prefix ? prefix + event : event; if (!this._events[evt]) return false; var listeners = this._events[evt] , len = arguments.length , args , i; if (listeners.fn) { if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); switch (len) { case 1: return listeners.fn.call(listeners.context), true; case 2: return listeners.fn.call(listeners.context, a1), true; case 3: return listeners.fn.call(listeners.context, a1, a2), true; case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; } for (i = 1, args = new Array(len -1); i < len; i++) { args[i - 1] = arguments[i]; } listeners.fn.apply(listeners.context, args); } else { var length = listeners.length , j; for (i = 0; i < length; i++) { if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); switch (len) { case 1: listeners[i].fn.call(listeners[i].context); break; case 2: listeners[i].fn.call(listeners[i].context, a1); break; case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; default: if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { args[j - 1] = arguments[j]; } listeners[i].fn.apply(listeners[i].context, args); } } } return true; }; /** * Add a listener for a given event. * * @param {(String|Symbol)} event The event name. * @param {Function} fn The listener function. * @param {*} [context=this] The context to invoke the listener with. * @returns {EventEmitter} `this`. * @public */ EventEmitter.prototype.on = function on(event, fn, context) { return addListener(this, event, fn, context, false); }; /** * Add a one-time listener for a given event. * * @param {(String|Symbol)} event The event name. * @param {Function} fn The listener function. * @param {*} [context=this] The context to invoke the listener with. * @returns {EventEmitter} `this`. * @public */ EventEmitter.prototype.once = function once(event, fn, context) { return addListener(this, event, fn, context, true); }; /** * Remove the listeners of a given event. * * @param {(String|Symbol)} event The event name. * @param {Function} fn Only remove the listeners that match this function. * @param {*} context Only remove the listeners that have this context. * @param {Boolean} once Only remove one-time listeners. * @returns {EventEmitter} `this`. * @public */ EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { var evt = prefix ? prefix + event : event; if (!this._events[evt]) return this; if (!fn) { clearEvent(this, evt); return this; } var listeners = this._events[evt]; if (listeners.fn) { if ( listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context) ) { clearEvent(this, evt); } } else { for (var i = 0, events = [], length = listeners.length; i < length; i++) { if ( listeners[i].fn !== fn || (once && !listeners[i].once) || (context && listeners[i].context !== context) ) { events.push(listeners[i]); } } // // Reset the array, or remove it completely if we have no more listeners. // if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; else clearEvent(this, evt); } return this; }; /** * Remove all listeners, or those of the specified event. * * @param {(String|Symbol)} [event] The event name. * @returns {EventEmitter} `this`. * @public */ EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { var evt; if (event) { evt = prefix ? prefix + event : event; if (this._events[evt]) clearEvent(this, evt); } else { this._events = new Events(); this._eventsCount = 0; } return this; }; // // Alias methods names because people roll like that. // EventEmitter.prototype.off = EventEmitter.prototype.removeListener; EventEmitter.prototype.addListener = EventEmitter.prototype.on; // // Expose the prefix. // EventEmitter.prefixed = prefix; // // Allow `EventEmitter` to be imported as module namespace. // EventEmitter.EventEmitter = EventEmitter; // // Expose the module. // if (true) { module.exports = EventEmitter; } /***/ }), /***/ 305: /***/ ((module, __unused_webpack_exports, __webpack_require__) => { module.exports = __webpack_require__(4200).get; /***/ }), /***/ 316: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const isIndex = __webpack_require__(8509); const isArrayLike = __webpack_require__(58); const isObject = __webpack_require__(4905); const eq = __webpack_require__(6761); function isIterateeCall(value, index, object) { if (!isObject.isObject(object)) { return false; } if ((typeof index === 'number' && isArrayLike.isArrayLike(object) && isIndex.isIndex(index) && index < object.length) || (typeof index === 'string' && index in object)) { return eq.eq(object[index], value); } return false; } exports.isIterateeCall = isIterateeCall; /***/ }), /***/ 523: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ q: () => (/* binding */ combineTooltipPayloadConfigurations) /* harmony export */ }); var combineTooltipPayloadConfigurations = (tooltipState, tooltipEventType, trigger, defaultIndex) => { // if tooltip reacts to axis interaction, then we display all items at the same time. if (tooltipEventType === 'axis') { return tooltipState.tooltipItemPayloads; } /* * By now we already know that tooltipEventType is 'item', so we can only search in itemInteractions. * item means that only the hovered or clicked item will be present in the tooltip. */ if (tooltipState.tooltipItemPayloads.length === 0) { // No point filtering if the payload is empty return []; } var filterByDataKey; if (trigger === 'hover') { filterByDataKey = tooltipState.itemInteraction.hover.dataKey; } else { filterByDataKey = tooltipState.itemInteraction.click.dataKey; } if (filterByDataKey == null && defaultIndex != null) { /* * So when we use `defaultIndex` - we don't have a dataKey to filter by because user did not hover over anything yet. * In that case let's display the first item in the tooltip; after all, this is `item` interaction case, * so we should display only one item at a time instead of all. */ return [tooltipState.tooltipItemPayloads[0]]; } return tooltipState.tooltipItemPayloads.filter(tpc => { var _tpc$settings; return ((_tpc$settings = tpc.settings) === null || _tpc$settings === void 0 ? void 0 : _tpc$settings.dataKey) === filterByDataKey; }); }; /***/ }), /***/ 645: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); function last(arr) { return arr[arr.length - 1]; } exports.last = last; /***/ }), /***/ 648: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ I: () => (/* binding */ DefaultZIndexes) /* harmony export */ }); /** * A collection of all default zIndex values used throughout the library. */ var DefaultZIndexes = { /** * CartesianGrid and PolarGrid */ grid: -100, /** * Background of Bar and RadialBar. * This is not visible by default but can be enabled by setting background={true} on Bar or RadialBar. */ barBackground: -50, /* * other chart elements or custom elements without specific zIndex * render in here, at zIndex 0 */ /** * Area, Pie, Radar, and ReferenceArea */ area: 100, /** * Cursor is embedded inside Tooltip and controlled by it. * The Tooltip itself has a separate portal and is not included in the zIndex system; * Cursor is the decoration inside the chart area. CursorRectangle is a rectangle box. * It renders below bar so that in a stacked bar chart the cursor rectangle does not hide the other bars. */ cursorRectangle: 200, /** * Bar and RadialBar */ bar: 300, /** * Line and ReferenceLine, and ErrorBor */ line: 400, /** * XAxis and YAxis and PolarAngleAxis and PolarRadiusAxis ticks and lines and children */ axis: 500, /** * Scatter and ReferenceDot, * and Dots of Line and Area and Radar if they have dot=true */ scatter: 600, /** * Hovering over a Bar or RadialBar renders a highlight rectangle */ activeBar: 1000, /** * Cursor is embedded inside Tooltip and controlled by it. * The Tooltip itself has a separate portal and is not included in the zIndex system; * Cursor is the decoration inside the chart area, usually a cross or a box. * CursorLine is a line cursor rendered in Line, Area, Scatter, Radar charts. * It renders above the Line and Scatter so that it is always visible. * It renders below active dot so that the dot is always visible and shows the current point. * We're also assuming that the active dot is small enough that it does not fully cover the cursor line. * * This also applies to the radial cursor in RadialBarChart. */ cursorLine: 1100, /** * Hovering over a Point in Line, Area, Scatter, Radar renders a highlight dot */ activeDot: 1200, /** * LabelList and Label, including Axis labels */ label: 2000 }; /***/ }), /***/ 709: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { A: () => (/* binding */ Tooltip) }); // EXTERNAL MODULE: ./node_modules/react/index.js var react = __webpack_require__(6540); var react_namespaceObject = /*#__PURE__*/__webpack_require__.t(react, 2); // EXTERNAL MODULE: ./node_modules/classnames/index.js var classnames = __webpack_require__(6942); var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); ;// ./node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs function hasWindow() { return typeof window !== 'undefined'; } function floating_ui_utils_dom_getNodeName(node) { if (isNode(node)) { return (node.nodeName || '').toLowerCase(); } // Mocked nodes in testing environments may not be instances of Node. By // returning `#document` an infinite loop won't occur. // https://github.com/floating-ui/floating-ui/issues/2317 return '#document'; } function floating_ui_utils_dom_getWindow(node) { var _node$ownerDocument; return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; } function getDocumentElement(node) { var _ref; return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; } function isNode(value) { if (!hasWindow()) { return false; } return value instanceof Node || value instanceof floating_ui_utils_dom_getWindow(value).Node; } function isElement(value) { if (!hasWindow()) { return false; } return value instanceof Element || value instanceof floating_ui_utils_dom_getWindow(value).Element; } function floating_ui_utils_dom_isHTMLElement(value) { if (!hasWindow()) { return false; } return value instanceof HTMLElement || value instanceof floating_ui_utils_dom_getWindow(value).HTMLElement; } function isShadowRoot(value) { if (!hasWindow() || typeof ShadowRoot === 'undefined') { return false; } return value instanceof ShadowRoot || value instanceof floating_ui_utils_dom_getWindow(value).ShadowRoot; } const invalidOverflowDisplayValues = /*#__PURE__*/new Set(['inline', 'contents']); function isOverflowElement(element) { const { overflow, overflowX, overflowY, display } = floating_ui_utils_dom_getComputedStyle(element); return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !invalidOverflowDisplayValues.has(display); } const tableElements = /*#__PURE__*/new Set(['table', 'td', 'th']); function isTableElement(element) { return tableElements.has(floating_ui_utils_dom_getNodeName(element)); } const topLayerSelectors = [':popover-open', ':modal']; function isTopLayer(element) { return topLayerSelectors.some(selector => { try { return element.matches(selector); } catch (_e) { return false; } }); } const transformProperties = ['transform', 'translate', 'scale', 'rotate', 'perspective']; const willChangeValues = ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter']; const containValues = ['paint', 'layout', 'strict', 'content']; function isContainingBlock(elementOrCss) { const webkit = isWebKit(); const css = isElement(elementOrCss) ? floating_ui_utils_dom_getComputedStyle(elementOrCss) : elementOrCss; // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block // https://drafts.csswg.org/css-transforms-2/#individual-transforms return transformProperties.some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || willChangeValues.some(value => (css.willChange || '').includes(value)) || containValues.some(value => (css.contain || '').includes(value)); } function getContainingBlock(element) { let currentNode = getParentNode(element); while (floating_ui_utils_dom_isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { if (isContainingBlock(currentNode)) { return currentNode; } else if (isTopLayer(currentNode)) { return null; } currentNode = getParentNode(currentNode); } return null; } function isWebKit() { if (typeof CSS === 'undefined' || !CSS.supports) return false; return CSS.supports('-webkit-backdrop-filter', 'none'); } const lastTraversableNodeNames = /*#__PURE__*/new Set(['html', 'body', '#document']); function isLastTraversableNode(node) { return lastTraversableNodeNames.has(floating_ui_utils_dom_getNodeName(node)); } function floating_ui_utils_dom_getComputedStyle(element) { return floating_ui_utils_dom_getWindow(element).getComputedStyle(element); } function getNodeScroll(element) { if (isElement(element)) { return { scrollLeft: element.scrollLeft, scrollTop: element.scrollTop }; } return { scrollLeft: element.scrollX, scrollTop: element.scrollY }; } function getParentNode(node) { if (floating_ui_utils_dom_getNodeName(node) === 'html') { return node; } const result = // Step into the shadow DOM of the parent of a slotted node. node.assignedSlot || // DOM Element detected. node.parentNode || // ShadowRoot detected. isShadowRoot(node) && node.host || // Fallback. getDocumentElement(node); return isShadowRoot(result) ? result.host : result; } function getNearestOverflowAncestor(node) { const parentNode = getParentNode(node); if (isLastTraversableNode(parentNode)) { return node.ownerDocument ? node.ownerDocument.body : node.body; } if (floating_ui_utils_dom_isHTMLElement(parentNode) && isOverflowElement(parentNode)) { return parentNode; } return getNearestOverflowAncestor(parentNode); } function getOverflowAncestors(node, list, traverseIframes) { var _node$ownerDocument2; if (list === void 0) { list = []; } if (traverseIframes === void 0) { traverseIframes = true; } const scrollableAncestor = getNearestOverflowAncestor(node); const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); const win = floating_ui_utils_dom_getWindow(scrollableAncestor); if (isBody) { const frameElement = getFrameElement(win); return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []); } return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); } function getFrameElement(win) { return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null; } ;// ./node_modules/tabbable/dist/index.esm.js /*! * tabbable 6.3.0 * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE */ // NOTE: separate `:not()` selectors has broader browser support than the newer // `:not([inert], [inert] *)` (Feb 2023) // CAREFUL: JSDom does not support `:not([inert] *)` as a selector; using it causes // the entire query to fail, resulting in no nodes found, which will break a lot // of things... so we have to rely on JS to identify nodes inside an inert container var candidateSelectors = ['input:not([inert])', 'select:not([inert])', 'textarea:not([inert])', 'a[href]:not([inert])', 'button:not([inert])', '[tabindex]:not(slot):not([inert])', 'audio[controls]:not([inert])', 'video[controls]:not([inert])', '[contenteditable]:not([contenteditable="false"]):not([inert])', 'details>summary:first-of-type:not([inert])', 'details:not([inert])']; var candidateSelector = /* #__PURE__ */candidateSelectors.join(','); var NoElement = typeof Element === 'undefined'; var matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; var getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) { var _element$getRootNode; return element === null || element === void 0 ? void 0 : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element); } : function (element) { return element === null || element === void 0 ? void 0 : element.ownerDocument; }; /** * Determines if a node is inert or in an inert ancestor. * @param {Element} [node] * @param {boolean} [lookUp] If true and `node` is not inert, looks up at ancestors to * see if any of them are inert. If false, only `node` itself is considered. * @returns {boolean} True if inert itself or by way of being in an inert ancestor. * False if `node` is falsy. */ var _isInert = function isInert(node, lookUp) { var _node$getAttribute; if (lookUp === void 0) { lookUp = true; } // CAREFUL: JSDom does not support inert at all, so we can't use the `HTMLElement.inert` // JS API property; we have to check the attribute, which can either be empty or 'true'; // if it's `null` (not specified) or 'false', it's an active element var inertAtt = node === null || node === void 0 ? void 0 : (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node, 'inert'); var inert = inertAtt === '' || inertAtt === 'true'; // NOTE: this could also be handled with `node.matches('[inert], :is([inert] *)')` // if it weren't for `matches()` not being a function on shadow roots; the following // code works for any kind of node // CAREFUL: JSDom does not appear to support certain selectors like `:not([inert] *)` // so it likely would not support `:is([inert] *)` either... var result = inert || lookUp && node && _isInert(node.parentNode); // recursive return result; }; /** * Determines if a node's content is editable. * @param {Element} [node] * @returns True if it's content-editable; false if it's not or `node` is falsy. */ var isContentEditable = function isContentEditable(node) { var _node$getAttribute2; // CAREFUL: JSDom does not support the `HTMLElement.isContentEditable` API so we have // to use the attribute directly to check for this, which can either be empty or 'true'; // if it's `null` (not specified) or 'false', it's a non-editable element var attValue = node === null || node === void 0 ? void 0 : (_node$getAttribute2 = node.getAttribute) === null || _node$getAttribute2 === void 0 ? void 0 : _node$getAttribute2.call(node, 'contenteditable'); return attValue === '' || attValue === 'true'; }; /** * @param {Element} el container to check in * @param {boolean} includeContainer add container to check * @param {(node: Element) => boolean} filter filter candidates * @returns {Element[]} */ var getCandidates = function getCandidates(el, includeContainer, filter) { // even if `includeContainer=false`, we still have to check it for inertness because // if it's inert, all its children are inert if (_isInert(el)) { return []; } var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector)); if (includeContainer && matches.call(el, candidateSelector)) { candidates.unshift(el); } candidates = candidates.filter(filter); return candidates; }; /** * @callback GetShadowRoot * @param {Element} element to check for shadow root * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available. */ /** * @callback ShadowRootFilter * @param {Element} shadowHostNode the element which contains shadow content * @returns {boolean} true if a shadow root could potentially contain valid candidates. */ /** * @typedef {Object} CandidateScope * @property {Element} scopeParent contains inner candidates * @property {Element[]} candidates list of candidates found in the scope parent */ /** * @typedef {Object} IterativeOptions * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not; * if a function, implies shadow support is enabled and either returns the shadow root of an element * or a boolean stating if it has an undisclosed shadow root * @property {(node: Element) => boolean} filter filter candidates * @property {boolean} flatten if true then result will flatten any CandidateScope into the returned list * @property {ShadowRootFilter} shadowRootFilter filter shadow roots; */ /** * @param {Element[]} elements list of element containers to match candidates from * @param {boolean} includeContainer add container list to check * @param {IterativeOptions} options * @returns {Array.} */ var _getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) { var candidates = []; var elementsToCheck = Array.from(elements); while (elementsToCheck.length) { var element = elementsToCheck.shift(); if (_isInert(element, false)) { // no need to look up since we're drilling down // anything inside this container will also be inert continue; } if (element.tagName === 'SLOT') { // add shadow dom slot scope (slot itself cannot be focusable) var assigned = element.assignedElements(); var content = assigned.length ? assigned : element.children; var nestedCandidates = _getCandidatesIteratively(content, true, options); if (options.flatten) { candidates.push.apply(candidates, nestedCandidates); } else { candidates.push({ scopeParent: element, candidates: nestedCandidates }); } } else { // check candidate element var validCandidate = matches.call(element, candidateSelector); if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) { candidates.push(element); } // iterate over shadow content if possible var shadowRoot = element.shadowRoot || // check for an undisclosed shadow typeof options.getShadowRoot === 'function' && options.getShadowRoot(element); // no inert look up because we're already drilling down and checking for inertness // on the way down, so all containers to this root node should have already been // vetted as non-inert var validShadowRoot = !_isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element)); if (shadowRoot && validShadowRoot) { // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed // shadow exists, so look at light dom children as fallback BUT create a scope for any // child candidates found because they're likely slotted elements (elements that are // children of the web component element (which has the shadow), in the light dom, but // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below, // _after_ we return from this recursive call var _nestedCandidates = _getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options); if (options.flatten) { candidates.push.apply(candidates, _nestedCandidates); } else { candidates.push({ scopeParent: element, candidates: _nestedCandidates }); } } else { // there's not shadow so just dig into the element's (light dom) children // __without__ giving the element special scope treatment elementsToCheck.unshift.apply(elementsToCheck, element.children); } } } return candidates; }; /** * @private * Determines if the node has an explicitly specified `tabindex` attribute. * @param {HTMLElement} node * @returns {boolean} True if so; false if not. */ var hasTabIndex = function hasTabIndex(node) { return !isNaN(parseInt(node.getAttribute('tabindex'), 10)); }; /** * Determine the tab index of a given node. * @param {HTMLElement} node * @returns {number} Tab order (negative, 0, or positive number). * @throws {Error} If `node` is falsy. */ var getTabIndex = function getTabIndex(node) { if (!node) { throw new Error('No node provided'); } if (node.tabIndex < 0) { // in Chrome,
,