@extends('layouts.app') @section('title',$draft->name.' - GIGAX DRAFT') @section('page_title','GIGAX DRAFT') @push('styles') @endpush @section('content') @php $typeLabel=['solo'=>'SOLO','clan'=>'CLÃS','panela'=>'PANELAS'][$draft->draft_type] ?? strtoupper($draft->draft_type); $statusLabel=['registration'=>'INSCRIÇÕES','ongoing'=>'EM ANDAMENTO','finished'=>'FINALIZADO'][$draft->status] ?? strtoupper($draft->status); $target=(int)$draft->max_teams*(int)$draft->team_size; $registered=$draft->draft_type==='solo' ? $members->count() : $entries->count(); $needed=$draft->draft_type==='solo' ? $target : (int)$draft->max_teams; $treeTeams=max(2,(int)$draft->max_teams); $treeRounds=max(1,$totalRounds); $teamH=$treeTeams>=128?17:($treeTeams>=64?18:($treeTeams>=32?19:21)); $matchH=($teamH*2)+20; $treeH=$treeTeams>8?max(420,(int)(($treeTeams/2)*($matchH+5))):($treeTeams>=8?360:($treeTeams>=4?230:145)); $colW=$treeTeams>=128?142:($treeTeams>=64?148:158); $championDisplay=trim((string)($draft->champion_name??'')); if($championDisplay!=='' && trim((string)($draft->champion_tag??''))!=='') $championDisplay='['.$draft->champion_tag.'] '.$championDisplay; if($championDisplay==='') $championDisplay='AGUARDANDO'; $entryName=function($name,$tag){$name=trim((string)$name);$tag=trim((string)$tag);return $name===''?'AGUARDANDO':($tag!==''?'['.$tag.'] ':'').$name;}; $endsAt=data_get($draft,'ends_at'); $endsIso=$endsAt?\Carbon\Carbon::parse($endsAt)->toIso8601String():''; $defaultMatch=$matches->first(fn($m)=>!empty($m->entry_a_id)&&!empty($m->entry_b_id)&&empty($m->winner_entry_id)) ?: $matches->first(); $defaultMatchId=$defaultMatch?(int)$defaultMatch->id:0; $liveDraftMatches=$matches->filter(fn($m)=>!empty($m->entry_a_id)&&!empty($m->entry_b_id)&&empty($m->winner_entry_id)&&!empty($m->training_match_id))->take(4)->values(); $historyGames=$seriesGamesByMatch->flatten(1)->sortByDesc('id')->take(12)->values(); $mapVisuals=[ ['VIÚVA NEGRA','viuva-negra.webp'], ['PORTO','porto.webp'], ['MÉXICO','mexico.webp'], ['SUB BASE','sub-base.webp'], ['ANKARA','ankara.webp'], ['SATELITE','satelite.webp'], ['OLHO DE AGUIA','olho-de-aguia.webp'], ]; @endphp
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif @if($errors->any())
{{ $errors->first() }}
@endif
🏆

DRAFT {{ $typeLabel }} #{{ str_pad((string)$draft->id,4,'0',STR_PAD_LEFT) }}

{{ $statusLabel }}
♟ {{ $draft->max_teams }} Times♟ {{ $draft->max_teams*$draft->team_size }} Jogadores⚔ {{ $draft->team_size }}v{{ $draft->team_size }}🎮 {{ strtoupper((string)($draft->game_mode ?? 'pd')) }}🇧🇷 {{ $draft->region==='BRASIL'?'BR':$draft->region }}
◴
{{ $endsIso?'ENCERRA EM':'STATUS' }}{{ $endsIso?'--d --h --m':$statusLabel }}
@if($draft->status==='registration')

INSCRIÇÕES • {{ $registered }}/{{ $needed }}

@if($draft->draft_type==='solo')

Entrada individual. Ao completar {{ $target }} jogadores, o sistema monta {{ $draft->max_teams }} times equilibrados por Skill + Ranking.

@if(!$myMember)
@csrf
@else
@csrf
@endif @if($isDraftAdmin)
@csrf
@endif
@elseif($draft->draft_type==='clan')

O roster do Clã permanece junto. O Draft utiliza o elenco registrado para formar o confronto.

