import { jsxs as s, Fragment as k, jsx as e } from "react/jsx-runtime";
import { q as ae, a3 as f, a4 as $, a5 as q, p, I as b, S as v, B as F, a6 as K, r as ce, s as se, a7 as m, W as re, L as J, a8 as de, w as ue } from "./index-T-3isYi5.js";
import { useState as g } from "react";
import { S as t, A as he } from "./AppCard-JgJMoBtw.js";
import { u as fe } from "./useIsAppEnabled-SudDKIHz.js";
var Q = /* @__PURE__ */ ((E) => (E.ON_BOOKING = "on_booking", E.ON_CANCEL = "on_cancel", E))(Q || {});
const le = ({
  bookingAction: E,
  optionLabel: L,
  optionEnabled: A,
  optionSwitchOnChange: U,
  writeToObjectData: u,
  updateWriteToObjectData: r
}) => {
  const { t: i } = ae(), x = [
    { label: i("text"), value: f.TEXT },
    { label: i("date"), value: f.DATE },
    { label: i("phone").charAt(0).toUpperCase() + i("phone").slice(1), value: f.PHONE },
    { label: i("checkbox"), value: f.CHECKBOX },
    { label: i("picklist"), value: f.PICKLIST },
    { label: i("custom"), value: f.CUSTOM }
  ], w = [
    { label: i("only_if_field_is_empty"), value: $.FIELD_EMPTY },
    ...E === "on_cancel" ? [{ label: i("salesforce_on_every_cancellation"), value: $.EVERY_BOOKING }] : [{ label: i("on_every_booking"), value: $.EVERY_BOOKING }]
  ], O = [
    { label: i("true"), value: !0 },
    { label: i("false"), value: !1 }
  ], S = [
    ...E === "on_cancel" ? [{ label: i("booking_cancel_date"), value: q.BOOKING_CANCEL_DATE }] : [],
    { label: i("booking_start_date"), value: q.BOOKING_START_DATE },
    { label: i("booking_created_date"), value: q.BOOKING_CREATED_DATE }
  ], [I, G] = g(x[0]), [y, X] = g(S[0]), [H, j] = g(
    O[0]
  ), [W, T] = g(w[0]), [z, R] = g({}), [D, C] = g(
    {}
  ), [d, _] = g({
    field: "",
    fieldType: I.value,
    value: "",
    whenToWrite: W.value
  }), M = (n) => {
    Object.keys(z).forEach((c) => {
      z[c] && c !== n && B(c);
    }), R((c) => ({ ...c, [n]: !0 })), C((c) => ({
      ...c,
      [n]: {
        field: n,
        fieldType: u[n].fieldType,
        value: u[n].value,
        whenToWrite: u[n].whenToWrite
      }
    }));
  }, B = (n) => {
    R((c) => ({ ...c, [n]: !1 })), C((c) => {
      const l = { ...c };
      return delete l[n], l;
    });
  }, P = (n) => {
    const c = D[n];
    if (!c)
      return;
    if (!c.field.trim()) {
      K("Field name cannot be empty", "error");
      return;
    }
    if (c.field !== n && Object.keys(u).includes(c.field.trim())) {
      K("Field already exists", "error");
      return;
    }
    const l = { ...u };
    c.field !== n && delete l[n], l[c.field.trim()] = {
      fieldType: c.fieldType,
      value: c.value,
      whenToWrite: c.whenToWrite
    }, r(l), B(n);
  };
  return /* @__PURE__ */ s(k, { children: [
    /* @__PURE__ */ e(t.SubSectionHeader, { icon: "star", labelFor: "write-to-object-settings", title: L, children: /* @__PURE__ */ e(
      p,
      {
        checked: A,
        onCheckedChange: U,
        id: "write-to-object-settings",
        size: "sm"
      }
    ) }),
    A ? /* @__PURE__ */ s(t.SubSectionContent, { children: [
      /* @__PURE__ */ s("div", { className: "text-subtle flex gap-3 px-3 py-[6px] text-sm font-medium", children: [
        /* @__PURE__ */ e("div", { className: "flex-1", children: i("field_name") }),
        /* @__PURE__ */ e("div", { className: "flex-1", children: i("field_type") }),
        /* @__PURE__ */ e("div", { className: "flex-1", children: i("value") }),
        /* @__PURE__ */ e("div", { className: "flex-1", children: i("when_to_write") }),
        /* @__PURE__ */ e("div", { className: "w-20" })
      ] }),
      /* @__PURE__ */ s(t.SubSectionNested, { children: [
        Object.keys(u).map((n) => {
          const c = z[n], l = D[n];
          return /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
            /* @__PURE__ */ e("div", { className: "flex-1", children: c ? /* @__PURE__ */ e(
              b,
              {
                value: (l == null ? void 0 : l.field) || n,
                onChange: (o) => C((h) => ({
                  ...h,
                  [n]: { ...l, field: o.target.value }
                })),
                size: "sm",
                className: "w-full"
              }
            ) : /* @__PURE__ */ e(b, { value: n, readOnly: !0, size: "sm", className: "w-full" }) }),
            /* @__PURE__ */ e("div", { className: "flex-1", children: c ? /* @__PURE__ */ e(
              v,
              {
                size: "sm",
                className: "w-full",
                options: x,
                value: x.find((o) => o.value === (l == null ? void 0 : l.fieldType)),
                onChange: (o) => {
                  o && C((h) => ({
                    ...h,
                    [n]: {
                      ...l,
                      fieldType: o.value,
                      ...o.value === f.DATE && {
                        value: S[0].value
                      },
                      ...o.value === f.CHECKBOX && {
                        value: O[0].value
                      }
                    }
                  }));
                }
              }
            ) : /* @__PURE__ */ e(
              v,
              {
                size: "sm",
                className: "w-full",
                value: x.find(
                  (o) => o.value === u[n].fieldType
                ),
                isDisabled: !0
              }
            ) }),
            /* @__PURE__ */ e("div", { className: "flex-1", children: c ? (l == null ? void 0 : l.fieldType) === f.DATE ? /* @__PURE__ */ e(
              v,
              {
                size: "sm",
                className: "w-full",
                options: S,
                value: S.find((o) => o.value === l.value),
                onChange: (o) => {
                  o && C((h) => ({
                    ...h,
                    [n]: { ...l, value: o.value }
                  }));
                }
              }
            ) : (l == null ? void 0 : l.fieldType) === f.CHECKBOX ? /* @__PURE__ */ e(
              v,
              {
                size: "sm",
                className: "w-full",
                options: O,
                value: O.find((o) => o.value === l.value),
                onChange: (o) => {
                  o && C((h) => ({
                    ...h,
                    [n]: { ...l, value: o.value }
                  }));
                }
              }
            ) : /* @__PURE__ */ e(
              b,
              {
                value: (l == null ? void 0 : l.value) || "",
                onChange: (o) => C((h) => ({
                  ...h,
                  [n]: { ...l, value: o.target.value }
                })),
                size: "sm",
                className: "w-full"
              }
            ) : u[n].fieldType === f.DATE ? /* @__PURE__ */ e(
              v,
              {
                size: "sm",
                className: "w-full",
                value: S.find(
                  (o) => o.value === u[n].value
                ),
                isDisabled: !0
              }
            ) : u[n].fieldType === f.CHECKBOX ? /* @__PURE__ */ e(
              v,
              {
                size: "sm",
                className: "w-full",
                value: O.find(
                  (o) => o.value === u[n].value
                ),
                isDisabled: !0
              }
            ) : /* @__PURE__ */ e(
              b,
              {
                value: u[n].value,
                readOnly: !0,
                size: "sm",
                className: "w-full"
              }
            ) }),
            /* @__PURE__ */ e("div", { className: "flex-1", children: c ? /* @__PURE__ */ e(
              v,
              {
                size: "sm",
                className: "w-full",
                options: w,
                value: w.find(
                  (o) => o.value === (l == null ? void 0 : l.whenToWrite)
                ),
                onChange: (o) => {
                  o && C((h) => ({
                    ...h,
                    [n]: { ...l, whenToWrite: o.value }
                  }));
                }
              }
            ) : /* @__PURE__ */ e(
              v,
              {
                size: "sm",
                className: "w-full",
                value: w.find(
                  (o) => o.value === u[n].whenToWrite
                ),
                isDisabled: !0
              }
            ) }),
            /* @__PURE__ */ e("div", { className: "flex w-20 justify-center gap-1", children: c ? /* @__PURE__ */ s(k, { children: [
              /* @__PURE__ */ e(
                F,
                {
                  size: "sm",
                  StartIcon: "check",
                  variant: "icon",
                  color: "primary",
                  onClick: () => P(n)
                }
              ),
              /* @__PURE__ */ e(
                F,
                {
                  size: "sm",
                  StartIcon: "x",
                  variant: "icon",
                  color: "secondary",
                  onClick: () => B(n)
                }
              )
            ] }) : /* @__PURE__ */ s(k, { children: [
              /* @__PURE__ */ e(
                F,
                {
                  size: "sm",
                  StartIcon: "pencil",
                  variant: "icon",
                  color: "minimal",
                  onClick: () => M(n)
                }
              ),
              /* @__PURE__ */ e(
                F,
                {
                  size: "sm",
                  StartIcon: "x",
                  variant: "icon",
                  color: "minimal",
                  onClick: () => {
                    const o = { ...u };
                    delete o[n], r(o);
                  }
                }
              )
            ] }) })
          ] }, n);
        }),
        /* @__PURE__ */ s("div", { className: "flex gap-2", children: [
          /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(
            b,
            {
              size: "sm",
              className: "w-full",
              value: d.field,
              onChange: (n) => _({
                ...d,
                field: n.target.value
              })
            }
          ) }),
          /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(
            v,
            {
              size: "sm",
              className: "w-full",
              options: x,
              value: I,
              onChange: (n) => {
                n && (G(n), _({
                  ...d,
                  fieldType: n.value,
                  ...n.value === f.DATE && { value: y.value },
                  ...n.value === f.CHECKBOX && {
                    value: H.value
                  }
                }));
              }
            }
          ) }),
          /* @__PURE__ */ e("div", { className: "flex-1", children: d.fieldType === f.DATE ? /* @__PURE__ */ e(
            v,
            {
              size: "sm",
              className: "w-full",
              options: S,
              value: y,
              onChange: (n) => {
                n && (X(n), _({
                  ...d,
                  value: n.value
                }));
              }
            }
          ) : d.fieldType === f.CHECKBOX ? /* @__PURE__ */ e(
            v,
            {
              size: "sm",
              className: "w-full",
              options: O,
              value: H,
              onChange: (n) => {
                n && (j(n), _({
                  ...d,
                  value: n.value
                }));
              }
            }
          ) : /* @__PURE__ */ e(
            b,
            {
              size: "sm",
              className: "w-full",
              value: d.value,
              onChange: (n) => _({
                ...d,
                value: n.target.value
              })
            }
          ) }),
          /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(
            v,
            {
              size: "sm",
              className: "w-full",
              options: w,
              value: W,
              onChange: (n) => {
                n && (T(n), _({
                  ...d,
                  whenToWrite: n.value
                }));
              }
            }
          ) }),
          /* @__PURE__ */ e("div", { className: "w-20" })
        ] })
      ] }),
      /* @__PURE__ */ e(
        F,
        {
          className: "text-subtle mt-2 w-fit",
          StartIcon: "plus",
          color: "minimal",
          size: "sm",
          disabled: !(d.field && d.fieldType && d.value !== "" && d.whenToWrite),
          onClick: () => {
            if (Object.keys(u).includes(d.field.trim())) {
              K("Field already exists", "error");
              return;
            }
            r({
              ...u,
              [d.field.trim()]: {
                fieldType: d.fieldType,
                value: d.value,
                whenToWrite: d.whenToWrite
              }
            }), _({
              field: "",
              fieldType: x[0].value,
              value: "",
              whenToWrite: w[0].value
            });
          },
          children: i("add_new_field")
        }
      )
    ] }) : null
  ] });
}, Se = function({ app: L, eventType: A, onAppInstallSuccess: U }) {
  var ne;
  const u = ce.usePathname(), { getAppData: r, setAppData: i, disabled: x } = se(), { enabled: w, updateEnabled: O } = fe(L), S = r("roundRobinLeadSkip"), I = r("roundRobinSkipCheckRecordOn") ?? m.CONTACT, G = r("ifFreeEmailDomainSkipOwnerCheck") ?? !1, y = r("skipContactCreation"), X = r("createLeadIfAccountNull"), H = r("createNewContactUnderAccount"), j = r("createEventOn") ?? m.CONTACT, W = r("onBookingWriteToEventObject") ?? !1, T = r("onBookingWriteToEventObjectMap") ?? {}, z = r("createEventOnLeadCheckForContact") ?? !1, R = r("onBookingChangeRecordOwner") ?? !1, D = r("onBookingChangeRecordOwnerName") ?? [], C = r("sendNoShowAttendeeData") ?? !1, d = r("sendNoShowAttendeeDataField") ?? "", _ = r("onBookingWriteToRecord") ?? !1, M = r("onBookingWriteToRecordFields") ?? {}, B = r("ignoreGuests") ?? !1, P = r("roundRobinSkipFallbackToLeadOwner") ?? !1, n = r("onCancelWriteToEventRecord") ?? !1, c = r("onCancelWriteToEventRecordFields") ?? {}, { t: l } = ae(), o = [
    { label: l("contact"), value: m.CONTACT },
    { label: l("salesforce_lead"), value: m.LEAD },
    { label: l("salesforce_contact_under_account"), value: m.ACCOUNT }
  ], [h, ie] = g(
    o.find((a) => a.value === j) ?? o[0]
  ), V = [
    { label: l("contact"), value: m.CONTACT },
    { label: l("salesforce_lead"), value: m.LEAD },
    { label: l("account"), value: m.ACCOUNT }
  ], [Z, oe] = g(
    V.find((a) => a.value === I) ?? V[0]
  ), [N, Y] = g({
    field: "",
    value: ""
  }), ee = () => /* @__PURE__ */ e(t.SubSection, { children: /* @__PURE__ */ e(
    t.SubSectionHeader,
    {
      icon: "at-sign",
      title: l("salesforce_create_new_contact_under_account"),
      labelFor: "create-new-contact-under-account",
      children: /* @__PURE__ */ e(
        p,
        {
          size: "sm",
          labelOnLeading: !0,
          checked: H,
          onCheckedChange: (a) => {
            i("createNewContactUnderAccount", a);
          }
        }
      )
    }
  ) });
  return /* @__PURE__ */ e(
    he,
    {
      onAppInstallSuccess: U,
      returnTo: `${re}${u}?tabName=apps`,
      app: L,
      teamId: ((ne = A.team) == null ? void 0 : ne.id) || void 0,
      switchOnClick: (a) => {
        O(a);
      },
      switchChecked: w,
      hideSettingsIcon: !0,
      children: /* @__PURE__ */ s(t.Content, { children: [
        /* @__PURE__ */ e(t.SubSection, { children: /* @__PURE__ */ e(
          t.SubSectionHeader,
          {
            icon: "zap",
            title: l("salesforce_add_attendees_as"),
            justify: "start",
            labelFor: "add-attendees-as",
            children: /* @__PURE__ */ e(
              v,
              {
                size: "sm",
                id: "add-attendees-as",
                className: "w-[200px]",
                options: o,
                value: h,
                onChange: (a) => {
                  a && (ie(a), i("createEventOn", a.value));
                }
              }
            )
          }
        ) }),
        /* @__PURE__ */ e(t.SubSection, { children: /* @__PURE__ */ e(
          t.SubSectionHeader,
          {
            icon: "user-plus",
            title: l("salesforce_ignore_guests"),
            labelFor: "ignore-guests",
            children: /* @__PURE__ */ e(
              p,
              {
                size: "sm",
                labelOnLeading: !0,
                checked: B,
                onCheckedChange: (a) => {
                  i("ignoreGuests", a);
                }
              }
            )
          }
        ) }),
        h.value === m.CONTACT ? /* @__PURE__ */ e(t.SubSection, { children: /* @__PURE__ */ e(
          t.SubSectionHeader,
          {
            icon: "user-plus",
            title: l("skip_contact_creation", { appName: "Salesforce" }),
            labelFor: "skip-contact-creation",
            children: /* @__PURE__ */ e(
              p,
              {
                size: "sm",
                labelOnLeading: !0,
                checked: y,
                onCheckedChange: (a) => {
                  i("skipContactCreation", a);
                }
              }
            )
          }
        ) }) : null,
        h.value === m.LEAD ? /* @__PURE__ */ s(k, { children: [
          /* @__PURE__ */ e(t.SubSection, { children: /* @__PURE__ */ e(
            t.SubSectionHeader,
            {
              icon: "user-plus",
              title: l("salesforce_create_event_on_contact"),
              labelFor: "create-event-on-contact",
              children: /* @__PURE__ */ e(
                p,
                {
                  size: "sm",
                  labelOnLeading: !0,
                  checked: z,
                  onCheckedChange: (a) => {
                    i("createEventOnLeadCheckForContact", a);
                  }
                }
              )
            }
          ) }),
          /* @__PURE__ */ e(ee, {})
        ] }) : null,
        h.value === m.ACCOUNT ? /* @__PURE__ */ s(k, { children: [
          /* @__PURE__ */ e(ee, {}),
          /* @__PURE__ */ e(t.SubSection, { children: /* @__PURE__ */ e(
            t.SubSectionHeader,
            {
              icon: "user-plus",
              title: l("salesforce_if_account_does_not_exist"),
              labelFor: "create-lead-if-account-null",
              children: /* @__PURE__ */ e(
                p,
                {
                  size: "sm",
                  labelOnLeading: !0,
                  checked: X,
                  onCheckedChange: (a) => {
                    i("createLeadIfAccountNull", a);
                  }
                }
              )
            }
          ) })
        ] }) : null,
        /* @__PURE__ */ s(t.SubSection, { children: [
          /* @__PURE__ */ e(t.SubSectionHeader, { icon: "badge-check", title: l("on_booking_write_to_event_object"), children: /* @__PURE__ */ e(
            p,
            {
              size: "sm",
              labelOnLeading: !0,
              checked: W,
              onCheckedChange: (a) => {
                i("onBookingWriteToEventObject", a);
              }
            }
          ) }),
          W ? /* @__PURE__ */ s(t.SubSectionContent, { children: [
            /* @__PURE__ */ s("div", { className: "text-subtle flex gap-3 px-3 py-[6px] text-sm font-medium", children: [
              /* @__PURE__ */ e("div", { className: "flex-1", children: l("field_name") }),
              /* @__PURE__ */ e("div", { className: "flex-1", children: l("value") }),
              /* @__PURE__ */ e("div", { className: "w-10" })
            ] }),
            /* @__PURE__ */ s(t.SubSectionNested, { children: [
              Object.keys(T).map((a) => /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
                /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(b, { value: a, readOnly: !0, size: "sm", className: "w-full" }) }),
                /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(
                  b,
                  {
                    value: T[a],
                    readOnly: !0,
                    size: "sm",
                    className: "w-full"
                  }
                ) }),
                /* @__PURE__ */ e("div", { className: "flex w-10 justify-center", children: /* @__PURE__ */ e(
                  F,
                  {
                    StartIcon: "x",
                    variant: "icon",
                    size: "sm",
                    color: "minimal",
                    onClick: () => {
                      const te = T;
                      delete T[a], i("onBookingWriteToEventObjectMap", te);
                    }
                  }
                ) })
              ] }, a)),
              /* @__PURE__ */ s("div", { className: "mt-2 flex gap-4", children: [
                /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(
                  b,
                  {
                    size: "sm",
                    className: "w-full",
                    value: N.field,
                    onChange: (a) => Y({
                      ...N,
                      field: a.target.value
                    })
                  }
                ) }),
                /* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(
                  b,
                  {
                    size: "sm",
                    className: "w-full",
                    value: N.value,
                    onChange: (a) => Y({
                      ...N,
                      value: a.target.value
                    })
                  }
                ) }),
                /* @__PURE__ */ e("div", { className: "w-10" })
              ] })
            ] }),
            /* @__PURE__ */ e(
              F,
              {
                className: "text-subtle mt-2 w-fit",
                size: "sm",
                color: "secondary",
                disabled: !(N.field && N.value),
                onClick: () => {
                  if (Object.keys(T).includes(
                    N.field.trim()
                  )) {
                    K("Field already exists", "error");
                    return;
                  }
                  i("onBookingWriteToEventObjectMap", {
                    ...T,
                    [N.field.trim()]: N.value.trim()
                  }), Y({ field: "", value: "" });
                },
                children: l("add_new_field")
              }
            )
          ] }) : null
        ] }),
        /* @__PURE__ */ e(t.SubSection, { children: /* @__PURE__ */ e(
          le,
          {
            bookingAction: Q.ON_BOOKING,
            optionLabel: l("salesforce_on_booking_write_to_record", { record: j }),
            optionEnabled: _,
            writeToObjectData: M,
            optionSwitchOnChange: (a) => {
              i("onBookingWriteToRecord", a);
            },
            updateWriteToObjectData: (a) => i("onBookingWriteToRecordFields", a)
          }
        ) }),
        /* @__PURE__ */ s(t.SubSection, { children: [
          /* @__PURE__ */ e(
            t.SubSectionHeader,
            {
              icon: "user-plus",
              title: l("salesforce_change_record_owner_on_booking"),
              labelFor: "change-record-owner-on-booking",
              children: /* @__PURE__ */ e(
                p,
                {
                  size: "sm",
                  labelOnLeading: !0,
                  checked: R,
                  onCheckedChange: (a) => {
                    i("onBookingChangeRecordOwner", a);
                  }
                }
              )
            }
          ),
          R ? /* @__PURE__ */ e(t.SubSectionContent, { classNames: { container: "p-3" }, children: /* @__PURE__ */ s("div", { children: [
            /* @__PURE__ */ e(
              J,
              {
                htmlFor: "on-booking-change-record-owner-name",
                className: "text-subtle text-sm font-medium",
                children: l("salesforce_owner_name_to_change")
              }
            ),
            /* @__PURE__ */ e(
              b,
              {
                id: "on-booking-change-record-owner-name",
                size: "sm",
                value: D,
                onChange: (a) => i("onBookingChangeRecordOwnerName", a.target.value)
              }
            )
          ] }) }) : null
        ] }),
        A.schedulingType === de.ROUND_ROBIN ? /* @__PURE__ */ s(k, { children: [
          /* @__PURE__ */ s(t.SubSection, { children: [
            /* @__PURE__ */ e(
              t.SubSectionHeader,
              {
                icon: "users",
                title: l("salesforce_book_directly_with_attendee_owner"),
                labelFor: "book-directly-with-attendee-owner",
                children: /* @__PURE__ */ e(
                  p,
                  {
                    size: "sm",
                    id: "book-directly-witha-attendee-owner",
                    checked: S,
                    onCheckedChange: (a) => {
                      i("roundRobinLeadSkip", a), a && i("enabled", a);
                    }
                  }
                )
              }
            ),
            S ? /* @__PURE__ */ e(t.SubSectionContent, { classNames: { container: "p-3" }, children: /* @__PURE__ */ s("div", { children: [
              /* @__PURE__ */ e(
                J,
                {
                  htmlFor: "round-robin-skip-check-record-on",
                  className: "text-subtle text-sm font-medium",
                  children: l("salesforce_check_owner_of")
                }
              ),
              /* @__PURE__ */ e(
                v,
                {
                  size: "sm",
                  className: "w-60",
                  options: V,
                  value: Z,
                  onChange: (a) => {
                    a && (oe(a), i("roundRobinSkipCheckRecordOn", a.value));
                  }
                }
              )
            ] }) }) : null
          ] }),
          /* @__PURE__ */ e(k, { children: S ? /* @__PURE__ */ s(k, { children: [
            Z.value === m.CONTACT ? /* @__PURE__ */ e(t.SubSection, { children: /* @__PURE__ */ e(
              t.SubSectionHeader,
              {
                icon: "users",
                title: l("salesforce_round_robin_skip_fallback_to_lead_owner"),
                labelFor: "round-robin-skip-fallback-to-lead-owner",
                children: /* @__PURE__ */ e(
                  p,
                  {
                    id: "round-robin-skip-fallback-to-lead-owner",
                    size: "sm",
                    checked: P,
                    onCheckedChange: (a) => {
                      i("roundRobinSkipFallbackToLeadOwner", a);
                    }
                  }
                )
              }
            ) }) : null,
            /* @__PURE__ */ s(t.SubSection, { children: [
              /* @__PURE__ */ e(
                t.SubSectionHeader,
                {
                  icon: "users",
                  title: l("salesforce_if_free_email_domain_skip_owner_check"),
                  labelFor: "if-free-email-domain-skip-owner-check",
                  children: /* @__PURE__ */ e(
                    p,
                    {
                      id: "if-free-email-domain-skip-owner-check",
                      size: "sm",
                      checked: G,
                      onCheckedChange: (a) => {
                        i("ifFreeEmailDomainSkipOwnerCheck", a);
                      }
                    }
                  )
                }
              ),
              /* @__PURE__ */ e(ue, { severity: "info", title: l("skip_rr_description") })
            ] })
          ] }) : null })
        ] }) : null,
        /* @__PURE__ */ e(t.SubSection, { children: /* @__PURE__ */ e(
          le,
          {
            bookingAction: Q.ON_CANCEL,
            optionLabel: l("salesforce_on_cancel_write_to_event"),
            optionEnabled: n,
            writeToObjectData: c,
            optionSwitchOnChange: (a) => {
              i("onCancelWriteToEventRecord", a);
            },
            updateWriteToObjectData: (a) => i("onCancelWriteToEventRecordFields", a)
          }
        ) }),
        /* @__PURE__ */ s(t.SubSection, { children: [
          /* @__PURE__ */ e(
            t.SubSectionHeader,
            {
              icon: "calendar",
              title: "Send no show attendee data to event object",
              labelFor: "send-no-show-attendee-data",
              children: /* @__PURE__ */ e(
                p,
                {
                  id: "send-no-show-attendee-data",
                  size: "sm",
                  checked: C,
                  onCheckedChange: (a) => {
                    i("sendNoShowAttendeeData", a);
                  }
                }
              )
            }
          ),
          C ? /* @__PURE__ */ s(t.SubSectionContent, { classNames: { container: "p-3" }, children: [
            /* @__PURE__ */ e(
              J,
              {
                htmlFor: "send-no-show-attendee-data-field-name",
                className: "text-subtle text-sm font-medium",
                children: "Field name to check (must be checkbox data type)"
              }
            ),
            /* @__PURE__ */ e(
              b,
              {
                id: "send-no-show-attendee-data-field-name",
                size: "sm",
                value: d,
                onChange: (a) => i("sendNoShowAttendeeDataField", a.target.value)
              }
            )
          ] }) : null
        ] })
      ] })
    }
  );
};
export {
  Se as default
};
