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

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

#include <adwaita.h>
#include <glib-object.h>
#include "planify.h"
#include <gtk/gtk.h>
#include <glib.h>
#include <gee.h>
#include <stdlib.h>
#include <string.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <gtksourceview/gtksource.h>
#include <libspelling.h>
#include <pango/pango.h>
#include <gdk/gdk.h>

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

#define LAYOUTS_TYPE_ITEM_SIDEBAR_VIEW (layouts_item_sidebar_view_get_type ())
#define LAYOUTS_ITEM_SIDEBAR_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LAYOUTS_TYPE_ITEM_SIDEBAR_VIEW, LayoutsItemSidebarView))
#define LAYOUTS_ITEM_SIDEBAR_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LAYOUTS_TYPE_ITEM_SIDEBAR_VIEW, LayoutsItemSidebarViewClass))
#define LAYOUTS_IS_ITEM_SIDEBAR_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LAYOUTS_TYPE_ITEM_SIDEBAR_VIEW))
#define LAYOUTS_IS_ITEM_SIDEBAR_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LAYOUTS_TYPE_ITEM_SIDEBAR_VIEW))
#define LAYOUTS_ITEM_SIDEBAR_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LAYOUTS_TYPE_ITEM_SIDEBAR_VIEW, LayoutsItemSidebarViewClass))

typedef struct _LayoutsItemSidebarView LayoutsItemSidebarView;
typedef struct _LayoutsItemSidebarViewClass LayoutsItemSidebarViewClass;
typedef struct _LayoutsItemSidebarViewPrivate LayoutsItemSidebarViewPrivate;

#define WIDGETS_TYPE_SUB_ITEMS (widgets_sub_items_get_type ())
#define WIDGETS_SUB_ITEMS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIDGETS_TYPE_SUB_ITEMS, WidgetsSubItems))
#define WIDGETS_SUB_ITEMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIDGETS_TYPE_SUB_ITEMS, WidgetsSubItemsClass))
#define WIDGETS_IS_SUB_ITEMS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIDGETS_TYPE_SUB_ITEMS))
#define WIDGETS_IS_SUB_ITEMS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIDGETS_TYPE_SUB_ITEMS))
#define WIDGETS_SUB_ITEMS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIDGETS_TYPE_SUB_ITEMS, WidgetsSubItemsClass))

typedef struct _WidgetsSubItems WidgetsSubItems;
typedef struct _WidgetsSubItemsClass WidgetsSubItemsClass;

#define WIDGETS_TYPE_ATTACHMENTS (widgets_attachments_get_type ())
#define WIDGETS_ATTACHMENTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIDGETS_TYPE_ATTACHMENTS, WidgetsAttachments))
#define WIDGETS_ATTACHMENTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIDGETS_TYPE_ATTACHMENTS, WidgetsAttachmentsClass))
#define WIDGETS_IS_ATTACHMENTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIDGETS_TYPE_ATTACHMENTS))
#define WIDGETS_IS_ATTACHMENTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIDGETS_TYPE_ATTACHMENTS))
#define WIDGETS_ATTACHMENTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIDGETS_TYPE_ATTACHMENTS, WidgetsAttachmentsClass))

typedef struct _WidgetsAttachments WidgetsAttachments;
typedef struct _WidgetsAttachmentsClass WidgetsAttachmentsClass;
enum  {
	LAYOUTS_ITEM_SIDEBAR_VIEW_0_PROPERTY,
	LAYOUTS_ITEM_SIDEBAR_VIEW_ITEM_PROPERTY,
	LAYOUTS_ITEM_SIDEBAR_VIEW_UPDATE_ID_PROPERTY,
	LAYOUTS_ITEM_SIDEBAR_VIEW_SHOW_COMPLETED_PROPERTY,
	LAYOUTS_ITEM_SIDEBAR_VIEW_NUM_PROPERTIES
};
static GParamSpec* layouts_item_sidebar_view_properties[LAYOUTS_ITEM_SIDEBAR_VIEW_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
typedef struct _WidgetsSubItemsPrivate WidgetsSubItemsPrivate;

#define LAYOUTS_TYPE_ITEM_BASE (layouts_item_base_get_type ())
#define LAYOUTS_ITEM_BASE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), LAYOUTS_TYPE_ITEM_BASE, LayoutsItemBase))
#define LAYOUTS_ITEM_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LAYOUTS_TYPE_ITEM_BASE, LayoutsItemBaseClass))
#define LAYOUTS_IS_ITEM_BASE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), LAYOUTS_TYPE_ITEM_BASE))
#define LAYOUTS_IS_ITEM_BASE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), LAYOUTS_TYPE_ITEM_BASE))
#define LAYOUTS_ITEM_BASE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), LAYOUTS_TYPE_ITEM_BASE, LayoutsItemBaseClass))

typedef struct _LayoutsItemBase LayoutsItemBase;
typedef struct _LayoutsItemBaseClass LayoutsItemBaseClass;
typedef struct _WidgetsAttachmentsPrivate WidgetsAttachmentsPrivate;

#define WIDGETS_TYPE_ATTACHMENT_ROW (widgets_attachment_row_get_type ())
#define WIDGETS_ATTACHMENT_ROW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIDGETS_TYPE_ATTACHMENT_ROW, WidgetsAttachmentRow))
#define WIDGETS_ATTACHMENT_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIDGETS_TYPE_ATTACHMENT_ROW, WidgetsAttachmentRowClass))
#define WIDGETS_IS_ATTACHMENT_ROW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIDGETS_TYPE_ATTACHMENT_ROW))
#define WIDGETS_IS_ATTACHMENT_ROW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIDGETS_TYPE_ATTACHMENT_ROW))
#define WIDGETS_ATTACHMENT_ROW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIDGETS_TYPE_ATTACHMENT_ROW, WidgetsAttachmentRowClass))

typedef struct _WidgetsAttachmentRow WidgetsAttachmentRow;
typedef struct _WidgetsAttachmentRowClass WidgetsAttachmentRowClass;

#define DIALOGS_PROJECT_PICKER_TYPE_PROJECT_PICKER (dialogs_project_picker_project_picker_get_type ())
#define DIALOGS_PROJECT_PICKER_PROJECT_PICKER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIALOGS_PROJECT_PICKER_TYPE_PROJECT_PICKER, DialogsProjectPickerProjectPicker))
#define DIALOGS_PROJECT_PICKER_PROJECT_PICKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DIALOGS_PROJECT_PICKER_TYPE_PROJECT_PICKER, DialogsProjectPickerProjectPickerClass))
#define DIALOGS_PROJECT_PICKER_IS_PROJECT_PICKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIALOGS_PROJECT_PICKER_TYPE_PROJECT_PICKER))
#define DIALOGS_PROJECT_PICKER_IS_PROJECT_PICKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DIALOGS_PROJECT_PICKER_TYPE_PROJECT_PICKER))
#define DIALOGS_PROJECT_PICKER_PROJECT_PICKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DIALOGS_PROJECT_PICKER_TYPE_PROJECT_PICKER, DialogsProjectPickerProjectPickerClass))

typedef struct _DialogsProjectPickerProjectPicker DialogsProjectPickerProjectPicker;
typedef struct _DialogsProjectPickerProjectPickerClass DialogsProjectPickerProjectPickerClass;

#define TYPE_PLANIFY (planify_get_type ())
#define PLANIFY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_PLANIFY, Planify))
#define PLANIFY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_PLANIFY, PlanifyClass))
#define IS_PLANIFY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_PLANIFY))
#define IS_PLANIFY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_PLANIFY))
#define PLANIFY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_PLANIFY, PlanifyClass))

typedef struct _Planify Planify;
typedef struct _PlanifyClass PlanifyClass;
typedef struct _PlanifyPrivate PlanifyPrivate;

#define TYPE_MAIN_WINDOW (main_window_get_type ())
#define MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_MAIN_WINDOW, MainWindow))
#define MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_MAIN_WINDOW, MainWindowClass))
#define IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_MAIN_WINDOW))
#define IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_MAIN_WINDOW))
#define MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_MAIN_WINDOW, MainWindowClass))

typedef struct _MainWindow MainWindow;
typedef struct _MainWindowClass MainWindowClass;

#define DIALOGS_TYPE_ITEM_CHANGE_HISTORY (dialogs_item_change_history_get_type ())
#define DIALOGS_ITEM_CHANGE_HISTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIALOGS_TYPE_ITEM_CHANGE_HISTORY, DialogsItemChangeHistory))
#define DIALOGS_ITEM_CHANGE_HISTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DIALOGS_TYPE_ITEM_CHANGE_HISTORY, DialogsItemChangeHistoryClass))
#define DIALOGS_IS_ITEM_CHANGE_HISTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIALOGS_TYPE_ITEM_CHANGE_HISTORY))
#define DIALOGS_IS_ITEM_CHANGE_HISTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DIALOGS_TYPE_ITEM_CHANGE_HISTORY))
#define DIALOGS_ITEM_CHANGE_HISTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DIALOGS_TYPE_ITEM_CHANGE_HISTORY, DialogsItemChangeHistoryClass))

typedef struct _DialogsItemChangeHistory DialogsItemChangeHistory;
typedef struct _DialogsItemChangeHistoryClass DialogsItemChangeHistoryClass;

#define DIALOGS_TYPE_QUICK_ADD (dialogs_quick_add_get_type ())
#define DIALOGS_QUICK_ADD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIALOGS_TYPE_QUICK_ADD, DialogsQuickAdd))
#define DIALOGS_QUICK_ADD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DIALOGS_TYPE_QUICK_ADD, DialogsQuickAddClass))
#define DIALOGS_IS_QUICK_ADD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIALOGS_TYPE_QUICK_ADD))
#define DIALOGS_IS_QUICK_ADD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DIALOGS_TYPE_QUICK_ADD))
#define DIALOGS_QUICK_ADD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DIALOGS_TYPE_QUICK_ADD, DialogsQuickAddClass))

typedef struct _DialogsQuickAdd DialogsQuickAdd;
typedef struct _DialogsQuickAddClass DialogsQuickAddClass;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
#define _http_response_unref0(var) ((var == NULL) ? NULL : (var = (http_response_unref (var), NULL)))
typedef struct _LayoutsItemSidebarViewCompleteItemData LayoutsItemSidebarViewCompleteItemData;
typedef struct _Block43Data Block43Data;
typedef struct _Block44Data Block44Data;

#define WIDGETS_TYPE_SCROLLED_WINDOW (widgets_scrolled_window_get_type ())
#define WIDGETS_SCROLLED_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), WIDGETS_TYPE_SCROLLED_WINDOW, WidgetsScrolledWindow))
#define WIDGETS_SCROLLED_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), WIDGETS_TYPE_SCROLLED_WINDOW, WidgetsScrolledWindowClass))
#define WIDGETS_IS_SCROLLED_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WIDGETS_TYPE_SCROLLED_WINDOW))
#define WIDGETS_IS_SCROLLED_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), WIDGETS_TYPE_SCROLLED_WINDOW))
#define WIDGETS_SCROLLED_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), WIDGETS_TYPE_SCROLLED_WINDOW, WidgetsScrolledWindowClass))

typedef struct _WidgetsScrolledWindow WidgetsScrolledWindow;
typedef struct _WidgetsScrolledWindowClass WidgetsScrolledWindowClass;
typedef struct _Block45Data Block45Data;

struct _LayoutsItemSidebarView {
	AdwBin parent_instance;
	LayoutsItemSidebarViewPrivate * priv;
};

struct _LayoutsItemSidebarViewClass {
	AdwBinClass parent_class;
};

struct _LayoutsItemSidebarViewPrivate {
	ObjectsItem* _item;
	GtkButton* parent_back_button;
	GtkLabel* parent_label;
	GtkRevealer* spinner_revealer;
	WidgetsTextView* content_textview;
	WidgetsMarkdownEditor* markdown_editor;
	GtkRevealer* markdown_editor_revealer;
	WidgetsStatusButton* status_button;
	WidgetsScheduleButton* schedule_button;
	WidgetsPriorityButton* priority_button;
	WidgetsLabelPickerLabelButton* label_button;
	WidgetsPinButton* pin_button;
	WidgetsSectionPickerSectionButton* section_button;
	WidgetsReminderPickerReminderButton* reminder_button;
	WidgetsDeadlineButton* deadline_button;
	WidgetsSubItems* subitems;
	WidgetsAttachments* attachments;
	guint destroy_editor_timeout_id;
	WidgetsContextMenuMenuSwitch* use_note_item;
	WidgetsContextMenuMenuItem* copy_clipboard_item;
	WidgetsContextMenuMenuItem* duplicate_item;
	WidgetsContextMenuMenuItem* move_item;
	WidgetsContextMenuMenuItem* export_ics_item;
	GeeHashMap* signals_map;
	GeeHashMap* markdown_handlerses;
	gchar* _update_id;
};

struct _WidgetsSubItems {
	AdwBin parent_instance;
	WidgetsSubItemsPrivate * priv;
	WidgetsLoadingButton* add_button;
	GeeHashMap* items_map;
	GeeHashMap* items_checked;
};

struct _WidgetsSubItemsClass {
	AdwBinClass parent_class;
};

struct _WidgetsAttachments {
	AdwBin parent_instance;
	WidgetsAttachmentsPrivate * priv;
	WidgetsLoadingButton* add_button;
	GeeHashMap* attachments_map;
};

struct _WidgetsAttachmentsClass {
	AdwBinClass parent_class;
};

struct _Planify {
	AdwApplication parent_instance;
	PlanifyPrivate * priv;
	MainWindow* main_window;
};

struct _PlanifyClass {
	AdwApplicationClass parent_class;
};

struct _LayoutsItemSidebarViewCompleteItemData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	LayoutsItemSidebarView* self;
	gboolean old_checked;
	gchar* old_completed_at;
	HttpResponse* response;
	ObjectsItem* _tmp0_;
	HttpResponse* _tmp1_;
	HttpResponse* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp4_;
	HttpResponse* _tmp5_;
};

struct _Block43Data {
	int _ref_count_;
	LayoutsItemSidebarView* self;
	WidgetsMarkdownEditor* editor;
	AdwDialog* dialog;
};

struct _Block44Data {
	int _ref_count_;
	LayoutsItemSidebarView* self;
	SpellingTextBufferAdapter* adapter;
};

struct _Block45Data {
	int _ref_count_;
	LayoutsItemSidebarView* self;
	ObjectsReminder* reminder;
};

static gint LayoutsItemSidebarView_private_offset;
static gpointer layouts_item_sidebar_view_parent_class = NULL;
VALA_EXTERN Planify* planify__instance;

VALA_EXTERN GType layouts_item_sidebar_view_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LayoutsItemSidebarView, g_object_unref)
VALA_EXTERN GType widgets_sub_items_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WidgetsSubItems, g_object_unref)
VALA_EXTERN GType widgets_attachments_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WidgetsAttachments, g_object_unref)
static void layouts_item_sidebar_view_update_content_description (LayoutsItemSidebarView* self);
VALA_EXTERN ObjectsItem* layouts_item_sidebar_view_get_item (LayoutsItemSidebarView* self);
VALA_EXTERN const gchar* layouts_item_sidebar_view_get_update_id (LayoutsItemSidebarView* self);
VALA_EXTERN void layouts_item_sidebar_view_present_item (LayoutsItemSidebarView* self,
                                             ObjectsItem* _item);
VALA_EXTERN void layouts_item_sidebar_view_clean_up (LayoutsItemSidebarView* self);
VALA_EXTERN void layouts_item_sidebar_view_set_item (LayoutsItemSidebarView* self,
                                         ObjectsItem* value);
VALA_EXTERN void layouts_item_sidebar_view_set_update_id (LayoutsItemSidebarView* self,
                                              const gchar* value);
static void layouts_item_sidebar_view_build_markdown_editor (LayoutsItemSidebarView* self);
VALA_EXTERN void layouts_item_sidebar_view_update_request (LayoutsItemSidebarView* self);
VALA_EXTERN void widgets_sub_items_present_item (WidgetsSubItems* self,
                                     ObjectsItem* _item_parent);
VALA_EXTERN void widgets_sub_items_set_reveal_child (WidgetsSubItems* self,
                                         gboolean value);
VALA_EXTERN void widgets_attachments_present_item (WidgetsAttachments* self,
                                       ObjectsItem* _item);
static void __lambda503_ (LayoutsItemSidebarView* self,
                   ObjectsItem* _item);
static void ___lambda503__services_event_bus_checked_toggled (ServicesEventBus* _sender,
                                                       ObjectsItem* item,
                                                       gboolean old_checked,
                                                       gpointer self);
static void __lambda504_ (LayoutsItemSidebarView* self,
                   const gchar* _update_id);
static void ___lambda504__objects_base_object_updated (ObjectsBaseObject* _sender,
                                                const gchar* update_id,
                                                gpointer self);
static void __lambda505_ (LayoutsItemSidebarView* self);
static void ___lambda505__objects_item_pin_updated (ObjectsItem* _sender,
                                             gpointer self);
static void __lambda506_ (LayoutsItemSidebarView* self,
                   ObjectsReminder* reminder);
static void ___lambda506__objects_item_reminder_added (ObjectsItem* _sender,
                                                ObjectsReminder* reminder,
                                                gpointer self);
static void __lambda507_ (LayoutsItemSidebarView* self,
                   ObjectsReminder* reminder);
static void ___lambda507__objects_item_reminder_deleted (ObjectsItem* _sender,
                                                  ObjectsReminder* reminder,
                                                  gpointer self);
static void __lambda508_ (LayoutsItemSidebarView* self);
static void ___lambda508__objects_base_object_loading_change (ObjectsBaseObject* _sender,
                                                       gpointer self);
static void __lambda509_ (LayoutsItemSidebarView* self,
                   GDateTime* date);
VALA_EXTERN void layouts_item_sidebar_view_update_deadline (LayoutsItemSidebarView* self,
                                                GDateTime* date);
static void ___lambda509__widgets_deadline_button_date_selected (WidgetsDeadlineButton* _sender,
                                                          GDateTime* date,
                                                          gpointer self);
VALA_EXTERN void widgets_sub_items_clean_up (WidgetsSubItems* self);
VALA_EXTERN void widgets_attachments_clean_up (WidgetsAttachments* self);
static void layouts_item_sidebar_view_destroy_markdown_signals (LayoutsItemSidebarView* self);
static void layouts_item_sidebar_view_destroy_markdown_editor (LayoutsItemSidebarView* self);
static void layouts_item_sidebar_view_build_markdown_signals (LayoutsItemSidebarView* self);
VALA_EXTERN GType layouts_item_base_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (LayoutsItemBase, g_object_unref)
VALA_EXTERN GType widgets_attachment_row_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WidgetsAttachmentRow, g_object_unref)
VALA_EXTERN void layouts_item_sidebar_view_update_due (LayoutsItemSidebarView* self,
                                           ObjectsDueDate* duedate);
VALA_EXTERN void layouts_item_sidebar_view_update_labels (LayoutsItemSidebarView* self,
                                              GeeHashMap* new_labels);
static GtkPopover* layouts_item_sidebar_view_build_context_menu (LayoutsItemSidebarView* self);
static void __lambda510_ (LayoutsItemSidebarView* self);
static void ___lambda510__widgets_context_menu_menu_switch_activate_item (WidgetsContextMenuMenuSwitch* _sender,
                                                                   gpointer self);
static void __lambda511_ (LayoutsItemSidebarView* self);
static void ___lambda511__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda512_ (LayoutsItemSidebarView* self);
static void ___lambda512__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda513_ (LayoutsItemSidebarView* self);
VALA_EXTERN GType dialogs_project_picker_project_picker_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DialogsProjectPickerProjectPicker, g_object_unref)
VALA_EXTERN DialogsProjectPickerProjectPicker* dialogs_project_picker_project_picker_new_for_projects (void);
VALA_EXTERN DialogsProjectPickerProjectPicker* dialogs_project_picker_project_picker_construct_for_projects (GType object_type);
VALA_EXTERN void dialogs_project_picker_project_picker_set_project (DialogsProjectPickerProjectPicker* self,
                                                        ObjectsProject* value);
VALA_EXTERN GType planify_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (Planify, g_object_unref)
VALA_EXTERN GType main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MainWindow, g_object_unref)
static void __lambda514_ (LayoutsItemSidebarView* self,
                   const gchar* type,
                   const gchar* id);
VALA_EXTERN void layouts_item_sidebar_view_move (LayoutsItemSidebarView* self,
                                     ObjectsProject* project,
                                     const gchar* section_id,
                                     const gchar* parent_id);
static void ___lambda514__dialogs_project_picker_project_picker_changed (DialogsProjectPickerProjectPicker* _sender,
                                                                  const gchar* type,
                                                                  const gchar* id,
                                                                  gpointer self);
static void ___lambda513__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda515_ (LayoutsItemSidebarView* self);
VALA_EXTERN void layouts_item_sidebar_view_delete_request (LayoutsItemSidebarView* self,
                                               gboolean undo);
static void ___lambda515__widgets_context_menu_menu_item_activate_item (WidgetsContextMenuMenuItem* _sender,
                                                                 gpointer self);
static void __lambda517_ (LayoutsItemSidebarView* self);
VALA_EXTERN GType dialogs_item_change_history_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DialogsItemChangeHistory, g_object_unref)
VALA_EXTERN DialogsItemChangeHistory* dialogs_item_change_history_new (ObjectsItem* item);
VALA_EXTERN DialogsItemChangeHistory* dialogs_item_change_history_construct (GType object_type,
                                                                 ObjectsItem* item);
static void ___lambda517__widgets_context_menu_menu_item_activate_item (WidgetsContextMenuMenuItem* _sender,
                                                                 gpointer self);
static void __lambda518_ (LayoutsItemSidebarView* self);
static void ___lambda518__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda516_ (LayoutsItemSidebarView* self,
                   const gchar* response);
static void ___lambda516__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                              const gchar* response,
                                              gpointer self);
VALA_EXTERN void layouts_item_sidebar_view_prepare_new_item (LayoutsItemSidebarView* self,
                                                 const gchar* content);
VALA_EXTERN GType dialogs_quick_add_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DialogsQuickAdd, g_object_unref)
VALA_EXTERN DialogsQuickAdd* dialogs_quick_add_new (void);
VALA_EXTERN DialogsQuickAdd* dialogs_quick_add_construct (GType object_type);
VALA_EXTERN void dialogs_quick_add_for_base_object (DialogsQuickAdd* self,
                                        ObjectsBaseObject* base_object);
