/* ReactionsRow.c generated by valac 0.56.18-dirty, the Vala compiler
 * generated from ReactionsRow.vala, do not modify */

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

#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_WIDGETS_TYPE_REACTIONS_ROW (tuba_widgets_reactions_row_get_type ())
#define TUBA_WIDGETS_REACTIONS_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_REACTIONS_ROW, TubaWidgetsReactionsRow))
#define TUBA_WIDGETS_REACTIONS_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_REACTIONS_ROW, TubaWidgetsReactionsRowClass))
#define TUBA_WIDGETS_IS_REACTIONS_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_REACTIONS_ROW))
#define TUBA_WIDGETS_IS_REACTIONS_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_REACTIONS_ROW))
#define TUBA_WIDGETS_REACTIONS_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_REACTIONS_ROW, TubaWidgetsReactionsRowClass))

typedef struct _TubaWidgetsReactionsRow TubaWidgetsReactionsRow;
typedef struct _TubaWidgetsReactionsRowClass TubaWidgetsReactionsRowClass;
typedef struct _TubaWidgetsReactionsRowPrivate TubaWidgetsReactionsRowPrivate;

#define TUBA_WIDGETS_TYPE_REACT_BUTTON (tuba_widgets_react_button_get_type ())
#define TUBA_WIDGETS_REACT_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_REACT_BUTTON, TubaWidgetsReactButton))
#define TUBA_WIDGETS_REACT_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_REACT_BUTTON, TubaWidgetsReactButtonClass))
#define TUBA_WIDGETS_IS_REACT_BUTTON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_REACT_BUTTON))
#define TUBA_WIDGETS_IS_REACT_BUTTON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_REACT_BUTTON))
#define TUBA_WIDGETS_REACT_BUTTON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_REACT_BUTTON, TubaWidgetsReactButtonClass))

typedef struct _TubaWidgetsReactButton TubaWidgetsReactButton;
typedef struct _TubaWidgetsReactButtonClass TubaWidgetsReactButtonClass;
enum  {
	TUBA_WIDGETS_REACTIONS_ROW_0_PROPERTY,
	TUBA_WIDGETS_REACTIONS_ROW_IS_ANNOUNCEMENT_PROPERTY,
	TUBA_WIDGETS_REACTIONS_ROW_NUM_PROPERTIES
};
static GParamSpec* tuba_widgets_reactions_row_properties[TUBA_WIDGETS_REACTIONS_ROW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block146Data Block146Data;

#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_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_API_TYPE_INSTANCE (tuba_api_instance_get_type ())
#define TUBA_API_INSTANCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_INSTANCE, TubaAPIInstance))
#define TUBA_API_INSTANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_INSTANCE, TubaAPIInstanceClass))
#define TUBA_API_IS_INSTANCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_INSTANCE))
#define TUBA_API_IS_INSTANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_INSTANCE))
#define TUBA_API_INSTANCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_INSTANCE, TubaAPIInstanceClass))

typedef struct _TubaAPIInstance TubaAPIInstance;
typedef struct _TubaAPIInstanceClass TubaAPIInstanceClass;

#define TUBA_API_TYPE_EMOJI_REACTION (tuba_api_emoji_reaction_get_type ())
#define TUBA_API_EMOJI_REACTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_EMOJI_REACTION, TubaAPIEmojiReaction))
#define TUBA_API_EMOJI_REACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_EMOJI_REACTION, TubaAPIEmojiReactionClass))
#define TUBA_API_IS_EMOJI_REACTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_EMOJI_REACTION))
#define TUBA_API_IS_EMOJI_REACTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_EMOJI_REACTION))
#define TUBA_API_EMOJI_REACTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_EMOJI_REACTION, TubaAPIEmojiReactionClass))

typedef struct _TubaAPIEmojiReaction TubaAPIEmojiReaction;
typedef struct _TubaAPIEmojiReactionClass TubaAPIEmojiReactionClass;
typedef struct _Block147Data Block147Data;
typedef struct _Block148Data Block148Data;

#define TUBA_TYPE_REQUEST (tuba_request_get_type ())
#define TUBA_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_REQUEST, TubaRequest))
#define TUBA_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_REQUEST, TubaRequestClass))
#define TUBA_IS_REQUEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_REQUEST))
#define TUBA_IS_REQUEST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_REQUEST))
#define TUBA_REQUEST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_REQUEST, TubaRequestClass))

typedef struct _TubaRequest TubaRequest;
typedef struct _TubaRequestClass TubaRequestClass;
typedef void (*TubaNetworkSuccessCallback) (GInputStream* in_stream, SoupMessageHeaders* response_headers, gpointer user_data, GError** error);
typedef void (*TubaNetworkErrorCallback) (gint32 code, const gchar* reason, gpointer user_data);

#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;
typedef struct _Block149Data Block149Data;

#define TUBA_TYPE_NETWORK (tuba_network_get_type ())
#define TUBA_NETWORK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_NETWORK, TubaNetwork))
#define TUBA_NETWORK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_NETWORK, TubaNetworkClass))
#define TUBA_IS_NETWORK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_NETWORK))
#define TUBA_IS_NETWORK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_NETWORK))
#define TUBA_NETWORK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_NETWORK, TubaNetworkClass))

typedef struct _TubaNetwork TubaNetwork;
typedef struct _TubaNetworkClass TubaNetworkClass;

#define TUBA_API_TYPE_STATUS (tuba_api_status_get_type ())
#define TUBA_API_STATUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_STATUS, TubaAPIStatus))
#define TUBA_API_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_STATUS, TubaAPIStatusClass))
#define TUBA_API_IS_STATUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_STATUS))
#define TUBA_API_IS_STATUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_STATUS))
#define TUBA_API_STATUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_STATUS, TubaAPIStatusClass))

typedef struct _TubaAPIStatus TubaAPIStatus;
typedef struct _TubaAPIStatusClass TubaAPIStatusClass;
#define __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))

#define TUBA_API_PLEROMA_TYPE_INSTANCE (tuba_api_pleroma_instance_get_type ())
#define TUBA_API_PLEROMA_INSTANCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_PLEROMA_TYPE_INSTANCE, TubaAPIPleromaInstance))
#define TUBA_API_PLEROMA_INSTANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_PLEROMA_TYPE_INSTANCE, TubaAPIPleromaInstanceClass))
#define TUBA_API_PLEROMA_IS_INSTANCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_PLEROMA_TYPE_INSTANCE))
#define TUBA_API_PLEROMA_IS_INSTANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_PLEROMA_TYPE_INSTANCE))
#define TUBA_API_PLEROMA_INSTANCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_PLEROMA_TYPE_INSTANCE, TubaAPIPleromaInstanceClass))

typedef struct _TubaAPIPleromaInstance TubaAPIPleromaInstance;
typedef struct _TubaAPIPleromaInstanceClass TubaAPIPleromaInstanceClass;
typedef struct _Block150Data Block150Data;

#define TUBA_API_TYPE_EMOJI (tuba_api_emoji_get_type ())
#define TUBA_API_EMOJI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_EMOJI, TubaAPIEmoji))
#define TUBA_API_EMOJI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_EMOJI, TubaAPIEmojiClass))
#define TUBA_API_IS_EMOJI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_EMOJI))
#define TUBA_API_IS_EMOJI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_EMOJI))
#define TUBA_API_EMOJI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_EMOJI, TubaAPIEmojiClass))

typedef struct _TubaAPIEmoji TubaAPIEmoji;
typedef struct _TubaAPIEmojiClass TubaAPIEmojiClass;

#define TUBA_WIDGETS_TYPE_CUSTOM_EMOJI_CHOOSER (tuba_widgets_custom_emoji_chooser_get_type ())
#define TUBA_WIDGETS_CUSTOM_EMOJI_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_CUSTOM_EMOJI_CHOOSER, TubaWidgetsCustomEmojiChooser))
#define TUBA_WIDGETS_CUSTOM_EMOJI_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_CUSTOM_EMOJI_CHOOSER, TubaWidgetsCustomEmojiChooserClass))
#define TUBA_WIDGETS_IS_CUSTOM_EMOJI_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_CUSTOM_EMOJI_CHOOSER))
#define TUBA_WIDGETS_IS_CUSTOM_EMOJI_CHOOSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_CUSTOM_EMOJI_CHOOSER))
#define TUBA_WIDGETS_CUSTOM_EMOJI_CHOOSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_CUSTOM_EMOJI_CHOOSER, TubaWidgetsCustomEmojiChooserClass))

typedef struct _TubaWidgetsCustomEmojiChooser TubaWidgetsCustomEmojiChooser;
typedef struct _TubaWidgetsCustomEmojiChooserClass TubaWidgetsCustomEmojiChooserClass;

struct _TubaWidgetsReactionsRow {
	AdwBin parent_instance;
	TubaWidgetsReactionsRowPrivate * priv;
};

struct _TubaWidgetsReactionsRowClass {
	AdwBinClass parent_class;
};

struct _TubaWidgetsReactionsRowPrivate {
	AdwWrapBox* reaction_box;
	GeeHashMap* react_btn_list;
	GtkMenuButton* emoji_button;
	GtkMenuButton* custom_emoji_button;
	gboolean _is_announcement;
	gchar* status_id;
};

struct _Block146Data {
	int _ref_count_;
	TubaWidgetsReactionsRow* self;
	gint64 max_reacts;
	gint self_reacts;
};

struct _Block147Data {
	int _ref_count_;
	TubaWidgetsReactionsRow* self;
	gchar** new_reactions_keys;
	gint new_reactions_keys_length1;
	gint _new_reactions_keys_size_;
};

struct _Block148Data {
	int _ref_count_;
	TubaWidgetsReactionsRow* self;
	TubaWidgetsReactButton* btn;
};

struct _Block149Data {
	int _ref_count_;
	TubaWidgetsReactionsRow* self;
	gchar* shortcode;
};

struct _Block150Data {
	int _ref_count_;
	TubaWidgetsReactionsRow* self;
	gboolean value;
};

static gint TubaWidgetsReactionsRow_private_offset;
static gpointer tuba_widgets_reactions_row_parent_class = NULL;
VALA_EXTERN TubaAccountStore* tuba_accounts;
VALA_EXTERN TubaApplication* tuba_app;
VALA_EXTERN TubaNetwork* tuba_network;

VALA_EXTERN GType tuba_widgets_reactions_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsReactionsRow, g_object_unref)
VALA_EXTERN GType tuba_widgets_react_button_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsReactButton, g_object_unref)
static void tuba_widgets_reactions_row_update_reaction_add_state (TubaWidgetsReactionsRow* self);
static Block146Data* block146_data_ref (Block146Data* _data146_);
static void block146_data_unref (void * _userdata_);
VALA_EXTERN gboolean tuba_widgets_reactions_row_get_is_announcement (TubaWidgetsReactionsRow* self);
VALA_EXTERN GType tuba_account_store_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAccountStore, g_object_unref)
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 TubaInstanceAccount* tuba_account_store_get_active (TubaAccountStore* self);
VALA_EXTERN GType tuba_api_instance_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIInstance, g_object_unref)
VALA_EXTERN TubaAPIInstance* tuba_instance_account_get_instance_info (TubaInstanceAccount* self);
VALA_EXTERN gint64 tuba_api_instance_get_compat_status_reactions_max (TubaAPIInstance* self);
static gboolean __lambda104_ (Block146Data* _data146_,
                       GeeMapEntry* e);
