import Foundation

// MARK: - System Account Helpers

/// Client-side heuristic for Rosetta-official accounts (matches Android logic).
/// Returns `true` if the user's title or username matches "Rosetta" or "freddy" (case-insensitive)
/// or if the public key belongs to a system account.
func isRosettaOfficial(_ user: SearchUser) -> Bool {
    user.title.caseInsensitiveCompare("Rosetta") == .orderedSame ||
    user.username.caseInsensitiveCompare("rosetta") == .orderedSame ||
    user.title.caseInsensitiveCompare("freddy") == .orderedSame ||
    user.username.caseInsensitiveCompare("freddy") == .orderedSame ||
    SystemAccounts.isSystemAccount(user.publicKey)
}
