/* ProductivityReport.c generated by valac 0.56.19, the Vala compiler
 * generated from ProductivityReport.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 <gtk/gtk.h>
#include <glib.h>
#include <glib/gi18n-lib.h>
#include <stdlib.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include "planify.h"
#include <gio/gio.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 DIALOGS_PRODUCTIVITY_REPORT_TYPE_PRODUCTIVITY_REPORT_DIALOG (dialogs_productivity_report_productivity_report_dialog_get_type ())
#define DIALOGS_PRODUCTIVITY_REPORT_PRODUCTIVITY_REPORT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIALOGS_PRODUCTIVITY_REPORT_TYPE_PRODUCTIVITY_REPORT_DIALOG, DialogsProductivityReportProductivityReportDialog))
#define DIALOGS_PRODUCTIVITY_REPORT_PRODUCTIVITY_REPORT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DIALOGS_PRODUCTIVITY_REPORT_TYPE_PRODUCTIVITY_REPORT_DIALOG, DialogsProductivityReportProductivityReportDialogClass))
#define DIALOGS_PRODUCTIVITY_REPORT_IS_PRODUCTIVITY_REPORT_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIALOGS_PRODUCTIVITY_REPORT_TYPE_PRODUCTIVITY_REPORT_DIALOG))
#define DIALOGS_PRODUCTIVITY_REPORT_IS_PRODUCTIVITY_REPORT_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DIALOGS_PRODUCTIVITY_REPORT_TYPE_PRODUCTIVITY_REPORT_DIALOG))
#define DIALOGS_PRODUCTIVITY_REPORT_PRODUCTIVITY_REPORT_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DIALOGS_PRODUCTIVITY_REPORT_TYPE_PRODUCTIVITY_REPORT_DIALOG, DialogsProductivityReportProductivityReportDialogClass))

typedef struct _DialogsProductivityReportProductivityReportDialog DialogsProductivityReportProductivityReportDialog;
typedef struct _DialogsProductivityReportProductivityReportDialogClass DialogsProductivityReportProductivityReportDialogClass;
typedef struct _DialogsProductivityReportProductivityReportDialogPrivate DialogsProductivityReportProductivityReportDialogPrivate;

#define DIALOGS_PRODUCTIVITY_REPORT_TYPE_PRODUCTIVITY_SECTION (dialogs_productivity_report_productivity_section_get_type ())
#define DIALOGS_PRODUCTIVITY_REPORT_PRODUCTIVITY_SECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIALOGS_PRODUCTIVITY_REPORT_TYPE_PRODUCTIVITY_SECTION, DialogsProductivityReportProductivitySection))
#define DIALOGS_PRODUCTIVITY_REPORT_PRODUCTIVITY_SECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DIALOGS_PRODUCTIVITY_REPORT_TYPE_PRODUCTIVITY_SECTION, DialogsProductivityReportProductivitySectionClass))
#define DIALOGS_PRODUCTIVITY_REPORT_IS_PRODUCTIVITY_SECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIALOGS_PRODUCTIVITY_REPORT_TYPE_PRODUCTIVITY_SECTION))
#define DIALOGS_PRODUCTIVITY_REPORT_IS_PRODUCTIVITY_SECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DIALOGS_PRODUCTIVITY_REPORT_TYPE_PRODUCTIVITY_SECTION))
#define DIALOGS_PRODUCTIVITY_REPORT_PRODUCTIVITY_SECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DIALOGS_PRODUCTIVITY_REPORT_TYPE_PRODUCTIVITY_SECTION, DialogsProductivityReportProductivitySectionClass))

typedef struct _DialogsProductivityReportProductivitySection DialogsProductivityReportProductivitySection;
typedef struct _DialogsProductivityReportProductivitySectionClass DialogsProductivityReportProductivitySectionClass;
enum  {
	DIALOGS_PRODUCTIVITY_REPORT_PRODUCTIVITY_REPORT_DIALOG_0_PROPERTY,
	DIALOGS_PRODUCTIVITY_REPORT_PRODUCTIVITY_REPORT_DIALOG_NUM_PROPERTIES
};
static GParamSpec* dialogs_productivity_report_productivity_report_dialog_properties[DIALOGS_PRODUCTIVITY_REPORT_PRODUCTIVITY_REPORT_DIALOG_NUM_PROPERTIES];
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block92Data Block92Data;

#define DIALOGS_PRODUCTIVITY_REPORT_TYPE_SUMMARY_SECTION (dialogs_productivity_report_summary_section_get_type ())
#define DIALOGS_PRODUCTIVITY_REPORT_SUMMARY_SECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DIALOGS_PRODUCTIVITY_REPORT_TYPE_SUMMARY_SECTION, DialogsProductivityReportSummarySection))
#define DIALOGS_PRODUCTIVITY_REPORT_SUMMARY_SECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DIALOGS_PRODUCTIVITY_REPORT_TYPE_SUMMARY_SECTION, DialogsProductivityReportSummarySectionClass))
#define DIALOGS_PRODUCTIVITY_REPORT_IS_SUMMARY_SECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DIALOGS_PRODUCTIVITY_REPORT_TYPE_SUMMARY_SECTION))
#define DIALOGS_PRODUCTIVITY_REPORT_IS_SUMMARY_SECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DIALOGS_PRODUCTIVITY_REPORT_TYPE_SUMMARY_SECTION))
#define DIALOGS_PRODUCTIVITY_REPORT_SUMMARY_SECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DIALOGS_PRODUCTIVITY_REPORT_TYPE_SUMMARY_SECTION, DialogsProductivityReportSummarySectionClass))

typedef struct _DialogsProductivityReportSummarySection DialogsProductivityReportSummarySection;
typedef struct _DialogsProductivityReportSummarySectionClass DialogsProductivityReportSummarySectionClass;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _DialogsProductivityReportProductivityReportDialog {
	AdwDialog parent_instance;
	DialogsProductivityReportProductivityReportDialogPrivate * priv;
};

struct _DialogsProductivityReportProductivityReportDialogClass {
	AdwDialogClass parent_class;
};

struct _DialogsProductivityReportProductivityReportDialogPrivate {
	AdwNavigationView* navigation_view;
	AdwBin* dimming_widget;
	GtkRevealer* goals_revealer;
	DialogsProductivityReportProductivitySection* productivity_section;
};

struct _Block92Data {
	int _ref_count_;
	DialogsProductivityReportProductivityReportDialog* self;
	GtkSpinButton* daily_spin;
	GtkSpinButton* weekly_spin;
};

static gint DialogsProductivityReportProductivityReportDialog_private_offset;
static gpointer dialogs_productivity_report_productivity_report_dialog_parent_class = NULL;

VALA_EXTERN GType dialogs_productivity_report_productivity_report_dialog_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DialogsProductivityReportProductivityReportDialog, g_object_unref)
VALA_EXTERN GType dialogs_productivity_report_productivity_section_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DialogsProductivityReportProductivitySection, g_object_unref)
VALA_EXTERN DialogsProductivityReportProductivityReportDialog* dialogs_productivity_report_productivity_report_dialog_new (void);
VALA_EXTERN DialogsProductivityReportProductivityReportDialog* dialogs_productivity_report_productivity_report_dialog_construct (GType object_type);
static void dialogs_productivity_report_productivity_report_dialog_show_goals_setup (DialogsProductivityReportProductivityReportDialog* self);
static void dialogs_productivity_report_productivity_report_dialog_hide_goals_setup (DialogsProductivityReportProductivityReportDialog* self);
static GtkWidget* dialogs_productivity_report_productivity_report_dialog_build_goals_setup (DialogsProductivityReportProductivityReportDialog* self);
static Block92Data* block92_data_ref (Block92Data* _data92_);
static void block92_data_unref (void * _userdata_);
static void __lambda918_ (Block92Data* _data92_);
VALA_EXTERN void dialogs_productivity_report_productivity_section_refresh (DialogsProductivityReportProductivitySection* self);
static void ___lambda918__gtk_button_clicked (GtkButton* _sender,
                                       gpointer self);
static void __lambda919_ (Block92Data* _data92_);
static void ___lambda919__gtk_spin_button_value_changed (GtkSpinButton* _sender,
                                                  gpointer self);
static void __lambda920_ (Block92Data* _data92_);
static void ___lambda920__gtk_spin_button_value_changed (GtkSpinButton* _sender,
                                                  gpointer self);
static AdwNavigationPage* dialogs_productivity_report_productivity_report_dialog_build_main_page (DialogsProductivityReportProductivityReportDialog* self);
VALA_EXTERN GType dialogs_productivity_report_summary_section_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (DialogsProductivityReportSummarySection, g_object_unref)
VALA_EXTERN DialogsProductivityReportSummarySection* dialogs_productivity_report_summary_section_new (void);
VALA_EXTERN DialogsProductivityReportSummarySection* dialogs_productivity_report_summary_section_construct (GType object_type);
static void __lambda925_ (DialogsProductivityReportProductivityReportDialog* self);
static AdwNavigationPage* dialogs_productivity_report_productivity_report_dialog_build_summary_detail_page (DialogsProductivityReportProductivityReportDialog* self);
static void ___lambda925__dialogs_productivity_report_summary_section_see_more_clicked (DialogsProductivityReportSummarySection* _sender,
                                                                                 gpointer self);
VALA_EXTERN DialogsProductivityReportProductivitySection* dialogs_productivity_report_productivity_section_new (void);
VALA_EXTERN DialogsProductivityReportProductivitySection* dialogs_productivity_report_productivity_section_construct (GType object_type);
static void __lambda926_ (DialogsProductivityReportProductivityReportDialog* self);
static AdwNavigationPage* dialogs_productivity_report_productivity_report_dialog_build_productivity_detail_page (DialogsProductivityReportProductivityReportDialog* self);
static void ___lambda926__dialogs_productivity_report_productivity_section_see_more_clicked (DialogsProductivityReportProductivitySection* _sender,
                                                                                      gpointer self);
static void __lambda927_ (DialogsProductivityReportProductivityReportDialog* self);
static void ___lambda927__dialogs_productivity_report_productivity_section_setup_goals_clicked (DialogsProductivityReportProductivitySection* _sender,
                                                                                         gpointer self);
static GObject * dialogs_productivity_report_productivity_report_dialog_constructor (GType type,
                                                                              guint n_construct_properties,
                                                                              GObjectConstructParam * construct_properties);
static void _dialogs_productivity_report_productivity_report_dialog___lambda928_ (DialogsProductivityReportProductivityReportDialog* self);
static void __dialogs_productivity_report_productivity_report_dialog___lambda928__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                                                      gint n_press,
                                                                                                      gdouble x,
                                                                                                      gdouble y,
                                                                                                      gpointer self);
static void _dialogs_productivity_report_productivity_report_dialog___lambda929_ (DialogsProductivityReportProductivityReportDialog* self);
static void __dialogs_productivity_report_productivity_report_dialog___lambda929__g_object_notify (GObject* _sender,
                                                                                            GParamSpec* pspec,
                                                                                            gpointer self);
static void _dialogs_productivity_report_productivity_report_dialog___lambda930_ (DialogsProductivityReportProductivityReportDialog* self);
static void __dialogs_productivity_report_productivity_report_dialog___lambda930__adw_dialog_closed (AdwDialog* _sender,
                                                                                              gpointer self);
static void dialogs_productivity_report_productivity_report_dialog_finalize (GObject * obj);
static GType dialogs_productivity_report_productivity_report_dialog_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static inline gpointer
dialogs_productivity_report_productivity_report_dialog_get_instance_private (DialogsProductivityReportProductivityReportDialog* self)
{
	return G_STRUCT_MEMBER_P (self, DialogsProductivityReportProductivityReportDialog_private_offset);
}

DialogsProductivityReportProductivityReportDialog*
dialogs_productivity_report_productivity_report_dialog_construct (GType object_type)
{
	DialogsProductivityReportProductivityReportDialog * self = NULL;
	self = (DialogsProductivityReportProductivityReportDialog*) g_object_new (object_type, "title", _ ("Summary & Productivity"), "content-width", 450, "content-height", 600, NULL);
	return self;
}

DialogsProductivityReportProductivityReportDialog*
dialogs_productivity_report_productivity_report_dialog_new (void)
{
	return dialogs_productivity_report_productivity_report_dialog_construct (DIALOGS_PRODUCTIVITY_REPORT_TYPE_PRODUCTIVITY_REPORT_DIALOG);
}

static void
dialogs_productivity_report_productivity_report_dialog_show_goals_setup (DialogsProductivityReportProductivityReportDialog* self)
{
	GtkRevealer* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->goals_revealer;
	gtk_revealer_set_reveal_child (_tmp0_, TRUE);
}

static void
dialogs_productivity_report_productivity_report_dialog_hide_goals_setup (DialogsProductivityReportProductivityReportDialog* self)
{
	GtkRevealer* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->goals_revealer;
	gtk_revealer_set_reveal_child (_tmp0_, FALSE);
}

static Block92Data*
block92_data_ref (Block92Data* _data92_)
{
	g_atomic_int_inc (&_data92_->_ref_count_);
	return _data92_;
}

static void
block92_data_unref (void * _userdata_)
{
	Block92Data* _data92_;
	_data92_ = (Block92Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data92_->_ref_count_)) {
		DialogsProductivityReportProductivityReportDialog* self;
		self = _data92_->self;
		_g_object_unref0 (_data92_->weekly_spin);
		_g_object_unref0 (_data92_->daily_spin);
		_g_object_unref0 (self);
		g_slice_free (Block92Data, _data92_);
	}
}

static void
__lambda918_ (Block92Data* _data92_)
{
	DialogsProductivityReportProductivityReportDialog* self;
	gint daily_val = 0;
	GtkSpinButton* _tmp0_;
	gdouble _tmp1_;
	gdouble _tmp2_;
	gint weekly_val = 0;
	GtkSpinButton* _tmp3_;
	gdouble _tmp4_;
	gdouble _tmp5_;
	gboolean _tmp6_ = FALSE;
	GtkSpinButton* _tmp11_;
	GtkSpinButton* _tmp12_;
	ServicesSettings* _tmp13_;
	ServicesSettings* _tmp14_;
	GSettings* _tmp15_;
	ServicesSettings* _tmp16_;
	ServicesSettings* _tmp17_;
	GSettings* _tmp18_;
	DialogsProductivityReportProductivitySection* _tmp19_;
	self = _data92_->self;
	_tmp0_ = _data92_->daily_spin;
	_tmp1_ = gtk_spin_button_get_value (_tmp0_);
	_tmp2_ = _tmp1_;
	daily_val = (gint) _tmp2_;
	_tmp3_ = _data92_->weekly_spin;
	_tmp4_ = gtk_spin_button_get_value (_tmp3_);
	_tmp5_ = _tmp4_;
	weekly_val = (gint) _tmp5_;
	if (daily_val <= 0) {
		_tmp6_ = TRUE;
	} else {
		_tmp6_ = weekly_val <= 0;
	}
	if (_tmp6_) {
		const gchar* _tmp7_ = NULL;
		GtkSpinButton* _tmp8_;
		const gchar* _tmp9_ = NULL;
		GtkSpinButton* _tmp10_;
		if (daily_val <= 0) {
			_tmp7_ = "error";
		} else {
			_tmp7_ = "";
		}
		_tmp8_ = _data92_->daily_spin;
		gtk_widget_add_css_class ((GtkWidget*) _tmp8_, _tmp7_);
		if (weekly_val <= 0) {
			_tmp9_ = "error";
		} else {
			_tmp9_ = "";
		}
		_tmp10_ = _data92_->weekly_spin;
		gtk_widget_add_css_class ((GtkWidget*) _tmp10_, _tmp9_);
		return;
	}
	_tmp11_ = _data92_->daily_spin;
	gtk_widget_remove_css_class ((GtkWidget*) _tmp11_, "error");
	_tmp12_ = _data92_->weekly_spin;
	gtk_widget_remove_css_class ((GtkWidget*) _tmp12_, "error");
	_tmp13_ = services_settings_get_default ();
	_tmp14_ = _tmp13_;
	_tmp15_ = _tmp14_->settings;
	g_settings_set_int (_tmp15_, "daily-task-goal", daily_val);
	_g_object_unref0 (_tmp14_);
	_tmp16_ = services_settings_get_default ();
	_tmp17_ = _tmp16_;
	_tmp18_ = _tmp17_->settings;
	g_settings_set_int (_tmp18_, "weekly-task-goal", weekly_val);
	_g_object_unref0 (_tmp17_);
	dialogs_productivity_report_productivity_report_dialog_hide_goals_setup (self);
	_tmp19_ = self->priv->productivity_section;
	dialogs_productivity_report_productivity_section_refresh (_tmp19_);
}

static void
___lambda918__gtk_button_clicked (GtkButton* _sender,
                                  gpointer self)
{
	__lambda918_ (self);
}

static void
__lambda919_ (Block92Data* _data92_)
{
	DialogsProductivityReportProductivityReportDialog* self;
	GtkSpinButton* _tmp0_;
	self = _data92_->self;
	_tmp0_ = _data92_->daily_spin;
	gtk_widget_remove_css_class ((GtkWidget*) _tmp0_, "error");
}

static void
___lambda919__gtk_spin_button_value_changed (GtkSpinButton* _sender,
                                             gpointer self)
{
	__lambda919_ (self);
}

static void
__lambda920_ (Block92Data* _data92_)
{
	DialogsProductivityReportProductivityReportDialog* self;
	GtkSpinButton* _tmp0_;
	self = _data92_->self;
	_tmp0_ = _data92_->weekly_spin;
	gtk_widget_remove_css_class ((GtkWidget*) _tmp0_, "error");
}

static void
___lambda920__gtk_spin_button_value_changed (GtkSpinButton* _sender,
                                             gpointer self)
{
	__lambda920_ (self);
}

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

static GtkWidget*
dialogs_productivity_report_productivity_report_dialog_build_goals_setup (DialogsProductivityReportProductivityReportDialog* self)
{
	Block92Data* _data92_;
	GtkLabel* title_label = NULL;
	gchar* _tmp0_;
	gchar** _tmp1_;
	GtkLabel* _tmp2_ = NULL;
	GtkLabel* description_label = NULL;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar** _tmp5_;
	GtkLabel* _tmp6_ = NULL;
	GtkBox* title_box = NULL;
	GtkBox* _tmp7_;
	GtkBox* _tmp8_;
	GtkLabel* _tmp9_;
	GtkBox* _tmp10_;
	GtkLabel* _tmp11_;
	GtkLabel* daily_label = NULL;
	GtkLabel* _tmp12_ = NULL;
	GtkSpinButton* _tmp13_ = NULL;
	GtkBox* daily_box = NULL;
	GtkBox* _tmp14_ = NULL;
	GtkBox* _tmp15_;
	GtkLabel* _tmp16_;
	GtkBox* _tmp17_;
	GtkSpinButton* _tmp18_;
	GtkLabel* weekly_label = NULL;
	GtkLabel* _tmp19_ = NULL;
	GtkSpinButton* _tmp20_ = NULL;
	GtkBox* weekly_box = NULL;
	GtkBox* _tmp21_ = NULL;
	GtkBox* _tmp22_;
	GtkLabel* _tmp23_;
	GtkBox* _tmp24_;
	GtkSpinButton* _tmp25_;
	GtkBox* goals_row = NULL;
	GtkBox* _tmp26_ = NULL;
	GtkBox* _tmp27_;
	GtkBox* _tmp28_;
	GtkBox* _tmp29_;
	GtkBox* _tmp30_;
	gint saved_daily = 0;
	ServicesSettings* _tmp31_;
	ServicesSettings* _tmp32_;
	GSettings* _tmp33_;
	gint _tmp34_;
	gint saved_weekly = 0;
	ServicesSettings* _tmp35_;
	ServicesSettings* _tmp36_;
	GSettings* _tmp37_;
	gint _tmp38_;
	GtkButton* save_button = NULL;
	gchar* _tmp41_;
	gchar** _tmp42_;
	GtkButton* _tmp43_ = NULL;
	GtkSpinButton* _tmp44_;
	GtkSpinButton* _tmp45_;
	GtkBox* content_box = NULL;
	GtkBox* _tmp46_ = NULL;
	GtkBox* _tmp47_;
	GtkBox* _tmp48_;
	gchar* _tmp49_;
	gchar** _tmp50_;
	GtkWidget* _tmp51_;
	AdwBin* _tmp52_ = NULL;
	GtkWidget* result;
	g_return_val_if_fail (self != NULL, NULL);
	_data92_ = g_slice_new0 (Block92Data);
	_data92_->_ref_count_ = 1;
	_data92_->self = g_object_ref (self);
	_tmp0_ = g_strdup ("font-bold");
	_tmp1_ = g_new0 (gchar*, 1 + 1);
	_tmp1_[0] = _tmp0_;
	_tmp2_ = (GtkLabel*) gtk_label_new (_ ("Set Up Goals"));
	gtk_widget_set_css_classes ((GtkWidget*) _tmp2_, _tmp1_);
	_tmp1_ = (_vala_array_free (_tmp1_, 1, (GDestroyNotify) g_free), NULL);
	gtk_widget_set_halign ((GtkWidget*) _tmp2_, GTK_ALIGN_START);
	g_object_ref_sink (_tmp2_);
	title_label = _tmp2_;
	_tmp3_ = g_strdup ("caption");
	_tmp4_ = g_strdup ("dimmed");
	_tmp5_ = g_new0 (gchar*, 2 + 1);
	_tmp5_[0] = _tmp3_;
	_tmp5_[1] = _tmp4_;
	_tmp6_ = (GtkLabel*) gtk_label_new (_ ("Define how many tasks you want to complete per day and week"));
	gtk_widget_set_css_classes ((GtkWidget*) _tmp6_, _tmp5_);
	_tmp5_ = (_vala_array_free (_tmp5_, 2, (GDestroyNotify) g_free), NULL);
	gtk_widget_set_halign ((GtkWidget*) _tmp6_, GTK_ALIGN_START);
	gtk_label_set_wrap (_tmp6_, TRUE);
	g_object_ref_sink (_tmp6_);
	description_label = _tmp6_;
	_tmp7_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
	g_object_ref_sink (_tmp7_);
	title_box = _tmp7_;
	_tmp8_ = title_box;
	_tmp9_ = title_label;
	gtk_box_append (_tmp8_, (GtkWidget*) _tmp9_);
	_tmp10_ = title_box;
	_tmp11_ = description_label;
	gtk_box_append (_tmp10_, (GtkWidget*) _tmp11_);
	_tmp12_ = (GtkLabel*) gtk_label_new (_ ("Daily"));
	gtk_widget_set_halign ((GtkWidget*) _tmp12_, GTK_ALIGN_START);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp12_, TRUE);
	g_object_ref_sink (_tmp12_);
	daily_label = _tmp12_;
	_tmp13_ = (GtkSpinButton*) gtk_spin_button_new_with_range ((gdouble) 0, (gdouble) 100, (gdouble) 1);
	gtk_spin_button_set_value (_tmp13_, (gdouble) 5);
	g_object_ref_sink (_tmp13_);
	_data92_->daily_spin = _tmp13_;
	_tmp14_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp14_, TRUE);
	g_object_ref_sink (_tmp14_);
	daily_box = _tmp14_;
	_tmp15_ = daily_box;
	_tmp16_ = daily_label;
	gtk_box_append (_tmp15_, (GtkWidget*) _tmp16_);
	_tmp17_ = daily_box;
	_tmp18_ = _data92_->daily_spin;
	gtk_box_append (_tmp17_, (GtkWidget*) _tmp18_);
	_tmp19_ = (GtkLabel*) gtk_label_new (_ ("Weekly"));
	gtk_widget_set_halign ((GtkWidget*) _tmp19_, GTK_ALIGN_START);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp19_, TRUE);
	g_object_ref_sink (_tmp19_);
	weekly_label = _tmp19_;
	_tmp20_ = (GtkSpinButton*) gtk_spin_button_new_with_range ((gdouble) 0, (gdouble) 500, (gdouble) 1);
	gtk_spin_button_set_value (_tmp20_, (gdouble) 25);
	g_object_ref_sink (_tmp20_);
	_data92_->weekly_spin = _tmp20_;
	_tmp21_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp21_, TRUE);
	g_object_ref_sink (_tmp21_);
	weekly_box = _tmp21_;
	_tmp22_ = weekly_box;
	_tmp23_ = weekly_label;
	gtk_box_append (_tmp22_, (GtkWidget*) _tmp23_);
	_tmp24_ = weekly_box;
	_tmp25_ = _data92_->weekly_spin;
	gtk_box_append (_tmp24_, (GtkWidget*) _tmp25_);
	_tmp26_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 16);
	gtk_box_set_homogeneous (_tmp26_, TRUE);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp26_, TRUE);
	g_object_ref_sink (_tmp26_);
	goals_row = _tmp26_;
	_tmp27_ = goals_row;
	_tmp28_ = daily_box;
	gtk_box_append (_tmp27_, (GtkWidget*) _tmp28_);
	_tmp29_ = goals_row;
	_tmp30_ = weekly_box;
	gtk_box_append (_tmp29_, (GtkWidget*) _tmp30_);
	_tmp31_ = services_settings_get_default ();
	_tmp32_ = _tmp31_;
	_tmp33_ = _tmp32_->settings;
	_tmp34_ = g_settings_get_int (_tmp33_, "daily-task-goal");
	_g_object_unref0 (_tmp32_);
	saved_daily = _tmp34_;
	_tmp35_ = services_settings_get_default ();
	_tmp36_ = _tmp35_;
	_tmp37_ = _tmp36_->settings;
	_tmp38_ = g_settings_get_int (_tmp37_, "weekly-task-goal");
	_g_object_unref0 (_tmp36_);
	saved_weekly = _tmp38_;
	if (saved_daily > 0) {
		GtkSpinButton* _tmp39_;
		_tmp39_ = _data92_->daily_spin;
		gtk_spin_button_set_value (_tmp39_, (gdouble) saved_daily);
	}
	if (saved_weekly > 0) {
		GtkSpinButton* _tmp40_;
		_tmp40_ = _data92_->weekly_spin;
		gtk_spin_button_set_value (_tmp40_, (gdouble) saved_weekly);
	}
	_tmp41_ = g_strdup ("suggested-action");
	_tmp42_ = g_new0 (gchar*, 1 + 1);
	_tmp42_[0] = _tmp41_;
	_tmp43_ = (GtkButton*) gtk_button_new_with_label (_ ("Save"));
	gtk_widget_set_css_classes ((GtkWidget*) _tmp43_, _tmp42_);
	_tmp42_ = (_vala_array_free (_tmp42_, 1, (GDestroyNotify) g_free), NULL);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp43_, TRUE);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp43_, 6);
	g_object_ref_sink (_tmp43_);
	save_button = _tmp43_;
	g_signal_connect_data (save_button, "clicked", (GCallback) ___lambda918__gtk_button_clicked, block92_data_ref (_data92_), (GClosureNotify) block92_data_unref, 0);
	_tmp44_ = _data92_->daily_spin;
	g_signal_connect_data (_tmp44_, "value-changed", (GCallback) ___lambda919__gtk_spin_button_value_changed, block92_data_ref (_data92_), (GClosureNotify) block92_data_unref, 0);
	_tmp45_ = _data92_->weekly_spin;
	g_signal_connect_data (_tmp45_, "value-changed", (GCallback) ___lambda920__gtk_spin_button_value_changed, block92_data_ref (_data92_), (GClosureNotify) block92_data_unref, 0);
	_tmp46_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp46_, 16);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp46_, 16);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp46_, 16);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp46_, 16);
	g_object_ref_sink (_tmp46_);
	content_box = _tmp46_;
	_tmp47_ = title_box;
	gtk_box_append (content_box, (GtkWidget*) _tmp47_);
	_tmp48_ = goals_row;
	gtk_box_append (content_box, (GtkWidget*) _tmp48_);
	gtk_box_append (content_box, (GtkWidget*) save_button);
	_tmp49_ = g_strdup ("card");
	_tmp50_ = g_new0 (gchar*, 1 + 1);
	_tmp50_[0] = _tmp49_;
	_tmp51_ = _g_object_ref0 ((GtkWidget*) content_box);
	_tmp52_ = (AdwBin*) adw_bin_new ();
	gtk_widget_set_css_classes ((GtkWidget*) _tmp52_, _tmp50_);
	_tmp50_ = (_vala_array_free (_tmp50_, 1, (GDestroyNotify) g_free), NULL);
	adw_bin_set_child (_tmp52_, _tmp51_);
	_g_object_unref0 (_tmp51_);
	g_object_ref_sink (_tmp52_);
	result = (GtkWidget*) _tmp52_;
	_g_object_unref0 (content_box);
	_g_object_unref0 (save_button);
	_g_object_unref0 (goals_row);
	_g_object_unref0 (weekly_box);
	_g_object_unref0 (weekly_label);
	_g_object_unref0 (daily_box);
	_g_object_unref0 (daily_label);
	_g_object_unref0 (title_box);
	_g_object_unref0 (description_label);
	_g_object_unref0 (title_label);
	block92_data_unref (_data92_);
	_data92_ = NULL;
	return result;
}

static void
__lambda925_ (DialogsProductivityReportProductivityReportDialog* self)
{
	AdwNavigationView* _tmp0_;
	AdwNavigationPage* _tmp1_;
	AdwNavigationPage* _tmp2_;
	_tmp0_ = self->priv->navigation_view;
	_tmp1_ = dialogs_productivity_report_productivity_report_dialog_build_summary_detail_page (self);
	_tmp2_ = _tmp1_;
	adw_navigation_view_push (_tmp0_, _tmp2_);
	_g_object_unref0 (_tmp2_);
}

static void
___lambda925__dialogs_productivity_report_summary_section_see_more_clicked (DialogsProductivityReportSummarySection* _sender,
                                                                            gpointer self)
{
	__lambda925_ ((DialogsProductivityReportProductivityReportDialog*) self);
}

static void
__lambda926_ (DialogsProductivityReportProductivityReportDialog* self)
{
	AdwNavigationView* _tmp0_;
	AdwNavigationPage* _tmp1_;
	AdwNavigationPage* _tmp2_;
	_tmp0_ = self->priv->navigation_view;
	_tmp1_ = dialogs_productivity_report_productivity_report_dialog_build_productivity_detail_page (self);
	_tmp2_ = _tmp1_;
	adw_navigation_view_push (_tmp0_, _tmp2_);
	_g_object_unref0 (_tmp2_);
}

static void
___lambda926__dialogs_productivity_report_productivity_section_see_more_clicked (DialogsProductivityReportProductivitySection* _sender,
                                                                                 gpointer self)
{
	__lambda926_ ((DialogsProductivityReportProductivityReportDialog*) self);
}

static void
__lambda927_ (DialogsProductivityReportProductivityReportDialog* self)
{
	dialogs_productivity_report_productivity_report_dialog_show_goals_setup (self);
}

static void
___lambda927__dialogs_productivity_report_productivity_section_setup_goals_clicked (DialogsProductivityReportProductivitySection* _sender,
                                                                                    gpointer self)
{
	__lambda927_ ((DialogsProductivityReportProductivityReportDialog*) self);
}

static AdwNavigationPage*
dialogs_productivity_report_productivity_report_dialog_build_main_page (DialogsProductivityReportProductivityReportDialog* self)
{
	AdwHeaderBar* headerbar = NULL;
	AdwHeaderBar* _tmp0_;
	DialogsProductivityReportSummarySection* summary_section = NULL;
	DialogsProductivityReportSummarySection* _tmp1_;
	DialogsProductivityReportProductivitySection* _tmp2_;
	DialogsProductivityReportProductivitySection* _tmp3_;
	DialogsProductivityReportProductivitySection* _tmp4_;
	GtkBox* content_box = NULL;
	GtkBox* _tmp5_ = NULL;
	DialogsProductivityReportProductivitySection* _tmp6_;
	GtkScrolledWindow* scrolled_window = NULL;
	GtkWidget* _tmp7_;
	GtkScrolledWindow* _tmp8_ = NULL;
	AdwToolbarView* toolbar_view = NULL;
	GtkWidget* _tmp9_;
	AdwToolbarView* _tmp10_ = NULL;
	AdwNavigationPage* _tmp11_;
	AdwNavigationPage* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (AdwHeaderBar*) adw_header_bar_new ();
	g_object_ref_sink (_tmp0_);
	headerbar = _tmp0_;
	gtk_widget_add_css_class ((GtkWidget*) headerbar, "flat");
	_tmp1_ = dialogs_productivity_report_summary_section_new ();
	g_object_ref_sink (_tmp1_);
	summary_section = _tmp1_;
	g_signal_connect_object (summary_section, "see-more-clicked", (GCallback) ___lambda925__dialogs_productivity_report_summary_section_see_more_clicked, self, 0);
	_tmp2_ = dialogs_productivity_report_productivity_section_new ();
	g_object_ref_sink (_tmp2_);
	_g_object_unref0 (self->priv->productivity_section);
	self->priv->productivity_section = _tmp2_;
	_tmp3_ = self->priv->productivity_section;
	g_signal_connect_object (_tmp3_, "see-more-clicked", (GCallback) ___lambda926__dialogs_productivity_report_productivity_section_see_more_clicked, self, 0);
	_tmp4_ = self->priv->productivity_section;
	g_signal_connect_object (_tmp4_, "setup-goals-clicked", (GCallback) ___lambda927__dialogs_productivity_report_productivity_section_setup_goals_clicked, self, 0);
	_tmp5_ = (GtkBox*) gtk_box_new (GTK_ORIENTATION_VERTICAL, 24);
	gtk_widget_set_margin_start ((GtkWidget*) _tmp5_, 16);
	gtk_widget_set_margin_end ((GtkWidget*) _tmp5_, 16);
	gtk_widget_set_margin_top ((GtkWidget*) _tmp5_, 8);
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp5_, 24);
	g_object_ref_sink (_tmp5_);
	content_box = _tmp5_;
	gtk_box_append (content_box, (GtkWidget*) summary_section);
	_tmp6_ = self->priv->productivity_section;
	gtk_box_append (content_box, (GtkWidget*) _tmp6_);
	_tmp7_ = _g_object_ref0 ((GtkWidget*) content_box);
	_tmp8_ = (GtkScrolledWindow*) gtk_scrolled_window_new ();
	g_object_set (_tmp8_, "hscrollbar-policy", GTK_POLICY_NEVER, NULL);
	gtk_widget_set_hexpand ((GtkWidget*) _tmp8_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp8_, TRUE);
	gtk_scrolled_window_set_child (_tmp8_, _tmp7_);
	_g_object_unref0 (_tmp7_);
	g_object_ref_sink (_tmp8_);
	scrolled_window = _tmp8_;
	_tmp9_ = _g_object_ref0 ((GtkWidget*) scrolled_window);
	_tmp10_ = (AdwToolbarView*) adw_toolbar_view_new ();
	adw_toolbar_view_set_content (_tmp10_, _tmp9_);
	_g_object_unref0 (_tmp9_);
	g_object_ref_sink (_tmp10_);
	toolbar_view = _tmp10_;
	adw_toolbar_view_add_top_bar (toolbar_view, (GtkWidget*) headerbar);
	_tmp11_ = adw_navigation_page_new ((GtkWidget*) toolbar_view, _ ("Summary & Productivity"));
	g_object_ref_sink (_tmp11_);
	result = _tmp11_;
	_g_object_unref0 (toolbar_view);
	_g_object_unref0 (scrolled_window);
	_g_object_unref0 (content_box);
	_g_object_unref0 (summary_section);
	_g_object_unref0 (headerbar);
	return result;
}

static AdwNavigationPage*
dialogs_productivity_report_productivity_report_dialog_build_summary_detail_page (DialogsProductivityReportProductivityReportDialog* self)
{
	AdwHeaderBar* headerbar = NULL;
	AdwHeaderBar* _tmp0_;
	AdwStatusPage* status_page = NULL;
	gchar* _tmp1_;
	gchar* _tmp2_;
	AdwStatusPage* _tmp3_ = NULL;
	AdwToolbarView* toolbar_view = NULL;
	GtkWidget* _tmp4_;
	AdwToolbarView* _tmp5_ = NULL;
	AdwNavigationPage* _tmp6_;
	AdwNavigationPage* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (AdwHeaderBar*) adw_header_bar_new ();
	g_object_ref_sink (_tmp0_);
	headerbar = _tmp0_;
	gtk_widget_add_css_class ((GtkWidget*) headerbar, "flat");
	_tmp1_ = g_strdup (_ ("Summary Details"));
	_tmp2_ = g_strdup (_ ("Detailed summary will appear here"));
	_tmp3_ = (AdwStatusPage*) adw_status_page_new ();
	adw_status_page_set_title (_tmp3_, _tmp1_);
	_g_free0 (_tmp1_);
	adw_status_page_set_description (_tmp3_, _tmp2_);
	_g_free0 (_tmp2_);
	g_object_ref_sink (_tmp3_);
	status_page = _tmp3_;
	_tmp4_ = _g_object_ref0 ((GtkWidget*) status_page);
	_tmp5_ = (AdwToolbarView*) adw_toolbar_view_new ();
	adw_toolbar_view_set_content (_tmp5_, _tmp4_);
	_g_object_unref0 (_tmp4_);
	g_object_ref_sink (_tmp5_);
	toolbar_view = _tmp5_;
	adw_toolbar_view_add_top_bar (toolbar_view, (GtkWidget*) headerbar);
	_tmp6_ = adw_navigation_page_new ((GtkWidget*) toolbar_view, _ ("Summary"));
	g_object_ref_sink (_tmp6_);
	result = _tmp6_;
	_g_object_unref0 (toolbar_view);
	_g_object_unref0 (status_page);
	_g_object_unref0 (headerbar);
	return result;
}

static AdwNavigationPage*
dialogs_productivity_report_productivity_report_dialog_build_productivity_detail_page (DialogsProductivityReportProductivityReportDialog* self)
{
	AdwHeaderBar* headerbar = NULL;
	AdwHeaderBar* _tmp0_;
	AdwStatusPage* status_page = NULL;
	gchar* _tmp1_;
	gchar* _tmp2_;
	AdwStatusPage* _tmp3_ = NULL;
	AdwToolbarView* toolbar_view = NULL;
	GtkWidget* _tmp4_;
	AdwToolbarView* _tmp5_ = NULL;
	AdwNavigationPage* _tmp6_;
	AdwNavigationPage* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = (AdwHeaderBar*) adw_header_bar_new ();
	g_object_ref_sink (_tmp0_);
	headerbar = _tmp0_;
	gtk_widget_add_css_class ((GtkWidget*) headerbar, "flat");
	_tmp1_ = g_strdup (_ ("Productivity Details"));
	_tmp2_ = g_strdup (_ ("Detailed productivity stats will appear here"));
	_tmp3_ = (AdwStatusPage*) adw_status_page_new ();
	adw_status_page_set_title (_tmp3_, _tmp1_);
	_g_free0 (_tmp1_);
	adw_status_page_set_description (_tmp3_, _tmp2_);
	_g_free0 (_tmp2_);
	g_object_ref_sink (_tmp3_);
	status_page = _tmp3_;
	_tmp4_ = _g_object_ref0 ((GtkWidget*) status_page);
	_tmp5_ = (AdwToolbarView*) adw_toolbar_view_new ();
	adw_toolbar_view_set_content (_tmp5_, _tmp4_);
	_g_object_unref0 (_tmp4_);
	g_object_ref_sink (_tmp5_);
	toolbar_view = _tmp5_;
	adw_toolbar_view_add_top_bar (toolbar_view, (GtkWidget*) headerbar);
	_tmp6_ = adw_navigation_page_new ((GtkWidget*) toolbar_view, _ ("Productivity"));
	g_object_ref_sink (_tmp6_);
	result = _tmp6_;
	_g_object_unref0 (toolbar_view);
	_g_object_unref0 (status_page);
	_g_object_unref0 (headerbar);
	return result;
}

static void
_dialogs_productivity_report_productivity_report_dialog___lambda928_ (DialogsProductivityReportProductivityReportDialog* self)
{
	dialogs_productivity_report_productivity_report_dialog_hide_goals_setup (self);
}

static void
__dialogs_productivity_report_productivity_report_dialog___lambda928__gtk_gesture_click_pressed (GtkGestureClick* _sender,
                                                                                                 gint n_press,
                                                                                                 gdouble x,
                                                                                                 gdouble y,
                                                                                                 gpointer self)
{
	_dialogs_productivity_report_productivity_report_dialog___lambda928_ ((DialogsProductivityReportProductivityReportDialog*) self);
}

static void
_dialogs_productivity_report_productivity_report_dialog___lambda929_ (DialogsProductivityReportProductivityReportDialog* self)
{
	AdwBin* _tmp0_;
	GtkRevealer* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	_tmp0_ = self->priv->dimming_widget;
	_tmp1_ = self->priv->goals_revealer;
	_tmp2_ = gtk_revealer_get_reveal_child (_tmp1_);
	_tmp3_ = _tmp2_;
	gtk_widget_set_visible ((GtkWidget*) _tmp0_, _tmp3_);
}

static void
__dialogs_productivity_report_productivity_report_dialog___lambda929__g_object_notify (GObject* _sender,
                                                                                       GParamSpec* pspec,
                                                                                       gpointer self)
{
	_dialogs_productivity_report_productivity_report_dialog___lambda929_ ((DialogsProductivityReportProductivityReportDialog*) self);
}

static void
_dialogs_productivity_report_productivity_report_dialog___lambda930_ (DialogsProductivityReportProductivityReportDialog* self)
{
	ServicesEventBus* _tmp0_;
	ServicesEventBus* _tmp1_;
	_tmp0_ = services_event_bus_get_default ();
	_tmp1_ = _tmp0_;
	g_signal_emit_by_name (_tmp1_, "connect-typing-accel");
	_g_object_unref0 (_tmp1_);
}

static void
__dialogs_productivity_report_productivity_report_dialog___lambda930__adw_dialog_closed (AdwDialog* _sender,
                                                                                         gpointer self)
{
	_dialogs_productivity_report_productivity_report_dialog___lambda930_ ((DialogsProductivityReportProductivityReportDialog*) self);
}

static GObject *
dialogs_productivity_report_productivity_report_dialog_constructor (GType type,
                                                                    guint n_construct_properties,
                                                                    GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	DialogsProductivityReportProductivityReportDialog * self;
	AdwNavigationView* _tmp0_;
	AdwNavigationView* _tmp1_;
	AdwNavigationPage* _tmp2_;
	AdwNavigationPage* _tmp3_;
	gchar* _tmp4_;
	gchar** _tmp5_;
	AdwBin* _tmp6_ = NULL;
	GtkGestureClick* dimming_gesture = NULL;
	GtkGestureClick* _tmp7_;
	AdwBin* _tmp8_;
	GtkGestureClick* _tmp9_;
	GtkEventController* _tmp10_;
	GtkGestureClick* _tmp11_;
	GtkWidget* _tmp12_;
	GtkRevealer* _tmp13_ = NULL;
	GtkRevealer* _tmp14_;
	GtkOverlay* main_overlay = NULL;
	AdwNavigationView* _tmp15_;
	GtkWidget* _tmp16_;
	GtkOverlay* _tmp17_ = NULL;
	GtkOverlay* _tmp18_;
	AdwBin* _tmp19_;
	GtkOverlay* _tmp20_;
	GtkRevealer* _tmp21_;
	GtkOverlay* _tmp22_;
	ServicesEventBus* _tmp23_;
	ServicesEventBus* _tmp24_;
	parent_class = G_OBJECT_CLASS (dialogs_productivity_report_productivity_report_dialog_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DIALOGS_PRODUCTIVITY_REPORT_TYPE_PRODUCTIVITY_REPORT_DIALOG, DialogsProductivityReportProductivityReportDialog);
	_tmp0_ = (AdwNavigationView*) adw_navigation_view_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->navigation_view);
	self->priv->navigation_view = _tmp0_;
	_tmp1_ = self->priv->navigation_view;
	_tmp2_ = dialogs_productivity_report_productivity_report_dialog_build_main_page (self);
	_tmp3_ = _tmp2_;
	adw_navigation_view_add (_tmp1_, _tmp3_);
	_g_object_unref0 (_tmp3_);
	_tmp4_ = g_strdup ("dimming-bg");
	_tmp5_ = g_new0 (gchar*, 1 + 1);
	_tmp5_[0] = _tmp4_;
	_tmp6_ = (AdwBin*) adw_bin_new ();
	gtk_widget_set_visible ((GtkWidget*) _tmp6_, FALSE);
	gtk_widget_set_css_classes ((GtkWidget*) _tmp6_, _tmp5_);
	_tmp5_ = (_vala_array_free (_tmp5_, 1, (GDestroyNotify) g_free), NULL);
	g_object_ref_sink (_tmp6_);
	_g_object_unref0 (self->priv->dimming_widget);
	self->priv->dimming_widget = _tmp6_;
	_tmp7_ = (GtkGestureClick*) gtk_gesture_click_new ();
	dimming_gesture = _tmp7_;
	_tmp8_ = self->priv->dimming_widget;
	_tmp9_ = dimming_gesture;
	_tmp10_ = _g_object_ref0 ((GtkEventController*) _tmp9_);
	gtk_widget_add_controller ((GtkWidget*) _tmp8_, _tmp10_);
	_tmp11_ = dimming_gesture;
	g_signal_connect_object (_tmp11_, "pressed", (GCallback) __dialogs_productivity_report_productivity_report_dialog___lambda928__gtk_gesture_click_pressed, self, 0);
	_tmp12_ = dialogs_productivity_report_productivity_report_dialog_build_goals_setup (self);
	_tmp13_ = (GtkRevealer*) gtk_revealer_new ();
	gtk_revealer_set_child (_tmp13_, _tmp12_);
	_g_object_unref0 (_tmp12_);
	gtk_widget_set_valign ((GtkWidget*) _tmp13_, GTK_ALIGN_END);
	gtk_revealer_set_transition_type (_tmp13_, GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP);
	gtk_revealer_set_reveal_child (_tmp13_, FALSE);
	g_object_ref_sink (_tmp13_);
	_g_object_unref0 (self->priv->goals_revealer);
	self->priv->goals_revealer = _tmp13_;
	_tmp14_ = self->priv->goals_revealer;
	g_signal_connect_object ((GObject*) _tmp14_, "notify::reveal-child", (GCallback) __dialogs_productivity_report_productivity_report_dialog___lambda929__g_object_notify, self, 0);
	_tmp15_ = self->priv->navigation_view;
	_tmp16_ = _g_object_ref0 ((GtkWidget*) _tmp15_);
	_tmp17_ = (GtkOverlay*) gtk_overlay_new ();
	gtk_overlay_set_child (_tmp17_, _tmp16_);
	_g_object_unref0 (_tmp16_);
	g_object_ref_sink (_tmp17_);
	main_overlay = _tmp17_;
	_tmp18_ = main_overlay;
	_tmp19_ = self->priv->dimming_widget;
	gtk_overlay_add_overlay (_tmp18_, (GtkWidget*) _tmp19_);
	_tmp20_ = main_overlay;
	_tmp21_ = self->priv->goals_revealer;
	gtk_overlay_add_overlay (_tmp20_, (GtkWidget*) _tmp21_);
	_tmp22_ = main_overlay;
	adw_dialog_set_child ((AdwDialog*) self, (GtkWidget*) _tmp22_);
	g_signal_connect_object ((AdwDialog*) self, "closed", (GCallback) __dialogs_productivity_report_productivity_report_dialog___lambda930__adw_dialog_closed, self, 0);
	_tmp23_ = services_event_bus_get_default ();
	_tmp24_ = _tmp23_;
	g_signal_emit_by_name (_tmp24_, "disconnect-typing-accel");
	_g_object_unref0 (_tmp24_);
	_g_object_unref0 (main_overlay);
	_g_object_unref0 (dimming_gesture);
	return obj;
}

static void
dialogs_productivity_report_productivity_report_dialog_class_init (DialogsProductivityReportProductivityReportDialogClass * klass,
                                                                   gpointer klass_data)
{
	dialogs_productivity_report_productivity_report_dialog_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &DialogsProductivityReportProductivityReportDialog_private_offset);
	G_OBJECT_CLASS (klass)->constructor = dialogs_productivity_report_productivity_report_dialog_constructor;
	G_OBJECT_CLASS (klass)->finalize = dialogs_productivity_report_productivity_report_dialog_finalize;
}

static void
dialogs_productivity_report_productivity_report_dialog_instance_init (DialogsProductivityReportProductivityReportDialog * self,
                                                                      gpointer klass)
{
	self->priv = dialogs_productivity_report_productivity_report_dialog_get_instance_private (self);
}

static void
dialogs_productivity_report_productivity_report_dialog_finalize (GObject * obj)
{
	DialogsProductivityReportProductivityReportDialog * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, DIALOGS_PRODUCTIVITY_REPORT_TYPE_PRODUCTIVITY_REPORT_DIALOG, DialogsProductivityReportProductivityReportDialog);
	_g_object_unref0 (self->priv->navigation_view);
	_g_object_unref0 (self->priv->dimming_widget);
	_g_object_unref0 (self->priv->goals_revealer);
	_g_object_unref0 (self->priv->productivity_section);
	G_OBJECT_CLASS (dialogs_productivity_report_productivity_report_dialog_parent_class)->finalize (obj);
}

static GType
dialogs_productivity_report_productivity_report_dialog_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (DialogsProductivityReportProductivityReportDialogClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) dialogs_productivity_report_productivity_report_dialog_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (DialogsProductivityReportProductivityReportDialog), 0, (GInstanceInitFunc) dialogs_productivity_report_productivity_report_dialog_instance_init, NULL };
	GType dialogs_productivity_report_productivity_report_dialog_type_id;
	dialogs_productivity_report_productivity_report_dialog_type_id = g_type_register_static (adw_dialog_get_type (), "DialogsProductivityReportProductivityReportDialog", &g_define_type_info, 0);
	DialogsProductivityReportProductivityReportDialog_private_offset = g_type_add_instance_private (dialogs_productivity_report_productivity_report_dialog_type_id, sizeof (DialogsProductivityReportProductivityReportDialogPrivate));
	return dialogs_productivity_report_productivity_report_dialog_type_id;
}

GType
dialogs_productivity_report_productivity_report_dialog_get_type (void)
{
	static volatile gsize dialogs_productivity_report_productivity_report_dialog_type_id__once = 0;
	if (g_once_init_enter (&dialogs_productivity_report_productivity_report_dialog_type_id__once)) {
		GType dialogs_productivity_report_productivity_report_dialog_type_id;
		dialogs_productivity_report_productivity_report_dialog_type_id = dialogs_productivity_report_productivity_report_dialog_get_type_once ();
		g_once_init_leave (&dialogs_productivity_report_productivity_report_dialog_type_id__once, dialogs_productivity_report_productivity_report_dialog_type_id);
	}
	return dialogs_productivity_report_productivity_report_dialog_type_id__once;
}

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

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

