/* Sidebar.c generated by valac 0.56.19, the Vala compiler
 * generated from Sidebar.vala, do not modify */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <gee.h>
#include <gio/gio.h>
#include <adwaita.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <json-glib/json-glib.h>
#include <glib/gi18n-lib.h>

#define TUBA_VIEWS_SIDEBAR_MAX_SIDEBAR_LISTS 25
#define TUBA_VIEWS_SIDEBAR_MAX_SIDEBAR_TAGS 25
#define BUILD_NAME "Tuba"
#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define TUBA_TYPE_ACCOUNT_HOLDER (tuba_account_holder_get_type ())
#define TUBA_ACCOUNT_HOLDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ACCOUNT_HOLDER, TubaAccountHolder))
#define TUBA_IS_ACCOUNT_HOLDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ACCOUNT_HOLDER))
#define TUBA_ACCOUNT_HOLDER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TUBA_TYPE_ACCOUNT_HOLDER, TubaAccountHolderIface))

typedef struct _TubaAccountHolder TubaAccountHolder;
typedef struct _TubaAccountHolderIface TubaAccountHolderIface;

#define TUBA_TYPE_ENTITY (tuba_entity_get_type ())
#define TUBA_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ENTITY, TubaEntity))
#define TUBA_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ENTITY, TubaEntityClass))
#define TUBA_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ENTITY))
#define TUBA_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ENTITY))
#define TUBA_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ENTITY, TubaEntityClass))

typedef struct _TubaEntity TubaEntity;
typedef struct _TubaEntityClass TubaEntityClass;

#define TUBA_API_TYPE_ACCOUNT (tuba_api_account_get_type ())
#define TUBA_API_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccount))
#define TUBA_API_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))
#define TUBA_API_IS_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_IS_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))

typedef struct _TubaAPIAccount TubaAPIAccount;
typedef struct _TubaAPIAccountClass TubaAPIAccountClass;

#define TUBA_TYPE_INSTANCE_ACCOUNT (tuba_instance_account_get_type ())
#define TUBA_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccount))
#define TUBA_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))
#define TUBA_IS_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_IS_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_INSTANCE_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))

typedef struct _TubaInstanceAccount TubaInstanceAccount;
typedef struct _TubaInstanceAccountClass TubaInstanceAccountClass;

#define TUBA_VIEWS_TYPE_SIDEBAR (tuba_views_sidebar_get_type ())
#define TUBA_VIEWS_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_TYPE_SIDEBAR, TubaViewsSidebar))
#define TUBA_VIEWS_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_TYPE_SIDEBAR, TubaViewsSidebarClass))
#define TUBA_VIEWS_IS_SIDEBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_TYPE_SIDEBAR))
#define TUBA_VIEWS_IS_SIDEBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_TYPE_SIDEBAR))
#define TUBA_VIEWS_SIDEBAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_TYPE_SIDEBAR, TubaViewsSidebarClass))

typedef struct _TubaViewsSidebar TubaViewsSidebar;
typedef struct _TubaViewsSidebarClass TubaViewsSidebarClass;
typedef struct _TubaViewsSidebarPrivate TubaViewsSidebarPrivate;

#define TUBA_WIDGETS_TYPE_AVATAR (tuba_widgets_avatar_get_type ())
#define TUBA_WIDGETS_AVATAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_AVATAR, TubaWidgetsAvatar))
#define TUBA_WIDGETS_AVATAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_AVATAR, TubaWidgetsAvatarClass))
#define TUBA_WIDGETS_IS_AVATAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_AVATAR))
#define TUBA_WIDGETS_IS_AVATAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_AVATAR))
#define TUBA_WIDGETS_AVATAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_AVATAR, TubaWidgetsAvatarClass))

typedef struct _TubaWidgetsAvatar TubaWidgetsAvatar;
typedef struct _TubaWidgetsAvatarClass TubaWidgetsAvatarClass;
enum  {
	TUBA_VIEWS_SIDEBAR_0_PROPERTY,
	TUBA_VIEWS_SIDEBAR_ACCOUNT_PROPERTY,
	TUBA_VIEWS_SIDEBAR_UNREAD_ANNOUNCEMENTS_PROPERTY,
	TUBA_VIEWS_SIDEBAR_UNREVIEWED_FOLLOW_REQUESTS_PROPERTY,
	TUBA_VIEWS_SIDEBAR_TUBA_WRAPPED_PROPERTY,
	TUBA_VIEWS_SIDEBAR_NUM_PROPERTIES
};
static GParamSpec* tuba_views_sidebar_properties[TUBA_VIEWS_SIDEBAR_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TUBA_TYPE_APPLICATION (tuba_application_get_type ())
#define TUBA_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_APPLICATION, TubaApplication))
#define TUBA_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_APPLICATION, TubaApplicationClass))
#define TUBA_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_APPLICATION))
#define TUBA_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_APPLICATION))
#define TUBA_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_APPLICATION, TubaApplicationClass))

typedef struct _TubaApplication TubaApplication;
typedef struct _TubaApplicationClass TubaApplicationClass;

#define TUBA_VIEWS_SIDEBAR_TYPE_ACCOUNT_ROW (tuba_views_sidebar_account_row_get_type ())
#define TUBA_VIEWS_SIDEBAR_ACCOUNT_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_SIDEBAR_TYPE_ACCOUNT_ROW, TubaViewsSidebarAccountRow))
#define TUBA_VIEWS_SIDEBAR_ACCOUNT_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_SIDEBAR_TYPE_ACCOUNT_ROW, TubaViewsSidebarAccountRowClass))
#define TUBA_VIEWS_SIDEBAR_IS_ACCOUNT_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_SIDEBAR_TYPE_ACCOUNT_ROW))
#define TUBA_VIEWS_SIDEBAR_IS_ACCOUNT_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_SIDEBAR_TYPE_ACCOUNT_ROW))
#define TUBA_VIEWS_SIDEBAR_ACCOUNT_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_SIDEBAR_TYPE_ACCOUNT_ROW, TubaViewsSidebarAccountRowClass))

typedef struct _TubaViewsSidebarAccountRow TubaViewsSidebarAccountRow;
typedef struct _TubaViewsSidebarAccountRowClass TubaViewsSidebarAccountRowClass;
typedef struct _Block80Data Block80Data;
#define _g_free0(var) (var = (g_free (var), NULL))

#define TUBA_DIALOGS_TYPE_MAIN_WINDOW (tuba_dialogs_main_window_get_type ())
#define TUBA_DIALOGS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_TYPE_MAIN_WINDOW, TubaDialogsMainWindow))
#define TUBA_DIALOGS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_TYPE_MAIN_WINDOW, TubaDialogsMainWindowClass))
#define TUBA_DIALOGS_IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_TYPE_MAIN_WINDOW))
#define TUBA_DIALOGS_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_TYPE_MAIN_WINDOW))
#define TUBA_DIALOGS_MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_TYPE_MAIN_WINDOW, TubaDialogsMainWindowClass))

typedef struct _TubaDialogsMainWindow TubaDialogsMainWindow;
typedef struct _TubaDialogsMainWindowClass TubaDialogsMainWindowClass;

#define TUBA_TYPE_WIDGETIZABLE (tuba_widgetizable_get_type ())
#define TUBA_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_WIDGETIZABLE, TubaWidgetizable))
#define TUBA_IS_WIDGETIZABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_WIDGETIZABLE))
#define TUBA_WIDGETIZABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TUBA_TYPE_WIDGETIZABLE, TubaWidgetizableIface))

typedef struct _TubaWidgetizable TubaWidgetizable;
typedef struct _TubaWidgetizableIface TubaWidgetizableIface;
typedef struct _TubaEntityPrivate TubaEntityPrivate;

#define TUBA_API_TYPE_SEARCH_RESULT (tuba_api_search_result_get_type ())
#define TUBA_API_SEARCH_RESULT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_SEARCH_RESULT, TubaAPISearchResult))
#define TUBA_API_IS_SEARCH_RESULT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_SEARCH_RESULT))
#define TUBA_API_SEARCH_RESULT_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TUBA_API_TYPE_SEARCH_RESULT, TubaAPISearchResultIface))

typedef struct _TubaAPISearchResult TubaAPISearchResult;
typedef struct _TubaAPISearchResultIface TubaAPISearchResultIface;
typedef struct _TubaAPIAccountPrivate TubaAPIAccountPrivate;

#define TUBA_TYPE_STREAMABLE (tuba_streamable_get_type ())
#define TUBA_STREAMABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_STREAMABLE, TubaStreamable))
#define TUBA_IS_STREAMABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_STREAMABLE))
#define TUBA_STREAMABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TUBA_TYPE_STREAMABLE, TubaStreamableIface))

typedef struct _TubaStreamable TubaStreamable;
typedef struct _TubaStreamableIface TubaStreamableIface;
typedef struct _TubaInstanceAccountPrivate TubaInstanceAccountPrivate;

#define TUBA_INSTANCE_ACCOUNT_TYPE_KIND (tuba_instance_account_kind_get_type ())
typedef struct _TubaInstanceAccountKind TubaInstanceAccountKind;

#define TUBA_TYPE_PLACE (tuba_place_get_type ())
#define TUBA_PLACE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_PLACE, TubaPlace))
#define TUBA_PLACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_PLACE, TubaPlaceClass))
#define TUBA_IS_PLACE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_PLACE))
#define TUBA_IS_PLACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_PLACE))
#define TUBA_PLACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_PLACE, TubaPlaceClass))

typedef struct _TubaPlace TubaPlace;
typedef struct _TubaPlaceClass TubaPlaceClass;

#define TUBA_API_TYPE_NOTIFICATION (tuba_api_notification_get_type ())
#define TUBA_API_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_NOTIFICATION, TubaAPINotification))
#define TUBA_API_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_NOTIFICATION, TubaAPINotificationClass))
#define TUBA_API_IS_NOTIFICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_NOTIFICATION))
#define TUBA_API_IS_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_NOTIFICATION))
#define TUBA_API_NOTIFICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_NOTIFICATION, TubaAPINotificationClass))

typedef struct _TubaAPINotification TubaAPINotification;
typedef struct _TubaAPINotificationClass TubaAPINotificationClass;

#define TUBA_INSTANCE_ACCOUNT_TYPE_VISIBILITY (tuba_instance_account_visibility_get_type ())
#define TUBA_INSTANCE_ACCOUNT_VISIBILITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_INSTANCE_ACCOUNT_TYPE_VISIBILITY, TubaInstanceAccountVisibility))
#define TUBA_INSTANCE_ACCOUNT_VISIBILITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_INSTANCE_ACCOUNT_TYPE_VISIBILITY, TubaInstanceAccountVisibilityClass))
#define TUBA_INSTANCE_ACCOUNT_IS_VISIBILITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_INSTANCE_ACCOUNT_TYPE_VISIBILITY))
#define TUBA_INSTANCE_ACCOUNT_IS_VISIBILITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_INSTANCE_ACCOUNT_TYPE_VISIBILITY))
#define TUBA_INSTANCE_ACCOUNT_VISIBILITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_INSTANCE_ACCOUNT_TYPE_VISIBILITY, TubaInstanceAccountVisibilityClass))

typedef struct _TubaInstanceAccountVisibility TubaInstanceAccountVisibility;
typedef struct _TubaInstanceAccountVisibilityClass TubaInstanceAccountVisibilityClass;

#define TUBA_VIEWS_SIDEBAR_TYPE_ITEM_ROW (tuba_views_sidebar_item_row_get_type ())
#define TUBA_VIEWS_SIDEBAR_ITEM_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_VIEWS_SIDEBAR_TYPE_ITEM_ROW, TubaViewsSidebarItemRow))
#define TUBA_VIEWS_SIDEBAR_ITEM_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_VIEWS_SIDEBAR_TYPE_ITEM_ROW, TubaViewsSidebarItemRowClass))
#define TUBA_VIEWS_SIDEBAR_IS_ITEM_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_VIEWS_SIDEBAR_TYPE_ITEM_ROW))
#define TUBA_VIEWS_SIDEBAR_IS_ITEM_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_VIEWS_SIDEBAR_TYPE_ITEM_ROW))
#define TUBA_VIEWS_SIDEBAR_ITEM_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_VIEWS_SIDEBAR_TYPE_ITEM_ROW, TubaViewsSidebarItemRowClass))

typedef struct _TubaViewsSidebarItemRow TubaViewsSidebarItemRow;
typedef struct _TubaViewsSidebarItemRowClass TubaViewsSidebarItemRowClass;
typedef void (*TubaPlaceOpenFunc) (TubaDialogsMainWindow* window, GObject* extra);

#define TUBA_DIALOGS_TYPE_SAVEABLE (tuba_dialogs_saveable_get_type ())
#define TUBA_DIALOGS_SAVEABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_TYPE_SAVEABLE, TubaDialogsSaveable))
#define TUBA_DIALOGS_IS_SAVEABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_TYPE_SAVEABLE))
#define TUBA_DIALOGS_SAVEABLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), TUBA_DIALOGS_TYPE_SAVEABLE, TubaDialogsSaveableIface))

typedef struct _TubaDialogsSaveable TubaDialogsSaveable;
typedef struct _TubaDialogsSaveableIface TubaDialogsSaveableIface;
typedef struct _TubaDialogsMainWindowPrivate TubaDialogsMainWindowPrivate;
typedef struct _TubaViewsSidebarAccountRowPrivate TubaViewsSidebarAccountRowPrivate;

#define TUBA_TYPE_ACCOUNT_STORE (tuba_account_store_get_type ())
#define TUBA_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStore))
#define TUBA_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStoreClass))
#define TUBA_IS_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ACCOUNT_STORE))
#define TUBA_IS_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ACCOUNT_STORE))
#define TUBA_ACCOUNT_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStoreClass))

typedef struct _TubaAccountStore TubaAccountStore;
typedef struct _TubaAccountStoreClass TubaAccountStoreClass;

#define TUBA_DIALOGS_TYPE_NEW_ACCOUNT (tuba_dialogs_new_account_get_type ())
#define TUBA_DIALOGS_NEW_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_TYPE_NEW_ACCOUNT, TubaDialogsNewAccount))
#define TUBA_DIALOGS_NEW_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_TYPE_NEW_ACCOUNT, TubaDialogsNewAccountClass))
#define TUBA_DIALOGS_IS_NEW_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_TYPE_NEW_ACCOUNT))
#define TUBA_DIALOGS_IS_NEW_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_TYPE_NEW_ACCOUNT))
#define TUBA_DIALOGS_NEW_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_TYPE_NEW_ACCOUNT, TubaDialogsNewAccountClass))

typedef struct _TubaDialogsNewAccount TubaDialogsNewAccount;
typedef struct _TubaDialogsNewAccountClass TubaDialogsNewAccountClass;
typedef struct _TubaViewsSidebarItemRowPrivate TubaViewsSidebarItemRowPrivate;
enum  {
	TUBA_VIEWS_SIDEBAR_ITEM_ROW_0_PROPERTY,
	TUBA_VIEWS_SIDEBAR_ITEM_ROW_PLACE_PROPERTY,
	TUBA_VIEWS_SIDEBAR_ITEM_ROW_NUM_PROPERTIES
};
static GParamSpec* tuba_views_sidebar_item_row_properties[TUBA_VIEWS_SIDEBAR_ITEM_ROW_NUM_PROPERTIES];
enum  {
	TUBA_VIEWS_SIDEBAR_ACCOUNT_ROW_0_PROPERTY,
	TUBA_VIEWS_SIDEBAR_ACCOUNT_ROW_NUM_PROPERTIES
};
static GParamSpec* tuba_views_sidebar_account_row_properties[TUBA_VIEWS_SIDEBAR_ACCOUNT_ROW_NUM_PROPERTIES];

#define TUBA_APPLICATION_TYPE_QUESTION_TEXT (tuba_application_question_text_get_type ())
typedef struct _TubaApplicationQuestionText TubaApplicationQuestionText;

#define TUBA_APPLICATION_TYPE_QUESTION_BUTTONS (tuba_application_question_buttons_get_type ())
typedef struct _TubaApplicationQuestionButtons TubaApplicationQuestionButtons;

#define TUBA_APPLICATION_TYPE_QUESTION_BUTTON (tuba_application_question_button_get_type ())
typedef struct _TubaApplicationQuestionButton TubaApplicationQuestionButton;
typedef enum  {
	TUBA_APPLICATION_QUESTION_ANSWER_YES,
	TUBA_APPLICATION_QUESTION_ANSWER_NO,
	TUBA_APPLICATION_QUESTION_ANSWER_CLOSE
} TubaApplicationQuestionAnswer;

#define TUBA_APPLICATION_TYPE_QUESTION_ANSWER (tuba_application_question_answer_get_type ())
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
enum  {
	TUBA_VIEWS_SIDEBAR_ACCOUNT_ROW_POPDOWN_SIGNAL_SIGNAL,
	TUBA_VIEWS_SIDEBAR_ACCOUNT_ROW_NUM_SIGNALS
};
static guint tuba_views_sidebar_account_row_signals[TUBA_VIEWS_SIDEBAR_ACCOUNT_ROW_NUM_SIGNALS] = {0};
#define _g_variant_unref0(var) ((var == NULL) ? NULL : (var = (g_variant_unref (var), NULL)))

#define TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS (tuba_widgets_label_with_widgets_get_type ())
#define TUBA_WIDGETS_LABEL_WITH_WIDGETS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS, TubaWidgetsLabelWithWidgets))
#define TUBA_WIDGETS_LABEL_WITH_WIDGETS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS, TubaWidgetsLabelWithWidgetsClass))
#define TUBA_WIDGETS_IS_LABEL_WITH_WIDGETS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS))
#define TUBA_WIDGETS_IS_LABEL_WITH_WIDGETS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS))
#define TUBA_WIDGETS_LABEL_WITH_WIDGETS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_LABEL_WITH_WIDGETS, TubaWidgetsLabelWithWidgetsClass))

typedef struct _TubaWidgetsLabelWithWidgets TubaWidgetsLabelWithWidgets;
typedef struct _TubaWidgetsLabelWithWidgetsClass TubaWidgetsLabelWithWidgetsClass;

#define TUBA_WIDGETS_TYPE_EMOJI_LABEL (tuba_widgets_emoji_label_get_type ())
#define TUBA_WIDGETS_EMOJI_LABEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_EMOJI_LABEL, TubaWidgetsEmojiLabel))
#define TUBA_WIDGETS_EMOJI_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_EMOJI_LABEL, TubaWidgetsEmojiLabelClass))
#define TUBA_WIDGETS_IS_EMOJI_LABEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_EMOJI_LABEL))
#define TUBA_WIDGETS_IS_EMOJI_LABEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_EMOJI_LABEL))
#define TUBA_WIDGETS_EMOJI_LABEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_EMOJI_LABEL, TubaWidgetsEmojiLabelClass))

typedef struct _TubaWidgetsEmojiLabel TubaWidgetsEmojiLabel;
typedef struct _TubaWidgetsEmojiLabelClass TubaWidgetsEmojiLabelClass;

struct _TubaAccountHolderIface {
	GTypeInterface parent_iface;
	void (*on_account_changed) (TubaAccountHolder* self, TubaInstanceAccount* acc);
	void (*on_accounts_changed) (TubaAccountHolder* self, GeeArrayList* accounts);
	TubaInstanceAccount* (*get_account) (TubaAccountHolder* self);
	void (*set_account) (TubaAccountHolder* self, TubaInstanceAccount* value);
};

struct _TubaViewsSidebar {
	GtkWidget parent_instance;
	TubaViewsSidebarPrivate * priv;
	GtkSliceListModel* tags_items;
	GtkSliceListModel* app_items;
	GtkSliceListModel* account_items;
	GtkFlattenListModel* item_model;
	GListStore* accounts_model;
};

struct _TubaViewsSidebarClass {
	GtkWidgetClass parent_class;
	GtkWidget* (*on_accounts_row_create) (TubaViewsSidebar* self, GObject* obj);
	void (*on_accounts_changed) (TubaViewsSidebar* self, GeeArrayList* accounts);
	void (*on_account_changed) (TubaViewsSidebar* self, TubaInstanceAccount* account);
};

struct _TubaViewsSidebarPrivate {
	GtkListBox* items;
	GtkListBox* saved_accounts;
	TubaWidgetsAvatar* accounts_button_avi;
	GtkMenuButton* menu_btn;
	GtkPopover* account_switcher_popover_menu;
	AdwBanner* announcements_banner;
	AdwBanner* fr_banner;
	AdwBanner* network_banner;
	TubaInstanceAccount* _account;
	GBinding* sidebar_avatar_btn;
	GBinding* announcements_banner_binding;
	GBinding* fr_banner_binding;
	GBinding* wrapped_binding;
};

struct _Block80Data {
	int _ref_count_;
	TubaViewsSidebar* self;
	GObject** accounts_to_add;
	gint accounts_to_add_length1;
	gint _accounts_to_add_size_;
};

struct _TubaWidgetizableIface {
	GTypeInterface parent_iface;
	GtkWidget* (*to_widget) (TubaWidgetizable* self);
	void (*open) (TubaWidgetizable* self);
	void (*resolve_open) (TubaWidgetizable* self, TubaInstanceAccount* account);
};

struct _TubaEntity {
	GObject parent_instance;
	TubaEntityPrivate * priv;
};

struct _TubaEntityClass {
	GObjectClass parent_class;
	gboolean (*is_local) (TubaEntity* self, TubaInstanceAccount* account);
	GType (*deserialize_array_type) (TubaEntity* self, const gchar* prop);
};

struct _TubaAPISearchResultIface {
	GTypeInterface parent_iface;
	GRegex* (*get_tuba_search_query_regex) (TubaAPISearchResult* self);
	void (*set_tuba_search_query_regex) (TubaAPISearchResult* self, GRegex* value);
};

struct _TubaAPIAccount {
	TubaEntity parent_instance;
	TubaAPIAccountPrivate * priv;
};

struct _TubaAPIAccountClass {
	TubaEntityClass parent_class;
};

struct _TubaStreamableIface {
	GTypeInterface parent_iface;
	gchar* (*get_stream_url) (TubaStreamable* self);
	void (*on_streaming_policy_changed) (TubaStreamable* self);
	const gchar* (*get_t_connection_url) (TubaStreamable* self);
	void (*set_t_connection_url) (TubaStreamable* self, const gchar* value);
	gboolean (*get_subscribed) (TubaStreamable* self);
	void (*set_subscribed) (TubaStreamable* self, gboolean value);
};

struct _TubaInstanceAccountKind {
	gchar* icon;
	gchar* description;
	gchar* url;
};

struct _TubaInstanceAccount {
	TubaAPIAccount parent_instance;
	TubaInstanceAccountPrivate * priv;
	GListStore* known_places;
	GListStore* list_places;
	GListStore* tags_places;
	GeeHashMap* type_overrides;
	GeeHashMap* visibility;
	GListStore* visibility_list;
	GListStore* supported_mime_types;
};

struct _TubaInstanceAccountClass {
	TubaAPIAccountClass parent_class;
	void (*describe_kind) (TubaInstanceAccount* self, const gchar* kind, TubaInstanceAccountKind* _result_, const gchar* actor_name, const gchar* callback_url, const gchar* other_data);
	void (*register_known_places) (TubaInstanceAccount* self, GListStore* places);
	void (*register_extra) (TubaInstanceAccount* self, GListStore* places, TubaPlace** extra, gint extra_length1);
	void (*bump_sidebar_items) (TubaInstanceAccount* self);
	void (*check_notifications) (TubaInstanceAccount* self, GAsyncReadyCallback _callback_, gpointer _user_data_);
	void (*check_notifications_finish) (TubaInstanceAccount* self, GAsyncResult* _res_);
	gchar* (*get_stream_url) (TubaInstanceAccount* self);
	void (*on_notification_received) (TubaInstanceAccount* self, TubaAPINotification* entity);
	void (*open_status_url) (TubaInstanceAccount* self, const gchar* url);
	void (*answer_follow_request) (TubaInstanceAccount* self, const gchar* issuer_id, const gchar* fr_id, gboolean accept);
	void (*follow_back) (TubaInstanceAccount* self, const gchar* issuer_id, const gchar* acc_id);
	void (*reply_to_status_uri) (TubaInstanceAccount* self, const gchar* issuer_id, const gchar* uri);
	void (*remove_from_followers) (TubaInstanceAccount* self, const gchar* issuer_id, const gchar* acc_id);
	void (*activated) (TubaInstanceAccount* self);
	void (*deactivated) (TubaInstanceAccount* self);
	void (*added) (TubaInstanceAccount* self);
	void (*removed) (TubaInstanceAccount* self);
};

struct _TubaDialogsSaveableIface {
	GTypeInterface parent_iface;
};

struct _TubaDialogsMainWindow {
	AdwApplicationWindow parent_instance;
	TubaDialogsMainWindowPrivate * priv;
	AdwOverlaySplitView* split_view;
	AdwNavigationPage* main_page;
};

struct _TubaDialogsMainWindowClass {
	AdwApplicationWindowClass parent_class;
};

struct _TubaViewsSidebarAccountRow {
	AdwActionRow parent_instance;
	TubaViewsSidebarAccountRowPrivate * priv;
	TubaInstanceAccount* account;
};

struct _TubaViewsSidebarAccountRowClass {
	AdwActionRowClass parent_class;
};

struct _TubaViewsSidebarItemRow {
	GtkListBoxRow parent_instance;
	TubaViewsSidebarItemRowPrivate * priv;
};

struct _TubaViewsSidebarItemRowClass {
	GtkListBoxRowClass parent_class;
};

struct _TubaViewsSidebarItemRowPrivate {
	TubaPlace* _place;
	GtkImage* icon;
	GtkLabel* label;
	GtkLabel* badge;
};

struct _TubaViewsSidebarAccountRowPrivate {
	TubaWidgetsAvatar* avatar;
	GtkButton* forget;
	GtkLabel* notifications_badge;
	GBinding* switcher_display_name;
	GBinding* switcher_handle;
	GBinding* switcher_tooltip;
	GBinding* switcher_avatar;
	GBinding* switcher_notifications;
	GBinding* switcher_notifications_visibility;
};

struct _TubaApplicationQuestionText {
	gchar* text;
	gboolean use_markup;
};

struct _TubaApplicationQuestionButton {
	gchar* label;
	AdwResponseAppearance appearance;
};

struct _TubaApplicationQuestionButtons {
	TubaApplicationQuestionButton yes;
	TubaApplicationQuestionButton no;
};

static gint TubaViewsSidebar_private_offset;
static gpointer tuba_views_sidebar_parent_class = NULL;
VALA_EXTERN TubaApplication* tuba_app;
VALA_EXTERN TubaAccountStore* tuba_accounts;
static gint TubaViewsSidebarItemRow_private_offset;
static gpointer tuba_views_sidebar_item_row_parent_class = NULL;
static gint TubaViewsSidebarAccountRow_private_offset;
static gpointer tuba_views_sidebar_account_row_parent_class = NULL;
static TubaAccountHolderIface * tuba_views_sidebar_tuba_account_holder_parent_iface = NULL;

VALA_EXTERN GType tuba_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaEntity, g_object_unref)
VALA_EXTERN GType tuba_api_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAccount, g_object_unref)
VALA_EXTERN GType tuba_instance_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaInstanceAccount, g_object_unref)
VALA_EXTERN GType tuba_account_holder_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAccountHolder, g_object_unref)
VALA_EXTERN GType tuba_views_sidebar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsSidebar, g_object_unref)
VALA_EXTERN GType tuba_widgets_avatar_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsAvatar, g_object_unref)
VALA_EXTERN GtkWidget* tuba_views_sidebar_on_accounts_row_create (TubaViewsSidebar* self,
                                                      GObject* obj);
