{{ __('Integrations') }}

{{ __('Connect the third-party APIs your panel uses. Each card links to its settings and a step-by-step setup guide.') }}

@php // Flatten the grouped catalogue into a key => display-name map so the manual // modal header can title itself from whichever card was opened. $names = []; foreach ($groups as $cards) { foreach ($cards as $c) { $names[$c['key']] = $c['name']; } } // Status badge presentation per computed status key. $badge = [ 'connected' => ['rf-badge-success', __('Connected')], 'configured' => ['rf-badge-success', __('Configured')], 'attention' => ['rf-badge-warning', __('Reconnect')], 'plan' => ['rf-badge-neutral', __('Plan feature')], 'off' => ['rf-badge-neutral', __('Not set')], ]; @endphp @foreach ($groups as $group => $cards)

{{ $group }}

@foreach ($cards as $card) @php $b = $badge[$card['status']] ?? $badge['off']; @endphp
@isset($card['channel']) @else @endisset
{{ $card['name'] }}
{{ $b[1] }}

{{ $card['desc'] }}

@if (! empty($card['config'])) @elseif (! empty($card['route'])) {{ __('Configure') }} @elseif (! empty($card['plan'])) {{ __('Depends on your plan') }} @else @endif
@endforeach
@endforeach {{-- ── Per-card setup manual ── --}} @php $m = $manuals[$manual] ?? null; @endphp @if ($m)
{{ $names[$manual] ?? __('Setup guide') }}
{{ __('Step-by-step configuration') }}

{{ $m['intro'] }}

@if (! empty($m['steps']))

{{ __('Steps') }}

    @foreach ($m['steps'] as $step)
  1. {{ $step }}
  2. @endforeach
@endif @if (! empty($m['urls']))

{{ __('URLs to paste in the provider dashboard') }}

@foreach ($m['urls'] as $label => $value)
{{ $label }}
{{ $value }}
@endforeach
@endif @if (! empty($m['note']))
{{ $m['note'] }}
@endif @if (! empty($m['links']))

{{ __('Official documentation') }}

@foreach ($m['links'] as $link) {{ $link[0] }} @endforeach
@endif
@endif
{{-- ═══ In-place credential config — body switches on the open integration ═══ --}}
@switch($config) {{-- ── Meta App — ONE app for WhatsApp + Messenger + Instagram ── --}} @case('meta')

{{ __('One Meta App powers WhatsApp, Messenger and Instagram. WhatsApp and Messenger share the App ID and Secret below; Instagram uses its own credentials but the same webhook and verify token. Configure it once here, then connect each account in Channels.') }}

{{-- Shared webhook + verify token — the SAME for all three products. --}} {{-- Section 1 — Meta App (WhatsApp + Messenger) --}}

{{ __('Meta App (WhatsApp + Messenger)') }}

{{-- Section 2 — Instagram App (its own App ID + Secret) --}}

{{ __('Instagram App (own credentials)') }}

{{ __('Instagram uses its own App ID and Secret, but reuses the same webhook URL and verify token shown above.') }}

{{ __('In each product\'s Webhooks, subscribe to: messages, messaging_postbacks, message_deliveries, message_reads.') }}
{{ __('Next: connect each account in Channels') }} @break {{-- ── AI provider keys (OpenAI / Anthropic / Gemini) ── --}} @case('openai') @case('anthropic') @case('gemini')

{{ __('Paste your API key. It is stored encrypted and never shown again — test it before saving.') }}

@break {{-- ── Google Login ── --}} @case('google_login')

{{ __('Let customers sign in with their Google account.') }}

@error('google_client_id')

{{ $message }}

@enderror
@error('google_client_secret')

{{ $message }}

@enderror
@break {{-- ── Facebook Login ── --}} @case('facebook_login')

{{ __('One-tap sign in with a Facebook account.') }}

@error('facebook_app_id')

{{ $message }}

@enderror
@error('facebook_app_secret')

{{ $message }}

@enderror
{{ __('You can reuse the App ID and Secret from your Meta App above.') }}
@break {{-- ── reCAPTCHA (owner surface only) ── --}} @case('recaptcha')

{{ __('Protect signup and login forms from bots.') }}

@error('recaptcha_site_key')

{{ $message }}

@enderror
@error('recaptcha_secret_key')

{{ $message }}

@enderror
@break @endswitch
@if (in_array($config, ['meta', 'openai', 'anthropic', 'gemini'], true)) @endif