import{Telemetry as o}from"@redocly/redoc-opentelemetry";import c from"../../package.json"with{type:"json"};const p="https://otel.cloud.redocly.com/v1/traces";class n extends o{specType;constructor(e){super(),this.specType=e.specType,this.init({otel:{isProd:process.env.NODE_ENV==="production"||process.env.ENABLE_LOCAL_TELEMETRY==="true",serviceVersion:e.serviceVersion||`${c.name}@${c.version}`,version:"1.0.0",collectorTraceUrl:e.collectorUrl||p,serviceName:e.serviceName||"redoc-ce",tracerName:"client-telemetry"},disabled:e.disabled||!1})}send(e,r){r&&Array.isArray(r)&&r.length>0&&(r=r.map(s=>s&&typeof s=="object"?{...s,specType:this.specType}:s)),super.send(e,r,{env:process.env.NODE_ENV})}}export{n as RedocTelemetry};
