function findChildren(vnode) {
  if (!vnode || typeof vnode !== "object") {
    return [];
  }
  if (Array.isArray(vnode)) {
    return vnode.map((child) => findChildren(child)).filter((v) => v).flat(1);
  } else if (Array.isArray(vnode.children)) {
    return vnode.children.map((child) => findChildren(child)).filter((v) => v).flat(1);
  } else if (vnode.component) {
    return [vnode.component, ...findChildren(vnode.component?.subTree)].filter((v) => v).flat(1);
  }
  return [];
}
function findChildrenWithProvide(provide, vnode) {
  return findChildren(vnode).slice(1).filter((cmp) => !!cmp.provides[provide]);
}
export {
  findChildren,
  findChildrenWithProvide
};
//# sourceMappingURL=helpers.mjs.map
