/**
 * mizan/allauth
 *
 * React integration for django-allauth headless API.
 * Framework-agnostic - works with Next.js, Remix, React Router, etc.
 *
 * ## Quick Start (Next.js)
 *
 * ```tsx
 * // layout.tsx
 * import { cookies } from 'next/headers'
 * import { createDjangoSSRClient } from 'mizan/client'
 * import { getInitialAuth } from 'mizan/allauth'
 * import { NextAllauthContext } from 'mizan/allauth/nextjs'
 *
 * export default async function RootLayout({ children }) {
 *     const ssrClient = createDjangoSSRClient({ cookies: await cookies() })
 *     const hydration = await getInitialAuth(ssrClient)
 *
 *     return (
 *         <NextAllauthContext hydration={hydration}>
 *             {children}
 *         </NextAllauthContext>
 *     )
 * }
 * ```
 *
 * ## Without SSR (pure client-side)
 *
 * ```tsx
 * // Just omit hydration - AllauthContext will fetch client-side
 * <NextAllauthContext>
 *     {children}
 * </NextAllauthContext>
 * ```
 */

// Configuration
export { createAllauthConfig, defaultConfig, DjangoFlowPaths } from './config'
export type { AllauthConfig } from './config'

// Hydration
export { getInitialAuth } from './hydration'
export type { InitialAuth } from './hydration'

// Providers
export { AllauthContext } from './contexts/AllauthContext'
export type { AllauthContextProps } from './contexts/AllauthContext'

// Router adapter
export type { RouterAdapter } from './adapters/router'
export { useRouter } from './contexts/RouterContext'

// Hooks
export { useAuthContext, useAuth, useUser, useConfig, useFeatures } from './contexts/AuthContext'
export { useAllauthAPI } from './contexts/APIContext'
export { useAllauthConfig } from './contexts/ConfigContext'
export { useStyles, cx } from './contexts/StylesContext'

// Styling
export type { AuthClassNames } from './styles/types'

// Components
export {
    // Main UI component (SPA - handles login, signup, MFA, settings, logout)
    AllauthUI,
    // Django-initiated flow handler (email verification, password reset links, OAuth)
    AllauthRouter,
    // Settings
    AuthSettings,
    ProfileSection,
    EmailsSection,
    PasswordSection,
    PasskeysSection,
    ConnectionsSection,
    MFASection,
    SessionsSection,
    SettingsSection,
    SettingsItem,
    SettingsList,
    Badge,
    Button,
    // Individual auth views
    LoginView,
    SignupView,
    MFAChooserView,
    MFAWebAuthnView,
    MFATOTPView,
    MFARecoveryCodesView,
    // Building blocks
    AuthCard,
    AuthFormPage,
    AuthDjangoForm,
    PasskeyLogin,
    ProviderList,
    // Form utilities
    useAuthForm,
    AuthField,
} from './components'
export type { AllauthUIView, AllauthUIMode } from './components'

// Routing guards
export { UserRoute, StaffRoute, AnonymousRoute, FeatureRoute } from './routing'

// API
export { createAPI, getAuthDetails } from './api'
export type { AuthResponse, AuthDetails, AllauthAPI, BrowserFormAction } from './api'

// Types (re-exported from types.ts)
export type {
    // Primitive types
    Timestamp,
    Email,
    Phone,
    Username,
    Password,
    Code,
    AuthenticatorCode,
    ProviderID,
    ProviderAccountID,
    AuthenticatorID,
    ClientID,
    // Enums
    AuthenticatorType as AuthenticatorTypeEnum,
    FlowID,
    LoginMethod,
    OAuthProcess,
    ProviderFlow,
    // User & Session
    User,
    Session,
    EmailAddress,
    PhoneNumber,
    // Authentication
    Flow,
    AuthenticationMethod,
    Authenticated,
    ReauthenticationRequired,
    // Provider
    Provider,
    ProviderAccount,
    // MFA / Authenticator
    BaseAuthenticator,
    TOTPAuthenticator,
    RecoveryCodesAuthenticator,
    SensitiveRecoveryCodesAuthenticator,
    WebAuthnAuthenticator,
    Authenticator,
    // Configuration
    AccountConfiguration,
    SocialAccountConfiguration,
    MFAConfiguration,
    UserSessionsConfiguration,
    AllauthConfiguration,
    // WebAuthn
    WebAuthnPublicKeyCredentialCreationOptions,
    WebAuthnPublicKeyCredentialRequestOptions,
    WebAuthnCreationOptions,
    WebAuthnRequestOptions,
    // TOTP
    TOTPStatus,
    // Meta
    BaseAuthenticationMeta,
    AuthenticationMeta,
    AuthenticatedMeta,
    // Response types
    AuthError,
    AllauthResponse,
    AuthenticatedResponse,
    ConfigurationResponse,
    EmailListResponse,
    SessionListResponse,
    AuthenticatorListResponse,
    ProviderAccountListResponse,
    TOTPStatusResponse,
    RecoveryCodesResponse,
    WebAuthnCreationOptionsResponse,
    WebAuthnRequestOptionsResponse,
    EmailVerificationInfoResponse,
    AuthenticationRequiredResponse,
    ReauthenticationRequiredResponse,
    ErrorResponse,
    ForbiddenResponse,
    ConflictResponse,
    SessionGoneResponse,
    // Request types
    LoginRequest,
    SignupRequest,
    ProviderSignupRequest,
    ReauthenticateRequest,
    RequestLoginCodeRequest,
    ConfirmLoginCodeRequest,
    MFAAuthenticateRequest,
    MFATrustRequest,
    RequestPasswordResetRequest,
    ResetPasswordRequest,
    VerifyEmailRequest,
    ChangePasswordRequest,
    AddEmailRequest,
    ProviderRedirectRequest,
    ProviderTokenRequest,
    WebAuthnAddRequest,
    WebAuthnAuthenticateRequest,
    WebAuthnUpdateRequest,
    WebAuthnDeleteRequest,
    EndSessionsRequest,
    // Union types
    AuthResponse as AuthResponseUnion,
    SessionStatusResponse,
} from './types'

// Constants
export { Flows, AuthenticatorType } from './defines'