VALA_EXTERN void dialogs_quick_add_update_content (DialogsQuickAdd* self,
                                       const gchar* content);
VALA_EXTERN void layouts_item_sidebar_view_checked_toggled (LayoutsItemSidebarView* self,
                                                gboolean active);
static void layouts_item_sidebar_view_complete_item (LayoutsItemSidebarView* self,
                                              gboolean old_checked);
static void _layouts_item_sidebar_view_complete_item (LayoutsItemSidebarView* self,
                                               gboolean old_checked,
                                               const gchar* old_completed_at,
                                               GAsyncReadyCallback _callback_,
                                               gpointer _user_data_);
static void _layouts_item_sidebar_view_complete_item_finish (LayoutsItemSidebarView* self,
                                                      GAsyncResult* _res_);
static void layouts_item_sidebar_view_update_next_recurrency (LayoutsItemSidebarView* self);
static void _layouts_item_sidebar_view_complete_item_data_free (gpointer _data);
static gboolean _layouts_item_sidebar_view_complete_item_co (LayoutsItemSidebarViewCompleteItemData* _data_);
static void _layouts_item_sidebar_view_complete_item_ready (GObject* source_object,
                                                     GAsyncResult* _res_,
                                                     gpointer _user_data_);
static void _layouts_item_sidebar_view_complete_item_error (LayoutsItemSidebarView* self,
                                                     HttpResponse* response,
                                                     gboolean old_checked,
                                                     const gchar* old_completed_at);
static void __lambda519_ (LayoutsItemSidebarView* self,
                   GObject* obj,
                   GAsyncResult* res);
static void layouts_item_sidebar_view_recurrency_update_complete (LayoutsItemSidebarView* self,
                                                           GDateTime* next_recurrency);
static void ___lambda519__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void layouts_item_sidebar_view_init_markdown_editor (LayoutsItemSidebarView* self);
static void __lambda502_ (LayoutsItemSidebarView* self);
static void ___lambda502__widgets_markdown_editor_text_changed (WidgetsMarkdownEditor* _sender,
                                                         const gchar* text,
                                                         gpointer self);
static gboolean __lambda501_ (LayoutsItemSidebarView* self);
static gboolean ___lambda501__gsource_func (gpointer self);
static void layouts_item_sidebar_view_open_description_dialog (LayoutsItemSidebarView* self);
static Block43Data* block43_data_ref (Block43Data* _data43_);
static void block43_data_unref (void * _userdata_);
static void __lambda520_ (Block43Data* _data43_);
static void ___lambda520__widgets_markdown_editor_escape_pressed (WidgetsMarkdownEditor* _sender,
                                                           gpointer self);
static void __lambda521_ (Block43Data* _data43_);
static void ___lambda521__adw_dialog_closed (AdwDialog* _sender,
                                      gpointer self);
VALA_EXTERN LayoutsItemSidebarView* layouts_item_sidebar_view_new (void);
VALA_EXTERN LayoutsItemSidebarView* layouts_item_sidebar_view_construct (GType object_type);
VALA_EXTERN gboolean layouts_item_sidebar_view_get_show_completed (LayoutsItemSidebarView* self);
static GObject * layouts_item_sidebar_view_constructor (GType type,
                                                 guint n_construct_properties,
                                                 GObjectConstructParam * construct_properties);
static Block44Data* block44_data_ref (Block44Data* _data44_);
static void block44_data_unref (void * _userdata_);
static void _layouts_item_sidebar_view___lambda522_ (Block44Data* _data44_);
static void __layouts_item_sidebar_view___lambda522__g_settings_changed (GSettings* _sender,
                                                                  const gchar* key,
                                                                  gpointer self);
static void _layouts_item_sidebar_view___lambda523_ (LayoutsItemSidebarView* self);
static void __layouts_item_sidebar_view___lambda523__gtk_button_clicked (GtkButton* _sender,
                                                                  gpointer self);
VALA_EXTERN WidgetsSubItems* widgets_sub_items_new_for_board (void);
VALA_EXTERN WidgetsSubItems* widgets_sub_items_construct_for_board (GType object_type);
VALA_EXTERN WidgetsAttachments* widgets_attachments_new (gboolean is_board);
VALA_EXTERN WidgetsAttachments* widgets_attachments_construct (GType object_type,
                                                   gboolean is_board);
VALA_EXTERN void widgets_attachments_set_card (WidgetsAttachments* self,
                                   gboolean value);
VALA_EXTERN GType widgets_scrolled_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (WidgetsScrolledWindow, g_object_unref)
VALA_EXTERN WidgetsScrolledWindow* widgets_scrolled_window_new (GtkWidget* widget,
                                                    GtkOrientation orientation);
VALA_EXTERN WidgetsScrolledWindow* widgets_scrolled_window_construct (GType object_type,
                                                          GtkWidget* widget,
                                                          GtkOrientation orientation);
static void _layouts_item_sidebar_view___lambda524_ (LayoutsItemSidebarView* self);
static void __layouts_item_sidebar_view___lambda524__gtk_button_clicked (GtkButton* _sender,
                                                                  gpointer self);
static void _layouts_item_sidebar_view___lambda525_ (LayoutsItemSidebarView* self,
                                              guint keyval,
                                              guint keycode,
                                              GdkModifierType state);
static void __layouts_item_sidebar_view___lambda525__gtk_event_controller_key_key_released (GtkEventControllerKey* _sender,
                                                                                     guint keyval,
                                                                                     guint keycode,
                                                                                     GdkModifierType state,
                                                                                     gpointer self);
static void _layouts_item_sidebar_view___lambda526_ (LayoutsItemSidebarView* self);
static void __layouts_item_sidebar_view___lambda526__widgets_schedule_button_duedate_changed (WidgetsScheduleButton* _sender,
                                                                                       gpointer self);
static void _layouts_item_sidebar_view___lambda527_ (LayoutsItemSidebarView* self,
                                              gint priority);
static void __layouts_item_sidebar_view___lambda527__widgets_priority_button_changed (WidgetsPriorityButton* _sender,
                                                                               gint priority,
                                                                               gpointer self);
static void _layouts_item_sidebar_view___lambda528_ (LayoutsItemSidebarView* self,
                                              GeeHashMap* labels);
static void __layouts_item_sidebar_view___lambda528__widgets_label_picker_label_button_labels_changed (WidgetsLabelPickerLabelButton* _sender,
                                                                                                GeeHashMap* labels,
                                                                                                gpointer self);
static void _layouts_item_sidebar_view___lambda529_ (LayoutsItemSidebarView* self);
static void __layouts_item_sidebar_view___lambda529__widgets_pin_button_changed (WidgetsPinButton* _sender,
                                                                          gpointer self);
static void _layouts_item_sidebar_view___lambda530_ (LayoutsItemSidebarView* self,
                                              ObjectsSection* section);
static void __layouts_item_sidebar_view___lambda530__widgets_section_picker_section_button_selected (WidgetsSectionPickerSectionButton* _sender,
                                                                                              ObjectsSection* section,
                                                                                              gpointer self);
static void _layouts_item_sidebar_view___lambda531_ (LayoutsItemSidebarView* self,
                                              ObjectsReminder* reminder);
static Block45Data* block45_data_ref (Block45Data* _data45_);
static void block45_data_unref (void * _userdata_);
static void ___lambda532_ (Block45Data* _data45_,
                    GObject* obj,
                    GAsyncResult* res);
static void ____lambda532__gasync_ready_callback (GObject* source_object,
                                           GAsyncResult* res,
                                           gpointer self);
static void __layouts_item_sidebar_view___lambda531__widgets_reminder_picker_reminder_button_reminder_added (WidgetsReminderPickerReminderButton* _sender,
                                                                                                      ObjectsReminder* reminder,
                                                                                                      gpointer self);
static void _layouts_item_sidebar_view___lambda533_ (LayoutsItemSidebarView* self,
                                              gboolean active);
static void __layouts_item_sidebar_view___lambda533__widgets_status_button_changed (WidgetsStatusButton* _sender,
                                                                             gboolean status,
                                                                             gpointer self);
static void _layouts_item_sidebar_view___lambda534_ (LayoutsItemSidebarView* self);
static void __layouts_item_sidebar_view___lambda534__gtk_button_clicked (GtkButton* _sender,
                                                                  gpointer self);
static void layouts_item_sidebar_view_finalize (GObject * obj);
static GType layouts_item_sidebar_view_get_type_once (void);
static void _vala_layouts_item_sidebar_view_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec);
static void _vala_layouts_item_sidebar_view_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec);

static inline gpointer
layouts_item_sidebar_view_get_instance_private (LayoutsItemSidebarView* self)
{
	return G_STRUCT_MEMBER_P (self, LayoutsItemSidebarView_private_offset);
}

static gchar*
string_chomp (const gchar* self)
{
	gchar* _result_ = NULL;
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_strdup (self);
	_result_ = _tmp0_;
	g_strchomp (_result_);
	result = _result_;
	return result;
}

static void
layouts_item_sidebar_view_update_content_description (LayoutsItemSidebarView* self)
{
	gboolean _tmp0_ = FALSE;
	ObjectsItem* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	WidgetsTextView* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gboolean _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->_item;
	_tmp2_ = objects_item_get_content (_tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = self->priv->content_textview;
	_tmp5_ = widgets_text_view_get_text (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = g_strcmp0 (_tmp3_, _tmp6_) != 0;
	_g_free0 (_tmp6_);
	if (_tmp7_) {
		_tmp0_ = TRUE;
	} else {
		ObjectsItem* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		WidgetsMarkdownEditor* _tmp11_;
		gchar* _tmp12_;
		gchar* _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
		_tmp8_ = self->priv->_item;
		_tmp9_ = objects_item_get_description (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp11_ = self->priv->markdown_editor;
		_tmp12_ = widgets_markdown_editor_get_text (_tmp11_);
		_tmp13_ = _tmp12_;
		_tmp14_ = string_chomp (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp0_ = g_strcmp0 (_tmp10_, _tmp15_) != 0;
		_g_free0 (_tmp15_);
		_g_free0 (_tmp13_);
	}
	if (_tmp0_) {
		ObjectsItem* _tmp16_;
		WidgetsTextView* _tmp17_;
		gchar* _tmp18_;
		gchar* _tmp19_;
		ItemType _tmp20_ = 0;
		ObjectsItem* _tmp21_;
		const gchar* _tmp22_;
		const gchar* _tmp23_;
		ObjectsItem* _tmp24_;
		WidgetsContextMenuMenuSwitch* _tmp25_;
		ObjectsItem* _tmp26_;
		ItemType _tmp27_;
		ItemType _tmp28_;
		ObjectsItem* _tmp29_;
		WidgetsMarkdownEditor* _tmp30_;
		gchar* _tmp31_;
		gchar* _tmp32_;
		gchar* _tmp33_;
		gchar* _tmp34_;
		ObjectsItem* _tmp35_;
		const gchar* _tmp36_;
		_tmp16_ = self->priv->_item;
		_tmp17_ = self->priv->content_textview;
		_tmp18_ = widgets_text_view_get_text (_tmp17_);
		_tmp19_ = _tmp18_;
		objects_item_set_content (_tmp16_, _tmp19_);
		_g_free0 (_tmp19_);
		_tmp21_ = self->priv->_item;
		_tmp22_ = objects_item_get_content (_tmp21_);
		_tmp23_ = _tmp22_;
		if (g_str_has_prefix (_tmp23_, "* ")) {
			_tmp20_ = ITEM_TYPE_NOTE;
		} else {
			_tmp20_ = ITEM_TYPE_TASK;
		}
		_tmp24_ = self->priv->_item;
		objects_item_set_item_type (_tmp24_, _tmp20_);
		_tmp25_ = self->priv->use_note_item;
		_tmp26_ = self->priv->_item;
		_tmp27_ = objects_item_get_item_type (_tmp26_);
		_tmp28_ = _tmp27_;
		widgets_context_menu_menu_switch_set_active (_tmp25_, _tmp28_ == ITEM_TYPE_NOTE);
		_tmp29_ = self->priv->_item;
		_tmp30_ = self->priv->markdown_editor;
		_tmp31_ = widgets_markdown_editor_get_text (_tmp30_);
		_tmp32_ = _tmp31_;
		_tmp33_ = string_chomp (_tmp32_);
		_tmp34_ = _tmp33_;
		objects_item_set_description (_tmp29_, _tmp34_);
		_g_free0 (_tmp34_);
		_g_free0 (_tmp32_);
		_tmp35_ = self->priv->_item;
		_tmp36_ = self->priv->_update_id;
		objects_item_update_async_timeout (_tmp35_, _tmp36_);
	}
}

static void
__lambda503_ (LayoutsItemSidebarView* self,
              ObjectsItem* _item)
{
	ObjectsItem* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	g_return_if_fail (_item != NULL);
	_tmp0_ = self->priv->_item;
	_tmp1_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = objects_base_object_get_id ((ObjectsBaseObject*) _item);
	_tmp4_ = _tmp3_;
	if (g_strcmp0 (_tmp2_, _tmp4_) == 0) {
		layouts_item_sidebar_view_update_request (self);
	}
}

static void
___lambda503__services_event_bus_checked_toggled (ServicesEventBus* _sender,
                                                  ObjectsItem* item,
                                                  gboolean old_checked,
                                                  gpointer self)
{
	__lambda503_ ((LayoutsItemSidebarView*) self, item);
}

static void
__lambda504_ (LayoutsItemSidebarView* self,
              const gchar* _update_id)
{
	const gchar* _tmp0_;
	g_return_if_fail (_update_id != NULL);
	_tmp0_ = self->priv->_update_id;
	if (g_strcmp0 (_tmp0_, _update_id) != 0) {
		layouts_item_sidebar_view_update_request (self);
	}
}

static void
___lambda504__objects_base_object_updated (ObjectsBaseObject* _sender,
                                           const gchar* update_id,
                                           gpointer self)
{
	__lambda504_ ((LayoutsItemSidebarView*) self, update_id);
}

static void
__lambda505_ (LayoutsItemSidebarView* self)
{
	WidgetsPinButton* _tmp0_;
	ObjectsItem* _tmp1_;
	_tmp0_ = self->priv->pin_button;
	_tmp1_ = self->priv->_item;
	widgets_pin_button_update_from_item (_tmp0_, _tmp1_);
}

static void
___lambda505__objects_item_pin_updated (ObjectsItem* _sender,
                                        gpointer self)
{
	__lambda505_ ((LayoutsItemSidebarView*) self);
}

static void
__lambda506_ (LayoutsItemSidebarView* self,
              ObjectsReminder* reminder)
{
	WidgetsReminderPickerReminderButton* _tmp0_;
	ObjectsItem* _tmp1_;
	GeeArrayList* _tmp2_;
	GeeArrayList* _tmp3_;
	g_return_if_fail (reminder != NULL);
	_tmp0_ = self->priv->reminder_button;
	_tmp1_ = self->priv->_item;
	_tmp2_ = objects_item_get_reminders (_tmp1_);
	_tmp3_ = _tmp2_;
	widgets_reminder_picker_reminder_button_add_reminder (_tmp0_, reminder, _tmp3_);
}

static void
___lambda506__objects_item_reminder_added (ObjectsItem* _sender,
                                           ObjectsReminder* reminder,
                                           gpointer self)
{
	__lambda506_ ((LayoutsItemSidebarView*) self, reminder);
}

static void
__lambda507_ (LayoutsItemSidebarView* self,
              ObjectsReminder* reminder)
{
	WidgetsReminderPickerReminderButton* _tmp0_;
	ObjectsItem* _tmp1_;
	GeeArrayList* _tmp2_;
	GeeArrayList* _tmp3_;
	g_return_if_fail (reminder != NULL);
	_tmp0_ = self->priv->reminder_button;
	_tmp1_ = self->priv->_item;
	_tmp2_ = objects_item_get_reminders (_tmp1_);
	_tmp3_ = _tmp2_;
	widgets_reminder_picker_reminder_button_delete_reminder (_tmp0_, reminder, _tmp3_);
}

static void
___lambda507__objects_item_reminder_deleted (ObjectsItem* _sender,
                                             ObjectsReminder* reminder,
                                             gpointer self)
{
	__lambda507_ ((LayoutsItemSidebarView*) self, reminder);
}

static void
__lambda508_ (LayoutsItemSidebarView* self)
{
	GtkRevealer* _tmp0_;
	ObjectsItem* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	_tmp0_ = self->priv->spinner_revealer;
	_tmp1_ = self->priv->_item;
	_tmp2_ = objects_base_object_get_loading ((ObjectsBaseObject*) _tmp1_);
	_tmp3_ = _tmp2_;
	gtk_revealer_set_reveal_child (_tmp0_, _tmp3_);
}

static void
___lambda508__objects_base_object_loading_change (ObjectsBaseObject* _sender,
                                                  gpointer self)
{
	__lambda508_ ((LayoutsItemSidebarView*) self);
}

static void
__lambda509_ (LayoutsItemSidebarView* self,
              GDateTime* date)
{
	layouts_item_sidebar_view_update_deadline (self, date);
}

static void
___lambda509__widgets_deadline_button_date_selected (WidgetsDeadlineButton* _sender,
                                                     GDateTime* date,
                                                     gpointer self)
{
	__lambda509_ ((LayoutsItemSidebarView*) self, date);
}

void
layouts_item_sidebar_view_present_item (LayoutsItemSidebarView* self,
                                        ObjectsItem* _item)
{
	gboolean always_show = FALSE;
	ServicesSettings* _tmp0_;
	ServicesSettings* _tmp1_;
	GSettings* _tmp2_;
	gboolean _tmp3_;
	Util* _tmp4_;
	Util* _tmp5_;
	gchar* _tmp6_;
	gchar* _tmp7_;
	WidgetsLabelPickerLabelButton* _tmp8_;
	ObjectsItem* _tmp9_;
	ObjectsProject* _tmp10_;
	ObjectsProject* _tmp11_;
	ObjectsSource* _tmp12_;
	ObjectsSource* _tmp13_;
	WidgetsSubItems* _tmp14_;
	ObjectsItem* _tmp15_;
	WidgetsSubItems* _tmp16_;
	WidgetsAttachments* _tmp17_;
	ObjectsItem* _tmp18_;
	GtkRevealer* _tmp19_;
	ObjectsItem* _tmp20_;
	gboolean _tmp21_;
	gboolean _tmp22_;
	WidgetsTextView* _tmp62_;
	GeeHashMap* _tmp63_;
	ServicesEventBus* _tmp64_;
	ServicesEventBus* _tmp65_;
	gulong _tmp66_;
	ServicesEventBus* _tmp67_;
	ServicesEventBus* _tmp68_;
	GeeHashMap* _tmp69_;
	ObjectsItem* _tmp70_;
	gulong _tmp71_;
	ObjectsItem* _tmp72_;
	GeeHashMap* _tmp73_;
	ObjectsItem* _tmp74_;
	gulong _tmp75_;
	ObjectsItem* _tmp76_;
	GeeHashMap* _tmp77_;
	ObjectsItem* _tmp78_;
	gulong _tmp79_;
	ObjectsItem* _tmp80_;
	GeeHashMap* _tmp81_;
	ObjectsItem* _tmp82_;
	gulong _tmp83_;
	ObjectsItem* _tmp84_;
	GeeHashMap* _tmp85_;
	ObjectsItem* _tmp86_;
	gulong _tmp87_;
	ObjectsItem* _tmp88_;
	GeeHashMap* _tmp89_;
	WidgetsDeadlineButton* _tmp90_;
	gulong _tmp91_;
	WidgetsDeadlineButton* _tmp92_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (_item != NULL);
	_tmp0_ = services_settings_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_->settings;
	_tmp3_ = g_settings_get_boolean (_tmp2_, "always-show-details-sidebar");
	_g_object_unref0 (_tmp1_);
	always_show = _tmp3_;
	if (always_show) {
		layouts_item_sidebar_view_clean_up (self);
	}
	layouts_item_sidebar_view_set_item (self, _item);
	_tmp4_ = util_get_default ();
	_tmp5_ = _tmp4_;
	_tmp6_ = util_generate_id (_tmp5_, NULL);
	_tmp7_ = _tmp6_;
	layouts_item_sidebar_view_set_update_id (self, _tmp7_);
	_g_free0 (_tmp7_);
	_g_object_unref0 (_tmp5_);
	layouts_item_sidebar_view_build_markdown_editor (self);
	_tmp8_ = self->priv->label_button;
	_tmp9_ = self->priv->_item;
	_tmp10_ = objects_item_get_project (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = objects_project_get_source (_tmp11_);
	_tmp13_ = _tmp12_;
	widgets_label_picker_label_button_set_source (_tmp8_, _tmp13_);
	layouts_item_sidebar_view_update_request (self);
	_tmp14_ = self->priv->subitems;
	_tmp15_ = self->priv->_item;
	widgets_sub_items_present_item (_tmp14_, _tmp15_);
	_tmp16_ = self->priv->subitems;
	widgets_sub_items_set_reveal_child (_tmp16_, TRUE);
	_tmp17_ = self->priv->attachments;
	_tmp18_ = self->priv->_item;
	widgets_attachments_present_item (_tmp17_, _tmp18_);
	_tmp19_ = self->priv->spinner_revealer;
	gtk_revealer_set_reveal_child (_tmp19_, FALSE);
	_tmp20_ = self->priv->_item;
	_tmp21_ = objects_item_get_has_parent (_tmp20_);
	_tmp22_ = _tmp21_;
	if (_tmp22_) {
		GtkLabel* _tmp23_;
		ObjectsItem* _tmp24_;
		ObjectsItem* _tmp25_;
		ObjectsItem* _tmp26_;
		const gchar* _tmp27_;
		const gchar* _tmp28_;
		GtkLabel* _tmp29_;
		ObjectsItem* _tmp30_;
		ObjectsItem* _tmp31_;
		ObjectsItem* _tmp32_;
		const gchar* _tmp33_;
		const gchar* _tmp34_;
		_tmp23_ = self->priv->parent_label;
		_tmp24_ = self->priv->_item;
		_tmp25_ = objects_item_get_parent (_tmp24_);
		_tmp26_ = _tmp25_;
		_tmp27_ = objects_item_get_content (_tmp26_);
		_tmp28_ = _tmp27_;
		gtk_label_set_label (_tmp23_, _tmp28_);
		_tmp29_ = self->priv->parent_label;
		_tmp30_ = self->priv->_item;
		_tmp31_ = objects_item_get_parent (_tmp30_);
		_tmp32_ = _tmp31_;
		_tmp33_ = objects_item_get_content (_tmp32_);
		_tmp34_ = _tmp33_;
		gtk_widget_set_tooltip_text ((GtkWidget*) _tmp29_, _tmp34_);
	} else {
		ObjectsItem* _tmp35_;
		const gchar* _tmp36_;
		const gchar* _tmp37_;
		_tmp35_ = self->priv->_item;
		_tmp36_ = objects_item_get_section_id (_tmp35_);
		_tmp37_ = _tmp36_;
		if (g_strcmp0 (_tmp37_, "") != 0) {
			GtkLabel* _tmp38_;
			ObjectsItem* _tmp39_;
			ObjectsSection* _tmp40_;
			ObjectsSection* _tmp41_;
			const gchar* _tmp42_;
			const gchar* _tmp43_;
			GtkLabel* _tmp44_;
			ObjectsItem* _tmp45_;
			ObjectsSection* _tmp46_;
			ObjectsSection* _tmp47_;
			const gchar* _tmp48_;
			const gchar* _tmp49_;
			_tmp38_ = self->priv->parent_label;
			_tmp39_ = self->priv->_item;
			_tmp40_ = objects_item_get_section (_tmp39_);
			_tmp41_ = _tmp40_;
			_tmp42_ = objects_base_object_get_name ((ObjectsBaseObject*) _tmp41_);
			_tmp43_ = _tmp42_;
			gtk_label_set_label (_tmp38_, _tmp43_);
			_tmp44_ = self->priv->parent_label;
			_tmp45_ = self->priv->_item;
			_tmp46_ = objects_item_get_section (_tmp45_);
			_tmp47_ = _tmp46_;
			_tmp48_ = objects_base_object_get_name ((ObjectsBaseObject*) _tmp47_);
			_tmp49_ = _tmp48_;
			gtk_widget_set_tooltip_text ((GtkWidget*) _tmp44_, _tmp49_);
		} else {
			GtkLabel* _tmp50_;
			ObjectsItem* _tmp51_;
			ObjectsProject* _tmp52_;
			ObjectsProject* _tmp53_;
			const gchar* _tmp54_;
			const gchar* _tmp55_;
			GtkLabel* _tmp56_;
			ObjectsItem* _tmp57_;
			ObjectsProject* _tmp58_;
			ObjectsProject* _tmp59_;
			const gchar* _tmp60_;
			const gchar* _tmp61_;
			_tmp50_ = self->priv->parent_label;
			_tmp51_ = self->priv->_item;
			_tmp52_ = objects_item_get_project (_tmp51_);
			_tmp53_ = _tmp52_;
			_tmp54_ = objects_base_object_get_name ((ObjectsBaseObject*) _tmp53_);
			_tmp55_ = _tmp54_;
			gtk_label_set_label (_tmp50_, _tmp55_);
			_tmp56_ = self->priv->parent_label;
			_tmp57_ = self->priv->_item;
			_tmp58_ = objects_item_get_project (_tmp57_);
			_tmp59_ = _tmp58_;
			_tmp60_ = objects_base_object_get_name ((ObjectsBaseObject*) _tmp59_);
			_tmp61_ = _tmp60_;
			gtk_widget_set_tooltip_text ((GtkWidget*) _tmp56_, _tmp61_);
		}
	}
	_tmp62_ = self->priv->content_textview;
	gtk_widget_grab_focus ((GtkWidget*) _tmp62_);
	_tmp63_ = self->priv->signals_map;
	_tmp64_ = services_event_bus_get_default ();
	_tmp65_ = _tmp64_;
	_tmp66_ = g_signal_connect_object (_tmp65_, "checked-toggled", (GCallback) ___lambda503__services_event_bus_checked_toggled, self, 0);
	_tmp67_ = services_event_bus_get_default ();
	_tmp68_ = _tmp67_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp63_, (gpointer) ((guintptr) _tmp66_), (GObject*) _tmp68_);
	_g_object_unref0 (_tmp68_);
	_g_object_unref0 (_tmp65_);
	_tmp69_ = self->priv->signals_map;
	_tmp70_ = self->priv->_item;
	_tmp71_ = g_signal_connect_object ((ObjectsBaseObject*) _tmp70_, "updated", (GCallback) ___lambda504__objects_base_object_updated, self, 0);
	_tmp72_ = self->priv->_item;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp69_, (gpointer) ((guintptr) _tmp71_), (GObject*) _tmp72_);
	_tmp73_ = self->priv->signals_map;
	_tmp74_ = self->priv->_item;
	_tmp75_ = g_signal_connect_object (_tmp74_, "pin-updated", (GCallback) ___lambda505__objects_item_pin_updated, self, 0);
	_tmp76_ = self->priv->_item;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp73_, (gpointer) ((guintptr) _tmp75_), (GObject*) _tmp76_);
	_tmp77_ = self->priv->signals_map;
	_tmp78_ = self->priv->_item;
	_tmp79_ = g_signal_connect_object (_tmp78_, "reminder-added", (GCallback) ___lambda506__objects_item_reminder_added, self, 0);
	_tmp80_ = self->priv->_item;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp77_, (gpointer) ((guintptr) _tmp79_), (GObject*) _tmp80_);
	_tmp81_ = self->priv->signals_map;
	_tmp82_ = self->priv->_item;
	_tmp83_ = g_signal_connect_object (_tmp82_, "reminder-deleted", (GCallback) ___lambda507__objects_item_reminder_deleted, self, 0);
	_tmp84_ = self->priv->_item;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp81_, (gpointer) ((guintptr) _tmp83_), (GObject*) _tmp84_);
	_tmp85_ = self->priv->signals_map;
	_tmp86_ = self->priv->_item;
	_tmp87_ = g_signal_connect_object ((ObjectsBaseObject*) _tmp86_, "loading-change", (GCallback) ___lambda508__objects_base_object_loading_change, self, 0);
	_tmp88_ = self->priv->_item;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp85_, (gpointer) ((guintptr) _tmp87_), (GObject*) _tmp88_);
	_tmp89_ = self->priv->signals_map;
	_tmp90_ = self->priv->deadline_button;
	_tmp91_ = g_signal_connect_object (_tmp90_, "date-selected", (GCallback) ___lambda509__widgets_deadline_button_date_selected, self, 0);
	_tmp92_ = self->priv->deadline_button;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp89_, (gpointer) ((guintptr) _tmp91_), (GObject*) _tmp92_);
}

