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

/*
 * Copyright © 2023 Alain M. (https://github.com/alainm23/planify)
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301 USA
 *
 * Authored by: Alain M. <alainmh23@gmail.com>
 */

#include "planify.h"
#include <gtk/gtk.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <glib-object.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>
#include <adwaita.h>
#include <gdk/gdk.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

enum  {
	WIDGETS_LABELS_PICKER_CORE_0_PROPERTY,
	WIDGETS_LABELS_PICKER_CORE_PICKER_TYPE_PROPERTY,
	WIDGETS_LABELS_PICKER_CORE_LABELS_PROPERTY,
	WIDGETS_LABELS_PICKER_CORE_SOURCE_PROPERTY,
	WIDGETS_LABELS_PICKER_CORE_IS_LOADING_PROPERTY,
	WIDGETS_LABELS_PICKER_CORE_NUM_PROPERTIES
};
static GParamSpec* widgets_labels_picker_core_properties[WIDGETS_LABELS_PICKER_CORE_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _Block33Data Block33Data;
#define _http_response_unref0(var) ((var == NULL) ? NULL : (var = (http_response_unref (var), NULL)))
typedef struct _Block34Data Block34Data;
#define _g_regex_unref0(var) ((var == NULL) ? NULL : (var = (g_regex_unref (var), NULL)))
enum  {
	WIDGETS_LABELS_PICKER_CORE_CLOSE_SIGNAL,
	WIDGETS_LABELS_PICKER_CORE_NUM_SIGNALS
};
static guint widgets_labels_picker_core_signals[WIDGETS_LABELS_PICKER_CORE_NUM_SIGNALS] = {0};

struct _WidgetsLabelsPickerCorePrivate {
	LabelPickerType _picker_type;
	GtkSearchEntry* search_entry;
	GtkListBox* listbox;
	GtkLabel* placeholder_message_label;
	GtkLabel* placeholder_title_label;
	GtkImage* placeholder_icon;
	GtkRevealer* add_tag_revealer;
	GtkRevealer* spinner_revealer;
	GtkRevealer* search_entry_revealer;
	GtkToggleButton* filter_button;
	gboolean hide_unused;
	ObjectsSource* _source;
	gchar* PLACEHOLDER_MESSAGE;
	gchar* PLACEHOLDER_CREATE_MESSAGE;
	GeeHashMap* signals_map;
};

struct _Block33Data {
	int _ref_count_;
	WidgetsLabelsPickerCore* self;
	ObjectsLabel* label;
};

struct _Block34Data {
	int _ref_count_;
	WidgetsLabelsPickerCore* self;
	gchar* search_text;
	gint size;
};

static gint WidgetsLabelsPickerCore_private_offset;
static gpointer widgets_labels_picker_core_parent_class = NULL;

static void widgets_labels_picker_core_add_assign_label (WidgetsLabelsPickerCore* self);
static Block33Data* block33_data_ref (Block33Data* _data33_);
static void block33_data_unref (void * _userdata_);
static void widgets_labels_picker_core_checked_toggled (WidgetsLabelsPickerCore* self,
                                                 ObjectsLabel* label,
                                                 gboolean active);
static void ____lambda260_ (Block33Data* _data33_,
                     GObject* obj,
                     GAsyncResult* res);
static void _____lambda260__gasync_ready_callback (GObject* source_object,
                                            GAsyncResult* res,
                                            gpointer self);
static void widgets_labels_picker_core_add_labels (WidgetsLabelsPickerCore* self,
                                            ObjectsSource* source);
static void _g_object_unref0_ (gpointer var);
static inline void _g_list_free__g_object_unref0_ (GList* self);
static void widgets_labels_picker_core_add_label (WidgetsLabelsPickerCore* self,
                                           ObjectsLabel* label);
static void _widgets_labels_picker_core_checked_toggled_widgets_label_picker_label_row_checked_toggled (WidgetsLabelPickerLabelRow* _sender,
                                                                                                 ObjectsLabel* label,
                                                                                                 gboolean active,
                                                                                                 gpointer self);
static GtkWidget* widgets_labels_picker_core_get_placeholder (WidgetsLabelsPickerCore* self);
static void widgets_labels_picker_core_invalidate_filter (WidgetsLabelsPickerCore* self);
static Block34Data* block34_data_ref (Block34Data* _data34_);
static void block34_data_unref (void * _userdata_);
static gboolean __lambda261_ (Block34Data* _data34_,
                       GtkListBoxRow* row);
static gboolean ___lambda261__gtk_list_box_filter_func (GtkListBoxRow* row,
                                                 gpointer self);
static GObject * widgets_labels_picker_core_constructor (GType type,
                                                  guint n_construct_properties,
                                                  GObjectConstructParam * construct_properties);
static gint _widgets_labels_picker_core___lambda262_ (WidgetsLabelsPickerCore* self,
                                               GtkListBoxRow* row1,
                                               GtkListBoxRow* row2);
static gint __widgets_labels_picker_core___lambda262__gtk_list_box_sort_func (GtkListBoxRow* row1,
                                                                       GtkListBoxRow* row2,
                                                                       gpointer self);
static gboolean _widgets_labels_picker_core___lambda263_ (WidgetsLabelsPickerCore* self,
                                                   guint keyval,
                                                   guint keycode,
                                                   GdkModifierType state);
static gboolean __widgets_labels_picker_core___lambda263__gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                                                         guint keyval,
                                                                                         guint keycode,
                                                                                         GdkModifierType state,
                                                                                         gpointer self);
static void _widgets_labels_picker_core___lambda264_ (WidgetsLabelsPickerCore* self);
static void __widgets_labels_picker_core___lambda264__gtk_search_entry_search_changed (GtkSearchEntry* _sender,
                                                                                gpointer self);
static void _widgets_labels_picker_core___lambda265_ (WidgetsLabelsPickerCore* self);
static void __widgets_labels_picker_core___lambda265__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                          gpointer self);
static void _widgets_labels_picker_core___lambda266_ (WidgetsLabelsPickerCore* self);
static void __widgets_labels_picker_core___lambda266__gtk_search_entry_activate (GtkSearchEntry* _sender,
                                                                          gpointer self);
static gboolean _widgets_labels_picker_core___lambda267_ (WidgetsLabelsPickerCore* self,
                                                   guint keyval,
                                                   guint keycode,
                                                   GdkModifierType state);
static gboolean __widgets_labels_picker_core___lambda267__gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                                                         guint keyval,
                                                                                         guint keycode,
                                                                                         GdkModifierType state,
                                                                                         gpointer self);
static void _widgets_labels_picker_core___lambda268_ (WidgetsLabelsPickerCore* self,
                                               ObjectsLabel* label);
static void __widgets_labels_picker_core___lambda268__services_store_label_added (ServicesStore* _sender,
                                                                           ObjectsLabel* label,
                                                                           gpointer self);
static void widgets_labels_picker_core_finalize (GObject * obj);
static GType widgets_labels_picker_core_get_type_once (void);
static void _vala_widgets_labels_picker_core_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec);
static void _vala_widgets_labels_picker_core_set_property (GObject * object,
                                                    guint property_id,
                                                    const GValue * value,
                                                    GParamSpec * pspec);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
widgets_labels_picker_core_get_instance_private (WidgetsLabelsPickerCore* self)
{
	return G_STRUCT_MEMBER_P (self, WidgetsLabelsPickerCore_private_offset);
}

WidgetsLabelsPickerCore*
widgets_labels_picker_core_construct (GType object_type,
                                      LabelPickerType picker_type)
{
	WidgetsLabelsPickerCore * self = NULL;
	self = (WidgetsLabelsPickerCore*) g_object_new (object_type, "picker-type", picker_type, NULL);
	return self;
}

WidgetsLabelsPickerCore*
widgets_labels_picker_core_new (LabelPickerType picker_type)
{
	return widgets_labels_picker_core_construct (WIDGETS_TYPE_LABELS_PICKER_CORE, picker_type);
}

static Block33Data*
block33_data_ref (Block33Data* _data33_)
{
	g_atomic_int_inc (&_data33_->_ref_count_);
	return _data33_;
}

static void
block33_data_unref (void * _userdata_)
{
	Block33Data* _data33_;
	_data33_ = (Block33Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data33_->_ref_count_)) {
		WidgetsLabelsPickerCore* self;
		self = _data33_->self;
		_g_object_unref0 (_data33_->label);
		_g_object_unref0 (self);
		g_slice_free (Block33Data, _data33_);
	}
}

static void
____lambda260_ (Block33Data* _data33_,
                GObject* obj,
                GAsyncResult* res)
{
	WidgetsLabelsPickerCore* self;
	HttpResponse* response = NULL;
	ServicesTodoist* _tmp0_;
	ServicesTodoist* _tmp1_;
	HttpResponse* _tmp2_;
	HttpResponse* _tmp3_;
	HttpResponse* _tmp4_;
	gboolean _tmp5_;
	gboolean _tmp6_;
	GtkSearchEntry* _tmp14_;
	self = _data33_->self;
	g_return_if_fail (res != NULL);
	_tmp0_ = services_todoist_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = services_todoist_add_finish (_tmp1_, res);
	_tmp3_ = _tmp2_;
	_g_object_unref0 (_tmp1_);
	response = _tmp3_;
	_tmp4_ = response;
	_tmp5_ = http_response_get_status (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_) {
		ObjectsLabel* _tmp7_;
		HttpResponse* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		ServicesStore* _tmp11_;
		ObjectsLabel* _tmp12_;
		ObjectsLabel* _tmp13_;
		_tmp7_ = _data33_->label;
		_tmp8_ = response;
		_tmp9_ = http_response_get_data (_tmp8_);
		_tmp10_ = _tmp9_;
		objects_base_object_set_id ((ObjectsBaseObject*) _tmp7_, _tmp10_);
		_tmp11_ = services_store_instance ();
		_tmp12_ = _data33_->label;
		services_store_insert_label (_tmp11_, _tmp12_);
		_tmp13_ = _data33_->label;
		widgets_labels_picker_core_checked_toggled (self, _tmp13_, TRUE);
	}
	g_signal_emit (self, widgets_labels_picker_core_signals[WIDGETS_LABELS_PICKER_CORE_CLOSE_SIGNAL], 0);
	widgets_labels_picker_core_set_is_loading (self, FALSE);
	_tmp14_ = self->priv->search_entry;
	gtk_editable_set_text ((GtkEditable*) _tmp14_, "");
	_http_response_unref0 (response);
}

static void
_____lambda260__gasync_ready_callback (GObject* source_object,
                                       GAsyncResult* res,
                                       gpointer self)
{
	____lambda260_ (self, source_object, res);
	block33_data_unref (self);
}

