import useEngineContext from "../../hooks/useEngineContext.js";
import useWindowSize from "../../hooks/useWindowSize.js";
import { useSales } from "../../businessModel/SalesModel/Sales/index.js";
import { useStep } from "../Sales/Step/index.js";
import { useResource } from "../Sales/Resource/index.js";
import { useInit } from "../Sales/Init/index.js";
import SalesPage from "../Sales/index.js";
import Header from "./components/Provider/Header/index.js";
import Footer from "./components/Provider/Footer/index.js";
import Layout from "./components/Provider/Content/index.js";
import locales_default from "./locales.js";
import React, { useEffect } from "react";
import { isMobile, locales } from "@pisell/utils";
import "./index.less";
//#region src/components/eventBooking/index.tsx
const Content = () => {
	var _utils$storage;
	const utils = useEngineContext().appHelper.utils || {};
	locales.init(locales_default, (utils === null || utils === void 0 || (_utils$storage = utils.storage) === null || _utils$storage === void 0 ? void 0 : _utils$storage.get("umi_locale")) || "en");
	useWindowSize({ debounceMs: 200 });
	const { data } = useSales();
	const { getBoardSetting } = useInit();
	const { currentStepData } = useStep();
	const { getResourceList } = useResource();
	const { form_id, shop_id } = data.initData || {};
	useEffect(() => {
		getBoardSetting.run({ item_type: "event_booking_v2" });
	}, []);
	/**
	* @title: 获取资源列表数据
	* @description:
	* @return {*}
	* @Author: WangHan
	* @Date: 2025-01-17 14:25
	*/
	useEffect(() => {
		var _utils$getHistory, _history$location;
		const history = (utils === null || utils === void 0 || (_utils$getHistory = utils.getHistory) === null || _utils$getHistory === void 0 ? void 0 : _utils$getHistory.call(utils)) || {};
		const query = history === null || history === void 0 || (_history$location = history.location) === null || _history$location === void 0 ? void 0 : _history$location.query;
		const params = { front_end_cache_id: (query === null || query === void 0 ? void 0 : query.cacheId) || "" };
		if (query === null || query === void 0 ? void 0 : query.ids) {
			var _query$ids;
			params.event_item_ids = query === null || query === void 0 || (_query$ids = query.ids) === null || _query$ids === void 0 ? void 0 : _query$ids.split(",");
		}
		getResourceList.run(params);
	}, []);
	return /* @__PURE__ */ React.createElement("div", { className: `event-booking-wrap ${isMobile() ? "event-booking-mobile-wrap" : ""}` }, /* @__PURE__ */ React.createElement(Header, null), /* @__PURE__ */ React.createElement(Layout, null), isMobile() && (currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.key) !== "select-category" ? /* @__PURE__ */ React.createElement(Footer, null) : null);
};
const EventBooking = () => {
	return /* @__PURE__ */ React.createElement(SalesPage, { config: { useSessionStorage: true } }, /* @__PURE__ */ React.createElement(Content, null));
};
//#endregion
export { EventBooking as default };
