import { Children, isValidElement } from "react";
const __SLOT_NAME = Symbol('__SLOT_NAME');
export function processOneSlot(child, out, slots) {
    let slotName;
    if (isValidElement(child) && (slotName = child.type[__SLOT_NAME])) {
        slots[slotName] = child;
    }
    else {
        out.push(child);
    }
}
export function processSlots(children, slots) {
    const out = [];
    Children.forEach(children, child => {
        processOneSlot(child, out, slots);
    });
    return out.length > 1 ? out : out[0];
}
export function defineSlot(name, component) {
    component[__SLOT_NAME] = name;
}
//# sourceMappingURL=slots.js.map