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/plus/productSelect/ProductCard/SkuCard/hooks/useDynamicComponents.ts
var useDynamicComponents_exports = {};
__export(useDynamicComponents_exports, {
  useDynamicComponents: () => useDynamicComponents
});
module.exports = __toCommonJS(useDynamicComponents_exports);
var import_react = __toESM(require("react"));
var import_Title = __toESM(require("../components/Title"));
var import_SubTitle = __toESM(require("../components/SubTitle"));
var import_Price = __toESM(require("../components/Price"));
var import_Tags = __toESM(require("../components/Tags"));
var import_MemberPrice = __toESM(require("../components/MemberPrice"));
var import_Countdown = __toESM(require("../components/Countdown"));
var import_Stock = __toESM(require("../components/Stock"));
var import_Capacity = __toESM(require("../components/Capacity"));
var import_Duration = __toESM(require("../components/Duration"));
var import_Time = __toESM(require("../components/Time"));
var import_Resource = __toESM(require("../components/Resource"));
var import_Promotions = __toESM(require("../components/Promotions"));
var componentMap = {
  title: import_Title.default,
  subtitle: import_SubTitle.default,
  price: import_Price.default,
  memberPrice: import_MemberPrice.default,
  tags: import_Tags.default,
  countdown: import_Countdown.default,
  stock: import_Stock.default,
  capacity: import_Capacity.default,
  duration: import_Duration.default,
  time: import_Time.default,
  resource: import_Resource.default,
  promotions: import_Promotions.default
};
var useDynamicComponents = () => {
  const renderComponent = (key, props) => {
    const Component = componentMap[key];
    if (!Component) {
      return null;
    }
    return import_react.default.createElement(Component, { key, props });
  };
  const renderComponents = (props) => {
    let sortKeys = (props == null ? void 0 : props.sortKeys) || [];
    return sortKeys.map((key) => renderComponent(key, props));
  };
  return {
    renderComponent,
    renderComponents,
    componentMap
  };
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  useDynamicComponents
});
