import React from "react";
import { AppleWebAppMeta, FormatDetectionMeta, ItunesMeta, BasicMetadata, VerificationMeta } from "./generate/basic";
import { AlternatesMetadata } from "./generate/alternate";
import { OpenGraphMetadata, TwitterMetadata, AppLinksMeta } from "./generate/opengraph";
import { IconsMetadata } from "./generate/icons";
import { accumulateMetadata, resolveMetadata } from "./resolve-metadata";
import { MetaFilter } from "./generate/meta";
// Generate the actual React elements from the resolved metadata.
export async function MetadataTree({ tree , pathname , searchParams , getDynamicParamFromSegment  }) {
    const options = {
        pathname
    };
    const resolvedMetadata = await resolveMetadata({
        tree,
        parentParams: {},
        metadataItems: [],
        searchParams,
        getDynamicParamFromSegment
    });
    const metadata = await accumulateMetadata(resolvedMetadata, options);
    const elements = MetaFilter([
        BasicMetadata({
            metadata
        }),
        AlternatesMetadata({
            alternates: metadata.alternates
        }),
        ItunesMeta({
            itunes: metadata.itunes
        }),
        FormatDetectionMeta({
            formatDetection: metadata.formatDetection
        }),
        VerificationMeta({
            verification: metadata.verification
        }),
        AppleWebAppMeta({
            appleWebApp: metadata.appleWebApp
        }),
        OpenGraphMetadata({
            openGraph: metadata.openGraph
        }),
        TwitterMetadata({
            twitter: metadata.twitter
        }),
        AppLinksMeta({
            appLinks: metadata.appLinks
        }),
        IconsMetadata({
            icons: metadata.icons
        })
    ]);
    // Wrap with fragment and key to skip react array-key warnings.
    return /*#__PURE__*/ React.createElement(React.Fragment, null, elements);
}

//# sourceMappingURL=metadata.js.map