void
layouts_item_sidebar_view_clean_up (LayoutsItemSidebarView* self)
{
	GeeHashMap* _tmp15_;
	WidgetsSubItems* _tmp16_;
	WidgetsAttachments* _tmp17_;
	g_return_if_fail (self != NULL);
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp0_;
		GeeSet* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
		_tmp0_ = self->priv->signals_map;
		_tmp1_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_entry_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp7_;
			gpointer _tmp8_;
			GeeMapEntry* _tmp9_;
			gconstpointer _tmp10_;
			gconstpointer _tmp11_;
			GeeMapEntry* _tmp12_;
			gconstpointer _tmp13_;
			gconstpointer _tmp14_;
			_tmp6_ = _entry_it;
			if (!gee_iterator_next (_tmp6_)) {
				break;
			}
			_tmp7_ = _entry_it;
			_tmp8_ = gee_iterator_get (_tmp7_);
			entry = (GeeMapEntry*) _tmp8_;
			_tmp9_ = entry;
			_tmp10_ = gee_map_entry_get_value (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = entry;
			_tmp13_ = gee_map_entry_get_key (_tmp12_);
			_tmp14_ = _tmp13_;
			g_signal_handler_disconnect ((GObject*) _tmp11_, (gulong) ((guintptr) _tmp14_));
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	_tmp15_ = self->priv->signals_map;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp15_);
	_tmp16_ = self->priv->subitems;
	widgets_sub_items_clean_up (_tmp16_);
	_tmp17_ = self->priv->attachments;
	widgets_attachments_clean_up (_tmp17_);
	layouts_item_sidebar_view_destroy_markdown_signals (self);
	layouts_item_sidebar_view_destroy_markdown_editor (self);
}

void
layouts_item_sidebar_view_update_request (LayoutsItemSidebarView* self)
{
	gboolean _tmp0_ = FALSE;
	WidgetsTextView* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	WidgetsMarkdownEditor* _tmp14_;
	WidgetsScheduleButton* _tmp33_;
	ObjectsItem* _tmp34_;
	WidgetsPriorityButton* _tmp35_;
	ObjectsItem* _tmp36_;
	WidgetsStatusButton* _tmp37_;
	ObjectsItem* _tmp38_;
	WidgetsLabelPickerLabelButton* _tmp39_;
	ObjectsItem* _tmp40_;
	GeeArrayList* _tmp41_;
	GeeArrayList* _tmp42_;
	WidgetsLabelPickerLabelButton* _tmp43_;
	ObjectsItem* _tmp44_;
	WidgetsPinButton* _tmp45_;
	ObjectsItem* _tmp46_;
	WidgetsSectionPickerSectionButton* _tmp47_;
	ObjectsItem* _tmp48_;
	ObjectsProject* _tmp49_;
	ObjectsProject* _tmp50_;
	GeeArrayList* _tmp51_;
	GeeArrayList* _tmp52_;
	WidgetsSectionPickerSectionButton* _tmp53_;
	ObjectsItem* _tmp54_;
	WidgetsReminderPickerReminderButton* _tmp55_;
	ObjectsItem* _tmp56_;
	GeeArrayList* _tmp57_;
	GeeArrayList* _tmp58_;
	WidgetsDeadlineButton* _tmp59_;
	ObjectsItem* _tmp60_;
	GDateTime* _tmp61_;
	GDateTime* _tmp62_;
	WidgetsTextView* _tmp63_;
	ObjectsItem* _tmp64_;
	gboolean _tmp65_;
	gboolean _tmp66_;
	WidgetsMarkdownEditor* _tmp67_;
	ObjectsItem* _tmp68_;
	gboolean _tmp69_;
	gboolean _tmp70_;
	WidgetsScheduleButton* _tmp71_;
	ObjectsItem* _tmp72_;
	gboolean _tmp73_;
	gboolean _tmp74_;
	WidgetsPriorityButton* _tmp75_;
	ObjectsItem* _tmp76_;
	gboolean _tmp77_;
	gboolean _tmp78_;
	WidgetsLabelPickerLabelButton* _tmp79_;
	ObjectsItem* _tmp80_;
	gboolean _tmp81_;
	gboolean _tmp82_;
	WidgetsPinButton* _tmp83_;
	ObjectsItem* _tmp84_;
	gboolean _tmp85_;
	gboolean _tmp86_;
	WidgetsSectionPickerSectionButton* _tmp87_;
	ObjectsItem* _tmp88_;
	gboolean _tmp89_;
	gboolean _tmp90_;
	WidgetsReminderPickerReminderButton* _tmp91_;
	ObjectsItem* _tmp92_;
	gboolean _tmp93_;
	gboolean _tmp94_;
	WidgetsContextMenuMenuItem* _tmp95_;
	ObjectsItem* _tmp96_;
	gboolean _tmp97_;
	gboolean _tmp98_;
	WidgetsContextMenuMenuItem* _tmp99_;
	ObjectsItem* _tmp100_;
	gboolean _tmp101_;
	gboolean _tmp102_;
	WidgetsContextMenuMenuItem* _tmp103_;
	ObjectsItem* _tmp104_;
	gboolean _tmp105_;
	gboolean _tmp106_;
	WidgetsSubItems* _tmp107_;
	WidgetsLoadingButton* _tmp108_;
	ObjectsItem* _tmp109_;
	gboolean _tmp110_;
	gboolean _tmp111_;
	WidgetsAttachments* _tmp112_;
	WidgetsLoadingButton* _tmp113_;
	ObjectsItem* _tmp114_;
	gboolean _tmp115_;
	gboolean _tmp116_;
	WidgetsContextMenuMenuSwitch* _tmp117_;
	ObjectsItem* _tmp118_;
	ItemType _tmp119_;
	ItemType _tmp120_;
	WidgetsStatusButton* _tmp121_;
	ObjectsItem* _tmp122_;
	ItemType _tmp123_;
	ItemType _tmp124_;
	GtkButton* _tmp125_;
	ObjectsItem* _tmp126_;
	gboolean _tmp127_;
	gboolean _tmp128_;
	WidgetsDeadlineButton* _tmp129_;
	ObjectsItem* _tmp130_;
	gboolean _tmp131_;
	gboolean _tmp132_;
	WidgetsContextMenuMenuItem* _tmp133_;
	ObjectsItem* _tmp134_;
	ObjectsProject* _tmp135_;
	ObjectsProject* _tmp136_;
	SourceType _tmp137_;
	SourceType _tmp138_;
	ObjectsItem* _tmp139_;
	gboolean _tmp140_;
	gboolean _tmp141_;
	g_return_if_fail (self != NULL);
	_tmp1_ = self->priv->content_textview;
	g_object_get ((GtkWidget*) _tmp1_, "has-focus", &_tmp2_, NULL);
	_tmp3_ = _tmp2_;
	if (!_tmp3_) {
		_tmp0_ = TRUE;
	} else {
		WidgetsTextView* _tmp4_;
		gchar* _tmp5_;
		gchar* _tmp6_;
		ObjectsItem* _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		_tmp4_ = self->priv->content_textview;
		_tmp5_ = widgets_text_view_get_text (_tmp4_);
		_tmp6_ = _tmp5_;
		_tmp7_ = self->priv->_item;
		_tmp8_ = objects_item_get_content (_tmp7_);
		_tmp9_ = _tmp8_;
		_tmp0_ = g_strcmp0 (_tmp6_, _tmp9_) == 0;
		_g_free0 (_tmp6_);
	}
	if (_tmp0_) {
		WidgetsTextView* _tmp10_;
		ObjectsItem* _tmp11_;
		const gchar* _tmp12_;
		const gchar* _tmp13_;
		_tmp10_ = self->priv->content_textview;
		_tmp11_ = self->priv->_item;
		_tmp12_ = objects_item_get_content (_tmp11_);
		_tmp13_ = _tmp12_;
		widgets_text_view_set_text (_tmp10_, _tmp13_);
	}
	_tmp14_ = self->priv->markdown_editor;
	if (_tmp14_ != NULL) {
		gchar* current_text = NULL;
		WidgetsMarkdownEditor* _tmp15_;
		gchar* _tmp16_;
		gchar* _tmp17_;
		gchar* _tmp18_;
		gchar* _tmp19_;
		gboolean _tmp20_ = FALSE;
		WidgetsMarkdownEditor* _tmp21_;
		GtkTextView* _tmp22_;
		gboolean _tmp23_;
		gboolean _tmp24_;
		_tmp15_ = self->priv->markdown_editor;
		_tmp16_ = widgets_markdown_editor_get_text (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = string_chomp (_tmp17_);
		_tmp19_ = _tmp18_;
		_g_free0 (_tmp17_);
		current_text = _tmp19_;
		_tmp21_ = self->priv->markdown_editor;
		_tmp22_ = _tmp21_->text_view;
		g_object_get ((GtkWidget*) _tmp22_, "has-focus", &_tmp23_, NULL);
		_tmp24_ = _tmp23_;
		if (!_tmp24_) {
			_tmp20_ = TRUE;
		} else {
			const gchar* _tmp25_;
			ObjectsItem* _tmp26_;
			const gchar* _tmp27_;
			const gchar* _tmp28_;
			_tmp25_ = current_text;
			_tmp26_ = self->priv->_item;
			_tmp27_ = objects_item_get_description (_tmp26_);
			_tmp28_ = _tmp27_;
			_tmp20_ = g_strcmp0 (_tmp25_, _tmp28_) == 0;
		}
		if (_tmp20_) {
			WidgetsMarkdownEditor* _tmp29_;
			ObjectsItem* _tmp30_;
			const gchar* _tmp31_;
			const gchar* _tmp32_;
			layouts_item_sidebar_view_destroy_markdown_signals (self);
			_tmp29_ = self->priv->markdown_editor;
			_tmp30_ = self->priv->_item;
			_tmp31_ = objects_item_get_description (_tmp30_);
			_tmp32_ = _tmp31_;
			widgets_markdown_editor_set_text (_tmp29_, _tmp32_);
			layouts_item_sidebar_view_build_markdown_signals (self);
		}
		_g_free0 (current_text);
	}
	_tmp33_ = self->priv->schedule_button;
	_tmp34_ = self->priv->_item;
	widgets_schedule_button_update_from_item (_tmp33_, _tmp34_);
	_tmp35_ = self->priv->priority_button;
	_tmp36_ = self->priv->_item;
	widgets_priority_button_update_from_item (_tmp35_, _tmp36_);
	_tmp37_ = self->priv->status_button;
	_tmp38_ = self->priv->_item;
	widgets_status_button_update_from_item (_tmp37_, _tmp38_);
	_tmp39_ = self->priv->label_button;
	_tmp40_ = self->priv->_item;
	_tmp41_ = objects_item_get_labels_list (_tmp40_);
	_tmp42_ = _tmp41_;
	widgets_label_picker_label_button_set_labels (_tmp39_, _tmp42_);
	_g_object_unref0 (_tmp42_);
	_tmp43_ = self->priv->label_button;
	_tmp44_ = self->priv->_item;
	widgets_label_picker_label_button_update_tooltip_from_item (_tmp43_, _tmp44_);
	_tmp45_ = self->priv->pin_button;
	_tmp46_ = self->priv->_item;
	widgets_pin_button_update_from_item (_tmp45_, _tmp46_);
	_tmp47_ = self->priv->section_button;
	_tmp48_ = self->priv->_item;
	_tmp49_ = objects_item_get_project (_tmp48_);
	_tmp50_ = _tmp49_;
	_tmp51_ = objects_project_get_sections (_tmp50_);
	_tmp52_ = _tmp51_;
	widgets_section_picker_section_button_set_sections (_tmp47_, _tmp52_);
	_tmp53_ = self->priv->section_button;
	_tmp54_ = self->priv->_item;
	widgets_section_picker_section_button_update_from_item (_tmp53_, _tmp54_);
	_tmp55_ = self->priv->reminder_button;
	_tmp56_ = self->priv->_item;
	_tmp57_ = objects_item_get_reminders (_tmp56_);
	_tmp58_ = _tmp57_;
	widgets_reminder_picker_reminder_button_set_reminders (_tmp55_, _tmp58_);
	_tmp59_ = self->priv->deadline_button;
	_tmp60_ = self->priv->_item;
	_tmp61_ = objects_item_get_deadline_datetime (_tmp60_);
	_tmp62_ = _tmp61_;
	widgets_deadline_button_set_datetime (_tmp59_, _tmp62_);
	_tmp63_ = self->priv->content_textview;
	_tmp64_ = self->priv->_item;
	_tmp65_ = objects_item_get_completed (_tmp64_);
	_tmp66_ = _tmp65_;
	gtk_text_view_set_editable ((GtkTextView*) _tmp63_, !_tmp66_);
	_tmp67_ = self->priv->markdown_editor;
	_tmp68_ = self->priv->_item;
	_tmp69_ = objects_item_get_completed (_tmp68_);
	_tmp70_ = _tmp69_;
	widgets_markdown_editor_set_is_editable (_tmp67_, !_tmp70_);
	_tmp71_ = self->priv->schedule_button;
	_tmp72_ = self->priv->_item;
	_tmp73_ = objects_item_get_completed (_tmp72_);
	_tmp74_ = _tmp73_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp71_, !_tmp74_);
	_tmp75_ = self->priv->priority_button;
	_tmp76_ = self->priv->_item;
	_tmp77_ = objects_item_get_completed (_tmp76_);
	_tmp78_ = _tmp77_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp75_, !_tmp78_);
	_tmp79_ = self->priv->label_button;
	_tmp80_ = self->priv->_item;
	_tmp81_ = objects_item_get_completed (_tmp80_);
	_tmp82_ = _tmp81_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp79_, !_tmp82_);
	_tmp83_ = self->priv->pin_button;
	_tmp84_ = self->priv->_item;
	_tmp85_ = objects_item_get_completed (_tmp84_);
	_tmp86_ = _tmp85_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp83_, !_tmp86_);
	_tmp87_ = self->priv->section_button;
	_tmp88_ = self->priv->_item;
	_tmp89_ = objects_item_get_completed (_tmp88_);
	_tmp90_ = _tmp89_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp87_, !_tmp90_);
	_tmp91_ = self->priv->reminder_button;
	_tmp92_ = self->priv->_item;
	_tmp93_ = objects_item_get_completed (_tmp92_);
	_tmp94_ = _tmp93_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp91_, !_tmp94_);
	_tmp95_ = self->priv->copy_clipboard_item;
	_tmp96_ = self->priv->_item;
	_tmp97_ = objects_item_get_completed (_tmp96_);
	_tmp98_ = _tmp97_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp95_, !_tmp98_);
	_tmp99_ = self->priv->duplicate_item;
	_tmp100_ = self->priv->_item;
	_tmp101_ = objects_item_get_completed (_tmp100_);
	_tmp102_ = _tmp101_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp99_, !_tmp102_);
	_tmp103_ = self->priv->move_item;
	_tmp104_ = self->priv->_item;
	_tmp105_ = objects_item_get_completed (_tmp104_);
	_tmp106_ = _tmp105_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp103_, !_tmp106_);
	_tmp107_ = self->priv->subitems;
	_tmp108_ = _tmp107_->add_button;
	_tmp109_ = self->priv->_item;
	_tmp110_ = objects_item_get_completed (_tmp109_);
	_tmp111_ = _tmp110_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp108_, !_tmp111_);
	_tmp112_ = self->priv->attachments;
	_tmp113_ = _tmp112_->add_button;
	_tmp114_ = self->priv->_item;
	_tmp115_ = objects_item_get_completed (_tmp114_);
	_tmp116_ = _tmp115_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp113_, !_tmp116_);
	_tmp117_ = self->priv->use_note_item;
	_tmp118_ = self->priv->_item;
	_tmp119_ = objects_item_get_item_type (_tmp118_);
	_tmp120_ = _tmp119_;
	widgets_context_menu_menu_switch_set_active (_tmp117_, _tmp120_ == ITEM_TYPE_NOTE);
	_tmp121_ = self->priv->status_button;
	_tmp122_ = self->priv->_item;
	_tmp123_ = objects_item_get_item_type (_tmp122_);
	_tmp124_ = _tmp123_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp121_, _tmp124_ == ITEM_TYPE_TASK);
	_tmp125_ = self->priv->parent_back_button;
	_tmp126_ = self->priv->_item;
	_tmp127_ = objects_item_get_has_parent (_tmp126_);
	_tmp128_ = _tmp127_;
	gtk_widget_set_visible ((GtkWidget*) _tmp125_, _tmp128_);
	_tmp129_ = self->priv->deadline_button;
	_tmp130_ = self->priv->_item;
	_tmp131_ = objects_item_get_completed (_tmp130_);
	_tmp132_ = _tmp131_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp129_, !_tmp132_);
	_tmp133_ = self->priv->export_ics_item;
	_tmp134_ = self->priv->_item;
	_tmp135_ = objects_item_get_project (_tmp134_);
	_tmp136_ = _tmp135_;
	_tmp137_ = objects_project_get_source_type (_tmp136_);
	_tmp138_ = _tmp137_;
	gtk_widget_set_visible ((GtkWidget*) _tmp133_, _tmp138_ == SOURCE_TYPE_CALDAV);
	_tmp139_ = self->priv->_item;
	_tmp140_ = objects_item_get_completed (_tmp139_);
	_tmp141_ = _tmp140_;
	if (_tmp141_) {
		WidgetsDeadlineButton* _tmp142_;
		_tmp142_ = self->priv->deadline_button;
		widgets_deadline_button_remove_error_style (_tmp142_);
	}
}