VALA_EXTERN gboolean tuba_widgets_react_button_get_has_reacted (TubaWidgetsReactButton* self);
static gboolean ___lambda104__gee_forall_func (gpointer g,
                                        gpointer self);
static void tuba_widgets_reactions_row_set_can_add_reaction (TubaWidgetsReactionsRow* self,
                                                      gboolean value);
VALA_EXTERN GType tuba_api_emoji_reaction_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIEmojiReaction, g_object_unref)
VALA_EXTERN void tuba_widgets_reactions_row_update_reactions_diff (TubaWidgetsReactionsRow* self,
                                                       GeeArrayList* new_reactions);
static Block147Data* block147_data_ref (Block147Data* _data147_);
static void block147_data_unref (void * _userdata_);
VALA_EXTERN const gchar* tuba_api_emoji_reaction_get_name (TubaAPIEmojiReaction* self);
static void _vala_array_add138 (gchar** * array,
                         gint* length,
                         gint* size,
                         gchar* value);
VALA_EXTERN void tuba_widgets_react_button_update_reaction (TubaWidgetsReactButton* self,
                                                TubaAPIEmojiReaction* reaction);
static void tuba_widgets_reactions_row_add_emoji (TubaWidgetsReactionsRow* self,
                                           TubaAPIEmojiReaction* reaction);
static gboolean __lambda108_ (Block147Data* _data147_,
                       GeeMapEntry* e);
static gboolean _vala_string_array_contains (gchar* * stack,
                                      gssize stack_length,
                                      const gchar* needle);
static void tuba_widgets_reactions_row_on_remove (TubaWidgetsReactionsRow* self,
                                           TubaWidgetsReactButton* btn);
static gboolean ___lambda108__gee_forall_func (gpointer g,
                                        gpointer self);
VALA_EXTERN TubaWidgetsReactionsRow* tuba_widgets_reactions_row_new (const gchar* status_id,
                                                         GeeArrayList* reactions,
                                                         gboolean is_announcement);
VALA_EXTERN TubaWidgetsReactionsRow* tuba_widgets_reactions_row_construct (GType object_type,
                                                               const gchar* status_id,
                                                               GeeArrayList* reactions,
                                                               gboolean is_announcement);
VALA_EXTERN void tuba_widgets_reactions_row_set_is_announcement (TubaWidgetsReactionsRow* self,
                                                     gboolean value);
static void tuba_widgets_reactions_row_set_reactions (TubaWidgetsReactionsRow* self,
                                               GeeArrayList* value);
static void tuba_widgets_reactions_row_on_reaction_toggled (TubaWidgetsReactionsRow* self,
                                                     TubaWidgetsReactButton* btn);
static Block148Data* block148_data_ref (Block148Data* _data148_);
static void block148_data_unref (void * _userdata_);
VALA_EXTERN GType tuba_request_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaRequest, g_object_unref)
static TubaRequest* tuba_widgets_reactions_row_reaction_request (TubaWidgetsReactionsRow* self,
                                                          const gchar* shortcode,
                                                          gboolean has_reacted);
VALA_EXTERN const gchar* tuba_widgets_react_button_get_shortcode (TubaWidgetsReactButton* self);
VALA_EXTERN TubaRequest* tuba_request_with_account (TubaRequest* self,
                                        TubaInstanceAccount* account);
VALA_EXTERN TubaRequest* tuba_request_then (TubaRequest* self,
                                TubaNetworkSuccessCallback cb,
                                gpointer cb_target,
                                GDestroyNotify cb_target_destroy_notify);
static void __lambda106_ (Block148Data* _data148_,
                   GError** error);
VALA_EXTERN void tuba_widgets_react_button_update_reacted (TubaWidgetsReactButton* self,
                                               gboolean reacted);
static void ___lambda106__tuba_network_success_callback (GInputStream* in_stream,
                                                  SoupMessageHeaders* response_headers,
                                                  gpointer self,
                                                  GError** error);
VALA_EXTERN TubaRequest* tuba_request_on_error (TubaRequest* self,
                                    TubaNetworkErrorCallback cb,
                                    gpointer cb_target,
                                    GDestroyNotify cb_target_destroy_notify);
static void __lambda107_ (Block148Data* _data148_,
                   gint32 code,
                   const gchar* message);
VALA_EXTERN GType tuba_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaApplication, g_object_unref)
static void ___lambda107__tuba_network_error_callback (gint32 code,
                                                const gchar* reason,
                                                gpointer self);
VALA_EXTERN TubaRequest* tuba_request_exec (TubaRequest* self);
static void tuba_widgets_reactions_row_react_with_shortcode (TubaWidgetsReactionsRow* self,
                                                      const gchar* shortcode);
static Block149Data* block149_data_ref (Block149Data* _data149_);
static void block149_data_unref (void * _userdata_);
static void ___lambda110_ (TubaWidgetsReactionsRow* self,
                    GInputStream* in_stream,
                    GError** error);
VALA_EXTERN JsonParser* tuba_network_get_parser_from_inputstream (GInputStream* in_stream,
                                                      GError** error);
VALA_EXTERN GType tuba_network_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaNetwork, g_object_unref)
VALA_EXTERN JsonNode* tuba_network_parse_node (TubaNetwork* self,
                                   JsonParser* parser);
VALA_EXTERN GType tuba_api_status_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIStatus, g_object_unref)
VALA_EXTERN TubaAPIStatus* tuba_api_status_from (JsonNode* node,
                                     GError** error);
static void _vala_JsonNode_free (JsonNode* self);
VALA_EXTERN TubaAPIStatus* tuba_api_status_get_formal (TubaAPIStatus* self);
VALA_EXTERN GeeArrayList* tuba_api_status_get_compat_status_reactions (TubaAPIStatus* self);
static void ____lambda110__tuba_network_success_callback (GInputStream* in_stream,
                                                   SoupMessageHeaders* response_headers,
                                                   gpointer self,
                                                   GError** error);
static void ___lambda111_ (Block149Data* _data149_,
                    gint32 code,
                    const gchar* message);
static void ____lambda111__tuba_network_error_callback (gint32 code,
                                                 const gchar* reason,
                                                 gpointer self);
VALA_EXTERN TubaRequest* tuba_request_new_DELETE (const gchar* url);
VALA_EXTERN TubaRequest* tuba_request_construct_DELETE (GType object_type,
                                            const gchar* url);
VALA_EXTERN TubaRequest* tuba_request_new_PUT (const gchar* url);
VALA_EXTERN TubaRequest* tuba_request_construct_PUT (GType object_type,
                                         const gchar* url);
VALA_EXTERN GType tuba_api_pleroma_instance_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIPleromaInstance, g_object_unref)
VALA_EXTERN TubaAPIPleromaInstance* tuba_api_instance_get_pleroma (TubaAPIInstance* self);
VALA_EXTERN TubaRequest* tuba_request_new_POST (const gchar* url);
VALA_EXTERN TubaRequest* tuba_request_construct_POST (GType object_type,
                                          const gchar* url);
static void tuba_widgets_reactions_row_on_remove_and_update_state (TubaWidgetsReactionsRow* self,
                                                            TubaWidgetsReactButton* btn);
static void tuba_widgets_reactions_row_on_emoji_picked (TubaWidgetsReactionsRow* self,
                                                 const gchar* emoji);
static void tuba_widgets_reactions_row_on_custom_emoji_picked (TubaWidgetsReactionsRow* self,
                                                        const gchar* emoji_shortcode);
VALA_EXTERN gint64 tuba_api_emoji_reaction_get_count (TubaAPIEmojiReaction* self);
VALA_EXTERN TubaWidgetsReactButton* tuba_widgets_react_button_new (TubaAPIEmojiReaction* reaction);
VALA_EXTERN TubaWidgetsReactButton* tuba_widgets_react_button_construct (GType object_type,
                                                             TubaAPIEmojiReaction* reaction);
static void _tuba_widgets_reactions_row_on_reaction_toggled_tuba_widgets_react_button_reaction_toggled (TubaWidgetsReactButton* _sender,
                                                                                                 gpointer self);
static void _tuba_widgets_reactions_row_on_remove_and_update_state_tuba_widgets_react_button_removed (TubaWidgetsReactButton* _sender,
                                                                                               gpointer self);
static Block150Data* block150_data_ref (Block150Data* _data150_);
static void block150_data_unref (void * _userdata_);
static gboolean _tuba_widgets_reactions_row_can_add_reaction___lambda105_ (Block150Data* _data150_,
                                                                    GeeMapEntry* e);
static gboolean __tuba_widgets_reactions_row_can_add_reaction___lambda105__gee_forall_func (gpointer g,
                                                                                     gpointer self);