static void
widgets_labels_picker_core_add_assign_label (WidgetsLabelsPickerCore* self)
{
	Block33Data* _data33_;
	ObjectsLabel* _tmp0_;
	ObjectsLabel* _tmp1_;
	Util* _tmp2_;
	Util* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	ObjectsLabel* _tmp6_;
	GtkSearchEntry* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	ObjectsLabel* _tmp10_;
	ObjectsSource* _tmp11_;
	ObjectsSource* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	gboolean _tmp15_ = FALSE;
	ObjectsSource* _tmp16_;
	ObjectsSource* _tmp17_;
	SourceType _tmp18_;
	SourceType _tmp19_;
	g_return_if_fail (self != NULL);
	_data33_ = g_slice_new0 (Block33Data);
	_data33_->_ref_count_ = 1;
	_data33_->self = g_object_ref (self);
	_tmp0_ = objects_label_new ();
	_data33_->label = _tmp0_;
	_tmp1_ = _data33_->label;
	_tmp2_ = util_get_default ();
	_tmp3_ = _tmp2_;
	_tmp4_ = util_get_random_color (_tmp3_);
	_tmp5_ = _tmp4_;
	objects_base_object_set_color ((ObjectsBaseObject*) _tmp1_, _tmp5_);
	_g_free0 (_tmp5_);
	_g_object_unref0 (_tmp3_);
	_tmp6_ = _data33_->label;
	_tmp7_ = self->priv->search_entry;
	_tmp8_ = gtk_editable_get_text ((GtkEditable*) _tmp7_);
	_tmp9_ = _tmp8_;
	objects_base_object_set_name ((ObjectsBaseObject*) _tmp6_, _tmp9_);
	_tmp10_ = _data33_->label;
	_tmp11_ = widgets_labels_picker_core_get_source (self);
	_tmp12_ = _tmp11_;
	_tmp13_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp12_);
	_tmp14_ = _tmp13_;
	objects_label_set_source_id (_tmp10_, _tmp14_);
	_tmp16_ = widgets_labels_picker_core_get_source (self);
	_tmp17_ = _tmp16_;
	_tmp18_ = objects_source_get_source_type (_tmp17_);
	_tmp19_ = _tmp18_;
	if (_tmp19_ == SOURCE_TYPE_LOCAL) {
		_tmp15_ = TRUE;
	} else {
		ObjectsSource* _tmp20_;
		ObjectsSource* _tmp21_;
		SourceType _tmp22_;
		SourceType _tmp23_;
		_tmp20_ = widgets_labels_picker_core_get_source (self);
		_tmp21_ = _tmp20_;
		_tmp22_ = objects_source_get_source_type (_tmp21_);
		_tmp23_ = _tmp22_;
		_tmp15_ = _tmp23_ == SOURCE_TYPE_CALDAV;
	}
	if (_tmp15_) {
		ObjectsLabel* _tmp24_;
		Util* _tmp25_;
		Util* _tmp26_;
		ObjectsLabel* _tmp27_;
		gchar* _tmp28_;
		gchar* _tmp29_;
		ServicesStore* _tmp30_;
		ObjectsLabel* _tmp31_;
		ObjectsLabel* _tmp32_;
		GtkSearchEntry* _tmp33_;
		_tmp24_ = _data33_->label;
		_tmp25_ = util_get_default ();
		_tmp26_ = _tmp25_;
		_tmp27_ = _data33_->label;
		_tmp28_ = util_generate_id (_tmp26_, (ObjectsBaseObject*) _tmp27_);
		_tmp29_ = _tmp28_;
		objects_base_object_set_id ((ObjectsBaseObject*) _tmp24_, _tmp29_);
		_g_free0 (_tmp29_);
		_g_object_unref0 (_tmp26_);
		_tmp30_ = services_store_instance ();
		_tmp31_ = _data33_->label;
		services_store_insert_label (_tmp30_, _tmp31_);
		_tmp32_ = _data33_->label;
		widgets_labels_picker_core_checked_toggled (self, _tmp32_, TRUE);
		_tmp33_ = self->priv->search_entry;
		gtk_editable_set_text ((GtkEditable*) _tmp33_, "");
		g_signal_emit (self, widgets_labels_picker_core_signals[WIDGETS_LABELS_PICKER_CORE_CLOSE_SIGNAL], 0);
	} else {
		ObjectsSource* _tmp34_;
		ObjectsSource* _tmp35_;
		SourceType _tmp36_;
		SourceType _tmp37_;
		_tmp34_ = widgets_labels_picker_core_get_source (self);
		_tmp35_ = _tmp34_;
		_tmp36_ = objects_source_get_source_type (_tmp35_);
		_tmp37_ = _tmp36_;
		if (_tmp37_ == SOURCE_TYPE_TODOIST) {
			ServicesTodoist* _tmp38_;
			ServicesTodoist* _tmp39_;
			ObjectsLabel* _tmp40_;
			widgets_labels_picker_core_set_is_loading (self, TRUE);
			_tmp38_ = services_todoist_get_default ();
			_tmp39_ = _tmp38_;
			_tmp40_ = _data33_->label;
			services_todoist_add (_tmp39_, (ObjectsBaseObject*) _tmp40_, _____lambda260__gasync_ready_callback, block33_data_ref (_data33_));
			_g_object_unref0 (_tmp39_);
		}
	}
	block33_data_unref (_data33_);
	_data33_ = NULL;
}

static void
_g_object_unref0_ (gpointer var)
{
	(var == NULL) ? NULL : (var = (g_object_unref (var), NULL));
}

static inline void
_g_list_free__g_object_unref0_ (GList* self)
{
	g_list_free_full (self, (GDestroyNotify) _g_object_unref0_);
}

static void
widgets_labels_picker_core_add_labels (WidgetsLabelsPickerCore* self,
                                       ObjectsSource* source)
{
	GeeHashMap* _tmp0_;
	Util* _tmp1_;
	Util* _tmp2_;
	GtkListBox* _tmp3_;
	GList* _tmp4_;
	GList* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (source != NULL);
	_tmp0_ = self->labels_widgets_map;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp0_);
	_tmp1_ = util_get_default ();
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->listbox;
	_tmp4_ = util_get_children (_tmp2_, _tmp3_);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp2_);
	{
		GList* child_collection = NULL;
		GList* child_it = NULL;
		child_collection = _tmp5_;
		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
			GtkWidget* child = NULL;
			child = (GtkWidget*) ((GtkListBoxRow*) child_it->data);
			{
				GtkListBox* _tmp6_;
				GtkWidget* _tmp7_;
				_tmp6_ = self->priv->listbox;
				_tmp7_ = child;
				gtk_list_box_remove (_tmp6_, _tmp7_);
			}
		}
		(child_collection == NULL) ? NULL : (child_collection = (_g_list_free__g_object_unref0_ (child_collection), NULL));
	}
	{
		GeeArrayList* _label_list = NULL;
		ServicesStore* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		GeeArrayList* _tmp11_;
		gint _label_size = 0;
		GeeArrayList* _tmp12_;
		gint _tmp13_;
		gint _tmp14_;
		gint _label_index = 0;
		_tmp8_ = services_store_instance ();
		_tmp9_ = objects_base_object_get_id ((ObjectsBaseObject*) source);
		_tmp10_ = _tmp9_;
		_tmp11_ = services_store_get_labels_by_source (_tmp8_, _tmp10_);
		_label_list = _tmp11_;
		_tmp12_ = _label_list;
		_tmp13_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp12_);
		_tmp14_ = _tmp13_;
		_label_size = _tmp14_;
		_label_index = -1;
		while (TRUE) {
			gint _tmp15_;
			gint _tmp16_;
			ObjectsLabel* label = NULL;
			GeeArrayList* _tmp17_;
			gpointer _tmp18_;
			ObjectsLabel* _tmp19_;
			_label_index = _label_index + 1;
			_tmp15_ = _label_index;
			_tmp16_ = _label_size;
			if (!(_tmp15_ < _tmp16_)) {
				break;
			}
			_tmp17_ = _label_list;
			_tmp18_ = gee_abstract_list_get ((GeeAbstractList*) _tmp17_, _label_index);
			label = (ObjectsLabel*) _tmp18_;
			_tmp19_ = label;
			widgets_labels_picker_core_add_label (self, _tmp19_);
			_g_object_unref0 (label);
		}
		_g_object_unref0 (_label_list);
	}
}

static void
_widgets_labels_picker_core_checked_toggled_widgets_label_picker_label_row_checked_toggled (WidgetsLabelPickerLabelRow* _sender,
                                                                                            ObjectsLabel* label,
                                                                                            gboolean active,
                                                                                            gpointer self)
{
	widgets_labels_picker_core_checked_toggled ((WidgetsLabelsPickerCore*) self, label, active);
}

static void
widgets_labels_picker_core_add_label (WidgetsLabelsPickerCore* self,
                                      ObjectsLabel* label)
{
	GeeHashMap* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	WidgetsLabelPickerLabelRow* _tmp3_;
	WidgetsLabelPickerLabelRow* _tmp4_;
	GeeHashMap* _tmp5_;
	GeeHashMap* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	gpointer _tmp9_;
	WidgetsLabelPickerLabelRow* _tmp10_;
	gulong _tmp11_;
	GeeHashMap* _tmp12_;
	const gchar* _tmp13_;
	const gchar* _tmp14_;
	gpointer _tmp15_;
	WidgetsLabelPickerLabelRow* _tmp16_;
	GtkListBox* _tmp17_;
	GeeHashMap* _tmp18_;
	const gchar* _tmp19_;
	const gchar* _tmp20_;
	gpointer _tmp21_;
	WidgetsLabelPickerLabelRow* _tmp22_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (label != NULL);
	_tmp0_ = self->labels_widgets_map;
	_tmp1_ = objects_base_object_get_id ((ObjectsBaseObject*) label);
	_tmp2_ = _tmp1_;
	_tmp3_ = widgets_label_picker_label_row_new (label);
	g_object_ref_sink (_tmp3_);
	_tmp4_ = _tmp3_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp0_, _tmp2_, _tmp4_);
	_g_object_unref0 (_tmp4_);
	_tmp5_ = self->priv->signals_map;
	_tmp6_ = self->labels_widgets_map;
	_tmp7_ = objects_base_object_get_id ((ObjectsBaseObject*) label);
	_tmp8_ = _tmp7_;
	_tmp9_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp6_, _tmp8_);
	_tmp10_ = (WidgetsLabelPickerLabelRow*) _tmp9_;
	_tmp11_ = g_signal_connect_object (_tmp10_, "checked-toggled", (GCallback) _widgets_labels_picker_core_checked_toggled_widgets_label_picker_label_row_checked_toggled, self, 0);
	_tmp12_ = self->labels_widgets_map;
	_tmp13_ = objects_base_object_get_id ((ObjectsBaseObject*) label);
	_tmp14_ = _tmp13_;
	_tmp15_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp12_, _tmp14_);
	_tmp16_ = (WidgetsLabelPickerLabelRow*) _tmp15_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp5_, (gpointer) ((guintptr) _tmp11_), (GObject*) _tmp16_);
	_g_object_unref0 (_tmp16_);
	_g_object_unref0 (_tmp10_);
	_tmp17_ = self->priv->listbox;
	_tmp18_ = self->labels_widgets_map;
	_tmp19_ = objects_base_object_get_id ((ObjectsBaseObject*) label);
	_tmp20_ = _tmp19_;
	_tmp21_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp18_, _tmp20_);
	_tmp22_ = (WidgetsLabelPickerLabelRow*) _tmp21_;
	gtk_list_box_append (_tmp17_, (GtkWidget*) _tmp22_);
	_g_object_unref0 (_tmp22_);
}

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