void
layouts_item_sidebar_view_update_due (LayoutsItemSidebarView* self,
                                      ObjectsDueDate* duedate)
{
	ObjectsItem* _tmp0_;
	ObjectsItem* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (duedate != NULL);
	_tmp0_ = self->priv->_item;
	if (_tmp0_ == NULL) {
		return;
	}
	_tmp1_ = self->priv->_item;
	objects_item_update_due (_tmp1_, duedate);
}

void
layouts_item_sidebar_view_update_labels (LayoutsItemSidebarView* self,
                                         GeeHashMap* new_labels)
{
	gboolean update = FALSE;
	ObjectsItem* _tmp39_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (new_labels != NULL);
	update = FALSE;
	{
		GeeIterator* _entry_it = NULL;
		GeeSet* _tmp0_;
		GeeSet* _tmp1_;
		GeeSet* _tmp2_;
		GeeIterator* _tmp3_;
		GeeIterator* _tmp4_;
		_tmp0_ = gee_abstract_map_get_entries ((GeeAbstractMap*) new_labels);
		_tmp1_ = _tmp0_;
		_tmp2_ = _tmp1_;
		_tmp3_ = gee_iterable_iterator ((GeeIterable*) _tmp2_);
		_tmp4_ = _tmp3_;
		_g_object_unref0 (_tmp2_);
		_entry_it = _tmp4_;
		while (TRUE) {
			GeeIterator* _tmp5_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp6_;
			gpointer _tmp7_;
			ObjectsItem* _tmp8_;
			GeeMapEntry* _tmp9_;
			gconstpointer _tmp10_;
			gconstpointer _tmp11_;
			ObjectsLabel* _tmp12_;
			ObjectsLabel* _tmp13_;
			gboolean _tmp14_;
			_tmp5_ = _entry_it;
			if (!gee_iterator_next (_tmp5_)) {
				break;
			}
			_tmp6_ = _entry_it;
			_tmp7_ = gee_iterator_get (_tmp6_);
			entry = (GeeMapEntry*) _tmp7_;
			_tmp8_ = self->priv->_item;
			_tmp9_ = entry;
			_tmp10_ = gee_map_entry_get_key (_tmp9_);
			_tmp11_ = _tmp10_;
			_tmp12_ = objects_item_get_label (_tmp8_, (const gchar*) _tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = _tmp13_ == NULL;
			_g_object_unref0 (_tmp13_);
			if (_tmp14_) {
				ObjectsItem* _tmp15_;
				GeeMapEntry* _tmp16_;
				gconstpointer _tmp17_;
				gconstpointer _tmp18_;
				ObjectsLabel* _tmp19_;
				ObjectsLabel* _tmp20_;
				_tmp15_ = self->priv->_item;
				_tmp16_ = entry;
				_tmp17_ = gee_map_entry_get_value (_tmp16_);
				_tmp18_ = _tmp17_;
				_tmp19_ = objects_item_add_label_if_not_exists (_tmp15_, (ObjectsLabel*) _tmp18_);
				_tmp20_ = _tmp19_;
				_g_object_unref0 (_tmp20_);
				update = TRUE;
			}
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	{
		GeeArrayList* _label_list = NULL;
		ObjectsItem* _tmp21_;
		GeeArrayList* _tmp22_;
		gint _label_size = 0;
		GeeArrayList* _tmp23_;
		gint _tmp24_;
		gint _tmp25_;
		gint _label_index = 0;
		_tmp21_ = self->priv->_item;
		_tmp22_ = objects_item_get_labels_list (_tmp21_);
		_label_list = _tmp22_;
		_tmp23_ = _label_list;
		_tmp24_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp23_);
		_tmp25_ = _tmp24_;
		_label_size = _tmp25_;
		_label_index = -1;
		while (TRUE) {
			gint _tmp26_;
			gint _tmp27_;
			ObjectsLabel* label = NULL;
			GeeArrayList* _tmp28_;
			gpointer _tmp29_;
			ObjectsLabel* _tmp30_;
			const gchar* _tmp31_;
			const gchar* _tmp32_;
			_label_index = _label_index + 1;
			_tmp26_ = _label_index;
			_tmp27_ = _label_size;
			if (!(_tmp26_ < _tmp27_)) {
				break;
			}
			_tmp28_ = _label_list;
			_tmp29_ = gee_abstract_list_get ((GeeAbstractList*) _tmp28_, _label_index);
			label = (ObjectsLabel*) _tmp29_;
			_tmp30_ = label;
			_tmp31_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp30_);
			_tmp32_ = _tmp31_;
			if (!gee_abstract_map_has_key ((GeeAbstractMap*) new_labels, _tmp32_)) {
				ObjectsItem* _tmp33_;
				ObjectsLabel* _tmp34_;
				const gchar* _tmp35_;
				const gchar* _tmp36_;
				ObjectsLabel* _tmp37_;
				ObjectsLabel* _tmp38_;
				_tmp33_ = self->priv->_item;
				_tmp34_ = label;
				_tmp35_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp34_);
				_tmp36_ = _tmp35_;
				_tmp37_ = objects_item_delete_item_label (_tmp33_, _tmp36_);
				_tmp38_ = _tmp37_;
				_g_object_unref0 (_tmp38_);
				update = TRUE;
			}
			_g_object_unref0 (label);
		}
		_g_object_unref0 (_label_list);
	}
	if (!update) {
		return;
	}
	_tmp39_ = self->priv->_item;
	objects_item_update_async (_tmp39_, "");
}

static void
__lambda510_ (LayoutsItemSidebarView* self)
{
	ItemType _tmp0_ = 0;
	WidgetsContextMenuMenuSwitch* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	ObjectsItem* _tmp4_;
	ObjectsItem* _tmp5_;
	_tmp1_ = self->priv->use_note_item;
	_tmp2_ = widgets_context_menu_menu_switch_get_active (_tmp1_);
	_tmp3_ = _tmp2_;
	if (_tmp3_) {
		_tmp0_ = ITEM_TYPE_NOTE;
	} else {
		_tmp0_ = ITEM_TYPE_TASK;
	}
	_tmp4_ = self->priv->_item;
	objects_item_set_item_type (_tmp4_, _tmp0_);
	_tmp5_ = self->priv->_item;
	objects_item_update_local (_tmp5_);
}

static void
___lambda510__widgets_context_menu_menu_switch_activate_item (WidgetsContextMenuMenuSwitch* _sender,
                                                              gpointer self)
{
	__lambda510_ ((LayoutsItemSidebarView*) self);
}

static void
__lambda511_ (LayoutsItemSidebarView* self)
{
	ObjectsItem* _tmp0_;
	_tmp0_ = self->priv->_item;
	objects_item_copy_clipboard (_tmp0_);
}

static void
___lambda511__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda511_ ((LayoutsItemSidebarView*) self);
}

static void
__lambda512_ (LayoutsItemSidebarView* self)
{
	Util* _tmp0_;
	Util* _tmp1_;
	ObjectsItem* _tmp2_;
	ObjectsItem* _tmp3_;
	const gchar* _tmp4_;
	const gchar* _tmp5_;
	ObjectsItem* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	ObjectsItem* _tmp9_;
	const gchar* _tmp10_;
	const gchar* _tmp11_;
	_tmp0_ = util_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = self->priv->_item;
	_tmp3_ = self->priv->_item;
	_tmp4_ = objects_item_get_project_id (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = self->priv->_item;
	_tmp7_ = objects_item_get_section_id (_tmp6_);
	_tmp8_ = _tmp7_;
	_tmp9_ = self->priv->_item;
	_tmp10_ = objects_item_get_parent_id (_tmp9_);
	_tmp11_ = _tmp10_;
	util_duplicate_item (_tmp1_, _tmp2_, _tmp5_, _tmp8_, _tmp11_, TRUE, NULL, NULL);
	_g_object_unref0 (_tmp1_);
}

static void
___lambda512__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda512_ ((LayoutsItemSidebarView*) self);
}

static void
__lambda514_ (LayoutsItemSidebarView* self,
              const gchar* type,
              const gchar* id)
{
	g_return_if_fail (type != NULL);
	g_return_if_fail (id != NULL);
	if (g_strcmp0 (type, "project") == 0) {
		ServicesStore* _tmp0_;
		ObjectsProject* _tmp1_;
		ObjectsProject* _tmp2_;
		_tmp0_ = services_store_instance ();
		_tmp1_ = services_store_get_project (_tmp0_, id);
		_tmp2_ = _tmp1_;
		layouts_item_sidebar_view_move (self, _tmp2_, "", "");
		_g_object_unref0 (_tmp2_);
	} else {
		ObjectsItem* _tmp3_;
		ObjectsProject* _tmp4_;
		ObjectsProject* _tmp5_;
		_tmp3_ = self->priv->_item;
		_tmp4_ = objects_item_get_project (_tmp3_);
		_tmp5_ = _tmp4_;
		layouts_item_sidebar_view_move (self, _tmp5_, id, "");
	}
}

static void
___lambda514__dialogs_project_picker_project_picker_changed (DialogsProjectPickerProjectPicker* _sender,
                                                             const gchar* type,
                                                             const gchar* id,
                                                             gpointer self)
{
	__lambda514_ ((LayoutsItemSidebarView*) self, type, id);
}

static void
__lambda513_ (LayoutsItemSidebarView* self)
{
	DialogsProjectPickerProjectPicker* dialog = NULL;
	DialogsProjectPickerProjectPicker* _tmp0_;
	ObjectsItem* _tmp1_;
	ObjectsProject* _tmp2_;
	ObjectsProject* _tmp3_;
	Planify* _tmp4_;
	MainWindow* _tmp5_;
	_tmp0_ = dialogs_project_picker_project_picker_new_for_projects ();
	g_object_ref_sink (_tmp0_);
	dialog = _tmp0_;
	_tmp1_ = self->priv->_item;
	_tmp2_ = objects_item_get_project (_tmp1_);
	_tmp3_ = _tmp2_;
	dialogs_project_picker_project_picker_set_project (dialog, _tmp3_);
	_tmp4_ = planify__instance;
	_tmp5_ = _tmp4_->main_window;
	adw_dialog_present ((AdwDialog*) dialog, (GtkWidget*) _tmp5_);
	g_signal_connect_object (dialog, "changed", (GCallback) ___lambda514__dialogs_project_picker_project_picker_changed, self, 0);
	_g_object_unref0 (dialog);
}

static void
___lambda513__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda513_ ((LayoutsItemSidebarView*) self);
}

static void
__lambda515_ (LayoutsItemSidebarView* self)
{
	layouts_item_sidebar_view_delete_request (self, TRUE);
}

static void
___lambda515__widgets_context_menu_menu_item_activate_item (WidgetsContextMenuMenuItem* _sender,
                                                            gpointer self)
{
	__lambda515_ ((LayoutsItemSidebarView*) self);
}

static void
__lambda517_ (LayoutsItemSidebarView* self)
{
	DialogsItemChangeHistory* dialog = NULL;
	ObjectsItem* _tmp0_;
	DialogsItemChangeHistory* _tmp1_;
	Planify* _tmp2_;
	MainWindow* _tmp3_;
	_tmp0_ = self->priv->_item;
	_tmp1_ = dialogs_item_change_history_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	dialog = _tmp1_;
	_tmp2_ = planify__instance;
	_tmp3_ = _tmp2_->main_window;
	adw_dialog_present ((AdwDialog*) dialog, (GtkWidget*) _tmp3_);
	_g_object_unref0 (dialog);
}

static void
___lambda517__widgets_context_menu_menu_item_activate_item (WidgetsContextMenuMenuItem* _sender,
                                                            gpointer self)
{
	__lambda517_ ((LayoutsItemSidebarView*) self);
}

static void
__lambda518_ (LayoutsItemSidebarView* self)
{
	ObjectsItem* _tmp0_;
	Planify* _tmp1_;
	MainWindow* _tmp2_;
	_tmp0_ = self->priv->_item;
	_tmp1_ = planify__instance;
	_tmp2_ = _tmp1_->main_window;
	objects_item_export_ics (_tmp0_, (GtkWindow*) _tmp2_);
}

static void
___lambda518__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda518_ ((LayoutsItemSidebarView*) self);
}

static GtkPopover*
layouts_item_sidebar_view_build_context_menu (LayoutsItemSidebarView* self)
{
	WidgetsContextMenuMenuSwitch* _tmp0_;
	WidgetsContextMenuMenuItem* _tmp1_;
	WidgetsContextMenuMenuItem* _tmp2_;
	WidgetsContextMenuMenuItem* _tmp3_;
	WidgetsContextMenuMenuItem* _tmp4_;
	WidgetsContextMenuMenuItem* delete_item = NULL;
	WidgetsContextMenuMenuItem* _tmp5_;
	WidgetsContextMenuMenuItem* more_information_item = NULL;
	WidgetsContextMenuMenuItem* _tmp6_;
	GtkPopover* popover = NULL;
	GtkPopover* _tmp7_ = NULL;
	GtkBox* menu_box = NULL;
	GtkBox* _tmp8_;
	WidgetsContextMenuMenuSwitch* _tmp9_;
	WidgetsContextMenuMenuSeparator* _tmp10_;
	WidgetsContextMenuMenuSeparator* _tmp11_;
	WidgetsContextMenuMenuItem* _tmp12_;
	WidgetsContextMenuMenuItem* _tmp13_;
	WidgetsContextMenuMenuItem* _tmp14_;
	WidgetsContextMenuMenuItem* _tmp15_;
	WidgetsContextMenuMenuSeparator* _tmp16_;
	WidgetsContextMenuMenuSeparator* _tmp17_;
	WidgetsContextMenuMenuSwitch* _tmp18_;
	WidgetsContextMenuMenuItem* _tmp19_;
	WidgetsContextMenuMenuItem* _tmp20_;
	WidgetsContextMenuMenuItem* _tmp21_;
	WidgetsContextMenuMenuItem* _tmp22_;
	GtkPopover* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = widgets_context_menu_menu_switch_new (_ ("Use as a Note"), "paper-symbolic");
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->use_note_item);
	self->priv->use_note_item = _tmp0_;
	_tmp1_ = widgets_context_menu_menu_item_new (_ ("Copy to Clipboard"), "clipboard-symbolic");
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->copy_clipboard_item);
	self->priv->copy_clipboard_item = _tmp1_;
	_tmp2_ = widgets_context_menu_menu_item_new (_ ("Duplicate"), "tabs-stack-symbolic");
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->duplicate_item);
	self->priv->duplicate_item = _tmp2_;
	_tmp3_ = widgets_context_menu_menu_item_new (_ ("Move"), "arrow3-right-symbolic");
	g_object_ref_sink (_tmp3_);
	_g_object_unref0 (self->priv->move_item);
	self->priv->move_item = _tmp3_;
	_tmp4_ = widgets_context_menu_menu_item_new (_ ("Export as .ics"), "document-save-symbolic");
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->export_ics_item);
	self->priv->export_ics_item = _tmp4_;
	_tmp5_ = widgets_context_menu_menu_item_new (_ ("Delete Task"), "user-trash-symbolic");
	g_object_ref_sink (_tmp5_);
	delete_item = _tmp5_;
	gtk_widget_add_css_class ((GtkWidget*) delete_item, "menu-item-danger");
	_tmp6_ = widgets_context_menu_menu_item_new (_ ("Change History"), "rotation-edit-symbolic");
	g_object_ref_sink (_tmp6_);
	more_information_item = _tmp6_;
	_tmp7_ = (GtkPopover*) gtk_popover_new ();
	gtk_popover_set_has_arrow (_tmp7_, FALSE);
	gtk_popover_set_position (_tmp7_, GTK_POS_BOTTOM);
	g_object_set ((GtkWidget*) _tmp7_, "width-request", 250, NULL);
	g_object_ref_sink (_tmp7_);
	popover = _tmp7_;
	_tmp8_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	g_object_ref_sink (_tmp8_);
	menu_box = _tmp8_;
	gtk_widget_set_margin_bottom ((GtkWidget*) menu_box, 3);
	gtk_widget_set_margin_top ((GtkWidget*) menu_box, 3);
	_tmp9_ = self->priv->use_note_item;
	gtk_box_append (menu_box, (GtkWidget*) _tmp9_);
	_tmp10_ = widgets_context_menu_menu_separator_new ();
	g_object_ref_sink (_tmp10_);
	_tmp11_ = _tmp10_;
	gtk_box_append (menu_box, (GtkWidget*) _tmp11_);
	_g_object_unref0 (_tmp11_);
	_tmp12_ = self->priv->copy_clipboard_item;
	gtk_box_append (menu_box, (GtkWidget*) _tmp12_);
	_tmp13_ = self->priv->duplicate_item;
	gtk_box_append (menu_box, (GtkWidget*) _tmp13_);
	_tmp14_ = self->priv->move_item;
	gtk_box_append (menu_box, (GtkWidget*) _tmp14_);
	_tmp15_ = self->priv->export_ics_item;
	gtk_box_append (menu_box, (GtkWidget*) _tmp15_);
	gtk_box_append (menu_box, (GtkWidget*) delete_item);
	_tmp16_ = widgets_context_menu_menu_separator_new ();
	g_object_ref_sink (_tmp16_);
	_tmp17_ = _tmp16_;
	gtk_box_append (menu_box, (GtkWidget*) _tmp17_);
	_g_object_unref0 (_tmp17_);
	gtk_box_append (menu_box, (GtkWidget*) more_information_item);
	gtk_popover_set_child (popover, (GtkWidget*) menu_box);
	_tmp18_ = self->priv->use_note_item;
	g_signal_connect_object (_tmp18_, "activate-item", (GCallback) ___lambda510__widgets_context_menu_menu_switch_activate_item, self, 0);
	_tmp19_ = self->priv->copy_clipboard_item;
	g_signal_connect_object ((GtkButton*) _tmp19_, "clicked", (GCallback) ___lambda511__gtk_button_clicked, self, 0);
	_tmp20_ = self->priv->duplicate_item;
	g_signal_connect_object ((GtkButton*) _tmp20_, "clicked", (GCallback) ___lambda512__gtk_button_clicked, self, 0);
	_tmp21_ = self->priv->move_item;
	g_signal_connect_object ((GtkButton*) _tmp21_, "clicked", (GCallback) ___lambda513__gtk_button_clicked, self, 0);
	g_signal_connect_object (delete_item, "activate-item", (GCallback) ___lambda515__widgets_context_menu_menu_item_activate_item, self, 0);
	g_signal_connect_object (more_information_item, "activate-item", (GCallback) ___lambda517__widgets_context_menu_menu_item_activate_item, self, 0);
	_tmp22_ = self->priv->export_ics_item;
	g_signal_connect_object ((GtkButton*) _tmp22_, "clicked", (GCallback) ___lambda518__gtk_button_clicked, self, 0);
	result = popover;
	_g_object_unref0 (menu_box);
	_g_object_unref0 (more_information_item);
	_g_object_unref0 (delete_item);
	return result;
}

void
layouts_item_sidebar_view_move (LayoutsItemSidebarView* self,
                                ObjectsProject* project,
                                const gchar* section_id,
                                const gchar* parent_id)
{
	gchar* project_id = NULL;
	const gchar* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	ObjectsItem* _tmp3_;
	ObjectsProject* _tmp4_;
	ObjectsProject* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (project != NULL);
	g_return_if_fail (section_id != NULL);
	g_return_if_fail (parent_id != NULL);
	_tmp0_ = objects_base_object_get_id ((ObjectsBaseObject*) project);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strdup (_tmp1_);
	project_id = _tmp2_;
	_tmp3_ = self->priv->_item;
	_tmp4_ = objects_item_get_project (_tmp3_);
	_tmp5_ = _tmp4_;
	_tmp6_ = objects_project_get_source_id (_tmp5_);
	_tmp7_ = _tmp6_;
	_tmp8_ = objects_project_get_source_id (project);
	_tmp9_ = _tmp8_;
	if (g_strcmp0 (_tmp7_, _tmp9_) != 0) {
		Util* _tmp10_;
		Util* _tmp11_;
		ObjectsItem* _tmp12_;
		_tmp10_ = util_get_default ();
		_tmp11_ = _tmp10_;
		_tmp12_ = self->priv->_item;
		util_move_backend_type_item (_tmp11_, _tmp12_, project, "", TRUE, NULL, NULL);
		_g_object_unref0 (_tmp11_);
	} else {
		gboolean _tmp13_ = FALSE;
		gboolean _tmp14_ = FALSE;
		ObjectsItem* _tmp15_;
		const gchar* _tmp16_;
		const gchar* _tmp17_;
		const gchar* _tmp18_;
		_tmp15_ = self->priv->_item;
		_tmp16_ = objects_item_get_project_id (_tmp15_);
		_tmp17_ = _tmp16_;
		_tmp18_ = project_id;
		if (g_strcmp0 (_tmp17_, _tmp18_) != 0) {
			_tmp14_ = TRUE;
		} else {
			ObjectsItem* _tmp19_;
			const gchar* _tmp20_;
			const gchar* _tmp21_;
			_tmp19_ = self->priv->_item;
			_tmp20_ = objects_item_get_section_id (_tmp19_);
			_tmp21_ = _tmp20_;
			_tmp14_ = g_strcmp0 (_tmp21_, section_id) != 0;
		}
		if (_tmp14_) {
			_tmp13_ = TRUE;
		} else {
			ObjectsItem* _tmp22_;
			const gchar* _tmp23_;
			const gchar* _tmp24_;
			_tmp22_ = self->priv->_item;
			_tmp23_ = objects_item_get_parent_id (_tmp22_);
			_tmp24_ = _tmp23_;
			_tmp13_ = g_strcmp0 (_tmp24_, parent_id) != 0;
		}
		if (_tmp13_) {
			ObjectsItem* _tmp25_;
			_tmp25_ = self->priv->_item;
			objects_item_move (_tmp25_, project, section_id, TRUE);
		}
	}
	_g_free0 (project_id);
}

