import { jsx as r, jsxs as c } from "react/jsx-runtime";
import { a as _ } from "./index.CfQlFjZU.js";
import { c as v, A as f } from "./Avatar.Chk9viGr.js";
function M(e, s, n) {
  return { messageBodyWithLinks: y(
    e,
    s,
    !0,
    n
  ) };
}
function y(e, s, n = !0, t) {
  return e.split(t).map((o) => o.match(t) ? n ? C(o, s) : s : o);
}
function C(e, s) {
  const t = e.startsWith("http://") || e.startsWith("https://") ? e : `https://${e}`, i = encodeURI(t);
  return /* @__PURE__ */ r(
    "a",
    {
      href: i,
      target: "_blank",
      rel: "noopener noreferrer",
      "aria-label": `Link to ${i}`,
      children: s
    }
  );
}
const w = "creator_SMSPreview_JYBUl", L = "creator_phone_AqCKV", b = "creator_header_WgxzZ", B = "creator_title_V26i8", I = "creator_body_10Vgu", W = "creator_messageList_uVCrs", A = "creator_message_5epnd", U = "creator_responseInput_I7Q5u", a = { SMSPreview: w, phone: L, header: b, title: B, body: I, messageList: W, message: A, responseInput: U };
function V(e) {
  return {
    containerClassName: a.SMSPreview,
    phoneClassName: a.phone,
    headerClassName: a.header,
    titleClassName: a.title,
    bodyClassName: a.body,
    messageListClassName: a.messageList,
    messageClassName: a.message,
    responseInputClassName: a.responseInput,
    ...e
  };
}
function k({
  containerClassName: e,
  phoneClassName: s,
  headerClassName: n,
  titleClassName: t,
  bodyClassName: i,
  messageListClassName: l,
  messageClassName: o,
  responseInputClassName: m,
  text: d,
  talentPhoneNumber: h,
  talentName: p,
  shortenedLinkFormat: u,
  unsubscribeMessage: g,
  smsUrlRegex: S
}) {
  const { messageBodyWithLinks: N } = M(
    d,
    u,
    S
  );
  return /* @__PURE__ */ r("div", { className: e, children: /* @__PURE__ */ c("div", { className: s, children: [
    /* @__PURE__ */ c("div", { className: n, children: [
      /* @__PURE__ */ r("div", { className: "sample", children: /* @__PURE__ */ r(v, { username: p, size: f.MD }) }),
      /* @__PURE__ */ r("div", { className: t, "data-testid": "preview-phone-number", children: h })
    ] }),
    /* @__PURE__ */ c("div", { className: i, children: [
      /* @__PURE__ */ r("div", { className: l, children: /* @__PURE__ */ c(
        "pre",
        {
          className: o,
          "data-testid": "sms-preview-message-body",
          children: [
            N,
            g
          ]
        }
      ) }),
      /* @__PURE__ */ r("div", { className: m, children: "Message" })
    ] })
  ] }) });
}
const $ = _(k, V);
export {
  k as S,
  $ as a,
  y as p,
  V as u
};
