import { _objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import { miniRedux } from "@pisell/utils";
const { Provider, Context } = miniRedux({
	namespace: "state",
	state: {
		data: {},
		schedulesDetail: {
			id: void 0,
			show: false
		},
		currentSelectDayDetail: null,
		tabKey: "products",
		calendar: {
			isEdit: false,
			allData: [],
			editData: []
		},
		schedules: {
			list: [],
			scheduleMap: {},
			scheduleAllMap: {}
		},
		products: {
			list: [],
			search: "",
			currentProduct: null,
			openProductDetailDrawer: false,
			openAddSchedulesDrawer: false
		},
		resources: { cacheResource: null },
		setGlobalState: null
	},
	reducers: {
		setState(state, payload) {
			return _objectSpread2(_objectSpread2({}, state), payload);
		},
		setGlobalState(state, payload) {
			return _objectSpread2(_objectSpread2({}, state), payload);
		},
		setProducts(state, payload) {
			return _objectSpread2(_objectSpread2({}, state), {}, { products: _objectSpread2(_objectSpread2({}, state.products), payload) });
		},
		setCalendar(state, payload) {
			return _objectSpread2(_objectSpread2({}, state), {}, { calendar: _objectSpread2(_objectSpread2({}, state.calendar), payload) });
		},
		setSchedules(state, payload) {
			return _objectSpread2(_objectSpread2({}, state), {}, { schedules: _objectSpread2(_objectSpread2({}, state.schedules), payload) });
		},
		setResources(state, payload) {
			return _objectSpread2(_objectSpread2({}, state), {}, { resources: _objectSpread2(_objectSpread2({}, state.resources), payload) });
		}
	}
});
//#endregion
export { Context, Provider };
