var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/eventBooking/components/Provider/Content/index.tsx
var Content_exports = {};
__export(Content_exports, {
  default: () => Content_default
});
module.exports = __toCommonJS(Content_exports);
var import_react = __toESM(require("react"));
var import_Sales = require("../../../../Sales");
var import_utils = require("@pisell/utils");
var import_Item = __toESM(require("../Cart/Item"));
var import_Resource = __toESM(require("../Resource"));
var import_Event = __toESM(require("../Event"));
var import_Information = __toESM(require("../Information"));
var import_index = require("./index.less");
var Layout = () => {
  const { currentStepData, isFirstStep } = (0, import_Sales.useStep)();
  (0, import_react.useEffect)(() => {
    window.scrollTo({
      top: 0,
      behavior: "smooth"
    });
  }, [currentStepData == null ? void 0 : currentStepData.key]);
  const Com = (0, import_react.useMemo)(() => {
    const key = currentStepData == null ? void 0 : currentStepData.key;
    if (!key) return null;
    const components = {
      // 选择资源
      "select-category": import_Resource.default,
      // 选择event
      "select-event": import_Event.default,
      // 确认信息
      "confirm-information": import_Information.default
    };
    let Com2 = components[key];
    return /* @__PURE__ */ import_react.default.createElement(Com2, null);
  }, [currentStepData == null ? void 0 : currentStepData.key]);
  (0, import_react.useEffect)(() => {
    var _a, _b;
    if ((0, import_utils.isMobile)()) {
      const header = document.querySelector(".event-progress-bar");
      const footer = document.querySelector(".pisell-section-footers-wrapper");
      const content = document.querySelector(".event-content-mobile-wrap");
      const headerHeight = ((_a = header == null ? void 0 : header.getBoundingClientRect()) == null ? void 0 : _a.height) || 0;
      const footerHeight = ((_b = footer == null ? void 0 : footer.getBoundingClientRect()) == null ? void 0 : _b.height) || 0;
      const windowHeight = window.innerHeight;
      const contentHeight = windowHeight - headerHeight - footerHeight;
      if (content && (content == null ? void 0 : content.style)) {
        content.style.height = `${contentHeight}px`;
        content.style.overflowY = "auto";
      }
    }
  }, [currentStepData == null ? void 0 : currentStepData.key]);
  return /* @__PURE__ */ import_react.default.createElement(
    "div",
    {
      className: `event-content-wrap ${(0, import_utils.isMobile)() ? "event-content-mobile-wrap" : ""}`
    },
    /* @__PURE__ */ import_react.default.createElement("div", { className: "event-content-left" }, Com),
    !(0, import_utils.isMobile)() && !isFirstStep ? /* @__PURE__ */ import_react.default.createElement("div", { className: "event-content-right" }, /* @__PURE__ */ import_react.default.createElement(import_Item.default, null)) : null
  );
};
var Content_default = Layout;