static gboolean _tuba_widgets_reactions_row_reactions___lambda109_ (TubaWidgetsReactionsRow* self,
                                                             GeeMapEntry* e);
static gboolean __tuba_widgets_reactions_row_reactions___lambda109__gee_forall_func (gpointer g,
                                                                              gpointer self);
static GObject * tuba_widgets_reactions_row_constructor (GType type,
                                                  guint n_construct_properties,
                                                  GObjectConstructParam * construct_properties);
static void _tuba_widgets_reactions_row_on_emoji_picked_gtk_emoji_chooser_emoji_picked (GtkEmojiChooser* _sender,
                                                                                 const gchar* text,
                                                                                 gpointer self);
VALA_EXTERN GType tuba_api_emoji_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIEmoji, g_object_unref)
VALA_EXTERN GeeArrayList* tuba_instance_account_get_instance_emojis (TubaInstanceAccount* self);
VALA_EXTERN GType tuba_widgets_custom_emoji_chooser_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsCustomEmojiChooser, g_object_unref)
VALA_EXTERN TubaWidgetsCustomEmojiChooser* tuba_widgets_custom_emoji_chooser_new (void);
VALA_EXTERN TubaWidgetsCustomEmojiChooser* tuba_widgets_custom_emoji_chooser_construct (GType object_type);
static void _tuba_widgets_reactions_row_on_custom_emoji_picked_tuba_widgets_custom_emoji_chooser_emoji_picked (TubaWidgetsCustomEmojiChooser* _sender,
                                                                                                        const gchar* shortcode,
                                                                                                        gpointer self);
static void tuba_widgets_reactions_row_finalize (GObject * obj);
static GType tuba_widgets_reactions_row_get_type_once (void);
static void _vala_tuba_widgets_reactions_row_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);
static void _vala_tuba_widgets_reactions_row_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_widgets_reactions_row_get_instance_private (TubaWidgetsReactionsRow* self)
{
	return G_STRUCT_MEMBER_P (self, TubaWidgetsReactionsRow_private_offset);
}

static Block146Data*
block146_data_ref (Block146Data* _data146_)
{
	g_atomic_int_inc (&_data146_->_ref_count_);
	return _data146_;
}

static void
block146_data_unref (void * _userdata_)
{
	Block146Data* _data146_;
	_data146_ = (Block146Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data146_->_ref_count_)) {
		TubaWidgetsReactionsRow* self;
		self = _data146_->self;
		_g_object_unref0 (self);
		g_slice_free (Block146Data, _data146_);
	}
}

static gboolean
__lambda104_ (Block146Data* _data146_,
              GeeMapEntry* e)
{
	TubaWidgetsReactionsRow* self;
	gconstpointer _tmp0_;
	gconstpointer _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean result;
	self = _data146_->self;
	g_return_val_if_fail (e != NULL, FALSE);
	_tmp0_ = gee_map_entry_get_value (e);
	_tmp1_ = _tmp0_;
	_tmp2_ = tuba_widgets_react_button_get_has_reacted (G_TYPE_CHECK_INSTANCE_CAST ((TubaWidgetsReactButton*) _tmp1_, TUBA_WIDGETS_TYPE_REACT_BUTTON, TubaWidgetsReactButton));
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		_data146_->self_reacts += 1;
		if (((gint64) _data146_->self_reacts) >= _data146_->max_reacts) {
			result = FALSE;
			_g_object_unref0 (e);
			return result;
		}
	}
	result = TRUE;
	_g_object_unref0 (e);
	return result;
}

static gboolean
___lambda104__gee_forall_func (gpointer g,
                               gpointer self)
{
	gboolean result;
	result = __lambda104_ (self, (GeeMapEntry*) g);
	return result;
}

static void
tuba_widgets_reactions_row_update_reaction_add_state (TubaWidgetsReactionsRow* self)
{
	Block146Data* _data146_;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_;
	gboolean _tmp2_;
	TubaAccountStore* _tmp8_;
	TubaInstanceAccount* _tmp9_;
	TubaInstanceAccount* _tmp10_;
	TubaAPIInstance* _tmp11_;
	TubaAPIInstance* _tmp12_;
	gint64 _tmp13_;
	gint64 _tmp14_;
	GeeHashMap* _tmp15_;
	g_return_if_fail (self != NULL);
	_data146_ = g_slice_new0 (Block146Data);
	_data146_->_ref_count_ = 1;
	_data146_->self = g_object_ref (self);
	_tmp1_ = tuba_widgets_reactions_row_get_is_announcement (self);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		_tmp0_ = TRUE;
	} else {
		TubaAccountStore* _tmp3_;
		TubaInstanceAccount* _tmp4_;
		TubaInstanceAccount* _tmp5_;
		TubaAPIInstance* _tmp6_;
		TubaAPIInstance* _tmp7_;
		_tmp3_ = tuba_accounts;
		_tmp4_ = tuba_account_store_get_active (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = tuba_instance_account_get_instance_info (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp0_ = _tmp7_ == NULL;
	}
	if (_tmp0_) {
		block146_data_unref (_data146_);
		_data146_ = NULL;
		return;
	}
	_tmp8_ = tuba_accounts;
	_tmp9_ = tuba_account_store_get_active (_tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = tuba_instance_account_get_instance_info (_tmp10_);
	_tmp12_ = _tmp11_;
	_tmp13_ = tuba_api_instance_get_compat_status_reactions_max (_tmp12_);
	_tmp14_ = _tmp13_;
	_data146_->max_reacts = _tmp14_;
	if (_data146_->max_reacts == ((gint64) 0)) {
		block146_data_unref (_data146_);
		_data146_ = NULL;
		return;
	}
	_data146_->self_reacts = 0;
	_tmp15_ = self->priv->react_btn_list;
	gee_abstract_map_foreach ((GeeAbstractMap*) _tmp15_, ___lambda104__gee_forall_func, _data146_);
	tuba_widgets_reactions_row_set_can_add_reaction (self, ((gint64) _data146_->self_reacts) < _data146_->max_reacts);
	block146_data_unref (_data146_);
	_data146_ = NULL;
}

static Block147Data*
block147_data_ref (Block147Data* _data147_)
{
	g_atomic_int_inc (&_data147_->_ref_count_);
	return _data147_;
}

static void
block147_data_unref (void * _userdata_)
{
	Block147Data* _data147_;
	_data147_ = (Block147Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data147_->_ref_count_)) {
		TubaWidgetsReactionsRow* self;
		self = _data147_->self;
		_data147_->new_reactions_keys = (_vala_array_free (_data147_->new_reactions_keys, _data147_->new_reactions_keys_length1, (GDestroyNotify) g_free), NULL);
		_g_object_unref0 (self);
		g_slice_free (Block147Data, _data147_);
	}
}

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

static gboolean
_vala_string_array_contains (gchar* * stack,
                             gssize stack_length,
                             const gchar* needle)
{
	gssize i;
	for (i = 0; i < stack_length; i++) {
		if (g_strcmp0 (stack[i], needle) == 0) {
			return TRUE;
		}
	}
	return FALSE;
}

static gboolean
__lambda108_ (Block147Data* _data147_,
              GeeMapEntry* e)
{
	TubaWidgetsReactionsRow* self;
	gconstpointer _tmp0_;
	gconstpointer _tmp1_;
	gchar** _tmp2_;
	gint _tmp2__length1;
	gboolean result;
	self = _data147_->self;
	g_return_val_if_fail (e != NULL, FALSE);
	_tmp0_ = gee_map_entry_get_key (e);
	_tmp1_ = _tmp0_;
	_tmp2_ = _data147_->new_reactions_keys;
	_tmp2__length1 = _data147_->new_reactions_keys_length1;
	if (!_vala_string_array_contains (_tmp2_, _tmp2__length1, (const gchar*) ((const gchar*) _tmp1_))) {
		gconstpointer _tmp3_;
		gconstpointer _tmp4_;
		_tmp3_ = gee_map_entry_get_value (e);
		_tmp4_ = _tmp3_;
		tuba_widgets_reactions_row_on_remove (self, G_TYPE_CHECK_INSTANCE_CAST ((TubaWidgetsReactButton*) _tmp4_, TUBA_WIDGETS_TYPE_REACT_BUTTON, TubaWidgetsReactButton));
	}
	result = TRUE;
	_g_object_unref0 (e);
	return result;
}

static gboolean
___lambda108__gee_forall_func (gpointer g,
                               gpointer self)
{
	gboolean result;
	result = __lambda108_ (self, (GeeMapEntry*) g);
	return result;
}

void
tuba_widgets_reactions_row_update_reactions_diff (TubaWidgetsReactionsRow* self,
                                                  GeeArrayList* new_reactions)
{
	Block147Data* _data147_;
	gchar** _tmp0_;
	GeeHashMap* _tmp24_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (new_reactions != NULL);
	_data147_ = g_slice_new0 (Block147Data);
	_data147_->_ref_count_ = 1;
	_data147_->self = g_object_ref (self);
	_tmp0_ = g_new0 (gchar*, 0 + 1);
	_data147_->new_reactions_keys = _tmp0_;
	_data147_->new_reactions_keys_length1 = 0;
	_data147_->_new_reactions_keys_size_ = _data147_->new_reactions_keys_length1;
	{
		GeeArrayList* _p_list = NULL;
		gint _p_size = 0;
		GeeArrayList* _tmp1_;
		gint _tmp2_;
		gint _tmp3_;
		gint _p_index = 0;
		_p_list = new_reactions;
		_tmp1_ = _p_list;
		_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
		_tmp3_ = _tmp2_;
		_p_size = _tmp3_;
		_p_index = -1;
		while (TRUE) {
			gint _tmp4_;
			gint _tmp5_;
			TubaAPIEmojiReaction* p = NULL;
			GeeArrayList* _tmp6_;
			gpointer _tmp7_;
			TubaAPIEmojiReaction* _tmp8_;
			const gchar* _tmp9_;
			const gchar* _tmp10_;
			gchar* _tmp11_;
			GeeHashMap* _tmp12_;
			TubaAPIEmojiReaction* _tmp13_;
			const gchar* _tmp14_;
			const gchar* _tmp15_;
			_p_index = _p_index + 1;
			_tmp4_ = _p_index;
			_tmp5_ = _p_size;
			if (!(_tmp4_ < _tmp5_)) {
				break;
			}
			_tmp6_ = _p_list;
			_tmp7_ = gee_abstract_list_get ((GeeAbstractList*) _tmp6_, _p_index);
			p = (TubaAPIEmojiReaction*) _tmp7_;
			_tmp8_ = p;
			_tmp9_ = tuba_api_emoji_reaction_get_name (_tmp8_);
			_tmp10_ = _tmp9_;
			_tmp11_ = g_strdup (_tmp10_);
			_vala_array_add138 (&_data147_->new_reactions_keys, &_data147_->new_reactions_keys_length1, &_data147_->_new_reactions_keys_size_, _tmp11_);
			_tmp12_ = self->priv->react_btn_list;
			_tmp13_ = p;
			_tmp14_ = tuba_api_emoji_reaction_get_name (_tmp13_);
			_tmp15_ = _tmp14_;
			if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp12_, _tmp15_)) {
				GeeHashMap* _tmp16_;
				TubaAPIEmojiReaction* _tmp17_;
				const gchar* _tmp18_;
				const gchar* _tmp19_;
				gpointer _tmp20_;
				TubaWidgetsReactButton* _tmp21_;
				TubaAPIEmojiReaction* _tmp22_;
				_tmp16_ = self->priv->react_btn_list;
				_tmp17_ = p;
				_tmp18_ = tuba_api_emoji_reaction_get_name (_tmp17_);
				_tmp19_ = _tmp18_;
				_tmp20_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp16_, _tmp19_);
				_tmp21_ = (TubaWidgetsReactButton*) _tmp20_;
				_tmp22_ = p;
				tuba_widgets_react_button_update_reaction (_tmp21_, _tmp22_);
				_g_object_unref0 (_tmp21_);
			} else {
				TubaAPIEmojiReaction* _tmp23_;
				_tmp23_ = p;
				tuba_widgets_reactions_row_add_emoji (self, _tmp23_);
			}
			_g_object_unref0 (p);
		}
	}
	_tmp24_ = self->priv->react_btn_list;
	gee_abstract_map_foreach ((GeeAbstractMap*) _tmp24_, ___lambda108__gee_forall_func, _data147_);
	tuba_widgets_reactions_row_update_reaction_add_state (self);
	block147_data_unref (_data147_);
	_data147_ = NULL;
}

