import { jsx as e, jsxs as b } from "react/jsx-runtime";
import { a as v } from "./index.CfQlFjZU.js";
import { P as C } from "./PageHeader.BwFpx_pz.js";
import { S as h } from "./shared.EdGf6tcG.js";
import "react";
import { O as R } from "./Onboarding.BDRBUM0D.js";
import { B as _, a as y } from "./Button.CpTwUWVr.js";
import { F as I } from "./form.BJJLcx4p.js";
import { a as u } from "./TextInput.63vMRxAK.js";
import { u as d } from "./useInputValidation.BmDVJuIZ.js";
import { p as S } from "./onboarding.ByhrQ6ig.js";
const F = "creator_contentContainerStretch_iDx95", g = "creator_mainContentContainer_Ab-gn", x = "creator_formContainer_ey01z", B = "creator_sectionFormContainer_bLwrU", D = { contentContainerStretch: F, mainContentContainer: g, formContainer: x, sectionFormContainer: B }, f = () => {
};
function N({
  loading: o,
  email: a = "",
  password: n = "",
  emailProcessor: i = f,
  passwordProcessor: m = f,
  shouldRemoveForm: p,
  token: r,
  onSubmit: l
}) {
  const s = !!o, t = d(i, {
    value: a,
    withIcon: !0
  }), c = d(m, {
    value: n,
    helper: S,
    withIcon: !0
  });
  function w(P) {
    P.preventDefault(), l?.({
      email: t.value,
      password: t.value,
      token: r
    });
  }
  return {
    disabled: !t.value || !!t.isError || !c.value || !!c.isError || !!o,
    disabledInputs: s,
    emailProps: t,
    token: r,
    isNativeForm: !p,
    loading: o,
    passwordProps: c,
    onSubmit: w,
    formContainerClassName: D.sectionFormContainer
  };
}
function E({
  disabled: o,
  disabledInputs: a,
  emailProps: n,
  isNativeForm: i,
  loading: m,
  token: p,
  onSubmit: r,
  passwordProps: l,
  formContainerClassName: s
}) {
  return /* @__PURE__ */ e(R, { children: /* @__PURE__ */ b(
    I,
    {
      isNative: i,
      formProps: { className: s, onSubmit: r },
      divProps: { className: s },
      children: [
        /* @__PURE__ */ e(C, { title: "Reset password", height: "auto" }),
        /* @__PURE__ */ e(
          u,
          {
            label: "Email",
            name: "email",
            type: "email",
            isDisabled: !0,
            ...n
          }
        ),
        /* @__PURE__ */ e(
          u,
          {
            label: "Password",
            name: "password",
            type: "password",
            isDisabled: a,
            ...l
          }
        ),
        /* @__PURE__ */ e("input", { type: "hidden", name: "token", value: p }),
        /* @__PURE__ */ e(
          _,
          {
            label: "Reset Password",
            size: "full",
            name: "intent",
            value: "reset-password",
            type: y.SUBMIT,
            semantic: h.PRIMARY,
            loading: m,
            disabled: o
          }
        )
      ]
    }
  ) });
}
const q = v(
  E,
  N
);
export {
  q as R,
  E as a,
  N as u
};