static GtkWidget*
widgets_labels_picker_core_get_placeholder (WidgetsLabelsPickerCore* self)
{
	gchar* _tmp0_;
	gchar** _tmp1_;
	GtkImage* _tmp2_ = NULL;
	GtkImage* _tmp3_;
	GtkWidget* _tmp4_;
	GtkRevealer* _tmp5_ = NULL;
	gchar* _tmp6_;
	gchar** _tmp7_;
	GtkLabel* _tmp8_ = NULL;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar** _tmp12_;
	GtkLabel* _tmp13_ = NULL;
	AdwSpinner* spinner = NULL;
	gchar* _tmp14_;
	gchar** _tmp15_;
	AdwSpinner* _tmp16_ = NULL;
	GtkWidget* _tmp17_;
	GtkRevealer* _tmp18_ = NULL;
	GtkBox* box = NULL;
	GtkBox* _tmp19_ = NULL;
	GtkRevealer* _tmp20_;
	GtkLabel* _tmp21_;
	GtkLabel* _tmp22_;
	GtkRevealer* _tmp23_;
	GtkWidget* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup ("dimmed");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = (GtkImage*) gtk_image_new_from_icon_name ("tag-outline-add-symbolic");
	gtk_image_set_pixel_size (_tmp2_, 32);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp2_, 12);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp2_, _tmp1_);
	_tmp1_ = (_vala_array_free (_tmp1_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->placeholder_icon);
	self->priv->placeholder_icon = _tmp2_;
	_tmp3_ = self->priv->placeholder_icon;
	_tmp4_ = _g_object_ref0 ((GtkWidget*) _tmp3_);
	_tmp5_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp5_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP);
	gtk_revealer_set_child (_tmp5_, _tmp4_);
	_g_object_unref0 (_tmp4_);
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (self->priv->add_tag_revealer);
	self->priv->add_tag_revealer = _tmp5_;
	_tmp6_ = g_strdup ("title-4");
	_tmp7_ = g_new0 (gchar*, 1 + 1);
	_tmp7_[0] = _tmp6_;
	_tmp8_ = (GtkLabel*) gtk_label_new (_ ("No Labels"));
	gtk_widget_set_css_classes ((GtkWidget*) _tmp8_, _tmp7_);
	_tmp7_ = (_vala_array_free (_tmp7_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp8_);
	_g_object_unref0 (self->priv->placeholder_title_label);
	self->priv->placeholder_title_label = _tmp8_;
	_tmp9_ = self->priv->PLACEHOLDER_MESSAGE;
	_tmp10_ = g_strdup ("dimmed");
	_tmp11_ = g_strdup ("caption");
	_tmp12_ = g_new0 (gchar*, 2 + 1);
	_tmp12_[0] = _tmp10_;
	_tmp12_[1] = _tmp11_;
	_tmp13_ = (GtkLabel*) gtk_label_new (_tmp9_);
	gtk_label_set_wrap (_tmp13_, TRUE);
	gtk_label_set_justify (_tmp13_, GTK_JUSTIFY_CENTER);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp13_, _tmp12_);
	_tmp12_ = (_vala_array_free (_tmp12_, 2, (GDestroyNotify) g_free), NULL);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp13_, 4);
	g_object_ref_sink (_tmp13_);
	_g_object_unref0 (self->priv->placeholder_message_label);
	self->priv->placeholder_message_label = _tmp13_;
	_tmp14_ = g_strdup ("text-color");
	_tmp15_ = g_new0 (gchar*, 1 + 1);
	_tmp15_[0] = _tmp14_;
	_tmp16_ = (AdwSpinner*) adw_spinner_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp16_, GTK_ALIGN_CENTER);
	gtk_widget_set_halign ((GtkWidget*) _tmp16_, GTK_ALIGN_CENTER);
	g_object_set ((GtkWidget*) _tmp16_, "height-request", 24, NULL);
	g_object_set ((GtkWidget*) _tmp16_, "width-request", 24, NULL);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp16_, 12);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp16_, _tmp15_);
	_tmp15_ = (_vala_array_free (_tmp15_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp16_);
	spinner = _tmp16_;
	_tmp17_ = _g_object_ref0 ((GtkWidget*) spinner);
	_tmp18_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp18_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP);
	gtk_revealer_set_child (_tmp18_, _tmp17_);
	_g_object_unref0 (_tmp17_);
	g_object_ref_sink (_tmp18_);
	_g_object_unref0 (self->priv->spinner_revealer);
	self->priv->spinner_revealer = _tmp18_;
	_tmp19_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	gtk_widget_set_valign ((GtkWidget*) _tmp19_, GTK_ALIGN_CENTER);
	gtk_widget_set_halign ((GtkWidget*) _tmp19_, GTK_ALIGN_CENTER);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp19_, 24);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp19_, 24);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp19_, 24);
	g_object_ref_sink (_tmp19_);
	box = _tmp19_;
	_tmp20_ = self->priv->add_tag_revealer;
	gtk_box_append (box, (GtkWidget*) _tmp20_);
	_tmp21_ = self->priv->placeholder_title_label;
	gtk_box_append (box, (GtkWidget*) _tmp21_);
	_tmp22_ = self->priv->placeholder_message_label;
	gtk_box_append (box, (GtkWidget*) _tmp22_);
	_tmp23_ = self->priv->spinner_revealer;
	gtk_box_append (box, (GtkWidget*) _tmp23_);
	result = (GtkWidget*) box;
	_g_object_unref0 (spinner);
	return result;
}

static void
widgets_labels_picker_core_checked_toggled (WidgetsLabelsPickerCore* self,
                                            ObjectsLabel* label,
                                            gboolean active)
{
	g_return_if_fail (self != NULL);
	g_return_if_fail (label != NULL);
	if (active) {
		GeeHashMap* _tmp0_;
		const gchar* _tmp1_;
		const gchar* _tmp2_;
		_tmp0_ = self->picked;
		_tmp1_ = objects_base_object_get_id ((ObjectsBaseObject*) label);
		_tmp2_ = _tmp1_;
		if (!gee_abstract_map_has_key ((GeeAbstractMap*) _tmp0_, _tmp2_)) {
			GeeHashMap* _tmp3_;
			const gchar* _tmp4_;
			const gchar* _tmp5_;
			_tmp3_ = self->picked;
			_tmp4_ = objects_base_object_get_id ((ObjectsBaseObject*) label);
			_tmp5_ = _tmp4_;
			gee_abstract_map_set ((GeeAbstractMap*) _tmp3_, _tmp5_, label);
		}
	} else {
		GeeHashMap* _tmp6_;
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		_tmp6_ = self->picked;
		_tmp7_ = objects_base_object_get_id ((ObjectsBaseObject*) label);
		_tmp8_ = _tmp7_;
		if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp6_, _tmp8_)) {
			GeeHashMap* _tmp9_;
			const gchar* _tmp10_;
			const gchar* _tmp11_;
			_tmp9_ = self->picked;
			_tmp10_ = objects_base_object_get_id ((ObjectsBaseObject*) label);
			_tmp11_ = _tmp10_;
			gee_abstract_map_unset ((GeeAbstractMap*) _tmp9_, _tmp11_, NULL);
		}
	}
}

static Block34Data*
block34_data_ref (Block34Data* _data34_)
{
	g_atomic_int_inc (&_data34_->_ref_count_);
	return _data34_;
}

static void
block34_data_unref (void * _userdata_)
{
	Block34Data* _data34_;
	_data34_ = (Block34Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data34_->_ref_count_)) {
		WidgetsLabelsPickerCore* self;
		self = _data34_->self;
		_g_free0 (_data34_->search_text);
		_g_object_unref0 (self);
		g_slice_free (Block34Data, _data34_);
	}
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static gboolean
__lambda261_ (Block34Data* _data34_,
              GtkListBoxRow* row)
{
	WidgetsLabelsPickerCore* self;
	ObjectsLabel* label = NULL;
	ObjectsLabel* _tmp0_;
	ObjectsLabel* _tmp1_;
	ObjectsLabel* _tmp2_;
	gboolean _tmp3_ = FALSE;
	gboolean matches_search = FALSE;
	ObjectsLabel* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	const gchar* _tmp12_;
	gboolean _tmp13_;
	gboolean result;
	self = _data34_->self;
	g_return_val_if_fail (row != NULL, FALSE);
	_tmp0_ = widgets_label_picker_label_row_get_label (G_TYPE_CHECK_INSTANCE_CAST (row, WIDGETS_LABEL_PICKER_TYPE_LABEL_ROW, WidgetsLabelPickerLabelRow));
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	label = _tmp2_;
	if (self->priv->hide_unused) {
		ObjectsLabel* _tmp4_;
		gint _tmp5_;
		gint _tmp6_;
		_tmp4_ = label;
		_tmp5_ = objects_label_get_label_count (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp3_ = _tmp6_ <= 0;
	} else {
		_tmp3_ = FALSE;
	}
	if (_tmp3_) {
		result = FALSE;
		_g_object_unref0 (label);
		return result;
	}
	_tmp7_ = label;
	_tmp8_ = objects_base_object_get_name ((ObjectsBaseObject*) _tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = g_utf8_strdown (_tmp9_, (gssize) -1);
	_tmp11_ = _tmp10_;
	_tmp12_ = _data34_->search_text;
	_tmp13_ = string_contains (_tmp11_, _tmp12_);
	_g_free0 (_tmp11_);
	matches_search = _tmp13_;
	if (matches_search) {
		gint _tmp14_;
		_tmp14_ = _data34_->size;
		_data34_->size = _tmp14_ + 1;
	}
	result = matches_search;
	_g_object_unref0 (label);
	return result;
}

static gboolean
___lambda261__gtk_list_box_filter_func (GtkListBoxRow* row,
                                        gpointer self)
{
	gboolean result;
	result = __lambda261_ (self, row);
	return result;
}

static void
widgets_labels_picker_core_invalidate_filter (WidgetsLabelsPickerCore* self)
{
	Block34Data* _data34_;
	GtkSearchEntry* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	GtkListBox* _tmp4_;
	LabelPickerType _tmp5_;
	g_return_if_fail (self != NULL);
	_data34_ = g_slice_new0 (Block34Data);
	_data34_->_ref_count_ = 1;
	_data34_->self = g_object_ref (self);
	_tmp0_ = self->priv->search_entry;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_utf8_strdown (_tmp2_, (gssize) -1);
	_data34_->search_text = _tmp3_;
	_data34_->size = 0;
	_tmp4_ = self->priv->listbox;
	gtk_list_box_set_filter_func (_tmp4_, ___lambda261__gtk_list_box_filter_func, block34_data_ref (_data34_), block34_data_unref);
	_tmp5_ = self->priv->_picker_type;
	if (_tmp5_ == LABEL_PICKER_TYPE_FILTER_AND_CREATE) {
		gboolean _tmp6_ = FALSE;
		gboolean _tmp7_ = FALSE;
		if (self->priv->hide_unused) {
			_tmp7_ = _data34_->size <= 0;
		} else {
			_tmp7_ = FALSE;
		}
		if (_tmp7_) {
			const gchar* _tmp8_;
			gint _tmp9_;
			gint _tmp10_;
			_tmp8_ = _data34_->search_text;
			_tmp9_ = strlen (_tmp8_);
			_tmp10_ = _tmp9_;
			_tmp6_ = _tmp10_ == 0;
		} else {
			_tmp6_ = FALSE;
		}
		if (_tmp6_) {
			GtkImage* _tmp11_;
			GtkRevealer* _tmp12_;
			GtkLabel* _tmp13_;
			GtkLabel* _tmp14_;
			_tmp11_ = self->priv->placeholder_icon;
			g_object_set (_tmp11_, "icon-name", "funnel-outline-symbolic", NULL);
			_tmp12_ = self->priv->add_tag_revealer;
			gtk_revealer_set_reveal_child (_tmp12_, TRUE);
			_tmp13_ = self->priv->placeholder_title_label;
			gtk_label_set_label (_tmp13_, _ ("All Hidden"));
			_tmp14_ = self->priv->placeholder_message_label;
			gtk_label_set_label (_tmp14_, _ ("All labels are hidden by the filter. Disable the filter to see them."));
		} else {
			if (_data34_->size <= 0) {
				GtkImage* _tmp15_;
				GtkRevealer* _tmp16_;
				GtkLabel* _tmp17_;
				const gchar* _tmp18_;
				GtkSearchEntry* _tmp19_;
				const gchar* _tmp20_;
				const gchar* _tmp21_;
				gchar* _tmp22_;
				gchar* _tmp23_;
				GtkLabel* _tmp24_;
				_tmp15_ = self->priv->placeholder_icon;
				g_object_set (_tmp15_, "icon-name", "tag-outline-add-symbolic", NULL);
				_tmp16_ = self->priv->add_tag_revealer;
				gtk_revealer_set_reveal_child (_tmp16_, TRUE);
				_tmp17_ = self->priv->placeholder_title_label;
				_tmp18_ = self->priv->PLACEHOLDER_CREATE_MESSAGE;
				_tmp19_ = self->priv->search_entry;
				_tmp20_ = gtk_editable_get_text ((GtkEditable*) _tmp19_);
				_tmp21_ = _tmp20_;
				_tmp22_ = g_strdup_printf (_tmp18_, _tmp21_);
				_tmp23_ = _tmp22_;
				gtk_label_set_label (_tmp17_, _tmp23_);
				_g_free0 (_tmp23_);
				_tmp24_ = self->priv->placeholder_message_label;
				gtk_label_set_label (_tmp24_, _ ("Press Enter to create and assign it"));
			} else {
				GtkLabel* _tmp25_;
				GtkLabel* _tmp26_;
				const gchar* _tmp27_;
				GtkRevealer* _tmp28_;
				_tmp25_ = self->priv->placeholder_title_label;
				gtk_label_set_label (_tmp25_, _ ("No Labels"));
				_tmp26_ = self->priv->placeholder_message_label;
				_tmp27_ = self->priv->PLACEHOLDER_MESSAGE;
				gtk_label_set_label (_tmp26_, _tmp27_);
				_tmp28_ = self->priv->add_tag_revealer;
				gtk_revealer_set_reveal_child (_tmp28_, FALSE);
			}
		}
	}
	block34_data_unref (_data34_);
	_data34_ = NULL;
}

void
widgets_labels_picker_core_reset (WidgetsLabelsPickerCore* self)
{
	GeeHashMap* _tmp15_;
	g_return_if_fail (self != NULL);
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp0_;
		GeeSet* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
		_tmp0_ = self->labels_widgets_map;
		_tmp1_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_entry_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp7_;
			gpointer _tmp8_;
			GeeHashMap* _tmp9_;
			GeeMapEntry* _tmp10_;
			gconstpointer _tmp11_;
			gconstpointer _tmp12_;
			gpointer _tmp13_;
			WidgetsLabelPickerLabelRow* _tmp14_;
			_tmp6_ = _entry_it;
			if (!gee_iterator_next (_tmp6_)) {
				break;
			}
			_tmp7_ = _entry_it;
			_tmp8_ = gee_iterator_get (_tmp7_);
			entry = (GeeMapEntry*) _tmp8_;
			_tmp9_ = self->labels_widgets_map;
			_tmp10_ = entry;
			_tmp11_ = gee_map_entry_get_key (_tmp10_);
			_tmp12_ = _tmp11_;
			_tmp13_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp9_, (const gchar*) _tmp12_);
			_tmp14_ = (WidgetsLabelPickerLabelRow*) _tmp13_;
			widgets_label_picker_label_row_set_active (_tmp14_, FALSE);
			_g_object_unref0 (_tmp14_);
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	_tmp15_ = self->labels_widgets_map;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp15_);
}

