@blueking/open-telemetry 0.0.29 → 0.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bk-rum.global.js +1 -1
- package/dist/bk-rum.global.js.map +1 -1
- package/dist/index.js +349 -397
- package/dist/index.js.map +1 -1
- package/dist/plugins/blank-screen.d.ts +0 -2
- package/dist/plugins/device.d.ts +0 -1
- package/dist/plugins/web-vitals.d.ts +0 -7
- package/dist/schema/attributes.d.ts +3 -8
- package/dist/schema/span.d.ts +1 -3
- package/package.json +1 -1
- package/skills/bk-rum-otele/SKILL.md +2 -1
- package/skills/bk-rum-otele/references/actions.md +1 -1
- package/skills/bk-rum-otele/references/data-model.md +3 -1
- package/skills/bk-rum-otele/references/network.md +6 -2
- package/skills/bk-rum-otele/references/privacy.md +1 -1
- package/skills/bk-rum-otele/references/span-protocol.md +667 -0
- package/skills/bk-rum-otele/references/telemetry-reference.md +7 -6
- package/skills/bk-rum-otele/references/views-routing.md +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bk-rum.global.js","names":["VERSION","VERSION","VERSION","_global","API_NAME","diag","API_NAME","SamplingDecision","API_NAME","global","isFunction","VERSION","VERSION","performance","VERSION","this","this","this","this","this","api.createNoopMeter","context","api.INVALID_SPAN_CONTEXT","this"],"sources":["../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/version.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/internal/semver.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/types.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/diag.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/utils.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context/context.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeter.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/context.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/context-utils.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/SamplingResult.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/span_kind.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/status.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context-api.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag-api.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/propagation.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/propagation-api.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/trace.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace-api.js","../../../node_modules/.pnpm/@opentelemetry+context-zone-peer-dep@2.7.1_@opentelemetry+api@1.9.1_zone.js@0.16.2/node_modules/@opentelemetry/context-zone-peer-dep/build/esm/util.js","../../../node_modules/.pnpm/@opentelemetry+context-zone-peer-dep@2.7.1_@opentelemetry+api@1.9.1_zone.js@0.16.2/node_modules/@opentelemetry/context-zone-peer-dep/build/esm/ZoneContextManager.js","../../../node_modules/.pnpm/zone.js@0.16.2/node_modules/zone.js/fesm2015/zone.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/trace/suppress-tracing.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/baggage/constants.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/baggage/utils.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/baggage/propagation/W3CBaggagePropagator.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/common/attributes.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/common/logging-error-handler.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/common/global-error-handler.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/platform/browser/environment.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/version.js","../../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.40.0/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/semconv.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/platform/browser/sdk-info.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/platform/browser/index.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/common/time.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/ExportResult.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/propagation/composite.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/internal/validators.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/trace/TraceState.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/trace/W3CTraceContextPropagator.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/utils/lodash.merge.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/utils/merge.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/utils/promise.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/utils/callback.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/internal/exporter.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/index.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/OTLPExporterBase.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/types.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/shared-configuration.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/bounded-queue-export-promise-handler.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/logging-response-handler.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-export-delegate.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-network-export-delegate.js","../../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/esm/default-service-name.js","../../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/esm/utils.js","../../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/esm/ResourceImpl.js","../../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/esm/common/internal.js","../../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/esm/common/utils.js","../../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/esm/trace/internal.js","../../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/esm/trace/json/trace.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/retrying-transport.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/is-export-retryable.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/transport/fetch-transport.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-browser-http-export-delegate.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/util.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-http-configuration.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/convert-legacy-http-options.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/convert-legacy-browser-http-options.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/create-legacy-browser-delegate.js","../../../node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/esm/platform/browser/OTLPTraceExporter.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/enums.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/Span.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/Sampler.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/AlwaysOffSampler.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/AlwaysOnSampler.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/ParentBasedSampler.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/TraceIdRatioBasedSampler.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/config.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/utility.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/export/BatchSpanProcessorBase.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/platform/browser/export/BatchSpanProcessor.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/platform/browser/RandomIdGenerator.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/semconv.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/TracerMetrics.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/version.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/Tracer.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/MultiSpanProcessor.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/BasicTracerProvider.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/export/SimpleSpanProcessor.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-web@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-web/build/esm/StackContextManager.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-web@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-web/build/esm/WebTracerProvider.js","../src/core/id.ts","../src/core/url.ts","../src/schema/attributes.ts","../src/schema/span.ts","../src/plugins/action.ts","../src/plugins/activity.ts","../src/core/page-activity.ts","../src/plugins/blank-screen.ts","../src/core/processor.ts","../src/core/request-timing.ts","../src/core/trace-context.ts","../src/plugins/resource.ts","../src/plugins/common.ts","../src/plugins/csp-violation.ts","../src/core/hash.ts","../src/plugins/device.ts","../src/plugins/error.ts","../src/plugins/long-task.ts","../src/core/route-observer.ts","../src/plugins/page-view.ts","../src/plugins/session-state.ts","../src/plugins/session.ts","../../../node_modules/.pnpm/web-vitals@5.2.0/node_modules/web-vitals/dist/web-vitals.attribution.js","../src/plugins/web-vitals.ts","../src/plugins/websocket.ts","../src/core/action-activity.ts","../package.json","../src/core/config.ts","../src/core/plugin.ts","../src/core/runtime-context.ts","../src/core/sampling.ts","../src/core/sdk.ts","../src/browser.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '1.9.1';\n//# sourceMappingURL=version.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { VERSION } from '../version';\nconst re = /^(\\d+)\\.(\\d+)\\.(\\d+)(-(.+))?$/;\n/**\n * Create a function to test an API version to see if it is compatible with the provided ownVersion.\n *\n * The returned function has the following semantics:\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param ownVersion version which should be checked against\n */\nexport function _makeCompatibilityCheck(ownVersion) {\n const acceptedVersions = new Set([ownVersion]);\n const rejectedVersions = new Set();\n const myVersionMatch = ownVersion.match(re);\n if (!myVersionMatch) {\n // we cannot guarantee compatibility so we always return noop\n return () => false;\n }\n const ownVersionParsed = {\n major: +myVersionMatch[1],\n minor: +myVersionMatch[2],\n patch: +myVersionMatch[3],\n prerelease: myVersionMatch[4],\n };\n // if ownVersion has a prerelease tag, versions must match exactly\n if (ownVersionParsed.prerelease != null) {\n return function isExactmatch(globalVersion) {\n return globalVersion === ownVersion;\n };\n }\n function _reject(v) {\n rejectedVersions.add(v);\n return false;\n }\n function _accept(v) {\n acceptedVersions.add(v);\n return true;\n }\n return function isCompatible(globalVersion) {\n if (acceptedVersions.has(globalVersion)) {\n return true;\n }\n if (rejectedVersions.has(globalVersion)) {\n return false;\n }\n const globalVersionMatch = globalVersion.match(re);\n if (!globalVersionMatch) {\n // cannot parse other version\n // we cannot guarantee compatibility so we always noop\n return _reject(globalVersion);\n }\n const globalVersionParsed = {\n major: +globalVersionMatch[1],\n minor: +globalVersionMatch[2],\n patch: +globalVersionMatch[3],\n prerelease: globalVersionMatch[4],\n };\n // if globalVersion has a prerelease tag, versions must match exactly\n if (globalVersionParsed.prerelease != null) {\n return _reject(globalVersion);\n }\n // major versions must match\n if (ownVersionParsed.major !== globalVersionParsed.major) {\n return _reject(globalVersion);\n }\n if (ownVersionParsed.major === 0) {\n if (ownVersionParsed.minor === globalVersionParsed.minor &&\n ownVersionParsed.patch <= globalVersionParsed.patch) {\n return _accept(globalVersion);\n }\n return _reject(globalVersion);\n }\n if (ownVersionParsed.minor <= globalVersionParsed.minor) {\n return _accept(globalVersion);\n }\n return _reject(globalVersion);\n };\n}\n/**\n * Test an API version to see if it is compatible with this API.\n *\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param version version of the API requesting an instance of the global API\n */\nexport const isCompatible = _makeCompatibilityCheck(VERSION);\n//# sourceMappingURL=semver.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { VERSION } from '../version';\nimport { isCompatible } from './semver';\nconst major = VERSION.split('.')[0];\nconst GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(`opentelemetry.js.api.${major}`);\nconst _global = (typeof globalThis === 'object'\n ? globalThis\n : typeof self === 'object'\n ? self\n : typeof window === 'object'\n ? window\n : typeof global === 'object'\n ? global\n : {});\nexport function registerGlobal(type, instance, diag, allowOverride = false) {\n var _a;\n const api = (_global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : {\n version: VERSION,\n });\n if (!allowOverride && api[type]) {\n // already registered an API of this type\n const err = new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${type}`);\n diag.error(err.stack || err.message);\n return false;\n }\n if (api.version !== VERSION) {\n // All registered APIs must be of the same version exactly\n const err = new Error(`@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${VERSION}`);\n diag.error(err.stack || err.message);\n return false;\n }\n api[type] = instance;\n diag.debug(`@opentelemetry/api: Registered a global for ${type} v${VERSION}.`);\n return true;\n}\nexport function getGlobal(type) {\n var _a, _b;\n const globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version;\n if (!globalVersion || !isCompatible(globalVersion)) {\n return;\n }\n return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type];\n}\nexport function unregisterGlobal(type, diag) {\n diag.debug(`@opentelemetry/api: Unregistering a global for ${type} v${VERSION}.`);\n const api = _global[GLOBAL_OPENTELEMETRY_API_KEY];\n if (api) {\n delete api[type];\n }\n}\n//# sourceMappingURL=global-utils.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { getGlobal } from '../internal/global-utils';\n/**\n * Component Logger which is meant to be used as part of any component which\n * will add automatically additional namespace in front of the log message.\n * It will then forward all message to global diag logger\n * @example\n * const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' });\n * cLogger.debug('test');\n * // @opentelemetry/instrumentation-http test\n */\nexport class DiagComponentLogger {\n constructor(props) {\n this._namespace = props.namespace || 'DiagComponentLogger';\n }\n debug(...args) {\n return logProxy('debug', this._namespace, args);\n }\n error(...args) {\n return logProxy('error', this._namespace, args);\n }\n info(...args) {\n return logProxy('info', this._namespace, args);\n }\n warn(...args) {\n return logProxy('warn', this._namespace, args);\n }\n verbose(...args) {\n return logProxy('verbose', this._namespace, args);\n }\n}\nfunction logProxy(funcName, namespace, args) {\n const logger = getGlobal('diag');\n // shortcut if logger not set\n if (!logger) {\n return;\n }\n return logger[funcName](namespace, ...args);\n}\n//# sourceMappingURL=ComponentLogger.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * Defines the available internal logging levels for the diagnostic logger, the numeric values\n * of the levels are defined to match the original values from the initial LogLevel to avoid\n * compatibility/migration issues for any implementation that assume the numeric ordering.\n */\nexport var DiagLogLevel;\n(function (DiagLogLevel) {\n /** Diagnostic Logging level setting to disable all logging (except and forced logs) */\n DiagLogLevel[DiagLogLevel[\"NONE\"] = 0] = \"NONE\";\n /** Identifies an error scenario */\n DiagLogLevel[DiagLogLevel[\"ERROR\"] = 30] = \"ERROR\";\n /** Identifies a warning scenario */\n DiagLogLevel[DiagLogLevel[\"WARN\"] = 50] = \"WARN\";\n /** General informational log message */\n DiagLogLevel[DiagLogLevel[\"INFO\"] = 60] = \"INFO\";\n /** General debug log message */\n DiagLogLevel[DiagLogLevel[\"DEBUG\"] = 70] = \"DEBUG\";\n /**\n * Detailed trace level logging should only be used for development, should only be set\n * in a development environment.\n */\n DiagLogLevel[DiagLogLevel[\"VERBOSE\"] = 80] = \"VERBOSE\";\n /** Used to set the logging level to include all logging */\n DiagLogLevel[DiagLogLevel[\"ALL\"] = 9999] = \"ALL\";\n})(DiagLogLevel || (DiagLogLevel = {}));\n//# sourceMappingURL=types.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { DiagLogLevel } from '../types';\nexport function createLogLevelDiagLogger(maxLevel, logger) {\n if (maxLevel < DiagLogLevel.NONE) {\n maxLevel = DiagLogLevel.NONE;\n }\n else if (maxLevel > DiagLogLevel.ALL) {\n maxLevel = DiagLogLevel.ALL;\n }\n // In case the logger is null or undefined\n logger = logger || {};\n function _filterFunc(funcName, theLevel) {\n const theFunc = logger[funcName];\n if (typeof theFunc === 'function' && maxLevel >= theLevel) {\n return theFunc.bind(logger);\n }\n return function () { };\n }\n return {\n error: _filterFunc('error', DiagLogLevel.ERROR),\n warn: _filterFunc('warn', DiagLogLevel.WARN),\n info: _filterFunc('info', DiagLogLevel.INFO),\n debug: _filterFunc('debug', DiagLogLevel.DEBUG),\n verbose: _filterFunc('verbose', DiagLogLevel.VERBOSE),\n };\n}\n//# sourceMappingURL=logLevelLogger.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { DiagComponentLogger } from '../diag/ComponentLogger';\nimport { createLogLevelDiagLogger } from '../diag/internal/logLevelLogger';\nimport { DiagLogLevel } from '../diag/types';\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nconst API_NAME = 'diag';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry internal\n * diagnostic API\n *\n * @since 1.0.0\n */\nexport class DiagAPI {\n /** Get the singleton instance of the DiagAPI API */\n static instance() {\n if (!this._instance) {\n this._instance = new DiagAPI();\n }\n return this._instance;\n }\n /**\n * Private internal constructor\n * @private\n */\n constructor() {\n function _logProxy(funcName) {\n return function (...args) {\n const logger = getGlobal('diag');\n // shortcut if logger not set\n if (!logger)\n return;\n return logger[funcName](...args);\n };\n }\n // Using self local variable for minification purposes as 'this' cannot be minified\n const self = this;\n // DiagAPI specific functions\n const setLogger = (logger, optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }) => {\n var _a, _b, _c;\n if (logger === self) {\n // There isn't much we can do here.\n // Logging to the console might break the user application.\n // Try to log to self. If a logger was previously registered it will receive the log.\n const err = new Error('Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation');\n self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);\n return false;\n }\n if (typeof optionsOrLogLevel === 'number') {\n optionsOrLogLevel = {\n logLevel: optionsOrLogLevel,\n };\n }\n const oldLogger = getGlobal('diag');\n const newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger);\n // There already is an logger registered. We'll let it know before overwriting it.\n if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {\n const stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : '<failed to generate stacktrace>';\n oldLogger.warn(`Current logger will be overwritten from ${stack}`);\n newLogger.warn(`Current logger will overwrite one already registered from ${stack}`);\n }\n return registerGlobal('diag', newLogger, self, true);\n };\n self.setLogger = setLogger;\n self.disable = () => {\n unregisterGlobal(API_NAME, self);\n };\n self.createComponentLogger = (options) => {\n return new DiagComponentLogger(options);\n };\n self.verbose = _logProxy('verbose');\n self.debug = _logProxy('debug');\n self.info = _logProxy('info');\n self.warn = _logProxy('warn');\n self.error = _logProxy('error');\n }\n}\n//# sourceMappingURL=diag.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport class BaggageImpl {\n constructor(entries) {\n this._entries = entries ? new Map(entries) : new Map();\n }\n getEntry(key) {\n const entry = this._entries.get(key);\n if (!entry) {\n return undefined;\n }\n return Object.assign({}, entry);\n }\n getAllEntries() {\n return Array.from(this._entries.entries());\n }\n setEntry(key, entry) {\n const newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.set(key, entry);\n return newBaggage;\n }\n removeEntry(key) {\n const newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.delete(key);\n return newBaggage;\n }\n removeEntries(...keys) {\n const newBaggage = new BaggageImpl(this._entries);\n for (const key of keys) {\n newBaggage._entries.delete(key);\n }\n return newBaggage;\n }\n clear() {\n return new BaggageImpl();\n }\n}\n//# sourceMappingURL=baggage-impl.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * Symbol used to make BaggageEntryMetadata an opaque type\n */\nexport const baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata');\n//# sourceMappingURL=symbol.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { DiagAPI } from '../api/diag';\nimport { BaggageImpl } from './internal/baggage-impl';\nimport { baggageEntryMetadataSymbol } from './internal/symbol';\nconst diag = DiagAPI.instance();\n/**\n * Create a new Baggage with optional entries\n *\n * @param entries An array of baggage entries the new baggage should contain\n */\nexport function createBaggage(entries = {}) {\n return new BaggageImpl(new Map(Object.entries(entries)));\n}\n/**\n * Create a serializable BaggageEntryMetadata object from a string.\n *\n * @param str string metadata. Format is currently not defined by the spec and has no special meaning.\n *\n * @since 1.0.0\n */\nexport function baggageEntryMetadataFromString(str) {\n if (typeof str !== 'string') {\n diag.error(`Cannot create baggage metadata from unknown type: ${typeof str}`);\n str = '';\n }\n return {\n __TYPE__: baggageEntryMetadataSymbol,\n toString() {\n return str;\n },\n };\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * Get a key to uniquely identify a context value\n *\n * @since 1.0.0\n */\nexport function createContextKey(description) {\n // The specification states that for the same input, multiple calls should\n // return different keys. Due to the nature of the JS dependency management\n // system, this creates problems where multiple versions of some package\n // could hold different keys for the same property.\n //\n // Therefore, we use Symbol.for which returns the same key for the same input.\n return Symbol.for(description);\n}\nclass BaseContext {\n /**\n * Construct a new context which inherits values from an optional parent context.\n *\n * @param parentContext a context from which to inherit values\n */\n constructor(parentContext) {\n // for minification\n const self = this;\n self._currentContext = parentContext ? new Map(parentContext) : new Map();\n self.getValue = (key) => self._currentContext.get(key);\n self.setValue = (key, value) => {\n const context = new BaseContext(self._currentContext);\n context._currentContext.set(key, value);\n return context;\n };\n self.deleteValue = (key) => {\n const context = new BaseContext(self._currentContext);\n context._currentContext.delete(key);\n return context;\n };\n }\n}\n/**\n * The root context is used as the default parent context when there is no active context\n *\n * @since 1.0.0\n */\nexport const ROOT_CONTEXT = new BaseContext();\n//# sourceMappingURL=context.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * NoopMeter is a noop implementation of the {@link Meter} interface. It reuses\n * constant NoopMetrics for all of its methods.\n */\nexport class NoopMeter {\n constructor() { }\n /**\n * @see {@link Meter.createGauge}\n */\n createGauge(_name, _options) {\n return NOOP_GAUGE_METRIC;\n }\n /**\n * @see {@link Meter.createHistogram}\n */\n createHistogram(_name, _options) {\n return NOOP_HISTOGRAM_METRIC;\n }\n /**\n * @see {@link Meter.createCounter}\n */\n createCounter(_name, _options) {\n return NOOP_COUNTER_METRIC;\n }\n /**\n * @see {@link Meter.createUpDownCounter}\n */\n createUpDownCounter(_name, _options) {\n return NOOP_UP_DOWN_COUNTER_METRIC;\n }\n /**\n * @see {@link Meter.createObservableGauge}\n */\n createObservableGauge(_name, _options) {\n return NOOP_OBSERVABLE_GAUGE_METRIC;\n }\n /**\n * @see {@link Meter.createObservableCounter}\n */\n createObservableCounter(_name, _options) {\n return NOOP_OBSERVABLE_COUNTER_METRIC;\n }\n /**\n * @see {@link Meter.createObservableUpDownCounter}\n */\n createObservableUpDownCounter(_name, _options) {\n return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;\n }\n /**\n * @see {@link Meter.addBatchObservableCallback}\n */\n addBatchObservableCallback(_callback, _observables) { }\n /**\n * @see {@link Meter.removeBatchObservableCallback}\n */\n removeBatchObservableCallback(_callback) { }\n}\nexport class NoopMetric {\n}\nexport class NoopCounterMetric extends NoopMetric {\n add(_value, _attributes) { }\n}\nexport class NoopUpDownCounterMetric extends NoopMetric {\n add(_value, _attributes) { }\n}\nexport class NoopGaugeMetric extends NoopMetric {\n record(_value, _attributes) { }\n}\nexport class NoopHistogramMetric extends NoopMetric {\n record(_value, _attributes) { }\n}\nexport class NoopObservableMetric {\n addCallback(_callback) { }\n removeCallback(_callback) { }\n}\nexport class NoopObservableCounterMetric extends NoopObservableMetric {\n}\nexport class NoopObservableGaugeMetric extends NoopObservableMetric {\n}\nexport class NoopObservableUpDownCounterMetric extends NoopObservableMetric {\n}\nexport const NOOP_METER = new NoopMeter();\n// Synchronous instruments\nexport const NOOP_COUNTER_METRIC = new NoopCounterMetric();\nexport const NOOP_GAUGE_METRIC = new NoopGaugeMetric();\nexport const NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric();\nexport const NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric();\n// Asynchronous instruments\nexport const NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric();\nexport const NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric();\nexport const NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric();\n/**\n * Create a no-op Meter\n *\n * @since 1.3.0\n */\nexport function createNoopMeter() {\n return NOOP_METER;\n}\n//# sourceMappingURL=NoopMeter.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @since 1.0.0\n */\nexport const defaultTextMapGetter = {\n get(carrier, key) {\n if (carrier == null) {\n return undefined;\n }\n return carrier[key];\n },\n keys(carrier) {\n if (carrier == null) {\n return [];\n }\n return Object.keys(carrier);\n },\n};\n/**\n * @since 1.0.0\n */\nexport const defaultTextMapSetter = {\n set(carrier, key, value) {\n if (carrier == null) {\n return;\n }\n carrier[key] = value;\n },\n};\n//# sourceMappingURL=TextMapPropagator.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ROOT_CONTEXT } from './context';\nexport class NoopContextManager {\n active() {\n return ROOT_CONTEXT;\n }\n with(_context, fn, thisArg, ...args) {\n return fn.call(thisArg, ...args);\n }\n bind(_context, target) {\n return target;\n }\n enable() {\n return this;\n }\n disable() {\n return this;\n }\n}\n//# sourceMappingURL=NoopContextManager.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { NoopContextManager } from '../context/NoopContextManager';\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nimport { DiagAPI } from './diag';\nconst API_NAME = 'context';\nconst NOOP_CONTEXT_MANAGER = new NoopContextManager();\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Context API\n *\n * @since 1.0.0\n */\nexport class ContextAPI {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n constructor() { }\n /** Get the singleton instance of the Context API */\n static getInstance() {\n if (!this._instance) {\n this._instance = new ContextAPI();\n }\n return this._instance;\n }\n /**\n * Set the current context manager.\n *\n * @returns true if the context manager was successfully registered, else false\n */\n setGlobalContextManager(contextManager) {\n return registerGlobal(API_NAME, contextManager, DiagAPI.instance());\n }\n /**\n * Get the currently active context\n */\n active() {\n return this._getContextManager().active();\n }\n /**\n * Execute a function with an active context\n *\n * @param context context to be active during function execution\n * @param fn function to execute in a context\n * @param thisArg optional receiver to be used for calling fn\n * @param args optional arguments forwarded to fn\n */\n with(context, fn, thisArg, ...args) {\n return this._getContextManager().with(context, fn, thisArg, ...args);\n }\n /**\n * Bind a context to a target function or event emitter\n *\n * @param context context to bind to the event emitter or function. Defaults to the currently active context\n * @param target function or event emitter to bind\n */\n bind(context, target) {\n return this._getContextManager().bind(context, target);\n }\n _getContextManager() {\n return getGlobal(API_NAME) || NOOP_CONTEXT_MANAGER;\n }\n /** Disable and remove the global context manager */\n disable() {\n this._getContextManager().disable();\n unregisterGlobal(API_NAME, DiagAPI.instance());\n }\n}\n//# sourceMappingURL=context.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @since 1.0.0\n */\nexport var TraceFlags;\n(function (TraceFlags) {\n /** Represents no flag set. */\n TraceFlags[TraceFlags[\"NONE\"] = 0] = \"NONE\";\n /** Bit to represent whether trace is sampled in trace flags. */\n TraceFlags[TraceFlags[\"SAMPLED\"] = 1] = \"SAMPLED\";\n})(TraceFlags || (TraceFlags = {}));\n//# sourceMappingURL=trace_flags.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { TraceFlags } from './trace_flags';\n/**\n * @since 1.0.0\n */\nexport const INVALID_SPANID = '0000000000000000';\n/**\n * @since 1.0.0\n */\nexport const INVALID_TRACEID = '00000000000000000000000000000000';\n/**\n * @since 1.0.0\n */\nexport const INVALID_SPAN_CONTEXT = {\n traceId: INVALID_TRACEID,\n spanId: INVALID_SPANID,\n traceFlags: TraceFlags.NONE,\n};\n//# sourceMappingURL=invalid-span-constants.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { INVALID_SPAN_CONTEXT } from './invalid-span-constants';\n/**\n * The NonRecordingSpan is the default {@link Span} that is used when no Span\n * implementation is available. All operations are no-op including context\n * propagation.\n */\nexport class NonRecordingSpan {\n constructor(spanContext = INVALID_SPAN_CONTEXT) {\n this._spanContext = spanContext;\n }\n // Returns a SpanContext.\n spanContext() {\n return this._spanContext;\n }\n // By default does nothing\n setAttribute(_key, _value) {\n return this;\n }\n // By default does nothing\n setAttributes(_attributes) {\n return this;\n }\n // By default does nothing\n addEvent(_name, _attributes) {\n return this;\n }\n addLink(_link) {\n return this;\n }\n addLinks(_links) {\n return this;\n }\n // By default does nothing\n setStatus(_status) {\n return this;\n }\n // By default does nothing\n updateName(_name) {\n return this;\n }\n // By default does nothing\n end(_endTime) { }\n // isRecording always returns false for NonRecordingSpan.\n isRecording() {\n return false;\n }\n // By default does nothing\n recordException(_exception, _time) { }\n}\n//# sourceMappingURL=NonRecordingSpan.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createContextKey } from '../context/context';\nimport { NonRecordingSpan } from './NonRecordingSpan';\nimport { ContextAPI } from '../api/context';\n/**\n * span key\n */\nconst SPAN_KEY = createContextKey('OpenTelemetry Context Key SPAN');\n/**\n * Return the span if one exists\n *\n * @param context context to get span from\n */\nexport function getSpan(context) {\n return context.getValue(SPAN_KEY) || undefined;\n}\n/**\n * Gets the span from the current context, if one exists.\n */\nexport function getActiveSpan() {\n return getSpan(ContextAPI.getInstance().active());\n}\n/**\n * Set the span on a context\n *\n * @param context context to use as parent\n * @param span span to set active\n */\nexport function setSpan(context, span) {\n return context.setValue(SPAN_KEY, span);\n}\n/**\n * Remove current span stored in the context\n *\n * @param context context to delete span from\n */\nexport function deleteSpan(context) {\n return context.deleteValue(SPAN_KEY);\n}\n/**\n * Wrap span context in a NoopSpan and set as span in a new\n * context\n *\n * @param context context to set active span on\n * @param spanContext span context to be wrapped\n */\nexport function setSpanContext(context, spanContext) {\n return setSpan(context, new NonRecordingSpan(spanContext));\n}\n/**\n * Get the span context of the span if it exists.\n *\n * @param context context to get values from\n */\nexport function getSpanContext(context) {\n var _a;\n return (_a = getSpan(context)) === null || _a === void 0 ? void 0 : _a.spanContext();\n}\n//# sourceMappingURL=context-utils.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { INVALID_SPANID, INVALID_TRACEID } from './invalid-span-constants';\nimport { NonRecordingSpan } from './NonRecordingSpan';\n// Valid characters (0-9, a-f, A-F) are marked as 1.\nconst isHex = new Uint8Array([\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,\n]);\nfunction isValidHex(id, length) {\n // As of 1.9.0 the id was allowed to be a non-string value,\n // even though it was not possible in the types.\n if (typeof id !== 'string' || id.length !== length)\n return false;\n let r = 0;\n for (let i = 0; i < id.length; i += 4) {\n r +=\n (isHex[id.charCodeAt(i)] | 0) +\n (isHex[id.charCodeAt(i + 1)] | 0) +\n (isHex[id.charCodeAt(i + 2)] | 0) +\n (isHex[id.charCodeAt(i + 3)] | 0);\n }\n return r === length;\n}\n/**\n * @since 1.0.0\n */\nexport function isValidTraceId(traceId) {\n return isValidHex(traceId, 32) && traceId !== INVALID_TRACEID;\n}\n/**\n * @since 1.0.0\n */\nexport function isValidSpanId(spanId) {\n return isValidHex(spanId, 16) && spanId !== INVALID_SPANID;\n}\n/**\n * Returns true if this {@link SpanContext} is valid.\n * @return true if this {@link SpanContext} is valid.\n *\n * @since 1.0.0\n */\nexport function isSpanContextValid(spanContext) {\n return (isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId));\n}\n/**\n * Wrap the given {@link SpanContext} in a new non-recording {@link Span}\n *\n * @param spanContext span context to be wrapped\n * @returns a new non-recording {@link Span} with the provided context\n */\nexport function wrapSpanContext(spanContext) {\n return new NonRecordingSpan(spanContext);\n}\n//# sourceMappingURL=spancontext-utils.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ContextAPI } from '../api/context';\nimport { getSpanContext, setSpan } from '../trace/context-utils';\nimport { NonRecordingSpan } from './NonRecordingSpan';\nimport { isSpanContextValid } from './spancontext-utils';\nconst contextApi = ContextAPI.getInstance();\n/**\n * No-op implementations of {@link Tracer}.\n */\nexport class NoopTracer {\n // startSpan starts a noop span.\n startSpan(name, options, context = contextApi.active()) {\n const root = Boolean(options === null || options === void 0 ? void 0 : options.root);\n if (root) {\n return new NonRecordingSpan();\n }\n const parentFromContext = context && getSpanContext(context);\n if (isSpanContext(parentFromContext) &&\n isSpanContextValid(parentFromContext)) {\n return new NonRecordingSpan(parentFromContext);\n }\n else {\n return new NonRecordingSpan();\n }\n }\n startActiveSpan(name, arg2, arg3, arg4) {\n let opts;\n let ctx;\n let fn;\n if (arguments.length < 2) {\n return;\n }\n else if (arguments.length === 2) {\n fn = arg2;\n }\n else if (arguments.length === 3) {\n opts = arg2;\n fn = arg3;\n }\n else {\n opts = arg2;\n ctx = arg3;\n fn = arg4;\n }\n const parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();\n const span = this.startSpan(name, opts, parentContext);\n const contextWithSpanSet = setSpan(parentContext, span);\n return contextApi.with(contextWithSpanSet, fn, undefined, span);\n }\n}\nfunction isSpanContext(spanContext) {\n return (spanContext !== null &&\n typeof spanContext === 'object' &&\n 'spanId' in spanContext &&\n typeof spanContext['spanId'] === 'string' &&\n 'traceId' in spanContext &&\n typeof spanContext['traceId'] === 'string' &&\n 'traceFlags' in spanContext &&\n typeof spanContext['traceFlags'] === 'number');\n}\n//# sourceMappingURL=NoopTracer.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { NoopTracer } from './NoopTracer';\nconst NOOP_TRACER = new NoopTracer();\n/**\n * Proxy tracer provided by the proxy tracer provider\n *\n * @since 1.0.0\n */\nexport class ProxyTracer {\n constructor(provider, name, version, options) {\n this._provider = provider;\n this.name = name;\n this.version = version;\n this.options = options;\n }\n startSpan(name, options, context) {\n return this._getTracer().startSpan(name, options, context);\n }\n startActiveSpan(_name, _options, _context, _fn) {\n const tracer = this._getTracer();\n return Reflect.apply(tracer.startActiveSpan, tracer, arguments);\n }\n /**\n * Try to get a tracer from the proxy tracer provider.\n * If the proxy tracer provider has no delegate, return a noop tracer.\n */\n _getTracer() {\n if (this._delegate) {\n return this._delegate;\n }\n const tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);\n if (!tracer) {\n return NOOP_TRACER;\n }\n this._delegate = tracer;\n return this._delegate;\n }\n}\n//# sourceMappingURL=ProxyTracer.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { NoopTracer } from './NoopTracer';\n/**\n * An implementation of the {@link TracerProvider} which returns an impotent\n * Tracer for all calls to `getTracer`.\n *\n * All operations are no-op.\n */\nexport class NoopTracerProvider {\n getTracer(_name, _version, _options) {\n return new NoopTracer();\n }\n}\n//# sourceMappingURL=NoopTracerProvider.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ProxyTracer } from './ProxyTracer';\nimport { NoopTracerProvider } from './NoopTracerProvider';\nconst NOOP_TRACER_PROVIDER = new NoopTracerProvider();\n/**\n * Tracer provider which provides {@link ProxyTracer}s.\n *\n * Before a delegate is set, tracers provided are NoOp.\n * When a delegate is set, traces are provided from the delegate.\n * When a delegate is set after tracers have already been provided,\n * all tracers already provided will use the provided delegate implementation.\n *\n * @deprecated This will be removed in the next major version.\n * @since 1.0.0\n */\nexport class ProxyTracerProvider {\n /**\n * Get a {@link ProxyTracer}\n */\n getTracer(name, version, options) {\n var _a;\n return ((_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer(this, name, version, options));\n }\n getDelegate() {\n var _a;\n return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER;\n }\n /**\n * Set the delegate tracer provider\n */\n setDelegate(delegate) {\n this._delegate = delegate;\n }\n getDelegateTracer(name, version, options) {\n var _a;\n return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options);\n }\n}\n//# sourceMappingURL=ProxyTracerProvider.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @deprecated use the one declared in @opentelemetry/sdk-trace-base instead.\n * A sampling decision that determines how a {@link Span} will be recorded\n * and collected.\n *\n * @since 1.0.0\n */\nexport var SamplingDecision;\n(function (SamplingDecision) {\n /**\n * `Span.isRecording() === false`, span will not be recorded and all events\n * and attributes will be dropped.\n */\n SamplingDecision[SamplingDecision[\"NOT_RECORD\"] = 0] = \"NOT_RECORD\";\n /**\n * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags}\n * MUST NOT be set.\n */\n SamplingDecision[SamplingDecision[\"RECORD\"] = 1] = \"RECORD\";\n /**\n * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags}\n * MUST be set.\n */\n SamplingDecision[SamplingDecision[\"RECORD_AND_SAMPLED\"] = 2] = \"RECORD_AND_SAMPLED\";\n})(SamplingDecision || (SamplingDecision = {}));\n//# sourceMappingURL=SamplingResult.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @since 1.0.0\n */\nexport var SpanKind;\n(function (SpanKind) {\n /** Default value. Indicates that the span is used internally. */\n SpanKind[SpanKind[\"INTERNAL\"] = 0] = \"INTERNAL\";\n /**\n * Indicates that the span covers server-side handling of an RPC or other\n * remote request.\n */\n SpanKind[SpanKind[\"SERVER\"] = 1] = \"SERVER\";\n /**\n * Indicates that the span covers the client-side wrapper around an RPC or\n * other remote request.\n */\n SpanKind[SpanKind[\"CLIENT\"] = 2] = \"CLIENT\";\n /**\n * Indicates that the span describes producer sending a message to a\n * broker. Unlike client and server, there is no direct critical path latency\n * relationship between producer and consumer spans.\n */\n SpanKind[SpanKind[\"PRODUCER\"] = 3] = \"PRODUCER\";\n /**\n * Indicates that the span describes consumer receiving a message from a\n * broker. Unlike client and server, there is no direct critical path latency\n * relationship between producer and consumer spans.\n */\n SpanKind[SpanKind[\"CONSUMER\"] = 4] = \"CONSUMER\";\n})(SpanKind || (SpanKind = {}));\n//# sourceMappingURL=span_kind.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * An enumeration of status codes.\n *\n * @since 1.0.0\n */\nexport var SpanStatusCode;\n(function (SpanStatusCode) {\n /**\n * The default status.\n */\n SpanStatusCode[SpanStatusCode[\"UNSET\"] = 0] = \"UNSET\";\n /**\n * The operation has been validated by an Application developer or\n * Operator to have completed successfully.\n */\n SpanStatusCode[SpanStatusCode[\"OK\"] = 1] = \"OK\";\n /**\n * The operation contains an error.\n */\n SpanStatusCode[SpanStatusCode[\"ERROR\"] = 2] = \"ERROR\";\n})(SpanStatusCode || (SpanStatusCode = {}));\n//# sourceMappingURL=status.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { ContextAPI } from './api/context';\n/**\n * Entrypoint for context API\n * @since 1.0.0\n */\nexport const context = ContextAPI.getInstance();\n//# sourceMappingURL=context-api.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { DiagAPI } from './api/diag';\n/**\n * Entrypoint for Diag API.\n * Defines Diagnostic handler used for internal diagnostic logging operations.\n * The default provides a Noop DiagLogger implementation which may be changed via the\n * diag.setLogger(logger: DiagLogger) function.\n *\n * @since 1.0.0\n */\nexport const diag = DiagAPI.instance();\n//# sourceMappingURL=diag-api.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * No-op implementations of {@link TextMapPropagator}.\n */\nexport class NoopTextMapPropagator {\n /** Noop inject function does nothing */\n inject(_context, _carrier) { }\n /** Noop extract function does nothing and returns the input context */\n extract(context, _carrier) {\n return context;\n }\n fields() {\n return [];\n }\n}\n//# sourceMappingURL=NoopTextMapPropagator.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ContextAPI } from '../api/context';\nimport { createContextKey } from '../context/context';\n/**\n * Baggage key\n */\nconst BAGGAGE_KEY = createContextKey('OpenTelemetry Baggage Key');\n/**\n * Retrieve the current baggage from the given context\n *\n * @param {Context} Context that manage all context values\n * @returns {Baggage} Extracted baggage from the context\n */\nexport function getBaggage(context) {\n return context.getValue(BAGGAGE_KEY) || undefined;\n}\n/**\n * Retrieve the current baggage from the active/current context\n *\n * @returns {Baggage} Extracted baggage from the context\n */\nexport function getActiveBaggage() {\n return getBaggage(ContextAPI.getInstance().active());\n}\n/**\n * Store a baggage in the given context\n *\n * @param {Context} Context that manage all context values\n * @param {Baggage} baggage that will be set in the actual context\n */\nexport function setBaggage(context, baggage) {\n return context.setValue(BAGGAGE_KEY, baggage);\n}\n/**\n * Delete the baggage stored in the given context\n *\n * @param {Context} Context that manage all context values\n */\nexport function deleteBaggage(context) {\n return context.deleteValue(BAGGAGE_KEY);\n}\n//# sourceMappingURL=context-helpers.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nimport { NoopTextMapPropagator } from '../propagation/NoopTextMapPropagator';\nimport { defaultTextMapGetter, defaultTextMapSetter, } from '../propagation/TextMapPropagator';\nimport { getBaggage, getActiveBaggage, setBaggage, deleteBaggage, } from '../baggage/context-helpers';\nimport { createBaggage } from '../baggage/utils';\nimport { DiagAPI } from './diag';\nconst API_NAME = 'propagation';\nconst NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Propagation API\n *\n * @since 1.0.0\n */\nexport class PropagationAPI {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n constructor() {\n this.createBaggage = createBaggage;\n this.getBaggage = getBaggage;\n this.getActiveBaggage = getActiveBaggage;\n this.setBaggage = setBaggage;\n this.deleteBaggage = deleteBaggage;\n }\n /** Get the singleton instance of the Propagator API */\n static getInstance() {\n if (!this._instance) {\n this._instance = new PropagationAPI();\n }\n return this._instance;\n }\n /**\n * Set the current propagator.\n *\n * @returns true if the propagator was successfully registered, else false\n */\n setGlobalPropagator(propagator) {\n return registerGlobal(API_NAME, propagator, DiagAPI.instance());\n }\n /**\n * Inject context into a carrier to be propagated inter-process\n *\n * @param context Context carrying tracing data to inject\n * @param carrier carrier to inject context into\n * @param setter Function used to set values on the carrier\n */\n inject(context, carrier, setter = defaultTextMapSetter) {\n return this._getGlobalPropagator().inject(context, carrier, setter);\n }\n /**\n * Extract context from a carrier\n *\n * @param context Context which the newly created context will inherit from\n * @param carrier Carrier to extract context from\n * @param getter Function used to extract keys from a carrier\n */\n extract(context, carrier, getter = defaultTextMapGetter) {\n return this._getGlobalPropagator().extract(context, carrier, getter);\n }\n /**\n * Return a list of all fields which may be used by the propagator.\n */\n fields() {\n return this._getGlobalPropagator().fields();\n }\n /** Remove the global propagator */\n disable() {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n }\n _getGlobalPropagator() {\n return getGlobal(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR;\n }\n}\n//# sourceMappingURL=propagation.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { PropagationAPI } from './api/propagation';\n/**\n * Entrypoint for propagation API\n *\n * @since 1.0.0\n */\nexport const propagation = PropagationAPI.getInstance();\n//# sourceMappingURL=propagation-api.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nimport { ProxyTracerProvider } from '../trace/ProxyTracerProvider';\nimport { isSpanContextValid, wrapSpanContext, } from '../trace/spancontext-utils';\nimport { deleteSpan, getActiveSpan, getSpan, getSpanContext, setSpan, setSpanContext, } from '../trace/context-utils';\nimport { DiagAPI } from './diag';\nconst API_NAME = 'trace';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Tracing API\n *\n * @since 1.0.0\n */\nexport class TraceAPI {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n constructor() {\n this._proxyTracerProvider = new ProxyTracerProvider();\n this.wrapSpanContext = wrapSpanContext;\n this.isSpanContextValid = isSpanContextValid;\n this.deleteSpan = deleteSpan;\n this.getSpan = getSpan;\n this.getActiveSpan = getActiveSpan;\n this.getSpanContext = getSpanContext;\n this.setSpan = setSpan;\n this.setSpanContext = setSpanContext;\n }\n /** Get the singleton instance of the Trace API */\n static getInstance() {\n if (!this._instance) {\n this._instance = new TraceAPI();\n }\n return this._instance;\n }\n /**\n * Set the current global tracer.\n *\n * @returns true if the tracer provider was successfully registered, else false\n */\n setGlobalTracerProvider(provider) {\n const success = registerGlobal(API_NAME, this._proxyTracerProvider, DiagAPI.instance());\n if (success) {\n this._proxyTracerProvider.setDelegate(provider);\n }\n return success;\n }\n /**\n * Returns the global tracer provider.\n */\n getTracerProvider() {\n return getGlobal(API_NAME) || this._proxyTracerProvider;\n }\n /**\n * Returns a tracer from the global tracer provider.\n */\n getTracer(name, version) {\n return this.getTracerProvider().getTracer(name, version);\n }\n /** Remove the global tracer provider */\n disable() {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n this._proxyTracerProvider = new ProxyTracerProvider();\n }\n}\n//# sourceMappingURL=trace.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { TraceAPI } from './api/trace';\n/**\n * Entrypoint for trace API\n *\n * @since 1.0.0\n */\nexport const trace = TraceAPI.getInstance();\n//# sourceMappingURL=trace-api.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * check if an object has `addEventListener` and `removeEventListener` functions.\n * Generally only called with a `TargetWithEvents` but may be called with an `unknown` value.\n * @param obj - The object to check.\n */\nexport function isListenerObject(obj) {\n return (typeof obj === 'object' &&\n obj !== null &&\n 'addEventListener' in obj &&\n typeof obj.addEventListener === 'function' &&\n 'removeEventListener' in obj &&\n typeof obj.removeEventListener === 'function');\n}\n//# sourceMappingURL=util.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ROOT_CONTEXT } from '@opentelemetry/api';\nimport { isListenerObject } from './util';\n/* Key name to be used to save a context reference in Zone */\nconst ZONE_CONTEXT_KEY = 'OT_ZONE_CONTEXT';\n/**\n * ZoneContextManager\n * This module provides an easy functionality for tracing action between asynchronous operations in web.\n * It was not possible with standard [StackContextManager]{@link https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-sdk-trace-web/src/StackContextManager.ts}.\n * It heavily depends on [zone.js]{@link https://www.npmjs.com/package/zone.js}.\n * It stores the information about context in zone. Each Context will have always new Zone;\n * It also supports binding a certain Span to a target that has \"addEventListener\" and \"removeEventListener\".\n * When this happens a new zone is being created and the provided Span is being assigned to this zone.\n */\nexport class ZoneContextManager {\n /**\n * whether the context manager is enabled or not\n */\n _enabled = false;\n /**\n * @param context A context (span) to be executed within target function\n * @param target Function to be executed within the context\n */\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n _bindFunction(context, target) {\n const manager = this;\n const contextWrapper = function (...args) {\n return manager.with(context, () => target.apply(this, args));\n };\n Object.defineProperty(contextWrapper, 'length', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: target.length,\n });\n return contextWrapper;\n }\n /**\n * @param context A context (span) to be bind to target\n * @param obj target object on which the listeners will be patched\n */\n _bindListener(context, obj) {\n const target = obj;\n if (target.__ot_listeners !== undefined) {\n return obj;\n }\n target.__ot_listeners = {};\n if (typeof target.addEventListener === 'function') {\n target.addEventListener = this._patchAddEventListener(target, target.addEventListener, context);\n }\n if (typeof target.removeEventListener === 'function') {\n target.removeEventListener = this._patchRemoveEventListener(target, target.removeEventListener);\n }\n return obj;\n }\n /**\n * Creates a new zone\n * @param zoneName zone name\n * @param context A context (span) to be bind with Zone\n */\n _createZone(zoneName, context) {\n return Zone.current.fork({\n name: zoneName,\n properties: {\n [ZONE_CONTEXT_KEY]: context,\n },\n onCancelTask(parentZoneDelegate, currentZone, targetZone, task) {\n if (task.state === 'notScheduled' || task.state === 'running') {\n return task;\n }\n return parentZoneDelegate.cancelTask(targetZone, task);\n },\n });\n }\n /**\n * Patches addEventListener method\n * @param target any target that has \"addEventListener\" method\n * @param original reference to the patched method\n * @param [context] context to be bind to the listener\n */\n _patchAddEventListener(target, original, context) {\n const contextManager = this;\n return function (event, listener, opts) {\n if (target.__ot_listeners === undefined) {\n target.__ot_listeners = {};\n }\n let listeners = target.__ot_listeners[event];\n if (listeners === undefined) {\n listeners = new WeakMap();\n target.__ot_listeners[event] = listeners;\n }\n const patchedListener = contextManager.bind(context, listener);\n // store a weak reference of the user listener to ours\n listeners.set(listener, patchedListener);\n return original.call(this, event, patchedListener, opts);\n };\n }\n /**\n * Patches removeEventListener method\n * @param target any target that has \"removeEventListener\" method\n * @param original reference to the patched method\n */\n _patchRemoveEventListener(target, original) {\n return function (event, listener) {\n if (target.__ot_listeners === undefined ||\n target.__ot_listeners[event] === undefined) {\n return original.call(this, event, listener);\n }\n const events = target.__ot_listeners[event];\n const patchedListener = events.get(listener);\n events.delete(listener);\n return original.call(this, event, patchedListener || listener);\n };\n }\n /**\n * Returns the active context\n */\n active() {\n if (!this._enabled || !Zone.current) {\n return ROOT_CONTEXT;\n }\n return Zone.current.get(ZONE_CONTEXT_KEY) || ROOT_CONTEXT;\n }\n /**\n * Binds a the certain context or the active one to the target function and then returns the target\n * @param context A context (span) to be bind to target\n * @param target a function or event emitter. When target or one of its callbacks is called,\n * the provided context will be used as the active context for the duration of the call.\n */\n bind(context, target) {\n if (typeof target === 'function') {\n return this._bindFunction(context, target);\n }\n else if (isListenerObject(target)) {\n this._bindListener(context, target);\n }\n return target;\n }\n /**\n * Disable the context manager (clears all the contexts)\n */\n disable() {\n this._enabled = false;\n return this;\n }\n /**\n * Enables the context manager and creates a default(root) context\n */\n enable() {\n this._enabled = true;\n return this;\n }\n /**\n * Calls the callback function [fn] with the provided [context].\n * If [context] is undefined then it will use the active context.\n * The context will be set as active\n * @param context A context (span) to be called with provided callback\n * @param fn Callback function\n * @param thisArg optional receiver to be used for calling fn\n * @param args optional arguments forwarded to fn\n */\n with(context, fn, thisArg, ...args) {\n let zoneName = 'otel:with';\n if (fn.name) {\n zoneName += `:${fn.name}`;\n }\n return this._createZone(zoneName, context).run(fn, thisArg, args);\n }\n}\n//# sourceMappingURL=ZoneContextManager.js.map","'use strict';\n/**\n * @license Angular\n * (c) 2010-2026 Google LLC. https://angular.dev/\n * License: MIT\n */\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\n\n// packages/zone.js/lib/zone-impl.js\nvar global = globalThis;\nfunction __symbol__(name) {\n const symbolPrefix = global[\"__Zone_symbol_prefix\"] || \"__zone_symbol__\";\n return symbolPrefix + name;\n}\nfunction initZone() {\n const performance = global[\"performance\"];\n function mark(name) {\n performance && performance[\"mark\"] && performance[\"mark\"](name);\n }\n function performanceMeasure(name, label) {\n performance && performance[\"measure\"] && performance[\"measure\"](name, label);\n }\n mark(\"Zone\");\n const _ZoneImpl = class _ZoneImpl {\n constructor(parent, zoneSpec) {\n __publicField(this, \"_parent\");\n __publicField(this, \"_name\");\n __publicField(this, \"_properties\");\n __publicField(this, \"_zoneDelegate\");\n this._parent = parent;\n this._name = zoneSpec ? zoneSpec.name || \"unnamed\" : \"<root>\";\n this._properties = zoneSpec && zoneSpec.properties || {};\n this._zoneDelegate = new _ZoneDelegate(this, this._parent && this._parent._zoneDelegate, zoneSpec);\n }\n static assertZonePatched() {\n if (global[\"Promise\"] !== patches[\"ZoneAwarePromise\"]) {\n throw new Error(\"Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)\");\n }\n }\n static get root() {\n let zone = _ZoneImpl.current;\n while (zone.parent) {\n zone = zone.parent;\n }\n return zone;\n }\n static get current() {\n return _currentZoneFrame.zone;\n }\n static get currentTask() {\n return _currentTask;\n }\n static __load_patch(name, fn, ignoreDuplicate = false) {\n if (patches.hasOwnProperty(name)) {\n const checkDuplicate = global[__symbol__(\"forceDuplicateZoneCheck\")] === true;\n if (!ignoreDuplicate && checkDuplicate) {\n throw Error(\"Already loaded patch: \" + name);\n }\n } else if (!global[\"__Zone_disable_\" + name]) {\n const perfName = \"Zone:\" + name;\n mark(perfName);\n patches[name] = fn(global, _ZoneImpl, _api);\n performanceMeasure(perfName, perfName);\n }\n }\n get parent() {\n return this._parent;\n }\n get name() {\n return this._name;\n }\n get(key) {\n const zone = this.getZoneWith(key);\n if (zone)\n return zone._properties[key];\n }\n getZoneWith(key) {\n let current = this;\n while (current) {\n if (current._properties.hasOwnProperty(key)) {\n return current;\n }\n current = current._parent;\n }\n return null;\n }\n fork(zoneSpec) {\n if (!zoneSpec)\n throw new Error(\"ZoneSpec required!\");\n return this._zoneDelegate.fork(this, zoneSpec);\n }\n wrap(callback, source) {\n if (typeof callback !== \"function\") {\n throw new Error(\"Expecting function got: \" + callback);\n }\n const _callback = this._zoneDelegate.intercept(this, callback, source);\n const zone = this;\n return function() {\n return zone.runGuarded(_callback, this, arguments, source);\n };\n }\n run(callback, applyThis, applyArgs, source) {\n _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n try {\n return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source);\n } finally {\n _currentZoneFrame = _currentZoneFrame.parent;\n }\n }\n runGuarded(callback, applyThis = null, applyArgs, source) {\n _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n try {\n try {\n return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source);\n } catch (error) {\n if (this._zoneDelegate.handleError(this, error)) {\n throw error;\n }\n }\n } finally {\n _currentZoneFrame = _currentZoneFrame.parent;\n }\n }\n runTask(task, applyThis, applyArgs) {\n if (task.zone != this) {\n throw new Error(\"A task can only be run in the zone of creation! (Creation: \" + (task.zone || NO_ZONE).name + \"; Execution: \" + this.name + \")\");\n }\n const zoneTask = task;\n const { type, data: { isPeriodic = false, isRefreshable = false } = {} } = task;\n if (task.state === notScheduled && (type === eventTask || type === macroTask)) {\n return;\n }\n const reEntryGuard = task.state != running;\n reEntryGuard && zoneTask._transitionTo(running, scheduled);\n const previousTask = _currentTask;\n _currentTask = zoneTask;\n _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n try {\n if (type == macroTask && task.data && !isPeriodic && !isRefreshable) {\n task.cancelFn = void 0;\n }\n try {\n return this._zoneDelegate.invokeTask(this, zoneTask, applyThis, applyArgs);\n } catch (error) {\n if (this._zoneDelegate.handleError(this, error)) {\n throw error;\n }\n }\n } finally {\n const state = task.state;\n if (state !== notScheduled && state !== unknown) {\n if (type == eventTask || isPeriodic || isRefreshable && state === scheduling) {\n reEntryGuard && zoneTask._transitionTo(scheduled, running, scheduling);\n } else {\n const zoneDelegates = zoneTask._zoneDelegates;\n this._updateTaskCount(zoneTask, -1);\n reEntryGuard && zoneTask._transitionTo(notScheduled, running, notScheduled);\n if (isRefreshable) {\n zoneTask._zoneDelegates = zoneDelegates;\n }\n }\n }\n _currentZoneFrame = _currentZoneFrame.parent;\n _currentTask = previousTask;\n }\n }\n scheduleTask(task) {\n if (task.zone && task.zone !== this) {\n let newZone = this;\n while (newZone) {\n if (newZone === task.zone) {\n throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${task.zone.name}`);\n }\n newZone = newZone.parent;\n }\n }\n task._transitionTo(scheduling, notScheduled);\n const zoneDelegates = [];\n task._zoneDelegates = zoneDelegates;\n task._zone = this;\n try {\n task = this._zoneDelegate.scheduleTask(this, task);\n } catch (err) {\n task._transitionTo(unknown, scheduling, notScheduled);\n this._zoneDelegate.handleError(this, err);\n throw err;\n }\n if (task._zoneDelegates === zoneDelegates) {\n this._updateTaskCount(task, 1);\n }\n if (task.state == scheduling) {\n task._transitionTo(scheduled, scheduling);\n }\n return task;\n }\n scheduleMicroTask(source, callback, data, customSchedule) {\n return this.scheduleTask(new ZoneTask(microTask, source, callback, data, customSchedule, void 0));\n }\n scheduleMacroTask(source, callback, data, customSchedule, customCancel) {\n return this.scheduleTask(new ZoneTask(macroTask, source, callback, data, customSchedule, customCancel));\n }\n scheduleEventTask(source, callback, data, customSchedule, customCancel) {\n return this.scheduleTask(new ZoneTask(eventTask, source, callback, data, customSchedule, customCancel));\n }\n cancelTask(task) {\n if (task.zone != this)\n throw new Error(\"A task can only be cancelled in the zone of creation! (Creation: \" + (task.zone || NO_ZONE).name + \"; Execution: \" + this.name + \")\");\n if (task.state !== scheduled && task.state !== running) {\n return;\n }\n task._transitionTo(canceling, scheduled, running);\n try {\n this._zoneDelegate.cancelTask(this, task);\n } catch (err) {\n task._transitionTo(unknown, canceling);\n this._zoneDelegate.handleError(this, err);\n throw err;\n }\n this._updateTaskCount(task, -1);\n task._transitionTo(notScheduled, canceling);\n task.runCount = -1;\n return task;\n }\n _updateTaskCount(task, count) {\n const zoneDelegates = task._zoneDelegates;\n if (count == -1) {\n task._zoneDelegates = null;\n }\n for (let i = 0; i < zoneDelegates.length; i++) {\n zoneDelegates[i]._updateTaskCount(task.type, count);\n }\n }\n };\n __publicField(_ZoneImpl, \"__symbol__\", __symbol__);\n let ZoneImpl = _ZoneImpl;\n const DELEGATE_ZS = {\n name: \"\",\n onHasTask: (delegate, _, target, hasTaskState) => delegate.hasTask(target, hasTaskState),\n onScheduleTask: (delegate, _, target, task) => delegate.scheduleTask(target, task),\n onInvokeTask: (delegate, _, target, task, applyThis, applyArgs) => delegate.invokeTask(target, task, applyThis, applyArgs),\n onCancelTask: (delegate, _, target, task) => delegate.cancelTask(target, task)\n };\n class _ZoneDelegate {\n constructor(zone, parentDelegate, zoneSpec) {\n __publicField(this, \"_zone\");\n __publicField(this, \"_taskCounts\", {\n \"microTask\": 0,\n \"macroTask\": 0,\n \"eventTask\": 0\n });\n __publicField(this, \"_forkDlgt\");\n __publicField(this, \"_forkZS\");\n __publicField(this, \"_forkCurrZone\");\n __publicField(this, \"_interceptDlgt\");\n __publicField(this, \"_interceptZS\");\n __publicField(this, \"_interceptCurrZone\");\n __publicField(this, \"_invokeDlgt\");\n __publicField(this, \"_invokeZS\");\n __publicField(this, \"_invokeCurrZone\");\n __publicField(this, \"_handleErrorDlgt\");\n __publicField(this, \"_handleErrorZS\");\n __publicField(this, \"_handleErrorCurrZone\");\n __publicField(this, \"_scheduleTaskDlgt\");\n __publicField(this, \"_scheduleTaskZS\");\n __publicField(this, \"_scheduleTaskCurrZone\");\n __publicField(this, \"_invokeTaskDlgt\");\n __publicField(this, \"_invokeTaskZS\");\n __publicField(this, \"_invokeTaskCurrZone\");\n __publicField(this, \"_cancelTaskDlgt\");\n __publicField(this, \"_cancelTaskZS\");\n __publicField(this, \"_cancelTaskCurrZone\");\n __publicField(this, \"_hasTaskDlgt\");\n __publicField(this, \"_hasTaskDlgtOwner\");\n __publicField(this, \"_hasTaskZS\");\n __publicField(this, \"_hasTaskCurrZone\");\n this._zone = zone;\n this._forkZS = zoneSpec && (zoneSpec && zoneSpec.onFork ? zoneSpec : parentDelegate._forkZS);\n this._forkDlgt = zoneSpec && (zoneSpec.onFork ? parentDelegate : parentDelegate._forkDlgt);\n this._forkCurrZone = zoneSpec && (zoneSpec.onFork ? this._zone : parentDelegate._forkCurrZone);\n this._interceptZS = zoneSpec && (zoneSpec.onIntercept ? zoneSpec : parentDelegate._interceptZS);\n this._interceptDlgt = zoneSpec && (zoneSpec.onIntercept ? parentDelegate : parentDelegate._interceptDlgt);\n this._interceptCurrZone = zoneSpec && (zoneSpec.onIntercept ? this._zone : parentDelegate._interceptCurrZone);\n this._invokeZS = zoneSpec && (zoneSpec.onInvoke ? zoneSpec : parentDelegate._invokeZS);\n this._invokeDlgt = zoneSpec && (zoneSpec.onInvoke ? parentDelegate : parentDelegate._invokeDlgt);\n this._invokeCurrZone = zoneSpec && (zoneSpec.onInvoke ? this._zone : parentDelegate._invokeCurrZone);\n this._handleErrorZS = zoneSpec && (zoneSpec.onHandleError ? zoneSpec : parentDelegate._handleErrorZS);\n this._handleErrorDlgt = zoneSpec && (zoneSpec.onHandleError ? parentDelegate : parentDelegate._handleErrorDlgt);\n this._handleErrorCurrZone = zoneSpec && (zoneSpec.onHandleError ? this._zone : parentDelegate._handleErrorCurrZone);\n this._scheduleTaskZS = zoneSpec && (zoneSpec.onScheduleTask ? zoneSpec : parentDelegate._scheduleTaskZS);\n this._scheduleTaskDlgt = zoneSpec && (zoneSpec.onScheduleTask ? parentDelegate : parentDelegate._scheduleTaskDlgt);\n this._scheduleTaskCurrZone = zoneSpec && (zoneSpec.onScheduleTask ? this._zone : parentDelegate._scheduleTaskCurrZone);\n this._invokeTaskZS = zoneSpec && (zoneSpec.onInvokeTask ? zoneSpec : parentDelegate._invokeTaskZS);\n this._invokeTaskDlgt = zoneSpec && (zoneSpec.onInvokeTask ? parentDelegate : parentDelegate._invokeTaskDlgt);\n this._invokeTaskCurrZone = zoneSpec && (zoneSpec.onInvokeTask ? this._zone : parentDelegate._invokeTaskCurrZone);\n this._cancelTaskZS = zoneSpec && (zoneSpec.onCancelTask ? zoneSpec : parentDelegate._cancelTaskZS);\n this._cancelTaskDlgt = zoneSpec && (zoneSpec.onCancelTask ? parentDelegate : parentDelegate._cancelTaskDlgt);\n this._cancelTaskCurrZone = zoneSpec && (zoneSpec.onCancelTask ? this._zone : parentDelegate._cancelTaskCurrZone);\n this._hasTaskZS = null;\n this._hasTaskDlgt = null;\n this._hasTaskDlgtOwner = null;\n this._hasTaskCurrZone = null;\n const zoneSpecHasTask = zoneSpec && zoneSpec.onHasTask;\n const parentHasTask = parentDelegate && parentDelegate._hasTaskZS;\n if (zoneSpecHasTask || parentHasTask) {\n this._hasTaskZS = zoneSpecHasTask ? zoneSpec : DELEGATE_ZS;\n this._hasTaskDlgt = parentDelegate;\n this._hasTaskDlgtOwner = this;\n this._hasTaskCurrZone = this._zone;\n if (!zoneSpec.onScheduleTask) {\n this._scheduleTaskZS = DELEGATE_ZS;\n this._scheduleTaskDlgt = parentDelegate;\n this._scheduleTaskCurrZone = this._zone;\n }\n if (!zoneSpec.onInvokeTask) {\n this._invokeTaskZS = DELEGATE_ZS;\n this._invokeTaskDlgt = parentDelegate;\n this._invokeTaskCurrZone = this._zone;\n }\n if (!zoneSpec.onCancelTask) {\n this._cancelTaskZS = DELEGATE_ZS;\n this._cancelTaskDlgt = parentDelegate;\n this._cancelTaskCurrZone = this._zone;\n }\n }\n }\n get zone() {\n return this._zone;\n }\n fork(targetZone, zoneSpec) {\n return this._forkZS ? this._forkZS.onFork(this._forkDlgt, this.zone, targetZone, zoneSpec) : new ZoneImpl(targetZone, zoneSpec);\n }\n intercept(targetZone, callback, source) {\n return this._interceptZS ? this._interceptZS.onIntercept(this._interceptDlgt, this._interceptCurrZone, targetZone, callback, source) : callback;\n }\n invoke(targetZone, callback, applyThis, applyArgs, source) {\n return this._invokeZS ? this._invokeZS.onInvoke(this._invokeDlgt, this._invokeCurrZone, targetZone, callback, applyThis, applyArgs, source) : callback.apply(applyThis, applyArgs);\n }\n handleError(targetZone, error) {\n return this._handleErrorZS ? this._handleErrorZS.onHandleError(this._handleErrorDlgt, this._handleErrorCurrZone, targetZone, error) : true;\n }\n scheduleTask(targetZone, task) {\n let returnTask = task;\n if (this._scheduleTaskZS) {\n if (this._hasTaskZS) {\n returnTask._zoneDelegates.push(this._hasTaskDlgtOwner);\n }\n returnTask = this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt, this._scheduleTaskCurrZone, targetZone, task);\n if (!returnTask)\n returnTask = task;\n } else {\n if (task.scheduleFn) {\n task.scheduleFn(task);\n } else if (task.type == microTask) {\n scheduleMicroTask(task);\n } else {\n throw new Error(\"Task is missing scheduleFn.\");\n }\n }\n return returnTask;\n }\n invokeTask(targetZone, task, applyThis, applyArgs) {\n return this._invokeTaskZS ? this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt, this._invokeTaskCurrZone, targetZone, task, applyThis, applyArgs) : task.callback.apply(applyThis, applyArgs);\n }\n cancelTask(targetZone, task) {\n let value;\n if (this._cancelTaskZS) {\n value = this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt, this._cancelTaskCurrZone, targetZone, task);\n } else {\n if (!task.cancelFn) {\n throw Error(\"Task is not cancelable\");\n }\n value = task.cancelFn(task);\n }\n return value;\n }\n hasTask(targetZone, isEmpty) {\n try {\n this._hasTaskZS && this._hasTaskZS.onHasTask(this._hasTaskDlgt, this._hasTaskCurrZone, targetZone, isEmpty);\n } catch (err) {\n this.handleError(targetZone, err);\n }\n }\n _updateTaskCount(type, count) {\n const counts = this._taskCounts;\n const prev = counts[type];\n const next = counts[type] = prev + count;\n if (next < 0) {\n throw new Error(\"More tasks executed then were scheduled.\");\n }\n if (prev == 0 || next == 0) {\n const isEmpty = {\n microTask: counts[\"microTask\"] > 0,\n macroTask: counts[\"macroTask\"] > 0,\n eventTask: counts[\"eventTask\"] > 0,\n change: type\n };\n this.hasTask(this._zone, isEmpty);\n }\n }\n }\n class ZoneTask {\n constructor(type, source, callback, options, scheduleFn, cancelFn) {\n __publicField(this, \"type\");\n __publicField(this, \"source\");\n __publicField(this, \"invoke\");\n __publicField(this, \"callback\");\n __publicField(this, \"data\");\n __publicField(this, \"scheduleFn\");\n __publicField(this, \"cancelFn\");\n __publicField(this, \"_zone\", null);\n __publicField(this, \"runCount\", 0);\n __publicField(this, \"_zoneDelegates\", null);\n __publicField(this, \"_state\", \"notScheduled\");\n this.type = type;\n this.source = source;\n this.data = options;\n this.scheduleFn = scheduleFn;\n this.cancelFn = cancelFn;\n if (!callback) {\n throw new Error(\"callback is not defined\");\n }\n this.callback = callback;\n const self2 = this;\n if (type === eventTask && options && options.useG) {\n this.invoke = ZoneTask.invokeTask;\n } else {\n this.invoke = function() {\n return ZoneTask.invokeTask.call(global, self2, this, arguments);\n };\n }\n }\n static invokeTask(task, target, args) {\n if (!task) {\n task = this;\n }\n _numberOfNestedTaskFrames++;\n try {\n task.runCount++;\n return task.zone.runTask(task, target, args);\n } finally {\n if (_numberOfNestedTaskFrames === 1 && !global[enableNativeMicrotaskDraining]) {\n drainMicroTaskQueueSynchronously();\n }\n _numberOfNestedTaskFrames--;\n }\n }\n get zone() {\n return this._zone;\n }\n get state() {\n return this._state;\n }\n cancelScheduleRequest() {\n this._transitionTo(notScheduled, scheduling);\n }\n _transitionTo(toState, fromState1, fromState2) {\n if (this._state === fromState1 || this._state === fromState2) {\n this._state = toState;\n if (toState == notScheduled) {\n this._zoneDelegates = null;\n }\n } else {\n throw new Error(`${this.type} '${this.source}': can not transition to '${toState}', expecting state '${fromState1}'${fromState2 ? \" or '\" + fromState2 + \"'\" : \"\"}, was '${this._state}'.`);\n }\n }\n toString() {\n if (this.data && typeof this.data.handleId !== \"undefined\") {\n return this.data.handleId.toString();\n } else {\n return Object.prototype.toString.call(this);\n }\n }\n // add toJSON method to prevent cyclic error when\n // call JSON.stringify(zoneTask)\n toJSON() {\n return {\n type: this.type,\n state: this.state,\n source: this.source,\n zone: this.zone.name,\n runCount: this.runCount\n };\n }\n }\n const symbolSetTimeout = __symbol__(\"setTimeout\");\n const symbolPromise = __symbol__(\"Promise\");\n const symbolThen = __symbol__(\"then\");\n const enableNativeMicrotaskDraining = __symbol__(\"enable_native_microtask_draining\");\n let _microTaskQueue = [];\n let _isDrainingMicrotaskQueue = false;\n let nativeMicroTaskQueuePromise;\n function nativeScheduleMicroTask(func) {\n var _a;\n if (!nativeMicroTaskQueuePromise && global[symbolPromise]) {\n nativeMicroTaskQueuePromise = global[symbolPromise].resolve(0);\n }\n if (nativeMicroTaskQueuePromise) {\n const thenFn = (_a = nativeMicroTaskQueuePromise[symbolThen]) != null ? _a : nativeMicroTaskQueuePromise[\"then\"];\n thenFn.call(nativeMicroTaskQueuePromise, func);\n } else {\n global[symbolSetTimeout](func, 0);\n }\n }\n function scheduleMicroTask(task) {\n const isNativeDrainingEnabled = global[enableNativeMicrotaskDraining];\n const shouldDrainWithNative = isNativeDrainingEnabled && _microTaskQueue.length === 0 && !_isDrainingMicrotaskQueue;\n const shouldDrainWithoutNative = !isNativeDrainingEnabled && _numberOfNestedTaskFrames === 0 && _microTaskQueue.length === 0;\n if (shouldDrainWithNative || shouldDrainWithoutNative) {\n nativeScheduleMicroTask(drainMicroTaskQueueSynchronously);\n }\n if (task) {\n _microTaskQueue.push(task);\n }\n }\n function drainMicroTaskQueueSynchronously() {\n if (_isDrainingMicrotaskQueue) {\n return;\n }\n _isDrainingMicrotaskQueue = true;\n while (_microTaskQueue.length) {\n const queue = _microTaskQueue;\n _microTaskQueue = [];\n for (const task of queue) {\n try {\n task.zone.runTask(task, null, null);\n } catch (error) {\n _api.onUnhandledError(error);\n }\n }\n }\n if (global[enableNativeMicrotaskDraining]) {\n _isDrainingMicrotaskQueue = false;\n _api.microtaskDrainDone();\n } else {\n _api.microtaskDrainDone();\n _isDrainingMicrotaskQueue = false;\n }\n }\n const NO_ZONE = { name: \"NO ZONE\" };\n const notScheduled = \"notScheduled\", scheduling = \"scheduling\", scheduled = \"scheduled\", running = \"running\", canceling = \"canceling\", unknown = \"unknown\";\n const microTask = \"microTask\", macroTask = \"macroTask\", eventTask = \"eventTask\";\n const patches = {};\n const _api = {\n symbol: __symbol__,\n currentZoneFrame: () => _currentZoneFrame,\n onUnhandledError: noop,\n microtaskDrainDone: noop,\n scheduleMicroTask,\n showUncaughtError: () => !ZoneImpl[__symbol__(\"ignoreConsoleErrorUncaughtError\")],\n patchEventTarget: () => [],\n patchOnProperties: noop,\n patchMethod: () => noop,\n bindArguments: () => [],\n patchThen: () => noop,\n patchMacroTask: () => noop,\n patchEventPrototype: () => noop,\n getGlobalObjects: () => void 0,\n ObjectDefineProperty: () => noop,\n ObjectGetOwnPropertyDescriptor: () => void 0,\n ObjectCreate: () => void 0,\n ArraySlice: () => [],\n patchClass: () => noop,\n wrapWithCurrentZone: () => noop,\n filterProperties: () => [],\n attachOriginToPatched: () => noop,\n _redefineProperty: () => noop,\n patchCallbacks: () => noop,\n nativeScheduleMicroTask\n };\n let _currentZoneFrame = { parent: null, zone: new ZoneImpl(null, null) };\n let _currentTask = null;\n let _numberOfNestedTaskFrames = 0;\n function noop() {\n }\n performanceMeasure(\"Zone\", \"Zone\");\n return ZoneImpl;\n}\n\n// packages/zone.js/lib/zone.js\nfunction loadZone() {\n var _a;\n const global2 = globalThis;\n const checkDuplicate = global2[__symbol__(\"forceDuplicateZoneCheck\")] === true;\n if (global2[\"Zone\"] && (checkDuplicate || typeof global2[\"Zone\"].__symbol__ !== \"function\")) {\n throw new Error(\"Zone already loaded.\");\n }\n (_a = global2[\"Zone\"]) != null ? _a : global2[\"Zone\"] = initZone();\n return global2[\"Zone\"];\n}\n\n// packages/zone.js/lib/common/utils.js\nvar ObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ObjectDefineProperty = Object.defineProperty;\nvar ObjectGetPrototypeOf = Object.getPrototypeOf;\nvar ObjectCreate = Object.create;\nvar ArraySlice = Array.prototype.slice;\nvar ADD_EVENT_LISTENER_STR = \"addEventListener\";\nvar REMOVE_EVENT_LISTENER_STR = \"removeEventListener\";\nvar ZONE_SYMBOL_ADD_EVENT_LISTENER = __symbol__(ADD_EVENT_LISTENER_STR);\nvar ZONE_SYMBOL_REMOVE_EVENT_LISTENER = __symbol__(REMOVE_EVENT_LISTENER_STR);\nvar TRUE_STR = \"true\";\nvar FALSE_STR = \"false\";\nvar ZONE_SYMBOL_PREFIX = __symbol__(\"\");\nfunction wrapWithCurrentZone(callback, source) {\n return Zone.current.wrap(callback, source);\n}\nfunction scheduleMacroTaskWithCurrentZone(source, callback, data, customSchedule, customCancel) {\n return Zone.current.scheduleMacroTask(source, callback, data, customSchedule, customCancel);\n}\nvar zoneSymbol = __symbol__;\nvar isWindowExists = typeof window !== \"undefined\";\nvar internalWindow = isWindowExists ? window : void 0;\nvar _global = isWindowExists && internalWindow || globalThis;\nvar REMOVE_ATTRIBUTE = \"removeAttribute\";\nfunction bindArguments(args, source) {\n for (let i = args.length - 1; i >= 0; i--) {\n if (typeof args[i] === \"function\") {\n args[i] = wrapWithCurrentZone(args[i], source + \"_\" + i);\n }\n }\n return args;\n}\nfunction patchPrototype(prototype, fnNames) {\n const source = prototype.constructor[\"name\"];\n for (let i = 0; i < fnNames.length; i++) {\n const name = fnNames[i];\n const delegate = prototype[name];\n if (delegate) {\n const prototypeDesc = ObjectGetOwnPropertyDescriptor(prototype, name);\n if (!isPropertyWritable(prototypeDesc)) {\n continue;\n }\n prototype[name] = ((delegate2) => {\n const patched = function() {\n return delegate2.apply(this, bindArguments(arguments, source + \".\" + name));\n };\n attachOriginToPatched(patched, delegate2);\n return patched;\n })(delegate);\n }\n }\n}\nfunction isPropertyWritable(propertyDesc) {\n if (!propertyDesc) {\n return true;\n }\n if (propertyDesc.writable === false) {\n return false;\n }\n return !(typeof propertyDesc.get === \"function\" && typeof propertyDesc.set === \"undefined\");\n}\nvar isWebWorker = typeof WorkerGlobalScope !== \"undefined\" && self instanceof WorkerGlobalScope;\nvar isNode = !(\"nw\" in _global) && typeof _global.process !== \"undefined\" && _global.process.toString() === \"[object process]\";\nvar isBrowser = !isNode && !isWebWorker && !!(isWindowExists && internalWindow[\"HTMLElement\"]);\nvar isMix = typeof _global.process !== \"undefined\" && _global.process.toString() === \"[object process]\" && !isWebWorker && !!(isWindowExists && internalWindow[\"HTMLElement\"]);\nvar zoneSymbolEventNames = {};\nvar enableBeforeunloadSymbol = zoneSymbol(\"enable_beforeunload\");\nvar wrapFn = function(event) {\n event = event || _global.event;\n if (!event) {\n return;\n }\n let eventNameSymbol = zoneSymbolEventNames[event.type];\n if (!eventNameSymbol) {\n eventNameSymbol = zoneSymbolEventNames[event.type] = zoneSymbol(\"ON_PROPERTY\" + event.type);\n }\n const target = this || event.target || _global;\n const listener = target[eventNameSymbol];\n let result;\n if (isBrowser && target === internalWindow && event.type === \"error\") {\n const errorEvent = event;\n result = listener && listener.call(this, errorEvent.message, errorEvent.filename, errorEvent.lineno, errorEvent.colno, errorEvent.error);\n if (result === true) {\n event.preventDefault();\n }\n } else {\n result = listener && listener.apply(this, arguments);\n if (\n // https://github.com/angular/angular/issues/47579\n // https://www.w3.org/TR/2011/WD-html5-20110525/history.html#beforeunloadevent\n // This is the only specific case we should check for. The spec defines that the\n // `returnValue` attribute represents the message to show the user. When the event\n // is created, this attribute must be set to the empty string.\n event.type === \"beforeunload\" && // To prevent any breaking changes resulting from this change, given that\n // it was already causing a significant number of failures in G3, we have hidden\n // that behavior behind a global configuration flag. Consumers can enable this\n // flag explicitly if they want the `beforeunload` event to be handled as defined\n // in the specification.\n _global[enableBeforeunloadSymbol] && // The IDL event definition is `attribute DOMString returnValue`, so we check whether\n // `typeof result` is a string.\n typeof result === \"string\"\n ) {\n event.returnValue = result;\n } else if (result != void 0 && !result) {\n event.preventDefault();\n }\n }\n return result;\n};\nfunction patchProperty(obj, prop, prototype) {\n let desc = ObjectGetOwnPropertyDescriptor(obj, prop);\n if (!desc && prototype) {\n const prototypeDesc = ObjectGetOwnPropertyDescriptor(prototype, prop);\n if (prototypeDesc) {\n desc = { enumerable: true, configurable: true };\n }\n }\n if (!desc || !desc.configurable) {\n return;\n }\n const onPropPatchedSymbol = zoneSymbol(\"on\" + prop + \"patched\");\n if (obj.hasOwnProperty(onPropPatchedSymbol) && obj[onPropPatchedSymbol]) {\n return;\n }\n delete desc.writable;\n delete desc.value;\n const originalDescGet = desc.get;\n const originalDescSet = desc.set;\n const eventName = prop.slice(2);\n let eventNameSymbol = zoneSymbolEventNames[eventName];\n if (!eventNameSymbol) {\n eventNameSymbol = zoneSymbolEventNames[eventName] = zoneSymbol(\"ON_PROPERTY\" + eventName);\n }\n desc.set = function(newValue) {\n let target = this;\n if (!target && obj === _global) {\n target = _global;\n }\n if (!target) {\n return;\n }\n const previousValue = target[eventNameSymbol];\n if (typeof previousValue === \"function\") {\n target.removeEventListener(eventName, wrapFn);\n }\n originalDescSet == null ? void 0 : originalDescSet.call(target, null);\n target[eventNameSymbol] = newValue;\n if (typeof newValue === \"function\") {\n target.addEventListener(eventName, wrapFn, false);\n }\n };\n desc.get = function() {\n let target = this;\n if (!target && obj === _global) {\n target = _global;\n }\n if (!target) {\n return null;\n }\n const listener = target[eventNameSymbol];\n if (listener) {\n return listener;\n } else if (originalDescGet) {\n let value = originalDescGet.call(this);\n if (value) {\n desc.set.call(this, value);\n if (typeof target[REMOVE_ATTRIBUTE] === \"function\") {\n target.removeAttribute(prop);\n }\n return value;\n }\n }\n return null;\n };\n ObjectDefineProperty(obj, prop, desc);\n obj[onPropPatchedSymbol] = true;\n}\nfunction patchOnProperties(obj, properties, prototype) {\n if (properties) {\n for (let i = 0; i < properties.length; i++) {\n patchProperty(obj, \"on\" + properties[i], prototype);\n }\n } else {\n const onProperties = [];\n for (const prop in obj) {\n if (prop.slice(0, 2) == \"on\") {\n onProperties.push(prop);\n }\n }\n for (let j = 0; j < onProperties.length; j++) {\n patchProperty(obj, onProperties[j], prototype);\n }\n }\n}\nvar originalInstanceKey = zoneSymbol(\"originalInstance\");\nfunction patchClass(className) {\n const OriginalClass = _global[className];\n if (!OriginalClass)\n return;\n _global[zoneSymbol(className)] = OriginalClass;\n _global[className] = function() {\n const a = bindArguments(arguments, className);\n switch (a.length) {\n case 0:\n this[originalInstanceKey] = new OriginalClass();\n break;\n case 1:\n this[originalInstanceKey] = new OriginalClass(a[0]);\n break;\n case 2:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1]);\n break;\n case 3:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);\n break;\n case 4:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);\n break;\n default:\n throw new Error(\"Arg list too long.\");\n }\n };\n attachOriginToPatched(_global[className], OriginalClass);\n const instance = new OriginalClass(function() {\n });\n let prop;\n for (prop in instance) {\n if (className === \"XMLHttpRequest\" && prop === \"responseBlob\")\n continue;\n (function(prop2) {\n if (typeof instance[prop2] === \"function\") {\n _global[className].prototype[prop2] = function() {\n return this[originalInstanceKey][prop2].apply(this[originalInstanceKey], arguments);\n };\n } else {\n ObjectDefineProperty(_global[className].prototype, prop2, {\n set: function(fn) {\n if (typeof fn === \"function\") {\n this[originalInstanceKey][prop2] = wrapWithCurrentZone(fn, className + \".\" + prop2);\n attachOriginToPatched(this[originalInstanceKey][prop2], fn);\n } else {\n this[originalInstanceKey][prop2] = fn;\n }\n },\n get: function() {\n return this[originalInstanceKey][prop2];\n }\n });\n }\n })(prop);\n }\n for (prop in OriginalClass) {\n if (prop !== \"prototype\" && OriginalClass.hasOwnProperty(prop)) {\n _global[className][prop] = OriginalClass[prop];\n }\n }\n}\nfunction copySymbolProperties(src, dest) {\n if (typeof Object.getOwnPropertySymbols !== \"function\") {\n return;\n }\n const symbols = Object.getOwnPropertySymbols(src);\n symbols.forEach((symbol) => {\n const desc = Object.getOwnPropertyDescriptor(src, symbol);\n Object.defineProperty(dest, symbol, {\n get: function() {\n return src[symbol];\n },\n set: function(value) {\n if (desc && (!desc.writable || typeof desc.set !== \"function\")) {\n return;\n }\n src[symbol] = value;\n },\n enumerable: desc ? desc.enumerable : true,\n configurable: desc ? desc.configurable : true\n });\n });\n}\nvar shouldCopySymbolProperties = false;\nfunction patchMethod(target, name, patchFn) {\n let proto = target;\n while (proto && !proto.hasOwnProperty(name)) {\n proto = ObjectGetPrototypeOf(proto);\n }\n if (!proto && target[name]) {\n proto = target;\n }\n const delegateName = zoneSymbol(name);\n let delegate = null;\n if (proto && (!(delegate = proto[delegateName]) || !proto.hasOwnProperty(delegateName))) {\n delegate = proto[delegateName] = proto[name];\n const desc = proto && ObjectGetOwnPropertyDescriptor(proto, name);\n if (isPropertyWritable(desc)) {\n const patchDelegate = patchFn(delegate, delegateName, name);\n proto[name] = function() {\n return patchDelegate(this, arguments);\n };\n attachOriginToPatched(proto[name], delegate);\n if (shouldCopySymbolProperties) {\n copySymbolProperties(delegate, proto[name]);\n }\n }\n }\n return delegate;\n}\nfunction patchMacroTask(obj, funcName, metaCreator) {\n let setNative = null;\n function scheduleTask(task) {\n const data = task.data;\n data.args[data.cbIdx] = function() {\n task.invoke.apply(this, arguments);\n };\n setNative.apply(data.target, data.args);\n return task;\n }\n setNative = patchMethod(obj, funcName, (delegate) => function(self2, args) {\n const meta = metaCreator(self2, args);\n if (meta.cbIdx >= 0 && typeof args[meta.cbIdx] === \"function\") {\n return scheduleMacroTaskWithCurrentZone(meta.name, args[meta.cbIdx], meta, scheduleTask);\n } else {\n return delegate.apply(self2, args);\n }\n });\n}\nfunction attachOriginToPatched(patched, original) {\n patched[zoneSymbol(\"OriginalDelegate\")] = original;\n}\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\nfunction isNumber(value) {\n return typeof value === \"number\";\n}\n\n// packages/zone.js/lib/common/events.js\nvar OPTIMIZED_ZONE_EVENT_TASK_DATA = {\n useG: true\n};\nvar zoneSymbolEventNames2 = {};\nvar globalSources = {};\nvar EVENT_NAME_SYMBOL_REGX = new RegExp(\"^\" + ZONE_SYMBOL_PREFIX + \"(\\\\w+)(true|false)$\");\nvar IMMEDIATE_PROPAGATION_SYMBOL = zoneSymbol(\"propagationStopped\");\nfunction prepareEventNames(eventName, eventNameToString) {\n const falseEventName = (eventNameToString ? eventNameToString(eventName) : eventName) + FALSE_STR;\n const trueEventName = (eventNameToString ? eventNameToString(eventName) : eventName) + TRUE_STR;\n const symbol = ZONE_SYMBOL_PREFIX + falseEventName;\n const symbolCapture = ZONE_SYMBOL_PREFIX + trueEventName;\n zoneSymbolEventNames2[eventName] = {};\n zoneSymbolEventNames2[eventName][FALSE_STR] = symbol;\n zoneSymbolEventNames2[eventName][TRUE_STR] = symbolCapture;\n}\nfunction patchEventTarget(_global2, api, apis, patchOptions) {\n const ADD_EVENT_LISTENER = patchOptions && patchOptions.add || ADD_EVENT_LISTENER_STR;\n const REMOVE_EVENT_LISTENER = patchOptions && patchOptions.rm || REMOVE_EVENT_LISTENER_STR;\n const LISTENERS_EVENT_LISTENER = patchOptions && patchOptions.listeners || \"eventListeners\";\n const REMOVE_ALL_LISTENERS_EVENT_LISTENER = patchOptions && patchOptions.rmAll || \"removeAllListeners\";\n const zoneSymbolAddEventListener = zoneSymbol(ADD_EVENT_LISTENER);\n const ADD_EVENT_LISTENER_SOURCE = \".\" + ADD_EVENT_LISTENER + \":\";\n const PREPEND_EVENT_LISTENER = \"prependListener\";\n const PREPEND_EVENT_LISTENER_SOURCE = \".\" + PREPEND_EVENT_LISTENER + \":\";\n const invokeTask = function(task, target, event) {\n if (task.isRemoved) {\n return;\n }\n const delegate = task.callback;\n if (typeof delegate === \"object\" && delegate.handleEvent) {\n task.callback = (event2) => delegate.handleEvent(event2);\n task.originalDelegate = delegate;\n }\n let error;\n try {\n task.invoke(task, target, [event]);\n } catch (err) {\n error = err;\n }\n const options = task.options;\n if (options && typeof options === \"object\" && options.once) {\n const delegate2 = task.originalDelegate ? task.originalDelegate : task.callback;\n target[REMOVE_EVENT_LISTENER].call(target, event.type, delegate2, options);\n }\n return error;\n };\n function globalCallback(context, event, isCapture) {\n event = event || _global2.event;\n if (!event) {\n return;\n }\n const target = context || event.target || _global2;\n const tasks = target[zoneSymbolEventNames2[event.type][isCapture ? TRUE_STR : FALSE_STR]];\n if (tasks) {\n const errors = [];\n if (tasks.length === 1) {\n const err = invokeTask(tasks[0], target, event);\n err && errors.push(err);\n } else {\n const copyTasks = tasks.slice();\n for (let i = 0; i < copyTasks.length; i++) {\n if (event && event[IMMEDIATE_PROPAGATION_SYMBOL] === true) {\n break;\n }\n const err = invokeTask(copyTasks[i], target, event);\n err && errors.push(err);\n }\n }\n if (errors.length === 1) {\n throw errors[0];\n } else {\n for (let i = 0; i < errors.length; i++) {\n const err = errors[i];\n api.nativeScheduleMicroTask(() => {\n throw err;\n });\n }\n }\n }\n }\n const globalZoneAwareCallback = function(event) {\n return globalCallback(this, event, false);\n };\n const globalZoneAwareCaptureCallback = function(event) {\n return globalCallback(this, event, true);\n };\n function patchEventTargetMethods(obj, patchOptions2) {\n if (!obj) {\n return false;\n }\n let useGlobalCallback = true;\n if (patchOptions2 && patchOptions2.useG !== void 0) {\n useGlobalCallback = patchOptions2.useG;\n }\n const validateHandler = patchOptions2 && patchOptions2.vh;\n let checkDuplicate = true;\n if (patchOptions2 && patchOptions2.chkDup !== void 0) {\n checkDuplicate = patchOptions2.chkDup;\n }\n let returnTarget = false;\n if (patchOptions2 && patchOptions2.rt !== void 0) {\n returnTarget = patchOptions2.rt;\n }\n let proto = obj;\n while (proto && !proto.hasOwnProperty(ADD_EVENT_LISTENER)) {\n proto = ObjectGetPrototypeOf(proto);\n }\n if (!proto && obj[ADD_EVENT_LISTENER]) {\n proto = obj;\n }\n if (!proto) {\n return false;\n }\n if (proto[zoneSymbolAddEventListener]) {\n return false;\n }\n const eventNameToString = patchOptions2 && patchOptions2.eventNameToString;\n const taskData = {};\n const nativeAddEventListener = proto[zoneSymbolAddEventListener] = proto[ADD_EVENT_LISTENER];\n const nativeRemoveEventListener = proto[zoneSymbol(REMOVE_EVENT_LISTENER)] = proto[REMOVE_EVENT_LISTENER];\n const nativeListeners = proto[zoneSymbol(LISTENERS_EVENT_LISTENER)] = proto[LISTENERS_EVENT_LISTENER];\n const nativeRemoveAllListeners = proto[zoneSymbol(REMOVE_ALL_LISTENERS_EVENT_LISTENER)] = proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER];\n let nativePrependEventListener;\n if (patchOptions2 && patchOptions2.prepend) {\n nativePrependEventListener = proto[zoneSymbol(patchOptions2.prepend)] = proto[patchOptions2.prepend];\n }\n function buildEventListenerOptions(options, passive) {\n if (!passive) {\n return options;\n }\n if (typeof options === \"boolean\") {\n return { capture: options, passive: true };\n }\n if (!options) {\n return { passive: true };\n }\n if (typeof options === \"object\" && options.passive !== false) {\n return __spreadProps(__spreadValues({}, options), { passive: true });\n }\n return options;\n }\n const customScheduleGlobal = function(task) {\n if (taskData.isExisting) {\n return;\n }\n return nativeAddEventListener.call(taskData.target, taskData.eventName, taskData.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, taskData.options);\n };\n const customCancelGlobal = function(task) {\n if (!task.isRemoved) {\n const symbolEventNames = zoneSymbolEventNames2[task.eventName];\n let symbolEventName;\n if (symbolEventNames) {\n symbolEventName = symbolEventNames[task.capture ? TRUE_STR : FALSE_STR];\n }\n const existingTasks = symbolEventName && task.target[symbolEventName];\n if (existingTasks) {\n for (let i = 0; i < existingTasks.length; i++) {\n const existingTask = existingTasks[i];\n if (existingTask === task) {\n existingTasks.splice(i, 1);\n task.isRemoved = true;\n if (task.removeAbortListener) {\n task.removeAbortListener();\n task.removeAbortListener = null;\n }\n if (existingTasks.length === 0) {\n task.allRemoved = true;\n task.target[symbolEventName] = null;\n }\n break;\n }\n }\n }\n }\n if (!task.allRemoved) {\n return;\n }\n return nativeRemoveEventListener.call(task.target, task.eventName, task.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, task.options);\n };\n const customScheduleNonGlobal = function(task) {\n return nativeAddEventListener.call(taskData.target, taskData.eventName, task.invoke, taskData.options);\n };\n const customSchedulePrepend = function(task) {\n return nativePrependEventListener.call(taskData.target, taskData.eventName, task.invoke, taskData.options);\n };\n const customCancelNonGlobal = function(task) {\n return nativeRemoveEventListener.call(task.target, task.eventName, task.invoke, task.options);\n };\n const customSchedule = useGlobalCallback ? customScheduleGlobal : customScheduleNonGlobal;\n const customCancel = useGlobalCallback ? customCancelGlobal : customCancelNonGlobal;\n const compareTaskCallbackVsDelegate = function(task, delegate) {\n const typeOfDelegate = typeof delegate;\n return typeOfDelegate === \"function\" && task.callback === delegate || typeOfDelegate === \"object\" && task.originalDelegate === delegate;\n };\n const compare = (patchOptions2 == null ? void 0 : patchOptions2.diff) || compareTaskCallbackVsDelegate;\n const unpatchedEvents = Zone[zoneSymbol(\"UNPATCHED_EVENTS\")];\n const passiveEvents = _global2[zoneSymbol(\"PASSIVE_EVENTS\")];\n function copyEventListenerOptions(options) {\n if (typeof options === \"object\" && options !== null) {\n const newOptions = __spreadValues({}, options);\n if (options.signal) {\n newOptions.signal = options.signal;\n }\n return newOptions;\n }\n return options;\n }\n const makeAddListener = function(nativeListener, addSource, customScheduleFn, customCancelFn, returnTarget2 = false, prepend = false) {\n return function() {\n const target = this || _global2;\n let eventName = arguments[0];\n if (patchOptions2 && patchOptions2.transferEventName) {\n eventName = patchOptions2.transferEventName(eventName);\n }\n let delegate = arguments[1];\n if (!delegate) {\n return nativeListener.apply(this, arguments);\n }\n if (isNode && eventName === \"uncaughtException\") {\n return nativeListener.apply(this, arguments);\n }\n let isEventListenerObject = false;\n if (typeof delegate !== \"function\") {\n if (!delegate.handleEvent) {\n return nativeListener.apply(this, arguments);\n }\n isEventListenerObject = true;\n }\n if (validateHandler && !validateHandler(nativeListener, delegate, target, arguments)) {\n return;\n }\n const passive = !!passiveEvents && passiveEvents.indexOf(eventName) !== -1;\n const options = copyEventListenerOptions(buildEventListenerOptions(arguments[2], passive));\n const signal = options == null ? void 0 : options.signal;\n if (signal == null ? void 0 : signal.aborted) {\n return;\n }\n if (unpatchedEvents) {\n for (let i = 0; i < unpatchedEvents.length; i++) {\n if (eventName === unpatchedEvents[i]) {\n if (passive) {\n return nativeListener.call(target, eventName, delegate, options);\n } else {\n return nativeListener.apply(this, arguments);\n }\n }\n }\n }\n const capture = !options ? false : typeof options === \"boolean\" ? true : options.capture;\n const once = options && typeof options === \"object\" ? options.once : false;\n const zone = Zone.current;\n let symbolEventNames = zoneSymbolEventNames2[eventName];\n if (!symbolEventNames) {\n prepareEventNames(eventName, eventNameToString);\n symbolEventNames = zoneSymbolEventNames2[eventName];\n }\n const symbolEventName = symbolEventNames[capture ? TRUE_STR : FALSE_STR];\n let existingTasks = target[symbolEventName];\n let isExisting = false;\n if (existingTasks) {\n isExisting = true;\n if (checkDuplicate) {\n for (let i = 0; i < existingTasks.length; i++) {\n if (compare(existingTasks[i], delegate)) {\n return;\n }\n }\n }\n } else {\n existingTasks = target[symbolEventName] = [];\n }\n let source;\n const constructorName = target.constructor[\"name\"];\n const targetSource = globalSources[constructorName];\n if (targetSource) {\n source = targetSource[eventName];\n }\n if (!source) {\n source = constructorName + addSource + (eventNameToString ? eventNameToString(eventName) : eventName);\n }\n taskData.options = options;\n if (once) {\n taskData.options.once = false;\n }\n taskData.target = target;\n taskData.capture = capture;\n taskData.eventName = eventName;\n taskData.isExisting = isExisting;\n const data = useGlobalCallback ? OPTIMIZED_ZONE_EVENT_TASK_DATA : void 0;\n if (data) {\n data.taskData = taskData;\n }\n if (signal) {\n taskData.options.signal = void 0;\n }\n const task = zone.scheduleEventTask(source, delegate, data, customScheduleFn, customCancelFn);\n if (signal) {\n taskData.options.signal = signal;\n const onAbort = () => task.zone.cancelTask(task);\n nativeListener.call(signal, \"abort\", onAbort, { once: true });\n task.removeAbortListener = () => signal.removeEventListener(\"abort\", onAbort);\n }\n taskData.target = null;\n if (data) {\n data.taskData = null;\n }\n if (once) {\n taskData.options.once = true;\n }\n if (typeof task.options !== \"boolean\") {\n task.options = options;\n }\n task.target = target;\n task.capture = capture;\n task.eventName = eventName;\n if (isEventListenerObject) {\n task.originalDelegate = delegate;\n }\n if (!prepend) {\n existingTasks.push(task);\n } else {\n existingTasks.unshift(task);\n }\n if (returnTarget2) {\n return target;\n }\n };\n };\n proto[ADD_EVENT_LISTENER] = makeAddListener(nativeAddEventListener, ADD_EVENT_LISTENER_SOURCE, customSchedule, customCancel, returnTarget);\n if (nativePrependEventListener) {\n proto[PREPEND_EVENT_LISTENER] = makeAddListener(nativePrependEventListener, PREPEND_EVENT_LISTENER_SOURCE, customSchedulePrepend, customCancel, returnTarget, true);\n }\n proto[REMOVE_EVENT_LISTENER] = function() {\n const target = this || _global2;\n let eventName = arguments[0];\n if (patchOptions2 && patchOptions2.transferEventName) {\n eventName = patchOptions2.transferEventName(eventName);\n }\n const options = arguments[2];\n const capture = !options ? false : typeof options === \"boolean\" ? true : options.capture;\n const delegate = arguments[1];\n if (!delegate) {\n return nativeRemoveEventListener.apply(this, arguments);\n }\n if (validateHandler && !validateHandler(nativeRemoveEventListener, delegate, target, arguments)) {\n return;\n }\n const symbolEventNames = zoneSymbolEventNames2[eventName];\n let symbolEventName;\n if (symbolEventNames) {\n symbolEventName = symbolEventNames[capture ? TRUE_STR : FALSE_STR];\n }\n const existingTasks = symbolEventName && target[symbolEventName];\n if (existingTasks) {\n for (let i = 0; i < existingTasks.length; i++) {\n const existingTask = existingTasks[i];\n if (compare(existingTask, delegate)) {\n existingTasks.splice(i, 1);\n existingTask.isRemoved = true;\n if (existingTasks.length === 0) {\n existingTask.allRemoved = true;\n target[symbolEventName] = null;\n if (!capture && typeof eventName === \"string\") {\n const onPropertySymbol = ZONE_SYMBOL_PREFIX + \"ON_PROPERTY\" + eventName;\n target[onPropertySymbol] = null;\n }\n }\n existingTask.zone.cancelTask(existingTask);\n if (returnTarget) {\n return target;\n }\n return;\n }\n }\n }\n return nativeRemoveEventListener.apply(this, arguments);\n };\n proto[LISTENERS_EVENT_LISTENER] = function() {\n const target = this || _global2;\n let eventName = arguments[0];\n if (patchOptions2 && patchOptions2.transferEventName) {\n eventName = patchOptions2.transferEventName(eventName);\n }\n const listeners = [];\n const tasks = findEventTasks(target, eventNameToString ? eventNameToString(eventName) : eventName);\n for (let i = 0; i < tasks.length; i++) {\n const task = tasks[i];\n let delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n listeners.push(delegate);\n }\n return listeners;\n };\n proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER] = function() {\n const target = this || _global2;\n let eventName = arguments[0];\n if (!eventName) {\n const keys = Object.keys(target);\n for (let i = 0; i < keys.length; i++) {\n const prop = keys[i];\n const match = EVENT_NAME_SYMBOL_REGX.exec(prop);\n let evtName = match && match[1];\n if (evtName && evtName !== \"removeListener\") {\n this[REMOVE_ALL_LISTENERS_EVENT_LISTENER].call(this, evtName);\n }\n }\n this[REMOVE_ALL_LISTENERS_EVENT_LISTENER].call(this, \"removeListener\");\n } else {\n if (patchOptions2 && patchOptions2.transferEventName) {\n eventName = patchOptions2.transferEventName(eventName);\n }\n const symbolEventNames = zoneSymbolEventNames2[eventName];\n if (symbolEventNames) {\n const symbolEventName = symbolEventNames[FALSE_STR];\n const symbolCaptureEventName = symbolEventNames[TRUE_STR];\n const tasks = target[symbolEventName];\n const captureTasks = target[symbolCaptureEventName];\n if (tasks) {\n const removeTasks = tasks.slice();\n for (let i = 0; i < removeTasks.length; i++) {\n const task = removeTasks[i];\n let delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n this[REMOVE_EVENT_LISTENER].call(this, eventName, delegate, task.options);\n }\n }\n if (captureTasks) {\n const removeTasks = captureTasks.slice();\n for (let i = 0; i < removeTasks.length; i++) {\n const task = removeTasks[i];\n let delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n this[REMOVE_EVENT_LISTENER].call(this, eventName, delegate, task.options);\n }\n }\n }\n }\n if (returnTarget) {\n return this;\n }\n };\n attachOriginToPatched(proto[ADD_EVENT_LISTENER], nativeAddEventListener);\n attachOriginToPatched(proto[REMOVE_EVENT_LISTENER], nativeRemoveEventListener);\n if (nativeRemoveAllListeners) {\n attachOriginToPatched(proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER], nativeRemoveAllListeners);\n }\n if (nativeListeners) {\n attachOriginToPatched(proto[LISTENERS_EVENT_LISTENER], nativeListeners);\n }\n return true;\n }\n let results = [];\n for (let i = 0; i < apis.length; i++) {\n results[i] = patchEventTargetMethods(apis[i], patchOptions);\n }\n return results;\n}\nfunction findEventTasks(target, eventName) {\n if (!eventName) {\n const foundTasks = [];\n for (let prop in target) {\n const match = EVENT_NAME_SYMBOL_REGX.exec(prop);\n let evtName = match && match[1];\n if (evtName && (!eventName || evtName === eventName)) {\n const tasks = target[prop];\n if (tasks) {\n for (let i = 0; i < tasks.length; i++) {\n foundTasks.push(tasks[i]);\n }\n }\n }\n }\n return foundTasks;\n }\n let symbolEventName = zoneSymbolEventNames2[eventName];\n if (!symbolEventName) {\n prepareEventNames(eventName);\n symbolEventName = zoneSymbolEventNames2[eventName];\n }\n const captureFalseTasks = target[symbolEventName[FALSE_STR]];\n const captureTrueTasks = target[symbolEventName[TRUE_STR]];\n if (!captureFalseTasks) {\n return captureTrueTasks ? captureTrueTasks.slice() : [];\n } else {\n return captureTrueTasks ? captureFalseTasks.concat(captureTrueTasks) : captureFalseTasks.slice();\n }\n}\nfunction patchEventPrototype(global2, api) {\n const Event = global2[\"Event\"];\n if (Event && Event.prototype) {\n api.patchMethod(Event.prototype, \"stopImmediatePropagation\", (delegate) => function(self2, args) {\n self2[IMMEDIATE_PROPAGATION_SYMBOL] = true;\n delegate && delegate.apply(self2, args);\n });\n }\n}\n\n// packages/zone.js/lib/common/queue-microtask.js\nfunction patchQueueMicrotask(global2, api) {\n api.patchMethod(global2, \"queueMicrotask\", (delegate) => {\n return function(self2, args) {\n Zone.current.scheduleMicroTask(\"queueMicrotask\", args[0]);\n };\n });\n}\n\n// packages/zone.js/lib/common/timers.js\nvar taskSymbol = zoneSymbol(\"zoneTask\");\nfunction patchTimer(window2, setName, cancelName, nameSuffix) {\n let setNative = null;\n let clearNative = null;\n setName += nameSuffix;\n cancelName += nameSuffix;\n const tasksByHandleId = {};\n function scheduleTask(task) {\n const data = task.data;\n data.args[0] = function() {\n return task.invoke.apply(this, arguments);\n };\n const handleOrId = setNative.apply(window2, data.args);\n if (isNumber(handleOrId)) {\n data.handleId = handleOrId;\n } else {\n data.handle = handleOrId;\n data.isRefreshable = isFunction(handleOrId.refresh);\n }\n return task;\n }\n function clearTask(task) {\n const { handle, handleId } = task.data;\n return clearNative.call(window2, handle != null ? handle : handleId);\n }\n setNative = patchMethod(window2, setName, (delegate) => function(self2, args) {\n var _a;\n if (isFunction(args[0])) {\n const options = {\n isRefreshable: false,\n isPeriodic: nameSuffix === \"Interval\",\n delay: nameSuffix === \"Timeout\" || nameSuffix === \"Interval\" ? args[1] || 0 : void 0,\n args\n };\n const callback = args[0];\n args[0] = function timer() {\n try {\n return callback.apply(this, arguments);\n } finally {\n const { handle: handle2, handleId: handleId2, isPeriodic: isPeriodic2, isRefreshable: isRefreshable2 } = options;\n if (!isPeriodic2 && !isRefreshable2) {\n if (handleId2) {\n delete tasksByHandleId[handleId2];\n } else if (handle2) {\n handle2[taskSymbol] = null;\n }\n }\n }\n };\n const task = scheduleMacroTaskWithCurrentZone(setName, args[0], options, scheduleTask, clearTask);\n if (!task) {\n return task;\n }\n const { handleId, handle, isRefreshable, isPeriodic } = task.data;\n if (handleId) {\n tasksByHandleId[handleId] = task;\n } else if (handle) {\n handle[taskSymbol] = task;\n if (isRefreshable && !isPeriodic) {\n const originalRefresh = handle.refresh;\n handle.refresh = function() {\n const { zone, state } = task;\n if (state === \"notScheduled\") {\n task._state = \"scheduled\";\n zone._updateTaskCount(task, 1);\n } else if (state === \"running\") {\n task._state = \"scheduling\";\n }\n return originalRefresh.call(this);\n };\n }\n }\n return (_a = handle != null ? handle : handleId) != null ? _a : task;\n } else {\n return delegate.apply(window2, args);\n }\n });\n clearNative = patchMethod(window2, cancelName, (delegate) => function(self2, args) {\n const id = args[0];\n let task;\n if (isNumber(id)) {\n task = tasksByHandleId[id];\n delete tasksByHandleId[id];\n } else {\n task = id == null ? void 0 : id[taskSymbol];\n if (task) {\n id[taskSymbol] = null;\n } else {\n task = id;\n }\n }\n if (task == null ? void 0 : task.type) {\n if (task.cancelFn) {\n task.zone.cancelTask(task);\n }\n } else {\n delegate.apply(window2, args);\n }\n });\n}\n\n// packages/zone.js/lib/browser/custom-elements.js\nfunction patchCustomElements(_global2, api) {\n const { isBrowser: isBrowser2, isMix: isMix2 } = api.getGlobalObjects();\n if (!isBrowser2 && !isMix2 || !_global2[\"customElements\"] || !(\"customElements\" in _global2)) {\n return;\n }\n const callbacks = [\n \"connectedCallback\",\n \"disconnectedCallback\",\n \"adoptedCallback\",\n \"attributeChangedCallback\",\n \"formAssociatedCallback\",\n \"formDisabledCallback\",\n \"formResetCallback\",\n \"formStateRestoreCallback\"\n ];\n api.patchCallbacks(api, _global2.customElements, \"customElements\", \"define\", callbacks);\n}\n\n// packages/zone.js/lib/browser/event-target.js\nfunction eventTargetPatch(_global2, api) {\n if (Zone[api.symbol(\"patchEventTarget\")]) {\n return;\n }\n const { eventNames, zoneSymbolEventNames: zoneSymbolEventNames3, TRUE_STR: TRUE_STR2, FALSE_STR: FALSE_STR2, ZONE_SYMBOL_PREFIX: ZONE_SYMBOL_PREFIX2 } = api.getGlobalObjects();\n for (let i = 0; i < eventNames.length; i++) {\n const eventName = eventNames[i];\n const falseEventName = eventName + FALSE_STR2;\n const trueEventName = eventName + TRUE_STR2;\n const symbol = ZONE_SYMBOL_PREFIX2 + falseEventName;\n const symbolCapture = ZONE_SYMBOL_PREFIX2 + trueEventName;\n zoneSymbolEventNames3[eventName] = {};\n zoneSymbolEventNames3[eventName][FALSE_STR2] = symbol;\n zoneSymbolEventNames3[eventName][TRUE_STR2] = symbolCapture;\n }\n const EVENT_TARGET = _global2[\"EventTarget\"];\n if (!EVENT_TARGET || !EVENT_TARGET.prototype) {\n return;\n }\n api.patchEventTarget(_global2, api, [EVENT_TARGET && EVENT_TARGET.prototype]);\n return true;\n}\nfunction patchEvent(global2, api) {\n api.patchEventPrototype(global2, api);\n}\n\n// packages/zone.js/lib/browser/property-descriptor.js\nfunction filterProperties(target, onProperties, ignoreProperties) {\n if (!ignoreProperties || ignoreProperties.length === 0) {\n return onProperties;\n }\n const tip = ignoreProperties.filter((ip) => ip.target === target);\n if (tip.length === 0) {\n return onProperties;\n }\n const targetIgnoreProperties = tip[0].ignoreProperties;\n return onProperties.filter((op) => targetIgnoreProperties.indexOf(op) === -1);\n}\nfunction patchFilteredProperties(target, onProperties, ignoreProperties, prototype) {\n if (!target) {\n return;\n }\n const filteredProperties = filterProperties(target, onProperties, ignoreProperties);\n patchOnProperties(target, filteredProperties, prototype);\n}\nfunction getOnEventNames(target) {\n return Object.getOwnPropertyNames(target).filter((name) => name.startsWith(\"on\") && name.length > 2).map((name) => name.substring(2));\n}\nfunction propertyDescriptorPatch(api, _global2) {\n if (isNode && !isMix) {\n return;\n }\n if (Zone[api.symbol(\"patchEvents\")]) {\n return;\n }\n const ignoreProperties = _global2[\"__Zone_ignore_on_properties\"];\n let patchTargets = [];\n if (isBrowser) {\n const internalWindow2 = window;\n patchTargets = patchTargets.concat([\n \"Document\",\n \"SVGElement\",\n \"Element\",\n \"HTMLElement\",\n \"HTMLBodyElement\",\n \"HTMLMediaElement\",\n \"HTMLFrameSetElement\",\n \"HTMLFrameElement\",\n \"HTMLIFrameElement\",\n \"HTMLMarqueeElement\",\n \"Worker\"\n ]);\n patchFilteredProperties(internalWindow2, getOnEventNames(internalWindow2), ignoreProperties, ObjectGetPrototypeOf(internalWindow2));\n }\n patchTargets = patchTargets.concat([\n \"XMLHttpRequest\",\n \"XMLHttpRequestEventTarget\",\n \"IDBIndex\",\n \"IDBRequest\",\n \"IDBOpenDBRequest\",\n \"IDBDatabase\",\n \"IDBTransaction\",\n \"IDBCursor\",\n \"WebSocket\"\n ]);\n for (let i = 0; i < patchTargets.length; i++) {\n const target = _global2[patchTargets[i]];\n (target == null ? void 0 : target.prototype) && patchFilteredProperties(target.prototype, getOnEventNames(target.prototype), ignoreProperties);\n }\n}\n\n// packages/zone.js/lib/browser/browser.js\nfunction patchBrowser(Zone3) {\n Zone3.__load_patch(\"timers\", (global2) => {\n const set = \"set\";\n const clear = \"clear\";\n patchTimer(global2, set, clear, \"Timeout\");\n patchTimer(global2, set, clear, \"Interval\");\n patchTimer(global2, set, clear, \"Immediate\");\n });\n Zone3.__load_patch(\"requestAnimationFrame\", (global2) => {\n patchTimer(global2, \"request\", \"cancel\", \"AnimationFrame\");\n patchTimer(global2, \"mozRequest\", \"mozCancel\", \"AnimationFrame\");\n patchTimer(global2, \"webkitRequest\", \"webkitCancel\", \"AnimationFrame\");\n });\n Zone3.__load_patch(\"blocking\", (global2, Zone4) => {\n const blockingMethods = [\"alert\", \"prompt\", \"confirm\"];\n for (let i = 0; i < blockingMethods.length; i++) {\n const name = blockingMethods[i];\n patchMethod(global2, name, (delegate, symbol, name2) => {\n return function(s, args) {\n return Zone4.current.run(delegate, global2, args, name2);\n };\n });\n }\n });\n Zone3.__load_patch(\"EventTarget\", (global2, Zone4, api) => {\n patchEvent(global2, api);\n eventTargetPatch(global2, api);\n const XMLHttpRequestEventTarget = global2[\"XMLHttpRequestEventTarget\"];\n if (XMLHttpRequestEventTarget && XMLHttpRequestEventTarget.prototype) {\n api.patchEventTarget(global2, api, [XMLHttpRequestEventTarget.prototype]);\n }\n });\n Zone3.__load_patch(\"MutationObserver\", (global2, Zone4, api) => {\n patchClass(\"MutationObserver\");\n patchClass(\"WebKitMutationObserver\");\n });\n Zone3.__load_patch(\"IntersectionObserver\", (global2, Zone4, api) => {\n patchClass(\"IntersectionObserver\");\n });\n Zone3.__load_patch(\"FileReader\", (global2, Zone4, api) => {\n patchClass(\"FileReader\");\n });\n Zone3.__load_patch(\"on_property\", (global2, Zone4, api) => {\n propertyDescriptorPatch(api, global2);\n });\n Zone3.__load_patch(\"customElements\", (global2, Zone4, api) => {\n patchCustomElements(global2, api);\n });\n Zone3.__load_patch(\"XHR\", (global2, Zone4) => {\n patchXHR(global2);\n const XHR_TASK = zoneSymbol(\"xhrTask\");\n const XHR_SYNC = zoneSymbol(\"xhrSync\");\n const XHR_LISTENER = zoneSymbol(\"xhrListener\");\n const XHR_SCHEDULED = zoneSymbol(\"xhrScheduled\");\n const XHR_URL = zoneSymbol(\"xhrURL\");\n const XHR_ERROR_BEFORE_SCHEDULED = zoneSymbol(\"xhrErrorBeforeScheduled\");\n function patchXHR(window2) {\n const XMLHttpRequest = window2[\"XMLHttpRequest\"];\n if (!XMLHttpRequest) {\n return;\n }\n const XMLHttpRequestPrototype = XMLHttpRequest.prototype;\n function findPendingTask(target) {\n return target[XHR_TASK];\n }\n let oriAddListener = XMLHttpRequestPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER];\n let oriRemoveListener = XMLHttpRequestPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];\n if (!oriAddListener) {\n const XMLHttpRequestEventTarget = window2[\"XMLHttpRequestEventTarget\"];\n if (XMLHttpRequestEventTarget) {\n const XMLHttpRequestEventTargetPrototype = XMLHttpRequestEventTarget.prototype;\n oriAddListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER];\n oriRemoveListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];\n }\n }\n const READY_STATE_CHANGE = \"readystatechange\";\n const SCHEDULED = \"scheduled\";\n function scheduleTask(task) {\n const data = task.data;\n const target = data.target;\n target[XHR_SCHEDULED] = false;\n target[XHR_ERROR_BEFORE_SCHEDULED] = false;\n const listener = target[XHR_LISTENER];\n if (!oriAddListener) {\n oriAddListener = target[ZONE_SYMBOL_ADD_EVENT_LISTENER];\n oriRemoveListener = target[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];\n }\n if (listener) {\n oriRemoveListener.call(target, READY_STATE_CHANGE, listener);\n }\n const newListener = target[XHR_LISTENER] = () => {\n if (target.readyState === target.DONE) {\n if (!data.aborted && target[XHR_SCHEDULED] && task.state === SCHEDULED) {\n const loadTasks = target[Zone4.__symbol__(\"loadfalse\")];\n if (target.status !== 0 && loadTasks && loadTasks.length > 0) {\n const oriInvoke = task.invoke;\n task.invoke = function() {\n const loadTasks2 = target[Zone4.__symbol__(\"loadfalse\")];\n for (let i = 0; i < loadTasks2.length; i++) {\n if (loadTasks2[i] === task) {\n loadTasks2.splice(i, 1);\n }\n }\n if (!data.aborted && task.state === SCHEDULED) {\n oriInvoke.call(task);\n }\n };\n loadTasks.push(task);\n } else {\n task.invoke();\n }\n } else if (!data.aborted && target[XHR_SCHEDULED] === false) {\n target[XHR_ERROR_BEFORE_SCHEDULED] = true;\n }\n }\n };\n oriAddListener.call(target, READY_STATE_CHANGE, newListener);\n const storedTask = target[XHR_TASK];\n if (!storedTask) {\n target[XHR_TASK] = task;\n }\n sendNative.apply(target, data.args);\n target[XHR_SCHEDULED] = true;\n return task;\n }\n function placeholderCallback() {\n }\n function clearTask(task) {\n const data = task.data;\n data.aborted = true;\n return abortNative.apply(data.target, data.args);\n }\n const openNative = patchMethod(XMLHttpRequestPrototype, \"open\", () => function(self2, args) {\n self2[XHR_SYNC] = args[2] == false;\n self2[XHR_URL] = args[1];\n return openNative.apply(self2, args);\n });\n const XMLHTTPREQUEST_SOURCE = \"XMLHttpRequest.send\";\n const fetchTaskAborting = zoneSymbol(\"fetchTaskAborting\");\n const fetchTaskScheduling = zoneSymbol(\"fetchTaskScheduling\");\n const sendNative = patchMethod(XMLHttpRequestPrototype, \"send\", () => function(self2, args) {\n if (Zone4.current[fetchTaskScheduling] === true) {\n return sendNative.apply(self2, args);\n }\n if (self2[XHR_SYNC]) {\n return sendNative.apply(self2, args);\n } else {\n const options = {\n target: self2,\n url: self2[XHR_URL],\n isPeriodic: false,\n args,\n aborted: false\n };\n const task = scheduleMacroTaskWithCurrentZone(XMLHTTPREQUEST_SOURCE, placeholderCallback, options, scheduleTask, clearTask);\n if (self2 && self2[XHR_ERROR_BEFORE_SCHEDULED] === true && !options.aborted && task.state === SCHEDULED) {\n task.invoke();\n }\n }\n });\n const abortNative = patchMethod(XMLHttpRequestPrototype, \"abort\", () => function(self2, args) {\n const task = findPendingTask(self2);\n if (task && typeof task.type == \"string\") {\n if (task.cancelFn == null || task.data && task.data.aborted) {\n return;\n }\n task.zone.cancelTask(task);\n } else if (Zone4.current[fetchTaskAborting] === true) {\n return abortNative.apply(self2, args);\n }\n });\n }\n });\n Zone3.__load_patch(\"geolocation\", (global2) => {\n if (global2[\"navigator\"] && global2[\"navigator\"].geolocation) {\n patchPrototype(global2[\"navigator\"].geolocation, [\"getCurrentPosition\", \"watchPosition\"]);\n }\n });\n Zone3.__load_patch(\"PromiseRejectionEvent\", (global2, Zone4) => {\n function findPromiseRejectionHandler(evtName) {\n return function(e) {\n const eventTasks = findEventTasks(global2, evtName);\n eventTasks.forEach((eventTask) => {\n const PromiseRejectionEvent = global2[\"PromiseRejectionEvent\"];\n if (PromiseRejectionEvent) {\n const evt = new PromiseRejectionEvent(evtName, {\n promise: e.promise,\n reason: e.rejection\n });\n eventTask.invoke(evt);\n }\n });\n };\n }\n if (global2[\"PromiseRejectionEvent\"]) {\n Zone4[zoneSymbol(\"unhandledPromiseRejectionHandler\")] = findPromiseRejectionHandler(\"unhandledrejection\");\n Zone4[zoneSymbol(\"rejectionHandledHandler\")] = findPromiseRejectionHandler(\"rejectionhandled\");\n }\n });\n Zone3.__load_patch(\"queueMicrotask\", (global2, Zone4, api) => {\n patchQueueMicrotask(global2, api);\n });\n}\n\n// packages/zone.js/lib/common/promise.js\nfunction patchPromise(Zone3) {\n Zone3.__load_patch(\"ZoneAwarePromise\", (global2, Zone4, api) => {\n const ObjectGetOwnPropertyDescriptor2 = Object.getOwnPropertyDescriptor;\n const ObjectDefineProperty2 = Object.defineProperty;\n function readableObjectToString(obj) {\n if (obj && obj.toString === Object.prototype.toString) {\n const className = obj.constructor && obj.constructor.name;\n return (className ? className : \"\") + \": \" + JSON.stringify(obj);\n }\n return obj ? obj.toString() : Object.prototype.toString.call(obj);\n }\n const __symbol__2 = api.symbol;\n const _uncaughtPromiseErrors = [];\n const isDisableWrappingUncaughtPromiseRejection = global2[__symbol__2(\"DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION\")] !== false;\n const symbolPromise = __symbol__2(\"Promise\");\n const symbolThen = __symbol__2(\"then\");\n const creationTrace = \"__creationTrace__\";\n api.onUnhandledError = (e) => {\n if (api.showUncaughtError()) {\n const rejection = e && e.rejection;\n if (rejection) {\n console.error(\"Unhandled Promise rejection:\", rejection instanceof Error ? rejection.message : rejection, \"; Zone:\", e.zone.name, \"; Task:\", e.task && e.task.source, \"; Value:\", rejection, rejection instanceof Error ? rejection.stack : void 0);\n } else {\n console.error(e);\n }\n }\n };\n api.microtaskDrainDone = () => {\n while (_uncaughtPromiseErrors.length) {\n const uncaughtPromiseError = _uncaughtPromiseErrors.shift();\n try {\n uncaughtPromiseError.zone.runGuarded(() => {\n if (uncaughtPromiseError.throwOriginal) {\n throw uncaughtPromiseError.rejection;\n }\n throw uncaughtPromiseError;\n });\n } catch (error) {\n handleUnhandledRejection(error);\n }\n }\n };\n const UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL = __symbol__2(\"unhandledPromiseRejectionHandler\");\n function handleUnhandledRejection(e) {\n api.onUnhandledError(e);\n try {\n const handler = Zone4[UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL];\n if (typeof handler === \"function\") {\n handler.call(this, e);\n }\n } catch (err) {\n }\n }\n function isThenable(value) {\n return value && typeof value.then === \"function\";\n }\n function forwardResolution(value) {\n return value;\n }\n function forwardRejection(rejection) {\n return ZoneAwarePromise.reject(rejection);\n }\n const symbolState = __symbol__2(\"state\");\n const symbolValue = __symbol__2(\"value\");\n const symbolFinally = __symbol__2(\"finally\");\n const symbolParentPromiseValue = __symbol__2(\"parentPromiseValue\");\n const symbolParentPromiseState = __symbol__2(\"parentPromiseState\");\n const source = \"Promise.then\";\n const UNRESOLVED = null;\n const RESOLVED = true;\n const REJECTED = false;\n const REJECTED_NO_CATCH = 0;\n function makeResolver(promise, state) {\n return (v) => {\n try {\n resolvePromise(promise, state, v);\n } catch (err) {\n resolvePromise(promise, false, err);\n }\n };\n }\n const once = function() {\n let wasCalled = false;\n return function wrapper(wrappedFunction) {\n return function() {\n if (wasCalled) {\n return;\n }\n wasCalled = true;\n wrappedFunction.apply(null, arguments);\n };\n };\n };\n const TYPE_ERROR = \"Promise resolved with itself\";\n const CURRENT_TASK_TRACE_SYMBOL = __symbol__2(\"currentTaskTrace\");\n function resolvePromise(promise, state, value) {\n const onceWrapper = once();\n if (promise === value) {\n throw new TypeError(TYPE_ERROR);\n }\n if (promise[symbolState] === UNRESOLVED) {\n let then = null;\n try {\n if (typeof value === \"object\" || typeof value === \"function\") {\n then = value && value.then;\n }\n } catch (err) {\n onceWrapper(() => {\n resolvePromise(promise, false, err);\n })();\n return promise;\n }\n if (state !== REJECTED && value instanceof ZoneAwarePromise && value.hasOwnProperty(symbolState) && value.hasOwnProperty(symbolValue) && value[symbolState] !== UNRESOLVED) {\n clearRejectedNoCatch(value);\n resolvePromise(promise, value[symbolState], value[symbolValue]);\n } else if (state !== REJECTED && typeof then === \"function\") {\n try {\n then.call(value, onceWrapper(makeResolver(promise, state)), onceWrapper(makeResolver(promise, false)));\n } catch (err) {\n onceWrapper(() => {\n resolvePromise(promise, false, err);\n })();\n }\n } else {\n promise[symbolState] = state;\n const queue = promise[symbolValue];\n promise[symbolValue] = value;\n if (promise[symbolFinally] === symbolFinally) {\n if (state === RESOLVED) {\n promise[symbolState] = promise[symbolParentPromiseState];\n promise[symbolValue] = promise[symbolParentPromiseValue];\n }\n }\n if (state === REJECTED && value instanceof Error) {\n const trace = Zone4.currentTask && Zone4.currentTask.data && Zone4.currentTask.data[creationTrace];\n if (trace) {\n ObjectDefineProperty2(value, CURRENT_TASK_TRACE_SYMBOL, {\n configurable: true,\n enumerable: false,\n writable: true,\n value: trace\n });\n }\n }\n for (let i = 0; i < queue.length; ) {\n scheduleResolveOrReject(promise, queue[i++], queue[i++], queue[i++], queue[i++]);\n }\n if (queue.length == 0 && state == REJECTED) {\n promise[symbolState] = REJECTED_NO_CATCH;\n let uncaughtPromiseError = value;\n try {\n throw new Error(\"Uncaught (in promise): \" + readableObjectToString(value) + (value && value.stack ? \"\\n\" + value.stack : \"\"));\n } catch (err) {\n uncaughtPromiseError = err;\n }\n if (isDisableWrappingUncaughtPromiseRejection) {\n uncaughtPromiseError.throwOriginal = true;\n }\n uncaughtPromiseError.rejection = value;\n uncaughtPromiseError.promise = promise;\n uncaughtPromiseError.zone = Zone4.current;\n uncaughtPromiseError.task = Zone4.currentTask;\n _uncaughtPromiseErrors.push(uncaughtPromiseError);\n api.scheduleMicroTask();\n }\n }\n }\n return promise;\n }\n const REJECTION_HANDLED_HANDLER = __symbol__2(\"rejectionHandledHandler\");\n function clearRejectedNoCatch(promise) {\n if (promise[symbolState] === REJECTED_NO_CATCH) {\n try {\n const handler = Zone4[REJECTION_HANDLED_HANDLER];\n if (handler && typeof handler === \"function\") {\n handler.call(this, { rejection: promise[symbolValue], promise });\n }\n } catch (err) {\n }\n promise[symbolState] = REJECTED;\n for (let i = 0; i < _uncaughtPromiseErrors.length; i++) {\n if (promise === _uncaughtPromiseErrors[i].promise) {\n _uncaughtPromiseErrors.splice(i, 1);\n }\n }\n }\n }\n function scheduleResolveOrReject(promise, zone, chainPromise, onFulfilled, onRejected) {\n clearRejectedNoCatch(promise);\n const promiseState = promise[symbolState];\n const delegate = promiseState ? typeof onFulfilled === \"function\" ? onFulfilled : forwardResolution : typeof onRejected === \"function\" ? onRejected : forwardRejection;\n zone.scheduleMicroTask(source, () => {\n try {\n const parentPromiseValue = promise[symbolValue];\n const isFinallyPromise = !!chainPromise && symbolFinally === chainPromise[symbolFinally];\n if (isFinallyPromise) {\n chainPromise[symbolParentPromiseValue] = parentPromiseValue;\n chainPromise[symbolParentPromiseState] = promiseState;\n }\n const value = zone.run(delegate, void 0, isFinallyPromise && delegate !== forwardRejection && delegate !== forwardResolution ? [] : [parentPromiseValue]);\n resolvePromise(chainPromise, true, value);\n } catch (error) {\n resolvePromise(chainPromise, false, error);\n }\n }, chainPromise);\n }\n const ZONE_AWARE_PROMISE_TO_STRING = \"function ZoneAwarePromise() { [native code] }\";\n const noop = function() {\n };\n const AggregateError = global2.AggregateError;\n class ZoneAwarePromise {\n static toString() {\n return ZONE_AWARE_PROMISE_TO_STRING;\n }\n static resolve(value) {\n if (value instanceof ZoneAwarePromise) {\n return value;\n }\n return resolvePromise(new this(null), RESOLVED, value);\n }\n static reject(error) {\n return resolvePromise(new this(null), REJECTED, error);\n }\n static withResolvers() {\n const result = {};\n result.promise = new ZoneAwarePromise((res, rej) => {\n result.resolve = res;\n result.reject = rej;\n });\n return result;\n }\n static any(values) {\n if (!values || typeof values[Symbol.iterator] !== \"function\") {\n return Promise.reject(new AggregateError([], \"All promises were rejected\"));\n }\n const promises = [];\n let count = 0;\n try {\n for (let v of values) {\n count++;\n promises.push(ZoneAwarePromise.resolve(v));\n }\n } catch (err) {\n return Promise.reject(new AggregateError([], \"All promises were rejected\"));\n }\n if (count === 0) {\n return Promise.reject(new AggregateError([], \"All promises were rejected\"));\n }\n let finished = false;\n const errors = [];\n return new ZoneAwarePromise((resolve, reject) => {\n for (let i = 0; i < promises.length; i++) {\n promises[i].then((v) => {\n if (finished) {\n return;\n }\n finished = true;\n resolve(v);\n }, (err) => {\n errors.push(err);\n count--;\n if (count === 0) {\n finished = true;\n reject(new AggregateError(errors, \"All promises were rejected\"));\n }\n });\n }\n });\n }\n static race(values) {\n let resolve;\n let reject;\n let promise = new this((res, rej) => {\n resolve = res;\n reject = rej;\n });\n function onResolve(value) {\n resolve(value);\n }\n function onReject(error) {\n reject(error);\n }\n for (let value of values) {\n if (!isThenable(value)) {\n value = this.resolve(value);\n }\n value.then(onResolve, onReject);\n }\n return promise;\n }\n static all(values) {\n return ZoneAwarePromise.allWithCallback(values);\n }\n static allSettled(values) {\n const P = this && this.prototype instanceof ZoneAwarePromise ? this : ZoneAwarePromise;\n return P.allWithCallback(values, {\n thenCallback: (value) => ({ status: \"fulfilled\", value }),\n errorCallback: (err) => ({ status: \"rejected\", reason: err })\n });\n }\n static allWithCallback(values, callback) {\n let resolve;\n let reject;\n let promise = new this((res, rej) => {\n resolve = res;\n reject = rej;\n });\n let unresolvedCount = 2;\n let valueIndex = 0;\n const resolvedValues = [];\n for (let value of values) {\n if (!isThenable(value)) {\n value = this.resolve(value);\n }\n const curValueIndex = valueIndex;\n try {\n value.then((value2) => {\n resolvedValues[curValueIndex] = callback ? callback.thenCallback(value2) : value2;\n unresolvedCount--;\n if (unresolvedCount === 0) {\n resolve(resolvedValues);\n }\n }, (err) => {\n if (!callback) {\n reject(err);\n } else {\n resolvedValues[curValueIndex] = callback.errorCallback(err);\n unresolvedCount--;\n if (unresolvedCount === 0) {\n resolve(resolvedValues);\n }\n }\n });\n } catch (thenErr) {\n reject(thenErr);\n }\n unresolvedCount++;\n valueIndex++;\n }\n unresolvedCount -= 2;\n if (unresolvedCount === 0) {\n resolve(resolvedValues);\n }\n return promise;\n }\n constructor(executor) {\n const promise = this;\n if (!(promise instanceof ZoneAwarePromise)) {\n throw new Error(\"Must be an instanceof Promise.\");\n }\n promise[symbolState] = UNRESOLVED;\n promise[symbolValue] = [];\n try {\n const onceWrapper = once();\n executor && executor(onceWrapper(makeResolver(promise, RESOLVED)), onceWrapper(makeResolver(promise, REJECTED)));\n } catch (error) {\n resolvePromise(promise, false, error);\n }\n }\n get [Symbol.toStringTag]() {\n return \"Promise\";\n }\n get [Symbol.species]() {\n return ZoneAwarePromise;\n }\n then(onFulfilled, onRejected) {\n var _a;\n let C = (_a = this.constructor) == null ? void 0 : _a[Symbol.species];\n if (!C || typeof C !== \"function\") {\n C = this.constructor || ZoneAwarePromise;\n }\n const chainPromise = new C(noop);\n const zone = Zone4.current;\n if (this[symbolState] == UNRESOLVED) {\n this[symbolValue].push(zone, chainPromise, onFulfilled, onRejected);\n } else {\n scheduleResolveOrReject(this, zone, chainPromise, onFulfilled, onRejected);\n }\n return chainPromise;\n }\n catch(onRejected) {\n return this.then(null, onRejected);\n }\n finally(onFinally) {\n var _a;\n let C = (_a = this.constructor) == null ? void 0 : _a[Symbol.species];\n if (!C || typeof C !== \"function\") {\n C = ZoneAwarePromise;\n }\n const chainPromise = new C(noop);\n chainPromise[symbolFinally] = symbolFinally;\n const zone = Zone4.current;\n if (this[symbolState] == UNRESOLVED) {\n this[symbolValue].push(zone, chainPromise, onFinally, onFinally);\n } else {\n scheduleResolveOrReject(this, zone, chainPromise, onFinally, onFinally);\n }\n return chainPromise;\n }\n }\n ZoneAwarePromise[\"resolve\"] = ZoneAwarePromise.resolve;\n ZoneAwarePromise[\"reject\"] = ZoneAwarePromise.reject;\n ZoneAwarePromise[\"race\"] = ZoneAwarePromise.race;\n ZoneAwarePromise[\"all\"] = ZoneAwarePromise.all;\n const NativePromise = global2[symbolPromise] = global2[\"Promise\"];\n global2[\"Promise\"] = ZoneAwarePromise;\n const symbolThenPatched = __symbol__2(\"thenPatched\");\n function patchThen(Ctor) {\n const proto = Ctor.prototype;\n const prop = ObjectGetOwnPropertyDescriptor2(proto, \"then\");\n if (prop && (prop.writable === false || !prop.configurable)) {\n return;\n }\n const originalThen = proto.then;\n proto[symbolThen] = originalThen;\n Ctor.prototype.then = function(onResolve, onReject) {\n const wrapped = new ZoneAwarePromise((resolve, reject) => {\n originalThen.call(this, resolve, reject);\n });\n return wrapped.then(onResolve, onReject);\n };\n Ctor[symbolThenPatched] = true;\n }\n api.patchThen = patchThen;\n function zoneify(fn) {\n return function(self2, args) {\n let resultPromise = fn.apply(self2, args);\n if (resultPromise instanceof ZoneAwarePromise) {\n return resultPromise;\n }\n let ctor = resultPromise.constructor;\n if (!ctor[symbolThenPatched]) {\n patchThen(ctor);\n }\n return resultPromise;\n };\n }\n if (NativePromise) {\n patchThen(NativePromise);\n const nativeTry = NativePromise[\"try\"];\n if (nativeTry && typeof nativeTry === \"function\") {\n ZoneAwarePromise[\"try\"] = nativeTry;\n }\n patchMethod(global2, \"fetch\", (delegate) => zoneify(delegate));\n }\n Promise[Zone4.__symbol__(\"uncaughtPromiseErrors\")] = _uncaughtPromiseErrors;\n return ZoneAwarePromise;\n });\n}\n\n// packages/zone.js/lib/common/to-string.js\nfunction patchToString(Zone3) {\n Zone3.__load_patch(\"toString\", (global2) => {\n const originalFunctionToString = Function.prototype.toString;\n const ORIGINAL_DELEGATE_SYMBOL = zoneSymbol(\"OriginalDelegate\");\n const PROMISE_SYMBOL = zoneSymbol(\"Promise\");\n const ERROR_SYMBOL = zoneSymbol(\"Error\");\n const newFunctionToString = function toString() {\n if (typeof this === \"function\") {\n const originalDelegate = this[ORIGINAL_DELEGATE_SYMBOL];\n if (originalDelegate) {\n if (typeof originalDelegate === \"function\") {\n return originalFunctionToString.call(originalDelegate);\n } else {\n return Object.prototype.toString.call(originalDelegate);\n }\n }\n if (this === Promise) {\n const nativePromise = global2[PROMISE_SYMBOL];\n if (nativePromise) {\n return originalFunctionToString.call(nativePromise);\n }\n }\n if (this === Error) {\n const nativeError = global2[ERROR_SYMBOL];\n if (nativeError) {\n return originalFunctionToString.call(nativeError);\n }\n }\n }\n return originalFunctionToString.call(this);\n };\n newFunctionToString[ORIGINAL_DELEGATE_SYMBOL] = originalFunctionToString;\n Function.prototype.toString = newFunctionToString;\n const originalObjectToString = Object.prototype.toString;\n const PROMISE_OBJECT_TO_STRING = \"[object Promise]\";\n Object.prototype.toString = function() {\n if (typeof Promise === \"function\" && this instanceof Promise) {\n return PROMISE_OBJECT_TO_STRING;\n }\n return originalObjectToString.call(this);\n };\n });\n}\n\n// packages/zone.js/lib/browser/browser-util.js\nfunction patchCallbacks(api, target, targetName, method, callbacks) {\n const symbol = Zone.__symbol__(method);\n if (target[symbol]) {\n return;\n }\n const nativeDelegate = target[symbol] = target[method];\n target[method] = function(name, opts, options) {\n if (opts && opts.prototype) {\n callbacks.forEach(function(callback) {\n const source = `${targetName}.${method}::` + callback;\n const prototype = opts.prototype;\n try {\n if (prototype.hasOwnProperty(callback)) {\n const descriptor = api.ObjectGetOwnPropertyDescriptor(prototype, callback);\n if (descriptor && descriptor.value) {\n descriptor.value = api.wrapWithCurrentZone(descriptor.value, source);\n api._redefineProperty(opts.prototype, callback, descriptor);\n } else if (prototype[callback]) {\n prototype[callback] = api.wrapWithCurrentZone(prototype[callback], source);\n }\n } else if (prototype[callback]) {\n prototype[callback] = api.wrapWithCurrentZone(prototype[callback], source);\n }\n } catch (e) {\n }\n });\n }\n return nativeDelegate.call(target, name, opts, options);\n };\n api.attachOriginToPatched(target[method], nativeDelegate);\n}\n\n// packages/zone.js/lib/browser/api-util.js\nfunction patchUtil(Zone3) {\n Zone3.__load_patch(\"util\", (global2, Zone4, api) => {\n const eventNames = getOnEventNames(global2);\n api.patchOnProperties = patchOnProperties;\n api.patchMethod = patchMethod;\n api.bindArguments = bindArguments;\n api.patchMacroTask = patchMacroTask;\n const SYMBOL_BLACK_LISTED_EVENTS = Zone4.__symbol__(\"BLACK_LISTED_EVENTS\");\n const SYMBOL_UNPATCHED_EVENTS = Zone4.__symbol__(\"UNPATCHED_EVENTS\");\n if (global2[SYMBOL_UNPATCHED_EVENTS]) {\n global2[SYMBOL_BLACK_LISTED_EVENTS] = global2[SYMBOL_UNPATCHED_EVENTS];\n }\n if (global2[SYMBOL_BLACK_LISTED_EVENTS]) {\n Zone4[SYMBOL_BLACK_LISTED_EVENTS] = Zone4[SYMBOL_UNPATCHED_EVENTS] = global2[SYMBOL_BLACK_LISTED_EVENTS];\n }\n api.patchEventPrototype = patchEventPrototype;\n api.patchEventTarget = patchEventTarget;\n api.ObjectDefineProperty = ObjectDefineProperty;\n api.ObjectGetOwnPropertyDescriptor = ObjectGetOwnPropertyDescriptor;\n api.ObjectCreate = ObjectCreate;\n api.ArraySlice = ArraySlice;\n api.patchClass = patchClass;\n api.wrapWithCurrentZone = wrapWithCurrentZone;\n api.filterProperties = filterProperties;\n api.attachOriginToPatched = attachOriginToPatched;\n api._redefineProperty = Object.defineProperty;\n api.patchCallbacks = patchCallbacks;\n api.getGlobalObjects = () => ({\n globalSources,\n zoneSymbolEventNames: zoneSymbolEventNames2,\n eventNames,\n isBrowser,\n isMix,\n isNode,\n TRUE_STR,\n FALSE_STR,\n ZONE_SYMBOL_PREFIX,\n ADD_EVENT_LISTENER_STR,\n REMOVE_EVENT_LISTENER_STR\n });\n });\n}\n\n// packages/zone.js/lib/browser/rollup-common.js\nfunction patchCommon(Zone3) {\n patchPromise(Zone3);\n patchToString(Zone3);\n patchUtil(Zone3);\n}\n\n// packages/zone.js/lib/browser/rollup-main.js\nvar Zone2 = loadZone();\npatchCommon(Zone2);\npatchBrowser(Zone2);\n","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createContextKey } from '@opentelemetry/api';\nconst SUPPRESS_TRACING_KEY = createContextKey('OpenTelemetry SDK Context Key SUPPRESS_TRACING');\nexport function suppressTracing(context) {\n return context.setValue(SUPPRESS_TRACING_KEY, true);\n}\nexport function unsuppressTracing(context) {\n return context.deleteValue(SUPPRESS_TRACING_KEY);\n}\nexport function isTracingSuppressed(context) {\n return context.getValue(SUPPRESS_TRACING_KEY) === true;\n}\n//# sourceMappingURL=suppress-tracing.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport const BAGGAGE_KEY_PAIR_SEPARATOR = '=';\nexport const BAGGAGE_PROPERTIES_SEPARATOR = ';';\nexport const BAGGAGE_ITEMS_SEPARATOR = ',';\n// Name of the http header used to propagate the baggage\nexport const BAGGAGE_HEADER = 'baggage';\n// Maximum number of name-value pairs allowed by w3c spec\nexport const BAGGAGE_MAX_NAME_VALUE_PAIRS = 180;\n// Maximum number of bytes per a single name-value pair allowed by w3c spec\nexport const BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096;\n// Maximum total length of all name-value pairs allowed by w3c spec\nexport const BAGGAGE_MAX_TOTAL_LENGTH = 8192;\n//# sourceMappingURL=constants.js.map","import { baggageEntryMetadataFromString } from '@opentelemetry/api';\nimport { BAGGAGE_ITEMS_SEPARATOR, BAGGAGE_PROPERTIES_SEPARATOR, BAGGAGE_KEY_PAIR_SEPARATOR, BAGGAGE_MAX_TOTAL_LENGTH, } from './constants';\nexport function serializeKeyPairs(keyPairs) {\n return keyPairs.reduce((hValue, current) => {\n const value = `${hValue}${hValue !== '' ? BAGGAGE_ITEMS_SEPARATOR : ''}${current}`;\n return value.length > BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value;\n }, '');\n}\nexport function getKeyPairs(baggage) {\n return baggage.getAllEntries().map(([key, value]) => {\n let entry = `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`;\n // include opaque metadata if provided\n // NOTE: we intentionally don't URI-encode the metadata - that responsibility falls on the metadata implementation\n if (value.metadata !== undefined) {\n entry += BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString();\n }\n return entry;\n });\n}\nexport function parsePairKeyValue(entry) {\n if (!entry)\n return;\n const metadataSeparatorIndex = entry.indexOf(BAGGAGE_PROPERTIES_SEPARATOR);\n const keyPairPart = metadataSeparatorIndex === -1\n ? entry\n : entry.substring(0, metadataSeparatorIndex);\n const separatorIndex = keyPairPart.indexOf(BAGGAGE_KEY_PAIR_SEPARATOR);\n if (separatorIndex <= 0)\n return;\n const rawKey = keyPairPart.substring(0, separatorIndex).trim();\n const rawValue = keyPairPart.substring(separatorIndex + 1).trim();\n if (!rawKey || !rawValue)\n return;\n let key;\n let value;\n try {\n key = decodeURIComponent(rawKey);\n value = decodeURIComponent(rawValue);\n }\n catch {\n return;\n }\n let metadata;\n if (metadataSeparatorIndex !== -1 &&\n metadataSeparatorIndex < entry.length - 1) {\n const metadataString = entry.substring(metadataSeparatorIndex + 1);\n metadata = baggageEntryMetadataFromString(metadataString);\n }\n return { key, value, metadata };\n}\n/**\n * Parse a string serialized in the baggage HTTP Format (without metadata):\n * https://github.com/w3c/baggage/blob/master/baggage/HTTP_HEADER_FORMAT.md\n */\nexport function parseKeyPairsIntoRecord(value) {\n const result = {};\n if (typeof value === 'string' && value.length > 0) {\n value.split(BAGGAGE_ITEMS_SEPARATOR).forEach(entry => {\n const keyPair = parsePairKeyValue(entry);\n if (keyPair !== undefined && keyPair.value.length > 0) {\n result[keyPair.key] = keyPair.value;\n }\n });\n }\n return result;\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { propagation } from '@opentelemetry/api';\nimport { isTracingSuppressed } from '../../trace/suppress-tracing';\nimport { BAGGAGE_HEADER, BAGGAGE_ITEMS_SEPARATOR, BAGGAGE_MAX_NAME_VALUE_PAIRS, BAGGAGE_MAX_PER_NAME_VALUE_PAIRS, } from '../constants';\nimport { getKeyPairs, parsePairKeyValue, serializeKeyPairs } from '../utils';\n/**\n * Propagates {@link Baggage} through Context format propagation.\n *\n * Based on the Baggage specification:\n * https://w3c.github.io/baggage/\n */\nexport class W3CBaggagePropagator {\n inject(context, carrier, setter) {\n const baggage = propagation.getBaggage(context);\n if (!baggage || isTracingSuppressed(context))\n return;\n const keyPairs = getKeyPairs(baggage)\n .filter((pair) => {\n return pair.length <= BAGGAGE_MAX_PER_NAME_VALUE_PAIRS;\n })\n .slice(0, BAGGAGE_MAX_NAME_VALUE_PAIRS);\n const headerValue = serializeKeyPairs(keyPairs);\n if (headerValue.length > 0) {\n setter.set(carrier, BAGGAGE_HEADER, headerValue);\n }\n }\n extract(context, carrier, getter) {\n const headerValue = getter.get(carrier, BAGGAGE_HEADER);\n const baggageString = Array.isArray(headerValue)\n ? headerValue.join(BAGGAGE_ITEMS_SEPARATOR)\n : headerValue;\n if (!baggageString)\n return context;\n const baggage = {};\n if (baggageString.length === 0) {\n return context;\n }\n const pairs = baggageString.split(BAGGAGE_ITEMS_SEPARATOR);\n pairs.forEach(entry => {\n const keyPair = parsePairKeyValue(entry);\n if (keyPair) {\n const baggageEntry = { value: keyPair.value };\n if (keyPair.metadata) {\n baggageEntry.metadata = keyPair.metadata;\n }\n baggage[keyPair.key] = baggageEntry;\n }\n });\n if (Object.entries(baggage).length === 0) {\n return context;\n }\n return propagation.setBaggage(context, propagation.createBaggage(baggage));\n }\n fields() {\n return [BAGGAGE_HEADER];\n }\n}\n//# sourceMappingURL=W3CBaggagePropagator.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\nexport function sanitizeAttributes(attributes) {\n const out = {};\n if (typeof attributes !== 'object' || attributes == null) {\n return out;\n }\n for (const key in attributes) {\n if (!Object.prototype.hasOwnProperty.call(attributes, key)) {\n continue;\n }\n if (!isAttributeKey(key)) {\n diag.warn(`Invalid attribute key: ${key}`);\n continue;\n }\n const val = attributes[key];\n if (!isAttributeValue(val)) {\n diag.warn(`Invalid attribute value set for key: ${key}`);\n continue;\n }\n if (Array.isArray(val)) {\n out[key] = val.slice();\n }\n else {\n out[key] = val;\n }\n }\n return out;\n}\nexport function isAttributeKey(key) {\n return typeof key === 'string' && key !== '';\n}\nexport function isAttributeValue(val) {\n if (val == null) {\n return true;\n }\n if (Array.isArray(val)) {\n return isHomogeneousAttributeValueArray(val);\n }\n return isValidPrimitiveAttributeValueType(typeof val);\n}\nfunction isHomogeneousAttributeValueArray(arr) {\n let type;\n for (const element of arr) {\n // null/undefined elements are allowed\n if (element == null)\n continue;\n const elementType = typeof element;\n if (elementType === type) {\n continue;\n }\n if (!type) {\n if (isValidPrimitiveAttributeValueType(elementType)) {\n type = elementType;\n continue;\n }\n // encountered an invalid primitive\n return false;\n }\n return false;\n }\n return true;\n}\nfunction isValidPrimitiveAttributeValueType(valType) {\n switch (valType) {\n case 'number':\n case 'boolean':\n case 'string':\n return true;\n }\n return false;\n}\n//# sourceMappingURL=attributes.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\n/**\n * Returns a function that logs an error using the provided logger, or a\n * console logger if one was not provided.\n */\nexport function loggingErrorHandler() {\n return (ex) => {\n diag.error(stringifyException(ex));\n };\n}\n/**\n * Converts an exception into a string representation\n * @param {Exception} ex\n */\nfunction stringifyException(ex) {\n if (typeof ex === 'string') {\n return ex;\n }\n else {\n return JSON.stringify(flattenException(ex));\n }\n}\n/**\n * Flattens an exception into key-value pairs by traversing the prototype chain\n * and coercing values to strings. Duplicate properties will not be overwritten;\n * the first insert wins.\n */\nfunction flattenException(ex) {\n const result = {};\n let current = ex;\n while (current !== null) {\n Object.getOwnPropertyNames(current).forEach(propertyName => {\n if (result[propertyName])\n return;\n const value = current[propertyName];\n if (value) {\n result[propertyName] = String(value);\n }\n });\n current = Object.getPrototypeOf(current);\n }\n return result;\n}\n//# sourceMappingURL=logging-error-handler.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { loggingErrorHandler } from './logging-error-handler';\n/** The global error handler delegate */\nlet delegateHandler = loggingErrorHandler();\n/**\n * Set the global error handler\n * @param {ErrorHandler} handler\n */\nexport function setGlobalErrorHandler(handler) {\n delegateHandler = handler;\n}\n/**\n * Return the global error handler\n * @param {Exception} ex\n */\nexport function globalErrorHandler(ex) {\n try {\n delegateHandler(ex);\n }\n catch { } // eslint-disable-line no-empty\n}\n//# sourceMappingURL=global-error-handler.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport function getStringFromEnv(_) {\n return undefined;\n}\nexport function getBooleanFromEnv(_) {\n return undefined;\n}\nexport function getNumberFromEnv(_) {\n return undefined;\n}\nexport function getStringListFromEnv(_) {\n return undefined;\n}\n//# sourceMappingURL=environment.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '2.7.1';\n//# sourceMappingURL=version.js.map","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//----------------------------------------------------------------------------------------------------------\n// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/registry/stable/attributes.ts.j2\n//----------------------------------------------------------------------------------------------------------\n/**\n * ASP.NET Core exception middleware handling result.\n *\n * @example handled\n * @example unhandled\n */\nexport const ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = 'aspnetcore.diagnostics.exception.result';\n/**\n * Enum value \"aborted\" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.\n *\n * Exception handling didn't run because the request was aborted.\n */\nexport const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = \"aborted\";\n/**\n * Enum value \"handled\" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.\n *\n * Exception was handled by the exception handling middleware.\n */\nexport const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED = \"handled\";\n/**\n * Enum value \"skipped\" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.\n *\n * Exception handling was skipped because the response had started.\n */\nexport const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED = \"skipped\";\n/**\n * Enum value \"unhandled\" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.\n *\n * Exception was not handled by the exception handling middleware.\n */\nexport const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED = \"unhandled\";\n/**\n * Full type name of the [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception.\n *\n * @example Contoso.MyHandler\n */\nexport const ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = 'aspnetcore.diagnostics.handler.type';\n/**\n * Rate limiting policy name.\n *\n * @example fixed\n * @example sliding\n * @example token\n */\nexport const ATTR_ASPNETCORE_RATE_LIMITING_POLICY = 'aspnetcore.rate_limiting.policy';\n/**\n * Rate-limiting result, shows whether the lease was acquired or contains a rejection reason\n *\n * @example acquired\n * @example request_canceled\n */\nexport const ATTR_ASPNETCORE_RATE_LIMITING_RESULT = 'aspnetcore.rate_limiting.result';\n/**\n * Enum value \"acquired\" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.\n *\n * Lease was acquired\n */\nexport const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED = \"acquired\";\n/**\n * Enum value \"endpoint_limiter\" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.\n *\n * Lease request was rejected by the endpoint limiter\n */\nexport const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER = \"endpoint_limiter\";\n/**\n * Enum value \"global_limiter\" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.\n *\n * Lease request was rejected by the global limiter\n */\nexport const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER = \"global_limiter\";\n/**\n * Enum value \"request_canceled\" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.\n *\n * Lease request was canceled\n */\nexport const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED = \"request_canceled\";\n/**\n * Flag indicating if request was handled by the application pipeline.\n *\n * @example true\n */\nexport const ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED = 'aspnetcore.request.is_unhandled';\n/**\n * A value that indicates whether the matched route is a fallback route.\n *\n * @example true\n */\nexport const ATTR_ASPNETCORE_ROUTING_IS_FALLBACK = 'aspnetcore.routing.is_fallback';\n/**\n * Match result - success or failure\n *\n * @example success\n * @example failure\n */\nexport const ATTR_ASPNETCORE_ROUTING_MATCH_STATUS = 'aspnetcore.routing.match_status';\n/**\n * Enum value \"failure\" for attribute {@link ATTR_ASPNETCORE_ROUTING_MATCH_STATUS}.\n *\n * Match failed\n */\nexport const ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = \"failure\";\n/**\n * Enum value \"success\" for attribute {@link ATTR_ASPNETCORE_ROUTING_MATCH_STATUS}.\n *\n * Match succeeded\n */\nexport const ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS = \"success\";\n/**\n * A value that indicates whether the user is authenticated.\n *\n * @example true\n */\nexport const ATTR_ASPNETCORE_USER_IS_AUTHENTICATED = 'aspnetcore.user.is_authenticated';\n/**\n * Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.\n *\n * @example client.example.com\n * @example 10.1.2.80\n * @example /tmp/my.sock\n *\n * @note When observed from the server side, and when communicating through an intermediary, `client.address` **SHOULD** represent the client address behind any intermediaries, for example proxies, if it's available.\n */\nexport const ATTR_CLIENT_ADDRESS = 'client.address';\n/**\n * Client port number.\n *\n * @example 65123\n *\n * @note When observed from the server side, and when communicating through an intermediary, `client.port` **SHOULD** represent the client port behind any intermediaries, for example proxies, if it's available.\n */\nexport const ATTR_CLIENT_PORT = 'client.port';\n/**\n * The column number in `code.file.path` best representing the operation. It **SHOULD** point within the code unit named in `code.function.name`. This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Line'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example 16\n */\nexport const ATTR_CODE_COLUMN_NUMBER = 'code.column.number';\n/**\n * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example \"/usr/local/MyApplication/content_root/app/index.php\"\n */\nexport const ATTR_CODE_FILE_PATH = 'code.file.path';\n/**\n * The method or function fully-qualified name without arguments. The value should fit the natural representation of the language runtime, which is also likely the same used within `code.stacktrace` attribute value. This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example com.example.MyHttpService.serveRequest\n * @example GuzzleHttp\\\\Client::transfer\n * @example fopen\n *\n * @note Values and format depends on each language runtime, thus it is impossible to provide an exhaustive list of examples.\n * The values are usually the same (or prefixes of) the ones found in native stack trace representation stored in\n * `code.stacktrace` without information on arguments.\n *\n * Examples:\n *\n * - Java method: `com.example.MyHttpService.serveRequest`\n * - Java anonymous class method: `com.mycompany.Main$1.myMethod`\n * - Java lambda method: `com.mycompany.Main$$Lambda/0x0000748ae4149c00.myMethod`\n * - PHP function: `GuzzleHttp\\Client::transfer`\n * - Go function: `github.com/my/repo/pkg.foo.func5`\n * - Elixir: `OpenTelemetry.Ctx.new`\n * - Erlang: `opentelemetry_ctx:new`\n * - Rust: `playground::my_module::my_cool_func`\n * - C function: `fopen`\n */\nexport const ATTR_CODE_FUNCTION_NAME = 'code.function.name';\n/**\n * The line number in `code.file.path` best representing the operation. It **SHOULD** point within the code unit named in `code.function.name`. This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Line'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example 42\n */\nexport const ATTR_CODE_LINE_NUMBER = 'code.line.number';\n/**\n * A stacktrace as a string in the natural representation for the language runtime. The representation is identical to [`exception.stacktrace`](/docs/exceptions/exceptions-spans.md#stacktrace-representation). This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Location'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example \"at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\\\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\\\n at com.example.GenerateTrace.main(GenerateTrace.java:5)\\\\n\"\n */\nexport const ATTR_CODE_STACKTRACE = 'code.stacktrace';\n/**\n * The name of a collection (table, container) within the database.\n *\n * @example public.users\n * @example customers\n *\n * @note It is **RECOMMENDED** to capture the value as provided by the application\n * without attempting to do any case normalization.\n *\n * The collection name **SHOULD NOT** be extracted from `db.query.text`,\n * when the database system supports query text with multiple collections\n * in non-batch operations.\n *\n * For batch operations, if the individual operations are known to have the same\n * collection name then that collection name **SHOULD** be used.\n */\nexport const ATTR_DB_COLLECTION_NAME = 'db.collection.name';\n/**\n * The name of the database, fully qualified within the server address and port.\n *\n * @example customers\n * @example test.users\n *\n * @note If a database system has multiple namespace components, they **SHOULD** be concatenated from the most general to the most specific namespace component, using `|` as a separator between the components. Any missing components (and their associated separators) **SHOULD** be omitted.\n * Semantic conventions for individual database systems **SHOULD** document what `db.namespace` means in the context of that system.\n * It is **RECOMMENDED** to capture the value as provided by the application without attempting to do any case normalization.\n */\nexport const ATTR_DB_NAMESPACE = 'db.namespace';\n/**\n * The number of queries included in a batch operation.\n *\n * @example 2\n * @example 3\n * @example 4\n *\n * @note Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` **SHOULD** never be `1`.\n */\nexport const ATTR_DB_OPERATION_BATCH_SIZE = 'db.operation.batch.size';\n/**\n * The name of the operation or command being executed.\n *\n * @example findAndModify\n * @example HMSET\n * @example SELECT\n *\n * @note It is **RECOMMENDED** to capture the value as provided by the application\n * without attempting to do any case normalization.\n *\n * The operation name **SHOULD NOT** be extracted from `db.query.text`,\n * when the database system supports query text with multiple operations\n * in non-batch operations.\n *\n * If spaces can occur in the operation name, multiple consecutive spaces\n * **SHOULD** be normalized to a single space.\n *\n * For batch operations, if the individual operations are known to have the same operation name\n * then that operation name **SHOULD** be used prepended by `BATCH `,\n * otherwise `db.operation.name` **SHOULD** be `BATCH` or some other database\n * system specific term if more applicable.\n */\nexport const ATTR_DB_OPERATION_NAME = 'db.operation.name';\n/**\n * Low cardinality summary of a database query.\n *\n * @example SELECT wuser_table\n * @example INSERT shipping_details SELECT orders\n * @example get user by id\n *\n * @note The query summary describes a class of database queries and is useful\n * as a grouping key, especially when analyzing telemetry for database\n * calls involving complex queries.\n *\n * Summary may be available to the instrumentation through\n * instrumentation hooks or other means. If it is not available, instrumentations\n * that support query parsing **SHOULD** generate a summary following\n * [Generating query summary](/docs/db/database-spans.md#generating-a-summary-of-the-query)\n * section.\n *\n * For batch operations, if the individual operations are known to have the same query summary\n * then that query summary **SHOULD** be used prepended by `BATCH `,\n * otherwise `db.query.summary` **SHOULD** be `BATCH` or some other database\n * system specific term if more applicable.\n */\nexport const ATTR_DB_QUERY_SUMMARY = 'db.query.summary';\n/**\n * The database query being executed.\n *\n * @example SELECT * FROM wuser_table where username = ?\n * @example SET mykey ?\n *\n * @note For sanitization see [Sanitization of `db.query.text`](/docs/db/database-spans.md#sanitization-of-dbquerytext).\n * For batch operations, if the individual operations are known to have the same query text then that query text **SHOULD** be used, otherwise all of the individual query texts **SHOULD** be concatenated with separator `; ` or some other database system specific separator if more applicable.\n * Parameterized query text **SHOULD NOT** be sanitized. Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk.\n */\nexport const ATTR_DB_QUERY_TEXT = 'db.query.text';\n/**\n * Database response status code.\n *\n * @example 102\n * @example ORA-17002\n * @example 08P01\n * @example 404\n *\n * @note The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes.\n * Semantic conventions for individual database systems **SHOULD** document what `db.response.status_code` means in the context of that system.\n */\nexport const ATTR_DB_RESPONSE_STATUS_CODE = 'db.response.status_code';\n/**\n * The name of a stored procedure within the database.\n *\n * @example GetCustomer\n *\n * @note It is **RECOMMENDED** to capture the value as provided by the application\n * without attempting to do any case normalization.\n *\n * For batch operations, if the individual operations are known to have the same\n * stored procedure name then that stored procedure name **SHOULD** be used.\n */\nexport const ATTR_DB_STORED_PROCEDURE_NAME = 'db.stored_procedure.name';\n/**\n * The database management system (DBMS) product as identified by the client instrumentation.\n *\n * @note The actual DBMS may differ from the one identified by the client. For example, when using PostgreSQL client libraries to connect to a CockroachDB, the `db.system.name` is set to `postgresql` based on the instrumentation's best knowledge.\n */\nexport const ATTR_DB_SYSTEM_NAME = 'db.system.name';\n/**\n * Enum value \"mariadb\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * [MariaDB](https://mariadb.org/)\n */\nexport const DB_SYSTEM_NAME_VALUE_MARIADB = \"mariadb\";\n/**\n * Enum value \"microsoft.sql_server\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * [Microsoft SQL Server](https://www.microsoft.com/sql-server)\n */\nexport const DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER = \"microsoft.sql_server\";\n/**\n * Enum value \"mysql\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * [MySQL](https://www.mysql.com/)\n */\nexport const DB_SYSTEM_NAME_VALUE_MYSQL = \"mysql\";\n/**\n * Enum value \"postgresql\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * [PostgreSQL](https://www.postgresql.org/)\n */\nexport const DB_SYSTEM_NAME_VALUE_POSTGRESQL = \"postgresql\";\n/**\n * Name of the garbage collector managed heap generation.\n *\n * @example gen0\n * @example gen1\n * @example gen2\n */\nexport const ATTR_DOTNET_GC_HEAP_GENERATION = 'dotnet.gc.heap.generation';\n/**\n * Enum value \"gen0\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Generation 0\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_GEN0 = \"gen0\";\n/**\n * Enum value \"gen1\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Generation 1\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_GEN1 = \"gen1\";\n/**\n * Enum value \"gen2\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Generation 2\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_GEN2 = \"gen2\";\n/**\n * Enum value \"loh\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Large Object Heap\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_LOH = \"loh\";\n/**\n * Enum value \"poh\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Pinned Object Heap\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_POH = \"poh\";\n/**\n * Describes a class of error the operation ended with.\n *\n * @example timeout\n * @example java.net.UnknownHostException\n * @example server_certificate_invalid\n * @example 500\n *\n * @note The `error.type` **SHOULD** be predictable, and **SHOULD** have low cardinality.\n *\n * When `error.type` is set to a type (e.g., an exception type), its\n * canonical class name identifying the type within the artifact **SHOULD** be used.\n *\n * Instrumentations **SHOULD** document the list of errors they report.\n *\n * The cardinality of `error.type` within one instrumentation library **SHOULD** be low.\n * Telemetry consumers that aggregate data from multiple instrumentation libraries and applications\n * should be prepared for `error.type` to have high cardinality at query time when no\n * additional filters are applied.\n *\n * If the operation has completed successfully, instrumentations **SHOULD NOT** set `error.type`.\n *\n * If a specific domain defines its own set of error identifiers (such as HTTP or RPC status codes),\n * it's **RECOMMENDED** to:\n *\n * - Use a domain-specific attribute\n * - Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.\n */\nexport const ATTR_ERROR_TYPE = 'error.type';\n/**\n * Enum value \"_OTHER\" for attribute {@link ATTR_ERROR_TYPE}.\n *\n * A fallback error value to be used when the instrumentation doesn't define a custom value.\n */\nexport const ERROR_TYPE_VALUE_OTHER = \"_OTHER\";\n/**\n * Indicates that the exception is escaping the scope of the span.\n *\n * @deprecated It's no longer recommended to record exceptions that are handled and do not escape the scope of a span.\n */\nexport const ATTR_EXCEPTION_ESCAPED = 'exception.escaped';\n/**\n * The exception message.\n *\n * @example Division by zero\n * @example Can't convert 'int' object to str implicitly\n *\n * @note > [!WARNING]\n *\n * > This attribute may contain sensitive information.\n */\nexport const ATTR_EXCEPTION_MESSAGE = 'exception.message';\n/**\n * A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG.\n *\n * @example \"Exception in thread \"main\" java.lang.RuntimeException: Test exception\\\\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\\\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\\\n at com.example.GenerateTrace.main(GenerateTrace.java:5)\\\\n\"\n */\nexport const ATTR_EXCEPTION_STACKTRACE = 'exception.stacktrace';\n/**\n * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it.\n *\n * @example java.net.ConnectException\n * @example OSError\n */\nexport const ATTR_EXCEPTION_TYPE = 'exception.type';\n/**\n * HTTP request headers, `<key>` being the normalized HTTP Header name (lowercase), the value being the header values.\n *\n * @example [\"application/json\"]\n * @example [\"1.2.3.4\", \"1.2.3.5\"]\n *\n * @note Instrumentations **SHOULD** require an explicit configuration of which headers are to be captured.\n * Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information.\n *\n * The `User-Agent` header is already captured in the `user_agent.original` attribute.\n * Users **MAY** explicitly configure instrumentations to capture them even though it is not recommended.\n *\n * The attribute value **MUST** consist of either multiple header values as an array of strings\n * or a single-item array containing a possibly comma-concatenated string, depending on the way\n * the HTTP library provides access to headers.\n *\n * Examples:\n *\n * - A header `Content-Type: application/json` **SHOULD** be recorded as the `http.request.header.content-type`\n * attribute with value `[\"application/json\"]`.\n * - A header `X-Forwarded-For: 1.2.3.4, 1.2.3.5` **SHOULD** be recorded as the `http.request.header.x-forwarded-for`\n * attribute with value `[\"1.2.3.4\", \"1.2.3.5\"]` or `[\"1.2.3.4, 1.2.3.5\"]` depending on the HTTP library.\n */\nexport const ATTR_HTTP_REQUEST_HEADER = (key) => `http.request.header.${key}`;\n/**\n * HTTP request method.\n *\n * @example GET\n * @example POST\n * @example HEAD\n *\n * @note HTTP request method value **SHOULD** be \"known\" to the instrumentation.\n * By default, this convention defines \"known\" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods),\n * the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html)\n * and the QUERY method defined in [httpbis-safe-method-w-body](https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/?include_text=1).\n *\n * If the HTTP request method is not known to instrumentation, it **MUST** set the `http.request.method` attribute to `_OTHER`.\n *\n * If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it **MUST** provide a way to override\n * the list of known HTTP methods. If this override is done via environment variable, then the environment variable **MUST** be named\n * OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods.\n *\n *\n * If this override is done via declarative configuration, then the list **MUST** be configurable via the `known_methods` property\n * (an array of case-sensitive strings with minimum items 0) under `.instrumentation/development.general.http.client` and/or\n * `.instrumentation/development.general.http.server`.\n *\n * In either case, this list **MUST** be a full override of the default known methods,\n * it is not a list of known methods in addition to the defaults.\n *\n * HTTP method names are case-sensitive and `http.request.method` attribute value **MUST** match a known HTTP method name exactly.\n * Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, **SHOULD** populate a canonical equivalent.\n * Tracing instrumentations that do so, **MUST** also set `http.request.method_original` to the original value.\n */\nexport const ATTR_HTTP_REQUEST_METHOD = 'http.request.method';\n/**\n * Enum value \"_OTHER\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * Any HTTP method that the instrumentation has no prior knowledge of.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_OTHER = \"_OTHER\";\n/**\n * Enum value \"CONNECT\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * CONNECT method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_CONNECT = \"CONNECT\";\n/**\n * Enum value \"DELETE\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * DELETE method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_DELETE = \"DELETE\";\n/**\n * Enum value \"GET\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * GET method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_GET = \"GET\";\n/**\n * Enum value \"HEAD\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * HEAD method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_HEAD = \"HEAD\";\n/**\n * Enum value \"OPTIONS\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * OPTIONS method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_OPTIONS = \"OPTIONS\";\n/**\n * Enum value \"PATCH\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * PATCH method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_PATCH = \"PATCH\";\n/**\n * Enum value \"POST\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * POST method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_POST = \"POST\";\n/**\n * Enum value \"PUT\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * PUT method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_PUT = \"PUT\";\n/**\n * Enum value \"TRACE\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * TRACE method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_TRACE = \"TRACE\";\n/**\n * Original HTTP method sent by the client in the request line.\n *\n * @example GeT\n * @example ACL\n * @example foo\n */\nexport const ATTR_HTTP_REQUEST_METHOD_ORIGINAL = 'http.request.method_original';\n/**\n * The ordinal number of request resending attempt (for any reason, including redirects).\n *\n * @example 3\n *\n * @note The resend count **SHOULD** be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other).\n */\nexport const ATTR_HTTP_REQUEST_RESEND_COUNT = 'http.request.resend_count';\n/**\n * HTTP response headers, `<key>` being the normalized HTTP Header name (lowercase), the value being the header values.\n *\n * @example [\"application/json\"]\n * @example [\"abc\", \"def\"]\n *\n * @note Instrumentations **SHOULD** require an explicit configuration of which headers are to be captured.\n * Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information.\n *\n * Users **MAY** explicitly configure instrumentations to capture them even though it is not recommended.\n *\n * The attribute value **MUST** consist of either multiple header values as an array of strings\n * or a single-item array containing a possibly comma-concatenated string, depending on the way\n * the HTTP library provides access to headers.\n *\n * Examples:\n *\n * - A header `Content-Type: application/json` header **SHOULD** be recorded as the `http.request.response.content-type`\n * attribute with value `[\"application/json\"]`.\n * - A header `My-custom-header: abc, def` header **SHOULD** be recorded as the `http.response.header.my-custom-header`\n * attribute with value `[\"abc\", \"def\"]` or `[\"abc, def\"]` depending on the HTTP library.\n */\nexport const ATTR_HTTP_RESPONSE_HEADER = (key) => `http.response.header.${key}`;\n/**\n * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).\n *\n * @example 200\n */\nexport const ATTR_HTTP_RESPONSE_STATUS_CODE = 'http.response.status_code';\n/**\n * The matched route template for the request. This **MUST** be low-cardinality and include all static path segments, with dynamic path segments represented with placeholders.\n *\n * @example /users/:userID?\n * @example my-controller/my-action/{id?}\n *\n * @note **MUST NOT** be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it.\n * **SHOULD** include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one.\n *\n * A static path segment is a part of the route template with a fixed, low-cardinality value. This includes literal strings like `/users/` and placeholders that\n * are constrained to a finite, predefined set of values, e.g. `{controller}` or `{action}`.\n *\n * A dynamic path segment is a placeholder for a value that can have high cardinality and is not constrained to a predefined list like static path segments.\n *\n * Instrumentations **SHOULD** use routing information provided by the corresponding web framework. They **SHOULD** pick the most precise source of routing information and **MAY**\n * support custom route formatting. Instrumentations **SHOULD** document the format and the API used to obtain the route string.\n */\nexport const ATTR_HTTP_ROUTE = 'http.route';\n/**\n * Name of the garbage collector action.\n *\n * @example end of minor GC\n * @example end of major GC\n *\n * @note Garbage collector action is generally obtained via [GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()).\n */\nexport const ATTR_JVM_GC_ACTION = 'jvm.gc.action';\n/**\n * Name of the garbage collector.\n *\n * @example G1 Young Generation\n * @example G1 Old Generation\n *\n * @note Garbage collector name is generally obtained via [GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()).\n */\nexport const ATTR_JVM_GC_NAME = 'jvm.gc.name';\n/**\n * Name of the memory pool.\n *\n * @example G1 Old Gen\n * @example G1 Eden space\n * @example G1 Survivor Space\n *\n * @note Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).\n */\nexport const ATTR_JVM_MEMORY_POOL_NAME = 'jvm.memory.pool.name';\n/**\n * The type of memory.\n *\n * @example heap\n * @example non_heap\n */\nexport const ATTR_JVM_MEMORY_TYPE = 'jvm.memory.type';\n/**\n * Enum value \"heap\" for attribute {@link ATTR_JVM_MEMORY_TYPE}.\n *\n * Heap memory.\n */\nexport const JVM_MEMORY_TYPE_VALUE_HEAP = \"heap\";\n/**\n * Enum value \"non_heap\" for attribute {@link ATTR_JVM_MEMORY_TYPE}.\n *\n * Non-heap memory\n */\nexport const JVM_MEMORY_TYPE_VALUE_NON_HEAP = \"non_heap\";\n/**\n * Whether the thread is daemon or not.\n */\nexport const ATTR_JVM_THREAD_DAEMON = 'jvm.thread.daemon';\n/**\n * State of the thread.\n *\n * @example runnable\n * @example blocked\n */\nexport const ATTR_JVM_THREAD_STATE = 'jvm.thread.state';\n/**\n * Enum value \"blocked\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that is blocked waiting for a monitor lock is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_BLOCKED = \"blocked\";\n/**\n * Enum value \"new\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that has not yet started is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_NEW = \"new\";\n/**\n * Enum value \"runnable\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread executing in the Java virtual machine is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_RUNNABLE = \"runnable\";\n/**\n * Enum value \"terminated\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that has exited is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_TERMINATED = \"terminated\";\n/**\n * Enum value \"timed_waiting\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that is waiting for another thread to perform an action for up to a specified waiting time is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_TIMED_WAITING = \"timed_waiting\";\n/**\n * Enum value \"waiting\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that is waiting indefinitely for another thread to perform a particular action is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_WAITING = \"waiting\";\n/**\n * Local address of the network connection - IP address or Unix domain socket name.\n *\n * @example 10.1.2.80\n * @example /tmp/my.sock\n */\nexport const ATTR_NETWORK_LOCAL_ADDRESS = 'network.local.address';\n/**\n * Local port number of the network connection.\n *\n * @example 65123\n */\nexport const ATTR_NETWORK_LOCAL_PORT = 'network.local.port';\n/**\n * Peer address of the network connection - IP address or Unix domain socket name.\n *\n * @example 10.1.2.80\n * @example /tmp/my.sock\n */\nexport const ATTR_NETWORK_PEER_ADDRESS = 'network.peer.address';\n/**\n * Peer port number of the network connection.\n *\n * @example 65123\n */\nexport const ATTR_NETWORK_PEER_PORT = 'network.peer.port';\n/**\n * [OSI application layer](https://wikipedia.org/wiki/Application_layer) or non-OSI equivalent.\n *\n * @example amqp\n * @example http\n * @example mqtt\n *\n * @note The value **SHOULD** be normalized to lowercase.\n */\nexport const ATTR_NETWORK_PROTOCOL_NAME = 'network.protocol.name';\n/**\n * The actual version of the protocol used for network communication.\n *\n * @example 1.1\n * @example 2\n *\n * @note If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute **SHOULD** be set to the negotiated version. If the actual protocol version is not known, this attribute **SHOULD NOT** be set.\n */\nexport const ATTR_NETWORK_PROTOCOL_VERSION = 'network.protocol.version';\n/**\n * [OSI transport layer](https://wikipedia.org/wiki/Transport_layer) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication).\n *\n * @example tcp\n * @example udp\n *\n * @note The value **SHOULD** be normalized to lowercase.\n *\n * Consider always setting the transport when setting a port number, since\n * a port number is ambiguous without knowing the transport. For example\n * different processes could be listening on TCP port 12345 and UDP port 12345.\n */\nexport const ATTR_NETWORK_TRANSPORT = 'network.transport';\n/**\n * Enum value \"pipe\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * Named or anonymous pipe.\n */\nexport const NETWORK_TRANSPORT_VALUE_PIPE = \"pipe\";\n/**\n * Enum value \"quic\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * QUIC\n */\nexport const NETWORK_TRANSPORT_VALUE_QUIC = \"quic\";\n/**\n * Enum value \"tcp\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * TCP\n */\nexport const NETWORK_TRANSPORT_VALUE_TCP = \"tcp\";\n/**\n * Enum value \"udp\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * UDP\n */\nexport const NETWORK_TRANSPORT_VALUE_UDP = \"udp\";\n/**\n * Enum value \"unix\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * Unix domain socket\n */\nexport const NETWORK_TRANSPORT_VALUE_UNIX = \"unix\";\n/**\n * [OSI network layer](https://wikipedia.org/wiki/Network_layer) or non-OSI equivalent.\n *\n * @example ipv4\n * @example ipv6\n *\n * @note The value **SHOULD** be normalized to lowercase.\n */\nexport const ATTR_NETWORK_TYPE = 'network.type';\n/**\n * Enum value \"ipv4\" for attribute {@link ATTR_NETWORK_TYPE}.\n *\n * IPv4\n */\nexport const NETWORK_TYPE_VALUE_IPV4 = \"ipv4\";\n/**\n * Enum value \"ipv6\" for attribute {@link ATTR_NETWORK_TYPE}.\n *\n * IPv6\n */\nexport const NETWORK_TYPE_VALUE_IPV6 = \"ipv6\";\n/**\n * The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP).\n *\n * @example io.opentelemetry.contrib.mongodb\n */\nexport const ATTR_OTEL_SCOPE_NAME = 'otel.scope.name';\n/**\n * The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP).\n *\n * @example 1.0.0\n */\nexport const ATTR_OTEL_SCOPE_VERSION = 'otel.scope.version';\n/**\n * Name of the code, either \"OK\" or \"ERROR\". **MUST NOT** be set if the status code is UNSET.\n */\nexport const ATTR_OTEL_STATUS_CODE = 'otel.status_code';\n/**\n * Enum value \"ERROR\" for attribute {@link ATTR_OTEL_STATUS_CODE}.\n *\n * The operation contains an error.\n */\nexport const OTEL_STATUS_CODE_VALUE_ERROR = \"ERROR\";\n/**\n * Enum value \"OK\" for attribute {@link ATTR_OTEL_STATUS_CODE}.\n *\n * The operation has been validated by an Application developer or Operator to have completed successfully.\n */\nexport const OTEL_STATUS_CODE_VALUE_OK = \"OK\";\n/**\n * Description of the Status if it has a value, otherwise not set.\n *\n * @example resource not found\n */\nexport const ATTR_OTEL_STATUS_DESCRIPTION = 'otel.status_description';\n/**\n * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.\n *\n * @example example.com\n * @example 10.1.2.80\n * @example /tmp/my.sock\n *\n * @note When observed from the client side, and when communicating through an intermediary, `server.address` **SHOULD** represent the server address behind any intermediaries, for example proxies, if it's available.\n */\nexport const ATTR_SERVER_ADDRESS = 'server.address';\n/**\n * Server port number.\n *\n * @example 80\n * @example 8080\n * @example 443\n *\n * @note When observed from the client side, and when communicating through an intermediary, `server.port` **SHOULD** represent the server port behind any intermediaries, for example proxies, if it's available.\n */\nexport const ATTR_SERVER_PORT = 'server.port';\n/**\n * The string ID of the service instance.\n *\n * @example 627cc493-f310-47de-96bd-71410b7dec09\n *\n * @note **MUST** be unique for each instance of the same `service.namespace,service.name` pair (in other words\n * `service.namespace,service.name,service.instance.id` triplet **MUST** be globally unique). The ID helps to\n * distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled\n * service).\n *\n * Implementations, such as SDKs, are recommended to generate a random Version 1 or Version 4 [RFC\n * 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an inherent unique ID as the source of\n * this value if stability is desirable. In that case, the ID **SHOULD** be used as source of a UUID Version 5 and\n * **SHOULD** use the following UUID as the namespace: `4d63009a-8d0f-11ee-aad7-4c796ed8e320`.\n *\n * UUIDs are typically recommended, as only an opaque value for the purposes of identifying a service instance is\n * needed. Similar to what can be seen in the man page for the\n * [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/latest/machine-id.html) file, the underlying\n * data, such as pod name and namespace should be treated as confidential, being the user's choice to expose it\n * or not via another resource attribute.\n *\n * For applications running behind an application server (like unicorn), we do not recommend using one identifier\n * for all processes participating in the application. Instead, it's recommended each division (e.g. a worker\n * thread in unicorn) to have its own instance.id.\n *\n * It's not recommended for a Collector to set `service.instance.id` if it can't unambiguously determine the\n * service instance that is generating that telemetry. For instance, creating an UUID based on `pod.name` will\n * likely be wrong, as the Collector might not know from which container within that pod the telemetry originated.\n * However, Collectors can set the `service.instance.id` if they can unambiguously determine the service instance\n * for that telemetry. This is typically the case for scraping receivers, as they know the target address and\n * port.\n */\nexport const ATTR_SERVICE_INSTANCE_ID = 'service.instance.id';\n/**\n * Logical name of the service.\n *\n * @example shoppingcart\n *\n * @note **MUST** be the same for all instances of horizontally scaled services. If the value was not specified, SDKs **MUST** fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value **MUST** be set to `unknown_service`.\n */\nexport const ATTR_SERVICE_NAME = 'service.name';\n/**\n * A namespace for `service.name`.\n *\n * @example Shop\n *\n * @note A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace.\n */\nexport const ATTR_SERVICE_NAMESPACE = 'service.namespace';\n/**\n * The version string of the service component. The format is not defined by these conventions.\n *\n * @example 2.0.0\n * @example a01dbef8a\n */\nexport const ATTR_SERVICE_VERSION = 'service.version';\n/**\n * SignalR HTTP connection closure status.\n *\n * @example app_shutdown\n * @example timeout\n */\nexport const ATTR_SIGNALR_CONNECTION_STATUS = 'signalr.connection.status';\n/**\n * Enum value \"app_shutdown\" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}.\n *\n * The connection was closed because the app is shutting down.\n */\nexport const SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN = \"app_shutdown\";\n/**\n * Enum value \"normal_closure\" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}.\n *\n * The connection was closed normally.\n */\nexport const SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = \"normal_closure\";\n/**\n * Enum value \"timeout\" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}.\n *\n * The connection was closed due to a timeout.\n */\nexport const SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = \"timeout\";\n/**\n * [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md)\n *\n * @example web_sockets\n * @example long_polling\n */\nexport const ATTR_SIGNALR_TRANSPORT = 'signalr.transport';\n/**\n * Enum value \"long_polling\" for attribute {@link ATTR_SIGNALR_TRANSPORT}.\n *\n * LongPolling protocol\n */\nexport const SIGNALR_TRANSPORT_VALUE_LONG_POLLING = \"long_polling\";\n/**\n * Enum value \"server_sent_events\" for attribute {@link ATTR_SIGNALR_TRANSPORT}.\n *\n * ServerSentEvents protocol\n */\nexport const SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = \"server_sent_events\";\n/**\n * Enum value \"web_sockets\" for attribute {@link ATTR_SIGNALR_TRANSPORT}.\n *\n * WebSockets protocol\n */\nexport const SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS = \"web_sockets\";\n/**\n * The language of the telemetry SDK.\n */\nexport const ATTR_TELEMETRY_SDK_LANGUAGE = 'telemetry.sdk.language';\n/**\n * Enum value \"cpp\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_CPP = \"cpp\";\n/**\n * Enum value \"dotnet\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = \"dotnet\";\n/**\n * Enum value \"erlang\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = \"erlang\";\n/**\n * Enum value \"go\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_GO = \"go\";\n/**\n * Enum value \"java\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = \"java\";\n/**\n * Enum value \"nodejs\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = \"nodejs\";\n/**\n * Enum value \"php\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_PHP = \"php\";\n/**\n * Enum value \"python\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = \"python\";\n/**\n * Enum value \"ruby\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = \"ruby\";\n/**\n * Enum value \"rust\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_RUST = \"rust\";\n/**\n * Enum value \"swift\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = \"swift\";\n/**\n * Enum value \"webjs\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = \"webjs\";\n/**\n * The name of the telemetry SDK as defined above.\n *\n * @example opentelemetry\n *\n * @note The OpenTelemetry SDK **MUST** set the `telemetry.sdk.name` attribute to `opentelemetry`.\n * If another SDK, like a fork or a vendor-provided implementation, is used, this SDK **MUST** set the\n * `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point\n * or another suitable identifier depending on the language.\n * The identifier `opentelemetry` is reserved and **MUST NOT** be used in this case.\n * All custom identifiers **SHOULD** be stable across different versions of an implementation.\n */\nexport const ATTR_TELEMETRY_SDK_NAME = 'telemetry.sdk.name';\n/**\n * The version string of the telemetry SDK.\n *\n * @example 1.2.3\n */\nexport const ATTR_TELEMETRY_SDK_VERSION = 'telemetry.sdk.version';\n/**\n * The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component\n *\n * @example SemConv\n */\nexport const ATTR_URL_FRAGMENT = 'url.fragment';\n/**\n * Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)\n *\n * @example https://www.foo.bar/search?q=OpenTelemetry#SemConv\n * @example //localhost\n *\n * @note For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment\n * is not transmitted over HTTP, but if it is known, it **SHOULD** be included nevertheless.\n *\n * `url.full` **MUST NOT** contain credentials passed via URL in form of `https://username:password@www.example.com/`.\n * In such case username and password **SHOULD** be redacted and attribute's value **SHOULD** be `https://REDACTED:REDACTED@www.example.com/`.\n *\n * `url.full` **SHOULD** capture the absolute URL when it is available (or can be reconstructed).\n *\n * Sensitive content provided in `url.full` **SHOULD** be scrubbed when instrumentations can identify it.\n *\n *\n * Query string values for the following keys **SHOULD** be redacted by default and replaced by the\n * value `REDACTED`:\n *\n * - [`AWSAccessKeyId`](https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth)\n * - [`Signature`](https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth)\n * - [`sig`](https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token)\n * - [`X-Goog-Signature`](https://cloud.google.com/storage/docs/access-control/signed-urls)\n *\n * This list is subject to change over time.\n *\n * Matching of query parameter keys against the sensitive list **SHOULD** be case-sensitive.\n *\n *\n * Instrumentation **MAY** provide a way to override this list via declarative configuration.\n * If so, it **SHOULD** use the `sensitive_query_parameters` property\n * (an array of case-sensitive strings with minimum items 0) under\n * `.instrumentation/development.general.sanitization.url`.\n * This list is a full override of the default sensitive query parameter keys,\n * it is not a list of keys in addition to the defaults.\n *\n * When a query string value is redacted, the query string key **SHOULD** still be preserved, e.g.\n * `https://www.example.com/path?color=blue&sig=REDACTED`.\n */\nexport const ATTR_URL_FULL = 'url.full';\n/**\n * The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component\n *\n * @example /search\n *\n * @note Sensitive content provided in `url.path` **SHOULD** be scrubbed when instrumentations can identify it.\n */\nexport const ATTR_URL_PATH = 'url.path';\n/**\n * The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component\n *\n * @example q=OpenTelemetry\n *\n * @note Sensitive content provided in `url.query` **SHOULD** be scrubbed when instrumentations can identify it.\n *\n *\n * Query string values for the following keys **SHOULD** be redacted by default and replaced by the value `REDACTED`:\n *\n * - [`AWSAccessKeyId`](https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth)\n * - [`Signature`](https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth)\n * - [`sig`](https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token)\n * - [`X-Goog-Signature`](https://cloud.google.com/storage/docs/access-control/signed-urls)\n *\n * This list is subject to change over time.\n *\n * Matching of query parameter keys against the sensitive list **SHOULD** be case-sensitive.\n *\n * Instrumentation **MAY** provide a way to override this list via declarative configuration.\n * If so, it **SHOULD** use the `sensitive_query_parameters` property\n * (an array of case-sensitive strings with minimum items 0) under\n * `.instrumentation/development.general.sanitization.url`.\n * This list is a full override of the default sensitive query parameter keys,\n * it is not a list of keys in addition to the defaults.\n *\n * When a query string value is redacted, the query string key **SHOULD** still be preserved, e.g.\n * `q=OpenTelemetry&sig=REDACTED`.\n */\nexport const ATTR_URL_QUERY = 'url.query';\n/**\n * The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol.\n *\n * @example https\n * @example ftp\n * @example telnet\n */\nexport const ATTR_URL_SCHEME = 'url.scheme';\n/**\n * Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client.\n *\n * @example CERN-LineMode/2.15 libwww/2.17b3\n * @example Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1\n * @example YourApp/1.0.0 grpc-java-okhttp/1.27.2\n */\nexport const ATTR_USER_AGENT_ORIGINAL = 'user_agent.original';\n//# sourceMappingURL=stable_attributes.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n/**\n * The name of the runtime of this process.\n *\n * @example OpenJDK Runtime Environment\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_RUNTIME_NAME = 'process.runtime.name';\n//# sourceMappingURL=semconv.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { VERSION } from '../../version';\nimport { ATTR_TELEMETRY_SDK_NAME, ATTR_TELEMETRY_SDK_LANGUAGE, TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS, ATTR_TELEMETRY_SDK_VERSION, } from '@opentelemetry/semantic-conventions';\nimport { ATTR_PROCESS_RUNTIME_NAME } from '../../semconv';\n/** Constants describing the SDK in use */\nexport const SDK_INFO = {\n [ATTR_TELEMETRY_SDK_NAME]: 'opentelemetry',\n [ATTR_PROCESS_RUNTIME_NAME]: 'browser',\n [ATTR_TELEMETRY_SDK_LANGUAGE]: TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS,\n [ATTR_TELEMETRY_SDK_VERSION]: VERSION,\n};\n//# sourceMappingURL=sdk-info.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport { getStringFromEnv, getBooleanFromEnv, getNumberFromEnv, getStringListFromEnv, } from './environment';\nexport { _globalThis } from '../../common/globalThis';\nexport { SDK_INFO } from './sdk-info';\n/**\n * @deprecated Use performance directly.\n */\nexport const otperformance = performance;\n//# sourceMappingURL=index.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { otperformance as performance } from '../platform';\nconst NANOSECOND_DIGITS = 9;\nconst NANOSECOND_DIGITS_IN_MILLIS = 6;\nconst MILLISECONDS_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS);\nconst SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS);\n/**\n * Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]).\n * @param epochMillis\n */\nexport function millisToHrTime(epochMillis) {\n const epochSeconds = epochMillis / 1000;\n // Decimals only.\n const seconds = Math.trunc(epochSeconds);\n // Round sub-nanosecond accuracy to nanosecond.\n const nanos = Math.round((epochMillis % 1000) * MILLISECONDS_TO_NANOSECONDS);\n return [seconds, nanos];\n}\n/**\n * @deprecated Use `performance.timeOrigin` directly.\n */\nexport function getTimeOrigin() {\n return performance.timeOrigin;\n}\n/**\n * Returns an hrtime calculated via performance component.\n * @param performanceNow\n */\nexport function hrTime(performanceNow) {\n const timeOrigin = millisToHrTime(performance.timeOrigin);\n const now = millisToHrTime(typeof performanceNow === 'number' ? performanceNow : performance.now());\n return addHrTimes(timeOrigin, now);\n}\n/**\n *\n * Converts a TimeInput to an HrTime, defaults to _hrtime().\n * @param time\n */\nexport function timeInputToHrTime(time) {\n // process.hrtime\n if (isTimeInputHrTime(time)) {\n return time;\n }\n else if (typeof time === 'number') {\n // Must be a performance.now() if it's smaller than process start time.\n if (time < performance.timeOrigin) {\n return hrTime(time);\n }\n else {\n // epoch milliseconds or performance.timeOrigin\n return millisToHrTime(time);\n }\n }\n else if (time instanceof Date) {\n return millisToHrTime(time.getTime());\n }\n else {\n throw TypeError('Invalid input type');\n }\n}\n/**\n * Returns a duration of two hrTime.\n * @param startTime\n * @param endTime\n */\nexport function hrTimeDuration(startTime, endTime) {\n let seconds = endTime[0] - startTime[0];\n let nanos = endTime[1] - startTime[1];\n // overflow\n if (nanos < 0) {\n seconds -= 1;\n // negate\n nanos += SECOND_TO_NANOSECONDS;\n }\n return [seconds, nanos];\n}\n/**\n * Convert hrTime to timestamp, for example \"2019-05-14T17:00:00.000123456Z\"\n * @param time\n */\nexport function hrTimeToTimeStamp(time) {\n const precision = NANOSECOND_DIGITS;\n const tmp = `${'0'.repeat(precision)}${time[1]}Z`;\n const nanoString = tmp.substring(tmp.length - precision - 1);\n const date = new Date(time[0] * 1000).toISOString();\n return date.replace('000Z', nanoString);\n}\n/**\n * Convert hrTime to nanoseconds.\n * @param time\n */\nexport function hrTimeToNanoseconds(time) {\n return time[0] * SECOND_TO_NANOSECONDS + time[1];\n}\n/**\n * Convert hrTime to milliseconds.\n * @param time\n */\nexport function hrTimeToMilliseconds(time) {\n return time[0] * 1e3 + time[1] / 1e6;\n}\n/**\n * Convert hrTime to microseconds.\n * @param time\n */\nexport function hrTimeToMicroseconds(time) {\n return time[0] * 1e6 + time[1] / 1e3;\n}\n/**\n * check if time is HrTime\n * @param value\n */\nexport function isTimeInputHrTime(value) {\n return (Array.isArray(value) &&\n value.length === 2 &&\n typeof value[0] === 'number' &&\n typeof value[1] === 'number');\n}\n/**\n * check if input value is a correct types.TimeInput\n * @param value\n */\nexport function isTimeInput(value) {\n return (isTimeInputHrTime(value) ||\n typeof value === 'number' ||\n value instanceof Date);\n}\n/**\n * Given 2 HrTime formatted times, return their sum as an HrTime.\n */\nexport function addHrTimes(time1, time2) {\n const out = [time1[0] + time2[0], time1[1] + time2[1]];\n // Nanoseconds\n if (out[1] >= SECOND_TO_NANOSECONDS) {\n out[1] -= SECOND_TO_NANOSECONDS;\n out[0] += 1;\n }\n return out;\n}\n//# sourceMappingURL=time.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport var ExportResultCode;\n(function (ExportResultCode) {\n ExportResultCode[ExportResultCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n ExportResultCode[ExportResultCode[\"FAILED\"] = 1] = \"FAILED\";\n})(ExportResultCode || (ExportResultCode = {}));\n//# sourceMappingURL=ExportResult.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\n/** Combines multiple propagators into a single propagator. */\nexport class CompositePropagator {\n _propagators;\n _fields;\n /**\n * Construct a composite propagator from a list of propagators.\n *\n * @param [config] Configuration object for composite propagator\n */\n constructor(config = {}) {\n this._propagators = config.propagators ?? [];\n const fields = new Set();\n for (const propagator of this._propagators) {\n // older propagators may not have fields function, null check to be sure\n const propagatorFields = typeof propagator.fields === 'function' ? propagator.fields() : [];\n for (const field of propagatorFields) {\n fields.add(field);\n }\n }\n this._fields = Array.from(fields);\n }\n /**\n * Run each of the configured propagators with the given context and carrier.\n * Propagators are run in the order they are configured, so if multiple\n * propagators write the same carrier key, the propagator later in the list\n * will \"win\".\n *\n * @param context Context to inject\n * @param carrier Carrier into which context will be injected\n */\n inject(context, carrier, setter) {\n for (const propagator of this._propagators) {\n try {\n propagator.inject(context, carrier, setter);\n }\n catch (err) {\n diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`);\n }\n }\n }\n /**\n * Run each of the configured propagators with the given context and carrier.\n * Propagators are run in the order they are configured, so if multiple\n * propagators write the same context key, the propagator later in the list\n * will \"win\".\n *\n * @param context Context to add values to\n * @param carrier Carrier from which to extract context\n */\n extract(context, carrier, getter) {\n return this._propagators.reduce((ctx, propagator) => {\n try {\n return propagator.extract(ctx, carrier, getter);\n }\n catch (err) {\n diag.warn(`Failed to extract with ${propagator.constructor.name}. Err: ${err.message}`);\n }\n return ctx;\n }, context);\n }\n fields() {\n // return a new array so our fields cannot be modified\n return this._fields.slice();\n }\n}\n//# sourceMappingURL=composite.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nconst VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]';\nconst VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`;\nconst VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`;\nconst VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`);\nconst VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/;\nconst INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/;\n/**\n * Key is opaque string up to 256 characters printable. It MUST begin with a\n * lowercase letter, and can only contain lowercase letters a-z, digits 0-9,\n * underscores _, dashes -, asterisks *, and forward slashes /.\n * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the\n * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key.\n * see https://www.w3.org/TR/trace-context/#key\n */\nexport function validateKey(key) {\n return VALID_KEY_REGEX.test(key);\n}\n/**\n * Value is opaque string up to 256 characters printable ASCII RFC0020\n * characters (i.e., the range 0x20 to 0x7E) except comma , and =.\n */\nexport function validateValue(value) {\n return (VALID_VALUE_BASE_REGEX.test(value) &&\n !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value));\n}\n//# sourceMappingURL=validators.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { validateKey, validateValue } from '../internal/validators';\nconst MAX_TRACE_STATE_ITEMS = 32;\nconst MAX_TRACE_STATE_LEN = 512;\nconst LIST_MEMBERS_SEPARATOR = ',';\nconst LIST_MEMBER_KEY_VALUE_SPLITTER = '=';\n/**\n * TraceState must be a class and not a simple object type because of the spec\n * requirement (https://www.w3.org/TR/trace-context/#tracestate-field).\n *\n * Here is the list of allowed mutations:\n * - New key-value pair should be added into the beginning of the list\n * - The value of any key can be updated. Modified keys MUST be moved to the\n * beginning of the list.\n */\nexport class TraceState {\n _length;\n _rawTraceState;\n _internalState;\n constructor(rawTraceState) {\n this._rawTraceState =\n typeof rawTraceState === 'string' ? rawTraceState : '';\n this._length = this._rawTraceState.length;\n }\n set(key, value) {\n if (!validateKey(key) || !validateValue(value)) {\n return this;\n }\n const currState = this._getState();\n const currValue = currState.get(key);\n // Get the new length depending if we already have a value or not\n // - for existing keys we add the difference between the length of the values\n // - for new keys is the key & value lenght plus\n // - +1 for the key/value splitter\n // - +1 for the separator if there are other keys\n let newLength = this._length;\n if (typeof currValue === 'string') {\n newLength += value.length - currValue.length;\n }\n else {\n newLength += key.length + value.length + (currState.size > 0 ? 2 : 1);\n }\n if (newLength > MAX_TRACE_STATE_LEN) {\n return this;\n }\n const newState = new Map(currState);\n newState.delete(key);\n newState.set(key, value);\n return this._fromState(newState, newLength);\n }\n unset(key) {\n const currState = this._getState();\n const currValue = currState.get(key);\n // No need to create a new instance if the key does not exist\n if (typeof currValue !== 'string') {\n return this;\n }\n // Get the new length depending if we already have a value or not\n // - for existing keys we substract key and value length plus\n // - +1 for the key/value splitter\n // - +1 for the separator if there are other keys\n let newLength = this._length - (key.length + currValue.length + 1);\n if (currState.size > 1) {\n // remove separator from length if there's no key or only one.\n newLength = newLength - 1;\n }\n const newState = new Map(currState);\n newState.delete(key);\n return this._fromState(newState, newLength);\n }\n get(key) {\n const currState = this._getState();\n return currState.get(key);\n }\n serialize() {\n // Maps put new entries at the end. We prepend the seralized entry\n // to get the right order according to the spec (updated members go 1st)\n let serialized = '';\n let index = 0;\n for (const entry of this._getState()) {\n if (index > 0) {\n serialized = LIST_MEMBERS_SEPARATOR + serialized;\n }\n serialized =\n `${entry[0]}${LIST_MEMBER_KEY_VALUE_SPLITTER}${entry[1]}` + serialized;\n index++;\n }\n return serialized;\n }\n _getState() {\n if (this._internalState) {\n return this._internalState;\n }\n // Not parsed yet, lets do it\n const vendorMembers = this._rawTraceState.split(LIST_MEMBERS_SEPARATOR);\n // This Map will have the order reversed\n const vendorEntries = new Map();\n let currentLength = 0;\n for (const member of vendorMembers) {\n const m = member.trim();\n const idx = m.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER);\n if (idx === -1) {\n continue;\n }\n const key = m.slice(0, idx);\n const value = m.slice(idx + 1);\n if (!validateKey(key) || !validateValue(value)) {\n continue;\n }\n // Skip if adding the new member exceeds the length\n const futureLength = currentLength + m.length + (vendorEntries.size > 0 ? 1 : 0);\n if (futureLength > MAX_TRACE_STATE_LEN) {\n continue;\n }\n // All good, add it\n vendorEntries.set(key, value);\n currentLength = futureLength;\n // Check if we reached the max items\n if (vendorEntries.size >= MAX_TRACE_STATE_ITEMS) {\n break;\n }\n }\n // Now we set the length & the Map in the right order\n this._length = currentLength;\n this._internalState = new Map(Array.from(vendorEntries.entries()).reverse());\n return this._internalState;\n }\n _fromState(state, length) {\n const traceState = Object.create(TraceState.prototype);\n traceState._internalState = state;\n traceState._length = length;\n return traceState;\n }\n}\n//# sourceMappingURL=TraceState.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { isSpanContextValid, trace, TraceFlags } from '@opentelemetry/api';\nimport { isTracingSuppressed } from './suppress-tracing';\nimport { TraceState } from './TraceState';\nexport const TRACE_PARENT_HEADER = 'traceparent';\nexport const TRACE_STATE_HEADER = 'tracestate';\nconst VERSION = '00';\nconst VERSION_PART = '(?!ff)[\\\\da-f]{2}';\nconst TRACE_ID_PART = '(?![0]{32})[\\\\da-f]{32}';\nconst PARENT_ID_PART = '(?![0]{16})[\\\\da-f]{16}';\nconst FLAGS_PART = '[\\\\da-f]{2}';\nconst TRACE_PARENT_REGEX = new RegExp(`^\\\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\\\s?$`);\n/**\n * Parses information from the [traceparent] span tag and converts it into {@link SpanContext}\n * @param traceParent - A meta property that comes from server.\n * It should be dynamically generated server side to have the server's request trace Id,\n * a parent span Id that was set on the server's request span,\n * and the trace flags to indicate the server's sampling decision\n * (01 = sampled, 00 = not sampled).\n * for example: '{version}-{traceId}-{spanId}-{sampleDecision}'\n * For more information see {@link https://www.w3.org/TR/trace-context/}\n */\nexport function parseTraceParent(traceParent) {\n const match = TRACE_PARENT_REGEX.exec(traceParent);\n if (!match)\n return null;\n // According to the specification the implementation should be compatible\n // with future versions. If there are more parts, we only reject it if it's using version 00\n // See https://www.w3.org/TR/trace-context/#versioning-of-traceparent\n if (match[1] === '00' && match[5])\n return null;\n return {\n traceId: match[2],\n spanId: match[3],\n traceFlags: parseInt(match[4], 16),\n };\n}\n/**\n * Propagates {@link SpanContext} through Trace Context format propagation.\n *\n * Based on the Trace Context specification:\n * https://www.w3.org/TR/trace-context/\n */\nexport class W3CTraceContextPropagator {\n inject(context, carrier, setter) {\n const spanContext = trace.getSpanContext(context);\n if (!spanContext ||\n isTracingSuppressed(context) ||\n !isSpanContextValid(spanContext))\n return;\n const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || TraceFlags.NONE).toString(16)}`;\n setter.set(carrier, TRACE_PARENT_HEADER, traceParent);\n if (spanContext.traceState) {\n setter.set(carrier, TRACE_STATE_HEADER, spanContext.traceState.serialize());\n }\n }\n extract(context, carrier, getter) {\n const traceParentHeader = getter.get(carrier, TRACE_PARENT_HEADER);\n if (!traceParentHeader)\n return context;\n const traceParent = Array.isArray(traceParentHeader)\n ? traceParentHeader[0]\n : traceParentHeader;\n if (typeof traceParent !== 'string')\n return context;\n const spanContext = parseTraceParent(traceParent);\n if (!spanContext)\n return context;\n spanContext.isRemote = true;\n const traceStateHeader = getter.get(carrier, TRACE_STATE_HEADER);\n if (traceStateHeader) {\n // If more than one `tracestate` header is found, we merge them into a\n // single header.\n const state = Array.isArray(traceStateHeader)\n ? traceStateHeader.join(',')\n : traceStateHeader;\n spanContext.traceState = new TraceState(typeof state === 'string' ? state : undefined);\n }\n return trace.setSpanContext(context, spanContext);\n }\n fields() {\n return [TRACE_PARENT_HEADER, TRACE_STATE_HEADER];\n }\n}\n//# sourceMappingURL=W3CTraceContextPropagator.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * based on lodash in order to support esm builds without esModuleInterop.\n * lodash is using MIT License.\n **/\nconst objectTag = '[object Object]';\nconst nullTag = '[object Null]';\nconst undefinedTag = '[object Undefined]';\nconst funcProto = Function.prototype;\nconst funcToString = funcProto.toString;\nconst objectCtorString = funcToString.call(Object);\nconst getPrototypeOf = Object.getPrototypeOf;\nconst objectProto = Object.prototype;\nconst hasOwnProperty = objectProto.hasOwnProperty;\nconst symToStringTag = Symbol ? Symbol.toStringTag : undefined;\nconst nativeObjectToString = objectProto.toString;\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nexport function isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) !== objectTag) {\n return false;\n }\n const proto = getPrototypeOf(value);\n if (proto === null) {\n return true;\n }\n const Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return (typeof Ctor == 'function' &&\n Ctor instanceof Ctor &&\n funcToString.call(Ctor) === objectCtorString);\n}\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return symToStringTag && symToStringTag in Object(value)\n ? getRawTag(value)\n : objectToString(value);\n}\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];\n let unmasked = false;\n try {\n value[symToStringTag] = undefined;\n unmasked = true;\n }\n catch {\n // silence\n }\n const result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n }\n else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n//# sourceMappingURL=lodash.merge.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { isPlainObject } from './lodash.merge';\nconst MAX_LEVEL = 20;\n/**\n * Merges objects together\n * @param args - objects / values to be merged\n */\nexport function merge(...args) {\n let result = args.shift();\n const objects = new WeakMap();\n while (args.length > 0) {\n result = mergeTwoObjects(result, args.shift(), 0, objects);\n }\n return result;\n}\nfunction takeValue(value) {\n if (isArray(value)) {\n return value.slice();\n }\n return value;\n}\n/**\n * Merges two objects\n * @param one - first object\n * @param two - second object\n * @param level - current deep level\n * @param objects - objects holder that has been already referenced - to prevent\n * cyclic dependency\n */\nfunction mergeTwoObjects(one, two, level = 0, objects) {\n let result;\n if (level > MAX_LEVEL) {\n return undefined;\n }\n level++;\n if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) {\n result = takeValue(two);\n }\n else if (isArray(one)) {\n result = one.slice();\n if (isArray(two)) {\n for (let i = 0, j = two.length; i < j; i++) {\n result.push(takeValue(two[i]));\n }\n }\n else if (isObject(two)) {\n const keys = Object.keys(two);\n for (let i = 0, j = keys.length; i < j; i++) {\n const key = keys[i];\n if (key === '__proto__' ||\n key === 'constructor' ||\n key === 'prototype') {\n continue;\n }\n result[key] = takeValue(two[key]);\n }\n }\n }\n else if (isObject(one)) {\n if (isObject(two)) {\n if (!shouldMerge(one, two)) {\n return two;\n }\n result = Object.assign({}, one);\n const keys = Object.keys(two);\n for (let i = 0, j = keys.length; i < j; i++) {\n const key = keys[i];\n if (key === '__proto__' ||\n key === 'constructor' ||\n key === 'prototype') {\n continue;\n }\n const twoValue = two[key];\n if (isPrimitive(twoValue)) {\n if (typeof twoValue === 'undefined') {\n delete result[key];\n }\n else {\n // result[key] = takeValue(twoValue);\n result[key] = twoValue;\n }\n }\n else {\n const obj1 = result[key];\n const obj2 = twoValue;\n if (wasObjectReferenced(one, key, objects) ||\n wasObjectReferenced(two, key, objects)) {\n delete result[key];\n }\n else {\n if (isObject(obj1) && isObject(obj2)) {\n const arr1 = objects.get(obj1) || [];\n const arr2 = objects.get(obj2) || [];\n arr1.push({ obj: one, key });\n arr2.push({ obj: two, key });\n objects.set(obj1, arr1);\n objects.set(obj2, arr2);\n }\n result[key] = mergeTwoObjects(result[key], twoValue, level, objects);\n }\n }\n }\n }\n else {\n result = two;\n }\n }\n return result;\n}\n/**\n * Function to check if object has been already reference\n * @param obj\n * @param key\n * @param objects\n */\nfunction wasObjectReferenced(obj, key, objects) {\n const arr = objects.get(obj[key]) || [];\n for (let i = 0, j = arr.length; i < j; i++) {\n const info = arr[i];\n if (info.key === key && info.obj === obj) {\n return true;\n }\n }\n return false;\n}\nfunction isArray(value) {\n return Array.isArray(value);\n}\nfunction isFunction(value) {\n return typeof value === 'function';\n}\nfunction isObject(value) {\n return (!isPrimitive(value) &&\n !isArray(value) &&\n !isFunction(value) &&\n typeof value === 'object');\n}\nfunction isPrimitive(value) {\n return (typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean' ||\n typeof value === 'undefined' ||\n value instanceof Date ||\n value instanceof RegExp ||\n value === null);\n}\nfunction shouldMerge(one, two) {\n if (!isPlainObject(one) || !isPlainObject(two)) {\n return false;\n }\n return true;\n}\n//# sourceMappingURL=merge.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport class Deferred {\n _promise;\n _resolve;\n _reject;\n constructor() {\n this._promise = new Promise((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n }\n get promise() {\n return this._promise;\n }\n resolve(val) {\n this._resolve(val);\n }\n reject(err) {\n this._reject(err);\n }\n}\n//# sourceMappingURL=promise.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { Deferred } from './promise';\n/**\n * Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked.\n */\nexport class BindOnceFuture {\n _isCalled = false;\n _deferred = new Deferred();\n _callback;\n _that;\n constructor(callback, that) {\n this._callback = callback;\n this._that = that;\n }\n get isCalled() {\n return this._isCalled;\n }\n get promise() {\n return this._deferred.promise;\n }\n call(...args) {\n if (!this._isCalled) {\n this._isCalled = true;\n try {\n Promise.resolve(this._callback.call(this._that, ...args)).then(val => this._deferred.resolve(val), err => this._deferred.reject(err));\n }\n catch (err) {\n this._deferred.reject(err);\n }\n }\n return this._deferred.promise;\n }\n}\n//# sourceMappingURL=callback.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { context } from '@opentelemetry/api';\nimport { suppressTracing } from '../trace/suppress-tracing';\n/**\n * @internal\n * Shared functionality used by Exporters while exporting data, including suppression of Traces.\n */\nexport function _export(exporter, arg) {\n return new Promise(resolve => {\n // prevent downstream exporter calls from generating spans\n context.with(suppressTracing(context.active()), () => {\n exporter.export(arg, resolve);\n });\n });\n}\n//# sourceMappingURL=exporter.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport { W3CBaggagePropagator } from './baggage/propagation/W3CBaggagePropagator';\nexport { AnchoredClock } from './common/anchored-clock';\nexport { isAttributeValue, sanitizeAttributes } from './common/attributes';\nexport { globalErrorHandler, setGlobalErrorHandler, } from './common/global-error-handler';\nexport { loggingErrorHandler } from './common/logging-error-handler';\nexport { addHrTimes, getTimeOrigin, hrTime, hrTimeDuration, hrTimeToMicroseconds, hrTimeToMilliseconds, hrTimeToNanoseconds, hrTimeToTimeStamp, isTimeInput, isTimeInputHrTime, millisToHrTime, timeInputToHrTime, } from './common/time';\nexport { unrefTimer } from './common/timer-util';\nexport { ExportResultCode } from './ExportResult';\nexport { parseKeyPairsIntoRecord } from './baggage/utils';\nexport { SDK_INFO, _globalThis, getStringFromEnv, getBooleanFromEnv, getNumberFromEnv, getStringListFromEnv, otperformance, } from './platform';\nexport { CompositePropagator } from './propagation/composite';\nexport { TRACE_PARENT_HEADER, TRACE_STATE_HEADER, W3CTraceContextPropagator, parseTraceParent, } from './trace/W3CTraceContextPropagator';\nexport { RPCType, deleteRPCMetadata, getRPCMetadata, setRPCMetadata, } from './trace/rpc-metadata';\nexport { isTracingSuppressed, suppressTracing, unsuppressTracing, } from './trace/suppress-tracing';\nexport { TraceState } from './trace/TraceState';\nexport { merge } from './utils/merge';\nexport { TimeoutError, callWithTimeout } from './utils/timeout';\nexport { isUrlIgnored, urlMatches } from './utils/url';\nexport { BindOnceFuture } from './utils/callback';\nexport { diagLogLevelFromString } from './utils/configuration';\nimport { _export } from './internal/exporter';\nexport const internal = {\n _export,\n};\n//# sourceMappingURL=index.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport class OTLPExporterBase {\n _delegate;\n constructor(delegate) {\n this._delegate = delegate;\n }\n /**\n * Export items.\n * @param items\n * @param resultCallback\n */\n export(items, resultCallback) {\n this._delegate.export(items, resultCallback);\n }\n forceFlush() {\n return this._delegate.forceFlush();\n }\n shutdown() {\n return this._delegate.shutdown();\n }\n}\n//# sourceMappingURL=OTLPExporterBase.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * Interface for handling error\n */\nexport class OTLPExporterError extends Error {\n code;\n name = 'OTLPExporterError';\n data;\n constructor(message, code, data) {\n super(message);\n this.data = data;\n this.code = code;\n }\n}\n//# sourceMappingURL=types.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport function validateTimeoutMillis(timeoutMillis) {\n if (Number.isFinite(timeoutMillis) && timeoutMillis > 0) {\n return timeoutMillis;\n }\n throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${timeoutMillis}')`);\n}\nexport function wrapStaticHeadersInFunction(headers) {\n if (headers == null) {\n return undefined;\n }\n return async () => headers;\n}\n/**\n * @param userProvidedConfiguration Configuration options provided by the user in code.\n * @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.\n * @param defaultConfiguration The defaults as defined by the exporter specification\n */\nexport function mergeOtlpSharedConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) {\n return {\n timeoutMillis: validateTimeoutMillis(userProvidedConfiguration.timeoutMillis ??\n fallbackConfiguration.timeoutMillis ??\n defaultConfiguration.timeoutMillis),\n concurrencyLimit: userProvidedConfiguration.concurrencyLimit ??\n fallbackConfiguration.concurrencyLimit ??\n defaultConfiguration.concurrencyLimit,\n compression: userProvidedConfiguration.compression ??\n fallbackConfiguration.compression ??\n defaultConfiguration.compression,\n };\n}\nexport function getSharedConfigurationDefaults() {\n return {\n timeoutMillis: 10000,\n concurrencyLimit: 30,\n compression: 'none',\n };\n}\n//# sourceMappingURL=shared-configuration.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nclass BoundedQueueExportPromiseHandler {\n _concurrencyLimit;\n _sendingPromises = [];\n /**\n * @param concurrencyLimit maximum promises allowed in a queue at the same time.\n */\n constructor(concurrencyLimit) {\n this._concurrencyLimit = concurrencyLimit;\n }\n pushPromise(promise) {\n if (this.hasReachedLimit()) {\n throw new Error('Concurrency Limit reached');\n }\n this._sendingPromises.push(promise);\n const popPromise = () => {\n const index = this._sendingPromises.indexOf(promise);\n void this._sendingPromises.splice(index, 1);\n };\n promise.then(popPromise, popPromise);\n }\n hasReachedLimit() {\n return this._sendingPromises.length >= this._concurrencyLimit;\n }\n async awaitAll() {\n await Promise.all(this._sendingPromises);\n }\n}\n/**\n * Promise queue for keeping track of export promises. Finished promises will be auto-dequeued.\n * Allows for awaiting all promises in the queue.\n */\nexport function createBoundedQueueExportPromiseHandler(options) {\n return new BoundedQueueExportPromiseHandler(options.concurrencyLimit);\n}\n//# sourceMappingURL=bounded-queue-export-promise-handler.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\nfunction isPartialSuccessResponse(response) {\n return Object.prototype.hasOwnProperty.call(response, 'partialSuccess');\n}\n/**\n * Default response handler that logs a partial success to the console.\n */\nexport function createLoggingPartialSuccessResponseHandler() {\n return {\n handleResponse(response) {\n // Partial success MUST never be an empty object according the specification\n // see https://opentelemetry.io/docs/specs/otlp/#partial-success\n if (response == null ||\n !isPartialSuccessResponse(response) ||\n response.partialSuccess == null ||\n Object.keys(response.partialSuccess).length === 0) {\n return;\n }\n diag.warn('Received Partial Success response:', JSON.stringify(response.partialSuccess));\n },\n };\n}\n//# sourceMappingURL=logging-response-handler.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ExportResultCode } from '@opentelemetry/core';\nimport { OTLPExporterError } from './types';\nimport { createLoggingPartialSuccessResponseHandler } from './logging-response-handler';\nimport { diag } from '@opentelemetry/api';\nclass OTLPExportDelegate {\n _diagLogger;\n _transport;\n _serializer;\n _responseHandler;\n _promiseQueue;\n _timeout;\n constructor(transport, serializer, responseHandler, promiseQueue, timeout) {\n this._transport = transport;\n this._serializer = serializer;\n this._responseHandler = responseHandler;\n this._promiseQueue = promiseQueue;\n this._timeout = timeout;\n this._diagLogger = diag.createComponentLogger({\n namespace: 'OTLPExportDelegate',\n });\n }\n export(internalRepresentation, resultCallback) {\n this._diagLogger.debug('items to be sent', internalRepresentation);\n // don't do any work if too many exports are in progress.\n if (this._promiseQueue.hasReachedLimit()) {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new Error('Concurrent export limit reached'),\n });\n return;\n }\n const serializedRequest = this._serializer.serializeRequest(internalRepresentation);\n if (serializedRequest == null) {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new Error('Nothing to send'),\n });\n return;\n }\n this._promiseQueue.pushPromise(this._transport.send(serializedRequest, this._timeout).then(response => {\n if (response.status === 'success') {\n if (response.data != null) {\n try {\n this._responseHandler.handleResponse(this._serializer.deserializeResponse(response.data));\n }\n catch (e) {\n this._diagLogger.warn('Export succeeded but could not deserialize response - is the response specification compliant?', e, response.data);\n }\n }\n // No matter the response, we can consider the export still successful.\n resultCallback({\n code: ExportResultCode.SUCCESS,\n });\n return;\n }\n else if (response.status === 'failure' && response.error) {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: response.error,\n });\n return;\n }\n else if (response.status === 'retryable') {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: response.error ??\n new OTLPExporterError('Export failed with retryable status'),\n });\n }\n else {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new OTLPExporterError('Export failed with unknown error'),\n });\n }\n }, reason => resultCallback({\n code: ExportResultCode.FAILED,\n error: reason,\n })));\n }\n forceFlush() {\n return this._promiseQueue.awaitAll();\n }\n async shutdown() {\n this._diagLogger.debug('shutdown started');\n await this.forceFlush();\n this._transport.shutdown();\n }\n}\n/**\n * Creates a generic delegate for OTLP exports which only contains parts of the OTLP export that are shared across all\n * signals.\n */\nexport function createOtlpExportDelegate(components, settings) {\n return new OTLPExportDelegate(components.transport, components.serializer, createLoggingPartialSuccessResponseHandler(), components.promiseHandler, settings.timeout);\n}\n//# sourceMappingURL=otlp-export-delegate.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createBoundedQueueExportPromiseHandler } from './bounded-queue-export-promise-handler';\nimport { createOtlpExportDelegate } from './otlp-export-delegate';\nexport function createOtlpNetworkExportDelegate(options, serializer, transport) {\n return createOtlpExportDelegate({\n transport: transport,\n serializer,\n promiseHandler: createBoundedQueueExportPromiseHandler(options),\n }, { timeout: options.timeoutMillis });\n}\n//# sourceMappingURL=otlp-network-export-delegate.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nlet serviceName;\n/**\n * Returns the default service name for OpenTelemetry resources.\n * In Node.js environments, returns \"unknown_service:<process.argv0>\".\n * In browser/edge environments, returns \"unknown_service\".\n */\nexport function defaultServiceName() {\n if (serviceName === undefined) {\n try {\n const argv0 = globalThis.process.argv0;\n serviceName = argv0 ? `unknown_service:${argv0}` : 'unknown_service';\n }\n catch {\n serviceName = 'unknown_service';\n }\n }\n return serviceName;\n}\n/** @internal For testing purposes only */\nexport function _clearDefaultServiceNameCache() {\n serviceName = undefined;\n}\n//# sourceMappingURL=default-service-name.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport const isPromiseLike = (val) => {\n return (val !== null &&\n typeof val === 'object' &&\n typeof val.then === 'function');\n};\n//# sourceMappingURL=utils.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\nimport { SDK_INFO } from '@opentelemetry/core';\nimport { ATTR_SERVICE_NAME, ATTR_TELEMETRY_SDK_LANGUAGE, ATTR_TELEMETRY_SDK_NAME, ATTR_TELEMETRY_SDK_VERSION, } from '@opentelemetry/semantic-conventions';\nimport { defaultServiceName } from './default-service-name';\nimport { isPromiseLike } from './utils';\nclass ResourceImpl {\n _rawAttributes;\n _asyncAttributesPending = false;\n _schemaUrl;\n _memoizedAttributes;\n static FromAttributeList(attributes, options) {\n const res = new ResourceImpl({}, options);\n res._rawAttributes = guardedRawAttributes(attributes);\n res._asyncAttributesPending =\n attributes.filter(([_, val]) => isPromiseLike(val)).length > 0;\n return res;\n }\n constructor(\n /**\n * A dictionary of attributes with string keys and values that provide\n * information about the entity as numbers, strings or booleans\n * TODO: Consider to add check/validation on attributes.\n */\n resource, options) {\n const attributes = resource.attributes ?? {};\n this._rawAttributes = Object.entries(attributes).map(([k, v]) => {\n if (isPromiseLike(v)) {\n // side-effect\n this._asyncAttributesPending = true;\n }\n return [k, v];\n });\n this._rawAttributes = guardedRawAttributes(this._rawAttributes);\n this._schemaUrl = validateSchemaUrl(options?.schemaUrl);\n }\n get asyncAttributesPending() {\n return this._asyncAttributesPending;\n }\n async waitForAsyncAttributes() {\n if (!this.asyncAttributesPending) {\n return;\n }\n for (let i = 0; i < this._rawAttributes.length; i++) {\n const [k, v] = this._rawAttributes[i];\n this._rawAttributes[i] = [k, isPromiseLike(v) ? await v : v];\n }\n this._asyncAttributesPending = false;\n }\n get attributes() {\n if (this.asyncAttributesPending) {\n diag.error('Accessing resource attributes before async attributes settled');\n }\n if (this._memoizedAttributes) {\n return this._memoizedAttributes;\n }\n const attrs = {};\n for (const [k, v] of this._rawAttributes) {\n if (isPromiseLike(v)) {\n diag.debug(`Unsettled resource attribute ${k} skipped`);\n continue;\n }\n if (v != null) {\n attrs[k] ??= v;\n }\n }\n // only memoize output if all attributes are settled\n if (!this._asyncAttributesPending) {\n this._memoizedAttributes = attrs;\n }\n return attrs;\n }\n getRawAttributes() {\n return this._rawAttributes;\n }\n get schemaUrl() {\n return this._schemaUrl;\n }\n merge(resource) {\n if (resource == null)\n return this;\n // Order is important\n // Spec states incoming attributes override existing attributes\n const mergedSchemaUrl = mergeSchemaUrl(this, resource);\n const mergedOptions = mergedSchemaUrl\n ? { schemaUrl: mergedSchemaUrl }\n : undefined;\n return ResourceImpl.FromAttributeList([...resource.getRawAttributes(), ...this.getRawAttributes()], mergedOptions);\n }\n}\nexport function resourceFromAttributes(attributes, options) {\n return ResourceImpl.FromAttributeList(Object.entries(attributes), options);\n}\nexport function resourceFromDetectedResource(detectedResource, options) {\n return new ResourceImpl(detectedResource, options);\n}\nexport function emptyResource() {\n return resourceFromAttributes({});\n}\nexport function defaultResource() {\n return resourceFromAttributes({\n [ATTR_SERVICE_NAME]: defaultServiceName(),\n [ATTR_TELEMETRY_SDK_LANGUAGE]: SDK_INFO[ATTR_TELEMETRY_SDK_LANGUAGE],\n [ATTR_TELEMETRY_SDK_NAME]: SDK_INFO[ATTR_TELEMETRY_SDK_NAME],\n [ATTR_TELEMETRY_SDK_VERSION]: SDK_INFO[ATTR_TELEMETRY_SDK_VERSION],\n });\n}\nfunction guardedRawAttributes(attributes) {\n return attributes.map(([k, v]) => {\n if (isPromiseLike(v)) {\n return [\n k,\n v.catch(err => {\n diag.debug('promise rejection for resource attribute: %s - %s', k, err);\n return undefined;\n }),\n ];\n }\n return [k, v];\n });\n}\nfunction validateSchemaUrl(schemaUrl) {\n if (typeof schemaUrl === 'string' || schemaUrl === undefined) {\n return schemaUrl;\n }\n diag.warn('Schema URL must be string or undefined, got %s. Schema URL will be ignored.', schemaUrl);\n return undefined;\n}\nfunction mergeSchemaUrl(old, updating) {\n const oldSchemaUrl = old?.schemaUrl;\n const updatingSchemaUrl = updating?.schemaUrl;\n const isOldEmpty = oldSchemaUrl === undefined || oldSchemaUrl === '';\n const isUpdatingEmpty = updatingSchemaUrl === undefined || updatingSchemaUrl === '';\n if (isOldEmpty) {\n return updatingSchemaUrl;\n }\n if (isUpdatingEmpty) {\n return oldSchemaUrl;\n }\n if (oldSchemaUrl === updatingSchemaUrl) {\n return oldSchemaUrl;\n }\n diag.warn('Schema URL merge conflict: old resource has \"%s\", updating resource has \"%s\". Resulting resource will have undefined Schema URL.', oldSchemaUrl, updatingSchemaUrl);\n return undefined;\n}\n//# sourceMappingURL=ResourceImpl.js.map","export function createResource(resource, encoder) {\n const result = {\n attributes: toAttributes(resource.attributes, encoder),\n droppedAttributesCount: 0,\n };\n const schemaUrl = resource.schemaUrl;\n if (schemaUrl && schemaUrl !== '')\n result.schemaUrl = schemaUrl;\n return result;\n}\nexport function createInstrumentationScope(scope) {\n return {\n name: scope.name,\n version: scope.version,\n };\n}\nexport function toAttributes(attributes, encoder) {\n return Object.keys(attributes).map(key => toKeyValue(key, attributes[key], encoder));\n}\nexport function toKeyValue(key, value, encoder) {\n return {\n key: key,\n value: toAnyValue(value, encoder),\n };\n}\nexport function toAnyValue(value, encoder) {\n const t = typeof value;\n if (t === 'string')\n return { stringValue: value };\n if (t === 'number') {\n if (!Number.isInteger(value))\n return { doubleValue: value };\n return { intValue: value };\n }\n if (t === 'boolean')\n return { boolValue: value };\n if (value instanceof Uint8Array)\n return { bytesValue: encoder.encodeUint8Array(value) };\n if (Array.isArray(value)) {\n const values = new Array(value.length);\n for (let i = 0; i < value.length; i++) {\n values[i] = toAnyValue(value[i], encoder);\n }\n return { arrayValue: { values } };\n }\n if (t === 'object' && value != null) {\n const keys = Object.keys(value);\n const values = new Array(keys.length);\n for (let i = 0; i < keys.length; i++) {\n values[i] = {\n key: keys[i],\n value: toAnyValue(value[keys[i]], encoder),\n };\n }\n return { kvlistValue: { values } };\n }\n return {};\n}\n//# sourceMappingURL=internal.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { hrTimeToNanoseconds } from '@opentelemetry/core';\nimport { hexToBinary } from './hex-to-binary';\nexport function hrTimeToNanos(hrTime) {\n const NANOSECONDS = BigInt(1000000000);\n return (BigInt(Math.trunc(hrTime[0])) * NANOSECONDS + BigInt(Math.trunc(hrTime[1])));\n}\nexport function toLongBits(value) {\n const low = Number(BigInt.asUintN(32, value));\n const high = Number(BigInt.asUintN(32, value >> BigInt(32)));\n return { low, high };\n}\nexport function encodeAsLongBits(hrTime) {\n const nanos = hrTimeToNanos(hrTime);\n return toLongBits(nanos);\n}\nexport function encodeAsString(hrTime) {\n const nanos = hrTimeToNanos(hrTime);\n return nanos.toString();\n}\nconst encodeTimestamp = typeof BigInt !== 'undefined' ? encodeAsString : hrTimeToNanoseconds;\nfunction identity(value) {\n return value;\n}\nfunction optionalHexToBinary(str) {\n if (str === undefined)\n return undefined;\n return hexToBinary(str);\n}\n/**\n * Encoder for protobuf format.\n * Uses { high, low } timestamps and binary for span/trace IDs, leaves Uint8Array attributes as-is.\n */\nexport const PROTOBUF_ENCODER = {\n encodeHrTime: encodeAsLongBits,\n encodeSpanContext: hexToBinary,\n encodeOptionalSpanContext: optionalHexToBinary,\n encodeUint8Array: identity,\n};\n/**\n * Encoder for JSON format.\n * Uses string timestamps, hex for span/trace IDs, and base64 for Uint8Array.\n */\nexport const JSON_ENCODER = {\n encodeHrTime: encodeTimestamp,\n encodeSpanContext: identity,\n encodeOptionalSpanContext: identity,\n encodeUint8Array: (bytes) => {\n if (typeof Buffer !== 'undefined') {\n return Buffer.from(bytes).toString('base64');\n }\n // implementation note: not using spread operator and passing to\n // btoa to avoid stack overflow on large Uint8Arrays\n const chars = new Array(bytes.length);\n for (let i = 0; i < bytes.length; i++) {\n chars[i] = String.fromCharCode(bytes[i]);\n }\n return btoa(chars.join(''));\n },\n};\n//# sourceMappingURL=utils.js.map","import { createInstrumentationScope, createResource, toAttributes, } from '../common/internal';\n// Span flags constants matching the OTLP specification\nconst SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK = 0x100;\nconst SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK = 0x200;\n/**\n * Builds the 32-bit span flags value combining the low 8-bit W3C TraceFlags\n * with the HAS_IS_REMOTE and IS_REMOTE bits according to the OTLP spec.\n */\nfunction buildSpanFlagsFrom(traceFlags, isRemote) {\n // low 8 bits are W3C TraceFlags (e.g., sampled)\n let flags = (traceFlags & 0xff) | SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK;\n if (isRemote) {\n flags |= SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK;\n }\n return flags;\n}\nexport function sdkSpanToOtlpSpan(span, encoder) {\n const ctx = span.spanContext();\n const status = span.status;\n const parentSpanId = span.parentSpanContext?.spanId\n ? encoder.encodeSpanContext(span.parentSpanContext?.spanId)\n : undefined;\n return {\n traceId: encoder.encodeSpanContext(ctx.traceId),\n spanId: encoder.encodeSpanContext(ctx.spanId),\n parentSpanId: parentSpanId,\n traceState: ctx.traceState?.serialize(),\n name: span.name,\n // Span kind is offset by 1 because the API does not define a value for unset\n kind: span.kind == null ? 0 : span.kind + 1,\n startTimeUnixNano: encoder.encodeHrTime(span.startTime),\n endTimeUnixNano: encoder.encodeHrTime(span.endTime),\n attributes: toAttributes(span.attributes, encoder),\n droppedAttributesCount: span.droppedAttributesCount,\n events: span.events.map(event => toOtlpSpanEvent(event, encoder)),\n droppedEventsCount: span.droppedEventsCount,\n status: {\n // API and proto enums share the same values\n code: status.code,\n message: status.message,\n },\n links: span.links.map(link => toOtlpLink(link, encoder)),\n droppedLinksCount: span.droppedLinksCount,\n flags: buildSpanFlagsFrom(ctx.traceFlags, span.parentSpanContext?.isRemote),\n };\n}\nexport function toOtlpLink(link, encoder) {\n return {\n attributes: link.attributes ? toAttributes(link.attributes, encoder) : [],\n spanId: encoder.encodeSpanContext(link.context.spanId),\n traceId: encoder.encodeSpanContext(link.context.traceId),\n traceState: link.context.traceState?.serialize(),\n droppedAttributesCount: link.droppedAttributesCount || 0,\n flags: buildSpanFlagsFrom(link.context.traceFlags, link.context.isRemote),\n };\n}\nexport function toOtlpSpanEvent(timedEvent, encoder) {\n return {\n attributes: timedEvent.attributes\n ? toAttributes(timedEvent.attributes, encoder)\n : [],\n name: timedEvent.name,\n timeUnixNano: encoder.encodeHrTime(timedEvent.time),\n droppedAttributesCount: timedEvent.droppedAttributesCount || 0,\n };\n}\nexport function createExportTraceServiceRequest(spans, encoder) {\n return {\n resourceSpans: spanRecordsToResourceSpans(spans, encoder),\n };\n}\nfunction createResourceMap(readableSpans) {\n const resourceMap = new Map();\n for (const record of readableSpans) {\n let ilsMap = resourceMap.get(record.resource);\n if (!ilsMap) {\n ilsMap = new Map();\n resourceMap.set(record.resource, ilsMap);\n }\n // TODO this is duplicated in basic tracer. Consolidate on a common helper in core\n const instrumentationScopeKey = `${record.instrumentationScope.name}@${record.instrumentationScope.version || ''}:${record.instrumentationScope.schemaUrl || ''}`;\n let records = ilsMap.get(instrumentationScopeKey);\n if (!records) {\n records = [];\n ilsMap.set(instrumentationScopeKey, records);\n }\n records.push(record);\n }\n return resourceMap;\n}\nfunction spanRecordsToResourceSpans(readableSpans, encoder) {\n const resourceMap = createResourceMap(readableSpans);\n const out = [];\n const entryIterator = resourceMap.entries();\n let entry = entryIterator.next();\n while (!entry.done) {\n const [resource, ilmMap] = entry.value;\n const scopeResourceSpans = [];\n const ilmIterator = ilmMap.values();\n let ilmEntry = ilmIterator.next();\n while (!ilmEntry.done) {\n const scopeSpans = ilmEntry.value;\n if (scopeSpans.length > 0) {\n const spans = scopeSpans.map(readableSpan => sdkSpanToOtlpSpan(readableSpan, encoder));\n scopeResourceSpans.push({\n scope: createInstrumentationScope(scopeSpans[0].instrumentationScope),\n spans: spans,\n schemaUrl: scopeSpans[0].instrumentationScope.schemaUrl,\n });\n }\n ilmEntry = ilmIterator.next();\n }\n const processedResource = createResource(resource, encoder);\n const transformedSpans = {\n resource: processedResource,\n scopeSpans: scopeResourceSpans,\n schemaUrl: processedResource.schemaUrl,\n };\n out.push(transformedSpans);\n entry = entryIterator.next();\n }\n return out;\n}\n//# sourceMappingURL=internal.js.map","import { createExportTraceServiceRequest } from '../internal';\nimport { JSON_ENCODER } from '../../common/utils';\nimport { diag } from '@opentelemetry/api';\nexport const JsonTraceSerializer = {\n serializeRequest: (arg) => {\n const request = createExportTraceServiceRequest(arg, JSON_ENCODER);\n const encoder = new TextEncoder();\n return encoder.encode(JSON.stringify(request));\n },\n deserializeResponse: (arg) => {\n if (arg.length === 0) {\n return {};\n }\n const decoder = new TextDecoder();\n try {\n return JSON.parse(decoder.decode(arg));\n }\n catch (err) {\n diag.warn(`Failed to parse trace export response: ${err.message}. Returning empty response`);\n return {};\n }\n },\n};\n//# sourceMappingURL=trace.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\nconst MAX_ATTEMPTS = 5;\nconst INITIAL_BACKOFF = 1000;\nconst MAX_BACKOFF = 5000;\nconst BACKOFF_MULTIPLIER = 1.5;\nconst JITTER = 0.2;\n/**\n * Get a pseudo-random jitter that falls in the range of [-JITTER, +JITTER]\n */\nfunction getJitter() {\n return Math.random() * (2 * JITTER) - JITTER;\n}\nclass RetryingTransport {\n _transport;\n constructor(transport) {\n this._transport = transport;\n }\n retry(data, timeoutMillis, inMillis) {\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n this._transport.send(data, timeoutMillis).then(resolve, reject);\n }, inMillis);\n });\n }\n async send(data, timeoutMillis) {\n let attempts = MAX_ATTEMPTS;\n let nextBackoff = INITIAL_BACKOFF;\n const deadline = Date.now() + timeoutMillis;\n let result = await this._transport.send(data, timeoutMillis);\n while (result.status === 'retryable' && attempts > 0) {\n attempts--;\n // use maximum of computed backoff and 0 to avoid negative timeouts\n const backoff = Math.max(Math.min(nextBackoff * (1 + getJitter()), MAX_BACKOFF), 0);\n nextBackoff = nextBackoff * BACKOFF_MULTIPLIER;\n const retryInMillis = result.retryInMillis ?? backoff;\n // return when expected retry time is after the export deadline.\n const remainingTimeoutMillis = deadline - Date.now();\n if (retryInMillis > remainingTimeoutMillis) {\n diag.info(`Export retry time ${Math.round(retryInMillis)}ms exceeds remaining timeout ${Math.round(remainingTimeoutMillis)}ms, not retrying further.`);\n return result;\n }\n diag.verbose(`Scheduling export retry in ${Math.round(retryInMillis)}ms`);\n result = await this.retry(data, remainingTimeoutMillis, retryInMillis);\n }\n if (result.status === 'success') {\n diag.verbose(`Export succeeded after ${MAX_ATTEMPTS - attempts} retry attempts.`);\n }\n else if (result.status === 'retryable') {\n diag.info(`Export failed after maximum retry attempts (${MAX_ATTEMPTS}).`);\n }\n else {\n diag.info(`Export failed with non-retryable error: ${result.error}`);\n }\n return result;\n }\n shutdown() {\n return this._transport.shutdown();\n }\n}\n/**\n * Creates an Exporter Transport that retries on 'retryable' response.\n */\nexport function createRetryingTransport(options) {\n return new RetryingTransport(options.transport);\n}\n//# sourceMappingURL=retrying-transport.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport function isExportHTTPErrorRetryable(statusCode) {\n return (statusCode === 429 ||\n statusCode === 502 ||\n statusCode === 503 ||\n statusCode === 504);\n}\nexport function parseRetryAfterToMills(retryAfter) {\n if (retryAfter == null) {\n return undefined;\n }\n const seconds = Number.parseInt(retryAfter, 10);\n if (Number.isInteger(seconds)) {\n return seconds > 0 ? seconds * 1000 : -1;\n }\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After#directives\n const delay = new Date(retryAfter).getTime() - Date.now();\n if (delay >= 0) {\n return delay;\n }\n return 0;\n}\n//# sourceMappingURL=is-export-retryable.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\nimport { isExportHTTPErrorRetryable, parseRetryAfterToMills, } from '../is-export-retryable';\n/**\n * Maximum total body size for concurrent keepalive requests.\n * Browsers enforce a 64KiB cumulative limit across all pending keepalive requests.\n * We use 60KB to leave headroom for headers.\n * @see https://github.com/whatwg/fetch/issues/679\n * @see https://blog.huli.tw/2025/01/06/en/navigator-sendbeacon-64kib-and-source-code/\n */\nconst MAX_KEEPALIVE_BODY_SIZE = 60 * 1024;\n/**\n * Maximum concurrent keepalive requests.\n * Chrome enforces 9 concurrent keepalive fetch requests per renderer process.\n * @see https://github.com/whatwg/fetch/issues/679\n * Quote: \"If the renderer process is processing more than 9 requests with keepalive set, we reject a new request\"\n */\nconst MAX_KEEPALIVE_REQUESTS = 9;\n/**\n * Track cumulative pending body size across all in-flight keepalive requests.\n * This is necessary because the 64KiB limit is cumulative, not per-request.\n */\nlet pendingBodySize = 0;\n/**\n * Track number of pending keepalive requests.\n */\nlet pendingKeepaliveCount = 0;\nclass FetchTransport {\n _parameters;\n constructor(parameters) {\n this._parameters = parameters;\n }\n async send(data, timeoutMillis) {\n const abortController = new AbortController();\n const timeout = setTimeout(() => abortController.abort(), timeoutMillis);\n // Fetch API may be wrapped by an instrumentation like `@opentelemetry/instrumentation-fetch`.\n // In that case the instrumentation would create a new Span for this request\n // because the context manager cannot keep the context after `await` calls.\n // This creates an indirect endless loop Export -> Span -> Export\n // By using the `__original` function the instrumentation can't intercept the call\n // and no Span will be created breaking the vicious cycle\n let fetchApi = globalThis.fetch;\n // @ts-expect-error -- fetch could be wrapped\n if (typeof fetchApi.__original === 'function') {\n // @ts-expect-error -- fetch could be wrapped\n fetchApi = fetchApi.__original;\n }\n const requestSize = data.byteLength;\n // Determine if we can use keepalive based on cumulative browser limits.\n // We must check BEFORE adding to pending totals to avoid exceeding limits.\n const wouldExceedSize = pendingBodySize + requestSize > MAX_KEEPALIVE_BODY_SIZE;\n const wouldExceedCount = pendingKeepaliveCount >= MAX_KEEPALIVE_REQUESTS;\n const useKeepalive = !wouldExceedSize && !wouldExceedCount;\n if (useKeepalive) {\n pendingBodySize += requestSize;\n pendingKeepaliveCount++;\n }\n else {\n const reason = wouldExceedSize ? 'size limit' : 'count limit';\n diag.debug(`keepalive disabled: ${(requestSize / 1024).toFixed(1)}KB payload, ${pendingKeepaliveCount} pending (${reason})`);\n }\n try {\n const url = new URL(this._parameters.url);\n const response = await fetchApi(url.href, {\n method: 'POST',\n headers: await this._parameters.headers(),\n body: data,\n signal: abortController.signal,\n keepalive: useKeepalive,\n mode: globalThis.location\n ? globalThis.location.origin === url.origin\n ? 'same-origin'\n : 'cors'\n : 'no-cors',\n });\n if (response.status >= 200 && response.status <= 299) {\n diag.debug(`export response success (status: ${response.status})`);\n return { status: 'success' };\n }\n else if (isExportHTTPErrorRetryable(response.status)) {\n diag.warn(`export response retryable (status: ${response.status})`);\n const retryAfter = response.headers.get('Retry-After');\n const retryInMillis = parseRetryAfterToMills(retryAfter);\n return { status: 'retryable', retryInMillis };\n }\n diag.error(`export response failure (status: ${response.status})`);\n return {\n status: 'failure',\n error: new Error(`Fetch request failed with non-retryable status ${response.status}`),\n };\n }\n catch (error) {\n if (isFetchNetworkErrorRetryable(error)) {\n diag.warn(`export request retryable (network error: ${error})`);\n return {\n status: 'retryable',\n error: new Error('Fetch request encountered a network error', {\n cause: error,\n }),\n };\n }\n diag.error(`export request failure (error: ${error})`);\n return {\n status: 'failure',\n error: new Error('Fetch request errored', { cause: error }),\n };\n }\n finally {\n clearTimeout(timeout);\n if (useKeepalive) {\n pendingBodySize -= requestSize;\n pendingKeepaliveCount--;\n }\n }\n }\n shutdown() {\n // Intentionally left empty, nothing to do.\n }\n}\n/**\n * Creates an exporter transport that uses `fetch` to send the data\n * @param parameters applied to each request made by transport\n */\nexport function createFetchTransport(parameters) {\n return new FetchTransport(parameters);\n}\nfunction isFetchNetworkErrorRetryable(error) {\n return error instanceof TypeError && !error.cause;\n}\n//# sourceMappingURL=fetch-transport.js.map","import { createRetryingTransport } from './retrying-transport';\nimport { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';\nimport { createFetchTransport } from './transport/fetch-transport';\nexport function createOtlpFetchExportDelegate(options, serializer) {\n return createOtlpNetworkExportDelegate(options, serializer, createRetryingTransport({\n transport: createFetchTransport(options),\n }));\n}\n/**\n * @deprecated Use {@link createOtlpFetchExportDelegate} instead. Modern browsers use `fetch` with `keepAlive: true` when `sendBeacon` is used. Use a `fetch` polyfill that mimics this behavior to keep using `sendBeacon`.\n */\nexport function createOtlpSendBeaconExportDelegate(options, serializer) {\n return createOtlpFetchExportDelegate(options, serializer);\n}\n//# sourceMappingURL=otlp-browser-http-export-delegate.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\n/**\n * Parses headers from config leaving only those that have defined values\n * @param partialHeaders\n */\nexport function validateAndNormalizeHeaders(partialHeaders) {\n const headers = {};\n Object.entries(partialHeaders ?? {}).forEach(([key, value]) => {\n if (typeof value !== 'undefined') {\n headers[key] = String(value);\n }\n else {\n diag.warn(`Header \"${key}\" has invalid value (${value}) and will be ignored`);\n }\n });\n return headers;\n}\n//# sourceMappingURL=util.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { getSharedConfigurationDefaults, mergeOtlpSharedConfigurationWithDefaults, } from './shared-configuration';\nimport { validateAndNormalizeHeaders } from '../util';\nfunction mergeHeaders(userProvidedHeaders, fallbackHeaders, defaultHeaders) {\n return async () => {\n const requiredHeaders = {\n ...(await defaultHeaders()),\n };\n const headers = {};\n // add fallback ones first\n if (fallbackHeaders != null) {\n Object.assign(headers, await fallbackHeaders());\n }\n // override with user-provided ones\n if (userProvidedHeaders != null) {\n Object.assign(headers, validateAndNormalizeHeaders(await userProvidedHeaders()));\n }\n // override required ones.\n return Object.assign(headers, requiredHeaders);\n };\n}\nfunction validateUserProvidedUrl(url) {\n if (url == null) {\n return undefined;\n }\n try {\n // NOTE: In non-browser environments, `globalThis.location` will be `undefined`.\n const base = globalThis.location?.href;\n return new URL(url, base).href;\n }\n catch {\n throw new Error(`Configuration: Could not parse user-provided export URL: '${url}'`);\n }\n}\n/**\n * @param userProvidedConfiguration Configuration options provided by the user in code.\n * @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.\n * @param defaultConfiguration The defaults as defined by the exporter specification\n */\nexport function mergeOtlpHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) {\n return {\n ...mergeOtlpSharedConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration),\n headers: mergeHeaders(userProvidedConfiguration.headers, fallbackConfiguration.headers, defaultConfiguration.headers),\n url: validateUserProvidedUrl(userProvidedConfiguration.url) ??\n fallbackConfiguration.url ??\n defaultConfiguration.url,\n };\n}\nexport function getHttpConfigurationDefaults(requiredHeaders, signalResourcePath) {\n return {\n ...getSharedConfigurationDefaults(),\n headers: async () => requiredHeaders,\n url: 'http://localhost:4318/' + signalResourcePath,\n };\n}\n//# sourceMappingURL=otlp-http-configuration.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { wrapStaticHeadersInFunction } from './shared-configuration';\nexport function convertLegacyHeaders(config) {\n if (typeof config.headers === 'function') {\n return config.headers;\n }\n return wrapStaticHeadersInFunction(config.headers);\n}\n//# sourceMappingURL=convert-legacy-http-options.js.map","import { getHttpConfigurationDefaults, mergeOtlpHttpConfigurationWithDefaults, } from './otlp-http-configuration';\nimport { convertLegacyHeaders } from './convert-legacy-http-options';\n/**\n * @deprecated this will be removed in 2.0\n *\n * @param config\n * @param signalResourcePath\n * @param requiredHeaders\n */\nexport function convertLegacyBrowserHttpOptions(config, signalResourcePath, requiredHeaders) {\n return mergeOtlpHttpConfigurationWithDefaults({\n url: config.url,\n timeoutMillis: config.timeoutMillis,\n headers: convertLegacyHeaders(config),\n concurrencyLimit: config.concurrencyLimit,\n }, {}, // no fallback for browser case\n getHttpConfigurationDefaults(requiredHeaders, signalResourcePath));\n}\n//# sourceMappingURL=convert-legacy-browser-http-options.js.map","import { createOtlpFetchExportDelegate } from '../otlp-browser-http-export-delegate';\nimport { convertLegacyBrowserHttpOptions } from './convert-legacy-browser-http-options';\n/**\n * @deprecated\n * @param config\n * @param serializer\n * @param signalResourcePath\n * @param requiredHeaders\n */\nexport function createLegacyOtlpBrowserExportDelegate(config, serializer, signalResourcePath, requiredHeaders) {\n const options = convertLegacyBrowserHttpOptions(config, signalResourcePath, requiredHeaders);\n return createOtlpFetchExportDelegate(options, serializer);\n}\n//# sourceMappingURL=create-legacy-browser-delegate.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { OTLPExporterBase } from '@opentelemetry/otlp-exporter-base';\nimport { JsonTraceSerializer } from '@opentelemetry/otlp-transformer';\nimport { createLegacyOtlpBrowserExportDelegate } from '@opentelemetry/otlp-exporter-base/browser-http';\n/**\n * Collector Trace Exporter for Web\n */\nexport class OTLPTraceExporter extends OTLPExporterBase {\n constructor(config = {}) {\n super(createLegacyOtlpBrowserExportDelegate(config, JsonTraceSerializer, 'v1/traces', { 'Content-Type': 'application/json' }));\n }\n}\n//# sourceMappingURL=OTLPTraceExporter.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n// Event name definitions\nexport const ExceptionEventName = 'exception';\n//# sourceMappingURL=enums.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag, SpanStatusCode } from '@opentelemetry/api';\nimport { addHrTimes, millisToHrTime, hrTime, hrTimeDuration, isAttributeValue, isTimeInput, isTimeInputHrTime, otperformance, sanitizeAttributes, } from '@opentelemetry/core';\nimport { ATTR_EXCEPTION_MESSAGE, ATTR_EXCEPTION_STACKTRACE, ATTR_EXCEPTION_TYPE, } from '@opentelemetry/semantic-conventions';\nimport { ExceptionEventName } from './enums';\n/**\n * This class represents a span.\n */\nexport class SpanImpl {\n // Below properties are included to implement ReadableSpan for export\n // purposes but are not intended to be written-to directly.\n _spanContext;\n kind;\n parentSpanContext;\n attributes = {};\n links = [];\n events = [];\n startTime;\n resource;\n instrumentationScope;\n _droppedAttributesCount = 0;\n _droppedEventsCount = 0;\n _droppedLinksCount = 0;\n _attributesCount = 0;\n name;\n status = {\n code: SpanStatusCode.UNSET,\n };\n endTime = [0, 0];\n _ended = false;\n _duration = [-1, -1];\n _spanProcessor;\n _spanLimits;\n _attributeValueLengthLimit;\n _recordEndMetrics;\n _performanceStartTime;\n _performanceOffset;\n _startTimeProvided;\n /**\n * Constructs a new SpanImpl instance.\n */\n constructor(opts) {\n const now = Date.now();\n this._spanContext = opts.spanContext;\n this._performanceStartTime = otperformance.now();\n this._performanceOffset =\n now - (this._performanceStartTime + otperformance.timeOrigin);\n this._startTimeProvided = opts.startTime != null;\n this._spanLimits = opts.spanLimits;\n this._attributeValueLengthLimit =\n this._spanLimits.attributeValueLengthLimit ?? 0;\n this._spanProcessor = opts.spanProcessor;\n this.name = opts.name;\n this.parentSpanContext = opts.parentSpanContext;\n this.kind = opts.kind;\n if (opts.links) {\n for (const link of opts.links) {\n this.addLink(link);\n }\n }\n this.startTime = this._getTime(opts.startTime ?? now);\n this.resource = opts.resource;\n this.instrumentationScope = opts.scope;\n this._recordEndMetrics = opts.recordEndMetrics;\n if (opts.attributes != null) {\n this.setAttributes(opts.attributes);\n }\n this._spanProcessor.onStart(this, opts.context);\n }\n spanContext() {\n return this._spanContext;\n }\n setAttribute(key, value) {\n if (value == null || this._isSpanEnded())\n return this;\n if (key.length === 0) {\n diag.warn(`Invalid attribute key: ${key}`);\n return this;\n }\n if (!isAttributeValue(value)) {\n diag.warn(`Invalid attribute value set for key: ${key}`);\n return this;\n }\n const { attributeCountLimit } = this._spanLimits;\n const isNewKey = !Object.prototype.hasOwnProperty.call(this.attributes, key);\n if (attributeCountLimit !== undefined &&\n this._attributesCount >= attributeCountLimit &&\n isNewKey) {\n this._droppedAttributesCount++;\n return this;\n }\n this.attributes[key] = this._truncateToSize(value);\n if (isNewKey) {\n this._attributesCount++;\n }\n return this;\n }\n setAttributes(attributes) {\n for (const key in attributes) {\n if (Object.prototype.hasOwnProperty.call(attributes, key)) {\n this.setAttribute(key, attributes[key]);\n }\n }\n return this;\n }\n /**\n *\n * @param name Span Name\n * @param [attributesOrStartTime] Span attributes or start time\n * if type is {@type TimeInput} and 3rd param is undefined\n * @param [timeStamp] Specified time stamp for the event\n */\n addEvent(name, attributesOrStartTime, timeStamp) {\n if (this._isSpanEnded())\n return this;\n const { eventCountLimit } = this._spanLimits;\n if (eventCountLimit === 0) {\n diag.warn('No events allowed.');\n this._droppedEventsCount++;\n return this;\n }\n if (eventCountLimit !== undefined &&\n this.events.length >= eventCountLimit) {\n if (this._droppedEventsCount === 0) {\n diag.debug('Dropping extra events.');\n }\n this.events.shift();\n this._droppedEventsCount++;\n }\n if (isTimeInput(attributesOrStartTime)) {\n if (!isTimeInput(timeStamp)) {\n timeStamp = attributesOrStartTime;\n }\n attributesOrStartTime = undefined;\n }\n const sanitized = sanitizeAttributes(attributesOrStartTime);\n const { attributePerEventCountLimit } = this._spanLimits;\n const attributes = {};\n let droppedAttributesCount = 0;\n let eventAttributesCount = 0;\n for (const attr in sanitized) {\n if (!Object.prototype.hasOwnProperty.call(sanitized, attr)) {\n continue;\n }\n const attrVal = sanitized[attr];\n if (attributePerEventCountLimit !== undefined &&\n eventAttributesCount >= attributePerEventCountLimit) {\n droppedAttributesCount++;\n continue;\n }\n attributes[attr] = this._truncateToSize(attrVal);\n eventAttributesCount++;\n }\n this.events.push({\n name,\n attributes,\n time: this._getTime(timeStamp),\n droppedAttributesCount,\n });\n return this;\n }\n addLink(link) {\n if (this._isSpanEnded())\n return this;\n const { linkCountLimit } = this._spanLimits;\n if (linkCountLimit === 0) {\n this._droppedLinksCount++;\n return this;\n }\n if (linkCountLimit !== undefined && this.links.length >= linkCountLimit) {\n if (this._droppedLinksCount === 0) {\n diag.debug('Dropping extra links.');\n }\n this.links.shift();\n this._droppedLinksCount++;\n }\n const { attributePerLinkCountLimit } = this._spanLimits;\n const sanitized = sanitizeAttributes(link.attributes);\n const attributes = {};\n let droppedAttributesCount = 0;\n let linkAttributesCount = 0;\n for (const attr in sanitized) {\n if (!Object.prototype.hasOwnProperty.call(sanitized, attr)) {\n continue;\n }\n const attrVal = sanitized[attr];\n if (attributePerLinkCountLimit !== undefined &&\n linkAttributesCount >= attributePerLinkCountLimit) {\n droppedAttributesCount++;\n continue;\n }\n attributes[attr] = this._truncateToSize(attrVal);\n linkAttributesCount++;\n }\n const processedLink = { context: link.context };\n if (linkAttributesCount > 0) {\n processedLink.attributes = attributes;\n }\n if (droppedAttributesCount > 0) {\n processedLink.droppedAttributesCount = droppedAttributesCount;\n }\n this.links.push(processedLink);\n return this;\n }\n addLinks(links) {\n for (const link of links) {\n this.addLink(link);\n }\n return this;\n }\n setStatus(status) {\n if (this._isSpanEnded())\n return this;\n if (status.code === SpanStatusCode.UNSET)\n return this;\n if (this.status.code === SpanStatusCode.OK)\n return this;\n const newStatus = { code: status.code };\n // When using try-catch, the caught \"error\" is of type `any`. When then assigning `any` to `status.message`,\n // TypeScript will not error. While this can happen during use of any API, it is more common on Span#setStatus()\n // as it's likely used in a catch-block. Therefore, we validate if `status.message` is actually a string, null, or\n // undefined to avoid an incorrect type causing issues downstream.\n if (status.code === SpanStatusCode.ERROR) {\n if (typeof status.message === 'string') {\n newStatus.message = status.message;\n }\n else if (status.message != null) {\n diag.warn(`Dropping invalid status.message of type '${typeof status.message}', expected 'string'`);\n }\n }\n this.status = newStatus;\n return this;\n }\n updateName(name) {\n if (this._isSpanEnded())\n return this;\n this.name = name;\n return this;\n }\n end(endTime) {\n if (this._isSpanEnded()) {\n diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);\n return;\n }\n this.endTime = this._getTime(endTime);\n this._duration = hrTimeDuration(this.startTime, this.endTime);\n if (this._duration[0] < 0) {\n diag.warn('Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.', this.startTime, this.endTime);\n this.endTime = this.startTime.slice();\n this._duration = [0, 0];\n }\n if (this._droppedEventsCount > 0) {\n diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`);\n }\n if (this._droppedLinksCount > 0) {\n diag.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`);\n }\n if (this._spanProcessor.onEnding) {\n this._spanProcessor.onEnding(this);\n }\n this._recordEndMetrics?.();\n this._ended = true;\n this._spanProcessor.onEnd(this);\n }\n _getTime(inp) {\n if (typeof inp === 'number' && inp <= otperformance.now()) {\n // must be a performance timestamp\n // apply correction and convert to hrtime\n return hrTime(inp + this._performanceOffset);\n }\n if (typeof inp === 'number') {\n return millisToHrTime(inp);\n }\n if (inp instanceof Date) {\n return millisToHrTime(inp.getTime());\n }\n if (isTimeInputHrTime(inp)) {\n return inp;\n }\n if (this._startTimeProvided) {\n // if user provided a time for the start manually\n // we can't use duration to calculate event/end times\n return millisToHrTime(Date.now());\n }\n const msDuration = otperformance.now() - this._performanceStartTime;\n return addHrTimes(this.startTime, millisToHrTime(msDuration));\n }\n isRecording() {\n return this._ended === false;\n }\n recordException(exception, time) {\n const attributes = {};\n if (typeof exception === 'string') {\n attributes[ATTR_EXCEPTION_MESSAGE] = exception;\n }\n else if (exception) {\n if (exception.code) {\n attributes[ATTR_EXCEPTION_TYPE] = exception.code.toString();\n }\n else if (exception.name) {\n attributes[ATTR_EXCEPTION_TYPE] = exception.name;\n }\n if (exception.message) {\n attributes[ATTR_EXCEPTION_MESSAGE] = exception.message;\n }\n if (exception.stack) {\n attributes[ATTR_EXCEPTION_STACKTRACE] = exception.stack;\n }\n }\n // these are minimum requirements from spec\n if (attributes[ATTR_EXCEPTION_TYPE] || attributes[ATTR_EXCEPTION_MESSAGE]) {\n this.addEvent(ExceptionEventName, attributes, time);\n }\n else {\n diag.warn(`Failed to record an exception ${exception}`);\n }\n }\n get duration() {\n return this._duration;\n }\n get ended() {\n return this._ended;\n }\n get droppedAttributesCount() {\n return this._droppedAttributesCount;\n }\n get droppedEventsCount() {\n return this._droppedEventsCount;\n }\n get droppedLinksCount() {\n return this._droppedLinksCount;\n }\n _isSpanEnded() {\n if (this._ended) {\n const error = new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);\n diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`, error);\n }\n return this._ended;\n }\n // Utility function to truncate given value within size\n // for value type of string, will truncate to given limit\n // for type of non-string, will return same value\n _truncateToLimitUtil(value, limit) {\n if (value.length <= limit) {\n return value;\n }\n return value.substring(0, limit);\n }\n /**\n * If the given attribute value is of type string and has more characters than given {@code attributeValueLengthLimit} then\n * return string with truncated to {@code attributeValueLengthLimit} characters\n *\n * If the given attribute value is array of strings then\n * return new array of strings with each element truncated to {@code attributeValueLengthLimit} characters\n *\n * Otherwise return same Attribute {@code value}\n *\n * @param value Attribute value\n * @returns truncated attribute value if required, otherwise same value\n */\n _truncateToSize(value) {\n const limit = this._attributeValueLengthLimit;\n // Check limit\n if (limit <= 0) {\n // Negative values are invalid, so do not truncate\n diag.warn(`Attribute value limit must be positive, got ${limit}`);\n return value;\n }\n // String\n if (typeof value === 'string') {\n return this._truncateToLimitUtil(value, limit);\n }\n // Array of strings\n if (Array.isArray(value)) {\n return value.map(val => typeof val === 'string' ? this._truncateToLimitUtil(val, limit) : val);\n }\n // Other types, no need to apply value length limit\n return value;\n }\n}\n//# sourceMappingURL=Span.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * A sampling decision that determines how a {@link Span} will be recorded\n * and collected.\n */\nexport var SamplingDecision;\n(function (SamplingDecision) {\n /**\n * `Span.isRecording() === false`, span will not be recorded and all events\n * and attributes will be dropped.\n */\n SamplingDecision[SamplingDecision[\"NOT_RECORD\"] = 0] = \"NOT_RECORD\";\n /**\n * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags}\n * MUST NOT be set.\n */\n SamplingDecision[SamplingDecision[\"RECORD\"] = 1] = \"RECORD\";\n /**\n * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags}\n * MUST be set.\n */\n SamplingDecision[SamplingDecision[\"RECORD_AND_SAMPLED\"] = 2] = \"RECORD_AND_SAMPLED\";\n})(SamplingDecision || (SamplingDecision = {}));\n//# sourceMappingURL=Sampler.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { SamplingDecision } from '../Sampler';\n/** Sampler that samples no traces. */\nexport class AlwaysOffSampler {\n shouldSample() {\n return {\n decision: SamplingDecision.NOT_RECORD,\n };\n }\n toString() {\n return 'AlwaysOffSampler';\n }\n}\n//# sourceMappingURL=AlwaysOffSampler.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { SamplingDecision } from '../Sampler';\n/** Sampler that samples all traces. */\nexport class AlwaysOnSampler {\n shouldSample() {\n return {\n decision: SamplingDecision.RECORD_AND_SAMPLED,\n };\n }\n toString() {\n return 'AlwaysOnSampler';\n }\n}\n//# sourceMappingURL=AlwaysOnSampler.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { isSpanContextValid, TraceFlags, trace } from '@opentelemetry/api';\nimport { globalErrorHandler } from '@opentelemetry/core';\nimport { AlwaysOffSampler } from './AlwaysOffSampler';\nimport { AlwaysOnSampler } from './AlwaysOnSampler';\n/**\n * A composite sampler that either respects the parent span's sampling decision\n * or delegates to `delegateSampler` for root spans.\n */\nexport class ParentBasedSampler {\n _root;\n _remoteParentSampled;\n _remoteParentNotSampled;\n _localParentSampled;\n _localParentNotSampled;\n constructor(config) {\n this._root = config.root;\n if (!this._root) {\n globalErrorHandler(new Error('ParentBasedSampler must have a root sampler configured'));\n this._root = new AlwaysOnSampler();\n }\n this._remoteParentSampled =\n config.remoteParentSampled ?? new AlwaysOnSampler();\n this._remoteParentNotSampled =\n config.remoteParentNotSampled ?? new AlwaysOffSampler();\n this._localParentSampled =\n config.localParentSampled ?? new AlwaysOnSampler();\n this._localParentNotSampled =\n config.localParentNotSampled ?? new AlwaysOffSampler();\n }\n shouldSample(context, traceId, spanName, spanKind, attributes, links) {\n const parentContext = trace.getSpanContext(context);\n if (!parentContext || !isSpanContextValid(parentContext)) {\n return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n if (parentContext.isRemote) {\n if (parentContext.traceFlags & TraceFlags.SAMPLED) {\n return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n if (parentContext.traceFlags & TraceFlags.SAMPLED) {\n return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n toString() {\n return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`;\n }\n}\n//# sourceMappingURL=ParentBasedSampler.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { isValidTraceId } from '@opentelemetry/api';\nimport { SamplingDecision } from '../Sampler';\n/** Sampler that samples a given fraction of traces based of trace id deterministically. */\nexport class TraceIdRatioBasedSampler {\n _ratio;\n _upperBound;\n constructor(ratio = 0) {\n this._ratio = this._normalize(ratio);\n this._upperBound = Math.floor(this._ratio * 0xffffffff);\n }\n shouldSample(context, traceId) {\n return {\n decision: isValidTraceId(traceId) && this._accumulate(traceId) < this._upperBound\n ? SamplingDecision.RECORD_AND_SAMPLED\n : SamplingDecision.NOT_RECORD,\n };\n }\n toString() {\n return `TraceIdRatioBased{${this._ratio}}`;\n }\n _normalize(ratio) {\n if (typeof ratio !== 'number' || isNaN(ratio))\n return 0;\n return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio;\n }\n _accumulate(traceId) {\n let accumulation = 0;\n for (let i = 0; i < 32; i += 8) {\n let part = 0;\n for (let j = 0; j < 8; j++) {\n const c = traceId.charCodeAt(i + j);\n // Convert hex char code to value: '0'-'9' -> 0-9, 'a'-'f' -> 10-15, 'A'-'F' -> 10-15\n const v = c < 58 ? c - 48 : c < 71 ? c - 55 : c - 87;\n part = (part << 4) | v;\n }\n accumulation = (accumulation ^ part) >>> 0;\n }\n return accumulation;\n }\n}\n//# sourceMappingURL=TraceIdRatioBasedSampler.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\nimport { getNumberFromEnv, getStringFromEnv } from '@opentelemetry/core';\nimport { AlwaysOffSampler } from './sampler/AlwaysOffSampler';\nimport { AlwaysOnSampler } from './sampler/AlwaysOnSampler';\nimport { ParentBasedSampler } from './sampler/ParentBasedSampler';\nimport { TraceIdRatioBasedSampler } from './sampler/TraceIdRatioBasedSampler';\nvar TracesSamplerValues;\n(function (TracesSamplerValues) {\n TracesSamplerValues[\"AlwaysOff\"] = \"always_off\";\n TracesSamplerValues[\"AlwaysOn\"] = \"always_on\";\n TracesSamplerValues[\"ParentBasedAlwaysOff\"] = \"parentbased_always_off\";\n TracesSamplerValues[\"ParentBasedAlwaysOn\"] = \"parentbased_always_on\";\n TracesSamplerValues[\"ParentBasedTraceIdRatio\"] = \"parentbased_traceidratio\";\n TracesSamplerValues[\"TraceIdRatio\"] = \"traceidratio\";\n})(TracesSamplerValues || (TracesSamplerValues = {}));\nconst DEFAULT_RATIO = 1;\n/**\n * Load default configuration. For fields with primitive values, any user-provided\n * value will override the corresponding default value. For fields with\n * non-primitive values (like `spanLimits`), the user-provided value will be\n * used to extend the default value.\n */\n// object needs to be wrapped in this function and called when needed otherwise\n// envs are parsed before tests are ran - causes tests using these envs to fail\nexport function loadDefaultConfig() {\n return {\n sampler: buildSamplerFromEnv(),\n forceFlushTimeoutMillis: 30000,\n generalLimits: {\n attributeValueLengthLimit: getNumberFromEnv('OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT') ?? Infinity,\n attributeCountLimit: getNumberFromEnv('OTEL_ATTRIBUTE_COUNT_LIMIT') ?? 128,\n },\n spanLimits: {\n attributeValueLengthLimit: getNumberFromEnv('OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT') ?? Infinity,\n attributeCountLimit: getNumberFromEnv('OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT') ?? 128,\n linkCountLimit: getNumberFromEnv('OTEL_SPAN_LINK_COUNT_LIMIT') ?? 128,\n eventCountLimit: getNumberFromEnv('OTEL_SPAN_EVENT_COUNT_LIMIT') ?? 128,\n attributePerEventCountLimit: getNumberFromEnv('OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT') ?? 128,\n attributePerLinkCountLimit: getNumberFromEnv('OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT') ?? 128,\n },\n };\n}\n/**\n * Based on environment, builds a sampler, complies with specification.\n */\nexport function buildSamplerFromEnv() {\n const sampler = getStringFromEnv('OTEL_TRACES_SAMPLER') ??\n TracesSamplerValues.ParentBasedAlwaysOn;\n switch (sampler) {\n case TracesSamplerValues.AlwaysOn:\n return new AlwaysOnSampler();\n case TracesSamplerValues.AlwaysOff:\n return new AlwaysOffSampler();\n case TracesSamplerValues.ParentBasedAlwaysOn:\n return new ParentBasedSampler({\n root: new AlwaysOnSampler(),\n });\n case TracesSamplerValues.ParentBasedAlwaysOff:\n return new ParentBasedSampler({\n root: new AlwaysOffSampler(),\n });\n case TracesSamplerValues.TraceIdRatio:\n return new TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv());\n case TracesSamplerValues.ParentBasedTraceIdRatio:\n return new ParentBasedSampler({\n root: new TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv()),\n });\n default:\n diag.error(`OTEL_TRACES_SAMPLER value \"${sampler}\" invalid, defaulting to \"${TracesSamplerValues.ParentBasedAlwaysOn}\".`);\n return new ParentBasedSampler({\n root: new AlwaysOnSampler(),\n });\n }\n}\nfunction getSamplerProbabilityFromEnv() {\n const probability = getNumberFromEnv('OTEL_TRACES_SAMPLER_ARG');\n if (probability == null) {\n diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${DEFAULT_RATIO}.`);\n return DEFAULT_RATIO;\n }\n if (probability < 0 || probability > 1) {\n diag.error(`OTEL_TRACES_SAMPLER_ARG=${probability} was given, but it is out of range ([0..1]), defaulting to ${DEFAULT_RATIO}.`);\n return DEFAULT_RATIO;\n }\n return probability;\n}\n//# sourceMappingURL=config.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { buildSamplerFromEnv, loadDefaultConfig } from './config';\nimport { getNumberFromEnv } from '@opentelemetry/core';\nexport const DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128;\nexport const DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity;\n/**\n * Function to merge Default configuration (as specified in './config') with\n * user provided configurations.\n */\nexport function mergeConfig(userConfig) {\n const perInstanceDefaults = {\n sampler: buildSamplerFromEnv(),\n };\n const DEFAULT_CONFIG = loadDefaultConfig();\n const target = Object.assign({}, DEFAULT_CONFIG, perInstanceDefaults, userConfig);\n target.generalLimits = Object.assign({}, DEFAULT_CONFIG.generalLimits, userConfig.generalLimits || {});\n target.spanLimits = Object.assign({}, DEFAULT_CONFIG.spanLimits, userConfig.spanLimits || {});\n return target;\n}\n/**\n * When general limits are provided and model specific limits are not,\n * configures the model specific limits by using the values from the general ones.\n * @param userConfig User provided tracer configuration\n */\nexport function reconfigureLimits(userConfig) {\n const spanLimits = Object.assign({}, userConfig.spanLimits);\n /**\n * Reassign span attribute count limit to use first non null value defined by user or use default value\n */\n spanLimits.attributeCountLimit =\n userConfig.spanLimits?.attributeCountLimit ??\n userConfig.generalLimits?.attributeCountLimit ??\n getNumberFromEnv('OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT') ??\n getNumberFromEnv('OTEL_ATTRIBUTE_COUNT_LIMIT') ??\n DEFAULT_ATTRIBUTE_COUNT_LIMIT;\n /**\n * Reassign span attribute value length limit to use first non null value defined by user or use default value\n */\n spanLimits.attributeValueLengthLimit =\n userConfig.spanLimits?.attributeValueLengthLimit ??\n userConfig.generalLimits?.attributeValueLengthLimit ??\n getNumberFromEnv('OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT') ??\n getNumberFromEnv('OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT') ??\n DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT;\n return Object.assign({}, userConfig, { spanLimits });\n}\n//# sourceMappingURL=utility.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { context, diag, TraceFlags } from '@opentelemetry/api';\nimport { BindOnceFuture, ExportResultCode, getNumberFromEnv, globalErrorHandler, suppressTracing, } from '@opentelemetry/core';\n/**\n * Implementation of the {@link SpanProcessor} that batches spans exported by\n * the SDK then pushes them to the exporter pipeline.\n */\nexport class BatchSpanProcessorBase {\n _maxExportBatchSize;\n _maxQueueSize;\n _scheduledDelayMillis;\n _exportTimeoutMillis;\n _exporter;\n _isExporting = false;\n _finishedSpans = [];\n _timer;\n _shutdownOnce;\n _droppedSpansCount = 0;\n constructor(exporter, config) {\n this._exporter = exporter;\n this._maxExportBatchSize =\n typeof config?.maxExportBatchSize === 'number'\n ? config.maxExportBatchSize\n : (getNumberFromEnv('OTEL_BSP_MAX_EXPORT_BATCH_SIZE') ?? 512);\n this._maxQueueSize =\n typeof config?.maxQueueSize === 'number'\n ? config.maxQueueSize\n : (getNumberFromEnv('OTEL_BSP_MAX_QUEUE_SIZE') ?? 2048);\n this._scheduledDelayMillis =\n typeof config?.scheduledDelayMillis === 'number'\n ? config.scheduledDelayMillis\n : (getNumberFromEnv('OTEL_BSP_SCHEDULE_DELAY') ?? 5000);\n this._exportTimeoutMillis =\n typeof config?.exportTimeoutMillis === 'number'\n ? config.exportTimeoutMillis\n : (getNumberFromEnv('OTEL_BSP_EXPORT_TIMEOUT') ?? 30000);\n this._shutdownOnce = new BindOnceFuture(this._shutdown, this);\n if (this._maxExportBatchSize > this._maxQueueSize) {\n diag.warn('BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize');\n this._maxExportBatchSize = this._maxQueueSize;\n }\n }\n forceFlush() {\n if (this._shutdownOnce.isCalled) {\n return this._shutdownOnce.promise;\n }\n return this._flushAll();\n }\n // does nothing.\n onStart(_span, _parentContext) { }\n onEnd(span) {\n if (this._shutdownOnce.isCalled) {\n return;\n }\n if ((span.spanContext().traceFlags & TraceFlags.SAMPLED) === 0) {\n return;\n }\n this._addToBuffer(span);\n }\n shutdown() {\n return this._shutdownOnce.call();\n }\n _shutdown() {\n return Promise.resolve()\n .then(() => {\n return this.onShutdown();\n })\n .then(() => {\n return this._flushAll();\n })\n .then(() => {\n return this._exporter.shutdown();\n });\n }\n /** Add a span in the buffer. */\n _addToBuffer(span) {\n if (this._finishedSpans.length >= this._maxQueueSize) {\n // limit reached, drop span\n if (this._droppedSpansCount === 0) {\n diag.debug('maxQueueSize reached, dropping spans');\n }\n this._droppedSpansCount++;\n return;\n }\n if (this._droppedSpansCount > 0) {\n // some spans were dropped, log once with count of spans dropped\n diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`);\n this._droppedSpansCount = 0;\n }\n this._finishedSpans.push(span);\n this._maybeStartTimer();\n }\n /**\n * Send all spans to the exporter respecting the batch size limit\n * This function is used only on forceFlush or shutdown,\n * for all other cases _flush should be used\n * */\n _flushAll() {\n return new Promise((resolve, reject) => {\n const promises = [];\n // calculate number of batches\n const count = Math.ceil(this._finishedSpans.length / this._maxExportBatchSize);\n for (let i = 0, j = count; i < j; i++) {\n promises.push(this._flushOneBatch());\n }\n Promise.all(promises)\n .then(() => {\n resolve();\n })\n .catch(reject);\n });\n }\n _flushOneBatch() {\n this._clearTimer();\n if (this._finishedSpans.length === 0) {\n return Promise.resolve();\n }\n return new Promise((resolve, reject) => {\n const timer = setTimeout(() => {\n // don't wait anymore for export, this way the next batch can start\n reject(new Error('Timeout'));\n }, this._exportTimeoutMillis);\n // prevent downstream exporter calls from generating spans\n context.with(suppressTracing(context.active()), () => {\n // Reset the finished spans buffer here because the next invocations of the _flush method\n // could pass the same finished spans to the exporter if the buffer is cleared\n // outside the execution of this callback.\n let spans;\n if (this._finishedSpans.length <= this._maxExportBatchSize) {\n spans = this._finishedSpans;\n this._finishedSpans = [];\n }\n else {\n spans = this._finishedSpans.splice(0, this._maxExportBatchSize);\n }\n const doExport = () => this._exporter.export(spans, result => {\n clearTimeout(timer);\n if (result.code === ExportResultCode.SUCCESS) {\n resolve();\n }\n else {\n reject(result.error ??\n new Error('BatchSpanProcessor: span export failed'));\n }\n });\n let pendingResources = null;\n for (let i = 0, len = spans.length; i < len; i++) {\n const span = spans[i];\n if (span.resource.asyncAttributesPending &&\n span.resource.waitForAsyncAttributes) {\n pendingResources ??= [];\n pendingResources.push(span.resource.waitForAsyncAttributes());\n }\n }\n // Avoid scheduling a promise to make the behavior more predictable and easier to test\n if (pendingResources === null) {\n doExport();\n }\n else {\n Promise.all(pendingResources).then(doExport, err => {\n globalErrorHandler(err);\n reject(err);\n });\n }\n });\n });\n }\n _maybeStartTimer() {\n if (this._isExporting)\n return;\n const flush = () => {\n this._isExporting = true;\n this._flushOneBatch()\n .finally(() => {\n this._isExporting = false;\n if (this._finishedSpans.length > 0) {\n this._clearTimer();\n this._maybeStartTimer();\n }\n })\n .catch(e => {\n this._isExporting = false;\n globalErrorHandler(e);\n });\n };\n // we only wait if the queue doesn't have enough elements yet\n if (this._finishedSpans.length >= this._maxExportBatchSize) {\n return flush();\n }\n if (this._timer !== undefined)\n return;\n this._timer = setTimeout(() => flush(), this._scheduledDelayMillis);\n // depending on runtime, this may be a 'number' or NodeJS.Timeout\n if (typeof this._timer !== 'number') {\n this._timer.unref();\n }\n }\n _clearTimer() {\n if (this._timer !== undefined) {\n clearTimeout(this._timer);\n this._timer = undefined;\n }\n }\n}\n//# sourceMappingURL=BatchSpanProcessorBase.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { BatchSpanProcessorBase } from '../../../export/BatchSpanProcessorBase';\nimport { globalErrorHandler } from '@opentelemetry/core';\nexport class BatchSpanProcessor extends BatchSpanProcessorBase {\n _visibilityChangeListener;\n _pageHideListener;\n constructor(_exporter, config) {\n super(_exporter, config);\n this.onInit(config);\n }\n onInit(config) {\n if (config?.disableAutoFlushOnDocumentHide !== true &&\n typeof document !== 'undefined') {\n this._visibilityChangeListener = () => {\n if (document.visibilityState === 'hidden') {\n this.forceFlush().catch(error => {\n globalErrorHandler(error);\n });\n }\n };\n this._pageHideListener = () => {\n this.forceFlush().catch(error => {\n globalErrorHandler(error);\n });\n };\n document.addEventListener('visibilitychange', this._visibilityChangeListener);\n // use 'pagehide' event as a fallback for Safari; see https://bugs.webkit.org/show_bug.cgi?id=116769\n document.addEventListener('pagehide', this._pageHideListener);\n }\n }\n onShutdown() {\n if (typeof document !== 'undefined') {\n if (this._visibilityChangeListener) {\n document.removeEventListener('visibilitychange', this._visibilityChangeListener);\n }\n if (this._pageHideListener) {\n document.removeEventListener('pagehide', this._pageHideListener);\n }\n }\n }\n}\n//# sourceMappingURL=BatchSpanProcessor.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nconst TRACE_ID_BYTES = 16;\nconst SPAN_ID_BYTES = 8;\nconst TRACE_BUFFER = new Uint8Array(TRACE_ID_BYTES);\nconst SPAN_BUFFER = new Uint8Array(SPAN_ID_BYTES);\n// Byte-to-hex lookup is faster than toString(16) in browsers\nconst HEX = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * Fills buffer with random bytes, ensuring at least one is non-zero\n * per W3C Trace Context spec.\n */\nfunction randomFill(buf) {\n for (let i = 0; i < buf.length; i++) {\n buf[i] = (Math.random() * 256) >>> 0;\n }\n // Ensure non-zero\n for (let i = 0; i < buf.length; i++) {\n if (buf[i] > 0)\n return;\n }\n buf[buf.length - 1] = 1;\n}\nfunction toHex(buf) {\n let hex = '';\n for (let i = 0; i < buf.length; i++) {\n hex += HEX[buf[i]];\n }\n return hex;\n}\nexport class RandomIdGenerator {\n /**\n * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex\n * characters corresponding to 128 bits.\n */\n generateTraceId() {\n randomFill(TRACE_BUFFER);\n return toHex(TRACE_BUFFER);\n }\n /**\n * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex\n * characters corresponding to 64 bits.\n */\n generateSpanId() {\n randomFill(SPAN_BUFFER);\n return toHex(SPAN_BUFFER);\n }\n}\n//# sourceMappingURL=RandomIdGenerator.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n/**\n * Determines whether the span has a parent span, and if so, [whether it is a remote parent](https://opentelemetry.io/docs/specs/otel/trace/api/#isremote)\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OTEL_SPAN_PARENT_ORIGIN = 'otel.span.parent.origin';\n/**\n * The result value of the sampler for this span\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OTEL_SPAN_SAMPLING_RESULT = 'otel.span.sampling_result';\n/**\n * The number of created spans with `recording=true` for which the end operation has not been called yet.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_OTEL_SDK_SPAN_LIVE = 'otel.sdk.span.live';\n/**\n * The number of created spans.\n *\n * @note Implementations **MUST** record this metric for all spans, even for non-recording ones.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_OTEL_SDK_SPAN_STARTED = 'otel.sdk.span.started';\n//# sourceMappingURL=semconv.js.map","import { SamplingDecision } from './Sampler';\nimport { ATTR_OTEL_SPAN_PARENT_ORIGIN, ATTR_OTEL_SPAN_SAMPLING_RESULT, METRIC_OTEL_SDK_SPAN_LIVE, METRIC_OTEL_SDK_SPAN_STARTED, } from './semconv';\n/**\n * Generates `otel.sdk.span.*` metrics.\n * https://opentelemetry.io/docs/specs/semconv/otel/sdk-metrics/#span-metrics\n */\nexport class TracerMetrics {\n startedSpans;\n liveSpans;\n constructor(meter) {\n this.startedSpans = meter.createCounter(METRIC_OTEL_SDK_SPAN_STARTED, {\n unit: '{span}',\n description: 'The number of created spans.',\n });\n this.liveSpans = meter.createUpDownCounter(METRIC_OTEL_SDK_SPAN_LIVE, {\n unit: '{span}',\n description: 'The number of currently live spans.',\n });\n }\n startSpan(parentSpanCtx, samplingDecision) {\n const samplingDecisionStr = samplingDecisionToString(samplingDecision);\n this.startedSpans.add(1, {\n [ATTR_OTEL_SPAN_PARENT_ORIGIN]: parentOrigin(parentSpanCtx),\n [ATTR_OTEL_SPAN_SAMPLING_RESULT]: samplingDecisionStr,\n });\n if (samplingDecision === SamplingDecision.NOT_RECORD) {\n return () => { };\n }\n const liveSpanAttributes = {\n [ATTR_OTEL_SPAN_SAMPLING_RESULT]: samplingDecisionStr,\n };\n this.liveSpans.add(1, liveSpanAttributes);\n return () => {\n this.liveSpans.add(-1, liveSpanAttributes);\n };\n }\n}\nfunction parentOrigin(parentSpanContext) {\n if (!parentSpanContext) {\n return 'none';\n }\n if (parentSpanContext.isRemote) {\n return 'remote';\n }\n return 'local';\n}\nfunction samplingDecisionToString(decision) {\n switch (decision) {\n case SamplingDecision.RECORD_AND_SAMPLED:\n return 'RECORD_AND_SAMPLE';\n case SamplingDecision.RECORD:\n return 'RECORD_ONLY';\n case SamplingDecision.NOT_RECORD:\n return 'DROP';\n }\n}\n//# sourceMappingURL=TracerMetrics.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '2.7.1';\n//# sourceMappingURL=version.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport * as api from '@opentelemetry/api';\nimport { sanitizeAttributes, isTracingSuppressed } from '@opentelemetry/core';\nimport { SpanImpl } from './Span';\nimport { mergeConfig } from './utility';\nimport { RandomIdGenerator } from './platform';\nimport { TracerMetrics } from './TracerMetrics';\nimport { VERSION } from './version';\n/**\n * This class represents a basic tracer.\n */\nexport class Tracer {\n _sampler;\n _generalLimits;\n _spanLimits;\n _idGenerator;\n instrumentationScope;\n _resource;\n _spanProcessor;\n _tracerMetrics;\n /**\n * Constructs a new Tracer instance.\n */\n constructor(instrumentationScope, config, resource, spanProcessor) {\n const localConfig = mergeConfig(config);\n this._sampler = localConfig.sampler;\n this._generalLimits = localConfig.generalLimits;\n this._spanLimits = localConfig.spanLimits;\n this._idGenerator = config.idGenerator || new RandomIdGenerator();\n this._resource = resource;\n this._spanProcessor = spanProcessor;\n this.instrumentationScope = instrumentationScope;\n const meter = localConfig.meterProvider\n ? localConfig.meterProvider.getMeter('@opentelemetry/sdk-trace', VERSION)\n : api.createNoopMeter();\n this._tracerMetrics = new TracerMetrics(meter);\n }\n /**\n * Starts a new Span or returns the default NoopSpan based on the sampling\n * decision.\n */\n startSpan(name, options = {}, context = api.context.active()) {\n // remove span from context in case a root span is requested via options\n if (options.root) {\n context = api.trace.deleteSpan(context);\n }\n const parentSpan = api.trace.getSpan(context);\n if (isTracingSuppressed(context)) {\n api.diag.debug('Instrumentation suppressed, returning Noop Span');\n const nonRecordingSpan = api.trace.wrapSpanContext(api.INVALID_SPAN_CONTEXT);\n return nonRecordingSpan;\n }\n const parentSpanContext = parentSpan?.spanContext();\n const spanId = this._idGenerator.generateSpanId();\n let validParentSpanContext;\n let traceId;\n let traceState;\n if (!parentSpanContext ||\n !api.trace.isSpanContextValid(parentSpanContext)) {\n // New root span.\n traceId = this._idGenerator.generateTraceId();\n }\n else {\n // New child span.\n traceId = parentSpanContext.traceId;\n traceState = parentSpanContext.traceState;\n validParentSpanContext = parentSpanContext;\n }\n const spanKind = options.kind ?? api.SpanKind.INTERNAL;\n const links = (options.links ?? []).map(link => {\n return {\n context: link.context,\n attributes: sanitizeAttributes(link.attributes),\n };\n });\n const attributes = sanitizeAttributes(options.attributes);\n // make sampling decision\n const samplingResult = this._sampler.shouldSample(context, traceId, name, spanKind, attributes, links);\n const recordEndMetrics = this._tracerMetrics.startSpan(parentSpanContext, samplingResult.decision);\n traceState = samplingResult.traceState ?? traceState;\n const traceFlags = samplingResult.decision === api.SamplingDecision.RECORD_AND_SAMPLED\n ? api.TraceFlags.SAMPLED\n : api.TraceFlags.NONE;\n const spanContext = { traceId, spanId, traceFlags, traceState };\n if (samplingResult.decision === api.SamplingDecision.NOT_RECORD) {\n api.diag.debug('Recording is off, propagating context in a non-recording span');\n const nonRecordingSpan = api.trace.wrapSpanContext(spanContext);\n return nonRecordingSpan;\n }\n // Set initial span attributes. The attributes object may have been mutated\n // by the sampler, so we sanitize the merged attributes before setting them.\n const initAttributes = sanitizeAttributes(Object.assign(attributes, samplingResult.attributes));\n const span = new SpanImpl({\n resource: this._resource,\n scope: this.instrumentationScope,\n context,\n spanContext,\n name,\n kind: spanKind,\n links,\n parentSpanContext: validParentSpanContext,\n attributes: initAttributes,\n startTime: options.startTime,\n spanProcessor: this._spanProcessor,\n spanLimits: this._spanLimits,\n recordEndMetrics,\n });\n return span;\n }\n startActiveSpan(name, arg2, arg3, arg4) {\n let opts;\n let ctx;\n let fn;\n if (arguments.length < 2) {\n return;\n }\n else if (arguments.length === 2) {\n fn = arg2;\n }\n else if (arguments.length === 3) {\n opts = arg2;\n fn = arg3;\n }\n else {\n opts = arg2;\n ctx = arg3;\n fn = arg4;\n }\n const parentContext = ctx ?? api.context.active();\n const span = this.startSpan(name, opts, parentContext);\n const contextWithSpanSet = api.trace.setSpan(parentContext, span);\n return api.context.with(contextWithSpanSet, fn, undefined, span);\n }\n /** Returns the active {@link GeneralLimits}. */\n getGeneralLimits() {\n return this._generalLimits;\n }\n /** Returns the active {@link SpanLimits}. */\n getSpanLimits() {\n return this._spanLimits;\n }\n}\n//# sourceMappingURL=Tracer.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { globalErrorHandler } from '@opentelemetry/core';\n/**\n * Implementation of the {@link SpanProcessor} that simply forwards all\n * received events to a list of {@link SpanProcessor}s.\n */\nexport class MultiSpanProcessor {\n _spanProcessors;\n constructor(spanProcessors) {\n this._spanProcessors = spanProcessors;\n }\n forceFlush() {\n const promises = [];\n for (const spanProcessor of this._spanProcessors) {\n promises.push(spanProcessor.forceFlush());\n }\n return new Promise(resolve => {\n Promise.all(promises)\n .then(() => {\n resolve();\n })\n .catch(error => {\n globalErrorHandler(error || new Error('MultiSpanProcessor: forceFlush failed'));\n resolve();\n });\n });\n }\n onStart(span, context) {\n for (const spanProcessor of this._spanProcessors) {\n spanProcessor.onStart(span, context);\n }\n }\n onEnding(span) {\n for (const spanProcessor of this._spanProcessors) {\n if (spanProcessor.onEnding) {\n spanProcessor.onEnding(span);\n }\n }\n }\n onEnd(span) {\n for (const spanProcessor of this._spanProcessors) {\n spanProcessor.onEnd(span);\n }\n }\n shutdown() {\n const promises = [];\n for (const spanProcessor of this._spanProcessors) {\n promises.push(spanProcessor.shutdown());\n }\n return new Promise((resolve, reject) => {\n Promise.all(promises).then(() => {\n resolve();\n }, reject);\n });\n }\n}\n//# sourceMappingURL=MultiSpanProcessor.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { merge } from '@opentelemetry/core';\nimport { defaultResource } from '@opentelemetry/resources';\nimport { Tracer } from './Tracer';\nimport { loadDefaultConfig } from './config';\nimport { MultiSpanProcessor } from './MultiSpanProcessor';\nimport { reconfigureLimits } from './utility';\nexport var ForceFlushState;\n(function (ForceFlushState) {\n ForceFlushState[ForceFlushState[\"resolved\"] = 0] = \"resolved\";\n ForceFlushState[ForceFlushState[\"timeout\"] = 1] = \"timeout\";\n ForceFlushState[ForceFlushState[\"error\"] = 2] = \"error\";\n ForceFlushState[ForceFlushState[\"unresolved\"] = 3] = \"unresolved\";\n})(ForceFlushState || (ForceFlushState = {}));\n/**\n * This class represents a basic tracer provider which platform libraries can extend\n */\nexport class BasicTracerProvider {\n _config;\n _tracers = new Map();\n _resource;\n _activeSpanProcessor;\n constructor(config = {}) {\n const mergedConfig = merge({}, loadDefaultConfig(), reconfigureLimits(config));\n this._resource = mergedConfig.resource ?? defaultResource();\n this._config = Object.assign({}, mergedConfig, {\n resource: this._resource,\n });\n const spanProcessors = [];\n if (config.spanProcessors?.length) {\n spanProcessors.push(...config.spanProcessors);\n }\n this._activeSpanProcessor = new MultiSpanProcessor(spanProcessors);\n }\n getTracer(name, version, options) {\n const key = `${name}@${version || ''}:${options?.schemaUrl || ''}`;\n if (!this._tracers.has(key)) {\n this._tracers.set(key, new Tracer({ name, version, schemaUrl: options?.schemaUrl }, this._config, this._resource, this._activeSpanProcessor));\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this._tracers.get(key);\n }\n forceFlush() {\n const timeout = this._config.forceFlushTimeoutMillis;\n const promises = this._activeSpanProcessor['_spanProcessors'].map((spanProcessor) => {\n return new Promise(resolve => {\n let state;\n const timeoutInterval = setTimeout(() => {\n resolve(new Error(`Span processor did not completed within timeout period of ${timeout} ms`));\n state = ForceFlushState.timeout;\n }, timeout);\n spanProcessor\n .forceFlush()\n .then(() => {\n clearTimeout(timeoutInterval);\n if (state !== ForceFlushState.timeout) {\n state = ForceFlushState.resolved;\n resolve(state);\n }\n })\n .catch(error => {\n clearTimeout(timeoutInterval);\n state = ForceFlushState.error;\n resolve(error);\n });\n });\n });\n return new Promise((resolve, reject) => {\n Promise.all(promises)\n .then(results => {\n const errors = results.filter(result => result !== ForceFlushState.resolved);\n if (errors.length > 0) {\n reject(errors);\n }\n else {\n resolve();\n }\n })\n .catch(error => reject([error]));\n });\n }\n shutdown() {\n return this._activeSpanProcessor.shutdown();\n }\n}\n//# sourceMappingURL=BasicTracerProvider.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { TraceFlags } from '@opentelemetry/api';\nimport { internal, ExportResultCode, globalErrorHandler, BindOnceFuture, } from '@opentelemetry/core';\n/**\n * An implementation of the {@link SpanProcessor} that converts the {@link Span}\n * to {@link ReadableSpan} and passes it to the configured exporter.\n *\n * Only spans that are sampled are converted.\n *\n * NOTE: This {@link SpanProcessor} exports every ended span individually instead of batching spans together, which causes significant performance overhead with most exporters. For production use, please consider using the {@link BatchSpanProcessor} instead.\n */\nexport class SimpleSpanProcessor {\n _exporter;\n _shutdownOnce;\n _pendingExports;\n constructor(exporter) {\n this._exporter = exporter;\n this._shutdownOnce = new BindOnceFuture(this._shutdown, this);\n this._pendingExports = new Set();\n }\n async forceFlush() {\n await Promise.all(Array.from(this._pendingExports));\n if (this._exporter.forceFlush) {\n await this._exporter.forceFlush();\n }\n }\n onStart(_span, _parentContext) { }\n onEnd(span) {\n if (this._shutdownOnce.isCalled) {\n return;\n }\n if ((span.spanContext().traceFlags & TraceFlags.SAMPLED) === 0) {\n return;\n }\n const pendingExport = this._doExport(span).catch(err => globalErrorHandler(err));\n // Enqueue this export to the pending list so it can be flushed by the user.\n this._pendingExports.add(pendingExport);\n void pendingExport.finally(() => this._pendingExports.delete(pendingExport));\n }\n async _doExport(span) {\n if (span.resource.asyncAttributesPending) {\n // Ensure resource is fully resolved before exporting.\n await span.resource.waitForAsyncAttributes?.();\n }\n const result = await internal._export(this._exporter, [span]);\n if (result.code !== ExportResultCode.SUCCESS) {\n throw (result.error ??\n new Error(`SimpleSpanProcessor: span export failed (status ${result})`));\n }\n }\n shutdown() {\n return this._shutdownOnce.call();\n }\n _shutdown() {\n return this._exporter.shutdown();\n }\n}\n//# sourceMappingURL=SimpleSpanProcessor.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ROOT_CONTEXT } from '@opentelemetry/api';\n/**\n * Stack Context Manager for managing the state in web\n * it doesn't fully support the async calls though\n */\nexport class StackContextManager {\n /**\n * whether the context manager is enabled or not\n */\n _enabled = false;\n /**\n * Keeps the reference to current context\n */\n _currentContext = ROOT_CONTEXT;\n /**\n *\n * @param context\n * @param target Function to be executed within the context\n */\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n _bindFunction(context = ROOT_CONTEXT, target) {\n const manager = this;\n const contextWrapper = function (...args) {\n return manager.with(context, () => target.apply(this, args));\n };\n Object.defineProperty(contextWrapper, 'length', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: target.length,\n });\n return contextWrapper;\n }\n /**\n * Returns the active context\n */\n active() {\n return this._currentContext;\n }\n /**\n * Binds a the certain context or the active one to the target function and then returns the target\n * @param context A context (span) to be bind to target\n * @param target a function or event emitter. When target or one of its callbacks is called,\n * the provided context will be used as the active context for the duration of the call.\n */\n bind(context, target) {\n // if no specific context to propagate is given, we use the current one\n if (context === undefined) {\n context = this.active();\n }\n if (typeof target === 'function') {\n return this._bindFunction(context, target);\n }\n return target;\n }\n /**\n * Disable the context manager (clears the current context)\n */\n disable() {\n this._currentContext = ROOT_CONTEXT;\n this._enabled = false;\n return this;\n }\n /**\n * Enables the context manager and creates a default(root) context\n */\n enable() {\n if (this._enabled) {\n return this;\n }\n this._enabled = true;\n this._currentContext = ROOT_CONTEXT;\n return this;\n }\n /**\n * Calls the callback function [fn] with the provided [context]. If [context] is undefined then it will use the window.\n * The context will be set as active\n * @param context\n * @param fn Callback function\n * @param thisArg optional receiver to be used for calling fn\n * @param args optional arguments forwarded to fn\n */\n with(context, fn, thisArg, ...args) {\n const previousContext = this._currentContext;\n this._currentContext = context || ROOT_CONTEXT;\n try {\n return fn.call(thisArg, ...args);\n }\n finally {\n this._currentContext = previousContext;\n }\n }\n}\n//# sourceMappingURL=StackContextManager.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { BasicTracerProvider } from '@opentelemetry/sdk-trace-base';\nimport { StackContextManager } from './StackContextManager';\nimport { trace, context, propagation } from '@opentelemetry/api';\nimport { CompositePropagator, W3CBaggagePropagator, W3CTraceContextPropagator, } from '@opentelemetry/core';\nfunction setupContextManager(contextManager) {\n // null means 'do not register'\n if (contextManager === null) {\n return;\n }\n // undefined means 'register default'\n if (contextManager === undefined) {\n const defaultContextManager = new StackContextManager();\n defaultContextManager.enable();\n context.setGlobalContextManager(defaultContextManager);\n return;\n }\n contextManager.enable();\n context.setGlobalContextManager(contextManager);\n}\nfunction setupPropagator(propagator) {\n // null means 'do not register'\n if (propagator === null) {\n return;\n }\n // undefined means 'register default'\n if (propagator === undefined) {\n propagation.setGlobalPropagator(new CompositePropagator({\n propagators: [\n new W3CTraceContextPropagator(),\n new W3CBaggagePropagator(),\n ],\n }));\n return;\n }\n propagation.setGlobalPropagator(propagator);\n}\n/**\n * This class represents a web tracer with {@link StackContextManager}\n */\nexport class WebTracerProvider extends BasicTracerProvider {\n /**\n * Constructs a new Tracer instance.\n * @param config Web Tracer config\n */\n constructor(config = {}) {\n super(config);\n }\n /**\n * Register this TracerProvider for use with the OpenTelemetry API.\n * Undefined values may be replaced with defaults, and\n * null values will be skipped.\n *\n * @param config Configuration object for SDK registration\n */\n register(config = {}) {\n trace.setGlobalTracerProvider(this);\n setupPropagator(config.propagator);\n setupContextManager(config.contextManager);\n }\n}\n//# sourceMappingURL=WebTracerProvider.js.map","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/**\n * 生成随机 ID。优先用 `crypto.randomUUID`(standards-compliant UUID v4),不可用时回退到\n * `${prefix}-${timestamp}-${rand}` 形式。\n *\n * 注意:fallback 实现使用 Math.random,**不是密码学安全**,仅适用于设备/会话/事件标识等场景,\n * 不要复用此函数生成 token、CSRF 防护等安全相关的值。\n */\nexport const createRandomId = (prefix: string) => {\n if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function') {\n return crypto.randomUUID();\n }\n return `${prefix}-${Date.now()}-${Math.random().toString(16).slice(2)}`;\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport type { BkOTUrlMatcher, ResolvedBkOTConfig } from './config';\n\nconst getBaseUrl = () => (typeof window === 'undefined' ? 'http://localhost' : window.location.origin);\n\nexport const toAbsoluteUrl = (url: string) => {\n try {\n return new URL(url, getBaseUrl()).href;\n } catch {\n return url;\n }\n};\n\nconst DYNAMIC_PATH_SEGMENT = /^(?:\\d+|[0-9a-f]{8}-[0-9a-f-]{27,}|[0-9a-f]{16,})$/i;\n\n/**\n * 常见数字 ID、UUID 和长十六进制段统一折叠为 :id,便于服务端按路由聚合。\n * 同时服务 `view.url_template`(页面路由)与 `url.template`(请求路径)两个维度。\n */\nexport const normalizeUrlPathTemplate = (pathGroup: string) => {\n const path = pathGroup.split(/[?#]/, 1)[0];\n return path\n .split('/')\n .map(segment => (DYNAMIC_PATH_SEGMENT.test(segment) ? ':id' : segment))\n .join('/');\n};\n\n// 去掉 trailing slash,便于 path 边界对齐比较\nconst stripTrailingSlash = (value: string) => (value.length > 1 ? value.replace(/\\/+$/, '') : value);\n\n// 比较两个 URL 是否指向同一资源(忽略 query/fragment 与末尾斜杠)\nconst isSameResource = (left: string, right: string) => {\n const stripped = (value: string) => stripTrailingSlash(value.replace(/[?#].*$/, ''));\n return stripped(left) === stripped(right);\n};\n\nexport const isBkOTEndpoint = (config: ResolvedBkOTConfig, url: string) => {\n const targetUrl = toAbsoluteUrl(url);\n return isSameResource(targetUrl, toAbsoluteUrl(config.transport.endpoint));\n};\n\nexport const shouldIgnoreUrl = (config: ResolvedBkOTConfig, url: string) => isBkOTEndpoint(config, url);\n\nconst matchesUrl = (matcher: BkOTUrlMatcher, url: string) => {\n if (typeof matcher === 'function') return matcher(url);\n if (typeof matcher === 'string') return url.includes(matcher);\n matcher.lastIndex = 0;\n return matcher.test(url);\n};\n\nexport const matchesUrlList = (matchers: BkOTUrlMatcher | BkOTUrlMatcher[] | undefined, url: string) =>\n (Array.isArray(matchers) ? matchers : matchers ? [matchers] : []).some(matcher => matchesUrl(matcher, url));\n\nconst getRequestConfig = (config: ResolvedBkOTConfig) =>\n typeof config.tracking.request === 'object' ? config.tracking.request : undefined;\n\nexport const shouldIgnoreRequest = (config: ResolvedBkOTConfig, url: string) =>\n shouldIgnoreUrl(config, url) || matchesUrlList(getRequestConfig(config)?.excludedUrls, toAbsoluteUrl(url));\n\n// Trace Header 仅向显式白名单注入,避免同源第三方路径被无意注入以及跨域 CORS 预检。\nexport const shouldPropagateTraceHeader = (config: ResolvedBkOTConfig, url: string) =>\n matchesUrlList(getRequestConfig(config)?.allowedTracingUrls, toAbsoluteUrl(url));\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n/**\n * RUM 上报字段 key 集中定义。\n *\n * 插件里不要散落硬编码字符串,后续字段命名调整只改这里,避免采集端与字段文档逐步漂移。\n */\nexport const RUM_ATTRIBUTES = {\n actionFrustrationType: 'action.frustration.type',\n actionId: 'action.id',\n actionLoadingTime: 'action.loading_time',\n actionName: 'action.name',\n actionTargetName: 'action.target.name',\n actionTargetTag: 'action.target.tag',\n actionType: 'action.type',\n deploymentEnvironmentName: 'deployment.environment.name',\n cacheHit: 'resource.cache.hit',\n deviceMemoryGib: 'device.memory_gib',\n deviceType: 'device.type',\n longTaskBlockingDuration: 'long_task.blocking_duration',\n longTaskDuration: 'long_task.duration',\n longTaskEntryType: 'long_task.entry_type',\n longTaskId: 'long_task.id',\n longTaskStartTime: 'long_task.start_time',\n networkEffectiveType: 'network.effective_type',\n networkStatus: 'network.status',\n nextHopProtocol: 'resource.protocol',\n outcomeReason: 'outcome.reason',\n outcomeType: 'outcome.type',\n serviceName: 'service.name',\n serviceVersion: 'service.version',\n sessionHasReplay: 'session.has_replay',\n sessionId: 'session.id',\n sessionSampleRate: 'session.sample_rate',\n sessionPhase: 'session.phase',\n sessionStartTime: 'session.start_time',\n sessionType: 'session.type',\n spanType: 'span_type',\n userId: 'user.id',\n userAgentName: 'user_agent.name',\n userAgentOsName: 'user_agent.os.name',\n userAgentVersion: 'user_agent.version',\n vitalMetric: 'vital.metric',\n vitalRating: 'vital.rating',\n vitalValue: 'vital.value',\n viewDomComplete: 'view.dom_complete',\n viewDomContentLoaded: 'view.dom_content_loaded',\n viewDomInteractive: 'view.dom_interactive',\n viewFirstByte: 'view.first_byte',\n viewId: 'view.id',\n viewLoadEvent: 'view.load_event',\n viewLoadingTime: 'view.loading_time',\n viewLoadingTimeSource: 'view.loading_time_source',\n viewLoadingType: 'view.loading_type',\n viewName: 'view.name',\n viewPhase: 'view.phase',\n viewStartedAt: 'view.started_at',\n viewUrl: 'view.url',\n viewUrlTemplate: 'view.url_template',\n viewVersion: 'view.version',\n websocketPhase: 'websocket.phase',\n} as const;\n\nexport type RumAttributeKey = (typeof RUM_ATTRIBUTES)[keyof typeof RUM_ATTRIBUTES];\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\nimport { RUM_ATTRIBUTES } from './attributes';\n\nimport type { Attributes } from '@opentelemetry/api';\n\n// 所有插件通过同一分类模型生成检索字段,保证错误、资源、Action 等信号可按统一维度聚合。\nexport const RUM_SPAN_OUTCOME = {\n abort: 'abort',\n error: 'error',\n success: 'success',\n timeout: 'timeout',\n warning: 'warning',\n} as const;\n\nexport const RUM_SPAN_TYPE = {\n action: 'action',\n custom: 'custom',\n error: 'error',\n longTask: 'long_task',\n resource: 'resource',\n session: 'session',\n vital: 'vital',\n view: 'view',\n websocket: 'websocket',\n} as const;\n\nexport type RumRequestOutcome =\n | { error?: unknown; type: 'network_error' }\n | { error?: unknown; type: 'timeout' }\n | { statusCode?: number; type: 'response' }\n | { type: 'abort' };\n\nexport interface RumResourceSpanInput {\n initiatorType?: string;\n method?: string;\n outcome?: RumRequestOutcome;\n url: string;\n}\n\nexport interface RumSpanClassification {\n outcome?: RumSpanOutcome;\n outcomeReason?: string;\n spanType: RumSpanType;\n}\n\nexport type RumSpanOutcome = (typeof RUM_SPAN_OUTCOME)[keyof typeof RUM_SPAN_OUTCOME];\n\nexport type RumSpanType = (typeof RUM_SPAN_TYPE)[keyof typeof RUM_SPAN_TYPE];\n\nexport interface RumUrlTarget {\n serverAddress?: string;\n serverPort?: number;\n}\n\nexport const getHttpOutcome = (statusCode: number | undefined): RumSpanOutcome => {\n if (statusCode === 408 || statusCode === 504) return RUM_SPAN_OUTCOME.timeout;\n if (typeof statusCode === 'number' && statusCode >= 400) return RUM_SPAN_OUTCOME.error;\n return RUM_SPAN_OUTCOME.success;\n};\n\nexport const getHttpOutcomeReason = (statusCode: number | undefined) => {\n if (statusCode === 408 || statusCode === 504) return 'network_timeout';\n if (typeof statusCode !== 'number' || statusCode < 400) return undefined;\n return statusCode >= 500 ? 'http_5xx' : 'http_4xx';\n};\n\nexport const getVitalOutcome = (rating: string | undefined): RumSpanOutcome =>\n rating === 'good' ? RUM_SPAN_OUTCOME.success : RUM_SPAN_OUTCOME.warning;\n\nexport const getUrlTarget = (url: string | undefined): RumUrlTarget => {\n if (!url) {\n return {};\n }\n try {\n const parsed = new URL(url, typeof location === 'undefined' ? 'http://localhost' : location.href);\n return {\n serverAddress: parsed.hostname,\n serverPort: parsed.port ? Number(parsed.port) : undefined,\n };\n } catch {\n return {};\n }\n};\n\nexport const buildRumSpanAttributes = ({\n outcome = RUM_SPAN_OUTCOME.success,\n outcomeReason,\n spanType,\n}: RumSpanClassification): Attributes => ({\n [RUM_ATTRIBUTES.spanType]: spanType,\n [RUM_ATTRIBUTES.outcomeType]: outcome,\n ...(outcomeReason ? { [RUM_ATTRIBUTES.outcomeReason]: outcomeReason } : {}),\n});\n\nexport const buildRumResourceSpanAttributes = ({\n initiatorType = 'other',\n method,\n outcome,\n url,\n}: RumResourceSpanInput): Attributes => {\n const target = getUrlTarget(url);\n const responseStatus =\n outcome?.type === 'response' && typeof outcome.statusCode === 'number' && outcome.statusCode > 0\n ? outcome.statusCode\n : undefined;\n const outcomeType =\n outcome?.type === 'abort'\n ? RUM_SPAN_OUTCOME.abort\n : outcome?.type === 'timeout'\n ? RUM_SPAN_OUTCOME.timeout\n : outcome?.type === 'network_error'\n ? RUM_SPAN_OUTCOME.error\n : typeof responseStatus === 'number'\n ? getHttpOutcome(responseStatus)\n : RUM_SPAN_OUTCOME.success;\n const outcomeReason =\n outcome?.type === 'timeout'\n ? 'network_timeout'\n : outcome?.type === 'network_error'\n ? 'network'\n : typeof responseStatus === 'number'\n ? getHttpOutcomeReason(responseStatus)\n : undefined;\n const normalizedMethod = method?.toUpperCase();\n return {\n ...buildRumSpanAttributes({\n outcome: outcomeType,\n outcomeReason,\n spanType: RUM_SPAN_TYPE.resource,\n }),\n ...(target.serverAddress ? { 'server.address': target.serverAddress } : {}),\n ...(target.serverPort !== undefined ? { 'server.port': target.serverPort } : {}),\n 'resource.type': initiatorType,\n ...(normalizedMethod ? { 'http.request.method': normalizedMethod } : {}),\n ...(typeof responseStatus === 'number' ? { 'http.response.status_code': responseStatus } : {}),\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { createRandomId } from '../core/id';\nimport { matchesUrlList } from '../core/url';\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\nimport { buildRumSpanAttributes, RUM_SPAN_OUTCOME, RUM_SPAN_TYPE } from '../schema/span';\n\nimport type { BkOTActivityEvent } from '../core/action-activity';\nimport type { BkOTPlugin, BkOTRuntimeContext } from '../core/plugin';\nimport type { Attributes } from '@opentelemetry/api';\n\n/**\n * 用户点击采集以“点击后产生的副作用”为 Action 生命周期:关联请求、资源、长任务、DOM 变化和错误,\n * 在活动安静后结束。完成后的 Action 暂缓至连击窗口结束再上报,以便把三次相近点击合并为一次 rage click。\n */\nconst ACTION_VALIDATION_DELAY = 100;\nconst ACTION_END_DELAY = 100;\nconst CLICK_CHAIN_DURATION = 1_000;\nconst CLICK_CHAIN_MAX_DISTANCE = 100;\nconst DEFAULT_ACTION_MAX_DURATION = 10_000;\nconst DEFAULT_ACTION_NAME_ATTRIBUTE = 'data-bk-action-name';\nconst MAX_NAME_LENGTH = 100;\nconst MAX_PARENTS_TO_CONSIDER = 10;\n\nexport interface BkOTActionPluginOptions {\n actionNameAttribute?: string;\n maxDuration?: number;\n /** 默认仅采集显式 data 属性;设为 text 才会读取可访问名称和 DOM 文本。 */\n nameCollection?: 'explicit' | 'text';\n}\n\ntype ActionFrustrationType = 'dead_click' | 'error_click' | 'rage_click';\n\ninterface ActiveAction {\n completed?: { endTime: number; hasLoadingTime: boolean };\n frustrations: Set<ActionFrustrationType>;\n hadActivity: boolean;\n hadError: boolean;\n id: string;\n lastActivityTime: number;\n maxDurationTimer: ReturnType<typeof setTimeout>;\n pendingRequests: Set<string>;\n quietTimer?: ReturnType<typeof setTimeout>;\n reportTimer?: ReturnType<typeof setTimeout>;\n runtimeAttributes: Attributes;\n startTime: number;\n target: Element;\n targetName: string;\n targetTag: string;\n userActivity: { input: boolean; scroll: boolean; selection: boolean };\n validationTimer: ReturnType<typeof setTimeout>;\n}\n\ninterface RecentClick {\n action: ActiveAction;\n target: Element;\n x: number;\n y: number;\n}\n\nconst normalizeText = (value: string) => value.replace(/\\s+/g, ' ').trim().slice(0, MAX_NAME_LENGTH);\n\nconst getParentElement = (element: Element) => {\n if (element.parentElement) {\n return element.parentElement;\n }\n const root = element.getRootNode?.();\n return typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot ? root.host : null;\n};\n\nconst findAttributeOnAncestors = (element: Element, attribute: string) => {\n let current: Element | null = element;\n while (current) {\n const value = current.getAttribute(attribute);\n if (value) {\n return normalizeText(value);\n }\n current = getParentElement(current);\n }\n return undefined;\n};\n\nconst getElementText = (element: Element) =>\n (element as HTMLElement).isContentEditable ? '' : normalizeText(element.textContent ?? '');\n\nconst getPriorityName = (element: Element) => {\n const formElement = element as Element & {\n labels?: HTMLLabelElement[] | NodeListOf<HTMLLabelElement>;\n value?: string;\n };\n const label = formElement.labels?.[0];\n if (label) {\n const labelText = getElementText(label);\n if (labelText) return labelText;\n }\n\n const tagName = element.tagName.toLowerCase();\n const inputType = element.getAttribute('type')?.toLowerCase();\n if (tagName === 'input' && ['button', 'reset', 'submit'].includes(inputType ?? '')) {\n const value = normalizeText(formElement.value ?? '');\n if (value) return value;\n }\n\n if (tagName === 'button' || tagName === 'label' || element.getAttribute('role') === 'button') {\n const text = getElementText(element);\n if (text) return text;\n }\n\n for (const attribute of ['aria-label', 'alt', 'name', 'title', 'placeholder']) {\n const value = normalizeText(element.getAttribute(attribute) ?? '');\n if (value) return value;\n }\n\n return undefined;\n};\n\nexport const getActionNameFromElement = (\n target: Element,\n actionNameAttribute = DEFAULT_ACTION_NAME_ATTRIBUTE,\n includeText = false,\n): string => {\n const explicitName = findAttributeOnAncestors(target, actionNameAttribute);\n if (explicitName) {\n return explicitName;\n }\n if (!includeText) return target.tagName.toLowerCase();\n\n let current: Element | null = target;\n let parentCount = 0;\n while (current && parentCount <= MAX_PARENTS_TO_CONSIDER) {\n const tagName = current.tagName.toLowerCase();\n if (tagName === 'body' || tagName === 'html' || tagName === 'head') break;\n const priorityName = getPriorityName(current);\n if (priorityName) return priorityName;\n if (tagName === 'form') break;\n current = getParentElement(current);\n parentCount += 1;\n }\n\n current = target;\n parentCount = 0;\n while (current && parentCount <= MAX_PARENTS_TO_CONSIDER) {\n const tagName = current.tagName.toLowerCase();\n if (tagName === 'body' || tagName === 'html' || tagName === 'head') break;\n const text = getElementText(current);\n if (text) return text;\n if (tagName === 'form') break;\n current = getParentElement(current);\n parentCount += 1;\n }\n\n return target.tagName.toLowerCase();\n};\n\nconst getElement = (event: Event) => {\n const composedTarget = event.composedPath?.()[0];\n if (composedTarget instanceof Element) return composedTarget;\n return event.target instanceof Element ? event.target : undefined;\n};\n\nconst toEpochTime = (event: Event) => {\n const eventTime = event.timeStamp;\n if (!Number.isFinite(eventTime) || eventTime <= 0) return Date.now();\n if (eventTime > 1_000_000_000_000) return eventTime;\n return typeof performance === 'undefined' ? Date.now() : performance.timeOrigin + eventTime;\n};\n\nconst positiveNumber = (value: number | undefined, fallback: number) =>\n typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : fallback;\n\nexport const isDeadClickExcluded = (target: Element) => {\n let current: Element | null = target;\n if (current.tagName.toLowerCase() === 'label' && current.hasAttribute('for')) {\n current = document.getElementById(current.getAttribute('for') ?? '');\n }\n\n while (current) {\n const tagName = current.tagName.toLowerCase();\n if (\n current.hasAttribute('contenteditable') ||\n tagName === 'canvas' ||\n tagName === 'select' ||\n tagName === 'textarea'\n ) {\n return true;\n }\n if (tagName === 'a' && current.hasAttribute('href')) return true;\n if (tagName === 'input') {\n return !['button', 'checkbox', 'radio', 'range', 'reset', 'submit'].includes(\n current.getAttribute('type')?.toLowerCase() ?? 'text',\n );\n }\n current = getParentElement(current);\n }\n return false;\n};\n\nexport const createActionPlugin = (options: BkOTActionPluginOptions = {}): BkOTPlugin => {\n const teardownCallbacks: Array<() => void> = [];\n const activeActions = new Map<string, ActiveAction>();\n const pendingActions = new Set<ActiveAction>();\n const actionNameAttribute = options.actionNameAttribute || DEFAULT_ACTION_NAME_ATTRIBUTE;\n const maxDuration = positiveNumber(options.maxDuration, DEFAULT_ACTION_MAX_DURATION);\n let recentClicks: RecentClick[] = [];\n let runtimeContext: BkOTRuntimeContext | undefined;\n\n const updateRuntimeActionIds = () => {\n runtimeContext?.setRuntimeAttributes({\n [RUM_ATTRIBUTES.actionId]: activeActions.size ? [...activeActions.keys()] : undefined,\n });\n };\n\n const isDeadAction = (action: ActiveAction) =>\n !action.hadActivity &&\n !action.userActivity.input &&\n !action.userActivity.scroll &&\n !action.userActivity.selection &&\n !isDeadClickExcluded(action.target);\n\n const reportAction = (action: ActiveAction) => {\n if (!pendingActions.delete(action) || !runtimeContext || !action.completed) return;\n clearTimeout(action.reportTimer);\n if (action.hadError) action.frustrations.add('error_click');\n if (isDeadAction(action)) action.frustrations.add('dead_click');\n const frustrationTypes = ['rage_click', 'dead_click', 'error_click'].filter(type =>\n action.frustrations.has(type as ActionFrustrationType),\n ) as ActionFrustrationType[];\n const { endTime, hasLoadingTime } = action.completed;\n const loadingTime = Math.max(0, endTime - action.startTime);\n const hasWarning = action.hadError || frustrationTypes.length > 0;\n const span = runtimeContext.startSpan(\n 'action.click',\n {\n ...runtimeContext.config.hooks.getPageAttributes(),\n ...buildRumSpanAttributes({\n outcome: hasWarning ? RUM_SPAN_OUTCOME.warning : RUM_SPAN_OUTCOME.success,\n spanType: RUM_SPAN_TYPE.action,\n }),\n ...action.runtimeAttributes,\n [RUM_ATTRIBUTES.actionId]: action.id,\n [RUM_ATTRIBUTES.actionType]: 'click',\n [RUM_ATTRIBUTES.actionName]: `Click on ${action.targetName}`,\n [RUM_ATTRIBUTES.actionTargetName]: action.targetName,\n [RUM_ATTRIBUTES.actionTargetTag]: action.targetTag,\n ...(frustrationTypes.length ? { [RUM_ATTRIBUTES.actionFrustrationType]: frustrationTypes } : {}),\n ...(hasLoadingTime ? { [RUM_ATTRIBUTES.actionLoadingTime]: loadingTime } : {}),\n },\n { startTime: action.startTime },\n );\n span.end(hasLoadingTime ? endTime : action.startTime);\n };\n\n const finishAction = (action: ActiveAction, endTime: number, hasLoadingTime: boolean) => {\n if (!activeActions.delete(action.id) || !runtimeContext) return;\n clearTimeout(action.validationTimer);\n clearTimeout(action.quietTimer);\n clearTimeout(action.maxDurationTimer);\n updateRuntimeActionIds();\n action.completed = { endTime, hasLoadingTime };\n pendingActions.add(action);\n // 等待连击窗口关闭后再落数,否则前两次点击已上报便无法合并为 rage click。\n const reportDelay = Math.max(0, action.startTime + CLICK_CHAIN_DURATION - Date.now());\n action.reportTimer = setTimeout(() => reportAction(action), reportDelay);\n };\n\n const flushPendingActions = () => {\n [...pendingActions].forEach(reportAction);\n };\n\n const scheduleActionEnd = (action: ActiveAction) => {\n clearTimeout(action.quietTimer);\n if (!action.hadActivity || action.pendingRequests.size) return;\n const delay = Math.max(0, action.lastActivityTime + ACTION_END_DELAY - Date.now());\n action.quietTimer = setTimeout(() => finishAction(action, action.lastActivityTime, true), delay);\n };\n\n const markActivity = (action: ActiveAction, time: number) => {\n action.hadActivity = true;\n action.lastActivityTime = Math.max(action.lastActivityTime, time);\n scheduleActionEnd(action);\n };\n\n const isInActionWindow = (action: ActiveAction, time: number) =>\n time >= action.startTime && time <= action.startTime + maxDuration;\n\n const onActivity = (event: BkOTActivityEvent) => {\n for (const action of activeActions.values()) {\n if (event.type === 'request_start') {\n if (event.url && matchesUrlList(runtimeContext?.config.view?.excludedActivityUrls, event.url)) continue;\n if (!isInActionWindow(action, event.time)) continue;\n action.pendingRequests.add(event.id);\n markActivity(action, event.time);\n continue;\n }\n if (event.type === 'request_end') {\n if (!action.pendingRequests.delete(event.id)) continue;\n markActivity(action, event.time);\n continue;\n }\n if (event.type === 'long_task' || event.type === 'resource') {\n if (\n event.type === 'resource' &&\n event.url &&\n matchesUrlList(runtimeContext?.config.view?.excludedActivityUrls, event.url)\n ) {\n continue;\n }\n if (\n event.startTime > action.startTime + maxDuration ||\n (event.type === 'resource' ? event.startTime < action.startTime : event.endTime < action.startTime)\n ) {\n continue;\n }\n markActivity(action, event.endTime);\n continue;\n }\n if (event.type === 'dom_mutation' || event.type === 'window_open') {\n if (isInActionWindow(action, event.time)) markActivity(action, event.time);\n continue;\n }\n if (event.type !== 'error') continue;\n if (!isInActionWindow(action, event.time)) continue;\n action.hadError = true;\n markActivity(action, event.time);\n }\n };\n\n const finishActiveActions = (endTime = Date.now()) => {\n [...activeActions.values()].forEach(action => finishAction(action, endTime, action.hadActivity));\n };\n\n const registerClick = (action: ActiveAction, event: Event) => {\n const x = 'clientX' in event && typeof event.clientX === 'number' ? event.clientX : 0;\n const y = 'clientY' in event && typeof event.clientY === 'number' ? event.clientY : 0;\n recentClicks = recentClicks.filter(click => action.startTime - click.action.startTime <= CLICK_CHAIN_DURATION);\n const lastClick = recentClicks.at(-1);\n const hasInterruptedChain = recentClicks.some(\n click => click.action.userActivity.scroll || click.action.userActivity.selection,\n );\n // 只有同一目标附近、未被滚动或选中文本打断的连续点击才视为同一连击链。\n const isSimilar =\n lastClick?.target === action.target && Math.hypot(lastClick.x - x, lastClick.y - y) <= CLICK_CHAIN_MAX_DISTANCE;\n if (hasInterruptedChain || (lastClick && !isSimilar)) recentClicks = [];\n recentClicks.push({ action, target: action.target, x, y });\n if (\n recentClicks.length >= 3 &&\n action.startTime - recentClicks[recentClicks.length - 3].action.startTime <= CLICK_CHAIN_DURATION\n ) {\n const rageSources = recentClicks.slice(-3).map(click => click.action);\n rageSources.forEach(source => source.frustrations.add('rage_click'));\n recentClicks = [];\n }\n };\n\n return {\n name: 'action',\n init(context) {\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n return;\n }\n runtimeContext = context;\n\n const listenerOptions: AddEventListenerOptions = { capture: true, passive: true };\n\n const startAction = (event: Event) => {\n if (!context.isSampled()) return;\n if ('button' in event && typeof event.button === 'number' && event.button !== 0) return;\n const element = getElement(event);\n if (!element) return;\n const startTime = toEpochTime(event);\n const id = createRandomId('action');\n const action: ActiveAction = {\n frustrations: new Set(),\n hadActivity: false,\n hadError: false,\n id,\n lastActivityTime: startTime,\n maxDurationTimer: setTimeout(() => finishAction(action, startTime + maxDuration, true), maxDuration),\n pendingRequests: new Set(),\n runtimeAttributes: context.getRuntimeAttributes(),\n startTime,\n target: element,\n targetName: getActionNameFromElement(element, actionNameAttribute, options.nameCollection === 'text'),\n targetTag: element.tagName.toLowerCase(),\n userActivity: { input: false, scroll: false, selection: false },\n validationTimer: setTimeout(() => {\n if (!action.hadActivity) finishAction(action, action.startTime, false);\n }, ACTION_VALIDATION_DELAY),\n };\n activeActions.set(id, action);\n registerClick(action, event);\n updateRuntimeActionIds();\n };\n\n window.addEventListener('click', startAction, listenerOptions);\n teardownCallbacks.push(() => window.removeEventListener('click', startAction, listenerOptions));\n\n const unsubscribeActivity = context.onActivity(onActivity);\n const unsubscribeSession = context.onSessionLifecycle(event => {\n if (event.type !== 'expired') return;\n finishActiveActions(event.expiredAt);\n flushPendingActions();\n });\n teardownCallbacks.push(unsubscribeActivity, unsubscribeSession);\n\n const finishOnHidden = () => {\n if (document.visibilityState === 'hidden') {\n finishActiveActions();\n flushPendingActions();\n }\n };\n const finishOnPageHide = () => {\n finishActiveActions();\n flushPendingActions();\n };\n window.addEventListener('pagehide', finishOnPageHide);\n document.addEventListener('visibilitychange', finishOnHidden);\n teardownCallbacks.push(\n () => window.removeEventListener('pagehide', finishOnPageHide),\n () => document.removeEventListener('visibilitychange', finishOnHidden),\n );\n\n const markUserActivity = (type: keyof ActiveAction['userActivity']) => {\n const actions = new Set([\n ...activeActions.values(),\n ...pendingActions,\n ...recentClicks.map(click => click.action),\n ]);\n actions.forEach(action => {\n action.userActivity[type] = true;\n // 滚动/选择表明用户仍在正常交互,撤销尚未上报的 rage click 判定。\n if (type !== 'input') action.frustrations.delete('rage_click');\n });\n };\n const onInput = () => markUserActivity('input');\n const onScroll = () => markUserActivity('scroll');\n const onSelectionChange = () => markUserActivity('selection');\n window.addEventListener('input', onInput, listenerOptions);\n window.addEventListener('scroll', onScroll, listenerOptions);\n document.addEventListener('selectionchange', onSelectionChange, listenerOptions);\n teardownCallbacks.push(\n () => window.removeEventListener('input', onInput, listenerOptions),\n () => window.removeEventListener('scroll', onScroll, listenerOptions),\n () => document.removeEventListener('selectionchange', onSelectionChange, listenerOptions),\n );\n },\n shutdown() {\n finishActiveActions();\n flushPendingActions();\n while (teardownCallbacks.length) {\n teardownCallbacks.pop()?.();\n }\n recentClicks = [];\n runtimeContext = undefined;\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n */\n\nimport type { BkOTPlugin } from '../core/plugin';\n\nexport const EXCLUDED_ACTIVITY_MUTATIONS_ATTRIBUTE = 'data-bk-excluded-activity-mutations';\n\nconst isExcludedMutation = (mutation: MutationRecord) => {\n const target = mutation.type === 'characterData' ? mutation.target.parentElement : mutation.target;\n return target instanceof Element && Boolean(target.closest(`[${EXCLUDED_ACTIVITY_MUTATIONS_ATTRIBUTE}]`));\n};\n\n/**\n * 页面级 DOM 活动只观察一次,再通过运行时活动总线分发给 View、Action 和白屏检测。\n */\nexport const createActivityPlugin = (): BkOTPlugin => {\n let mutationObserver: MutationObserver | undefined;\n const teardownCallbacks: Array<() => void> = [];\n\n return {\n name: 'activity',\n init(context) {\n if (typeof document !== 'undefined' && typeof MutationObserver !== 'undefined') {\n mutationObserver = new MutationObserver(mutations => {\n if (mutations.length && !mutations.every(isExcludedMutation)) {\n context.notifyActivity({ time: Date.now(), type: 'dom_mutation' });\n }\n });\n mutationObserver.observe(document, { attributes: true, characterData: true, childList: true, subtree: true });\n }\n\n if (typeof window === 'undefined') return;\n\n if (typeof window.open === 'function') {\n const originalOpen = window.open;\n const patchedOpen = ((...args: Parameters<typeof window.open>) => {\n context.notifyActivity({ time: Date.now(), type: 'window_open' });\n return Reflect.apply(originalOpen, window, args);\n }) as typeof window.open;\n window.open = patchedOpen;\n teardownCallbacks.push(() => {\n if (window.open === patchedOpen) window.open = originalOpen;\n });\n }\n\n },\n shutdown() {\n mutationObserver?.disconnect();\n mutationObserver = undefined;\n while (teardownCallbacks.length) teardownCallbacks.pop()?.();\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n */\n\nimport { matchesUrlList } from './url';\n\nimport type { BkOTActivityEvent } from './action-activity';\nimport type { BkOTRuntimeContext } from './plugin';\n\nexport const PAGE_ACTIVITY_VALIDATION_DELAY = 100;\nexport const PAGE_ACTIVITY_END_DELAY = 100;\n\nexport type PageActivityEnd = { endTime: number; hadActivity: true } | { hadActivity: false };\n\nconst isActivityUrlExcluded = (context: BkOTRuntimeContext, url: string | undefined) =>\n Boolean(url && matchesUrlList(context.config.view.excludedActivityUrls, url));\n\n/**\n * 等待 View/Action 启动后的请求、静态资源和 DOM 变更全部安静 100ms。\n * 请求用 id 精确配对,避免并发请求提前结束等待。\n */\nexport const waitForPageActivityEnd = (\n context: BkOTRuntimeContext,\n startTime: number,\n callback: (result: PageActivityEnd) => void,\n) => {\n const pendingRequests = new Set<string>();\n let completed = false;\n let hadActivity = false;\n let lastActivityTime = startTime;\n let quietTimer: ReturnType<typeof setTimeout> | undefined;\n\n const complete = (result: PageActivityEnd) => {\n if (completed) return;\n completed = true;\n clearTimeout(validationTimer);\n clearTimeout(quietTimer);\n unsubscribe();\n callback(result);\n };\n\n const scheduleEnd = () => {\n clearTimeout(quietTimer);\n if (!hadActivity || pendingRequests.size) return;\n quietTimer = setTimeout(\n () => complete({ endTime: lastActivityTime, hadActivity: true }),\n Math.max(0, lastActivityTime + PAGE_ACTIVITY_END_DELAY - Date.now()),\n );\n };\n\n const markActivity = (time: number) => {\n hadActivity = true;\n lastActivityTime = Math.max(lastActivityTime, time);\n scheduleEnd();\n };\n\n const onActivity = (event: BkOTActivityEvent) => {\n if (event.type === 'error' || event.type === 'long_task') return;\n if (event.type === 'request_start') {\n if (event.time < startTime || isActivityUrlExcluded(context, event.url)) return;\n pendingRequests.add(event.id);\n markActivity(event.time);\n return;\n }\n if (event.type === 'request_end') {\n if (!pendingRequests.delete(event.id)) return;\n markActivity(event.time);\n return;\n }\n if (event.type === 'resource') {\n if (event.endTime < startTime || isActivityUrlExcluded(context, event.url)) return;\n markActivity(event.endTime);\n return;\n }\n if (event.time >= startTime) markActivity(event.time);\n };\n\n const unsubscribe = context.onActivity(onActivity);\n const validationTimer = setTimeout(() => {\n if (!hadActivity) complete({ hadActivity: false });\n }, PAGE_ACTIVITY_VALIDATION_DELAY);\n\n return () => {\n if (completed) return;\n completed = true;\n clearTimeout(validationTimer);\n clearTimeout(quietTimer);\n unsubscribe();\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n */\n\nimport { waitForPageActivityEnd } from '../core/page-activity';\nimport { buildRumSpanAttributes, RUM_SPAN_OUTCOME, RUM_SPAN_TYPE } from '../schema/span';\n\nimport type { BkOTPlugin } from '../core/plugin';\n\n/**\n * 通过视口九宫格采样估算空白比例,并在页面稳定后连续确认两次。每个 View 最多上报一次,\n * 避免首屏渲染、路由切换和 loading 状态造成瞬时误报。\n */\nexport interface BkOTBlankScreenPluginOptions {\n /** 页面活动稳定后首次检查的延迟,默认 1000ms。 */\n checkDelay?: number;\n /** 两次空白结果之间的确认间隔,默认 200ms。 */\n confirmationDelay?: number;\n /** loading、骨架屏等不参与空白比例计算的元素。 */\n ignoreSelectors?: string[];\n /** 应用挂载根节点,默认 body。根节点不存在时回退到 body 检测。 */\n rootSelector?: string;\n /** 空白采样点比例阈值,默认 0.8。 */\n threshold?: number;\n}\n\ninterface DetectionResult {\n centerElement: string;\n emptyCount: number;\n ignoredCount: number;\n reason: 'empty_viewport' | 'missing_root';\n rootFound: boolean;\n score: number;\n validCount: number;\n}\n\nconst DEFAULT_CHECK_DELAY = 1000;\nconst DEFAULT_CONFIRMATION_DELAY = 200;\nconst DEFAULT_ROOT_SELECTOR = 'body';\nconst DEFAULT_THRESHOLD = 0.8;\nconst DEFAULT_IGNORED_SELECTORS = [\n '[data-loading=\"true\"]',\n '[aria-busy=\"true\"]',\n '.loading',\n '.is-loading',\n '.spinner',\n '.skeleton',\n '.bk-loading',\n];\n\nconst SAMPLE_POINTS: ReadonlyArray<readonly [number, number]> = [\n [0.2, 0.2],\n [0.5, 0.2],\n [0.8, 0.2],\n [0.2, 0.5],\n [0.5, 0.5],\n [0.8, 0.5],\n [0.2, 0.8],\n [0.5, 0.8],\n [0.8, 0.8],\n];\n\nconst nonNegativeNumber = (value: number | undefined, fallback: number) =>\n typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : fallback;\n\nconst boundedRatio = (value: number | undefined, fallback: number) =>\n typeof value === 'number' && Number.isFinite(value) ? Math.max(0, Math.min(1, value)) : fallback;\n\nconst getElementSelector = (element: Element | undefined) => {\n if (!element) return '';\n const tag = element.tagName.toLowerCase();\n return element.id ? `${tag}#${element.id}` : tag;\n};\n\nconst matchesAny = (element: Element, selectors: string[]) =>\n selectors.some(selector => {\n try {\n return element.matches(selector) || Boolean(element.closest(selector));\n } catch {\n return false;\n }\n });\n\nconst isVisuallyPresent = (element: Element) => {\n if (typeof getComputedStyle !== 'function') return true;\n const style = getComputedStyle(element);\n return style.display !== 'none' && style.visibility !== 'hidden' && Number(style.opacity || 1) > 0;\n};\n\nconst getElementsAtPoint = (x: number, y: number): Element[] => {\n if (typeof document.elementsFromPoint === 'function') return document.elementsFromPoint(x, y);\n const element = document.elementFromPoint(x, y);\n return element ? [element] : [];\n};\n\nexport const detectBlankScreen = (rootSelector: string, ignoredSelectors: string[]): DetectionResult => {\n const configuredRoot = document.querySelector(rootSelector);\n const root = configuredRoot ?? document.body ?? document.documentElement;\n const rootFound = Boolean(configuredRoot);\n\n let emptyCount = 0;\n let ignoredCount = 0;\n let centerElement = '';\n // 采样视口九宫格而非遍历 DOM,检测成本固定;被 loading/骨架屏覆盖的点不进入分母。\n for (const [xRatio, yRatio] of SAMPLE_POINTS) {\n const layers = getElementsAtPoint(window.innerWidth * xRatio, window.innerHeight * yRatio);\n if (xRatio === 0.5 && yRatio === 0.5) centerElement = getElementSelector(layers[0]);\n if (layers.some(element => matchesAny(element, ignoredSelectors))) {\n ignoredCount += 1;\n continue;\n }\n const hasContent = layers.some(\n element =>\n element !== root &&\n element !== document.body &&\n element !== document.documentElement &&\n root.contains(element) &&\n isVisuallyPresent(element),\n );\n if (!hasContent) emptyCount += 1;\n }\n\n const validCount = SAMPLE_POINTS.length - ignoredCount;\n return {\n centerElement,\n emptyCount,\n ignoredCount,\n reason: rootFound ? 'empty_viewport' : 'missing_root',\n rootFound,\n score: validCount ? emptyCount / validCount : 0,\n validCount,\n };\n};\n\nexport const createBlankScreenPlugin = (options: BkOTBlankScreenPluginOptions = {}): BkOTPlugin => {\n const checkDelay = nonNegativeNumber(options.checkDelay, DEFAULT_CHECK_DELAY);\n const confirmationDelay = nonNegativeNumber(options.confirmationDelay, DEFAULT_CONFIRMATION_DELAY);\n const rootSelector = options.rootSelector || DEFAULT_ROOT_SELECTOR;\n const threshold = boundedRatio(options.threshold, DEFAULT_THRESHOLD);\n const ignoredSelectors = [...DEFAULT_IGNORED_SELECTORS, ...(options.ignoreSelectors ?? [])];\n let activeViewId: string | undefined;\n let reportedViewId: string | undefined;\n let stopActivityTracking: (() => void) | undefined;\n let timer: ReturnType<typeof setTimeout> | undefined;\n let unsubscribeView = () => {};\n let visibilityListener: (() => void) | undefined;\n\n return {\n name: 'blank-screen',\n init(context) {\n if (typeof window === 'undefined' || typeof document === 'undefined') return;\n const clearTimer = () => {\n clearTimeout(timer);\n timer = undefined;\n };\n\n const report = (viewId: string, result: DetectionResult) => {\n if (activeViewId !== viewId || reportedViewId === viewId) return;\n if (!context.isSampled()) return;\n reportedViewId = viewId;\n const occurredAt = Date.now();\n const span = context.startSpan(\n 'browser.blank_screen',\n {\n ...buildRumSpanAttributes({\n outcome: RUM_SPAN_OUTCOME.error,\n outcomeReason: 'blank_screen',\n spanType: RUM_SPAN_TYPE.error,\n }),\n 'blank_screen.center_element': result.centerElement,\n 'blank_screen.empty_ratio': result.score,\n 'blank_screen.empty_sample_count': result.emptyCount,\n 'blank_screen.ignored_sample_count': result.ignoredCount,\n 'blank_screen.reason': result.reason,\n 'blank_screen.root_found': result.rootFound,\n 'blank_screen.root_selector': rootSelector,\n 'blank_screen.sample_count': SAMPLE_POINTS.length,\n 'blank_screen.valid_sample_count': result.validCount,\n },\n { startTime: occurredAt },\n );\n span.end(occurredAt);\n };\n\n const detectAndConfirm = (viewId: string) => {\n if (activeViewId !== viewId || reportedViewId === viewId) return;\n if (document.visibilityState === 'hidden') return;\n let first: DetectionResult;\n try {\n first = detectBlankScreen(rootSelector, ignoredSelectors);\n } catch (error) {\n if (context.config.debug) globalThis.console?.warn('[bk-ot][blank-screen] detection failed:', error);\n return;\n }\n if (!first.validCount || first.score < threshold) return;\n timer = setTimeout(() => {\n if (activeViewId !== viewId || document.visibilityState === 'hidden') return;\n let confirmed: DetectionResult;\n try {\n confirmed = detectBlankScreen(rootSelector, ignoredSelectors);\n } catch (error) {\n if (context.config.debug) globalThis.console?.warn('[bk-ot][blank-screen] confirmation failed:', error);\n return;\n }\n if (confirmed.validCount && confirmed.score >= threshold) report(viewId, confirmed);\n }, confirmationDelay);\n };\n\n const schedule = (viewId: string) => {\n clearTimer();\n if (document.visibilityState === 'hidden' || !context.isSampled()) return;\n timer = setTimeout(() => detectAndConfirm(viewId), checkDelay);\n };\n\n unsubscribeView = context.onViewChange(view => {\n if (view.id === activeViewId) return;\n clearTimer();\n stopActivityTracking?.();\n stopActivityTracking = undefined;\n activeViewId = view.id;\n reportedViewId = undefined;\n if (view.id) {\n const viewId = view.id;\n // 页面活动结束后再延迟检测,避免把正常渲染过程中的短暂空白误报为白屏。\n stopActivityTracking = waitForPageActivityEnd(context, Date.now(), () => {\n stopActivityTracking = undefined;\n schedule(viewId);\n });\n }\n });\n const onVisibilityChange = () => {\n if (document.visibilityState === 'hidden') {\n clearTimer();\n } else if (activeViewId && reportedViewId !== activeViewId) {\n schedule(activeViewId);\n }\n };\n document.addEventListener('visibilitychange', onVisibilityChange);\n visibilityListener = () => document.removeEventListener('visibilitychange', onVisibilityChange);\n },\n shutdown() {\n clearTimeout(timer);\n timer = undefined;\n unsubscribeView();\n stopActivityTracking?.();\n stopActivityTracking = undefined;\n visibilityListener?.();\n visibilityListener = undefined;\n activeViewId = undefined;\n reportedViewId = undefined;\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\nimport { isBkOTEndpoint } from './url';\n\nimport type { ResolvedBkOTConfig } from './config';\nimport type { Attributes, Context, Span as ApiSpan } from '@opentelemetry/api';\nimport type { ReadableSpan, Span, SpanProcessor } from '@opentelemetry/sdk-trace-base';\n\nconst SELF_TELEMETRY_URL_KEYS = ['http.url', 'url.full'];\nconst discardedSpans = new WeakSet<object>();\n\nexport const markSpanDiscarded = (span: ApiSpan) => {\n discardedSpans.add(span);\n};\n\nconst getSpanUrl = (span: ReadableSpan): string | undefined => {\n for (const key of SELF_TELEMETRY_URL_KEYS) {\n const value = span.attributes?.[key];\n if (typeof value === 'string') {\n return value;\n }\n }\n return undefined;\n};\n\nconst hasSessionId = (attributes: Record<string, unknown> | undefined) => {\n const sessionId = attributes?.[RUM_ATTRIBUTES.sessionId];\n return typeof sessionId === 'string' && sessionId.length > 0;\n};\n\nconst hasViewId = (attributes: Record<string, unknown> | undefined) => {\n const viewId = attributes?.[RUM_ATTRIBUTES.viewId];\n return typeof viewId === 'string' && viewId.length > 0;\n};\n\nconst hasRumContext = (attributes: Record<string, unknown> | undefined) =>\n hasSessionId(attributes) && hasViewId(attributes);\n\n/**\n * 给所有 span 固化创建时的运行时上下文,并在 onEnd 阶段过滤自身上报请求和无 RUM 上下文 span。\n */\nexport class FilteringSpanProcessor implements SpanProcessor {\n public constructor(\n private readonly inner: SpanProcessor,\n private readonly config: ResolvedBkOTConfig,\n private readonly getRuntimeAttributes: () => Attributes,\n ) {}\n\n public forceFlush(): Promise<void> {\n return this.inner.forceFlush();\n }\n\n public onEnd(span: ReadableSpan): void {\n const url = getSpanUrl(span);\n if (\n discardedSpans.delete(span) ||\n (url && isBkOTEndpoint(this.config, url)) ||\n (!hasRumContext(span.attributes) &&\n !(span.name === 'browser.session' && hasSessionId(span.attributes)))\n ) {\n return;\n }\n try {\n if (\n this.config.hooks?.beforeSend?.({\n attributes: span.attributes,\n name: span.name,\n signal: 'span',\n }) === false\n ) {\n return;\n }\n } catch (error) {\n if (this.config.debug) globalThis.console?.warn('[bk-ot] tracking.beforeSend failed:', error);\n }\n this.inner.onEnd(span);\n }\n\n public onStart(span: Span, parentContext: Context): void {\n const existingAttributes = (span as Span & { attributes?: Attributes }).attributes ?? {};\n const missingRuntimeAttributes: Attributes = {};\n // instrumentation 显式写入的属性优先,只补齐创建时缺失的运行时上下文。\n for (const [key, value] of Object.entries(this.getRuntimeAttributes())) {\n if (existingAttributes[key] === undefined && value !== undefined) missingRuntimeAttributes[key] = value;\n }\n span.setAttributes(missingRuntimeAttributes);\n this.inner.onStart(span, parentContext);\n }\n\n public shutdown(): Promise<void> {\n return this.inner.shutdown();\n }\n}\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n */\n\ninterface PendingRequestTiming {\n entry?: PerformanceResourceTiming;\n startTime: number;\n timer?: ReturnType<typeof setTimeout>;\n url: string;\n callback?: (entry?: PerformanceResourceTiming) => void;\n}\n\nconst MAX_PENDING_REQUESTS = 100;\nconst RESOURCE_TIMING_WAIT_MS = 200;\nconst pendingRequests: PendingRequestTiming[] = [];\n\nconst normalizeUrl = (url: string) => url.replace(/#.*$/, '');\n\nconst removePending = (pending: PendingRequestTiming) => {\n const index = pendingRequests.indexOf(pending);\n if (index >= 0) pendingRequests.splice(index, 1);\n if (pending.timer !== undefined) clearTimeout(pending.timer);\n};\n\nconst finishPending = (pending: PendingRequestTiming, entry?: PerformanceResourceTiming) => {\n const callback = pending.callback;\n removePending(pending);\n pending.callback = undefined;\n callback?.(entry);\n};\n\nexport const notifyRequestTiming = (entry: PerformanceResourceTiming) => {\n const entryStartTime = performance.timeOrigin + entry.startTime;\n // 同 URL 并发时选择起始时间最接近的请求;50ms 容差覆盖 JS 调用与浏览器创建 timing entry 的偏差。\n const candidate = pendingRequests\n .filter(\n pending =>\n !pending.entry &&\n normalizeUrl(pending.url) === normalizeUrl(entry.name) &&\n entryStartTime >= pending.startTime - 50,\n )\n .sort((left, right) => Math.abs(left.startTime - entryStartTime) - Math.abs(right.startTime - entryStartTime))[0];\n if (!candidate) return;\n candidate.entry = entry;\n if (candidate.callback) finishPending(candidate, entry);\n};\n\nexport const trackRequestTiming = (url: string, startTime = Date.now()) => {\n const pending: PendingRequestTiming = { startTime, url };\n pendingRequests.push(pending);\n if (pendingRequests.length > MAX_PENDING_REQUESTS) finishPending(pendingRequests[0]);\n return {\n cancel: () => finishPending(pending),\n complete: (callback: (entry?: PerformanceResourceTiming) => void) => {\n pending.callback = callback;\n if (pending.entry) {\n finishPending(pending, pending.entry);\n return;\n }\n // XHR 终止事件/Fetch settle 通常早于 ResourceTiming 回调,短暂等待以补齐 DNS、连接和下载阶段。\n pending.timer = setTimeout(() => finishPending(pending), RESOURCE_TIMING_WAIT_MS);\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n/**\n * 被观测请求的 Trace Context 规划。\n *\n * 后端 APM 只解析 W3C `traceparent`,并且要求一个后端 trace 只对应一个 API 请求,因此这里不复用\n * RUM Span 自身的 trace context,而是为每个命中白名单的请求生成独立的 trace-id/span-id,再通过\n * Span Link 把后端 trace 关联回 RUM Span。\n *\n * 如果业务已经自行设置了 trace header(`traceparent`、`sentry-trace`、b3、Datadog、sw8),则完全\n * 不注入,避免破坏业务既有的传播方式,只把已有链路建成 Link。\n *\n * Link 结构恒定:`context` 承载 trace-id/span-id,`attributes` 记录命中的格式与原始 header。\n * sw8 这类无法映射为合法 OTel id 的格式会补一对占位 id,让 Link 结构保持统一。\n */\n\nimport { TraceFlags } from '@opentelemetry/api';\n\nimport type { Attributes, Link } from '@opentelemetry/api';\n\n/** 大小写不敏感地读取一个请求 header */\nexport type BkOTHeaderReader = (name: string) => string | undefined;\n\nexport interface BkOTRequestTracePlan {\n /** 关联后端 trace 的 Span Link,恒为一条 */\n links: Link[];\n /** 需要注入的 traceparent;业务已有 trace header 时为 undefined */\n traceparent?: string;\n}\n\nexport type BkOTUpstreamTraceFormat = 'b3' | 'b3-multi' | 'datadog' | 'sentry-trace' | 'sw8' | 'traceparent';\n\nexport const TRACEPARENT_HEADER = 'traceparent';\n\nconst TRACE_ID_LENGTH = 32;\nconst SPAN_ID_LENGTH = 16;\n\nconst HEX_DIGITS = '0123456789abcdef';\nconst HEX_PATTERN = /^[\\da-f]+$/;\nconst ZERO_PATTERN = /^0+$/;\nconst DECIMAL_PATTERN = /^\\d+$/;\n\n// 00-{trace-id}-{parent-id}-{trace-flags};允许未来版本追加字段,但 ff 是规范保留值\nconst TRACEPARENT_PATTERN = /^([\\da-f]{2})-([\\da-f]{32})-([\\da-f]{16})-([\\da-f]{2})(?:-.*)?$/;\nconst SENTRY_TRACE_PATTERN = /^([\\da-f]{32})-([\\da-f]{16})(?:-([01]))?$/;\n// Datadog 128 位 trace-id 的高 64 位放在 x-datadog-tags 的 _dd.p.tid 里\nconst DATADOG_TRACE_ID_HIGH_PATTERN = /(?:^|,)_dd\\.p\\.tid=([\\da-f]{16})(?:,|$)/;\nconst DATADOG_TRACE_ID_HIGH_DEFAULT = '0000000000000000';\n\n/** OTel 要求 id 为定长小写 hex 且不能全零 */\nconst isValidHexId = (value: string, length: number) =>\n value.length === length && HEX_PATTERN.test(value) && !ZERO_PATTERN.test(value);\n\n// b3 与 Datadog 允许 64 位 trace-id,映射到 OTel 的 128 位时按规范左侧补零\nconst normalizeTraceId = (value: string) => {\n const lower = value.toLowerCase();\n if (isValidHexId(lower, TRACE_ID_LENGTH)) return lower;\n return isValidHexId(lower, SPAN_ID_LENGTH) ? lower.padStart(TRACE_ID_LENGTH, '0') : undefined;\n};\n\nconst normalizeSpanId = (value: string) => {\n const lower = value.toLowerCase();\n return isValidHexId(lower, SPAN_ID_LENGTH) ? lower : undefined;\n};\n\nconst createRandomHexId = (length: number) => {\n const bytes = new Uint8Array(length / 2);\n if (typeof crypto !== 'undefined' && typeof crypto.getRandomValues === 'function') {\n crypto.getRandomValues(bytes);\n } else {\n for (let index = 0; index < bytes.length; index += 1) bytes[index] = Math.floor(Math.random() * 256);\n }\n let hex = '';\n for (const byte of bytes) {\n hex += HEX_DIGITS[byte >> 4] + HEX_DIGITS[byte & 15];\n }\n // 全零是 OTel 的非法 id,概率极低但必须排除\n return ZERO_PATTERN.test(hex) ? `${hex.slice(1)}1` : hex;\n};\n\n/**\n * Datadog 用十进制字符串传 64 位 id。构建目标是 es2015,不能依赖 BigInt,\n * 这里用逐位进位的方式把十进制换算成 16 位 hex。\n */\nconst decimalToHexId = (value: string) => {\n if (!DECIMAL_PATTERN.test(value)) return undefined;\n const nibbles: number[] = [];\n for (let index = 0; index < value.length; index += 1) {\n let carry = value.charCodeAt(index) - 48;\n for (let position = 0; position < nibbles.length; position += 1) {\n const product = nibbles[position] * 10 + carry;\n nibbles[position] = product % 16;\n carry = (product - (product % 16)) / 16;\n }\n while (carry > 0) {\n nibbles.push(carry % 16);\n carry = (carry - (carry % 16)) / 16;\n }\n }\n if (nibbles.length > SPAN_ID_LENGTH) return undefined;\n let hex = '';\n for (let position = nibbles.length - 1; position >= 0; position -= 1) hex += HEX_DIGITS[nibbles[position]];\n return hex.padStart(SPAN_ID_LENGTH, '0');\n};\n\ninterface UpstreamTrace {\n format: BkOTUpstreamTraceFormat;\n /** 命中格式的原始 header,原样写入 Link Attributes */\n headers: Attributes;\n sampled?: boolean;\n /** 规范化后的合法 OTel id;无法映射时两者同时缺失 */\n spanId?: string;\n traceId?: string;\n}\n\n/** 按 header 原名收集实际存在的取值,缺失的不写入 */\nconst collectHeaders = (getHeader: BkOTHeaderReader, names: string[]) => {\n const headers: Attributes = {};\n for (const name of names) {\n const value = getHeader(name)?.trim();\n if (value) headers[name] = value;\n }\n return headers;\n};\n\n/**\n * `traceparent` 与 SDK 注入的是同一个 header,因此格式非法时视作没有既有链路:\n * 这种值后端同样无法接续,覆盖注入比保留它更有价值。\n */\nconst parseTraceparent = (getHeader: BkOTHeaderReader): undefined | UpstreamTrace => {\n const value = getHeader(TRACEPARENT_HEADER)?.trim().toLowerCase();\n if (!value) return undefined;\n const matched = TRACEPARENT_PATTERN.exec(value);\n if (!matched || matched[1] === 'ff') return undefined;\n const [, , traceId, spanId, flags] = matched;\n if (!isValidHexId(traceId, TRACE_ID_LENGTH) || !isValidHexId(spanId, SPAN_ID_LENGTH)) return undefined;\n return {\n format: 'traceparent',\n headers: collectHeaders(getHeader, [TRACEPARENT_HEADER]),\n sampled: (Number.parseInt(flags, 16) & 1) === 1,\n spanId,\n traceId,\n };\n};\n\nconst parseSentryTrace = (getHeader: BkOTHeaderReader): undefined | UpstreamTrace => {\n const value = getHeader('sentry-trace')?.trim().toLowerCase();\n if (!value) return undefined;\n const headers = collectHeaders(getHeader, ['sentry-trace']);\n const matched = SENTRY_TRACE_PATTERN.exec(value);\n if (!matched) return { format: 'sentry-trace', headers };\n const [, traceId, spanId, sampled] = matched;\n return {\n format: 'sentry-trace',\n headers,\n ...(sampled === undefined ? {} : { sampled: sampled === '1' }),\n ...(isValidHexId(traceId, TRACE_ID_LENGTH) && isValidHexId(spanId, SPAN_ID_LENGTH) ? { spanId, traceId } : {}),\n };\n};\n\n// b3 单头:{trace-id}-{span-id}[-{sampling-state}[-{parent-span-id}]],也允许只有 0 / 1 / d\nconst parseB3Single = (getHeader: BkOTHeaderReader): undefined | UpstreamTrace => {\n const value = getHeader('b3')?.trim().toLowerCase();\n if (!value) return undefined;\n const [rawTraceId, rawSpanId, samplingState] = value.split('-');\n const traceId = rawTraceId ? normalizeTraceId(rawTraceId) : undefined;\n const spanId = rawSpanId ? normalizeSpanId(rawSpanId) : undefined;\n return {\n format: 'b3',\n headers: collectHeaders(getHeader, ['b3']),\n ...(traceId && spanId ? { spanId, traceId } : {}),\n ...(samplingState ? { sampled: samplingState === '1' || samplingState === 'd' } : {}),\n };\n};\n\nconst parseB3Multi = (getHeader: BkOTHeaderReader): undefined | UpstreamTrace => {\n const rawTraceId = getHeader('x-b3-traceid')?.trim().toLowerCase();\n const rawSpanId = getHeader('x-b3-spanid')?.trim().toLowerCase();\n const samplingState = getHeader('x-b3-sampled')?.trim().toLowerCase();\n if (!rawTraceId && !rawSpanId && !samplingState) return undefined;\n const traceId = rawTraceId ? normalizeTraceId(rawTraceId) : undefined;\n const spanId = rawSpanId ? normalizeSpanId(rawSpanId) : undefined;\n return {\n format: 'b3-multi',\n headers: collectHeaders(getHeader, [\n 'x-b3-traceid',\n 'x-b3-spanid',\n 'x-b3-parentspanid',\n 'x-b3-sampled',\n 'x-b3-flags',\n ]),\n ...(traceId && spanId ? { spanId, traceId } : {}),\n ...(samplingState ? { sampled: samplingState === '1' || samplingState === 'd' } : {}),\n };\n};\n\nconst parseDatadog = (getHeader: BkOTHeaderReader): undefined | UpstreamTrace => {\n const rawTraceId = getHeader('x-datadog-trace-id')?.trim();\n const rawSpanId = getHeader('x-datadog-parent-id')?.trim();\n const samplingPriority = getHeader('x-datadog-sampling-priority')?.trim();\n if (!rawTraceId && !rawSpanId && !samplingPriority) return undefined;\n const tags = getHeader('x-datadog-tags')?.trim().toLowerCase();\n const traceIdHigh =\n (tags ? DATADOG_TRACE_ID_HIGH_PATTERN.exec(tags)?.[1] : undefined) ?? DATADOG_TRACE_ID_HIGH_DEFAULT;\n const traceIdLow = rawTraceId ? decimalToHexId(rawTraceId) : undefined;\n const traceId = traceIdLow ? normalizeTraceId(`${traceIdHigh}${traceIdLow}`) : undefined;\n const spanIdHex = rawSpanId ? decimalToHexId(rawSpanId) : undefined;\n const spanId = spanIdHex ? normalizeSpanId(spanIdHex) : undefined;\n return {\n format: 'datadog',\n headers: collectHeaders(getHeader, [\n 'x-datadog-trace-id',\n 'x-datadog-parent-id',\n 'x-datadog-sampling-priority',\n 'x-datadog-origin',\n 'x-datadog-tags',\n ]),\n ...(traceId && spanId ? { spanId, traceId } : {}),\n ...(samplingPriority ? { sampled: Number(samplingPriority) > 0 } : {}),\n };\n};\n\n/**\n * sw8:{sample}-{trace-id}-{segment-id}-{span-id}-{service}-{instance}-{endpoint}-{peer},\n * 其中 trace-id 与 segment-id 是 base64 后的 SkyWalking id。它们不是 16 字节 hex,无法映射为\n * 合法的 OTel SpanContext,因此不产出 traceId/spanId,由调用方补占位 id。\n */\nconst parseSw8 = (getHeader: BkOTHeaderReader): undefined | UpstreamTrace => {\n const value = getHeader('sw8')?.trim();\n if (!value) return undefined;\n const samplingState = value.split('-')[0];\n return {\n format: 'sw8',\n headers: collectHeaders(getHeader, ['sw8']),\n ...(samplingState ? { sampled: samplingState === '1' } : {}),\n };\n};\n\n// 按格式明确度排序:先看与 SDK 同名的 traceparent,再看其他厂商格式\nconst UPSTREAM_PARSERS = [parseTraceparent, parseSentryTrace, parseB3Single, parseB3Multi, parseDatadog, parseSw8];\n\nexport const detectUpstreamTrace = (getHeader: BkOTHeaderReader) => {\n for (const parse of UPSTREAM_PARSERS) {\n const upstream = parse(getHeader);\n if (upstream) return upstream;\n }\n return undefined;\n};\n\nconst toLink = (traceId: string, spanId: string, attributes: Attributes, sampled?: boolean): Link => ({\n attributes,\n context: {\n spanId,\n traceFlags: sampled === false ? TraceFlags.NONE : TraceFlags.SAMPLED,\n traceId,\n },\n});\n\nexport const planRequestTrace = (getHeader: BkOTHeaderReader): BkOTRequestTracePlan => {\n const upstream = detectUpstreamTrace(getHeader);\n if (!upstream) {\n // 与 RUM Span 无关的独立 trace,保证后端按 trace-id 检索时只命中这一个 API 请求\n const traceId = createRandomHexId(TRACE_ID_LENGTH);\n const spanId = createRandomHexId(SPAN_ID_LENGTH);\n const traceparent = `00-${traceId}-${spanId}-01`;\n return {\n links: [toLink(traceId, spanId, { format: 'traceparent', injected: true, [TRACEPARENT_HEADER]: traceparent })],\n traceparent,\n };\n }\n // sw8 等格式解析不出合法 OTel id,补占位 id 让 Link 结构统一;此时不注入,后端不会有对应 trace\n return {\n links: [\n toLink(\n upstream.traceId ?? createRandomHexId(TRACE_ID_LENGTH),\n upstream.spanId ?? createRandomHexId(SPAN_ID_LENGTH),\n // injected 恒定写出:业务自带的合法 traceparent 与 SDK 注入的 format 同值,只靠 format 无法区分\n { format: upstream.format, injected: false, ...upstream.headers },\n upstream.sampled,\n ),\n ],\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { SpanKind } from '@opentelemetry/api';\n\nimport { notifyRequestTiming } from '../core/request-timing';\nimport { shouldIgnoreUrl } from '../core/url';\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\nimport { buildRumResourceSpanAttributes } from '../schema/span';\n\nimport type { BkOTPlugin } from '../core/plugin';\n\n/**\n * Resource Timing 的统一消费端:静态资源按配置生成 span;Fetch/XHR timing 转交 request 插件,\n * 与其已创建的请求 span 合并,避免同一次网络请求重复计数。\n */\ntype ResourceTimingWithStatus = PerformanceResourceTiming & {\n deliveryType?: string;\n renderBlockingStatus?: string;\n responseStatus?: number;\n};\n\nconst getCacheHit = (entry: ResourceTimingWithStatus) =>\n entry.deliveryType === 'cache' || (entry.transferSize === 0 && entry.decodedBodySize > 0) ? true : undefined;\n\nconst hasUnavailableResourceDetails = (entry: ResourceTimingWithStatus) =>\n entry.transferSize === 0 &&\n entry.encodedBodySize === 0 &&\n entry.decodedBodySize === 0 &&\n entry.requestStart === 0 &&\n entry.responseStart === 0 &&\n !entry.nextHopProtocol;\n\nconst areInOrder = (...values: number[]) => values.every((value, index) => index === 0 || values[index - 1] <= value);\n\nconst setTiming = (attributes: Record<string, number>, name: string, origin: number, start: number, end: number) => {\n if (!areInOrder(origin, start, end)) return;\n attributes[`resource.${name}.start`] = start - origin;\n attributes[`resource.${name}.duration`] = end - start;\n};\n\nexport const getResourceTimingAttributes = (entry: ResourceTimingWithStatus) => {\n const attributes: Record<string, number> = {};\n const commonTimings = [\n entry.startTime,\n entry.fetchStart,\n entry.domainLookupStart,\n entry.domainLookupEnd,\n entry.connectStart,\n entry.connectEnd,\n entry.requestStart,\n entry.responseStart,\n entry.responseEnd,\n ];\n // 浏览器因 TAO 或实现差异可能返回缺失/乱序时间点;整组校验可避免产生负 duration。\n if (!commonTimings.every(Number.isFinite) || !areInOrder(...commonTimings)) return attributes;\n\n setTiming(attributes, 'first_byte', entry.startTime, entry.requestStart, entry.responseStart);\n setTiming(attributes, 'download', entry.startTime, entry.responseStart, entry.responseEnd);\n if (entry.workerStart > 0 && entry.workerStart < entry.fetchStart) {\n setTiming(attributes, 'worker', entry.startTime, entry.workerStart, entry.fetchStart);\n }\n if (entry.fetchStart < entry.domainLookupEnd) {\n setTiming(attributes, 'dns', entry.startTime, entry.domainLookupStart, entry.domainLookupEnd);\n }\n if (entry.fetchStart < entry.connectEnd) {\n setTiming(attributes, 'connect', entry.startTime, entry.connectStart, entry.connectEnd);\n if (entry.connectStart <= entry.secureConnectionStart && entry.secureConnectionStart <= entry.connectEnd) {\n setTiming(attributes, 'ssl', entry.startTime, entry.secureConnectionStart, entry.connectEnd);\n }\n }\n if (\n entry.redirectEnd > entry.startTime &&\n areInOrder(entry.startTime, entry.redirectStart, entry.redirectEnd, entry.fetchStart)\n ) {\n setTiming(attributes, 'redirect', entry.startTime, entry.redirectStart, entry.redirectEnd);\n }\n return attributes;\n};\n\nexport const getResourceDuration = (entry: ResourceTimingWithStatus) =>\n entry.duration === 0 && entry.responseEnd > entry.startTime ? entry.responseEnd - entry.startTime : entry.duration;\n\nexport const getResourcePerformanceAttributes = (entry: ResourceTimingWithStatus) => {\n const detailsUnavailable = hasUnavailableResourceDetails(entry);\n const deliveryType = typeof entry.deliveryType === 'string' && entry.deliveryType ? entry.deliveryType : undefined;\n return {\n [RUM_ATTRIBUTES.cacheHit]: getCacheHit(entry),\n ...(entry.nextHopProtocol ? { [RUM_ATTRIBUTES.nextHopProtocol]: entry.nextHopProtocol } : {}),\n ...getResourceTimingAttributes(entry),\n ...(deliveryType ? { 'resource.delivery_type': deliveryType } : {}),\n ...(entry.renderBlockingStatus ? { 'resource.render_blocking_status': entry.renderBlockingStatus } : {}),\n ...(detailsUnavailable\n ? {}\n : {\n // 对齐 Datadog:resource.size 取解压后 body 体积,缓存命中也能反映真实大小;\n // 网络传输量单独用 resource.transfer_size 表达(受缓存/TAO 影响可能为 0)。\n 'resource.size': entry.decodedBodySize,\n 'resource.encoded_body_size': entry.encodedBodySize,\n 'resource.decoded_body_size': entry.decodedBodySize,\n 'resource.transfer_size': entry.transferSize,\n }),\n };\n};\n\nexport const createResourcePlugin = (emitResourceSpans = true): BkOTPlugin => {\n let observer: PerformanceObserver | undefined;\n\n return {\n name: 'resource',\n init(context) {\n if (typeof PerformanceObserver === 'undefined') {\n return;\n }\n if (!PerformanceObserver.supportedEntryTypes?.includes('resource')) {\n return;\n }\n\n const emitEntry = (entry: ResourceTimingWithStatus) => {\n if (!context.isSampled()) return;\n if (!entry.name || shouldIgnoreUrl(context.config, entry.name)) {\n return;\n }\n if (entry.initiatorType === 'fetch' || entry.initiatorType === 'xmlhttprequest') {\n // Fetch/XHR 已由 request 插件建 span;这里只把 ResourceTiming 回传补齐网络阶段,避免重复上报。\n notifyRequestTiming(entry);\n return;\n }\n if (entry.duration < 0) return;\n const redactedUrl = context.config.hooks.redactUrl(entry.name);\n const duration = getResourceDuration(entry);\n const startTime = performance.timeOrigin + entry.startTime;\n const endTime = startTime + duration;\n if (emitResourceSpans && context.isSampled()) {\n const span = context.startSpan(\n 'browser.resource',\n {\n ...context.config.hooks.getPageAttributes(),\n ...buildRumResourceSpanAttributes({\n initiatorType: entry.initiatorType || 'other',\n outcome:\n typeof entry.responseStatus === 'number'\n ? { statusCode: entry.responseStatus, type: 'response' }\n : undefined,\n url: redactedUrl,\n }),\n 'url.full': redactedUrl,\n ...getResourcePerformanceAttributes(entry),\n },\n { kind: SpanKind.CLIENT, startTime },\n );\n span.end(endTime);\n }\n context.notifyActivity({ endTime, startTime, type: 'resource', url: entry.name });\n };\n\n try {\n observer = new PerformanceObserver(list => {\n for (const entry of list.getEntries() as ResourceTimingWithStatus[]) {\n emitEntry(entry);\n }\n });\n observer.observe({ type: 'resource', buffered: true });\n } catch {\n observer = undefined;\n }\n },\n shutdown() {\n observer?.disconnect();\n observer = undefined;\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n */\n\n/**\n * Fetch/XHR 请求统一采集入口。\n *\n * 同一层 patch 负责请求 span、Trace Header、页面活动与 beforeSend,避免多套 patch\n * 重复计数,也不依赖 OpenTelemetry instrumentation 的私有方法。\n */\n\nimport { SpanKind, SpanStatusCode } from '@opentelemetry/api';\n\nimport { createRandomId } from '../core/id';\nimport { markSpanDiscarded } from '../core/processor';\nimport { trackRequestTiming } from '../core/request-timing';\nimport { planRequestTrace, TRACEPARENT_HEADER } from '../core/trace-context';\nimport {\n matchesUrlList,\n shouldIgnoreRequest,\n shouldIgnoreUrl,\n shouldPropagateTraceHeader,\n toAbsoluteUrl,\n} from '../core/url';\nimport { buildRumResourceSpanAttributes } from '../schema/span';\nimport { getResourceDuration, getResourcePerformanceAttributes } from './resource';\n\nimport type { BkOTRequestConfig, BkOTRequestContext, BkOTRequestOutcome } from '../core/config';\nimport type { BkOTPlugin, BkOTRuntimeContext } from '../core/plugin';\nimport type { BkOTHeaderReader, BkOTRequestTracePlan } from '../core/trace-context';\nimport type { Attributes, Span } from '@opentelemetry/api';\n\ninterface RequestDetails {\n method?: string;\n startedAt?: number;\n url?: string;\n}\n\nconst getRequestOptions = (context: BkOTRuntimeContext) =>\n typeof context.config.tracking.request === 'object' ? context.config.tracking.request : undefined;\n\n// 没有白名单时不会注入任何 header,也就不需要为探测既有 trace header 付出 patch 成本。\nconst hasTracingAllowlist = (context: BkOTRuntimeContext) => {\n const allowed = getRequestOptions(context)?.allowedTracingUrls;\n return Array.isArray(allowed) ? allowed.length > 0 : allowed !== undefined;\n};\n\nconst getErrorName = (error: unknown) =>\n typeof error === 'object' && error && 'name' in error && typeof error.name === 'string' ? error.name : '';\n\nconst getFetchFailureOutcome = (requestContext: Request | RequestInit, error: unknown): BkOTRequestOutcome => {\n const signal = requestContext.signal;\n if (getErrorName(signal?.reason) === 'TimeoutError' || getErrorName(error) === 'TimeoutError') {\n return { error, type: 'timeout' };\n }\n if (signal?.aborted || getErrorName(error) === 'AbortError') return { type: 'abort' };\n return { error, type: 'network_error' };\n};\n\nconst getXhrOutcome = (\n completionType: 'abort' | 'error' | 'load' | 'timeout',\n xhr: XMLHttpRequest,\n): BkOTRequestOutcome => {\n if (completionType === 'abort') return { type: 'abort' };\n if (completionType === 'timeout') return { type: 'timeout' };\n if (completionType === 'error' || xhr.status === 0) return { type: 'network_error' };\n return { statusCode: xhr.status, type: 'response' };\n};\n\nconst isErrorOutcome = (outcome: BkOTRequestOutcome) =>\n outcome.type === 'network_error' ||\n outcome.type === 'timeout' ||\n (outcome.type === 'response' && typeof outcome.statusCode === 'number' && outcome.statusCode >= 400);\n\nconst getFetchUrl = (input: RequestInfo | URL) => {\n if (typeof input === 'string' || input instanceof URL) return toAbsoluteUrl(String(input));\n return toAbsoluteUrl(input.url);\n};\n\nconst getFetchMethod = (input: RequestInfo | URL, init?: RequestInit) =>\n (init?.method ?? (typeof Request !== 'undefined' && input instanceof Request ? input.method : 'GET')).toUpperCase();\n\nconst getFetchRequestContext = (input: RequestInfo | URL, init?: RequestInit): Request | RequestInit =>\n typeof Request !== 'undefined' && input instanceof Request ? input : (init ?? {});\n\n/** 取本次请求最终会发出的 header 集合:init.headers 一旦存在就会整体覆盖 Request 上的 header。 */\nconst getFetchRequestHeaders = (input: RequestInfo | URL, init: RequestInit | undefined) => {\n const requestHeaders = typeof Request !== 'undefined' && input instanceof Request ? input.headers : undefined;\n return new Headers(init?.headers ?? requestHeaders);\n};\n\nconst applyFetchTracePlan = (init: RequestInit | undefined, headers: Headers, plan: BkOTRequestTracePlan) => {\n if (!plan.traceparent) return init;\n headers.set(TRACEPARENT_HEADER, plan.traceparent);\n return { ...init, headers };\n};\n\nconst createHeaderReader =\n (headers: Record<string, string> | undefined): BkOTHeaderReader =>\n name =>\n headers?.[name.toLowerCase()];\n\nconst isActivityExcluded = (context: BkOTRuntimeContext, url: string) =>\n shouldIgnoreUrl(context.config, url) || matchesUrlList(context.config.view.excludedActivityUrls, url);\n\nconst startRequestActivity = (context: BkOTRuntimeContext, url: string) => {\n if (isActivityExcluded(context, url)) return () => {};\n const id = createRandomId('request');\n context.notifyActivity({ id, time: Date.now(), type: 'request_start', url });\n let ended = false;\n return () => {\n if (ended) return;\n ended = true;\n context.notifyActivity({ id, time: Date.now(), type: 'request_end' });\n };\n};\n\nconst trackRequestSpanTiming = (context: BkOTRuntimeContext, url: string) =>\n !context.isSampled()\n ? {\n cancel() {},\n complete(callback: (entry?: PerformanceResourceTiming) => void) {\n callback();\n },\n }\n : trackRequestTiming(url);\n\nconst startRequestSpan = (\n context: BkOTRuntimeContext,\n subtype: 'fetch' | 'xhr',\n details: RequestDetails,\n tracePlan?: BkOTRequestTracePlan,\n) => {\n const startedAt = details.startedAt ?? Date.now();\n return context.startSpan(\n 'browser.resource',\n {\n ...context.config.hooks.getPageAttributes(),\n ...buildRumResourceSpanAttributes({\n initiatorType: subtype,\n method: details.method,\n url: details.url ?? '',\n }),\n ...(details.url\n ? {\n 'url.full': context.config.hooks.redactUrl(details.url),\n 'url.template': context.config.hooks.getRequestUrlTemplate(details.url),\n }\n : {}),\n },\n {\n kind: SpanKind.CLIENT,\n startTime: startedAt,\n ...(tracePlan ? { links: tracePlan.links } : {}),\n },\n );\n};\n\nexport const decorateRequestSpan = (\n context: BkOTRuntimeContext,\n span: Span,\n subtype: 'fetch' | 'xhr',\n domainContext: BkOTRequestContext,\n outcome: BkOTRequestOutcome,\n details: RequestDetails = {},\n) => {\n const sourceUrl = details.url;\n const redactedUrl = sourceUrl ? context.config.hooks.redactUrl(sourceUrl) : undefined;\n const method = details.method;\n const attributes: Attributes = {\n ...context.config.hooks.getPageAttributes(),\n ...buildRumResourceSpanAttributes({\n initiatorType: subtype,\n method,\n outcome,\n url: redactedUrl ?? '',\n }),\n ...(redactedUrl ? { 'url.full': redactedUrl } : {}),\n // 模板由原始 URL 推导:Hook 可能需要 query 才能判断路由,产出的模板本身是低基数的\n ...(sourceUrl ? { 'url.template': context.config.hooks.getRequestUrlTemplate(sourceUrl) } : {}),\n };\n\n const event = {\n attributes,\n resource: {\n method,\n outcome,\n transport: subtype,\n url: redactedUrl,\n },\n type: 'resource' as const,\n };\n let shouldSend: boolean | void = true;\n try {\n shouldSend = getRequestOptions(context)?.beforeSend?.(event, domainContext);\n } catch (error) {\n if (context.config.debug) globalThis.console?.warn('[bk-ot] request.beforeSend failed:', error);\n }\n span.setAttributes(context.applyRedact(event.attributes));\n if (shouldSend === false) {\n // SpanProcessor 在 onEnd 统一识别内部状态,避免这里绕过正常的 span 结束流程。\n markSpanDiscarded(span);\n return;\n }\n if (isErrorOutcome(outcome)) span.setStatus({ code: SpanStatusCode.ERROR });\n};\n\nexport const createCommonInstrumentationsPlugin = (option: BkOTRequestConfig | boolean | undefined): BkOTPlugin => {\n const teardownCallbacks: Array<() => void> = [];\n const activeRequestEnds = new Set<() => void>();\n\n return {\n name: 'request',\n enabled: option !== false,\n init(context) {\n if (typeof window === 'undefined') return;\n\n if (typeof window.fetch === 'function') {\n const originalFetch = window.fetch;\n const patchedFetch: typeof window.fetch = async function (this: Window, input, init) {\n const url = getFetchUrl(input);\n if (!context.isSampled() || shouldIgnoreRequest(context.config, url))\n return originalFetch.call(this, input, init);\n const method = getFetchMethod(input, init);\n const details = { method, startedAt: Date.now(), url };\n // Span Link 必须在创建 span 时给出,因此先规划 trace context 再建 span。\n const headers = shouldPropagateTraceHeader(context.config, url)\n ? getFetchRequestHeaders(input, init)\n : undefined;\n const tracePlan = headers ? planRequestTrace(name => headers.get(name) ?? undefined) : undefined;\n const span = startRequestSpan(context, 'fetch', details, tracePlan);\n const timing = trackRequestSpanTiming(context, url);\n const endActivity = startRequestActivity(context, url);\n const requestContext = getFetchRequestContext(input, init);\n const requestInit = headers && tracePlan ? applyFetchTracePlan(init, headers, tracePlan) : init;\n let ended = false;\n const endSpan = (entry?: PerformanceResourceTiming, fallbackEndTime = Date.now()) => {\n if (ended) return;\n ended = true;\n activeRequestEnds.delete(forceEnd);\n if (entry) {\n span.setAttributes(context.applyRedact(getResourcePerformanceAttributes(entry)));\n span.end(performance.timeOrigin + entry.startTime + getResourceDuration(entry));\n return;\n }\n span.end(fallbackEndTime);\n };\n const forceEnd = () => {\n // shutdown 不再等待异步 ResourceTiming,立即结束仍在飞行中的 span。\n timing.cancel();\n endSpan();\n };\n activeRequestEnds.add(forceEnd);\n try {\n const response = await originalFetch.call(this, input, requestInit);\n const outcome: BkOTRequestOutcome = {\n ...(response.status > 0 ? { statusCode: response.status } : {}),\n type: 'response',\n };\n decorateRequestSpan(\n context,\n span,\n 'fetch',\n { request: requestContext, response, type: 'fetch' },\n outcome,\n details,\n );\n const completedAt = Date.now();\n timing.complete(entry => endSpan(entry, completedAt));\n return response;\n } catch (error) {\n const outcome = getFetchFailureOutcome(requestContext, error);\n decorateRequestSpan(\n context,\n span,\n 'fetch',\n { error, request: requestContext, type: 'fetch' },\n outcome,\n details,\n );\n if (outcome.type !== 'abort' && error instanceof Error) span.recordException(error);\n const completedAt = Date.now();\n timing.complete(entry => endSpan(entry, completedAt));\n throw error;\n } finally {\n endActivity();\n }\n };\n window.fetch = patchedFetch;\n teardownCallbacks.push(() => {\n if (window.fetch === patchedFetch) window.fetch = originalFetch;\n });\n }\n\n if (typeof XMLHttpRequest !== 'undefined') {\n const requests = new WeakMap<XMLHttpRequest, RequestDetails>();\n // 浏览器不提供读取 XHR 请求头的 API,只能自己快照业务设置的 header 以便探测既有链路。\n const authorHeaders = new WeakMap<XMLHttpRequest, Record<string, string>>();\n const originalOpen = XMLHttpRequest.prototype.open;\n const originalSend = XMLHttpRequest.prototype.send;\n const patchedOpen: typeof XMLHttpRequest.prototype.open = function (\n this: XMLHttpRequest,\n method: string,\n url: string | URL,\n async = true,\n username?: null | string,\n password?: null | string,\n ) {\n requests.set(this, { method: method.toUpperCase(), url: toAbsoluteUrl(String(url)) });\n // open() 会清空已设置的请求头,快照必须同步失效。\n authorHeaders.delete(this);\n return originalOpen.call(this, method, String(url), async, username, password);\n };\n const patchedSend: typeof XMLHttpRequest.prototype.send = function (this: XMLHttpRequest, body) {\n const details = requests.get(this) ?? {};\n if (!context.isSampled() || !details.url || shouldIgnoreRequest(context.config, details.url))\n return originalSend.call(this, body);\n details.startedAt = Date.now();\n const tracePlan = shouldPropagateTraceHeader(context.config, details.url)\n ? planRequestTrace(createHeaderReader(authorHeaders.get(this)))\n : undefined;\n const span = startRequestSpan(context, 'xhr', details, tracePlan);\n const timing = trackRequestSpanTiming(context, details.url);\n const endActivity = startRequestActivity(context, details.url);\n if (tracePlan?.traceparent) this.setRequestHeader(TRACEPARENT_HEADER, tracePlan.traceparent);\n let finishing = false;\n let ended = false;\n let removeTerminalListeners = () => {};\n const forceEnd = () => {\n // XHR 可能永不触发终止事件;SDK 停止时必须清理活动计数并结束 span。\n removeTerminalListeners();\n timing.cancel();\n if (ended) return;\n ended = true;\n activeRequestEnds.delete(forceEnd);\n endActivity();\n span.end();\n };\n activeRequestEnds.add(forceEnd);\n const complete = (completionType: 'abort' | 'error' | 'load' | 'timeout') => {\n if (finishing || ended) return;\n finishing = true;\n removeTerminalListeners();\n const outcome = getXhrOutcome(completionType, this);\n decorateRequestSpan(context, span, 'xhr', { type: 'xhr', xhr: this }, outcome, details);\n endActivity();\n const completedAt = Date.now();\n timing.complete(entry => {\n if (ended) return;\n ended = true;\n activeRequestEnds.delete(forceEnd);\n if (entry) {\n span.setAttributes(context.applyRedact(getResourcePerformanceAttributes(entry)));\n span.end(performance.timeOrigin + entry.startTime + getResourceDuration(entry));\n return;\n }\n span.end(completedAt);\n });\n };\n const onAbort = () => complete('abort');\n const onError = () => complete('error');\n const onLoad = () => complete('load');\n const onTimeout = () => complete('timeout');\n removeTerminalListeners = () => {\n this.removeEventListener('abort', onAbort);\n this.removeEventListener('error', onError);\n this.removeEventListener('load', onLoad);\n this.removeEventListener('timeout', onTimeout);\n };\n this.addEventListener('abort', onAbort, { once: true });\n this.addEventListener('error', onError, { once: true });\n this.addEventListener('load', onLoad, { once: true });\n this.addEventListener('timeout', onTimeout, { once: true });\n try {\n return originalSend.call(this, body);\n } catch (error) {\n if (error instanceof Error) span.recordException(error);\n complete('error');\n throw error;\n }\n };\n XMLHttpRequest.prototype.open = patchedOpen;\n XMLHttpRequest.prototype.send = patchedSend;\n teardownCallbacks.push(() => {\n if (XMLHttpRequest.prototype.open === patchedOpen) XMLHttpRequest.prototype.open = originalOpen;\n if (XMLHttpRequest.prototype.send === patchedSend) XMLHttpRequest.prototype.send = originalSend;\n });\n\n if (hasTracingAllowlist(context) && typeof XMLHttpRequest.prototype.setRequestHeader === 'function') {\n const originalSetRequestHeader = XMLHttpRequest.prototype.setRequestHeader;\n const patchedSetRequestHeader: typeof XMLHttpRequest.prototype.setRequestHeader = function (\n this: XMLHttpRequest,\n name: string,\n value: string,\n ) {\n const key = name.toLowerCase();\n const headers = authorHeaders.get(this) ?? {};\n // 浏览器对重复设置的同名 header 做 \", \" 合并,快照保持一致才能正确解析。\n headers[key] = key in headers ? `${headers[key]}, ${value}` : value;\n authorHeaders.set(this, headers);\n return originalSetRequestHeader.call(this, name, value);\n };\n XMLHttpRequest.prototype.setRequestHeader = patchedSetRequestHeader;\n teardownCallbacks.push(() => {\n if (XMLHttpRequest.prototype.setRequestHeader === patchedSetRequestHeader)\n XMLHttpRequest.prototype.setRequestHeader = originalSetRequestHeader;\n });\n }\n }\n },\n shutdown() {\n for (const end of [...activeRequestEnds]) end();\n while (teardownCallbacks.length) teardownCallbacks.pop()?.();\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { buildRumSpanAttributes, RUM_SPAN_OUTCOME, RUM_SPAN_TYPE } from '../schema/span';\n\nimport type { BkOTPlugin } from '../core/plugin';\n\n// blockedURI 除了 URL 还可能是 'inline' / 'eval' / 'wasm-eval' / 'self' 等关键字(CSP spec),\n// 这些不是 URL,不应该走 redactUrl\nconst URL_LIKE_BLOCKED_URI = /^https?:|^\\/\\//i;\n\nconst redactBlockedUri = (redactUrl: (url: string) => string, blockedURI: string | undefined) => {\n if (!blockedURI) return undefined;\n return URL_LIKE_BLOCKED_URI.test(blockedURI) ? redactUrl(blockedURI) : blockedURI;\n};\n\n/**\n * CSP 违规事件采集插件,通过监听 `securitypolicyviolation` 事件捕获被 CSP 策略拦截的脚本/资源,\n * 以 error span 上报,进入统一错误分析口径。\n *\n * URL 处理:\n * - `blockedURI` / `sourceFile` 中的 URL 类值会经 `redactUrl` 脱敏。\n * - `blockedURI` 是 'inline' / 'eval' 等 CSP 关键字时直接保留,不调用 redactUrl。\n */\nexport const createCspViolationPlugin = (): BkOTPlugin => {\n let teardown: (() => void) | undefined;\n\n return {\n name: 'csp-violation',\n init(context) {\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n return;\n }\n\n const handler = (event: SecurityPolicyViolationEvent) => {\n if (!context.isSampled()) return;\n const occurredAt = Date.now();\n const blockedUri = redactBlockedUri(context.config.hooks.redactUrl, event.blockedURI);\n const sourceFile = event.sourceFile ? context.config.hooks.redactUrl(event.sourceFile) : undefined;\n\n const span = context.startSpan(\n 'csp.violation',\n {\n ...context.config.hooks.getPageAttributes(),\n ...buildRumSpanAttributes({\n outcome: RUM_SPAN_OUTCOME.error,\n outcomeReason: 'csp',\n spanType: RUM_SPAN_TYPE.error,\n }),\n 'csp.blocked_uri': blockedUri,\n 'csp.violated_directive': event.violatedDirective,\n 'csp.effective_directive': event.effectiveDirective,\n 'csp.disposition': event.disposition,\n 'csp.source_file': sourceFile,\n 'csp.line_number': event.lineNumber,\n 'csp.column_number': event.columnNumber,\n 'csp.status_code': event.statusCode,\n 'csp.original_policy': event.originalPolicy,\n 'error.source': 'csp',\n },\n { startTime: occurredAt },\n );\n span.end(occurredAt);\n };\n\n document.addEventListener('securitypolicyviolation', handler);\n teardown = () => document.removeEventListener('securitypolicyviolation', handler);\n },\n shutdown() {\n teardown?.();\n teardown = undefined;\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n */\n\n/** 非密码学稳定 hash,仅用于生成浏览器本地 storage key。 */\nexport const hashString = (input: string): string => {\n let hash = 5381;\n for (let index = 0; index < input.length; index++) {\n hash = (hash * 33) ^ input.charCodeAt(index);\n }\n return (hash >>> 0).toString(36);\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { hashString } from '../core/hash';\nimport { createRandomId } from '../core/id';\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\n\nimport type { BkOTPlugin } from '../core/plugin';\nimport type { Attributes } from '@opentelemetry/api';\n\nexport interface BkOTDevicePluginOptions {\n /** 是否跨页面持久化匿名设备 ID,默认 false。 */\n persistentId?: boolean;\n storageKey?: string;\n}\n\nconst DEFAULT_DEVICE_STORAGE_KEY = 'BK_RUM_DEVICE_ID';\n// 用户拖窗口时 resize 高频触发,debounce 静默期内只在最后一次更新,避免无谓的 setRuntimeAttributes 风暴\nconst VIEWPORT_DEBOUNCE_MS = 250;\n\ninterface NetworkInformationLike {\n effectiveType?: string;\n type?: string;\n addEventListener?: (type: 'change', listener: () => void) => void;\n removeEventListener?: (type: 'change', listener: () => void) => void;\n}\n\ninterface UserAgentDataLike {\n mobile?: boolean;\n platform?: string;\n}\n\nconst getConnection = (): NetworkInformationLike | undefined =>\n (\n navigator as Navigator & {\n connection?: NetworkInformationLike;\n }\n ).connection;\n\nconst getUserAgentData = (): undefined | UserAgentDataLike =>\n (\n navigator as Navigator & {\n userAgentData?: UserAgentDataLike;\n }\n ).userAgentData;\n\nconst getBrowserInfo = (ua: string) => {\n const matchers: Array<[string, RegExp]> = [\n ['Edge', /Edg\\/([\\d.]+)/],\n ['Chrome', /Chrome\\/([\\d.]+)/],\n ['Firefox', /Firefox\\/([\\d.]+)/],\n ['Safari', /Version\\/([\\d.]+).*Safari/],\n ];\n for (const [name, pattern] of matchers) {\n const matched = ua.match(pattern);\n if (matched?.[1]) {\n return { name, version: matched[1].split('.')[0] };\n }\n }\n return { name: 'Other', version: undefined };\n};\n\nconst getOsName = (ua: string, platform?: string) => {\n const value = `${platform ?? ''} ${ua}`;\n if (/iphone|ipad|ipod/i.test(value)) return 'iOS';\n if (/android/i.test(value)) return 'Android';\n if (/mac/i.test(value)) return 'macOS';\n if (/win/i.test(value)) return 'Windows';\n if (/linux/i.test(value)) return 'Linux';\n return 'Other';\n};\n\nconst readDeviceId = (storageKey: string) => {\n let existed: null | string = null;\n try {\n existed = window.localStorage.getItem(storageKey);\n } catch {\n /* localStorage 不可用(隐私模式 / sandbox iframe),下面会创建一个 in-memory id */\n }\n if (existed) {\n return existed;\n }\n const deviceId = createRandomId('device');\n try {\n window.localStorage.setItem(storageKey, deviceId);\n } catch {\n /* 写不进去也行,至少本次 SDK 生命周期内 deviceId 仍然稳定 */\n }\n return deviceId;\n};\n\n// 视口尺寸:随窗口大小 / 屏幕旋转变化,需要在 resize / orientationchange 时刷新\nconst getViewportAttributes = (): Attributes => {\n if (typeof window === 'undefined') {\n return {};\n }\n return {\n 'browser.viewport.width': window.innerWidth,\n 'browser.viewport.height': window.innerHeight,\n 'browser.screen.width': window.screen?.width,\n 'browser.screen.height': window.screen?.height,\n };\n};\n\n// 网络信息:随 online / offline / connection.change 变化\nconst getNetworkAttributes = (): Attributes => {\n if (typeof navigator === 'undefined') {\n return {};\n }\n const connection = getConnection();\n return {\n [RUM_ATTRIBUTES.networkStatus]: navigator.onLine ? 'connected' : 'not_connected',\n 'network.effective_type': connection?.effectiveType,\n 'network.connection.type': connection?.type,\n };\n};\n\n// 设备与 User Agent 信息:进入页面时一次性读取,运行期不会变化,适合作为 Resource 公共属性。\nexport const getDeviceResourceAttributes = (): Attributes => {\n if (typeof navigator === 'undefined') {\n return {};\n }\n const uaData = getUserAgentData();\n const ua = navigator.userAgent;\n const browser = getBrowserInfo(ua);\n const osName = getOsName(ua, uaData?.platform);\n const deviceType = uaData?.mobile || /mobi|android|iphone|ipad|ipod/i.test(ua) ? 'mobile' : 'desktop';\n return {\n [RUM_ATTRIBUTES.deviceMemoryGib]: (navigator as Navigator & { deviceMemory?: number }).deviceMemory,\n [RUM_ATTRIBUTES.deviceType]: deviceType,\n [RUM_ATTRIBUTES.userAgentName]: browser.name,\n [RUM_ATTRIBUTES.userAgentVersion]: browser.version,\n [RUM_ATTRIBUTES.userAgentOsName]: osName,\n };\n};\n\n// trailing debounce:windowMs 静默期内的多次触发只执行最后一次。\n// 适合 resize 这类\"用户停下来后才需要拿到最终值\"的场景。\nconst createDebounce = (fn: () => void, windowMs: number) => {\n let timer: number | undefined;\n return () => {\n if (timer !== undefined) {\n window.clearTimeout(timer);\n }\n timer = window.setTimeout(() => {\n timer = undefined;\n fn();\n }, windowMs);\n };\n};\n\n/**\n * 设备元数据采集插件。稳定的设备能力由 SDK 写入 Resource;这里只维护设备 ID 和运行期动态属性。\n *\n * 上报字段:\n * - `device.id`:设备级永久标识,存于 localStorage(默认 key 复用旧 session 插件以保留现网用户)。\n * - `device.memory_gib`:硬件能力快照,写入 Resource。\n * - `user_agent.name` / `user_agent.version` / `user_agent.os.name`:User Agent 信息,写入 Resource。\n * - `browser.viewport.*` / `browser.screen.*`:视口与屏幕尺寸。\n * - `network.status` / `network.effective_type` / `network.connection.type`:网络信息。\n *\n * 实时更新:\n * - viewport 监听 `resize` / `orientationchange`,并经 250ms debounce 合并,避免拖窗口时高频触发;\n * 静默期结束后用最终值刷新 runtimeAttributes。\n * - network 监听 `online` / `offline` / `connection.change`(本身低频,不需要 throttle)。\n * - 二者只更新 in-memory 的 runtimeAttributes,不会主动产生新的 Span;\n * 更新后续生成的 Span 会带最新值。\n *\n * 与 session 插件的关系:device 跨会话持久(终身),session 有过期与续期(连续访问语义)。\n */\nexport const createDevicePlugin = (options: BkOTDevicePluginOptions = {}): BkOTPlugin => {\n const teardownCallbacks: Array<() => void> = [];\n return {\n name: 'device',\n init(context) {\n const storageKey =\n options.storageKey ?? `${DEFAULT_DEVICE_STORAGE_KEY}_${hashString(context.config.application.name)}`;\n const deviceId =\n typeof window === 'undefined' || options.persistentId !== true\n ? createRandomId('device')\n : readDeviceId(storageKey);\n\n context.setRuntimeAttributes({\n 'device.id': deviceId,\n // createDevicePlugin 作为扩展单独启用时,Resource 没有设备字段,仍回退到原有 runtime attributes 行为。\n ...(context.config.tracking.device === false ? getDeviceResourceAttributes() : {}),\n ...getViewportAttributes(),\n ...getNetworkAttributes(),\n });\n\n if (typeof window === 'undefined') {\n return;\n }\n\n const refreshViewport = createDebounce(() => {\n context.setRuntimeAttributes(getViewportAttributes());\n }, VIEWPORT_DEBOUNCE_MS);\n window.addEventListener('resize', refreshViewport);\n window.addEventListener('orientationchange', refreshViewport);\n teardownCallbacks.push(\n () => window.removeEventListener('resize', refreshViewport),\n () => window.removeEventListener('orientationchange', refreshViewport),\n );\n\n const refreshNetwork = () => {\n context.setRuntimeAttributes(getNetworkAttributes());\n };\n window.addEventListener('online', refreshNetwork);\n window.addEventListener('offline', refreshNetwork);\n teardownCallbacks.push(\n () => window.removeEventListener('online', refreshNetwork),\n () => window.removeEventListener('offline', refreshNetwork),\n );\n\n const connection = getConnection();\n // NetworkInformation 实现了 EventTarget;旧浏览器或某些 polyfill 可能没有 addEventListener,做能力检测\n if (connection && typeof connection.addEventListener === 'function') {\n connection.addEventListener('change', refreshNetwork);\n teardownCallbacks.push(() => {\n connection.removeEventListener?.('change', refreshNetwork);\n });\n }\n },\n shutdown() {\n while (teardownCallbacks.length) {\n teardownCallbacks.pop()?.();\n }\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/**\n * 浏览器错误采集插件,负责捕获 JS 运行时错误、未处理的 Promise rejection、资源加载失败三类错误。\n *\n * 上报策略:\n * - 错误分析主数据统一使用 `span_type=error` 的 error span。\n * - 每个浏览器错误只生成一条原始 error Span,错误分组和风暴控制由服务端完成。\n *\n * 关键 attribute:\n * - `error.source`:错误来源,取值 `window.error` / `unhandledrejection` / `resource`。\n * - `error.cross_origin`:仅在跨域脚本错误(\"Script error.\")时为 true,便于过滤这类无 stack 噪声。\n * - 资源错误额外带 `url.full`(经 redactUrl 脱敏)与 `html.tag`。\n * - JS 错误额外带 `code.filepath` / `code.lineno` / `code.column`。\n */\n\nimport { SpanStatusCode } from '@opentelemetry/api';\n\nimport { buildRumSpanAttributes, RUM_SPAN_OUTCOME, RUM_SPAN_TYPE } from '../schema/span';\n\nimport type { BkOTPlugin, BkOTRuntimeContext } from '../core/plugin';\n\nconst getErrorMessage = (value: unknown) => {\n if (value instanceof Error) {\n return value.message;\n }\n if (typeof value === 'string') {\n return value;\n }\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n};\n\ninterface EmitErrorOptions {\n context: BkOTRuntimeContext;\n error: unknown;\n exceptionType?: string;\n extra?: Record<string, unknown>;\n source: string;\n spanName: string;\n}\n\nconst emitError = ({ context, error, exceptionType, extra = {}, source, spanName }: EmitErrorOptions) => {\n if (!context.isSampled()) return;\n const occurredAt = Date.now();\n const message = getErrorMessage(error);\n context.notifyActivity({ time: occurredAt, type: 'error' });\n\n const exceptionLike = error instanceof Error ? error : { message, name: exceptionType ?? source };\n const attributes = {\n ...context.config.hooks.getPageAttributes(),\n ...context.config.hooks.getErrorAttributes(),\n ...buildRumSpanAttributes({\n outcome: RUM_SPAN_OUTCOME.error,\n spanType: RUM_SPAN_TYPE.error,\n }),\n 'error.message': message,\n 'error.handled': false,\n 'error.source': source,\n ...extra,\n };\n // 错误分析统一沉淀为 error span;若当前存在 active context,OTel 会自动建立父子关系。\n const errorSpan = context.startSpan(spanName, attributes, { startTime: occurredAt });\n errorSpan.recordException(exceptionLike);\n errorSpan.setStatus({ code: SpanStatusCode.ERROR, message });\n errorSpan.end();\n};\n\nexport const createErrorPlugin = (): BkOTPlugin => {\n const listeners: Array<() => void> = [];\n\n return {\n name: 'error',\n init(context) {\n if (typeof window === 'undefined') {\n return;\n }\n\n const onError = (event: ErrorEvent) => {\n // 跨域脚本错误浏览器会屏蔽 stack/filename,message 通常是 \"Script error.\"\n const isCrossOrigin = !event.error && !event.filename && event.message === 'Script error.';\n emitError({\n context,\n spanName: 'browser.error',\n source: 'window.error',\n error: event.error ?? event.message,\n extra: {\n 'code.filepath': event.filename,\n 'code.lineno': event.lineno,\n 'code.column': event.colno,\n ...(isCrossOrigin ? { 'error.cross_origin': true } : {}),\n },\n });\n };\n const onUnhandledRejection = (event: PromiseRejectionEvent) => {\n emitError({\n context,\n spanName: 'browser.unhandledrejection',\n source: 'unhandledrejection',\n error: event.reason,\n exceptionType: event.reason instanceof Error ? event.reason.name : 'UnhandledRejection',\n });\n };\n const onResourceError = (event: Event) => {\n // JS 运行时错误是 ErrorEvent,已由 bubble 阶段的 onError 处理;这里只关心资源加载失败\n if (event instanceof ErrorEvent) return;\n const target = event.target;\n if (!(target instanceof Element)) return;\n const elementWithUrl = target as Element & { href?: string; src?: string };\n const resourceUrl = elementWithUrl.src || elementWithUrl.href || (target as HTMLMediaElement).currentSrc || '';\n emitError({\n context,\n spanName: 'browser.resource_error',\n source: 'resource',\n error: new Error(`Resource load failed: ${target.tagName.toLowerCase()} ${resourceUrl}`),\n exceptionType: 'ResourceError',\n extra: {\n 'url.full': context.config.hooks.redactUrl(resourceUrl),\n 'html.tag': target.tagName,\n },\n });\n };\n\n window.addEventListener('error', onError);\n window.addEventListener('unhandledrejection', onUnhandledRejection);\n window.addEventListener('error', onResourceError, true);\n listeners.push(\n () => window.removeEventListener('error', onError),\n () => window.removeEventListener('unhandledrejection', onUnhandledRejection),\n () => window.removeEventListener('error', onResourceError, true),\n );\n },\n shutdown() {\n while (listeners.length) {\n listeners.pop()?.();\n }\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n */\n\nimport { createRandomId } from '../core/id';\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\nimport { buildRumSpanAttributes, RUM_SPAN_TYPE } from '../schema/span';\n\nimport type { BkOTPlugin } from '../core/plugin';\nimport type { Attributes } from '@opentelemetry/api';\n\n/**\n * 主线程阻塞优先使用 Long Animation Frame API 获取脚本归因,不支持时回退到 Long Tasks API;\n * span 保留单次诊断详情,分布与计数由服务端从原始事件计算。\n */\nexport interface BkOTLongTaskPluginOptions {\n /** 采集阈值,默认 50ms。Performance API 本身通常只产生大于 50ms 的条目。 */\n threshold?: number;\n}\n\ninterface LegacyLongTaskEntry extends PerformanceEntry {\n attribution?: Array<{\n containerId?: string;\n containerName?: string;\n containerSrc?: string;\n containerType?: string;\n name?: string;\n }>;\n}\n\ninterface LongAnimationFrameEntry extends PerformanceEntry {\n blockingDuration: number;\n firstUIEventTimestamp: number;\n renderStart: number;\n scripts: ScriptTiming[];\n styleAndLayoutStart: number;\n}\n\ninterface ScriptTiming {\n duration: number;\n executionStart: number;\n forcedStyleAndLayoutDuration: number;\n invoker: string;\n invokerType: string;\n pauseDuration: number;\n sourceCharPosition: number;\n sourceFunctionName: string;\n sourceURL: string;\n startTime: number;\n windowAttribution: string;\n}\n\nconst DEFAULT_THRESHOLD = 50;\n\nconst nonNegativeNumber = (value: number | undefined, fallback: number) =>\n typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : fallback;\n\nconst finiteNumber = (value: number | undefined) => (Number.isFinite(value) ? value : undefined);\n\nconst getLegacyAttributionAttributes = (\n attribution: NonNullable<LegacyLongTaskEntry['attribution']>[number],\n redactUrl: (url: string) => string,\n): Attributes => ({\n ...(attribution.containerId ? { 'long_task.attribution.container_id': attribution.containerId } : {}),\n ...(attribution.containerName ? { 'long_task.attribution.container_name': attribution.containerName } : {}),\n ...(attribution.containerSrc ? { 'long_task.attribution.container_src': redactUrl(attribution.containerSrc) } : {}),\n ...(attribution.containerType ? { 'long_task.attribution.container_type': attribution.containerType } : {}),\n ...(attribution.name ? { 'long_task.attribution.name': attribution.name } : {}),\n});\n\nconst getScriptAttributes = (script: ScriptTiming, redactUrl: (url: string) => string): Attributes => ({\n 'long_task.script.duration': script.duration,\n 'long_task.script.execution_start': script.executionStart,\n 'long_task.script.forced_style_and_layout_duration': script.forcedStyleAndLayoutDuration,\n 'long_task.script.invoker': script.invoker,\n 'long_task.script.invoker_type': script.invokerType,\n 'long_task.script.pause_duration': script.pauseDuration,\n 'long_task.script.source_char_position': script.sourceCharPosition,\n 'long_task.script.source_function_name': script.sourceFunctionName,\n 'long_task.script.source_url': script.sourceURL ? redactUrl(script.sourceURL) : '',\n 'long_task.script.start_time': script.startTime,\n 'long_task.script.window_attribution': script.windowAttribution,\n});\n\nexport const createLongTaskPlugin = (options: BkOTLongTaskPluginOptions = {}): BkOTPlugin => {\n const threshold = nonNegativeNumber(options.threshold, DEFAULT_THRESHOLD);\n let observer: PerformanceObserver | undefined;\n let initialBatchTimer: ReturnType<typeof setTimeout> | undefined;\n let initialEntries: PerformanceEntry[] = [];\n\n return {\n name: 'long-task',\n init(context) {\n if (typeof PerformanceObserver === 'undefined' || typeof performance === 'undefined') return;\n const supportedEntryTypes = PerformanceObserver.supportedEntryTypes ?? [];\n // LoAF 提供脚本归因与 blockingDuration,支持时优先使用;旧浏览器回退到 longtask。\n const entryType = supportedEntryTypes.includes('long-animation-frame')\n ? 'long-animation-frame'\n : supportedEntryTypes.includes('longtask')\n ? 'longtask'\n : undefined;\n if (!entryType) return;\n\n const emitEntry = (entry: LegacyLongTaskEntry | LongAnimationFrameEntry) => {\n if (!context.isSampled()) return;\n if (!Number.isFinite(entry.duration) || entry.duration < threshold) return;\n const isLoaf = entry.entryType === 'long-animation-frame';\n const loaf = isLoaf ? (entry as LongAnimationFrameEntry) : undefined;\n const scripts = loaf?.scripts ?? [];\n const id = createRandomId('long-task');\n const startTime = performance.timeOrigin + entry.startTime;\n const endTime = startTime + entry.duration;\n const entryTypeAttribute = isLoaf ? 'long-animation-frame' : 'long-task';\n const legacyAttributions = isLoaf ? [] : ((entry as LegacyLongTaskEntry).attribution ?? []);\n const span = context.startSpan(\n 'browser.long_task',\n {\n ...context.config.hooks.getPageAttributes(),\n ...buildRumSpanAttributes({\n spanType: RUM_SPAN_TYPE.longTask,\n }),\n ...(finiteNumber(loaf?.blockingDuration) !== undefined\n ? { [RUM_ATTRIBUTES.longTaskBlockingDuration]: loaf!.blockingDuration }\n : {}),\n [RUM_ATTRIBUTES.longTaskDuration]: entry.duration,\n [RUM_ATTRIBUTES.longTaskEntryType]: entryTypeAttribute,\n [RUM_ATTRIBUTES.longTaskId]: id,\n 'long_task.name': entry.name,\n ...(finiteNumber(loaf?.firstUIEventTimestamp) !== undefined\n ? { 'long_task.first_ui_event_timestamp': loaf!.firstUIEventTimestamp }\n : {}),\n ...(finiteNumber(loaf?.renderStart) !== undefined ? { 'long_task.render_start': loaf!.renderStart } : {}),\n ...(finiteNumber(loaf?.styleAndLayoutStart) !== undefined\n ? { 'long_task.style_and_layout_start': loaf!.styleAndLayoutStart }\n : {}),\n ...(loaf ? { [RUM_ATTRIBUTES.longTaskStartTime]: loaf.startTime } : {}),\n },\n { startTime },\n );\n scripts.forEach(script => {\n span.addEvent(\n 'long_task.script',\n context.applyRedact(getScriptAttributes(script, context.config.hooks.redactUrl)),\n performance.timeOrigin + script.startTime,\n );\n });\n legacyAttributions.forEach((attribution, index) => {\n span.addEvent(\n 'long_task.attribution',\n context.applyRedact({\n 'long_task.attribution.index': index,\n ...getLegacyAttributionAttributes(attribution, context.config.hooks.redactUrl),\n }),\n startTime,\n );\n });\n span.end(endTime);\n context.notifyActivity({ endTime, startTime, type: 'long_task' });\n };\n\n const emitEntries = (entries: PerformanceEntry[]) =>\n entries.forEach(entry => emitEntry(entry as LegacyLongTaskEntry));\n try {\n let initializing = true;\n observer = new PerformanceObserver(list => {\n const entries = list.getEntries();\n if (initializing) {\n // buffered 条目可能在 observe() 内同步回调,先合并到下一宏任务,等 Session/View 上下文就绪后再归属。\n initialEntries.push(...entries);\n if (!initialBatchTimer) {\n initialBatchTimer = setTimeout(() => {\n const entriesToEmit = initialEntries;\n initialEntries = [];\n initialBatchTimer = undefined;\n emitEntries(entriesToEmit);\n });\n }\n } else {\n emitEntries(entries);\n }\n });\n observer.observe({ type: entryType, buffered: true });\n initializing = false;\n } catch {\n observer = undefined;\n }\n },\n shutdown() {\n observer?.disconnect();\n observer = undefined;\n clearTimeout(initialBatchTimer);\n initialBatchTimer = undefined;\n initialEntries = [];\n },\n };\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nexport interface RouteChangeEvent {\n fromUrl: string;\n source: RouteChangeSource;\n toUrl: string;\n}\n\nexport type RouteChangeSource = 'hashchange' | 'popstate' | 'pushState' | 'replaceState';\n\ntype RouteChangeHandler = (event: RouteChangeEvent) => void;\n\nconst subscribers = new Set<RouteChangeHandler>();\n\n// History 只 patch 一次,多个插件/实例共用订阅集合;最后一个订阅者退出时恢复原方法。\nlet lastUrl = '';\nlet originalPushState: typeof history.pushState | undefined;\nlet originalReplaceState: typeof history.replaceState | undefined;\nlet patched = false;\n\nconst getCurrentUrl = () => (typeof location === 'undefined' ? '' : location.href);\n\nconst emitRouteChange = (source: RouteChangeSource, fromUrl: string) => {\n const toUrl = getCurrentUrl();\n lastUrl = toUrl;\n const event: RouteChangeEvent = { fromUrl, source, toUrl };\n\n for (const subscriber of Array.from(subscribers)) {\n subscriber(event);\n }\n};\n\nconst onPopState = () => {\n emitRouteChange('popstate', lastUrl || getCurrentUrl());\n};\n\nconst onHashChange = () => {\n emitRouteChange('hashchange', lastUrl || getCurrentUrl());\n};\n\nconst patchHistory = () => {\n if (patched || typeof window === 'undefined' || typeof history === 'undefined') {\n return;\n }\n\n patched = true;\n lastUrl = getCurrentUrl();\n originalPushState = history.pushState;\n originalReplaceState = history.replaceState;\n\n history.pushState = function patchedPushState(this: History, data: any, title: string, url?: null | string | URL) {\n const fromUrl = lastUrl || getCurrentUrl();\n // 先执行原方法,让订阅者读取到的 location 与浏览器最终状态一致。\n const result = originalPushState?.apply(this, [data, title, url]);\n emitRouteChange('pushState', fromUrl);\n return result;\n };\n history.replaceState = function patchedReplaceState(\n this: History,\n data: any,\n title: string,\n url?: null | string | URL,\n ) {\n const fromUrl = lastUrl || getCurrentUrl();\n const result = originalReplaceState?.apply(this, [data, title, url]);\n emitRouteChange('replaceState', fromUrl);\n return result;\n };\n window.addEventListener('popstate', onPopState);\n window.addEventListener('hashchange', onHashChange);\n};\n\nconst restoreHistory = () => {\n if (!patched || typeof window === 'undefined' || typeof history === 'undefined') {\n return;\n }\n\n if (originalPushState) {\n history.pushState = originalPushState;\n }\n if (originalReplaceState) {\n history.replaceState = originalReplaceState;\n }\n window.removeEventListener('popstate', onPopState);\n window.removeEventListener('hashchange', onHashChange);\n originalPushState = undefined;\n originalReplaceState = undefined;\n patched = false;\n lastUrl = '';\n};\n\nexport const subscribeRouteChange = (handler: RouteChangeHandler) => {\n if (typeof window === 'undefined' || typeof history === 'undefined') {\n return () => {};\n }\n\n patchHistory();\n subscribers.add(handler);\n\n return () => {\n subscribers.delete(handler);\n if (subscribers.size === 0) {\n restoreHistory();\n }\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/**\n * Page View 插件\n *\n * 自动模式监听初始加载、SPA 路由和 BFCache;手动模式仅由 startView() 划分 View。\n *\n * 上报形态:browser.view start/update/end 原始生命周期事件 span。\n *\n * 自动边界与 Datadog 对齐:pathname 或非锚点 hash path 改变才创建 View,query-only 变化不创建。\n *\n * 关键属性:\n * - view.url:当前页面 URL(经 redactUrl 脱敏)\n * - url.previous:跳转前的 URL(来自 route-observer 的 fromUrl,初始 load 为空字符串)\n * - document.referrer:仅 'load' 事件携带\n */\n\nimport { createRandomId } from '../core/id';\nimport { waitForPageActivityEnd } from '../core/page-activity';\nimport { subscribeRouteChange } from '../core/route-observer';\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\nimport { buildRumSpanAttributes, RUM_SPAN_TYPE } from '../schema/span';\n\nimport type { BkOTPlugin } from '../core/plugin';\nimport type { BkOTStartViewOptions, BkOTViewContext } from '../core/runtime-context';\nimport type { Attributes } from '@opentelemetry/api';\n\ninterface ActiveView {\n attributes: Attributes;\n id: string;\n loadingTime?: number;\n loadingTimeSource?: 'auto' | 'manual';\n loadingType: ViewLoadingType;\n /** 仅业务显式命名时存在;未命名时由后端回退到 view.url_template 展示 */\n name?: string;\n rawUrl: string;\n snapshotAttributes: Attributes;\n startedAt: number;\n url: string;\n urlTemplate: string;\n version: number;\n stopLoadingTime?: () => void;\n}\n\ntype ViewLoadingType = NonNullable<BkOTViewContext['loadingType']>;\n\nconst PROTECTED_ATTRIBUTE_KEYS = new Set<string>(Object.values(RUM_ATTRIBUTES));\n\nconst getCurrentUrl = () => {\n if (typeof location === 'undefined') {\n return '';\n }\n return location.href;\n};\n\nconst getNavigationTimingAttributes = (): Attributes => {\n if (typeof performance === 'undefined') return {};\n const navigation = performance.getEntriesByType('navigation')[0] as PerformanceNavigationTiming | undefined;\n if (!navigation) return {};\n const attributes: Attributes = {};\n const setTiming = (key: string, value: number) => {\n if (Number.isFinite(value) && value > 0) attributes[key] = value;\n };\n setTiming(RUM_ATTRIBUTES.viewFirstByte, navigation.responseStart);\n setTiming(RUM_ATTRIBUTES.viewDomInteractive, navigation.domInteractive);\n setTiming(RUM_ATTRIBUTES.viewDomContentLoaded, navigation.domContentLoadedEventEnd);\n setTiming(RUM_ATTRIBUTES.viewDomComplete, navigation.domComplete);\n setTiming(RUM_ATTRIBUTES.viewLoadEvent, navigation.loadEventEnd);\n return attributes;\n};\n\nconst getHashPath = (hash: string) => {\n const queryIndex = hash.indexOf('?');\n return queryIndex < 0 ? hash : hash.slice(0, queryIndex);\n};\n\nconst isHashAnchor = (hash: string) => {\n const id = hash.slice(1);\n if (!id || typeof document === 'undefined' || typeof document.getElementById !== 'function') return false;\n try {\n return Boolean(document.getElementById(decodeURIComponent(id)));\n } catch {\n return Boolean(document.getElementById(id));\n }\n};\n\nexport const isViewLocationChange = (fromUrl: string, toUrl: string) => {\n try {\n const base = typeof location === 'undefined' ? 'http://localhost' : location.href;\n const from = new URL(fromUrl, base);\n const to = new URL(toUrl, base);\n return from.pathname !== to.pathname || (!isHashAnchor(to.hash) && getHashPath(from.hash) !== getHashPath(to.hash));\n } catch {\n return fromUrl !== toUrl;\n }\n};\n\nexport const createPageViewPlugin = (): BkOTPlugin => {\n const teardownCallbacks: Array<() => void> = [];\n\n return {\n name: 'page-view',\n init(context) {\n if (typeof window === 'undefined') {\n return;\n }\n\n let activeView: ActiveView | undefined;\n let bfCacheView: Omit<ActiveView, 'stopLoadingTime'> | undefined;\n let renewalView: Omit<ActiveView, 'stopLoadingTime'> | undefined;\n\n const clearViewContext = (changedAt = Date.now()) => context.setView({}, changedAt);\n\n const emitViewEvent = (\n view: ActiveView,\n phase: 'end' | 'start' | 'update',\n timestamp = Date.now(),\n reason?: string,\n ) => {\n view.version += 1;\n const span = context.startSpan(\n 'browser.view',\n {\n ...context.config.hooks.getPageAttributes(),\n ...view.attributes,\n ...view.snapshotAttributes,\n [RUM_ATTRIBUTES.viewPhase]: phase,\n [RUM_ATTRIBUTES.viewStartedAt]: view.startedAt,\n [RUM_ATTRIBUTES.viewVersion]: view.version,\n ...(reason ? { 'view.end_reason': reason } : {}),\n ...(view.loadingTime === undefined\n ? {}\n : {\n [RUM_ATTRIBUTES.viewLoadingTime]: view.loadingTime,\n [RUM_ATTRIBUTES.viewLoadingTimeSource]: view.loadingTimeSource,\n }),\n },\n {\n contextTime: timestamp,\n startTime: timestamp,\n },\n );\n span.end(timestamp);\n };\n\n const endActiveView = (reason: string, clearContext = true, endedAt = Date.now()) => {\n if (!activeView) {\n if (clearContext) clearViewContext(endedAt);\n return undefined;\n }\n const snapshot = { ...activeView };\n activeView.stopLoadingTime?.();\n emitViewEvent(activeView, 'end', endedAt, reason);\n activeView = undefined;\n if (clearContext) clearViewContext(endedAt);\n const { stopLoadingTime: _stopLoadingTime, ...rest } = snapshot;\n return rest;\n };\n\n const setLoadingTime = (view: ActiveView, duration: number, source: 'auto' | 'manual') => {\n if (activeView !== view || !Number.isFinite(duration) || duration < 0) return;\n const navigationTimingAttributes = view.loadingType === 'initial_load' ? getNavigationTimingAttributes() : {};\n const updatedAttributes = {\n ...navigationTimingAttributes,\n [RUM_ATTRIBUTES.viewLoadingTime]: duration,\n [RUM_ATTRIBUTES.viewLoadingTimeSource]: source,\n };\n Object.assign(view.snapshotAttributes, updatedAttributes);\n view.loadingTime = duration;\n view.loadingTimeSource = source;\n emitViewEvent(view, 'update');\n };\n\n const startLoadingTimeTracking = (view: ActiveView) => {\n if (!context.config.view.loadingTime || document.visibilityState === 'hidden') return;\n let activityResolved = false;\n let activityCandidate: number | undefined;\n let loadResolved = view.loadingType !== 'initial_load';\n let loadCandidate: number | undefined;\n let loadListener: (() => void) | undefined;\n let hidden = false;\n let visibilityListener: (() => void) | undefined;\n\n const tryComplete = () => {\n if (hidden || !activityResolved || !loadResolved || activeView !== view) return;\n const candidates = [activityCandidate, loadCandidate].filter(\n (candidate): candidate is number => candidate !== undefined,\n );\n if (candidates.length) setLoadingTime(view, Math.max(...candidates), 'auto');\n view.stopLoadingTime?.();\n view.stopLoadingTime = undefined;\n };\n\n const readLoadEvent = () => {\n const navigation = performance.getEntriesByType?.('navigation')[0] as PerformanceNavigationTiming | undefined;\n if (!navigation?.loadEventEnd) return false;\n loadCandidate = Math.max(0, performance.timeOrigin + navigation.loadEventEnd - view.startedAt);\n loadResolved = true;\n return true;\n };\n\n if (!loadResolved && !readLoadEvent()) {\n const onLoad = () => {\n setTimeout(() => {\n if (activeView !== view) return;\n readLoadEvent();\n loadResolved = true;\n tryComplete();\n });\n };\n window.addEventListener('load', onLoad, { once: true });\n loadListener = () => window.removeEventListener('load', onLoad);\n }\n\n const stopActivity = waitForPageActivityEnd(context, view.startedAt, result => {\n activityResolved = true;\n if (result.hadActivity) activityCandidate = Math.max(0, result.endTime - view.startedAt);\n tryComplete();\n });\n const onVisibilityChange = () => {\n if (document.visibilityState !== 'hidden') return;\n hidden = true;\n view.stopLoadingTime?.();\n view.stopLoadingTime = undefined;\n };\n document.addEventListener('visibilitychange', onVisibilityChange);\n visibilityListener = () => document.removeEventListener('visibilitychange', onVisibilityChange);\n view.stopLoadingTime = () => {\n stopActivity();\n loadListener?.();\n loadListener = undefined;\n visibilityListener?.();\n visibilityListener = undefined;\n };\n tryComplete();\n };\n\n const sanitizeViewAttributes = (attributes: Attributes | undefined) => {\n const redacted = context.applyRedact(attributes ?? {});\n return Object.fromEntries(\n Object.entries(redacted).filter(([key, value]) => value !== undefined && !PROTECTED_ATTRIBUTE_KEYS.has(key)),\n ) as Attributes;\n };\n\n const startView = (\n options: BkOTStartViewOptions,\n source: string,\n loadingType: ViewLoadingType,\n previousUrl = activeView?.rawUrl ?? '',\n ) => {\n if (!context.isSessionActive()) return;\n const currentUrl = options.url ?? getCurrentUrl();\n const urlTemplate = context.config.hooks.getViewUrlTemplate(currentUrl);\n const name = options.name;\n const customAttributes = sanitizeViewAttributes(options.attributes);\n endActiveView(source, false);\n\n const viewId = createRandomId('view');\n const redactedCurrentUrl = context.config.hooks.redactUrl(currentUrl);\n const redactedPreviousUrl = context.config.hooks.redactUrl(previousUrl);\n const isInitialLoad = loadingType === 'initial_load';\n const startedAt = isInitialLoad && typeof performance !== 'undefined' ? performance.timeOrigin : Date.now();\n const navigationTimingAttributes = isInitialLoad ? getNavigationTimingAttributes() : {};\n\n context.setView(\n {\n attributes: customAttributes,\n id: viewId,\n loadingType,\n name,\n startedAt,\n url: redactedCurrentUrl,\n urlTemplate,\n },\n startedAt,\n );\n\n const viewAttributes = {\n ...customAttributes,\n ...context.config.hooks.getPageAttributes(),\n ...navigationTimingAttributes,\n ...buildRumSpanAttributes({\n spanType: RUM_SPAN_TYPE.view,\n }),\n [RUM_ATTRIBUTES.viewId]: viewId,\n ...(name ? { [RUM_ATTRIBUTES.viewName]: name } : {}),\n [RUM_ATTRIBUTES.viewUrl]: redactedCurrentUrl,\n [RUM_ATTRIBUTES.viewUrlTemplate]: urlTemplate,\n [RUM_ATTRIBUTES.viewLoadingType]: loadingType,\n 'url.previous': redactedPreviousUrl,\n ...(isInitialLoad ? { 'document.referrer': context.config.hooks.redactUrl(document.referrer || '') } : {}),\n };\n activeView = {\n attributes: customAttributes,\n version: 0,\n id: viewId,\n loadingType,\n name,\n rawUrl: currentUrl,\n snapshotAttributes: viewAttributes,\n startedAt,\n url: redactedCurrentUrl,\n urlTemplate,\n };\n emitViewEvent(activeView, 'start', startedAt);\n startLoadingTimeTracking(activeView);\n };\n\n const unsubscribeViewCommands = context.onViewCommand(command => {\n if (command.type === 'start') {\n startView(command.options, 'manual', activeView ? 'route_change' : 'initial_load');\n return;\n }\n if (!activeView) return;\n if (command.type === 'set_loading_time') {\n activeView.stopLoadingTime?.();\n activeView.stopLoadingTime = undefined;\n setLoadingTime(activeView, Math.max(0, command.time - activeView.startedAt), 'manual');\n return;\n }\n if (activeView.name === command.name) return;\n activeView.name = command.name;\n activeView.snapshotAttributes[RUM_ATTRIBUTES.viewName] = command.name;\n context.setView({\n attributes: activeView.attributes,\n id: activeView.id,\n loadingType: activeView.loadingType,\n name: activeView.name,\n startedAt: activeView.startedAt,\n url: activeView.url,\n urlTemplate: activeView.urlTemplate,\n });\n emitViewEvent(activeView, 'update');\n });\n\n let unsubscribeRoute = () => {};\n if (context.config.view.tracking === 'auto') {\n if (!activeView) startView({}, 'load', 'initial_load');\n unsubscribeRoute = subscribeRouteChange(event => {\n if (isViewLocationChange(event.fromUrl, event.toUrl)) {\n startView({}, event.source, 'route_change', event.fromUrl);\n }\n });\n }\n\n const onPageHide = (event: PageTransitionEvent) => {\n if (event.persisted) {\n bfCacheView = endActiveView('bfcache');\n return;\n }\n bfCacheView = undefined;\n endActiveView('pagehide');\n };\n const onPageShow = (event: PageTransitionEvent) => {\n if (event.persisted && context.config.view.tracking === 'auto') {\n const restoredView = bfCacheView;\n bfCacheView = undefined;\n if (!context.isSessionActive()) {\n renewalView = restoredView;\n return;\n }\n startView(\n restoredView\n ? { attributes: restoredView.attributes, name: restoredView.name, url: restoredView.rawUrl }\n : {},\n 'bfCache',\n 'bf_cache',\n restoredView?.rawUrl,\n );\n }\n };\n const unsubscribeSessionLifecycle = context.onSessionLifecycle(event => {\n if (event.type === 'expired') {\n renewalView = endActiveView('session_expired', true, event.expiredAt) ?? bfCacheView;\n bfCacheView = undefined;\n return;\n }\n if (renewalView) {\n startView(\n { attributes: renewalView.attributes, name: renewalView.name, url: renewalView.rawUrl },\n 'sessionRenewal',\n 'session_renewal',\n renewalView.rawUrl,\n );\n renewalView = undefined;\n }\n });\n window.addEventListener('pagehide', onPageHide);\n window.addEventListener('pageshow', onPageShow);\n\n teardownCallbacks.push(\n unsubscribeRoute,\n unsubscribeSessionLifecycle,\n unsubscribeViewCommands,\n () => window.removeEventListener('pagehide', onPageHide),\n () => window.removeEventListener('pageshow', onPageShow),\n () => endActiveView('shutdown'),\n );\n },\n shutdown() {\n while (teardownCallbacks.length) {\n teardownCallbacks.pop()?.();\n }\n },\n };\n};\n","export interface ActiveSessionRecord {\n expiresAt: number;\n id: string;\n startedAt: number;\n status: 'active';\n}\n\nexport interface ExpiredSessionRecord {\n expiredAt: number;\n previousId: string;\n reason: SessionExpireReason;\n status: 'expired';\n}\n\n/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\nexport type SessionExpireReason = 'inactivity' | 'maxLifetime';\n\nexport type SessionRecord = ActiveSessionRecord | ExpiredSessionRecord;\n\nconst FUTURE_CLOCK_TOLERANCE_MS = 5_000;\n\nconst isTimestamp = (value: unknown): value is number =>\n typeof value === 'number' && Number.isFinite(value) && value > 0;\n\nexport const createActiveSessionRecord = (\n id: string,\n now: number,\n idleTimeoutMs: number,\n maxDurationMs: number,\n): ActiveSessionRecord => ({\n expiresAt: Math.min(now + idleTimeoutMs, now + maxDurationMs),\n id,\n startedAt: now,\n status: 'active',\n});\n\nexport const getSessionExpireReason = (\n record: ActiveSessionRecord,\n now: number,\n maxDurationMs: number,\n): SessionExpireReason | undefined => {\n if (now >= record.startedAt + maxDurationMs) return 'maxLifetime';\n if (now >= record.expiresAt) return 'inactivity';\n return undefined;\n};\n\nexport const expandActiveSession = (\n record: ActiveSessionRecord,\n now: number,\n idleTimeoutMs: number,\n maxDurationMs: number,\n): ActiveSessionRecord => ({\n ...record,\n expiresAt: Math.min(now + idleTimeoutMs, record.startedAt + maxDurationMs),\n});\n\nexport const parseSessionRecord = (raw: null | string, now: number, maxDurationMs: number): null | SessionRecord => {\n if (!raw) return null;\n try {\n const parsed = JSON.parse(raw) as Partial<SessionRecord>;\n if (\n parsed.status === 'active' &&\n typeof parsed.id === 'string' &&\n parsed.id.length > 0 &&\n isTimestamp(parsed.startedAt) &&\n // 容忍轻微时钟漂移,但拒绝远期时间与超出最大生命周期的记录,避免脏 storage 永久续期。\n parsed.startedAt <= now + FUTURE_CLOCK_TOLERANCE_MS &&\n isTimestamp(parsed.expiresAt) &&\n parsed.expiresAt >= parsed.startedAt &&\n parsed.expiresAt <= parsed.startedAt + maxDurationMs\n ) {\n return parsed as ActiveSessionRecord;\n }\n if (\n parsed.status === 'expired' &&\n typeof parsed.previousId === 'string' &&\n parsed.previousId.length > 0 &&\n (parsed.reason === 'inactivity' || parsed.reason === 'maxLifetime') &&\n isTimestamp(parsed.expiredAt) &&\n parsed.expiredAt <= now + FUTURE_CLOCK_TOLERANCE_MS\n ) {\n return parsed as ExpiredSessionRecord;\n }\n } catch {\n /* JSON 损坏视为无记录 */\n }\n return null;\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/**\n * Session 插件\n *\n * 生命周期:\n * - 首次访问创建 session;用户交互会续期有效 session,或重建已过期 session\n * - 固定 15 分钟无活动 / 4 小时最长生命周期,任一到达时立即清理运行时 session.id\n * - 页面重新可见时只续期有效 session,不会复活已过期 session\n * - 跨 tab 共享持久化状态;本 tab 过期后不会被其他 tab 的新 session 被动复活\n */\n\nimport { hashString } from '../core/hash';\nimport { createRandomId } from '../core/id';\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\nimport { buildRumSpanAttributes, RUM_SPAN_TYPE } from '../schema/span';\nimport {\n createActiveSessionRecord,\n expandActiveSession,\n getSessionExpireReason,\n parseSessionRecord,\n} from './session-state';\n\nimport type { BkOTPlugin, BkOTRuntimeContext } from '../core/plugin';\nimport type { ActiveSessionRecord, ExpiredSessionRecord, SessionExpireReason, SessionRecord } from './session-state';\n\nexport interface BkOTSessionConfig {\n /** 以 0~1 表示的 Session 采样率,默认 1。 */\n sampleRate?: number;\n // 自定义 storage key;不传则按 endpoint host 自动生成隔离后缀\n storageKey?: string;\n}\n\nconst SESSION_IDLE_TIMEOUT_MS = 15 * 60 * 1000;\nconst SESSION_MAX_DURATION_MS = 4 * 60 * 60 * 1000;\nconst ACTIVITY_THROTTLE_MS = 1_000;\nconst VISIBILITY_CHECK_MS = 60_000;\nconst ACTIVITY_EVENTS: Array<keyof WindowEventMap> = ['click', 'keydown', 'scroll', 'touchstart'];\nconst memoryRecords = new Map<string, string>();\n\ninterface SessionStorage {\n isLocalStorage: () => boolean;\n read: () => null | string;\n write: (record: SessionRecord) => void;\n}\n\nconst createSessionStorage = (storageKey: string): SessionStorage => {\n let localStorageAvailable = typeof window !== 'undefined';\n\n const read = () => {\n if (localStorageAvailable) {\n try {\n return window.localStorage.getItem(storageKey);\n } catch {\n localStorageAvailable = false;\n }\n }\n return memoryRecords.get(storageKey) ?? null;\n };\n\n const write = (record: SessionRecord) => {\n const serialized = JSON.stringify(record);\n memoryRecords.set(storageKey, serialized);\n if (!localStorageAvailable) return;\n try {\n window.localStorage.setItem(storageKey, serialized);\n } catch {\n localStorageAvailable = false;\n }\n };\n\n read();\n return { isLocalStorage: () => localStorageAvailable, read, write };\n};\n\nconst buildDefaultStorageKey = (endpoint: string, applicationName: string) => {\n let suffix = '';\n try {\n suffix = new URL(endpoint).host;\n } catch {\n suffix = endpoint;\n }\n return `bk_ot_session__${hashString(`${applicationName}\\0${suffix || 'default'}`)}`;\n};\n\nconst emitSessionEvent = (\n context: BkOTRuntimeContext,\n phase: 'end' | 'rotate' | 'start',\n sessionId: string,\n startedAt: number,\n timestamp: number,\n reason: string,\n previousId?: string,\n) => {\n const span = context.startSpan(\n 'browser.session',\n {\n ...context.config.hooks.getPageAttributes(),\n ...buildRumSpanAttributes({\n spanType: RUM_SPAN_TYPE.session,\n }),\n [RUM_ATTRIBUTES.sessionPhase]: phase,\n [RUM_ATTRIBUTES.sessionHasReplay]: false,\n [RUM_ATTRIBUTES.sessionId]: sessionId,\n [RUM_ATTRIBUTES.sessionStartTime]: startedAt,\n [RUM_ATTRIBUTES.sessionType]: 'user',\n 'session.lifecycle.reason': reason,\n ...(previousId ? { 'session.previous_id': previousId } : {}),\n },\n {\n contextTime: timestamp,\n startTime: timestamp,\n },\n );\n span.end(timestamp);\n};\n\nexport const createSessionPlugin = (options: BkOTSessionConfig = {}): BkOTPlugin => {\n const teardownCallbacks: Array<() => void> = [];\n\n return {\n name: 'session',\n init(context) {\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n const now = Date.now();\n const sessionId = createRandomId('session');\n context.setRuntimeAttributes(\n {\n [RUM_ATTRIBUTES.sessionHasReplay]: false,\n [RUM_ATTRIBUTES.sessionId]: sessionId,\n [RUM_ATTRIBUTES.sessionStartTime]: now,\n [RUM_ATTRIBUTES.sessionType]: 'user',\n },\n now,\n );\n return;\n }\n\n const storageKey =\n options.storageKey ??\n buildDefaultStorageKey(context.config.transport.endpoint, context.config.application.name);\n const storage = createSessionStorage(storageKey);\n const documentStartedAt =\n typeof performance !== 'undefined' && Number.isFinite(performance.timeOrigin)\n ? performance.timeOrigin\n : Date.now();\n let currentSessionId: string | undefined;\n let currentSessionStartedAt: number | undefined;\n let expirationTimeout: ReturnType<typeof setTimeout> | undefined;\n\n const readRecord = (now = Date.now()) => parseSessionRecord(storage.read(), now, SESSION_MAX_DURATION_MS);\n\n const clearExpirationTimeout = () => {\n if (expirationTimeout !== undefined) {\n clearTimeout(expirationTimeout);\n expirationTimeout = undefined;\n }\n };\n\n const deactivate = (reason: 'external' | SessionExpireReason, expiredAt = Date.now()) => {\n const expiredSessionId = currentSessionId;\n if (!expiredSessionId) return;\n context.notifySessionLifecycle({\n expiredAt,\n id: expiredSessionId,\n reason,\n type: 'expired',\n });\n emitSessionEvent(context, 'end', expiredSessionId, currentSessionStartedAt ?? expiredAt, expiredAt, reason);\n clearExpirationTimeout();\n currentSessionId = undefined;\n currentSessionStartedAt = undefined;\n context.setRuntimeAttributes(\n {\n [RUM_ATTRIBUTES.sessionHasReplay]: undefined,\n [RUM_ATTRIBUTES.sessionId]: undefined,\n [RUM_ATTRIBUTES.sessionStartTime]: undefined,\n [RUM_ATTRIBUTES.sessionType]: undefined,\n },\n expiredAt,\n );\n void context.flush();\n };\n\n const expireCurrentSession = () => {\n const now = Date.now();\n const record = readRecord(now);\n if (!record) {\n deactivate('external', now);\n return;\n }\n if (record.status === 'expired') {\n deactivate(record.reason, record.expiredAt);\n return;\n }\n if (record.id !== currentSessionId) {\n deactivate('external', now);\n return;\n }\n const reason = getSessionExpireReason(record, now, SESSION_MAX_DURATION_MS);\n if (!reason) {\n scheduleExpiration(record);\n return;\n }\n const expired: ExpiredSessionRecord = {\n expiredAt: now,\n previousId: record.id,\n reason,\n status: 'expired',\n };\n storage.write(expired);\n deactivate(reason, now);\n };\n\n const scheduleExpiration = (record: ActiveSessionRecord) => {\n clearExpirationTimeout();\n const expiresAt = Math.min(record.expiresAt, record.startedAt + SESSION_MAX_DURATION_MS);\n expirationTimeout = setTimeout(expireCurrentSession, Math.max(0, expiresAt - Date.now()));\n };\n\n const activate = (\n record: ActiveSessionRecord,\n lifecycle?: {\n previousId?: string;\n reason: 'inactivity' | 'init' | 'maxLifetime' | 'shared';\n },\n ) => {\n const changed = record.id !== currentSessionId;\n currentSessionId = record.id;\n currentSessionStartedAt = record.startedAt;\n context.setRuntimeAttributes(\n {\n [RUM_ATTRIBUTES.sessionHasReplay]: false,\n [RUM_ATTRIBUTES.sessionId]: record.id,\n [RUM_ATTRIBUTES.sessionStartTime]: record.startedAt,\n [RUM_ATTRIBUTES.sessionType]: 'user',\n },\n Math.min(record.startedAt, documentStartedAt),\n );\n scheduleExpiration(record);\n if (changed && lifecycle) {\n context.notifySessionLifecycle({\n id: record.id,\n previousId: lifecycle.previousId,\n reason: lifecycle.reason,\n startedAt: record.startedAt,\n type: 'renewed',\n });\n }\n };\n\n const expandOrRenew = (isInitialization = false) => {\n const now = Date.now();\n const record = readRecord(now);\n if (record?.status === 'active' && !getSessionExpireReason(record, now, SESSION_MAX_DURATION_MS)) {\n const expanded = expandActiveSession(record, now, SESSION_IDLE_TIMEOUT_MS, SESSION_MAX_DURATION_MS);\n storage.write(expanded);\n activate(expanded, currentSessionId ? undefined : { reason: 'shared' });\n return;\n }\n\n const previousId = record?.status === 'expired' ? record.previousId : record?.id;\n const reason =\n record?.status === 'expired'\n ? record.reason\n : record\n ? getSessionExpireReason(record, now, SESSION_MAX_DURATION_MS)\n : isInitialization\n ? 'init'\n : undefined;\n const created = createActiveSessionRecord(\n createRandomId('session'),\n now,\n SESSION_IDLE_TIMEOUT_MS,\n SESSION_MAX_DURATION_MS,\n );\n storage.write(created);\n activate(created, {\n previousId,\n reason: reason ?? 'init',\n });\n const lifecycleReason = reason ?? 'init';\n emitSessionEvent(\n context,\n lifecycleReason === 'init' ? 'start' : 'rotate',\n created.id,\n created.startedAt,\n created.startedAt,\n lifecycleReason,\n previousId,\n );\n };\n\n const expandOnly = () => {\n if (!currentSessionId) return;\n const now = Date.now();\n const record = readRecord(now);\n if (\n record?.status !== 'active' ||\n record.id !== currentSessionId ||\n getSessionExpireReason(record, now, SESSION_MAX_DURATION_MS)\n ) {\n expireCurrentSession();\n return;\n }\n const expanded = expandActiveSession(record, now, SESSION_IDLE_TIMEOUT_MS, SESSION_MAX_DURATION_MS);\n storage.write(expanded);\n activate(expanded);\n };\n\n expandOrRenew(true);\n\n let lastActivityAt = 0;\n const onActivity = () => {\n const now = Date.now();\n if (now - lastActivityAt < ACTIVITY_THROTTLE_MS) return;\n lastActivityAt = now;\n expandOrRenew();\n };\n const activityListenerOptions: AddEventListenerOptions = { capture: true, passive: true };\n ACTIVITY_EVENTS.forEach(eventName => window.addEventListener(eventName, onActivity, activityListenerOptions));\n teardownCallbacks.push(() => {\n ACTIVITY_EVENTS.forEach(eventName =>\n window.removeEventListener(eventName, onActivity, activityListenerOptions),\n );\n });\n\n const expandWhenVisible = () => {\n if (document.visibilityState === 'visible') expandOnly();\n };\n document.addEventListener('visibilitychange', expandWhenVisible);\n const visibilityInterval = window.setInterval(expandWhenVisible, VISIBILITY_CHECK_MS);\n teardownCallbacks.push(() => {\n document.removeEventListener('visibilitychange', expandWhenVisible);\n window.clearInterval(visibilityInterval);\n });\n\n const onStorage = (event: StorageEvent) => {\n if (!storage.isLocalStorage() || event.storageArea !== window.localStorage || event.key !== storageKey) return;\n const now = Date.now();\n const record = parseSessionRecord(event.newValue, now, SESSION_MAX_DURATION_MS);\n if (\n record?.status === 'active' &&\n record.id === currentSessionId &&\n !getSessionExpireReason(record, now, SESSION_MAX_DURATION_MS)\n ) {\n scheduleExpiration(record);\n return;\n }\n // 当前 tab 一旦失效,不被其他 tab 新建的 session 被动复活;本 tab 发生交互后再接管共享 session。\n deactivate(\n record?.status === 'expired' ? record.reason : 'external',\n record?.status === 'expired' ? record.expiredAt : now,\n );\n };\n window.addEventListener('storage', onStorage);\n teardownCallbacks.push(() => window.removeEventListener('storage', onStorage));\n teardownCallbacks.push(clearExpirationTimeout);\n },\n shutdown() {\n while (teardownCallbacks.length) teardownCallbacks.pop()?.();\n },\n };\n};\n","class t{t;o=0;i=[];u(t){if(t.hadRecentInput)return;const e=this.i[0],n=this.i.at(-1);this.o&&e&&n&&t.startTime-n.startTime<1e3&&t.startTime-e.startTime<5e3?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),this.t?.(t)}}const e=()=>{const t=performance.getEntriesByType(\"navigation\")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},n=t=>{if(\"loading\"===document.readyState)return\"loading\";const n=e();if(n){if(t<n.domInteractive)return\"loading\";if(0===n.domContentLoadedEventStart||t<n.domContentLoadedEventStart)return\"dom-interactive\";if(0===n.domComplete||t<n.domComplete)return\"dom-content-loaded\"}return\"complete\"},o=t=>{const e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,\"\")},i=t=>{let e=\"\";try{for(;9!==t?.nodeType;){const n=t,i=n.id?\"#\"+n.id:[o(n),...Array.from(n.classList).sort()].join(\".\");if(e.length+i.length>99)return e||i;if(e=e?i+\">\"+e:i,n.id)break;t=n.parentNode}}catch{}return e},r=new WeakMap;function s(t,e){return r.get(t)||r.set(t,new e),r.get(t)}let a=-1;const c=()=>a,u=t=>{addEventListener(\"pageshow\",e=>{e.persisted&&(a=e.timeStamp,t(e))},!0)},f=(t,e,n,o)=>{let i,r;return s=>{e.value>=0&&(s||o)&&(r=e.value-(i??0),(r||void 0===i)&&(i=e.value,e.delta=r,e.rating=((t,e)=>t>e[1]?\"poor\":t>e[0]?\"needs-improvement\":\"good\")(e.value,n),t(e)))}},d=t=>{requestAnimationFrame(()=>requestAnimationFrame(t))},l=()=>e()?.activationStart??0,h=(t,n=-1)=>{const o=e();let i=\"navigate\";c()>=0?i=\"back-forward-cache\":o&&(document.prerendering||l()>0?i=\"prerender\":document.wasDiscarded?i=\"restore\":o.type&&(i=o.type.replace(/_/g,\"-\")));return{name:t,value:n,rating:\"good\",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:i}},m=(t,e,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const o=new PerformanceObserver(t=>{queueMicrotask(()=>{e(t.getEntries())})});return o.observe({type:t,buffered:!0,...n}),o}}catch{}},g=t=>{let e=!1;return()=>{e||(t(),e=!0)}};let p=-1;const y=new Set,v=()=>\"hidden\"!==document.visibilityState||document.prerendering?1/0:0,b=t=>{if(\"hidden\"===document.visibilityState){if(\"visibilitychange\"===t.type)for(const t of y)t();isFinite(p)||(p=\"visibilitychange\"===t.type?t.timeStamp:0,removeEventListener(\"prerenderingchange\",b,!0))}},M=()=>{if(p<0){const t=l(),e=document.prerendering?void 0:globalThis.performance.getEntriesByType(\"visibility-state\").find(e=>\"hidden\"===e.name&&e.startTime>=t)?.startTime;p=e??v(),addEventListener(\"visibilitychange\",b,!0),addEventListener(\"prerenderingchange\",b,!0),u(()=>{setTimeout(()=>{p=v()})})}return{get firstHiddenTime(){return p},onHidden(t){y.add(t)}}},T=t=>{document.prerendering?addEventListener(\"prerenderingchange\",t,!0):t()},E=[1800,3e3],D=(t,e={})=>{T(()=>{const n=M();let o,i=h(\"FCP\");const r=m(\"paint\",t=>{for(const e of t)\"first-contentful-paint\"===e.name&&(r.disconnect(),e.startTime<n.firstHiddenTime&&(i.value=Math.max(e.startTime-l(),0),i.entries.push(e),o(!0)))});r&&(o=f(t,i,E,e.reportAllChanges),u(n=>{i=h(\"FCP\"),o=f(t,i,E,e.reportAllChanges),d(()=>{i.value=performance.now()-n.timeStamp,o(!0)})}))})},L=[.1,.25],S=t=>t.find(t=>1===t.node?.nodeType)||t[0],P=(e,o={})=>{const r=s(o=Object.assign({},o),t),a=new WeakMap;r.t=t=>{if(t?.sources?.length){const e=S(t.sources),n=e?.node;if(n){const t=o.generateTarget?.(n)??i(n);a.set(e,t)}}};((e,n={})=>{const o=M();D(g(()=>{let i,r=h(\"CLS\",0);const a=s(n,t),c=t=>{for(const e of t)a.u(e);a.o>r.value&&(r.value=a.o,r.entries=a.i,i())},l=m(\"layout-shift\",c);l&&(i=f(e,r,L,n.reportAllChanges),o.onHidden(()=>{c(l.takeRecords()),i(!0)}),u(()=>{a.o=0,r=h(\"CLS\",0),i=f(e,r,L,n.reportAllChanges),d(i)}),setTimeout(i))}))})(t=>{e((t=>{let e={};if(t.entries.length){const o=t.entries.reduce((t,e)=>t.value>e.value?t:e);if(o?.sources?.length){const t=S(o.sources);t&&(e={largestShiftTarget:a.get(t),largestShiftTime:o.startTime,largestShiftValue:o.value,largestShiftSource:t,largestShiftEntry:o,loadState:n(o.startTime)})}}return Object.assign(t,{attribution:e})})(t))},o)},w=(t,o={})=>{D(o=>{t((t=>{let o={timeToFirstByte:0,firstByteToFCP:t.value,loadState:n(c())};if(t.entries.length){const i=e(),r=t.entries.at(-1);if(i){const e=i.activationStart||0,s=Math.max(0,i.responseStart-e);o={timeToFirstByte:s,firstByteToFCP:t.value-s,loadState:n(t.entries[0].startTime),navigationEntry:i,fcpEntry:r}}}return Object.assign(t,{attribution:o})})(o))},o)};let _=0,k=1/0,F=0;const B=t=>{for(const e of t)e.interactionId&&(k=Math.min(k,e.interactionId),F=Math.max(F,e.interactionId),_=F?(F-k)/7+1:0)};let C;const O=()=>C?_:performance.interactionCount??0,j=()=>{\"interactionCount\"in performance||C||(C=m(\"event\",B,{durationThreshold:0}))};let I=0;class A{l=[];h=new Map;m;p;v(){I=O(),this.l.length=0,this.h.clear()}M(){const t=Math.min(this.l.length-1,Math.floor((O()-I)/50));return this.l[t]}u(t){if(this.m?.(t),!t.interactionId&&\"first-input\"!==t.entryType)return;const e=this.l.at(-1);let n=this.h.get(t.interactionId);if(n||this.l.length<10||t.duration>e.T){if(n?t.duration>n.T?(n.entries=[t],n.T=t.duration):t.duration===n.T&&t.startTime===n.entries[0].startTime&&n.entries.push(t):(n={id:t.interactionId,entries:[t],T:t.duration},this.h.set(n.id,n),this.l.push(n)),this.l.sort((t,e)=>e.T-t.T),this.l.length>10){const t=this.l.splice(10);for(const e of t)this.h.delete(e.id)}this.p?.(n)}}}const q=t=>{const e=globalThis.requestIdleCallback||setTimeout,n=globalThis.cancelIdleCallback||clearTimeout;if(\"hidden\"===document.visibilityState)t();else{const o=g(t);let i=-1;const r=()=>{n(i),o()};addEventListener(\"visibilitychange\",r,{once:!0,capture:!0}),i=e(()=>{removeEventListener(\"visibilitychange\",r,{capture:!0}),o()})}},W=[200,500],x=(t,e={})=>{const o=s(e=Object.assign({},e),A);let r=[],a=[],c=0;const d=new WeakMap,l=new WeakMap;let g=!1;const p=()=>{g||(q(y),g=!0)},y=()=>{const t=new Set(o.l.map(t=>d.get(t.entries[0]))),e=a.length-10;a=a.filter((n,o)=>o>=e||t.has(n));const n=new Set;for(const t of a){const e=v(t.startTime,t.processingEnd);for(const t of e)n.add(t)}r=r.filter(t=>t.startTime>c||n.has(t)),g=!1};o.m=t=>{const n=t.startTime+t.duration;let o;c=Math.max(c,t.processingEnd);for(let i=a.length-1;i>=0;i--){const r=a[i];if(Math.abs(n-r.renderTime)<=8){o=r,o.startTime=Math.min(t.startTime,o.startTime),o.processingStart=Math.min(t.processingStart,o.processingStart),o.processingEnd=Math.max(t.processingEnd,o.processingEnd),!1!==e.includeProcessedEventEntries&&o.entries.push(t);break}}o||(o={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:n,entries:!1!==e.includeProcessedEventEntries?[t]:[]},a.push(o)),(t.interactionId||\"first-input\"===t.entryType)&&d.set(t,o),p()},o.p=t=>{if(!l.get(t)){const n=t.entries[0].target;if(n){const o=e.generateTarget?.(n)??i(n);l.set(t,o)}}};const v=(t,e)=>{const n=[];for(const o of r)if(!(o.startTime+o.duration<t)){if(o.startTime>e)break;n.push(o)}return n},b=t=>{const e=t.entries[0],i=d.get(e),r=e.processingStart,s=Math.max(e.startTime+e.duration,r),a=Math.min(i.processingEnd,s),c=i.entries.sort((t,e)=>t.processingStart-e.processingStart),u=v(e.startTime,a),f=o.h.get(e.interactionId),h={interactionTarget:l.get(f),interactionType:e.name.startsWith(\"key\")?\"keyboard\":\"pointer\",interactionTime:e.startTime,nextPaintTime:s,processedEventEntries:c,longAnimationFrameEntries:u,inputDelay:r-e.startTime,processingDuration:a-r,presentationDelay:s-a,loadState:n(e.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(t=>{if(!t.longAnimationFrameEntries?.length)return;const e=t.interactionTime,n=t.inputDelay,o=t.processingDuration;let i,r,s=0,a=0,c=0,u=0;for(const c of t.longAnimationFrameEntries){a=a+c.startTime+c.duration-c.styleAndLayoutStart;for(const t of c.scripts){const c=t.startTime+t.duration;if(c<e)continue;const f=c-Math.max(e,t.startTime),d=t.duration?f/t.duration*t.forcedStyleAndLayoutDuration:0;s+=f-d,a+=d,f>u&&(r=t.startTime<e+n?\"input-delay\":t.startTime>=e+n+o?\"presentation-delay\":\"processing-duration\",i=t,u=f)}}const f=t.longAnimationFrameEntries.at(-1),d=f?f.startTime+f.duration:0;d>=e+n+o&&(c=t.nextPaintTime-d),i&&r&&(t.longestScript={entry:i,subpart:r,intersectingDuration:u}),t.totalScriptDuration=s,t.totalStyleAndLayoutDuration=a,t.totalPaintDuration=c,t.totalUnattributedDuration=t.nextPaintTime-e-s-a-c})(h),Object.assign(t,{attribution:h})};m(\"long-animation-frame\",t=>{r=r.concat(t),p()}),((t,e={})=>{if(!globalThis.PerformanceEventTiming||!(\"interactionId\"in PerformanceEventTiming.prototype))return;const n=M();T(()=>{j();let o,i=h(\"INP\");const r=s(e,A),a=t=>{q(()=>{for(const e of t)r.u(e);const e=r.M();e&&e.T!==i.value&&(i.value=e.T,i.entries=e.entries,o())})},c=m(\"event\",a,{durationThreshold:e.durationThreshold??40});o=f(t,i,W,e.reportAllChanges),c&&(c.observe({type:\"first-input\",buffered:!0}),n.onHidden(()=>{a(c.takeRecords()),o(!0)}),u(()=>{r.v(),i=h(\"INP\"),o=f(t,i,W,e.reportAllChanges)}))})})(e=>{t(b(e))},e)};class N{m;u(t){this.m?.(t)}}const $=[2500,4e3],H=(t,n={})=>{const o=s(n=Object.assign({},n),N),r=new WeakMap;o.m=t=>{const e=t.element;if(e){const o=n.generateTarget?.(e)??i(e);r.set(t,o)}else t.id&&r.set(t,`#${t.id}`)};((t,e={})=>{T(()=>{const n=M();let o,i=h(\"LCP\");const r=s(e,N),a=t=>{e.reportAllChanges||(t=t.slice(-1));for(const e of t)r.u(e),e.startTime<n.firstHiddenTime&&(i.value=Math.max(e.startTime-l(),0),i.entries=[e],o())},c=m(\"largest-contentful-paint\",a);if(c){o=f(t,i,$,e.reportAllChanges);const n=g(()=>{a(c.takeRecords()),c.disconnect(),o(!0)}),r=t=>{t.isTrusted&&(q(n),removeEventListener(t.type,r,{capture:!0}))};for(const t of[\"keydown\",\"click\",\"visibilitychange\"])addEventListener(t,r,{capture:!0});u(n=>{i=h(\"LCP\"),o=f(t,i,$,e.reportAllChanges),d(()=>{i.value=performance.now()-n.timeStamp,o(!0)})})}})})(n=>{t((t=>{let n={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){const o=t.entries.at(-1),i=o.url&&performance.getEntriesByType(\"resource\").find(t=>t.name===o.url);n.target=r.get(o),n.lcpEntry=o,o.url&&(n.url=o.url),i&&(n.lcpResourceEntry=i);const s=e();if(s){const e=s.activationStart||0,o=Math.max(0,s.responseStart-e),r=Math.max(o,i?(i.requestStart||i.startTime)-e:0),a=Math.min(t.value,Math.max(r,i?i.responseEnd-e:0));n={...n,timeToFirstByte:o,resourceLoadDelay:r-o,resourceLoadDuration:a-r,elementRenderDelay:t.value-a,navigationEntry:s}}}return Object.assign(t,{attribution:n})})(n))},n)},R=[800,1800],U=t=>{document.prerendering?T(()=>U(t)):\"complete\"!==document.readyState?addEventListener(\"load\",()=>U(t),!0):setTimeout(t)},V=(t,n={})=>{((t,n={})=>{let o=h(\"TTFB\"),i=f(t,o,R,n.reportAllChanges);U(()=>{const r=e();r&&(o.value=Math.max(r.responseStart-l(),0),o.entries=[r],i(!0),u(()=>{o=h(\"TTFB\",0),i=f(t,o,R,n.reportAllChanges),i(!0)}))})})(e=>{t((t=>{let e={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(t.entries.length){const n=t.entries[0],o=n.activationStart||0,i=Math.max((n.workerStart||n.fetchStart)-o,0),r=Math.max(n.domainLookupStart-o,0),s=Math.max(n.connectStart-o,0),a=Math.max(n.connectEnd-o,0);e={waitingDuration:i,cacheDuration:r-i,dnsDuration:s-r,connectionDuration:a-s,requestDuration:t.value-a,navigationEntry:n}}return Object.assign(t,{attribution:e})})(e))},n)};export{L as CLSThresholds,E as FCPThresholds,W as INPThresholds,$ as LCPThresholds,R as TTFBThresholds,P as onCLS,w as onFCP,x as onINP,H as onLCP,V as onTTFB};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/**\n * Web Vitals 插件\n *\n * 基于 google/web-vitals 库(attribution 版本)采集 Core Web Vitals:\n * CLS / FCP / INP / LCP / TTFB\n *\n * browser.web_vital span 带 vital.id(唯一)、vital.value 与 attribution 详情\n * (LCP 元素 url / CLS shift target / INP interaction target 等高基数字段),\n * 方便按个例排查\"哪个元素拖累了 LCP\"\n *\n * 数值语义:CLS 是无量纲分数,FCP/INP/LCP/TTFB 的 vital.value 单位为 ms。\n *\n * View 边界:FCP/LCP/TTFB 使用 web-vitals 的条目时间回查历史 View;CLS/INP 按 SDK View 重置,\n * CLS 使用 session window,INP 使用当前 View 的 p98 交互候选。\n *\n * 生命周期保护:\n * - disposed 标志位:shutdown 后所有回调入口 early return,避免向已销毁的 provider 上报\n * - dynamic import 完成后再次检查 disposed:处理\"start() 完成前 shutdown()\"的 race\n * - dynamic import 自身 try/catch:与 PluginManager 的 per-plugin 隔离形成纵深防御,\n * 即使加载失败也不影响整体启动\n */\n\nimport { type Attributes } from '@opentelemetry/api';\n\nimport { createRandomId } from '../core/id';\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\nimport { buildRumSpanAttributes, getVitalOutcome, RUM_SPAN_TYPE } from '../schema/span';\n\nimport type { BkOTPlugin } from '../core/plugin';\nimport type * as WebVitalsAttribution from 'web-vitals/attribution';\nimport type { MetricWithAttribution } from 'web-vitals/attribution';\n\ninterface EventTimingEntry extends PerformanceEntry {\n interactionId?: number;\n processingEnd?: number;\n processingStart?: number;\n target?: EventTarget | null;\n}\n\ninterface InpCandidate {\n duration: number;\n inputDelay: number;\n interactionId: number;\n interactionTarget?: string;\n interactionType: string;\n presentationDelay: number;\n processingDuration: number;\n}\n\ninterface LayoutShiftEntry extends PerformanceEntry {\n hadRecentInput?: boolean;\n sources?: Array<{ node?: Node | null }>;\n value?: number;\n}\n\ninterface ViewVitalState {\n cls: number;\n clsWindowEnd?: number;\n clsWindowLargestShiftTarget?: string;\n clsWindowLargestShiftValue: number;\n clsWindowStart?: number;\n clsWindowValue: number;\n id: string;\n inpCandidates: InpCandidate[];\n interactionCountAtStart?: number;\n interactionIdMax: number;\n interactionIdMin: number;\n largestShiftTarget?: string;\n largestShiftValue: number;\n runtimeAttributes: Attributes;\n startedAt: number;\n}\n\ntype VitalLike = Pick<MetricWithAttribution, 'attribution' | 'entries' | 'id' | 'name' | 'rating' | 'value'>;\n\nconst MAX_INP_CANDIDATES = 10;\nconst MAX_INP_VALUE = 60_000;\nconst MAX_CLS_WINDOW_DURATION = 5_000;\nconst MAX_CLS_UPDATE_GAP = 1_000;\n\nexport const isSameViewId = (currentViewId: string | undefined, nextViewId: string | undefined) =>\n Boolean(nextViewId) && currentViewId === nextViewId;\n\nconst getRating = (name: 'CLS' | 'INP', value: number): VitalLike['rating'] => {\n const [good, poor] = name === 'CLS' ? [0.1, 0.25] : [200, 500];\n return value <= good ? 'good' : value <= poor ? 'needs-improvement' : 'poor';\n};\n\nconst getTargetName = (target: EventTarget | Node | null | undefined) => {\n if (typeof Element === 'undefined' || !(target instanceof Element)) return undefined;\n return (\n target.getAttribute('data-bk-action-name') ??\n target.getAttribute('aria-label') ??\n target.getAttribute('name') ??\n target.tagName.toLowerCase()\n );\n};\n\nconst getInteractionCount = () => {\n if (typeof performance === 'undefined') return undefined;\n const value = (performance as Performance & { interactionCount?: number }).interactionCount;\n return typeof value === 'number' && Number.isFinite(value) ? value : undefined;\n};\n\nexport const updateViewCls = (view: ViewVitalState, entry: LayoutShiftEntry) => {\n const value = entry.value ?? 0;\n if (entry.hadRecentInput || !Number.isFinite(value)) return;\n const shouldCreateWindow =\n view.clsWindowStart === undefined ||\n entry.startTime - (view.clsWindowEnd ?? entry.startTime) >= MAX_CLS_UPDATE_GAP ||\n entry.startTime - view.clsWindowStart >= MAX_CLS_WINDOW_DURATION;\n if (shouldCreateWindow) {\n view.clsWindowStart = entry.startTime;\n view.clsWindowValue = value;\n view.clsWindowLargestShiftValue = value;\n view.clsWindowLargestShiftTarget = getTargetName(entry.sources?.[0]?.node);\n } else {\n view.clsWindowValue += value;\n if (value > view.clsWindowLargestShiftValue) {\n view.clsWindowLargestShiftValue = value;\n view.clsWindowLargestShiftTarget = getTargetName(entry.sources?.[0]?.node);\n }\n }\n view.clsWindowEnd = entry.startTime;\n if (view.clsWindowValue > view.cls) {\n view.cls = Math.round(view.clsWindowValue * 10_000) / 10_000;\n view.largestShiftValue = view.clsWindowLargestShiftValue;\n view.largestShiftTarget = view.clsWindowLargestShiftTarget;\n }\n};\n\nexport const updateViewInp = (view: ViewVitalState, entry: EventTimingEntry) => {\n if (!entry.interactionId || !Number.isFinite(entry.duration)) return;\n view.interactionIdMin = Math.min(view.interactionIdMin, entry.interactionId);\n view.interactionIdMax = Math.max(view.interactionIdMax, entry.interactionId);\n const processingStart = entry.processingStart ?? entry.startTime;\n const processingEnd = entry.processingEnd ?? processingStart;\n const candidate: InpCandidate = {\n duration: Math.min(entry.duration, MAX_INP_VALUE),\n inputDelay: Math.max(0, processingStart - entry.startTime),\n interactionId: entry.interactionId,\n interactionTarget: getTargetName(entry.target),\n interactionType: entry.name,\n presentationDelay: Math.max(0, entry.startTime + entry.duration - processingEnd),\n processingDuration: Math.max(0, processingEnd - processingStart),\n };\n const index = view.inpCandidates.findIndex(item => item.interactionId === entry.interactionId);\n if (index >= 0) {\n if (candidate.duration > view.inpCandidates[index].duration) view.inpCandidates[index] = candidate;\n } else {\n view.inpCandidates.push(candidate);\n }\n view.inpCandidates.sort((left, right) => right.duration - left.duration).splice(MAX_INP_CANDIDATES);\n};\n\nexport const getViewInp = (view: ViewVitalState): InpCandidate | undefined => {\n const nativeCount = getInteractionCount();\n const interactionCount =\n nativeCount !== undefined && view.interactionCountAtStart !== undefined\n ? Math.max(0, nativeCount - view.interactionCountAtStart)\n : view.interactionIdMin === Infinity\n ? 0\n : (view.interactionIdMax - view.interactionIdMin) / 7 + 1;\n if (!view.inpCandidates.length) return undefined;\n return view.inpCandidates[Math.min(view.inpCandidates.length - 1, Math.floor(interactionCount / 50))];\n};\n\n// 把 attribution 中价值最高的字段抽出来写入 Span。\nconst pickAttribution = (metric: VitalLike, redactUrl: (url: string) => string): Attributes => {\n const attr = metric.attribution ?? {};\n const result: Attributes = {};\n const getAttrValue = (key: string) => (attr as Record<string, unknown>)[key];\n\n const setIfDefined = (key: string, value: unknown, transform?: (value: string) => string) => {\n if (value === undefined || value === null) return;\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n result[key] = typeof value === 'string' && transform ? transform(value) : value;\n }\n };\n\n switch (metric.name) {\n case 'LCP':\n setIfDefined('vital.lcp.url', getAttrValue('url'), redactUrl);\n setIfDefined('vital.lcp.target', getAttrValue('target'));\n setIfDefined('vital.lcp.element_render_delay', getAttrValue('elementRenderDelay'));\n setIfDefined('vital.lcp.resource_load_duration', getAttrValue('resourceLoadDuration'));\n setIfDefined('vital.lcp.time_to_first_byte', getAttrValue('timeToFirstByte'));\n break;\n case 'CLS':\n setIfDefined('vital.cls.largest_shift_target', getAttrValue('largestShiftTarget'));\n setIfDefined('vital.cls.largest_shift_value', getAttrValue('largestShiftValue'));\n setIfDefined('vital.cls.load_state', getAttrValue('loadState'));\n break;\n case 'INP':\n setIfDefined('vital.inp.interaction_target', getAttrValue('interactionTarget'));\n setIfDefined('vital.inp.interaction_type', getAttrValue('interactionType'));\n setIfDefined('vital.inp.input_delay', getAttrValue('inputDelay'));\n setIfDefined('vital.inp.processing_duration', getAttrValue('processingDuration'));\n setIfDefined('vital.inp.presentation_delay', getAttrValue('presentationDelay'));\n break;\n case 'FCP':\n setIfDefined('vital.fcp.time_to_first_byte', getAttrValue('timeToFirstByte'));\n setIfDefined('vital.fcp.load_state', getAttrValue('loadState'));\n break;\n case 'TTFB':\n setIfDefined('vital.ttfb.waiting_duration', getAttrValue('waitingDuration'));\n setIfDefined('vital.ttfb.dns_duration', getAttrValue('dnsDuration'));\n setIfDefined('vital.ttfb.connection_duration', getAttrValue('connectionDuration'));\n setIfDefined('vital.ttfb.request_duration', getAttrValue('requestDuration'));\n break;\n default:\n break;\n }\n return result;\n};\n\nexport const createWebVitalsPlugin = (): BkOTPlugin => {\n let cleanup: (() => void) | undefined;\n let disposed = false;\n\n return {\n name: 'web-vitals',\n async init(context) {\n if (typeof window === 'undefined') {\n return;\n }\n\n // dynamic import 自包 try/catch:与 PluginManager 的 per-plugin 隔离形成纵深防御,\n // 离线 / chunk 加载失败时不影响其他插件,且 debug 模式留下排查痕迹\n let webVitalsModule: typeof WebVitalsAttribution;\n try {\n webVitalsModule = await import('web-vitals/attribution');\n } catch (error) {\n if (context.config.debug) {\n globalThis.console?.warn('[bk-ot] web-vitals load failed:', error);\n }\n return;\n }\n // import 期间用户可能已经 shutdown:此后再注册回调会向已销毁 provider 上报\n if (disposed) return;\n\n const { onFCP, onLCP, onTTFB } = webVitalsModule;\n const recordSpan = (\n metric: VitalLike,\n runtimeAttributes: Attributes,\n contextTime?: number,\n occurredAt = contextTime ?? Date.now(),\n ) => {\n if (!context.isSampled()) return;\n const metricName = metric.name.toLowerCase();\n const span = context.startSpan(\n 'browser.web_vital',\n {\n ...context.config.hooks.getPageAttributes(),\n ...runtimeAttributes,\n ...buildRumSpanAttributes({\n outcome: getVitalOutcome(metric.rating),\n spanType: RUM_SPAN_TYPE.vital,\n }),\n [RUM_ATTRIBUTES.vitalMetric]: metricName,\n [RUM_ATTRIBUTES.vitalValue]: metric.value,\n [RUM_ATTRIBUTES.vitalRating]: metric.rating,\n 'vital.id': metric.id,\n ...pickAttribution(metric, context.config.hooks.redactUrl),\n },\n { contextTime, startTime: occurredAt },\n );\n span.end(occurredAt);\n };\n\n const recordDurationVital = (metric: VitalLike) => {\n // 防御非法值:极端浏览器实现 bug 可能给出 NaN/Infinity,OT 后端会拒收\n if (disposed || !Number.isFinite(metric.value) || !context.isSampled()) return;\n const firstEntry = metric.entries[0];\n const contextTime =\n firstEntry && typeof performance !== 'undefined' ? performance.timeOrigin + firstEntry.startTime : undefined;\n const runtimeAttributes =\n contextTime === undefined ? context.getRuntimeAttributes() : context.getRuntimeAttributesAt(contextTime);\n recordSpan(metric, runtimeAttributes, contextTime);\n };\n\n let currentView: undefined | ViewVitalState;\n let eventObserver: PerformanceObserver | undefined;\n let layoutShiftObserver: PerformanceObserver | undefined;\n\n const recordViewVital = (metric: VitalLike, runtimeAttributes: Attributes, contextTime: number) => {\n recordSpan(metric, runtimeAttributes, contextTime, Date.now());\n };\n\n const finalizeView = () => {\n const view = currentView;\n if (!view || !context.isSampled()) return;\n recordViewVital(\n {\n attribution: {\n largestShiftTarget: view.largestShiftTarget,\n largestShiftValue: view.largestShiftValue,\n },\n entries: [],\n id: createRandomId('vital'),\n name: 'CLS',\n rating: getRating('CLS', view.cls),\n value: view.cls,\n } as VitalLike,\n view.runtimeAttributes,\n view.startedAt,\n );\n const inp = getViewInp(view);\n if (inp) {\n recordViewVital(\n {\n attribution: {\n inputDelay: inp.inputDelay,\n interactionTarget: inp.interactionTarget,\n interactionType: inp.interactionType,\n presentationDelay: inp.presentationDelay,\n processingDuration: inp.processingDuration,\n },\n entries: [],\n id: createRandomId('vital'),\n name: 'INP',\n rating: getRating('INP', inp.duration),\n value: inp.duration,\n } as VitalLike,\n view.runtimeAttributes,\n view.startedAt,\n );\n }\n };\n\n const unsubscribeView = context.onViewChange(view => {\n const activeVitalView = currentView;\n if (activeVitalView && isSameViewId(activeVitalView.id, view.id)) {\n activeVitalView.runtimeAttributes = {\n ...activeVitalView.runtimeAttributes,\n [RUM_ATTRIBUTES.viewId]: view.id,\n ...(view.name ? { [RUM_ATTRIBUTES.viewName]: view.name } : {}),\n [RUM_ATTRIBUTES.viewUrl]: view.url,\n [RUM_ATTRIBUTES.viewUrlTemplate]: view.urlTemplate,\n };\n return;\n }\n finalizeView();\n currentView = view.id\n ? {\n cls: 0,\n clsWindowLargestShiftValue: 0,\n clsWindowValue: 0,\n interactionCountAtStart: getInteractionCount(),\n interactionIdMax: 0,\n interactionIdMin: Infinity,\n inpCandidates: [],\n id: view.id,\n largestShiftValue: 0,\n runtimeAttributes: context.getRuntimeAttributes(),\n startedAt: view.startedAt ?? Date.now(),\n }\n : undefined;\n });\n\n if (typeof PerformanceObserver !== 'undefined') {\n if (PerformanceObserver.supportedEntryTypes?.includes('layout-shift')) {\n layoutShiftObserver = new PerformanceObserver(list => {\n if (!currentView) return;\n for (const entry of list.getEntries() as LayoutShiftEntry[]) {\n const startedAt = performance.timeOrigin + entry.startTime;\n if (startedAt < currentView.startedAt) continue;\n updateViewCls(currentView, entry);\n }\n });\n layoutShiftObserver.observe({ buffered: true, type: 'layout-shift' });\n }\n if (PerformanceObserver.supportedEntryTypes?.includes('event')) {\n eventObserver = new PerformanceObserver(list => {\n if (!currentView) return;\n for (const entry of list.getEntries() as EventTimingEntry[]) {\n const startedAt = performance.timeOrigin + entry.startTime;\n if (startedAt < currentView.startedAt || !entry.interactionId || !Number.isFinite(entry.duration))\n continue;\n updateViewInp(currentView, entry);\n }\n });\n eventObserver.observe({ buffered: true, durationThreshold: 40, type: 'event' });\n }\n }\n onFCP(recordDurationVital);\n onLCP(recordDurationVital);\n onTTFB(recordDurationVital);\n\n cleanup = () => {\n finalizeView();\n currentView = undefined;\n unsubscribeView();\n layoutShiftObserver?.disconnect();\n eventObserver?.disconnect();\n };\n },\n shutdown() {\n // web-vitals 的 onXXX 不返回 unsubscribe,无法真正取消订阅;\n // 用 disposed 标志位让回调入口 early return 即可\n disposed = true;\n cleanup?.();\n cleanup = undefined;\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n */\n\nimport { SpanKind } from '@opentelemetry/api';\n\nimport { createRandomId } from '../core/id';\nimport { shouldIgnoreUrl } from '../core/url';\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\nimport { buildRumSpanAttributes, RUM_SPAN_OUTCOME, RUM_SPAN_TYPE } from '../schema/span';\n\nimport type { BkOTPlugin, BkOTRuntimeContext } from '../core/plugin';\nimport type { Attributes } from '@opentelemetry/api';\n\nconst buildWebSocketAttributes = (url: string, redactUrl: (url: string) => string): Attributes => {\n const attributes: Attributes = {\n 'network.protocol.name': 'websocket',\n 'url.full': redactUrl(url),\n };\n try {\n const parsed = new URL(url, typeof location === 'undefined' ? 'http://localhost' : location.href);\n attributes['server.address'] = parsed.hostname;\n if (parsed.port) attributes['server.port'] = Number(parsed.port);\n attributes['url.scheme'] = parsed.protocol.replace(':', '');\n } catch {\n // 非法 URL 仍保留脱敏后的原始字符串。\n }\n return attributes;\n};\n\nconst instrumentSocket = (socket: WebSocket, context: BkOTRuntimeContext, url: string, isDisposed: () => boolean) => {\n const connectionId = createRandomId('websocket');\n const baseAttributes = buildWebSocketAttributes(url, context.config.hooks.redactUrl);\n let opened = false;\n\n const emit = (phase: 'close' | 'connect' | 'error' | 'open', timestamp: number, attributes: Attributes = {}) => {\n if (isDisposed() || !context.isSampled()) return;\n const isError = phase === 'error';\n const span = context.startSpan(\n 'browser.websocket',\n {\n ...baseAttributes,\n ...buildRumSpanAttributes({\n outcome: isError ? RUM_SPAN_OUTCOME.error : RUM_SPAN_OUTCOME.success,\n outcomeReason: isError ? 'network' : undefined,\n spanType: RUM_SPAN_TYPE.websocket,\n }),\n [RUM_ATTRIBUTES.websocketPhase]: phase,\n 'websocket.connection.id': connectionId,\n ...attributes,\n },\n { kind: SpanKind.CLIENT, startTime: timestamp },\n );\n span.end(timestamp);\n };\n\n emit('connect', Date.now());\n socket.addEventListener('open', () => {\n opened = true;\n emit('open', Date.now());\n });\n socket.addEventListener('error', () => {\n emit('error', Date.now(), { 'websocket.error.phase': opened ? 'runtime' : 'connect' });\n });\n socket.addEventListener('close', event => {\n emit('close', Date.now(), {\n 'websocket.close.code': event.code,\n 'websocket.close.reason': event.reason,\n 'websocket.close.was_clean': event.wasClean,\n });\n });\n};\n\nexport const createWebSocketPlugin = (): BkOTPlugin => {\n let originalWebSocket: typeof WebSocket | undefined;\n let patchedProxy: typeof WebSocket | undefined;\n let disposed = false;\n\n return {\n name: 'websocket',\n init(context) {\n if (typeof window === 'undefined' || typeof window.WebSocket === 'undefined') return;\n const nativeWebSocket = window.WebSocket;\n originalWebSocket = nativeWebSocket;\n patchedProxy = new Proxy(nativeWebSocket, {\n construct(target, args, newTarget) {\n const socket = Reflect.construct(target, args, newTarget) as WebSocket;\n if (disposed || !context.isSampled()) return socket;\n const url = args[0] == null ? '' : String(args[0]);\n if (url && !shouldIgnoreUrl(context.config, url)) {\n instrumentSocket(socket, context, url, () => disposed);\n }\n return socket;\n },\n });\n window.WebSocket = patchedProxy;\n },\n shutdown() {\n disposed = true;\n if (typeof window !== 'undefined' && originalWebSocket && window.WebSocket === patchedProxy) {\n window.WebSocket = originalWebSocket;\n }\n patchedProxy = undefined;\n originalWebSocket = undefined;\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n */\n\nexport type BkOTActivityEvent =\n | { endTime: number; startTime: number; type: 'long_task'; url?: never }\n | { endTime: number; startTime: number; type: 'resource'; url?: string }\n | { id: string; time: number; type: 'request_end' }\n | { id: string; time: number; type: 'request_start'; url?: string }\n | { time: number; type: 'dom_mutation' | 'error' | 'window_open' };\n\nexport class RumActivityObserver {\n private readonly listeners = new Set<(event: BkOTActivityEvent) => void>();\n\n public notify = (event: BkOTActivityEvent) => {\n this.listeners.forEach(listener => listener(event));\n };\n\n public subscribe = (listener: (event: BkOTActivityEvent) => void) => {\n this.listeners.add(listener);\n return () => this.listeners.delete(listener);\n };\n}\n","{\n \"name\": \"@blueking/open-telemetry\",\n \"version\": \"0.0.29\",\n \"description\": \"OpenTelemetry browser SDK for BK RUM\",\n \"author\": \"TencentCloud Real User Monitoring\",\n \"main\": \"dist/index.js\",\n \"unpkg\": \"dist/bk-rum.global.js\",\n \"jsdelivr\": \"dist/bk-rum.global.js\",\n \"license\": \"MIT\",\n \"files\": [\n \"dist\",\n \"skills\"\n ],\n \"scripts\": {\n \"prepublishOnly\": \"pnpm build && pnpm dts && pnpm skill:refs\",\n \"skill:refs\": \"node scripts/gen-skill-references.mjs\",\n \"test:skill-refs\": \"node --test tests/gen-skill-references.test.mjs\",\n \"build\": \"vite build && vite build --mode cdn && pnpm dts\",\n \"build:cdn\": \"vite build --mode cdn\",\n \"build:esm\": \"vite build\",\n \"docs:build\": \"vitepress build wikis\",\n \"docs:dev\": \"vitepress dev wikis\",\n \"docs:preview\": \"vitepress preview wikis\",\n \"dev\": \"vite dev\",\n \"dts\": \"vue-tsc --project tsconfig.dts.json\",\n \"test:rum-context\": \"node --experimental-default-type=module --experimental-strip-types --test tests/action-plugin.test.mjs tests/consent.test.mjs tests/experience-plugins.test.mjs tests/request-model.test.mjs tests/runtime-context.test.mjs tests/sampling.test.mjs tests/session-state.test.ts tests/session-plugin.test.mjs tests/session-page-view.test.mjs tests/session-processors.test.mjs tests/trace-context.test.mjs tests/web-vitals.test.mjs\"\n },\n \"dependencies\": {\n \"@opentelemetry/api\": \"^1.9.1\",\n \"@opentelemetry/context-zone\": \"2.7.1\",\n \"@opentelemetry/core\": \"^2.7.1\",\n \"@opentelemetry/exporter-trace-otlp-http\": \"^0.217.0\",\n \"@opentelemetry/instrumentation\": \"^0.217.0\",\n \"@opentelemetry/resources\": \"^2.7.1\",\n \"@opentelemetry/sdk-trace-base\": \"^2.7.1\",\n \"@opentelemetry/sdk-trace-web\": \"^2.7.1\",\n \"@opentelemetry/semantic-conventions\": \"^1.38.0\",\n \"web-vitals\": \"^5.0.3\"\n },\n \"devDependencies\": {\n \"@vitejs/plugin-vue\": \"^6.0.6\",\n \"@vue/test-utils\": \"^2.4.6\",\n \"@vue/tsconfig\": \"^0.9.0\",\n \"oxc-minify\": \"^0.133.0\",\n \"vite\": \"^8.0.2\",\n \"vite-bundle-analyzer\": \"^1.3.2\",\n \"vitepress\": \"2.0.0-alpha.16\",\n \"vue\": \"^3.5.34\",\n \"vue-router\": \"^5.0.6\",\n \"vue-tsc\": \"^3.1.4\"\n }\n}\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { version as packageVersion } from '../../package.json';\nimport { getDeviceResourceAttributes } from '../plugins/device';\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\nimport { normalizeUrlPathTemplate } from './url';\n\nimport type { BkOTActionPluginOptions } from '../plugins/action';\nimport type { BkOTBlankScreenPluginOptions } from '../plugins/blank-screen';\nimport type { BkOTDevicePluginOptions } from '../plugins/device';\nimport type { BkOTLongTaskPluginOptions } from '../plugins/long-task';\nimport type { BkOTSessionConfig } from '../plugins/session';\nimport type { RumRequestOutcome } from '../schema/span';\nimport type { BkOTPlugin } from './plugin';\nimport type { BkOTUserContext } from './runtime-context';\nimport type { Attributes } from '@opentelemetry/api';\nimport type { Instrumentation } from '@opentelemetry/instrumentation';\n\nexport interface BkOTActionEventPayload {\n attributes?: Attributes;\n name: string;\n}\n\nexport interface BkOTApplicationConfig {\n environment?: string;\n name: string;\n version?: string;\n}\n\nexport interface BkOTAttributesConfig {\n custom?: () => Attributes;\n error?: () => Attributes;\n page?: () => Attributes;\n}\n\nexport type BkOTAttributeValue = boolean | number | string;\n\nexport interface BkOTBatchConfig {\n exportTimeoutMillis?: number;\n maxExportBatchSize?: number;\n maxQueueSize?: number;\n scheduledDelayMillis?: number;\n}\n\nexport interface BkOTBeforeSendEvent {\n attributes: Record<string, unknown>;\n name: string;\n signal: 'span';\n}\n\nexport interface BkOTContextConfig {\n attributes?: BkOTAttributesConfig;\n user?: BkOTUserContext;\n}\n\nexport interface BkOTCustomEventPayload {\n attributes?: Attributes;\n error?: Error;\n name: string;\n}\n\nexport interface BkOTExtensionsConfig {\n instrumentations?: Instrumentation[];\n plugins?: BkOTPlugin[];\n}\n\nexport interface BkOTOptions {\n application: BkOTApplicationConfig;\n autoStart?: boolean;\n context?: BkOTContextConfig;\n debug?: boolean;\n enabled?: boolean;\n extensions?: BkOTExtensionsConfig;\n privacy?: BkOTPrivacyConfig;\n session?: BkOTSessionConfig;\n tracking?: BkOTTrackingConfig;\n transport: BkOTTransportConfig;\n}\n\nexport interface BkOTPrivacyConfig {\n /** 初始化时的采集授权状态;运行期可通过 setTrackingConsent 更新。 */\n trackingConsent?: BkOTTrackingConsent;\n /** 在所有 RUM 自定义插件 emit 前统一过滤属性。 */\n redactAttributes?: (attributes: Attributes) => Attributes;\n /** 所有写入 attribute 的 URL 都会先经过此函数。 */\n redactUrl?: (url: string) => string;\n}\n\nexport interface BkOTRequestConfig {\n allowedTracingUrls?: BkOTUrlMatcher | BkOTUrlMatcher[];\n excludedUrls?: BkOTUrlMatcher | BkOTUrlMatcher[];\n beforeSend?: (event: BkOTRequestEvent, context: BkOTRequestContext) => boolean | void;\n /** 返回请求 URL 的低基数模板,例如 `/api/orders/{id}`;返回空值时回退到默认折叠规则。 */\n getUrlTemplate?: (url: string) => string | undefined;\n}\n\nexport type BkOTRequestContext =\n | { error?: unknown; request: Request | RequestInit; response?: Response; type: 'fetch' }\n | { type: 'xhr'; xhr: XMLHttpRequest };\n\nexport interface BkOTRequestEvent {\n attributes: Attributes;\n type: 'resource';\n resource: {\n method?: string;\n outcome: BkOTRequestOutcome;\n transport: 'fetch' | 'xhr';\n url?: string;\n };\n}\n\nexport type BkOTRequestOutcome = RumRequestOutcome;\n\nexport type BkOTSpanProcessorMode = 'batch' | 'simple';\n\nexport interface BkOTTrackingConfig {\n action?: BkOTActionPluginOptions | boolean;\n blankScreen?: BkOTBlankScreenPluginOptions | boolean;\n cspViolation?: boolean;\n device?: BkOTDevicePluginOptions | boolean;\n error?: boolean;\n longTask?: BkOTLongTaskPluginOptions | boolean;\n request?: BkOTRequestConfig | boolean;\n resource?: boolean;\n view?: BkOTViewConfig;\n websocket?: boolean;\n webVitals?: boolean;\n beforeSend?: (event: BkOTBeforeSendEvent) => boolean | void;\n}\n\nexport type BkOTTrackingConsent = 'granted' | 'not-granted';\n\nexport interface BkOTTransportConfig {\n batch?: BkOTBatchConfig;\n concurrencyLimit?: number;\n endpoint: string;\n headers?: Record<string, string>;\n processor?: BkOTSpanProcessorMode;\n timeoutMillis?: number;\n token?: string;\n}\n\nexport type BkOTUrlMatcher = ((url: string) => boolean) | RegExp | string;\n\nexport interface BkOTViewConfig {\n /** 不参与 View loading time 的长轮询、流式请求或埋点 URL。 */\n excludedActivityUrls?: BkOTUrlMatcher | BkOTUrlMatcher[];\n /** 自动计算初始加载与 SPA 路由的页面稳定耗时,默认开启。 */\n loadingTime?: boolean;\n tracking?: 'auto' | 'manual';\n /** 返回页面路由的低基数模板,例如 `/trace/:id`;返回空值时回退到默认折叠规则。 */\n getUrlTemplate?: (url: string) => string | undefined;\n}\n\nexport interface ResolvedApplicationConfig {\n environment: string;\n name: string;\n version?: string;\n}\n\nexport interface ResolvedBkOTConfig {\n application: ResolvedApplicationConfig;\n autoStart: boolean;\n debug: boolean;\n enabled: boolean;\n extensions: BkOTExtensionsConfig;\n hooks: ResolvedConfigHooks;\n resourceAttributes: Attributes;\n session: ResolvedSessionConfig;\n spanBatch?: BkOTBatchConfig;\n spanProcessor: BkOTSpanProcessorMode;\n tracking: BkOTTrackingConfig;\n trackingConsent: BkOTTrackingConsent;\n transport: ResolvedTransportConfig;\n user?: BkOTUserContext;\n view: ResolvedViewConfig;\n}\n\nexport interface ResolvedConfigHooks {\n beforeSend?: (event: BkOTBeforeSendEvent) => boolean | void;\n getCustomAttributes: () => Attributes;\n getErrorAttributes: () => Attributes;\n getPageAttributes: () => Attributes;\n getRequestUrlTemplate: (url: string) => string;\n getViewUrlTemplate: (url: string) => string;\n redactAttributes: (attributes: Attributes) => Attributes;\n redactUrl: (url: string) => string;\n}\n\nexport interface ResolvedSessionConfig extends BkOTSessionConfig {\n sampleRate: number;\n}\n\nexport interface ResolvedTransportConfig {\n concurrencyLimit?: number;\n endpoint: string;\n headers?: Record<string, string>;\n timeoutMillis?: number;\n}\n\nexport interface ResolvedViewConfig {\n excludedActivityUrls?: BkOTUrlMatcher | BkOTUrlMatcher[];\n loadingTime: boolean;\n tracking: 'auto' | 'manual';\n}\n\nconst trimTrailingSlash = (value: string) => value.trim().replace(/\\/+$/, '');\n\nconst resolveTransportConfig = (transport: BkOTTransportConfig): ResolvedTransportConfig => {\n // token 只负责提供默认鉴权头;headers 保持显式配置优先,便于特殊场景覆盖。\n const mergedHeaders =\n transport.token || transport.headers\n ? {\n ...(transport.token ? { Authorization: `Bearer ${transport.token}` } : {}),\n ...(transport.headers ?? {}),\n }\n : undefined;\n\n return {\n concurrencyLimit: transport.concurrencyLimit,\n endpoint: `${trimTrailingSlash(transport.endpoint)}/v1/rum`,\n headers: mergedHeaders,\n timeoutMillis: transport.timeoutMillis,\n };\n};\n\nconst clampSampleRate = (sampleRate?: number) => {\n if (typeof sampleRate !== 'number' || !Number.isFinite(sampleRate)) {\n return 1;\n }\n return Math.max(0, Math.min(1, sampleRate));\n};\n\nconst identityRedactAttributes = (attributes: Attributes) => attributes;\n\n// 默认只保留 URL 的定位信息;认证信息、查询参数和 fragment 可能携带用户数据,统一移除。\nconst defaultRedactUrl = (url: string) => {\n if (!url) return url;\n try {\n const parsed = new URL(url, typeof location === 'undefined' ? 'http://localhost' : location.href);\n parsed.username = '';\n parsed.password = '';\n parsed.search = '';\n parsed.hash = '';\n return parsed.href;\n } catch {\n return url.replace(/[?#].*$/, '');\n }\n};\n\nconst getUrlPathname = (url: string) => {\n try {\n return new URL(url, typeof location === 'undefined' ? 'http://localhost' : location.href).pathname || '/';\n } catch {\n return url || '/';\n }\n};\n\n/**\n * 低基数路径模板,供 `view.url_template` 与 `url.template` 共用同一套折叠规则。\n * 只保留 path:host 维度由 `server.address` 表达,query 由 `normalizeUrlPathTemplate` 去掉。\n */\nconst templatizeUrlPath = (url: string) => normalizeUrlPathTemplate(getUrlPathname(url));\n\n/** 模板 Hook 在每个请求/导航上都会跑,抛错不能影响追踪本身 */\nconst resolveTemplateHook =\n (config: BkOTOptions, custom: ((url: string) => string | undefined) | undefined) => (url: string) => {\n try {\n const templated = custom?.(url);\n if (templated) return templated;\n } catch (error) {\n if (config.debug) globalThis.console?.warn('[bk-ot] url template hook failed:', error);\n }\n return templatizeUrlPath(url);\n };\n\nconst resolveApplicationConfig = (application: BkOTOptions['application']): ResolvedApplicationConfig => ({\n environment: application.environment ?? 'production',\n name: application.name,\n version: application.version,\n});\n\nconst resolveResourceAttributes = (\n application: ResolvedApplicationConfig,\n device: BkOTTrackingConfig['device'],\n sampleRate: number,\n): Attributes => ({\n [RUM_ATTRIBUTES.deploymentEnvironmentName]: application.environment,\n ...(device === false ? {} : getDeviceResourceAttributes()),\n [RUM_ATTRIBUTES.serviceName]: application.name,\n ...(application.version ? { [RUM_ATTRIBUTES.serviceVersion]: application.version } : {}),\n [RUM_ATTRIBUTES.sessionSampleRate]: sampleRate,\n 'telemetry.sdk.language': 'webjs',\n 'telemetry.sdk.name': '@blueking/open-telemetry',\n 'telemetry.sdk.version': packageVersion,\n});\n\nconst validateTransportConfig = (transport: BkOTTransportConfig | undefined) => {\n if (!transport) throw new Error('[bk-ot] transport is required.');\n if (!transport.endpoint?.trim()) throw new Error('[bk-ot] transport.endpoint is required.');\n};\n\nconst resolveHooks = (config: BkOTOptions): ResolvedConfigHooks => ({\n beforeSend: config.tracking?.beforeSend,\n getPageAttributes: config.context?.attributes?.page ?? (() => ({})),\n getErrorAttributes: config.context?.attributes?.error ?? (() => ({})),\n getCustomAttributes: config.context?.attributes?.custom ?? (() => ({})),\n getRequestUrlTemplate: resolveTemplateHook(\n config,\n typeof config.tracking?.request === 'object' ? config.tracking.request.getUrlTemplate : undefined,\n ),\n getViewUrlTemplate: resolveTemplateHook(\n config,\n typeof config.tracking?.view === 'object' ? config.tracking.view.getUrlTemplate : undefined,\n ),\n redactAttributes: config.privacy?.redactAttributes ?? identityRedactAttributes,\n redactUrl: config.privacy?.redactUrl ?? defaultRedactUrl,\n});\n\nexport const resolveConfig = (config: BkOTOptions): ResolvedBkOTConfig => {\n if (!config.application?.name?.trim()) {\n throw new Error('[bk-ot] application.name is required.');\n }\n validateTransportConfig(config.transport);\n const application = resolveApplicationConfig(config.application);\n const viewConfig = typeof config.tracking?.view === 'object' ? config.tracking.view : undefined;\n const hooks = resolveHooks(config);\n const sampleRate = clampSampleRate(config.session?.sampleRate);\n\n return {\n application,\n autoStart: config.autoStart ?? true,\n debug: config.debug ?? false,\n enabled: config.enabled ?? true,\n extensions: {\n instrumentations: [...(config.extensions?.instrumentations ?? [])],\n plugins: [...(config.extensions?.plugins ?? [])],\n },\n hooks,\n resourceAttributes: hooks.redactAttributes(\n resolveResourceAttributes(application, config.tracking?.device, sampleRate),\n ),\n session: {\n ...config.session,\n sampleRate,\n },\n spanBatch: config.transport.batch,\n spanProcessor: config.transport.processor ?? 'batch',\n tracking: config.tracking ?? {},\n trackingConsent: config.privacy?.trackingConsent ?? 'granted',\n transport: resolveTransportConfig(config.transport),\n user: config.context?.user,\n view: {\n excludedActivityUrls: viewConfig?.excludedActivityUrls,\n loadingTime: viewConfig?.loadingTime !== false,\n tracking: viewConfig?.tracking === 'manual' ? 'manual' : 'auto',\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport type { BkOTActivityEvent } from './action-activity';\nimport type { ResolvedBkOTConfig } from './config';\nimport type { BkOTSessionLifecycleEvent, BkOTUserContext, BkOTViewCommand, BkOTViewContext } from './runtime-context';\nimport type { Attributes, Link, Span, SpanKind, TimeInput, Tracer } from '@opentelemetry/api';\nimport type { Instrumentation } from '@opentelemetry/instrumentation';\n\nexport interface BkOTPlugin {\n enabled?: ((config: ResolvedBkOTConfig) => boolean) | boolean;\n name: string;\n flush?: () => Promise<void> | void;\n init: (context: BkOTRuntimeContext) => Promise<void> | void;\n shutdown?: () => Promise<void> | void;\n}\n\nexport interface BkOTRuntimeContext {\n config: ResolvedBkOTConfig;\n tracer: Tracer;\n /** 对外提供的属性脱敏入口,所有插件在 emit 前都应过一次 */\n applyRedact: (attributes: Attributes) => Attributes;\n flush: () => Promise<void>;\n getRuntimeAttributes: () => Attributes;\n getRuntimeAttributesAt: (timestamp: number) => Attributes;\n isSampled: () => boolean;\n isSessionActive: () => boolean;\n isViewActive: () => boolean;\n notifyActivity: (event: BkOTActivityEvent) => void;\n notifySessionLifecycle: (event: BkOTSessionLifecycleEvent) => void;\n onActivity: (listener: (event: BkOTActivityEvent) => void) => () => void;\n onSessionLifecycle: (listener: (event: BkOTSessionLifecycleEvent) => void) => () => void;\n onViewChange: (listener: (view: BkOTViewContext) => void) => () => void;\n onViewCommand: (listener: (command: BkOTViewCommand) => void) => () => void;\n registerInstrumentations: (instrumentations: Instrumentation[]) => void;\n setRuntimeAttributes: (attributes: Attributes, changedAt?: number) => void;\n /** 更新用户上下文;user.id 由接入方传入,SDK 原样透传 */\n setUser: (user: BkOTUserContext) => void;\n /** 更新当前 View 上下文,后续 span 会自动带上 view.* 关联字段 */\n setView: (view: BkOTViewContext, changedAt?: number) => void;\n startSpan: (name: string, attributes?: Attributes, options?: BkOTStartSpanOptions) => Span;\n}\n\n/**\n * startSpan 的扩展选项。\n *\n * 用于\"事件实际发生在过去某个时刻,但 span 现在才创建\"的场景:\n * 例如 PerformanceObserver 在条目结束后才回调,但 span 的时间窗仍需反映\n * 条目真实发生的区间,方便 trace 视图与并发请求对齐。\n *\n * startTime 接受 OT TimeInput;常用 epoch 毫秒(performance.timeOrigin + performance.now())。\n * 配合 span.end(endTime?) 可控制结束时间。\n */\nexport interface BkOTStartSpanOptions {\n /** 用于从历史中解析 Session/View/Action 归属;默认复用数字类型 startTime。 */\n contextTime?: number;\n kind?: SpanKind;\n /** 关联其他 trace 的 Span Link;OTel 要求在创建时传入。 */\n links?: Link[];\n startTime?: TimeInput;\n}\n\nexport const isPluginEnabled = (plugin: BkOTPlugin, config: ResolvedBkOTConfig) => {\n if (typeof plugin.enabled === 'function') {\n return plugin.enabled(config);\n }\n return plugin.enabled !== false;\n};\n\nexport const createPlugin = (plugin: BkOTPlugin) => plugin;\n\nexport class PluginManager {\n private readonly plugins: BkOTPlugin[];\n private startedPlugins: BkOTPlugin[] = [];\n\n public constructor(plugins: BkOTPlugin[]) {\n this.plugins = plugins;\n }\n\n public async flush() {\n // 并行 flush,避免单个慢插件拖累整体\n await Promise.all(this.startedPlugins.map(plugin => Promise.resolve().then(() => plugin.flush?.())));\n }\n\n public async shutdown() {\n const plugins = [...this.startedPlugins].reverse();\n for (const plugin of plugins) {\n await plugin.shutdown?.();\n }\n this.startedPlugins = [];\n }\n\n public async start(context: BkOTRuntimeContext) {\n // 每个插件独立 try/catch,单个插件 init 失败不应拖累其他插件:\n // - 失败的插件不会进入 startedPlugins(shutdown 时不会被反向 teardown)\n // - debug 模式打 warn,方便排查;非 debug 静默失败避免污染业务日志\n for (const plugin of this.plugins) {\n if (!isPluginEnabled(plugin, context.config)) {\n continue;\n }\n try {\n await plugin.init(context);\n this.startedPlugins.push(plugin);\n } catch (error) {\n if (context.config.debug) {\n globalThis.console?.warn(`[bk-ot] plugin \"${plugin.name}\" init failed:`, error);\n }\n }\n }\n }\n}\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\n\nimport type { Attributes } from '@opentelemetry/api';\n\nexport type BkOTSessionLifecycleEvent =\n | {\n expiredAt: number;\n id: string;\n reason: 'external' | 'inactivity' | 'maxLifetime';\n type: 'expired';\n }\n | {\n id: string;\n previousId?: string;\n reason: 'inactivity' | 'init' | 'maxLifetime' | 'shared';\n startedAt: number;\n type: 'renewed';\n };\n\nexport interface BkOTStartViewOptions {\n attributes?: Attributes;\n name?: string;\n url?: string;\n}\n\nexport interface BkOTUserContext {\n /** 由接入方传入并由 SDK 原样透传;SDK 不 hash、不脱敏、不改写。 */\n id?: string;\n}\n\nexport type BkOTViewCommand =\n | { name: string; type: 'set_name' }\n | { options: BkOTStartViewOptions; type: 'start' }\n | { time: number; type: 'set_loading_time' };\n\nexport interface BkOTViewContext {\n attributes?: Attributes;\n id?: string;\n loadingType?: 'bf_cache' | 'initial_load' | 'route_change' | 'session_renewal';\n name?: string;\n startedAt?: number;\n url?: string;\n urlTemplate?: string;\n}\n\nconst PROTECTED_VIEW_ATTRIBUTE_KEYS = new Set<string>(Object.values(RUM_ATTRIBUTES));\n\n/**\n * 管理 SDK 运行期公共属性快照。\n *\n * 这里仅保存“后续事件都需要带上”的低成本上下文,Session/View/用户切换时更新快照,\n * 插件发 Span 时读取当前快照即可,避免每个插件重复维护公共字段。\n */\nexport class RumRuntimeContext {\n private readonly actionHistory: Array<{ attributes: Attributes; endedAt?: number; startedAt: number }> = [];\n private readonly attributes: Attributes = {};\n private readonly queuedViewCommands: BkOTViewCommand[] = [];\n\n // 保存关联关系的生效区间,供延迟到达的 PerformanceEntry 按事件时间回查原 Session/View/Action。\n private recordAssociation = (\n history: Array<{ attributes: Attributes; endedAt?: number; startedAt: number }>,\n keys: Iterable<string>,\n changedAt: number,\n active: boolean,\n ) => {\n const previous = history.at(-1);\n if (previous && previous.endedAt === undefined) previous.endedAt = Math.max(previous.startedAt, changedAt);\n if (active) {\n const associationAttributes: Attributes = {};\n for (const key of keys) {\n const value = this.attributes[key];\n if (value !== undefined) associationAttributes[key] = value;\n }\n history.push({ attributes: associationAttributes, startedAt: changedAt });\n }\n if (history.length > 100) history.splice(0, history.length - 100);\n };\n private readonly sessionHistory: Array<{ attributes: Attributes; endedAt?: number; startedAt: number }> = [];\n private sampled = false;\n private readonly samplingHistory: Array<{ endedAt?: number; sampled: boolean; startedAt: number }> = [];\n private readonly sessionLifecycleListeners = new Set<(event: BkOTSessionLifecycleEvent) => void>();\n private readonly setOptionalAttribute = (key: string, value: string | undefined) => {\n if (value === undefined) {\n delete this.attributes[key];\n return;\n }\n this.attributes[key] = value;\n };\n private user: BkOTUserContext = {};\n private view: BkOTViewContext = {};\n private readonly viewAttributeKeys = new Set<string>();\n private readonly viewChangeListeners = new Set<(view: BkOTViewContext) => void>();\n private readonly viewCommandListeners = new Set<(command: BkOTViewCommand) => void>();\n\n private readonly viewHistory: Array<{ attributes: Attributes; endedAt?: number; startedAt: number }> = [];\n\n private readonly viewScopedAttributeKeys = new Set<string>();\n\n public dispatchViewCommand = (command: BkOTViewCommand) => {\n // autoStart 下调用方可能早于 page-view 插件发命令,先排队可避免 startView/setViewName 丢失。\n if (this.viewCommandListeners.size === 0) {\n this.queuedViewCommands.push(command);\n return;\n }\n this.viewCommandListeners.forEach(listener => listener(command));\n };\n\n public getAttributes = (): Attributes => ({ ...this.attributes });\n\n public getAttributesAt = (timestamp: number): Attributes => {\n if (!Number.isFinite(timestamp)) return this.getAttributes();\n const result = this.getAttributes();\n const applyHistory = (\n history: Array<{ attributes: Attributes; endedAt?: number; startedAt: number }>,\n keys: Iterable<string>,\n ) => {\n // 先移除当前关联字段,再用目标时间所在的历史快照覆盖,避免把旧事件错误归到当前 View。\n for (const key of keys) delete result[key];\n const matched = [...history]\n .reverse()\n .find(entry => entry.startedAt <= timestamp && (entry.endedAt === undefined || timestamp < entry.endedAt));\n if (matched) Object.assign(result, matched.attributes);\n };\n applyHistory(this.sessionHistory, [RUM_ATTRIBUTES.sessionId, RUM_ATTRIBUTES.sessionHasReplay]);\n applyHistory(this.viewHistory, this.viewScopedAttributeKeys);\n applyHistory(this.actionHistory, [RUM_ATTRIBUTES.actionId]);\n return result;\n };\n\n public getUser = (): BkOTUserContext => ({ ...this.user });\n\n public getView = (): BkOTViewContext => ({ ...this.view });\n\n public isSessionActive = () => typeof this.attributes[RUM_ATTRIBUTES.sessionId] === 'string';\n\n public isSessionSampledAt = (timestamp: number) => {\n if (!Number.isFinite(timestamp)) return this.sampled;\n return (\n [...this.samplingHistory]\n .reverse()\n .find(entry => entry.startedAt <= timestamp && (entry.endedAt === undefined || timestamp < entry.endedAt))\n ?.sampled ?? false\n );\n };\n\n public isViewActive = () => typeof this.attributes[RUM_ATTRIBUTES.viewId] === 'string';\n\n public notifySessionLifecycle = (event: BkOTSessionLifecycleEvent) => {\n this.sessionLifecycleListeners.forEach(listener => listener(event));\n };\n\n public onSessionLifecycle = (listener: (event: BkOTSessionLifecycleEvent) => void) => {\n this.sessionLifecycleListeners.add(listener);\n return () => this.sessionLifecycleListeners.delete(listener);\n };\n\n public onViewChange = (listener: (view: BkOTViewContext) => void) => {\n this.viewChangeListeners.add(listener);\n if (this.view.id) listener(this.getView());\n return () => this.viewChangeListeners.delete(listener);\n };\n\n public onViewCommand = (listener: (command: BkOTViewCommand) => void) => {\n this.viewCommandListeners.add(listener);\n while (this.queuedViewCommands.length) {\n listener(this.queuedViewCommands.shift()!);\n }\n return () => this.viewCommandListeners.delete(listener);\n };\n\n public setAttributes = (attributes: Attributes, changedAt = Date.now()) => {\n for (const [key, value] of Object.entries(attributes)) {\n if (value === undefined) {\n delete this.attributes[key];\n continue;\n }\n this.attributes[key] = value;\n }\n if (RUM_ATTRIBUTES.sessionId in attributes) {\n this.recordAssociation(\n this.sessionHistory,\n [RUM_ATTRIBUTES.sessionId, RUM_ATTRIBUTES.sessionHasReplay],\n changedAt,\n typeof this.attributes[RUM_ATTRIBUTES.sessionId] === 'string',\n );\n }\n if (RUM_ATTRIBUTES.actionId in attributes) {\n const actionId = this.attributes[RUM_ATTRIBUTES.actionId];\n this.recordAssociation(\n this.actionHistory,\n [RUM_ATTRIBUTES.actionId],\n changedAt,\n Array.isArray(actionId) ? actionId.length > 0 : typeof actionId === 'string',\n );\n }\n };\n\n public setUser = (user: BkOTUserContext) => {\n this.user = {\n ...this.user,\n ...user,\n };\n\n if ('id' in user) {\n if (user.id === undefined) {\n delete this.attributes[RUM_ATTRIBUTES.userId];\n return;\n }\n this.attributes[RUM_ATTRIBUTES.userId] = user.id;\n }\n };\n\n public setSessionSampled = (sampled: boolean, changedAt = Date.now()) => {\n if (sampled === this.sampled) return;\n const previous = this.samplingHistory.at(-1);\n if (previous && previous.endedAt === undefined) previous.endedAt = Math.max(previous.startedAt, changedAt);\n this.sampled = sampled;\n if (sampled) this.samplingHistory.push({ sampled, startedAt: changedAt });\n if (this.samplingHistory.length > 100) {\n this.samplingHistory.splice(0, this.samplingHistory.length - 100);\n }\n };\n\n public setView = (view: BkOTViewContext, changedAt = view.startedAt ?? Date.now()) => {\n this.viewAttributeKeys.forEach(key => delete this.attributes[key]);\n this.viewAttributeKeys.clear();\n const viewAttributes: Attributes = {};\n for (const [key, value] of Object.entries(view.attributes ?? {})) {\n // 自定义 View 属性不能覆盖 SDK 维护的关联和语义字段。\n if (value === undefined || PROTECTED_VIEW_ATTRIBUTE_KEYS.has(key)) continue;\n viewAttributes[key] = value;\n this.attributes[key] = value;\n this.viewAttributeKeys.add(key);\n this.viewScopedAttributeKeys.add(key);\n }\n this.view = { ...view, attributes: viewAttributes };\n this.setOptionalAttribute(RUM_ATTRIBUTES.viewId, view.id);\n this.setOptionalAttribute(RUM_ATTRIBUTES.viewUrl, view.url);\n this.setOptionalAttribute(RUM_ATTRIBUTES.viewUrlTemplate, view.urlTemplate);\n this.setOptionalAttribute(RUM_ATTRIBUTES.viewLoadingType, view.loadingType);\n this.setOptionalAttribute(RUM_ATTRIBUTES.viewName, view.name);\n [\n RUM_ATTRIBUTES.viewId,\n RUM_ATTRIBUTES.viewUrl,\n RUM_ATTRIBUTES.viewUrlTemplate,\n RUM_ATTRIBUTES.viewLoadingType,\n RUM_ATTRIBUTES.viewName,\n ].forEach(key => this.viewScopedAttributeKeys.add(key));\n this.recordAssociation(\n this.viewHistory,\n this.viewScopedAttributeKeys,\n changedAt,\n typeof view.id === 'string' && view.id.length > 0,\n );\n this.viewChangeListeners.forEach(listener => listener(this.getView()));\n };\n\n public constructor(initialAttributes: Attributes = {}, user?: BkOTUserContext) {\n this.setAttributes(initialAttributes);\n if (user) {\n this.setUser(user);\n }\n }\n}\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport type { ResolvedBkOTConfig } from './config';\n\nconst hashToUnitInterval = (input: string) => {\n let hash = 0x811c9dc5;\n for (let index = 0; index < input.length; index += 1) {\n hash = Math.imul(hash ^ input.charCodeAt(index), 0x01000193);\n }\n hash += hash << 13;\n hash ^= hash >>> 7;\n hash += hash << 3;\n hash ^= hash >>> 17;\n hash += hash << 5;\n return (hash >>> 0) / 0x100000000;\n};\n\n/**\n * 按应用和 RUM Session ID 做确定性采样。采样决定随 Session 更新,不再依赖 Tab 级 sessionStorage。\n */\nexport const isBkOTSampled = (\n { application, session }: Pick<ResolvedBkOTConfig, 'application' | 'session'>,\n sessionId: string,\n) => {\n if (session.sampleRate <= 0) {\n return false;\n }\n if (session.sampleRate >= 1) {\n return true;\n }\n return hashToUnitInterval(`${application.name}\\0${sessionId}`) < session.sampleRate;\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { type Attributes, type Span, context, propagation, SpanKind, SpanStatusCode } from '@opentelemetry/api';\nimport { ZoneContextManager } from '@opentelemetry/context-zone';\nimport { W3CTraceContextPropagator } from '@opentelemetry/core';\nimport { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';\nimport { resourceFromAttributes } from '@opentelemetry/resources';\nimport { BatchSpanProcessor, SamplingDecision, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base';\nimport { WebTracerProvider } from '@opentelemetry/sdk-trace-web';\n\nimport { createActionPlugin } from '../plugins/action';\nimport { createActivityPlugin } from '../plugins/activity';\nimport { createBlankScreenPlugin } from '../plugins/blank-screen';\nimport { createCommonInstrumentationsPlugin } from '../plugins/common';\nimport { createCspViolationPlugin } from '../plugins/csp-violation';\nimport { createDevicePlugin } from '../plugins/device';\nimport { createErrorPlugin } from '../plugins/error';\nimport { createLongTaskPlugin } from '../plugins/long-task';\nimport { createPageViewPlugin } from '../plugins/page-view';\nimport { createResourcePlugin } from '../plugins/resource';\nimport { createSessionPlugin } from '../plugins/session';\nimport { createWebVitalsPlugin } from '../plugins/web-vitals';\nimport { createWebSocketPlugin } from '../plugins/websocket';\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\nimport { buildRumSpanAttributes, RUM_SPAN_OUTCOME, RUM_SPAN_TYPE } from '../schema/span';\nimport { RumActivityObserver } from './action-activity';\nimport {\n type BkOTActionEventPayload,\n type BkOTCustomEventPayload,\n type BkOTOptions,\n type BkOTTrackingConfig,\n type BkOTTrackingConsent,\n type ResolvedBkOTConfig,\n type ResolvedTransportConfig,\n resolveConfig,\n} from './config';\nimport { createRandomId } from './id';\nimport { type BkOTPlugin, type BkOTRuntimeContext, type BkOTStartSpanOptions, PluginManager } from './plugin';\nimport { FilteringSpanProcessor } from './processor';\nimport {\n type BkOTSessionLifecycleEvent,\n type BkOTStartViewOptions,\n type BkOTUserContext,\n RumRuntimeContext,\n} from './runtime-context';\nimport { isBkOTSampled } from './sampling';\n\nimport type { Instrumentation } from '@opentelemetry/instrumentation';\nimport type { Sampler } from '@opentelemetry/sdk-trace-base';\n\nexport interface BkOTInstance extends Omit<\n BkOTRuntimeContext,\n 'notifyActivity' | 'onActivity' | 'onViewChange' | 'onViewCommand' | 'registerInstrumentations' | 'setView'\n> {\n flush: () => Promise<void>;\n reportAction: (payload: BkOTActionEventPayload) => void;\n reportCustomEvent: (payload: BkOTCustomEventPayload) => void;\n setTrackingConsent: (consent: BkOTTrackingConsent) => Promise<void>;\n setUser: (user: BkOTUserContext) => void;\n setViewLoadingTime: () => void;\n setViewName: (name: string) => void;\n shutdown: () => Promise<void>;\n start: () => Promise<void>;\n startView: (options?: BkOTStartViewOptions) => void;\n use: (plugin: BkOTPlugin) => BkOTInstance;\n useInstrumentation: (instrumentation: Instrumentation) => BkOTInstance;\n}\n\nconst createExporterOptions = (config: ResolvedTransportConfig) => ({\n url: config.endpoint,\n headers: config.headers,\n concurrencyLimit: config.concurrencyLimit,\n timeoutMillis: config.timeoutMillis,\n});\n\nconst BK_OT_INSTRUMENTATION_NAME = 'bk-rum';\n\nclass RumSessionSampler implements Sampler {\n public constructor(private readonly isSampled: () => boolean) {}\n\n public shouldSample() {\n return {\n decision: this.isSampled() ? SamplingDecision.RECORD_AND_SAMPLED : SamplingDecision.NOT_RECORD,\n };\n }\n\n public toString() {\n return 'RumSessionSampler';\n }\n}\n\n// OTel context manager 和 propagator 是页面级全局对象,多 SDK 实例通过引用计数共享,最后一个实例退出时释放。\nlet globalRegistration:\n | undefined\n | {\n contextManager?: ZoneContextManager;\n ownsContext: boolean;\n ownsPropagator: boolean;\n users: number;\n };\n\nconst acquireOtelGlobals = () => {\n if (globalRegistration) {\n globalRegistration.users += 1;\n } else {\n const contextManager = new ZoneContextManager().enable();\n const ownsContext = context.setGlobalContextManager(contextManager);\n if (!ownsContext) contextManager.disable();\n globalRegistration = {\n contextManager: ownsContext ? contextManager : undefined,\n ownsContext,\n ownsPropagator: propagation.setGlobalPropagator(new W3CTraceContextPropagator()),\n users: 1,\n };\n }\n let released = false;\n return () => {\n if (released || !globalRegistration) return;\n released = true;\n globalRegistration.users -= 1;\n if (globalRegistration.users > 0) return;\n if (globalRegistration.ownsContext) context.disable();\n if (globalRegistration.ownsPropagator) propagation.disable();\n globalRegistration = undefined;\n };\n};\n\n/**\n * 用 Proxy 包装一层 debug 旁路,避免直接 mutate 第三方 exporter 实例(其内部可能含 #private fields)。\n */\nconst wrapWithDebug = <TExporter extends { export: (...args: any[]) => any }>(\n exporter: TExporter,\n enabled: boolean,\n): TExporter => {\n if (!enabled) {\n return exporter;\n }\n return new Proxy(exporter, {\n get(target, prop, receiver) {\n if (prop === 'export') {\n return (records: unknown, callback: unknown) => {\n globalThis.console?.log('[bk-ot][rum]', records);\n return (target as { export: (...args: unknown[]) => unknown }).export(records, callback);\n };\n }\n const value = Reflect.get(target, prop, receiver);\n return typeof value === 'function' ? value.bind(target) : value;\n },\n });\n};\n\n// 请求插件统一负责 Fetch/XHR span、Trace Header 与活动计数。\nconst getCorePlugins = (config: ResolvedBkOTConfig): BkOTPlugin[] => [\n createCommonInstrumentationsPlugin(config.tracking.request),\n];\n\nconst getRumContextPlugins = (config: ResolvedBkOTConfig): BkOTPlugin[] => [\n createSessionPlugin(config.session),\n ...createBuiltInPlugin(config.tracking.device, true, createDevicePlugin),\n createActivityPlugin(),\n createPageViewPlugin(),\n createResourcePlugin(isBuiltInPluginEnabled(config.tracking.resource, true)),\n];\n\nconst isBuiltInPluginEnabled = <TOptions extends object>(\n option: boolean | TOptions | undefined,\n defaultEnabled: boolean,\n) => (option === undefined ? defaultEnabled : option !== false);\n\nconst getBuiltInPluginOptions = <TOptions extends object>(option: boolean | TOptions | undefined) =>\n typeof option === 'object' && option !== null ? option : undefined;\n\nconst createBuiltInPlugin = <TOptions extends object>(\n option: boolean | TOptions | undefined,\n defaultEnabled: boolean,\n factory: (options?: TOptions) => BkOTPlugin,\n) => (isBuiltInPluginEnabled(option, defaultEnabled) ? [factory(getBuiltInPluginOptions(option))] : []);\n\n// 上下文插件先启动,确保后续 span 能带上关联字段;Session sampler 与 processor 负责统一采样。\nconst getRumPlugins = (tracking: BkOTTrackingConfig): BkOTPlugin[] => [\n ...createBuiltInPlugin(tracking.error, true, createErrorPlugin),\n ...createBuiltInPlugin(tracking.webVitals, true, createWebVitalsPlugin),\n ...createBuiltInPlugin(tracking.blankScreen, true, createBlankScreenPlugin),\n ...createBuiltInPlugin(tracking.action, true, createActionPlugin),\n ...createBuiltInPlugin(tracking.websocket, false, createWebSocketPlugin),\n ...createBuiltInPlugin(tracking.longTask, false, createLongTaskPlugin),\n ...createBuiltInPlugin(tracking.cspViolation, false, createCspViolationPlugin),\n];\n\ntype SdkLifecyclePhase = 'idle' | 'started' | 'starting' | 'stopped';\n\n/**\n * 浏览器 RUM SDK 的生命周期入口。Provider 在构造时创建,插件和全局 patch 则随 start、授权变更和\n * shutdown 安装或卸载;Session 决定统一作用于所有 RUM span。\n */\nexport class BkOpenTelemetry implements BkOTInstance {\n private readonly activityObserver = new RumActivityObserver();\n private readonly flushProviders = async () => {\n await this.tracerProvider.forceFlush();\n };\n private phase: SdkLifecyclePhase = 'idle';\n private pluginManager?: PluginManager;\n private readonly registeredInstrumentations: Instrumentation[];\n private releaseOtelGlobals?: () => void;\n private readonly runtimeContext: RumRuntimeContext;\n\n private sampled = false;\n private readonly startCollection = async () => {\n // Provider 始终存在以保持公开 API 稳定;采集插件仅在启用且获得授权后安装。\n if (this.pluginManager || !this.config.enabled || this.config.trackingConsent !== 'granted') return;\n this.releaseOtelGlobals = acquireOtelGlobals();\n const pluginManager = this.createPluginManager();\n this.pluginManager = pluginManager;\n try {\n await pluginManager.start(this.createPluginContext());\n this.registerInstrumentations(this.config.extensions.instrumentations ?? []);\n } catch (error) {\n await pluginManager.shutdown();\n this.pluginManager = undefined;\n while (this.registeredInstrumentations.length) this.registeredInstrumentations.pop()?.disable?.();\n this.releaseOtelGlobals?.();\n this.releaseOtelGlobals = undefined;\n throw error;\n }\n };\n private readonly stopCollection = async (flush: boolean) => {\n const pluginManager = this.pluginManager;\n if (!pluginManager) return;\n await pluginManager.shutdown();\n this.pluginManager = undefined;\n while (this.registeredInstrumentations.length) this.registeredInstrumentations.pop()?.disable?.();\n // 撤销授权后立即清空 Session,防止后续手工 API 继续复用旧采样决定。\n this.setRuntimeAttributes({\n [RUM_ATTRIBUTES.sessionHasReplay]: undefined,\n [RUM_ATTRIBUTES.sessionId]: undefined,\n });\n if (flush) await this.flushProviders();\n this.releaseOtelGlobals?.();\n this.releaseOtelGlobals = undefined;\n };\n private readonly teardownCallbacks: Array<() => void> = [];\n private readonly tracerProvider: WebTracerProvider;\n private assertBeforeStart(method: string) {\n if (this.phase !== 'idle') {\n throw new Error(`[bk-ot] ${method}() must be called before start(); set autoStart: false before registration.`);\n }\n }\n private createPluginContext(): BkOTRuntimeContext {\n return {\n applyRedact: this.applyRedact,\n config: this.config,\n flush: this.flush,\n getRuntimeAttributes: this.getRuntimeAttributes,\n getRuntimeAttributesAt: this.getRuntimeAttributesAt,\n isSampled: this.isSampled,\n isSessionActive: this.isSessionActive,\n isViewActive: this.isViewActive,\n notifySessionLifecycle: this.notifySessionLifecycle,\n notifyActivity: this.activityObserver.notify,\n onActivity: this.activityObserver.subscribe,\n onSessionLifecycle: this.onSessionLifecycle,\n onViewCommand: this.runtimeContext.onViewCommand,\n onViewChange: this.runtimeContext.onViewChange,\n registerInstrumentations: this.registerInstrumentations,\n setRuntimeAttributes: this.setRuntimeAttributes,\n setUser: this.setUser,\n setView: this.runtimeContext.setView,\n startSpan: this.startSpan,\n tracer: this.tracer,\n };\n }\n private createPluginManager() {\n return new PluginManager([\n ...getRumContextPlugins(this.config),\n ...getCorePlugins(this.config),\n ...getRumPlugins(this.config.tracking),\n ...(this.config.extensions.plugins ?? []),\n ]);\n }\n public readonly applyRedact = (attributes: Attributes) => this.config.hooks.redactAttributes(attributes);\n\n public readonly config: ResolvedBkOTConfig;\n\n public readonly flush = async () => {\n await this.pluginManager?.flush();\n await this.flushProviders();\n };\n\n public readonly getRuntimeAttributes = () => this.runtimeContext.getAttributes();\n public readonly getRuntimeAttributesAt = (timestamp: number) => this.runtimeContext.getAttributesAt(timestamp);\n public readonly isSampled = () => this.sampled;\n public readonly isSessionActive = () => this.runtimeContext.isSessionActive();\n public readonly isViewActive = () => this.runtimeContext.isViewActive();\n public readonly notifySessionLifecycle = (event: BkOTSessionLifecycleEvent) => {\n this.runtimeContext.notifySessionLifecycle(event);\n };\n\n public readonly onSessionLifecycle = (listener: (event: BkOTSessionLifecycleEvent) => void) =>\n this.runtimeContext.onSessionLifecycle(listener);\n\n public readonly registerInstrumentations = (instrumentations: Instrumentation[]) => {\n if (!instrumentations.length) return;\n instrumentations.forEach(instrumentation => {\n instrumentation.setTracerProvider(this.tracerProvider);\n if (!instrumentation.getConfig().enabled) instrumentation.enable();\n });\n this.registeredInstrumentations.push(...instrumentations);\n };\n\n public readonly reportAction = ({ attributes = {}, name }: BkOTActionEventPayload) => {\n if (!this.isSampled()) {\n return;\n }\n const actionId = createRandomId('action');\n const occurredAt = Date.now();\n const span = this.startSpan(\n 'action.custom',\n {\n ...this.config.hooks.getPageAttributes(),\n ...attributes,\n ...buildRumSpanAttributes({\n spanType: RUM_SPAN_TYPE.action,\n }),\n [RUM_ATTRIBUTES.actionId]: actionId,\n [RUM_ATTRIBUTES.actionName]: name,\n [RUM_ATTRIBUTES.actionType]: 'custom',\n },\n { startTime: occurredAt },\n );\n span.end(occurredAt);\n };\n\n public readonly reportCustomEvent = ({ attributes = {}, error, name }: BkOTCustomEventPayload) => {\n if (!this.isSampled()) {\n // 未采样时静默丢弃;如需调试请把 debug 选项打开\n if (this.config.debug) {\n globalThis.console?.warn('[bk-ot] custom event dropped (not sampled):', name);\n }\n return;\n }\n\n const occurredAt = Date.now();\n const span = this.startSpan(\n `custom.${name}`,\n {\n ...this.config.hooks.getPageAttributes(),\n ...this.config.hooks.getCustomAttributes(),\n ...attributes,\n ...buildRumSpanAttributes({\n outcome: error ? RUM_SPAN_OUTCOME.error : RUM_SPAN_OUTCOME.success,\n spanType: RUM_SPAN_TYPE.custom,\n }),\n },\n { startTime: occurredAt },\n );\n\n if (error) {\n span.recordException(error);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n }\n\n span.end(occurredAt);\n };\n\n public readonly setRuntimeAttributes = (attributes: Attributes, changedAt?: number) => {\n const nextAttributes = { ...attributes };\n const effectiveChangedAt = changedAt ?? Date.now();\n if (RUM_ATTRIBUTES.sessionId in attributes) {\n // 采样以 Session 为边界重新计算,并保存在运行时私有历史中。\n const sessionId = attributes[RUM_ATTRIBUTES.sessionId];\n this.sampled =\n this.config.enabled && typeof sessionId === 'string' && sessionId.length > 0\n ? isBkOTSampled(this.config, sessionId)\n : false;\n this.runtimeContext.setSessionSampled(this.sampled, effectiveChangedAt);\n }\n this.runtimeContext.setAttributes(nextAttributes, effectiveChangedAt);\n };\n\n public readonly setTrackingConsent = async (consent: BkOTTrackingConsent) => {\n if (this.config.trackingConsent === consent) return;\n this.config.trackingConsent = consent;\n if (this.phase !== 'started') return;\n if (consent === 'granted') await this.startCollection();\n else await this.stopCollection(true);\n };\n\n public readonly setUser = (user: BkOTUserContext) => {\n this.runtimeContext.setUser(user);\n };\n\n public readonly setViewLoadingTime = () => {\n if (this.isSampled()) this.runtimeContext.dispatchViewCommand({ time: Date.now(), type: 'set_loading_time' });\n };\n\n public readonly setViewName = (name: string) => {\n if (this.isSampled()) this.runtimeContext.dispatchViewCommand({ name, type: 'set_name' });\n };\n\n public readonly shutdown = async () => {\n if (this.phase === 'stopped') {\n return;\n }\n await this.stopCollection(false);\n await this.flushProviders();\n while (this.teardownCallbacks.length) {\n this.teardownCallbacks.pop()?.();\n }\n await this.tracerProvider.shutdown();\n this.phase = 'stopped';\n };\n\n public readonly start = async () => {\n if (this.phase === 'started' || this.phase === 'starting') {\n return;\n }\n if (this.phase === 'stopped') {\n // shutdown 已经销毁了 provider/processor,此处禁止再次启动\n throw new Error('[bk-ot] instance has been shut down and cannot be restarted; create a new instance instead.');\n }\n if (!this.config.enabled) {\n this.phase = 'started';\n return;\n }\n this.phase = 'starting';\n try {\n await this.startCollection();\n if (typeof window !== 'undefined' && typeof document !== 'undefined') {\n // 页面进入后台或被丢弃前尽力导出批量数据;两个事件并存以覆盖不同浏览器生命周期。\n const flushOnPageHide = () => {\n void this.flush();\n };\n const flushOnHidden = () => {\n if (document.visibilityState === 'hidden') {\n void this.flush();\n }\n };\n window.addEventListener('pagehide', flushOnPageHide);\n document.addEventListener('visibilitychange', flushOnHidden);\n this.teardownCallbacks.push(\n () => window.removeEventListener('pagehide', flushOnPageHide),\n () => document.removeEventListener('visibilitychange', flushOnHidden),\n );\n }\n } catch (error) {\n while (this.teardownCallbacks.length) {\n this.teardownCallbacks.pop()?.();\n }\n await this.stopCollection(false);\n this.phase = 'idle';\n throw error;\n }\n this.phase = 'started';\n };\n\n public readonly startSpan = (name: string, attributes: Attributes = {}, options?: BkOTStartSpanOptions): Span => {\n const contextTime =\n options?.contextTime ?? (typeof options?.startTime === 'number' ? options.startTime : undefined);\n // 返回 provider 创建的 non-recording span,而不是让每个调用方处理 undefined。\n if (!this.isSampled() || (contextTime !== undefined && !this.runtimeContext.isSessionSampledAt(contextTime))) {\n return this.tracer.startSpan(name);\n }\n const runtimeAttributes =\n contextTime === undefined ? this.getRuntimeAttributes() : this.runtimeContext.getAttributesAt(contextTime);\n return this.tracer.startSpan(name, {\n kind: options?.kind ?? SpanKind.INTERNAL,\n links: options?.links,\n startTime: options?.startTime,\n attributes: this.applyRedact({\n ...runtimeAttributes,\n ...attributes,\n }),\n });\n };\n\n public readonly startView = (options: BkOTStartViewOptions = {}) => {\n if (this.isSampled()) this.runtimeContext.dispatchViewCommand({ options, type: 'start' });\n };\n\n public readonly tracer: BkOTRuntimeContext['tracer'];\n\n public readonly use = (plugin: BkOTPlugin): this => {\n this.assertBeforeStart('use');\n this.config.extensions.plugins?.push(plugin);\n return this;\n };\n\n public readonly useInstrumentation = (instrumentation: Instrumentation): this => {\n this.assertBeforeStart('useInstrumentation');\n if (this.config.enabled) this.config.extensions.instrumentations?.push(instrumentation);\n return this;\n };\n\n constructor(inputConfig: BkOTOptions) {\n this.config = resolveConfig(inputConfig);\n this.runtimeContext = new RumRuntimeContext({}, this.config.user);\n\n const resource = resourceFromAttributes(this.config.resourceAttributes);\n const spanProcessors = (() => {\n const exporter = wrapWithDebug(\n new OTLPTraceExporter(createExporterOptions(this.config.transport)),\n this.config.debug,\n );\n const processor =\n this.config.spanProcessor === 'simple'\n ? new SimpleSpanProcessor(exporter)\n : new BatchSpanProcessor(exporter, this.config.spanBatch);\n return [\n new FilteringSpanProcessor(processor, this.config, () =>\n this.applyRedact({\n ...this.runtimeContext.getAttributes(),\n ...this.config.hooks.getPageAttributes(),\n }),\n ),\n ];\n })();\n this.tracerProvider = new WebTracerProvider({\n resource,\n sampler: new RumSessionSampler(this.isSampled),\n spanProcessors,\n });\n this.tracer = this.tracerProvider.getTracer(BK_OT_INSTRUMENTATION_NAME);\n this.registeredInstrumentations = [];\n if (this.config.autoStart) {\n void this.start().catch(error => {\n globalThis.console?.warn('[bk-ot] auto start failed:', error);\n });\n }\n }\n}\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { BkOpenTelemetry } from './core/sdk';\n\nif (typeof window !== 'undefined') {\n Object.assign(window, {\n BkOpenTelemetry,\n });\n}\n\nexport default BkOpenTelemetry;\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,130],"mappings":"mNAKaA,EAAU,QCAjB,EAAK,gCAiBX,SAAgB,EAAwB,EAAY,CAChD,IAAM,EAAmB,IAAI,IAAI,CAAC,EAAW,CAAC,CACxC,EAAmB,IAAI,IACvB,EAAiB,EAAW,MAAM,EAAG,CAC3C,GAAI,CAAC,EAED,UAAa,GAEjB,IAAM,EAAmB,CACrB,MAAO,CAAC,EAAe,GACvB,MAAO,CAAC,EAAe,GACvB,MAAO,CAAC,EAAe,GACvB,WAAY,EAAe,GAC9B,CAED,GAAI,EAAiB,YAAc,KAC/B,OAAO,SAAsB,EAAe,CACxC,OAAO,IAAkB,GAGjC,SAAS,EAAQ,EAAG,CAEhB,OADA,EAAiB,IAAI,EAAE,CAChB,GAEX,SAAS,EAAQ,EAAG,CAEhB,OADA,EAAiB,IAAI,EAAE,CAChB,GAEX,OAAO,SAAsB,EAAe,CACxC,GAAI,EAAiB,IAAI,EAAc,CACnC,MAAO,GAEX,GAAI,EAAiB,IAAI,EAAc,CACnC,MAAO,GAEX,IAAM,EAAqB,EAAc,MAAM,EAAG,CAClD,GAAI,CAAC,EAGD,OAAO,EAAQ,EAAc,CAEj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A,MAAA,EAAS,KAAK,EAAO,CACrC,cAGT,qBAAsC,GAA2C,OAG/E,OAFA,KAAK,kBAAkB,qBAAqB,CACxC,KAAK,OAAO,WAAS,EAAA,KAAK,OAAO,WAAW,mBAAA,MAAA,EAAkB,KAAK,EAAgB,EAChF,OAIP,KAAK,OAAS,GAAc,EAAY,CACxC,KAAK,eAAiB,IAAI,GAAkB,EAAE,CAAE,KAAK,OAAO,KAAK,CAEjE,IAAM,EAAW,GAAuB,KAAK,OAAO,mBAAmB,CACjE,OAAwB,CAC5B,IAAM,EAAW,GACf,IAAI,GAAkB,GAAsB,KAAK,OAAO,UAAU,CAAC,CACnE,KAAK,OAAO,MACb,CAKD,MAAO,CACL,IAAI,GAJJ,KAAK,OAAO,gBAAkB,SAC1B,IAAI,GAAoB,EAAS,CACjC,IAAI,GAAmB,EAAU,KAAK,OAAO,UAAU,CAErB,KAAK,WACzC,KAAK,YAAA,EAAA,EAAA,EAAA,CACA,KAAK,eAAe,eAAe,CAAA,CACnC,KAAK,OAAO,MAAM,mBAAmB,CACzC,CAAC,CACH,CACF,IACC,CACJ,KAAK,eAAiB,IAAI,GAAkB,CAC1C,WACA,QAAS,IAAI,GAAkB,KAAK,UAAU,CAC9C,iBACD,CAAC,CACF,KAAK,OAAS,KAAK,eAAe,UAAU,GAA2B,CACvE,KAAK,2BAA6B,EAAE,CAChC,KAAK,OAAO,WACd,KAAU,OAAO,CAAC,MAAM,GAAS,QAC/B,EAAA,WAAW,UAAA,MAAA,EAAS,KAAK,6BAA8B,EAAM,EAC7D,UC9gBJ,OAAO,OAAW,KACpB,OAAO,OAAO,OAAQ,CACpB,mBACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"bk-rum.global.js","names":["VERSION","VERSION","VERSION","_global","API_NAME","diag","API_NAME","SamplingDecision","API_NAME","global","isFunction","VERSION","VERSION","performance","VERSION","this","this","this","this","this","api.createNoopMeter","context","api.INVALID_SPAN_CONTEXT","this"],"sources":["../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/version.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/internal/semver.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/internal/global-utils.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/types.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/diag.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/utils.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context/context.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/metrics/NoopMeter.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/context.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/context-utils.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/SamplingResult.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/span_kind.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/status.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context-api.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag-api.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/propagation.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/propagation-api.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/trace.js","../../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace-api.js","../../../node_modules/.pnpm/@opentelemetry+context-zone-peer-dep@2.7.1_@opentelemetry+api@1.9.1_zone.js@0.16.2/node_modules/@opentelemetry/context-zone-peer-dep/build/esm/util.js","../../../node_modules/.pnpm/@opentelemetry+context-zone-peer-dep@2.7.1_@opentelemetry+api@1.9.1_zone.js@0.16.2/node_modules/@opentelemetry/context-zone-peer-dep/build/esm/ZoneContextManager.js","../../../node_modules/.pnpm/zone.js@0.16.2/node_modules/zone.js/fesm2015/zone.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/trace/suppress-tracing.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/baggage/constants.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/baggage/utils.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/baggage/propagation/W3CBaggagePropagator.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/common/attributes.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/common/logging-error-handler.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/common/global-error-handler.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/platform/browser/environment.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/version.js","../../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.40.0/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/semconv.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/platform/browser/sdk-info.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/platform/browser/index.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/common/time.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/ExportResult.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/propagation/composite.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/internal/validators.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/trace/TraceState.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/trace/W3CTraceContextPropagator.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/utils/lodash.merge.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/utils/merge.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/utils/promise.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/utils/callback.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/internal/exporter.js","../../../node_modules/.pnpm/@opentelemetry+core@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/index.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/OTLPExporterBase.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/types.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/shared-configuration.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/bounded-queue-export-promise-handler.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/logging-response-handler.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-export-delegate.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-network-export-delegate.js","../../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/esm/default-service-name.js","../../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/esm/utils.js","../../../node_modules/.pnpm/@opentelemetry+resources@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/esm/ResourceImpl.js","../../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/esm/common/internal.js","../../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/esm/common/utils.js","../../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/esm/trace/internal.js","../../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/esm/trace/json/trace.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/retrying-transport.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/is-export-retryable.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/transport/fetch-transport.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-browser-http-export-delegate.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/util.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-http-configuration.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/convert-legacy-http-options.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/convert-legacy-browser-http-options.js","../../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/create-legacy-browser-delegate.js","../../../node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.217.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/esm/platform/browser/OTLPTraceExporter.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/enums.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/Span.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/Sampler.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/AlwaysOffSampler.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/AlwaysOnSampler.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/ParentBasedSampler.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/sampler/TraceIdRatioBasedSampler.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/config.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/utility.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/export/BatchSpanProcessorBase.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/platform/browser/export/BatchSpanProcessor.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/platform/browser/RandomIdGenerator.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/semconv.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/TracerMetrics.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/version.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/Tracer.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/MultiSpanProcessor.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/BasicTracerProvider.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/export/SimpleSpanProcessor.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-web@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-web/build/esm/StackContextManager.js","../../../node_modules/.pnpm/@opentelemetry+sdk-trace-web@2.7.1_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-web/build/esm/WebTracerProvider.js","../src/core/id.ts","../src/core/url.ts","../src/schema/attributes.ts","../src/schema/span.ts","../src/plugins/action.ts","../src/plugins/activity.ts","../src/core/page-activity.ts","../src/plugins/blank-screen.ts","../src/core/processor.ts","../src/core/request-timing.ts","../src/core/trace-context.ts","../src/plugins/resource.ts","../src/plugins/common.ts","../src/plugins/csp-violation.ts","../src/core/hash.ts","../src/plugins/device.ts","../src/plugins/error.ts","../src/plugins/long-task.ts","../src/core/route-observer.ts","../src/plugins/page-view.ts","../src/plugins/session-state.ts","../src/plugins/session.ts","../../../node_modules/.pnpm/web-vitals@5.2.0/node_modules/web-vitals/dist/web-vitals.attribution.js","../src/plugins/web-vitals.ts","../src/plugins/websocket.ts","../src/core/action-activity.ts","../package.json","../src/core/config.ts","../src/core/plugin.ts","../src/core/runtime-context.ts","../src/core/sampling.ts","../src/core/sdk.ts","../src/browser.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '1.9.1';\n//# sourceMappingURL=version.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { VERSION } from '../version';\nconst re = /^(\\d+)\\.(\\d+)\\.(\\d+)(-(.+))?$/;\n/**\n * Create a function to test an API version to see if it is compatible with the provided ownVersion.\n *\n * The returned function has the following semantics:\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param ownVersion version which should be checked against\n */\nexport function _makeCompatibilityCheck(ownVersion) {\n const acceptedVersions = new Set([ownVersion]);\n const rejectedVersions = new Set();\n const myVersionMatch = ownVersion.match(re);\n if (!myVersionMatch) {\n // we cannot guarantee compatibility so we always return noop\n return () => false;\n }\n const ownVersionParsed = {\n major: +myVersionMatch[1],\n minor: +myVersionMatch[2],\n patch: +myVersionMatch[3],\n prerelease: myVersionMatch[4],\n };\n // if ownVersion has a prerelease tag, versions must match exactly\n if (ownVersionParsed.prerelease != null) {\n return function isExactmatch(globalVersion) {\n return globalVersion === ownVersion;\n };\n }\n function _reject(v) {\n rejectedVersions.add(v);\n return false;\n }\n function _accept(v) {\n acceptedVersions.add(v);\n return true;\n }\n return function isCompatible(globalVersion) {\n if (acceptedVersions.has(globalVersion)) {\n return true;\n }\n if (rejectedVersions.has(globalVersion)) {\n return false;\n }\n const globalVersionMatch = globalVersion.match(re);\n if (!globalVersionMatch) {\n // cannot parse other version\n // we cannot guarantee compatibility so we always noop\n return _reject(globalVersion);\n }\n const globalVersionParsed = {\n major: +globalVersionMatch[1],\n minor: +globalVersionMatch[2],\n patch: +globalVersionMatch[3],\n prerelease: globalVersionMatch[4],\n };\n // if globalVersion has a prerelease tag, versions must match exactly\n if (globalVersionParsed.prerelease != null) {\n return _reject(globalVersion);\n }\n // major versions must match\n if (ownVersionParsed.major !== globalVersionParsed.major) {\n return _reject(globalVersion);\n }\n if (ownVersionParsed.major === 0) {\n if (ownVersionParsed.minor === globalVersionParsed.minor &&\n ownVersionParsed.patch <= globalVersionParsed.patch) {\n return _accept(globalVersion);\n }\n return _reject(globalVersion);\n }\n if (ownVersionParsed.minor <= globalVersionParsed.minor) {\n return _accept(globalVersion);\n }\n return _reject(globalVersion);\n };\n}\n/**\n * Test an API version to see if it is compatible with this API.\n *\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param version version of the API requesting an instance of the global API\n */\nexport const isCompatible = _makeCompatibilityCheck(VERSION);\n//# sourceMappingURL=semver.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { VERSION } from '../version';\nimport { isCompatible } from './semver';\nconst major = VERSION.split('.')[0];\nconst GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(`opentelemetry.js.api.${major}`);\nconst _global = (typeof globalThis === 'object'\n ? globalThis\n : typeof self === 'object'\n ? self\n : typeof window === 'object'\n ? window\n : typeof global === 'object'\n ? global\n : {});\nexport function registerGlobal(type, instance, diag, allowOverride = false) {\n var _a;\n const api = (_global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : {\n version: VERSION,\n });\n if (!allowOverride && api[type]) {\n // already registered an API of this type\n const err = new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${type}`);\n diag.error(err.stack || err.message);\n return false;\n }\n if (api.version !== VERSION) {\n // All registered APIs must be of the same version exactly\n const err = new Error(`@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${VERSION}`);\n diag.error(err.stack || err.message);\n return false;\n }\n api[type] = instance;\n diag.debug(`@opentelemetry/api: Registered a global for ${type} v${VERSION}.`);\n return true;\n}\nexport function getGlobal(type) {\n var _a, _b;\n const globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version;\n if (!globalVersion || !isCompatible(globalVersion)) {\n return;\n }\n return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type];\n}\nexport function unregisterGlobal(type, diag) {\n diag.debug(`@opentelemetry/api: Unregistering a global for ${type} v${VERSION}.`);\n const api = _global[GLOBAL_OPENTELEMETRY_API_KEY];\n if (api) {\n delete api[type];\n }\n}\n//# sourceMappingURL=global-utils.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { getGlobal } from '../internal/global-utils';\n/**\n * Component Logger which is meant to be used as part of any component which\n * will add automatically additional namespace in front of the log message.\n * It will then forward all message to global diag logger\n * @example\n * const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' });\n * cLogger.debug('test');\n * // @opentelemetry/instrumentation-http test\n */\nexport class DiagComponentLogger {\n constructor(props) {\n this._namespace = props.namespace || 'DiagComponentLogger';\n }\n debug(...args) {\n return logProxy('debug', this._namespace, args);\n }\n error(...args) {\n return logProxy('error', this._namespace, args);\n }\n info(...args) {\n return logProxy('info', this._namespace, args);\n }\n warn(...args) {\n return logProxy('warn', this._namespace, args);\n }\n verbose(...args) {\n return logProxy('verbose', this._namespace, args);\n }\n}\nfunction logProxy(funcName, namespace, args) {\n const logger = getGlobal('diag');\n // shortcut if logger not set\n if (!logger) {\n return;\n }\n return logger[funcName](namespace, ...args);\n}\n//# sourceMappingURL=ComponentLogger.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * Defines the available internal logging levels for the diagnostic logger, the numeric values\n * of the levels are defined to match the original values from the initial LogLevel to avoid\n * compatibility/migration issues for any implementation that assume the numeric ordering.\n */\nexport var DiagLogLevel;\n(function (DiagLogLevel) {\n /** Diagnostic Logging level setting to disable all logging (except and forced logs) */\n DiagLogLevel[DiagLogLevel[\"NONE\"] = 0] = \"NONE\";\n /** Identifies an error scenario */\n DiagLogLevel[DiagLogLevel[\"ERROR\"] = 30] = \"ERROR\";\n /** Identifies a warning scenario */\n DiagLogLevel[DiagLogLevel[\"WARN\"] = 50] = \"WARN\";\n /** General informational log message */\n DiagLogLevel[DiagLogLevel[\"INFO\"] = 60] = \"INFO\";\n /** General debug log message */\n DiagLogLevel[DiagLogLevel[\"DEBUG\"] = 70] = \"DEBUG\";\n /**\n * Detailed trace level logging should only be used for development, should only be set\n * in a development environment.\n */\n DiagLogLevel[DiagLogLevel[\"VERBOSE\"] = 80] = \"VERBOSE\";\n /** Used to set the logging level to include all logging */\n DiagLogLevel[DiagLogLevel[\"ALL\"] = 9999] = \"ALL\";\n})(DiagLogLevel || (DiagLogLevel = {}));\n//# sourceMappingURL=types.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { DiagLogLevel } from '../types';\nexport function createLogLevelDiagLogger(maxLevel, logger) {\n if (maxLevel < DiagLogLevel.NONE) {\n maxLevel = DiagLogLevel.NONE;\n }\n else if (maxLevel > DiagLogLevel.ALL) {\n maxLevel = DiagLogLevel.ALL;\n }\n // In case the logger is null or undefined\n logger = logger || {};\n function _filterFunc(funcName, theLevel) {\n const theFunc = logger[funcName];\n if (typeof theFunc === 'function' && maxLevel >= theLevel) {\n return theFunc.bind(logger);\n }\n return function () { };\n }\n return {\n error: _filterFunc('error', DiagLogLevel.ERROR),\n warn: _filterFunc('warn', DiagLogLevel.WARN),\n info: _filterFunc('info', DiagLogLevel.INFO),\n debug: _filterFunc('debug', DiagLogLevel.DEBUG),\n verbose: _filterFunc('verbose', DiagLogLevel.VERBOSE),\n };\n}\n//# sourceMappingURL=logLevelLogger.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { DiagComponentLogger } from '../diag/ComponentLogger';\nimport { createLogLevelDiagLogger } from '../diag/internal/logLevelLogger';\nimport { DiagLogLevel } from '../diag/types';\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nconst API_NAME = 'diag';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry internal\n * diagnostic API\n *\n * @since 1.0.0\n */\nexport class DiagAPI {\n /** Get the singleton instance of the DiagAPI API */\n static instance() {\n if (!this._instance) {\n this._instance = new DiagAPI();\n }\n return this._instance;\n }\n /**\n * Private internal constructor\n * @private\n */\n constructor() {\n function _logProxy(funcName) {\n return function (...args) {\n const logger = getGlobal('diag');\n // shortcut if logger not set\n if (!logger)\n return;\n return logger[funcName](...args);\n };\n }\n // Using self local variable for minification purposes as 'this' cannot be minified\n const self = this;\n // DiagAPI specific functions\n const setLogger = (logger, optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }) => {\n var _a, _b, _c;\n if (logger === self) {\n // There isn't much we can do here.\n // Logging to the console might break the user application.\n // Try to log to self. If a logger was previously registered it will receive the log.\n const err = new Error('Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation');\n self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);\n return false;\n }\n if (typeof optionsOrLogLevel === 'number') {\n optionsOrLogLevel = {\n logLevel: optionsOrLogLevel,\n };\n }\n const oldLogger = getGlobal('diag');\n const newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger);\n // There already is an logger registered. We'll let it know before overwriting it.\n if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {\n const stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : '<failed to generate stacktrace>';\n oldLogger.warn(`Current logger will be overwritten from ${stack}`);\n newLogger.warn(`Current logger will overwrite one already registered from ${stack}`);\n }\n return registerGlobal('diag', newLogger, self, true);\n };\n self.setLogger = setLogger;\n self.disable = () => {\n unregisterGlobal(API_NAME, self);\n };\n self.createComponentLogger = (options) => {\n return new DiagComponentLogger(options);\n };\n self.verbose = _logProxy('verbose');\n self.debug = _logProxy('debug');\n self.info = _logProxy('info');\n self.warn = _logProxy('warn');\n self.error = _logProxy('error');\n }\n}\n//# sourceMappingURL=diag.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport class BaggageImpl {\n constructor(entries) {\n this._entries = entries ? new Map(entries) : new Map();\n }\n getEntry(key) {\n const entry = this._entries.get(key);\n if (!entry) {\n return undefined;\n }\n return Object.assign({}, entry);\n }\n getAllEntries() {\n return Array.from(this._entries.entries());\n }\n setEntry(key, entry) {\n const newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.set(key, entry);\n return newBaggage;\n }\n removeEntry(key) {\n const newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.delete(key);\n return newBaggage;\n }\n removeEntries(...keys) {\n const newBaggage = new BaggageImpl(this._entries);\n for (const key of keys) {\n newBaggage._entries.delete(key);\n }\n return newBaggage;\n }\n clear() {\n return new BaggageImpl();\n }\n}\n//# sourceMappingURL=baggage-impl.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * Symbol used to make BaggageEntryMetadata an opaque type\n */\nexport const baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata');\n//# sourceMappingURL=symbol.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { DiagAPI } from '../api/diag';\nimport { BaggageImpl } from './internal/baggage-impl';\nimport { baggageEntryMetadataSymbol } from './internal/symbol';\nconst diag = DiagAPI.instance();\n/**\n * Create a new Baggage with optional entries\n *\n * @param entries An array of baggage entries the new baggage should contain\n */\nexport function createBaggage(entries = {}) {\n return new BaggageImpl(new Map(Object.entries(entries)));\n}\n/**\n * Create a serializable BaggageEntryMetadata object from a string.\n *\n * @param str string metadata. Format is currently not defined by the spec and has no special meaning.\n *\n * @since 1.0.0\n */\nexport function baggageEntryMetadataFromString(str) {\n if (typeof str !== 'string') {\n diag.error(`Cannot create baggage metadata from unknown type: ${typeof str}`);\n str = '';\n }\n return {\n __TYPE__: baggageEntryMetadataSymbol,\n toString() {\n return str;\n },\n };\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * Get a key to uniquely identify a context value\n *\n * @since 1.0.0\n */\nexport function createContextKey(description) {\n // The specification states that for the same input, multiple calls should\n // return different keys. Due to the nature of the JS dependency management\n // system, this creates problems where multiple versions of some package\n // could hold different keys for the same property.\n //\n // Therefore, we use Symbol.for which returns the same key for the same input.\n return Symbol.for(description);\n}\nclass BaseContext {\n /**\n * Construct a new context which inherits values from an optional parent context.\n *\n * @param parentContext a context from which to inherit values\n */\n constructor(parentContext) {\n // for minification\n const self = this;\n self._currentContext = parentContext ? new Map(parentContext) : new Map();\n self.getValue = (key) => self._currentContext.get(key);\n self.setValue = (key, value) => {\n const context = new BaseContext(self._currentContext);\n context._currentContext.set(key, value);\n return context;\n };\n self.deleteValue = (key) => {\n const context = new BaseContext(self._currentContext);\n context._currentContext.delete(key);\n return context;\n };\n }\n}\n/**\n * The root context is used as the default parent context when there is no active context\n *\n * @since 1.0.0\n */\nexport const ROOT_CONTEXT = new BaseContext();\n//# sourceMappingURL=context.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * NoopMeter is a noop implementation of the {@link Meter} interface. It reuses\n * constant NoopMetrics for all of its methods.\n */\nexport class NoopMeter {\n constructor() { }\n /**\n * @see {@link Meter.createGauge}\n */\n createGauge(_name, _options) {\n return NOOP_GAUGE_METRIC;\n }\n /**\n * @see {@link Meter.createHistogram}\n */\n createHistogram(_name, _options) {\n return NOOP_HISTOGRAM_METRIC;\n }\n /**\n * @see {@link Meter.createCounter}\n */\n createCounter(_name, _options) {\n return NOOP_COUNTER_METRIC;\n }\n /**\n * @see {@link Meter.createUpDownCounter}\n */\n createUpDownCounter(_name, _options) {\n return NOOP_UP_DOWN_COUNTER_METRIC;\n }\n /**\n * @see {@link Meter.createObservableGauge}\n */\n createObservableGauge(_name, _options) {\n return NOOP_OBSERVABLE_GAUGE_METRIC;\n }\n /**\n * @see {@link Meter.createObservableCounter}\n */\n createObservableCounter(_name, _options) {\n return NOOP_OBSERVABLE_COUNTER_METRIC;\n }\n /**\n * @see {@link Meter.createObservableUpDownCounter}\n */\n createObservableUpDownCounter(_name, _options) {\n return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;\n }\n /**\n * @see {@link Meter.addBatchObservableCallback}\n */\n addBatchObservableCallback(_callback, _observables) { }\n /**\n * @see {@link Meter.removeBatchObservableCallback}\n */\n removeBatchObservableCallback(_callback) { }\n}\nexport class NoopMetric {\n}\nexport class NoopCounterMetric extends NoopMetric {\n add(_value, _attributes) { }\n}\nexport class NoopUpDownCounterMetric extends NoopMetric {\n add(_value, _attributes) { }\n}\nexport class NoopGaugeMetric extends NoopMetric {\n record(_value, _attributes) { }\n}\nexport class NoopHistogramMetric extends NoopMetric {\n record(_value, _attributes) { }\n}\nexport class NoopObservableMetric {\n addCallback(_callback) { }\n removeCallback(_callback) { }\n}\nexport class NoopObservableCounterMetric extends NoopObservableMetric {\n}\nexport class NoopObservableGaugeMetric extends NoopObservableMetric {\n}\nexport class NoopObservableUpDownCounterMetric extends NoopObservableMetric {\n}\nexport const NOOP_METER = new NoopMeter();\n// Synchronous instruments\nexport const NOOP_COUNTER_METRIC = new NoopCounterMetric();\nexport const NOOP_GAUGE_METRIC = new NoopGaugeMetric();\nexport const NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric();\nexport const NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric();\n// Asynchronous instruments\nexport const NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric();\nexport const NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric();\nexport const NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric();\n/**\n * Create a no-op Meter\n *\n * @since 1.3.0\n */\nexport function createNoopMeter() {\n return NOOP_METER;\n}\n//# sourceMappingURL=NoopMeter.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @since 1.0.0\n */\nexport const defaultTextMapGetter = {\n get(carrier, key) {\n if (carrier == null) {\n return undefined;\n }\n return carrier[key];\n },\n keys(carrier) {\n if (carrier == null) {\n return [];\n }\n return Object.keys(carrier);\n },\n};\n/**\n * @since 1.0.0\n */\nexport const defaultTextMapSetter = {\n set(carrier, key, value) {\n if (carrier == null) {\n return;\n }\n carrier[key] = value;\n },\n};\n//# sourceMappingURL=TextMapPropagator.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ROOT_CONTEXT } from './context';\nexport class NoopContextManager {\n active() {\n return ROOT_CONTEXT;\n }\n with(_context, fn, thisArg, ...args) {\n return fn.call(thisArg, ...args);\n }\n bind(_context, target) {\n return target;\n }\n enable() {\n return this;\n }\n disable() {\n return this;\n }\n}\n//# sourceMappingURL=NoopContextManager.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { NoopContextManager } from '../context/NoopContextManager';\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nimport { DiagAPI } from './diag';\nconst API_NAME = 'context';\nconst NOOP_CONTEXT_MANAGER = new NoopContextManager();\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Context API\n *\n * @since 1.0.0\n */\nexport class ContextAPI {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n constructor() { }\n /** Get the singleton instance of the Context API */\n static getInstance() {\n if (!this._instance) {\n this._instance = new ContextAPI();\n }\n return this._instance;\n }\n /**\n * Set the current context manager.\n *\n * @returns true if the context manager was successfully registered, else false\n */\n setGlobalContextManager(contextManager) {\n return registerGlobal(API_NAME, contextManager, DiagAPI.instance());\n }\n /**\n * Get the currently active context\n */\n active() {\n return this._getContextManager().active();\n }\n /**\n * Execute a function with an active context\n *\n * @param context context to be active during function execution\n * @param fn function to execute in a context\n * @param thisArg optional receiver to be used for calling fn\n * @param args optional arguments forwarded to fn\n */\n with(context, fn, thisArg, ...args) {\n return this._getContextManager().with(context, fn, thisArg, ...args);\n }\n /**\n * Bind a context to a target function or event emitter\n *\n * @param context context to bind to the event emitter or function. Defaults to the currently active context\n * @param target function or event emitter to bind\n */\n bind(context, target) {\n return this._getContextManager().bind(context, target);\n }\n _getContextManager() {\n return getGlobal(API_NAME) || NOOP_CONTEXT_MANAGER;\n }\n /** Disable and remove the global context manager */\n disable() {\n this._getContextManager().disable();\n unregisterGlobal(API_NAME, DiagAPI.instance());\n }\n}\n//# sourceMappingURL=context.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @since 1.0.0\n */\nexport var TraceFlags;\n(function (TraceFlags) {\n /** Represents no flag set. */\n TraceFlags[TraceFlags[\"NONE\"] = 0] = \"NONE\";\n /** Bit to represent whether trace is sampled in trace flags. */\n TraceFlags[TraceFlags[\"SAMPLED\"] = 1] = \"SAMPLED\";\n})(TraceFlags || (TraceFlags = {}));\n//# sourceMappingURL=trace_flags.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { TraceFlags } from './trace_flags';\n/**\n * @since 1.0.0\n */\nexport const INVALID_SPANID = '0000000000000000';\n/**\n * @since 1.0.0\n */\nexport const INVALID_TRACEID = '00000000000000000000000000000000';\n/**\n * @since 1.0.0\n */\nexport const INVALID_SPAN_CONTEXT = {\n traceId: INVALID_TRACEID,\n spanId: INVALID_SPANID,\n traceFlags: TraceFlags.NONE,\n};\n//# sourceMappingURL=invalid-span-constants.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { INVALID_SPAN_CONTEXT } from './invalid-span-constants';\n/**\n * The NonRecordingSpan is the default {@link Span} that is used when no Span\n * implementation is available. All operations are no-op including context\n * propagation.\n */\nexport class NonRecordingSpan {\n constructor(spanContext = INVALID_SPAN_CONTEXT) {\n this._spanContext = spanContext;\n }\n // Returns a SpanContext.\n spanContext() {\n return this._spanContext;\n }\n // By default does nothing\n setAttribute(_key, _value) {\n return this;\n }\n // By default does nothing\n setAttributes(_attributes) {\n return this;\n }\n // By default does nothing\n addEvent(_name, _attributes) {\n return this;\n }\n addLink(_link) {\n return this;\n }\n addLinks(_links) {\n return this;\n }\n // By default does nothing\n setStatus(_status) {\n return this;\n }\n // By default does nothing\n updateName(_name) {\n return this;\n }\n // By default does nothing\n end(_endTime) { }\n // isRecording always returns false for NonRecordingSpan.\n isRecording() {\n return false;\n }\n // By default does nothing\n recordException(_exception, _time) { }\n}\n//# sourceMappingURL=NonRecordingSpan.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createContextKey } from '../context/context';\nimport { NonRecordingSpan } from './NonRecordingSpan';\nimport { ContextAPI } from '../api/context';\n/**\n * span key\n */\nconst SPAN_KEY = createContextKey('OpenTelemetry Context Key SPAN');\n/**\n * Return the span if one exists\n *\n * @param context context to get span from\n */\nexport function getSpan(context) {\n return context.getValue(SPAN_KEY) || undefined;\n}\n/**\n * Gets the span from the current context, if one exists.\n */\nexport function getActiveSpan() {\n return getSpan(ContextAPI.getInstance().active());\n}\n/**\n * Set the span on a context\n *\n * @param context context to use as parent\n * @param span span to set active\n */\nexport function setSpan(context, span) {\n return context.setValue(SPAN_KEY, span);\n}\n/**\n * Remove current span stored in the context\n *\n * @param context context to delete span from\n */\nexport function deleteSpan(context) {\n return context.deleteValue(SPAN_KEY);\n}\n/**\n * Wrap span context in a NoopSpan and set as span in a new\n * context\n *\n * @param context context to set active span on\n * @param spanContext span context to be wrapped\n */\nexport function setSpanContext(context, spanContext) {\n return setSpan(context, new NonRecordingSpan(spanContext));\n}\n/**\n * Get the span context of the span if it exists.\n *\n * @param context context to get values from\n */\nexport function getSpanContext(context) {\n var _a;\n return (_a = getSpan(context)) === null || _a === void 0 ? void 0 : _a.spanContext();\n}\n//# sourceMappingURL=context-utils.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { INVALID_SPANID, INVALID_TRACEID } from './invalid-span-constants';\nimport { NonRecordingSpan } from './NonRecordingSpan';\n// Valid characters (0-9, a-f, A-F) are marked as 1.\nconst isHex = new Uint8Array([\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,\n]);\nfunction isValidHex(id, length) {\n // As of 1.9.0 the id was allowed to be a non-string value,\n // even though it was not possible in the types.\n if (typeof id !== 'string' || id.length !== length)\n return false;\n let r = 0;\n for (let i = 0; i < id.length; i += 4) {\n r +=\n (isHex[id.charCodeAt(i)] | 0) +\n (isHex[id.charCodeAt(i + 1)] | 0) +\n (isHex[id.charCodeAt(i + 2)] | 0) +\n (isHex[id.charCodeAt(i + 3)] | 0);\n }\n return r === length;\n}\n/**\n * @since 1.0.0\n */\nexport function isValidTraceId(traceId) {\n return isValidHex(traceId, 32) && traceId !== INVALID_TRACEID;\n}\n/**\n * @since 1.0.0\n */\nexport function isValidSpanId(spanId) {\n return isValidHex(spanId, 16) && spanId !== INVALID_SPANID;\n}\n/**\n * Returns true if this {@link SpanContext} is valid.\n * @return true if this {@link SpanContext} is valid.\n *\n * @since 1.0.0\n */\nexport function isSpanContextValid(spanContext) {\n return (isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId));\n}\n/**\n * Wrap the given {@link SpanContext} in a new non-recording {@link Span}\n *\n * @param spanContext span context to be wrapped\n * @returns a new non-recording {@link Span} with the provided context\n */\nexport function wrapSpanContext(spanContext) {\n return new NonRecordingSpan(spanContext);\n}\n//# sourceMappingURL=spancontext-utils.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ContextAPI } from '../api/context';\nimport { getSpanContext, setSpan } from '../trace/context-utils';\nimport { NonRecordingSpan } from './NonRecordingSpan';\nimport { isSpanContextValid } from './spancontext-utils';\nconst contextApi = ContextAPI.getInstance();\n/**\n * No-op implementations of {@link Tracer}.\n */\nexport class NoopTracer {\n // startSpan starts a noop span.\n startSpan(name, options, context = contextApi.active()) {\n const root = Boolean(options === null || options === void 0 ? void 0 : options.root);\n if (root) {\n return new NonRecordingSpan();\n }\n const parentFromContext = context && getSpanContext(context);\n if (isSpanContext(parentFromContext) &&\n isSpanContextValid(parentFromContext)) {\n return new NonRecordingSpan(parentFromContext);\n }\n else {\n return new NonRecordingSpan();\n }\n }\n startActiveSpan(name, arg2, arg3, arg4) {\n let opts;\n let ctx;\n let fn;\n if (arguments.length < 2) {\n return;\n }\n else if (arguments.length === 2) {\n fn = arg2;\n }\n else if (arguments.length === 3) {\n opts = arg2;\n fn = arg3;\n }\n else {\n opts = arg2;\n ctx = arg3;\n fn = arg4;\n }\n const parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();\n const span = this.startSpan(name, opts, parentContext);\n const contextWithSpanSet = setSpan(parentContext, span);\n return contextApi.with(contextWithSpanSet, fn, undefined, span);\n }\n}\nfunction isSpanContext(spanContext) {\n return (spanContext !== null &&\n typeof spanContext === 'object' &&\n 'spanId' in spanContext &&\n typeof spanContext['spanId'] === 'string' &&\n 'traceId' in spanContext &&\n typeof spanContext['traceId'] === 'string' &&\n 'traceFlags' in spanContext &&\n typeof spanContext['traceFlags'] === 'number');\n}\n//# sourceMappingURL=NoopTracer.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { NoopTracer } from './NoopTracer';\nconst NOOP_TRACER = new NoopTracer();\n/**\n * Proxy tracer provided by the proxy tracer provider\n *\n * @since 1.0.0\n */\nexport class ProxyTracer {\n constructor(provider, name, version, options) {\n this._provider = provider;\n this.name = name;\n this.version = version;\n this.options = options;\n }\n startSpan(name, options, context) {\n return this._getTracer().startSpan(name, options, context);\n }\n startActiveSpan(_name, _options, _context, _fn) {\n const tracer = this._getTracer();\n return Reflect.apply(tracer.startActiveSpan, tracer, arguments);\n }\n /**\n * Try to get a tracer from the proxy tracer provider.\n * If the proxy tracer provider has no delegate, return a noop tracer.\n */\n _getTracer() {\n if (this._delegate) {\n return this._delegate;\n }\n const tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);\n if (!tracer) {\n return NOOP_TRACER;\n }\n this._delegate = tracer;\n return this._delegate;\n }\n}\n//# sourceMappingURL=ProxyTracer.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { NoopTracer } from './NoopTracer';\n/**\n * An implementation of the {@link TracerProvider} which returns an impotent\n * Tracer for all calls to `getTracer`.\n *\n * All operations are no-op.\n */\nexport class NoopTracerProvider {\n getTracer(_name, _version, _options) {\n return new NoopTracer();\n }\n}\n//# sourceMappingURL=NoopTracerProvider.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ProxyTracer } from './ProxyTracer';\nimport { NoopTracerProvider } from './NoopTracerProvider';\nconst NOOP_TRACER_PROVIDER = new NoopTracerProvider();\n/**\n * Tracer provider which provides {@link ProxyTracer}s.\n *\n * Before a delegate is set, tracers provided are NoOp.\n * When a delegate is set, traces are provided from the delegate.\n * When a delegate is set after tracers have already been provided,\n * all tracers already provided will use the provided delegate implementation.\n *\n * @deprecated This will be removed in the next major version.\n * @since 1.0.0\n */\nexport class ProxyTracerProvider {\n /**\n * Get a {@link ProxyTracer}\n */\n getTracer(name, version, options) {\n var _a;\n return ((_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer(this, name, version, options));\n }\n getDelegate() {\n var _a;\n return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER;\n }\n /**\n * Set the delegate tracer provider\n */\n setDelegate(delegate) {\n this._delegate = delegate;\n }\n getDelegateTracer(name, version, options) {\n var _a;\n return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options);\n }\n}\n//# sourceMappingURL=ProxyTracerProvider.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @deprecated use the one declared in @opentelemetry/sdk-trace-base instead.\n * A sampling decision that determines how a {@link Span} will be recorded\n * and collected.\n *\n * @since 1.0.0\n */\nexport var SamplingDecision;\n(function (SamplingDecision) {\n /**\n * `Span.isRecording() === false`, span will not be recorded and all events\n * and attributes will be dropped.\n */\n SamplingDecision[SamplingDecision[\"NOT_RECORD\"] = 0] = \"NOT_RECORD\";\n /**\n * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags}\n * MUST NOT be set.\n */\n SamplingDecision[SamplingDecision[\"RECORD\"] = 1] = \"RECORD\";\n /**\n * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags}\n * MUST be set.\n */\n SamplingDecision[SamplingDecision[\"RECORD_AND_SAMPLED\"] = 2] = \"RECORD_AND_SAMPLED\";\n})(SamplingDecision || (SamplingDecision = {}));\n//# sourceMappingURL=SamplingResult.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * @since 1.0.0\n */\nexport var SpanKind;\n(function (SpanKind) {\n /** Default value. Indicates that the span is used internally. */\n SpanKind[SpanKind[\"INTERNAL\"] = 0] = \"INTERNAL\";\n /**\n * Indicates that the span covers server-side handling of an RPC or other\n * remote request.\n */\n SpanKind[SpanKind[\"SERVER\"] = 1] = \"SERVER\";\n /**\n * Indicates that the span covers the client-side wrapper around an RPC or\n * other remote request.\n */\n SpanKind[SpanKind[\"CLIENT\"] = 2] = \"CLIENT\";\n /**\n * Indicates that the span describes producer sending a message to a\n * broker. Unlike client and server, there is no direct critical path latency\n * relationship between producer and consumer spans.\n */\n SpanKind[SpanKind[\"PRODUCER\"] = 3] = \"PRODUCER\";\n /**\n * Indicates that the span describes consumer receiving a message from a\n * broker. Unlike client and server, there is no direct critical path latency\n * relationship between producer and consumer spans.\n */\n SpanKind[SpanKind[\"CONSUMER\"] = 4] = \"CONSUMER\";\n})(SpanKind || (SpanKind = {}));\n//# sourceMappingURL=span_kind.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * An enumeration of status codes.\n *\n * @since 1.0.0\n */\nexport var SpanStatusCode;\n(function (SpanStatusCode) {\n /**\n * The default status.\n */\n SpanStatusCode[SpanStatusCode[\"UNSET\"] = 0] = \"UNSET\";\n /**\n * The operation has been validated by an Application developer or\n * Operator to have completed successfully.\n */\n SpanStatusCode[SpanStatusCode[\"OK\"] = 1] = \"OK\";\n /**\n * The operation contains an error.\n */\n SpanStatusCode[SpanStatusCode[\"ERROR\"] = 2] = \"ERROR\";\n})(SpanStatusCode || (SpanStatusCode = {}));\n//# sourceMappingURL=status.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { ContextAPI } from './api/context';\n/**\n * Entrypoint for context API\n * @since 1.0.0\n */\nexport const context = ContextAPI.getInstance();\n//# sourceMappingURL=context-api.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { DiagAPI } from './api/diag';\n/**\n * Entrypoint for Diag API.\n * Defines Diagnostic handler used for internal diagnostic logging operations.\n * The default provides a Noop DiagLogger implementation which may be changed via the\n * diag.setLogger(logger: DiagLogger) function.\n *\n * @since 1.0.0\n */\nexport const diag = DiagAPI.instance();\n//# sourceMappingURL=diag-api.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * No-op implementations of {@link TextMapPropagator}.\n */\nexport class NoopTextMapPropagator {\n /** Noop inject function does nothing */\n inject(_context, _carrier) { }\n /** Noop extract function does nothing and returns the input context */\n extract(context, _carrier) {\n return context;\n }\n fields() {\n return [];\n }\n}\n//# sourceMappingURL=NoopTextMapPropagator.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ContextAPI } from '../api/context';\nimport { createContextKey } from '../context/context';\n/**\n * Baggage key\n */\nconst BAGGAGE_KEY = createContextKey('OpenTelemetry Baggage Key');\n/**\n * Retrieve the current baggage from the given context\n *\n * @param {Context} Context that manage all context values\n * @returns {Baggage} Extracted baggage from the context\n */\nexport function getBaggage(context) {\n return context.getValue(BAGGAGE_KEY) || undefined;\n}\n/**\n * Retrieve the current baggage from the active/current context\n *\n * @returns {Baggage} Extracted baggage from the context\n */\nexport function getActiveBaggage() {\n return getBaggage(ContextAPI.getInstance().active());\n}\n/**\n * Store a baggage in the given context\n *\n * @param {Context} Context that manage all context values\n * @param {Baggage} baggage that will be set in the actual context\n */\nexport function setBaggage(context, baggage) {\n return context.setValue(BAGGAGE_KEY, baggage);\n}\n/**\n * Delete the baggage stored in the given context\n *\n * @param {Context} Context that manage all context values\n */\nexport function deleteBaggage(context) {\n return context.deleteValue(BAGGAGE_KEY);\n}\n//# sourceMappingURL=context-helpers.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nimport { NoopTextMapPropagator } from '../propagation/NoopTextMapPropagator';\nimport { defaultTextMapGetter, defaultTextMapSetter, } from '../propagation/TextMapPropagator';\nimport { getBaggage, getActiveBaggage, setBaggage, deleteBaggage, } from '../baggage/context-helpers';\nimport { createBaggage } from '../baggage/utils';\nimport { DiagAPI } from './diag';\nconst API_NAME = 'propagation';\nconst NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Propagation API\n *\n * @since 1.0.0\n */\nexport class PropagationAPI {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n constructor() {\n this.createBaggage = createBaggage;\n this.getBaggage = getBaggage;\n this.getActiveBaggage = getActiveBaggage;\n this.setBaggage = setBaggage;\n this.deleteBaggage = deleteBaggage;\n }\n /** Get the singleton instance of the Propagator API */\n static getInstance() {\n if (!this._instance) {\n this._instance = new PropagationAPI();\n }\n return this._instance;\n }\n /**\n * Set the current propagator.\n *\n * @returns true if the propagator was successfully registered, else false\n */\n setGlobalPropagator(propagator) {\n return registerGlobal(API_NAME, propagator, DiagAPI.instance());\n }\n /**\n * Inject context into a carrier to be propagated inter-process\n *\n * @param context Context carrying tracing data to inject\n * @param carrier carrier to inject context into\n * @param setter Function used to set values on the carrier\n */\n inject(context, carrier, setter = defaultTextMapSetter) {\n return this._getGlobalPropagator().inject(context, carrier, setter);\n }\n /**\n * Extract context from a carrier\n *\n * @param context Context which the newly created context will inherit from\n * @param carrier Carrier to extract context from\n * @param getter Function used to extract keys from a carrier\n */\n extract(context, carrier, getter = defaultTextMapGetter) {\n return this._getGlobalPropagator().extract(context, carrier, getter);\n }\n /**\n * Return a list of all fields which may be used by the propagator.\n */\n fields() {\n return this._getGlobalPropagator().fields();\n }\n /** Remove the global propagator */\n disable() {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n }\n _getGlobalPropagator() {\n return getGlobal(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR;\n }\n}\n//# sourceMappingURL=propagation.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { PropagationAPI } from './api/propagation';\n/**\n * Entrypoint for propagation API\n *\n * @since 1.0.0\n */\nexport const propagation = PropagationAPI.getInstance();\n//# sourceMappingURL=propagation-api.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { getGlobal, registerGlobal, unregisterGlobal, } from '../internal/global-utils';\nimport { ProxyTracerProvider } from '../trace/ProxyTracerProvider';\nimport { isSpanContextValid, wrapSpanContext, } from '../trace/spancontext-utils';\nimport { deleteSpan, getActiveSpan, getSpan, getSpanContext, setSpan, setSpanContext, } from '../trace/context-utils';\nimport { DiagAPI } from './diag';\nconst API_NAME = 'trace';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Tracing API\n *\n * @since 1.0.0\n */\nexport class TraceAPI {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n constructor() {\n this._proxyTracerProvider = new ProxyTracerProvider();\n this.wrapSpanContext = wrapSpanContext;\n this.isSpanContextValid = isSpanContextValid;\n this.deleteSpan = deleteSpan;\n this.getSpan = getSpan;\n this.getActiveSpan = getActiveSpan;\n this.getSpanContext = getSpanContext;\n this.setSpan = setSpan;\n this.setSpanContext = setSpanContext;\n }\n /** Get the singleton instance of the Trace API */\n static getInstance() {\n if (!this._instance) {\n this._instance = new TraceAPI();\n }\n return this._instance;\n }\n /**\n * Set the current global tracer.\n *\n * @returns true if the tracer provider was successfully registered, else false\n */\n setGlobalTracerProvider(provider) {\n const success = registerGlobal(API_NAME, this._proxyTracerProvider, DiagAPI.instance());\n if (success) {\n this._proxyTracerProvider.setDelegate(provider);\n }\n return success;\n }\n /**\n * Returns the global tracer provider.\n */\n getTracerProvider() {\n return getGlobal(API_NAME) || this._proxyTracerProvider;\n }\n /**\n * Returns a tracer from the global tracer provider.\n */\n getTracer(name, version) {\n return this.getTracerProvider().getTracer(name, version);\n }\n /** Remove the global tracer provider */\n disable() {\n unregisterGlobal(API_NAME, DiagAPI.instance());\n this._proxyTracerProvider = new ProxyTracerProvider();\n }\n}\n//# sourceMappingURL=trace.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nimport { TraceAPI } from './api/trace';\n/**\n * Entrypoint for trace API\n *\n * @since 1.0.0\n */\nexport const trace = TraceAPI.getInstance();\n//# sourceMappingURL=trace-api.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * check if an object has `addEventListener` and `removeEventListener` functions.\n * Generally only called with a `TargetWithEvents` but may be called with an `unknown` value.\n * @param obj - The object to check.\n */\nexport function isListenerObject(obj) {\n return (typeof obj === 'object' &&\n obj !== null &&\n 'addEventListener' in obj &&\n typeof obj.addEventListener === 'function' &&\n 'removeEventListener' in obj &&\n typeof obj.removeEventListener === 'function');\n}\n//# sourceMappingURL=util.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ROOT_CONTEXT } from '@opentelemetry/api';\nimport { isListenerObject } from './util';\n/* Key name to be used to save a context reference in Zone */\nconst ZONE_CONTEXT_KEY = 'OT_ZONE_CONTEXT';\n/**\n * ZoneContextManager\n * This module provides an easy functionality for tracing action between asynchronous operations in web.\n * It was not possible with standard [StackContextManager]{@link https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-sdk-trace-web/src/StackContextManager.ts}.\n * It heavily depends on [zone.js]{@link https://www.npmjs.com/package/zone.js}.\n * It stores the information about context in zone. Each Context will have always new Zone;\n * It also supports binding a certain Span to a target that has \"addEventListener\" and \"removeEventListener\".\n * When this happens a new zone is being created and the provided Span is being assigned to this zone.\n */\nexport class ZoneContextManager {\n /**\n * whether the context manager is enabled or not\n */\n _enabled = false;\n /**\n * @param context A context (span) to be executed within target function\n * @param target Function to be executed within the context\n */\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n _bindFunction(context, target) {\n const manager = this;\n const contextWrapper = function (...args) {\n return manager.with(context, () => target.apply(this, args));\n };\n Object.defineProperty(contextWrapper, 'length', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: target.length,\n });\n return contextWrapper;\n }\n /**\n * @param context A context (span) to be bind to target\n * @param obj target object on which the listeners will be patched\n */\n _bindListener(context, obj) {\n const target = obj;\n if (target.__ot_listeners !== undefined) {\n return obj;\n }\n target.__ot_listeners = {};\n if (typeof target.addEventListener === 'function') {\n target.addEventListener = this._patchAddEventListener(target, target.addEventListener, context);\n }\n if (typeof target.removeEventListener === 'function') {\n target.removeEventListener = this._patchRemoveEventListener(target, target.removeEventListener);\n }\n return obj;\n }\n /**\n * Creates a new zone\n * @param zoneName zone name\n * @param context A context (span) to be bind with Zone\n */\n _createZone(zoneName, context) {\n return Zone.current.fork({\n name: zoneName,\n properties: {\n [ZONE_CONTEXT_KEY]: context,\n },\n onCancelTask(parentZoneDelegate, currentZone, targetZone, task) {\n if (task.state === 'notScheduled' || task.state === 'running') {\n return task;\n }\n return parentZoneDelegate.cancelTask(targetZone, task);\n },\n });\n }\n /**\n * Patches addEventListener method\n * @param target any target that has \"addEventListener\" method\n * @param original reference to the patched method\n * @param [context] context to be bind to the listener\n */\n _patchAddEventListener(target, original, context) {\n const contextManager = this;\n return function (event, listener, opts) {\n if (target.__ot_listeners === undefined) {\n target.__ot_listeners = {};\n }\n let listeners = target.__ot_listeners[event];\n if (listeners === undefined) {\n listeners = new WeakMap();\n target.__ot_listeners[event] = listeners;\n }\n const patchedListener = contextManager.bind(context, listener);\n // store a weak reference of the user listener to ours\n listeners.set(listener, patchedListener);\n return original.call(this, event, patchedListener, opts);\n };\n }\n /**\n * Patches removeEventListener method\n * @param target any target that has \"removeEventListener\" method\n * @param original reference to the patched method\n */\n _patchRemoveEventListener(target, original) {\n return function (event, listener) {\n if (target.__ot_listeners === undefined ||\n target.__ot_listeners[event] === undefined) {\n return original.call(this, event, listener);\n }\n const events = target.__ot_listeners[event];\n const patchedListener = events.get(listener);\n events.delete(listener);\n return original.call(this, event, patchedListener || listener);\n };\n }\n /**\n * Returns the active context\n */\n active() {\n if (!this._enabled || !Zone.current) {\n return ROOT_CONTEXT;\n }\n return Zone.current.get(ZONE_CONTEXT_KEY) || ROOT_CONTEXT;\n }\n /**\n * Binds a the certain context or the active one to the target function and then returns the target\n * @param context A context (span) to be bind to target\n * @param target a function or event emitter. When target or one of its callbacks is called,\n * the provided context will be used as the active context for the duration of the call.\n */\n bind(context, target) {\n if (typeof target === 'function') {\n return this._bindFunction(context, target);\n }\n else if (isListenerObject(target)) {\n this._bindListener(context, target);\n }\n return target;\n }\n /**\n * Disable the context manager (clears all the contexts)\n */\n disable() {\n this._enabled = false;\n return this;\n }\n /**\n * Enables the context manager and creates a default(root) context\n */\n enable() {\n this._enabled = true;\n return this;\n }\n /**\n * Calls the callback function [fn] with the provided [context].\n * If [context] is undefined then it will use the active context.\n * The context will be set as active\n * @param context A context (span) to be called with provided callback\n * @param fn Callback function\n * @param thisArg optional receiver to be used for calling fn\n * @param args optional arguments forwarded to fn\n */\n with(context, fn, thisArg, ...args) {\n let zoneName = 'otel:with';\n if (fn.name) {\n zoneName += `:${fn.name}`;\n }\n return this._createZone(zoneName, context).run(fn, thisArg, args);\n }\n}\n//# sourceMappingURL=ZoneContextManager.js.map","'use strict';\n/**\n * @license Angular\n * (c) 2010-2026 Google LLC. https://angular.dev/\n * License: MIT\n */\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n};\n\n// packages/zone.js/lib/zone-impl.js\nvar global = globalThis;\nfunction __symbol__(name) {\n const symbolPrefix = global[\"__Zone_symbol_prefix\"] || \"__zone_symbol__\";\n return symbolPrefix + name;\n}\nfunction initZone() {\n const performance = global[\"performance\"];\n function mark(name) {\n performance && performance[\"mark\"] && performance[\"mark\"](name);\n }\n function performanceMeasure(name, label) {\n performance && performance[\"measure\"] && performance[\"measure\"](name, label);\n }\n mark(\"Zone\");\n const _ZoneImpl = class _ZoneImpl {\n constructor(parent, zoneSpec) {\n __publicField(this, \"_parent\");\n __publicField(this, \"_name\");\n __publicField(this, \"_properties\");\n __publicField(this, \"_zoneDelegate\");\n this._parent = parent;\n this._name = zoneSpec ? zoneSpec.name || \"unnamed\" : \"<root>\";\n this._properties = zoneSpec && zoneSpec.properties || {};\n this._zoneDelegate = new _ZoneDelegate(this, this._parent && this._parent._zoneDelegate, zoneSpec);\n }\n static assertZonePatched() {\n if (global[\"Promise\"] !== patches[\"ZoneAwarePromise\"]) {\n throw new Error(\"Zone.js has detected that ZoneAwarePromise `(window|global).Promise` has been overwritten.\\nMost likely cause is that a Promise polyfill has been loaded after Zone.js (Polyfilling Promise api is not necessary when zone.js is loaded. If you must load one, do so before loading zone.js.)\");\n }\n }\n static get root() {\n let zone = _ZoneImpl.current;\n while (zone.parent) {\n zone = zone.parent;\n }\n return zone;\n }\n static get current() {\n return _currentZoneFrame.zone;\n }\n static get currentTask() {\n return _currentTask;\n }\n static __load_patch(name, fn, ignoreDuplicate = false) {\n if (patches.hasOwnProperty(name)) {\n const checkDuplicate = global[__symbol__(\"forceDuplicateZoneCheck\")] === true;\n if (!ignoreDuplicate && checkDuplicate) {\n throw Error(\"Already loaded patch: \" + name);\n }\n } else if (!global[\"__Zone_disable_\" + name]) {\n const perfName = \"Zone:\" + name;\n mark(perfName);\n patches[name] = fn(global, _ZoneImpl, _api);\n performanceMeasure(perfName, perfName);\n }\n }\n get parent() {\n return this._parent;\n }\n get name() {\n return this._name;\n }\n get(key) {\n const zone = this.getZoneWith(key);\n if (zone)\n return zone._properties[key];\n }\n getZoneWith(key) {\n let current = this;\n while (current) {\n if (current._properties.hasOwnProperty(key)) {\n return current;\n }\n current = current._parent;\n }\n return null;\n }\n fork(zoneSpec) {\n if (!zoneSpec)\n throw new Error(\"ZoneSpec required!\");\n return this._zoneDelegate.fork(this, zoneSpec);\n }\n wrap(callback, source) {\n if (typeof callback !== \"function\") {\n throw new Error(\"Expecting function got: \" + callback);\n }\n const _callback = this._zoneDelegate.intercept(this, callback, source);\n const zone = this;\n return function() {\n return zone.runGuarded(_callback, this, arguments, source);\n };\n }\n run(callback, applyThis, applyArgs, source) {\n _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n try {\n return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source);\n } finally {\n _currentZoneFrame = _currentZoneFrame.parent;\n }\n }\n runGuarded(callback, applyThis = null, applyArgs, source) {\n _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n try {\n try {\n return this._zoneDelegate.invoke(this, callback, applyThis, applyArgs, source);\n } catch (error) {\n if (this._zoneDelegate.handleError(this, error)) {\n throw error;\n }\n }\n } finally {\n _currentZoneFrame = _currentZoneFrame.parent;\n }\n }\n runTask(task, applyThis, applyArgs) {\n if (task.zone != this) {\n throw new Error(\"A task can only be run in the zone of creation! (Creation: \" + (task.zone || NO_ZONE).name + \"; Execution: \" + this.name + \")\");\n }\n const zoneTask = task;\n const { type, data: { isPeriodic = false, isRefreshable = false } = {} } = task;\n if (task.state === notScheduled && (type === eventTask || type === macroTask)) {\n return;\n }\n const reEntryGuard = task.state != running;\n reEntryGuard && zoneTask._transitionTo(running, scheduled);\n const previousTask = _currentTask;\n _currentTask = zoneTask;\n _currentZoneFrame = { parent: _currentZoneFrame, zone: this };\n try {\n if (type == macroTask && task.data && !isPeriodic && !isRefreshable) {\n task.cancelFn = void 0;\n }\n try {\n return this._zoneDelegate.invokeTask(this, zoneTask, applyThis, applyArgs);\n } catch (error) {\n if (this._zoneDelegate.handleError(this, error)) {\n throw error;\n }\n }\n } finally {\n const state = task.state;\n if (state !== notScheduled && state !== unknown) {\n if (type == eventTask || isPeriodic || isRefreshable && state === scheduling) {\n reEntryGuard && zoneTask._transitionTo(scheduled, running, scheduling);\n } else {\n const zoneDelegates = zoneTask._zoneDelegates;\n this._updateTaskCount(zoneTask, -1);\n reEntryGuard && zoneTask._transitionTo(notScheduled, running, notScheduled);\n if (isRefreshable) {\n zoneTask._zoneDelegates = zoneDelegates;\n }\n }\n }\n _currentZoneFrame = _currentZoneFrame.parent;\n _currentTask = previousTask;\n }\n }\n scheduleTask(task) {\n if (task.zone && task.zone !== this) {\n let newZone = this;\n while (newZone) {\n if (newZone === task.zone) {\n throw Error(`can not reschedule task to ${this.name} which is descendants of the original zone ${task.zone.name}`);\n }\n newZone = newZone.parent;\n }\n }\n task._transitionTo(scheduling, notScheduled);\n const zoneDelegates = [];\n task._zoneDelegates = zoneDelegates;\n task._zone = this;\n try {\n task = this._zoneDelegate.scheduleTask(this, task);\n } catch (err) {\n task._transitionTo(unknown, scheduling, notScheduled);\n this._zoneDelegate.handleError(this, err);\n throw err;\n }\n if (task._zoneDelegates === zoneDelegates) {\n this._updateTaskCount(task, 1);\n }\n if (task.state == scheduling) {\n task._transitionTo(scheduled, scheduling);\n }\n return task;\n }\n scheduleMicroTask(source, callback, data, customSchedule) {\n return this.scheduleTask(new ZoneTask(microTask, source, callback, data, customSchedule, void 0));\n }\n scheduleMacroTask(source, callback, data, customSchedule, customCancel) {\n return this.scheduleTask(new ZoneTask(macroTask, source, callback, data, customSchedule, customCancel));\n }\n scheduleEventTask(source, callback, data, customSchedule, customCancel) {\n return this.scheduleTask(new ZoneTask(eventTask, source, callback, data, customSchedule, customCancel));\n }\n cancelTask(task) {\n if (task.zone != this)\n throw new Error(\"A task can only be cancelled in the zone of creation! (Creation: \" + (task.zone || NO_ZONE).name + \"; Execution: \" + this.name + \")\");\n if (task.state !== scheduled && task.state !== running) {\n return;\n }\n task._transitionTo(canceling, scheduled, running);\n try {\n this._zoneDelegate.cancelTask(this, task);\n } catch (err) {\n task._transitionTo(unknown, canceling);\n this._zoneDelegate.handleError(this, err);\n throw err;\n }\n this._updateTaskCount(task, -1);\n task._transitionTo(notScheduled, canceling);\n task.runCount = -1;\n return task;\n }\n _updateTaskCount(task, count) {\n const zoneDelegates = task._zoneDelegates;\n if (count == -1) {\n task._zoneDelegates = null;\n }\n for (let i = 0; i < zoneDelegates.length; i++) {\n zoneDelegates[i]._updateTaskCount(task.type, count);\n }\n }\n };\n __publicField(_ZoneImpl, \"__symbol__\", __symbol__);\n let ZoneImpl = _ZoneImpl;\n const DELEGATE_ZS = {\n name: \"\",\n onHasTask: (delegate, _, target, hasTaskState) => delegate.hasTask(target, hasTaskState),\n onScheduleTask: (delegate, _, target, task) => delegate.scheduleTask(target, task),\n onInvokeTask: (delegate, _, target, task, applyThis, applyArgs) => delegate.invokeTask(target, task, applyThis, applyArgs),\n onCancelTask: (delegate, _, target, task) => delegate.cancelTask(target, task)\n };\n class _ZoneDelegate {\n constructor(zone, parentDelegate, zoneSpec) {\n __publicField(this, \"_zone\");\n __publicField(this, \"_taskCounts\", {\n \"microTask\": 0,\n \"macroTask\": 0,\n \"eventTask\": 0\n });\n __publicField(this, \"_forkDlgt\");\n __publicField(this, \"_forkZS\");\n __publicField(this, \"_forkCurrZone\");\n __publicField(this, \"_interceptDlgt\");\n __publicField(this, \"_interceptZS\");\n __publicField(this, \"_interceptCurrZone\");\n __publicField(this, \"_invokeDlgt\");\n __publicField(this, \"_invokeZS\");\n __publicField(this, \"_invokeCurrZone\");\n __publicField(this, \"_handleErrorDlgt\");\n __publicField(this, \"_handleErrorZS\");\n __publicField(this, \"_handleErrorCurrZone\");\n __publicField(this, \"_scheduleTaskDlgt\");\n __publicField(this, \"_scheduleTaskZS\");\n __publicField(this, \"_scheduleTaskCurrZone\");\n __publicField(this, \"_invokeTaskDlgt\");\n __publicField(this, \"_invokeTaskZS\");\n __publicField(this, \"_invokeTaskCurrZone\");\n __publicField(this, \"_cancelTaskDlgt\");\n __publicField(this, \"_cancelTaskZS\");\n __publicField(this, \"_cancelTaskCurrZone\");\n __publicField(this, \"_hasTaskDlgt\");\n __publicField(this, \"_hasTaskDlgtOwner\");\n __publicField(this, \"_hasTaskZS\");\n __publicField(this, \"_hasTaskCurrZone\");\n this._zone = zone;\n this._forkZS = zoneSpec && (zoneSpec && zoneSpec.onFork ? zoneSpec : parentDelegate._forkZS);\n this._forkDlgt = zoneSpec && (zoneSpec.onFork ? parentDelegate : parentDelegate._forkDlgt);\n this._forkCurrZone = zoneSpec && (zoneSpec.onFork ? this._zone : parentDelegate._forkCurrZone);\n this._interceptZS = zoneSpec && (zoneSpec.onIntercept ? zoneSpec : parentDelegate._interceptZS);\n this._interceptDlgt = zoneSpec && (zoneSpec.onIntercept ? parentDelegate : parentDelegate._interceptDlgt);\n this._interceptCurrZone = zoneSpec && (zoneSpec.onIntercept ? this._zone : parentDelegate._interceptCurrZone);\n this._invokeZS = zoneSpec && (zoneSpec.onInvoke ? zoneSpec : parentDelegate._invokeZS);\n this._invokeDlgt = zoneSpec && (zoneSpec.onInvoke ? parentDelegate : parentDelegate._invokeDlgt);\n this._invokeCurrZone = zoneSpec && (zoneSpec.onInvoke ? this._zone : parentDelegate._invokeCurrZone);\n this._handleErrorZS = zoneSpec && (zoneSpec.onHandleError ? zoneSpec : parentDelegate._handleErrorZS);\n this._handleErrorDlgt = zoneSpec && (zoneSpec.onHandleError ? parentDelegate : parentDelegate._handleErrorDlgt);\n this._handleErrorCurrZone = zoneSpec && (zoneSpec.onHandleError ? this._zone : parentDelegate._handleErrorCurrZone);\n this._scheduleTaskZS = zoneSpec && (zoneSpec.onScheduleTask ? zoneSpec : parentDelegate._scheduleTaskZS);\n this._scheduleTaskDlgt = zoneSpec && (zoneSpec.onScheduleTask ? parentDelegate : parentDelegate._scheduleTaskDlgt);\n this._scheduleTaskCurrZone = zoneSpec && (zoneSpec.onScheduleTask ? this._zone : parentDelegate._scheduleTaskCurrZone);\n this._invokeTaskZS = zoneSpec && (zoneSpec.onInvokeTask ? zoneSpec : parentDelegate._invokeTaskZS);\n this._invokeTaskDlgt = zoneSpec && (zoneSpec.onInvokeTask ? parentDelegate : parentDelegate._invokeTaskDlgt);\n this._invokeTaskCurrZone = zoneSpec && (zoneSpec.onInvokeTask ? this._zone : parentDelegate._invokeTaskCurrZone);\n this._cancelTaskZS = zoneSpec && (zoneSpec.onCancelTask ? zoneSpec : parentDelegate._cancelTaskZS);\n this._cancelTaskDlgt = zoneSpec && (zoneSpec.onCancelTask ? parentDelegate : parentDelegate._cancelTaskDlgt);\n this._cancelTaskCurrZone = zoneSpec && (zoneSpec.onCancelTask ? this._zone : parentDelegate._cancelTaskCurrZone);\n this._hasTaskZS = null;\n this._hasTaskDlgt = null;\n this._hasTaskDlgtOwner = null;\n this._hasTaskCurrZone = null;\n const zoneSpecHasTask = zoneSpec && zoneSpec.onHasTask;\n const parentHasTask = parentDelegate && parentDelegate._hasTaskZS;\n if (zoneSpecHasTask || parentHasTask) {\n this._hasTaskZS = zoneSpecHasTask ? zoneSpec : DELEGATE_ZS;\n this._hasTaskDlgt = parentDelegate;\n this._hasTaskDlgtOwner = this;\n this._hasTaskCurrZone = this._zone;\n if (!zoneSpec.onScheduleTask) {\n this._scheduleTaskZS = DELEGATE_ZS;\n this._scheduleTaskDlgt = parentDelegate;\n this._scheduleTaskCurrZone = this._zone;\n }\n if (!zoneSpec.onInvokeTask) {\n this._invokeTaskZS = DELEGATE_ZS;\n this._invokeTaskDlgt = parentDelegate;\n this._invokeTaskCurrZone = this._zone;\n }\n if (!zoneSpec.onCancelTask) {\n this._cancelTaskZS = DELEGATE_ZS;\n this._cancelTaskDlgt = parentDelegate;\n this._cancelTaskCurrZone = this._zone;\n }\n }\n }\n get zone() {\n return this._zone;\n }\n fork(targetZone, zoneSpec) {\n return this._forkZS ? this._forkZS.onFork(this._forkDlgt, this.zone, targetZone, zoneSpec) : new ZoneImpl(targetZone, zoneSpec);\n }\n intercept(targetZone, callback, source) {\n return this._interceptZS ? this._interceptZS.onIntercept(this._interceptDlgt, this._interceptCurrZone, targetZone, callback, source) : callback;\n }\n invoke(targetZone, callback, applyThis, applyArgs, source) {\n return this._invokeZS ? this._invokeZS.onInvoke(this._invokeDlgt, this._invokeCurrZone, targetZone, callback, applyThis, applyArgs, source) : callback.apply(applyThis, applyArgs);\n }\n handleError(targetZone, error) {\n return this._handleErrorZS ? this._handleErrorZS.onHandleError(this._handleErrorDlgt, this._handleErrorCurrZone, targetZone, error) : true;\n }\n scheduleTask(targetZone, task) {\n let returnTask = task;\n if (this._scheduleTaskZS) {\n if (this._hasTaskZS) {\n returnTask._zoneDelegates.push(this._hasTaskDlgtOwner);\n }\n returnTask = this._scheduleTaskZS.onScheduleTask(this._scheduleTaskDlgt, this._scheduleTaskCurrZone, targetZone, task);\n if (!returnTask)\n returnTask = task;\n } else {\n if (task.scheduleFn) {\n task.scheduleFn(task);\n } else if (task.type == microTask) {\n scheduleMicroTask(task);\n } else {\n throw new Error(\"Task is missing scheduleFn.\");\n }\n }\n return returnTask;\n }\n invokeTask(targetZone, task, applyThis, applyArgs) {\n return this._invokeTaskZS ? this._invokeTaskZS.onInvokeTask(this._invokeTaskDlgt, this._invokeTaskCurrZone, targetZone, task, applyThis, applyArgs) : task.callback.apply(applyThis, applyArgs);\n }\n cancelTask(targetZone, task) {\n let value;\n if (this._cancelTaskZS) {\n value = this._cancelTaskZS.onCancelTask(this._cancelTaskDlgt, this._cancelTaskCurrZone, targetZone, task);\n } else {\n if (!task.cancelFn) {\n throw Error(\"Task is not cancelable\");\n }\n value = task.cancelFn(task);\n }\n return value;\n }\n hasTask(targetZone, isEmpty) {\n try {\n this._hasTaskZS && this._hasTaskZS.onHasTask(this._hasTaskDlgt, this._hasTaskCurrZone, targetZone, isEmpty);\n } catch (err) {\n this.handleError(targetZone, err);\n }\n }\n _updateTaskCount(type, count) {\n const counts = this._taskCounts;\n const prev = counts[type];\n const next = counts[type] = prev + count;\n if (next < 0) {\n throw new Error(\"More tasks executed then were scheduled.\");\n }\n if (prev == 0 || next == 0) {\n const isEmpty = {\n microTask: counts[\"microTask\"] > 0,\n macroTask: counts[\"macroTask\"] > 0,\n eventTask: counts[\"eventTask\"] > 0,\n change: type\n };\n this.hasTask(this._zone, isEmpty);\n }\n }\n }\n class ZoneTask {\n constructor(type, source, callback, options, scheduleFn, cancelFn) {\n __publicField(this, \"type\");\n __publicField(this, \"source\");\n __publicField(this, \"invoke\");\n __publicField(this, \"callback\");\n __publicField(this, \"data\");\n __publicField(this, \"scheduleFn\");\n __publicField(this, \"cancelFn\");\n __publicField(this, \"_zone\", null);\n __publicField(this, \"runCount\", 0);\n __publicField(this, \"_zoneDelegates\", null);\n __publicField(this, \"_state\", \"notScheduled\");\n this.type = type;\n this.source = source;\n this.data = options;\n this.scheduleFn = scheduleFn;\n this.cancelFn = cancelFn;\n if (!callback) {\n throw new Error(\"callback is not defined\");\n }\n this.callback = callback;\n const self2 = this;\n if (type === eventTask && options && options.useG) {\n this.invoke = ZoneTask.invokeTask;\n } else {\n this.invoke = function() {\n return ZoneTask.invokeTask.call(global, self2, this, arguments);\n };\n }\n }\n static invokeTask(task, target, args) {\n if (!task) {\n task = this;\n }\n _numberOfNestedTaskFrames++;\n try {\n task.runCount++;\n return task.zone.runTask(task, target, args);\n } finally {\n if (_numberOfNestedTaskFrames === 1 && !global[enableNativeMicrotaskDraining]) {\n drainMicroTaskQueueSynchronously();\n }\n _numberOfNestedTaskFrames--;\n }\n }\n get zone() {\n return this._zone;\n }\n get state() {\n return this._state;\n }\n cancelScheduleRequest() {\n this._transitionTo(notScheduled, scheduling);\n }\n _transitionTo(toState, fromState1, fromState2) {\n if (this._state === fromState1 || this._state === fromState2) {\n this._state = toState;\n if (toState == notScheduled) {\n this._zoneDelegates = null;\n }\n } else {\n throw new Error(`${this.type} '${this.source}': can not transition to '${toState}', expecting state '${fromState1}'${fromState2 ? \" or '\" + fromState2 + \"'\" : \"\"}, was '${this._state}'.`);\n }\n }\n toString() {\n if (this.data && typeof this.data.handleId !== \"undefined\") {\n return this.data.handleId.toString();\n } else {\n return Object.prototype.toString.call(this);\n }\n }\n // add toJSON method to prevent cyclic error when\n // call JSON.stringify(zoneTask)\n toJSON() {\n return {\n type: this.type,\n state: this.state,\n source: this.source,\n zone: this.zone.name,\n runCount: this.runCount\n };\n }\n }\n const symbolSetTimeout = __symbol__(\"setTimeout\");\n const symbolPromise = __symbol__(\"Promise\");\n const symbolThen = __symbol__(\"then\");\n const enableNativeMicrotaskDraining = __symbol__(\"enable_native_microtask_draining\");\n let _microTaskQueue = [];\n let _isDrainingMicrotaskQueue = false;\n let nativeMicroTaskQueuePromise;\n function nativeScheduleMicroTask(func) {\n var _a;\n if (!nativeMicroTaskQueuePromise && global[symbolPromise]) {\n nativeMicroTaskQueuePromise = global[symbolPromise].resolve(0);\n }\n if (nativeMicroTaskQueuePromise) {\n const thenFn = (_a = nativeMicroTaskQueuePromise[symbolThen]) != null ? _a : nativeMicroTaskQueuePromise[\"then\"];\n thenFn.call(nativeMicroTaskQueuePromise, func);\n } else {\n global[symbolSetTimeout](func, 0);\n }\n }\n function scheduleMicroTask(task) {\n const isNativeDrainingEnabled = global[enableNativeMicrotaskDraining];\n const shouldDrainWithNative = isNativeDrainingEnabled && _microTaskQueue.length === 0 && !_isDrainingMicrotaskQueue;\n const shouldDrainWithoutNative = !isNativeDrainingEnabled && _numberOfNestedTaskFrames === 0 && _microTaskQueue.length === 0;\n if (shouldDrainWithNative || shouldDrainWithoutNative) {\n nativeScheduleMicroTask(drainMicroTaskQueueSynchronously);\n }\n if (task) {\n _microTaskQueue.push(task);\n }\n }\n function drainMicroTaskQueueSynchronously() {\n if (_isDrainingMicrotaskQueue) {\n return;\n }\n _isDrainingMicrotaskQueue = true;\n while (_microTaskQueue.length) {\n const queue = _microTaskQueue;\n _microTaskQueue = [];\n for (const task of queue) {\n try {\n task.zone.runTask(task, null, null);\n } catch (error) {\n _api.onUnhandledError(error);\n }\n }\n }\n if (global[enableNativeMicrotaskDraining]) {\n _isDrainingMicrotaskQueue = false;\n _api.microtaskDrainDone();\n } else {\n _api.microtaskDrainDone();\n _isDrainingMicrotaskQueue = false;\n }\n }\n const NO_ZONE = { name: \"NO ZONE\" };\n const notScheduled = \"notScheduled\", scheduling = \"scheduling\", scheduled = \"scheduled\", running = \"running\", canceling = \"canceling\", unknown = \"unknown\";\n const microTask = \"microTask\", macroTask = \"macroTask\", eventTask = \"eventTask\";\n const patches = {};\n const _api = {\n symbol: __symbol__,\n currentZoneFrame: () => _currentZoneFrame,\n onUnhandledError: noop,\n microtaskDrainDone: noop,\n scheduleMicroTask,\n showUncaughtError: () => !ZoneImpl[__symbol__(\"ignoreConsoleErrorUncaughtError\")],\n patchEventTarget: () => [],\n patchOnProperties: noop,\n patchMethod: () => noop,\n bindArguments: () => [],\n patchThen: () => noop,\n patchMacroTask: () => noop,\n patchEventPrototype: () => noop,\n getGlobalObjects: () => void 0,\n ObjectDefineProperty: () => noop,\n ObjectGetOwnPropertyDescriptor: () => void 0,\n ObjectCreate: () => void 0,\n ArraySlice: () => [],\n patchClass: () => noop,\n wrapWithCurrentZone: () => noop,\n filterProperties: () => [],\n attachOriginToPatched: () => noop,\n _redefineProperty: () => noop,\n patchCallbacks: () => noop,\n nativeScheduleMicroTask\n };\n let _currentZoneFrame = { parent: null, zone: new ZoneImpl(null, null) };\n let _currentTask = null;\n let _numberOfNestedTaskFrames = 0;\n function noop() {\n }\n performanceMeasure(\"Zone\", \"Zone\");\n return ZoneImpl;\n}\n\n// packages/zone.js/lib/zone.js\nfunction loadZone() {\n var _a;\n const global2 = globalThis;\n const checkDuplicate = global2[__symbol__(\"forceDuplicateZoneCheck\")] === true;\n if (global2[\"Zone\"] && (checkDuplicate || typeof global2[\"Zone\"].__symbol__ !== \"function\")) {\n throw new Error(\"Zone already loaded.\");\n }\n (_a = global2[\"Zone\"]) != null ? _a : global2[\"Zone\"] = initZone();\n return global2[\"Zone\"];\n}\n\n// packages/zone.js/lib/common/utils.js\nvar ObjectGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar ObjectDefineProperty = Object.defineProperty;\nvar ObjectGetPrototypeOf = Object.getPrototypeOf;\nvar ObjectCreate = Object.create;\nvar ArraySlice = Array.prototype.slice;\nvar ADD_EVENT_LISTENER_STR = \"addEventListener\";\nvar REMOVE_EVENT_LISTENER_STR = \"removeEventListener\";\nvar ZONE_SYMBOL_ADD_EVENT_LISTENER = __symbol__(ADD_EVENT_LISTENER_STR);\nvar ZONE_SYMBOL_REMOVE_EVENT_LISTENER = __symbol__(REMOVE_EVENT_LISTENER_STR);\nvar TRUE_STR = \"true\";\nvar FALSE_STR = \"false\";\nvar ZONE_SYMBOL_PREFIX = __symbol__(\"\");\nfunction wrapWithCurrentZone(callback, source) {\n return Zone.current.wrap(callback, source);\n}\nfunction scheduleMacroTaskWithCurrentZone(source, callback, data, customSchedule, customCancel) {\n return Zone.current.scheduleMacroTask(source, callback, data, customSchedule, customCancel);\n}\nvar zoneSymbol = __symbol__;\nvar isWindowExists = typeof window !== \"undefined\";\nvar internalWindow = isWindowExists ? window : void 0;\nvar _global = isWindowExists && internalWindow || globalThis;\nvar REMOVE_ATTRIBUTE = \"removeAttribute\";\nfunction bindArguments(args, source) {\n for (let i = args.length - 1; i >= 0; i--) {\n if (typeof args[i] === \"function\") {\n args[i] = wrapWithCurrentZone(args[i], source + \"_\" + i);\n }\n }\n return args;\n}\nfunction patchPrototype(prototype, fnNames) {\n const source = prototype.constructor[\"name\"];\n for (let i = 0; i < fnNames.length; i++) {\n const name = fnNames[i];\n const delegate = prototype[name];\n if (delegate) {\n const prototypeDesc = ObjectGetOwnPropertyDescriptor(prototype, name);\n if (!isPropertyWritable(prototypeDesc)) {\n continue;\n }\n prototype[name] = ((delegate2) => {\n const patched = function() {\n return delegate2.apply(this, bindArguments(arguments, source + \".\" + name));\n };\n attachOriginToPatched(patched, delegate2);\n return patched;\n })(delegate);\n }\n }\n}\nfunction isPropertyWritable(propertyDesc) {\n if (!propertyDesc) {\n return true;\n }\n if (propertyDesc.writable === false) {\n return false;\n }\n return !(typeof propertyDesc.get === \"function\" && typeof propertyDesc.set === \"undefined\");\n}\nvar isWebWorker = typeof WorkerGlobalScope !== \"undefined\" && self instanceof WorkerGlobalScope;\nvar isNode = !(\"nw\" in _global) && typeof _global.process !== \"undefined\" && _global.process.toString() === \"[object process]\";\nvar isBrowser = !isNode && !isWebWorker && !!(isWindowExists && internalWindow[\"HTMLElement\"]);\nvar isMix = typeof _global.process !== \"undefined\" && _global.process.toString() === \"[object process]\" && !isWebWorker && !!(isWindowExists && internalWindow[\"HTMLElement\"]);\nvar zoneSymbolEventNames = {};\nvar enableBeforeunloadSymbol = zoneSymbol(\"enable_beforeunload\");\nvar wrapFn = function(event) {\n event = event || _global.event;\n if (!event) {\n return;\n }\n let eventNameSymbol = zoneSymbolEventNames[event.type];\n if (!eventNameSymbol) {\n eventNameSymbol = zoneSymbolEventNames[event.type] = zoneSymbol(\"ON_PROPERTY\" + event.type);\n }\n const target = this || event.target || _global;\n const listener = target[eventNameSymbol];\n let result;\n if (isBrowser && target === internalWindow && event.type === \"error\") {\n const errorEvent = event;\n result = listener && listener.call(this, errorEvent.message, errorEvent.filename, errorEvent.lineno, errorEvent.colno, errorEvent.error);\n if (result === true) {\n event.preventDefault();\n }\n } else {\n result = listener && listener.apply(this, arguments);\n if (\n // https://github.com/angular/angular/issues/47579\n // https://www.w3.org/TR/2011/WD-html5-20110525/history.html#beforeunloadevent\n // This is the only specific case we should check for. The spec defines that the\n // `returnValue` attribute represents the message to show the user. When the event\n // is created, this attribute must be set to the empty string.\n event.type === \"beforeunload\" && // To prevent any breaking changes resulting from this change, given that\n // it was already causing a significant number of failures in G3, we have hidden\n // that behavior behind a global configuration flag. Consumers can enable this\n // flag explicitly if they want the `beforeunload` event to be handled as defined\n // in the specification.\n _global[enableBeforeunloadSymbol] && // The IDL event definition is `attribute DOMString returnValue`, so we check whether\n // `typeof result` is a string.\n typeof result === \"string\"\n ) {\n event.returnValue = result;\n } else if (result != void 0 && !result) {\n event.preventDefault();\n }\n }\n return result;\n};\nfunction patchProperty(obj, prop, prototype) {\n let desc = ObjectGetOwnPropertyDescriptor(obj, prop);\n if (!desc && prototype) {\n const prototypeDesc = ObjectGetOwnPropertyDescriptor(prototype, prop);\n if (prototypeDesc) {\n desc = { enumerable: true, configurable: true };\n }\n }\n if (!desc || !desc.configurable) {\n return;\n }\n const onPropPatchedSymbol = zoneSymbol(\"on\" + prop + \"patched\");\n if (obj.hasOwnProperty(onPropPatchedSymbol) && obj[onPropPatchedSymbol]) {\n return;\n }\n delete desc.writable;\n delete desc.value;\n const originalDescGet = desc.get;\n const originalDescSet = desc.set;\n const eventName = prop.slice(2);\n let eventNameSymbol = zoneSymbolEventNames[eventName];\n if (!eventNameSymbol) {\n eventNameSymbol = zoneSymbolEventNames[eventName] = zoneSymbol(\"ON_PROPERTY\" + eventName);\n }\n desc.set = function(newValue) {\n let target = this;\n if (!target && obj === _global) {\n target = _global;\n }\n if (!target) {\n return;\n }\n const previousValue = target[eventNameSymbol];\n if (typeof previousValue === \"function\") {\n target.removeEventListener(eventName, wrapFn);\n }\n originalDescSet == null ? void 0 : originalDescSet.call(target, null);\n target[eventNameSymbol] = newValue;\n if (typeof newValue === \"function\") {\n target.addEventListener(eventName, wrapFn, false);\n }\n };\n desc.get = function() {\n let target = this;\n if (!target && obj === _global) {\n target = _global;\n }\n if (!target) {\n return null;\n }\n const listener = target[eventNameSymbol];\n if (listener) {\n return listener;\n } else if (originalDescGet) {\n let value = originalDescGet.call(this);\n if (value) {\n desc.set.call(this, value);\n if (typeof target[REMOVE_ATTRIBUTE] === \"function\") {\n target.removeAttribute(prop);\n }\n return value;\n }\n }\n return null;\n };\n ObjectDefineProperty(obj, prop, desc);\n obj[onPropPatchedSymbol] = true;\n}\nfunction patchOnProperties(obj, properties, prototype) {\n if (properties) {\n for (let i = 0; i < properties.length; i++) {\n patchProperty(obj, \"on\" + properties[i], prototype);\n }\n } else {\n const onProperties = [];\n for (const prop in obj) {\n if (prop.slice(0, 2) == \"on\") {\n onProperties.push(prop);\n }\n }\n for (let j = 0; j < onProperties.length; j++) {\n patchProperty(obj, onProperties[j], prototype);\n }\n }\n}\nvar originalInstanceKey = zoneSymbol(\"originalInstance\");\nfunction patchClass(className) {\n const OriginalClass = _global[className];\n if (!OriginalClass)\n return;\n _global[zoneSymbol(className)] = OriginalClass;\n _global[className] = function() {\n const a = bindArguments(arguments, className);\n switch (a.length) {\n case 0:\n this[originalInstanceKey] = new OriginalClass();\n break;\n case 1:\n this[originalInstanceKey] = new OriginalClass(a[0]);\n break;\n case 2:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1]);\n break;\n case 3:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2]);\n break;\n case 4:\n this[originalInstanceKey] = new OriginalClass(a[0], a[1], a[2], a[3]);\n break;\n default:\n throw new Error(\"Arg list too long.\");\n }\n };\n attachOriginToPatched(_global[className], OriginalClass);\n const instance = new OriginalClass(function() {\n });\n let prop;\n for (prop in instance) {\n if (className === \"XMLHttpRequest\" && prop === \"responseBlob\")\n continue;\n (function(prop2) {\n if (typeof instance[prop2] === \"function\") {\n _global[className].prototype[prop2] = function() {\n return this[originalInstanceKey][prop2].apply(this[originalInstanceKey], arguments);\n };\n } else {\n ObjectDefineProperty(_global[className].prototype, prop2, {\n set: function(fn) {\n if (typeof fn === \"function\") {\n this[originalInstanceKey][prop2] = wrapWithCurrentZone(fn, className + \".\" + prop2);\n attachOriginToPatched(this[originalInstanceKey][prop2], fn);\n } else {\n this[originalInstanceKey][prop2] = fn;\n }\n },\n get: function() {\n return this[originalInstanceKey][prop2];\n }\n });\n }\n })(prop);\n }\n for (prop in OriginalClass) {\n if (prop !== \"prototype\" && OriginalClass.hasOwnProperty(prop)) {\n _global[className][prop] = OriginalClass[prop];\n }\n }\n}\nfunction copySymbolProperties(src, dest) {\n if (typeof Object.getOwnPropertySymbols !== \"function\") {\n return;\n }\n const symbols = Object.getOwnPropertySymbols(src);\n symbols.forEach((symbol) => {\n const desc = Object.getOwnPropertyDescriptor(src, symbol);\n Object.defineProperty(dest, symbol, {\n get: function() {\n return src[symbol];\n },\n set: function(value) {\n if (desc && (!desc.writable || typeof desc.set !== \"function\")) {\n return;\n }\n src[symbol] = value;\n },\n enumerable: desc ? desc.enumerable : true,\n configurable: desc ? desc.configurable : true\n });\n });\n}\nvar shouldCopySymbolProperties = false;\nfunction patchMethod(target, name, patchFn) {\n let proto = target;\n while (proto && !proto.hasOwnProperty(name)) {\n proto = ObjectGetPrototypeOf(proto);\n }\n if (!proto && target[name]) {\n proto = target;\n }\n const delegateName = zoneSymbol(name);\n let delegate = null;\n if (proto && (!(delegate = proto[delegateName]) || !proto.hasOwnProperty(delegateName))) {\n delegate = proto[delegateName] = proto[name];\n const desc = proto && ObjectGetOwnPropertyDescriptor(proto, name);\n if (isPropertyWritable(desc)) {\n const patchDelegate = patchFn(delegate, delegateName, name);\n proto[name] = function() {\n return patchDelegate(this, arguments);\n };\n attachOriginToPatched(proto[name], delegate);\n if (shouldCopySymbolProperties) {\n copySymbolProperties(delegate, proto[name]);\n }\n }\n }\n return delegate;\n}\nfunction patchMacroTask(obj, funcName, metaCreator) {\n let setNative = null;\n function scheduleTask(task) {\n const data = task.data;\n data.args[data.cbIdx] = function() {\n task.invoke.apply(this, arguments);\n };\n setNative.apply(data.target, data.args);\n return task;\n }\n setNative = patchMethod(obj, funcName, (delegate) => function(self2, args) {\n const meta = metaCreator(self2, args);\n if (meta.cbIdx >= 0 && typeof args[meta.cbIdx] === \"function\") {\n return scheduleMacroTaskWithCurrentZone(meta.name, args[meta.cbIdx], meta, scheduleTask);\n } else {\n return delegate.apply(self2, args);\n }\n });\n}\nfunction attachOriginToPatched(patched, original) {\n patched[zoneSymbol(\"OriginalDelegate\")] = original;\n}\nfunction isFunction(value) {\n return typeof value === \"function\";\n}\nfunction isNumber(value) {\n return typeof value === \"number\";\n}\n\n// packages/zone.js/lib/common/events.js\nvar OPTIMIZED_ZONE_EVENT_TASK_DATA = {\n useG: true\n};\nvar zoneSymbolEventNames2 = {};\nvar globalSources = {};\nvar EVENT_NAME_SYMBOL_REGX = new RegExp(\"^\" + ZONE_SYMBOL_PREFIX + \"(\\\\w+)(true|false)$\");\nvar IMMEDIATE_PROPAGATION_SYMBOL = zoneSymbol(\"propagationStopped\");\nfunction prepareEventNames(eventName, eventNameToString) {\n const falseEventName = (eventNameToString ? eventNameToString(eventName) : eventName) + FALSE_STR;\n const trueEventName = (eventNameToString ? eventNameToString(eventName) : eventName) + TRUE_STR;\n const symbol = ZONE_SYMBOL_PREFIX + falseEventName;\n const symbolCapture = ZONE_SYMBOL_PREFIX + trueEventName;\n zoneSymbolEventNames2[eventName] = {};\n zoneSymbolEventNames2[eventName][FALSE_STR] = symbol;\n zoneSymbolEventNames2[eventName][TRUE_STR] = symbolCapture;\n}\nfunction patchEventTarget(_global2, api, apis, patchOptions) {\n const ADD_EVENT_LISTENER = patchOptions && patchOptions.add || ADD_EVENT_LISTENER_STR;\n const REMOVE_EVENT_LISTENER = patchOptions && patchOptions.rm || REMOVE_EVENT_LISTENER_STR;\n const LISTENERS_EVENT_LISTENER = patchOptions && patchOptions.listeners || \"eventListeners\";\n const REMOVE_ALL_LISTENERS_EVENT_LISTENER = patchOptions && patchOptions.rmAll || \"removeAllListeners\";\n const zoneSymbolAddEventListener = zoneSymbol(ADD_EVENT_LISTENER);\n const ADD_EVENT_LISTENER_SOURCE = \".\" + ADD_EVENT_LISTENER + \":\";\n const PREPEND_EVENT_LISTENER = \"prependListener\";\n const PREPEND_EVENT_LISTENER_SOURCE = \".\" + PREPEND_EVENT_LISTENER + \":\";\n const invokeTask = function(task, target, event) {\n if (task.isRemoved) {\n return;\n }\n const delegate = task.callback;\n if (typeof delegate === \"object\" && delegate.handleEvent) {\n task.callback = (event2) => delegate.handleEvent(event2);\n task.originalDelegate = delegate;\n }\n let error;\n try {\n task.invoke(task, target, [event]);\n } catch (err) {\n error = err;\n }\n const options = task.options;\n if (options && typeof options === \"object\" && options.once) {\n const delegate2 = task.originalDelegate ? task.originalDelegate : task.callback;\n target[REMOVE_EVENT_LISTENER].call(target, event.type, delegate2, options);\n }\n return error;\n };\n function globalCallback(context, event, isCapture) {\n event = event || _global2.event;\n if (!event) {\n return;\n }\n const target = context || event.target || _global2;\n const tasks = target[zoneSymbolEventNames2[event.type][isCapture ? TRUE_STR : FALSE_STR]];\n if (tasks) {\n const errors = [];\n if (tasks.length === 1) {\n const err = invokeTask(tasks[0], target, event);\n err && errors.push(err);\n } else {\n const copyTasks = tasks.slice();\n for (let i = 0; i < copyTasks.length; i++) {\n if (event && event[IMMEDIATE_PROPAGATION_SYMBOL] === true) {\n break;\n }\n const err = invokeTask(copyTasks[i], target, event);\n err && errors.push(err);\n }\n }\n if (errors.length === 1) {\n throw errors[0];\n } else {\n for (let i = 0; i < errors.length; i++) {\n const err = errors[i];\n api.nativeScheduleMicroTask(() => {\n throw err;\n });\n }\n }\n }\n }\n const globalZoneAwareCallback = function(event) {\n return globalCallback(this, event, false);\n };\n const globalZoneAwareCaptureCallback = function(event) {\n return globalCallback(this, event, true);\n };\n function patchEventTargetMethods(obj, patchOptions2) {\n if (!obj) {\n return false;\n }\n let useGlobalCallback = true;\n if (patchOptions2 && patchOptions2.useG !== void 0) {\n useGlobalCallback = patchOptions2.useG;\n }\n const validateHandler = patchOptions2 && patchOptions2.vh;\n let checkDuplicate = true;\n if (patchOptions2 && patchOptions2.chkDup !== void 0) {\n checkDuplicate = patchOptions2.chkDup;\n }\n let returnTarget = false;\n if (patchOptions2 && patchOptions2.rt !== void 0) {\n returnTarget = patchOptions2.rt;\n }\n let proto = obj;\n while (proto && !proto.hasOwnProperty(ADD_EVENT_LISTENER)) {\n proto = ObjectGetPrototypeOf(proto);\n }\n if (!proto && obj[ADD_EVENT_LISTENER]) {\n proto = obj;\n }\n if (!proto) {\n return false;\n }\n if (proto[zoneSymbolAddEventListener]) {\n return false;\n }\n const eventNameToString = patchOptions2 && patchOptions2.eventNameToString;\n const taskData = {};\n const nativeAddEventListener = proto[zoneSymbolAddEventListener] = proto[ADD_EVENT_LISTENER];\n const nativeRemoveEventListener = proto[zoneSymbol(REMOVE_EVENT_LISTENER)] = proto[REMOVE_EVENT_LISTENER];\n const nativeListeners = proto[zoneSymbol(LISTENERS_EVENT_LISTENER)] = proto[LISTENERS_EVENT_LISTENER];\n const nativeRemoveAllListeners = proto[zoneSymbol(REMOVE_ALL_LISTENERS_EVENT_LISTENER)] = proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER];\n let nativePrependEventListener;\n if (patchOptions2 && patchOptions2.prepend) {\n nativePrependEventListener = proto[zoneSymbol(patchOptions2.prepend)] = proto[patchOptions2.prepend];\n }\n function buildEventListenerOptions(options, passive) {\n if (!passive) {\n return options;\n }\n if (typeof options === \"boolean\") {\n return { capture: options, passive: true };\n }\n if (!options) {\n return { passive: true };\n }\n if (typeof options === \"object\" && options.passive !== false) {\n return __spreadProps(__spreadValues({}, options), { passive: true });\n }\n return options;\n }\n const customScheduleGlobal = function(task) {\n if (taskData.isExisting) {\n return;\n }\n return nativeAddEventListener.call(taskData.target, taskData.eventName, taskData.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, taskData.options);\n };\n const customCancelGlobal = function(task) {\n if (!task.isRemoved) {\n const symbolEventNames = zoneSymbolEventNames2[task.eventName];\n let symbolEventName;\n if (symbolEventNames) {\n symbolEventName = symbolEventNames[task.capture ? TRUE_STR : FALSE_STR];\n }\n const existingTasks = symbolEventName && task.target[symbolEventName];\n if (existingTasks) {\n for (let i = 0; i < existingTasks.length; i++) {\n const existingTask = existingTasks[i];\n if (existingTask === task) {\n existingTasks.splice(i, 1);\n task.isRemoved = true;\n if (task.removeAbortListener) {\n task.removeAbortListener();\n task.removeAbortListener = null;\n }\n if (existingTasks.length === 0) {\n task.allRemoved = true;\n task.target[symbolEventName] = null;\n }\n break;\n }\n }\n }\n }\n if (!task.allRemoved) {\n return;\n }\n return nativeRemoveEventListener.call(task.target, task.eventName, task.capture ? globalZoneAwareCaptureCallback : globalZoneAwareCallback, task.options);\n };\n const customScheduleNonGlobal = function(task) {\n return nativeAddEventListener.call(taskData.target, taskData.eventName, task.invoke, taskData.options);\n };\n const customSchedulePrepend = function(task) {\n return nativePrependEventListener.call(taskData.target, taskData.eventName, task.invoke, taskData.options);\n };\n const customCancelNonGlobal = function(task) {\n return nativeRemoveEventListener.call(task.target, task.eventName, task.invoke, task.options);\n };\n const customSchedule = useGlobalCallback ? customScheduleGlobal : customScheduleNonGlobal;\n const customCancel = useGlobalCallback ? customCancelGlobal : customCancelNonGlobal;\n const compareTaskCallbackVsDelegate = function(task, delegate) {\n const typeOfDelegate = typeof delegate;\n return typeOfDelegate === \"function\" && task.callback === delegate || typeOfDelegate === \"object\" && task.originalDelegate === delegate;\n };\n const compare = (patchOptions2 == null ? void 0 : patchOptions2.diff) || compareTaskCallbackVsDelegate;\n const unpatchedEvents = Zone[zoneSymbol(\"UNPATCHED_EVENTS\")];\n const passiveEvents = _global2[zoneSymbol(\"PASSIVE_EVENTS\")];\n function copyEventListenerOptions(options) {\n if (typeof options === \"object\" && options !== null) {\n const newOptions = __spreadValues({}, options);\n if (options.signal) {\n newOptions.signal = options.signal;\n }\n return newOptions;\n }\n return options;\n }\n const makeAddListener = function(nativeListener, addSource, customScheduleFn, customCancelFn, returnTarget2 = false, prepend = false) {\n return function() {\n const target = this || _global2;\n let eventName = arguments[0];\n if (patchOptions2 && patchOptions2.transferEventName) {\n eventName = patchOptions2.transferEventName(eventName);\n }\n let delegate = arguments[1];\n if (!delegate) {\n return nativeListener.apply(this, arguments);\n }\n if (isNode && eventName === \"uncaughtException\") {\n return nativeListener.apply(this, arguments);\n }\n let isEventListenerObject = false;\n if (typeof delegate !== \"function\") {\n if (!delegate.handleEvent) {\n return nativeListener.apply(this, arguments);\n }\n isEventListenerObject = true;\n }\n if (validateHandler && !validateHandler(nativeListener, delegate, target, arguments)) {\n return;\n }\n const passive = !!passiveEvents && passiveEvents.indexOf(eventName) !== -1;\n const options = copyEventListenerOptions(buildEventListenerOptions(arguments[2], passive));\n const signal = options == null ? void 0 : options.signal;\n if (signal == null ? void 0 : signal.aborted) {\n return;\n }\n if (unpatchedEvents) {\n for (let i = 0; i < unpatchedEvents.length; i++) {\n if (eventName === unpatchedEvents[i]) {\n if (passive) {\n return nativeListener.call(target, eventName, delegate, options);\n } else {\n return nativeListener.apply(this, arguments);\n }\n }\n }\n }\n const capture = !options ? false : typeof options === \"boolean\" ? true : options.capture;\n const once = options && typeof options === \"object\" ? options.once : false;\n const zone = Zone.current;\n let symbolEventNames = zoneSymbolEventNames2[eventName];\n if (!symbolEventNames) {\n prepareEventNames(eventName, eventNameToString);\n symbolEventNames = zoneSymbolEventNames2[eventName];\n }\n const symbolEventName = symbolEventNames[capture ? TRUE_STR : FALSE_STR];\n let existingTasks = target[symbolEventName];\n let isExisting = false;\n if (existingTasks) {\n isExisting = true;\n if (checkDuplicate) {\n for (let i = 0; i < existingTasks.length; i++) {\n if (compare(existingTasks[i], delegate)) {\n return;\n }\n }\n }\n } else {\n existingTasks = target[symbolEventName] = [];\n }\n let source;\n const constructorName = target.constructor[\"name\"];\n const targetSource = globalSources[constructorName];\n if (targetSource) {\n source = targetSource[eventName];\n }\n if (!source) {\n source = constructorName + addSource + (eventNameToString ? eventNameToString(eventName) : eventName);\n }\n taskData.options = options;\n if (once) {\n taskData.options.once = false;\n }\n taskData.target = target;\n taskData.capture = capture;\n taskData.eventName = eventName;\n taskData.isExisting = isExisting;\n const data = useGlobalCallback ? OPTIMIZED_ZONE_EVENT_TASK_DATA : void 0;\n if (data) {\n data.taskData = taskData;\n }\n if (signal) {\n taskData.options.signal = void 0;\n }\n const task = zone.scheduleEventTask(source, delegate, data, customScheduleFn, customCancelFn);\n if (signal) {\n taskData.options.signal = signal;\n const onAbort = () => task.zone.cancelTask(task);\n nativeListener.call(signal, \"abort\", onAbort, { once: true });\n task.removeAbortListener = () => signal.removeEventListener(\"abort\", onAbort);\n }\n taskData.target = null;\n if (data) {\n data.taskData = null;\n }\n if (once) {\n taskData.options.once = true;\n }\n if (typeof task.options !== \"boolean\") {\n task.options = options;\n }\n task.target = target;\n task.capture = capture;\n task.eventName = eventName;\n if (isEventListenerObject) {\n task.originalDelegate = delegate;\n }\n if (!prepend) {\n existingTasks.push(task);\n } else {\n existingTasks.unshift(task);\n }\n if (returnTarget2) {\n return target;\n }\n };\n };\n proto[ADD_EVENT_LISTENER] = makeAddListener(nativeAddEventListener, ADD_EVENT_LISTENER_SOURCE, customSchedule, customCancel, returnTarget);\n if (nativePrependEventListener) {\n proto[PREPEND_EVENT_LISTENER] = makeAddListener(nativePrependEventListener, PREPEND_EVENT_LISTENER_SOURCE, customSchedulePrepend, customCancel, returnTarget, true);\n }\n proto[REMOVE_EVENT_LISTENER] = function() {\n const target = this || _global2;\n let eventName = arguments[0];\n if (patchOptions2 && patchOptions2.transferEventName) {\n eventName = patchOptions2.transferEventName(eventName);\n }\n const options = arguments[2];\n const capture = !options ? false : typeof options === \"boolean\" ? true : options.capture;\n const delegate = arguments[1];\n if (!delegate) {\n return nativeRemoveEventListener.apply(this, arguments);\n }\n if (validateHandler && !validateHandler(nativeRemoveEventListener, delegate, target, arguments)) {\n return;\n }\n const symbolEventNames = zoneSymbolEventNames2[eventName];\n let symbolEventName;\n if (symbolEventNames) {\n symbolEventName = symbolEventNames[capture ? TRUE_STR : FALSE_STR];\n }\n const existingTasks = symbolEventName && target[symbolEventName];\n if (existingTasks) {\n for (let i = 0; i < existingTasks.length; i++) {\n const existingTask = existingTasks[i];\n if (compare(existingTask, delegate)) {\n existingTasks.splice(i, 1);\n existingTask.isRemoved = true;\n if (existingTasks.length === 0) {\n existingTask.allRemoved = true;\n target[symbolEventName] = null;\n if (!capture && typeof eventName === \"string\") {\n const onPropertySymbol = ZONE_SYMBOL_PREFIX + \"ON_PROPERTY\" + eventName;\n target[onPropertySymbol] = null;\n }\n }\n existingTask.zone.cancelTask(existingTask);\n if (returnTarget) {\n return target;\n }\n return;\n }\n }\n }\n return nativeRemoveEventListener.apply(this, arguments);\n };\n proto[LISTENERS_EVENT_LISTENER] = function() {\n const target = this || _global2;\n let eventName = arguments[0];\n if (patchOptions2 && patchOptions2.transferEventName) {\n eventName = patchOptions2.transferEventName(eventName);\n }\n const listeners = [];\n const tasks = findEventTasks(target, eventNameToString ? eventNameToString(eventName) : eventName);\n for (let i = 0; i < tasks.length; i++) {\n const task = tasks[i];\n let delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n listeners.push(delegate);\n }\n return listeners;\n };\n proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER] = function() {\n const target = this || _global2;\n let eventName = arguments[0];\n if (!eventName) {\n const keys = Object.keys(target);\n for (let i = 0; i < keys.length; i++) {\n const prop = keys[i];\n const match = EVENT_NAME_SYMBOL_REGX.exec(prop);\n let evtName = match && match[1];\n if (evtName && evtName !== \"removeListener\") {\n this[REMOVE_ALL_LISTENERS_EVENT_LISTENER].call(this, evtName);\n }\n }\n this[REMOVE_ALL_LISTENERS_EVENT_LISTENER].call(this, \"removeListener\");\n } else {\n if (patchOptions2 && patchOptions2.transferEventName) {\n eventName = patchOptions2.transferEventName(eventName);\n }\n const symbolEventNames = zoneSymbolEventNames2[eventName];\n if (symbolEventNames) {\n const symbolEventName = symbolEventNames[FALSE_STR];\n const symbolCaptureEventName = symbolEventNames[TRUE_STR];\n const tasks = target[symbolEventName];\n const captureTasks = target[symbolCaptureEventName];\n if (tasks) {\n const removeTasks = tasks.slice();\n for (let i = 0; i < removeTasks.length; i++) {\n const task = removeTasks[i];\n let delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n this[REMOVE_EVENT_LISTENER].call(this, eventName, delegate, task.options);\n }\n }\n if (captureTasks) {\n const removeTasks = captureTasks.slice();\n for (let i = 0; i < removeTasks.length; i++) {\n const task = removeTasks[i];\n let delegate = task.originalDelegate ? task.originalDelegate : task.callback;\n this[REMOVE_EVENT_LISTENER].call(this, eventName, delegate, task.options);\n }\n }\n }\n }\n if (returnTarget) {\n return this;\n }\n };\n attachOriginToPatched(proto[ADD_EVENT_LISTENER], nativeAddEventListener);\n attachOriginToPatched(proto[REMOVE_EVENT_LISTENER], nativeRemoveEventListener);\n if (nativeRemoveAllListeners) {\n attachOriginToPatched(proto[REMOVE_ALL_LISTENERS_EVENT_LISTENER], nativeRemoveAllListeners);\n }\n if (nativeListeners) {\n attachOriginToPatched(proto[LISTENERS_EVENT_LISTENER], nativeListeners);\n }\n return true;\n }\n let results = [];\n for (let i = 0; i < apis.length; i++) {\n results[i] = patchEventTargetMethods(apis[i], patchOptions);\n }\n return results;\n}\nfunction findEventTasks(target, eventName) {\n if (!eventName) {\n const foundTasks = [];\n for (let prop in target) {\n const match = EVENT_NAME_SYMBOL_REGX.exec(prop);\n let evtName = match && match[1];\n if (evtName && (!eventName || evtName === eventName)) {\n const tasks = target[prop];\n if (tasks) {\n for (let i = 0; i < tasks.length; i++) {\n foundTasks.push(tasks[i]);\n }\n }\n }\n }\n return foundTasks;\n }\n let symbolEventName = zoneSymbolEventNames2[eventName];\n if (!symbolEventName) {\n prepareEventNames(eventName);\n symbolEventName = zoneSymbolEventNames2[eventName];\n }\n const captureFalseTasks = target[symbolEventName[FALSE_STR]];\n const captureTrueTasks = target[symbolEventName[TRUE_STR]];\n if (!captureFalseTasks) {\n return captureTrueTasks ? captureTrueTasks.slice() : [];\n } else {\n return captureTrueTasks ? captureFalseTasks.concat(captureTrueTasks) : captureFalseTasks.slice();\n }\n}\nfunction patchEventPrototype(global2, api) {\n const Event = global2[\"Event\"];\n if (Event && Event.prototype) {\n api.patchMethod(Event.prototype, \"stopImmediatePropagation\", (delegate) => function(self2, args) {\n self2[IMMEDIATE_PROPAGATION_SYMBOL] = true;\n delegate && delegate.apply(self2, args);\n });\n }\n}\n\n// packages/zone.js/lib/common/queue-microtask.js\nfunction patchQueueMicrotask(global2, api) {\n api.patchMethod(global2, \"queueMicrotask\", (delegate) => {\n return function(self2, args) {\n Zone.current.scheduleMicroTask(\"queueMicrotask\", args[0]);\n };\n });\n}\n\n// packages/zone.js/lib/common/timers.js\nvar taskSymbol = zoneSymbol(\"zoneTask\");\nfunction patchTimer(window2, setName, cancelName, nameSuffix) {\n let setNative = null;\n let clearNative = null;\n setName += nameSuffix;\n cancelName += nameSuffix;\n const tasksByHandleId = {};\n function scheduleTask(task) {\n const data = task.data;\n data.args[0] = function() {\n return task.invoke.apply(this, arguments);\n };\n const handleOrId = setNative.apply(window2, data.args);\n if (isNumber(handleOrId)) {\n data.handleId = handleOrId;\n } else {\n data.handle = handleOrId;\n data.isRefreshable = isFunction(handleOrId.refresh);\n }\n return task;\n }\n function clearTask(task) {\n const { handle, handleId } = task.data;\n return clearNative.call(window2, handle != null ? handle : handleId);\n }\n setNative = patchMethod(window2, setName, (delegate) => function(self2, args) {\n var _a;\n if (isFunction(args[0])) {\n const options = {\n isRefreshable: false,\n isPeriodic: nameSuffix === \"Interval\",\n delay: nameSuffix === \"Timeout\" || nameSuffix === \"Interval\" ? args[1] || 0 : void 0,\n args\n };\n const callback = args[0];\n args[0] = function timer() {\n try {\n return callback.apply(this, arguments);\n } finally {\n const { handle: handle2, handleId: handleId2, isPeriodic: isPeriodic2, isRefreshable: isRefreshable2 } = options;\n if (!isPeriodic2 && !isRefreshable2) {\n if (handleId2) {\n delete tasksByHandleId[handleId2];\n } else if (handle2) {\n handle2[taskSymbol] = null;\n }\n }\n }\n };\n const task = scheduleMacroTaskWithCurrentZone(setName, args[0], options, scheduleTask, clearTask);\n if (!task) {\n return task;\n }\n const { handleId, handle, isRefreshable, isPeriodic } = task.data;\n if (handleId) {\n tasksByHandleId[handleId] = task;\n } else if (handle) {\n handle[taskSymbol] = task;\n if (isRefreshable && !isPeriodic) {\n const originalRefresh = handle.refresh;\n handle.refresh = function() {\n const { zone, state } = task;\n if (state === \"notScheduled\") {\n task._state = \"scheduled\";\n zone._updateTaskCount(task, 1);\n } else if (state === \"running\") {\n task._state = \"scheduling\";\n }\n return originalRefresh.call(this);\n };\n }\n }\n return (_a = handle != null ? handle : handleId) != null ? _a : task;\n } else {\n return delegate.apply(window2, args);\n }\n });\n clearNative = patchMethod(window2, cancelName, (delegate) => function(self2, args) {\n const id = args[0];\n let task;\n if (isNumber(id)) {\n task = tasksByHandleId[id];\n delete tasksByHandleId[id];\n } else {\n task = id == null ? void 0 : id[taskSymbol];\n if (task) {\n id[taskSymbol] = null;\n } else {\n task = id;\n }\n }\n if (task == null ? void 0 : task.type) {\n if (task.cancelFn) {\n task.zone.cancelTask(task);\n }\n } else {\n delegate.apply(window2, args);\n }\n });\n}\n\n// packages/zone.js/lib/browser/custom-elements.js\nfunction patchCustomElements(_global2, api) {\n const { isBrowser: isBrowser2, isMix: isMix2 } = api.getGlobalObjects();\n if (!isBrowser2 && !isMix2 || !_global2[\"customElements\"] || !(\"customElements\" in _global2)) {\n return;\n }\n const callbacks = [\n \"connectedCallback\",\n \"disconnectedCallback\",\n \"adoptedCallback\",\n \"attributeChangedCallback\",\n \"formAssociatedCallback\",\n \"formDisabledCallback\",\n \"formResetCallback\",\n \"formStateRestoreCallback\"\n ];\n api.patchCallbacks(api, _global2.customElements, \"customElements\", \"define\", callbacks);\n}\n\n// packages/zone.js/lib/browser/event-target.js\nfunction eventTargetPatch(_global2, api) {\n if (Zone[api.symbol(\"patchEventTarget\")]) {\n return;\n }\n const { eventNames, zoneSymbolEventNames: zoneSymbolEventNames3, TRUE_STR: TRUE_STR2, FALSE_STR: FALSE_STR2, ZONE_SYMBOL_PREFIX: ZONE_SYMBOL_PREFIX2 } = api.getGlobalObjects();\n for (let i = 0; i < eventNames.length; i++) {\n const eventName = eventNames[i];\n const falseEventName = eventName + FALSE_STR2;\n const trueEventName = eventName + TRUE_STR2;\n const symbol = ZONE_SYMBOL_PREFIX2 + falseEventName;\n const symbolCapture = ZONE_SYMBOL_PREFIX2 + trueEventName;\n zoneSymbolEventNames3[eventName] = {};\n zoneSymbolEventNames3[eventName][FALSE_STR2] = symbol;\n zoneSymbolEventNames3[eventName][TRUE_STR2] = symbolCapture;\n }\n const EVENT_TARGET = _global2[\"EventTarget\"];\n if (!EVENT_TARGET || !EVENT_TARGET.prototype) {\n return;\n }\n api.patchEventTarget(_global2, api, [EVENT_TARGET && EVENT_TARGET.prototype]);\n return true;\n}\nfunction patchEvent(global2, api) {\n api.patchEventPrototype(global2, api);\n}\n\n// packages/zone.js/lib/browser/property-descriptor.js\nfunction filterProperties(target, onProperties, ignoreProperties) {\n if (!ignoreProperties || ignoreProperties.length === 0) {\n return onProperties;\n }\n const tip = ignoreProperties.filter((ip) => ip.target === target);\n if (tip.length === 0) {\n return onProperties;\n }\n const targetIgnoreProperties = tip[0].ignoreProperties;\n return onProperties.filter((op) => targetIgnoreProperties.indexOf(op) === -1);\n}\nfunction patchFilteredProperties(target, onProperties, ignoreProperties, prototype) {\n if (!target) {\n return;\n }\n const filteredProperties = filterProperties(target, onProperties, ignoreProperties);\n patchOnProperties(target, filteredProperties, prototype);\n}\nfunction getOnEventNames(target) {\n return Object.getOwnPropertyNames(target).filter((name) => name.startsWith(\"on\") && name.length > 2).map((name) => name.substring(2));\n}\nfunction propertyDescriptorPatch(api, _global2) {\n if (isNode && !isMix) {\n return;\n }\n if (Zone[api.symbol(\"patchEvents\")]) {\n return;\n }\n const ignoreProperties = _global2[\"__Zone_ignore_on_properties\"];\n let patchTargets = [];\n if (isBrowser) {\n const internalWindow2 = window;\n patchTargets = patchTargets.concat([\n \"Document\",\n \"SVGElement\",\n \"Element\",\n \"HTMLElement\",\n \"HTMLBodyElement\",\n \"HTMLMediaElement\",\n \"HTMLFrameSetElement\",\n \"HTMLFrameElement\",\n \"HTMLIFrameElement\",\n \"HTMLMarqueeElement\",\n \"Worker\"\n ]);\n patchFilteredProperties(internalWindow2, getOnEventNames(internalWindow2), ignoreProperties, ObjectGetPrototypeOf(internalWindow2));\n }\n patchTargets = patchTargets.concat([\n \"XMLHttpRequest\",\n \"XMLHttpRequestEventTarget\",\n \"IDBIndex\",\n \"IDBRequest\",\n \"IDBOpenDBRequest\",\n \"IDBDatabase\",\n \"IDBTransaction\",\n \"IDBCursor\",\n \"WebSocket\"\n ]);\n for (let i = 0; i < patchTargets.length; i++) {\n const target = _global2[patchTargets[i]];\n (target == null ? void 0 : target.prototype) && patchFilteredProperties(target.prototype, getOnEventNames(target.prototype), ignoreProperties);\n }\n}\n\n// packages/zone.js/lib/browser/browser.js\nfunction patchBrowser(Zone3) {\n Zone3.__load_patch(\"timers\", (global2) => {\n const set = \"set\";\n const clear = \"clear\";\n patchTimer(global2, set, clear, \"Timeout\");\n patchTimer(global2, set, clear, \"Interval\");\n patchTimer(global2, set, clear, \"Immediate\");\n });\n Zone3.__load_patch(\"requestAnimationFrame\", (global2) => {\n patchTimer(global2, \"request\", \"cancel\", \"AnimationFrame\");\n patchTimer(global2, \"mozRequest\", \"mozCancel\", \"AnimationFrame\");\n patchTimer(global2, \"webkitRequest\", \"webkitCancel\", \"AnimationFrame\");\n });\n Zone3.__load_patch(\"blocking\", (global2, Zone4) => {\n const blockingMethods = [\"alert\", \"prompt\", \"confirm\"];\n for (let i = 0; i < blockingMethods.length; i++) {\n const name = blockingMethods[i];\n patchMethod(global2, name, (delegate, symbol, name2) => {\n return function(s, args) {\n return Zone4.current.run(delegate, global2, args, name2);\n };\n });\n }\n });\n Zone3.__load_patch(\"EventTarget\", (global2, Zone4, api) => {\n patchEvent(global2, api);\n eventTargetPatch(global2, api);\n const XMLHttpRequestEventTarget = global2[\"XMLHttpRequestEventTarget\"];\n if (XMLHttpRequestEventTarget && XMLHttpRequestEventTarget.prototype) {\n api.patchEventTarget(global2, api, [XMLHttpRequestEventTarget.prototype]);\n }\n });\n Zone3.__load_patch(\"MutationObserver\", (global2, Zone4, api) => {\n patchClass(\"MutationObserver\");\n patchClass(\"WebKitMutationObserver\");\n });\n Zone3.__load_patch(\"IntersectionObserver\", (global2, Zone4, api) => {\n patchClass(\"IntersectionObserver\");\n });\n Zone3.__load_patch(\"FileReader\", (global2, Zone4, api) => {\n patchClass(\"FileReader\");\n });\n Zone3.__load_patch(\"on_property\", (global2, Zone4, api) => {\n propertyDescriptorPatch(api, global2);\n });\n Zone3.__load_patch(\"customElements\", (global2, Zone4, api) => {\n patchCustomElements(global2, api);\n });\n Zone3.__load_patch(\"XHR\", (global2, Zone4) => {\n patchXHR(global2);\n const XHR_TASK = zoneSymbol(\"xhrTask\");\n const XHR_SYNC = zoneSymbol(\"xhrSync\");\n const XHR_LISTENER = zoneSymbol(\"xhrListener\");\n const XHR_SCHEDULED = zoneSymbol(\"xhrScheduled\");\n const XHR_URL = zoneSymbol(\"xhrURL\");\n const XHR_ERROR_BEFORE_SCHEDULED = zoneSymbol(\"xhrErrorBeforeScheduled\");\n function patchXHR(window2) {\n const XMLHttpRequest = window2[\"XMLHttpRequest\"];\n if (!XMLHttpRequest) {\n return;\n }\n const XMLHttpRequestPrototype = XMLHttpRequest.prototype;\n function findPendingTask(target) {\n return target[XHR_TASK];\n }\n let oriAddListener = XMLHttpRequestPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER];\n let oriRemoveListener = XMLHttpRequestPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];\n if (!oriAddListener) {\n const XMLHttpRequestEventTarget = window2[\"XMLHttpRequestEventTarget\"];\n if (XMLHttpRequestEventTarget) {\n const XMLHttpRequestEventTargetPrototype = XMLHttpRequestEventTarget.prototype;\n oriAddListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_ADD_EVENT_LISTENER];\n oriRemoveListener = XMLHttpRequestEventTargetPrototype[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];\n }\n }\n const READY_STATE_CHANGE = \"readystatechange\";\n const SCHEDULED = \"scheduled\";\n function scheduleTask(task) {\n const data = task.data;\n const target = data.target;\n target[XHR_SCHEDULED] = false;\n target[XHR_ERROR_BEFORE_SCHEDULED] = false;\n const listener = target[XHR_LISTENER];\n if (!oriAddListener) {\n oriAddListener = target[ZONE_SYMBOL_ADD_EVENT_LISTENER];\n oriRemoveListener = target[ZONE_SYMBOL_REMOVE_EVENT_LISTENER];\n }\n if (listener) {\n oriRemoveListener.call(target, READY_STATE_CHANGE, listener);\n }\n const newListener = target[XHR_LISTENER] = () => {\n if (target.readyState === target.DONE) {\n if (!data.aborted && target[XHR_SCHEDULED] && task.state === SCHEDULED) {\n const loadTasks = target[Zone4.__symbol__(\"loadfalse\")];\n if (target.status !== 0 && loadTasks && loadTasks.length > 0) {\n const oriInvoke = task.invoke;\n task.invoke = function() {\n const loadTasks2 = target[Zone4.__symbol__(\"loadfalse\")];\n for (let i = 0; i < loadTasks2.length; i++) {\n if (loadTasks2[i] === task) {\n loadTasks2.splice(i, 1);\n }\n }\n if (!data.aborted && task.state === SCHEDULED) {\n oriInvoke.call(task);\n }\n };\n loadTasks.push(task);\n } else {\n task.invoke();\n }\n } else if (!data.aborted && target[XHR_SCHEDULED] === false) {\n target[XHR_ERROR_BEFORE_SCHEDULED] = true;\n }\n }\n };\n oriAddListener.call(target, READY_STATE_CHANGE, newListener);\n const storedTask = target[XHR_TASK];\n if (!storedTask) {\n target[XHR_TASK] = task;\n }\n sendNative.apply(target, data.args);\n target[XHR_SCHEDULED] = true;\n return task;\n }\n function placeholderCallback() {\n }\n function clearTask(task) {\n const data = task.data;\n data.aborted = true;\n return abortNative.apply(data.target, data.args);\n }\n const openNative = patchMethod(XMLHttpRequestPrototype, \"open\", () => function(self2, args) {\n self2[XHR_SYNC] = args[2] == false;\n self2[XHR_URL] = args[1];\n return openNative.apply(self2, args);\n });\n const XMLHTTPREQUEST_SOURCE = \"XMLHttpRequest.send\";\n const fetchTaskAborting = zoneSymbol(\"fetchTaskAborting\");\n const fetchTaskScheduling = zoneSymbol(\"fetchTaskScheduling\");\n const sendNative = patchMethod(XMLHttpRequestPrototype, \"send\", () => function(self2, args) {\n if (Zone4.current[fetchTaskScheduling] === true) {\n return sendNative.apply(self2, args);\n }\n if (self2[XHR_SYNC]) {\n return sendNative.apply(self2, args);\n } else {\n const options = {\n target: self2,\n url: self2[XHR_URL],\n isPeriodic: false,\n args,\n aborted: false\n };\n const task = scheduleMacroTaskWithCurrentZone(XMLHTTPREQUEST_SOURCE, placeholderCallback, options, scheduleTask, clearTask);\n if (self2 && self2[XHR_ERROR_BEFORE_SCHEDULED] === true && !options.aborted && task.state === SCHEDULED) {\n task.invoke();\n }\n }\n });\n const abortNative = patchMethod(XMLHttpRequestPrototype, \"abort\", () => function(self2, args) {\n const task = findPendingTask(self2);\n if (task && typeof task.type == \"string\") {\n if (task.cancelFn == null || task.data && task.data.aborted) {\n return;\n }\n task.zone.cancelTask(task);\n } else if (Zone4.current[fetchTaskAborting] === true) {\n return abortNative.apply(self2, args);\n }\n });\n }\n });\n Zone3.__load_patch(\"geolocation\", (global2) => {\n if (global2[\"navigator\"] && global2[\"navigator\"].geolocation) {\n patchPrototype(global2[\"navigator\"].geolocation, [\"getCurrentPosition\", \"watchPosition\"]);\n }\n });\n Zone3.__load_patch(\"PromiseRejectionEvent\", (global2, Zone4) => {\n function findPromiseRejectionHandler(evtName) {\n return function(e) {\n const eventTasks = findEventTasks(global2, evtName);\n eventTasks.forEach((eventTask) => {\n const PromiseRejectionEvent = global2[\"PromiseRejectionEvent\"];\n if (PromiseRejectionEvent) {\n const evt = new PromiseRejectionEvent(evtName, {\n promise: e.promise,\n reason: e.rejection\n });\n eventTask.invoke(evt);\n }\n });\n };\n }\n if (global2[\"PromiseRejectionEvent\"]) {\n Zone4[zoneSymbol(\"unhandledPromiseRejectionHandler\")] = findPromiseRejectionHandler(\"unhandledrejection\");\n Zone4[zoneSymbol(\"rejectionHandledHandler\")] = findPromiseRejectionHandler(\"rejectionhandled\");\n }\n });\n Zone3.__load_patch(\"queueMicrotask\", (global2, Zone4, api) => {\n patchQueueMicrotask(global2, api);\n });\n}\n\n// packages/zone.js/lib/common/promise.js\nfunction patchPromise(Zone3) {\n Zone3.__load_patch(\"ZoneAwarePromise\", (global2, Zone4, api) => {\n const ObjectGetOwnPropertyDescriptor2 = Object.getOwnPropertyDescriptor;\n const ObjectDefineProperty2 = Object.defineProperty;\n function readableObjectToString(obj) {\n if (obj && obj.toString === Object.prototype.toString) {\n const className = obj.constructor && obj.constructor.name;\n return (className ? className : \"\") + \": \" + JSON.stringify(obj);\n }\n return obj ? obj.toString() : Object.prototype.toString.call(obj);\n }\n const __symbol__2 = api.symbol;\n const _uncaughtPromiseErrors = [];\n const isDisableWrappingUncaughtPromiseRejection = global2[__symbol__2(\"DISABLE_WRAPPING_UNCAUGHT_PROMISE_REJECTION\")] !== false;\n const symbolPromise = __symbol__2(\"Promise\");\n const symbolThen = __symbol__2(\"then\");\n const creationTrace = \"__creationTrace__\";\n api.onUnhandledError = (e) => {\n if (api.showUncaughtError()) {\n const rejection = e && e.rejection;\n if (rejection) {\n console.error(\"Unhandled Promise rejection:\", rejection instanceof Error ? rejection.message : rejection, \"; Zone:\", e.zone.name, \"; Task:\", e.task && e.task.source, \"; Value:\", rejection, rejection instanceof Error ? rejection.stack : void 0);\n } else {\n console.error(e);\n }\n }\n };\n api.microtaskDrainDone = () => {\n while (_uncaughtPromiseErrors.length) {\n const uncaughtPromiseError = _uncaughtPromiseErrors.shift();\n try {\n uncaughtPromiseError.zone.runGuarded(() => {\n if (uncaughtPromiseError.throwOriginal) {\n throw uncaughtPromiseError.rejection;\n }\n throw uncaughtPromiseError;\n });\n } catch (error) {\n handleUnhandledRejection(error);\n }\n }\n };\n const UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL = __symbol__2(\"unhandledPromiseRejectionHandler\");\n function handleUnhandledRejection(e) {\n api.onUnhandledError(e);\n try {\n const handler = Zone4[UNHANDLED_PROMISE_REJECTION_HANDLER_SYMBOL];\n if (typeof handler === \"function\") {\n handler.call(this, e);\n }\n } catch (err) {\n }\n }\n function isThenable(value) {\n return value && typeof value.then === \"function\";\n }\n function forwardResolution(value) {\n return value;\n }\n function forwardRejection(rejection) {\n return ZoneAwarePromise.reject(rejection);\n }\n const symbolState = __symbol__2(\"state\");\n const symbolValue = __symbol__2(\"value\");\n const symbolFinally = __symbol__2(\"finally\");\n const symbolParentPromiseValue = __symbol__2(\"parentPromiseValue\");\n const symbolParentPromiseState = __symbol__2(\"parentPromiseState\");\n const source = \"Promise.then\";\n const UNRESOLVED = null;\n const RESOLVED = true;\n const REJECTED = false;\n const REJECTED_NO_CATCH = 0;\n function makeResolver(promise, state) {\n return (v) => {\n try {\n resolvePromise(promise, state, v);\n } catch (err) {\n resolvePromise(promise, false, err);\n }\n };\n }\n const once = function() {\n let wasCalled = false;\n return function wrapper(wrappedFunction) {\n return function() {\n if (wasCalled) {\n return;\n }\n wasCalled = true;\n wrappedFunction.apply(null, arguments);\n };\n };\n };\n const TYPE_ERROR = \"Promise resolved with itself\";\n const CURRENT_TASK_TRACE_SYMBOL = __symbol__2(\"currentTaskTrace\");\n function resolvePromise(promise, state, value) {\n const onceWrapper = once();\n if (promise === value) {\n throw new TypeError(TYPE_ERROR);\n }\n if (promise[symbolState] === UNRESOLVED) {\n let then = null;\n try {\n if (typeof value === \"object\" || typeof value === \"function\") {\n then = value && value.then;\n }\n } catch (err) {\n onceWrapper(() => {\n resolvePromise(promise, false, err);\n })();\n return promise;\n }\n if (state !== REJECTED && value instanceof ZoneAwarePromise && value.hasOwnProperty(symbolState) && value.hasOwnProperty(symbolValue) && value[symbolState] !== UNRESOLVED) {\n clearRejectedNoCatch(value);\n resolvePromise(promise, value[symbolState], value[symbolValue]);\n } else if (state !== REJECTED && typeof then === \"function\") {\n try {\n then.call(value, onceWrapper(makeResolver(promise, state)), onceWrapper(makeResolver(promise, false)));\n } catch (err) {\n onceWrapper(() => {\n resolvePromise(promise, false, err);\n })();\n }\n } else {\n promise[symbolState] = state;\n const queue = promise[symbolValue];\n promise[symbolValue] = value;\n if (promise[symbolFinally] === symbolFinally) {\n if (state === RESOLVED) {\n promise[symbolState] = promise[symbolParentPromiseState];\n promise[symbolValue] = promise[symbolParentPromiseValue];\n }\n }\n if (state === REJECTED && value instanceof Error) {\n const trace = Zone4.currentTask && Zone4.currentTask.data && Zone4.currentTask.data[creationTrace];\n if (trace) {\n ObjectDefineProperty2(value, CURRENT_TASK_TRACE_SYMBOL, {\n configurable: true,\n enumerable: false,\n writable: true,\n value: trace\n });\n }\n }\n for (let i = 0; i < queue.length; ) {\n scheduleResolveOrReject(promise, queue[i++], queue[i++], queue[i++], queue[i++]);\n }\n if (queue.length == 0 && state == REJECTED) {\n promise[symbolState] = REJECTED_NO_CATCH;\n let uncaughtPromiseError = value;\n try {\n throw new Error(\"Uncaught (in promise): \" + readableObjectToString(value) + (value && value.stack ? \"\\n\" + value.stack : \"\"));\n } catch (err) {\n uncaughtPromiseError = err;\n }\n if (isDisableWrappingUncaughtPromiseRejection) {\n uncaughtPromiseError.throwOriginal = true;\n }\n uncaughtPromiseError.rejection = value;\n uncaughtPromiseError.promise = promise;\n uncaughtPromiseError.zone = Zone4.current;\n uncaughtPromiseError.task = Zone4.currentTask;\n _uncaughtPromiseErrors.push(uncaughtPromiseError);\n api.scheduleMicroTask();\n }\n }\n }\n return promise;\n }\n const REJECTION_HANDLED_HANDLER = __symbol__2(\"rejectionHandledHandler\");\n function clearRejectedNoCatch(promise) {\n if (promise[symbolState] === REJECTED_NO_CATCH) {\n try {\n const handler = Zone4[REJECTION_HANDLED_HANDLER];\n if (handler && typeof handler === \"function\") {\n handler.call(this, { rejection: promise[symbolValue], promise });\n }\n } catch (err) {\n }\n promise[symbolState] = REJECTED;\n for (let i = 0; i < _uncaughtPromiseErrors.length; i++) {\n if (promise === _uncaughtPromiseErrors[i].promise) {\n _uncaughtPromiseErrors.splice(i, 1);\n }\n }\n }\n }\n function scheduleResolveOrReject(promise, zone, chainPromise, onFulfilled, onRejected) {\n clearRejectedNoCatch(promise);\n const promiseState = promise[symbolState];\n const delegate = promiseState ? typeof onFulfilled === \"function\" ? onFulfilled : forwardResolution : typeof onRejected === \"function\" ? onRejected : forwardRejection;\n zone.scheduleMicroTask(source, () => {\n try {\n const parentPromiseValue = promise[symbolValue];\n const isFinallyPromise = !!chainPromise && symbolFinally === chainPromise[symbolFinally];\n if (isFinallyPromise) {\n chainPromise[symbolParentPromiseValue] = parentPromiseValue;\n chainPromise[symbolParentPromiseState] = promiseState;\n }\n const value = zone.run(delegate, void 0, isFinallyPromise && delegate !== forwardRejection && delegate !== forwardResolution ? [] : [parentPromiseValue]);\n resolvePromise(chainPromise, true, value);\n } catch (error) {\n resolvePromise(chainPromise, false, error);\n }\n }, chainPromise);\n }\n const ZONE_AWARE_PROMISE_TO_STRING = \"function ZoneAwarePromise() { [native code] }\";\n const noop = function() {\n };\n const AggregateError = global2.AggregateError;\n class ZoneAwarePromise {\n static toString() {\n return ZONE_AWARE_PROMISE_TO_STRING;\n }\n static resolve(value) {\n if (value instanceof ZoneAwarePromise) {\n return value;\n }\n return resolvePromise(new this(null), RESOLVED, value);\n }\n static reject(error) {\n return resolvePromise(new this(null), REJECTED, error);\n }\n static withResolvers() {\n const result = {};\n result.promise = new ZoneAwarePromise((res, rej) => {\n result.resolve = res;\n result.reject = rej;\n });\n return result;\n }\n static any(values) {\n if (!values || typeof values[Symbol.iterator] !== \"function\") {\n return Promise.reject(new AggregateError([], \"All promises were rejected\"));\n }\n const promises = [];\n let count = 0;\n try {\n for (let v of values) {\n count++;\n promises.push(ZoneAwarePromise.resolve(v));\n }\n } catch (err) {\n return Promise.reject(new AggregateError([], \"All promises were rejected\"));\n }\n if (count === 0) {\n return Promise.reject(new AggregateError([], \"All promises were rejected\"));\n }\n let finished = false;\n const errors = [];\n return new ZoneAwarePromise((resolve, reject) => {\n for (let i = 0; i < promises.length; i++) {\n promises[i].then((v) => {\n if (finished) {\n return;\n }\n finished = true;\n resolve(v);\n }, (err) => {\n errors.push(err);\n count--;\n if (count === 0) {\n finished = true;\n reject(new AggregateError(errors, \"All promises were rejected\"));\n }\n });\n }\n });\n }\n static race(values) {\n let resolve;\n let reject;\n let promise = new this((res, rej) => {\n resolve = res;\n reject = rej;\n });\n function onResolve(value) {\n resolve(value);\n }\n function onReject(error) {\n reject(error);\n }\n for (let value of values) {\n if (!isThenable(value)) {\n value = this.resolve(value);\n }\n value.then(onResolve, onReject);\n }\n return promise;\n }\n static all(values) {\n return ZoneAwarePromise.allWithCallback(values);\n }\n static allSettled(values) {\n const P = this && this.prototype instanceof ZoneAwarePromise ? this : ZoneAwarePromise;\n return P.allWithCallback(values, {\n thenCallback: (value) => ({ status: \"fulfilled\", value }),\n errorCallback: (err) => ({ status: \"rejected\", reason: err })\n });\n }\n static allWithCallback(values, callback) {\n let resolve;\n let reject;\n let promise = new this((res, rej) => {\n resolve = res;\n reject = rej;\n });\n let unresolvedCount = 2;\n let valueIndex = 0;\n const resolvedValues = [];\n for (let value of values) {\n if (!isThenable(value)) {\n value = this.resolve(value);\n }\n const curValueIndex = valueIndex;\n try {\n value.then((value2) => {\n resolvedValues[curValueIndex] = callback ? callback.thenCallback(value2) : value2;\n unresolvedCount--;\n if (unresolvedCount === 0) {\n resolve(resolvedValues);\n }\n }, (err) => {\n if (!callback) {\n reject(err);\n } else {\n resolvedValues[curValueIndex] = callback.errorCallback(err);\n unresolvedCount--;\n if (unresolvedCount === 0) {\n resolve(resolvedValues);\n }\n }\n });\n } catch (thenErr) {\n reject(thenErr);\n }\n unresolvedCount++;\n valueIndex++;\n }\n unresolvedCount -= 2;\n if (unresolvedCount === 0) {\n resolve(resolvedValues);\n }\n return promise;\n }\n constructor(executor) {\n const promise = this;\n if (!(promise instanceof ZoneAwarePromise)) {\n throw new Error(\"Must be an instanceof Promise.\");\n }\n promise[symbolState] = UNRESOLVED;\n promise[symbolValue] = [];\n try {\n const onceWrapper = once();\n executor && executor(onceWrapper(makeResolver(promise, RESOLVED)), onceWrapper(makeResolver(promise, REJECTED)));\n } catch (error) {\n resolvePromise(promise, false, error);\n }\n }\n get [Symbol.toStringTag]() {\n return \"Promise\";\n }\n get [Symbol.species]() {\n return ZoneAwarePromise;\n }\n then(onFulfilled, onRejected) {\n var _a;\n let C = (_a = this.constructor) == null ? void 0 : _a[Symbol.species];\n if (!C || typeof C !== \"function\") {\n C = this.constructor || ZoneAwarePromise;\n }\n const chainPromise = new C(noop);\n const zone = Zone4.current;\n if (this[symbolState] == UNRESOLVED) {\n this[symbolValue].push(zone, chainPromise, onFulfilled, onRejected);\n } else {\n scheduleResolveOrReject(this, zone, chainPromise, onFulfilled, onRejected);\n }\n return chainPromise;\n }\n catch(onRejected) {\n return this.then(null, onRejected);\n }\n finally(onFinally) {\n var _a;\n let C = (_a = this.constructor) == null ? void 0 : _a[Symbol.species];\n if (!C || typeof C !== \"function\") {\n C = ZoneAwarePromise;\n }\n const chainPromise = new C(noop);\n chainPromise[symbolFinally] = symbolFinally;\n const zone = Zone4.current;\n if (this[symbolState] == UNRESOLVED) {\n this[symbolValue].push(zone, chainPromise, onFinally, onFinally);\n } else {\n scheduleResolveOrReject(this, zone, chainPromise, onFinally, onFinally);\n }\n return chainPromise;\n }\n }\n ZoneAwarePromise[\"resolve\"] = ZoneAwarePromise.resolve;\n ZoneAwarePromise[\"reject\"] = ZoneAwarePromise.reject;\n ZoneAwarePromise[\"race\"] = ZoneAwarePromise.race;\n ZoneAwarePromise[\"all\"] = ZoneAwarePromise.all;\n const NativePromise = global2[symbolPromise] = global2[\"Promise\"];\n global2[\"Promise\"] = ZoneAwarePromise;\n const symbolThenPatched = __symbol__2(\"thenPatched\");\n function patchThen(Ctor) {\n const proto = Ctor.prototype;\n const prop = ObjectGetOwnPropertyDescriptor2(proto, \"then\");\n if (prop && (prop.writable === false || !prop.configurable)) {\n return;\n }\n const originalThen = proto.then;\n proto[symbolThen] = originalThen;\n Ctor.prototype.then = function(onResolve, onReject) {\n const wrapped = new ZoneAwarePromise((resolve, reject) => {\n originalThen.call(this, resolve, reject);\n });\n return wrapped.then(onResolve, onReject);\n };\n Ctor[symbolThenPatched] = true;\n }\n api.patchThen = patchThen;\n function zoneify(fn) {\n return function(self2, args) {\n let resultPromise = fn.apply(self2, args);\n if (resultPromise instanceof ZoneAwarePromise) {\n return resultPromise;\n }\n let ctor = resultPromise.constructor;\n if (!ctor[symbolThenPatched]) {\n patchThen(ctor);\n }\n return resultPromise;\n };\n }\n if (NativePromise) {\n patchThen(NativePromise);\n const nativeTry = NativePromise[\"try\"];\n if (nativeTry && typeof nativeTry === \"function\") {\n ZoneAwarePromise[\"try\"] = nativeTry;\n }\n patchMethod(global2, \"fetch\", (delegate) => zoneify(delegate));\n }\n Promise[Zone4.__symbol__(\"uncaughtPromiseErrors\")] = _uncaughtPromiseErrors;\n return ZoneAwarePromise;\n });\n}\n\n// packages/zone.js/lib/common/to-string.js\nfunction patchToString(Zone3) {\n Zone3.__load_patch(\"toString\", (global2) => {\n const originalFunctionToString = Function.prototype.toString;\n const ORIGINAL_DELEGATE_SYMBOL = zoneSymbol(\"OriginalDelegate\");\n const PROMISE_SYMBOL = zoneSymbol(\"Promise\");\n const ERROR_SYMBOL = zoneSymbol(\"Error\");\n const newFunctionToString = function toString() {\n if (typeof this === \"function\") {\n const originalDelegate = this[ORIGINAL_DELEGATE_SYMBOL];\n if (originalDelegate) {\n if (typeof originalDelegate === \"function\") {\n return originalFunctionToString.call(originalDelegate);\n } else {\n return Object.prototype.toString.call(originalDelegate);\n }\n }\n if (this === Promise) {\n const nativePromise = global2[PROMISE_SYMBOL];\n if (nativePromise) {\n return originalFunctionToString.call(nativePromise);\n }\n }\n if (this === Error) {\n const nativeError = global2[ERROR_SYMBOL];\n if (nativeError) {\n return originalFunctionToString.call(nativeError);\n }\n }\n }\n return originalFunctionToString.call(this);\n };\n newFunctionToString[ORIGINAL_DELEGATE_SYMBOL] = originalFunctionToString;\n Function.prototype.toString = newFunctionToString;\n const originalObjectToString = Object.prototype.toString;\n const PROMISE_OBJECT_TO_STRING = \"[object Promise]\";\n Object.prototype.toString = function() {\n if (typeof Promise === \"function\" && this instanceof Promise) {\n return PROMISE_OBJECT_TO_STRING;\n }\n return originalObjectToString.call(this);\n };\n });\n}\n\n// packages/zone.js/lib/browser/browser-util.js\nfunction patchCallbacks(api, target, targetName, method, callbacks) {\n const symbol = Zone.__symbol__(method);\n if (target[symbol]) {\n return;\n }\n const nativeDelegate = target[symbol] = target[method];\n target[method] = function(name, opts, options) {\n if (opts && opts.prototype) {\n callbacks.forEach(function(callback) {\n const source = `${targetName}.${method}::` + callback;\n const prototype = opts.prototype;\n try {\n if (prototype.hasOwnProperty(callback)) {\n const descriptor = api.ObjectGetOwnPropertyDescriptor(prototype, callback);\n if (descriptor && descriptor.value) {\n descriptor.value = api.wrapWithCurrentZone(descriptor.value, source);\n api._redefineProperty(opts.prototype, callback, descriptor);\n } else if (prototype[callback]) {\n prototype[callback] = api.wrapWithCurrentZone(prototype[callback], source);\n }\n } else if (prototype[callback]) {\n prototype[callback] = api.wrapWithCurrentZone(prototype[callback], source);\n }\n } catch (e) {\n }\n });\n }\n return nativeDelegate.call(target, name, opts, options);\n };\n api.attachOriginToPatched(target[method], nativeDelegate);\n}\n\n// packages/zone.js/lib/browser/api-util.js\nfunction patchUtil(Zone3) {\n Zone3.__load_patch(\"util\", (global2, Zone4, api) => {\n const eventNames = getOnEventNames(global2);\n api.patchOnProperties = patchOnProperties;\n api.patchMethod = patchMethod;\n api.bindArguments = bindArguments;\n api.patchMacroTask = patchMacroTask;\n const SYMBOL_BLACK_LISTED_EVENTS = Zone4.__symbol__(\"BLACK_LISTED_EVENTS\");\n const SYMBOL_UNPATCHED_EVENTS = Zone4.__symbol__(\"UNPATCHED_EVENTS\");\n if (global2[SYMBOL_UNPATCHED_EVENTS]) {\n global2[SYMBOL_BLACK_LISTED_EVENTS] = global2[SYMBOL_UNPATCHED_EVENTS];\n }\n if (global2[SYMBOL_BLACK_LISTED_EVENTS]) {\n Zone4[SYMBOL_BLACK_LISTED_EVENTS] = Zone4[SYMBOL_UNPATCHED_EVENTS] = global2[SYMBOL_BLACK_LISTED_EVENTS];\n }\n api.patchEventPrototype = patchEventPrototype;\n api.patchEventTarget = patchEventTarget;\n api.ObjectDefineProperty = ObjectDefineProperty;\n api.ObjectGetOwnPropertyDescriptor = ObjectGetOwnPropertyDescriptor;\n api.ObjectCreate = ObjectCreate;\n api.ArraySlice = ArraySlice;\n api.patchClass = patchClass;\n api.wrapWithCurrentZone = wrapWithCurrentZone;\n api.filterProperties = filterProperties;\n api.attachOriginToPatched = attachOriginToPatched;\n api._redefineProperty = Object.defineProperty;\n api.patchCallbacks = patchCallbacks;\n api.getGlobalObjects = () => ({\n globalSources,\n zoneSymbolEventNames: zoneSymbolEventNames2,\n eventNames,\n isBrowser,\n isMix,\n isNode,\n TRUE_STR,\n FALSE_STR,\n ZONE_SYMBOL_PREFIX,\n ADD_EVENT_LISTENER_STR,\n REMOVE_EVENT_LISTENER_STR\n });\n });\n}\n\n// packages/zone.js/lib/browser/rollup-common.js\nfunction patchCommon(Zone3) {\n patchPromise(Zone3);\n patchToString(Zone3);\n patchUtil(Zone3);\n}\n\n// packages/zone.js/lib/browser/rollup-main.js\nvar Zone2 = loadZone();\npatchCommon(Zone2);\npatchBrowser(Zone2);\n","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createContextKey } from '@opentelemetry/api';\nconst SUPPRESS_TRACING_KEY = createContextKey('OpenTelemetry SDK Context Key SUPPRESS_TRACING');\nexport function suppressTracing(context) {\n return context.setValue(SUPPRESS_TRACING_KEY, true);\n}\nexport function unsuppressTracing(context) {\n return context.deleteValue(SUPPRESS_TRACING_KEY);\n}\nexport function isTracingSuppressed(context) {\n return context.getValue(SUPPRESS_TRACING_KEY) === true;\n}\n//# sourceMappingURL=suppress-tracing.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport const BAGGAGE_KEY_PAIR_SEPARATOR = '=';\nexport const BAGGAGE_PROPERTIES_SEPARATOR = ';';\nexport const BAGGAGE_ITEMS_SEPARATOR = ',';\n// Name of the http header used to propagate the baggage\nexport const BAGGAGE_HEADER = 'baggage';\n// Maximum number of name-value pairs allowed by w3c spec\nexport const BAGGAGE_MAX_NAME_VALUE_PAIRS = 180;\n// Maximum number of bytes per a single name-value pair allowed by w3c spec\nexport const BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096;\n// Maximum total length of all name-value pairs allowed by w3c spec\nexport const BAGGAGE_MAX_TOTAL_LENGTH = 8192;\n//# sourceMappingURL=constants.js.map","import { baggageEntryMetadataFromString } from '@opentelemetry/api';\nimport { BAGGAGE_ITEMS_SEPARATOR, BAGGAGE_PROPERTIES_SEPARATOR, BAGGAGE_KEY_PAIR_SEPARATOR, BAGGAGE_MAX_TOTAL_LENGTH, } from './constants';\nexport function serializeKeyPairs(keyPairs) {\n return keyPairs.reduce((hValue, current) => {\n const value = `${hValue}${hValue !== '' ? BAGGAGE_ITEMS_SEPARATOR : ''}${current}`;\n return value.length > BAGGAGE_MAX_TOTAL_LENGTH ? hValue : value;\n }, '');\n}\nexport function getKeyPairs(baggage) {\n return baggage.getAllEntries().map(([key, value]) => {\n let entry = `${encodeURIComponent(key)}=${encodeURIComponent(value.value)}`;\n // include opaque metadata if provided\n // NOTE: we intentionally don't URI-encode the metadata - that responsibility falls on the metadata implementation\n if (value.metadata !== undefined) {\n entry += BAGGAGE_PROPERTIES_SEPARATOR + value.metadata.toString();\n }\n return entry;\n });\n}\nexport function parsePairKeyValue(entry) {\n if (!entry)\n return;\n const metadataSeparatorIndex = entry.indexOf(BAGGAGE_PROPERTIES_SEPARATOR);\n const keyPairPart = metadataSeparatorIndex === -1\n ? entry\n : entry.substring(0, metadataSeparatorIndex);\n const separatorIndex = keyPairPart.indexOf(BAGGAGE_KEY_PAIR_SEPARATOR);\n if (separatorIndex <= 0)\n return;\n const rawKey = keyPairPart.substring(0, separatorIndex).trim();\n const rawValue = keyPairPart.substring(separatorIndex + 1).trim();\n if (!rawKey || !rawValue)\n return;\n let key;\n let value;\n try {\n key = decodeURIComponent(rawKey);\n value = decodeURIComponent(rawValue);\n }\n catch {\n return;\n }\n let metadata;\n if (metadataSeparatorIndex !== -1 &&\n metadataSeparatorIndex < entry.length - 1) {\n const metadataString = entry.substring(metadataSeparatorIndex + 1);\n metadata = baggageEntryMetadataFromString(metadataString);\n }\n return { key, value, metadata };\n}\n/**\n * Parse a string serialized in the baggage HTTP Format (without metadata):\n * https://github.com/w3c/baggage/blob/master/baggage/HTTP_HEADER_FORMAT.md\n */\nexport function parseKeyPairsIntoRecord(value) {\n const result = {};\n if (typeof value === 'string' && value.length > 0) {\n value.split(BAGGAGE_ITEMS_SEPARATOR).forEach(entry => {\n const keyPair = parsePairKeyValue(entry);\n if (keyPair !== undefined && keyPair.value.length > 0) {\n result[keyPair.key] = keyPair.value;\n }\n });\n }\n return result;\n}\n//# sourceMappingURL=utils.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { propagation } from '@opentelemetry/api';\nimport { isTracingSuppressed } from '../../trace/suppress-tracing';\nimport { BAGGAGE_HEADER, BAGGAGE_ITEMS_SEPARATOR, BAGGAGE_MAX_NAME_VALUE_PAIRS, BAGGAGE_MAX_PER_NAME_VALUE_PAIRS, } from '../constants';\nimport { getKeyPairs, parsePairKeyValue, serializeKeyPairs } from '../utils';\n/**\n * Propagates {@link Baggage} through Context format propagation.\n *\n * Based on the Baggage specification:\n * https://w3c.github.io/baggage/\n */\nexport class W3CBaggagePropagator {\n inject(context, carrier, setter) {\n const baggage = propagation.getBaggage(context);\n if (!baggage || isTracingSuppressed(context))\n return;\n const keyPairs = getKeyPairs(baggage)\n .filter((pair) => {\n return pair.length <= BAGGAGE_MAX_PER_NAME_VALUE_PAIRS;\n })\n .slice(0, BAGGAGE_MAX_NAME_VALUE_PAIRS);\n const headerValue = serializeKeyPairs(keyPairs);\n if (headerValue.length > 0) {\n setter.set(carrier, BAGGAGE_HEADER, headerValue);\n }\n }\n extract(context, carrier, getter) {\n const headerValue = getter.get(carrier, BAGGAGE_HEADER);\n const baggageString = Array.isArray(headerValue)\n ? headerValue.join(BAGGAGE_ITEMS_SEPARATOR)\n : headerValue;\n if (!baggageString)\n return context;\n const baggage = {};\n if (baggageString.length === 0) {\n return context;\n }\n const pairs = baggageString.split(BAGGAGE_ITEMS_SEPARATOR);\n pairs.forEach(entry => {\n const keyPair = parsePairKeyValue(entry);\n if (keyPair) {\n const baggageEntry = { value: keyPair.value };\n if (keyPair.metadata) {\n baggageEntry.metadata = keyPair.metadata;\n }\n baggage[keyPair.key] = baggageEntry;\n }\n });\n if (Object.entries(baggage).length === 0) {\n return context;\n }\n return propagation.setBaggage(context, propagation.createBaggage(baggage));\n }\n fields() {\n return [BAGGAGE_HEADER];\n }\n}\n//# sourceMappingURL=W3CBaggagePropagator.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\nexport function sanitizeAttributes(attributes) {\n const out = {};\n if (typeof attributes !== 'object' || attributes == null) {\n return out;\n }\n for (const key in attributes) {\n if (!Object.prototype.hasOwnProperty.call(attributes, key)) {\n continue;\n }\n if (!isAttributeKey(key)) {\n diag.warn(`Invalid attribute key: ${key}`);\n continue;\n }\n const val = attributes[key];\n if (!isAttributeValue(val)) {\n diag.warn(`Invalid attribute value set for key: ${key}`);\n continue;\n }\n if (Array.isArray(val)) {\n out[key] = val.slice();\n }\n else {\n out[key] = val;\n }\n }\n return out;\n}\nexport function isAttributeKey(key) {\n return typeof key === 'string' && key !== '';\n}\nexport function isAttributeValue(val) {\n if (val == null) {\n return true;\n }\n if (Array.isArray(val)) {\n return isHomogeneousAttributeValueArray(val);\n }\n return isValidPrimitiveAttributeValueType(typeof val);\n}\nfunction isHomogeneousAttributeValueArray(arr) {\n let type;\n for (const element of arr) {\n // null/undefined elements are allowed\n if (element == null)\n continue;\n const elementType = typeof element;\n if (elementType === type) {\n continue;\n }\n if (!type) {\n if (isValidPrimitiveAttributeValueType(elementType)) {\n type = elementType;\n continue;\n }\n // encountered an invalid primitive\n return false;\n }\n return false;\n }\n return true;\n}\nfunction isValidPrimitiveAttributeValueType(valType) {\n switch (valType) {\n case 'number':\n case 'boolean':\n case 'string':\n return true;\n }\n return false;\n}\n//# sourceMappingURL=attributes.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\n/**\n * Returns a function that logs an error using the provided logger, or a\n * console logger if one was not provided.\n */\nexport function loggingErrorHandler() {\n return (ex) => {\n diag.error(stringifyException(ex));\n };\n}\n/**\n * Converts an exception into a string representation\n * @param {Exception} ex\n */\nfunction stringifyException(ex) {\n if (typeof ex === 'string') {\n return ex;\n }\n else {\n return JSON.stringify(flattenException(ex));\n }\n}\n/**\n * Flattens an exception into key-value pairs by traversing the prototype chain\n * and coercing values to strings. Duplicate properties will not be overwritten;\n * the first insert wins.\n */\nfunction flattenException(ex) {\n const result = {};\n let current = ex;\n while (current !== null) {\n Object.getOwnPropertyNames(current).forEach(propertyName => {\n if (result[propertyName])\n return;\n const value = current[propertyName];\n if (value) {\n result[propertyName] = String(value);\n }\n });\n current = Object.getPrototypeOf(current);\n }\n return result;\n}\n//# sourceMappingURL=logging-error-handler.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { loggingErrorHandler } from './logging-error-handler';\n/** The global error handler delegate */\nlet delegateHandler = loggingErrorHandler();\n/**\n * Set the global error handler\n * @param {ErrorHandler} handler\n */\nexport function setGlobalErrorHandler(handler) {\n delegateHandler = handler;\n}\n/**\n * Return the global error handler\n * @param {Exception} ex\n */\nexport function globalErrorHandler(ex) {\n try {\n delegateHandler(ex);\n }\n catch { } // eslint-disable-line no-empty\n}\n//# sourceMappingURL=global-error-handler.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport function getStringFromEnv(_) {\n return undefined;\n}\nexport function getBooleanFromEnv(_) {\n return undefined;\n}\nexport function getNumberFromEnv(_) {\n return undefined;\n}\nexport function getStringListFromEnv(_) {\n return undefined;\n}\n//# sourceMappingURL=environment.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '2.7.1';\n//# sourceMappingURL=version.js.map","/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//----------------------------------------------------------------------------------------------------------\n// DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/registry/stable/attributes.ts.j2\n//----------------------------------------------------------------------------------------------------------\n/**\n * ASP.NET Core exception middleware handling result.\n *\n * @example handled\n * @example unhandled\n */\nexport const ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT = 'aspnetcore.diagnostics.exception.result';\n/**\n * Enum value \"aborted\" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.\n *\n * Exception handling didn't run because the request was aborted.\n */\nexport const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED = \"aborted\";\n/**\n * Enum value \"handled\" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.\n *\n * Exception was handled by the exception handling middleware.\n */\nexport const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED = \"handled\";\n/**\n * Enum value \"skipped\" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.\n *\n * Exception handling was skipped because the response had started.\n */\nexport const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED = \"skipped\";\n/**\n * Enum value \"unhandled\" for attribute {@link ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT}.\n *\n * Exception was not handled by the exception handling middleware.\n */\nexport const ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED = \"unhandled\";\n/**\n * Full type name of the [`IExceptionHandler`](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.diagnostics.iexceptionhandler) implementation that handled the exception.\n *\n * @example Contoso.MyHandler\n */\nexport const ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE = 'aspnetcore.diagnostics.handler.type';\n/**\n * Rate limiting policy name.\n *\n * @example fixed\n * @example sliding\n * @example token\n */\nexport const ATTR_ASPNETCORE_RATE_LIMITING_POLICY = 'aspnetcore.rate_limiting.policy';\n/**\n * Rate-limiting result, shows whether the lease was acquired or contains a rejection reason\n *\n * @example acquired\n * @example request_canceled\n */\nexport const ATTR_ASPNETCORE_RATE_LIMITING_RESULT = 'aspnetcore.rate_limiting.result';\n/**\n * Enum value \"acquired\" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.\n *\n * Lease was acquired\n */\nexport const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED = \"acquired\";\n/**\n * Enum value \"endpoint_limiter\" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.\n *\n * Lease request was rejected by the endpoint limiter\n */\nexport const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER = \"endpoint_limiter\";\n/**\n * Enum value \"global_limiter\" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.\n *\n * Lease request was rejected by the global limiter\n */\nexport const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER = \"global_limiter\";\n/**\n * Enum value \"request_canceled\" for attribute {@link ATTR_ASPNETCORE_RATE_LIMITING_RESULT}.\n *\n * Lease request was canceled\n */\nexport const ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED = \"request_canceled\";\n/**\n * Flag indicating if request was handled by the application pipeline.\n *\n * @example true\n */\nexport const ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED = 'aspnetcore.request.is_unhandled';\n/**\n * A value that indicates whether the matched route is a fallback route.\n *\n * @example true\n */\nexport const ATTR_ASPNETCORE_ROUTING_IS_FALLBACK = 'aspnetcore.routing.is_fallback';\n/**\n * Match result - success or failure\n *\n * @example success\n * @example failure\n */\nexport const ATTR_ASPNETCORE_ROUTING_MATCH_STATUS = 'aspnetcore.routing.match_status';\n/**\n * Enum value \"failure\" for attribute {@link ATTR_ASPNETCORE_ROUTING_MATCH_STATUS}.\n *\n * Match failed\n */\nexport const ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE = \"failure\";\n/**\n * Enum value \"success\" for attribute {@link ATTR_ASPNETCORE_ROUTING_MATCH_STATUS}.\n *\n * Match succeeded\n */\nexport const ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS = \"success\";\n/**\n * A value that indicates whether the user is authenticated.\n *\n * @example true\n */\nexport const ATTR_ASPNETCORE_USER_IS_AUTHENTICATED = 'aspnetcore.user.is_authenticated';\n/**\n * Client address - domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.\n *\n * @example client.example.com\n * @example 10.1.2.80\n * @example /tmp/my.sock\n *\n * @note When observed from the server side, and when communicating through an intermediary, `client.address` **SHOULD** represent the client address behind any intermediaries, for example proxies, if it's available.\n */\nexport const ATTR_CLIENT_ADDRESS = 'client.address';\n/**\n * Client port number.\n *\n * @example 65123\n *\n * @note When observed from the server side, and when communicating through an intermediary, `client.port` **SHOULD** represent the client port behind any intermediaries, for example proxies, if it's available.\n */\nexport const ATTR_CLIENT_PORT = 'client.port';\n/**\n * The column number in `code.file.path` best representing the operation. It **SHOULD** point within the code unit named in `code.function.name`. This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Line'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example 16\n */\nexport const ATTR_CODE_COLUMN_NUMBER = 'code.column.number';\n/**\n * The source code file name that identifies the code unit as uniquely as possible (preferably an absolute file path). This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example \"/usr/local/MyApplication/content_root/app/index.php\"\n */\nexport const ATTR_CODE_FILE_PATH = 'code.file.path';\n/**\n * The method or function fully-qualified name without arguments. The value should fit the natural representation of the language runtime, which is also likely the same used within `code.stacktrace` attribute value. This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Function'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example com.example.MyHttpService.serveRequest\n * @example GuzzleHttp\\\\Client::transfer\n * @example fopen\n *\n * @note Values and format depends on each language runtime, thus it is impossible to provide an exhaustive list of examples.\n * The values are usually the same (or prefixes of) the ones found in native stack trace representation stored in\n * `code.stacktrace` without information on arguments.\n *\n * Examples:\n *\n * - Java method: `com.example.MyHttpService.serveRequest`\n * - Java anonymous class method: `com.mycompany.Main$1.myMethod`\n * - Java lambda method: `com.mycompany.Main$$Lambda/0x0000748ae4149c00.myMethod`\n * - PHP function: `GuzzleHttp\\Client::transfer`\n * - Go function: `github.com/my/repo/pkg.foo.func5`\n * - Elixir: `OpenTelemetry.Ctx.new`\n * - Erlang: `opentelemetry_ctx:new`\n * - Rust: `playground::my_module::my_cool_func`\n * - C function: `fopen`\n */\nexport const ATTR_CODE_FUNCTION_NAME = 'code.function.name';\n/**\n * The line number in `code.file.path` best representing the operation. It **SHOULD** point within the code unit named in `code.function.name`. This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Line'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example 42\n */\nexport const ATTR_CODE_LINE_NUMBER = 'code.line.number';\n/**\n * A stacktrace as a string in the natural representation for the language runtime. The representation is identical to [`exception.stacktrace`](/docs/exceptions/exceptions-spans.md#stacktrace-representation). This attribute **MUST NOT** be used on the Profile signal since the data is already captured in 'message Location'. This constraint is imposed to prevent redundancy and maintain data integrity.\n *\n * @example \"at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\\\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\\\n at com.example.GenerateTrace.main(GenerateTrace.java:5)\\\\n\"\n */\nexport const ATTR_CODE_STACKTRACE = 'code.stacktrace';\n/**\n * The name of a collection (table, container) within the database.\n *\n * @example public.users\n * @example customers\n *\n * @note It is **RECOMMENDED** to capture the value as provided by the application\n * without attempting to do any case normalization.\n *\n * The collection name **SHOULD NOT** be extracted from `db.query.text`,\n * when the database system supports query text with multiple collections\n * in non-batch operations.\n *\n * For batch operations, if the individual operations are known to have the same\n * collection name then that collection name **SHOULD** be used.\n */\nexport const ATTR_DB_COLLECTION_NAME = 'db.collection.name';\n/**\n * The name of the database, fully qualified within the server address and port.\n *\n * @example customers\n * @example test.users\n *\n * @note If a database system has multiple namespace components, they **SHOULD** be concatenated from the most general to the most specific namespace component, using `|` as a separator between the components. Any missing components (and their associated separators) **SHOULD** be omitted.\n * Semantic conventions for individual database systems **SHOULD** document what `db.namespace` means in the context of that system.\n * It is **RECOMMENDED** to capture the value as provided by the application without attempting to do any case normalization.\n */\nexport const ATTR_DB_NAMESPACE = 'db.namespace';\n/**\n * The number of queries included in a batch operation.\n *\n * @example 2\n * @example 3\n * @example 4\n *\n * @note Operations are only considered batches when they contain two or more operations, and so `db.operation.batch.size` **SHOULD** never be `1`.\n */\nexport const ATTR_DB_OPERATION_BATCH_SIZE = 'db.operation.batch.size';\n/**\n * The name of the operation or command being executed.\n *\n * @example findAndModify\n * @example HMSET\n * @example SELECT\n *\n * @note It is **RECOMMENDED** to capture the value as provided by the application\n * without attempting to do any case normalization.\n *\n * The operation name **SHOULD NOT** be extracted from `db.query.text`,\n * when the database system supports query text with multiple operations\n * in non-batch operations.\n *\n * If spaces can occur in the operation name, multiple consecutive spaces\n * **SHOULD** be normalized to a single space.\n *\n * For batch operations, if the individual operations are known to have the same operation name\n * then that operation name **SHOULD** be used prepended by `BATCH `,\n * otherwise `db.operation.name` **SHOULD** be `BATCH` or some other database\n * system specific term if more applicable.\n */\nexport const ATTR_DB_OPERATION_NAME = 'db.operation.name';\n/**\n * Low cardinality summary of a database query.\n *\n * @example SELECT wuser_table\n * @example INSERT shipping_details SELECT orders\n * @example get user by id\n *\n * @note The query summary describes a class of database queries and is useful\n * as a grouping key, especially when analyzing telemetry for database\n * calls involving complex queries.\n *\n * Summary may be available to the instrumentation through\n * instrumentation hooks or other means. If it is not available, instrumentations\n * that support query parsing **SHOULD** generate a summary following\n * [Generating query summary](/docs/db/database-spans.md#generating-a-summary-of-the-query)\n * section.\n *\n * For batch operations, if the individual operations are known to have the same query summary\n * then that query summary **SHOULD** be used prepended by `BATCH `,\n * otherwise `db.query.summary` **SHOULD** be `BATCH` or some other database\n * system specific term if more applicable.\n */\nexport const ATTR_DB_QUERY_SUMMARY = 'db.query.summary';\n/**\n * The database query being executed.\n *\n * @example SELECT * FROM wuser_table where username = ?\n * @example SET mykey ?\n *\n * @note For sanitization see [Sanitization of `db.query.text`](/docs/db/database-spans.md#sanitization-of-dbquerytext).\n * For batch operations, if the individual operations are known to have the same query text then that query text **SHOULD** be used, otherwise all of the individual query texts **SHOULD** be concatenated with separator `; ` or some other database system specific separator if more applicable.\n * Parameterized query text **SHOULD NOT** be sanitized. Even though parameterized query text can potentially have sensitive data, by using a parameterized query the user is giving a strong signal that any sensitive data will be passed as parameter values, and the benefit to observability of capturing the static part of the query text by default outweighs the risk.\n */\nexport const ATTR_DB_QUERY_TEXT = 'db.query.text';\n/**\n * Database response status code.\n *\n * @example 102\n * @example ORA-17002\n * @example 08P01\n * @example 404\n *\n * @note The status code returned by the database. Usually it represents an error code, but may also represent partial success, warning, or differentiate between various types of successful outcomes.\n * Semantic conventions for individual database systems **SHOULD** document what `db.response.status_code` means in the context of that system.\n */\nexport const ATTR_DB_RESPONSE_STATUS_CODE = 'db.response.status_code';\n/**\n * The name of a stored procedure within the database.\n *\n * @example GetCustomer\n *\n * @note It is **RECOMMENDED** to capture the value as provided by the application\n * without attempting to do any case normalization.\n *\n * For batch operations, if the individual operations are known to have the same\n * stored procedure name then that stored procedure name **SHOULD** be used.\n */\nexport const ATTR_DB_STORED_PROCEDURE_NAME = 'db.stored_procedure.name';\n/**\n * The database management system (DBMS) product as identified by the client instrumentation.\n *\n * @note The actual DBMS may differ from the one identified by the client. For example, when using PostgreSQL client libraries to connect to a CockroachDB, the `db.system.name` is set to `postgresql` based on the instrumentation's best knowledge.\n */\nexport const ATTR_DB_SYSTEM_NAME = 'db.system.name';\n/**\n * Enum value \"mariadb\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * [MariaDB](https://mariadb.org/)\n */\nexport const DB_SYSTEM_NAME_VALUE_MARIADB = \"mariadb\";\n/**\n * Enum value \"microsoft.sql_server\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * [Microsoft SQL Server](https://www.microsoft.com/sql-server)\n */\nexport const DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER = \"microsoft.sql_server\";\n/**\n * Enum value \"mysql\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * [MySQL](https://www.mysql.com/)\n */\nexport const DB_SYSTEM_NAME_VALUE_MYSQL = \"mysql\";\n/**\n * Enum value \"postgresql\" for attribute {@link ATTR_DB_SYSTEM_NAME}.\n *\n * [PostgreSQL](https://www.postgresql.org/)\n */\nexport const DB_SYSTEM_NAME_VALUE_POSTGRESQL = \"postgresql\";\n/**\n * Name of the garbage collector managed heap generation.\n *\n * @example gen0\n * @example gen1\n * @example gen2\n */\nexport const ATTR_DOTNET_GC_HEAP_GENERATION = 'dotnet.gc.heap.generation';\n/**\n * Enum value \"gen0\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Generation 0\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_GEN0 = \"gen0\";\n/**\n * Enum value \"gen1\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Generation 1\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_GEN1 = \"gen1\";\n/**\n * Enum value \"gen2\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Generation 2\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_GEN2 = \"gen2\";\n/**\n * Enum value \"loh\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Large Object Heap\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_LOH = \"loh\";\n/**\n * Enum value \"poh\" for attribute {@link ATTR_DOTNET_GC_HEAP_GENERATION}.\n *\n * Pinned Object Heap\n */\nexport const DOTNET_GC_HEAP_GENERATION_VALUE_POH = \"poh\";\n/**\n * Describes a class of error the operation ended with.\n *\n * @example timeout\n * @example java.net.UnknownHostException\n * @example server_certificate_invalid\n * @example 500\n *\n * @note The `error.type` **SHOULD** be predictable, and **SHOULD** have low cardinality.\n *\n * When `error.type` is set to a type (e.g., an exception type), its\n * canonical class name identifying the type within the artifact **SHOULD** be used.\n *\n * Instrumentations **SHOULD** document the list of errors they report.\n *\n * The cardinality of `error.type` within one instrumentation library **SHOULD** be low.\n * Telemetry consumers that aggregate data from multiple instrumentation libraries and applications\n * should be prepared for `error.type` to have high cardinality at query time when no\n * additional filters are applied.\n *\n * If the operation has completed successfully, instrumentations **SHOULD NOT** set `error.type`.\n *\n * If a specific domain defines its own set of error identifiers (such as HTTP or RPC status codes),\n * it's **RECOMMENDED** to:\n *\n * - Use a domain-specific attribute\n * - Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.\n */\nexport const ATTR_ERROR_TYPE = 'error.type';\n/**\n * Enum value \"_OTHER\" for attribute {@link ATTR_ERROR_TYPE}.\n *\n * A fallback error value to be used when the instrumentation doesn't define a custom value.\n */\nexport const ERROR_TYPE_VALUE_OTHER = \"_OTHER\";\n/**\n * Indicates that the exception is escaping the scope of the span.\n *\n * @deprecated It's no longer recommended to record exceptions that are handled and do not escape the scope of a span.\n */\nexport const ATTR_EXCEPTION_ESCAPED = 'exception.escaped';\n/**\n * The exception message.\n *\n * @example Division by zero\n * @example Can't convert 'int' object to str implicitly\n *\n * @note > [!WARNING]\n *\n * > This attribute may contain sensitive information.\n */\nexport const ATTR_EXCEPTION_MESSAGE = 'exception.message';\n/**\n * A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG.\n *\n * @example \"Exception in thread \"main\" java.lang.RuntimeException: Test exception\\\\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\\\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\\\n at com.example.GenerateTrace.main(GenerateTrace.java:5)\\\\n\"\n */\nexport const ATTR_EXCEPTION_STACKTRACE = 'exception.stacktrace';\n/**\n * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it.\n *\n * @example java.net.ConnectException\n * @example OSError\n */\nexport const ATTR_EXCEPTION_TYPE = 'exception.type';\n/**\n * HTTP request headers, `<key>` being the normalized HTTP Header name (lowercase), the value being the header values.\n *\n * @example [\"application/json\"]\n * @example [\"1.2.3.4\", \"1.2.3.5\"]\n *\n * @note Instrumentations **SHOULD** require an explicit configuration of which headers are to be captured.\n * Including all request headers can be a security risk - explicit configuration helps avoid leaking sensitive information.\n *\n * The `User-Agent` header is already captured in the `user_agent.original` attribute.\n * Users **MAY** explicitly configure instrumentations to capture them even though it is not recommended.\n *\n * The attribute value **MUST** consist of either multiple header values as an array of strings\n * or a single-item array containing a possibly comma-concatenated string, depending on the way\n * the HTTP library provides access to headers.\n *\n * Examples:\n *\n * - A header `Content-Type: application/json` **SHOULD** be recorded as the `http.request.header.content-type`\n * attribute with value `[\"application/json\"]`.\n * - A header `X-Forwarded-For: 1.2.3.4, 1.2.3.5` **SHOULD** be recorded as the `http.request.header.x-forwarded-for`\n * attribute with value `[\"1.2.3.4\", \"1.2.3.5\"]` or `[\"1.2.3.4, 1.2.3.5\"]` depending on the HTTP library.\n */\nexport const ATTR_HTTP_REQUEST_HEADER = (key) => `http.request.header.${key}`;\n/**\n * HTTP request method.\n *\n * @example GET\n * @example POST\n * @example HEAD\n *\n * @note HTTP request method value **SHOULD** be \"known\" to the instrumentation.\n * By default, this convention defines \"known\" methods as the ones listed in [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-methods),\n * the PATCH method defined in [RFC5789](https://www.rfc-editor.org/rfc/rfc5789.html)\n * and the QUERY method defined in [httpbis-safe-method-w-body](https://datatracker.ietf.org/doc/draft-ietf-httpbis-safe-method-w-body/?include_text=1).\n *\n * If the HTTP request method is not known to instrumentation, it **MUST** set the `http.request.method` attribute to `_OTHER`.\n *\n * If the HTTP instrumentation could end up converting valid HTTP request methods to `_OTHER`, then it **MUST** provide a way to override\n * the list of known HTTP methods. If this override is done via environment variable, then the environment variable **MUST** be named\n * OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive known HTTP methods.\n *\n *\n * If this override is done via declarative configuration, then the list **MUST** be configurable via the `known_methods` property\n * (an array of case-sensitive strings with minimum items 0) under `.instrumentation/development.general.http.client` and/or\n * `.instrumentation/development.general.http.server`.\n *\n * In either case, this list **MUST** be a full override of the default known methods,\n * it is not a list of known methods in addition to the defaults.\n *\n * HTTP method names are case-sensitive and `http.request.method` attribute value **MUST** match a known HTTP method name exactly.\n * Instrumentations for specific web frameworks that consider HTTP methods to be case insensitive, **SHOULD** populate a canonical equivalent.\n * Tracing instrumentations that do so, **MUST** also set `http.request.method_original` to the original value.\n */\nexport const ATTR_HTTP_REQUEST_METHOD = 'http.request.method';\n/**\n * Enum value \"_OTHER\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * Any HTTP method that the instrumentation has no prior knowledge of.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_OTHER = \"_OTHER\";\n/**\n * Enum value \"CONNECT\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * CONNECT method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_CONNECT = \"CONNECT\";\n/**\n * Enum value \"DELETE\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * DELETE method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_DELETE = \"DELETE\";\n/**\n * Enum value \"GET\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * GET method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_GET = \"GET\";\n/**\n * Enum value \"HEAD\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * HEAD method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_HEAD = \"HEAD\";\n/**\n * Enum value \"OPTIONS\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * OPTIONS method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_OPTIONS = \"OPTIONS\";\n/**\n * Enum value \"PATCH\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * PATCH method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_PATCH = \"PATCH\";\n/**\n * Enum value \"POST\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * POST method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_POST = \"POST\";\n/**\n * Enum value \"PUT\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * PUT method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_PUT = \"PUT\";\n/**\n * Enum value \"TRACE\" for attribute {@link ATTR_HTTP_REQUEST_METHOD}.\n *\n * TRACE method.\n */\nexport const HTTP_REQUEST_METHOD_VALUE_TRACE = \"TRACE\";\n/**\n * Original HTTP method sent by the client in the request line.\n *\n * @example GeT\n * @example ACL\n * @example foo\n */\nexport const ATTR_HTTP_REQUEST_METHOD_ORIGINAL = 'http.request.method_original';\n/**\n * The ordinal number of request resending attempt (for any reason, including redirects).\n *\n * @example 3\n *\n * @note The resend count **SHOULD** be updated each time an HTTP request gets resent by the client, regardless of what was the cause of the resending (e.g. redirection, authorization failure, 503 Server Unavailable, network issues, or any other).\n */\nexport const ATTR_HTTP_REQUEST_RESEND_COUNT = 'http.request.resend_count';\n/**\n * HTTP response headers, `<key>` being the normalized HTTP Header name (lowercase), the value being the header values.\n *\n * @example [\"application/json\"]\n * @example [\"abc\", \"def\"]\n *\n * @note Instrumentations **SHOULD** require an explicit configuration of which headers are to be captured.\n * Including all response headers can be a security risk - explicit configuration helps avoid leaking sensitive information.\n *\n * Users **MAY** explicitly configure instrumentations to capture them even though it is not recommended.\n *\n * The attribute value **MUST** consist of either multiple header values as an array of strings\n * or a single-item array containing a possibly comma-concatenated string, depending on the way\n * the HTTP library provides access to headers.\n *\n * Examples:\n *\n * - A header `Content-Type: application/json` header **SHOULD** be recorded as the `http.request.response.content-type`\n * attribute with value `[\"application/json\"]`.\n * - A header `My-custom-header: abc, def` header **SHOULD** be recorded as the `http.response.header.my-custom-header`\n * attribute with value `[\"abc\", \"def\"]` or `[\"abc, def\"]` depending on the HTTP library.\n */\nexport const ATTR_HTTP_RESPONSE_HEADER = (key) => `http.response.header.${key}`;\n/**\n * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).\n *\n * @example 200\n */\nexport const ATTR_HTTP_RESPONSE_STATUS_CODE = 'http.response.status_code';\n/**\n * The matched route template for the request. This **MUST** be low-cardinality and include all static path segments, with dynamic path segments represented with placeholders.\n *\n * @example /users/:userID?\n * @example my-controller/my-action/{id?}\n *\n * @note **MUST NOT** be populated when this is not supported by the HTTP server framework as the route attribute should have low-cardinality and the URI path can NOT substitute it.\n * **SHOULD** include the [application root](/docs/http/http-spans.md#http-server-definitions) if there is one.\n *\n * A static path segment is a part of the route template with a fixed, low-cardinality value. This includes literal strings like `/users/` and placeholders that\n * are constrained to a finite, predefined set of values, e.g. `{controller}` or `{action}`.\n *\n * A dynamic path segment is a placeholder for a value that can have high cardinality and is not constrained to a predefined list like static path segments.\n *\n * Instrumentations **SHOULD** use routing information provided by the corresponding web framework. They **SHOULD** pick the most precise source of routing information and **MAY**\n * support custom route formatting. Instrumentations **SHOULD** document the format and the API used to obtain the route string.\n */\nexport const ATTR_HTTP_ROUTE = 'http.route';\n/**\n * Name of the garbage collector action.\n *\n * @example end of minor GC\n * @example end of major GC\n *\n * @note Garbage collector action is generally obtained via [GarbageCollectionNotificationInfo#getGcAction()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcAction()).\n */\nexport const ATTR_JVM_GC_ACTION = 'jvm.gc.action';\n/**\n * Name of the garbage collector.\n *\n * @example G1 Young Generation\n * @example G1 Old Generation\n *\n * @note Garbage collector name is generally obtained via [GarbageCollectionNotificationInfo#getGcName()](https://docs.oracle.com/en/java/javase/11/docs/api/jdk.management/com/sun/management/GarbageCollectionNotificationInfo.html#getGcName()).\n */\nexport const ATTR_JVM_GC_NAME = 'jvm.gc.name';\n/**\n * Name of the memory pool.\n *\n * @example G1 Old Gen\n * @example G1 Eden space\n * @example G1 Survivor Space\n *\n * @note Pool names are generally obtained via [MemoryPoolMXBean#getName()](https://docs.oracle.com/en/java/javase/11/docs/api/java.management/java/lang/management/MemoryPoolMXBean.html#getName()).\n */\nexport const ATTR_JVM_MEMORY_POOL_NAME = 'jvm.memory.pool.name';\n/**\n * The type of memory.\n *\n * @example heap\n * @example non_heap\n */\nexport const ATTR_JVM_MEMORY_TYPE = 'jvm.memory.type';\n/**\n * Enum value \"heap\" for attribute {@link ATTR_JVM_MEMORY_TYPE}.\n *\n * Heap memory.\n */\nexport const JVM_MEMORY_TYPE_VALUE_HEAP = \"heap\";\n/**\n * Enum value \"non_heap\" for attribute {@link ATTR_JVM_MEMORY_TYPE}.\n *\n * Non-heap memory\n */\nexport const JVM_MEMORY_TYPE_VALUE_NON_HEAP = \"non_heap\";\n/**\n * Whether the thread is daemon or not.\n */\nexport const ATTR_JVM_THREAD_DAEMON = 'jvm.thread.daemon';\n/**\n * State of the thread.\n *\n * @example runnable\n * @example blocked\n */\nexport const ATTR_JVM_THREAD_STATE = 'jvm.thread.state';\n/**\n * Enum value \"blocked\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that is blocked waiting for a monitor lock is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_BLOCKED = \"blocked\";\n/**\n * Enum value \"new\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that has not yet started is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_NEW = \"new\";\n/**\n * Enum value \"runnable\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread executing in the Java virtual machine is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_RUNNABLE = \"runnable\";\n/**\n * Enum value \"terminated\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that has exited is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_TERMINATED = \"terminated\";\n/**\n * Enum value \"timed_waiting\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that is waiting for another thread to perform an action for up to a specified waiting time is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_TIMED_WAITING = \"timed_waiting\";\n/**\n * Enum value \"waiting\" for attribute {@link ATTR_JVM_THREAD_STATE}.\n *\n * A thread that is waiting indefinitely for another thread to perform a particular action is in this state.\n */\nexport const JVM_THREAD_STATE_VALUE_WAITING = \"waiting\";\n/**\n * Local address of the network connection - IP address or Unix domain socket name.\n *\n * @example 10.1.2.80\n * @example /tmp/my.sock\n */\nexport const ATTR_NETWORK_LOCAL_ADDRESS = 'network.local.address';\n/**\n * Local port number of the network connection.\n *\n * @example 65123\n */\nexport const ATTR_NETWORK_LOCAL_PORT = 'network.local.port';\n/**\n * Peer address of the network connection - IP address or Unix domain socket name.\n *\n * @example 10.1.2.80\n * @example /tmp/my.sock\n */\nexport const ATTR_NETWORK_PEER_ADDRESS = 'network.peer.address';\n/**\n * Peer port number of the network connection.\n *\n * @example 65123\n */\nexport const ATTR_NETWORK_PEER_PORT = 'network.peer.port';\n/**\n * [OSI application layer](https://wikipedia.org/wiki/Application_layer) or non-OSI equivalent.\n *\n * @example amqp\n * @example http\n * @example mqtt\n *\n * @note The value **SHOULD** be normalized to lowercase.\n */\nexport const ATTR_NETWORK_PROTOCOL_NAME = 'network.protocol.name';\n/**\n * The actual version of the protocol used for network communication.\n *\n * @example 1.1\n * @example 2\n *\n * @note If protocol version is subject to negotiation (for example using [ALPN](https://www.rfc-editor.org/rfc/rfc7301.html)), this attribute **SHOULD** be set to the negotiated version. If the actual protocol version is not known, this attribute **SHOULD NOT** be set.\n */\nexport const ATTR_NETWORK_PROTOCOL_VERSION = 'network.protocol.version';\n/**\n * [OSI transport layer](https://wikipedia.org/wiki/Transport_layer) or [inter-process communication method](https://wikipedia.org/wiki/Inter-process_communication).\n *\n * @example tcp\n * @example udp\n *\n * @note The value **SHOULD** be normalized to lowercase.\n *\n * Consider always setting the transport when setting a port number, since\n * a port number is ambiguous without knowing the transport. For example\n * different processes could be listening on TCP port 12345 and UDP port 12345.\n */\nexport const ATTR_NETWORK_TRANSPORT = 'network.transport';\n/**\n * Enum value \"pipe\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * Named or anonymous pipe.\n */\nexport const NETWORK_TRANSPORT_VALUE_PIPE = \"pipe\";\n/**\n * Enum value \"quic\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * QUIC\n */\nexport const NETWORK_TRANSPORT_VALUE_QUIC = \"quic\";\n/**\n * Enum value \"tcp\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * TCP\n */\nexport const NETWORK_TRANSPORT_VALUE_TCP = \"tcp\";\n/**\n * Enum value \"udp\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * UDP\n */\nexport const NETWORK_TRANSPORT_VALUE_UDP = \"udp\";\n/**\n * Enum value \"unix\" for attribute {@link ATTR_NETWORK_TRANSPORT}.\n *\n * Unix domain socket\n */\nexport const NETWORK_TRANSPORT_VALUE_UNIX = \"unix\";\n/**\n * [OSI network layer](https://wikipedia.org/wiki/Network_layer) or non-OSI equivalent.\n *\n * @example ipv4\n * @example ipv6\n *\n * @note The value **SHOULD** be normalized to lowercase.\n */\nexport const ATTR_NETWORK_TYPE = 'network.type';\n/**\n * Enum value \"ipv4\" for attribute {@link ATTR_NETWORK_TYPE}.\n *\n * IPv4\n */\nexport const NETWORK_TYPE_VALUE_IPV4 = \"ipv4\";\n/**\n * Enum value \"ipv6\" for attribute {@link ATTR_NETWORK_TYPE}.\n *\n * IPv6\n */\nexport const NETWORK_TYPE_VALUE_IPV6 = \"ipv6\";\n/**\n * The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP).\n *\n * @example io.opentelemetry.contrib.mongodb\n */\nexport const ATTR_OTEL_SCOPE_NAME = 'otel.scope.name';\n/**\n * The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP).\n *\n * @example 1.0.0\n */\nexport const ATTR_OTEL_SCOPE_VERSION = 'otel.scope.version';\n/**\n * Name of the code, either \"OK\" or \"ERROR\". **MUST NOT** be set if the status code is UNSET.\n */\nexport const ATTR_OTEL_STATUS_CODE = 'otel.status_code';\n/**\n * Enum value \"ERROR\" for attribute {@link ATTR_OTEL_STATUS_CODE}.\n *\n * The operation contains an error.\n */\nexport const OTEL_STATUS_CODE_VALUE_ERROR = \"ERROR\";\n/**\n * Enum value \"OK\" for attribute {@link ATTR_OTEL_STATUS_CODE}.\n *\n * The operation has been validated by an Application developer or Operator to have completed successfully.\n */\nexport const OTEL_STATUS_CODE_VALUE_OK = \"OK\";\n/**\n * Description of the Status if it has a value, otherwise not set.\n *\n * @example resource not found\n */\nexport const ATTR_OTEL_STATUS_DESCRIPTION = 'otel.status_description';\n/**\n * Server domain name if available without reverse DNS lookup; otherwise, IP address or Unix domain socket name.\n *\n * @example example.com\n * @example 10.1.2.80\n * @example /tmp/my.sock\n *\n * @note When observed from the client side, and when communicating through an intermediary, `server.address` **SHOULD** represent the server address behind any intermediaries, for example proxies, if it's available.\n */\nexport const ATTR_SERVER_ADDRESS = 'server.address';\n/**\n * Server port number.\n *\n * @example 80\n * @example 8080\n * @example 443\n *\n * @note When observed from the client side, and when communicating through an intermediary, `server.port` **SHOULD** represent the server port behind any intermediaries, for example proxies, if it's available.\n */\nexport const ATTR_SERVER_PORT = 'server.port';\n/**\n * The string ID of the service instance.\n *\n * @example 627cc493-f310-47de-96bd-71410b7dec09\n *\n * @note **MUST** be unique for each instance of the same `service.namespace,service.name` pair (in other words\n * `service.namespace,service.name,service.instance.id` triplet **MUST** be globally unique). The ID helps to\n * distinguish instances of the same service that exist at the same time (e.g. instances of a horizontally scaled\n * service).\n *\n * Implementations, such as SDKs, are recommended to generate a random Version 1 or Version 4 [RFC\n * 4122](https://www.ietf.org/rfc/rfc4122.txt) UUID, but are free to use an inherent unique ID as the source of\n * this value if stability is desirable. In that case, the ID **SHOULD** be used as source of a UUID Version 5 and\n * **SHOULD** use the following UUID as the namespace: `4d63009a-8d0f-11ee-aad7-4c796ed8e320`.\n *\n * UUIDs are typically recommended, as only an opaque value for the purposes of identifying a service instance is\n * needed. Similar to what can be seen in the man page for the\n * [`/etc/machine-id`](https://www.freedesktop.org/software/systemd/man/latest/machine-id.html) file, the underlying\n * data, such as pod name and namespace should be treated as confidential, being the user's choice to expose it\n * or not via another resource attribute.\n *\n * For applications running behind an application server (like unicorn), we do not recommend using one identifier\n * for all processes participating in the application. Instead, it's recommended each division (e.g. a worker\n * thread in unicorn) to have its own instance.id.\n *\n * It's not recommended for a Collector to set `service.instance.id` if it can't unambiguously determine the\n * service instance that is generating that telemetry. For instance, creating an UUID based on `pod.name` will\n * likely be wrong, as the Collector might not know from which container within that pod the telemetry originated.\n * However, Collectors can set the `service.instance.id` if they can unambiguously determine the service instance\n * for that telemetry. This is typically the case for scraping receivers, as they know the target address and\n * port.\n */\nexport const ATTR_SERVICE_INSTANCE_ID = 'service.instance.id';\n/**\n * Logical name of the service.\n *\n * @example shoppingcart\n *\n * @note **MUST** be the same for all instances of horizontally scaled services. If the value was not specified, SDKs **MUST** fallback to `unknown_service:` concatenated with [`process.executable.name`](process.md), e.g. `unknown_service:bash`. If `process.executable.name` is not available, the value **MUST** be set to `unknown_service`.\n */\nexport const ATTR_SERVICE_NAME = 'service.name';\n/**\n * A namespace for `service.name`.\n *\n * @example Shop\n *\n * @note A string value having a meaning that helps to distinguish a group of services, for example the team name that owns a group of services. `service.name` is expected to be unique within the same namespace. If `service.namespace` is not specified in the Resource then `service.name` is expected to be unique for all services that have no explicit namespace defined (so the empty/unspecified namespace is simply one more valid namespace). Zero-length namespace string is assumed equal to unspecified namespace.\n */\nexport const ATTR_SERVICE_NAMESPACE = 'service.namespace';\n/**\n * The version string of the service component. The format is not defined by these conventions.\n *\n * @example 2.0.0\n * @example a01dbef8a\n */\nexport const ATTR_SERVICE_VERSION = 'service.version';\n/**\n * SignalR HTTP connection closure status.\n *\n * @example app_shutdown\n * @example timeout\n */\nexport const ATTR_SIGNALR_CONNECTION_STATUS = 'signalr.connection.status';\n/**\n * Enum value \"app_shutdown\" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}.\n *\n * The connection was closed because the app is shutting down.\n */\nexport const SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN = \"app_shutdown\";\n/**\n * Enum value \"normal_closure\" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}.\n *\n * The connection was closed normally.\n */\nexport const SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE = \"normal_closure\";\n/**\n * Enum value \"timeout\" for attribute {@link ATTR_SIGNALR_CONNECTION_STATUS}.\n *\n * The connection was closed due to a timeout.\n */\nexport const SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT = \"timeout\";\n/**\n * [SignalR transport type](https://github.com/dotnet/aspnetcore/blob/main/src/SignalR/docs/specs/TransportProtocols.md)\n *\n * @example web_sockets\n * @example long_polling\n */\nexport const ATTR_SIGNALR_TRANSPORT = 'signalr.transport';\n/**\n * Enum value \"long_polling\" for attribute {@link ATTR_SIGNALR_TRANSPORT}.\n *\n * LongPolling protocol\n */\nexport const SIGNALR_TRANSPORT_VALUE_LONG_POLLING = \"long_polling\";\n/**\n * Enum value \"server_sent_events\" for attribute {@link ATTR_SIGNALR_TRANSPORT}.\n *\n * ServerSentEvents protocol\n */\nexport const SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS = \"server_sent_events\";\n/**\n * Enum value \"web_sockets\" for attribute {@link ATTR_SIGNALR_TRANSPORT}.\n *\n * WebSockets protocol\n */\nexport const SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS = \"web_sockets\";\n/**\n * The language of the telemetry SDK.\n */\nexport const ATTR_TELEMETRY_SDK_LANGUAGE = 'telemetry.sdk.language';\n/**\n * Enum value \"cpp\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_CPP = \"cpp\";\n/**\n * Enum value \"dotnet\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET = \"dotnet\";\n/**\n * Enum value \"erlang\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG = \"erlang\";\n/**\n * Enum value \"go\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_GO = \"go\";\n/**\n * Enum value \"java\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_JAVA = \"java\";\n/**\n * Enum value \"nodejs\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS = \"nodejs\";\n/**\n * Enum value \"php\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_PHP = \"php\";\n/**\n * Enum value \"python\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON = \"python\";\n/**\n * Enum value \"ruby\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_RUBY = \"ruby\";\n/**\n * Enum value \"rust\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_RUST = \"rust\";\n/**\n * Enum value \"swift\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT = \"swift\";\n/**\n * Enum value \"webjs\" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.\n */\nexport const TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = \"webjs\";\n/**\n * The name of the telemetry SDK as defined above.\n *\n * @example opentelemetry\n *\n * @note The OpenTelemetry SDK **MUST** set the `telemetry.sdk.name` attribute to `opentelemetry`.\n * If another SDK, like a fork or a vendor-provided implementation, is used, this SDK **MUST** set the\n * `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point\n * or another suitable identifier depending on the language.\n * The identifier `opentelemetry` is reserved and **MUST NOT** be used in this case.\n * All custom identifiers **SHOULD** be stable across different versions of an implementation.\n */\nexport const ATTR_TELEMETRY_SDK_NAME = 'telemetry.sdk.name';\n/**\n * The version string of the telemetry SDK.\n *\n * @example 1.2.3\n */\nexport const ATTR_TELEMETRY_SDK_VERSION = 'telemetry.sdk.version';\n/**\n * The [URI fragment](https://www.rfc-editor.org/rfc/rfc3986#section-3.5) component\n *\n * @example SemConv\n */\nexport const ATTR_URL_FRAGMENT = 'url.fragment';\n/**\n * Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)\n *\n * @example https://www.foo.bar/search?q=OpenTelemetry#SemConv\n * @example //localhost\n *\n * @note For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment\n * is not transmitted over HTTP, but if it is known, it **SHOULD** be included nevertheless.\n *\n * `url.full` **MUST NOT** contain credentials passed via URL in form of `https://username:password@www.example.com/`.\n * In such case username and password **SHOULD** be redacted and attribute's value **SHOULD** be `https://REDACTED:REDACTED@www.example.com/`.\n *\n * `url.full` **SHOULD** capture the absolute URL when it is available (or can be reconstructed).\n *\n * Sensitive content provided in `url.full` **SHOULD** be scrubbed when instrumentations can identify it.\n *\n *\n * Query string values for the following keys **SHOULD** be redacted by default and replaced by the\n * value `REDACTED`:\n *\n * - [`AWSAccessKeyId`](https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth)\n * - [`Signature`](https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth)\n * - [`sig`](https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token)\n * - [`X-Goog-Signature`](https://cloud.google.com/storage/docs/access-control/signed-urls)\n *\n * This list is subject to change over time.\n *\n * Matching of query parameter keys against the sensitive list **SHOULD** be case-sensitive.\n *\n *\n * Instrumentation **MAY** provide a way to override this list via declarative configuration.\n * If so, it **SHOULD** use the `sensitive_query_parameters` property\n * (an array of case-sensitive strings with minimum items 0) under\n * `.instrumentation/development.general.sanitization.url`.\n * This list is a full override of the default sensitive query parameter keys,\n * it is not a list of keys in addition to the defaults.\n *\n * When a query string value is redacted, the query string key **SHOULD** still be preserved, e.g.\n * `https://www.example.com/path?color=blue&sig=REDACTED`.\n */\nexport const ATTR_URL_FULL = 'url.full';\n/**\n * The [URI path](https://www.rfc-editor.org/rfc/rfc3986#section-3.3) component\n *\n * @example /search\n *\n * @note Sensitive content provided in `url.path` **SHOULD** be scrubbed when instrumentations can identify it.\n */\nexport const ATTR_URL_PATH = 'url.path';\n/**\n * The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component\n *\n * @example q=OpenTelemetry\n *\n * @note Sensitive content provided in `url.query` **SHOULD** be scrubbed when instrumentations can identify it.\n *\n *\n * Query string values for the following keys **SHOULD** be redacted by default and replaced by the value `REDACTED`:\n *\n * - [`AWSAccessKeyId`](https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth)\n * - [`Signature`](https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth)\n * - [`sig`](https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token)\n * - [`X-Goog-Signature`](https://cloud.google.com/storage/docs/access-control/signed-urls)\n *\n * This list is subject to change over time.\n *\n * Matching of query parameter keys against the sensitive list **SHOULD** be case-sensitive.\n *\n * Instrumentation **MAY** provide a way to override this list via declarative configuration.\n * If so, it **SHOULD** use the `sensitive_query_parameters` property\n * (an array of case-sensitive strings with minimum items 0) under\n * `.instrumentation/development.general.sanitization.url`.\n * This list is a full override of the default sensitive query parameter keys,\n * it is not a list of keys in addition to the defaults.\n *\n * When a query string value is redacted, the query string key **SHOULD** still be preserved, e.g.\n * `q=OpenTelemetry&sig=REDACTED`.\n */\nexport const ATTR_URL_QUERY = 'url.query';\n/**\n * The [URI scheme](https://www.rfc-editor.org/rfc/rfc3986#section-3.1) component identifying the used protocol.\n *\n * @example https\n * @example ftp\n * @example telnet\n */\nexport const ATTR_URL_SCHEME = 'url.scheme';\n/**\n * Value of the [HTTP User-Agent](https://www.rfc-editor.org/rfc/rfc9110.html#field.user-agent) header sent by the client.\n *\n * @example CERN-LineMode/2.15 libwww/2.17b3\n * @example Mozilla/5.0 (iPhone; CPU iPhone OS 14_7_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Mobile/15E148 Safari/604.1\n * @example YourApp/1.0.0 grpc-java-okhttp/1.27.2\n */\nexport const ATTR_USER_AGENT_ORIGINAL = 'user_agent.original';\n//# sourceMappingURL=stable_attributes.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n/**\n * The name of the runtime of this process.\n *\n * @example OpenJDK Runtime Environment\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_PROCESS_RUNTIME_NAME = 'process.runtime.name';\n//# sourceMappingURL=semconv.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { VERSION } from '../../version';\nimport { ATTR_TELEMETRY_SDK_NAME, ATTR_TELEMETRY_SDK_LANGUAGE, TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS, ATTR_TELEMETRY_SDK_VERSION, } from '@opentelemetry/semantic-conventions';\nimport { ATTR_PROCESS_RUNTIME_NAME } from '../../semconv';\n/** Constants describing the SDK in use */\nexport const SDK_INFO = {\n [ATTR_TELEMETRY_SDK_NAME]: 'opentelemetry',\n [ATTR_PROCESS_RUNTIME_NAME]: 'browser',\n [ATTR_TELEMETRY_SDK_LANGUAGE]: TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS,\n [ATTR_TELEMETRY_SDK_VERSION]: VERSION,\n};\n//# sourceMappingURL=sdk-info.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport { getStringFromEnv, getBooleanFromEnv, getNumberFromEnv, getStringListFromEnv, } from './environment';\nexport { _globalThis } from '../../common/globalThis';\nexport { SDK_INFO } from './sdk-info';\n/**\n * @deprecated Use performance directly.\n */\nexport const otperformance = performance;\n//# sourceMappingURL=index.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { otperformance as performance } from '../platform';\nconst NANOSECOND_DIGITS = 9;\nconst NANOSECOND_DIGITS_IN_MILLIS = 6;\nconst MILLISECONDS_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS);\nconst SECOND_TO_NANOSECONDS = Math.pow(10, NANOSECOND_DIGITS);\n/**\n * Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]).\n * @param epochMillis\n */\nexport function millisToHrTime(epochMillis) {\n const epochSeconds = epochMillis / 1000;\n // Decimals only.\n const seconds = Math.trunc(epochSeconds);\n // Round sub-nanosecond accuracy to nanosecond.\n const nanos = Math.round((epochMillis % 1000) * MILLISECONDS_TO_NANOSECONDS);\n return [seconds, nanos];\n}\n/**\n * @deprecated Use `performance.timeOrigin` directly.\n */\nexport function getTimeOrigin() {\n return performance.timeOrigin;\n}\n/**\n * Returns an hrtime calculated via performance component.\n * @param performanceNow\n */\nexport function hrTime(performanceNow) {\n const timeOrigin = millisToHrTime(performance.timeOrigin);\n const now = millisToHrTime(typeof performanceNow === 'number' ? performanceNow : performance.now());\n return addHrTimes(timeOrigin, now);\n}\n/**\n *\n * Converts a TimeInput to an HrTime, defaults to _hrtime().\n * @param time\n */\nexport function timeInputToHrTime(time) {\n // process.hrtime\n if (isTimeInputHrTime(time)) {\n return time;\n }\n else if (typeof time === 'number') {\n // Must be a performance.now() if it's smaller than process start time.\n if (time < performance.timeOrigin) {\n return hrTime(time);\n }\n else {\n // epoch milliseconds or performance.timeOrigin\n return millisToHrTime(time);\n }\n }\n else if (time instanceof Date) {\n return millisToHrTime(time.getTime());\n }\n else {\n throw TypeError('Invalid input type');\n }\n}\n/**\n * Returns a duration of two hrTime.\n * @param startTime\n * @param endTime\n */\nexport function hrTimeDuration(startTime, endTime) {\n let seconds = endTime[0] - startTime[0];\n let nanos = endTime[1] - startTime[1];\n // overflow\n if (nanos < 0) {\n seconds -= 1;\n // negate\n nanos += SECOND_TO_NANOSECONDS;\n }\n return [seconds, nanos];\n}\n/**\n * Convert hrTime to timestamp, for example \"2019-05-14T17:00:00.000123456Z\"\n * @param time\n */\nexport function hrTimeToTimeStamp(time) {\n const precision = NANOSECOND_DIGITS;\n const tmp = `${'0'.repeat(precision)}${time[1]}Z`;\n const nanoString = tmp.substring(tmp.length - precision - 1);\n const date = new Date(time[0] * 1000).toISOString();\n return date.replace('000Z', nanoString);\n}\n/**\n * Convert hrTime to nanoseconds.\n * @param time\n */\nexport function hrTimeToNanoseconds(time) {\n return time[0] * SECOND_TO_NANOSECONDS + time[1];\n}\n/**\n * Convert hrTime to milliseconds.\n * @param time\n */\nexport function hrTimeToMilliseconds(time) {\n return time[0] * 1e3 + time[1] / 1e6;\n}\n/**\n * Convert hrTime to microseconds.\n * @param time\n */\nexport function hrTimeToMicroseconds(time) {\n return time[0] * 1e6 + time[1] / 1e3;\n}\n/**\n * check if time is HrTime\n * @param value\n */\nexport function isTimeInputHrTime(value) {\n return (Array.isArray(value) &&\n value.length === 2 &&\n typeof value[0] === 'number' &&\n typeof value[1] === 'number');\n}\n/**\n * check if input value is a correct types.TimeInput\n * @param value\n */\nexport function isTimeInput(value) {\n return (isTimeInputHrTime(value) ||\n typeof value === 'number' ||\n value instanceof Date);\n}\n/**\n * Given 2 HrTime formatted times, return their sum as an HrTime.\n */\nexport function addHrTimes(time1, time2) {\n const out = [time1[0] + time2[0], time1[1] + time2[1]];\n // Nanoseconds\n if (out[1] >= SECOND_TO_NANOSECONDS) {\n out[1] -= SECOND_TO_NANOSECONDS;\n out[0] += 1;\n }\n return out;\n}\n//# sourceMappingURL=time.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport var ExportResultCode;\n(function (ExportResultCode) {\n ExportResultCode[ExportResultCode[\"SUCCESS\"] = 0] = \"SUCCESS\";\n ExportResultCode[ExportResultCode[\"FAILED\"] = 1] = \"FAILED\";\n})(ExportResultCode || (ExportResultCode = {}));\n//# sourceMappingURL=ExportResult.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\n/** Combines multiple propagators into a single propagator. */\nexport class CompositePropagator {\n _propagators;\n _fields;\n /**\n * Construct a composite propagator from a list of propagators.\n *\n * @param [config] Configuration object for composite propagator\n */\n constructor(config = {}) {\n this._propagators = config.propagators ?? [];\n const fields = new Set();\n for (const propagator of this._propagators) {\n // older propagators may not have fields function, null check to be sure\n const propagatorFields = typeof propagator.fields === 'function' ? propagator.fields() : [];\n for (const field of propagatorFields) {\n fields.add(field);\n }\n }\n this._fields = Array.from(fields);\n }\n /**\n * Run each of the configured propagators with the given context and carrier.\n * Propagators are run in the order they are configured, so if multiple\n * propagators write the same carrier key, the propagator later in the list\n * will \"win\".\n *\n * @param context Context to inject\n * @param carrier Carrier into which context will be injected\n */\n inject(context, carrier, setter) {\n for (const propagator of this._propagators) {\n try {\n propagator.inject(context, carrier, setter);\n }\n catch (err) {\n diag.warn(`Failed to inject with ${propagator.constructor.name}. Err: ${err.message}`);\n }\n }\n }\n /**\n * Run each of the configured propagators with the given context and carrier.\n * Propagators are run in the order they are configured, so if multiple\n * propagators write the same context key, the propagator later in the list\n * will \"win\".\n *\n * @param context Context to add values to\n * @param carrier Carrier from which to extract context\n */\n extract(context, carrier, getter) {\n return this._propagators.reduce((ctx, propagator) => {\n try {\n return propagator.extract(ctx, carrier, getter);\n }\n catch (err) {\n diag.warn(`Failed to extract with ${propagator.constructor.name}. Err: ${err.message}`);\n }\n return ctx;\n }, context);\n }\n fields() {\n // return a new array so our fields cannot be modified\n return this._fields.slice();\n }\n}\n//# sourceMappingURL=composite.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nconst VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]';\nconst VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`;\nconst VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`;\nconst VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`);\nconst VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/;\nconst INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/;\n/**\n * Key is opaque string up to 256 characters printable. It MUST begin with a\n * lowercase letter, and can only contain lowercase letters a-z, digits 0-9,\n * underscores _, dashes -, asterisks *, and forward slashes /.\n * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the\n * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key.\n * see https://www.w3.org/TR/trace-context/#key\n */\nexport function validateKey(key) {\n return VALID_KEY_REGEX.test(key);\n}\n/**\n * Value is opaque string up to 256 characters printable ASCII RFC0020\n * characters (i.e., the range 0x20 to 0x7E) except comma , and =.\n */\nexport function validateValue(value) {\n return (VALID_VALUE_BASE_REGEX.test(value) &&\n !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value));\n}\n//# sourceMappingURL=validators.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { validateKey, validateValue } from '../internal/validators';\nconst MAX_TRACE_STATE_ITEMS = 32;\nconst MAX_TRACE_STATE_LEN = 512;\nconst LIST_MEMBERS_SEPARATOR = ',';\nconst LIST_MEMBER_KEY_VALUE_SPLITTER = '=';\n/**\n * TraceState must be a class and not a simple object type because of the spec\n * requirement (https://www.w3.org/TR/trace-context/#tracestate-field).\n *\n * Here is the list of allowed mutations:\n * - New key-value pair should be added into the beginning of the list\n * - The value of any key can be updated. Modified keys MUST be moved to the\n * beginning of the list.\n */\nexport class TraceState {\n _length;\n _rawTraceState;\n _internalState;\n constructor(rawTraceState) {\n this._rawTraceState =\n typeof rawTraceState === 'string' ? rawTraceState : '';\n this._length = this._rawTraceState.length;\n }\n set(key, value) {\n if (!validateKey(key) || !validateValue(value)) {\n return this;\n }\n const currState = this._getState();\n const currValue = currState.get(key);\n // Get the new length depending if we already have a value or not\n // - for existing keys we add the difference between the length of the values\n // - for new keys is the key & value lenght plus\n // - +1 for the key/value splitter\n // - +1 for the separator if there are other keys\n let newLength = this._length;\n if (typeof currValue === 'string') {\n newLength += value.length - currValue.length;\n }\n else {\n newLength += key.length + value.length + (currState.size > 0 ? 2 : 1);\n }\n if (newLength > MAX_TRACE_STATE_LEN) {\n return this;\n }\n const newState = new Map(currState);\n newState.delete(key);\n newState.set(key, value);\n return this._fromState(newState, newLength);\n }\n unset(key) {\n const currState = this._getState();\n const currValue = currState.get(key);\n // No need to create a new instance if the key does not exist\n if (typeof currValue !== 'string') {\n return this;\n }\n // Get the new length depending if we already have a value or not\n // - for existing keys we substract key and value length plus\n // - +1 for the key/value splitter\n // - +1 for the separator if there are other keys\n let newLength = this._length - (key.length + currValue.length + 1);\n if (currState.size > 1) {\n // remove separator from length if there's no key or only one.\n newLength = newLength - 1;\n }\n const newState = new Map(currState);\n newState.delete(key);\n return this._fromState(newState, newLength);\n }\n get(key) {\n const currState = this._getState();\n return currState.get(key);\n }\n serialize() {\n // Maps put new entries at the end. We prepend the seralized entry\n // to get the right order according to the spec (updated members go 1st)\n let serialized = '';\n let index = 0;\n for (const entry of this._getState()) {\n if (index > 0) {\n serialized = LIST_MEMBERS_SEPARATOR + serialized;\n }\n serialized =\n `${entry[0]}${LIST_MEMBER_KEY_VALUE_SPLITTER}${entry[1]}` + serialized;\n index++;\n }\n return serialized;\n }\n _getState() {\n if (this._internalState) {\n return this._internalState;\n }\n // Not parsed yet, lets do it\n const vendorMembers = this._rawTraceState.split(LIST_MEMBERS_SEPARATOR);\n // This Map will have the order reversed\n const vendorEntries = new Map();\n let currentLength = 0;\n for (const member of vendorMembers) {\n const m = member.trim();\n const idx = m.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER);\n if (idx === -1) {\n continue;\n }\n const key = m.slice(0, idx);\n const value = m.slice(idx + 1);\n if (!validateKey(key) || !validateValue(value)) {\n continue;\n }\n // Skip if adding the new member exceeds the length\n const futureLength = currentLength + m.length + (vendorEntries.size > 0 ? 1 : 0);\n if (futureLength > MAX_TRACE_STATE_LEN) {\n continue;\n }\n // All good, add it\n vendorEntries.set(key, value);\n currentLength = futureLength;\n // Check if we reached the max items\n if (vendorEntries.size >= MAX_TRACE_STATE_ITEMS) {\n break;\n }\n }\n // Now we set the length & the Map in the right order\n this._length = currentLength;\n this._internalState = new Map(Array.from(vendorEntries.entries()).reverse());\n return this._internalState;\n }\n _fromState(state, length) {\n const traceState = Object.create(TraceState.prototype);\n traceState._internalState = state;\n traceState._length = length;\n return traceState;\n }\n}\n//# sourceMappingURL=TraceState.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { isSpanContextValid, trace, TraceFlags } from '@opentelemetry/api';\nimport { isTracingSuppressed } from './suppress-tracing';\nimport { TraceState } from './TraceState';\nexport const TRACE_PARENT_HEADER = 'traceparent';\nexport const TRACE_STATE_HEADER = 'tracestate';\nconst VERSION = '00';\nconst VERSION_PART = '(?!ff)[\\\\da-f]{2}';\nconst TRACE_ID_PART = '(?![0]{32})[\\\\da-f]{32}';\nconst PARENT_ID_PART = '(?![0]{16})[\\\\da-f]{16}';\nconst FLAGS_PART = '[\\\\da-f]{2}';\nconst TRACE_PARENT_REGEX = new RegExp(`^\\\\s?(${VERSION_PART})-(${TRACE_ID_PART})-(${PARENT_ID_PART})-(${FLAGS_PART})(-.*)?\\\\s?$`);\n/**\n * Parses information from the [traceparent] span tag and converts it into {@link SpanContext}\n * @param traceParent - A meta property that comes from server.\n * It should be dynamically generated server side to have the server's request trace Id,\n * a parent span Id that was set on the server's request span,\n * and the trace flags to indicate the server's sampling decision\n * (01 = sampled, 00 = not sampled).\n * for example: '{version}-{traceId}-{spanId}-{sampleDecision}'\n * For more information see {@link https://www.w3.org/TR/trace-context/}\n */\nexport function parseTraceParent(traceParent) {\n const match = TRACE_PARENT_REGEX.exec(traceParent);\n if (!match)\n return null;\n // According to the specification the implementation should be compatible\n // with future versions. If there are more parts, we only reject it if it's using version 00\n // See https://www.w3.org/TR/trace-context/#versioning-of-traceparent\n if (match[1] === '00' && match[5])\n return null;\n return {\n traceId: match[2],\n spanId: match[3],\n traceFlags: parseInt(match[4], 16),\n };\n}\n/**\n * Propagates {@link SpanContext} through Trace Context format propagation.\n *\n * Based on the Trace Context specification:\n * https://www.w3.org/TR/trace-context/\n */\nexport class W3CTraceContextPropagator {\n inject(context, carrier, setter) {\n const spanContext = trace.getSpanContext(context);\n if (!spanContext ||\n isTracingSuppressed(context) ||\n !isSpanContextValid(spanContext))\n return;\n const traceParent = `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-0${Number(spanContext.traceFlags || TraceFlags.NONE).toString(16)}`;\n setter.set(carrier, TRACE_PARENT_HEADER, traceParent);\n if (spanContext.traceState) {\n setter.set(carrier, TRACE_STATE_HEADER, spanContext.traceState.serialize());\n }\n }\n extract(context, carrier, getter) {\n const traceParentHeader = getter.get(carrier, TRACE_PARENT_HEADER);\n if (!traceParentHeader)\n return context;\n const traceParent = Array.isArray(traceParentHeader)\n ? traceParentHeader[0]\n : traceParentHeader;\n if (typeof traceParent !== 'string')\n return context;\n const spanContext = parseTraceParent(traceParent);\n if (!spanContext)\n return context;\n spanContext.isRemote = true;\n const traceStateHeader = getter.get(carrier, TRACE_STATE_HEADER);\n if (traceStateHeader) {\n // If more than one `tracestate` header is found, we merge them into a\n // single header.\n const state = Array.isArray(traceStateHeader)\n ? traceStateHeader.join(',')\n : traceStateHeader;\n spanContext.traceState = new TraceState(typeof state === 'string' ? state : undefined);\n }\n return trace.setSpanContext(context, spanContext);\n }\n fields() {\n return [TRACE_PARENT_HEADER, TRACE_STATE_HEADER];\n }\n}\n//# sourceMappingURL=W3CTraceContextPropagator.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * based on lodash in order to support esm builds without esModuleInterop.\n * lodash is using MIT License.\n **/\nconst objectTag = '[object Object]';\nconst nullTag = '[object Null]';\nconst undefinedTag = '[object Undefined]';\nconst funcProto = Function.prototype;\nconst funcToString = funcProto.toString;\nconst objectCtorString = funcToString.call(Object);\nconst getPrototypeOf = Object.getPrototypeOf;\nconst objectProto = Object.prototype;\nconst hasOwnProperty = objectProto.hasOwnProperty;\nconst symToStringTag = Symbol ? Symbol.toStringTag : undefined;\nconst nativeObjectToString = objectProto.toString;\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nexport function isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) !== objectTag) {\n return false;\n }\n const proto = getPrototypeOf(value);\n if (proto === null) {\n return true;\n }\n const Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return (typeof Ctor == 'function' &&\n Ctor instanceof Ctor &&\n funcToString.call(Ctor) === objectCtorString);\n}\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return symToStringTag && symToStringTag in Object(value)\n ? getRawTag(value)\n : objectToString(value);\n}\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n const isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];\n let unmasked = false;\n try {\n value[symToStringTag] = undefined;\n unmasked = true;\n }\n catch {\n // silence\n }\n const result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n }\n else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n//# sourceMappingURL=lodash.merge.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { isPlainObject } from './lodash.merge';\nconst MAX_LEVEL = 20;\n/**\n * Merges objects together\n * @param args - objects / values to be merged\n */\nexport function merge(...args) {\n let result = args.shift();\n const objects = new WeakMap();\n while (args.length > 0) {\n result = mergeTwoObjects(result, args.shift(), 0, objects);\n }\n return result;\n}\nfunction takeValue(value) {\n if (isArray(value)) {\n return value.slice();\n }\n return value;\n}\n/**\n * Merges two objects\n * @param one - first object\n * @param two - second object\n * @param level - current deep level\n * @param objects - objects holder that has been already referenced - to prevent\n * cyclic dependency\n */\nfunction mergeTwoObjects(one, two, level = 0, objects) {\n let result;\n if (level > MAX_LEVEL) {\n return undefined;\n }\n level++;\n if (isPrimitive(one) || isPrimitive(two) || isFunction(two)) {\n result = takeValue(two);\n }\n else if (isArray(one)) {\n result = one.slice();\n if (isArray(two)) {\n for (let i = 0, j = two.length; i < j; i++) {\n result.push(takeValue(two[i]));\n }\n }\n else if (isObject(two)) {\n const keys = Object.keys(two);\n for (let i = 0, j = keys.length; i < j; i++) {\n const key = keys[i];\n if (key === '__proto__' ||\n key === 'constructor' ||\n key === 'prototype') {\n continue;\n }\n result[key] = takeValue(two[key]);\n }\n }\n }\n else if (isObject(one)) {\n if (isObject(two)) {\n if (!shouldMerge(one, two)) {\n return two;\n }\n result = Object.assign({}, one);\n const keys = Object.keys(two);\n for (let i = 0, j = keys.length; i < j; i++) {\n const key = keys[i];\n if (key === '__proto__' ||\n key === 'constructor' ||\n key === 'prototype') {\n continue;\n }\n const twoValue = two[key];\n if (isPrimitive(twoValue)) {\n if (typeof twoValue === 'undefined') {\n delete result[key];\n }\n else {\n // result[key] = takeValue(twoValue);\n result[key] = twoValue;\n }\n }\n else {\n const obj1 = result[key];\n const obj2 = twoValue;\n if (wasObjectReferenced(one, key, objects) ||\n wasObjectReferenced(two, key, objects)) {\n delete result[key];\n }\n else {\n if (isObject(obj1) && isObject(obj2)) {\n const arr1 = objects.get(obj1) || [];\n const arr2 = objects.get(obj2) || [];\n arr1.push({ obj: one, key });\n arr2.push({ obj: two, key });\n objects.set(obj1, arr1);\n objects.set(obj2, arr2);\n }\n result[key] = mergeTwoObjects(result[key], twoValue, level, objects);\n }\n }\n }\n }\n else {\n result = two;\n }\n }\n return result;\n}\n/**\n * Function to check if object has been already reference\n * @param obj\n * @param key\n * @param objects\n */\nfunction wasObjectReferenced(obj, key, objects) {\n const arr = objects.get(obj[key]) || [];\n for (let i = 0, j = arr.length; i < j; i++) {\n const info = arr[i];\n if (info.key === key && info.obj === obj) {\n return true;\n }\n }\n return false;\n}\nfunction isArray(value) {\n return Array.isArray(value);\n}\nfunction isFunction(value) {\n return typeof value === 'function';\n}\nfunction isObject(value) {\n return (!isPrimitive(value) &&\n !isArray(value) &&\n !isFunction(value) &&\n typeof value === 'object');\n}\nfunction isPrimitive(value) {\n return (typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean' ||\n typeof value === 'undefined' ||\n value instanceof Date ||\n value instanceof RegExp ||\n value === null);\n}\nfunction shouldMerge(one, two) {\n if (!isPlainObject(one) || !isPlainObject(two)) {\n return false;\n }\n return true;\n}\n//# sourceMappingURL=merge.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport class Deferred {\n _promise;\n _resolve;\n _reject;\n constructor() {\n this._promise = new Promise((resolve, reject) => {\n this._resolve = resolve;\n this._reject = reject;\n });\n }\n get promise() {\n return this._promise;\n }\n resolve(val) {\n this._resolve(val);\n }\n reject(err) {\n this._reject(err);\n }\n}\n//# sourceMappingURL=promise.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { Deferred } from './promise';\n/**\n * Bind the callback and only invoke the callback once regardless how many times `BindOnceFuture.call` is invoked.\n */\nexport class BindOnceFuture {\n _isCalled = false;\n _deferred = new Deferred();\n _callback;\n _that;\n constructor(callback, that) {\n this._callback = callback;\n this._that = that;\n }\n get isCalled() {\n return this._isCalled;\n }\n get promise() {\n return this._deferred.promise;\n }\n call(...args) {\n if (!this._isCalled) {\n this._isCalled = true;\n try {\n Promise.resolve(this._callback.call(this._that, ...args)).then(val => this._deferred.resolve(val), err => this._deferred.reject(err));\n }\n catch (err) {\n this._deferred.reject(err);\n }\n }\n return this._deferred.promise;\n }\n}\n//# sourceMappingURL=callback.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { context } from '@opentelemetry/api';\nimport { suppressTracing } from '../trace/suppress-tracing';\n/**\n * @internal\n * Shared functionality used by Exporters while exporting data, including suppression of Traces.\n */\nexport function _export(exporter, arg) {\n return new Promise(resolve => {\n // prevent downstream exporter calls from generating spans\n context.with(suppressTracing(context.active()), () => {\n exporter.export(arg, resolve);\n });\n });\n}\n//# sourceMappingURL=exporter.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport { W3CBaggagePropagator } from './baggage/propagation/W3CBaggagePropagator';\nexport { AnchoredClock } from './common/anchored-clock';\nexport { isAttributeValue, sanitizeAttributes } from './common/attributes';\nexport { globalErrorHandler, setGlobalErrorHandler, } from './common/global-error-handler';\nexport { loggingErrorHandler } from './common/logging-error-handler';\nexport { addHrTimes, getTimeOrigin, hrTime, hrTimeDuration, hrTimeToMicroseconds, hrTimeToMilliseconds, hrTimeToNanoseconds, hrTimeToTimeStamp, isTimeInput, isTimeInputHrTime, millisToHrTime, timeInputToHrTime, } from './common/time';\nexport { unrefTimer } from './common/timer-util';\nexport { ExportResultCode } from './ExportResult';\nexport { parseKeyPairsIntoRecord } from './baggage/utils';\nexport { SDK_INFO, _globalThis, getStringFromEnv, getBooleanFromEnv, getNumberFromEnv, getStringListFromEnv, otperformance, } from './platform';\nexport { CompositePropagator } from './propagation/composite';\nexport { TRACE_PARENT_HEADER, TRACE_STATE_HEADER, W3CTraceContextPropagator, parseTraceParent, } from './trace/W3CTraceContextPropagator';\nexport { RPCType, deleteRPCMetadata, getRPCMetadata, setRPCMetadata, } from './trace/rpc-metadata';\nexport { isTracingSuppressed, suppressTracing, unsuppressTracing, } from './trace/suppress-tracing';\nexport { TraceState } from './trace/TraceState';\nexport { merge } from './utils/merge';\nexport { TimeoutError, callWithTimeout } from './utils/timeout';\nexport { isUrlIgnored, urlMatches } from './utils/url';\nexport { BindOnceFuture } from './utils/callback';\nexport { diagLogLevelFromString } from './utils/configuration';\nimport { _export } from './internal/exporter';\nexport const internal = {\n _export,\n};\n//# sourceMappingURL=index.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport class OTLPExporterBase {\n _delegate;\n constructor(delegate) {\n this._delegate = delegate;\n }\n /**\n * Export items.\n * @param items\n * @param resultCallback\n */\n export(items, resultCallback) {\n this._delegate.export(items, resultCallback);\n }\n forceFlush() {\n return this._delegate.forceFlush();\n }\n shutdown() {\n return this._delegate.shutdown();\n }\n}\n//# sourceMappingURL=OTLPExporterBase.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * Interface for handling error\n */\nexport class OTLPExporterError extends Error {\n code;\n name = 'OTLPExporterError';\n data;\n constructor(message, code, data) {\n super(message);\n this.data = data;\n this.code = code;\n }\n}\n//# sourceMappingURL=types.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport function validateTimeoutMillis(timeoutMillis) {\n if (Number.isFinite(timeoutMillis) && timeoutMillis > 0) {\n return timeoutMillis;\n }\n throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${timeoutMillis}')`);\n}\nexport function wrapStaticHeadersInFunction(headers) {\n if (headers == null) {\n return undefined;\n }\n return async () => headers;\n}\n/**\n * @param userProvidedConfiguration Configuration options provided by the user in code.\n * @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.\n * @param defaultConfiguration The defaults as defined by the exporter specification\n */\nexport function mergeOtlpSharedConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) {\n return {\n timeoutMillis: validateTimeoutMillis(userProvidedConfiguration.timeoutMillis ??\n fallbackConfiguration.timeoutMillis ??\n defaultConfiguration.timeoutMillis),\n concurrencyLimit: userProvidedConfiguration.concurrencyLimit ??\n fallbackConfiguration.concurrencyLimit ??\n defaultConfiguration.concurrencyLimit,\n compression: userProvidedConfiguration.compression ??\n fallbackConfiguration.compression ??\n defaultConfiguration.compression,\n };\n}\nexport function getSharedConfigurationDefaults() {\n return {\n timeoutMillis: 10000,\n concurrencyLimit: 30,\n compression: 'none',\n };\n}\n//# sourceMappingURL=shared-configuration.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nclass BoundedQueueExportPromiseHandler {\n _concurrencyLimit;\n _sendingPromises = [];\n /**\n * @param concurrencyLimit maximum promises allowed in a queue at the same time.\n */\n constructor(concurrencyLimit) {\n this._concurrencyLimit = concurrencyLimit;\n }\n pushPromise(promise) {\n if (this.hasReachedLimit()) {\n throw new Error('Concurrency Limit reached');\n }\n this._sendingPromises.push(promise);\n const popPromise = () => {\n const index = this._sendingPromises.indexOf(promise);\n void this._sendingPromises.splice(index, 1);\n };\n promise.then(popPromise, popPromise);\n }\n hasReachedLimit() {\n return this._sendingPromises.length >= this._concurrencyLimit;\n }\n async awaitAll() {\n await Promise.all(this._sendingPromises);\n }\n}\n/**\n * Promise queue for keeping track of export promises. Finished promises will be auto-dequeued.\n * Allows for awaiting all promises in the queue.\n */\nexport function createBoundedQueueExportPromiseHandler(options) {\n return new BoundedQueueExportPromiseHandler(options.concurrencyLimit);\n}\n//# sourceMappingURL=bounded-queue-export-promise-handler.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\nfunction isPartialSuccessResponse(response) {\n return Object.prototype.hasOwnProperty.call(response, 'partialSuccess');\n}\n/**\n * Default response handler that logs a partial success to the console.\n */\nexport function createLoggingPartialSuccessResponseHandler() {\n return {\n handleResponse(response) {\n // Partial success MUST never be an empty object according the specification\n // see https://opentelemetry.io/docs/specs/otlp/#partial-success\n if (response == null ||\n !isPartialSuccessResponse(response) ||\n response.partialSuccess == null ||\n Object.keys(response.partialSuccess).length === 0) {\n return;\n }\n diag.warn('Received Partial Success response:', JSON.stringify(response.partialSuccess));\n },\n };\n}\n//# sourceMappingURL=logging-response-handler.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ExportResultCode } from '@opentelemetry/core';\nimport { OTLPExporterError } from './types';\nimport { createLoggingPartialSuccessResponseHandler } from './logging-response-handler';\nimport { diag } from '@opentelemetry/api';\nclass OTLPExportDelegate {\n _diagLogger;\n _transport;\n _serializer;\n _responseHandler;\n _promiseQueue;\n _timeout;\n constructor(transport, serializer, responseHandler, promiseQueue, timeout) {\n this._transport = transport;\n this._serializer = serializer;\n this._responseHandler = responseHandler;\n this._promiseQueue = promiseQueue;\n this._timeout = timeout;\n this._diagLogger = diag.createComponentLogger({\n namespace: 'OTLPExportDelegate',\n });\n }\n export(internalRepresentation, resultCallback) {\n this._diagLogger.debug('items to be sent', internalRepresentation);\n // don't do any work if too many exports are in progress.\n if (this._promiseQueue.hasReachedLimit()) {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new Error('Concurrent export limit reached'),\n });\n return;\n }\n const serializedRequest = this._serializer.serializeRequest(internalRepresentation);\n if (serializedRequest == null) {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new Error('Nothing to send'),\n });\n return;\n }\n this._promiseQueue.pushPromise(this._transport.send(serializedRequest, this._timeout).then(response => {\n if (response.status === 'success') {\n if (response.data != null) {\n try {\n this._responseHandler.handleResponse(this._serializer.deserializeResponse(response.data));\n }\n catch (e) {\n this._diagLogger.warn('Export succeeded but could not deserialize response - is the response specification compliant?', e, response.data);\n }\n }\n // No matter the response, we can consider the export still successful.\n resultCallback({\n code: ExportResultCode.SUCCESS,\n });\n return;\n }\n else if (response.status === 'failure' && response.error) {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: response.error,\n });\n return;\n }\n else if (response.status === 'retryable') {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: response.error ??\n new OTLPExporterError('Export failed with retryable status'),\n });\n }\n else {\n resultCallback({\n code: ExportResultCode.FAILED,\n error: new OTLPExporterError('Export failed with unknown error'),\n });\n }\n }, reason => resultCallback({\n code: ExportResultCode.FAILED,\n error: reason,\n })));\n }\n forceFlush() {\n return this._promiseQueue.awaitAll();\n }\n async shutdown() {\n this._diagLogger.debug('shutdown started');\n await this.forceFlush();\n this._transport.shutdown();\n }\n}\n/**\n * Creates a generic delegate for OTLP exports which only contains parts of the OTLP export that are shared across all\n * signals.\n */\nexport function createOtlpExportDelegate(components, settings) {\n return new OTLPExportDelegate(components.transport, components.serializer, createLoggingPartialSuccessResponseHandler(), components.promiseHandler, settings.timeout);\n}\n//# sourceMappingURL=otlp-export-delegate.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { createBoundedQueueExportPromiseHandler } from './bounded-queue-export-promise-handler';\nimport { createOtlpExportDelegate } from './otlp-export-delegate';\nexport function createOtlpNetworkExportDelegate(options, serializer, transport) {\n return createOtlpExportDelegate({\n transport: transport,\n serializer,\n promiseHandler: createBoundedQueueExportPromiseHandler(options),\n }, { timeout: options.timeoutMillis });\n}\n//# sourceMappingURL=otlp-network-export-delegate.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nlet serviceName;\n/**\n * Returns the default service name for OpenTelemetry resources.\n * In Node.js environments, returns \"unknown_service:<process.argv0>\".\n * In browser/edge environments, returns \"unknown_service\".\n */\nexport function defaultServiceName() {\n if (serviceName === undefined) {\n try {\n const argv0 = globalThis.process.argv0;\n serviceName = argv0 ? `unknown_service:${argv0}` : 'unknown_service';\n }\n catch {\n serviceName = 'unknown_service';\n }\n }\n return serviceName;\n}\n/** @internal For testing purposes only */\nexport function _clearDefaultServiceNameCache() {\n serviceName = undefined;\n}\n//# sourceMappingURL=default-service-name.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport const isPromiseLike = (val) => {\n return (val !== null &&\n typeof val === 'object' &&\n typeof val.then === 'function');\n};\n//# sourceMappingURL=utils.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\nimport { SDK_INFO } from '@opentelemetry/core';\nimport { ATTR_SERVICE_NAME, ATTR_TELEMETRY_SDK_LANGUAGE, ATTR_TELEMETRY_SDK_NAME, ATTR_TELEMETRY_SDK_VERSION, } from '@opentelemetry/semantic-conventions';\nimport { defaultServiceName } from './default-service-name';\nimport { isPromiseLike } from './utils';\nclass ResourceImpl {\n _rawAttributes;\n _asyncAttributesPending = false;\n _schemaUrl;\n _memoizedAttributes;\n static FromAttributeList(attributes, options) {\n const res = new ResourceImpl({}, options);\n res._rawAttributes = guardedRawAttributes(attributes);\n res._asyncAttributesPending =\n attributes.filter(([_, val]) => isPromiseLike(val)).length > 0;\n return res;\n }\n constructor(\n /**\n * A dictionary of attributes with string keys and values that provide\n * information about the entity as numbers, strings or booleans\n * TODO: Consider to add check/validation on attributes.\n */\n resource, options) {\n const attributes = resource.attributes ?? {};\n this._rawAttributes = Object.entries(attributes).map(([k, v]) => {\n if (isPromiseLike(v)) {\n // side-effect\n this._asyncAttributesPending = true;\n }\n return [k, v];\n });\n this._rawAttributes = guardedRawAttributes(this._rawAttributes);\n this._schemaUrl = validateSchemaUrl(options?.schemaUrl);\n }\n get asyncAttributesPending() {\n return this._asyncAttributesPending;\n }\n async waitForAsyncAttributes() {\n if (!this.asyncAttributesPending) {\n return;\n }\n for (let i = 0; i < this._rawAttributes.length; i++) {\n const [k, v] = this._rawAttributes[i];\n this._rawAttributes[i] = [k, isPromiseLike(v) ? await v : v];\n }\n this._asyncAttributesPending = false;\n }\n get attributes() {\n if (this.asyncAttributesPending) {\n diag.error('Accessing resource attributes before async attributes settled');\n }\n if (this._memoizedAttributes) {\n return this._memoizedAttributes;\n }\n const attrs = {};\n for (const [k, v] of this._rawAttributes) {\n if (isPromiseLike(v)) {\n diag.debug(`Unsettled resource attribute ${k} skipped`);\n continue;\n }\n if (v != null) {\n attrs[k] ??= v;\n }\n }\n // only memoize output if all attributes are settled\n if (!this._asyncAttributesPending) {\n this._memoizedAttributes = attrs;\n }\n return attrs;\n }\n getRawAttributes() {\n return this._rawAttributes;\n }\n get schemaUrl() {\n return this._schemaUrl;\n }\n merge(resource) {\n if (resource == null)\n return this;\n // Order is important\n // Spec states incoming attributes override existing attributes\n const mergedSchemaUrl = mergeSchemaUrl(this, resource);\n const mergedOptions = mergedSchemaUrl\n ? { schemaUrl: mergedSchemaUrl }\n : undefined;\n return ResourceImpl.FromAttributeList([...resource.getRawAttributes(), ...this.getRawAttributes()], mergedOptions);\n }\n}\nexport function resourceFromAttributes(attributes, options) {\n return ResourceImpl.FromAttributeList(Object.entries(attributes), options);\n}\nexport function resourceFromDetectedResource(detectedResource, options) {\n return new ResourceImpl(detectedResource, options);\n}\nexport function emptyResource() {\n return resourceFromAttributes({});\n}\nexport function defaultResource() {\n return resourceFromAttributes({\n [ATTR_SERVICE_NAME]: defaultServiceName(),\n [ATTR_TELEMETRY_SDK_LANGUAGE]: SDK_INFO[ATTR_TELEMETRY_SDK_LANGUAGE],\n [ATTR_TELEMETRY_SDK_NAME]: SDK_INFO[ATTR_TELEMETRY_SDK_NAME],\n [ATTR_TELEMETRY_SDK_VERSION]: SDK_INFO[ATTR_TELEMETRY_SDK_VERSION],\n });\n}\nfunction guardedRawAttributes(attributes) {\n return attributes.map(([k, v]) => {\n if (isPromiseLike(v)) {\n return [\n k,\n v.catch(err => {\n diag.debug('promise rejection for resource attribute: %s - %s', k, err);\n return undefined;\n }),\n ];\n }\n return [k, v];\n });\n}\nfunction validateSchemaUrl(schemaUrl) {\n if (typeof schemaUrl === 'string' || schemaUrl === undefined) {\n return schemaUrl;\n }\n diag.warn('Schema URL must be string or undefined, got %s. Schema URL will be ignored.', schemaUrl);\n return undefined;\n}\nfunction mergeSchemaUrl(old, updating) {\n const oldSchemaUrl = old?.schemaUrl;\n const updatingSchemaUrl = updating?.schemaUrl;\n const isOldEmpty = oldSchemaUrl === undefined || oldSchemaUrl === '';\n const isUpdatingEmpty = updatingSchemaUrl === undefined || updatingSchemaUrl === '';\n if (isOldEmpty) {\n return updatingSchemaUrl;\n }\n if (isUpdatingEmpty) {\n return oldSchemaUrl;\n }\n if (oldSchemaUrl === updatingSchemaUrl) {\n return oldSchemaUrl;\n }\n diag.warn('Schema URL merge conflict: old resource has \"%s\", updating resource has \"%s\". Resulting resource will have undefined Schema URL.', oldSchemaUrl, updatingSchemaUrl);\n return undefined;\n}\n//# sourceMappingURL=ResourceImpl.js.map","export function createResource(resource, encoder) {\n const result = {\n attributes: toAttributes(resource.attributes, encoder),\n droppedAttributesCount: 0,\n };\n const schemaUrl = resource.schemaUrl;\n if (schemaUrl && schemaUrl !== '')\n result.schemaUrl = schemaUrl;\n return result;\n}\nexport function createInstrumentationScope(scope) {\n return {\n name: scope.name,\n version: scope.version,\n };\n}\nexport function toAttributes(attributes, encoder) {\n return Object.keys(attributes).map(key => toKeyValue(key, attributes[key], encoder));\n}\nexport function toKeyValue(key, value, encoder) {\n return {\n key: key,\n value: toAnyValue(value, encoder),\n };\n}\nexport function toAnyValue(value, encoder) {\n const t = typeof value;\n if (t === 'string')\n return { stringValue: value };\n if (t === 'number') {\n if (!Number.isInteger(value))\n return { doubleValue: value };\n return { intValue: value };\n }\n if (t === 'boolean')\n return { boolValue: value };\n if (value instanceof Uint8Array)\n return { bytesValue: encoder.encodeUint8Array(value) };\n if (Array.isArray(value)) {\n const values = new Array(value.length);\n for (let i = 0; i < value.length; i++) {\n values[i] = toAnyValue(value[i], encoder);\n }\n return { arrayValue: { values } };\n }\n if (t === 'object' && value != null) {\n const keys = Object.keys(value);\n const values = new Array(keys.length);\n for (let i = 0; i < keys.length; i++) {\n values[i] = {\n key: keys[i],\n value: toAnyValue(value[keys[i]], encoder),\n };\n }\n return { kvlistValue: { values } };\n }\n return {};\n}\n//# sourceMappingURL=internal.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { hrTimeToNanoseconds } from '@opentelemetry/core';\nimport { hexToBinary } from './hex-to-binary';\nexport function hrTimeToNanos(hrTime) {\n const NANOSECONDS = BigInt(1000000000);\n return (BigInt(Math.trunc(hrTime[0])) * NANOSECONDS + BigInt(Math.trunc(hrTime[1])));\n}\nexport function toLongBits(value) {\n const low = Number(BigInt.asUintN(32, value));\n const high = Number(BigInt.asUintN(32, value >> BigInt(32)));\n return { low, high };\n}\nexport function encodeAsLongBits(hrTime) {\n const nanos = hrTimeToNanos(hrTime);\n return toLongBits(nanos);\n}\nexport function encodeAsString(hrTime) {\n const nanos = hrTimeToNanos(hrTime);\n return nanos.toString();\n}\nconst encodeTimestamp = typeof BigInt !== 'undefined' ? encodeAsString : hrTimeToNanoseconds;\nfunction identity(value) {\n return value;\n}\nfunction optionalHexToBinary(str) {\n if (str === undefined)\n return undefined;\n return hexToBinary(str);\n}\n/**\n * Encoder for protobuf format.\n * Uses { high, low } timestamps and binary for span/trace IDs, leaves Uint8Array attributes as-is.\n */\nexport const PROTOBUF_ENCODER = {\n encodeHrTime: encodeAsLongBits,\n encodeSpanContext: hexToBinary,\n encodeOptionalSpanContext: optionalHexToBinary,\n encodeUint8Array: identity,\n};\n/**\n * Encoder for JSON format.\n * Uses string timestamps, hex for span/trace IDs, and base64 for Uint8Array.\n */\nexport const JSON_ENCODER = {\n encodeHrTime: encodeTimestamp,\n encodeSpanContext: identity,\n encodeOptionalSpanContext: identity,\n encodeUint8Array: (bytes) => {\n if (typeof Buffer !== 'undefined') {\n return Buffer.from(bytes).toString('base64');\n }\n // implementation note: not using spread operator and passing to\n // btoa to avoid stack overflow on large Uint8Arrays\n const chars = new Array(bytes.length);\n for (let i = 0; i < bytes.length; i++) {\n chars[i] = String.fromCharCode(bytes[i]);\n }\n return btoa(chars.join(''));\n },\n};\n//# sourceMappingURL=utils.js.map","import { createInstrumentationScope, createResource, toAttributes, } from '../common/internal';\n// Span flags constants matching the OTLP specification\nconst SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK = 0x100;\nconst SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK = 0x200;\n/**\n * Builds the 32-bit span flags value combining the low 8-bit W3C TraceFlags\n * with the HAS_IS_REMOTE and IS_REMOTE bits according to the OTLP spec.\n */\nfunction buildSpanFlagsFrom(traceFlags, isRemote) {\n // low 8 bits are W3C TraceFlags (e.g., sampled)\n let flags = (traceFlags & 0xff) | SPAN_FLAGS_CONTEXT_HAS_IS_REMOTE_MASK;\n if (isRemote) {\n flags |= SPAN_FLAGS_CONTEXT_IS_REMOTE_MASK;\n }\n return flags;\n}\nexport function sdkSpanToOtlpSpan(span, encoder) {\n const ctx = span.spanContext();\n const status = span.status;\n const parentSpanId = span.parentSpanContext?.spanId\n ? encoder.encodeSpanContext(span.parentSpanContext?.spanId)\n : undefined;\n return {\n traceId: encoder.encodeSpanContext(ctx.traceId),\n spanId: encoder.encodeSpanContext(ctx.spanId),\n parentSpanId: parentSpanId,\n traceState: ctx.traceState?.serialize(),\n name: span.name,\n // Span kind is offset by 1 because the API does not define a value for unset\n kind: span.kind == null ? 0 : span.kind + 1,\n startTimeUnixNano: encoder.encodeHrTime(span.startTime),\n endTimeUnixNano: encoder.encodeHrTime(span.endTime),\n attributes: toAttributes(span.attributes, encoder),\n droppedAttributesCount: span.droppedAttributesCount,\n events: span.events.map(event => toOtlpSpanEvent(event, encoder)),\n droppedEventsCount: span.droppedEventsCount,\n status: {\n // API and proto enums share the same values\n code: status.code,\n message: status.message,\n },\n links: span.links.map(link => toOtlpLink(link, encoder)),\n droppedLinksCount: span.droppedLinksCount,\n flags: buildSpanFlagsFrom(ctx.traceFlags, span.parentSpanContext?.isRemote),\n };\n}\nexport function toOtlpLink(link, encoder) {\n return {\n attributes: link.attributes ? toAttributes(link.attributes, encoder) : [],\n spanId: encoder.encodeSpanContext(link.context.spanId),\n traceId: encoder.encodeSpanContext(link.context.traceId),\n traceState: link.context.traceState?.serialize(),\n droppedAttributesCount: link.droppedAttributesCount || 0,\n flags: buildSpanFlagsFrom(link.context.traceFlags, link.context.isRemote),\n };\n}\nexport function toOtlpSpanEvent(timedEvent, encoder) {\n return {\n attributes: timedEvent.attributes\n ? toAttributes(timedEvent.attributes, encoder)\n : [],\n name: timedEvent.name,\n timeUnixNano: encoder.encodeHrTime(timedEvent.time),\n droppedAttributesCount: timedEvent.droppedAttributesCount || 0,\n };\n}\nexport function createExportTraceServiceRequest(spans, encoder) {\n return {\n resourceSpans: spanRecordsToResourceSpans(spans, encoder),\n };\n}\nfunction createResourceMap(readableSpans) {\n const resourceMap = new Map();\n for (const record of readableSpans) {\n let ilsMap = resourceMap.get(record.resource);\n if (!ilsMap) {\n ilsMap = new Map();\n resourceMap.set(record.resource, ilsMap);\n }\n // TODO this is duplicated in basic tracer. Consolidate on a common helper in core\n const instrumentationScopeKey = `${record.instrumentationScope.name}@${record.instrumentationScope.version || ''}:${record.instrumentationScope.schemaUrl || ''}`;\n let records = ilsMap.get(instrumentationScopeKey);\n if (!records) {\n records = [];\n ilsMap.set(instrumentationScopeKey, records);\n }\n records.push(record);\n }\n return resourceMap;\n}\nfunction spanRecordsToResourceSpans(readableSpans, encoder) {\n const resourceMap = createResourceMap(readableSpans);\n const out = [];\n const entryIterator = resourceMap.entries();\n let entry = entryIterator.next();\n while (!entry.done) {\n const [resource, ilmMap] = entry.value;\n const scopeResourceSpans = [];\n const ilmIterator = ilmMap.values();\n let ilmEntry = ilmIterator.next();\n while (!ilmEntry.done) {\n const scopeSpans = ilmEntry.value;\n if (scopeSpans.length > 0) {\n const spans = scopeSpans.map(readableSpan => sdkSpanToOtlpSpan(readableSpan, encoder));\n scopeResourceSpans.push({\n scope: createInstrumentationScope(scopeSpans[0].instrumentationScope),\n spans: spans,\n schemaUrl: scopeSpans[0].instrumentationScope.schemaUrl,\n });\n }\n ilmEntry = ilmIterator.next();\n }\n const processedResource = createResource(resource, encoder);\n const transformedSpans = {\n resource: processedResource,\n scopeSpans: scopeResourceSpans,\n schemaUrl: processedResource.schemaUrl,\n };\n out.push(transformedSpans);\n entry = entryIterator.next();\n }\n return out;\n}\n//# sourceMappingURL=internal.js.map","import { createExportTraceServiceRequest } from '../internal';\nimport { JSON_ENCODER } from '../../common/utils';\nimport { diag } from '@opentelemetry/api';\nexport const JsonTraceSerializer = {\n serializeRequest: (arg) => {\n const request = createExportTraceServiceRequest(arg, JSON_ENCODER);\n const encoder = new TextEncoder();\n return encoder.encode(JSON.stringify(request));\n },\n deserializeResponse: (arg) => {\n if (arg.length === 0) {\n return {};\n }\n const decoder = new TextDecoder();\n try {\n return JSON.parse(decoder.decode(arg));\n }\n catch (err) {\n diag.warn(`Failed to parse trace export response: ${err.message}. Returning empty response`);\n return {};\n }\n },\n};\n//# sourceMappingURL=trace.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\nconst MAX_ATTEMPTS = 5;\nconst INITIAL_BACKOFF = 1000;\nconst MAX_BACKOFF = 5000;\nconst BACKOFF_MULTIPLIER = 1.5;\nconst JITTER = 0.2;\n/**\n * Get a pseudo-random jitter that falls in the range of [-JITTER, +JITTER]\n */\nfunction getJitter() {\n return Math.random() * (2 * JITTER) - JITTER;\n}\nclass RetryingTransport {\n _transport;\n constructor(transport) {\n this._transport = transport;\n }\n retry(data, timeoutMillis, inMillis) {\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n this._transport.send(data, timeoutMillis).then(resolve, reject);\n }, inMillis);\n });\n }\n async send(data, timeoutMillis) {\n let attempts = MAX_ATTEMPTS;\n let nextBackoff = INITIAL_BACKOFF;\n const deadline = Date.now() + timeoutMillis;\n let result = await this._transport.send(data, timeoutMillis);\n while (result.status === 'retryable' && attempts > 0) {\n attempts--;\n // use maximum of computed backoff and 0 to avoid negative timeouts\n const backoff = Math.max(Math.min(nextBackoff * (1 + getJitter()), MAX_BACKOFF), 0);\n nextBackoff = nextBackoff * BACKOFF_MULTIPLIER;\n const retryInMillis = result.retryInMillis ?? backoff;\n // return when expected retry time is after the export deadline.\n const remainingTimeoutMillis = deadline - Date.now();\n if (retryInMillis > remainingTimeoutMillis) {\n diag.info(`Export retry time ${Math.round(retryInMillis)}ms exceeds remaining timeout ${Math.round(remainingTimeoutMillis)}ms, not retrying further.`);\n return result;\n }\n diag.verbose(`Scheduling export retry in ${Math.round(retryInMillis)}ms`);\n result = await this.retry(data, remainingTimeoutMillis, retryInMillis);\n }\n if (result.status === 'success') {\n diag.verbose(`Export succeeded after ${MAX_ATTEMPTS - attempts} retry attempts.`);\n }\n else if (result.status === 'retryable') {\n diag.info(`Export failed after maximum retry attempts (${MAX_ATTEMPTS}).`);\n }\n else {\n diag.info(`Export failed with non-retryable error: ${result.error}`);\n }\n return result;\n }\n shutdown() {\n return this._transport.shutdown();\n }\n}\n/**\n * Creates an Exporter Transport that retries on 'retryable' response.\n */\nexport function createRetryingTransport(options) {\n return new RetryingTransport(options.transport);\n}\n//# sourceMappingURL=retrying-transport.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nexport function isExportHTTPErrorRetryable(statusCode) {\n return (statusCode === 429 ||\n statusCode === 502 ||\n statusCode === 503 ||\n statusCode === 504);\n}\nexport function parseRetryAfterToMills(retryAfter) {\n if (retryAfter == null) {\n return undefined;\n }\n const seconds = Number.parseInt(retryAfter, 10);\n if (Number.isInteger(seconds)) {\n return seconds > 0 ? seconds * 1000 : -1;\n }\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After#directives\n const delay = new Date(retryAfter).getTime() - Date.now();\n if (delay >= 0) {\n return delay;\n }\n return 0;\n}\n//# sourceMappingURL=is-export-retryable.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\nimport { isExportHTTPErrorRetryable, parseRetryAfterToMills, } from '../is-export-retryable';\n/**\n * Maximum total body size for concurrent keepalive requests.\n * Browsers enforce a 64KiB cumulative limit across all pending keepalive requests.\n * We use 60KB to leave headroom for headers.\n * @see https://github.com/whatwg/fetch/issues/679\n * @see https://blog.huli.tw/2025/01/06/en/navigator-sendbeacon-64kib-and-source-code/\n */\nconst MAX_KEEPALIVE_BODY_SIZE = 60 * 1024;\n/**\n * Maximum concurrent keepalive requests.\n * Chrome enforces 9 concurrent keepalive fetch requests per renderer process.\n * @see https://github.com/whatwg/fetch/issues/679\n * Quote: \"If the renderer process is processing more than 9 requests with keepalive set, we reject a new request\"\n */\nconst MAX_KEEPALIVE_REQUESTS = 9;\n/**\n * Track cumulative pending body size across all in-flight keepalive requests.\n * This is necessary because the 64KiB limit is cumulative, not per-request.\n */\nlet pendingBodySize = 0;\n/**\n * Track number of pending keepalive requests.\n */\nlet pendingKeepaliveCount = 0;\nclass FetchTransport {\n _parameters;\n constructor(parameters) {\n this._parameters = parameters;\n }\n async send(data, timeoutMillis) {\n const abortController = new AbortController();\n const timeout = setTimeout(() => abortController.abort(), timeoutMillis);\n // Fetch API may be wrapped by an instrumentation like `@opentelemetry/instrumentation-fetch`.\n // In that case the instrumentation would create a new Span for this request\n // because the context manager cannot keep the context after `await` calls.\n // This creates an indirect endless loop Export -> Span -> Export\n // By using the `__original` function the instrumentation can't intercept the call\n // and no Span will be created breaking the vicious cycle\n let fetchApi = globalThis.fetch;\n // @ts-expect-error -- fetch could be wrapped\n if (typeof fetchApi.__original === 'function') {\n // @ts-expect-error -- fetch could be wrapped\n fetchApi = fetchApi.__original;\n }\n const requestSize = data.byteLength;\n // Determine if we can use keepalive based on cumulative browser limits.\n // We must check BEFORE adding to pending totals to avoid exceeding limits.\n const wouldExceedSize = pendingBodySize + requestSize > MAX_KEEPALIVE_BODY_SIZE;\n const wouldExceedCount = pendingKeepaliveCount >= MAX_KEEPALIVE_REQUESTS;\n const useKeepalive = !wouldExceedSize && !wouldExceedCount;\n if (useKeepalive) {\n pendingBodySize += requestSize;\n pendingKeepaliveCount++;\n }\n else {\n const reason = wouldExceedSize ? 'size limit' : 'count limit';\n diag.debug(`keepalive disabled: ${(requestSize / 1024).toFixed(1)}KB payload, ${pendingKeepaliveCount} pending (${reason})`);\n }\n try {\n const url = new URL(this._parameters.url);\n const response = await fetchApi(url.href, {\n method: 'POST',\n headers: await this._parameters.headers(),\n body: data,\n signal: abortController.signal,\n keepalive: useKeepalive,\n mode: globalThis.location\n ? globalThis.location.origin === url.origin\n ? 'same-origin'\n : 'cors'\n : 'no-cors',\n });\n if (response.status >= 200 && response.status <= 299) {\n diag.debug(`export response success (status: ${response.status})`);\n return { status: 'success' };\n }\n else if (isExportHTTPErrorRetryable(response.status)) {\n diag.warn(`export response retryable (status: ${response.status})`);\n const retryAfter = response.headers.get('Retry-After');\n const retryInMillis = parseRetryAfterToMills(retryAfter);\n return { status: 'retryable', retryInMillis };\n }\n diag.error(`export response failure (status: ${response.status})`);\n return {\n status: 'failure',\n error: new Error(`Fetch request failed with non-retryable status ${response.status}`),\n };\n }\n catch (error) {\n if (isFetchNetworkErrorRetryable(error)) {\n diag.warn(`export request retryable (network error: ${error})`);\n return {\n status: 'retryable',\n error: new Error('Fetch request encountered a network error', {\n cause: error,\n }),\n };\n }\n diag.error(`export request failure (error: ${error})`);\n return {\n status: 'failure',\n error: new Error('Fetch request errored', { cause: error }),\n };\n }\n finally {\n clearTimeout(timeout);\n if (useKeepalive) {\n pendingBodySize -= requestSize;\n pendingKeepaliveCount--;\n }\n }\n }\n shutdown() {\n // Intentionally left empty, nothing to do.\n }\n}\n/**\n * Creates an exporter transport that uses `fetch` to send the data\n * @param parameters applied to each request made by transport\n */\nexport function createFetchTransport(parameters) {\n return new FetchTransport(parameters);\n}\nfunction isFetchNetworkErrorRetryable(error) {\n return error instanceof TypeError && !error.cause;\n}\n//# sourceMappingURL=fetch-transport.js.map","import { createRetryingTransport } from './retrying-transport';\nimport { createOtlpNetworkExportDelegate } from './otlp-network-export-delegate';\nimport { createFetchTransport } from './transport/fetch-transport';\nexport function createOtlpFetchExportDelegate(options, serializer) {\n return createOtlpNetworkExportDelegate(options, serializer, createRetryingTransport({\n transport: createFetchTransport(options),\n }));\n}\n/**\n * @deprecated Use {@link createOtlpFetchExportDelegate} instead. Modern browsers use `fetch` with `keepAlive: true` when `sendBeacon` is used. Use a `fetch` polyfill that mimics this behavior to keep using `sendBeacon`.\n */\nexport function createOtlpSendBeaconExportDelegate(options, serializer) {\n return createOtlpFetchExportDelegate(options, serializer);\n}\n//# sourceMappingURL=otlp-browser-http-export-delegate.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\n/**\n * Parses headers from config leaving only those that have defined values\n * @param partialHeaders\n */\nexport function validateAndNormalizeHeaders(partialHeaders) {\n const headers = {};\n Object.entries(partialHeaders ?? {}).forEach(([key, value]) => {\n if (typeof value !== 'undefined') {\n headers[key] = String(value);\n }\n else {\n diag.warn(`Header \"${key}\" has invalid value (${value}) and will be ignored`);\n }\n });\n return headers;\n}\n//# sourceMappingURL=util.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { getSharedConfigurationDefaults, mergeOtlpSharedConfigurationWithDefaults, } from './shared-configuration';\nimport { validateAndNormalizeHeaders } from '../util';\nfunction mergeHeaders(userProvidedHeaders, fallbackHeaders, defaultHeaders) {\n return async () => {\n const requiredHeaders = {\n ...(await defaultHeaders()),\n };\n const headers = {};\n // add fallback ones first\n if (fallbackHeaders != null) {\n Object.assign(headers, await fallbackHeaders());\n }\n // override with user-provided ones\n if (userProvidedHeaders != null) {\n Object.assign(headers, validateAndNormalizeHeaders(await userProvidedHeaders()));\n }\n // override required ones.\n return Object.assign(headers, requiredHeaders);\n };\n}\nfunction validateUserProvidedUrl(url) {\n if (url == null) {\n return undefined;\n }\n try {\n // NOTE: In non-browser environments, `globalThis.location` will be `undefined`.\n const base = globalThis.location?.href;\n return new URL(url, base).href;\n }\n catch {\n throw new Error(`Configuration: Could not parse user-provided export URL: '${url}'`);\n }\n}\n/**\n * @param userProvidedConfiguration Configuration options provided by the user in code.\n * @param fallbackConfiguration Fallback to use when the {@link userProvidedConfiguration} does not specify an option.\n * @param defaultConfiguration The defaults as defined by the exporter specification\n */\nexport function mergeOtlpHttpConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration) {\n return {\n ...mergeOtlpSharedConfigurationWithDefaults(userProvidedConfiguration, fallbackConfiguration, defaultConfiguration),\n headers: mergeHeaders(userProvidedConfiguration.headers, fallbackConfiguration.headers, defaultConfiguration.headers),\n url: validateUserProvidedUrl(userProvidedConfiguration.url) ??\n fallbackConfiguration.url ??\n defaultConfiguration.url,\n };\n}\nexport function getHttpConfigurationDefaults(requiredHeaders, signalResourcePath) {\n return {\n ...getSharedConfigurationDefaults(),\n headers: async () => requiredHeaders,\n url: 'http://localhost:4318/' + signalResourcePath,\n };\n}\n//# sourceMappingURL=otlp-http-configuration.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { wrapStaticHeadersInFunction } from './shared-configuration';\nexport function convertLegacyHeaders(config) {\n if (typeof config.headers === 'function') {\n return config.headers;\n }\n return wrapStaticHeadersInFunction(config.headers);\n}\n//# sourceMappingURL=convert-legacy-http-options.js.map","import { getHttpConfigurationDefaults, mergeOtlpHttpConfigurationWithDefaults, } from './otlp-http-configuration';\nimport { convertLegacyHeaders } from './convert-legacy-http-options';\n/**\n * @deprecated this will be removed in 2.0\n *\n * @param config\n * @param signalResourcePath\n * @param requiredHeaders\n */\nexport function convertLegacyBrowserHttpOptions(config, signalResourcePath, requiredHeaders) {\n return mergeOtlpHttpConfigurationWithDefaults({\n url: config.url,\n timeoutMillis: config.timeoutMillis,\n headers: convertLegacyHeaders(config),\n concurrencyLimit: config.concurrencyLimit,\n }, {}, // no fallback for browser case\n getHttpConfigurationDefaults(requiredHeaders, signalResourcePath));\n}\n//# sourceMappingURL=convert-legacy-browser-http-options.js.map","import { createOtlpFetchExportDelegate } from '../otlp-browser-http-export-delegate';\nimport { convertLegacyBrowserHttpOptions } from './convert-legacy-browser-http-options';\n/**\n * @deprecated\n * @param config\n * @param serializer\n * @param signalResourcePath\n * @param requiredHeaders\n */\nexport function createLegacyOtlpBrowserExportDelegate(config, serializer, signalResourcePath, requiredHeaders) {\n const options = convertLegacyBrowserHttpOptions(config, signalResourcePath, requiredHeaders);\n return createOtlpFetchExportDelegate(options, serializer);\n}\n//# sourceMappingURL=create-legacy-browser-delegate.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { OTLPExporterBase } from '@opentelemetry/otlp-exporter-base';\nimport { JsonTraceSerializer } from '@opentelemetry/otlp-transformer';\nimport { createLegacyOtlpBrowserExportDelegate } from '@opentelemetry/otlp-exporter-base/browser-http';\n/**\n * Collector Trace Exporter for Web\n */\nexport class OTLPTraceExporter extends OTLPExporterBase {\n constructor(config = {}) {\n super(createLegacyOtlpBrowserExportDelegate(config, JsonTraceSerializer, 'v1/traces', { 'Content-Type': 'application/json' }));\n }\n}\n//# sourceMappingURL=OTLPTraceExporter.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n// Event name definitions\nexport const ExceptionEventName = 'exception';\n//# sourceMappingURL=enums.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag, SpanStatusCode } from '@opentelemetry/api';\nimport { addHrTimes, millisToHrTime, hrTime, hrTimeDuration, isAttributeValue, isTimeInput, isTimeInputHrTime, otperformance, sanitizeAttributes, } from '@opentelemetry/core';\nimport { ATTR_EXCEPTION_MESSAGE, ATTR_EXCEPTION_STACKTRACE, ATTR_EXCEPTION_TYPE, } from '@opentelemetry/semantic-conventions';\nimport { ExceptionEventName } from './enums';\n/**\n * This class represents a span.\n */\nexport class SpanImpl {\n // Below properties are included to implement ReadableSpan for export\n // purposes but are not intended to be written-to directly.\n _spanContext;\n kind;\n parentSpanContext;\n attributes = {};\n links = [];\n events = [];\n startTime;\n resource;\n instrumentationScope;\n _droppedAttributesCount = 0;\n _droppedEventsCount = 0;\n _droppedLinksCount = 0;\n _attributesCount = 0;\n name;\n status = {\n code: SpanStatusCode.UNSET,\n };\n endTime = [0, 0];\n _ended = false;\n _duration = [-1, -1];\n _spanProcessor;\n _spanLimits;\n _attributeValueLengthLimit;\n _recordEndMetrics;\n _performanceStartTime;\n _performanceOffset;\n _startTimeProvided;\n /**\n * Constructs a new SpanImpl instance.\n */\n constructor(opts) {\n const now = Date.now();\n this._spanContext = opts.spanContext;\n this._performanceStartTime = otperformance.now();\n this._performanceOffset =\n now - (this._performanceStartTime + otperformance.timeOrigin);\n this._startTimeProvided = opts.startTime != null;\n this._spanLimits = opts.spanLimits;\n this._attributeValueLengthLimit =\n this._spanLimits.attributeValueLengthLimit ?? 0;\n this._spanProcessor = opts.spanProcessor;\n this.name = opts.name;\n this.parentSpanContext = opts.parentSpanContext;\n this.kind = opts.kind;\n if (opts.links) {\n for (const link of opts.links) {\n this.addLink(link);\n }\n }\n this.startTime = this._getTime(opts.startTime ?? now);\n this.resource = opts.resource;\n this.instrumentationScope = opts.scope;\n this._recordEndMetrics = opts.recordEndMetrics;\n if (opts.attributes != null) {\n this.setAttributes(opts.attributes);\n }\n this._spanProcessor.onStart(this, opts.context);\n }\n spanContext() {\n return this._spanContext;\n }\n setAttribute(key, value) {\n if (value == null || this._isSpanEnded())\n return this;\n if (key.length === 0) {\n diag.warn(`Invalid attribute key: ${key}`);\n return this;\n }\n if (!isAttributeValue(value)) {\n diag.warn(`Invalid attribute value set for key: ${key}`);\n return this;\n }\n const { attributeCountLimit } = this._spanLimits;\n const isNewKey = !Object.prototype.hasOwnProperty.call(this.attributes, key);\n if (attributeCountLimit !== undefined &&\n this._attributesCount >= attributeCountLimit &&\n isNewKey) {\n this._droppedAttributesCount++;\n return this;\n }\n this.attributes[key] = this._truncateToSize(value);\n if (isNewKey) {\n this._attributesCount++;\n }\n return this;\n }\n setAttributes(attributes) {\n for (const key in attributes) {\n if (Object.prototype.hasOwnProperty.call(attributes, key)) {\n this.setAttribute(key, attributes[key]);\n }\n }\n return this;\n }\n /**\n *\n * @param name Span Name\n * @param [attributesOrStartTime] Span attributes or start time\n * if type is {@type TimeInput} and 3rd param is undefined\n * @param [timeStamp] Specified time stamp for the event\n */\n addEvent(name, attributesOrStartTime, timeStamp) {\n if (this._isSpanEnded())\n return this;\n const { eventCountLimit } = this._spanLimits;\n if (eventCountLimit === 0) {\n diag.warn('No events allowed.');\n this._droppedEventsCount++;\n return this;\n }\n if (eventCountLimit !== undefined &&\n this.events.length >= eventCountLimit) {\n if (this._droppedEventsCount === 0) {\n diag.debug('Dropping extra events.');\n }\n this.events.shift();\n this._droppedEventsCount++;\n }\n if (isTimeInput(attributesOrStartTime)) {\n if (!isTimeInput(timeStamp)) {\n timeStamp = attributesOrStartTime;\n }\n attributesOrStartTime = undefined;\n }\n const sanitized = sanitizeAttributes(attributesOrStartTime);\n const { attributePerEventCountLimit } = this._spanLimits;\n const attributes = {};\n let droppedAttributesCount = 0;\n let eventAttributesCount = 0;\n for (const attr in sanitized) {\n if (!Object.prototype.hasOwnProperty.call(sanitized, attr)) {\n continue;\n }\n const attrVal = sanitized[attr];\n if (attributePerEventCountLimit !== undefined &&\n eventAttributesCount >= attributePerEventCountLimit) {\n droppedAttributesCount++;\n continue;\n }\n attributes[attr] = this._truncateToSize(attrVal);\n eventAttributesCount++;\n }\n this.events.push({\n name,\n attributes,\n time: this._getTime(timeStamp),\n droppedAttributesCount,\n });\n return this;\n }\n addLink(link) {\n if (this._isSpanEnded())\n return this;\n const { linkCountLimit } = this._spanLimits;\n if (linkCountLimit === 0) {\n this._droppedLinksCount++;\n return this;\n }\n if (linkCountLimit !== undefined && this.links.length >= linkCountLimit) {\n if (this._droppedLinksCount === 0) {\n diag.debug('Dropping extra links.');\n }\n this.links.shift();\n this._droppedLinksCount++;\n }\n const { attributePerLinkCountLimit } = this._spanLimits;\n const sanitized = sanitizeAttributes(link.attributes);\n const attributes = {};\n let droppedAttributesCount = 0;\n let linkAttributesCount = 0;\n for (const attr in sanitized) {\n if (!Object.prototype.hasOwnProperty.call(sanitized, attr)) {\n continue;\n }\n const attrVal = sanitized[attr];\n if (attributePerLinkCountLimit !== undefined &&\n linkAttributesCount >= attributePerLinkCountLimit) {\n droppedAttributesCount++;\n continue;\n }\n attributes[attr] = this._truncateToSize(attrVal);\n linkAttributesCount++;\n }\n const processedLink = { context: link.context };\n if (linkAttributesCount > 0) {\n processedLink.attributes = attributes;\n }\n if (droppedAttributesCount > 0) {\n processedLink.droppedAttributesCount = droppedAttributesCount;\n }\n this.links.push(processedLink);\n return this;\n }\n addLinks(links) {\n for (const link of links) {\n this.addLink(link);\n }\n return this;\n }\n setStatus(status) {\n if (this._isSpanEnded())\n return this;\n if (status.code === SpanStatusCode.UNSET)\n return this;\n if (this.status.code === SpanStatusCode.OK)\n return this;\n const newStatus = { code: status.code };\n // When using try-catch, the caught \"error\" is of type `any`. When then assigning `any` to `status.message`,\n // TypeScript will not error. While this can happen during use of any API, it is more common on Span#setStatus()\n // as it's likely used in a catch-block. Therefore, we validate if `status.message` is actually a string, null, or\n // undefined to avoid an incorrect type causing issues downstream.\n if (status.code === SpanStatusCode.ERROR) {\n if (typeof status.message === 'string') {\n newStatus.message = status.message;\n }\n else if (status.message != null) {\n diag.warn(`Dropping invalid status.message of type '${typeof status.message}', expected 'string'`);\n }\n }\n this.status = newStatus;\n return this;\n }\n updateName(name) {\n if (this._isSpanEnded())\n return this;\n this.name = name;\n return this;\n }\n end(endTime) {\n if (this._isSpanEnded()) {\n diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);\n return;\n }\n this.endTime = this._getTime(endTime);\n this._duration = hrTimeDuration(this.startTime, this.endTime);\n if (this._duration[0] < 0) {\n diag.warn('Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.', this.startTime, this.endTime);\n this.endTime = this.startTime.slice();\n this._duration = [0, 0];\n }\n if (this._droppedEventsCount > 0) {\n diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`);\n }\n if (this._droppedLinksCount > 0) {\n diag.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`);\n }\n if (this._spanProcessor.onEnding) {\n this._spanProcessor.onEnding(this);\n }\n this._recordEndMetrics?.();\n this._ended = true;\n this._spanProcessor.onEnd(this);\n }\n _getTime(inp) {\n if (typeof inp === 'number' && inp <= otperformance.now()) {\n // must be a performance timestamp\n // apply correction and convert to hrtime\n return hrTime(inp + this._performanceOffset);\n }\n if (typeof inp === 'number') {\n return millisToHrTime(inp);\n }\n if (inp instanceof Date) {\n return millisToHrTime(inp.getTime());\n }\n if (isTimeInputHrTime(inp)) {\n return inp;\n }\n if (this._startTimeProvided) {\n // if user provided a time for the start manually\n // we can't use duration to calculate event/end times\n return millisToHrTime(Date.now());\n }\n const msDuration = otperformance.now() - this._performanceStartTime;\n return addHrTimes(this.startTime, millisToHrTime(msDuration));\n }\n isRecording() {\n return this._ended === false;\n }\n recordException(exception, time) {\n const attributes = {};\n if (typeof exception === 'string') {\n attributes[ATTR_EXCEPTION_MESSAGE] = exception;\n }\n else if (exception) {\n if (exception.code) {\n attributes[ATTR_EXCEPTION_TYPE] = exception.code.toString();\n }\n else if (exception.name) {\n attributes[ATTR_EXCEPTION_TYPE] = exception.name;\n }\n if (exception.message) {\n attributes[ATTR_EXCEPTION_MESSAGE] = exception.message;\n }\n if (exception.stack) {\n attributes[ATTR_EXCEPTION_STACKTRACE] = exception.stack;\n }\n }\n // these are minimum requirements from spec\n if (attributes[ATTR_EXCEPTION_TYPE] || attributes[ATTR_EXCEPTION_MESSAGE]) {\n this.addEvent(ExceptionEventName, attributes, time);\n }\n else {\n diag.warn(`Failed to record an exception ${exception}`);\n }\n }\n get duration() {\n return this._duration;\n }\n get ended() {\n return this._ended;\n }\n get droppedAttributesCount() {\n return this._droppedAttributesCount;\n }\n get droppedEventsCount() {\n return this._droppedEventsCount;\n }\n get droppedLinksCount() {\n return this._droppedLinksCount;\n }\n _isSpanEnded() {\n if (this._ended) {\n const error = new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);\n diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`, error);\n }\n return this._ended;\n }\n // Utility function to truncate given value within size\n // for value type of string, will truncate to given limit\n // for type of non-string, will return same value\n _truncateToLimitUtil(value, limit) {\n if (value.length <= limit) {\n return value;\n }\n return value.substring(0, limit);\n }\n /**\n * If the given attribute value is of type string and has more characters than given {@code attributeValueLengthLimit} then\n * return string with truncated to {@code attributeValueLengthLimit} characters\n *\n * If the given attribute value is array of strings then\n * return new array of strings with each element truncated to {@code attributeValueLengthLimit} characters\n *\n * Otherwise return same Attribute {@code value}\n *\n * @param value Attribute value\n * @returns truncated attribute value if required, otherwise same value\n */\n _truncateToSize(value) {\n const limit = this._attributeValueLengthLimit;\n // Check limit\n if (limit <= 0) {\n // Negative values are invalid, so do not truncate\n diag.warn(`Attribute value limit must be positive, got ${limit}`);\n return value;\n }\n // String\n if (typeof value === 'string') {\n return this._truncateToLimitUtil(value, limit);\n }\n // Array of strings\n if (Array.isArray(value)) {\n return value.map(val => typeof val === 'string' ? this._truncateToLimitUtil(val, limit) : val);\n }\n // Other types, no need to apply value length limit\n return value;\n }\n}\n//# sourceMappingURL=Span.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/**\n * A sampling decision that determines how a {@link Span} will be recorded\n * and collected.\n */\nexport var SamplingDecision;\n(function (SamplingDecision) {\n /**\n * `Span.isRecording() === false`, span will not be recorded and all events\n * and attributes will be dropped.\n */\n SamplingDecision[SamplingDecision[\"NOT_RECORD\"] = 0] = \"NOT_RECORD\";\n /**\n * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags}\n * MUST NOT be set.\n */\n SamplingDecision[SamplingDecision[\"RECORD\"] = 1] = \"RECORD\";\n /**\n * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags}\n * MUST be set.\n */\n SamplingDecision[SamplingDecision[\"RECORD_AND_SAMPLED\"] = 2] = \"RECORD_AND_SAMPLED\";\n})(SamplingDecision || (SamplingDecision = {}));\n//# sourceMappingURL=Sampler.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { SamplingDecision } from '../Sampler';\n/** Sampler that samples no traces. */\nexport class AlwaysOffSampler {\n shouldSample() {\n return {\n decision: SamplingDecision.NOT_RECORD,\n };\n }\n toString() {\n return 'AlwaysOffSampler';\n }\n}\n//# sourceMappingURL=AlwaysOffSampler.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { SamplingDecision } from '../Sampler';\n/** Sampler that samples all traces. */\nexport class AlwaysOnSampler {\n shouldSample() {\n return {\n decision: SamplingDecision.RECORD_AND_SAMPLED,\n };\n }\n toString() {\n return 'AlwaysOnSampler';\n }\n}\n//# sourceMappingURL=AlwaysOnSampler.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { isSpanContextValid, TraceFlags, trace } from '@opentelemetry/api';\nimport { globalErrorHandler } from '@opentelemetry/core';\nimport { AlwaysOffSampler } from './AlwaysOffSampler';\nimport { AlwaysOnSampler } from './AlwaysOnSampler';\n/**\n * A composite sampler that either respects the parent span's sampling decision\n * or delegates to `delegateSampler` for root spans.\n */\nexport class ParentBasedSampler {\n _root;\n _remoteParentSampled;\n _remoteParentNotSampled;\n _localParentSampled;\n _localParentNotSampled;\n constructor(config) {\n this._root = config.root;\n if (!this._root) {\n globalErrorHandler(new Error('ParentBasedSampler must have a root sampler configured'));\n this._root = new AlwaysOnSampler();\n }\n this._remoteParentSampled =\n config.remoteParentSampled ?? new AlwaysOnSampler();\n this._remoteParentNotSampled =\n config.remoteParentNotSampled ?? new AlwaysOffSampler();\n this._localParentSampled =\n config.localParentSampled ?? new AlwaysOnSampler();\n this._localParentNotSampled =\n config.localParentNotSampled ?? new AlwaysOffSampler();\n }\n shouldSample(context, traceId, spanName, spanKind, attributes, links) {\n const parentContext = trace.getSpanContext(context);\n if (!parentContext || !isSpanContextValid(parentContext)) {\n return this._root.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n if (parentContext.isRemote) {\n if (parentContext.traceFlags & TraceFlags.SAMPLED) {\n return this._remoteParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n return this._remoteParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n if (parentContext.traceFlags & TraceFlags.SAMPLED) {\n return this._localParentSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n return this._localParentNotSampled.shouldSample(context, traceId, spanName, spanKind, attributes, links);\n }\n toString() {\n return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`;\n }\n}\n//# sourceMappingURL=ParentBasedSampler.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { isValidTraceId } from '@opentelemetry/api';\nimport { SamplingDecision } from '../Sampler';\n/** Sampler that samples a given fraction of traces based of trace id deterministically. */\nexport class TraceIdRatioBasedSampler {\n _ratio;\n _upperBound;\n constructor(ratio = 0) {\n this._ratio = this._normalize(ratio);\n this._upperBound = Math.floor(this._ratio * 0xffffffff);\n }\n shouldSample(context, traceId) {\n return {\n decision: isValidTraceId(traceId) && this._accumulate(traceId) < this._upperBound\n ? SamplingDecision.RECORD_AND_SAMPLED\n : SamplingDecision.NOT_RECORD,\n };\n }\n toString() {\n return `TraceIdRatioBased{${this._ratio}}`;\n }\n _normalize(ratio) {\n if (typeof ratio !== 'number' || isNaN(ratio))\n return 0;\n return ratio >= 1 ? 1 : ratio <= 0 ? 0 : ratio;\n }\n _accumulate(traceId) {\n let accumulation = 0;\n for (let i = 0; i < 32; i += 8) {\n let part = 0;\n for (let j = 0; j < 8; j++) {\n const c = traceId.charCodeAt(i + j);\n // Convert hex char code to value: '0'-'9' -> 0-9, 'a'-'f' -> 10-15, 'A'-'F' -> 10-15\n const v = c < 58 ? c - 48 : c < 71 ? c - 55 : c - 87;\n part = (part << 4) | v;\n }\n accumulation = (accumulation ^ part) >>> 0;\n }\n return accumulation;\n }\n}\n//# sourceMappingURL=TraceIdRatioBasedSampler.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { diag } from '@opentelemetry/api';\nimport { getNumberFromEnv, getStringFromEnv } from '@opentelemetry/core';\nimport { AlwaysOffSampler } from './sampler/AlwaysOffSampler';\nimport { AlwaysOnSampler } from './sampler/AlwaysOnSampler';\nimport { ParentBasedSampler } from './sampler/ParentBasedSampler';\nimport { TraceIdRatioBasedSampler } from './sampler/TraceIdRatioBasedSampler';\nvar TracesSamplerValues;\n(function (TracesSamplerValues) {\n TracesSamplerValues[\"AlwaysOff\"] = \"always_off\";\n TracesSamplerValues[\"AlwaysOn\"] = \"always_on\";\n TracesSamplerValues[\"ParentBasedAlwaysOff\"] = \"parentbased_always_off\";\n TracesSamplerValues[\"ParentBasedAlwaysOn\"] = \"parentbased_always_on\";\n TracesSamplerValues[\"ParentBasedTraceIdRatio\"] = \"parentbased_traceidratio\";\n TracesSamplerValues[\"TraceIdRatio\"] = \"traceidratio\";\n})(TracesSamplerValues || (TracesSamplerValues = {}));\nconst DEFAULT_RATIO = 1;\n/**\n * Load default configuration. For fields with primitive values, any user-provided\n * value will override the corresponding default value. For fields with\n * non-primitive values (like `spanLimits`), the user-provided value will be\n * used to extend the default value.\n */\n// object needs to be wrapped in this function and called when needed otherwise\n// envs are parsed before tests are ran - causes tests using these envs to fail\nexport function loadDefaultConfig() {\n return {\n sampler: buildSamplerFromEnv(),\n forceFlushTimeoutMillis: 30000,\n generalLimits: {\n attributeValueLengthLimit: getNumberFromEnv('OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT') ?? Infinity,\n attributeCountLimit: getNumberFromEnv('OTEL_ATTRIBUTE_COUNT_LIMIT') ?? 128,\n },\n spanLimits: {\n attributeValueLengthLimit: getNumberFromEnv('OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT') ?? Infinity,\n attributeCountLimit: getNumberFromEnv('OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT') ?? 128,\n linkCountLimit: getNumberFromEnv('OTEL_SPAN_LINK_COUNT_LIMIT') ?? 128,\n eventCountLimit: getNumberFromEnv('OTEL_SPAN_EVENT_COUNT_LIMIT') ?? 128,\n attributePerEventCountLimit: getNumberFromEnv('OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT') ?? 128,\n attributePerLinkCountLimit: getNumberFromEnv('OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT') ?? 128,\n },\n };\n}\n/**\n * Based on environment, builds a sampler, complies with specification.\n */\nexport function buildSamplerFromEnv() {\n const sampler = getStringFromEnv('OTEL_TRACES_SAMPLER') ??\n TracesSamplerValues.ParentBasedAlwaysOn;\n switch (sampler) {\n case TracesSamplerValues.AlwaysOn:\n return new AlwaysOnSampler();\n case TracesSamplerValues.AlwaysOff:\n return new AlwaysOffSampler();\n case TracesSamplerValues.ParentBasedAlwaysOn:\n return new ParentBasedSampler({\n root: new AlwaysOnSampler(),\n });\n case TracesSamplerValues.ParentBasedAlwaysOff:\n return new ParentBasedSampler({\n root: new AlwaysOffSampler(),\n });\n case TracesSamplerValues.TraceIdRatio:\n return new TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv());\n case TracesSamplerValues.ParentBasedTraceIdRatio:\n return new ParentBasedSampler({\n root: new TraceIdRatioBasedSampler(getSamplerProbabilityFromEnv()),\n });\n default:\n diag.error(`OTEL_TRACES_SAMPLER value \"${sampler}\" invalid, defaulting to \"${TracesSamplerValues.ParentBasedAlwaysOn}\".`);\n return new ParentBasedSampler({\n root: new AlwaysOnSampler(),\n });\n }\n}\nfunction getSamplerProbabilityFromEnv() {\n const probability = getNumberFromEnv('OTEL_TRACES_SAMPLER_ARG');\n if (probability == null) {\n diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${DEFAULT_RATIO}.`);\n return DEFAULT_RATIO;\n }\n if (probability < 0 || probability > 1) {\n diag.error(`OTEL_TRACES_SAMPLER_ARG=${probability} was given, but it is out of range ([0..1]), defaulting to ${DEFAULT_RATIO}.`);\n return DEFAULT_RATIO;\n }\n return probability;\n}\n//# sourceMappingURL=config.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { buildSamplerFromEnv, loadDefaultConfig } from './config';\nimport { getNumberFromEnv } from '@opentelemetry/core';\nexport const DEFAULT_ATTRIBUTE_COUNT_LIMIT = 128;\nexport const DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT = Infinity;\n/**\n * Function to merge Default configuration (as specified in './config') with\n * user provided configurations.\n */\nexport function mergeConfig(userConfig) {\n const perInstanceDefaults = {\n sampler: buildSamplerFromEnv(),\n };\n const DEFAULT_CONFIG = loadDefaultConfig();\n const target = Object.assign({}, DEFAULT_CONFIG, perInstanceDefaults, userConfig);\n target.generalLimits = Object.assign({}, DEFAULT_CONFIG.generalLimits, userConfig.generalLimits || {});\n target.spanLimits = Object.assign({}, DEFAULT_CONFIG.spanLimits, userConfig.spanLimits || {});\n return target;\n}\n/**\n * When general limits are provided and model specific limits are not,\n * configures the model specific limits by using the values from the general ones.\n * @param userConfig User provided tracer configuration\n */\nexport function reconfigureLimits(userConfig) {\n const spanLimits = Object.assign({}, userConfig.spanLimits);\n /**\n * Reassign span attribute count limit to use first non null value defined by user or use default value\n */\n spanLimits.attributeCountLimit =\n userConfig.spanLimits?.attributeCountLimit ??\n userConfig.generalLimits?.attributeCountLimit ??\n getNumberFromEnv('OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT') ??\n getNumberFromEnv('OTEL_ATTRIBUTE_COUNT_LIMIT') ??\n DEFAULT_ATTRIBUTE_COUNT_LIMIT;\n /**\n * Reassign span attribute value length limit to use first non null value defined by user or use default value\n */\n spanLimits.attributeValueLengthLimit =\n userConfig.spanLimits?.attributeValueLengthLimit ??\n userConfig.generalLimits?.attributeValueLengthLimit ??\n getNumberFromEnv('OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT') ??\n getNumberFromEnv('OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT') ??\n DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT;\n return Object.assign({}, userConfig, { spanLimits });\n}\n//# sourceMappingURL=utility.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { context, diag, TraceFlags } from '@opentelemetry/api';\nimport { BindOnceFuture, ExportResultCode, getNumberFromEnv, globalErrorHandler, suppressTracing, } from '@opentelemetry/core';\n/**\n * Implementation of the {@link SpanProcessor} that batches spans exported by\n * the SDK then pushes them to the exporter pipeline.\n */\nexport class BatchSpanProcessorBase {\n _maxExportBatchSize;\n _maxQueueSize;\n _scheduledDelayMillis;\n _exportTimeoutMillis;\n _exporter;\n _isExporting = false;\n _finishedSpans = [];\n _timer;\n _shutdownOnce;\n _droppedSpansCount = 0;\n constructor(exporter, config) {\n this._exporter = exporter;\n this._maxExportBatchSize =\n typeof config?.maxExportBatchSize === 'number'\n ? config.maxExportBatchSize\n : (getNumberFromEnv('OTEL_BSP_MAX_EXPORT_BATCH_SIZE') ?? 512);\n this._maxQueueSize =\n typeof config?.maxQueueSize === 'number'\n ? config.maxQueueSize\n : (getNumberFromEnv('OTEL_BSP_MAX_QUEUE_SIZE') ?? 2048);\n this._scheduledDelayMillis =\n typeof config?.scheduledDelayMillis === 'number'\n ? config.scheduledDelayMillis\n : (getNumberFromEnv('OTEL_BSP_SCHEDULE_DELAY') ?? 5000);\n this._exportTimeoutMillis =\n typeof config?.exportTimeoutMillis === 'number'\n ? config.exportTimeoutMillis\n : (getNumberFromEnv('OTEL_BSP_EXPORT_TIMEOUT') ?? 30000);\n this._shutdownOnce = new BindOnceFuture(this._shutdown, this);\n if (this._maxExportBatchSize > this._maxQueueSize) {\n diag.warn('BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize');\n this._maxExportBatchSize = this._maxQueueSize;\n }\n }\n forceFlush() {\n if (this._shutdownOnce.isCalled) {\n return this._shutdownOnce.promise;\n }\n return this._flushAll();\n }\n // does nothing.\n onStart(_span, _parentContext) { }\n onEnd(span) {\n if (this._shutdownOnce.isCalled) {\n return;\n }\n if ((span.spanContext().traceFlags & TraceFlags.SAMPLED) === 0) {\n return;\n }\n this._addToBuffer(span);\n }\n shutdown() {\n return this._shutdownOnce.call();\n }\n _shutdown() {\n return Promise.resolve()\n .then(() => {\n return this.onShutdown();\n })\n .then(() => {\n return this._flushAll();\n })\n .then(() => {\n return this._exporter.shutdown();\n });\n }\n /** Add a span in the buffer. */\n _addToBuffer(span) {\n if (this._finishedSpans.length >= this._maxQueueSize) {\n // limit reached, drop span\n if (this._droppedSpansCount === 0) {\n diag.debug('maxQueueSize reached, dropping spans');\n }\n this._droppedSpansCount++;\n return;\n }\n if (this._droppedSpansCount > 0) {\n // some spans were dropped, log once with count of spans dropped\n diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`);\n this._droppedSpansCount = 0;\n }\n this._finishedSpans.push(span);\n this._maybeStartTimer();\n }\n /**\n * Send all spans to the exporter respecting the batch size limit\n * This function is used only on forceFlush or shutdown,\n * for all other cases _flush should be used\n * */\n _flushAll() {\n return new Promise((resolve, reject) => {\n const promises = [];\n // calculate number of batches\n const count = Math.ceil(this._finishedSpans.length / this._maxExportBatchSize);\n for (let i = 0, j = count; i < j; i++) {\n promises.push(this._flushOneBatch());\n }\n Promise.all(promises)\n .then(() => {\n resolve();\n })\n .catch(reject);\n });\n }\n _flushOneBatch() {\n this._clearTimer();\n if (this._finishedSpans.length === 0) {\n return Promise.resolve();\n }\n return new Promise((resolve, reject) => {\n const timer = setTimeout(() => {\n // don't wait anymore for export, this way the next batch can start\n reject(new Error('Timeout'));\n }, this._exportTimeoutMillis);\n // prevent downstream exporter calls from generating spans\n context.with(suppressTracing(context.active()), () => {\n // Reset the finished spans buffer here because the next invocations of the _flush method\n // could pass the same finished spans to the exporter if the buffer is cleared\n // outside the execution of this callback.\n let spans;\n if (this._finishedSpans.length <= this._maxExportBatchSize) {\n spans = this._finishedSpans;\n this._finishedSpans = [];\n }\n else {\n spans = this._finishedSpans.splice(0, this._maxExportBatchSize);\n }\n const doExport = () => this._exporter.export(spans, result => {\n clearTimeout(timer);\n if (result.code === ExportResultCode.SUCCESS) {\n resolve();\n }\n else {\n reject(result.error ??\n new Error('BatchSpanProcessor: span export failed'));\n }\n });\n let pendingResources = null;\n for (let i = 0, len = spans.length; i < len; i++) {\n const span = spans[i];\n if (span.resource.asyncAttributesPending &&\n span.resource.waitForAsyncAttributes) {\n pendingResources ??= [];\n pendingResources.push(span.resource.waitForAsyncAttributes());\n }\n }\n // Avoid scheduling a promise to make the behavior more predictable and easier to test\n if (pendingResources === null) {\n doExport();\n }\n else {\n Promise.all(pendingResources).then(doExport, err => {\n globalErrorHandler(err);\n reject(err);\n });\n }\n });\n });\n }\n _maybeStartTimer() {\n if (this._isExporting)\n return;\n const flush = () => {\n this._isExporting = true;\n this._flushOneBatch()\n .finally(() => {\n this._isExporting = false;\n if (this._finishedSpans.length > 0) {\n this._clearTimer();\n this._maybeStartTimer();\n }\n })\n .catch(e => {\n this._isExporting = false;\n globalErrorHandler(e);\n });\n };\n // we only wait if the queue doesn't have enough elements yet\n if (this._finishedSpans.length >= this._maxExportBatchSize) {\n return flush();\n }\n if (this._timer !== undefined)\n return;\n this._timer = setTimeout(() => flush(), this._scheduledDelayMillis);\n // depending on runtime, this may be a 'number' or NodeJS.Timeout\n if (typeof this._timer !== 'number') {\n this._timer.unref();\n }\n }\n _clearTimer() {\n if (this._timer !== undefined) {\n clearTimeout(this._timer);\n this._timer = undefined;\n }\n }\n}\n//# sourceMappingURL=BatchSpanProcessorBase.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { BatchSpanProcessorBase } from '../../../export/BatchSpanProcessorBase';\nimport { globalErrorHandler } from '@opentelemetry/core';\nexport class BatchSpanProcessor extends BatchSpanProcessorBase {\n _visibilityChangeListener;\n _pageHideListener;\n constructor(_exporter, config) {\n super(_exporter, config);\n this.onInit(config);\n }\n onInit(config) {\n if (config?.disableAutoFlushOnDocumentHide !== true &&\n typeof document !== 'undefined') {\n this._visibilityChangeListener = () => {\n if (document.visibilityState === 'hidden') {\n this.forceFlush().catch(error => {\n globalErrorHandler(error);\n });\n }\n };\n this._pageHideListener = () => {\n this.forceFlush().catch(error => {\n globalErrorHandler(error);\n });\n };\n document.addEventListener('visibilitychange', this._visibilityChangeListener);\n // use 'pagehide' event as a fallback for Safari; see https://bugs.webkit.org/show_bug.cgi?id=116769\n document.addEventListener('pagehide', this._pageHideListener);\n }\n }\n onShutdown() {\n if (typeof document !== 'undefined') {\n if (this._visibilityChangeListener) {\n document.removeEventListener('visibilitychange', this._visibilityChangeListener);\n }\n if (this._pageHideListener) {\n document.removeEventListener('pagehide', this._pageHideListener);\n }\n }\n }\n}\n//# sourceMappingURL=BatchSpanProcessor.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nconst TRACE_ID_BYTES = 16;\nconst SPAN_ID_BYTES = 8;\nconst TRACE_BUFFER = new Uint8Array(TRACE_ID_BYTES);\nconst SPAN_BUFFER = new Uint8Array(SPAN_ID_BYTES);\n// Byte-to-hex lookup is faster than toString(16) in browsers\nconst HEX = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\n/**\n * Fills buffer with random bytes, ensuring at least one is non-zero\n * per W3C Trace Context spec.\n */\nfunction randomFill(buf) {\n for (let i = 0; i < buf.length; i++) {\n buf[i] = (Math.random() * 256) >>> 0;\n }\n // Ensure non-zero\n for (let i = 0; i < buf.length; i++) {\n if (buf[i] > 0)\n return;\n }\n buf[buf.length - 1] = 1;\n}\nfunction toHex(buf) {\n let hex = '';\n for (let i = 0; i < buf.length; i++) {\n hex += HEX[buf[i]];\n }\n return hex;\n}\nexport class RandomIdGenerator {\n /**\n * Returns a random 16-byte trace ID formatted/encoded as a 32 lowercase hex\n * characters corresponding to 128 bits.\n */\n generateTraceId() {\n randomFill(TRACE_BUFFER);\n return toHex(TRACE_BUFFER);\n }\n /**\n * Returns a random 8-byte span ID formatted/encoded as a 16 lowercase hex\n * characters corresponding to 64 bits.\n */\n generateSpanId() {\n randomFill(SPAN_BUFFER);\n return toHex(SPAN_BUFFER);\n }\n}\n//# sourceMappingURL=RandomIdGenerator.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n/*\n * This file contains a copy of unstable semantic convention definitions\n * used by this package.\n * @see https://github.com/open-telemetry/opentelemetry-js/tree/main/semantic-conventions#unstable-semconv\n */\n/**\n * Determines whether the span has a parent span, and if so, [whether it is a remote parent](https://opentelemetry.io/docs/specs/otel/trace/api/#isremote)\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OTEL_SPAN_PARENT_ORIGIN = 'otel.span.parent.origin';\n/**\n * The result value of the sampler for this span\n *\n * @experimental This attribute is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const ATTR_OTEL_SPAN_SAMPLING_RESULT = 'otel.span.sampling_result';\n/**\n * The number of created spans with `recording=true` for which the end operation has not been called yet.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_OTEL_SDK_SPAN_LIVE = 'otel.sdk.span.live';\n/**\n * The number of created spans.\n *\n * @note Implementations **MUST** record this metric for all spans, even for non-recording ones.\n *\n * @experimental This metric is experimental and is subject to breaking changes in minor releases of `@opentelemetry/semantic-conventions`.\n */\nexport const METRIC_OTEL_SDK_SPAN_STARTED = 'otel.sdk.span.started';\n//# sourceMappingURL=semconv.js.map","import { SamplingDecision } from './Sampler';\nimport { ATTR_OTEL_SPAN_PARENT_ORIGIN, ATTR_OTEL_SPAN_SAMPLING_RESULT, METRIC_OTEL_SDK_SPAN_LIVE, METRIC_OTEL_SDK_SPAN_STARTED, } from './semconv';\n/**\n * Generates `otel.sdk.span.*` metrics.\n * https://opentelemetry.io/docs/specs/semconv/otel/sdk-metrics/#span-metrics\n */\nexport class TracerMetrics {\n startedSpans;\n liveSpans;\n constructor(meter) {\n this.startedSpans = meter.createCounter(METRIC_OTEL_SDK_SPAN_STARTED, {\n unit: '{span}',\n description: 'The number of created spans.',\n });\n this.liveSpans = meter.createUpDownCounter(METRIC_OTEL_SDK_SPAN_LIVE, {\n unit: '{span}',\n description: 'The number of currently live spans.',\n });\n }\n startSpan(parentSpanCtx, samplingDecision) {\n const samplingDecisionStr = samplingDecisionToString(samplingDecision);\n this.startedSpans.add(1, {\n [ATTR_OTEL_SPAN_PARENT_ORIGIN]: parentOrigin(parentSpanCtx),\n [ATTR_OTEL_SPAN_SAMPLING_RESULT]: samplingDecisionStr,\n });\n if (samplingDecision === SamplingDecision.NOT_RECORD) {\n return () => { };\n }\n const liveSpanAttributes = {\n [ATTR_OTEL_SPAN_SAMPLING_RESULT]: samplingDecisionStr,\n };\n this.liveSpans.add(1, liveSpanAttributes);\n return () => {\n this.liveSpans.add(-1, liveSpanAttributes);\n };\n }\n}\nfunction parentOrigin(parentSpanContext) {\n if (!parentSpanContext) {\n return 'none';\n }\n if (parentSpanContext.isRemote) {\n return 'remote';\n }\n return 'local';\n}\nfunction samplingDecisionToString(decision) {\n switch (decision) {\n case SamplingDecision.RECORD_AND_SAMPLED:\n return 'RECORD_AND_SAMPLE';\n case SamplingDecision.RECORD:\n return 'RECORD_ONLY';\n case SamplingDecision.NOT_RECORD:\n return 'DROP';\n }\n}\n//# sourceMappingURL=TracerMetrics.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n// this is autogenerated file, see scripts/version-update.js\nexport const VERSION = '2.7.1';\n//# sourceMappingURL=version.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport * as api from '@opentelemetry/api';\nimport { sanitizeAttributes, isTracingSuppressed } from '@opentelemetry/core';\nimport { SpanImpl } from './Span';\nimport { mergeConfig } from './utility';\nimport { RandomIdGenerator } from './platform';\nimport { TracerMetrics } from './TracerMetrics';\nimport { VERSION } from './version';\n/**\n * This class represents a basic tracer.\n */\nexport class Tracer {\n _sampler;\n _generalLimits;\n _spanLimits;\n _idGenerator;\n instrumentationScope;\n _resource;\n _spanProcessor;\n _tracerMetrics;\n /**\n * Constructs a new Tracer instance.\n */\n constructor(instrumentationScope, config, resource, spanProcessor) {\n const localConfig = mergeConfig(config);\n this._sampler = localConfig.sampler;\n this._generalLimits = localConfig.generalLimits;\n this._spanLimits = localConfig.spanLimits;\n this._idGenerator = config.idGenerator || new RandomIdGenerator();\n this._resource = resource;\n this._spanProcessor = spanProcessor;\n this.instrumentationScope = instrumentationScope;\n const meter = localConfig.meterProvider\n ? localConfig.meterProvider.getMeter('@opentelemetry/sdk-trace', VERSION)\n : api.createNoopMeter();\n this._tracerMetrics = new TracerMetrics(meter);\n }\n /**\n * Starts a new Span or returns the default NoopSpan based on the sampling\n * decision.\n */\n startSpan(name, options = {}, context = api.context.active()) {\n // remove span from context in case a root span is requested via options\n if (options.root) {\n context = api.trace.deleteSpan(context);\n }\n const parentSpan = api.trace.getSpan(context);\n if (isTracingSuppressed(context)) {\n api.diag.debug('Instrumentation suppressed, returning Noop Span');\n const nonRecordingSpan = api.trace.wrapSpanContext(api.INVALID_SPAN_CONTEXT);\n return nonRecordingSpan;\n }\n const parentSpanContext = parentSpan?.spanContext();\n const spanId = this._idGenerator.generateSpanId();\n let validParentSpanContext;\n let traceId;\n let traceState;\n if (!parentSpanContext ||\n !api.trace.isSpanContextValid(parentSpanContext)) {\n // New root span.\n traceId = this._idGenerator.generateTraceId();\n }\n else {\n // New child span.\n traceId = parentSpanContext.traceId;\n traceState = parentSpanContext.traceState;\n validParentSpanContext = parentSpanContext;\n }\n const spanKind = options.kind ?? api.SpanKind.INTERNAL;\n const links = (options.links ?? []).map(link => {\n return {\n context: link.context,\n attributes: sanitizeAttributes(link.attributes),\n };\n });\n const attributes = sanitizeAttributes(options.attributes);\n // make sampling decision\n const samplingResult = this._sampler.shouldSample(context, traceId, name, spanKind, attributes, links);\n const recordEndMetrics = this._tracerMetrics.startSpan(parentSpanContext, samplingResult.decision);\n traceState = samplingResult.traceState ?? traceState;\n const traceFlags = samplingResult.decision === api.SamplingDecision.RECORD_AND_SAMPLED\n ? api.TraceFlags.SAMPLED\n : api.TraceFlags.NONE;\n const spanContext = { traceId, spanId, traceFlags, traceState };\n if (samplingResult.decision === api.SamplingDecision.NOT_RECORD) {\n api.diag.debug('Recording is off, propagating context in a non-recording span');\n const nonRecordingSpan = api.trace.wrapSpanContext(spanContext);\n return nonRecordingSpan;\n }\n // Set initial span attributes. The attributes object may have been mutated\n // by the sampler, so we sanitize the merged attributes before setting them.\n const initAttributes = sanitizeAttributes(Object.assign(attributes, samplingResult.attributes));\n const span = new SpanImpl({\n resource: this._resource,\n scope: this.instrumentationScope,\n context,\n spanContext,\n name,\n kind: spanKind,\n links,\n parentSpanContext: validParentSpanContext,\n attributes: initAttributes,\n startTime: options.startTime,\n spanProcessor: this._spanProcessor,\n spanLimits: this._spanLimits,\n recordEndMetrics,\n });\n return span;\n }\n startActiveSpan(name, arg2, arg3, arg4) {\n let opts;\n let ctx;\n let fn;\n if (arguments.length < 2) {\n return;\n }\n else if (arguments.length === 2) {\n fn = arg2;\n }\n else if (arguments.length === 3) {\n opts = arg2;\n fn = arg3;\n }\n else {\n opts = arg2;\n ctx = arg3;\n fn = arg4;\n }\n const parentContext = ctx ?? api.context.active();\n const span = this.startSpan(name, opts, parentContext);\n const contextWithSpanSet = api.trace.setSpan(parentContext, span);\n return api.context.with(contextWithSpanSet, fn, undefined, span);\n }\n /** Returns the active {@link GeneralLimits}. */\n getGeneralLimits() {\n return this._generalLimits;\n }\n /** Returns the active {@link SpanLimits}. */\n getSpanLimits() {\n return this._spanLimits;\n }\n}\n//# sourceMappingURL=Tracer.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { globalErrorHandler } from '@opentelemetry/core';\n/**\n * Implementation of the {@link SpanProcessor} that simply forwards all\n * received events to a list of {@link SpanProcessor}s.\n */\nexport class MultiSpanProcessor {\n _spanProcessors;\n constructor(spanProcessors) {\n this._spanProcessors = spanProcessors;\n }\n forceFlush() {\n const promises = [];\n for (const spanProcessor of this._spanProcessors) {\n promises.push(spanProcessor.forceFlush());\n }\n return new Promise(resolve => {\n Promise.all(promises)\n .then(() => {\n resolve();\n })\n .catch(error => {\n globalErrorHandler(error || new Error('MultiSpanProcessor: forceFlush failed'));\n resolve();\n });\n });\n }\n onStart(span, context) {\n for (const spanProcessor of this._spanProcessors) {\n spanProcessor.onStart(span, context);\n }\n }\n onEnding(span) {\n for (const spanProcessor of this._spanProcessors) {\n if (spanProcessor.onEnding) {\n spanProcessor.onEnding(span);\n }\n }\n }\n onEnd(span) {\n for (const spanProcessor of this._spanProcessors) {\n spanProcessor.onEnd(span);\n }\n }\n shutdown() {\n const promises = [];\n for (const spanProcessor of this._spanProcessors) {\n promises.push(spanProcessor.shutdown());\n }\n return new Promise((resolve, reject) => {\n Promise.all(promises).then(() => {\n resolve();\n }, reject);\n });\n }\n}\n//# sourceMappingURL=MultiSpanProcessor.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { merge } from '@opentelemetry/core';\nimport { defaultResource } from '@opentelemetry/resources';\nimport { Tracer } from './Tracer';\nimport { loadDefaultConfig } from './config';\nimport { MultiSpanProcessor } from './MultiSpanProcessor';\nimport { reconfigureLimits } from './utility';\nexport var ForceFlushState;\n(function (ForceFlushState) {\n ForceFlushState[ForceFlushState[\"resolved\"] = 0] = \"resolved\";\n ForceFlushState[ForceFlushState[\"timeout\"] = 1] = \"timeout\";\n ForceFlushState[ForceFlushState[\"error\"] = 2] = \"error\";\n ForceFlushState[ForceFlushState[\"unresolved\"] = 3] = \"unresolved\";\n})(ForceFlushState || (ForceFlushState = {}));\n/**\n * This class represents a basic tracer provider which platform libraries can extend\n */\nexport class BasicTracerProvider {\n _config;\n _tracers = new Map();\n _resource;\n _activeSpanProcessor;\n constructor(config = {}) {\n const mergedConfig = merge({}, loadDefaultConfig(), reconfigureLimits(config));\n this._resource = mergedConfig.resource ?? defaultResource();\n this._config = Object.assign({}, mergedConfig, {\n resource: this._resource,\n });\n const spanProcessors = [];\n if (config.spanProcessors?.length) {\n spanProcessors.push(...config.spanProcessors);\n }\n this._activeSpanProcessor = new MultiSpanProcessor(spanProcessors);\n }\n getTracer(name, version, options) {\n const key = `${name}@${version || ''}:${options?.schemaUrl || ''}`;\n if (!this._tracers.has(key)) {\n this._tracers.set(key, new Tracer({ name, version, schemaUrl: options?.schemaUrl }, this._config, this._resource, this._activeSpanProcessor));\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return this._tracers.get(key);\n }\n forceFlush() {\n const timeout = this._config.forceFlushTimeoutMillis;\n const promises = this._activeSpanProcessor['_spanProcessors'].map((spanProcessor) => {\n return new Promise(resolve => {\n let state;\n const timeoutInterval = setTimeout(() => {\n resolve(new Error(`Span processor did not completed within timeout period of ${timeout} ms`));\n state = ForceFlushState.timeout;\n }, timeout);\n spanProcessor\n .forceFlush()\n .then(() => {\n clearTimeout(timeoutInterval);\n if (state !== ForceFlushState.timeout) {\n state = ForceFlushState.resolved;\n resolve(state);\n }\n })\n .catch(error => {\n clearTimeout(timeoutInterval);\n state = ForceFlushState.error;\n resolve(error);\n });\n });\n });\n return new Promise((resolve, reject) => {\n Promise.all(promises)\n .then(results => {\n const errors = results.filter(result => result !== ForceFlushState.resolved);\n if (errors.length > 0) {\n reject(errors);\n }\n else {\n resolve();\n }\n })\n .catch(error => reject([error]));\n });\n }\n shutdown() {\n return this._activeSpanProcessor.shutdown();\n }\n}\n//# sourceMappingURL=BasicTracerProvider.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { TraceFlags } from '@opentelemetry/api';\nimport { internal, ExportResultCode, globalErrorHandler, BindOnceFuture, } from '@opentelemetry/core';\n/**\n * An implementation of the {@link SpanProcessor} that converts the {@link Span}\n * to {@link ReadableSpan} and passes it to the configured exporter.\n *\n * Only spans that are sampled are converted.\n *\n * NOTE: This {@link SpanProcessor} exports every ended span individually instead of batching spans together, which causes significant performance overhead with most exporters. For production use, please consider using the {@link BatchSpanProcessor} instead.\n */\nexport class SimpleSpanProcessor {\n _exporter;\n _shutdownOnce;\n _pendingExports;\n constructor(exporter) {\n this._exporter = exporter;\n this._shutdownOnce = new BindOnceFuture(this._shutdown, this);\n this._pendingExports = new Set();\n }\n async forceFlush() {\n await Promise.all(Array.from(this._pendingExports));\n if (this._exporter.forceFlush) {\n await this._exporter.forceFlush();\n }\n }\n onStart(_span, _parentContext) { }\n onEnd(span) {\n if (this._shutdownOnce.isCalled) {\n return;\n }\n if ((span.spanContext().traceFlags & TraceFlags.SAMPLED) === 0) {\n return;\n }\n const pendingExport = this._doExport(span).catch(err => globalErrorHandler(err));\n // Enqueue this export to the pending list so it can be flushed by the user.\n this._pendingExports.add(pendingExport);\n void pendingExport.finally(() => this._pendingExports.delete(pendingExport));\n }\n async _doExport(span) {\n if (span.resource.asyncAttributesPending) {\n // Ensure resource is fully resolved before exporting.\n await span.resource.waitForAsyncAttributes?.();\n }\n const result = await internal._export(this._exporter, [span]);\n if (result.code !== ExportResultCode.SUCCESS) {\n throw (result.error ??\n new Error(`SimpleSpanProcessor: span export failed (status ${result})`));\n }\n }\n shutdown() {\n return this._shutdownOnce.call();\n }\n _shutdown() {\n return this._exporter.shutdown();\n }\n}\n//# sourceMappingURL=SimpleSpanProcessor.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { ROOT_CONTEXT } from '@opentelemetry/api';\n/**\n * Stack Context Manager for managing the state in web\n * it doesn't fully support the async calls though\n */\nexport class StackContextManager {\n /**\n * whether the context manager is enabled or not\n */\n _enabled = false;\n /**\n * Keeps the reference to current context\n */\n _currentContext = ROOT_CONTEXT;\n /**\n *\n * @param context\n * @param target Function to be executed within the context\n */\n // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type\n _bindFunction(context = ROOT_CONTEXT, target) {\n const manager = this;\n const contextWrapper = function (...args) {\n return manager.with(context, () => target.apply(this, args));\n };\n Object.defineProperty(contextWrapper, 'length', {\n enumerable: false,\n configurable: true,\n writable: false,\n value: target.length,\n });\n return contextWrapper;\n }\n /**\n * Returns the active context\n */\n active() {\n return this._currentContext;\n }\n /**\n * Binds a the certain context or the active one to the target function and then returns the target\n * @param context A context (span) to be bind to target\n * @param target a function or event emitter. When target or one of its callbacks is called,\n * the provided context will be used as the active context for the duration of the call.\n */\n bind(context, target) {\n // if no specific context to propagate is given, we use the current one\n if (context === undefined) {\n context = this.active();\n }\n if (typeof target === 'function') {\n return this._bindFunction(context, target);\n }\n return target;\n }\n /**\n * Disable the context manager (clears the current context)\n */\n disable() {\n this._currentContext = ROOT_CONTEXT;\n this._enabled = false;\n return this;\n }\n /**\n * Enables the context manager and creates a default(root) context\n */\n enable() {\n if (this._enabled) {\n return this;\n }\n this._enabled = true;\n this._currentContext = ROOT_CONTEXT;\n return this;\n }\n /**\n * Calls the callback function [fn] with the provided [context]. If [context] is undefined then it will use the window.\n * The context will be set as active\n * @param context\n * @param fn Callback function\n * @param thisArg optional receiver to be used for calling fn\n * @param args optional arguments forwarded to fn\n */\n with(context, fn, thisArg, ...args) {\n const previousContext = this._currentContext;\n this._currentContext = context || ROOT_CONTEXT;\n try {\n return fn.call(thisArg, ...args);\n }\n finally {\n this._currentContext = previousContext;\n }\n }\n}\n//# sourceMappingURL=StackContextManager.js.map","/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { BasicTracerProvider } from '@opentelemetry/sdk-trace-base';\nimport { StackContextManager } from './StackContextManager';\nimport { trace, context, propagation } from '@opentelemetry/api';\nimport { CompositePropagator, W3CBaggagePropagator, W3CTraceContextPropagator, } from '@opentelemetry/core';\nfunction setupContextManager(contextManager) {\n // null means 'do not register'\n if (contextManager === null) {\n return;\n }\n // undefined means 'register default'\n if (contextManager === undefined) {\n const defaultContextManager = new StackContextManager();\n defaultContextManager.enable();\n context.setGlobalContextManager(defaultContextManager);\n return;\n }\n contextManager.enable();\n context.setGlobalContextManager(contextManager);\n}\nfunction setupPropagator(propagator) {\n // null means 'do not register'\n if (propagator === null) {\n return;\n }\n // undefined means 'register default'\n if (propagator === undefined) {\n propagation.setGlobalPropagator(new CompositePropagator({\n propagators: [\n new W3CTraceContextPropagator(),\n new W3CBaggagePropagator(),\n ],\n }));\n return;\n }\n propagation.setGlobalPropagator(propagator);\n}\n/**\n * This class represents a web tracer with {@link StackContextManager}\n */\nexport class WebTracerProvider extends BasicTracerProvider {\n /**\n * Constructs a new Tracer instance.\n * @param config Web Tracer config\n */\n constructor(config = {}) {\n super(config);\n }\n /**\n * Register this TracerProvider for use with the OpenTelemetry API.\n * Undefined values may be replaced with defaults, and\n * null values will be skipped.\n *\n * @param config Configuration object for SDK registration\n */\n register(config = {}) {\n trace.setGlobalTracerProvider(this);\n setupPropagator(config.propagator);\n setupContextManager(config.contextManager);\n }\n}\n//# sourceMappingURL=WebTracerProvider.js.map","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/**\n * 生成随机 ID。优先用 `crypto.randomUUID`(standards-compliant UUID v4),不可用时回退到\n * `${prefix}-${timestamp}-${rand}` 形式。\n *\n * 注意:fallback 实现使用 Math.random,**不是密码学安全**,仅适用于设备/会话/事件标识等场景,\n * 不要复用此函数生成 token、CSRF 防护等安全相关的值。\n */\nexport const createRandomId = (prefix: string) => {\n if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function') {\n return crypto.randomUUID();\n }\n return `${prefix}-${Date.now()}-${Math.random().toString(16).slice(2)}`;\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport type { BkOTUrlMatcher, ResolvedBkOTConfig } from './config';\n\nconst getBaseUrl = () => (typeof window === 'undefined' ? 'http://localhost' : window.location.origin);\n\nexport const toAbsoluteUrl = (url: string) => {\n try {\n return new URL(url, getBaseUrl()).href;\n } catch {\n return url;\n }\n};\n\nconst DYNAMIC_PATH_SEGMENT = /^(?:\\d+|[0-9a-f]{8}-[0-9a-f-]{27,}|[0-9a-f]{16,})$/i;\n\n/**\n * 常见数字 ID、UUID 和长十六进制段统一折叠为 :id,便于服务端按路由聚合。\n * 同时服务 `view.url_template`(页面路由)与 `url.template`(请求路径)两个维度。\n */\nexport const normalizeUrlPathTemplate = (pathGroup: string) => {\n const path = pathGroup.split(/[?#]/, 1)[0];\n return path\n .split('/')\n .map(segment => (DYNAMIC_PATH_SEGMENT.test(segment) ? ':id' : segment))\n .join('/');\n};\n\n// 去掉 trailing slash,便于 path 边界对齐比较\nconst stripTrailingSlash = (value: string) => (value.length > 1 ? value.replace(/\\/+$/, '') : value);\n\n// 比较两个 URL 是否指向同一资源(忽略 query/fragment 与末尾斜杠)\nconst isSameResource = (left: string, right: string) => {\n const stripped = (value: string) => stripTrailingSlash(value.replace(/[?#].*$/, ''));\n return stripped(left) === stripped(right);\n};\n\nexport const isBkOTEndpoint = (config: ResolvedBkOTConfig, url: string) => {\n const targetUrl = toAbsoluteUrl(url);\n return isSameResource(targetUrl, toAbsoluteUrl(config.transport.endpoint));\n};\n\nexport const shouldIgnoreUrl = (config: ResolvedBkOTConfig, url: string) => isBkOTEndpoint(config, url);\n\nconst matchesUrl = (matcher: BkOTUrlMatcher, url: string) => {\n if (typeof matcher === 'function') return matcher(url);\n if (typeof matcher === 'string') return url.includes(matcher);\n matcher.lastIndex = 0;\n return matcher.test(url);\n};\n\nexport const matchesUrlList = (matchers: BkOTUrlMatcher | BkOTUrlMatcher[] | undefined, url: string) =>\n (Array.isArray(matchers) ? matchers : matchers ? [matchers] : []).some(matcher => matchesUrl(matcher, url));\n\nconst getRequestConfig = (config: ResolvedBkOTConfig) =>\n typeof config.tracking.request === 'object' ? config.tracking.request : undefined;\n\nexport const shouldIgnoreRequest = (config: ResolvedBkOTConfig, url: string) =>\n shouldIgnoreUrl(config, url) || matchesUrlList(getRequestConfig(config)?.excludedUrls, toAbsoluteUrl(url));\n\n// Trace Header 仅向显式白名单注入,避免同源第三方路径被无意注入以及跨域 CORS 预检。\nexport const shouldPropagateTraceHeader = (config: ResolvedBkOTConfig, url: string) =>\n matchesUrlList(getRequestConfig(config)?.allowedTracingUrls, toAbsoluteUrl(url));\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n/**\n * RUM 上报字段 key 集中定义。\n *\n * 插件里不要散落硬编码字符串,后续字段命名调整只改这里,避免采集端与字段文档逐步漂移。\n */\nexport const RUM_ATTRIBUTES = {\n actionFrustrationType: 'action.frustration.type',\n actionId: 'action.id',\n actionTargetName: 'action.target.name',\n actionTargetTag: 'action.target.tag',\n actionType: 'action.type',\n deploymentEnvironmentName: 'deployment.environment.name',\n cacheHit: 'resource.cache.hit',\n deviceType: 'device.type',\n longTaskBlockingDuration: 'long_task.blocking_duration',\n longTaskEntryType: 'long_task.entry_type',\n longTaskId: 'long_task.id',\n networkEffectiveType: 'network.effective_type',\n networkStatus: 'network.status',\n nextHopProtocol: 'resource.protocol',\n outcomeType: 'outcome.type',\n serviceName: 'service.name',\n serviceVersion: 'service.version',\n sessionHasReplay: 'session.has_replay',\n sessionId: 'session.id',\n sessionSampleRate: 'session.sample_rate',\n sessionPhase: 'session.phase',\n sessionType: 'session.type',\n spanType: 'span_type',\n userId: 'user.id',\n userAgentName: 'user_agent.name',\n userAgentOsName: 'user_agent.os.name',\n userAgentVersion: 'user_agent.version',\n vitalMetric: 'vital.metric',\n vitalValue: 'vital.value',\n viewDomComplete: 'view.dom_complete',\n viewDomContentLoaded: 'view.dom_content_loaded',\n viewDomInteractive: 'view.dom_interactive',\n viewFirstByte: 'view.first_byte',\n viewId: 'view.id',\n viewLoadEvent: 'view.load_event',\n viewLoadingTime: 'view.loading_time',\n viewLoadingTimeSource: 'view.loading_time_source',\n viewLoadingType: 'view.loading_type',\n viewName: 'view.name',\n viewPhase: 'view.phase',\n viewPrevious: 'view.previous',\n viewPreviousUrlTemplate: 'view.previous_url_template',\n viewReferrer: 'view.referrer',\n viewStartedAt: 'view.started_at',\n viewUrl: 'view.url',\n viewUrlTemplate: 'view.url_template',\n viewVersion: 'view.version',\n websocketPhase: 'websocket.phase',\n} as const;\n\nexport type RumAttributeKey = (typeof RUM_ATTRIBUTES)[keyof typeof RUM_ATTRIBUTES];\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\nimport { RUM_ATTRIBUTES } from './attributes';\n\nimport type { Attributes } from '@opentelemetry/api';\n\n// 所有插件通过同一分类模型生成检索字段,保证错误、资源、Action 等信号可按统一维度聚合。\nexport const RUM_SPAN_OUTCOME = {\n abort: 'abort',\n error: 'error',\n success: 'success',\n timeout: 'timeout',\n warning: 'warning',\n} as const;\n\nexport const RUM_SPAN_TYPE = {\n action: 'action',\n custom: 'custom',\n error: 'error',\n longTask: 'long_task',\n resource: 'resource',\n session: 'session',\n vital: 'vital',\n view: 'view',\n websocket: 'websocket',\n} as const;\n\nexport type RumRequestOutcome =\n | { error?: unknown; type: 'network_error' }\n | { error?: unknown; type: 'timeout' }\n | { statusCode?: number; type: 'response' }\n | { type: 'abort' };\n\nexport interface RumResourceSpanInput {\n initiatorType?: string;\n method?: string;\n outcome?: RumRequestOutcome;\n url: string;\n}\n\nexport interface RumSpanClassification {\n outcome?: RumSpanOutcome;\n spanType: RumSpanType;\n}\n\nexport type RumSpanOutcome = (typeof RUM_SPAN_OUTCOME)[keyof typeof RUM_SPAN_OUTCOME];\n\nexport type RumSpanType = (typeof RUM_SPAN_TYPE)[keyof typeof RUM_SPAN_TYPE];\n\nexport interface RumUrlTarget {\n serverAddress?: string;\n serverPort?: number;\n}\n\nexport const getHttpOutcome = (statusCode: number | undefined): RumSpanOutcome => {\n if (statusCode === 408 || statusCode === 504) return RUM_SPAN_OUTCOME.timeout;\n if (typeof statusCode === 'number' && statusCode >= 400) return RUM_SPAN_OUTCOME.error;\n return RUM_SPAN_OUTCOME.success;\n};\n\nexport const getVitalOutcome = (rating: string | undefined): RumSpanOutcome =>\n rating === 'good' ? RUM_SPAN_OUTCOME.success : RUM_SPAN_OUTCOME.warning;\n\nexport const getUrlTarget = (url: string | undefined): RumUrlTarget => {\n if (!url) {\n return {};\n }\n try {\n const parsed = new URL(url, typeof location === 'undefined' ? 'http://localhost' : location.href);\n return {\n serverAddress: parsed.hostname,\n serverPort: parsed.port ? Number(parsed.port) : undefined,\n };\n } catch {\n return {};\n }\n};\n\nexport const buildRumSpanAttributes = ({\n outcome = RUM_SPAN_OUTCOME.success,\n spanType,\n}: RumSpanClassification): Attributes => ({\n [RUM_ATTRIBUTES.spanType]: spanType,\n [RUM_ATTRIBUTES.outcomeType]: outcome,\n});\n\nexport const buildRumResourceSpanAttributes = ({\n initiatorType = 'other',\n method,\n outcome,\n url,\n}: RumResourceSpanInput): Attributes => {\n const target = getUrlTarget(url);\n const responseStatus =\n outcome?.type === 'response' && typeof outcome.statusCode === 'number' && outcome.statusCode > 0\n ? outcome.statusCode\n : undefined;\n const outcomeType =\n outcome?.type === 'abort'\n ? RUM_SPAN_OUTCOME.abort\n : outcome?.type === 'timeout'\n ? RUM_SPAN_OUTCOME.timeout\n : outcome?.type === 'network_error'\n ? RUM_SPAN_OUTCOME.error\n : typeof responseStatus === 'number'\n ? getHttpOutcome(responseStatus)\n : RUM_SPAN_OUTCOME.success;\n const normalizedMethod = method?.toUpperCase();\n return {\n ...buildRumSpanAttributes({\n outcome: outcomeType,\n spanType: RUM_SPAN_TYPE.resource,\n }),\n ...(target.serverAddress ? { 'server.address': target.serverAddress } : {}),\n ...(target.serverPort !== undefined ? { 'server.port': target.serverPort } : {}),\n 'resource.type': initiatorType,\n ...(normalizedMethod ? { 'http.request.method': normalizedMethod } : {}),\n ...(typeof responseStatus === 'number' ? { 'http.response.status_code': responseStatus } : {}),\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { createRandomId } from '../core/id';\nimport { matchesUrlList } from '../core/url';\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\nimport { buildRumSpanAttributes, RUM_SPAN_OUTCOME, RUM_SPAN_TYPE } from '../schema/span';\n\nimport type { BkOTActivityEvent } from '../core/action-activity';\nimport type { BkOTPlugin, BkOTRuntimeContext } from '../core/plugin';\nimport type { Attributes } from '@opentelemetry/api';\n\n/**\n * 用户点击采集以“点击后产生的副作用”为 Action 生命周期:关联请求、资源、长任务、DOM 变化和错误,\n * 在活动安静后结束。完成后的 Action 暂缓至连击窗口结束再上报,以便把三次相近点击合并为一次 rage click。\n */\nconst ACTION_VALIDATION_DELAY = 100;\nconst ACTION_END_DELAY = 100;\nconst CLICK_CHAIN_DURATION = 1_000;\nconst CLICK_CHAIN_MAX_DISTANCE = 100;\nconst DEFAULT_ACTION_MAX_DURATION = 10_000;\nconst DEFAULT_ACTION_NAME_ATTRIBUTE = 'data-bk-action-name';\nconst MAX_NAME_LENGTH = 100;\nconst MAX_PARENTS_TO_CONSIDER = 10;\n\nexport interface BkOTActionPluginOptions {\n actionNameAttribute?: string;\n maxDuration?: number;\n /** 默认仅采集显式 data 属性;设为 text 才会读取可访问名称和 DOM 文本。 */\n nameCollection?: 'explicit' | 'text';\n}\n\ntype ActionFrustrationType = 'dead_click' | 'error_click' | 'rage_click';\n\ninterface ActiveAction {\n completed?: { endTime: number; hasLoadingTime: boolean };\n frustrations: Set<ActionFrustrationType>;\n hadActivity: boolean;\n hadError: boolean;\n id: string;\n lastActivityTime: number;\n maxDurationTimer: ReturnType<typeof setTimeout>;\n pendingRequests: Set<string>;\n quietTimer?: ReturnType<typeof setTimeout>;\n reportTimer?: ReturnType<typeof setTimeout>;\n runtimeAttributes: Attributes;\n startTime: number;\n target: Element;\n targetName: string;\n targetTag: string;\n userActivity: { input: boolean; scroll: boolean; selection: boolean };\n validationTimer: ReturnType<typeof setTimeout>;\n}\n\ninterface RecentClick {\n action: ActiveAction;\n target: Element;\n x: number;\n y: number;\n}\n\nconst normalizeText = (value: string) => value.replace(/\\s+/g, ' ').trim().slice(0, MAX_NAME_LENGTH);\n\nconst getParentElement = (element: Element) => {\n if (element.parentElement) {\n return element.parentElement;\n }\n const root = element.getRootNode?.();\n return typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot ? root.host : null;\n};\n\nconst findAttributeOnAncestors = (element: Element, attribute: string) => {\n let current: Element | null = element;\n while (current) {\n const value = current.getAttribute(attribute);\n if (value) {\n return normalizeText(value);\n }\n current = getParentElement(current);\n }\n return undefined;\n};\n\nconst getElementText = (element: Element) =>\n (element as HTMLElement).isContentEditable ? '' : normalizeText(element.textContent ?? '');\n\nconst getPriorityName = (element: Element) => {\n const formElement = element as Element & {\n labels?: HTMLLabelElement[] | NodeListOf<HTMLLabelElement>;\n value?: string;\n };\n const label = formElement.labels?.[0];\n if (label) {\n const labelText = getElementText(label);\n if (labelText) return labelText;\n }\n\n const tagName = element.tagName.toLowerCase();\n const inputType = element.getAttribute('type')?.toLowerCase();\n if (tagName === 'input' && ['button', 'reset', 'submit'].includes(inputType ?? '')) {\n const value = normalizeText(formElement.value ?? '');\n if (value) return value;\n }\n\n if (tagName === 'button' || tagName === 'label' || element.getAttribute('role') === 'button') {\n const text = getElementText(element);\n if (text) return text;\n }\n\n for (const attribute of ['aria-label', 'alt', 'name', 'title', 'placeholder']) {\n const value = normalizeText(element.getAttribute(attribute) ?? '');\n if (value) return value;\n }\n\n return undefined;\n};\n\nexport const getActionNameFromElement = (\n target: Element,\n actionNameAttribute = DEFAULT_ACTION_NAME_ATTRIBUTE,\n includeText = false,\n): string => {\n const explicitName = findAttributeOnAncestors(target, actionNameAttribute);\n if (explicitName) {\n return explicitName;\n }\n if (!includeText) return target.tagName.toLowerCase();\n\n let current: Element | null = target;\n let parentCount = 0;\n while (current && parentCount <= MAX_PARENTS_TO_CONSIDER) {\n const tagName = current.tagName.toLowerCase();\n if (tagName === 'body' || tagName === 'html' || tagName === 'head') break;\n const priorityName = getPriorityName(current);\n if (priorityName) return priorityName;\n if (tagName === 'form') break;\n current = getParentElement(current);\n parentCount += 1;\n }\n\n current = target;\n parentCount = 0;\n while (current && parentCount <= MAX_PARENTS_TO_CONSIDER) {\n const tagName = current.tagName.toLowerCase();\n if (tagName === 'body' || tagName === 'html' || tagName === 'head') break;\n const text = getElementText(current);\n if (text) return text;\n if (tagName === 'form') break;\n current = getParentElement(current);\n parentCount += 1;\n }\n\n return target.tagName.toLowerCase();\n};\n\nconst getElement = (event: Event) => {\n const composedTarget = event.composedPath?.()[0];\n if (composedTarget instanceof Element) return composedTarget;\n return event.target instanceof Element ? event.target : undefined;\n};\n\nconst toEpochTime = (event: Event) => {\n const eventTime = event.timeStamp;\n if (!Number.isFinite(eventTime) || eventTime <= 0) return Date.now();\n if (eventTime > 1_000_000_000_000) return eventTime;\n return typeof performance === 'undefined' ? Date.now() : performance.timeOrigin + eventTime;\n};\n\nconst positiveNumber = (value: number | undefined, fallback: number) =>\n typeof value === 'number' && Number.isFinite(value) && value > 0 ? value : fallback;\n\nexport const isDeadClickExcluded = (target: Element) => {\n let current: Element | null = target;\n if (current.tagName.toLowerCase() === 'label' && current.hasAttribute('for')) {\n current = document.getElementById(current.getAttribute('for') ?? '');\n }\n\n while (current) {\n const tagName = current.tagName.toLowerCase();\n if (\n current.hasAttribute('contenteditable') ||\n tagName === 'canvas' ||\n tagName === 'select' ||\n tagName === 'textarea'\n ) {\n return true;\n }\n if (tagName === 'a' && current.hasAttribute('href')) return true;\n if (tagName === 'input') {\n return !['button', 'checkbox', 'radio', 'range', 'reset', 'submit'].includes(\n current.getAttribute('type')?.toLowerCase() ?? 'text',\n );\n }\n current = getParentElement(current);\n }\n return false;\n};\n\nexport const createActionPlugin = (options: BkOTActionPluginOptions = {}): BkOTPlugin => {\n const teardownCallbacks: Array<() => void> = [];\n const activeActions = new Map<string, ActiveAction>();\n const pendingActions = new Set<ActiveAction>();\n const actionNameAttribute = options.actionNameAttribute || DEFAULT_ACTION_NAME_ATTRIBUTE;\n const maxDuration = positiveNumber(options.maxDuration, DEFAULT_ACTION_MAX_DURATION);\n let recentClicks: RecentClick[] = [];\n let runtimeContext: BkOTRuntimeContext | undefined;\n\n const updateRuntimeActionId = () => {\n runtimeContext?.setRuntimeAttributes({\n // 重叠窗口只暴露最近一次 Action,保证 action.id 始终是字符串。\n [RUM_ATTRIBUTES.actionId]: [...activeActions.keys()].at(-1),\n });\n };\n\n const isDeadAction = (action: ActiveAction) =>\n !action.hadActivity &&\n !action.userActivity.input &&\n !action.userActivity.scroll &&\n !action.userActivity.selection &&\n !isDeadClickExcluded(action.target);\n\n const reportAction = (action: ActiveAction) => {\n if (!pendingActions.delete(action) || !runtimeContext || !action.completed) return;\n clearTimeout(action.reportTimer);\n if (action.hadError) action.frustrations.add('error_click');\n if (isDeadAction(action)) action.frustrations.add('dead_click');\n const frustrationTypes = ['rage_click', 'dead_click', 'error_click'].filter(type =>\n action.frustrations.has(type as ActionFrustrationType),\n ) as ActionFrustrationType[];\n const { endTime, hasLoadingTime } = action.completed;\n const hasWarning = action.hadError || frustrationTypes.length > 0;\n const span = runtimeContext.startSpan(\n 'action.click',\n {\n ...runtimeContext.config.hooks.getPageAttributes(),\n ...buildRumSpanAttributes({\n outcome: hasWarning ? RUM_SPAN_OUTCOME.warning : RUM_SPAN_OUTCOME.success,\n spanType: RUM_SPAN_TYPE.action,\n }),\n ...action.runtimeAttributes,\n [RUM_ATTRIBUTES.actionId]: action.id,\n [RUM_ATTRIBUTES.actionType]: 'click',\n [RUM_ATTRIBUTES.actionTargetName]: action.targetName,\n [RUM_ATTRIBUTES.actionTargetTag]: action.targetTag,\n ...(frustrationTypes.length ? { [RUM_ATTRIBUTES.actionFrustrationType]: frustrationTypes } : {}),\n },\n { startTime: action.startTime },\n );\n span.end(hasLoadingTime ? endTime : action.startTime);\n };\n\n const finishAction = (action: ActiveAction, endTime: number, hasLoadingTime: boolean) => {\n if (!activeActions.delete(action.id) || !runtimeContext) return;\n clearTimeout(action.validationTimer);\n clearTimeout(action.quietTimer);\n clearTimeout(action.maxDurationTimer);\n updateRuntimeActionId();\n action.completed = { endTime, hasLoadingTime };\n pendingActions.add(action);\n // 等待连击窗口关闭后再落数,否则前两次点击已上报便无法合并为 rage click。\n const reportDelay = Math.max(0, action.startTime + CLICK_CHAIN_DURATION - Date.now());\n action.reportTimer = setTimeout(() => reportAction(action), reportDelay);\n };\n\n const flushPendingActions = () => {\n [...pendingActions].forEach(reportAction);\n };\n\n const scheduleActionEnd = (action: ActiveAction) => {\n clearTimeout(action.quietTimer);\n if (!action.hadActivity || action.pendingRequests.size) return;\n const delay = Math.max(0, action.lastActivityTime + ACTION_END_DELAY - Date.now());\n action.quietTimer = setTimeout(() => finishAction(action, action.lastActivityTime, true), delay);\n };\n\n const markActivity = (action: ActiveAction, time: number) => {\n action.hadActivity = true;\n action.lastActivityTime = Math.max(action.lastActivityTime, time);\n scheduleActionEnd(action);\n };\n\n const isInActionWindow = (action: ActiveAction, time: number) =>\n time >= action.startTime && time <= action.startTime + maxDuration;\n\n const onActivity = (event: BkOTActivityEvent) => {\n for (const action of activeActions.values()) {\n if (event.type === 'request_start') {\n if (event.url && matchesUrlList(runtimeContext?.config.view?.excludedActivityUrls, event.url)) continue;\n if (!isInActionWindow(action, event.time)) continue;\n action.pendingRequests.add(event.id);\n markActivity(action, event.time);\n continue;\n }\n if (event.type === 'request_end') {\n if (!action.pendingRequests.delete(event.id)) continue;\n markActivity(action, event.time);\n continue;\n }\n if (event.type === 'long_task' || event.type === 'resource') {\n if (\n event.type === 'resource' &&\n event.url &&\n matchesUrlList(runtimeContext?.config.view?.excludedActivityUrls, event.url)\n ) {\n continue;\n }\n if (\n event.startTime > action.startTime + maxDuration ||\n (event.type === 'resource' ? event.startTime < action.startTime : event.endTime < action.startTime)\n ) {\n continue;\n }\n markActivity(action, event.endTime);\n continue;\n }\n if (event.type === 'dom_mutation' || event.type === 'window_open') {\n if (isInActionWindow(action, event.time)) markActivity(action, event.time);\n continue;\n }\n if (event.type !== 'error') continue;\n if (!isInActionWindow(action, event.time)) continue;\n action.hadError = true;\n markActivity(action, event.time);\n }\n };\n\n const finishActiveActions = (endTime = Date.now()) => {\n [...activeActions.values()].forEach(action => finishAction(action, endTime, action.hadActivity));\n };\n\n const registerClick = (action: ActiveAction, event: Event) => {\n const x = 'clientX' in event && typeof event.clientX === 'number' ? event.clientX : 0;\n const y = 'clientY' in event && typeof event.clientY === 'number' ? event.clientY : 0;\n recentClicks = recentClicks.filter(click => action.startTime - click.action.startTime <= CLICK_CHAIN_DURATION);\n const lastClick = recentClicks.at(-1);\n const hasInterruptedChain = recentClicks.some(\n click => click.action.userActivity.scroll || click.action.userActivity.selection,\n );\n // 只有同一目标附近、未被滚动或选中文本打断的连续点击才视为同一连击链。\n const isSimilar =\n lastClick?.target === action.target && Math.hypot(lastClick.x - x, lastClick.y - y) <= CLICK_CHAIN_MAX_DISTANCE;\n if (hasInterruptedChain || (lastClick && !isSimilar)) recentClicks = [];\n recentClicks.push({ action, target: action.target, x, y });\n if (\n recentClicks.length >= 3 &&\n action.startTime - recentClicks[recentClicks.length - 3].action.startTime <= CLICK_CHAIN_DURATION\n ) {\n const rageSources = recentClicks.slice(-3).map(click => click.action);\n rageSources.forEach(source => source.frustrations.add('rage_click'));\n recentClicks = [];\n }\n };\n\n return {\n name: 'action',\n init(context) {\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n return;\n }\n runtimeContext = context;\n\n const listenerOptions: AddEventListenerOptions = { capture: true, passive: true };\n\n const startAction = (event: Event) => {\n if (!context.isSampled()) return;\n if ('button' in event && typeof event.button === 'number' && event.button !== 0) return;\n const element = getElement(event);\n if (!element) return;\n const startTime = toEpochTime(event);\n const id = createRandomId('action');\n const action: ActiveAction = {\n frustrations: new Set(),\n hadActivity: false,\n hadError: false,\n id,\n lastActivityTime: startTime,\n maxDurationTimer: setTimeout(() => finishAction(action, startTime + maxDuration, true), maxDuration),\n pendingRequests: new Set(),\n runtimeAttributes: context.getRuntimeAttributes(),\n startTime,\n target: element,\n targetName: getActionNameFromElement(element, actionNameAttribute, options.nameCollection === 'text'),\n targetTag: element.tagName.toLowerCase(),\n userActivity: { input: false, scroll: false, selection: false },\n validationTimer: setTimeout(() => {\n if (!action.hadActivity) finishAction(action, action.startTime, false);\n }, ACTION_VALIDATION_DELAY),\n };\n activeActions.set(id, action);\n registerClick(action, event);\n updateRuntimeActionId();\n };\n\n window.addEventListener('click', startAction, listenerOptions);\n teardownCallbacks.push(() => window.removeEventListener('click', startAction, listenerOptions));\n\n const unsubscribeActivity = context.onActivity(onActivity);\n const unsubscribeSession = context.onSessionLifecycle(event => {\n if (event.type !== 'expired') return;\n finishActiveActions(event.expiredAt);\n flushPendingActions();\n });\n teardownCallbacks.push(unsubscribeActivity, unsubscribeSession);\n\n const finishOnHidden = () => {\n if (document.visibilityState === 'hidden') {\n finishActiveActions();\n flushPendingActions();\n }\n };\n const finishOnPageHide = () => {\n finishActiveActions();\n flushPendingActions();\n };\n window.addEventListener('pagehide', finishOnPageHide);\n document.addEventListener('visibilitychange', finishOnHidden);\n teardownCallbacks.push(\n () => window.removeEventListener('pagehide', finishOnPageHide),\n () => document.removeEventListener('visibilitychange', finishOnHidden),\n );\n\n const markUserActivity = (type: keyof ActiveAction['userActivity']) => {\n const actions = new Set([\n ...activeActions.values(),\n ...pendingActions,\n ...recentClicks.map(click => click.action),\n ]);\n actions.forEach(action => {\n action.userActivity[type] = true;\n // 滚动/选择表明用户仍在正常交互,撤销尚未上报的 rage click 判定。\n if (type !== 'input') action.frustrations.delete('rage_click');\n });\n };\n const onInput = () => markUserActivity('input');\n const onScroll = () => markUserActivity('scroll');\n const onSelectionChange = () => markUserActivity('selection');\n window.addEventListener('input', onInput, listenerOptions);\n window.addEventListener('scroll', onScroll, listenerOptions);\n document.addEventListener('selectionchange', onSelectionChange, listenerOptions);\n teardownCallbacks.push(\n () => window.removeEventListener('input', onInput, listenerOptions),\n () => window.removeEventListener('scroll', onScroll, listenerOptions),\n () => document.removeEventListener('selectionchange', onSelectionChange, listenerOptions),\n );\n },\n shutdown() {\n finishActiveActions();\n flushPendingActions();\n while (teardownCallbacks.length) {\n teardownCallbacks.pop()?.();\n }\n recentClicks = [];\n runtimeContext = undefined;\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n */\n\nimport type { BkOTPlugin } from '../core/plugin';\n\nexport const EXCLUDED_ACTIVITY_MUTATIONS_ATTRIBUTE = 'data-bk-excluded-activity-mutations';\n\nconst isExcludedMutation = (mutation: MutationRecord) => {\n const target = mutation.type === 'characterData' ? mutation.target.parentElement : mutation.target;\n return target instanceof Element && Boolean(target.closest(`[${EXCLUDED_ACTIVITY_MUTATIONS_ATTRIBUTE}]`));\n};\n\n/**\n * 页面级 DOM 活动只观察一次,再通过运行时活动总线分发给 View、Action 和白屏检测。\n */\nexport const createActivityPlugin = (): BkOTPlugin => {\n let mutationObserver: MutationObserver | undefined;\n const teardownCallbacks: Array<() => void> = [];\n\n return {\n name: 'activity',\n init(context) {\n if (typeof document !== 'undefined' && typeof MutationObserver !== 'undefined') {\n mutationObserver = new MutationObserver(mutations => {\n if (mutations.length && !mutations.every(isExcludedMutation)) {\n context.notifyActivity({ time: Date.now(), type: 'dom_mutation' });\n }\n });\n mutationObserver.observe(document, { attributes: true, characterData: true, childList: true, subtree: true });\n }\n\n if (typeof window === 'undefined') return;\n\n if (typeof window.open === 'function') {\n const originalOpen = window.open;\n const patchedOpen = ((...args: Parameters<typeof window.open>) => {\n context.notifyActivity({ time: Date.now(), type: 'window_open' });\n return Reflect.apply(originalOpen, window, args);\n }) as typeof window.open;\n window.open = patchedOpen;\n teardownCallbacks.push(() => {\n if (window.open === patchedOpen) window.open = originalOpen;\n });\n }\n\n },\n shutdown() {\n mutationObserver?.disconnect();\n mutationObserver = undefined;\n while (teardownCallbacks.length) teardownCallbacks.pop()?.();\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n */\n\nimport { matchesUrlList } from './url';\n\nimport type { BkOTActivityEvent } from './action-activity';\nimport type { BkOTRuntimeContext } from './plugin';\n\nexport const PAGE_ACTIVITY_VALIDATION_DELAY = 100;\nexport const PAGE_ACTIVITY_END_DELAY = 100;\n\nexport type PageActivityEnd = { endTime: number; hadActivity: true } | { hadActivity: false };\n\nconst isActivityUrlExcluded = (context: BkOTRuntimeContext, url: string | undefined) =>\n Boolean(url && matchesUrlList(context.config.view.excludedActivityUrls, url));\n\n/**\n * 等待 View/Action 启动后的请求、静态资源和 DOM 变更全部安静 100ms。\n * 请求用 id 精确配对,避免并发请求提前结束等待。\n */\nexport const waitForPageActivityEnd = (\n context: BkOTRuntimeContext,\n startTime: number,\n callback: (result: PageActivityEnd) => void,\n) => {\n const pendingRequests = new Set<string>();\n let completed = false;\n let hadActivity = false;\n let lastActivityTime = startTime;\n let quietTimer: ReturnType<typeof setTimeout> | undefined;\n\n const complete = (result: PageActivityEnd) => {\n if (completed) return;\n completed = true;\n clearTimeout(validationTimer);\n clearTimeout(quietTimer);\n unsubscribe();\n callback(result);\n };\n\n const scheduleEnd = () => {\n clearTimeout(quietTimer);\n if (!hadActivity || pendingRequests.size) return;\n quietTimer = setTimeout(\n () => complete({ endTime: lastActivityTime, hadActivity: true }),\n Math.max(0, lastActivityTime + PAGE_ACTIVITY_END_DELAY - Date.now()),\n );\n };\n\n const markActivity = (time: number) => {\n hadActivity = true;\n lastActivityTime = Math.max(lastActivityTime, time);\n scheduleEnd();\n };\n\n const onActivity = (event: BkOTActivityEvent) => {\n if (event.type === 'error' || event.type === 'long_task') return;\n if (event.type === 'request_start') {\n if (event.time < startTime || isActivityUrlExcluded(context, event.url)) return;\n pendingRequests.add(event.id);\n markActivity(event.time);\n return;\n }\n if (event.type === 'request_end') {\n if (!pendingRequests.delete(event.id)) return;\n markActivity(event.time);\n return;\n }\n if (event.type === 'resource') {\n if (event.endTime < startTime || isActivityUrlExcluded(context, event.url)) return;\n markActivity(event.endTime);\n return;\n }\n if (event.time >= startTime) markActivity(event.time);\n };\n\n const unsubscribe = context.onActivity(onActivity);\n const validationTimer = setTimeout(() => {\n if (!hadActivity) complete({ hadActivity: false });\n }, PAGE_ACTIVITY_VALIDATION_DELAY);\n\n return () => {\n if (completed) return;\n completed = true;\n clearTimeout(validationTimer);\n clearTimeout(quietTimer);\n unsubscribe();\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n */\n\nimport { waitForPageActivityEnd } from '../core/page-activity';\nimport { buildRumSpanAttributes, RUM_SPAN_OUTCOME, RUM_SPAN_TYPE } from '../schema/span';\n\nimport type { BkOTPlugin } from '../core/plugin';\n\n/**\n * 通过视口九宫格采样估算空白比例,并在页面稳定后连续确认两次。每个 View 最多上报一次,\n * 避免首屏渲染、路由切换和 loading 状态造成瞬时误报。\n */\nexport interface BkOTBlankScreenPluginOptions {\n /** 页面活动稳定后首次检查的延迟,默认 1000ms。 */\n checkDelay?: number;\n /** 两次空白结果之间的确认间隔,默认 200ms。 */\n confirmationDelay?: number;\n /** loading、骨架屏等不参与空白比例计算的元素。 */\n ignoreSelectors?: string[];\n /** 应用挂载根节点,默认 body。根节点不存在时回退到 body 检测。 */\n rootSelector?: string;\n /** 空白采样点比例阈值,默认 0.8。 */\n threshold?: number;\n}\n\ninterface DetectionResult {\n emptyCount: number;\n ignoredCount: number;\n reason: 'empty_viewport' | 'missing_root';\n score: number;\n validCount: number;\n}\n\nconst DEFAULT_CHECK_DELAY = 1000;\nconst DEFAULT_CONFIRMATION_DELAY = 200;\nconst DEFAULT_ROOT_SELECTOR = 'body';\nconst DEFAULT_THRESHOLD = 0.8;\nconst DEFAULT_IGNORED_SELECTORS = [\n '[data-loading=\"true\"]',\n '[aria-busy=\"true\"]',\n '.loading',\n '.is-loading',\n '.spinner',\n '.skeleton',\n '.bk-loading',\n];\n\nconst SAMPLE_POINTS: ReadonlyArray<readonly [number, number]> = [\n [0.2, 0.2],\n [0.5, 0.2],\n [0.8, 0.2],\n [0.2, 0.5],\n [0.5, 0.5],\n [0.8, 0.5],\n [0.2, 0.8],\n [0.5, 0.8],\n [0.8, 0.8],\n];\n\nconst nonNegativeNumber = (value: number | undefined, fallback: number) =>\n typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : fallback;\n\nconst boundedRatio = (value: number | undefined, fallback: number) =>\n typeof value === 'number' && Number.isFinite(value) ? Math.max(0, Math.min(1, value)) : fallback;\n\nconst matchesAny = (element: Element, selectors: string[]) =>\n selectors.some(selector => {\n try {\n return element.matches(selector) || Boolean(element.closest(selector));\n } catch {\n return false;\n }\n });\n\nconst isVisuallyPresent = (element: Element) => {\n if (typeof getComputedStyle !== 'function') return true;\n const style = getComputedStyle(element);\n return style.display !== 'none' && style.visibility !== 'hidden' && Number(style.opacity || 1) > 0;\n};\n\nconst getElementsAtPoint = (x: number, y: number): Element[] => {\n if (typeof document.elementsFromPoint === 'function') return document.elementsFromPoint(x, y);\n const element = document.elementFromPoint(x, y);\n return element ? [element] : [];\n};\n\nexport const detectBlankScreen = (rootSelector: string, ignoredSelectors: string[]): DetectionResult => {\n const configuredRoot = document.querySelector(rootSelector);\n const root = configuredRoot ?? document.body ?? document.documentElement;\n\n let emptyCount = 0;\n let ignoredCount = 0;\n // 采样视口九宫格而非遍历 DOM,检测成本固定;被 loading/骨架屏覆盖的点不进入分母。\n for (const [xRatio, yRatio] of SAMPLE_POINTS) {\n const layers = getElementsAtPoint(window.innerWidth * xRatio, window.innerHeight * yRatio);\n if (layers.some(element => matchesAny(element, ignoredSelectors))) {\n ignoredCount += 1;\n continue;\n }\n const hasContent = layers.some(\n element =>\n element !== root &&\n element !== document.body &&\n element !== document.documentElement &&\n root.contains(element) &&\n isVisuallyPresent(element),\n );\n if (!hasContent) emptyCount += 1;\n }\n\n const validCount = SAMPLE_POINTS.length - ignoredCount;\n return {\n emptyCount,\n ignoredCount,\n reason: configuredRoot ? 'empty_viewport' : 'missing_root',\n score: validCount ? emptyCount / validCount : 0,\n validCount,\n };\n};\n\nexport const createBlankScreenPlugin = (options: BkOTBlankScreenPluginOptions = {}): BkOTPlugin => {\n const checkDelay = nonNegativeNumber(options.checkDelay, DEFAULT_CHECK_DELAY);\n const confirmationDelay = nonNegativeNumber(options.confirmationDelay, DEFAULT_CONFIRMATION_DELAY);\n const rootSelector = options.rootSelector || DEFAULT_ROOT_SELECTOR;\n const threshold = boundedRatio(options.threshold, DEFAULT_THRESHOLD);\n const ignoredSelectors = [...DEFAULT_IGNORED_SELECTORS, ...(options.ignoreSelectors ?? [])];\n let activeViewId: string | undefined;\n let reportedViewId: string | undefined;\n let stopActivityTracking: (() => void) | undefined;\n let timer: ReturnType<typeof setTimeout> | undefined;\n let unsubscribeView = () => {};\n let visibilityListener: (() => void) | undefined;\n\n return {\n name: 'blank-screen',\n init(context) {\n if (typeof window === 'undefined' || typeof document === 'undefined') return;\n const clearTimer = () => {\n clearTimeout(timer);\n timer = undefined;\n };\n\n const report = (viewId: string, result: DetectionResult) => {\n if (activeViewId !== viewId || reportedViewId === viewId) return;\n if (!context.isSampled()) return;\n reportedViewId = viewId;\n const occurredAt = Date.now();\n const span = context.startSpan(\n 'browser.blank_screen',\n {\n ...buildRumSpanAttributes({\n outcome: RUM_SPAN_OUTCOME.error,\n spanType: RUM_SPAN_TYPE.error,\n }),\n 'blank_screen.empty_ratio': result.score,\n 'blank_screen.empty_sample_count': result.emptyCount,\n 'blank_screen.reason': result.reason,\n },\n { startTime: occurredAt },\n );\n span.end(occurredAt);\n };\n\n const detectAndConfirm = (viewId: string) => {\n if (activeViewId !== viewId || reportedViewId === viewId) return;\n if (document.visibilityState === 'hidden') return;\n let first: DetectionResult;\n try {\n first = detectBlankScreen(rootSelector, ignoredSelectors);\n } catch (error) {\n if (context.config.debug) globalThis.console?.warn('[bk-ot][blank-screen] detection failed:', error);\n return;\n }\n if (!first.validCount || first.score < threshold) return;\n timer = setTimeout(() => {\n if (activeViewId !== viewId || document.visibilityState === 'hidden') return;\n let confirmed: DetectionResult;\n try {\n confirmed = detectBlankScreen(rootSelector, ignoredSelectors);\n } catch (error) {\n if (context.config.debug) globalThis.console?.warn('[bk-ot][blank-screen] confirmation failed:', error);\n return;\n }\n if (confirmed.validCount && confirmed.score >= threshold) report(viewId, confirmed);\n }, confirmationDelay);\n };\n\n const schedule = (viewId: string) => {\n clearTimer();\n if (document.visibilityState === 'hidden' || !context.isSampled()) return;\n timer = setTimeout(() => detectAndConfirm(viewId), checkDelay);\n };\n\n unsubscribeView = context.onViewChange(view => {\n if (view.id === activeViewId) return;\n clearTimer();\n stopActivityTracking?.();\n stopActivityTracking = undefined;\n activeViewId = view.id;\n reportedViewId = undefined;\n if (view.id) {\n const viewId = view.id;\n // 页面活动结束后再延迟检测,避免把正常渲染过程中的短暂空白误报为白屏。\n stopActivityTracking = waitForPageActivityEnd(context, Date.now(), () => {\n stopActivityTracking = undefined;\n schedule(viewId);\n });\n }\n });\n const onVisibilityChange = () => {\n if (document.visibilityState === 'hidden') {\n clearTimer();\n } else if (activeViewId && reportedViewId !== activeViewId) {\n schedule(activeViewId);\n }\n };\n document.addEventListener('visibilitychange', onVisibilityChange);\n visibilityListener = () => document.removeEventListener('visibilitychange', onVisibilityChange);\n },\n shutdown() {\n clearTimeout(timer);\n timer = undefined;\n unsubscribeView();\n stopActivityTracking?.();\n stopActivityTracking = undefined;\n visibilityListener?.();\n visibilityListener = undefined;\n activeViewId = undefined;\n reportedViewId = undefined;\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\nimport { isBkOTEndpoint } from './url';\n\nimport type { ResolvedBkOTConfig } from './config';\nimport type { Attributes, Context, Span as ApiSpan } from '@opentelemetry/api';\nimport type { ReadableSpan, Span, SpanProcessor } from '@opentelemetry/sdk-trace-base';\n\nconst SELF_TELEMETRY_URL_KEYS = ['http.url', 'url.full'];\nconst discardedSpans = new WeakSet<object>();\n\nexport const markSpanDiscarded = (span: ApiSpan) => {\n discardedSpans.add(span);\n};\n\nconst getSpanUrl = (span: ReadableSpan): string | undefined => {\n for (const key of SELF_TELEMETRY_URL_KEYS) {\n const value = span.attributes?.[key];\n if (typeof value === 'string') {\n return value;\n }\n }\n return undefined;\n};\n\nconst hasSessionId = (attributes: Record<string, unknown> | undefined) => {\n const sessionId = attributes?.[RUM_ATTRIBUTES.sessionId];\n return typeof sessionId === 'string' && sessionId.length > 0;\n};\n\nconst hasViewId = (attributes: Record<string, unknown> | undefined) => {\n const viewId = attributes?.[RUM_ATTRIBUTES.viewId];\n return typeof viewId === 'string' && viewId.length > 0;\n};\n\nconst hasRumContext = (attributes: Record<string, unknown> | undefined) =>\n hasSessionId(attributes) && hasViewId(attributes);\n\n/**\n * 给所有 span 固化创建时的运行时上下文,并在 onEnd 阶段过滤自身上报请求和无 RUM 上下文 span。\n */\nexport class FilteringSpanProcessor implements SpanProcessor {\n public constructor(\n private readonly inner: SpanProcessor,\n private readonly config: ResolvedBkOTConfig,\n private readonly getRuntimeAttributes: () => Attributes,\n ) {}\n\n public forceFlush(): Promise<void> {\n return this.inner.forceFlush();\n }\n\n public onEnd(span: ReadableSpan): void {\n const url = getSpanUrl(span);\n if (\n discardedSpans.delete(span) ||\n (url && isBkOTEndpoint(this.config, url)) ||\n (!hasRumContext(span.attributes) &&\n !(span.name === 'browser.session' && hasSessionId(span.attributes)))\n ) {\n return;\n }\n try {\n if (\n this.config.hooks?.beforeSend?.({\n attributes: span.attributes,\n name: span.name,\n signal: 'span',\n }) === false\n ) {\n return;\n }\n } catch (error) {\n if (this.config.debug) globalThis.console?.warn('[bk-ot] tracking.beforeSend failed:', error);\n }\n this.inner.onEnd(span);\n }\n\n public onStart(span: Span, parentContext: Context): void {\n const existingAttributes = (span as Span & { attributes?: Attributes }).attributes ?? {};\n const missingRuntimeAttributes: Attributes = {};\n // instrumentation 显式写入的属性优先,只补齐创建时缺失的运行时上下文。\n for (const [key, value] of Object.entries(this.getRuntimeAttributes())) {\n if (existingAttributes[key] === undefined && value !== undefined) missingRuntimeAttributes[key] = value;\n }\n span.setAttributes(missingRuntimeAttributes);\n this.inner.onStart(span, parentContext);\n }\n\n public shutdown(): Promise<void> {\n return this.inner.shutdown();\n }\n}\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n */\n\ninterface PendingRequestTiming {\n entry?: PerformanceResourceTiming;\n startTime: number;\n timer?: ReturnType<typeof setTimeout>;\n url: string;\n callback?: (entry?: PerformanceResourceTiming) => void;\n}\n\nconst MAX_PENDING_REQUESTS = 100;\nconst RESOURCE_TIMING_WAIT_MS = 200;\nconst pendingRequests: PendingRequestTiming[] = [];\n\nconst normalizeUrl = (url: string) => url.replace(/#.*$/, '');\n\nconst removePending = (pending: PendingRequestTiming) => {\n const index = pendingRequests.indexOf(pending);\n if (index >= 0) pendingRequests.splice(index, 1);\n if (pending.timer !== undefined) clearTimeout(pending.timer);\n};\n\nconst finishPending = (pending: PendingRequestTiming, entry?: PerformanceResourceTiming) => {\n const callback = pending.callback;\n removePending(pending);\n pending.callback = undefined;\n callback?.(entry);\n};\n\nexport const notifyRequestTiming = (entry: PerformanceResourceTiming) => {\n const entryStartTime = performance.timeOrigin + entry.startTime;\n // 同 URL 并发时选择起始时间最接近的请求;50ms 容差覆盖 JS 调用与浏览器创建 timing entry 的偏差。\n const candidate = pendingRequests\n .filter(\n pending =>\n !pending.entry &&\n normalizeUrl(pending.url) === normalizeUrl(entry.name) &&\n entryStartTime >= pending.startTime - 50,\n )\n .sort((left, right) => Math.abs(left.startTime - entryStartTime) - Math.abs(right.startTime - entryStartTime))[0];\n if (!candidate) return;\n candidate.entry = entry;\n if (candidate.callback) finishPending(candidate, entry);\n};\n\nexport const trackRequestTiming = (url: string, startTime = Date.now()) => {\n const pending: PendingRequestTiming = { startTime, url };\n pendingRequests.push(pending);\n if (pendingRequests.length > MAX_PENDING_REQUESTS) finishPending(pendingRequests[0]);\n return {\n cancel: () => finishPending(pending),\n complete: (callback: (entry?: PerformanceResourceTiming) => void) => {\n pending.callback = callback;\n if (pending.entry) {\n finishPending(pending, pending.entry);\n return;\n }\n // XHR 终止事件/Fetch settle 通常早于 ResourceTiming 回调,短暂等待以补齐 DNS、连接和下载阶段。\n pending.timer = setTimeout(() => finishPending(pending), RESOURCE_TIMING_WAIT_MS);\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n/**\n * 被观测请求的 Trace Context 规划。\n *\n * 后端 APM 只解析 W3C `traceparent`,并且要求一个后端 trace 只对应一个 API 请求,因此这里不复用\n * RUM Span 自身的 trace context,而是为每个命中白名单的请求生成独立的 trace-id/span-id,再通过\n * Span Link 把后端 trace 关联回 RUM Span。\n *\n * 如果业务已经自行设置了 trace header(`traceparent`、`sentry-trace`、b3、Datadog、sw8),则完全\n * 不注入,避免破坏业务既有的传播方式,只把已有链路建成 Link。\n *\n * Link 结构恒定:`context` 承载 trace-id/span-id,`attributes` 记录命中的格式与原始 header。\n * sw8 这类无法映射为合法 OTel id 的格式会补一对占位 id,让 Link 结构保持统一。\n */\n\nimport { TraceFlags } from '@opentelemetry/api';\n\nimport type { Attributes, Link } from '@opentelemetry/api';\n\n/** 大小写不敏感地读取一个请求 header */\nexport type BkOTHeaderReader = (name: string) => string | undefined;\n\nexport interface BkOTRequestTracePlan {\n /** 关联后端 trace 的 Span Link,恒为一条 */\n links: Link[];\n /** 需要注入的 traceparent;业务已有 trace header 时为 undefined */\n traceparent?: string;\n}\n\nexport type BkOTUpstreamTraceFormat = 'b3' | 'b3-multi' | 'datadog' | 'sentry-trace' | 'sw8' | 'traceparent';\n\nexport const TRACEPARENT_HEADER = 'traceparent';\n\nconst TRACE_ID_LENGTH = 32;\nconst SPAN_ID_LENGTH = 16;\n\nconst HEX_DIGITS = '0123456789abcdef';\nconst HEX_PATTERN = /^[\\da-f]+$/;\nconst ZERO_PATTERN = /^0+$/;\nconst DECIMAL_PATTERN = /^\\d+$/;\n\n// 00-{trace-id}-{parent-id}-{trace-flags};允许未来版本追加字段,但 ff 是规范保留值\nconst TRACEPARENT_PATTERN = /^([\\da-f]{2})-([\\da-f]{32})-([\\da-f]{16})-([\\da-f]{2})(?:-.*)?$/;\nconst SENTRY_TRACE_PATTERN = /^([\\da-f]{32})-([\\da-f]{16})(?:-([01]))?$/;\n// Datadog 128 位 trace-id 的高 64 位放在 x-datadog-tags 的 _dd.p.tid 里\nconst DATADOG_TRACE_ID_HIGH_PATTERN = /(?:^|,)_dd\\.p\\.tid=([\\da-f]{16})(?:,|$)/;\nconst DATADOG_TRACE_ID_HIGH_DEFAULT = '0000000000000000';\n\n/** OTel 要求 id 为定长小写 hex 且不能全零 */\nconst isValidHexId = (value: string, length: number) =>\n value.length === length && HEX_PATTERN.test(value) && !ZERO_PATTERN.test(value);\n\n// b3 与 Datadog 允许 64 位 trace-id,映射到 OTel 的 128 位时按规范左侧补零\nconst normalizeTraceId = (value: string) => {\n const lower = value.toLowerCase();\n if (isValidHexId(lower, TRACE_ID_LENGTH)) return lower;\n return isValidHexId(lower, SPAN_ID_LENGTH) ? lower.padStart(TRACE_ID_LENGTH, '0') : undefined;\n};\n\nconst normalizeSpanId = (value: string) => {\n const lower = value.toLowerCase();\n return isValidHexId(lower, SPAN_ID_LENGTH) ? lower : undefined;\n};\n\nconst createRandomHexId = (length: number) => {\n const bytes = new Uint8Array(length / 2);\n if (typeof crypto !== 'undefined' && typeof crypto.getRandomValues === 'function') {\n crypto.getRandomValues(bytes);\n } else {\n for (let index = 0; index < bytes.length; index += 1) bytes[index] = Math.floor(Math.random() * 256);\n }\n let hex = '';\n for (const byte of bytes) {\n hex += HEX_DIGITS[byte >> 4] + HEX_DIGITS[byte & 15];\n }\n // 全零是 OTel 的非法 id,概率极低但必须排除\n return ZERO_PATTERN.test(hex) ? `${hex.slice(1)}1` : hex;\n};\n\n/**\n * Datadog 用十进制字符串传 64 位 id。构建目标是 es2015,不能依赖 BigInt,\n * 这里用逐位进位的方式把十进制换算成 16 位 hex。\n */\nconst decimalToHexId = (value: string) => {\n if (!DECIMAL_PATTERN.test(value)) return undefined;\n const nibbles: number[] = [];\n for (let index = 0; index < value.length; index += 1) {\n let carry = value.charCodeAt(index) - 48;\n for (let position = 0; position < nibbles.length; position += 1) {\n const product = nibbles[position] * 10 + carry;\n nibbles[position] = product % 16;\n carry = (product - (product % 16)) / 16;\n }\n while (carry > 0) {\n nibbles.push(carry % 16);\n carry = (carry - (carry % 16)) / 16;\n }\n }\n if (nibbles.length > SPAN_ID_LENGTH) return undefined;\n let hex = '';\n for (let position = nibbles.length - 1; position >= 0; position -= 1) hex += HEX_DIGITS[nibbles[position]];\n return hex.padStart(SPAN_ID_LENGTH, '0');\n};\n\ninterface UpstreamTrace {\n format: BkOTUpstreamTraceFormat;\n /** 命中格式的原始 header,原样写入 Link Attributes */\n headers: Attributes;\n sampled?: boolean;\n /** 规范化后的合法 OTel id;无法映射时两者同时缺失 */\n spanId?: string;\n traceId?: string;\n}\n\n/** 按 header 原名收集实际存在的取值,缺失的不写入 */\nconst collectHeaders = (getHeader: BkOTHeaderReader, names: string[]) => {\n const headers: Attributes = {};\n for (const name of names) {\n const value = getHeader(name)?.trim();\n if (value) headers[name] = value;\n }\n return headers;\n};\n\n/**\n * `traceparent` 与 SDK 注入的是同一个 header,因此格式非法时视作没有既有链路:\n * 这种值后端同样无法接续,覆盖注入比保留它更有价值。\n */\nconst parseTraceparent = (getHeader: BkOTHeaderReader): undefined | UpstreamTrace => {\n const value = getHeader(TRACEPARENT_HEADER)?.trim().toLowerCase();\n if (!value) return undefined;\n const matched = TRACEPARENT_PATTERN.exec(value);\n if (!matched || matched[1] === 'ff') return undefined;\n const [, , traceId, spanId, flags] = matched;\n if (!isValidHexId(traceId, TRACE_ID_LENGTH) || !isValidHexId(spanId, SPAN_ID_LENGTH)) return undefined;\n return {\n format: 'traceparent',\n headers: collectHeaders(getHeader, [TRACEPARENT_HEADER]),\n sampled: (Number.parseInt(flags, 16) & 1) === 1,\n spanId,\n traceId,\n };\n};\n\nconst parseSentryTrace = (getHeader: BkOTHeaderReader): undefined | UpstreamTrace => {\n const value = getHeader('sentry-trace')?.trim().toLowerCase();\n if (!value) return undefined;\n const headers = collectHeaders(getHeader, ['sentry-trace']);\n const matched = SENTRY_TRACE_PATTERN.exec(value);\n if (!matched) return { format: 'sentry-trace', headers };\n const [, traceId, spanId, sampled] = matched;\n return {\n format: 'sentry-trace',\n headers,\n ...(sampled === undefined ? {} : { sampled: sampled === '1' }),\n ...(isValidHexId(traceId, TRACE_ID_LENGTH) && isValidHexId(spanId, SPAN_ID_LENGTH) ? { spanId, traceId } : {}),\n };\n};\n\n// b3 单头:{trace-id}-{span-id}[-{sampling-state}[-{parent-span-id}]],也允许只有 0 / 1 / d\nconst parseB3Single = (getHeader: BkOTHeaderReader): undefined | UpstreamTrace => {\n const value = getHeader('b3')?.trim().toLowerCase();\n if (!value) return undefined;\n const [rawTraceId, rawSpanId, samplingState] = value.split('-');\n const traceId = rawTraceId ? normalizeTraceId(rawTraceId) : undefined;\n const spanId = rawSpanId ? normalizeSpanId(rawSpanId) : undefined;\n return {\n format: 'b3',\n headers: collectHeaders(getHeader, ['b3']),\n ...(traceId && spanId ? { spanId, traceId } : {}),\n ...(samplingState ? { sampled: samplingState === '1' || samplingState === 'd' } : {}),\n };\n};\n\nconst parseB3Multi = (getHeader: BkOTHeaderReader): undefined | UpstreamTrace => {\n const rawTraceId = getHeader('x-b3-traceid')?.trim().toLowerCase();\n const rawSpanId = getHeader('x-b3-spanid')?.trim().toLowerCase();\n const samplingState = getHeader('x-b3-sampled')?.trim().toLowerCase();\n if (!rawTraceId && !rawSpanId && !samplingState) return undefined;\n const traceId = rawTraceId ? normalizeTraceId(rawTraceId) : undefined;\n const spanId = rawSpanId ? normalizeSpanId(rawSpanId) : undefined;\n return {\n format: 'b3-multi',\n headers: collectHeaders(getHeader, [\n 'x-b3-traceid',\n 'x-b3-spanid',\n 'x-b3-parentspanid',\n 'x-b3-sampled',\n 'x-b3-flags',\n ]),\n ...(traceId && spanId ? { spanId, traceId } : {}),\n ...(samplingState ? { sampled: samplingState === '1' || samplingState === 'd' } : {}),\n };\n};\n\nconst parseDatadog = (getHeader: BkOTHeaderReader): undefined | UpstreamTrace => {\n const rawTraceId = getHeader('x-datadog-trace-id')?.trim();\n const rawSpanId = getHeader('x-datadog-parent-id')?.trim();\n const samplingPriority = getHeader('x-datadog-sampling-priority')?.trim();\n if (!rawTraceId && !rawSpanId && !samplingPriority) return undefined;\n const tags = getHeader('x-datadog-tags')?.trim().toLowerCase();\n const traceIdHigh =\n (tags ? DATADOG_TRACE_ID_HIGH_PATTERN.exec(tags)?.[1] : undefined) ?? DATADOG_TRACE_ID_HIGH_DEFAULT;\n const traceIdLow = rawTraceId ? decimalToHexId(rawTraceId) : undefined;\n const traceId = traceIdLow ? normalizeTraceId(`${traceIdHigh}${traceIdLow}`) : undefined;\n const spanIdHex = rawSpanId ? decimalToHexId(rawSpanId) : undefined;\n const spanId = spanIdHex ? normalizeSpanId(spanIdHex) : undefined;\n return {\n format: 'datadog',\n headers: collectHeaders(getHeader, [\n 'x-datadog-trace-id',\n 'x-datadog-parent-id',\n 'x-datadog-sampling-priority',\n 'x-datadog-origin',\n 'x-datadog-tags',\n ]),\n ...(traceId && spanId ? { spanId, traceId } : {}),\n ...(samplingPriority ? { sampled: Number(samplingPriority) > 0 } : {}),\n };\n};\n\n/**\n * sw8:{sample}-{trace-id}-{segment-id}-{span-id}-{service}-{instance}-{endpoint}-{peer},\n * 其中 trace-id 与 segment-id 是 base64 后的 SkyWalking id。它们不是 16 字节 hex,无法映射为\n * 合法的 OTel SpanContext,因此不产出 traceId/spanId,由调用方补占位 id。\n */\nconst parseSw8 = (getHeader: BkOTHeaderReader): undefined | UpstreamTrace => {\n const value = getHeader('sw8')?.trim();\n if (!value) return undefined;\n const samplingState = value.split('-')[0];\n return {\n format: 'sw8',\n headers: collectHeaders(getHeader, ['sw8']),\n ...(samplingState ? { sampled: samplingState === '1' } : {}),\n };\n};\n\n// 按格式明确度排序:先看与 SDK 同名的 traceparent,再看其他厂商格式\nconst UPSTREAM_PARSERS = [parseTraceparent, parseSentryTrace, parseB3Single, parseB3Multi, parseDatadog, parseSw8];\n\nexport const detectUpstreamTrace = (getHeader: BkOTHeaderReader) => {\n for (const parse of UPSTREAM_PARSERS) {\n const upstream = parse(getHeader);\n if (upstream) return upstream;\n }\n return undefined;\n};\n\nconst toLink = (traceId: string, spanId: string, attributes: Attributes, sampled?: boolean): Link => ({\n attributes,\n context: {\n spanId,\n traceFlags: sampled === false ? TraceFlags.NONE : TraceFlags.SAMPLED,\n traceId,\n },\n});\n\nexport const planRequestTrace = (getHeader: BkOTHeaderReader): BkOTRequestTracePlan => {\n const upstream = detectUpstreamTrace(getHeader);\n if (!upstream) {\n // 与 RUM Span 无关的独立 trace,保证后端按 trace-id 检索时只命中这一个 API 请求\n const traceId = createRandomHexId(TRACE_ID_LENGTH);\n const spanId = createRandomHexId(SPAN_ID_LENGTH);\n const traceparent = `00-${traceId}-${spanId}-01`;\n return {\n links: [toLink(traceId, spanId, { format: 'traceparent', injected: true, [TRACEPARENT_HEADER]: traceparent })],\n traceparent,\n };\n }\n // sw8 等格式解析不出合法 OTel id,补占位 id 让 Link 结构统一;此时不注入,后端不会有对应 trace\n return {\n links: [\n toLink(\n upstream.traceId ?? createRandomHexId(TRACE_ID_LENGTH),\n upstream.spanId ?? createRandomHexId(SPAN_ID_LENGTH),\n // injected 恒定写出:业务自带的合法 traceparent 与 SDK 注入的 format 同值,只靠 format 无法区分\n { format: upstream.format, injected: false, ...upstream.headers },\n upstream.sampled,\n ),\n ],\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { SpanKind } from '@opentelemetry/api';\n\nimport { notifyRequestTiming } from '../core/request-timing';\nimport { shouldIgnoreUrl } from '../core/url';\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\nimport { buildRumResourceSpanAttributes } from '../schema/span';\n\nimport type { BkOTPlugin } from '../core/plugin';\n\n/**\n * Resource Timing 的统一消费端:静态资源按配置生成 span;Fetch/XHR timing 转交 request 插件,\n * 与其已创建的请求 span 合并,避免同一次网络请求重复计数。\n */\ntype ResourceTimingWithStatus = PerformanceResourceTiming & {\n deliveryType?: string;\n renderBlockingStatus?: string;\n responseStatus?: number;\n};\n\nconst getCacheHit = (entry: ResourceTimingWithStatus) =>\n entry.deliveryType === 'cache' || (entry.transferSize === 0 && entry.decodedBodySize > 0) ? true : undefined;\n\nconst hasUnavailableResourceDetails = (entry: ResourceTimingWithStatus) =>\n entry.transferSize === 0 &&\n entry.encodedBodySize === 0 &&\n entry.decodedBodySize === 0 &&\n entry.requestStart === 0 &&\n entry.responseStart === 0 &&\n !entry.nextHopProtocol;\n\nconst areInOrder = (...values: number[]) => values.every((value, index) => index === 0 || values[index - 1] <= value);\n\nconst setTiming = (attributes: Record<string, number>, name: string, origin: number, start: number, end: number) => {\n if (!areInOrder(origin, start, end)) return;\n attributes[`resource.${name}.start`] = start - origin;\n attributes[`resource.${name}.duration`] = end - start;\n};\n\nexport const getResourceTimingAttributes = (entry: ResourceTimingWithStatus) => {\n const attributes: Record<string, number> = {};\n const commonTimings = [\n entry.startTime,\n entry.fetchStart,\n entry.domainLookupStart,\n entry.domainLookupEnd,\n entry.connectStart,\n entry.connectEnd,\n entry.requestStart,\n entry.responseStart,\n entry.responseEnd,\n ];\n // 浏览器因 TAO 或实现差异可能返回缺失/乱序时间点;整组校验可避免产生负 duration。\n if (!commonTimings.every(Number.isFinite) || !areInOrder(...commonTimings)) return attributes;\n\n setTiming(attributes, 'first_byte', entry.startTime, entry.requestStart, entry.responseStart);\n setTiming(attributes, 'download', entry.startTime, entry.responseStart, entry.responseEnd);\n if (entry.workerStart > 0 && entry.workerStart < entry.fetchStart) {\n setTiming(attributes, 'worker', entry.startTime, entry.workerStart, entry.fetchStart);\n }\n if (entry.fetchStart < entry.domainLookupEnd) {\n setTiming(attributes, 'dns', entry.startTime, entry.domainLookupStart, entry.domainLookupEnd);\n }\n if (entry.fetchStart < entry.connectEnd) {\n setTiming(attributes, 'connect', entry.startTime, entry.connectStart, entry.connectEnd);\n if (entry.connectStart <= entry.secureConnectionStart && entry.secureConnectionStart <= entry.connectEnd) {\n setTiming(attributes, 'ssl', entry.startTime, entry.secureConnectionStart, entry.connectEnd);\n }\n }\n if (\n entry.redirectEnd > entry.startTime &&\n areInOrder(entry.startTime, entry.redirectStart, entry.redirectEnd, entry.fetchStart)\n ) {\n setTiming(attributes, 'redirect', entry.startTime, entry.redirectStart, entry.redirectEnd);\n }\n return attributes;\n};\n\nexport const getResourceDuration = (entry: ResourceTimingWithStatus) =>\n entry.duration === 0 && entry.responseEnd > entry.startTime ? entry.responseEnd - entry.startTime : entry.duration;\n\nexport const getResourcePerformanceAttributes = (entry: ResourceTimingWithStatus) => {\n const detailsUnavailable = hasUnavailableResourceDetails(entry);\n const deliveryType = typeof entry.deliveryType === 'string' && entry.deliveryType ? entry.deliveryType : undefined;\n return {\n [RUM_ATTRIBUTES.cacheHit]: getCacheHit(entry),\n ...(entry.nextHopProtocol ? { [RUM_ATTRIBUTES.nextHopProtocol]: entry.nextHopProtocol } : {}),\n ...getResourceTimingAttributes(entry),\n ...(deliveryType ? { 'resource.delivery_type': deliveryType } : {}),\n ...(entry.renderBlockingStatus ? { 'resource.render_blocking_status': entry.renderBlockingStatus } : {}),\n ...(detailsUnavailable\n ? {}\n : {\n // 对齐 Datadog:resource.size 取解压后 body 体积,缓存命中也能反映真实大小;\n // 网络传输量单独用 resource.transfer_size 表达(受缓存/TAO 影响可能为 0)。\n 'resource.size': entry.decodedBodySize,\n 'resource.encoded_body_size': entry.encodedBodySize,\n 'resource.decoded_body_size': entry.decodedBodySize,\n 'resource.transfer_size': entry.transferSize,\n }),\n };\n};\n\nexport const createResourcePlugin = (emitResourceSpans = true): BkOTPlugin => {\n let observer: PerformanceObserver | undefined;\n\n return {\n name: 'resource',\n init(context) {\n if (typeof PerformanceObserver === 'undefined') {\n return;\n }\n if (!PerformanceObserver.supportedEntryTypes?.includes('resource')) {\n return;\n }\n\n const emitEntry = (entry: ResourceTimingWithStatus) => {\n if (!context.isSampled()) return;\n if (!entry.name || shouldIgnoreUrl(context.config, entry.name)) {\n return;\n }\n if (entry.initiatorType === 'fetch' || entry.initiatorType === 'xmlhttprequest') {\n // Fetch/XHR 已由 request 插件建 span;这里只把 ResourceTiming 回传补齐网络阶段,避免重复上报。\n notifyRequestTiming(entry);\n return;\n }\n if (entry.duration < 0) return;\n const redactedUrl = context.config.hooks.redactUrl(entry.name);\n const duration = getResourceDuration(entry);\n const startTime = performance.timeOrigin + entry.startTime;\n const endTime = startTime + duration;\n if (emitResourceSpans && context.isSampled()) {\n const span = context.startSpan(\n 'browser.resource',\n {\n ...context.config.hooks.getPageAttributes(),\n ...buildRumResourceSpanAttributes({\n initiatorType: entry.initiatorType || 'other',\n outcome:\n typeof entry.responseStatus === 'number'\n ? { statusCode: entry.responseStatus, type: 'response' }\n : undefined,\n url: redactedUrl,\n }),\n 'url.full': redactedUrl,\n 'url.template': context.config.hooks.getRequestUrlTemplate(redactedUrl),\n ...getResourcePerformanceAttributes(entry),\n },\n { kind: SpanKind.CLIENT, startTime },\n );\n span.end(endTime);\n }\n context.notifyActivity({ endTime, startTime, type: 'resource', url: entry.name });\n };\n\n try {\n observer = new PerformanceObserver(list => {\n for (const entry of list.getEntries() as ResourceTimingWithStatus[]) {\n emitEntry(entry);\n }\n });\n observer.observe({ type: 'resource', buffered: true });\n } catch {\n observer = undefined;\n }\n },\n shutdown() {\n observer?.disconnect();\n observer = undefined;\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n */\n\n/**\n * Fetch/XHR 请求统一采集入口。\n *\n * 同一层 patch 负责请求 span、Trace Header、页面活动与 beforeSend,避免多套 patch\n * 重复计数,也不依赖 OpenTelemetry instrumentation 的私有方法。\n */\n\nimport { SpanKind, SpanStatusCode } from '@opentelemetry/api';\n\nimport { createRandomId } from '../core/id';\nimport { markSpanDiscarded } from '../core/processor';\nimport { trackRequestTiming } from '../core/request-timing';\nimport { planRequestTrace, TRACEPARENT_HEADER } from '../core/trace-context';\nimport {\n matchesUrlList,\n shouldIgnoreRequest,\n shouldIgnoreUrl,\n shouldPropagateTraceHeader,\n toAbsoluteUrl,\n} from '../core/url';\nimport { buildRumResourceSpanAttributes } from '../schema/span';\nimport { getResourceDuration, getResourcePerformanceAttributes } from './resource';\n\nimport type { BkOTRequestConfig, BkOTRequestContext, BkOTRequestOutcome } from '../core/config';\nimport type { BkOTPlugin, BkOTRuntimeContext } from '../core/plugin';\nimport type { BkOTHeaderReader, BkOTRequestTracePlan } from '../core/trace-context';\nimport type { Attributes, Span } from '@opentelemetry/api';\n\ninterface RequestDetails {\n method?: string;\n startedAt?: number;\n url?: string;\n}\n\nconst getRequestOptions = (context: BkOTRuntimeContext) =>\n typeof context.config.tracking.request === 'object' ? context.config.tracking.request : undefined;\n\n// 没有白名单时不会注入任何 header,也就不需要为探测既有 trace header 付出 patch 成本。\nconst hasTracingAllowlist = (context: BkOTRuntimeContext) => {\n const allowed = getRequestOptions(context)?.allowedTracingUrls;\n return Array.isArray(allowed) ? allowed.length > 0 : allowed !== undefined;\n};\n\nconst getErrorName = (error: unknown) =>\n typeof error === 'object' && error && 'name' in error && typeof error.name === 'string' ? error.name : '';\n\nconst getFetchFailureOutcome = (requestContext: Request | RequestInit, error: unknown): BkOTRequestOutcome => {\n const signal = requestContext.signal;\n if (getErrorName(signal?.reason) === 'TimeoutError' || getErrorName(error) === 'TimeoutError') {\n return { error, type: 'timeout' };\n }\n if (signal?.aborted || getErrorName(error) === 'AbortError') return { type: 'abort' };\n return { error, type: 'network_error' };\n};\n\nconst getXhrOutcome = (\n completionType: 'abort' | 'error' | 'load' | 'timeout',\n xhr: XMLHttpRequest,\n): BkOTRequestOutcome => {\n if (completionType === 'abort') return { type: 'abort' };\n if (completionType === 'timeout') return { type: 'timeout' };\n if (completionType === 'error' || xhr.status === 0) return { type: 'network_error' };\n return { statusCode: xhr.status, type: 'response' };\n};\n\nconst isErrorOutcome = (outcome: BkOTRequestOutcome) =>\n outcome.type === 'network_error' ||\n outcome.type === 'timeout' ||\n (outcome.type === 'response' && typeof outcome.statusCode === 'number' && outcome.statusCode >= 400);\n\nconst getFetchUrl = (input: RequestInfo | URL) => {\n if (typeof input === 'string' || input instanceof URL) return toAbsoluteUrl(String(input));\n return toAbsoluteUrl(input.url);\n};\n\nconst getFetchMethod = (input: RequestInfo | URL, init?: RequestInit) =>\n (init?.method ?? (typeof Request !== 'undefined' && input instanceof Request ? input.method : 'GET')).toUpperCase();\n\nconst getFetchRequestContext = (input: RequestInfo | URL, init?: RequestInit): Request | RequestInit =>\n typeof Request !== 'undefined' && input instanceof Request ? input : (init ?? {});\n\n/** 取本次请求最终会发出的 header 集合:init.headers 一旦存在就会整体覆盖 Request 上的 header。 */\nconst getFetchRequestHeaders = (input: RequestInfo | URL, init: RequestInit | undefined) => {\n const requestHeaders = typeof Request !== 'undefined' && input instanceof Request ? input.headers : undefined;\n return new Headers(init?.headers ?? requestHeaders);\n};\n\nconst applyFetchTracePlan = (init: RequestInit | undefined, headers: Headers, plan: BkOTRequestTracePlan) => {\n if (!plan.traceparent) return init;\n headers.set(TRACEPARENT_HEADER, plan.traceparent);\n return { ...init, headers };\n};\n\nconst createHeaderReader =\n (headers: Record<string, string> | undefined): BkOTHeaderReader =>\n name =>\n headers?.[name.toLowerCase()];\n\nconst isActivityExcluded = (context: BkOTRuntimeContext, url: string) =>\n shouldIgnoreUrl(context.config, url) || matchesUrlList(context.config.view.excludedActivityUrls, url);\n\nconst startRequestActivity = (context: BkOTRuntimeContext, url: string) => {\n if (isActivityExcluded(context, url)) return () => {};\n const id = createRandomId('request');\n context.notifyActivity({ id, time: Date.now(), type: 'request_start', url });\n let ended = false;\n return () => {\n if (ended) return;\n ended = true;\n context.notifyActivity({ id, time: Date.now(), type: 'request_end' });\n };\n};\n\nconst trackRequestSpanTiming = (context: BkOTRuntimeContext, url: string) =>\n !context.isSampled()\n ? {\n cancel() {},\n complete(callback: (entry?: PerformanceResourceTiming) => void) {\n callback();\n },\n }\n : trackRequestTiming(url);\n\nconst startRequestSpan = (\n context: BkOTRuntimeContext,\n subtype: 'fetch' | 'xhr',\n details: RequestDetails,\n tracePlan?: BkOTRequestTracePlan,\n) => {\n const startedAt = details.startedAt ?? Date.now();\n return context.startSpan(\n 'browser.resource',\n {\n ...context.config.hooks.getPageAttributes(),\n ...buildRumResourceSpanAttributes({\n initiatorType: subtype,\n method: details.method,\n url: details.url ?? '',\n }),\n ...(details.url\n ? {\n 'url.full': context.config.hooks.redactUrl(details.url),\n 'url.template': context.config.hooks.getRequestUrlTemplate(details.url),\n }\n : {}),\n },\n {\n kind: SpanKind.CLIENT,\n startTime: startedAt,\n ...(tracePlan ? { links: tracePlan.links } : {}),\n },\n );\n};\n\nexport const decorateRequestSpan = (\n context: BkOTRuntimeContext,\n span: Span,\n subtype: 'fetch' | 'xhr',\n domainContext: BkOTRequestContext,\n outcome: BkOTRequestOutcome,\n details: RequestDetails = {},\n) => {\n const sourceUrl = details.url;\n const redactedUrl = sourceUrl ? context.config.hooks.redactUrl(sourceUrl) : undefined;\n const method = details.method;\n const attributes: Attributes = {\n ...context.config.hooks.getPageAttributes(),\n ...buildRumResourceSpanAttributes({\n initiatorType: subtype,\n method,\n outcome,\n url: redactedUrl ?? '',\n }),\n ...(redactedUrl ? { 'url.full': redactedUrl } : {}),\n // 模板由原始 URL 推导:Hook 可能需要 query 才能判断路由,产出的模板本身是低基数的\n ...(sourceUrl ? { 'url.template': context.config.hooks.getRequestUrlTemplate(sourceUrl) } : {}),\n };\n\n const event = {\n attributes,\n resource: {\n method,\n outcome,\n transport: subtype,\n url: redactedUrl,\n },\n type: 'resource' as const,\n };\n let shouldSend: boolean | void = true;\n try {\n shouldSend = getRequestOptions(context)?.beforeSend?.(event, domainContext);\n } catch (error) {\n if (context.config.debug) globalThis.console?.warn('[bk-ot] request.beforeSend failed:', error);\n }\n span.setAttributes(context.applyRedact(event.attributes));\n if (shouldSend === false) {\n // SpanProcessor 在 onEnd 统一识别内部状态,避免这里绕过正常的 span 结束流程。\n markSpanDiscarded(span);\n return;\n }\n if (isErrorOutcome(outcome)) span.setStatus({ code: SpanStatusCode.ERROR });\n};\n\nexport const createCommonInstrumentationsPlugin = (option: BkOTRequestConfig | boolean | undefined): BkOTPlugin => {\n const teardownCallbacks: Array<() => void> = [];\n const activeRequestEnds = new Set<() => void>();\n\n return {\n name: 'request',\n enabled: option !== false,\n init(context) {\n if (typeof window === 'undefined') return;\n\n if (typeof window.fetch === 'function') {\n const originalFetch = window.fetch;\n const patchedFetch: typeof window.fetch = async function (this: Window, input, init) {\n const url = getFetchUrl(input);\n if (!context.isSampled() || shouldIgnoreRequest(context.config, url))\n return originalFetch.call(this, input, init);\n const method = getFetchMethod(input, init);\n const details = { method, startedAt: Date.now(), url };\n // Span Link 必须在创建 span 时给出,因此先规划 trace context 再建 span。\n const headers = shouldPropagateTraceHeader(context.config, url)\n ? getFetchRequestHeaders(input, init)\n : undefined;\n const tracePlan = headers ? planRequestTrace(name => headers.get(name) ?? undefined) : undefined;\n const span = startRequestSpan(context, 'fetch', details, tracePlan);\n const timing = trackRequestSpanTiming(context, url);\n const endActivity = startRequestActivity(context, url);\n const requestContext = getFetchRequestContext(input, init);\n const requestInit = headers && tracePlan ? applyFetchTracePlan(init, headers, tracePlan) : init;\n let ended = false;\n const endSpan = (entry?: PerformanceResourceTiming, fallbackEndTime = Date.now()) => {\n if (ended) return;\n ended = true;\n activeRequestEnds.delete(forceEnd);\n if (entry) {\n span.setAttributes(context.applyRedact(getResourcePerformanceAttributes(entry)));\n span.end(performance.timeOrigin + entry.startTime + getResourceDuration(entry));\n return;\n }\n span.end(fallbackEndTime);\n };\n const forceEnd = () => {\n // shutdown 不再等待异步 ResourceTiming,立即结束仍在飞行中的 span。\n timing.cancel();\n endSpan();\n };\n activeRequestEnds.add(forceEnd);\n try {\n const response = await originalFetch.call(this, input, requestInit);\n const outcome: BkOTRequestOutcome = {\n ...(response.status > 0 ? { statusCode: response.status } : {}),\n type: 'response',\n };\n decorateRequestSpan(\n context,\n span,\n 'fetch',\n { request: requestContext, response, type: 'fetch' },\n outcome,\n details,\n );\n const completedAt = Date.now();\n timing.complete(entry => endSpan(entry, completedAt));\n return response;\n } catch (error) {\n const outcome = getFetchFailureOutcome(requestContext, error);\n decorateRequestSpan(\n context,\n span,\n 'fetch',\n { error, request: requestContext, type: 'fetch' },\n outcome,\n details,\n );\n if (outcome.type !== 'abort' && error instanceof Error) span.recordException(error);\n const completedAt = Date.now();\n timing.complete(entry => endSpan(entry, completedAt));\n throw error;\n } finally {\n endActivity();\n }\n };\n window.fetch = patchedFetch;\n teardownCallbacks.push(() => {\n if (window.fetch === patchedFetch) window.fetch = originalFetch;\n });\n }\n\n if (typeof XMLHttpRequest !== 'undefined') {\n const requests = new WeakMap<XMLHttpRequest, RequestDetails>();\n // 浏览器不提供读取 XHR 请求头的 API,只能自己快照业务设置的 header 以便探测既有链路。\n const authorHeaders = new WeakMap<XMLHttpRequest, Record<string, string>>();\n const originalOpen = XMLHttpRequest.prototype.open;\n const originalSend = XMLHttpRequest.prototype.send;\n const patchedOpen: typeof XMLHttpRequest.prototype.open = function (\n this: XMLHttpRequest,\n method: string,\n url: string | URL,\n async = true,\n username?: null | string,\n password?: null | string,\n ) {\n requests.set(this, { method: method.toUpperCase(), url: toAbsoluteUrl(String(url)) });\n // open() 会清空已设置的请求头,快照必须同步失效。\n authorHeaders.delete(this);\n return originalOpen.call(this, method, String(url), async, username, password);\n };\n const patchedSend: typeof XMLHttpRequest.prototype.send = function (this: XMLHttpRequest, body) {\n const details = requests.get(this) ?? {};\n if (!context.isSampled() || !details.url || shouldIgnoreRequest(context.config, details.url))\n return originalSend.call(this, body);\n details.startedAt = Date.now();\n const tracePlan = shouldPropagateTraceHeader(context.config, details.url)\n ? planRequestTrace(createHeaderReader(authorHeaders.get(this)))\n : undefined;\n const span = startRequestSpan(context, 'xhr', details, tracePlan);\n const timing = trackRequestSpanTiming(context, details.url);\n const endActivity = startRequestActivity(context, details.url);\n if (tracePlan?.traceparent) this.setRequestHeader(TRACEPARENT_HEADER, tracePlan.traceparent);\n let finishing = false;\n let ended = false;\n let removeTerminalListeners = () => {};\n const forceEnd = () => {\n // XHR 可能永不触发终止事件;SDK 停止时必须清理活动计数并结束 span。\n removeTerminalListeners();\n timing.cancel();\n if (ended) return;\n ended = true;\n activeRequestEnds.delete(forceEnd);\n endActivity();\n span.end();\n };\n activeRequestEnds.add(forceEnd);\n const complete = (completionType: 'abort' | 'error' | 'load' | 'timeout') => {\n if (finishing || ended) return;\n finishing = true;\n removeTerminalListeners();\n const outcome = getXhrOutcome(completionType, this);\n decorateRequestSpan(context, span, 'xhr', { type: 'xhr', xhr: this }, outcome, details);\n endActivity();\n const completedAt = Date.now();\n timing.complete(entry => {\n if (ended) return;\n ended = true;\n activeRequestEnds.delete(forceEnd);\n if (entry) {\n span.setAttributes(context.applyRedact(getResourcePerformanceAttributes(entry)));\n span.end(performance.timeOrigin + entry.startTime + getResourceDuration(entry));\n return;\n }\n span.end(completedAt);\n });\n };\n const onAbort = () => complete('abort');\n const onError = () => complete('error');\n const onLoad = () => complete('load');\n const onTimeout = () => complete('timeout');\n removeTerminalListeners = () => {\n this.removeEventListener('abort', onAbort);\n this.removeEventListener('error', onError);\n this.removeEventListener('load', onLoad);\n this.removeEventListener('timeout', onTimeout);\n };\n this.addEventListener('abort', onAbort, { once: true });\n this.addEventListener('error', onError, { once: true });\n this.addEventListener('load', onLoad, { once: true });\n this.addEventListener('timeout', onTimeout, { once: true });\n try {\n return originalSend.call(this, body);\n } catch (error) {\n if (error instanceof Error) span.recordException(error);\n complete('error');\n throw error;\n }\n };\n XMLHttpRequest.prototype.open = patchedOpen;\n XMLHttpRequest.prototype.send = patchedSend;\n teardownCallbacks.push(() => {\n if (XMLHttpRequest.prototype.open === patchedOpen) XMLHttpRequest.prototype.open = originalOpen;\n if (XMLHttpRequest.prototype.send === patchedSend) XMLHttpRequest.prototype.send = originalSend;\n });\n\n if (hasTracingAllowlist(context) && typeof XMLHttpRequest.prototype.setRequestHeader === 'function') {\n const originalSetRequestHeader = XMLHttpRequest.prototype.setRequestHeader;\n const patchedSetRequestHeader: typeof XMLHttpRequest.prototype.setRequestHeader = function (\n this: XMLHttpRequest,\n name: string,\n value: string,\n ) {\n const key = name.toLowerCase();\n const headers = authorHeaders.get(this) ?? {};\n // 浏览器对重复设置的同名 header 做 \", \" 合并,快照保持一致才能正确解析。\n headers[key] = key in headers ? `${headers[key]}, ${value}` : value;\n authorHeaders.set(this, headers);\n return originalSetRequestHeader.call(this, name, value);\n };\n XMLHttpRequest.prototype.setRequestHeader = patchedSetRequestHeader;\n teardownCallbacks.push(() => {\n if (XMLHttpRequest.prototype.setRequestHeader === patchedSetRequestHeader)\n XMLHttpRequest.prototype.setRequestHeader = originalSetRequestHeader;\n });\n }\n }\n },\n shutdown() {\n for (const end of [...activeRequestEnds]) end();\n while (teardownCallbacks.length) teardownCallbacks.pop()?.();\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { buildRumSpanAttributes, RUM_SPAN_OUTCOME, RUM_SPAN_TYPE } from '../schema/span';\n\nimport type { BkOTPlugin } from '../core/plugin';\n\n// blockedURI 除了 URL 还可能是 'inline' / 'eval' / 'wasm-eval' / 'self' 等关键字(CSP spec),\n// 这些不是 URL,不应该走 redactUrl\nconst URL_LIKE_BLOCKED_URI = /^https?:|^\\/\\//i;\n\nconst redactBlockedUri = (redactUrl: (url: string) => string, blockedURI: string | undefined) => {\n if (!blockedURI) return undefined;\n return URL_LIKE_BLOCKED_URI.test(blockedURI) ? redactUrl(blockedURI) : blockedURI;\n};\n\n/**\n * CSP 违规事件采集插件,通过监听 `securitypolicyviolation` 事件捕获被 CSP 策略拦截的脚本/资源,\n * 以 error span 上报,进入统一错误分析口径。\n *\n * URL 处理:\n * - `blockedURI` / `sourceFile` 中的 URL 类值会经 `redactUrl` 脱敏。\n * - `blockedURI` 是 'inline' / 'eval' 等 CSP 关键字时直接保留,不调用 redactUrl。\n */\nexport const createCspViolationPlugin = (): BkOTPlugin => {\n let teardown: (() => void) | undefined;\n\n return {\n name: 'csp-violation',\n init(context) {\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n return;\n }\n\n const handler = (event: SecurityPolicyViolationEvent) => {\n if (!context.isSampled()) return;\n const occurredAt = Date.now();\n const blockedUri = redactBlockedUri(context.config.hooks.redactUrl, event.blockedURI);\n const sourceFile = event.sourceFile ? context.config.hooks.redactUrl(event.sourceFile) : undefined;\n\n const span = context.startSpan(\n 'csp.violation',\n {\n ...context.config.hooks.getPageAttributes(),\n ...buildRumSpanAttributes({\n outcome: RUM_SPAN_OUTCOME.error,\n spanType: RUM_SPAN_TYPE.error,\n }),\n 'csp.blocked_uri': blockedUri,\n 'csp.violated_directive': event.violatedDirective,\n 'csp.effective_directive': event.effectiveDirective,\n 'csp.disposition': event.disposition,\n 'csp.source_file': sourceFile,\n 'csp.line_number': event.lineNumber,\n 'csp.column_number': event.columnNumber,\n 'csp.status_code': event.statusCode,\n 'csp.original_policy': event.originalPolicy,\n 'error.source': 'csp',\n },\n { startTime: occurredAt },\n );\n span.end(occurredAt);\n };\n\n document.addEventListener('securitypolicyviolation', handler);\n teardown = () => document.removeEventListener('securitypolicyviolation', handler);\n },\n shutdown() {\n teardown?.();\n teardown = undefined;\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n */\n\n/** 非密码学稳定 hash,仅用于生成浏览器本地 storage key。 */\nexport const hashString = (input: string): string => {\n let hash = 5381;\n for (let index = 0; index < input.length; index++) {\n hash = (hash * 33) ^ input.charCodeAt(index);\n }\n return (hash >>> 0).toString(36);\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { hashString } from '../core/hash';\nimport { createRandomId } from '../core/id';\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\n\nimport type { BkOTPlugin } from '../core/plugin';\nimport type { Attributes } from '@opentelemetry/api';\n\nexport interface BkOTDevicePluginOptions {\n /** 是否跨页面持久化匿名设备 ID,默认 false。 */\n persistentId?: boolean;\n storageKey?: string;\n}\n\nconst DEFAULT_DEVICE_STORAGE_KEY = 'BK_RUM_DEVICE_ID';\n// 用户拖窗口时 resize 高频触发,debounce 静默期内只在最后一次更新,避免无谓的 setRuntimeAttributes 风暴\nconst VIEWPORT_DEBOUNCE_MS = 250;\n\ninterface NetworkInformationLike {\n effectiveType?: string;\n type?: string;\n addEventListener?: (type: 'change', listener: () => void) => void;\n removeEventListener?: (type: 'change', listener: () => void) => void;\n}\n\ninterface UserAgentDataLike {\n mobile?: boolean;\n platform?: string;\n}\n\nconst getConnection = (): NetworkInformationLike | undefined =>\n (\n navigator as Navigator & {\n connection?: NetworkInformationLike;\n }\n ).connection;\n\nconst getUserAgentData = (): undefined | UserAgentDataLike =>\n (\n navigator as Navigator & {\n userAgentData?: UserAgentDataLike;\n }\n ).userAgentData;\n\nconst getBrowserInfo = (ua: string) => {\n const matchers: Array<[string, RegExp]> = [\n ['Edge', /Edg\\/([\\d.]+)/],\n ['Chrome', /Chrome\\/([\\d.]+)/],\n ['Firefox', /Firefox\\/([\\d.]+)/],\n ['Safari', /Version\\/([\\d.]+).*Safari/],\n ];\n for (const [name, pattern] of matchers) {\n const matched = ua.match(pattern);\n if (matched?.[1]) {\n return { name, version: matched[1].split('.')[0] };\n }\n }\n return { name: 'Other', version: undefined };\n};\n\nconst getOsName = (ua: string, platform?: string) => {\n const value = `${platform ?? ''} ${ua}`;\n if (/iphone|ipad|ipod/i.test(value)) return 'iOS';\n if (/android/i.test(value)) return 'Android';\n if (/mac/i.test(value)) return 'macOS';\n if (/win/i.test(value)) return 'Windows';\n if (/linux/i.test(value)) return 'Linux';\n return 'Other';\n};\n\nconst readDeviceId = (storageKey: string) => {\n let existed: null | string = null;\n try {\n existed = window.localStorage.getItem(storageKey);\n } catch {\n /* localStorage 不可用(隐私模式 / sandbox iframe),下面会创建一个 in-memory id */\n }\n if (existed) {\n return existed;\n }\n const deviceId = createRandomId('device');\n try {\n window.localStorage.setItem(storageKey, deviceId);\n } catch {\n /* 写不进去也行,至少本次 SDK 生命周期内 deviceId 仍然稳定 */\n }\n return deviceId;\n};\n\n// 视口尺寸:随窗口大小 / 屏幕旋转变化,需要在 resize / orientationchange 时刷新\nconst getViewportAttributes = (): Attributes => {\n if (typeof window === 'undefined') {\n return {};\n }\n return {\n 'browser.viewport.width': window.innerWidth,\n 'browser.viewport.height': window.innerHeight,\n 'browser.screen.width': window.screen?.width,\n 'browser.screen.height': window.screen?.height,\n };\n};\n\n// 网络信息:随 online / offline / connection.change 变化\nconst getNetworkAttributes = (): Attributes => {\n if (typeof navigator === 'undefined') {\n return {};\n }\n const connection = getConnection();\n return {\n [RUM_ATTRIBUTES.networkStatus]: navigator.onLine ? 'connected' : 'not_connected',\n 'network.effective_type': connection?.effectiveType,\n 'network.connection.type': connection?.type,\n };\n};\n\n// 设备与 User Agent 信息:进入页面时一次性读取,运行期不会变化,适合作为 Resource 公共属性。\nexport const getDeviceResourceAttributes = (): Attributes => {\n if (typeof navigator === 'undefined') {\n return {};\n }\n const uaData = getUserAgentData();\n const ua = navigator.userAgent;\n const browser = getBrowserInfo(ua);\n const osName = getOsName(ua, uaData?.platform);\n const deviceType = uaData?.mobile || /mobi|android|iphone|ipad|ipod/i.test(ua) ? 'mobile' : 'desktop';\n return {\n [RUM_ATTRIBUTES.deviceType]: deviceType,\n [RUM_ATTRIBUTES.userAgentName]: browser.name,\n [RUM_ATTRIBUTES.userAgentVersion]: browser.version,\n [RUM_ATTRIBUTES.userAgentOsName]: osName,\n };\n};\n\n// trailing debounce:windowMs 静默期内的多次触发只执行最后一次。\n// 适合 resize 这类\"用户停下来后才需要拿到最终值\"的场景。\nconst createDebounce = (fn: () => void, windowMs: number) => {\n let timer: number | undefined;\n return () => {\n if (timer !== undefined) {\n window.clearTimeout(timer);\n }\n timer = window.setTimeout(() => {\n timer = undefined;\n fn();\n }, windowMs);\n };\n};\n\n/**\n * 设备元数据采集插件。稳定的设备能力由 SDK 写入 Resource;这里只维护设备 ID 和运行期动态属性。\n *\n * 上报字段:\n * - `device.id`:设备级永久标识,存于 localStorage(默认 key 复用旧 session 插件以保留现网用户)。\n * - `user_agent.name` / `user_agent.version` / `user_agent.os.name`:User Agent 信息,写入 Resource。\n * - `browser.viewport.*` / `browser.screen.*`:视口与屏幕尺寸。\n * - `network.status` / `network.effective_type` / `network.connection.type`:网络信息。\n *\n * 实时更新:\n * - viewport 监听 `resize` / `orientationchange`,并经 250ms debounce 合并,避免拖窗口时高频触发;\n * 静默期结束后用最终值刷新 runtimeAttributes。\n * - network 监听 `online` / `offline` / `connection.change`(本身低频,不需要 throttle)。\n * - 二者只更新 in-memory 的 runtimeAttributes,不会主动产生新的 Span;\n * 更新后续生成的 Span 会带最新值。\n *\n * 与 session 插件的关系:device 跨会话持久(终身),session 有过期与续期(连续访问语义)。\n */\nexport const createDevicePlugin = (options: BkOTDevicePluginOptions = {}): BkOTPlugin => {\n const teardownCallbacks: Array<() => void> = [];\n return {\n name: 'device',\n init(context) {\n const storageKey =\n options.storageKey ?? `${DEFAULT_DEVICE_STORAGE_KEY}_${hashString(context.config.application.name)}`;\n const deviceId =\n typeof window === 'undefined' || options.persistentId !== true\n ? createRandomId('device')\n : readDeviceId(storageKey);\n\n context.setRuntimeAttributes({\n 'device.id': deviceId,\n // createDevicePlugin 作为扩展单独启用时,Resource 没有设备字段,仍回退到原有 runtime attributes 行为。\n ...(context.config.tracking.device === false ? getDeviceResourceAttributes() : {}),\n ...getViewportAttributes(),\n ...getNetworkAttributes(),\n });\n\n if (typeof window === 'undefined') {\n return;\n }\n\n const refreshViewport = createDebounce(() => {\n context.setRuntimeAttributes(getViewportAttributes());\n }, VIEWPORT_DEBOUNCE_MS);\n window.addEventListener('resize', refreshViewport);\n window.addEventListener('orientationchange', refreshViewport);\n teardownCallbacks.push(\n () => window.removeEventListener('resize', refreshViewport),\n () => window.removeEventListener('orientationchange', refreshViewport),\n );\n\n const refreshNetwork = () => {\n context.setRuntimeAttributes(getNetworkAttributes());\n };\n window.addEventListener('online', refreshNetwork);\n window.addEventListener('offline', refreshNetwork);\n teardownCallbacks.push(\n () => window.removeEventListener('online', refreshNetwork),\n () => window.removeEventListener('offline', refreshNetwork),\n );\n\n const connection = getConnection();\n // NetworkInformation 实现了 EventTarget;旧浏览器或某些 polyfill 可能没有 addEventListener,做能力检测\n if (connection && typeof connection.addEventListener === 'function') {\n connection.addEventListener('change', refreshNetwork);\n teardownCallbacks.push(() => {\n connection.removeEventListener?.('change', refreshNetwork);\n });\n }\n },\n shutdown() {\n while (teardownCallbacks.length) {\n teardownCallbacks.pop()?.();\n }\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/**\n * 浏览器错误采集插件,负责捕获 JS 运行时错误、未处理的 Promise rejection、资源加载失败三类错误。\n *\n * 上报策略:\n * - 错误分析主数据统一使用 `span_type=error` 的 error span。\n * - 每个浏览器错误只生成一条原始 error Span,错误分组和风暴控制由服务端完成。\n *\n * 关键 attribute:\n * - `error.source`:错误来源,取值 `window.error` / `unhandledrejection` / `resource`。\n * - 资源错误额外带 `url.full`(经 redactUrl 脱敏)。\n * - JS 错误额外带 `code.filepath` / `code.lineno` / `code.column`。\n */\n\nimport { SpanStatusCode } from '@opentelemetry/api';\n\nimport { buildRumSpanAttributes, RUM_SPAN_OUTCOME, RUM_SPAN_TYPE } from '../schema/span';\n\nimport type { BkOTPlugin, BkOTRuntimeContext } from '../core/plugin';\n\nconst getErrorMessage = (value: unknown) => {\n if (value instanceof Error) {\n return value.message;\n }\n if (typeof value === 'string') {\n return value;\n }\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n};\n\ninterface EmitErrorOptions {\n context: BkOTRuntimeContext;\n error: unknown;\n exceptionType?: string;\n extra?: Record<string, unknown>;\n source: string;\n spanName: string;\n}\n\nconst emitError = ({ context, error, exceptionType, extra = {}, source, spanName }: EmitErrorOptions) => {\n if (!context.isSampled()) return;\n const occurredAt = Date.now();\n const message = getErrorMessage(error);\n context.notifyActivity({ time: occurredAt, type: 'error' });\n\n const exceptionLike = error instanceof Error ? error : { message, name: exceptionType ?? source };\n const attributes = {\n ...context.config.hooks.getPageAttributes(),\n ...context.config.hooks.getErrorAttributes(),\n ...buildRumSpanAttributes({\n outcome: RUM_SPAN_OUTCOME.error,\n spanType: RUM_SPAN_TYPE.error,\n }),\n 'error.message': message,\n 'error.handled': false,\n 'error.source': source,\n ...extra,\n };\n // 错误分析统一沉淀为 error span;若当前存在 active context,OTel 会自动建立父子关系。\n const errorSpan = context.startSpan(spanName, attributes, { startTime: occurredAt });\n errorSpan.recordException(exceptionLike);\n errorSpan.setStatus({ code: SpanStatusCode.ERROR, message });\n errorSpan.end();\n};\n\nexport const createErrorPlugin = (): BkOTPlugin => {\n const listeners: Array<() => void> = [];\n\n return {\n name: 'error',\n init(context) {\n if (typeof window === 'undefined') {\n return;\n }\n\n const onError = (event: ErrorEvent) => {\n emitError({\n context,\n spanName: 'browser.error',\n source: 'window.error',\n error: event.error ?? event.message,\n extra: {\n 'code.filepath': event.filename,\n 'code.lineno': event.lineno,\n 'code.column': event.colno,\n },\n });\n };\n const onUnhandledRejection = (event: PromiseRejectionEvent) => {\n emitError({\n context,\n spanName: 'browser.unhandledrejection',\n source: 'unhandledrejection',\n error: event.reason,\n exceptionType: event.reason instanceof Error ? event.reason.name : 'UnhandledRejection',\n });\n };\n const onResourceError = (event: Event) => {\n // JS 运行时错误是 ErrorEvent,已由 bubble 阶段的 onError 处理;这里只关心资源加载失败\n if (event instanceof ErrorEvent) return;\n const target = event.target;\n if (!(target instanceof Element)) return;\n const elementWithUrl = target as Element & { href?: string; src?: string };\n const resourceUrl = elementWithUrl.src || elementWithUrl.href || (target as HTMLMediaElement).currentSrc || '';\n emitError({\n context,\n spanName: 'browser.resource_error',\n source: 'resource',\n error: new Error(`Resource load failed: ${target.tagName.toLowerCase()} ${resourceUrl}`),\n exceptionType: 'ResourceError',\n extra: {\n 'url.full': context.config.hooks.redactUrl(resourceUrl),\n },\n });\n };\n\n window.addEventListener('error', onError);\n window.addEventListener('unhandledrejection', onUnhandledRejection);\n window.addEventListener('error', onResourceError, true);\n listeners.push(\n () => window.removeEventListener('error', onError),\n () => window.removeEventListener('unhandledrejection', onUnhandledRejection),\n () => window.removeEventListener('error', onResourceError, true),\n );\n },\n shutdown() {\n while (listeners.length) {\n listeners.pop()?.();\n }\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n */\n\nimport { createRandomId } from '../core/id';\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\nimport { buildRumSpanAttributes, RUM_SPAN_TYPE } from '../schema/span';\n\nimport type { BkOTPlugin } from '../core/plugin';\nimport type { Attributes } from '@opentelemetry/api';\n\n/**\n * 主线程阻塞优先使用 Long Animation Frame API 获取脚本归因,不支持时回退到 Long Tasks API;\n * span 保留单次诊断详情,分布与计数由服务端从原始事件计算。\n */\nexport interface BkOTLongTaskPluginOptions {\n /** 采集阈值,默认 50ms。Performance API 本身通常只产生大于 50ms 的条目。 */\n threshold?: number;\n}\n\ninterface LegacyLongTaskEntry extends PerformanceEntry {\n attribution?: Array<{\n containerId?: string;\n containerName?: string;\n containerSrc?: string;\n containerType?: string;\n name?: string;\n }>;\n}\n\ninterface LongAnimationFrameEntry extends PerformanceEntry {\n blockingDuration: number;\n firstUIEventTimestamp: number;\n renderStart: number;\n scripts: ScriptTiming[];\n styleAndLayoutStart: number;\n}\n\ninterface ScriptTiming {\n duration: number;\n executionStart: number;\n forcedStyleAndLayoutDuration: number;\n invoker: string;\n invokerType: string;\n pauseDuration: number;\n sourceCharPosition: number;\n sourceFunctionName: string;\n sourceURL: string;\n startTime: number;\n windowAttribution: string;\n}\n\nconst DEFAULT_THRESHOLD = 50;\n\nconst nonNegativeNumber = (value: number | undefined, fallback: number) =>\n typeof value === 'number' && Number.isFinite(value) && value >= 0 ? value : fallback;\n\nconst finiteNumber = (value: number | undefined) => (Number.isFinite(value) ? value : undefined);\n\nconst getLegacyAttributionAttributes = (\n attribution: NonNullable<LegacyLongTaskEntry['attribution']>[number],\n redactUrl: (url: string) => string,\n): Attributes => ({\n ...(attribution.containerId ? { 'long_task.attribution.container_id': attribution.containerId } : {}),\n ...(attribution.containerName ? { 'long_task.attribution.container_name': attribution.containerName } : {}),\n ...(attribution.containerSrc ? { 'long_task.attribution.container_src': redactUrl(attribution.containerSrc) } : {}),\n ...(attribution.containerType ? { 'long_task.attribution.container_type': attribution.containerType } : {}),\n ...(attribution.name ? { 'long_task.attribution.name': attribution.name } : {}),\n});\n\nconst getScriptAttributes = (script: ScriptTiming, redactUrl: (url: string) => string): Attributes => ({\n 'long_task.script.duration': script.duration,\n 'long_task.script.execution_start': script.executionStart,\n 'long_task.script.forced_style_and_layout_duration': script.forcedStyleAndLayoutDuration,\n 'long_task.script.invoker': script.invoker,\n 'long_task.script.invoker_type': script.invokerType,\n 'long_task.script.pause_duration': script.pauseDuration,\n 'long_task.script.source_char_position': script.sourceCharPosition,\n 'long_task.script.source_function_name': script.sourceFunctionName,\n 'long_task.script.source_url': script.sourceURL ? redactUrl(script.sourceURL) : '',\n 'long_task.script.start_time': script.startTime,\n 'long_task.script.window_attribution': script.windowAttribution,\n});\n\nexport const createLongTaskPlugin = (options: BkOTLongTaskPluginOptions = {}): BkOTPlugin => {\n const threshold = nonNegativeNumber(options.threshold, DEFAULT_THRESHOLD);\n let observer: PerformanceObserver | undefined;\n let initialBatchTimer: ReturnType<typeof setTimeout> | undefined;\n let initialEntries: PerformanceEntry[] = [];\n\n return {\n name: 'long-task',\n init(context) {\n if (typeof PerformanceObserver === 'undefined' || typeof performance === 'undefined') return;\n const supportedEntryTypes = PerformanceObserver.supportedEntryTypes ?? [];\n // LoAF 提供脚本归因与 blockingDuration,支持时优先使用;旧浏览器回退到 longtask。\n const entryType = supportedEntryTypes.includes('long-animation-frame')\n ? 'long-animation-frame'\n : supportedEntryTypes.includes('longtask')\n ? 'longtask'\n : undefined;\n if (!entryType) return;\n\n const emitEntry = (entry: LegacyLongTaskEntry | LongAnimationFrameEntry) => {\n if (!context.isSampled()) return;\n if (!Number.isFinite(entry.duration) || entry.duration < threshold) return;\n const isLoaf = entry.entryType === 'long-animation-frame';\n const loaf = isLoaf ? (entry as LongAnimationFrameEntry) : undefined;\n const scripts = loaf?.scripts ?? [];\n const id = createRandomId('long-task');\n const startTime = performance.timeOrigin + entry.startTime;\n const endTime = startTime + entry.duration;\n const entryTypeAttribute = isLoaf ? 'long-animation-frame' : 'long-task';\n const legacyAttributions = isLoaf ? [] : ((entry as LegacyLongTaskEntry).attribution ?? []);\n const span = context.startSpan(\n 'browser.long_task',\n {\n ...context.config.hooks.getPageAttributes(),\n ...buildRumSpanAttributes({\n spanType: RUM_SPAN_TYPE.longTask,\n }),\n ...(finiteNumber(loaf?.blockingDuration) !== undefined\n ? { [RUM_ATTRIBUTES.longTaskBlockingDuration]: loaf!.blockingDuration }\n : {}),\n [RUM_ATTRIBUTES.longTaskEntryType]: entryTypeAttribute,\n [RUM_ATTRIBUTES.longTaskId]: id,\n 'long_task.name': entry.name,\n ...(finiteNumber(loaf?.firstUIEventTimestamp) !== undefined\n ? { 'long_task.first_ui_event_timestamp': loaf!.firstUIEventTimestamp }\n : {}),\n ...(finiteNumber(loaf?.renderStart) !== undefined ? { 'long_task.render_start': loaf!.renderStart } : {}),\n ...(finiteNumber(loaf?.styleAndLayoutStart) !== undefined\n ? { 'long_task.style_and_layout_start': loaf!.styleAndLayoutStart }\n : {}),\n },\n { startTime },\n );\n scripts.forEach(script => {\n span.addEvent(\n 'long_task.script',\n context.applyRedact(getScriptAttributes(script, context.config.hooks.redactUrl)),\n performance.timeOrigin + script.startTime,\n );\n });\n legacyAttributions.forEach((attribution, index) => {\n span.addEvent(\n 'long_task.attribution',\n context.applyRedact({\n 'long_task.attribution.index': index,\n ...getLegacyAttributionAttributes(attribution, context.config.hooks.redactUrl),\n }),\n startTime,\n );\n });\n span.end(endTime);\n context.notifyActivity({ endTime, startTime, type: 'long_task' });\n };\n\n const emitEntries = (entries: PerformanceEntry[]) =>\n entries.forEach(entry => emitEntry(entry as LegacyLongTaskEntry));\n try {\n let initializing = true;\n observer = new PerformanceObserver(list => {\n const entries = list.getEntries();\n if (initializing) {\n // buffered 条目可能在 observe() 内同步回调,先合并到下一宏任务,等 Session/View 上下文就绪后再归属。\n initialEntries.push(...entries);\n if (!initialBatchTimer) {\n initialBatchTimer = setTimeout(() => {\n const entriesToEmit = initialEntries;\n initialEntries = [];\n initialBatchTimer = undefined;\n emitEntries(entriesToEmit);\n });\n }\n } else {\n emitEntries(entries);\n }\n });\n observer.observe({ type: entryType, buffered: true });\n initializing = false;\n } catch {\n observer = undefined;\n }\n },\n shutdown() {\n observer?.disconnect();\n observer = undefined;\n clearTimeout(initialBatchTimer);\n initialBatchTimer = undefined;\n initialEntries = [];\n },\n };\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nexport interface RouteChangeEvent {\n fromUrl: string;\n source: RouteChangeSource;\n toUrl: string;\n}\n\nexport type RouteChangeSource = 'hashchange' | 'popstate' | 'pushState' | 'replaceState';\n\ntype RouteChangeHandler = (event: RouteChangeEvent) => void;\n\nconst subscribers = new Set<RouteChangeHandler>();\n\n// History 只 patch 一次,多个插件/实例共用订阅集合;最后一个订阅者退出时恢复原方法。\nlet lastUrl = '';\nlet originalPushState: typeof history.pushState | undefined;\nlet originalReplaceState: typeof history.replaceState | undefined;\nlet patched = false;\n\nconst getCurrentUrl = () => (typeof location === 'undefined' ? '' : location.href);\n\nconst emitRouteChange = (source: RouteChangeSource, fromUrl: string) => {\n const toUrl = getCurrentUrl();\n lastUrl = toUrl;\n const event: RouteChangeEvent = { fromUrl, source, toUrl };\n\n for (const subscriber of Array.from(subscribers)) {\n subscriber(event);\n }\n};\n\nconst onPopState = () => {\n emitRouteChange('popstate', lastUrl || getCurrentUrl());\n};\n\nconst onHashChange = () => {\n emitRouteChange('hashchange', lastUrl || getCurrentUrl());\n};\n\nconst patchHistory = () => {\n if (patched || typeof window === 'undefined' || typeof history === 'undefined') {\n return;\n }\n\n patched = true;\n lastUrl = getCurrentUrl();\n originalPushState = history.pushState;\n originalReplaceState = history.replaceState;\n\n history.pushState = function patchedPushState(this: History, data: any, title: string, url?: null | string | URL) {\n const fromUrl = lastUrl || getCurrentUrl();\n // 先执行原方法,让订阅者读取到的 location 与浏览器最终状态一致。\n const result = originalPushState?.apply(this, [data, title, url]);\n emitRouteChange('pushState', fromUrl);\n return result;\n };\n history.replaceState = function patchedReplaceState(\n this: History,\n data: any,\n title: string,\n url?: null | string | URL,\n ) {\n const fromUrl = lastUrl || getCurrentUrl();\n const result = originalReplaceState?.apply(this, [data, title, url]);\n emitRouteChange('replaceState', fromUrl);\n return result;\n };\n window.addEventListener('popstate', onPopState);\n window.addEventListener('hashchange', onHashChange);\n};\n\nconst restoreHistory = () => {\n if (!patched || typeof window === 'undefined' || typeof history === 'undefined') {\n return;\n }\n\n if (originalPushState) {\n history.pushState = originalPushState;\n }\n if (originalReplaceState) {\n history.replaceState = originalReplaceState;\n }\n window.removeEventListener('popstate', onPopState);\n window.removeEventListener('hashchange', onHashChange);\n originalPushState = undefined;\n originalReplaceState = undefined;\n patched = false;\n lastUrl = '';\n};\n\nexport const subscribeRouteChange = (handler: RouteChangeHandler) => {\n if (typeof window === 'undefined' || typeof history === 'undefined') {\n return () => {};\n }\n\n patchHistory();\n subscribers.add(handler);\n\n return () => {\n subscribers.delete(handler);\n if (subscribers.size === 0) {\n restoreHistory();\n }\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/**\n * Page View 插件\n *\n * 自动模式监听初始加载、SPA 路由和 BFCache;手动模式仅由 startView() 划分 View。\n *\n * 上报形态:browser.view start/update/end 原始生命周期事件 span。\n *\n * 自动边界与 Datadog 对齐:pathname 或非锚点 hash path 改变才创建 View,query-only 变化不创建。\n *\n * 关键属性:\n * - view.url:当前页面 URL(经 redactUrl 脱敏)\n * - view.previous:跳转前的 URL(来自 route-observer 的 fromUrl,初始 load 为空字符串)\n * - view.previous_url_template:跳转前 URL 的低基数路由模板,初始 load 为空字符串\n * - view.referrer:仅初始加载且值非空时携带\n */\n\nimport { createRandomId } from '../core/id';\nimport { waitForPageActivityEnd } from '../core/page-activity';\nimport { subscribeRouteChange } from '../core/route-observer';\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\nimport { buildRumSpanAttributes, RUM_SPAN_TYPE } from '../schema/span';\n\nimport type { BkOTPlugin } from '../core/plugin';\nimport type { BkOTStartViewOptions, BkOTViewContext } from '../core/runtime-context';\nimport type { Attributes } from '@opentelemetry/api';\n\ninterface ActiveView {\n attributes: Attributes;\n id: string;\n loadingTime?: number;\n loadingTimeSource?: 'auto' | 'manual';\n loadingType: ViewLoadingType;\n /** 仅业务显式命名时存在;未命名时由后端回退到 view.url_template 展示 */\n name?: string;\n rawUrl: string;\n snapshotAttributes: Attributes;\n startedAt: number;\n url: string;\n urlTemplate: string;\n version: number;\n stopLoadingTime?: () => void;\n}\n\ntype ViewLoadingType = NonNullable<BkOTViewContext['loadingType']>;\n\nconst PROTECTED_ATTRIBUTE_KEYS = new Set<string>(Object.values(RUM_ATTRIBUTES));\n\nconst getCurrentUrl = () => {\n if (typeof location === 'undefined') {\n return '';\n }\n return location.href;\n};\n\nconst getNavigationTimingAttributes = (): Attributes => {\n if (typeof performance === 'undefined') return {};\n const navigation = performance.getEntriesByType('navigation')[0] as PerformanceNavigationTiming | undefined;\n if (!navigation) return {};\n const attributes: Attributes = {};\n const setTiming = (key: string, value: number) => {\n if (Number.isFinite(value) && value > 0) attributes[key] = value;\n };\n setTiming(RUM_ATTRIBUTES.viewFirstByte, navigation.responseStart);\n setTiming(RUM_ATTRIBUTES.viewDomInteractive, navigation.domInteractive);\n setTiming(RUM_ATTRIBUTES.viewDomContentLoaded, navigation.domContentLoadedEventEnd);\n setTiming(RUM_ATTRIBUTES.viewDomComplete, navigation.domComplete);\n setTiming(RUM_ATTRIBUTES.viewLoadEvent, navigation.loadEventEnd);\n return attributes;\n};\n\nconst getHashPath = (hash: string) => {\n const queryIndex = hash.indexOf('?');\n return queryIndex < 0 ? hash : hash.slice(0, queryIndex);\n};\n\nconst isHashAnchor = (hash: string) => {\n const id = hash.slice(1);\n if (!id || typeof document === 'undefined' || typeof document.getElementById !== 'function') return false;\n try {\n return Boolean(document.getElementById(decodeURIComponent(id)));\n } catch {\n return Boolean(document.getElementById(id));\n }\n};\n\nexport const isViewLocationChange = (fromUrl: string, toUrl: string) => {\n try {\n const base = typeof location === 'undefined' ? 'http://localhost' : location.href;\n const from = new URL(fromUrl, base);\n const to = new URL(toUrl, base);\n return from.pathname !== to.pathname || (!isHashAnchor(to.hash) && getHashPath(from.hash) !== getHashPath(to.hash));\n } catch {\n return fromUrl !== toUrl;\n }\n};\n\nexport const createPageViewPlugin = (): BkOTPlugin => {\n const teardownCallbacks: Array<() => void> = [];\n\n return {\n name: 'page-view',\n init(context) {\n if (typeof window === 'undefined') {\n return;\n }\n\n let activeView: ActiveView | undefined;\n let bfCacheView: Omit<ActiveView, 'stopLoadingTime'> | undefined;\n let renewalView: Omit<ActiveView, 'stopLoadingTime'> | undefined;\n\n const clearViewContext = (changedAt = Date.now()) => context.setView({}, changedAt);\n\n const emitViewEvent = (\n view: ActiveView,\n phase: 'end' | 'start' | 'update',\n timestamp = Date.now(),\n reason?: string,\n ) => {\n view.version += 1;\n const span = context.startSpan(\n 'browser.view',\n {\n ...context.config.hooks.getPageAttributes(),\n ...view.attributes,\n ...view.snapshotAttributes,\n [RUM_ATTRIBUTES.viewPhase]: phase,\n [RUM_ATTRIBUTES.viewStartedAt]: view.startedAt,\n [RUM_ATTRIBUTES.viewVersion]: view.version,\n ...(reason ? { 'view.end_reason': reason } : {}),\n ...(view.loadingTime === undefined\n ? {}\n : {\n [RUM_ATTRIBUTES.viewLoadingTime]: view.loadingTime,\n [RUM_ATTRIBUTES.viewLoadingTimeSource]: view.loadingTimeSource,\n }),\n },\n {\n contextTime: timestamp,\n startTime: timestamp,\n },\n );\n span.end(timestamp);\n };\n\n const endActiveView = (reason: string, clearContext = true, endedAt = Date.now()) => {\n if (!activeView) {\n if (clearContext) clearViewContext(endedAt);\n return undefined;\n }\n const snapshot = { ...activeView };\n activeView.stopLoadingTime?.();\n emitViewEvent(activeView, 'end', endedAt, reason);\n activeView = undefined;\n if (clearContext) clearViewContext(endedAt);\n const { stopLoadingTime: _stopLoadingTime, ...rest } = snapshot;\n return rest;\n };\n\n const setLoadingTime = (view: ActiveView, duration: number, source: 'auto' | 'manual') => {\n if (activeView !== view || !Number.isFinite(duration) || duration < 0) return;\n const navigationTimingAttributes = view.loadingType === 'initial_load' ? getNavigationTimingAttributes() : {};\n const updatedAttributes = {\n ...navigationTimingAttributes,\n [RUM_ATTRIBUTES.viewLoadingTime]: duration,\n [RUM_ATTRIBUTES.viewLoadingTimeSource]: source,\n };\n Object.assign(view.snapshotAttributes, updatedAttributes);\n view.loadingTime = duration;\n view.loadingTimeSource = source;\n emitViewEvent(view, 'update');\n };\n\n const startLoadingTimeTracking = (view: ActiveView) => {\n if (!context.config.view.loadingTime || document.visibilityState === 'hidden') return;\n let activityResolved = false;\n let activityCandidate: number | undefined;\n let loadResolved = view.loadingType !== 'initial_load';\n let loadCandidate: number | undefined;\n let loadListener: (() => void) | undefined;\n let hidden = false;\n let visibilityListener: (() => void) | undefined;\n\n const tryComplete = () => {\n if (hidden || !activityResolved || !loadResolved || activeView !== view) return;\n const candidates = [activityCandidate, loadCandidate].filter(\n (candidate): candidate is number => candidate !== undefined,\n );\n if (candidates.length) setLoadingTime(view, Math.max(...candidates), 'auto');\n view.stopLoadingTime?.();\n view.stopLoadingTime = undefined;\n };\n\n const readLoadEvent = () => {\n const navigation = performance.getEntriesByType?.('navigation')[0] as PerformanceNavigationTiming | undefined;\n if (!navigation?.loadEventEnd) return false;\n loadCandidate = Math.max(0, performance.timeOrigin + navigation.loadEventEnd - view.startedAt);\n loadResolved = true;\n return true;\n };\n\n if (!loadResolved && !readLoadEvent()) {\n const onLoad = () => {\n setTimeout(() => {\n if (activeView !== view) return;\n readLoadEvent();\n loadResolved = true;\n tryComplete();\n });\n };\n window.addEventListener('load', onLoad, { once: true });\n loadListener = () => window.removeEventListener('load', onLoad);\n }\n\n const stopActivity = waitForPageActivityEnd(context, view.startedAt, result => {\n activityResolved = true;\n if (result.hadActivity) activityCandidate = Math.max(0, result.endTime - view.startedAt);\n tryComplete();\n });\n const onVisibilityChange = () => {\n if (document.visibilityState !== 'hidden') return;\n hidden = true;\n view.stopLoadingTime?.();\n view.stopLoadingTime = undefined;\n };\n document.addEventListener('visibilitychange', onVisibilityChange);\n visibilityListener = () => document.removeEventListener('visibilitychange', onVisibilityChange);\n view.stopLoadingTime = () => {\n stopActivity();\n loadListener?.();\n loadListener = undefined;\n visibilityListener?.();\n visibilityListener = undefined;\n };\n tryComplete();\n };\n\n const sanitizeViewAttributes = (attributes: Attributes | undefined) => {\n const redacted = context.applyRedact(attributes ?? {});\n return Object.fromEntries(\n Object.entries(redacted).filter(([key, value]) => value !== undefined && !PROTECTED_ATTRIBUTE_KEYS.has(key)),\n ) as Attributes;\n };\n\n const startView = (\n options: BkOTStartViewOptions,\n source: string,\n loadingType: ViewLoadingType,\n previousUrl = activeView?.rawUrl ?? '',\n ) => {\n if (!context.isSessionActive()) return;\n const currentUrl = options.url ?? getCurrentUrl();\n const urlTemplate = context.config.hooks.getViewUrlTemplate(currentUrl);\n const previousUrlTemplate = previousUrl ? context.config.hooks.getViewUrlTemplate(previousUrl) : '';\n const name = options.name;\n const customAttributes = sanitizeViewAttributes(options.attributes);\n endActiveView(source, false);\n\n const viewId = createRandomId('view');\n const redactedCurrentUrl = context.config.hooks.redactUrl(currentUrl);\n const redactedPreviousUrl = context.config.hooks.redactUrl(previousUrl);\n const isInitialLoad = loadingType === 'initial_load';\n const startedAt = isInitialLoad && typeof performance !== 'undefined' ? performance.timeOrigin : Date.now();\n const navigationTimingAttributes = isInitialLoad ? getNavigationTimingAttributes() : {};\n\n context.setView(\n {\n attributes: customAttributes,\n id: viewId,\n loadingType,\n name,\n startedAt,\n url: redactedCurrentUrl,\n urlTemplate,\n },\n startedAt,\n );\n\n const viewAttributes = {\n ...customAttributes,\n ...context.config.hooks.getPageAttributes(),\n ...navigationTimingAttributes,\n ...buildRumSpanAttributes({\n spanType: RUM_SPAN_TYPE.view,\n }),\n [RUM_ATTRIBUTES.viewId]: viewId,\n ...(name ? { [RUM_ATTRIBUTES.viewName]: name } : {}),\n [RUM_ATTRIBUTES.viewUrl]: redactedCurrentUrl,\n [RUM_ATTRIBUTES.viewUrlTemplate]: urlTemplate,\n [RUM_ATTRIBUTES.viewLoadingType]: loadingType,\n [RUM_ATTRIBUTES.viewPrevious]: redactedPreviousUrl,\n [RUM_ATTRIBUTES.viewPreviousUrlTemplate]: previousUrlTemplate,\n ...(isInitialLoad && document.referrer\n ? { [RUM_ATTRIBUTES.viewReferrer]: context.config.hooks.redactUrl(document.referrer) }\n : {}),\n };\n activeView = {\n attributes: customAttributes,\n version: 0,\n id: viewId,\n loadingType,\n name,\n rawUrl: currentUrl,\n snapshotAttributes: viewAttributes,\n startedAt,\n url: redactedCurrentUrl,\n urlTemplate,\n };\n emitViewEvent(activeView, 'start', startedAt);\n startLoadingTimeTracking(activeView);\n };\n\n const unsubscribeViewCommands = context.onViewCommand(command => {\n if (command.type === 'start') {\n startView(command.options, 'manual', activeView ? 'route_change' : 'initial_load');\n return;\n }\n if (!activeView) return;\n if (command.type === 'set_loading_time') {\n activeView.stopLoadingTime?.();\n activeView.stopLoadingTime = undefined;\n setLoadingTime(activeView, Math.max(0, command.time - activeView.startedAt), 'manual');\n return;\n }\n if (activeView.name === command.name) return;\n activeView.name = command.name;\n activeView.snapshotAttributes[RUM_ATTRIBUTES.viewName] = command.name;\n context.setView({\n attributes: activeView.attributes,\n id: activeView.id,\n loadingType: activeView.loadingType,\n name: activeView.name,\n startedAt: activeView.startedAt,\n url: activeView.url,\n urlTemplate: activeView.urlTemplate,\n });\n emitViewEvent(activeView, 'update');\n });\n\n let unsubscribeRoute = () => {};\n if (context.config.view.tracking === 'auto') {\n if (!activeView) startView({}, 'load', 'initial_load');\n unsubscribeRoute = subscribeRouteChange(event => {\n if (isViewLocationChange(event.fromUrl, event.toUrl)) {\n startView({}, event.source, 'route_change', event.fromUrl);\n }\n });\n }\n\n const onPageHide = (event: PageTransitionEvent) => {\n if (event.persisted) {\n bfCacheView = endActiveView('bfcache');\n return;\n }\n bfCacheView = undefined;\n endActiveView('pagehide');\n };\n const onPageShow = (event: PageTransitionEvent) => {\n if (event.persisted && context.config.view.tracking === 'auto') {\n const restoredView = bfCacheView;\n bfCacheView = undefined;\n if (!context.isSessionActive()) {\n renewalView = restoredView;\n return;\n }\n startView(\n restoredView\n ? { attributes: restoredView.attributes, name: restoredView.name, url: restoredView.rawUrl }\n : {},\n 'bfCache',\n 'bf_cache',\n restoredView?.rawUrl,\n );\n }\n };\n const unsubscribeSessionLifecycle = context.onSessionLifecycle(event => {\n if (event.type === 'expired') {\n renewalView = endActiveView('session_expired', true, event.expiredAt) ?? bfCacheView;\n bfCacheView = undefined;\n return;\n }\n if (renewalView) {\n startView(\n { attributes: renewalView.attributes, name: renewalView.name, url: renewalView.rawUrl },\n 'sessionRenewal',\n 'session_renewal',\n renewalView.rawUrl,\n );\n renewalView = undefined;\n }\n });\n window.addEventListener('pagehide', onPageHide);\n window.addEventListener('pageshow', onPageShow);\n\n teardownCallbacks.push(\n unsubscribeRoute,\n unsubscribeSessionLifecycle,\n unsubscribeViewCommands,\n () => window.removeEventListener('pagehide', onPageHide),\n () => window.removeEventListener('pageshow', onPageShow),\n () => endActiveView('shutdown'),\n );\n },\n shutdown() {\n while (teardownCallbacks.length) {\n teardownCallbacks.pop()?.();\n }\n },\n };\n};\n","export interface ActiveSessionRecord {\n expiresAt: number;\n id: string;\n startedAt: number;\n status: 'active';\n}\n\nexport interface ExpiredSessionRecord {\n expiredAt: number;\n previousId: string;\n reason: SessionExpireReason;\n status: 'expired';\n}\n\n/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\nexport type SessionExpireReason = 'inactivity' | 'maxLifetime';\n\nexport type SessionRecord = ActiveSessionRecord | ExpiredSessionRecord;\n\nconst FUTURE_CLOCK_TOLERANCE_MS = 5_000;\n\nconst isTimestamp = (value: unknown): value is number =>\n typeof value === 'number' && Number.isFinite(value) && value > 0;\n\nexport const createActiveSessionRecord = (\n id: string,\n now: number,\n idleTimeoutMs: number,\n maxDurationMs: number,\n): ActiveSessionRecord => ({\n expiresAt: Math.min(now + idleTimeoutMs, now + maxDurationMs),\n id,\n startedAt: now,\n status: 'active',\n});\n\nexport const getSessionExpireReason = (\n record: ActiveSessionRecord,\n now: number,\n maxDurationMs: number,\n): SessionExpireReason | undefined => {\n if (now >= record.startedAt + maxDurationMs) return 'maxLifetime';\n if (now >= record.expiresAt) return 'inactivity';\n return undefined;\n};\n\nexport const expandActiveSession = (\n record: ActiveSessionRecord,\n now: number,\n idleTimeoutMs: number,\n maxDurationMs: number,\n): ActiveSessionRecord => ({\n ...record,\n expiresAt: Math.min(now + idleTimeoutMs, record.startedAt + maxDurationMs),\n});\n\nexport const parseSessionRecord = (raw: null | string, now: number, maxDurationMs: number): null | SessionRecord => {\n if (!raw) return null;\n try {\n const parsed = JSON.parse(raw) as Partial<SessionRecord>;\n if (\n parsed.status === 'active' &&\n typeof parsed.id === 'string' &&\n parsed.id.length > 0 &&\n isTimestamp(parsed.startedAt) &&\n // 容忍轻微时钟漂移,但拒绝远期时间与超出最大生命周期的记录,避免脏 storage 永久续期。\n parsed.startedAt <= now + FUTURE_CLOCK_TOLERANCE_MS &&\n isTimestamp(parsed.expiresAt) &&\n parsed.expiresAt >= parsed.startedAt &&\n parsed.expiresAt <= parsed.startedAt + maxDurationMs\n ) {\n return parsed as ActiveSessionRecord;\n }\n if (\n parsed.status === 'expired' &&\n typeof parsed.previousId === 'string' &&\n parsed.previousId.length > 0 &&\n (parsed.reason === 'inactivity' || parsed.reason === 'maxLifetime') &&\n isTimestamp(parsed.expiredAt) &&\n parsed.expiredAt <= now + FUTURE_CLOCK_TOLERANCE_MS\n ) {\n return parsed as ExpiredSessionRecord;\n }\n } catch {\n /* JSON 损坏视为无记录 */\n }\n return null;\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/**\n * Session 插件\n *\n * 生命周期:\n * - 首次访问创建 session;用户交互会续期有效 session,或重建已过期 session\n * - 固定 15 分钟无活动 / 4 小时最长生命周期,任一到达时立即清理运行时 session.id\n * - 页面重新可见时只续期有效 session,不会复活已过期 session\n * - 跨 tab 共享持久化状态;本 tab 过期后不会被其他 tab 的新 session 被动复活\n */\n\nimport { hashString } from '../core/hash';\nimport { createRandomId } from '../core/id';\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\nimport { buildRumSpanAttributes, RUM_SPAN_TYPE } from '../schema/span';\nimport {\n createActiveSessionRecord,\n expandActiveSession,\n getSessionExpireReason,\n parseSessionRecord,\n} from './session-state';\n\nimport type { BkOTPlugin, BkOTRuntimeContext } from '../core/plugin';\nimport type { ActiveSessionRecord, ExpiredSessionRecord, SessionExpireReason, SessionRecord } from './session-state';\n\nexport interface BkOTSessionConfig {\n /** 以 0~1 表示的 Session 采样率,默认 1。 */\n sampleRate?: number;\n // 自定义 storage key;不传则按 endpoint host 自动生成隔离后缀\n storageKey?: string;\n}\n\nconst SESSION_IDLE_TIMEOUT_MS = 15 * 60 * 1000;\nconst SESSION_MAX_DURATION_MS = 4 * 60 * 60 * 1000;\nconst ACTIVITY_THROTTLE_MS = 1_000;\nconst VISIBILITY_CHECK_MS = 60_000;\nconst ACTIVITY_EVENTS: Array<keyof WindowEventMap> = ['click', 'keydown', 'scroll', 'touchstart'];\nconst memoryRecords = new Map<string, string>();\n\ninterface SessionStorage {\n isLocalStorage: () => boolean;\n read: () => null | string;\n write: (record: SessionRecord) => void;\n}\n\nconst createSessionStorage = (storageKey: string): SessionStorage => {\n let localStorageAvailable = typeof window !== 'undefined';\n\n const read = () => {\n if (localStorageAvailable) {\n try {\n return window.localStorage.getItem(storageKey);\n } catch {\n localStorageAvailable = false;\n }\n }\n return memoryRecords.get(storageKey) ?? null;\n };\n\n const write = (record: SessionRecord) => {\n const serialized = JSON.stringify(record);\n memoryRecords.set(storageKey, serialized);\n if (!localStorageAvailable) return;\n try {\n window.localStorage.setItem(storageKey, serialized);\n } catch {\n localStorageAvailable = false;\n }\n };\n\n read();\n return { isLocalStorage: () => localStorageAvailable, read, write };\n};\n\nconst buildDefaultStorageKey = (endpoint: string, applicationName: string) => {\n let suffix = '';\n try {\n suffix = new URL(endpoint).host;\n } catch {\n suffix = endpoint;\n }\n return `bk_ot_session__${hashString(`${applicationName}\\0${suffix || 'default'}`)}`;\n};\n\nconst emitSessionEvent = (\n context: BkOTRuntimeContext,\n phase: 'end' | 'rotate' | 'start',\n sessionId: string,\n timestamp: number,\n) => {\n const span = context.startSpan(\n 'browser.session',\n {\n ...context.config.hooks.getPageAttributes(),\n ...buildRumSpanAttributes({\n spanType: RUM_SPAN_TYPE.session,\n }),\n [RUM_ATTRIBUTES.sessionPhase]: phase,\n [RUM_ATTRIBUTES.sessionHasReplay]: false,\n [RUM_ATTRIBUTES.sessionId]: sessionId,\n [RUM_ATTRIBUTES.sessionType]: 'user',\n },\n {\n contextTime: timestamp,\n startTime: timestamp,\n },\n );\n span.end(timestamp);\n};\n\nexport const createSessionPlugin = (options: BkOTSessionConfig = {}): BkOTPlugin => {\n const teardownCallbacks: Array<() => void> = [];\n\n return {\n name: 'session',\n init(context) {\n if (typeof window === 'undefined' || typeof document === 'undefined') {\n const now = Date.now();\n const sessionId = createRandomId('session');\n context.setRuntimeAttributes(\n {\n [RUM_ATTRIBUTES.sessionHasReplay]: false,\n [RUM_ATTRIBUTES.sessionId]: sessionId,\n [RUM_ATTRIBUTES.sessionType]: 'user',\n },\n now,\n );\n return;\n }\n\n const storageKey =\n options.storageKey ??\n buildDefaultStorageKey(context.config.transport.endpoint, context.config.application.name);\n const storage = createSessionStorage(storageKey);\n const documentStartedAt =\n typeof performance !== 'undefined' && Number.isFinite(performance.timeOrigin)\n ? performance.timeOrigin\n : Date.now();\n let currentSessionId: string | undefined;\n let expirationTimeout: ReturnType<typeof setTimeout> | undefined;\n\n const readRecord = (now = Date.now()) => parseSessionRecord(storage.read(), now, SESSION_MAX_DURATION_MS);\n\n const clearExpirationTimeout = () => {\n if (expirationTimeout !== undefined) {\n clearTimeout(expirationTimeout);\n expirationTimeout = undefined;\n }\n };\n\n const deactivate = (reason: 'external' | SessionExpireReason, expiredAt = Date.now()) => {\n const expiredSessionId = currentSessionId;\n if (!expiredSessionId) return;\n context.notifySessionLifecycle({\n expiredAt,\n id: expiredSessionId,\n reason,\n type: 'expired',\n });\n emitSessionEvent(context, 'end', expiredSessionId, expiredAt);\n clearExpirationTimeout();\n currentSessionId = undefined;\n context.setRuntimeAttributes(\n {\n [RUM_ATTRIBUTES.sessionHasReplay]: undefined,\n [RUM_ATTRIBUTES.sessionId]: undefined,\n [RUM_ATTRIBUTES.sessionType]: undefined,\n },\n expiredAt,\n );\n void context.flush();\n };\n\n const expireCurrentSession = () => {\n const now = Date.now();\n const record = readRecord(now);\n if (!record) {\n deactivate('external', now);\n return;\n }\n if (record.status === 'expired') {\n deactivate(record.reason, record.expiredAt);\n return;\n }\n if (record.id !== currentSessionId) {\n deactivate('external', now);\n return;\n }\n const reason = getSessionExpireReason(record, now, SESSION_MAX_DURATION_MS);\n if (!reason) {\n scheduleExpiration(record);\n return;\n }\n const expired: ExpiredSessionRecord = {\n expiredAt: now,\n previousId: record.id,\n reason,\n status: 'expired',\n };\n storage.write(expired);\n deactivate(reason, now);\n };\n\n const scheduleExpiration = (record: ActiveSessionRecord) => {\n clearExpirationTimeout();\n const expiresAt = Math.min(record.expiresAt, record.startedAt + SESSION_MAX_DURATION_MS);\n expirationTimeout = setTimeout(expireCurrentSession, Math.max(0, expiresAt - Date.now()));\n };\n\n const activate = (\n record: ActiveSessionRecord,\n lifecycle?: {\n previousId?: string;\n reason: 'inactivity' | 'init' | 'maxLifetime' | 'shared';\n },\n ) => {\n const changed = record.id !== currentSessionId;\n currentSessionId = record.id;\n context.setRuntimeAttributes(\n {\n [RUM_ATTRIBUTES.sessionHasReplay]: false,\n [RUM_ATTRIBUTES.sessionId]: record.id,\n [RUM_ATTRIBUTES.sessionType]: 'user',\n },\n Math.min(record.startedAt, documentStartedAt),\n );\n scheduleExpiration(record);\n if (changed && lifecycle) {\n context.notifySessionLifecycle({\n id: record.id,\n previousId: lifecycle.previousId,\n reason: lifecycle.reason,\n startedAt: record.startedAt,\n type: 'renewed',\n });\n }\n };\n\n const expandOrRenew = (isInitialization = false) => {\n const now = Date.now();\n const record = readRecord(now);\n if (record?.status === 'active' && !getSessionExpireReason(record, now, SESSION_MAX_DURATION_MS)) {\n const expanded = expandActiveSession(record, now, SESSION_IDLE_TIMEOUT_MS, SESSION_MAX_DURATION_MS);\n storage.write(expanded);\n activate(expanded, currentSessionId ? undefined : { reason: 'shared' });\n return;\n }\n\n const previousId = record?.status === 'expired' ? record.previousId : record?.id;\n const reason =\n record?.status === 'expired'\n ? record.reason\n : record\n ? getSessionExpireReason(record, now, SESSION_MAX_DURATION_MS)\n : isInitialization\n ? 'init'\n : undefined;\n const created = createActiveSessionRecord(\n createRandomId('session'),\n now,\n SESSION_IDLE_TIMEOUT_MS,\n SESSION_MAX_DURATION_MS,\n );\n storage.write(created);\n activate(created, {\n previousId,\n reason: reason ?? 'init',\n });\n const lifecycleReason = reason ?? 'init';\n emitSessionEvent(\n context,\n lifecycleReason === 'init' ? 'start' : 'rotate',\n created.id,\n created.startedAt,\n );\n };\n\n const expandOnly = () => {\n if (!currentSessionId) return;\n const now = Date.now();\n const record = readRecord(now);\n if (\n record?.status !== 'active' ||\n record.id !== currentSessionId ||\n getSessionExpireReason(record, now, SESSION_MAX_DURATION_MS)\n ) {\n expireCurrentSession();\n return;\n }\n const expanded = expandActiveSession(record, now, SESSION_IDLE_TIMEOUT_MS, SESSION_MAX_DURATION_MS);\n storage.write(expanded);\n activate(expanded);\n };\n\n expandOrRenew(true);\n\n let lastActivityAt = 0;\n const onActivity = () => {\n const now = Date.now();\n if (now - lastActivityAt < ACTIVITY_THROTTLE_MS) return;\n lastActivityAt = now;\n expandOrRenew();\n };\n const activityListenerOptions: AddEventListenerOptions = { capture: true, passive: true };\n ACTIVITY_EVENTS.forEach(eventName => window.addEventListener(eventName, onActivity, activityListenerOptions));\n teardownCallbacks.push(() => {\n ACTIVITY_EVENTS.forEach(eventName =>\n window.removeEventListener(eventName, onActivity, activityListenerOptions),\n );\n });\n\n const expandWhenVisible = () => {\n if (document.visibilityState === 'visible') expandOnly();\n };\n document.addEventListener('visibilitychange', expandWhenVisible);\n const visibilityInterval = window.setInterval(expandWhenVisible, VISIBILITY_CHECK_MS);\n teardownCallbacks.push(() => {\n document.removeEventListener('visibilitychange', expandWhenVisible);\n window.clearInterval(visibilityInterval);\n });\n\n const onStorage = (event: StorageEvent) => {\n if (!storage.isLocalStorage() || event.storageArea !== window.localStorage || event.key !== storageKey) return;\n const now = Date.now();\n const record = parseSessionRecord(event.newValue, now, SESSION_MAX_DURATION_MS);\n if (\n record?.status === 'active' &&\n record.id === currentSessionId &&\n !getSessionExpireReason(record, now, SESSION_MAX_DURATION_MS)\n ) {\n scheduleExpiration(record);\n return;\n }\n // 当前 tab 一旦失效,不被其他 tab 新建的 session 被动复活;本 tab 发生交互后再接管共享 session。\n deactivate(\n record?.status === 'expired' ? record.reason : 'external',\n record?.status === 'expired' ? record.expiredAt : now,\n );\n };\n window.addEventListener('storage', onStorage);\n teardownCallbacks.push(() => window.removeEventListener('storage', onStorage));\n teardownCallbacks.push(clearExpirationTimeout);\n },\n shutdown() {\n while (teardownCallbacks.length) teardownCallbacks.pop()?.();\n },\n };\n};\n","class t{t;o=0;i=[];u(t){if(t.hadRecentInput)return;const e=this.i[0],n=this.i.at(-1);this.o&&e&&n&&t.startTime-n.startTime<1e3&&t.startTime-e.startTime<5e3?(this.o+=t.value,this.i.push(t)):(this.o=t.value,this.i=[t]),this.t?.(t)}}const e=()=>{const t=performance.getEntriesByType(\"navigation\")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},n=t=>{if(\"loading\"===document.readyState)return\"loading\";const n=e();if(n){if(t<n.domInteractive)return\"loading\";if(0===n.domContentLoadedEventStart||t<n.domContentLoadedEventStart)return\"dom-interactive\";if(0===n.domComplete||t<n.domComplete)return\"dom-content-loaded\"}return\"complete\"},o=t=>{const e=t.nodeName;return 1===t.nodeType?e.toLowerCase():e.toUpperCase().replace(/^#/,\"\")},i=t=>{let e=\"\";try{for(;9!==t?.nodeType;){const n=t,i=n.id?\"#\"+n.id:[o(n),...Array.from(n.classList).sort()].join(\".\");if(e.length+i.length>99)return e||i;if(e=e?i+\">\"+e:i,n.id)break;t=n.parentNode}}catch{}return e},r=new WeakMap;function s(t,e){return r.get(t)||r.set(t,new e),r.get(t)}let a=-1;const c=()=>a,u=t=>{addEventListener(\"pageshow\",e=>{e.persisted&&(a=e.timeStamp,t(e))},!0)},f=(t,e,n,o)=>{let i,r;return s=>{e.value>=0&&(s||o)&&(r=e.value-(i??0),(r||void 0===i)&&(i=e.value,e.delta=r,e.rating=((t,e)=>t>e[1]?\"poor\":t>e[0]?\"needs-improvement\":\"good\")(e.value,n),t(e)))}},d=t=>{requestAnimationFrame(()=>requestAnimationFrame(t))},l=()=>e()?.activationStart??0,h=(t,n=-1)=>{const o=e();let i=\"navigate\";c()>=0?i=\"back-forward-cache\":o&&(document.prerendering||l()>0?i=\"prerender\":document.wasDiscarded?i=\"restore\":o.type&&(i=o.type.replace(/_/g,\"-\")));return{name:t,value:n,rating:\"good\",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:i}},m=(t,e,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const o=new PerformanceObserver(t=>{queueMicrotask(()=>{e(t.getEntries())})});return o.observe({type:t,buffered:!0,...n}),o}}catch{}},g=t=>{let e=!1;return()=>{e||(t(),e=!0)}};let p=-1;const y=new Set,v=()=>\"hidden\"!==document.visibilityState||document.prerendering?1/0:0,b=t=>{if(\"hidden\"===document.visibilityState){if(\"visibilitychange\"===t.type)for(const t of y)t();isFinite(p)||(p=\"visibilitychange\"===t.type?t.timeStamp:0,removeEventListener(\"prerenderingchange\",b,!0))}},M=()=>{if(p<0){const t=l(),e=document.prerendering?void 0:globalThis.performance.getEntriesByType(\"visibility-state\").find(e=>\"hidden\"===e.name&&e.startTime>=t)?.startTime;p=e??v(),addEventListener(\"visibilitychange\",b,!0),addEventListener(\"prerenderingchange\",b,!0),u(()=>{setTimeout(()=>{p=v()})})}return{get firstHiddenTime(){return p},onHidden(t){y.add(t)}}},T=t=>{document.prerendering?addEventListener(\"prerenderingchange\",t,!0):t()},E=[1800,3e3],D=(t,e={})=>{T(()=>{const n=M();let o,i=h(\"FCP\");const r=m(\"paint\",t=>{for(const e of t)\"first-contentful-paint\"===e.name&&(r.disconnect(),e.startTime<n.firstHiddenTime&&(i.value=Math.max(e.startTime-l(),0),i.entries.push(e),o(!0)))});r&&(o=f(t,i,E,e.reportAllChanges),u(n=>{i=h(\"FCP\"),o=f(t,i,E,e.reportAllChanges),d(()=>{i.value=performance.now()-n.timeStamp,o(!0)})}))})},L=[.1,.25],S=t=>t.find(t=>1===t.node?.nodeType)||t[0],P=(e,o={})=>{const r=s(o=Object.assign({},o),t),a=new WeakMap;r.t=t=>{if(t?.sources?.length){const e=S(t.sources),n=e?.node;if(n){const t=o.generateTarget?.(n)??i(n);a.set(e,t)}}};((e,n={})=>{const o=M();D(g(()=>{let i,r=h(\"CLS\",0);const a=s(n,t),c=t=>{for(const e of t)a.u(e);a.o>r.value&&(r.value=a.o,r.entries=a.i,i())},l=m(\"layout-shift\",c);l&&(i=f(e,r,L,n.reportAllChanges),o.onHidden(()=>{c(l.takeRecords()),i(!0)}),u(()=>{a.o=0,r=h(\"CLS\",0),i=f(e,r,L,n.reportAllChanges),d(i)}),setTimeout(i))}))})(t=>{e((t=>{let e={};if(t.entries.length){const o=t.entries.reduce((t,e)=>t.value>e.value?t:e);if(o?.sources?.length){const t=S(o.sources);t&&(e={largestShiftTarget:a.get(t),largestShiftTime:o.startTime,largestShiftValue:o.value,largestShiftSource:t,largestShiftEntry:o,loadState:n(o.startTime)})}}return Object.assign(t,{attribution:e})})(t))},o)},w=(t,o={})=>{D(o=>{t((t=>{let o={timeToFirstByte:0,firstByteToFCP:t.value,loadState:n(c())};if(t.entries.length){const i=e(),r=t.entries.at(-1);if(i){const e=i.activationStart||0,s=Math.max(0,i.responseStart-e);o={timeToFirstByte:s,firstByteToFCP:t.value-s,loadState:n(t.entries[0].startTime),navigationEntry:i,fcpEntry:r}}}return Object.assign(t,{attribution:o})})(o))},o)};let _=0,k=1/0,F=0;const B=t=>{for(const e of t)e.interactionId&&(k=Math.min(k,e.interactionId),F=Math.max(F,e.interactionId),_=F?(F-k)/7+1:0)};let C;const O=()=>C?_:performance.interactionCount??0,j=()=>{\"interactionCount\"in performance||C||(C=m(\"event\",B,{durationThreshold:0}))};let I=0;class A{l=[];h=new Map;m;p;v(){I=O(),this.l.length=0,this.h.clear()}M(){const t=Math.min(this.l.length-1,Math.floor((O()-I)/50));return this.l[t]}u(t){if(this.m?.(t),!t.interactionId&&\"first-input\"!==t.entryType)return;const e=this.l.at(-1);let n=this.h.get(t.interactionId);if(n||this.l.length<10||t.duration>e.T){if(n?t.duration>n.T?(n.entries=[t],n.T=t.duration):t.duration===n.T&&t.startTime===n.entries[0].startTime&&n.entries.push(t):(n={id:t.interactionId,entries:[t],T:t.duration},this.h.set(n.id,n),this.l.push(n)),this.l.sort((t,e)=>e.T-t.T),this.l.length>10){const t=this.l.splice(10);for(const e of t)this.h.delete(e.id)}this.p?.(n)}}}const q=t=>{const e=globalThis.requestIdleCallback||setTimeout,n=globalThis.cancelIdleCallback||clearTimeout;if(\"hidden\"===document.visibilityState)t();else{const o=g(t);let i=-1;const r=()=>{n(i),o()};addEventListener(\"visibilitychange\",r,{once:!0,capture:!0}),i=e(()=>{removeEventListener(\"visibilitychange\",r,{capture:!0}),o()})}},W=[200,500],x=(t,e={})=>{const o=s(e=Object.assign({},e),A);let r=[],a=[],c=0;const d=new WeakMap,l=new WeakMap;let g=!1;const p=()=>{g||(q(y),g=!0)},y=()=>{const t=new Set(o.l.map(t=>d.get(t.entries[0]))),e=a.length-10;a=a.filter((n,o)=>o>=e||t.has(n));const n=new Set;for(const t of a){const e=v(t.startTime,t.processingEnd);for(const t of e)n.add(t)}r=r.filter(t=>t.startTime>c||n.has(t)),g=!1};o.m=t=>{const n=t.startTime+t.duration;let o;c=Math.max(c,t.processingEnd);for(let i=a.length-1;i>=0;i--){const r=a[i];if(Math.abs(n-r.renderTime)<=8){o=r,o.startTime=Math.min(t.startTime,o.startTime),o.processingStart=Math.min(t.processingStart,o.processingStart),o.processingEnd=Math.max(t.processingEnd,o.processingEnd),!1!==e.includeProcessedEventEntries&&o.entries.push(t);break}}o||(o={startTime:t.startTime,processingStart:t.processingStart,processingEnd:t.processingEnd,renderTime:n,entries:!1!==e.includeProcessedEventEntries?[t]:[]},a.push(o)),(t.interactionId||\"first-input\"===t.entryType)&&d.set(t,o),p()},o.p=t=>{if(!l.get(t)){const n=t.entries[0].target;if(n){const o=e.generateTarget?.(n)??i(n);l.set(t,o)}}};const v=(t,e)=>{const n=[];for(const o of r)if(!(o.startTime+o.duration<t)){if(o.startTime>e)break;n.push(o)}return n},b=t=>{const e=t.entries[0],i=d.get(e),r=e.processingStart,s=Math.max(e.startTime+e.duration,r),a=Math.min(i.processingEnd,s),c=i.entries.sort((t,e)=>t.processingStart-e.processingStart),u=v(e.startTime,a),f=o.h.get(e.interactionId),h={interactionTarget:l.get(f),interactionType:e.name.startsWith(\"key\")?\"keyboard\":\"pointer\",interactionTime:e.startTime,nextPaintTime:s,processedEventEntries:c,longAnimationFrameEntries:u,inputDelay:r-e.startTime,processingDuration:a-r,presentationDelay:s-a,loadState:n(e.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(t=>{if(!t.longAnimationFrameEntries?.length)return;const e=t.interactionTime,n=t.inputDelay,o=t.processingDuration;let i,r,s=0,a=0,c=0,u=0;for(const c of t.longAnimationFrameEntries){a=a+c.startTime+c.duration-c.styleAndLayoutStart;for(const t of c.scripts){const c=t.startTime+t.duration;if(c<e)continue;const f=c-Math.max(e,t.startTime),d=t.duration?f/t.duration*t.forcedStyleAndLayoutDuration:0;s+=f-d,a+=d,f>u&&(r=t.startTime<e+n?\"input-delay\":t.startTime>=e+n+o?\"presentation-delay\":\"processing-duration\",i=t,u=f)}}const f=t.longAnimationFrameEntries.at(-1),d=f?f.startTime+f.duration:0;d>=e+n+o&&(c=t.nextPaintTime-d),i&&r&&(t.longestScript={entry:i,subpart:r,intersectingDuration:u}),t.totalScriptDuration=s,t.totalStyleAndLayoutDuration=a,t.totalPaintDuration=c,t.totalUnattributedDuration=t.nextPaintTime-e-s-a-c})(h),Object.assign(t,{attribution:h})};m(\"long-animation-frame\",t=>{r=r.concat(t),p()}),((t,e={})=>{if(!globalThis.PerformanceEventTiming||!(\"interactionId\"in PerformanceEventTiming.prototype))return;const n=M();T(()=>{j();let o,i=h(\"INP\");const r=s(e,A),a=t=>{q(()=>{for(const e of t)r.u(e);const e=r.M();e&&e.T!==i.value&&(i.value=e.T,i.entries=e.entries,o())})},c=m(\"event\",a,{durationThreshold:e.durationThreshold??40});o=f(t,i,W,e.reportAllChanges),c&&(c.observe({type:\"first-input\",buffered:!0}),n.onHidden(()=>{a(c.takeRecords()),o(!0)}),u(()=>{r.v(),i=h(\"INP\"),o=f(t,i,W,e.reportAllChanges)}))})})(e=>{t(b(e))},e)};class N{m;u(t){this.m?.(t)}}const $=[2500,4e3],H=(t,n={})=>{const o=s(n=Object.assign({},n),N),r=new WeakMap;o.m=t=>{const e=t.element;if(e){const o=n.generateTarget?.(e)??i(e);r.set(t,o)}else t.id&&r.set(t,`#${t.id}`)};((t,e={})=>{T(()=>{const n=M();let o,i=h(\"LCP\");const r=s(e,N),a=t=>{e.reportAllChanges||(t=t.slice(-1));for(const e of t)r.u(e),e.startTime<n.firstHiddenTime&&(i.value=Math.max(e.startTime-l(),0),i.entries=[e],o())},c=m(\"largest-contentful-paint\",a);if(c){o=f(t,i,$,e.reportAllChanges);const n=g(()=>{a(c.takeRecords()),c.disconnect(),o(!0)}),r=t=>{t.isTrusted&&(q(n),removeEventListener(t.type,r,{capture:!0}))};for(const t of[\"keydown\",\"click\",\"visibilitychange\"])addEventListener(t,r,{capture:!0});u(n=>{i=h(\"LCP\"),o=f(t,i,$,e.reportAllChanges),d(()=>{i.value=performance.now()-n.timeStamp,o(!0)})})}})})(n=>{t((t=>{let n={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:t.value};if(t.entries.length){const o=t.entries.at(-1),i=o.url&&performance.getEntriesByType(\"resource\").find(t=>t.name===o.url);n.target=r.get(o),n.lcpEntry=o,o.url&&(n.url=o.url),i&&(n.lcpResourceEntry=i);const s=e();if(s){const e=s.activationStart||0,o=Math.max(0,s.responseStart-e),r=Math.max(o,i?(i.requestStart||i.startTime)-e:0),a=Math.min(t.value,Math.max(r,i?i.responseEnd-e:0));n={...n,timeToFirstByte:o,resourceLoadDelay:r-o,resourceLoadDuration:a-r,elementRenderDelay:t.value-a,navigationEntry:s}}}return Object.assign(t,{attribution:n})})(n))},n)},R=[800,1800],U=t=>{document.prerendering?T(()=>U(t)):\"complete\"!==document.readyState?addEventListener(\"load\",()=>U(t),!0):setTimeout(t)},V=(t,n={})=>{((t,n={})=>{let o=h(\"TTFB\"),i=f(t,o,R,n.reportAllChanges);U(()=>{const r=e();r&&(o.value=Math.max(r.responseStart-l(),0),o.entries=[r],i(!0),u(()=>{o=h(\"TTFB\",0),i=f(t,o,R,n.reportAllChanges),i(!0)}))})})(e=>{t((t=>{let e={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(t.entries.length){const n=t.entries[0],o=n.activationStart||0,i=Math.max((n.workerStart||n.fetchStart)-o,0),r=Math.max(n.domainLookupStart-o,0),s=Math.max(n.connectStart-o,0),a=Math.max(n.connectEnd-o,0);e={waitingDuration:i,cacheDuration:r-i,dnsDuration:s-r,connectionDuration:a-s,requestDuration:t.value-a,navigationEntry:n}}return Object.assign(t,{attribution:e})})(e))},n)};export{L as CLSThresholds,E as FCPThresholds,W as INPThresholds,$ as LCPThresholds,R as TTFBThresholds,P as onCLS,w as onFCP,x as onINP,H as onLCP,V as onTTFB};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\n/**\n * Web Vitals 插件\n *\n * 基于 google/web-vitals 库(attribution 版本)采集 Core Web Vitals:\n * CLS / FCP / INP / LCP / TTFB\n *\n * browser.web_vital span 带 vital.id(唯一)、vital.value 与 attribution 详情\n * (LCP 元素 url / CLS shift target / INP interaction target 等高基数字段),\n * 方便按个例排查\"哪个元素拖累了 LCP\"\n *\n * 数值语义:CLS 是无量纲分数,FCP/INP/LCP/TTFB 的 vital.value 单位为 ms。\n *\n * View 边界:FCP/LCP/TTFB 使用 web-vitals 的条目时间回查历史 View;CLS/INP 按 SDK View 重置,\n * CLS 使用 session window,INP 使用当前 View 的 p98 交互候选。\n *\n * 生命周期保护:\n * - disposed 标志位:shutdown 后所有回调入口 early return,避免向已销毁的 provider 上报\n * - dynamic import 完成后再次检查 disposed:处理\"start() 完成前 shutdown()\"的 race\n * - dynamic import 自身 try/catch:与 PluginManager 的 per-plugin 隔离形成纵深防御,\n * 即使加载失败也不影响整体启动\n */\n\nimport { type Attributes } from '@opentelemetry/api';\n\nimport { createRandomId } from '../core/id';\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\nimport { buildRumSpanAttributes, getVitalOutcome, RUM_SPAN_TYPE } from '../schema/span';\n\nimport type { BkOTPlugin } from '../core/plugin';\nimport type * as WebVitalsAttribution from 'web-vitals/attribution';\nimport type { MetricWithAttribution } from 'web-vitals/attribution';\n\ninterface EventTimingEntry extends PerformanceEntry {\n interactionId?: number;\n processingEnd?: number;\n processingStart?: number;\n target?: EventTarget | null;\n}\n\ninterface InpCandidate {\n duration: number;\n inputDelay: number;\n interactionId: number;\n interactionTarget?: string;\n interactionType: string;\n presentationDelay: number;\n processingDuration: number;\n}\n\ninterface LayoutShiftEntry extends PerformanceEntry {\n hadRecentInput?: boolean;\n value?: number;\n}\n\ninterface ViewVitalState {\n cls: number;\n clsWindowEnd?: number;\n clsWindowStart?: number;\n clsWindowValue: number;\n id: string;\n inpCandidates: InpCandidate[];\n interactionCountAtStart?: number;\n interactionIdMax: number;\n interactionIdMin: number;\n runtimeAttributes: Attributes;\n startedAt: number;\n}\n\ntype VitalLike = Pick<MetricWithAttribution, 'attribution' | 'entries' | 'id' | 'name' | 'rating' | 'value'>;\n\nconst MAX_INP_CANDIDATES = 10;\nconst MAX_INP_VALUE = 60_000;\nconst MAX_CLS_WINDOW_DURATION = 5_000;\nconst MAX_CLS_UPDATE_GAP = 1_000;\n\nexport const isSameViewId = (currentViewId: string | undefined, nextViewId: string | undefined) =>\n Boolean(nextViewId) && currentViewId === nextViewId;\n\nconst getRating = (name: 'CLS' | 'INP', value: number): VitalLike['rating'] => {\n const [good, poor] = name === 'CLS' ? [0.1, 0.25] : [200, 500];\n return value <= good ? 'good' : value <= poor ? 'needs-improvement' : 'poor';\n};\n\nconst getTargetName = (target: EventTarget | Node | null | undefined) => {\n if (typeof Element === 'undefined' || !(target instanceof Element)) return undefined;\n return (\n target.getAttribute('data-bk-action-name') ??\n target.getAttribute('aria-label') ??\n target.getAttribute('name') ??\n target.tagName.toLowerCase()\n );\n};\n\nconst getInteractionCount = () => {\n if (typeof performance === 'undefined') return undefined;\n const value = (performance as Performance & { interactionCount?: number }).interactionCount;\n return typeof value === 'number' && Number.isFinite(value) ? value : undefined;\n};\n\nexport const updateViewCls = (view: ViewVitalState, entry: LayoutShiftEntry) => {\n const value = entry.value ?? 0;\n if (entry.hadRecentInput || !Number.isFinite(value)) return;\n const shouldCreateWindow =\n view.clsWindowStart === undefined ||\n entry.startTime - (view.clsWindowEnd ?? entry.startTime) >= MAX_CLS_UPDATE_GAP ||\n entry.startTime - view.clsWindowStart >= MAX_CLS_WINDOW_DURATION;\n if (shouldCreateWindow) {\n view.clsWindowStart = entry.startTime;\n view.clsWindowValue = value;\n } else {\n view.clsWindowValue += value;\n }\n view.clsWindowEnd = entry.startTime;\n if (view.clsWindowValue > view.cls) {\n view.cls = Math.round(view.clsWindowValue * 10_000) / 10_000;\n }\n};\n\nexport const updateViewInp = (view: ViewVitalState, entry: EventTimingEntry) => {\n if (!entry.interactionId || !Number.isFinite(entry.duration)) return;\n view.interactionIdMin = Math.min(view.interactionIdMin, entry.interactionId);\n view.interactionIdMax = Math.max(view.interactionIdMax, entry.interactionId);\n const processingStart = entry.processingStart ?? entry.startTime;\n const processingEnd = entry.processingEnd ?? processingStart;\n const candidate: InpCandidate = {\n duration: Math.min(entry.duration, MAX_INP_VALUE),\n inputDelay: Math.max(0, processingStart - entry.startTime),\n interactionId: entry.interactionId,\n interactionTarget: getTargetName(entry.target),\n interactionType: entry.name,\n presentationDelay: Math.max(0, entry.startTime + entry.duration - processingEnd),\n processingDuration: Math.max(0, processingEnd - processingStart),\n };\n const index = view.inpCandidates.findIndex(item => item.interactionId === entry.interactionId);\n if (index >= 0) {\n if (candidate.duration > view.inpCandidates[index].duration) view.inpCandidates[index] = candidate;\n } else {\n view.inpCandidates.push(candidate);\n }\n view.inpCandidates.sort((left, right) => right.duration - left.duration).splice(MAX_INP_CANDIDATES);\n};\n\nexport const getViewInp = (view: ViewVitalState): InpCandidate | undefined => {\n const nativeCount = getInteractionCount();\n const interactionCount =\n nativeCount !== undefined && view.interactionCountAtStart !== undefined\n ? Math.max(0, nativeCount - view.interactionCountAtStart)\n : view.interactionIdMin === Infinity\n ? 0\n : (view.interactionIdMax - view.interactionIdMin) / 7 + 1;\n if (!view.inpCandidates.length) return undefined;\n return view.inpCandidates[Math.min(view.inpCandidates.length - 1, Math.floor(interactionCount / 50))];\n};\n\n// 把 attribution 中价值最高的字段抽出来写入 Span。\nconst pickAttribution = (metric: VitalLike, redactUrl: (url: string) => string): Attributes => {\n const attr = metric.attribution ?? {};\n const result: Attributes = {};\n const getAttrValue = (key: string) => (attr as Record<string, unknown>)[key];\n\n const setIfDefined = (key: string, value: unknown, transform?: (value: string) => string) => {\n if (value === undefined || value === null) return;\n if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {\n result[key] = typeof value === 'string' && transform ? transform(value) : value;\n }\n };\n\n switch (metric.name) {\n case 'LCP':\n setIfDefined('vital.lcp.url', getAttrValue('url'), redactUrl);\n setIfDefined('vital.lcp.target', getAttrValue('target'));\n setIfDefined('vital.lcp.element_render_delay', getAttrValue('elementRenderDelay'));\n setIfDefined('vital.lcp.resource_load_duration', getAttrValue('resourceLoadDuration'));\n break;\n case 'CLS':\n setIfDefined('vital.cls.load_state', getAttrValue('loadState'));\n break;\n case 'INP':\n setIfDefined('vital.inp.interaction_target', getAttrValue('interactionTarget'));\n setIfDefined('vital.inp.interaction_type', getAttrValue('interactionType'));\n setIfDefined('vital.inp.input_delay', getAttrValue('inputDelay'));\n setIfDefined('vital.inp.processing_duration', getAttrValue('processingDuration'));\n setIfDefined('vital.inp.presentation_delay', getAttrValue('presentationDelay'));\n break;\n case 'TTFB':\n setIfDefined('vital.ttfb.waiting_duration', getAttrValue('waitingDuration'));\n setIfDefined('vital.ttfb.dns_duration', getAttrValue('dnsDuration'));\n setIfDefined('vital.ttfb.connection_duration', getAttrValue('connectionDuration'));\n setIfDefined('vital.ttfb.request_duration', getAttrValue('requestDuration'));\n break;\n default:\n break;\n }\n return result;\n};\n\nexport const createWebVitalsPlugin = (): BkOTPlugin => {\n let cleanup: (() => void) | undefined;\n let disposed = false;\n\n return {\n name: 'web-vitals',\n async init(context) {\n if (typeof window === 'undefined') {\n return;\n }\n\n // dynamic import 自包 try/catch:与 PluginManager 的 per-plugin 隔离形成纵深防御,\n // 离线 / chunk 加载失败时不影响其他插件,且 debug 模式留下排查痕迹\n let webVitalsModule: typeof WebVitalsAttribution;\n try {\n webVitalsModule = await import('web-vitals/attribution');\n } catch (error) {\n if (context.config.debug) {\n globalThis.console?.warn('[bk-ot] web-vitals load failed:', error);\n }\n return;\n }\n // import 期间用户可能已经 shutdown:此后再注册回调会向已销毁 provider 上报\n if (disposed) return;\n\n const { onFCP, onLCP, onTTFB } = webVitalsModule;\n const recordSpan = (\n metric: VitalLike,\n runtimeAttributes: Attributes,\n contextTime?: number,\n occurredAt = contextTime ?? Date.now(),\n ) => {\n if (!context.isSampled()) return;\n const metricName = metric.name.toLowerCase();\n const span = context.startSpan(\n 'browser.web_vital',\n {\n ...context.config.hooks.getPageAttributes(),\n ...runtimeAttributes,\n ...buildRumSpanAttributes({\n outcome: getVitalOutcome(metric.rating),\n spanType: RUM_SPAN_TYPE.vital,\n }),\n [RUM_ATTRIBUTES.vitalMetric]: metricName,\n [RUM_ATTRIBUTES.vitalValue]: metric.value,\n 'vital.id': metric.id,\n ...pickAttribution(metric, context.config.hooks.redactUrl),\n },\n { contextTime, startTime: occurredAt },\n );\n span.end(occurredAt);\n };\n\n const recordDurationVital = (metric: VitalLike) => {\n // 防御非法值:极端浏览器实现 bug 可能给出 NaN/Infinity,OT 后端会拒收\n if (disposed || !Number.isFinite(metric.value) || !context.isSampled()) return;\n const firstEntry = metric.entries[0];\n const contextTime =\n firstEntry && typeof performance !== 'undefined' ? performance.timeOrigin + firstEntry.startTime : undefined;\n const runtimeAttributes =\n contextTime === undefined ? context.getRuntimeAttributes() : context.getRuntimeAttributesAt(contextTime);\n recordSpan(metric, runtimeAttributes, contextTime);\n };\n\n let currentView: undefined | ViewVitalState;\n let eventObserver: PerformanceObserver | undefined;\n let layoutShiftObserver: PerformanceObserver | undefined;\n\n const recordViewVital = (metric: VitalLike, runtimeAttributes: Attributes, contextTime: number) => {\n recordSpan(metric, runtimeAttributes, contextTime, Date.now());\n };\n\n const finalizeView = () => {\n const view = currentView;\n if (!view || !context.isSampled()) return;\n recordViewVital(\n {\n attribution: {},\n entries: [],\n id: createRandomId('vital'),\n name: 'CLS',\n rating: getRating('CLS', view.cls),\n value: view.cls,\n } as VitalLike,\n view.runtimeAttributes,\n view.startedAt,\n );\n const inp = getViewInp(view);\n if (inp) {\n recordViewVital(\n {\n attribution: {\n inputDelay: inp.inputDelay,\n interactionTarget: inp.interactionTarget,\n interactionType: inp.interactionType,\n presentationDelay: inp.presentationDelay,\n processingDuration: inp.processingDuration,\n },\n entries: [],\n id: createRandomId('vital'),\n name: 'INP',\n rating: getRating('INP', inp.duration),\n value: inp.duration,\n } as VitalLike,\n view.runtimeAttributes,\n view.startedAt,\n );\n }\n };\n\n const unsubscribeView = context.onViewChange(view => {\n const activeVitalView = currentView;\n if (activeVitalView && isSameViewId(activeVitalView.id, view.id)) {\n activeVitalView.runtimeAttributes = {\n ...activeVitalView.runtimeAttributes,\n [RUM_ATTRIBUTES.viewId]: view.id,\n ...(view.name ? { [RUM_ATTRIBUTES.viewName]: view.name } : {}),\n [RUM_ATTRIBUTES.viewUrl]: view.url,\n [RUM_ATTRIBUTES.viewUrlTemplate]: view.urlTemplate,\n };\n return;\n }\n finalizeView();\n currentView = view.id\n ? {\n cls: 0,\n clsWindowValue: 0,\n interactionCountAtStart: getInteractionCount(),\n interactionIdMax: 0,\n interactionIdMin: Infinity,\n inpCandidates: [],\n id: view.id,\n runtimeAttributes: context.getRuntimeAttributes(),\n startedAt: view.startedAt ?? Date.now(),\n }\n : undefined;\n });\n\n if (typeof PerformanceObserver !== 'undefined') {\n if (PerformanceObserver.supportedEntryTypes?.includes('layout-shift')) {\n layoutShiftObserver = new PerformanceObserver(list => {\n if (!currentView) return;\n for (const entry of list.getEntries() as LayoutShiftEntry[]) {\n const startedAt = performance.timeOrigin + entry.startTime;\n if (startedAt < currentView.startedAt) continue;\n updateViewCls(currentView, entry);\n }\n });\n layoutShiftObserver.observe({ buffered: true, type: 'layout-shift' });\n }\n if (PerformanceObserver.supportedEntryTypes?.includes('event')) {\n eventObserver = new PerformanceObserver(list => {\n if (!currentView) return;\n for (const entry of list.getEntries() as EventTimingEntry[]) {\n const startedAt = performance.timeOrigin + entry.startTime;\n if (startedAt < currentView.startedAt || !entry.interactionId || !Number.isFinite(entry.duration))\n continue;\n updateViewInp(currentView, entry);\n }\n });\n eventObserver.observe({ buffered: true, durationThreshold: 40, type: 'event' });\n }\n }\n onFCP(recordDurationVital);\n onLCP(recordDurationVital);\n onTTFB(recordDurationVital);\n\n cleanup = () => {\n finalizeView();\n currentView = undefined;\n unsubscribeView();\n layoutShiftObserver?.disconnect();\n eventObserver?.disconnect();\n };\n },\n shutdown() {\n // web-vitals 的 onXXX 不返回 unsubscribe,无法真正取消订阅;\n // 用 disposed 标志位让回调入口 early return 即可\n disposed = true;\n cleanup?.();\n cleanup = undefined;\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n */\n\nimport { SpanKind } from '@opentelemetry/api';\n\nimport { createRandomId } from '../core/id';\nimport { shouldIgnoreUrl } from '../core/url';\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\nimport { buildRumSpanAttributes, RUM_SPAN_OUTCOME, RUM_SPAN_TYPE } from '../schema/span';\n\nimport type { BkOTPlugin, BkOTRuntimeContext } from '../core/plugin';\nimport type { Attributes } from '@opentelemetry/api';\n\nconst buildWebSocketAttributes = (url: string, redactUrl: (url: string) => string): Attributes => {\n const attributes: Attributes = {\n 'network.protocol.name': 'websocket',\n 'url.full': redactUrl(url),\n };\n try {\n const parsed = new URL(url, typeof location === 'undefined' ? 'http://localhost' : location.href);\n attributes['server.address'] = parsed.hostname;\n if (parsed.port) attributes['server.port'] = Number(parsed.port);\n attributes['url.scheme'] = parsed.protocol.replace(':', '');\n } catch {\n // 非法 URL 仍保留脱敏后的原始字符串。\n }\n return attributes;\n};\n\nconst instrumentSocket = (socket: WebSocket, context: BkOTRuntimeContext, url: string, isDisposed: () => boolean) => {\n const connectionId = createRandomId('websocket');\n const baseAttributes = buildWebSocketAttributes(url, context.config.hooks.redactUrl);\n let opened = false;\n\n const emit = (phase: 'close' | 'connect' | 'error' | 'open', timestamp: number, attributes: Attributes = {}) => {\n if (isDisposed() || !context.isSampled()) return;\n const isError = phase === 'error';\n const span = context.startSpan(\n 'browser.websocket',\n {\n ...baseAttributes,\n ...buildRumSpanAttributes({\n outcome: isError ? RUM_SPAN_OUTCOME.error : RUM_SPAN_OUTCOME.success,\n spanType: RUM_SPAN_TYPE.websocket,\n }),\n [RUM_ATTRIBUTES.websocketPhase]: phase,\n 'websocket.connection.id': connectionId,\n ...attributes,\n },\n { kind: SpanKind.CLIENT, startTime: timestamp },\n );\n span.end(timestamp);\n };\n\n emit('connect', Date.now());\n socket.addEventListener('open', () => {\n opened = true;\n emit('open', Date.now());\n });\n socket.addEventListener('error', () => {\n emit('error', Date.now(), { 'websocket.error.phase': opened ? 'runtime' : 'connect' });\n });\n socket.addEventListener('close', event => {\n emit('close', Date.now(), {\n 'websocket.close.code': event.code,\n 'websocket.close.reason': event.reason,\n 'websocket.close.was_clean': event.wasClean,\n });\n });\n};\n\nexport const createWebSocketPlugin = (): BkOTPlugin => {\n let originalWebSocket: typeof WebSocket | undefined;\n let patchedProxy: typeof WebSocket | undefined;\n let disposed = false;\n\n return {\n name: 'websocket',\n init(context) {\n if (typeof window === 'undefined' || typeof window.WebSocket === 'undefined') return;\n const nativeWebSocket = window.WebSocket;\n originalWebSocket = nativeWebSocket;\n patchedProxy = new Proxy(nativeWebSocket, {\n construct(target, args, newTarget) {\n const socket = Reflect.construct(target, args, newTarget) as WebSocket;\n if (disposed || !context.isSampled()) return socket;\n const url = args[0] == null ? '' : String(args[0]);\n if (url && !shouldIgnoreUrl(context.config, url)) {\n instrumentSocket(socket, context, url, () => disposed);\n }\n return socket;\n },\n });\n window.WebSocket = patchedProxy;\n },\n shutdown() {\n disposed = true;\n if (typeof window !== 'undefined' && originalWebSocket && window.WebSocket === patchedProxy) {\n window.WebSocket = originalWebSocket;\n }\n patchedProxy = undefined;\n originalWebSocket = undefined;\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n */\n\nexport type BkOTActivityEvent =\n | { endTime: number; startTime: number; type: 'long_task'; url?: never }\n | { endTime: number; startTime: number; type: 'resource'; url?: string }\n | { id: string; time: number; type: 'request_end' }\n | { id: string; time: number; type: 'request_start'; url?: string }\n | { time: number; type: 'dom_mutation' | 'error' | 'window_open' };\n\nexport class RumActivityObserver {\n private readonly listeners = new Set<(event: BkOTActivityEvent) => void>();\n\n public notify = (event: BkOTActivityEvent) => {\n this.listeners.forEach(listener => listener(event));\n };\n\n public subscribe = (listener: (event: BkOTActivityEvent) => void) => {\n this.listeners.add(listener);\n return () => this.listeners.delete(listener);\n };\n}\n","{\n \"name\": \"@blueking/open-telemetry\",\n \"version\": \"0.0.31\",\n \"description\": \"OpenTelemetry browser SDK for BK RUM\",\n \"author\": \"TencentCloud Real User Monitoring\",\n \"main\": \"dist/index.js\",\n \"unpkg\": \"dist/bk-rum.global.js\",\n \"jsdelivr\": \"dist/bk-rum.global.js\",\n \"license\": \"MIT\",\n \"files\": [\n \"dist\",\n \"skills\"\n ],\n \"scripts\": {\n \"prepublishOnly\": \"pnpm build && pnpm dts && pnpm skill:refs\",\n \"skill:refs\": \"node scripts/gen-skill-references.mjs\",\n \"test:skill-refs\": \"node --test tests/gen-skill-references.test.mjs\",\n \"build\": \"vite build && vite build --mode cdn && pnpm dts\",\n \"build:cdn\": \"vite build --mode cdn\",\n \"build:esm\": \"vite build\",\n \"docs:build\": \"vitepress build wikis\",\n \"docs:dev\": \"vitepress dev wikis\",\n \"docs:preview\": \"vitepress preview wikis\",\n \"dev\": \"vite dev\",\n \"dts\": \"vue-tsc --project tsconfig.dts.json\",\n \"test:rum-context\": \"node --experimental-default-type=module --experimental-strip-types --test tests/action-plugin.test.mjs tests/consent.test.mjs tests/experience-plugins.test.mjs tests/request-model.test.mjs tests/runtime-context.test.mjs tests/sampling.test.mjs tests/session-state.test.ts tests/session-plugin.test.mjs tests/session-page-view.test.mjs tests/session-processors.test.mjs tests/trace-context.test.mjs tests/web-vitals.test.mjs\"\n },\n \"dependencies\": {\n \"@opentelemetry/api\": \"^1.9.1\",\n \"@opentelemetry/context-zone\": \"2.7.1\",\n \"@opentelemetry/core\": \"^2.7.1\",\n \"@opentelemetry/exporter-trace-otlp-http\": \"^0.217.0\",\n \"@opentelemetry/instrumentation\": \"^0.217.0\",\n \"@opentelemetry/resources\": \"^2.7.1\",\n \"@opentelemetry/sdk-trace-base\": \"^2.7.1\",\n \"@opentelemetry/sdk-trace-web\": \"^2.7.1\",\n \"@opentelemetry/semantic-conventions\": \"^1.38.0\",\n \"web-vitals\": \"^5.0.3\"\n },\n \"devDependencies\": {\n \"@vitejs/plugin-vue\": \"^6.0.6\",\n \"@vue/test-utils\": \"^2.4.6\",\n \"@vue/tsconfig\": \"^0.9.0\",\n \"oxc-minify\": \"^0.133.0\",\n \"vite\": \"^8.0.2\",\n \"vite-bundle-analyzer\": \"^1.3.2\",\n \"vitepress\": \"2.0.0-alpha.16\",\n \"vue\": \"^3.5.34\",\n \"vue-router\": \"^5.0.6\",\n \"vue-tsc\": \"^3.1.4\"\n }\n}\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { version as packageVersion } from '../../package.json';\nimport { getDeviceResourceAttributes } from '../plugins/device';\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\nimport { normalizeUrlPathTemplate } from './url';\n\nimport type { BkOTActionPluginOptions } from '../plugins/action';\nimport type { BkOTBlankScreenPluginOptions } from '../plugins/blank-screen';\nimport type { BkOTDevicePluginOptions } from '../plugins/device';\nimport type { BkOTLongTaskPluginOptions } from '../plugins/long-task';\nimport type { BkOTSessionConfig } from '../plugins/session';\nimport type { RumRequestOutcome } from '../schema/span';\nimport type { BkOTPlugin } from './plugin';\nimport type { BkOTUserContext } from './runtime-context';\nimport type { Attributes } from '@opentelemetry/api';\nimport type { Instrumentation } from '@opentelemetry/instrumentation';\n\nexport interface BkOTActionEventPayload {\n attributes?: Attributes;\n name: string;\n}\n\nexport interface BkOTApplicationConfig {\n environment?: string;\n name: string;\n version?: string;\n}\n\nexport interface BkOTAttributesConfig {\n custom?: () => Attributes;\n error?: () => Attributes;\n page?: () => Attributes;\n}\n\nexport type BkOTAttributeValue = boolean | number | string;\n\nexport interface BkOTBatchConfig {\n exportTimeoutMillis?: number;\n maxExportBatchSize?: number;\n maxQueueSize?: number;\n scheduledDelayMillis?: number;\n}\n\nexport interface BkOTBeforeSendEvent {\n attributes: Record<string, unknown>;\n name: string;\n signal: 'span';\n}\n\nexport interface BkOTContextConfig {\n attributes?: BkOTAttributesConfig;\n user?: BkOTUserContext;\n}\n\nexport interface BkOTCustomEventPayload {\n attributes?: Attributes;\n error?: Error;\n name: string;\n}\n\nexport interface BkOTExtensionsConfig {\n instrumentations?: Instrumentation[];\n plugins?: BkOTPlugin[];\n}\n\nexport interface BkOTOptions {\n application: BkOTApplicationConfig;\n autoStart?: boolean;\n context?: BkOTContextConfig;\n debug?: boolean;\n enabled?: boolean;\n extensions?: BkOTExtensionsConfig;\n privacy?: BkOTPrivacyConfig;\n session?: BkOTSessionConfig;\n tracking?: BkOTTrackingConfig;\n transport: BkOTTransportConfig;\n}\n\nexport interface BkOTPrivacyConfig {\n /** 初始化时的采集授权状态;运行期可通过 setTrackingConsent 更新。 */\n trackingConsent?: BkOTTrackingConsent;\n /** 在所有 RUM 自定义插件 emit 前统一过滤属性。 */\n redactAttributes?: (attributes: Attributes) => Attributes;\n /** 所有写入 attribute 的 URL 都会先经过此函数。 */\n redactUrl?: (url: string) => string;\n}\n\nexport interface BkOTRequestConfig {\n allowedTracingUrls?: BkOTUrlMatcher | BkOTUrlMatcher[];\n excludedUrls?: BkOTUrlMatcher | BkOTUrlMatcher[];\n beforeSend?: (event: BkOTRequestEvent, context: BkOTRequestContext) => boolean | void;\n /** 返回请求 URL 的低基数模板,例如 `/api/orders/{id}`;返回空值时回退到默认折叠规则。 */\n getUrlTemplate?: (url: string) => string | undefined;\n}\n\nexport type BkOTRequestContext =\n | { error?: unknown; request: Request | RequestInit; response?: Response; type: 'fetch' }\n | { type: 'xhr'; xhr: XMLHttpRequest };\n\nexport interface BkOTRequestEvent {\n attributes: Attributes;\n type: 'resource';\n resource: {\n method?: string;\n outcome: BkOTRequestOutcome;\n transport: 'fetch' | 'xhr';\n url?: string;\n };\n}\n\nexport type BkOTRequestOutcome = RumRequestOutcome;\n\nexport type BkOTSpanProcessorMode = 'batch' | 'simple';\n\nexport interface BkOTTrackingConfig {\n action?: BkOTActionPluginOptions | boolean;\n blankScreen?: BkOTBlankScreenPluginOptions | boolean;\n cspViolation?: boolean;\n device?: BkOTDevicePluginOptions | boolean;\n error?: boolean;\n longTask?: BkOTLongTaskPluginOptions | boolean;\n request?: BkOTRequestConfig | boolean;\n resource?: boolean;\n view?: BkOTViewConfig;\n websocket?: boolean;\n webVitals?: boolean;\n beforeSend?: (event: BkOTBeforeSendEvent) => boolean | void;\n}\n\nexport type BkOTTrackingConsent = 'granted' | 'not-granted';\n\nexport interface BkOTTransportConfig {\n batch?: BkOTBatchConfig;\n concurrencyLimit?: number;\n endpoint: string;\n headers?: Record<string, string>;\n processor?: BkOTSpanProcessorMode;\n timeoutMillis?: number;\n token?: string;\n}\n\nexport type BkOTUrlMatcher = ((url: string) => boolean) | RegExp | string;\n\nexport interface BkOTViewConfig {\n /** 不参与 View loading time 的长轮询、流式请求或埋点 URL。 */\n excludedActivityUrls?: BkOTUrlMatcher | BkOTUrlMatcher[];\n /** 自动计算初始加载与 SPA 路由的页面稳定耗时,默认开启。 */\n loadingTime?: boolean;\n tracking?: 'auto' | 'manual';\n /** 返回页面路由的低基数模板,例如 `/trace/:id`;返回空值时回退到默认折叠规则。 */\n getUrlTemplate?: (url: string) => string | undefined;\n}\n\nexport interface ResolvedApplicationConfig {\n environment: string;\n name: string;\n version?: string;\n}\n\nexport interface ResolvedBkOTConfig {\n application: ResolvedApplicationConfig;\n autoStart: boolean;\n debug: boolean;\n enabled: boolean;\n extensions: BkOTExtensionsConfig;\n hooks: ResolvedConfigHooks;\n resourceAttributes: Attributes;\n session: ResolvedSessionConfig;\n spanBatch?: BkOTBatchConfig;\n spanProcessor: BkOTSpanProcessorMode;\n tracking: BkOTTrackingConfig;\n trackingConsent: BkOTTrackingConsent;\n transport: ResolvedTransportConfig;\n user?: BkOTUserContext;\n view: ResolvedViewConfig;\n}\n\nexport interface ResolvedConfigHooks {\n beforeSend?: (event: BkOTBeforeSendEvent) => boolean | void;\n getCustomAttributes: () => Attributes;\n getErrorAttributes: () => Attributes;\n getPageAttributes: () => Attributes;\n getRequestUrlTemplate: (url: string) => string;\n getViewUrlTemplate: (url: string) => string;\n redactAttributes: (attributes: Attributes) => Attributes;\n redactUrl: (url: string) => string;\n}\n\nexport interface ResolvedSessionConfig extends BkOTSessionConfig {\n sampleRate: number;\n}\n\nexport interface ResolvedTransportConfig {\n concurrencyLimit?: number;\n endpoint: string;\n headers?: Record<string, string>;\n timeoutMillis?: number;\n}\n\nexport interface ResolvedViewConfig {\n excludedActivityUrls?: BkOTUrlMatcher | BkOTUrlMatcher[];\n loadingTime: boolean;\n tracking: 'auto' | 'manual';\n}\n\nconst trimTrailingSlash = (value: string) => value.trim().replace(/\\/+$/, '');\n\nconst resolveTransportConfig = (transport: BkOTTransportConfig): ResolvedTransportConfig => {\n // token 只负责提供默认鉴权头;headers 保持显式配置优先,便于特殊场景覆盖。\n const mergedHeaders =\n transport.token || transport.headers\n ? {\n ...(transport.token ? { Authorization: `Bearer ${transport.token}` } : {}),\n ...(transport.headers ?? {}),\n }\n : undefined;\n\n return {\n concurrencyLimit: transport.concurrencyLimit,\n endpoint: `${trimTrailingSlash(transport.endpoint)}/v1/rum`,\n headers: mergedHeaders,\n timeoutMillis: transport.timeoutMillis,\n };\n};\n\nconst clampSampleRate = (sampleRate?: number) => {\n if (typeof sampleRate !== 'number' || !Number.isFinite(sampleRate)) {\n return 1;\n }\n return Math.max(0, Math.min(1, sampleRate));\n};\n\nconst identityRedactAttributes = (attributes: Attributes) => attributes;\n\n// 默认只保留 URL 的定位信息;认证信息、查询参数和 fragment 可能携带用户数据,统一移除。\nconst defaultRedactUrl = (url: string) => {\n if (!url) return url;\n try {\n const parsed = new URL(url, typeof location === 'undefined' ? 'http://localhost' : location.href);\n parsed.username = '';\n parsed.password = '';\n parsed.search = '';\n parsed.hash = '';\n return parsed.href;\n } catch {\n return url.replace(/[?#].*$/, '');\n }\n};\n\nconst getUrlPathname = (url: string) => {\n try {\n return new URL(url, typeof location === 'undefined' ? 'http://localhost' : location.href).pathname || '/';\n } catch {\n return url || '/';\n }\n};\n\n/**\n * 低基数路径模板,供 `view.url_template` 与 `url.template` 共用同一套折叠规则。\n * 只保留 path:host 维度由 `server.address` 表达,query 由 `normalizeUrlPathTemplate` 去掉。\n */\nconst templatizeUrlPath = (url: string) => normalizeUrlPathTemplate(getUrlPathname(url));\n\n/** 模板 Hook 在每个请求/导航上都会跑,抛错不能影响追踪本身 */\nconst resolveTemplateHook =\n (config: BkOTOptions, custom: ((url: string) => string | undefined) | undefined) => (url: string) => {\n try {\n const templated = custom?.(url);\n if (templated) return templated;\n } catch (error) {\n if (config.debug) globalThis.console?.warn('[bk-ot] url template hook failed:', error);\n }\n return templatizeUrlPath(url);\n };\n\nconst resolveApplicationConfig = (application: BkOTOptions['application']): ResolvedApplicationConfig => ({\n environment: application.environment ?? 'production',\n name: application.name,\n version: application.version,\n});\n\nconst resolveResourceAttributes = (\n application: ResolvedApplicationConfig,\n device: BkOTTrackingConfig['device'],\n sampleRate: number,\n): Attributes => ({\n [RUM_ATTRIBUTES.deploymentEnvironmentName]: application.environment,\n ...(device === false ? {} : getDeviceResourceAttributes()),\n [RUM_ATTRIBUTES.serviceName]: application.name,\n ...(application.version ? { [RUM_ATTRIBUTES.serviceVersion]: application.version } : {}),\n [RUM_ATTRIBUTES.sessionSampleRate]: sampleRate,\n 'telemetry.sdk.language': 'webjs',\n 'telemetry.sdk.name': 'blueking',\n 'telemetry.sdk.version': packageVersion,\n});\n\nconst validateTransportConfig = (transport: BkOTTransportConfig | undefined) => {\n if (!transport) throw new Error('[bk-ot] transport is required.');\n if (!transport.endpoint?.trim()) throw new Error('[bk-ot] transport.endpoint is required.');\n};\n\nconst resolveHooks = (config: BkOTOptions): ResolvedConfigHooks => ({\n beforeSend: config.tracking?.beforeSend,\n getPageAttributes: config.context?.attributes?.page ?? (() => ({})),\n getErrorAttributes: config.context?.attributes?.error ?? (() => ({})),\n getCustomAttributes: config.context?.attributes?.custom ?? (() => ({})),\n getRequestUrlTemplate: resolveTemplateHook(\n config,\n typeof config.tracking?.request === 'object' ? config.tracking.request.getUrlTemplate : undefined,\n ),\n getViewUrlTemplate: resolveTemplateHook(\n config,\n typeof config.tracking?.view === 'object' ? config.tracking.view.getUrlTemplate : undefined,\n ),\n redactAttributes: config.privacy?.redactAttributes ?? identityRedactAttributes,\n redactUrl: config.privacy?.redactUrl ?? defaultRedactUrl,\n});\n\nexport const resolveConfig = (config: BkOTOptions): ResolvedBkOTConfig => {\n if (!config.application?.name?.trim()) {\n throw new Error('[bk-ot] application.name is required.');\n }\n validateTransportConfig(config.transport);\n const application = resolveApplicationConfig(config.application);\n const viewConfig = typeof config.tracking?.view === 'object' ? config.tracking.view : undefined;\n const hooks = resolveHooks(config);\n const sampleRate = clampSampleRate(config.session?.sampleRate);\n\n return {\n application,\n autoStart: config.autoStart ?? true,\n debug: config.debug ?? false,\n enabled: config.enabled ?? true,\n extensions: {\n instrumentations: [...(config.extensions?.instrumentations ?? [])],\n plugins: [...(config.extensions?.plugins ?? [])],\n },\n hooks,\n resourceAttributes: hooks.redactAttributes(\n resolveResourceAttributes(application, config.tracking?.device, sampleRate),\n ),\n session: {\n ...config.session,\n sampleRate,\n },\n spanBatch: config.transport.batch,\n spanProcessor: config.transport.processor ?? 'batch',\n tracking: config.tracking ?? {},\n trackingConsent: config.privacy?.trackingConsent ?? 'granted',\n transport: resolveTransportConfig(config.transport),\n user: config.context?.user,\n view: {\n excludedActivityUrls: viewConfig?.excludedActivityUrls,\n loadingTime: viewConfig?.loadingTime !== false,\n tracking: viewConfig?.tracking === 'manual' ? 'manual' : 'auto',\n },\n };\n};\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport type { BkOTActivityEvent } from './action-activity';\nimport type { ResolvedBkOTConfig } from './config';\nimport type { BkOTSessionLifecycleEvent, BkOTUserContext, BkOTViewCommand, BkOTViewContext } from './runtime-context';\nimport type { Attributes, Link, Span, SpanKind, TimeInput, Tracer } from '@opentelemetry/api';\nimport type { Instrumentation } from '@opentelemetry/instrumentation';\n\nexport interface BkOTPlugin {\n enabled?: ((config: ResolvedBkOTConfig) => boolean) | boolean;\n name: string;\n flush?: () => Promise<void> | void;\n init: (context: BkOTRuntimeContext) => Promise<void> | void;\n shutdown?: () => Promise<void> | void;\n}\n\nexport interface BkOTRuntimeContext {\n config: ResolvedBkOTConfig;\n tracer: Tracer;\n /** 对外提供的属性脱敏入口,所有插件在 emit 前都应过一次 */\n applyRedact: (attributes: Attributes) => Attributes;\n flush: () => Promise<void>;\n getRuntimeAttributes: () => Attributes;\n getRuntimeAttributesAt: (timestamp: number) => Attributes;\n isSampled: () => boolean;\n isSessionActive: () => boolean;\n isViewActive: () => boolean;\n notifyActivity: (event: BkOTActivityEvent) => void;\n notifySessionLifecycle: (event: BkOTSessionLifecycleEvent) => void;\n onActivity: (listener: (event: BkOTActivityEvent) => void) => () => void;\n onSessionLifecycle: (listener: (event: BkOTSessionLifecycleEvent) => void) => () => void;\n onViewChange: (listener: (view: BkOTViewContext) => void) => () => void;\n onViewCommand: (listener: (command: BkOTViewCommand) => void) => () => void;\n registerInstrumentations: (instrumentations: Instrumentation[]) => void;\n setRuntimeAttributes: (attributes: Attributes, changedAt?: number) => void;\n /** 更新用户上下文;user.id 由接入方传入,SDK 原样透传 */\n setUser: (user: BkOTUserContext) => void;\n /** 更新当前 View 上下文,后续 span 会自动带上 view.* 关联字段 */\n setView: (view: BkOTViewContext, changedAt?: number) => void;\n startSpan: (name: string, attributes?: Attributes, options?: BkOTStartSpanOptions) => Span;\n}\n\n/**\n * startSpan 的扩展选项。\n *\n * 用于\"事件实际发生在过去某个时刻,但 span 现在才创建\"的场景:\n * 例如 PerformanceObserver 在条目结束后才回调,但 span 的时间窗仍需反映\n * 条目真实发生的区间,方便 trace 视图与并发请求对齐。\n *\n * startTime 接受 OT TimeInput;常用 epoch 毫秒(performance.timeOrigin + performance.now())。\n * 配合 span.end(endTime?) 可控制结束时间。\n */\nexport interface BkOTStartSpanOptions {\n /** 用于从历史中解析 Session/View/Action 归属;默认复用数字类型 startTime。 */\n contextTime?: number;\n kind?: SpanKind;\n /** 关联其他 trace 的 Span Link;OTel 要求在创建时传入。 */\n links?: Link[];\n startTime?: TimeInput;\n}\n\nexport const isPluginEnabled = (plugin: BkOTPlugin, config: ResolvedBkOTConfig) => {\n if (typeof plugin.enabled === 'function') {\n return plugin.enabled(config);\n }\n return plugin.enabled !== false;\n};\n\nexport const createPlugin = (plugin: BkOTPlugin) => plugin;\n\nexport class PluginManager {\n private readonly plugins: BkOTPlugin[];\n private startedPlugins: BkOTPlugin[] = [];\n\n public constructor(plugins: BkOTPlugin[]) {\n this.plugins = plugins;\n }\n\n public async flush() {\n // 并行 flush,避免单个慢插件拖累整体\n await Promise.all(this.startedPlugins.map(plugin => Promise.resolve().then(() => plugin.flush?.())));\n }\n\n public async shutdown() {\n const plugins = [...this.startedPlugins].reverse();\n for (const plugin of plugins) {\n await plugin.shutdown?.();\n }\n this.startedPlugins = [];\n }\n\n public async start(context: BkOTRuntimeContext) {\n // 每个插件独立 try/catch,单个插件 init 失败不应拖累其他插件:\n // - 失败的插件不会进入 startedPlugins(shutdown 时不会被反向 teardown)\n // - debug 模式打 warn,方便排查;非 debug 静默失败避免污染业务日志\n for (const plugin of this.plugins) {\n if (!isPluginEnabled(plugin, context.config)) {\n continue;\n }\n try {\n await plugin.init(context);\n this.startedPlugins.push(plugin);\n } catch (error) {\n if (context.config.debug) {\n globalThis.console?.warn(`[bk-ot] plugin \"${plugin.name}\" init failed:`, error);\n }\n }\n }\n }\n}\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\n\nimport type { Attributes } from '@opentelemetry/api';\n\nexport type BkOTSessionLifecycleEvent =\n | {\n expiredAt: number;\n id: string;\n reason: 'external' | 'inactivity' | 'maxLifetime';\n type: 'expired';\n }\n | {\n id: string;\n previousId?: string;\n reason: 'inactivity' | 'init' | 'maxLifetime' | 'shared';\n startedAt: number;\n type: 'renewed';\n };\n\nexport interface BkOTStartViewOptions {\n attributes?: Attributes;\n name?: string;\n url?: string;\n}\n\nexport interface BkOTUserContext {\n /** 由接入方传入并由 SDK 原样透传;SDK 不 hash、不脱敏、不改写。 */\n id?: string;\n}\n\nexport type BkOTViewCommand =\n | { name: string; type: 'set_name' }\n | { options: BkOTStartViewOptions; type: 'start' }\n | { time: number; type: 'set_loading_time' };\n\nexport interface BkOTViewContext {\n attributes?: Attributes;\n id?: string;\n loadingType?: 'bf_cache' | 'initial_load' | 'route_change' | 'session_renewal';\n name?: string;\n startedAt?: number;\n url?: string;\n urlTemplate?: string;\n}\n\nconst PROTECTED_VIEW_ATTRIBUTE_KEYS = new Set<string>(Object.values(RUM_ATTRIBUTES));\n\nconst toActionId = (value: unknown): string | undefined => {\n if (typeof value === 'string' && value.length > 0) return value;\n if (!Array.isArray(value)) return undefined;\n for (let index = value.length - 1; index >= 0; index -= 1) {\n const item = value[index];\n if (typeof item === 'string' && item.length > 0) return item;\n }\n return undefined;\n};\n\n/**\n * 管理 SDK 运行期公共属性快照。\n *\n * 这里仅保存“后续事件都需要带上”的低成本上下文,Session/View/用户切换时更新快照,\n * 插件发 Span 时读取当前快照即可,避免每个插件重复维护公共字段。\n */\nexport class RumRuntimeContext {\n private readonly actionHistory: Array<{ attributes: Attributes; endedAt?: number; startedAt: number }> = [];\n private readonly attributes: Attributes = {};\n private readonly queuedViewCommands: BkOTViewCommand[] = [];\n\n // 保存关联关系的生效区间,供延迟到达的 PerformanceEntry 按事件时间回查原 Session/View/Action。\n private recordAssociation = (\n history: Array<{ attributes: Attributes; endedAt?: number; startedAt: number }>,\n keys: Iterable<string>,\n changedAt: number,\n active: boolean,\n ) => {\n const previous = history.at(-1);\n if (previous && previous.endedAt === undefined) previous.endedAt = Math.max(previous.startedAt, changedAt);\n if (active) {\n const associationAttributes: Attributes = {};\n for (const key of keys) {\n const value = this.attributes[key];\n if (value !== undefined) associationAttributes[key] = value;\n }\n history.push({ attributes: associationAttributes, startedAt: changedAt });\n }\n if (history.length > 100) history.splice(0, history.length - 100);\n };\n private readonly sessionHistory: Array<{ attributes: Attributes; endedAt?: number; startedAt: number }> = [];\n private sampled = false;\n private readonly samplingHistory: Array<{ endedAt?: number; sampled: boolean; startedAt: number }> = [];\n private readonly sessionLifecycleListeners = new Set<(event: BkOTSessionLifecycleEvent) => void>();\n private readonly setOptionalAttribute = (key: string, value: string | undefined) => {\n if (value === undefined) {\n delete this.attributes[key];\n return;\n }\n this.attributes[key] = value;\n };\n private user: BkOTUserContext = {};\n private view: BkOTViewContext = {};\n private readonly viewAttributeKeys = new Set<string>();\n private readonly viewChangeListeners = new Set<(view: BkOTViewContext) => void>();\n private readonly viewCommandListeners = new Set<(command: BkOTViewCommand) => void>();\n\n private readonly viewHistory: Array<{ attributes: Attributes; endedAt?: number; startedAt: number }> = [];\n\n private readonly viewScopedAttributeKeys = new Set<string>();\n\n public dispatchViewCommand = (command: BkOTViewCommand) => {\n // autoStart 下调用方可能早于 page-view 插件发命令,先排队可避免 startView/setViewName 丢失。\n if (this.viewCommandListeners.size === 0) {\n this.queuedViewCommands.push(command);\n return;\n }\n this.viewCommandListeners.forEach(listener => listener(command));\n };\n\n public getAttributes = (): Attributes => ({ ...this.attributes });\n\n public getAttributesAt = (timestamp: number): Attributes => {\n if (!Number.isFinite(timestamp)) return this.getAttributes();\n const result = this.getAttributes();\n const applyHistory = (\n history: Array<{ attributes: Attributes; endedAt?: number; startedAt: number }>,\n keys: Iterable<string>,\n ) => {\n // 先移除当前关联字段,再用目标时间所在的历史快照覆盖,避免把旧事件错误归到当前 View。\n for (const key of keys) delete result[key];\n const matched = [...history]\n .reverse()\n .find(entry => entry.startedAt <= timestamp && (entry.endedAt === undefined || timestamp < entry.endedAt));\n if (matched) Object.assign(result, matched.attributes);\n };\n applyHistory(this.sessionHistory, [RUM_ATTRIBUTES.sessionId, RUM_ATTRIBUTES.sessionHasReplay]);\n applyHistory(this.viewHistory, this.viewScopedAttributeKeys);\n applyHistory(this.actionHistory, [RUM_ATTRIBUTES.actionId]);\n return result;\n };\n\n public getUser = (): BkOTUserContext => ({ ...this.user });\n\n public getView = (): BkOTViewContext => ({ ...this.view });\n\n public isSessionActive = () => typeof this.attributes[RUM_ATTRIBUTES.sessionId] === 'string';\n\n public isSessionSampledAt = (timestamp: number) => {\n if (!Number.isFinite(timestamp)) return this.sampled;\n return (\n [...this.samplingHistory]\n .reverse()\n .find(entry => entry.startedAt <= timestamp && (entry.endedAt === undefined || timestamp < entry.endedAt))\n ?.sampled ?? false\n );\n };\n\n public isViewActive = () => typeof this.attributes[RUM_ATTRIBUTES.viewId] === 'string';\n\n public notifySessionLifecycle = (event: BkOTSessionLifecycleEvent) => {\n this.sessionLifecycleListeners.forEach(listener => listener(event));\n };\n\n public onSessionLifecycle = (listener: (event: BkOTSessionLifecycleEvent) => void) => {\n this.sessionLifecycleListeners.add(listener);\n return () => this.sessionLifecycleListeners.delete(listener);\n };\n\n public onViewChange = (listener: (view: BkOTViewContext) => void) => {\n this.viewChangeListeners.add(listener);\n if (this.view.id) listener(this.getView());\n return () => this.viewChangeListeners.delete(listener);\n };\n\n public onViewCommand = (listener: (command: BkOTViewCommand) => void) => {\n this.viewCommandListeners.add(listener);\n while (this.queuedViewCommands.length) {\n listener(this.queuedViewCommands.shift()!);\n }\n return () => this.viewCommandListeners.delete(listener);\n };\n\n public setAttributes = (attributes: Attributes, changedAt = Date.now()) => {\n for (const [key, value] of Object.entries(attributes)) {\n if (value === undefined) {\n delete this.attributes[key];\n continue;\n }\n this.attributes[key] = value;\n }\n if (RUM_ATTRIBUTES.sessionId in attributes) {\n this.recordAssociation(\n this.sessionHistory,\n [RUM_ATTRIBUTES.sessionId, RUM_ATTRIBUTES.sessionHasReplay],\n changedAt,\n typeof this.attributes[RUM_ATTRIBUTES.sessionId] === 'string',\n );\n }\n if (RUM_ATTRIBUTES.actionId in attributes) {\n const actionId = toActionId(this.attributes[RUM_ATTRIBUTES.actionId]);\n if (actionId === undefined) delete this.attributes[RUM_ATTRIBUTES.actionId];\n else this.attributes[RUM_ATTRIBUTES.actionId] = actionId;\n this.recordAssociation(\n this.actionHistory,\n [RUM_ATTRIBUTES.actionId],\n changedAt,\n typeof this.attributes[RUM_ATTRIBUTES.actionId] === 'string',\n );\n }\n };\n\n public setUser = (user: BkOTUserContext) => {\n this.user = {\n ...this.user,\n ...user,\n };\n\n if ('id' in user) {\n if (user.id === undefined) {\n delete this.attributes[RUM_ATTRIBUTES.userId];\n return;\n }\n this.attributes[RUM_ATTRIBUTES.userId] = user.id;\n }\n };\n\n public setSessionSampled = (sampled: boolean, changedAt = Date.now()) => {\n if (sampled === this.sampled) return;\n const previous = this.samplingHistory.at(-1);\n if (previous && previous.endedAt === undefined) previous.endedAt = Math.max(previous.startedAt, changedAt);\n this.sampled = sampled;\n if (sampled) this.samplingHistory.push({ sampled, startedAt: changedAt });\n if (this.samplingHistory.length > 100) {\n this.samplingHistory.splice(0, this.samplingHistory.length - 100);\n }\n };\n\n public setView = (view: BkOTViewContext, changedAt = view.startedAt ?? Date.now()) => {\n this.viewAttributeKeys.forEach(key => delete this.attributes[key]);\n this.viewAttributeKeys.clear();\n const viewAttributes: Attributes = {};\n for (const [key, value] of Object.entries(view.attributes ?? {})) {\n // 自定义 View 属性不能覆盖 SDK 维护的关联和语义字段。\n if (value === undefined || PROTECTED_VIEW_ATTRIBUTE_KEYS.has(key)) continue;\n viewAttributes[key] = value;\n this.attributes[key] = value;\n this.viewAttributeKeys.add(key);\n this.viewScopedAttributeKeys.add(key);\n }\n this.view = { ...view, attributes: viewAttributes };\n this.setOptionalAttribute(RUM_ATTRIBUTES.viewId, view.id);\n this.setOptionalAttribute(RUM_ATTRIBUTES.viewUrl, view.url);\n this.setOptionalAttribute(RUM_ATTRIBUTES.viewUrlTemplate, view.urlTemplate);\n this.setOptionalAttribute(RUM_ATTRIBUTES.viewLoadingType, view.loadingType);\n this.setOptionalAttribute(RUM_ATTRIBUTES.viewName, view.name);\n [\n RUM_ATTRIBUTES.viewId,\n RUM_ATTRIBUTES.viewUrl,\n RUM_ATTRIBUTES.viewUrlTemplate,\n RUM_ATTRIBUTES.viewLoadingType,\n RUM_ATTRIBUTES.viewName,\n ].forEach(key => this.viewScopedAttributeKeys.add(key));\n this.recordAssociation(\n this.viewHistory,\n this.viewScopedAttributeKeys,\n changedAt,\n typeof view.id === 'string' && view.id.length > 0,\n );\n this.viewChangeListeners.forEach(listener => listener(this.getView()));\n };\n\n public constructor(initialAttributes: Attributes = {}, user?: BkOTUserContext) {\n this.setAttributes(initialAttributes);\n if (user) {\n this.setUser(user);\n }\n }\n}\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport type { ResolvedBkOTConfig } from './config';\n\nconst hashToUnitInterval = (input: string) => {\n let hash = 0x811c9dc5;\n for (let index = 0; index < input.length; index += 1) {\n hash = Math.imul(hash ^ input.charCodeAt(index), 0x01000193);\n }\n hash += hash << 13;\n hash ^= hash >>> 7;\n hash += hash << 3;\n hash ^= hash >>> 17;\n hash += hash << 5;\n return (hash >>> 0) / 0x100000000;\n};\n\n/**\n * 按应用和 RUM Session ID 做确定性采样。采样决定随 Session 更新,不再依赖 Tab 级 sessionStorage。\n */\nexport const isBkOTSampled = (\n { application, session }: Pick<ResolvedBkOTConfig, 'application' | 'session'>,\n sessionId: string,\n) => {\n if (session.sampleRate <= 0) {\n return false;\n }\n if (session.sampleRate >= 1) {\n return true;\n }\n return hashToUnitInterval(`${application.name}\\0${sessionId}`) < session.sampleRate;\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\n/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2017-2025 Tencent. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { type Attributes, type Span, context, propagation, SpanKind, SpanStatusCode } from '@opentelemetry/api';\nimport { ZoneContextManager } from '@opentelemetry/context-zone';\nimport { W3CTraceContextPropagator } from '@opentelemetry/core';\nimport { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';\nimport { resourceFromAttributes } from '@opentelemetry/resources';\nimport { BatchSpanProcessor, SamplingDecision, SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base';\nimport { WebTracerProvider } from '@opentelemetry/sdk-trace-web';\n\nimport { createActionPlugin } from '../plugins/action';\nimport { createActivityPlugin } from '../plugins/activity';\nimport { createBlankScreenPlugin } from '../plugins/blank-screen';\nimport { createCommonInstrumentationsPlugin } from '../plugins/common';\nimport { createCspViolationPlugin } from '../plugins/csp-violation';\nimport { createDevicePlugin } from '../plugins/device';\nimport { createErrorPlugin } from '../plugins/error';\nimport { createLongTaskPlugin } from '../plugins/long-task';\nimport { createPageViewPlugin } from '../plugins/page-view';\nimport { createResourcePlugin } from '../plugins/resource';\nimport { createSessionPlugin } from '../plugins/session';\nimport { createWebVitalsPlugin } from '../plugins/web-vitals';\nimport { createWebSocketPlugin } from '../plugins/websocket';\nimport { RUM_ATTRIBUTES } from '../schema/attributes';\nimport { buildRumSpanAttributes, RUM_SPAN_OUTCOME, RUM_SPAN_TYPE } from '../schema/span';\nimport { RumActivityObserver } from './action-activity';\nimport {\n type BkOTActionEventPayload,\n type BkOTCustomEventPayload,\n type BkOTOptions,\n type BkOTTrackingConfig,\n type BkOTTrackingConsent,\n type ResolvedBkOTConfig,\n type ResolvedTransportConfig,\n resolveConfig,\n} from './config';\nimport { createRandomId } from './id';\nimport { type BkOTPlugin, type BkOTRuntimeContext, type BkOTStartSpanOptions, PluginManager } from './plugin';\nimport { FilteringSpanProcessor } from './processor';\nimport {\n type BkOTSessionLifecycleEvent,\n type BkOTStartViewOptions,\n type BkOTUserContext,\n RumRuntimeContext,\n} from './runtime-context';\nimport { isBkOTSampled } from './sampling';\n\nimport type { Instrumentation } from '@opentelemetry/instrumentation';\nimport type { Sampler } from '@opentelemetry/sdk-trace-base';\n\nexport interface BkOTInstance extends Omit<\n BkOTRuntimeContext,\n 'notifyActivity' | 'onActivity' | 'onViewChange' | 'onViewCommand' | 'registerInstrumentations' | 'setView'\n> {\n flush: () => Promise<void>;\n reportAction: (payload: BkOTActionEventPayload) => void;\n reportCustomEvent: (payload: BkOTCustomEventPayload) => void;\n setTrackingConsent: (consent: BkOTTrackingConsent) => Promise<void>;\n setUser: (user: BkOTUserContext) => void;\n setViewLoadingTime: () => void;\n setViewName: (name: string) => void;\n shutdown: () => Promise<void>;\n start: () => Promise<void>;\n startView: (options?: BkOTStartViewOptions) => void;\n use: (plugin: BkOTPlugin) => BkOTInstance;\n useInstrumentation: (instrumentation: Instrumentation) => BkOTInstance;\n}\n\nconst createExporterOptions = (config: ResolvedTransportConfig) => ({\n url: config.endpoint,\n headers: config.headers,\n concurrencyLimit: config.concurrencyLimit,\n timeoutMillis: config.timeoutMillis,\n});\n\nconst BK_OT_INSTRUMENTATION_NAME = 'bk-rum';\n\nclass RumSessionSampler implements Sampler {\n public constructor(private readonly isSampled: () => boolean) {}\n\n public shouldSample() {\n return {\n decision: this.isSampled() ? SamplingDecision.RECORD_AND_SAMPLED : SamplingDecision.NOT_RECORD,\n };\n }\n\n public toString() {\n return 'RumSessionSampler';\n }\n}\n\n// OTel context manager 和 propagator 是页面级全局对象,多 SDK 实例通过引用计数共享,最后一个实例退出时释放。\nlet globalRegistration:\n | undefined\n | {\n contextManager?: ZoneContextManager;\n ownsContext: boolean;\n ownsPropagator: boolean;\n users: number;\n };\n\nconst acquireOtelGlobals = () => {\n if (globalRegistration) {\n globalRegistration.users += 1;\n } else {\n const contextManager = new ZoneContextManager().enable();\n const ownsContext = context.setGlobalContextManager(contextManager);\n if (!ownsContext) contextManager.disable();\n globalRegistration = {\n contextManager: ownsContext ? contextManager : undefined,\n ownsContext,\n ownsPropagator: propagation.setGlobalPropagator(new W3CTraceContextPropagator()),\n users: 1,\n };\n }\n let released = false;\n return () => {\n if (released || !globalRegistration) return;\n released = true;\n globalRegistration.users -= 1;\n if (globalRegistration.users > 0) return;\n if (globalRegistration.ownsContext) context.disable();\n if (globalRegistration.ownsPropagator) propagation.disable();\n globalRegistration = undefined;\n };\n};\n\n/**\n * 用 Proxy 包装一层 debug 旁路,避免直接 mutate 第三方 exporter 实例(其内部可能含 #private fields)。\n */\nconst wrapWithDebug = <TExporter extends { export: (...args: any[]) => any }>(\n exporter: TExporter,\n enabled: boolean,\n): TExporter => {\n if (!enabled) {\n return exporter;\n }\n return new Proxy(exporter, {\n get(target, prop, receiver) {\n if (prop === 'export') {\n return (records: unknown, callback: unknown) => {\n globalThis.console?.log('[bk-ot][rum]', records);\n return (target as { export: (...args: unknown[]) => unknown }).export(records, callback);\n };\n }\n const value = Reflect.get(target, prop, receiver);\n return typeof value === 'function' ? value.bind(target) : value;\n },\n });\n};\n\n// 请求插件统一负责 Fetch/XHR span、Trace Header 与活动计数。\nconst getCorePlugins = (config: ResolvedBkOTConfig): BkOTPlugin[] => [\n createCommonInstrumentationsPlugin(config.tracking.request),\n];\n\nconst getRumContextPlugins = (config: ResolvedBkOTConfig): BkOTPlugin[] => [\n createSessionPlugin(config.session),\n ...createBuiltInPlugin(config.tracking.device, true, createDevicePlugin),\n createActivityPlugin(),\n createPageViewPlugin(),\n createResourcePlugin(isBuiltInPluginEnabled(config.tracking.resource, true)),\n];\n\nconst isBuiltInPluginEnabled = <TOptions extends object>(\n option: boolean | TOptions | undefined,\n defaultEnabled: boolean,\n) => (option === undefined ? defaultEnabled : option !== false);\n\nconst getBuiltInPluginOptions = <TOptions extends object>(option: boolean | TOptions | undefined) =>\n typeof option === 'object' && option !== null ? option : undefined;\n\nconst createBuiltInPlugin = <TOptions extends object>(\n option: boolean | TOptions | undefined,\n defaultEnabled: boolean,\n factory: (options?: TOptions) => BkOTPlugin,\n) => (isBuiltInPluginEnabled(option, defaultEnabled) ? [factory(getBuiltInPluginOptions(option))] : []);\n\n// 上下文插件先启动,确保后续 span 能带上关联字段;Session sampler 与 processor 负责统一采样。\nconst getRumPlugins = (tracking: BkOTTrackingConfig): BkOTPlugin[] => [\n ...createBuiltInPlugin(tracking.error, true, createErrorPlugin),\n ...createBuiltInPlugin(tracking.webVitals, true, createWebVitalsPlugin),\n ...createBuiltInPlugin(tracking.blankScreen, true, createBlankScreenPlugin),\n ...createBuiltInPlugin(tracking.action, true, createActionPlugin),\n ...createBuiltInPlugin(tracking.websocket, false, createWebSocketPlugin),\n ...createBuiltInPlugin(tracking.longTask, false, createLongTaskPlugin),\n ...createBuiltInPlugin(tracking.cspViolation, false, createCspViolationPlugin),\n];\n\ntype SdkLifecyclePhase = 'idle' | 'started' | 'starting' | 'stopped';\n\n/**\n * 浏览器 RUM SDK 的生命周期入口。Provider 在构造时创建,插件和全局 patch 则随 start、授权变更和\n * shutdown 安装或卸载;Session 决定统一作用于所有 RUM span。\n */\nexport class BkOpenTelemetry implements BkOTInstance {\n private readonly activityObserver = new RumActivityObserver();\n private readonly flushProviders = async () => {\n await this.tracerProvider.forceFlush();\n };\n private phase: SdkLifecyclePhase = 'idle';\n private pluginManager?: PluginManager;\n private readonly registeredInstrumentations: Instrumentation[];\n private releaseOtelGlobals?: () => void;\n private readonly runtimeContext: RumRuntimeContext;\n\n private sampled = false;\n private readonly startCollection = async () => {\n // Provider 始终存在以保持公开 API 稳定;采集插件仅在启用且获得授权后安装。\n if (this.pluginManager || !this.config.enabled || this.config.trackingConsent !== 'granted') return;\n this.releaseOtelGlobals = acquireOtelGlobals();\n const pluginManager = this.createPluginManager();\n this.pluginManager = pluginManager;\n try {\n await pluginManager.start(this.createPluginContext());\n this.registerInstrumentations(this.config.extensions.instrumentations ?? []);\n } catch (error) {\n await pluginManager.shutdown();\n this.pluginManager = undefined;\n while (this.registeredInstrumentations.length) this.registeredInstrumentations.pop()?.disable?.();\n this.releaseOtelGlobals?.();\n this.releaseOtelGlobals = undefined;\n throw error;\n }\n };\n private readonly stopCollection = async (flush: boolean) => {\n const pluginManager = this.pluginManager;\n if (!pluginManager) return;\n await pluginManager.shutdown();\n this.pluginManager = undefined;\n while (this.registeredInstrumentations.length) this.registeredInstrumentations.pop()?.disable?.();\n // 撤销授权后立即清空 Session,防止后续手工 API 继续复用旧采样决定。\n this.setRuntimeAttributes({\n [RUM_ATTRIBUTES.sessionHasReplay]: undefined,\n [RUM_ATTRIBUTES.sessionId]: undefined,\n });\n if (flush) await this.flushProviders();\n this.releaseOtelGlobals?.();\n this.releaseOtelGlobals = undefined;\n };\n private readonly teardownCallbacks: Array<() => void> = [];\n private readonly tracerProvider: WebTracerProvider;\n private assertBeforeStart(method: string) {\n if (this.phase !== 'idle') {\n throw new Error(`[bk-ot] ${method}() must be called before start(); set autoStart: false before registration.`);\n }\n }\n private createPluginContext(): BkOTRuntimeContext {\n return {\n applyRedact: this.applyRedact,\n config: this.config,\n flush: this.flush,\n getRuntimeAttributes: this.getRuntimeAttributes,\n getRuntimeAttributesAt: this.getRuntimeAttributesAt,\n isSampled: this.isSampled,\n isSessionActive: this.isSessionActive,\n isViewActive: this.isViewActive,\n notifySessionLifecycle: this.notifySessionLifecycle,\n notifyActivity: this.activityObserver.notify,\n onActivity: this.activityObserver.subscribe,\n onSessionLifecycle: this.onSessionLifecycle,\n onViewCommand: this.runtimeContext.onViewCommand,\n onViewChange: this.runtimeContext.onViewChange,\n registerInstrumentations: this.registerInstrumentations,\n setRuntimeAttributes: this.setRuntimeAttributes,\n setUser: this.setUser,\n setView: this.runtimeContext.setView,\n startSpan: this.startSpan,\n tracer: this.tracer,\n };\n }\n private createPluginManager() {\n return new PluginManager([\n ...getRumContextPlugins(this.config),\n ...getCorePlugins(this.config),\n ...getRumPlugins(this.config.tracking),\n ...(this.config.extensions.plugins ?? []),\n ]);\n }\n public readonly applyRedact = (attributes: Attributes) => this.config.hooks.redactAttributes(attributes);\n\n public readonly config: ResolvedBkOTConfig;\n\n public readonly flush = async () => {\n await this.pluginManager?.flush();\n await this.flushProviders();\n };\n\n public readonly getRuntimeAttributes = () => this.runtimeContext.getAttributes();\n public readonly getRuntimeAttributesAt = (timestamp: number) => this.runtimeContext.getAttributesAt(timestamp);\n public readonly isSampled = () => this.sampled;\n public readonly isSessionActive = () => this.runtimeContext.isSessionActive();\n public readonly isViewActive = () => this.runtimeContext.isViewActive();\n public readonly notifySessionLifecycle = (event: BkOTSessionLifecycleEvent) => {\n this.runtimeContext.notifySessionLifecycle(event);\n };\n\n public readonly onSessionLifecycle = (listener: (event: BkOTSessionLifecycleEvent) => void) =>\n this.runtimeContext.onSessionLifecycle(listener);\n\n public readonly registerInstrumentations = (instrumentations: Instrumentation[]) => {\n if (!instrumentations.length) return;\n instrumentations.forEach(instrumentation => {\n instrumentation.setTracerProvider(this.tracerProvider);\n if (!instrumentation.getConfig().enabled) instrumentation.enable();\n });\n this.registeredInstrumentations.push(...instrumentations);\n };\n\n public readonly reportAction = ({ attributes = {}, name }: BkOTActionEventPayload) => {\n if (!this.isSampled()) {\n return;\n }\n const actionId = createRandomId('action');\n const occurredAt = Date.now();\n const span = this.startSpan(\n `action.${name}`,\n {\n ...this.config.hooks.getPageAttributes(),\n ...attributes,\n ...buildRumSpanAttributes({\n spanType: RUM_SPAN_TYPE.action,\n }),\n [RUM_ATTRIBUTES.actionId]: actionId,\n [RUM_ATTRIBUTES.actionType]: 'custom',\n },\n { startTime: occurredAt },\n );\n span.end(occurredAt);\n };\n\n public readonly reportCustomEvent = ({ attributes = {}, error, name }: BkOTCustomEventPayload) => {\n if (!this.isSampled()) {\n // 未采样时静默丢弃;如需调试请把 debug 选项打开\n if (this.config.debug) {\n globalThis.console?.warn('[bk-ot] custom event dropped (not sampled):', name);\n }\n return;\n }\n\n const occurredAt = Date.now();\n const span = this.startSpan(\n `custom.${name}`,\n {\n ...this.config.hooks.getPageAttributes(),\n ...this.config.hooks.getCustomAttributes(),\n ...attributes,\n ...buildRumSpanAttributes({\n outcome: error ? RUM_SPAN_OUTCOME.error : RUM_SPAN_OUTCOME.success,\n spanType: RUM_SPAN_TYPE.custom,\n }),\n },\n { startTime: occurredAt },\n );\n\n if (error) {\n span.recordException(error);\n span.setStatus({\n code: SpanStatusCode.ERROR,\n message: error.message,\n });\n }\n\n span.end(occurredAt);\n };\n\n public readonly setRuntimeAttributes = (attributes: Attributes, changedAt?: number) => {\n const nextAttributes = { ...attributes };\n const effectiveChangedAt = changedAt ?? Date.now();\n if (RUM_ATTRIBUTES.sessionId in attributes) {\n // 采样以 Session 为边界重新计算,并保存在运行时私有历史中。\n const sessionId = attributes[RUM_ATTRIBUTES.sessionId];\n this.sampled =\n this.config.enabled && typeof sessionId === 'string' && sessionId.length > 0\n ? isBkOTSampled(this.config, sessionId)\n : false;\n this.runtimeContext.setSessionSampled(this.sampled, effectiveChangedAt);\n }\n this.runtimeContext.setAttributes(nextAttributes, effectiveChangedAt);\n };\n\n public readonly setTrackingConsent = async (consent: BkOTTrackingConsent) => {\n if (this.config.trackingConsent === consent) return;\n this.config.trackingConsent = consent;\n if (this.phase !== 'started') return;\n if (consent === 'granted') await this.startCollection();\n else await this.stopCollection(true);\n };\n\n public readonly setUser = (user: BkOTUserContext) => {\n this.runtimeContext.setUser(user);\n };\n\n public readonly setViewLoadingTime = () => {\n if (this.isSampled()) this.runtimeContext.dispatchViewCommand({ time: Date.now(), type: 'set_loading_time' });\n };\n\n public readonly setViewName = (name: string) => {\n if (this.isSampled()) this.runtimeContext.dispatchViewCommand({ name, type: 'set_name' });\n };\n\n public readonly shutdown = async () => {\n if (this.phase === 'stopped') {\n return;\n }\n await this.stopCollection(false);\n await this.flushProviders();\n while (this.teardownCallbacks.length) {\n this.teardownCallbacks.pop()?.();\n }\n await this.tracerProvider.shutdown();\n this.phase = 'stopped';\n };\n\n public readonly start = async () => {\n if (this.phase === 'started' || this.phase === 'starting') {\n return;\n }\n if (this.phase === 'stopped') {\n // shutdown 已经销毁了 provider/processor,此处禁止再次启动\n throw new Error('[bk-ot] instance has been shut down and cannot be restarted; create a new instance instead.');\n }\n if (!this.config.enabled) {\n this.phase = 'started';\n return;\n }\n this.phase = 'starting';\n try {\n await this.startCollection();\n if (typeof window !== 'undefined' && typeof document !== 'undefined') {\n // 页面进入后台或被丢弃前尽力导出批量数据;两个事件并存以覆盖不同浏览器生命周期。\n const flushOnPageHide = () => {\n void this.flush();\n };\n const flushOnHidden = () => {\n if (document.visibilityState === 'hidden') {\n void this.flush();\n }\n };\n window.addEventListener('pagehide', flushOnPageHide);\n document.addEventListener('visibilitychange', flushOnHidden);\n this.teardownCallbacks.push(\n () => window.removeEventListener('pagehide', flushOnPageHide),\n () => document.removeEventListener('visibilitychange', flushOnHidden),\n );\n }\n } catch (error) {\n while (this.teardownCallbacks.length) {\n this.teardownCallbacks.pop()?.();\n }\n await this.stopCollection(false);\n this.phase = 'idle';\n throw error;\n }\n this.phase = 'started';\n };\n\n public readonly startSpan = (name: string, attributes: Attributes = {}, options?: BkOTStartSpanOptions): Span => {\n const contextTime =\n options?.contextTime ?? (typeof options?.startTime === 'number' ? options.startTime : undefined);\n // 返回 provider 创建的 non-recording span,而不是让每个调用方处理 undefined。\n if (!this.isSampled() || (contextTime !== undefined && !this.runtimeContext.isSessionSampledAt(contextTime))) {\n return this.tracer.startSpan(name);\n }\n const runtimeAttributes =\n contextTime === undefined ? this.getRuntimeAttributes() : this.runtimeContext.getAttributesAt(contextTime);\n return this.tracer.startSpan(name, {\n kind: options?.kind ?? SpanKind.INTERNAL,\n links: options?.links,\n startTime: options?.startTime,\n attributes: this.applyRedact({\n ...runtimeAttributes,\n ...attributes,\n }),\n });\n };\n\n public readonly startView = (options: BkOTStartViewOptions = {}) => {\n if (this.isSampled()) this.runtimeContext.dispatchViewCommand({ options, type: 'start' });\n };\n\n public readonly tracer: BkOTRuntimeContext['tracer'];\n\n public readonly use = (plugin: BkOTPlugin): this => {\n this.assertBeforeStart('use');\n this.config.extensions.plugins?.push(plugin);\n return this;\n };\n\n public readonly useInstrumentation = (instrumentation: Instrumentation): this => {\n this.assertBeforeStart('useInstrumentation');\n if (this.config.enabled) this.config.extensions.instrumentations?.push(instrumentation);\n return this;\n };\n\n constructor(inputConfig: BkOTOptions) {\n this.config = resolveConfig(inputConfig);\n this.runtimeContext = new RumRuntimeContext({}, this.config.user);\n\n const resource = resourceFromAttributes(this.config.resourceAttributes);\n const spanProcessors = (() => {\n const exporter = wrapWithDebug(\n new OTLPTraceExporter(createExporterOptions(this.config.transport)),\n this.config.debug,\n );\n const processor =\n this.config.spanProcessor === 'simple'\n ? new SimpleSpanProcessor(exporter)\n : new BatchSpanProcessor(exporter, this.config.spanBatch);\n return [\n new FilteringSpanProcessor(processor, this.config, () =>\n this.applyRedact({\n ...this.runtimeContext.getAttributes(),\n ...this.config.hooks.getPageAttributes(),\n }),\n ),\n ];\n })();\n this.tracerProvider = new WebTracerProvider({\n resource,\n sampler: new RumSessionSampler(this.isSampled),\n spanProcessors,\n });\n this.tracer = this.tracerProvider.getTracer(BK_OT_INSTRUMENTATION_NAME);\n this.registeredInstrumentations = [];\n if (this.config.autoStart) {\n void this.start().catch(error => {\n globalThis.console?.warn('[bk-ot] auto start failed:', error);\n });\n }\n }\n}\n","/*\n * Tencent is pleased to support the open source community by making\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) available.\n *\n * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.\n *\n * 蓝鲸智云PaaS平台 (BlueKing PaaS) is licensed under the MIT License.\n *\n * License for 蓝鲸智云PaaS平台 (BlueKing PaaS):\n *\n * ---------------------------------------------------\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n * documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n * to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of\n * the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n\nimport { BkOpenTelemetry } from './core/sdk';\n\nif (typeof window !== 'undefined') {\n Object.assign(window, {\n BkOpenTelemetry,\n });\n}\n\nexport default BkOpenTelemetry;\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,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