import{telemetry as l}from"./app/telemetry/index.js";l.init({otel:{isProd:process.env.NODE_ENV==="production",serviceVersion:`${b}@${process.env.REDOCLY_PORTAL_VERSION}`,version:"1.0.0",collectorTraceUrl:new URL(r(D.OTEL_TRACES),location.origin).toString(),serviceName:"realm-ui",tracerName:"client-telemetry",instrumentations:[new u,new R,new E]},disabled:!g});import e from"react";import{hydrateRoot as m}from"react-dom/client";import{RouterProvider as p,createBrowserRouter as f}from"react-router-dom";import{HelmetProvider as d}from"@dr.pogodin/react-helmet";import{DocumentLoadInstrumentation as u}from"@opentelemetry/instrumentation-document-load";import{XMLHttpRequestInstrumentation as E}from"@opentelemetry/instrumentation-xml-http-request";import{FetchInstrumentation as R}from"@opentelemetry/instrumentation-fetch";import{getLocaleFromPathname as L,withoutPathPrefix as O,withPathPrefix as r}from"@redocly/theme/core/utils";import{DEFAULT_LOCALE_PLACEHOLDER as _,ServerRoutes as D}from"../constants/common";import{TELEMETRY_ENABLED as g}from"../server/constants/common.js";import{initL10n as h}from"./app/l10n/initL10n";import{Loader as v,useRefresh as x,globalData as t}from"./runtime/loader";import{App as A,routes as P}from"./App";import{PACKAGE_NAME as b,PRODUCT_NAME as N}from"../config/product-gates";import"./polyfills";import{ServerStyleSheet as j,StyleSheetManager as J}from"styled-components";function T(){return x(),e.createElement(d,{context:{}},e.createElement(A,null))}function S(){t?.removeAttribution&&process.env.REDOCLY_PORTAL_VERSION?console.log(`
%c Version: ${process.env.REDOCLY_PORTAL_VERSION} %c
`,"background:#ffffff ; padding: 1px; border:1px solid #0044D4; border-radius: 3px; color: #0044D4","background:transparent"):process.env.REDOCLY_PORTAL_VERSION&&console.log(`
%c Redocly ${N} %c ${process.env.REDOCLY_PORTAL_VERSION} %c

%chttps://redocly.com
`,"background:#0044D4 ; padding: 1px; border-radius: 3px 0 0 3px;  color: #fff; border:1px solid #0044D4","background:#ffffff ; padding: 1px; border:1px solid #0044D4; border-radius: 0 3px 3px 0; color: #0044D4","background:transparent","font-size: 10px; font-style: italic;")}async function C(){process.env.NODE_ENV!=="production"&&import("./runtime/ws-client").then(s=>s.listenWs()),await v.load(window.location.pathname),S();const o=t?.l10n,n=o?.locales||[],i=o?.defaultLocale||_,a=L(O(location.pathname),i,n);await h(o,a);const c=f([{Component:T,path:r("/*"),children:P}]);m(document.getElementById("app_root"),e.createElement(p,{future:{v7_startTransition:!1},router:c}))}C();export{j as ServerStyleSheet,J as StyleSheetManager};