static void
__lambda516_ (LayoutsItemSidebarView* self,
              const gchar* response)
{
	g_return_if_fail (response != NULL);
	if (g_strcmp0 (response, "delete") == 0) {
		ObjectsItem* _tmp0_;
		ServicesEventBus* _tmp1_;
		ServicesEventBus* _tmp2_;
		_tmp0_ = self->priv->_item;
		objects_item_delete_item (_tmp0_);
		_tmp1_ = services_event_bus_get_default ();
		_tmp2_ = _tmp1_;
		g_signal_emit_by_name (_tmp2_, "close-item");
		_g_object_unref0 (_tmp2_);
	}
}

static void
___lambda516__adw_alert_dialog_response (AdwAlertDialog* _sender,
                                         const gchar* response,
                                         gpointer self)
{
	__lambda516_ ((LayoutsItemSidebarView*) self, response);
}

void
layouts_item_sidebar_view_delete_request (LayoutsItemSidebarView* self,
                                          gboolean undo)
{
	AdwAlertDialog* dialog = NULL;
	AdwAlertDialog* _tmp0_;
	Planify* _tmp1_;
	MainWindow* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = (AdwAlertDialog*) adw_alert_dialog_new (_ ("Are you sure you want to delete?"), _ ("This can not be undone"));
	g_object_ref_sink (_tmp0_);
	dialog = _tmp0_;
	adw_alert_dialog_add_response (dialog, "cancel", _ ("Cancel"));
	adw_alert_dialog_add_response (dialog, "delete", _ ("Delete"));
	adw_alert_dialog_set_response_appearance (dialog, "delete", ADW_RESPONSE_DESTRUCTIVE);
	_tmp1_ = planify__instance;
	_tmp2_ = _tmp1_->main_window;
	adw_dialog_present ((AdwDialog*) dialog, (GtkWidget*) _tmp2_);
	g_signal_connect_object (dialog, "response", (GCallback) ___lambda516__adw_alert_dialog_response, self, 0);
	_g_object_unref0 (dialog);
}

void
layouts_item_sidebar_view_prepare_new_item (LayoutsItemSidebarView* self,
                                            const gchar* content)
{
	DialogsQuickAdd* dialog = NULL;
	DialogsQuickAdd* _tmp0_;
	ObjectsItem* _tmp1_;
	Planify* _tmp2_;
	MainWindow* _tmp3_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (content != NULL);
	_tmp0_ = dialogs_quick_add_new ();
	g_object_ref_sink (_tmp0_);
	dialog = _tmp0_;
	_tmp1_ = self->priv->_item;
	dialogs_quick_add_for_base_object (dialog, (ObjectsBaseObject*) _tmp1_);
	dialogs_quick_add_update_content (dialog, content);
	_tmp2_ = planify__instance;
	_tmp3_ = _tmp2_->main_window;
	adw_dialog_present ((AdwDialog*) dialog, (GtkWidget*) _tmp3_);
	_g_object_unref0 (dialog);
}

void
layouts_item_sidebar_view_checked_toggled (LayoutsItemSidebarView* self,
                                           gboolean active)
{
	gboolean old_checked = FALSE;
	ObjectsItem* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_item;
	_tmp1_ = objects_item_get_checked (_tmp0_);
	_tmp2_ = _tmp1_;
	old_checked = _tmp2_;
	if (active) {
		layouts_item_sidebar_view_complete_item (self, old_checked);
	} else {
		gchar* old_completed_at = NULL;
		ObjectsItem* _tmp3_;
		const gchar* _tmp4_;
		const gchar* _tmp5_;
		gchar* _tmp6_;
		ObjectsItem* _tmp7_;
		ObjectsItem* _tmp8_;
		const gchar* _tmp9_;
		_tmp3_ = self->priv->_item;
		_tmp4_ = objects_item_get_completed_at (_tmp3_);
		_tmp5_ = _tmp4_;
		_tmp6_ = g_strdup (_tmp5_);
		old_completed_at = _tmp6_;
		_tmp7_ = self->priv->_item;
		objects_item_set_checked (_tmp7_, FALSE);
		_tmp8_ = self->priv->_item;
		objects_item_set_completed_at (_tmp8_, "");
		_tmp9_ = old_completed_at;
		_layouts_item_sidebar_view_complete_item (self, old_checked, _tmp9_, NULL, NULL);
		_g_free0 (old_completed_at);
	}
}

static gchar*
g_date_time_to_string (GDateTime* self)
{
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_date_time_format (self, "%FT%H:%M:%S%z");
	result = _tmp0_;
	return result;
}

static void
layouts_item_sidebar_view_complete_item (LayoutsItemSidebarView* self,
                                         gboolean old_checked)
{
	ServicesSettings* _tmp0_;
	ServicesSettings* _tmp1_;
	GSettings* _tmp2_;
	gboolean _tmp3_;
	gboolean _tmp6_ = FALSE;
	ObjectsItem* _tmp7_;
	ObjectsDueDate* _tmp8_;
	ObjectsDueDate* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	g_return_if_fail (self != NULL);
	_tmp0_ = services_settings_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_->settings;
	_tmp3_ = g_settings_get_boolean (_tmp2_, "task-complete-tone");
	_g_object_unref0 (_tmp1_);
	if (_tmp3_) {
		Util* _tmp4_;
		Util* _tmp5_;
		_tmp4_ = util_get_default ();
		_tmp5_ = _tmp4_;
		util_play_audio (_tmp5_);
		_g_object_unref0 (_tmp5_);
	}
	_tmp7_ = self->priv->_item;
	_tmp8_ = objects_item_get_due (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = objects_due_date_get_is_recurring (_tmp9_);
	_tmp11_ = _tmp10_;
	if (_tmp11_) {
		ObjectsItem* _tmp12_;
		ObjectsDueDate* _tmp13_;
		ObjectsDueDate* _tmp14_;
		gboolean _tmp15_;
		gboolean _tmp16_;
		_tmp12_ = self->priv->_item;
		_tmp13_ = objects_item_get_due (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp15_ = objects_due_date_get_is_recurrency_end (_tmp14_);
		_tmp16_ = _tmp15_;
		_tmp6_ = !_tmp16_;
	} else {
		_tmp6_ = FALSE;
	}
	if (_tmp6_) {
		layouts_item_sidebar_view_update_next_recurrency (self);
	} else {
		gchar* old_completed_at = NULL;
		ObjectsItem* _tmp17_;
		const gchar* _tmp18_;
		const gchar* _tmp19_;
		gchar* _tmp20_;
		ObjectsItem* _tmp21_;
		ObjectsItem* _tmp22_;
		GDateTime* _tmp23_;
		GDateTime* _tmp24_;
		gchar* _tmp25_;
		gchar* _tmp26_;
		const gchar* _tmp27_;
		_tmp17_ = self->priv->_item;
		_tmp18_ = objects_item_get_completed_at (_tmp17_);
		_tmp19_ = _tmp18_;
		_tmp20_ = g_strdup (_tmp19_);
		old_completed_at = _tmp20_;
		_tmp21_ = self->priv->_item;
		objects_item_set_checked (_tmp21_, TRUE);
		_tmp22_ = self->priv->_item;
		_tmp23_ = g_date_time_new_now_local ();
		_tmp24_ = _tmp23_;
		_tmp25_ = g_date_time_to_string (_tmp24_);
		_tmp26_ = _tmp25_;
		objects_item_set_completed_at (_tmp22_, _tmp26_);
		_g_free0 (_tmp26_);
		_g_date_time_unref0 (_tmp24_);
		_tmp27_ = old_completed_at;
		_layouts_item_sidebar_view_complete_item (self, old_checked, _tmp27_, NULL, NULL);
		_g_free0 (old_completed_at);
	}
}

static void
_layouts_item_sidebar_view_complete_item_data_free (gpointer _data)
{
	LayoutsItemSidebarViewCompleteItemData* _data_;
	_data_ = _data;
	_g_free0 (_data_->old_completed_at);
	_g_object_unref0 (_data_->self);
	g_slice_free (LayoutsItemSidebarViewCompleteItemData, _data_);
}

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

static void
_layouts_item_sidebar_view_complete_item (LayoutsItemSidebarView* self,
                                          gboolean old_checked,
                                          const gchar* old_completed_at,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_)
{
	LayoutsItemSidebarViewCompleteItemData* _data_;
	LayoutsItemSidebarView* _tmp0_;
	gchar* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (old_completed_at != NULL);
	_data_ = g_slice_new0 (LayoutsItemSidebarViewCompleteItemData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, _layouts_item_sidebar_view_complete_item_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	_data_->old_checked = old_checked;
	_tmp1_ = g_strdup (old_completed_at);
	_g_free0 (_data_->old_completed_at);
	_data_->old_completed_at = _tmp1_;
	_layouts_item_sidebar_view_complete_item_co (_data_);
}

static void
_layouts_item_sidebar_view_complete_item_finish (LayoutsItemSidebarView* self,
                                                 GAsyncResult* _res_)
{
	LayoutsItemSidebarViewCompleteItemData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
_layouts_item_sidebar_view_complete_item_ready (GObject* source_object,
                                                GAsyncResult* _res_,
                                                gpointer _user_data_)
{
	LayoutsItemSidebarViewCompleteItemData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	_layouts_item_sidebar_view_complete_item_co (_data_);
}

static gboolean
_layouts_item_sidebar_view_complete_item_co (LayoutsItemSidebarViewCompleteItemData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = _data_->self->priv->_item;
	_data_->_state_ = 1;
	objects_item_complete_item (_data_->_tmp0_, _data_->old_checked, _layouts_item_sidebar_view_complete_item_ready, _data_);
	return FALSE;
	_state_1:
	_data_->_tmp1_ = objects_item_complete_item_finish (_data_->_tmp0_, _data_->_res_);
	_data_->response = _data_->_tmp1_;
	_data_->_tmp2_ = _data_->response;
	_data_->_tmp3_ = http_response_get_status (_data_->_tmp2_);
	_data_->_tmp4_ = _data_->_tmp3_;
	if (!_data_->_tmp4_) {
		_data_->_tmp5_ = _data_->response;
		_layouts_item_sidebar_view_complete_item_error (_data_->self, _data_->_tmp5_, _data_->old_checked, _data_->old_completed_at);
	}
	_http_response_unref0 (_data_->response);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static void
_layouts_item_sidebar_view_complete_item_error (LayoutsItemSidebarView* self,
                                                HttpResponse* response,
                                                gboolean old_checked,
                                                const gchar* old_completed_at)
{
	ObjectsItem* _tmp0_;
	ObjectsItem* _tmp1_;
	ServicesEventBus* _tmp2_;
	ServicesEventBus* _tmp3_;
	gint _tmp4_;
	gint _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (response != NULL);
	g_return_if_fail (old_completed_at != NULL);
	_tmp0_ = self->priv->_item;
	objects_item_set_checked (_tmp0_, old_checked);
	_tmp1_ = self->priv->_item;
	objects_item_set_completed_at (_tmp1_, old_completed_at);
	_tmp2_ = services_event_bus_get_default ();
	_tmp3_ = _tmp2_;
	_tmp4_ = http_response_get_error_code (response);
	_tmp5_ = _tmp4_;
	_tmp6_ = http_response_get_error (response);
	_tmp7_ = _tmp6_;
	g_signal_emit_by_name (_tmp3_, "send-error-toast", _tmp5_, _tmp7_);
	_g_object_unref0 (_tmp3_);
}

static void
__lambda519_ (LayoutsItemSidebarView* self,
              GObject* obj,
              GAsyncResult* res)
{
	GDateTime* next_recurrency = NULL;
	ObjectsItem* _tmp0_;
	GDateTime* _tmp1_;
	GDateTime* _tmp2_;
	g_return_if_fail (res != NULL);
	_tmp0_ = self->priv->_item;
	_tmp1_ = objects_item_update_next_recurrency_finish (_tmp0_, res);
	next_recurrency = _tmp1_;
	_tmp2_ = next_recurrency;
	if (_tmp2_ != NULL) {
		GDateTime* _tmp3_;
		_tmp3_ = next_recurrency;
		layouts_item_sidebar_view_recurrency_update_complete (self, _tmp3_);
	}
	_g_date_time_unref0 (next_recurrency);
}

static void
___lambda519__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	__lambda519_ ((LayoutsItemSidebarView*) self, source_object, res);
	g_object_unref (self);
}

static void
layouts_item_sidebar_view_update_next_recurrency (LayoutsItemSidebarView* self)
{
	ObjectsItem* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_item;
	objects_item_update_next_recurrency (_tmp0_, ___lambda519__gasync_ready_callback, g_object_ref (self));
}

static void
layouts_item_sidebar_view_recurrency_update_complete (LayoutsItemSidebarView* self,
                                                      GDateTime* next_recurrency)
{
	gchar* title = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	AdwToast* toast = NULL;
	Util* _tmp6_;
	Util* _tmp7_;
	AdwToast* _tmp8_;
	AdwToast* _tmp9_;
	ServicesEventBus* _tmp10_;
	ServicesEventBus* _tmp11_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (next_recurrency != NULL);
	_tmp0_ = utils_datetime_get_default_date_format_from_date (next_recurrency);
	_tmp1_ = _tmp0_;
	_tmp2_ = g_strdup_printf ("Completed. Next occurrence: %s", _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strdup (_ (_tmp3_));
	_tmp5_ = _tmp4_;
	_g_free0 (_tmp3_);
	_g_free0 (_tmp1_);
	title = _tmp5_;
	_tmp6_ = util_get_default ();
	_tmp7_ = _tmp6_;
	_tmp8_ = util_create_toast (_tmp7_, title, (guint) 3, ADW_TOAST_PRIORITY_NORMAL);
	_tmp9_ = _tmp8_;
	_g_object_unref0 (_tmp7_);
	toast = _tmp9_;
	_tmp10_ = services_event_bus_get_default ();
	_tmp11_ = _tmp10_;
	g_signal_emit_by_name (_tmp11_, "send-toast", toast);
	_g_object_unref0 (_tmp11_);
	_g_object_unref0 (toast);
	_g_free0 (title);
}

static void
layouts_item_sidebar_view_init_markdown_editor (LayoutsItemSidebarView* self)
{
	ObjectsItem* _tmp0_;
	ObjectsProject* _tmp1_;
	ObjectsProject* _tmp2_;
	ObjectsProject* _tmp3_;
	WidgetsMarkdownEditor* _tmp4_ = NULL;
	WidgetsMarkdownEditor* _tmp5_;
	GtkTextView* _tmp6_;
	WidgetsMarkdownEditor* _tmp7_;
	WidgetsMarkdownEditor* _tmp8_;
	WidgetsMarkdownEditor* _tmp9_;
	WidgetsMarkdownEditor* _tmp10_;
	AdwBin* markdown_editor_card = NULL;
	WidgetsMarkdownEditor* _tmp11_;
	GtkWidget* _tmp12_;
	AdwBin* _tmp13_ = NULL;
	GtkRevealer* _tmp14_;
	GtkRevealer* _tmp15_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->_item;
	_tmp1_ = objects_item_get_project (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_tmp4_ = widgets_markdown_editor_new ();
	widgets_markdown_editor_set_project (_tmp4_, _tmp3_);
	_g_object_unref0 (_tmp3_);
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->markdown_editor);
	self->priv->markdown_editor = _tmp4_;
	_tmp5_ = self->priv->markdown_editor;
	_tmp6_ = _tmp5_->text_view;
	g_object_set ((GtkWidget*) _tmp6_, "height-request", 64, NULL);
	_tmp7_ = self->priv->markdown_editor;
	gtk_widget_set_margin_start ((GtkWidget*) _tmp7_, 12);
	_tmp8_ = self->priv->markdown_editor;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp8_, 12);
	_tmp9_ = self->priv->markdown_editor;
	gtk_widget_set_margin_top ((GtkWidget*) _tmp9_, 12);
	_tmp10_ = self->priv->markdown_editor;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp10_, 12);
	_tmp11_ = self->priv->markdown_editor;
	_tmp12_ = _g_object_ref0 ((GtkWidget*) _tmp11_);
	_tmp13_ = (AdwBin*) adw_bin_new ();
	adw_bin_set_child (_tmp13_, _tmp12_);
	_g_object_unref0 (_tmp12_);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp13_, 3);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp13_, 3);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp13_, 3);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp13_, 3);
	g_object_ref_sink (_tmp13_);
	markdown_editor_card = _tmp13_;
	gtk_widget_add_css_class ((GtkWidget*) markdown_editor_card, "card");
	_tmp14_ = self->priv->markdown_editor_revealer;
	gtk_revealer_set_child (_tmp14_, (GtkWidget*) markdown_editor_card);
	_tmp15_ = self->priv->markdown_editor_revealer;
	gtk_revealer_set_reveal_child (_tmp15_, TRUE);
	_g_object_unref0 (markdown_editor_card);
}

static void
layouts_item_sidebar_view_build_markdown_editor (LayoutsItemSidebarView* self)
{
	WidgetsMarkdownEditor* _tmp0_;
	ObjectsItem* _tmp2_;
	ObjectsProject* _tmp3_;
	ObjectsProject* _tmp4_;
	ObjectsProject* _tmp5_;
	WidgetsMarkdownEditor* _tmp6_ = NULL;
	WidgetsMarkdownEditor* _tmp7_;
	GtkTextView* _tmp8_;
	WidgetsMarkdownEditor* _tmp9_;
	WidgetsMarkdownEditor* _tmp10_;
	WidgetsMarkdownEditor* _tmp11_;
	WidgetsMarkdownEditor* _tmp12_;
	WidgetsMarkdownEditor* _tmp13_;
	ObjectsItem* _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	AdwBin* markdown_editor_card = NULL;
	WidgetsMarkdownEditor* _tmp17_;
	GtkWidget* _tmp18_;
	AdwBin* _tmp19_ = NULL;
	AdwBin* _tmp20_;
	GtkRevealer* _tmp21_;
	AdwBin* _tmp22_;
	GtkRevealer* _tmp23_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->markdown_editor;
	if (_tmp0_ != NULL) {
		return;
	}
	if (self->priv->destroy_editor_timeout_id != ((guint) 0)) {
		GtkRevealer* _tmp1_;
		g_source_remove (self->priv->destroy_editor_timeout_id);
		self->priv->destroy_editor_timeout_id = (guint) 0;
		_tmp1_ = self->priv->markdown_editor_revealer;
		gtk_revealer_set_child (_tmp1_, NULL);
	}
	_tmp2_ = self->priv->_item;
	_tmp3_ = objects_item_get_project (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = _g_object_ref0 (_tmp4_);
	_tmp6_ = widgets_markdown_editor_new ();
	widgets_markdown_editor_set_project (_tmp6_, _tmp5_);
	_g_object_unref0 (_tmp5_);
	g_object_ref_sink (_tmp6_);
	_g_object_unref0 (self->priv->markdown_editor);
	self->priv->markdown_editor = _tmp6_;
	_tmp7_ = self->priv->markdown_editor;
	_tmp8_ = _tmp7_->text_view;
	g_object_set ((GtkWidget*) _tmp8_, "height-request", 64, NULL);
	_tmp9_ = self->priv->markdown_editor;
	gtk_widget_set_margin_start ((GtkWidget*) _tmp9_, 12);
	_tmp10_ = self->priv->markdown_editor;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp10_, 12);
	_tmp11_ = self->priv->markdown_editor;
	gtk_widget_set_margin_top ((GtkWidget*) _tmp11_, 12);
	_tmp12_ = self->priv->markdown_editor;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp12_, 12);
	_tmp13_ = self->priv->markdown_editor;
	_tmp14_ = self->priv->_item;
	_tmp15_ = objects_item_get_description (_tmp14_);
	_tmp16_ = _tmp15_;
	widgets_markdown_editor_set_text (_tmp13_, _tmp16_);
	_tmp17_ = self->priv->markdown_editor;
	_tmp18_ = _g_object_ref0 ((GtkWidget*) _tmp17_);
	_tmp19_ = (AdwBin*) adw_bin_new ();
	adw_bin_set_child (_tmp19_, _tmp18_);
	_g_object_unref0 (_tmp18_);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp19_, 3);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp19_, 3);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp19_, 3);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp19_, 3);
	g_object_ref_sink (_tmp19_);
	markdown_editor_card = _tmp19_;
	_tmp20_ = markdown_editor_card;
	gtk_widget_add_css_class ((GtkWidget*) _tmp20_, "card");
	_tmp21_ = self->priv->markdown_editor_revealer;
	_tmp22_ = markdown_editor_card;
	gtk_revealer_set_child (_tmp21_, (GtkWidget*) _tmp22_);
	_tmp23_ = self->priv->markdown_editor_revealer;
	gtk_revealer_set_reveal_child (_tmp23_, TRUE);
	layouts_item_sidebar_view_build_markdown_signals (self);
	_g_object_unref0 (markdown_editor_card);
}

static void
__lambda502_ (LayoutsItemSidebarView* self)
{
	layouts_item_sidebar_view_update_content_description (self);
}

static void
___lambda502__widgets_markdown_editor_text_changed (WidgetsMarkdownEditor* _sender,
                                                    const gchar* text,
                                                    gpointer self)
{
	__lambda502_ ((LayoutsItemSidebarView*) self);
}

static void
layouts_item_sidebar_view_build_markdown_signals (LayoutsItemSidebarView* self)
{
	GeeHashMap* _tmp0_;
	WidgetsMarkdownEditor* _tmp1_;
	gulong _tmp2_;
	WidgetsMarkdownEditor* _tmp3_;
	GtkSourceBuffer* _tmp4_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->markdown_handlerses;
	_tmp1_ = self->priv->markdown_editor;
	_tmp2_ = g_signal_connect_object (_tmp1_, "text-changed", (GCallback) ___lambda502__widgets_markdown_editor_text_changed, self, 0);
	_tmp3_ = self->priv->markdown_editor;
	_tmp4_ = _tmp3_->buffer;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp0_, (gpointer) ((guintptr) _tmp2_), (GObject*) _tmp4_);
}

