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

#include <adwaita.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <gee.h>
#include <gio/gio.h>
#include <json-glib/json-glib.h>
#include <libsoup/soup.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_DIALOGS_TYPE_FILTER_EDIT (tuba_dialogs_filter_edit_get_type ())
#define TUBA_DIALOGS_FILTER_EDIT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_TYPE_FILTER_EDIT, TubaDialogsFilterEdit))
#define TUBA_DIALOGS_FILTER_EDIT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_TYPE_FILTER_EDIT, TubaDialogsFilterEditClass))
#define TUBA_DIALOGS_IS_FILTER_EDIT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_TYPE_FILTER_EDIT))
#define TUBA_DIALOGS_IS_FILTER_EDIT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_TYPE_FILTER_EDIT))
#define TUBA_DIALOGS_FILTER_EDIT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_TYPE_FILTER_EDIT, TubaDialogsFilterEditClass))

typedef struct _TubaDialogsFilterEdit TubaDialogsFilterEdit;
typedef struct _TubaDialogsFilterEditClass TubaDialogsFilterEditClass;
typedef struct _TubaDialogsFilterEditPrivate TubaDialogsFilterEditPrivate;

#define TUBA_DIALOGS_FILTER_EDIT_TYPE_CONTEXT_ROW (tuba_dialogs_filter_edit_context_row_get_type ())
typedef struct _TubaDialogsFilterEditContextRow TubaDialogsFilterEditContextRow;
typedef enum  {
	TUBA_API_FILTERS_FILTER_CONTEXT_TYPE_HOME,
	TUBA_API_FILTERS_FILTER_CONTEXT_TYPE_NOTIFICATIONS,
	TUBA_API_FILTERS_FILTER_CONTEXT_TYPE_PUBLIC,
	TUBA_API_FILTERS_FILTER_CONTEXT_TYPE_THREAD,
	TUBA_API_FILTERS_FILTER_CONTEXT_TYPE_ACCOUNT
} TubaAPIFiltersFilterContextType;

#define TUBA_API_FILTERS_FILTER_TYPE_CONTEXT_TYPE (tuba_api_filters_filter_context_type_get_type ())

#define TUBA_DIALOGS_FILTER_EDIT_TYPE_KEYWORD_ROW (tuba_dialogs_filter_edit_keyword_row_get_type ())
#define TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_FILTER_EDIT_TYPE_KEYWORD_ROW, TubaDialogsFilterEditKeywordRow))
#define TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_FILTER_EDIT_TYPE_KEYWORD_ROW, TubaDialogsFilterEditKeywordRowClass))
#define TUBA_DIALOGS_FILTER_EDIT_IS_KEYWORD_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_FILTER_EDIT_TYPE_KEYWORD_ROW))
#define TUBA_DIALOGS_FILTER_EDIT_IS_KEYWORD_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_FILTER_EDIT_TYPE_KEYWORD_ROW))
#define TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_FILTER_EDIT_TYPE_KEYWORD_ROW, TubaDialogsFilterEditKeywordRowClass))

typedef struct _TubaDialogsFilterEditKeywordRow TubaDialogsFilterEditKeywordRow;
typedef struct _TubaDialogsFilterEditKeywordRowClass TubaDialogsFilterEditKeywordRowClass;
enum  {
	TUBA_DIALOGS_FILTER_EDIT_0_PROPERTY,
	TUBA_DIALOGS_FILTER_EDIT_NUM_PROPERTIES
};
static GParamSpec* tuba_dialogs_filter_edit_properties[TUBA_DIALOGS_FILTER_EDIT_NUM_PROPERTIES];
typedef enum  {
	TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_NEVER,
	TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_MINUTES_30,
	TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_HOUR_1,
	TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_HOUR_6,
	TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_HOUR_12,
	TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_DAY_1,
	TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_WEEK_1
} TubaDialogsFilterEditFilterExpiration;

#define TUBA_DIALOGS_FILTER_EDIT_TYPE_FILTER_EXPIRATION (tuba_dialogs_filter_edit_filter_expiration_get_type ())
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#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_FILTERS_TYPE_FILTER (tuba_api_filters_filter_get_type ())
#define TUBA_API_FILTERS_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_FILTERS_TYPE_FILTER, TubaAPIFiltersFilter))
#define TUBA_API_FILTERS_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_FILTERS_TYPE_FILTER, TubaAPIFiltersFilterClass))
#define TUBA_API_FILTERS_IS_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_FILTERS_TYPE_FILTER))
#define TUBA_API_FILTERS_IS_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_FILTERS_TYPE_FILTER))
#define TUBA_API_FILTERS_FILTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_FILTERS_TYPE_FILTER, TubaAPIFiltersFilterClass))

typedef struct _TubaAPIFiltersFilter TubaAPIFiltersFilter;
typedef struct _TubaAPIFiltersFilterClass TubaAPIFiltersFilterClass;
typedef enum  {
	TUBA_API_FILTERS_FILTER_FILTER_ACTION_HIDE,
	TUBA_API_FILTERS_FILTER_FILTER_ACTION_BLUR,
	TUBA_API_FILTERS_FILTER_FILTER_ACTION_WARN
} TubaAPIFiltersFilterFilterAction;

#define TUBA_API_FILTERS_FILTER_TYPE_FILTER_ACTION (tuba_api_filters_filter_filter_action_get_type ())

#define TUBA_API_FILTERS_TYPE_FILTER_KEYWORD (tuba_api_filters_filter_keyword_get_type ())
#define TUBA_API_FILTERS_FILTER_KEYWORD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_FILTERS_TYPE_FILTER_KEYWORD, TubaAPIFiltersFilterKeyword))
#define TUBA_API_FILTERS_FILTER_KEYWORD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_FILTERS_TYPE_FILTER_KEYWORD, TubaAPIFiltersFilterKeywordClass))
#define TUBA_API_FILTERS_IS_FILTER_KEYWORD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_FILTERS_TYPE_FILTER_KEYWORD))
#define TUBA_API_FILTERS_IS_FILTER_KEYWORD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_FILTERS_TYPE_FILTER_KEYWORD))
#define TUBA_API_FILTERS_FILTER_KEYWORD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_FILTERS_TYPE_FILTER_KEYWORD, TubaAPIFiltersFilterKeywordClass))

typedef struct _TubaAPIFiltersFilterKeyword TubaAPIFiltersFilterKeyword;
typedef struct _TubaAPIFiltersFilterKeywordClass TubaAPIFiltersFilterKeywordClass;

#define TUBA_DIALOGS_FILTER_EDIT_TYPE_EXP_WRAPPER (tuba_dialogs_filter_edit_exp_wrapper_get_type ())
#define TUBA_DIALOGS_FILTER_EDIT_EXP_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_FILTER_EDIT_TYPE_EXP_WRAPPER, TubaDialogsFilterEditExpWrapper))
#define TUBA_DIALOGS_FILTER_EDIT_EXP_WRAPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_FILTER_EDIT_TYPE_EXP_WRAPPER, TubaDialogsFilterEditExpWrapperClass))
#define TUBA_DIALOGS_FILTER_EDIT_IS_EXP_WRAPPER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_FILTER_EDIT_TYPE_EXP_WRAPPER))
#define TUBA_DIALOGS_FILTER_EDIT_IS_EXP_WRAPPER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_FILTER_EDIT_TYPE_EXP_WRAPPER))
#define TUBA_DIALOGS_FILTER_EDIT_EXP_WRAPPER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_FILTER_EDIT_TYPE_EXP_WRAPPER, TubaDialogsFilterEditExpWrapperClass))

typedef struct _TubaDialogsFilterEditExpWrapper TubaDialogsFilterEditExpWrapper;
typedef struct _TubaDialogsFilterEditExpWrapperClass TubaDialogsFilterEditExpWrapperClass;
#define _gtk_expression_unref0(var) ((var == NULL) ? NULL : (var = (gtk_expression_unref (var), NULL)))

#define TUBA_TYPE_REQUEST_V2 (tuba_request_v2_get_type ())
#define TUBA_REQUEST_V2(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_REQUEST_V2, TubaRequestV2))
#define TUBA_REQUEST_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_REQUEST_V2, TubaRequestV2Class))
#define TUBA_IS_REQUEST_V2(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_REQUEST_V2))
#define TUBA_IS_REQUEST_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_REQUEST_V2))
#define TUBA_REQUEST_V2_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_REQUEST_V2, TubaRequestV2Class))

typedef struct _TubaRequestV2 TubaRequestV2;
typedef struct _TubaRequestV2Class TubaRequestV2Class;
typedef enum  {
	TUBA_REQUEST_V2_METHOD_GET,
	TUBA_REQUEST_V2_METHOD_POST,
	TUBA_REQUEST_V2_METHOD_PUT,
	TUBA_REQUEST_V2_METHOD_DELETE,
	TUBA_REQUEST_V2_METHOD_PATCH
} TubaRequestV2Method;

#define TUBA_REQUEST_V2_TYPE_METHOD (tuba_request_v2_method_get_type ())

#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_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_TYPE_OOPSIE (tuba_oopsie_get_type ())

#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 __vala_JsonNode_free0(var) ((var == NULL) ? NULL : (var = (_vala_JsonNode_free (var), NULL)))
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
typedef struct _TubaDialogsFilterEditSaveRealData TubaDialogsFilterEditSaveRealData;
typedef struct _TubaDialogsFilterEditExpWrapperPrivate TubaDialogsFilterEditExpWrapperPrivate;
enum  {
	TUBA_DIALOGS_FILTER_EDIT_EXP_WRAPPER_0_PROPERTY,
	TUBA_DIALOGS_FILTER_EDIT_EXP_WRAPPER_EXP_PROPERTY,
	TUBA_DIALOGS_FILTER_EDIT_EXP_WRAPPER_TITLE_PROPERTY,
	TUBA_DIALOGS_FILTER_EDIT_EXP_WRAPPER_NUM_PROPERTIES
};
static GParamSpec* tuba_dialogs_filter_edit_exp_wrapper_properties[TUBA_DIALOGS_FILTER_EDIT_EXP_WRAPPER_NUM_PROPERTIES];
typedef struct _TubaDialogsFilterEditKeywordRowPrivate TubaDialogsFilterEditKeywordRowPrivate;
enum  {
	TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_0_PROPERTY,
	TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_ID_PROPERTY,
	TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_SHOULD_DESTROY_PROPERTY,
	TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_WHOLE_WORD_PROPERTY,
	TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_KEYWORD_PROPERTY,
	TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_NUM_PROPERTIES
};
static GParamSpec* tuba_dialogs_filter_edit_keyword_row_properties[TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_NUM_PROPERTIES];
enum  {
	TUBA_DIALOGS_FILTER_EDIT_SAVED_SIGNAL,
	TUBA_DIALOGS_FILTER_EDIT_TOAST_SIGNAL,
	TUBA_DIALOGS_FILTER_EDIT_NUM_SIGNALS
};
static guint tuba_dialogs_filter_edit_signals[TUBA_DIALOGS_FILTER_EDIT_NUM_SIGNALS] = {0};

struct _TubaDialogsFilterEdit {
	AdwNavigationPage parent_instance;
	TubaDialogsFilterEditPrivate * priv;
};

struct _TubaDialogsFilterEditClass {
	AdwNavigationPageClass parent_class;
};

struct _TubaDialogsFilterEditContextRow {
	AdwSwitchRow* row;
	TubaAPIFiltersFilterContextType ctx;
};

struct _TubaDialogsFilterEditPrivate {
	AdwEntryRow* title_row;
	AdwComboRow* expire_in_row;
	AdwPreferencesGroup* context_group;
	AdwPreferencesGroup* keywords_group;
	GtkButton* save_btn;
	AdwSwitchRow* hide_row;
	AdwButtonRow* filter_row;
	gchar* filter_id;
	TubaDialogsFilterEditContextRow* context_rows;
	gint context_rows_length1;
	gint _context_rows_size_;
	TubaDialogsFilterEditKeywordRow** keyword_rows;
	gint keyword_rows_length1;
	gint _keyword_rows_size_;
};

typedef enum  {
	TUBA_OOPSIE_USER,
	TUBA_OOPSIE_PARSING,
	TUBA_OOPSIE_INSTANCE,
	TUBA_OOPSIE_INTERNAL,
	TUBA_OOPSIE_HTTP_401 = 401,
	TUBA_OOPSIE_HTTP_403 = 403,
	TUBA_OOPSIE_HTTP_404 = 404,
	TUBA_OOPSIE_HTTP_410 = 410,
	TUBA_OOPSIE_HTTP_422 = 422,
	TUBA_OOPSIE_HTTP_429 = 429,
	TUBA_OOPSIE_HTTP_500 = 500,
	TUBA_OOPSIE_HTTP_503 = 503
} TubaOopsie;
#define TUBA_OOPSIE tuba_oopsie_quark ()

struct _TubaDialogsFilterEditSaveRealData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaDialogsFilterEdit* self;
	TubaRequestV2* req;
	GInputStream* in_stream;
	GInputStream* _tmp0_;
	JsonParser* parser;
	GInputStream* _tmp1_;
	JsonParser* _tmp2_;
	JsonNode* node;
	TubaNetwork* _tmp3_;
	JsonParser* _tmp4_;
	JsonNode* _tmp5_;
	TubaAPIFiltersFilter* _tmp6_;
	JsonNode* _tmp7_;
	TubaAPIFiltersFilter* _tmp8_;
	GError* e;
	GError* _tmp9_;
	const gchar* _tmp10_;
	gchar* _tmp11_;
	gchar* _tmp12_;
	GError* _tmp13_;
	gchar* _tmp14_;
	gchar* _tmp15_;
	GError* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	gchar* _tmp19_;
	gchar* _tmp20_;
	GError* _inner_error0_;
};

