: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
const onMouseDown = (event) => {
previousMouseDownRef.current = event.target;
return addGlobalEventListener("mousedown", onMouseDown, true);
return previousMouseDownRef;
;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/XHJGS6Z5.js
// src/dialog/utils/use-hide-on-interact-outside.ts
function isInDocument(target) {
if (target.tagName === "HTML")
return contains(DLOEKDPY_getDocument(target).body, target);
function isDisclosure(disclosure, target) {
if (contains(disclosure, target))
const activeId = target.getAttribute("aria-activedescendant");
const activeElement = DLOEKDPY_getDocument(disclosure).getElementById(activeId);
return contains(disclosure, activeElement);
function isMouseEventOnDialog(event, dialog) {
if (!("clientY" in event))
const rect = dialog.getBoundingClientRect();
if (rect.width === 0 || rect.height === 0)
return rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width;
function useEventOutside({
const callListener = useEvent(listener);
const open = store.useState("open");
const focusedRef = (0,external_React_.useRef)(false);
useSafeLayoutEffect(() => {
const { contentElement } = store.getState();
focusedRef.current = true;
contentElement.addEventListener("focusin", onFocus, true);
return () => contentElement.removeEventListener("focusin", onFocus, true);
}, [store, open, domReady]);
(0,external_React_.useEffect)(() => {
const onEvent = (event) => {
const { contentElement, disclosureElement } = store.getState();
const target = event.target;
if (!isInDocument(target))
if (contains(contentElement, target))
if (isDisclosure(disclosureElement, target))
if (target.hasAttribute("data-focus-trap"))
if (isMouseEventOnDialog(event, contentElement))
const focused = focusedRef.current;
if (focused && !isElementMarked(target, contentElement.id))
return addGlobalEventListener(type, onEvent, capture);
function shouldHideOnInteractOutside(hideOnInteractOutside, event) {
if (typeof hideOnInteractOutside === "function") {
return hideOnInteractOutside(event);
return !!hideOnInteractOutside;
function useHideOnInteractOutside(store, hideOnInteractOutside, domReady) {
const open = store.useState("open");
const previousMouseDownRef = usePreviousMouseDownRef(open);
const props = { store, domReady, capture: true };
useEventOutside(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), {
const { contentElement } = store.getState();
const previousMouseDown = previousMouseDownRef.current;
if (!isVisible(previousMouseDown))
if (!isElementMarked(previousMouseDown, contentElement == null ? void 0 : contentElement.id))
if (!shouldHideOnInteractOutside(hideOnInteractOutside, event))
useEventOutside(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), {
const { contentElement } = store.getState();
if (event.target === DLOEKDPY_getDocument(contentElement))
if (!shouldHideOnInteractOutside(hideOnInteractOutside, event))
useEventOutside(_4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), {
if (!shouldHideOnInteractOutside(hideOnInteractOutside, event))
;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/6GXEOXGT.js
// src/dialog/utils/prepend-hidden-dismiss.ts
function prependHiddenDismiss(container, onClick) {
const document = DLOEKDPY_getDocument(container);
const button = document.createElement("button");
button.textContent = "Dismiss popup";
Object.assign(button.style, {
button.addEventListener("click", onClick);
container.prepend(button);
const removeHiddenDismiss = () => {
button.removeEventListener("click", onClick);
return removeHiddenDismiss;
;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/HPP6CWMY.js
// src/focusable/focusable-container.tsx
var useFocusableContainer = createHook(
var _b = _a, { autoFocusOnShow = true } = _b, props = __objRest(_b, ["autoFocusOnShow"]);
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(FocusableContext.Provider, { value: autoFocusOnShow, children: element }),
var FocusableContainer = createComponent(
const htmlProps = useFocusableContainer(props);
return _3ORBWXWF_createElement("div", htmlProps);
;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/XPF5GU3Q.js
// src/heading/heading-context.ts
var HeadingContext = (0,external_React_.createContext)(0);
;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/UYRJLDVS.js
// src/heading/heading-level.tsx
function HeadingLevel({ level, children }) {
const contextLevel = (0,external_React_.useContext)(HeadingContext);
const nextLevel = Math.max(
Math.min(level || contextLevel + 1, 6),
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(HeadingContext.Provider, { value: nextLevel, children });
;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/BG6HZDS7.js
// src/visually-hidden/visually-hidden.ts
var useVisuallyHidden = createHook((props) => {
props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({}, props), {
style: _4R3V3JGP_spreadValues({
var VisuallyHidden = createComponent(
const htmlProps = useVisuallyHidden(props);
return _3ORBWXWF_createElement("span", htmlProps);
;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/CHKJ74UC.js
// src/focus-trap/focus-trap.ts
var useFocusTrap = createHook((props) => {
props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({
style: _4R3V3JGP_spreadValues({
// Prevents unintended scroll jumps.
props = useVisuallyHidden(props);
var FocusTrap = createComponent((props) => {
const htmlProps = useFocusTrap(props);
return _3ORBWXWF_createElement("span", htmlProps);
;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/7452U3HH.js
// src/portal/portal-context.ts
var PortalContext = (0,external_React_.createContext)(null);
;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/JPXNJYSO.js
function getRootElement(element) {
return DLOEKDPY_getDocument(element).body;
function getPortalElement(element, portalElement) {
return DLOEKDPY_getDocument(element).createElement("div");
if (typeof portalElement === "function") {
return portalElement(element);
function getRandomId(prefix = "id") {
return `${prefix ? `${prefix}-` : ""}${Math.random().toString(36).substr(2, 6)}`;
function queueFocus(element) {
element == null ? void 0 : element.focus();
var usePortal = createHook(
} = _b, props = __objRest(_b, [
"preserveTabOrderAnchor",
const ref = (0,external_React_.useRef)(null);
const refProp = useMergeRefs(ref, props.ref);
const context = (0,external_React_.useContext)(PortalContext);
const [portalNode, setPortalNode] = (0,external_React_.useState)(null);
const [anchorPortalNode, setAnchorPortalNode] = (0,external_React_.useState)(null);
const outerBeforeRef = (0,external_React_.useRef)(null);
const innerBeforeRef = (0,external_React_.useRef)(null);
const innerAfterRef = (0,external_React_.useRef)(null);
const outerAfterRef = (0,external_React_.useRef)(null);
useSafeLayoutEffect(() => {
const element = ref.current;
if (!element || !portal) {
const portalEl = getPortalElement(element, portalElement);
const isPortalInDocument = portalEl.isConnected;
if (!isPortalInDocument) {
const rootElement = context || getRootElement(element);
rootElement.appendChild(portalEl);
portalEl.id = element.id ? `portal/${element.id}` : getRandomId();
setRef(portalRef, portalEl);
}, [portal, portalElement, context, portalRef]);
useSafeLayoutEffect(() => {
if (!preserveTabOrderAnchor)
const doc = DLOEKDPY_getDocument(preserveTabOrderAnchor);
const element = doc.createElement("span");
element.style.position = "fixed";
preserveTabOrderAnchor.insertAdjacentElement("afterend", element);
setAnchorPortalNode(element);
setAnchorPortalNode(null);
}, [preserveTabOrder, preserveTabOrderAnchor]);
(0,external_React_.useEffect)(() => {
const onFocus = (event) => {
if (!isFocusEventOutside(event))
const focusing = event.type === "focusin";
cancelAnimationFrame(raf);
return restoreFocusIn(portalNode);
raf = requestAnimationFrame(() => {
disableFocusIn(portalNode, true);
portalNode.addEventListener("focusin", onFocus, true);
portalNode.addEventListener("focusout", onFocus, true);
cancelAnimationFrame(raf);
portalNode.removeEventListener("focusin", onFocus, true);
portalNode.removeEventListener("focusout", onFocus, true);
}, [portalNode, preserveTabOrder]);
element = // While the portal node is not in the DOM, we need to pass the
// current context to the portal context, otherwise it's going to
// reset to the body element on nested portals.
/* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(PortalContext.Provider, { value: portalNode || context, children: element });
return /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
style: { position: "fixed" },
element = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
preserveTabOrder && portalNode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
className: "__focus-trap-inner-before",
if (isFocusEventOutside(event, portalNode)) {
queueFocus(getNextTabbable());
queueFocus(outerBeforeRef.current);
preserveTabOrder && portalNode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(
className: "__focus-trap-inner-after",
if (isFocusEventOutside(event, portalNode)) {
queueFocus(getPreviousTabbable());
queueFocus(outerAfterRef.current);
element = (0,external_ReactDOM_namespaceObject.createPortal)(element, portalNode);
let preserveTabOrderElement = /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, { children: [
preserveTabOrder && portalNode && /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(