'use client';

// Демо данные для тестирования без Telegram
const demoUser = {
  id: 'demo_user_123',
  first_name: 'Demo',
  username: 'demo_user',
  language_code: 'ru'
};

const demoInitData = {
  query_id: 'demo_query',
  user: demoUser,
  auth_date: Date.now(),
  hash: 'demo_hash'
};

export const isDemoMode = () => {
  return typeof window !== 'undefined' && new URLSearchParams(window.location.search).has('demo');
};

export const getDemoWebApp = () => ({
  initData: 'demo_mode',
  initDataUnsafe: demoInitData,
  platform: 'demo',
  colorScheme: 'light',
  themeParams: {
    bg_color: '#ffffff',
    text_color: '#000000',
    hint_color: '#999999',
    link_color: '#2481cc',
    button_color: '#2481cc',
    button_text_color: '#ffffff'
  },
  isExpanded: true,
  viewportHeight: typeof window !== 'undefined' ? window.innerHeight : 800,
  viewportStableHeight: typeof window !== 'undefined' ? window.innerHeight : 800,
  headerColor: '#ffffff',
  backgroundColor: '#ffffff',
  isClosingConfirmationEnabled: true,
  BackButton: {
    isVisible: false,
    onClick: () => {},
  },
  MainButton: {
    text: '',
    color: '#2481cc',
    textColor: '#ffffff',
    isVisible: false,
    isProgressVisible: false,
    isActive: true,
    setText: () => {},
    onClick: () => {},
    show: () => {},
    hide: () => {},
    enable: () => {},
    disable: () => {},
    showProgress: () => {},
    hideProgress: () => {},
  },
  ready: () => {},
  expand: () => {},
  close: () => {},
}); 