TubaWidgetsReactionsRow*
tuba_widgets_reactions_row_construct (GType object_type,
                                      const gchar* status_id,
                                      GeeArrayList* reactions,
                                      gboolean is_announcement)
{
	TubaWidgetsReactionsRow * self = NULL;
	gchar* _tmp0_;
	g_return_val_if_fail (status_id != NULL, NULL);
	g_return_val_if_fail (reactions != NULL, NULL);
	self = (TubaWidgetsReactionsRow*) g_object_new (object_type, NULL);
	tuba_widgets_reactions_row_set_is_announcement (self, is_announcement);
	_tmp0_ = g_strdup (status_id);
	_g_free0 (self->priv->status_id);
	self->priv->status_id = _tmp0_;
	tuba_widgets_reactions_row_set_reactions (self, reactions);
	return self;
}

TubaWidgetsReactionsRow*
tuba_widgets_reactions_row_new (const gchar* status_id,
                                GeeArrayList* reactions,
                                gboolean is_announcement)
{
	return tuba_widgets_reactions_row_construct (TUBA_WIDGETS_TYPE_REACTIONS_ROW, status_id, reactions, is_announcement);
}

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

static Block148Data*
block148_data_ref (Block148Data* _data148_)
{
	g_atomic_int_inc (&_data148_->_ref_count_);
	return _data148_;
}

static void
block148_data_unref (void * _userdata_)
{
	Block148Data* _data148_;
	_data148_ = (Block148Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data148_->_ref_count_)) {
		TubaWidgetsReactionsRow* self;
		self = _data148_->self;
		_g_object_unref0 (_data148_->btn);
		_g_object_unref0 (self);
		g_slice_free (Block148Data, _data148_);
	}
}

static void
__lambda106_ (Block148Data* _data148_,
              GError** error)
{
	TubaWidgetsReactionsRow* self;
	gboolean _tmp0_;
	gboolean _tmp1_;
	self = _data148_->self;
	_tmp0_ = tuba_widgets_react_button_get_has_reacted (_data148_->btn);
	_tmp1_ = _tmp0_;
	tuba_widgets_react_button_update_reacted (_data148_->btn, !_tmp1_);
	gtk_widget_set_sensitive ((GtkWidget*) _data148_->btn, TRUE);
}

