@extends('layouts/layoutMaster') @section('title', 'Perfil del proveedor') @section('vendor-style') @vite(['resources/assets/vendor/libs/select2/select2.scss']) @endsection @section('page-style') @endsection @section('vendor-script') @vite(['resources/assets/vendor/libs/select2/select2.js']) @endsection @section('content') @php $publicHandle = $profile->slug ?: 'm-xxxxxxx'; $displayName = $profile->avatarDisplayName(); $avatarInitials = $profile->avatarInitials(); $canManageProfilePhoto = $profile->canManageProfilePhoto(); $showProfilePhoto = $profile->shouldShowProfilePhoto(); $canManageProfileCover = $profile->canManageProfileCover(); $showProfileCover = $profile->shouldShowProfileCover(); $publicProfileUrl = \Illuminate\Support\Facades\Route::has('mariachi.provider.public.show') && filled($profile->slug) ? route('mariachi.provider.public.show', ['handle' => $profile->slug]) : null; $profileChecklist = [ ['label' => 'Nombre', 'done' => filled($profile->business_name)], ['label' => 'Descripcion', 'done' => filled($profile->short_description)], ['label' => 'Telefono', 'done' => filled($defaultPhoneNumber)], ['label' => 'WhatsApp', 'done' => filled($profile->whatsapp)], ['label' => 'Logo', 'done' => $showProfilePhoto], ['label' => 'Portada', 'done' => $showProfileCover], ['label' => 'Instagram', 'done' => filled($profile->instagram)], ['label' => 'Facebook', 'done' => filled($profile->facebook)], ]; $completedProfileItems = collect($profileChecklist)->where('done', true)->count(); $profileCompletion = (int) round(($completedProfileItems / max(count($profileChecklist), 1)) * 100); $mediaReadyCount = collect([ $showProfilePhoto, $showProfileCover, filled($profile->instagram), filled($profile->facebook), filled($profile->tiktok), filled($profile->youtube), ])->filter()->count(); $requiresActivation = $user->requiresActivation(); $activeSubscription = $profile->activeSubscription; $activePlan = $activeSubscription?->plan; $activationStatusMeta = match (true) { $requiresActivation => [ 'label' => 'Pendiente', 'class' => 'warning', 'title' => 'Tu acceso todavía necesita activación', 'description' => 'Primero activa la cuenta. Después eliges planes por anuncio cuando quieras publicar con visibilidad.', ], filled($activePlan?->name) => [ 'label' => 'Operativo', 'class' => 'success', 'title' => 'Tu cuenta ya puede operar con anuncios', 'description' => 'Tu acceso está activo. Los planes y upgrades se gestionan por anuncio desde el panel de publicaciones.', ], default => [ 'label' => 'Listo', 'class' => 'secondary', 'title' => 'Tu acceso está habilitado', 'description' => 'Completa el perfil y luego elige visibilidad por anuncio según cada campaña.', ], }; $verificationBaseAmount = (int) (collect($verificationPlans ?? [])->min('amount_cop') ?? 0); $verificationStatusMeta = match ((string) $profile->verification_status) { 'verified' => $profile->hasActiveVerification() ? ['label' => 'Verificado', 'class' => 'success', 'description' => 'Tu insignia está activa y ya puedes usar handle premium y mejores señales de confianza.'] : ['label' => 'Vencida', 'class' => 'warning', 'description' => 'La verificación venció. Puedes renovarla cuando quieras desde este mismo flujo.'], 'payment_pending' => ['label' => 'En revisión', 'class' => 'warning', 'description' => 'El pago y los documentos ya entraron a revisión manual.'], 'rejected' => ['label' => 'Rechazada', 'class' => 'danger', 'description' => 'La última solicitud fue rechazada. Revisa el motivo y vuelve a intentarlo.'], default => ['label' => 'Sin verificación', 'class' => 'secondary', 'description' => 'Actívala para sumar confianza, insignia y handle premium.'], }; @endphp