void
widgets_labels_picker_core_add_labels_list (WidgetsLabelsPickerCore* self,
                                            GeeArrayList* labels_list)
{
	GeeHashMap* _tmp0_;
	Util* _tmp1_;
	Util* _tmp2_;
	GtkListBox* _tmp3_;
	GList* _tmp4_;
	GList* _tmp5_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (labels_list != NULL);
	_tmp0_ = self->labels_widgets_map;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp0_);
	_tmp1_ = util_get_default ();
	_tmp2_ = _tmp1_;
	_tmp3_ = self->priv->listbox;
	_tmp4_ = util_get_children (_tmp2_, _tmp3_);
	_tmp5_ = _tmp4_;
	_g_object_unref0 (_tmp2_);
	{
		GList* child_collection = NULL;
		GList* child_it = NULL;
		child_collection = _tmp5_;
		for (child_it = child_collection; child_it != NULL; child_it = child_it->next) {
			GtkWidget* child = NULL;
			child = (GtkWidget*) ((GtkListBoxRow*) child_it->data);
			{
				GtkListBox* _tmp6_;
				GtkWidget* _tmp7_;
				_tmp6_ = self->priv->listbox;
				_tmp7_ = child;
				gtk_list_box_remove (_tmp6_, _tmp7_);
			}
		}
		(child_collection == NULL) ? NULL : (child_collection = (_g_list_free__g_object_unref0_ (child_collection), NULL));
	}
	{
		GeeArrayList* _label_list = NULL;
		gint _label_size = 0;
		GeeArrayList* _tmp8_;
		gint _tmp9_;
		gint _tmp10_;
		gint _label_index = 0;
		_label_list = labels_list;
		_tmp8_ = _label_list;
		_tmp9_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp8_);
		_tmp10_ = _tmp9_;
		_label_size = _tmp10_;
		_label_index = -1;
		while (TRUE) {
			gint _tmp11_;
			gint _tmp12_;
			ObjectsLabel* label = NULL;
			GeeArrayList* _tmp13_;
			gpointer _tmp14_;
			ObjectsLabel* _tmp15_;
			_label_index = _label_index + 1;
			_tmp11_ = _label_index;
			_tmp12_ = _label_size;
			if (!(_tmp11_ < _tmp12_)) {
				break;
			}
			_tmp13_ = _label_list;
			_tmp14_ = gee_abstract_list_get ((GeeAbstractList*) _tmp13_, _label_index);
			label = (ObjectsLabel*) _tmp14_;
			_tmp15_ = label;
			widgets_labels_picker_core_add_label (self, _tmp15_);
			_g_object_unref0 (label);
		}
	}
}

void
widgets_labels_picker_core_clean_up (WidgetsLabelsPickerCore* self)
{
	GtkListBox* _tmp0_;
	GtkListBox* _tmp1_;
	GeeHashMap* _tmp32_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->listbox;
	gtk_list_box_set_sort_func (_tmp0_, NULL, NULL, NULL);
	_tmp1_ = self->priv->listbox;
	gtk_list_box_set_filter_func (_tmp1_, NULL, NULL, NULL);
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp2_;
		GeeSet* _tmp3_;
		GeeSet* _tmp4_;
		GeeSet* _tmp5_;
		GeeIterator* _tmp6_;
		GeeIterator* _tmp7_;
		_tmp2_ = self->labels_widgets_map;
		_tmp3_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp2_);
		_tmp4_ = _tmp3_;
		_tmp5_ = _tmp4_;
		_tmp6_ = gee_iterable_iterator ((GeeIterable*) _tmp5_);
		_tmp7_ = _tmp6_;
		_g_object_unref0 (_tmp5_);
		_entry_it = _tmp7_;
		while (TRUE) {
			GeeIterator* _tmp8_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp9_;
			gpointer _tmp10_;
			GeeHashMap* _tmp11_;
			GeeMapEntry* _tmp12_;
			gconstpointer _tmp13_;
			gconstpointer _tmp14_;
			gpointer _tmp15_;
			WidgetsLabelPickerLabelRow* _tmp16_;
			_tmp8_ = _entry_it;
			if (!gee_iterator_next (_tmp8_)) {
				break;
			}
			_tmp9_ = _entry_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			entry = (GeeMapEntry*) _tmp10_;
			_tmp11_ = self->labels_widgets_map;
			_tmp12_ = entry;
			_tmp13_ = gee_map_entry_get_key (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp11_, (const gchar*) _tmp14_);
			_tmp16_ = (WidgetsLabelPickerLabelRow*) _tmp15_;
			widgets_label_picker_label_row_clean_up (_tmp16_);
			_g_object_unref0 (_tmp16_);
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp17_;
		GeeSet* _tmp18_;
		GeeSet* _tmp19_;
		GeeSet* _tmp20_;
		GeeIterator* _tmp21_;
		GeeIterator* _tmp22_;
		_tmp17_ = self->priv->signals_map;
		_tmp18_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = _tmp19_;
		_tmp21_ = gee_iterable_iterator ((GeeIterable*) _tmp20_);
		_tmp22_ = _tmp21_;
		_g_object_unref0 (_tmp20_);
		_entry_it = _tmp22_;
		while (TRUE) {
			GeeIterator* _tmp23_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp24_;
			gpointer _tmp25_;
			GeeMapEntry* _tmp26_;
			gconstpointer _tmp27_;
			gconstpointer _tmp28_;
			GeeMapEntry* _tmp29_;
			gconstpointer _tmp30_;
			gconstpointer _tmp31_;
			_tmp23_ = _entry_it;
			if (!gee_iterator_next (_tmp23_)) {
				break;
			}
			_tmp24_ = _entry_it;
			_tmp25_ = gee_iterator_get (_tmp24_);
			entry = (GeeMapEntry*) _tmp25_;
			_tmp26_ = entry;
			_tmp27_ = gee_map_entry_get_value (_tmp26_);
			_tmp28_ = _tmp27_;
			_tmp29_ = entry;
			_tmp30_ = gee_map_entry_get_key (_tmp29_);
			_tmp31_ = _tmp30_;
			g_signal_handler_disconnect ((GObject*) _tmp28_, (gulong) ((guintptr) _tmp31_));
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	_tmp32_ = self->priv->signals_map;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp32_);
}

LabelPickerType
widgets_labels_picker_core_get_picker_type (WidgetsLabelsPickerCore* self)
{
	LabelPickerType result;
	g_return_val_if_fail (self != NULL, 0);
	result = self->priv->_picker_type;
	return result;
}

static void
widgets_labels_picker_core_set_picker_type (WidgetsLabelsPickerCore* self,
                                            LabelPickerType value)
{
	LabelPickerType old_value;
	g_return_if_fail (self != NULL);
	old_value = widgets_labels_picker_core_get_picker_type (self);
	if (old_value != value) {
		self->priv->_picker_type = value;
		g_object_notify_by_pspec ((GObject *) self, widgets_labels_picker_core_properties[WIDGETS_LABELS_PICKER_CORE_PICKER_TYPE_PROPERTY]);
	}
}