static void
___lambda106__tuba_network_success_callback (GInputStream* in_stream,
                                             SoupMessageHeaders* response_headers,
                                             gpointer self,
                                             GError** error)
{
	__lambda106_ (self, error);
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

static void
__lambda107_ (Block148Data* _data148_,
              gint32 code,
              const gchar* message)
{
	TubaWidgetsReactionsRow* self;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	const gchar* _tmp7_;
	gchar* _tmp8_;
	gchar* _tmp9_;
	TubaApplication* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	self = _data148_->self;
	g_return_if_fail (message != NULL);
	_tmp0_ = self->priv->status_id;
	_tmp1_ = string_to_string (_tmp0_);
	_tmp2_ = tuba_widgets_react_button_get_shortcode (_data148_->btn);
	_tmp3_ = _tmp2_;
	_tmp4_ = string_to_string (_tmp3_);
	_tmp5_ = g_strdup_printf ("%i", code);
	_tmp6_ = _tmp5_;
	_tmp7_ = string_to_string (message);
	_tmp8_ = g_strconcat ("Error while reacting to ", _tmp1_, " with ", _tmp4_, ": ", _tmp6_, " ", _tmp7_, NULL);
	_tmp9_ = _tmp8_;
	g_warning ("ReactionsRow.vala:149: %s", _tmp9_);
	_g_free0 (_tmp9_);
	_g_free0 (_tmp6_);
	gtk_widget_set_sensitive ((GtkWidget*) _data148_->btn, TRUE);
	_tmp10_ = tuba_app;
	_tmp11_ = g_strdup_printf ("%s: %s", _ ("Error"), message);
	_tmp12_ = _tmp11_;
	g_signal_emit_by_name (_tmp10_, "toast", _tmp12_, (guint) 5);
	_g_free0 (_tmp12_);
	tuba_widgets_reactions_row_update_reaction_add_state (self);
}

static void
___lambda107__tuba_network_error_callback (gint32 code,
                                           const gchar* reason,
                                           gpointer self)
{
	__lambda107_ (self, code, reason);
}

static void
tuba_widgets_reactions_row_on_reaction_toggled (TubaWidgetsReactionsRow* self,
                                                TubaWidgetsReactButton* btn)
{
	Block148Data* _data148_;
	TubaWidgetsReactButton* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	TubaRequest* _tmp5_;
	TubaRequest* _tmp6_;
	TubaAccountStore* _tmp7_;
	TubaInstanceAccount* _tmp8_;
	TubaInstanceAccount* _tmp9_;
	TubaRequest* _tmp10_;
	TubaRequest* _tmp11_;
	TubaRequest* _tmp12_;
	TubaRequest* _tmp13_;
	TubaRequest* _tmp14_;
	TubaRequest* _tmp15_;
	TubaRequest* _tmp16_;
	TubaRequest* _tmp17_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (btn != NULL);
	_data148_ = g_slice_new0 (Block148Data);
	_data148_->_ref_count_ = 1;
	_data148_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (btn);
	_g_object_unref0 (_data148_->btn);
	_data148_->btn = _tmp0_;
	gtk_widget_set_sensitive ((GtkWidget*) _data148_->btn, FALSE);
	_tmp1_ = tuba_widgets_react_button_get_shortcode (_data148_->btn);
	_tmp2_ = _tmp1_;
	_tmp3_ = tuba_widgets_react_button_get_has_reacted (_data148_->btn);
	_tmp4_ = _tmp3_;
	_tmp5_ = tuba_widgets_reactions_row_reaction_request (self, _tmp2_, _tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = tuba_accounts;
	_tmp8_ = tuba_account_store_get_active (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = tuba_request_with_account (_tmp6_, _tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = tuba_request_then (_tmp11_, ___lambda106__tuba_network_success_callback, block148_data_ref (_data148_), block148_data_unref);
	_tmp13_ = _tmp12_;
	_tmp14_ = tuba_request_on_error (_tmp13_, ___lambda107__tuba_network_error_callback, block148_data_ref (_data148_), block148_data_unref);
	_tmp15_ = _tmp14_;
	_tmp16_ = tuba_request_exec (_tmp15_);
	_tmp17_ = _tmp16_;
	_g_object_unref0 (_tmp17_);
	_g_object_unref0 (_tmp15_);
	_g_object_unref0 (_tmp13_);
	_g_object_unref0 (_tmp11_);
	_g_object_unref0 (_tmp6_);
	block148_data_unref (_data148_);
	_data148_ = NULL;
}

static Block149Data*
block149_data_ref (Block149Data* _data149_)
{
	g_atomic_int_inc (&_data149_->_ref_count_);
	return _data149_;
}

static void
block149_data_unref (void * _userdata_)
{
	Block149Data* _data149_;
	_data149_ = (Block149Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data149_->_ref_count_)) {
		TubaWidgetsReactionsRow* self;
		self = _data149_->self;
		_g_free0 (_data149_->shortcode);
		_g_object_unref0 (self);
		g_slice_free (Block149Data, _data149_);
	}
}

static void
_vala_JsonNode_free (JsonNode* self)
{
	g_boxed_free (json_node_get_type (), self);
}

static void
___lambda110_ (TubaWidgetsReactionsRow* self,
               GInputStream* in_stream,
               GError** error)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (in_stream != NULL);
	_tmp0_ = tuba_widgets_reactions_row_get_is_announcement (self);
	_tmp1_ = _tmp0_;
	if (!_tmp1_) {
		JsonParser* parser = NULL;
		JsonParser* _tmp2_;
		JsonNode* node = NULL;
		TubaNetwork* _tmp3_;
		JsonParser* _tmp4_;
		JsonNode* _tmp5_;
		TubaAPIStatus* status = NULL;
		JsonNode* _tmp6_;
		TubaAPIStatus* _tmp7_;
		TubaAPIStatus* _tmp8_;
		TubaAPIStatus* _tmp9_;
		TubaAPIStatus* _tmp10_;
		GeeArrayList* _tmp11_;
		GeeArrayList* _tmp12_;
		_tmp2_ = tuba_network_get_parser_from_inputstream (in_stream, &_inner_error0_);
		parser = _tmp2_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_propagate_error (error, _inner_error0_);
			return;
		}
		_tmp3_ = tuba_network;
		_tmp4_ = parser;
		_tmp5_ = tuba_network_parse_node (_tmp3_, _tmp4_);
		node = _tmp5_;
		_tmp6_ = node;
		_tmp7_ = tuba_api_status_from (_tmp6_, &_inner_error0_);
		status = _tmp7_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			g_propagate_error (error, _inner_error0_);
			__vala_JsonNode_free0 (node);
			_g_object_unref0 (parser);
			return;
		}
		_tmp8_ = status;
		_tmp9_ = tuba_api_status_get_formal (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = tuba_api_status_get_compat_status_reactions (_tmp10_);
		_tmp12_ = _tmp11_;
		if (_tmp12_ != NULL) {
			TubaAPIStatus* _tmp13_;
			TubaAPIStatus* _tmp14_;
			TubaAPIStatus* _tmp15_;
			GeeArrayList* _tmp16_;
			GeeArrayList* _tmp17_;
			_tmp13_ = status;
			_tmp14_ = tuba_api_status_get_formal (_tmp13_);
			_tmp15_ = _tmp14_;
			_tmp16_ = tuba_api_status_get_compat_status_reactions (_tmp15_);
			_tmp17_ = _tmp16_;
			tuba_widgets_reactions_row_update_reactions_diff (self, _tmp17_);
		}
		_g_object_unref0 (status);
		__vala_JsonNode_free0 (node);
		_g_object_unref0 (parser);
	}
}

static void
____lambda110__tuba_network_success_callback (GInputStream* in_stream,
                                              SoupMessageHeaders* response_headers,
                                              gpointer self,
                                              GError** error)
{
	___lambda110_ ((TubaWidgetsReactionsRow*) self, in_stream, error);
}

static void
___lambda111_ (Block149Data* _data149_,
               gint32 code,
               const gchar* message)
{
	TubaWidgetsReactionsRow* self;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	TubaApplication* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	self = _data149_->self;
	g_return_if_fail (message != NULL);
	_tmp0_ = self->priv->status_id;
	_tmp1_ = string_to_string (_tmp0_);
	_tmp2_ = string_to_string (_data149_->shortcode);
	_tmp3_ = g_strdup_printf ("%i", code);
	_tmp4_ = _tmp3_;
	_tmp5_ = string_to_string (message);
	_tmp6_ = g_strconcat ("Error while reacting to ", _tmp1_, " with ", _tmp2_, ": ", _tmp4_, " ", _tmp5_, NULL);
	_tmp7_ = _tmp6_;
	g_warning ("ReactionsRow.vala:175: %s", _tmp7_);
	_g_free0 (_tmp7_);
	_g_free0 (_tmp4_);
	_tmp8_ = tuba_app;
	_tmp9_ = g_strdup_printf ("%s: %s", _ ("Error"), message);
	_tmp10_ = _tmp9_;
	g_signal_emit_by_name (_tmp8_, "toast", _tmp10_, (guint) 5);
	_g_free0 (_tmp10_);
}

static void
____lambda111__tuba_network_error_callback (gint32 code,
                                            const gchar* reason,
                                            gpointer self)
{
	___lambda111_ (self, code, reason);
}

static void
tuba_widgets_reactions_row_react_with_shortcode (TubaWidgetsReactionsRow* self,
                                                 const gchar* shortcode)
{
	Block149Data* _data149_;
	gchar* _tmp0_;
	GeeHashMap* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (shortcode != NULL);
	_data149_ = g_slice_new0 (Block149Data);
	_data149_->_ref_count_ = 1;
	_data149_->self = g_object_ref (self);
	_tmp0_ = g_strdup (shortcode);
	_g_free0 (_data149_->shortcode);
	_data149_->shortcode = _tmp0_;
	_tmp1_ = self->priv->react_btn_list;
	if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp1_, _data149_->shortcode)) {
		GeeHashMap* _tmp2_;
		gpointer _tmp3_;
		TubaWidgetsReactButton* _tmp4_;
		_tmp2_ = self->priv->react_btn_list;
		_tmp3_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp2_, _data149_->shortcode);
		_tmp4_ = (TubaWidgetsReactButton*) _tmp3_;
		tuba_widgets_reactions_row_on_reaction_toggled (self, _tmp4_);
		_g_object_unref0 (_tmp4_);
	} else {
		TubaRequest* _tmp5_;
		TubaRequest* _tmp6_;
		TubaAccountStore* _tmp7_;
		TubaInstanceAccount* _tmp8_;
		TubaInstanceAccount* _tmp9_;
		TubaRequest* _tmp10_;
		TubaRequest* _tmp11_;
		TubaRequest* _tmp12_;
		TubaRequest* _tmp13_;
		TubaRequest* _tmp14_;
		TubaRequest* _tmp15_;
		TubaRequest* _tmp16_;
		TubaRequest* _tmp17_;
		_tmp5_ = tuba_widgets_reactions_row_reaction_request (self, _data149_->shortcode, FALSE);
		_tmp6_ = _tmp5_;
		_tmp7_ = tuba_accounts;
		_tmp8_ = tuba_account_store_get_active (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp10_ = tuba_request_with_account (_tmp6_, _tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = tuba_request_then (_tmp11_, ____lambda110__tuba_network_success_callback, g_object_ref (self), g_object_unref);
		_tmp13_ = _tmp12_;
		_tmp14_ = tuba_request_on_error (_tmp13_, ____lambda111__tuba_network_error_callback, block149_data_ref (_data149_), block149_data_unref);
		_tmp15_ = _tmp14_;
		_tmp16_ = tuba_request_exec (_tmp15_);
		_tmp17_ = _tmp16_;
		_g_object_unref0 (_tmp17_);
		_g_object_unref0 (_tmp15_);
		_g_object_unref0 (_tmp13_);
		_g_object_unref0 (_tmp11_);
		_g_object_unref0 (_tmp6_);
	}
	block149_data_unref (_data149_);
	_data149_ = NULL;
}

static TubaRequest*
tuba_widgets_reactions_row_reaction_request (TubaWidgetsReactionsRow* self,
                                             const gchar* shortcode,
                                             gboolean has_reacted)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	TubaRequest* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (shortcode != NULL, NULL);
	_tmp0_ = tuba_widgets_reactions_row_get_is_announcement (self);
	_tmp1_ = _tmp0_;
	if (_tmp1_) {
		gchar* endpoint = NULL;
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		gchar* _tmp4_;
		gchar* _tmp5_;
		const gchar* _tmp6_;
		gchar* _tmp7_;
		gchar* _tmp8_;
		TubaRequest* _tmp9_ = NULL;
		_tmp2_ = self->priv->status_id;
		_tmp3_ = string_to_string (_tmp2_);
		_tmp4_ = g_uri_escape_string (shortcode, NULL, TRUE);
		_tmp5_ = _tmp4_;
		_tmp6_ = string_to_string (_tmp5_);
		_tmp7_ = g_strconcat ("/api/v1/announcements/", _tmp3_, "/reactions/", _tmp6_, NULL);
		_tmp8_ = _tmp7_;
		_g_free0 (_tmp5_);
		endpoint = _tmp8_;
		if (has_reacted) {
			const gchar* _tmp10_;
			TubaRequest* _tmp11_;
			_tmp10_ = endpoint;
			_tmp11_ = tuba_request_new_DELETE (_tmp10_);
			_g_object_unref0 (_tmp9_);
			_tmp9_ = _tmp11_;
		} else {
			const gchar* _tmp12_;
			TubaRequest* _tmp13_;
			_tmp12_ = endpoint;
			_tmp13_ = tuba_request_new_PUT (_tmp12_);
			_g_object_unref0 (_tmp9_);
			_tmp9_ = _tmp13_;
		}
		result = _tmp9_;
		_g_free0 (endpoint);
		return result;
	} else {
		TubaAccountStore* _tmp14_;
		TubaInstanceAccount* _tmp15_;
		TubaInstanceAccount* _tmp16_;
		TubaAPIInstance* _tmp17_;
		TubaAPIInstance* _tmp18_;
		TubaAPIPleromaInstance* _tmp19_;
		TubaAPIPleromaInstance* _tmp20_;
		_tmp14_ = tuba_accounts;
		_tmp15_ = tuba_account_store_get_active (_tmp14_);
		_tmp16_ = _tmp15_;
		_tmp17_ = tuba_instance_account_get_instance_info (_tmp16_);
		_tmp18_ = _tmp17_;
		_tmp19_ = tuba_api_instance_get_pleroma (_tmp18_);
		_tmp20_ = _tmp19_;
		if (_tmp20_ != NULL) {
			gchar* endpoint = NULL;
			const gchar* _tmp21_;
			const gchar* _tmp22_;
			gchar* _tmp23_;
			gchar* _tmp24_;
			const gchar* _tmp25_;
			gchar* _tmp26_;
			gchar* _tmp27_;
			TubaRequest* _tmp28_ = NULL;
			_tmp21_ = self->priv->status_id;
			_tmp22_ = string_to_string (_tmp21_);
			_tmp23_ = g_uri_escape_string (shortcode, NULL, TRUE);
			_tmp24_ = _tmp23_;
			_tmp25_ = string_to_string (_tmp24_);
			_tmp26_ = g_strconcat ("/api/v1/pleroma/statuses/", _tmp22_, "/reactions/", _tmp25_, NULL);
			_tmp27_ = _tmp26_;
			_g_free0 (_tmp24_);
			endpoint = _tmp27_;
			if (has_reacted) {
				const gchar* _tmp29_;
				TubaRequest* _tmp30_;
				_tmp29_ = endpoint;
				_tmp30_ = tuba_request_new_DELETE (_tmp29_);
				_g_object_unref0 (_tmp28_);
				_tmp28_ = _tmp30_;
			} else {
				const gchar* _tmp31_;
				TubaRequest* _tmp32_;
				_tmp31_ = endpoint;
				_tmp32_ = tuba_request_new_PUT (_tmp31_);
				_g_object_unref0 (_tmp28_);
				_tmp28_ = _tmp32_;
			}
			result = _tmp28_;
			_g_free0 (endpoint);
			return result;
		} else {
			gchar* action = NULL;
			gchar* _tmp33_;
			gchar* endpoint = NULL;
			const gchar* _tmp35_;
			const gchar* _tmp36_;
			const gchar* _tmp37_;
			const gchar* _tmp38_;
			gchar* _tmp39_;
			gchar* _tmp40_;
			const gchar* _tmp41_;
			gchar* _tmp42_;
			gchar* _tmp43_;
			const gchar* _tmp44_;
			TubaRequest* _tmp45_;
			_tmp33_ = g_strdup ("react");
			action = _tmp33_;
			if (has_reacted) {
				gchar* _tmp34_;
				_tmp34_ = g_strdup ("unreact");
				_g_free0 (action);
				action = _tmp34_;
			}
			_tmp35_ = self->priv->status_id;
			_tmp36_ = string_to_string (_tmp35_);
			_tmp37_ = action;
			_tmp38_ = string_to_string (_tmp37_);
			_tmp39_ = g_uri_escape_string (shortcode, NULL, TRUE);
			_tmp40_ = _tmp39_;
			_tmp41_ = string_to_string (_tmp40_);
			_tmp42_ = g_strconcat ("/api/v1/statuses/", _tmp36_, "/", _tmp38_, "/", _tmp41_, NULL);
			_tmp43_ = _tmp42_;
			_g_free0 (_tmp40_);
			endpoint = _tmp43_;
			_tmp44_ = endpoint;
			_tmp45_ = tuba_request_new_POST (_tmp44_);
			result = _tmp45_;
			_g_free0 (endpoint);
			_g_free0 (action);
			return result;
		}
	}
}

