<?php

use App\Http\Controllers\ProfileController;
use Illuminate\Foundation\Application;
use Illuminate\Support\Facades\Route;
use Inertia\Inertia;

use App\Http\Controllers\DepositController;

use App\Http\Controllers\PromotionController;

use App\Http\Controllers\RewardCenterController;
use App\Http\Controllers\VipController;

use App\Http\Controllers\VipRulesController;
use App\Http\Controllers\RebateController;

use App\Http\Controllers\MissionController;

use App\Http\Controllers\MyAccountController;
use App\Http\Controllers\BettingRecordController;
use App\Http\Controllers\ExclusionTurnoverController;

use App\Http\Controllers\GameLobbyController;

 
    Route::get('/hot-games', [GameLobbyController::class, 'hotGames'])->name('games.hot');
    Route::get('/favorites', [GameLobbyController::class, 'favorites'])->name('games.favorites');
    Route::get('/slots', [GameLobbyController::class, 'slots'])->name('games.slots');
    Route::get('/live-casino', [GameLobbyController::class, 'liveCasino'])->name('games.live');
    Route::get('/poker', [GameLobbyController::class, 'poker'])->name('games.poker');
    Route::get('/fish', [GameLobbyController::class, 'fish'])->name('games.fish');
    Route::get('/sports', [GameLobbyController::class, 'sports'])->name('games.sports');
    Route::get('/e-sports', [GameLobbyController::class, 'esports'])->name('games.esports');
    Route::get('/lottery', [GameLobbyController::class, 'lottery'])->name('games.lottery');
 
Route::middleware(['auth'])->group(function () {
    Route::get('/my-account', [MyAccountController::class, 'index'])->name('my-account.index');

    Route::get('/betting-record', [BettingRecordController::class, 'index'])->name('betting-record.index');

    Route::get('/exclusion-turnover-list', [ExclusionTurnoverController::class, 'index'])->name('exclusion-turnover.index');
});


Route::get('/mission', [MissionController::class, 'index'])->name('mission.index');
Route::get('/mission/rules/{missionKey}', [MissionController::class, 'rules'])->name('mission.rules');
Route::get('/mission/leaderboard/{missionKey}', [MissionController::class, 'leaderboard'])->name('mission.leaderboard');
 
 
    Route::get('/manual-rebate', [RebateController::class, 'index'])->name('rebate.index');
 

 
    Route::get('/vip-rules', [VipRulesController::class, 'index'])->name('vip-rules.index');
 

 
    Route::get('/reward-center', [RewardCenterController::class, 'index'])->name('reward-center.index');
    Route::get('/reward-center/bonus', [RewardCenterController::class, 'bonus'])->name('reward-center.bonus');
    Route::get('/reward-center/ticket-records', [RewardCenterController::class, 'ticketRecords'])->name('reward-center.ticket-records');
    Route::get('/reward-center/sign-in', [RewardCenterController::class, 'signIn'])->name('reward-center.sign-in');
    Route::get('/reward-center/rescue-fund', [RewardCenterController::class, 'rescueFund'])->name('reward-center.rescue-fund');
    Route::get('/reward-center/rescue-fund/{type}', [RewardCenterController::class, 'rescueFundDetails'])->name('reward-center.rescue-fund.details');
    Route::get('/reward-center/promo-code', [RewardCenterController::class, 'promoCode'])->name('reward-center.promo-code');
    Route::get('/vip', [VipController::class, 'index'])->name('vip.index');
 
 


 
    Route::get('/promotions', [PromotionController::class, 'index'])->name('promotions.index');
    Route::get('/promotions/{promotion:slug}', [PromotionController::class, 'show'])->name('promotions.show');
 


Route::get('/invite-friends', function () {
    return Inertia::render('InviteFriendsPage');
});
 

Route::middleware(['auth'])->group(function () {
    Route::get('/deposit', [DepositController::class, 'index'])->name('deposit.index');
    Route::post('/deposit/submit', [DepositController::class, 'store'])->name('deposit.store');
    Route::get('/deposit/{deposit}/submit', [DepositController::class, 'submitPage'])->name('deposit.submit.page');
    Route::post('/deposit/{deposit}/confirm', [DepositController::class, 'confirm'])->name('deposit.confirm');
    Route::get('/deposit/{deposit}/info', [DepositController::class, 'info'])->name('deposit.info');
    Route::get('/deposit/records', [DepositController::class, 'records'])->name('deposit.records');
});
 

// Route::get('/', function () {
//     return Inertia::render('Home', [
//         'auth' => [
//             'user' => auth()->user(),
//         ],
//     ]);
// });

Route::get('/', function () {
    return Inertia::render('Home', [
        'canLogin' => Route::has('login'),
        'canRegister' => Route::has('register'),
        'laravelVersion' => Application::VERSION,
        'phpVersion' => PHP_VERSION,
    ]);
})->name('home');

Route::get('/dashboard', function () {
    return Inertia::render('Dashboard');
})->middleware(['auth', 'verified'])->name('dashboard');

Route::middleware('auth')->group(function () {
    Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
    Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
    Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');
});

require __DIR__.'/auth.php';
