// src/components/docs/integrations/IntegrationsWhatsappMetaPage.tsx
import Link from "@contractspec/lib.ui-link";
import { ChevronRight } from "lucide-react";
import { jsx, jsxs } from "react/jsx-runtime";
function IntegrationsWhatsappMetaPage() {
  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 Meta"
          }),
          /* @__PURE__ */ jsx("p", {
            className: "text-muted-foreground",
            children: "Meta WhatsApp is the primary WhatsApp channel for ContractSpec's messaging runtime, with signed webhook verification and reliable outbound delivery."
          })
        ]
      }),
      /* @__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
{
  "accessToken": "...",
  "appSecret": "...",
  "verifyToken": "..."
}

// required connection config
{
  "phoneNumberId": "120000000001",
  "apiVersion": "v22.0"
}`
            })
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Webhook endpoints"
          }),
          /* @__PURE__ */ jsxs("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsxs("li", {
                children: [
                  "Verification challenge:",
                  " ",
                  /* @__PURE__ */ jsx("code", {
                    className: "bg-background/50 rounded px-2 py-1",
                    children: "GET /webhooks/whatsapp/meta"
                  })
                ]
              }),
              /* @__PURE__ */ jsxs("li", {
                children: [
                  "Inbound messages:",
                  " ",
                  /* @__PURE__ */ jsx("code", {
                    className: "bg-background/50 rounded px-2 py-1",
                    children: "POST /webhooks/whatsapp/meta"
                  })
                ]
              }),
              /* @__PURE__ */ jsxs("li", {
                children: [
                  "Signatures are validated with",
                  " ",
                  /* @__PURE__ */ jsx("code", {
                    className: "bg-background/50 rounded px-2 py-1",
                    children: "x-hub-signature-256"
                  }),
                  "."
                ]
              })
            ]
          })
        ]
      }),
      /* @__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_META={"120000000001":"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: "Keep verify and app secrets separate from access tokens."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Map each phone number ID to a workspace for strict tenant routing."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Use Twilio WhatsApp only as fallback when you need active-passive routing."
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "flex items-center gap-4 pt-4",
        children: [
          /* @__PURE__ */ jsx(Link, {
            href: "/docs/integrations/github",
            className: "btn-ghost",
            children: "Previous: GitHub Messaging"
          }),
          /* @__PURE__ */ jsxs(Link, {
            href: "/docs/integrations/whatsapp-twilio",
            className: "btn-primary",
            children: [
              "Next: WhatsApp Twilio ",
              /* @__PURE__ */ jsx(ChevronRight, {
                size: 16
              })
            ]
          })
        ]
      })
    ]
  });
}
export {
  IntegrationsWhatsappMetaPage
};
