"use client";
import { Fragment, jsx } from "react/jsx-runtime";
import { useInjectionDataWidgets } from "./useInjectionDataWidgets.js";
import { InjectionWizard } from "./InjectionWizard.js";
function isWizardWidget(widget) {
  const mod = widget.module ?? widget;
  return mod && typeof mod === "object" && "kind" in mod && mod.kind === "wizard" && "steps" in mod;
}
function WizardInjectionSpot({ spotId, context, onClose }) {
  const { widgets, isLoading } = useInjectionDataWidgets(spotId);
  if (isLoading || widgets.length === 0) return null;
  const wizardWidgets = widgets.filter(isWizardWidget);
  if (wizardWidgets.length === 0) return null;
  return /* @__PURE__ */ jsx(Fragment, { children: wizardWidgets.map((widget) => {
    const mod = widget.module ?? widget;
    return /* @__PURE__ */ jsx(
      InjectionWizard,
      {
        widget: mod,
        context,
        onClose
      },
      mod.metadata?.id ?? widget.key
    );
  }) });
}
export {
  WizardInjectionSpot
};
//# sourceMappingURL=WizardInjectionSpot.js.map
