"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const reactClient = require("@contember/react-client");
const react = require("react");
const variables = require("../../lib/variables.cjs");
const useSingleTenantMutation = require("../../lib/useSingleTenantMutation.cjs");
const INIT_SIGN_IN_IDP_MUTATION = `
initSignInIDP(redirectUrl: $redirectUrl, identityProvider: $identityProvider) {
	ok
	error {
		code
		developerMessage
	}
	result {
		authUrl
		sessionData
	}
}
`;
const initSignInIdpVariables = {
  redirectUrl: variables.GQLVariable.Required(variables.GQLVariable.String),
  identityProvider: variables.GQLVariable.Required(variables.GQLVariable.String)
};
const useInitSignInIDP = () => {
  const loginToken = reactClient.useLoginToken();
  return useSingleTenantMutation.useSingleTenantMutation(
    INIT_SIGN_IN_IDP_MUTATION,
    initSignInIdpVariables,
    react.useMemo(() => ({
      apiTokenOverride: loginToken
    }), [loginToken])
  );
};
exports.useInitSignInIDP = useInitSignInIDP;
//# sourceMappingURL=initSignInIDP.cjs.map