static void
tuba_widgets_reactions_row_on_remove (TubaWidgetsReactionsRow* self,
                                      TubaWidgetsReactButton* btn)
{
	AdwWrapBox* _tmp0_;
	GeeHashMap* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (btn != NULL);
	_tmp0_ = self->priv->reaction_box;
	adw_wrap_box_remove (_tmp0_, (GtkWidget*) btn);
	_tmp1_ = self->priv->react_btn_list;
	_tmp2_ = tuba_widgets_react_button_get_shortcode (btn);
	_tmp3_ = _tmp2_;
	gee_abstract_map_unset ((GeeAbstractMap*) _tmp1_, _tmp3_, NULL);
}

static void
tuba_widgets_reactions_row_on_remove_and_update_state (TubaWidgetsReactionsRow* self,
                                                       TubaWidgetsReactButton* btn)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (btn != NULL);
	tuba_widgets_reactions_row_on_remove (self, btn);
	tuba_widgets_reactions_row_update_reaction_add_state (self);
}

static void
tuba_widgets_reactions_row_on_emoji_picked (TubaWidgetsReactionsRow* self,
                                            const gchar* emoji)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (emoji != NULL);
	tuba_widgets_reactions_row_react_with_shortcode (self, emoji);
}

static gchar*
string_slice (const gchar* self,
              glong start,
              glong end)
{
	glong string_length = 0L;
	gint _tmp0_;
	gint _tmp1_;
	gboolean _tmp2_ = FALSE;
	gboolean _tmp3_ = FALSE;
	gchar* _tmp4_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	string_length = (glong) _tmp1_;
	if (start < ((glong) 0)) {
		start = string_length + start;
	}
	if (end < ((glong) 0)) {
		end = string_length + end;
	}
	if (start >= ((glong) 0)) {
		_tmp2_ = start <= string_length;
	} else {
		_tmp2_ = FALSE;
	}
	g_return_val_if_fail (_tmp2_, NULL);
	if (end >= ((glong) 0)) {
		_tmp3_ = end <= string_length;
	} else {
		_tmp3_ = FALSE;
	}
	g_return_val_if_fail (_tmp3_, NULL);
	g_return_val_if_fail (start <= end, NULL);
	_tmp4_ = g_strndup (((gchar*) self) + start, (gsize) (end - start));
	result = _tmp4_;
	return result;
}

static void
tuba_widgets_reactions_row_on_custom_emoji_picked (TubaWidgetsReactionsRow* self,
                                                   const gchar* emoji_shortcode)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (emoji_shortcode != NULL);
	_tmp0_ = string_slice (emoji_shortcode, (glong) 1, (glong) -2);
	_tmp1_ = _tmp0_;
	tuba_widgets_reactions_row_react_with_shortcode (self, _tmp1_);
	_g_free0 (_tmp1_);
}

static void
_tuba_widgets_reactions_row_on_reaction_toggled_tuba_widgets_react_button_reaction_toggled (TubaWidgetsReactButton* _sender,
                                                                                            gpointer self)
{
	tuba_widgets_reactions_row_on_reaction_toggled ((TubaWidgetsReactionsRow*) self, _sender);
}

static void
_tuba_widgets_reactions_row_on_remove_and_update_state_tuba_widgets_react_button_removed (TubaWidgetsReactButton* _sender,
                                                                                          gpointer self)
{
	tuba_widgets_reactions_row_on_remove_and_update_state ((TubaWidgetsReactionsRow*) self, _sender);
}

static void
tuba_widgets_reactions_row_add_emoji (TubaWidgetsReactionsRow* self,
                                      TubaAPIEmojiReaction* reaction)
{
	gint64 _tmp0_;
	gint64 _tmp1_;
	TubaWidgetsReactButton* badge_button = NULL;
	TubaWidgetsReactButton* _tmp2_;
	TubaWidgetsReactButton* _tmp3_;
	TubaWidgetsReactButton* _tmp4_;
	GtkWidget* last_reaction = NULL;
	AdwWrapBox* _tmp5_;
	GtkWidget* _tmp6_;
	GtkWidget* _tmp7_;
	GtkWidget* _tmp8_;
	GtkWidget* _tmp18_;
	GeeHashMap* _tmp24_;
	const gchar* _tmp25_;
	const gchar* _tmp26_;
	TubaWidgetsReactButton* _tmp27_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (reaction != NULL);
	_tmp0_ = tuba_api_emoji_reaction_get_count (reaction);
	_tmp1_ = _tmp0_;
	if (_tmp1_ == ((gint64) 0)) {
		return;
	}
	_tmp2_ = tuba_widgets_react_button_new (reaction);
	g_object_ref_sink (_tmp2_);
	badge_button = _tmp2_;
	_tmp3_ = badge_button;
	g_signal_connect_object (_tmp3_, "reaction-toggled", (GCallback) _tuba_widgets_reactions_row_on_reaction_toggled_tuba_widgets_react_button_reaction_toggled, self, 0);
	_tmp4_ = badge_button;
	g_signal_connect_object (_tmp4_, "removed", (GCallback) _tuba_widgets_reactions_row_on_remove_and_update_state_tuba_widgets_react_button_removed, self, 0);
	_tmp5_ = self->priv->reaction_box;
	_tmp6_ = gtk_widget_get_last_child ((GtkWidget*) _tmp5_);
	_tmp7_ = _g_object_ref0 (_tmp6_);
	last_reaction = _tmp7_;
	_tmp8_ = last_reaction;
	if (_tmp8_ != NULL) {
		GtkWidget* _tmp9_;
		GtkWidget* _tmp10_;
		GtkWidget* _tmp11_;
		gboolean _tmp12_ = FALSE;
		GtkWidget* _tmp13_;
		_tmp9_ = last_reaction;
		_tmp10_ = gtk_widget_get_prev_sibling (_tmp9_);
		_tmp11_ = _g_object_ref0 (_tmp10_);
		_g_object_unref0 (last_reaction);
		last_reaction = _tmp11_;
		_tmp13_ = last_reaction;
		if (_tmp13_ != NULL) {
			GtkMenuButton* _tmp14_;
			_tmp14_ = self->priv->custom_emoji_button;
			_tmp12_ = _tmp14_ != NULL;
		} else {
			_tmp12_ = FALSE;
		}
		if (_tmp12_) {
			GtkWidget* _tmp15_;
			GtkWidget* _tmp16_;
			GtkWidget* _tmp17_;
			_tmp15_ = last_reaction;
			_tmp16_ = gtk_widget_get_prev_sibling (_tmp15_);
			_tmp17_ = _g_object_ref0 (_tmp16_);
			_g_object_unref0 (last_reaction);
			last_reaction = _tmp17_;
		}
	}
	_tmp18_ = last_reaction;
	if (_tmp18_ == NULL) {
		AdwWrapBox* _tmp19_;
		TubaWidgetsReactButton* _tmp20_;
		_tmp19_ = self->priv->reaction_box;
		_tmp20_ = badge_button;
		adw_wrap_box_prepend (_tmp19_, (GtkWidget*) _tmp20_);
	} else {
		AdwWrapBox* _tmp21_;
		TubaWidgetsReactButton* _tmp22_;
		GtkWidget* _tmp23_;
		_tmp21_ = self->priv->reaction_box;
		_tmp22_ = badge_button;
		_tmp23_ = last_reaction;
		adw_wrap_box_insert_child_after (_tmp21_, (GtkWidget*) _tmp22_, _tmp23_);
	}
	_tmp24_ = self->priv->react_btn_list;
	_tmp25_ = tuba_api_emoji_reaction_get_name (reaction);
	_tmp26_ = _tmp25_;
	_tmp27_ = badge_button;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp24_, _tmp26_, _tmp27_);
	_g_object_unref0 (last_reaction);
	_g_object_unref0 (badge_button);
}

