// Только явно заявленный Primary может участвовать в официальных подтверждениях. export function accountRoleFromHeader(accountType) { return accountType === 1 ? 'primary' : accountType === 0 ? 'non_voting' : ''; } export function confirmationRights(actor, target) { const a = String(actor?.login || '').trim().toLowerCase(); const b = String(target?.login || '').trim().toLowerCase(); const primary = Boolean(a && b && a !== b && actor?.accountRole === 'primary' && target?.accountRole === 'primary'); return { primary, shine: Boolean(a && b && a !== b && actor?.accountRole === 'primary' && actor?.shineStatus === 'shining' && target?.shineStatus === 'shining') }; }