static gboolean
__lambda501_ (LayoutsItemSidebarView* self)
{
	GtkRevealer* _tmp0_;
	gboolean result;
	_tmp0_ = self->priv->markdown_editor_revealer;
	gtk_revealer_set_child (_tmp0_, NULL);
	self->priv->destroy_editor_timeout_id = (guint) 0;
	result = G_SOURCE_REMOVE;
	return result;
}

static gboolean
___lambda501__gsource_func (gpointer self)
{
	gboolean result;
	result = __lambda501_ ((LayoutsItemSidebarView*) self);
	return result;
}

static void
layouts_item_sidebar_view_destroy_markdown_editor (LayoutsItemSidebarView* self)
{
	WidgetsMarkdownEditor* _tmp0_;
	GtkRevealer* _tmp2_;
	GtkRevealer* _tmp3_;
	guint _tmp4_;
	guint _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->markdown_editor;
	if (_tmp0_ != NULL) {
		WidgetsMarkdownEditor* _tmp1_;
		_tmp1_ = self->priv->markdown_editor;
		widgets_markdown_editor_cleanup (_tmp1_);
	}
	layouts_item_sidebar_view_destroy_markdown_signals (self);
	_g_object_unref0 (self->priv->markdown_editor);
	self->priv->markdown_editor = NULL;
	if (self->priv->destroy_editor_timeout_id != ((guint) 0)) {
		g_source_remove (self->priv->destroy_editor_timeout_id);
		self->priv->destroy_editor_timeout_id = (guint) 0;
	}
	_tmp2_ = self->priv->markdown_editor_revealer;
	gtk_revealer_set_reveal_child (_tmp2_, FALSE);
	_tmp3_ = self->priv->markdown_editor_revealer;
	_tmp4_ = gtk_revealer_get_transition_duration (_tmp3_);
	_tmp5_ = _tmp4_;
	self->priv->destroy_editor_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT, _tmp5_, ___lambda501__gsource_func, g_object_ref (self), g_object_unref);
}

static void
layouts_item_sidebar_view_destroy_markdown_signals (LayoutsItemSidebarView* self)
{
	GeeHashMap* _tmp25_;
	g_return_if_fail (self != NULL);
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp0_;
		GeeSet* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
		_tmp0_ = self->priv->markdown_handlerses;
		_tmp1_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_entry_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp7_;
			gpointer _tmp8_;
			gboolean _tmp9_ = FALSE;
			GeeMapEntry* _tmp10_;
			gconstpointer _tmp11_;
			gconstpointer _tmp12_;
			_tmp6_ = _entry_it;
			if (!gee_iterator_next (_tmp6_)) {
				break;
			}
			_tmp7_ = _entry_it;
			_tmp8_ = gee_iterator_get (_tmp7_);
			entry = (GeeMapEntry*) _tmp8_;
			_tmp10_ = entry;
			_tmp11_ = gee_map_entry_get_value (_tmp10_);
			_tmp12_ = _tmp11_;
			if (((GObject*) _tmp12_) != NULL) {
				GeeMapEntry* _tmp13_;
				gconstpointer _tmp14_;
				gconstpointer _tmp15_;
				GeeMapEntry* _tmp16_;
				gconstpointer _tmp17_;
				gconstpointer _tmp18_;
				_tmp13_ = entry;
				_tmp14_ = gee_map_entry_get_value (_tmp13_);
				_tmp15_ = _tmp14_;
				_tmp16_ = entry;
				_tmp17_ = gee_map_entry_get_key (_tmp16_);
				_tmp18_ = _tmp17_;
				_tmp9_ = g_signal_handler_is_connected ((GObject*) _tmp15_, (gulong) ((guintptr) _tmp18_));
			} else {
				_tmp9_ = FALSE;
			}
			if (_tmp9_) {
				GeeMapEntry* _tmp19_;
				gconstpointer _tmp20_;
				gconstpointer _tmp21_;
				GeeMapEntry* _tmp22_;
				gconstpointer _tmp23_;
				gconstpointer _tmp24_;
				_tmp19_ = entry;
				_tmp20_ = gee_map_entry_get_value (_tmp19_);
				_tmp21_ = _tmp20_;
				_tmp22_ = entry;
				_tmp23_ = gee_map_entry_get_key (_tmp22_);
				_tmp24_ = _tmp23_;
				g_signal_handler_disconnect ((GObject*) _tmp21_, (gulong) ((guintptr) _tmp24_));
			}
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	_tmp25_ = self->priv->markdown_handlerses;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp25_);
}

void
layouts_item_sidebar_view_update_deadline (LayoutsItemSidebarView* self,
                                           GDateTime* date)
{
	gchar* _tmp0_ = NULL;
	ObjectsItem* _tmp3_;
	ObjectsItem* _tmp4_;
	g_return_if_fail (self != NULL);
	if (date == NULL) {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("");
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp1_;
	} else {
		gchar* _tmp2_;
		_tmp2_ = g_date_time_to_string (date);
		_g_free0 (_tmp0_);
		_tmp0_ = _tmp2_;
	}
	_tmp3_ = self->priv->_item;
	objects_item_set_deadline_date (_tmp3_, _tmp0_);
	_tmp4_ = self->priv->_item;
	objects_item_update_async (_tmp4_, "");
	_g_free0 (_tmp0_);
}

static Block43Data*
block43_data_ref (Block43Data* _data43_)
{
	g_atomic_int_inc (&_data43_->_ref_count_);
	return _data43_;
}

static void
block43_data_unref (void * _userdata_)
{
	Block43Data* _data43_;
	_data43_ = (Block43Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data43_->_ref_count_)) {
		LayoutsItemSidebarView* self;
		self = _data43_->self;
		_g_object_unref0 (_data43_->dialog);
		_g_object_unref0 (_data43_->editor);
		_g_object_unref0 (self);
		g_slice_free (Block43Data, _data43_);
	}
}

static void
__lambda520_ (Block43Data* _data43_)
{
	LayoutsItemSidebarView* self;
	self = _data43_->self;
	adw_dialog_close (_data43_->dialog);
}

static void
___lambda520__widgets_markdown_editor_escape_pressed (WidgetsMarkdownEditor* _sender,
                                                      gpointer self)
{
	__lambda520_ (self);
}

static void
__lambda521_ (Block43Data* _data43_)
{
	LayoutsItemSidebarView* self;
	gchar* new_description = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	ObjectsItem* _tmp4_;
	const gchar* _tmp5_;
	const gchar* _tmp6_;
	const gchar* _tmp7_;
	self = _data43_->self;
	_tmp0_ = widgets_markdown_editor_get_text (_data43_->editor);
	_tmp1_ = _tmp0_;
	_tmp2_ = string_chomp (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	new_description = _tmp3_;
	_tmp4_ = self->priv->_item;
	_tmp5_ = objects_item_get_description (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = new_description;
	if (g_strcmp0 (_tmp6_, _tmp7_) != 0) {
		ObjectsItem* _tmp8_;
		const gchar* _tmp9_;
		ObjectsItem* _tmp10_;
		const gchar* _tmp11_;
		WidgetsMarkdownEditor* _tmp12_;
		_tmp8_ = self->priv->_item;
		_tmp9_ = new_description;
		objects_item_set_description (_tmp8_, _tmp9_);
		_tmp10_ = self->priv->_item;
		_tmp11_ = self->priv->_update_id;
		objects_item_update_async_timeout (_tmp10_, _tmp11_);
		_tmp12_ = self->priv->markdown_editor;
		if (_tmp12_ != NULL) {
			WidgetsMarkdownEditor* _tmp13_;
			ObjectsItem* _tmp14_;
			const gchar* _tmp15_;
			const gchar* _tmp16_;
			layouts_item_sidebar_view_destroy_markdown_signals (self);
			_tmp13_ = self->priv->markdown_editor;
			_tmp14_ = self->priv->_item;
			_tmp15_ = objects_item_get_description (_tmp14_);
			_tmp16_ = _tmp15_;
			widgets_markdown_editor_set_text (_tmp13_, _tmp16_);
			layouts_item_sidebar_view_build_markdown_signals (self);
		}
	}
	_g_free0 (new_description);
}

static void
___lambda521__adw_dialog_closed (AdwDialog* _sender,
                                 gpointer self)
{
	__lambda521_ (self);
}

static void
layouts_item_sidebar_view_open_description_dialog (LayoutsItemSidebarView* self)
{
	Block43Data* _data43_;
	ObjectsItem* _tmp0_;
	ObjectsProject* _tmp1_;
	ObjectsProject* _tmp2_;
	ObjectsProject* _tmp3_;
	WidgetsMarkdownEditor* _tmp4_ = NULL;
	GtkTextView* _tmp5_;
	ObjectsItem* _tmp6_;
	const gchar* _tmp7_;
	const gchar* _tmp8_;
	ObjectsItem* _tmp9_;
	gboolean _tmp10_;
	gboolean _tmp11_;
	GtkScrolledWindow* scrolled = NULL;
	GtkWidget* _tmp12_;
	GtkScrolledWindow* _tmp13_ = NULL;
	AdwToolbarView* toolbar_view = NULL;
	AdwToolbarView* _tmp14_;
	AdwHeaderBar* _tmp15_;
	AdwHeaderBar* _tmp16_;
	ObjectsItem* _tmp17_;
	const gchar* _tmp18_;
	const gchar* _tmp19_;
	gchar* _tmp20_;
	AdwDialog* _tmp21_ = NULL;
	Planify* _tmp22_;
	MainWindow* _tmp23_;
	g_return_if_fail (self != NULL);
	_data43_ = g_slice_new0 (Block43Data);
	_data43_->_ref_count_ = 1;
	_data43_->self = g_object_ref (self);
	_tmp0_ = self->priv->_item;
	_tmp1_ = objects_item_get_project (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_tmp4_ = widgets_markdown_editor_new ();
	widgets_markdown_editor_set_project (_tmp4_, _tmp3_);
	_g_object_unref0 (_tmp3_);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp4_, 16);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp4_, 16);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp4_, 16);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp4_, 16);
	g_object_ref_sink (_tmp4_);
	_data43_->editor = _tmp4_;
	_tmp5_ = _data43_->editor->text_view;
	g_object_set ((GtkWidget*) _tmp5_, "height-request", 300, NULL);
	_tmp6_ = self->priv->_item;
	_tmp7_ = objects_item_get_description (_tmp6_);
	_tmp8_ = _tmp7_;
	widgets_markdown_editor_set_text (_data43_->editor, _tmp8_);
	_tmp9_ = self->priv->_item;
	_tmp10_ = objects_item_get_completed (_tmp9_);
	_tmp11_ = _tmp10_;
	widgets_markdown_editor_set_is_editable (_data43_->editor, !_tmp11_);
	_tmp12_ = _g_object_ref0 ((GtkWidget*) _data43_->editor);
	_tmp13_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp13_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp13_, TRUE);
	gtk_scrolled_window_set_child (_tmp13_, _tmp12_);
	_g_object_unref0 (_tmp12_);
	g_object_ref_sink (_tmp13_);
	scrolled = _tmp13_;
	_tmp14_ = (AdwToolbarView*) adw_toolbar_view_new ();
	g_object_ref_sink (_tmp14_);
	toolbar_view = _tmp14_;
	_tmp15_ = (AdwHeaderBar*) adw_header_bar_new ();
	g_object_ref_sink (_tmp15_);
	_tmp16_ = _tmp15_;
	adw_toolbar_view_add_top_bar (toolbar_view, (GtkWidget*) _tmp16_);
	_g_object_unref0 (_tmp16_);
	adw_toolbar_view_set_content (toolbar_view, (GtkWidget*) scrolled);
	_tmp17_ = self->priv->_item;
	_tmp18_ = objects_item_get_content (_tmp17_);
	_tmp19_ = _tmp18_;
	_tmp20_ = g_strdup (_tmp19_);
	_tmp21_ = adw_dialog_new ();
	adw_dialog_set_title (_tmp21_, _tmp20_);
	_g_free0 (_tmp20_);
	adw_dialog_set_content_width (_tmp21_, 700);
	adw_dialog_set_content_height (_tmp21_, 500);
	g_object_ref_sink (_tmp21_);
	_data43_->dialog = _tmp21_;
	adw_dialog_set_child (_data43_->dialog, (GtkWidget*) toolbar_view);
	_tmp22_ = planify__instance;
	_tmp23_ = _tmp22_->main_window;
	adw_dialog_present (_data43_->dialog, (GtkWidget*) _tmp23_);
	g_signal_connect_data (_data43_->editor, "escape-pressed", (GCallback) ___lambda520__widgets_markdown_editor_escape_pressed, block43_data_ref (_data43_), (GClosureNotify) block43_data_unref, 0);
	g_signal_connect_data (_data43_->dialog, "closed", (GCallback) ___lambda521__adw_dialog_closed, block43_data_ref (_data43_), (GClosureNotify) block43_data_unref, 0);
	_g_object_unref0 (toolbar_view);
	_g_object_unref0 (scrolled);
	block43_data_unref (_data43_);
	_data43_ = NULL;
}

LayoutsItemSidebarView*
layouts_item_sidebar_view_construct (GType object_type)
{
	LayoutsItemSidebarView * self = NULL;
	self = (LayoutsItemSidebarView*) g_object_new (object_type, NULL);
	return self;
}

LayoutsItemSidebarView*
layouts_item_sidebar_view_new (void)
{
	return layouts_item_sidebar_view_construct (LAYOUTS_TYPE_ITEM_SIDEBAR_VIEW);
}

ObjectsItem*
layouts_item_sidebar_view_get_item (LayoutsItemSidebarView* self)
{
	ObjectsItem* result;
	ObjectsItem* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_item;
	result = _tmp0_;
	return result;
}

void
layouts_item_sidebar_view_set_item (LayoutsItemSidebarView* self,
                                    ObjectsItem* value)
{
	ObjectsItem* old_value;
	g_return_if_fail (self != NULL);
	old_value = layouts_item_sidebar_view_get_item (self);
	if (old_value != value) {
		ObjectsItem* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_item);
		self->priv->_item = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, layouts_item_sidebar_view_properties[LAYOUTS_ITEM_SIDEBAR_VIEW_ITEM_PROPERTY]);
	}
}

const gchar*
layouts_item_sidebar_view_get_update_id (LayoutsItemSidebarView* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_update_id;
	result = _tmp0_;
	return result;
}

void
layouts_item_sidebar_view_set_update_id (LayoutsItemSidebarView* self,
                                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = layouts_item_sidebar_view_get_update_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_update_id);
		self->priv->_update_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, layouts_item_sidebar_view_properties[LAYOUTS_ITEM_SIDEBAR_VIEW_UPDATE_ID_PROPERTY]);
	}
}

gboolean
layouts_item_sidebar_view_get_show_completed (LayoutsItemSidebarView* self)
{
	gboolean result;
	ServicesSettings* _tmp0_;
	ServicesSettings* _tmp1_;
	GSettings* _tmp2_;
	gboolean _tmp3_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = services_settings_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = _tmp1_->settings;
	_tmp3_ = g_settings_get_boolean (_tmp2_, "always-show-completed-subtasks");
	_g_object_unref0 (_tmp1_);
	result = _tmp3_;
	return result;
}

static Block44Data*
block44_data_ref (Block44Data* _data44_)
{
	g_atomic_int_inc (&_data44_->_ref_count_);
	return _data44_;
}

static void
block44_data_unref (void * _userdata_)
{
	Block44Data* _data44_;
	_data44_ = (Block44Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data44_->_ref_count_)) {
		LayoutsItemSidebarView* self;
		self = _data44_->self;
		_g_object_unref0 (_data44_->adapter);
		_g_object_unref0 (self);
		g_slice_free (Block44Data, _data44_);
	}
}

static void
_layouts_item_sidebar_view___lambda522_ (Block44Data* _data44_)
{
	LayoutsItemSidebarView* self;
	SpellingTextBufferAdapter* _tmp0_;
	ServicesSettings* _tmp1_;
	ServicesSettings* _tmp2_;
	GSettings* _tmp3_;
	self = _data44_->self;
	_tmp0_ = _data44_->adapter;
	_tmp1_ = services_settings_get_default ();
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_->settings;
	spelling_text_buffer_adapter_set_enabled (_tmp0_, g_settings_get_boolean (_tmp3_, "spell-checking-enabled"));
	_g_object_unref0 (_tmp2_);
}

static void
__layouts_item_sidebar_view___lambda522__g_settings_changed (GSettings* _sender,
                                                             const gchar* key,
                                                             gpointer self)
{
	_layouts_item_sidebar_view___lambda522_ (self);
}

static void
_layouts_item_sidebar_view___lambda523_ (LayoutsItemSidebarView* self)
{
	layouts_item_sidebar_view_open_description_dialog (self);
}

static void
__layouts_item_sidebar_view___lambda523__gtk_button_clicked (GtkButton* _sender,
                                                             gpointer self)
{
	_layouts_item_sidebar_view___lambda523_ ((LayoutsItemSidebarView*) self);
}

static void
_layouts_item_sidebar_view___lambda524_ (LayoutsItemSidebarView* self)
{
	ServicesEventBus* _tmp0_;
	ServicesEventBus* _tmp1_;
	_tmp0_ = services_event_bus_get_default ();
	_tmp1_ = _tmp0_;
	g_signal_emit_by_name (_tmp1_, "close-item");
	_g_object_unref0 (_tmp1_);
}

static void
__layouts_item_sidebar_view___lambda524__gtk_button_clicked (GtkButton* _sender,
                                                             gpointer self)
{
	_layouts_item_sidebar_view___lambda524_ ((LayoutsItemSidebarView*) self);
}

static void
_layouts_item_sidebar_view___lambda525_ (LayoutsItemSidebarView* self,
                                         guint keyval,
                                         guint keycode,
                                         GdkModifierType state)
{
	layouts_item_sidebar_view_update_content_description (self);
}

static void
__layouts_item_sidebar_view___lambda525__gtk_event_controller_key_key_released (GtkEventControllerKey* _sender,
                                                                                guint keyval,
                                                                                guint keycode,
                                                                                GdkModifierType state,
                                                                                gpointer self)
{
	_layouts_item_sidebar_view___lambda525_ ((LayoutsItemSidebarView*) self, keyval, keycode, state);
}

static void
_layouts_item_sidebar_view___lambda526_ (LayoutsItemSidebarView* self)
{
	WidgetsScheduleButton* _tmp0_;
	ObjectsDueDate* _tmp1_;
	ObjectsDueDate* _tmp2_;
	_tmp0_ = self->priv->schedule_button;
	_tmp1_ = widgets_schedule_button_get_duedate (_tmp0_);
	_tmp2_ = _tmp1_;
	layouts_item_sidebar_view_update_due (self, _tmp2_);
}

static void
__layouts_item_sidebar_view___lambda526__widgets_schedule_button_duedate_changed (WidgetsScheduleButton* _sender,
                                                                                  gpointer self)
{
	_layouts_item_sidebar_view___lambda526_ ((LayoutsItemSidebarView*) self);
}

