: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
const activeItem = allItems.find((item) => item.id === activeId2);
return (_b = IERTEJ3A_findFirstEnabledItem(allItems)) == null ? void 0 : _b.id;
const isGrid = !!activeItem.rowId;
const activeIndex = allItems.indexOf(activeItem);
const nextItems = allItems.slice(activeIndex + 1);
const nextItemsInRow = getItemsInRow(nextItems, activeItem.rowId);
const nextEnabledItemsInRow = getEnabledItems(nextItemsInRow, activeId2);
const nextItem2 = nextEnabledItemsInRow.slice(skip)[0] || // If we can't find an item, just return the last one.
nextEnabledItemsInRow[nextEnabledItemsInRow.length - 1];
return nextItem2 == null ? void 0 : nextItem2.id;
const oppositeOrientation = getOppositeOrientation(
// If it's a grid and orientation is not set, it's a next/previous call,
// which is inherently horizontal. up/down will call next with orientation
// set to vertical by default (see below on up/down methods).
isGrid ? orientation || "horizontal" : orientation
const canLoop = focusLoop && focusLoop !== oppositeOrientation;
const canWrap = isGrid && focusWrap && focusWrap !== oppositeOrientation;
hasNullItem = hasNullItem || !isGrid && canLoop && includesBaseElement;
const loopItems = canWrap && !hasNullItem ? allItems : getItemsInRow(allItems, activeItem.rowId);
const sortedItems = IERTEJ3A_flipItems(loopItems, activeId2, hasNullItem);
const nextItem2 = IERTEJ3A_findFirstEnabledItem(sortedItems, activeId2);
return nextItem2 == null ? void 0 : nextItem2.id;
const nextItem2 = IERTEJ3A_findFirstEnabledItem(
// We can use nextItems, which contains all the next items, including
// items from other rows, to wrap between rows. However, if there is a
// null item (the composite container), we'll only use the next items in
// the row. So moving next from the last item will focus on the
// composite container. On grid composites, horizontal navigation never
// focuses on the composite container, only vertical.
hasNullItem ? nextItemsInRow : nextItems,
const nextId = hasNullItem ? (nextItem2 == null ? void 0 : nextItem2.id) || null : nextItem2 == null ? void 0 : nextItem2.id;
const nextItem = IERTEJ3A_findFirstEnabledItem(nextItemsInRow, activeId2);
if (!nextItem && hasNullItem) {
return nextItem == null ? void 0 : nextItem.id;
return _chunks_4R3V3JGP_spreadProps(_chunks_4R3V3JGP_spreadValues(_chunks_4R3V3JGP_spreadValues({}, collection), composite), {
setBaseElement: (element) => composite.setState("baseElement", element),
setActiveId: (id) => composite.setState("activeId", id),
composite.setState("activeId", id);
composite.setState("moves", (moves) => moves + 1);
return (_a2 = IERTEJ3A_findFirstEnabledItem(composite.getState().renderedItems)) == null ? void 0 : _a2.id;
return (_a2 = IERTEJ3A_findFirstEnabledItem(reverseArray(composite.getState().renderedItems))) == null ? void 0 : _a2.id;
const { renderedItems, orientation } = composite.getState();
return getNextId(renderedItems, orientation, false, skip);
const { renderedItems, orientation, includesBaseElement } = composite.getState();
const isGrid = !!((_a2 = IERTEJ3A_findFirstEnabledItem(renderedItems)) == null ? void 0 : _a2.rowId);
const hasNullItem = !isGrid && includesBaseElement;
reverseArray(renderedItems),
} = composite.getState();
const shouldShift = focusShift && !skip;
const verticalItems = verticalizeItems(
normalizeRows(IERTEJ3A_groupItemsByRows(renderedItems), activeId2, shouldShift)
const canLoop = focusLoop && focusLoop !== "horizontal";
const hasNullItem = canLoop && includesBaseElement;
return getNextId(verticalItems, "vertical", hasNullItem, skip);
const { activeId: activeId2, renderedItems, focusShift, includesBaseElement } = composite.getState();
const shouldShift = focusShift && !skip;
const verticalItems = verticalizeItems(
IERTEJ3A_groupItemsByRows(renderedItems),
const hasNullItem = includesBaseElement;
return getNextId(verticalItems, "vertical", hasNullItem, skip);
;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/7GBW5FLS.js
// src/composite/composite-store.ts
function useCompositeStoreProps(store, update, props) {
store = useCollectionStoreProps(store, update, props);
useStoreProps(store, props, "activeId", "setActiveId");
useStoreProps(store, props, "includesBaseElement");
useStoreProps(store, props, "virtualFocus");
useStoreProps(store, props, "orientation");
useStoreProps(store, props, "rtl");
useStoreProps(store, props, "focusLoop");
useStoreProps(store, props, "focusWrap");
useStoreProps(store, props, "focusShift");
function useCompositeStore(props = {}) {
const [store, update] = EKQEJRUF_useStore(createCompositeStore, props);
return useCompositeStoreProps(store, update, props);
;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/7QTPYGNZ.js
// src/composite/composite.tsx
return items.some((item) => !!item.rowId);
function isPrintableKey(event) {
const target = event.target;
if (target && !DLOEKDPY_isTextField(target))
return event.key.length === 1 && !event.ctrlKey && !event.metaKey;
function isModifierKey(event) {
return event.key === "Shift" || event.key === "Control" || event.key === "Alt" || event.key === "Meta";
function useKeyboardEventProxy(store, onKeyboardEvent, previousElementRef) {
return useEvent((event) => {
onKeyboardEvent == null ? void 0 : onKeyboardEvent(event);
if (event.defaultPrevented)
if (event.isPropagationStopped())
if (!isSelfTarget(event))
if (isModifierKey(event))
if (isPrintableKey(event))
const state = store.getState();
const activeElement = (_a = getEnabledItem(store, state.activeId)) == null ? void 0 : _a.element;
const _b = event, { view } = _b, eventInit = __objRest(_b, ["view"]);
const previousElement = previousElementRef == null ? void 0 : previousElementRef.current;
if (activeElement !== previousElement) {
if (!fireKeyboardEvent(activeElement, event.type, eventInit)) {
if (event.currentTarget.contains(activeElement)) {
function findFirstEnabledItemInTheLastRow(items) {
return findFirstEnabledItem(
flatten2DArray(reverseArray(groupItemsByRows(items)))
function useScheduleFocus(store) {
const [scheduled, setScheduled] = (0,external_React_.useState)(false);
const schedule = (0,external_React_.useCallback)(() => setScheduled(true), []);
const activeItem = store.useState(
(state) => getEnabledItem(store, state.activeId)
(0,external_React_.useEffect)(() => {
const activeElement = activeItem == null ? void 0 : activeItem.element;
activeElement.focus({ preventScroll: true });
}, [activeItem, scheduled]);
var useComposite = createHook(
} = _b, props = __objRest(_b, [
const context = useCompositeProviderContext();
store = store || context;
const previousElementRef = (0,external_React_.useRef)(null);
const scheduleFocus = useScheduleFocus(store);
const moves = store.useState("moves");
(0,external_React_.useEffect)(() => {
const { activeId: activeId2 } = store.getState();
const itemElement = (_a2 = getEnabledItem(store, activeId2)) == null ? void 0 : _a2.element;
focusIntoView(itemElement);
}, [store, moves, composite, focusOnMove]);
useSafeLayoutEffect(() => {
const { baseElement, activeId: activeId2 } = store.getState();
const isSelfAcive = activeId2 === null;
const previousElement = previousElementRef.current;
previousElementRef.current = null;
fireBlurEvent(previousElement, { relatedTarget: baseElement });
if (!hasFocus(baseElement)) {
}, [store, moves, composite]);
const activeId = store.useState("activeId");
const virtualFocus = store.useState("virtualFocus");
useSafeLayoutEffect(() => {
const previousElement = previousElementRef.current;
previousElementRef.current = null;
const activeElement = (_a2 = getEnabledItem(store, activeId)) == null ? void 0 : _a2.element;
const relatedTarget = activeElement || getActiveElement(previousElement);
if (relatedTarget === previousElement)
fireBlurEvent(previousElement, { relatedTarget });
}, [store, activeId, virtualFocus, composite]);
const onKeyDownCapture = useKeyboardEventProxy(
const onKeyUpCapture = useKeyboardEventProxy(
const onFocusCaptureProp = props.onFocusCapture;
const onFocusCapture = useEvent((event) => {
onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event);
if (event.defaultPrevented)
const { virtualFocus: virtualFocus2 } = store.getState();
const previousActiveElement = event.relatedTarget;
const isSilentlyFocused = silentlyFocused(event.currentTarget);
if (isSelfTarget(event) && isSilentlyFocused) {
previousElementRef.current = previousActiveElement;
const onFocusProp = props.onFocus;
const onFocus = useEvent((event) => {
onFocusProp == null ? void 0 : onFocusProp(event);
if (event.defaultPrevented)
const { relatedTarget } = event;
const { virtualFocus: virtualFocus2 } = store.getState();
if (isSelfTarget(event) && !isItem(store, relatedTarget)) {
queueMicrotask(scheduleFocus);
} else if (isSelfTarget(event)) {
const onBlurCaptureProp = props.onBlurCapture;
const onBlurCapture = useEvent((event) => {
onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event);
if (event.defaultPrevented)
const { virtualFocus: virtualFocus2, activeId: activeId2 } = store.getState();
const activeElement = (_a2 = getEnabledItem(store, activeId2)) == null ? void 0 : _a2.element;
const nextActiveElement = event.relatedTarget;
const nextActiveElementIsItem = isItem(store, nextActiveElement);
const previousElement = previousElementRef.current;
previousElementRef.current = null;
if (isSelfTarget(event) && nextActiveElementIsItem) {
if (nextActiveElement === activeElement) {
if (previousElement && previousElement !== nextActiveElement) {
fireBlurEvent(previousElement, event);
} else if (activeElement) {
fireBlurEvent(activeElement, event);
} else if (previousElement) {
fireBlurEvent(previousElement, event);
const targetIsItem = isItem(store, event.target);
if (!targetIsItem && activeElement) {
fireBlurEvent(activeElement, event);
const onKeyDownProp = props.onKeyDown;
const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress);
const onKeyDown = useEvent((event) => {
onKeyDownProp == null ? void 0 : onKeyDownProp(event);
if (event.defaultPrevented)
if (!isSelfTarget(event))
const { orientation, items, renderedItems, activeId: activeId2 } = store.getState();
const activeItem = getEnabledItem(store, activeId2);
if ((_a2 = activeItem == null ? void 0 : activeItem.element) == null ? void 0 : _a2.isConnected)
const isVertical = orientation !== "horizontal";
const isHorizontal = orientation !== "vertical";
const grid = isGrid(renderedItems);
const isHorizontalKey = event.key === "ArrowLeft" || event.key === "ArrowRight" || event.key === "Home" || event.key === "End";
if (isHorizontalKey && DLOEKDPY_isTextField(event.currentTarget))
const item = items && findFirstEnabledItemInTheLastRow(items);
return item == null ? void 0 : item.id;
return store == null ? void 0 : store.last();
ArrowUp: (grid || isVertical) && up,
ArrowRight: (grid || isHorizontal) && store.first,
ArrowDown: (grid || isVertical) && store.first,
ArrowLeft: (grid || isHorizontal) && store.last,
const action = keyMap[event.key];
if (!moveOnKeyPressProp(event))
(element) => /* @__PURE__ */ (0,external_ReactJSXRuntime_namespaceObject.jsx)(CompositeContextProvider, { value: store, children: element }),
const activeDescendant = store.useState((state) => {
return (_a2 = getEnabledItem(store, state.activeId)) == null ? void 0 : _a2.id;
props = _4R3V3JGP_spreadProps(_4R3V3JGP_spreadValues({
"aria-activedescendant": activeDescendant
ref: useMergeRefs(composite ? store.setBaseElement : null, props.ref),
const focusable = store.useState(
(state) => composite && (state.virtualFocus || state.activeId === null)
props = useFocusable(_4R3V3JGP_spreadValues({ focusable }, props));
var Composite = createComponent((props) => {
const htmlProps = useComposite(props);
return _3ORBWXWF_createElement("div", htmlProps);
;// CONCATENATED MODULE: ./node_modules/@ariakit/react-core/esm/__chunks/BNUFNEVY.js
// src/composite/composite-row.tsx
var useCompositeRow = createHook(
"aria-setsize": ariaSetSize,
"aria-posinset": ariaPosInSet
} = _b, props = __objRest(_b, [