VALA_EXTERN void tuba_views_sidebar_on_accounts_changed (TubaViewsSidebar* self,
                                             GeeArrayList* accounts);
VALA_EXTERN void tuba_views_sidebar_on_account_changed (TubaViewsSidebar* self,
                                            TubaInstanceAccount* account);
static void tuba_views_sidebar_on_network_change (TubaViewsSidebar* self);
VALA_EXTERN GType tuba_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaApplication, g_object_unref)
VALA_EXTERN gboolean tuba_application_get_is_online (TubaApplication* self);
static GtkWidget* tuba_views_sidebar_real_on_accounts_row_create (TubaViewsSidebar* self,
                                                           GObject* obj);
VALA_EXTERN GType tuba_views_sidebar_account_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsSidebarAccountRow, g_object_unref)
VALA_EXTERN TubaViewsSidebarAccountRow* tuba_views_sidebar_account_row_new (TubaInstanceAccount* _account);
VALA_EXTERN TubaViewsSidebarAccountRow* tuba_views_sidebar_account_row_construct (GType object_type,
                                                                      TubaInstanceAccount* _account);
static void tuba_views_sidebar_popdown (TubaViewsSidebar* self);
static void _tuba_views_sidebar_popdown_tuba_views_sidebar_account_row_popdown_signal (TubaViewsSidebarAccountRow* _sender,
                                                                                gpointer self);
static void tuba_views_sidebar_real_on_accounts_changed (TubaViewsSidebar* self,
                                                  GeeArrayList* accounts);
static Block80Data* block80_data_ref (Block80Data* _data80_);
static void block80_data_unref (void * _userdata_);
static gint tuba_views_sidebar_compare_accounts (TubaInstanceAccount* a,
                                          TubaInstanceAccount* b);
static gint _tuba_views_sidebar_compare_accounts_gcompare_data_func (gconstpointer a,
                                                              gconstpointer b,
                                                              gpointer self);
static gboolean __lambda204_ (Block80Data* _data80_,
                       TubaInstanceAccount* acc);
static void _vala_array_add111 (GObject** * array,
                         gint* length,
                         gint* size,
                         GObject* value);
static gboolean ___lambda204__gee_forall_func (gpointer g,
                                        gpointer self);
static void _vala_array_add112 (GObject** * array,
                         gint* length,
                         gint* size,
                         GObject* value);
static void tuba_views_sidebar_update_selected_account (TubaViewsSidebar* self,
                                                 gboolean clear);
VALA_EXTERN gchar* tuba_instance_account_get_handle (TubaInstanceAccount* self);
VALA_EXTERN TubaInstanceAccount* tuba_account_holder_get_account (TubaAccountHolder* self);
VALA_EXTERN void tuba_views_sidebar_set_sidebar_selected_item (TubaViewsSidebar* self,
                                                   gint index);
static void tuba_views_sidebar_real_on_account_changed (TubaViewsSidebar* self,
                                                 TubaInstanceAccount* account);
VALA_EXTERN void tuba_views_sidebar_set_tuba_wrapped (TubaViewsSidebar* self,
                                          gint value);
VALA_EXTERN void tuba_views_sidebar_set_unread_announcements (TubaViewsSidebar* self,
                                                  gint value);
VALA_EXTERN GType tuba_dialogs_main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsMainWindow, g_object_unref)
VALA_EXTERN TubaDialogsMainWindow* tuba_application_get_main_window (TubaApplication* self);
VALA_EXTERN void tuba_dialogs_main_window_go_back_to_start (TubaDialogsMainWindow* self);
VALA_EXTERN void tuba_account_holder_set_account (TubaAccountHolder* self,
                                      TubaInstanceAccount* value);
VALA_EXTERN GType tuba_widgetizable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetizable, g_object_unref)
VALA_EXTERN GType tuba_api_search_result_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPISearchResult, g_object_unref)
VALA_EXTERN GType tuba_streamable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaStreamable, g_object_unref)
VALA_EXTERN GType tuba_instance_account_kind_get_type (void) G_GNUC_CONST ;
VALA_EXTERN TubaInstanceAccountKind* tuba_instance_account_kind_dup (const TubaInstanceAccountKind* self);
VALA_EXTERN void tuba_instance_account_kind_free (TubaInstanceAccountKind* self);
VALA_EXTERN void tuba_instance_account_kind_copy (const TubaInstanceAccountKind* self,
                                      TubaInstanceAccountKind* dest);