struct _TubaDialogsFilterEditExpWrapper {
	GObject parent_instance;
	TubaDialogsFilterEditExpWrapperPrivate * priv;
};

struct _TubaDialogsFilterEditExpWrapperClass {
	GObjectClass parent_class;
};

struct _TubaDialogsFilterEditExpWrapperPrivate {
	TubaDialogsFilterEditFilterExpiration _exp;
	gchar* _title;
};

struct _TubaDialogsFilterEditKeywordRow {
	AdwEntryRow parent_instance;
	TubaDialogsFilterEditKeywordRowPrivate * priv;
};

struct _TubaDialogsFilterEditKeywordRowClass {
	AdwEntryRowClass parent_class;
};

struct _TubaDialogsFilterEditKeywordRowPrivate {
	gchar* _id;
	gboolean _should_destroy;
	GtkSwitch* word_switch;
};

static gint TubaDialogsFilterEdit_private_offset;
static gpointer tuba_dialogs_filter_edit_parent_class = NULL;
VALA_EXTERN TubaAccountStore* tuba_accounts;
VALA_EXTERN TubaNetwork* tuba_network;
static gint TubaDialogsFilterEditExpWrapper_private_offset;
static gpointer tuba_dialogs_filter_edit_exp_wrapper_parent_class = NULL;
static gint TubaDialogsFilterEditKeywordRow_private_offset;
static gpointer tuba_dialogs_filter_edit_keyword_row_parent_class = NULL;

VALA_EXTERN GType tuba_dialogs_filter_edit_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsFilterEdit, g_object_unref)
static GType tuba_dialogs_filter_edit_context_row_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
VALA_EXTERN GType tuba_api_filters_filter_context_type_get_type (void) G_GNUC_CONST ;
static TubaDialogsFilterEditContextRow* tuba_dialogs_filter_edit_context_row_dup (const TubaDialogsFilterEditContextRow* self);
static void tuba_dialogs_filter_edit_context_row_free (TubaDialogsFilterEditContextRow* self);
static void tuba_dialogs_filter_edit_context_row_copy (const TubaDialogsFilterEditContextRow* self,
                                                TubaDialogsFilterEditContextRow* dest);
static void tuba_dialogs_filter_edit_context_row_destroy (TubaDialogsFilterEditContextRow* self);
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC (TubaDialogsFilterEditContextRow, tuba_dialogs_filter_edit_context_row_destroy)
static GType tuba_dialogs_filter_edit_keyword_row_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsFilterEditKeywordRow, g_object_unref)
static void _vala_TubaDialogsFilterEditContextRow_array_free (TubaDialogsFilterEditContextRow * array,
                                                       gssize array_length);
static GType tuba_dialogs_filter_edit_filter_expiration_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static gchar* tuba_dialogs_filter_edit_filter_expiration_to_string (TubaDialogsFilterEditFilterExpiration self);
static gint tuba_dialogs_filter_edit_filter_expiration_to_seconds (TubaDialogsFilterEditFilterExpiration self);
static TubaDialogsFilterEditFilterExpiration tuba_dialogs_filter_edit_filter_expiration_from_date (const gchar* iso_8601);
VALA_EXTERN void tuba_dialogs_filter_edit_validate (TubaDialogsFilterEdit* self);
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_filters_filter_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIFiltersFilter, g_object_unref)
VALA_EXTERN TubaDialogsFilterEdit* tuba_dialogs_filter_edit_new (TubaAPIFiltersFilter* filter);
VALA_EXTERN TubaDialogsFilterEdit* tuba_dialogs_filter_edit_construct (GType object_type,
                                                           TubaAPIFiltersFilter* filter);
static void tuba_dialogs_filter_edit_add_keyword_row (TubaDialogsFilterEdit* self);
static void _tuba_dialogs_filter_edit_add_keyword_row_adw_button_row_activated (AdwButtonRow* _sender,
                                                                         gpointer self);
static void tuba_dialogs_filter_edit_populate_exp_row (TubaDialogsFilterEdit* self);
VALA_EXTERN const gchar* tuba_api_filters_filter_get_id (TubaAPIFiltersFilter* self);
VALA_EXTERN const gchar* tuba_api_filters_filter_get_title (TubaAPIFiltersFilter* self);
VALA_EXTERN GType tuba_api_filters_filter_filter_action_get_type (void) G_GNUC_CONST ;
VALA_EXTERN TubaAPIFiltersFilterFilterAction tuba_api_filters_filter_filter_action_from_string (const gchar* action);
VALA_EXTERN const gchar* tuba_api_filters_filter_get_filter_action (TubaAPIFiltersFilter* self);
VALA_EXTERN const gchar* tuba_api_filters_filter_get_expires_at (TubaAPIFiltersFilter* self);
static void tuba_dialogs_filter_edit_populate_context_group (TubaDialogsFilterEdit* self,
                                                      GeeArrayList* contexts);
VALA_EXTERN GeeArrayList* tuba_api_filters_filter_get_context (TubaAPIFiltersFilter* self);
VALA_EXTERN GType tuba_api_filters_filter_keyword_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIFiltersFilterKeyword, g_object_unref)
static void tuba_dialogs_filter_edit_populate_keywords_group (TubaDialogsFilterEdit* self,
                                                       GeeArrayList* keywords);
VALA_EXTERN GeeArrayList* tuba_api_filters_filter_get_keywords (TubaAPIFiltersFilter* self);
static GType tuba_dialogs_filter_edit_exp_wrapper_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsFilterEditExpWrapper, g_object_unref)
static TubaDialogsFilterEditExpWrapper* tuba_dialogs_filter_edit_exp_wrapper_new (TubaDialogsFilterEditFilterExpiration exp,
                                                                           const gchar* title);
static TubaDialogsFilterEditExpWrapper* tuba_dialogs_filter_edit_exp_wrapper_construct (GType object_type,
                                                                                 TubaDialogsFilterEditFilterExpiration exp,
                                                                                 const gchar* title);
static void _vala_array_add13 (TubaDialogsFilterEditExpWrapper** * array,
                        gint* length,
                        gint* size,
                        TubaDialogsFilterEditExpWrapper* value);
VALA_EXTERN gchar* tuba_api_filters_filter_context_type_to_api (TubaAPIFiltersFilterContextType self);
VALA_EXTERN gchar* tuba_api_filters_filter_context_type_to_string (TubaAPIFiltersFilterContextType self);
static void _vala_array_add14 (TubaDialogsFilterEditContextRow* * array,
                        gint* length,
                        gint* size,
                        const TubaDialogsFilterEditContextRow* value);
static void _tuba_dialogs_filter_edit_validate_g_object_notify (GObject* _sender,
                                                         GParamSpec* pspec,
                                                         gpointer self);
static gboolean __lambda215_ (TubaDialogsFilterEdit* self,
                       TubaAPIFiltersFilterKeyword* e);
static TubaDialogsFilterEditKeywordRow* tuba_dialogs_filter_edit_keyword_row_new (TubaAPIFiltersFilterKeyword* keyword);
static TubaDialogsFilterEditKeywordRow* tuba_dialogs_filter_edit_keyword_row_construct (GType object_type,
                                                                                 TubaAPIFiltersFilterKeyword* keyword);
static void _vala_array_add15 (TubaDialogsFilterEditKeywordRow** * array,
                        gint* length,
                        gint* size,
                        TubaDialogsFilterEditKeywordRow* value);
static gboolean ___lambda215__gee_forall_func (gpointer g,
                                        gpointer self);
static void _vala_array_add16 (TubaDialogsFilterEditKeywordRow** * array,
                        gint* length,
                        gint* size,
                        TubaDialogsFilterEditKeywordRow* value);
static void tuba_dialogs_filter_edit_on_title_row_changed (TubaDialogsFilterEdit* self);
VALA_EXTERN void tuba_toggle_css (GtkWidget* wdg,
                      gboolean state,
                      const gchar* style);
static void _tuba_dialogs_filter_edit_on_title_row_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                          gpointer self);
static void tuba_dialogs_filter_edit_on_close (TubaDialogsFilterEdit* self);
static void _tuba_dialogs_filter_edit_on_close_gtk_button_clicked (GtkButton* _sender,
                                                            gpointer self);
static void tuba_dialogs_filter_edit_on_save_clicked (TubaDialogsFilterEdit* self);
static const gchar* tuba_dialogs_filter_edit_keyword_row_get_id (TubaDialogsFilterEditKeywordRow* self);
static gboolean tuba_dialogs_filter_edit_keyword_row_get_should_destroy (TubaDialogsFilterEditKeywordRow* self);
static gboolean tuba_dialogs_filter_edit_keyword_row_get_whole_word (TubaDialogsFilterEditKeywordRow* self);
static const gchar* tuba_dialogs_filter_edit_keyword_row_get_keyword (TubaDialogsFilterEditKeywordRow* self);
VALA_EXTERN GType tuba_request_v2_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaRequestV2, g_object_unref)
VALA_EXTERN GType tuba_request_v2_method_get_type (void) G_GNUC_CONST ;
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_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 TubaRequestV2* tuba_request_v2_new (const gchar* url,
                                    TubaRequestV2Method method);
VALA_EXTERN TubaRequestV2* tuba_request_v2_construct (GType object_type,
                                          const gchar* url,
                                          TubaRequestV2Method method);
VALA_EXTERN void tuba_request_v2_set_account (TubaRequestV2* self,
                                  TubaInstanceAccount* value);
VALA_EXTERN void tuba_request_v2_set_body_from_json (TubaRequestV2* self,
                                         JsonBuilder* json_builder);
static void tuba_dialogs_filter_edit_save_real (TubaDialogsFilterEdit* self,
                                         TubaRequestV2* req,
                                         GAsyncReadyCallback _callback_,
                                         gpointer _user_data_);
static void tuba_dialogs_filter_edit_save_real_finish (TubaDialogsFilterEdit* self,
                                                GAsyncResult* _res_);
static void _tuba_dialogs_filter_edit_on_save_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                   gpointer self);
static void tuba_dialogs_filter_edit_save_real_data_free (gpointer _data);
static gboolean tuba_dialogs_filter_edit_save_real_co (TubaDialogsFilterEditSaveRealData* _data_);
VALA_EXTERN void tuba_request_v2_exec (TubaRequestV2* self,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_);
VALA_EXTERN GQuark tuba_oopsie_quark (void);
VALA_EXTERN GType tuba_oopsie_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GInputStream* tuba_request_v2_exec_finish (TubaRequestV2* self,
                                           GAsyncResult* _res_,
                                           SoupMessageHeaders** response_headers,
                                           GError** error);
static void tuba_dialogs_filter_edit_save_real_ready (GObject* source_object,
                                               GAsyncResult* _res_,
                                               gpointer _user_data_);
VALA_EXTERN void tuba_network_get_parser_from_inputstream_async (GInputStream* in_stream,
                                                     GCancellable* cancellable,
                                                     GAsyncReadyCallback _callback_,
                                                     gpointer _user_data_);
