// src/components/docs/integrations/IntegrationsHealthRoutingPage.tsx
import Link from "@contractspec/lib.ui-link";
import { jsx, jsxs } from "react/jsx-runtime";
function IntegrationsHealthRoutingPage() {
  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: "Health Routing Strategy"
          }),
          /* @__PURE__ */ jsx("p", {
            className: "text-muted-foreground",
            children: "Health integrations resolve providers through deterministic transport strategy order with explicit capability gating and unofficial-route controls."
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Connection config fields"
          }),
          /* @__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: `{
  "defaultTransport": "official-api",
  "strategyOrder": [
    "official-api",
    "official-mcp",
    "aggregator-api",
    "aggregator-mcp",
    "unofficial"
  ],
  "allowUnofficial": false,
  "unofficialAllowList": ["health.peloton"],
  "apiBaseUrl": "https://api.provider.example",
  "mcpUrl": "https://mcp.provider.example",
  "oauthTokenUrl": "https://api.provider.example/oauth/token"
}`
            })
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Secret payload fields"
          }),
          /* @__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: `{
  "apiKey": "...",
  "accessToken": "...",
  "refreshToken": "...",
  "clientId": "...",
  "clientSecret": "...",
  "tokenExpiresAt": "2026-02-01T00:00:00.000Z",
  "mcpAccessToken": "...",
  "webhookSecret": "..."
}`
            })
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Routing behavior"
          }),
          /* @__PURE__ */ jsxs("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsx("li", {
                children: "Unsupported strategies are skipped per provider capability matrix."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Missing credentials fail closed and fall through only when a later strategy is valid."
              }),
              /* @__PURE__ */ jsxs("li", {
                children: [
                  "Unofficial routes are disabled unless",
                  /* @__PURE__ */ jsx("code", {
                    className: "bg-background/50 ml-1 rounded px-2 py-1",
                    children: "allowUnofficial"
                  }),
                  "is true."
                ]
              }),
              /* @__PURE__ */ jsxs("li", {
                children: [
                  "When",
                  /* @__PURE__ */ jsx("code", {
                    className: "bg-background/50 ml-1 rounded px-2 py-1",
                    children: "unofficialAllowList"
                  }),
                  "is set, only listed provider keys can route unofficially."
                ]
              }),
              /* @__PURE__ */ jsxs("li", {
                children: [
                  "OAuth refresh uses",
                  /* @__PURE__ */ jsx("code", {
                    className: "bg-background/50 ml-1 rounded px-2 py-1",
                    children: "oauthTokenUrl"
                  }),
                  "with refresh/client credentials when APIs return 401."
                ]
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "space-y-4",
        children: [
          /* @__PURE__ */ jsx("h2", {
            className: "text-2xl font-bold",
            children: "Provider guidance"
          }),
          /* @__PURE__ */ jsxs("ul", {
            className: "text-muted-foreground list-inside list-disc space-y-2",
            children: [
              /* @__PURE__ */ jsx("li", {
                children: "Use official APIs when available (Whoop, Oura, Strava, Fitbit)."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Use aggregator routing for providers without stable official APIs (Garmin, MyFitnessPal, Eight Sleep, Peloton)."
              }),
              /* @__PURE__ */ jsx("li", {
                children: "Keep unofficial automation opt-in and auditable for production."
              })
            ]
          })
        ]
      }),
      /* @__PURE__ */ jsxs("div", {
        className: "flex items-center gap-4 pt-4",
        children: [
          /* @__PURE__ */ jsx(Link, {
            href: "/docs/integrations/whatsapp-twilio",
            className: "btn-ghost",
            children: "Previous: WhatsApp Twilio"
          }),
          /* @__PURE__ */ jsx(Link, {
            href: "/docs/integrations",
            className: "btn-primary",
            children: "Back to Integrations"
          })
        ]
      })
    ]
  });
}
export {
  IntegrationsHealthRoutingPage
};