VALA_EXTERN void tuba_instance_account_kind_destroy (TubaInstanceAccountKind* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (TubaInstanceAccountKind, tuba_instance_account_kind_destroy)
VALA_EXTERN GType tuba_place_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaPlace, g_object_unref)
VALA_EXTERN GType tuba_api_notification_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPINotification, g_object_unref)
VALA_EXTERN GType tuba_instance_account_visibility_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaInstanceAccountVisibility, g_object_unref)
VALA_EXTERN gboolean tuba_instance_account_get_admin_mode (TubaInstanceAccount* self);
VALA_EXTERN void tuba_widgets_avatar_set_account (TubaWidgetsAvatar* self,
                                      TubaAPIAccount* value);
static GtkWidget* tuba_views_sidebar_on_item_create (TubaViewsSidebar* self,
                                              GObject* obj);
VALA_EXTERN TubaViewsSidebarItemRow* tuba_views_sidebar_item_row_new (TubaPlace* place);
VALA_EXTERN TubaViewsSidebarItemRow* tuba_views_sidebar_item_row_construct (GType object_type,
                                                                TubaPlace* place);
VALA_EXTERN GType tuba_views_sidebar_item_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaViewsSidebarItemRow, g_object_unref)
static void tuba_views_sidebar_on_item_activated (TubaViewsSidebar* self,
                                           GtkListBoxRow* _row);
VALA_EXTERN TubaPlace* tuba_views_sidebar_item_row_get_place (TubaViewsSidebarItemRow* self);
VALA_EXTERN TubaPlaceOpenFunc tuba_place_get_open_func (TubaPlace* self);
VALA_EXTERN GObject* tuba_place_get_extra_data (TubaPlace* self);
VALA_EXTERN GType tuba_dialogs_saveable_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsSaveable, g_object_unref)
static void _tuba_views_sidebar_on_item_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                       GtkListBoxRow* row,
                                                                       gpointer self);
static void tuba_views_sidebar_on_item_header_update (TubaViewsSidebar* self,
                                               GtkListBoxRow* _row,
                                               GtkListBoxRow* _before);
VALA_EXTERN gboolean tuba_place_get_separated (TubaPlace* self);
static void tuba_views_sidebar_view_announcements_cb (TubaViewsSidebar* self);
VALA_EXTERN void tuba_application_open_announcements (TubaApplication* self);
static void tuba_views_sidebar_view_fr_cb (TubaViewsSidebar* self);
VALA_EXTERN void tuba_application_open_follow_requests (TubaApplication* self);
static void tuba_views_sidebar_on_account_header_update (TubaViewsSidebar* self,
                                                  GtkListBoxRow* _row,
                                                  GtkListBoxRow* _before);
static void tuba_views_sidebar_on_account_activated (TubaViewsSidebar* self,
                                              GtkListBoxRow* _row);
VALA_EXTERN GType tuba_account_store_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAccountStore, g_object_unref)
VALA_EXTERN void tuba_account_store_activate (TubaAccountStore* self,
                                  TubaInstanceAccount* account,
                                  gboolean clear_cache);
VALA_EXTERN TubaDialogsNewAccount* tuba_dialogs_new_account_new (gboolean can_access_settings,
                                                     TubaInstanceAccount* account_to_update);
VALA_EXTERN TubaDialogsNewAccount* tuba_dialogs_new_account_construct (GType object_type,
                                                           gboolean can_access_settings,
                                                           TubaInstanceAccount* account_to_update);
VALA_EXTERN GType tuba_dialogs_new_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsNewAccount, g_object_unref)
static void _tuba_views_sidebar_on_account_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                          GtkListBoxRow* row,
                                                                          gpointer self);
VALA_EXTERN TubaViewsSidebar* tuba_views_sidebar_new (void);
VALA_EXTERN TubaViewsSidebar* tuba_views_sidebar_construct (GType object_type);
VALA_EXTERN void tuba_views_sidebar_set_unreviewed_follow_requests (TubaViewsSidebar* self,
                                                        gint value);
static void tuba_views_sidebar_item_row_on_visibility_changed (TubaViewsSidebarItemRow* self);
static void _tuba_views_sidebar_item_row_on_visibility_changed_g_object_notify (GObject* _sender,
                                                                         GParamSpec* pspec,
                                                                         gpointer self);
VALA_EXTERN void tuba_views_sidebar_item_row_set_place (TubaViewsSidebarItemRow* self,
                                            TubaPlace* value);
static gboolean __lambda119_ (TubaViewsSidebarItemRow* self,
                       GBinding* b,
                       GValue* src,
                       GValue* target);
static gboolean ___lambda119__gbinding_transform_func (GBinding* binding,
                                                GValue* from_value,
                                                GValue* to_value,
                                                gpointer self);
static void tuba_views_sidebar_item_row_on_attention_change (TubaViewsSidebarItemRow* self);
static void _tuba_views_sidebar_item_row_on_attention_change_g_object_notify (GObject* _sender,
                                                                       GParamSpec* pspec,
                                                                       gpointer self);
VALA_EXTERN gboolean tuba_place_get_visible (TubaPlace* self);
VALA_EXTERN gboolean tuba_place_get_needs_attention (TubaPlace* self);
static void tuba_views_sidebar_item_row_finalize (GObject * obj);
static GType tuba_views_sidebar_item_row_get_type_once (void);
static void _vala_tuba_views_sidebar_item_row_get_property (GObject * object,
                                                     guint property_id,
                                                     GValue * value,
                                                     GParamSpec * pspec);
static void _vala_tuba_views_sidebar_item_row_set_property (GObject * object,
                                                     guint property_id,
                                                     const GValue * value,
                                                     GParamSpec * pspec);
static gboolean tuba_views_sidebar_account_row_switcher_notifications_visibility_cb (TubaViewsSidebarAccountRow* self,
                                                                              GBinding* binding,
                                                                              GValue* from_value,
                                                                              GValue* to_value);
static gboolean _tuba_views_sidebar_account_row_switcher_notifications_visibility_cb_gbinding_transform_func (GBinding* binding,
                                                                                                       GValue* from_value,
                                                                                                       GValue* to_value,
                                                                                                       gpointer self);
static void tuba_views_sidebar_account_row_on_open (TubaViewsSidebarAccountRow* self);
VALA_EXTERN void tuba_widgetizable_resolve_open (TubaWidgetizable* self,
                                     TubaInstanceAccount* account);
VALA_EXTERN TubaInstanceAccount* tuba_account_store_get_active (TubaAccountStore* self);
static void _tuba_views_sidebar_account_row_on_open_gtk_button_clicked (GtkButton* _sender,
                                                                 gpointer self);
static void tuba_views_sidebar_account_row_on_forget (TubaViewsSidebarAccountRow* self);
VALA_EXTERN GType tuba_application_question_text_get_type (void) G_GNUC_CONST ;
VALA_EXTERN TubaApplicationQuestionText* tuba_application_question_text_dup (const TubaApplicationQuestionText* self);
VALA_EXTERN void tuba_application_question_text_free (TubaApplicationQuestionText* self);
VALA_EXTERN void tuba_application_question_text_copy (const TubaApplicationQuestionText* self,
                                          TubaApplicationQuestionText* dest);