void
widgets_labels_picker_core_set_labels (WidgetsLabelsPickerCore* self,
                                       GeeArrayList* value)
{
	GeeHashMap* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->picked;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp0_);
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeSet* _tmp4_;
		GeeIterator* _tmp5_;
		GeeIterator* _tmp6_;
		_tmp1_ = self->labels_widgets_map;
		_tmp2_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_entry_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp8_;
			gpointer _tmp9_;
			GeeMapEntry* _tmp10_;
			gconstpointer _tmp11_;
			gconstpointer _tmp12_;
			_tmp7_ = _entry_it;
			if (!gee_iterator_next (_tmp7_)) {
				break;
			}
			_tmp8_ = _entry_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			entry = (GeeMapEntry*) _tmp9_;
			_tmp10_ = entry;
			_tmp11_ = gee_map_entry_get_value (_tmp10_);
			_tmp12_ = _tmp11_;
			widgets_label_picker_label_row_set_active ((WidgetsLabelPickerLabelRow*) _tmp12_, FALSE);
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	{
		GeeArrayList* _label_list = NULL;
		gint _label_size = 0;
		GeeArrayList* _tmp13_;
		gint _tmp14_;
		gint _tmp15_;
		gint _label_index = 0;
		_label_list = value;
		_tmp13_ = _label_list;
		_tmp14_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp13_);
		_tmp15_ = _tmp14_;
		_label_size = _tmp15_;
		_label_index = -1;
		while (TRUE) {
			gint _tmp16_;
			gint _tmp17_;
			ObjectsLabel* label = NULL;
			GeeArrayList* _tmp18_;
			gpointer _tmp19_;
			GeeHashMap* _tmp20_;
			ObjectsLabel* _tmp21_;
			const gchar* _tmp22_;
			const gchar* _tmp23_;
			GeeHashMap* _tmp30_;
			ObjectsLabel* _tmp31_;
			const gchar* _tmp32_;
			const gchar* _tmp33_;
			ObjectsLabel* _tmp34_;
			_label_index = _label_index + 1;
			_tmp16_ = _label_index;
			_tmp17_ = _label_size;
			if (!(_tmp16_ < _tmp17_)) {
				break;
			}
			_tmp18_ = _label_list;
			_tmp19_ = gee_abstract_list_get ((GeeAbstractList*) _tmp18_, _label_index);
			label = (ObjectsLabel*) _tmp19_;
			_tmp20_ = self->labels_widgets_map;
			_tmp21_ = label;
			_tmp22_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp21_);
			_tmp23_ = _tmp22_;
			if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp20_, _tmp23_)) {
				GeeHashMap* _tmp24_;
				ObjectsLabel* _tmp25_;
				const gchar* _tmp26_;
				const gchar* _tmp27_;
				gpointer _tmp28_;
				WidgetsLabelPickerLabelRow* _tmp29_;
				_tmp24_ = self->labels_widgets_map;
				_tmp25_ = label;
				_tmp26_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp25_);
				_tmp27_ = _tmp26_;
				_tmp28_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp24_, _tmp27_);
				_tmp29_ = (WidgetsLabelPickerLabelRow*) _tmp28_;
				widgets_label_picker_label_row_set_active (_tmp29_, TRUE);
				_g_object_unref0 (_tmp29_);
			}
			_tmp30_ = self->picked;
			_tmp31_ = label;
			_tmp32_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp31_);
			_tmp33_ = _tmp32_;
			_tmp34_ = label;
			gee_abstract_map_set ((GeeAbstractMap*) _tmp30_, _tmp33_, _tmp34_);
			_g_object_unref0 (label);
		}
	}
	g_object_notify_by_pspec ((GObject *) self, widgets_labels_picker_core_properties[WIDGETS_LABELS_PICKER_CORE_LABELS_PROPERTY]);
}

ObjectsSource*
widgets_labels_picker_core_get_source (WidgetsLabelsPickerCore* self)
{
	ObjectsSource* result;
	ObjectsSource* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_source;
	result = _tmp0_;
	return result;
}

void
widgets_labels_picker_core_set_source (WidgetsLabelsPickerCore* self,
                                       ObjectsSource* value)
{
	ObjectsSource* _tmp0_;
	ObjectsSource* _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_source);
	self->priv->_source = _tmp0_;
	_tmp1_ = self->priv->_source;
	widgets_labels_picker_core_add_labels (self, _tmp1_);
	g_object_notify_by_pspec ((GObject *) self, widgets_labels_picker_core_properties[WIDGETS_LABELS_PICKER_CORE_SOURCE_PROPERTY]);
}

void
widgets_labels_picker_core_set_is_loading (WidgetsLabelsPickerCore* self,
                                           gboolean value)
{
	GtkRevealer* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->spinner_revealer;
	gtk_revealer_set_reveal_child (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, widgets_labels_picker_core_properties[WIDGETS_LABELS_PICKER_CORE_IS_LOADING_PROPERTY]);
}

static gint
_widgets_labels_picker_core___lambda262_ (WidgetsLabelsPickerCore* self,
                                          GtkListBoxRow* row1,
                                          GtkListBoxRow* row2)
{
	ObjectsLabel* item1 = NULL;
	ObjectsLabel* _tmp0_;
	ObjectsLabel* _tmp1_;
	ObjectsLabel* _tmp2_;
	ObjectsLabel* item2 = NULL;
	ObjectsLabel* _tmp3_;
	ObjectsLabel* _tmp4_;
	ObjectsLabel* _tmp5_;
	ObjectsLabel* _tmp6_;
	gint _tmp7_;
	gint _tmp8_;
	ObjectsLabel* _tmp9_;
	gint _tmp10_;
	gint _tmp11_;
	gint result;
	g_return_val_if_fail (row1 != NULL, -1);
	g_return_val_if_fail (row2 != NULL, -1);
	_tmp0_ = widgets_label_picker_label_row_get_label (G_TYPE_CHECK_INSTANCE_CAST (row1, WIDGETS_LABEL_PICKER_TYPE_LABEL_ROW, WidgetsLabelPickerLabelRow));
	_tmp1_ = _tmp0_;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	item1 = _tmp2_;
	_tmp3_ = widgets_label_picker_label_row_get_label (G_TYPE_CHECK_INSTANCE_CAST (row2, WIDGETS_LABEL_PICKER_TYPE_LABEL_ROW, WidgetsLabelPickerLabelRow));
	_tmp4_ = _tmp3_;
	_tmp5_ = _g_object_ref0 (_tmp4_);
	item2 = _tmp5_;
	_tmp6_ = item1;
	_tmp7_ = objects_label_get_item_order (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = item2;
	_tmp10_ = objects_label_get_item_order (_tmp9_);
	_tmp11_ = _tmp10_;
	result = _tmp8_ - _tmp11_;
	_g_object_unref0 (item2);
	_g_object_unref0 (item1);
	return result;
}

static gint
__widgets_labels_picker_core___lambda262__gtk_list_box_sort_func (GtkListBoxRow* row1,
                                                                  GtkListBoxRow* row2,
                                                                  gpointer self)
{
	gint result;
	result = _widgets_labels_picker_core___lambda262_ ((WidgetsLabelsPickerCore*) self, row1, row2);
	return result;
}

static gchar*
string_replace (const gchar* self,
                const gchar* old,
                const gchar* replacement)
{
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	GError* _inner_error0_ = NULL;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	g_return_val_if_fail (old != NULL, NULL);
	g_return_val_if_fail (replacement != NULL, NULL);
	if ((*((gchar*) self)) == '\0') {
		_tmp1_ = TRUE;
	} else {
		_tmp1_ = (*((gchar*) old)) == '\0';
	}
	if (_tmp1_) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = g_strcmp0 (old, replacement) == 0;
	}
	if (_tmp0_) {
		gchar* _tmp2_;
		_tmp2_ = g_strdup (self);
		result = _tmp2_;
		return result;
	}
	{
		GRegex* regex = NULL;
		gchar* _tmp3_;
		gchar* _tmp4_;
		GRegex* _tmp5_;
		GRegex* _tmp6_;
		gchar* _tmp7_ = NULL;
		GRegex* _tmp8_;
		gchar* _tmp9_;
		gchar* _tmp10_;
		_tmp3_ = g_regex_escape_string (old, -1);
		_tmp4_ = _tmp3_;
		_tmp5_ = g_regex_new (_tmp4_, 0, 0, &_inner_error0_);
		_tmp6_ = _tmp5_;
		_g_free0 (_tmp4_);
		regex = _tmp6_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp8_ = regex;
		_tmp9_ = g_regex_replace_literal (_tmp8_, self, (gssize) -1, 0, replacement, 0, &_inner_error0_);
		_tmp7_ = _tmp9_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_regex_unref0 (regex);
			if (_inner_error0_->domain == G_REGEX_ERROR) {
				goto __catch0_g_regex_error;
			}
			g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
			g_clear_error (&_inner_error0_);
			return NULL;
		}
		_tmp10_ = _tmp7_;
		_tmp7_ = NULL;
		result = _tmp10_;
		_g_free0 (_tmp7_);
		_g_regex_unref0 (regex);
		return result;
	}
	goto __finally0;
	__catch0_g_regex_error:
	{
		g_clear_error (&_inner_error0_);
		g_assert_not_reached ();
	}
	__finally0:
	g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
	g_clear_error (&_inner_error0_);
	return NULL;
}

static gchar*
g_unichar_to_string (gunichar self)
{
	gchar* str = NULL;
	gchar* _tmp0_;
	gchar* result;
	_tmp0_ = g_new0 (gchar, 7);
	str = (gchar*) _tmp0_;
	g_unichar_to_utf8 (self, str);
	result = str;
	return result;
}