VALA_EXTERN JsonParser* tuba_network_get_parser_from_inputstream_finish (GAsyncResult* _res_,
                                                             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 TubaAPIFiltersFilter* tuba_api_filters_filter_from (JsonNode* node,
                                                    GError** error);
static void _vala_JsonNode_free (JsonNode* self);
static void g_cclosure_user_marshal_VOID__STRING_INT (GClosure * closure,
                                               GValue * return_value,
                                               guint n_param_values,
                                               const GValue * param_values,
                                               gpointer invocation_hint,
                                               gpointer marshal_data);
static void tuba_dialogs_filter_edit_exp_wrapper_set_exp (TubaDialogsFilterEditExpWrapper* self,
                                                   TubaDialogsFilterEditFilterExpiration value);
static void tuba_dialogs_filter_edit_exp_wrapper_set_title (TubaDialogsFilterEditExpWrapper* self,
                                                     const gchar* value);
static TubaDialogsFilterEditFilterExpiration tuba_dialogs_filter_edit_exp_wrapper_get_exp (TubaDialogsFilterEditExpWrapper* self);
static const gchar* tuba_dialogs_filter_edit_exp_wrapper_get_title (TubaDialogsFilterEditExpWrapper* self);
static void tuba_dialogs_filter_edit_exp_wrapper_finalize (GObject * obj);
static GType tuba_dialogs_filter_edit_exp_wrapper_get_type_once (void);
static void _vala_tuba_dialogs_filter_edit_exp_wrapper_get_property (GObject * object,
                                                              guint property_id,
                                                              GValue * value,
                                                              GParamSpec * pspec);
static void _vala_tuba_dialogs_filter_edit_exp_wrapper_set_property (GObject * object,
                                                              guint property_id,
                                                              const GValue * value,
                                                              GParamSpec * pspec);
VALA_EXTERN const gchar* tuba_api_filters_filter_keyword_get_id (TubaAPIFiltersFilterKeyword* self);
static void tuba_dialogs_filter_edit_keyword_row_set_id (TubaDialogsFilterEditKeywordRow* self,
                                                  const gchar* value);
VALA_EXTERN const gchar* tuba_api_filters_filter_keyword_get_keyword (TubaAPIFiltersFilterKeyword* self);
VALA_EXTERN gboolean tuba_api_filters_filter_keyword_get_whole_word (TubaAPIFiltersFilterKeyword* self);
static void tuba_dialogs_filter_edit_keyword_row_on_delete (TubaDialogsFilterEditKeywordRow* self);
static void tuba_dialogs_filter_edit_keyword_row_set_should_destroy (TubaDialogsFilterEditKeywordRow* self,
                                                              gboolean value);
static GObject * tuba_dialogs_filter_edit_keyword_row_constructor (GType type,
                                                            guint n_construct_properties,
                                                            GObjectConstructParam * construct_properties);
static void _tuba_dialogs_filter_edit_keyword_row_on_delete_gtk_button_clicked (GtkButton* _sender,
                                                                         gpointer self);
static void tuba_dialogs_filter_edit_keyword_row_finalize (GObject * obj);
static GType tuba_dialogs_filter_edit_keyword_row_get_type_once (void);
static void _vala_tuba_dialogs_filter_edit_keyword_row_get_property (GObject * object,
                                                              guint property_id,
                                                              GValue * value,
                                                              GParamSpec * pspec);
static void _vala_tuba_dialogs_filter_edit_keyword_row_set_property (GObject * object,
                                                              guint property_id,
                                                              const GValue * value,
                                                              GParamSpec * pspec);
static void tuba_dialogs_filter_edit_finalize (GObject * obj);
static GType tuba_dialogs_filter_edit_get_type_once (void);
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 const TubaDialogsFilterEditFilterExpiration TUBA_DIALOGS_FILTER_EDIT_ALL_EXP[7] = {TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_NEVER, TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_MINUTES_30, TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_HOUR_1, TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_HOUR_6, TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_HOUR_12, TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_DAY_1, TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_WEEK_1};
static const TubaAPIFiltersFilterContextType TUBA_DIALOGS_FILTER_EDIT_ALL_CONTEXT[5] = {TUBA_API_FILTERS_FILTER_CONTEXT_TYPE_HOME, TUBA_API_FILTERS_FILTER_CONTEXT_TYPE_NOTIFICATIONS, TUBA_API_FILTERS_FILTER_CONTEXT_TYPE_PUBLIC, TUBA_API_FILTERS_FILTER_CONTEXT_TYPE_THREAD, TUBA_API_FILTERS_FILTER_CONTEXT_TYPE_ACCOUNT};

static inline gpointer
tuba_dialogs_filter_edit_get_instance_private (TubaDialogsFilterEdit* self)
{
	return G_STRUCT_MEMBER_P (self, TubaDialogsFilterEdit_private_offset);
}

static void
_vala_TubaDialogsFilterEditContextRow_array_free (TubaDialogsFilterEditContextRow * array,
                                                  gssize array_length)
{
	if (array != NULL) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			tuba_dialogs_filter_edit_context_row_destroy (&array[i]);
		}
	}
	g_free (array);
}

static gchar*
tuba_dialogs_filter_edit_filter_expiration_to_string (TubaDialogsFilterEditFilterExpiration self)
{
	gchar* result;
	switch (self) {
		case TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_NEVER:
		{
			gchar* _tmp0_;
			_tmp0_ = g_strdup (_ ("Never"));
			result = _tmp0_;
			return result;
		}
		case TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_MINUTES_30:
		{
			gchar* _tmp1_;
			_tmp1_ = g_strdup_printf (ngettext ("%d Minute", "%d Minutes", (gulong) 30), 30);
			result = _tmp1_;
			return result;
		}
		case TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_HOUR_1:
		{
			gchar* _tmp2_;
			_tmp2_ = g_strdup_printf (ngettext ("%d Hour", "%d Hours", (gulong) 1), 1);
			result = _tmp2_;
			return result;
		}
		case TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_HOUR_6:
		{
			gchar* _tmp3_;
			_tmp3_ = g_strdup_printf (ngettext ("%d Hour", "%d Hours", (gulong) 6), 6);
			result = _tmp3_;
			return result;
		}
		case TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_HOUR_12:
		{
			gchar* _tmp4_;
			_tmp4_ = g_strdup_printf (ngettext ("%d Hour", "%d Hours", (gulong) 12), 12);
			result = _tmp4_;
			return result;
		}
		case TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_DAY_1:
		{
			gchar* _tmp5_;
			_tmp5_ = g_strdup_printf (ngettext ("%d Day", "%d Days", (gulong) 1), 1);
			result = _tmp5_;
			return result;
		}
		case TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_WEEK_1:
		{
			gchar* _tmp6_;
			_tmp6_ = g_strdup_printf (ngettext ("%d Week", "%d Weeks", (gulong) 1), 1);
			result = _tmp6_;
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}

static gint
tuba_dialogs_filter_edit_filter_expiration_to_seconds (TubaDialogsFilterEditFilterExpiration self)
{
	gint result;
	switch (self) {
		case TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_NEVER:
		{
			result = 0;
			return result;
		}
		case TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_MINUTES_30:
		{
			result = 1800;
			return result;
		}
		case TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_HOUR_1:
		{
			result = 3600;
			return result;
		}
		case TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_HOUR_6:
		{
			result = 21600;
			return result;
		}
		case TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_HOUR_12:
		{
			result = 43200;
			return result;
		}
		case TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_DAY_1:
		{
			result = 86400;
			return result;
		}
		case TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_WEEK_1:
		{
			result = 604800;
			return result;
		}
		default:
		{
			g_assert_not_reached ();
		}
	}
}

static TubaDialogsFilterEditFilterExpiration
tuba_dialogs_filter_edit_filter_expiration_from_date (const gchar* iso_8601)
{
	GDateTime* date = NULL;
	GDateTime* _tmp0_;
	GDateTime* now = NULL;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	GDateTime* _tmp3_;
	GTimeSpan delta = 0LL;
	GDateTime* _tmp4_;
	GDateTime* _tmp5_;
	GTimeSpan seconds = 0LL;
	TubaDialogsFilterEditFilterExpiration res = 0;
	TubaDialogsFilterEditFilterExpiration result;
	if (iso_8601 == NULL) {
		result = TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_NEVER;
		return result;
	}
	_tmp0_ = g_date_time_new_from_iso8601 (iso_8601, NULL);
	date = _tmp0_;
	_tmp1_ = g_date_time_new_now_local ();
	now = _tmp1_;
	_tmp2_ = date;
	_tmp3_ = now;
	if (g_date_time_compare (_tmp2_, _tmp3_) < 1) {
		result = TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_NEVER;
		_g_date_time_unref0 (now);
		_g_date_time_unref0 (date);
		return result;
	}
	_tmp4_ = date;
	_tmp5_ = now;
	delta = g_date_time_difference (_tmp4_, _tmp5_);
	seconds = delta / G_TIME_SPAN_SECOND;
	res = TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_WEEK_1;
	{
		TubaDialogsFilterEditFilterExpiration* exp_collection = NULL;
		gint exp_collection_length1 = 0;
		gint _exp_collection_size_ = 0;
		gint exp_it = 0;
		exp_collection = TUBA_DIALOGS_FILTER_EDIT_ALL_EXP;
		exp_collection_length1 = G_N_ELEMENTS (TUBA_DIALOGS_FILTER_EDIT_ALL_EXP);
		for (exp_it = 0; exp_it < exp_collection_length1; exp_it = exp_it + 1) {
			TubaDialogsFilterEditFilterExpiration exp = 0;
			exp = exp_collection[exp_it];
			{
				if (seconds <= ((GTimeSpan) tuba_dialogs_filter_edit_filter_expiration_to_seconds (exp))) {
					res = exp;
					break;
				}
			}
		}
	}
	result = res;
	_g_date_time_unref0 (now);
	_g_date_time_unref0 (date);
	return result;
}

 G_GNUC_NO_INLINE static GType
tuba_dialogs_filter_edit_filter_expiration_get_type_once (void)
{
	static const GEnumValue values[] = {{TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_NEVER, "TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_NEVER", "never"}, {TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_MINUTES_30, "TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_MINUTES_30", "minutes-30"}, {TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_HOUR_1, "TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_HOUR_1", "hour-1"}, {TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_HOUR_6, "TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_HOUR_6", "hour-6"}, {TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_HOUR_12, "TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_HOUR_12", "hour-12"}, {TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_DAY_1, "TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_DAY_1", "day-1"}, {TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_WEEK_1, "TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_WEEK_1", "week-1"}, {0, NULL, NULL}};
	GType tuba_dialogs_filter_edit_filter_expiration_type_id;
	tuba_dialogs_filter_edit_filter_expiration_type_id = g_enum_register_static ("TubaDialogsFilterEditFilterExpiration", values);
	return tuba_dialogs_filter_edit_filter_expiration_type_id;
}

static GType
tuba_dialogs_filter_edit_filter_expiration_get_type (void)
{
	static GType tuba_dialogs_filter_edit_filter_expiration_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_dialogs_filter_edit_filter_expiration_type_id__once)) {
		GType tuba_dialogs_filter_edit_filter_expiration_type_id;
		tuba_dialogs_filter_edit_filter_expiration_type_id = tuba_dialogs_filter_edit_filter_expiration_get_type_once ();
		g_once_init_leave_pointer (&tuba_dialogs_filter_edit_filter_expiration_type_id__once, tuba_dialogs_filter_edit_filter_expiration_type_id);
	}
	return tuba_dialogs_filter_edit_filter_expiration_type_id__once;
}

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

void
tuba_dialogs_filter_edit_validate (TubaDialogsFilterEdit* self)
{
	gint context_active = 0;
	AdwSwitchRow* last_row = NULL;
	TubaDialogsFilterEditContextRow* _tmp0_;
	gint _tmp0__length1;
	gboolean _tmp12_ = FALSE;
	gboolean _tmp15_ = FALSE;
	AdwEntryRow* _tmp16_;
	const gchar* _tmp17_;
	const gchar* _tmp18_;
	gboolean res = FALSE;
	GtkButton* _tmp19_;
	g_return_if_fail (self != NULL);
	context_active = 0;
	last_row = NULL;
	_tmp0_ = self->priv->context_rows;
	_tmp0__length1 = self->priv->context_rows_length1;
	{
		TubaDialogsFilterEditContextRow* ctx_row_collection = NULL;
		gint ctx_row_collection_length1 = 0;
		gint _ctx_row_collection_size_ = 0;
		gint ctx_row_it = 0;
		ctx_row_collection = _tmp0_;
		ctx_row_collection_length1 = _tmp0__length1;
		for (ctx_row_it = 0; ctx_row_it < ctx_row_collection_length1; ctx_row_it = ctx_row_it + 1) {
			TubaDialogsFilterEditContextRow _tmp1_;
			TubaDialogsFilterEditContextRow _tmp2_ = {0};
			TubaDialogsFilterEditContextRow ctx_row = {0};
			_tmp1_ = ctx_row_collection[ctx_row_it];
			tuba_dialogs_filter_edit_context_row_copy (&_tmp1_, &_tmp2_);
			ctx_row = _tmp2_;
			{
				TubaDialogsFilterEditContextRow _tmp3_;
				AdwSwitchRow* _tmp4_;
				TubaDialogsFilterEditContextRow _tmp5_;
				AdwSwitchRow* _tmp6_;
				gboolean _tmp7_;
				gboolean _tmp8_;
				_tmp3_ = ctx_row;
				_tmp4_ = _tmp3_.row;
				gtk_widget_set_sensitive ((GtkWidget*) _tmp4_, TRUE);
				_tmp5_ = ctx_row;
				_tmp6_ = _tmp5_.row;
				_tmp7_ = adw_switch_row_get_active (_tmp6_);
				_tmp8_ = _tmp7_;
				if (_tmp8_) {
					TubaDialogsFilterEditContextRow _tmp9_;
					AdwSwitchRow* _tmp10_;
					AdwSwitchRow* _tmp11_;
					context_active += 1;
					_tmp9_ = ctx_row;
					_tmp10_ = _tmp9_.row;
					_tmp11_ = _g_object_ref0 (_tmp10_);
					_g_object_unref0 (last_row);
					last_row = _tmp11_;
				}
				tuba_dialogs_filter_edit_context_row_destroy (&ctx_row);
			}
		}
	}
	if (context_active == 1) {
		AdwSwitchRow* _tmp13_;
		_tmp13_ = last_row;
		_tmp12_ = _tmp13_ != NULL;
	} else {
		_tmp12_ = FALSE;
	}
	if (_tmp12_) {
		AdwSwitchRow* _tmp14_;
		_tmp14_ = last_row;
		gtk_widget_set_sensitive ((GtkWidget*) _tmp14_, FALSE);
	}
	_tmp16_ = self->priv->title_row;
	_tmp17_ = gtk_editable_get_text ((GtkEditable*) _tmp16_);
	_tmp18_ = _tmp17_;
	if (g_strcmp0 (_tmp18_, "") != 0) {
		_tmp15_ = context_active > 0;
	} else {
		_tmp15_ = FALSE;
	}
	res = _tmp15_;
	_tmp19_ = self->priv->save_btn;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp19_, res);
	_g_object_unref0 (last_row);
}

