import { jsxs as l, jsx as e, Fragment as v } from "react/jsx-runtime";
import { a as R } from "./index.CfQlFjZU.js";
import { n as u } from "./index.B0wX8xO7.js";
import { T as y } from "./TimeSelect.D6TvpsnX.js";
import { M as H } from "./shared.EdGf6tcG.js";
import { r as g } from "./index.dWlEA7uO.js";
import "react";
import { a as j } from "./Checkbox.BszXXvCK.js";
import { D as P } from "./Datepicker.B0OFWzLp.js";
import { a as U } from "./TextInput.63vMRxAK.js";
import { T as W } from "./TimezoneSelect.CqdVrk7V.js";
import { a as _ } from "./message.CHKnnsjy.js";
import { a as X } from "./TabBar.Dal6Y13v.js";
import { c as Z } from "./index.CfM2L_w0.js";
const q = "creator_smartScheduleFormViewContainer_WZzTX", G = "creator_tabBar_p6My3", J = "creator_checkboxHelper_EIc4c", K = "creator_checkboxHelper__error_Ikpoj", s = { smartScheduleFormViewContainer: q, tabBar: G, checkboxHelper: J, checkboxHelper__error: K };
var Q = /* @__PURE__ */ ((t) => (t[t.SMART_SCHEDULE = 0] = "SMART_SCHEDULE", t[t.ALL_AT_ONCE = 1] = "ALL_AT_ONCE", t))(Q || {});
const Y = ({
  onSubmit: t,
  onDateChange: d,
  onTimeChange: h,
  onCheckboxChange: p,
  errors: r,
  formId: x,
  ...n
}) => {
  const m = n.selectedTab === 1 ? void 0 : {
    novalidate: !0
  };
  return {
    onSubmit: (i) => {
      i.preventDefault(), t(i);
    },
    onDateChange: d,
    onTimeChange: h,
    onCheckboxChange: p,
    formId: x,
    containerClassName: s.smartScheduleFormViewContainer,
    tabBarClassName: s.tabBar,
    checkboxHelperClassName: Z(s.checkboxHelper, {
      [s.checkboxHelper__error]: !!r?.checkbox
    }),
    errors: r,
    ...m && { smartTabInputs: m },
    ...n
  };
}, $ = ({
  onSubmit: t,
  onDateChange: d,
  onTimeChange: h,
  onTimezoneSelect: p,
  onChangeSelectedTab: r,
  onTextChange: x,
  onCheckboxChange: n,
  formId: k,
  containerClassName: m,
  tabBarClassName: i,
  checkboxHelperClassName: N,
  labels: c,
  placeholders: b,
  helpers: o,
  errors: a,
  dateValue: w,
  timeValue: T,
  maxSendValue: z,
  timezoneValue: A,
  initialTimezone: M,
  timestamp: D,
  selectedTab: f = 0,
  tabOptions: V,
  displayDateTimeError: I = !1,
  dateTimeErrorText: L = "",
  messageSemantic: S = H.INFO,
  messageText: C = "",
  buttonProps: E,
  checked: O,
  disabled: B,
  smartTabInputs: F
}) => /* @__PURE__ */ l("form", { id: k, className: m, onSubmit: t, children: [
  /* @__PURE__ */ e(
    P,
    {
      disablePastDates: !0,
      dropdownIcon: /* @__PURE__ */ e(g, { size: 24 }),
      label: c?.date,
      selectedDate: w,
      dropdownPlaceholder: b?.date,
      helper: a?.date || o?.date,
      hasError: !!a?.date,
      onDateChange: d
    }
  ),
  /* @__PURE__ */ e(
    y,
    {
      label: c?.time || "",
      helper: a?.time || o?.time,
      value: T,
      hasHourError: !!a?.time,
      hasMinuteError: !!a?.time,
      onChange: h
    }
  ),
  /* @__PURE__ */ e(
    W,
    {
      value: A,
      initialTimezone: M,
      timestamp: D,
      onTimezoneSelect: p,
      disabled: B,
      placeholder: b?.timezone,
      label: c?.timezone,
      helper: a?.timezone || o?.timezone,
      hasError: !!a?.timezone
    }
  ),
  /* @__PURE__ */ e(
    u,
    {
      value: I,
      then: /* @__PURE__ */ e(_, { text: L, semantic: H.ERROR })
    }
  ),
  /* @__PURE__ */ e("div", { className: i, children: /* @__PURE__ */ e(
    X,
    {
      tabs: V,
      selectedTab: f,
      onChangeSelectedTab: r
    }
  ) }),
  /* @__PURE__ */ e(
    u,
    {
      value: f,
      then: {
        0: /* @__PURE__ */ l(v, { children: [
          /* @__PURE__ */ e(
            U,
            {
              label: c?.maxSend,
              placeholder: b?.maxSend,
              helper: a?.maxSend || o?.maxSend,
              type: "number",
              value: z,
              isError: !!a?.maxSend,
              onChange: x,
              ...F
            }
          ),
          /* @__PURE__ */ e(
            _,
            {
              text: C,
              semantic: S,
              buttonProps: E
            }
          )
        ] }),
        1: /* @__PURE__ */ l(v, { children: [
          /* @__PURE__ */ e(
            _,
            {
              text: C,
              semantic: S,
              buttonProps: E
            }
          ),
          /* @__PURE__ */ l("div", { children: [
            /* @__PURE__ */ e(
              j,
              {
                name: "checkbox",
                checked: O,
                onChecked: n,
                label: c?.checkbox
              }
            ),
            /* @__PURE__ */ e(
              u,
              {
                value: a?.checkbox || o?.checkbox,
                then: /* @__PURE__ */ e("span", { className: N, children: a?.checkbox || o?.checkbox })
              }
            )
          ] })
        ] })
      }
    }
  )
] }), xe = R(
  $,
  Y
);
export {
  Q as S,
  xe as a
};