static void
_layouts_item_sidebar_view___lambda527_ (LayoutsItemSidebarView* self,
                                         gint priority)
{
	ObjectsItem* _tmp0_;
	gint _tmp1_;
	gint _tmp2_;
	_tmp0_ = self->priv->_item;
	_tmp1_ = objects_item_get_priority (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_ != priority) {
		ObjectsItem* _tmp3_;
		gboolean _tmp4_ = FALSE;
		ObjectsItem* _tmp5_;
		ObjectsProject* _tmp6_;
		ObjectsProject* _tmp7_;
		SourceType _tmp8_;
		SourceType _tmp9_;
		_tmp3_ = self->priv->_item;
		objects_item_set_priority (_tmp3_, priority);
		_tmp5_ = self->priv->_item;
		_tmp6_ = objects_item_get_project (_tmp5_);
		_tmp7_ = _tmp6_;
		_tmp8_ = objects_project_get_source_type (_tmp7_);
		_tmp9_ = _tmp8_;
		if (_tmp9_ == SOURCE_TYPE_TODOIST) {
			_tmp4_ = TRUE;
		} else {
			ObjectsItem* _tmp10_;
			ObjectsProject* _tmp11_;
			ObjectsProject* _tmp12_;
			SourceType _tmp13_;
			SourceType _tmp14_;
			_tmp10_ = self->priv->_item;
			_tmp11_ = objects_item_get_project (_tmp10_);
			_tmp12_ = _tmp11_;
			_tmp13_ = objects_project_get_source_type (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp4_ = _tmp14_ == SOURCE_TYPE_CALDAV;
		}
		if (_tmp4_) {
			ObjectsItem* _tmp15_;
			_tmp15_ = self->priv->_item;
			objects_item_update_async (_tmp15_, "");
		} else {
			ObjectsItem* _tmp16_;
			_tmp16_ = self->priv->_item;
			objects_item_update_local (_tmp16_);
		}
	}
}

static void
__layouts_item_sidebar_view___lambda527__widgets_priority_button_changed (WidgetsPriorityButton* _sender,
                                                                          gint priority,
                                                                          gpointer self)
{
	_layouts_item_sidebar_view___lambda527_ ((LayoutsItemSidebarView*) self, priority);
}

static void
_layouts_item_sidebar_view___lambda528_ (LayoutsItemSidebarView* self,
                                         GeeHashMap* labels)
{
	g_return_if_fail (labels != NULL);
	layouts_item_sidebar_view_update_labels (self, labels);
}

static void
__layouts_item_sidebar_view___lambda528__widgets_label_picker_label_button_labels_changed (WidgetsLabelPickerLabelButton* _sender,
                                                                                           GeeHashMap* labels,
                                                                                           gpointer self)
{
	_layouts_item_sidebar_view___lambda528_ ((LayoutsItemSidebarView*) self, labels);
}

static void
_layouts_item_sidebar_view___lambda529_ (LayoutsItemSidebarView* self)
{
	ObjectsItem* _tmp0_;
	ObjectsItem* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	_tmp0_ = self->priv->_item;
	_tmp1_ = self->priv->_item;
	_tmp2_ = objects_item_get_pinned (_tmp1_);
	_tmp3_ = _tmp2_;
	objects_item_update_pin (_tmp0_, !_tmp3_);
}

static void
__layouts_item_sidebar_view___lambda529__widgets_pin_button_changed (WidgetsPinButton* _sender,
                                                                     gpointer self)
{
	_layouts_item_sidebar_view___lambda529_ ((LayoutsItemSidebarView*) self);
}

static void
_layouts_item_sidebar_view___lambda530_ (LayoutsItemSidebarView* self,
                                         ObjectsSection* section)
{
	ObjectsItem* _tmp0_;
	ObjectsProject* _tmp1_;
	ObjectsProject* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	g_return_if_fail (section != NULL);
	_tmp0_ = self->priv->_item;
	_tmp1_ = objects_item_get_project (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = objects_base_object_get_id ((ObjectsBaseObject*) section);
	_tmp4_ = _tmp3_;
	layouts_item_sidebar_view_move (self, _tmp2_, _tmp4_, "");
}

static void
__layouts_item_sidebar_view___lambda530__widgets_section_picker_section_button_selected (WidgetsSectionPickerSectionButton* _sender,
                                                                                         ObjectsSection* section,
                                                                                         gpointer self)
{
	_layouts_item_sidebar_view___lambda530_ ((LayoutsItemSidebarView*) self, section);
}

static Block45Data*
block45_data_ref (Block45Data* _data45_)
{
	g_atomic_int_inc (&_data45_->_ref_count_);
	return _data45_;
}

static void
block45_data_unref (void * _userdata_)
{
	Block45Data* _data45_;
	_data45_ = (Block45Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data45_->_ref_count_)) {
		LayoutsItemSidebarView* self;
		self = _data45_->self;
		_g_object_unref0 (_data45_->reminder);
		_g_object_unref0 (self);
		g_slice_free (Block45Data, _data45_);
	}
}

static void
___lambda532_ (Block45Data* _data45_,
               GObject* obj,
               GAsyncResult* res)
{
	LayoutsItemSidebarView* self;
	HttpResponse* response = NULL;
	ServicesTodoist* _tmp0_;
	ServicesTodoist* _tmp1_;
	HttpResponse* _tmp2_;
	HttpResponse* _tmp3_;
	ObjectsItem* _tmp4_;
	HttpResponse* _tmp5_;
	gboolean _tmp6_;
	gboolean _tmp7_;
	ObjectsItem* _tmp15_;
	ObjectsReminder* _tmp16_;
	ObjectsReminder* _tmp17_;
	self = _data45_->self;
	g_return_if_fail (res != NULL);
	_tmp0_ = services_todoist_get_default ();
	_tmp1_ = _tmp0_;
	_tmp2_ = services_todoist_add_finish (_tmp1_, res);
	_tmp3_ = _tmp2_;
	_g_object_unref0 (_tmp1_);
	response = _tmp3_;
	_tmp4_ = self->priv->_item;
	objects_base_object_set_loading ((ObjectsBaseObject*) _tmp4_, FALSE);
	_tmp5_ = response;
	_tmp6_ = http_response_get_status (_tmp5_);
	_tmp7_ = _tmp6_;
	if (_tmp7_) {
		HttpResponse* _tmp8_;
		const gchar* _tmp9_;
		const gchar* _tmp10_;
		_tmp8_ = response;
		_tmp9_ = http_response_get_data (_tmp8_);
		_tmp10_ = _tmp9_;
		objects_base_object_set_id ((ObjectsBaseObject*) _data45_->reminder, _tmp10_);
	} else {
		Util* _tmp11_;
		Util* _tmp12_;
		gchar* _tmp13_;
		gchar* _tmp14_;
		_tmp11_ = util_get_default ();
		_tmp12_ = _tmp11_;
		_tmp13_ = util_generate_id (_tmp12_, (ObjectsBaseObject*) _data45_->reminder);
		_tmp14_ = _tmp13_;
		objects_base_object_set_id ((ObjectsBaseObject*) _data45_->reminder, _tmp14_);
		_g_free0 (_tmp14_);
		_g_object_unref0 (_tmp12_);
	}
	_tmp15_ = self->priv->_item;
	_tmp16_ = objects_item_add_reminder_if_not_exists (_tmp15_, _data45_->reminder, TRUE);
	_tmp17_ = _tmp16_;
	_g_object_unref0 (_tmp17_);
	_http_response_unref0 (response);
}

static void
____lambda532__gasync_ready_callback (GObject* source_object,
                                      GAsyncResult* res,
                                      gpointer self)
{
	___lambda532_ (self, source_object, res);
	block45_data_unref (self);
}

static void
_layouts_item_sidebar_view___lambda531_ (LayoutsItemSidebarView* self,
                                         ObjectsReminder* reminder)
{
	Block45Data* _data45_;
	ObjectsReminder* _tmp0_;
	ObjectsItem* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	ObjectsItem* _tmp4_;
	ObjectsProject* _tmp5_;
	ObjectsProject* _tmp6_;
	SourceType _tmp7_;
	SourceType _tmp8_;
	g_return_if_fail (reminder != NULL);
	_data45_ = g_slice_new0 (Block45Data);
	_data45_->_ref_count_ = 1;
	_data45_->self = g_object_ref (self);
	_tmp0_ = _g_object_ref0 (reminder);
	_g_object_unref0 (_data45_->reminder);
	_data45_->reminder = _tmp0_;
	_tmp1_ = self->priv->_item;
	_tmp2_ = objects_base_object_get_id ((ObjectsBaseObject*) _tmp1_);
	_tmp3_ = _tmp2_;
	objects_reminder_set_item_id (_data45_->reminder, _tmp3_);
	_tmp4_ = self->priv->_item;
	_tmp5_ = objects_item_get_project (_tmp4_);
	_tmp6_ = _tmp5_;
	_tmp7_ = objects_project_get_source_type (_tmp6_);
	_tmp8_ = _tmp7_;
	if (_tmp8_ == SOURCE_TYPE_TODOIST) {
		ObjectsItem* _tmp9_;
		ServicesTodoist* _tmp10_;
		ServicesTodoist* _tmp11_;
		_tmp9_ = self->priv->_item;
		objects_base_object_set_loading ((ObjectsBaseObject*) _tmp9_, TRUE);
		_tmp10_ = services_todoist_get_default ();
		_tmp11_ = _tmp10_;
		services_todoist_add (_tmp11_, (ObjectsBaseObject*) _data45_->reminder, ____lambda532__gasync_ready_callback, block45_data_ref (_data45_));
		_g_object_unref0 (_tmp11_);
	} else {
		Util* _tmp12_;
		Util* _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
		ObjectsItem* _tmp16_;
		ObjectsReminder* _tmp17_;
		ObjectsReminder* _tmp18_;
		_tmp12_ = util_get_default ();
		_tmp13_ = _tmp12_;
		_tmp14_ = util_generate_id (_tmp13_, (ObjectsBaseObject*) _data45_->reminder);
		_tmp15_ = _tmp14_;
		objects_base_object_set_id ((ObjectsBaseObject*) _data45_->reminder, _tmp15_);
		_g_free0 (_tmp15_);
		_g_object_unref0 (_tmp13_);
		_tmp16_ = self->priv->_item;
		_tmp17_ = objects_item_add_reminder_if_not_exists (_tmp16_, _data45_->reminder, TRUE);
		_tmp18_ = _tmp17_;
		_g_object_unref0 (_tmp18_);
	}
	block45_data_unref (_data45_);
	_data45_ = NULL;
}

static void
__layouts_item_sidebar_view___lambda531__widgets_reminder_picker_reminder_button_reminder_added (WidgetsReminderPickerReminderButton* _sender,
                                                                                                 ObjectsReminder* reminder,
                                                                                                 gpointer self)
{
	_layouts_item_sidebar_view___lambda531_ ((LayoutsItemSidebarView*) self, reminder);
}

static void
_layouts_item_sidebar_view___lambda533_ (LayoutsItemSidebarView* self,
                                         gboolean active)
{
	layouts_item_sidebar_view_checked_toggled (self, active);
}

static void
__layouts_item_sidebar_view___lambda533__widgets_status_button_changed (WidgetsStatusButton* _sender,
                                                                        gboolean status,
                                                                        gpointer self)
{
	_layouts_item_sidebar_view___lambda533_ ((LayoutsItemSidebarView*) self, status);
}

static void
_layouts_item_sidebar_view___lambda534_ (LayoutsItemSidebarView* self)
{
	ObjectsItem* _tmp0_;
	gboolean _tmp1_;
	gboolean _tmp2_;
	_tmp0_ = self->priv->_item;
	_tmp1_ = objects_item_get_has_parent (_tmp0_);
	_tmp2_ = _tmp1_;
	if (_tmp2_) {
		ServicesEventBus* _tmp3_;
		ServicesEventBus* _tmp4_;
		ObjectsItem* _tmp5_;
		ObjectsItem* _tmp6_;
		ObjectsItem* _tmp7_;
		_tmp3_ = services_event_bus_get_default ();
		_tmp4_ = _tmp3_;
		_tmp5_ = self->priv->_item;
		_tmp6_ = objects_item_get_parent (_tmp5_);
		_tmp7_ = _tmp6_;
		g_signal_emit_by_name (_tmp4_, "open-item", _tmp7_);
		_g_object_unref0 (_tmp4_);
	} else {
		ServicesEventBus* _tmp8_;
		ServicesEventBus* _tmp9_;
		_tmp8_ = services_event_bus_get_default ();
		_tmp9_ = _tmp8_;
		g_signal_emit_by_name (_tmp9_, "close-item");
		_g_object_unref0 (_tmp9_);
	}
}

static void
__layouts_item_sidebar_view___lambda534__gtk_button_clicked (GtkButton* _sender,
                                                             gpointer self)
{
	_layouts_item_sidebar_view___lambda534_ ((LayoutsItemSidebarView*) self);
}

static GObject *
layouts_item_sidebar_view_constructor (GType type,
                                       guint n_construct_properties,
                                       GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	LayoutsItemSidebarView * self;
	Block44Data* _data44_;
	GtkImage* previous_icon = NULL;
	GtkImage* _tmp0_;
	GtkLabel* _tmp1_ = NULL;
	GtkLabel* _tmp2_;
	GtkBox* parent_box = NULL;
	GtkBox* _tmp3_;
	GtkBox* _tmp4_;
	GtkImage* _tmp5_;
	GtkBox* _tmp6_;
	GtkLabel* _tmp7_;
	GtkBox* _tmp8_;
	GtkWidget* _tmp9_;
	GtkButton* _tmp10_ = NULL;
	GtkButton* _tmp11_;
	GtkButton* close_button = NULL;
	gchar* _tmp12_;
	GtkButton* _tmp13_ = NULL;
	GtkMenuButton* menu_button = NULL;
	gchar* _tmp14_;
	GtkMenuButton* _tmp15_ = NULL;
	GtkMenuButton* _tmp16_;
	GtkPopover* _tmp17_;
	GtkPopover* _tmp18_;
	GtkMenuButton* _tmp19_;
	WidgetsPinButton* _tmp20_;
	AdwSpinner* spinner = NULL;
	AdwSpinner* _tmp21_ = NULL;
	AdwSpinner* _tmp22_;
	GtkWidget* _tmp23_;
	GtkRevealer* _tmp24_ = NULL;
	AdwHeaderBar* headerbar = NULL;
	GtkLabel* _tmp25_;
	gchar* _tmp26_;
	AdwHeaderBar* _tmp27_ = NULL;
	AdwHeaderBar* _tmp28_;
	GtkButton* _tmp29_;
	AdwHeaderBar* _tmp30_;
	GtkButton* _tmp31_;
	AdwHeaderBar* _tmp32_;
	GtkMenuButton* _tmp33_;
	AdwHeaderBar* _tmp34_;
	WidgetsPinButton* _tmp35_;
	AdwHeaderBar* _tmp36_;
	GtkRevealer* _tmp37_;
	gchar* _tmp38_;
	WidgetsTextView* _tmp39_ = NULL;
	WidgetsTextView* _tmp40_;
	WidgetsTextView* _tmp41_;
	GtkSourceBuffer* source_buffer = NULL;
	GtkSourceBuffer* _tmp42_;
	WidgetsTextView* _tmp43_;
	GtkSourceBuffer* _tmp44_;
	GtkSourceBuffer* _tmp45_;
	SpellingChecker* _tmp46_;
	SpellingTextBufferAdapter* _tmp47_;
	WidgetsTextView* _tmp48_;
	SpellingTextBufferAdapter* _tmp49_;
	GMenuModel* _tmp50_;
	WidgetsTextView* _tmp51_;
	SpellingTextBufferAdapter* _tmp52_;
	SpellingTextBufferAdapter* _tmp53_;
	ServicesSettings* _tmp54_;
	ServicesSettings* _tmp55_;
	GSettings* _tmp56_;
	ServicesSettings* _tmp57_;
	ServicesSettings* _tmp58_;
	GSettings* _tmp59_;
	AdwPreferencesGroup* content_group = NULL;
	AdwPreferencesGroup* _tmp60_ = NULL;
	AdwPreferencesGroup* _tmp61_;
	AdwPreferencesGroup* _tmp62_;
	WidgetsTextView* _tmp63_;
	WidgetsStatusButton* _tmp64_;
	WidgetsSectionPickerSectionButton* _tmp65_;
	WidgetsScheduleButton* _tmp66_;
	WidgetsPriorityButton* _tmp67_;
	WidgetsLabelPickerLabelButton* _tmp68_;
	WidgetsReminderPickerReminderButton* _tmp69_;
	WidgetsDeadlineButton* _tmp70_;
	GtkGrid* properties_grid = NULL;
	GtkGrid* _tmp71_ = NULL;
	GtkGrid* _tmp72_;
	WidgetsStatusButton* _tmp73_;
	GtkGrid* _tmp74_;
	WidgetsSectionPickerSectionButton* _tmp75_;
	GtkGrid* _tmp76_;
	WidgetsScheduleButton* _tmp77_;
	GtkGrid* _tmp78_;
	WidgetsPriorityButton* _tmp79_;
	GtkGrid* _tmp80_;
	WidgetsLabelPickerLabelButton* _tmp81_;
	GtkGrid* _tmp82_;
	WidgetsReminderPickerReminderButton* _tmp83_;
	GtkGrid* _tmp84_;
	WidgetsDeadlineButton* _tmp85_;
	AdwPreferencesGroup* properties_group = NULL;
	AdwPreferencesGroup* _tmp86_ = NULL;
	AdwPreferencesGroup* _tmp87_;
	AdwPreferencesGroup* _tmp88_;
	GtkGrid* _tmp89_;
	GtkRevealer* _tmp90_;
	GtkLabel* description_title = NULL;
	GtkLabel* _tmp91_ = NULL;
	GtkLabel* _tmp92_;
	GtkButton* expand_button = NULL;
	gchar* _tmp93_;
	GtkButton* _tmp94_ = NULL;
	GtkButton* _tmp95_;
	GtkButton* _tmp96_;
	GtkBox* description_header = NULL;
	GtkBox* _tmp97_ = NULL;
	GtkBox* _tmp98_;
	GtkLabel* _tmp99_;
	GtkBox* _tmp100_;
	GtkButton* _tmp101_;
	GtkBox* description_group = NULL;
	GtkBox* _tmp102_ = NULL;
	GtkBox* _tmp103_;
	GtkBox* _tmp104_;
	GtkBox* _tmp105_;
	GtkRevealer* _tmp106_;
	GtkButton* _tmp107_;
	WidgetsSubItems* _tmp108_ = NULL;
	WidgetsAttachments* _tmp109_ = NULL;
	GtkBox* content = NULL;
	GtkBox* _tmp110_ = NULL;
	GtkBox* _tmp111_;
	AdwPreferencesGroup* _tmp112_;
	GtkBox* _tmp113_;
	AdwPreferencesGroup* _tmp114_;
	GtkBox* _tmp115_;
	GtkBox* _tmp116_;
	GtkBox* _tmp117_;
	WidgetsSubItems* _tmp118_;
	GtkBox* _tmp119_;
	WidgetsAttachments* _tmp120_;
	WidgetsScrolledWindow* scrolled_window = NULL;
	GtkBox* _tmp121_;
	WidgetsScrolledWindow* _tmp122_;
	AdwToolbarView* toolbar_view = NULL;
	AdwToolbarView* _tmp123_ = NULL;
	AdwToolbarView* _tmp124_;
	AdwHeaderBar* _tmp125_;
	AdwToolbarView* _tmp126_;
	WidgetsScrolledWindow* _tmp127_;
	AdwToolbarView* _tmp128_;
	GtkButton* _tmp129_;
	GtkEventControllerKey* content_controller_key = NULL;
	GtkEventControllerKey* _tmp130_;
	WidgetsTextView* _tmp131_;
	GtkEventControllerKey* _tmp132_;
	GtkEventController* _tmp133_;
	GtkEventControllerKey* _tmp134_;
	WidgetsScheduleButton* _tmp135_;
	WidgetsPriorityButton* _tmp136_;
	WidgetsLabelPickerLabelButton* _tmp137_;
	WidgetsPinButton* _tmp138_;
	WidgetsSectionPickerSectionButton* _tmp139_;
	WidgetsReminderPickerReminderButton* _tmp140_;
	WidgetsStatusButton* _tmp141_;
	GtkButton* _tmp142_;
	parent_class = G_OBJECT_CLASS (layouts_item_sidebar_view_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, LAYOUTS_TYPE_ITEM_SIDEBAR_VIEW, LayoutsItemSidebarView);
	_data44_ = g_slice_new0 (Block44Data);
	_data44_->_ref_count_ = 1;
	_data44_->self = g_object_ref (self);
	_tmp0_ = (GtkImage*) gtk_image_new_from_icon_name ("go-previous-symbolic");
	g_object_ref_sink (_tmp0_);
	previous_icon = _tmp0_;
	_tmp1_ = (GtkLabel*) gtk_label_new (NULL);
	gtk_label_set_ellipsize (_tmp1_, PANGO_ELLIPSIZE_END);
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->parent_label);
	self->priv->parent_label = _tmp1_;
	_tmp2_ = self->priv->parent_label;
	gtk_widget_add_css_class ((GtkWidget*) _tmp2_, "font-bold");
	_tmp3_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
	g_object_ref_sink (_tmp3_);
	parent_box = _tmp3_;
	_tmp4_ = parent_box;
	_tmp5_ = previous_icon;
	gtk_box_append (_tmp4_, (GtkWidget*) _tmp5_);
	_tmp6_ = parent_box;
	_tmp7_ = self->priv->parent_label;
	gtk_box_append (_tmp6_, (GtkWidget*) _tmp7_);
	_tmp8_ = parent_box;
	_tmp9_ = _g_object_ref0 ((GtkWidget*) _tmp8_);
	_tmp10_ = (GtkButton*) gtk_button_new ();
	gtk_button_set_child (_tmp10_, _tmp9_);
	_g_object_unref0 (_tmp9_);
	gtk_widget_set_valign ((GtkWidget*) _tmp10_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp10_);
	_g_object_unref0 (self->priv->parent_back_button);
	self->priv->parent_back_button = _tmp10_;
	_tmp11_ = self->priv->parent_back_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp11_, "flat");
	_tmp12_ = g_strdup (_ ("Close Detail"));
	_tmp13_ = (GtkButton*) gtk_button_new_from_icon_name ("step-out-symbolic");
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp13_, _tmp12_);
	_g_free0 (_tmp12_);
	g_object_ref_sink (_tmp13_);
	close_button = _tmp13_;
	_tmp14_ = g_strdup ("view-more-symbolic");
	_tmp15_ = (GtkMenuButton*) gtk_menu_button_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp15_, GTK_ALIGN_CENTER);
	gtk_widget_set_halign ((GtkWidget*) _tmp15_, GTK_ALIGN_CENTER);
	gtk_menu_button_set_icon_name (_tmp15_, _tmp14_);
	_g_free0 (_tmp14_);
	g_object_ref_sink (_tmp15_);
	menu_button = _tmp15_;
	_tmp16_ = menu_button;
	_tmp17_ = layouts_item_sidebar_view_build_context_menu (self);
	_tmp18_ = _tmp17_;
	gtk_menu_button_set_popover (_tmp16_, _tmp18_);
	_g_object_unref0 (_tmp18_);
	_tmp19_ = menu_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp19_, "flat");
	_tmp20_ = widgets_pin_button_new ();
	g_object_ref_sink (_tmp20_);
	_g_object_unref0 (self->priv->pin_button);
	self->priv->pin_button = _tmp20_;
	_tmp21_ = (AdwSpinner*) adw_spinner_new ();
	gtk_widget_set_valign ((GtkWidget*) _tmp21_, GTK_ALIGN_CENTER);
	gtk_widget_set_halign ((GtkWidget*) _tmp21_, GTK_ALIGN_CENTER);
	g_object_ref_sink (_tmp21_);
	spinner = _tmp21_;
	_tmp22_ = spinner;
	_tmp23_ = _g_object_ref0 ((GtkWidget*) _tmp22_);
	_tmp24_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_transition_type (_tmp24_, GTK_REVEALER_TRANSITION_TYPE_CROSSFADE);
	gtk_revealer_set_child (_tmp24_, _tmp23_);
	_g_object_unref0 (_tmp23_);
	g_object_ref_sink (_tmp24_);
	_g_object_unref0 (self->priv->spinner_revealer);
	self->priv->spinner_revealer = _tmp24_;
	_tmp25_ = (GtkLabel*) gtk_label_new (NULL);
	g_object_ref_sink (_tmp25_);
	_tmp26_ = g_strdup (":");
	_tmp27_ = (AdwHeaderBar*) adw_header_bar_new ();
	adw_header_bar_set_title_widget (_tmp27_, (GtkWidget*) _tmp25_);
	_g_object_unref0 (_tmp25_);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp27_, TRUE);
	adw_header_bar_set_decoration_layout (_tmp27_, _tmp26_);
	_g_free0 (_tmp26_);
	g_object_ref_sink (_tmp27_);
	headerbar = _tmp27_;
	_tmp28_ = headerbar;
	_tmp29_ = self->priv->parent_back_button;
	adw_header_bar_pack_start (_tmp28_, (GtkWidget*) _tmp29_);
	_tmp30_ = headerbar;
	_tmp31_ = close_button;
	adw_header_bar_pack_end (_tmp30_, (GtkWidget*) _tmp31_);
	_tmp32_ = headerbar;
	_tmp33_ = menu_button;
	adw_header_bar_pack_end (_tmp32_, (GtkWidget*) _tmp33_);
	_tmp34_ = headerbar;
	_tmp35_ = self->priv->pin_button;
	adw_header_bar_pack_end (_tmp34_, (GtkWidget*) _tmp35_);
	_tmp36_ = headerbar;
	_tmp37_ = self->priv->spinner_revealer;
	adw_header_bar_pack_end (_tmp36_, (GtkWidget*) _tmp37_);
	_tmp38_ = g_strdup (_ ("To-do name"));
	_tmp39_ = widgets_text_view_new ();
	gtk_text_view_set_left_margin ((GtkTextView*) _tmp39_, 12);
	gtk_text_view_set_right_margin ((GtkTextView*) _tmp39_, 12);
	gtk_text_view_set_top_margin ((GtkTextView*) _tmp39_, 12);
	gtk_text_view_set_bottom_margin ((GtkTextView*) _tmp39_, 12);
	g_object_set ((GtkWidget*) _tmp39_, "height-request", 64, NULL);
	gtk_text_view_set_wrap_mode ((GtkTextView*) _tmp39_, GTK_WRAP_WORD);
	gtk_text_view_set_accepts_tab ((GtkTextView*) _tmp39_, FALSE);
	widgets_text_view_set_placeholder_text (_tmp39_, _tmp38_);
	_g_free0 (_tmp38_);
	g_object_ref_sink (_tmp39_);
	_g_object_unref0 (self->priv->content_textview);
	self->priv->content_textview = _tmp39_;
	_tmp40_ = self->priv->content_textview;
	gtk_widget_remove_css_class ((GtkWidget*) _tmp40_, "view");
	_tmp41_ = self->priv->content_textview;
	gtk_widget_add_css_class ((GtkWidget*) _tmp41_, "card");
	_tmp42_ = gtk_source_buffer_new (NULL);
	source_buffer = _tmp42_;
	_tmp43_ = self->priv->content_textview;
	_tmp44_ = source_buffer;
	gtk_text_view_set_buffer ((GtkTextView*) _tmp43_, (GtkTextBuffer*) _tmp44_);
	_tmp45_ = source_buffer;
	_tmp46_ = spelling_checker_get_default ();
	_tmp47_ = spelling_text_buffer_adapter_new (_tmp45_, _tmp46_);
	_data44_->adapter = _tmp47_;
	_tmp48_ = self->priv->content_textview;
	_tmp49_ = _data44_->adapter;
	_tmp50_ = spelling_text_buffer_adapter_get_menu_model (_tmp49_);
	gtk_text_view_set_extra_menu ((GtkTextView*) _tmp48_, _tmp50_);
	_tmp51_ = self->priv->content_textview;
	_tmp52_ = _data44_->adapter;
	gtk_widget_insert_action_group ((GtkWidget*) _tmp51_, "spelling", (GActionGroup*) _tmp52_);
	_tmp53_ = _data44_->adapter;
	_tmp54_ = services_settings_get_default ();
	_tmp55_ = _tmp54_;
	_tmp56_ = _tmp55_->settings;
	spelling_text_buffer_adapter_set_enabled (_tmp53_, g_settings_get_boolean (_tmp56_, "spell-checking-enabled"));
	_g_object_unref0 (_tmp55_);
	_tmp57_ = services_settings_get_default ();
	_tmp58_ = _tmp57_;
	_tmp59_ = _tmp58_->settings;
	g_signal_connect_data (_tmp59_, "changed::spell-checking-enabled", (GCallback) __layouts_item_sidebar_view___lambda522__g_settings_changed, block44_data_ref (_data44_), (GClosureNotify) block44_data_unref, 0);
	_g_object_unref0 (_tmp58_);
	_tmp60_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	gtk_widget_set_margin_start ((GtkWidget*) _tmp60_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp60_, 12);
	g_object_ref_sink (_tmp60_);
	content_group = _tmp60_;
	_tmp61_ = content_group;
	adw_preferences_group_set_title (_tmp61_, _ ("Title"));
	_tmp62_ = content_group;
	_tmp63_ = self->priv->content_textview;
	adw_preferences_group_add (_tmp62_, (GtkWidget*) _tmp63_);
	_tmp64_ = widgets_status_button_new ();
	g_object_ref_sink (_tmp64_);
	_g_object_unref0 (self->priv->status_button);
	self->priv->status_button = _tmp64_;
	_tmp65_ = widgets_section_picker_section_button_new ();
	g_object_ref_sink (_tmp65_);
	_g_object_unref0 (self->priv->section_button);
	self->priv->section_button = _tmp65_;
	_tmp66_ = widgets_schedule_button_new_for_board (_ ("Date"));
	g_object_ref_sink (_tmp66_);
	_g_object_unref0 (self->priv->schedule_button);
	self->priv->schedule_button = _tmp66_;
	_tmp67_ = widgets_priority_button_new_for_board ();
	g_object_ref_sink (_tmp67_);
	_g_object_unref0 (self->priv->priority_button);
	self->priv->priority_button = _tmp67_;
	_tmp68_ = widgets_label_picker_label_button_new_for_board ();
	g_object_ref_sink (_tmp68_);
	_g_object_unref0 (self->priv->label_button);
	self->priv->label_button = _tmp68_;
	_tmp69_ = widgets_reminder_picker_reminder_button_new_for_board ();
	g_object_ref_sink (_tmp69_);
	_g_object_unref0 (self->priv->reminder_button);
	self->priv->reminder_button = _tmp69_;
	_tmp70_ = widgets_deadline_button_new_card ();
	g_object_ref_sink (_tmp70_);
	_g_object_unref0 (self->priv->deadline_button);
	self->priv->deadline_button = _tmp70_;
	_tmp71_ = (GtkGrid*) gtk_grid_new ();
	gtk_grid_set_column_homogeneous (_tmp71_, TRUE);
	gtk_grid_set_column_spacing (_tmp71_, 12);
	gtk_grid_set_row_homogeneous (_tmp71_, TRUE);
	gtk_grid_set_row_spacing (_tmp71_, 12);
	g_object_ref_sink (_tmp71_);
	properties_grid = _tmp71_;
	_tmp72_ = properties_grid;
	_tmp73_ = self->priv->status_button;
	gtk_grid_attach (_tmp72_, (GtkWidget*) _tmp73_, 0, 0, 1, 1);
	_tmp74_ = properties_grid;
	_tmp75_ = self->priv->section_button;
	gtk_grid_attach (_tmp74_, (GtkWidget*) _tmp75_, 1, 0, 1, 1);
	_tmp76_ = properties_grid;
	_tmp77_ = self->priv->schedule_button;
	gtk_grid_attach (_tmp76_, (GtkWidget*) _tmp77_, 0, 1, 1, 1);
	_tmp78_ = properties_grid;
	_tmp79_ = self->priv->priority_button;
	gtk_grid_attach (_tmp78_, (GtkWidget*) _tmp79_, 1, 1, 1, 1);
	_tmp80_ = properties_grid;
	_tmp81_ = self->priv->label_button;
	gtk_grid_attach (_tmp80_, (GtkWidget*) _tmp81_, 0, 2, 1, 1);
	_tmp82_ = properties_grid;
	_tmp83_ = self->priv->reminder_button;
	gtk_grid_attach (_tmp82_, (GtkWidget*) _tmp83_, 1, 2, 1, 1);
	_tmp84_ = properties_grid;
	_tmp85_ = self->priv->deadline_button;
	gtk_grid_attach (_tmp84_, (GtkWidget*) _tmp85_, 0, 3, 1, 1);
	_tmp86_ = (AdwPreferencesGroup*) adw_preferences_group_new ();
	gtk_widget_set_margin_start ((GtkWidget*) _tmp86_, 12);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp86_, 12);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp86_, 12);
	g_object_ref_sink (_tmp86_);
	properties_group = _tmp86_;
	_tmp87_ = properties_group;
	adw_preferences_group_set_title (_tmp87_, _ ("Properties"));
	_tmp88_ = properties_group;
	_tmp89_ = properties_grid;
	adw_preferences_group_add (_tmp88_, (GtkWidget*) _tmp89_);
	_tmp90_ = (GtkRevealer*) gtk_revealer_new ();
	g_object_ref_sink (_tmp90_);
	_g_object_unref0 (self->priv->markdown_editor_revealer);
	self->priv->markdown_editor_revealer = _tmp90_;
	_tmp91_ = (GtkLabel*) gtk_label_new (_ ("Description"));
	gtk_widget_set_halign ((GtkWidget*) _tmp91_, GTK_ALIGN_START);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp91_, TRUE);
	gtk_label_set_ellipsize (_tmp91_, PANGO_ELLIPSIZE_END);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp91_, 3);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp91_, 3);
	g_object_ref_sink (_tmp91_);
	description_title = _tmp91_;
	_tmp92_ = description_title;
	gtk_widget_add_css_class ((GtkWidget*) _tmp92_, "heading");
	_tmp93_ = g_strdup (_ ("Expand Description"));
	_tmp94_ = (GtkButton*) gtk_button_new_from_icon_name ("four-arrows-pointing-outward-symbolic");
	gtk_widget_set_valign ((GtkWidget*) _tmp94_, GTK_ALIGN_CENTER);
	gtk_widget_set_tooltip_text ((GtkWidget*) _tmp94_, _tmp93_);
	_g_free0 (_tmp93_);
	g_object_ref_sink (_tmp94_);
	expand_button = _tmp94_;
	_tmp95_ = expand_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp95_, "flat");
	_tmp96_ = expand_button;
	gtk_widget_add_css_class ((GtkWidget*) _tmp96_, "caption");
	_tmp97_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp97_, 3);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp97_, 3);
	g_object_ref_sink (_tmp97_);
	description_header = _tmp97_;
	_tmp98_ = description_header;
	_tmp99_ = description_title;
	gtk_box_append (_tmp98_, (GtkWidget*) _tmp99_);
	_tmp100_ = description_header;
	_tmp101_ = expand_button;
	gtk_box_append (_tmp100_, (GtkWidget*) _tmp101_);
	_tmp102_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp102_, 9);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp102_, 9);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp102_, 12);
	g_object_ref_sink (_tmp102_);
	description_group = _tmp102_;
	_tmp103_ = description_group;
	_tmp104_ = description_header;
	gtk_box_append (_tmp103_, (GtkWidget*) _tmp104_);
	_tmp105_ = description_group;
	_tmp106_ = self->priv->markdown_editor_revealer;
	gtk_box_append (_tmp105_, (GtkWidget*) _tmp106_);
	_tmp107_ = expand_button;
	g_signal_connect_object (_tmp107_, "clicked", (GCallback) __layouts_item_sidebar_view___lambda523__gtk_button_clicked, self, 0);
	_tmp108_ = widgets_sub_items_new_for_board ();
	gtk_widget_set_margin_top ((GtkWidget*) _tmp108_, 12);
	g_object_ref_sink (_tmp108_);
	_g_object_unref0 (self->priv->subitems);
	self->priv->subitems = _tmp108_;
	_tmp109_ = widgets_attachments_new (TRUE);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp109_, 12);
	widgets_attachments_set_card (_tmp109_, TRUE);
	g_object_ref_sink (_tmp109_);
	_g_object_unref0 (self->priv->attachments);
	self->priv->attachments = _tmp109_;
	_tmp110_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	gtk_widget_set_valign ((GtkWidget*) _tmp110_, GTK_ALIGN_START);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp110_, 24);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp110_, 6);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp110_, 6);
	g_object_ref_sink (_tmp110_);
	content = _tmp110_;
	_tmp111_ = content;
	_tmp112_ = content_group;
	gtk_box_append (_tmp111_, (GtkWidget*) _tmp112_);
	_tmp113_ = content;
	_tmp114_ = properties_group;
	gtk_box_append (_tmp113_, (GtkWidget*) _tmp114_);
	_tmp115_ = content;
	_tmp116_ = description_group;
	gtk_box_append (_tmp115_, (GtkWidget*) _tmp116_);
	_tmp117_ = content;
	_tmp118_ = self->priv->subitems;
	gtk_box_append (_tmp117_, (GtkWidget*) _tmp118_);
	_tmp119_ = content;
	_tmp120_ = self->priv->attachments;
	gtk_box_append (_tmp119_, (GtkWidget*) _tmp120_);
	_tmp121_ = content;
	_tmp122_ = widgets_scrolled_window_new ((GtkWidget*) _tmp121_, GTK_ORIENTATION_VERTICAL);
	g_object_ref_sink (_tmp122_);
	scrolled_window = _tmp122_;
	_tmp123_ = (AdwToolbarView*) adw_toolbar_view_new ();
	adw_toolbar_view_set_bottom_bar_style (_tmp123_, ADW_TOOLBAR_RAISED_BORDER);
	adw_toolbar_view_set_reveal_bottom_bars (_tmp123_, FALSE);
	g_object_ref_sink (_tmp123_);
	toolbar_view = _tmp123_;
	_tmp124_ = toolbar_view;
	_tmp125_ = headerbar;
	adw_toolbar_view_add_top_bar (_tmp124_, (GtkWidget*) _tmp125_);
	_tmp126_ = toolbar_view;
	_tmp127_ = scrolled_window;
	adw_toolbar_view_set_content (_tmp126_, (GtkWidget*) _tmp127_);
	_tmp128_ = toolbar_view;
	adw_bin_set_child ((AdwBin*) self, (GtkWidget*) _tmp128_);
	_tmp129_ = close_button;
	g_signal_connect_object (_tmp129_, "clicked", (GCallback) __layouts_item_sidebar_view___lambda524__gtk_button_clicked, self, 0);
	_tmp130_ = (GtkEventControllerKey*) gtk_event_controller_key_new ();
	content_controller_key = _tmp130_;
	_tmp131_ = self->priv->content_textview;
	_tmp132_ = content_controller_key;
	_tmp133_ = _g_object_ref0 ((GtkEventController*) _tmp132_);
	gtk_widget_add_controller ((GtkWidget*) _tmp131_, _tmp133_);
	_tmp134_ = content_controller_key;
	g_signal_connect_object (_tmp134_, "key-released", (GCallback) __layouts_item_sidebar_view___lambda525__gtk_event_controller_key_key_released, self, 0);
	_tmp135_ = self->priv->schedule_button;
	g_signal_connect_object (_tmp135_, "duedate-changed", (GCallback) __layouts_item_sidebar_view___lambda526__widgets_schedule_button_duedate_changed, self, 0);
	_tmp136_ = self->priv->priority_button;
	g_signal_connect_object (_tmp136_, "changed", (GCallback) __layouts_item_sidebar_view___lambda527__widgets_priority_button_changed, self, 0);
	_tmp137_ = self->priv->label_button;
	g_signal_connect_object (_tmp137_, "labels-changed", (GCallback) __layouts_item_sidebar_view___lambda528__widgets_label_picker_label_button_labels_changed, self, 0);
	_tmp138_ = self->priv->pin_button;
	g_signal_connect_object (_tmp138_, "changed", (GCallback) __layouts_item_sidebar_view___lambda529__widgets_pin_button_changed, self, 0);
	_tmp139_ = self->priv->section_button;
	g_signal_connect_object (_tmp139_, "selected", (GCallback) __layouts_item_sidebar_view___lambda530__widgets_section_picker_section_button_selected, self, 0);
	_tmp140_ = self->priv->reminder_button;
	g_signal_connect_object (_tmp140_, "reminder-added", (GCallback) __layouts_item_sidebar_view___lambda531__widgets_reminder_picker_reminder_button_reminder_added, self, 0);
	_tmp141_ = self->priv->status_button;
	g_signal_connect_object (_tmp141_, "changed", (GCallback) __layouts_item_sidebar_view___lambda533__widgets_status_button_changed, self, 0);
	_tmp142_ = self->priv->parent_back_button;
	g_signal_connect_object (_tmp142_, "clicked", (GCallback) __layouts_item_sidebar_view___lambda534__gtk_button_clicked, self, 0);
	_g_object_unref0 (content_controller_key);
	_g_object_unref0 (toolbar_view);
	_g_object_unref0 (scrolled_window);
	_g_object_unref0 (content);
	_g_object_unref0 (description_group);
	_g_object_unref0 (description_header);
	_g_object_unref0 (expand_button);
	_g_object_unref0 (description_title);
	_g_object_unref0 (properties_group);
	_g_object_unref0 (properties_grid);
	_g_object_unref0 (content_group);
	_g_object_unref0 (source_buffer);
	_g_object_unref0 (headerbar);
	_g_object_unref0 (spinner);
	_g_object_unref0 (menu_button);
	_g_object_unref0 (close_button);
	_g_object_unref0 (parent_box);
	_g_object_unref0 (previous_icon);
	block44_data_unref (_data44_);
	_data44_ = NULL;
	return obj;
}