static void
_tuba_dialogs_filter_edit_add_keyword_row_adw_button_row_activated (AdwButtonRow* _sender,
                                                                    gpointer self)
{
	tuba_dialogs_filter_edit_add_keyword_row ((TubaDialogsFilterEdit*) self);
}

TubaDialogsFilterEdit*
tuba_dialogs_filter_edit_construct (GType object_type,
                                    TubaAPIFiltersFilter* filter)
{
	TubaDialogsFilterEdit * self = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	AdwButtonRow* _tmp2_ = NULL;
	AdwButtonRow* _tmp3_;
	AdwPreferencesGroup* _tmp4_;
	AdwButtonRow* _tmp5_;
	self = (TubaDialogsFilterEdit*) g_object_new (object_type, NULL);
	_tmp0_ = g_strdup (_ ("Add Keyword"));
	_tmp1_ = g_strdup ("tuba-plus-large-symbolic");
	_tmp2_ = (AdwButtonRow*) adw_button_row_new ();
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp2_, _tmp0_);
	_g_free0 (_tmp0_);
	adw_button_row_set_start_icon_name (_tmp2_, _tmp1_);
	_g_free0 (_tmp1_);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->filter_row);
	self->priv->filter_row = _tmp2_;
	_tmp3_ = self->priv->filter_row;
	g_signal_connect_object (_tmp3_, "activated", (GCallback) _tuba_dialogs_filter_edit_add_keyword_row_adw_button_row_activated, self, 0);
	_tmp4_ = self->priv->keywords_group;
	_tmp5_ = self->priv->filter_row;
	adw_preferences_group_add (_tmp4_, (GtkWidget*) _tmp5_);
	tuba_dialogs_filter_edit_populate_exp_row (self);
	if (filter != NULL) {
		const gchar* _tmp6_;
		const gchar* _tmp7_;
		gchar* _tmp8_;
		AdwEntryRow* _tmp9_;
		const gchar* _tmp10_;
		const gchar* _tmp11_;
		AdwSwitchRow* _tmp12_;
		const gchar* _tmp13_;
		const gchar* _tmp14_;
		TubaDialogsFilterEditFilterExpiration exp_from_date = 0;
		const gchar* _tmp15_;
		const gchar* _tmp16_;
		GeeArrayList* _tmp21_;
		GeeArrayList* _tmp22_;
		GeeArrayList* _tmp23_;
		GeeArrayList* _tmp24_;
		_tmp6_ = tuba_api_filters_filter_get_id (filter);
		_tmp7_ = _tmp6_;
		_tmp8_ = g_strdup (_tmp7_);
		_g_free0 (self->priv->filter_id);
		self->priv->filter_id = _tmp8_;
		_tmp9_ = self->priv->title_row;
		_tmp10_ = tuba_api_filters_filter_get_title (filter);
		_tmp11_ = _tmp10_;
		gtk_editable_set_text ((GtkEditable*) _tmp9_, _tmp11_);
		_tmp12_ = self->priv->hide_row;
		_tmp13_ = tuba_api_filters_filter_get_filter_action (filter);
		_tmp14_ = _tmp13_;
		adw_switch_row_set_active (_tmp12_, tuba_api_filters_filter_filter_action_from_string (_tmp14_) == TUBA_API_FILTERS_FILTER_FILTER_ACTION_HIDE);
		_tmp15_ = tuba_api_filters_filter_get_expires_at (filter);
		_tmp16_ = _tmp15_;
		exp_from_date = tuba_dialogs_filter_edit_filter_expiration_from_date (_tmp16_);
		if (exp_from_date != TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_NEVER) {
			{
				gint i = 0;
				i = 0;
				{
					gboolean _tmp17_ = FALSE;
					_tmp17_ = TRUE;
					while (TRUE) {
						TubaDialogsFilterEditFilterExpiration _tmp19_;
						if (!_tmp17_) {
							gint _tmp18_;
							_tmp18_ = i;
							i = _tmp18_ + 1;
						}
						_tmp17_ = FALSE;
						if (!(i < G_N_ELEMENTS (TUBA_DIALOGS_FILTER_EDIT_ALL_EXP))) {
							break;
						}
						_tmp19_ = TUBA_DIALOGS_FILTER_EDIT_ALL_EXP[i];
						if (exp_from_date == _tmp19_) {
							AdwComboRow* _tmp20_;
							_tmp20_ = self->priv->expire_in_row;
							adw_combo_row_set_selected (_tmp20_, (guint) i);
							break;
						}
					}
				}
			}
		}
		_tmp21_ = tuba_api_filters_filter_get_context (filter);
		_tmp22_ = _tmp21_;
		tuba_dialogs_filter_edit_populate_context_group (self, _tmp22_);
		_tmp23_ = tuba_api_filters_filter_get_keywords (filter);
		_tmp24_ = _tmp23_;
		tuba_dialogs_filter_edit_populate_keywords_group (self, _tmp24_);
	} else {
		AdwComboRow* _tmp25_;
		_tmp25_ = self->priv->expire_in_row;
		adw_combo_row_set_selected (_tmp25_, (guint) 0);
		tuba_dialogs_filter_edit_populate_context_group (self, NULL);
		adw_navigation_page_set_title ((AdwNavigationPage*) self, _ ("New Filter"));
	}
	tuba_dialogs_filter_edit_validate (self);
	return self;
}

TubaDialogsFilterEdit*
tuba_dialogs_filter_edit_new (TubaAPIFiltersFilter* filter)
{
	return tuba_dialogs_filter_edit_construct (TUBA_DIALOGS_TYPE_FILTER_EDIT, filter);
}

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

static void
tuba_dialogs_filter_edit_populate_exp_row (TubaDialogsFilterEdit* self)
{
	GListStore* model = NULL;
	GListStore* _tmp0_;
	TubaDialogsFilterEditExpWrapper** to_add = NULL;
	TubaDialogsFilterEditExpWrapper** _tmp1_;
	gint to_add_length1;
	gint _to_add_size_;
	GListStore* _tmp5_;
	TubaDialogsFilterEditExpWrapper** _tmp6_;
	gint _tmp6__length1;
	AdwComboRow* _tmp7_;
	GtkPropertyExpression* _tmp8_;
	GtkPropertyExpression* _tmp9_;
	AdwComboRow* _tmp10_;
	GListStore* _tmp11_;
	g_return_if_fail (self != NULL);
	_tmp0_ = g_list_store_new (TUBA_DIALOGS_FILTER_EDIT_TYPE_EXP_WRAPPER);
	model = _tmp0_;
	_tmp1_ = g_new0 (TubaDialogsFilterEditExpWrapper*, 0 + 1);
	to_add = _tmp1_;
	to_add_length1 = 0;
	_to_add_size_ = to_add_length1;
	{
		TubaDialogsFilterEditFilterExpiration* exp_collection = NULL;
		gint exp_collection_length1 = 0;
		gint _exp_collection_size_ = 0;
		gint exp_it = 0;
		exp_collection = TUBA_DIALOGS_FILTER_EDIT_ALL_EXP;
		exp_collection_length1 = G_N_ELEMENTS (TUBA_DIALOGS_FILTER_EDIT_ALL_EXP);
		for (exp_it = 0; exp_it < exp_collection_length1; exp_it = exp_it + 1) {
			TubaDialogsFilterEditFilterExpiration exp = 0;
			exp = exp_collection[exp_it];
			{
				gchar* _tmp2_;
				gchar* _tmp3_;
				TubaDialogsFilterEditExpWrapper* _tmp4_;
				_tmp2_ = tuba_dialogs_filter_edit_filter_expiration_to_string (exp);
				_tmp3_ = _tmp2_;
				_tmp4_ = tuba_dialogs_filter_edit_exp_wrapper_new (exp, _tmp3_);
				_vala_array_add13 (&to_add, &to_add_length1, &_to_add_size_, _tmp4_);
				_g_free0 (_tmp3_);
			}
		}
	}
	_tmp5_ = model;
	_tmp6_ = to_add;
	_tmp6__length1 = to_add_length1;
	g_list_store_splice (_tmp5_, (guint) 0, (guint) 0, _tmp6_, (guint) _tmp6__length1);
	_tmp7_ = self->priv->expire_in_row;
	_tmp8_ = (GtkPropertyExpression*) gtk_property_expression_new (TUBA_DIALOGS_FILTER_EDIT_TYPE_EXP_WRAPPER, NULL, "title");
	_tmp9_ = _tmp8_;
	adw_combo_row_set_expression (_tmp7_, (GtkExpression*) _tmp9_);
	_gtk_expression_unref0 (_tmp9_);
	_tmp10_ = self->priv->expire_in_row;
	_tmp11_ = model;
	adw_combo_row_set_model (_tmp10_, (GListModel*) _tmp11_);
	to_add = (_vala_array_free (to_add, to_add_length1, (GDestroyNotify) g_object_unref), NULL);
	_g_object_unref0 (model);
}

static void
_vala_array_add14 (TubaDialogsFilterEditContextRow* * array,
                   gint* length,
                   gint* size,
                   const TubaDialogsFilterEditContextRow* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (TubaDialogsFilterEditContextRow, *array, *size);
	}
	(*array)[(*length)++] = *value;
}

static void
_tuba_dialogs_filter_edit_validate_g_object_notify (GObject* _sender,
                                                    GParamSpec* pspec,
                                                    gpointer self)
{
	tuba_dialogs_filter_edit_validate ((TubaDialogsFilterEdit*) self);
}

static void
tuba_dialogs_filter_edit_populate_context_group (TubaDialogsFilterEdit* self,
                                                 GeeArrayList* contexts)
{
	g_return_if_fail (self != NULL);
	{
		TubaAPIFiltersFilterContextType* ctx_collection = NULL;
		gint ctx_collection_length1 = 0;
		gint _ctx_collection_size_ = 0;
		gint ctx_it = 0;
		ctx_collection = TUBA_DIALOGS_FILTER_EDIT_ALL_CONTEXT;
		ctx_collection_length1 = G_N_ELEMENTS (TUBA_DIALOGS_FILTER_EDIT_ALL_CONTEXT);
		for (ctx_it = 0; ctx_it < ctx_collection_length1; ctx_it = ctx_it + 1) {
			TubaAPIFiltersFilterContextType ctx = 0;
			ctx = ctx_collection[ctx_it];
			{
				gboolean _tmp0_ = FALSE;
				AdwSwitchRow* row = NULL;
				gchar* _tmp4_;
				AdwSwitchRow* _tmp5_ = NULL;
				AdwSwitchRow* _tmp6_;
				AdwSwitchRow* _tmp7_;
				TubaDialogsFilterEditContextRow _tmp8_ = {0};
				AdwSwitchRow* _tmp9_;
				AdwPreferencesGroup* _tmp10_;
				AdwSwitchRow* _tmp11_;
				if (contexts == NULL) {
					_tmp0_ = TRUE;
				} else {
					gboolean _tmp1_ = FALSE;
					if (contexts != NULL) {
						gchar* _tmp2_;
						gchar* _tmp3_;
						_tmp2_ = tuba_api_filters_filter_context_type_to_api (ctx);
						_tmp3_ = _tmp2_;
						_tmp1_ = gee_abstract_collection_contains ((GeeAbstractCollection*) contexts, _tmp3_);
						_g_free0 (_tmp3_);
					} else {
						_tmp1_ = FALSE;
					}
					_tmp0_ = _tmp1_;
				}
				_tmp4_ = tuba_api_filters_filter_context_type_to_string (ctx);
				_tmp5_ = (AdwSwitchRow*) adw_switch_row_new ();
				adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp5_, _tmp4_);
				_g_free0 (_tmp4_);
				adw_switch_row_set_active (_tmp5_, _tmp0_);
				g_object_ref_sink (_tmp5_);
				row = _tmp5_;
				_tmp6_ = row;
				_tmp7_ = _g_object_ref0 (_tmp6_);
				memset (&_tmp8_, 0, sizeof (TubaDialogsFilterEditContextRow));
				_g_object_unref0 (_tmp8_.row);
				_tmp8_.row = _tmp7_;
				_tmp8_.ctx = ctx;
				_vala_array_add14 (&self->priv->context_rows, &self->priv->context_rows_length1, &self->priv->_context_rows_size_, &_tmp8_);
				_tmp9_ = row;
				g_signal_connect_object ((GObject*) _tmp9_, "notify::active", (GCallback) _tuba_dialogs_filter_edit_validate_g_object_notify, self, 0);
				_tmp10_ = self->priv->context_group;
				_tmp11_ = row;
				adw_preferences_group_add (_tmp10_, (GtkWidget*) _tmp11_);
				_g_object_unref0 (row);
			}
		}
	}
}

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

static gboolean
__lambda215_ (TubaDialogsFilterEdit* self,
              TubaAPIFiltersFilterKeyword* e)
{
	TubaDialogsFilterEditKeywordRow* row = NULL;
	TubaDialogsFilterEditKeywordRow* _tmp0_;
	TubaDialogsFilterEditKeywordRow* _tmp1_;
	AdwPreferencesGroup* _tmp2_;
	gboolean result;
	g_return_val_if_fail (e != NULL, FALSE);
	_tmp0_ = tuba_dialogs_filter_edit_keyword_row_new (e);
	g_object_ref_sink (_tmp0_);
	row = _tmp0_;
	_tmp1_ = _g_object_ref0 (row);
	_vala_array_add15 (&self->priv->keyword_rows, &self->priv->keyword_rows_length1, &self->priv->_keyword_rows_size_, _tmp1_);
	_tmp2_ = self->priv->keywords_group;
	adw_preferences_group_add (_tmp2_, (GtkWidget*) row);
	result = TRUE;
	_g_object_unref0 (row);
	_g_object_unref0 (e);
	return result;
}

