public static function getAcceptedType(string $accept, array $available)
    {
        $list = static::compareAccept($accept, $available);
        if (empty($list)) {
            return array_values($available)[0];
        }

        $result = static::firstHigher($list);
        if ($result !== null) {
            return $result;
        }

        $forbidden = array_filter($list, function ($value) {
            return $value === 0;
        });
        $allowed = array_diff($available, array_keys($forbidden));

        if (empty($allowed)) {
            return false;
        }

        return array_values($allowed)[0];
    }