@githat/nextjs 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +65 -1
- package/dist/index.d.ts +65 -1
- package/dist/index.js +93 -66
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +26 -0
- package/dist/index.mjs.map +1 -1
- package/dist/server.d.mts +41 -1
- package/dist/server.d.ts +41 -1
- package/dist/server.js +18 -0
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +17 -0
- package/dist/server.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/provider.tsx","../src/config.ts","../src/client.ts","../src/hooks.ts","../src/data.ts","../src/components/SignInForm.tsx","../src/components/SignUpForm.tsx","../src/components/SignInButton.tsx","../src/components/SignUpButton.tsx","../src/components/UserButton.tsx","../src/components/OrgSwitcher.tsx","../src/components/VerifiedBadge.tsx","../src/components/ProtectedRoute.tsx","../src/components/ForgotPasswordForm.tsx","../src/components/ResetPasswordForm.tsx","../src/components/VerifyEmailStatus.tsx","../src/components/ChangePasswordForm.tsx","../src/components/GitHubButton.tsx","../src/components/GitHubCallback.tsx","../src/components/CognitoButton.tsx","../src/components/CognitoCallback.tsx"],"sourcesContent":["// Provider\nexport { GitHatProvider } from './provider';\n\n// Hooks\nexport { useAuth, useGitHat } from './hooks';\nexport { useData } from './data';\n\n// Components\nexport { SignInForm } from './components/SignInForm';\nexport { SignUpForm } from './components/SignUpForm';\nexport { SignInButton } from './components/SignInButton';\nexport { SignUpButton } from './components/SignUpButton';\nexport { UserButton } from './components/UserButton';\nexport { OrgSwitcher } from './components/OrgSwitcher';\nexport { VerifiedBadge } from './components/VerifiedBadge';\nexport { ProtectedRoute } from './components/ProtectedRoute';\nexport { ForgotPasswordForm } from './components/ForgotPasswordForm';\nexport { ResetPasswordForm } from './components/ResetPasswordForm';\nexport { VerifyEmailStatus } from './components/VerifyEmailStatus';\nexport { ChangePasswordForm } from './components/ChangePasswordForm';\n// OAuth (Web2)\nexport { GitHubButton } from './components/GitHubButton';\nexport { GitHubCallback } from './components/GitHubCallback';\nexport { CognitoButton } from './components/CognitoButton';\nexport { CognitoCallback } from './components/CognitoCallback';\n\n// Types\nexport type {\n GitHatUser,\n GitHatOrg,\n GitHatConfig,\n AuthState,\n AuthActions,\n SignUpData,\n SignUpResult,\n GitHatContextValue,\n PasswordResetResult,\n EmailVerificationResult,\n} from './types';\n\nexport type {\n DataItem,\n QueryOptions,\n QueryResult,\n PutResult,\n DeleteResult,\n BatchOperation,\n BatchResult,\n} from './data';\n\n// Re-export server types (for TypeScript consumers who import from main entry)\nexport type {\n AuthPayload,\n VerifyOptions,\n OrgMetadata,\n AuthenticatedHandler,\n WithAuthOptions,\n} from './server';\n","'use client';\n\nimport React, { createContext, useState, useEffect, useCallback, useMemo, useRef } from 'react';\nimport type { GitHatConfig, GitHatContextValue, GitHatUser, GitHatOrg, SignUpData, SignUpResult } from './types';\nimport { TOKEN_KEYS, resolveConfig } from './config';\nimport { createClient } from './client';\n\nexport const GitHatContext = createContext<GitHatContextValue | null>(null);\n\nfunction isDevMode(key: string): boolean {\n return !key || (!key.startsWith('pk_live_') && !key.startsWith('pk_test_'));\n}\n\nfunction DevModeBanner() {\n const [dismissed, setDismissed] = useState(() => {\n if (typeof window === 'undefined') return true;\n return localStorage.getItem('githat_dev_banner_dismissed') === '1';\n });\n\n if (dismissed || typeof window === 'undefined') return null;\n\n const hostname = window.location.hostname;\n if (hostname !== 'localhost' && hostname !== '127.0.0.1') return null;\n\n return (\n <div className=\"githat-dev-banner\" role=\"status\">\n <span>\n <strong>GitHat Dev Mode</strong> — No publishable key. Auth works on localhost.{' '}\n <a href=\"https://githat.io/dashboard/apps\" target=\"_blank\" rel=\"noopener noreferrer\">\n Get your key\n </a>\n </span>\n <button\n onClick={() => {\n setDismissed(true);\n localStorage.setItem('githat_dev_banner_dismissed', '1');\n }}\n aria-label=\"Dismiss\"\n >\n ×\n </button>\n </div>\n );\n}\n\ninterface GitHatProviderProps {\n config: GitHatConfig;\n children: React.ReactNode;\n}\n\nexport function GitHatProvider({ config: rawConfig, children }: GitHatProviderProps) {\n const config = useMemo(() => resolveConfig(rawConfig), [rawConfig]);\n const useCookies = config.tokenStorage === 'cookie';\n const devMode = isDevMode(config.publishableKey);\n\n // Create client with cookie mode awareness\n const clientRef = useRef(createClient(config.apiUrl, config.publishableKey, { useCookies }));\n\n // Dev mode console warning (runs once on mount)\n useEffect(() => {\n if (!devMode || typeof window === 'undefined') return;\n\n const hostname = window.location.hostname;\n if (hostname === 'localhost' || hostname === '127.0.0.1') {\n console.warn(\n '%c GitHat Dev Mode %c No publishable key configured. Auth works on localhost but will fail in production. Get your key at https://githat.io/dashboard/apps',\n 'background: #f59e0b; color: #000; font-weight: bold; padding: 2px 6px; border-radius: 3px;',\n 'color: #f59e0b;'\n );\n } else {\n console.error(\n '%c GitHat %c Missing publishable key. Auth requests will fail. Add NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY to your environment. Get your key at https://githat.io/dashboard/apps',\n 'background: #ef4444; color: #fff; font-weight: bold; padding: 2px 6px; border-radius: 3px;',\n 'color: #ef4444;'\n );\n }\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n const [user, setUser] = useState<GitHatUser | null>(null);\n const [org, setOrg] = useState<GitHatOrg | null>(null);\n const [isSignedIn, setIsSignedIn] = useState(false);\n const [isLoading, setIsLoading] = useState(true);\n const [authError, setAuthError] = useState<string | null>(null);\n\n // Validate stored token/session on mount\n useEffect(() => {\n const validateSession = async () => {\n try {\n // In cookie mode, we always try to validate (cookies sent automatically)\n // In localStorage mode, only validate if we have a token\n if (!useCookies) {\n const token = localStorage.getItem(TOKEN_KEYS.accessToken);\n const storedUser = localStorage.getItem(TOKEN_KEYS.user);\n if (!token || !storedUser) {\n setIsLoading(false);\n return;\n }\n }\n\n const data = await clientRef.current.fetchApi<{ user: GitHatUser; currentOrg: GitHatOrg }>('/auth/me');\n\n if (data.user) {\n setUser(data.user);\n setOrg(data.currentOrg || null);\n setIsSignedIn(true);\n setAuthError(null);\n\n // Store user info in localStorage for client-side access (even in cookie mode)\n if (!useCookies) {\n localStorage.setItem(TOKEN_KEYS.user, JSON.stringify(data.user));\n if (data.currentOrg) {\n localStorage.setItem(TOKEN_KEYS.org, JSON.stringify(data.currentOrg));\n }\n }\n }\n } catch (err: unknown) {\n const error = err as Error;\n if (error.message === 'Session expired') {\n clientRef.current.clearAuth();\n } else if (!useCookies) {\n // Network error in localStorage mode — try to use stored user\n const storedUser = localStorage.getItem(TOKEN_KEYS.user);\n if (storedUser) {\n try {\n setUser(JSON.parse(storedUser));\n setIsSignedIn(true);\n } catch {}\n }\n setAuthError(error.message || 'Failed to verify session');\n }\n // In cookie mode with error, just stay logged out\n }\n setIsLoading(false);\n };\n\n validateSession();\n }, [useCookies]);\n\n // Listen for auth-changed events\n useEffect(() => {\n const handleAuthChanged = (e: Event) => {\n const detail = (e as CustomEvent).detail;\n if (detail?.signedIn === false) {\n setIsSignedIn(false);\n setUser(null);\n setOrg(null);\n } else if (detail?.signedIn === true && detail?.user) {\n setUser(detail.user);\n setIsSignedIn(true);\n if (detail.org) setOrg(detail.org);\n }\n };\n window.addEventListener('githat:auth-changed', handleAuthChanged);\n return () => window.removeEventListener('githat:auth-changed', handleAuthChanged);\n }, []);\n\n const signIn = useCallback(async (email: string, password: string) => {\n // Build login URL with setCookie param if in cookie mode\n const loginUrl = useCookies ? '/auth/login?setCookie=true' : '/auth/login';\n\n const data = await clientRef.current.fetchApi<{\n accessToken?: string;\n refreshToken?: string;\n user: GitHatUser;\n org: GitHatOrg;\n }>(loginUrl, {\n method: 'POST',\n body: JSON.stringify({ email, password }),\n });\n\n // In localStorage mode, store tokens\n if (!useCookies && data.accessToken && data.refreshToken) {\n localStorage.setItem(TOKEN_KEYS.accessToken, data.accessToken);\n localStorage.setItem(TOKEN_KEYS.refreshToken, data.refreshToken);\n localStorage.setItem(TOKEN_KEYS.user, JSON.stringify(data.user));\n if (data.org) localStorage.setItem(TOKEN_KEYS.org, JSON.stringify(data.org));\n }\n\n setUser(data.user);\n setOrg(data.org || null);\n setIsSignedIn(true);\n\n window.dispatchEvent(new CustomEvent('githat:auth-changed', {\n detail: { user: data.user, org: data.org, signedIn: true },\n }));\n }, [useCookies]);\n\n const signUp = useCallback(async (signUpData: SignUpData): Promise<SignUpResult> => {\n // Build register URL with setCookie param if in cookie mode\n const registerUrl = useCookies ? '/auth/register?setCookie=true' : '/auth/register';\n\n const data = await clientRef.current.fetchApi<{\n accessToken?: string;\n refreshToken?: string;\n user: GitHatUser;\n org: GitHatOrg;\n }>(registerUrl, {\n method: 'POST',\n body: JSON.stringify(signUpData),\n });\n\n // In localStorage mode, store tokens\n if (!useCookies && data.accessToken && data.refreshToken) {\n localStorage.setItem(TOKEN_KEYS.accessToken, data.accessToken);\n localStorage.setItem(TOKEN_KEYS.refreshToken, data.refreshToken);\n localStorage.setItem(TOKEN_KEYS.user, JSON.stringify(data.user));\n if (data.org) localStorage.setItem(TOKEN_KEYS.org, JSON.stringify(data.org));\n }\n\n setUser(data.user);\n setOrg(data.org || null);\n setIsSignedIn(true);\n\n window.dispatchEvent(new CustomEvent('githat:auth-changed', {\n detail: { user: data.user, org: data.org, signedIn: true },\n }));\n\n return { requiresVerification: !data.user.emailVerified, email: signUpData.email };\n }, [useCookies]);\n\n const signOut = useCallback(async () => {\n try {\n // In cookie mode, logout endpoint clears cookies\n const logoutUrl = useCookies ? '/auth/logout?setCookie=true' : '/auth/logout';\n await clientRef.current.fetchApi(logoutUrl, { method: 'POST' });\n } catch {}\n clientRef.current.clearAuth();\n setIsSignedIn(false);\n setUser(null);\n setOrg(null);\n if (typeof window !== 'undefined' && config.afterSignOutUrl) {\n window.location.href = config.afterSignOutUrl;\n }\n }, [config.afterSignOutUrl, useCookies]);\n\n const switchOrg = useCallback(async (orgId: string) => {\n try {\n const switchUrl = useCookies\n ? `/user/orgs/${orgId}/switch?setCookie=true`\n : `/user/orgs/${orgId}/switch`;\n\n const data = await clientRef.current.fetchApi<{\n accessToken?: string;\n refreshToken?: string;\n org: GitHatOrg;\n }>(switchUrl, { method: 'POST' });\n\n // In localStorage mode, store new tokens\n if (!useCookies) {\n if (data.accessToken) localStorage.setItem(TOKEN_KEYS.accessToken, data.accessToken);\n if (data.refreshToken) localStorage.setItem(TOKEN_KEYS.refreshToken, data.refreshToken);\n localStorage.setItem(TOKEN_KEYS.org, JSON.stringify(data.org));\n }\n\n setOrg(data.org);\n\n window.dispatchEvent(new CustomEvent('githat:auth-changed', {\n detail: { user, org: data.org, signedIn: true },\n }));\n } catch (e) {\n console.error('Org switch failed:', e);\n }\n }, [user, useCookies]);\n\n const value = useMemo<GitHatContextValue>(() => ({\n user, org, isSignedIn, isLoading, authError, config,\n signIn, signUp, signOut, switchOrg,\n }), [user, org, isSignedIn, isLoading, authError, config, signIn, signUp, signOut, switchOrg]);\n\n return (\n <GitHatContext.Provider value={value}>\n {devMode && <DevModeBanner />}\n {children}\n </GitHatContext.Provider>\n );\n}\n","import type { GitHatConfig } from './types';\n\nexport const DEFAULT_API_URL = 'https://api.githat.io';\n\nexport const TOKEN_KEYS = {\n accessToken: 'githat_access_token',\n refreshToken: 'githat_refresh_token',\n user: 'githat_user',\n org: 'githat_org',\n} as const;\n\nexport const COOKIE_NAMES = {\n accessToken: 'githat_access',\n refreshToken: 'githat_refresh',\n} as const;\n\nexport function resolveConfig(config: GitHatConfig): Required<GitHatConfig> {\n return {\n publishableKey: config.publishableKey,\n apiUrl: config.apiUrl || DEFAULT_API_URL,\n signInUrl: config.signInUrl || '/sign-in',\n signUpUrl: config.signUpUrl || '/sign-up',\n afterSignInUrl: config.afterSignInUrl || '/dashboard',\n afterSignOutUrl: config.afterSignOutUrl || '/',\n tokenStorage: config.tokenStorage || 'localStorage',\n };\n}\n","import { TOKEN_KEYS } from './config';\n\ninterface ClientOptions {\n /**\n * When true, use credentials: 'include' for all requests\n * and don't send Authorization header (cookies handle auth)\n */\n useCookies?: boolean;\n}\n\nlet _refreshPromise: Promise<boolean> | null = null;\n\nasync function refreshTokens(\n apiUrl: string,\n appKey: string,\n useCookies: boolean\n): Promise<boolean> {\n // In cookie mode, refresh token comes from cookie\n // In localStorage mode, we need to send it in the body\n const refreshToken =\n typeof window !== 'undefined' && !useCookies\n ? localStorage.getItem(TOKEN_KEYS.refreshToken)\n : null;\n\n // In localStorage mode, we need a refresh token\n if (!useCookies && !refreshToken) return false;\n\n let orgId: string | null = null;\n try {\n const orgStr = localStorage.getItem(TOKEN_KEYS.org);\n if (orgStr) orgId = JSON.parse(orgStr).id;\n } catch {}\n\n try {\n const refreshUrl = useCookies\n ? `${apiUrl}/auth/refresh?setCookie=true`\n : `${apiUrl}/auth/refresh`;\n\n const res = await fetch(refreshUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-GitHat-App-Key': appKey,\n },\n credentials: useCookies ? 'include' : 'same-origin',\n body: JSON.stringify(useCookies ? { orgId } : { refreshToken, orgId }),\n });\n\n if (!res.ok) return false;\n\n const data = await res.json();\n\n // In localStorage mode, store the new tokens\n if (!useCookies) {\n if (data.accessToken) localStorage.setItem(TOKEN_KEYS.accessToken, data.accessToken);\n if (data.refreshToken) localStorage.setItem(TOKEN_KEYS.refreshToken, data.refreshToken);\n }\n\n if (data.org) localStorage.setItem(TOKEN_KEYS.org, JSON.stringify(data.org));\n return true;\n } catch {\n return false;\n }\n}\n\nfunction clearAuth() {\n if (typeof window === 'undefined') return;\n Object.values(TOKEN_KEYS).forEach((key) => localStorage.removeItem(key));\n window.dispatchEvent(\n new CustomEvent('githat:auth-changed', {\n detail: { user: null, org: null, signedIn: false },\n })\n );\n}\n\nexport function createClient(\n apiUrl: string,\n appKey: string,\n options: ClientOptions = {}\n) {\n const { useCookies = false } = options;\n\n async function fetchApi<T = unknown>(\n endpoint: string,\n fetchOptions: RequestInit = {}\n ): Promise<T> {\n const url = `${apiUrl}${endpoint}`;\n\n // In localStorage mode, get token from storage\n // In cookie mode, cookies are sent automatically with credentials: 'include'\n const token =\n typeof window !== 'undefined' && !useCookies\n ? localStorage.getItem(TOKEN_KEYS.accessToken)\n : null;\n\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n 'X-GitHat-App-Key': appKey,\n ...(token && { Authorization: `Bearer ${token}` }),\n ...(fetchOptions.headers as Record<string, string>),\n };\n\n let response: Response;\n try {\n response = await fetch(url, {\n ...fetchOptions,\n headers,\n credentials: useCookies ? 'include' : 'same-origin',\n });\n } catch (networkError: unknown) {\n // Network errors (CORS blocked, offline, DNS failure) throw TypeError\n if (networkError instanceof TypeError) {\n const isMissingKey = !appKey || (!appKey.startsWith('pk_live_') && !appKey.startsWith('pk_test_'));\n const isLocalhost =\n typeof window !== 'undefined' &&\n (window.location.hostname === 'localhost' ||\n window.location.hostname === '127.0.0.1');\n\n if (isMissingKey && !isLocalhost) {\n throw new Error(\n 'GitHat: Missing or invalid publishable key. Add NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY to your environment variables. Get your key at https://githat.io/dashboard/apps'\n );\n }\n if (isLocalhost) {\n throw new Error(\n 'GitHat: Cannot reach api.githat.io. Check your internet connection.'\n );\n }\n throw new Error(\n 'GitHat: API request failed. Verify your publishable key and app domain at https://githat.io/dashboard/apps'\n );\n }\n throw networkError;\n }\n\n if (response.status === 401) {\n // Queue all 401 retries behind a single refresh promise\n if (!_refreshPromise) {\n _refreshPromise = refreshTokens(apiUrl, appKey, useCookies).finally(() => {\n _refreshPromise = null;\n });\n }\n\n const refreshed = await _refreshPromise;\n\n if (refreshed) {\n // Get the new token (only needed in localStorage mode)\n const newToken =\n !useCookies && typeof window !== 'undefined'\n ? localStorage.getItem(TOKEN_KEYS.accessToken)\n : null;\n\n const retryResponse = await fetch(url, {\n ...fetchOptions,\n headers: {\n ...headers,\n ...(newToken && { Authorization: `Bearer ${newToken}` }),\n },\n credentials: useCookies ? 'include' : 'same-origin',\n });\n\n const retryData = await retryResponse.json();\n if (!retryResponse.ok) throw new Error(retryData.error || 'Request failed');\n return retryData as T;\n }\n\n clearAuth();\n throw new Error('Session expired');\n }\n\n const data = await response.json();\n if (!response.ok) throw new Error(data.error || 'Request failed');\n return data as T;\n }\n\n return { fetchApi, clearAuth };\n}\n","'use client';\n\nimport { useContext, useMemo, useCallback } from 'react';\nimport { GitHatContext } from './provider';\nimport { createClient } from './client';\nimport type { GitHatContextValue, GitHatOrg, GitHatUser } from './types';\n\nexport interface OrgMetadata {\n [key: string]: unknown;\n}\n\nexport function useAuth(): GitHatContextValue {\n const ctx = useContext(GitHatContext);\n if (!ctx) throw new Error('useAuth must be used within a <GitHatProvider>');\n return ctx;\n}\n\nexport function useGitHat() {\n const ctx = useAuth();\n const client = useMemo(\n () => createClient(ctx.config.apiUrl!, ctx.config.publishableKey),\n [ctx.config.apiUrl, ctx.config.publishableKey]\n );\n\n /**\n * Get the current organization's metadata.\n * Requires the user to be signed in with an active organization.\n *\n * @example\n * ```tsx\n * const { getOrgMetadata } = useGitHat();\n * const meta = await getOrgMetadata();\n * console.log(meta.stripeAccountId);\n * ```\n */\n const getOrgMetadata = useCallback(async (): Promise<OrgMetadata> => {\n if (!ctx.org?.id) {\n throw new Error('No active organization');\n }\n const response = await client.fetchApi<{ metadata: OrgMetadata }>(\n `/orgs/${ctx.org.id}/metadata`\n );\n return response.metadata || {};\n }, [client, ctx.org?.id]);\n\n /**\n * Update the current organization's metadata.\n * Merges the provided object with existing metadata.\n * Set a key to null to delete it.\n * Requires admin or owner role.\n *\n * @example\n * ```tsx\n * const { updateOrgMetadata } = useGitHat();\n * // Set values\n * await updateOrgMetadata({ stripeAccountId: 'acct_xxx', features: ['pos'] });\n * // Delete a key\n * await updateOrgMetadata({ oldKey: null });\n * ```\n */\n const updateOrgMetadata = useCallback(\n async (updates: OrgMetadata): Promise<OrgMetadata> => {\n if (!ctx.org?.id) {\n throw new Error('No active organization');\n }\n const response = await client.fetchApi<{ metadata: OrgMetadata }>(\n `/orgs/${ctx.org.id}/metadata`,\n {\n method: 'PATCH',\n body: JSON.stringify(updates),\n }\n );\n return response.metadata || {};\n },\n [client, ctx.org?.id]\n );\n\n // ============================================================================\n // Password Management\n // ============================================================================\n\n /**\n * Request a password reset email.\n *\n * @example\n * ```tsx\n * const { forgotPassword } = useGitHat();\n * await forgotPassword('user@example.com');\n * // Check email for reset link\n * ```\n */\n const forgotPassword = useCallback(\n async (email: string): Promise<{ success: boolean }> => {\n await client.fetchApi('/auth/forgot-password', {\n method: 'POST',\n body: JSON.stringify({ email }),\n });\n return { success: true };\n },\n [client]\n );\n\n /**\n * Reset password using a token from email.\n *\n * @example\n * ```tsx\n * const { resetPassword } = useGitHat();\n * const token = searchParams.get('token');\n * await resetPassword(token, 'NewSecurePassword123!');\n * ```\n */\n const resetPassword = useCallback(\n async (token: string, newPassword: string): Promise<{ success: boolean }> => {\n await client.fetchApi('/auth/reset-password', {\n method: 'POST',\n body: JSON.stringify({ token, password: newPassword }),\n });\n return { success: true };\n },\n [client]\n );\n\n /**\n * Change password for authenticated user.\n * Requires current password for verification.\n *\n * @example\n * ```tsx\n * const { changePassword } = useGitHat();\n * await changePassword('currentPassword', 'newSecurePassword123!');\n * ```\n */\n const changePassword = useCallback(\n async (currentPassword: string, newPassword: string): Promise<{ success: boolean }> => {\n await client.fetchApi('/auth/change-password', {\n method: 'POST',\n body: JSON.stringify({ currentPassword, newPassword }),\n });\n return { success: true };\n },\n [client]\n );\n\n // ============================================================================\n // Email Verification\n // ============================================================================\n\n /**\n * Verify email using a token from the verification email.\n *\n * @example\n * ```tsx\n * const { verifyEmail } = useGitHat();\n * const token = searchParams.get('token');\n * await verifyEmail(token);\n * ```\n */\n const verifyEmail = useCallback(\n async (token: string): Promise<{ success: boolean }> => {\n await client.fetchApi('/auth/verify-email', {\n method: 'POST',\n body: JSON.stringify({ token }),\n });\n return { success: true };\n },\n [client]\n );\n\n /**\n * Resend verification email to the specified address.\n *\n * @example\n * ```tsx\n * const { resendVerificationEmail } = useGitHat();\n * await resendVerificationEmail('user@example.com');\n * ```\n */\n const resendVerificationEmail = useCallback(\n async (email: string): Promise<{ success: boolean }> => {\n await client.fetchApi('/auth/resend-verification', {\n method: 'POST',\n body: JSON.stringify({ email }),\n });\n return { success: true };\n },\n [client]\n );\n\n // ============================================================================\n // OAuth (Web2)\n // ============================================================================\n\n /**\n * Get the GitHub OAuth authorization URL.\n * Redirects user to GitHub to authorize, then back to your callback URL.\n *\n * @example\n * ```tsx\n * const { getGitHubOAuthUrl } = useGitHat();\n * const handleGitHubLogin = async () => {\n * const { url } = await getGitHubOAuthUrl();\n * window.location.href = url;\n * };\n * ```\n */\n const getGitHubOAuthUrl = useCallback(\n async (options?: { redirectUri?: string; state?: string }): Promise<{ url: string }> => {\n const params = new URLSearchParams();\n if (options?.redirectUri) params.append('redirectUri', options.redirectUri);\n if (options?.state) params.append('state', options.state);\n const queryString = params.toString();\n const path = queryString ? `/auth/oauth/github/url?${queryString}` : '/auth/oauth/github/url';\n return client.fetchApi<{ url: string }>(path);\n },\n [client]\n );\n\n /**\n * Exchange a GitHub OAuth code for GitHat tokens.\n * Call this in your callback page after GitHub redirects back.\n *\n * @example\n * ```tsx\n * // In /auth/callback/github page\n * const { signInWithGitHub } = useGitHat();\n * useEffect(() => {\n * const code = searchParams.get('code');\n * if (code) {\n * signInWithGitHub(code).then(({ user, isNewUser }) => {\n * router.push(isNewUser ? '/onboarding' : '/dashboard');\n * });\n * }\n * }, []);\n * ```\n */\n const signInWithGitHub = useCallback(\n async (code: string, options?: { redirectUri?: string }): Promise<{\n user: GitHatUser;\n org: GitHatOrg | null;\n isNewUser: boolean;\n }> => {\n const response = await client.fetchApi<{\n user: GitHatUser;\n org: GitHatOrg | null;\n isNewUser: boolean;\n accessToken?: string;\n refreshToken?: string;\n }>('/auth/oauth/github', {\n method: 'POST',\n body: JSON.stringify({\n code,\n redirectUri: options?.redirectUri,\n }),\n });\n\n // Update auth state\n if (response.accessToken) {\n // localStorage mode - tokens in response\n window.dispatchEvent(new CustomEvent('githat:auth-changed', {\n detail: { user: response.user, org: response.org, signedIn: true },\n }));\n }\n\n return {\n user: response.user,\n org: response.org,\n isNewUser: response.isNewUser,\n };\n },\n [client]\n );\n\n /**\n * Get the AWS Cognito OAuth authorization URL.\n * Redirects user to Cognito hosted UI to authenticate.\n *\n * @example\n * ```tsx\n * const { getCognitoOAuthUrl } = useGitHat();\n * const handleCognitoLogin = async () => {\n * const { url } = await getCognitoOAuthUrl();\n * window.location.href = url;\n * };\n * // Or with specific identity provider (Google via Cognito)\n * const { url } = await getCognitoOAuthUrl({ identityProvider: 'Google' });\n * ```\n */\n const getCognitoOAuthUrl = useCallback(\n async (options?: {\n redirectUri?: string;\n state?: string;\n identityProvider?: string;\n }): Promise<{ url: string }> => {\n const params = new URLSearchParams();\n if (options?.redirectUri) params.append('redirectUri', options.redirectUri);\n if (options?.state) params.append('state', options.state);\n if (options?.identityProvider) params.append('identityProvider', options.identityProvider);\n const queryString = params.toString();\n const path = queryString ? `/auth/oauth/cognito/url?${queryString}` : '/auth/oauth/cognito/url';\n return client.fetchApi<{ url: string }>(path);\n },\n [client]\n );\n\n /**\n * Exchange an AWS Cognito OAuth code for GitHat tokens.\n * Call this in your callback page after Cognito redirects back.\n *\n * @example\n * ```tsx\n * // In /auth/callback/cognito page\n * const { signInWithCognito } = useGitHat();\n * useEffect(() => {\n * const code = searchParams.get('code');\n * if (code) {\n * signInWithCognito(code).then(({ user, isNewUser }) => {\n * router.push(isNewUser ? '/onboarding' : '/dashboard');\n * });\n * }\n * }, []);\n * ```\n */\n const signInWithCognito = useCallback(\n async (code: string, options?: { redirectUri?: string }): Promise<{\n user: GitHatUser;\n org: GitHatOrg | null;\n isNewUser: boolean;\n }> => {\n const response = await client.fetchApi<{\n user: GitHatUser;\n org: GitHatOrg | null;\n isNewUser: boolean;\n accessToken?: string;\n refreshToken?: string;\n }>('/auth/oauth/cognito', {\n method: 'POST',\n body: JSON.stringify({\n code,\n redirectUri: options?.redirectUri,\n }),\n });\n\n // Update auth state\n if (response.accessToken) {\n window.dispatchEvent(new CustomEvent('githat:auth-changed', {\n detail: { user: response.user, org: response.org, signedIn: true },\n }));\n }\n\n return {\n user: response.user,\n org: response.org,\n isNewUser: response.isNewUser,\n };\n },\n [client]\n );\n\n return {\n fetch: client.fetchApi,\n getUserOrgs: () => client.fetchApi<{ orgs: GitHatOrg[] }>('/user/orgs'),\n verifyMCP: (domain: string) => client.fetchApi<{ verified: boolean }>(`/verify/mcp/${domain}`),\n verifyAgent: (wallet: string) => client.fetchApi<{ verified: boolean }>(`/verify/agent/${wallet}`),\n getOrgMetadata,\n updateOrgMetadata,\n // Password management\n forgotPassword,\n resetPassword,\n changePassword,\n // Email verification\n verifyEmail,\n resendVerificationEmail,\n // OAuth (Web2)\n getGitHubOAuthUrl,\n signInWithGitHub,\n getCognitoOAuthUrl,\n signInWithCognito,\n };\n}\n","'use client';\n\nimport { useMemo } from 'react';\nimport { useAuth } from './hooks';\nimport { createClient } from './client';\n\nexport interface DataItem {\n id: string;\n [key: string]: unknown;\n _createdAt?: string;\n _updatedAt?: string;\n}\n\nexport interface QueryOptions {\n limit?: number;\n cursor?: string;\n filter?: Record<string, unknown>;\n}\n\nexport interface QueryResult<T = DataItem> {\n items: T[];\n collection: string;\n nextCursor: string | null;\n count: number;\n}\n\nexport interface PutResult<T = DataItem> {\n item: T;\n collection: string;\n created: boolean;\n}\n\nexport interface DeleteResult {\n deleted: boolean;\n id: string;\n collection: string;\n}\n\nexport interface BatchOperation {\n type: 'put' | 'delete';\n id: string;\n data?: Record<string, unknown>;\n}\n\nexport interface BatchResult {\n processed: number;\n put: number;\n deleted: number;\n collection: string;\n}\n\n/**\n * Hook for interacting with GitHat's Customer Data API.\n * Provides CRUD operations for storing app data in GitHat's managed DynamoDB.\n *\n * @example\n * ```tsx\n * const { put, get, query, remove, batch } = useData();\n *\n * // Store data\n * await put('orders', { id: 'order_123', amount: 99.99, status: 'pending' });\n *\n * // Get single item\n * const order = await get('orders', 'order_123');\n *\n * // Query collection\n * const { items } = await query('orders', { filter: { status: 'pending' } });\n *\n * // Delete item\n * await remove('orders', 'order_123');\n * ```\n */\nexport function useData() {\n const ctx = useAuth();\n const client = useMemo(\n () => createClient(ctx.config.apiUrl!, ctx.config.publishableKey),\n [ctx.config.apiUrl, ctx.config.publishableKey]\n );\n\n return useMemo(() => ({\n /**\n * Store an item in a collection. If the item exists, it will be updated.\n * @param collection - Collection name (e.g., 'orders', 'users')\n * @param data - Data object with required `id` field\n */\n put: async <T extends DataItem>(collection: string, data: T): Promise<PutResult<T>> => {\n if (!data.id) {\n throw new Error('Data must include an \"id\" field');\n }\n return client.fetchApi<PutResult<T>>(`/data/${collection}/${data.id}`, {\n method: 'PUT',\n body: JSON.stringify(data),\n });\n },\n\n /**\n * Get a single item from a collection.\n * @param collection - Collection name\n * @param id - Item ID\n */\n get: async <T extends DataItem>(collection: string, id: string): Promise<T | null> => {\n try {\n const result = await client.fetchApi<{ item: T }>(`/data/${collection}/${id}`);\n return result.item;\n } catch (err: unknown) {\n if (err instanceof Error && err.message === 'Item not found') {\n return null;\n }\n throw err;\n }\n },\n\n /**\n * Query items from a collection with optional filters and pagination.\n * @param collection - Collection name\n * @param options - Query options (limit, cursor, filter)\n */\n query: async <T extends DataItem>(\n collection: string,\n options: QueryOptions = {}\n ): Promise<QueryResult<T>> => {\n const params = new URLSearchParams();\n if (options.limit) params.set('limit', options.limit.toString());\n if (options.cursor) params.set('cursor', options.cursor);\n if (options.filter) params.set('filter', JSON.stringify(options.filter));\n\n const queryString = params.toString();\n const url = `/data/${collection}${queryString ? `?${queryString}` : ''}`;\n\n return client.fetchApi<QueryResult<T>>(url);\n },\n\n /**\n * Delete an item from a collection.\n * @param collection - Collection name\n * @param id - Item ID\n */\n remove: async (collection: string, id: string): Promise<DeleteResult> => {\n return client.fetchApi<DeleteResult>(`/data/${collection}/${id}`, {\n method: 'DELETE',\n });\n },\n\n /**\n * Batch operations (put/delete) on a collection.\n * Maximum 100 operations per request.\n * @param collection - Collection name\n * @param operations - Array of operations\n */\n batch: async (collection: string, operations: BatchOperation[]): Promise<BatchResult> => {\n return client.fetchApi<BatchResult>(`/data/${collection}/batch`, {\n method: 'POST',\n body: JSON.stringify({ operations }),\n });\n },\n }), [client]);\n}\n","'use client';\n\nimport React, { useState, FormEvent } from 'react';\nimport { useAuth } from '../hooks';\n\ninterface SignInFormProps {\n onSuccess?: () => void;\n signUpUrl?: string;\n forgotPasswordUrl?: string;\n}\n\nexport function SignInForm({ onSuccess, signUpUrl, forgotPasswordUrl }: SignInFormProps) {\n const { signIn, config } = useAuth();\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const [error, setError] = useState('');\n const [loading, setLoading] = useState(false);\n\n const emailValid = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email);\n\n const handleSubmit = async (e: FormEvent) => {\n e.preventDefault();\n if (!emailValid) {\n setError('Please enter a valid email address');\n return;\n }\n setError('');\n setLoading(true);\n try {\n await signIn(email, password);\n if (onSuccess) {\n onSuccess();\n } else if (typeof window !== 'undefined') {\n const params = new URLSearchParams(window.location.search);\n window.location.href = params.get('redirect_url') || config.afterSignInUrl!;\n }\n } catch (err: unknown) {\n setError(err instanceof Error ? err.message : 'Sign in failed');\n } finally {\n setLoading(false);\n }\n };\n\n return (\n <div className=\"githat-form-container\">\n <div className=\"githat-form-header\">\n <h2 className=\"githat-form-title\">Sign in</h2>\n <p className=\"githat-form-subtitle\">Welcome back to GitHat</p>\n </div>\n {error && <div className=\"githat-alert githat-alert-error\" role=\"alert\" aria-live=\"polite\">{error}</div>}\n <form onSubmit={handleSubmit} className=\"githat-form\" aria-label=\"Sign in form\">\n <div className=\"githat-field\">\n <label className=\"githat-label\" htmlFor=\"githat-signin-email\">Email</label>\n <input\n id=\"githat-signin-email\"\n className=\"githat-input\"\n type=\"email\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n placeholder=\"you@example.com\"\n autoComplete=\"email\"\n required\n />\n </div>\n <div className=\"githat-field\">\n <label className=\"githat-label\" htmlFor=\"githat-signin-password\">Password</label>\n <input\n id=\"githat-signin-password\"\n className=\"githat-input\"\n type=\"password\"\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n placeholder=\"Enter your password\"\n autoComplete=\"current-password\"\n required\n />\n </div>\n {forgotPasswordUrl && (\n <a href={forgotPasswordUrl} className=\"githat-link githat-forgot-link\">Forgot password?</a>\n )}\n <button\n type=\"submit\"\n className=\"githat-button githat-button-primary\"\n disabled={loading || !email || !password || (email.length > 0 && !emailValid)}\n >\n {loading ? 'Signing in...' : 'Sign in'}\n </button>\n </form>\n {signUpUrl && (\n <p className=\"githat-form-footer\">\n Don't have an account? <a href={signUpUrl} className=\"githat-link\">Sign up</a>\n </p>\n )}\n <p className=\"githat-powered-by\">Secured by <strong>GitHat</strong></p>\n </div>\n );\n}\n","'use client';\n\nimport React, { useState, FormEvent } from 'react';\nimport { useAuth } from '../hooks';\n\ninterface SignUpFormProps {\n onSuccess?: (result: { requiresVerification: boolean; email: string }) => void;\n signInUrl?: string;\n}\n\nexport function SignUpForm({ onSuccess, signInUrl }: SignUpFormProps) {\n const { signUp, config } = useAuth();\n const [name, setName] = useState('');\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const [error, setError] = useState('');\n const [loading, setLoading] = useState(false);\n\n const emailValid = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email);\n const passwordValid = password.length >= 8\n && /[A-Z]/.test(password)\n && /[a-z]/.test(password)\n && /\\d/.test(password);\n\n const handleSubmit = async (e: FormEvent) => {\n e.preventDefault();\n if (!emailValid) {\n setError('Please enter a valid email address');\n return;\n }\n if (!passwordValid) {\n setError('Password must be 8+ characters with uppercase, lowercase, and number');\n return;\n }\n setError('');\n setLoading(true);\n try {\n const result = await signUp({ email, password, name });\n if (onSuccess) {\n onSuccess(result);\n } else if (typeof window !== 'undefined') {\n window.location.href = config.afterSignInUrl!;\n }\n } catch (err: unknown) {\n setError(err instanceof Error ? err.message : 'Sign up failed');\n } finally {\n setLoading(false);\n }\n };\n\n return (\n <div className=\"githat-form-container\">\n <div className=\"githat-form-header\">\n <h2 className=\"githat-form-title\">Create an account</h2>\n <p className=\"githat-form-subtitle\">Get started with GitHat</p>\n </div>\n {error && <div className=\"githat-alert githat-alert-error\" role=\"alert\" aria-live=\"polite\">{error}</div>}\n <form onSubmit={handleSubmit} className=\"githat-form\" aria-label=\"Sign up form\">\n <div className=\"githat-field\">\n <label className=\"githat-label\" htmlFor=\"githat-signup-name\">Full name</label>\n <input\n id=\"githat-signup-name\"\n className=\"githat-input\"\n type=\"text\"\n value={name}\n onChange={(e) => setName(e.target.value)}\n placeholder=\"Your name\"\n autoComplete=\"name\"\n required\n />\n </div>\n <div className=\"githat-field\">\n <label className=\"githat-label\" htmlFor=\"githat-signup-email\">Email</label>\n <input\n id=\"githat-signup-email\"\n className=\"githat-input\"\n type=\"email\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n placeholder=\"you@example.com\"\n autoComplete=\"email\"\n required\n />\n </div>\n <div className=\"githat-field\">\n <label className=\"githat-label\" htmlFor=\"githat-signup-password\">Password</label>\n <input\n id=\"githat-signup-password\"\n className=\"githat-input\"\n type=\"password\"\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n placeholder=\"8+ characters\"\n autoComplete=\"new-password\"\n required\n />\n {password && !passwordValid && (\n <p className=\"githat-field-error\">\n Must be 8+ characters with uppercase, lowercase, and number\n </p>\n )}\n </div>\n <button\n type=\"submit\"\n className=\"githat-button githat-button-primary\"\n disabled={loading || !email || !password || !name || !emailValid}\n >\n {loading ? 'Creating account...' : 'Sign up'}\n </button>\n </form>\n {signInUrl && (\n <p className=\"githat-form-footer\">\n Already have an account? <a href={signInUrl} className=\"githat-link\">Sign in</a>\n </p>\n )}\n <p className=\"githat-powered-by\">Secured by <strong>GitHat</strong></p>\n </div>\n );\n}\n","'use client';\n\nimport React, { useContext } from 'react';\nimport { GitHatContext } from '../provider';\n\ninterface SignInButtonProps {\n className?: string;\n children?: React.ReactNode;\n href?: string;\n}\n\nexport function SignInButton({ className, children, href }: SignInButtonProps) {\n const ctx = useContext(GitHatContext);\n const url = href || ctx?.config.signInUrl || '/sign-in';\n return (\n <a href={url} className={className || 'githat-button githat-button-primary'} aria-label=\"Sign in\">\n {children || 'Sign in'}\n </a>\n );\n}\n","'use client';\n\nimport React, { useContext } from 'react';\nimport { GitHatContext } from '../provider';\n\ninterface SignUpButtonProps {\n className?: string;\n children?: React.ReactNode;\n href?: string;\n}\n\nexport function SignUpButton({ className, children, href }: SignUpButtonProps) {\n const ctx = useContext(GitHatContext);\n const url = href || ctx?.config.signUpUrl || '/sign-up';\n return (\n <a href={url} className={className || 'githat-button githat-button-outline'} aria-label=\"Sign up\">\n {children || 'Sign up'}\n </a>\n );\n}\n","'use client';\n\nimport React, { useState, useRef, useEffect } from 'react';\nimport { useAuth } from '../hooks';\n\nexport function UserButton() {\n const { user, org, isSignedIn, signOut } = useAuth();\n const [open, setOpen] = useState(false);\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const handleClickOutside = (e: MouseEvent) => {\n if (ref.current && !ref.current.contains(e.target as Node)) setOpen(false);\n };\n document.addEventListener('mousedown', handleClickOutside);\n return () => document.removeEventListener('mousedown', handleClickOutside);\n }, []);\n\n if (!isSignedIn || !user) return null;\n\n const initials = user.name\n ? user.name.split(' ').map(n => n[0]).join('').toUpperCase().slice(0, 2)\n : user.email[0].toUpperCase();\n\n return (\n <div className=\"githat-user-button\" ref={ref}>\n <button className=\"githat-avatar-trigger\" onClick={() => setOpen(!open)} aria-label=\"User menu\" aria-expanded={open} aria-haspopup=\"true\">\n {user.avatarUrl ? (\n <img src={user.avatarUrl} alt={user.name || 'User avatar'} className=\"githat-avatar-img\" />\n ) : (\n <span className=\"githat-avatar-initials\">{initials}</span>\n )}\n </button>\n {open && (\n <div className=\"githat-dropdown\" role=\"menu\">\n <div className=\"githat-dropdown-header\">\n <p className=\"githat-dropdown-name\">{user.name}</p>\n <p className=\"githat-dropdown-email\">{user.email}</p>\n {org && <p className=\"githat-dropdown-org\">{org.name}</p>}\n </div>\n <div className=\"githat-dropdown-divider\" />\n <button className=\"githat-dropdown-item\" role=\"menuitem\" onClick={() => { signOut(); setOpen(false); }}>\n Sign out\n </button>\n </div>\n )}\n </div>\n );\n}\n","'use client';\n\nimport React, { useState, useEffect, useRef } from 'react';\nimport { useAuth, useGitHat } from '../hooks';\nimport type { GitHatOrg } from '../types';\n\nexport function OrgSwitcher() {\n const { org, isSignedIn, switchOrg } = useAuth();\n const githat = useGitHat();\n const [orgs, setOrgs] = useState<GitHatOrg[]>([]);\n const [orgsLoading, setOrgsLoading] = useState(false);\n const [open, setOpen] = useState(false);\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (isSignedIn) {\n setOrgsLoading(true);\n githat.getUserOrgs()\n .then(data => setOrgs(data.orgs || []))\n .catch(() => {})\n .finally(() => setOrgsLoading(false));\n }\n }, [isSignedIn]);\n\n useEffect(() => {\n const handleClickOutside = (e: MouseEvent) => {\n if (ref.current && !ref.current.contains(e.target as Node)) setOpen(false);\n };\n document.addEventListener('mousedown', handleClickOutside);\n return () => document.removeEventListener('mousedown', handleClickOutside);\n }, []);\n\n if (!isSignedIn || !org || (orgs.length < 2 && !orgsLoading)) return null;\n\n return (\n <div className=\"githat-org-switcher\" ref={ref}>\n <button className=\"githat-org-trigger\" onClick={() => setOpen(!open)} aria-label=\"Switch organization\" aria-expanded={open} aria-haspopup=\"true\">\n <span className=\"githat-org-name\">{org.name}</span>\n <span className=\"githat-chevron\">{open ? '\\u25B2' : '\\u25BC'}</span>\n </button>\n {open && (\n <div className=\"githat-dropdown\" role=\"menu\">\n {orgsLoading ? (\n <div className=\"githat-dropdown-item\" aria-busy=\"true\">Loading...</div>\n ) : orgs.map(o => (\n <button\n key={o.id}\n className={`githat-dropdown-item ${o.id === org.id ? 'githat-dropdown-item-active' : ''}`}\n role=\"menuitem\"\n aria-current={o.id === org.id ? 'true' : undefined}\n onClick={() => { switchOrg(o.id); setOpen(false); }}\n >\n {o.name}\n {o.id === org.id && <span className=\"githat-check\">{'\\u2713'}</span>}\n </button>\n ))}\n </div>\n )}\n </div>\n );\n}\n","'use client';\n\nimport React, { useState, useEffect, useRef } from 'react';\nimport { useGitHat } from '../hooks';\n\ninterface VerifiedBadgeProps {\n type: 'mcp' | 'agent';\n identifier: string;\n label?: string;\n}\n\nconst CACHE_TTL = 5 * 60 * 1000; // 5 minutes\nconst cache = new Map<string, { verified: boolean; ts: number }>();\n\nexport function VerifiedBadge({ type, identifier, label }: VerifiedBadgeProps) {\n const githat = useGitHat();\n const [verified, setVerified] = useState<boolean | null>(null);\n const mounted = useRef(true);\n\n useEffect(() => {\n mounted.current = true;\n const key = `${type}:${identifier}`;\n const cached = cache.get(key);\n if (cached && Date.now() - cached.ts < CACHE_TTL) {\n setVerified(cached.verified);\n return;\n }\n\n const verify = type === 'mcp' ? githat.verifyMCP : githat.verifyAgent;\n verify(identifier)\n .then(data => {\n if (mounted.current) {\n setVerified(data.verified);\n cache.set(key, { verified: data.verified, ts: Date.now() });\n }\n })\n .catch(() => { if (mounted.current) setVerified(false); });\n\n return () => { mounted.current = false; };\n }, [type, identifier]);\n\n if (verified === null) return null;\n\n return (\n <span className={`githat-badge ${verified ? 'githat-badge-verified' : 'githat-badge-unverified'}`}>\n {verified ? '\\u2713' : '\\u2717'} {label || (verified ? 'Verified' : 'Unverified')}\n </span>\n );\n}\n","'use client';\n\nimport React from 'react';\nimport { useAuth } from '../hooks';\n\ninterface ProtectedRouteProps {\n children: React.ReactNode;\n fallback?: React.ReactNode;\n}\n\nexport function ProtectedRoute({ children, fallback }: ProtectedRouteProps) {\n const { isSignedIn, isLoading, config } = useAuth();\n\n if (isLoading) {\n return <>{fallback || <div className=\"githat-loading\">Loading...</div>}</>;\n }\n\n if (!isSignedIn) {\n if (typeof window !== 'undefined') {\n window.location.href = config.signInUrl!;\n }\n return null;\n }\n\n return <>{children}</>;\n}\n","'use client';\n\nimport React, { useState, FormEvent } from 'react';\nimport { useGitHat } from '../hooks';\n\ninterface ForgotPasswordFormProps {\n onSuccess?: (email: string) => void;\n onError?: (error: Error) => void;\n signInUrl?: string;\n}\n\nexport function ForgotPasswordForm({\n onSuccess,\n onError,\n signInUrl = '/sign-in',\n}: ForgotPasswordFormProps) {\n const { forgotPassword } = useGitHat();\n const [email, setEmail] = useState('');\n const [isLoading, setIsLoading] = useState(false);\n const [sent, setSent] = useState(false);\n const [error, setError] = useState('');\n\n const emailValid = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email);\n\n const handleSubmit = async (e: FormEvent) => {\n e.preventDefault();\n if (!emailValid) {\n setError('Please enter a valid email address');\n return;\n }\n setIsLoading(true);\n setError('');\n try {\n await forgotPassword(email);\n setSent(true);\n onSuccess?.(email);\n } catch (err) {\n const message = err instanceof Error ? err.message : 'Failed to send reset email';\n setError(message);\n onError?.(err instanceof Error ? err : new Error(message));\n } finally {\n setIsLoading(false);\n }\n };\n\n if (sent) {\n return (\n <div className=\"githat-form-container\">\n <div className=\"githat-form-header\">\n <h2 className=\"githat-form-title\">Check your email</h2>\n <p className=\"githat-form-subtitle\">\n We sent a password reset link to <strong>{email}</strong>\n </p>\n </div>\n <a href={signInUrl} className=\"githat-link\">\n Back to sign in\n </a>\n <p className=\"githat-powered-by\">\n Secured by <strong>GitHat</strong>\n </p>\n </div>\n );\n }\n\n return (\n <div className=\"githat-form-container\">\n <div className=\"githat-form-header\">\n <h2 className=\"githat-form-title\">Forgot password</h2>\n <p className=\"githat-form-subtitle\">\n Enter your email and we'll send you a reset link\n </p>\n </div>\n {error && (\n <div className=\"githat-alert githat-alert-error\" role=\"alert\" aria-live=\"polite\">\n {error}\n </div>\n )}\n <form onSubmit={handleSubmit} className=\"githat-form\" aria-label=\"Forgot password form\">\n <div className=\"githat-field\">\n <label className=\"githat-label\" htmlFor=\"githat-forgot-email\">\n Email\n </label>\n <input\n id=\"githat-forgot-email\"\n className=\"githat-input\"\n type=\"email\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n placeholder=\"you@example.com\"\n autoComplete=\"email\"\n disabled={isLoading}\n required\n />\n </div>\n <button\n type=\"submit\"\n className=\"githat-button githat-button-primary\"\n disabled={isLoading || !email || (email.length > 0 && !emailValid)}\n >\n {isLoading ? 'Sending...' : 'Send reset link'}\n </button>\n </form>\n <p className=\"githat-form-footer\">\n Remember your password? <a href={signInUrl} className=\"githat-link\">Sign in</a>\n </p>\n <p className=\"githat-powered-by\">\n Secured by <strong>GitHat</strong>\n </p>\n </div>\n );\n}\n","'use client';\n\nimport React, { useState, FormEvent } from 'react';\nimport { useGitHat } from '../hooks';\n\ninterface ResetPasswordFormProps {\n token: string;\n onSuccess?: () => void;\n onError?: (error: Error) => void;\n signInUrl?: string;\n minPasswordLength?: number;\n}\n\nexport function ResetPasswordForm({\n token,\n onSuccess,\n onError,\n signInUrl = '/sign-in',\n minPasswordLength = 8,\n}: ResetPasswordFormProps) {\n const { resetPassword } = useGitHat();\n const [password, setPassword] = useState('');\n const [confirm, setConfirm] = useState('');\n const [isLoading, setIsLoading] = useState(false);\n const [success, setSuccess] = useState(false);\n const [error, setError] = useState('');\n\n const handleSubmit = async (e: FormEvent) => {\n e.preventDefault();\n if (password !== confirm) {\n setError('Passwords do not match');\n return;\n }\n if (password.length < minPasswordLength) {\n setError(`Password must be at least ${minPasswordLength} characters`);\n return;\n }\n setIsLoading(true);\n setError('');\n try {\n await resetPassword(token, password);\n setSuccess(true);\n onSuccess?.();\n } catch (err) {\n const message = err instanceof Error ? err.message : 'Failed to reset password';\n setError(message);\n onError?.(err instanceof Error ? err : new Error(message));\n } finally {\n setIsLoading(false);\n }\n };\n\n if (success) {\n return (\n <div className=\"githat-form-container\">\n <div className=\"githat-form-header\">\n <h2 className=\"githat-form-title\">Password reset!</h2>\n <p className=\"githat-form-subtitle\">\n Your password has been successfully reset.\n </p>\n </div>\n <a href={signInUrl} className=\"githat-button githat-button-primary\" style={{ display: 'block', textAlign: 'center', textDecoration: 'none' }}>\n Sign in\n </a>\n <p className=\"githat-powered-by\">\n Secured by <strong>GitHat</strong>\n </p>\n </div>\n );\n }\n\n return (\n <div className=\"githat-form-container\">\n <div className=\"githat-form-header\">\n <h2 className=\"githat-form-title\">Reset password</h2>\n <p className=\"githat-form-subtitle\">Enter your new password</p>\n </div>\n {error && (\n <div className=\"githat-alert githat-alert-error\" role=\"alert\" aria-live=\"polite\">\n {error}\n </div>\n )}\n <form onSubmit={handleSubmit} className=\"githat-form\" aria-label=\"Reset password form\">\n <div className=\"githat-field\">\n <label className=\"githat-label\" htmlFor=\"githat-reset-password\">\n New password\n </label>\n <input\n id=\"githat-reset-password\"\n className=\"githat-input\"\n type=\"password\"\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n placeholder=\"Enter new password\"\n autoComplete=\"new-password\"\n disabled={isLoading}\n required\n minLength={minPasswordLength}\n />\n </div>\n <div className=\"githat-field\">\n <label className=\"githat-label\" htmlFor=\"githat-reset-confirm\">\n Confirm password\n </label>\n <input\n id=\"githat-reset-confirm\"\n className=\"githat-input\"\n type=\"password\"\n value={confirm}\n onChange={(e) => setConfirm(e.target.value)}\n placeholder=\"Confirm new password\"\n autoComplete=\"new-password\"\n disabled={isLoading}\n required\n />\n </div>\n <button\n type=\"submit\"\n className=\"githat-button githat-button-primary\"\n disabled={isLoading || !password || !confirm}\n >\n {isLoading ? 'Resetting...' : 'Reset password'}\n </button>\n </form>\n <p className=\"githat-powered-by\">\n Secured by <strong>GitHat</strong>\n </p>\n </div>\n );\n}\n","'use client';\n\nimport React, { useEffect, useState } from 'react';\nimport { useGitHat } from '../hooks';\n\ninterface VerifyEmailStatusProps {\n token: string;\n onSuccess?: () => void;\n onError?: (error: Error) => void;\n signInUrl?: string;\n redirectDelay?: number;\n}\n\nexport function VerifyEmailStatus({\n token,\n onSuccess,\n onError,\n signInUrl = '/sign-in',\n redirectDelay = 3000,\n}: VerifyEmailStatusProps) {\n const { verifyEmail } = useGitHat();\n const [status, setStatus] = useState<'loading' | 'success' | 'error'>('loading');\n const [error, setError] = useState('');\n\n useEffect(() => {\n if (!token) {\n setStatus('error');\n setError('Missing verification token');\n return;\n }\n\n verifyEmail(token)\n .then(() => {\n setStatus('success');\n onSuccess?.();\n if (signInUrl && redirectDelay > 0) {\n setTimeout(() => {\n window.location.href = signInUrl;\n }, redirectDelay);\n }\n })\n .catch((err) => {\n setStatus('error');\n const message = err instanceof Error ? err.message : 'Verification failed';\n setError(message);\n onError?.(err instanceof Error ? err : new Error(message));\n });\n }, [token, verifyEmail, onSuccess, onError, signInUrl, redirectDelay]);\n\n return (\n <div className=\"githat-form-container\">\n {status === 'loading' && (\n <div className=\"githat-form-header\">\n <h2 className=\"githat-form-title\">Verifying email...</h2>\n <p className=\"githat-form-subtitle\">Please wait while we verify your email address.</p>\n </div>\n )}\n {status === 'success' && (\n <>\n <div className=\"githat-form-header\">\n <h2 className=\"githat-form-title\">Email verified!</h2>\n <p className=\"githat-form-subtitle\">\n Your email has been successfully verified. Redirecting to sign in...\n </p>\n </div>\n <a href={signInUrl} className=\"githat-button githat-button-primary\" style={{ display: 'block', textAlign: 'center', textDecoration: 'none' }}>\n Sign in now\n </a>\n </>\n )}\n {status === 'error' && (\n <>\n <div className=\"githat-form-header\">\n <h2 className=\"githat-form-title\">Verification failed</h2>\n <p className=\"githat-form-subtitle\">{error}</p>\n </div>\n <p className=\"githat-form-footer\">\n The link may have expired. <a href=\"/sign-up\" className=\"githat-link\">Try signing up again</a>\n </p>\n </>\n )}\n <p className=\"githat-powered-by\">\n Secured by <strong>GitHat</strong>\n </p>\n </div>\n );\n}\n","'use client';\n\nimport React, { useState, FormEvent } from 'react';\nimport { useGitHat } from '../hooks';\n\ninterface ChangePasswordFormProps {\n onSuccess?: () => void;\n onError?: (error: Error) => void;\n minPasswordLength?: number;\n}\n\nexport function ChangePasswordForm({\n onSuccess,\n onError,\n minPasswordLength = 8,\n}: ChangePasswordFormProps) {\n const { changePassword } = useGitHat();\n const [current, setCurrent] = useState('');\n const [newPass, setNewPass] = useState('');\n const [confirm, setConfirm] = useState('');\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState('');\n const [success, setSuccess] = useState(false);\n\n const handleSubmit = async (e: FormEvent) => {\n e.preventDefault();\n if (newPass !== confirm) {\n setError('Passwords do not match');\n return;\n }\n if (newPass.length < minPasswordLength) {\n setError(`Password must be at least ${minPasswordLength} characters`);\n return;\n }\n setIsLoading(true);\n setError('');\n try {\n await changePassword(current, newPass);\n setSuccess(true);\n setCurrent('');\n setNewPass('');\n setConfirm('');\n onSuccess?.();\n } catch (err) {\n const message = err instanceof Error ? err.message : 'Failed to change password';\n setError(message);\n onError?.(err instanceof Error ? err : new Error(message));\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <div className=\"githat-form-container\">\n <div className=\"githat-form-header\">\n <h2 className=\"githat-form-title\">Change password</h2>\n <p className=\"githat-form-subtitle\">Update your account password</p>\n </div>\n {success && (\n <div className=\"githat-alert githat-alert-success\" role=\"status\" aria-live=\"polite\">\n Password changed successfully!\n </div>\n )}\n {error && (\n <div className=\"githat-alert githat-alert-error\" role=\"alert\" aria-live=\"polite\">\n {error}\n </div>\n )}\n <form onSubmit={handleSubmit} className=\"githat-form\" aria-label=\"Change password form\">\n <div className=\"githat-field\">\n <label className=\"githat-label\" htmlFor=\"githat-change-current\">\n Current password\n </label>\n <input\n id=\"githat-change-current\"\n className=\"githat-input\"\n type=\"password\"\n value={current}\n onChange={(e) => setCurrent(e.target.value)}\n placeholder=\"Enter current password\"\n autoComplete=\"current-password\"\n disabled={isLoading}\n required\n />\n </div>\n <div className=\"githat-field\">\n <label className=\"githat-label\" htmlFor=\"githat-change-new\">\n New password\n </label>\n <input\n id=\"githat-change-new\"\n className=\"githat-input\"\n type=\"password\"\n value={newPass}\n onChange={(e) => setNewPass(e.target.value)}\n placeholder=\"Enter new password\"\n autoComplete=\"new-password\"\n disabled={isLoading}\n required\n minLength={minPasswordLength}\n />\n </div>\n <div className=\"githat-field\">\n <label className=\"githat-label\" htmlFor=\"githat-change-confirm\">\n Confirm new password\n </label>\n <input\n id=\"githat-change-confirm\"\n className=\"githat-input\"\n type=\"password\"\n value={confirm}\n onChange={(e) => setConfirm(e.target.value)}\n placeholder=\"Confirm new password\"\n autoComplete=\"new-password\"\n disabled={isLoading}\n required\n />\n </div>\n <button\n type=\"submit\"\n className=\"githat-button githat-button-primary\"\n disabled={isLoading || !current || !newPass || !confirm}\n >\n {isLoading ? 'Changing...' : 'Change password'}\n </button>\n </form>\n <p className=\"githat-powered-by\">\n Secured by <strong>GitHat</strong>\n </p>\n </div>\n );\n}\n","'use client';\n\nimport React, { useState, useCallback } from 'react';\nimport { useGitHat } from '../hooks';\n\nconst GitHubIcon = () => (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M12 0C5.374 0 0 5.373 0 12c0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23A11.509 11.509 0 0112 5.803c1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576C20.566 21.797 24 17.3 24 12c0-6.627-5.373-12-12-12z\"/>\n </svg>\n);\n\nexport interface GitHubButtonProps {\n /** Text to display on the button */\n children?: React.ReactNode;\n /** Custom redirect URI after GitHub auth */\n redirectUri?: string;\n /** Callback on successful auth */\n onSuccess?: (result: { user: any; org: any; isNewUser: boolean }) => void;\n /** Callback on error */\n onError?: (error: Error) => void;\n /** Additional class names */\n className?: string;\n /** Button variant */\n variant?: 'default' | 'outline';\n /** Disable the button */\n disabled?: boolean;\n}\n\nexport function GitHubButton({\n children = 'Continue with GitHub',\n redirectUri,\n onSuccess,\n onError,\n className = '',\n variant = 'default',\n disabled = false,\n}: GitHubButtonProps) {\n const { getGitHubOAuthUrl } = useGitHat();\n const [isLoading, setIsLoading] = useState(false);\n\n const handleClick = useCallback(async () => {\n if (isLoading || disabled) return;\n\n setIsLoading(true);\n try {\n // Generate a random state for CSRF protection\n const state = crypto.randomUUID();\n sessionStorage.setItem('githat_oauth_state', state);\n\n const { url } = await getGitHubOAuthUrl({ redirectUri, state });\n window.location.href = url;\n } catch (error) {\n setIsLoading(false);\n if (onError) {\n onError(error instanceof Error ? error : new Error('Failed to start GitHub OAuth'));\n }\n }\n }, [getGitHubOAuthUrl, redirectUri, onError, isLoading, disabled]);\n\n const baseStyles = 'githat-github-button';\n const variantStyles = variant === 'outline' ? 'githat-github-button-outline' : '';\n const disabledStyles = disabled || isLoading ? 'githat-github-button-disabled' : '';\n\n return (\n <button\n type=\"button\"\n onClick={handleClick}\n disabled={disabled || isLoading}\n className={`${baseStyles} ${variantStyles} ${disabledStyles} ${className}`.trim()}\n >\n {isLoading ? (\n <span className=\"githat-github-spinner\" />\n ) : (\n <GitHubIcon />\n )}\n <span>{children}</span>\n </button>\n );\n}\n\n// CSS styles injected inline\nif (typeof document !== 'undefined') {\n const styleId = 'githat-github-button-styles';\n if (!document.getElementById(styleId)) {\n const style = document.createElement('style');\n style.id = styleId;\n style.textContent = `\n .githat-github-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n padding: 0.625rem 1rem;\n font-size: 0.875rem;\n font-weight: 500;\n border-radius: 0.375rem;\n border: none;\n cursor: pointer;\n transition: all 0.15s ease;\n background-color: #24292f;\n color: #ffffff;\n width: 100%;\n }\n .githat-github-button:hover:not(:disabled) {\n background-color: #32383f;\n }\n .githat-github-button-outline {\n background-color: transparent;\n color: #24292f;\n border: 1px solid #d0d7de;\n }\n .githat-github-button-outline:hover:not(:disabled) {\n background-color: #f6f8fa;\n border-color: #24292f;\n }\n .githat-github-button-disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .githat-github-spinner {\n width: 1rem;\n height: 1rem;\n border: 2px solid currentColor;\n border-top-color: transparent;\n border-radius: 50%;\n animation: githat-spin 0.6s linear infinite;\n }\n @keyframes githat-spin {\n to { transform: rotate(360deg); }\n }\n `;\n document.head.appendChild(style);\n }\n}\n","'use client';\n\nimport React, { useEffect, useState } from 'react';\nimport { useGitHat } from '../hooks';\nimport { useAuth } from '../hooks';\n\nexport interface GitHubCallbackProps {\n /** URL to redirect to after successful auth */\n redirectUrl?: string;\n /** URL for new users (onboarding) */\n newUserRedirectUrl?: string;\n /** Callback on successful auth */\n onSuccess?: (result: { user: any; org: any; isNewUser: boolean }) => void;\n /** Callback on error */\n onError?: (error: Error) => void;\n /** Custom loading component */\n loadingComponent?: React.ReactNode;\n /** Custom error component */\n errorComponent?: (error: string) => React.ReactNode;\n}\n\nexport function GitHubCallback({\n redirectUrl = '/dashboard',\n newUserRedirectUrl,\n onSuccess,\n onError,\n loadingComponent,\n errorComponent,\n}: GitHubCallbackProps) {\n const { signInWithGitHub } = useGitHat();\n const { config } = useAuth();\n const [error, setError] = useState<string | null>(null);\n const [isProcessing, setIsProcessing] = useState(true);\n\n useEffect(() => {\n const handleCallback = async () => {\n // Get code and state from URL\n const params = new URLSearchParams(window.location.search);\n const code = params.get('code');\n const state = params.get('state');\n const errorParam = params.get('error');\n const errorDescription = params.get('error_description');\n\n // Check for OAuth errors\n if (errorParam) {\n const errorMsg = errorDescription || errorParam;\n setError(errorMsg);\n setIsProcessing(false);\n if (onError) {\n onError(new Error(errorMsg));\n }\n return;\n }\n\n if (!code) {\n const errorMsg = 'No authorization code received';\n setError(errorMsg);\n setIsProcessing(false);\n if (onError) {\n onError(new Error(errorMsg));\n }\n return;\n }\n\n // Validate state (CSRF protection)\n const savedState = sessionStorage.getItem('githat_oauth_state');\n if (savedState && state !== savedState) {\n const errorMsg = 'Invalid state parameter';\n setError(errorMsg);\n setIsProcessing(false);\n if (onError) {\n onError(new Error(errorMsg));\n }\n return;\n }\n sessionStorage.removeItem('githat_oauth_state');\n\n try {\n const result = await signInWithGitHub(code);\n\n if (onSuccess) {\n onSuccess(result);\n }\n\n // Redirect\n const targetUrl = result.isNewUser && newUserRedirectUrl\n ? newUserRedirectUrl\n : redirectUrl || config.afterSignInUrl || '/dashboard';\n\n window.location.href = targetUrl;\n } catch (err) {\n const errorMsg = err instanceof Error ? err.message : 'Authentication failed';\n setError(errorMsg);\n setIsProcessing(false);\n if (onError) {\n onError(err instanceof Error ? err : new Error(errorMsg));\n }\n }\n };\n\n handleCallback();\n }, [signInWithGitHub, redirectUrl, newUserRedirectUrl, config.afterSignInUrl, onSuccess, onError]);\n\n if (error) {\n if (errorComponent) {\n return <>{errorComponent(error)}</>;\n }\n\n return (\n <div className=\"githat-callback-error\">\n <h2>Authentication Failed</h2>\n <p>{error}</p>\n <a href=\"/sign-in\">Back to Sign In</a>\n </div>\n );\n }\n\n if (loadingComponent) {\n return <>{loadingComponent}</>;\n }\n\n return (\n <div className=\"githat-callback-loading\">\n <div className=\"githat-callback-spinner\" />\n <p>Completing sign in with GitHub...</p>\n </div>\n );\n}\n\n// CSS styles injected inline\nif (typeof document !== 'undefined') {\n const styleId = 'githat-callback-styles';\n if (!document.getElementById(styleId)) {\n const style = document.createElement('style');\n style.id = styleId;\n style.textContent = `\n .githat-callback-loading,\n .githat-callback-error {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n min-height: 200px;\n padding: 2rem;\n text-align: center;\n }\n .githat-callback-spinner {\n width: 2rem;\n height: 2rem;\n border: 3px solid #e5e7eb;\n border-top-color: #3b82f6;\n border-radius: 50%;\n animation: githat-spin 0.8s linear infinite;\n margin-bottom: 1rem;\n }\n .githat-callback-error h2 {\n color: #dc2626;\n margin-bottom: 0.5rem;\n }\n .githat-callback-error p {\n color: #6b7280;\n margin-bottom: 1rem;\n }\n .githat-callback-error a {\n color: #3b82f6;\n text-decoration: underline;\n }\n @keyframes githat-spin {\n to { transform: rotate(360deg); }\n }\n `;\n document.head.appendChild(style);\n }\n}\n","'use client';\n\nimport React, { useState, useCallback } from 'react';\nimport { useGitHat } from '../hooks';\n\nconst AWSIcon = () => (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M6.763 10.036c0 .296.032.535.088.71.064.176.144.368.256.576.04.063.056.127.056.183 0 .08-.048.16-.152.24l-.503.335a.383.383 0 0 1-.208.072c-.08 0-.16-.04-.239-.112a2.47 2.47 0 0 1-.287-.375 6.18 6.18 0 0 1-.248-.471c-.622.734-1.405 1.101-2.347 1.101-.67 0-1.205-.191-1.596-.574-.391-.384-.59-.894-.59-1.533 0-.678.239-1.23.726-1.644.487-.415 1.133-.623 1.955-.623.272 0 .551.024.846.064.296.04.6.104.918.176v-.583c0-.607-.127-1.03-.375-1.277-.255-.248-.686-.367-1.3-.367-.28 0-.568.031-.863.103-.295.072-.583.16-.862.272a2.287 2.287 0 0 1-.28.104.488.488 0 0 1-.127.023c-.112 0-.168-.08-.168-.247v-.391c0-.128.016-.224.056-.28a.597.597 0 0 1 .224-.167c.279-.144.614-.264 1.005-.36a4.84 4.84 0 0 1 1.246-.151c.95 0 1.644.216 2.091.647.439.43.662 1.085.662 1.963v2.586zm-3.24 1.214c.263 0 .534-.048.822-.144.287-.096.543-.271.758-.51.128-.152.224-.32.272-.512.047-.191.08-.423.08-.694v-.335a6.66 6.66 0 0 0-.735-.136 6.02 6.02 0 0 0-.75-.048c-.535 0-.926.104-1.19.32-.263.215-.39.518-.39.917 0 .375.095.655.295.846.191.2.47.296.838.296zm6.41.862c-.144 0-.24-.024-.304-.08-.064-.048-.12-.16-.168-.311L7.586 5.55a1.398 1.398 0 0 1-.072-.32c0-.128.064-.2.191-.2h.783c.151 0 .255.025.31.08.065.048.113.16.16.312l1.342 5.284 1.245-5.284c.04-.16.088-.264.151-.312a.549.549 0 0 1 .32-.08h.638c.152 0 .256.025.32.08.063.048.12.16.151.312l1.261 5.348 1.381-5.348c.048-.16.104-.264.16-.312a.52.52 0 0 1 .311-.08h.743c.127 0 .2.065.2.2 0 .04-.009.08-.017.128a1.137 1.137 0 0 1-.056.2l-1.923 6.17c-.048.16-.104.264-.168.312a.51.51 0 0 1-.303.08h-.687c-.151 0-.255-.024-.32-.08-.063-.056-.119-.16-.15-.32l-1.238-5.148-1.23 5.14c-.04.16-.087.264-.15.32-.065.056-.177.08-.32.08zm10.256.215c-.415 0-.83-.048-1.229-.143-.399-.096-.71-.2-.918-.32-.128-.071-.215-.151-.247-.223a.563.563 0 0 1-.048-.224v-.407c0-.167.064-.247.183-.247.048 0 .096.008.144.024.048.016.12.048.2.08.271.12.566.215.878.279.319.064.63.096.95.096.502 0 .894-.088 1.165-.264a.86.86 0 0 0 .415-.758.777.777 0 0 0-.215-.559c-.144-.151-.415-.287-.806-.415l-1.157-.36c-.583-.183-1.014-.454-1.277-.813a1.902 1.902 0 0 1-.4-1.158c0-.335.073-.63.216-.886.144-.255.336-.479.575-.654.24-.184.51-.32.83-.415.32-.096.655-.136 1.006-.136.176 0 .359.008.535.032.183.024.35.056.518.088.16.04.312.08.455.127.144.048.256.096.336.144a.69.69 0 0 1 .24.2.43.43 0 0 1 .071.263v.375c0 .168-.064.256-.184.256a.83.83 0 0 1-.303-.096 3.652 3.652 0 0 0-1.532-.311c-.455 0-.815.071-1.062.223-.248.152-.375.383-.375.71 0 .224.08.416.24.567.159.152.454.304.877.44l1.134.358c.574.184.99.44 1.237.767.247.327.367.702.367 1.117 0 .343-.072.655-.207.926-.144.272-.336.511-.583.703-.248.2-.543.343-.886.447-.36.111-.734.167-1.142.167z\"/>\n </svg>\n);\n\nexport interface CognitoButtonProps {\n /** Text to display on the button */\n children?: React.ReactNode;\n /** Custom redirect URI after Cognito auth */\n redirectUri?: string;\n /** Specific identity provider (e.g., 'Google', 'Facebook') */\n identityProvider?: string;\n /** Callback on error */\n onError?: (error: Error) => void;\n /** Additional class names */\n className?: string;\n /** Button variant */\n variant?: 'default' | 'outline';\n /** Disable the button */\n disabled?: boolean;\n}\n\nexport function CognitoButton({\n children = 'Continue with AWS',\n redirectUri,\n identityProvider,\n onError,\n className = '',\n variant = 'default',\n disabled = false,\n}: CognitoButtonProps) {\n const { getCognitoOAuthUrl } = useGitHat();\n const [isLoading, setIsLoading] = useState(false);\n\n const handleClick = useCallback(async () => {\n if (isLoading || disabled) return;\n\n setIsLoading(true);\n try {\n const state = crypto.randomUUID();\n sessionStorage.setItem('githat_cognito_oauth_state', state);\n\n const { url } = await getCognitoOAuthUrl({ redirectUri, state, identityProvider });\n window.location.href = url;\n } catch (error) {\n setIsLoading(false);\n if (onError) {\n onError(error instanceof Error ? error : new Error('Failed to start Cognito OAuth'));\n }\n }\n }, [getCognitoOAuthUrl, redirectUri, identityProvider, onError, isLoading, disabled]);\n\n const baseStyles = 'githat-cognito-button';\n const variantStyles = variant === 'outline' ? 'githat-cognito-button-outline' : '';\n const disabledStyles = disabled || isLoading ? 'githat-cognito-button-disabled' : '';\n\n return (\n <button\n type=\"button\"\n onClick={handleClick}\n disabled={disabled || isLoading}\n className={`${baseStyles} ${variantStyles} ${disabledStyles} ${className}`.trim()}\n >\n {isLoading ? (\n <span className=\"githat-cognito-spinner\" />\n ) : (\n <AWSIcon />\n )}\n <span>{children}</span>\n </button>\n );\n}\n\n// CSS styles\nif (typeof document !== 'undefined') {\n const styleId = 'githat-cognito-button-styles';\n if (!document.getElementById(styleId)) {\n const style = document.createElement('style');\n style.id = styleId;\n style.textContent = `\n .githat-cognito-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n padding: 0.625rem 1rem;\n font-size: 0.875rem;\n font-weight: 500;\n border-radius: 0.375rem;\n border: none;\n cursor: pointer;\n transition: all 0.15s ease;\n background-color: #ff9900;\n color: #232f3e;\n width: 100%;\n }\n .githat-cognito-button:hover:not(:disabled) {\n background-color: #ec7211;\n }\n .githat-cognito-button-outline {\n background-color: transparent;\n color: #ff9900;\n border: 1px solid #ff9900;\n }\n .githat-cognito-button-outline:hover:not(:disabled) {\n background-color: rgba(255, 153, 0, 0.1);\n }\n .githat-cognito-button-disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .githat-cognito-spinner {\n width: 1rem;\n height: 1rem;\n border: 2px solid currentColor;\n border-top-color: transparent;\n border-radius: 50%;\n animation: githat-cognito-spin 0.6s linear infinite;\n }\n @keyframes githat-cognito-spin {\n to { transform: rotate(360deg); }\n }\n `;\n document.head.appendChild(style);\n }\n}\n","'use client';\n\nimport React, { useEffect, useState } from 'react';\nimport { useGitHat, useAuth } from '../hooks';\n\nexport interface CognitoCallbackProps {\n /** URL to redirect to after successful auth */\n redirectUrl?: string;\n /** URL for new users (onboarding) */\n newUserRedirectUrl?: string;\n /** Callback on successful auth */\n onSuccess?: (result: { user: any; org: any; isNewUser: boolean }) => void;\n /** Callback on error */\n onError?: (error: Error) => void;\n /** Custom loading component */\n loadingComponent?: React.ReactNode;\n /** Custom error component */\n errorComponent?: (error: string) => React.ReactNode;\n}\n\nexport function CognitoCallback({\n redirectUrl = '/dashboard',\n newUserRedirectUrl,\n onSuccess,\n onError,\n loadingComponent,\n errorComponent,\n}: CognitoCallbackProps) {\n const { signInWithCognito } = useGitHat();\n const { config } = useAuth();\n const [error, setError] = useState<string | null>(null);\n const [isProcessing, setIsProcessing] = useState(true);\n\n useEffect(() => {\n const handleCallback = async () => {\n const params = new URLSearchParams(window.location.search);\n const code = params.get('code');\n const state = params.get('state');\n const errorParam = params.get('error');\n const errorDescription = params.get('error_description');\n\n if (errorParam) {\n const errorMsg = errorDescription || errorParam;\n setError(errorMsg);\n setIsProcessing(false);\n if (onError) {\n onError(new Error(errorMsg));\n }\n return;\n }\n\n if (!code) {\n const errorMsg = 'No authorization code received';\n setError(errorMsg);\n setIsProcessing(false);\n if (onError) {\n onError(new Error(errorMsg));\n }\n return;\n }\n\n // Validate state (CSRF protection)\n const savedState = sessionStorage.getItem('githat_cognito_oauth_state');\n if (savedState && state !== savedState) {\n const errorMsg = 'Invalid state parameter';\n setError(errorMsg);\n setIsProcessing(false);\n if (onError) {\n onError(new Error(errorMsg));\n }\n return;\n }\n sessionStorage.removeItem('githat_cognito_oauth_state');\n\n try {\n const result = await signInWithCognito(code);\n\n if (onSuccess) {\n onSuccess(result);\n }\n\n const targetUrl = result.isNewUser && newUserRedirectUrl\n ? newUserRedirectUrl\n : redirectUrl || config.afterSignInUrl || '/dashboard';\n\n window.location.href = targetUrl;\n } catch (err) {\n const errorMsg = err instanceof Error ? err.message : 'Authentication failed';\n setError(errorMsg);\n setIsProcessing(false);\n if (onError) {\n onError(err instanceof Error ? err : new Error(errorMsg));\n }\n }\n };\n\n handleCallback();\n }, [signInWithCognito, redirectUrl, newUserRedirectUrl, config.afterSignInUrl, onSuccess, onError]);\n\n if (error) {\n if (errorComponent) {\n return <>{errorComponent(error)}</>;\n }\n\n return (\n <div className=\"githat-callback-error\">\n <h2>Authentication Failed</h2>\n <p>{error}</p>\n <a href=\"/sign-in\">Back to Sign In</a>\n </div>\n );\n }\n\n if (loadingComponent) {\n return <>{loadingComponent}</>;\n }\n\n return (\n <div className=\"githat-callback-loading\">\n <div className=\"githat-callback-spinner\" />\n <p>Completing sign in with AWS Cognito...</p>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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A,oDAAC,QAAG,mCAAqB;AAAA,MACzB,8CAAC,OAAG,iBAAM;AAAA,MACV,8CAAC,OAAE,MAAK,YAAW,6BAAe;AAAA,OACpC;AAAA,EAEJ;AAEA,MAAI,kBAAkB;AACpB,WAAO,+EAAG,4BAAiB;AAAA,EAC7B;AAEA,SACE,+CAAC,SAAI,WAAU,2BACb;AAAA,kDAAC,SAAI,WAAU,2BAA0B;AAAA,IACzC,8CAAC,OAAE,oDAAsC;AAAA,KAC3C;AAEJ;","names":["import_react","import_react","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/provider.tsx","../src/config.ts","../src/client.ts","../src/hooks.ts","../src/data.ts","../src/email.ts","../src/components/SignInForm.tsx","../src/components/SignUpForm.tsx","../src/components/SignInButton.tsx","../src/components/SignUpButton.tsx","../src/components/UserButton.tsx","../src/components/OrgSwitcher.tsx","../src/components/VerifiedBadge.tsx","../src/components/ProtectedRoute.tsx","../src/components/ForgotPasswordForm.tsx","../src/components/ResetPasswordForm.tsx","../src/components/VerifyEmailStatus.tsx","../src/components/ChangePasswordForm.tsx","../src/components/GitHubButton.tsx","../src/components/GitHubCallback.tsx","../src/components/CognitoButton.tsx","../src/components/CognitoCallback.tsx"],"sourcesContent":["// Provider\nexport { GitHatProvider } from './provider';\n\n// Hooks\nexport { useAuth, useGitHat } from './hooks';\nexport { useData } from './data';\nexport { useEmail } from './email';\n\n// Components\nexport { SignInForm } from './components/SignInForm';\nexport { SignUpForm } from './components/SignUpForm';\nexport { SignInButton } from './components/SignInButton';\nexport { SignUpButton } from './components/SignUpButton';\nexport { UserButton } from './components/UserButton';\nexport { OrgSwitcher } from './components/OrgSwitcher';\nexport { VerifiedBadge } from './components/VerifiedBadge';\nexport { ProtectedRoute } from './components/ProtectedRoute';\nexport { ForgotPasswordForm } from './components/ForgotPasswordForm';\nexport { ResetPasswordForm } from './components/ResetPasswordForm';\nexport { VerifyEmailStatus } from './components/VerifyEmailStatus';\nexport { ChangePasswordForm } from './components/ChangePasswordForm';\n// OAuth (Web2)\nexport { GitHubButton } from './components/GitHubButton';\nexport { GitHubCallback } from './components/GitHubCallback';\nexport { CognitoButton } from './components/CognitoButton';\nexport { CognitoCallback } from './components/CognitoCallback';\n\n// Types\nexport type {\n GitHatUser,\n GitHatOrg,\n GitHatConfig,\n AuthState,\n AuthActions,\n SignUpData,\n SignUpResult,\n GitHatContextValue,\n PasswordResetResult,\n EmailVerificationResult,\n} from './types';\n\nexport type {\n DataItem,\n QueryOptions,\n QueryResult,\n PutResult,\n DeleteResult,\n BatchOperation,\n BatchResult,\n} from './data';\n\nexport type {\n SendEmailOptions,\n SendEmailResult,\n} from './email';\n\n// Re-export server types (for TypeScript consumers who import from main entry)\nexport type {\n AuthPayload,\n VerifyOptions,\n OrgMetadata,\n AuthenticatedHandler,\n WithAuthOptions,\n ServerSendEmailOptions,\n ServerSendEmailResult,\n} from './server';\n","'use client';\n\nimport React, { createContext, useState, useEffect, useCallback, useMemo, useRef } from 'react';\nimport type { GitHatConfig, GitHatContextValue, GitHatUser, GitHatOrg, SignUpData, SignUpResult } from './types';\nimport { TOKEN_KEYS, resolveConfig } from './config';\nimport { createClient } from './client';\n\nexport const GitHatContext = createContext<GitHatContextValue | null>(null);\n\nfunction isDevMode(key: string): boolean {\n return !key || (!key.startsWith('pk_live_') && !key.startsWith('pk_test_'));\n}\n\nfunction DevModeBanner() {\n const [dismissed, setDismissed] = useState(() => {\n if (typeof window === 'undefined') return true;\n return localStorage.getItem('githat_dev_banner_dismissed') === '1';\n });\n\n if (dismissed || typeof window === 'undefined') return null;\n\n const hostname = window.location.hostname;\n if (hostname !== 'localhost' && hostname !== '127.0.0.1') return null;\n\n return (\n <div className=\"githat-dev-banner\" role=\"status\">\n <span>\n <strong>GitHat Dev Mode</strong> — No publishable key. Auth works on localhost.{' '}\n <a href=\"https://githat.io/dashboard/apps\" target=\"_blank\" rel=\"noopener noreferrer\">\n Get your key\n </a>\n </span>\n <button\n onClick={() => {\n setDismissed(true);\n localStorage.setItem('githat_dev_banner_dismissed', '1');\n }}\n aria-label=\"Dismiss\"\n >\n ×\n </button>\n </div>\n );\n}\n\ninterface GitHatProviderProps {\n config: GitHatConfig;\n children: React.ReactNode;\n}\n\nexport function GitHatProvider({ config: rawConfig, children }: GitHatProviderProps) {\n const config = useMemo(() => resolveConfig(rawConfig), [rawConfig]);\n const useCookies = config.tokenStorage === 'cookie';\n const devMode = isDevMode(config.publishableKey);\n\n // Create client with cookie mode awareness\n const clientRef = useRef(createClient(config.apiUrl, config.publishableKey, { useCookies }));\n\n // Dev mode console warning (runs once on mount)\n useEffect(() => {\n if (!devMode || typeof window === 'undefined') return;\n\n const hostname = window.location.hostname;\n if (hostname === 'localhost' || hostname === '127.0.0.1') {\n console.warn(\n '%c GitHat Dev Mode %c No publishable key configured. Auth works on localhost but will fail in production. Get your key at https://githat.io/dashboard/apps',\n 'background: #f59e0b; color: #000; font-weight: bold; padding: 2px 6px; border-radius: 3px;',\n 'color: #f59e0b;'\n );\n } else {\n console.error(\n '%c GitHat %c Missing publishable key. Auth requests will fail. Add NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY to your environment. Get your key at https://githat.io/dashboard/apps',\n 'background: #ef4444; color: #fff; font-weight: bold; padding: 2px 6px; border-radius: 3px;',\n 'color: #ef4444;'\n );\n }\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n const [user, setUser] = useState<GitHatUser | null>(null);\n const [org, setOrg] = useState<GitHatOrg | null>(null);\n const [isSignedIn, setIsSignedIn] = useState(false);\n const [isLoading, setIsLoading] = useState(true);\n const [authError, setAuthError] = useState<string | null>(null);\n\n // Validate stored token/session on mount\n useEffect(() => {\n const validateSession = async () => {\n try {\n // In cookie mode, we always try to validate (cookies sent automatically)\n // In localStorage mode, only validate if we have a token\n if (!useCookies) {\n const token = localStorage.getItem(TOKEN_KEYS.accessToken);\n const storedUser = localStorage.getItem(TOKEN_KEYS.user);\n if (!token || !storedUser) {\n setIsLoading(false);\n return;\n }\n }\n\n const data = await clientRef.current.fetchApi<{ user: GitHatUser; currentOrg: GitHatOrg }>('/auth/me');\n\n if (data.user) {\n setUser(data.user);\n setOrg(data.currentOrg || null);\n setIsSignedIn(true);\n setAuthError(null);\n\n // Store user info in localStorage for client-side access (even in cookie mode)\n if (!useCookies) {\n localStorage.setItem(TOKEN_KEYS.user, JSON.stringify(data.user));\n if (data.currentOrg) {\n localStorage.setItem(TOKEN_KEYS.org, JSON.stringify(data.currentOrg));\n }\n }\n }\n } catch (err: unknown) {\n const error = err as Error;\n if (error.message === 'Session expired') {\n clientRef.current.clearAuth();\n } else if (!useCookies) {\n // Network error in localStorage mode — try to use stored user\n const storedUser = localStorage.getItem(TOKEN_KEYS.user);\n if (storedUser) {\n try {\n setUser(JSON.parse(storedUser));\n setIsSignedIn(true);\n } catch {}\n }\n setAuthError(error.message || 'Failed to verify session');\n }\n // In cookie mode with error, just stay logged out\n }\n setIsLoading(false);\n };\n\n validateSession();\n }, [useCookies]);\n\n // Listen for auth-changed events\n useEffect(() => {\n const handleAuthChanged = (e: Event) => {\n const detail = (e as CustomEvent).detail;\n if (detail?.signedIn === false) {\n setIsSignedIn(false);\n setUser(null);\n setOrg(null);\n } else if (detail?.signedIn === true && detail?.user) {\n setUser(detail.user);\n setIsSignedIn(true);\n if (detail.org) setOrg(detail.org);\n }\n };\n window.addEventListener('githat:auth-changed', handleAuthChanged);\n return () => window.removeEventListener('githat:auth-changed', handleAuthChanged);\n }, []);\n\n const signIn = useCallback(async (email: string, password: string) => {\n // Build login URL with setCookie param if in cookie mode\n const loginUrl = useCookies ? '/auth/login?setCookie=true' : '/auth/login';\n\n const data = await clientRef.current.fetchApi<{\n accessToken?: string;\n refreshToken?: string;\n user: GitHatUser;\n org: GitHatOrg;\n }>(loginUrl, {\n method: 'POST',\n body: JSON.stringify({ email, password }),\n });\n\n // In localStorage mode, store tokens\n if (!useCookies && data.accessToken && data.refreshToken) {\n localStorage.setItem(TOKEN_KEYS.accessToken, data.accessToken);\n localStorage.setItem(TOKEN_KEYS.refreshToken, data.refreshToken);\n localStorage.setItem(TOKEN_KEYS.user, JSON.stringify(data.user));\n if (data.org) localStorage.setItem(TOKEN_KEYS.org, JSON.stringify(data.org));\n }\n\n setUser(data.user);\n setOrg(data.org || null);\n setIsSignedIn(true);\n\n window.dispatchEvent(new CustomEvent('githat:auth-changed', {\n detail: { user: data.user, org: data.org, signedIn: true },\n }));\n }, [useCookies]);\n\n const signUp = useCallback(async (signUpData: SignUpData): Promise<SignUpResult> => {\n // Build register URL with setCookie param if in cookie mode\n const registerUrl = useCookies ? '/auth/register?setCookie=true' : '/auth/register';\n\n const data = await clientRef.current.fetchApi<{\n accessToken?: string;\n refreshToken?: string;\n user: GitHatUser;\n org: GitHatOrg;\n }>(registerUrl, {\n method: 'POST',\n body: JSON.stringify(signUpData),\n });\n\n // In localStorage mode, store tokens\n if (!useCookies && data.accessToken && data.refreshToken) {\n localStorage.setItem(TOKEN_KEYS.accessToken, data.accessToken);\n localStorage.setItem(TOKEN_KEYS.refreshToken, data.refreshToken);\n localStorage.setItem(TOKEN_KEYS.user, JSON.stringify(data.user));\n if (data.org) localStorage.setItem(TOKEN_KEYS.org, JSON.stringify(data.org));\n }\n\n setUser(data.user);\n setOrg(data.org || null);\n setIsSignedIn(true);\n\n window.dispatchEvent(new CustomEvent('githat:auth-changed', {\n detail: { user: data.user, org: data.org, signedIn: true },\n }));\n\n return { requiresVerification: !data.user.emailVerified, email: signUpData.email };\n }, [useCookies]);\n\n const signOut = useCallback(async () => {\n try {\n // In cookie mode, logout endpoint clears cookies\n const logoutUrl = useCookies ? '/auth/logout?setCookie=true' : '/auth/logout';\n await clientRef.current.fetchApi(logoutUrl, { method: 'POST' });\n } catch {}\n clientRef.current.clearAuth();\n setIsSignedIn(false);\n setUser(null);\n setOrg(null);\n if (typeof window !== 'undefined' && config.afterSignOutUrl) {\n window.location.href = config.afterSignOutUrl;\n }\n }, [config.afterSignOutUrl, useCookies]);\n\n const switchOrg = useCallback(async (orgId: string) => {\n try {\n const switchUrl = useCookies\n ? `/user/orgs/${orgId}/switch?setCookie=true`\n : `/user/orgs/${orgId}/switch`;\n\n const data = await clientRef.current.fetchApi<{\n accessToken?: string;\n refreshToken?: string;\n org: GitHatOrg;\n }>(switchUrl, { method: 'POST' });\n\n // In localStorage mode, store new tokens\n if (!useCookies) {\n if (data.accessToken) localStorage.setItem(TOKEN_KEYS.accessToken, data.accessToken);\n if (data.refreshToken) localStorage.setItem(TOKEN_KEYS.refreshToken, data.refreshToken);\n localStorage.setItem(TOKEN_KEYS.org, JSON.stringify(data.org));\n }\n\n setOrg(data.org);\n\n window.dispatchEvent(new CustomEvent('githat:auth-changed', {\n detail: { user, org: data.org, signedIn: true },\n }));\n } catch (e) {\n console.error('Org switch failed:', e);\n }\n }, [user, useCookies]);\n\n const value = useMemo<GitHatContextValue>(() => ({\n user, org, isSignedIn, isLoading, authError, config,\n signIn, signUp, signOut, switchOrg,\n }), [user, org, isSignedIn, isLoading, authError, config, signIn, signUp, signOut, switchOrg]);\n\n return (\n <GitHatContext.Provider value={value}>\n {devMode && <DevModeBanner />}\n {children}\n </GitHatContext.Provider>\n );\n}\n","import type { GitHatConfig } from './types';\n\nexport const DEFAULT_API_URL = 'https://api.githat.io';\n\nexport const TOKEN_KEYS = {\n accessToken: 'githat_access_token',\n refreshToken: 'githat_refresh_token',\n user: 'githat_user',\n org: 'githat_org',\n} as const;\n\nexport const COOKIE_NAMES = {\n accessToken: 'githat_access',\n refreshToken: 'githat_refresh',\n} as const;\n\nexport function resolveConfig(config: GitHatConfig): Required<GitHatConfig> {\n return {\n publishableKey: config.publishableKey,\n apiUrl: config.apiUrl || DEFAULT_API_URL,\n signInUrl: config.signInUrl || '/sign-in',\n signUpUrl: config.signUpUrl || '/sign-up',\n afterSignInUrl: config.afterSignInUrl || '/dashboard',\n afterSignOutUrl: config.afterSignOutUrl || '/',\n tokenStorage: config.tokenStorage || 'localStorage',\n };\n}\n","import { TOKEN_KEYS } from './config';\n\ninterface ClientOptions {\n /**\n * When true, use credentials: 'include' for all requests\n * and don't send Authorization header (cookies handle auth)\n */\n useCookies?: boolean;\n}\n\nlet _refreshPromise: Promise<boolean> | null = null;\n\nasync function refreshTokens(\n apiUrl: string,\n appKey: string,\n useCookies: boolean\n): Promise<boolean> {\n // In cookie mode, refresh token comes from cookie\n // In localStorage mode, we need to send it in the body\n const refreshToken =\n typeof window !== 'undefined' && !useCookies\n ? localStorage.getItem(TOKEN_KEYS.refreshToken)\n : null;\n\n // In localStorage mode, we need a refresh token\n if (!useCookies && !refreshToken) return false;\n\n let orgId: string | null = null;\n try {\n const orgStr = localStorage.getItem(TOKEN_KEYS.org);\n if (orgStr) orgId = JSON.parse(orgStr).id;\n } catch {}\n\n try {\n const refreshUrl = useCookies\n ? `${apiUrl}/auth/refresh?setCookie=true`\n : `${apiUrl}/auth/refresh`;\n\n const res = await fetch(refreshUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'X-GitHat-App-Key': appKey,\n },\n credentials: useCookies ? 'include' : 'same-origin',\n body: JSON.stringify(useCookies ? { orgId } : { refreshToken, orgId }),\n });\n\n if (!res.ok) return false;\n\n const data = await res.json();\n\n // In localStorage mode, store the new tokens\n if (!useCookies) {\n if (data.accessToken) localStorage.setItem(TOKEN_KEYS.accessToken, data.accessToken);\n if (data.refreshToken) localStorage.setItem(TOKEN_KEYS.refreshToken, data.refreshToken);\n }\n\n if (data.org) localStorage.setItem(TOKEN_KEYS.org, JSON.stringify(data.org));\n return true;\n } catch {\n return false;\n }\n}\n\nfunction clearAuth() {\n if (typeof window === 'undefined') return;\n Object.values(TOKEN_KEYS).forEach((key) => localStorage.removeItem(key));\n window.dispatchEvent(\n new CustomEvent('githat:auth-changed', {\n detail: { user: null, org: null, signedIn: false },\n })\n );\n}\n\nexport function createClient(\n apiUrl: string,\n appKey: string,\n options: ClientOptions = {}\n) {\n const { useCookies = false } = options;\n\n async function fetchApi<T = unknown>(\n endpoint: string,\n fetchOptions: RequestInit = {}\n ): Promise<T> {\n const url = `${apiUrl}${endpoint}`;\n\n // In localStorage mode, get token from storage\n // In cookie mode, cookies are sent automatically with credentials: 'include'\n const token =\n typeof window !== 'undefined' && !useCookies\n ? localStorage.getItem(TOKEN_KEYS.accessToken)\n : null;\n\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n 'X-GitHat-App-Key': appKey,\n ...(token && { Authorization: `Bearer ${token}` }),\n ...(fetchOptions.headers as Record<string, string>),\n };\n\n let response: Response;\n try {\n response = await fetch(url, {\n ...fetchOptions,\n headers,\n credentials: useCookies ? 'include' : 'same-origin',\n });\n } catch (networkError: unknown) {\n // Network errors (CORS blocked, offline, DNS failure) throw TypeError\n if (networkError instanceof TypeError) {\n const isMissingKey = !appKey || (!appKey.startsWith('pk_live_') && !appKey.startsWith('pk_test_'));\n const isLocalhost =\n typeof window !== 'undefined' &&\n (window.location.hostname === 'localhost' ||\n window.location.hostname === '127.0.0.1');\n\n if (isMissingKey && !isLocalhost) {\n throw new Error(\n 'GitHat: Missing or invalid publishable key. Add NEXT_PUBLIC_GITHAT_PUBLISHABLE_KEY to your environment variables. Get your key at https://githat.io/dashboard/apps'\n );\n }\n if (isLocalhost) {\n throw new Error(\n 'GitHat: Cannot reach api.githat.io. Check your internet connection.'\n );\n }\n throw new Error(\n 'GitHat: API request failed. Verify your publishable key and app domain at https://githat.io/dashboard/apps'\n );\n }\n throw networkError;\n }\n\n if (response.status === 401) {\n // Queue all 401 retries behind a single refresh promise\n if (!_refreshPromise) {\n _refreshPromise = refreshTokens(apiUrl, appKey, useCookies).finally(() => {\n _refreshPromise = null;\n });\n }\n\n const refreshed = await _refreshPromise;\n\n if (refreshed) {\n // Get the new token (only needed in localStorage mode)\n const newToken =\n !useCookies && typeof window !== 'undefined'\n ? localStorage.getItem(TOKEN_KEYS.accessToken)\n : null;\n\n const retryResponse = await fetch(url, {\n ...fetchOptions,\n headers: {\n ...headers,\n ...(newToken && { Authorization: `Bearer ${newToken}` }),\n },\n credentials: useCookies ? 'include' : 'same-origin',\n });\n\n const retryData = await retryResponse.json();\n if (!retryResponse.ok) throw new Error(retryData.error || 'Request failed');\n return retryData as T;\n }\n\n clearAuth();\n throw new Error('Session expired');\n }\n\n const data = await response.json();\n if (!response.ok) throw new Error(data.error || 'Request failed');\n return data as T;\n }\n\n return { fetchApi, clearAuth };\n}\n","'use client';\n\nimport { useContext, useMemo, useCallback } from 'react';\nimport { GitHatContext } from './provider';\nimport { createClient } from './client';\nimport type { GitHatContextValue, GitHatOrg, GitHatUser } from './types';\n\nexport interface OrgMetadata {\n [key: string]: unknown;\n}\n\nexport function useAuth(): GitHatContextValue {\n const ctx = useContext(GitHatContext);\n if (!ctx) throw new Error('useAuth must be used within a <GitHatProvider>');\n return ctx;\n}\n\nexport function useGitHat() {\n const ctx = useAuth();\n const client = useMemo(\n () => createClient(ctx.config.apiUrl!, ctx.config.publishableKey),\n [ctx.config.apiUrl, ctx.config.publishableKey]\n );\n\n /**\n * Get the current organization's metadata.\n * Requires the user to be signed in with an active organization.\n *\n * @example\n * ```tsx\n * const { getOrgMetadata } = useGitHat();\n * const meta = await getOrgMetadata();\n * console.log(meta.stripeAccountId);\n * ```\n */\n const getOrgMetadata = useCallback(async (): Promise<OrgMetadata> => {\n if (!ctx.org?.id) {\n throw new Error('No active organization');\n }\n const response = await client.fetchApi<{ metadata: OrgMetadata }>(\n `/orgs/${ctx.org.id}/metadata`\n );\n return response.metadata || {};\n }, [client, ctx.org?.id]);\n\n /**\n * Update the current organization's metadata.\n * Merges the provided object with existing metadata.\n * Set a key to null to delete it.\n * Requires admin or owner role.\n *\n * @example\n * ```tsx\n * const { updateOrgMetadata } = useGitHat();\n * // Set values\n * await updateOrgMetadata({ stripeAccountId: 'acct_xxx', features: ['pos'] });\n * // Delete a key\n * await updateOrgMetadata({ oldKey: null });\n * ```\n */\n const updateOrgMetadata = useCallback(\n async (updates: OrgMetadata): Promise<OrgMetadata> => {\n if (!ctx.org?.id) {\n throw new Error('No active organization');\n }\n const response = await client.fetchApi<{ metadata: OrgMetadata }>(\n `/orgs/${ctx.org.id}/metadata`,\n {\n method: 'PATCH',\n body: JSON.stringify(updates),\n }\n );\n return response.metadata || {};\n },\n [client, ctx.org?.id]\n );\n\n // ============================================================================\n // Password Management\n // ============================================================================\n\n /**\n * Request a password reset email.\n *\n * @example\n * ```tsx\n * const { forgotPassword } = useGitHat();\n * await forgotPassword('user@example.com');\n * // Check email for reset link\n * ```\n */\n const forgotPassword = useCallback(\n async (email: string): Promise<{ success: boolean }> => {\n await client.fetchApi('/auth/forgot-password', {\n method: 'POST',\n body: JSON.stringify({ email }),\n });\n return { success: true };\n },\n [client]\n );\n\n /**\n * Reset password using a token from email.\n *\n * @example\n * ```tsx\n * const { resetPassword } = useGitHat();\n * const token = searchParams.get('token');\n * await resetPassword(token, 'NewSecurePassword123!');\n * ```\n */\n const resetPassword = useCallback(\n async (token: string, newPassword: string): Promise<{ success: boolean }> => {\n await client.fetchApi('/auth/reset-password', {\n method: 'POST',\n body: JSON.stringify({ token, password: newPassword }),\n });\n return { success: true };\n },\n [client]\n );\n\n /**\n * Change password for authenticated user.\n * Requires current password for verification.\n *\n * @example\n * ```tsx\n * const { changePassword } = useGitHat();\n * await changePassword('currentPassword', 'newSecurePassword123!');\n * ```\n */\n const changePassword = useCallback(\n async (currentPassword: string, newPassword: string): Promise<{ success: boolean }> => {\n await client.fetchApi('/auth/change-password', {\n method: 'POST',\n body: JSON.stringify({ currentPassword, newPassword }),\n });\n return { success: true };\n },\n [client]\n );\n\n // ============================================================================\n // Email Verification\n // ============================================================================\n\n /**\n * Verify email using a token from the verification email.\n *\n * @example\n * ```tsx\n * const { verifyEmail } = useGitHat();\n * const token = searchParams.get('token');\n * await verifyEmail(token);\n * ```\n */\n const verifyEmail = useCallback(\n async (token: string): Promise<{ success: boolean }> => {\n await client.fetchApi('/auth/verify-email', {\n method: 'POST',\n body: JSON.stringify({ token }),\n });\n return { success: true };\n },\n [client]\n );\n\n /**\n * Resend verification email to the specified address.\n *\n * @example\n * ```tsx\n * const { resendVerificationEmail } = useGitHat();\n * await resendVerificationEmail('user@example.com');\n * ```\n */\n const resendVerificationEmail = useCallback(\n async (email: string): Promise<{ success: boolean }> => {\n await client.fetchApi('/auth/resend-verification', {\n method: 'POST',\n body: JSON.stringify({ email }),\n });\n return { success: true };\n },\n [client]\n );\n\n // ============================================================================\n // OAuth (Web2)\n // ============================================================================\n\n /**\n * Get the GitHub OAuth authorization URL.\n * Redirects user to GitHub to authorize, then back to your callback URL.\n *\n * @example\n * ```tsx\n * const { getGitHubOAuthUrl } = useGitHat();\n * const handleGitHubLogin = async () => {\n * const { url } = await getGitHubOAuthUrl();\n * window.location.href = url;\n * };\n * ```\n */\n const getGitHubOAuthUrl = useCallback(\n async (options?: { redirectUri?: string; state?: string }): Promise<{ url: string }> => {\n const params = new URLSearchParams();\n if (options?.redirectUri) params.append('redirectUri', options.redirectUri);\n if (options?.state) params.append('state', options.state);\n const queryString = params.toString();\n const path = queryString ? `/auth/oauth/github/url?${queryString}` : '/auth/oauth/github/url';\n return client.fetchApi<{ url: string }>(path);\n },\n [client]\n );\n\n /**\n * Exchange a GitHub OAuth code for GitHat tokens.\n * Call this in your callback page after GitHub redirects back.\n *\n * @example\n * ```tsx\n * // In /auth/callback/github page\n * const { signInWithGitHub } = useGitHat();\n * useEffect(() => {\n * const code = searchParams.get('code');\n * if (code) {\n * signInWithGitHub(code).then(({ user, isNewUser }) => {\n * router.push(isNewUser ? '/onboarding' : '/dashboard');\n * });\n * }\n * }, []);\n * ```\n */\n const signInWithGitHub = useCallback(\n async (code: string, options?: { redirectUri?: string }): Promise<{\n user: GitHatUser;\n org: GitHatOrg | null;\n isNewUser: boolean;\n }> => {\n const response = await client.fetchApi<{\n user: GitHatUser;\n org: GitHatOrg | null;\n isNewUser: boolean;\n accessToken?: string;\n refreshToken?: string;\n }>('/auth/oauth/github', {\n method: 'POST',\n body: JSON.stringify({\n code,\n redirectUri: options?.redirectUri,\n }),\n });\n\n // Update auth state\n if (response.accessToken) {\n // localStorage mode - tokens in response\n window.dispatchEvent(new CustomEvent('githat:auth-changed', {\n detail: { user: response.user, org: response.org, signedIn: true },\n }));\n }\n\n return {\n user: response.user,\n org: response.org,\n isNewUser: response.isNewUser,\n };\n },\n [client]\n );\n\n /**\n * Get the AWS Cognito OAuth authorization URL.\n * Redirects user to Cognito hosted UI to authenticate.\n *\n * @example\n * ```tsx\n * const { getCognitoOAuthUrl } = useGitHat();\n * const handleCognitoLogin = async () => {\n * const { url } = await getCognitoOAuthUrl();\n * window.location.href = url;\n * };\n * // Or with specific identity provider (Google via Cognito)\n * const { url } = await getCognitoOAuthUrl({ identityProvider: 'Google' });\n * ```\n */\n const getCognitoOAuthUrl = useCallback(\n async (options?: {\n redirectUri?: string;\n state?: string;\n identityProvider?: string;\n }): Promise<{ url: string }> => {\n const params = new URLSearchParams();\n if (options?.redirectUri) params.append('redirectUri', options.redirectUri);\n if (options?.state) params.append('state', options.state);\n if (options?.identityProvider) params.append('identityProvider', options.identityProvider);\n const queryString = params.toString();\n const path = queryString ? `/auth/oauth/cognito/url?${queryString}` : '/auth/oauth/cognito/url';\n return client.fetchApi<{ url: string }>(path);\n },\n [client]\n );\n\n /**\n * Exchange an AWS Cognito OAuth code for GitHat tokens.\n * Call this in your callback page after Cognito redirects back.\n *\n * @example\n * ```tsx\n * // In /auth/callback/cognito page\n * const { signInWithCognito } = useGitHat();\n * useEffect(() => {\n * const code = searchParams.get('code');\n * if (code) {\n * signInWithCognito(code).then(({ user, isNewUser }) => {\n * router.push(isNewUser ? '/onboarding' : '/dashboard');\n * });\n * }\n * }, []);\n * ```\n */\n const signInWithCognito = useCallback(\n async (code: string, options?: { redirectUri?: string }): Promise<{\n user: GitHatUser;\n org: GitHatOrg | null;\n isNewUser: boolean;\n }> => {\n const response = await client.fetchApi<{\n user: GitHatUser;\n org: GitHatOrg | null;\n isNewUser: boolean;\n accessToken?: string;\n refreshToken?: string;\n }>('/auth/oauth/cognito', {\n method: 'POST',\n body: JSON.stringify({\n code,\n redirectUri: options?.redirectUri,\n }),\n });\n\n // Update auth state\n if (response.accessToken) {\n window.dispatchEvent(new CustomEvent('githat:auth-changed', {\n detail: { user: response.user, org: response.org, signedIn: true },\n }));\n }\n\n return {\n user: response.user,\n org: response.org,\n isNewUser: response.isNewUser,\n };\n },\n [client]\n );\n\n return {\n fetch: client.fetchApi,\n getUserOrgs: () => client.fetchApi<{ orgs: GitHatOrg[] }>('/user/orgs'),\n verifyMCP: (domain: string) => client.fetchApi<{ verified: boolean }>(`/verify/mcp/${domain}`),\n verifyAgent: (wallet: string) => client.fetchApi<{ verified: boolean }>(`/verify/agent/${wallet}`),\n getOrgMetadata,\n updateOrgMetadata,\n // Password management\n forgotPassword,\n resetPassword,\n changePassword,\n // Email verification\n verifyEmail,\n resendVerificationEmail,\n // OAuth (Web2)\n getGitHubOAuthUrl,\n signInWithGitHub,\n getCognitoOAuthUrl,\n signInWithCognito,\n };\n}\n","'use client';\n\nimport { useMemo } from 'react';\nimport { useAuth } from './hooks';\nimport { createClient } from './client';\n\nexport interface DataItem {\n id: string;\n [key: string]: unknown;\n _createdAt?: string;\n _updatedAt?: string;\n}\n\nexport interface QueryOptions {\n limit?: number;\n cursor?: string;\n filter?: Record<string, unknown>;\n}\n\nexport interface QueryResult<T = DataItem> {\n items: T[];\n collection: string;\n nextCursor: string | null;\n count: number;\n}\n\nexport interface PutResult<T = DataItem> {\n item: T;\n collection: string;\n created: boolean;\n}\n\nexport interface DeleteResult {\n deleted: boolean;\n id: string;\n collection: string;\n}\n\nexport interface BatchOperation {\n type: 'put' | 'delete';\n id: string;\n data?: Record<string, unknown>;\n}\n\nexport interface BatchResult {\n processed: number;\n put: number;\n deleted: number;\n collection: string;\n}\n\n/**\n * Hook for interacting with GitHat's Customer Data API.\n * Provides CRUD operations for storing app data in GitHat's managed DynamoDB.\n *\n * @example\n * ```tsx\n * const { put, get, query, remove, batch } = useData();\n *\n * // Store data\n * await put('orders', { id: 'order_123', amount: 99.99, status: 'pending' });\n *\n * // Get single item\n * const order = await get('orders', 'order_123');\n *\n * // Query collection\n * const { items } = await query('orders', { filter: { status: 'pending' } });\n *\n * // Delete item\n * await remove('orders', 'order_123');\n * ```\n */\nexport function useData() {\n const ctx = useAuth();\n const client = useMemo(\n () => createClient(ctx.config.apiUrl!, ctx.config.publishableKey),\n [ctx.config.apiUrl, ctx.config.publishableKey]\n );\n\n return useMemo(() => ({\n /**\n * Store an item in a collection. If the item exists, it will be updated.\n * @param collection - Collection name (e.g., 'orders', 'users')\n * @param data - Data object with required `id` field\n */\n put: async <T extends DataItem>(collection: string, data: T): Promise<PutResult<T>> => {\n if (!data.id) {\n throw new Error('Data must include an \"id\" field');\n }\n return client.fetchApi<PutResult<T>>(`/data/${collection}/${data.id}`, {\n method: 'PUT',\n body: JSON.stringify(data),\n });\n },\n\n /**\n * Get a single item from a collection.\n * @param collection - Collection name\n * @param id - Item ID\n */\n get: async <T extends DataItem>(collection: string, id: string): Promise<T | null> => {\n try {\n const result = await client.fetchApi<{ item: T }>(`/data/${collection}/${id}`);\n return result.item;\n } catch (err: unknown) {\n if (err instanceof Error && err.message === 'Item not found') {\n return null;\n }\n throw err;\n }\n },\n\n /**\n * Query items from a collection with optional filters and pagination.\n * @param collection - Collection name\n * @param options - Query options (limit, cursor, filter)\n */\n query: async <T extends DataItem>(\n collection: string,\n options: QueryOptions = {}\n ): Promise<QueryResult<T>> => {\n const params = new URLSearchParams();\n if (options.limit) params.set('limit', options.limit.toString());\n if (options.cursor) params.set('cursor', options.cursor);\n if (options.filter) params.set('filter', JSON.stringify(options.filter));\n\n const queryString = params.toString();\n const url = `/data/${collection}${queryString ? `?${queryString}` : ''}`;\n\n return client.fetchApi<QueryResult<T>>(url);\n },\n\n /**\n * Delete an item from a collection.\n * @param collection - Collection name\n * @param id - Item ID\n */\n remove: async (collection: string, id: string): Promise<DeleteResult> => {\n return client.fetchApi<DeleteResult>(`/data/${collection}/${id}`, {\n method: 'DELETE',\n });\n },\n\n /**\n * Batch operations (put/delete) on a collection.\n * Maximum 100 operations per request.\n * @param collection - Collection name\n * @param operations - Array of operations\n */\n batch: async (collection: string, operations: BatchOperation[]): Promise<BatchResult> => {\n return client.fetchApi<BatchResult>(`/data/${collection}/batch`, {\n method: 'POST',\n body: JSON.stringify({ operations }),\n });\n },\n }), [client]);\n}\n","'use client';\n\nimport { useMemo } from 'react';\nimport { useAuth } from './hooks';\nimport { createClient } from './client';\n\nexport interface SendEmailOptions {\n /** Recipient email address(es). Single string or array of up to 50 addresses. */\n to: string | string[];\n /** Email subject line (max 998 characters). */\n subject: string;\n /** HTML body (optional if text is provided). */\n html?: string;\n /** Plain text body (optional if html is provided). */\n text?: string;\n /** Reply-to email address. Recipients can reply directly to this address. */\n replyTo?: string;\n}\n\nexport interface SendEmailResult {\n /** SES message ID for tracking. */\n messageId: string;\n /** Recipient addresses the email was sent to. */\n to: string[];\n /** Subject line as sent. */\n subject: string;\n /** Whether the email was sent successfully. */\n sent: boolean;\n}\n\n/**\n * Hook for sending transactional emails via GitHat's Email API.\n * Emails are sent from noreply@githat.io. Use replyTo for customer replies.\n *\n * @example\n * ```tsx\n * const { send } = useEmail();\n *\n * await send({\n * to: 'user@example.com',\n * subject: 'Your order is confirmed',\n * html: '<h1>Order Confirmed</h1><p>Thank you!</p>',\n * replyTo: 'support@myapp.com'\n * });\n * ```\n */\nexport function useEmail() {\n const ctx = useAuth();\n const client = useMemo(\n () => createClient(ctx.config.apiUrl!, ctx.config.publishableKey),\n [ctx.config.apiUrl, ctx.config.publishableKey]\n );\n\n return useMemo(() => ({\n /**\n * Send a transactional email.\n * @param options - Email options (to, subject, html/text, replyTo)\n */\n send: async (options: SendEmailOptions): Promise<SendEmailResult> => {\n if (!options.to) throw new Error('Recipient \"to\" is required');\n if (!options.subject) throw new Error('Subject is required');\n if (!options.html && !options.text) throw new Error('At least one of \"html\" or \"text\" is required');\n\n return client.fetchApi<SendEmailResult>('/email/send', {\n method: 'POST',\n body: JSON.stringify(options),\n });\n },\n }), [client]);\n}\n","'use client';\n\nimport React, { useState, FormEvent } from 'react';\nimport { useAuth } from '../hooks';\n\ninterface SignInFormProps {\n onSuccess?: () => void;\n signUpUrl?: string;\n forgotPasswordUrl?: string;\n}\n\nexport function SignInForm({ onSuccess, signUpUrl, forgotPasswordUrl }: SignInFormProps) {\n const { signIn, config } = useAuth();\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const [error, setError] = useState('');\n const [loading, setLoading] = useState(false);\n\n const emailValid = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email);\n\n const handleSubmit = async (e: FormEvent) => {\n e.preventDefault();\n if (!emailValid) {\n setError('Please enter a valid email address');\n return;\n }\n setError('');\n setLoading(true);\n try {\n await signIn(email, password);\n if (onSuccess) {\n onSuccess();\n } else if (typeof window !== 'undefined') {\n const params = new URLSearchParams(window.location.search);\n window.location.href = params.get('redirect_url') || config.afterSignInUrl!;\n }\n } catch (err: unknown) {\n setError(err instanceof Error ? err.message : 'Sign in failed');\n } finally {\n setLoading(false);\n }\n };\n\n return (\n <div className=\"githat-form-container\">\n <div className=\"githat-form-header\">\n <h2 className=\"githat-form-title\">Sign in</h2>\n <p className=\"githat-form-subtitle\">Welcome back to GitHat</p>\n </div>\n {error && <div className=\"githat-alert githat-alert-error\" role=\"alert\" aria-live=\"polite\">{error}</div>}\n <form onSubmit={handleSubmit} className=\"githat-form\" aria-label=\"Sign in form\">\n <div className=\"githat-field\">\n <label className=\"githat-label\" htmlFor=\"githat-signin-email\">Email</label>\n <input\n id=\"githat-signin-email\"\n className=\"githat-input\"\n type=\"email\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n placeholder=\"you@example.com\"\n autoComplete=\"email\"\n required\n />\n </div>\n <div className=\"githat-field\">\n <label className=\"githat-label\" htmlFor=\"githat-signin-password\">Password</label>\n <input\n id=\"githat-signin-password\"\n className=\"githat-input\"\n type=\"password\"\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n placeholder=\"Enter your password\"\n autoComplete=\"current-password\"\n required\n />\n </div>\n {forgotPasswordUrl && (\n <a href={forgotPasswordUrl} className=\"githat-link githat-forgot-link\">Forgot password?</a>\n )}\n <button\n type=\"submit\"\n className=\"githat-button githat-button-primary\"\n disabled={loading || !email || !password || (email.length > 0 && !emailValid)}\n >\n {loading ? 'Signing in...' : 'Sign in'}\n </button>\n </form>\n {signUpUrl && (\n <p className=\"githat-form-footer\">\n Don't have an account? <a href={signUpUrl} className=\"githat-link\">Sign up</a>\n </p>\n )}\n <p className=\"githat-powered-by\">Secured by <strong>GitHat</strong></p>\n </div>\n );\n}\n","'use client';\n\nimport React, { useState, FormEvent } from 'react';\nimport { useAuth } from '../hooks';\n\ninterface SignUpFormProps {\n onSuccess?: (result: { requiresVerification: boolean; email: string }) => void;\n signInUrl?: string;\n}\n\nexport function SignUpForm({ onSuccess, signInUrl }: SignUpFormProps) {\n const { signUp, config } = useAuth();\n const [name, setName] = useState('');\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const [error, setError] = useState('');\n const [loading, setLoading] = useState(false);\n\n const emailValid = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email);\n const passwordValid = password.length >= 8\n && /[A-Z]/.test(password)\n && /[a-z]/.test(password)\n && /\\d/.test(password);\n\n const handleSubmit = async (e: FormEvent) => {\n e.preventDefault();\n if (!emailValid) {\n setError('Please enter a valid email address');\n return;\n }\n if (!passwordValid) {\n setError('Password must be 8+ characters with uppercase, lowercase, and number');\n return;\n }\n setError('');\n setLoading(true);\n try {\n const result = await signUp({ email, password, name });\n if (onSuccess) {\n onSuccess(result);\n } else if (typeof window !== 'undefined') {\n window.location.href = config.afterSignInUrl!;\n }\n } catch (err: unknown) {\n setError(err instanceof Error ? err.message : 'Sign up failed');\n } finally {\n setLoading(false);\n }\n };\n\n return (\n <div className=\"githat-form-container\">\n <div className=\"githat-form-header\">\n <h2 className=\"githat-form-title\">Create an account</h2>\n <p className=\"githat-form-subtitle\">Get started with GitHat</p>\n </div>\n {error && <div className=\"githat-alert githat-alert-error\" role=\"alert\" aria-live=\"polite\">{error}</div>}\n <form onSubmit={handleSubmit} className=\"githat-form\" aria-label=\"Sign up form\">\n <div className=\"githat-field\">\n <label className=\"githat-label\" htmlFor=\"githat-signup-name\">Full name</label>\n <input\n id=\"githat-signup-name\"\n className=\"githat-input\"\n type=\"text\"\n value={name}\n onChange={(e) => setName(e.target.value)}\n placeholder=\"Your name\"\n autoComplete=\"name\"\n required\n />\n </div>\n <div className=\"githat-field\">\n <label className=\"githat-label\" htmlFor=\"githat-signup-email\">Email</label>\n <input\n id=\"githat-signup-email\"\n className=\"githat-input\"\n type=\"email\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n placeholder=\"you@example.com\"\n autoComplete=\"email\"\n required\n />\n </div>\n <div className=\"githat-field\">\n <label className=\"githat-label\" htmlFor=\"githat-signup-password\">Password</label>\n <input\n id=\"githat-signup-password\"\n className=\"githat-input\"\n type=\"password\"\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n placeholder=\"8+ characters\"\n autoComplete=\"new-password\"\n required\n />\n {password && !passwordValid && (\n <p className=\"githat-field-error\">\n Must be 8+ characters with uppercase, lowercase, and number\n </p>\n )}\n </div>\n <button\n type=\"submit\"\n className=\"githat-button githat-button-primary\"\n disabled={loading || !email || !password || !name || !emailValid}\n >\n {loading ? 'Creating account...' : 'Sign up'}\n </button>\n </form>\n {signInUrl && (\n <p className=\"githat-form-footer\">\n Already have an account? <a href={signInUrl} className=\"githat-link\">Sign in</a>\n </p>\n )}\n <p className=\"githat-powered-by\">Secured by <strong>GitHat</strong></p>\n </div>\n );\n}\n","'use client';\n\nimport React, { useContext } from 'react';\nimport { GitHatContext } from '../provider';\n\ninterface SignInButtonProps {\n className?: string;\n children?: React.ReactNode;\n href?: string;\n}\n\nexport function SignInButton({ className, children, href }: SignInButtonProps) {\n const ctx = useContext(GitHatContext);\n const url = href || ctx?.config.signInUrl || '/sign-in';\n return (\n <a href={url} className={className || 'githat-button githat-button-primary'} aria-label=\"Sign in\">\n {children || 'Sign in'}\n </a>\n );\n}\n","'use client';\n\nimport React, { useContext } from 'react';\nimport { GitHatContext } from '../provider';\n\ninterface SignUpButtonProps {\n className?: string;\n children?: React.ReactNode;\n href?: string;\n}\n\nexport function SignUpButton({ className, children, href }: SignUpButtonProps) {\n const ctx = useContext(GitHatContext);\n const url = href || ctx?.config.signUpUrl || '/sign-up';\n return (\n <a href={url} className={className || 'githat-button githat-button-outline'} aria-label=\"Sign up\">\n {children || 'Sign up'}\n </a>\n );\n}\n","'use client';\n\nimport React, { useState, useRef, useEffect } from 'react';\nimport { useAuth } from '../hooks';\n\nexport function UserButton() {\n const { user, org, isSignedIn, signOut } = useAuth();\n const [open, setOpen] = useState(false);\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const handleClickOutside = (e: MouseEvent) => {\n if (ref.current && !ref.current.contains(e.target as Node)) setOpen(false);\n };\n document.addEventListener('mousedown', handleClickOutside);\n return () => document.removeEventListener('mousedown', handleClickOutside);\n }, []);\n\n if (!isSignedIn || !user) return null;\n\n const initials = user.name\n ? user.name.split(' ').map(n => n[0]).join('').toUpperCase().slice(0, 2)\n : user.email[0].toUpperCase();\n\n return (\n <div className=\"githat-user-button\" ref={ref}>\n <button className=\"githat-avatar-trigger\" onClick={() => setOpen(!open)} aria-label=\"User menu\" aria-expanded={open} aria-haspopup=\"true\">\n {user.avatarUrl ? (\n <img src={user.avatarUrl} alt={user.name || 'User avatar'} className=\"githat-avatar-img\" />\n ) : (\n <span className=\"githat-avatar-initials\">{initials}</span>\n )}\n </button>\n {open && (\n <div className=\"githat-dropdown\" role=\"menu\">\n <div className=\"githat-dropdown-header\">\n <p className=\"githat-dropdown-name\">{user.name}</p>\n <p className=\"githat-dropdown-email\">{user.email}</p>\n {org && <p className=\"githat-dropdown-org\">{org.name}</p>}\n </div>\n <div className=\"githat-dropdown-divider\" />\n <button className=\"githat-dropdown-item\" role=\"menuitem\" onClick={() => { signOut(); setOpen(false); }}>\n Sign out\n </button>\n </div>\n )}\n </div>\n );\n}\n","'use client';\n\nimport React, { useState, useEffect, useRef } from 'react';\nimport { useAuth, useGitHat } from '../hooks';\nimport type { GitHatOrg } from '../types';\n\nexport function OrgSwitcher() {\n const { org, isSignedIn, switchOrg } = useAuth();\n const githat = useGitHat();\n const [orgs, setOrgs] = useState<GitHatOrg[]>([]);\n const [orgsLoading, setOrgsLoading] = useState(false);\n const [open, setOpen] = useState(false);\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (isSignedIn) {\n setOrgsLoading(true);\n githat.getUserOrgs()\n .then(data => setOrgs(data.orgs || []))\n .catch(() => {})\n .finally(() => setOrgsLoading(false));\n }\n }, [isSignedIn]);\n\n useEffect(() => {\n const handleClickOutside = (e: MouseEvent) => {\n if (ref.current && !ref.current.contains(e.target as Node)) setOpen(false);\n };\n document.addEventListener('mousedown', handleClickOutside);\n return () => document.removeEventListener('mousedown', handleClickOutside);\n }, []);\n\n if (!isSignedIn || !org || (orgs.length < 2 && !orgsLoading)) return null;\n\n return (\n <div className=\"githat-org-switcher\" ref={ref}>\n <button className=\"githat-org-trigger\" onClick={() => setOpen(!open)} aria-label=\"Switch organization\" aria-expanded={open} aria-haspopup=\"true\">\n <span className=\"githat-org-name\">{org.name}</span>\n <span className=\"githat-chevron\">{open ? '\\u25B2' : '\\u25BC'}</span>\n </button>\n {open && (\n <div className=\"githat-dropdown\" role=\"menu\">\n {orgsLoading ? (\n <div className=\"githat-dropdown-item\" aria-busy=\"true\">Loading...</div>\n ) : orgs.map(o => (\n <button\n key={o.id}\n className={`githat-dropdown-item ${o.id === org.id ? 'githat-dropdown-item-active' : ''}`}\n role=\"menuitem\"\n aria-current={o.id === org.id ? 'true' : undefined}\n onClick={() => { switchOrg(o.id); setOpen(false); }}\n >\n {o.name}\n {o.id === org.id && <span className=\"githat-check\">{'\\u2713'}</span>}\n </button>\n ))}\n </div>\n )}\n </div>\n );\n}\n","'use client';\n\nimport React, { useState, useEffect, useRef } from 'react';\nimport { useGitHat } from '../hooks';\n\ninterface VerifiedBadgeProps {\n type: 'mcp' | 'agent';\n identifier: string;\n label?: string;\n}\n\nconst CACHE_TTL = 5 * 60 * 1000; // 5 minutes\nconst cache = new Map<string, { verified: boolean; ts: number }>();\n\nexport function VerifiedBadge({ type, identifier, label }: VerifiedBadgeProps) {\n const githat = useGitHat();\n const [verified, setVerified] = useState<boolean | null>(null);\n const mounted = useRef(true);\n\n useEffect(() => {\n mounted.current = true;\n const key = `${type}:${identifier}`;\n const cached = cache.get(key);\n if (cached && Date.now() - cached.ts < CACHE_TTL) {\n setVerified(cached.verified);\n return;\n }\n\n const verify = type === 'mcp' ? githat.verifyMCP : githat.verifyAgent;\n verify(identifier)\n .then(data => {\n if (mounted.current) {\n setVerified(data.verified);\n cache.set(key, { verified: data.verified, ts: Date.now() });\n }\n })\n .catch(() => { if (mounted.current) setVerified(false); });\n\n return () => { mounted.current = false; };\n }, [type, identifier]);\n\n if (verified === null) return null;\n\n return (\n <span className={`githat-badge ${verified ? 'githat-badge-verified' : 'githat-badge-unverified'}`}>\n {verified ? '\\u2713' : '\\u2717'} {label || (verified ? 'Verified' : 'Unverified')}\n </span>\n );\n}\n","'use client';\n\nimport React from 'react';\nimport { useAuth } from '../hooks';\n\ninterface ProtectedRouteProps {\n children: React.ReactNode;\n fallback?: React.ReactNode;\n}\n\nexport function ProtectedRoute({ children, fallback }: ProtectedRouteProps) {\n const { isSignedIn, isLoading, config } = useAuth();\n\n if (isLoading) {\n return <>{fallback || <div className=\"githat-loading\">Loading...</div>}</>;\n }\n\n if (!isSignedIn) {\n if (typeof window !== 'undefined') {\n window.location.href = config.signInUrl!;\n }\n return null;\n }\n\n return <>{children}</>;\n}\n","'use client';\n\nimport React, { useState, FormEvent } from 'react';\nimport { useGitHat } from '../hooks';\n\ninterface ForgotPasswordFormProps {\n onSuccess?: (email: string) => void;\n onError?: (error: Error) => void;\n signInUrl?: string;\n}\n\nexport function ForgotPasswordForm({\n onSuccess,\n onError,\n signInUrl = '/sign-in',\n}: ForgotPasswordFormProps) {\n const { forgotPassword } = useGitHat();\n const [email, setEmail] = useState('');\n const [isLoading, setIsLoading] = useState(false);\n const [sent, setSent] = useState(false);\n const [error, setError] = useState('');\n\n const emailValid = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email);\n\n const handleSubmit = async (e: FormEvent) => {\n e.preventDefault();\n if (!emailValid) {\n setError('Please enter a valid email address');\n return;\n }\n setIsLoading(true);\n setError('');\n try {\n await forgotPassword(email);\n setSent(true);\n onSuccess?.(email);\n } catch (err) {\n const message = err instanceof Error ? err.message : 'Failed to send reset email';\n setError(message);\n onError?.(err instanceof Error ? err : new Error(message));\n } finally {\n setIsLoading(false);\n }\n };\n\n if (sent) {\n return (\n <div className=\"githat-form-container\">\n <div className=\"githat-form-header\">\n <h2 className=\"githat-form-title\">Check your email</h2>\n <p className=\"githat-form-subtitle\">\n We sent a password reset link to <strong>{email}</strong>\n </p>\n </div>\n <a href={signInUrl} className=\"githat-link\">\n Back to sign in\n </a>\n <p className=\"githat-powered-by\">\n Secured by <strong>GitHat</strong>\n </p>\n </div>\n );\n }\n\n return (\n <div className=\"githat-form-container\">\n <div className=\"githat-form-header\">\n <h2 className=\"githat-form-title\">Forgot password</h2>\n <p className=\"githat-form-subtitle\">\n Enter your email and we'll send you a reset link\n </p>\n </div>\n {error && (\n <div className=\"githat-alert githat-alert-error\" role=\"alert\" aria-live=\"polite\">\n {error}\n </div>\n )}\n <form onSubmit={handleSubmit} className=\"githat-form\" aria-label=\"Forgot password form\">\n <div className=\"githat-field\">\n <label className=\"githat-label\" htmlFor=\"githat-forgot-email\">\n Email\n </label>\n <input\n id=\"githat-forgot-email\"\n className=\"githat-input\"\n type=\"email\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n placeholder=\"you@example.com\"\n autoComplete=\"email\"\n disabled={isLoading}\n required\n />\n </div>\n <button\n type=\"submit\"\n className=\"githat-button githat-button-primary\"\n disabled={isLoading || !email || (email.length > 0 && !emailValid)}\n >\n {isLoading ? 'Sending...' : 'Send reset link'}\n </button>\n </form>\n <p className=\"githat-form-footer\">\n Remember your password? <a href={signInUrl} className=\"githat-link\">Sign in</a>\n </p>\n <p className=\"githat-powered-by\">\n Secured by <strong>GitHat</strong>\n </p>\n </div>\n );\n}\n","'use client';\n\nimport React, { useState, FormEvent } from 'react';\nimport { useGitHat } from '../hooks';\n\ninterface ResetPasswordFormProps {\n token: string;\n onSuccess?: () => void;\n onError?: (error: Error) => void;\n signInUrl?: string;\n minPasswordLength?: number;\n}\n\nexport function ResetPasswordForm({\n token,\n onSuccess,\n onError,\n signInUrl = '/sign-in',\n minPasswordLength = 8,\n}: ResetPasswordFormProps) {\n const { resetPassword } = useGitHat();\n const [password, setPassword] = useState('');\n const [confirm, setConfirm] = useState('');\n const [isLoading, setIsLoading] = useState(false);\n const [success, setSuccess] = useState(false);\n const [error, setError] = useState('');\n\n const handleSubmit = async (e: FormEvent) => {\n e.preventDefault();\n if (password !== confirm) {\n setError('Passwords do not match');\n return;\n }\n if (password.length < minPasswordLength) {\n setError(`Password must be at least ${minPasswordLength} characters`);\n return;\n }\n setIsLoading(true);\n setError('');\n try {\n await resetPassword(token, password);\n setSuccess(true);\n onSuccess?.();\n } catch (err) {\n const message = err instanceof Error ? err.message : 'Failed to reset password';\n setError(message);\n onError?.(err instanceof Error ? err : new Error(message));\n } finally {\n setIsLoading(false);\n }\n };\n\n if (success) {\n return (\n <div className=\"githat-form-container\">\n <div className=\"githat-form-header\">\n <h2 className=\"githat-form-title\">Password reset!</h2>\n <p className=\"githat-form-subtitle\">\n Your password has been successfully reset.\n </p>\n </div>\n <a href={signInUrl} className=\"githat-button githat-button-primary\" style={{ display: 'block', textAlign: 'center', textDecoration: 'none' }}>\n Sign in\n </a>\n <p className=\"githat-powered-by\">\n Secured by <strong>GitHat</strong>\n </p>\n </div>\n );\n }\n\n return (\n <div className=\"githat-form-container\">\n <div className=\"githat-form-header\">\n <h2 className=\"githat-form-title\">Reset password</h2>\n <p className=\"githat-form-subtitle\">Enter your new password</p>\n </div>\n {error && (\n <div className=\"githat-alert githat-alert-error\" role=\"alert\" aria-live=\"polite\">\n {error}\n </div>\n )}\n <form onSubmit={handleSubmit} className=\"githat-form\" aria-label=\"Reset password form\">\n <div className=\"githat-field\">\n <label className=\"githat-label\" htmlFor=\"githat-reset-password\">\n New password\n </label>\n <input\n id=\"githat-reset-password\"\n className=\"githat-input\"\n type=\"password\"\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n placeholder=\"Enter new password\"\n autoComplete=\"new-password\"\n disabled={isLoading}\n required\n minLength={minPasswordLength}\n />\n </div>\n <div className=\"githat-field\">\n <label className=\"githat-label\" htmlFor=\"githat-reset-confirm\">\n Confirm password\n </label>\n <input\n id=\"githat-reset-confirm\"\n className=\"githat-input\"\n type=\"password\"\n value={confirm}\n onChange={(e) => setConfirm(e.target.value)}\n placeholder=\"Confirm new password\"\n autoComplete=\"new-password\"\n disabled={isLoading}\n required\n />\n </div>\n <button\n type=\"submit\"\n className=\"githat-button githat-button-primary\"\n disabled={isLoading || !password || !confirm}\n >\n {isLoading ? 'Resetting...' : 'Reset password'}\n </button>\n </form>\n <p className=\"githat-powered-by\">\n Secured by <strong>GitHat</strong>\n </p>\n </div>\n );\n}\n","'use client';\n\nimport React, { useEffect, useState } from 'react';\nimport { useGitHat } from '../hooks';\n\ninterface VerifyEmailStatusProps {\n token: string;\n onSuccess?: () => void;\n onError?: (error: Error) => void;\n signInUrl?: string;\n redirectDelay?: number;\n}\n\nexport function VerifyEmailStatus({\n token,\n onSuccess,\n onError,\n signInUrl = '/sign-in',\n redirectDelay = 3000,\n}: VerifyEmailStatusProps) {\n const { verifyEmail } = useGitHat();\n const [status, setStatus] = useState<'loading' | 'success' | 'error'>('loading');\n const [error, setError] = useState('');\n\n useEffect(() => {\n if (!token) {\n setStatus('error');\n setError('Missing verification token');\n return;\n }\n\n verifyEmail(token)\n .then(() => {\n setStatus('success');\n onSuccess?.();\n if (signInUrl && redirectDelay > 0) {\n setTimeout(() => {\n window.location.href = signInUrl;\n }, redirectDelay);\n }\n })\n .catch((err) => {\n setStatus('error');\n const message = err instanceof Error ? err.message : 'Verification failed';\n setError(message);\n onError?.(err instanceof Error ? err : new Error(message));\n });\n }, [token, verifyEmail, onSuccess, onError, signInUrl, redirectDelay]);\n\n return (\n <div className=\"githat-form-container\">\n {status === 'loading' && (\n <div className=\"githat-form-header\">\n <h2 className=\"githat-form-title\">Verifying email...</h2>\n <p className=\"githat-form-subtitle\">Please wait while we verify your email address.</p>\n </div>\n )}\n {status === 'success' && (\n <>\n <div className=\"githat-form-header\">\n <h2 className=\"githat-form-title\">Email verified!</h2>\n <p className=\"githat-form-subtitle\">\n Your email has been successfully verified. Redirecting to sign in...\n </p>\n </div>\n <a href={signInUrl} className=\"githat-button githat-button-primary\" style={{ display: 'block', textAlign: 'center', textDecoration: 'none' }}>\n Sign in now\n </a>\n </>\n )}\n {status === 'error' && (\n <>\n <div className=\"githat-form-header\">\n <h2 className=\"githat-form-title\">Verification failed</h2>\n <p className=\"githat-form-subtitle\">{error}</p>\n </div>\n <p className=\"githat-form-footer\">\n The link may have expired. <a href=\"/sign-up\" className=\"githat-link\">Try signing up again</a>\n </p>\n </>\n )}\n <p className=\"githat-powered-by\">\n Secured by <strong>GitHat</strong>\n </p>\n </div>\n );\n}\n","'use client';\n\nimport React, { useState, FormEvent } from 'react';\nimport { useGitHat } from '../hooks';\n\ninterface ChangePasswordFormProps {\n onSuccess?: () => void;\n onError?: (error: Error) => void;\n minPasswordLength?: number;\n}\n\nexport function ChangePasswordForm({\n onSuccess,\n onError,\n minPasswordLength = 8,\n}: ChangePasswordFormProps) {\n const { changePassword } = useGitHat();\n const [current, setCurrent] = useState('');\n const [newPass, setNewPass] = useState('');\n const [confirm, setConfirm] = useState('');\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState('');\n const [success, setSuccess] = useState(false);\n\n const handleSubmit = async (e: FormEvent) => {\n e.preventDefault();\n if (newPass !== confirm) {\n setError('Passwords do not match');\n return;\n }\n if (newPass.length < minPasswordLength) {\n setError(`Password must be at least ${minPasswordLength} characters`);\n return;\n }\n setIsLoading(true);\n setError('');\n try {\n await changePassword(current, newPass);\n setSuccess(true);\n setCurrent('');\n setNewPass('');\n setConfirm('');\n onSuccess?.();\n } catch (err) {\n const message = err instanceof Error ? err.message : 'Failed to change password';\n setError(message);\n onError?.(err instanceof Error ? err : new Error(message));\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <div className=\"githat-form-container\">\n <div className=\"githat-form-header\">\n <h2 className=\"githat-form-title\">Change password</h2>\n <p className=\"githat-form-subtitle\">Update your account password</p>\n </div>\n {success && (\n <div className=\"githat-alert githat-alert-success\" role=\"status\" aria-live=\"polite\">\n Password changed successfully!\n </div>\n )}\n {error && (\n <div className=\"githat-alert githat-alert-error\" role=\"alert\" aria-live=\"polite\">\n {error}\n </div>\n )}\n <form onSubmit={handleSubmit} className=\"githat-form\" aria-label=\"Change password form\">\n <div className=\"githat-field\">\n <label className=\"githat-label\" htmlFor=\"githat-change-current\">\n Current password\n </label>\n <input\n id=\"githat-change-current\"\n className=\"githat-input\"\n type=\"password\"\n value={current}\n onChange={(e) => setCurrent(e.target.value)}\n placeholder=\"Enter current password\"\n autoComplete=\"current-password\"\n disabled={isLoading}\n required\n />\n </div>\n <div className=\"githat-field\">\n <label className=\"githat-label\" htmlFor=\"githat-change-new\">\n New password\n </label>\n <input\n id=\"githat-change-new\"\n className=\"githat-input\"\n type=\"password\"\n value={newPass}\n onChange={(e) => setNewPass(e.target.value)}\n placeholder=\"Enter new password\"\n autoComplete=\"new-password\"\n disabled={isLoading}\n required\n minLength={minPasswordLength}\n />\n </div>\n <div className=\"githat-field\">\n <label className=\"githat-label\" htmlFor=\"githat-change-confirm\">\n Confirm new password\n </label>\n <input\n id=\"githat-change-confirm\"\n className=\"githat-input\"\n type=\"password\"\n value={confirm}\n onChange={(e) => setConfirm(e.target.value)}\n placeholder=\"Confirm new password\"\n autoComplete=\"new-password\"\n disabled={isLoading}\n required\n />\n </div>\n <button\n type=\"submit\"\n className=\"githat-button githat-button-primary\"\n disabled={isLoading || !current || !newPass || !confirm}\n >\n {isLoading ? 'Changing...' : 'Change password'}\n </button>\n </form>\n <p className=\"githat-powered-by\">\n Secured by <strong>GitHat</strong>\n </p>\n </div>\n );\n}\n","'use client';\n\nimport React, { useState, useCallback } from 'react';\nimport { useGitHat } from '../hooks';\n\nconst GitHubIcon = () => (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M12 0C5.374 0 0 5.373 0 12c0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23A11.509 11.509 0 0112 5.803c1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576C20.566 21.797 24 17.3 24 12c0-6.627-5.373-12-12-12z\"/>\n </svg>\n);\n\nexport interface GitHubButtonProps {\n /** Text to display on the button */\n children?: React.ReactNode;\n /** Custom redirect URI after GitHub auth */\n redirectUri?: string;\n /** Callback on successful auth */\n onSuccess?: (result: { user: any; org: any; isNewUser: boolean }) => void;\n /** Callback on error */\n onError?: (error: Error) => void;\n /** Additional class names */\n className?: string;\n /** Button variant */\n variant?: 'default' | 'outline';\n /** Disable the button */\n disabled?: boolean;\n}\n\nexport function GitHubButton({\n children = 'Continue with GitHub',\n redirectUri,\n onSuccess,\n onError,\n className = '',\n variant = 'default',\n disabled = false,\n}: GitHubButtonProps) {\n const { getGitHubOAuthUrl } = useGitHat();\n const [isLoading, setIsLoading] = useState(false);\n\n const handleClick = useCallback(async () => {\n if (isLoading || disabled) return;\n\n setIsLoading(true);\n try {\n // Generate a random state for CSRF protection\n const state = crypto.randomUUID();\n sessionStorage.setItem('githat_oauth_state', state);\n\n const { url } = await getGitHubOAuthUrl({ redirectUri, state });\n window.location.href = url;\n } catch (error) {\n setIsLoading(false);\n if (onError) {\n onError(error instanceof Error ? error : new Error('Failed to start GitHub OAuth'));\n }\n }\n }, [getGitHubOAuthUrl, redirectUri, onError, isLoading, disabled]);\n\n const baseStyles = 'githat-github-button';\n const variantStyles = variant === 'outline' ? 'githat-github-button-outline' : '';\n const disabledStyles = disabled || isLoading ? 'githat-github-button-disabled' : '';\n\n return (\n <button\n type=\"button\"\n onClick={handleClick}\n disabled={disabled || isLoading}\n className={`${baseStyles} ${variantStyles} ${disabledStyles} ${className}`.trim()}\n >\n {isLoading ? (\n <span className=\"githat-github-spinner\" />\n ) : (\n <GitHubIcon />\n )}\n <span>{children}</span>\n </button>\n );\n}\n\n// CSS styles injected inline\nif (typeof document !== 'undefined') {\n const styleId = 'githat-github-button-styles';\n if (!document.getElementById(styleId)) {\n const style = document.createElement('style');\n style.id = styleId;\n style.textContent = `\n .githat-github-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n padding: 0.625rem 1rem;\n font-size: 0.875rem;\n font-weight: 500;\n border-radius: 0.375rem;\n border: none;\n cursor: pointer;\n transition: all 0.15s ease;\n background-color: #24292f;\n color: #ffffff;\n width: 100%;\n }\n .githat-github-button:hover:not(:disabled) {\n background-color: #32383f;\n }\n .githat-github-button-outline {\n background-color: transparent;\n color: #24292f;\n border: 1px solid #d0d7de;\n }\n .githat-github-button-outline:hover:not(:disabled) {\n background-color: #f6f8fa;\n border-color: #24292f;\n }\n .githat-github-button-disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .githat-github-spinner {\n width: 1rem;\n height: 1rem;\n border: 2px solid currentColor;\n border-top-color: transparent;\n border-radius: 50%;\n animation: githat-spin 0.6s linear infinite;\n }\n @keyframes githat-spin {\n to { transform: rotate(360deg); }\n }\n `;\n document.head.appendChild(style);\n }\n}\n","'use client';\n\nimport React, { useEffect, useState } from 'react';\nimport { useGitHat } from '../hooks';\nimport { useAuth } from '../hooks';\n\nexport interface GitHubCallbackProps {\n /** URL to redirect to after successful auth */\n redirectUrl?: string;\n /** URL for new users (onboarding) */\n newUserRedirectUrl?: string;\n /** Callback on successful auth */\n onSuccess?: (result: { user: any; org: any; isNewUser: boolean }) => void;\n /** Callback on error */\n onError?: (error: Error) => void;\n /** Custom loading component */\n loadingComponent?: React.ReactNode;\n /** Custom error component */\n errorComponent?: (error: string) => React.ReactNode;\n}\n\nexport function GitHubCallback({\n redirectUrl = '/dashboard',\n newUserRedirectUrl,\n onSuccess,\n onError,\n loadingComponent,\n errorComponent,\n}: GitHubCallbackProps) {\n const { signInWithGitHub } = useGitHat();\n const { config } = useAuth();\n const [error, setError] = useState<string | null>(null);\n const [isProcessing, setIsProcessing] = useState(true);\n\n useEffect(() => {\n const handleCallback = async () => {\n // Get code and state from URL\n const params = new URLSearchParams(window.location.search);\n const code = params.get('code');\n const state = params.get('state');\n const errorParam = params.get('error');\n const errorDescription = params.get('error_description');\n\n // Check for OAuth errors\n if (errorParam) {\n const errorMsg = errorDescription || errorParam;\n setError(errorMsg);\n setIsProcessing(false);\n if (onError) {\n onError(new Error(errorMsg));\n }\n return;\n }\n\n if (!code) {\n const errorMsg = 'No authorization code received';\n setError(errorMsg);\n setIsProcessing(false);\n if (onError) {\n onError(new Error(errorMsg));\n }\n return;\n }\n\n // Validate state (CSRF protection)\n const savedState = sessionStorage.getItem('githat_oauth_state');\n if (savedState && state !== savedState) {\n const errorMsg = 'Invalid state parameter';\n setError(errorMsg);\n setIsProcessing(false);\n if (onError) {\n onError(new Error(errorMsg));\n }\n return;\n }\n sessionStorage.removeItem('githat_oauth_state');\n\n try {\n const result = await signInWithGitHub(code);\n\n if (onSuccess) {\n onSuccess(result);\n }\n\n // Redirect\n const targetUrl = result.isNewUser && newUserRedirectUrl\n ? newUserRedirectUrl\n : redirectUrl || config.afterSignInUrl || '/dashboard';\n\n window.location.href = targetUrl;\n } catch (err) {\n const errorMsg = err instanceof Error ? err.message : 'Authentication failed';\n setError(errorMsg);\n setIsProcessing(false);\n if (onError) {\n onError(err instanceof Error ? err : new Error(errorMsg));\n }\n }\n };\n\n handleCallback();\n }, [signInWithGitHub, redirectUrl, newUserRedirectUrl, config.afterSignInUrl, onSuccess, onError]);\n\n if (error) {\n if (errorComponent) {\n return <>{errorComponent(error)}</>;\n }\n\n return (\n <div className=\"githat-callback-error\">\n <h2>Authentication Failed</h2>\n <p>{error}</p>\n <a href=\"/sign-in\">Back to Sign In</a>\n </div>\n );\n }\n\n if (loadingComponent) {\n return <>{loadingComponent}</>;\n }\n\n return (\n <div className=\"githat-callback-loading\">\n <div className=\"githat-callback-spinner\" />\n <p>Completing sign in with GitHub...</p>\n </div>\n );\n}\n\n// CSS styles injected inline\nif (typeof document !== 'undefined') {\n const styleId = 'githat-callback-styles';\n if (!document.getElementById(styleId)) {\n const style = document.createElement('style');\n style.id = styleId;\n style.textContent = `\n .githat-callback-loading,\n .githat-callback-error {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n min-height: 200px;\n padding: 2rem;\n text-align: center;\n }\n .githat-callback-spinner {\n width: 2rem;\n height: 2rem;\n border: 3px solid #e5e7eb;\n border-top-color: #3b82f6;\n border-radius: 50%;\n animation: githat-spin 0.8s linear infinite;\n margin-bottom: 1rem;\n }\n .githat-callback-error h2 {\n color: #dc2626;\n margin-bottom: 0.5rem;\n }\n .githat-callback-error p {\n color: #6b7280;\n margin-bottom: 1rem;\n }\n .githat-callback-error a {\n color: #3b82f6;\n text-decoration: underline;\n }\n @keyframes githat-spin {\n to { transform: rotate(360deg); }\n }\n `;\n document.head.appendChild(style);\n }\n}\n","'use client';\n\nimport React, { useState, useCallback } from 'react';\nimport { useGitHat } from '../hooks';\n\nconst AWSIcon = () => (\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M6.763 10.036c0 .296.032.535.088.71.064.176.144.368.256.576.04.063.056.127.056.183 0 .08-.048.16-.152.24l-.503.335a.383.383 0 0 1-.208.072c-.08 0-.16-.04-.239-.112a2.47 2.47 0 0 1-.287-.375 6.18 6.18 0 0 1-.248-.471c-.622.734-1.405 1.101-2.347 1.101-.67 0-1.205-.191-1.596-.574-.391-.384-.59-.894-.59-1.533 0-.678.239-1.23.726-1.644.487-.415 1.133-.623 1.955-.623.272 0 .551.024.846.064.296.04.6.104.918.176v-.583c0-.607-.127-1.03-.375-1.277-.255-.248-.686-.367-1.3-.367-.28 0-.568.031-.863.103-.295.072-.583.16-.862.272a2.287 2.287 0 0 1-.28.104.488.488 0 0 1-.127.023c-.112 0-.168-.08-.168-.247v-.391c0-.128.016-.224.056-.28a.597.597 0 0 1 .224-.167c.279-.144.614-.264 1.005-.36a4.84 4.84 0 0 1 1.246-.151c.95 0 1.644.216 2.091.647.439.43.662 1.085.662 1.963v2.586zm-3.24 1.214c.263 0 .534-.048.822-.144.287-.096.543-.271.758-.51.128-.152.224-.32.272-.512.047-.191.08-.423.08-.694v-.335a6.66 6.66 0 0 0-.735-.136 6.02 6.02 0 0 0-.75-.048c-.535 0-.926.104-1.19.32-.263.215-.39.518-.39.917 0 .375.095.655.295.846.191.2.47.296.838.296zm6.41.862c-.144 0-.24-.024-.304-.08-.064-.048-.12-.16-.168-.311L7.586 5.55a1.398 1.398 0 0 1-.072-.32c0-.128.064-.2.191-.2h.783c.151 0 .255.025.31.08.065.048.113.16.16.312l1.342 5.284 1.245-5.284c.04-.16.088-.264.151-.312a.549.549 0 0 1 .32-.08h.638c.152 0 .256.025.32.08.063.048.12.16.151.312l1.261 5.348 1.381-5.348c.048-.16.104-.264.16-.312a.52.52 0 0 1 .311-.08h.743c.127 0 .2.065.2.2 0 .04-.009.08-.017.128a1.137 1.137 0 0 1-.056.2l-1.923 6.17c-.048.16-.104.264-.168.312a.51.51 0 0 1-.303.08h-.687c-.151 0-.255-.024-.32-.08-.063-.056-.119-.16-.15-.32l-1.238-5.148-1.23 5.14c-.04.16-.087.264-.15.32-.065.056-.177.08-.32.08zm10.256.215c-.415 0-.83-.048-1.229-.143-.399-.096-.71-.2-.918-.32-.128-.071-.215-.151-.247-.223a.563.563 0 0 1-.048-.224v-.407c0-.167.064-.247.183-.247.048 0 .096.008.144.024.048.016.12.048.2.08.271.12.566.215.878.279.319.064.63.096.95.096.502 0 .894-.088 1.165-.264a.86.86 0 0 0 .415-.758.777.777 0 0 0-.215-.559c-.144-.151-.415-.287-.806-.415l-1.157-.36c-.583-.183-1.014-.454-1.277-.813a1.902 1.902 0 0 1-.4-1.158c0-.335.073-.63.216-.886.144-.255.336-.479.575-.654.24-.184.51-.32.83-.415.32-.096.655-.136 1.006-.136.176 0 .359.008.535.032.183.024.35.056.518.088.16.04.312.08.455.127.144.048.256.096.336.144a.69.69 0 0 1 .24.2.43.43 0 0 1 .071.263v.375c0 .168-.064.256-.184.256a.83.83 0 0 1-.303-.096 3.652 3.652 0 0 0-1.532-.311c-.455 0-.815.071-1.062.223-.248.152-.375.383-.375.71 0 .224.08.416.24.567.159.152.454.304.877.44l1.134.358c.574.184.99.44 1.237.767.247.327.367.702.367 1.117 0 .343-.072.655-.207.926-.144.272-.336.511-.583.703-.248.2-.543.343-.886.447-.36.111-.734.167-1.142.167z\"/>\n </svg>\n);\n\nexport interface CognitoButtonProps {\n /** Text to display on the button */\n children?: React.ReactNode;\n /** Custom redirect URI after Cognito auth */\n redirectUri?: string;\n /** Specific identity provider (e.g., 'Google', 'Facebook') */\n identityProvider?: string;\n /** Callback on error */\n onError?: (error: Error) => void;\n /** Additional class names */\n className?: string;\n /** Button variant */\n variant?: 'default' | 'outline';\n /** Disable the button */\n disabled?: boolean;\n}\n\nexport function CognitoButton({\n children = 'Continue with AWS',\n redirectUri,\n identityProvider,\n onError,\n className = '',\n variant = 'default',\n disabled = false,\n}: CognitoButtonProps) {\n const { getCognitoOAuthUrl } = useGitHat();\n const [isLoading, setIsLoading] = useState(false);\n\n const handleClick = useCallback(async () => {\n if (isLoading || disabled) return;\n\n setIsLoading(true);\n try {\n const state = crypto.randomUUID();\n sessionStorage.setItem('githat_cognito_oauth_state', state);\n\n const { url } = await getCognitoOAuthUrl({ redirectUri, state, identityProvider });\n window.location.href = url;\n } catch (error) {\n setIsLoading(false);\n if (onError) {\n onError(error instanceof Error ? error : new Error('Failed to start Cognito OAuth'));\n }\n }\n }, [getCognitoOAuthUrl, redirectUri, identityProvider, onError, isLoading, disabled]);\n\n const baseStyles = 'githat-cognito-button';\n const variantStyles = variant === 'outline' ? 'githat-cognito-button-outline' : '';\n const disabledStyles = disabled || isLoading ? 'githat-cognito-button-disabled' : '';\n\n return (\n <button\n type=\"button\"\n onClick={handleClick}\n disabled={disabled || isLoading}\n className={`${baseStyles} ${variantStyles} ${disabledStyles} ${className}`.trim()}\n >\n {isLoading ? (\n <span className=\"githat-cognito-spinner\" />\n ) : (\n <AWSIcon />\n )}\n <span>{children}</span>\n </button>\n );\n}\n\n// CSS styles\nif (typeof document !== 'undefined') {\n const styleId = 'githat-cognito-button-styles';\n if (!document.getElementById(styleId)) {\n const style = document.createElement('style');\n style.id = styleId;\n style.textContent = `\n .githat-cognito-button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n padding: 0.625rem 1rem;\n font-size: 0.875rem;\n font-weight: 500;\n border-radius: 0.375rem;\n border: none;\n cursor: pointer;\n transition: all 0.15s ease;\n background-color: #ff9900;\n color: #232f3e;\n width: 100%;\n }\n .githat-cognito-button:hover:not(:disabled) {\n background-color: #ec7211;\n }\n .githat-cognito-button-outline {\n background-color: transparent;\n color: #ff9900;\n border: 1px solid #ff9900;\n }\n .githat-cognito-button-outline:hover:not(:disabled) {\n background-color: rgba(255, 153, 0, 0.1);\n }\n .githat-cognito-button-disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .githat-cognito-spinner {\n width: 1rem;\n height: 1rem;\n border: 2px solid currentColor;\n border-top-color: transparent;\n border-radius: 50%;\n animation: githat-cognito-spin 0.6s linear infinite;\n }\n @keyframes githat-cognito-spin {\n to { transform: rotate(360deg); }\n }\n `;\n document.head.appendChild(style);\n }\n}\n","'use client';\n\nimport React, { useEffect, useState } from 'react';\nimport { useGitHat, useAuth } from '../hooks';\n\nexport interface CognitoCallbackProps {\n /** URL to redirect to after successful auth */\n redirectUrl?: string;\n /** URL for new users (onboarding) */\n newUserRedirectUrl?: string;\n /** Callback on successful auth */\n onSuccess?: (result: { user: any; org: any; isNewUser: boolean }) => void;\n /** Callback on error */\n onError?: (error: Error) => void;\n /** Custom loading component */\n loadingComponent?: React.ReactNode;\n /** Custom error component */\n errorComponent?: (error: string) => React.ReactNode;\n}\n\nexport function CognitoCallback({\n redirectUrl = '/dashboard',\n newUserRedirectUrl,\n onSuccess,\n onError,\n loadingComponent,\n errorComponent,\n}: CognitoCallbackProps) {\n const { signInWithCognito } = useGitHat();\n const { config } = useAuth();\n const [error, setError] = useState<string | null>(null);\n const [isProcessing, setIsProcessing] = useState(true);\n\n useEffect(() => {\n const handleCallback = async () => {\n const params = new URLSearchParams(window.location.search);\n const code = params.get('code');\n const state = params.get('state');\n const errorParam = params.get('error');\n const errorDescription = params.get('error_description');\n\n if (errorParam) {\n const errorMsg = errorDescription || errorParam;\n setError(errorMsg);\n setIsProcessing(false);\n if (onError) {\n onError(new Error(errorMsg));\n }\n return;\n }\n\n if (!code) {\n const errorMsg = 'No authorization code received';\n setError(errorMsg);\n setIsProcessing(false);\n if (onError) {\n onError(new Error(errorMsg));\n }\n return;\n }\n\n // Validate state (CSRF protection)\n const savedState = sessionStorage.getItem('githat_cognito_oauth_state');\n if (savedState && state !== savedState) {\n const errorMsg = 'Invalid state parameter';\n setError(errorMsg);\n setIsProcessing(false);\n if (onError) {\n onError(new Error(errorMsg));\n }\n return;\n }\n sessionStorage.removeItem('githat_cognito_oauth_state');\n\n try {\n const result = await signInWithCognito(code);\n\n if (onSuccess) {\n onSuccess(result);\n }\n\n const targetUrl = result.isNewUser && newUserRedirectUrl\n ? newUserRedirectUrl\n : redirectUrl || config.afterSignInUrl || '/dashboard';\n\n window.location.href = targetUrl;\n } catch (err) {\n const errorMsg = err instanceof Error ? err.message : 'Authentication failed';\n setError(errorMsg);\n setIsProcessing(false);\n if (onError) {\n onError(err instanceof Error ? err : new Error(errorMsg));\n }\n }\n };\n\n handleCallback();\n }, [signInWithCognito, redirectUrl, newUserRedirectUrl, config.afterSignInUrl, onSuccess, onError]);\n\n if (error) {\n if (errorComponent) {\n return <>{errorComponent(error)}</>;\n }\n\n return (\n <div className=\"githat-callback-error\">\n <h2>Authentication Failed</h2>\n <p>{error}</p>\n <a href=\"/sign-in\">Back to Sign In</a>\n </div>\n );\n }\n\n if (loadingComponent) {\n return <>{loadingComponent}</>;\n }\n\n return (\n <div className=\"githat-callback-loading\">\n <div className=\"githat-callback-spinner\" />\n <p>Completing sign in with AWS Cognito...</p>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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B,KAAK;AACrB,YAAI,SAAS;AACX,kBAAQ,IAAI,MAAM,QAAQ,CAAC;AAAA,QAC7B;AACA;AAAA,MACF;AACA,qBAAe,WAAW,4BAA4B;AAEtD,UAAI;AACF,cAAM,SAAS,MAAM,kBAAkB,IAAI;AAE3C,YAAI,WAAW;AACb,oBAAU,MAAM;AAAA,QAClB;AAEA,cAAM,YAAY,OAAO,aAAa,qBAClC,qBACA,eAAe,OAAO,kBAAkB;AAE5C,eAAO,SAAS,OAAO;AAAA,MACzB,SAAS,KAAK;AACZ,cAAM,WAAW,eAAe,QAAQ,IAAI,UAAU;AACtD,iBAAS,QAAQ;AACjB,wBAAgB,KAAK;AACrB,YAAI,SAAS;AACX,kBAAQ,eAAe,QAAQ,MAAM,IAAI,MAAM,QAAQ,CAAC;AAAA,QAC1D;AAAA,MACF;AAAA,IACF;AAEA,mBAAe;AAAA,EACjB,GAAG,CAAC,mBAAmB,aAAa,oBAAoB,OAAO,gBAAgB,WAAW,OAAO,CAAC;AAElG,MAAI,OAAO;AACT,QAAI,gBAAgB;AAClB,aAAO,+EAAG,yBAAe,KAAK,GAAE;AAAA,IAClC;AAEA,WACE,+CAAC,SAAI,WAAU,yBACb;AAAA,oDAAC,QAAG,mCAAqB;AAAA,MACzB,8CAAC,OAAG,iBAAM;AAAA,MACV,8CAAC,OAAE,MAAK,YAAW,6BAAe;AAAA,OACpC;AAAA,EAEJ;AAEA,MAAI,kBAAkB;AACpB,WAAO,+EAAG,4BAAiB;AAAA,EAC7B;AAEA,SACE,+CAAC,SAAI,WAAU,2BACb;AAAA,kDAAC,SAAI,WAAU,2BAA0B;AAAA,IACzC,8CAAC,OAAE,oDAAsC;AAAA,KAC3C;AAEJ;","names":["import_react","import_react","import_react","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime","import_react","import_jsx_runtime"]}
|