static gboolean
___lambda215__gee_forall_func (gpointer g,
                               gpointer self)
{
	gboolean result;
	result = __lambda215_ ((TubaDialogsFilterEdit*) self, (TubaAPIFiltersFilterKeyword*) g);
	return result;
}

static void
tuba_dialogs_filter_edit_populate_keywords_group (TubaDialogsFilterEdit* self,
                                                  GeeArrayList* keywords)
{
	AdwPreferencesGroup* _tmp0_;
	AdwButtonRow* _tmp1_;
	AdwPreferencesGroup* _tmp2_;
	AdwButtonRow* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (keywords != NULL);
	_tmp0_ = self->priv->keywords_group;
	_tmp1_ = self->priv->filter_row;
	adw_preferences_group_remove (_tmp0_, (GtkWidget*) _tmp1_);
	gee_abstract_collection_foreach ((GeeAbstractCollection*) keywords, ___lambda215__gee_forall_func, self);
	_tmp2_ = self->priv->keywords_group;
	_tmp3_ = self->priv->filter_row;
	adw_preferences_group_add (_tmp2_, (GtkWidget*) _tmp3_);
}

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

static void
tuba_dialogs_filter_edit_add_keyword_row (TubaDialogsFilterEdit* self)
{
	TubaDialogsFilterEditKeywordRow* row = NULL;
	TubaDialogsFilterEditKeywordRow* _tmp0_;
	TubaDialogsFilterEditKeywordRow* _tmp1_;
	AdwPreferencesGroup* _tmp2_;
	AdwButtonRow* _tmp3_;
	AdwPreferencesGroup* _tmp4_;
	AdwPreferencesGroup* _tmp5_;
	AdwButtonRow* _tmp6_;
	g_return_if_fail (self != NULL);
	_tmp0_ = tuba_dialogs_filter_edit_keyword_row_new (NULL);
	g_object_ref_sink (_tmp0_);
	row = _tmp0_;
	_tmp1_ = _g_object_ref0 (row);
	_vala_array_add16 (&self->priv->keyword_rows, &self->priv->keyword_rows_length1, &self->priv->_keyword_rows_size_, _tmp1_);
	_tmp2_ = self->priv->keywords_group;
	_tmp3_ = self->priv->filter_row;
	adw_preferences_group_remove (_tmp2_, (GtkWidget*) _tmp3_);
	_tmp4_ = self->priv->keywords_group;
	adw_preferences_group_add (_tmp4_, (GtkWidget*) row);
	_tmp5_ = self->priv->keywords_group;
	_tmp6_ = self->priv->filter_row;
	adw_preferences_group_add (_tmp5_, (GtkWidget*) _tmp6_);
	_g_object_unref0 (row);
}

static void
tuba_dialogs_filter_edit_on_title_row_changed (TubaDialogsFilterEdit* self)
{
	gboolean valid = FALSE;
	AdwEntryRow* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	AdwEntryRow* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->title_row;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = strlen (_tmp2_);
	_tmp4_ = _tmp3_;
	valid = _tmp4_ > 0;
	_tmp5_ = self->priv->title_row;
	tuba_toggle_css ((GtkWidget*) _tmp5_, !valid, "error");
	tuba_dialogs_filter_edit_validate (self);
}

static void
_tuba_dialogs_filter_edit_on_title_row_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                     gpointer self)
{
	tuba_dialogs_filter_edit_on_title_row_changed ((TubaDialogsFilterEdit*) self);
}

static void
tuba_dialogs_filter_edit_on_close (TubaDialogsFilterEdit* self)
{
	g_return_if_fail (self != NULL);
	gtk_widget_activate_action ((GtkWidget*) self, "navigation.pop", NULL, NULL);
}

static void
_tuba_dialogs_filter_edit_on_close_gtk_button_clicked (GtkButton* _sender,
                                                       gpointer self)
{
	tuba_dialogs_filter_edit_on_close ((TubaDialogsFilterEdit*) self);
}

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
tuba_dialogs_filter_edit_on_save_clicked (TubaDialogsFilterEdit* self)
{
	TubaDialogsFilterEditFilterExpiration exp = 0;
	AdwComboRow* _tmp0_;
	guint _tmp1_;
	guint _tmp2_;
	TubaDialogsFilterEditFilterExpiration _tmp3_;
	JsonBuilder* builder = NULL;
	JsonBuilder* _tmp4_;
	JsonBuilder* _tmp5_;
	JsonBuilder* _tmp6_;
	JsonBuilder* _tmp7_;
	AdwEntryRow* _tmp8_;
	const gchar* _tmp9_;
	const gchar* _tmp10_;
	JsonBuilder* _tmp11_;
	const gchar* _tmp12_ = NULL;
	AdwSwitchRow* _tmp13_;
	gboolean _tmp14_;
	gboolean _tmp15_;
	JsonBuilder* _tmp16_;
	JsonBuilder* _tmp17_;
	JsonBuilder* _tmp18_;
	TubaDialogsFilterEditContextRow* _tmp19_;
	gint _tmp19__length1;
	JsonBuilder* _tmp30_;
	JsonBuilder* _tmp31_;
	JsonBuilder* _tmp34_;
	JsonBuilder* _tmp35_;
	TubaDialogsFilterEditKeywordRow** _tmp36_;
	gint _tmp36__length1;
	JsonBuilder* _tmp70_;
	JsonBuilder* _tmp71_;
	TubaRequestV2* req = NULL;
	const gchar* _tmp72_;
	TubaRequestV2* _tmp87_;
	JsonBuilder* _tmp88_;
	TubaRequestV2* _tmp89_;
	g_return_if_fail (self != NULL);
	gtk_widget_set_sensitive ((GtkWidget*) self, FALSE);
	_tmp0_ = self->priv->expire_in_row;
	_tmp1_ = adw_combo_row_get_selected (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = TUBA_DIALOGS_FILTER_EDIT_ALL_EXP[_tmp2_];
	exp = _tmp3_;
	_tmp4_ = json_builder_new ();
	builder = _tmp4_;
	_tmp5_ = builder;
	json_builder_begin_object (_tmp5_);
	_tmp6_ = builder;
	json_builder_set_member_name (_tmp6_, "title");
	_tmp7_ = builder;
	_tmp8_ = self->priv->title_row;
	_tmp9_ = gtk_editable_get_text ((GtkEditable*) _tmp8_);
	_tmp10_ = _tmp9_;
	json_builder_add_string_value (_tmp7_, _tmp10_);
	_tmp11_ = builder;
	json_builder_set_member_name (_tmp11_, "filter_action");
	_tmp13_ = self->priv->hide_row;
	_tmp14_ = adw_switch_row_get_active (_tmp13_);
	_tmp15_ = _tmp14_;
	if (_tmp15_) {
		_tmp12_ = "hide";
	} else {
		_tmp12_ = "warn";
	}
	_tmp16_ = builder;
	json_builder_add_string_value (_tmp16_, _tmp12_);
	_tmp17_ = builder;
	json_builder_set_member_name (_tmp17_, "context");
	_tmp18_ = builder;
	json_builder_begin_array (_tmp18_);
	_tmp19_ = self->priv->context_rows;
	_tmp19__length1 = self->priv->context_rows_length1;
	{
		TubaDialogsFilterEditContextRow* ctx_row_collection = NULL;
		gint ctx_row_collection_length1 = 0;
		gint _ctx_row_collection_size_ = 0;
		gint ctx_row_it = 0;
		ctx_row_collection = _tmp19_;
		ctx_row_collection_length1 = _tmp19__length1;
		for (ctx_row_it = 0; ctx_row_it < ctx_row_collection_length1; ctx_row_it = ctx_row_it + 1) {
			TubaDialogsFilterEditContextRow _tmp20_;
			TubaDialogsFilterEditContextRow _tmp21_ = {0};
			TubaDialogsFilterEditContextRow ctx_row = {0};
			_tmp20_ = ctx_row_collection[ctx_row_it];
			tuba_dialogs_filter_edit_context_row_copy (&_tmp20_, &_tmp21_);
			ctx_row = _tmp21_;
			{
				TubaDialogsFilterEditContextRow _tmp22_;
				AdwSwitchRow* _tmp23_;
				gboolean _tmp24_;
				gboolean _tmp25_;
				_tmp22_ = ctx_row;
				_tmp23_ = _tmp22_.row;
				_tmp24_ = adw_switch_row_get_active (_tmp23_);
				_tmp25_ = _tmp24_;
				if (_tmp25_) {
					JsonBuilder* _tmp26_;
					TubaDialogsFilterEditContextRow _tmp27_;
					gchar* _tmp28_;
					gchar* _tmp29_;
					_tmp26_ = builder;
					_tmp27_ = ctx_row;
					_tmp28_ = tuba_api_filters_filter_context_type_to_api (_tmp27_.ctx);
					_tmp29_ = _tmp28_;
					json_builder_add_string_value (_tmp26_, _tmp29_);
					_g_free0 (_tmp29_);
				}
				tuba_dialogs_filter_edit_context_row_destroy (&ctx_row);
			}
		}
	}
	_tmp30_ = builder;
	json_builder_end_array (_tmp30_);
	_tmp31_ = builder;
	json_builder_set_member_name (_tmp31_, "expires_in");
	if (exp == TUBA_DIALOGS_FILTER_EDIT_FILTER_EXPIRATION_NEVER) {
		JsonBuilder* _tmp32_;
		_tmp32_ = builder;
		json_builder_add_null_value (_tmp32_);
	} else {
		JsonBuilder* _tmp33_;
		_tmp33_ = builder;
		json_builder_add_int_value (_tmp33_, (gint64) tuba_dialogs_filter_edit_filter_expiration_to_seconds (exp));
	}
	_tmp34_ = builder;
	json_builder_set_member_name (_tmp34_, "keywords_attributes");
	_tmp35_ = builder;
	json_builder_begin_array (_tmp35_);
	_tmp36_ = self->priv->keyword_rows;
	_tmp36__length1 = self->priv->keyword_rows_length1;
	{
		TubaDialogsFilterEditKeywordRow** keyword_row_collection = NULL;
		gint keyword_row_collection_length1 = 0;
		gint _keyword_row_collection_size_ = 0;
		gint keyword_row_it = 0;
		keyword_row_collection = _tmp36_;
		keyword_row_collection_length1 = _tmp36__length1;
		for (keyword_row_it = 0; keyword_row_it < keyword_row_collection_length1; keyword_row_it = keyword_row_it + 1) {
			TubaDialogsFilterEditKeywordRow* _tmp37_;
			TubaDialogsFilterEditKeywordRow* keyword_row = NULL;
			_tmp37_ = _g_object_ref0 (keyword_row_collection[keyword_row_it]);
			keyword_row = _tmp37_;
			{
				gboolean _tmp38_ = FALSE;
				TubaDialogsFilterEditKeywordRow* _tmp39_;
				const gchar* _tmp40_;
				const gchar* _tmp41_;
				JsonBuilder* _tmp45_;
				TubaDialogsFilterEditKeywordRow* _tmp46_;
				const gchar* _tmp47_;
				const gchar* _tmp48_;
				JsonBuilder* _tmp59_;
				JsonBuilder* _tmp60_;
				TubaDialogsFilterEditKeywordRow* _tmp61_;
				gboolean _tmp62_;
				gboolean _tmp63_;
				JsonBuilder* _tmp64_;
				JsonBuilder* _tmp65_;
				TubaDialogsFilterEditKeywordRow* _tmp66_;
				const gchar* _tmp67_;
				const gchar* _tmp68_;
				JsonBuilder* _tmp69_;
				_tmp39_ = keyword_row;
				_tmp40_ = tuba_dialogs_filter_edit_keyword_row_get_id (_tmp39_);
				_tmp41_ = _tmp40_;
				if (_tmp41_ == NULL) {
					TubaDialogsFilterEditKeywordRow* _tmp42_;
					gboolean _tmp43_;
					gboolean _tmp44_;
					_tmp42_ = keyword_row;
					_tmp43_ = tuba_dialogs_filter_edit_keyword_row_get_should_destroy (_tmp42_);
					_tmp44_ = _tmp43_;
					_tmp38_ = _tmp44_;
				} else {
					_tmp38_ = FALSE;
				}
				if (_tmp38_) {
					_g_object_unref0 (keyword_row);
					continue;
				}
				_tmp45_ = builder;
				json_builder_begin_object (_tmp45_);
				_tmp46_ = keyword_row;
				_tmp47_ = tuba_dialogs_filter_edit_keyword_row_get_id (_tmp46_);
				_tmp48_ = _tmp47_;
				if (_tmp48_ != NULL) {
					JsonBuilder* _tmp49_;
					JsonBuilder* _tmp50_;
					TubaDialogsFilterEditKeywordRow* _tmp51_;
					const gchar* _tmp52_;
					const gchar* _tmp53_;
					JsonBuilder* _tmp54_;
					JsonBuilder* _tmp55_;
					TubaDialogsFilterEditKeywordRow* _tmp56_;
					gboolean _tmp57_;
					gboolean _tmp58_;
					_tmp49_ = builder;
					json_builder_set_member_name (_tmp49_, "id");
					_tmp50_ = builder;
					_tmp51_ = keyword_row;
					_tmp52_ = tuba_dialogs_filter_edit_keyword_row_get_id (_tmp51_);
					_tmp53_ = _tmp52_;
					json_builder_add_string_value (_tmp50_, _tmp53_);
					_tmp54_ = builder;
					json_builder_set_member_name (_tmp54_, "_destroy");
					_tmp55_ = builder;
					_tmp56_ = keyword_row;
					_tmp57_ = tuba_dialogs_filter_edit_keyword_row_get_should_destroy (_tmp56_);
					_tmp58_ = _tmp57_;
					json_builder_add_boolean_value (_tmp55_, _tmp58_);
				}
				_tmp59_ = builder;
				json_builder_set_member_name (_tmp59_, "whole_word");
				_tmp60_ = builder;
				_tmp61_ = keyword_row;
				_tmp62_ = tuba_dialogs_filter_edit_keyword_row_get_whole_word (_tmp61_);
				_tmp63_ = _tmp62_;
				json_builder_add_boolean_value (_tmp60_, _tmp63_);
				_tmp64_ = builder;
				json_builder_set_member_name (_tmp64_, "keyword");
				_tmp65_ = builder;
				_tmp66_ = keyword_row;
				_tmp67_ = tuba_dialogs_filter_edit_keyword_row_get_keyword (_tmp66_);
				_tmp68_ = _tmp67_;
				json_builder_add_string_value (_tmp65_, _tmp68_);
				_tmp69_ = builder;
				json_builder_end_object (_tmp69_);
				_g_object_unref0 (keyword_row);
			}
		}
	}
	_tmp70_ = builder;
	json_builder_end_array (_tmp70_);
	_tmp71_ = builder;
	json_builder_end_object (_tmp71_);
	_tmp72_ = self->priv->filter_id;
	if (_tmp72_ != NULL) {
		const gchar* _tmp73_;
		const gchar* _tmp74_;
		gchar* _tmp75_;
		gchar* _tmp76_;
		TubaAccountStore* _tmp77_;
		TubaInstanceAccount* _tmp78_;
		TubaInstanceAccount* _tmp79_;
		TubaInstanceAccount* _tmp80_;
		TubaRequestV2* _tmp81_ = NULL;
		_tmp73_ = self->priv->filter_id;
		_tmp74_ = string_to_string (_tmp73_);
		_tmp75_ = g_strconcat ("/api/v2/filters/", _tmp74_, NULL);
		_tmp76_ = _tmp75_;
		_tmp77_ = tuba_accounts;
		_tmp78_ = tuba_account_store_get_active (_tmp77_);
		_tmp79_ = _tmp78_;
		_tmp80_ = _g_object_ref0 (_tmp79_);
		_tmp81_ = tuba_request_v2_new (_tmp76_, TUBA_REQUEST_V2_METHOD_PUT);
		tuba_request_v2_set_account (_tmp81_, _tmp80_);
		_g_object_unref0 (_tmp80_);
		_g_object_unref0 (req);
		req = _tmp81_;
		_g_free0 (_tmp76_);
	} else {
		TubaAccountStore* _tmp82_;
		TubaInstanceAccount* _tmp83_;
		TubaInstanceAccount* _tmp84_;
		TubaInstanceAccount* _tmp85_;
		TubaRequestV2* _tmp86_ = NULL;
		_tmp82_ = tuba_accounts;
		_tmp83_ = tuba_account_store_get_active (_tmp82_);
		_tmp84_ = _tmp83_;
		_tmp85_ = _g_object_ref0 (_tmp84_);
		_tmp86_ = tuba_request_v2_new ("/api/v2/filters", TUBA_REQUEST_V2_METHOD_POST);
		tuba_request_v2_set_account (_tmp86_, _tmp85_);
		_g_object_unref0 (_tmp85_);
		_g_object_unref0 (req);
		req = _tmp86_;
	}
	_tmp87_ = req;
	_tmp88_ = builder;
	tuba_request_v2_set_body_from_json (_tmp87_, _tmp88_);
	_tmp89_ = req;
	tuba_dialogs_filter_edit_save_real (self, _tmp89_, NULL, NULL);
	_g_object_unref0 (req);
	_g_object_unref0 (builder);
}

static void
_tuba_dialogs_filter_edit_on_save_clicked_gtk_button_clicked (GtkButton* _sender,
                                                              gpointer self)
{
	tuba_dialogs_filter_edit_on_save_clicked ((TubaDialogsFilterEdit*) self);
}

static void
tuba_dialogs_filter_edit_save_real_data_free (gpointer _data)
{
	TubaDialogsFilterEditSaveRealData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->req);
	_g_object_unref0 (_data_->self);
	g_slice_free (TubaDialogsFilterEditSaveRealData, _data_);
}