gboolean
tuba_widgets_reactions_row_get_is_announcement (TubaWidgetsReactionsRow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_is_announcement;
	return result;
}

void
tuba_widgets_reactions_row_set_is_announcement (TubaWidgetsReactionsRow* self,
                                                gboolean value)
{
	GtkMenuButton* _tmp0_;
	GtkMenuButton* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->emoji_button;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, !value);
	_tmp1_ = self->priv->custom_emoji_button;
	if (_tmp1_ != NULL) {
		GtkMenuButton* _tmp2_;
		_tmp2_ = self->priv->custom_emoji_button;
		gtk_widget_set_visible ((GtkWidget*) _tmp2_, !value);
	}
	self->priv->_is_announcement = value;
	g_object_notify_by_pspec ((GObject *) self, tuba_widgets_reactions_row_properties[TUBA_WIDGETS_REACTIONS_ROW_IS_ANNOUNCEMENT_PROPERTY]);
}

static Block150Data*
block150_data_ref (Block150Data* _data150_)
{
	g_atomic_int_inc (&_data150_->_ref_count_);
	return _data150_;
}

static void
block150_data_unref (void * _userdata_)
{
	Block150Data* _data150_;
	_data150_ = (Block150Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data150_->_ref_count_)) {
		TubaWidgetsReactionsRow* self;
		self = _data150_->self;
		_g_object_unref0 (self);
		g_slice_free (Block150Data, _data150_);
	}
}

static gboolean
_tuba_widgets_reactions_row_can_add_reaction___lambda105_ (Block150Data* _data150_,
                                                           GeeMapEntry* e)
{
	TubaWidgetsReactionsRow* self;
	gconstpointer _tmp0_;
	gconstpointer _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	gboolean result;
	self = _data150_->self;
	g_return_val_if_fail (e != NULL, FALSE);
	_tmp0_ = gee_map_entry_get_value (e);
	_tmp1_ = _tmp0_;
	_tmp2_ = tuba_widgets_react_button_get_has_reacted (G_TYPE_CHECK_INSTANCE_CAST ((TubaWidgetsReactButton*) _tmp1_, TUBA_WIDGETS_TYPE_REACT_BUTTON, TubaWidgetsReactButton));
	_tmp3_ = _tmp2_;
	if (!_tmp3_) {
		gconstpointer _tmp4_;
		gconstpointer _tmp5_;
		_tmp4_ = gee_map_entry_get_value (e);
		_tmp5_ = _tmp4_;
		gtk_widget_set_sensitive ((GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST ((TubaWidgetsReactButton*) _tmp5_, TUBA_WIDGETS_TYPE_REACT_BUTTON, TubaWidgetsReactButton), _data150_->value);
	}
	result = TRUE;
	_g_object_unref0 (e);
	return result;
}

static gboolean
__tuba_widgets_reactions_row_can_add_reaction___lambda105__gee_forall_func (gpointer g,
                                                                            gpointer self)
{
	gboolean result;
	result = _tuba_widgets_reactions_row_can_add_reaction___lambda105_ (self, (GeeMapEntry*) g);
	return result;
}

static void
tuba_widgets_reactions_row_set_can_add_reaction (TubaWidgetsReactionsRow* self,
                                                 gboolean value)
{
	Block150Data* _data150_;
	GtkMenuButton* _tmp0_;
	GtkMenuButton* _tmp1_;
	GeeHashMap* _tmp3_;
	g_return_if_fail (self != NULL);
	_data150_ = g_slice_new0 (Block150Data);
	_data150_->_ref_count_ = 1;
	_data150_->self = g_object_ref (self);
	_data150_->value = value;
	_tmp0_ = self->priv->emoji_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp0_, _data150_->value);
	_tmp1_ = self->priv->custom_emoji_button;
	if (_tmp1_ != NULL) {
		GtkMenuButton* _tmp2_;
		_tmp2_ = self->priv->custom_emoji_button;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp2_, _data150_->value);
	}
	_tmp3_ = self->priv->react_btn_list;
	gee_abstract_map_foreach ((GeeAbstractMap*) _tmp3_, __tuba_widgets_reactions_row_can_add_reaction___lambda105__gee_forall_func, _data150_);
	block150_data_unref (_data150_);
	_data150_ = NULL;
}

static gboolean
_tuba_widgets_reactions_row_reactions___lambda109_ (TubaWidgetsReactionsRow* self,
                                                    GeeMapEntry* e)
{
	AdwWrapBox* _tmp0_;
	gconstpointer _tmp1_;
	gconstpointer _tmp2_;
	gboolean result;
	g_return_val_if_fail (e != NULL, FALSE);
	_tmp0_ = self->priv->reaction_box;
	_tmp1_ = gee_map_entry_get_value (e);
	_tmp2_ = _tmp1_;
	adw_wrap_box_remove (_tmp0_, (GtkWidget*) G_TYPE_CHECK_INSTANCE_CAST ((TubaWidgetsReactButton*) _tmp2_, TUBA_WIDGETS_TYPE_REACT_BUTTON, TubaWidgetsReactButton));
	result = TRUE;
	_g_object_unref0 (e);
	return result;
}

static gboolean
__tuba_widgets_reactions_row_reactions___lambda109__gee_forall_func (gpointer g,
                                                                     gpointer self)
{
	gboolean result;
	result = _tuba_widgets_reactions_row_reactions___lambda109_ ((TubaWidgetsReactionsRow*) self, (GeeMapEntry*) g);
	return result;
}

static void
tuba_widgets_reactions_row_set_reactions (TubaWidgetsReactionsRow* self,
                                          GeeArrayList* value)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	g_return_if_fail (self != NULL);
	if (value == NULL) {
		return;
	}
	_tmp0_ = self->priv->react_btn_list;
	gee_abstract_map_foreach ((GeeAbstractMap*) _tmp0_, __tuba_widgets_reactions_row_reactions___lambda109__gee_forall_func, self);
	_tmp1_ = self->priv->react_btn_list;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp1_);
	{
		gint j = 0;
		gint _tmp2_;
		gint _tmp3_;
		_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) value);
		_tmp3_ = _tmp2_;
		j = _tmp3_ - 1;
		{
			gboolean _tmp4_ = FALSE;
			_tmp4_ = TRUE;
			while (TRUE) {
				TubaAPIEmojiReaction* p = NULL;
				gpointer _tmp6_;
				TubaAPIEmojiReaction* _tmp7_;
				gint64 _tmp8_;
				gint64 _tmp9_;
				TubaWidgetsReactButton* badge_button = NULL;
				TubaAPIEmojiReaction* _tmp10_;
				TubaWidgetsReactButton* _tmp11_;
				TubaWidgetsReactButton* _tmp12_;
				TubaWidgetsReactButton* _tmp13_;
				AdwWrapBox* _tmp14_;
				TubaWidgetsReactButton* _tmp15_;
				GeeHashMap* _tmp16_;
				TubaAPIEmojiReaction* _tmp17_;
				const gchar* _tmp18_;
				const gchar* _tmp19_;
				TubaWidgetsReactButton* _tmp20_;
				if (!_tmp4_) {
					gint _tmp5_;
					_tmp5_ = j;
					j = _tmp5_ - 1;
				}
				_tmp4_ = FALSE;
				if (!(j >= 0)) {
					break;
				}
				_tmp6_ = gee_abstract_list_get ((GeeAbstractList*) value, j);
				p = (TubaAPIEmojiReaction*) _tmp6_;
				_tmp7_ = p;
				_tmp8_ = tuba_api_emoji_reaction_get_count (_tmp7_);
				_tmp9_ = _tmp8_;
				if (_tmp9_ <= ((gint64) 0)) {
					_g_object_unref0 (p);
					return;
				}
				_tmp10_ = p;
				_tmp11_ = tuba_widgets_react_button_new (_tmp10_);
				g_object_ref_sink (_tmp11_);
				badge_button = _tmp11_;
				_tmp12_ = badge_button;
				g_signal_connect_object (_tmp12_, "reaction-toggled", (GCallback) _tuba_widgets_reactions_row_on_reaction_toggled_tuba_widgets_react_button_reaction_toggled, self, 0);
				_tmp13_ = badge_button;
				g_signal_connect_object (_tmp13_, "removed", (GCallback) _tuba_widgets_reactions_row_on_remove_and_update_state_tuba_widgets_react_button_removed, self, 0);
				_tmp14_ = self->priv->reaction_box;
				_tmp15_ = badge_button;
				adw_wrap_box_prepend (_tmp14_, (GtkWidget*) _tmp15_);
				_tmp16_ = self->priv->react_btn_list;
				_tmp17_ = p;
				_tmp18_ = tuba_api_emoji_reaction_get_name (_tmp17_);
				_tmp19_ = _tmp18_;
				_tmp20_ = badge_button;
				gee_abstract_map_set ((GeeAbstractMap*) _tmp16_, _tmp19_, _tmp20_);
				_g_object_unref0 (badge_button);
				_g_object_unref0 (p);
			}
		}
	}
	tuba_widgets_reactions_row_update_reaction_add_state (self);
}

static void
_tuba_widgets_reactions_row_on_emoji_picked_gtk_emoji_chooser_emoji_picked (GtkEmojiChooser* _sender,
                                                                            const gchar* text,
                                                                            gpointer self)
{
	tuba_widgets_reactions_row_on_emoji_picked ((TubaWidgetsReactionsRow*) self, text);
}

static void
_tuba_widgets_reactions_row_on_custom_emoji_picked_tuba_widgets_custom_emoji_chooser_emoji_picked (TubaWidgetsCustomEmojiChooser* _sender,
                                                                                                   const gchar* shortcode,
                                                                                                   gpointer self)
{
	tuba_widgets_reactions_row_on_custom_emoji_picked ((TubaWidgetsReactionsRow*) self, shortcode);
}

