// Imports

// Core
import { App } from "./core/App.js";
import { Rpc } from "./core/Rpc.js";
import { UI } from "./core/UI.js";

// Models
import { User } from "./model/User.js";
import { UserProfile } from "./model/UserProfile.js";
import { Group } from "./model/Group.js";
import { Appointment } from "./model/Appointment.js";
import { Contract } from "./model/Contract.js";
import { AttendedAppointment } from "./model/AttendedAppointment.js";
import { Countries } from "./model/Countries.js";
import { ZContract } from "./model/ZContract.js";

// Components
import { Layout } from "./components/general/Layout.js";
import { SideNavigation } from "./components/general/SideNavigation.js";
import { MemberDataTable } from "./components/members/MemberDataTable.js";
import { AppointmentDataTable } from "./components/appointments/AppointmentDataTable.js";
import { AppointmentSelectTable } from "./components/appointments/AppointmentSelectTable.js";
import { ContractDataTable } from "./components/contract/ContractDataTable.js";
import { ContractUnchargedMemberDataTable} from "./components/contract/ContractUnchargedMemberDataTable.js";
import { ContractForm } from "./components/contract/ContractForm.js";
import { ContractAppointmentAssignDualList } from "./components/contract/ContractAppointmentAssignDualList.js";
import { CoronaTracking } from "./components/corona/CoronaTracking.js";
import { AccessDataTable } from "./components/settings/AccessDataTable.js";
import { EmployeeDataTable } from "./components/kkspecial/EmployeeDataTable.js";
import { HourAllocationDataTable } from "./components/kkspecial/HourAllocationDataTable.js";
import { HourReportingDataTable } from "./components/kkspecial/HourReportingDataTable.js";

// View
import { AuthLogin } from "./views/auth/AuthLogin.js";
import { Dashboard } from "./views/dashboard/Dashboard.js";
import { MemberList } from "./views/members/MemberList.js";
import { AppointmentList } from "./views/appointments/AppointmentList.js";
import { AppointmentCalendar } from "./views/appointments/AppointmentCalendar.js";
import { ContractList } from "./views/contract/ContractList.js";
import { ContractOverview } from "./views/contract/ContractOverview.js";
import { ContractCharging } from "./views/contract/ContractCharging.js";
import { ContractClaim } from "./views/contract/ContractClaim.js";
import { ContractArchive } from "./views/contract/ContractArchive.js";
import { ContractCreate } from "./views/contract/ContractCreate.js";
import { ContractEdit } from "./views/contract/ContractEdit.js";
import { ContractChargeAppointment } from "./views/contract/ContractChargeAppointment.js";
import { ContractMasterData } from "./views/contract/ContractMasterData.js";
import { CoronaSpecial } from "./views/corona/CoronaSpecial.js";
import { SettingsAccess } from "./views/settings/SettingsAccess.js";
import { ContractCommercial } from "./views/contract/ContractCommercial.js";
import { EmployeeList } from "./views/kkspecial/EmployeeList.js";
import { HourAllocation } from "./views/kkspecial/HourAllocation.js";
import { HourReporting } from "./views/kkspecial/HourReporting.js";

const app = IF.createApp(
    'pb-manager',
    document.getElementById( 'manager-app'),
    App,
    {
        title : 'ProBuddy | Manager',
        resources : {
            css : [
                'assets/css/bootstrap.css',
                'assets/font-awesome/css/font-awesome.css',
                'assets/css/animate.css',
                'assets/css/dataTables/datatables.min.css',
                //'assets/css/fullcalendar/fullcalendar.print.css',
                'assets/css/fullcalendar/fullcalendar.css',
                'assets/css/toastr/toastr.min.css',
                'assets/css/awesome-bootstrap-checkbox.css',
                'assets/css/dualListBox/bootstrap-duallistbox.min.css',
                'assets/css/style.css',
                'assets/css/app.css'
            ]
        }
    }
);

app.addClass( 'Rpc', Rpc );
app.addClass( 'UI', UI );
app.addClass( 'User', User );
app.addClass( 'UserProfile', UserProfile );
app.addClass( 'Group', Group );
app.addClass( 'Appointment', Appointment );
app.addClass( 'Contract', Contract );
app.addClass( 'AttendedAppointment', AttendedAppointment );
app.addClass( 'Countries', Countries );
app.addClass( 'ZContract', ZContract );

app.addComponent( 'layout', Layout );
app.addComponent( 'side-navigation', SideNavigation );
app.addComponent( 'member-data-table', MemberDataTable );
app.addComponent( 'appointment-data-table', AppointmentDataTable );
app.addComponent( 'appointment-select-table', AppointmentSelectTable );
app.addComponent( 'contract-data-table', ContractDataTable );
app.addComponent( 'contract-uncharged-member-data-table', ContractUnchargedMemberDataTable );
app.addComponent( 'contract-form', ContractForm );
app.addComponent( 'contract-appointment-assign-dual-list', ContractAppointmentAssignDualList );
app.addComponent( 'corona-tracking', CoronaTracking );
app.addComponent( 'access-data-table', AccessDataTable );
app.addComponent( 'kkspecial-employee-data-table', EmployeeDataTable );
app.addComponent( 'kkspecial-hour-allocation-data-table', HourAllocationDataTable );
app.addComponent( 'kkspecial-hour-reporting-data-table', HourReportingDataTable );

app.addView( 'login', AuthLogin );
app.addView( 'dashboard', Dashboard );
app.addView( 'member-list', MemberList );
app.addView( 'appointment-list', AppointmentList );
app.addView( 'appointment-calendar', AppointmentCalendar );
app.addView( 'contract-overview', ContractOverview );
app.addView( 'contract-list', ContractList );
app.addView( 'contract-charging', ContractCharging );
app.addView( 'contract-claim', ContractClaim );
app.addView( 'contract-archive', ContractArchive );
app.addView( 'contract-create', ContractCreate );
app.addView( 'contract-edit', ContractEdit );
app.addView( 'contract-charge-appointment', ContractChargeAppointment );
app.addView( 'contract-master-data', ContractMasterData );
app.addView( 'contract-commercial', ContractCommercial );
app.addView( 'corona-special', CoronaSpecial );
app.addView( 'settings-access', SettingsAccess );
app.addView( 'kkspecial-employee-list', EmployeeList );
app.addView( 'kkspecial-hour-allocation', HourAllocation );
app.addView( 'kkspecial-hour-reporting', HourReporting );

window.onload = function()
{
    app.run();
    window.app = app;
};