import { jsx as e, jsxs as t } from "react/jsx-runtime";
import { useCallback as s } from "react";
import { salesChannelOptions as u } from "../schemas.js";
import f from "../../../hooks/useStepperState.js";
import S from "../../../hooks/useStepperHandlers.js";
import g from "../../../../form/hooks/useZodForm.js";
import C from "../../../hooks/useStepperBeforeNavigate.js";
import T from "../../../../form/Form.js";
import b from "../../../../box/Box.js";
import a from "../../../../field/Field.js";
import i from "../../../../field/components/field-label/FieldLabel.js";
import n from "../../../../field/components/field-control/FieldControl.js";
import x from "../../../../select/Select.js";
import v from "../../../../input/Input.js";
import V from "../../../../alert/Alert.js";
import w from "../../../../checkbox/Checkbox.js";
const N = ({ id: y }) => {
  const { currentStep: l } = f(), { setStepData: p } = S(), { schema: m, defaultValues: c } = l.initialData, o = g({ schema: m, defaultValues: l.storedData ?? c });
  C(async (r) => {
    if (r.type === "next" && !await o.trigger()) return !1;
    p("shop", o.getValues());
  });
  const h = s(
    (r) => {
      o.setValue("acceptShopTerms", r, { shouldValidate: !0 });
    },
    [o]
  ), d = s(
    (r) => {
      o.setValue("salesChannel", r);
    },
    [o]
  );
  return /* @__PURE__ */ e(T, { form: o, onSubmit: () => {
  }, noValidate: !0, children: /* @__PURE__ */ t(b, { className: "flex flex-col gap-[var(--spacing-6)]", children: [
    /* @__PURE__ */ t(a, { name: "salesChannel", children: [
      /* @__PURE__ */ e(i, { required: !0, children: "Sales Channel" }),
      /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(x, { options: u, placeholder: "JTL-Shop", value: o.watch("salesChannel"), onChange: d }) })
    ] }),
    /* @__PURE__ */ t(a, { name: "shopName", children: [
      /* @__PURE__ */ e(i, { required: !0, children: "Shop Name" }),
      /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(v, { placeholder: "Tassen Tycoon" }) })
    ] }),
    /* @__PURE__ */ e(
      V,
      {
        variant: "warning",
        title: "Notice",
        description: "JTL-Software-GmbH is not responsible for products or services sold through the connected online shop. As the shop operator, you are responsible for compliance with all legal requirements, such as a complete imprint or cancellation form.",
        closable: !1
      }
    ),
    /* @__PURE__ */ e(a, { name: "acceptShopTerms", children: /* @__PURE__ */ e(n, { children: /* @__PURE__ */ e(w, { value: o.watch("acceptShopTerms"), onChange: h, children: "I accept the JTL Shop Terms of Use and confirm that I have read and understood them." }) }) })
  ] }) });
};
N.displayName = "OnlineShopStep";
export {
  N as default
};
//# sourceMappingURL=OnlineShopStep.js.map
