{"version":3,"sources":["webpack:///./node_modules/@esri/calcite-components/dist/components/debounce.js","webpack:///./node_modules/@esri/calcite-components/dist/components/floating-ui.js"],"names":["freeGlobal","global","Object","freeSelf","self","root","Function","Symbol","objectProto$1","prototype","hasOwnProperty","nativeObjectToString$1","toString","symToStringTag$1","toStringTag","undefined","nativeObjectToString","symToStringTag","baseGetTag","value","isOwn","call","tag","unmasked","e","result","getRawTag","objectToString","reWhitespace","reTrimStart","baseTrim","string","slice","index","length","test","charAt","trimmedEndIndex","replace","isObject","type","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","toNumber","isObjectLike","isSymbol","other","valueOf","isBinary","now","Date","nativeMax","Math","max","nativeMin","min","getSide","placement","split","getAlignment","getMainAxisFromPlacement","includes","getLengthFromAxis","axis","computeCoordsFromPlacement","_ref","rtl","reference","floating","commonX","x","width","commonY","y","height","mainAxis","commonAlign","isVertical","coords","getSideObjectFromPadding","padding","top","right","bottom","left","expandPaddingObject","rectToClientRect","rect","async","detectOverflow","middlewareArguments","options","_await$platform$isEle","platform","rects","elements","strategy","boundary","rootBoundary","elementContext","altBoundary","paddingObject","element","clippingClientRect","getClippingRect","isElement","contextElement","getDocumentElement","elementClientRect","convertOffsetParentRelativeRectToViewportRelativeRect","offsetParent","getOffsetParent","min$1","max$1","within","min$1$1","max$1$1","hash$1","getOppositePlacement","matched","getAlignmentSides","alignment","mainAlignmentSide","main","cross","hash","start","end","getOppositeAlignmentPlacement","sides","allPlacements","reduce","acc","side","concat","autoPlacement","name","_middlewareData$autoP","_middlewareData$autoP2","_middlewareData$autoP3","_middlewareData$autoP4","_placementsSortedByLe","middlewareData","allowedPlacements","autoAlignment","detectOverflowOptions","placements","filter","getPlacementList","overflow","currentIndex","currentPlacement","isRTL","reset","currentOverflows","allOverflows","overflows","nextPlacement","data","placementsSortedByLeastOverflow","sort","a","b","placementThatFitsOnAllSides","find","every","resetPlacement","flip","_middlewareData$flip","initialPlacement","checkMainAxis","crossAxis","checkCrossAxis","fallbackPlacements","specifiedFallbackPlacements","fallbackStrategy","flipAlignment","oppositePlacement","getExpandedPlacements","overflowsData","push","_middlewareData$flip$","_middlewareData$flip2","nextIndex","_overflowsData$map$so","map","d","getSideOffsets","isAnySideFullyClipped","some","hide","_temp","offsets","referenceHiddenOffsets","referenceHidden","escapedOffsets","escaped","offset","diffCoords","mainAxisMulti","crossAxisMulti","rawValue","alignmentAxis","convertValueToCoords","isWindow","document","location","alert","setInterval","getWindow","node","window","ownerDocument","defaultView","getComputedStyle","getNodeName","nodeName","toLowerCase","uaData","navigator","userAgentData","brands","item","brand","version","join","userAgent","isHTMLElement","HTMLElement","Element","isShadowRoot","ShadowRoot","isOverflowElement","overflowX","overflowY","display","isTableElement","isContainingBlock","isFirefox","css","transform","perspective","willChange","contain","isLayoutViewport","isLastTraversableNode","round","getBoundingClientRect","includeScale","isFixedStrategy","_win$visualViewport$o","_win$visualViewport","_win$visualViewport$o2","_win$visualViewport2","clientRect","scaleX","scaleY","offsetWidth","offsetHeight","win","addVisualOffsets","visualViewport","offsetLeft","offsetTop","Node","documentElement","getNodeScroll","scrollLeft","scrollTop","pageXOffset","pageYOffset","getWindowScrollBarX","getRectRelativeToOffsetParent","isOffsetParentAnElement","isScaled","scroll","offsetRect","clientLeft","clientTop","getParentNode","assignedSlot","parentNode","host","getTrueOffsetParent","position","currentNode","parent","getContainingBlock","getDimensions","getOverflowAncestors","list","_node$ownerDocument","scrollableAncestor","getNearestOverflowAncestor","body","isBody","target","updatedList","getClientRectFromClippingAncestor","clippingParent","html","clientWidth","clientHeight","layoutViewport","getViewportRect","getInnerBoundingClientRect","_element$ownerDocumen","scrollWidth","scrollHeight","direction","getDocumentRect","getClippingAncestors","clippingAncestors","nearestEscapableParent","getNearestParentCapableOfEscapingClipping","clipperElement","child","rootNode","getRootNode","contains","next","firstClippingAncestor","clippingRect","accRect","clippingAncestor","getElementRects","getClientRects","Array","from","autoUpdate","update","ancestorScroll","_ancestorScroll","ancestorResize","elementResize","animationFrame","ancestors","forEach","ancestor","addEventListener","passive","frameId","observer","initialUpdate","ResizeObserver","observe","prevRefRect","frameLoop","nextRefRect","requestAnimationFrame","_observer","removeEventListener","disconnect","cancelAnimationFrame","computePosition","config","middleware","statefulPlacement","resetCount","i","fn","nextX","nextY","computePosition$1","floatingUINonChromiumPositioningFix","globalThis","floatingUIBrowserCheck","isBrowser","getUAString","patchFloatingUiForNonChromiumBrowsers","effectivePlacements","FloatingCSS","animation","animationActive","getMiddleware","disableFlip","flipPlacements","offsetDistance","offsetSkidding","arrowEl","defaultMiddleware","limiter","mainAxisCoord","crossAxisCoord","maxSide","limitedCoords","arrowDimensions","minProp","maxProp","endDiff","startDiff","arrowOffsetParent","clientSize","centerToReference","center","shouldAddOffset","centerOffset","arrow","filterComputedPlacements","el","filteredPlacements","console","warn","tagName","trim","getEffectivePlacement","floatingEl","reverse","reposition","component","delayed","open","debouncedReposition","positionFloatingUI","func","wait","lastArgs","lastThis","maxWait","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","TypeError","invokeFunc","time","args","thisArg","apply","leadingEdge","setTimeout","timerExpired","shouldInvoke","timeSinceLastCall","trailingEdge","timeWaiting","remainingWait","debounced","isInvoking","arguments","this","clearTimeout","cancel","flush","debounce","referenceEl","overlayPositioning","includeArrow","_a","effectivePlacement","arrowX","arrowY","assign","style","visibility","pointerEvents","setAttribute","cleanupMap","WeakMap","connectFloatingUI","disconnectFloatingUI","moveOffScreen","runAutoUpdate","_refEl","_floatingEl","updateCallback","set","getTransitionTarget","handleTransitionElTransitionEnd","cleanup","get","delete","defaultOffsetDistance","ceil","hypot","updateAfterClose","shadowRoot","event","floatingTransitionEl","propertyName","classList","getFloatingElFromTransitionTarget"],"mappings":";yYAMIA,EAA8B,iBAAVC,QAAsBA,QAAUA,OAAOC,SAAWA,QAAUD,OAGhFE,EAA0B,iBAARC,MAAoBA,MAAQA,KAAKF,SAAWA,QAAUE,KAGxEC,EAAOL,GAAcG,GAAYG,SAAS,cAAT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J,MAAM2N,GAAa,IAAIC,QAQvB,SAASC,GAAkBpD,EAAWsC,EAAazC,GACjD,IAAKA,IAAeyC,EAClB,OAEFe,GAAqBrD,EAAWsC,EAAazC,GAC7C,MAAM1H,EAAW6H,EAAUuC,mBAE3B1C,EAAWiD,MAAM3K,SAAWA,EACX,aAAbA,GACFmL,GAAczD,GAEhB,MAAM0D,EAAgB,IAAMjG,UACxBtC,GACA,CAACwI,EAAQC,EAAaC,KACtBA,IACO,QAIXR,GAAWS,IAAI3D,EAAWuD,EAAcjB,EAAazC,EAAY,IAAMG,EAAUD,eASnF,SAASsD,GAAqBrD,EAAWsC,EAAazC,GACpD,IAAKA,IAAeyC,EAClB,OAEFsB,GAAoB/D,GAAYvD,oBAAoB,gBAAiBuH,IACrE,MAAMC,EAAUZ,GAAWa,IAAI/D,GAC3B8D,GACFA,IAEFZ,GAAWc,OAAOhE,GAEpB,MAMMiE,GAAwBta,KAAKua,KAAKva,KAAKwa,MANlB,MAc3B,SAASC,GAAiBvE,GACnBA,GAA4C,aAA9BA,EAAWiD,MAAM3K,UAGpCyL,GAAoB/D,GAAYnE,iBAAiB,gBAAiBmI,IAEpE,SAASD,GAAoB/D,GAE3B,OAAOA,EAAWwE,YAAcxE,EAElC,SAASgE,GAAgCS,GACvC,MAAMC,EAAuBD,EAAMvL,OACnC,GAEuB,YAAvBuL,EAAME,cACJD,EAAqBE,UAAUnK,SAASoD,GAAYC,WAAY,CAChE,MAAMkC,EAUV,SAA2C0E,GACzC,OAAO,YAAkCA,EAAsB,oBAX1CG,CAAkCH,GACrDjB,GAAczD,GACd+D,GAAoB/D,GAAYvD,oBAAoB,gBAAiBuH,KAGzE,SAASP,GAAczD,GACrBA,EAAWiD,MAAMvN,UAAY,GAC7BsK,EAAWiD,MAAMtX,IAAM,WACvBqU,EAAWiD,MAAMnX,KAAO","file":"19.bf767d10e69e66bfe93a.js","sourcesContent":["/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.\n * v1.0.0-beta.97\n */\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\n/** Used for built-in method references. */\nvar objectProto$1 = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto$1.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString$1 = objectProto$1.toString;\n\n/** Built-in value references. */\nvar symToStringTag$1 = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag$1),\n tag = value[symToStringTag$1];\n\n try {\n value[symToStringTag$1] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString$1.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag$1] = tag;\n } else {\n delete value[symToStringTag$1];\n }\n }\n return result;\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\n/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nexport { Symbol as S, isSymbol as a, baseGetTag as b, isObjectLike as c, debounce as d, freeGlobal as f, isObject as i, root as r };\n","/*!\n * All material copyright ESRI, All Rights Reserved, unless otherwise specified.\n * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.\n * v1.0.0-beta.97\n */\nimport { c as getElementDir, o as closestElementCrossShadowBoundary } from './dom.js';\nimport { Build } from '@stencil/core/internal/client/index.js';\nimport { d as debounce } from './debounce.js';\n\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\n\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\n\nfunction getMainAxisFromPlacement(placement) {\n return ['top', 'bottom'].includes(getSide(placement)) ? 'x' : 'y';\n}\n\nfunction getLengthFromAxis(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const mainAxis = getMainAxisFromPlacement(placement);\n const length = getLengthFromAxis(mainAxis);\n const commonAlign = reference[length] / 2 - floating[length] / 2;\n const side = getSide(placement);\n const isVertical = mainAxis === 'x';\n let coords;\n\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n\n switch (getAlignment(placement)) {\n case 'start':\n coords[mainAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n\n case 'end':\n coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n\n return coords;\n}\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a reference element when it is given a certain positioning strategy.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\n\nconst computePosition$1 = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let middlewareData = {};\n let resetCount = 0;\n\n for (let i = 0; i < middleware.length; i++) {\n const {\n name,\n fn\n } = middleware[i];\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData = { ...middlewareData,\n [name]: { ...middlewareData[name],\n ...data\n }\n };\n\n if (reset && resetCount <= 50) {\n resetCount++;\n\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n\n i = -1;\n continue;\n }\n }\n\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\n\nfunction getSideObjectFromPadding(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\n\nfunction rectToClientRect(rect) {\n return { ...rect,\n top: rect.y,\n left: rect.x,\n right: rect.x + rect.width,\n bottom: rect.y + rect.height\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(middlewareArguments, options) {\n var _await$platform$isEle;\n\n if (options === void 0) {\n options = {};\n }\n\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = middlewareArguments;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = options;\n const paddingObject = getSideObjectFromPadding(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n rect: elementContext === 'floating' ? { ...rects.floating,\n x,\n y\n } : rects.reference,\n offsetParent: await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)),\n strategy\n }) : rects[elementContext]);\n return {\n top: clippingClientRect.top - elementClientRect.top + paddingObject.top,\n bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,\n left: clippingClientRect.left - elementClientRect.left + paddingObject.left,\n right: elementClientRect.right - clippingClientRect.right + paddingObject.right\n };\n}\n\nconst min$1 = Math.min;\nconst max$1 = Math.max;\n\nfunction within(min$1$1, value, max$1$1) {\n return max$1(min$1$1, min$1(value, max$1$1));\n}\n\n/**\n * Positions an inner element of the floating element such that it is centered\n * to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n\n async fn(middlewareArguments) {\n // Since `element` is required, we don't Partial<> the type\n const {\n element,\n padding = 0\n } = options != null ? options : {};\n const {\n x,\n y,\n placement,\n rects,\n platform\n } = middlewareArguments;\n\n if (element == null) {\n\n return {};\n }\n\n const paddingObject = getSideObjectFromPadding(padding);\n const coords = {\n x,\n y\n };\n const axis = getMainAxisFromPlacement(placement);\n const alignment = getAlignment(placement);\n const length = getLengthFromAxis(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const minProp = axis === 'y' ? 'top' : 'left';\n const maxProp = axis === 'y' ? 'bottom' : 'right';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;\n\n if (clientSize === 0) {\n clientSize = rects.floating[length];\n }\n\n const centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds\n\n const min = paddingObject[minProp];\n const max = clientSize - arrowDimensions[length] - paddingObject[maxProp];\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = within(min, center, max); // Make sure that arrow points at the reference\n\n const alignmentPadding = alignment === 'start' ? paddingObject[minProp] : paddingObject[maxProp];\n const shouldAddOffset = alignmentPadding > 0 && center !== offset && rects.reference[length] <= rects.floating[length];\n const alignmentOffset = shouldAddOffset ? center < min ? min - center : max - center : 0;\n return {\n [axis]: coords[axis] - alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset\n }\n };\n }\n\n});\n\nconst hash$1 = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nfunction getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, matched => hash$1[matched]);\n}\n\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n\n const alignment = getAlignment(placement);\n const mainAxis = getMainAxisFromPlacement(placement);\n const length = getLengthFromAxis(mainAxis);\n let mainAlignmentSide = mainAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n\n return {\n main: mainAlignmentSide,\n cross: getOppositePlacement(mainAlignmentSide)\n };\n}\n\nconst hash = {\n start: 'end',\n end: 'start'\n};\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.replace(/start|end/g, matched => hash[matched]);\n}\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst allPlacements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-start\", side + \"-end\"), []);\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n\n return true;\n });\n}\n\n/**\n * Automatically chooses the `placement` which has the most space available.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n\n return {\n name: 'autoPlacement',\n options,\n\n async fn(middlewareArguments) {\n var _middlewareData$autoP, _middlewareData$autoP2, _middlewareData$autoP3, _middlewareData$autoP4, _placementsSortedByLe;\n\n const {\n x,\n y,\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = middlewareArguments;\n const {\n alignment = null,\n allowedPlacements = allPlacements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = options;\n const placements = getPlacementList(alignment, autoAlignment, allowedPlacements);\n const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);\n const currentIndex = (_middlewareData$autoP = (_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.index) != null ? _middlewareData$autoP : 0;\n const currentPlacement = placements[currentIndex];\n\n if (currentPlacement == null) {\n return {};\n }\n\n const {\n main,\n cross\n } = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))); // Make `computeCoords` start from the right place\n\n if (placement !== currentPlacement) {\n return {\n x,\n y,\n reset: {\n placement: placements[0]\n }\n };\n }\n\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[main], overflow[cross]];\n const allOverflows = [...((_middlewareData$autoP3 = (_middlewareData$autoP4 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP4.overflows) != null ? _middlewareData$autoP3 : []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements[currentIndex + 1]; // There are more placements to check\n\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n\n const placementsSortedByLeastOverflow = allOverflows.slice().sort((a, b) => a.overflows[0] - b.overflows[0]);\n const placementThatFitsOnAllSides = (_placementsSortedByLe = placementsSortedByLeastOverflow.find(_ref => {\n let {\n overflows\n } = _ref;\n return overflows.every(overflow => overflow <= 0);\n })) == null ? void 0 : _placementsSortedByLe.placement;\n const resetPlacement = placementThatFitsOnAllSides != null ? placementThatFitsOnAllSides : placementsSortedByLeastOverflow[0].placement;\n\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n\n return {};\n }\n\n };\n};\n\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\n\n/**\n * Changes the placement of the floating element to one that will fit if the\n * initially specified `placement` does not.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n\n return {\n name: 'flip',\n options,\n\n async fn(middlewareArguments) {\n var _middlewareData$flip;\n\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = middlewareArguments;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n flipAlignment = true,\n ...detectOverflowOptions\n } = options;\n const side = getSide(placement);\n const isBasePlacement = side === initialPlacement;\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n\n if (checkCrossAxis) {\n const {\n main,\n cross\n } = getAlignmentSides(placement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n overflows.push(overflow[main], overflow[cross]);\n }\n\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }]; // One or more sides is overflowing\n\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip$, _middlewareData$flip2;\n\n const nextIndex = ((_middlewareData$flip$ = (_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) != null ? _middlewareData$flip$ : 0) + 1;\n const nextPlacement = placements[nextIndex];\n\n if (nextPlacement) {\n // Try next placement and re-run the lifecycle\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n\n let resetPlacement = 'bottom';\n\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$map$so;\n\n const placement = (_overflowsData$map$so = overflowsData.map(d => [d, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0].placement;\n\n if (placement) {\n resetPlacement = placement;\n }\n\n break;\n }\n\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n\n return {};\n }\n\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\n\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (_temp) {\n let {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = _temp === void 0 ? {} : _temp;\n return {\n name: 'hide',\n\n async fn(middlewareArguments) {\n const {\n rects\n } = middlewareArguments;\n\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await detectOverflow(middlewareArguments, { ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n\n case 'escaped':\n {\n const overflow = await detectOverflow(middlewareArguments, { ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n\n default:\n {\n return {};\n }\n }\n }\n\n };\n};\n\nasync function convertValueToCoords(middlewareArguments, value) {\n const {\n placement,\n platform,\n elements\n } = middlewareArguments;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getMainAxisFromPlacement(placement) === 'x';\n const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = typeof value === 'function' ? value(middlewareArguments) : value; // eslint-disable-next-line prefer-const\n\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: 0,\n crossAxis: 0,\n alignmentAxis: null,\n ...rawValue\n };\n\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n/**\n * Displaces the floating element from its reference element.\n * @see https://floating-ui.com/docs/offset\n */\n\nconst offset = function (value) {\n if (value === void 0) {\n value = 0;\n }\n\n return {\n name: 'offset',\n options: value,\n\n async fn(middlewareArguments) {\n const {\n x,\n y\n } = middlewareArguments;\n const diffCoords = await convertValueToCoords(middlewareArguments, value);\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: diffCoords\n };\n }\n\n };\n};\n\nfunction getCrossAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\n\n/**\n * Shifts the floating element in order to keep it in view when it will overflow\n * a clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n\n return {\n name: 'shift',\n options,\n\n async fn(middlewareArguments) {\n const {\n x,\n y,\n placement\n } = middlewareArguments;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = options;\n const coords = {\n x,\n y\n };\n const overflow = await detectOverflow(middlewareArguments, detectOverflowOptions);\n const mainAxis = getMainAxisFromPlacement(getSide(placement));\n const crossAxis = getCrossAxis(mainAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = within(min, mainAxisCoord, max);\n }\n\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = within(min, crossAxisCoord, max);\n }\n\n const limitedCoords = limiter.fn({ ...middlewareArguments,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return { ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y\n }\n };\n }\n\n };\n};\n\nfunction isWindow(value) {\n return value && value.document && value.location && value.alert && value.setInterval;\n}\nfunction getWindow(node) {\n if (node == null) {\n return window;\n }\n\n if (!isWindow(node)) {\n const ownerDocument = node.ownerDocument;\n return ownerDocument ? ownerDocument.defaultView || window : window;\n }\n\n return node;\n}\n\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\n\nfunction getNodeName(node) {\n return isWindow(node) ? '' : node ? (node.nodeName || '').toLowerCase() : '';\n}\n\nfunction getUAString() {\n const uaData = navigator.userAgentData;\n\n if (uaData != null && uaData.brands) {\n return uaData.brands.map(item => item.brand + \"/\" + item.version).join(' ');\n }\n\n return navigator.userAgent;\n}\n\nfunction isHTMLElement(value) {\n return value instanceof getWindow(value).HTMLElement;\n}\nfunction isElement(value) {\n return value instanceof getWindow(value).Element;\n}\nfunction isNode(value) {\n return value instanceof getWindow(value).Node;\n}\nfunction isShadowRoot(node) {\n // Browsers without `ShadowRoot` support\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n\n const OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\nfunction isOverflowElement(element) {\n // Firefox wants us to check `-x` and `-y` variations as well\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);\n}\nfunction isTableElement(element) {\n return ['table', 'td', 'th'].includes(getNodeName(element));\n}\nfunction isContainingBlock(element) {\n // TODO: Try and use feature detection here instead\n const isFirefox = /firefox/i.test(getUAString());\n const css = getComputedStyle(element); // 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\n return css.transform !== 'none' || css.perspective !== 'none' || isFirefox && css.willChange === 'filter' || isFirefox && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective'].some(value => css.willChange.includes(value)) || ['paint', 'layout', 'strict', 'content'].some( // TS 4.1 compat\n value => {\n const contain = css.contain;\n return contain != null ? contain.includes(value) : false;\n });\n}\nfunction isLayoutViewport() {\n // Not Safari\n return !/^((?!chrome|android).)*safari/i.test(getUAString()); // Feature detection for this fails in various ways\n // • Always-visible scrollbar or not\n // • Width of , etc.\n // const vV = win.visualViewport;\n // return vV ? Math.abs(win.innerWidth / vV.scale - vV.width) < 0.5 : true;\n}\nfunction isLastTraversableNode(node) {\n return ['html', 'body', '#document'].includes(getNodeName(node));\n}\n\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy) {\n var _win$visualViewport$o, _win$visualViewport, _win$visualViewport$o2, _win$visualViewport2;\n\n if (includeScale === void 0) {\n includeScale = false;\n }\n\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n\n const clientRect = element.getBoundingClientRect();\n let scaleX = 1;\n let scaleY = 1;\n\n if (includeScale && isHTMLElement(element)) {\n scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;\n scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;\n }\n\n const win = isElement(element) ? getWindow(element) : window;\n const addVisualOffsets = !isLayoutViewport() && isFixedStrategy;\n const x = (clientRect.left + (addVisualOffsets ? (_win$visualViewport$o = (_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) != null ? _win$visualViewport$o : 0 : 0)) / scaleX;\n const y = (clientRect.top + (addVisualOffsets ? (_win$visualViewport$o2 = (_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) != null ? _win$visualViewport$o2 : 0 : 0)) / scaleY;\n const width = clientRect.width / scaleX;\n const height = clientRect.height / scaleY;\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\nfunction getDocumentElement(node) {\n return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement;\n}\n\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n\n return {\n scrollLeft: element.pageXOffset,\n scrollTop: element.pageYOffset\n };\n}\n\nfunction getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;\n}\n\nfunction isScaled(element) {\n const rect = getBoundingClientRect(element);\n return round(rect.width) !== element.offsetWidth || round(rect.height) !== element.offsetHeight;\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const rect = getBoundingClientRect(element, // @ts-ignore - checked above (TS 4.1 compat)\n isOffsetParentAnElement && isScaled(offsetParent), strategy === 'fixed');\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent, true);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.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\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n\n return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle\n // @ts-ignore\n node.assignedSlot || // step into the shadow DOM of the parent of a slotted node\n node.parentNode || ( // DOM Element detected\n isShadowRoot(node) ? node.host : null) || // ShadowRoot detected\n getDocumentElement(node) // fallback\n\n );\n}\n\nfunction getTrueOffsetParent(element) {\n if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {\n return null;\n }\n\n return element.offsetParent;\n}\n\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n\n if (isShadowRoot(currentNode)) {\n currentNode = currentNode.host;\n }\n\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else {\n const parent = currentNode.parentNode;\n currentNode = isShadowRoot(parent) ? parent.host : parent;\n }\n }\n\n return null;\n} // Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\n\n\nfunction getOffsetParent(element) {\n const window = getWindow(element);\n let offsetParent = getTrueOffsetParent(element);\n\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent);\n }\n\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {\n return window;\n }\n\n return offsetParent || getContainingBlock(element) || window;\n}\n\nfunction getDimensions(element) {\n if (isHTMLElement(element)) {\n return {\n width: element.offsetWidth,\n height: element.offsetHeight\n };\n }\n\n const rect = getBoundingClientRect(element);\n return {\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n\n if (offsetParent === documentElement) {\n return rect;\n }\n\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = {\n x: 0,\n y: 0\n };\n\n if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent, true);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } // This doesn't appear to be need to be negated.\n // else if (documentElement) {\n // offsets.x = getWindowScrollBarX(documentElement);\n // }\n\n }\n\n return { ...rect,\n x: rect.x - scroll.scrollLeft + offsets.x,\n y: rect.y - scroll.scrollTop + offsets.y\n };\n}\n\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\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 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,\n y\n };\n}\n\n// of the `` and `` rect bounds if horizontally scrollable\n\nfunction getDocumentRect(element) {\n var _element$ownerDocumen;\n\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;\n const width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);\n const height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n\n if (getComputedStyle(body || html).direction === 'rtl') {\n x += max(html.clientWidth, body ? body.clientWidth : 0) - width;\n }\n\n return {\n width,\n height,\n x,\n y\n };\n}\n\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n\n if (isLastTraversableNode(parentNode)) {\n // @ts-ignore assume body is always available\n return node.ownerDocument.body;\n }\n\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n\n return getNearestOverflowAncestor(parentNode);\n}\n\nfunction getOverflowAncestors(node, list) {\n var _node$ownerDocument;\n\n if (list === void 0) {\n list = [];\n }\n\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);\n const win = getWindow(scrollableAncestor);\n const target = isBody ? [win].concat(win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []) : scrollableAncestor;\n const updatedList = list.concat(target);\n return isBody ? updatedList : // @ts-ignore: isBody tells us target will be an HTMLElement here\n updatedList.concat(getOverflowAncestors(target));\n}\n\nfunction contains(parent, child) {\n const rootNode = child.getRootNode == null ? void 0 : child.getRootNode(); // First, attempt with faster native method\n\n if (parent.contains(child)) {\n return true;\n } // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n let next = child;\n\n do {\n // use `===` replace node.isSameNode()\n if (next && parent === next) {\n return true;\n } // @ts-ignore: need a better way to handle this...\n\n\n next = next.parentNode || next.host;\n } while (next);\n }\n\n return false;\n}\n\nfunction getNearestParentCapableOfEscapingClipping(element, clippingAncestors) {\n let currentNode = element;\n\n while (currentNode && !isLastTraversableNode(currentNode) && // @ts-expect-error\n !clippingAncestors.includes(currentNode)) {\n if (isElement(currentNode) && ['absolute', 'fixed'].includes(getComputedStyle(currentNode).position)) {\n break;\n }\n\n const parentNode = getParentNode(currentNode);\n currentNode = isShadowRoot(parentNode) ? parentNode.host : parentNode;\n }\n\n return currentNode;\n}\n\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, false, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n return {\n top,\n left,\n x: left,\n y: top,\n right: left + element.clientWidth,\n bottom: top + element.clientHeight,\n width: element.clientWidth,\n height: element.clientHeight\n };\n}\n\nfunction getClientRectFromClippingAncestor(element, clippingParent, strategy) {\n if (clippingParent === 'viewport') {\n return rectToClientRect(getViewportRect(element, strategy));\n }\n\n if (isElement(clippingParent)) {\n return getInnerBoundingClientRect(clippingParent, strategy);\n }\n\n return rectToClientRect(getDocumentRect(getDocumentElement(element)));\n} // A \"clipping ancestor\" is an overflowable container with the characteristic of\n// clipping (or hiding) overflowing elements with a position different from\n// `initial`\n\n\nfunction getClippingAncestors(element) {\n const clippingAncestors = getOverflowAncestors(element);\n const nearestEscapableParent = getNearestParentCapableOfEscapingClipping(element, clippingAncestors);\n let clipperElement = null;\n\n if (nearestEscapableParent && isHTMLElement(nearestEscapableParent)) {\n const offsetParent = getOffsetParent(nearestEscapableParent);\n\n if (isOverflowElement(nearestEscapableParent)) {\n clipperElement = nearestEscapableParent;\n } else if (isHTMLElement(offsetParent)) {\n clipperElement = offsetParent;\n }\n }\n\n if (!isElement(clipperElement)) {\n return [];\n } // @ts-ignore isElement check ensures we return Array\n\n\n return clippingAncestors.filter(clippingAncestors => clipperElement && isElement(clippingAncestors) && contains(clippingAncestors, clipperElement) && getNodeName(clippingAncestors) !== 'body');\n} // Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors\n\n\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const mainClippingAncestors = boundary === 'clippingAncestors' ? getClippingAncestors(element) : [].concat(boundary);\n const clippingAncestors = [...mainClippingAncestors, rootBoundary];\n const firstClippingAncestor = clippingAncestors[0];\n const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\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 return accRect;\n }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n return {\n width: clippingRect.right - clippingRect.left,\n height: clippingRect.bottom - clippingRect.top,\n x: clippingRect.left,\n y: clippingRect.top\n };\n}\n\nconst platform = {\n getClippingRect,\n convertOffsetParentRelativeRectToViewportRelativeRect,\n isElement,\n getDimensions,\n getOffsetParent,\n getDocumentElement,\n getElementRects: _ref => {\n let {\n reference,\n floating,\n strategy\n } = _ref;\n return {\n reference: getRectRelativeToOffsetParent(reference, getOffsetParent(floating), strategy),\n floating: { ...getDimensions(floating),\n x: 0,\n y: 0\n }\n };\n },\n getClientRects: element => Array.from(element.getClientRects()),\n isRTL: element => getComputedStyle(element).direction === 'rtl'\n};\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n\n const {\n ancestorScroll: _ancestorScroll = true,\n ancestorResize = true,\n elementResize = true,\n animationFrame = false\n } = options;\n const ancestorScroll = _ancestorScroll && !animationFrame;\n const ancestors = ancestorScroll || ancestorResize ? [...(isElement(reference) ? getOverflowAncestors(reference) : []), ...getOverflowAncestors(floating)] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update, {\n passive: true\n });\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n let observer = null;\n\n if (elementResize) {\n let initialUpdate = true;\n observer = new ResizeObserver(() => {\n if (!initialUpdate) {\n update();\n }\n\n initialUpdate = false;\n });\n isElement(reference) && !animationFrame && observer.observe(reference);\n observer.observe(floating);\n }\n\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n\n if (animationFrame) {\n frameLoop();\n }\n\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n\n if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {\n update();\n }\n\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n\n update();\n return () => {\n var _observer;\n\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n (_observer = observer) == null ? void 0 : _observer.disconnect();\n observer = null;\n\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a reference element when it is given a certain CSS positioning\n * strategy.\n */\n\nconst computePosition = (reference, floating, options) => computePosition$1(reference, floating, {\n platform,\n ...options\n});\n\n/**\n * This module helps users provide custom configuration for component internals.\n *\n * @internal\n */\nconst configOverrides = globalThis[\"calciteComponentsConfig\"];\nconst config = {\n /**\n * We apply a custom fix to improve positioning for non-Chromium browsers.\n * The fix comes at a performance cost, so provides users a way to opt-out if necessary.\n *\n * @internal\n */\n floatingUINonChromiumPositioningFix: true,\n ...configOverrides\n};\n\nconst floatingUIBrowserCheck = patchFloatingUiForNonChromiumBrowsers();\nasync function patchFloatingUiForNonChromiumBrowsers() {\n function getUAString() {\n const uaData = navigator.userAgentData;\n if (uaData === null || uaData === void 0 ? void 0 : uaData.brands) {\n return uaData.brands.map((item) => `${item.brand}/${item.version}`).join(\" \");\n }\n return navigator.userAgent;\n }\n if (Build.isBrowser &&\n config.floatingUINonChromiumPositioningFix &&\n // ⚠️ browser-sniffing is not a best practice and should be avoided ⚠️\n /firefox|safari/i.test(getUAString())) {\n const { getClippingRect, getElementRects, getOffsetParent } = await import('./nonChromiumPlatformUtils.js');\n platform.getClippingRect = getClippingRect;\n platform.getOffsetParent = getOffsetParent;\n platform.getElementRects = getElementRects;\n }\n}\nconst placementDataAttribute = \"data-placement\";\n/**\n * Exported for testing purposes only\n */\nconst repositionDebounceTimeout = 100;\nconst effectivePlacements = [\n \"top\",\n \"bottom\",\n \"right\",\n \"left\",\n \"top-start\",\n \"top-end\",\n \"bottom-start\",\n \"bottom-end\",\n \"right-start\",\n \"right-end\",\n \"left-start\",\n \"left-end\"\n];\nconst defaultMenuPlacement = \"bottom-start\";\nconst FloatingCSS = {\n animation: \"calcite-floating-ui-anim\",\n animationActive: \"calcite-floating-ui-anim--active\"\n};\nfunction getMiddleware({ placement, disableFlip, flipPlacements, offsetDistance, offsetSkidding, arrowEl, type }) {\n const defaultMiddleware = [shift(), hide()];\n if (type === \"menu\") {\n return [\n ...defaultMiddleware,\n flip({\n fallbackPlacements: flipPlacements || [\"top-start\", \"top\", \"top-end\", \"bottom-start\", \"bottom\", \"bottom-end\"]\n })\n ];\n }\n if (type === \"popover\" || type === \"tooltip\") {\n const middleware = [\n ...defaultMiddleware,\n offset({\n mainAxis: typeof offsetDistance === \"number\" ? offsetDistance : 0,\n crossAxis: typeof offsetSkidding === \"number\" ? offsetSkidding : 0\n })\n ];\n if (placement === \"auto\" || placement === \"auto-start\" || placement === \"auto-end\") {\n middleware.push(autoPlacement({ alignment: placement === \"auto-start\" ? \"start\" : placement === \"auto-end\" ? \"end\" : null }));\n }\n else if (!disableFlip) {\n middleware.push(flip(flipPlacements ? { fallbackPlacements: flipPlacements } : {}));\n }\n if (arrowEl) {\n middleware.push(arrow({\n element: arrowEl\n }));\n }\n return middleware;\n }\n return [];\n}\nfunction filterComputedPlacements(placements, el) {\n const filteredPlacements = placements.filter((placement) => effectivePlacements.includes(placement));\n if (filteredPlacements.length !== placements.length) {\n console.warn(`${el.tagName}: Invalid value found in: flipPlacements. Try any of these: ${effectivePlacements\n .map((placement) => `\"${placement}\"`)\n .join(\", \")\n .trim()}`, { el });\n }\n return filteredPlacements;\n}\n/*\nIn floating-ui, \"*-start\" and \"*-end\" are already flipped in RTL.\nThere is no need for our \"*-leading\" and \"*-trailing\" values anymore.\nhttps://github.com/floating-ui/floating-ui/issues/1530\nhttps://github.com/floating-ui/floating-ui/issues/1563\n*/\nfunction getEffectivePlacement(floatingEl, placement) {\n const placements = [\"left\", \"right\"];\n if (getElementDir(floatingEl) === \"rtl\") {\n placements.reverse();\n }\n return placement\n .replace(/-leading/gi, \"-start\")\n .replace(/-trailing/gi, \"-end\")\n .replace(/leading/gi, placements[0])\n .replace(/trailing/gi, placements[1]);\n}\n/**\n * Convenience function to manage `reposition` calls for FloatingUIComponents that use `positionFloatingUI.\n *\n * Note: this is not needed for components that use `calcite-popover`.\n *\n * @param component\n * @param options\n * @param options.referenceEl\n * @param options.floatingEl\n * @param options.overlayPositioning\n * @param options.placement\n * @param options.disableFlip\n * @param options.flipPlacements\n * @param options.offsetDistance\n * @param options.offsetSkidding\n * @param options.arrowEl\n * @param options.type\n * @param delayed\n */\nasync function reposition(component, options, delayed = false) {\n if (!component.open) {\n return;\n }\n return delayed ? debouncedReposition(options) : positionFloatingUI(options);\n}\nconst debouncedReposition = debounce(positionFloatingUI, repositionDebounceTimeout, {\n leading: true,\n maxWait: repositionDebounceTimeout\n});\n/**\n * Positions the floating element relative to the reference element.\n *\n * **Note:** exported for testing purposes only\n *\n * @param root0\n * @param root0.referenceEl\n * @param root0.floatingEl\n * @param root0.overlayPositioning\n * @param root0.placement\n * @param root0.disableFlip\n * @param root0.flipPlacements\n * @param root0.offsetDistance\n * @param root0.offsetSkidding\n * @param root0.arrowEl\n * @param root0.type\n * @param root0.includeArrow\n */\nasync function positionFloatingUI({ referenceEl, floatingEl, overlayPositioning = \"absolute\", placement, disableFlip, flipPlacements, offsetDistance, offsetSkidding, includeArrow = false, arrowEl, type }) {\n var _a;\n if (!referenceEl || !floatingEl || (includeArrow && !arrowEl)) {\n return null;\n }\n await floatingUIBrowserCheck;\n const { x, y, placement: effectivePlacement, strategy: position, middlewareData } = await computePosition(referenceEl, floatingEl, {\n strategy: overlayPositioning,\n placement: placement === \"auto\" || placement === \"auto-start\" || placement === \"auto-end\"\n ? undefined\n : getEffectivePlacement(floatingEl, placement),\n middleware: getMiddleware({\n placement,\n disableFlip,\n flipPlacements,\n offsetDistance,\n offsetSkidding,\n arrowEl,\n type\n })\n });\n if (middlewareData === null || middlewareData === void 0 ? void 0 : middlewareData.arrow) {\n const { x: arrowX, y: arrowY } = middlewareData.arrow;\n Object.assign(arrowEl.style, {\n left: arrowX != null ? `${arrowX}px` : \"\",\n top: arrowY != null ? `${arrowY}px` : \"\"\n });\n }\n const referenceHidden = (_a = middlewareData === null || middlewareData === void 0 ? void 0 : middlewareData.hide) === null || _a === void 0 ? void 0 : _a.referenceHidden;\n const visibility = referenceHidden ? \"hidden\" : null;\n const pointerEvents = visibility ? \"none\" : null;\n floatingEl.setAttribute(placementDataAttribute, effectivePlacement);\n const transform = `translate(${Math.round(x)}px,${Math.round(y)}px)`;\n Object.assign(floatingEl.style, {\n visibility,\n pointerEvents,\n position,\n top: \"0\",\n left: \"0\",\n transform\n });\n}\n/**\n * Exported for testing purposes only\n *\n * @internal\n */\nconst cleanupMap = new WeakMap();\n/**\n * Helper to set up floating element interactions on connectedCallback.\n *\n * @param component\n * @param referenceEl\n * @param floatingEl\n */\nfunction connectFloatingUI(component, referenceEl, floatingEl) {\n if (!floatingEl || !referenceEl) {\n return;\n }\n disconnectFloatingUI(component, referenceEl, floatingEl);\n const position = component.overlayPositioning;\n // ensure position matches for initial positioning\n floatingEl.style.position = position;\n if (position === \"absolute\") {\n moveOffScreen(floatingEl);\n }\n const runAutoUpdate = Build.isBrowser\n ? autoUpdate\n : (_refEl, _floatingEl, updateCallback) => {\n updateCallback();\n return () => {\n /* noop */\n };\n };\n cleanupMap.set(component, runAutoUpdate(referenceEl, floatingEl, () => component.reposition()));\n}\n/**\n * Helper to tear down floating element interactions on disconnectedCallback.\n *\n * @param component\n * @param referenceEl\n * @param floatingEl\n */\nfunction disconnectFloatingUI(component, referenceEl, floatingEl) {\n if (!floatingEl || !referenceEl) {\n return;\n }\n getTransitionTarget(floatingEl).removeEventListener(\"transitionend\", handleTransitionElTransitionEnd);\n const cleanup = cleanupMap.get(component);\n if (cleanup) {\n cleanup();\n }\n cleanupMap.delete(component);\n}\nconst visiblePointerSize = 4;\n/**\n * Default offset the position of the floating element away from the reference element.\n *\n * @default 6\n */\nconst defaultOffsetDistance = Math.ceil(Math.hypot(visiblePointerSize, visiblePointerSize));\n/**\n * This utils applies floating element styles to avoid affecting layout when closed.\n *\n * This should be called when the closing transition will start.\n *\n * @param floatingEl\n */\nfunction updateAfterClose(floatingEl) {\n if (!floatingEl || floatingEl.style.position !== \"absolute\") {\n return;\n }\n getTransitionTarget(floatingEl).addEventListener(\"transitionend\", handleTransitionElTransitionEnd);\n}\nfunction getTransitionTarget(floatingEl) {\n // assumes floatingEl w/ shadowRoot is a FloatingUIComponent\n return floatingEl.shadowRoot || floatingEl;\n}\nfunction handleTransitionElTransitionEnd(event) {\n const floatingTransitionEl = event.target;\n if (\n // using any prop from floating-ui transition\n event.propertyName === \"opacity\" &&\n floatingTransitionEl.classList.contains(FloatingCSS.animation)) {\n const floatingEl = getFloatingElFromTransitionTarget(floatingTransitionEl);\n moveOffScreen(floatingEl);\n getTransitionTarget(floatingEl).removeEventListener(\"transitionend\", handleTransitionElTransitionEnd);\n }\n}\nfunction moveOffScreen(floatingEl) {\n floatingEl.style.transform = \"\";\n floatingEl.style.top = \"-99999px\";\n floatingEl.style.left = \"-99999px\";\n}\nfunction getFloatingElFromTransitionTarget(floatingTransitionEl) {\n return closestElementCrossShadowBoundary(floatingTransitionEl, `[${placementDataAttribute}]`);\n}\n\nexport { FloatingCSS as F, disconnectFloatingUI as a, defaultOffsetDistance as b, connectFloatingUI as c, defaultMenuPlacement as d, rectToClientRect as e, filterComputedPlacements as f, reposition as r, updateAfterClose as u };\n"],"sourceRoot":""}