static void
tuba_dialogs_filter_edit_save_real (TubaDialogsFilterEdit* self,
                                    TubaRequestV2* req,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_)
{
	TubaDialogsFilterEditSaveRealData* _data_;
	TubaDialogsFilterEdit* _tmp0_;
	TubaRequestV2* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (req != NULL);
	_data_ = g_slice_new0 (TubaDialogsFilterEditSaveRealData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_dialogs_filter_edit_save_real_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_tmp1_ = _g_object_ref0 (req);
	_g_object_unref0 (_data_->req);
	_data_->req = _tmp1_;
	tuba_dialogs_filter_edit_save_real_co (_data_);
}

static void
tuba_dialogs_filter_edit_save_real_finish (TubaDialogsFilterEdit* self,
                                           GAsyncResult* _res_)
{
	TubaDialogsFilterEditSaveRealData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
tuba_dialogs_filter_edit_save_real_ready (GObject* source_object,
                                          GAsyncResult* _res_,
                                          gpointer _user_data_)
{
	TubaDialogsFilterEditSaveRealData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_dialogs_filter_edit_save_real_co (_data_);
}

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

static gboolean
tuba_dialogs_filter_edit_save_real_co (TubaDialogsFilterEditSaveRealData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	{
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->req, tuba_dialogs_filter_edit_save_real_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp0_ = tuba_request_v2_exec_finish (_data_->req, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->in_stream = _data_->_tmp0_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_data_->_tmp1_ = _data_->in_stream;
		_data_->_state_ = 2;
		tuba_network_get_parser_from_inputstream_async (_data_->_tmp1_, NULL, tuba_dialogs_filter_edit_save_real_ready, _data_);
		return FALSE;
		_state_2:
		_data_->_tmp2_ = tuba_network_get_parser_from_inputstream_finish (_data_->_res_, &_data_->_inner_error0_);
		_data_->parser = _data_->_tmp2_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			_g_object_unref0 (_data_->in_stream);
			goto __catch0_g_error;
		}
		_data_->_tmp3_ = tuba_network;
		_data_->_tmp4_ = _data_->parser;
		_data_->_tmp5_ = tuba_network_parse_node (_data_->_tmp3_, _data_->_tmp4_);
		_data_->node = _data_->_tmp5_;
		_data_->_tmp7_ = _data_->node;
		_data_->_tmp8_ = tuba_api_filters_filter_from (_data_->_tmp7_, &_data_->_inner_error0_);
		_data_->_tmp6_ = _data_->_tmp8_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			__vala_JsonNode_free0 (_data_->node);
			_g_object_unref0 (_data_->parser);
			_g_object_unref0 (_data_->in_stream);
			goto __catch0_g_error;
		}
		g_signal_emit (_data_->self, tuba_dialogs_filter_edit_signals[TUBA_DIALOGS_FILTER_EDIT_SAVED_SIGNAL], 0, _data_->_tmp6_);
		tuba_dialogs_filter_edit_on_close (_data_->self);
		_g_object_unref0 (_data_->_tmp6_);
		__vala_JsonNode_free0 (_data_->node);
		_g_object_unref0 (_data_->parser);
		_g_object_unref0 (_data_->in_stream);
	}
	goto __finally0;
	__catch0_g_error:
	{
		_data_->e = _data_->_inner_error0_;
		_data_->_inner_error0_ = NULL;
		gtk_widget_set_sensitive ((GtkWidget*) _data_->self, TRUE);
		_data_->_tmp9_ = _data_->e;
		_data_->_tmp10_ = _data_->_tmp9_->message;
		_data_->_tmp11_ = g_strdup_printf (_ ("Couldn't edit filter: %s"), _data_->_tmp10_);
		_data_->_tmp12_ = _data_->_tmp11_;
		g_signal_emit (_data_->self, tuba_dialogs_filter_edit_signals[TUBA_DIALOGS_FILTER_EDIT_TOAST_SIGNAL], 0, _data_->_tmp12_, 0);
		_g_free0 (_data_->_tmp12_);
		_data_->_tmp13_ = _data_->e;
		_data_->_tmp14_ = g_strdup_printf ("%i", _data_->_tmp13_->code);
		_data_->_tmp15_ = _data_->_tmp14_;
		_data_->_tmp16_ = _data_->e;
		_data_->_tmp17_ = _data_->_tmp16_->message;
		_data_->_tmp18_ = string_to_string (_data_->_tmp17_);
		_data_->_tmp19_ = g_strconcat ("Couldn't edit filter: ", _data_->_tmp15_, " ", _data_->_tmp18_, NULL);
		_data_->_tmp20_ = _data_->_tmp19_;
		g_warning ("FilterEdit.vala:341: %s", _data_->_tmp20_);
		_g_free0 (_data_->_tmp20_);
		_g_free0 (_data_->_tmp15_);
		_g_error_free0 (_data_->e);
	}
	__finally0:
	if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error0_->message, g_quark_to_string (_data_->_inner_error0_->domain), _data_->_inner_error0_->code);
		g_clear_error (&_data_->_inner_error0_);
		g_object_unref (_data_->_async_result);
		return FALSE;
	}
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
g_cclosure_user_marshal_VOID__STRING_INT (GClosure * closure,
                                          GValue * return_value,
                                          guint n_param_values,
                                          const GValue * param_values,
                                          gpointer invocation_hint,
                                          gpointer marshal_data)
{
	typedef void (*GMarshalFunc_VOID__STRING_INT) (gpointer data1, const char* arg_1, gint arg_2, gpointer data2);
	register GMarshalFunc_VOID__STRING_INT callback;
	register GCClosure * cc;
	register gpointer data1;
	register gpointer data2;
	cc = (GCClosure *) closure;
	g_return_if_fail (n_param_values == 3);
	if (G_CCLOSURE_SWAP_DATA (closure)) {
		data1 = closure->data;
		data2 = param_values->data[0].v_pointer;
	} else {
		data1 = param_values->data[0].v_pointer;
		data2 = closure->data;
	}
	callback = (GMarshalFunc_VOID__STRING_INT) (marshal_data ? marshal_data : cc->callback);
	callback (data1, g_value_get_string (param_values + 1), g_value_get_int (param_values + 2), data2);
}

static inline gpointer
tuba_dialogs_filter_edit_exp_wrapper_get_instance_private (TubaDialogsFilterEditExpWrapper* self)
{
	return G_STRUCT_MEMBER_P (self, TubaDialogsFilterEditExpWrapper_private_offset);
}

static TubaDialogsFilterEditExpWrapper*
tuba_dialogs_filter_edit_exp_wrapper_construct (GType object_type,
                                                TubaDialogsFilterEditFilterExpiration exp,
                                                const gchar* title)
{
	TubaDialogsFilterEditExpWrapper * self = NULL;
	g_return_val_if_fail (title != NULL, NULL);
	self = (TubaDialogsFilterEditExpWrapper*) g_object_new (object_type, NULL);
	tuba_dialogs_filter_edit_exp_wrapper_set_exp (self, exp);
	tuba_dialogs_filter_edit_exp_wrapper_set_title (self, title);
	return self;
}

static TubaDialogsFilterEditExpWrapper*
tuba_dialogs_filter_edit_exp_wrapper_new (TubaDialogsFilterEditFilterExpiration exp,
                                          const gchar* title)
{
	return tuba_dialogs_filter_edit_exp_wrapper_construct (TUBA_DIALOGS_FILTER_EDIT_TYPE_EXP_WRAPPER, exp, title);
}

static TubaDialogsFilterEditFilterExpiration
tuba_dialogs_filter_edit_exp_wrapper_get_exp (TubaDialogsFilterEditExpWrapper* self)
{
	TubaDialogsFilterEditFilterExpiration result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_exp;
	return result;
}

static void
tuba_dialogs_filter_edit_exp_wrapper_set_exp (TubaDialogsFilterEditExpWrapper* self,
                                              TubaDialogsFilterEditFilterExpiration value)
{
	TubaDialogsFilterEditFilterExpiration old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_dialogs_filter_edit_exp_wrapper_get_exp (self);
	if (old_value != value) {
		self->priv->_exp = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_dialogs_filter_edit_exp_wrapper_properties[TUBA_DIALOGS_FILTER_EDIT_EXP_WRAPPER_EXP_PROPERTY]);
	}
}

