<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>API Docs — Swagger UI</title>
    <link rel="stylesheet" href="https://unpkg.com/swagger-ui-dist@5/swagger-ui.css" />
    <style>
      body { margin: 0; background: #f7f7f7; }
      .topbar { display:none; }
    </style>
  </head>
  <body>
    <div id="swagger-ui"></div>

    <script src="https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js"></script>
    <script>
      (function () {
        const specs = <?php echo json_encode($specs ?? [], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); ?>;
        window.ui = SwaggerUIBundle({
          dom_id: '#swagger-ui',
          urls: specs,
          urlsPrimaryName: (specs[0] && specs[0].name) || undefined,
          deepLinking: true,
          docExpansion: 'list',
          filter: true,
          layout: 'BaseLayout',
          presets: [SwaggerUIBundle.presets.apis],
        });
      })();
    </script>
  </body>
  </html>