@if(!$myMember)
@csrf
@else
@csrf
@endif @if($isDraftAdmin)
@csrf
@endif
@else @if(!$myMember)
@csrf
@elseif($myEntry && (int)$myEntry->captain_user_id===(int)session('user_id') && ($membersByEntry->get((int)$myEntry->id,collect())->count()<5))
@csrf
@endif @endif
@endif
@if(!$matches->count())
◈ PRÉVIA DA CHAVE • AINDA NÃO GERADA
@endif
@for($round=1;$round<=$treeRounds;$round++) @php $roundRows=$matches->where('round_number',$round)->values();$expected=max(1,(int)($treeTeams/(2**$round)));$rs=$roundSettings->get($round);$bo=(int)($rs->best_of??1); @endphp
{{ $phaseLabel($round) }}MD{{ $bo }}
@for($mi=0;$mi<$expected;$mi++) @php $m=$roundRows->get($mi);$globalGame=$treeTeams-(int)($treeTeams/(2**($round-1)))+$mi+1; $aName=$m?$entryName($m->entry_a_name,$m->entry_a_tag):'AGUARDANDO';$bName=$m?$entryName($m->entry_b_name,$m->entry_b_tag):'AGUARDANDO'; $aWin=$m&&!empty($m->winner_entry_id)&&(int)$m->winner_entry_id===(int)($m->entry_a_id??-1);$bWin=$m&&!empty($m->winner_entry_id)&&(int)$m->winner_entry_id===(int)($m->entry_b_id??-1); $games=$m?collect($seriesGamesByMatch->get((int)$m->id,collect())):collect();$winsA=$m?$games->where('winner_entry_id',(int)($m->entry_a_id??-1))->count():0;$winsB=$m?$games->where('winner_entry_id',(int)($m->entry_b_id??-1))->count():0; $tpl='gd17-match-'.$draft->id.'-'.$globalGame;$mcHue=($globalGame*47)%360;$lobby=$m&&!empty($m->training_match_id)?$lobbyStates->get((int)$m->training_match_id):null; $rosterA=$m?collect($membersByEntry->get((int)($m->entry_a_id??0),collect())):collect();$rosterB=$m?collect($membersByEntry->get((int)($m->entry_b_id??0),collect())):collect(); @endphp
♟{{ $aName }}{{ $bo>1?$winsA:($aWin?'✓':'—') }}
♟{{ $bName }}{{ $bo>1?$winsB:($bWin?'✓':'—') }}
@endfor
@endfor
CAMPEÃO🏆
{{ $championDisplay }}
JOGOFASEMD1AGUARDANDO
♟♟
CLIQUE EM UM JOGO DA CHAVE PARA VER JOGADORES, VETO E PARTIDA.
LOBBY - PARTIDAS DO DRAFT (SOMENTE LIBERADAS)
@foreach($liveDraftMatches as $li=>$m) @php $aName=$entryName($m->entry_a_name,$m->entry_a_tag);$bName=$entryName($m->entry_b_name,$m->entry_b_tag);$lobby=!empty($m->training_match_id)?$lobbyStates->get((int)$m->training_match_id):null;$isLive=$lobby && (string)($lobby->status??'')==='in_progress';$rs=$roundSettings->get((int)$m->round_number);$bo=(int)($rs->best_of??1);$games=collect($seriesGamesByMatch->get((int)$m->id,collect()));$wa=$games->where('winner_entry_id',(int)$m->entry_a_id)->count();$wb=$games->where('winner_entry_id',(int)$m->entry_b_id)->count(); @endphp @if($m->training_match_id)@else@endif @endforeach @if($liveDraftMatches->isEmpty())
⌛
{{ $matches->count() ? 'AGUARDANDO PARTIDAS LIBERADAS' : 'AGUARDANDO GERAÇÃO DA CHAVE' }}{{ $matches->count() ? 'Assim que um confronto tiver os dois lados definidos e a partida for liberada, ele aparecerá aqui.' : 'A árvore acima é apenas uma prévia. Nenhuma partida real foi criada no Lobby.' }}
@elseif($liveDraftMatches->count()<5)
⌛Aguardando próxima partida liberada...
@endif
@push('scripts') @endpush @endsection