From 56e40ee8ae917000d61cfea6b73dc4b5ba75cd5f Mon Sep 17 00:00:00 2001 From: gtbu Date: Tue, 11 Mar 2025 00:27:09 +0100 Subject: [PATCH] ony jqery 3.6.3 and Ajax -deprecation removed jquery 3.7 - now only 3.6.3 (overlooked) -- added missing popper-map -- deprecation of Ajax which is now also safer --- .../thirdparty/Popper.js/popper.min.js.map | 1 + include/thirdparty/js/jquery.js | 1925 ++++++++++------- include/thirdparty/js/jquery.min.js | 4 +- include/thirdparty/js/jquery.min.map | 2 +- include/tool/Output/Ajax.php | 51 +- include/tool/Session.php | 1 + 6 files changed, 1140 insertions(+), 844 deletions(-) create mode 100644 include/thirdparty/Popper.js/popper.min.js.map diff --git a/include/thirdparty/Popper.js/popper.min.js.map b/include/thirdparty/Popper.js/popper.min.js.map new file mode 100644 index 0000000..e3471cf --- /dev/null +++ b/include/thirdparty/Popper.js/popper.min.js.map @@ -0,0 +1 @@ +{"version":3,"file":"popper.min.js","sources":["../../src/dom-utils/getWindow.js","../../src/dom-utils/instanceOf.js","../../src/utils/math.js","../../src/utils/userAgent.js","../../src/dom-utils/isLayoutViewport.js","../../src/dom-utils/getBoundingClientRect.js","../../src/dom-utils/getWindowScroll.js","../../src/dom-utils/getNodeName.js","../../src/dom-utils/getDocumentElement.js","../../src/dom-utils/getWindowScrollBarX.js","../../src/dom-utils/getComputedStyle.js","../../src/dom-utils/isScrollParent.js","../../src/dom-utils/getCompositeRect.js","../../src/dom-utils/getNodeScroll.js","../../src/dom-utils/getHTMLElementScroll.js","../../src/dom-utils/getLayoutRect.js","../../src/dom-utils/getParentNode.js","../../src/dom-utils/getScrollParent.js","../../src/dom-utils/listScrollParents.js","../../src/dom-utils/isTableElement.js","../../src/dom-utils/getOffsetParent.js","../../src/enums.js","../../src/utils/orderModifiers.js","../../src/dom-utils/contains.js","../../src/utils/rectToClientRect.js","../../src/dom-utils/getClippingRect.js","../../src/dom-utils/getViewportRect.js","../../src/dom-utils/getDocumentRect.js","../../src/utils/getBasePlacement.js","../../src/utils/getVariation.js","../../src/utils/getMainAxisFromPlacement.js","../../src/utils/computeOffsets.js","../../src/utils/mergePaddingObject.js","../../src/utils/getFreshSideObject.js","../../src/utils/expandToHashMap.js","../../src/utils/detectOverflow.js","../../src/createPopper.js","../../src/utils/debounce.js","../../src/utils/mergeByName.js","../../src/modifiers/eventListeners.js","../../src/modifiers/popperOffsets.js","../../src/modifiers/computeStyles.js","../../src/modifiers/applyStyles.js","../../src/modifiers/offset.js","../../src/utils/getOppositePlacement.js","../../src/utils/getOppositeVariationPlacement.js","../../src/utils/computeAutoPlacement.js","../../src/modifiers/flip.js","../../src/utils/within.js","../../src/modifiers/preventOverflow.js","../../src/utils/getAltAxis.js","../../src/modifiers/arrow.js","../../src/modifiers/hide.js","../../src/popper-lite.js","../../src/popper.js"],"sourcesContent":["// @flow\nimport type { Window } from '../types';\ndeclare function getWindow(node: Node | Window): Window;\n\nexport default function getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (node.toString() !== '[object Window]') {\n const ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}\n","// @flow\nimport getWindow from './getWindow';\n\ndeclare function isElement(node: mixed): boolean %checks(node instanceof\n Element);\nfunction isElement(node) {\n const OwnElement = getWindow(node).Element;\n return node instanceof OwnElement || node instanceof Element;\n}\n\ndeclare function isHTMLElement(node: mixed): boolean %checks(node instanceof\n HTMLElement);\nfunction isHTMLElement(node) {\n const OwnElement = getWindow(node).HTMLElement;\n return node instanceof OwnElement || node instanceof HTMLElement;\n}\n\ndeclare function isShadowRoot(node: mixed): boolean %checks(node instanceof\n ShadowRoot);\nfunction isShadowRoot(node) {\n // IE 11 has no ShadowRoot\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n const OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\nexport { isElement, isHTMLElement, isShadowRoot };\n","// @flow\nexport const max = Math.max;\nexport const min = Math.min;\nexport const round = Math.round;\n","// @flow\ntype Navigator = Navigator & { userAgentData?: NavigatorUAData };\n\ninterface NavigatorUAData {\n brands: Array<{ brand: string, version: string }>;\n mobile: boolean;\n platform: string;\n}\n\nexport default function getUAString(): string {\n const uaData = (navigator: Navigator).userAgentData;\n\n if (uaData?.brands && Array.isArray(uaData.brands)) {\n return uaData.brands\n .map((item) => `${item.brand}/${item.version}`)\n .join(' ');\n }\n\n return navigator.userAgent;\n}\n","// @flow\nimport getUAString from '../utils/userAgent';\n\nexport default function isLayoutViewport() {\n return !/^((?!chrome|android).)*safari/i.test(getUAString());\n}\n","// @flow\nimport type { ClientRectObject, VirtualElement } from '../types';\nimport { isElement, isHTMLElement } from './instanceOf';\nimport { round } from '../utils/math';\nimport getWindow from './getWindow';\nimport isLayoutViewport from './isLayoutViewport';\n\nexport default function getBoundingClientRect(\n element: Element | VirtualElement,\n includeScale: boolean = false,\n isFixedStrategy: boolean = false\n): ClientRectObject {\n const clientRect = element.getBoundingClientRect();\n let scaleX = 1;\n let scaleY = 1;\n\n if (includeScale && isHTMLElement(element)) {\n scaleX =\n (element: HTMLElement).offsetWidth > 0\n ? round(clientRect.width) / (element: HTMLElement).offsetWidth || 1\n : 1;\n scaleY =\n (element: HTMLElement).offsetHeight > 0\n ? round(clientRect.height) / (element: HTMLElement).offsetHeight || 1\n : 1;\n }\n\n const { visualViewport } = isElement(element) ? getWindow(element) : window;\n const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n\n const x =\n (clientRect.left +\n (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) /\n scaleX;\n const y =\n (clientRect.top +\n (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) /\n scaleY;\n const width = clientRect.width / scaleX;\n const height = clientRect.height / scaleY;\n\n return {\n width,\n height,\n top: y,\n right: x + width,\n bottom: y + height,\n left: x,\n x,\n y,\n };\n}\n","// @flow\nimport getWindow from './getWindow';\nimport type { Window } from '../types';\n\nexport default function getWindowScroll(node: Node | Window) {\n const win = getWindow(node);\n const scrollLeft = win.pageXOffset;\n const scrollTop = win.pageYOffset;\n\n return {\n scrollLeft,\n scrollTop,\n };\n}\n","// @flow\nimport type { Window } from '../types';\n\nexport default function getNodeName(element: ?Node | Window): ?string {\n return element ? (element.nodeName || '').toLowerCase() : null;\n}\n","// @flow\nimport { isElement } from './instanceOf';\nimport type { Window } from '../types';\n\nexport default function getDocumentElement(\n element: Element | Window\n): HTMLElement {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return (\n (isElement(element)\n ? element.ownerDocument\n : // $FlowFixMe[prop-missing]\n element.document) || window.document\n ).documentElement;\n}\n","// @flow\nimport getBoundingClientRect from './getBoundingClientRect';\nimport getDocumentElement from './getDocumentElement';\nimport getWindowScroll from './getWindowScroll';\n\nexport default function getWindowScrollBarX(element: Element): number {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n // Popper 1 is broken in this case and never had a bug report so let's assume\n // it's not an issue. I don't think anyone ever specifies width on \n // anyway.\n // Browsers where the left scrollbar doesn't cause an issue report `0` for\n // this (e.g. Edge 2019, IE11, Safari)\n return (\n getBoundingClientRect(getDocumentElement(element)).left +\n getWindowScroll(element).scrollLeft\n );\n}\n","// @flow\nimport getWindow from './getWindow';\n\nexport default function getComputedStyle(\n element: Element\n): CSSStyleDeclaration {\n return getWindow(element).getComputedStyle(element);\n}\n","// @flow\nimport getComputedStyle from './getComputedStyle';\n\nexport default function isScrollParent(element: HTMLElement): boolean {\n // Firefox wants us to check `-x` and `-y` variations as well\n const { overflow, overflowX, overflowY } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);\n}\n","// @flow\nimport type { Rect, VirtualElement, Window } from '../types';\nimport getBoundingClientRect from './getBoundingClientRect';\nimport getNodeScroll from './getNodeScroll';\nimport getNodeName from './getNodeName';\nimport { isHTMLElement } from './instanceOf';\nimport getWindowScrollBarX from './getWindowScrollBarX';\nimport getDocumentElement from './getDocumentElement';\nimport isScrollParent from './isScrollParent';\nimport { round } from '../utils/math';\n\nfunction isElementScaled(element: HTMLElement) {\n const rect = element.getBoundingClientRect();\n const scaleX = round(rect.width) / element.offsetWidth || 1;\n const scaleY = round(rect.height) / element.offsetHeight || 1;\n\n return scaleX !== 1 || scaleY !== 1;\n}\n\n// Returns the composite rect of an element relative to its offsetParent.\n// Composite means it takes into account transforms as well as layout.\nexport default function getCompositeRect(\n elementOrVirtualElement: Element | VirtualElement,\n offsetParent: Element | Window,\n isFixed: boolean = false\n): Rect {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const offsetParentIsScaled =\n isHTMLElement(offsetParent) && isElementScaled(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const rect = getBoundingClientRect(\n elementOrVirtualElement,\n offsetParentIsScaled,\n isFixed\n );\n\n let scroll = { scrollLeft: 0, scrollTop: 0 };\n let offsets = { x: 0, y: 0 };\n\n if (isOffsetParentAnElement || (!isOffsetParentAnElement && !isFixed)) {\n if (\n getNodeName(offsetParent) !== 'body' ||\n // https://github.com/popperjs/popper-core/issues/1078\n isScrollParent(documentElement)\n ) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n offsets = getBoundingClientRect(offsetParent, true);\n offsets.x += offsetParent.clientLeft;\n offsets.y += offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n\n return {\n x: rect.left + scroll.scrollLeft - offsets.x,\n y: rect.top + scroll.scrollTop - offsets.y,\n width: rect.width,\n height: rect.height,\n };\n}\n","// @flow\nimport getWindowScroll from './getWindowScroll';\nimport getWindow from './getWindow';\nimport { isHTMLElement } from './instanceOf';\nimport getHTMLElementScroll from './getHTMLElementScroll';\nimport type { Window } from '../types';\n\nexport default function getNodeScroll(node: Node | Window) {\n if (node === getWindow(node) || !isHTMLElement(node)) {\n return getWindowScroll(node);\n } else {\n return getHTMLElementScroll(node);\n }\n}\n","// @flow\n\nexport default function getHTMLElementScroll(element: HTMLElement) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop,\n };\n}\n","// @flow\nimport type { Rect } from '../types';\nimport getBoundingClientRect from './getBoundingClientRect';\n\n// Returns the layout rect of an element relative to its offsetParent. Layout\n// means it doesn't take into account transforms.\nexport default function getLayoutRect(element: HTMLElement): Rect {\n const clientRect = getBoundingClientRect(element);\n\n // Use the clientRect sizes if it's not been transformed.\n // Fixes https://github.com/popperjs/popper-core/issues/1223\n let width = element.offsetWidth;\n let height = element.offsetHeight;\n\n if (Math.abs(clientRect.width - width) <= 1) {\n width = clientRect.width;\n }\n\n if (Math.abs(clientRect.height - height) <= 1) {\n height = clientRect.height;\n }\n\n return {\n x: element.offsetLeft,\n y: element.offsetTop,\n width,\n height,\n };\n}\n","// @flow\nimport getNodeName from './getNodeName';\nimport getDocumentElement from './getDocumentElement';\nimport { isShadowRoot } from './instanceOf';\n\nexport default function getParentNode(element: Node | ShadowRoot): Node {\n if (getNodeName(element) === 'html') {\n return element;\n }\n\n return (\n // this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // $FlowFixMe[incompatible-return]\n // $FlowFixMe[prop-missing]\n element.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n element.parentNode || // DOM Element detected\n (isShadowRoot(element) ? element.host : null) || // ShadowRoot detected\n // $FlowFixMe[incompatible-call]: HTMLElement is a Node\n getDocumentElement(element) // fallback\n );\n}\n","// @flow\nimport getParentNode from './getParentNode';\nimport isScrollParent from './isScrollParent';\nimport getNodeName from './getNodeName';\nimport { isHTMLElement } from './instanceOf';\n\nexport default function getScrollParent(node: Node): HTMLElement {\n if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {\n // $FlowFixMe[incompatible-return]: assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(node) && isScrollParent(node)) {\n return node;\n }\n\n return getScrollParent(getParentNode(node));\n}\n","// @flow\nimport getScrollParent from './getScrollParent';\nimport getParentNode from './getParentNode';\nimport getWindow from './getWindow';\nimport type { Window, VisualViewport } from '../types';\nimport isScrollParent from './isScrollParent';\n\n/*\ngiven a DOM element, return the list of all scroll parents, up the list of ancesors\nuntil we get to the top window object. This list is what we attach scroll listeners\nto, because if any of these parent elements scroll, we'll need to re-calculate the\nreference element's position.\n*/\nexport default function listScrollParents(\n element: Node,\n list: Array = []\n): Array {\n const scrollParent = getScrollParent(element);\n const isBody = scrollParent === element.ownerDocument?.body;\n const win = getWindow(scrollParent);\n const target = isBody\n ? [win].concat(\n win.visualViewport || [],\n isScrollParent(scrollParent) ? scrollParent : []\n )\n : scrollParent;\n const updatedList = list.concat(target);\n\n return isBody\n ? updatedList\n : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here\n updatedList.concat(listScrollParents(getParentNode(target)));\n}\n","// @flow\nimport getNodeName from './getNodeName';\n\nexport default function isTableElement(element: Element): boolean {\n return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;\n}\n","// @flow\nimport getWindow from './getWindow';\nimport getNodeName from './getNodeName';\nimport getComputedStyle from './getComputedStyle';\nimport { isHTMLElement, isShadowRoot } from './instanceOf';\nimport isTableElement from './isTableElement';\nimport getParentNode from './getParentNode';\nimport getUAString from '../utils/userAgent';\n\nfunction getTrueOffsetParent(element: Element): ?Element {\n if (\n !isHTMLElement(element) ||\n // https://github.com/popperjs/popper-core/issues/837\n getComputedStyle(element).position === 'fixed'\n ) {\n return null;\n }\n\n return element.offsetParent;\n}\n\n// `.offsetParent` reports `null` for fixed elements, while absolute elements\n// return the containing block\nfunction getContainingBlock(element: Element) {\n const isFirefox = /firefox/i.test(getUAString());\n const isIE = /Trident/i.test(getUAString());\n\n if (isIE && isHTMLElement(element)) {\n // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport\n const elementCss = getComputedStyle(element);\n if (elementCss.position === 'fixed') {\n return null;\n }\n }\n\n let currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (\n isHTMLElement(currentNode) &&\n ['html', 'body'].indexOf(getNodeName(currentNode)) < 0\n ) {\n const css = getComputedStyle(currentNode);\n\n // This is non-exhaustive but covers the most common CSS properties that\n // create a containing block.\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n if (\n css.transform !== 'none' ||\n css.perspective !== 'none' ||\n css.contain === 'paint' ||\n ['transform', 'perspective'].indexOf(css.willChange) !== -1 ||\n (isFirefox && css.willChange === 'filter') ||\n (isFirefox && css.filter && css.filter !== 'none')\n ) {\n return currentNode;\n } else {\n currentNode = currentNode.parentNode;\n }\n }\n\n return null;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nexport default function getOffsetParent(element: Element) {\n const window = getWindow(element);\n\n let offsetParent = getTrueOffsetParent(element);\n\n while (\n offsetParent &&\n isTableElement(offsetParent) &&\n getComputedStyle(offsetParent).position === 'static'\n ) {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (\n offsetParent &&\n (getNodeName(offsetParent) === 'html' ||\n (getNodeName(offsetParent) === 'body' &&\n getComputedStyle(offsetParent).position === 'static'))\n ) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}\n","// @flow\nexport const top: 'top' = 'top';\nexport const bottom: 'bottom' = 'bottom';\nexport const right: 'right' = 'right';\nexport const left: 'left' = 'left';\nexport const auto: 'auto' = 'auto';\nexport type BasePlacement =\n | typeof top\n | typeof bottom\n | typeof right\n | typeof left;\nexport const basePlacements: Array = [top, bottom, right, left];\n\nexport const start: 'start' = 'start';\nexport const end: 'end' = 'end';\nexport type Variation = typeof start | typeof end;\n\nexport const clippingParents: 'clippingParents' = 'clippingParents';\nexport const viewport: 'viewport' = 'viewport';\nexport type Boundary = Element | Array | typeof clippingParents;\nexport type RootBoundary = typeof viewport | 'document';\n\nexport const popper: 'popper' = 'popper';\nexport const reference: 'reference' = 'reference';\nexport type Context = typeof popper | typeof reference;\n\nexport type VariationPlacement =\n | 'top-start'\n | 'top-end'\n | 'bottom-start'\n | 'bottom-end'\n | 'right-start'\n | 'right-end'\n | 'left-start'\n | 'left-end';\nexport type AutoPlacement = 'auto' | 'auto-start' | 'auto-end';\nexport type ComputedPlacement = VariationPlacement | BasePlacement;\nexport type Placement = AutoPlacement | BasePlacement | VariationPlacement;\n\nexport const variationPlacements: Array = basePlacements.reduce(\n (acc: Array, placement: BasePlacement) =>\n acc.concat([(`${placement}-${start}`: any), (`${placement}-${end}`: any)]),\n []\n);\nexport const placements: Array = [...basePlacements, auto].reduce(\n (\n acc: Array,\n placement: BasePlacement | typeof auto\n ): Array =>\n acc.concat([\n placement,\n (`${placement}-${start}`: any),\n (`${placement}-${end}`: any),\n ]),\n []\n);\n\n// modifiers that need to read the DOM\nexport const beforeRead: 'beforeRead' = 'beforeRead';\nexport const read: 'read' = 'read';\nexport const afterRead: 'afterRead' = 'afterRead';\n// pure-logic modifiers\nexport const beforeMain: 'beforeMain' = 'beforeMain';\nexport const main: 'main' = 'main';\nexport const afterMain: 'afterMain' = 'afterMain';\n// modifier with the purpose to write to the DOM (or write into a framework state)\nexport const beforeWrite: 'beforeWrite' = 'beforeWrite';\nexport const write: 'write' = 'write';\nexport const afterWrite: 'afterWrite' = 'afterWrite';\nexport const modifierPhases: Array = [\n beforeRead,\n read,\n afterRead,\n beforeMain,\n main,\n afterMain,\n beforeWrite,\n write,\n afterWrite,\n];\n\nexport type ModifierPhases =\n | typeof beforeRead\n | typeof read\n | typeof afterRead\n | typeof beforeMain\n | typeof main\n | typeof afterMain\n | typeof beforeWrite\n | typeof write\n | typeof afterWrite;\n","// @flow\nimport type { Modifier } from '../types';\nimport { modifierPhases } from '../enums';\n\n// source: https://stackoverflow.com/questions/49875255\nfunction order(modifiers) {\n const map = new Map();\n const visited = new Set();\n const result = [];\n\n modifiers.forEach(modifier => {\n map.set(modifier.name, modifier);\n });\n\n // On visiting object, check for its dependencies and visit them recursively\n function sort(modifier: Modifier) {\n visited.add(modifier.name);\n\n const requires = [\n ...(modifier.requires || []),\n ...(modifier.requiresIfExists || []),\n ];\n\n requires.forEach(dep => {\n if (!visited.has(dep)) {\n const depModifier = map.get(dep);\n\n if (depModifier) {\n sort(depModifier);\n }\n }\n });\n\n result.push(modifier);\n }\n\n modifiers.forEach(modifier => {\n if (!visited.has(modifier.name)) {\n // check for visited object\n sort(modifier);\n }\n });\n\n return result;\n}\n\nexport default function orderModifiers(\n modifiers: Array>\n): Array> {\n // order based on dependencies\n const orderedModifiers = order(modifiers);\n\n // order based on phase\n return modifierPhases.reduce((acc, phase) => {\n return acc.concat(\n orderedModifiers.filter(modifier => modifier.phase === phase)\n );\n }, []);\n}\n","// @flow\nimport { isShadowRoot } from './instanceOf';\n\nexport default function contains(parent: Element, child: Element) {\n const rootNode = child.getRootNode && child.getRootNode();\n\n // First, attempt with faster native method\n if (parent.contains(child)) {\n return true;\n }\n // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n let next = child;\n do {\n if (next && parent.isSameNode(next)) {\n return true;\n }\n // $FlowFixMe[prop-missing]: need a better way to handle this...\n next = next.parentNode || next.host;\n } while (next);\n }\n\n // Give up, the result is false\n return false;\n}\n","// @flow\nimport type { Rect, ClientRectObject } from '../types';\n\nexport default function rectToClientRect(rect: Rect): ClientRectObject {\n return {\n ...rect,\n left: rect.x,\n top: rect.y,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height,\n };\n}\n","// @flow\nimport type { ClientRectObject, PositioningStrategy } from '../types';\nimport type { Boundary, RootBoundary } from '../enums';\nimport { viewport } from '../enums';\nimport getViewportRect from './getViewportRect';\nimport getDocumentRect from './getDocumentRect';\nimport listScrollParents from './listScrollParents';\nimport getOffsetParent from './getOffsetParent';\nimport getDocumentElement from './getDocumentElement';\nimport getComputedStyle from './getComputedStyle';\nimport { isElement, isHTMLElement } from './instanceOf';\nimport getBoundingClientRect from './getBoundingClientRect';\nimport getParentNode from './getParentNode';\nimport contains from './contains';\nimport getNodeName from './getNodeName';\nimport rectToClientRect from '../utils/rectToClientRect';\nimport { max, min } from '../utils/math';\n\nfunction getInnerBoundingClientRect(\n element: Element,\n strategy: PositioningStrategy\n) {\n const rect = getBoundingClientRect(element, false, strategy === 'fixed');\n\n rect.top = rect.top + element.clientTop;\n rect.left = rect.left + element.clientLeft;\n rect.bottom = rect.top + element.clientHeight;\n rect.right = rect.left + element.clientWidth;\n rect.width = element.clientWidth;\n rect.height = element.clientHeight;\n rect.x = rect.left;\n rect.y = rect.top;\n\n return rect;\n}\n\nfunction getClientRectFromMixedType(\n element: Element,\n clippingParent: Element | RootBoundary,\n strategy: PositioningStrategy\n): ClientRectObject {\n return clippingParent === viewport\n ? rectToClientRect(getViewportRect(element, strategy))\n : isElement(clippingParent)\n ? getInnerBoundingClientRect(clippingParent, strategy)\n : rectToClientRect(getDocumentRect(getDocumentElement(element)));\n}\n\n// A \"clipping parent\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\nfunction getClippingParents(element: Element): Array {\n const clippingParents = listScrollParents(getParentNode(element));\n const canEscapeClipping =\n ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;\n const clipperElement =\n canEscapeClipping && isHTMLElement(element)\n ? getOffsetParent(element)\n : element;\n\n if (!isElement(clipperElement)) {\n return [];\n }\n\n // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414\n return clippingParents.filter(\n (clippingParent) =>\n isElement(clippingParent) &&\n contains(clippingParent, clipperElement) &&\n getNodeName(clippingParent) !== 'body'\n );\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping parents\nexport default function getClippingRect(\n element: Element,\n boundary: Boundary,\n rootBoundary: RootBoundary,\n strategy: PositioningStrategy\n): ClientRectObject {\n const mainClippingParents =\n boundary === 'clippingParents'\n ? getClippingParents(element)\n : [].concat(boundary);\n const clippingParents = [...mainClippingParents, rootBoundary];\n const firstClippingParent = clippingParents[0];\n\n const clippingRect = clippingParents.reduce((accRect, clippingParent) => {\n const rect = getClientRectFromMixedType(element, clippingParent, strategy);\n\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n\n return accRect;\n }, getClientRectFromMixedType(element, firstClippingParent, strategy));\n\n clippingRect.width = clippingRect.right - clippingRect.left;\n clippingRect.height = clippingRect.bottom - clippingRect.top;\n clippingRect.x = clippingRect.left;\n clippingRect.y = clippingRect.top;\n\n return clippingRect;\n}\n","// @flow\nimport getWindow from './getWindow';\nimport getDocumentElement from './getDocumentElement';\nimport getWindowScrollBarX from './getWindowScrollBarX';\nimport isLayoutViewport from './isLayoutViewport';\nimport type { PositioningStrategy } from '../types';\n\nexport default function getViewportRect(\n element: Element,\n strategy: PositioningStrategy\n) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n\n const layoutViewport = isLayoutViewport();\n\n if (layoutViewport || (!layoutViewport && strategy === 'fixed')) {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n\n return {\n width,\n height,\n x: x + getWindowScrollBarX(element),\n y,\n };\n}\n","// @flow\nimport type { Rect } from '../types';\nimport getDocumentElement from './getDocumentElement';\nimport getComputedStyle from './getComputedStyle';\nimport getWindowScrollBarX from './getWindowScrollBarX';\nimport getWindowScroll from './getWindowScroll';\nimport { max } from '../utils/math';\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable\nexport default function getDocumentRect(element: HTMLElement): Rect {\n const html = getDocumentElement(element);\n const winScroll = getWindowScroll(element);\n const body = element.ownerDocument?.body;\n\n const width = max(\n html.scrollWidth,\n html.clientWidth,\n body ? body.scrollWidth : 0,\n body ? body.clientWidth : 0\n );\n const height = max(\n html.scrollHeight,\n html.clientHeight,\n body ? body.scrollHeight : 0,\n body ? body.clientHeight : 0\n );\n\n let x = -winScroll.scrollLeft + getWindowScrollBarX(element);\n const y = -winScroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return { width, height, x, y };\n}\n","// @flow\nimport { type BasePlacement, type Placement, auto } from '../enums';\n\nexport default function getBasePlacement(\n placement: Placement | typeof auto\n): BasePlacement {\n return (placement.split('-')[0]: any);\n}\n","// @flow\nimport { type Variation, type Placement } from '../enums';\n\nexport default function getVariation(placement: Placement): ?Variation {\n return (placement.split('-')[1]: any);\n}\n","// @flow\nimport type { Placement } from '../enums';\n\nexport default function getMainAxisFromPlacement(\n placement: Placement\n): 'x' | 'y' {\n return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';\n}\n","// @flow\nimport getBasePlacement from './getBasePlacement';\nimport getVariation from './getVariation';\nimport getMainAxisFromPlacement from './getMainAxisFromPlacement';\nimport type {\n Rect,\n PositioningStrategy,\n Offsets,\n ClientRectObject,\n} from '../types';\nimport { top, right, bottom, left, start, end, type Placement } from '../enums';\n\nexport default function computeOffsets({\n reference,\n element,\n placement,\n}: {\n reference: Rect | ClientRectObject,\n element: Rect | ClientRectObject,\n strategy: PositioningStrategy,\n placement?: Placement,\n}): Offsets {\n const basePlacement = placement ? getBasePlacement(placement) : null;\n const variation = placement ? getVariation(placement) : null;\n const commonX = reference.x + reference.width / 2 - element.width / 2;\n const commonY = reference.y + reference.height / 2 - element.height / 2;\n\n let offsets;\n switch (basePlacement) {\n case top:\n offsets = {\n x: commonX,\n y: reference.y - element.height,\n };\n break;\n case bottom:\n offsets = {\n x: commonX,\n y: reference.y + reference.height,\n };\n break;\n case right:\n offsets = {\n x: reference.x + reference.width,\n y: commonY,\n };\n break;\n case left:\n offsets = {\n x: reference.x - element.width,\n y: commonY,\n };\n break;\n default:\n offsets = {\n x: reference.x,\n y: reference.y,\n };\n }\n\n const mainAxis = basePlacement\n ? getMainAxisFromPlacement(basePlacement)\n : null;\n\n if (mainAxis != null) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n\n switch (variation) {\n case start:\n offsets[mainAxis] =\n offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);\n break;\n case end:\n offsets[mainAxis] =\n offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);\n break;\n default:\n }\n }\n\n return offsets;\n}\n","// @flow\nimport type { SideObject } from '../types';\nimport getFreshSideObject from './getFreshSideObject';\n\nexport default function mergePaddingObject(\n paddingObject: $Shape\n): SideObject {\n return {\n ...getFreshSideObject(),\n ...paddingObject,\n };\n}\n","// @flow\nimport type { SideObject } from '../types';\n\nexport default function getFreshSideObject(): SideObject {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n };\n}\n","// @flow\n\nexport default function expandToHashMap<\n T: number | string | boolean,\n K: string\n>(value: T, keys: Array): { [key: string]: T } {\n return keys.reduce((hashMap, key) => {\n hashMap[key] = value;\n return hashMap;\n }, {});\n}\n","// @flow\nimport type { State, SideObject, Padding, PositioningStrategy } from '../types';\nimport type { Placement, Boundary, RootBoundary, Context } from '../enums';\nimport getClippingRect from '../dom-utils/getClippingRect';\nimport getDocumentElement from '../dom-utils/getDocumentElement';\nimport getBoundingClientRect from '../dom-utils/getBoundingClientRect';\nimport computeOffsets from './computeOffsets';\nimport rectToClientRect from './rectToClientRect';\nimport {\n clippingParents,\n reference,\n popper,\n bottom,\n top,\n right,\n basePlacements,\n viewport,\n} from '../enums';\nimport { isElement } from '../dom-utils/instanceOf';\nimport mergePaddingObject from './mergePaddingObject';\nimport expandToHashMap from './expandToHashMap';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n placement: Placement,\n strategy: PositioningStrategy,\n boundary: Boundary,\n rootBoundary: RootBoundary,\n elementContext: Context,\n altBoundary: boolean,\n padding: Padding,\n};\n\nexport default function detectOverflow(\n state: State,\n options: $Shape = {}\n): SideObject {\n const {\n placement = state.placement,\n strategy = state.strategy,\n boundary = clippingParents,\n rootBoundary = viewport,\n elementContext = popper,\n altBoundary = false,\n padding = 0,\n } = options;\n\n const paddingObject = mergePaddingObject(\n typeof padding !== 'number'\n ? padding\n : expandToHashMap(padding, basePlacements)\n );\n\n const altContext = elementContext === popper ? reference : popper;\n\n const popperRect = state.rects.popper;\n const element = state.elements[altBoundary ? altContext : elementContext];\n\n const clippingClientRect = getClippingRect(\n isElement(element)\n ? element\n : element.contextElement || getDocumentElement(state.elements.popper),\n boundary,\n rootBoundary,\n strategy\n );\n\n const referenceClientRect = getBoundingClientRect(state.elements.reference);\n\n const popperOffsets = computeOffsets({\n reference: referenceClientRect,\n element: popperRect,\n strategy: 'absolute',\n placement,\n });\n\n const popperClientRect = rectToClientRect({\n ...popperRect,\n ...popperOffsets,\n });\n\n const elementClientRect =\n elementContext === popper ? popperClientRect : referenceClientRect;\n\n // positive = overflowing the clipping rect\n // 0 or negative = within the clipping rect\n const overflowOffsets = {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom:\n elementClientRect.bottom -\n clippingClientRect.bottom +\n paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right:\n elementClientRect.right - clippingClientRect.right + paddingObject.right,\n };\n\n const offsetData = state.modifiersData.offset;\n\n // Offsets can be applied only to the popper element\n if (elementContext === popper && offsetData) {\n const offset = offsetData[placement];\n\n Object.keys(overflowOffsets).forEach((key) => {\n const multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;\n const axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';\n overflowOffsets[key] += offset[axis] * multiply;\n });\n }\n\n return overflowOffsets;\n}\n","// @flow\nimport type {\n State,\n OptionsGeneric,\n Modifier,\n Instance,\n VirtualElement,\n} from './types';\nimport getCompositeRect from './dom-utils/getCompositeRect';\nimport getLayoutRect from './dom-utils/getLayoutRect';\nimport listScrollParents from './dom-utils/listScrollParents';\nimport getOffsetParent from './dom-utils/getOffsetParent';\nimport orderModifiers from './utils/orderModifiers';\nimport debounce from './utils/debounce';\nimport mergeByName from './utils/mergeByName';\nimport detectOverflow from './utils/detectOverflow';\nimport { isElement } from './dom-utils/instanceOf';\n\nconst DEFAULT_OPTIONS: OptionsGeneric = {\n placement: 'bottom',\n modifiers: [],\n strategy: 'absolute',\n};\n\ntype PopperGeneratorArgs = {\n defaultModifiers?: Array>,\n defaultOptions?: $Shape>,\n};\n\nfunction areValidElements(...args: Array): boolean {\n return !args.some(\n (element) =>\n !(element && typeof element.getBoundingClientRect === 'function')\n );\n}\n\nexport function popperGenerator(generatorOptions: PopperGeneratorArgs = {}) {\n const { defaultModifiers = [], defaultOptions = DEFAULT_OPTIONS } =\n generatorOptions;\n\n return function createPopper>>(\n reference: Element | VirtualElement,\n popper: HTMLElement,\n options: $Shape> = defaultOptions\n ): Instance {\n let state: $Shape = {\n placement: 'bottom',\n orderedModifiers: [],\n options: { ...DEFAULT_OPTIONS, ...defaultOptions },\n modifiersData: {},\n elements: {\n reference,\n popper,\n },\n attributes: {},\n styles: {},\n };\n\n let effectCleanupFns: Array<() => void> = [];\n let isDestroyed = false;\n\n const instance = {\n state,\n setOptions(setOptionsAction) {\n const options =\n typeof setOptionsAction === 'function'\n ? setOptionsAction(state.options)\n : setOptionsAction;\n\n cleanupModifierEffects();\n\n state.options = {\n // $FlowFixMe[exponential-spread]\n ...defaultOptions,\n ...state.options,\n ...options,\n };\n\n state.scrollParents = {\n reference: isElement(reference)\n ? listScrollParents(reference)\n : reference.contextElement\n ? listScrollParents(reference.contextElement)\n : [],\n popper: listScrollParents(popper),\n };\n\n // Orders the modifiers based on their dependencies and `phase`\n // properties\n const orderedModifiers = orderModifiers(\n mergeByName([...defaultModifiers, ...state.options.modifiers])\n );\n\n // Strip out disabled modifiers\n state.orderedModifiers = orderedModifiers.filter((m) => m.enabled);\n\n runModifierEffects();\n\n return instance.update();\n },\n\n // Sync update – it will always be executed, even if not necessary. This\n // is useful for low frequency updates where sync behavior simplifies the\n // logic.\n // For high frequency updates (e.g. `resize` and `scroll` events), always\n // prefer the async Popper#update method\n forceUpdate() {\n if (isDestroyed) {\n return;\n }\n\n const { reference, popper } = state.elements;\n\n // Don't proceed if `reference` or `popper` are not valid elements\n // anymore\n if (!areValidElements(reference, popper)) {\n return;\n }\n\n // Store the reference and popper rects to be read by modifiers\n state.rects = {\n reference: getCompositeRect(\n reference,\n getOffsetParent(popper),\n state.options.strategy === 'fixed'\n ),\n popper: getLayoutRect(popper),\n };\n\n // Modifiers have the ability to reset the current update cycle. The\n // most common use case for this is the `flip` modifier changing the\n // placement, which then needs to re-run all the modifiers, because the\n // logic was previously ran for the previous placement and is therefore\n // stale/incorrect\n state.reset = false;\n\n state.placement = state.options.placement;\n\n // On each update cycle, the `modifiersData` property for each modifier\n // is filled with the initial data specified by the modifier. This means\n // it doesn't persist and is fresh on each update.\n // To ensure persistent data, use `${name}#persistent`\n state.orderedModifiers.forEach(\n (modifier) =>\n (state.modifiersData[modifier.name] = {\n ...modifier.data,\n })\n );\n\n for (let index = 0; index < state.orderedModifiers.length; index++) {\n if (state.reset === true) {\n state.reset = false;\n index = -1;\n continue;\n }\n\n const { fn, options = {}, name } = state.orderedModifiers[index];\n\n if (typeof fn === 'function') {\n state = fn({ state, options, name, instance }) || state;\n }\n }\n },\n\n // Async and optimistically optimized update – it will not be executed if\n // not necessary (debounced to run at most once-per-tick)\n update: debounce<$Shape>(\n () =>\n new Promise<$Shape>((resolve) => {\n instance.forceUpdate();\n resolve(state);\n })\n ),\n\n destroy() {\n cleanupModifierEffects();\n isDestroyed = true;\n },\n };\n\n if (!areValidElements(reference, popper)) {\n return instance;\n }\n\n instance.setOptions(options).then((state) => {\n if (!isDestroyed && options.onFirstUpdate) {\n options.onFirstUpdate(state);\n }\n });\n\n // Modifiers have the ability to execute arbitrary code before the first\n // update cycle runs. They will be executed in the same order as the update\n // cycle. This is useful when a modifier adds some persistent data that\n // other modifiers need to use, but the modifier is run after the dependent\n // one.\n function runModifierEffects() {\n state.orderedModifiers.forEach(({ name, options = {}, effect }) => {\n if (typeof effect === 'function') {\n const cleanupFn = effect({ state, name, instance, options });\n const noopFn = () => {};\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }\n\n function cleanupModifierEffects() {\n effectCleanupFns.forEach((fn) => fn());\n effectCleanupFns = [];\n }\n\n return instance;\n };\n}\n\nexport const createPopper = popperGenerator();\n\n// eslint-disable-next-line import/no-unused-modules\nexport { detectOverflow };\n","// @flow\n\nexport default function debounce(fn: Function): () => Promise {\n let pending;\n return () => {\n if (!pending) {\n pending = new Promise(resolve => {\n Promise.resolve().then(() => {\n pending = undefined;\n resolve(fn());\n });\n });\n }\n\n return pending;\n };\n}\n","// @flow\nimport type { Modifier } from '../types';\n\nexport default function mergeByName(\n modifiers: Array<$Shape>>\n): Array<$Shape>> {\n const merged = modifiers.reduce((merged, current) => {\n const existing = merged[current.name];\n merged[current.name] = existing\n ? {\n ...existing,\n ...current,\n options: { ...existing.options, ...current.options },\n data: { ...existing.data, ...current.data },\n }\n : current;\n return merged;\n }, {});\n\n // IE11 does not support Object.values\n return Object.keys(merged).map(key => merged[key]);\n}\n","// @flow\nimport type { ModifierArguments, Modifier } from '../types';\nimport getWindow from '../dom-utils/getWindow';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n scroll: boolean,\n resize: boolean,\n};\n\nconst passive = { passive: true };\n\nfunction effect({ state, instance, options }: ModifierArguments) {\n const { scroll = true, resize = true } = options;\n\n const window = getWindow(state.elements.popper);\n const scrollParents = [\n ...state.scrollParents.reference,\n ...state.scrollParents.popper,\n ];\n\n if (scroll) {\n scrollParents.forEach(scrollParent => {\n scrollParent.addEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.addEventListener('resize', instance.update, passive);\n }\n\n return () => {\n if (scroll) {\n scrollParents.forEach(scrollParent => {\n scrollParent.removeEventListener('scroll', instance.update, passive);\n });\n }\n\n if (resize) {\n window.removeEventListener('resize', instance.update, passive);\n }\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type EventListenersModifier = Modifier<'eventListeners', Options>;\nexport default ({\n name: 'eventListeners',\n enabled: true,\n phase: 'write',\n fn: () => {},\n effect,\n data: {},\n}: EventListenersModifier);\n","// @flow\nimport type { ModifierArguments, Modifier } from '../types';\nimport computeOffsets from '../utils/computeOffsets';\n\nfunction popperOffsets({ state, name }: ModifierArguments<{||}>) {\n // Offsets are the actual position the popper needs to have to be\n // properly positioned near its reference element\n // This is the most basic placement, and will be adjusted by\n // the modifiers in the next step\n state.modifiersData[name] = computeOffsets({\n reference: state.rects.reference,\n element: state.rects.popper,\n strategy: 'absolute',\n placement: state.placement,\n });\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type PopperOffsetsModifier = Modifier<'popperOffsets', {||}>;\nexport default ({\n name: 'popperOffsets',\n enabled: true,\n phase: 'read',\n fn: popperOffsets,\n data: {},\n}: PopperOffsetsModifier);\n","// @flow\nimport type {\n PositioningStrategy,\n Offsets,\n Modifier,\n ModifierArguments,\n Rect,\n Window,\n} from '../types';\nimport {\n type BasePlacement,\n type Variation,\n top,\n left,\n right,\n bottom,\n end,\n} from '../enums';\nimport getOffsetParent from '../dom-utils/getOffsetParent';\nimport getWindow from '../dom-utils/getWindow';\nimport getDocumentElement from '../dom-utils/getDocumentElement';\nimport getComputedStyle from '../dom-utils/getComputedStyle';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport getVariation from '../utils/getVariation';\nimport { round } from '../utils/math';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type RoundOffsets = (\n offsets: $Shape<{ x: number, y: number, centerOffset: number }>\n) => Offsets;\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n gpuAcceleration: boolean,\n adaptive: boolean,\n roundOffsets?: boolean | RoundOffsets,\n};\n\nconst unsetSides = {\n top: 'auto',\n right: 'auto',\n bottom: 'auto',\n left: 'auto',\n};\n\n// Round the offsets to the nearest suitable subpixel based on the DPR.\n// Zooming can change the DPR, but it seems to report a value that will\n// cleanly divide the values into the appropriate subpixels.\nfunction roundOffsetsByDPR({ x, y }, win: Window): Offsets {\n const dpr = win.devicePixelRatio || 1;\n\n return {\n x: round(x * dpr) / dpr || 0,\n y: round(y * dpr) / dpr || 0,\n };\n}\n\nexport function mapToStyles({\n popper,\n popperRect,\n placement,\n variation,\n offsets,\n position,\n gpuAcceleration,\n adaptive,\n roundOffsets,\n isFixed,\n}: {\n popper: HTMLElement,\n popperRect: Rect,\n placement: BasePlacement,\n variation: ?Variation,\n offsets: $Shape<{ x: number, y: number, centerOffset: number }>,\n position: PositioningStrategy,\n gpuAcceleration: boolean,\n adaptive: boolean,\n roundOffsets: boolean | RoundOffsets,\n isFixed: boolean,\n}) {\n let { x = 0, y = 0 } = offsets;\n\n ({ x, y } =\n typeof roundOffsets === 'function' ? roundOffsets({ x, y }) : { x, y });\n\n const hasX = offsets.hasOwnProperty('x');\n const hasY = offsets.hasOwnProperty('y');\n\n let sideX: string = left;\n let sideY: string = top;\n\n const win: Window = window;\n\n if (adaptive) {\n let offsetParent = getOffsetParent(popper);\n let heightProp = 'clientHeight';\n let widthProp = 'clientWidth';\n\n if (offsetParent === getWindow(popper)) {\n offsetParent = getDocumentElement(popper);\n\n if (\n getComputedStyle(offsetParent).position !== 'static' &&\n position === 'absolute'\n ) {\n heightProp = 'scrollHeight';\n widthProp = 'scrollWidth';\n }\n }\n\n // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it\n offsetParent = (offsetParent: Element);\n\n if (\n placement === top ||\n ((placement === left || placement === right) && variation === end)\n ) {\n sideY = bottom;\n const offsetY =\n isFixed && offsetParent === win && win.visualViewport\n ? win.visualViewport.height\n : // $FlowFixMe[prop-missing]\n offsetParent[heightProp];\n y -= offsetY - popperRect.height;\n y *= gpuAcceleration ? 1 : -1;\n }\n\n if (\n placement === left ||\n ((placement === top || placement === bottom) && variation === end)\n ) {\n sideX = right;\n const offsetX =\n isFixed && offsetParent === win && win.visualViewport\n ? win.visualViewport.width\n : // $FlowFixMe[prop-missing]\n offsetParent[widthProp];\n x -= offsetX - popperRect.width;\n x *= gpuAcceleration ? 1 : -1;\n }\n }\n\n const commonStyles = {\n position,\n ...(adaptive && unsetSides),\n };\n\n ({ x, y } =\n roundOffsets === true\n ? roundOffsetsByDPR({ x, y }, getWindow(popper))\n : { x, y });\n\n if (gpuAcceleration) {\n return {\n ...commonStyles,\n [sideY]: hasY ? '0' : '',\n [sideX]: hasX ? '0' : '',\n // Layer acceleration can disable subpixel rendering which causes slightly\n // blurry text on low PPI displays, so we want to use 2D transforms\n // instead\n transform:\n (win.devicePixelRatio || 1) <= 1\n ? `translate(${x}px, ${y}px)`\n : `translate3d(${x}px, ${y}px, 0)`,\n };\n }\n\n return {\n ...commonStyles,\n [sideY]: hasY ? `${y}px` : '',\n [sideX]: hasX ? `${x}px` : '',\n transform: '',\n };\n}\n\nfunction computeStyles({ state, options }: ModifierArguments) {\n const {\n gpuAcceleration = true,\n adaptive = true,\n // defaults to use builtin `roundOffsetsByDPR`\n roundOffsets = true,\n } = options;\n\n const commonStyles = {\n placement: getBasePlacement(state.placement),\n variation: getVariation(state.placement),\n popper: state.elements.popper,\n popperRect: state.rects.popper,\n gpuAcceleration,\n isFixed: state.options.strategy === 'fixed',\n };\n\n if (state.modifiersData.popperOffsets != null) {\n state.styles.popper = {\n ...state.styles.popper,\n ...mapToStyles({\n ...commonStyles,\n offsets: state.modifiersData.popperOffsets,\n position: state.options.strategy,\n adaptive,\n roundOffsets,\n }),\n };\n }\n\n if (state.modifiersData.arrow != null) {\n state.styles.arrow = {\n ...state.styles.arrow,\n ...mapToStyles({\n ...commonStyles,\n offsets: state.modifiersData.arrow,\n position: 'absolute',\n adaptive: false,\n roundOffsets,\n }),\n };\n }\n\n state.attributes.popper = {\n ...state.attributes.popper,\n 'data-popper-placement': state.placement,\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type ComputeStylesModifier = Modifier<'computeStyles', Options>;\nexport default ({\n name: 'computeStyles',\n enabled: true,\n phase: 'beforeWrite',\n fn: computeStyles,\n data: {},\n}: ComputeStylesModifier);\n","// @flow\nimport type { Modifier, ModifierArguments } from '../types';\nimport getNodeName from '../dom-utils/getNodeName';\nimport { isHTMLElement } from '../dom-utils/instanceOf';\n\n// This modifier takes the styles prepared by the `computeStyles` modifier\n// and applies them to the HTMLElements such as popper and arrow\n\nfunction applyStyles({ state }: ModifierArguments<{||}>) {\n Object.keys(state.elements).forEach((name) => {\n const style = state.styles[name] || {};\n\n const attributes = state.attributes[name] || {};\n const element = state.elements[name];\n\n // arrow is optional + virtual elements\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n // Flow doesn't support to extend this property, but it's the most\n // effective way to apply styles to an HTMLElement\n // $FlowFixMe[cannot-write]\n Object.assign(element.style, style);\n\n Object.keys(attributes).forEach((name) => {\n const value = attributes[name];\n if (value === false) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value === true ? '' : value);\n }\n });\n });\n}\n\nfunction effect({ state }: ModifierArguments<{||}>) {\n const initialStyles = {\n popper: {\n position: state.options.strategy,\n left: '0',\n top: '0',\n margin: '0',\n },\n arrow: {\n position: 'absolute',\n },\n reference: {},\n };\n\n Object.assign(state.elements.popper.style, initialStyles.popper);\n state.styles = initialStyles;\n\n if (state.elements.arrow) {\n Object.assign(state.elements.arrow.style, initialStyles.arrow);\n }\n\n return () => {\n Object.keys(state.elements).forEach((name) => {\n const element = state.elements[name];\n const attributes = state.attributes[name] || {};\n\n const styleProperties = Object.keys(\n state.styles.hasOwnProperty(name)\n ? state.styles[name]\n : initialStyles[name]\n );\n\n // Set all values to an empty string to unset them\n const style = styleProperties.reduce((style, property) => {\n style[property] = '';\n return style;\n }, {});\n\n // arrow is optional + virtual elements\n if (!isHTMLElement(element) || !getNodeName(element)) {\n return;\n }\n\n Object.assign(element.style, style);\n\n Object.keys(attributes).forEach((attribute) => {\n element.removeAttribute(attribute);\n });\n });\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type ApplyStylesModifier = Modifier<'applyStyles', {||}>;\nexport default ({\n name: 'applyStyles',\n enabled: true,\n phase: 'write',\n fn: applyStyles,\n effect,\n requires: ['computeStyles'],\n}: ApplyStylesModifier);\n","// @flow\nimport type { Placement } from '../enums';\nimport type { ModifierArguments, Modifier, Rect, Offsets } from '../types';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport { top, left, right, placements } from '../enums';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type OffsetsFunction = ({\n popper: Rect,\n reference: Rect,\n placement: Placement,\n}) => [?number, ?number];\n\ntype Offset = OffsetsFunction | [?number, ?number];\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n offset: Offset,\n};\n\nexport function distanceAndSkiddingToXY(\n placement: Placement,\n rects: { popper: Rect, reference: Rect },\n offset: Offset\n): Offsets {\n const basePlacement = getBasePlacement(placement);\n const invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;\n\n let [skidding, distance] =\n typeof offset === 'function'\n ? offset({\n ...rects,\n placement,\n })\n : offset;\n\n skidding = skidding || 0;\n distance = (distance || 0) * invertDistance;\n\n return [left, right].indexOf(basePlacement) >= 0\n ? { x: distance, y: skidding }\n : { x: skidding, y: distance };\n}\n\nfunction offset({ state, options, name }: ModifierArguments) {\n const { offset = [0, 0] } = options;\n\n const data = placements.reduce((acc, placement) => {\n acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);\n return acc;\n }, {});\n\n const { x, y } = data[state.placement];\n\n if (state.modifiersData.popperOffsets != null) {\n state.modifiersData.popperOffsets.x += x;\n state.modifiersData.popperOffsets.y += y;\n }\n\n state.modifiersData[name] = data;\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type OffsetModifier = Modifier<'offset', Options>;\nexport default ({\n name: 'offset',\n enabled: true,\n phase: 'main',\n requires: ['popperOffsets'],\n fn: offset,\n}: OffsetModifier);\n","// @flow\nimport type { Placement } from '../enums';\n\nconst hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };\n\nexport default function getOppositePlacement(placement: Placement): Placement {\n return (placement.replace(\n /left|right|bottom|top/g,\n matched => hash[matched]\n ): any);\n}\n","// @flow\nimport type { Placement } from '../enums';\n\nconst hash = { start: 'end', end: 'start' };\n\nexport default function getOppositeVariationPlacement(\n placement: Placement\n): Placement {\n return (placement.replace(/start|end/g, matched => hash[matched]): any);\n}\n","// @flow\nimport type { State, Padding } from '../types';\nimport type {\n Placement,\n ComputedPlacement,\n Boundary,\n RootBoundary,\n} from '../enums';\nimport getVariation from './getVariation';\nimport {\n variationPlacements,\n basePlacements,\n placements as allPlacements,\n} from '../enums';\nimport detectOverflow from './detectOverflow';\nimport getBasePlacement from './getBasePlacement';\n\ntype Options = {\n placement: Placement,\n padding: Padding,\n boundary: Boundary,\n rootBoundary: RootBoundary,\n flipVariations: boolean,\n allowedAutoPlacements?: Array,\n};\n\ntype OverflowsMap = { [ComputedPlacement]: number };\n\nexport default function computeAutoPlacement(\n state: $Shape,\n options: Options = {}\n): Array {\n const {\n placement,\n boundary,\n rootBoundary,\n padding,\n flipVariations,\n allowedAutoPlacements = allPlacements,\n } = options;\n\n const variation = getVariation(placement);\n\n const placements = variation\n ? flipVariations\n ? variationPlacements\n : variationPlacements.filter(\n (placement) => getVariation(placement) === variation\n )\n : basePlacements;\n\n let allowedPlacements = placements.filter(\n (placement) => allowedAutoPlacements.indexOf(placement) >= 0\n );\n\n if (allowedPlacements.length === 0) {\n allowedPlacements = placements;\n }\n\n // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...\n const overflows: OverflowsMap = allowedPlacements.reduce((acc, placement) => {\n acc[placement] = detectOverflow(state, {\n placement,\n boundary,\n rootBoundary,\n padding,\n })[getBasePlacement(placement)];\n\n return acc;\n }, {});\n\n return Object.keys(overflows).sort((a, b) => overflows[a] - overflows[b]);\n}\n","// @flow\nimport type { Placement, Boundary, RootBoundary } from '../enums';\nimport type { ModifierArguments, Modifier, Padding } from '../types';\nimport getOppositePlacement from '../utils/getOppositePlacement';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport getOppositeVariationPlacement from '../utils/getOppositeVariationPlacement';\nimport detectOverflow from '../utils/detectOverflow';\nimport computeAutoPlacement from '../utils/computeAutoPlacement';\nimport { bottom, top, start, right, left, auto } from '../enums';\nimport getVariation from '../utils/getVariation';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n mainAxis: boolean,\n altAxis: boolean,\n fallbackPlacements: Array,\n padding: Padding,\n boundary: Boundary,\n rootBoundary: RootBoundary,\n altBoundary: boolean,\n flipVariations: boolean,\n allowedAutoPlacements: Array,\n};\n\nfunction getExpandedFallbackPlacements(placement: Placement): Array {\n if (getBasePlacement(placement) === auto) {\n return [];\n }\n\n const oppositePlacement = getOppositePlacement(placement);\n\n return [\n getOppositeVariationPlacement(placement),\n oppositePlacement,\n getOppositeVariationPlacement(oppositePlacement),\n ];\n}\n\nfunction flip({ state, options, name }: ModifierArguments) {\n if (state.modifiersData[name]._skip) {\n return;\n }\n\n const {\n mainAxis: checkMainAxis = true,\n altAxis: checkAltAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n padding,\n boundary,\n rootBoundary,\n altBoundary,\n flipVariations = true,\n allowedAutoPlacements,\n } = options;\n\n const preferredPlacement = state.options.placement;\n const basePlacement = getBasePlacement(preferredPlacement);\n const isBasePlacement = basePlacement === preferredPlacement;\n\n const fallbackPlacements =\n specifiedFallbackPlacements ||\n (isBasePlacement || !flipVariations\n ? [getOppositePlacement(preferredPlacement)]\n : getExpandedFallbackPlacements(preferredPlacement));\n\n const placements = [preferredPlacement, ...fallbackPlacements].reduce(\n (acc, placement) => {\n return acc.concat(\n getBasePlacement(placement) === auto\n ? computeAutoPlacement(state, {\n placement,\n boundary,\n rootBoundary,\n padding,\n flipVariations,\n allowedAutoPlacements,\n })\n : placement\n );\n },\n []\n );\n\n const referenceRect = state.rects.reference;\n const popperRect = state.rects.popper;\n\n const checksMap = new Map();\n let makeFallbackChecks = true;\n let firstFittingPlacement = placements[0];\n\n for (let i = 0; i < placements.length; i++) {\n const placement = placements[i];\n const basePlacement = getBasePlacement(placement);\n const isStartVariation = getVariation(placement) === start;\n const isVertical = [top, bottom].indexOf(basePlacement) >= 0;\n const len = isVertical ? 'width' : 'height';\n\n const overflow = detectOverflow(state, {\n placement,\n boundary,\n rootBoundary,\n altBoundary,\n padding,\n });\n\n let mainVariationSide: any = isVertical\n ? isStartVariation\n ? right\n : left\n : isStartVariation\n ? bottom\n : top;\n\n if (referenceRect[len] > popperRect[len]) {\n mainVariationSide = getOppositePlacement(mainVariationSide);\n }\n\n const altVariationSide: any = getOppositePlacement(mainVariationSide);\n\n const checks = [];\n\n if (checkMainAxis) {\n checks.push(overflow[basePlacement] <= 0);\n }\n\n if (checkAltAxis) {\n checks.push(\n overflow[mainVariationSide] <= 0,\n overflow[altVariationSide] <= 0\n );\n }\n\n if (checks.every((check) => check)) {\n firstFittingPlacement = placement;\n makeFallbackChecks = false;\n break;\n }\n\n checksMap.set(placement, checks);\n }\n\n if (makeFallbackChecks) {\n // `2` may be desired in some cases – research later\n const numberOfChecks = flipVariations ? 3 : 1;\n\n for (let i = numberOfChecks; i > 0; i--) {\n const fittingPlacement = placements.find((placement) => {\n const checks = checksMap.get(placement);\n if (checks) {\n return checks.slice(0, i).every((check) => check);\n }\n });\n\n if (fittingPlacement) {\n firstFittingPlacement = fittingPlacement;\n break;\n }\n }\n }\n\n if (state.placement !== firstFittingPlacement) {\n state.modifiersData[name]._skip = true;\n state.placement = firstFittingPlacement;\n state.reset = true;\n }\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type FlipModifier = Modifier<'flip', Options>;\nexport default ({\n name: 'flip',\n enabled: true,\n phase: 'main',\n fn: flip,\n requiresIfExists: ['offset'],\n data: { _skip: false },\n}: FlipModifier);\n","// @flow\nimport { max as mathMax, min as mathMin } from './math';\n\nexport function within(min: number, value: number, max: number): number {\n return mathMax(min, mathMin(value, max));\n}\n\nexport function withinMaxClamp(min: number, value: number, max: number) {\n const v = within(min, value, max);\n return v > max ? max : v;\n}\n","// @flow\nimport { top, left, right, bottom, start } from '../enums';\nimport type { Placement, Boundary, RootBoundary } from '../enums';\nimport type { Rect, ModifierArguments, Modifier, Padding } from '../types';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport getMainAxisFromPlacement from '../utils/getMainAxisFromPlacement';\nimport getAltAxis from '../utils/getAltAxis';\nimport { within, withinMaxClamp } from '../utils/within';\nimport getLayoutRect from '../dom-utils/getLayoutRect';\nimport getOffsetParent from '../dom-utils/getOffsetParent';\nimport detectOverflow from '../utils/detectOverflow';\nimport getVariation from '../utils/getVariation';\nimport getFreshSideObject from '../utils/getFreshSideObject';\nimport { min as mathMin, max as mathMax } from '../utils/math';\n\ntype TetherOffset =\n | (({\n popper: Rect,\n reference: Rect,\n placement: Placement,\n }) => number | { mainAxis: number, altAxis: number })\n | number\n | { mainAxis: number, altAxis: number };\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n /* Prevents boundaries overflow on the main axis */\n mainAxis: boolean,\n /* Prevents boundaries overflow on the alternate axis */\n altAxis: boolean,\n /* The area to check the popper is overflowing in */\n boundary: Boundary,\n /* If the popper is not overflowing the main area, fallback to this one */\n rootBoundary: RootBoundary,\n /* Use the reference's \"clippingParents\" boundary context */\n altBoundary: boolean,\n /**\n * Allows the popper to overflow from its boundaries to keep it near its\n * reference element\n */\n tether: boolean,\n /* Offsets when the `tether` option should activate */\n tetherOffset: TetherOffset,\n /* Sets a padding to the provided boundary */\n padding: Padding,\n};\n\nfunction preventOverflow({ state, options, name }: ModifierArguments) {\n const {\n mainAxis: checkMainAxis = true,\n altAxis: checkAltAxis = false,\n boundary,\n rootBoundary,\n altBoundary,\n padding,\n tether = true,\n tetherOffset = 0,\n } = options;\n\n const overflow = detectOverflow(state, {\n boundary,\n rootBoundary,\n padding,\n altBoundary,\n });\n const basePlacement = getBasePlacement(state.placement);\n const variation = getVariation(state.placement);\n const isBasePlacement = !variation;\n const mainAxis = getMainAxisFromPlacement(basePlacement);\n const altAxis = getAltAxis(mainAxis);\n const popperOffsets = state.modifiersData.popperOffsets;\n const referenceRect = state.rects.reference;\n const popperRect = state.rects.popper;\n const tetherOffsetValue =\n typeof tetherOffset === 'function'\n ? tetherOffset({\n ...state.rects,\n placement: state.placement,\n })\n : tetherOffset;\n const normalizedTetherOffsetValue =\n typeof tetherOffsetValue === 'number'\n ? { mainAxis: tetherOffsetValue, altAxis: tetherOffsetValue }\n : { mainAxis: 0, altAxis: 0, ...tetherOffsetValue };\n const offsetModifierState = state.modifiersData.offset\n ? state.modifiersData.offset[state.placement]\n : null;\n\n const data = { x: 0, y: 0 };\n\n if (!popperOffsets) {\n return;\n }\n\n if (checkMainAxis) {\n const mainSide = mainAxis === 'y' ? top : left;\n const altSide = mainAxis === 'y' ? bottom : right;\n const len = mainAxis === 'y' ? 'height' : 'width';\n const offset = popperOffsets[mainAxis];\n\n const min = offset + overflow[mainSide];\n const max = offset - overflow[altSide];\n\n const additive = tether ? -popperRect[len] / 2 : 0;\n\n const minLen = variation === start ? referenceRect[len] : popperRect[len];\n const maxLen = variation === start ? -popperRect[len] : -referenceRect[len];\n\n // We need to include the arrow in the calculation so the arrow doesn't go\n // outside the reference bounds\n const arrowElement = state.elements.arrow;\n const arrowRect =\n tether && arrowElement\n ? getLayoutRect(arrowElement)\n : { width: 0, height: 0 };\n const arrowPaddingObject = state.modifiersData['arrow#persistent']\n ? state.modifiersData['arrow#persistent'].padding\n : getFreshSideObject();\n const arrowPaddingMin = arrowPaddingObject[mainSide];\n const arrowPaddingMax = arrowPaddingObject[altSide];\n\n // If the reference length is smaller than the arrow length, we don't want\n // to include its full size in the calculation. If the reference is small\n // and near the edge of a boundary, the popper can overflow even if the\n // reference is not overflowing as well (e.g. virtual elements with no\n // width or height)\n const arrowLen = within(0, referenceRect[len], arrowRect[len]);\n\n const minOffset = isBasePlacement\n ? referenceRect[len] / 2 -\n additive -\n arrowLen -\n arrowPaddingMin -\n normalizedTetherOffsetValue.mainAxis\n : minLen -\n arrowLen -\n arrowPaddingMin -\n normalizedTetherOffsetValue.mainAxis;\n const maxOffset = isBasePlacement\n ? -referenceRect[len] / 2 +\n additive +\n arrowLen +\n arrowPaddingMax +\n normalizedTetherOffsetValue.mainAxis\n : maxLen +\n arrowLen +\n arrowPaddingMax +\n normalizedTetherOffsetValue.mainAxis;\n\n const arrowOffsetParent =\n state.elements.arrow && getOffsetParent(state.elements.arrow);\n const clientOffset = arrowOffsetParent\n ? mainAxis === 'y'\n ? arrowOffsetParent.clientTop || 0\n : arrowOffsetParent.clientLeft || 0\n : 0;\n\n const offsetModifierValue = offsetModifierState?.[mainAxis] ?? 0;\n const tetherMin = offset + minOffset - offsetModifierValue - clientOffset;\n const tetherMax = offset + maxOffset - offsetModifierValue;\n\n const preventedOffset = within(\n tether ? mathMin(min, tetherMin) : min,\n offset,\n tether ? mathMax(max, tetherMax) : max\n );\n\n popperOffsets[mainAxis] = preventedOffset;\n data[mainAxis] = preventedOffset - offset;\n }\n\n if (checkAltAxis) {\n const mainSide = mainAxis === 'x' ? top : left;\n const altSide = mainAxis === 'x' ? bottom : right;\n const offset = popperOffsets[altAxis];\n\n const len = altAxis === 'y' ? 'height' : 'width';\n\n const min = offset + overflow[mainSide];\n const max = offset - overflow[altSide];\n\n const isOriginSide = [top, left].indexOf(basePlacement) !== -1;\n\n const offsetModifierValue = offsetModifierState?.[altAxis] ?? 0;\n const tetherMin = isOriginSide\n ? min\n : offset -\n referenceRect[len] -\n popperRect[len] -\n offsetModifierValue +\n normalizedTetherOffsetValue.altAxis;\n const tetherMax = isOriginSide\n ? offset +\n referenceRect[len] +\n popperRect[len] -\n offsetModifierValue -\n normalizedTetherOffsetValue.altAxis\n : max;\n\n const preventedOffset =\n tether && isOriginSide\n ? withinMaxClamp(tetherMin, offset, tetherMax)\n : within(tether ? tetherMin : min, offset, tether ? tetherMax : max);\n\n popperOffsets[altAxis] = preventedOffset;\n data[altAxis] = preventedOffset - offset;\n }\n\n state.modifiersData[name] = data;\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type PreventOverflowModifier = Modifier<'preventOverflow', Options>;\nexport default ({\n name: 'preventOverflow',\n enabled: true,\n phase: 'main',\n fn: preventOverflow,\n requiresIfExists: ['offset'],\n}: PreventOverflowModifier);\n","// @flow\n\nexport default function getAltAxis(axis: 'x' | 'y'): 'x' | 'y' {\n return axis === 'x' ? 'y' : 'x';\n}\n","// @flow\nimport type { Modifier, ModifierArguments, Padding, Rect } from '../types';\nimport type { Placement } from '../enums';\nimport getBasePlacement from '../utils/getBasePlacement';\nimport getLayoutRect from '../dom-utils/getLayoutRect';\nimport contains from '../dom-utils/contains';\nimport getOffsetParent from '../dom-utils/getOffsetParent';\nimport getMainAxisFromPlacement from '../utils/getMainAxisFromPlacement';\nimport { within } from '../utils/within';\nimport mergePaddingObject from '../utils/mergePaddingObject';\nimport expandToHashMap from '../utils/expandToHashMap';\nimport { left, right, basePlacements, top, bottom } from '../enums';\n\n// eslint-disable-next-line import/no-unused-modules\nexport type Options = {\n element: HTMLElement | string | null,\n padding:\n | Padding\n | (({|\n popper: Rect,\n reference: Rect,\n placement: Placement,\n |}) => Padding),\n};\n\nconst toPaddingObject = (padding, state) => {\n padding =\n typeof padding === 'function'\n ? padding({ ...state.rects, placement: state.placement })\n : padding;\n\n return mergePaddingObject(\n typeof padding !== 'number'\n ? padding\n : expandToHashMap(padding, basePlacements)\n );\n};\n\nfunction arrow({ state, name, options }: ModifierArguments) {\n const arrowElement = state.elements.arrow;\n const popperOffsets = state.modifiersData.popperOffsets;\n const basePlacement = getBasePlacement(state.placement);\n const axis = getMainAxisFromPlacement(basePlacement);\n const isVertical = [left, right].indexOf(basePlacement) >= 0;\n const len = isVertical ? 'height' : 'width';\n\n if (!arrowElement || !popperOffsets) {\n return;\n }\n\n const paddingObject = toPaddingObject(options.padding, state);\n const arrowRect = getLayoutRect(arrowElement);\n const minProp = axis === 'y' ? top : left;\n const maxProp = axis === 'y' ? bottom : right;\n\n const endDiff =\n state.rects.reference[len] +\n state.rects.reference[axis] -\n popperOffsets[axis] -\n state.rects.popper[len];\n const startDiff = popperOffsets[axis] - state.rects.reference[axis];\n\n const arrowOffsetParent = getOffsetParent(arrowElement);\n const clientSize = arrowOffsetParent\n ? axis === 'y'\n ? arrowOffsetParent.clientHeight || 0\n : arrowOffsetParent.clientWidth || 0\n : 0;\n\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // Make sure the arrow doesn't overflow the popper if the center point is\n // outside of the popper bounds\n const min = paddingObject[minProp];\n const max = clientSize - arrowRect[len] - paddingObject[maxProp];\n const center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;\n const offset = within(min, center, max);\n\n // Prevents breaking syntax highlighting...\n const axisProp: string = axis;\n state.modifiersData[name] = {\n [axisProp]: offset,\n centerOffset: offset - center,\n };\n}\n\nfunction effect({ state, options }: ModifierArguments) {\n let { element: arrowElement = '[data-popper-arrow]' } = options;\n\n if (arrowElement == null) {\n return;\n }\n\n // CSS selector\n if (typeof arrowElement === 'string') {\n arrowElement = state.elements.popper.querySelector(arrowElement);\n\n if (!arrowElement) {\n return;\n }\n }\n\n if (!contains(state.elements.popper, arrowElement)) {\n return;\n }\n\n state.elements.arrow = arrowElement;\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type ArrowModifier = Modifier<'arrow', Options>;\nexport default ({\n name: 'arrow',\n enabled: true,\n phase: 'main',\n fn: arrow,\n effect,\n requires: ['popperOffsets'],\n requiresIfExists: ['preventOverflow'],\n}: ArrowModifier);\n","// @flow\nimport type {\n ModifierArguments,\n Modifier,\n Rect,\n SideObject,\n Offsets,\n} from '../types';\nimport { top, bottom, left, right } from '../enums';\nimport detectOverflow from '../utils/detectOverflow';\n\nfunction getSideOffsets(\n overflow: SideObject,\n rect: Rect,\n preventedOffsets: Offsets = { x: 0, y: 0 }\n): SideObject {\n return {\n top: overflow.top - rect.height - preventedOffsets.y,\n right: overflow.right - rect.width + preventedOffsets.x,\n bottom: overflow.bottom - rect.height + preventedOffsets.y,\n left: overflow.left - rect.width - preventedOffsets.x,\n };\n}\n\nfunction isAnySideFullyClipped(overflow: SideObject): boolean {\n return [top, right, bottom, left].some((side) => overflow[side] >= 0);\n}\n\nfunction hide({ state, name }: ModifierArguments<{||}>) {\n const referenceRect = state.rects.reference;\n const popperRect = state.rects.popper;\n const preventedOffsets = state.modifiersData.preventOverflow;\n\n const referenceOverflow = detectOverflow(state, {\n elementContext: 'reference',\n });\n const popperAltOverflow = detectOverflow(state, {\n altBoundary: true,\n });\n\n const referenceClippingOffsets = getSideOffsets(\n referenceOverflow,\n referenceRect\n );\n const popperEscapeOffsets = getSideOffsets(\n popperAltOverflow,\n popperRect,\n preventedOffsets\n );\n\n const isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);\n const hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);\n\n state.modifiersData[name] = {\n referenceClippingOffsets,\n popperEscapeOffsets,\n isReferenceHidden,\n hasPopperEscaped,\n };\n\n state.attributes.popper = {\n ...state.attributes.popper,\n 'data-popper-reference-hidden': isReferenceHidden,\n 'data-popper-escaped': hasPopperEscaped,\n };\n}\n\n// eslint-disable-next-line import/no-unused-modules\nexport type HideModifier = Modifier<'hide', {||}>;\nexport default ({\n name: 'hide',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['preventOverflow'],\n fn: hide,\n}: HideModifier);\n","// @flow\nimport { popperGenerator, detectOverflow } from './createPopper';\n\nimport eventListeners from './modifiers/eventListeners';\nimport popperOffsets from './modifiers/popperOffsets';\nimport computeStyles from './modifiers/computeStyles';\nimport applyStyles from './modifiers/applyStyles';\n\nexport type * from './types';\n\nconst defaultModifiers = [\n eventListeners,\n popperOffsets,\n computeStyles,\n applyStyles,\n];\n\nconst createPopper = popperGenerator({ defaultModifiers });\n\n// eslint-disable-next-line import/no-unused-modules\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };\n","// @flow\nimport { popperGenerator, detectOverflow } from './createPopper';\n\nimport eventListeners from './modifiers/eventListeners';\nimport popperOffsets from './modifiers/popperOffsets';\nimport computeStyles from './modifiers/computeStyles';\nimport applyStyles from './modifiers/applyStyles';\nimport offset from './modifiers/offset';\nimport flip from './modifiers/flip';\nimport preventOverflow from './modifiers/preventOverflow';\nimport arrow from './modifiers/arrow';\nimport hide from './modifiers/hide';\n\nexport type * from './types';\n\nconst defaultModifiers = [\n eventListeners,\n popperOffsets,\n computeStyles,\n applyStyles,\n offset,\n flip,\n preventOverflow,\n arrow,\n hide,\n];\n\nconst createPopper = popperGenerator({ defaultModifiers });\n\n// eslint-disable-next-line import/no-unused-modules\nexport { createPopper, popperGenerator, defaultModifiers, detectOverflow };\n// eslint-disable-next-line import/no-unused-modules\nexport { createPopper as createPopperLite } from './popper-lite';\n// eslint-disable-next-line import/no-unused-modules\nexport * from './modifiers';\n"],"names":["getWindow","node","window","toString","ownerDocument","defaultView","isElement","Element","isHTMLElement","HTMLElement","isShadowRoot","ShadowRoot","max","Math","min","round","getUAString","uaData","navigator","userAgentData","brands","Array","isArray","map","item","brand","version","join","userAgent","isLayoutViewport","test","getBoundingClientRect","element","includeScale","isFixedStrategy","clientRect","scaleX","scaleY","offsetWidth","width","offsetHeight","height","visualViewport","addVisualOffsets","x","left","offsetLeft","y","top","offsetTop","right","bottom","getWindowScroll","win","scrollLeft","pageXOffset","scrollTop","pageYOffset","getNodeName","nodeName","toLowerCase","getDocumentElement","document","documentElement","getWindowScrollBarX","getComputedStyle","isScrollParent","overflow","overflowX","overflowY","getCompositeRect","elementOrVirtualElement","offsetParent","isFixed","isOffsetParentAnElement","offsetParentIsScaled","rect","isElementScaled","scroll","offsets","clientLeft","clientTop","getLayoutRect","abs","getParentNode","assignedSlot","parentNode","host","getScrollParent","indexOf","body","listScrollParents","list","scrollParent","isBody","_element$ownerDocumen","target","concat","updatedList","isTableElement","getTrueOffsetParent","position","getOffsetParent","isFirefox","currentNode","css","transform","perspective","contain","willChange","filter","getContainingBlock","auto","basePlacements","start","end","viewport","popper","variationPlacements","reduce","acc","placement","placements","modifierPhases","order","modifiers","Map","visited","Set","result","sort","modifier","add","name","requires","requiresIfExists","forEach","dep","has","depModifier","get","push","set","contains","parent","child","rootNode","getRootNode","next","isSameNode","rectToClientRect","getClientRectFromMixedType","clippingParent","strategy","html","clientWidth","clientHeight","layoutViewport","getViewportRect","getInnerBoundingClientRect","winScroll","scrollWidth","scrollHeight","direction","getDocumentRect","getClippingRect","boundary","rootBoundary","mainClippingParents","clippingParents","clipperElement","getClippingParents","firstClippingParent","clippingRect","accRect","getBasePlacement","split","getVariation","getMainAxisFromPlacement","computeOffsets","reference","basePlacement","variation","commonX","commonY","mainAxis","len","mergePaddingObject","paddingObject","expandToHashMap","value","keys","hashMap","key","detectOverflow","state","options","elementContext","altBoundary","padding","altContext","popperRect","rects","elements","clippingClientRect","contextElement","referenceClientRect","popperOffsets","popperClientRect","elementClientRect","overflowOffsets","offsetData","modifiersData","offset","Object","multiply","axis","DEFAULT_OPTIONS","areValidElements","args","some","popperGenerator","generatorOptions","defaultModifiers","defaultOptions","fn","pending","orderedModifiers","attributes","styles","effectCleanupFns","isDestroyed","instance","setOptions","setOptionsAction","cleanupModifierEffects","scrollParents","merged","phase","orderModifiers","current","existing","data","m","enabled","effect","cleanupFn","noopFn","update","forceUpdate","reset","index","length","Promise","resolve","then","undefined","destroy","onFirstUpdate","passive","resize","addEventListener","removeEventListener","unsetSides","mapToStyles","gpuAcceleration","adaptive","roundOffsets","hasX","hasOwnProperty","hasY","sideX","sideY","heightProp","widthProp","commonStyles","dpr","devicePixelRatio","roundOffsetsByDPR","arrow","style","assign","removeAttribute","setAttribute","initialStyles","margin","property","attribute","invertDistance","skidding","distance","distanceAndSkiddingToXY","hash","getOppositePlacement","replace","matched","getOppositeVariationPlacement","computeAutoPlacement","flipVariations","allowedAutoPlacements","allPlacements","allowedPlacements","overflows","a","b","_skip","checkMainAxis","altAxis","checkAltAxis","specifiedFallbackPlacements","fallbackPlacements","preferredPlacement","oppositePlacement","getExpandedFallbackPlacements","referenceRect","checksMap","makeFallbackChecks","firstFittingPlacement","i","isStartVariation","isVertical","mainVariationSide","altVariationSide","checks","every","check","fittingPlacement","find","slice","within","mathMax","mathMin","tether","tetherOffset","isBasePlacement","tetherOffsetValue","normalizedTetherOffsetValue","offsetModifierState","mainSide","altSide","additive","minLen","maxLen","arrowElement","arrowRect","arrowPaddingObject","arrowPaddingMin","arrowPaddingMax","arrowLen","minOffset","maxOffset","arrowOffsetParent","clientOffset","offsetModifierValue","tetherMax","preventedOffset","isOriginSide","tetherMin","v","withinMaxClamp","toPaddingObject","minProp","maxProp","endDiff","startDiff","clientSize","centerToReference","center","axisProp","centerOffset","querySelector","getSideOffsets","preventedOffsets","isAnySideFullyClipped","side","preventOverflow","referenceOverflow","popperAltOverflow","referenceClippingOffsets","popperEscapeOffsets","isReferenceHidden","hasPopperEscaped","createPopper","eventListeners","computeStyles","applyStyles","flip","hide"],"mappings":";;;;8OAIe,SAASA,EAAUC,MACpB,MAARA,SACKC,UAGe,oBAApBD,EAAKE,WAAkC,KACnCC,EAAgBH,EAAKG,qBACpBA,GAAgBA,EAAcC,aAAwBH,cAGxDD,ECTT,SAASK,EAAUL,UAEVA,aADYD,EAAUC,GAAMM,SACEN,aAAgBM,QAKvD,SAASC,EAAcP,UAEdA,aADYD,EAAUC,GAAMQ,aACER,aAAgBQ,YAKvD,SAASC,EAAaT,SAEM,oBAAfU,aAIJV,aADYD,EAAUC,GAAMU,YACEV,aAAgBU,YCxBhD,IAAMC,EAAMC,KAAKD,IACXE,EAAMD,KAAKC,IACXC,EAAQF,KAAKE,MCMX,SAASC,QAChBC,EAAUC,UAAsBC,2BAElCF,GAAAA,EAAQG,QAAUC,MAAMC,QAAQL,EAAOG,QAClCH,EAAOG,OACXG,KAAI,SAACC,UA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AAKE,EAAOC,EAAQN,GAAM+K,MAAK,SAAC0J,UAASnT,EAASmT,IAAS,YA4CrD,CACdjP,KAAM,OACN+G,SAAS,EACTN,MAAO,OACPvG,iBAAkB,CAAC,mBACnB0F,GA9CF,gBAAgB9B,IAAAA,MAAO9D,IAAAA,KACfqL,EAAgBvH,EAAMO,MAAMtB,UAC5BqB,EAAaN,EAAMO,MAAMrF,OACzB+P,EAAmBjL,EAAMiB,cAAcmK,gBAEvCC,EAAoBtL,EAAeC,EAAO,CAC9CE,eAAgB,cAEZoL,EAAoBvL,EAAeC,EAAO,CAC9CG,aAAa,IAGToL,EAA2BP,GAC/BK,EACA9D,GAEIiE,EAAsBR,GAC1BM,EACAhL,EACA2K,GAGIQ,EAAoBP,GAAsBK,GAC1CG,EAAmBR,GAAsBM,GAE/CxL,EAAMiB,cAAc/E,GAAQ,CAC1BqP,yBAAAA,EACAC,oBAAAA,EACAC,kBAAAA,EACAC,iBAAAA,GAGF1L,EAAMiC,WAAW/G,wBACZ8E,EAAMiC,WAAW/G,uCACYuQ,wBACTC,MC9CrBC,GAAejK,EAAgB,CAAEE,iBAPd,CACvBgK,GACAhL,GACAiL,GACAC,MCCIlK,GAAmB,CACvBgK,GACAhL,GACAiL,GACAC,GACA5K,GACA6K,GACAX,GACAhG,GACA4G,IAGIL,GAAejK,EAAgB,CAAEE,iBAAAA"} \ No newline at end of file diff --git a/include/thirdparty/js/jquery.js b/include/thirdparty/js/jquery.js index 5f5c9ca..b86de89 100644 --- a/include/thirdparty/js/jquery.js +++ b/include/thirdparty/js/jquery.js @@ -1,12 +1,15 @@ /*! - * jQuery JavaScript Library v3.7.0 + * jQuery JavaScript Library v3.6.3 * https://jquery.com/ * + * Includes Sizzle.js + * https://sizzlejs.com/ + * * Copyright OpenJS Foundation and other contributors * Released under the MIT license * https://jquery.org/license * - * Date: 2023-05-11T18:29Z + * Date: 2022-12-20T21:28Z */ ( function( global, factory ) { @@ -147,9 +150,8 @@ function toType( obj ) { -var version = "3.7.0", - - rhtmlSuffix = /HTML$/i, +var + version = "3.6.3", // Define a local copy of jQuery jQuery = function( selector, context ) { @@ -395,33 +397,6 @@ jQuery.extend( { return obj; }, - - // Retrieve the text value of an array of DOM nodes - text: 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 += jQuery.text( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - return elem.textContent; - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - - // Do not include comment or processing instruction nodes - - return ret; - }, - // results is for internal usage only makeArray: function( arr, results ) { var ret = results || []; @@ -444,15 +419,6 @@ jQuery.extend( { return arr == null ? -1 : indexOf.call( arr, elem, i ); }, - isXMLDoc: function( elem ) { - var namespace = elem && elem.namespaceURI, - docElem = elem && ( elem.ownerDocument || elem ).documentElement; - - // Assume HTML when documentElement doesn't yet exist, such as inside - // document fragments. - return !rhtmlSuffix.test( namespace || docElem && docElem.nodeName || "HTML" ); - }, - // Support: Android <=4.0 only, PhantomJS 1 only // push.apply(_, arraylike) throws on ancient WebKit merge: function( first, second ) { @@ -554,98 +520,43 @@ function isArrayLike( obj ) { return type === "array" || length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj; } - - -function nodeName( elem, name ) { - - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - -} -var pop = arr.pop; - - -var sort = arr.sort; - - -var splice = arr.splice; - - -var whitespace = "[\\x20\\t\\r\\n\\f]"; - - -var rtrimCSS = new RegExp( - "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", - "g" -); - - - - -// Note: an element does not contain itself -jQuery.contains = function( a, b ) { - var bup = b && b.parentNode; - - return a === bup || !!( bup && bup.nodeType === 1 && ( - - // Support: IE 9 - 11+ - // IE doesn't have `contains` on SVG. - a.contains ? - a.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - ) ); -}; - - - - -// CSS string/identifier serialization -// https://drafts.csswg.org/cssom/#common-serializing-idioms -var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g; - -function fcssescape( 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; -} - -jQuery.escapeSelector = function( sel ) { - return ( sel + "" ).replace( rcssescape, fcssescape ); -}; - - - - -var preferredDoc = document, - pushNative = push; - -( function() { - +var Sizzle = +/*! + * Sizzle CSS Selector Engine v2.3.9 + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://js.foundation/ + * + * Date: 2022-12-19 + */ +( function( window ) { var i, + support, Expr, + getText, + isXML, + tokenize, + compile, + select, outermostContext, sortInput, hasDuplicate, - push = pushNative, // Local document vars + setDocument, document, - documentElement, + docElem, documentIsHTML, rbuggyQSA, + rbuggyMatches, matches, + contains, // Instance-specific data - expando = jQuery.expando, + expando = "sizzle" + 1 * new Date(), + preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), @@ -659,22 +570,47 @@ var i, return 0; }, - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|" + - "loop|multiple|open|readonly|required|scoped", + // 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: https://www.w3.org/TR/selectors/#attribute-selectors + // 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]" + // "Attribute values must be CSS identifiers [capture 5] + // or strings [capture 3 or capture 4]" "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]", @@ -693,88 +629,101 @@ var i, // 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 + "*" ), - rleadingCombinator = new RegExp( "^" + whitespace + "*([>+~]|" + 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" ), + "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 + + "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 - // https://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + - "?|\\\\([^\\r\\n\\f])", "g" ), + // 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; - if ( nonHex ) { + return nonHex ? // Strip the backslash prefix from a non-hex escape sequence - return nonHex; - } + 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 - return high < 0 ? - String.fromCharCode( high + 0x10000 ) : - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + // 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 ); }, - // Used for iframes; see `setDocument`. - // Support: IE 9 - 11+, Edge 12 - 18+ + // 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/Edge. + // error in IE unloadHandler = function() { setDocument(); }, inDisabledFieldset = addCombinator( function( elem ) { - return elem.disabled === true && nodeName( elem, "fieldset" ); + return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; }, { dir: "parentNode", next: "legend" } ); -// Support: IE <=9 only -// Accessing document.activeElement can throw unexpectedly -// https://bugs.jquery.com/ticket/13393 -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} - // Optimize for push.apply( _, NodeList ) try { push.apply( @@ -782,22 +731,32 @@ try { preferredDoc.childNodes ); - // Support: Android <=4.0 + // 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: function( target, els ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { pushNative.apply( target, slice.call( els ) ); - }, - call: function( target ) { - pushNative.apply( target, slice.call( arguments, 1 ) ); + } : + + // 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 find( selector, context, results, seed ) { +function Sizzle( selector, context, results, seed ) { var m, i, elem, nid, match, groups, newSelector, newContext = context && context.ownerDocument, @@ -831,10 +790,11 @@ function find( selector, context, results, seed ) { if ( nodeType === 9 ) { if ( ( elem = context.getElementById( m ) ) ) { - // Support: IE 9 only + // Support: IE, Opera, Webkit + // TODO: identify versions // getElementById can match elements by name instead of ID if ( elem.id === m ) { - push.call( results, elem ); + results.push( elem ); return results; } } else { @@ -844,13 +804,14 @@ function find( selector, context, results, seed ) { // Element context } else { - // Support: IE 9 only + // Support: IE, Opera, Webkit + // TODO: identify versions // getElementById can match elements by name instead of ID if ( newContext && ( elem = newContext.getElementById( m ) ) && - find.contains( context, elem ) && + contains( context, elem ) && elem.id === m ) { - push.call( results, elem ); + results.push( elem ); return results; } } @@ -861,15 +822,22 @@ function find( selector, context, results, seed ) { return results; // Class selector - } else if ( ( m = match[ 3 ] ) && context.getElementsByClassName ) { + } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && + context.getElementsByClassName ) { + push.apply( results, context.getElementsByClassName( m ) ); return results; } } // Take advantage of querySelectorAll - if ( !nonnativeSelectorCache[ selector + " " ] && - ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) ) { + 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; @@ -882,7 +850,7 @@ function find( selector, context, results, seed ) { // as such selectors are not recognized by querySelectorAll. // Thanks to Andrew Dupont for this technique. if ( nodeType === 1 && - ( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) { + ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { // Expand context for sibling selectors newContext = rsibling.test( selector ) && testContext( context.parentNode ) || @@ -890,15 +858,11 @@ function find( selector, context, results, seed ) { // We can use :scope instead of the ID hack if the browser // supports it & if we're not changing the context. - // 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 ( newContext != context || !support.scope ) { + if ( newContext !== context || !support.scope ) { // Capture the context ID, setting it first if necessary if ( ( nid = context.getAttribute( "id" ) ) ) { - nid = jQuery.escapeSelector( nid ); + nid = nid.replace( rcssescape, fcssescape ); } else { context.setAttribute( "id", ( nid = expando ) ); } @@ -915,6 +879,27 @@ function find( selector, context, results, seed ) { } try { + + // `qSA` may not throw for unrecognized parts using forgiving parsing: + // https://drafts.csswg.org/selectors/#forgiving-selector + // like the `:has()` pseudo-class: + // https://drafts.csswg.org/selectors/#relational + // `CSS.supports` is still expected to return `false` then: + // https://drafts.csswg.org/css-conditional-4/#typedef-supports-selector-fn + // https://drafts.csswg.org/css-conditional-4/#dfn-support-selector + if ( support.cssSupportsSelector && + + // eslint-disable-next-line no-undef + !CSS.supports( "selector(:is(" + newSelector + "))" ) ) { + + // Support: IE 11+ + // Throw to get to the same code path as an error directly in qSA. + // Note: once we only support browser supporting + // `CSS.supports('selector(...)')`, we can most likely drop + // the `try-catch`. IE doesn't implement the API. + throw new Error(); + } + push.apply( results, newContext.querySelectorAll( newSelector ) ); @@ -931,7 +916,7 @@ function find( selector, context, results, seed ) { } // All others - return select( selector.replace( rtrimCSS, "$1" ), context, results, seed ); + return select( selector.replace( rtrim, "$1" ), context, results, seed ); } /** @@ -945,8 +930,7 @@ function createCache() { function cache( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties - // (see https://github.com/jquery/sizzle/issues/157) + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) if ( keys.push( key + " " ) > Expr.cacheLength ) { // Only keep the most recent entries @@ -958,7 +942,7 @@ function createCache() { } /** - * Mark a function for special use by jQuery selector module + * Mark a function for special use by Sizzle * @param {Function} fn The function to mark */ function markFunction( fn ) { @@ -989,13 +973,56 @@ function assert( fn ) { } } +/** + * 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 ) { - return nodeName( elem, "input" ) && elem.type === type; + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; }; } @@ -1005,8 +1032,8 @@ function createInputPseudo( type ) { */ function createButtonPseudo( type ) { return function( elem ) { - return ( nodeName( elem, "input" ) || nodeName( elem, "button" ) ) && - elem.type === type; + var name = elem.nodeName.toLowerCase(); + return ( name === "input" || name === "button" ) && elem.type === type; }; } @@ -1042,13 +1069,14 @@ function createDisabledPseudo( disabled ) { } } - // Support: IE 6 - 11+ + // 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; + inDisabledFieldset( elem ) === disabled; } return elem.disabled === disabled; @@ -1088,7 +1116,7 @@ function createPositionalPseudo( fn ) { } /** - * Checks a node for validity as a jQuery selector context + * 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 */ @@ -1096,13 +1124,31 @@ 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} [node] An element or document object to use to set the document + * @param {Element|Object} [doc] An element or document object to use to set the document * @returns {Object} Returns the current document */ -function setDocument( node ) { - var subWindow, +setDocument = Sizzle.setDocument = function( node ) { + var hasCompare, subWindow, doc = node ? node.ownerDocument || node : preferredDoc; // Return early if doc is invalid or already selected @@ -1116,17 +1162,11 @@ function setDocument( node ) { // Update global variables document = doc; - documentElement = document.documentElement; - documentIsHTML = !jQuery.isXMLDoc( document ); - - // Support: iOS 7 only, IE 9 - 11+ - // Older browsers didn't support unprefixed `matches`. - matches = documentElement.matches || - documentElement.webkitMatchesSelector || - documentElement.msMatchesSelector; + docElem = document.documentElement; + documentIsHTML = !isXML( document ); // Support: IE 9 - 11+, Edge 12 - 18+ - // Accessing iframe documents after unload throws "permission denied" errors (see trac-13936) + // 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. @@ -1134,67 +1174,100 @@ function setDocument( node ) { if ( preferredDoc != document && ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { - // Support: IE 9 - 11+, Edge 12 - 18+ - subWindow.addEventListener( "unload", unloadHandler ); + // 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 <10 + // 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; + } ); + + // Support: Chrome 105+, Firefox 104+, Safari 15.4+ + // Make sure forgiving mode is not used in `CSS.supports( "selector(...)" )`. + // + // `:is()` uses a forgiving selector list as an argument and is widely + // implemented, so it's a good one to test against. + support.cssSupportsSelector = assert( function() { + /* eslint-disable no-undef */ + + return CSS.supports( "selector(*)" ) && + + // Support: Firefox 78-81 only + // In old Firefox, `:is()` didn't use forgiving parsing. In that case, + // fail this test as there's no selector to test against that. + // `CSS.supports` uses unforgiving parsing + document.querySelectorAll( ":is(:jqfake)" ) && + + // `*` is needed as Safari & newer Chrome implemented something in between + // for `:has()` - it throws in `qSA` if it only contains an unsupported + // argument but multiple ones, one of which is supported, are fine. + // We want to play safe in case `:is()` gets the same treatment. + !CSS.supports( "selector(:is(*,:jqfake))" ); + + /* eslint-enable */ + } ); + + /* 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 ) { - documentElement.appendChild( el ).id = jQuery.expando; - return !document.getElementsByName || - !document.getElementsByName( jQuery.expando ).length; - } ); - - // Support: IE 9 only - // Check to see if it's possible to do matchesSelector - // on a disconnected node. - support.disconnectedMatch = assert( function( el ) { - return matches.call( el, "*" ); - } ); - - // Support: IE 9 - 11+, Edge 12 - 18+ - // IE/Edge don't support the :scope pseudo-class. - support.scope = assert( function() { - return document.querySelectorAll( ":scope" ); - } ); - - // Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only - // Make sure the `:has()` argument is parsed unforgivingly. - // We include `*` in the test to detect buggy implementations that are - // _selectively_ forgiving (specifically when the list includes at least - // one valid selector). - // Note that we treat complete lack of support for `:has()` as if it were - // spec-compliant support, which is fine because use of `:has()` in such - // environments will fail in the qSA path and fall back to jQuery traversal - // anyway. - support.cssHas = assert( function() { - try { - document.querySelector( ":has(*,:jqfake)" ); - return false; - } catch ( e ) { - return true; - } + docElem.appendChild( el ).id = expando; + return !document.getElementsByName || !document.getElementsByName( expando ).length; } ); // ID filter and find if ( support.getById ) { - Expr.filter.ID = function( id ) { + 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 ) { + 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 ) { + Expr.filter[ "ID" ] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { var node = typeof elem.getAttributeNode !== "undefined" && @@ -1205,7 +1278,7 @@ function setDocument( node ) { // Support: IE 6 - 7 only // getElementById is not reliable as a find shortcut - Expr.find.ID = function( id, context ) { + Expr.find[ "ID" ] = function( id, context ) { if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { var node, i, elems, elem = context.getElementById( id ); @@ -1235,18 +1308,40 @@ function setDocument( node ) { } // Tag - Expr.find.TAG = function( tag, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( 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 { - return context.querySelectorAll( 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 = function( className, context ) { + Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { return context.getElementsByClassName( className ); } @@ -1257,94 +1352,195 @@ function setDocument( node ) { // 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 = []; - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert( function( el ) { + if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { - var input; + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert( function( el ) { - documentElement.appendChild( el ).innerHTML = - "" + - ""; + var input; - // Support: iOS <=7 - 8 only - // Boolean attributes and "value" are not treated correctly in some XML documents - if ( !el.querySelectorAll( "[selected]" ).length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } + // 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: iOS <=7 - 8 only - if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { - rbuggyQSA.push( "~=" ); - } + // 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: iOS 8 only - // 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: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !el.querySelectorAll( "[selected]" ).length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } - // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+ - // In some of the document kinds, these selectors wouldn't work natively. - // This is probably OK but for backwards compatibility we want to maintain - // handling them through jQuery traversal in jQuery 3.x. - if ( !el.querySelectorAll( ":checked" ).length ) { - rbuggyQSA.push( ":checked" ); - } + // 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: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - input = document.createElement( "input" ); - input.setAttribute( "type", "hidden" ); - el.appendChild( input ).setAttribute( "name", "D" ); + // 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 + "*(?:''|\"\")" ); + } - // Support: IE 9 - 11+ - // IE's :disabled selector does not pick up the children of disabled fieldsets - // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+ - // In some of the document kinds, these selectors wouldn't work natively. - // This is probably OK but for backwards compatibility we want to maintain - // handling them through jQuery traversal in jQuery 3.x. - documentElement.appendChild( el ).disabled = true; - if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } + // 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: 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 + "*(?:''|\"\")" ); - } - } ); + // 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( ".#.+[+~]" ); + } - if ( !support.cssHas ) { + // Support: Firefox <=3.6 - 5 only + // Old Firefox doesn't throw on a badly-escaped identifier. + el.querySelectorAll( "\\\f" ); + rbuggyQSA.push( "[\\r\\n\\f]" ); + } ); - // Support: Chrome 105 - 110+, Safari 15.4 - 16.3+ - // Our regular `try-catch` mechanism fails to detect natively-unsupported - // pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`) - // in browsers that parse the `:has()` argument as a forgiving selector list. - // https://drafts.csswg.org/selectors/#relational now requires the argument - // to be parsed unforgivingly, but browsers have not yet fully adjusted. + 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 ); + } ); + } + + if ( !support.cssSupportsSelector ) { + + // Support: Chrome 105+, Safari 15.4+ + // `:has()` uses a forgiving selector list as an argument so our regular + // `try-catch` mechanism fails to catch `:has()` with arguments not supported + // natively like `:has(:contains("Foo"))`. Where supported & spec-compliant, + // we now use `CSS.supports("selector(:is(SELECTOR_TO_BE_TESTED))")`, but + // outside that we mark `:has` as buggy. rbuggyQSA.push( ":has" ); } 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 ) { + + // Support: IE <9 only + // IE doesn't have `contains` on `document` so we need to check for + // `documentElement` presence. + // We need to fall back to `a` when `documentElement` is missing + // as `ownerDocument` of elements within `