/* contacts-contact-editor.c generated by valac 0.34.0.3-63fa6, the Vala compiler
 * generated from contacts-contact-editor.vala, do not modify */

/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 8 -*- */
/*
 * Copyright (C) 2011 Alexander Larsson <alexl@redhat.com>
 *
 * 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 2 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, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <folks/folks.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gee.h>
#include <float.h>
#include <math.h>
#include <atk/atk.h>
#include <gio/gio.h>
#include <gdk-pixbuf/gdk-pixbuf.h>


#define CONTACTS_TYPE_ADDRESS_EDITOR (contacts_address_editor_get_type ())
#define CONTACTS_ADDRESS_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_ADDRESS_EDITOR, ContactsAddressEditor))
#define CONTACTS_ADDRESS_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_ADDRESS_EDITOR, ContactsAddressEditorClass))
#define CONTACTS_IS_ADDRESS_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_ADDRESS_EDITOR))
#define CONTACTS_IS_ADDRESS_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_ADDRESS_EDITOR))
#define CONTACTS_ADDRESS_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_ADDRESS_EDITOR, ContactsAddressEditorClass))

typedef struct _ContactsAddressEditor ContactsAddressEditor;
typedef struct _ContactsAddressEditorClass ContactsAddressEditorClass;
typedef struct _ContactsAddressEditorPrivate ContactsAddressEditorPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define CONTACTS_TYPE_CONTACT_EDITOR (contacts_contact_editor_get_type ())
#define CONTACTS_CONTACT_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CONTACT_EDITOR, ContactsContactEditor))
#define CONTACTS_CONTACT_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CONTACT_EDITOR, ContactsContactEditorClass))
#define CONTACTS_IS_CONTACT_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CONTACT_EDITOR))
#define CONTACTS_IS_CONTACT_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CONTACT_EDITOR))
#define CONTACTS_CONTACT_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONTACT_EDITOR, ContactsContactEditorClass))

typedef struct _ContactsContactEditor ContactsContactEditor;
typedef struct _ContactsContactEditorClass ContactsContactEditorClass;
typedef struct _ContactsContactEditorPrivate ContactsContactEditorPrivate;

#define CONTACTS_TYPE_CONTACT (contacts_contact_get_type ())
#define CONTACTS_CONTACT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CONTACT, ContactsContact))
#define CONTACTS_CONTACT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CONTACT, ContactsContactClass))
#define CONTACTS_IS_CONTACT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CONTACT))
#define CONTACTS_IS_CONTACT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CONTACT))
#define CONTACTS_CONTACT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONTACT, ContactsContactClass))

typedef struct _ContactsContact ContactsContact;
typedef struct _ContactsContactClass ContactsContactClass;

#define CONTACTS_CONTACT_EDITOR_TYPE_FIELD (contacts_contact_editor_field_get_type ())

#define CONTACTS_CONTACT_EDITOR_TYPE_ROW_DATA (contacts_contact_editor_row_data_get_type ())
typedef struct _ContactsContactEditorRowData ContactsContactEditorRowData;
typedef struct _ContactsContactEditorField ContactsContactEditorField;

#define CONTACTS_TYPE_TYPECOMBO (contacts_typecombo_get_type ())
#define CONTACTS_TYPECOMBO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_TYPECOMBO, ContactsTypeCombo))
#define CONTACTS_TYPECOMBO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_TYPECOMBO, ContactsTypeComboClass))
#define CONTACTS_IS_TYPECOMBO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_TYPECOMBO))
#define CONTACTS_IS_TYPECOMBO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_TYPECOMBO))
#define CONTACTS_TYPECOMBO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_TYPECOMBO, ContactsTypeComboClass))

typedef struct _ContactsTypeCombo ContactsTypeCombo;
typedef struct _ContactsTypeComboClass ContactsTypeComboClass;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))

#define CONTACTS_TYPE_TYPESET (contacts_typeset_get_type ())
#define CONTACTS_TYPESET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_TYPESET, ContactsTypeSet))
#define CONTACTS_TYPESET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_TYPESET, ContactsTypeSetClass))
#define CONTACTS_IS_TYPESET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_TYPESET))
#define CONTACTS_IS_TYPESET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_TYPESET))
#define CONTACTS_TYPESET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_TYPESET, ContactsTypeSetClass))

typedef struct _ContactsTypeSet ContactsTypeSet;
typedef struct _ContactsTypeSetClass ContactsTypeSetClass;
typedef struct _Block21Data Block21Data;
typedef struct _Block22Data Block22Data;
typedef struct _Block23Data Block23Data;
typedef struct _Block24Data Block24Data;
typedef struct _Block25Data Block25Data;
#define _contacts_contact_editor_field_free0(var) ((var == NULL) ? NULL : (var = (contacts_contact_editor_field_free (var), NULL)))
#define _contacts_contact_editor_row_data_free0(var) ((var == NULL) ? NULL : (var = (contacts_contact_editor_row_data_free (var), NULL)))

#define TYPE_CENTER (center_get_type ())
#define CENTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CENTER, Center))
#define CENTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CENTER, CenterClass))
#define IS_CENTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CENTER))
#define IS_CENTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CENTER))
#define CENTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CENTER, CenterClass))

typedef struct _Center Center;
typedef struct _CenterClass CenterClass;

#define CONTACTS_TYPE_CONTACT_FRAME (contacts_contact_frame_get_type ())
#define CONTACTS_CONTACT_FRAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CONTACT_FRAME, ContactsContactFrame))
#define CONTACTS_CONTACT_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CONTACT_FRAME, ContactsContactFrameClass))
#define CONTACTS_IS_CONTACT_FRAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CONTACT_FRAME))
#define CONTACTS_IS_CONTACT_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CONTACT_FRAME))
#define CONTACTS_CONTACT_FRAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONTACT_FRAME, ContactsContactFrameClass))

typedef struct _ContactsContactFrame ContactsContactFrame;
typedef struct _ContactsContactFrameClass ContactsContactFrameClass;
typedef struct _Block26Data Block26Data;
typedef struct _ContactsContactPrivate ContactsContactPrivate;

#define CONTACTS_TYPE_STORE (contacts_store_get_type ())
#define CONTACTS_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_STORE, ContactsStore))
#define CONTACTS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_STORE, ContactsStoreClass))
#define CONTACTS_IS_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_STORE))
#define CONTACTS_IS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_STORE))
#define CONTACTS_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_STORE, ContactsStoreClass))

typedef struct _ContactsStore ContactsStore;
typedef struct _ContactsStoreClass ContactsStoreClass;

#define CONTACTS_TYPE_AVATAR_DIALOG (contacts_avatar_dialog_get_type ())
#define CONTACTS_AVATAR_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_AVATAR_DIALOG, ContactsAvatarDialog))
#define CONTACTS_AVATAR_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_AVATAR_DIALOG, ContactsAvatarDialogClass))
#define CONTACTS_IS_AVATAR_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_AVATAR_DIALOG))
#define CONTACTS_IS_AVATAR_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_AVATAR_DIALOG))
#define CONTACTS_AVATAR_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_AVATAR_DIALOG, ContactsAvatarDialogClass))

typedef struct _ContactsAvatarDialog ContactsAvatarDialog;
typedef struct _ContactsAvatarDialogClass ContactsAvatarDialogClass;
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))

#define CONTACTS_CONTACT_EDITOR_TYPE_PROPERTY_DATA (contacts_contact_editor_property_data_get_type ())
typedef struct _ContactsContactEditorPropertyData ContactsContactEditorPropertyData;

#define CONTACTS_TYPE_FAKE_PERSONA (contacts_fake_persona_get_type ())
#define CONTACTS_FAKE_PERSONA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_FAKE_PERSONA, ContactsFakePersona))
#define CONTACTS_FAKE_PERSONA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_FAKE_PERSONA, ContactsFakePersonaClass))
#define CONTACTS_IS_FAKE_PERSONA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_FAKE_PERSONA))
#define CONTACTS_IS_FAKE_PERSONA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_FAKE_PERSONA))
#define CONTACTS_FAKE_PERSONA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_FAKE_PERSONA, ContactsFakePersonaClass))

typedef struct _ContactsFakePersona ContactsFakePersona;
typedef struct _ContactsFakePersonaClass ContactsFakePersonaClass;
typedef struct _Block27Data Block27Data;

struct _ContactsAddressEditor {
	GtkBox parent_instance;
	ContactsAddressEditorPrivate * priv;
	GtkEntry* entries[7];
	FolksPostalAddressFieldDetails* details;
};

struct _ContactsAddressEditorClass {
	GtkBoxClass parent_class;
};

struct _ContactsContactEditor {
	GtkGrid parent_instance;
	ContactsContactEditorPrivate * priv;
	GtkButton* linked_button;
	GtkButton* remove_button;
};

struct _ContactsContactEditorClass {
	GtkGridClass parent_class;
};

struct _ContactsContactEditorRowData {
	FolksAbstractFieldDetails* details;
};

struct _ContactsContactEditorField {
	gboolean changed;
	GeeHashMap* rows;
};

struct _ContactsContactEditorPrivate {
	ContactsContact* contact;
	GtkGrid* container_grid;
	GtkWidget* focus_widget;
	gint last_row;
	GeeHashMap* writable_personas;
	gboolean _has_birthday_row;
	gboolean _has_nickname_row;
	gboolean _has_notes_row;
};

struct _Block21Data {
	int _ref_count_;
	ContactsContactEditor* self;
	ContactsTypeCombo* combo;
	GtkEntry* value_entry;
	GtkButton* delete_button;
};

struct _Block22Data {
	int _ref_count_;
	ContactsContactEditor* self;
	GtkEntry* value_entry;
	GtkButton* delete_button;
};

struct _Block23Data {
	int _ref_count_;
	ContactsContactEditor* self;
	GtkTextView* value_text;
	GtkButton* delete_button;
};

typedef void (*ContactsContactEditorAdjustingDateFn) (void* user_data);
struct _Block24Data {
	int _ref_count_;
	ContactsContactEditor* self;
	GtkSpinButton* day_spin;
	GtkComboBoxText* combo;
	GtkSpinButton* year_spin;
	GtkButton* delete_button;
	ContactsContactEditorAdjustingDateFn fn;
	gpointer fn_target;
	GDestroyNotify fn_target_destroy_notify;
};

struct _Block25Data {
	int _ref_count_;
	ContactsContactEditor* self;
	ContactsTypeCombo* combo;
	ContactsAddressEditor* value_address;
	GtkButton* delete_button;
};

struct _Block26Data {
	int _ref_count_;
	ContactsContactEditor* self;
	ContactsContactFrame* image_frame;
	GtkEntry* name_entry;
	ContactsContact* c;
};

struct _ContactsContact {
	GObject parent_instance;
	ContactsContactPrivate * priv;
	ContactsStore* store;
	gboolean is_main;
	FolksPresenceType presence_type;
	gchar* presence_message;
	gboolean is_phone;
	FolksIndividual* individual;
	FolksPersona* fake_persona;
};

struct _ContactsContactClass {
	GObjectClass parent_class;
};

struct _ContactsContactEditorPropertyData {
	FolksPersona* persona;
	GValue value;
};

struct _Block27Data {
	int _ref_count_;
	ContactsContactEditor* self;
	ContactsContactFrame* image_frame;
	GtkEntry* name_entry;
};


static gpointer contacts_address_editor_parent_class = NULL;
extern gchar** contacts_address_editor_postal_element_names;
extern gint contacts_address_editor_postal_element_names_length1;
gchar** contacts_address_editor_postal_element_names = NULL;
gint contacts_address_editor_postal_element_names_length1 = 0;
static gpointer contacts_contact_editor_parent_class = NULL;

GType contacts_address_editor_get_type (void) G_GNUC_CONST;
enum  {
	CONTACTS_ADDRESS_EDITOR_DUMMY_PROPERTY
};
ContactsAddressEditor* contacts_address_editor_new (FolksPostalAddressFieldDetails* _details);
ContactsAddressEditor* contacts_address_editor_construct (GType object_type, FolksPostalAddressFieldDetails* _details);
static void _____lambda40_ (ContactsAddressEditor* self);
static void ______lambda40__gtk_editable_changed (GtkEditable* _sender, gpointer self);
static void contacts_address_editor_real_grab_focus (GtkWidget* base);
static void contacts_address_editor_finalize (GObject* obj);
GType contacts_contact_editor_get_type (void) G_GNUC_CONST;
GType contacts_contact_get_type (void) G_GNUC_CONST;
static GType contacts_contact_editor_field_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static GType contacts_contact_editor_row_data_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static ContactsContactEditorRowData* contacts_contact_editor_row_data_dup (const ContactsContactEditorRowData* self);
static void contacts_contact_editor_row_data_free (ContactsContactEditorRowData* self);
static void contacts_contact_editor_row_data_copy (const ContactsContactEditorRowData* self, ContactsContactEditorRowData* dest);
static void contacts_contact_editor_row_data_destroy (ContactsContactEditorRowData* self);
static ContactsContactEditorField* contacts_contact_editor_field_dup (const ContactsContactEditorField* self);
static void contacts_contact_editor_field_free (ContactsContactEditorField* self);
static void contacts_contact_editor_field_copy (const ContactsContactEditorField* self, ContactsContactEditorField* dest);
static void contacts_contact_editor_field_destroy (ContactsContactEditorField* self);
#define CONTACTS_CONTACT_EDITOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CONTACTS_TYPE_CONTACT_EDITOR, ContactsContactEditorPrivate))
enum  {
	CONTACTS_CONTACT_EDITOR_DUMMY_PROPERTY,
	CONTACTS_CONTACT_EDITOR_HAS_BIRTHDAY_ROW,
	CONTACTS_CONTACT_EDITOR_HAS_NICKNAME_ROW,
	CONTACTS_CONTACT_EDITOR_HAS_NOTES_ROW
};
static void contacts_contact_editor_get_value_from_emails (ContactsContactEditor* self, GeeHashMap* rows, GValue* result);
GType contacts_typecombo_get_type (void) G_GNUC_CONST;
void contacts_typecombo_update_details (ContactsTypeCombo* self, FolksAbstractFieldDetails* details);
static void contacts_contact_editor_get_value_from_phones (ContactsContactEditor* self, GeeHashMap* rows, GValue* result);
static void contacts_contact_editor_get_value_from_urls (ContactsContactEditor* self, GeeHashMap* rows, GValue* result);
static void contacts_contact_editor_get_value_from_nickname (ContactsContactEditor* self, GeeHashMap* rows, GValue* result);
static void contacts_contact_editor_get_value_from_birthday (ContactsContactEditor* self, GeeHashMap* rows, GValue* result);
static void contacts_contact_editor_get_value_from_notes (ContactsContactEditor* self, GeeHashMap* rows, GValue* result);
static void contacts_contact_editor_get_value_from_addresses (ContactsContactEditor* self, GeeHashMap* rows, GValue* result);
static void contacts_contact_editor_set_field_changed (ContactsContactEditor* self, gint row);
static void contacts_contact_editor_remove_row (ContactsContactEditor* self, gint row);
GType contacts_typeset_get_type (void) G_GNUC_CONST;
static void contacts_contact_editor_attach_row_with_entry (ContactsContactEditor* self, gint row, ContactsTypeSet* type_set, FolksAbstractFieldDetails* details, const gchar* value, const gchar* type);
static Block21Data* block21_data_ref (Block21Data* _data21_);
static void block21_data_unref (void * _userdata_);
ContactsTypeCombo* contacts_typecombo_new (ContactsTypeSet* type_set);
ContactsTypeCombo* contacts_typecombo_construct (GType object_type, ContactsTypeSet* type_set);
void contacts_typecombo_set_active (ContactsTypeCombo* self, FolksAbstractFieldDetails* details);
void contacts_typecombo_set_to (ContactsTypeCombo* self, const gchar* type);
ContactsTypeSet* contacts_typeset_get_email (void);
ContactsTypeSet* contacts_typeset_get_phone (void);
static void __lambda41_ (Block21Data* _data21_);
static gint contacts_contact_editor_get_current_row (ContactsContactEditor* self, GtkWidget* child);
static void ___lambda41__contacts_typecombo_changed (ContactsTypeCombo* _sender, gpointer self);
static void __lambda42_ (Block21Data* _data21_);
static void ___lambda42__gtk_editable_changed (GtkEditable* _sender, gpointer self);
static void __lambda43_ (Block21Data* _data21_);
static void ___lambda43__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void contacts_contact_editor_attach_row_with_entry_labeled (ContactsContactEditor* self, const gchar* title, FolksAbstractFieldDetails* details, const gchar* value, gint row);
static Block22Data* block22_data_ref (Block22Data* _data22_);
static void block22_data_unref (void * _userdata_);
static void __lambda44_ (Block22Data* _data22_);
static void ___lambda44__gtk_editable_changed (GtkEditable* _sender, gpointer self);
static void __lambda45_ (Block22Data* _data22_);
static void ___lambda45__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void contacts_contact_editor_attach_row_with_text_labeled (ContactsContactEditor* self, const gchar* title, FolksAbstractFieldDetails* details, const gchar* value, gint row);
static Block23Data* block23_data_ref (Block23Data* _data23_);
static void block23_data_unref (void * _userdata_);
static void __lambda46_ (Block23Data* _data23_);
static void ___lambda46__gtk_text_buffer_changed (GtkTextBuffer* _sender, gpointer self);
static void __lambda47_ (Block23Data* _data23_);
static void contacts_contact_editor_set_has_notes_row (ContactsContactEditor* self, gboolean value);
static void ___lambda47__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void contacts_contact_editor_attach_row_for_birthday (ContactsContactEditor* self, const gchar* title, FolksAbstractFieldDetails* details, GDateTime* birthday, gint row);
static Block24Data* block24_data_ref (Block24Data* _data24_);
static void block24_data_unref (void * _userdata_);
static void __lambda48_ (Block24Data* _data24_);
static gboolean _vala_int_array_contains (gint* stack, int stack_length, gint needle);
static void ___lambda48__contacts_contact_editor_adjusting_date_fn (gpointer self);
static void __lambda49_ (Block24Data* _data24_);
static void ___lambda49__gtk_editable_changed (GtkEditable* _sender, gpointer self);
static void __lambda50_ (Block24Data* _data24_);
static void ___lambda50__gtk_combo_box_changed (GtkComboBox* _sender, gpointer self);
static void __lambda51_ (Block24Data* _data24_);
static void ___lambda51__gtk_editable_changed (GtkEditable* _sender, gpointer self);
static void __lambda52_ (Block24Data* _data24_);
static void contacts_contact_editor_set_has_birthday_row (ContactsContactEditor* self, gboolean value);
static void ___lambda52__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void contacts_contact_editor_attach_row_for_address (ContactsContactEditor* self, gint row, ContactsTypeSet* type_set, FolksPostalAddressFieldDetails* details, const gchar* type);
static Block25Data* block25_data_ref (Block25Data* _data25_);
static void block25_data_unref (void * _userdata_);
static void __lambda53_ (Block25Data* _data25_);
static void ___lambda53__contacts_typecombo_changed (ContactsTypeCombo* _sender, gpointer self);
static void __lambda54_ (Block25Data* _data25_);
static void ___lambda54__contacts_address_editor_changed (ContactsAddressEditor* _sender, gpointer self);
static void __lambda55_ (Block25Data* _data25_);
static void ___lambda55__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void contacts_contact_editor_add_edit_row (ContactsContactEditor* self, FolksPersona* p, const gchar* prop_name, gint* row, gboolean add_empty, const gchar* type);
GeeArrayList* contacts_contact_sort_fields (GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, GeeCollection* fields);
gboolean contacts_is_set (const gchar* str);
static void contacts_contact_editor_set_has_nickname_row (ContactsContactEditor* self, gboolean value);
static void ____lambda56_ (ContactsContactEditor* self);
static void _____lambda56__gtk_button_clicked (GtkButton* _sender, gpointer self);
ContactsTypeSet* contacts_typeset_get_general (void);
static void contacts_contact_editor_insert_row_at (ContactsContactEditor* self, gint idx);
static void contacts_contact_editor_size_allocate_cb (ContactsContactEditor* self, GtkAllocation* alloc);
ContactsContactEditor* contacts_contact_editor_new (GSimpleActionGroup* editor_actions);
ContactsContactEditor* contacts_contact_editor_construct (GType object_type, GSimpleActionGroup* editor_actions);
GType center_get_type (void) G_GNUC_CONST;
Center* center_new (void);
Center* center_construct (GType object_type);
void center_set_max_width (Center* self, gint value);
void center_set_xalign (Center* self, gdouble value);
GtkBuilder* contacts_load_ui (const gchar* ui);
static void _contacts_contact_editor_size_allocate_cb_gtk_widget_size_allocate (GtkWidget* _sender, GtkAllocation* allocation, gpointer self);
void contacts_contact_editor_edit (ContactsContactEditor* self, ContactsContact* c);
GType contacts_contact_frame_get_type (void) G_GNUC_CONST;
static Block26Data* block26_data_ref (Block26Data* _data26_);
static void block26_data_unref (void * _userdata_);
gboolean contacts_contact_can_remove_personas (ContactsContact* self);
GType contacts_store_get_type (void) G_GNUC_CONST;
#define PROFILE_SIZE 96
ContactsContactFrame* contacts_contact_frame_new (gint size, gboolean with_button);
ContactsContactFrame* contacts_contact_frame_construct (GType object_type, gint size, gboolean with_button);
static void __lambda57_ (Block26Data* _data26_);
GType contacts_avatar_dialog_get_type (void) G_GNUC_CONST;
ContactsAvatarDialog* contacts_avatar_dialog_new (ContactsContact* contact);
ContactsAvatarDialog* contacts_avatar_dialog_construct (GType object_type, ContactsContact* contact);
static void __lambda64_ (Block26Data* _data26_, GIcon* icon);
void contacts_contact_frame_set_pixbuf (ContactsContactFrame* self, GdkPixbuf* a_pixbuf);
static void ___lambda64__contacts_avatar_dialog_set_avatar (ContactsAvatarDialog* _sender, GIcon* avatar_icon, gpointer self);
static void ___lambda57__contacts_contact_frame_clicked (ContactsContactFrame* _sender, gpointer self);
void contacts_contact_keep_widget_uptodate (ContactsContact* self, GtkWidget* w, GtkCallback callback, void* callback_target, GDestroyNotify callback_target_destroy_notify);
static void __lambda65_ (Block26Data* _data26_, GtkWidget* w);
void contacts_contact_frame_set_image (ContactsContactFrame* self, FolksAvatarDetails* details, ContactsContact* contact);
static void ___lambda65__gtk_callback (GtkWidget* widget, gpointer self);
const gchar* contacts_contact_get_display_name (ContactsContact* self);
static void __lambda66_ (Block26Data* _data26_);
static void ___lambda66__gtk_editable_changed (GtkEditable* _sender, gpointer self);
GeeList* contacts_contact_get_personas_for_display (ContactsContact* self);
gchar* contacts_contact_format_persona_store_name_for_contact (FolksPersona* persona);
gchar** contacts_contact_sort_persona_properties (gchar** props, int props_length1, int* result_length1);
void contacts_contact_editor_clear (ContactsContactEditor* self);
GType contacts_contact_editor_property_data_get_type (void) G_GNUC_CONST;
ContactsContactEditorPropertyData* contacts_contact_editor_property_data_dup (const ContactsContactEditorPropertyData* self);
void contacts_contact_editor_property_data_free (ContactsContactEditorPropertyData* self);
void contacts_contact_editor_property_data_copy (const ContactsContactEditorPropertyData* self, ContactsContactEditorPropertyData* dest);
void contacts_contact_editor_property_data_destroy (ContactsContactEditorPropertyData* self);
GeeHashMap* contacts_contact_editor_properties_changed (ContactsContactEditor* self);
FolksPersona* contacts_contact_find_persona_from_uid (ContactsContact* self, const gchar* uid);
gboolean contacts_contact_editor_name_changed (ContactsContactEditor* self);
void contacts_contact_editor_get_full_name_value (ContactsContactEditor* self, GValue* result);
gboolean contacts_contact_editor_avatar_changed (ContactsContactEditor* self);
void contacts_contact_editor_get_avatar_value (ContactsContactEditor* self, GValue* result);
void contacts_contact_editor_add_new_row_for_property (ContactsContactEditor* self, FolksPersona* p, const gchar* prop_name, const gchar* type);
ContactsFakePersona* contacts_fake_persona_new (ContactsContact* contact);
ContactsFakePersona* contacts_fake_persona_construct (GType object_type, ContactsContact* contact);
GType contacts_fake_persona_get_type (void) G_GNUC_CONST;
void contacts_contact_editor_set_new_contact (ContactsContactEditor* self);
static Block27Data* block27_data_ref (Block27Data* _data27_);
static void block27_data_unref (void * _userdata_);
static void __lambda67_ (Block27Data* _data27_);
static void __lambda68_ (Block27Data* _data27_, GIcon* icon);
static void ___lambda68__contacts_avatar_dialog_set_avatar (ContactsAvatarDialog* _sender, GIcon* avatar_icon, gpointer self);
static void ___lambda67__contacts_contact_frame_clicked (ContactsContactFrame* _sender, gpointer self);
static void __lambda69_ (Block27Data* _data27_);
static void ___lambda69__gtk_editable_changed (GtkEditable* _sender, gpointer self);
gboolean contacts_contact_editor_get_has_birthday_row (ContactsContactEditor* self);
gboolean contacts_contact_editor_get_has_nickname_row (ContactsContactEditor* self);
gboolean contacts_contact_editor_get_has_notes_row (ContactsContactEditor* self);
static void contacts_contact_editor_finalize (GObject* obj);
static void _vala_contacts_contact_editor_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_contacts_contact_editor_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
static gint _vala_array_length (gpointer array);

const gchar* CONTACTS_ADDRESS_EDITOR_postal_element_props[7] = {"street", "extension", "locality", "region", "postal_code", "po_box", "country"};

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


static void _____lambda40_ (ContactsAddressEditor* self) {
	g_signal_emit_by_name (self, "changed");
}


static void ______lambda40__gtk_editable_changed (GtkEditable* _sender, gpointer self) {
	_____lambda40_ ((ContactsAddressEditor*) self);
}


ContactsAddressEditor* contacts_address_editor_construct (GType object_type, FolksPostalAddressFieldDetails* _details) {
	ContactsAddressEditor * self = NULL;
	FolksPostalAddressFieldDetails* _tmp0_ = NULL;
	FolksPostalAddressFieldDetails* _tmp1_ = NULL;
	g_return_val_if_fail (_details != NULL, NULL);
	self = (ContactsAddressEditor*) g_object_new (object_type, NULL);
	gtk_widget_set_hexpand ((GtkWidget*) self, TRUE);
	gtk_orientable_set_orientation ((GtkOrientable*) self, GTK_ORIENTATION_VERTICAL);
	_tmp0_ = _details;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->details);
	self->details = _tmp1_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				gint _tmp4_ = 0;
				gchar* postal_part = NULL;
				FolksPostalAddressFieldDetails* _tmp5_ = NULL;
				gconstpointer _tmp6_ = NULL;
				FolksPostalAddress* _tmp7_ = NULL;
				gint _tmp8_ = 0;
				const gchar* _tmp9_ = NULL;
				gint _tmp10_ = 0;
				GtkEntry* _tmp11_ = NULL;
				GtkEntry* _tmp12_ = NULL;
				gint _tmp13_ = 0;
				GtkEntry* _tmp14_ = NULL;
				gint _tmp15_ = 0;
				GtkEntry* _tmp16_ = NULL;
				gchar** _tmp17_ = NULL;
				gint _tmp17__length1 = 0;
				gint _tmp18_ = 0;
				const gchar* _tmp19_ = NULL;
				const gchar* _tmp20_ = NULL;
				gint _tmp24_ = 0;
				GtkEntry* _tmp25_ = NULL;
				GtkStyleContext* _tmp26_ = NULL;
				gint _tmp27_ = 0;
				GtkEntry* _tmp28_ = NULL;
				GtkStyleContext* _tmp29_ = NULL;
				gint _tmp30_ = 0;
				GtkEntry* _tmp31_ = NULL;
				gint _tmp32_ = 0;
				GtkEntry* _tmp33_ = NULL;
				if (!_tmp2_) {
					gint _tmp3_ = 0;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = i;
				if (!(_tmp4_ < 7)) {
					break;
				}
				_tmp5_ = self->details;
				_tmp6_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp5_);
				_tmp7_ = _tmp6_;
				_tmp8_ = i;
				_tmp9_ = CONTACTS_ADDRESS_EDITOR_postal_element_props[_tmp8_];
				g_object_get ((GObject*) ((FolksPostalAddress*) _tmp7_), _tmp9_, &postal_part, NULL);
				_tmp10_ = i;
				_tmp11_ = (GtkEntry*) gtk_entry_new ();
				g_object_ref_sink (_tmp11_);
				_g_object_unref0 (self->entries[_tmp10_]);
				self->entries[_tmp10_] = _tmp11_;
				_tmp12_ = self->entries[_tmp10_];
				_tmp13_ = i;
				_tmp14_ = self->entries[_tmp13_];
				gtk_widget_set_hexpand ((GtkWidget*) _tmp14_, TRUE);
				_tmp15_ = i;
				_tmp16_ = self->entries[_tmp15_];
				_tmp17_ = contacts_address_editor_postal_element_names;
				_tmp17__length1 = contacts_address_editor_postal_element_names_length1;
				_tmp18_ = i;
				_tmp19_ = _tmp17_[_tmp18_];
				g_object_set ((GObject*) _tmp16_, "placeholder-text", _tmp19_, NULL);
				_tmp20_ = postal_part;
				if (_tmp20_ != NULL) {
					gint _tmp21_ = 0;
					GtkEntry* _tmp22_ = NULL;
					const gchar* _tmp23_ = NULL;
					_tmp21_ = i;
					_tmp22_ = self->entries[_tmp21_];
					_tmp23_ = postal_part;
					gtk_entry_set_text (_tmp22_, _tmp23_);
				}
				_tmp24_ = i;
				_tmp25_ = self->entries[_tmp24_];
				_tmp26_ = gtk_widget_get_style_context ((GtkWidget*) _tmp25_);
				gtk_style_context_add_class (_tmp26_, "contacts-entry");
				_tmp27_ = i;
				_tmp28_ = self->entries[_tmp27_];
				_tmp29_ = gtk_widget_get_style_context ((GtkWidget*) _tmp28_);
				gtk_style_context_add_class (_tmp29_, "contacts-postal-entry");
				_tmp30_ = i;
				_tmp31_ = self->entries[_tmp30_];
				gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp31_);
				_tmp32_ = i;
				_tmp33_ = self->entries[_tmp32_];
				g_signal_connect_object ((GtkEditable*) _tmp33_, "changed", (GCallback) ______lambda40__gtk_editable_changed, self, 0);
				_g_free0 (postal_part);
			}
		}
	}
	return self;
}


ContactsAddressEditor* contacts_address_editor_new (FolksPostalAddressFieldDetails* _details) {
	return contacts_address_editor_construct (CONTACTS_TYPE_ADDRESS_EDITOR, _details);
}


static void contacts_address_editor_real_grab_focus (GtkWidget* base) {
	ContactsAddressEditor * self;
	GtkEntry* _tmp0_ = NULL;
	self = (ContactsAddressEditor*) base;
	_tmp0_ = self->entries[0];
	gtk_widget_grab_focus ((GtkWidget*) _tmp0_);
}


static void contacts_address_editor_class_init (ContactsAddressEditorClass * klass) {
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	const gchar* _tmp2_ = NULL;
	gchar* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	gchar* _tmp5_ = NULL;
	const gchar* _tmp6_ = NULL;
	gchar* _tmp7_ = NULL;
	const gchar* _tmp8_ = NULL;
	gchar* _tmp9_ = NULL;
	const gchar* _tmp10_ = NULL;
	gchar* _tmp11_ = NULL;
	const gchar* _tmp12_ = NULL;
	gchar* _tmp13_ = NULL;
	gchar** _tmp14_ = NULL;
	contacts_address_editor_parent_class = g_type_class_peek_parent (klass);
	((GtkWidgetClass *) klass)->grab_focus = contacts_address_editor_real_grab_focus;
	G_OBJECT_CLASS (klass)->finalize = contacts_address_editor_finalize;
	g_signal_new ("changed", CONTACTS_TYPE_ADDRESS_EDITOR, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	_tmp0_ = _ ("Street");
	_tmp1_ = g_strdup (_tmp0_);
	_tmp2_ = _ ("Extension");
	_tmp3_ = g_strdup (_tmp2_);
	_tmp4_ = _ ("City");
	_tmp5_ = g_strdup (_tmp4_);
	_tmp6_ = _ ("State/Province");
	_tmp7_ = g_strdup (_tmp6_);
	_tmp8_ = _ ("Zip/Postal Code");
	_tmp9_ = g_strdup (_tmp8_);
	_tmp10_ = _ ("PO box");
	_tmp11_ = g_strdup (_tmp10_);
	_tmp12_ = _ ("Country");
	_tmp13_ = g_strdup (_tmp12_);
	_tmp14_ = g_new0 (gchar*, 7 + 1);
	_tmp14_[0] = _tmp1_;
	_tmp14_[1] = _tmp3_;
	_tmp14_[2] = _tmp5_;
	_tmp14_[3] = _tmp7_;
	_tmp14_[4] = _tmp9_;
	_tmp14_[5] = _tmp11_;
	_tmp14_[6] = _tmp13_;
	contacts_address_editor_postal_element_names = _tmp14_;
	contacts_address_editor_postal_element_names_length1 = 7;
}


static void contacts_address_editor_instance_init (ContactsAddressEditor * self) {
}


static void contacts_address_editor_finalize (GObject* obj) {
	ContactsAddressEditor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONTACTS_TYPE_ADDRESS_EDITOR, ContactsAddressEditor);
	_vala_array_destroy (self->entries, 7, (GDestroyNotify) g_object_unref);
	_g_object_unref0 (self->details);
	G_OBJECT_CLASS (contacts_address_editor_parent_class)->finalize (obj);
}


GType contacts_address_editor_get_type (void) {
	static volatile gsize contacts_address_editor_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_address_editor_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ContactsAddressEditorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) contacts_address_editor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ContactsAddressEditor), 0, (GInstanceInitFunc) contacts_address_editor_instance_init, NULL };
		GType contacts_address_editor_type_id;
		contacts_address_editor_type_id = g_type_register_static (gtk_box_get_type (), "ContactsAddressEditor", &g_define_type_info, 0);
		g_once_init_leave (&contacts_address_editor_type_id__volatile, contacts_address_editor_type_id);
	}
	return contacts_address_editor_type_id__volatile;
}


static void contacts_contact_editor_get_value_from_emails (ContactsContactEditor* self, GeeHashMap* rows, GValue* result) {
	GeeHashSet* new_details = NULL;
	GeeHashSet* _tmp0_ = NULL;
	GValue new_value = {0};
	GeeHashSet* _tmp41_ = NULL;
	GType _tmp42_ = 0UL;
	GValue _tmp43_ = {0};
	GeeHashSet* _tmp44_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (rows != NULL);
	_tmp0_ = gee_hash_set_new (FOLKS_TYPE_EMAIL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	new_details = _tmp0_;
	{
		GeeIterator* _row_entry_it = NULL;
		GeeHashMap* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeSet* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _tmp6_ = NULL;
		_tmp1_ = rows;
		_tmp2_ = gee_abstract_map_get_entries ((GeeMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_row_entry_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			GeeMapEntry* row_entry = NULL;
			GeeIterator* _tmp9_ = NULL;
			gpointer _tmp10_ = NULL;
			ContactsTypeCombo* combo = NULL;
			GtkGrid* _tmp11_ = NULL;
			GeeMapEntry* _tmp12_ = NULL;
			gconstpointer _tmp13_ = NULL;
			gint _tmp14_ = 0;
			GtkWidget* _tmp15_ = NULL;
			ContactsTypeCombo* _tmp16_ = NULL;
			GtkEntry* entry = NULL;
			GtkGrid* _tmp17_ = NULL;
			GeeMapEntry* _tmp18_ = NULL;
			gconstpointer _tmp19_ = NULL;
			gint _tmp20_ = 0;
			GtkWidget* _tmp21_ = NULL;
			GtkEntry* _tmp22_ = NULL;
			GtkEntry* _tmp23_ = NULL;
			const gchar* _tmp24_ = NULL;
			ContactsTypeCombo* _tmp25_ = NULL;
			GeeMapEntry* _tmp26_ = NULL;
			gconstpointer _tmp27_ = NULL;
			ContactsContactEditorRowData* _tmp28_ = NULL;
			FolksAbstractFieldDetails* _tmp29_ = NULL;
			FolksEmailFieldDetails* details = NULL;
			GtkEntry* _tmp30_ = NULL;
			const gchar* _tmp31_ = NULL;
			GeeMapEntry* _tmp32_ = NULL;
			gconstpointer _tmp33_ = NULL;
			ContactsContactEditorRowData* _tmp34_ = NULL;
			FolksAbstractFieldDetails* _tmp35_ = NULL;
			GeeMultiMap* _tmp36_ = NULL;
			GeeMultiMap* _tmp37_ = NULL;
			FolksEmailFieldDetails* _tmp38_ = NULL;
			GeeHashSet* _tmp39_ = NULL;
			FolksEmailFieldDetails* _tmp40_ = NULL;
			_tmp7_ = _row_entry_it;
			_tmp8_ = gee_iterator_next (_tmp7_);
			if (!_tmp8_) {
				break;
			}
			_tmp9_ = _row_entry_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			row_entry = (GeeMapEntry*) _tmp10_;
			_tmp11_ = self->priv->container_grid;
			_tmp12_ = row_entry;
			_tmp13_ = gee_map_entry_get_key (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = gtk_grid_get_child_at (_tmp11_, 0, (gint) ((gintptr) _tmp14_));
			_tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, CONTACTS_TYPE_TYPECOMBO) ? ((ContactsTypeCombo*) _tmp15_) : NULL);
			combo = _tmp16_;
			_tmp17_ = self->priv->container_grid;
			_tmp18_ = row_entry;
			_tmp19_ = gee_map_entry_get_key (_tmp18_);
			_tmp20_ = _tmp19_;
			_tmp21_ = gtk_grid_get_child_at (_tmp17_, 1, (gint) ((gintptr) _tmp20_));
			_tmp22_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp21_, gtk_entry_get_type ()) ? ((GtkEntry*) _tmp21_) : NULL);
			entry = _tmp22_;
			_tmp23_ = entry;
			_tmp24_ = gtk_entry_get_text (_tmp23_);
			if (g_strcmp0 (_tmp24_, "") == 0) {
				_g_object_unref0 (entry);
				_g_object_unref0 (combo);
				_g_object_unref0 (row_entry);
				continue;
			}
			_tmp25_ = combo;
			_tmp26_ = row_entry;
			_tmp27_ = gee_map_entry_get_value (_tmp26_);
			_tmp28_ = _tmp27_;
			_tmp29_ = (*((ContactsContactEditorRowData*) _tmp28_)).details;
			contacts_typecombo_update_details (_tmp25_, _tmp29_);
			_tmp30_ = entry;
			_tmp31_ = gtk_entry_get_text (_tmp30_);
			_tmp32_ = row_entry;
			_tmp33_ = gee_map_entry_get_value (_tmp32_);
			_tmp34_ = _tmp33_;
			_tmp35_ = (*((ContactsContactEditorRowData*) _tmp34_)).details;
			_tmp36_ = folks_abstract_field_details_get_parameters (_tmp35_);
			_tmp37_ = _tmp36_;
			_tmp38_ = folks_email_field_details_new (_tmp31_, _tmp37_);
			details = _tmp38_;
			_tmp39_ = new_details;
			_tmp40_ = details;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp39_, _tmp40_);
			_g_object_unref0 (details);
			_g_object_unref0 (entry);
			_g_object_unref0 (combo);
			_g_object_unref0 (row_entry);
		}
		_g_object_unref0 (_row_entry_it);
	}
	_tmp41_ = new_details;
	_tmp42_ = G_TYPE_FROM_INSTANCE ((GObject*) _tmp41_);
	g_value_init (&_tmp43_, _tmp42_);
	new_value = _tmp43_;
	_tmp44_ = new_details;
	g_value_set_object (&new_value, (GObject*) _tmp44_);
	*result = new_value;
	_g_object_unref0 (new_details);
	return;
}


static void contacts_contact_editor_get_value_from_phones (ContactsContactEditor* self, GeeHashMap* rows, GValue* result) {
	GeeHashSet* new_details = NULL;
	GeeHashSet* _tmp0_ = NULL;
	GValue new_value = {0};
	GeeHashSet* _tmp41_ = NULL;
	GType _tmp42_ = 0UL;
	GValue _tmp43_ = {0};
	GeeHashSet* _tmp44_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (rows != NULL);
	_tmp0_ = gee_hash_set_new (FOLKS_TYPE_PHONE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	new_details = _tmp0_;
	{
		GeeIterator* _row_entry_it = NULL;
		GeeHashMap* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeSet* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _tmp6_ = NULL;
		_tmp1_ = rows;
		_tmp2_ = gee_abstract_map_get_entries ((GeeMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_row_entry_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			GeeMapEntry* row_entry = NULL;
			GeeIterator* _tmp9_ = NULL;
			gpointer _tmp10_ = NULL;
			ContactsTypeCombo* combo = NULL;
			GtkGrid* _tmp11_ = NULL;
			GeeMapEntry* _tmp12_ = NULL;
			gconstpointer _tmp13_ = NULL;
			gint _tmp14_ = 0;
			GtkWidget* _tmp15_ = NULL;
			ContactsTypeCombo* _tmp16_ = NULL;
			GtkEntry* entry = NULL;
			GtkGrid* _tmp17_ = NULL;
			GeeMapEntry* _tmp18_ = NULL;
			gconstpointer _tmp19_ = NULL;
			gint _tmp20_ = 0;
			GtkWidget* _tmp21_ = NULL;
			GtkEntry* _tmp22_ = NULL;
			GtkEntry* _tmp23_ = NULL;
			const gchar* _tmp24_ = NULL;
			ContactsTypeCombo* _tmp25_ = NULL;
			GeeMapEntry* _tmp26_ = NULL;
			gconstpointer _tmp27_ = NULL;
			ContactsContactEditorRowData* _tmp28_ = NULL;
			FolksAbstractFieldDetails* _tmp29_ = NULL;
			FolksPhoneFieldDetails* details = NULL;
			GtkEntry* _tmp30_ = NULL;
			const gchar* _tmp31_ = NULL;
			GeeMapEntry* _tmp32_ = NULL;
			gconstpointer _tmp33_ = NULL;
			ContactsContactEditorRowData* _tmp34_ = NULL;
			FolksAbstractFieldDetails* _tmp35_ = NULL;
			GeeMultiMap* _tmp36_ = NULL;
			GeeMultiMap* _tmp37_ = NULL;
			FolksPhoneFieldDetails* _tmp38_ = NULL;
			GeeHashSet* _tmp39_ = NULL;
			FolksPhoneFieldDetails* _tmp40_ = NULL;
			_tmp7_ = _row_entry_it;
			_tmp8_ = gee_iterator_next (_tmp7_);
			if (!_tmp8_) {
				break;
			}
			_tmp9_ = _row_entry_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			row_entry = (GeeMapEntry*) _tmp10_;
			_tmp11_ = self->priv->container_grid;
			_tmp12_ = row_entry;
			_tmp13_ = gee_map_entry_get_key (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = gtk_grid_get_child_at (_tmp11_, 0, (gint) ((gintptr) _tmp14_));
			_tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, CONTACTS_TYPE_TYPECOMBO) ? ((ContactsTypeCombo*) _tmp15_) : NULL);
			combo = _tmp16_;
			_tmp17_ = self->priv->container_grid;
			_tmp18_ = row_entry;
			_tmp19_ = gee_map_entry_get_key (_tmp18_);
			_tmp20_ = _tmp19_;
			_tmp21_ = gtk_grid_get_child_at (_tmp17_, 1, (gint) ((gintptr) _tmp20_));
			_tmp22_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp21_, gtk_entry_get_type ()) ? ((GtkEntry*) _tmp21_) : NULL);
			entry = _tmp22_;
			_tmp23_ = entry;
			_tmp24_ = gtk_entry_get_text (_tmp23_);
			if (g_strcmp0 (_tmp24_, "") == 0) {
				_g_object_unref0 (entry);
				_g_object_unref0 (combo);
				_g_object_unref0 (row_entry);
				continue;
			}
			_tmp25_ = combo;
			_tmp26_ = row_entry;
			_tmp27_ = gee_map_entry_get_value (_tmp26_);
			_tmp28_ = _tmp27_;
			_tmp29_ = (*((ContactsContactEditorRowData*) _tmp28_)).details;
			contacts_typecombo_update_details (_tmp25_, _tmp29_);
			_tmp30_ = entry;
			_tmp31_ = gtk_entry_get_text (_tmp30_);
			_tmp32_ = row_entry;
			_tmp33_ = gee_map_entry_get_value (_tmp32_);
			_tmp34_ = _tmp33_;
			_tmp35_ = (*((ContactsContactEditorRowData*) _tmp34_)).details;
			_tmp36_ = folks_abstract_field_details_get_parameters (_tmp35_);
			_tmp37_ = _tmp36_;
			_tmp38_ = folks_phone_field_details_new (_tmp31_, _tmp37_);
			details = _tmp38_;
			_tmp39_ = new_details;
			_tmp40_ = details;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp39_, _tmp40_);
			_g_object_unref0 (details);
			_g_object_unref0 (entry);
			_g_object_unref0 (combo);
			_g_object_unref0 (row_entry);
		}
		_g_object_unref0 (_row_entry_it);
	}
	_tmp41_ = new_details;
	_tmp42_ = G_TYPE_FROM_INSTANCE ((GObject*) _tmp41_);
	g_value_init (&_tmp43_, _tmp42_);
	new_value = _tmp43_;
	_tmp44_ = new_details;
	g_value_set_object (&new_value, (GObject*) _tmp44_);
	*result = new_value;
	_g_object_unref0 (new_details);
	return;
}


static void contacts_contact_editor_get_value_from_urls (ContactsContactEditor* self, GeeHashMap* rows, GValue* result) {
	GeeHashSet* new_details = NULL;
	GeeHashSet* _tmp0_ = NULL;
	GValue new_value = {0};
	GeeHashSet* _tmp30_ = NULL;
	GType _tmp31_ = 0UL;
	GValue _tmp32_ = {0};
	GeeHashSet* _tmp33_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (rows != NULL);
	_tmp0_ = gee_hash_set_new (FOLKS_TYPE_URL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	new_details = _tmp0_;
	{
		GeeIterator* _row_entry_it = NULL;
		GeeHashMap* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeSet* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _tmp6_ = NULL;
		_tmp1_ = rows;
		_tmp2_ = gee_abstract_map_get_entries ((GeeMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_row_entry_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			GeeMapEntry* row_entry = NULL;
			GeeIterator* _tmp9_ = NULL;
			gpointer _tmp10_ = NULL;
			GtkEntry* entry = NULL;
			GtkGrid* _tmp11_ = NULL;
			GeeMapEntry* _tmp12_ = NULL;
			gconstpointer _tmp13_ = NULL;
			gint _tmp14_ = 0;
			GtkWidget* _tmp15_ = NULL;
			GtkEntry* _tmp16_ = NULL;
			GtkEntry* _tmp17_ = NULL;
			const gchar* _tmp18_ = NULL;
			FolksUrlFieldDetails* details = NULL;
			GtkEntry* _tmp19_ = NULL;
			const gchar* _tmp20_ = NULL;
			GeeMapEntry* _tmp21_ = NULL;
			gconstpointer _tmp22_ = NULL;
			ContactsContactEditorRowData* _tmp23_ = NULL;
			FolksAbstractFieldDetails* _tmp24_ = NULL;
			GeeMultiMap* _tmp25_ = NULL;
			GeeMultiMap* _tmp26_ = NULL;
			FolksUrlFieldDetails* _tmp27_ = NULL;
			GeeHashSet* _tmp28_ = NULL;
			FolksUrlFieldDetails* _tmp29_ = NULL;
			_tmp7_ = _row_entry_it;
			_tmp8_ = gee_iterator_next (_tmp7_);
			if (!_tmp8_) {
				break;
			}
			_tmp9_ = _row_entry_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			row_entry = (GeeMapEntry*) _tmp10_;
			_tmp11_ = self->priv->container_grid;
			_tmp12_ = row_entry;
			_tmp13_ = gee_map_entry_get_key (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = gtk_grid_get_child_at (_tmp11_, 1, (gint) ((gintptr) _tmp14_));
			_tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, gtk_entry_get_type ()) ? ((GtkEntry*) _tmp15_) : NULL);
			entry = _tmp16_;
			_tmp17_ = entry;
			_tmp18_ = gtk_entry_get_text (_tmp17_);
			if (g_strcmp0 (_tmp18_, "") == 0) {
				_g_object_unref0 (entry);
				_g_object_unref0 (row_entry);
				continue;
			}
			_tmp19_ = entry;
			_tmp20_ = gtk_entry_get_text (_tmp19_);
			_tmp21_ = row_entry;
			_tmp22_ = gee_map_entry_get_value (_tmp21_);
			_tmp23_ = _tmp22_;
			_tmp24_ = (*((ContactsContactEditorRowData*) _tmp23_)).details;
			_tmp25_ = folks_abstract_field_details_get_parameters (_tmp24_);
			_tmp26_ = _tmp25_;
			_tmp27_ = folks_url_field_details_new (_tmp20_, _tmp26_);
			details = _tmp27_;
			_tmp28_ = new_details;
			_tmp29_ = details;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp28_, _tmp29_);
			_g_object_unref0 (details);
			_g_object_unref0 (entry);
			_g_object_unref0 (row_entry);
		}
		_g_object_unref0 (_row_entry_it);
	}
	_tmp30_ = new_details;
	_tmp31_ = G_TYPE_FROM_INSTANCE ((GObject*) _tmp30_);
	g_value_init (&_tmp32_, _tmp31_);
	new_value = _tmp32_;
	_tmp33_ = new_details;
	g_value_set_object (&new_value, (GObject*) _tmp33_);
	*result = new_value;
	_g_object_unref0 (new_details);
	return;
}


static void contacts_contact_editor_get_value_from_nickname (ContactsContactEditor* self, GeeHashMap* rows, GValue* result) {
	GValue new_value = {0};
	GValue _tmp0_ = {0};
	g_return_if_fail (self != NULL);
	g_return_if_fail (rows != NULL);
	g_value_init (&_tmp0_, G_TYPE_STRING);
	new_value = _tmp0_;
	{
		GeeIterator* _row_entry_it = NULL;
		GeeHashMap* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeSet* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _tmp6_ = NULL;
		_tmp1_ = rows;
		_tmp2_ = gee_abstract_map_get_entries ((GeeMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_row_entry_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			GeeMapEntry* row_entry = NULL;
			GeeIterator* _tmp9_ = NULL;
			gpointer _tmp10_ = NULL;
			GtkEntry* entry = NULL;
			GtkGrid* _tmp11_ = NULL;
			GeeMapEntry* _tmp12_ = NULL;
			gconstpointer _tmp13_ = NULL;
			gint _tmp14_ = 0;
			GtkWidget* _tmp15_ = NULL;
			GtkEntry* _tmp16_ = NULL;
			GtkEntry* _tmp17_ = NULL;
			const gchar* _tmp18_ = NULL;
			GtkEntry* _tmp19_ = NULL;
			const gchar* _tmp20_ = NULL;
			_tmp7_ = _row_entry_it;
			_tmp8_ = gee_iterator_next (_tmp7_);
			if (!_tmp8_) {
				break;
			}
			_tmp9_ = _row_entry_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			row_entry = (GeeMapEntry*) _tmp10_;
			_tmp11_ = self->priv->container_grid;
			_tmp12_ = row_entry;
			_tmp13_ = gee_map_entry_get_key (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = gtk_grid_get_child_at (_tmp11_, 1, (gint) ((gintptr) _tmp14_));
			_tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, gtk_entry_get_type ()) ? ((GtkEntry*) _tmp15_) : NULL);
			entry = _tmp16_;
			_tmp17_ = entry;
			_tmp18_ = gtk_entry_get_text (_tmp17_);
			if (g_strcmp0 (_tmp18_, "") == 0) {
				_g_object_unref0 (entry);
				_g_object_unref0 (row_entry);
				continue;
			}
			_tmp19_ = entry;
			_tmp20_ = gtk_entry_get_text (_tmp19_);
			g_value_set_string (&new_value, _tmp20_);
			_g_object_unref0 (entry);
			_g_object_unref0 (row_entry);
		}
		_g_object_unref0 (_row_entry_it);
	}
	*result = new_value;
	return;
}


static void contacts_contact_editor_get_value_from_birthday (ContactsContactEditor* self, GeeHashMap* rows, GValue* result) {
	GValue new_value = {0};
	GValue _tmp0_ = {0};
	g_return_if_fail (self != NULL);
	g_return_if_fail (rows != NULL);
	g_value_init (&_tmp0_, G_TYPE_DATE_TIME);
	new_value = _tmp0_;
	{
		GeeIterator* _row_entry_it = NULL;
		GeeHashMap* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeSet* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _tmp6_ = NULL;
		_tmp1_ = rows;
		_tmp2_ = gee_abstract_map_get_entries ((GeeMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_row_entry_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			GeeMapEntry* row_entry = NULL;
			GeeIterator* _tmp9_ = NULL;
			gpointer _tmp10_ = NULL;
			GtkGrid* box = NULL;
			GtkGrid* _tmp11_ = NULL;
			GeeMapEntry* _tmp12_ = NULL;
			gconstpointer _tmp13_ = NULL;
			gint _tmp14_ = 0;
			GtkWidget* _tmp15_ = NULL;
			GtkGrid* _tmp16_ = NULL;
			GtkSpinButton* day_spin = NULL;
			GtkGrid* _tmp17_ = NULL;
			GtkWidget* _tmp18_ = NULL;
			GtkSpinButton* _tmp19_ = NULL;
			GtkComboBoxText* combo = NULL;
			GtkGrid* _tmp20_ = NULL;
			GtkWidget* _tmp21_ = NULL;
			GtkComboBoxText* _tmp22_ = NULL;
			GtkSpinButton* year_spin = NULL;
			GtkGrid* _tmp23_ = NULL;
			GtkWidget* _tmp24_ = NULL;
			GtkSpinButton* _tmp25_ = NULL;
			GDateTime* bday = NULL;
			GtkSpinButton* _tmp26_ = NULL;
			gint _tmp27_ = 0;
			GtkComboBoxText* _tmp28_ = NULL;
			gint _tmp29_ = 0;
			GtkSpinButton* _tmp30_ = NULL;
			gint _tmp31_ = 0;
			GDateTime* _tmp32_ = NULL;
			GDateTime* _tmp33_ = NULL;
			GDateTime* _tmp34_ = NULL;
			GDateTime* _tmp35_ = NULL;
			_tmp7_ = _row_entry_it;
			_tmp8_ = gee_iterator_next (_tmp7_);
			if (!_tmp8_) {
				break;
			}
			_tmp9_ = _row_entry_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			row_entry = (GeeMapEntry*) _tmp10_;
			_tmp11_ = self->priv->container_grid;
			_tmp12_ = row_entry;
			_tmp13_ = gee_map_entry_get_key (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = gtk_grid_get_child_at (_tmp11_, 1, (gint) ((gintptr) _tmp14_));
			_tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, gtk_grid_get_type ()) ? ((GtkGrid*) _tmp15_) : NULL);
			box = _tmp16_;
			_tmp17_ = box;
			_tmp18_ = gtk_grid_get_child_at (_tmp17_, 0, 0);
			_tmp19_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp18_, gtk_spin_button_get_type ()) ? ((GtkSpinButton*) _tmp18_) : NULL);
			day_spin = _tmp19_;
			_tmp20_ = box;
			_tmp21_ = gtk_grid_get_child_at (_tmp20_, 1, 0);
			_tmp22_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp21_, gtk_combo_box_text_get_type ()) ? ((GtkComboBoxText*) _tmp21_) : NULL);
			combo = _tmp22_;
			_tmp23_ = box;
			_tmp24_ = gtk_grid_get_child_at (_tmp23_, 2, 0);
			_tmp25_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp24_, gtk_spin_button_get_type ()) ? ((GtkSpinButton*) _tmp24_) : NULL);
			year_spin = _tmp25_;
			_tmp26_ = year_spin;
			_tmp27_ = gtk_spin_button_get_value_as_int (_tmp26_);
			_tmp28_ = combo;
			_tmp29_ = gtk_combo_box_get_active ((GtkComboBox*) _tmp28_);
			_tmp30_ = day_spin;
			_tmp31_ = gtk_spin_button_get_value_as_int (_tmp30_);
			_tmp32_ = g_date_time_new_local (_tmp27_, _tmp29_ + 1, _tmp31_, 0, 0, (gdouble) 0);
			bday = _tmp32_;
			_tmp33_ = bday;
			_tmp34_ = g_date_time_to_utc (_tmp33_);
			_g_date_time_unref0 (bday);
			bday = _tmp34_;
			_tmp35_ = bday;
			g_value_set_boxed (&new_value, _tmp35_);
			_g_date_time_unref0 (bday);
			_g_object_unref0 (year_spin);
			_g_object_unref0 (combo);
			_g_object_unref0 (day_spin);
			_g_object_unref0 (box);
			_g_object_unref0 (row_entry);
		}
		_g_object_unref0 (_row_entry_it);
	}
	*result = new_value;
	return;
}


static void contacts_contact_editor_get_value_from_notes (ContactsContactEditor* self, GeeHashMap* rows, GValue* result) {
	GeeHashSet* new_details = NULL;
	GeeHashSet* _tmp0_ = NULL;
	GValue new_value = {0};
	GeeHashSet* _tmp40_ = NULL;
	GType _tmp41_ = 0UL;
	GValue _tmp42_ = {0};
	GeeHashSet* _tmp43_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (rows != NULL);
	_tmp0_ = gee_hash_set_new (FOLKS_TYPE_NOTE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	new_details = _tmp0_;
	{
		GeeIterator* _row_entry_it = NULL;
		GeeHashMap* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeSet* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _tmp6_ = NULL;
		_tmp1_ = rows;
		_tmp2_ = gee_abstract_map_get_entries ((GeeMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_row_entry_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			GeeMapEntry* row_entry = NULL;
			GeeIterator* _tmp9_ = NULL;
			gpointer _tmp10_ = NULL;
			GtkTextView* text = NULL;
			GtkGrid* _tmp11_ = NULL;
			GeeMapEntry* _tmp12_ = NULL;
			gconstpointer _tmp13_ = NULL;
			gint _tmp14_ = 0;
			GtkWidget* _tmp15_ = NULL;
			GtkWidget* _tmp16_ = NULL;
			GtkTextView* _tmp17_ = NULL;
			GtkTextIter start = {0};
			GtkTextIter end = {0};
			GtkTextView* _tmp18_ = NULL;
			GtkTextBuffer* _tmp19_ = NULL;
			GtkTextIter _tmp20_ = {0};
			GtkTextView* _tmp21_ = NULL;
			GtkTextBuffer* _tmp22_ = NULL;
			GtkTextIter _tmp23_ = {0};
			gchar* value = NULL;
			GtkTextView* _tmp24_ = NULL;
			GtkTextBuffer* _tmp25_ = NULL;
			GtkTextIter _tmp26_ = {0};
			GtkTextIter _tmp27_ = {0};
			gchar* _tmp28_ = NULL;
			const gchar* _tmp29_ = NULL;
			_tmp7_ = _row_entry_it;
			_tmp8_ = gee_iterator_next (_tmp7_);
			if (!_tmp8_) {
				break;
			}
			_tmp9_ = _row_entry_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			row_entry = (GeeMapEntry*) _tmp10_;
			_tmp11_ = self->priv->container_grid;
			_tmp12_ = row_entry;
			_tmp13_ = gee_map_entry_get_key (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = gtk_grid_get_child_at (_tmp11_, 1, (gint) ((gintptr) _tmp14_));
			_tmp16_ = gtk_bin_get_child (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, gtk_bin_get_type ()) ? ((GtkBin*) _tmp15_) : NULL);
			_tmp17_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp16_, gtk_text_view_get_type ()) ? ((GtkTextView*) _tmp16_) : NULL);
			text = _tmp17_;
			_tmp18_ = text;
			_tmp19_ = gtk_text_view_get_buffer (_tmp18_);
			gtk_text_buffer_get_start_iter (_tmp19_, &_tmp20_);
			start = _tmp20_;
			_tmp21_ = text;
			_tmp22_ = gtk_text_view_get_buffer (_tmp21_);
			gtk_text_buffer_get_end_iter (_tmp22_, &_tmp23_);
			end = _tmp23_;
			_tmp24_ = text;
			_tmp25_ = gtk_text_view_get_buffer (_tmp24_);
			_tmp26_ = start;
			_tmp27_ = end;
			_tmp28_ = gtk_text_buffer_get_text (_tmp25_, &_tmp26_, &_tmp27_, TRUE);
			value = _tmp28_;
			_tmp29_ = value;
			if (g_strcmp0 (_tmp29_, "") != 0) {
				FolksNoteFieldDetails* details = NULL;
				const gchar* _tmp30_ = NULL;
				GeeMapEntry* _tmp31_ = NULL;
				gconstpointer _tmp32_ = NULL;
				ContactsContactEditorRowData* _tmp33_ = NULL;
				FolksAbstractFieldDetails* _tmp34_ = NULL;
				GeeMultiMap* _tmp35_ = NULL;
				GeeMultiMap* _tmp36_ = NULL;
				FolksNoteFieldDetails* _tmp37_ = NULL;
				GeeHashSet* _tmp38_ = NULL;
				FolksNoteFieldDetails* _tmp39_ = NULL;
				_tmp30_ = value;
				_tmp31_ = row_entry;
				_tmp32_ = gee_map_entry_get_value (_tmp31_);
				_tmp33_ = _tmp32_;
				_tmp34_ = (*((ContactsContactEditorRowData*) _tmp33_)).details;
				_tmp35_ = folks_abstract_field_details_get_parameters (_tmp34_);
				_tmp36_ = _tmp35_;
				_tmp37_ = folks_note_field_details_new (_tmp30_, _tmp36_, NULL);
				details = _tmp37_;
				_tmp38_ = new_details;
				_tmp39_ = details;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp38_, _tmp39_);
				_g_object_unref0 (details);
			}
			_g_free0 (value);
			_g_object_unref0 (text);
			_g_object_unref0 (row_entry);
		}
		_g_object_unref0 (_row_entry_it);
	}
	_tmp40_ = new_details;
	_tmp41_ = G_TYPE_FROM_INSTANCE ((GObject*) _tmp40_);
	g_value_init (&_tmp42_, _tmp41_);
	new_value = _tmp42_;
	_tmp43_ = new_details;
	g_value_set_object (&new_value, (GObject*) _tmp43_);
	*result = new_value;
	_g_object_unref0 (new_details);
	return;
}


static void contacts_contact_editor_get_value_from_addresses (ContactsContactEditor* self, GeeHashMap* rows, GValue* result) {
	GeeHashSet* new_details = NULL;
	GeeHashSet* _tmp0_ = NULL;
	GValue new_value = {0};
	GeeHashSet* _tmp102_ = NULL;
	GType _tmp103_ = 0UL;
	GValue _tmp104_ = {0};
	GeeHashSet* _tmp105_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (rows != NULL);
	_tmp0_ = gee_hash_set_new (FOLKS_TYPE_POSTAL_ADDRESS_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	new_details = _tmp0_;
	{
		GeeIterator* _row_entry_it = NULL;
		GeeHashMap* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeSet* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _tmp6_ = NULL;
		_tmp1_ = rows;
		_tmp2_ = gee_abstract_map_get_entries ((GeeMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_row_entry_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			GeeMapEntry* row_entry = NULL;
			GeeIterator* _tmp9_ = NULL;
			gpointer _tmp10_ = NULL;
			ContactsTypeCombo* combo = NULL;
			GtkGrid* _tmp11_ = NULL;
			GeeMapEntry* _tmp12_ = NULL;
			gconstpointer _tmp13_ = NULL;
			gint _tmp14_ = 0;
			GtkWidget* _tmp15_ = NULL;
			ContactsTypeCombo* _tmp16_ = NULL;
			ContactsAddressEditor* addr_editor = NULL;
			GtkGrid* _tmp17_ = NULL;
			GeeMapEntry* _tmp18_ = NULL;
			gconstpointer _tmp19_ = NULL;
			gint _tmp20_ = 0;
			GtkWidget* _tmp21_ = NULL;
			ContactsAddressEditor* _tmp22_ = NULL;
			ContactsTypeCombo* _tmp23_ = NULL;
			GeeMapEntry* _tmp24_ = NULL;
			gconstpointer _tmp25_ = NULL;
			ContactsContactEditorRowData* _tmp26_ = NULL;
			FolksAbstractFieldDetails* _tmp27_ = NULL;
			FolksPostalAddress* new_value = NULL;
			ContactsAddressEditor* _tmp28_ = NULL;
			FolksPostalAddressFieldDetails* _tmp29_ = NULL;
			gconstpointer _tmp30_ = NULL;
			FolksPostalAddress* _tmp31_ = NULL;
			const gchar* _tmp32_ = NULL;
			const gchar* _tmp33_ = NULL;
			ContactsAddressEditor* _tmp34_ = NULL;
			FolksPostalAddressFieldDetails* _tmp35_ = NULL;
			gconstpointer _tmp36_ = NULL;
			FolksPostalAddress* _tmp37_ = NULL;
			const gchar* _tmp38_ = NULL;
			const gchar* _tmp39_ = NULL;
			ContactsAddressEditor* _tmp40_ = NULL;
			FolksPostalAddressFieldDetails* _tmp41_ = NULL;
			gconstpointer _tmp42_ = NULL;
			FolksPostalAddress* _tmp43_ = NULL;
			const gchar* _tmp44_ = NULL;
			const gchar* _tmp45_ = NULL;
			ContactsAddressEditor* _tmp46_ = NULL;
			FolksPostalAddressFieldDetails* _tmp47_ = NULL;
			gconstpointer _tmp48_ = NULL;
			FolksPostalAddress* _tmp49_ = NULL;
			const gchar* _tmp50_ = NULL;
			const gchar* _tmp51_ = NULL;
			ContactsAddressEditor* _tmp52_ = NULL;
			FolksPostalAddressFieldDetails* _tmp53_ = NULL;
			gconstpointer _tmp54_ = NULL;
			FolksPostalAddress* _tmp55_ = NULL;
			const gchar* _tmp56_ = NULL;
			const gchar* _tmp57_ = NULL;
			ContactsAddressEditor* _tmp58_ = NULL;
			FolksPostalAddressFieldDetails* _tmp59_ = NULL;
			gconstpointer _tmp60_ = NULL;
			FolksPostalAddress* _tmp61_ = NULL;
			const gchar* _tmp62_ = NULL;
			const gchar* _tmp63_ = NULL;
			ContactsAddressEditor* _tmp64_ = NULL;
			FolksPostalAddressFieldDetails* _tmp65_ = NULL;
			gconstpointer _tmp66_ = NULL;
			FolksPostalAddress* _tmp67_ = NULL;
			const gchar* _tmp68_ = NULL;
			const gchar* _tmp69_ = NULL;
			ContactsAddressEditor* _tmp70_ = NULL;
			FolksPostalAddressFieldDetails* _tmp71_ = NULL;
			gconstpointer _tmp72_ = NULL;
			FolksPostalAddress* _tmp73_ = NULL;
			const gchar* _tmp74_ = NULL;
			const gchar* _tmp75_ = NULL;
			ContactsAddressEditor* _tmp76_ = NULL;
			FolksPostalAddressFieldDetails* _tmp77_ = NULL;
			const gchar* _tmp78_ = NULL;
			const gchar* _tmp79_ = NULL;
			FolksPostalAddress* _tmp80_ = NULL;
			FolksPostalAddressFieldDetails* details = NULL;
			FolksPostalAddress* _tmp92_ = NULL;
			GeeMapEntry* _tmp93_ = NULL;
			gconstpointer _tmp94_ = NULL;
			ContactsContactEditorRowData* _tmp95_ = NULL;
			FolksAbstractFieldDetails* _tmp96_ = NULL;
			GeeMultiMap* _tmp97_ = NULL;
			GeeMultiMap* _tmp98_ = NULL;
			FolksPostalAddressFieldDetails* _tmp99_ = NULL;
			GeeHashSet* _tmp100_ = NULL;
			FolksPostalAddressFieldDetails* _tmp101_ = NULL;
			_tmp7_ = _row_entry_it;
			_tmp8_ = gee_iterator_next (_tmp7_);
			if (!_tmp8_) {
				break;
			}
			_tmp9_ = _row_entry_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			row_entry = (GeeMapEntry*) _tmp10_;
			_tmp11_ = self->priv->container_grid;
			_tmp12_ = row_entry;
			_tmp13_ = gee_map_entry_get_key (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = gtk_grid_get_child_at (_tmp11_, 0, (gint) ((gintptr) _tmp14_));
			_tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, CONTACTS_TYPE_TYPECOMBO) ? ((ContactsTypeCombo*) _tmp15_) : NULL);
			combo = _tmp16_;
			_tmp17_ = self->priv->container_grid;
			_tmp18_ = row_entry;
			_tmp19_ = gee_map_entry_get_key (_tmp18_);
			_tmp20_ = _tmp19_;
			_tmp21_ = gtk_grid_get_child_at (_tmp17_, 1, (gint) ((gintptr) _tmp20_));
			_tmp22_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp21_, CONTACTS_TYPE_ADDRESS_EDITOR) ? ((ContactsAddressEditor*) _tmp21_) : NULL);
			addr_editor = _tmp22_;
			_tmp23_ = combo;
			_tmp24_ = row_entry;
			_tmp25_ = gee_map_entry_get_value (_tmp24_);
			_tmp26_ = _tmp25_;
			_tmp27_ = (*((ContactsContactEditorRowData*) _tmp26_)).details;
			contacts_typecombo_update_details (_tmp23_, _tmp27_);
			_tmp28_ = addr_editor;
			_tmp29_ = _tmp28_->details;
			_tmp30_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp29_);
			_tmp31_ = _tmp30_;
			_tmp32_ = folks_postal_address_get_po_box ((FolksPostalAddress*) _tmp31_);
			_tmp33_ = _tmp32_;
			_tmp34_ = addr_editor;
			_tmp35_ = _tmp34_->details;
			_tmp36_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp35_);
			_tmp37_ = _tmp36_;
			_tmp38_ = folks_postal_address_get_extension ((FolksPostalAddress*) _tmp37_);
			_tmp39_ = _tmp38_;
			_tmp40_ = addr_editor;
			_tmp41_ = _tmp40_->details;
			_tmp42_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp41_);
			_tmp43_ = _tmp42_;
			_tmp44_ = folks_postal_address_get_street ((FolksPostalAddress*) _tmp43_);
			_tmp45_ = _tmp44_;
			_tmp46_ = addr_editor;
			_tmp47_ = _tmp46_->details;
			_tmp48_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp47_);
			_tmp49_ = _tmp48_;
			_tmp50_ = folks_postal_address_get_locality ((FolksPostalAddress*) _tmp49_);
			_tmp51_ = _tmp50_;
			_tmp52_ = addr_editor;
			_tmp53_ = _tmp52_->details;
			_tmp54_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp53_);
			_tmp55_ = _tmp54_;
			_tmp56_ = folks_postal_address_get_region ((FolksPostalAddress*) _tmp55_);
			_tmp57_ = _tmp56_;
			_tmp58_ = addr_editor;
			_tmp59_ = _tmp58_->details;
			_tmp60_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp59_);
			_tmp61_ = _tmp60_;
			_tmp62_ = folks_postal_address_get_postal_code ((FolksPostalAddress*) _tmp61_);
			_tmp63_ = _tmp62_;
			_tmp64_ = addr_editor;
			_tmp65_ = _tmp64_->details;
			_tmp66_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp65_);
			_tmp67_ = _tmp66_;
			_tmp68_ = folks_postal_address_get_country ((FolksPostalAddress*) _tmp67_);
			_tmp69_ = _tmp68_;
			_tmp70_ = addr_editor;
			_tmp71_ = _tmp70_->details;
			_tmp72_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp71_);
			_tmp73_ = _tmp72_;
			_tmp74_ = folks_postal_address_get_address_format ((FolksPostalAddress*) _tmp73_);
			_tmp75_ = _tmp74_;
			_tmp76_ = addr_editor;
			_tmp77_ = _tmp76_->details;
			_tmp78_ = folks_abstract_field_details_get_id ((FolksAbstractFieldDetails*) _tmp77_);
			_tmp79_ = _tmp78_;
			_tmp80_ = folks_postal_address_new (_tmp33_, _tmp39_, _tmp45_, _tmp51_, _tmp57_, _tmp63_, _tmp69_, _tmp75_, _tmp79_);
			new_value = _tmp80_;
			{
				gint i = 0;
				i = 0;
				{
					gboolean _tmp81_ = FALSE;
					_tmp81_ = TRUE;
					while (TRUE) {
						gint _tmp83_ = 0;
						ContactsAddressEditor* _tmp84_ = NULL;
						FolksPostalAddress* _tmp85_ = NULL;
						gint _tmp86_ = 0;
						const gchar* _tmp87_ = NULL;
						ContactsAddressEditor* _tmp88_ = NULL;
						gint _tmp89_ = 0;
						GtkEntry* _tmp90_ = NULL;
						const gchar* _tmp91_ = NULL;
						if (!_tmp81_) {
							gint _tmp82_ = 0;
							_tmp82_ = i;
							i = _tmp82_ + 1;
						}
						_tmp81_ = FALSE;
						_tmp83_ = i;
						_tmp84_ = addr_editor;
						if (!(_tmp83_ < 7)) {
							break;
						}
						_tmp85_ = new_value;
						_tmp86_ = i;
						_tmp87_ = CONTACTS_ADDRESS_EDITOR_postal_element_props[_tmp86_];
						_tmp88_ = addr_editor;
						_tmp89_ = i;
						_tmp90_ = _tmp88_->entries[_tmp89_];
						_tmp91_ = gtk_entry_get_text (_tmp90_);
						g_object_set ((GObject*) _tmp85_, _tmp87_, _tmp91_, NULL);
					}
				}
			}
			_tmp92_ = new_value;
			_tmp93_ = row_entry;
			_tmp94_ = gee_map_entry_get_value (_tmp93_);
			_tmp95_ = _tmp94_;
			_tmp96_ = (*((ContactsContactEditorRowData*) _tmp95_)).details;
			_tmp97_ = folks_abstract_field_details_get_parameters (_tmp96_);
			_tmp98_ = _tmp97_;
			_tmp99_ = folks_postal_address_field_details_new (_tmp92_, _tmp98_);
			details = _tmp99_;
			_tmp100_ = new_details;
			_tmp101_ = details;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp100_, _tmp101_);
			_g_object_unref0 (details);
			_g_object_unref0 (new_value);
			_g_object_unref0 (addr_editor);
			_g_object_unref0 (combo);
			_g_object_unref0 (row_entry);
		}
		_g_object_unref0 (_row_entry_it);
	}
	_tmp102_ = new_details;
	_tmp103_ = G_TYPE_FROM_INSTANCE ((GObject*) _tmp102_);
	g_value_init (&_tmp104_, _tmp103_);
	new_value = _tmp104_;
	_tmp105_ = new_details;
	g_value_set_object (&new_value, (GObject*) _tmp105_);
	*result = new_value;
	_g_object_unref0 (new_details);
	return;
}


static void contacts_contact_editor_set_field_changed (ContactsContactEditor* self, gint row) {
	g_return_if_fail (self != NULL);
	{
		GeeIterator* _fields_it = NULL;
		GeeHashMap* _tmp0_ = NULL;
		GeeCollection* _tmp1_ = NULL;
		GeeCollection* _tmp2_ = NULL;
		GeeCollection* _tmp3_ = NULL;
		GeeIterator* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		_tmp0_ = self->priv->writable_personas;
		_tmp1_ = gee_abstract_map_get_values ((GeeMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_fields_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_ = NULL;
			gboolean _tmp7_ = FALSE;
			GeeHashMap* fields = NULL;
			GeeIterator* _tmp8_ = NULL;
			gpointer _tmp9_ = NULL;
			_tmp6_ = _fields_it;
			_tmp7_ = gee_iterator_next (_tmp6_);
			if (!_tmp7_) {
				break;
			}
			_tmp8_ = _fields_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			fields = (GeeHashMap*) _tmp9_;
			{
				GeeIterator* _entry_it = NULL;
				GeeHashMap* _tmp10_ = NULL;
				GeeSet* _tmp11_ = NULL;
				GeeSet* _tmp12_ = NULL;
				GeeSet* _tmp13_ = NULL;
				GeeIterator* _tmp14_ = NULL;
				GeeIterator* _tmp15_ = NULL;
				_tmp10_ = fields;
				_tmp11_ = gee_abstract_map_get_entries ((GeeMap*) _tmp10_);
				_tmp12_ = _tmp11_;
				_tmp13_ = _tmp12_;
				_tmp14_ = gee_iterable_iterator ((GeeIterable*) _tmp13_);
				_tmp15_ = _tmp14_;
				_g_object_unref0 (_tmp13_);
				_entry_it = _tmp15_;
				while (TRUE) {
					GeeIterator* _tmp16_ = NULL;
					gboolean _tmp17_ = FALSE;
					GeeMapEntry* entry = NULL;
					GeeIterator* _tmp18_ = NULL;
					gpointer _tmp19_ = NULL;
					GeeMapEntry* _tmp20_ = NULL;
					gconstpointer _tmp21_ = NULL;
					ContactsContactEditorField* _tmp22_ = NULL;
					GeeHashMap* _tmp23_ = NULL;
					GeeSet* _tmp24_ = NULL;
					GeeSet* _tmp25_ = NULL;
					GeeSet* _tmp26_ = NULL;
					gint _tmp27_ = 0;
					gboolean _tmp28_ = FALSE;
					gboolean _tmp29_ = FALSE;
					_tmp16_ = _entry_it;
					_tmp17_ = gee_iterator_next (_tmp16_);
					if (!_tmp17_) {
						break;
					}
					_tmp18_ = _entry_it;
					_tmp19_ = gee_iterator_get (_tmp18_);
					entry = (GeeMapEntry*) _tmp19_;
					_tmp20_ = entry;
					_tmp21_ = gee_map_entry_get_value (_tmp20_);
					_tmp22_ = _tmp21_;
					_tmp23_ = (*((ContactsContactEditorField*) _tmp22_)).rows;
					_tmp24_ = gee_abstract_map_get_keys ((GeeMap*) _tmp23_);
					_tmp25_ = _tmp24_;
					_tmp26_ = _tmp25_;
					_tmp27_ = row;
					_tmp28_ = gee_collection_contains ((GeeCollection*) _tmp26_, (gpointer) ((gintptr) _tmp27_));
					_tmp29_ = _tmp28_;
					_g_object_unref0 (_tmp26_);
					if (_tmp29_) {
						GeeMapEntry* _tmp30_ = NULL;
						gconstpointer _tmp31_ = NULL;
						ContactsContactEditorField* _tmp32_ = NULL;
						gboolean _tmp33_ = FALSE;
						GeeMapEntry* _tmp34_ = NULL;
						gconstpointer _tmp35_ = NULL;
						ContactsContactEditorField* _tmp36_ = NULL;
						_tmp30_ = entry;
						_tmp31_ = gee_map_entry_get_value (_tmp30_);
						_tmp32_ = _tmp31_;
						_tmp33_ = (*((ContactsContactEditorField*) _tmp32_)).changed;
						if (_tmp33_) {
							_g_object_unref0 (entry);
							_g_object_unref0 (_entry_it);
							_g_object_unref0 (fields);
							_g_object_unref0 (_fields_it);
							return;
						}
						_tmp34_ = entry;
						_tmp35_ = gee_map_entry_get_value (_tmp34_);
						_tmp36_ = _tmp35_;
						(*((ContactsContactEditorField*) _tmp36_)).changed = TRUE;
						_g_object_unref0 (entry);
						_g_object_unref0 (_entry_it);
						_g_object_unref0 (fields);
						_g_object_unref0 (_fields_it);
						return;
					}
					_g_object_unref0 (entry);
				}
				_g_object_unref0 (_entry_it);
			}
			_g_object_unref0 (fields);
		}
		_g_object_unref0 (_fields_it);
	}
}


static void contacts_contact_editor_remove_row (ContactsContactEditor* self, gint row) {
	g_return_if_fail (self != NULL);
	{
		GeeIterator* _fields_it = NULL;
		GeeHashMap* _tmp0_ = NULL;
		GeeCollection* _tmp1_ = NULL;
		GeeCollection* _tmp2_ = NULL;
		GeeCollection* _tmp3_ = NULL;
		GeeIterator* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		_tmp0_ = self->priv->writable_personas;
		_tmp1_ = gee_abstract_map_get_values ((GeeMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_fields_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_ = NULL;
			gboolean _tmp7_ = FALSE;
			GeeHashMap* fields = NULL;
			GeeIterator* _tmp8_ = NULL;
			gpointer _tmp9_ = NULL;
			_tmp6_ = _fields_it;
			_tmp7_ = gee_iterator_next (_tmp6_);
			if (!_tmp7_) {
				break;
			}
			_tmp8_ = _fields_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			fields = (GeeHashMap*) _tmp9_;
			{
				GeeIterator* _field_entry_it = NULL;
				GeeHashMap* _tmp10_ = NULL;
				GeeSet* _tmp11_ = NULL;
				GeeSet* _tmp12_ = NULL;
				GeeSet* _tmp13_ = NULL;
				GeeIterator* _tmp14_ = NULL;
				GeeIterator* _tmp15_ = NULL;
				_tmp10_ = fields;
				_tmp11_ = gee_abstract_map_get_entries ((GeeMap*) _tmp10_);
				_tmp12_ = _tmp11_;
				_tmp13_ = _tmp12_;
				_tmp14_ = gee_iterable_iterator ((GeeIterable*) _tmp13_);
				_tmp15_ = _tmp14_;
				_g_object_unref0 (_tmp13_);
				_field_entry_it = _tmp15_;
				while (TRUE) {
					GeeIterator* _tmp16_ = NULL;
					gboolean _tmp17_ = FALSE;
					GeeMapEntry* field_entry = NULL;
					GeeIterator* _tmp18_ = NULL;
					gpointer _tmp19_ = NULL;
					_tmp16_ = _field_entry_it;
					_tmp17_ = gee_iterator_next (_tmp16_);
					if (!_tmp17_) {
						break;
					}
					_tmp18_ = _field_entry_it;
					_tmp19_ = gee_iterator_get (_tmp18_);
					field_entry = (GeeMapEntry*) _tmp19_;
					{
						GeeIterator* _idx_it = NULL;
						GeeMapEntry* _tmp20_ = NULL;
						gconstpointer _tmp21_ = NULL;
						ContactsContactEditorField* _tmp22_ = NULL;
						GeeHashMap* _tmp23_ = NULL;
						GeeSet* _tmp24_ = NULL;
						GeeSet* _tmp25_ = NULL;
						GeeSet* _tmp26_ = NULL;
						GeeIterator* _tmp27_ = NULL;
						GeeIterator* _tmp28_ = NULL;
						_tmp20_ = field_entry;
						_tmp21_ = gee_map_entry_get_value (_tmp20_);
						_tmp22_ = _tmp21_;
						_tmp23_ = (*((ContactsContactEditorField*) _tmp22_)).rows;
						_tmp24_ = gee_abstract_map_get_keys ((GeeMap*) _tmp23_);
						_tmp25_ = _tmp24_;
						_tmp26_ = _tmp25_;
						_tmp27_ = gee_iterable_iterator ((GeeIterable*) _tmp26_);
						_tmp28_ = _tmp27_;
						_g_object_unref0 (_tmp26_);
						_idx_it = _tmp28_;
						while (TRUE) {
							GeeIterator* _tmp29_ = NULL;
							gboolean _tmp30_ = FALSE;
							gint idx = 0;
							GeeIterator* _tmp31_ = NULL;
							gpointer _tmp32_ = NULL;
							gint _tmp33_ = 0;
							gint _tmp34_ = 0;
							_tmp29_ = _idx_it;
							_tmp30_ = gee_iterator_next (_tmp29_);
							if (!_tmp30_) {
								break;
							}
							_tmp31_ = _idx_it;
							_tmp32_ = gee_iterator_get (_tmp31_);
							idx = (gint) ((gintptr) _tmp32_);
							_tmp33_ = idx;
							_tmp34_ = row;
							if (_tmp33_ == _tmp34_) {
								GtkWidget* child = NULL;
								GtkGrid* _tmp35_ = NULL;
								gint _tmp36_ = 0;
								GtkWidget* _tmp37_ = NULL;
								GtkWidget* _tmp38_ = NULL;
								GtkWidget* _tmp39_ = NULL;
								GtkGrid* _tmp40_ = NULL;
								gint _tmp41_ = 0;
								GtkWidget* _tmp42_ = NULL;
								GtkWidget* _tmp43_ = NULL;
								GtkWidget* _tmp44_ = NULL;
								GtkGrid* _tmp45_ = NULL;
								gint _tmp46_ = 0;
								GtkWidget* _tmp47_ = NULL;
								GtkWidget* _tmp48_ = NULL;
								GtkWidget* _tmp49_ = NULL;
								GeeMapEntry* _tmp50_ = NULL;
								gconstpointer _tmp51_ = NULL;
								ContactsContactEditorField* _tmp52_ = NULL;
								GeeMapEntry* _tmp53_ = NULL;
								gconstpointer _tmp54_ = NULL;
								ContactsContactEditorField* _tmp55_ = NULL;
								GeeHashMap* _tmp56_ = NULL;
								gint _tmp57_ = 0;
								_tmp35_ = self->priv->container_grid;
								_tmp36_ = row;
								_tmp37_ = gtk_grid_get_child_at (_tmp35_, 0, _tmp36_);
								_tmp38_ = _g_object_ref0 (_tmp37_);
								child = _tmp38_;
								_tmp39_ = child;
								gtk_widget_destroy (_tmp39_);
								_tmp40_ = self->priv->container_grid;
								_tmp41_ = row;
								_tmp42_ = gtk_grid_get_child_at (_tmp40_, 1, _tmp41_);
								_tmp43_ = _g_object_ref0 (_tmp42_);
								_g_object_unref0 (child);
								child = _tmp43_;
								_tmp44_ = child;
								gtk_widget_destroy (_tmp44_);
								_tmp45_ = self->priv->container_grid;
								_tmp46_ = row;
								_tmp47_ = gtk_grid_get_child_at (_tmp45_, 3, _tmp46_);
								_tmp48_ = _g_object_ref0 (_tmp47_);
								_g_object_unref0 (child);
								child = _tmp48_;
								_tmp49_ = child;
								gtk_widget_destroy (_tmp49_);
								_tmp50_ = field_entry;
								_tmp51_ = gee_map_entry_get_value (_tmp50_);
								_tmp52_ = _tmp51_;
								(*((ContactsContactEditorField*) _tmp52_)).changed = TRUE;
								_tmp53_ = field_entry;
								_tmp54_ = gee_map_entry_get_value (_tmp53_);
								_tmp55_ = _tmp54_;
								_tmp56_ = (*((ContactsContactEditorField*) _tmp55_)).rows;
								_tmp57_ = row;
								gee_abstract_map_unset ((GeeAbstractMap*) _tmp56_, (gpointer) ((gintptr) _tmp57_), NULL);
								_g_object_unref0 (child);
								_g_object_unref0 (_idx_it);
								_g_object_unref0 (field_entry);
								_g_object_unref0 (_field_entry_it);
								_g_object_unref0 (fields);
								_g_object_unref0 (_fields_it);
								return;
							}
						}
						_g_object_unref0 (_idx_it);
					}
					_g_object_unref0 (field_entry);
				}
				_g_object_unref0 (_field_entry_it);
			}
			_g_object_unref0 (fields);
		}
		_g_object_unref0 (_fields_it);
	}
}


static Block21Data* block21_data_ref (Block21Data* _data21_) {
	g_atomic_int_inc (&_data21_->_ref_count_);
	return _data21_;
}


static void block21_data_unref (void * _userdata_) {
	Block21Data* _data21_;
	_data21_ = (Block21Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data21_->_ref_count_)) {
		ContactsContactEditor* self;
		self = _data21_->self;
		_g_object_unref0 (_data21_->delete_button);
		_g_object_unref0 (_data21_->value_entry);
		_g_object_unref0 (_data21_->combo);
		_g_object_unref0 (self);
		g_slice_free (Block21Data, _data21_);
	}
}


static void __lambda41_ (Block21Data* _data21_) {
	ContactsContactEditor* self;
	ContactsTypeCombo* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	self = _data21_->self;
	_tmp0_ = _data21_->combo;
	_tmp1_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _tmp0_);
	contacts_contact_editor_set_field_changed (self, _tmp1_);
}


static void ___lambda41__contacts_typecombo_changed (ContactsTypeCombo* _sender, gpointer self) {
	__lambda41_ (self);
}


static void __lambda42_ (Block21Data* _data21_) {
	ContactsContactEditor* self;
	GtkEntry* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	self = _data21_->self;
	_tmp0_ = _data21_->value_entry;
	_tmp1_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _tmp0_);
	contacts_contact_editor_set_field_changed (self, _tmp1_);
}


static void ___lambda42__gtk_editable_changed (GtkEditable* _sender, gpointer self) {
	__lambda42_ (self);
}


static void __lambda43_ (Block21Data* _data21_) {
	ContactsContactEditor* self;
	GtkButton* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	self = _data21_->self;
	_tmp0_ = _data21_->delete_button;
	_tmp1_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _tmp0_);
	contacts_contact_editor_remove_row (self, _tmp1_);
}


static void ___lambda43__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda43_ (self);
}


static void contacts_contact_editor_attach_row_with_entry (ContactsContactEditor* self, gint row, ContactsTypeSet* type_set, FolksAbstractFieldDetails* details, const gchar* value, const gchar* type) {
	Block21Data* _data21_;
	ContactsTypeSet* _tmp0_ = NULL;
	ContactsTypeCombo* _tmp1_ = NULL;
	ContactsTypeCombo* _tmp2_ = NULL;
	ContactsTypeCombo* _tmp3_ = NULL;
	FolksAbstractFieldDetails* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	ContactsTypeCombo* _tmp8_ = NULL;
	GtkGrid* _tmp9_ = NULL;
	ContactsTypeCombo* _tmp10_ = NULL;
	gint _tmp11_ = 0;
	GtkEntry* _tmp12_ = NULL;
	GtkEntry* _tmp13_ = NULL;
	const gchar* _tmp14_ = NULL;
	GtkEntry* _tmp15_ = NULL;
	GtkGrid* _tmp16_ = NULL;
	GtkEntry* _tmp17_ = NULL;
	gint _tmp18_ = 0;
	ContactsTypeSet* _tmp19_ = NULL;
	ContactsTypeSet* _tmp20_ = NULL;
	ContactsTypeSet* _tmp21_ = NULL;
	GtkButton* _tmp29_ = NULL;
	GtkButton* _tmp30_ = NULL;
	AtkObject* _tmp31_ = NULL;
	const gchar* _tmp32_ = NULL;
	GtkGrid* _tmp33_ = NULL;
	GtkButton* _tmp34_ = NULL;
	gint _tmp35_ = 0;
	ContactsTypeCombo* _tmp36_ = NULL;
	GtkEntry* _tmp37_ = NULL;
	GtkButton* _tmp38_ = NULL;
	const gchar* _tmp39_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (type_set != NULL);
	g_return_if_fail (details != NULL);
	g_return_if_fail (value != NULL);
	_data21_ = g_slice_new0 (Block21Data);
	_data21_->_ref_count_ = 1;
	_data21_->self = g_object_ref (self);
	_tmp0_ = type_set;
	_tmp1_ = contacts_typecombo_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	_data21_->combo = _tmp1_;
	_tmp2_ = _data21_->combo;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp2_, FALSE);
	_tmp3_ = _data21_->combo;
	_tmp4_ = details;
	contacts_typecombo_set_active (_tmp3_, _tmp4_);
	_tmp5_ = type;
	if (_tmp5_ != NULL) {
		ContactsTypeCombo* _tmp6_ = NULL;
		const gchar* _tmp7_ = NULL;
		_tmp6_ = _data21_->combo;
		_tmp7_ = type;
		contacts_typecombo_set_to (_tmp6_, _tmp7_);
	}
	_tmp8_ = _data21_->combo;
	gtk_widget_set_valign ((GtkWidget*) _tmp8_, GTK_ALIGN_CENTER);
	_tmp9_ = self->priv->container_grid;
	_tmp10_ = _data21_->combo;
	_tmp11_ = row;
	gtk_grid_attach (_tmp9_, (GtkWidget*) _tmp10_, 0, _tmp11_, 1, 1);
	_tmp12_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp12_);
	_data21_->value_entry = _tmp12_;
	_tmp13_ = _data21_->value_entry;
	_tmp14_ = value;
	gtk_entry_set_text (_tmp13_, _tmp14_);
	_tmp15_ = _data21_->value_entry;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp15_, TRUE);
	_tmp16_ = self->priv->container_grid;
	_tmp17_ = _data21_->value_entry;
	_tmp18_ = row;
	gtk_grid_attach (_tmp16_, (GtkWidget*) _tmp17_, 1, _tmp18_, 1, 1);
	_tmp19_ = type_set;
	_tmp20_ = contacts_typeset_get_email ();
	_tmp21_ = _tmp20_;
	if (_tmp19_ == _tmp21_) {
		GtkEntry* _tmp22_ = NULL;
		const gchar* _tmp23_ = NULL;
		_tmp22_ = _data21_->value_entry;
		_tmp23_ = _ ("Add email");
		gtk_entry_set_placeholder_text (_tmp22_, _tmp23_);
	} else {
		ContactsTypeSet* _tmp24_ = NULL;
		ContactsTypeSet* _tmp25_ = NULL;
		ContactsTypeSet* _tmp26_ = NULL;
		_tmp24_ = type_set;
		_tmp25_ = contacts_typeset_get_phone ();
		_tmp26_ = _tmp25_;
		if (_tmp24_ == _tmp26_) {
			GtkEntry* _tmp27_ = NULL;
			const gchar* _tmp28_ = NULL;
			_tmp27_ = _data21_->value_entry;
			_tmp28_ = _ ("Add number");
			gtk_entry_set_placeholder_text (_tmp27_, _tmp28_);
		}
	}
	_tmp29_ = (GtkButton*) gtk_button_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp29_);
	_data21_->delete_button = _tmp29_;
	_tmp30_ = _data21_->delete_button;
	_tmp31_ = gtk_widget_get_accessible ((GtkWidget*) _tmp30_);
	_tmp32_ = _ ("Delete field");
	atk_object_set_name (_tmp31_, _tmp32_);
	_tmp33_ = self->priv->container_grid;
	_tmp34_ = _data21_->delete_button;
	_tmp35_ = row;
	gtk_grid_attach (_tmp33_, (GtkWidget*) _tmp34_, 3, _tmp35_, 1, 1);
	_tmp36_ = _data21_->combo;
	g_signal_connect_data (_tmp36_, "changed", (GCallback) ___lambda41__contacts_typecombo_changed, block21_data_ref (_data21_), (GClosureNotify) block21_data_unref, 0);
	_tmp37_ = _data21_->value_entry;
	g_signal_connect_data ((GtkEditable*) _tmp37_, "changed", (GCallback) ___lambda42__gtk_editable_changed, block21_data_ref (_data21_), (GClosureNotify) block21_data_unref, 0);
	_tmp38_ = _data21_->delete_button;
	g_signal_connect_data (_tmp38_, "clicked", (GCallback) ___lambda43__gtk_button_clicked, block21_data_ref (_data21_), (GClosureNotify) block21_data_unref, 0);
	_tmp39_ = value;
	if (g_strcmp0 (_tmp39_, "") == 0) {
		GtkEntry* _tmp40_ = NULL;
		_tmp40_ = _data21_->value_entry;
		self->priv->focus_widget = (GtkWidget*) _tmp40_;
	}
	block21_data_unref (_data21_);
	_data21_ = NULL;
}


static Block22Data* block22_data_ref (Block22Data* _data22_) {
	g_atomic_int_inc (&_data22_->_ref_count_);
	return _data22_;
}


static void block22_data_unref (void * _userdata_) {
	Block22Data* _data22_;
	_data22_ = (Block22Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data22_->_ref_count_)) {
		ContactsContactEditor* self;
		self = _data22_->self;
		_g_object_unref0 (_data22_->delete_button);
		_g_object_unref0 (_data22_->value_entry);
		_g_object_unref0 (self);
		g_slice_free (Block22Data, _data22_);
	}
}


static void __lambda44_ (Block22Data* _data22_) {
	ContactsContactEditor* self;
	GtkEntry* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	self = _data22_->self;
	_tmp0_ = _data22_->value_entry;
	_tmp1_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _tmp0_);
	contacts_contact_editor_set_field_changed (self, _tmp1_);
}


static void ___lambda44__gtk_editable_changed (GtkEditable* _sender, gpointer self) {
	__lambda44_ (self);
}


static void __lambda45_ (Block22Data* _data22_) {
	ContactsContactEditor* self;
	GtkButton* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	self = _data22_->self;
	_tmp0_ = _data22_->delete_button;
	_tmp1_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _tmp0_);
	contacts_contact_editor_remove_row (self, _tmp1_);
}


static void ___lambda45__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda45_ (self);
}


static void contacts_contact_editor_attach_row_with_entry_labeled (ContactsContactEditor* self, const gchar* title, FolksAbstractFieldDetails* details, const gchar* value, gint row) {
	Block22Data* _data22_;
	GtkLabel* title_label = NULL;
	const gchar* _tmp0_ = NULL;
	GtkLabel* _tmp1_ = NULL;
	GtkLabel* _tmp2_ = NULL;
	GtkLabel* _tmp3_ = NULL;
	GtkLabel* _tmp4_ = NULL;
	GtkGrid* _tmp5_ = NULL;
	GtkLabel* _tmp6_ = NULL;
	gint _tmp7_ = 0;
	GtkEntry* _tmp8_ = NULL;
	GtkEntry* _tmp9_ = NULL;
	const gchar* _tmp10_ = NULL;
	GtkEntry* _tmp11_ = NULL;
	GtkGrid* _tmp12_ = NULL;
	GtkEntry* _tmp13_ = NULL;
	gint _tmp14_ = 0;
	GtkButton* _tmp15_ = NULL;
	GtkButton* _tmp16_ = NULL;
	AtkObject* _tmp17_ = NULL;
	const gchar* _tmp18_ = NULL;
	GtkGrid* _tmp19_ = NULL;
	GtkButton* _tmp20_ = NULL;
	gint _tmp21_ = 0;
	GtkEntry* _tmp22_ = NULL;
	GtkButton* _tmp23_ = NULL;
	const gchar* _tmp24_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (title != NULL);
	g_return_if_fail (value != NULL);
	_data22_ = g_slice_new0 (Block22Data);
	_data22_->_ref_count_ = 1;
	_data22_->self = g_object_ref (self);
	_tmp0_ = title;
	_tmp1_ = (GtkLabel*) gtk_label_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	title_label = _tmp1_;
	_tmp2_ = title_label;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp2_, FALSE);
	_tmp3_ = title_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp3_, GTK_ALIGN_START);
	_tmp4_ = title_label;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp4_, 6);
	_tmp5_ = self->priv->container_grid;
	_tmp6_ = title_label;
	_tmp7_ = row;
	gtk_grid_attach (_tmp5_, (GtkWidget*) _tmp6_, 0, _tmp7_, 1, 1);
	_tmp8_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp8_);
	_data22_->value_entry = _tmp8_;
	_tmp9_ = _data22_->value_entry;
	_tmp10_ = value;
	gtk_entry_set_text (_tmp9_, _tmp10_);
	_tmp11_ = _data22_->value_entry;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp11_, TRUE);
	_tmp12_ = self->priv->container_grid;
	_tmp13_ = _data22_->value_entry;
	_tmp14_ = row;
	gtk_grid_attach (_tmp12_, (GtkWidget*) _tmp13_, 1, _tmp14_, 1, 1);
	_tmp15_ = (GtkButton*) gtk_button_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp15_);
	_data22_->delete_button = _tmp15_;
	_tmp16_ = _data22_->delete_button;
	_tmp17_ = gtk_widget_get_accessible ((GtkWidget*) _tmp16_);
	_tmp18_ = _ ("Delete field");
	atk_object_set_name (_tmp17_, _tmp18_);
	_tmp19_ = self->priv->container_grid;
	_tmp20_ = _data22_->delete_button;
	_tmp21_ = row;
	gtk_grid_attach (_tmp19_, (GtkWidget*) _tmp20_, 3, _tmp21_, 1, 1);
	_tmp22_ = _data22_->value_entry;
	g_signal_connect_data ((GtkEditable*) _tmp22_, "changed", (GCallback) ___lambda44__gtk_editable_changed, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, 0);
	_tmp23_ = _data22_->delete_button;
	g_signal_connect_data (_tmp23_, "clicked", (GCallback) ___lambda45__gtk_button_clicked, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, G_CONNECT_AFTER);
	_tmp24_ = value;
	if (g_strcmp0 (_tmp24_, "") == 0) {
		GtkEntry* _tmp25_ = NULL;
		_tmp25_ = _data22_->value_entry;
		self->priv->focus_widget = (GtkWidget*) _tmp25_;
	}
	_g_object_unref0 (title_label);
	block22_data_unref (_data22_);
	_data22_ = NULL;
}


static Block23Data* block23_data_ref (Block23Data* _data23_) {
	g_atomic_int_inc (&_data23_->_ref_count_);
	return _data23_;
}


static void block23_data_unref (void * _userdata_) {
	Block23Data* _data23_;
	_data23_ = (Block23Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data23_->_ref_count_)) {
		ContactsContactEditor* self;
		self = _data23_->self;
		_g_object_unref0 (_data23_->delete_button);
		_g_object_unref0 (_data23_->value_text);
		_g_object_unref0 (self);
		g_slice_free (Block23Data, _data23_);
	}
}


static void __lambda46_ (Block23Data* _data23_) {
	ContactsContactEditor* self;
	GtkTextView* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	self = _data23_->self;
	_tmp0_ = _data23_->value_text;
	_tmp1_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _tmp0_);
	contacts_contact_editor_set_field_changed (self, _tmp1_);
}


static void ___lambda46__gtk_text_buffer_changed (GtkTextBuffer* _sender, gpointer self) {
	__lambda46_ (self);
}


static void __lambda47_ (Block23Data* _data23_) {
	ContactsContactEditor* self;
	GtkButton* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	self = _data23_->self;
	_tmp0_ = _data23_->delete_button;
	_tmp1_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _tmp0_);
	contacts_contact_editor_remove_row (self, _tmp1_);
	contacts_contact_editor_set_has_notes_row (self, FALSE);
}


static void ___lambda47__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda47_ (self);
}


static void contacts_contact_editor_attach_row_with_text_labeled (ContactsContactEditor* self, const gchar* title, FolksAbstractFieldDetails* details, const gchar* value, gint row) {
	Block23Data* _data23_;
	GtkLabel* title_label = NULL;
	const gchar* _tmp0_ = NULL;
	GtkLabel* _tmp1_ = NULL;
	GtkLabel* _tmp2_ = NULL;
	GtkLabel* _tmp3_ = NULL;
	GtkLabel* _tmp4_ = NULL;
	GtkLabel* _tmp5_ = NULL;
	GtkLabel* _tmp6_ = NULL;
	GtkGrid* _tmp7_ = NULL;
	GtkLabel* _tmp8_ = NULL;
	gint _tmp9_ = 0;
	GtkScrolledWindow* sw = NULL;
	GtkScrolledWindow* _tmp10_ = NULL;
	GtkScrolledWindow* _tmp11_ = NULL;
	GtkScrolledWindow* _tmp12_ = NULL;
	GtkTextView* _tmp13_ = NULL;
	GtkTextView* _tmp14_ = NULL;
	GtkTextBuffer* _tmp15_ = NULL;
	const gchar* _tmp16_ = NULL;
	GtkTextView* _tmp17_ = NULL;
	GtkTextView* _tmp18_ = NULL;
	GtkStyleContext* _tmp19_ = NULL;
	GtkScrolledWindow* _tmp20_ = NULL;
	GtkTextView* _tmp21_ = NULL;
	GtkGrid* _tmp22_ = NULL;
	GtkScrolledWindow* _tmp23_ = NULL;
	gint _tmp24_ = 0;
	GtkButton* _tmp25_ = NULL;
	GtkButton* _tmp26_ = NULL;
	AtkObject* _tmp27_ = NULL;
	const gchar* _tmp28_ = NULL;
	GtkButton* _tmp29_ = NULL;
	GtkGrid* _tmp30_ = NULL;
	GtkButton* _tmp31_ = NULL;
	gint _tmp32_ = 0;
	GtkTextView* _tmp33_ = NULL;
	GtkTextBuffer* _tmp34_ = NULL;
	GtkButton* _tmp35_ = NULL;
	const gchar* _tmp36_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (title != NULL);
	g_return_if_fail (value != NULL);
	_data23_ = g_slice_new0 (Block23Data);
	_data23_->_ref_count_ = 1;
	_data23_->self = g_object_ref (self);
	_tmp0_ = title;
	_tmp1_ = (GtkLabel*) gtk_label_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	title_label = _tmp1_;
	_tmp2_ = title_label;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp2_, FALSE);
	_tmp3_ = title_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp3_, GTK_ALIGN_START);
	_tmp4_ = title_label;
	gtk_widget_set_valign ((GtkWidget*) _tmp4_, GTK_ALIGN_START);
	_tmp5_ = title_label;
	gtk_widget_set_margin_top ((GtkWidget*) _tmp5_, 3);
	_tmp6_ = title_label;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp6_, 6);
	_tmp7_ = self->priv->container_grid;
	_tmp8_ = title_label;
	_tmp9_ = row;
	gtk_grid_attach (_tmp7_, (GtkWidget*) _tmp8_, 0, _tmp9_, 1, 1);
	_tmp10_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_ref_sink (_tmp10_);
	sw = _tmp10_;
	_tmp11_ = sw;
	gtk_scrolled_window_set_shadow_type (_tmp11_, GTK_SHADOW_OUT);
	_tmp12_ = sw;
	gtk_widget_set_size_request ((GtkWidget*) _tmp12_, -1, 100);
	_tmp13_ = (GtkTextView*) gtk_text_view_new ();
	g_object_ref_sink (_tmp13_);
	_data23_->value_text = _tmp13_;
	_tmp14_ = _data23_->value_text;
	_tmp15_ = gtk_text_view_get_buffer (_tmp14_);
	_tmp16_ = value;
	gtk_text_buffer_set_text (_tmp15_, _tmp16_, -1);
	_tmp17_ = _data23_->value_text;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp17_, TRUE);
	_tmp18_ = _data23_->value_text;
	_tmp19_ = gtk_widget_get_style_context ((GtkWidget*) _tmp18_);
	gtk_style_context_add_class (_tmp19_, "contacts-entry");
	_tmp20_ = sw;
	_tmp21_ = _data23_->value_text;
	gtk_container_add ((GtkContainer*) _tmp20_, (GtkWidget*) _tmp21_);
	_tmp22_ = self->priv->container_grid;
	_tmp23_ = sw;
	_tmp24_ = row;
	gtk_grid_attach (_tmp22_, (GtkWidget*) _tmp23_, 1, _tmp24_, 1, 1);
	_tmp25_ = (GtkButton*) gtk_button_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp25_);
	_data23_->delete_button = _tmp25_;
	_tmp26_ = _data23_->delete_button;
	_tmp27_ = gtk_widget_get_accessible ((GtkWidget*) _tmp26_);
	_tmp28_ = _ ("Delete field");
	atk_object_set_name (_tmp27_, _tmp28_);
	_tmp29_ = _data23_->delete_button;
	gtk_widget_set_valign ((GtkWidget*) _tmp29_, GTK_ALIGN_START);
	_tmp30_ = self->priv->container_grid;
	_tmp31_ = _data23_->delete_button;
	_tmp32_ = row;
	gtk_grid_attach (_tmp30_, (GtkWidget*) _tmp31_, 3, _tmp32_, 1, 1);
	_tmp33_ = _data23_->value_text;
	_tmp34_ = gtk_text_view_get_buffer (_tmp33_);
	g_signal_connect_data (_tmp34_, "changed", (GCallback) ___lambda46__gtk_text_buffer_changed, block23_data_ref (_data23_), (GClosureNotify) block23_data_unref, 0);
	_tmp35_ = _data23_->delete_button;
	g_signal_connect_data (_tmp35_, "clicked", (GCallback) ___lambda47__gtk_button_clicked, block23_data_ref (_data23_), (GClosureNotify) block23_data_unref, 0);
	_tmp36_ = value;
	if (g_strcmp0 (_tmp36_, "") == 0) {
		GtkTextView* _tmp37_ = NULL;
		_tmp37_ = _data23_->value_text;
		self->priv->focus_widget = (GtkWidget*) _tmp37_;
	}
	_g_object_unref0 (sw);
	_g_object_unref0 (title_label);
	block23_data_unref (_data23_);
	_data23_ = NULL;
}


static Block24Data* block24_data_ref (Block24Data* _data24_) {
	g_atomic_int_inc (&_data24_->_ref_count_);
	return _data24_;
}


static void block24_data_unref (void * _userdata_) {
	Block24Data* _data24_;
	_data24_ = (Block24Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data24_->_ref_count_)) {
		ContactsContactEditor* self;
		self = _data24_->self;
		(_data24_->fn_target_destroy_notify == NULL) ? NULL : (_data24_->fn_target_destroy_notify (_data24_->fn_target), NULL);
		_data24_->fn = NULL;
		_data24_->fn_target = NULL;
		_data24_->fn_target_destroy_notify = NULL;
		_g_object_unref0 (_data24_->delete_button);
		_g_object_unref0 (_data24_->year_spin);
		_g_object_unref0 (_data24_->combo);
		_g_object_unref0 (_data24_->day_spin);
		_g_object_unref0 (self);
		g_slice_free (Block24Data, _data24_);
	}
}


static gboolean _vala_int_array_contains (gint* stack, int stack_length, gint needle) {
	int i;
	for (i = 0; i < stack_length; i++) {
		if (needle == stack[i]) {
			return TRUE;
		}
	}
	return FALSE;
}


static void __lambda48_ (Block24Data* _data24_) {
	ContactsContactEditor* self;
	gint* month_of_31 = NULL;
	gint* _tmp0_ = NULL;
	gint month_of_31_length1 = 0;
	gint _month_of_31_size_ = 0;
	gint _tmp1_ = 0;
	gint* _tmp2_ = NULL;
	gint _tmp2__length1 = 0;
	self = _data24_->self;
	_tmp0_ = g_new0 (gint, 4);
	_tmp0_[0] = 3;
	_tmp0_[1] = 5;
	_tmp0_[2] = 8;
	_tmp0_[3] = 10;
	month_of_31 = _tmp0_;
	month_of_31_length1 = 4;
	_month_of_31_size_ = month_of_31_length1;
	_tmp1_ = gtk_combo_box_get_active ((GtkComboBox*) _data24_->combo);
	_tmp2_ = month_of_31;
	_tmp2__length1 = month_of_31_length1;
	if (_vala_int_array_contains (_tmp2_, _tmp2__length1, _tmp1_)) {
		gtk_spin_button_set_range (_data24_->day_spin, (gdouble) 1, (gdouble) 30);
	} else {
		gint _tmp3_ = 0;
		_tmp3_ = gtk_combo_box_get_active ((GtkComboBox*) _data24_->combo);
		if (_tmp3_ == 1) {
			gboolean _tmp4_ = FALSE;
			gint _tmp5_ = 0;
			_tmp5_ = gtk_spin_button_get_value_as_int (_data24_->year_spin);
			if ((_tmp5_ % 4) == 0) {
				gint _tmp6_ = 0;
				_tmp6_ = gtk_spin_button_get_value_as_int (_data24_->year_spin);
				_tmp4_ = (_tmp6_ % 100) != 0;
			} else {
				_tmp4_ = FALSE;
			}
			if (_tmp4_) {
				gtk_spin_button_set_range (_data24_->day_spin, (gdouble) 1, (gdouble) 29);
			} else {
				gtk_spin_button_set_range (_data24_->day_spin, (gdouble) 1, (gdouble) 28);
			}
		}
	}
	month_of_31 = (g_free (month_of_31), NULL);
}


static void ___lambda48__contacts_contact_editor_adjusting_date_fn (gpointer self) {
	__lambda48_ (self);
}


static void __lambda49_ (Block24Data* _data24_) {
	ContactsContactEditor* self;
	gint _tmp0_ = 0;
	self = _data24_->self;
	_tmp0_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _data24_->day_spin);
	contacts_contact_editor_set_field_changed (self, _tmp0_);
}


static void ___lambda49__gtk_editable_changed (GtkEditable* _sender, gpointer self) {
	__lambda49_ (self);
}


static void __lambda50_ (Block24Data* _data24_) {
	ContactsContactEditor* self;
	gint _tmp0_ = 0;
	self = _data24_->self;
	_tmp0_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _data24_->combo);
	contacts_contact_editor_set_field_changed (self, _tmp0_);
	_data24_->fn (_data24_->fn_target);
}


static void ___lambda50__gtk_combo_box_changed (GtkComboBox* _sender, gpointer self) {
	__lambda50_ (self);
}


static void __lambda51_ (Block24Data* _data24_) {
	ContactsContactEditor* self;
	gint _tmp0_ = 0;
	self = _data24_->self;
	_tmp0_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _data24_->year_spin);
	contacts_contact_editor_set_field_changed (self, _tmp0_);
	_data24_->fn (_data24_->fn_target);
}


static void ___lambda51__gtk_editable_changed (GtkEditable* _sender, gpointer self) {
	__lambda51_ (self);
}


static void __lambda52_ (Block24Data* _data24_) {
	ContactsContactEditor* self;
	gint _tmp0_ = 0;
	self = _data24_->self;
	_tmp0_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _data24_->delete_button);
	contacts_contact_editor_remove_row (self, _tmp0_);
	contacts_contact_editor_set_has_birthday_row (self, FALSE);
}


static void ___lambda52__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda52_ (self);
}


static void contacts_contact_editor_attach_row_for_birthday (ContactsContactEditor* self, const gchar* title, FolksAbstractFieldDetails* details, GDateTime* birthday, gint row) {
	Block24Data* _data24_;
	GtkLabel* title_label = NULL;
	const gchar* _tmp0_ = NULL;
	GtkLabel* _tmp1_ = NULL;
	GtkGrid* _tmp2_ = NULL;
	gint _tmp3_ = 0;
	GtkGrid* box = NULL;
	GtkGrid* _tmp4_ = NULL;
	GtkSpinButton* _tmp5_ = NULL;
	GDateTime* _tmp6_ = NULL;
	GDateTime* _tmp7_ = NULL;
	GDateTime* _tmp8_ = NULL;
	gint _tmp9_ = 0;
	GtkComboBoxText* _tmp10_ = NULL;
	const gchar* _tmp11_ = NULL;
	const gchar* _tmp12_ = NULL;
	const gchar* _tmp13_ = NULL;
	const gchar* _tmp14_ = NULL;
	const gchar* _tmp15_ = NULL;
	const gchar* _tmp16_ = NULL;
	const gchar* _tmp17_ = NULL;
	const gchar* _tmp18_ = NULL;
	const gchar* _tmp19_ = NULL;
	const gchar* _tmp20_ = NULL;
	const gchar* _tmp21_ = NULL;
	const gchar* _tmp22_ = NULL;
	GDateTime* _tmp23_ = NULL;
	GDateTime* _tmp24_ = NULL;
	GDateTime* _tmp25_ = NULL;
	gint _tmp26_ = 0;
	GtkStyleContext* _tmp27_ = NULL;
	GtkSpinButton* _tmp28_ = NULL;
	GDateTime* _tmp29_ = NULL;
	GDateTime* _tmp30_ = NULL;
	GDateTime* _tmp31_ = NULL;
	gint _tmp32_ = 0;
	GtkGrid* _tmp33_ = NULL;
	gint _tmp34_ = 0;
	GtkButton* _tmp35_ = NULL;
	AtkObject* _tmp36_ = NULL;
	const gchar* _tmp37_ = NULL;
	GtkGrid* _tmp38_ = NULL;
	gint _tmp39_ = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (title != NULL);
	g_return_if_fail (birthday != NULL);
	_data24_ = g_slice_new0 (Block24Data);
	_data24_->_ref_count_ = 1;
	_data24_->self = g_object_ref (self);
	_tmp0_ = title;
	_tmp1_ = (GtkLabel*) gtk_label_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	title_label = _tmp1_;
	gtk_widget_set_hexpand ((GtkWidget*) title_label, FALSE);
	gtk_widget_set_halign ((GtkWidget*) title_label, GTK_ALIGN_START);
	gtk_widget_set_margin_end ((GtkWidget*) title_label, 6);
	_tmp2_ = self->priv->container_grid;
	_tmp3_ = row;
	gtk_grid_attach (_tmp2_, (GtkWidget*) title_label, 0, _tmp3_, 1, 1);
	_tmp4_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp4_);
	box = _tmp4_;
	gtk_grid_set_column_spacing (box, (guint) 12);
	_tmp5_ = (GtkSpinButton*) gtk_spin_button_new_with_range (1.0, 31.0, 1.0);
	g_object_ref_sink (_tmp5_);
	_data24_->day_spin = _tmp5_;
	gtk_spin_button_set_digits (_data24_->day_spin, (guint) 0);
	gtk_spin_button_set_numeric (_data24_->day_spin, TRUE);
	_tmp6_ = birthday;
	_tmp7_ = g_date_time_to_local (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = g_date_time_get_day_of_month (_tmp8_);
	gtk_spin_button_set_value (_data24_->day_spin, (gdouble) _tmp9_);
	_g_date_time_unref0 (_tmp8_);
	_tmp10_ = (GtkComboBoxText*) gtk_combo_box_text_new ();
	g_object_ref_sink (_tmp10_);
	_data24_->combo = _tmp10_;
	_tmp11_ = _ ("January");
	gtk_combo_box_text_append_text (_data24_->combo, _tmp11_);
	_tmp12_ = _ ("February");
	gtk_combo_box_text_append_text (_data24_->combo, _tmp12_);
	_tmp13_ = _ ("March");
	gtk_combo_box_text_append_text (_data24_->combo, _tmp13_);
	_tmp14_ = _ ("April");
	gtk_combo_box_text_append_text (_data24_->combo, _tmp14_);
	_tmp15_ = _ ("May");
	gtk_combo_box_text_append_text (_data24_->combo, _tmp15_);
	_tmp16_ = _ ("June");
	gtk_combo_box_text_append_text (_data24_->combo, _tmp16_);
	_tmp17_ = _ ("July");
	gtk_combo_box_text_append_text (_data24_->combo, _tmp17_);
	_tmp18_ = _ ("August");
	gtk_combo_box_text_append_text (_data24_->combo, _tmp18_);
	_tmp19_ = _ ("September");
	gtk_combo_box_text_append_text (_data24_->combo, _tmp19_);
	_tmp20_ = _ ("October");
	gtk_combo_box_text_append_text (_data24_->combo, _tmp20_);
	_tmp21_ = _ ("November");
	gtk_combo_box_text_append_text (_data24_->combo, _tmp21_);
	_tmp22_ = _ ("December");
	gtk_combo_box_text_append_text (_data24_->combo, _tmp22_);
	_tmp23_ = birthday;
	_tmp24_ = g_date_time_to_local (_tmp23_);
	_tmp25_ = _tmp24_;
	_tmp26_ = g_date_time_get_month (_tmp25_);
	gtk_combo_box_set_active ((GtkComboBox*) _data24_->combo, _tmp26_ - 1);
	_g_date_time_unref0 (_tmp25_);
	_tmp27_ = gtk_widget_get_style_context ((GtkWidget*) _data24_->combo);
	gtk_style_context_add_class (_tmp27_, "contacts-combo");
	gtk_widget_set_hexpand ((GtkWidget*) _data24_->combo, TRUE);
	_tmp28_ = (GtkSpinButton*) gtk_spin_button_new_with_range ((gdouble) 1800, (gdouble) 3000, (gdouble) 1);
	g_object_ref_sink (_tmp28_);
	_data24_->year_spin = _tmp28_;
	gtk_spin_button_set_digits (_data24_->year_spin, (guint) 0);
	gtk_spin_button_set_numeric (_data24_->year_spin, TRUE);
	_tmp29_ = birthday;
	_tmp30_ = g_date_time_to_local (_tmp29_);
	_tmp31_ = _tmp30_;
	_tmp32_ = g_date_time_get_year (_tmp31_);
	gtk_spin_button_set_value (_data24_->year_spin, (gdouble) _tmp32_);
	_g_date_time_unref0 (_tmp31_);
	gtk_container_add ((GtkContainer*) box, (GtkWidget*) _data24_->day_spin);
	gtk_container_add ((GtkContainer*) box, (GtkWidget*) _data24_->combo);
	gtk_container_add ((GtkContainer*) box, (GtkWidget*) _data24_->year_spin);
	_tmp33_ = self->priv->container_grid;
	_tmp34_ = row;
	gtk_grid_attach (_tmp33_, (GtkWidget*) box, 1, _tmp34_, 1, 1);
	_tmp35_ = (GtkButton*) gtk_button_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp35_);
	_data24_->delete_button = _tmp35_;
	_tmp36_ = gtk_widget_get_accessible ((GtkWidget*) _data24_->delete_button);
	_tmp37_ = _ ("Delete field");
	atk_object_set_name (_tmp36_, _tmp37_);
	_tmp38_ = self->priv->container_grid;
	_tmp39_ = row;
	gtk_grid_attach (_tmp38_, (GtkWidget*) _data24_->delete_button, 3, _tmp39_, 1, 1);
	_data24_->fn = ___lambda48__contacts_contact_editor_adjusting_date_fn;
	_data24_->fn_target = block24_data_ref (_data24_);
	_data24_->fn_target_destroy_notify = block24_data_unref;
	g_signal_connect_data ((GtkEditable*) _data24_->day_spin, "changed", (GCallback) ___lambda49__gtk_editable_changed, block24_data_ref (_data24_), (GClosureNotify) block24_data_unref, 0);
	g_signal_connect_data ((GtkComboBox*) _data24_->combo, "changed", (GCallback) ___lambda50__gtk_combo_box_changed, block24_data_ref (_data24_), (GClosureNotify) block24_data_unref, 0);
	g_signal_connect_data ((GtkEditable*) _data24_->year_spin, "changed", (GCallback) ___lambda51__gtk_editable_changed, block24_data_ref (_data24_), (GClosureNotify) block24_data_unref, 0);
	g_signal_connect_data (_data24_->delete_button, "clicked", (GCallback) ___lambda52__gtk_button_clicked, block24_data_ref (_data24_), (GClosureNotify) block24_data_unref, 0);
	_g_object_unref0 (box);
	_g_object_unref0 (title_label);
	block24_data_unref (_data24_);
	_data24_ = NULL;
}


static Block25Data* block25_data_ref (Block25Data* _data25_) {
	g_atomic_int_inc (&_data25_->_ref_count_);
	return _data25_;
}


static void block25_data_unref (void * _userdata_) {
	Block25Data* _data25_;
	_data25_ = (Block25Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data25_->_ref_count_)) {
		ContactsContactEditor* self;
		self = _data25_->self;
		_g_object_unref0 (_data25_->delete_button);
		_g_object_unref0 (_data25_->value_address);
		_g_object_unref0 (_data25_->combo);
		_g_object_unref0 (self);
		g_slice_free (Block25Data, _data25_);
	}
}


static void __lambda53_ (Block25Data* _data25_) {
	ContactsContactEditor* self;
	ContactsTypeCombo* _tmp0_ = NULL;
	gint _tmp1_ = 0;
	self = _data25_->self;
	_tmp0_ = _data25_->combo;
	_tmp1_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _tmp0_);
	contacts_contact_editor_set_field_changed (self, _tmp1_);
}


static void ___lambda53__contacts_typecombo_changed (ContactsTypeCombo* _sender, gpointer self) {
	__lambda53_ (self);
}


static void __lambda54_ (Block25Data* _data25_) {
	ContactsContactEditor* self;
	gint _tmp0_ = 0;
	self = _data25_->self;
	_tmp0_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _data25_->value_address);
	contacts_contact_editor_set_field_changed (self, _tmp0_);
}


static void ___lambda54__contacts_address_editor_changed (ContactsAddressEditor* _sender, gpointer self) {
	__lambda54_ (self);
}


static void __lambda55_ (Block25Data* _data25_) {
	ContactsContactEditor* self;
	gint _tmp0_ = 0;
	self = _data25_->self;
	_tmp0_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _data25_->delete_button);
	contacts_contact_editor_remove_row (self, _tmp0_);
}


static void ___lambda55__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda55_ (self);
}


static void contacts_contact_editor_attach_row_for_address (ContactsContactEditor* self, gint row, ContactsTypeSet* type_set, FolksPostalAddressFieldDetails* details, const gchar* type) {
	Block25Data* _data25_;
	ContactsTypeSet* _tmp0_ = NULL;
	ContactsTypeCombo* _tmp1_ = NULL;
	ContactsTypeCombo* _tmp2_ = NULL;
	ContactsTypeCombo* _tmp3_ = NULL;
	FolksPostalAddressFieldDetails* _tmp4_ = NULL;
	const gchar* _tmp5_ = NULL;
	GtkGrid* _tmp8_ = NULL;
	ContactsTypeCombo* _tmp9_ = NULL;
	gint _tmp10_ = 0;
	FolksPostalAddressFieldDetails* _tmp11_ = NULL;
	ContactsAddressEditor* _tmp12_ = NULL;
	GtkGrid* _tmp13_ = NULL;
	gint _tmp14_ = 0;
	GtkButton* _tmp15_ = NULL;
	AtkObject* _tmp16_ = NULL;
	const gchar* _tmp17_ = NULL;
	GtkGrid* _tmp18_ = NULL;
	gint _tmp19_ = 0;
	ContactsTypeCombo* _tmp20_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (type_set != NULL);
	g_return_if_fail (details != NULL);
	_data25_ = g_slice_new0 (Block25Data);
	_data25_->_ref_count_ = 1;
	_data25_->self = g_object_ref (self);
	_tmp0_ = type_set;
	_tmp1_ = contacts_typecombo_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	_data25_->combo = _tmp1_;
	_tmp2_ = _data25_->combo;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp2_, FALSE);
	_tmp3_ = _data25_->combo;
	_tmp4_ = details;
	contacts_typecombo_set_active (_tmp3_, (FolksAbstractFieldDetails*) _tmp4_);
	_tmp5_ = type;
	if (_tmp5_ != NULL) {
		ContactsTypeCombo* _tmp6_ = NULL;
		const gchar* _tmp7_ = NULL;
		_tmp6_ = _data25_->combo;
		_tmp7_ = type;
		contacts_typecombo_set_to (_tmp6_, _tmp7_);
	}
	_tmp8_ = self->priv->container_grid;
	_tmp9_ = _data25_->combo;
	_tmp10_ = row;
	gtk_grid_attach (_tmp8_, (GtkWidget*) _tmp9_, 0, _tmp10_, 1, 1);
	_tmp11_ = details;
	_tmp12_ = contacts_address_editor_new (_tmp11_);
	g_object_ref_sink (_tmp12_);
	_data25_->value_address = _tmp12_;
	_tmp13_ = self->priv->container_grid;
	_tmp14_ = row;
	gtk_grid_attach (_tmp13_, (GtkWidget*) _data25_->value_address, 1, _tmp14_, 1, 1);
	_tmp15_ = (GtkButton*) gtk_button_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp15_);
	_data25_->delete_button = _tmp15_;
	_tmp16_ = gtk_widget_get_accessible ((GtkWidget*) _data25_->delete_button);
	_tmp17_ = _ ("Delete field");
	atk_object_set_name (_tmp16_, _tmp17_);
	gtk_widget_set_valign ((GtkWidget*) _data25_->delete_button, GTK_ALIGN_START);
	_tmp18_ = self->priv->container_grid;
	_tmp19_ = row;
	gtk_grid_attach (_tmp18_, (GtkWidget*) _data25_->delete_button, 3, _tmp19_, 1, 1);
	_tmp20_ = _data25_->combo;
	g_signal_connect_data (_tmp20_, "changed", (GCallback) ___lambda53__contacts_typecombo_changed, block25_data_ref (_data25_), (GClosureNotify) block25_data_unref, 0);
	g_signal_connect_data (_data25_->value_address, "changed", (GCallback) ___lambda54__contacts_address_editor_changed, block25_data_ref (_data25_), (GClosureNotify) block25_data_unref, 0);
	g_signal_connect_data (_data25_->delete_button, "clicked", (GCallback) ___lambda55__gtk_button_clicked, block25_data_ref (_data25_), (GClosureNotify) block25_data_unref, 0);
	self->priv->focus_widget = (GtkWidget*) _data25_->value_address;
	block25_data_unref (_data25_);
	_data25_ = NULL;
}


static void ____lambda56_ (ContactsContactEditor* self) {
	contacts_contact_editor_set_has_nickname_row (self, FALSE);
}


static void _____lambda56__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	____lambda56_ ((ContactsContactEditor*) self);
}


static void contacts_contact_editor_add_edit_row (ContactsContactEditor* self, FolksPersona* p, const gchar* prop_name, gint* row, gboolean add_empty, const gchar* type) {
	const gchar* _tmp0_ = NULL;
	FolksPersona* _tmp1_ = NULL;
	gchar* persona_uid = NULL;
	gchar* _tmp5_ = NULL;
	const gchar* _tmp6_ = NULL;
	const gchar* _tmp7_ = NULL;
	GQuark _tmp9_ = 0U;
	static GQuark _tmp8_label0 = 0;
	static GQuark _tmp8_label1 = 0;
	static GQuark _tmp8_label2 = 0;
	static GQuark _tmp8_label3 = 0;
	static GQuark _tmp8_label4 = 0;
	static GQuark _tmp8_label5 = 0;
	static GQuark _tmp8_label6 = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (prop_name != NULL);
	_tmp1_ = p;
	if (_tmp1_ != NULL) {
		FolksPersona* _tmp2_ = NULL;
		const gchar* _tmp3_ = NULL;
		const gchar* _tmp4_ = NULL;
		_tmp2_ = p;
		_tmp3_ = folks_persona_get_uid (_tmp2_);
		_tmp4_ = _tmp3_;
		_tmp0_ = _tmp4_;
	} else {
		_tmp0_ = "null-persona.hack";
	}
	_tmp5_ = g_strdup (_tmp0_);
	persona_uid = _tmp5_;
	_tmp6_ = prop_name;
	_tmp7_ = _tmp6_;
	_tmp9_ = (NULL == _tmp7_) ? 0 : g_quark_from_string (_tmp7_);
	if (_tmp9_ == ((0 != _tmp8_label0) ? _tmp8_label0 : (_tmp8_label0 = g_quark_from_static_string ("email-addresses")))) {
		switch (0) {
			default:
			{
				GeeHashMap* rows = NULL;
				GeeHashMap* _tmp10_ = NULL;
				gboolean _tmp11_ = FALSE;
				GeeHashMap* _tmp53_ = NULL;
				gboolean _tmp54_ = FALSE;
				gboolean _tmp55_ = FALSE;
				_tmp10_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, CONTACTS_CONTACT_EDITOR_TYPE_ROW_DATA, (GBoxedCopyFunc) contacts_contact_editor_row_data_dup, contacts_contact_editor_row_data_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
				rows = _tmp10_;
				_tmp11_ = add_empty;
				if (_tmp11_) {
					FolksEmailFieldDetails* detail_field = NULL;
					FolksEmailFieldDetails* _tmp12_ = NULL;
					gint _tmp13_ = 0;
					ContactsTypeSet* _tmp14_ = NULL;
					ContactsTypeSet* _tmp15_ = NULL;
					FolksEmailFieldDetails* _tmp16_ = NULL;
					const gchar* _tmp17_ = NULL;
					GeeHashMap* _tmp18_ = NULL;
					gint _tmp19_ = 0;
					FolksEmailFieldDetails* _tmp20_ = NULL;
					ContactsContactEditorRowData _tmp21_ = {0};
					gint _tmp22_ = 0;
					_tmp12_ = folks_email_field_details_new ("", NULL);
					detail_field = _tmp12_;
					_tmp13_ = *row;
					_tmp14_ = contacts_typeset_get_email ();
					_tmp15_ = _tmp14_;
					_tmp16_ = detail_field;
					_tmp17_ = type;
					contacts_contact_editor_attach_row_with_entry (self, _tmp13_, _tmp15_, (FolksAbstractFieldDetails*) _tmp16_, "", _tmp17_);
					_tmp18_ = rows;
					_tmp19_ = *row;
					_tmp20_ = detail_field;
					_g_object_unref0 (_tmp21_.details);
					_tmp21_.details = (FolksAbstractFieldDetails*) _tmp20_;
					gee_abstract_map_set ((GeeAbstractMap*) _tmp18_, (gpointer) ((gintptr) _tmp19_), &_tmp21_);
					_tmp22_ = *row;
					*row = _tmp22_ + 1;
					_g_object_unref0 (detail_field);
				} else {
					FolksEmailDetails* details = NULL;
					FolksPersona* _tmp23_ = NULL;
					FolksEmailDetails* _tmp24_ = NULL;
					FolksEmailDetails* _tmp25_ = NULL;
					_tmp23_ = p;
					_tmp24_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp23_, FOLKS_TYPE_EMAIL_DETAILS) ? ((FolksEmailDetails*) _tmp23_) : NULL);
					details = _tmp24_;
					_tmp25_ = details;
					if (_tmp25_ != NULL) {
						GeeArrayList* emails = NULL;
						FolksEmailDetails* _tmp26_ = NULL;
						GeeSet* _tmp27_ = NULL;
						GeeSet* _tmp28_ = NULL;
						GeeArrayList* _tmp29_ = NULL;
						_tmp26_ = details;
						_tmp27_ = folks_email_details_get_email_addresses (_tmp26_);
						_tmp28_ = _tmp27_;
						_tmp29_ = contacts_contact_sort_fields (FOLKS_TYPE_EMAIL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GeeCollection*) _tmp28_);
						emails = _tmp29_;
						{
							GeeArrayList* _email_list = NULL;
							GeeArrayList* _tmp30_ = NULL;
							GeeArrayList* _tmp31_ = NULL;
							gint _email_size = 0;
							GeeArrayList* _tmp32_ = NULL;
							gint _tmp33_ = 0;
							gint _tmp34_ = 0;
							gint _email_index = 0;
							_tmp30_ = emails;
							_tmp31_ = _g_object_ref0 (_tmp30_);
							_email_list = _tmp31_;
							_tmp32_ = _email_list;
							_tmp33_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp32_);
							_tmp34_ = _tmp33_;
							_email_size = _tmp34_;
							_email_index = -1;
							while (TRUE) {
								gint _tmp35_ = 0;
								gint _tmp36_ = 0;
								gint _tmp37_ = 0;
								FolksEmailFieldDetails* email = NULL;
								GeeArrayList* _tmp38_ = NULL;
								gint _tmp39_ = 0;
								gpointer _tmp40_ = NULL;
								gint _tmp41_ = 0;
								ContactsTypeSet* _tmp42_ = NULL;
								ContactsTypeSet* _tmp43_ = NULL;
								FolksEmailFieldDetails* _tmp44_ = NULL;
								FolksEmailFieldDetails* _tmp45_ = NULL;
								gconstpointer _tmp46_ = NULL;
								const gchar* _tmp47_ = NULL;
								GeeHashMap* _tmp48_ = NULL;
								gint _tmp49_ = 0;
								FolksEmailFieldDetails* _tmp50_ = NULL;
								ContactsContactEditorRowData _tmp51_ = {0};
								gint _tmp52_ = 0;
								_tmp35_ = _email_index;
								_email_index = _tmp35_ + 1;
								_tmp36_ = _email_index;
								_tmp37_ = _email_size;
								if (!(_tmp36_ < _tmp37_)) {
									break;
								}
								_tmp38_ = _email_list;
								_tmp39_ = _email_index;
								_tmp40_ = gee_abstract_list_get ((GeeAbstractList*) _tmp38_, _tmp39_);
								email = (FolksEmailFieldDetails*) _tmp40_;
								_tmp41_ = *row;
								_tmp42_ = contacts_typeset_get_email ();
								_tmp43_ = _tmp42_;
								_tmp44_ = email;
								_tmp45_ = email;
								_tmp46_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp45_);
								_tmp47_ = _tmp46_;
								contacts_contact_editor_attach_row_with_entry (self, _tmp41_, _tmp43_, (FolksAbstractFieldDetails*) _tmp44_, (const gchar*) _tmp47_, NULL);
								_tmp48_ = rows;
								_tmp49_ = *row;
								_tmp50_ = email;
								_g_object_unref0 (_tmp51_.details);
								_tmp51_.details = (FolksAbstractFieldDetails*) _tmp50_;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp48_, (gpointer) ((gintptr) _tmp49_), &_tmp51_);
								_tmp52_ = *row;
								*row = _tmp52_ + 1;
								_g_object_unref0 (email);
							}
							_g_object_unref0 (_email_list);
						}
						_g_object_unref0 (emails);
					}
					_g_object_unref0 (details);
				}
				_tmp53_ = rows;
				_tmp54_ = gee_map_get_is_empty ((GeeMap*) _tmp53_);
				_tmp55_ = _tmp54_;
				if (!_tmp55_) {
					GeeHashMap* _tmp56_ = NULL;
					const gchar* _tmp57_ = NULL;
					gpointer _tmp58_ = NULL;
					GeeHashMap* _tmp59_ = NULL;
					const gchar* _tmp60_ = NULL;
					gboolean _tmp61_ = FALSE;
					gboolean _tmp62_ = FALSE;
					_tmp56_ = self->priv->writable_personas;
					_tmp57_ = persona_uid;
					_tmp58_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp56_, _tmp57_);
					_tmp59_ = (GeeHashMap*) _tmp58_;
					_tmp60_ = prop_name;
					_tmp61_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp59_, _tmp60_);
					_tmp62_ = _tmp61_;
					_g_object_unref0 (_tmp59_);
					if (_tmp62_) {
						{
							GeeIterator* _entry_it = NULL;
							GeeHashMap* _tmp63_ = NULL;
							GeeSet* _tmp64_ = NULL;
							GeeSet* _tmp65_ = NULL;
							GeeSet* _tmp66_ = NULL;
							GeeIterator* _tmp67_ = NULL;
							GeeIterator* _tmp68_ = NULL;
							_tmp63_ = rows;
							_tmp64_ = gee_abstract_map_get_entries ((GeeMap*) _tmp63_);
							_tmp65_ = _tmp64_;
							_tmp66_ = _tmp65_;
							_tmp67_ = gee_iterable_iterator ((GeeIterable*) _tmp66_);
							_tmp68_ = _tmp67_;
							_g_object_unref0 (_tmp66_);
							_entry_it = _tmp68_;
							while (TRUE) {
								GeeIterator* _tmp69_ = NULL;
								gboolean _tmp70_ = FALSE;
								GeeMapEntry* entry = NULL;
								GeeIterator* _tmp71_ = NULL;
								gpointer _tmp72_ = NULL;
								GeeHashMap* _tmp73_ = NULL;
								const gchar* _tmp74_ = NULL;
								gpointer _tmp75_ = NULL;
								GeeHashMap* _tmp76_ = NULL;
								const gchar* _tmp77_ = NULL;
								gpointer _tmp78_ = NULL;
								ContactsContactEditorField* _tmp79_ = NULL;
								GeeHashMap* _tmp80_ = NULL;
								GeeMapEntry* _tmp81_ = NULL;
								gconstpointer _tmp82_ = NULL;
								gint _tmp83_ = 0;
								GeeMapEntry* _tmp84_ = NULL;
								gconstpointer _tmp85_ = NULL;
								ContactsContactEditorRowData* _tmp86_ = NULL;
								_tmp69_ = _entry_it;
								_tmp70_ = gee_iterator_next (_tmp69_);
								if (!_tmp70_) {
									break;
								}
								_tmp71_ = _entry_it;
								_tmp72_ = gee_iterator_get (_tmp71_);
								entry = (GeeMapEntry*) _tmp72_;
								_tmp73_ = self->priv->writable_personas;
								_tmp74_ = persona_uid;
								_tmp75_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp73_, _tmp74_);
								_tmp76_ = (GeeHashMap*) _tmp75_;
								_tmp77_ = prop_name;
								_tmp78_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp76_, _tmp77_);
								_tmp79_ = (ContactsContactEditorField*) _tmp78_;
								_tmp80_ = (*_tmp79_).rows;
								_tmp81_ = entry;
								_tmp82_ = gee_map_entry_get_key (_tmp81_);
								_tmp83_ = _tmp82_;
								_tmp84_ = entry;
								_tmp85_ = gee_map_entry_get_value (_tmp84_);
								_tmp86_ = _tmp85_;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp80_, (gpointer) ((gintptr) ((gint) ((gintptr) _tmp83_))), (ContactsContactEditorRowData*) _tmp86_);
								_contacts_contact_editor_field_free0 (_tmp79_);
								_g_object_unref0 (_tmp76_);
								_g_object_unref0 (entry);
							}
							_g_object_unref0 (_entry_it);
						}
					} else {
						GeeHashMap* _tmp87_ = NULL;
						const gchar* _tmp88_ = NULL;
						gpointer _tmp89_ = NULL;
						GeeHashMap* _tmp90_ = NULL;
						const gchar* _tmp91_ = NULL;
						GeeHashMap* _tmp92_ = NULL;
						ContactsContactEditorField _tmp93_ = {0};
						_tmp87_ = self->priv->writable_personas;
						_tmp88_ = persona_uid;
						_tmp89_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp87_, _tmp88_);
						_tmp90_ = (GeeHashMap*) _tmp89_;
						_tmp91_ = prop_name;
						_tmp92_ = rows;
						_tmp93_.changed = FALSE;
						_g_object_unref0 (_tmp93_.rows);
						_tmp93_.rows = _tmp92_;
						gee_abstract_map_set ((GeeAbstractMap*) _tmp90_, _tmp91_, &_tmp93_);
						_g_object_unref0 (_tmp90_);
					}
				}
				_g_object_unref0 (rows);
				break;
			}
		}
	} else if (_tmp9_ == ((0 != _tmp8_label1) ? _tmp8_label1 : (_tmp8_label1 = g_quark_from_static_string ("phone-numbers")))) {
		switch (0) {
			default:
			{
				GeeHashMap* rows = NULL;
				GeeHashMap* _tmp94_ = NULL;
				gboolean _tmp95_ = FALSE;
				GeeHashMap* _tmp138_ = NULL;
				gboolean _tmp139_ = FALSE;
				gboolean _tmp140_ = FALSE;
				_tmp94_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, CONTACTS_CONTACT_EDITOR_TYPE_ROW_DATA, (GBoxedCopyFunc) contacts_contact_editor_row_data_dup, contacts_contact_editor_row_data_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
				rows = _tmp94_;
				_tmp95_ = add_empty;
				if (_tmp95_) {
					FolksPhoneFieldDetails* detail_field = NULL;
					FolksPhoneFieldDetails* _tmp96_ = NULL;
					gint _tmp97_ = 0;
					ContactsTypeSet* _tmp98_ = NULL;
					ContactsTypeSet* _tmp99_ = NULL;
					FolksPhoneFieldDetails* _tmp100_ = NULL;
					const gchar* _tmp101_ = NULL;
					GeeHashMap* _tmp102_ = NULL;
					gint _tmp103_ = 0;
					FolksPhoneFieldDetails* _tmp104_ = NULL;
					ContactsContactEditorRowData _tmp105_ = {0};
					gint _tmp106_ = 0;
					_tmp96_ = folks_phone_field_details_new ("", NULL);
					detail_field = _tmp96_;
					_tmp97_ = *row;
					_tmp98_ = contacts_typeset_get_phone ();
					_tmp99_ = _tmp98_;
					_tmp100_ = detail_field;
					_tmp101_ = type;
					contacts_contact_editor_attach_row_with_entry (self, _tmp97_, _tmp99_, (FolksAbstractFieldDetails*) _tmp100_, "", _tmp101_);
					_tmp102_ = rows;
					_tmp103_ = *row;
					_tmp104_ = detail_field;
					_g_object_unref0 (_tmp105_.details);
					_tmp105_.details = (FolksAbstractFieldDetails*) _tmp104_;
					gee_abstract_map_set ((GeeAbstractMap*) _tmp102_, (gpointer) ((gintptr) _tmp103_), &_tmp105_);
					_tmp106_ = *row;
					*row = _tmp106_ + 1;
					_g_object_unref0 (detail_field);
				} else {
					FolksPhoneDetails* details = NULL;
					FolksPersona* _tmp107_ = NULL;
					FolksPhoneDetails* _tmp108_ = NULL;
					FolksPhoneDetails* _tmp109_ = NULL;
					_tmp107_ = p;
					_tmp108_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp107_, FOLKS_TYPE_PHONE_DETAILS) ? ((FolksPhoneDetails*) _tmp107_) : NULL);
					details = _tmp108_;
					_tmp109_ = details;
					if (_tmp109_ != NULL) {
						GeeArrayList* phones = NULL;
						FolksPhoneDetails* _tmp110_ = NULL;
						GeeSet* _tmp111_ = NULL;
						GeeSet* _tmp112_ = NULL;
						GeeArrayList* _tmp113_ = NULL;
						_tmp110_ = details;
						_tmp111_ = folks_phone_details_get_phone_numbers (_tmp110_);
						_tmp112_ = _tmp111_;
						_tmp113_ = contacts_contact_sort_fields (FOLKS_TYPE_PHONE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GeeCollection*) _tmp112_);
						phones = _tmp113_;
						{
							GeeArrayList* _phone_list = NULL;
							GeeArrayList* _tmp114_ = NULL;
							GeeArrayList* _tmp115_ = NULL;
							gint _phone_size = 0;
							GeeArrayList* _tmp116_ = NULL;
							gint _tmp117_ = 0;
							gint _tmp118_ = 0;
							gint _phone_index = 0;
							_tmp114_ = phones;
							_tmp115_ = _g_object_ref0 (_tmp114_);
							_phone_list = _tmp115_;
							_tmp116_ = _phone_list;
							_tmp117_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp116_);
							_tmp118_ = _tmp117_;
							_phone_size = _tmp118_;
							_phone_index = -1;
							while (TRUE) {
								gint _tmp119_ = 0;
								gint _tmp120_ = 0;
								gint _tmp121_ = 0;
								FolksPhoneFieldDetails* phone = NULL;
								GeeArrayList* _tmp122_ = NULL;
								gint _tmp123_ = 0;
								gpointer _tmp124_ = NULL;
								gint _tmp125_ = 0;
								ContactsTypeSet* _tmp126_ = NULL;
								ContactsTypeSet* _tmp127_ = NULL;
								FolksPhoneFieldDetails* _tmp128_ = NULL;
								FolksPhoneFieldDetails* _tmp129_ = NULL;
								gconstpointer _tmp130_ = NULL;
								const gchar* _tmp131_ = NULL;
								const gchar* _tmp132_ = NULL;
								GeeHashMap* _tmp133_ = NULL;
								gint _tmp134_ = 0;
								FolksPhoneFieldDetails* _tmp135_ = NULL;
								ContactsContactEditorRowData _tmp136_ = {0};
								gint _tmp137_ = 0;
								_tmp119_ = _phone_index;
								_phone_index = _tmp119_ + 1;
								_tmp120_ = _phone_index;
								_tmp121_ = _phone_size;
								if (!(_tmp120_ < _tmp121_)) {
									break;
								}
								_tmp122_ = _phone_list;
								_tmp123_ = _phone_index;
								_tmp124_ = gee_abstract_list_get ((GeeAbstractList*) _tmp122_, _tmp123_);
								phone = (FolksPhoneFieldDetails*) _tmp124_;
								_tmp125_ = *row;
								_tmp126_ = contacts_typeset_get_phone ();
								_tmp127_ = _tmp126_;
								_tmp128_ = phone;
								_tmp129_ = phone;
								_tmp130_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp129_);
								_tmp131_ = _tmp130_;
								_tmp132_ = type;
								contacts_contact_editor_attach_row_with_entry (self, _tmp125_, _tmp127_, (FolksAbstractFieldDetails*) _tmp128_, (const gchar*) _tmp131_, _tmp132_);
								_tmp133_ = rows;
								_tmp134_ = *row;
								_tmp135_ = phone;
								_g_object_unref0 (_tmp136_.details);
								_tmp136_.details = (FolksAbstractFieldDetails*) _tmp135_;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp133_, (gpointer) ((gintptr) _tmp134_), &_tmp136_);
								_tmp137_ = *row;
								*row = _tmp137_ + 1;
								_g_object_unref0 (phone);
							}
							_g_object_unref0 (_phone_list);
						}
						_g_object_unref0 (phones);
					}
					_g_object_unref0 (details);
				}
				_tmp138_ = rows;
				_tmp139_ = gee_map_get_is_empty ((GeeMap*) _tmp138_);
				_tmp140_ = _tmp139_;
				if (!_tmp140_) {
					GeeHashMap* _tmp141_ = NULL;
					const gchar* _tmp142_ = NULL;
					gpointer _tmp143_ = NULL;
					GeeHashMap* _tmp144_ = NULL;
					const gchar* _tmp145_ = NULL;
					gboolean _tmp146_ = FALSE;
					gboolean _tmp147_ = FALSE;
					_tmp141_ = self->priv->writable_personas;
					_tmp142_ = persona_uid;
					_tmp143_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp141_, _tmp142_);
					_tmp144_ = (GeeHashMap*) _tmp143_;
					_tmp145_ = prop_name;
					_tmp146_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp144_, _tmp145_);
					_tmp147_ = _tmp146_;
					_g_object_unref0 (_tmp144_);
					if (_tmp147_) {
						{
							GeeIterator* _entry_it = NULL;
							GeeHashMap* _tmp148_ = NULL;
							GeeSet* _tmp149_ = NULL;
							GeeSet* _tmp150_ = NULL;
							GeeSet* _tmp151_ = NULL;
							GeeIterator* _tmp152_ = NULL;
							GeeIterator* _tmp153_ = NULL;
							_tmp148_ = rows;
							_tmp149_ = gee_abstract_map_get_entries ((GeeMap*) _tmp148_);
							_tmp150_ = _tmp149_;
							_tmp151_ = _tmp150_;
							_tmp152_ = gee_iterable_iterator ((GeeIterable*) _tmp151_);
							_tmp153_ = _tmp152_;
							_g_object_unref0 (_tmp151_);
							_entry_it = _tmp153_;
							while (TRUE) {
								GeeIterator* _tmp154_ = NULL;
								gboolean _tmp155_ = FALSE;
								GeeMapEntry* entry = NULL;
								GeeIterator* _tmp156_ = NULL;
								gpointer _tmp157_ = NULL;
								GeeHashMap* _tmp158_ = NULL;
								const gchar* _tmp159_ = NULL;
								gpointer _tmp160_ = NULL;
								GeeHashMap* _tmp161_ = NULL;
								const gchar* _tmp162_ = NULL;
								gpointer _tmp163_ = NULL;
								ContactsContactEditorField* _tmp164_ = NULL;
								GeeHashMap* _tmp165_ = NULL;
								GeeMapEntry* _tmp166_ = NULL;
								gconstpointer _tmp167_ = NULL;
								gint _tmp168_ = 0;
								GeeMapEntry* _tmp169_ = NULL;
								gconstpointer _tmp170_ = NULL;
								ContactsContactEditorRowData* _tmp171_ = NULL;
								_tmp154_ = _entry_it;
								_tmp155_ = gee_iterator_next (_tmp154_);
								if (!_tmp155_) {
									break;
								}
								_tmp156_ = _entry_it;
								_tmp157_ = gee_iterator_get (_tmp156_);
								entry = (GeeMapEntry*) _tmp157_;
								_tmp158_ = self->priv->writable_personas;
								_tmp159_ = persona_uid;
								_tmp160_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp158_, _tmp159_);
								_tmp161_ = (GeeHashMap*) _tmp160_;
								_tmp162_ = prop_name;
								_tmp163_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp161_, _tmp162_);
								_tmp164_ = (ContactsContactEditorField*) _tmp163_;
								_tmp165_ = (*_tmp164_).rows;
								_tmp166_ = entry;
								_tmp167_ = gee_map_entry_get_key (_tmp166_);
								_tmp168_ = _tmp167_;
								_tmp169_ = entry;
								_tmp170_ = gee_map_entry_get_value (_tmp169_);
								_tmp171_ = _tmp170_;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp165_, (gpointer) ((gintptr) ((gint) ((gintptr) _tmp168_))), (ContactsContactEditorRowData*) _tmp171_);
								_contacts_contact_editor_field_free0 (_tmp164_);
								_g_object_unref0 (_tmp161_);
								_g_object_unref0 (entry);
							}
							_g_object_unref0 (_entry_it);
						}
					} else {
						GeeHashMap* _tmp172_ = NULL;
						const gchar* _tmp173_ = NULL;
						gpointer _tmp174_ = NULL;
						GeeHashMap* _tmp175_ = NULL;
						const gchar* _tmp176_ = NULL;
						GeeHashMap* _tmp177_ = NULL;
						ContactsContactEditorField _tmp178_ = {0};
						_tmp172_ = self->priv->writable_personas;
						_tmp173_ = persona_uid;
						_tmp174_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp172_, _tmp173_);
						_tmp175_ = (GeeHashMap*) _tmp174_;
						_tmp176_ = prop_name;
						_tmp177_ = rows;
						_tmp178_.changed = FALSE;
						_g_object_unref0 (_tmp178_.rows);
						_tmp178_.rows = _tmp177_;
						gee_abstract_map_set ((GeeAbstractMap*) _tmp175_, _tmp176_, &_tmp178_);
						_g_object_unref0 (_tmp175_);
					}
				}
				_g_object_unref0 (rows);
				break;
			}
		}
	} else if (_tmp9_ == ((0 != _tmp8_label2) ? _tmp8_label2 : (_tmp8_label2 = g_quark_from_static_string ("urls")))) {
		switch (0) {
			default:
			{
				GeeHashMap* rows = NULL;
				GeeHashMap* _tmp179_ = NULL;
				gboolean _tmp180_ = FALSE;
				GeeHashMap* _tmp212_ = NULL;
				gboolean _tmp213_ = FALSE;
				gboolean _tmp214_ = FALSE;
				_tmp179_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, CONTACTS_CONTACT_EDITOR_TYPE_ROW_DATA, (GBoxedCopyFunc) contacts_contact_editor_row_data_dup, contacts_contact_editor_row_data_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
				rows = _tmp179_;
				_tmp180_ = add_empty;
				if (_tmp180_) {
					FolksUrlFieldDetails* detail_field = NULL;
					FolksUrlFieldDetails* _tmp181_ = NULL;
					const gchar* _tmp182_ = NULL;
					FolksUrlFieldDetails* _tmp183_ = NULL;
					gint _tmp184_ = 0;
					GeeHashMap* _tmp185_ = NULL;
					gint _tmp186_ = 0;
					FolksUrlFieldDetails* _tmp187_ = NULL;
					ContactsContactEditorRowData _tmp188_ = {0};
					gint _tmp189_ = 0;
					_tmp181_ = folks_url_field_details_new ("", NULL);
					detail_field = _tmp181_;
					_tmp182_ = _ ("Website");
					_tmp183_ = detail_field;
					_tmp184_ = *row;
					contacts_contact_editor_attach_row_with_entry_labeled (self, _tmp182_, (FolksAbstractFieldDetails*) _tmp183_, "", _tmp184_);
					_tmp185_ = rows;
					_tmp186_ = *row;
					_tmp187_ = detail_field;
					_g_object_unref0 (_tmp188_.details);
					_tmp188_.details = (FolksAbstractFieldDetails*) _tmp187_;
					gee_abstract_map_set ((GeeAbstractMap*) _tmp185_, (gpointer) ((gintptr) _tmp186_), &_tmp188_);
					_tmp189_ = *row;
					*row = _tmp189_ + 1;
					_g_object_unref0 (detail_field);
				} else {
					FolksUrlDetails* url_details = NULL;
					FolksPersona* _tmp190_ = NULL;
					FolksUrlDetails* _tmp191_ = NULL;
					FolksUrlDetails* _tmp192_ = NULL;
					_tmp190_ = p;
					_tmp191_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp190_, FOLKS_TYPE_URL_DETAILS) ? ((FolksUrlDetails*) _tmp190_) : NULL);
					url_details = _tmp191_;
					_tmp192_ = url_details;
					if (_tmp192_ != NULL) {
						{
							GeeIterator* _url_it = NULL;
							FolksUrlDetails* _tmp193_ = NULL;
							GeeSet* _tmp194_ = NULL;
							GeeSet* _tmp195_ = NULL;
							GeeIterator* _tmp196_ = NULL;
							_tmp193_ = url_details;
							_tmp194_ = folks_url_details_get_urls (_tmp193_);
							_tmp195_ = _tmp194_;
							_tmp196_ = gee_iterable_iterator ((GeeIterable*) _tmp195_);
							_url_it = _tmp196_;
							while (TRUE) {
								GeeIterator* _tmp197_ = NULL;
								gboolean _tmp198_ = FALSE;
								FolksUrlFieldDetails* url = NULL;
								GeeIterator* _tmp199_ = NULL;
								gpointer _tmp200_ = NULL;
								const gchar* _tmp201_ = NULL;
								FolksUrlFieldDetails* _tmp202_ = NULL;
								FolksUrlFieldDetails* _tmp203_ = NULL;
								gconstpointer _tmp204_ = NULL;
								const gchar* _tmp205_ = NULL;
								gint _tmp206_ = 0;
								GeeHashMap* _tmp207_ = NULL;
								gint _tmp208_ = 0;
								FolksUrlFieldDetails* _tmp209_ = NULL;
								ContactsContactEditorRowData _tmp210_ = {0};
								gint _tmp211_ = 0;
								_tmp197_ = _url_it;
								_tmp198_ = gee_iterator_next (_tmp197_);
								if (!_tmp198_) {
									break;
								}
								_tmp199_ = _url_it;
								_tmp200_ = gee_iterator_get (_tmp199_);
								url = (FolksUrlFieldDetails*) _tmp200_;
								_tmp201_ = _ ("Website");
								_tmp202_ = url;
								_tmp203_ = url;
								_tmp204_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp203_);
								_tmp205_ = _tmp204_;
								_tmp206_ = *row;
								contacts_contact_editor_attach_row_with_entry_labeled (self, _tmp201_, (FolksAbstractFieldDetails*) _tmp202_, (const gchar*) _tmp205_, _tmp206_);
								_tmp207_ = rows;
								_tmp208_ = *row;
								_tmp209_ = url;
								_g_object_unref0 (_tmp210_.details);
								_tmp210_.details = (FolksAbstractFieldDetails*) _tmp209_;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp207_, (gpointer) ((gintptr) _tmp208_), &_tmp210_);
								_tmp211_ = *row;
								*row = _tmp211_ + 1;
								_g_object_unref0 (url);
							}
							_g_object_unref0 (_url_it);
						}
					}
					_g_object_unref0 (url_details);
				}
				_tmp212_ = rows;
				_tmp213_ = gee_map_get_is_empty ((GeeMap*) _tmp212_);
				_tmp214_ = _tmp213_;
				if (!_tmp214_) {
					GeeHashMap* _tmp215_ = NULL;
					const gchar* _tmp216_ = NULL;
					gpointer _tmp217_ = NULL;
					GeeHashMap* _tmp218_ = NULL;
					const gchar* _tmp219_ = NULL;
					gboolean _tmp220_ = FALSE;
					gboolean _tmp221_ = FALSE;
					_tmp215_ = self->priv->writable_personas;
					_tmp216_ = persona_uid;
					_tmp217_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp215_, _tmp216_);
					_tmp218_ = (GeeHashMap*) _tmp217_;
					_tmp219_ = prop_name;
					_tmp220_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp218_, _tmp219_);
					_tmp221_ = _tmp220_;
					_g_object_unref0 (_tmp218_);
					if (_tmp221_) {
						{
							GeeIterator* _entry_it = NULL;
							GeeHashMap* _tmp222_ = NULL;
							GeeSet* _tmp223_ = NULL;
							GeeSet* _tmp224_ = NULL;
							GeeSet* _tmp225_ = NULL;
							GeeIterator* _tmp226_ = NULL;
							GeeIterator* _tmp227_ = NULL;
							_tmp222_ = rows;
							_tmp223_ = gee_abstract_map_get_entries ((GeeMap*) _tmp222_);
							_tmp224_ = _tmp223_;
							_tmp225_ = _tmp224_;
							_tmp226_ = gee_iterable_iterator ((GeeIterable*) _tmp225_);
							_tmp227_ = _tmp226_;
							_g_object_unref0 (_tmp225_);
							_entry_it = _tmp227_;
							while (TRUE) {
								GeeIterator* _tmp228_ = NULL;
								gboolean _tmp229_ = FALSE;
								GeeMapEntry* entry = NULL;
								GeeIterator* _tmp230_ = NULL;
								gpointer _tmp231_ = NULL;
								GeeHashMap* _tmp232_ = NULL;
								const gchar* _tmp233_ = NULL;
								gpointer _tmp234_ = NULL;
								GeeHashMap* _tmp235_ = NULL;
								const gchar* _tmp236_ = NULL;
								gpointer _tmp237_ = NULL;
								ContactsContactEditorField* _tmp238_ = NULL;
								GeeHashMap* _tmp239_ = NULL;
								GeeMapEntry* _tmp240_ = NULL;
								gconstpointer _tmp241_ = NULL;
								gint _tmp242_ = 0;
								GeeMapEntry* _tmp243_ = NULL;
								gconstpointer _tmp244_ = NULL;
								ContactsContactEditorRowData* _tmp245_ = NULL;
								_tmp228_ = _entry_it;
								_tmp229_ = gee_iterator_next (_tmp228_);
								if (!_tmp229_) {
									break;
								}
								_tmp230_ = _entry_it;
								_tmp231_ = gee_iterator_get (_tmp230_);
								entry = (GeeMapEntry*) _tmp231_;
								_tmp232_ = self->priv->writable_personas;
								_tmp233_ = persona_uid;
								_tmp234_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp232_, _tmp233_);
								_tmp235_ = (GeeHashMap*) _tmp234_;
								_tmp236_ = prop_name;
								_tmp237_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp235_, _tmp236_);
								_tmp238_ = (ContactsContactEditorField*) _tmp237_;
								_tmp239_ = (*_tmp238_).rows;
								_tmp240_ = entry;
								_tmp241_ = gee_map_entry_get_key (_tmp240_);
								_tmp242_ = _tmp241_;
								_tmp243_ = entry;
								_tmp244_ = gee_map_entry_get_value (_tmp243_);
								_tmp245_ = _tmp244_;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp239_, (gpointer) ((gintptr) ((gint) ((gintptr) _tmp242_))), (ContactsContactEditorRowData*) _tmp245_);
								_contacts_contact_editor_field_free0 (_tmp238_);
								_g_object_unref0 (_tmp235_);
								_g_object_unref0 (entry);
							}
							_g_object_unref0 (_entry_it);
						}
					} else {
						GeeHashMap* _tmp246_ = NULL;
						const gchar* _tmp247_ = NULL;
						gpointer _tmp248_ = NULL;
						GeeHashMap* _tmp249_ = NULL;
						const gchar* _tmp250_ = NULL;
						GeeHashMap* _tmp251_ = NULL;
						ContactsContactEditorField _tmp252_ = {0};
						_tmp246_ = self->priv->writable_personas;
						_tmp247_ = persona_uid;
						_tmp248_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp246_, _tmp247_);
						_tmp249_ = (GeeHashMap*) _tmp248_;
						_tmp250_ = prop_name;
						_tmp251_ = rows;
						_tmp252_.changed = FALSE;
						_g_object_unref0 (_tmp252_.rows);
						_tmp252_.rows = _tmp251_;
						gee_abstract_map_set ((GeeAbstractMap*) _tmp249_, _tmp250_, &_tmp252_);
						_g_object_unref0 (_tmp249_);
					}
				}
				_g_object_unref0 (rows);
				break;
			}
		}
	} else if (_tmp9_ == ((0 != _tmp8_label3) ? _tmp8_label3 : (_tmp8_label3 = g_quark_from_static_string ("nickname")))) {
		switch (0) {
			default:
			{
				GeeHashMap* rows = NULL;
				GeeHashMap* _tmp253_ = NULL;
				gboolean _tmp254_ = FALSE;
				GeeHashMap* _tmp277_ = NULL;
				gboolean _tmp278_ = FALSE;
				gboolean _tmp279_ = FALSE;
				_tmp253_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, CONTACTS_CONTACT_EDITOR_TYPE_ROW_DATA, (GBoxedCopyFunc) contacts_contact_editor_row_data_dup, contacts_contact_editor_row_data_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
				rows = _tmp253_;
				_tmp254_ = add_empty;
				if (_tmp254_) {
					const gchar* _tmp255_ = NULL;
					gint _tmp256_ = 0;
					GeeHashMap* _tmp257_ = NULL;
					gint _tmp258_ = 0;
					ContactsContactEditorRowData _tmp259_ = {0};
					gint _tmp260_ = 0;
					_tmp255_ = _ ("Nickname");
					_tmp256_ = *row;
					contacts_contact_editor_attach_row_with_entry_labeled (self, _tmp255_, NULL, "", _tmp256_);
					_tmp257_ = rows;
					_tmp258_ = *row;
					_g_object_unref0 (_tmp259_.details);
					_tmp259_.details = NULL;
					gee_abstract_map_set ((GeeAbstractMap*) _tmp257_, (gpointer) ((gintptr) _tmp258_), &_tmp259_);
					_tmp260_ = *row;
					*row = _tmp260_ + 1;
				} else {
					FolksNameDetails* name_details = NULL;
					FolksPersona* _tmp261_ = NULL;
					FolksNameDetails* _tmp262_ = NULL;
					FolksNameDetails* _tmp263_ = NULL;
					_tmp261_ = p;
					_tmp262_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp261_, FOLKS_TYPE_NAME_DETAILS) ? ((FolksNameDetails*) _tmp261_) : NULL);
					name_details = _tmp262_;
					_tmp263_ = name_details;
					if (_tmp263_ != NULL) {
						FolksNameDetails* _tmp264_ = NULL;
						const gchar* _tmp265_ = NULL;
						const gchar* _tmp266_ = NULL;
						gboolean _tmp267_ = FALSE;
						_tmp264_ = name_details;
						_tmp265_ = folks_name_details_get_nickname (_tmp264_);
						_tmp266_ = _tmp265_;
						_tmp267_ = contacts_is_set (_tmp266_);
						if (_tmp267_) {
							const gchar* _tmp268_ = NULL;
							FolksNameDetails* _tmp269_ = NULL;
							const gchar* _tmp270_ = NULL;
							const gchar* _tmp271_ = NULL;
							gint _tmp272_ = 0;
							GeeHashMap* _tmp273_ = NULL;
							gint _tmp274_ = 0;
							ContactsContactEditorRowData _tmp275_ = {0};
							gint _tmp276_ = 0;
							_tmp268_ = _ ("Nickname");
							_tmp269_ = name_details;
							_tmp270_ = folks_name_details_get_nickname (_tmp269_);
							_tmp271_ = _tmp270_;
							_tmp272_ = *row;
							contacts_contact_editor_attach_row_with_entry_labeled (self, _tmp268_, NULL, _tmp271_, _tmp272_);
							_tmp273_ = rows;
							_tmp274_ = *row;
							_g_object_unref0 (_tmp275_.details);
							_tmp275_.details = NULL;
							gee_abstract_map_set ((GeeAbstractMap*) _tmp273_, (gpointer) ((gintptr) _tmp274_), &_tmp275_);
							_tmp276_ = *row;
							*row = _tmp276_ + 1;
						}
					}
					_g_object_unref0 (name_details);
				}
				_tmp277_ = rows;
				_tmp278_ = gee_map_get_is_empty ((GeeMap*) _tmp277_);
				_tmp279_ = _tmp278_;
				if (!_tmp279_) {
					GtkButton* delete_button = NULL;
					GtkGrid* _tmp280_ = NULL;
					gint _tmp281_ = 0;
					GtkWidget* _tmp282_ = NULL;
					GtkButton* _tmp283_ = NULL;
					GtkButton* _tmp284_ = NULL;
					GeeHashMap* _tmp285_ = NULL;
					const gchar* _tmp286_ = NULL;
					gpointer _tmp287_ = NULL;
					GeeHashMap* _tmp288_ = NULL;
					const gchar* _tmp289_ = NULL;
					gboolean _tmp290_ = FALSE;
					gboolean _tmp291_ = FALSE;
					contacts_contact_editor_set_has_nickname_row (self, TRUE);
					_tmp280_ = self->priv->container_grid;
					_tmp281_ = *row;
					_tmp282_ = gtk_grid_get_child_at (_tmp280_, 3, _tmp281_ - 1);
					_tmp283_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp282_, gtk_button_get_type ()) ? ((GtkButton*) _tmp282_) : NULL);
					delete_button = _tmp283_;
					_tmp284_ = delete_button;
					g_signal_connect_object (_tmp284_, "clicked", (GCallback) _____lambda56__gtk_button_clicked, self, 0);
					_tmp285_ = self->priv->writable_personas;
					_tmp286_ = persona_uid;
					_tmp287_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp285_, _tmp286_);
					_tmp288_ = (GeeHashMap*) _tmp287_;
					_tmp289_ = prop_name;
					_tmp290_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp288_, _tmp289_);
					_tmp291_ = _tmp290_;
					_g_object_unref0 (_tmp288_);
					if (_tmp291_) {
						{
							GeeIterator* _entry_it = NULL;
							GeeHashMap* _tmp292_ = NULL;
							GeeSet* _tmp293_ = NULL;
							GeeSet* _tmp294_ = NULL;
							GeeSet* _tmp295_ = NULL;
							GeeIterator* _tmp296_ = NULL;
							GeeIterator* _tmp297_ = NULL;
							_tmp292_ = rows;
							_tmp293_ = gee_abstract_map_get_entries ((GeeMap*) _tmp292_);
							_tmp294_ = _tmp293_;
							_tmp295_ = _tmp294_;
							_tmp296_ = gee_iterable_iterator ((GeeIterable*) _tmp295_);
							_tmp297_ = _tmp296_;
							_g_object_unref0 (_tmp295_);
							_entry_it = _tmp297_;
							while (TRUE) {
								GeeIterator* _tmp298_ = NULL;
								gboolean _tmp299_ = FALSE;
								GeeMapEntry* entry = NULL;
								GeeIterator* _tmp300_ = NULL;
								gpointer _tmp301_ = NULL;
								GeeHashMap* _tmp302_ = NULL;
								const gchar* _tmp303_ = NULL;
								gpointer _tmp304_ = NULL;
								GeeHashMap* _tmp305_ = NULL;
								const gchar* _tmp306_ = NULL;
								gpointer _tmp307_ = NULL;
								ContactsContactEditorField* _tmp308_ = NULL;
								GeeHashMap* _tmp309_ = NULL;
								GeeMapEntry* _tmp310_ = NULL;
								gconstpointer _tmp311_ = NULL;
								gint _tmp312_ = 0;
								GeeMapEntry* _tmp313_ = NULL;
								gconstpointer _tmp314_ = NULL;
								ContactsContactEditorRowData* _tmp315_ = NULL;
								_tmp298_ = _entry_it;
								_tmp299_ = gee_iterator_next (_tmp298_);
								if (!_tmp299_) {
									break;
								}
								_tmp300_ = _entry_it;
								_tmp301_ = gee_iterator_get (_tmp300_);
								entry = (GeeMapEntry*) _tmp301_;
								_tmp302_ = self->priv->writable_personas;
								_tmp303_ = persona_uid;
								_tmp304_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp302_, _tmp303_);
								_tmp305_ = (GeeHashMap*) _tmp304_;
								_tmp306_ = prop_name;
								_tmp307_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp305_, _tmp306_);
								_tmp308_ = (ContactsContactEditorField*) _tmp307_;
								_tmp309_ = (*_tmp308_).rows;
								_tmp310_ = entry;
								_tmp311_ = gee_map_entry_get_key (_tmp310_);
								_tmp312_ = _tmp311_;
								_tmp313_ = entry;
								_tmp314_ = gee_map_entry_get_value (_tmp313_);
								_tmp315_ = _tmp314_;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp309_, (gpointer) ((gintptr) ((gint) ((gintptr) _tmp312_))), (ContactsContactEditorRowData*) _tmp315_);
								_contacts_contact_editor_field_free0 (_tmp308_);
								_g_object_unref0 (_tmp305_);
								_g_object_unref0 (entry);
							}
							_g_object_unref0 (_entry_it);
						}
					} else {
						GeeHashMap* _tmp316_ = NULL;
						const gchar* _tmp317_ = NULL;
						gpointer _tmp318_ = NULL;
						GeeHashMap* _tmp319_ = NULL;
						const gchar* _tmp320_ = NULL;
						GeeHashMap* _tmp321_ = NULL;
						ContactsContactEditorField _tmp322_ = {0};
						_tmp316_ = self->priv->writable_personas;
						_tmp317_ = persona_uid;
						_tmp318_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp316_, _tmp317_);
						_tmp319_ = (GeeHashMap*) _tmp318_;
						_tmp320_ = prop_name;
						_tmp321_ = rows;
						_tmp322_.changed = FALSE;
						_g_object_unref0 (_tmp322_.rows);
						_tmp322_.rows = _tmp321_;
						gee_abstract_map_set ((GeeAbstractMap*) _tmp319_, _tmp320_, &_tmp322_);
						_g_object_unref0 (_tmp319_);
					}
					_g_object_unref0 (delete_button);
				}
				_g_object_unref0 (rows);
				break;
			}
		}
	} else if (_tmp9_ == ((0 != _tmp8_label4) ? _tmp8_label4 : (_tmp8_label4 = g_quark_from_static_string ("birthday")))) {
		switch (0) {
			default:
			{
				GeeHashMap* rows = NULL;
				GeeHashMap* _tmp323_ = NULL;
				gboolean _tmp324_ = FALSE;
				GeeHashMap* _tmp348_ = NULL;
				gboolean _tmp349_ = FALSE;
				gboolean _tmp350_ = FALSE;
				_tmp323_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, CONTACTS_CONTACT_EDITOR_TYPE_ROW_DATA, (GBoxedCopyFunc) contacts_contact_editor_row_data_dup, contacts_contact_editor_row_data_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
				rows = _tmp323_;
				_tmp324_ = add_empty;
				if (_tmp324_) {
					GDateTime* today = NULL;
					GDateTime* _tmp325_ = NULL;
					const gchar* _tmp326_ = NULL;
					GDateTime* _tmp327_ = NULL;
					gint _tmp328_ = 0;
					GeeHashMap* _tmp329_ = NULL;
					gint _tmp330_ = 0;
					ContactsContactEditorRowData _tmp331_ = {0};
					gint _tmp332_ = 0;
					_tmp325_ = g_date_time_new_now_local ();
					today = _tmp325_;
					_tmp326_ = _ ("Birthday");
					_tmp327_ = today;
					_tmp328_ = *row;
					contacts_contact_editor_attach_row_for_birthday (self, _tmp326_, NULL, _tmp327_, _tmp328_);
					_tmp329_ = rows;
					_tmp330_ = *row;
					_g_object_unref0 (_tmp331_.details);
					_tmp331_.details = NULL;
					gee_abstract_map_set ((GeeAbstractMap*) _tmp329_, (gpointer) ((gintptr) _tmp330_), &_tmp331_);
					_tmp332_ = *row;
					*row = _tmp332_ + 1;
					_g_date_time_unref0 (today);
				} else {
					FolksBirthdayDetails* birthday_details = NULL;
					FolksPersona* _tmp333_ = NULL;
					FolksBirthdayDetails* _tmp334_ = NULL;
					FolksBirthdayDetails* _tmp335_ = NULL;
					_tmp333_ = p;
					_tmp334_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp333_, FOLKS_TYPE_BIRTHDAY_DETAILS) ? ((FolksBirthdayDetails*) _tmp333_) : NULL);
					birthday_details = _tmp334_;
					_tmp335_ = birthday_details;
					if (_tmp335_ != NULL) {
						FolksBirthdayDetails* _tmp336_ = NULL;
						GDateTime* _tmp337_ = NULL;
						GDateTime* _tmp338_ = NULL;
						_tmp336_ = birthday_details;
						_tmp337_ = folks_birthday_details_get_birthday (_tmp336_);
						_tmp338_ = _tmp337_;
						if (_tmp338_ != NULL) {
							const gchar* _tmp339_ = NULL;
							FolksBirthdayDetails* _tmp340_ = NULL;
							GDateTime* _tmp341_ = NULL;
							GDateTime* _tmp342_ = NULL;
							gint _tmp343_ = 0;
							GeeHashMap* _tmp344_ = NULL;
							gint _tmp345_ = 0;
							ContactsContactEditorRowData _tmp346_ = {0};
							gint _tmp347_ = 0;
							_tmp339_ = _ ("Birthday");
							_tmp340_ = birthday_details;
							_tmp341_ = folks_birthday_details_get_birthday (_tmp340_);
							_tmp342_ = _tmp341_;
							_tmp343_ = *row;
							contacts_contact_editor_attach_row_for_birthday (self, _tmp339_, NULL, _tmp342_, _tmp343_);
							_tmp344_ = rows;
							_tmp345_ = *row;
							_g_object_unref0 (_tmp346_.details);
							_tmp346_.details = NULL;
							gee_abstract_map_set ((GeeAbstractMap*) _tmp344_, (gpointer) ((gintptr) _tmp345_), &_tmp346_);
							_tmp347_ = *row;
							*row = _tmp347_ + 1;
						}
					}
					_g_object_unref0 (birthday_details);
				}
				_tmp348_ = rows;
				_tmp349_ = gee_map_get_is_empty ((GeeMap*) _tmp348_);
				_tmp350_ = _tmp349_;
				if (!_tmp350_) {
					GeeHashMap* _tmp351_ = NULL;
					const gchar* _tmp352_ = NULL;
					gpointer _tmp353_ = NULL;
					GeeHashMap* _tmp354_ = NULL;
					const gchar* _tmp355_ = NULL;
					gboolean _tmp356_ = FALSE;
					GeeHashMap* _tmp357_ = NULL;
					ContactsContactEditorField _tmp358_ = {0};
					contacts_contact_editor_set_has_birthday_row (self, TRUE);
					_tmp351_ = self->priv->writable_personas;
					_tmp352_ = persona_uid;
					_tmp353_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp351_, _tmp352_);
					_tmp354_ = (GeeHashMap*) _tmp353_;
					_tmp355_ = prop_name;
					_tmp356_ = add_empty;
					_tmp357_ = rows;
					_tmp358_.changed = _tmp356_;
					_g_object_unref0 (_tmp358_.rows);
					_tmp358_.rows = _tmp357_;
					gee_abstract_map_set ((GeeAbstractMap*) _tmp354_, _tmp355_, &_tmp358_);
					_g_object_unref0 (_tmp354_);
				}
				_g_object_unref0 (rows);
				break;
			}
		}
	} else if (_tmp9_ == ((0 != _tmp8_label5) ? _tmp8_label5 : (_tmp8_label5 = g_quark_from_static_string ("notes")))) {
		switch (0) {
			default:
			{
				GeeHashMap* rows = NULL;
				GeeHashMap* _tmp359_ = NULL;
				gboolean _tmp360_ = FALSE;
				GeeHashMap* _tmp394_ = NULL;
				gboolean _tmp395_ = FALSE;
				gboolean _tmp396_ = FALSE;
				_tmp359_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, CONTACTS_CONTACT_EDITOR_TYPE_ROW_DATA, (GBoxedCopyFunc) contacts_contact_editor_row_data_dup, contacts_contact_editor_row_data_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
				rows = _tmp359_;
				_tmp360_ = add_empty;
				if (_tmp360_) {
					FolksNoteFieldDetails* detail_field = NULL;
					FolksNoteFieldDetails* _tmp361_ = NULL;
					const gchar* _tmp362_ = NULL;
					FolksNoteFieldDetails* _tmp363_ = NULL;
					gint _tmp364_ = 0;
					GeeHashMap* _tmp365_ = NULL;
					gint _tmp366_ = 0;
					FolksNoteFieldDetails* _tmp367_ = NULL;
					ContactsContactEditorRowData _tmp368_ = {0};
					gint _tmp369_ = 0;
					_tmp361_ = folks_note_field_details_new ("", NULL, NULL);
					detail_field = _tmp361_;
					_tmp362_ = _ ("Note");
					_tmp363_ = detail_field;
					_tmp364_ = *row;
					contacts_contact_editor_attach_row_with_text_labeled (self, _tmp362_, (FolksAbstractFieldDetails*) _tmp363_, "", _tmp364_);
					_tmp365_ = rows;
					_tmp366_ = *row;
					_tmp367_ = detail_field;
					_g_object_unref0 (_tmp368_.details);
					_tmp368_.details = (FolksAbstractFieldDetails*) _tmp367_;
					gee_abstract_map_set ((GeeAbstractMap*) _tmp365_, (gpointer) ((gintptr) _tmp366_), &_tmp368_);
					_tmp369_ = *row;
					*row = _tmp369_ + 1;
					_g_object_unref0 (detail_field);
				} else {
					FolksNoteDetails* note_details = NULL;
					FolksPersona* _tmp370_ = NULL;
					FolksNoteDetails* _tmp371_ = NULL;
					gboolean _tmp372_ = FALSE;
					FolksNoteDetails* _tmp373_ = NULL;
					_tmp370_ = p;
					_tmp371_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp370_, FOLKS_TYPE_NOTE_DETAILS) ? ((FolksNoteDetails*) _tmp370_) : NULL);
					note_details = _tmp371_;
					_tmp373_ = note_details;
					if (_tmp373_ != NULL) {
						_tmp372_ = TRUE;
					} else {
						gboolean _tmp374_ = FALSE;
						_tmp374_ = add_empty;
						_tmp372_ = _tmp374_;
					}
					if (_tmp372_) {
						{
							GeeIterator* _note_it = NULL;
							FolksNoteDetails* _tmp375_ = NULL;
							GeeSet* _tmp376_ = NULL;
							GeeSet* _tmp377_ = NULL;
							GeeIterator* _tmp378_ = NULL;
							_tmp375_ = note_details;
							_tmp376_ = folks_note_details_get_notes (_tmp375_);
							_tmp377_ = _tmp376_;
							_tmp378_ = gee_iterable_iterator ((GeeIterable*) _tmp377_);
							_note_it = _tmp378_;
							while (TRUE) {
								GeeIterator* _tmp379_ = NULL;
								gboolean _tmp380_ = FALSE;
								FolksNoteFieldDetails* note = NULL;
								GeeIterator* _tmp381_ = NULL;
								gpointer _tmp382_ = NULL;
								const gchar* _tmp383_ = NULL;
								FolksNoteFieldDetails* _tmp384_ = NULL;
								FolksNoteFieldDetails* _tmp385_ = NULL;
								gconstpointer _tmp386_ = NULL;
								const gchar* _tmp387_ = NULL;
								gint _tmp388_ = 0;
								GeeHashMap* _tmp389_ = NULL;
								gint _tmp390_ = 0;
								FolksNoteFieldDetails* _tmp391_ = NULL;
								ContactsContactEditorRowData _tmp392_ = {0};
								gint _tmp393_ = 0;
								_tmp379_ = _note_it;
								_tmp380_ = gee_iterator_next (_tmp379_);
								if (!_tmp380_) {
									break;
								}
								_tmp381_ = _note_it;
								_tmp382_ = gee_iterator_get (_tmp381_);
								note = (FolksNoteFieldDetails*) _tmp382_;
								_tmp383_ = _ ("Note");
								_tmp384_ = note;
								_tmp385_ = note;
								_tmp386_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp385_);
								_tmp387_ = _tmp386_;
								_tmp388_ = *row;
								contacts_contact_editor_attach_row_with_text_labeled (self, _tmp383_, (FolksAbstractFieldDetails*) _tmp384_, (const gchar*) _tmp387_, _tmp388_);
								_tmp389_ = rows;
								_tmp390_ = *row;
								_tmp391_ = note;
								_g_object_unref0 (_tmp392_.details);
								_tmp392_.details = (FolksAbstractFieldDetails*) _tmp391_;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp389_, (gpointer) ((gintptr) _tmp390_), &_tmp392_);
								_tmp393_ = *row;
								*row = _tmp393_ + 1;
								_g_object_unref0 (note);
							}
							_g_object_unref0 (_note_it);
						}
					}
					_g_object_unref0 (note_details);
				}
				_tmp394_ = rows;
				_tmp395_ = gee_map_get_is_empty ((GeeMap*) _tmp394_);
				_tmp396_ = _tmp395_;
				if (!_tmp396_) {
					GeeHashMap* _tmp397_ = NULL;
					const gchar* _tmp398_ = NULL;
					gpointer _tmp399_ = NULL;
					GeeHashMap* _tmp400_ = NULL;
					const gchar* _tmp401_ = NULL;
					gboolean _tmp402_ = FALSE;
					gboolean _tmp403_ = FALSE;
					contacts_contact_editor_set_has_notes_row (self, TRUE);
					_tmp397_ = self->priv->writable_personas;
					_tmp398_ = persona_uid;
					_tmp399_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp397_, _tmp398_);
					_tmp400_ = (GeeHashMap*) _tmp399_;
					_tmp401_ = prop_name;
					_tmp402_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp400_, _tmp401_);
					_tmp403_ = _tmp402_;
					_g_object_unref0 (_tmp400_);
					if (_tmp403_) {
						{
							GeeIterator* _entry_it = NULL;
							GeeHashMap* _tmp404_ = NULL;
							GeeSet* _tmp405_ = NULL;
							GeeSet* _tmp406_ = NULL;
							GeeSet* _tmp407_ = NULL;
							GeeIterator* _tmp408_ = NULL;
							GeeIterator* _tmp409_ = NULL;
							_tmp404_ = rows;
							_tmp405_ = gee_abstract_map_get_entries ((GeeMap*) _tmp404_);
							_tmp406_ = _tmp405_;
							_tmp407_ = _tmp406_;
							_tmp408_ = gee_iterable_iterator ((GeeIterable*) _tmp407_);
							_tmp409_ = _tmp408_;
							_g_object_unref0 (_tmp407_);
							_entry_it = _tmp409_;
							while (TRUE) {
								GeeIterator* _tmp410_ = NULL;
								gboolean _tmp411_ = FALSE;
								GeeMapEntry* entry = NULL;
								GeeIterator* _tmp412_ = NULL;
								gpointer _tmp413_ = NULL;
								GeeHashMap* _tmp414_ = NULL;
								const gchar* _tmp415_ = NULL;
								gpointer _tmp416_ = NULL;
								GeeHashMap* _tmp417_ = NULL;
								const gchar* _tmp418_ = NULL;
								gpointer _tmp419_ = NULL;
								ContactsContactEditorField* _tmp420_ = NULL;
								GeeHashMap* _tmp421_ = NULL;
								GeeMapEntry* _tmp422_ = NULL;
								gconstpointer _tmp423_ = NULL;
								gint _tmp424_ = 0;
								GeeMapEntry* _tmp425_ = NULL;
								gconstpointer _tmp426_ = NULL;
								ContactsContactEditorRowData* _tmp427_ = NULL;
								_tmp410_ = _entry_it;
								_tmp411_ = gee_iterator_next (_tmp410_);
								if (!_tmp411_) {
									break;
								}
								_tmp412_ = _entry_it;
								_tmp413_ = gee_iterator_get (_tmp412_);
								entry = (GeeMapEntry*) _tmp413_;
								_tmp414_ = self->priv->writable_personas;
								_tmp415_ = persona_uid;
								_tmp416_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp414_, _tmp415_);
								_tmp417_ = (GeeHashMap*) _tmp416_;
								_tmp418_ = prop_name;
								_tmp419_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp417_, _tmp418_);
								_tmp420_ = (ContactsContactEditorField*) _tmp419_;
								_tmp421_ = (*_tmp420_).rows;
								_tmp422_ = entry;
								_tmp423_ = gee_map_entry_get_key (_tmp422_);
								_tmp424_ = _tmp423_;
								_tmp425_ = entry;
								_tmp426_ = gee_map_entry_get_value (_tmp425_);
								_tmp427_ = _tmp426_;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp421_, (gpointer) ((gintptr) ((gint) ((gintptr) _tmp424_))), (ContactsContactEditorRowData*) _tmp427_);
								_contacts_contact_editor_field_free0 (_tmp420_);
								_g_object_unref0 (_tmp417_);
								_g_object_unref0 (entry);
							}
							_g_object_unref0 (_entry_it);
						}
					} else {
						GeeHashMap* _tmp428_ = NULL;
						const gchar* _tmp429_ = NULL;
						gpointer _tmp430_ = NULL;
						GeeHashMap* _tmp431_ = NULL;
						const gchar* _tmp432_ = NULL;
						GeeHashMap* _tmp433_ = NULL;
						ContactsContactEditorField _tmp434_ = {0};
						_tmp428_ = self->priv->writable_personas;
						_tmp429_ = persona_uid;
						_tmp430_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp428_, _tmp429_);
						_tmp431_ = (GeeHashMap*) _tmp430_;
						_tmp432_ = prop_name;
						_tmp433_ = rows;
						_tmp434_.changed = FALSE;
						_g_object_unref0 (_tmp434_.rows);
						_tmp434_.rows = _tmp433_;
						gee_abstract_map_set ((GeeAbstractMap*) _tmp431_, _tmp432_, &_tmp434_);
						_g_object_unref0 (_tmp431_);
					}
				}
				_g_object_unref0 (rows);
				break;
			}
		}
	} else if (_tmp9_ == ((0 != _tmp8_label6) ? _tmp8_label6 : (_tmp8_label6 = g_quark_from_static_string ("postal-addresses")))) {
		switch (0) {
			default:
			{
				GeeHashMap* rows = NULL;
				GeeHashMap* _tmp435_ = NULL;
				gboolean _tmp436_ = FALSE;
				GeeHashMap* _tmp472_ = NULL;
				gboolean _tmp473_ = FALSE;
				gboolean _tmp474_ = FALSE;
				_tmp435_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, CONTACTS_CONTACT_EDITOR_TYPE_ROW_DATA, (GBoxedCopyFunc) contacts_contact_editor_row_data_dup, contacts_contact_editor_row_data_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
				rows = _tmp435_;
				_tmp436_ = add_empty;
				if (_tmp436_) {
					FolksPostalAddressFieldDetails* detail_field = NULL;
					FolksPostalAddress* _tmp437_ = NULL;
					FolksPostalAddress* _tmp438_ = NULL;
					FolksPostalAddressFieldDetails* _tmp439_ = NULL;
					FolksPostalAddressFieldDetails* _tmp440_ = NULL;
					gint _tmp441_ = 0;
					ContactsTypeSet* _tmp442_ = NULL;
					ContactsTypeSet* _tmp443_ = NULL;
					FolksPostalAddressFieldDetails* _tmp444_ = NULL;
					const gchar* _tmp445_ = NULL;
					GeeHashMap* _tmp446_ = NULL;
					gint _tmp447_ = 0;
					FolksPostalAddressFieldDetails* _tmp448_ = NULL;
					ContactsContactEditorRowData _tmp449_ = {0};
					gint _tmp450_ = 0;
					_tmp437_ = folks_postal_address_new (NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
					_tmp438_ = _tmp437_;
					_tmp439_ = folks_postal_address_field_details_new (_tmp438_, NULL);
					_tmp440_ = _tmp439_;
					_g_object_unref0 (_tmp438_);
					detail_field = _tmp440_;
					_tmp441_ = *row;
					_tmp442_ = contacts_typeset_get_general ();
					_tmp443_ = _tmp442_;
					_tmp444_ = detail_field;
					_tmp445_ = type;
					contacts_contact_editor_attach_row_for_address (self, _tmp441_, _tmp443_, _tmp444_, _tmp445_);
					_tmp446_ = rows;
					_tmp447_ = *row;
					_tmp448_ = detail_field;
					_g_object_unref0 (_tmp449_.details);
					_tmp449_.details = (FolksAbstractFieldDetails*) _tmp448_;
					gee_abstract_map_set ((GeeAbstractMap*) _tmp446_, (gpointer) ((gintptr) _tmp447_), &_tmp449_);
					_tmp450_ = *row;
					*row = _tmp450_ + 1;
					_g_object_unref0 (detail_field);
				} else {
					FolksPostalAddressDetails* address_details = NULL;
					FolksPersona* _tmp451_ = NULL;
					FolksPostalAddressDetails* _tmp452_ = NULL;
					FolksPostalAddressDetails* _tmp453_ = NULL;
					_tmp451_ = p;
					_tmp452_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp451_, FOLKS_TYPE_POSTAL_ADDRESS_DETAILS) ? ((FolksPostalAddressDetails*) _tmp451_) : NULL);
					address_details = _tmp452_;
					_tmp453_ = address_details;
					if (_tmp453_ != NULL) {
						{
							GeeIterator* _addr_it = NULL;
							FolksPostalAddressDetails* _tmp454_ = NULL;
							GeeSet* _tmp455_ = NULL;
							GeeSet* _tmp456_ = NULL;
							GeeIterator* _tmp457_ = NULL;
							_tmp454_ = address_details;
							_tmp455_ = folks_postal_address_details_get_postal_addresses (_tmp454_);
							_tmp456_ = _tmp455_;
							_tmp457_ = gee_iterable_iterator ((GeeIterable*) _tmp456_);
							_addr_it = _tmp457_;
							while (TRUE) {
								GeeIterator* _tmp458_ = NULL;
								gboolean _tmp459_ = FALSE;
								FolksPostalAddressFieldDetails* addr = NULL;
								GeeIterator* _tmp460_ = NULL;
								gpointer _tmp461_ = NULL;
								gint _tmp462_ = 0;
								ContactsTypeSet* _tmp463_ = NULL;
								ContactsTypeSet* _tmp464_ = NULL;
								FolksPostalAddressFieldDetails* _tmp465_ = NULL;
								const gchar* _tmp466_ = NULL;
								GeeHashMap* _tmp467_ = NULL;
								gint _tmp468_ = 0;
								FolksPostalAddressFieldDetails* _tmp469_ = NULL;
								ContactsContactEditorRowData _tmp470_ = {0};
								gint _tmp471_ = 0;
								_tmp458_ = _addr_it;
								_tmp459_ = gee_iterator_next (_tmp458_);
								if (!_tmp459_) {
									break;
								}
								_tmp460_ = _addr_it;
								_tmp461_ = gee_iterator_get (_tmp460_);
								addr = (FolksPostalAddressFieldDetails*) _tmp461_;
								_tmp462_ = *row;
								_tmp463_ = contacts_typeset_get_general ();
								_tmp464_ = _tmp463_;
								_tmp465_ = addr;
								_tmp466_ = type;
								contacts_contact_editor_attach_row_for_address (self, _tmp462_, _tmp464_, _tmp465_, _tmp466_);
								_tmp467_ = rows;
								_tmp468_ = *row;
								_tmp469_ = addr;
								_g_object_unref0 (_tmp470_.details);
								_tmp470_.details = (FolksAbstractFieldDetails*) _tmp469_;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp467_, (gpointer) ((gintptr) _tmp468_), &_tmp470_);
								_tmp471_ = *row;
								*row = _tmp471_ + 1;
								_g_object_unref0 (addr);
							}
							_g_object_unref0 (_addr_it);
						}
					}
					_g_object_unref0 (address_details);
				}
				_tmp472_ = rows;
				_tmp473_ = gee_map_get_is_empty ((GeeMap*) _tmp472_);
				_tmp474_ = _tmp473_;
				if (!_tmp474_) {
					GeeHashMap* _tmp475_ = NULL;
					const gchar* _tmp476_ = NULL;
					gpointer _tmp477_ = NULL;
					GeeHashMap* _tmp478_ = NULL;
					const gchar* _tmp479_ = NULL;
					gboolean _tmp480_ = FALSE;
					gboolean _tmp481_ = FALSE;
					_tmp475_ = self->priv->writable_personas;
					_tmp476_ = persona_uid;
					_tmp477_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp475_, _tmp476_);
					_tmp478_ = (GeeHashMap*) _tmp477_;
					_tmp479_ = prop_name;
					_tmp480_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp478_, _tmp479_);
					_tmp481_ = _tmp480_;
					_g_object_unref0 (_tmp478_);
					if (_tmp481_) {
						{
							GeeIterator* _entry_it = NULL;
							GeeHashMap* _tmp482_ = NULL;
							GeeSet* _tmp483_ = NULL;
							GeeSet* _tmp484_ = NULL;
							GeeSet* _tmp485_ = NULL;
							GeeIterator* _tmp486_ = NULL;
							GeeIterator* _tmp487_ = NULL;
							_tmp482_ = rows;
							_tmp483_ = gee_abstract_map_get_entries ((GeeMap*) _tmp482_);
							_tmp484_ = _tmp483_;
							_tmp485_ = _tmp484_;
							_tmp486_ = gee_iterable_iterator ((GeeIterable*) _tmp485_);
							_tmp487_ = _tmp486_;
							_g_object_unref0 (_tmp485_);
							_entry_it = _tmp487_;
							while (TRUE) {
								GeeIterator* _tmp488_ = NULL;
								gboolean _tmp489_ = FALSE;
								GeeMapEntry* entry = NULL;
								GeeIterator* _tmp490_ = NULL;
								gpointer _tmp491_ = NULL;
								GeeHashMap* _tmp492_ = NULL;
								const gchar* _tmp493_ = NULL;
								gpointer _tmp494_ = NULL;
								GeeHashMap* _tmp495_ = NULL;
								const gchar* _tmp496_ = NULL;
								gpointer _tmp497_ = NULL;
								ContactsContactEditorField* _tmp498_ = NULL;
								GeeHashMap* _tmp499_ = NULL;
								GeeMapEntry* _tmp500_ = NULL;
								gconstpointer _tmp501_ = NULL;
								gint _tmp502_ = 0;
								GeeMapEntry* _tmp503_ = NULL;
								gconstpointer _tmp504_ = NULL;
								ContactsContactEditorRowData* _tmp505_ = NULL;
								_tmp488_ = _entry_it;
								_tmp489_ = gee_iterator_next (_tmp488_);
								if (!_tmp489_) {
									break;
								}
								_tmp490_ = _entry_it;
								_tmp491_ = gee_iterator_get (_tmp490_);
								entry = (GeeMapEntry*) _tmp491_;
								_tmp492_ = self->priv->writable_personas;
								_tmp493_ = persona_uid;
								_tmp494_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp492_, _tmp493_);
								_tmp495_ = (GeeHashMap*) _tmp494_;
								_tmp496_ = prop_name;
								_tmp497_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp495_, _tmp496_);
								_tmp498_ = (ContactsContactEditorField*) _tmp497_;
								_tmp499_ = (*_tmp498_).rows;
								_tmp500_ = entry;
								_tmp501_ = gee_map_entry_get_key (_tmp500_);
								_tmp502_ = _tmp501_;
								_tmp503_ = entry;
								_tmp504_ = gee_map_entry_get_value (_tmp503_);
								_tmp505_ = _tmp504_;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp499_, (gpointer) ((gintptr) ((gint) ((gintptr) _tmp502_))), (ContactsContactEditorRowData*) _tmp505_);
								_contacts_contact_editor_field_free0 (_tmp498_);
								_g_object_unref0 (_tmp495_);
								_g_object_unref0 (entry);
							}
							_g_object_unref0 (_entry_it);
						}
					} else {
						GeeHashMap* _tmp506_ = NULL;
						const gchar* _tmp507_ = NULL;
						gpointer _tmp508_ = NULL;
						GeeHashMap* _tmp509_ = NULL;
						const gchar* _tmp510_ = NULL;
						GeeHashMap* _tmp511_ = NULL;
						ContactsContactEditorField _tmp512_ = {0};
						_tmp506_ = self->priv->writable_personas;
						_tmp507_ = persona_uid;
						_tmp508_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp506_, _tmp507_);
						_tmp509_ = (GeeHashMap*) _tmp508_;
						_tmp510_ = prop_name;
						_tmp511_ = rows;
						_tmp512_.changed = FALSE;
						_g_object_unref0 (_tmp512_.rows);
						_tmp512_.rows = _tmp511_;
						gee_abstract_map_set ((GeeAbstractMap*) _tmp509_, _tmp510_, &_tmp512_);
						_g_object_unref0 (_tmp509_);
					}
				}
				_g_object_unref0 (rows);
				break;
			}
		}
	}
	_g_free0 (persona_uid);
}


static gint contacts_contact_editor_get_current_row (ContactsContactEditor* self, GtkWidget* child) {
	gint result = 0;
	gint row = 0;
	GtkGrid* _tmp0_ = NULL;
	GtkWidget* _tmp1_ = NULL;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (child != NULL, 0);
	_tmp0_ = self->priv->container_grid;
	_tmp1_ = child;
	gtk_container_child_get ((GtkContainer*) _tmp0_, _tmp1_, "top-attach", &row, NULL);
	result = row;
	return result;
}


static void contacts_contact_editor_insert_row_at (ContactsContactEditor* self, gint idx) {
	GtkGrid* _tmp120_ = NULL;
	gint _tmp121_ = 0;
	g_return_if_fail (self != NULL);
	{
		GeeIterator* _field_maps_it = NULL;
		GeeHashMap* _tmp0_ = NULL;
		GeeCollection* _tmp1_ = NULL;
		GeeCollection* _tmp2_ = NULL;
		GeeCollection* _tmp3_ = NULL;
		GeeIterator* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		_tmp0_ = self->priv->writable_personas;
		_tmp1_ = gee_abstract_map_get_values ((GeeMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_field_maps_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_ = NULL;
			gboolean _tmp7_ = FALSE;
			GeeHashMap* field_maps = NULL;
			GeeIterator* _tmp8_ = NULL;
			gpointer _tmp9_ = NULL;
			_tmp6_ = _field_maps_it;
			_tmp7_ = gee_iterator_next (_tmp6_);
			if (!_tmp7_) {
				break;
			}
			_tmp8_ = _field_maps_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			field_maps = (GeeHashMap*) _tmp9_;
			{
				GeeIterator* _field_it = NULL;
				GeeHashMap* _tmp10_ = NULL;
				GeeCollection* _tmp11_ = NULL;
				GeeCollection* _tmp12_ = NULL;
				GeeCollection* _tmp13_ = NULL;
				GeeIterator* _tmp14_ = NULL;
				GeeIterator* _tmp15_ = NULL;
				_tmp10_ = field_maps;
				_tmp11_ = gee_abstract_map_get_values ((GeeMap*) _tmp10_);
				_tmp12_ = _tmp11_;
				_tmp13_ = _tmp12_;
				_tmp14_ = gee_iterable_iterator ((GeeIterable*) _tmp13_);
				_tmp15_ = _tmp14_;
				_g_object_unref0 (_tmp13_);
				_field_it = _tmp15_;
				while (TRUE) {
					GeeIterator* _tmp16_ = NULL;
					gboolean _tmp17_ = FALSE;
					ContactsContactEditorField* field = NULL;
					GeeIterator* _tmp18_ = NULL;
					gpointer _tmp19_ = NULL;
					_tmp16_ = _field_it;
					_tmp17_ = gee_iterator_next (_tmp16_);
					if (!_tmp17_) {
						break;
					}
					_tmp18_ = _field_it;
					_tmp19_ = gee_iterator_get (_tmp18_);
					field = (ContactsContactEditorField*) _tmp19_;
					{
						GeeIterator* _row_it = NULL;
						ContactsContactEditorField* _tmp20_ = NULL;
						GeeHashMap* _tmp21_ = NULL;
						GeeSet* _tmp22_ = NULL;
						GeeSet* _tmp23_ = NULL;
						GeeSet* _tmp24_ = NULL;
						GeeIterator* _tmp25_ = NULL;
						GeeIterator* _tmp26_ = NULL;
						_tmp20_ = field;
						_tmp21_ = (*_tmp20_).rows;
						_tmp22_ = gee_abstract_map_get_keys ((GeeMap*) _tmp21_);
						_tmp23_ = _tmp22_;
						_tmp24_ = _tmp23_;
						_tmp25_ = gee_iterable_iterator ((GeeIterable*) _tmp24_);
						_tmp26_ = _tmp25_;
						_g_object_unref0 (_tmp24_);
						_row_it = _tmp26_;
						while (TRUE) {
							GeeIterator* _tmp27_ = NULL;
							gboolean _tmp28_ = FALSE;
							gint row = 0;
							GeeIterator* _tmp29_ = NULL;
							gpointer _tmp30_ = NULL;
							gint _tmp31_ = 0;
							gint _tmp32_ = 0;
							_tmp27_ = _row_it;
							_tmp28_ = gee_iterator_next (_tmp27_);
							if (!_tmp28_) {
								break;
							}
							_tmp29_ = _row_it;
							_tmp30_ = gee_iterator_get (_tmp29_);
							row = (gint) ((gintptr) _tmp30_);
							_tmp31_ = row;
							_tmp32_ = idx;
							if (_tmp31_ >= _tmp32_) {
								GeeHashMap* new_rows = NULL;
								GeeHashMap* _tmp33_ = NULL;
								ContactsContactEditorField* _tmp52_ = NULL;
								GeeHashMap* _tmp53_ = NULL;
								GeeHashMap* _tmp54_ = NULL;
								_tmp33_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, CONTACTS_CONTACT_EDITOR_TYPE_ROW_DATA, (GBoxedCopyFunc) contacts_contact_editor_row_data_dup, contacts_contact_editor_row_data_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
								new_rows = _tmp33_;
								{
									GeeIterator* _old_row_it = NULL;
									ContactsContactEditorField* _tmp34_ = NULL;
									GeeHashMap* _tmp35_ = NULL;
									GeeSet* _tmp36_ = NULL;
									GeeSet* _tmp37_ = NULL;
									GeeSet* _tmp38_ = NULL;
									GeeIterator* _tmp39_ = NULL;
									GeeIterator* _tmp40_ = NULL;
									_tmp34_ = field;
									_tmp35_ = (*_tmp34_).rows;
									_tmp36_ = gee_abstract_map_get_keys ((GeeMap*) _tmp35_);
									_tmp37_ = _tmp36_;
									_tmp38_ = _tmp37_;
									_tmp39_ = gee_iterable_iterator ((GeeIterable*) _tmp38_);
									_tmp40_ = _tmp39_;
									_g_object_unref0 (_tmp38_);
									_old_row_it = _tmp40_;
									while (TRUE) {
										GeeIterator* _tmp41_ = NULL;
										gboolean _tmp42_ = FALSE;
										gint old_row = 0;
										GeeIterator* _tmp43_ = NULL;
										gpointer _tmp44_ = NULL;
										GeeHashMap* _tmp45_ = NULL;
										gint _tmp46_ = 0;
										ContactsContactEditorField* _tmp47_ = NULL;
										GeeHashMap* _tmp48_ = NULL;
										gint _tmp49_ = 0;
										gpointer _tmp50_ = NULL;
										ContactsContactEditorRowData* _tmp51_ = NULL;
										_tmp41_ = _old_row_it;
										_tmp42_ = gee_iterator_next (_tmp41_);
										if (!_tmp42_) {
											break;
										}
										_tmp43_ = _old_row_it;
										_tmp44_ = gee_iterator_get (_tmp43_);
										old_row = (gint) ((gintptr) _tmp44_);
										_tmp45_ = new_rows;
										_tmp46_ = old_row;
										_tmp47_ = field;
										_tmp48_ = (*_tmp47_).rows;
										_tmp49_ = old_row;
										_tmp50_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp48_, (gpointer) ((gintptr) _tmp49_));
										_tmp51_ = (ContactsContactEditorRowData*) _tmp50_;
										gee_abstract_map_set ((GeeAbstractMap*) _tmp45_, (gpointer) ((gintptr) (_tmp46_ + 1)), _tmp51_);
										_contacts_contact_editor_row_data_free0 (_tmp51_);
									}
									_g_object_unref0 (_old_row_it);
								}
								_tmp52_ = field;
								_tmp53_ = new_rows;
								_tmp54_ = _g_object_ref0 (_tmp53_);
								_g_object_unref0 ((*_tmp52_).rows);
								(*_tmp52_).rows = _tmp54_;
								_g_object_unref0 (new_rows);
								break;
							}
						}
						_g_object_unref0 (_row_it);
					}
					_contacts_contact_editor_field_free0 (field);
				}
				_g_object_unref0 (_field_it);
			}
			_g_object_unref0 (field_maps);
		}
		_g_object_unref0 (_field_maps_it);
	}
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp55_ = NULL;
		GeeSet* _tmp56_ = NULL;
		GeeSet* _tmp57_ = NULL;
		GeeSet* _tmp58_ = NULL;
		GeeIterator* _tmp59_ = NULL;
		GeeIterator* _tmp60_ = NULL;
		_tmp55_ = self->priv->writable_personas;
		_tmp56_ = gee_abstract_map_get_entries ((GeeMap*) _tmp55_);
		_tmp57_ = _tmp56_;
		_tmp58_ = _tmp57_;
		_tmp59_ = gee_iterable_iterator ((GeeIterable*) _tmp58_);
		_tmp60_ = _tmp59_;
		_g_object_unref0 (_tmp58_);
		_entry_it = _tmp60_;
		while (TRUE) {
			GeeIterator* _tmp61_ = NULL;
			gboolean _tmp62_ = FALSE;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp63_ = NULL;
			gpointer _tmp64_ = NULL;
			_tmp61_ = _entry_it;
			_tmp62_ = gee_iterator_next (_tmp61_);
			if (!_tmp62_) {
				break;
			}
			_tmp63_ = _entry_it;
			_tmp64_ = gee_iterator_get (_tmp63_);
			entry = (GeeMapEntry*) _tmp64_;
			{
				GeeIterator* _field_entry_it = NULL;
				GeeMapEntry* _tmp65_ = NULL;
				gconstpointer _tmp66_ = NULL;
				GeeHashMap* _tmp67_ = NULL;
				GeeSet* _tmp68_ = NULL;
				GeeSet* _tmp69_ = NULL;
				GeeSet* _tmp70_ = NULL;
				GeeIterator* _tmp71_ = NULL;
				GeeIterator* _tmp72_ = NULL;
				_tmp65_ = entry;
				_tmp66_ = gee_map_entry_get_value (_tmp65_);
				_tmp67_ = _tmp66_;
				_tmp68_ = gee_abstract_map_get_entries ((GeeMap*) ((GeeHashMap*) _tmp67_));
				_tmp69_ = _tmp68_;
				_tmp70_ = _tmp69_;
				_tmp71_ = gee_iterable_iterator ((GeeIterable*) _tmp70_);
				_tmp72_ = _tmp71_;
				_g_object_unref0 (_tmp70_);
				_field_entry_it = _tmp72_;
				while (TRUE) {
					GeeIterator* _tmp73_ = NULL;
					gboolean _tmp74_ = FALSE;
					GeeMapEntry* field_entry = NULL;
					GeeIterator* _tmp75_ = NULL;
					gpointer _tmp76_ = NULL;
					_tmp73_ = _field_entry_it;
					_tmp74_ = gee_iterator_next (_tmp73_);
					if (!_tmp74_) {
						break;
					}
					_tmp75_ = _field_entry_it;
					_tmp76_ = gee_iterator_get (_tmp75_);
					field_entry = (GeeMapEntry*) _tmp76_;
					{
						GeeIterator* _row_it = NULL;
						GeeMapEntry* _tmp77_ = NULL;
						gconstpointer _tmp78_ = NULL;
						ContactsContactEditorField* _tmp79_ = NULL;
						GeeHashMap* _tmp80_ = NULL;
						GeeSet* _tmp81_ = NULL;
						GeeSet* _tmp82_ = NULL;
						GeeSet* _tmp83_ = NULL;
						GeeIterator* _tmp84_ = NULL;
						GeeIterator* _tmp85_ = NULL;
						_tmp77_ = field_entry;
						_tmp78_ = gee_map_entry_get_value (_tmp77_);
						_tmp79_ = _tmp78_;
						_tmp80_ = (*((ContactsContactEditorField*) _tmp79_)).rows;
						_tmp81_ = gee_abstract_map_get_keys ((GeeMap*) _tmp80_);
						_tmp82_ = _tmp81_;
						_tmp83_ = _tmp82_;
						_tmp84_ = gee_iterable_iterator ((GeeIterable*) _tmp83_);
						_tmp85_ = _tmp84_;
						_g_object_unref0 (_tmp83_);
						_row_it = _tmp85_;
						while (TRUE) {
							GeeIterator* _tmp86_ = NULL;
							gboolean _tmp87_ = FALSE;
							gint row = 0;
							GeeIterator* _tmp88_ = NULL;
							gpointer _tmp89_ = NULL;
							gint _tmp90_ = 0;
							gint _tmp91_ = 0;
							_tmp86_ = _row_it;
							_tmp87_ = gee_iterator_next (_tmp86_);
							if (!_tmp87_) {
								break;
							}
							_tmp88_ = _row_it;
							_tmp89_ = gee_iterator_get (_tmp88_);
							row = (gint) ((gintptr) _tmp89_);
							_tmp90_ = row;
							_tmp91_ = idx;
							if (_tmp90_ >= _tmp91_) {
								GeeHashMap* new_rows = NULL;
								GeeHashMap* _tmp92_ = NULL;
								GeeMapEntry* _tmp115_ = NULL;
								gconstpointer _tmp116_ = NULL;
								ContactsContactEditorField* _tmp117_ = NULL;
								GeeHashMap* _tmp118_ = NULL;
								GeeHashMap* _tmp119_ = NULL;
								_tmp92_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, CONTACTS_CONTACT_EDITOR_TYPE_ROW_DATA, (GBoxedCopyFunc) contacts_contact_editor_row_data_dup, contacts_contact_editor_row_data_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
								new_rows = _tmp92_;
								{
									GeeIterator* _old_row_it = NULL;
									GeeMapEntry* _tmp93_ = NULL;
									gconstpointer _tmp94_ = NULL;
									ContactsContactEditorField* _tmp95_ = NULL;
									GeeHashMap* _tmp96_ = NULL;
									GeeSet* _tmp97_ = NULL;
									GeeSet* _tmp98_ = NULL;
									GeeSet* _tmp99_ = NULL;
									GeeIterator* _tmp100_ = NULL;
									GeeIterator* _tmp101_ = NULL;
									_tmp93_ = field_entry;
									_tmp94_ = gee_map_entry_get_value (_tmp93_);
									_tmp95_ = _tmp94_;
									_tmp96_ = (*((ContactsContactEditorField*) _tmp95_)).rows;
									_tmp97_ = gee_abstract_map_get_keys ((GeeMap*) _tmp96_);
									_tmp98_ = _tmp97_;
									_tmp99_ = _tmp98_;
									_tmp100_ = gee_iterable_iterator ((GeeIterable*) _tmp99_);
									_tmp101_ = _tmp100_;
									_g_object_unref0 (_tmp99_);
									_old_row_it = _tmp101_;
									while (TRUE) {
										GeeIterator* _tmp102_ = NULL;
										gboolean _tmp103_ = FALSE;
										gint old_row = 0;
										GeeIterator* _tmp104_ = NULL;
										gpointer _tmp105_ = NULL;
										GeeHashMap* _tmp106_ = NULL;
										gint _tmp107_ = 0;
										GeeMapEntry* _tmp108_ = NULL;
										gconstpointer _tmp109_ = NULL;
										ContactsContactEditorField* _tmp110_ = NULL;
										GeeHashMap* _tmp111_ = NULL;
										gint _tmp112_ = 0;
										gpointer _tmp113_ = NULL;
										ContactsContactEditorRowData* _tmp114_ = NULL;
										_tmp102_ = _old_row_it;
										_tmp103_ = gee_iterator_next (_tmp102_);
										if (!_tmp103_) {
											break;
										}
										_tmp104_ = _old_row_it;
										_tmp105_ = gee_iterator_get (_tmp104_);
										old_row = (gint) ((gintptr) _tmp105_);
										_tmp106_ = new_rows;
										_tmp107_ = old_row;
										_tmp108_ = field_entry;
										_tmp109_ = gee_map_entry_get_value (_tmp108_);
										_tmp110_ = _tmp109_;
										_tmp111_ = (*((ContactsContactEditorField*) _tmp110_)).rows;
										_tmp112_ = old_row;
										_tmp113_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp111_, (gpointer) ((gintptr) _tmp112_));
										_tmp114_ = (ContactsContactEditorRowData*) _tmp113_;
										gee_abstract_map_set ((GeeAbstractMap*) _tmp106_, (gpointer) ((gintptr) (_tmp107_ + 1)), _tmp114_);
										_contacts_contact_editor_row_data_free0 (_tmp114_);
									}
									_g_object_unref0 (_old_row_it);
								}
								_tmp115_ = field_entry;
								_tmp116_ = gee_map_entry_get_value (_tmp115_);
								_tmp117_ = _tmp116_;
								_tmp118_ = new_rows;
								_tmp119_ = _g_object_ref0 (_tmp118_);
								_g_object_unref0 ((*((ContactsContactEditorField*) _tmp117_)).rows);
								(*((ContactsContactEditorField*) _tmp117_)).rows = _tmp119_;
								_g_object_unref0 (new_rows);
								break;
							}
						}
						_g_object_unref0 (_row_it);
					}
					_g_object_unref0 (field_entry);
				}
				_g_object_unref0 (_field_entry_it);
			}
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	_tmp120_ = self->priv->container_grid;
	_tmp121_ = idx;
	gtk_grid_insert_row (_tmp120_, _tmp121_);
}


static void contacts_contact_editor_size_allocate_cb (ContactsContactEditor* self, GtkAllocation* alloc) {
	gboolean _tmp0_ = FALSE;
	GtkWidget* _tmp1_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (alloc != NULL);
	_tmp1_ = self->priv->focus_widget;
	if (_tmp1_ != NULL) {
		GtkWidget* _tmp2_ = NULL;
		_tmp2_ = self->priv->focus_widget;
		_tmp0_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, gtk_widget_get_type ());
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GtkWidget* _tmp3_ = NULL;
		_tmp3_ = self->priv->focus_widget;
		gtk_widget_grab_focus (_tmp3_);
		self->priv->focus_widget = NULL;
	}
}


static void _contacts_contact_editor_size_allocate_cb_gtk_widget_size_allocate (GtkWidget* _sender, GtkAllocation* allocation, gpointer self) {
	contacts_contact_editor_size_allocate_cb ((ContactsContactEditor*) self, allocation);
}


ContactsContactEditor* contacts_contact_editor_construct (GType object_type, GSimpleActionGroup* editor_actions) {
	ContactsContactEditor * self = NULL;
	GtkScrolledWindow* main_sw = NULL;
	GtkScrolledWindow* _tmp0_ = NULL;
	Center* hcenter = NULL;
	Center* _tmp1_ = NULL;
	GtkGrid* _tmp2_ = NULL;
	GtkGrid* _tmp3_ = NULL;
	GtkGrid* _tmp4_ = NULL;
	GtkGrid* _tmp5_ = NULL;
	GtkGrid* _tmp6_ = NULL;
	GtkGrid* _tmp7_ = NULL;
	GtkGrid* _tmp8_ = NULL;
	GtkGrid* _tmp9_ = NULL;
	GtkGrid* _tmp10_ = NULL;
	GtkAdjustment* _tmp11_ = NULL;
	GtkWidget* _tmp12_ = NULL;
	GtkStyleContext* _tmp13_ = NULL;
	GtkWidget* _tmp14_ = NULL;
	GtkStyleContext* _tmp15_ = NULL;
	GtkActionBar* edit_toolbar = NULL;
	GtkActionBar* _tmp16_ = NULL;
	GtkBuilder* builder = NULL;
	GtkBuilder* _tmp17_ = NULL;
	GMenuModel* gmenu = NULL;
	GObject* _tmp18_ = NULL;
	GMenuModel* _tmp19_ = NULL;
	GtkMenuButton* add_detail_button = NULL;
	GtkMenuButton* _tmp20_ = NULL;
	GtkPopover* _tmp21_ = NULL;
	GSimpleActionGroup* _tmp22_ = NULL;
	GtkBox* box = NULL;
	GtkBox* _tmp23_ = NULL;
	const gchar* _tmp24_ = NULL;
	GtkLabel* _tmp25_ = NULL;
	GtkLabel* _tmp26_ = NULL;
	GtkImage* _tmp27_ = NULL;
	GtkImage* _tmp28_ = NULL;
	const gchar* _tmp29_ = NULL;
	GtkButton* _tmp30_ = NULL;
	GtkButton* _tmp31_ = NULL;
	const gchar* _tmp32_ = NULL;
	GtkButton* _tmp33_ = NULL;
	GtkButton* _tmp34_ = NULL;
	GtkGrid* _tmp35_ = NULL;
	GeeHashMap* _tmp36_ = NULL;
	GtkGrid* _tmp37_ = NULL;
	g_return_val_if_fail (editor_actions != NULL, NULL);
	self = (ContactsContactEditor*) g_object_new (object_type, NULL);
	gtk_orientable_set_orientation ((GtkOrientable*) self, GTK_ORIENTATION_VERTICAL);
	_tmp0_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_ref_sink (_tmp0_);
	main_sw = _tmp0_;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) main_sw);
	gtk_scrolled_window_set_shadow_type (main_sw, GTK_SHADOW_NONE);
	gtk_widget_set_hexpand ((GtkWidget*) main_sw, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) main_sw, TRUE);
	gtk_scrolled_window_set_policy (main_sw, GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
	_tmp1_ = center_new ();
	g_object_ref_sink (_tmp1_);
	hcenter = _tmp1_;
	center_set_max_width (hcenter, 600);
	center_set_xalign (hcenter, 0.0);
	_tmp2_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->container_grid);
	self->priv->container_grid = _tmp2_;
	_tmp3_ = self->priv->container_grid;
	gtk_grid_set_row_spacing (_tmp3_, (guint) 12);
	_tmp4_ = self->priv->container_grid;
	gtk_grid_set_column_spacing (_tmp4_, (guint) 12);
	_tmp5_ = self->priv->container_grid;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp5_, TRUE);
	_tmp6_ = self->priv->container_grid;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp6_, TRUE);
	_tmp7_ = self->priv->container_grid;
	g_object_set ((GtkWidget*) _tmp7_, "margin", 36, NULL);
	_tmp8_ = self->priv->container_grid;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp8_, 24);
	_tmp9_ = self->priv->container_grid;
	gtk_container_add ((GtkContainer*) hcenter, (GtkWidget*) _tmp9_);
	gtk_container_add ((GtkContainer*) main_sw, (GtkWidget*) hcenter);
	_tmp10_ = self->priv->container_grid;
	_tmp11_ = gtk_scrolled_window_get_vadjustment (main_sw);
	gtk_container_set_focus_vadjustment ((GtkContainer*) _tmp10_, _tmp11_);
	_tmp12_ = gtk_bin_get_child ((GtkBin*) main_sw);
	_tmp13_ = gtk_widget_get_style_context (_tmp12_);
	gtk_style_context_add_class (_tmp13_, "contacts-main-view");
	_tmp14_ = gtk_bin_get_child ((GtkBin*) main_sw);
	_tmp15_ = gtk_widget_get_style_context (_tmp14_);
	gtk_style_context_add_class (_tmp15_, "view");
	_tmp16_ = (GtkActionBar*) gtk_action_bar_new ();
	g_object_ref_sink (_tmp16_);
	edit_toolbar = _tmp16_;
	_tmp17_ = contacts_load_ui ("app-menu.ui");
	builder = _tmp17_;
	_tmp18_ = gtk_builder_get_object (builder, "edit-contact");
	_tmp19_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp18_, g_menu_model_get_type ()) ? ((GMenuModel*) _tmp18_) : NULL);
	gmenu = _tmp19_;
	_tmp20_ = (GtkMenuButton*) gtk_menu_button_new ();
	g_object_ref_sink (_tmp20_);
	add_detail_button = _tmp20_;
	gtk_menu_button_set_use_popover (add_detail_button, TRUE);
	gtk_menu_button_set_menu_model (add_detail_button, gmenu);
	gtk_menu_button_set_direction (add_detail_button, GTK_ARROW_UP);
	_tmp21_ = gtk_menu_button_get_popover (add_detail_button);
	_tmp22_ = editor_actions;
	gtk_widget_insert_action_group ((GtkWidget*) _tmp21_, "edit", (GActionGroup*) _tmp22_);
	_tmp23_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	g_object_ref_sink (_tmp23_);
	box = _tmp23_;
	_tmp24_ = _ ("New Detail");
	_tmp25_ = (GtkLabel*) gtk_label_new (_tmp24_);
	g_object_ref_sink (_tmp25_);
	_tmp26_ = _tmp25_;
	gtk_container_add ((GtkContainer*) box, (GtkWidget*) _tmp26_);
	_g_object_unref0 (_tmp26_);
	_tmp27_ = (GtkImage*) gtk_image_new_from_icon_name ("go-down-symbolic", GTK_ICON_SIZE_BUTTON);
	g_object_ref_sink (_tmp27_);
	_tmp28_ = _tmp27_;
	gtk_container_add ((GtkContainer*) box, (GtkWidget*) _tmp28_);
	_g_object_unref0 (_tmp28_);
	gtk_container_add ((GtkContainer*) add_detail_button, (GtkWidget*) box);
	gtk_action_bar_pack_start (edit_toolbar, (GtkWidget*) add_detail_button);
	_tmp29_ = _ ("Linked Accounts");
	_tmp30_ = (GtkButton*) gtk_button_new_with_label (_tmp29_);
	g_object_ref_sink (_tmp30_);
	_g_object_unref0 (self->linked_button);
	self->linked_button = _tmp30_;
	_tmp31_ = self->linked_button;
	gtk_action_bar_pack_start (edit_toolbar, (GtkWidget*) _tmp31_);
	_tmp32_ = _ ("Remove Contact");
	_tmp33_ = (GtkButton*) gtk_button_new_with_label (_tmp32_);
	g_object_ref_sink (_tmp33_);
	_g_object_unref0 (self->remove_button);
	self->remove_button = _tmp33_;
	_tmp34_ = self->remove_button;
	gtk_action_bar_pack_end (edit_toolbar, (GtkWidget*) _tmp34_);
	gtk_widget_show_all ((GtkWidget*) edit_toolbar);
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) edit_toolbar);
	_tmp35_ = self->priv->container_grid;
	gtk_widget_show_all ((GtkWidget*) _tmp35_);
	gtk_widget_show ((GtkWidget*) main_sw);
	gtk_widget_show_all ((GtkWidget*) self);
	_tmp36_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, GEE_TYPE_HASH_MAP, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->writable_personas);
	self->priv->writable_personas = _tmp36_;
	_tmp37_ = self->priv->container_grid;
	g_signal_connect_object ((GtkWidget*) _tmp37_, "size-allocate", (GCallback) _contacts_contact_editor_size_allocate_cb_gtk_widget_size_allocate, self, G_CONNECT_AFTER);
	_g_object_unref0 (box);
	_g_object_unref0 (add_detail_button);
	_g_object_unref0 (gmenu);
	_g_object_unref0 (builder);
	_g_object_unref0 (edit_toolbar);
	_g_object_unref0 (hcenter);
	_g_object_unref0 (main_sw);
	return self;
}


ContactsContactEditor* contacts_contact_editor_new (GSimpleActionGroup* editor_actions) {
	return contacts_contact_editor_construct (CONTACTS_TYPE_CONTACT_EDITOR, editor_actions);
}


static Block26Data* block26_data_ref (Block26Data* _data26_) {
	g_atomic_int_inc (&_data26_->_ref_count_);
	return _data26_;
}


static void block26_data_unref (void * _userdata_) {
	Block26Data* _data26_;
	_data26_ = (Block26Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data26_->_ref_count_)) {
		ContactsContactEditor* self;
		self = _data26_->self;
		_g_object_unref0 (_data26_->name_entry);
		_g_object_unref0 (_data26_->image_frame);
		_g_object_unref0 (_data26_->c);
		_g_object_unref0 (self);
		g_slice_free (Block26Data, _data26_);
	}
}


static void __lambda64_ (Block26Data* _data26_, GIcon* icon) {
	ContactsContactEditor* self;
	ContactsContactFrame* _tmp0_ = NULL;
	GIcon* _tmp1_ = NULL;
	GIcon* _tmp2_ = NULL;
	ContactsContactFrame* _tmp3_ = NULL;
	GdkPixbuf* a_pixbuf = NULL;
	ContactsContactFrame* _tmp10_ = NULL;
	GdkPixbuf* _tmp11_ = NULL;
	GError * _inner_error_ = NULL;
	self = _data26_->self;
	g_return_if_fail (icon != NULL);
	_tmp0_ = _data26_->image_frame;
	_tmp1_ = icon;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	g_object_set_data_full ((GObject*) _tmp0_, "value", _tmp2_, g_object_unref);
	_tmp3_ = _data26_->image_frame;
	g_object_set_data_full ((GObject*) _tmp3_, "changed", (gpointer) ((gintptr) TRUE), NULL);
	a_pixbuf = NULL;
	{
		GInputStream* stream = NULL;
		GIcon* _tmp4_ = NULL;
		GInputStream* _tmp5_ = NULL;
		GdkPixbuf* _tmp6_ = NULL;
		GInputStream* _tmp7_ = NULL;
		GdkPixbuf* _tmp8_ = NULL;
		GdkPixbuf* _tmp9_ = NULL;
		_tmp4_ = icon;
		_tmp5_ = g_loadable_icon_load (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, g_loadable_icon_get_type ()) ? ((GLoadableIcon*) _tmp4_) : NULL, PROFILE_SIZE, NULL, NULL, &_inner_error_);
		stream = _tmp5_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			goto __catch6_g_error;
		}
		_tmp7_ = stream;
		_tmp8_ = gdk_pixbuf_new_from_stream_at_scale (_tmp7_, PROFILE_SIZE, PROFILE_SIZE, TRUE, NULL, &_inner_error_);
		_tmp6_ = _tmp8_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			_g_object_unref0 (stream);
			goto __catch6_g_error;
		}
		_tmp9_ = _tmp6_;
		_tmp6_ = NULL;
		_g_object_unref0 (a_pixbuf);
		a_pixbuf = _tmp9_;
		_g_object_unref0 (_tmp6_);
		_g_object_unref0 (stream);
	}
	goto __finally6;
	__catch6_g_error:
	{
		g_clear_error (&_inner_error_);
		_inner_error_ = NULL;
	}
	__finally6:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		_g_object_unref0 (a_pixbuf);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
	_tmp10_ = _data26_->image_frame;
	_tmp11_ = a_pixbuf;
	contacts_contact_frame_set_pixbuf (_tmp10_, _tmp11_);
	_g_object_unref0 (a_pixbuf);
}


static void ___lambda64__contacts_avatar_dialog_set_avatar (ContactsAvatarDialog* _sender, GIcon* avatar_icon, gpointer self) {
	__lambda64_ (self, avatar_icon);
}


static void __lambda57_ (Block26Data* _data26_) {
	ContactsContactEditor* self;
	ContactsAvatarDialog* dialog = NULL;
	ContactsContact* _tmp0_ = NULL;
	ContactsAvatarDialog* _tmp1_ = NULL;
	self = _data26_->self;
	_tmp0_ = self->priv->contact;
	_tmp1_ = contacts_avatar_dialog_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	dialog = _tmp1_;
	g_signal_connect_data (dialog, "set-avatar", (GCallback) ___lambda64__contacts_avatar_dialog_set_avatar, block26_data_ref (_data26_), (GClosureNotify) block26_data_unref, 0);
	gtk_widget_show ((GtkWidget*) dialog);
	_g_object_unref0 (dialog);
}


static void ___lambda57__contacts_contact_frame_clicked (ContactsContactFrame* _sender, gpointer self) {
	__lambda57_ (self);
}


static void __lambda65_ (Block26Data* _data26_, GtkWidget* w) {
	ContactsContactEditor* self;
	GtkWidget* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	FolksIndividual* _tmp2_ = NULL;
	ContactsContact* _tmp3_ = NULL;
	self = _data26_->self;
	g_return_if_fail (w != NULL);
	_tmp0_ = w;
	_tmp1_ = _data26_->c;
	_tmp2_ = _tmp1_->individual;
	_tmp3_ = _data26_->c;
	contacts_contact_frame_set_image (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, CONTACTS_TYPE_CONTACT_FRAME) ? ((ContactsContactFrame*) _tmp0_) : NULL, (FolksAvatarDetails*) _tmp2_, _tmp3_);
}


static void ___lambda65__gtk_callback (GtkWidget* widget, gpointer self) {
	__lambda65_ (self, widget);
}


static void __lambda66_ (Block26Data* _data26_) {
	ContactsContactEditor* self;
	GtkEntry* _tmp0_ = NULL;
	self = _data26_->self;
	_tmp0_ = _data26_->name_entry;
	g_object_set_data_full ((GObject*) _tmp0_, "changed", (gpointer) ((gintptr) TRUE), NULL);
}


static void ___lambda66__gtk_editable_changed (GtkEditable* _sender, gpointer self) {
	__lambda66_ (self);
}


void contacts_contact_editor_edit (ContactsContactEditor* self, ContactsContact* c) {
	Block26Data* _data26_;
	ContactsContact* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	ContactsContact* _tmp2_ = NULL;
	ContactsContact* _tmp3_ = NULL;
	GtkButton* _tmp4_ = NULL;
	GtkButton* _tmp5_ = NULL;
	ContactsContact* _tmp6_ = NULL;
	gboolean _tmp7_ = FALSE;
	GtkButton* _tmp8_ = NULL;
	GtkButton* _tmp9_ = NULL;
	ContactsContact* _tmp10_ = NULL;
	FolksIndividual* _tmp11_ = NULL;
	GeeSet* _tmp12_ = NULL;
	GeeSet* _tmp13_ = NULL;
	gint _tmp14_ = 0;
	gint _tmp15_ = 0;
	ContactsContactFrame* _tmp16_ = NULL;
	ContactsContactFrame* _tmp17_ = NULL;
	ContactsContactFrame* _tmp18_ = NULL;
	ContactsContactFrame* _tmp19_ = NULL;
	GtkWidget* _tmp20_ = NULL;
	ContactsContactFrame* _tmp21_ = NULL;
	ContactsContact* _tmp22_ = NULL;
	ContactsContactFrame* _tmp23_ = NULL;
	GtkGrid* _tmp24_ = NULL;
	ContactsContactFrame* _tmp25_ = NULL;
	GtkEntry* _tmp26_ = NULL;
	GtkEntry* _tmp27_ = NULL;
	GtkEntry* _tmp28_ = NULL;
	GtkEntry* _tmp29_ = NULL;
	ContactsContact* _tmp30_ = NULL;
	const gchar* _tmp31_ = NULL;
	const gchar* _tmp32_ = NULL;
	GtkEntry* _tmp33_ = NULL;
	GtkEntry* _tmp34_ = NULL;
	const gchar* _tmp35_ = NULL;
	GtkGrid* _tmp36_ = NULL;
	GtkEntry* _tmp37_ = NULL;
	GtkEntry* _tmp38_ = NULL;
	gint i = 0;
	gint last_store_position = 0;
	gboolean is_first_persona = FALSE;
	GeeList* personas = NULL;
	ContactsContact* _tmp39_ = NULL;
	GeeList* _tmp40_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (c != NULL);
	_data26_ = g_slice_new0 (Block26Data);
	_data26_->_ref_count_ = 1;
	_data26_->self = g_object_ref (self);
	_tmp0_ = c;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data26_->c);
	_data26_->c = _tmp1_;
	_tmp2_ = _data26_->c;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_g_object_unref0 (self->priv->contact);
	self->priv->contact = _tmp3_;
	_tmp4_ = self->remove_button;
	gtk_widget_show ((GtkWidget*) _tmp4_);
	_tmp5_ = self->remove_button;
	_tmp6_ = self->priv->contact;
	_tmp7_ = contacts_contact_can_remove_personas (_tmp6_);
	gtk_widget_set_sensitive ((GtkWidget*) _tmp5_, _tmp7_);
	_tmp8_ = self->linked_button;
	gtk_widget_show ((GtkWidget*) _tmp8_);
	_tmp9_ = self->linked_button;
	_tmp10_ = self->priv->contact;
	_tmp11_ = _tmp10_->individual;
	_tmp12_ = folks_individual_get_personas (_tmp11_);
	_tmp13_ = _tmp12_;
	_tmp14_ = gee_collection_get_size ((GeeCollection*) _tmp13_);
	_tmp15_ = _tmp14_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp9_, _tmp15_ > 1);
	_tmp16_ = contacts_contact_frame_new (PROFILE_SIZE, TRUE);
	g_object_ref_sink (_tmp16_);
	_data26_->image_frame = _tmp16_;
	_tmp17_ = _data26_->image_frame;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp17_, FALSE);
	_tmp18_ = _data26_->image_frame;
	gtk_widget_set_valign ((GtkWidget*) _tmp18_, GTK_ALIGN_START);
	_tmp19_ = _data26_->image_frame;
	_tmp20_ = gtk_bin_get_child ((GtkBin*) _tmp19_);
	gtk_button_set_relief (G_TYPE_CHECK_INSTANCE_TYPE (_tmp20_, gtk_button_get_type ()) ? ((GtkButton*) _tmp20_) : NULL, GTK_RELIEF_NORMAL);
	_tmp21_ = _data26_->image_frame;
	g_signal_connect_data (_tmp21_, "clicked", (GCallback) ___lambda57__contacts_contact_frame_clicked, block26_data_ref (_data26_), (GClosureNotify) block26_data_unref, 0);
	_tmp22_ = _data26_->c;
	_tmp23_ = _data26_->image_frame;
	contacts_contact_keep_widget_uptodate (_tmp22_, (GtkWidget*) _tmp23_, ___lambda65__gtk_callback, block26_data_ref (_data26_), block26_data_unref);
	_tmp24_ = self->priv->container_grid;
	_tmp25_ = _data26_->image_frame;
	gtk_grid_attach (_tmp24_, (GtkWidget*) _tmp25_, 0, 0, 1, 3);
	_tmp26_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp26_);
	_data26_->name_entry = _tmp26_;
	_tmp27_ = _data26_->name_entry;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp27_, TRUE);
	_tmp28_ = _data26_->name_entry;
	gtk_widget_set_valign ((GtkWidget*) _tmp28_, GTK_ALIGN_CENTER);
	_tmp29_ = _data26_->name_entry;
	_tmp30_ = _data26_->c;
	_tmp31_ = contacts_contact_get_display_name (_tmp30_);
	_tmp32_ = _tmp31_;
	gtk_entry_set_text (_tmp29_, _tmp32_);
	_tmp33_ = _data26_->name_entry;
	g_object_set_data_full ((GObject*) _tmp33_, "changed", (gpointer) ((gintptr) FALSE), NULL);
	_tmp34_ = _data26_->name_entry;
	_tmp35_ = _ ("Add name");
	gtk_entry_set_placeholder_text (_tmp34_, _tmp35_);
	_tmp36_ = self->priv->container_grid;
	_tmp37_ = _data26_->name_entry;
	gtk_grid_attach (_tmp36_, (GtkWidget*) _tmp37_, 1, 0, 3, 3);
	_tmp38_ = _data26_->name_entry;
	g_signal_connect_data ((GtkEditable*) _tmp38_, "changed", (GCallback) ___lambda66__gtk_editable_changed, block26_data_ref (_data26_), (GClosureNotify) block26_data_unref, 0);
	i = 3;
	last_store_position = 0;
	is_first_persona = TRUE;
	_tmp39_ = _data26_->c;
	_tmp40_ = contacts_contact_get_personas_for_display (_tmp39_);
	personas = _tmp40_;
	{
		GeeList* _p_list = NULL;
		GeeList* _tmp41_ = NULL;
		GeeList* _tmp42_ = NULL;
		gint _p_size = 0;
		GeeList* _tmp43_ = NULL;
		gint _tmp44_ = 0;
		gint _tmp45_ = 0;
		gint _p_index = 0;
		_tmp41_ = personas;
		_tmp42_ = _g_object_ref0 (_tmp41_);
		_p_list = _tmp42_;
		_tmp43_ = _p_list;
		_tmp44_ = gee_collection_get_size ((GeeCollection*) _tmp43_);
		_tmp45_ = _tmp44_;
		_p_size = _tmp45_;
		_p_index = -1;
		while (TRUE) {
			gint _tmp46_ = 0;
			gint _tmp47_ = 0;
			gint _tmp48_ = 0;
			FolksPersona* p = NULL;
			GeeList* _tmp49_ = NULL;
			gint _tmp50_ = 0;
			gpointer _tmp51_ = NULL;
			gboolean _tmp52_ = FALSE;
			gchar** rw_props = NULL;
			FolksPersona* _tmp68_ = NULL;
			gchar** _tmp69_ = NULL;
			gint _tmp69__length1 = 0;
			gchar** _tmp70_ = NULL;
			gint _tmp70__length1 = 0;
			gint _tmp71_ = 0;
			gchar** _tmp72_ = NULL;
			gint rw_props_length1 = 0;
			gint _rw_props_size_ = 0;
			gchar** _tmp73_ = NULL;
			gint _tmp73__length1 = 0;
			gboolean _tmp84_ = FALSE;
			gint _tmp86_ = 0;
			gint _tmp87_ = 0;
			gint _tmp88_ = 0;
			_tmp46_ = _p_index;
			_p_index = _tmp46_ + 1;
			_tmp47_ = _p_index;
			_tmp48_ = _p_size;
			if (!(_tmp47_ < _tmp48_)) {
				break;
			}
			_tmp49_ = _p_list;
			_tmp50_ = _p_index;
			_tmp51_ = gee_list_get (_tmp49_, _tmp50_);
			p = (FolksPersona*) _tmp51_;
			_tmp52_ = is_first_persona;
			if (!_tmp52_) {
				GtkLabel* store_name = NULL;
				GtkLabel* _tmp53_ = NULL;
				GtkLabel* _tmp54_ = NULL;
				FolksPersona* _tmp55_ = NULL;
				gchar* _tmp56_ = NULL;
				gchar* _tmp57_ = NULL;
				gchar* _tmp58_ = NULL;
				gchar* _tmp59_ = NULL;
				GtkLabel* _tmp60_ = NULL;
				GtkLabel* _tmp61_ = NULL;
				GtkLabel* _tmp62_ = NULL;
				GtkGrid* _tmp63_ = NULL;
				GtkLabel* _tmp64_ = NULL;
				gint _tmp65_ = 0;
				gint _tmp66_ = 0;
				gint _tmp67_ = 0;
				_tmp53_ = (GtkLabel*) gtk_label_new ("");
				g_object_ref_sink (_tmp53_);
				store_name = _tmp53_;
				_tmp54_ = store_name;
				_tmp55_ = p;
				_tmp56_ = contacts_contact_format_persona_store_name_for_contact (_tmp55_);
				_tmp57_ = _tmp56_;
				_tmp58_ = g_markup_printf_escaped ("<span font='16px bold'>%s</span>", _tmp57_);
				_tmp59_ = _tmp58_;
				gtk_label_set_markup (_tmp54_, _tmp59_);
				_g_free0 (_tmp59_);
				_g_free0 (_tmp57_);
				_tmp60_ = store_name;
				gtk_widget_set_halign ((GtkWidget*) _tmp60_, GTK_ALIGN_START);
				_tmp61_ = store_name;
				gtk_label_set_xalign (_tmp61_, 0.0f);
				_tmp62_ = store_name;
				gtk_widget_set_margin_start ((GtkWidget*) _tmp62_, 6);
				_tmp63_ = self->priv->container_grid;
				_tmp64_ = store_name;
				_tmp65_ = i;
				gtk_grid_attach (_tmp63_, (GtkWidget*) _tmp64_, 0, _tmp65_, 2, 1);
				_tmp66_ = i;
				i = _tmp66_ + 1;
				_tmp67_ = i;
				last_store_position = _tmp67_;
				_g_object_unref0 (store_name);
			}
			_tmp68_ = p;
			_tmp69_ = folks_persona_get_writeable_properties (_tmp68_, &_tmp69__length1);
			_tmp70_ = _tmp69_;
			_tmp70__length1 = _tmp69__length1;
			_tmp72_ = contacts_contact_sort_persona_properties (_tmp70_, _tmp70__length1, &_tmp71_);
			rw_props = _tmp72_;
			rw_props_length1 = _tmp71_;
			_rw_props_size_ = rw_props_length1;
			_tmp73_ = rw_props;
			_tmp73__length1 = rw_props_length1;
			if (_tmp73__length1 != 0) {
				GeeHashMap* _tmp74_ = NULL;
				FolksPersona* _tmp75_ = NULL;
				const gchar* _tmp76_ = NULL;
				const gchar* _tmp77_ = NULL;
				GeeHashMap* _tmp78_ = NULL;
				GeeHashMap* _tmp79_ = NULL;
				gchar** _tmp80_ = NULL;
				gint _tmp80__length1 = 0;
				_tmp74_ = self->priv->writable_personas;
				_tmp75_ = p;
				_tmp76_ = folks_persona_get_uid (_tmp75_);
				_tmp77_ = _tmp76_;
				_tmp78_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, CONTACTS_CONTACT_EDITOR_TYPE_FIELD, (GBoxedCopyFunc) contacts_contact_editor_field_dup, contacts_contact_editor_field_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
				_tmp79_ = _tmp78_;
				gee_abstract_map_set ((GeeAbstractMap*) _tmp74_, _tmp77_, _tmp79_);
				_g_object_unref0 (_tmp79_);
				_tmp80_ = rw_props;
				_tmp80__length1 = rw_props_length1;
				{
					gchar** prop_collection = NULL;
					gint prop_collection_length1 = 0;
					gint _prop_collection_size_ = 0;
					gint prop_it = 0;
					prop_collection = _tmp80_;
					prop_collection_length1 = _tmp80__length1;
					for (prop_it = 0; prop_it < _tmp80__length1; prop_it = prop_it + 1) {
						gchar* _tmp81_ = NULL;
						gchar* prop = NULL;
						_tmp81_ = g_strdup (prop_collection[prop_it]);
						prop = _tmp81_;
						{
							FolksPersona* _tmp82_ = NULL;
							const gchar* _tmp83_ = NULL;
							_tmp82_ = p;
							_tmp83_ = prop;
							contacts_contact_editor_add_edit_row (self, _tmp82_, _tmp83_, &i, FALSE, NULL);
							_g_free0 (prop);
						}
					}
				}
			}
			_tmp84_ = is_first_persona;
			if (_tmp84_) {
				gint _tmp85_ = 0;
				_tmp85_ = i;
				self->priv->last_row = _tmp85_ - 1;
			}
			_tmp86_ = i;
			if (_tmp86_ != 3) {
				is_first_persona = FALSE;
			}
			_tmp87_ = i;
			_tmp88_ = last_store_position;
			if (_tmp87_ == _tmp88_) {
				gint _tmp89_ = 0;
				GtkGrid* _tmp90_ = NULL;
				gint _tmp91_ = 0;
				GtkWidget* _tmp92_ = NULL;
				_tmp89_ = i;
				i = _tmp89_ - 1;
				_tmp90_ = self->priv->container_grid;
				_tmp91_ = i;
				_tmp92_ = gtk_grid_get_child_at (_tmp90_, 0, _tmp91_);
				gtk_widget_destroy (_tmp92_);
			}
			rw_props = (_vala_array_free (rw_props, rw_props_length1, (GDestroyNotify) g_free), NULL);
			_g_object_unref0 (p);
		}
		_g_object_unref0 (_p_list);
	}
	_g_object_unref0 (personas);
	block26_data_unref (_data26_);
	_data26_ = NULL;
}


void contacts_contact_editor_clear (ContactsContactEditor* self) {
	GtkGrid* _tmp0_ = NULL;
	GList* _tmp1_ = NULL;
	GtkButton* _tmp3_ = NULL;
	GtkButton* _tmp4_ = NULL;
	GeeHashMap* _tmp5_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->container_grid;
	_tmp1_ = gtk_container_get_children ((GtkContainer*) _tmp0_);
	{
		GList* w_collection = NULL;
		GList* w_it = NULL;
		w_collection = _tmp1_;
		for (w_it = w_collection; w_it != NULL; w_it = w_it->next) {
			GtkWidget* w = NULL;
			w = (GtkWidget*) w_it->data;
			{
				GtkWidget* _tmp2_ = NULL;
				_tmp2_ = w;
				gtk_widget_destroy (_tmp2_);
			}
		}
		_g_list_free0 (w_collection);
	}
	_tmp3_ = self->remove_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp3_, FALSE);
	_tmp4_ = self->linked_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp4_, FALSE);
	contacts_contact_editor_set_has_birthday_row (self, FALSE);
	contacts_contact_editor_set_has_nickname_row (self, FALSE);
	contacts_contact_editor_set_has_notes_row (self, FALSE);
	_tmp5_ = self->priv->writable_personas;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp5_);
	_g_object_unref0 (self->priv->contact);
	self->priv->contact = NULL;
}


GeeHashMap* contacts_contact_editor_properties_changed (ContactsContactEditor* self) {
	GeeHashMap* result = NULL;
	GeeHashMap* props_set = NULL;
	GeeHashMap* _tmp0_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, CONTACTS_CONTACT_EDITOR_TYPE_PROPERTY_DATA, (GBoxedCopyFunc) contacts_contact_editor_property_data_dup, contacts_contact_editor_property_data_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	props_set = _tmp0_;
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeSet* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _tmp6_ = NULL;
		_tmp1_ = self->priv->writable_personas;
		_tmp2_ = gee_abstract_map_get_entries ((GeeMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_entry_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp9_ = NULL;
			gpointer _tmp10_ = NULL;
			_tmp7_ = _entry_it;
			_tmp8_ = gee_iterator_next (_tmp7_);
			if (!_tmp8_) {
				break;
			}
			_tmp9_ = _entry_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			entry = (GeeMapEntry*) _tmp10_;
			{
				GeeIterator* _field_entry_it = NULL;
				GeeMapEntry* _tmp11_ = NULL;
				gconstpointer _tmp12_ = NULL;
				GeeHashMap* _tmp13_ = NULL;
				GeeSet* _tmp14_ = NULL;
				GeeSet* _tmp15_ = NULL;
				GeeSet* _tmp16_ = NULL;
				GeeIterator* _tmp17_ = NULL;
				GeeIterator* _tmp18_ = NULL;
				_tmp11_ = entry;
				_tmp12_ = gee_map_entry_get_value (_tmp11_);
				_tmp13_ = _tmp12_;
				_tmp14_ = gee_abstract_map_get_entries ((GeeMap*) ((GeeHashMap*) _tmp13_));
				_tmp15_ = _tmp14_;
				_tmp16_ = _tmp15_;
				_tmp17_ = gee_iterable_iterator ((GeeIterable*) _tmp16_);
				_tmp18_ = _tmp17_;
				_g_object_unref0 (_tmp16_);
				_field_entry_it = _tmp18_;
				while (TRUE) {
					GeeIterator* _tmp19_ = NULL;
					gboolean _tmp20_ = FALSE;
					GeeMapEntry* field_entry = NULL;
					GeeIterator* _tmp21_ = NULL;
					gpointer _tmp22_ = NULL;
					gboolean _tmp23_ = FALSE;
					GeeMapEntry* _tmp24_ = NULL;
					gconstpointer _tmp25_ = NULL;
					ContactsContactEditorField* _tmp26_ = NULL;
					gboolean _tmp27_ = FALSE;
					_tmp19_ = _field_entry_it;
					_tmp20_ = gee_iterator_next (_tmp19_);
					if (!_tmp20_) {
						break;
					}
					_tmp21_ = _field_entry_it;
					_tmp22_ = gee_iterator_get (_tmp21_);
					field_entry = (GeeMapEntry*) _tmp22_;
					_tmp24_ = field_entry;
					_tmp25_ = gee_map_entry_get_value (_tmp24_);
					_tmp26_ = _tmp25_;
					_tmp27_ = (*((ContactsContactEditorField*) _tmp26_)).changed;
					if (_tmp27_) {
						GeeHashMap* _tmp28_ = NULL;
						GeeMapEntry* _tmp29_ = NULL;
						gconstpointer _tmp30_ = NULL;
						const gchar* _tmp31_ = NULL;
						gboolean _tmp32_ = FALSE;
						_tmp28_ = props_set;
						_tmp29_ = field_entry;
						_tmp30_ = gee_map_entry_get_key (_tmp29_);
						_tmp31_ = _tmp30_;
						_tmp32_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp28_, (const gchar*) _tmp31_);
						_tmp23_ = !_tmp32_;
					} else {
						_tmp23_ = FALSE;
					}
					if (_tmp23_) {
						ContactsContactEditorPropertyData p = {0};
						ContactsContact* _tmp33_ = NULL;
						GeeMapEntry* _tmp39_ = NULL;
						gconstpointer _tmp40_ = NULL;
						const gchar* _tmp41_ = NULL;
						const gchar* _tmp42_ = NULL;
						GQuark _tmp44_ = 0U;
						static GQuark _tmp43_label0 = 0;
						static GQuark _tmp43_label1 = 0;
						static GQuark _tmp43_label2 = 0;
						static GQuark _tmp43_label3 = 0;
						static GQuark _tmp43_label4 = 0;
						static GQuark _tmp43_label5 = 0;
						static GQuark _tmp43_label6 = 0;
						GeeHashMap* _tmp80_ = NULL;
						GeeMapEntry* _tmp81_ = NULL;
						gconstpointer _tmp82_ = NULL;
						const gchar* _tmp83_ = NULL;
						ContactsContactEditorPropertyData _tmp84_ = {0};
						memset (&p, 0, sizeof (ContactsContactEditorPropertyData));
						_g_object_unref0 (p.persona);
						p.persona = NULL;
						_tmp33_ = self->priv->contact;
						if (_tmp33_ != NULL) {
							ContactsContact* _tmp34_ = NULL;
							GeeMapEntry* _tmp35_ = NULL;
							gconstpointer _tmp36_ = NULL;
							const gchar* _tmp37_ = NULL;
							FolksPersona* _tmp38_ = NULL;
							_tmp34_ = self->priv->contact;
							_tmp35_ = entry;
							_tmp36_ = gee_map_entry_get_key (_tmp35_);
							_tmp37_ = _tmp36_;
							_tmp38_ = contacts_contact_find_persona_from_uid (_tmp34_, (const gchar*) _tmp37_);
							_g_object_unref0 (p.persona);
							p.persona = _tmp38_;
						}
						_tmp39_ = field_entry;
						_tmp40_ = gee_map_entry_get_key (_tmp39_);
						_tmp41_ = _tmp40_;
						_tmp42_ = (const gchar*) _tmp41_;
						_tmp44_ = (NULL == _tmp42_) ? 0 : g_quark_from_string (_tmp42_);
						if (_tmp44_ == ((0 != _tmp43_label0) ? _tmp43_label0 : (_tmp43_label0 = g_quark_from_static_string ("email-addresses")))) {
							switch (0) {
								default:
								{
									GeeMapEntry* _tmp45_ = NULL;
									gconstpointer _tmp46_ = NULL;
									ContactsContactEditorField* _tmp47_ = NULL;
									GeeHashMap* _tmp48_ = NULL;
									GValue _tmp49_ = {0};
									_tmp45_ = field_entry;
									_tmp46_ = gee_map_entry_get_value (_tmp45_);
									_tmp47_ = _tmp46_;
									_tmp48_ = (*((ContactsContactEditorField*) _tmp47_)).rows;
									contacts_contact_editor_get_value_from_emails (self, _tmp48_, &_tmp49_);
									G_IS_VALUE (&p.value) ? (g_value_unset (&p.value), NULL) : NULL;
									p.value = _tmp49_;
									break;
								}
							}
						} else if (_tmp44_ == ((0 != _tmp43_label1) ? _tmp43_label1 : (_tmp43_label1 = g_quark_from_static_string ("phone-numbers")))) {
							switch (0) {
								default:
								{
									GeeMapEntry* _tmp50_ = NULL;
									gconstpointer _tmp51_ = NULL;
									ContactsContactEditorField* _tmp52_ = NULL;
									GeeHashMap* _tmp53_ = NULL;
									GValue _tmp54_ = {0};
									_tmp50_ = field_entry;
									_tmp51_ = gee_map_entry_get_value (_tmp50_);
									_tmp52_ = _tmp51_;
									_tmp53_ = (*((ContactsContactEditorField*) _tmp52_)).rows;
									contacts_contact_editor_get_value_from_phones (self, _tmp53_, &_tmp54_);
									G_IS_VALUE (&p.value) ? (g_value_unset (&p.value), NULL) : NULL;
									p.value = _tmp54_;
									break;
								}
							}
						} else if (_tmp44_ == ((0 != _tmp43_label2) ? _tmp43_label2 : (_tmp43_label2 = g_quark_from_static_string ("urls")))) {
							switch (0) {
								default:
								{
									GeeMapEntry* _tmp55_ = NULL;
									gconstpointer _tmp56_ = NULL;
									ContactsContactEditorField* _tmp57_ = NULL;
									GeeHashMap* _tmp58_ = NULL;
									GValue _tmp59_ = {0};
									_tmp55_ = field_entry;
									_tmp56_ = gee_map_entry_get_value (_tmp55_);
									_tmp57_ = _tmp56_;
									_tmp58_ = (*((ContactsContactEditorField*) _tmp57_)).rows;
									contacts_contact_editor_get_value_from_urls (self, _tmp58_, &_tmp59_);
									G_IS_VALUE (&p.value) ? (g_value_unset (&p.value), NULL) : NULL;
									p.value = _tmp59_;
									break;
								}
							}
						} else if (_tmp44_ == ((0 != _tmp43_label3) ? _tmp43_label3 : (_tmp43_label3 = g_quark_from_static_string ("nickname")))) {
							switch (0) {
								default:
								{
									GeeMapEntry* _tmp60_ = NULL;
									gconstpointer _tmp61_ = NULL;
									ContactsContactEditorField* _tmp62_ = NULL;
									GeeHashMap* _tmp63_ = NULL;
									GValue _tmp64_ = {0};
									_tmp60_ = field_entry;
									_tmp61_ = gee_map_entry_get_value (_tmp60_);
									_tmp62_ = _tmp61_;
									_tmp63_ = (*((ContactsContactEditorField*) _tmp62_)).rows;
									contacts_contact_editor_get_value_from_nickname (self, _tmp63_, &_tmp64_);
									G_IS_VALUE (&p.value) ? (g_value_unset (&p.value), NULL) : NULL;
									p.value = _tmp64_;
									break;
								}
							}
						} else if (_tmp44_ == ((0 != _tmp43_label4) ? _tmp43_label4 : (_tmp43_label4 = g_quark_from_static_string ("birthday")))) {
							switch (0) {
								default:
								{
									GeeMapEntry* _tmp65_ = NULL;
									gconstpointer _tmp66_ = NULL;
									ContactsContactEditorField* _tmp67_ = NULL;
									GeeHashMap* _tmp68_ = NULL;
									GValue _tmp69_ = {0};
									_tmp65_ = field_entry;
									_tmp66_ = gee_map_entry_get_value (_tmp65_);
									_tmp67_ = _tmp66_;
									_tmp68_ = (*((ContactsContactEditorField*) _tmp67_)).rows;
									contacts_contact_editor_get_value_from_birthday (self, _tmp68_, &_tmp69_);
									G_IS_VALUE (&p.value) ? (g_value_unset (&p.value), NULL) : NULL;
									p.value = _tmp69_;
									break;
								}
							}
						} else if (_tmp44_ == ((0 != _tmp43_label5) ? _tmp43_label5 : (_tmp43_label5 = g_quark_from_static_string ("notes")))) {
							switch (0) {
								default:
								{
									GeeMapEntry* _tmp70_ = NULL;
									gconstpointer _tmp71_ = NULL;
									ContactsContactEditorField* _tmp72_ = NULL;
									GeeHashMap* _tmp73_ = NULL;
									GValue _tmp74_ = {0};
									_tmp70_ = field_entry;
									_tmp71_ = gee_map_entry_get_value (_tmp70_);
									_tmp72_ = _tmp71_;
									_tmp73_ = (*((ContactsContactEditorField*) _tmp72_)).rows;
									contacts_contact_editor_get_value_from_notes (self, _tmp73_, &_tmp74_);
									G_IS_VALUE (&p.value) ? (g_value_unset (&p.value), NULL) : NULL;
									p.value = _tmp74_;
									break;
								}
							}
						} else if (_tmp44_ == ((0 != _tmp43_label6) ? _tmp43_label6 : (_tmp43_label6 = g_quark_from_static_string ("postal-addresses")))) {
							switch (0) {
								default:
								{
									GeeMapEntry* _tmp75_ = NULL;
									gconstpointer _tmp76_ = NULL;
									ContactsContactEditorField* _tmp77_ = NULL;
									GeeHashMap* _tmp78_ = NULL;
									GValue _tmp79_ = {0};
									_tmp75_ = field_entry;
									_tmp76_ = gee_map_entry_get_value (_tmp75_);
									_tmp77_ = _tmp76_;
									_tmp78_ = (*((ContactsContactEditorField*) _tmp77_)).rows;
									contacts_contact_editor_get_value_from_addresses (self, _tmp78_, &_tmp79_);
									G_IS_VALUE (&p.value) ? (g_value_unset (&p.value), NULL) : NULL;
									p.value = _tmp79_;
									break;
								}
							}
						}
						_tmp80_ = props_set;
						_tmp81_ = field_entry;
						_tmp82_ = gee_map_entry_get_key (_tmp81_);
						_tmp83_ = _tmp82_;
						_tmp84_ = p;
						gee_abstract_map_set ((GeeAbstractMap*) _tmp80_, (const gchar*) _tmp83_, &_tmp84_);
						contacts_contact_editor_property_data_destroy (&p);
					}
					_g_object_unref0 (field_entry);
				}
				_g_object_unref0 (_field_entry_it);
			}
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	result = props_set;
	return result;
}


gboolean contacts_contact_editor_name_changed (ContactsContactEditor* self) {
	gboolean result = FALSE;
	GtkEntry* name_entry = NULL;
	GtkGrid* _tmp0_ = NULL;
	GtkWidget* _tmp1_ = NULL;
	GtkEntry* _tmp2_ = NULL;
	gconstpointer _tmp3_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->container_grid;
	_tmp1_ = gtk_grid_get_child_at (_tmp0_, 1, 0);
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, gtk_entry_get_type ()) ? ((GtkEntry*) _tmp1_) : NULL);
	name_entry = _tmp2_;
	_tmp3_ = g_object_get_data ((GObject*) name_entry, "changed");
	result = (gboolean) ((gintptr) _tmp3_);
	_g_object_unref0 (name_entry);
	return result;
}


void contacts_contact_editor_get_full_name_value (ContactsContactEditor* self, GValue* result) {
	GValue v = {0};
	GValue _tmp0_ = {0};
	GtkEntry* name_entry = NULL;
	GtkGrid* _tmp1_ = NULL;
	GtkWidget* _tmp2_ = NULL;
	GtkEntry* _tmp3_ = NULL;
	const gchar* _tmp4_ = NULL;
	g_return_if_fail (self != NULL);
	g_value_init (&_tmp0_, G_TYPE_STRING);
	v = _tmp0_;
	_tmp1_ = self->priv->container_grid;
	_tmp2_ = gtk_grid_get_child_at (_tmp1_, 1, 0);
	_tmp3_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, gtk_entry_get_type ()) ? ((GtkEntry*) _tmp2_) : NULL);
	name_entry = _tmp3_;
	_tmp4_ = gtk_entry_get_text (name_entry);
	g_value_set_string (&v, _tmp4_);
	*result = v;
	_g_object_unref0 (name_entry);
	return;
}


gboolean contacts_contact_editor_avatar_changed (ContactsContactEditor* self) {
	gboolean result = FALSE;
	ContactsContactFrame* image_frame = NULL;
	GtkGrid* _tmp0_ = NULL;
	GtkWidget* _tmp1_ = NULL;
	ContactsContactFrame* _tmp2_ = NULL;
	gconstpointer _tmp3_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->container_grid;
	_tmp1_ = gtk_grid_get_child_at (_tmp0_, 0, 0);
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, CONTACTS_TYPE_CONTACT_FRAME) ? ((ContactsContactFrame*) _tmp1_) : NULL);
	image_frame = _tmp2_;
	_tmp3_ = g_object_get_data ((GObject*) image_frame, "changed");
	result = (gboolean) ((gintptr) _tmp3_);
	_g_object_unref0 (image_frame);
	return result;
}


void contacts_contact_editor_get_avatar_value (ContactsContactEditor* self, GValue* result) {
	ContactsContactFrame* image_frame = NULL;
	GtkGrid* _tmp0_ = NULL;
	GtkWidget* _tmp1_ = NULL;
	ContactsContactFrame* _tmp2_ = NULL;
	GIcon* icon = NULL;
	gconstpointer _tmp3_ = NULL;
	GIcon* _tmp4_ = NULL;
	GValue v = {0};
	GType _tmp5_ = 0UL;
	GValue _tmp6_ = {0};
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->container_grid;
	_tmp1_ = gtk_grid_get_child_at (_tmp0_, 0, 0);
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, CONTACTS_TYPE_CONTACT_FRAME) ? ((ContactsContactFrame*) _tmp1_) : NULL);
	image_frame = _tmp2_;
	_tmp3_ = g_object_get_data ((GObject*) image_frame, "value");
	_tmp4_ = _g_object_ref0 ((GIcon*) _tmp3_);
	icon = _tmp4_;
	_tmp5_ = G_TYPE_FROM_INSTANCE ((GObject*) icon);
	g_value_init (&_tmp6_, _tmp5_);
	v = _tmp6_;
	g_value_set_object (&v, (GObject*) icon);
	*result = v;
	_g_object_unref0 (icon);
	_g_object_unref0 (image_frame);
	return;
}


void contacts_contact_editor_add_new_row_for_property (ContactsContactEditor* self, FolksPersona* p, const gchar* prop_name, const gchar* type) {
	FolksPersona* persona = NULL;
	ContactsContact* _tmp0_ = NULL;
	gint next_idx = 0;
	gint _tmp46_ = 0;
	gint _tmp47_ = 0;
	gint _tmp50_ = 0;
	FolksPersona* _tmp51_ = NULL;
	const gchar* _tmp52_ = NULL;
	const gchar* _tmp53_ = NULL;
	gint _tmp54_ = 0;
	GtkGrid* _tmp55_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (prop_name != NULL);
	persona = NULL;
	_tmp0_ = self->priv->contact;
	if (_tmp0_ != NULL) {
		FolksPersona* _tmp1_ = NULL;
		_tmp1_ = p;
		if (_tmp1_ == NULL) {
			ContactsContact* _tmp2_ = NULL;
			ContactsFakePersona* _tmp3_ = NULL;
			GeeHashMap* _tmp4_ = NULL;
			FolksPersona* _tmp5_ = NULL;
			const gchar* _tmp6_ = NULL;
			const gchar* _tmp7_ = NULL;
			GeeHashMap* _tmp8_ = NULL;
			GeeHashMap* _tmp9_ = NULL;
			_tmp2_ = self->priv->contact;
			_tmp3_ = contacts_fake_persona_new (_tmp2_);
			_g_object_unref0 (persona);
			persona = (FolksPersona*) _tmp3_;
			_tmp4_ = self->priv->writable_personas;
			_tmp5_ = persona;
			_tmp6_ = folks_persona_get_uid (_tmp5_);
			_tmp7_ = _tmp6_;
			_tmp8_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, CONTACTS_CONTACT_EDITOR_TYPE_FIELD, (GBoxedCopyFunc) contacts_contact_editor_field_dup, contacts_contact_editor_field_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
			_tmp9_ = _tmp8_;
			gee_abstract_map_set ((GeeAbstractMap*) _tmp4_, _tmp7_, _tmp9_);
			_g_object_unref0 (_tmp9_);
		} else {
			FolksPersona* _tmp10_ = NULL;
			FolksPersona* _tmp11_ = NULL;
			_tmp10_ = p;
			_tmp11_ = _g_object_ref0 (_tmp10_);
			_g_object_unref0 (persona);
			persona = _tmp11_;
		}
	}
	next_idx = 0;
	{
		GeeIterator* _fields_it = NULL;
		GeeHashMap* _tmp12_ = NULL;
		GeeCollection* _tmp13_ = NULL;
		GeeCollection* _tmp14_ = NULL;
		GeeCollection* _tmp15_ = NULL;
		GeeIterator* _tmp16_ = NULL;
		GeeIterator* _tmp17_ = NULL;
		_tmp12_ = self->priv->writable_personas;
		_tmp13_ = gee_abstract_map_get_values ((GeeMap*) _tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = _tmp14_;
		_tmp16_ = gee_iterable_iterator ((GeeIterable*) _tmp15_);
		_tmp17_ = _tmp16_;
		_g_object_unref0 (_tmp15_);
		_fields_it = _tmp17_;
		while (TRUE) {
			GeeIterator* _tmp18_ = NULL;
			gboolean _tmp19_ = FALSE;
			GeeHashMap* fields = NULL;
			GeeIterator* _tmp20_ = NULL;
			gpointer _tmp21_ = NULL;
			GeeHashMap* _tmp22_ = NULL;
			const gchar* _tmp23_ = NULL;
			gboolean _tmp24_ = FALSE;
			_tmp18_ = _fields_it;
			_tmp19_ = gee_iterator_next (_tmp18_);
			if (!_tmp19_) {
				break;
			}
			_tmp20_ = _fields_it;
			_tmp21_ = gee_iterator_get (_tmp20_);
			fields = (GeeHashMap*) _tmp21_;
			_tmp22_ = fields;
			_tmp23_ = prop_name;
			_tmp24_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp22_, _tmp23_);
			if (_tmp24_) {
				{
					GeeIterator* _idx_it = NULL;
					GeeHashMap* _tmp25_ = NULL;
					const gchar* _tmp26_ = NULL;
					gpointer _tmp27_ = NULL;
					ContactsContactEditorField* _tmp28_ = NULL;
					GeeHashMap* _tmp29_ = NULL;
					GeeSet* _tmp30_ = NULL;
					GeeSet* _tmp31_ = NULL;
					GeeSet* _tmp32_ = NULL;
					GeeIterator* _tmp33_ = NULL;
					GeeIterator* _tmp34_ = NULL;
					_tmp25_ = fields;
					_tmp26_ = prop_name;
					_tmp27_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp25_, _tmp26_);
					_tmp28_ = (ContactsContactEditorField*) _tmp27_;
					_tmp29_ = (*_tmp28_).rows;
					_tmp30_ = gee_abstract_map_get_keys ((GeeMap*) _tmp29_);
					_tmp31_ = _tmp30_;
					_tmp32_ = _tmp31_;
					_tmp33_ = gee_iterable_iterator ((GeeIterable*) _tmp32_);
					_tmp34_ = _tmp33_;
					_g_object_unref0 (_tmp32_);
					_contacts_contact_editor_field_free0 (_tmp28_);
					_idx_it = _tmp34_;
					while (TRUE) {
						GeeIterator* _tmp35_ = NULL;
						gboolean _tmp36_ = FALSE;
						gint idx = 0;
						GeeIterator* _tmp37_ = NULL;
						gpointer _tmp38_ = NULL;
						gint _tmp39_ = 0;
						gint _tmp40_ = 0;
						_tmp35_ = _idx_it;
						_tmp36_ = gee_iterator_next (_tmp35_);
						if (!_tmp36_) {
							break;
						}
						_tmp37_ = _idx_it;
						_tmp38_ = gee_iterator_get (_tmp37_);
						idx = (gint) ((gintptr) _tmp38_);
						_tmp39_ = idx;
						_tmp40_ = self->priv->last_row;
						if (_tmp39_ < _tmp40_) {
							gint _tmp41_ = 0;
							gint _tmp42_ = 0;
							gint _tmp43_ = 0;
							_tmp42_ = idx;
							_tmp43_ = next_idx;
							if (_tmp42_ > _tmp43_) {
								gint _tmp44_ = 0;
								_tmp44_ = idx;
								_tmp41_ = _tmp44_;
							} else {
								gint _tmp45_ = 0;
								_tmp45_ = next_idx;
								_tmp41_ = _tmp45_;
							}
							next_idx = _tmp41_;
						}
					}
					_g_object_unref0 (_idx_it);
				}
				_g_object_unref0 (fields);
				break;
			}
			_g_object_unref0 (fields);
		}
		_g_object_unref0 (_fields_it);
	}
	_tmp47_ = next_idx;
	if (_tmp47_ == 0) {
		gint _tmp48_ = 0;
		_tmp48_ = self->priv->last_row;
		_tmp46_ = _tmp48_;
	} else {
		gint _tmp49_ = 0;
		_tmp49_ = next_idx;
		_tmp46_ = _tmp49_;
	}
	next_idx = _tmp46_ + 1;
	_tmp50_ = next_idx;
	contacts_contact_editor_insert_row_at (self, _tmp50_);
	_tmp51_ = persona;
	_tmp52_ = prop_name;
	_tmp53_ = type;
	contacts_contact_editor_add_edit_row (self, _tmp51_, _tmp52_, &next_idx, TRUE, _tmp53_);
	_tmp54_ = self->priv->last_row;
	self->priv->last_row = _tmp54_ + 1;
	_tmp55_ = self->priv->container_grid;
	gtk_widget_show_all ((GtkWidget*) _tmp55_);
	_g_object_unref0 (persona);
}


static Block27Data* block27_data_ref (Block27Data* _data27_) {
	g_atomic_int_inc (&_data27_->_ref_count_);
	return _data27_;
}


static void block27_data_unref (void * _userdata_) {
	Block27Data* _data27_;
	_data27_ = (Block27Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data27_->_ref_count_)) {
		ContactsContactEditor* self;
		self = _data27_->self;
		_g_object_unref0 (_data27_->name_entry);
		_g_object_unref0 (_data27_->image_frame);
		_g_object_unref0 (self);
		g_slice_free (Block27Data, _data27_);
	}
}


static void __lambda68_ (Block27Data* _data27_, GIcon* icon) {
	ContactsContactEditor* self;
	ContactsContactFrame* _tmp0_ = NULL;
	GIcon* _tmp1_ = NULL;
	GIcon* _tmp2_ = NULL;
	ContactsContactFrame* _tmp3_ = NULL;
	GdkPixbuf* a_pixbuf = NULL;
	ContactsContactFrame* _tmp10_ = NULL;
	GdkPixbuf* _tmp11_ = NULL;
	GError * _inner_error_ = NULL;
	self = _data27_->self;
	g_return_if_fail (icon != NULL);
	_tmp0_ = _data27_->image_frame;
	_tmp1_ = icon;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	g_object_set_data_full ((GObject*) _tmp0_, "value", _tmp2_, g_object_unref);
	_tmp3_ = _data27_->image_frame;
	g_object_set_data_full ((GObject*) _tmp3_, "changed", (gpointer) ((gintptr) TRUE), NULL);
	a_pixbuf = NULL;
	{
		GInputStream* stream = NULL;
		GIcon* _tmp4_ = NULL;
		GInputStream* _tmp5_ = NULL;
		GdkPixbuf* _tmp6_ = NULL;
		GInputStream* _tmp7_ = NULL;
		GdkPixbuf* _tmp8_ = NULL;
		GdkPixbuf* _tmp9_ = NULL;
		_tmp4_ = icon;
		_tmp5_ = g_loadable_icon_load (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, g_loadable_icon_get_type ()) ? ((GLoadableIcon*) _tmp4_) : NULL, PROFILE_SIZE, NULL, NULL, &_inner_error_);
		stream = _tmp5_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			goto __catch7_g_error;
		}
		_tmp7_ = stream;
		_tmp8_ = gdk_pixbuf_new_from_stream_at_scale (_tmp7_, PROFILE_SIZE, PROFILE_SIZE, TRUE, NULL, &_inner_error_);
		_tmp6_ = _tmp8_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			_g_object_unref0 (stream);
			goto __catch7_g_error;
		}
		_tmp9_ = _tmp6_;
		_tmp6_ = NULL;
		_g_object_unref0 (a_pixbuf);
		a_pixbuf = _tmp9_;
		_g_object_unref0 (_tmp6_);
		_g_object_unref0 (stream);
	}
	goto __finally7;
	__catch7_g_error:
	{
		g_clear_error (&_inner_error_);
		_inner_error_ = NULL;
	}
	__finally7:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		_g_object_unref0 (a_pixbuf);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
	_tmp10_ = _data27_->image_frame;
	_tmp11_ = a_pixbuf;
	contacts_contact_frame_set_pixbuf (_tmp10_, _tmp11_);
	_g_object_unref0 (a_pixbuf);
}


static void ___lambda68__contacts_avatar_dialog_set_avatar (ContactsAvatarDialog* _sender, GIcon* avatar_icon, gpointer self) {
	__lambda68_ (self, avatar_icon);
}


static void __lambda67_ (Block27Data* _data27_) {
	ContactsContactEditor* self;
	ContactsAvatarDialog* dialog = NULL;
	ContactsAvatarDialog* _tmp0_ = NULL;
	self = _data27_->self;
	_tmp0_ = contacts_avatar_dialog_new (NULL);
	g_object_ref_sink (_tmp0_);
	dialog = _tmp0_;
	g_signal_connect_data (dialog, "set-avatar", (GCallback) ___lambda68__contacts_avatar_dialog_set_avatar, block27_data_ref (_data27_), (GClosureNotify) block27_data_unref, 0);
	gtk_widget_show ((GtkWidget*) dialog);
	_g_object_unref0 (dialog);
}


static void ___lambda67__contacts_contact_frame_clicked (ContactsContactFrame* _sender, gpointer self) {
	__lambda67_ (self);
}


static void __lambda69_ (Block27Data* _data27_) {
	ContactsContactEditor* self;
	GtkEntry* _tmp0_ = NULL;
	self = _data27_->self;
	_tmp0_ = _data27_->name_entry;
	g_object_set_data_full ((GObject*) _tmp0_, "changed", (gpointer) ((gintptr) TRUE), NULL);
}


static void ___lambda69__gtk_editable_changed (GtkEditable* _sender, gpointer self) {
	__lambda69_ (self);
}


void contacts_contact_editor_set_new_contact (ContactsContactEditor* self) {
	Block27Data* _data27_;
	GtkButton* _tmp0_ = NULL;
	GtkButton* _tmp1_ = NULL;
	ContactsContactFrame* _tmp2_ = NULL;
	ContactsContactFrame* _tmp3_ = NULL;
	ContactsContactFrame* _tmp4_ = NULL;
	ContactsContactFrame* _tmp5_ = NULL;
	ContactsContactFrame* _tmp6_ = NULL;
	GtkWidget* _tmp7_ = NULL;
	ContactsContactFrame* _tmp8_ = NULL;
	GtkGrid* _tmp9_ = NULL;
	ContactsContactFrame* _tmp10_ = NULL;
	GtkEntry* _tmp11_ = NULL;
	GtkEntry* _tmp12_ = NULL;
	GtkEntry* _tmp13_ = NULL;
	GtkEntry* _tmp14_ = NULL;
	GtkEntry* _tmp15_ = NULL;
	const gchar* _tmp16_ = NULL;
	GtkGrid* _tmp17_ = NULL;
	GtkEntry* _tmp18_ = NULL;
	GtkEntry* _tmp19_ = NULL;
	gchar** rw_props = NULL;
	gchar* _tmp20_ = NULL;
	gchar* _tmp21_ = NULL;
	gchar* _tmp22_ = NULL;
	gchar** _tmp23_ = NULL;
	gint rw_props_length1 = 0;
	gint _rw_props_size_ = 0;
	GeeHashMap* _tmp24_ = NULL;
	GeeHashMap* _tmp25_ = NULL;
	GeeHashMap* _tmp26_ = NULL;
	gchar** _tmp27_ = NULL;
	gint _tmp27__length1 = 0;
	GtkEntry* _tmp38_ = NULL;
	g_return_if_fail (self != NULL);
	_data27_ = g_slice_new0 (Block27Data);
	_data27_->_ref_count_ = 1;
	_data27_->self = g_object_ref (self);
	_tmp0_ = self->remove_button;
	gtk_widget_hide ((GtkWidget*) _tmp0_);
	_tmp1_ = self->linked_button;
	gtk_widget_hide ((GtkWidget*) _tmp1_);
	_tmp2_ = contacts_contact_frame_new (PROFILE_SIZE, TRUE);
	g_object_ref_sink (_tmp2_);
	_data27_->image_frame = _tmp2_;
	_tmp3_ = _data27_->image_frame;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp3_, FALSE);
	_tmp4_ = _data27_->image_frame;
	gtk_widget_set_valign ((GtkWidget*) _tmp4_, GTK_ALIGN_START);
	_tmp5_ = _data27_->image_frame;
	contacts_contact_frame_set_image (_tmp5_, NULL, NULL);
	_tmp6_ = _data27_->image_frame;
	_tmp7_ = gtk_bin_get_child ((GtkBin*) _tmp6_);
	gtk_button_set_relief (G_TYPE_CHECK_INSTANCE_TYPE (_tmp7_, gtk_button_get_type ()) ? ((GtkButton*) _tmp7_) : NULL, GTK_RELIEF_NORMAL);
	_tmp8_ = _data27_->image_frame;
	g_signal_connect_data (_tmp8_, "clicked", (GCallback) ___lambda67__contacts_contact_frame_clicked, block27_data_ref (_data27_), (GClosureNotify) block27_data_unref, 0);
	_tmp9_ = self->priv->container_grid;
	_tmp10_ = _data27_->image_frame;
	gtk_grid_attach (_tmp9_, (GtkWidget*) _tmp10_, 0, 0, 1, 3);
	_tmp11_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp11_);
	_data27_->name_entry = _tmp11_;
	_tmp12_ = _data27_->name_entry;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp12_, TRUE);
	_tmp13_ = _data27_->name_entry;
	gtk_widget_set_valign ((GtkWidget*) _tmp13_, GTK_ALIGN_CENTER);
	_tmp14_ = _data27_->name_entry;
	g_object_set_data_full ((GObject*) _tmp14_, "changed", (gpointer) ((gintptr) FALSE), NULL);
	_tmp15_ = _data27_->name_entry;
	_tmp16_ = _ ("Add name");
	gtk_entry_set_placeholder_text (_tmp15_, _tmp16_);
	_tmp17_ = self->priv->container_grid;
	_tmp18_ = _data27_->name_entry;
	gtk_grid_attach (_tmp17_, (GtkWidget*) _tmp18_, 1, 0, 3, 3);
	_tmp19_ = _data27_->name_entry;
	g_signal_connect_data ((GtkEditable*) _tmp19_, "changed", (GCallback) ___lambda69__gtk_editable_changed, block27_data_ref (_data27_), (GClosureNotify) block27_data_unref, 0);
	self->priv->last_row = 2;
	_tmp20_ = g_strdup ("email-addresses.personal");
	_tmp21_ = g_strdup ("phone-numbers.cell");
	_tmp22_ = g_strdup ("postal-addresses.home");
	_tmp23_ = g_new0 (gchar*, 3 + 1);
	_tmp23_[0] = _tmp20_;
	_tmp23_[1] = _tmp21_;
	_tmp23_[2] = _tmp22_;
	rw_props = _tmp23_;
	rw_props_length1 = 3;
	_rw_props_size_ = rw_props_length1;
	_tmp24_ = self->priv->writable_personas;
	_tmp25_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, CONTACTS_CONTACT_EDITOR_TYPE_FIELD, (GBoxedCopyFunc) contacts_contact_editor_field_dup, contacts_contact_editor_field_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_tmp26_ = _tmp25_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp24_, "null-persona.hack", _tmp26_);
	_g_object_unref0 (_tmp26_);
	_tmp27_ = rw_props;
	_tmp27__length1 = rw_props_length1;
	{
		gchar** prop_collection = NULL;
		gint prop_collection_length1 = 0;
		gint _prop_collection_size_ = 0;
		gint prop_it = 0;
		prop_collection = _tmp27_;
		prop_collection_length1 = _tmp27__length1;
		for (prop_it = 0; prop_it < _tmp27__length1; prop_it = prop_it + 1) {
			gchar* _tmp28_ = NULL;
			gchar* prop = NULL;
			_tmp28_ = g_strdup (prop_collection[prop_it]);
			prop = _tmp28_;
			{
				gchar** tok = NULL;
				const gchar* _tmp29_ = NULL;
				gchar** _tmp30_ = NULL;
				gchar** _tmp31_ = NULL;
				gint tok_length1 = 0;
				gint _tok_size_ = 0;
				gchar** _tmp32_ = NULL;
				gint _tmp32__length1 = 0;
				const gchar* _tmp33_ = NULL;
				gchar** _tmp34_ = NULL;
				gint _tmp34__length1 = 0;
				const gchar* _tmp35_ = NULL;
				gchar* _tmp36_ = NULL;
				gchar* _tmp37_ = NULL;
				_tmp29_ = prop;
				_tmp31_ = _tmp30_ = g_strsplit (_tmp29_, ".", 0);
				tok = _tmp31_;
				tok_length1 = _vala_array_length (_tmp30_);
				_tok_size_ = tok_length1;
				_tmp32_ = tok;
				_tmp32__length1 = tok_length1;
				_tmp33_ = _tmp32_[0];
				_tmp34_ = tok;
				_tmp34__length1 = tok_length1;
				_tmp35_ = _tmp34_[1];
				_tmp36_ = g_utf8_strup (_tmp35_, (gssize) -1);
				_tmp37_ = _tmp36_;
				contacts_contact_editor_add_new_row_for_property (self, NULL, _tmp33_, _tmp37_);
				_g_free0 (_tmp37_);
				tok = (_vala_array_free (tok, tok_length1, (GDestroyNotify) g_free), NULL);
				_g_free0 (prop);
			}
		}
	}
	_tmp38_ = _data27_->name_entry;
	self->priv->focus_widget = (GtkWidget*) _tmp38_;
	rw_props = (_vala_array_free (rw_props, rw_props_length1, (GDestroyNotify) g_free), NULL);
	block27_data_unref (_data27_);
	_data27_ = NULL;
}


gboolean contacts_contact_editor_get_has_birthday_row (ContactsContactEditor* self) {
	gboolean result;
	gboolean _tmp0_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_has_birthday_row;
	result = _tmp0_;
	return result;
}


static void contacts_contact_editor_set_has_birthday_row (ContactsContactEditor* self, gboolean value) {
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_has_birthday_row = _tmp0_;
	g_object_notify ((GObject *) self, "has-birthday-row");
}


gboolean contacts_contact_editor_get_has_nickname_row (ContactsContactEditor* self) {
	gboolean result;
	gboolean _tmp0_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_has_nickname_row;
	result = _tmp0_;
	return result;
}


static void contacts_contact_editor_set_has_nickname_row (ContactsContactEditor* self, gboolean value) {
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_has_nickname_row = _tmp0_;
	g_object_notify ((GObject *) self, "has-nickname-row");
}


gboolean contacts_contact_editor_get_has_notes_row (ContactsContactEditor* self) {
	gboolean result;
	gboolean _tmp0_ = FALSE;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_has_notes_row;
	result = _tmp0_;
	return result;
}


static void contacts_contact_editor_set_has_notes_row (ContactsContactEditor* self, gboolean value) {
	gboolean _tmp0_ = FALSE;
	g_return_if_fail (self != NULL);
	_tmp0_ = value;
	self->priv->_has_notes_row = _tmp0_;
	g_object_notify ((GObject *) self, "has-notes-row");
}


void contacts_contact_editor_property_data_copy (const ContactsContactEditorPropertyData* self, ContactsContactEditorPropertyData* dest) {
	FolksPersona* _tmp0_ = NULL;
	FolksPersona* _tmp1_ = NULL;
	GValue _tmp2_ = {0};
	GValue _tmp3_ = {0};
	_tmp0_ = (*self).persona;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 ((*dest).persona);
	(*dest).persona = _tmp1_;
	_tmp2_ = (*self).value;
	if (G_IS_VALUE (&_tmp2_)) {
		g_value_init (&_tmp3_, G_VALUE_TYPE (&_tmp2_));
		g_value_copy (&_tmp2_, &_tmp3_);
	} else {
		_tmp3_ = _tmp2_;
	}
	G_IS_VALUE (&(*dest).value) ? (g_value_unset (&(*dest).value), NULL) : NULL;
	(*dest).value = _tmp3_;
}


void contacts_contact_editor_property_data_destroy (ContactsContactEditorPropertyData* self) {
	_g_object_unref0 ((*self).persona);
	G_IS_VALUE (&(*self).value) ? (g_value_unset (&(*self).value), NULL) : NULL;
}


ContactsContactEditorPropertyData* contacts_contact_editor_property_data_dup (const ContactsContactEditorPropertyData* self) {
	ContactsContactEditorPropertyData* dup;
	dup = g_new0 (ContactsContactEditorPropertyData, 1);
	contacts_contact_editor_property_data_copy (self, dup);
	return dup;
}


void contacts_contact_editor_property_data_free (ContactsContactEditorPropertyData* self) {
	contacts_contact_editor_property_data_destroy (self);
	g_free (self);
}


GType contacts_contact_editor_property_data_get_type (void) {
	static volatile gsize contacts_contact_editor_property_data_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_contact_editor_property_data_type_id__volatile)) {
		GType contacts_contact_editor_property_data_type_id;
		contacts_contact_editor_property_data_type_id = g_boxed_type_register_static ("ContactsContactEditorPropertyData", (GBoxedCopyFunc) contacts_contact_editor_property_data_dup, (GBoxedFreeFunc) contacts_contact_editor_property_data_free);
		g_once_init_leave (&contacts_contact_editor_property_data_type_id__volatile, contacts_contact_editor_property_data_type_id);
	}
	return contacts_contact_editor_property_data_type_id__volatile;
}


static void contacts_contact_editor_row_data_copy (const ContactsContactEditorRowData* self, ContactsContactEditorRowData* dest) {
	FolksAbstractFieldDetails* _tmp0_ = NULL;
	FolksAbstractFieldDetails* _tmp1_ = NULL;
	_tmp0_ = (*self).details;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 ((*dest).details);
	(*dest).details = _tmp1_;
}


static void contacts_contact_editor_row_data_destroy (ContactsContactEditorRowData* self) {
	_g_object_unref0 ((*self).details);
}


static ContactsContactEditorRowData* contacts_contact_editor_row_data_dup (const ContactsContactEditorRowData* self) {
	ContactsContactEditorRowData* dup;
	dup = g_new0 (ContactsContactEditorRowData, 1);
	contacts_contact_editor_row_data_copy (self, dup);
	return dup;
}


static void contacts_contact_editor_row_data_free (ContactsContactEditorRowData* self) {
	contacts_contact_editor_row_data_destroy (self);
	g_free (self);
}


static GType contacts_contact_editor_row_data_get_type (void) {
	static volatile gsize contacts_contact_editor_row_data_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_contact_editor_row_data_type_id__volatile)) {
		GType contacts_contact_editor_row_data_type_id;
		contacts_contact_editor_row_data_type_id = g_boxed_type_register_static ("ContactsContactEditorRowData", (GBoxedCopyFunc) contacts_contact_editor_row_data_dup, (GBoxedFreeFunc) contacts_contact_editor_row_data_free);
		g_once_init_leave (&contacts_contact_editor_row_data_type_id__volatile, contacts_contact_editor_row_data_type_id);
	}
	return contacts_contact_editor_row_data_type_id__volatile;
}


static void contacts_contact_editor_field_copy (const ContactsContactEditorField* self, ContactsContactEditorField* dest) {
	gboolean _tmp0_ = FALSE;
	GeeHashMap* _tmp1_ = NULL;
	GeeHashMap* _tmp2_ = NULL;
	_tmp0_ = (*self).changed;
	(*dest).changed = _tmp0_;
	_tmp1_ = (*self).rows;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 ((*dest).rows);
	(*dest).rows = _tmp2_;
}


static void contacts_contact_editor_field_destroy (ContactsContactEditorField* self) {
	_g_object_unref0 ((*self).rows);
}


static ContactsContactEditorField* contacts_contact_editor_field_dup (const ContactsContactEditorField* self) {
	ContactsContactEditorField* dup;
	dup = g_new0 (ContactsContactEditorField, 1);
	contacts_contact_editor_field_copy (self, dup);
	return dup;
}


static void contacts_contact_editor_field_free (ContactsContactEditorField* self) {
	contacts_contact_editor_field_destroy (self);
	g_free (self);
}


static GType contacts_contact_editor_field_get_type (void) {
	static volatile gsize contacts_contact_editor_field_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_contact_editor_field_type_id__volatile)) {
		GType contacts_contact_editor_field_type_id;
		contacts_contact_editor_field_type_id = g_boxed_type_register_static ("ContactsContactEditorField", (GBoxedCopyFunc) contacts_contact_editor_field_dup, (GBoxedFreeFunc) contacts_contact_editor_field_free);
		g_once_init_leave (&contacts_contact_editor_field_type_id__volatile, contacts_contact_editor_field_type_id);
	}
	return contacts_contact_editor_field_type_id__volatile;
}


static void contacts_contact_editor_class_init (ContactsContactEditorClass * klass) {
	contacts_contact_editor_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ContactsContactEditorPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_contacts_contact_editor_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_contacts_contact_editor_set_property;
	G_OBJECT_CLASS (klass)->finalize = contacts_contact_editor_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_CONTACT_EDITOR_HAS_BIRTHDAY_ROW, g_param_spec_boolean ("has-birthday-row", "has-birthday-row", "has-birthday-row", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_CONTACT_EDITOR_HAS_NICKNAME_ROW, g_param_spec_boolean ("has-nickname-row", "has-nickname-row", "has-nickname-row", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_CONTACT_EDITOR_HAS_NOTES_ROW, g_param_spec_boolean ("has-notes-row", "has-notes-row", "has-notes-row", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
}


static void contacts_contact_editor_instance_init (ContactsContactEditor * self) {
	self->priv = CONTACTS_CONTACT_EDITOR_GET_PRIVATE (self);
	self->priv->_has_birthday_row = FALSE;
	self->priv->_has_nickname_row = FALSE;
	self->priv->_has_notes_row = FALSE;
}


static void contacts_contact_editor_finalize (GObject* obj) {
	ContactsContactEditor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONTACTS_TYPE_CONTACT_EDITOR, ContactsContactEditor);
	_g_object_unref0 (self->priv->contact);
	_g_object_unref0 (self->priv->container_grid);
	_g_object_unref0 (self->linked_button);
	_g_object_unref0 (self->remove_button);
	_g_object_unref0 (self->priv->writable_personas);
	G_OBJECT_CLASS (contacts_contact_editor_parent_class)->finalize (obj);
}


GType contacts_contact_editor_get_type (void) {
	static volatile gsize contacts_contact_editor_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_contact_editor_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ContactsContactEditorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) contacts_contact_editor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ContactsContactEditor), 0, (GInstanceInitFunc) contacts_contact_editor_instance_init, NULL };
		GType contacts_contact_editor_type_id;
		contacts_contact_editor_type_id = g_type_register_static (gtk_grid_get_type (), "ContactsContactEditor", &g_define_type_info, 0);
		g_once_init_leave (&contacts_contact_editor_type_id__volatile, contacts_contact_editor_type_id);
	}
	return contacts_contact_editor_type_id__volatile;
}


static void _vala_contacts_contact_editor_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ContactsContactEditor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONTACTS_TYPE_CONTACT_EDITOR, ContactsContactEditor);
	switch (property_id) {
		case CONTACTS_CONTACT_EDITOR_HAS_BIRTHDAY_ROW:
		g_value_set_boolean (value, contacts_contact_editor_get_has_birthday_row (self));
		break;
		case CONTACTS_CONTACT_EDITOR_HAS_NICKNAME_ROW:
		g_value_set_boolean (value, contacts_contact_editor_get_has_nickname_row (self));
		break;
		case CONTACTS_CONTACT_EDITOR_HAS_NOTES_ROW:
		g_value_set_boolean (value, contacts_contact_editor_get_has_notes_row (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_contacts_contact_editor_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	ContactsContactEditor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONTACTS_TYPE_CONTACT_EDITOR, ContactsContactEditor);
	switch (property_id) {
		case CONTACTS_CONTACT_EDITOR_HAS_BIRTHDAY_ROW:
		contacts_contact_editor_set_has_birthday_row (self, g_value_get_boolean (value));
		break;
		case CONTACTS_CONTACT_EDITOR_HAS_NICKNAME_ROW:
		contacts_contact_editor_set_has_nickname_row (self, g_value_get_boolean (value));
		break;
		case CONTACTS_CONTACT_EDITOR_HAS_NOTES_ROW:
		contacts_contact_editor_set_has_notes_row (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, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int 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, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}


static gint _vala_array_length (gpointer array) {
	int length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}



