"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "getVisibleItems", {
    enumerable: true,
    get: function() {
        return getVisibleItems;
    }
});
const getVisibleItems = (items)=>items.reduce((acc, item)=>{
        if (item.hidden) {
            return acc;
        }
        if (!item.items) {
            acc.push(item);
            return acc;
        }
        const visibleInnerItems = getVisibleItems(item.items);
        acc.push({
            ...item,
            items: visibleInnerItems.length ? visibleInnerItems : undefined
        });
        return acc;
    }, []);
