@php $appId = (string) \App\Models\SystemSetting::get('waba_app_id', ''); $configId = (string) \App\Models\SystemSetting::get('waba_config_id', ''); $missing = $appId === '' || $configId === ''; $cred = $existing && $existing->provider === 'waba' ? $existing->creds() : []; // Embedded Signup version + coexistence config — same admin settings the // /devices launcher reads, so both connect surfaces behave identically. $esVersion = (string) \App\Models\SystemSetting::get('waba_es_version', 'v2'); $coexConfigId = (string) \App\Models\SystemSetting::get('waba_coex_config_id', ''); $coexEnabled = (bool) \App\Models\SystemSetting::get('waba_coexistence', false); $graphVersion = \App\Models\SystemSetting::get('waba_graph_api_version', 'v23.0'); @endphp

{{ __('Connect with') }} {{ __('Meta') }}.

{{ __("Sign in to Meta, pick the WhatsApp number to connect, and we'll provision the rest — webhook subscription, phone register, catalog link.") }}

@if ($missing)
{{ __('Meta App not configured') }}
Your platform admin needs to add the Meta App ID + Config ID at /admin/settings → Sending providers. Once set, this page will let you connect with one click.
@else
{{ __('Embedded Signup') }}

{{ __("We'll never see your Meta password. You pick which WhatsApp number we get access to.") }}

@if ($coexEnabled) {{-- Coexistence: link a number already on the WhatsApp Business App. Meta shows a QR inside its popup; the app keeps working alongside Cloud-API automation on the same number. Same setting + config the /devices launcher uses. --}}
{{ __('or') }}
@endif

{{ __('Requires a Meta Business account, a verified business, and a phone not already on the consumer WhatsApp app.') }}

1. Webhook
We auto-subscribe Meta's webhook to your WABA so messages flow to /chat.
2. Register phone
We register your number on Cloud API with a secret PIN we generate.
3. Catalog
We link your products to a Meta catalog so you can send single-product / list messages in chat.
@endif @if ($existing && $existing->provider === 'waba' && $existing->isConnected())
{{ __("You're connected ✓") }}
{{ __('Phone:') }} {{ $existing->phone_number ? mask_phone($existing->phone_number) : '—' }} · Connected {{ optional($existing->connected_at)->diffForHumans() }}
Go to store
@endif