// src/components/docs/integrations/IntegrationsWhatsappTwilioPage.tsx
import Link from "@contractspec/lib.ui-link";
import { ChevronRight } from "lucide-react";
import { jsx, jsxs } from "react/jsx-runtime";
function IntegrationsWhatsappTwilioPage() {
  return /* @__PURE__ */ jsxs("div", {
    className: "space-y-8",
    children: [
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h1", {
            className: "text-4xl font-bold",
            children: "WhatsApp Twilio"
          }),
          /* @__PURE__ */ jsx("p", {
            className: "text-muted-foreground",
            children: "Twilio WhatsApp support provides a durable fallback channel with signature verification and outbox-backed outbound dispatch."
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Required secrets and config"
          }),
          /* @__PURE__ */ jsx("div", {
            className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
            children: /* @__PURE__ */ jsx("pre", {
              children: `// secret payload
{
  "accountSid": "AC123",
  "authToken": "..."
}

// optional connection config
{
  "fromNumber": "whatsapp:+15550002"
}`
            })
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Webhook ingress"
          }),
          /* @__PURE__ */ jsxs("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsxs("li", {
                children: [
                  "Inbound Twilio form payloads are accepted on",
                  " ",
                  /* @__PURE__ */ jsx("code", {
                    className: "bg-background/50 rounded px-2 py-1",
                    children: "/webhooks/whatsapp/twilio"
                  }),
                  "."
                ]
              }),
              /* @__PURE__ */ jsxs("li", {
                children: [
                  "Signatures are validated with",
                  " ",
                  /* @__PURE__ */ jsx("code", {
                    className: "bg-background/50 rounded px-2 py-1",
                    children: "x-twilio-signature"
                  }),
                  " ",
                  "and the configured auth token."
                ]
              }),
              /* @__PURE__ */ jsxs("li", {
                children: [
                  "For deterministic verification, set the exact public webhook URL in",
                  " ",
                  /* @__PURE__ */ jsx("code", {
                    className: "bg-background/50 rounded px-2 py-1",
                    children: "WHATSAPP_TWILIO_WEBHOOK_URL"
                  }),
                  "."
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Workspace mapping"
          }),
          /* @__PURE__ */ jsx("div", {
            className: "bg-background/50 border-border text-muted-foreground overflow-x-auto rounded-lg border p-4 font-mono text-sm",
            children: /* @__PURE__ */ jsx("pre", {
              children: `CHANNEL_WORKSPACE_MAP_WHATSAPP_TWILIO={"AC123":"workspace-acme"}`
            })
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Best practices"
          }),
          /* @__PURE__ */ jsxs("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsx("li", {
                children: "Use Twilio as fallback when Meta WhatsApp is your primary route."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Keep account SID mapping explicit to avoid tenant misrouting."
              }),
              /* @__PURE__ */ jsxs("li", {
                children: [
                  "Protect internal dispatch endpoints with",
                  /* @__PURE__ */ jsx("code", {
                    className: "bg-background/50 ml-1 rounded px-2 py-1",
                    children: "CHANNEL_DISPATCH_TOKEN"
                  }),
                  "."
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "flex items-center gap-4 pt-4",
        children: [
          /* @__PURE__ */ jsx(Link, {
            href: "/docs/integrations/whatsapp-meta",
            className: "btn-ghost",
            children: "Previous: WhatsApp Meta"
          }),
          /* @__PURE__ */ jsxs(Link, {
            href: "/docs/integrations/health-routing",
            className: "btn-primary",
            children: [
              "Next: Health Routing ",
              /* @__PURE__ */ jsx(ChevronRight, {
                size: 16
              })
            ]
          })
        ]
      })
    ]
  });
}
export {
  IntegrationsWhatsappTwilioPage
};
