onairos 4.0.18 → 4.0.21

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/421.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"421.js","mappings":"yJAGe,SAASA,EAAaC,GAA0B,IAAzB,WAAEC,EAAU,QAAEC,GAASF,EAgB3D,OAdAG,EAAAA,EAAAA,WAAU,KACR,MAAMC,EAASC,SAASC,cAAc,UAKtC,OAJAF,EAAOG,IAAM,6CACbH,EAAOI,OAAQ,EACfH,SAASI,KAAKC,YAAYN,GAEnB,KACL,MAAMO,EAAiBN,SAASO,cAAc,4DAC1CD,GACFN,SAASI,KAAKI,YAAYF,KAG7B,IAGDG,EAAAA,cAAA,OAAKC,UAAU,uBAAuBC,MAAO,CAAEC,OAAQ,SAErDH,EAAAA,cAAA,OAAKC,UAAU,wDAEbD,EAAAA,cAAA,OAAKC,UAAU,4BACbD,EAAAA,cAAA,OAAKC,UAAU,8CACbD,EAAAA,cAAA,OACEC,UAAU,oCACV,WAAS,gDACTG,IAAI,mBAMVJ,EAAAA,cAAA,KAAGC,UAAU,8BAA6B,cAG1CD,EAAAA,cAAA,MAAIC,UAAU,sDAAqD,WAGnED,EAAAA,cAAA,KAAGC,UAAU,kEAAiE,+FAMhFD,EAAAA,cAAA,OAAKC,UAAU,2BACbD,EAAAA,cAAA,UACEC,UAAU,mJACVI,QAASlB,GACV,cAECa,EAAAA,cAAA,OAAKC,UAAU,UAAUK,KAAK,OAAOC,OAAO,eAAeC,QAAQ,aACjER,EAAAA,cAAA,QAAMS,cAAc,QAAQC,eAAe,QAAQC,YAAa,EAAGC,EAAE,oBAMjF,C,aC3DO,MAAMC,EAAS,CAEpBC,aAAc,UACdC,WAAY,UAGZC,SAAU,UACVC,UAAW,qBAGXC,wBAAyB,UACzBC,sBAAuB,UAGvBC,WAAY,UACZC,oBAAqB,UAGrBC,YAAa,UACbC,cAAe,UACfC,UAAW,UAGXC,OAA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OkZ,EAAUiJ,YAAc,MAG3CpiB,QAAQC,IAAI,mCAAoCkZ,EAAUkI,iBAEnDlI,CACT,C,wFAEA,SACEyH,2BACAlB,uB","sources":["webpack://OnairosLaravel/./src/components/WelcomeScreen.jsx","webpack://OnairosLaravel/./src/theme/colors.js","webpack://OnairosLaravel/./src/components/ui/PrimaryButton.jsx","webpack://OnairosLaravel/./src/components/EmailAuth.js","webpack://OnairosLaravel/./src/components/connectors/ChatGPTConnector.js","webpack://OnairosLaravel/./src/components/UniversalOnboarding.jsx","webpack://OnairosLaravel/./src/components/PinSetup.js","webpack://OnairosLaravel/./src/components/DataRequest.js","webpack://OnairosLaravel/./src/components/TrainingComponent.jsx","webpack://OnairosLaravel/./src/components/LoadingScreen.jsx","webpack://OnairosLaravel/./src/utils/responseFormatter.js","webpack://OnairosLaravel/./src/components/ui/PageLayout.jsx","webpack://OnairosLaravel/./src/onairosButton.jsx","webpack://OnairosLaravel/./src/utils/userDataFormatter.js"],"sourcesContent":["import React, { useEffect } from 'react';\nimport { COLORS } from '../theme/colors.js';\n\nexport default function WelcomeScreen({ onContinue, onClose }) {\n // Load Sirv script for responsive images\n useEffect(() => {\n const script = document.createElement('script');\n script.src = 'https://scripts.sirv.com/sirvjs/v3/sirv.js';\n script.async = true;\n document.head.appendChild(script);\n \n return () => {\n const existingScript = document.querySelector('script[src=\"https://scripts.sirv.com/sirvjs/v3/sirv.js\"]');\n if (existingScript) {\n document.head.removeChild(existingScript);\n }\n };\n }, []);\n\n return (\n <div className=\"w-full flex flex-col\" style={{ height: '100%' }}>\n {/* Content - Flexible center area */}\n <div className=\"px-6 text-center flex-1 flex flex-col justify-center\">\n {/* Logo */}\n <div className=\"mb-8 flex justify-center\">\n <div className=\"w-20 h-20 flex items-center justify-center\">\n <img \n className=\"Sirv w-full h-full object-contain\" \n data-src=\"https://anushkasirv.sirv.com/OnairosBlack.png\" \n alt=\"Onairos Logo\"\n />\n </div>\n </div>\n\n {/* Welcome Text */}\n <p className=\"text-gray-500 text-sm mb-2\">Welcome to</p>\n\n {/* Main Title */}\n <h1 className=\"text-4xl font-bold text-gray-900 mb-6 text-balance\">Onairos</h1>\n\n {/* Description */}\n <p className=\"text-gray-600 text-base leading-relaxed mb-12 text-pretty px-2\">\n OnairOS personalizes your digital experience on every app so you can just enjoy being you!\n </p>\n </div>\n\n {/* Get Started Button - Fixed at bottom */}\n <div className=\"px-6 pb-8 flex-shrink-0\">\n <button\n className=\"w-full bg-gray-900 hover:bg-gray-800 text-white rounded-full py-4 text-base font-medium flex items-center justify-center gap-2 transition-colors\"\n onClick={onContinue}\n >\n Get Started\n <svg className=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M9 5l7 7-7 7\" />\n </svg>\n </button>\n </div>\n </div>\n );\n}\n","// Theme colors for Onairos SDK - derived from mobile design\nexport const COLORS = {\n // Button gradient colors\n btnGradStart: '#1A1A1A',\n btnGradEnd: '#000000',\n \n // Button text and icon colors\n btnLabel: '#FFFFFF',\n btnBorder: 'rgba(0, 0, 0, 0.2)',\n \n // Icon circle gradient colors\n iconCircleGradientStart: '#333333',\n iconCircleGradientEnd: '#1A1A1A',\n \n // Background colors\n background: '#FFFFFF',\n backgroundSecondary: '#F8F9FA',\n \n // Text colors\n textPrimary: '#1A1A1A',\n textSecondary: '#6B7280',\n textMuted: '#9CA3AF',\n \n // Border colors\n border: '#E5E7EB',\n borderLight: '#F3F4F6',\n \n // Status colors\n success: '#10B981',\n error: '#EF4444',\n warning: '#F59E0B',\n info: '#3B82F6',\n \n // Interactive states\n hover: 'rgba(0, 0, 0, 0.05)',\n pressed: 'rgba(0, 0, 0, 0.1)',\n focus: 'rgba(59, 130, 246, 0.1)',\n};\n\nexport default COLORS; ","import React, { useState } from 'react';\nimport { COLORS } from '../../theme/colors.js';\n\n// Icon Circle component matching the React Native version\nconst IconCircle = ({ \n size = 40, \n children,\n className = ''\n}) => {\n return (\n <div \n className={`relative flex items-center justify-center border border-black border-opacity-25 ${className}`}\n style={{\n width: size,\n height: size,\n borderRadius: size / 2,\n background: `linear-gradient(to bottom, ${COLORS.iconCircleGradientStart}, ${COLORS.iconCircleGradientEnd})`\n }}\n >\n {children || (\n <span \n className=\"font-semibold opacity-95\"\n style={{\n fontSize: '20px',\n color: COLORS.btnLabel,\n backgroundColor: 'transparent'\n }}\n >\n →\n </span>\n )}\n </div>\n );\n};\n\n// Primary Button component matching the React Native design\nconst PrimaryButton = ({\n label = \"Get Started\",\n onClick,\n iconRight,\n loading = false,\n disabled = false,\n testId,\n className = '',\n style = {},\n textStyle = {},\n centered = false,\n ...props\n}) => {\n const [pressed, setPressed] = useState(false);\n\n const handleMouseDown = () => setPressed(true);\n const handleMouseUp = () => setPressed(false);\n const handleMouseLeave = () => setPressed(false);\n\n const buttonStyle = {\n height: '48px',\n borderRadius: '100px',\n border: `1px solid ${COLORS.btnBorder}`,\n background: `linear-gradient(to bottom, ${COLORS.btnGradStart}, ${COLORS.btnGradEnd})`,\n position: 'relative',\n overflow: 'hidden',\n width: centered ? 'auto' : '100%',\n minWidth: centered ? '250px' : 'auto',\n maxWidth: centered ? '350px' : 'none',\n margin: centered ? '0 auto' : '0',\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.65 : 1,\n boxShadow: disabled ? 'none' : '20px 30px 40px rgba(0,0,0,0.10)',\n transition: 'all 0.2s ease',\n ...style\n };\n\n const pressedOverlayStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: 'rgba(0,0,0,0.1)',\n borderRadius: '100px',\n opacity: pressed ? 1 : 0,\n transition: 'opacity 0.1s ease'\n };\n\n const textContainerStyle = {\n position: 'absolute',\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n backgroundColor: 'transparent'\n };\n\n const iconPositionStyle = {\n position: 'absolute',\n right: '4px',\n top: '4px',\n bottom: '4px',\n width: '40px',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n backgroundColor: 'transparent'\n };\n\n const labelStyle = {\n fontFamily: 'Inter, system-ui, sans-serif',\n fontWeight: '600',\n fontSize: '16px',\n color: COLORS.btnLabel,\n textAlign: 'center',\n backgroundColor: 'transparent',\n ...textStyle\n };\n\n return (\n <button\n className={`relative ${className}`}\n style={buttonStyle}\n onClick={onClick}\n onMouseDown={handleMouseDown}\n onMouseUp={handleMouseUp}\n onMouseLeave={handleMouseLeave}\n disabled={disabled || loading}\n data-testid={testId}\n aria-label={label}\n {...props}\n >\n {/* Pressed state overlay */}\n <div style={pressedOverlayStyle} />\n\n {/* Centered text container */}\n <div style={textContainerStyle}>\n {loading ? (\n <div \n className=\"animate-spin rounded-full border-2 border-white border-t-transparent\"\n style={{ width: '20px', height: '20px' }}\n />\n ) : (\n <span style={labelStyle}>{label}</span>\n )}\n </div>\n\n {/* Icon in fixed position on right */}\n <div style={iconPositionStyle}>\n {!loading && (iconRight || <IconCircle />)}\n </div>\n </button>\n );\n};\n\nexport { IconCircle };\nexport default PrimaryButton; ","import React, { useState, useEffect } from 'react';\nimport { Mail, ArrowRight, Check } from 'lucide-react';\nimport PrimaryButton from './ui/PrimaryButton.jsx';\nimport { COLORS } from '../theme/colors.js';\n\nexport default function EmailAuth({ onSuccess, testMode = true }) {\n const [email, setEmail] = useState('');\n const [code, setCode] = useState('');\n const [step, setStep] = useState('email'); // 'email' | 'code' | 'success'\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState('');\n const [emailSent, setEmailSent] = useState(true); // Track if email was actually sent\n const [emailServiceMessage, setEmailServiceMessage] = useState(''); // Store service message\n\n // Auto-focus first PIN input when code step loads\n useEffect(() => {\n if (step === 'code') {\n // Small delay to ensure DOM is ready\n setTimeout(() => {\n const firstInput = document.querySelector('input[maxLength=\"1\"]');\n if (firstInput) {\n firstInput.focus();\n }\n }, 100);\n }\n }, [step]);\n\n const validateEmail = (email) => {\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n return emailRegex.test(email);\n };\n\n const handleEmailSubmit = async (e) => {\n e.preventDefault();\n setError('');\n setEmailSent(true); // Reset email status\n setEmailServiceMessage(''); // Reset service message\n\n if (!validateEmail(email)) {\n setError('Please enter a valid email address');\n return;\n }\n\n setIsLoading(true);\n\n try {\n if (testMode) {\n // Test mode: Skip API call completely, simulate instant success\n console.log('🧪 Test mode: Simulating email verification request for:', email);\n setTimeout(() => {\n setStep('code');\n setIsLoading(false);\n console.log('🧪 Test mode: Email verification simulated successfully');\n }, 800); // Shorter delay for faster testing\n } else {\n // Production mode: Use proper email verification API from schema\n const baseUrl = (typeof window !== 'undefined' && window.onairosBaseUrl) || 'https://api2.onairos.uk';\n const apiKey = (typeof window !== 'undefined' && window.onairosApiKey) || 'ona_VvoHNg1fdCCUa9eBy4Iz3IfvXdgLfMFI7TNcyHLDKEadPogkbjAeE2iDOs6M7Aey';\n \n const response = await fetch(`${baseUrl}/email/verify`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'x-api-key': apiKey,\n 'Authorization': `Bearer ${apiKey}`\n },\n body: JSON.stringify({\n email: (email || '').trim().toLowerCase()\n }),\n });\n\n if (!response.ok) {\n throw new Error('Failed to send verification code');\n }\n\n const data = await response.json();\n if (!data.success) {\n throw new Error(data.error || 'Failed to send verification code');\n }\n\n console.log('📧 Email request response:', data);\n\n // Store email service status\n setEmailSent(data.emailSent !== false); // Default to true if not specified\n setEmailServiceMessage(data.message || '');\n\n setStep('code');\n setIsLoading(false);\n }\n } catch (error) {\n console.error('Email request error:', error);\n setError(error.message);\n setIsLoading(false);\n }\n };\n\n const handleGoogleAuth = async () => {\n try {\n setIsLoading(true);\n setError('');\n\n // Create temporary account identifier for OAuth flow\n const tempId = `google_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;\n localStorage.setItem('onairos_temp_google_id', tempId);\n console.log('✅ Temporary account created for Google OAuth');\n\n const sdkConfig = {\n baseUrl: 'https://api2.onairos.uk',\n apiKey: window.onairosApiKey || 'test-key',\n };\n\n const username = localStorage.getItem('username') || \n (JSON.parse(localStorage.getItem('onairosUser') || '{}')?.email) || \n tempId;\n \n console.log('🔗 Requesting Gmail OAuth URL for Google authentication...');\n \n // Request OAuth URL from backend\n const res = await fetch(`${sdkConfig.baseUrl}/gmail/authorize`, {\n method: 'POST',\n headers: {\n 'x-api-key': sdkConfig.apiKey,\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n session: { username }\n })\n });\n\n if (!res.ok) {\n throw new Error('Failed to get OAuth URL');\n }\n\n const data = await res.json();\n const oauthUrl = data.gmailURL || data.gmailUrl || data.gmail_url || data.url;\n \n if (!oauthUrl) {\n throw new Error('No OAuth URL received from backend');\n }\n\n console.log('🚀 Opening Google OAuth popup...');\n\n // Open popup for OAuth\n const popup = window.open(\n oauthUrl,\n 'google_oauth',\n 'width=500,height=600,scrollbars=yes,resizable=yes,status=no,location=no,toolbar=no,menubar=no'\n );\n\n if (!popup) {\n throw new Error('Popup blocked. Please allow popups for this site.');\n }\n\n // Set up postMessage listener for cross-origin communication\n const messageHandler = (event) => {\n // Only accept messages from onairos.uk origin\n if (event.origin !== 'https://api2.onairos.uk' && \n event.origin !== 'https://onairos.uk' &&\n !event.origin.includes('onairos.uk')) {\n return;\n }\n\n if (event.data && event.data.type === 'oauth-success' && event.data.platform === 'gmail') {\n console.log('✅ OAuth success received via postMessage:', event.data);\n window.removeEventListener('message', messageHandler);\n handleOAuthSuccess(event.data.email || event.data.gmailEmail);\n }\n };\n\n window.addEventListener('message', messageHandler);\n console.log('👂 [POSTMESSAGE] Listener registered, waiting for messages...');\n\n // Poll localStorage for OAuth completion (oauth-callback.html sets this)\n let pollCount = 0;\n const maxPolls = 300; // 5 minutes max (300 * 1 second)\n const localStorageKey = 'onairos_gmail_success';\n const timestampKey = 'onairos_gmail_timestamp';\n\n const pollInterval = setInterval(() => {\n pollCount++;\n \n try {\n // Check if popup is closed (user might have closed it manually)\n // If closed after OAuth redirect (pollCount > 10 = ~10 seconds), try fallback\n if (popup.closed && pollCount > 10) {\n clearInterval(pollInterval);\n window.removeEventListener('message', messageHandler);\n console.log('⚠️ OAuth popup was closed, trying fallback to get email from backend...');\n retrieveAndContinueWithGoogleEmail(username, tempId);\n return;\n }\n\n // Check localStorage for success signal\n const success = localStorage.getItem(localStorageKey);\n const timestamp = localStorage.getItem(timestampKey);\n \n if (success === 'true' && timestamp) {\n const timestampNum = parseInt(timestamp, 10);\n const now = Date.now();\n \n // Only process if timestamp is recent (within last 30 seconds)\n if (now - timestampNum < 30000) {\n console.log('✅ Cross-origin detected - OAuth popup navigated to onairos.uk');\n clearInterval(pollInterval);\n window.removeEventListener('message', messageHandler);\n \n // Try to get email from URL params (stored by oauth-callback.html)\n // The callback URL includes: ?success=true&platform=gmail&email=...\n // We need to retrieve email from backend since we can't access popup.location\n retrieveAndContinueWithGoogleEmail(username, tempId);\n }\n }\n\n // Check for cross-origin navigation (don't access popup.location - causes COOP error)\n // Instead, rely on localStorage and postMessage signals\n if (pollCount === 1) {\n console.log('✅ Cross-origin detected - waiting for postMessage/localStorage...');\n }\n\n // Timeout after max polls\n if (pollCount >= maxPolls) {\n clearInterval(pollInterval);\n window.removeEventListener('message', messageHandler);\n setIsLoading(false);\n console.log('⏳ [TIMEOUT] PostMessage not received after 5 minutes, closing popup and trying fallback...');\n \n // Try fallback: retrieve email from backend\n if (popup.closed) {\n retrieveAndContinueWithGoogleEmail(username, tempId);\n } else {\n try {\n popup.close();\n } catch (e) {}\n setError('OAuth timeout. Please try again.');\n }\n }\n } catch (error) {\n console.error('Error in OAuth polling:', error);\n }\n }, 1000);\n\n // Cleanup function\n const cleanup = () => {\n clearInterval(pollInterval);\n window.removeEventListener('message', messageHandler);\n try {\n localStorage.removeItem(localStorageKey);\n localStorage.removeItem(timestampKey);\n } catch (e) {}\n };\n\n // Store cleanup function for component unmount\n if (typeof window !== 'undefined') {\n window._onairosOAuthCleanup = cleanup;\n }\n\n } catch (error) {\n console.error('❌ Google OAuth failed:', error);\n setError('Google authentication failed. Please try again.');\n setIsLoading(false);\n }\n };\n\n // Helper function to retrieve Gmail email from backend and continue flow\n const retrieveAndContinueWithGoogleEmail = async (username, tempId) => {\n try {\n console.log('📧 Retrieving Gmail email from backend for user:', username || tempId);\n \n // First, try to get email from localStorage (set by oauth-callback.html)\n let gmailEmail = localStorage.getItem('onairos_gmail_email');\n if (gmailEmail) {\n console.log('✅ Gmail email retrieved from localStorage:', gmailEmail);\n handleOAuthSuccess(gmailEmail);\n return;\n }\n\n const sdkConfig = {\n baseUrl: 'https://api2.onairos.uk',\n apiKey: window.onairosApiKey || 'test-key',\n };\n\n // Try to get email from backend\n const emailRes = await fetch(`${sdkConfig.baseUrl}/gmail/get-email`, {\n method: 'POST',\n headers: {\n 'x-api-key': sdkConfig.apiKey,\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n username: username || tempId\n })\n });\n\n if (emailRes.ok) {\n const emailData = await emailRes.json();\n gmailEmail = emailData.email;\n console.log('✅ Gmail email retrieved from backend:', gmailEmail);\n } else {\n console.warn('⚠️ Could not retrieve Gmail email from backend');\n // Last resort: use temp username or prompt user\n gmailEmail = username && username.includes('@') ? username : `${tempId}@gmail.com`;\n console.log('⚠️ Using fallback email:', gmailEmail);\n }\n\n // Continue with email verification flow using Gmail email\n handleOAuthSuccess(gmailEmail);\n\n } catch (error) {\n console.error('❌ Error retrieving Gmail email:', error);\n // Continue anyway with fallback\n handleOAuthSuccess(`${tempId}@gmail.com`);\n }\n };\n\n // Helper function to handle OAuth success (Gmail)\n const handleOAuthSuccess = async (gmailEmail) => {\n try {\n setIsLoading(true);\n console.log('✅ Google OAuth completed successfully, email:', gmailEmail);\n\n // For Gmail SSO we trust Google's email verification and skip the 6‑digit code.\n // We still record the email locally and immediately continue into onboarding.\n const normalizedEmail = (gmailEmail || '').trim().toLowerCase();\n setEmail(normalizedEmail);\n\n // Simulate a successful verification response and jump straight to success → UniversalOnboarding\n setStep('success');\n setIsLoading(false);\n\n setTimeout(() => {\n onSuccess({\n email: normalizedEmail,\n verified: true,\n token: null,\n userName: normalizedEmail.split('@')[0],\n existingUser: false,\n accountInfo: null,\n isNewUser: true,\n flowType: 'onboarding',\n adminMode: false,\n userCreated: true,\n accountDetails: {\n email: normalizedEmail,\n createdAt: new Date().toISOString(),\n ssoProvider: 'gmail'\n }\n });\n }, 400);\n \n } catch (error) {\n console.error('❌ Error handling OAuth success:', error);\n setError('Failed to continue with Google authentication. Please try again.');\n setIsLoading(false);\n }\n };\n\n const handleCodeSubmit = async (e) => {\n e.preventDefault();\n setError('');\n setIsLoading(true);\n\n try {\n if (testMode) {\n // Test mode: Skip API call completely, simulate verification\n console.log('🧪 Test mode: Simulating code verification for:', email, 'with code:', code);\n \n if (code === '123456' || code.length === 6) {\n setStep('success');\n setTimeout(() => {\n // Simulate new user for design testing\n const simulatedResponse = { \n email, \n verified: true, \n token: 'test-token-' + Date.now(),\n userName: email.split('@')[0],\n existingUser: false, // Always simulate new user for full flow testing\n accountInfo: null,\n isNewUser: true,\n flowType: 'onboarding',\n adminMode: false,\n userCreated: true,\n accountDetails: {\n email: email,\n createdAt: new Date().toISOString(),\n testAccount: true\n }\n };\n console.log('🧪 Test mode: Simulated verification successful, user data:', simulatedResponse);\n onSuccess(simulatedResponse);\n }, 600); // Faster for design testing\n } else {\n setError('Invalid code. Use any 6-digit code (e.g., 123456) for testing.');\n setIsLoading(false);\n }\n } else {\n // Production mode: Use real email verification API from schema\n const baseUrl = (typeof window !== 'undefined' && window.onairosBaseUrl) || 'https://api2.onairos.uk';\n const apiKey = (typeof window !== 'undefined' && window.onairosApiKey) || 'ona_VvoHNg1fdCCUa9eBy4Iz3IfvXdgLfMFI7TNcyHLDKEadPogkbjAeE2iDOs6M7Aey';\n \n const response = await fetch(`${baseUrl}/email/verify/confirm`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'x-api-key': apiKey,\n 'Authorization': `Bearer ${apiKey}`\n },\n body: JSON.stringify({\n email: (email || '').trim().toLowerCase(),\n code: code.trim()\n }),\n });\n\n if (!response.ok) {\n throw new Error('Invalid verification code');\n }\n\n const data = await response.json();\n \n if (!data.success) {\n throw new Error(data.error || 'Verification failed');\n }\n\n console.log('📧 Email verification response:', data);\n\n setStep('success');\n setTimeout(() => {\n // Pass complete API response for flow determination\n onSuccess({ \n email, \n verified: true, \n token: data.token || data.jwtToken,\n userName: data.userName,\n existingUser: data.existingUser,\n accountInfo: data.accountInfo,\n isNewUser: !data.existingUser, // Set based on API response\n flowType: data.existingUser ? 'dataRequest' : 'onboarding',\n adminMode: data.adminMode,\n userCreated: data.userCreated,\n accountDetails: data.accountDetails\n });\n }, 1000);\n }\n } catch (error) {\n console.error('Email verification error:', error);\n setError(error.message || 'Invalid code. Please try again.');\n setIsLoading(false);\n }\n };\n\n const renderEmailStep = () => (\n <div className=\"w-full flex flex-col\" style={{ height: '100%' }}>\n {/* Content - Flexible center area */}\n <div className=\"px-12 pt-16 pb-8 text-center flex-1 flex flex-col\">\n <div className=\"mb-8\">\n <h1 className=\"text-2xl font-bold text-gray-900 mb-2 text-balance leading-tight\">\n Use pre-existing Persona or create a new one in seconds\n </h1>\n <p className=\"text-gray-600 text-base\">Sign in or create an account</p>\n </div>\n\n <div className=\"mb-6\">\n <input\n type=\"email\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n placeholder=\"Enter your email\"\n className=\"w-full max-w-sm mx-auto px-4 py-4 text-base bg-gray-50 border-0 rounded-xl placeholder:text-gray-400 focus:bg-white focus:ring-2 focus:ring-gray-200 outline-none transition-all duration-200\"\n style={{ \n fontFamily: 'Inter, system-ui, sans-serif'\n }}\n required\n />\n </div>\n\n <div className=\"mb-6 text-center\">\n <span className=\"text-gray-500 text-sm\">Or</span>\n </div>\n\n <div className=\"mb-8\">\n <button\n type=\"button\"\n className=\"w-full max-w-sm mx-auto py-4 text-base font-medium rounded-xl border border-gray-200 hover:bg-gray-50 flex items-center justify-center gap-3 bg-transparent transition-colors\"\n style={{ \n fontFamily: 'Inter, system-ui, sans-serif'\n }}\n onClick={handleGoogleAuth}\n >\n <svg className=\"w-5 h-5\" viewBox=\"0 0 24 24\">\n <path\n fill=\"#4285F4\"\n d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z\"\n />\n <path\n fill=\"#34A853\"\n d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\"\n />\n <path\n fill=\"#FBBC05\"\n d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\"\n />\n <path\n fill=\"#EA4335\"\n d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\"\n />\n </svg>\n Continue with Google\n </button>\n </div>\n\n {/* Error Display */}\n {error && (\n <div className=\"mb-6\">\n <p className=\"text-sm text-center\" style={{ color: COLORS.error }}>{error}</p>\n </div>\n )}\n </div>\n\n {/* Continue Button - Fixed at bottom */}\n <div className=\"px-12 pb-8 flex-shrink-0\">\n <button\n className=\"w-full max-w-sm mx-auto bg-gray-900 hover:bg-gray-800 text-white rounded-full py-4 text-base font-medium flex items-center justify-center gap-2 transition-colors disabled:opacity-50\"\n onClick={handleEmailSubmit}\n disabled={isLoading || !email.trim()}\n style={{ \n fontFamily: 'Inter, system-ui, sans-serif'\n }}\n >\n {isLoading ? 'Loading...' : 'Continue'}\n <svg className=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M9 5l7 7-7 7\" />\n </svg>\n </button>\n </div>\n </div>\n );\n\n const renderCodeStep = () => (\n <div className=\"w-full flex flex-col\" style={{ height: '100%' }}>\n {/* Heading - matching VerificationStep.tsx */}\n <div className=\"w-full pt-16 px-12 mb-10 text-center\">\n <h1 \n className=\"font-bold mb-2\"\n style={{ \n fontFamily: 'IBM Plex Sans, system-ui, sans-serif',\n fontWeight: '700',\n fontSize: '24px',\n lineHeight: '32px',\n color: COLORS.textPrimary\n }}\n >\n Enter verification code\n </h1>\n <p \n className=\"mb-2\"\n style={{ \n fontFamily: 'Inter, system-ui, sans-serif',\n fontWeight: '400',\n fontSize: '16px',\n lineHeight: '24px',\n color: COLORS.textSecondary\n }}\n >\n {emailSent ? `We've sent a 6-digit code to ${email}` : `A verification code has been generated for ${email}`}\n </p>\n {!emailSent && (\n <div \n className=\"mb-4 mx-auto max-w-sm px-4 py-3 rounded-lg border\"\n style={{ \n backgroundColor: '#FEF3C7',\n borderColor: '#FCD34D',\n fontFamily: 'Inter, system-ui, sans-serif',\n fontSize: '14px',\n lineHeight: '20px',\n color: '#92400E'\n }}\n >\n <p className=\"font-medium mb-1\">⚠️ Email service unavailable</p>\n <p className=\"text-sm\">\n {emailServiceMessage.includes('testing mode') || emailServiceMessage.includes('server logs') \n ? 'Any 6-digit code will be accepted. Check server logs for the actual code.'\n : 'The verification code was generated but could not be sent. Please check server logs or contact support.'}\n </p>\n </div>\n )}\n </div>\n\n\n {/* Code Input - matching VerificationStep design with individual digit boxes */}\n <div className=\"px-12 mb-6\">\n <div className=\"flex justify-center space-x-3\">\n {Array.from({ length: 6 }, (_, index) => (\n <input\n key={index}\n type=\"text\"\n maxLength=\"1\"\n value={code[index] || ''}\n onChange={(e) => {\n const newCode = code.split('');\n newCode[index] = e.target.value;\n setCode(newCode.join(''));\n \n // Auto-focus next input\n if (e.target.value && index < 5) {\n const nextInput = e.target.parentElement?.children[index + 1];\n if (nextInput) nextInput.focus();\n }\n }}\n onKeyDown={(e) => {\n // Handle backspace to focus previous input\n if (e.key === 'Backspace' && !code[index] && index > 0) {\n const prevInput = e.target.parentElement?.children[index - 1];\n if (prevInput) prevInput.focus();\n }\n }}\n className=\"w-12 h-12 border rounded-lg text-center text-lg font-medium focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none\"\n style={{ \n borderColor: COLORS.border,\n backgroundColor: COLORS.background,\n fontFamily: 'Inter, system-ui, sans-serif'\n }}\n />\n ))}\n </div>\n </div>\n\n {/* Error Display */}\n {error && (\n <div className=\"px-12 mb-6\">\n <p className=\"text-sm text-center\" style={{ color: COLORS.error }}>{error}</p>\n </div>\n )}\n\n {/* Continue Button - positioned right below code inputs */}\n <div className=\"px-12 mb-6\">\n <div className=\"max-w-sm mx-auto\">\n <PrimaryButton\n label=\"Continue\"\n onClick={handleCodeSubmit}\n loading={isLoading}\n disabled={isLoading || code.length !== 6}\n testId=\"verify-code-button\"\n />\n </div>\n </div>\n\n {/* Spacer */}\n <div style={{ flex: 1, minHeight: '20px' }} />\n\n {/* Back to email option */}\n <div className=\"px-12 w-full\">\n <div className=\"max-w-sm mx-auto\">\n <button\n type=\"button\"\n onClick={() => setStep('email')}\n className=\"w-full py-2 px-4 font-medium transition-colors text-sm\"\n style={{ color: COLORS.textSecondary }}\n >\n Use a different email\n </button>\n </div>\n </div>\n </div>\n );\n\n const renderSuccessStep = () => (\n <div className=\"w-full flex flex-col items-center space-y-6 pt-16 px-12\">\n <div \n className=\"flex items-center justify-center w-16 h-16 rounded-full\"\n style={{ backgroundColor: '#D1FAE5' }}\n >\n <Check className=\"w-8 h-8\" style={{ color: COLORS.success }} />\n </div>\n \n <div className=\"text-center space-y-2\">\n <h2 \n className=\"text-xl font-semibold\"\n style={{ color: COLORS.textPrimary }}\n >\n Email verified!\n </h2>\n <p style={{ color: COLORS.textSecondary }}>Setting up your account...</p>\n </div>\n\n <div className=\"w-8 h-8\">\n <div className=\"animate-spin h-8 w-8 border-2 border-blue-600 rounded-full border-t-transparent\"></div>\n </div>\n </div>\n );\n\n return (\n <div className=\"w-full\">\n {step === 'email' && renderEmailStep()}\n {step === 'code' && renderCodeStep()}\n {step === 'success' && renderSuccessStep()}\n </div>\n );\n} \n","import React, { Component } from 'react';\nimport { useLLMConnectorManager } from '../LLMConnectorManager';\n\nclass ChatGPTConnector extends Component {\n constructor(props) {\n super(props);\n this.state = {\n connected: false,\n open: false,\n isConnecting: false,\n };\n this.handleClose = this.handleClose.bind(this);\n this.handleOpen = this.handleOpen.bind(this);\n this.chatGPTConnect = this.chatGPTConnect.bind(this);\n this.setConnected = this.setConnected.bind(this);\n this.setDisconnected = this.setDisconnected.bind(this);\n }\n\n setConnected() {\n this.setState({ connected: true });\n if (this.props.onConnectionChange) {\n this.props.onConnectionChange('ChatGPT', true);\n }\n this.handleClose();\n }\n\n setDisconnected() {\n this.setState({ connected: false });\n if (this.props.onConnectionChange) {\n this.props.onConnectionChange('ChatGPT', false);\n }\n this.handleClose();\n }\n\n handleOpen() {\n this.setState({ open: true });\n }\n\n handleClose() {\n this.setState({ open: false });\n if (this.props.onClose) {\n this.props.onClose();\n }\n }\n\n async chatGPTConnect() {\n // Use the LLM Connector Manager if available, otherwise fallback to old behavior\n const llmManager = this.props.llmConnectorManager;\n \n if (llmManager) {\n // New behavior: Use extension detection\n llmManager.connectToLLM(\n 'chatgpt',\n (platform) => {\n // Success callback\n console.log(`✅ ${platform} connected via extension`);\n this.setConnected();\n },\n (platform, error) => {\n // Error callback\n console.error(`❌ ${platform} connection error:`, error);\n alert(`Failed to connect to ${platform}. ${error}`);\n }\n );\n } else {\n // Fallback: Original behavior for backward compatibility\n this.setState({ isConnecting: true });\n \n try {\n console.log('🤖 Opening ChatGPT in new tab (fallback mode)...');\n \n const chatGPTWindow = window.open('https://chatgpt.com', '_blank');\n \n if (!chatGPTWindow) {\n throw new Error('Popup blocked. Please allow popups for this site.');\n }\n\n setTimeout(() => {\n console.log('✅ ChatGPT connection simulated (fallback)');\n this.setConnected();\n this.setState({ isConnecting: false });\n }, 1000);\n\n } catch (error) {\n console.error('❌ ChatGPT connection error:', error);\n this.setState({ isConnecting: false });\n alert('Failed to open ChatGPT. Please ensure popups are allowed and try again.');\n }\n }\n }\n\n render() {\n const { open = this.props.open || this.state.open } = this.props;\n \n if (!open) return null;\n\n // Bookmarklet code: fully inline so it works with ChatGPT CSP (no external script load)\n const bookmarkletCode = `javascript:(function(){try{var ok=window.confirm('Allow Onairos to export your last 10 ChatGPT conversations to your Onairos account?');if(!ok){console.log('❌ Onairos ChatGPT export cancelled by user.');return;}console.log('✅ Onairos ChatGPT export consent granted. Extracting conversations...');setTimeout(function(){console.log('✅ Export complete! You can now return to your Onairos tab.');if(window.opener&&!window.opener.closed){window.opener.focus();}},1500);}catch(e){console.error('Onairos ChatGPT bookmarklet error:',e);}})();`;\n \n return (\n <>\n <style>{`\n @keyframes gentlePulse {\n 0%, 100% {\n box-shadow: 0 0 0 0 rgba(148, 163, 184, 0.35);\n }\n 50% {\n box-shadow: 0 0 0 10px rgba(148, 163, 184, 0);\n }\n }\n .bookmarklet-button {\n background: rgba(15, 23, 42, 0.85);\n border-radius: 9999px;\n border: 1px solid rgba(255,255,255,0.16);\n backdrop-filter: blur(18px);\n }\n .bookmarklet-button:hover {\n background: rgba(15, 23, 42, 0.92);\n }\n @keyframes fadeInScale {\n 0% { opacity: 0; transform: translateY(8px) scale(0.96); }\n 100% { opacity: 1; transform: translateY(0) scale(1); }\n }\n .chatgpt-modal-card {\n animation: fadeInScale 200ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n .step-circle {\n background: rgba(15, 23, 42, 0.9);\n min-width: 28px;\n width: 28px;\n height: 28px;\n }\n `}</style>\n \n {/* Backdrop (transparent so it feels like a sheet on top of the existing modal) */}\n <div className=\"fixed inset-0 flex items-center justify-center z-50 p-4 pointer-events-none\">\n \n {/* Compact Modal Container */}\n <div className=\"w-full max-w-md pointer-events-auto\">\n <div className=\"chatgpt-modal-card rounded-3xl overflow-hidden shadow-[0_30px_80px_rgba(15,23,42,0.70)] border border-white/10 bg-[radial-gradient(circle_at_top,_rgba(255,255,255,0.22),_transparent_55%),radial-gradient(circle_at_bottom,_rgba(15,23,42,0.9),_rgba(15,23,42,1))] backdrop-blur-3xl\">\n \n {/* Header */}\n <div className=\"relative px-5 py-4 border-b border-white/10 bg-white/10\">\n <button\n onClick={this.handleClose}\n className=\"absolute right-4 top-4 p-1.5 hover:bg-white/20 rounded-full transition-colors\"\n aria-label=\"Close\"\n >\n <svg className=\"w-4 h-4 text-slate-100\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n\n <h2 className=\"text-xl font-semibold text-slate-50 pr-8\">\n Connect ChatGPT\n </h2>\n <p className=\"text-sm text-slate-300 mt-0.5\">\n Three quick steps to import your conversations\n </p>\n \n {/* Privacy Notice */}\n <div className=\"mt-3 flex items-start gap-2 bg-white/12 rounded-2xl px-3 py-2\">\n <svg className=\"w-4 h-4 text-emerald-300 mt-0.5 flex-shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\">\n <path fillRule=\"evenodd\" d=\"M2.166 4.999A11.954 11.954 0 0010 1.944 11.954 11.954 0 0017.834 5c.11.65.166 1.32.166 2.001 0 5.225-3.34 9.67-8 11.317C5.34 16.67 2 12.225 2 7c0-.682.057-1.35.166-2.001zm11.541 3.708a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z\" clipRule=\"evenodd\" />\n </svg>\n <p className=\"text-xs text-slate-100/90 leading-relaxed\">\n <strong className=\"font-semibold\">Private & secure.</strong> We only access your chat history. No one else sees this data.\n </p>\n </div>\n </div>\n\n {/* Steps Content */}\n <div className=\"px-5 py-4 space-y-4\">\n \n {/* Step 1 */}\n <div className=\"flex gap-3\">\n <div className=\"flex-shrink-0\">\n <div className=\"step-circle rounded-full flex items-center justify-center\">\n <span className=\"text-white font-bold text-sm\">1</span>\n </div>\n </div>\n <div className=\"flex-1 pt-0.5\">\n <h3 className=\"text-sm font-semibold text-slate-50 mb-1\">\n Drag this button to your bookmarks bar\n </h3>\n <div className=\"relative inline-block mt-2\">\n <div className=\"absolute inset-0 rounded-full\" style={{ animation: 'gentlePulse 2s ease-in-out infinite' }}></div>\n <a\n href={bookmarkletCode}\n draggable=\"true\"\n onDragStart={(e) => {\n e.dataTransfer.setData('text/plain', bookmarkletCode);\n e.dataTransfer.effectAllowed = 'copy';\n }}\n onClick={(e) => {\n e.preventDefault();\n alert('Please drag this button to your bookmarks bar');\n }}\n className=\"bookmarklet-button relative inline-flex items-center gap-1.5 px-4 py-2 font-medium text-slate-50 cursor-move select-none transition-all hover:scale-[1.03]\"\n >\n <span className=\"text-base\">✨</span>\n <span className=\"text-sm\">Onairos ChatGPT</span>\n </a>\n </div>\n <p className=\"text-xs text-slate-300 mt-2\">\n <kbd className=\"px-1.5 py-0.5 bg-white/10 rounded-full text-[10px] font-mono text-slate-100 border border-white/10\">Ctrl+Shift+B</kbd> to show bookmarks bar\n </p>\n </div>\n </div>\n\n {/* Divider */}\n <div className=\"border-t border-white/10 ml-10\"></div>\n\n {/* Step 2 */}\n <div className=\"flex gap-3\">\n <div className=\"flex-shrink-0\">\n <div className=\"step-circle rounded-full flex items-center justify-center\">\n <span className=\"text-white font-bold text-sm\">2</span>\n </div>\n </div>\n <div className=\"flex-1 pt-0.5\">\n <h3 className=\"text-sm font-semibold text-slate-50 mb-1\">\n Open ChatGPT and log in\n </h3>\n <p className=\"text-xs text-slate-300 mb-2\">\n Make sure you're logged into your ChatGPT account\n </p>\n <button\n onClick={() => {\n window.open('https://chatgpt.com', '_blank');\n }}\n className=\"inline-flex items-center gap-1.5 px-4 py-2 rounded-full bg-emerald-400/90 hover:bg-emerald-300 text-slate-900 text-xs font-medium transition-colors shadow-[0_0_25px_rgba(52,211,153,0.35)]\"\n >\n <svg className=\"w-3.5 h-3.5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14\" />\n </svg>\n Open ChatGPT\n </button>\n </div>\n </div>\n\n {/* Divider */}\n <div className=\"border-t border-white/10 ml-10\"></div>\n\n {/* Step 3 */}\n <div className=\"flex gap-3\">\n <div className=\"flex-shrink-0\">\n <div className=\"step-circle rounded-full flex items-center justify-center\">\n <span className=\"text-white font-bold text-sm\">3</span>\n </div>\n </div>\n <div className=\"flex-1 pt-0.5\">\n <h3 className=\"text-sm font-semibold text-slate-50 mb-1\">\n Click the bookmark on ChatGPT\n </h3>\n <p className=\"text-xs text-slate-300\">\n Click the <strong>\"Onairos ChatGPT\"</strong> bookmark you added. We'll securely import your last 10 conversations.\n </p>\n </div>\n </div>\n\n </div>\n\n {/* Footer */}\n <div className=\"px-5 py-4 bg-white/5 border-t border-white/10\">\n <button\n onClick={() => {\n this.setConnected();\n }}\n className=\"w-full px-4 py-2.5 rounded-full font-medium text-slate-900 text-sm transition-all hover:scale-[1.01] active:scale-[0.99] bg-slate-100/90 hover:bg-white shadow-[0_10px_30px_rgba(15,23,42,0.45)] border border-white/40\"\n >\n Got it! ✓\n </button>\n </div>\n \n </div>\n </div>\n </div>\n </>\n );\n }\n}\n\nexport default ChatGPTConnector;\n","import React, { useEffect, useId, useState, useRef } from 'react';\nimport Lottie from 'lottie-react';\nimport personaAnim from '../../public/persona-anim.json';\nimport ChatGPTConnector from './connectors/ChatGPTConnector';\nconst chatgptIcon = 'https://anushkasirv.sirv.com/openai.png';\nconst claudeIcon = 'https://anushkasirv.sirv.com/claude-color.png';\nconst geminiIcon = 'https://anushkasirv.sirv.com/gemini-color.png';\nconst grokIcon = 'https://anushkasirv.sirv.com/grok.png';\n\nconst sdkConfig = {\n apiKey: process.env.REACT_APP_ONAIROS_API_KEY || 'ona_VvoHNg1fdCCUa9eBy4Iz3IfvXdgLfMFI7TNcyHLDKEadPogkbjAeE2iDOs6M7Aey',\n baseUrl: process.env.REACT_APP_ONAIROS_BASE_URL || 'https://api2.onairos.uk',\n sdkType: 'web',\n enableHealthMonitoring: true,\n enableAutoRefresh: true,\n enableConnectionValidation: true,\n};\n\nconst fadeSlideInKeyframes = `\n@keyframes fadeSlideIn {\n from { opacity: 0; transform: translateX(var(--slide-x)); }\n to { opacity: 1; transform: translateX(0); }\n}\n`;\n\nexport default function UniversalOnboarding({ onComplete }) {\n const lottieRef = useRef(null);\n const lastFrameRef = useRef(0);\n const rafRef = useRef(null);\n\n const [connectedAccounts, setConnectedAccounts] = useState({});\n const [isConnecting, setIsConnecting] = useState(false);\n const [connectingPlatform, setConnectingPlatform] = useState(null);\n const [selected, setSelected] = useState('Instagram');\n const [currentPage, setCurrentPage] = useState(1);\n const [showChatGPTModal, setShowChatGPTModal] = useState(false);\n\n // swipe state\n const touchStartX = useRef(0);\n const touchDeltaX = useRef(0);\n\n const [vh, setVh] = useState(() => (typeof window !== 'undefined' ? window.innerHeight : 800));\n useEffect(() => {\n const onResize = () => setVh(window.innerHeight);\n window.addEventListener('resize', onResize);\n return () => window.removeEventListener('resize', onResize);\n }, []);\n\n const FOOTER_H = 88;\n\n // persona stays as requested (background, unchanged placement)\n const personaSide = Math.min(vh * 0.52, 500);\n const PERSONA_TOP = 96;\n\n // icon layout (restore tighter spacing on page 1; place the band lower)\n const SLOT = Math.max(56, Math.min(64, Math.floor(vh * 0.07)));\n const CIRCLE = 42;\n const GAP_PAGE1 = 12;\n const GAP_PAGE2 = 20;\n const ACTIVE_SCALE = vh < 760 ? 1.12 : 1.22;\n\n const ICONS_H = 84;\n const ICONS_TOP_OFFSET = Math.max(180, Math.min(240, Math.round(vh * 0.28))); // ~28vh, clamped for all screens\n\n const igGradId = useId();\n\n // ---- official brand SVGs (compact, consistent viewboxes) ----\n const Brand = {\n ChatGPT: <img src={chatgptIcon} alt=\"ChatGPT\" style={{ width: 20, height: 20, objectFit: 'contain' }} />,\n Claude: <img src={claudeIcon} alt=\"Claude\" style={{ width: 20, height: 20, objectFit: 'contain' }} />,\n Gemini: <img src={geminiIcon} alt=\"Gemini\" style={{ width: 20, height: 20, objectFit: 'contain' }} />,\n Grok: <img src={grokIcon} alt=\"Grok\" style={{ width: 20, height: 20, objectFit: 'contain' }} />,\n Instagram: (\n <svg viewBox=\"0 0 24 24\" aria-hidden>\n <defs>\n <radialGradient id={igGradId} cx=\"0.5\" cy=\"1\" r=\"1\">\n <stop offset=\"0%\" stopColor=\"#FDBB4B\"/>\n <stop offset=\"40%\" stopColor=\"#E95950\"/>\n <stop offset=\"70%\" stopColor=\"#BC2A8D\"/>\n <stop offset=\"100%\" stopColor=\"#4C68D7\"/>\n </radialGradient>\n </defs>\n <path fill={`url(#${igGradId})`} d=\"M7 2h10a5 5 0 0 1 5 5v10a5 5 0 0 1-5 5H7a5 5 0 0 1-5-5V7a5 5 0 0 1 5-5zm5 5.5A4.5 4.5 0 1 0 16.5 12 4.5 4.5 0 0 0 12 7.5zm0 7.4A2.9 2.9 0 1 1 14.9 12 2.9 2.9 0 0 1 12 14.9Zm5.35-8.25a1.15 1.15 0 1 0 1.15 1.15 1.15 1.15 0 0 0-1.15-1.15Z\"/>\n </svg>\n ),\n YouTube: (\n <svg viewBox=\"0 0 24 24\" aria-hidden>\n <path fill=\"#FF0000\" d=\"M22.54 6.42a3 3 0 0 0-2.11-2.12C18.49 3.75 12 3.75 12 3.75s-6.49 0-8.43.55A3 3 0 0 0 1.46 6.42 31.63 31.63 0 0 0 1 12a31.63 31.63 0 0 0 .46 5.58 3 3 0 0 0 2.11 2.12C5.51 20.25 12 20.25 12 20.25s6.49 0 8.43-.55a3 3 0 0 0 2.11-2.12A31.63 31.63 0 0 0 23 12a31.63 31.63 0 0 0-.46-5.58z\"/>\n <path fill=\"#FFF\" d=\"M10 8.75v6.5l6-3.25-6-3.25z\"/>\n </svg>\n ),\n Reddit: (\n <svg viewBox=\"0 0 24 24\" aria-hidden>\n <circle cx=\"12\" cy=\"12\" r=\"12\" fill=\"#FF4500\"/>\n <circle cx=\"8.75\" cy=\"12.5\" r=\"1.25\" fill=\"#FFF\"/>\n <circle cx=\"15.25\" cy=\"12.5\" r=\"1.25\" fill=\"#FFF\"/>\n <path fill=\"#FFF\" d=\"M7.9 15c.8.8 2.3 1.05 4.1 1.05S15.3 15.8 16.1 15c.2-.2.2-.5 0-.7-.2-.2-.5-.2-.7 0-.6.6-1.9.85-3.4.85S9.3 14.9 8.7 14.3c-.2-.2-.5-.2-.7 0-.2.2-.2.5 0 .7z\"/>\n </svg>\n ),\n LinkedIn: (\n <svg viewBox=\"0 0 24 24\" aria-hidden>\n <rect x=\"2\" y=\"2\" width=\"20\" height=\"20\" rx=\"3\" fill=\"#0A66C2\"/>\n <rect x=\"5\" y=\"9\" width=\"3\" height=\"10\" fill=\"#FFF\"/>\n <circle cx=\"6.5\" cy=\"6.5\" r=\"1.5\" fill=\"#FFF\"/>\n <path fill=\"#FFF\" d=\"M16.8 19H13.9v-5c0-1.2-.5-1.8-1.4-1.8-.9 0-1.6.6-1.6 1.8V19H8V9h2.8v1.3c.5-.8 1.4-1.5 2.7-1.5 2 0 3.3 1.3 3.3 3.7V19z\"/>\n </svg>\n ),\n Twitter: (\n <svg viewBox=\"0 0 24 24\" aria-hidden>\n <path fill=\"#1DA1F2\" d=\"M23.643 4.937c-.835.37-1.732.62-2.675.733.962-.576 1.7-1.49 2.048-2.578-.9.534-1.897.922-2.958 1.13-.85-.904-2.06-1.47-3.4-1.47-2.572 0-4.658 2.086-4.658 4.66 0 .364.042.718.12 1.06-3.873-.195-7.304-2.05-9.602-4.868-.4.69-.63 1.49-.63 2.342 0 1.616.823 3.043 2.072 3.878-.764-.025-1.482-.234-2.11-.583v.06c0 2.257 1.605 4.14 3.737 4.568-.392.106-.803.162-1.227.162-.3 0-.593-.028-.877-.082.593 1.85 2.313 3.198 4.352 3.234-1.595 1.25-3.604 1.995-5.786 1.995-.376 0-.747-.022-1.112-.065 2.062 1.323 4.51 2.093 7.14 2.093 8.57 0 13.255-7.098 13.255-13.254 0-.2-.005-.402-.014-.602.91-.658 1.7-1.477 2.323-2.41z\"/>\n </svg>\n ),\n };\n\n const aiLinks = {\n ChatGPT: 'https://chat.openai.com',\n Claude: 'https://claude.ai',\n Gemini: 'https://gemini.google.com',\n Grok: 'https://grok.x.ai',\n };\n\n const descriptions = {\n ChatGPT: <>We analyze your <strong className=\"font-semibold\">prompt style</strong> and <strong className=\"font-semibold\">chat history</strong> to match your writing and thinking patterns.</>,\n Claude: <>We learn your <strong className=\"font-semibold\">document workflow</strong> and <strong className=\"font-semibold\">reasoning preferences</strong> to tune output format and detail.</>,\n Gemini: <>We study your <strong className=\"font-semibold\">search patterns</strong> and <strong className=\"font-semibold\">multimodal usage</strong> to improve response accuracy.</>,\n Grok: <>We adapt to your <strong className=\"font-semibold\">X posting style</strong> and <strong className=\"font-semibold\">meme literacy</strong> to match your tone.</>,\n Twitter: <>We analyze your <strong className=\"font-semibold\">tweets</strong> and <strong className=\"font-semibold\">interests</strong> to understand your preferences.</>,\n YouTube: <>We study your <strong className=\"font-semibold\">watch history</strong> and <strong className=\"font-semibold\">interactions</strong> to learn your interests.</>,\n Reddit: <>We examine your <strong className=\"font-semibold\">search history</strong> and <strong className=\"font-semibold\">discussions</strong> to understand your interests.</>,\n Instagram: <>We analyze your <strong className=\"font-semibold\">photos</strong> and <strong className=\"font-semibold\">interactions</strong> to learn visual preferences.</>,\n LinkedIn: <>We study your <strong className=\"font-semibold\">professional graph</strong> and <strong className=\"font-semibold\">content</strong> to understand career interests.</>,\n };\n\n const allPlatforms = [\n // Page 1\n { name: 'Instagram', connector: 'instagram', icon: Brand.Instagram },\n { name: 'YouTube', connector: 'youtube', icon: Brand.YouTube },\n { name: 'ChatGPT', connector: 'chatgpt', icon: Brand.ChatGPT, directLink: aiLinks.ChatGPT },\n // Page 2\n { name: 'Claude', connector: 'claude', icon: Brand.Claude, directLink: aiLinks.Claude },\n { name: 'Gemini', connector: 'gemini', icon: Brand.Gemini, directLink: aiLinks.Gemini },\n { name: 'Twitter', connector: 'twitter', icon: Brand.Twitter },\n // Page 3\n { name: 'LinkedIn', connector: 'linkedin', icon: Brand.LinkedIn },\n { name: 'Reddit', connector: 'reddit', icon: Brand.Reddit },\n { name: 'Grok', connector: 'grok', icon: Brand.Grok, directLink: aiLinks.Grok },\n ];\n\n const getPlatformsForPage = (page) => {\n if (page === 1) return allPlatforms.slice(0, 3);\n if (page === 2) return allPlatforms.slice(3, 6);\n return allPlatforms.slice(6);\n };\n\n const platforms = getPlatformsForPage(currentPage);\n\n useEffect(() => {\n // Load OAuth platform returns\n const p = localStorage.getItem('onairos_oauth_platform');\n if (p) {\n localStorage.removeItem('onairos_oauth_platform');\n localStorage.removeItem('onairos_oauth_return');\n setConnectedAccounts((s) => ({ ...s, [p]: true }));\n }\n \n // Load persisted connected accounts from user data\n try {\n const userData = JSON.parse(localStorage.getItem('onairosUser') || '{}');\n if (userData.connectedAccounts && Array.isArray(userData.connectedAccounts)) {\n // Convert array to object format\n const accountsObj = userData.connectedAccounts.reduce((acc, platform) => {\n acc[platform] = true;\n return acc;\n }, {});\n setConnectedAccounts(accountsObj);\n }\n } catch (error) {\n console.warn('Failed to load persisted connected accounts:', error);\n }\n }, []);\n\n async function connectToPlatform(name) {\n const plat = allPlatforms.find((p) => p.name === name);\n if (!plat) return false;\n try {\n // For direct-link platforms (no OAuth), mark connected immediately and return\n if (plat.directLink) {\n setConnectedAccounts((s) => ({ ...s, [name]: true }));\n setIsConnecting(false);\n setConnectingPlatform(null);\n return true;\n }\n\n // Immediately reflect selection in UI without spinner while starting OAuth\n setConnectedAccounts((s) => ({ ...s, [name]: true }));\n setIsConnecting(true);\n setConnectingPlatform(name);\n \n // BYPASS: Twitter endpoint is 404, so just keep toggle ON without API call\n if (name === 'Twitter') {\n console.log('🐦 Twitter: Bypassing API call (endpoint not available), keeping toggle ON');\n setIsConnecting(false);\n setConnectingPlatform(null);\n return true;\n }\n \n const username = localStorage.getItem('username') || (JSON.parse(localStorage.getItem('onairosUser') || '{}')?.email) || 'user@example.com';\n\n const res = await fetch(`${sdkConfig.baseUrl}/${plat.connector}/authorize`, {\n method: 'POST', headers: { 'x-api-key': sdkConfig.apiKey, 'Content-Type': 'application/json' },\n body: JSON.stringify({ session: { username } }),\n });\n if (!res.ok) throw new Error('auth failed');\n const data = await res.json();\n\n const candidates = (\n {\n youtube: ['youtubeURL','youtubeUrl','youtube_url'],\n linkedin: ['linkedinURL','linkedinUrl','linkedin_url'],\n reddit: ['redditURL','redditUrl','reddit_url'],\n pinterest: ['pinterestURL','pinterestUrl','pinterest_url'],\n instagram: ['instagramURL','instagramUrl','instagram_url'],\n github: ['githubURL','githubUrl','github_url'],\n facebook: ['facebookURL','facebookUrl','facebook_url'],\n gmail: ['gmailURL','gmailUrl','gmail_url'],\n }[plat.connector]\n ) || [`${plat.connector}URL`, `${plat.connector}Url`, `${plat.connector}_url`, 'platformURL', 'authUrl', 'url'];\n\n let oauthUrl = null; for (const k of candidates) if (data[k]) { oauthUrl = data[k]; break; }\n if (!oauthUrl) throw new Error('no url');\n\n const popup = window.open(oauthUrl, `${plat.connector}_oauth`, 'width=500,height=600,scrollbars=yes,resizable=yes,status=no,location=no,toolbar=no,menubar=no');\n if (!popup) throw new Error('popup blocked');\n\n let touched = false; const it = setInterval(() => {\n try { if (popup.location && popup.location.hostname === 'onairos.uk') { touched = true; popup.close(); } } catch { if (!touched) touched = true; }\n try { if (popup.closed) { clearInterval(it); setIsConnecting(false); setConnectingPlatform(null); } } catch {}\n }, 800);\n\n setTimeout(() => { try { if (!popup.closed && touched) popup.close(); } catch {} }, 10000);\n setTimeout(() => { if (!popup.closed) { popup.close(); clearInterval(it); setIsConnecting(false); setConnectingPlatform(null); } }, 300000);\n return true;\n } catch {\n // On failure, revert the optimistic toggle\n setConnectedAccounts((s) => ({ ...s, [name]: false }));\n setIsConnecting(false); setConnectingPlatform(null); return false;\n }\n }\n\n const handleSwitch = async (name) => {\n if (isConnecting && connectingPlatform !== name) return;\n const on = !!connectedAccounts[name];\n if (on) setConnectedAccounts((s) => ({ ...s, [name]: false }));\n else await connectToPlatform(name);\n };\n\n const connectedCount = Object.values(connectedAccounts).filter(Boolean).length;\n\n useEffect(() => {\n if (!lottieRef.current) return;\n const totalFrames = (personaAnim.op || 0) - (personaAnim.ip || 0);\n const TOTAL_PLATFORMS = 9; // Total number of platforms across all pages\n const progress = connectedCount / TOTAL_PLATFORMS;\n const target = Math.max(0, Math.floor(progress * totalFrames));\n const start = lastFrameRef.current || 0;\n const duration = 420; const startTs = performance.now();\n const step = (now) => {\n const t = Math.min(1, (now - startTs) / duration);\n const eased = t < 0.5 ? 2*t*t : -1 + (4 - 2*t)*t;\n const frame = Math.floor(start + (target - start) * eased);\n lottieRef.current.goToAndStop(frame, true);\n if (t < 1) rafRef.current = requestAnimationFrame(step); else lastFrameRef.current = target;\n };\n if (rafRef.current) cancelAnimationFrame(rafRef.current);\n rafRef.current = requestAnimationFrame(step);\n return () => { if (rafRef.current) cancelAnimationFrame(rafRef.current); };\n }, [connectedCount]);\n\n // swipe handlers for smooth paging\n const onTouchStart = (e) => { touchStartX.current = e.touches[0].clientX; touchDeltaX.current = 0; };\n const onTouchMove = (e) => { touchDeltaX.current = e.touches[0].clientX - touchStartX.current; };\n const onTouchEnd = () => {\n const dx = touchDeltaX.current; const THRESH = 40;\n if (dx < -THRESH && currentPage < 3) setCurrentPage(currentPage + 1);\n else if (dx > THRESH && currentPage > 1) setCurrentPage(currentPage - 1);\n };\n\n return (\n <div className=\"w-full h-full relative\" style={{ height: Math.min('90vh', Math.max(600, Math.min(720, vh * 0.9))), minHeight: 580, maxHeight: 720 }}>\n <style>{fadeSlideInKeyframes}</style>\n\n {/* persona as background (unchanged) */}\n <div aria-hidden style={{ position: 'absolute', left: '50%', top: PERSONA_TOP, transform: 'translateX(-50%)', width: personaSide, height: personaSide, zIndex: 0, pointerEvents: 'none', opacity: 0.95 }}>\n <div className=\"overflow-hidden rounded-[28px] w-full h-full\">\n <Lottie lottieRef={lottieRef} animationData={personaAnim} autoplay={false} loop={false} style={{ width: '100%', height: '100%' }} />\n </div>\n </div>\n\n {/* content above persona */}\n <div className=\"relative z-10 h-full flex flex-col\">\n {/* header (unchanged visuals) */}\n <div className=\"px-6 pt-16 pb-4 text-center flex-shrink-0\">\n <h1 className=\"text-2xl font-bold text-gray-900 mb-2 leading-tight\">Connect App Data</h1>\n <p className=\"text-gray-600 text-base\">More Connections, Better Personalization.</p>\n </div>\n\n {/* Spacer to push content down */}\n <div className=\"flex-1\" style={{ minHeight: 40 }} />\n\n {/* icons band */}\n <div className=\"px-6 flex-shrink-0\" style={{ height: ICONS_H }}>\n <div className=\"h-full flex items-center justify-center\">\n <div\n className=\"grid w-full box-border relative\"\n onTouchStart={onTouchStart}\n onTouchMove={onTouchMove}\n onTouchEnd={onTouchEnd}\n style={{\n gridAutoFlow: 'column',\n gridTemplateColumns: `repeat(${platforms.length}, minmax(0,1fr))`,\n columnGap: currentPage === 1 ? GAP_PAGE1 : GAP_PAGE2,\n alignItems: 'center',\n justifyItems: 'center',\n paddingInline: 8,\n overflow: 'hidden',\n }}\n >\n {platforms.map((p, idx) => {\n const on = !!connectedAccounts[p.name];\n const busy = false; // keep icon static visually per request\n const isSel = selected === p.name;\n const shift = (currentPage === 1 ? idx : idx - 2) * 14;\n return (\n <div key={p.name} className=\"transition-all duration-300\" style={{ opacity: 0, transform: `translateX(${shift}px)`, animation: 'fadeSlideIn 0.28s forwards', ['--slide-x']: `${shift}px` }}>\n <button\n type=\"button\"\n onClick={() => { \n setSelected(p.name);\n if (p.name === 'ChatGPT') {\n // Show ChatGPT connector modal\n setShowChatGPTModal(true);\n } else if (p.directLink) {\n // For direct link platforms (AI tools), connect immediately and open link\n if (!connectedAccounts[p.name]) {\n setConnectedAccounts((s) => ({ ...s, [p.name]: true }));\n }\n window.open(p.directLink, '_blank');\n } else {\n handleSwitch(p.name);\n }\n }}\n className=\"relative grid place-items-center outline-none\"\n style={{ width: SLOT, height: SLOT }}\n title={p.name}\n >\n <div className={`rounded-full border-3 transition-all duration-150 ease-out flex items-center justify-center shadow-lg ${on ? 'border-blue-600 bg-white text-black shadow-blue-500/70' : 'border-gray-300 hover:border-gray-400 bg-white text-black'}`}\n style={{ width: CIRCLE, height: CIRCLE, transform: `scale(${isSel ? ACTIVE_SCALE : 1})`, transformOrigin: 'center' }}>\n <div className=\"flex items-center justify-center\" style={{ width: 20, height: 20 }}>\n {p.icon}\n </div>\n </div>\n </button>\n </div>\n );\n })}\n </div>\n </div>\n </div>\n\n {/* dots navigation (no numbers) - directly under icons, above card */}\n <div className=\"relative flex items-center justify-center gap-4 select-none flex-shrink-0\" style={{ marginTop: 20, marginBottom: 16, zIndex: 25 }}>\n {[1,2,3].map(n => (\n <button key={n} onClick={() => setCurrentPage(n)} aria-label={`page ${n}`} className=\"relative\" style={{ width: 12, height: 12 }}>\n <span className={`block rounded-full ${currentPage === n ? 'bg-blue-600 scale-110' : 'bg-gray-300'} transition-transform`} style={{ width: 12, height: 12 }} />\n </button>\n ))}\n </div>\n\n {/* info sheet — positioned using flex */}\n <div className=\"px-6 flex-shrink-0\" style={{ marginBottom: 24, zIndex: 20 }}>\n <div className=\"mx-auto rounded-2xl bg-white shadow-sm border border-gray-200 px-4 py-2.5\" style={{ width: 'min(680px,92%)', maxHeight: vh * 0.2 }}>\n <div className=\"flex items-center justify-between\">\n <div className=\"text-gray-900 font-medium\">{selected}</div>\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={!!connectedAccounts[selected]}\n aria-label={`toggle ${selected}`}\n onClick={() => handleSwitch(selected)}\n disabled={isConnecting && connectingPlatform !== selected}\n className={`relative inline-flex items-center transition-colors disabled:opacity-50 ${connectedAccounts[selected] ? 'bg-black' : 'bg-gray-200'} rounded-full`}\n style={{ width: 56, height: 32 }}\n >\n <span className=\"absolute bg-white rounded-full shadow\" style={{ width: 24, height: 24, transform: connectedAccounts[selected] ? 'translateX(26px)' : 'translateX(6px)', transition: 'transform 160ms ease' }} />\n </button>\n </div>\n <div className=\"mt-3\">\n <div className=\"rounded-2xl bg-gray-50 text-gray-700 text-sm leading-6 px-4 py-3 shadow-[inset_0_0_0_1px_rgba(0,0,0,0.04)]\">\n {descriptions[selected] || null}\n </div>\n </div>\n </div>\n </div>\n\n {/* footer — anchored at bottom using flex */}\n <div className=\"px-6 flex-shrink-0\" style={{ paddingBottom: 16, background: 'linear-gradient(to top, white 60%, rgba(255,255,255,0.9) 85%, rgba(255,255,255,0))', zIndex: 30 }}>\n <div className=\"w-full bg-gray-900 hover:bg-gray-800 text-white rounded-full py-4 text-base font-medium flex items-center justify-center gap-2 cursor-pointer transition-colors\" onClick={() => {\n const connected = Object.entries(connectedAccounts).filter(([, v]) => v).map(([k]) => k);\n onComplete?.({ connectedAccounts: connected, totalConnections: connected.length });\n }}>\n Update\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M9 5l7 7-7 7\" /></svg>\n </div>\n <div onClick={() => onComplete?.({ connectedAccounts: [], totalConnections: 0 })} className=\"w-full text-gray-600 text-base font-medium py-2 text-center cursor-pointer hover:text-gray-800 transition-colors\">Skip</div>\n </div>\n </div>\n\n {/* ChatGPT Connector Modal */}\n <ChatGPTConnector\n open={showChatGPTModal}\n onClose={() => setShowChatGPTModal(false)}\n onConnectionChange={(platform, connected) => {\n if (connected) {\n setConnectedAccounts((s) => ({ ...s, [platform]: true }));\n }\n setShowChatGPTModal(false);\n }}\n />\n </div>\n );\n}","import React, { useState, useEffect } from 'react';\n\nexport default function PinSetup({ onComplete, onBack, userEmail }) {\n const [pin, setPin] = useState('');\n const [pinRequirements, setPinRequirements] = useState({\n length: false,\n uppercase: false,\n number: false,\n });\n\n // Check PIN requirements\n useEffect(() => {\n setPinRequirements({\n length: pin.length >= 6,\n uppercase: /[A-Z]/.test(pin),\n number: /\\d/.test(pin),\n });\n }, [pin]);\n\n const allRequirementsMet = pinRequirements.length && pinRequirements.uppercase && pinRequirements.number;\n\n const handleSubmit = () => {\n if (allRequirementsMet) {\n onComplete({\n pin: pin, // This should be hashed in production\n pinCreated: true,\n timestamp: new Date().toISOString()\n });\n }\n };\n\n return (\n <div className=\"w-full h-full flex flex-col\" style={{ height: '100%', minHeight: 0 }}>\n {/* Content - Flexible center area */}\n <div className=\"px-6 pt-16 flex-1 flex flex-col\" style={{ minHeight: 0, overflow: 'hidden' }}>\n <div className=\"mb-6 flex-shrink-0\">\n <h1 className=\"text-2xl font-bold text-gray-900 mb-2\">Create a PIN</h1>\n <p className=\"text-gray-600 text-base\">A PIN so only you have the access to your data</p>\n </div>\n\n <div className=\"mb-6 flex-shrink-0\">\n <input\n type=\"password\"\n value={pin}\n onChange={(e) => setPin(e.target.value)}\n className=\"w-full px-4 py-4 border-2 border-gray-300 rounded-xl text-center text-lg font-medium focus:border-gray-900 focus:outline-none bg-white\"\n placeholder=\"Enter your PIN\"\n maxLength={20}\n style={{\n color: '#000000',\n WebkitTextFillColor: '#000000',\n backgroundColor: '#FFFFFF'\n }}\n />\n </div>\n\n {/* Scrollable requirements list */}\n <div className=\"flex-1 overflow-y-auto\" style={{ minHeight: 0 }}>\n <div className=\"space-y-3 pb-4\">\n <p className=\"text-gray-900 font-medium mb-4\">Your PIN must:</p>\n <div className=\"space-y-3\">\n <div className=\"flex items-center gap-3\">\n <div\n className={`w-5 h-5 rounded-full border-2 ${pinRequirements.length ? \"border-green-500 bg-green-500\" : \"border-gray-300 bg-white\"}`}\n >\n {pinRequirements.length && (\n <svg className=\"w-3 h-3 text-white m-0.5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M5 13l4 4L19 7\" />\n </svg>\n )}\n </div>\n <span className=\"text-gray-700\">Be at least 6 characters in length.</span>\n </div>\n <div className=\"flex items-center gap-3\">\n <div\n className={`w-5 h-5 rounded-full border-2 ${pinRequirements.uppercase ? \"border-green-500 bg-green-500\" : \"border-gray-300 bg-white\"}`}\n >\n {pinRequirements.uppercase && (\n <svg className=\"w-3 h-3 text-white m-0.5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M5 13l4 4L19 7\" />\n </svg>\n )}\n </div>\n <span className=\"text-gray-700\">Contain an uppercase letter.</span>\n </div>\n <div className=\"flex items-center gap-3\">\n <div\n className={`w-5 h-5 rounded-full border-2 ${pinRequirements.number ? \"border-green-500 bg-green-500\" : \"border-gray-300 bg-white\"}`}\n >\n {pinRequirements.number && (\n <svg className=\"w-3 h-3 text-white m-0.5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M5 13l4 4L19 7\" />\n </svg>\n )}\n </div>\n <span className=\"text-gray-700\">Contain a number.</span>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n {/* Buttons - Fixed at bottom */}\n <div className=\"px-6 pb-6 pt-4 flex-shrink-0 space-y-3\" style={{ minHeight: 'auto' }}>\n <div\n className={`w-full rounded-full py-4 text-base font-medium flex items-center justify-center gap-2 transition-colors ${\n allRequirementsMet \n ? \"bg-gray-900 hover:bg-gray-800 text-white cursor-pointer\" \n : \"bg-gray-300 text-gray-500 cursor-not-allowed\"\n }`}\n onClick={allRequirementsMet ? handleSubmit : undefined}\n >\n Continue\n <svg className=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M9 5l7 7-7 7\" />\n </svg>\n </div>\n </div>\n </div>\n );\n} ","import React, { useState } from \"react\";\n\n/* -------------------------\n ICON COMPONENTS\n-------------------------- */\nconst Icon = ({ type }) => {\n const base = \"w-4 h-4 text-gray-700\";\n\n switch (type) {\n case \"User\":\n return (\n <svg className={base} viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4\n 1.79-4 4 1.79 4 4 4zm0 2c-2.67\n 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z\"/>\n </svg>\n );\n case \"Memory\":\n return (\n <svg className={base} viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M12 2C6.48 2 2 6.48 2\n 12s4.48 10 10 10 10-4.48 10-10S17.52\n 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z\"/>\n </svg>\n );\n case \"Grid3X3\":\n return (\n <svg className={base} viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M3 13h8V3H3v10zm0 8h8v-6H3v6zm10\n 0h8V11h-8v10zm0-18v6h8V3h-8z\"/>\n </svg>\n );\n case \"Brain\":\n return (\n <svg className={base} viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M11.99 2C6.47 2 2 6.48 2\n 12s4.47 10 9.99 10C17.52\n 22 22 17.52 22 12S17.52\n 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8\n 8-8 8 3.58 8 8-3.58 8-8\n 8zm3.5-9c.83 0 1.5-.67\n 1.5-1.5S16.33 8 15.5\n 8 14 8.67 14 9.5s.67 1.5\n 1.5 1.5zm-7 0c.83 0 1.5-.67\n 1.5-1.5S9.33 8 8.5\n 8 7 8.67 7 9.5s.67 1.5\n 1.5 1.5zm3.5 6.5c2.33\n 0 4.31-1.46 5.11-3.5H6.89c.8\n 2.04 2.78 3.5 5.11 3.5z\"/>\n </svg>\n );\n default:\n return null;\n }\n};\n\n/* -------------------------\n TOGGLE (soft apple style)\n-------------------------- */\nconst DataTypeToggle = ({ dataType, enabled, onToggle }) => {\n const handle = () => {\n if (dataType.required) return;\n onToggle(dataType.id, !enabled);\n };\n\n return (\n <button\n onClick={handle}\n className=\"\n w-full flex items-center justify-between\n py-2.5 px-2\n bg-white/40 backdrop-blur-sm\n hover:bg-white/70\n transition rounded-xl shadow-sm\n \"\n >\n <div className=\"flex items-center gap-3\">\n <div className=\"w-7 h-7 flex items-center justify-center rounded-full bg-gray-100\">\n <Icon type={dataType.icon} />\n </div>\n <span className=\"text-[14px] text-gray-900 font-medium\">\n {dataType.name}\n </span>\n </div>\n\n <div\n className={`w-5 h-5 rounded-md border flex items-center justify-center shadow-sm\n transition\n ${enabled\n ? \"bg-gray-900 border-gray-900\"\n : \"bg-white border-gray-300\"\n }`}\n >\n {enabled && (\n <svg className=\"w-3 h-3 text-white\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path d=\"M16.707 5.293a1 1 0 010\n 1.414l-8 8a1 1 0 01-1.414\n 0l-4-4a1 1 0 011.414-1.414L8\n 12.586l7.293-7.293a1 1 0\n 011.414 0z\"/>\n </svg>\n )}\n </div>\n </button>\n );\n};\n\n/* -------------------------\n MAIN COMPONENT\n-------------------------- */\n\nconst options = [\n { id: \"basic\", name: \"Basic Profile\", icon: \"User\", required: true },\n { id: \"rawMemories\", name: \"Raw Memory Data\", icon: \"Memory\" },\n { id: \"preferences\", name: \"User Preferences\", icon: \"Grid3X3\" },\n { id: \"personality\", name: \"Personality Traits\", icon: \"Brain\" },\n];\n\nconst DataRequest = ({ appName = \"My App\", onComplete, connectedPlatforms = [] }) => {\n const [selected, setSelected] = useState({\n basic: true,\n rawMemories: false,\n preferences: false,\n personality: false,\n });\n\n const [freq, setFreq] = useState(\"weekly\");\n\n const toggle = (id, val) =>\n setSelected((p) => ({ ...p, [id]: val }));\n\n const selectedCount = Object.values(selected).filter(Boolean).length;\n\n // Ensure we actually show connected platforms even if prop isn't passed\n const getConnected = () => {\n // If array provided, use it\n if (Array.isArray(connectedPlatforms) && connectedPlatforms.length > 0) return connectedPlatforms;\n // If object provided, map truthy keys\n if (connectedPlatforms && typeof connectedPlatforms === \"object\" && !Array.isArray(connectedPlatforms)) {\n return Object.entries(connectedPlatforms).filter(([_, v]) => Boolean(v)).map(([k]) => k);\n }\n // Fallback: try localStorage onairosUser\n try {\n const u = JSON.parse(localStorage.getItem(\"onairosUser\") || \"{}\");\n if (u && u.connectedAccounts && typeof u.connectedAccounts === \"object\") {\n return Object.entries(u.connectedAccounts).filter(([_, v]) => Boolean(v)).map(([k]) => k);\n }\n } catch {}\n return [];\n };\n const platforms = getConnected();\n\n const freqToPercent = (f) => (f === \"once\" ? 0 : f === \"weekly\" ? 50 : 100);\n const handleRailClick = (e) => {\n const rect = e.currentTarget.getBoundingClientRect();\n const x = Math.max(0, Math.min(rect.width, e.clientX - rect.left));\n const ratio = x / rect.width;\n if (ratio < 1 / 3) setFreq(\"once\");\n else if (ratio < 2 / 3) setFreq(\"weekly\");\n else setFreq(\"daily\");\n };\n\n return (\n <div className=\"flex flex-col h-full max-h-[90vh] bg-white/70 backdrop-blur-2xl rounded-3xl overflow-hidden\">\n\n {/* CONTENT */}\n <div className=\"flex-1 overflow-y-auto px-6 pt-10 pb-4\">\n\n {/* ICONS */}\n <div className=\"flex justify-center items-center gap-4 mb-6\">\n <div className=\"w-12 h-12 rounded-2xl bg-white shadow flex items-center justify-center\">\n <Icon type=\"User\" />\n </div>\n <svg className=\"w-4 h-4 text-gray-400\" fill=\"none\" stroke=\"currentColor\">\n <path strokeWidth={2} strokeLinecap=\"round\" d=\"M9 5l7 7-7 7\"/>\n </svg>\n <div className=\"w-12 h-12 rounded-2xl bg-white shadow flex items-center justify-center\">\n <span className=\"text-xl font-serif font-bold\">B</span>\n </div>\n </div>\n\n {/* TITLE */}\n <div className=\"text-center mb-8\">\n <h1 className=\"text-[24px] md:text-[26px] font-semibold text-gray-900 leading-tight tracking-tight\">\n {appName} wants to personalize your experience\n </h1>\n <p className=\"text-[13px] text-gray-500 mt-1\">choose what to share</p>\n </div>\n\n {/* TOGGLES */}\n <div className=\"grid grid-cols-2 gap-4 mb-10\">\n {options.map((opt) => (\n <DataTypeToggle\n key={opt.id}\n dataType={opt}\n enabled={selected[opt.id]}\n onToggle={toggle}\n />\n ))}\n </div>\n\n {/* FREQUENCY PANEL */}\n <div className=\"p-5 rounded-3xl bg-white/50 backdrop-blur-md border border-black/5 shadow-sm\">\n <div className=\"flex justify-between items-center mb-3\">\n <span className=\"text-sm font-medium text-gray-900\">\n How often can {appName} receive updates?\n </span>\n <span className=\"text-[11px] text-gray-500\">\n {freq === \"once\"\n ? \"one-time only\"\n : freq === \"weekly\"\n ? \"once per week\"\n : \"once per day\"}\n </span>\n </div>\n\n {/* SLIDER: subtle rail, monochrome progress, click-to-set */}\n <div\n className=\"relative h-2.5 rounded-full bg-gray-200/90 overflow-hidden mb-4 border border-black/5 shadow-inner cursor-pointer\"\n onClick={handleRailClick}\n >\n <div\n className=\"absolute h-full transition-all rounded-full\"\n style={{\n width: `${freqToPercent(freq)}%`,\n background: \"linear-gradient(90deg, rgba(31,41,55,0.95) 0%, rgba(107,114,128,0.9) 60%, rgba(209,213,219,0.85) 100%)\",\n }}\n />\n {/* Tick marks for 3 stops */}\n <span className=\"absolute left-0 top-1/2 -translate-y-1/2 w-[2px] h-3 bg-black/10\" />\n <span className=\"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[2px] h-3 bg-black/10\" />\n <span className=\"absolute right-0 top-1/2 -translate-y-1/2 w-[2px] h-3 bg-black/10\" />\n {/* Thumb indicator (sleek) */}\n <span\n className=\"absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-4.5 h-4.5 rounded-full bg-white border border-black/20 shadow-md\"\n style={{\n left: `${freqToPercent(freq)}%`,\n }}\n />\n </div>\n\n <div className=\"grid grid-cols-3 text-center text-[12px] font-medium\">\n <button onClick={() => setFreq(\"once\")} className=\"text-gray-700\">1× only</button>\n <button onClick={() => setFreq(\"weekly\")} className=\"text-gray-900 font-semibold\">1× weekly</button>\n <button onClick={() => setFreq(\"daily\")} className=\"text-gray-700\">1× daily</button>\n </div>\n\n <p className=\"text-[11px] text-gray-500 mt-3 leading-snug\">\n This only controls update frequency; It does not grant more access.\n </p>\n </div>\n\n {/* CONNECTED PLATFORMS (appears at the bottom of content; no overlap with footer) */}\n {platforms && platforms.length > 0 ? (\n <div className=\"mt-6 mb-2 rounded-2xl bg-white/60 backdrop-blur border border-black/5 p-3\">\n <div className=\"text-center text-xs text-gray-500 mb-2\">Connected Platforms</div>\n <div className=\"flex justify-center items-center gap-2 flex-wrap\">\n {platforms.map((platform, index) => {\n const logoMap = {\n Instagram: 'https://upload.wikimedia.org/wikipedia/commons/a/a5/Instagram_icon.png',\n YouTube: 'https://upload.wikimedia.org/wikipedia/commons/0/09/YouTube_full-color_icon_%282017%29.svg',\n LinkedIn: 'https://upload.wikimedia.org/wikipedia/commons/c/ca/LinkedIn_logo_initials.png',\n Reddit: 'https://www.redditinc.com/assets/images/site/reddit-logo.png',\n Pinterest: 'https://upload.wikimedia.org/wikipedia/commons/0/08/Pinterest-logo.png',\n GitHub: 'https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png',\n Facebook: 'https://upload.wikimedia.org/wikipedia/commons/5/51/Facebook_f_logo_%282019%29.svg',\n Gmail: 'https://upload.wikimedia.org/wikipedia/commons/7/7e/Gmail_icon_%282020%29.svg',\n Twitter: 'https://upload.wikimedia.org/wikipedia/commons/6/6f/Logo_of_Twitter.svg',\n ChatGPT: 'https://anushkasirv.sirv.com/openai.png',\n Claude: 'https://anushkasirv.sirv.com/claude-color.png',\n Gemini: 'https://anushkasirv.sirv.com/gemini-color.png',\n Grok: 'https://anushkasirv.sirv.com/grok.png'\n };\n const src = logoMap[platform] || '';\n return (\n <img\n key={`${platform}-${index}`}\n src={src}\n alt={platform}\n title={platform}\n className=\"w-6 h-6 rounded-md shadow-sm hover:scale-110 transition\"\n onError={(e) => { e.currentTarget.style.display = 'none'; }}\n />\n );\n })}\n </div>\n </div>\n ) : null}\n </div>\n\n {/* FOOTER */}\n <div className=\"px-6 py-5 bg-white/80 backdrop-blur border-t border-black/5\">\n <button\n className=\"w-full rounded-full py-3 bg-gray-900 text-white text-sm font-medium shadow-sm flex items-center justify-center gap-2 mb-3\"\n disabled={selectedCount === 0}\n onClick={() => {\n if (selectedCount === 0) return;\n onComplete?.({\n approved: Array.from(selected).filter(id => selected[id]),\n freq,\n });\n }}\n >\n Accept & Continue\n <svg className=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\">\n <path strokeWidth={2} strokeLinecap=\"round\" d=\"M9 5l7 7-7 7\"/>\n </svg>\n </button>\n\n <button\n className=\"w-full rounded-full py-3 bg-gray-100 text-gray-700 text-sm font-medium shadow-sm\"\n onClick={() => {\n onComplete?.({\n approved: [],\n freq,\n declined: true,\n });\n }}\n >\n Decline\n </button>\n </div>\n </div>\n );\n};\n\nexport default DataRequest;\n","import React, { useState, useEffect } from 'react';\nimport { COLORS } from '../theme/colors.js';\n\nexport default function TrainingComponent({ onComplete, userEmail, appName = 'App', testMode = false }) {\n const [currentStep, setCurrentStep] = useState(0);\n const [progress, setProgress] = useState(0);\n const [isComplete, setIsComplete] = useState(false);\n\n const steps = [\n {\n title: 'Setting up your personal AI',\n description: 'Initializing your secure data model',\n icon: '🤖',\n duration: testMode ? 800 : 2000 // Much faster in test mode\n },\n {\n title: 'Processing your connections',\n description: 'Analyzing your social media patterns',\n icon: '🔗',\n duration: testMode ? 600 : 2500\n },\n {\n title: 'Training your model',\n description: 'Building your personalized insights',\n icon: '🧠',\n duration: testMode ? 700 : 3000\n },\n {\n title: 'Finalizing setup',\n description: 'Preparing your Onairos experience',\n icon: '✨',\n duration: testMode ? 500 : 2000\n }\n ];\n\n useEffect(() => {\n let interval;\n let stepTimeout;\n\n if (currentStep < steps.length) {\n const stepDuration = steps[currentStep].duration;\n const stepProgress = 100 / steps.length;\n\n // Update progress gradually\n interval = setInterval(() => {\n setProgress(prev => {\n const newProgress = prev + (stepProgress / (stepDuration / 100));\n return Math.min(newProgress, (currentStep + 1) * stepProgress);\n });\n }, 100);\n\n // Move to next step after duration\n stepTimeout = setTimeout(() => {\n if (currentStep < steps.length - 1) {\n setCurrentStep(prev => prev + 1);\n } else {\n setIsComplete(true);\n const completionDelay = testMode ? 400 : 1000; // Faster completion in test mode\n \n if (testMode) {\n console.log('🧪 Test mode: Training simulation completed');\n }\n \n setTimeout(() => {\n onComplete({\n trainingComplete: true,\n timestamp: new Date().toISOString(),\n userEmail: userEmail,\n appName: appName,\n testMode: testMode,\n simulatedTraining: testMode\n });\n }, completionDelay);\n }\n }, stepDuration);\n }\n\n return () => {\n if (interval) clearInterval(interval);\n if (stepTimeout) clearTimeout(stepTimeout);\n };\n }, [currentStep, onComplete, userEmail, appName]);\n\n return (\n <div className=\"w-full flex flex-col items-center space-y-8\">\n <div className=\"text-center\">\n <div \n className=\"w-20 h-20 rounded-full flex items-center justify-center mx-auto mb-4\"\n style={{\n background: `linear-gradient(135deg, ${COLORS.info}, #8B5CF6)`\n }}\n >\n <div className=\"text-3xl\">\n {isComplete ? '🎉' : steps[currentStep]?.icon}\n </div>\n </div>\n <h2 \n className=\"text-2xl font-bold mb-2\"\n style={{ color: COLORS.textPrimary }}\n >\n {isComplete ? 'All set!' : steps[currentStep]?.title}\n </h2>\n <p style={{ color: COLORS.textSecondary }}>\n {isComplete \n ? 'Your personal AI is ready to use' \n : steps[currentStep]?.description\n }\n </p>\n </div>\n\n {/* Progress Bar */}\n <div className=\"w-full\">\n <div \n className=\"flex justify-between text-sm mb-2\"\n style={{ color: COLORS.textSecondary }}\n >\n <span>Progress</span>\n <span>{Math.round(progress)}%</span>\n </div>\n <div \n className=\"w-full rounded-full h-2\"\n style={{ backgroundColor: COLORS.borderLight }}\n >\n <div \n className=\"h-2 rounded-full transition-all duration-300 ease-out\"\n style={{ \n width: `${progress}%`,\n background: `linear-gradient(90deg, ${COLORS.info}, #8B5CF6)`\n }}\n />\n </div>\n </div>\n\n {/* Steps Indicator */}\n <div className=\"flex justify-center space-x-2\">\n {steps.map((_, index) => (\n <div\n key={index}\n className=\"w-3 h-3 rounded-full transition-all duration-300\"\n style={{\n backgroundColor: index <= currentStep ? COLORS.info : COLORS.border\n }}\n />\n ))}\n </div>\n\n {/* Current Step Details */}\n <div \n className=\"p-4 rounded-lg w-full\"\n style={{ backgroundColor: COLORS.backgroundSecondary }}\n >\n <div className=\"flex items-center space-x-3\">\n <div \n className=\"w-8 h-8 rounded-full flex items-center justify-center\"\n style={{ backgroundColor: '#DBEAFE' }}\n >\n <div className=\"text-sm\">\n {isComplete ? '✅' : steps[currentStep]?.icon}\n </div>\n </div>\n <div>\n <h3 \n className=\"font-medium\"\n style={{ color: COLORS.textPrimary }}\n >\n {isComplete ? 'Training Complete' : `Step ${currentStep + 1} of ${steps.length}`}\n </h3>\n <p \n className=\"text-sm\"\n style={{ color: COLORS.textSecondary }}\n >\n {isComplete \n ? 'Your Onairos experience is ready' \n : steps[currentStep]?.description\n }\n </p>\n </div>\n </div>\n </div>\n\n {/* App Info */}\n <div className=\"text-center\">\n <p \n className=\"text-sm\"\n style={{ color: COLORS.textSecondary }}\n >\n Setting up for <span className=\"font-medium\">{appName}</span>\n </p>\n {userEmail && (\n <p \n className=\"text-xs mt-1\"\n style={{ color: COLORS.textMuted }}\n >\n {userEmail}\n </p>\n )}\n </div>\n </div>\n );\n} ","import React, { useState, useEffect } from \"react\";\nimport Lottie from 'lottie-react';\nimport rainAnim from '../../public/rain-anim.json';\n\nexport default function LoadingScreen({ onComplete }) {\n const [currentStep, setCurrentStep] = useState(0);\n const [dotCount, setDotCount] = useState(0);\n\n const loadingStates = [\n { message: \"Validating PIN and continuing training\", progress: 20 },\n { message: \"Uploading model to secure storage\", progress: 40 },\n { message: \"Running test inference\", progress: 60 },\n { message: \"Storing results in databases\", progress: 80 },\n { message: \"Complete!\", progress: 100 },\n ];\n\n useEffect(() => {\n const stateInterval = setInterval(() => {\n setCurrentStep((prev) => {\n const nextStep = prev + 1;\n if (nextStep >= loadingStates.length) {\n // Loading complete, call onComplete after a short delay\n setTimeout(() => {\n onComplete();\n }, 1000);\n return prev; // Keep at last step\n }\n return nextStep;\n });\n }, 3000); // Change state every 3 seconds\n\n return () => clearInterval(stateInterval);\n }, [loadingStates.length, onComplete]);\n\n useEffect(() => {\n const dotInterval = setInterval(() => {\n setDotCount((prev) => (prev + 1) % 4); // 0, 1, 2, 3 dots\n }, 500); // Change dots every 500ms\n\n return () => clearInterval(dotInterval);\n }, []);\n\n const currentState = loadingStates[currentStep];\n\n return (\n <div className=\"fixed inset-0 bg-gray-500 bg-opacity-50 flex items-center justify-center p-6\" style={{ zIndex: 2147483647, pointerEvents: 'auto' }}>\n {/* Modal - Full height from bottom */}\n <div className=\"bg-white rounded-3xl w-full max-w-lg mx-auto shadow-2xl overflow-hidden flex flex-col\" style={{ maxWidth: '500px', height: '90vh' }}>\n {/* Header */}\n <div className=\"px-6 pt-6 pb-4 flex-shrink-0\">\n </div>\n\n {/* Content - Rain animation and loading state */}\n <div className=\"flex-1 flex flex-col px-6\">\n {/* Rain Animation */}\n <div className=\"flex-1 flex items-center justify-center\">\n <div style={{ width: '100%', maxWidth: '400px', aspectRatio: '1' }}>\n <Lottie\n animationData={rainAnim}\n loop={true}\n autoplay={true}\n style={{ width: '100%', height: '100%' }}\n />\n </div>\n </div>\n\n {/* Loading State - Positioned at bottom */}\n <div className=\"flex-shrink-0 pb-12\">\n <div className=\"text-center\">\n <h1 className=\"font-bold text-gray-900 leading-tight mb-6\" style={{ fontSize: 'clamp(16px, 4vw, 20px)' }}>\n {currentState.message}\n {currentState.message !== \"Complete!\" && (\n <span className=\"inline-block w-8 text-left\">{\".\".repeat(dotCount)}</span>\n )}\n </h1>\n\n <div className=\"mx-auto\" style={{ width: 'clamp(200px, 50vw, 300px)' }}>\n <div className=\"w-full h-2 bg-gray-200 rounded-full\">\n <div\n className=\"h-2 bg-gray-900 rounded-full transition-all duration-1000 ease-out\"\n style={{ width: `${currentState.progress}%` }}\n ></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n {/* Bottom spacing */}\n <div className=\"h-20 flex-shrink-0\"></div>\n </div>\n </div>\n );\n}\n","/**\n * Response formatter utility for Onairos SDK\n * Converts array-based responses to dictionary format for better developer experience\n */\n\n// Standard 16 personality types in order that the API returns them\nexport const PERSONALITY_TYPES = [\n 'Analyst',\n 'Diplomat', \n 'Sentinel',\n 'Explorer',\n 'Architect',\n 'Logician',\n 'Commander',\n 'Debater',\n 'Advocate',\n 'Mediator',\n 'Protagonist',\n 'Campaigner',\n 'Logistician',\n 'Defender',\n 'Executive',\n 'Consul'\n];\n\n// Standard trait categories that might be returned\nexport const TRAIT_CATEGORIES = [\n 'Openness',\n 'Conscientiousness',\n 'Extraversion',\n 'Agreeableness',\n 'Neuroticism'\n];\n\n/**\n * Formats API response to include both array and dictionary formats\n * @param {Object} apiResponse - Raw API response from Onairos\n * @param {Object} options - Formatting options\n * @param {boolean} options.includeDictionary - Whether to include dictionary format (default: true)\n * @param {boolean} options.includeArray - Whether to include original array format (default: true)\n * @returns {Object} Formatted response with both formats\n */\nexport function formatOnairosResponse(apiResponse, options = {}) {\n const { includeDictionary = true, includeArray = true } = options;\n \n if (!apiResponse) {\n return apiResponse;\n }\n\n const formatted = { ...apiResponse };\n\n // Handle personality scores if present\n if (apiResponse.InferenceResult?.traits || apiResponse.traits || apiResponse.scores) {\n const scores = apiResponse.InferenceResult?.traits || apiResponse.traits || apiResponse.scores;\n \n if (Array.isArray(scores) && scores.length >= 16) {\n if (includeDictionary) {\n // Create personality dictionary\n const personalityDict = {};\n PERSONALITY_TYPES.forEach((type, index) => {\n personalityDict[type] = scores[index];\n });\n \n // Add to formatted response\n if (formatted.InferenceResult) {\n formatted.InferenceResult.personalityDict = personalityDict;\n } else {\n formatted.personalityDict = personalityDict;\n }\n }\n \n if (!includeArray) {\n // Remove array format if not requested\n if (formatted.InferenceResult?.traits) {\n delete formatted.InferenceResult.traits;\n }\n if (formatted.traits) {\n delete formatted.traits;\n }\n if (formatted.scores) {\n delete formatted.scores;\n }\n }\n }\n }\n\n // Handle trait data if present (for preferences/traits)\n if (apiResponse.traitResult || apiResponse.traits) {\n const traits = apiResponse.traitResult || apiResponse.traits;\n \n if (Array.isArray(traits) && includeDictionary) {\n const traitDict = {};\n TRAIT_CATEGORIES.forEach((category, index) => {\n if (traits[index] !== undefined) {\n traitDict[category] = traits[index];\n }\n });\n \n formatted.traitDict = traitDict;\n }\n }\n\n return formatted;\n}\n\n/**\n * Legacy formatter for backward compatibility\n * Converts scores array to personality dictionary only\n * @param {Array} scores - Array of personality scores\n * @returns {Object} Dictionary with personality type names as keys\n */\nexport function formatPersonalityScores(scores) {\n if (!Array.isArray(scores) || scores.length < 16) {\n console.warn('Invalid scores array provided to formatPersonalityScores');\n return {};\n }\n\n const personalityDict = {};\n PERSONALITY_TYPES.forEach((type, index) => {\n personalityDict[type] = scores[index];\n });\n \n return personalityDict;\n}\n\n/**\n * Get personality type names in order\n * @returns {Array} Array of personality type names\n */\nexport function getPersonalityTypes() {\n return [...PERSONALITY_TYPES];\n}\n\n/**\n * Get trait category names in order \n * @returns {Array} Array of trait category names\n */\nexport function getTraitCategories() {\n return [...TRAIT_CATEGORIES];\n} ","import React from 'react';\nimport { COLORS } from '../../theme/colors.js';\n\n// Standardized page layout component with white background\nconst PageLayout = ({\n children,\n title,\n subtitle,\n icon,\n showHeader = true,\n showCloseButton = false,\n onClose,\n onBack,\n showBackButton = false,\n className = '',\n contentClassName = '',\n centerContent = true,\n style = {},\n ...props\n}) => {\n const layoutStyle = {\n backgroundColor: COLORS.background,\n minHeight: '100%',\n width: '100%',\n display: 'flex',\n flexDirection: 'column',\n ...style\n };\n\n const headerStyle = {\n position: 'sticky',\n top: 0,\n backgroundColor: COLORS.background,\n zIndex: 10,\n padding: 'clamp(8px, 2vw, 16px) clamp(16px, 4vw, 32px) clamp(6px, 1.5vw, 12px)'\n };\n\n const contentStyle = {\n flex: 1,\n padding: 'clamp(16px, 4vw, 32px)',\n display: 'flex',\n flexDirection: 'column',\n overflow: 'auto',\n minHeight: 0, // Allow flex item to shrink below content size\n ...(centerContent && {\n alignItems: 'center',\n justifyContent: 'flex-start'\n })\n };\n\n const titleStyle = {\n fontFamily: 'Inter, system-ui, sans-serif',\n fontSize: 'clamp(20px, 5vw, 28px)',\n fontWeight: '700',\n color: COLORS.textPrimary,\n margin: '0 0 clamp(6px, 1.5vw, 12px) 0',\n textAlign: centerContent ? 'center' : 'left',\n lineHeight: '1.2'\n };\n\n const subtitleStyle = {\n fontFamily: 'Inter, system-ui, sans-serif',\n fontSize: 'clamp(14px, 3.5vw, 18px)',\n fontWeight: '400',\n color: COLORS.textSecondary,\n margin: '0 0 clamp(20px, 5vw, 40px) 0',\n textAlign: centerContent ? 'center' : 'left',\n lineHeight: '1.5'\n };\n\n const iconStyle = {\n width: 'clamp(40px, 8vw, 56px)',\n height: 'clamp(40px, 8vw, 56px)',\n margin: '0 auto clamp(16px, 4vw, 32px)',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n fontSize: 'clamp(20px, 5vw, 28px)'\n };\n\n return (\n <div \n className={`onairos-page-layout ${className}`}\n style={layoutStyle}\n {...props}\n >\n {/* Header with navigation */}\n {showHeader && (\n <div style={headerStyle}>\n <div className=\"flex items-center justify-between\">\n {/* Back button */}\n {showBackButton && onBack && (\n <button\n onClick={onBack}\n className=\"flex items-center justify-center w-8 h-8 rounded-full hover:bg-gray-100 transition-colors\"\n aria-label=\"Go back\"\n >\n <span style={{ fontSize: '16px', color: COLORS.textPrimary }}>←</span>\n </button>\n )}\n\n\n {/* Close button */}\n {showCloseButton && onClose && (\n <button\n onClick={onClose}\n className=\"flex items-center justify-center w-8 h-8 rounded-full hover:bg-gray-100 transition-colors\"\n aria-label=\"Close\"\n >\n <span style={{ fontSize: '16px', color: COLORS.textPrimary }}>×</span>\n </button>\n )}\n </div>\n </div>\n )}\n\n {/* Main content area */}\n <div \n className={`onairos-page-content ${contentClassName}`}\n style={contentStyle}\n >\n {/* Icon */}\n {icon && (\n <div style={iconStyle}>\n {typeof icon === 'string' ? <span>{icon}</span> : icon}\n </div>\n )}\n\n {/* Title */}\n {title && (\n <h1 style={titleStyle}>\n {title}\n </h1>\n )}\n\n {/* Subtitle */}\n {subtitle && (\n <p style={subtitleStyle}>\n {subtitle}\n </p>\n )}\n\n {/* Page content */}\n {children}\n </div>\n </div>\n );\n};\n\n// Modal wrapper component for overlay-style pages\nconst ModalPageLayout = ({\n children,\n visible = true,\n onClose,\n onBackdropClick,\n backdropStyle = {},\n modalStyle = {},\n ...pageLayoutProps\n}) => {\n if (!visible) return null;\n\n const backdropStyles = {\n position: 'fixed',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: 'rgba(0, 0, 0, 0.5)',\n zIndex: 2147483647,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n transition: 'opacity 200ms ease',\n willChange: 'opacity',\n ...backdropStyle\n };\n\n const modalStyles = {\n backgroundColor: COLORS.background,\n borderTopLeftRadius: '24px',\n borderTopRightRadius: '24px',\n borderBottomLeftRadius: '24px',\n borderBottomRightRadius: '24px',\n height: '90vh',\n width: '100%',\n maxWidth: '500px',\n boxShadow: '0 -10px 40px rgba(0, 0, 0, 0.3)',\n overflow: 'hidden',\n display: 'flex',\n flexDirection: 'column',\n transform: 'translateY(0)',\n transition: 'transform 220ms ease, opacity 220ms ease',\n willChange: 'transform, opacity',\n ...modalStyle\n };\n\n const handleBackdropClick = (e) => {\n if (e.target === e.currentTarget) {\n if (onBackdropClick) {\n onBackdropClick();\n } else if (onClose) {\n onClose();\n }\n }\n };\n\n return (\n <div style={backdropStyles} onClick={handleBackdropClick}>\n <div style={modalStyles}>\n <PageLayout\n showHeader={true}\n showCloseButton={true}\n onClose={onClose}\n {...pageLayoutProps}\n >\n {children}\n </PageLayout>\n </div>\n </div>\n );\n};\n\nexport { ModalPageLayout };\nexport default PageLayout; ","import React, { useEffect, useState } from 'react';\nimport WelcomeScreen from './components/WelcomeScreen.jsx';\nimport EmailAuth from './components/EmailAuth.js';\nimport UniversalOnboarding from './components/UniversalOnboarding.jsx';\nimport PinSetup from './components/PinSetup.js';\nimport DataRequest from './components/DataRequest.js';\nimport TrainingComponent from './components/TrainingComponent.jsx';\nimport LoadingScreen from './components/LoadingScreen.jsx';\nimport { formatOnairosResponse } from './utils/responseFormatter.js';\nimport { ModalPageLayout } from './components/ui/PageLayout.jsx';\n\nexport function OnairosButton({\n requestData, \n webpageName, \n inferenceData = null, \n onComplete = null, \n autoFetch = true, // Auto-enabled for seamless testing experience\n testMode = false, // Production mode by default - set to true for testing\n proofMode = false, \n textLayout = 'below', \n textColor = 'white',\n login = false,\n buttonType = 'pill',\n loginReturn = null,\n loginType = 'signIn',\n visualType = 'full',\n appIcon = null,\n enableTraining = true,\n formatResponse = true,\n responseFormat = { includeDictionary: true, includeArray: true },\n priorityPlatform = null, // Platform to prioritize (e.g., 'gmail', 'pinterest', 'linkedin')\n rawMemoriesOnly = false, // Show only LLM connections when true\n rawMemoriesConfig = null // Configuration for RAW memories collection\n}) {\n\n const [showOverlay, setShowOverlay] = useState(false);\n const [currentFlow, setCurrentFlow] = useState('welcome'); // 'welcome' | 'email' | 'onboarding' | 'pin' | 'dataRequest' (training is within onboarding)\n const [userData, setUserData] = useState(null);\n const [error, setError] = useState(null);\n\n // Check for existing user session\n useEffect(() => {\n const checkExistingSession = () => {\n // In test mode, always start fresh to see the full flow\n if (testMode) {\n console.log('🧪 Test mode: Starting fresh flow, clearing any cached user data');\n localStorage.removeItem('onairosUser');\n setCurrentFlow('welcome');\n return;\n }\n \n const savedUser = localStorage.getItem('onairosUser');\n if (savedUser) {\n try {\n const user = JSON.parse(savedUser);\n setUserData(user);\n // If user has completed onboarding and PIN setup, go directly to data request\n if (user.onboardingComplete && user.pinCreated) {\n setCurrentFlow('dataRequest');\n } else if (user.verified && !user.onboardingComplete) {\n setCurrentFlow('onboarding');\n } else if (user.onboardingComplete && !user.pinCreated) {\n setCurrentFlow('pin');\n }\n } catch (error) {\n console.error('Error parsing saved user data:', error);\n localStorage.removeItem('onairosUser');\n }\n }\n };\n\n checkExistingSession();\n }, [testMode]);\n\n const openTerminal = async () => {\n try {\n console.log('🔥 openTerminal called - resetting flow');\n console.log('🔥 testMode prop:', testMode);\n console.log('🔥 window.onairosApiKey:', window.onairosApiKey);\n // ALWAYS reset flow on open to start fresh every time\n setCurrentFlow('welcome');\n setUserData(null);\n try { localStorage.removeItem('onairosUser'); } catch {}\n setShowOverlay(true);\n } catch (error) {\n console.error('Error in openTerminal:', error);\n }\n };\n\n const handleCloseOverlay = () => {\n setShowOverlay(false);\n setError(null);\n // Reset flow and session so next open starts fresh\n setCurrentFlow('welcome');\n try { localStorage.removeItem('onairosUser'); } catch {}\n setUserData(null);\n };\n\n // Handle clicks on the backdrop to close modal\n const handleBackdropClick = (e) => {\n if (e.target === e.currentTarget) {\n handleCloseOverlay();\n }\n };\n\n const handleWelcomeContinue = () => {\n console.log('🔥 Welcome screen continue clicked');\n setCurrentFlow('email');\n };\n\n const handleEmailAuthSuccess = (authData) => {\n console.log('🔥 Email auth successful:', authData);\n console.log('🔧 User State:', {\n isNewUser: authData.isNewUser,\n userState: authData.userState,\n flowType: authData.flowType,\n existingUser: authData.existingUser,\n hasAccountInfo: !!authData.accountInfo\n });\n\n // Save identity-bearing JWT immediately (email/id/userId/sub)\n try {\n const candidate = authData.jwtToken || authData.token || authData.accessToken;\n if (candidate) {\n const base64 = candidate.split('.')[1];\n if (base64) {\n const payload = JSON.parse(decodeURIComponent(atob(base64).split('').map(c => '%'+('00'+c.charCodeAt(0).toString(16)).slice(-2)).join('')));\n if (payload && (payload.email || payload.id || payload.userId || payload.sub)) {\n try { localStorage.setItem('onairos_user_token', candidate); } catch {}\n console.log('✅ [OnairosButton] Identity JWT saved from email auth');\n } else {\n console.warn('⚠️ [OnairosButton] Email auth returned minimal token (no id/email)');\n }\n }\n }\n } catch (e) {\n console.warn('⚠️ [OnairosButton] Failed to parse/save email auth token');\n }\n \n // Determine flow based on API response - more explicit checking\n const isNewUser = authData.isNewUser === true || \n authData.existingUser === false || \n authData.flowType === 'onboarding' || \n authData.userState === 'new' ||\n !authData.accountInfo; // No account info means new user\n \n console.log('🔍 Flow determination:', {\n finalDecision: isNewUser ? 'NEW USER → onboarding (data connectors)' : 'EXISTING USER → dataRequest (data permissions)',\n reasoning: {\n isNewUser: authData.isNewUser,\n existingUserFalse: authData.existingUser === false,\n flowTypeOnboarding: authData.flowType === 'onboarding',\n noAccountInfo: !authData.accountInfo\n }\n });\n \n const newUserData = {\n ...authData,\n verified: true,\n onboardingComplete: !isNewUser, // New users need onboarding, returning users have completed it\n pinCreated: !isNewUser // Assume returning users have PIN, new users need to create it\n };\n \n setUserData(newUserData);\n localStorage.setItem('onairosUser', JSON.stringify(newUserData));\n \n // Flow decision logic - prioritize new user detection\n if (isNewUser) {\n console.log('🚀 NEW USER detected → Starting onboarding flow (data connectors page)');\n setCurrentFlow('onboarding');\n } else {\n console.log('👋 EXISTING USER detected → Going directly to data request (data permissions page)');\n setCurrentFlow('dataRequest');\n }\n };\n\n const handleOnboardingComplete = (onboardingData) => {\n console.log('Onboarding completed:', onboardingData);\n const updatedUserData = {\n ...userData,\n onboardingComplete: true,\n connectedAccounts: onboardingData.connectedAccounts || []\n };\n setUserData(updatedUserData);\n localStorage.setItem('onairosUser', JSON.stringify(updatedUserData));\n setCurrentFlow('pin');\n };\n\n const handlePinSetupComplete = async (pinData) => {\n console.log('PIN setup completed:', pinData);\n const updatedUserData = {\n ...userData,\n ...pinData,\n pinCreated: true\n };\n setUserData(updatedUserData);\n localStorage.setItem('onairosUser', JSON.stringify(updatedUserData));\n \n // 🔥 FIX: Don't trigger training here - wait for user to approve data request\n console.log('✅ PIN created - moving to data request (training will start after approval)');\n \n // Go directly to data request - user must approve before training starts\n setCurrentFlow('dataRequest');\n };\n\n const handleLoadingComplete = () => {\n setCurrentFlow('dataRequest');\n };\n\n const handleTrainingComplete = (trainingResult) => {\n console.log('🎓 Training completed:', trainingResult);\n const updatedUserData = {\n ...userData,\n trainingCompleted: true,\n ...trainingResult\n };\n setUserData(updatedUserData);\n localStorage.setItem('onairosUser', JSON.stringify(updatedUserData));\n \n // Move to data request after training\n setCurrentFlow('dataRequest');\n };\n\n const handleDataRequestComplete = async (requestResult) => {\n console.log('🔥 OnairosButton: Data request completed:', requestResult);\n \n // Update user data with request result\n const updatedUserData = {\n ...userData,\n lastDataRequest: requestResult\n };\n setUserData(updatedUserData);\n localStorage.setItem('onairosUser', JSON.stringify(updatedUserData));\n // Do NOT auto-trigger training here. The host app (e.g., DelphiDemo)\n // will call the backend-chosen apiUrl for combined training/inference.\n\n // Close overlay immediately\n console.log('🔥 Closing overlay after data request completion');\n // Use centralized close to also reset flow and session\n handleCloseOverlay();\n\n // Format response if requested and API response is present\n let formattedResult = requestResult;\n if (formatResponse && requestResult?.apiResponse) {\n try {\n formattedResult = {\n ...requestResult,\n apiResponse: formatOnairosResponse(requestResult.apiResponse, responseFormat)\n };\n console.log('🔥 Response formatted with dictionary:', formattedResult.apiResponse?.personalityDict || 'No personality data');\n } catch (error) {\n console.warn('🔥 Error formatting response:', error);\n // Continue with original result if formatting fails\n }\n }\n\n // Enhanced user data formatting for better display\n const { logFormattedUserData } = require('./utils/userDataFormatter');\n \n // Add user data to the result for comprehensive formatting\n const completeResult = {\n ...formattedResult,\n userData: updatedUserData\n };\n\n // Log formatted user data for better readability\n const enhancedResult = logFormattedUserData(completeResult);\n\n // Call onComplete callback if provided\n console.log('🔥 Calling onComplete callback with enhanced result');\n console.log('🔥 onComplete data structure:', {\n token: enhancedResult.token ? '✅ Present (JWT string)' : '❌ Missing',\n apiUrl: enhancedResult.apiUrl ? '✅ Present (URL string)' : '❌ Missing',\n apiResponse: enhancedResult.apiResponse ? '✅ Present (object)' : '❌ Missing',\n userData: enhancedResult.userData ? '✅ Present (object)' : '❌ Missing',\n success: enhancedResult.success,\n testMode: enhancedResult.testMode,\n allKeys: Object.keys(enhancedResult)\n });\n \n if (onComplete) {\n try {\n onComplete(enhancedResult);\n console.log('🔥 onComplete callback executed successfully with enhanced formatting');\n } catch (error) {\n console.error('🔥 Error in onComplete callback:', error);\n }\n } else {\n console.log('🔥 No onComplete callback provided');\n }\n };\n\n const getFlowTitle = () => {\n switch (currentFlow) {\n case 'welcome':\n return ''; // WelcomeScreen handles its own titles\n case 'email':\n return ''; // EmailAuth handles its own titles\n case 'onboarding':\n return 'Connect Your Data';\n case 'pin':\n return 'Secure Your Account';\n case 'training':\n return 'Training Your Model';\n case 'dataRequest':\n return 'Data Request';\n default:\n return '';\n }\n };\n\n const getFlowSubtitle = () => {\n switch (currentFlow) {\n case 'welcome':\n return ''; // WelcomeScreen handles its own subtitles\n case 'email':\n return ''; // EmailAuth handles its own subtitles\n case 'onboarding':\n return 'Choose which accounts to connect for a personalized experience';\n case 'pin':\n return 'Create a secure PIN to protect your data';\n case 'training':\n return 'Building your personalized insights';\n case 'dataRequest':\n return `Select the data you want to share with ${webpageName}`;\n default:\n return '';\n }\n };\n\n const getFlowIcon = () => {\n switch (currentFlow) {\n case 'welcome':\n return ''; // WelcomeScreen handles its own layout\n case 'email':\n return ''; // EmailAuth handles its own layout\n case 'onboarding':\n return '🔗';\n case 'pin':\n return '🔒';\n case 'training':\n return '⚡';\n case 'dataRequest':\n return '📊';\n default:\n return '';\n }\n };\n\n const renderCurrentFlow = () => {\n switch (currentFlow) {\n case 'welcome':\n return (\n <WelcomeScreen \n onContinue={handleWelcomeContinue}\n onClose={handleCloseOverlay}\n webpageName={webpageName}\n appIcon={appIcon}\n testMode={testMode}\n />\n );\n case 'email':\n return (\n <div className=\"h-[min(85vh,700px)]\">\n <EmailAuth \n onSuccess={handleEmailAuthSuccess}\n testMode={testMode} // Use the testMode prop from initialization\n />\n </div>\n );\n \n case 'onboarding':\n return (\n <UniversalOnboarding \n onComplete={handleOnboardingComplete}\n onBack={() => setCurrentFlow('email')}\n appIcon={appIcon || \"https://onairos.sirv.com/Images/OnairosBlack.png\"}\n appName={webpageName}\n username={userData?.email || userData?.username}\n testMode={testMode}\n priorityPlatform={priorityPlatform}\n rawMemoriesOnly={rawMemoriesOnly}\n rawMemoriesConfig={rawMemoriesConfig}\n />\n );\n \n case 'pin':\n return (\n <PinSetup \n onComplete={handlePinSetupComplete}\n userEmail={userData?.email}\n />\n );\n \n case 'training':\n return (\n <TrainingComponent \n onComplete={handleTrainingComplete}\n userEmail={userData?.email}\n appName={webpageName}\n connectedAccounts={userData?.connectedAccounts || []}\n testMode={testMode}\n />\n );\n \n case 'dataRequest':\n console.log('🔍 [DEBUG] Rendering DataRequest with userData:', {\n email: userData?.email,\n userName: userData?.userName,\n hasUserData: !!userData,\n userDataKeys: userData ? Object.keys(userData) : []\n });\n return (\n <DataRequest \n onComplete={handleDataRequestComplete}\n userEmail={userData?.email || userData?.userName}\n requestData={requestData}\n appName={webpageName}\n autoFetch={autoFetch}\n testMode={testMode}\n appIcon={appIcon}\n connectedAccounts={userData?.connectedAccounts || {}}\n rawMemoriesOnly={rawMemoriesOnly}\n rawMemoriesConfig={rawMemoriesConfig}\n />\n );\n \n default:\n return (\n <div className=\"flex flex-col items-center space-y-4 p-6\">\n <div className=\"animate-spin h-8 w-8 border-2 border-blue-600 rounded-full border-t-transparent\"></div>\n <p className=\"text-gray-600\">Loading...</p>\n </div>\n );\n }\n };\n\n // Styling and button class based on visual type\n const buttonClass = \n `flex items-center justify-center font-bold rounded cursor-pointer ${\n buttonType === 'pill' ? 'px-4 py-2' : 'w-12 h-12'\n } bg-transparent OnairosConnect`;\n\n const buttonStyle = {\n flexDirection: textLayout === 'below' ? 'column' : 'row',\n backgroundColor: 'transparent',\n color: textColor,\n border: '1px solid transparent',\n };\n\n // Icon and text style based on the visualType\n const logoStyle = {\n width: '20px',\n height: '20px',\n marginRight: visualType === 'full' ? '12px' : '0',\n };\n\n const getText = () => {\n switch (loginType) {\n case 'signUp':\n return 'Sign Up with Onairos';\n case 'signOut':\n return 'Sign Out of Onairos';\n default:\n return 'Sign In with Onairos';\n }\n };\n\n return (\n <>\n <button\n className={buttonClass}\n onClick={openTerminal}\n style={buttonStyle}\n >\n {(visualType === 'full' || visualType === 'icon') && (\n <img\n src={login ? \"https://onairos.sirv.com/Images/OnairosWhite.png\" : \"https://onairos.sirv.com/Images/OnairosBlack.png\"}\n alt=\"Onairos Logo\"\n style={logoStyle}\n />\n )}\n {visualType !== 'icon' && (\n <span className={`${textColor === 'black' ? 'text-black' : 'text-white'} ${visualType === 'icon' ? 'sr-only' : ''} ${textLayout === 'right' ? 'ml-2' : textLayout === 'left' ? 'mr-2' : ''}`}>\n {getText()}\n </span>\n )}\n </button>\n\n {/* Modal with New Design */}\n {showOverlay && (\n <>\n {currentFlow === 'email' ? (\n // Special case for email - render directly without PageLayout wrapper\n <div className=\"fixed inset-0 bg-gray-500 bg-opacity-50 flex items-center justify-center p-6\" style={{ zIndex: 2147483647 }}>\n <div className=\"bg-white rounded-3xl w-full max-w-lg mx-auto shadow-2xl overflow-hidden flex flex-col\" style={{ maxWidth: '500px', height: '90vh' }}>\n {/* Header */}\n <div className=\"relative px-6 pt-6 pb-4 flex-shrink-0\">\n <button\n onClick={handleCloseOverlay}\n className=\"absolute left-4 top-4 p-2 hover:bg-gray-100 rounded-full transition-colors\"\n >\n <svg className=\"w-5 h-5 text-gray-600\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>\n\n {/* Email Content */}\n <div className=\"h-[min(85vh,700px)]\">\n <EmailAuth \n onSuccess={handleEmailAuthSuccess}\n testMode={testMode}\n />\n </div>\n </div>\n </div>\n ) : currentFlow === 'onboarding' ? (\n // Special case for onboarding - render directly without PageLayout wrapper\n <div className=\"fixed inset-0 bg-gray-500 bg-opacity-50 flex items-center justify-center p-6\" style={{ zIndex: 2147483647 }}>\n <div className=\"bg-white rounded-3xl w-full max-w-lg mx-auto shadow-2xl overflow-hidden flex flex-col\" style={{ maxWidth: '500px', height: '90vh' }}>\n {/* Header */}\n <div className=\"relative px-6 pt-6 pb-4 flex-shrink-0\">\n <button\n onClick={() => setCurrentFlow('email')}\n className=\"absolute left-4 top-4 p-2 hover:bg-gray-100 rounded-full transition-colors\"\n >\n <svg className=\"w-5 h-5 text-gray-600\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M15 19l-7-7 7-7\" />\n </svg>\n </button>\n </div>\n\n {/* Onboarding Content */}\n <UniversalOnboarding \n onComplete={handleOnboardingComplete}\n onBack={() => setCurrentFlow('email')}\n appIcon={appIcon || \"https://onairos.sirv.com/Images/OnairosBlack.png\"}\n appName={webpageName}\n username={userData?.email || userData?.username}\n testMode={testMode}\n priorityPlatform={priorityPlatform}\n rawMemoriesOnly={rawMemoriesOnly}\n rawMemoriesConfig={rawMemoriesConfig}\n />\n </div>\n </div>\n ) : currentFlow === 'dataRequest' ? (\n // Special case for dataRequest - render directly without PageLayout wrapper\n <div className=\"fixed inset-0 bg-gray-500 bg-opacity-50 flex items-center justify-center p-6\" style={{ zIndex: 2147483647 }}>\n <div className=\"bg-white rounded-3xl w-full max-w-lg mx-auto shadow-2xl overflow-hidden flex flex-col\" style={{ maxWidth: '500px', height: '90vh' }}>\n {/* Header */}\n <div className=\"relative px-6 pt-6 pb-4 flex-shrink-0\">\n <button\n onClick={() => setCurrentFlow('onboarding')}\n className=\"absolute left-4 top-4 p-2 hover:bg-gray-100 rounded-full transition-colors\"\n >\n <svg className=\"w-5 h-5 text-gray-600\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M15 19l-7-7 7-7\" />\n </svg>\n </button>\n </div>\n\n {/* DataRequest Content */}\n <DataRequest \n onComplete={handleDataRequestComplete}\n userEmail={userData?.email || userData?.userName}\n requestData={requestData}\n appName={webpageName}\n autoFetch={autoFetch}\n testMode={testMode}\n appIcon={appIcon}\n connectedAccounts={userData?.connectedAccounts || {}}\n rawMemoriesOnly={rawMemoriesOnly}\n rawMemoriesConfig={rawMemoriesConfig}\n />\n </div>\n </div>\n ) : currentFlow === 'pin' ? (\n // Special case for pin - render directly without PageLayout wrapper\n <div className=\"fixed inset-0 bg-gray-500 bg-opacity-50 flex items-center justify-center p-6\" style={{ zIndex: 2147483647 }}>\n <div className=\"bg-white rounded-3xl w-full max-w-lg mx-auto shadow-2xl overflow-hidden flex flex-col\" style={{ maxWidth: '500px', height: '90vh' }}>\n {/* Header */}\n <div className=\"relative px-6 pt-6 pb-4 flex-shrink-0\">\n <button\n onClick={() => setCurrentFlow('onboarding')}\n className=\"absolute left-4 top-4 p-2 hover:bg-gray-100 rounded-full transition-colors\"\n >\n <svg className=\"w-5 h-5 text-gray-600\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M15 19l-7-7 7-7\" />\n </svg>\n </button>\n </div>\n\n {/* PinSetup Content - Must take remaining height */}\n <div className=\"flex-1 min-h-0\">\n <PinSetup \n onComplete={handlePinSetupComplete}\n onBack={() => setCurrentFlow('onboarding')}\n userEmail={userData?.email}\n />\n </div>\n </div>\n </div>\n ) : currentFlow === 'loading' ? (\n // Loading screen\n <LoadingScreen onComplete={handleLoadingComplete} />\n ) : (\n // All other flows use PageLayout wrapper\n <ModalPageLayout\n visible={showOverlay}\n onClose={handleCloseOverlay}\n showBackButton={currentFlow === 'training'}\n onBack={() => {\n if (currentFlow === 'email') setCurrentFlow('welcome');\n if (currentFlow === 'onboarding') setCurrentFlow('email');\n if (currentFlow === 'pin') setCurrentFlow('onboarding'); \n if (currentFlow === 'training') setCurrentFlow('pin');\n }}\n title={getFlowTitle()}\n subtitle={getFlowSubtitle()}\n icon={getFlowIcon()}\n centerContent={true}\n >\n {renderCurrentFlow()}\n </ModalPageLayout>\n )}\n </>\n )}\n </>\n );\n}\n\nexport default OnairosButton;","/**\n * Enhanced User Data Formatter for onComplete Callback\n * Provides structured, readable formatting of Onairos user data\n */\n\n/**\n * Formats user data for better readability in onComplete callback\n * @param {Object} result - The complete result object from data request\n * @returns {Object} Enhanced result with formatted user data display\n */\nexport function formatUserDataForDisplay(result) {\n if (!result) return result;\n\n const formatted = { ...result };\n \n // Create a structured summary of the user data\n const userDataSummary = {\n // Basic request information\n requestInfo: {\n timestamp: result.timestamp || new Date().toISOString(),\n appName: result.appName || 'Unknown App',\n userHash: result.userHash || 'Unknown User',\n testMode: result.testMode || false,\n dataTypesRequested: result.approvedData || []\n },\n \n // User authentication and profile data\n userProfile: {\n email: result.userData?.email || 'Not provided',\n userType: result.userData?.userType || 'Unknown',\n onboardingComplete: result.userData?.onboardingComplete || false,\n pinCreated: result.userData?.pinCreated || false,\n trainingComplete: result.userData?.trainingComplete || false,\n modelReady: result.userData?.modelReady || false\n },\n \n // Connected platforms/accounts\n connectedAccounts: formatConnectedAccounts(result.userData?.connectedAccounts || []),\n \n // API response data (personality, preferences, etc.)\n aiData: formatAIResponseData(result.apiResponse),\n \n // Success status and any errors\n status: {\n success: result.success || false,\n hasApiResponse: !!result.apiResponse,\n hasErrors: !!result.error || !!result.apiError\n }\n };\n\n // Add the formatted summary to the result\n formatted.userDataSummary = userDataSummary;\n \n // Create a pretty-printed version for console logging\n formatted.prettyPrint = createPrettyPrintVersion(userDataSummary);\n \n return formatted;\n}\n\n/**\n * Formats connected accounts data\n * @param {Array} accounts - Array of connected account objects\n * @returns {Object} Formatted accounts summary\n */\nfunction formatConnectedAccounts(accounts) {\n if (!Array.isArray(accounts) || accounts.length === 0) {\n return {\n count: 0,\n platforms: [],\n summary: 'No connected accounts'\n };\n }\n\n return {\n count: accounts.length,\n platforms: accounts.map(account => ({\n name: account.platform || account.name || 'Unknown Platform',\n status: account.status || 'Unknown',\n connectedAt: account.connectedAt || 'Unknown date',\n hasData: account.hasData || false\n })),\n summary: `${accounts.length} platform(s) connected: ${accounts.map(a => a.platform || a.name).join(', ')}`\n };\n}\n\n/**\n * Formats AI response data (personality scores, traits, etc.)\n * @param {Object} apiResponse - The API response containing AI data\n * @returns {Object} Formatted AI data summary\n */\nfunction formatAIResponseData(apiResponse) {\n if (!apiResponse) {\n return {\n available: false,\n summary: 'No AI data available'\n };\n }\n\n const aiData = {\n available: true,\n dataTypes: []\n };\n\n // Check for personality data\n if (apiResponse.InferenceResult?.traits || apiResponse.personalityDict || apiResponse.traits) {\n const personalityData = {\n type: 'personality',\n available: true\n };\n\n // If we have dictionary format, use it for better readability\n if (apiResponse.personalityDict) {\n personalityData.data = apiResponse.personalityDict;\n personalityData.summary = `Personality analysis with ${Object.keys(apiResponse.personalityDict).length} traits`;\n } else if (apiResponse.InferenceResult?.traits) {\n personalityData.data = apiResponse.InferenceResult.traits;\n personalityData.summary = `Personality scores array with ${apiResponse.InferenceResult.traits.length} values`;\n } else if (apiResponse.traits) {\n personalityData.data = apiResponse.traits;\n personalityData.summary = `Personality traits with ${Array.isArray(apiResponse.traits) ? apiResponse.traits.length : Object.keys(apiResponse.traits).length} items`;\n }\n\n aiData.dataTypes.push(personalityData);\n }\n\n // Check for preferences/traits data\n if (apiResponse.traitResult || apiResponse.traitDict) {\n const preferencesData = {\n type: 'preferences',\n available: true\n };\n\n if (apiResponse.traitDict) {\n preferencesData.data = apiResponse.traitDict;\n preferencesData.summary = `Preferences analysis with ${Object.keys(apiResponse.traitDict).length} categories`;\n } else if (apiResponse.traitResult) {\n preferencesData.data = apiResponse.traitResult;\n preferencesData.summary = `Trait results with ${Array.isArray(apiResponse.traitResult) ? apiResponse.traitResult.length : Object.keys(apiResponse.traitResult).length} items`;\n }\n\n aiData.dataTypes.push(preferencesData);\n }\n\n // Check for basic info/output\n if (apiResponse.InferenceResult?.output || apiResponse.output) {\n aiData.dataTypes.push({\n type: 'basic_info',\n available: true,\n data: apiResponse.InferenceResult?.output || apiResponse.output,\n summary: 'Basic user information and insights'\n });\n }\n\n // Create overall summary\n aiData.summary = aiData.dataTypes.length > 0 \n ? `AI analysis complete with ${aiData.dataTypes.length} data type(s): ${aiData.dataTypes.map(d => d.type).join(', ')}`\n : 'AI data structure present but no recognized data types found';\n\n return aiData;\n}\n\n/**\n * Creates a pretty-printed version for console logging\n * @param {Object} userDataSummary - The formatted user data summary\n * @returns {string} Pretty-printed string for console output\n */\nfunction createPrettyPrintVersion(userDataSummary) {\n const lines = [];\n \n lines.push('🎉 ONAIROS USER DATA SUMMARY');\n lines.push('=' .repeat(50));\n \n // Request Info\n lines.push('\\n📋 REQUEST INFORMATION:');\n lines.push(` App: ${userDataSummary.requestInfo.appName}`);\n lines.push(` User: ${userDataSummary.requestInfo.userHash}`);\n lines.push(` Mode: ${userDataSummary.requestInfo.testMode ? 'Test' : 'Production'}`);\n lines.push(` Data Types: ${userDataSummary.requestInfo.dataTypesRequested.join(', ') || 'None'}`);\n lines.push(` Timestamp: ${new Date(userDataSummary.requestInfo.timestamp).toLocaleString()}`);\n \n // User Profile\n lines.push('\\n👤 USER PROFILE:');\n lines.push(` Email: ${userDataSummary.userProfile.email}`);\n lines.push(` Type: ${userDataSummary.userProfile.userType}`);\n lines.push(` Onboarding: ${userDataSummary.userProfile.onboardingComplete ? '✅' : '❌'}`);\n lines.push(` PIN Setup: ${userDataSummary.userProfile.pinCreated ? '✅' : '❌'}`);\n lines.push(` Training: ${userDataSummary.userProfile.trainingComplete ? '✅' : '❌'}`);\n lines.push(` Model Ready: ${userDataSummary.userProfile.modelReady ? '✅' : '❌'}`);\n \n // Connected Accounts\n lines.push('\\n🔗 CONNECTED ACCOUNTS:');\n lines.push(` ${userDataSummary.connectedAccounts.summary}`);\n if (userDataSummary.connectedAccounts.platforms.length > 0) {\n userDataSummary.connectedAccounts.platforms.forEach(platform => {\n lines.push(` • ${platform.name}: ${platform.status} ${platform.hasData ? '(has data)' : '(no data)'}`);\n });\n }\n \n // AI Data\n lines.push('\\n🤖 AI ANALYSIS DATA:');\n lines.push(` ${userDataSummary.aiData.summary}`);\n if (userDataSummary.aiData.dataTypes.length > 0) {\n userDataSummary.aiData.dataTypes.forEach(dataType => {\n lines.push(` • ${dataType.type.toUpperCase()}: ${dataType.summary}`);\n });\n }\n \n // Status\n lines.push('\\n✅ STATUS:');\n lines.push(` Success: ${userDataSummary.status.success ? '✅' : '❌'}`);\n lines.push(` API Response: ${userDataSummary.status.hasApiResponse ? '✅' : '❌'}`);\n lines.push(` Errors: ${userDataSummary.status.hasErrors ? '❌ Yes' : '✅ None'}`);\n \n lines.push('\\n' + '=' .repeat(50));\n \n return lines.join('\\n');\n}\n\n/**\n * Console logging helper that prints formatted user data\n * @param {Object} result - The result object from onComplete\n */\nexport function logFormattedUserData(result) {\n const formatted = formatUserDataForDisplay(result);\n \n console.log('\\n' + formatted.prettyPrint + '\\n');\n \n // Also log the structured data for programmatic access\n console.log('📊 Structured User Data Summary:', formatted.userDataSummary);\n \n return formatted;\n}\n\nexport default {\n formatUserDataForDisplay,\n logFormattedUserData\n};\n"],"names":["WelcomeScreen","_ref","onContinue","onClose","useEffect","script","document","createElement","src","async","head","appendChild","existingScript","querySelector","removeChild","React","className","style","height","alt","onClick","fill","stroke","viewBox","strokeLinecap","strokeLinejoin","strokeWidth","d","COLORS","btnGradStart","btnGradEnd","btnLabel","btnBorder","iconCircleGradientStart","iconCircleGradientEnd","background","backgroundSecondary","textPrimary","textSecondary","textMuted","border","borderLight","success","error","warning","info","hover","pressed","focus","IconCircle","size","children","concat","width","borderRadius","fontSize","color","backgroundColor","_ref2","label","iconRight","loading","disabled","testId","textStyle","centered","props","_objectWithoutProperties","_excluded","setPressed","useState","buttonStyle","_objectSpread","position","overflow","minWidth","maxWidth","margin","cursor","opacity","boxShadow","transition","pressedOverlayStyle","top","left","right","bottom","labelStyle","fontFamily","fontWeight","textAlign","_extends","onMouseDown","handleMouseDown","onMouseUp","handleMouseUp","onMouseLeave","handleMouseLeave","display","justifyContent","alignItems","EmailAuth","onSuccess","testMode","email","setEmail","code","setCode","step","setStep","isLoading","setIsLoading","setError","emailSent","setEmailSent","emailServiceMessage","setEmailServiceMessage","setTimeout","firstInput","handleEmailSubmit","e","preventDefault","test","validateEmail","console","log","baseUrl","window","onairosBaseUrl","apiKey","onairosApiKey","response","fetch","method","headers","body","JSON","stringify","trim","toLowerCase","ok","Error","data","json","message","handleGoogleAuth","_JSON$parse","tempId","Date","now","Math","random","toString","substr","localStorage","setItem","sdkConfig","username","getItem","parse","res","session","oauthUrl","gmailURL","gmailUrl","gmail_url","url","popup","open","messageHandler","event","origin","includes","type","platform","removeEventListener","handleOAuthSuccess","gmailEmail","addEventListener","pollCount","maxPolls","localStorageKey","timestampKey","pollInterval","setInterval","closed","clearInterval","retrieveAndContinueWithGoogleEmail","timestamp","timestampNum","parseInt","close","cleanup","removeItem","_onairosOAuthCleanup","emailRes","warn","normalizedEmail","verified","token","userName","split","existingUser","accountInfo","isNewUser","flowType","adminMode","userCreated","accountDetails","createdAt","toISOString","ssoProvider","handleCodeSubmit","length","simulatedResponse","testAccount","jwtToken","value","onChange","target","placeholder","required","lineHeight","borderColor","Array","from","_","index","key","maxLength","newCode","join","_e$target$parentEleme","nextInput","parentElement","onKeyDown","_e$target$parentEleme2","prevInput","PrimaryButton","flex","minHeight","Check","ChatGPTConnector","Component","constructor","super","this","state","connected","isConnecting","handleClose","bind","handleOpen","chatGPTConnect","setConnected","setDisconnected","setState","onConnectionChange","llmManager","llmConnectorManager","connectToLLM","alert","render","bookmarkletCode","fillRule","clipRule","animation","href","draggable","onDragStart","dataTransfer","setData","effectAllowed","chatgptIcon","claudeIcon","geminiIcon","grokIcon","process","env","REACT_APP_ONAIROS_API_KEY","REACT_APP_ONAIROS_BASE_URL","sdkType","enableHealthMonitoring","enableAutoRefresh","enableConnectionValidation","fadeSlideInKeyframes","UniversalOnboarding","onComplete","lottieRef","useRef","lastFrameRef","rafRef","connectedAccounts","setConnectedAccounts","setIsConnecting","connectingPlatform","setConnectingPlatform","selected","setSelected","currentPage","setCurrentPage","showChatGPTModal","setShowChatGPTModal","touchStartX","touchDeltaX","vh","setVh","innerHeight","onResize","personaSide","min","SLOT","max","floor","ACTIVE_SCALE","igGradId","round","useId","Brand","ChatGPT","objectFit","Claude","Gemini","Grok","Instagram","id","cx","cy","r","offset","stopColor","YouTube","Reddit","LinkedIn","x","y","rx","Twitter","aiLinks","descriptions","allPlatforms","name","connector","icon","directLink","platforms","page","slice","p","s","userData","isArray","accountsObj","reduce","acc","handleSwitch","plat","find","candidates","youtube","linkedin","reddit","pinterest","instagram","github","facebook","gmail","k","touched","it","location","hostname","_unused","_unused2","_unused3","_unused4","connectToPlatform","connectedCount","Object","values","filter","Boolean","current","totalFrames","personaAnim","progress","start","startTs","performance","t","eased","frame","goToAndStop","requestAnimationFrame","cancelAnimationFrame","maxHeight","transform","zIndex","pointerEvents","Lottie","animationData","autoplay","loop","onTouchStart","touches","clientX","onTouchMove","onTouchEnd","dx","gridAutoFlow","gridTemplateColumns","columnGap","justifyItems","paddingInline","map","idx","on","isSel","shift","title","transformOrigin","marginTop","marginBottom","n","role","paddingBottom","entries","v","_ref3","totalConnections","xmlns","PinSetup","onBack","userEmail","pin","setPin","pinRequirements","setPinRequirements","uppercase","number","allRequirementsMet","WebkitTextFillColor","handleSubmit","pinCreated","undefined","Icon","base","DataTypeToggle","dataType","enabled","onToggle","handle","options","appName","connectedPlatforms","basic","rawMemories","preferences","personality","freq","setFreq","toggle","val","selectedCount","getConnected","_ref4","_ref5","u","_ref6","_ref7","freqToPercent","f","opt","rect","currentTarget","getBoundingClientRect","ratio","Pinterest","GitHub","Facebook","Gmail","onError","approved","declined","TrainingComponent","_steps$currentStep","_steps$currentStep2","_steps$currentStep3","_steps$currentStep4","_steps$currentStep5","currentStep","setCurrentStep","setProgress","isComplete","setIsComplete","steps","description","duration","interval","stepTimeout","stepDuration","stepProgress","prev","newProgress","completionDelay","trainingComplete","simulatedTraining","clearTimeout","LoadingScreen","dotCount","setDotCount","loadingStates","stateInterval","nextStep","dotInterval","currentState","aspectRatio","rainAnim","repeat","PERSONALITY_TYPES","TRAIT_CATEGORIES","formatOnairosResponse","apiResponse","_apiResponse$Inferenc","arguments","includeDictionary","includeArray","formatted","InferenceResult","traits","scores","_apiResponse$Inferenc2","personalityDict","forEach","_formatted$InferenceR","traitResult","traitDict","category","PageLayout","subtitle","showHeader","showCloseButton","showBackButton","contentClassName","centerContent","layoutStyle","flexDirection","headerStyle","padding","contentStyle","titleStyle","subtitleStyle","ModalPageLayout","visible","onBackdropClick","backdropStyle","modalStyle","pageLayoutProps","_excluded2","backdropStyles","willChange","modalStyles","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","OnairosButton","requestData","webpageName","inferenceData","autoFetch","proofMode","textLayout","textColor","login","buttonType","loginReturn","loginType","visualType","appIcon","enableTraining","formatResponse","responseFormat","priorityPlatform","rawMemoriesOnly","rawMemoriesConfig","showOverlay","setShowOverlay","currentFlow","setCurrentFlow","setUserData","checkExistingSession","savedUser","user","onboardingComplete","handleCloseOverlay","handleWelcomeContinue","handleEmailAuthSuccess","authData","userState","hasAccountInfo","candidate","accessToken","base64","payload","decodeURIComponent","atob","c","charCodeAt","userId","sub","finalDecision","reasoning","existingUserFalse","flowTypeOnboarding","noAccountInfo","newUserData","handleOnboardingComplete","onboardingData","updatedUserData","handlePinSetupComplete","pinData","handleTrainingComplete","trainingResult","trainingCompleted","handleDataRequestComplete","requestResult","lastDataRequest","formattedResult","_formattedResult$apiR","logFormattedUserData","require","enhancedResult","apiUrl","allKeys","keys","buttonClass","logoStyle","marginRight","getText","DataRequest","handleLoadingComplete","getFlowTitle","getFlowSubtitle","getFlowIcon","renderCurrentFlow","hasUserData","userDataKeys","formatUserDataForDisplay","result","_result$userData","_result$userData2","_result$userData3","_result$userData4","_result$userData5","_result$userData6","_result$userData7","userDataSummary","requestInfo","userHash","dataTypesRequested","approvedData","userProfile","userType","modelReady","formatConnectedAccounts","aiData","formatAIResponseData","status","hasApiResponse","hasErrors","apiError","prettyPrint","lines","push","toLocaleString","summary","hasData","dataTypes","toUpperCase","createPrettyPrintVersion","accounts","count","account","connectedAt","a","_apiResponse$Inferenc3","available","personalityData","preferencesData","_apiResponse$Inferenc4","output"],"ignoreList":[],"sourceRoot":""}
1
+ {"version":3,"file":"421.js","mappings":"yJAGe,SAASA,EAAaC,GAA0B,IAAzB,WAAEC,EAAU,QAAEC,GAASF,EAgB3D,OAdAG,EAAAA,EAAAA,WAAU,KACR,MAAMC,EAASC,SAASC,cAAc,UAKtC,OAJAF,EAAOG,IAAM,6CACbH,EAAOI,OAAQ,EACfH,SAASI,KAAKC,YAAYN,GAEnB,KACL,MAAMO,EAAiBN,SAASO,cAAc,4DAC1CD,GACFN,SAASI,KAAKI,YAAYF,KAG7B,IAGDG,EAAAA,cAAA,OAAKC,UAAU,uBAAuBC,MAAO,CAAEC,OAAQ,SAErDH,EAAAA,cAAA,OAAKC,UAAU,wDAEbD,EAAAA,cAAA,OAAKC,UAAU,4BACbD,EAAAA,cAAA,OAAKC,UAAU,8CACbD,EAAAA,cAAA,OACEC,UAAU,oCACV,WAAS,gDACTG,IAAI,mBAMVJ,EAAAA,cAAA,KAAGC,UAAU,8BAA6B,cAG1CD,EAAAA,cAAA,MAAIC,UAAU,sDAAqD,WAGnED,EAAAA,cAAA,KAAGC,UAAU,kEAAiE,+FAMhFD,EAAAA,cAAA,OAAKC,UAAU,2BACbD,EAAAA,cAAA,UACEC,UAAU,mJACVI,QAASlB,GACV,cAECa,EAAAA,cAAA,OAAKC,UAAU,UAAUK,KAAK,OAAOC,OAAO,eAAeC,QAAQ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ources":["webpack://OnairosLaravel/./src/components/WelcomeScreen.jsx","webpack://OnairosLaravel/./src/theme/colors.js","webpack://OnairosLaravel/./src/components/ui/PrimaryButton.jsx","webpack://OnairosLaravel/./src/components/EmailAuth.js","webpack://OnairosLaravel/./src/components/connectors/ChatGPTConnector.js","webpack://OnairosLaravel/./src/components/UniversalOnboarding.jsx","webpack://OnairosLaravel/./src/components/PinSetup.js","webpack://OnairosLaravel/./src/components/DataRequest.js","webpack://OnairosLaravel/./src/components/TrainingComponent.jsx","webpack://OnairosLaravel/./src/components/LoadingScreen.jsx","webpack://OnairosLaravel/./src/utils/responseFormatter.js","webpack://OnairosLaravel/./src/components/ui/PageLayout.jsx","webpack://OnairosLaravel/./src/onairosButton.jsx","webpack://OnairosLaravel/./src/utils/userDataFormatter.js"],"sourcesContent":["import React, { useEffect } from 'react';\nimport { COLORS } from '../theme/colors.js';\n\nexport default function WelcomeScreen({ onContinue, onClose }) {\n // Load Sirv script for responsive images\n useEffect(() => {\n const script = document.createElement('script');\n script.src = 'https://scripts.sirv.com/sirvjs/v3/sirv.js';\n script.async = true;\n document.head.appendChild(script);\n \n return () => {\n const existingScript = document.querySelector('script[src=\"https://scripts.sirv.com/sirvjs/v3/sirv.js\"]');\n if (existingScript) {\n document.head.removeChild(existingScript);\n }\n };\n }, []);\n\n return (\n <div className=\"w-full flex flex-col\" style={{ height: '100%' }}>\n {/* Content - Flexible center area */}\n <div className=\"px-6 text-center flex-1 flex flex-col justify-center\">\n {/* Logo */}\n <div className=\"mb-8 flex justify-center\">\n <div className=\"w-20 h-20 flex items-center justify-center\">\n <img \n className=\"Sirv w-full h-full object-contain\" \n data-src=\"https://anushkasirv.sirv.com/OnairosBlack.png\" \n alt=\"Onairos Logo\"\n />\n </div>\n </div>\n\n {/* Welcome Text */}\n <p className=\"text-gray-500 text-sm mb-2\">Welcome to</p>\n\n {/* Main Title */}\n <h1 className=\"text-4xl font-bold text-gray-900 mb-6 text-balance\">Onairos</h1>\n\n {/* Description */}\n <p className=\"text-gray-600 text-base leading-relaxed mb-12 text-pretty px-2\">\n OnairOS personalizes your digital experience on every app so you can just enjoy being you!\n </p>\n </div>\n\n {/* Get Started Button - Fixed at bottom */}\n <div className=\"px-6 pb-8 flex-shrink-0\">\n <button\n className=\"w-full bg-gray-900 hover:bg-gray-800 text-white rounded-full py-4 text-base font-medium flex items-center justify-center gap-2 transition-colors\"\n onClick={onContinue}\n >\n Get Started\n <svg className=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M9 5l7 7-7 7\" />\n </svg>\n </button>\n </div>\n </div>\n );\n}\n","// Theme colors for Onairos SDK - derived from mobile design\nexport const COLORS = {\n // Button gradient colors\n btnGradStart: '#1A1A1A',\n btnGradEnd: '#000000',\n \n // Button text and icon colors\n btnLabel: '#FFFFFF',\n btnBorder: 'rgba(0, 0, 0, 0.2)',\n \n // Icon circle gradient colors\n iconCircleGradientStart: '#333333',\n iconCircleGradientEnd: '#1A1A1A',\n \n // Background colors\n background: '#FFFFFF',\n backgroundSecondary: '#F8F9FA',\n \n // Text colors\n textPrimary: '#1A1A1A',\n textSecondary: '#6B7280',\n textMuted: '#9CA3AF',\n \n // Border colors\n border: '#E5E7EB',\n borderLight: '#F3F4F6',\n \n // Status colors\n success: '#10B981',\n error: '#EF4444',\n warning: '#F59E0B',\n info: '#3B82F6',\n \n // Interactive states\n hover: 'rgba(0, 0, 0, 0.05)',\n pressed: 'rgba(0, 0, 0, 0.1)',\n focus: 'rgba(59, 130, 246, 0.1)',\n};\n\nexport default COLORS; ","import React, { useState } from 'react';\nimport { COLORS } from '../../theme/colors.js';\n\n// Icon Circle component matching the React Native version\nconst IconCircle = ({ \n size = 40, \n children,\n className = ''\n}) => {\n return (\n <div \n className={`relative flex items-center justify-center border border-black border-opacity-25 ${className}`}\n style={{\n width: size,\n height: size,\n borderRadius: size / 2,\n background: `linear-gradient(to bottom, ${COLORS.iconCircleGradientStart}, ${COLORS.iconCircleGradientEnd})`\n }}\n >\n {children || (\n <span \n className=\"font-semibold opacity-95\"\n style={{\n fontSize: '20px',\n color: COLORS.btnLabel,\n backgroundColor: 'transparent'\n }}\n >\n →\n </span>\n )}\n </div>\n );\n};\n\n// Primary Button component matching the React Native design\nconst PrimaryButton = ({\n label = \"Get Started\",\n onClick,\n iconRight,\n loading = false,\n disabled = false,\n testId,\n className = '',\n style = {},\n textStyle = {},\n centered = false,\n ...props\n}) => {\n const [pressed, setPressed] = useState(false);\n\n const handleMouseDown = () => setPressed(true);\n const handleMouseUp = () => setPressed(false);\n const handleMouseLeave = () => setPressed(false);\n\n const buttonStyle = {\n height: '48px',\n borderRadius: '100px',\n border: `1px solid ${COLORS.btnBorder}`,\n background: `linear-gradient(to bottom, ${COLORS.btnGradStart}, ${COLORS.btnGradEnd})`,\n position: 'relative',\n overflow: 'hidden',\n width: centered ? 'auto' : '100%',\n minWidth: centered ? '250px' : 'auto',\n maxWidth: centered ? '350px' : 'none',\n margin: centered ? '0 auto' : '0',\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.65 : 1,\n boxShadow: disabled ? 'none' : '20px 30px 40px rgba(0,0,0,0.10)',\n transition: 'all 0.2s ease',\n ...style\n };\n\n const pressedOverlayStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: 'rgba(0,0,0,0.1)',\n borderRadius: '100px',\n opacity: pressed ? 1 : 0,\n transition: 'opacity 0.1s ease'\n };\n\n const textContainerStyle = {\n position: 'absolute',\n left: 0,\n right: 0,\n top: 0,\n bottom: 0,\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n backgroundColor: 'transparent'\n };\n\n const iconPositionStyle = {\n position: 'absolute',\n right: '4px',\n top: '4px',\n bottom: '4px',\n width: '40px',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n backgroundColor: 'transparent'\n };\n\n const labelStyle = {\n fontFamily: 'Inter, system-ui, sans-serif',\n fontWeight: '600',\n fontSize: '16px',\n color: COLORS.btnLabel,\n textAlign: 'center',\n backgroundColor: 'transparent',\n ...textStyle\n };\n\n return (\n <button\n className={`relative ${className}`}\n style={buttonStyle}\n onClick={onClick}\n onMouseDown={handleMouseDown}\n onMouseUp={handleMouseUp}\n onMouseLeave={handleMouseLeave}\n disabled={disabled || loading}\n data-testid={testId}\n aria-label={label}\n {...props}\n >\n {/* Pressed state overlay */}\n <div style={pressedOverlayStyle} />\n\n {/* Centered text container */}\n <div style={textContainerStyle}>\n {loading ? (\n <div \n className=\"animate-spin rounded-full border-2 border-white border-t-transparent\"\n style={{ width: '20px', height: '20px' }}\n />\n ) : (\n <span style={labelStyle}>{label}</span>\n )}\n </div>\n\n {/* Icon in fixed position on right */}\n <div style={iconPositionStyle}>\n {!loading && (iconRight || <IconCircle />)}\n </div>\n </button>\n );\n};\n\nexport { IconCircle };\nexport default PrimaryButton; ","import React, { useState, useEffect } from 'react';\nimport { Mail, ArrowRight, Check } from 'lucide-react';\nimport PrimaryButton from './ui/PrimaryButton.jsx';\nimport { COLORS } from '../theme/colors.js';\n\nexport default function EmailAuth({ onSuccess, testMode = true }) {\n const [email, setEmail] = useState('');\n const [code, setCode] = useState('');\n const [step, setStep] = useState('email'); // 'email' | 'code' | 'success'\n const [isLoading, setIsLoading] = useState(false);\n const [error, setError] = useState('');\n const [emailSent, setEmailSent] = useState(true); // Track if email was actually sent\n const [emailServiceMessage, setEmailServiceMessage] = useState(''); // Store service message\n\n // Auto-focus first PIN input when code step loads\n useEffect(() => {\n if (step === 'code') {\n // Small delay to ensure DOM is ready\n setTimeout(() => {\n const firstInput = document.querySelector('input[maxLength=\"1\"]');\n if (firstInput) {\n firstInput.focus();\n }\n }, 100);\n }\n }, [step]);\n\n const validateEmail = (email) => {\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n return emailRegex.test(email);\n };\n\n const handleEmailSubmit = async (e) => {\n e.preventDefault();\n setError('');\n setEmailSent(true); // Reset email status\n setEmailServiceMessage(''); // Reset service message\n\n if (!validateEmail(email)) {\n setError('Please enter a valid email address');\n return;\n }\n\n setIsLoading(true);\n\n try {\n if (testMode) {\n // Test mode: Skip API call completely, simulate instant success\n console.log('🧪 Test mode: Simulating email verification request for:', email);\n setTimeout(() => {\n setStep('code');\n setIsLoading(false);\n console.log('🧪 Test mode: Email verification simulated successfully');\n }, 800); // Shorter delay for faster testing\n } else {\n // Production mode: Use proper email verification API from schema\n const baseUrl = (typeof window !== 'undefined' && window.onairosBaseUrl) || 'https://api2.onairos.uk';\n const apiKey = (typeof window !== 'undefined' && window.onairosApiKey) || 'ona_VvoHNg1fdCCUa9eBy4Iz3IfvXdgLfMFI7TNcyHLDKEadPogkbjAeE2iDOs6M7Aey';\n \n const response = await fetch(`${baseUrl}/email/verify`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'x-api-key': apiKey,\n 'Authorization': `Bearer ${apiKey}`\n },\n body: JSON.stringify({\n email: (email || '').trim().toLowerCase()\n }),\n });\n\n if (!response.ok) {\n throw new Error('Failed to send verification code');\n }\n\n const data = await response.json();\n if (!data.success) {\n throw new Error(data.error || 'Failed to send verification code');\n }\n\n console.log('📧 Email request response:', data);\n\n // Store email service status\n setEmailSent(data.emailSent !== false); // Default to true if not specified\n setEmailServiceMessage(data.message || '');\n\n setStep('code');\n setIsLoading(false);\n }\n } catch (error) {\n console.error('Email request error:', error);\n setError(error.message);\n setIsLoading(false);\n }\n };\n\n const handleGoogleAuth = async () => {\n try {\n setIsLoading(true);\n setError('');\n\n // Create temporary account identifier for OAuth flow\n const tempId = `google_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;\n localStorage.setItem('onairos_temp_google_id', tempId);\n console.log('✅ Temporary account created for Google OAuth');\n\n const sdkConfig = {\n baseUrl: 'https://api2.onairos.uk',\n apiKey: window.onairosApiKey || 'test-key',\n };\n\n const username = localStorage.getItem('username') || \n (JSON.parse(localStorage.getItem('onairosUser') || '{}')?.email) || \n tempId;\n \n console.log('🔗 Requesting Gmail OAuth URL for Google authentication...');\n \n // Request OAuth URL from backend\n const res = await fetch(`${sdkConfig.baseUrl}/gmail/authorize`, {\n method: 'POST',\n headers: {\n 'x-api-key': sdkConfig.apiKey,\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n session: { username }\n })\n });\n\n if (!res.ok) {\n throw new Error('Failed to get OAuth URL');\n }\n\n const data = await res.json();\n const oauthUrl = data.gmailURL || data.gmailUrl || data.gmail_url || data.url;\n \n if (!oauthUrl) {\n throw new Error('No OAuth URL received from backend');\n }\n\n console.log('🚀 Opening Google OAuth popup...');\n\n // Open popup for OAuth\n const popup = window.open(\n oauthUrl,\n 'google_oauth',\n 'width=500,height=600,scrollbars=yes,resizable=yes,status=no,location=no,toolbar=no,menubar=no'\n );\n\n if (!popup) {\n throw new Error('Popup blocked. Please allow popups for this site.');\n }\n\n // Set up postMessage listener for cross-origin communication\n const messageHandler = (event) => {\n // Only accept messages from onairos.uk origin\n if (event.origin !== 'https://api2.onairos.uk' && \n event.origin !== 'https://onairos.uk' &&\n !event.origin.includes('onairos.uk')) {\n return;\n }\n\n if (event.data && event.data.type === 'oauth-success' && event.data.platform === 'gmail') {\n console.log('✅ OAuth success received via postMessage:', event.data);\n window.removeEventListener('message', messageHandler);\n handleOAuthSuccess(event.data.email || event.data.gmailEmail);\n }\n };\n\n window.addEventListener('message', messageHandler);\n console.log('👂 [POSTMESSAGE] Listener registered, waiting for messages...');\n\n // Poll localStorage for OAuth completion (oauth-callback.html sets this)\n let pollCount = 0;\n const maxPolls = 300; // 5 minutes max (300 * 1 second)\n const localStorageKey = 'onairos_gmail_success';\n const timestampKey = 'onairos_gmail_timestamp';\n\n const pollInterval = setInterval(() => {\n pollCount++;\n \n try {\n // Check if popup is closed (user might have closed it manually)\n // If closed after OAuth redirect (pollCount > 10 = ~10 seconds), try fallback\n if (popup.closed && pollCount > 10) {\n clearInterval(pollInterval);\n window.removeEventListener('message', messageHandler);\n console.log('⚠️ OAuth popup was closed, trying fallback to get email from backend...');\n retrieveAndContinueWithGoogleEmail(username, tempId);\n return;\n }\n\n // Check localStorage for success signal\n const success = localStorage.getItem(localStorageKey);\n const timestamp = localStorage.getItem(timestampKey);\n \n if (success === 'true' && timestamp) {\n const timestampNum = parseInt(timestamp, 10);\n const now = Date.now();\n \n // Only process if timestamp is recent (within last 30 seconds)\n if (now - timestampNum < 30000) {\n console.log('✅ Cross-origin detected - OAuth popup navigated to onairos.uk');\n clearInterval(pollInterval);\n window.removeEventListener('message', messageHandler);\n \n // Try to get email from URL params (stored by oauth-callback.html)\n // The callback URL includes: ?success=true&platform=gmail&email=...\n // We need to retrieve email from backend since we can't access popup.location\n retrieveAndContinueWithGoogleEmail(username, tempId);\n }\n }\n\n // Check for cross-origin navigation (don't access popup.location - causes COOP error)\n // Instead, rely on localStorage and postMessage signals\n if (pollCount === 1) {\n console.log('✅ Cross-origin detected - waiting for postMessage/localStorage...');\n }\n\n // Timeout after max polls\n if (pollCount >= maxPolls) {\n clearInterval(pollInterval);\n window.removeEventListener('message', messageHandler);\n setIsLoading(false);\n console.log('⏳ [TIMEOUT] PostMessage not received after 5 minutes, closing popup and trying fallback...');\n \n // Try fallback: retrieve email from backend\n if (popup.closed) {\n retrieveAndContinueWithGoogleEmail(username, tempId);\n } else {\n try {\n popup.close();\n } catch (e) {}\n setError('OAuth timeout. Please try again.');\n }\n }\n } catch (error) {\n console.error('Error in OAuth polling:', error);\n }\n }, 1000);\n\n // Cleanup function\n const cleanup = () => {\n clearInterval(pollInterval);\n window.removeEventListener('message', messageHandler);\n try {\n localStorage.removeItem(localStorageKey);\n localStorage.removeItem(timestampKey);\n } catch (e) {}\n };\n\n // Store cleanup function for component unmount\n if (typeof window !== 'undefined') {\n window._onairosOAuthCleanup = cleanup;\n }\n\n } catch (error) {\n console.error('❌ Google OAuth failed:', error);\n setError('Google authentication failed. Please try again.');\n setIsLoading(false);\n }\n };\n\n // Helper function to retrieve Gmail email from backend and continue flow\n const retrieveAndContinueWithGoogleEmail = async (username, tempId) => {\n try {\n console.log('📧 Retrieving Gmail email from backend for user:', username || tempId);\n \n // First, try to get email from localStorage (set by oauth-callback.html)\n let gmailEmail = localStorage.getItem('onairos_gmail_email');\n if (gmailEmail) {\n console.log('✅ Gmail email retrieved from localStorage:', gmailEmail);\n handleOAuthSuccess(gmailEmail);\n return;\n }\n\n const sdkConfig = {\n baseUrl: 'https://api2.onairos.uk',\n apiKey: window.onairosApiKey || 'test-key',\n };\n\n // Try to get email from backend\n const emailRes = await fetch(`${sdkConfig.baseUrl}/gmail/get-email`, {\n method: 'POST',\n headers: {\n 'x-api-key': sdkConfig.apiKey,\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n username: username || tempId\n })\n });\n\n if (emailRes.ok) {\n const emailData = await emailRes.json();\n gmailEmail = emailData.email;\n console.log('✅ Gmail email retrieved from backend:', gmailEmail);\n } else {\n console.warn('⚠️ Could not retrieve Gmail email from backend');\n // Last resort: use temp username or prompt user\n gmailEmail = username && username.includes('@') ? username : `${tempId}@gmail.com`;\n console.log('⚠️ Using fallback email:', gmailEmail);\n }\n\n // Continue with email verification flow using Gmail email\n handleOAuthSuccess(gmailEmail);\n\n } catch (error) {\n console.error('❌ Error retrieving Gmail email:', error);\n // Continue anyway with fallback\n handleOAuthSuccess(`${tempId}@gmail.com`);\n }\n };\n\n // Helper function to handle OAuth success (Gmail)\n const handleOAuthSuccess = async (gmailEmail) => {\n try {\n setIsLoading(true);\n console.log('✅ Google OAuth completed successfully, email:', gmailEmail);\n\n // For Gmail SSO we trust Google's email verification and skip the 6‑digit code.\n // We still record the email locally and immediately continue into onboarding.\n const normalizedEmail = (gmailEmail || '').trim().toLowerCase();\n setEmail(normalizedEmail);\n\n // Simulate a successful verification response and jump straight to success → UniversalOnboarding\n setStep('success');\n setIsLoading(false);\n\n setTimeout(() => {\n onSuccess({\n email: normalizedEmail,\n verified: true,\n token: null,\n userName: normalizedEmail.split('@')[0],\n existingUser: false,\n accountInfo: null,\n isNewUser: true,\n flowType: 'onboarding',\n adminMode: false,\n userCreated: true,\n accountDetails: {\n email: normalizedEmail,\n createdAt: new Date().toISOString(),\n ssoProvider: 'gmail'\n }\n });\n }, 400);\n \n } catch (error) {\n console.error('❌ Error handling OAuth success:', error);\n setError('Failed to continue with Google authentication. Please try again.');\n setIsLoading(false);\n }\n };\n\n const handleCodeSubmit = async (e) => {\n e.preventDefault();\n setError('');\n setIsLoading(true);\n\n try {\n if (testMode) {\n // Test mode: Skip API call completely, simulate verification\n console.log('🧪 Test mode: Simulating code verification for:', email, 'with code:', code);\n \n if (code === '123456' || code.length === 6) {\n setStep('success');\n setTimeout(() => {\n // Simulate new user for design testing\n const simulatedResponse = { \n email, \n verified: true, \n token: 'test-token-' + Date.now(),\n userName: email.split('@')[0],\n existingUser: false, // Always simulate new user for full flow testing\n accountInfo: null,\n isNewUser: true,\n flowType: 'onboarding',\n adminMode: false,\n userCreated: true,\n accountDetails: {\n email: email,\n createdAt: new Date().toISOString(),\n testAccount: true\n }\n };\n console.log('🧪 Test mode: Simulated verification successful, user data:', simulatedResponse);\n onSuccess(simulatedResponse);\n }, 600); // Faster for design testing\n } else {\n setError('Invalid code. Use any 6-digit code (e.g., 123456) for testing.');\n setIsLoading(false);\n }\n } else {\n // Production mode: Use real email verification API from schema\n const baseUrl = (typeof window !== 'undefined' && window.onairosBaseUrl) || 'https://api2.onairos.uk';\n const apiKey = (typeof window !== 'undefined' && window.onairosApiKey) || 'ona_VvoHNg1fdCCUa9eBy4Iz3IfvXdgLfMFI7TNcyHLDKEadPogkbjAeE2iDOs6M7Aey';\n \n const response = await fetch(`${baseUrl}/email/verify/confirm`, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'x-api-key': apiKey,\n 'Authorization': `Bearer ${apiKey}`\n },\n body: JSON.stringify({\n email: (email || '').trim().toLowerCase(),\n code: code.trim()\n }),\n });\n\n if (!response.ok) {\n throw new Error('Invalid verification code');\n }\n\n const data = await response.json();\n \n if (!data.success) {\n throw new Error(data.error || 'Verification failed');\n }\n\n console.log('📧 Email verification response:', data);\n\n setStep('success');\n setTimeout(() => {\n // Pass complete API response for flow determination\n onSuccess({ \n email, \n verified: true, \n token: data.token || data.jwtToken,\n userName: data.userName,\n existingUser: data.existingUser,\n accountInfo: data.accountInfo,\n isNewUser: !data.existingUser, // Set based on API response\n flowType: data.existingUser ? 'dataRequest' : 'onboarding',\n adminMode: data.adminMode,\n userCreated: data.userCreated,\n accountDetails: data.accountDetails\n });\n }, 1000);\n }\n } catch (error) {\n console.error('Email verification error:', error);\n setError(error.message || 'Invalid code. Please try again.');\n setIsLoading(false);\n }\n };\n\n const renderEmailStep = () => (\n <div className=\"w-full flex flex-col\" style={{ height: '100%' }}>\n {/* Content - Flexible center area */}\n <div className=\"px-12 pt-16 pb-8 text-center flex-1 flex flex-col\">\n <div className=\"mb-8\">\n <h1 className=\"text-2xl font-bold text-gray-900 mb-2 text-balance leading-tight\">\n Use pre-existing Persona or create a new one in seconds\n </h1>\n <p className=\"text-gray-600 text-base\">Sign in or create an account</p>\n </div>\n\n <div className=\"mb-6\">\n <input\n type=\"email\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n placeholder=\"Enter your email\"\n className=\"w-full max-w-sm mx-auto px-4 py-4 text-base bg-gray-50 border-0 rounded-xl placeholder:text-gray-400 focus:bg-white focus:ring-2 focus:ring-gray-200 outline-none transition-all duration-200\"\n style={{ \n fontFamily: 'Inter, system-ui, sans-serif'\n }}\n required\n />\n </div>\n\n <div className=\"mb-6 text-center\">\n <span className=\"text-gray-500 text-sm\">Or</span>\n </div>\n\n <div className=\"mb-8\">\n <button\n type=\"button\"\n className=\"w-full max-w-sm mx-auto py-4 text-base font-medium rounded-xl border border-gray-200 hover:bg-gray-50 flex items-center justify-center gap-3 bg-transparent transition-colors\"\n style={{ \n fontFamily: 'Inter, system-ui, sans-serif'\n }}\n onClick={handleGoogleAuth}\n >\n <svg className=\"w-5 h-5\" viewBox=\"0 0 24 24\">\n <path\n fill=\"#4285F4\"\n d=\"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z\"\n />\n <path\n fill=\"#34A853\"\n d=\"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z\"\n />\n <path\n fill=\"#FBBC05\"\n d=\"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z\"\n />\n <path\n fill=\"#EA4335\"\n d=\"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z\"\n />\n </svg>\n Continue with Google\n </button>\n </div>\n\n {/* Error Display */}\n {error && (\n <div className=\"mb-6\">\n <p className=\"text-sm text-center\" style={{ color: COLORS.error }}>{error}</p>\n </div>\n )}\n </div>\n\n {/* Continue Button - Fixed at bottom */}\n <div className=\"px-12 pb-8 flex-shrink-0\">\n <button\n className=\"w-full max-w-sm mx-auto bg-gray-900 hover:bg-gray-800 text-white rounded-full py-4 text-base font-medium flex items-center justify-center gap-2 transition-colors disabled:opacity-50\"\n onClick={handleEmailSubmit}\n disabled={isLoading || !email.trim()}\n style={{ \n fontFamily: 'Inter, system-ui, sans-serif'\n }}\n >\n {isLoading ? 'Loading...' : 'Continue'}\n <svg className=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M9 5l7 7-7 7\" />\n </svg>\n </button>\n </div>\n </div>\n );\n\n const renderCodeStep = () => (\n <div className=\"w-full flex flex-col\" style={{ height: '100%' }}>\n {/* Heading - matching VerificationStep.tsx */}\n <div className=\"w-full pt-16 px-12 mb-10 text-center\">\n <h1 \n className=\"font-bold mb-2\"\n style={{ \n fontFamily: 'IBM Plex Sans, system-ui, sans-serif',\n fontWeight: '700',\n fontSize: '24px',\n lineHeight: '32px',\n color: COLORS.textPrimary\n }}\n >\n Enter verification code\n </h1>\n <p \n className=\"mb-2\"\n style={{ \n fontFamily: 'Inter, system-ui, sans-serif',\n fontWeight: '400',\n fontSize: '16px',\n lineHeight: '24px',\n color: COLORS.textSecondary\n }}\n >\n {emailSent ? `We've sent a 6-digit code to ${email}` : `A verification code has been generated for ${email}`}\n </p>\n {!emailSent && (\n <div \n className=\"mb-4 mx-auto max-w-sm px-4 py-3 rounded-lg border\"\n style={{ \n backgroundColor: '#FEF3C7',\n borderColor: '#FCD34D',\n fontFamily: 'Inter, system-ui, sans-serif',\n fontSize: '14px',\n lineHeight: '20px',\n color: '#92400E'\n }}\n >\n <p className=\"font-medium mb-1\">⚠️ Email service unavailable</p>\n <p className=\"text-sm\">\n {emailServiceMessage.includes('testing mode') || emailServiceMessage.includes('server logs') \n ? 'Any 6-digit code will be accepted. Check server logs for the actual code.'\n : 'The verification code was generated but could not be sent. Please check server logs or contact support.'}\n </p>\n </div>\n )}\n </div>\n\n\n {/* Code Input - matching VerificationStep design with individual digit boxes */}\n <div className=\"px-12 mb-6\">\n <div className=\"flex justify-center space-x-3\">\n {Array.from({ length: 6 }, (_, index) => (\n <input\n key={index}\n type=\"text\"\n maxLength=\"1\"\n value={code[index] || ''}\n onChange={(e) => {\n const newCode = code.split('');\n newCode[index] = e.target.value;\n setCode(newCode.join(''));\n \n // Auto-focus next input\n if (e.target.value && index < 5) {\n const nextInput = e.target.parentElement?.children[index + 1];\n if (nextInput) nextInput.focus();\n }\n }}\n onKeyDown={(e) => {\n // Handle backspace to focus previous input\n if (e.key === 'Backspace' && !code[index] && index > 0) {\n const prevInput = e.target.parentElement?.children[index - 1];\n if (prevInput) prevInput.focus();\n }\n }}\n className=\"w-12 h-12 border rounded-lg text-center text-lg font-medium focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none\"\n style={{ \n borderColor: COLORS.border,\n backgroundColor: COLORS.background,\n fontFamily: 'Inter, system-ui, sans-serif'\n }}\n />\n ))}\n </div>\n </div>\n\n {/* Error Display */}\n {error && (\n <div className=\"px-12 mb-6\">\n <p className=\"text-sm text-center\" style={{ color: COLORS.error }}>{error}</p>\n </div>\n )}\n\n {/* Continue Button - positioned right below code inputs */}\n <div className=\"px-12 mb-6\">\n <div className=\"max-w-sm mx-auto\">\n <PrimaryButton\n label=\"Continue\"\n onClick={handleCodeSubmit}\n loading={isLoading}\n disabled={isLoading || code.length !== 6}\n testId=\"verify-code-button\"\n />\n </div>\n </div>\n\n {/* Spacer */}\n <div style={{ flex: 1, minHeight: '20px' }} />\n\n {/* Back to email option */}\n <div className=\"px-12 w-full\">\n <div className=\"max-w-sm mx-auto\">\n <button\n type=\"button\"\n onClick={() => setStep('email')}\n className=\"w-full py-2 px-4 font-medium transition-colors text-sm\"\n style={{ color: COLORS.textSecondary }}\n >\n Use a different email\n </button>\n </div>\n </div>\n </div>\n );\n\n const renderSuccessStep = () => (\n <div className=\"w-full flex flex-col items-center space-y-6 pt-16 px-12\">\n <div \n className=\"flex items-center justify-center w-16 h-16 rounded-full\"\n style={{ backgroundColor: '#D1FAE5' }}\n >\n <Check className=\"w-8 h-8\" style={{ color: COLORS.success }} />\n </div>\n \n <div className=\"text-center space-y-2\">\n <h2 \n className=\"text-xl font-semibold\"\n style={{ color: COLORS.textPrimary }}\n >\n Email verified!\n </h2>\n <p style={{ color: COLORS.textSecondary }}>Setting up your account...</p>\n </div>\n\n <div className=\"w-8 h-8\">\n <div className=\"animate-spin h-8 w-8 border-2 border-blue-600 rounded-full border-t-transparent\"></div>\n </div>\n </div>\n );\n\n return (\n <div className=\"w-full\">\n {step === 'email' && renderEmailStep()}\n {step === 'code' && renderCodeStep()}\n {step === 'success' && renderSuccessStep()}\n </div>\n );\n} \n","import React, { Component } from 'react';\nimport { useLLMConnectorManager } from '../LLMConnectorManager';\n\nclass ChatGPTConnector extends Component {\n constructor(props) {\n super(props);\n this.state = {\n connected: false,\n open: false,\n isConnecting: false,\n };\n this.handleClose = this.handleClose.bind(this);\n this.handleOpen = this.handleOpen.bind(this);\n this.chatGPTConnect = this.chatGPTConnect.bind(this);\n this.setConnected = this.setConnected.bind(this);\n this.setDisconnected = this.setDisconnected.bind(this);\n }\n\n setConnected() {\n this.setState({ connected: true });\n if (this.props.onConnectionChange) {\n this.props.onConnectionChange('ChatGPT', true);\n }\n this.handleClose();\n }\n\n setDisconnected() {\n this.setState({ connected: false });\n if (this.props.onConnectionChange) {\n this.props.onConnectionChange('ChatGPT', false);\n }\n this.handleClose();\n }\n\n handleOpen() {\n this.setState({ open: true });\n }\n\n handleClose() {\n this.setState({ open: false });\n if (this.props.onClose) {\n this.props.onClose();\n }\n }\n\n async chatGPTConnect() {\n // Use the LLM Connector Manager if available, otherwise fallback to old behavior\n const llmManager = this.props.llmConnectorManager;\n \n if (llmManager) {\n // New behavior: Use extension detection\n llmManager.connectToLLM(\n 'chatgpt',\n (platform) => {\n // Success callback\n console.log(`✅ ${platform} connected via extension`);\n this.setConnected();\n },\n (platform, error) => {\n // Error callback\n console.error(`❌ ${platform} connection error:`, error);\n alert(`Failed to connect to ${platform}. ${error}`);\n }\n );\n } else {\n // Fallback: Original behavior for backward compatibility\n this.setState({ isConnecting: true });\n \n try {\n console.log('🤖 Opening ChatGPT in new tab (fallback mode)...');\n \n const chatGPTWindow = window.open('https://chatgpt.com', '_blank');\n \n if (!chatGPTWindow) {\n throw new Error('Popup blocked. Please allow popups for this site.');\n }\n\n setTimeout(() => {\n console.log('✅ ChatGPT connection simulated (fallback)');\n this.setConnected();\n this.setState({ isConnecting: false });\n }, 1000);\n\n } catch (error) {\n console.error('❌ ChatGPT connection error:', error);\n this.setState({ isConnecting: false });\n alert('Failed to open ChatGPT. Please ensure popups are allowed and try again.');\n }\n }\n }\n\n render() {\n const { open = this.props.open || this.state.open } = this.props;\n \n if (!open) return null;\n\n // Bookmarklet code: fully inline so it works with ChatGPT CSP (no external script load)\n const bookmarkletCode = `javascript:(function(){try{var ok=window.confirm('Allow Onairos to export your last 10 ChatGPT conversations to your Onairos account?');if(!ok){console.log('❌ Onairos ChatGPT export cancelled by user.');return;}console.log('✅ Onairos ChatGPT export consent granted. Extracting conversations...');setTimeout(function(){console.log('✅ Export complete! You can now return to your Onairos tab.');if(window.opener&&!window.opener.closed){window.opener.focus();}},1500);}catch(e){console.error('Onairos ChatGPT bookmarklet error:',e);}})();`;\n \n return (\n <>\n <style>{`\n @keyframes gentlePulse {\n 0%, 100% {\n box-shadow: 0 0 0 0 rgba(148, 163, 184, 0.35);\n }\n 50% {\n box-shadow: 0 0 0 10px rgba(148, 163, 184, 0);\n }\n }\n .bookmarklet-button {\n background: rgba(15, 23, 42, 0.85);\n border-radius: 9999px;\n border: 1px solid rgba(255,255,255,0.16);\n backdrop-filter: blur(18px);\n }\n .bookmarklet-button:hover {\n background: rgba(15, 23, 42, 0.92);\n }\n @keyframes fadeInScale {\n 0% { opacity: 0; transform: translateY(8px) scale(0.96); }\n 100% { opacity: 1; transform: translateY(0) scale(1); }\n }\n .chatgpt-modal-card {\n animation: fadeInScale 200ms cubic-bezier(0.16, 1, 0.3, 1);\n }\n .step-circle {\n background: rgba(15, 23, 42, 0.9);\n min-width: 28px;\n width: 28px;\n height: 28px;\n }\n `}</style>\n \n {/* Backdrop (transparent so it feels like a sheet on top of the existing modal) */}\n <div className=\"fixed inset-0 flex items-center justify-center z-50 p-4 pointer-events-none\">\n \n {/* Compact Modal Container */}\n <div className=\"w-full max-w-md pointer-events-auto\">\n <div className=\"chatgpt-modal-card rounded-3xl overflow-hidden shadow-[0_30px_80px_rgba(15,23,42,0.70)] border border-white/10 bg-[radial-gradient(circle_at_top,_rgba(255,255,255,0.22),_transparent_55%),radial-gradient(circle_at_bottom,_rgba(15,23,42,0.9),_rgba(15,23,42,1))] backdrop-blur-3xl\">\n \n {/* Header */}\n <div className=\"relative px-5 py-4 border-b border-white/10 bg-white/10\">\n <button\n onClick={this.handleClose}\n className=\"absolute right-4 top-4 p-1.5 hover:bg-white/20 rounded-full transition-colors\"\n aria-label=\"Close\"\n >\n <svg className=\"w-4 h-4 text-slate-100\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n\n <h2 className=\"text-xl font-semibold text-slate-50 pr-8\">\n Connect ChatGPT\n </h2>\n <p className=\"text-sm text-slate-300 mt-0.5\">\n Three quick steps to import your conversations\n </p>\n \n {/* Privacy Notice */}\n <div className=\"mt-3 flex items-start gap-2 bg-white/12 rounded-2xl px-3 py-2\">\n <svg className=\"w-4 h-4 text-emerald-300 mt-0.5 flex-shrink-0\" fill=\"currentColor\" viewBox=\"0 0 20 20\">\n <path fillRule=\"evenodd\" d=\"M2.166 4.999A11.954 11.954 0 0010 1.944 11.954 11.954 0 0017.834 5c.11.65.166 1.32.166 2.001 0 5.225-3.34 9.67-8 11.317C5.34 16.67 2 12.225 2 7c0-.682.057-1.35.166-2.001zm11.541 3.708a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z\" clipRule=\"evenodd\" />\n </svg>\n <p className=\"text-xs text-slate-100/90 leading-relaxed\">\n <strong className=\"font-semibold\">Private & secure.</strong> We only access your chat history. No one else sees this data.\n </p>\n </div>\n </div>\n\n {/* Steps Content */}\n <div className=\"px-5 py-4 space-y-4\">\n \n {/* Step 1 */}\n <div className=\"flex gap-3\">\n <div className=\"flex-shrink-0\">\n <div className=\"step-circle rounded-full flex items-center justify-center\">\n <span className=\"text-white font-bold text-sm\">1</span>\n </div>\n </div>\n <div className=\"flex-1 pt-0.5\">\n <h3 className=\"text-sm font-semibold text-slate-50 mb-1\">\n Drag this button to your bookmarks bar\n </h3>\n <div className=\"relative inline-block mt-2\">\n <div className=\"absolute inset-0 rounded-full\" style={{ animation: 'gentlePulse 2s ease-in-out infinite' }}></div>\n <a\n href={bookmarkletCode}\n draggable=\"true\"\n onDragStart={(e) => {\n e.dataTransfer.setData('text/plain', bookmarkletCode);\n e.dataTransfer.effectAllowed = 'copy';\n }}\n onClick={(e) => {\n e.preventDefault();\n alert('Please drag this button to your bookmarks bar');\n }}\n className=\"bookmarklet-button relative inline-flex items-center gap-1.5 px-4 py-2 font-medium text-slate-50 cursor-move select-none transition-all hover:scale-[1.03]\"\n >\n <span className=\"text-base\">✨</span>\n <span className=\"text-sm\">Onairos ChatGPT</span>\n </a>\n </div>\n <p className=\"text-xs text-slate-300 mt-2\">\n <kbd className=\"px-1.5 py-0.5 bg-white/10 rounded-full text-[10px] font-mono text-slate-100 border border-white/10\">Ctrl+Shift+B</kbd> to show bookmarks bar\n </p>\n </div>\n </div>\n\n {/* Divider */}\n <div className=\"border-t border-white/10 ml-10\"></div>\n\n {/* Step 2 */}\n <div className=\"flex gap-3\">\n <div className=\"flex-shrink-0\">\n <div className=\"step-circle rounded-full flex items-center justify-center\">\n <span className=\"text-white font-bold text-sm\">2</span>\n </div>\n </div>\n <div className=\"flex-1 pt-0.5\">\n <h3 className=\"text-sm font-semibold text-slate-50 mb-1\">\n Open ChatGPT and log in\n </h3>\n <p className=\"text-xs text-slate-300 mb-2\">\n Make sure you're logged into your ChatGPT account\n </p>\n <button\n onClick={() => {\n window.open('https://chatgpt.com', '_blank');\n }}\n className=\"inline-flex items-center gap-1.5 px-4 py-2 rounded-full bg-emerald-400/90 hover:bg-emerald-300 text-slate-900 text-xs font-medium transition-colors shadow-[0_0_25px_rgba(52,211,153,0.35)]\"\n >\n <svg className=\"w-3.5 h-3.5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14\" />\n </svg>\n Open ChatGPT\n </button>\n </div>\n </div>\n\n {/* Divider */}\n <div className=\"border-t border-white/10 ml-10\"></div>\n\n {/* Step 3 */}\n <div className=\"flex gap-3\">\n <div className=\"flex-shrink-0\">\n <div className=\"step-circle rounded-full flex items-center justify-center\">\n <span className=\"text-white font-bold text-sm\">3</span>\n </div>\n </div>\n <div className=\"flex-1 pt-0.5\">\n <h3 className=\"text-sm font-semibold text-slate-50 mb-1\">\n Click the bookmark on ChatGPT\n </h3>\n <p className=\"text-xs text-slate-300\">\n Click the <strong>\"Onairos ChatGPT\"</strong> bookmark you added. We'll securely import your last 10 conversations.\n </p>\n </div>\n </div>\n\n </div>\n\n {/* Footer */}\n <div className=\"px-5 py-4 bg-white/5 border-t border-white/10\">\n <button\n onClick={() => {\n this.setConnected();\n }}\n className=\"w-full px-4 py-2.5 rounded-full font-medium text-slate-900 text-sm transition-all hover:scale-[1.01] active:scale-[0.99] bg-slate-100/90 hover:bg-white shadow-[0_10px_30px_rgba(15,23,42,0.45)] border border-white/40\"\n >\n Got it! ✓\n </button>\n </div>\n \n </div>\n </div>\n </div>\n </>\n );\n }\n}\n\nexport default ChatGPTConnector;\n","import React, { useEffect, useId, useState, useRef } from 'react';\nimport Lottie from 'lottie-react';\nimport personaAnim from '../../public/persona-anim.json';\nimport ChatGPTConnector from './connectors/ChatGPTConnector';\nconst chatgptIcon = 'https://anushkasirv.sirv.com/openai.png';\nconst claudeIcon = 'https://anushkasirv.sirv.com/claude-color.png';\nconst geminiIcon = 'https://anushkasirv.sirv.com/gemini-color.png';\nconst grokIcon = 'https://anushkasirv.sirv.com/grok.png';\n\nconst sdkConfig = {\n apiKey: process.env.REACT_APP_ONAIROS_API_KEY || 'ona_VvoHNg1fdCCUa9eBy4Iz3IfvXdgLfMFI7TNcyHLDKEadPogkbjAeE2iDOs6M7Aey',\n baseUrl: process.env.REACT_APP_ONAIROS_BASE_URL || 'https://api2.onairos.uk',\n sdkType: 'web',\n enableHealthMonitoring: true,\n enableAutoRefresh: true,\n enableConnectionValidation: true,\n};\n\nconst fadeSlideInKeyframes = `\n@keyframes fadeSlideIn {\n from { opacity: 0; transform: translateX(var(--slide-x)); }\n to { opacity: 1; transform: translateX(0); }\n}\n`;\n\nexport default function UniversalOnboarding({ onComplete }) {\n const lottieRef = useRef(null);\n const lastFrameRef = useRef(0);\n const rafRef = useRef(null);\n\n const [connectedAccounts, setConnectedAccounts] = useState({});\n const [isConnecting, setIsConnecting] = useState(false);\n const [connectingPlatform, setConnectingPlatform] = useState(null);\n const [selected, setSelected] = useState('Instagram');\n const [currentPage, setCurrentPage] = useState(1);\n const [showChatGPTModal, setShowChatGPTModal] = useState(false);\n\n // swipe state\n const touchStartX = useRef(0);\n const touchDeltaX = useRef(0);\n\n const [vh, setVh] = useState(() => (typeof window !== 'undefined' ? window.innerHeight : 800));\n useEffect(() => {\n const onResize = () => setVh(window.innerHeight);\n window.addEventListener('resize', onResize);\n return () => window.removeEventListener('resize', onResize);\n }, []);\n\n const FOOTER_H = 88;\n\n // persona stays as requested (background, unchanged placement)\n const personaSide = Math.min(vh * 0.52, 500);\n const PERSONA_TOP = 96;\n\n // icon layout (restore tighter spacing on page 1; place the band lower)\n const SLOT = Math.max(56, Math.min(64, Math.floor(vh * 0.07)));\n const CIRCLE = 42;\n const GAP_PAGE1 = 12;\n const GAP_PAGE2 = 20;\n const ACTIVE_SCALE = vh < 760 ? 1.12 : 1.22;\n\n const ICONS_H = 84;\n const ICONS_TOP_OFFSET = Math.max(180, Math.min(240, Math.round(vh * 0.28))); // ~28vh, clamped for all screens\n\n const igGradId = useId();\n\n // ---- official brand SVGs (compact, consistent viewboxes) ----\n const Brand = {\n ChatGPT: <img src={chatgptIcon} alt=\"ChatGPT\" style={{ width: 20, height: 20, objectFit: 'contain' }} />,\n Claude: <img src={claudeIcon} alt=\"Claude\" style={{ width: 20, height: 20, objectFit: 'contain' }} />,\n Gemini: <img src={geminiIcon} alt=\"Gemini\" style={{ width: 20, height: 20, objectFit: 'contain' }} />,\n Grok: <img src={grokIcon} alt=\"Grok\" style={{ width: 20, height: 20, objectFit: 'contain' }} />,\n Instagram: (\n <svg viewBox=\"0 0 24 24\" aria-hidden>\n <defs>\n <radialGradient id={igGradId} cx=\"0.5\" cy=\"1\" r=\"1\">\n <stop offset=\"0%\" stopColor=\"#FDBB4B\"/>\n <stop offset=\"40%\" stopColor=\"#E95950\"/>\n <stop offset=\"70%\" stopColor=\"#BC2A8D\"/>\n <stop offset=\"100%\" stopColor=\"#4C68D7\"/>\n </radialGradient>\n </defs>\n <path fill={`url(#${igGradId})`} d=\"M7 2h10a5 5 0 0 1 5 5v10a5 5 0 0 1-5 5H7a5 5 0 0 1-5-5V7a5 5 0 0 1 5-5zm5 5.5A4.5 4.5 0 1 0 16.5 12 4.5 4.5 0 0 0 12 7.5zm0 7.4A2.9 2.9 0 1 1 14.9 12 2.9 2.9 0 0 1 12 14.9Zm5.35-8.25a1.15 1.15 0 1 0 1.15 1.15 1.15 1.15 0 0 0-1.15-1.15Z\"/>\n </svg>\n ),\n YouTube: (\n <svg viewBox=\"0 0 24 24\" aria-hidden>\n <path fill=\"#FF0000\" d=\"M22.54 6.42a3 3 0 0 0-2.11-2.12C18.49 3.75 12 3.75 12 3.75s-6.49 0-8.43.55A3 3 0 0 0 1.46 6.42 31.63 31.63 0 0 0 1 12a31.63 31.63 0 0 0 .46 5.58 3 3 0 0 0 2.11 2.12C5.51 20.25 12 20.25 12 20.25s6.49 0 8.43-.55a3 3 0 0 0 2.11-2.12A31.63 31.63 0 0 0 23 12a31.63 31.63 0 0 0-.46-5.58z\"/>\n <path fill=\"#FFF\" d=\"M10 8.75v6.5l6-3.25-6-3.25z\"/>\n </svg>\n ),\n Reddit: (\n <svg viewBox=\"0 0 24 24\" aria-hidden>\n <circle cx=\"12\" cy=\"12\" r=\"12\" fill=\"#FF4500\"/>\n <circle cx=\"8.75\" cy=\"12.5\" r=\"1.25\" fill=\"#FFF\"/>\n <circle cx=\"15.25\" cy=\"12.5\" r=\"1.25\" fill=\"#FFF\"/>\n <path fill=\"#FFF\" d=\"M7.9 15c.8.8 2.3 1.05 4.1 1.05S15.3 15.8 16.1 15c.2-.2.2-.5 0-.7-.2-.2-.5-.2-.7 0-.6.6-1.9.85-3.4.85S9.3 14.9 8.7 14.3c-.2-.2-.5-.2-.7 0-.2.2-.2.5 0 .7z\"/>\n </svg>\n ),\n LinkedIn: (\n <svg viewBox=\"0 0 24 24\" aria-hidden>\n <rect x=\"2\" y=\"2\" width=\"20\" height=\"20\" rx=\"3\" fill=\"#0A66C2\"/>\n <rect x=\"5\" y=\"9\" width=\"3\" height=\"10\" fill=\"#FFF\"/>\n <circle cx=\"6.5\" cy=\"6.5\" r=\"1.5\" fill=\"#FFF\"/>\n <path fill=\"#FFF\" d=\"M16.8 19H13.9v-5c0-1.2-.5-1.8-1.4-1.8-.9 0-1.6.6-1.6 1.8V19H8V9h2.8v1.3c.5-.8 1.4-1.5 2.7-1.5 2 0 3.3 1.3 3.3 3.7V19z\"/>\n </svg>\n ),\n Twitter: (\n <svg viewBox=\"0 0 24 24\" aria-hidden>\n <path fill=\"#1DA1F2\" d=\"M23.643 4.937c-.835.37-1.732.62-2.675.733.962-.576 1.7-1.49 2.048-2.578-.9.534-1.897.922-2.958 1.13-.85-.904-2.06-1.47-3.4-1.47-2.572 0-4.658 2.086-4.658 4.66 0 .364.042.718.12 1.06-3.873-.195-7.304-2.05-9.602-4.868-.4.69-.63 1.49-.63 2.342 0 1.616.823 3.043 2.072 3.878-.764-.025-1.482-.234-2.11-.583v.06c0 2.257 1.605 4.14 3.737 4.568-.392.106-.803.162-1.227.162-.3 0-.593-.028-.877-.082.593 1.85 2.313 3.198 4.352 3.234-1.595 1.25-3.604 1.995-5.786 1.995-.376 0-.747-.022-1.112-.065 2.062 1.323 4.51 2.093 7.14 2.093 8.57 0 13.255-7.098 13.255-13.254 0-.2-.005-.402-.014-.602.91-.658 1.7-1.477 2.323-2.41z\"/>\n </svg>\n ),\n };\n\n const aiLinks = {\n ChatGPT: 'https://chat.openai.com',\n Claude: 'https://claude.ai',\n Gemini: 'https://gemini.google.com',\n Grok: 'https://grok.x.ai',\n };\n\n const descriptions = {\n ChatGPT: <>We analyze your <strong className=\"font-semibold\">prompt style</strong> and <strong className=\"font-semibold\">chat history</strong> to match your writing and thinking patterns.</>,\n Claude: <>We learn your <strong className=\"font-semibold\">document workflow</strong> and <strong className=\"font-semibold\">reasoning preferences</strong> to tune output format and detail.</>,\n Gemini: <>We study your <strong className=\"font-semibold\">search patterns</strong> and <strong className=\"font-semibold\">multimodal usage</strong> to improve response accuracy.</>,\n Grok: <>We adapt to your <strong className=\"font-semibold\">X posting style</strong> and <strong className=\"font-semibold\">meme literacy</strong> to match your tone.</>,\n Twitter: <>We analyze your <strong className=\"font-semibold\">tweets</strong> and <strong className=\"font-semibold\">interests</strong> to understand your preferences.</>,\n YouTube: <>We study your <strong className=\"font-semibold\">watch history</strong> and <strong className=\"font-semibold\">interactions</strong> to learn your interests.</>,\n Reddit: <>We examine your <strong className=\"font-semibold\">search history</strong> and <strong className=\"font-semibold\">discussions</strong> to understand your interests.</>,\n Instagram: <>We analyze your <strong className=\"font-semibold\">photos</strong> and <strong className=\"font-semibold\">interactions</strong> to learn visual preferences.</>,\n LinkedIn: <>We study your <strong className=\"font-semibold\">professional graph</strong> and <strong className=\"font-semibold\">content</strong> to understand career interests.</>,\n };\n\n const allPlatforms = [\n // Page 1\n { name: 'Instagram', connector: 'instagram', icon: Brand.Instagram },\n { name: 'YouTube', connector: 'youtube', icon: Brand.YouTube },\n { name: 'ChatGPT', connector: 'chatgpt', icon: Brand.ChatGPT, directLink: aiLinks.ChatGPT },\n // Page 2\n { name: 'Claude', connector: 'claude', icon: Brand.Claude, directLink: aiLinks.Claude },\n { name: 'Gemini', connector: 'gemini', icon: Brand.Gemini, directLink: aiLinks.Gemini },\n { name: 'Twitter', connector: 'twitter', icon: Brand.Twitter },\n // Page 3\n { name: 'LinkedIn', connector: 'linkedin', icon: Brand.LinkedIn },\n { name: 'Reddit', connector: 'reddit', icon: Brand.Reddit },\n { name: 'Grok', connector: 'grok', icon: Brand.Grok, directLink: aiLinks.Grok },\n ];\n\n const getPlatformsForPage = (page) => {\n if (page === 1) return allPlatforms.slice(0, 3);\n if (page === 2) return allPlatforms.slice(3, 6);\n return allPlatforms.slice(6);\n };\n\n const platforms = getPlatformsForPage(currentPage);\n\n useEffect(() => {\n // Load OAuth platform returns\n const p = localStorage.getItem('onairos_oauth_platform');\n if (p) {\n localStorage.removeItem('onairos_oauth_platform');\n localStorage.removeItem('onairos_oauth_return');\n setConnectedAccounts((s) => ({ ...s, [p]: true }));\n }\n \n // Load persisted connected accounts from user data\n try {\n const userData = JSON.parse(localStorage.getItem('onairosUser') || '{}');\n if (userData.connectedAccounts && Array.isArray(userData.connectedAccounts)) {\n // Convert array to object format\n const accountsObj = userData.connectedAccounts.reduce((acc, platform) => {\n acc[platform] = true;\n return acc;\n }, {});\n setConnectedAccounts(accountsObj);\n }\n } catch (error) {\n console.warn('Failed to load persisted connected accounts:', error);\n }\n }, []);\n\n async function connectToPlatform(name) {\n const plat = allPlatforms.find((p) => p.name === name);\n if (!plat) return false;\n try {\n // For direct-link platforms (no OAuth), mark connected immediately and return\n if (plat.directLink) {\n setConnectedAccounts((s) => ({ ...s, [name]: true }));\n setIsConnecting(false);\n setConnectingPlatform(null);\n return true;\n }\n\n // Immediately reflect selection in UI without spinner while starting OAuth\n setConnectedAccounts((s) => ({ ...s, [name]: true }));\n setIsConnecting(true);\n setConnectingPlatform(name);\n \n // BYPASS: Twitter endpoint is 404, so just keep toggle ON without API call\n if (name === 'Twitter') {\n console.log('🐦 Twitter: Bypassing API call (endpoint not available), keeping toggle ON');\n setIsConnecting(false);\n setConnectingPlatform(null);\n return true;\n }\n \n const username = localStorage.getItem('username') || (JSON.parse(localStorage.getItem('onairosUser') || '{}')?.email) || 'user@example.com';\n\n const res = await fetch(`${sdkConfig.baseUrl}/${plat.connector}/authorize`, {\n method: 'POST', headers: { 'x-api-key': sdkConfig.apiKey, 'Content-Type': 'application/json' },\n body: JSON.stringify({ session: { username } }),\n });\n if (!res.ok) throw new Error('auth failed');\n const data = await res.json();\n\n const candidates = (\n {\n youtube: ['youtubeURL','youtubeUrl','youtube_url'],\n linkedin: ['linkedinURL','linkedinUrl','linkedin_url'],\n reddit: ['redditURL','redditUrl','reddit_url'],\n pinterest: ['pinterestURL','pinterestUrl','pinterest_url'],\n instagram: ['instagramURL','instagramUrl','instagram_url'],\n github: ['githubURL','githubUrl','github_url'],\n facebook: ['facebookURL','facebookUrl','facebook_url'],\n gmail: ['gmailURL','gmailUrl','gmail_url'],\n }[plat.connector]\n ) || [`${plat.connector}URL`, `${plat.connector}Url`, `${plat.connector}_url`, 'platformURL', 'authUrl', 'url'];\n\n let oauthUrl = null; for (const k of candidates) if (data[k]) { oauthUrl = data[k]; break; }\n if (!oauthUrl) throw new Error('no url');\n\n const popup = window.open(oauthUrl, `${plat.connector}_oauth`, 'width=500,height=600,scrollbars=yes,resizable=yes,status=no,location=no,toolbar=no,menubar=no');\n if (!popup) throw new Error('popup blocked');\n\n let touched = false; const it = setInterval(() => {\n try { if (popup.location && popup.location.hostname === 'onairos.uk') { touched = true; popup.close(); } } catch { if (!touched) touched = true; }\n try { if (popup.closed) { clearInterval(it); setIsConnecting(false); setConnectingPlatform(null); } } catch {}\n }, 800);\n\n setTimeout(() => { try { if (!popup.closed && touched) popup.close(); } catch {} }, 10000);\n setTimeout(() => { if (!popup.closed) { popup.close(); clearInterval(it); setIsConnecting(false); setConnectingPlatform(null); } }, 300000);\n return true;\n } catch {\n // On failure, revert the optimistic toggle\n setConnectedAccounts((s) => ({ ...s, [name]: false }));\n setIsConnecting(false); setConnectingPlatform(null); return false;\n }\n }\n\n const handleSwitch = async (name) => {\n if (isConnecting && connectingPlatform !== name) return;\n const on = !!connectedAccounts[name];\n if (on) setConnectedAccounts((s) => ({ ...s, [name]: false }));\n else await connectToPlatform(name);\n };\n\n const connectedCount = Object.values(connectedAccounts).filter(Boolean).length;\n\n useEffect(() => {\n if (!lottieRef.current) return;\n const totalFrames = (personaAnim.op || 0) - (personaAnim.ip || 0);\n const TOTAL_PLATFORMS = 9; // Total number of platforms across all pages\n const progress = connectedCount / TOTAL_PLATFORMS;\n const target = Math.max(0, Math.floor(progress * totalFrames));\n const start = lastFrameRef.current || 0;\n const duration = 420; const startTs = performance.now();\n const step = (now) => {\n const t = Math.min(1, (now - startTs) / duration);\n const eased = t < 0.5 ? 2*t*t : -1 + (4 - 2*t)*t;\n const frame = Math.floor(start + (target - start) * eased);\n lottieRef.current.goToAndStop(frame, true);\n if (t < 1) rafRef.current = requestAnimationFrame(step); else lastFrameRef.current = target;\n };\n if (rafRef.current) cancelAnimationFrame(rafRef.current);\n rafRef.current = requestAnimationFrame(step);\n return () => { if (rafRef.current) cancelAnimationFrame(rafRef.current); };\n }, [connectedCount]);\n\n // swipe handlers for smooth paging\n const onTouchStart = (e) => { touchStartX.current = e.touches[0].clientX; touchDeltaX.current = 0; };\n const onTouchMove = (e) => { touchDeltaX.current = e.touches[0].clientX - touchStartX.current; };\n const onTouchEnd = () => {\n const dx = touchDeltaX.current; const THRESH = 40;\n if (dx < -THRESH && currentPage < 3) setCurrentPage(currentPage + 1);\n else if (dx > THRESH && currentPage > 1) setCurrentPage(currentPage - 1);\n };\n\n return (\n <div className=\"w-full h-full relative\" style={{ height: Math.min('90vh', Math.max(600, Math.min(720, vh * 0.9))), minHeight: 580, maxHeight: 720 }}>\n <style>{fadeSlideInKeyframes}</style>\n\n {/* persona as background (unchanged) */}\n <div aria-hidden style={{ position: 'absolute', left: '50%', top: PERSONA_TOP, transform: 'translateX(-50%)', width: personaSide, height: personaSide, zIndex: 0, pointerEvents: 'none', opacity: 0.95 }}>\n <div className=\"overflow-hidden rounded-[28px] w-full h-full\">\n <Lottie lottieRef={lottieRef} animationData={personaAnim} autoplay={false} loop={false} style={{ width: '100%', height: '100%' }} />\n </div>\n </div>\n\n {/* content above persona */}\n <div className=\"relative z-10 h-full flex flex-col\">\n {/* header (unchanged visuals) */}\n <div className=\"px-6 pt-16 pb-4 text-center flex-shrink-0\">\n <h1 className=\"text-2xl font-bold text-gray-900 mb-2 leading-tight\">Connect App Data</h1>\n <p className=\"text-gray-600 text-base\">More Connections, Better Personalization.</p>\n </div>\n\n {/* Spacer to push content down */}\n <div className=\"flex-1\" style={{ minHeight: 40 }} />\n\n {/* icons band */}\n <div className=\"px-6 flex-shrink-0\" style={{ height: ICONS_H }}>\n <div className=\"h-full flex items-center justify-center\">\n <div\n className=\"grid w-full box-border relative\"\n onTouchStart={onTouchStart}\n onTouchMove={onTouchMove}\n onTouchEnd={onTouchEnd}\n style={{\n gridAutoFlow: 'column',\n gridTemplateColumns: `repeat(${platforms.length}, minmax(0,1fr))`,\n columnGap: currentPage === 1 ? GAP_PAGE1 : GAP_PAGE2,\n alignItems: 'center',\n justifyItems: 'center',\n paddingInline: 8,\n overflow: 'hidden',\n }}\n >\n {platforms.map((p, idx) => {\n const on = !!connectedAccounts[p.name];\n const busy = false; // keep icon static visually per request\n const isSel = selected === p.name;\n const shift = (currentPage === 1 ? idx : idx - 2) * 14;\n return (\n <div key={p.name} className=\"transition-all duration-300\" style={{ opacity: 0, transform: `translateX(${shift}px)`, animation: 'fadeSlideIn 0.28s forwards', ['--slide-x']: `${shift}px` }}>\n <button\n type=\"button\"\n onClick={() => { \n setSelected(p.name);\n if (p.name === 'ChatGPT') {\n // Show ChatGPT connector modal\n setShowChatGPTModal(true);\n } else if (p.directLink) {\n // For direct link platforms (AI tools), connect immediately and open link\n if (!connectedAccounts[p.name]) {\n setConnectedAccounts((s) => ({ ...s, [p.name]: true }));\n }\n window.open(p.directLink, '_blank');\n } else {\n handleSwitch(p.name);\n }\n }}\n className=\"relative grid place-items-center outline-none\"\n style={{ width: SLOT, height: SLOT }}\n title={p.name}\n >\n <div className={`rounded-full border-3 transition-all duration-150 ease-out flex items-center justify-center shadow-lg ${on ? 'border-blue-600 bg-white text-black shadow-blue-500/70' : 'border-gray-300 hover:border-gray-400 bg-white text-black'}`}\n style={{ width: CIRCLE, height: CIRCLE, transform: `scale(${isSel ? ACTIVE_SCALE : 1})`, transformOrigin: 'center' }}>\n <div className=\"flex items-center justify-center\" style={{ width: 20, height: 20 }}>\n {p.icon}\n </div>\n </div>\n </button>\n </div>\n );\n })}\n </div>\n </div>\n </div>\n\n {/* dots navigation (no numbers) - directly under icons, above card */}\n <div className=\"relative flex items-center justify-center gap-4 select-none flex-shrink-0\" style={{ marginTop: 20, marginBottom: 16, zIndex: 25 }}>\n {[1,2,3].map(n => (\n <button key={n} onClick={() => setCurrentPage(n)} aria-label={`page ${n}`} className=\"relative\" style={{ width: 12, height: 12 }}>\n <span className={`block rounded-full ${currentPage === n ? 'bg-blue-600 scale-110' : 'bg-gray-300'} transition-transform`} style={{ width: 12, height: 12 }} />\n </button>\n ))}\n </div>\n\n {/* info sheet — positioned using flex */}\n <div className=\"px-6 flex-shrink-0\" style={{ marginBottom: 24, zIndex: 20 }}>\n <div className=\"mx-auto rounded-2xl bg-white shadow-sm border border-gray-200 px-4 py-2.5\" style={{ width: 'min(680px,92%)', maxHeight: vh * 0.2 }}>\n <div className=\"flex items-center justify-between\">\n <div className=\"text-gray-900 font-medium\">{selected}</div>\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={!!connectedAccounts[selected]}\n aria-label={`toggle ${selected}`}\n onClick={() => handleSwitch(selected)}\n disabled={isConnecting && connectingPlatform !== selected}\n className={`relative inline-flex items-center transition-colors disabled:opacity-50 ${connectedAccounts[selected] ? 'bg-black' : 'bg-gray-200'} rounded-full`}\n style={{ width: 56, height: 32 }}\n >\n <span className=\"absolute bg-white rounded-full shadow\" style={{ width: 24, height: 24, transform: connectedAccounts[selected] ? 'translateX(26px)' : 'translateX(6px)', transition: 'transform 160ms ease' }} />\n </button>\n </div>\n <div className=\"mt-3\">\n <div className=\"rounded-2xl bg-gray-50 text-gray-700 text-sm leading-6 px-4 py-3 shadow-[inset_0_0_0_1px_rgba(0,0,0,0.04)]\">\n {descriptions[selected] || null}\n </div>\n </div>\n </div>\n </div>\n\n {/* footer — anchored at bottom using flex */}\n <div className=\"px-6 flex-shrink-0\" style={{ paddingBottom: 16, background: 'linear-gradient(to top, white 60%, rgba(255,255,255,0.9) 85%, rgba(255,255,255,0))', zIndex: 30 }}>\n <div className=\"w-full bg-gray-900 hover:bg-gray-800 text-white rounded-full py-4 text-base font-medium flex items-center justify-center gap-2 cursor-pointer transition-colors\" onClick={() => {\n const connected = Object.entries(connectedAccounts).filter(([, v]) => v).map(([k]) => k);\n onComplete?.({ connectedAccounts: connected, totalConnections: connected.length });\n }}>\n Update\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\"><path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M9 5l7 7-7 7\" /></svg>\n </div>\n <div onClick={() => onComplete?.({ connectedAccounts: [], totalConnections: 0 })} className=\"w-full text-gray-600 text-base font-medium py-2 text-center cursor-pointer hover:text-gray-800 transition-colors\">Skip</div>\n </div>\n </div>\n\n {/* ChatGPT Connector Modal */}\n <ChatGPTConnector\n open={showChatGPTModal}\n onClose={() => setShowChatGPTModal(false)}\n onConnectionChange={(platform, connected) => {\n if (connected) {\n setConnectedAccounts((s) => ({ ...s, [platform]: true }));\n }\n setShowChatGPTModal(false);\n }}\n />\n </div>\n );\n}","import React, { useState, useEffect } from 'react';\n\nexport default function PinSetup({ onComplete, onBack, userEmail }) {\n const [pin, setPin] = useState('');\n const [pinRequirements, setPinRequirements] = useState({\n length: false,\n uppercase: false,\n number: false,\n });\n\n // Check PIN requirements\n useEffect(() => {\n setPinRequirements({\n length: pin.length >= 6,\n uppercase: /[A-Z]/.test(pin),\n number: /\\d/.test(pin),\n });\n }, [pin]);\n\n const allRequirementsMet = pinRequirements.length && pinRequirements.uppercase && pinRequirements.number;\n\n const handleSubmit = () => {\n if (allRequirementsMet) {\n onComplete({\n pin: pin, // This should be hashed in production\n pinCreated: true,\n timestamp: new Date().toISOString()\n });\n }\n };\n\n return (\n <div className=\"w-full h-full flex flex-col\" style={{ height: '100%', minHeight: 0 }}>\n {/* Content - Flexible center area */}\n <div className=\"px-6 pt-16 flex-1 flex flex-col\" style={{ minHeight: 0, overflow: 'hidden' }}>\n <div className=\"mb-6 flex-shrink-0\">\n <h1 className=\"text-2xl font-bold text-gray-900 mb-2\">Create a PIN</h1>\n <p className=\"text-gray-600 text-base\">A PIN so only you have the access to your data</p>\n </div>\n\n <div className=\"mb-6 flex-shrink-0\">\n <input\n type=\"password\"\n value={pin}\n onChange={(e) => setPin(e.target.value)}\n className=\"w-full px-4 py-4 border-2 border-gray-300 rounded-xl text-center text-lg font-medium focus:border-gray-900 focus:outline-none bg-white\"\n placeholder=\"Enter your PIN\"\n maxLength={20}\n style={{\n color: '#000000',\n WebkitTextFillColor: '#000000',\n backgroundColor: '#FFFFFF'\n }}\n />\n </div>\n\n {/* Scrollable requirements list */}\n <div className=\"flex-1 overflow-y-auto\" style={{ minHeight: 0 }}>\n <div className=\"space-y-3 pb-4\">\n <p className=\"text-gray-900 font-medium mb-4\">Your PIN must:</p>\n <div className=\"space-y-3\">\n <div className=\"flex items-center gap-3\">\n <div\n className={`w-5 h-5 rounded-full border-2 ${pinRequirements.length ? \"border-green-500 bg-green-500\" : \"border-gray-300 bg-white\"}`}\n >\n {pinRequirements.length && (\n <svg className=\"w-3 h-3 text-white m-0.5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M5 13l4 4L19 7\" />\n </svg>\n )}\n </div>\n <span className=\"text-gray-700\">Be at least 6 characters in length.</span>\n </div>\n <div className=\"flex items-center gap-3\">\n <div\n className={`w-5 h-5 rounded-full border-2 ${pinRequirements.uppercase ? \"border-green-500 bg-green-500\" : \"border-gray-300 bg-white\"}`}\n >\n {pinRequirements.uppercase && (\n <svg className=\"w-3 h-3 text-white m-0.5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M5 13l4 4L19 7\" />\n </svg>\n )}\n </div>\n <span className=\"text-gray-700\">Contain an uppercase letter.</span>\n </div>\n <div className=\"flex items-center gap-3\">\n <div\n className={`w-5 h-5 rounded-full border-2 ${pinRequirements.number ? \"border-green-500 bg-green-500\" : \"border-gray-300 bg-white\"}`}\n >\n {pinRequirements.number && (\n <svg className=\"w-3 h-3 text-white m-0.5\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M5 13l4 4L19 7\" />\n </svg>\n )}\n </div>\n <span className=\"text-gray-700\">Contain a number.</span>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n {/* Buttons - Fixed at bottom */}\n <div className=\"px-6 pb-6 pt-4 flex-shrink-0 space-y-3\" style={{ minHeight: 'auto' }}>\n <div\n className={`w-full rounded-full py-4 text-base font-medium flex items-center justify-center gap-2 transition-colors ${\n allRequirementsMet \n ? \"bg-gray-900 hover:bg-gray-800 text-white cursor-pointer\" \n : \"bg-gray-300 text-gray-500 cursor-not-allowed\"\n }`}\n onClick={allRequirementsMet ? handleSubmit : undefined}\n >\n Continue\n <svg className=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M9 5l7 7-7 7\" />\n </svg>\n </div>\n </div>\n </div>\n );\n} ","import React, { useState } from \"react\";\n\n/* -------------------------\n ICON COMPONENTS\n-------------------------- */\nconst Icon = ({ type }) => {\n const base = \"w-4 h-4 text-gray-700\";\n\n switch (type) {\n case \"User\":\n return (\n <svg className={base} viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4\n 1.79-4 4 1.79 4 4 4zm0 2c-2.67\n 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z\"/>\n </svg>\n );\n case \"Memory\":\n return (\n <svg className={base} viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M12 2C6.48 2 2 6.48 2\n 12s4.48 10 10 10 10-4.48 10-10S17.52\n 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z\"/>\n </svg>\n );\n case \"Grid3X3\":\n return (\n <svg className={base} viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M3 13h8V3H3v10zm0 8h8v-6H3v6zm10\n 0h8V11h-8v10zm0-18v6h8V3h-8z\"/>\n </svg>\n );\n case \"Brain\":\n return (\n <svg className={base} viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <path d=\"M11.99 2C6.47 2 2 6.48 2\n 12s4.47 10 9.99 10C17.52\n 22 22 17.52 22 12S17.52\n 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8\n 8-8 8 3.58 8 8-3.58 8-8\n 8zm3.5-9c.83 0 1.5-.67\n 1.5-1.5S16.33 8 15.5\n 8 14 8.67 14 9.5s.67 1.5\n 1.5 1.5zm-7 0c.83 0 1.5-.67\n 1.5-1.5S9.33 8 8.5\n 8 7 8.67 7 9.5s.67 1.5\n 1.5 1.5zm3.5 6.5c2.33\n 0 4.31-1.46 5.11-3.5H6.89c.8\n 2.04 2.78 3.5 5.11 3.5z\"/>\n </svg>\n );\n default:\n return null;\n }\n};\n\n/* -------------------------\n TOGGLE (soft apple style)\n-------------------------- */\nconst DataTypeToggle = ({ dataType, enabled, onToggle }) => {\n const handle = () => {\n if (dataType.required) return;\n onToggle(dataType.id, !enabled);\n };\n\n return (\n <button\n onClick={handle}\n className=\"\n w-full flex items-center justify-between\n py-2.5 px-2\n bg-white/40 backdrop-blur-sm\n hover:bg-white/70\n transition rounded-xl shadow-sm\n \"\n >\n <div className=\"flex items-center gap-3\">\n <div className=\"w-7 h-7 flex items-center justify-center rounded-full bg-gray-100\">\n <Icon type={dataType.icon} />\n </div>\n <span className=\"text-[14px] text-gray-900 font-medium\">\n {dataType.name}\n </span>\n </div>\n\n <div\n className={`w-5 h-5 rounded-md border flex items-center justify-center shadow-sm\n transition\n ${enabled\n ? \"bg-gray-900 border-gray-900\"\n : \"bg-white border-gray-300\"\n }`}\n >\n {enabled && (\n <svg className=\"w-3 h-3 text-white\" viewBox=\"0 0 20 20\" fill=\"currentColor\">\n <path d=\"M16.707 5.293a1 1 0 010\n 1.414l-8 8a1 1 0 01-1.414\n 0l-4-4a1 1 0 011.414-1.414L8\n 12.586l7.293-7.293a1 1 0\n 011.414 0z\"/>\n </svg>\n )}\n </div>\n </button>\n );\n};\n\n/* -------------------------\n MAIN COMPONENT\n-------------------------- */\n\nconst options = [\n { id: \"basic\", name: \"Basic Profile\", icon: \"User\", required: true },\n { id: \"rawMemories\", name: \"Raw Memory Data\", icon: \"Memory\" },\n { id: \"preferences\", name: \"User Preferences\", icon: \"Grid3X3\" },\n { id: \"personality\", name: \"Personality Traits\", icon: \"Brain\" },\n];\n\nconst DataRequest = ({ appName = \"My App\", onComplete, connectedPlatforms = [] }) => {\n const [selected, setSelected] = useState({\n basic: true,\n rawMemories: false,\n preferences: false,\n personality: false,\n });\n\n const [freq, setFreq] = useState(\"weekly\");\n\n const toggle = (id, val) =>\n setSelected((p) => ({ ...p, [id]: val }));\n\n const selectedCount = Object.values(selected).filter(Boolean).length;\n\n // Ensure we actually show connected platforms even if prop isn't passed\n const getConnected = () => {\n // If array provided, use it\n if (Array.isArray(connectedPlatforms) && connectedPlatforms.length > 0) return connectedPlatforms;\n // If object provided, map truthy keys\n if (connectedPlatforms && typeof connectedPlatforms === \"object\" && !Array.isArray(connectedPlatforms)) {\n return Object.entries(connectedPlatforms).filter(([_, v]) => Boolean(v)).map(([k]) => k);\n }\n // Fallback: try localStorage onairosUser\n try {\n const u = JSON.parse(localStorage.getItem(\"onairosUser\") || \"{}\");\n if (u && u.connectedAccounts && typeof u.connectedAccounts === \"object\") {\n return Object.entries(u.connectedAccounts).filter(([_, v]) => Boolean(v)).map(([k]) => k);\n }\n } catch {}\n return [];\n };\n const platforms = getConnected();\n\n const freqToPercent = (f) => (f === \"once\" ? 0 : f === \"weekly\" ? 50 : 100);\n const handleRailClick = (e) => {\n const rect = e.currentTarget.getBoundingClientRect();\n const x = Math.max(0, Math.min(rect.width, e.clientX - rect.left));\n const ratio = x / rect.width;\n if (ratio < 1 / 3) setFreq(\"once\");\n else if (ratio < 2 / 3) setFreq(\"weekly\");\n else setFreq(\"daily\");\n };\n\n return (\n <div className=\"flex flex-col h-full max-h-[90vh] bg-white/70 backdrop-blur-2xl rounded-3xl overflow-hidden\">\n\n {/* CONTENT */}\n <div className=\"flex-1 overflow-y-auto px-6 pt-10 pb-4\">\n\n {/* ICONS */}\n <div className=\"flex justify-center items-center gap-4 mb-6\">\n <div className=\"w-12 h-12 rounded-2xl bg-white shadow flex items-center justify-center\">\n <Icon type=\"User\" />\n </div>\n <svg className=\"w-4 h-4 text-gray-400\" fill=\"none\" stroke=\"currentColor\">\n <path strokeWidth={2} strokeLinecap=\"round\" d=\"M9 5l7 7-7 7\"/>\n </svg>\n <div className=\"w-12 h-12 rounded-2xl bg-white shadow flex items-center justify-center\">\n <span className=\"text-xl font-serif font-bold\">B</span>\n </div>\n </div>\n\n {/* TITLE */}\n <div className=\"text-center mb-8\">\n <h1 className=\"text-[24px] md:text-[26px] font-semibold text-gray-900 leading-tight tracking-tight\">\n {appName} wants to personalize your experience\n </h1>\n <p className=\"text-[13px] text-gray-500 mt-1\">choose what to share</p>\n </div>\n\n {/* TOGGLES */}\n <div className=\"grid grid-cols-2 gap-4 mb-10\">\n {options.map((opt) => (\n <DataTypeToggle\n key={opt.id}\n dataType={opt}\n enabled={selected[opt.id]}\n onToggle={toggle}\n />\n ))}\n </div>\n\n {/* FREQUENCY PANEL */}\n <div className=\"p-5 rounded-3xl bg-white/50 backdrop-blur-md border border-black/5 shadow-sm\">\n <div className=\"flex justify-between items-center mb-3\">\n <span className=\"text-sm font-medium text-gray-900\">\n How often can {appName} receive updates?\n </span>\n <span className=\"text-[11px] text-gray-500\">\n {freq === \"once\"\n ? \"one-time only\"\n : freq === \"weekly\"\n ? \"once per week\"\n : \"once per day\"}\n </span>\n </div>\n\n {/* SLIDER: subtle rail, monochrome progress, click-to-set */}\n <div\n className=\"relative h-2.5 rounded-full bg-gray-200/90 overflow-hidden mb-4 border border-black/5 shadow-inner cursor-pointer\"\n onClick={handleRailClick}\n >\n <div\n className=\"absolute h-full transition-all rounded-full\"\n style={{\n width: `${freqToPercent(freq)}%`,\n background: \"linear-gradient(90deg, rgba(31,41,55,0.95) 0%, rgba(107,114,128,0.9) 60%, rgba(209,213,219,0.85) 100%)\",\n }}\n />\n {/* Tick marks for 3 stops */}\n <span className=\"absolute left-0 top-1/2 -translate-y-1/2 w-[2px] h-3 bg-black/10\" />\n <span className=\"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[2px] h-3 bg-black/10\" />\n <span className=\"absolute right-0 top-1/2 -translate-y-1/2 w-[2px] h-3 bg-black/10\" />\n {/* Thumb indicator (sleek) */}\n <span\n className=\"absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-4.5 h-4.5 rounded-full bg-white border border-black/20 shadow-md\"\n style={{\n left: `${freqToPercent(freq)}%`,\n }}\n />\n </div>\n\n <div className=\"grid grid-cols-3 text-center text-[12px] font-medium\">\n <button onClick={() => setFreq(\"once\")} className=\"text-gray-700\">1× only</button>\n <button onClick={() => setFreq(\"weekly\")} className=\"text-gray-900 font-semibold\">1× weekly</button>\n <button onClick={() => setFreq(\"daily\")} className=\"text-gray-700\">1× daily</button>\n </div>\n\n <p className=\"text-[11px] text-gray-500 mt-3 leading-snug\">\n This only controls update frequency; It does not grant more access.\n </p>\n </div>\n\n {/* CONNECTED PLATFORMS (appears at the bottom of content; no overlap with footer) */}\n {platforms && platforms.length > 0 ? (\n <div className=\"mt-6 mb-2 rounded-2xl bg-white/60 backdrop-blur border border-black/5 p-3\">\n <div className=\"text-center text-xs text-gray-500 mb-2\">Connected Platforms</div>\n <div className=\"flex justify-center items-center gap-2 flex-wrap\">\n {platforms.map((platform, index) => {\n const logoMap = {\n Instagram: 'https://upload.wikimedia.org/wikipedia/commons/a/a5/Instagram_icon.png',\n YouTube: 'https://upload.wikimedia.org/wikipedia/commons/0/09/YouTube_full-color_icon_%282017%29.svg',\n LinkedIn: 'https://upload.wikimedia.org/wikipedia/commons/c/ca/LinkedIn_logo_initials.png',\n Reddit: 'https://www.redditinc.com/assets/images/site/reddit-logo.png',\n Pinterest: 'https://upload.wikimedia.org/wikipedia/commons/0/08/Pinterest-logo.png',\n GitHub: 'https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png',\n Facebook: 'https://upload.wikimedia.org/wikipedia/commons/5/51/Facebook_f_logo_%282019%29.svg',\n Gmail: 'https://upload.wikimedia.org/wikipedia/commons/7/7e/Gmail_icon_%282020%29.svg',\n Twitter: 'https://upload.wikimedia.org/wikipedia/commons/6/6f/Logo_of_Twitter.svg',\n ChatGPT: 'https://anushkasirv.sirv.com/openai.png',\n Claude: 'https://anushkasirv.sirv.com/claude-color.png',\n Gemini: 'https://anushkasirv.sirv.com/gemini-color.png',\n Grok: 'https://anushkasirv.sirv.com/grok.png'\n };\n const src = logoMap[platform] || '';\n return (\n <img\n key={`${platform}-${index}`}\n src={src}\n alt={platform}\n title={platform}\n className=\"w-6 h-6 rounded-md shadow-sm hover:scale-110 transition\"\n onError={(e) => { e.currentTarget.style.display = 'none'; }}\n />\n );\n })}\n </div>\n </div>\n ) : null}\n </div>\n\n {/* FOOTER */}\n <div className=\"px-6 py-5 bg-white/80 backdrop-blur border-t border-black/5\">\n <button\n className=\"w-full rounded-full py-3 bg-gray-900 text-white text-sm font-medium shadow-sm flex items-center justify-center gap-2 mb-3\"\n disabled={selectedCount === 0}\n onClick={() => {\n if (selectedCount === 0) return;\n onComplete?.({\n approved: Object.keys(selected).filter(id => selected[id]),\n freq,\n });\n }}\n >\n Accept & Continue\n <svg className=\"w-4 h-4\" fill=\"none\" stroke=\"currentColor\">\n <path strokeWidth={2} strokeLinecap=\"round\" d=\"M9 5l7 7-7 7\"/>\n </svg>\n </button>\n\n <button\n className=\"w-full rounded-full py-3 bg-gray-100 text-gray-700 text-sm font-medium shadow-sm\"\n onClick={() => {\n onComplete?.({\n approved: [],\n freq,\n declined: true,\n });\n }}\n >\n Decline\n </button>\n </div>\n </div>\n );\n};\n\nexport default DataRequest;\n","import React, { useState, useEffect } from 'react';\nimport { COLORS } from '../theme/colors.js';\n\nexport default function TrainingComponent({ onComplete, userEmail, appName = 'App', testMode = false }) {\n const [currentStep, setCurrentStep] = useState(0);\n const [progress, setProgress] = useState(0);\n const [isComplete, setIsComplete] = useState(false);\n\n const steps = [\n {\n title: 'Setting up your personal AI',\n description: 'Initializing your secure data model',\n icon: '🤖',\n duration: testMode ? 800 : 2000 // Much faster in test mode\n },\n {\n title: 'Processing your connections',\n description: 'Analyzing your social media patterns',\n icon: '🔗',\n duration: testMode ? 600 : 2500\n },\n {\n title: 'Training your model',\n description: 'Building your personalized insights',\n icon: '🧠',\n duration: testMode ? 700 : 3000\n },\n {\n title: 'Finalizing setup',\n description: 'Preparing your Onairos experience',\n icon: '✨',\n duration: testMode ? 500 : 2000\n }\n ];\n\n useEffect(() => {\n let interval;\n let stepTimeout;\n\n if (currentStep < steps.length) {\n const stepDuration = steps[currentStep].duration;\n const stepProgress = 100 / steps.length;\n\n // Update progress gradually\n interval = setInterval(() => {\n setProgress(prev => {\n const newProgress = prev + (stepProgress / (stepDuration / 100));\n return Math.min(newProgress, (currentStep + 1) * stepProgress);\n });\n }, 100);\n\n // Move to next step after duration\n stepTimeout = setTimeout(() => {\n if (currentStep < steps.length - 1) {\n setCurrentStep(prev => prev + 1);\n } else {\n setIsComplete(true);\n const completionDelay = testMode ? 400 : 1000; // Faster completion in test mode\n \n if (testMode) {\n console.log('🧪 Test mode: Training simulation completed');\n }\n \n setTimeout(() => {\n onComplete({\n trainingComplete: true,\n timestamp: new Date().toISOString(),\n userEmail: userEmail,\n appName: appName,\n testMode: testMode,\n simulatedTraining: testMode\n });\n }, completionDelay);\n }\n }, stepDuration);\n }\n\n return () => {\n if (interval) clearInterval(interval);\n if (stepTimeout) clearTimeout(stepTimeout);\n };\n }, [currentStep, onComplete, userEmail, appName]);\n\n return (\n <div className=\"w-full flex flex-col items-center space-y-8\">\n <div className=\"text-center\">\n <div \n className=\"w-20 h-20 rounded-full flex items-center justify-center mx-auto mb-4\"\n style={{\n background: `linear-gradient(135deg, ${COLORS.info}, #8B5CF6)`\n }}\n >\n <div className=\"text-3xl\">\n {isComplete ? '🎉' : steps[currentStep]?.icon}\n </div>\n </div>\n <h2 \n className=\"text-2xl font-bold mb-2\"\n style={{ color: COLORS.textPrimary }}\n >\n {isComplete ? 'All set!' : steps[currentStep]?.title}\n </h2>\n <p style={{ color: COLORS.textSecondary }}>\n {isComplete \n ? 'Your personal AI is ready to use' \n : steps[currentStep]?.description\n }\n </p>\n </div>\n\n {/* Progress Bar */}\n <div className=\"w-full\">\n <div \n className=\"flex justify-between text-sm mb-2\"\n style={{ color: COLORS.textSecondary }}\n >\n <span>Progress</span>\n <span>{Math.round(progress)}%</span>\n </div>\n <div \n className=\"w-full rounded-full h-2\"\n style={{ backgroundColor: COLORS.borderLight }}\n >\n <div \n className=\"h-2 rounded-full transition-all duration-300 ease-out\"\n style={{ \n width: `${progress}%`,\n background: `linear-gradient(90deg, ${COLORS.info}, #8B5CF6)`\n }}\n />\n </div>\n </div>\n\n {/* Steps Indicator */}\n <div className=\"flex justify-center space-x-2\">\n {steps.map((_, index) => (\n <div\n key={index}\n className=\"w-3 h-3 rounded-full transition-all duration-300\"\n style={{\n backgroundColor: index <= currentStep ? COLORS.info : COLORS.border\n }}\n />\n ))}\n </div>\n\n {/* Current Step Details */}\n <div \n className=\"p-4 rounded-lg w-full\"\n style={{ backgroundColor: COLORS.backgroundSecondary }}\n >\n <div className=\"flex items-center space-x-3\">\n <div \n className=\"w-8 h-8 rounded-full flex items-center justify-center\"\n style={{ backgroundColor: '#DBEAFE' }}\n >\n <div className=\"text-sm\">\n {isComplete ? '✅' : steps[currentStep]?.icon}\n </div>\n </div>\n <div>\n <h3 \n className=\"font-medium\"\n style={{ color: COLORS.textPrimary }}\n >\n {isComplete ? 'Training Complete' : `Step ${currentStep + 1} of ${steps.length}`}\n </h3>\n <p \n className=\"text-sm\"\n style={{ color: COLORS.textSecondary }}\n >\n {isComplete \n ? 'Your Onairos experience is ready' \n : steps[currentStep]?.description\n }\n </p>\n </div>\n </div>\n </div>\n\n {/* App Info */}\n <div className=\"text-center\">\n <p \n className=\"text-sm\"\n style={{ color: COLORS.textSecondary }}\n >\n Setting up for <span className=\"font-medium\">{appName}</span>\n </p>\n {userEmail && (\n <p \n className=\"text-xs mt-1\"\n style={{ color: COLORS.textMuted }}\n >\n {userEmail}\n </p>\n )}\n </div>\n </div>\n );\n} ","import React, { useState, useEffect } from \"react\";\nimport Lottie from 'lottie-react';\nimport rainAnim from '../../public/rain-anim.json';\n\nexport default function LoadingScreen({ onComplete }) {\n const [currentStep, setCurrentStep] = useState(0);\n const [dotCount, setDotCount] = useState(0);\n\n const loadingStates = [\n { message: \"Validating PIN and continuing training\", progress: 20 },\n { message: \"Uploading model to secure storage\", progress: 40 },\n { message: \"Running test inference\", progress: 60 },\n { message: \"Storing results in databases\", progress: 80 },\n { message: \"Complete!\", progress: 100 },\n ];\n\n useEffect(() => {\n const stateInterval = setInterval(() => {\n setCurrentStep((prev) => {\n const nextStep = prev + 1;\n if (nextStep >= loadingStates.length) {\n // Loading complete, call onComplete after a short delay\n setTimeout(() => {\n onComplete();\n }, 1000);\n return prev; // Keep at last step\n }\n return nextStep;\n });\n }, 3000); // Change state every 3 seconds\n\n return () => clearInterval(stateInterval);\n }, [loadingStates.length, onComplete]);\n\n useEffect(() => {\n const dotInterval = setInterval(() => {\n setDotCount((prev) => (prev + 1) % 4); // 0, 1, 2, 3 dots\n }, 500); // Change dots every 500ms\n\n return () => clearInterval(dotInterval);\n }, []);\n\n const currentState = loadingStates[currentStep];\n\n return (\n <div className=\"fixed inset-0 bg-gray-500 bg-opacity-50 flex items-center justify-center p-6\" style={{ zIndex: 2147483647, pointerEvents: 'auto' }}>\n {/* Modal - Full height from bottom */}\n <div className=\"bg-white rounded-3xl w-full max-w-lg mx-auto shadow-2xl overflow-hidden flex flex-col\" style={{ maxWidth: '500px', height: '90vh' }}>\n {/* Header */}\n <div className=\"px-6 pt-6 pb-4 flex-shrink-0\">\n </div>\n\n {/* Content - Rain animation and loading state */}\n <div className=\"flex-1 flex flex-col px-6\">\n {/* Rain Animation */}\n <div className=\"flex-1 flex items-center justify-center\">\n <div style={{ width: '100%', maxWidth: '400px', aspectRatio: '1' }}>\n <Lottie\n animationData={rainAnim}\n loop={true}\n autoplay={true}\n style={{ width: '100%', height: '100%' }}\n />\n </div>\n </div>\n\n {/* Loading State - Positioned at bottom */}\n <div className=\"flex-shrink-0 pb-12\">\n <div className=\"text-center\">\n <h1 className=\"font-bold text-gray-900 leading-tight mb-6\" style={{ fontSize: 'clamp(16px, 4vw, 20px)' }}>\n {currentState.message}\n {currentState.message !== \"Complete!\" && (\n <span className=\"inline-block w-8 text-left\">{\".\".repeat(dotCount)}</span>\n )}\n </h1>\n\n <div className=\"mx-auto\" style={{ width: 'clamp(200px, 50vw, 300px)' }}>\n <div className=\"w-full h-2 bg-gray-200 rounded-full\">\n <div\n className=\"h-2 bg-gray-900 rounded-full transition-all duration-1000 ease-out\"\n style={{ width: `${currentState.progress}%` }}\n ></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n {/* Bottom spacing */}\n <div className=\"h-20 flex-shrink-0\"></div>\n </div>\n </div>\n );\n}\n","/**\n * Response formatter utility for Onairos SDK\n * Converts array-based responses to dictionary format for better developer experience\n */\n\n// Standard 16 personality types in order that the API returns them\nexport const PERSONALITY_TYPES = [\n 'Analyst',\n 'Diplomat', \n 'Sentinel',\n 'Explorer',\n 'Architect',\n 'Logician',\n 'Commander',\n 'Debater',\n 'Advocate',\n 'Mediator',\n 'Protagonist',\n 'Campaigner',\n 'Logistician',\n 'Defender',\n 'Executive',\n 'Consul'\n];\n\n// Standard trait categories that might be returned\nexport const TRAIT_CATEGORIES = [\n 'Openness',\n 'Conscientiousness',\n 'Extraversion',\n 'Agreeableness',\n 'Neuroticism'\n];\n\n/**\n * Formats API response to include both array and dictionary formats\n * @param {Object} apiResponse - Raw API response from Onairos\n * @param {Object} options - Formatting options\n * @param {boolean} options.includeDictionary - Whether to include dictionary format (default: true)\n * @param {boolean} options.includeArray - Whether to include original array format (default: true)\n * @returns {Object} Formatted response with both formats\n */\nexport function formatOnairosResponse(apiResponse, options = {}) {\n const { includeDictionary = true, includeArray = true } = options;\n \n if (!apiResponse) {\n return apiResponse;\n }\n\n const formatted = { ...apiResponse };\n\n // Handle personality scores if present\n if (apiResponse.InferenceResult?.traits || apiResponse.traits || apiResponse.scores) {\n const scores = apiResponse.InferenceResult?.traits || apiResponse.traits || apiResponse.scores;\n \n if (Array.isArray(scores) && scores.length >= 16) {\n if (includeDictionary) {\n // Create personality dictionary\n const personalityDict = {};\n PERSONALITY_TYPES.forEach((type, index) => {\n personalityDict[type] = scores[index];\n });\n \n // Add to formatted response\n if (formatted.InferenceResult) {\n formatted.InferenceResult.personalityDict = personalityDict;\n } else {\n formatted.personalityDict = personalityDict;\n }\n }\n \n if (!includeArray) {\n // Remove array format if not requested\n if (formatted.InferenceResult?.traits) {\n delete formatted.InferenceResult.traits;\n }\n if (formatted.traits) {\n delete formatted.traits;\n }\n if (formatted.scores) {\n delete formatted.scores;\n }\n }\n }\n }\n\n // Handle trait data if present (for preferences/traits)\n if (apiResponse.traitResult || apiResponse.traits) {\n const traits = apiResponse.traitResult || apiResponse.traits;\n \n if (Array.isArray(traits) && includeDictionary) {\n const traitDict = {};\n TRAIT_CATEGORIES.forEach((category, index) => {\n if (traits[index] !== undefined) {\n traitDict[category] = traits[index];\n }\n });\n \n formatted.traitDict = traitDict;\n }\n }\n\n return formatted;\n}\n\n/**\n * Legacy formatter for backward compatibility\n * Converts scores array to personality dictionary only\n * @param {Array} scores - Array of personality scores\n * @returns {Object} Dictionary with personality type names as keys\n */\nexport function formatPersonalityScores(scores) {\n if (!Array.isArray(scores) || scores.length < 16) {\n console.warn('Invalid scores array provided to formatPersonalityScores');\n return {};\n }\n\n const personalityDict = {};\n PERSONALITY_TYPES.forEach((type, index) => {\n personalityDict[type] = scores[index];\n });\n \n return personalityDict;\n}\n\n/**\n * Get personality type names in order\n * @returns {Array} Array of personality type names\n */\nexport function getPersonalityTypes() {\n return [...PERSONALITY_TYPES];\n}\n\n/**\n * Get trait category names in order \n * @returns {Array} Array of trait category names\n */\nexport function getTraitCategories() {\n return [...TRAIT_CATEGORIES];\n} ","import React from 'react';\nimport { COLORS } from '../../theme/colors.js';\n\n// Standardized page layout component with white background\nconst PageLayout = ({\n children,\n title,\n subtitle,\n icon,\n showHeader = true,\n showCloseButton = false,\n onClose,\n onBack,\n showBackButton = false,\n className = '',\n contentClassName = '',\n centerContent = true,\n style = {},\n ...props\n}) => {\n const layoutStyle = {\n backgroundColor: COLORS.background,\n minHeight: '100%',\n width: '100%',\n display: 'flex',\n flexDirection: 'column',\n ...style\n };\n\n const headerStyle = {\n position: 'sticky',\n top: 0,\n backgroundColor: COLORS.background,\n zIndex: 10,\n padding: 'clamp(8px, 2vw, 16px) clamp(16px, 4vw, 32px) clamp(6px, 1.5vw, 12px)'\n };\n\n const contentStyle = {\n flex: 1,\n padding: 'clamp(16px, 4vw, 32px)',\n display: 'flex',\n flexDirection: 'column',\n overflow: 'auto',\n minHeight: 0, // Allow flex item to shrink below content size\n ...(centerContent && {\n alignItems: 'center',\n justifyContent: 'flex-start'\n })\n };\n\n const titleStyle = {\n fontFamily: 'Inter, system-ui, sans-serif',\n fontSize: 'clamp(20px, 5vw, 28px)',\n fontWeight: '700',\n color: COLORS.textPrimary,\n margin: '0 0 clamp(6px, 1.5vw, 12px) 0',\n textAlign: centerContent ? 'center' : 'left',\n lineHeight: '1.2'\n };\n\n const subtitleStyle = {\n fontFamily: 'Inter, system-ui, sans-serif',\n fontSize: 'clamp(14px, 3.5vw, 18px)',\n fontWeight: '400',\n color: COLORS.textSecondary,\n margin: '0 0 clamp(20px, 5vw, 40px) 0',\n textAlign: centerContent ? 'center' : 'left',\n lineHeight: '1.5'\n };\n\n const iconStyle = {\n width: 'clamp(40px, 8vw, 56px)',\n height: 'clamp(40px, 8vw, 56px)',\n margin: '0 auto clamp(16px, 4vw, 32px)',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n fontSize: 'clamp(20px, 5vw, 28px)'\n };\n\n return (\n <div \n className={`onairos-page-layout ${className}`}\n style={layoutStyle}\n {...props}\n >\n {/* Header with navigation */}\n {showHeader && (\n <div style={headerStyle}>\n <div className=\"flex items-center justify-between\">\n {/* Back button */}\n {showBackButton && onBack && (\n <button\n onClick={onBack}\n className=\"flex items-center justify-center w-8 h-8 rounded-full hover:bg-gray-100 transition-colors\"\n aria-label=\"Go back\"\n >\n <span style={{ fontSize: '16px', color: COLORS.textPrimary }}>←</span>\n </button>\n )}\n\n\n {/* Close button */}\n {showCloseButton && onClose && (\n <button\n onClick={onClose}\n className=\"flex items-center justify-center w-8 h-8 rounded-full hover:bg-gray-100 transition-colors\"\n aria-label=\"Close\"\n >\n <span style={{ fontSize: '16px', color: COLORS.textPrimary }}>×</span>\n </button>\n )}\n </div>\n </div>\n )}\n\n {/* Main content area */}\n <div \n className={`onairos-page-content ${contentClassName}`}\n style={contentStyle}\n >\n {/* Icon */}\n {icon && (\n <div style={iconStyle}>\n {typeof icon === 'string' ? <span>{icon}</span> : icon}\n </div>\n )}\n\n {/* Title */}\n {title && (\n <h1 style={titleStyle}>\n {title}\n </h1>\n )}\n\n {/* Subtitle */}\n {subtitle && (\n <p style={subtitleStyle}>\n {subtitle}\n </p>\n )}\n\n {/* Page content */}\n {children}\n </div>\n </div>\n );\n};\n\n// Modal wrapper component for overlay-style pages\nconst ModalPageLayout = ({\n children,\n visible = true,\n onClose,\n onBackdropClick,\n backdropStyle = {},\n modalStyle = {},\n ...pageLayoutProps\n}) => {\n if (!visible) return null;\n\n const backdropStyles = {\n position: 'fixed',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: 'rgba(0, 0, 0, 0.5)',\n zIndex: 2147483647,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n transition: 'opacity 200ms ease',\n willChange: 'opacity',\n ...backdropStyle\n };\n\n const modalStyles = {\n backgroundColor: COLORS.background,\n borderTopLeftRadius: '24px',\n borderTopRightRadius: '24px',\n borderBottomLeftRadius: '24px',\n borderBottomRightRadius: '24px',\n height: '90vh',\n width: '100%',\n maxWidth: '500px',\n boxShadow: '0 -10px 40px rgba(0, 0, 0, 0.3)',\n overflow: 'hidden',\n display: 'flex',\n flexDirection: 'column',\n transform: 'translateY(0)',\n transition: 'transform 220ms ease, opacity 220ms ease',\n willChange: 'transform, opacity',\n ...modalStyle\n };\n\n const handleBackdropClick = (e) => {\n if (e.target === e.currentTarget) {\n if (onBackdropClick) {\n onBackdropClick();\n } else if (onClose) {\n onClose();\n }\n }\n };\n\n return (\n <div style={backdropStyles} onClick={handleBackdropClick}>\n <div style={modalStyles}>\n <PageLayout\n showHeader={true}\n showCloseButton={true}\n onClose={onClose}\n {...pageLayoutProps}\n >\n {children}\n </PageLayout>\n </div>\n </div>\n );\n};\n\nexport { ModalPageLayout };\nexport default PageLayout; ","import React, { useEffect, useState } from 'react';\nimport WelcomeScreen from './components/WelcomeScreen.jsx';\nimport EmailAuth from './components/EmailAuth.js';\nimport UniversalOnboarding from './components/UniversalOnboarding.jsx';\nimport PinSetup from './components/PinSetup.js';\nimport DataRequest from './components/DataRequest.js';\nimport TrainingComponent from './components/TrainingComponent.jsx';\nimport LoadingScreen from './components/LoadingScreen.jsx';\nimport { formatOnairosResponse } from './utils/responseFormatter.js';\nimport { ModalPageLayout } from './components/ui/PageLayout.jsx';\n\nexport function OnairosButton({\n requestData, \n webpageName, \n inferenceData = null, \n onComplete = null, \n autoFetch = true, // Auto-enabled for seamless testing experience\n testMode = false, // Production mode by default - set to true for testing\n proofMode = false, \n textLayout = 'below', \n textColor = 'white',\n login = false,\n buttonType = 'pill',\n loginReturn = null,\n loginType = 'signIn',\n visualType = 'full',\n appIcon = null,\n enableTraining = true,\n formatResponse = true,\n responseFormat = { includeDictionary: true, includeArray: true },\n priorityPlatform = null, // Platform to prioritize (e.g., 'gmail', 'pinterest', 'linkedin')\n rawMemoriesOnly = false, // Show only LLM connections when true\n rawMemoriesConfig = null // Configuration for RAW memories collection\n}) {\n\n const [showOverlay, setShowOverlay] = useState(false);\n const [currentFlow, setCurrentFlow] = useState('welcome'); // 'welcome' | 'email' | 'onboarding' | 'pin' | 'dataRequest' (training is within onboarding)\n const [userData, setUserData] = useState(null);\n const [error, setError] = useState(null);\n\n // Check for existing user session\n useEffect(() => {\n const checkExistingSession = () => {\n // In test mode, always start fresh to see the full flow\n if (testMode) {\n console.log('🧪 Test mode: Starting fresh flow, clearing any cached user data');\n localStorage.removeItem('onairosUser');\n setCurrentFlow('welcome');\n return;\n }\n \n const savedUser = localStorage.getItem('onairosUser');\n if (savedUser) {\n try {\n const user = JSON.parse(savedUser);\n setUserData(user);\n // If user has completed onboarding and PIN setup, go directly to data request\n if (user.onboardingComplete && user.pinCreated) {\n setCurrentFlow('dataRequest');\n } else if (user.verified && !user.onboardingComplete) {\n setCurrentFlow('onboarding');\n } else if (user.onboardingComplete && !user.pinCreated) {\n setCurrentFlow('pin');\n }\n } catch (error) {\n console.error('Error parsing saved user data:', error);\n localStorage.removeItem('onairosUser');\n }\n }\n };\n\n checkExistingSession();\n }, [testMode]);\n\n const openTerminal = async () => {\n try {\n console.log('🔥 openTerminal called - resetting flow');\n console.log('🔥 testMode prop:', testMode);\n console.log('🔥 window.onairosApiKey:', window.onairosApiKey);\n // ALWAYS reset flow on open to start fresh every time\n setCurrentFlow('welcome');\n setUserData(null);\n try { localStorage.removeItem('onairosUser'); } catch {}\n setShowOverlay(true);\n } catch (error) {\n console.error('Error in openTerminal:', error);\n }\n };\n\n const handleCloseOverlay = () => {\n setShowOverlay(false);\n setError(null);\n // Reset flow and session so next open starts fresh\n setCurrentFlow('welcome');\n try { localStorage.removeItem('onairosUser'); } catch {}\n setUserData(null);\n };\n\n // Handle clicks on the backdrop to close modal\n const handleBackdropClick = (e) => {\n if (e.target === e.currentTarget) {\n handleCloseOverlay();\n }\n };\n\n const handleWelcomeContinue = () => {\n console.log('🔥 Welcome screen continue clicked');\n setCurrentFlow('email');\n };\n\n const handleEmailAuthSuccess = (authData) => {\n console.log('🔥 Email auth successful:', authData);\n console.log('🔧 User State:', {\n isNewUser: authData.isNewUser,\n userState: authData.userState,\n flowType: authData.flowType,\n existingUser: authData.existingUser,\n hasAccountInfo: !!authData.accountInfo\n });\n\n // Save identity-bearing JWT immediately (email/id/userId/sub)\n try {\n const candidate = authData.jwtToken || authData.token || authData.accessToken;\n if (candidate) {\n const base64 = candidate.split('.')[1];\n if (base64) {\n const payload = JSON.parse(decodeURIComponent(atob(base64).split('').map(c => '%'+('00'+c.charCodeAt(0).toString(16)).slice(-2)).join('')));\n if (payload && (payload.email || payload.id || payload.userId || payload.sub)) {\n try { localStorage.setItem('onairos_user_token', candidate); } catch {}\n console.log('✅ [OnairosButton] Identity JWT saved from email auth');\n } else {\n console.warn('⚠️ [OnairosButton] Email auth returned minimal token (no id/email)');\n }\n }\n }\n } catch (e) {\n console.warn('⚠️ [OnairosButton] Failed to parse/save email auth token');\n }\n \n // Determine flow based on API response - more explicit checking\n const isNewUser = authData.isNewUser === true || \n authData.existingUser === false || \n authData.flowType === 'onboarding' || \n authData.userState === 'new' ||\n !authData.accountInfo; // No account info means new user\n \n console.log('🔍 Flow determination:', {\n finalDecision: isNewUser ? 'NEW USER → onboarding (data connectors)' : 'EXISTING USER → dataRequest (data permissions)',\n reasoning: {\n isNewUser: authData.isNewUser,\n existingUserFalse: authData.existingUser === false,\n flowTypeOnboarding: authData.flowType === 'onboarding',\n noAccountInfo: !authData.accountInfo\n }\n });\n \n const newUserData = {\n ...authData,\n verified: true,\n onboardingComplete: !isNewUser, // New users need onboarding, returning users have completed it\n pinCreated: !isNewUser // Assume returning users have PIN, new users need to create it\n };\n \n setUserData(newUserData);\n localStorage.setItem('onairosUser', JSON.stringify(newUserData));\n \n // Flow decision logic - prioritize new user detection\n if (isNewUser) {\n console.log('🚀 NEW USER detected → Starting onboarding flow (data connectors page)');\n setCurrentFlow('onboarding');\n } else {\n console.log('👋 EXISTING USER detected → Going directly to data request (data permissions page)');\n setCurrentFlow('dataRequest');\n }\n };\n\n const handleOnboardingComplete = (onboardingData) => {\n console.log('Onboarding completed:', onboardingData);\n const updatedUserData = {\n ...userData,\n onboardingComplete: true,\n connectedAccounts: onboardingData.connectedAccounts || []\n };\n setUserData(updatedUserData);\n localStorage.setItem('onairosUser', JSON.stringify(updatedUserData));\n setCurrentFlow('pin');\n };\n\n const handlePinSetupComplete = async (pinData) => {\n console.log('PIN setup completed:', pinData);\n const updatedUserData = {\n ...userData,\n ...pinData,\n pinCreated: true\n };\n setUserData(updatedUserData);\n localStorage.setItem('onairosUser', JSON.stringify(updatedUserData));\n \n // 🔥 FIX: Don't trigger training here - wait for user to approve data request\n console.log('✅ PIN created - moving to data request (training will start after approval)');\n \n // Go directly to data request - user must approve before training starts\n setCurrentFlow('dataRequest');\n };\n\n const handleLoadingComplete = () => {\n setCurrentFlow('dataRequest');\n };\n\n const handleTrainingComplete = (trainingResult) => {\n console.log('🎓 Training completed:', trainingResult);\n const updatedUserData = {\n ...userData,\n trainingCompleted: true,\n ...trainingResult\n };\n setUserData(updatedUserData);\n localStorage.setItem('onairosUser', JSON.stringify(updatedUserData));\n \n // Move to data request after training\n setCurrentFlow('dataRequest');\n };\n\n const handleDataRequestComplete = async (requestResult) => {\n console.log('🔥 OnairosButton: Data request completed:', requestResult);\n \n // Update user data with request result\n const updatedUserData = {\n ...userData,\n lastDataRequest: requestResult\n };\n setUserData(updatedUserData);\n localStorage.setItem('onairosUser', JSON.stringify(updatedUserData));\n\n // Handle data fetching if autoFetch is enabled\n let finalResult = requestResult;\n \n if (autoFetch && requestResult.approved?.length > 0) {\n console.log('🚀 Auto-fetching data from Onairos API...');\n \n try {\n // 1. Get the API URL from the backend\n const urlResponse = await fetch('https://api2.onairos.uk/getAPIurlMobile', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n Info: {\n appId: webpageName,\n account: userData?.email || userData?.username,\n confirmations: requestResult.approved.map(id => ({ data: id === 'personality' ? 'Large' : id === 'basic' ? 'Basic' : id })),\n EncryptedUserPin: userData?.EncryptedUserPin || 'pending_pin_integration',\n storage: 's3',\n proofMode: proofMode\n }\n })\n });\n\n const urlData = await urlResponse.json();\n console.log('🔗 API URL received:', urlData.apiUrl);\n\n if (urlData.apiUrl && urlData.token) {\n // 2. Fetch the actual data\n // Determine method based on endpoint (onairos-wrapped is GET/POST, others usually POST)\n const isWrapped = webpageName === 'onairos-wrapped';\n const method = isWrapped ? 'GET' : 'POST';\n \n console.log(`📡 Fetching data from ${urlData.apiUrl} (${method})...`);\n \n const dataResponse = await fetch(urlData.apiUrl, {\n method: method,\n headers: {\n 'Authorization': `Bearer ${urlData.token}`,\n 'Content-Type': 'application/json'\n },\n // Only send body for POST\n body: method === 'POST' ? JSON.stringify({\n email: userData?.email,\n includeLlmData: requestResult.approved.includes('rawMemories')\n }) : undefined\n });\n\n const apiResponse = await dataResponse.json();\n console.log('📦 Data received:', apiResponse);\n\n // Merge into result\n finalResult = {\n ...requestResult,\n apiResponse: apiResponse, // Raw response\n token: urlData.token, // Token used\n apiUrl: urlData.apiUrl // URL used\n };\n \n // Add to updated user data\n updatedUserData.apiResponse = apiResponse;\n setUserData(updatedUserData);\n } else {\n console.warn('⚠️ Failed to get API URL:', urlData);\n }\n } catch (fetchError) {\n console.error('❌ Error auto-fetching data:', fetchError);\n // Continue with what we have\n }\n }\n\n // Close overlay immediately\n console.log('🔥 Closing overlay after data request completion');\n // Use centralized close to also reset flow and session\n handleCloseOverlay();\n\n // Format response if requested and API response is present\n let formattedResult = finalResult;\n if (formatResponse && finalResult?.apiResponse) {\n try {\n formattedResult = {\n ...requestResult,\n apiResponse: formatOnairosResponse(requestResult.apiResponse, responseFormat)\n };\n console.log('🔥 Response formatted with dictionary:', formattedResult.apiResponse?.personalityDict || 'No personality data');\n } catch (error) {\n console.warn('🔥 Error formatting response:', error);\n // Continue with original result if formatting fails\n }\n }\n\n // Enhanced user data formatting for better display\n const { logFormattedUserData } = require('./utils/userDataFormatter');\n \n // Add user data to the result for comprehensive formatting\n const completeResult = {\n ...formattedResult,\n userData: updatedUserData\n };\n\n // Log formatted user data for better readability\n const enhancedResult = logFormattedUserData(completeResult);\n\n // Call onComplete callback if provided\n console.log('🔥 Calling onComplete callback with enhanced result');\n console.log('🔥 onComplete data structure:', {\n token: enhancedResult.token ? '✅ Present (JWT string)' : '❌ Missing',\n apiUrl: enhancedResult.apiUrl ? '✅ Present (URL string)' : '❌ Missing',\n apiResponse: enhancedResult.apiResponse ? '✅ Present (object)' : '❌ Missing',\n userData: enhancedResult.userData ? '✅ Present (object)' : '❌ Missing',\n success: enhancedResult.success,\n testMode: enhancedResult.testMode,\n allKeys: Object.keys(enhancedResult)\n });\n \n if (onComplete) {\n try {\n onComplete(enhancedResult);\n console.log('🔥 onComplete callback executed successfully with enhanced formatting');\n } catch (error) {\n console.error('🔥 Error in onComplete callback:', error);\n }\n } else {\n console.log('🔥 No onComplete callback provided');\n }\n };\n\n const getFlowTitle = () => {\n switch (currentFlow) {\n case 'welcome':\n return ''; // WelcomeScreen handles its own titles\n case 'email':\n return ''; // EmailAuth handles its own titles\n case 'onboarding':\n return 'Connect Your Data';\n case 'pin':\n return 'Secure Your Account';\n case 'training':\n return 'Training Your Model';\n case 'dataRequest':\n return 'Data Request';\n default:\n return '';\n }\n };\n\n const getFlowSubtitle = () => {\n switch (currentFlow) {\n case 'welcome':\n return ''; // WelcomeScreen handles its own subtitles\n case 'email':\n return ''; // EmailAuth handles its own subtitles\n case 'onboarding':\n return 'Choose which accounts to connect for a personalized experience';\n case 'pin':\n return 'Create a secure PIN to protect your data';\n case 'training':\n return 'Building your personalized insights';\n case 'dataRequest':\n return `Select the data you want to share with ${webpageName}`;\n default:\n return '';\n }\n };\n\n const getFlowIcon = () => {\n switch (currentFlow) {\n case 'welcome':\n return ''; // WelcomeScreen handles its own layout\n case 'email':\n return ''; // EmailAuth handles its own layout\n case 'onboarding':\n return '🔗';\n case 'pin':\n return '🔒';\n case 'training':\n return '⚡';\n case 'dataRequest':\n return '📊';\n default:\n return '';\n }\n };\n\n const renderCurrentFlow = () => {\n switch (currentFlow) {\n case 'welcome':\n return (\n <WelcomeScreen \n onContinue={handleWelcomeContinue}\n onClose={handleCloseOverlay}\n webpageName={webpageName}\n appIcon={appIcon}\n testMode={testMode}\n />\n );\n case 'email':\n return (\n <div className=\"h-[min(85vh,700px)]\">\n <EmailAuth \n onSuccess={handleEmailAuthSuccess}\n testMode={testMode} // Use the testMode prop from initialization\n />\n </div>\n );\n \n case 'onboarding':\n return (\n <UniversalOnboarding \n onComplete={handleOnboardingComplete}\n onBack={() => setCurrentFlow('email')}\n appIcon={appIcon || \"https://onairos.sirv.com/Images/OnairosBlack.png\"}\n appName={webpageName}\n username={userData?.email || userData?.username}\n testMode={testMode}\n priorityPlatform={priorityPlatform}\n rawMemoriesOnly={rawMemoriesOnly}\n rawMemoriesConfig={rawMemoriesConfig}\n />\n );\n \n case 'pin':\n return (\n <PinSetup \n onComplete={handlePinSetupComplete}\n userEmail={userData?.email}\n />\n );\n \n case 'training':\n return (\n <TrainingComponent \n onComplete={handleTrainingComplete}\n userEmail={userData?.email}\n appName={webpageName}\n connectedAccounts={userData?.connectedAccounts || []}\n testMode={testMode}\n />\n );\n \n case 'dataRequest':\n console.log('🔍 [DEBUG] Rendering DataRequest with userData:', {\n email: userData?.email,\n userName: userData?.userName,\n hasUserData: !!userData,\n userDataKeys: userData ? Object.keys(userData) : []\n });\n return (\n <DataRequest \n onComplete={handleDataRequestComplete}\n userEmail={userData?.email || userData?.userName}\n requestData={requestData}\n appName={webpageName}\n autoFetch={autoFetch}\n testMode={testMode}\n appIcon={appIcon}\n connectedAccounts={userData?.connectedAccounts || {}}\n rawMemoriesOnly={rawMemoriesOnly}\n rawMemoriesConfig={rawMemoriesConfig}\n />\n );\n \n default:\n return (\n <div className=\"flex flex-col items-center space-y-4 p-6\">\n <div className=\"animate-spin h-8 w-8 border-2 border-blue-600 rounded-full border-t-transparent\"></div>\n <p className=\"text-gray-600\">Loading...</p>\n </div>\n );\n }\n };\n\n // Styling and button class based on visual type\n const buttonClass = \n `flex items-center justify-center font-bold rounded cursor-pointer ${\n buttonType === 'pill' ? 'px-4 py-2' : 'w-12 h-12'\n } bg-transparent OnairosConnect`;\n\n const buttonStyle = {\n flexDirection: textLayout === 'below' ? 'column' : 'row',\n backgroundColor: 'transparent',\n color: textColor,\n border: '1px solid transparent',\n };\n\n // Icon and text style based on the visualType\n const logoStyle = {\n width: '20px',\n height: '20px',\n marginRight: visualType === 'full' ? '12px' : '0',\n };\n\n const getText = () => {\n switch (loginType) {\n case 'signUp':\n return 'Sign Up with Onairos';\n case 'signOut':\n return 'Sign Out of Onairos';\n default:\n return 'Sign In with Onairos';\n }\n };\n\n return (\n <>\n <button\n className={buttonClass}\n onClick={openTerminal}\n style={buttonStyle}\n >\n {(visualType === 'full' || visualType === 'icon') && (\n <img\n src={login ? \"https://onairos.sirv.com/Images/OnairosWhite.png\" : \"https://onairos.sirv.com/Images/OnairosBlack.png\"}\n alt=\"Onairos Logo\"\n style={logoStyle}\n />\n )}\n {visualType !== 'icon' && (\n <span className={`${textColor === 'black' ? 'text-black' : 'text-white'} ${visualType === 'icon' ? 'sr-only' : ''} ${textLayout === 'right' ? 'ml-2' : textLayout === 'left' ? 'mr-2' : ''}`}>\n {getText()}\n </span>\n )}\n </button>\n\n {/* Modal with New Design */}\n {showOverlay && (\n <>\n {currentFlow === 'email' ? (\n // Special case for email - render directly without PageLayout wrapper\n <div className=\"fixed inset-0 bg-gray-500 bg-opacity-50 flex items-center justify-center p-6\" style={{ zIndex: 2147483647 }}>\n <div className=\"bg-white rounded-3xl w-full max-w-lg mx-auto shadow-2xl overflow-hidden flex flex-col\" style={{ maxWidth: '500px', height: '90vh' }}>\n {/* Header */}\n <div className=\"relative px-6 pt-6 pb-4 flex-shrink-0\">\n <button\n onClick={handleCloseOverlay}\n className=\"absolute left-4 top-4 p-2 hover:bg-gray-100 rounded-full transition-colors\"\n >\n <svg className=\"w-5 h-5 text-gray-600\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n </button>\n </div>\n\n {/* Email Content */}\n <div className=\"h-[min(85vh,700px)]\">\n <EmailAuth \n onSuccess={handleEmailAuthSuccess}\n testMode={testMode}\n />\n </div>\n </div>\n </div>\n ) : currentFlow === 'onboarding' ? (\n // Special case for onboarding - render directly without PageLayout wrapper\n <div className=\"fixed inset-0 bg-gray-500 bg-opacity-50 flex items-center justify-center p-6\" style={{ zIndex: 2147483647 }}>\n <div className=\"bg-white rounded-3xl w-full max-w-lg mx-auto shadow-2xl overflow-hidden flex flex-col\" style={{ maxWidth: '500px', height: '90vh' }}>\n {/* Header */}\n <div className=\"relative px-6 pt-6 pb-4 flex-shrink-0\">\n <button\n onClick={() => setCurrentFlow('email')}\n className=\"absolute left-4 top-4 p-2 hover:bg-gray-100 rounded-full transition-colors\"\n >\n <svg className=\"w-5 h-5 text-gray-600\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M15 19l-7-7 7-7\" />\n </svg>\n </button>\n </div>\n\n {/* Onboarding Content */}\n <UniversalOnboarding \n onComplete={handleOnboardingComplete}\n onBack={() => setCurrentFlow('email')}\n appIcon={appIcon || \"https://onairos.sirv.com/Images/OnairosBlack.png\"}\n appName={webpageName}\n username={userData?.email || userData?.username}\n testMode={testMode}\n priorityPlatform={priorityPlatform}\n rawMemoriesOnly={rawMemoriesOnly}\n rawMemoriesConfig={rawMemoriesConfig}\n />\n </div>\n </div>\n ) : currentFlow === 'dataRequest' ? (\n // Special case for dataRequest - render directly without PageLayout wrapper\n <div className=\"fixed inset-0 bg-gray-500 bg-opacity-50 flex items-center justify-center p-6\" style={{ zIndex: 2147483647 }}>\n <div className=\"bg-white rounded-3xl w-full max-w-lg mx-auto shadow-2xl overflow-hidden flex flex-col\" style={{ maxWidth: '500px', height: '90vh' }}>\n {/* Header */}\n <div className=\"relative px-6 pt-6 pb-4 flex-shrink-0\">\n <button\n onClick={() => setCurrentFlow('onboarding')}\n className=\"absolute left-4 top-4 p-2 hover:bg-gray-100 rounded-full transition-colors\"\n >\n <svg className=\"w-5 h-5 text-gray-600\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M15 19l-7-7 7-7\" />\n </svg>\n </button>\n </div>\n\n {/* DataRequest Content */}\n <DataRequest \n onComplete={handleDataRequestComplete}\n userEmail={userData?.email || userData?.userName}\n requestData={requestData}\n appName={webpageName}\n autoFetch={autoFetch}\n testMode={testMode}\n appIcon={appIcon}\n connectedAccounts={userData?.connectedAccounts || {}}\n rawMemoriesOnly={rawMemoriesOnly}\n rawMemoriesConfig={rawMemoriesConfig}\n />\n </div>\n </div>\n ) : currentFlow === 'pin' ? (\n // Special case for pin - render directly without PageLayout wrapper\n <div className=\"fixed inset-0 bg-gray-500 bg-opacity-50 flex items-center justify-center p-6\" style={{ zIndex: 2147483647 }}>\n <div className=\"bg-white rounded-3xl w-full max-w-lg mx-auto shadow-2xl overflow-hidden flex flex-col\" style={{ maxWidth: '500px', height: '90vh' }}>\n {/* Header */}\n <div className=\"relative px-6 pt-6 pb-4 flex-shrink-0\">\n <button\n onClick={() => setCurrentFlow('onboarding')}\n className=\"absolute left-4 top-4 p-2 hover:bg-gray-100 rounded-full transition-colors\"\n >\n <svg className=\"w-5 h-5 text-gray-600\" fill=\"none\" stroke=\"currentColor\" viewBox=\"0 0 24 24\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M15 19l-7-7 7-7\" />\n </svg>\n </button>\n </div>\n\n {/* PinSetup Content - Must take remaining height */}\n <div className=\"flex-1 min-h-0\">\n <PinSetup \n onComplete={handlePinSetupComplete}\n onBack={() => setCurrentFlow('onboarding')}\n userEmail={userData?.email}\n />\n </div>\n </div>\n </div>\n ) : currentFlow === 'loading' ? (\n // Loading screen\n <LoadingScreen onComplete={handleLoadingComplete} />\n ) : (\n // All other flows use PageLayout wrapper\n <ModalPageLayout\n visible={showOverlay}\n onClose={handleCloseOverlay}\n showBackButton={currentFlow === 'training'}\n onBack={() => {\n if (currentFlow === 'email') setCurrentFlow('welcome');\n if (currentFlow === 'onboarding') setCurrentFlow('email');\n if (currentFlow === 'pin') setCurrentFlow('onboarding'); \n if (currentFlow === 'training') setCurrentFlow('pin');\n }}\n title={getFlowTitle()}\n subtitle={getFlowSubtitle()}\n icon={getFlowIcon()}\n centerContent={true}\n >\n {renderCurrentFlow()}\n </ModalPageLayout>\n )}\n </>\n )}\n </>\n );\n}\n\nexport default OnairosButton;","/**\n * Enhanced User Data Formatter for onComplete Callback\n * Provides structured, readable formatting of Onairos user data\n */\n\n/**\n * Formats user data for better readability in onComplete callback\n * @param {Object} result - The complete result object from data request\n * @returns {Object} Enhanced result with formatted user data display\n */\nexport function formatUserDataForDisplay(result) {\n if (!result) return result;\n\n const formatted = { ...result };\n \n // Create a structured summary of the user data\n const userDataSummary = {\n // Basic request information\n requestInfo: {\n timestamp: result.timestamp || new Date().toISOString(),\n appName: result.appName || 'Unknown App',\n userHash: result.userHash || 'Unknown User',\n testMode: result.testMode || false,\n dataTypesRequested: result.approvedData || []\n },\n \n // User authentication and profile data\n userProfile: {\n email: result.userData?.email || 'Not provided',\n userType: result.userData?.userType || 'Unknown',\n onboardingComplete: result.userData?.onboardingComplete || false,\n pinCreated: result.userData?.pinCreated || false,\n trainingComplete: result.userData?.trainingComplete || false,\n modelReady: result.userData?.modelReady || false\n },\n \n // Connected platforms/accounts\n connectedAccounts: formatConnectedAccounts(result.userData?.connectedAccounts || []),\n \n // API response data (personality, preferences, etc.)\n aiData: formatAIResponseData(result.apiResponse),\n \n // Success status and any errors\n status: {\n success: result.success || false,\n hasApiResponse: !!result.apiResponse,\n hasErrors: !!result.error || !!result.apiError\n }\n };\n\n // Add the formatted summary to the result\n formatted.userDataSummary = userDataSummary;\n \n // Create a pretty-printed version for console logging\n formatted.prettyPrint = createPrettyPrintVersion(userDataSummary);\n \n return formatted;\n}\n\n/**\n * Formats connected accounts data\n * @param {Array} accounts - Array of connected account objects\n * @returns {Object} Formatted accounts summary\n */\nfunction formatConnectedAccounts(accounts) {\n if (!Array.isArray(accounts) || accounts.length === 0) {\n return {\n count: 0,\n platforms: [],\n summary: 'No connected accounts'\n };\n }\n\n return {\n count: accounts.length,\n platforms: accounts.map(account => ({\n name: account.platform || account.name || 'Unknown Platform',\n status: account.status || 'Unknown',\n connectedAt: account.connectedAt || 'Unknown date',\n hasData: account.hasData || false\n })),\n summary: `${accounts.length} platform(s) connected: ${accounts.map(a => a.platform || a.name).join(', ')}`\n };\n}\n\n/**\n * Formats AI response data (personality scores, traits, etc.)\n * @param {Object} apiResponse - The API response containing AI data\n * @returns {Object} Formatted AI data summary\n */\nfunction formatAIResponseData(apiResponse) {\n if (!apiResponse) {\n return {\n available: false,\n summary: 'No AI data available'\n };\n }\n\n const aiData = {\n available: true,\n dataTypes: []\n };\n\n // Check for Onairos Wrapped Dashboard\n if (apiResponse.data?.dashboard || apiResponse.dashboard || apiResponse.slides) {\n aiData.dataTypes.push({\n type: 'wrapped_dashboard',\n available: true,\n data: apiResponse.data?.dashboard || apiResponse.dashboard || apiResponse,\n summary: 'Onairos Wrapped / Neural Recall Dashboard'\n });\n \n // Add apps if available\n if (apiResponse.data?.apps || apiResponse.apps) {\n aiData.dataTypes.push({\n type: 'connected_apps',\n available: true,\n data: apiResponse.data?.apps || apiResponse.apps,\n summary: `Connected apps list (${(apiResponse.data?.apps || apiResponse.apps).length})`\n });\n }\n }\n\n // Check for personality data\n if (apiResponse.InferenceResult?.traits || apiResponse.personalityDict || apiResponse.traits) {\n const personalityData = {\n type: 'personality',\n available: true\n };\n\n // If we have dictionary format, use it for better readability\n if (apiResponse.personalityDict) {\n personalityData.data = apiResponse.personalityDict;\n personalityData.summary = `Personality analysis with ${Object.keys(apiResponse.personalityDict).length} traits`;\n } else if (apiResponse.InferenceResult?.traits) {\n personalityData.data = apiResponse.InferenceResult.traits;\n personalityData.summary = `Personality scores array with ${apiResponse.InferenceResult.traits.length} values`;\n } else if (apiResponse.traits) {\n personalityData.data = apiResponse.traits;\n personalityData.summary = `Personality traits with ${Array.isArray(apiResponse.traits) ? apiResponse.traits.length : Object.keys(apiResponse.traits).length} items`;\n }\n\n aiData.dataTypes.push(personalityData);\n }\n\n // Check for preferences/traits data\n if (apiResponse.traitResult || apiResponse.traitDict) {\n const preferencesData = {\n type: 'preferences',\n available: true\n };\n\n if (apiResponse.traitDict) {\n preferencesData.data = apiResponse.traitDict;\n preferencesData.summary = `Preferences analysis with ${Object.keys(apiResponse.traitDict).length} categories`;\n } else if (apiResponse.traitResult) {\n preferencesData.data = apiResponse.traitResult;\n preferencesData.summary = `Trait results with ${Array.isArray(apiResponse.traitResult) ? apiResponse.traitResult.length : Object.keys(apiResponse.traitResult).length} items`;\n }\n\n aiData.dataTypes.push(preferencesData);\n }\n\n // Check for basic info/output\n if (apiResponse.InferenceResult?.output || apiResponse.output) {\n aiData.dataTypes.push({\n type: 'basic_info',\n available: true,\n data: apiResponse.InferenceResult?.output || apiResponse.output,\n summary: 'Basic user information and insights'\n });\n }\n\n // Create overall summary\n aiData.summary = aiData.dataTypes.length > 0 \n ? `AI analysis complete with ${aiData.dataTypes.length} data type(s): ${aiData.dataTypes.map(d => d.type).join(', ')}`\n : 'AI data structure present but no recognized data types found';\n\n return aiData;\n}\n\n/**\n * Creates a pretty-printed version for console logging\n * @param {Object} userDataSummary - The formatted user data summary\n * @returns {string} Pretty-printed string for console output\n */\nfunction createPrettyPrintVersion(userDataSummary) {\n const lines = [];\n \n lines.push('🎉 ONAIROS USER DATA SUMMARY');\n lines.push('=' .repeat(50));\n \n // Request Info\n lines.push('\\n📋 REQUEST INFORMATION:');\n lines.push(` App: ${userDataSummary.requestInfo.appName}`);\n lines.push(` User: ${userDataSummary.requestInfo.userHash}`);\n lines.push(` Mode: ${userDataSummary.requestInfo.testMode ? 'Test' : 'Production'}`);\n lines.push(` Data Types: ${userDataSummary.requestInfo.dataTypesRequested.join(', ') || 'None'}`);\n lines.push(` Timestamp: ${new Date(userDataSummary.requestInfo.timestamp).toLocaleString()}`);\n \n // User Profile\n lines.push('\\n👤 USER PROFILE:');\n lines.push(` Email: ${userDataSummary.userProfile.email}`);\n lines.push(` Type: ${userDataSummary.userProfile.userType}`);\n lines.push(` Onboarding: ${userDataSummary.userProfile.onboardingComplete ? '✅' : '❌'}`);\n lines.push(` PIN Setup: ${userDataSummary.userProfile.pinCreated ? '✅' : '❌'}`);\n lines.push(` Training: ${userDataSummary.userProfile.trainingComplete ? '✅' : '❌'}`);\n lines.push(` Model Ready: ${userDataSummary.userProfile.modelReady ? '✅' : '❌'}`);\n \n // Connected Accounts\n lines.push('\\n🔗 CONNECTED ACCOUNTS:');\n lines.push(` ${userDataSummary.connectedAccounts.summary}`);\n if (userDataSummary.connectedAccounts.platforms.length > 0) {\n userDataSummary.connectedAccounts.platforms.forEach(platform => {\n lines.push(` • ${platform.name}: ${platform.status} ${platform.hasData ? '(has data)' : '(no data)'}`);\n });\n }\n \n // AI Data\n lines.push('\\n🤖 AI ANALYSIS DATA:');\n lines.push(` ${userDataSummary.aiData.summary}`);\n if (userDataSummary.aiData.dataTypes.length > 0) {\n userDataSummary.aiData.dataTypes.forEach(dataType => {\n lines.push(` • ${dataType.type.toUpperCase()}: ${dataType.summary}`);\n });\n }\n \n // Status\n lines.push('\\n✅ STATUS:');\n lines.push(` Success: ${userDataSummary.status.success ? '✅' : '❌'}`);\n lines.push(` API Response: ${userDataSummary.status.hasApiResponse ? '✅' : '❌'}`);\n lines.push(` Errors: ${userDataSummary.status.hasErrors ? '❌ Yes' : '✅ None'}`);\n \n lines.push('\\n' + '=' .repeat(50));\n \n return lines.join('\\n');\n}\n\n/**\n * Console logging helper that prints formatted user data\n * @param {Object} result - The result object from onComplete\n */\nexport function logFormattedUserData(result) {\n const formatted = formatUserDataForDisplay(result);\n \n console.log('\\n' + formatted.prettyPrint + '\\n');\n \n // Also log the structured data for programmatic access\n console.log('📊 Structured User Data Summary:', formatted.userDataSummary);\n \n return formatted;\n}\n\nexport default {\n formatUserDataForDisplay,\n logFormattedUserData\n};\n"],"names":["WelcomeScreen","_ref","onContinue","onClose","useEffect","script","document","createElement","src","async","head","appendChild","existingScript","querySelector","removeChild","React","className","style","height","alt","onClick","fill","stroke","viewBox","strokeLinecap","strokeLinejoin","strokeWidth","d","COLORS","btnGradStart","btnGradEnd","btnLabel","btnBorder","iconCircleGradientStart","iconCircleGradientEnd","background","backgroundSecondary","textPrimary","textSecondary","textMuted","border","borderLight","success","error","warning","info","hover","pressed","focus","IconCircle","size","children","concat","width","borderRadius","fontSize","color","backgroundColor","_ref2","label","iconRight","loading","disabled","testId","textStyle","centered","props","_objectWithoutProperties","_excluded","setPressed","useState","buttonStyle","_objectSpread","position","overflow","minWidth","maxWidth","margin","cursor","opacity","boxShadow","transition","pressedOverlayStyle","top","left","right","bottom","labelStyle","fontFamily","fontWeight","textAlign","_extends","onMouseDown","handleMouseDown","onMouseUp","handleMouseUp","onMouseLeave","handleMouseLeave","display","justifyContent","alignItems","EmailAuth","onSuccess","testMode","email","setEmail","code","setCode","step","setStep","isLoading","setIsLoading","setError","emailSent","setEmailSent","emailServiceMessage","setEmailServiceMessage","setTimeout","firstInput","handleEmailSubmit","e","preventDefault","test","validateEmail","console","log","baseUrl","window","onairosBaseUrl","apiKey","onairosApiKey","response","fetch","method","headers","body","JSON","stringify","trim","toLowerCase","ok","Error","data","json","message","handleGoogleAuth","_JSON$parse","tempId","Date","now","Math","random","toString","substr","localStorage","setItem","sdkConfig","username","getItem","parse","res","session","oauthUrl","gmailURL","gmailUrl","gmail_url","url","popup","open","messageHandler","event","origin","includes","type","platform","removeEventListener","handleOAuthSuccess","gmailEmail","addEventListener","pollCount","maxPolls","localStorageKey","timestampKey","pollInterval","setInterval","closed","clearInterval","retrieveAndContinueWithGoogleEmail","timestamp","timestampNum","parseInt","close","cleanup","removeItem","_onairosOAuthCleanup","emailRes","warn","normalizedEmail","verified","token","userName","split","existingUser","accountInfo","isNewUser","flowType","adminMode","userCreated","accountDetails","createdAt","toISOString","ssoProvider","handleCodeSubmit","length","simulatedResponse","testAccount","jwtToken","value","onChange","target","placeholder","required","lineHeight","borderColor","Array","from","_","index","key","maxLength","newCode","join","_e$target$parentEleme","nextInput","parentElement","onKeyDown","_e$target$parentEleme2","prevInput","PrimaryButton","flex","minHeight","Check","ChatGPTConnector","Component","constructor","super","this","state","connected","isConnecting","handleClose","bind","handleOpen","chatGPTConnect","setConnected","setDisconnected","setState","onConnectionChange","llmManager","llmConnectorManager","connectToLLM","alert","render","bookmarkletCode","fillRule","clipRule","animation","href","draggable","onDragStart","dataTransfer","setData","effectAllowed","chatgptIcon","claudeIcon","geminiIcon","grokIcon","process","env","REACT_APP_ONAIROS_API_KEY","REACT_APP_ONAIROS_BASE_URL","sdkType","enableHealthMonitoring","enableAutoRefresh","enableConnectionValidation","fadeSlideInKeyframes","UniversalOnboarding","onComplete","lottieRef","useRef","lastFrameRef","rafRef","connectedAccounts","setConnectedAccounts","setIsConnecting","connectingPlatform","setConnectingPlatform","selected","setSelected","currentPage","setCurrentPage","showChatGPTModal","setShowChatGPTModal","touchStartX","touchDeltaX","vh","setVh","innerHeight","onResize","personaSide","min","SLOT","max","floor","ACTIVE_SCALE","igGradId","round","useId","Brand","ChatGPT","objectFit","Claude","Gemini","Grok","Instagram","id","cx","cy","r","offset","stopColor","YouTube","Reddit","LinkedIn","x","y","rx","Twitter","aiLinks","descriptions","allPlatforms","name","connector","icon","directLink","platforms","page","slice","p","s","userData","isArray","accountsObj","reduce","acc","handleSwitch","plat","find","candidates","youtube","linkedin","reddit","pinterest","instagram","github","facebook","gmail","k","touched","it","location","hostname","_unused","_unused2","_unused3","_unused4","connectToPlatform","connectedCount","Object","values","filter","Boolean","current","totalFrames","personaAnim","progress","start","startTs","performance","t","eased","frame","goToAndStop","requestAnimationFrame","cancelAnimationFrame","maxHeight","transform","zIndex","pointerEvents","Lottie","animationData","autoplay","loop","onTouchStart","touches","clientX","onTouchMove","onTouchEnd","dx","gridAutoFlow","gridTemplateColumns","columnGap","justifyItems","paddingInline","map","idx","on","isSel","shift","title","transformOrigin","marginTop","marginBottom","n","role","paddingBottom","entries","v","_ref3","totalConnections","xmlns","PinSetup","onBack","userEmail","pin","setPin","pinRequirements","setPinRequirements","uppercase","number","allRequirementsMet","WebkitTextFillColor","handleSubmit","pinCreated","undefined","Icon","base","DataTypeToggle","dataType","enabled","onToggle","handle","options","appName","connectedPlatforms","basic","rawMemories","preferences","personality","freq","setFreq","toggle","val","selectedCount","getConnected","_ref4","_ref5","u","_ref6","_ref7","freqToPercent","f","opt","rect","currentTarget","getBoundingClientRect","ratio","Pinterest","GitHub","Facebook","Gmail","onError","approved","keys","declined","TrainingComponent","_steps$currentStep","_steps$currentStep2","_steps$currentStep3","_steps$currentStep4","_steps$currentStep5","currentStep","setCurrentStep","setProgress","isComplete","setIsComplete","steps","description","duration","interval","stepTimeout","stepDuration","stepProgress","prev","newProgress","completionDelay","trainingComplete","simulatedTraining","clearTimeout","LoadingScreen","dotCount","setDotCount","loadingStates","stateInterval","nextStep","dotInterval","currentState","aspectRatio","rainAnim","repeat","PERSONALITY_TYPES","TRAIT_CATEGORIES","formatOnairosResponse","apiResponse","_apiResponse$Inferenc","arguments","includeDictionary","includeArray","formatted","InferenceResult","traits","scores","_apiResponse$Inferenc2","personalityDict","forEach","_formatted$InferenceR","traitResult","traitDict","category","PageLayout","subtitle","showHeader","showCloseButton","showBackButton","contentClassName","centerContent","layoutStyle","flexDirection","headerStyle","padding","contentStyle","titleStyle","subtitleStyle","ModalPageLayout","visible","onBackdropClick","backdropStyle","modalStyle","pageLayoutProps","_excluded2","backdropStyles","willChange","modalStyles","borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius","OnairosButton","requestData","webpageName","inferenceData","autoFetch","proofMode","textLayout","textColor","login","buttonType","loginReturn","loginType","visualType","appIcon","enableTraining","formatResponse","responseFormat","priorityPlatform","rawMemoriesOnly","rawMemoriesConfig","showOverlay","setShowOverlay","currentFlow","setCurrentFlow","setUserData","checkExistingSession","savedUser","user","onboardingComplete","handleCloseOverlay","handleWelcomeContinue","handleEmailAuthSuccess","authData","userState","hasAccountInfo","candidate","accessToken","base64","payload","decodeURIComponent","atob","c","charCodeAt","userId","sub","finalDecision","reasoning","existingUserFalse","flowTypeOnboarding","noAccountInfo","newUserData","handleOnboardingComplete","onboardingData","updatedUserData","handlePinSetupComplete","pinData","handleTrainingComplete","trainingResult","trainingCompleted","handleDataRequestComplete","_requestResult$approv","_finalResult","requestResult","lastDataRequest","finalResult","urlResponse","Info","appId","account","confirmations","EncryptedUserPin","storage","urlData","apiUrl","dataResponse","includeLlmData","fetchError","formattedResult","_formattedResult$apiR","logFormattedUserData","require","enhancedResult","allKeys","buttonClass","logoStyle","marginRight","getText","DataRequest","handleLoadingComplete","getFlowTitle","getFlowSubtitle","getFlowIcon","renderCurrentFlow","hasUserData","userDataKeys","formatUserDataForDisplay","result","_result$userData","_result$userData2","_result$userData3","_result$userData4","_result$userData5","_result$userData6","_result$userData7","userDataSummary","requestInfo","userHash","dataTypesRequested","approvedData","userProfile","userType","modelReady","formatConnectedAccounts","aiData","formatAIResponseData","status","hasApiResponse","hasErrors","apiError","prettyPrint","lines","push","toLocaleString","summary","hasData","dataTypes","toUpperCase","createPrettyPrintVersion","accounts","count","connectedAt","a","_apiResponse$data","_apiResponse$Inferenc3","available","_apiResponse$data2","_apiResponse$data3","_apiResponse$data4","_apiResponse$data5","_apiResponse$Inferenc4","dashboard","slides","apps","personalityData","preferencesData","output"],"ignoreList":[],"sourceRoot":""}