{"version":3,"file":"instrumentation.mjs","names":[],"sources":["../../../src/platform/browser/instrumentation.ts"],"sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { InstrumentationAbstract } from '../../instrumentation';\nimport type * as types from '../../types';\nimport type { InstrumentationConfig } from '../../types';\n\n/**\n * Base abstract class for instrumenting web plugins\n */\nexport abstract class InstrumentationBase<\n    ConfigType extends InstrumentationConfig = InstrumentationConfig,\n  >\n  extends InstrumentationAbstract<ConfigType>\n  implements types.Instrumentation<ConfigType>\n{\n  /** Subclasses set this to true when their enable() succeeds and to false in\n   * their disable(); isEnabled() returns it. */\n  protected _enabled = false;\n\n  constructor(\n    instrumentationName: string,\n    instrumentationVersion: string,\n    config: ConfigType\n  ) {\n    super(instrumentationName, instrumentationVersion, config);\n\n    if (this._config.enabled) {\n      this.enable();\n    }\n  }\n\n  /** Returns `_enabled`, which stays false unless the subclass's enable() sets it. */\n  public isEnabled(): boolean {\n    return this._enabled;\n  }\n}\n"],"mappings":";;;;;AAYA,IAAsB,sBAAtB,cAGU,wBAEV;;;CAGE,WAAqB;CAErB,YACE,qBACA,wBACA,QACA;EACA,MAAM,qBAAqB,wBAAwB,MAAM;EAEzD,IAAI,KAAK,QAAQ,SACf,KAAK,OAAO;CAEhB;;CAGA,YAA4B;EAC1B,OAAO,KAAK;CACd;AACF"}