static gboolean
_widgets_labels_picker_core___lambda263_ (WidgetsLabelsPickerCore* self,
                                          guint keyval,
                                          guint keycode,
                                          GdkModifierType state)
{
	gchar* key = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gboolean result;
	_tmp0_ = gdk_keyval_name (keyval);
	_tmp1_ = string_replace (_tmp0_, "KP_", "");
	key = _tmp1_;
	_tmp2_ = key;
	if (g_strcmp0 (_tmp2_, "Up") == 0) {
		GtkListBoxRow* selected_row = NULL;
		GtkListBox* _tmp3_;
		GtkListBoxRow* _tmp4_;
		GtkListBoxRow* _tmp5_;
		GtkListBoxRow* _tmp6_;
		_tmp3_ = self->priv->listbox;
		_tmp4_ = gtk_list_box_get_selected_row (_tmp3_);
		_tmp5_ = _g_object_ref0 (_tmp4_);
		selected_row = _tmp5_;
		_tmp6_ = selected_row;
		if (_tmp6_ != NULL) {
			GtkListBoxRow* first_visible_row = NULL;
			gint index = 0;
			gboolean _tmp15_ = FALSE;
			GtkListBoxRow* _tmp16_;
			first_visible_row = NULL;
			index = 0;
			while (TRUE) {
				GtkListBoxRow* row = NULL;
				GtkListBox* _tmp7_;
				GtkListBoxRow* _tmp8_;
				GtkListBoxRow* _tmp9_;
				GtkListBoxRow* _tmp10_;
				GtkListBoxRow* _tmp11_;
				gint _tmp14_;
				_tmp7_ = self->priv->listbox;
				_tmp8_ = gtk_list_box_get_row_at_index (_tmp7_, index);
				_tmp9_ = _g_object_ref0 (_tmp8_);
				row = _tmp9_;
				_tmp10_ = row;
				if (_tmp10_ == NULL) {
					_g_object_unref0 (row);
					break;
				}
				_tmp11_ = row;
				if (gtk_widget_get_child_visible ((GtkWidget*) _tmp11_)) {
					GtkListBoxRow* _tmp12_;
					GtkListBoxRow* _tmp13_;
					_tmp12_ = row;
					_tmp13_ = _g_object_ref0 (_tmp12_);
					_g_object_unref0 (first_visible_row);
					first_visible_row = _tmp13_;
					_g_object_unref0 (row);
					break;
				}
				_tmp14_ = index;
				index = _tmp14_ + 1;
				_g_object_unref0 (row);
			}
			_tmp16_ = first_visible_row;
			if (_tmp16_ != NULL) {
				GtkListBoxRow* _tmp17_;
				GtkListBoxRow* _tmp18_;
				_tmp17_ = selected_row;
				_tmp18_ = first_visible_row;
				_tmp15_ = _tmp17_ == _tmp18_;
			} else {
				_tmp15_ = FALSE;
			}
			if (_tmp15_) {
				GtkSearchEntry* _tmp19_;
				GtkSearchEntry* _tmp20_;
				GtkSearchEntry* _tmp21_;
				const gchar* _tmp22_;
				const gchar* _tmp23_;
				gint _tmp24_;
				gint _tmp25_;
				_tmp19_ = self->priv->search_entry;
				gtk_widget_grab_focus ((GtkWidget*) _tmp19_);
				_tmp20_ = self->priv->search_entry;
				_tmp21_ = self->priv->search_entry;
				_tmp22_ = gtk_editable_get_text ((GtkEditable*) _tmp21_);
				_tmp23_ = _tmp22_;
				_tmp24_ = strlen (_tmp23_);
				_tmp25_ = _tmp24_;
				gtk_editable_set_position ((GtkEditable*) _tmp20_, _tmp25_);
				result = TRUE;
				_g_object_unref0 (first_visible_row);
				_g_object_unref0 (selected_row);
				_g_free0 (key);
				return result;
			}
			_g_object_unref0 (first_visible_row);
		}
		_g_object_unref0 (selected_row);
	} else {
		const gchar* _tmp26_;
		_tmp26_ = key;
		if (g_strcmp0 (_tmp26_, "Down") == 0) {
		} else {
			gboolean _tmp27_ = FALSE;
			gboolean _tmp28_ = FALSE;
			const gchar* _tmp29_;
			_tmp29_ = key;
			if (g_strcmp0 (_tmp29_, "Enter") == 0) {
				_tmp28_ = TRUE;
			} else {
				const gchar* _tmp30_;
				_tmp30_ = key;
				_tmp28_ = g_strcmp0 (_tmp30_, "Return") == 0;
			}
			if (_tmp28_) {
				_tmp27_ = TRUE;
			} else {
				const gchar* _tmp31_;
				_tmp31_ = key;
				_tmp27_ = g_strcmp0 (_tmp31_, "KP_Enter") == 0;
			}
			if (_tmp27_) {
			} else {
				const gchar* _tmp32_;
				_tmp32_ = key;
				if (g_strcmp0 (_tmp32_, "BackSpace") == 0) {
					gboolean _tmp33_ = FALSE;
					GtkSearchEntry* _tmp34_;
					gboolean _tmp35_;
					gboolean _tmp36_;
					_tmp34_ = self->priv->search_entry;
					g_object_get ((GtkWidget*) _tmp34_, "has-focus", &_tmp35_, NULL);
					_tmp36_ = _tmp35_;
					if (!_tmp36_) {
						GtkSearchEntry* _tmp37_;
						const gchar* _tmp38_;
						const gchar* _tmp39_;
						gint _tmp40_;
						gint _tmp41_;
						_tmp37_ = self->priv->search_entry;
						_tmp38_ = gtk_editable_get_text ((GtkEditable*) _tmp37_);
						_tmp39_ = _tmp38_;
						_tmp40_ = strlen (_tmp39_);
						_tmp41_ = _tmp40_;
						_tmp33_ = _tmp41_ > 0;
					} else {
						_tmp33_ = FALSE;
					}
					if (_tmp33_) {
						GtkSearchEntry* _tmp42_;
						gint pos = 0;
						GtkSearchEntry* _tmp43_;
						const gchar* _tmp44_;
						const gchar* _tmp45_;
						gint _tmp46_;
						gint _tmp47_;
						GtkSearchEntry* _tmp48_;
						GtkSearchEntry* _tmp49_;
						_tmp42_ = self->priv->search_entry;
						gtk_widget_grab_focus ((GtkWidget*) _tmp42_);
						_tmp43_ = self->priv->search_entry;
						_tmp44_ = gtk_editable_get_text ((GtkEditable*) _tmp43_);
						_tmp45_ = _tmp44_;
						_tmp46_ = strlen (_tmp45_);
						_tmp47_ = _tmp46_;
						pos = _tmp47_;
						_tmp48_ = self->priv->search_entry;
						g_signal_emit_by_name ((GtkEditable*) _tmp48_, "delete-text", pos - 1, pos);
						_tmp49_ = self->priv->search_entry;
						gtk_editable_set_position ((GtkEditable*) _tmp49_, pos - 1);
						result = TRUE;
						_g_free0 (key);
						return result;
					}
				} else {
					GtkSearchEntry* _tmp50_;
					gboolean _tmp51_;
					gboolean _tmp52_;
					_tmp50_ = self->priv->search_entry;
					g_object_get ((GtkWidget*) _tmp50_, "has-focus", &_tmp51_, NULL);
					_tmp52_ = _tmp51_;
					if (!_tmp52_) {
						gunichar c = 0U;
						c = (gunichar) gdk_keyval_to_unicode (keyval);
						if (g_unichar_isprint (c)) {
							GtkSearchEntry* _tmp53_;
							gint pos = 0;
							GtkSearchEntry* _tmp54_;
							const gchar* _tmp55_;
							const gchar* _tmp56_;
							gint _tmp57_;
							gint _tmp58_;
							GtkSearchEntry* _tmp59_;
							gchar* _tmp60_;
							gchar* _tmp61_;
							GtkSearchEntry* _tmp62_;
							_tmp53_ = self->priv->search_entry;
							gtk_widget_grab_focus ((GtkWidget*) _tmp53_);
							_tmp54_ = self->priv->search_entry;
							_tmp55_ = gtk_editable_get_text ((GtkEditable*) _tmp54_);
							_tmp56_ = _tmp55_;
							_tmp57_ = strlen (_tmp56_);
							_tmp58_ = _tmp57_;
							pos = _tmp58_;
							_tmp59_ = self->priv->search_entry;
							_tmp60_ = g_unichar_to_string (c);
							_tmp61_ = _tmp60_;
							g_signal_emit_by_name ((GtkEditable*) _tmp59_, "insert-text", _tmp61_, -1, &pos);
							_g_free0 (_tmp61_);
							_tmp62_ = self->priv->search_entry;
							gtk_editable_set_position ((GtkEditable*) _tmp62_, pos);
							result = TRUE;
							_g_free0 (key);
							return result;
						}
					}
				}
			}
		}
	}
	result = FALSE;
	_g_free0 (key);
	return result;
}

static gboolean
__widgets_labels_picker_core___lambda263__gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                                                guint keyval,
                                                                                guint keycode,
                                                                                GdkModifierType state,
                                                                                gpointer self)
{
	gboolean result;
	result = _widgets_labels_picker_core___lambda263_ ((WidgetsLabelsPickerCore*) self, keyval, keycode, state);
	return result;
}

static void
_widgets_labels_picker_core___lambda264_ (WidgetsLabelsPickerCore* self)
{
	widgets_labels_picker_core_invalidate_filter (self);
}

static void
__widgets_labels_picker_core___lambda264__gtk_search_entry_search_changed (GtkSearchEntry* _sender,
                                                                           gpointer self)
{
	_widgets_labels_picker_core___lambda264_ ((WidgetsLabelsPickerCore*) self);
}

static void
_widgets_labels_picker_core___lambda265_ (WidgetsLabelsPickerCore* self)
{
	GtkToggleButton* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	ServicesSettings* _tmp3_;
	ServicesSettings* _tmp4_;
	GSettings* _tmp5_;
	_tmp0_ = self->priv->filter_button;
	_tmp1_ = gtk_toggle_button_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	self->priv->hide_unused = _tmp2_;
	_tmp3_ = services_settings_get_default ();
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_->settings;
	g_settings_set_boolean (_tmp5_, "label-picker-hide-unused", self->priv->hide_unused);
	_g_object_unref0 (_tmp4_);
	widgets_labels_picker_core_invalidate_filter (self);
}

static void
__widgets_labels_picker_core___lambda265__gtk_toggle_button_toggled (GtkToggleButton* _sender,
                                                                     gpointer self)
{
	_widgets_labels_picker_core___lambda265_ ((WidgetsLabelsPickerCore*) self);
}

