import*as o from"react";import i from"styled-components";import{RedoclyOpenAPIDocs as m}from"@redocly/openapi-docs";import{LayoutVariant as c}from"@redocly/config";import{CLIENT_TELEMETRY_ENABLED as s}from"../../constants/common.js";import{ThreePanelLayout as p}from"@redocly/theme/layouts/ThreePanelLayout";import{CatalogClassicInfoBlock as f}from"@redocly/theme/components/CatalogClassic/CatalogClassicInfoBlock";import{withPathPrefix as h}from"@redocly/theme/core/utils";import{useUserClaims as d}from"../../app/hooks";import{ServerRoutes as u}from"../../../constants/api.js";import{PACKAGE_NAME as E}from"../../../config/product-gates";import{usePageSharedData as v}from"../../providers/page-data/hooks";import{usePatchedStore as g}from"./helpers.js";function y({pageProps:t}){const r=d(),e=v("openAPIDocsStore"),n=o.useMemo(()=>({layout:t.apiOptions?.layout,userClaims:r}),[t.apiOptions?.layout,r]),a=g(e,t);if(!e)return"Something went wrong";const l=t.apiOptions?.layout;return o.createElement(A,null,o.createElement(S,{layout:l},o.createElement(f,{metadata:t.metadata})),o.createElement(m,{store:{options:a.options,definition:a.definition,withState:n},telemetryConfig:{collectorUrl:new URL(h(u.OTEL_TRACES),location.origin).toString(),disabled:!s,serviceVersion:`${E}@${process.env.REDOCLY_PORTAL_VERSION}`}}))}const S=i(p)`
  && {
    padding-right: ${({layout:t})=>t===c.THREE_PANEL?"calc(var(--panel-gap-horizontal) * 2)":"var(--panel-gap-horizontal)"};
  }
`,A=i.div`
  div[id] {
    scroll-margin-top: calc(var(--navbar-height) + var(--banner-height) - var(--panel-gap-vertical));
  }
  a[id] {
    scroll-margin-top: calc(var(--navbar-height) + var(--banner-height) + var(--panel-gap-vertical));
  }

  --sidebar-width: 0px;
`;export{y as default};
