import { getAuthAPI } from "../libs/auth.mjs";
import { useAuth } from "./useAuth/useAuth.mjs";
import { useConfiguration } from "@intlayer/editor-react";
import { getIntlayerAPI } from "@intlayer/api";

//#region src/hooks/useIntlayerAPI.ts
const useIntlayerOAuth = (props) => {
	const configuration = useConfiguration();
	const { oAuth2AccessToken } = useAuth();
	return getIntlayerAPI({
		...oAuth2AccessToken && { headers: { Authorization: `Bearer ${oAuth2AccessToken.accessToken}` } },
		...props?.options ?? {}
	}, props?.intlayerConfiguration ?? configuration);
};
const useIntlayerAuth = (props) => {
	const configuration = useConfiguration();
	return getAuthAPI(props?.intlayerConfiguration ?? configuration);
};

//#endregion
export { useIntlayerAuth, useIntlayerOAuth };
//# sourceMappingURL=useIntlayerAPI.mjs.map