static void
_widgets_labels_picker_core___lambda266_ (WidgetsLabelsPickerCore* self)
{
	gboolean _tmp0_ = FALSE;
	ObjectsSource* _tmp1_;
	ObjectsSource* _tmp2_;
	_tmp1_ = widgets_labels_picker_core_get_source (self);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != NULL) {
		GtkSearchEntry* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		gint _tmp6_;
		gint _tmp7_;
		_tmp3_ = self->priv->search_entry;
		_tmp4_ = gtk_editable_get_text ((GtkEditable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = strlen (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp0_ = _tmp7_ > 0;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		ObjectsLabel* label = NULL;
		ServicesStore* _tmp8_;
		GtkSearchEntry* _tmp9_;
		const gchar* _tmp10_;
		const gchar* _tmp11_;
		ObjectsSource* _tmp12_;
		ObjectsSource* _tmp13_;
		const gchar* _tmp14_;
		const gchar* _tmp15_;
		ObjectsLabel* _tmp16_;
		ObjectsLabel* _tmp17_;
		_tmp8_ = services_store_instance ();
		_tmp9_ = self->priv->search_entry;
		_tmp10_ = gtk_editable_get_text ((GtkEditable*) _tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = widgets_labels_picker_core_get_source (self);
		_tmp13_ = _tmp12_;
		_tmp14_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = services_store_get_label_by_name (_tmp8_, _tmp11_, TRUE, _tmp15_);
		label = _tmp16_;
		_tmp17_ = label;
		if (_tmp17_ != NULL) {
			GeeHashMap* _tmp18_;
			ObjectsLabel* _tmp19_;
			const gchar* _tmp20_;
			const gchar* _tmp21_;
			_tmp18_ = self->labels_widgets_map;
			_tmp19_ = label;
			_tmp20_ = objects_base_object_get_id_string ((ObjectsBaseObject*) _tmp19_);
			_tmp21_ = _tmp20_;
			if (gee_abstract_map_has_key ((GeeAbstractMap*) _tmp18_, _tmp21_)) {
				GeeHashMap* _tmp22_;
				ObjectsLabel* _tmp23_;
				const gchar* _tmp24_;
				const gchar* _tmp25_;
				gpointer _tmp26_;
				WidgetsLabelPickerLabelRow* _tmp27_;
				_tmp22_ = self->labels_widgets_map;
				_tmp23_ = label;
				_tmp24_ = objects_base_object_get_id_string ((ObjectsBaseObject*) _tmp23_);
				_tmp25_ = _tmp24_;
				_tmp26_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp22_, _tmp25_);
				_tmp27_ = (WidgetsLabelPickerLabelRow*) _tmp26_;
				widgets_label_picker_label_row_update_checked_toggled (_tmp27_);
				_g_object_unref0 (_tmp27_);
			}
		} else {
			widgets_labels_picker_core_add_assign_label (self);
		}
		_g_object_unref0 (label);
	}
}

static void
__widgets_labels_picker_core___lambda266__gtk_search_entry_activate (GtkSearchEntry* _sender,
                                                                     gpointer self)
{
	_widgets_labels_picker_core___lambda266_ ((WidgetsLabelsPickerCore*) self);
}

static gboolean
_widgets_labels_picker_core___lambda267_ (WidgetsLabelsPickerCore* self,
                                          guint keyval,
                                          guint keycode,
                                          GdkModifierType state)
{
	gchar* key = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gboolean result;
	_tmp0_ = gdk_keyval_name (keyval);
	_tmp1_ = string_replace (_tmp0_, "KP_", "");
	key = _tmp1_;
	if (keyval == GDK_KEY_Escape) {
		g_signal_emit (self, widgets_labels_picker_core_signals[WIDGETS_LABELS_PICKER_CORE_CLOSE_SIGNAL], 0);
	} else {
		const gchar* _tmp2_;
		_tmp2_ = key;
		if (g_strcmp0 (_tmp2_, "Down") == 0) {
			GtkListBox* _tmp3_;
			GtkListBoxRow* _tmp4_;
			_tmp3_ = self->priv->listbox;
			_tmp4_ = gtk_list_box_get_row_at_index (_tmp3_, 0);
			gtk_widget_grab_focus ((GtkWidget*) _tmp4_);
			result = TRUE;
			_g_free0 (key);
			return result;
		}
	}
	result = FALSE;
	_g_free0 (key);
	return result;
}

static gboolean
__widgets_labels_picker_core___lambda267__gtk_event_controller_key_key_pressed (GtkEventControllerKey* _sender,
                                                                                guint keyval,
                                                                                guint keycode,
                                                                                GdkModifierType state,
                                                                                gpointer self)
{
	gboolean result;
	result = _widgets_labels_picker_core___lambda267_ ((WidgetsLabelsPickerCore*) self, keyval, keycode, state);
	return result;
}

static void
_widgets_labels_picker_core___lambda268_ (WidgetsLabelsPickerCore* self,
                                          ObjectsLabel* label)
{
	g_return_if_fail (label != NULL);
	widgets_labels_picker_core_add_label (self, label);
}

static void
__widgets_labels_picker_core___lambda268__services_store_label_added (ServicesStore* _sender,
                                                                      ObjectsLabel* label,
                                                                      gpointer self)
{
	_widgets_labels_picker_core___lambda268_ ((WidgetsLabelsPickerCore*) self, label);
}

static GObject *
widgets_labels_picker_core_constructor (GType type,
                                        guint n_construct_properties,
                                        GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	WidgetsLabelsPickerCore * self;
	LabelPickerType _tmp0_;
	const gchar* _tmp2_ = NULL;
	LabelPickerType _tmp3_;
	gchar* _tmp4_;
	GtkSearchEntry* _tmp5_ = NULL;
	ServicesSettings* _tmp6_;
	ServicesSettings* _tmp7_;
	GSettings* _tmp8_;
	gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gchar** _tmp12_;
	GtkToggleButton* _tmp13_ = NULL;
	GtkBox* search_box = NULL;
	GtkBox* _tmp14_ = NULL;
	GtkBox* _tmp15_;
	GtkSearchEntry* _tmp16_;
	GtkBox* _tmp17_;
	GtkToggleButton* _tmp18_;
	GtkBox* _tmp19_;
	GtkWidget* _tmp20_;
	GtkRevealer* _tmp21_ = NULL;
	GtkListBox* _tmp22_ = NULL;
	GtkListBox* _tmp23_;
	GtkListBox* _tmp24_;
	GtkListBox* _tmp25_;
	GtkWidget* _tmp26_;
	GtkWidget* _tmp27_;
	GtkListBox* _tmp28_;
	AdwBin* listbox_grid = NULL;
	GtkListBox* _tmp29_;
	GtkWidget* _tmp30_;
	AdwBin* _tmp31_ = NULL;
	GtkScrolledWindow* listbox_scrolled = NULL;
	GtkScrolledWindow* _tmp32_ = NULL;
	GtkScrolledWindow* _tmp33_;
	AdwBin* _tmp34_;
	AdwToolbarView* toolbar_view = NULL;
	AdwToolbarView* _tmp35_;
	AdwToolbarView* _tmp36_;
	GtkRevealer* _tmp37_;
	AdwToolbarView* _tmp38_;
	GtkScrolledWindow* _tmp39_;
	AdwToolbarView* _tmp40_;
	GtkEventControllerKey* listbox_controller_key = NULL;
	GtkEventControllerKey* _tmp41_;
	GtkListBox* _tmp42_;
	GtkEventControllerKey* _tmp43_;
	GtkEventController* _tmp44_;
	GeeHashMap* _tmp45_;
	GtkEventControllerKey* _tmp46_;
	gulong _tmp47_;
	GtkEventControllerKey* _tmp48_;
	GeeHashMap* _tmp49_;
	GtkSearchEntry* _tmp50_;
	gulong _tmp51_;
	GtkSearchEntry* _tmp52_;
	GeeHashMap* _tmp53_;
	GtkToggleButton* _tmp54_;
	gulong _tmp55_;
	GtkToggleButton* _tmp56_;
	GeeHashMap* _tmp57_;
	GtkSearchEntry* _tmp58_;
	gulong _tmp59_;
	GtkSearchEntry* _tmp60_;
	GtkEventControllerKey* search_entry_ctrl_key = NULL;
	GtkEventControllerKey* _tmp61_;
	GtkSearchEntry* _tmp62_;
	GtkEventControllerKey* _tmp63_;
	GtkEventController* _tmp64_;
	GeeHashMap* _tmp65_;
	GtkEventControllerKey* _tmp66_;
	gulong _tmp67_;
	GtkEventControllerKey* _tmp68_;
	GeeHashMap* _tmp69_;
	ServicesStore* _tmp70_;
	gulong _tmp71_;
	ServicesStore* _tmp72_;
	parent_class = G_OBJECT_CLASS (widgets_labels_picker_core_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_TYPE_LABELS_PICKER_CORE, WidgetsLabelsPickerCore);
	_tmp0_ = self->priv->_picker_type;
	if (_tmp0_ == LABEL_PICKER_TYPE_FILTER_ONLY) {
		gchar* _tmp1_;
		_tmp1_ = g_strdup (_ ("Your list of filters will show up here."));
		_g_free0 (self->priv->PLACEHOLDER_MESSAGE);
		self->priv->PLACEHOLDER_MESSAGE = _tmp1_;
	}
	_tmp3_ = self->priv->_picker_type;
	if (_tmp3_ == LABEL_PICKER_TYPE_FILTER_ONLY) {
		_tmp2_ = _ ("Search");
	} else {
		_tmp2_ = _ ("Search or Create");
	}
	_tmp4_ = g_strdup (_tmp2_);
	_tmp5_ = (GtkSearchEntry*) gtk_search_entry_new ();
	g_object_set (_tmp5_, "placeholder-text", _tmp4_, NULL);
	_g_free0 (_tmp4_);
	gtk_widget_set_valign ((GtkWidget*) _tmp5_, GTK_ALIGN_CENTER);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp5_, TRUE);
	g_object_ref_sink (_tmp5_);
	_g_object_unref0 (self->priv->search_entry);
	self->priv->search_entry = _tmp5_;
	_tmp6_ = services_settings_get_default ();
	_tmp7_ = _tmp6_;
	_tmp8_ = _tmp7_->settings;
	self->priv->hide_unused = g_settings_get_boolean (_tmp8_, "label-picker-hide-unused");
	_g_object_unref0 (_tmp7_);
	_tmp9_ = g_strdup ("funnel-outline-symbolic");
	_tmp10_ = g_strdup (_ ("Hide unused labels"));
	_tmp11_ = g_strdup ("flat");
	_tmp12_ = g_new0 (gchar*, 1 + 1);
	_tmp12_[0] = _tmp11_;
	_tmp13_ = (GtkToggleButton*) gtk_toggle_button_new ();
	gtk_button_set_icon_name ((GtkButton*) _tmp13_, _tmp9_);
	_g_free0 (_tmp9_);
	gtk_toggle_button_set_active (_tmp13_, self->priv->hide_unused);
	gtk_widget_set_valign ((GtkWidget*) _tmp13_, GTK_ALIGN_CENTER);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp13_, _tmp10_);
	_g_free0 (_tmp10_);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp13_, _tmp12_);
	_tmp12_ = (_vala_array_free (_tmp12_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp13_);
	_g_object_unref0 (self->priv->filter_button);
	self->priv->filter_button = _tmp13_;
	_tmp14_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp14_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp14_, 12);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp14_, 12);
	g_object_ref_sink (_tmp14_);
	search_box = _tmp14_;
	_tmp15_ = search_box;
	_tmp16_ = self->priv->search_entry;
	gtk_box_append (_tmp15_, (GtkWidget*) _tmp16_);
	_tmp17_ = search_box;
	_tmp18_ = self->priv->filter_button;
	gtk_box_append (_tmp17_, (GtkWidget*) _tmp18_);
	_tmp19_ = search_box;
	_tmp20_ = _g_object_ref0 ((GtkWidget*) _tmp19_);
	_tmp21_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_child (_tmp21_, _tmp20_);
	_g_object_unref0 (_tmp20_);
	gtk_revealer_set_reveal_child (_tmp21_, TRUE);
	g_object_ref_sink (_tmp21_);
	_g_object_unref0 (self->priv->search_entry_revealer);
	self->priv->search_entry_revealer = _tmp21_;
	_tmp22_ = (GtkListBox*) gtk_list_box_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp22_, TRUE);
	gtk_widget_set_valign ((GtkWidget*) _tmp22_, GTK_ALIGN_START);
	g_object_ref_sink (_tmp22_);
	_g_object_unref0 (self->priv->listbox);
	self->priv->listbox = _tmp22_;
	_tmp23_ = self->priv->listbox;
	gtk_widget_add_css_class ((GtkWidget*) _tmp23_, "listbox-background");
	_tmp24_ = self->priv->listbox;
	gtk_widget_add_css_class ((GtkWidget*) _tmp24_, "listbox-separator-6");
	_tmp25_ = self->priv->listbox;
	_tmp26_ = widgets_labels_picker_core_get_placeholder (self);
	_tmp27_ = _tmp26_;
	gtk_list_box_set_placeholder (_tmp25_, _tmp27_);
	_g_object_unref0 (_tmp27_);
	_tmp28_ = self->priv->listbox;
	gtk_list_box_set_sort_func (_tmp28_, __widgets_labels_picker_core___lambda262__gtk_list_box_sort_func, g_object_ref (self), g_object_unref);
	_tmp29_ = self->priv->listbox;
	_tmp30_ = _g_object_ref0 ((GtkWidget*) _tmp29_);
	_tmp31_ = (AdwBin*) adw_bin_new ();
	gtk_widget_set_margin_start ((GtkWidget*) _tmp31_, 9);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp31_, 9);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp31_, 6);
	adw_bin_set_child (_tmp31_, _tmp30_);
	_g_object_unref0 (_tmp30_);
	gtk_widget_set_valign ((GtkWidget*) _tmp31_, GTK_ALIGN_START);
	g_object_ref_sink (_tmp31_);
	listbox_grid = _tmp31_;
	_tmp32_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	g_object_set (_tmp32_, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp32_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp32_, TRUE);
	g_object_ref_sink (_tmp32_);
	listbox_scrolled = _tmp32_;
	_tmp33_ = listbox_scrolled;
	_tmp34_ = listbox_grid;
	gtk_scrolled_window_set_child (_tmp33_, (GtkWidget*) _tmp34_);
	_tmp35_ = (AdwToolbarView*) adw_toolbar_view_new ();
	g_object_ref_sink (_tmp35_);
	toolbar_view = _tmp35_;
	_tmp36_ = toolbar_view;
	_tmp37_ = self->priv->search_entry_revealer;
	adw_toolbar_view_add_top_bar (_tmp36_, (GtkWidget*) _tmp37_);
	_tmp38_ = toolbar_view;
	_tmp39_ = listbox_scrolled;
	adw_toolbar_view_set_content (_tmp38_, (GtkWidget*) _tmp39_);
	_tmp40_ = toolbar_view;
	adw_bin_set_child ((AdwBin*) self, (GtkWidget*) _tmp40_);
	_tmp41_ = (GtkEventControllerKey*) gtk_event_controller_key_new ();
	listbox_controller_key = _tmp41_;
	_tmp42_ = self->priv->listbox;
	_tmp43_ = listbox_controller_key;
	_tmp44_ = _g_object_ref0 ((GtkEventController*) _tmp43_);
	gtk_widget_add_controller ((GtkWidget*) _tmp42_, _tmp44_);
	_tmp45_ = self->priv->signals_map;
	_tmp46_ = listbox_controller_key;
	_tmp47_ = g_signal_connect_object (_tmp46_, "key-pressed", (GCallback) __widgets_labels_picker_core___lambda263__gtk_event_controller_key_key_pressed, self, 0);
	_tmp48_ = listbox_controller_key;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp45_, (gpointer) ((guintptr) _tmp47_), (GObject*) _tmp48_);
	_tmp49_ = self->priv->signals_map;
	_tmp50_ = self->priv->search_entry;
	_tmp51_ = g_signal_connect_object (_tmp50_, "search-changed", (GCallback) __widgets_labels_picker_core___lambda264__gtk_search_entry_search_changed, self, 0);
	_tmp52_ = self->priv->search_entry;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp49_, (gpointer) ((guintptr) _tmp51_), (GObject*) _tmp52_);
	_tmp53_ = self->priv->signals_map;
	_tmp54_ = self->priv->filter_button;
	_tmp55_ = g_signal_connect_object (_tmp54_, "toggled", (GCallback) __widgets_labels_picker_core___lambda265__gtk_toggle_button_toggled, self, 0);
	_tmp56_ = self->priv->filter_button;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp53_, (gpointer) ((guintptr) _tmp55_), (GObject*) _tmp56_);
	_tmp57_ = self->priv->signals_map;
	_tmp58_ = self->priv->search_entry;
	_tmp59_ = g_signal_connect_object (_tmp58_, "activate", (GCallback) __widgets_labels_picker_core___lambda266__gtk_search_entry_activate, self, 0);
	_tmp60_ = self->priv->search_entry;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp57_, (gpointer) ((guintptr) _tmp59_), (GObject*) _tmp60_);
	_tmp61_ = (GtkEventControllerKey*) gtk_event_controller_key_new ();
	search_entry_ctrl_key = _tmp61_;
	_tmp62_ = self->priv->search_entry;
	_tmp63_ = search_entry_ctrl_key;
	_tmp64_ = _g_object_ref0 ((GtkEventController*) _tmp63_);
	gtk_widget_add_controller ((GtkWidget*) _tmp62_, _tmp64_);
	_tmp65_ = self->priv->signals_map;
	_tmp66_ = search_entry_ctrl_key;
	_tmp67_ = g_signal_connect_object (_tmp66_, "key-pressed", (GCallback) __widgets_labels_picker_core___lambda267__gtk_event_controller_key_key_pressed, self, 0);
	_tmp68_ = search_entry_ctrl_key;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp65_, (gpointer) ((guintptr) _tmp67_), (GObject*) _tmp68_);
	_tmp69_ = self->priv->signals_map;
	_tmp70_ = services_store_instance ();
	_tmp71_ = g_signal_connect_object (_tmp70_, "label-added", (GCallback) __widgets_labels_picker_core___lambda268__services_store_label_added, self, 0);
	_tmp72_ = services_store_instance ();
	gee_abstract_map_set ((GeeAbstractMap*) _tmp69_, (gpointer) ((guintptr) _tmp71_), (GObject*) _tmp72_);
	_g_object_unref0 (search_entry_ctrl_key);
	_g_object_unref0 (listbox_controller_key);
	_g_object_unref0 (toolbar_view);
	_g_object_unref0 (listbox_scrolled);
	_g_object_unref0 (listbox_grid);
	_g_object_unref0 (search_box);
	return obj;
}