static GObject *
tuba_widgets_reactions_row_constructor (GType type,
                                        guint n_construct_properties,
                                        GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaWidgetsReactionsRow * self;
	GeeHashMap* _tmp0_;
	AdwWrapBox* _tmp1_ = NULL;
	AdwWrapBox* _tmp2_;
	GtkEmojiChooser* emoji_picker = NULL;
	GtkEmojiChooser* _tmp3_;
	gchar* _tmp4_;
	GtkEmojiChooser* _tmp5_;
	GtkPopover* _tmp6_;
	gchar* _tmp7_;
	GtkMenuButton* _tmp8_ = NULL;
	AdwWrapBox* _tmp9_;
	GtkMenuButton* _tmp10_;
	GtkEmojiChooser* _tmp11_;
	gboolean _tmp12_ = FALSE;
	TubaAccountStore* _tmp13_;
	TubaInstanceAccount* _tmp14_;
	TubaInstanceAccount* _tmp15_;
	GeeArrayList* _tmp16_;
	GeeArrayList* _tmp17_;
	parent_class = G_OBJECT_CLASS (tuba_widgets_reactions_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_TYPE_REACTIONS_ROW, TubaWidgetsReactionsRow);
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, TUBA_WIDGETS_TYPE_REACT_BUTTON, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->react_btn_list);
	self->priv->react_btn_list = _tmp0_;
	_tmp1_ = (AdwWrapBox*) adw_wrap_box_new ();
	adw_wrap_box_set_child_spacing (_tmp1_, 6);
	adw_wrap_box_set_line_spacing (_tmp1_, 6);
	adw_wrap_box_set_justify (_tmp1_, ADW_JUSTIFY_NONE);
	adw_wrap_box_set_align (_tmp1_, 0.0f);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->reaction_box);
	self->priv->reaction_box = _tmp1_;
	_tmp2_ = self->priv->reaction_box;
	adw_bin_set_child ((AdwBin*) self, (GtkWidget*) _tmp2_);
	_tmp3_ = (GtkEmojiChooser*) gtk_emoji_chooser_new ();
	g_object_ref_sink (_tmp3_);
	emoji_picker = _tmp3_;
	_tmp4_ = g_strdup ("tuba-smile-symbolic");
	_tmp5_ = emoji_picker;
	_tmp6_ = _g_object_ref0 ((GtkPopover*) _tmp5_);
	_tmp7_ = g_strdup (_ ("Emoji Picker"));
	_tmp8_ = (GtkMenuButton*) gtk_menu_button_new ();
	gtk_menu_button_set_icon_name (_tmp8_, _tmp4_);
	_g_free0 (_tmp4_);
	gtk_menu_button_set_popover (_tmp8_, _tmp6_);
	_g_object_unref0 (_tmp6_);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp8_, _tmp7_);
	_g_free0 (_tmp7_);
	g_object_ref_sink (_tmp8_);
	_g_object_unref0 (self->priv->emoji_button);
	self->priv->emoji_button = _tmp8_;
	_tmp9_ = self->priv->reaction_box;
	_tmp10_ = self->priv->emoji_button;
	adw_wrap_box_append (_tmp9_, (GtkWidget*) _tmp10_);
	_tmp11_ = emoji_picker;
	g_signal_connect_object (_tmp11_, "emoji-picked", (GCallback) _tuba_widgets_reactions_row_on_emoji_picked_gtk_emoji_chooser_emoji_picked, self, 0);
	_tmp13_ = tuba_accounts;
	_tmp14_ = tuba_account_store_get_active (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = tuba_instance_account_get_instance_emojis (_tmp15_);
	_tmp17_ = _tmp16_;
	if (_tmp17_ != NULL) {
		TubaAccountStore* _tmp18_;
		TubaInstanceAccount* _tmp19_;
		TubaInstanceAccount* _tmp20_;
		GeeArrayList* _tmp21_;
		GeeArrayList* _tmp22_;
		gint _tmp23_;
		gint _tmp24_;
		_tmp18_ = tuba_accounts;
		_tmp19_ = tuba_account_store_get_active (_tmp18_);
		_tmp20_ = _tmp19_;
		_tmp21_ = tuba_instance_account_get_instance_emojis (_tmp20_);
		_tmp22_ = _tmp21_;
		_tmp23_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp22_);
		_tmp24_ = _tmp23_;
		_tmp12_ = _tmp24_ > 0;
	} else {
		_tmp12_ = FALSE;
	}
	if (_tmp12_) {
		TubaWidgetsCustomEmojiChooser* custom_emoji_picker = NULL;
		TubaWidgetsCustomEmojiChooser* _tmp25_;
		gchar* _tmp26_;
		TubaWidgetsCustomEmojiChooser* _tmp27_;
		GtkPopover* _tmp28_;
		gchar* _tmp29_;
		GtkMenuButton* _tmp30_ = NULL;
		AdwWrapBox* _tmp31_;
		GtkMenuButton* _tmp32_;
		TubaWidgetsCustomEmojiChooser* _tmp33_;
		_tmp25_ = tuba_widgets_custom_emoji_chooser_new ();
		g_object_ref_sink (_tmp25_);
		custom_emoji_picker = _tmp25_;
		_tmp26_ = g_strdup ("tuba-cat-symbolic");
		_tmp27_ = custom_emoji_picker;
		_tmp28_ = _g_object_ref0 ((GtkPopover*) _tmp27_);
		_tmp29_ = g_strdup (_ ("Custom Emoji Picker"));
		_tmp30_ = (GtkMenuButton*) gtk_menu_button_new ();
		gtk_menu_button_set_icon_name (_tmp30_, _tmp26_);
		_g_free0 (_tmp26_);
		gtk_menu_button_set_popover (_tmp30_, _tmp28_);
		_g_object_unref0 (_tmp28_);
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp30_, _tmp29_);
		_g_free0 (_tmp29_);
		g_object_ref_sink (_tmp30_);
		_g_object_unref0 (self->priv->custom_emoji_button);
		self->priv->custom_emoji_button = _tmp30_;
		_tmp31_ = self->priv->reaction_box;
		_tmp32_ = self->priv->custom_emoji_button;
		adw_wrap_box_append (_tmp31_, (GtkWidget*) _tmp32_);
		_tmp33_ = custom_emoji_picker;
		g_signal_connect_object (_tmp33_, "emoji-picked", (GCallback) _tuba_widgets_reactions_row_on_custom_emoji_picked_tuba_widgets_custom_emoji_chooser_emoji_picked, self, 0);
		_g_object_unref0 (custom_emoji_picker);
	}
	_g_object_unref0 (emoji_picker);
	return obj;
}

static void
tuba_widgets_reactions_row_class_init (TubaWidgetsReactionsRowClass * klass,
                                       gpointer klass_data)
{
	tuba_widgets_reactions_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaWidgetsReactionsRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_widgets_reactions_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_widgets_reactions_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = tuba_widgets_reactions_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_widgets_reactions_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_WIDGETS_REACTIONS_ROW_IS_ANNOUNCEMENT_PROPERTY, tuba_widgets_reactions_row_properties[TUBA_WIDGETS_REACTIONS_ROW_IS_ANNOUNCEMENT_PROPERTY] = g_param_spec_boolean ("is-announcement", "is-announcement", "is-announcement", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
tuba_widgets_reactions_row_instance_init (TubaWidgetsReactionsRow * self,
                                          gpointer klass)
{
	self->priv = tuba_widgets_reactions_row_get_instance_private (self);
	self->priv->_is_announcement = FALSE;
}

static void
tuba_widgets_reactions_row_finalize (GObject * obj)
{
	TubaWidgetsReactionsRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_WIDGETS_TYPE_REACTIONS_ROW, TubaWidgetsReactionsRow);
	_g_object_unref0 (self->priv->reaction_box);
	_g_object_unref0 (self->priv->react_btn_list);
	_g_object_unref0 (self->priv->emoji_button);
	_g_object_unref0 (self->priv->custom_emoji_button);
	_g_free0 (self->priv->status_id);
	G_OBJECT_CLASS (tuba_widgets_reactions_row_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_widgets_reactions_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaWidgetsReactionsRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_widgets_reactions_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaWidgetsReactionsRow), 0, (GInstanceInitFunc) tuba_widgets_reactions_row_instance_init, NULL };
	GType tuba_widgets_reactions_row_type_id;
	tuba_widgets_reactions_row_type_id = g_type_register_static (adw_bin_get_type (), "TubaWidgetsReactionsRow", &g_define_type_info, 0);
	TubaWidgetsReactionsRow_private_offset = g_type_add_instance_private (tuba_widgets_reactions_row_type_id, sizeof (TubaWidgetsReactionsRowPrivate));
	return tuba_widgets_reactions_row_type_id;
}

GType
tuba_widgets_reactions_row_get_type (void)
{
	static gsize tuba_widgets_reactions_row_type_id__once = 0;
	if (g_once_init_enter (&tuba_widgets_reactions_row_type_id__once)) {
		GType tuba_widgets_reactions_row_type_id;
		tuba_widgets_reactions_row_type_id = tuba_widgets_reactions_row_get_type_once ();
		g_once_init_leave (&tuba_widgets_reactions_row_type_id__once, tuba_widgets_reactions_row_type_id);
	}
	return tuba_widgets_reactions_row_type_id__once;
}

static void
_vala_tuba_widgets_reactions_row_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	TubaWidgetsReactionsRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_TYPE_REACTIONS_ROW, TubaWidgetsReactionsRow);
	switch (property_id) {
		case TUBA_WIDGETS_REACTIONS_ROW_IS_ANNOUNCEMENT_PROPERTY:
		g_value_set_boolean (value, tuba_widgets_reactions_row_get_is_announcement (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_widgets_reactions_row_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec)
{
	TubaWidgetsReactionsRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_WIDGETS_TYPE_REACTIONS_ROW, TubaWidgetsReactionsRow);
	switch (property_id) {
		case TUBA_WIDGETS_REACTIONS_ROW_IS_ANNOUNCEMENT_PROPERTY:
		tuba_widgets_reactions_row_set_is_announcement (self, g_value_get_boolean (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);
}

