@php // KPI rollups across all numbers (computed from the rows the controller passed). $enabledRows = $rows->filter(fn ($r) => !empty($r['cfg']['enabled'])); $numWarming = $enabledRows->count(); $totalBudget = (int) $enabledRows->sum('budget'); $sentToday = (int) $enabledRows->sum('sent'); $avgHealth = $rows->count() ? (int) round($rows->avg('health')) : 0; // Plain-words explanation shown under each setting field. $hints = [ 'daily_base' => 'How many messages this number may send on day one.', 'step_pct' => 'Grow that daily limit by this percent each step.', 'step_days' => 'How often the limit grows (every N days).', 'max_daily' => 'The highest the daily limit ever reaches.', 'gap_min' => 'Shortest wait between two messages.', 'gap_max' => 'Longest wait between two messages.', 'active_start' => 'Only start sending after this hour (24-hour clock).', 'active_end' => 'Stop sending after this hour.', ]; @endphp
{{-- =============== LEFT RAIL =============== --}} {{-- =============== MAIN =============== --}}
{{-- Header --}}
{{ __('More') }} / {{ __('Warmer') }}

{{ __('Warm up your') }} {{ __('numbers') }}

{{ __('Ramp each Unofficial API number\'s daily send limit with human-like gaps and active hours to reduce ban risk. Each number warms up on its own schedule.') }}

@if (session('warmer_status'))
{{ session('warmer_status') }}
@endif {{-- KPI strip --}}
{{ __('Numbers warming') }}
{{ $numWarming }}
{{ __('of') }} {{ $rows->count() }} {{ __('connected') }}
{{ __("Today's budget") }}
{{ number_format($totalBudget) }}
{{ __('messages allowed today') }}
{{ __('Sent today') }}
{{ number_format($sentToday) }}
{{ __('counted toward warm-up') }}
{{ __('Avg health') }}
{{ $avgHealth }}
{{ __('across all numbers') }}
{{-- Per-number cards --}} @forelse ($rows as $r) @php $d = $r['device']; $cfg = $r['cfg']; $health = $r['health']; $hClass = $health >= 70 ? 'bg-wa-mint text-wa-deep' : ($health >= 40 ? 'bg-accent-amber/20 text-[#7B5A14]' : 'bg-accent-coral/15 text-accent-coral'); $on = (bool) ($cfg['enabled'] ?? false); // Which engine this number belongs to โ€” so a multi-engine // workspace can tell its Unofficial / WABA / Twilio numbers apart. $engBadge = match ($r['engine'] ?? 'baileys') { 'waba' => [__('WABA'), 'bg-wa-mint/40 text-wa-deep border border-wa-deep/20'], 'twilio' => [__('Twilio'), 'bg-accent-coral/10 text-accent-coral border border-accent-coral/30'], default => [__('Unofficial API'), 'bg-ink-900/5 text-ink-700 border border-ink-200'], }; @endphp
@csrf
{{ $d->device_name ?: __('Number') }} {{ $engBadge[0] }} {{ __('Health') }} {{ $health }}
{{ $r['phone'] ?: 'โ€”' }} ยท {{ ucfirst((string) $d->status) }}
{{-- live status strip --}}
{{ __("Today's budget") }}
{{ $r['budget'] }}
{{ __('Remaining today') }}
{{ $r['remaining'] }}
{{ __('Sent today') }}
{{ (int) ($r['sent'] ?? 0) }}
@php $fields = [ ['daily_base', __('Start budget/day'), $cfg['daily_base'], 1, 5000], ['step_pct', __('Ramp +% / step'), $cfg['step_pct'], 0, 200], ['step_days', __('Ramp every (days)'),$cfg['step_days'], 1, 60], ['max_daily', __('Max budget/day'), $cfg['max_daily'], 1, 100000], ['gap_min', __('Min gap (sec)'), $cfg['gap_min'], 0, 3600], ['gap_max', __('Max gap (sec)'), $cfg['gap_max'], 0, 3600], ['active_start', __('Active from (hr)'), $cfg['active_start'], 0, 23], ['active_end', __('Active to (hr)'), $cfg['active_end'], 0, 24], ]; @endphp
@foreach ($fields as [$name, $label, $val, $min, $max]) @endforeach
@empty

{{ __('No connected numbers yet.') }}

{{ __('Connect a number') }}
@endforelse