static void
widgets_labels_picker_core_class_init (WidgetsLabelsPickerCoreClass * klass,
                                       gpointer klass_data)
{
	widgets_labels_picker_core_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &WidgetsLabelsPickerCore_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_widgets_labels_picker_core_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_widgets_labels_picker_core_set_property;
	G_OBJECT_CLASS (klass)->constructor = widgets_labels_picker_core_constructor;
	G_OBJECT_CLASS (klass)->finalize = widgets_labels_picker_core_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_LABELS_PICKER_CORE_PICKER_TYPE_PROPERTY, widgets_labels_picker_core_properties[WIDGETS_LABELS_PICKER_CORE_PICKER_TYPE_PROPERTY] = g_param_spec_enum ("picker-type", "picker-type", "picker-type", TYPE_LABEL_PICKER_TYPE, 0, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_LABELS_PICKER_CORE_LABELS_PROPERTY, widgets_labels_picker_core_properties[WIDGETS_LABELS_PICKER_CORE_LABELS_PROPERTY] = g_param_spec_object ("labels", "labels", "labels", GEE_TYPE_ARRAY_LIST, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_LABELS_PICKER_CORE_SOURCE_PROPERTY, widgets_labels_picker_core_properties[WIDGETS_LABELS_PICKER_CORE_SOURCE_PROPERTY] = g_param_spec_object ("source", "source", "source", OBJECTS_TYPE_SOURCE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), WIDGETS_LABELS_PICKER_CORE_IS_LOADING_PROPERTY, widgets_labels_picker_core_properties[WIDGETS_LABELS_PICKER_CORE_IS_LOADING_PROPERTY] = g_param_spec_boolean ("is-loading", "is-loading", "is-loading", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_WRITABLE));
	widgets_labels_picker_core_signals[WIDGETS_LABELS_PICKER_CORE_CLOSE_SIGNAL] = g_signal_new ("close", WIDGETS_TYPE_LABELS_PICKER_CORE, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}

static void
widgets_labels_picker_core_instance_init (WidgetsLabelsPickerCore * self,
                                          gpointer klass)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	GeeHashMap* _tmp4_;
	self->priv = widgets_labels_picker_core_get_instance_private (self);
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, WIDGETS_LABEL_PICKER_TYPE_LABEL_ROW, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->labels_widgets_map = _tmp0_;
	_tmp1_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, OBJECTS_TYPE_LABEL, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->picked = _tmp1_;
	_tmp2_ = g_strdup (_ ("Your list of filters will show up here. Create one by entering the nam" \
"e and pressing the Enter key."));
	self->priv->PLACEHOLDER_MESSAGE = _tmp2_;
	_tmp3_ = g_strdup (_ ("Create '%s'"));
	self->priv->PLACEHOLDER_CREATE_MESSAGE = _tmp3_;
	_tmp4_ = gee_hash_map_new (G_TYPE_ULONG, NULL, NULL, G_TYPE_OBJECT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->signals_map = _tmp4_;
}

static void
widgets_labels_picker_core_finalize (GObject * obj)
{
	WidgetsLabelsPickerCore * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, WIDGETS_TYPE_LABELS_PICKER_CORE, WidgetsLabelsPickerCore);
	g_debug ("LabelsPickerCore.vala:88: Destroying - Widgets.LabelsPickerCore\n");
	_g_object_unref0 (self->priv->search_entry);
	_g_object_unref0 (self->priv->listbox);
	_g_object_unref0 (self->priv->placeholder_message_label);
	_g_object_unref0 (self->priv->placeholder_title_label);
	_g_object_unref0 (self->priv->placeholder_icon);
	_g_object_unref0 (self->priv->add_tag_revealer);
	_g_object_unref0 (self->priv->spinner_revealer);
	_g_object_unref0 (self->priv->search_entry_revealer);
	_g_object_unref0 (self->priv->filter_button);
	_g_object_unref0 (self->priv->_source);
	_g_object_unref0 (self->labels_widgets_map);
	_g_object_unref0 (self->picked);
	_g_free0 (self->priv->PLACEHOLDER_MESSAGE);
	_g_free0 (self->priv->PLACEHOLDER_CREATE_MESSAGE);
	_g_object_unref0 (self->priv->signals_map);
	G_OBJECT_CLASS (widgets_labels_picker_core_parent_class)->finalize (obj);
}

static GType
widgets_labels_picker_core_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (WidgetsLabelsPickerCoreClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) widgets_labels_picker_core_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (WidgetsLabelsPickerCore), 0, (GInstanceInitFunc) widgets_labels_picker_core_instance_init, NULL };
	GType widgets_labels_picker_core_type_id;
	widgets_labels_picker_core_type_id = g_type_register_static (adw_bin_get_type (), "WidgetsLabelsPickerCore", &g_define_type_info, 0);
	WidgetsLabelsPickerCore_private_offset = g_type_add_instance_private (widgets_labels_picker_core_type_id, sizeof (WidgetsLabelsPickerCorePrivate));
	return widgets_labels_picker_core_type_id;
}

GType
widgets_labels_picker_core_get_type (void)
{
	static volatile gsize widgets_labels_picker_core_type_id__once = 0;
	if (g_once_init_enter (&widgets_labels_picker_core_type_id__once)) {
		GType widgets_labels_picker_core_type_id;
		widgets_labels_picker_core_type_id = widgets_labels_picker_core_get_type_once ();
		g_once_init_leave (&widgets_labels_picker_core_type_id__once, widgets_labels_picker_core_type_id);
	}
	return widgets_labels_picker_core_type_id__once;
}

static void
_vala_widgets_labels_picker_core_get_property (GObject * object,
                                               guint property_id,
                                               GValue * value,
                                               GParamSpec * pspec)
{
	WidgetsLabelsPickerCore * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_TYPE_LABELS_PICKER_CORE, WidgetsLabelsPickerCore);
	switch (property_id) {
		case WIDGETS_LABELS_PICKER_CORE_PICKER_TYPE_PROPERTY:
		g_value_set_enum (value, widgets_labels_picker_core_get_picker_type (self));
		break;
		case WIDGETS_LABELS_PICKER_CORE_SOURCE_PROPERTY:
		g_value_set_object (value, widgets_labels_picker_core_get_source (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_widgets_labels_picker_core_set_property (GObject * object,
                                               guint property_id,
                                               const GValue * value,
                                               GParamSpec * pspec)
{
	WidgetsLabelsPickerCore * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, WIDGETS_TYPE_LABELS_PICKER_CORE, WidgetsLabelsPickerCore);
	switch (property_id) {
		case WIDGETS_LABELS_PICKER_CORE_PICKER_TYPE_PROPERTY:
		widgets_labels_picker_core_set_picker_type (self, g_value_get_enum (value));
		break;
		case WIDGETS_LABELS_PICKER_CORE_LABELS_PROPERTY:
		widgets_labels_picker_core_set_labels (self, g_value_get_object (value));
		break;
		case WIDGETS_LABELS_PICKER_CORE_SOURCE_PROPERTY:
		widgets_labels_picker_core_set_source (self, g_value_get_object (value));
		break;
		case WIDGETS_LABELS_PICKER_CORE_IS_LOADING_PROPERTY:
		widgets_labels_picker_core_set_is_loading (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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

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

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