static const gchar*
tuba_dialogs_filter_edit_exp_wrapper_get_title (TubaDialogsFilterEditExpWrapper* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_title;
	result = _tmp0_;
	return result;
}

static void
tuba_dialogs_filter_edit_exp_wrapper_set_title (TubaDialogsFilterEditExpWrapper* self,
                                                const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_dialogs_filter_edit_exp_wrapper_get_title (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_title);
		self->priv->_title = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_dialogs_filter_edit_exp_wrapper_properties[TUBA_DIALOGS_FILTER_EDIT_EXP_WRAPPER_TITLE_PROPERTY]);
	}
}

static void
tuba_dialogs_filter_edit_exp_wrapper_class_init (TubaDialogsFilterEditExpWrapperClass * klass,
                                                 gpointer klass_data)
{
	tuba_dialogs_filter_edit_exp_wrapper_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaDialogsFilterEditExpWrapper_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_dialogs_filter_edit_exp_wrapper_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_dialogs_filter_edit_exp_wrapper_set_property;
	G_OBJECT_CLASS (klass)->finalize = tuba_dialogs_filter_edit_exp_wrapper_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_FILTER_EDIT_EXP_WRAPPER_EXP_PROPERTY, tuba_dialogs_filter_edit_exp_wrapper_properties[TUBA_DIALOGS_FILTER_EDIT_EXP_WRAPPER_EXP_PROPERTY] = g_param_spec_enum ("exp", "exp", "exp", TUBA_DIALOGS_FILTER_EDIT_TYPE_FILTER_EXPIRATION, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_FILTER_EDIT_EXP_WRAPPER_TITLE_PROPERTY, tuba_dialogs_filter_edit_exp_wrapper_properties[TUBA_DIALOGS_FILTER_EDIT_EXP_WRAPPER_TITLE_PROPERTY] = g_param_spec_string ("title", "title", "title", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
tuba_dialogs_filter_edit_exp_wrapper_instance_init (TubaDialogsFilterEditExpWrapper * self,
                                                    gpointer klass)
{
	self->priv = tuba_dialogs_filter_edit_exp_wrapper_get_instance_private (self);
}

static void
tuba_dialogs_filter_edit_exp_wrapper_finalize (GObject * obj)
{
	TubaDialogsFilterEditExpWrapper * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_DIALOGS_FILTER_EDIT_TYPE_EXP_WRAPPER, TubaDialogsFilterEditExpWrapper);
	_g_free0 (self->priv->_title);
	G_OBJECT_CLASS (tuba_dialogs_filter_edit_exp_wrapper_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_dialogs_filter_edit_exp_wrapper_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaDialogsFilterEditExpWrapperClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_dialogs_filter_edit_exp_wrapper_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaDialogsFilterEditExpWrapper), 0, (GInstanceInitFunc) tuba_dialogs_filter_edit_exp_wrapper_instance_init, NULL };
	GType tuba_dialogs_filter_edit_exp_wrapper_type_id;
	tuba_dialogs_filter_edit_exp_wrapper_type_id = g_type_register_static (G_TYPE_OBJECT, "TubaDialogsFilterEditExpWrapper", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaDialogsFilterEditExpWrapper_private_offset = g_type_add_instance_private (tuba_dialogs_filter_edit_exp_wrapper_type_id, sizeof (TubaDialogsFilterEditExpWrapperPrivate));
	return tuba_dialogs_filter_edit_exp_wrapper_type_id;
}

static GType
tuba_dialogs_filter_edit_exp_wrapper_get_type (void)
{
	static GType tuba_dialogs_filter_edit_exp_wrapper_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_dialogs_filter_edit_exp_wrapper_type_id__once)) {
		GType tuba_dialogs_filter_edit_exp_wrapper_type_id;
		tuba_dialogs_filter_edit_exp_wrapper_type_id = tuba_dialogs_filter_edit_exp_wrapper_get_type_once ();
		g_once_init_leave_pointer (&tuba_dialogs_filter_edit_exp_wrapper_type_id__once, tuba_dialogs_filter_edit_exp_wrapper_type_id);
	}
	return tuba_dialogs_filter_edit_exp_wrapper_type_id__once;
}

static void
_vala_tuba_dialogs_filter_edit_exp_wrapper_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec)
{
	TubaDialogsFilterEditExpWrapper * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_DIALOGS_FILTER_EDIT_TYPE_EXP_WRAPPER, TubaDialogsFilterEditExpWrapper);
	switch (property_id) {
		case TUBA_DIALOGS_FILTER_EDIT_EXP_WRAPPER_EXP_PROPERTY:
		g_value_set_enum (value, tuba_dialogs_filter_edit_exp_wrapper_get_exp (self));
		break;
		case TUBA_DIALOGS_FILTER_EDIT_EXP_WRAPPER_TITLE_PROPERTY:
		g_value_set_string (value, tuba_dialogs_filter_edit_exp_wrapper_get_title (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_dialogs_filter_edit_exp_wrapper_set_property (GObject * object,
                                                         guint property_id,
                                                         const GValue * value,
                                                         GParamSpec * pspec)
{
	TubaDialogsFilterEditExpWrapper * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_DIALOGS_FILTER_EDIT_TYPE_EXP_WRAPPER, TubaDialogsFilterEditExpWrapper);
	switch (property_id) {
		case TUBA_DIALOGS_FILTER_EDIT_EXP_WRAPPER_EXP_PROPERTY:
		tuba_dialogs_filter_edit_exp_wrapper_set_exp (self, g_value_get_enum (value));
		break;
		case TUBA_DIALOGS_FILTER_EDIT_EXP_WRAPPER_TITLE_PROPERTY:
		tuba_dialogs_filter_edit_exp_wrapper_set_title (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static inline gpointer
tuba_dialogs_filter_edit_keyword_row_get_instance_private (TubaDialogsFilterEditKeywordRow* self)
{
	return G_STRUCT_MEMBER_P (self, TubaDialogsFilterEditKeywordRow_private_offset);
}

static TubaDialogsFilterEditKeywordRow*
tuba_dialogs_filter_edit_keyword_row_construct (GType object_type,
                                                TubaAPIFiltersFilterKeyword* keyword)
{
	TubaDialogsFilterEditKeywordRow * self = NULL;
	self = (TubaDialogsFilterEditKeywordRow*) g_object_new (object_type, NULL);
	if (keyword != NULL) {
		const gchar* _tmp0_;
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		const gchar* _tmp3_;
		GtkSwitch* _tmp4_;
		gboolean _tmp5_;
		gboolean _tmp6_;
		_tmp0_ = tuba_api_filters_filter_keyword_get_id (keyword);
		_tmp1_ = _tmp0_;
		tuba_dialogs_filter_edit_keyword_row_set_id (self, _tmp1_);
		_tmp2_ = tuba_api_filters_filter_keyword_get_keyword (keyword);
		_tmp3_ = _tmp2_;
		gtk_editable_set_text ((GtkEditable*) self, _tmp3_);
		_tmp4_ = self->priv->word_switch;
		_tmp5_ = tuba_api_filters_filter_keyword_get_whole_word (keyword);
		_tmp6_ = _tmp5_;
		gtk_switch_set_active (_tmp4_, _tmp6_);
	}
	return self;
}

static TubaDialogsFilterEditKeywordRow*
tuba_dialogs_filter_edit_keyword_row_new (TubaAPIFiltersFilterKeyword* keyword)
{
	return tuba_dialogs_filter_edit_keyword_row_construct (TUBA_DIALOGS_FILTER_EDIT_TYPE_KEYWORD_ROW, keyword);
}

static void
tuba_dialogs_filter_edit_keyword_row_on_delete (TubaDialogsFilterEditKeywordRow* self)
{
	g_return_if_fail (self != NULL);
	tuba_dialogs_filter_edit_keyword_row_set_should_destroy (self, TRUE);
	gtk_widget_set_visible ((GtkWidget*) self, FALSE);
}

static const gchar*
tuba_dialogs_filter_edit_keyword_row_get_id (TubaDialogsFilterEditKeywordRow* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_id;
	result = _tmp0_;
	return result;
}

static void
tuba_dialogs_filter_edit_keyword_row_set_id (TubaDialogsFilterEditKeywordRow* self,
                                             const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_dialogs_filter_edit_keyword_row_get_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_id);
		self->priv->_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, tuba_dialogs_filter_edit_keyword_row_properties[TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_ID_PROPERTY]);
	}
}

static gboolean
tuba_dialogs_filter_edit_keyword_row_get_should_destroy (TubaDialogsFilterEditKeywordRow* self)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	result = self->priv->_should_destroy;
	return result;
}

static void
tuba_dialogs_filter_edit_keyword_row_set_should_destroy (TubaDialogsFilterEditKeywordRow* self,
                                                         gboolean value)
{
	gboolean old_value;
	g_return_if_fail (self != NULL);
	old_value = tuba_dialogs_filter_edit_keyword_row_get_should_destroy (self);
	if (old_value != value) {
		self->priv->_should_destroy = value;
		g_object_notify_by_pspec ((GObject *) self, tuba_dialogs_filter_edit_keyword_row_properties[TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_SHOULD_DESTROY_PROPERTY]);
	}
}

static gboolean
tuba_dialogs_filter_edit_keyword_row_get_whole_word (TubaDialogsFilterEditKeywordRow* self)
{
	gboolean result;
	GtkSwitch* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->word_switch;
	_tmp1_ = gtk_switch_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	result = _tmp2_;
	return result;
}

static const gchar*
tuba_dialogs_filter_edit_keyword_row_get_keyword (TubaDialogsFilterEditKeywordRow* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gtk_editable_get_text ((GtkEditable*) self);
	_tmp1_ = _tmp0_;
	result = _tmp1_;
	return result;
}

static void
_tuba_dialogs_filter_edit_keyword_row_on_delete_gtk_button_clicked (GtkButton* _sender,
                                                                    gpointer self)
{
	tuba_dialogs_filter_edit_keyword_row_on_delete ((TubaDialogsFilterEditKeywordRow*) self);
}

static GObject *
tuba_dialogs_filter_edit_keyword_row_constructor (GType type,
                                                  guint n_construct_properties,
                                                  GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaDialogsFilterEditKeywordRow * self;
	gchar* _tmp0_;
	GtkSwitch* _tmp1_ = NULL;
	GtkSwitch* _tmp2_;
	GtkButton* delete_btn = NULL;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar** _tmp6_;
	gchar* _tmp7_;
	GtkButton* _tmp8_ = NULL;
	GtkButton* _tmp9_;
	GtkButton* _tmp10_;
	parent_class = G_OBJECT_CLASS (tuba_dialogs_filter_edit_keyword_row_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_DIALOGS_FILTER_EDIT_TYPE_KEYWORD_ROW, TubaDialogsFilterEditKeywordRow);
	adw_preferences_row_set_title ((AdwPreferencesRow*) self, _ ("Keyword"));
	_tmp0_ = g_strdup (_ ("Match Whole Word"));
	_tmp1_ = (GtkSwitch*) gtk_switch_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp1_, GTK_ALIGN_CENTER);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp1_, _tmp0_);
	_g_free0 (_tmp0_);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->word_switch);
	self->priv->word_switch = _tmp1_;
	_tmp2_ = self->priv->word_switch;
	adw_entry_row_add_suffix ((AdwEntryRow*) self, (GtkWidget*) _tmp2_);
	adw_entry_row_set_activates_default ((AdwEntryRow*) self, FALSE);
	_tmp3_ = g_strdup ("circular");
	_tmp4_ = g_strdup ("flat");
	_tmp5_ = g_strdup ("error");
	_tmp6_ = g_new0 (gchar*, 3 + 1);
	_tmp6_[0] = _tmp3_;
	_tmp6_[1] = _tmp4_;
	_tmp6_[2] = _tmp5_;
	_tmp7_ = g_strdup (_ ("Delete"));
	_tmp8_ = (GtkButton*) gtk_button_new_from_icon_name ("user-trash-symbolic");
	gtk_widget_set_css_classes ((GtkWidget*) _tmp8_, _tmp6_);
	_tmp6_ = (_vala_array_free (_tmp6_, 3, (GDestroyNotify) g_free), NULL);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp8_, _tmp7_);
	_g_free0 (_tmp7_);
	gtk_widget_set_valign ((GtkWidget*) _tmp8_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp8_);
	delete_btn = _tmp8_;
	_tmp9_ = delete_btn;
	g_signal_connect_object (_tmp9_, "clicked", (GCallback) _tuba_dialogs_filter_edit_keyword_row_on_delete_gtk_button_clicked, self, 0);
	_tmp10_ = delete_btn;
	adw_entry_row_add_suffix ((AdwEntryRow*) self, (GtkWidget*) _tmp10_);
	_g_object_unref0 (delete_btn);
	return obj;
}