VALA_EXTERN void tuba_application_question_text_destroy (TubaApplicationQuestionText* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (TubaApplicationQuestionText, tuba_application_question_text_destroy)
VALA_EXTERN GType tuba_application_question_buttons_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType tuba_application_question_button_get_type (void) G_GNUC_CONST ;
VALA_EXTERN TubaApplicationQuestionButton* tuba_application_question_button_dup (const TubaApplicationQuestionButton* self);
VALA_EXTERN void tuba_application_question_button_free (TubaApplicationQuestionButton* self);
VALA_EXTERN void tuba_application_question_button_copy (const TubaApplicationQuestionButton* self,
                                            TubaApplicationQuestionButton* dest);
VALA_EXTERN void tuba_application_question_button_destroy (TubaApplicationQuestionButton* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (TubaApplicationQuestionButton, tuba_application_question_button_destroy)
VALA_EXTERN TubaApplicationQuestionButtons* tuba_application_question_buttons_dup (const TubaApplicationQuestionButtons* self);
VALA_EXTERN void tuba_application_question_buttons_free (TubaApplicationQuestionButtons* self);
VALA_EXTERN void tuba_application_question_buttons_copy (const TubaApplicationQuestionButtons* self,
                                             TubaApplicationQuestionButtons* dest);
VALA_EXTERN void tuba_application_question_buttons_destroy (TubaApplicationQuestionButtons* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (TubaApplicationQuestionButtons, tuba_application_question_buttons_destroy)
VALA_EXTERN void tuba_application_question (TubaApplication* self,
                                TubaApplicationQuestionText* title,
                                TubaApplicationQuestionText* msg,
                                GtkWidget* win,
                                TubaApplicationQuestionButtons* buttons,
                                GtkWidget* child,
                                gboolean skip,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_);
VALA_EXTERN GType tuba_application_question_answer_get_type (void) G_GNUC_CONST ;
VALA_EXTERN TubaApplicationQuestionAnswer tuba_application_question_finish (TubaApplication* self,
                                                                GAsyncResult* _res_);
VALA_EXTERN const gchar* tuba_api_account_get_username (TubaAPIAccount* self);
VALA_EXTERN gchar* tuba_api_account_get_domain (TubaAPIAccount* self);
static void __lambda203_ (TubaViewsSidebarAccountRow* self,
                   GObject* obj,
                   GAsyncResult* res);
VALA_EXTERN gboolean tuba_application_question_answer_truthy (TubaApplicationQuestionAnswer self);
VALA_EXTERN void tuba_account_store_remove (TubaAccountStore* self,
                                TubaInstanceAccount* account,
                                GError** error);
static void ___lambda203__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void _tuba_views_sidebar_account_row_on_forget_gtk_button_clicked (GtkButton* _sender,
                                                                   gpointer self);
static void tuba_views_sidebar_account_row_finalize (GObject * obj);
static GType tuba_views_sidebar_account_row_get_type_once (void);
static GObject * tuba_views_sidebar_constructor (GType type,
                                          guint n_construct_properties,
                                          GObjectConstructParam * construct_properties);
static GtkWidget* _tuba_views_sidebar_on_accounts_row_create_gtk_list_box_create_widget_func (GObject* item,
                                                                                       gpointer self);
static GVariant* _variant_new31 (const gchar* value);
static GVariant* _variant_new32 (const gchar* value);
static GVariant* _variant_new33 (const gchar* value);
static GtkWidget* _tuba_views_sidebar_on_item_create_gtk_list_box_create_widget_func (GObject* item,
                                                                               gpointer self);
static void _tuba_views_sidebar_on_item_header_update_gtk_list_box_update_header_func (GtkListBoxRow* row,
                                                                                GtkListBoxRow* before,
                                                                                gpointer self);
static void _tuba_views_sidebar_on_account_header_update_gtk_list_box_update_header_func (GtkListBoxRow* row,
                                                                                   GtkListBoxRow* before,
                                                                                   gpointer self);
VALA_EXTERN void tuba_account_holder_construct_account_holder (TubaAccountHolder* self);
static void _tuba_views_sidebar_view_announcements_cb_adw_banner_button_clicked (AdwBanner* _sender,
                                                                          gpointer self);
static void _tuba_views_sidebar_view_fr_cb_adw_banner_button_clicked (AdwBanner* _sender,
                                                               gpointer self);
static void _tuba_views_sidebar_on_network_change_g_object_notify (GObject* _sender,
                                                            GParamSpec* pspec,
                                                            gpointer self);
VALA_EXTERN GType tuba_widgets_label_with_widgets_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsLabelWithWidgets, g_object_unref)
VALA_EXTERN GType tuba_widgets_emoji_label_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsEmojiLabel, g_object_unref)
VALA_EXTERN void tuba_account_holder_on_accounts_changed (TubaAccountHolder* self,
                                              GeeArrayList* accounts);
VALA_EXTERN void tuba_account_holder_on_account_changed (TubaAccountHolder* self,
                                             TubaInstanceAccount* acc);
static void tuba_views_sidebar_finalize (GObject * obj);
static GType tuba_views_sidebar_get_type_once (void);
static void _vala_tuba_views_sidebar_get_property (GObject * object,
                                            guint property_id,
                                            GValue * value,
                                            GParamSpec * pspec);
static void _vala_tuba_views_sidebar_set_property (GObject * object,
                                            guint property_id,
                                            const GValue * value,
                                            GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
tuba_views_sidebar_get_instance_private (TubaViewsSidebar* self)
{
	return G_STRUCT_MEMBER_P (self, TubaViewsSidebar_private_offset);
}

static void
tuba_views_sidebar_on_network_change (TubaViewsSidebar* self)
{
	AdwBanner* _tmp0_;
	TubaApplication* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->network_banner;
	_tmp1_ = tuba_app;
	_tmp2_ = tuba_application_get_is_online (_tmp1_);
	_tmp3_ = _tmp2_;
	adw_banner_set_revealed (_tmp0_, !_tmp3_);
}

static void
_tuba_views_sidebar_popdown_tuba_views_sidebar_account_row_popdown_signal (TubaViewsSidebarAccountRow* _sender,
                                                                           gpointer self)
{
	tuba_views_sidebar_popdown ((TubaViewsSidebar*) self);
}

static GtkWidget*
tuba_views_sidebar_real_on_accounts_row_create (TubaViewsSidebar* self,
                                                GObject* obj)
{
	TubaViewsSidebarAccountRow* row = NULL;
	TubaViewsSidebarAccountRow* _tmp0_;
	GtkWidget* result;
	g_return_val_if_fail (obj != NULL, NULL);
	_tmp0_ = tuba_views_sidebar_account_row_new (TUBA_IS_INSTANCE_ACCOUNT (obj) ? ((TubaInstanceAccount*) obj) : NULL);
	g_object_ref_sink (_tmp0_);
	row = _tmp0_;
	g_signal_connect_object (row, "popdown-signal", (GCallback) _tuba_views_sidebar_popdown_tuba_views_sidebar_account_row_popdown_signal, self, 0);
	result = (GtkWidget*) row;
	return result;
}

GtkWidget*
tuba_views_sidebar_on_accounts_row_create (TubaViewsSidebar* self,
                                           GObject* obj)
{
	TubaViewsSidebarClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = TUBA_VIEWS_SIDEBAR_GET_CLASS (self);
	if (_klass_->on_accounts_row_create) {
		return _klass_->on_accounts_row_create (self, obj);
	}
	return NULL;
}

static Block80Data*
block80_data_ref (Block80Data* _data80_)
{
	g_atomic_int_inc (&_data80_->_ref_count_);
	return _data80_;
}

static void
block80_data_unref (void * _userdata_)
{
	Block80Data* _data80_;
	_data80_ = (Block80Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data80_->_ref_count_)) {
		TubaViewsSidebar* self;
		self = _data80_->self;
		_data80_->accounts_to_add = (_vala_array_free (_data80_->accounts_to_add, _data80_->accounts_to_add_length1, (GDestroyNotify) g_object_unref), NULL);
		_g_object_unref0 (self);
		g_slice_free (Block80Data, _data80_);
	}
}

static gint
_tuba_views_sidebar_compare_accounts_gcompare_data_func (gconstpointer a,
                                                         gconstpointer b,
                                                         gpointer self)
{
	gint result;
	result = tuba_views_sidebar_compare_accounts ((TubaInstanceAccount*) a, (TubaInstanceAccount*) b);
	return result;
}

static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

static void
_vala_array_add111 (GObject** * array,
                    gint* length,
                    gint* size,
                    GObject* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GObject*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static gboolean
__lambda204_ (Block80Data* _data80_,
              TubaInstanceAccount* acc)
{
	TubaViewsSidebar* self;
	GObject* _tmp0_;
	gboolean result;
	self = _data80_->self;
	g_return_val_if_fail (acc != NULL, FALSE);
	_tmp0_ = _g_object_ref0 ((GObject*) acc);
	_vala_array_add111 (&_data80_->accounts_to_add, &_data80_->accounts_to_add_length1, &_data80_->_accounts_to_add_size_, _tmp0_);
	result = TRUE;
	_g_object_unref0 (acc);
	return result;
}

static gboolean
___lambda204__gee_forall_func (gpointer g,
                               gpointer self)
{
	gboolean result;
	result = __lambda204_ (self, (TubaInstanceAccount*) g);
	return result;
}

static void
_vala_array_add112 (GObject** * array,
                    gint* length,
                    gint* size,
                    GObject* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (GObject*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
tuba_views_sidebar_real_on_accounts_changed (TubaViewsSidebar* self,
                                             GeeArrayList* accounts)
{
	Block80Data* _data80_;
	GListStore* _tmp0_;
	GObject** _tmp1_;
	GObject* _tmp2_;
	GListStore* _tmp3_;
	GObject** _tmp4_;
	gint _tmp4__length1;
	g_return_if_fail (accounts != NULL);
	_data80_ = g_slice_new0 (Block80Data);
	_data80_->_ref_count_ = 1;
	_data80_->self = g_object_ref (self);
	_tmp0_ = self->accounts_model;
	g_list_store_remove_all (_tmp0_);
	gee_list_sort ((GeeList*) accounts, _tuba_views_sidebar_compare_accounts_gcompare_data_func, NULL, NULL);
	_tmp1_ = g_new0 (GObject*, 0 + 1);
	_data80_->accounts_to_add = _tmp1_;
	_data80_->accounts_to_add_length1 = 0;
	_data80_->_accounts_to_add_size_ = _data80_->accounts_to_add_length1;
	gee_abstract_collection_foreach ((GeeAbstractCollection*) accounts, ___lambda204__gee_forall_func, _data80_);
	_tmp2_ = g_object_new (G_TYPE_OBJECT, NULL);
	_vala_array_add112 (&_data80_->accounts_to_add, &_data80_->accounts_to_add_length1, &_data80_->_accounts_to_add_size_, _tmp2_);
	_tmp3_ = self->accounts_model;
	_tmp4_ = _data80_->accounts_to_add;
	_tmp4__length1 = _data80_->accounts_to_add_length1;
	g_list_store_splice (_tmp3_, (guint) 0, (guint) 0, _tmp4_, (guint) _tmp4__length1);
	tuba_views_sidebar_update_selected_account (self, FALSE);
	block80_data_unref (_data80_);
	_data80_ = NULL;
}

void
tuba_views_sidebar_on_accounts_changed (TubaViewsSidebar* self,
                                        GeeArrayList* accounts)
{
	TubaViewsSidebarClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = TUBA_VIEWS_SIDEBAR_GET_CLASS (self);
	if (_klass_->on_accounts_changed) {
		_klass_->on_accounts_changed (self, accounts);
	}
}

static gint
tuba_views_sidebar_compare_accounts (TubaInstanceAccount* a,
                                     TubaInstanceAccount* b)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gint _tmp10_;
	gint result;
	g_return_val_if_fail (a != NULL, -1);
	g_return_val_if_fail (b != NULL, -1);
	_tmp0_ = tuba_instance_account_get_handle (a);
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_;
	_tmp3_ = g_utf8_strdown (_tmp2_, (gssize) -1);
	_tmp4_ = _tmp3_;
	_tmp5_ = tuba_instance_account_get_handle (b);
	_tmp6_ = _tmp5_;
	_tmp7_ = _tmp6_;
	_tmp8_ = g_utf8_strdown (_tmp7_, (gssize) -1);
	_tmp9_ = _tmp8_;
	_tmp10_ = g_utf8_collate (_tmp4_, _tmp9_);
	_g_free0 (_tmp9_);
	_g_free0 (_tmp7_);
	_g_free0 (_tmp4_);
	_g_free0 (_tmp2_);
	result = _tmp10_;
	return result;
}

static void
tuba_views_sidebar_update_selected_account (TubaViewsSidebar* self,
                                            gboolean clear)
{
	guint index = 0U;
	GListStore* _tmp11_;
	TubaInstanceAccount* _tmp12_;
	TubaInstanceAccount* _tmp13_;
	guint _tmp14_ = 0U;
	gboolean _tmp15_;
	g_return_if_fail (self != NULL);
	if (clear) {
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp0_ = FALSE;
				_tmp0_ = TRUE;
				while (TRUE) {
					GListStore* _tmp2_;
					guint _tmp3_;
					guint _tmp4_;
					GtkListBoxRow* row = NULL;
					GtkListBox* _tmp5_;
					GtkListBoxRow* _tmp6_;
					GtkListBoxRow* _tmp7_;
					GtkListBoxRow* _tmp8_;
					GtkListBoxRow* _tmp9_;
					if (!_tmp0_) {
						gint _tmp1_;
						_tmp1_ = i;
						i = _tmp1_ + 1;
					}
					_tmp0_ = FALSE;
					_tmp2_ = self->accounts_model;
					g_object_get (_tmp2_, "n-items", &_tmp3_, NULL);
					_tmp4_ = _tmp3_;
					if (!(((guint) i) < _tmp4_)) {
						break;
					}
					_tmp5_ = self->priv->saved_accounts;
					_tmp6_ = gtk_list_box_get_row_at_index (_tmp5_, (gint) i);
					_tmp7_ = _g_object_ref0 (_tmp6_);
					row = _tmp7_;
					_tmp8_ = row;
					if (_tmp8_ == NULL) {
						_g_object_unref0 (row);
						break;
					}
					_tmp9_ = row;
					if (gtk_widget_has_css_class ((GtkWidget*) _tmp9_, "active")) {
						GtkListBoxRow* _tmp10_;
						_tmp10_ = row;
						gtk_widget_remove_css_class ((GtkWidget*) _tmp10_, "active");
					}
					_g_object_unref0 (row);
				}
			}
		}
	}
	_tmp11_ = self->accounts_model;
	_tmp12_ = tuba_account_holder_get_account ((TubaAccountHolder*) self);
	_tmp13_ = _tmp12_;
	_tmp15_ = g_list_store_find (_tmp11_, (GObject*) _tmp13_, &_tmp14_);
	index = _tmp14_;
	if (_tmp15_) {
		GtkListBoxRow* row = NULL;
		GtkListBox* _tmp16_;
		GtkListBoxRow* _tmp17_;
		GtkListBoxRow* _tmp18_;
		GtkListBox* _tmp19_;
		GtkListBoxRow* _tmp20_;
		GtkListBoxRow* _tmp21_;
		_tmp16_ = self->priv->saved_accounts;
		_tmp17_ = gtk_list_box_get_row_at_index (_tmp16_, (gint) index);
		_tmp18_ = _g_object_ref0 (_tmp17_);
		row = _tmp18_;
		_tmp19_ = self->priv->saved_accounts;
		_tmp20_ = row;
		gtk_list_box_select_row (_tmp19_, _tmp20_);
		_tmp21_ = row;
		gtk_widget_add_css_class ((GtkWidget*) _tmp21_, "active");
		_g_object_unref0 (row);
	}
}

void
tuba_views_sidebar_set_sidebar_selected_item (TubaViewsSidebar* self,
                                              gint index)
{
	GtkListBox* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->items;
	if (_tmp0_ != NULL) {
		GtkListBox* _tmp1_;
		GtkListBox* _tmp2_;
		GtkListBoxRow* _tmp3_;
		_tmp1_ = self->priv->items;
		_tmp2_ = self->priv->items;
		_tmp3_ = gtk_list_box_get_row_at_index (_tmp2_, index);
		gtk_list_box_select_row (_tmp1_, _tmp3_);
	}
}

static void
tuba_views_sidebar_real_on_account_changed (TubaViewsSidebar* self,
                                            TubaInstanceAccount* account)
{
	TubaInstanceAccount* _tmp0_;
	TubaInstanceAccount* _tmp1_;
	gboolean _tmp10_ = FALSE;
	TubaApplication* _tmp11_;
	_tmp0_ = tuba_account_holder_get_account ((TubaAccountHolder*) self);
	_tmp1_ = _tmp0_;
	if (_tmp1_ != NULL) {
		GBinding* _tmp2_;
		GBinding* _tmp3_;
		GBinding* _tmp4_;
		GBinding* _tmp5_;
		GBinding* _tmp6_;
		GBinding* _tmp7_;
		GBinding* _tmp8_;
		GBinding* _tmp9_;
		_tmp2_ = self->priv->sidebar_avatar_btn;
		_tmp3_ = _g_object_ref0 (_tmp2_);
		g_binding_unbind (_tmp3_);
		_tmp4_ = self->priv->announcements_banner_binding;
		_tmp5_ = _g_object_ref0 (_tmp4_);
		g_binding_unbind (_tmp5_);
		_tmp6_ = self->priv->fr_banner_binding;
		_tmp7_ = _g_object_ref0 (_tmp6_);
		g_binding_unbind (_tmp7_);
		_tmp8_ = self->priv->wrapped_binding;
		_tmp9_ = _g_object_ref0 (_tmp8_);
		g_binding_unbind (_tmp9_);
	}
	tuba_views_sidebar_set_tuba_wrapped (self, 0);
	tuba_views_sidebar_set_unread_announcements (self, 0);
	_tmp11_ = tuba_app;
	if (_tmp11_ != NULL) {
		TubaApplication* _tmp12_;
		TubaDialogsMainWindow* _tmp13_;
		TubaDialogsMainWindow* _tmp14_;
		_tmp12_ = tuba_app;
		_tmp13_ = tuba_application_get_main_window (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp10_ = _tmp14_ != NULL;
	} else {
		_tmp10_ = FALSE;
	}
	if (_tmp10_) {
		TubaApplication* _tmp15_;
		TubaDialogsMainWindow* _tmp16_;
		TubaDialogsMainWindow* _tmp17_;
		_tmp15_ = tuba_app;
		_tmp16_ = tuba_application_get_main_window (_tmp15_);
		_tmp17_ = _tmp16_;
		tuba_dialogs_main_window_go_back_to_start (_tmp17_);
	}
	tuba_account_holder_set_account ((TubaAccountHolder*) self, account);
	if (account != NULL) {
		TubaInstanceAccount* _tmp18_;
		TubaInstanceAccount* _tmp19_;
		GBinding* _tmp20_;
		GBinding* _tmp21_;
		TubaInstanceAccount* _tmp22_;
		TubaInstanceAccount* _tmp23_;
		GBinding* _tmp24_;
		GBinding* _tmp25_;
		TubaInstanceAccount* _tmp26_;
		TubaInstanceAccount* _tmp27_;
		TubaWidgetsAvatar* _tmp28_;
		GBinding* _tmp29_;
		GBinding* _tmp30_;
		TubaInstanceAccount* _tmp31_;
		TubaInstanceAccount* _tmp32_;
		GBinding* _tmp33_;
		GBinding* _tmp34_;
		GtkSliceListModel* _tmp35_;
		GListStore* _tmp36_;
		GtkSliceListModel* _tmp37_;
		GListStore* _tmp38_;
		GtkSliceListModel* _tmp39_;
		GListStore* _tmp40_;
		GSimpleAction* dashboard_action = NULL;
		TubaApplication* _tmp41_;
		GAction* _tmp42_;
		GSimpleAction* _tmp43_;
		GSimpleAction* _tmp44_;
		_tmp18_ = tuba_account_holder_get_account ((TubaAccountHolder*) self);
		_tmp19_ = _tmp18_;
		_tmp20_ = g_object_bind_property_with_closures ((GObject*) _tmp19_, "unread-announcements", (GObject*) self, "unread-announcements", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp21_ = _g_object_ref0 (_tmp20_);
		_g_object_unref0 (self->priv->announcements_banner_binding);
		self->priv->announcements_banner_binding = _tmp21_;
		_tmp22_ = tuba_account_holder_get_account ((TubaAccountHolder*) self);
		_tmp23_ = _tmp22_;
		_tmp24_ = g_object_bind_property_with_closures ((GObject*) _tmp23_, "unreviewed-follow-requests", (GObject*) self, "unreviewed-follow-requests", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp25_ = _g_object_ref0 (_tmp24_);
		_g_object_unref0 (self->priv->fr_banner_binding);
		self->priv->fr_banner_binding = _tmp25_;
		_tmp26_ = tuba_account_holder_get_account ((TubaAccountHolder*) self);
		_tmp27_ = _tmp26_;
		_tmp28_ = self->priv->accounts_button_avi;
		_tmp29_ = g_object_bind_property_with_closures ((GObject*) _tmp27_, "avatar", (GObject*) _tmp28_, "avatar-url", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp30_ = _g_object_ref0 (_tmp29_);
		_g_object_unref0 (self->priv->sidebar_avatar_btn);
		self->priv->sidebar_avatar_btn = _tmp30_;
		_tmp31_ = tuba_account_holder_get_account ((TubaAccountHolder*) self);
		_tmp32_ = _tmp31_;
		_tmp33_ = g_object_bind_property_with_closures ((GObject*) _tmp32_, "tuba-last-fediwrapped-year", (GObject*) self, "tuba-wrapped", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp34_ = _g_object_ref0 (_tmp33_);
		_g_object_unref0 (self->priv->wrapped_binding);
		self->priv->wrapped_binding = _tmp34_;
		_tmp35_ = self->account_items;
		_tmp36_ = account->known_places;
		gtk_slice_list_model_set_model (_tmp35_, (GListModel*) _tmp36_);
		_tmp37_ = self->app_items;
		_tmp38_ = account->list_places;
		gtk_slice_list_model_set_model (_tmp37_, (GListModel*) _tmp38_);
		_tmp39_ = self->tags_items;
		_tmp40_ = account->tags_places;
		gtk_slice_list_model_set_model (_tmp39_, (GListModel*) _tmp40_);
		tuba_views_sidebar_update_selected_account (self, TRUE);
		_tmp41_ = tuba_app;
		_tmp42_ = g_action_map_lookup_action ((GActionMap*) _tmp41_, "open-admin-dashboard");
		_tmp43_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp42_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp42_) : NULL);
		dashboard_action = _tmp43_;
		_tmp44_ = dashboard_action;
		if (_tmp44_ != NULL) {
			GSimpleAction* _tmp45_;
			TubaInstanceAccount* _tmp46_;
			TubaInstanceAccount* _tmp47_;
			gboolean _tmp48_;
			gboolean _tmp49_;
			_tmp45_ = dashboard_action;
			_tmp46_ = tuba_account_holder_get_account ((TubaAccountHolder*) self);
			_tmp47_ = _tmp46_;
			_tmp48_ = tuba_instance_account_get_admin_mode (_tmp47_);
			_tmp49_ = _tmp48_;
			g_simple_action_set_enabled (_tmp45_, _tmp49_);
		}
		_g_object_unref0 (dashboard_action);
	} else {
		GtkListBox* _tmp50_;
		GtkSliceListModel* _tmp51_;
		GtkSliceListModel* _tmp52_;
		GtkSliceListModel* _tmp53_;
		TubaWidgetsAvatar* _tmp54_;
		_tmp50_ = self->priv->saved_accounts;
		gtk_list_box_unselect_all (_tmp50_);
		_tmp51_ = self->account_items;
		gtk_slice_list_model_set_model (_tmp51_, NULL);
		_tmp52_ = self->app_items;
		gtk_slice_list_model_set_model (_tmp52_, NULL);
		_tmp53_ = self->tags_items;
		gtk_slice_list_model_set_model (_tmp53_, NULL);
		_tmp54_ = self->priv->accounts_button_avi;
		tuba_widgets_avatar_set_account (_tmp54_, NULL);
	}
}

void
tuba_views_sidebar_on_account_changed (TubaViewsSidebar* self,
                                       TubaInstanceAccount* account)
{
	TubaViewsSidebarClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = TUBA_VIEWS_SIDEBAR_GET_CLASS (self);
	if (_klass_->on_account_changed) {
		_klass_->on_account_changed (self, account);
	}
}

static GtkWidget*
tuba_views_sidebar_on_item_create (TubaViewsSidebar* self,
                                   GObject* obj)
{
	TubaViewsSidebarItemRow* _tmp0_;
	GtkWidget* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (obj != NULL, NULL);
	_tmp0_ = tuba_views_sidebar_item_row_new (TUBA_IS_PLACE (obj) ? ((TubaPlace*) obj) : NULL);
	g_object_ref_sink (_tmp0_);
	result = (GtkWidget*) _tmp0_;
	return result;
}

static void
tuba_views_sidebar_on_item_activated (TubaViewsSidebar* self,
                                      GtkListBoxRow* _row)
{
	TubaViewsSidebarItemRow* row = NULL;
	TubaViewsSidebarItemRow* _tmp0_;
	TubaViewsSidebarItemRow* _tmp1_;
	TubaPlace* _tmp2_;
	TubaPlace* _tmp3_;
	TubaPlaceOpenFunc _tmp4_ = NULL;
	TubaPlaceOpenFunc _tmp5_;
	AdwOverlaySplitView* split_view = NULL;
	TubaApplication* _tmp19_;
	TubaDialogsMainWindow* _tmp20_;
	TubaDialogsMainWindow* _tmp21_;
	AdwOverlaySplitView* _tmp22_;
	AdwOverlaySplitView* _tmp23_;
	AdwOverlaySplitView* _tmp24_;
	gboolean _tmp25_;
	gboolean _tmp26_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (_row != NULL);
	_tmp0_ = _g_object_ref0 (TUBA_VIEWS_SIDEBAR_IS_ITEM_ROW (_row) ? ((TubaViewsSidebarItemRow*) _row) : NULL);
	row = _tmp0_;
	_tmp1_ = row;
	_tmp2_ = tuba_views_sidebar_item_row_get_place (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = tuba_place_get_open_func (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_ != NULL) {
		TubaViewsSidebarItemRow* _tmp6_;
		TubaPlace* _tmp7_;
		TubaPlace* _tmp8_;
		TubaPlaceOpenFunc _tmp9_ = NULL;
		TubaPlaceOpenFunc _tmp10_;
		TubaApplication* _tmp11_;
		TubaDialogsMainWindow* _tmp12_;
		TubaDialogsMainWindow* _tmp13_;
		TubaViewsSidebarItemRow* _tmp14_;
		TubaPlace* _tmp15_;
		TubaPlace* _tmp16_;
		GObject* _tmp17_;
		GObject* _tmp18_;
		_tmp6_ = row;
		_tmp7_ = tuba_views_sidebar_item_row_get_place (_tmp6_);
		_tmp8_ = _tmp7_;
		_tmp9_ = tuba_place_get_open_func (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = tuba_app;
		_tmp12_ = tuba_application_get_main_window (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = row;
		_tmp15_ = tuba_views_sidebar_item_row_get_place (_tmp14_);
		_tmp16_ = _tmp15_;
		_tmp17_ = tuba_place_get_extra_data (_tmp16_);
		_tmp18_ = _tmp17_;
		_tmp10_ (_tmp13_, _tmp18_);
	}
	_tmp19_ = tuba_app;
	_tmp20_ = tuba_application_get_main_window (_tmp19_);
	_tmp21_ = _tmp20_;
	_tmp22_ = _tmp21_->split_view;
	_tmp23_ = _g_object_ref0 (_tmp22_);
	split_view = _tmp23_;
	_tmp24_ = split_view;
	_tmp25_ = adw_overlay_split_view_get_collapsed (_tmp24_);
	_tmp26_ = _tmp25_;
	if (_tmp26_) {
		AdwOverlaySplitView* _tmp27_;
		_tmp27_ = split_view;
		adw_overlay_split_view_set_show_sidebar (_tmp27_, FALSE);
	}
	_g_object_unref0 (split_view);
	_g_object_unref0 (row);
}

static void
_tuba_views_sidebar_on_item_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                  GtkListBoxRow* row,
                                                                  gpointer self)
{
	tuba_views_sidebar_on_item_activated ((TubaViewsSidebar*) self, row);
}

static void
tuba_views_sidebar_on_item_header_update (TubaViewsSidebar* self,
                                          GtkListBoxRow* _row,
                                          GtkListBoxRow* _before)
{
	TubaViewsSidebarItemRow* row = NULL;
	TubaViewsSidebarItemRow* _tmp0_;
	TubaViewsSidebarItemRow* before = NULL;
	TubaViewsSidebarItemRow* _tmp1_;
	TubaViewsSidebarItemRow* _tmp2_;
	gboolean _tmp3_ = FALSE;
	gboolean _tmp4_ = FALSE;
	TubaViewsSidebarItemRow* _tmp5_;
	TubaPlace* _tmp6_;
	TubaPlace* _tmp7_;
	gboolean _tmp8_;
	gboolean _tmp9_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (_row != NULL);
	_tmp0_ = _g_object_ref0 (TUBA_VIEWS_SIDEBAR_IS_ITEM_ROW (_row) ? ((TubaViewsSidebarItemRow*) _row) : NULL);
	row = _tmp0_;
	_tmp1_ = _g_object_ref0 (TUBA_VIEWS_SIDEBAR_IS_ITEM_ROW (_before) ? ((TubaViewsSidebarItemRow*) _before) : NULL);
	before = _tmp1_;
	_tmp2_ = row;
	gtk_list_box_row_set_header ((GtkListBoxRow*) _tmp2_, NULL);
	_tmp5_ = row;
	_tmp6_ = tuba_views_sidebar_item_row_get_place (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = tuba_place_get_separated (_tmp7_);
	_tmp9_ = _tmp8_;
	if (_tmp9_) {
		TubaViewsSidebarItemRow* _tmp10_;
		_tmp10_ = before;
		_tmp4_ = _tmp10_ != NULL;
	} else {
		_tmp4_ = FALSE;
	}
	if (_tmp4_) {
		TubaViewsSidebarItemRow* _tmp11_;
		TubaPlace* _tmp12_;
		TubaPlace* _tmp13_;
		gboolean _tmp14_;
		gboolean _tmp15_;
		_tmp11_ = before;
		_tmp12_ = tuba_views_sidebar_item_row_get_place (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = tuba_place_get_separated (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp3_ = !_tmp15_;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		TubaViewsSidebarItemRow* _tmp16_;
		gchar* _tmp17_;
		gchar** _tmp18_;
		GtkSeparator* _tmp19_ = NULL;
		GtkSeparator* _tmp20_;
		_tmp16_ = row;
		_tmp17_ = g_strdup ("ttl-separator");
		_tmp18_ = g_new0 (gchar*, 1 + 1);
		_tmp18_[0] = _tmp17_;
		_tmp19_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
		gtk_widget_set_css_classes ((GtkWidget*) _tmp19_, _tmp18_);
		_tmp18_ = (_vala_array_free (_tmp18_, 1, (GDestroyNotify) g_free), NULL);
		g_object_ref_sink (_tmp19_);
		_tmp20_ = _tmp19_;
		gtk_list_box_row_set_header ((GtkListBoxRow*) _tmp16_, (GtkWidget*) _tmp20_);
		_g_object_unref0 (_tmp20_);
	}
	_g_object_unref0 (before);
	_g_object_unref0 (row);
}

static void
tuba_views_sidebar_view_announcements_cb (TubaViewsSidebar* self)
{
	TubaApplication* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = tuba_app;
	tuba_application_open_announcements (_tmp0_);
}

static void
tuba_views_sidebar_view_fr_cb (TubaViewsSidebar* self)
{
	TubaApplication* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = tuba_app;
	tuba_application_open_follow_requests (_tmp0_);
}

static void
tuba_views_sidebar_popdown (TubaViewsSidebar* self)
{
	GtkPopover* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->account_switcher_popover_menu;
	gtk_popover_popdown (_tmp0_);
}

static void
tuba_views_sidebar_on_account_header_update (TubaViewsSidebar* self,
                                             GtkListBoxRow* _row,
                                             GtkListBoxRow* _before)
{
	TubaViewsSidebarAccountRow* row = NULL;
	TubaViewsSidebarAccountRow* _tmp0_;
	TubaViewsSidebarAccountRow* _tmp1_;
	gboolean _tmp2_ = FALSE;
	TubaViewsSidebarAccountRow* _tmp3_;
	TubaInstanceAccount* _tmp4_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (_row != NULL);
	_tmp0_ = _g_object_ref0 (TUBA_VIEWS_SIDEBAR_IS_ACCOUNT_ROW (_row) ? ((TubaViewsSidebarAccountRow*) _row) : NULL);
	row = _tmp0_;
	_tmp1_ = row;
	gtk_list_box_row_set_header ((GtkListBoxRow*) _tmp1_, NULL);
	_tmp3_ = row;
	_tmp4_ = _tmp3_->account;
	if (_tmp4_ == NULL) {
		_tmp2_ = _before != NULL;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		TubaViewsSidebarAccountRow* _tmp5_;
		GtkSeparator* _tmp6_;
		GtkSeparator* _tmp7_;
		_tmp5_ = row;
		_tmp6_ = (GtkSeparator*) gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
		g_object_ref_sink (_tmp6_);
		_tmp7_ = _tmp6_;
		gtk_list_box_row_set_header ((GtkListBoxRow*) _tmp5_, (GtkWidget*) _tmp7_);
		_g_object_unref0 (_tmp7_);
	}
	_g_object_unref0 (row);
}

static void
tuba_views_sidebar_on_account_activated (TubaViewsSidebar* self,
                                         GtkListBoxRow* _row)
{
	TubaViewsSidebarAccountRow* row = NULL;
	TubaViewsSidebarAccountRow* _tmp0_;
	TubaViewsSidebarAccountRow* _tmp1_;
	TubaInstanceAccount* _tmp2_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (_row != NULL);
	tuba_views_sidebar_popdown (self);
	_tmp0_ = _g_object_ref0 (TUBA_VIEWS_SIDEBAR_IS_ACCOUNT_ROW (_row) ? ((TubaViewsSidebarAccountRow*) _row) : NULL);
	row = _tmp0_;
	_tmp1_ = row;
	_tmp2_ = _tmp1_->account;
	if (_tmp2_ != NULL) {
		TubaAccountStore* _tmp3_;
		TubaViewsSidebarAccountRow* _tmp4_;
		TubaInstanceAccount* _tmp5_;
		_tmp3_ = tuba_accounts;
		_tmp4_ = row;
		_tmp5_ = _tmp4_->account;
		tuba_account_store_activate (_tmp3_, _tmp5_, TRUE);
	} else {
		TubaDialogsNewAccount* _tmp6_;
		TubaDialogsNewAccount* _tmp7_;
		_tmp6_ = tuba_dialogs_new_account_new (TRUE, NULL);
		g_object_ref_sink (_tmp6_);
		_tmp7_ = _tmp6_;
		gtk_window_present ((GtkWindow*) _tmp7_);
		_g_object_unref0 (_tmp7_);
	}
	_g_object_unref0 (row);
}

static void
_tuba_views_sidebar_on_account_activated_gtk_list_box_row_activated (GtkListBox* _sender,
                                                                     GtkListBoxRow* row,
                                                                     gpointer self)
{
	tuba_views_sidebar_on_account_activated ((TubaViewsSidebar*) self, row);
}

TubaViewsSidebar*
tuba_views_sidebar_construct (GType object_type)
{
	TubaViewsSidebar * self = NULL;
	self = (TubaViewsSidebar*) g_object_new (object_type, NULL);
	return self;
}

TubaViewsSidebar*
tuba_views_sidebar_new (void)
{
	return tuba_views_sidebar_construct (TUBA_VIEWS_TYPE_SIDEBAR);
}

static TubaInstanceAccount*
tuba_views_sidebar_real_get_account (TubaAccountHolder* base)
{
	TubaInstanceAccount* result;
	TubaViewsSidebar* self;
	TubaInstanceAccount* _tmp0_;
	self = (TubaViewsSidebar*) base;
	_tmp0_ = self->priv->_account;
	result = _tmp0_;
	return result;
}

static void
tuba_views_sidebar_real_set_account (TubaAccountHolder* base,
                                     TubaInstanceAccount* value)
{
	TubaViewsSidebar* self;
	TubaInstanceAccount* old_value;
	self = (TubaViewsSidebar*) base;
	old_value = tuba_views_sidebar_real_get_account (base);
	if (old_value != value) {
		TubaInstanceAccount* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_account);
		self->priv->_account = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_views_sidebar_properties[TUBA_VIEWS_SIDEBAR_ACCOUNT_PROPERTY]);
	}
}

void
tuba_views_sidebar_set_unread_announcements (TubaViewsSidebar* self,
                                             gint value)
{
	g_return_if_fail (self != NULL);
	if (value > 0) {
		AdwBanner* _tmp0_;
		AdwBanner* _tmp1_;
		gchar* _tmp2_;
		gchar* _tmp3_;
		_tmp0_ = self->priv->announcements_banner;
		adw_banner_set_revealed (_tmp0_, TRUE);
		_tmp1_ = self->priv->announcements_banner;
		_tmp2_ = g_strdup_printf (ngettext ("%d Announcement", "%d Announcements", (gulong) value), value);
		_tmp3_ = _tmp2_;
		adw_banner_set_title (_tmp1_, _tmp3_);
		_g_free0 (_tmp3_);
	} else {
		AdwBanner* _tmp4_;
		_tmp4_ = self->priv->announcements_banner;
		adw_banner_set_revealed (_tmp4_, FALSE);
	}
	g_object_notify_by_pspec ((GObject *) self, tuba_views_sidebar_properties[TUBA_VIEWS_SIDEBAR_UNREAD_ANNOUNCEMENTS_PROPERTY]);
}

void
tuba_views_sidebar_set_unreviewed_follow_requests (TubaViewsSidebar* self,
                                                   gint value)
{
	g_return_if_fail (self != NULL);
	if (value > 0) {
		AdwBanner* _tmp0_;
		AdwBanner* _tmp1_;
		gchar* _tmp2_;
		gchar* _tmp3_;
		_tmp0_ = self->priv->fr_banner;
		adw_banner_set_revealed (_tmp0_, TRUE);
		_tmp1_ = self->priv->fr_banner;
		_tmp2_ = g_strdup_printf (ngettext ("%d Follow Request", "%d Follow Requests", (gulong) value), value);
		_tmp3_ = _tmp2_;
		adw_banner_set_title (_tmp1_, _tmp3_);
		_g_free0 (_tmp3_);
	} else {
		AdwBanner* _tmp4_;
		_tmp4_ = self->priv->fr_banner;
		adw_banner_set_revealed (_tmp4_, FALSE);
	}
	g_object_notify_by_pspec ((GObject *) self, tuba_views_sidebar_properties[TUBA_VIEWS_SIDEBAR_UNREVIEWED_FOLLOW_REQUESTS_PROPERTY]);
}

void
tuba_views_sidebar_set_tuba_wrapped (TubaViewsSidebar* self,
                                     gint value)
{
	GSimpleAction* wrapped_action = NULL;
	TubaApplication* _tmp0_;
	GAction* _tmp1_;
	GSimpleAction* _tmp2_;
	GSimpleAction* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = tuba_app;
	_tmp1_ = g_action_map_lookup_action ((GActionMap*) _tmp0_, "open-last-fediwrapped");
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, g_simple_action_get_type ()) ? ((GSimpleAction*) _tmp1_) : NULL);
	wrapped_action = _tmp2_;
	_tmp3_ = wrapped_action;
	if (_tmp3_ != NULL) {
		GSimpleAction* _tmp4_;
		_tmp4_ = wrapped_action;
		g_simple_action_set_enabled (_tmp4_, value > 2000);
	}
	_g_object_unref0 (wrapped_action);
	g_object_notify_by_pspec ((GObject *) self, tuba_views_sidebar_properties[TUBA_VIEWS_SIDEBAR_TUBA_WRAPPED_PROPERTY]);
}

static inline gpointer
tuba_views_sidebar_item_row_get_instance_private (TubaViewsSidebarItemRow* self)
{
	return G_STRUCT_MEMBER_P (self, TubaViewsSidebarItemRow_private_offset);
}

static void
_tuba_views_sidebar_item_row_on_visibility_changed_g_object_notify (GObject* _sender,
                                                                    GParamSpec* pspec,
                                                                    gpointer self)
{
	tuba_views_sidebar_item_row_on_visibility_changed ((TubaViewsSidebarItemRow*) self);
}

static gboolean
__lambda119_ (TubaViewsSidebarItemRow* self,
              GBinding* b,
              GValue* src,
              GValue* target)
{
	gboolean result;
	g_return_val_if_fail (b != NULL, FALSE);
	g_return_val_if_fail (src != NULL, FALSE);
	g_return_val_if_fail (target != NULL, FALSE);
	g_value_set_boolean (target, g_value_get_int (src) > 0);
	result = TRUE;
	return result;
}

static gboolean
___lambda119__gbinding_transform_func (GBinding* binding,
                                       GValue* from_value,
                                       GValue* to_value,
                                       gpointer self)
{
	gboolean result;
	result = __lambda119_ ((TubaViewsSidebarItemRow*) self, binding, from_value, to_value);
	return result;
}

static void
_tuba_views_sidebar_item_row_on_attention_change_g_object_notify (GObject* _sender,
                                                                  GParamSpec* pspec,
                                                                  gpointer self)
{
	tuba_views_sidebar_item_row_on_attention_change ((TubaViewsSidebarItemRow*) self);
}

TubaViewsSidebarItemRow*
tuba_views_sidebar_item_row_construct (GType object_type,
                                       TubaPlace* place)
{
	TubaViewsSidebarItemRow * self = NULL;
	GtkLabel* _tmp0_;
	GtkImage* _tmp1_;
	GtkLabel* _tmp2_;
	GtkLabel* _tmp3_;
	g_return_val_if_fail (place != NULL, NULL);
	self = (TubaViewsSidebarItemRow*) g_object_new (object_type, NULL);
	g_signal_connect_object ((GObject*) self, "notify::visible", (GCallback) _tuba_views_sidebar_item_row_on_visibility_changed_g_object_notify, self, 0);
	tuba_views_sidebar_item_row_set_place (self, place);
	_tmp0_ = self->priv->label;
	g_object_bind_property_with_closures ((GObject*) place, "title", (GObject*) _tmp0_, "label", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp1_ = self->priv->icon;
	g_object_bind_property_with_closures ((GObject*) place, "icon", (GObject*) _tmp1_, "icon-name", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_object_bind_property_with_closures ((GObject*) place, "visible", (GObject*) self, "visible", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_object_bind_property_with_closures ((GObject*) place, "selectable", (GObject*) self, "selectable", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp2_ = self->priv->badge;
	g_object_bind_property_with_closures ((GObject*) place, "badge", (GObject*) _tmp2_, "label", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	_tmp3_ = self->priv->badge;
	g_object_bind_property_with_closures ((GObject*) place, "badge", (GObject*) _tmp3_, "visible", G_BINDING_SYNC_CREATE, (GClosure*) ((___lambda119__gbinding_transform_func == NULL) ? NULL : g_cclosure_new ((GCallback) ___lambda119__gbinding_transform_func, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	g_signal_connect_object ((GObject*) place, "notify::needs-attention", (GCallback) _tuba_views_sidebar_item_row_on_attention_change_g_object_notify, self, 0);
	tuba_views_sidebar_item_row_on_attention_change (self);
	return self;
}

TubaViewsSidebarItemRow*
tuba_views_sidebar_item_row_new (TubaPlace* place)
{
	return tuba_views_sidebar_item_row_construct (TUBA_VIEWS_SIDEBAR_TYPE_ITEM_ROW, place);
}

static void
tuba_views_sidebar_item_row_on_visibility_changed (TubaViewsSidebarItemRow* self)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	TubaPlace* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_widget_get_visible ((GtkWidget*) self);
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->_place;
	_tmp3_ = tuba_place_get_visible (_tmp2_);
	_tmp4_ = _tmp3_;
	if (_tmp1_ != _tmp4_) {
		TubaPlace* _tmp5_;
		gboolean _tmp6_;
		gboolean _tmp7_;
		_tmp5_ = self->priv->_place;
		_tmp6_ = tuba_place_get_visible (_tmp5_);
		_tmp7_ = _tmp6_;
		gtk_widget_set_visible ((GtkWidget*) self, _tmp7_);
	}
}

static void
tuba_views_sidebar_item_row_on_attention_change (TubaViewsSidebarItemRow* self)
{
	TubaPlace* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_place;
	_tmp1_ = tuba_place_get_needs_attention (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		GtkLabel* _tmp3_;
		_tmp3_ = self->priv->badge;
		gtk_widget_remove_css_class ((GtkWidget*) _tmp3_, "no-attention");
	} else {
		GtkLabel* _tmp4_;
		_tmp4_ = self->priv->badge;
		gtk_widget_add_css_class ((GtkWidget*) _tmp4_, "no-attention");
	}
}

TubaPlace*
tuba_views_sidebar_item_row_get_place (TubaViewsSidebarItemRow* self)
{
	TubaPlace* result;
	TubaPlace* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_place;
	result = _tmp0_;
	return result;
}

void
tuba_views_sidebar_item_row_set_place (TubaViewsSidebarItemRow* self,
                                       TubaPlace* value)
{
	TubaPlace* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_views_sidebar_item_row_get_place (self);
	if (old_value != value) {
		TubaPlace* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_place);
		self->priv->_place = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_views_sidebar_item_row_properties[TUBA_VIEWS_SIDEBAR_ITEM_ROW_PLACE_PROPERTY]);
	}
}

static void
tuba_views_sidebar_item_row_class_init (TubaViewsSidebarItemRowClass * klass,
                                        gpointer klass_data)
{
	tuba_views_sidebar_item_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaViewsSidebarItemRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_views_sidebar_item_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_views_sidebar_item_row_set_property;
	G_OBJECT_CLASS (klass)->finalize = tuba_views_sidebar_item_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_VIEWS_SIDEBAR_ITEM_ROW_PLACE_PROPERTY, tuba_views_sidebar_item_row_properties[TUBA_VIEWS_SIDEBAR_ITEM_ROW_PLACE_PROPERTY] = g_param_spec_object ("place", "place", "place", TUBA_TYPE_PLACE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/dev/geopjr/Tuba/ui/views/sidebar/item.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "icon", FALSE, TubaViewsSidebarItemRow_private_offset + G_STRUCT_OFFSET (TubaViewsSidebarItemRowPrivate, icon));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "label", FALSE, TubaViewsSidebarItemRow_private_offset + G_STRUCT_OFFSET (TubaViewsSidebarItemRowPrivate, label));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "badge", FALSE, TubaViewsSidebarItemRow_private_offset + G_STRUCT_OFFSET (TubaViewsSidebarItemRowPrivate, badge));
}

static void
tuba_views_sidebar_item_row_instance_init (TubaViewsSidebarItemRow * self,
                                           gpointer klass)
{
	self->priv = tuba_views_sidebar_item_row_get_instance_private (self);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
tuba_views_sidebar_item_row_finalize (GObject * obj)
{
	TubaViewsSidebarItemRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_VIEWS_SIDEBAR_TYPE_ITEM_ROW, TubaViewsSidebarItemRow);
	_g_object_unref0 (self->priv->_place);
	G_OBJECT_CLASS (tuba_views_sidebar_item_row_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_views_sidebar_item_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaViewsSidebarItemRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_views_sidebar_item_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaViewsSidebarItemRow), 0, (GInstanceInitFunc) tuba_views_sidebar_item_row_instance_init, NULL };
	GType tuba_views_sidebar_item_row_type_id;
	tuba_views_sidebar_item_row_type_id = g_type_register_static (gtk_list_box_row_get_type (), "TubaViewsSidebarItemRow", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaViewsSidebarItemRow_private_offset = g_type_add_instance_private (tuba_views_sidebar_item_row_type_id, sizeof (TubaViewsSidebarItemRowPrivate));
	return tuba_views_sidebar_item_row_type_id;
}

GType
tuba_views_sidebar_item_row_get_type (void)
{
	static GType tuba_views_sidebar_item_row_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_views_sidebar_item_row_type_id__once)) {
		GType tuba_views_sidebar_item_row_type_id;
		tuba_views_sidebar_item_row_type_id = tuba_views_sidebar_item_row_get_type_once ();
		g_once_init_leave_pointer (&tuba_views_sidebar_item_row_type_id__once, tuba_views_sidebar_item_row_type_id);
	}
	return tuba_views_sidebar_item_row_type_id__once;
}

static void
_vala_tuba_views_sidebar_item_row_get_property (GObject * object,
                                                guint property_id,
                                                GValue * value,
                                                GParamSpec * pspec)
{
	TubaViewsSidebarItemRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_VIEWS_SIDEBAR_TYPE_ITEM_ROW, TubaViewsSidebarItemRow);
	switch (property_id) {
		case TUBA_VIEWS_SIDEBAR_ITEM_ROW_PLACE_PROPERTY:
		g_value_set_object (value, tuba_views_sidebar_item_row_get_place (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_views_sidebar_item_row_set_property (GObject * object,
                                                guint property_id,
                                                const GValue * value,
                                                GParamSpec * pspec)
{
	TubaViewsSidebarItemRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_VIEWS_SIDEBAR_TYPE_ITEM_ROW, TubaViewsSidebarItemRow);
	switch (property_id) {
		case TUBA_VIEWS_SIDEBAR_ITEM_ROW_PLACE_PROPERTY:
		tuba_views_sidebar_item_row_set_place (self, g_value_get_object (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
tuba_views_sidebar_account_row_get_instance_private (TubaViewsSidebarAccountRow* self)
{
	return G_STRUCT_MEMBER_P (self, TubaViewsSidebarAccountRow_private_offset);
}

static gboolean
_tuba_views_sidebar_account_row_switcher_notifications_visibility_cb_gbinding_transform_func (GBinding* binding,
                                                                                              GValue* from_value,
                                                                                              GValue* to_value,
                                                                                              gpointer self)
{
	gboolean result;
	result = tuba_views_sidebar_account_row_switcher_notifications_visibility_cb ((TubaViewsSidebarAccountRow*) self, binding, from_value, to_value);
	return result;
}

TubaViewsSidebarAccountRow*
tuba_views_sidebar_account_row_construct (GType object_type,
                                          TubaInstanceAccount* _account)
{
	TubaViewsSidebarAccountRow * self = NULL;
	TubaInstanceAccount* _tmp0_;
	TubaInstanceAccount* _tmp13_;
	TubaInstanceAccount* _tmp14_;
	self = (TubaViewsSidebarAccountRow*) g_object_new (object_type, NULL);
	_tmp0_ = self->account;
	if (_tmp0_ != NULL) {
		GBinding* _tmp1_;
		GBinding* _tmp2_;
		GBinding* _tmp3_;
		GBinding* _tmp4_;
		GBinding* _tmp5_;
		GBinding* _tmp6_;
		GBinding* _tmp7_;
		GBinding* _tmp8_;
		GBinding* _tmp9_;
		GBinding* _tmp10_;
		GBinding* _tmp11_;
		GBinding* _tmp12_;
		_tmp1_ = self->priv->switcher_display_name;
		_tmp2_ = _g_object_ref0 (_tmp1_);
		g_binding_unbind (_tmp2_);
		_tmp3_ = self->priv->switcher_handle;
		_tmp4_ = _g_object_ref0 (_tmp3_);
		g_binding_unbind (_tmp4_);
		_tmp5_ = self->priv->switcher_tooltip;
		_tmp6_ = _g_object_ref0 (_tmp5_);
		g_binding_unbind (_tmp6_);
		_tmp7_ = self->priv->switcher_avatar;
		_tmp8_ = _g_object_ref0 (_tmp7_);
		g_binding_unbind (_tmp8_);
		_tmp9_ = self->priv->switcher_notifications;
		_tmp10_ = _g_object_ref0 (_tmp9_);
		g_binding_unbind (_tmp10_);
		_tmp11_ = self->priv->switcher_notifications_visibility;
		_tmp12_ = _g_object_ref0 (_tmp11_);
		g_binding_unbind (_tmp12_);
	}
	_tmp13_ = _g_object_ref0 (_account);
	_g_object_unref0 (self->account);
	self->account = _tmp13_;
	_tmp14_ = self->account;
	if (_tmp14_ != NULL) {
		TubaInstanceAccount* _tmp15_;
		GBinding* _tmp16_;
		GBinding* _tmp17_;
		TubaInstanceAccount* _tmp18_;
		GBinding* _tmp19_;
		GBinding* _tmp20_;
		TubaInstanceAccount* _tmp21_;
		GBinding* _tmp22_;
		GBinding* _tmp23_;
		TubaInstanceAccount* _tmp24_;
		TubaWidgetsAvatar* _tmp25_;
		GBinding* _tmp26_;
		GBinding* _tmp27_;
		TubaInstanceAccount* _tmp28_;
		GtkLabel* _tmp29_;
		GBinding* _tmp30_;
		GBinding* _tmp31_;
		TubaInstanceAccount* _tmp32_;
		GtkLabel* _tmp33_;
		GBinding* _tmp34_;
		GBinding* _tmp35_;
		_tmp15_ = self->account;
		_tmp16_ = g_object_bind_property_with_closures ((GObject*) _tmp15_, "display-name", (GObject*) self, "title", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp17_ = _g_object_ref0 (_tmp16_);
		_g_object_unref0 (self->priv->switcher_display_name);
		self->priv->switcher_display_name = _tmp17_;
		_tmp18_ = self->account;
		_tmp19_ = g_object_bind_property_with_closures ((GObject*) _tmp18_, "handle", (GObject*) self, "subtitle", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp20_ = _g_object_ref0 (_tmp19_);
		_g_object_unref0 (self->priv->switcher_handle);
		self->priv->switcher_handle = _tmp20_;
		_tmp21_ = self->account;
		_tmp22_ = g_object_bind_property_with_closures ((GObject*) _tmp21_, "handle", (GObject*) self, "tooltip-text", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp23_ = _g_object_ref0 (_tmp22_);
		_g_object_unref0 (self->priv->switcher_tooltip);
		self->priv->switcher_tooltip = _tmp23_;
		_tmp24_ = self->account;
		_tmp25_ = self->priv->avatar;
		_tmp26_ = g_object_bind_property_with_closures ((GObject*) _tmp24_, "avatar", (GObject*) _tmp25_, "avatar-url", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp27_ = _g_object_ref0 (_tmp26_);
		_g_object_unref0 (self->priv->switcher_avatar);
		self->priv->switcher_avatar = _tmp27_;
		_tmp28_ = self->account;
		_tmp29_ = self->priv->notifications_badge;
		_tmp30_ = g_object_bind_property_with_closures ((GObject*) _tmp28_, "unread-count", (GObject*) _tmp29_, "label", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp31_ = _g_object_ref0 (_tmp30_);
		_g_object_unref0 (self->priv->switcher_notifications);
		self->priv->switcher_notifications = _tmp31_;
		_tmp32_ = self->account;
		_tmp33_ = self->priv->notifications_badge;
		_tmp34_ = g_object_bind_property_with_closures ((GObject*) _tmp32_, "unread-count", (GObject*) _tmp33_, "visible", G_BINDING_SYNC_CREATE, (GClosure*) ((_tuba_views_sidebar_account_row_switcher_notifications_visibility_cb_gbinding_transform_func == NULL) ? NULL : g_cclosure_new ((GCallback) _tuba_views_sidebar_account_row_switcher_notifications_visibility_cb_gbinding_transform_func, g_object_ref (self), (GClosureNotify) g_object_unref)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
		_tmp35_ = _g_object_ref0 (_tmp34_);
		_g_object_unref0 (self->priv->switcher_notifications_visibility);
		self->priv->switcher_notifications_visibility = _tmp35_;
	} else {
		TubaWidgetsAvatar* _tmp36_;
		GtkButton* _tmp37_;
		TubaWidgetsAvatar* _tmp38_;
		TubaWidgetsAvatar* _tmp39_;
		adw_preferences_row_set_title ((AdwPreferencesRow*) self, _ ("Add Account"));
		_tmp36_ = self->priv->avatar;
		tuba_widgets_avatar_set_account (_tmp36_, NULL);
		gtk_list_box_row_set_selectable ((GtkListBoxRow*) self, FALSE);
		_tmp37_ = self->priv->forget;
		gtk_widget_hide ((GtkWidget*) _tmp37_);
		gtk_widget_set_tooltip_text ((GtkWidget*) self, _ ("Add Account"));
		_tmp38_ = self->priv->avatar;
		gtk_button_set_icon_name ((GtkButton*) _tmp38_, "tuba-plus-large-symbolic");
		_tmp39_ = self->priv->avatar;
		gtk_widget_remove_css_class ((GtkWidget*) _tmp39_, "flat");
	}
	return self;
}

TubaViewsSidebarAccountRow*
tuba_views_sidebar_account_row_new (TubaInstanceAccount* _account)
{
	return tuba_views_sidebar_account_row_construct (TUBA_VIEWS_SIDEBAR_TYPE_ACCOUNT_ROW, _account);
}

static gboolean
tuba_views_sidebar_account_row_switcher_notifications_visibility_cb (TubaViewsSidebarAccountRow* self,
                                                                     GBinding* binding,
                                                                     GValue* from_value,
                                                                     GValue* to_value)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (binding != NULL, FALSE);
	g_return_val_if_fail (from_value != NULL, FALSE);
	g_return_val_if_fail (to_value != NULL, FALSE);
	g_value_set_boolean (to_value, g_value_get_int (from_value) > 0);
	result = TRUE;
	return result;
}

static void
tuba_views_sidebar_account_row_on_open (TubaViewsSidebarAccountRow* self)
{
	TubaInstanceAccount* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->account;
	if (_tmp0_ != NULL) {
		TubaInstanceAccount* _tmp1_;
		TubaAccountStore* _tmp2_;
		TubaInstanceAccount* _tmp3_;
		TubaInstanceAccount* _tmp4_;
		_tmp1_ = self->account;
		_tmp2_ = tuba_accounts;
		_tmp3_ = tuba_account_store_get_active (_tmp2_);
		_tmp4_ = _tmp3_;
		tuba_widgetizable_resolve_open ((TubaWidgetizable*) _tmp1_, _tmp4_);
	} else {
		TubaDialogsNewAccount* _tmp5_;
		TubaDialogsNewAccount* _tmp6_;
		_tmp5_ = tuba_dialogs_new_account_new (TRUE, NULL);
		g_object_ref_sink (_tmp5_);
		_tmp6_ = _tmp5_;
		gtk_window_present ((GtkWindow*) _tmp6_);
		_g_object_unref0 (_tmp6_);
	}
	g_signal_emit (self, tuba_views_sidebar_account_row_signals[TUBA_VIEWS_SIDEBAR_ACCOUNT_ROW_POPDOWN_SIGNAL_SIGNAL], 0);
}

static void
_tuba_views_sidebar_account_row_on_open_gtk_button_clicked (GtkButton* _sender,
                                                            gpointer self)
{
	tuba_views_sidebar_account_row_on_open ((TubaViewsSidebarAccountRow*) self);
}

static void
__lambda203_ (TubaViewsSidebarAccountRow* self,
              GObject* obj,
              GAsyncResult* res)
{
	TubaApplication* _tmp0_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (res != NULL);
	_tmp0_ = tuba_app;
	if (tuba_application_question_answer_truthy (tuba_application_question_finish (_tmp0_, res))) {
		{
			TubaAccountStore* _tmp1_;
			TubaInstanceAccount* _tmp2_;
			_tmp1_ = tuba_accounts;
			_tmp2_ = self->account;
			tuba_account_store_remove (_tmp1_, _tmp2_, &_inner_error0_);
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch0_g_error;
			}
		}
		goto __finally0;
		__catch0_g_error:
		{
			GError* e = NULL;
			GError* _tmp3_;
			const gchar* _tmp4_;
			TubaApplication* _tmp5_;
			GError* _tmp6_;
			const gchar* _tmp7_;
			gchar* _tmp8_;
			gchar* _tmp9_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp3_ = e;
			_tmp4_ = _tmp3_->message;
			g_warning ("Sidebar.vala:384: %s", _tmp4_);
			_tmp5_ = tuba_app;
			_tmp6_ = e;
			_tmp7_ = _tmp6_->message;
			_tmp8_ = g_strdup_printf ("%s: %s", _ ("Error"), _tmp7_);
			_tmp9_ = _tmp8_;
			g_signal_emit_by_name (_tmp5_, "toast", _tmp9_, (guint) 5, NULL, NULL, NULL);
			_g_free0 (_tmp9_);
			_g_error_free0 (e);
		}
		__finally0:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return;
		}
	}
}

static void
___lambda203__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	__lambda203_ ((TubaViewsSidebarAccountRow*) self, source_object, res);
	g_object_unref (self);
}

static void
tuba_views_sidebar_account_row_on_forget (TubaViewsSidebarAccountRow* self)
{
	TubaApplication* _tmp0_;
	TubaInstanceAccount* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	TubaInstanceAccount* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	TubaApplicationQuestionText _tmp12_ = {0};
	TubaApplicationQuestionText _tmp13_ = {0};
	TubaApplication* _tmp14_;
	TubaDialogsMainWindow* _tmp15_;
	TubaDialogsMainWindow* _tmp16_;
	TubaApplicationQuestionButtons _tmp17_ = {0};
	g_return_if_fail (self != NULL);
	g_signal_emit (self, tuba_views_sidebar_account_row_signals[TUBA_VIEWS_SIDEBAR_ACCOUNT_ROW_POPDOWN_SIGNAL_SIGNAL], 0);
	_tmp0_ = tuba_app;
	_tmp1_ = self->account;
	_tmp2_ = tuba_api_account_get_username ((TubaAPIAccount*) _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = self->account;
	_tmp5_ = tuba_api_account_get_domain ((TubaAPIAccount*) _tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = _tmp6_;
	_tmp8_ = g_strdup_printf ("<span segment=\"word\">@%s</span><span segment=\"word\">@%s</span>", _tmp3_, _tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = g_strdup_printf (_ ("Forget %s?"), _tmp9_);
	_tmp11_ = _tmp10_;
	_g_free0 (_tmp12_.text);
	_tmp12_.text = _tmp11_;
	_tmp12_.use_markup = TRUE;
	_g_free0 (_tmp13_.text);
	_tmp13_.text = _ ("This account will be removed from the application.");
	_tmp13_.use_markup = FALSE;
	_tmp14_ = tuba_app;
	_tmp15_ = tuba_application_get_main_window (_tmp14_);
	_tmp16_ = _tmp15_;
	tuba_application_question_button_destroy (&_tmp17_.yes);
	_tmp17_.yes = (TubaApplicationQuestionButton) {_ ("Forget"), ADW_RESPONSE_DESTRUCTIVE};
	tuba_application_question_button_destroy (&_tmp17_.no);
	_tmp17_.no = (TubaApplicationQuestionButton) {_ ("Cancel"), ADW_RESPONSE_DEFAULT};
	tuba_application_question (_tmp0_, &_tmp12_, &_tmp13_, (GtkWidget*) _tmp16_, &_tmp17_, NULL, FALSE, ___lambda203__gasync_ready_callback, g_object_ref (self));
	_g_free0 (_tmp11_);
	_g_free0 (_tmp9_);
	_g_free0 (_tmp7_);
}

static void
_tuba_views_sidebar_account_row_on_forget_gtk_button_clicked (GtkButton* _sender,
                                                              gpointer self)
{
	tuba_views_sidebar_account_row_on_forget ((TubaViewsSidebarAccountRow*) self);
}

static void
tuba_views_sidebar_account_row_class_init (TubaViewsSidebarAccountRowClass * klass,
                                           gpointer klass_data)
{
	tuba_views_sidebar_account_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaViewsSidebarAccountRow_private_offset);
	G_OBJECT_CLASS (klass)->finalize = tuba_views_sidebar_account_row_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/dev/geopjr/Tuba/ui/views/sidebar/account.ui");
	tuba_views_sidebar_account_row_signals[TUBA_VIEWS_SIDEBAR_ACCOUNT_ROW_POPDOWN_SIGNAL_SIGNAL] = g_signal_new ("popdown-signal", TUBA_VIEWS_SIDEBAR_TYPE_ACCOUNT_ROW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "avatar", FALSE, TubaViewsSidebarAccountRow_private_offset + G_STRUCT_OFFSET (TubaViewsSidebarAccountRowPrivate, avatar));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "forget", FALSE, TubaViewsSidebarAccountRow_private_offset + G_STRUCT_OFFSET (TubaViewsSidebarAccountRowPrivate, forget));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "notifications_badge", FALSE, TubaViewsSidebarAccountRow_private_offset + G_STRUCT_OFFSET (TubaViewsSidebarAccountRowPrivate, notifications_badge));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_open", G_CALLBACK(_tuba_views_sidebar_account_row_on_open_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_forget", G_CALLBACK(_tuba_views_sidebar_account_row_on_forget_gtk_button_clicked));
	g_type_ensure (TUBA_WIDGETS_TYPE_AVATAR);
}

static void
tuba_views_sidebar_account_row_instance_init (TubaViewsSidebarAccountRow * self,
                                              gpointer klass)
{
	self->priv = tuba_views_sidebar_account_row_get_instance_private (self);
	g_type_ensure (TUBA_WIDGETS_TYPE_AVATAR);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
tuba_views_sidebar_account_row_finalize (GObject * obj)
{
	TubaViewsSidebarAccountRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_VIEWS_SIDEBAR_TYPE_ACCOUNT_ROW, TubaViewsSidebarAccountRow);
	_g_object_unref0 (self->account);
	_g_object_unref0 (self->priv->switcher_display_name);
	_g_object_unref0 (self->priv->switcher_handle);
	_g_object_unref0 (self->priv->switcher_tooltip);
	_g_object_unref0 (self->priv->switcher_avatar);
	_g_object_unref0 (self->priv->switcher_notifications);
	_g_object_unref0 (self->priv->switcher_notifications_visibility);
	G_OBJECT_CLASS (tuba_views_sidebar_account_row_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_views_sidebar_account_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaViewsSidebarAccountRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_views_sidebar_account_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaViewsSidebarAccountRow), 0, (GInstanceInitFunc) tuba_views_sidebar_account_row_instance_init, NULL };
	GType tuba_views_sidebar_account_row_type_id;
	tuba_views_sidebar_account_row_type_id = g_type_register_static (adw_action_row_get_type (), "TubaViewsSidebarAccountRow", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaViewsSidebarAccountRow_private_offset = g_type_add_instance_private (tuba_views_sidebar_account_row_type_id, sizeof (TubaViewsSidebarAccountRowPrivate));
	return tuba_views_sidebar_account_row_type_id;
}

GType
tuba_views_sidebar_account_row_get_type (void)
{
	static GType tuba_views_sidebar_account_row_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_views_sidebar_account_row_type_id__once)) {
		GType tuba_views_sidebar_account_row_type_id;
		tuba_views_sidebar_account_row_type_id = tuba_views_sidebar_account_row_get_type_once ();
		g_once_init_leave_pointer (&tuba_views_sidebar_account_row_type_id__once, tuba_views_sidebar_account_row_type_id);
	}
	return tuba_views_sidebar_account_row_type_id__once;
}

static GtkWidget*
_tuba_views_sidebar_on_accounts_row_create_gtk_list_box_create_widget_func (GObject* item,
                                                                            gpointer self)
{
	GtkWidget* result;
	result = tuba_views_sidebar_on_accounts_row_create ((TubaViewsSidebar*) self, item);
	return result;
}

static GVariant*
_variant_new31 (const gchar* value)
{
	return g_variant_ref_sink (g_variant_new_string (value));
}

static GVariant*
_variant_new32 (const gchar* value)
{
	return g_variant_ref_sink (g_variant_new_string (value));
}

static GVariant*
_variant_new33 (const gchar* value)
{
	return g_variant_ref_sink (g_variant_new_string (value));
}

static GtkWidget*
_tuba_views_sidebar_on_item_create_gtk_list_box_create_widget_func (GObject* item,
                                                                    gpointer self)
{
	GtkWidget* result;
	result = tuba_views_sidebar_on_item_create ((TubaViewsSidebar*) self, item);
	return result;
}

static void
_tuba_views_sidebar_on_item_header_update_gtk_list_box_update_header_func (GtkListBoxRow* row,
                                                                           GtkListBoxRow* before,
                                                                           gpointer self)
{
	tuba_views_sidebar_on_item_header_update ((TubaViewsSidebar*) self, row, before);
}

static void
_tuba_views_sidebar_on_account_header_update_gtk_list_box_update_header_func (GtkListBoxRow* row,
                                                                              GtkListBoxRow* before,
                                                                              gpointer self)
{
	tuba_views_sidebar_on_account_header_update ((TubaViewsSidebar*) self, row, before);
}

static void
_tuba_views_sidebar_view_announcements_cb_adw_banner_button_clicked (AdwBanner* _sender,
                                                                     gpointer self)
{
	tuba_views_sidebar_view_announcements_cb ((TubaViewsSidebar*) self);
}

static void
_tuba_views_sidebar_view_fr_cb_adw_banner_button_clicked (AdwBanner* _sender,
                                                          gpointer self)
{
	tuba_views_sidebar_view_fr_cb ((TubaViewsSidebar*) self);
}

static void
_tuba_views_sidebar_on_network_change_g_object_notify (GObject* _sender,
                                                       GParamSpec* pspec,
                                                       gpointer self)
{
	tuba_views_sidebar_on_network_change ((TubaViewsSidebar*) self);
}

static GObject *
tuba_views_sidebar_constructor (GType type,
                                guint n_construct_properties,
                                GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaViewsSidebar * self;
	GMenu* menu_model = NULL;
	GMenu* _tmp0_;
	GListStore* _tmp1_;
	GtkListBox* _tmp2_;
	GListStore* _tmp3_;
	GMenu* account_submenu_model = NULL;
	GMenu* _tmp4_;
	GMenu* _tmp5_;
	GMenu* _tmp6_;
	GMenu* _tmp7_;
	GMenu* _tmp8_;
	GMenu* _tmp9_;
	GMenu* misc_submenu_model = NULL;
	GMenu* _tmp10_;
	GMenu* _tmp11_;
	GMenu* _tmp12_;
	GMenu* _tmp13_;
	GMenu* _tmp14_;
	GMenu* _tmp15_;
	GMenuItem* collections_menu_item = NULL;
	GMenuItem* _tmp16_;
	GMenuItem* _tmp17_;
	GVariant* _tmp18_;
	GMenu* _tmp19_;
	GMenuItem* _tmp20_;
	GMenuItem* wrapped_menu_item = NULL;
	GMenuItem* _tmp21_;
	GMenuItem* _tmp22_;
	GVariant* _tmp23_;
	GMenu* _tmp24_;
	GMenuItem* _tmp25_;
	GMenuItem* admin_dahsboard_menu_item = NULL;
	GMenuItem* _tmp26_;
	GMenuItem* _tmp27_;
	GVariant* _tmp28_;
	GMenu* _tmp29_;
	GMenuItem* _tmp30_;
	GMenu* _tmp31_;
	GMenu* _tmp32_;
	GMenu* _tmp33_;
	GMenu* _tmp34_;
	GMenu* _tmp35_;
	GMenu* _tmp36_;
	gchar* _tmp37_;
	gchar* _tmp38_;
	GMenu* _tmp39_;
	GMenu* _tmp40_;
	GMenu* _tmp41_;
	GtkMenuButton* _tmp42_;
	GMenu* _tmp43_;
	GtkSliceListModel* _tmp44_;
	GtkSliceListModel* _tmp45_;
	GtkSliceListModel* _tmp46_;
	GListStore* models = NULL;
	GListStore* _tmp47_;
	GListStore* _tmp48_;
	GtkSliceListModel* _tmp49_;
	GListStore* _tmp50_;
	GtkSliceListModel* _tmp51_;
	GListStore* _tmp52_;
	GtkSliceListModel* _tmp53_;
	GListStore* _tmp54_;
	GListModel* _tmp55_;
	GtkFlattenListModel* _tmp56_;
	GtkListBox* _tmp57_;
	GtkFlattenListModel* _tmp58_;
	GtkListBox* _tmp59_;
	GtkListBox* _tmp60_;
	AdwBanner* _tmp61_;
	AdwBanner* _tmp62_;
	TubaApplication* _tmp63_;
	parent_class = G_OBJECT_CLASS (tuba_views_sidebar_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_VIEWS_TYPE_SIDEBAR, TubaViewsSidebar);
	_tmp0_ = g_menu_new ();
	menu_model = _tmp0_;
	_tmp1_ = g_list_store_new (G_TYPE_OBJECT);
	_g_object_unref0 (self->accounts_model);
	self->accounts_model = _tmp1_;
	_tmp2_ = self->priv->saved_accounts;
	_tmp3_ = self->accounts_model;
	gtk_list_box_bind_model (_tmp2_, (GListModel*) _tmp3_, _tuba_views_sidebar_on_accounts_row_create_gtk_list_box_create_widget_func, g_object_ref (self), g_object_unref);
	_tmp4_ = g_menu_new ();
	account_submenu_model = _tmp4_;
	_tmp5_ = account_submenu_model;
	g_menu_append (_tmp5_, _ ("New Post"), "app.compose");
	_tmp6_ = account_submenu_model;
	g_menu_append (_tmp6_, _ ("Open Profile"), "app.open-current-account-profile");
	_tmp7_ = account_submenu_model;
	g_menu_append (_tmp7_, _ ("Refresh"), "app.refresh");
	_tmp8_ = menu_model;
	_tmp9_ = account_submenu_model;
	g_menu_append_section (_tmp8_, NULL, (GMenuModel*) _tmp9_);
	_tmp10_ = g_menu_new ();
	misc_submenu_model = _tmp10_;
	_tmp11_ = misc_submenu_model;
	g_menu_append (_tmp11_, _ ("Announcements"), "app.open-announcements");
	_tmp12_ = misc_submenu_model;
	g_menu_append (_tmp12_, _ ("Follow Requests"), "app.open-follow-requests");
	_tmp13_ = misc_submenu_model;
	g_menu_append (_tmp13_, _ ("Mutes & Blocks"), "app.open-mutes-blocks");
	_tmp14_ = misc_submenu_model;
	g_menu_append (_tmp14_, _ ("Draft Posts"), "app.open-draft-posts");
	_tmp15_ = misc_submenu_model;
	g_menu_append (_tmp15_, _ ("Scheduled Posts"), "app.open-scheduled-posts");
	_tmp16_ = g_menu_item_new (_ ("Collections"), "app.open-collections");
	collections_menu_item = _tmp16_;
	_tmp17_ = collections_menu_item;
	_tmp18_ = _variant_new31 ("action-disabled");
	g_menu_item_set_attribute_value (_tmp17_, "hidden-when", _tmp18_);
	_g_variant_unref0 (_tmp18_);
	_tmp19_ = misc_submenu_model;
	_tmp20_ = collections_menu_item;
	g_menu_append_item (_tmp19_, _tmp20_);
	_tmp21_ = g_menu_item_new (_ ("#FediWrapped"), "app.open-last-fediwrapped");
	wrapped_menu_item = _tmp21_;
	_tmp22_ = wrapped_menu_item;
	_tmp23_ = _variant_new32 ("action-disabled");
	g_menu_item_set_attribute_value (_tmp22_, "hidden-when", _tmp23_);
	_g_variant_unref0 (_tmp23_);
	_tmp24_ = misc_submenu_model;
	_tmp25_ = wrapped_menu_item;
	g_menu_append_item (_tmp24_, _tmp25_);
	_tmp26_ = g_menu_item_new (_ ("Admin Dashboard"), "app.open-admin-dashboard");
	admin_dahsboard_menu_item = _tmp26_;
	_tmp27_ = admin_dahsboard_menu_item;
	_tmp28_ = _variant_new33 ("action-disabled");
	g_menu_item_set_attribute_value (_tmp27_, "hidden-when", _tmp28_);
	_g_variant_unref0 (_tmp28_);
	_tmp29_ = misc_submenu_model;
	_tmp30_ = admin_dahsboard_menu_item;
	g_menu_append_item (_tmp29_, _tmp30_);
	_tmp31_ = menu_model;
	_tmp32_ = misc_submenu_model;
	g_menu_append_section (_tmp31_, NULL, (GMenuModel*) _tmp32_);
	_tmp33_ = g_menu_new ();
	_g_object_unref0 (misc_submenu_model);
	misc_submenu_model = _tmp33_;
	_tmp34_ = misc_submenu_model;
	g_menu_append (_tmp34_, _ ("Preferences"), "app.open-preferences");
	_tmp35_ = misc_submenu_model;
	g_menu_append (_tmp35_, _ ("Keyboard Shortcuts"), "app.shortcuts");
	_tmp36_ = misc_submenu_model;
	_tmp37_ = g_strdup_printf (_ ("About %s"), BUILD_NAME);
	_tmp38_ = _tmp37_;
	g_menu_append (_tmp36_, _tmp38_, "app.about");
	_g_free0 (_tmp38_);
	_tmp39_ = misc_submenu_model;
	g_menu_append (_tmp39_, _ ("Quit"), "app.quit");
	_tmp40_ = menu_model;
	_tmp41_ = misc_submenu_model;
	g_menu_append_section (_tmp40_, NULL, (GMenuModel*) _tmp41_);
	_tmp42_ = self->priv->menu_btn;
	_tmp43_ = menu_model;
	gtk_menu_button_set_menu_model (_tmp42_, (GMenuModel*) _tmp43_);
	_tmp44_ = gtk_slice_list_model_new (NULL, (guint) 0, (guint) TUBA_VIEWS_SIDEBAR_MAX_SIDEBAR_TAGS);
	_g_object_unref0 (self->tags_items);
	self->tags_items = _tmp44_;
	_tmp45_ = gtk_slice_list_model_new (NULL, (guint) 0, (guint) TUBA_VIEWS_SIDEBAR_MAX_SIDEBAR_LISTS);
	_g_object_unref0 (self->app_items);
	self->app_items = _tmp45_;
	_tmp46_ = gtk_slice_list_model_new (NULL, (guint) 0, (guint) 15);
	_g_object_unref0 (self->account_items);
	self->account_items = _tmp46_;
	_tmp47_ = g_list_store_new (G_TYPE_OBJECT);
	models = _tmp47_;
	_tmp48_ = models;
	_tmp49_ = self->account_items;
	g_list_store_append (_tmp48_, (GObject*) _tmp49_);
	_tmp50_ = models;
	_tmp51_ = self->app_items;
	g_list_store_append (_tmp50_, (GObject*) _tmp51_);
	_tmp52_ = models;
	_tmp53_ = self->tags_items;
	g_list_store_append (_tmp52_, (GObject*) _tmp53_);
	_tmp54_ = models;
	_tmp55_ = _g_object_ref0 ((GListModel*) _tmp54_);
	_tmp56_ = gtk_flatten_list_model_new (_tmp55_);
	_g_object_unref0 (self->item_model);
	self->item_model = _tmp56_;
	_tmp57_ = self->priv->items;
	_tmp58_ = self->item_model;
	gtk_list_box_bind_model (_tmp57_, (GListModel*) _tmp58_, _tuba_views_sidebar_on_item_create_gtk_list_box_create_widget_func, g_object_ref (self), g_object_unref);
	_tmp59_ = self->priv->items;
	gtk_list_box_set_header_func (_tmp59_, _tuba_views_sidebar_on_item_header_update_gtk_list_box_update_header_func, g_object_ref (self), g_object_unref);
	_tmp60_ = self->priv->saved_accounts;
	gtk_list_box_set_header_func (_tmp60_, _tuba_views_sidebar_on_account_header_update_gtk_list_box_update_header_func, g_object_ref (self), g_object_unref);
	tuba_account_holder_construct_account_holder ((TubaAccountHolder*) self);
	_tmp61_ = self->priv->announcements_banner;
	g_signal_connect_object (_tmp61_, "button-clicked", (GCallback) _tuba_views_sidebar_view_announcements_cb_adw_banner_button_clicked, self, 0);
	_tmp62_ = self->priv->fr_banner;
	g_signal_connect_object (_tmp62_, "button-clicked", (GCallback) _tuba_views_sidebar_view_fr_cb_adw_banner_button_clicked, self, 0);
	_tmp63_ = tuba_app;
	g_signal_connect_object ((GObject*) _tmp63_, "notify::is-online", (GCallback) _tuba_views_sidebar_on_network_change_g_object_notify, self, 0);
	tuba_views_sidebar_on_network_change (self);
	_g_object_unref0 (models);
	_g_object_unref0 (admin_dahsboard_menu_item);
	_g_object_unref0 (wrapped_menu_item);
	_g_object_unref0 (collections_menu_item);
	_g_object_unref0 (misc_submenu_model);
	_g_object_unref0 (account_submenu_model);
	_g_object_unref0 (menu_model);
	return obj;
}

static void
tuba_views_sidebar_class_init (TubaViewsSidebarClass * klass,
                               gpointer klass_data)
{
	tuba_views_sidebar_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaViewsSidebar_private_offset);
	((TubaViewsSidebarClass *) klass)->on_accounts_row_create = (GtkWidget* (*) (TubaViewsSidebar*, GObject*)) tuba_views_sidebar_real_on_accounts_row_create;
	((TubaViewsSidebarClass *) klass)->on_accounts_changed = (void (*) (TubaViewsSidebar*, GeeArrayList*)) tuba_views_sidebar_real_on_accounts_changed;
	((TubaViewsSidebarClass *) klass)->on_account_changed = (void (*) (TubaViewsSidebar*, TubaInstanceAccount*)) tuba_views_sidebar_real_on_account_changed;
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_views_sidebar_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_views_sidebar_set_property;
	G_OBJECT_CLASS (klass)->constructor = tuba_views_sidebar_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_views_sidebar_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_VIEWS_SIDEBAR_ACCOUNT_PROPERTY, tuba_views_sidebar_properties[TUBA_VIEWS_SIDEBAR_ACCOUNT_PROPERTY] = g_param_spec_object ("account", "account", "account", TUBA_TYPE_INSTANCE_ACCOUNT, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_VIEWS_SIDEBAR_UNREAD_ANNOUNCEMENTS_PROPERTY, tuba_views_sidebar_properties[TUBA_VIEWS_SIDEBAR_UNREAD_ANNOUNCEMENTS_PROPERTY] = g_param_spec_int ("unread-announcements", "unread-announcements", "unread-announcements", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_VIEWS_SIDEBAR_UNREVIEWED_FOLLOW_REQUESTS_PROPERTY, tuba_views_sidebar_properties[TUBA_VIEWS_SIDEBAR_UNREVIEWED_FOLLOW_REQUESTS_PROPERTY] = g_param_spec_int ("unreviewed-follow-requests", "unreviewed-follow-requests", "unreviewed-follow-requests", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_VIEWS_SIDEBAR_TUBA_WRAPPED_PROPERTY, tuba_views_sidebar_properties[TUBA_VIEWS_SIDEBAR_TUBA_WRAPPED_PROPERTY] = g_param_spec_int ("tuba-wrapped", "tuba-wrapped", "tuba-wrapped", G_MININT, G_MAXINT, 0, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/dev/geopjr/Tuba/ui/views/sidebar/view.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "items", FALSE, TubaViewsSidebar_private_offset + G_STRUCT_OFFSET (TubaViewsSidebarPrivate, items));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "saved_accounts", FALSE, TubaViewsSidebar_private_offset + G_STRUCT_OFFSET (TubaViewsSidebarPrivate, saved_accounts));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "accounts_button_avi", FALSE, TubaViewsSidebar_private_offset + G_STRUCT_OFFSET (TubaViewsSidebarPrivate, accounts_button_avi));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "menu_btn", FALSE, TubaViewsSidebar_private_offset + G_STRUCT_OFFSET (TubaViewsSidebarPrivate, menu_btn));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "account_switcher_popover_menu", FALSE, TubaViewsSidebar_private_offset + G_STRUCT_OFFSET (TubaViewsSidebarPrivate, account_switcher_popover_menu));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "announcements_banner", FALSE, TubaViewsSidebar_private_offset + G_STRUCT_OFFSET (TubaViewsSidebarPrivate, announcements_banner));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "fr_banner", FALSE, TubaViewsSidebar_private_offset + G_STRUCT_OFFSET (TubaViewsSidebarPrivate, fr_banner));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "network_banner", FALSE, TubaViewsSidebar_private_offset + G_STRUCT_OFFSET (TubaViewsSidebarPrivate, network_banner));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_item_activated", G_CALLBACK(_tuba_views_sidebar_on_item_activated_gtk_list_box_row_activated));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_account_activated", G_CALLBACK(_tuba_views_sidebar_on_account_activated_gtk_list_box_row_activated));
	g_type_ensure (TUBA_WIDGETS_TYPE_AVATAR);
	g_type_ensure (TUBA_WIDGETS_TYPE_EMOJI_LABEL);
	gtk_widget_class_set_layout_manager_type (GTK_WIDGET_CLASS (klass), gtk_bin_layout_get_type ());
}

static void
tuba_views_sidebar_tuba_account_holder_interface_init (TubaAccountHolderIface * iface,
                                                       gpointer iface_data)
{
	tuba_views_sidebar_tuba_account_holder_parent_iface = g_type_interface_peek_parent (iface);
	iface->on_accounts_changed = (void (*) (TubaAccountHolder*, GeeArrayList*)) tuba_views_sidebar_on_accounts_changed;
	iface->on_account_changed = (void (*) (TubaAccountHolder*, TubaInstanceAccount*)) tuba_views_sidebar_on_account_changed;
	iface->get_account = tuba_views_sidebar_real_get_account;
	iface->set_account = tuba_views_sidebar_real_set_account;
}

static void
tuba_views_sidebar_instance_init (TubaViewsSidebar * self,
                                  gpointer klass)
{
	self->priv = tuba_views_sidebar_get_instance_private (self);
	self->priv->_account = NULL;
	g_type_ensure (TUBA_WIDGETS_TYPE_AVATAR);
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
tuba_views_sidebar_finalize (GObject * obj)
{
	TubaViewsSidebar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_VIEWS_TYPE_SIDEBAR, TubaViewsSidebar);
	_g_object_unref0 (self->priv->_account);
	_g_object_unref0 (self->tags_items);
	_g_object_unref0 (self->app_items);
	_g_object_unref0 (self->account_items);
	_g_object_unref0 (self->item_model);
	_g_object_unref0 (self->accounts_model);
	_g_object_unref0 (self->priv->sidebar_avatar_btn);
	_g_object_unref0 (self->priv->announcements_banner_binding);
	_g_object_unref0 (self->priv->fr_banner_binding);
	_g_object_unref0 (self->priv->wrapped_binding);
	G_OBJECT_CLASS (tuba_views_sidebar_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_views_sidebar_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaViewsSidebarClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_views_sidebar_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaViewsSidebar), 0, (GInstanceInitFunc) tuba_views_sidebar_instance_init, NULL };
	static const GInterfaceInfo tuba_account_holder_info = { (GInterfaceInitFunc) tuba_views_sidebar_tuba_account_holder_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
	GType tuba_views_sidebar_type_id;
	tuba_views_sidebar_type_id = g_type_register_static (gtk_widget_get_type (), "TubaViewsSidebar", &g_define_type_info, G_TYPE_FLAG_NONE);
	g_type_add_interface_static (tuba_views_sidebar_type_id, TUBA_TYPE_ACCOUNT_HOLDER, &tuba_account_holder_info);
	TubaViewsSidebar_private_offset = g_type_add_instance_private (tuba_views_sidebar_type_id, sizeof (TubaViewsSidebarPrivate));
	return tuba_views_sidebar_type_id;
}

GType
tuba_views_sidebar_get_type (void)
{
	static GType tuba_views_sidebar_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_views_sidebar_type_id__once)) {
		GType tuba_views_sidebar_type_id;
		tuba_views_sidebar_type_id = tuba_views_sidebar_get_type_once ();
		g_once_init_leave_pointer (&tuba_views_sidebar_type_id__once, tuba_views_sidebar_type_id);
	}
	return tuba_views_sidebar_type_id__once;
}

static void
_vala_tuba_views_sidebar_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec)
{
	TubaViewsSidebar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_VIEWS_TYPE_SIDEBAR, TubaViewsSidebar);
	switch (property_id) {
		case TUBA_VIEWS_SIDEBAR_ACCOUNT_PROPERTY:
		g_value_set_object (value, tuba_account_holder_get_account ((TubaAccountHolder*) self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_views_sidebar_set_property (GObject * object,
                                       guint property_id,
                                       const GValue * value,
                                       GParamSpec * pspec)
{
	TubaViewsSidebar * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_VIEWS_TYPE_SIDEBAR, TubaViewsSidebar);
	switch (property_id) {
		case TUBA_VIEWS_SIDEBAR_ACCOUNT_PROPERTY:
		tuba_account_holder_set_account ((TubaAccountHolder*) self, g_value_get_object (value));
		break;
		case TUBA_VIEWS_SIDEBAR_UNREAD_ANNOUNCEMENTS_PROPERTY:
		tuba_views_sidebar_set_unread_announcements (self, g_value_get_int (value));
		break;
		case TUBA_VIEWS_SIDEBAR_UNREVIEWED_FOLLOW_REQUESTS_PROPERTY:
		tuba_views_sidebar_set_unreviewed_follow_requests (self, g_value_get_int (value));
		break;
		case TUBA_VIEWS_SIDEBAR_TUBA_WRAPPED_PROPERTY:
		tuba_views_sidebar_set_tuba_wrapped (self, g_value_get_int (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