static void
layouts_item_sidebar_view_class_init (LayoutsItemSidebarViewClass * klass,
                                      gpointer klass_data)
{
	layouts_item_sidebar_view_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &LayoutsItemSidebarView_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_layouts_item_sidebar_view_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_layouts_item_sidebar_view_set_property;
	G_OBJECT_CLASS (klass)->constructor = layouts_item_sidebar_view_constructor;
	G_OBJECT_CLASS (klass)->finalize = layouts_item_sidebar_view_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), LAYOUTS_ITEM_SIDEBAR_VIEW_ITEM_PROPERTY, layouts_item_sidebar_view_properties[LAYOUTS_ITEM_SIDEBAR_VIEW_ITEM_PROPERTY] = g_param_spec_object ("item", "item", "item", OBJECTS_TYPE_ITEM, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), LAYOUTS_ITEM_SIDEBAR_VIEW_UPDATE_ID_PROPERTY, layouts_item_sidebar_view_properties[LAYOUTS_ITEM_SIDEBAR_VIEW_UPDATE_ID_PROPERTY] = g_param_spec_string ("update-id", "update-id", "update-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), LAYOUTS_ITEM_SIDEBAR_VIEW_SHOW_COMPLETED_PROPERTY, layouts_item_sidebar_view_properties[LAYOUTS_ITEM_SIDEBAR_VIEW_SHOW_COMPLETED_PROPERTY] = g_param_spec_boolean ("show-completed", "show-completed", "show-completed", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
layouts_item_sidebar_view_instance_init (LayoutsItemSidebarView * self,
                                         gpointer klass)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	self->priv = layouts_item_sidebar_view_get_instance_private (self);
	self->priv->destroy_editor_timeout_id = (guint) 0;
	_tmp0_ = gee_hash_map_new (G_TYPE_ULONG, NULL, NULL, G_TYPE_OBJECT, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->signals_map = _tmp0_;
	_tmp1_ = gee_hash_map_new (G_TYPE_ULONG, NULL, NULL, G_TYPE_OBJECT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	self->priv->markdown_handlerses = _tmp1_;
}

static void
layouts_item_sidebar_view_finalize (GObject * obj)
{
	LayoutsItemSidebarView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, LAYOUTS_TYPE_ITEM_SIDEBAR_VIEW, LayoutsItemSidebarView);
	_g_object_unref0 (self->priv->_item);
	_g_object_unref0 (self->priv->parent_back_button);
	_g_object_unref0 (self->priv->parent_label);
	_g_object_unref0 (self->priv->spinner_revealer);
	_g_object_unref0 (self->priv->content_textview);
	_g_object_unref0 (self->priv->markdown_editor);
	_g_object_unref0 (self->priv->markdown_editor_revealer);
	_g_object_unref0 (self->priv->status_button);
	_g_object_unref0 (self->priv->schedule_button);
	_g_object_unref0 (self->priv->priority_button);
	_g_object_unref0 (self->priv->label_button);
	_g_object_unref0 (self->priv->pin_button);
	_g_object_unref0 (self->priv->section_button);
	_g_object_unref0 (self->priv->reminder_button);
	_g_object_unref0 (self->priv->deadline_button);
	_g_object_unref0 (self->priv->subitems);
	_g_object_unref0 (self->priv->attachments);
	_g_object_unref0 (self->priv->use_note_item);
	_g_object_unref0 (self->priv->copy_clipboard_item);
	_g_object_unref0 (self->priv->duplicate_item);
	_g_object_unref0 (self->priv->move_item);
	_g_object_unref0 (self->priv->export_ics_item);
	_g_object_unref0 (self->priv->signals_map);
	_g_object_unref0 (self->priv->markdown_handlerses);
	_g_free0 (self->priv->_update_id);
	G_OBJECT_CLASS (layouts_item_sidebar_view_parent_class)->finalize (obj);
}

static GType
layouts_item_sidebar_view_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (LayoutsItemSidebarViewClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) layouts_item_sidebar_view_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (LayoutsItemSidebarView), 0, (GInstanceInitFunc) layouts_item_sidebar_view_instance_init, NULL };
	GType layouts_item_sidebar_view_type_id;
	layouts_item_sidebar_view_type_id = g_type_register_static (adw_bin_get_type (), "LayoutsItemSidebarView", &g_define_type_info, 0);
	LayoutsItemSidebarView_private_offset = g_type_add_instance_private (layouts_item_sidebar_view_type_id, sizeof (LayoutsItemSidebarViewPrivate));
	return layouts_item_sidebar_view_type_id;
}

GType
layouts_item_sidebar_view_get_type (void)
{
	static volatile gsize layouts_item_sidebar_view_type_id__once = 0;
	if (g_once_init_enter (&layouts_item_sidebar_view_type_id__once)) {
		GType layouts_item_sidebar_view_type_id;
		layouts_item_sidebar_view_type_id = layouts_item_sidebar_view_get_type_once ();
		g_once_init_leave (&layouts_item_sidebar_view_type_id__once, layouts_item_sidebar_view_type_id);
	}
	return layouts_item_sidebar_view_type_id__once;
}

static void
_vala_layouts_item_sidebar_view_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec)
{
	LayoutsItemSidebarView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, LAYOUTS_TYPE_ITEM_SIDEBAR_VIEW, LayoutsItemSidebarView);
	switch (property_id) {
		case LAYOUTS_ITEM_SIDEBAR_VIEW_ITEM_PROPERTY:
		g_value_set_object (value, layouts_item_sidebar_view_get_item (self));
		break;
		case LAYOUTS_ITEM_SIDEBAR_VIEW_UPDATE_ID_PROPERTY:
		g_value_set_string (value, layouts_item_sidebar_view_get_update_id (self));
		break;
		case LAYOUTS_ITEM_SIDEBAR_VIEW_SHOW_COMPLETED_PROPERTY:
		g_value_set_boolean (value, layouts_item_sidebar_view_get_show_completed (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_layouts_item_sidebar_view_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec)
{
	LayoutsItemSidebarView * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, LAYOUTS_TYPE_ITEM_SIDEBAR_VIEW, LayoutsItemSidebarView);
	switch (property_id) {
		case LAYOUTS_ITEM_SIDEBAR_VIEW_ITEM_PROPERTY:
		layouts_item_sidebar_view_set_item (self, g_value_get_object (value));
		break;
		case LAYOUTS_ITEM_SIDEBAR_VIEW_UPDATE_ID_PROPERTY:
		layouts_item_sidebar_view_set_update_id (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

