{#if loading}
{#if showSpinner}

{$_('common.loading')}

{/if}
{:else if error}

{$_('oauth.error.title')}

{error}
{:else if consentData}
{#if consentData.logo_uri} {/if}

{consentData.client_name || $_('oauth.consent.title')}

{$_('oauth.consent.appWantsAccess', { values: { app: '' } })}

{#if consentData.client_uri} {consentData.client_uri} {/if}
{#if consentData.is_delegation}
{$_('oauthConsent.delegatedAccess')}
{$_('oauthConsent.actingAs')} {consentData.did}
{$_('oauthConsent.controller')} @{consentData.controller_handle || consentData.controller_did}
{$_('oauthConsent.accessLevel')} {consentData.delegation_level}
{#if consentData.delegation_level && consentData.delegation_level !== 'Owner'}
{$_('oauthConsent.permissionsLimited')}

{#if consentData.delegation_level === 'Viewer'} {$_('oauthConsent.viewerLimitedDesc')} {:else if consentData.delegation_level === 'Editor'} {$_('oauthConsent.editorLimitedDesc')} {:else} {$_('oauthConsent.permissionsLimitedDesc', { values: { level: consentData.delegation_level } })} {/if}

{/if} {:else} {$_('oauth.consent.signingInAs')} {consentData.did} {/if}

{$_('oauth.consent.permissionsRequested')}

{#if consentData.scopes.length === 0}
{$_('oauthConsent.readOnlyAccess')} {$_('oauthConsent.readOnlyDesc')}
{:else} {#each Object.entries(scopeGroups) as [category, scopes]}

{category}

{#each scopes as scope} {/each}
{/each} {/if}
{/if}