/*! phoscon-app 2025-10-13 */

import*as scheduleFunctions from"./schedule-functions.js";export const emptyHandlerFactory=(view,overView,listView,navView,constants)=>(ctx,event)=>{let c=constants,type=event.type;type===c.states.EMPTY?(view.show(),navView.showEmptyState()):type===c.events.ADD_SCHEDULE?scheduleFunctions.addSchedule(overView,listView):view.hide()};export const overviewHandlerFactory=(view,listView,navView,constants)=>(ctx,event)=>{let c=constants,type=event.type;(({[c.states.OVERVIEW]:()=>{view.show(),navView.hideEmptyState()},[c.events.DELETE_CLICKED]:()=>scheduleFunctions.deleteSchedule(listView,view,constants),[c.events.RENAME_CLICKED]:()=>scheduleFunctions.renameSchedule(listView,view,constants),[c.events.ADD_SCHEDULE]:()=>scheduleFunctions.addSchedule(view,listView),[c.events.ACTIVATE_SCHEDULE]:()=>scheduleFunctions.activateSchedule(view,listView),[c.events.DEACTIVATE_SCHEDULE]:()=>scheduleFunctions.deactivateSchedule(view,listView),[c.events.WEEKDAY_CLICKED]:()=>scheduleFunctions.saveWeekdays(view,event.day),[c.events.FADING_TIME_CHANGED]:()=>scheduleFunctions.adaptFadingTime(view,event.value),[c.events.BLIND_HEIGHT_CHANGED]:()=>scheduleFunctions.adaptBlindHeight(view,event.value),[c.events.THERMOSTAT_CHANGED]:()=>scheduleFunctions.adaptThermoStatChanged(view,event.value),[c.events.TIME_CHANGED]:()=>scheduleFunctions.adaptTime(view,event.value),[c.events.TIMER_FINISHED]:()=>view.clickEvents(!0),[c.events.TOGGLE_FADING]:()=>scheduleFunctions.toggleFadingStart(view,event.value)})[type]||(()=>{view.hide()}))()};export const navHandlerFactory=(view,settingsView,constants)=>(ctx,event)=>{let c=constants;event.type===c.events.SCHEDULE_CHANGED&&scheduleFunctions.scheduleChanged(view,constants)};export const scheduleListHandlerFactory=(view,overView,constants)=>(ctx,event)=>{let c=constants;event.type===c.events.SCHEDULE_SELECTED&&scheduleFunctions.setActiveSchedule(overView,view,constants)};export const sceneListHandlerFactory=(view,overView,constants)=>(ctx,event)=>{let c=constants,type=event.type;type===c.events.SCENE_SELECTED?scheduleFunctions.selectScene(view,overView,constants):type===c.events.GROUP_OFF?scheduleFunctions.lightGroup(view,overView,constants):type===c.events.BLIND_GROUP?scheduleFunctions.blindGroup(view,overView,constants):type===c.events.THERMOSTAT_GROUP&&scheduleFunctions.thermostatGroup(view,overView,constants)};