<?php
declare(strict_types=1);

// Prevent direct access from web
if (!defined('LUNA_APP')) {
    http_response_code(403);
    exit('Forbidden');
}

/**
 * Zalo Chatbot Configuration
 * Free tier: 3000 messages
 */

// Zalo chatbot token (Bot Creator format)
define('ZALO_TOKEN', '1033249594902632569:udrWfKKlgaghqCfmvGgpjVNmTVFiBwDdwNNuxCGtdBbMOifJpjpWFOHMVBOdkbXk');

// Zalo Bot Creator API endpoint (Telegram-style)
define('ZALO_BOT_API_ENDPOINT', 'https://bot-api.zapps.me/bot');

// Legacy endpoints (backup)
define('ZALO_API_ENDPOINT', 'https://openapi.zalo.me/v2.0/oa/message');
define('ZALO_WEBHOOK_ENDPOINT', 'https://api.miniapp.zalo.me/api/v1/message/text');

// Timeout for API requests (seconds)
define('ZALO_TIMEOUT', 30);

// Enable debug mode
define('ZALO_DEBUG', false);

/**
 * Get Zalo configuration
 */
function zalo_get_config(): array
{
    return [
        'token' => ZALO_TOKEN,
        'bot_api_endpoint' => ZALO_BOT_API_ENDPOINT,
        'api_endpoint' => ZALO_API_ENDPOINT,
        'webhook_endpoint' => ZALO_WEBHOOK_ENDPOINT,
        'timeout' => ZALO_TIMEOUT,
        'debug' => ZALO_DEBUG,
    ];
}
