: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
resizeObserver.observe(floating);
let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
const nextRefRect = getBoundingClientRect(reference);
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
prevRefRect = nextRefRect;
frameId = requestAnimationFrame(frameLoop);
ancestors.forEach(ancestor => {
ancestorScroll && ancestor.removeEventListener('scroll', update);
ancestorResize && ancestor.removeEventListener('resize', update);
cleanupIo == null || cleanupIo();
(_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();
cancelAnimationFrame(frameId);
* Optimizes the visibility of the floating element by choosing the placement
* that has the most space available automatically, without needing to specify a
* preferred placement. Alternative to `flip`.
* @see https://floating-ui.com/docs/autoPlacement
const floating_ui_dom_autoPlacement = (/* unused pure expression or super */ null && (autoPlacement$1));
* Optimizes the visibility of the floating element by shifting it in order to
* keep it in view when it will overflow the clipping boundary.
* @see https://floating-ui.com/docs/shift
const floating_ui_dom_shift = shift;
* Optimizes the visibility of the floating element by flipping the `placement`
* in order to keep it in view when the preferred placement(s) will overflow the
* clipping boundary. Alternative to `autoPlacement`.
* @see https://floating-ui.com/docs/flip
const floating_ui_dom_flip = flip;
* Provides data that allows you to change the size of the floating element —
* for instance, prevent it from overflowing the clipping boundary or match the
* width of the reference element.
* @see https://floating-ui.com/docs/size
const floating_ui_dom_size = size;
* Provides data to hide the floating element in applicable situations, such as
* when it is not in the same clipping context as the reference element.
* @see https://floating-ui.com/docs/hide
const floating_ui_dom_hide = (/* unused pure expression or super */ null && (hide$1));
* Provides data to position an inner element of the floating element so that it
* appears centered to the reference element.
* @see https://floating-ui.com/docs/arrow
const floating_ui_dom_arrow = arrow;
* Provides improved positioning for inline reference elements that can span
* over multiple lines, such as hyperlinks or range selections.
* @see https://floating-ui.com/docs/inline
const floating_ui_dom_inline = (/* unused pure expression or super */ null && (inline$1));
* Built-in `limiter` that will stop `shift()` at a certain point.
const floating_ui_dom_limitShift = limitShift;
* Computes the `x` and `y` coordinates that will place the floating element
* next to a given reference element.
const floating_ui_dom_computePosition = (reference, floating, options) => {
// This caches the expensive `getClippingElementAncestors` function so that
// multiple lifecycle resets re-use the same result. It only lives for a
// single call. If other functions become expensive, we can add them as well.
const platformWithCache = {
...mergedOptions.platform,
return computePosition(reference, floating, {
platform: platformWithCache
;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/IRX7SFUJ.js
// src/popover/popover.tsx
function createDOMRect(x = 0, y = 0, width = 0, height = 0) {
if (typeof DOMRect === "function") {
return new DOMRect(x, y, width, height);
return _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, rect), { toJSON: () => rect });
function getDOMRect(anchorRect) {
const { x, y, width, height } = anchorRect;
return createDOMRect(x, y, width, height);
function getAnchorElement(anchorElement, getAnchorRect) {
const contextElement = anchorElement || void 0;
getBoundingClientRect: () => {
const anchor = anchorElement;
const anchorRect = getAnchorRect == null ? void 0 : getAnchorRect(anchor);
if (anchorRect || !anchor) {
return getDOMRect(anchorRect);
return anchor.getBoundingClientRect();
function isValidPlacement(flip2) {
return /^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(flip2);
function roundByDPR(value) {
const dpr = window.devicePixelRatio || 1;
return Math.round(value * dpr) / dpr;
function getOffsetMiddleware(arrowElement, props) {
return offset(({ placement }) => {
const arrowOffset = ((arrowElement == null ? void 0 : arrowElement.clientHeight) || 0) / 2;
const finalGutter = typeof props.gutter === "number" ? props.gutter + arrowOffset : (_a = props.gutter) != null ? _a : arrowOffset;
const hasAlignment = !!placement.split("-")[1];
crossAxis: !hasAlignment ? props.shift : void 0,
alignmentAxis: props.shift
function getFlipMiddleware(props) {
if (props.flip === false)
const fallbackPlacements = typeof props.flip === "string" ? props.flip.split(" ") : void 0;
!fallbackPlacements || fallbackPlacements.every(isValidPlacement),
return floating_ui_dom_flip({
padding: props.overflowPadding,
function getShiftMiddleware(props) {
if (!props.slide && !props.overlap)
return floating_ui_dom_shift({
crossAxis: props.overlap,
padding: props.overflowPadding,
limiter: floating_ui_dom_limitShift()
function getSizeMiddleware(props) {
return floating_ui_dom_size({
padding: props.overflowPadding,
apply({ elements, availableWidth, availableHeight, rects }) {
const wrapper = elements.floating;
const referenceWidth = Math.round(rects.reference.width);
availableWidth = Math.floor(availableWidth);
availableHeight = Math.floor(availableHeight);
wrapper.style.setProperty(
"--popover-anchor-width",
wrapper.style.setProperty(
"--popover-available-width",
wrapper.style.setProperty(
"--popover-available-height",
wrapper.style.width = `${referenceWidth}px`;
wrapper.style.maxWidth = `${availableWidth}px`;
wrapper.style.maxHeight = `${availableHeight}px`;
function getArrowMiddleware(arrowElement, props) {
return floating_ui_dom_arrow({
padding: props.arrowPadding
var usePopover = createHook(
} = _b, props = __objRest(_b, [
const context = usePopoverProviderContext();
store = store || context;
const arrowElement = store.useState("arrowElement");
const anchorElement = store.useState("anchorElement");
const disclosureElement = store.useState("disclosureElement");
const popoverElement = store.useState("popoverElement");
const contentElement = store.useState("contentElement");
const placement = store.useState("placement");
const mounted = store.useState("mounted");
const rendered = store.useState("rendered");
const [positioned, setPositioned] = (0,external_React_.useState)(false);
const { portalRef, domReady } = usePortalRef(portal, props.portalRef);
const getAnchorRectProp = useEvent(getAnchorRect);
const updatePositionProp = useEvent(updatePosition);
const hasCustomUpdatePosition = !!updatePosition;
useSafeLayoutEffect(() => {
if (!(popoverElement == null ? void 0 : popoverElement.isConnected))
popoverElement.style.setProperty(
"--popover-overflow-padding",
const anchor = getAnchorElement(anchorElement, getAnchorRectProp);
const updatePosition2 = async () => {
getOffsetMiddleware(arrowElement, { gutter, shift: shift2 }),
getFlipMiddleware({ flip: flip2, overflowPadding }),
getShiftMiddleware({ slide, shift: shift2, overlap, overflowPadding }),
getArrowMiddleware(arrowElement, { arrowPadding }),
const pos = await floating_ui_dom_computePosition(anchor, popoverElement, {
strategy: fixed ? "fixed" : "absolute",
store == null ? void 0 : store.setState("currentPlacement", pos.placement);
const x = roundByDPR(pos.x);
const y = roundByDPR(pos.y);
Object.assign(popoverElement.style, {
transform: `translate3d(${x}px,${y}px,0)`
if (arrowElement && pos.middlewareData.arrow) {
const { x: arrowX, y: arrowY } = pos.middlewareData.arrow;
const dir = pos.placement.split("-")[0];
Object.assign(arrowElement.style, {
left: arrowX != null ? `${arrowX}px` : "",
top: arrowY != null ? `${arrowY}px` : "",
const update = async () => {
if (hasCustomUpdatePosition) {
await updatePositionProp({ updatePosition: updatePosition2 });
const cancelAutoUpdate = autoUpdate(anchor, popoverElement, update, {
// JSDOM doesn't support ResizeObserver
elementResize: typeof ResizeObserver === "function"
useSafeLayoutEffect(() => {
if (!(popoverElement == null ? void 0 : popoverElement.isConnected))
if (!(contentElement == null ? void 0 : contentElement.isConnected))
const applyZIndex = () => {
popoverElement.style.zIndex = getComputedStyle(contentElement).zIndex;
let raf = requestAnimationFrame(() => {
raf = requestAnimationFrame(applyZIndex);
return () => cancelAnimationFrame(raf);
}, [mounted, domReady, popoverElement, contentElement]);
const position = fixed ? "fixed" : "absolute";
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({
style: _4R3V3JGP_spreadValues({
// https://floating-ui.com/docs/computeposition#initial-layout
}, wrapperProps == null ? void 0 : wrapperProps.style),
ref: store == null ? void 0 : store.setPopoverElement,
[store, position, wrapperProps]
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PopoverScopedContextProvider, { value: store, children: element }),
props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({
// data-placing is not part of the public API. We're setting this here so
// we can wait for the popover to be positioned before other components
// move focus into it. For example, this attribute is observed by the
// Combobox component with the autoSelect behavior.
"data-placing": !positioned ? "" : void 0
style: _4R3V3JGP_spreadValues({
props = useDialog(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({
preserveTabOrderAnchor: disclosureElement || anchorElement,
autoFocusOnShow: positioned && autoFocusOnShow
var Popover = createDialogComponent(
createComponent((props) => {
const htmlProps = usePopover(props);
return _3ORBWXWF_createElement("div", htmlProps);
usePopoverProviderContext
;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/QWSZGSIG.js
// src/hovercard/hovercard.tsx
function isMovingOnHovercard(target, card, anchor, nested) {
if (hasFocusWithin(card))
if (contains(card, target))
if (anchor && contains(anchor, target))
if (nested == null ? void 0 : nested.some((card2) => isMovingOnHovercard(target, card2, anchor))) {