// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.
import { createContext, useMemo } from '@lynx-js/react';
import { resolveCatalog } from '../catalog/defineCatalog.js';
export const A2UIContext = createContext(null);
/**
 * Internal provider mounted by `<A2UI>`. Not exported from the package.
 */
export function A2UIProvider(props) {
    const { processor, catalog, children } = props;
    const value = useMemo(() => ({
        processor,
        catalog,
        catalogMap: resolveCatalog(catalog),
    }), [processor, catalog]);
    return <A2UIContext.Provider value={value}>{children}</A2UIContext.Provider>;
}
//# sourceMappingURL=A2UIProvider.jsx.map