import { jsx as d, jsxs as f } from "react/jsx-runtime";
import { u as p } from "./useId.7P31viIO.js";
import { a as C } from "./index.CfQlFjZU.js";
import { useEffect as M } from "react";
import { S as l, M as h } from "./shared.EdGf6tcG.js";
import { a as S } from "./TextInput.63vMRxAK.js";
import { a as I } from "./message.CHKnnsjy.js";
import { a as b } from "./Button.CpTwUWVr.js";
import { u as _, M as D } from "./modal.BZAvb1Nx.js";
const v = "creator_contentContainerStretch_SuDo0", T = "creator_mainContentContainer_w1DKr", V = "creator_formContainer_nHDPl", A = "creator_sectionFormContainer_IIGzs", Y = "creator_individualVideoModalContainer_7eAA7", g = { contentContainerStretch: v, mainContentContainer: T, formContainer: V, sectionFormContainer: A, individualVideoModalContainer: Y };
function x({
  onSubmit: a,
  visible: o = !0,
  ...i
}) {
  const r = p(), { Modal: s, openModal: n, closeModal: e } = _();
  return M(() => {
    o ? n() : e();
  }, [o, n, e]), {
    onSubmit: (t) => {
      t.preventDefault(), a(t);
    },
    formId: r,
    containerClassName: g.individualVideoModalContainer,
    Modal: s,
    visible: o,
    ...i
  };
}
function y({
  onSubmit: a,
  onCancel: o,
  onLinkChange: i,
  link: r,
  disabled: s,
  helper: n,
  error: e,
  formId: t,
  containerClassName: c,
  Modal: m
}) {
  return /* @__PURE__ */ d(
    m,
    {
      type: D.ADVANCED,
      heading: "Add YouTube Shorts",
      buttons: [
        {
          label: "Done",
          semantic: l.PRIMARY,
          type: b.SUBMIT,
          form: t,
          disabled: s
        },
        {
          label: "Cancel",
          semantic: l.SECONDARY,
          onClick: () => o()
        }
      ],
      onDismiss: () => o(),
      children: /* @__PURE__ */ f("form", { id: t, className: c, onSubmit: a, children: [
        /* @__PURE__ */ d(
          I,
          {
            semantic: h.INFO,
            text: "If the video is not public, it will be hidden on page",
            showIcon: !0,
            dismissible: !1
          }
        ),
        /* @__PURE__ */ d(
          S,
          {
            label: "Link",
            isError: !!e,
            value: r,
            helper: e || n,
            onChange: (u) => i(u.target.value)
          }
        )
      ] })
    }
  );
}
const P = C(
  y,
  x
);
export {
  P as Y,
  y as a,
  x as u
};