static void
tuba_dialogs_filter_edit_keyword_row_class_init (TubaDialogsFilterEditKeywordRowClass * klass,
                                                 gpointer klass_data)
{
	tuba_dialogs_filter_edit_keyword_row_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaDialogsFilterEditKeywordRow_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_dialogs_filter_edit_keyword_row_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_dialogs_filter_edit_keyword_row_set_property;
	G_OBJECT_CLASS (klass)->constructor = tuba_dialogs_filter_edit_keyword_row_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_dialogs_filter_edit_keyword_row_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_ID_PROPERTY, tuba_dialogs_filter_edit_keyword_row_properties[TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_ID_PROPERTY] = g_param_spec_string ("id", "id", "id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_SHOULD_DESTROY_PROPERTY, tuba_dialogs_filter_edit_keyword_row_properties[TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_SHOULD_DESTROY_PROPERTY] = g_param_spec_boolean ("should-destroy", "should-destroy", "should-destroy", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_WHOLE_WORD_PROPERTY, tuba_dialogs_filter_edit_keyword_row_properties[TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_WHOLE_WORD_PROPERTY] = g_param_spec_boolean ("whole-word", "whole-word", "whole-word", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_KEYWORD_PROPERTY, tuba_dialogs_filter_edit_keyword_row_properties[TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_KEYWORD_PROPERTY] = g_param_spec_string ("keyword", "keyword", "keyword", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
tuba_dialogs_filter_edit_keyword_row_instance_init (TubaDialogsFilterEditKeywordRow * self,
                                                    gpointer klass)
{
	self->priv = tuba_dialogs_filter_edit_keyword_row_get_instance_private (self);
	self->priv->_id = NULL;
	self->priv->_should_destroy = FALSE;
}

static void
tuba_dialogs_filter_edit_keyword_row_finalize (GObject * obj)
{
	TubaDialogsFilterEditKeywordRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_DIALOGS_FILTER_EDIT_TYPE_KEYWORD_ROW, TubaDialogsFilterEditKeywordRow);
	_g_free0 (self->priv->_id);
	_g_object_unref0 (self->priv->word_switch);
	G_OBJECT_CLASS (tuba_dialogs_filter_edit_keyword_row_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_dialogs_filter_edit_keyword_row_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaDialogsFilterEditKeywordRowClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_dialogs_filter_edit_keyword_row_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaDialogsFilterEditKeywordRow), 0, (GInstanceInitFunc) tuba_dialogs_filter_edit_keyword_row_instance_init, NULL };
	GType tuba_dialogs_filter_edit_keyword_row_type_id;
	tuba_dialogs_filter_edit_keyword_row_type_id = g_type_register_static (adw_entry_row_get_type (), "TubaDialogsFilterEditKeywordRow", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaDialogsFilterEditKeywordRow_private_offset = g_type_add_instance_private (tuba_dialogs_filter_edit_keyword_row_type_id, sizeof (TubaDialogsFilterEditKeywordRowPrivate));
	return tuba_dialogs_filter_edit_keyword_row_type_id;
}

static GType
tuba_dialogs_filter_edit_keyword_row_get_type (void)
{
	static GType tuba_dialogs_filter_edit_keyword_row_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_dialogs_filter_edit_keyword_row_type_id__once)) {
		GType tuba_dialogs_filter_edit_keyword_row_type_id;
		tuba_dialogs_filter_edit_keyword_row_type_id = tuba_dialogs_filter_edit_keyword_row_get_type_once ();
		g_once_init_leave_pointer (&tuba_dialogs_filter_edit_keyword_row_type_id__once, tuba_dialogs_filter_edit_keyword_row_type_id);
	}
	return tuba_dialogs_filter_edit_keyword_row_type_id__once;
}

static void
_vala_tuba_dialogs_filter_edit_keyword_row_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec)
{
	TubaDialogsFilterEditKeywordRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_DIALOGS_FILTER_EDIT_TYPE_KEYWORD_ROW, TubaDialogsFilterEditKeywordRow);
	switch (property_id) {
		case TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_ID_PROPERTY:
		g_value_set_string (value, tuba_dialogs_filter_edit_keyword_row_get_id (self));
		break;
		case TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_SHOULD_DESTROY_PROPERTY:
		g_value_set_boolean (value, tuba_dialogs_filter_edit_keyword_row_get_should_destroy (self));
		break;
		case TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_WHOLE_WORD_PROPERTY:
		g_value_set_boolean (value, tuba_dialogs_filter_edit_keyword_row_get_whole_word (self));
		break;
		case TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_KEYWORD_PROPERTY:
		g_value_set_string (value, tuba_dialogs_filter_edit_keyword_row_get_keyword (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_dialogs_filter_edit_keyword_row_set_property (GObject * object,
                                                         guint property_id,
                                                         const GValue * value,
                                                         GParamSpec * pspec)
{
	TubaDialogsFilterEditKeywordRow * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_DIALOGS_FILTER_EDIT_TYPE_KEYWORD_ROW, TubaDialogsFilterEditKeywordRow);
	switch (property_id) {
		case TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_ID_PROPERTY:
		tuba_dialogs_filter_edit_keyword_row_set_id (self, g_value_get_string (value));
		break;
		case TUBA_DIALOGS_FILTER_EDIT_KEYWORD_ROW_SHOULD_DESTROY_PROPERTY:
		tuba_dialogs_filter_edit_keyword_row_set_should_destroy (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
tuba_dialogs_filter_edit_context_row_copy (const TubaDialogsFilterEditContextRow* self,
                                           TubaDialogsFilterEditContextRow* dest)
{
	AdwSwitchRow* _tmp0_;
	AdwSwitchRow* _tmp1_;
	_tmp0_ = (*self).row;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 ((*dest).row);
	(*dest).row = _tmp1_;
	(*dest).ctx = (*self).ctx;
}

static void
tuba_dialogs_filter_edit_context_row_destroy (TubaDialogsFilterEditContextRow* self)
{
	_g_object_unref0 ((*self).row);
}

static TubaDialogsFilterEditContextRow*
tuba_dialogs_filter_edit_context_row_dup (const TubaDialogsFilterEditContextRow* self)
{
	TubaDialogsFilterEditContextRow* dup;
	dup = g_new0 (TubaDialogsFilterEditContextRow, 1);
	tuba_dialogs_filter_edit_context_row_copy (self, dup);
	return dup;
}

static void
tuba_dialogs_filter_edit_context_row_free (TubaDialogsFilterEditContextRow* self)
{
	tuba_dialogs_filter_edit_context_row_destroy (self);
	g_free (self);
}

 G_GNUC_NO_INLINE static GType
tuba_dialogs_filter_edit_context_row_get_type_once (void)
{
	GType tuba_dialogs_filter_edit_context_row_type_id;
	tuba_dialogs_filter_edit_context_row_type_id = g_boxed_type_register_static ("TubaDialogsFilterEditContextRow", (GBoxedCopyFunc) tuba_dialogs_filter_edit_context_row_dup, (GBoxedFreeFunc) tuba_dialogs_filter_edit_context_row_free);
	return tuba_dialogs_filter_edit_context_row_type_id;
}

static GType
tuba_dialogs_filter_edit_context_row_get_type (void)
{
	static GType tuba_dialogs_filter_edit_context_row_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_dialogs_filter_edit_context_row_type_id__once)) {
		GType tuba_dialogs_filter_edit_context_row_type_id;
		tuba_dialogs_filter_edit_context_row_type_id = tuba_dialogs_filter_edit_context_row_get_type_once ();
		g_once_init_leave_pointer (&tuba_dialogs_filter_edit_context_row_type_id__once, tuba_dialogs_filter_edit_context_row_type_id);
	}
	return tuba_dialogs_filter_edit_context_row_type_id__once;
}

static void
tuba_dialogs_filter_edit_class_init (TubaDialogsFilterEditClass * klass,
                                     gpointer klass_data)
{
	tuba_dialogs_filter_edit_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaDialogsFilterEdit_private_offset);
	G_OBJECT_CLASS (klass)->finalize = tuba_dialogs_filter_edit_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/dev/geopjr/Tuba/ui/dialogs/filter_edit.ui");
	tuba_dialogs_filter_edit_signals[TUBA_DIALOGS_FILTER_EDIT_SAVED_SIGNAL] = g_signal_new ("saved", TUBA_DIALOGS_TYPE_FILTER_EDIT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, TUBA_API_FILTERS_TYPE_FILTER);
	tuba_dialogs_filter_edit_signals[TUBA_DIALOGS_FILTER_EDIT_TOAST_SIGNAL] = g_signal_new ("toast", TUBA_DIALOGS_TYPE_FILTER_EDIT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__STRING_INT, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_INT);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "title_row", FALSE, TubaDialogsFilterEdit_private_offset + G_STRUCT_OFFSET (TubaDialogsFilterEditPrivate, title_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "expire_in_row", FALSE, TubaDialogsFilterEdit_private_offset + G_STRUCT_OFFSET (TubaDialogsFilterEditPrivate, expire_in_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "context_group", FALSE, TubaDialogsFilterEdit_private_offset + G_STRUCT_OFFSET (TubaDialogsFilterEditPrivate, context_group));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "keywords_group", FALSE, TubaDialogsFilterEdit_private_offset + G_STRUCT_OFFSET (TubaDialogsFilterEditPrivate, keywords_group));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "save_btn", FALSE, TubaDialogsFilterEdit_private_offset + G_STRUCT_OFFSET (TubaDialogsFilterEditPrivate, save_btn));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "hide_row", FALSE, TubaDialogsFilterEdit_private_offset + G_STRUCT_OFFSET (TubaDialogsFilterEditPrivate, hide_row));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_title_row_changed", G_CALLBACK(_tuba_dialogs_filter_edit_on_title_row_changed_gtk_editable_changed));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_close", G_CALLBACK(_tuba_dialogs_filter_edit_on_close_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_save_clicked", G_CALLBACK(_tuba_dialogs_filter_edit_on_save_clicked_gtk_button_clicked));
}

static void
tuba_dialogs_filter_edit_instance_init (TubaDialogsFilterEdit * self,
                                        gpointer klass)
{
	TubaDialogsFilterEditContextRow* _tmp0_;
	TubaDialogsFilterEditKeywordRow** _tmp1_;
	self->priv = tuba_dialogs_filter_edit_get_instance_private (self);
	self->priv->filter_id = NULL;
	_tmp0_ = g_new0 (TubaDialogsFilterEditContextRow, 0);
	self->priv->context_rows = _tmp0_;
	self->priv->context_rows_length1 = 0;
	self->priv->_context_rows_size_ = self->priv->context_rows_length1;
	_tmp1_ = g_new0 (TubaDialogsFilterEditKeywordRow*, 0 + 1);
	self->priv->keyword_rows = _tmp1_;
	self->priv->keyword_rows_length1 = 0;
	self->priv->_keyword_rows_size_ = self->priv->keyword_rows_length1;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
tuba_dialogs_filter_edit_finalize (GObject * obj)
{
	TubaDialogsFilterEdit * self;
	TubaDialogsFilterEditContextRow* _tmp0_;
	TubaDialogsFilterEditKeywordRow** _tmp1_;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_DIALOGS_TYPE_FILTER_EDIT, TubaDialogsFilterEdit);
	_tmp0_ = g_new0 (TubaDialogsFilterEditContextRow, 0);
	self->priv->context_rows = (_vala_TubaDialogsFilterEditContextRow_array_free (self->priv->context_rows, self->priv->context_rows_length1), NULL);
	self->priv->context_rows = _tmp0_;
	self->priv->context_rows_length1 = 0;
	self->priv->_context_rows_size_ = self->priv->context_rows_length1;
	_tmp1_ = g_new0 (TubaDialogsFilterEditKeywordRow*, 0 + 1);
	self->priv->keyword_rows = (_vala_array_free (self->priv->keyword_rows, self->priv->keyword_rows_length1, (GDestroyNotify) g_object_unref), NULL);
	self->priv->keyword_rows = _tmp1_;
	self->priv->keyword_rows_length1 = 0;
	self->priv->_keyword_rows_size_ = self->priv->keyword_rows_length1;
	g_debug ("FilterEdit.vala:79: Destroying FilterEdit");
	_g_object_unref0 (self->priv->filter_row);
	_g_free0 (self->priv->filter_id);
	self->priv->context_rows = (_vala_TubaDialogsFilterEditContextRow_array_free (self->priv->context_rows, self->priv->context_rows_length1), NULL);
	self->priv->keyword_rows = (_vala_array_free (self->priv->keyword_rows, self->priv->keyword_rows_length1, (GDestroyNotify) g_object_unref), NULL);
	G_OBJECT_CLASS (tuba_dialogs_filter_edit_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_dialogs_filter_edit_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaDialogsFilterEditClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_dialogs_filter_edit_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaDialogsFilterEdit), 0, (GInstanceInitFunc) tuba_dialogs_filter_edit_instance_init, NULL };
	GType tuba_dialogs_filter_edit_type_id;
	tuba_dialogs_filter_edit_type_id = g_type_register_static (adw_navigation_page_get_type (), "TubaDialogsFilterEdit", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaDialogsFilterEdit_private_offset = g_type_add_instance_private (tuba_dialogs_filter_edit_type_id, sizeof (TubaDialogsFilterEditPrivate));
	return tuba_dialogs_filter_edit_type_id;
}

GType
tuba_dialogs_filter_edit_get_type (void)
{
	static GType tuba_dialogs_filter_edit_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_dialogs_filter_edit_type_id__once)) {
		GType tuba_dialogs_filter_edit_type_id;
		tuba_dialogs_filter_edit_type_id = tuba_dialogs_filter_edit_get_type_once ();
		g_once_init_leave_pointer (&tuba_dialogs_filter_edit_type_id__once, tuba_dialogs_filter_edit_type_id);
	}
	return tuba_dialogs_filter_edit_type_id__once;
}

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);
}

