@php $isOauthApp = $isGithub || $isDatastore; $keySource = $isGithub ? ($githubApp['source'] ?? 'missing') : ($isDatastore ? ($supabaseApp['source'] ?? 'missing') : ($isVisualCatalog ? ($visualKeySource ?? 'missing') : $settings->keySource($provider))); $maskedKey = $isOauthApp ? null : ($isVisualCatalog ? ($visualMaskedKey ?? null) : $settings->maskedKey($provider)); $pricing = is_array($project) ? ($project['pricing'] ?? null) : null; $activeScenario = is_array($project) ? ($project['scenario'] ?? null) : null; $unitCostJs = is_array($project) && $project['unit_cost_usd'] !== null ? (float) $project['unit_cost_usd'] : null; @endphp
{{ __('dashboard.API Integration') }} {{ $providerLabel }}

{{ $providerLabel }}

@if ($isGithub) {{ __('dashboard.OAuth credentials for Lab imports.') }} @elseif ($isVisualCatalog) {{ __('dashboard.Server-side key so Lab can fetch matching photographs.') }} @elseif ($isDatastore) {{ __('dashboard.OAuth credentials so Lab users can connect Supabase from the + menu.') }} @else {{ __('dashboard.API key, models, and project-volume cost for this provider.') }} @endif

{{ __('dashboard.Credentials') }}

@if ($isOauthApp) @if ($keySource === 'workspace') {{ __('dashboard.Configured') }} @elseif ($keySource === 'env') {{ __('dashboard.Using .env') }} @else {{ __('dashboard.Not configured') }} @endif @elseif ($keySource === 'workspace') {{ __('dashboard.Workspace key :masked', ['masked' => $maskedKey]) }} @elseif ($keySource === 'env') {{ __('dashboard.Using .env fallback :masked', ['masked' => $maskedKey]) }} @else {{ __('dashboard.No key configured') }} @endif

@if ($unreadableStoredKey) {{ __('dashboard.Saved key cannot be read') }} {{ __('dashboard.The saved secret can no longer be read. Paste it again to restore this provider.') }} @endif @if ($isGithub) {{-- Decoy fields: stop browsers from injecting saved login credentials. --}} @if ($githubHasStoredSecret) @endif

{{ __('dashboard.Import limits') }}

{{ __('dashboard.Limits applied when Lab imports a GitHub repository archive.') }}

{{ __('dashboard.Allowed range: :min–:max MB. Default is :default MB.', [ 'min' => $maxZipMbMin, 'max' => $maxZipMbMax, 'default' => \App\Lab\Github\LabGithubImportLimits::MAX_ZIP_MB_DEFAULT, ]) }} {{ __('dashboard.Allowed range: :min–:max files. Default is :default. For monorepos set Root directory (e.g. apps/www).', [ 'min' => number_format($maxFilesMin), 'max' => number_format($maxFilesMax), 'default' => number_format(\App\Lab\Github\LabGithubImportLimits::MAX_FILES_DEFAULT), ]) }} @elseif ($isDatastore) @if ($supabaseHasStoredSecret) @endif @if (str_starts_with(strtolower((string) $supabaseCallbackUrl), 'https://')) {{ __('dashboard.Add this callback URL in Supabase Dashboard → Organization → OAuth Apps. Enable Organizations and Projects read (and write if chat should apply SQL).') }} @else {{ __('dashboard.Supabase requires HTTPS') }} {{ __('dashboard.Do not paste http://127.0.0.1 into Supabase. Use your Cloudflare tunnel callback, then save it as the redirect override.') }} @endif @elseif ($isUnsplash) {{ __('dashboard.Unsplash Application ID. From your Unsplash developers page. Lab does not send it with photograph searches.') }} {{ __('dashboard.Unsplash Access Key (Client-ID). Lab uses this to search photographs on the server.') }} @if ($maskedKey) @endif {{ __('dashboard.Unsplash Secret key. Stored encrypted. Photograph search uses the Access Key, not this secret.') }} @if ($visualHasStoredSecret ?? false) @endif @else @if ($isVisualCatalog && filled($visualKeyHint ?? null)) {{ $visualKeyHint }} @endif @if ($maskedKey) @endif @endif {{ __('dashboard.Save provider') }} @unless ($isGithub || $isVisualCatalog || $isDatastore)

{{ __('dashboard.Models') }}

{{ __('dashboard.Only one model can be the Lab default. Turning a switch on replaces the current default.') }}

@if ($workspaceDefault && $workspaceDefault->provider !== $provider)

{{ __('dashboard.Current default: :model.', ['model' => $workspaceDefault->label]) }}

@endif
@if (count($models) > 0)
@foreach ($models as $model) @php $isDefault = $defaultModelId === $model->id; @endphp

{{ $model->label }}

@if ($isDefault)

{{ __('dashboard.Used by Lab until the chat picker chooses another.') }}

@endif
@endforeach
@else {{ __('dashboard.No models registered for this provider in :file.', ['file' => 'config/ai.php']) }} @endif

{{ __('dashboard.Project cost') }}

{{ __('dashboard.Pick a project type, then set how many projects (1–:max).', ['max' => number_format($projectCountMax)]) }}

@if (count($models) > 0)
@foreach ($models as $model) {{ $model->label }} @endforeach @foreach ($scenarios as $scenario) {{ $scenario['label'] }} @endforeach
@if ($project && $activeScenario)

{{ __('dashboard.Estimated API cost') }}

@if ($pricing) ${{ number_format($pricing['input_per_mtok'], 2) }}/M in · ${{ number_format($pricing['output_per_mtok'], 2) }}/M out @endif

{{ $activeScenario['blurb'] }}

@endif @else {{ __('dashboard.No models registered for this provider in :file.', ['file' => 'config/ai.php']) }} @endif
@endunless